1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 17:24:20 +02:00

avoiding "CGAL ERROR: assertion violation"

This commit is contained in:
Justin Lin
2017-05-16 17:10:49 +08:00
parent 3a1a6754cb
commit a966e017a9

View File

@@ -15,11 +15,14 @@ include <__private__/__frags.scad>;
module ring_extrude(shape_pts, radius, angle = 360, twist = 0, scale = 1.0, triangles = "SOLID") {
frags = __frags(radius);
// 359.9999 is for avoiding "CGAL ERROR: assertion violation"
ang = angle == 360 ? 359.9999 : angle;
angle_step = 360 / frags;
as = [for(a = [0:angle_step:angle]) [90, 0, a]];
as = [for(a = [0:angle_step:ang]) [90, 0, a]];
angles = as[len(as) - 1][2] == angle ? as : concat(as, [[90, 0, angle]]);
angles = as[len(as) - 1][2] == ang ? as : concat(as, [[90, 0, ang]]);
pts = [for(a = angles) [radius * cos(a[2]), radius * sin(a[2])]];
polysections(