[GRASS-dev] v.out.ogr: faces export added (for KML and friends)

Hi,

inspired by the new Linux version of Google Earth [1]
I have extended v.out.ogr to export faces, the GRASS
3D vectors [2].

With:
v.out.ogr in=buildings_3d dsn=buildings_3d.kml \
           olayer=buildings_3d format=KML type=face
you can generate a KML file of your favourite
3D city (v.extrude helps) and visualize it in
Google Earth.

Note that the KML driver in GDAL-CVS is not complete yet.
This means that the map to be exported needs to be projected
to LongLat first (v.proj).

Enjoy,
Markus

[1] http://earth.google.com/download-earth.html
    -> beta4

[2] http://grass.itc.it/grass61/screenshots/vector.php
--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy

Markus Neteler wrote:

inspired by the new Linux version of Google Earth [1]
I have extended v.out.ogr to export faces, the GRASS
3D vectors [2].

FYI, I have written a simple filter to convert Wavefront .obj to GRASS
vector ascii format as faces. It's a mix of UNIX tools, Matlab [or
Octave] script, and GRASS modules.

[*] .obj is a 3D modelling format, same as Java3D ??

This is less necessary now that Huidae has added 3DFACE support to
v.in.dxf, as there are several OBJ->DXF converters out there- but at
the time I needed it.

I found two shareware programs that could do OBJ->DXF:
"wc2pov27.zip" windows GUI program, works well under Wine.
  http://www.davidhsmith.net/downloaditems/wc2pov27.zip

"3dto3dV35.zip" windows CLI program. worked; not recommened.

I thought I'd post my code for future archive searches anyway.

Wavefront OBJ Specification:
  http://netghost.narod.ru/gff/vendspec/waveobj/

Hamish

(attachments)

obj2grass3d_clean.sh (3.97 KB)

Markus Neteler wrote:

inspired by the new Linux version of Google Earth [1]
I have extended v.out.ogr to export faces, the GRASS
3D vectors [2].

* do you know the status of "kernels"? Are they used by anything?

* must faces be flat polygons or can they be saddle/pringle shaped?

* must the kernel fall on the face surface or do they float inside a
volume defined by the faces?

I know there is no 3D vector topology in GRASS (yet), but I'd like to
try and be future proof where possible.

thanks,
Hamish

On Wed, Jun 14, 2006 at 09:49:36PM +1200, Hamish wrote:

Markus Neteler wrote:
> inspired by the new Linux version of Google Earth [1]
> I have extended v.out.ogr to export faces, the GRASS
> 3D vectors [2].

* do you know the status of "kernels"? Are they used by anything?

AFAIK it is implemented in the format but not used.
(kernels = 3D centroids)

* must faces be flat polygons or can they be saddle/pringle shaped?

I dunno. You can easily test this with v.drape:
2D polygon, drape over DEM

* must the kernel fall on the face surface or do they float inside a
volume defined by the faces?

I assume that kernels can float inside a volume.

Markus

I know there is no 3D vector topology in GRASS (yet), but I'd like to
try and be future proof where possible.

thanks,
Hamish