summaryrefslogtreecommitdiff
path: root/testdata/scad/features/module-recursion.scad
blob: f67a1d04b08d4ff40c1b035e71cfe9fab80033bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module tree(currentScale, levels)
{
  h = currentScale;
  w = currentScale/5;
  childScale = currentScale * 0.7;
  
  if (levels > 0) {
    cylinder(r=w, h=h);
    translate([0,0,h]) for (i = [1:2]) {
      rotate([40, 0, i * 180]) tree(childScale, levels-1);
    }
  }
}

tree(1, 4);
contact: Jan Huwald // Impressum