3D model to DEM, maintain volume?

المشرف العام

Administrator
طاقم الإدارة
Bit of a challenge here which I've been grappling with for some time. I'll explain my full work flow so you can reproduce if needed.

I'm creating virtual landscapes in Google SketchUp which I ultimately would like to use in Netlogo to examine how turtles interact with them.

My problem is that by the time I get the landscapes into Netlogo the units don't seem to relate to the original 3D model.

Step 1: Create simple hill on a 50m by 50m square in Sketchup using the Toposhaper extension.

Step 2: Export to .dae file and import into Meshlab, ensure the Meshlab model has the same dimensions as the Sketchup model by adjusting the units with the assistance of the measuring tool. Export from meshlab as .xyz file.

Step 3: Import .xyz file into QGis as points by adding a new layer from delimited file. Selecting field_1 and field_2 as X and Y fields.

Step 4: Create raster of points using Raster > Interpolation > Interpolation. Add field_3 as interpolation attribute, set number of columns to 50 by 50 (to correspond to the 50m x 50m 3D model). The cell size of X and Y should match exactly to ensure Netlogo will read the resulting .asc file.

Step 5: Finally, I setup a model in Netlogo to receive the raster. Firstly, in model settings I set the the min and max pxor and pycor to 0 and 49 (creating 50 x 50 patches). Then, using the Gis Extension, I import the raster apply the z-value to a patch variable called elevation:

to load-gis set elevation gis:load-dataset "cone_50.asc" gis:set-world-envelope-ds gis:envelope-of elevation gis:apply-raster elevation target-elev end Now, each patch of my 50 by 50 Netlogo world should have an elevation value taken from my 50 by 50 raster. In theory, adding all the elevation values together should (roughly) give me the total volume of the raised area of the hill? The figure I get is higher however and the problem gets worse with larger volumes.

Can anyone help?



أكثر...
 
أعلى