1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-06 23:06:43 +02:00
This commit is contained in:
Justin Lin
2019-09-20 15:45:38 +08:00
parent e6aec7f07e
commit 50903803c3

View File

@@ -11,12 +11,14 @@
module polyline2d(points, width, startingStyle = "CAP_SQUARE", endingStyle = "CAP_SQUARE") { module polyline2d(points, width, startingStyle = "CAP_SQUARE", endingStyle = "CAP_SQUARE") {
leng_pts = len(points); leng_pts = len(points);
s_styles = [startingStyle, "CAP_ROUND"];
e_styles = ["CAP_BUTT", endingStyle];
default_styles = ["CAP_BUTT", "CAP_ROUND"];
module line_segment(index) { module line_segment(index) {
styles = index == 1 ? [startingStyle, "CAP_ROUND"] : ( styles = index == 1 ? s_styles :
index == leng_pts - 1 ? ["CAP_BUTT", endingStyle] : [ index == leng_pts - 1 ? e_styles :
"CAP_BUTT", "CAP_ROUND" default_styles;
]
);
p1 = points[index - 1]; p1 = points[index - 1];
p2 = points[index]; p2 = points[index];