# Terrain modeling

8 messages
Open this post in threaded view
|

## Terrain modeling

 I've been using OpenSCAD with terrain heights from SRTM and also the OS Terrain 50 data  for the UK see http://kitwallace.tumblr.com/tagged/terrain  I'm using Python to extract the height matrix and surface() to generate the object. Files of around 200 x 200 ie. 40,000 points render in about 6 minutes but much larger areas seem never to terminate.  Sharp edges are rather pixilated. So I'm wondering what algorithm is used in the triangulation of surfaces and whether there is scope for improvment.  I'm also tempted to learn about STL by writing my own generator in Python so I'd welcome any hints on suitable algorithms.
Open this post in threaded view
|

## Re: Terrain modeling

Open this post in threaded view
|

## Re: Terrain modeling

Open this post in threaded view
|

## Re: Terrain modeling

 Just to report back on my efforts, I learnt quite a bit about STL and supporting tools writing my own terrain STL generation which I wrote up here: http://kitwallace.tumblr.com/post/78433659932/generating-stl-for-terrain-modelsBottom line is that the Python code was about 100 times faster than OpenSCAD on this special case.  The only change from the obvious faceting of a grid was to chose the triangulation of a square along the diagonal with the lesser gradient.
Open this post in threaded view
|

## Re: Terrain modeling

 kitwallace wrote Bottom line is that the Python code was about 100 times faster than OpenSCAD on this special case.  The only change from the obvious faceting of a grid was to chose the triangulation of a square along the diagonal with the lesser gradient. Just pure surface generation is a lot faster with the unstable branch too, Marius made some quite impressive improvements. The main issue is that as soon as an object with lots of vertices is passed to any CGAL operation, it grinds to a halt. I've converted a grayscale 480x300 pixel picture (http://www.flickr.com/photos/96851846@N05/11740684974/). That stats are quite different: OpenSCAD release version: 45 minutes OpenSCAD development version: 3 seconds! (Print time: 1:53 hours) Note that just a single difference() resulted in a change from 3 seconds to 30 minutes. So there's still a lot room for future improvement. -- Torsten
Open this post in threaded view
|

## Re: Terrain modeling

 In reply to this post by kitwallace Very cool. Did you use SolidPython? I've been using that library, and loving it.