I had some trouble uploading a model built in OpenSCAD to Shapeways.
After some consultation with Shapeways support, the problem was
tracked down to zero-area faces being detected as self-intersections.
You can see some examples of problematical triangulation circled in:
(The simplified model shown there is attached to this email.) What you
see is the so-called T-vertex where it looks like one edge is meeting
at the middle of another edge, but really, there's a zero-width
triangle in between.
I looked into what was causing this, and in detail what's going on is
that during the Nef_polyhedron_3 to Polyhedron_3 conversion in the STL
export process, CGAL is picking bad triangulations of polygonal facets
- a tetrahedral face:
With A, B, C collinear is sometimes triangulated as:
(ASCII art may not survive email.) After some dead-ends, I tried
making the following two line change to Nef_polyhedron.h in my CGAL
And got much better results after recompiling OpenSCAD - the
T-vertices were gone, and the resulting triangulation contained many
less pathologically skinny triangles. On more complex models, it
definitely looked like the result would be much easier to
hand-manipulate, if you wanted to do that. The results for the model
in the earlier screenshot can be seen in:
(In terms of performance it seems slightly slower, but the export is
still many times faster than the CGAL rendering step.)
So I'm wondering:
- Have other people hit this sort of problem?
- How did you deal with it?
- What are the possibilities for a real fix other than people hacking
up their CGAL sources? I thought of adding a post-process step on the
generated Polyhedron_3 which puts back together adjacent coplanar
triangles into the original planar facets and retriangulates them, but
that's just silly.