From a3ce67b128b47ab55ea3097461864e3ca85f87a6 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 19 May 2017 13:19:03 +0800 Subject: [PATCH] supported twist --- src/along_with.scad | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/along_with.scad b/src/along_with.scad index ed62f2aa..436cae99 100644 --- a/src/along_with.scad +++ b/src/along_with.scad @@ -13,8 +13,10 @@ include <__private__/__angy_angz.scad>; -module along_with(points, angles) { +module along_with(points, angles, twist = 0) { leng_points = len(points); + twist_step_a = twist / leng_points; + echo(twist_step_a); function _path_angles(i = 0) = i == leng_points - 1 ? @@ -38,10 +40,12 @@ module along_with(points, angles) { translate(points[i]) rotate(angs[i]) if(angles_defined) { - children(0); + rotate(twist_step_a * i) + children(0); } else { rotate([90, 0, -90]) - children(0); + rotate(twist_step_a * i) + children(0); } }