Re: DXF & imp3D
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: DXF & imp3D
- From: Roberto Sierra <73557.2101 at compuserve.com>
- Date: 24 Jun 93 03:31:22 EDT
Regarding Mitja Lakner's problems with WriteDXF:
> I have problems with WriteDXF (only with ImplicitPlot3D).
>
> g = ImplicitPlot3D[E^z Cos[x] == Cos[y],
> {x,-6,6}, {y,-6,6}, {z,-6,6},
> PlotPoints->{16,16,12},
> Passes->4]
> g = Graphics3D[g];
> WriteDXF["g.dxf",g,PolygonsOnly->True]
>
> I get file, but there are (at least) mistakes:
> empty polygons and unevaluated fractions.
You can fix DXF.m by making the following changes:
(1) EMPTY POLYGONS
In the definition of WriteDXF, change
parts = Cases[pic,(Polygon[_?(Length[#] <= 4 &)] |
_Line | _Point),
to
parts = Cases[pic,(Polygon[_?(0 < Length[#] <= 4 &)] |
_Line | _Point),
(2) UNEVALUATED FRACTIONS
In the definition of writegroup, change
WriteString[stream,rightjustifynum[code],cr,
ToString[CForm[it]],cr]
to
WriteString[stream,rightjustifynum[code],cr,
ToString[CForm[N[it]]],cr]
This seems to fix the specific problems you encountered, though
I don't have AutoCAD to fully test the DXF output. Hope this
helps.
P.S.
In your original message, the line
g = Graphics3D[g];
will cause problems, since the output from ImplicitPlot3D is
already a Graphics3D object. There is no need to coerce it.
\\|//
- -
o o
J roberto sierra
O tempered microdesigns
\_/ 73557.2101 at compuserve.com