example021.scad 735 B

1234567891011121314151617181920212223242526272829303132
  1. module thing()
  2. {
  3. $fa = 30;
  4. difference() {
  5. sphere(r = 25);
  6. cylinder(h = 62.5, r1 = 12.5, r2 = 6.25, center = true);
  7. rotate(90, [ 1, 0, 0 ]) cylinder(h = 62.5,
  8. r1 = 12.5, r2 = 6.25, center = true);
  9. rotate(90, [ 0, 1, 0 ]) cylinder(h = 62.5,
  10. r1 = 12.5, r2 = 6.25, center = true);
  11. }
  12. }
  13. module demo_proj()
  14. {
  15. linear_extrude(center = true, height = 0.5) projection(cut = false) thing();
  16. % thing();
  17. }
  18. module demo_cut()
  19. {
  20. for (i=[-20:5:+20]) {
  21. rotate(-30, [ 1, 1, 0 ]) translate([ 0, 0, -i ])
  22. linear_extrude(center = true, height = 0.5) projection(cut = true)
  23. translate([ 0, 0, i ]) rotate(+30, [ 1, 1, 0 ]) thing();
  24. }
  25. % thing();
  26. }
  27. translate([ -30, 0, 0 ]) demo_proj();
  28. translate([ +30, 0, 0 ]) demo_cut();