example018.scad 428 B

1234567891011121314151617181920212223
  1. module step(len, mod)
  2. {
  3. for (i = [0:$children-1])
  4. translate([ len*(i - ($children-1)/2), 0, 0 ]) child((i+mod) % $children);
  5. }
  6. for (i = [1:4])
  7. {
  8. translate([0, -250+i*100, 0]) step(100, i)
  9. {
  10. sphere(30);
  11. cube(60, true);
  12. cylinder(r = 30, h = 50, center = true);
  13. union() {
  14. cube(45, true);
  15. rotate([45, 0, 0]) cube(50, true);
  16. rotate([0, 45, 0]) cube(50, true);
  17. rotate([0, 0, 45]) cube(50, true);
  18. }
  19. }
  20. }