On 17. mai 2017 16:57, Ronaldo Persiano wrote:

> One example where the

> extrusion of non-simple polygon is accepted as 2-manifold by CGAL follows:

>

> function circle(r) = [for(a=[0:10:360]) r*[cos(a), sin(a)]];

> function reverse(p) = [for(i=[len(p)-1:-1:0]) p[i]];

>

> linear_extrude(2)

> polygon(concat(circle(20),reverse(circle(10))));

> cube(30);

This is a polygon with 74 edges in a single loop. Edge 37 runs from

[20,0] (vertex37) to [10,0] (vertex38) and the final edge 74 runs from

[10,0] (vertex74) to [20,0] (vertex01).

There are coinciding vertices (37/01 and 38/74) and coinciding edges

(37/74 , parallel and overlapping). It is a classic "2*PI problem". I

would classify that as a self intersecting polygon.

If the polygon had been defined with an inner and outer loop instead, it

would be well defined.

It ultimately falls into "undefined behaviour" category when you have a

polygon with either intersecting non-parallel edges or overlapping

parallel edges.

The model by Eric Buijs that "worked" with an offset was in effect also

relying on undefined behaviour for this reason.

Carsten Arnholm

_______________________________________________

OpenSCAD mailing list

[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org