[OpenSCAD] avoiding assertion violation

Dan Shriver tabbydan at gmail.com
Tue Jul 16 21:42:56 EDT 2019


Thanks guys.
----
If it's not my bug but is a kind of error in rotate_extrude I suggest 2
things:

1) in the documentation for rotate_extrude mention that all points must be
>0 for y value.  The documentation I saw mentions it in a way that if you
are skimming through you don't notice right away
"The 2D shape needs to lie completely on either the right (recommended) or
the left side of the Y-axis. More precisely speaking, each vertex of the
shape must have either x >= 0 or x <= 0. If the shape crosses"
I think it would be more clear if the y instructions were written in a
similar vein to the  x instructions ("y>0, or y<0 for all vertices").  I
tend to skim over things quickly and the x stuff jumps out whereas the y
stuff just sort of disappears into the background

2) if the exception message was different, perhaps the code could check for
a bad vertex and tell the user.  It already seems to do that for x values.

I know everyone is busy, I'm just thinking if these suggestions are put on
a list they might get implemented at some point.

On Tue, Jul 16, 2019 at 8:02 PM MichaelAtOz <oz.at.michael at gmail.com> wrote:

> 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.
>
> rotate_extrude(angle=360)
> {
>     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
> thickness.
>
> rotate_extrude(angle=360)
> {
>     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/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190716/a814948d/attachment.html>


More information about the Discuss mailing list