mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-03 22:17:25 +02:00
Fixed new rounded_polygon to work with last OpenSCAD release.
Trainling commas in let().
This commit is contained in:
@@ -76,7 +76,7 @@ function rounded_polygon(points, _tangents = undef) = //! Return the rounded pol
|
|||||||
let(
|
let(
|
||||||
len = len(points),
|
len = len(points),
|
||||||
tangents = _tangents ? _tangents : rounded_polygon_tangents(points),
|
tangents = _tangents ? _tangents : rounded_polygon_tangents(points),
|
||||||
arcs = rounded_polygon_arcs(points, tangents),
|
arcs = rounded_polygon_arcs(points, tangents)
|
||||||
) [for(i = [0 : len - 1], last = (i - 1 + len) % len, R = points[i][2]) each [
|
) [for(i = [0 : len - 1], last = (i - 1 + len) % len, R = points[i][2]) each [
|
||||||
vec2(tangents[last][1]), // End of last tangent
|
vec2(tangents[last][1]), // End of last tangent
|
||||||
if(R) // If rounded
|
if(R) // If rounded
|
||||||
@@ -86,7 +86,7 @@ function rounded_polygon(points, _tangents = undef) = //! Return the rounded pol
|
|||||||
arc = arcs[i], // Get corner arc details
|
arc = arcs[i], // Get corner arc details
|
||||||
start = ceil(arc[1] / step + eps), // Starting index
|
start = ceil(arc[1] / step + eps), // Starting index
|
||||||
end = floor((arc[0] + arc[1]) / step - eps), // Ending index
|
end = floor((arc[0] + arc[1]) / step - eps), // Ending index
|
||||||
c = vec2(points[i]), // Centre of arc
|
c = vec2(points[i]) // Centre of arc
|
||||||
) for(j = R > 0 ? [end : -1 : start] : [start : 1 : end], a = j * step) c + r * [cos(a), sin(a)], // Points on the arc
|
) for(j = R > 0 ? [end : -1 : start] : [start : 1 : end], a = j * step) c + r * [cos(a), sin(a)], // Points on the arc
|
||||||
vec2(tangents[i][0])] // Start of next tangent
|
vec2(tangents[i][0])] // Start of next tangent
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user