diff --git a/src/path_extrude.scad b/src/path_extrude.scad index 7e23a75b..d52ed55f 100644 --- a/src/path_extrude.scad +++ b/src/path_extrude.scad @@ -14,6 +14,9 @@ **/ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale = 1.0) { + + s_pts = len(shape_pts[0]) == 3 ? shape_pts : [for(p = shape_pts) [p[0], p[1], 0]]; + function first_section() = let( p1 = path_pts[0], @@ -25,7 +28,7 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale az = atan2(dy, dx) ) [ - for(p = shape_pts) + for(p = s_pts) rotate_p(p, [0, ay, az]) + p1 ]; @@ -50,7 +53,7 @@ module path_extrude(shape_pts, path_pts, triangles = "RADIAL", twist = 0, scale az = atan2(dy, dx) ) [ - for(p = shape_pts) + for(p = s_pts) let(scaled_p = [p[0] * (1 + scale_step_x * i), p[1] * (1 + scale_step_y * i), p[2]]) rotate_p( rotate_p(scaled_p, twist_step * i) + [0, 0, length],