Last active
August 29, 2015 13:56
-
-
Save GilesBathgate/9200018 to your computer and use it in GitHub Desktop.
Gear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getR(r,i) = (i%4==i%2)?r:r-1; | |
function gear(r,l=[],i=0) = i>=360?l:gear(r,concat(l,[[getR(r,i)*sin(i),getR(r,i)*cos(i)]]),i+5); | |
function getRange(start,finish,v=[]) = len(v)>finish?v:getRange(start+1,finish,concat(v,start)); | |
linear_extrude(height=2) | |
polygon(gear(r=6),[getRange(0,360/5)]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment