From 6e3806165553d8e0adf96792ac3d3da731f72432 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 1 Oct 2021 08:47:45 +0800 Subject: [PATCH] refactor --- src/polyline3d.scad | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/polyline3d.scad b/src/polyline3d.scad index a4974d5b..1086bb31 100644 --- a/src/polyline3d.scad +++ b/src/polyline3d.scad @@ -28,28 +28,15 @@ module polyline3d(points, diameter, startingStyle = "CAP_CIRCLE", endingStyle = p2Style = styles[1]; line3d(p1, p2, diameter, - p1Style = p1Style, p2Style = p2Style); - - // hook for testing - test_polyline3d_line3d_segment(index, p1, p2, diameter, p1Style, p2Style); - } - - module polyline3d_inner(index) { - if(index < leng_pts) { - line_segment(index); - polyline3d_inner(index + 1); - } + p1Style = p1Style, p2Style = p2Style); } if(leng_pts == 2) { line3d(points[0], points[1], diameter, startingStyle, endingStyle); } else { - polyline3d_inner(1); + for(i = [1:leng_pts - 1]) { + line_segment(i); + } } -} - -// override it to test -module test_polyline3d_line3d_segment(index, point1, point2, diameter, p1Style, p2Style) { - } \ No newline at end of file