Skip to content

Commit

Permalink
Added a spin module, does what the transformation with the same name …
Browse files Browse the repository at this point in the history
…in Blender does
  • Loading branch information
diara628 committed Feb 16, 2011
1 parent 88bf287 commit 7c56855
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utilities.scad
Expand Up @@ -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;
Expand Down

0 comments on commit 7c56855

Please sign in to comment.