FW: Rendering problem about importing dxf file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: Rendering problem about importing dxf file

MichaelAtOz
Administrator
This bounced. Resending to list.

> -----Original Message-----
> From: ericlau [mailto:[hidden email]]
> Sent: Fri, 12 Jan 2018 10:21
> To: [hidden email]
> Subject: Rendering problem about importing dxf file
>
> I'm a new user of OpenSCAD and just met a rendering problem. Could you help
> to solve it?
>
> Rendering success:
> - Use linear_extrude() for a dxf file and display a sphere.
> - Only use rotate_extrude() for a dxf file.
>
> Rendering fail:
> - Use rotate_extrude() for a dxf file and display a
> sphere.
>
> Here is the error message:
> ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
> violation! Expr: e->incident_sface() != SFace_const_handle() File:
> /Users/kintel/code/OpenSCAD/openscad/../libraries/install/include/CGAL/Nef_S2/SM_const_decorator.
> h
> Line: 329
>
> Here is my source code:
> /**************
> **************/
> module loadFile() {
>     rotate_extrude()
>         import("import_exercise.dxf");
> }
>
> module loadSphere() {
>     translate([0,0,-30])
>         sphere(10);
> }
>
> loadFile();
> loadSphere();
> /**************
> **************/
>
> Here is the scad file:
> https://drive.google.com/file/d/1dT84jAzTGn-FxavEXamVivUwODelRqLS/view?usp=sharing
> <https://drive.google.com/file/d/1dT84jAzTGn-FxavEXamVivUwODelRqLS/view?usp=sharing>
>
> Here is the dxf file:
> https://drive.google.com/file/d/1XhjWkydDVEnrn-vYcJOT5-yIjSRtdQaT/view?usp=sharing
> <https://drive.google.com/file/d/1XhjWkydDVEnrn-vYcJOT5-yIjSRtdQaT/view?usp=sharing>
>
> <http://forum.openscad.org/file/t2130/screenshot_preview.png>
>
> <http://forum.openscad.org/file/t2130/screenshot_render.png>
>
> <http://forum.openscad.org/file/t2130/screenshot_render_success.png>
>
> Thank you!
>
>
>
> --
> Sent from: http://forum.openscad.org/



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: FW: Rendering problem about importing dxf file

cbernhardt
I am not really sure why the DXF will not render with the sphere since it
will render by itself, but I know how to fix it. The image on the left side
of the picture below is the DXF file loaded into AutoCAD.  The blue squares
are the vertices of the figure.  The vertex with the coordinates shown
beside it shows that the X coordinate is 0.000.  If you move this vertex
just slightly in the positive X direction, then it renders with the sphere
with no error message (right side of picture).  I assume the problem lies in
the fact that the DXF file is rotated about the Z axis passing through X=0,
Y=0.
<http://forum.openscad.org/file/t1309/import_exercise_dxf.jpg>



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: FW: Rendering problem about importing dxf file

cacb
In reply to this post by MichaelAtOz
>> I'm a new user of OpenSCAD and just met a rendering problem. Could you
>> help
>> to solve it?
>>
>> Rendering success:
>> - Use linear_extrude() for a dxf file and display a sphere.
>> - Only use rotate_extrude() for a dxf file.
>>
>> Rendering fail:
>> - Use rotate_extrude() for a dxf file and display a
>> sphere.

The problem is that after rotate_extrude, the solid created is
self-intersecting. This is not detected until you attempt to perform a
boolean operation on it, i.e. union with the sphere. To avoid this
problem, make sure the profile you rotate_extrude is not crossing or
touching the x-axis.

For example
translate([0.1,0.0,0.0])import("import_exercise.dxf");

Carsten Arnholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: FW: Rendering problem about importing dxf file

ericlau
In reply to this post by cbernhardt
cbernhardt wrote

> I am not really sure why the DXF will not render with the sphere since it
> will render by itself, but I know how to fix it. The image on the left
> side
> of the picture below is the DXF file loaded into AutoCAD.  The blue
> squares
> are the vertices of the figure.  The vertex with the coordinates shown
> beside it shows that the X coordinate is 0.000.  If you move this vertex
> just slightly in the positive X direction, then it renders with the sphere
> with no error message (right side of picture).  I assume the problem lies
> in
> the fact that the DXF file is rotated about the Z axis passing through
> X=0,
> Y=0.
> &lt;http://forum.openscad.org/file/t1309/import_exercise_dxf.jpg&gt; 
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Thanks cbernhardt. It works! The problem is solved after I add
"translate([1,0,0])" under "rotate_extrude()".



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: FW: Rendering problem about importing dxf file

ericlau
In reply to this post by cacb
cacb wrote

>>> I'm a new user of OpenSCAD and just met a rendering problem. Could you
>>> help
>>> to solve it?
>>>
>>> Rendering success:
>>> - Use linear_extrude() for a dxf file and display a sphere.
>>> - Only use rotate_extrude() for a dxf file.
>>>
>>> Rendering fail:
>>> - Use rotate_extrude() for a dxf file and display a
>>> sphere.
>
> The problem is that after rotate_extrude, the solid created is
> self-intersecting. This is not detected until you attempt to perform a
> boolean operation on it, i.e. union with the sphere. To avoid this
> problem, make sure the profile you rotate_extrude is not crossing or
> touching the x-axis.
>
> For example
> translate([0.1,0.0,0.0])import("import_exercise.dxf");
>
> Carsten Arnholm
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Thanks cacb. It works! The problem is solved after I add
"translate([1,0,0])" under "rotate_extrude()".



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: FW: Rendering problem about importing dxf file

cbernhardt
ericlau:

I'm not sure if this matters in your application, but you might like to
know.  Your DXF file contains what AutoCAD calls a "POLYLINE".  In your case
the POLYLINE is a series of connected line segments.  POLYLINES can also
contain connected line segments and arc segments, but OpenSCAD cannot
properly display the arc  segments unless you "EXPLODE" the POLYLINE into
separate lines and arcs.  I changed the line segments in your DXF file into
arc segments and imported it into OpenSCAD.  You can see the difference in
the picture below.
Charles
<http://forum.openscad.org/file/t1309/arcs_lines.jpg>



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org