example006.scad 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. module example006()
  2. {
  3. module edgeprofile()
  4. {
  5. render(convexity = 2) difference() {
  6. cube([20, 20, 150], center = true);
  7. translate([-10, -10, 0])
  8. cylinder(h = 80, r = 10, center = true);
  9. translate([-10, -10, +40])
  10. sphere(r = 10);
  11. translate([-10, -10, -40])
  12. sphere(r = 10);
  13. }
  14. }
  15. difference()
  16. {
  17. cube(100, center = true);
  18. for (rot = [ [0, 0, 0], [1, 0, 0], [0, 1, 0] ]) {
  19. rotate(90, rot)
  20. for (p = [[+1, +1, 0], [-1, +1, 90], [-1, -1, 180], [+1, -1, 270]]) {
  21. translate([ p[0]*50, p[1]*50, 0 ])
  22. rotate(p[2], [0, 0, 1])
  23. edgeprofile();
  24. }
  25. }
  26. for (i = [
  27. [ 0, 0, [ [0, 0] ] ],
  28. [ 90, 0, [ [-20, -20], [+20, +20] ] ],
  29. [ 180, 0, [ [-20, -25], [-20, 0], [-20, +25], [+20, -25], [+20, 0], [+20, +25] ] ],
  30. [ 270, 0, [ [0, 0], [-25, -25], [+25, -25], [-25, +25], [+25, +25] ] ],
  31. [ 0, 90, [ [-25, -25], [0, 0], [+25, +25] ] ],
  32. [ 0, -90, [ [-25, -25], [+25, -25], [-25, +25], [+25, +25] ] ]
  33. ]) {
  34. rotate(i[0], [0, 0, 1]) rotate(i[1], [1, 0, 0]) translate([0, -50, 0])
  35. for (j = i[2])
  36. translate([j[0], 0, j[1]]) sphere(10);
  37. }
  38. }
  39. }
  40. example006();