summaryrefslogtreecommitdiff
path: root/bubbles.scad
authorMichael Krelin <hacker@klever.net>2016-06-24 11:26:00 (UTC)
committer Michael Krelin <hacker@klever.net>2016-06-25 19:52:17 (UTC)
commit0bd5c1fd7159694b36ef69694143eef00d442961 (patch) (unidiff)
tree5acf562652b0949b89d3f8da01f941484666face /bubbles.scad
parentb058fc56422523d643e0e30250102fdbae8ea69b (diff)
downloadhotendery-0bd5c1fd7159694b36ef69694143eef00d442961.zip
hotendery-0bd5c1fd7159694b36ef69694143eef00d442961.tar.gz
hotendery-0bd5c1fd7159694b36ef69694143eef00d442961.tar.bz2
Volcano
Diffstat (limited to 'bubbles.scad') (more/less context) (show whitespace changes)
-rw-r--r--bubbles.scad11
1 files changed, 11 insertions, 0 deletions
diff --git a/bubbles.scad b/bubbles.scad
new file mode 100644
index 0000000..2f25938
--- a/dev/null
+++ b/bubbles.scad
@@ -0,0 +1,11 @@
1 module bubbles(size,d=1.2,s=1.8) {
2 maxr=max(d/2,size[1]);
3 scl = [ d/2/maxr, size[1]/maxr, d/2/maxr ];
4 nx = floor((size[0]-2*d)/s); sx = s*nx; x0=(size[0]-sx)/2;
5 nz = floor((size[2]-2*d)/s); sz = s*nz; z0=(size[2]-sz)/2;
6 for(iz=[0:nz]) let(z=z0+s*iz) {
7 for(ix=[0:iz%2?nx-1:nx]) let(x=x0+(iz%2?s/2:0)+s*ix) {
8 translate([x,0,z]) scale(scl) sphere(r=maxr,$fn=30);
9 }
10 }
11 }