Skip to content

Instantly share code, notes, and snippets.

@dokipen
Created January 8, 2014 20:51
Show Gist options
  • Select an option

  • Save dokipen/8324418 to your computer and use it in GitHub Desktop.

Select an option

Save dokipen/8324418 to your computer and use it in GitHub Desktop.
var count = 4;
var dist = 0.3;
var radius = 0.4;
var start = -(count*dist/2);
var last = CSG.sphere({ center: [start, start, 0], radius: radius });
for (var i = 1; i <= count; i++) {
last = CSG.sphere({ center: [start + i*dist, start, 0], radius: radius }).union(last);
}for (var i = 1; i <= count; i++) {
last = CSG.sphere({ center: [start, start + i*dist, 0], radius: radius }).union(last);
}
return last
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment