From 7c56855186b230f3a928bc0f8a6ac79eb91fb697 Mon Sep 17 00:00:00 2001 From: Elmom Date: Wed, 16 Feb 2011 11:51:46 +0200 Subject: [PATCH] Added a spin module, does what the transformation with the same name in Blender does --- utilities.scad | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utilities.scad b/utilities.scad index 174d4ba..6d6468d 100644 --- a/utilities.scad +++ b/utilities.scad @@ -23,6 +23,16 @@ function angle(v) = angleOfNormalizedVector(normalized(v)); function angleBetweenTwoPoints(a, b) = angle(normalized(b-a)); +// TODO check that the axis parameter works as intended +// Duplicate everything $no of times around an $axis, for $angle/360 rounds +module spin(no, angle=360, axis=[0, 0, 1]){ + for (i = [0:no]){ + rotate(normalized(axis)*angle*i/no) union(){ + for (i = [0 : $children-1]) child(i); + } + } +} + CENTER = 0; LEFT = -0.5;