Skip to content

Instantly share code, notes, and snippets.

@peterwake
Created March 30, 2020 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterwake/8872c23fb90d75803c2f25964b1b8ed3 to your computer and use it in GitHub Desktop.
Save peterwake/8872c23fb90d75803c2f25964b1b8ed3 to your computer and use it in GitHub Desktop.
OpenJSCad spiral
//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