[OpenSCAD] Alternate triangulation bug

Ronaldo rcmpersiano at gmail.com
Sun Jan 7 11:26:29 EST 2018


As Parkinbot remarked recently in another thread, the alternate triangulation
OpenSCAD builds for non-triangular faces has some bugs. I could isolate a
small example where this comes clear. The code is a simple polyhedron (fully
inside an intercepting cube) with many triangular faces and 2 quadrangular
faces. The list faces0 contains just the triangular faces; faces1 includes
the 2 quadrangular faces and faces2 is the same as faces1 with the
quadrangular faces explicitly subdivided in triangles. The polyhedron
defined with faces2 renders fine. With faces0, it renders with a warning
(non-manifold) because of the 2 missing faces. With faces1, we get an access
violation from CGAL. I checked it with version 2017.08.31 (git c6f3f0d) in a
Windows 7 environment.

verts = [[107.118, 20.796, 3.69206], [101.912, 18.7279, -9.29348], [89.8439,
13.9336, -3.69206], [95.0496, 16.0017, 9.29348], [91.3134, 60.0577,
3.69206], [86.6335, 56.9797, -9.29348], [75.7842, 49.844, -3.69206],
[80.4641, 52.9221, 9.29348], [61.5224, 90.1203, 3.69206], [57.5616, 86.1595,
-9.29348], [48.3794, 76.9773, -3.69206], [52.3402, 80.9381, 9.29348]];
;

faces0 = [[0, 5, 1], [0, 4, 5], [1, 6, 2], [1, 5, 6], [2, 7, 3], [2, 6, 7],
[3, 4, 0], [3, 7, 4], [4, 9, 5], [4, 8, 9], [5, 10, 6], [5, 9, 10], [6, 11,
7], [6, 10, 11], [7, 8, 4], [7, 11, 8]];

faces1 = concat(faces0, [ [0, 1, 2, 3], [11, 10, 9, 8]] );

faces2 =  concat( faces0, [ [0, 1, 2], [0, 2, 3], [8, 11, 10], [8, 10, 9]]
);

intersection(){ 
  translate([0,0,-100]) cube(200);
  polyhedron( verts, faces1);
//  polyhedron( verts, faces0);
//  polyhedron( verts, faces2);
}

 



--
Sent from: http://forum.openscad.org/




More information about the Discuss mailing list