[GRASSLIST:1111] Re: [GRASS-user] Re: tin to raster dem

Soeren Gebbert soerengebbert at gmx.de
Sat Jun 17 05:03:58 EDT 2006


Hi Ivan,
what you need is a rasterizer. :)

What do you think about this small algorithm? 

###################################
Use the bounding box of your TIN to set a 2d raster region.

  Calculate for every raster cell the center.
  Now do for every triangle:

    Find all cells within the triangle. 
    Then use the shape functions of the triangle to calculate the height/value for
    every cell center within the triangle.
    Write those values to the corresponding cells.

done
###################################

You have to project the triangle calculations into parametric coordinates, because
shape functions are normaly in parametric space. This is easy for triangles and
quadrangles. But not for polygons with more than five vertices.
But i guess TIN's usually consists of triangles.

You can ask your local computer graphics or FEM experts for help.

Hope this helps a bit
Best regards
Soeren

On Saturday 17 June 2006 10:07, ivan marchesini wrote:
> Hi Laurent,
> not useful!!
> there's not the option (using v.to.rast) for converting a 3d area into a
> raster   :-( 
> 
> 
> Il giorno ven, 16/06/2006 alle 15.39 +0200, Laurent C. ha scritto:
> > 2006/6/16, ivan marchesini <marchesini at unipg.it>:
> >         Hi Laurent, thanks for your answer....
> >         I know that v.surf.* is able to interpolate points and
> >         contours...
> >         but don't have this kind of data and I don't mind to
> >         interpolate points
> >         because I would like to obtain perfect planes in correspondace
> >         of the 
> >         triangles!!! interpolating will obviously create some little
> >         difference
> >         between the elevation of the dem and of the original triangle
> >         surface...
> >         the boundaries that I have are 3d boundaries, they start from
> >         an
> >         elevation and finish to another...
> >         if you can imagine a 3d triangle you can also imagine a raster
> >         dem the
> >         cells of which has the same elevation of the plane in each
> >         point!!!
> >         
> >         I have tried to interpolate the tree points of a 3d
> >         triangle... 
> >         using v.surf.rst and smoothing=0 and tension=1  (for creating
> >         a perfect
> >         plane) but the results is not so fine (please see the small
> >         attached
> >         file, I apologize for this image with the users of the mailing
> >         list)
> >         
> >         I know I can use r.plane for creating a single plane but I
> >         should know
> >         the azimut and deep of the plane... is there a way to obtain
> >         this
> >         information for a 3d triangle??? (not in a manual way
> >         obviously)
> >         
> >         any idea???? 
> >         thanks
> >         
> >         Ivan
> >         
> >         
> >         
> >         
> >         
> >         
> >         
> >         Il giorno ven, 16/06/2006 alle 10.55 +0200, Laurent C. ha
> >         scritto:
> >         > Hi,
> >         > You can try v.surf.*
> >         >
> >         > 2006/6/16, ivan marchesini <marchesini at unipg.it>:
> >         >         Dear all...
> >         >         I have been able to create a tin starting from the
> >         v.delaunay
> >         >         module and
> >         >         then manual editing the v.delaunay output exported
> >         with 
> >         >         v.in.ascii
> >         >         (format=standard)
> >         >         now I can see, using nviz, the some filled triangles
> >         in the
> >         >         3d
> >         >         space...!!!!
> >         >         now the problem:
> >         >         I would like to transfrom the tin surface in a
> >         raster
> >         >         surface...
> >         >         is it possible in some way!!!!
> >         >         any idea????
> > 
> > I see. What sort of result give v.to.rast ?




More information about the grass-user mailing list