summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-13 12:24:24 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-13 12:24:24 (GMT)
commit7f944e1e25faa8d8c077ba78e4fd489b69270fb5 (patch)
treed9330c7943a585865855e3f3fe3dfdfc400480cd /examples
parent367d7b3244c0091f9ca8b5b39a62c5d49886577c (diff)
Clifford Wolf:
Added child() statement git-svn-id: http://svn.clifford.at/openscad/trunk@275 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'examples')
-rw-r--r--examples/example018.scad23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/example018.scad b/examples/example018.scad
new file mode 100644
index 0000000..15ed745
--- /dev/null
+++ b/examples/example018.scad
@@ -0,0 +1,23 @@
+
+module step(len, mod)
+{
+ for (i = [0:$children-1])
+ translate([ len*(i - ($children-1)/2), 0, 0 ]) child((i+mod) % $children);
+}
+
+for (i = [1:4])
+{
+ translate([0, -250+i*100, 0]) step(100, i)
+ {
+ sphere(30);
+ cube(60, true);
+ cylinder(r = 30, h = 50, center = true);
+
+ union() {
+ cube(45, true);
+ rotate([45, 0, 0]) cube(50, true);
+ rotate([0, 45, 0]) cube(50, true);
+ rotate([0, 0, 45]) cube(50, true);
+ }
+ }
+}
contact: Jan Huwald // Impressum