1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

fix end i

This commit is contained in:
Justin Lin
2019-06-23 09:10:37 +08:00
parent 65119984fd
commit be05e3b68e

View File

@@ -1,7 +1,10 @@
function __lines_from(pts, closed = false) =
let(leng = len(pts))
let(
leng = len(pts),
endi = leng - 1
)
concat(
[for(i = 0; i <= leng; i = i + 1) [pts[i], pts[i + 1]]],
[for(i = 0; i < endi; i = i + 1) [pts[i], pts[i + 1]]],
closed ? [[pts[len(pts) - 1], pts[0]]] : []
);