From ac2c4204870487e508e452203016e4ffc03701b6 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 1 Oct 2021 08:46:08 +0800 Subject: [PATCH] refactor --- src/polyline2d.scad | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/polyline2d.scad b/src/polyline2d.scad index 0c1c375d..e48e7ad3 100644 --- a/src/polyline2d.scad +++ b/src/polyline2d.scad @@ -32,16 +32,6 @@ module polyline2d(points, width = 1, startingStyle = "CAP_SQUARE", endingStyle = line2d(points[index - 1], points[index], width, p1Style = p1Style, p2Style = p2Style); - - // hook for testing - test_polyline2d_line_segment(index, p1, p2, width, p1Style, p2Style); - } - - module lines(index) { - if(index < leng_pts) { - line_segment(index); - lines(index + 1); - } } function angle(p1, p2, p3) = @@ -90,12 +80,9 @@ module polyline2d(points, width = 1, startingStyle = "CAP_SQUARE", endingStyle = line2d(points[0], points[1], width, startingStyle, endingStyle); } else { - lines(1); + for(i = [1:leng_pts - 1]) { + line_segment(i); + } joins(points, width / 2, leng_pts - 2, 0); } -} - -// override it to test -module test_polyline2d_line_segment(index, point1, point2, width, p1Style, p2Style) { - } \ No newline at end of file