[GRASSLIST:10514] Dxf and other 3d objects in NVIZ

Hi All,

I’m new to the list but not Grass which i use primarily on Mac OS X. Is there an alternative option to getting 3d objects into NVIZ. I have tried to obtain the v.in.dxf (OpenDWG Toolkit) but have failed.

Has anyone had success with buildings or Windturbines in thier correct geographic positions. I have a ‘.dxf’ instances i would like to import.

Thanks,

Paul Shapley

Hi list,

I've got some problems with r.topidx.

I've used both normal elevation maps and preprocessed (with r.fill.dir) depressionless elevation maps, but the resulting topidx map is full of artifacts

- a lot of -10 values in the resulting topidx map
- with some elevation maps, a kind of gridlike raster pattern is produced, with a background of NULL values and a grid consisting of both -10 and positive values.

Any ideas?

cheers
wouter

Hi,

Since r.topidx tries to calculate topidx values based on the resolution of a
dem, the dem has to have the right resolution. If the resolution is less than
the actual grid size, r.topidx cannot know whether cells within a grid are
sinks or not.

When your elevation data is (assume its resolution is 1):

123
456
789

If the above data has a resolution greater than 1 (let's say 3 here), the
imported raster will look like the following:

111222333
111222333
111222333
444555666
444555666
444555666
777888999
777888999
777888999

Now, GRASS cannot say those duplicated (because of greater resolution) 9 cells
per each grid are really one grid or 9 grids. Similarly, r.topidx treats those values as sinks.

To find the correct resolution of your dem data, run the following script
(find_res.sh my_dem):
---
#!/bin/sh
r.stats -1n "$1" | awk '{
  v = $0
  if(NR > 1 && v != v0){
    if(min_n == 0 || n < min_n)
      min_n = n
    n = 1
    v0 = v
    next
  }
  v0 = v
  n++
}
END{
  print min_n
}'
---

The above script counts the minimum number of duplicated cell values. Now you
want to multiply the current resolution by the printed number.

g.region -p | grep nsres | awk '{print $2}'

  1

find_res.sh my_dem

  3

g.region res=3 # 1 * 3
d.erase
r.topidx in=my_dem ou=topidx

Huidae Cho

On Wed, Feb 22, 2006 at 11:39:36AM +0000, Wouter Buytaert wrote:

Hi list,

I've got some problems with r.topidx.

I've used both normal elevation maps and preprocessed (with r.fill.dir)
depressionless elevation maps, but the resulting topidx map is full of
artifacts

- a lot of -10 values in the resulting topidx map
- with some elevation maps, a kind of gridlike raster pattern is produced, with
a background of NULL values and a grid consisting of both -10 and positive
values.

Any ideas?

cheers
wouter

You can use v.extrude for buildings. I tried it and it is pretty slick.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


From: Paul Shapley p.shapley@gmail.com
Date: Wed, 22 Feb 2006 11:04:53 +0000
To: GRASSLIST@baylor.edu
Subject: [GRASSLIST:10514] Dxf and other 3d objects in NVIZ

Hi All,

I’m new to the list but not Grass which i use primarily on Mac OS X. Is there an alternative option to getting 3d objects into NVIZ. I have tried to obtain the v.in.dxf (OpenDWG Toolkit) but have failed.

Has anyone had success with buildings or Windturbines in thier correct geographic positions. I have a ‘.dxf’ instances i would like to import.

Thanks,

Paul Shapley

I also tried for some time to get 3d shapes from a CAD file into GRASS as 3d vectors. I used lots of different methods - extruded shapes (like v.extrude but in CAD), individual faces/surfaces, etc., and never had anything come out right in GRASS. I was using v.in.ogr to import Microstation .dgn files - which works fine for 2d vectors, and for 2 1/2d vectors – contour lines with elevation – but not for proper 3d objects.

Nick Cahill

On Feb 23, 2006, at 8:19 AM, Michael Barton wrote:

You can use v.extrude for buildings. I tried it and it is pretty slick.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


From: Paul Shapley <p.shapley@gmail.com>
Date: Wed, 22 Feb 2006 11:04:53 +0000
To: <GRASSLIST@baylor.edu>
Subject: [GRASSLIST:10514] Dxf and other 3d objects in NVIZ

Hi All,

I’m new to the list but not Grass which i use primarily on Mac OS X. Is there an alternative option to getting 3d objects into NVIZ. I have tried to obtain the v.in.dxf (OpenDWG Toolkit) but have failed.

Has anyone had success with buildings or Windturbines in thier correct geographic positions. I have a ‘.dxf’ instances i would like to import.

Thanks,

Paul Shapley