From 9da693e6f9934a6f5e7349f77dd4b88ceb5aa942 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Wed, 3 May 2017 08:50:30 +0800 Subject: [PATCH] supported round_robin --- src/path_extend.scad | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/path_extend.scad b/src/path_extend.scad index 5e034cb1..c7d423e2 100644 --- a/src/path_extend.scad +++ b/src/path_extend.scad @@ -34,8 +34,6 @@ module path_extend(stroke_pts, path_pts, scale = 1.0, round_robin = false) { scale_step = (scale - 1) / (leng_path_pts - 1); - echo(scale_step); - function first_stroke() = let( p1 = path_pts[0], @@ -63,8 +61,12 @@ module path_extend(stroke_pts, path_pts, scale = 1.0, round_robin = false) { [stroke(path_pts[index - 1], path_pts[index], index)], path_extend_inner(index + 1) ); - if(round_robin && path_pts[0] == path_pts[leng_path_pts - 1]) { + if(round_robin && path_pts[0] == path_pts[leng_path_pts - 1]) { + strokes = path_extend_inner(1); + polytransversals( + concat(strokes, [strokes[0]]) + ); } else { polytransversals( concat([first_stroke()], path_extend_inner(1))