1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-18 04:21:16 +02:00

no more approximation

This commit is contained in:
Justin Lin
2017-05-18 09:36:23 +08:00
parent cf2fe3bbfd
commit 52347bf4c4

View File

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