[OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in CGAL_Nef_polyhedron3():

Parkinbot rudolf at parkinbot.com
Thu Jan 18 09:23:38 EST 2018

cacb wrote
> Experienced users like yourself may "abuse" it to achieve useful special 
> effects like you describe.

Polyhedron and polygon is like Peek and Poke of BASIC. While it opens the
door to hell, it does all the rest, what you can't do with the ordinary
language. History has shown that any accepted language needs such backdoors
and I don't see anything wrong in having some features for power users of
OpenSCAD, as they give most of the qualified feedback and do most of the
testing and "marketing" by producing impressive designs. To be honest,
without polyhedron I would have dropped the language after three weeks of
use, latest. In my eyes it is the real expressive power of OpenSCAD. Why
castrate it - and break a lot of code out there? Because a novice user can
stumble over it? If you offer a solution that differences out several
primitives with little differences, he will stumble at this point. You are
using and propagating AngleScript, because it lets you do things, that
OpenSCAD doesn't let you do. So you will understand this point.
I wouldn't touch these primitives, but opt to more emphazise the difference
between CSG and CGAL in the documentation. Most people especially beginners
don't know this essential difference. 
F6 can (and should) give warnings about improper topologies, like it does
when it finds a singularity. But why should it prevent me with an error from
writing out an improper topology into an STL?  
Why sacrifice parts of the expressive power of CSG (e.g. color), only
because CGAL is not rich enough? There is a F5 and a F6. And they lead into
different worlds. E.g. I use OpenSCAD a lot to produce animations and to
explain things visually. You don't need proper polyhedrons or manifolds for
that, but fast and powerful code.

I would also provide a built-in import function like 

data = import("mystl.stl"); 

that lets me implement all sorts of query and modifier stuff like 

function boundary(data) = ... 

or write code like 

polyhedron(data[0]. data[1]); 

and introduce at least a rudimentary interface for data import in a
standardized format (binary and ASCII). This would offer a pathway to solve
most of the severe problems (like quering a design), more experienced people
run into after having invested some learning time into OpenSCAD and trying
to implement something more sophisticated. Of course the import function
should be extended to support all data formats, OpenSCAD can write out.
Currently one has to write (or find) code that converts these formats into
SCAD code, which is very clumsy.

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

More information about the Discuss mailing list