[GRASS-user] vector export to DXF in 3d ?

Hi all,

how can a 3D vector in GRASS6.4 be exported into a DXF while preserving the 3D content ?

Example: Isohypses are created from the 10m DEM of the spearfish data set by r.contour.

v.info asserts that the newly created vector file is truly 3d. Also v.to.3d flatly refuses to work on the vector layer.

Alas, exporting the vector using v.to.dxf results in a perfectly "flat" DXF.

Does anybody of a good workaround for this one ?

Peter

--
Dr. Peter Löwe
<peter.loewe@gmx.de>

Dear Peter,

I've found that v.out.dxf exports a 2d dxf file, but v.out.ogr produces proper 3d vectors. I've done this with contour lines produced by v.surf.rst and then r.contour; it should work the same, shouldn't it?

Hope this helps.

Nick Cahill

On Oct 9, 2012, at 3:37 PM, Peter Löwe wrote:

Hi all,

how can a 3D vector in GRASS6.4 be exported into a DXF while preserving the 3D content ?

Example: Isohypses are created from the 10m DEM of the spearfish data set by r.contour.

v.info asserts that the newly created vector file is truly 3d. Also v.to.3d flatly refuses to work on the vector layer.

Alas, exporting the vector using v.to.dxf results in a perfectly "flat" DXF.

Does anybody of a good workaround for this one ?

Peter

--
Dr. Peter Löwe
<peter.loewe@gmx.de>

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, Oct 9, 2012 at 5:41 PM, Nick Cahill <ndcahill@wisc.edu> wrote:

Dear Peter,

I've found that v.out.dxf exports a 2d dxf file,

Maybe it does *some* vector types only in 2D? Because I see
x,y,z in several places:

cat vector/v.out.dxf/write_dxf.c | grep '^int \|z'
...
int dxf_point(char *layer, double x, double y, double z)
    fprintf(dxf_fp, "10\n%f\n20\n%f\n30\n%f\n", x, y, z);
...
int dxf_vertex(char *layer, double x, double y, double z)
    fprintf(dxf_fp, "10\n%f\n20\n%f\n 30\n%f\n", x, y, z);
int dxf_text(char *layer, double x, double y, double z, double size, int just,
    fprintf(dxf_fp, "%f\n 30\n%f\n 40\n%f\n 1\n%s\n", y, z, size, text);

It seems that lines and faces are not (yet) exported in 3D.
Knowing how it has to be formatted (maybe learning from v.in.dxf which
supports that) writing them might be just a few lines of code more.

Markus