Discussion:
[OpenSCAD] PolySet has nonplanar faces --> ERROR: CGAL
DarioPellegrini
2018-10-25 14:48:59 UTC
Permalink
I am using v20180923. The minimal example below works with f5 but produces
the following error with f6. Thank you for your attention!

PolySet has nonplanar faces. Attempting alternate construction
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/usr/include/CGAL/Nef_3/SNC_external_structure.h Line: 1153

use <list-comprehension-demos/sweep.scad>points = [ [-1,-1,0], [ 1, 1,0],
[-1, 1,0], [ 1,-1,0]];shape = [ [-1,-1], [-1, 1], [ 1, 1], [
1,-1]];path_transforms = construct_transform_path(5*points);union() {
sweep(shape, path_transforms); cube(5, center=true);}



--
Sent from: http://forum.openscad.org/
DarioPellegrini
2018-10-25 15:06:13 UTC
Permalink
Same behaviour also with version 20181024.



--
Sent from: http://forum.openscad.org/
Ronaldo Persiano
2018-10-26 10:42:17 UTC
Permalink
The path has a self-intersection. Then the polyhedron generated by sweep
will have a self-intersection itself which is not allowed.
Post by DarioPellegrini
Same behaviour also with version 20181024.
--
Sent from: http://forum.openscad.org/
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
DarioPellegrini
2018-10-27 13:23:10 UTC
Permalink
Thank you for your clarification!
Do you think that self-intersections could be allowed somehow?



--
Sent from: http://forum.openscad.org/
Ronaldo Persiano
2018-10-27 14:11:24 UTC
Permalink
No, they are not allowed but might be cicumvented. I would try to split the
path in non self-intersecting sections and union the sweeps build from
then. Something like:

path1 = [ [-1,-1,0], [ 1, 1,0], [-1, 1,0] ];
path2 = [ [-1, 1,0], [ 1,-1,0] ];


Do you think that self-intersections could be allowed somehow?
DarioPellegrini
2018-10-27 14:30:54 UTC
Permalink
I see. The problem is that I encountered this error when playing with things
like this: https://www.thingiverse.com/thing:3179773
...so I may need some more advanced way to circumvent this limitation.



--
Sent from: http://forum.openscad.org/
Ronaldo Persiano
2018-10-28 12:43:23 UTC
Permalink
Em sáb, 27 de out de 2018 às 15:31, DarioPellegrini <
Post by DarioPellegrini
I see. The problem is that I encountered this error when playing with things
like this: https://www.thingiverse.com/thing:3179773
...so I may need some more advanced way to circumvent this limitation.
A radical measure to avoid polyhedron self-intersections with sweep is to
build one polyhedron for each pair of subsequent path points. That strategy
has however a severe drawback: a very lengthy render time. You may find a
code implementing that strategy in:

http://forum.openscad.org/Mirror-rotations-and-sweep-td21256.html

which requires the section to be convex. It is good enough for paths with a
few hundred points.

A more efficient, less radical solution is waiting to be to be written. We
may segment the path in shorter ones without self intersections and apply
the sweep you used to each segment.

Loading...