Created
March 30, 2020 08:54
-
-
Save peterwake/8872c23fb90d75803c2f25964b1b8ed3 to your computer and use it in GitHub Desktop.
OpenJSCad spiral
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
//openjscad.org | |
// Anna and Charlie's spral | |
function main () { | |
const twist = 9; | |
var w = [ ]; | |
for(var i = 0; i < 40; i++) { | |
w.push( | |
color('lightblue', cube({ | |
size: [30, 6, 2] | |
}).translate([0, -3, i*2]) | |
.rotateZ(i * twist)) | |
); | |
w.push( | |
color('lightblue', cube({ | |
size: [30, 6, 2] | |
}).translate([-30, -3, i*2]) | |
.rotateZ(i * twist)) | |
); | |
w.push( | |
color('blue', cube({ | |
size:[30, 6, 2] | |
}).translate([-15, 3, i*2]) | |
.rotateZ(i * twist)) | |
); | |
w.push( | |
color('blue', cube({ | |
size: [30, 6, 2] | |
}).translate([-15, -9, i*2]) | |
.rotateZ(i * twist)) | |
); | |
} | |
return w; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment