From f18044915d81e5677fb3589922b709641b139f31 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Mon, 30 Nov 2020 21:52:42 +0000 Subject: [PATCH] Fixed nan length for rounded_polygon with zero radius corners. --- utils/rounded_polygon.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/rounded_polygon.scad b/utils/rounded_polygon.scad index 54a2962..f69742b 100644 --- a/utils/rounded_polygon.scad +++ b/utils/rounded_polygon.scad @@ -60,7 +60,7 @@ function rounded_polygon_length(points, tangents) = //! Calculate the length giv v1 = p1 - c, v2 = p2 - c, r = abs(corner.z), - a = acos((v1 * v2) / sqr(r))) PI * (cross(v1,v2) <= 0 ? a : 360 - a) * r / 180] + a = acos((v1 * v2) / sqr(r))) r ? PI * (cross(v1, v2) <= 0 ? a : 360 - a) * r / 180 : 0] ) sumv(concat(straights, arcs));