[OpenSCAD] avoiding assertion violation

MichaelAtOz oz.at.michael at gmail.com
Tue Jul 16 20:01:42 EDT 2019

If you don't do a union, OpenSCAD does it implicitly, at various places,
including a global one.
Union() does not 'clean up', it just joins objects, if they touch properly.

Don't focus too much on the irrational number issue.

Those points are fine in themselves. Such CGAL errors tend to come from
interactions between objects. 

But in this case it comes from the rotate_extrude.

    tip=0; // 0.0001;
    polygon(points=[ [tip, 73.2099], [1, 72.66682], [2, 70.4477], [3,
64.1422], [4, 46.9017], [5, 0] ]);
cube();  // test for CGAL issues

With tip=0 it gets the CGAL error, I initially suspected it may be a bug. At
first glance I would expect it to be able to make such a shape. 
The problem is the tip forms what I call a singularity. If you look at a
sphere it doesn't have such a convergence point. There have been similar
problems with a torus which meets in the middle.

However, I think the problem is at the tip it is infinitely thin. So CGAL
can't tell the difference between the top surface and the inside surface.

A fix is to add a point along the centre axis jut below the tip to provide

    thick=0.2; // this value is a design choice you should make
    polygon(points=[ [0, 73.2099-thick], [0, 73.2099], [1, 72.66682], [2,
70.4477], [3, 64.1422], [4, 46.9017], [5, 0] ]);
cube(1); // test for CGAL issues

That works.

While the base doesn't produce a error, having the taper down to a fine
point is probably asking for trouble.
So I'd also suggest adding a point like [5-0.001, 0] on the end so it isn't
approaching infinitely thin.


Admin - email* me if you need anything, or if I've done something stupid...

* click on my MichaelAtOz label, there is a link to email me.

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!
Sent from: http://forum.openscad.org/

More information about the Discuss mailing list