[OpenSCAD] avoiding assertion violation

Carsten Arnholm arnholm at arnholm.org
Wed Jul 17 09:59:27 EDT 2019


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.png
Type: image/png
Size: 14476 bytes
Desc: not available
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190717/b93b4c8b/attachment.png>


More information about the Discuss mailing list