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

add closed param

This commit is contained in:
Justin Lin
2019-05-29 09:11:01 +08:00
parent 7dbfbc3741
commit 561e2b69b1

View File

@@ -1,7 +1,7 @@
function __edges_from(pts) =
function __edges_from(pts, closed = true) =
let(leng = len(pts))
concat(
[for(i = [0:leng - 2]) [pts[i], pts[i + 1]]],
[[pts[len(pts) - 1], pts[0]]]
closed ? [[pts[len(pts) - 1], pts[0]]] : []
);