# Getting from a DEM to points that could be used for a TIN

I have a DEM, and would like to create a set of points that I can use to make a mesh for a 3d modeling program, such as Maya, Blender, or SketchUp. If I were to make a TIN from a DEM in ArcGIS, ArcGIS would create a greater density of points in areas where the slope changes.

How should I perform a similar process using open source tools? Do you know what algorithm is used for sampling points in a DEM to create a TIN?

I'm looking for a solution that would produce less points than the number of pixels, and in locations where the DEM is more flat, produces less points. The best solution for me would use python or command line tools and result in either a mesh-like geometry or points that could easily be triangulated to create a mesh.

Thanks.

[EDIT: would classifying areas by some combination of slope and aspect be a first step? maybe then I could put points along the borders of these areas?]

The 3D version of the Douglas-Peucker filtering algorithm deals solves this issue. See this answer to this question. I do not know if it is implemented in any software, sorry.

The GRASS wiki has a high level overview of how to do this: Triangle Meshes and TINs.

• Thanks Swingley, it looks like there was a feature produced in GRASS called r.refine (by Jonathan Todd and Laura Toma) which would do precisely what I want, but I can't find any documentation on the module. However, Jonathan Todd presented a paper at FOSS4G 2006 that explains the algorithm:2006.foss4g.org/… Mar 31, 2011 at 6:11
• The other tools described in your link don't appear to do what I am looking for. Most describe ways of getting a DEM from point data or building a TIN from a predetermined set of points. and thank you. Mar 31, 2011 at 21:45

If you want to use GRASS you can use the r.to.vect module which will convert all pixels to point objects. Usage would be: `r.to.vect input=dem output=DEMPoints feature=point`

Note: Untested

• Thanks Nathan. I should clarify: I'm looking for a solution that would produce less points than the number of pixels, and in locations where the DEM is more flat, produces less points. Mar 31, 2011 at 1:33
• Ahh well I'm sure that can be done by someone. A little bit out of my GRASS skills. Mar 31, 2011 at 1:36
• maybe using r.slope.aspect, r.reclass (based on a set of slope ranges), then r.to.vect, to create points at the edges of the same-slope areas? never worked with GRASS, but it looks well-made for this sort of thing. Mar 31, 2011 at 2:16