Advertisement
pcwizz

Untitled

Mar 22nd, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. module edgeprofile()
  2. {
  3. render(convexity = 2) difference() {
  4. cube([20, 20, 150], center = true);
  5. translate([-10, -10, 0])
  6. cylinder(h = 80, r = 10, center = true);
  7. translate([-10, -10, +40])
  8. sphere(r = 10);
  9. translate([-10, -10, -40])
  10. sphere(r = 10);
  11. }
  12. }
  13.  
  14. difference()
  15. {
  16. cube(100, center = true);
  17. for (rot = [ [0, 0, 0], [1, 0, 0], [0, 1, 0] ]) {
  18. rotate(90, rot)
  19. for (p = [[+1, +1, 0], [-1, +1, 90], [-1, -1, 180], [+1, -1, 270]]) {
  20. translate([ p[0]*50, p[1]*50, 0 ])
  21. rotate(p[2], [0, 0, 1])
  22. edgeprofile();
  23. }
  24. }
  25. for (i = [
  26. [ 0, 0, [ [0, 0] ] ],
  27. [ 90, 0, [ [-20, -20], [+20, +20] ] ],
  28. [ 180, 0, [ [-20, -25], [-20, 0], [-20, +25], [+20, -25], [+20, 0], [+20, +25] ] ],
  29. [ 270, 0, [ [0, 0], [-25, -25], [+25, -25], [-25, +25], [+25, +25] ] ],
  30. [ 0, 90, [ [-25, -25], [0, 0], [+25, +25] ] ],
  31. [ 0, -90, [ [-25, -25], [+25, -25], [-25, +25], [+25, +25] ] ]
  32. ]) {
  33. rotate(i[0], [0, 0, 1]) rotate(i[1], [1, 0, 0]) translate([0, -50, 0])
  34. for (j = i[2])
  35. translate([j[0], 0, j[1]]) sphere(10);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement