[OpenSCAD] avoiding assertion violation

nop head nop.head at gmail.com
Wed Jul 17 10:19:19 EDT 2019


Rotate extrude and linear extrude, polygon, etc, all work outside CGAL with
PolySets. Only when you need a CSG op is it converted to a Nef_Polyhedron
and fed to CGAL, which then barfs as I stated. It doesn't accept self
intersecting geometry.

On Wed, 17 Jul 2019 at 15:00, Carsten Arnholm <arnholm at arnholm.org> wrote:

> On 17.07.2019 15:23, nop head wrote:
> > How does it differ from the OP's?
>
> We might perhaps know if the source is posted.
>
> The claim that touching the Y-axis in a single point is causing
> assertion when used in rotate_extrude can be tested:
>
> rotate_extrude(){
>    polygon([ [0,0],[2,-2], [2,2] ]);
> }
>
> This works fine in OpenSCAD 2019.03.31 and it can be exported
> successfully to various formats, including OFF (sing1.off, vertices=15
> faces=28) and STL (sing1.stl, vertices=84 faces=28).
>
> The assertion occurs in OpenSCAD if you try to union with a cube:
>
> rotate_extrude(){
>    polygon([ [0,0],[2,-2], [2,2] ]);
> }
> cube(1);
>
> Or this way, it also gives an assertion
>
> import("./sing1.stl");
> cube(1);
>
>
> Now, if you import the OpenSCAD-generated model into AngelCAD
> (OFF-version) and union it with a cube as above and save it as test2.off:
>
> // AngelCAD code.
> shape@ main_shape()
> {
>     polyhedron p("./sing1.off");
>     return p + cube(1);
> }
>
> In this case there is no problem, it works fine as shown in enclosed PNG
> image, and
>
> ===
>
> $ polyfix test2.off
>
> Parameters:
>    input_file = test2.off
>
>
> polyhedron 0 ================= volume=29.4181, dtol=0.01, atol=1e-06,
> maxiter=10
> iteration 0: vertices=20 faces=38
>               total changes=0
>               no warnings
>
> Summary:
>               polyhedron 0: vertices=20 faces=38 : no warnings
>
> ====
>
>
> Therefore, the problem seen in OpenSCAD is not really in rotate_extrude,
> but how the model is interpreted when subject to union using CGAL. The
> same union using Carve works fine as should be expected.
>
>
> Carsten Arnholm
> _______________________________________________
> 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/20190717/3c416d5f/attachment.html>


More information about the Discuss mailing list