example007.scad 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. module cutout()
  2. {
  3. intersection()
  4. {
  5. rotate(90, [1, 0, 0])
  6. translate([0, 0, -50])
  7. linear_extrude(height = 100, convexity = 1)
  8. import(file = "example007.dxf", layer = "cutout1");
  9. rotate(90, [0, 0, 1])
  10. rotate(90, [1, 0, 0])
  11. translate([0, 0, -50])
  12. linear_extrude(height = 100, convexity = 2)
  13. import(file = "example007.dxf", layer = "cutout2");
  14. }
  15. }
  16. module clip()
  17. {
  18. difference() {
  19. // NB! We have to use the deprecated module here since the "dorn"
  20. // layer contains an open polyline, which is not yet supported
  21. // by the import() module.
  22. rotate_extrude(
  23. file = "example007.dxf",
  24. layer="dorn",
  25. convexity = 3);
  26. for (r = [0, 90])
  27. rotate(r, [0, 0, 1])
  28. cutout();
  29. }
  30. }
  31. module cutview()
  32. {
  33. difference()
  34. {
  35. difference()
  36. {
  37. translate([0, 0, -10])
  38. clip();
  39. rotate(20, [0, 0, 1])
  40. rotate(-20, [0, 1, 0])
  41. translate([18, 0, 0])
  42. cube(30, center = true);
  43. }
  44. # render(convexity = 5) intersection()
  45. {
  46. translate([0, 0, -10])
  47. clip();
  48. rotate(20, [0, 0, 1])
  49. rotate(-20, [0, 1, 0])
  50. translate([18, 0, 0])
  51. cube(30, center = true);
  52. }
  53. }
  54. }
  55. translate([0, 0, -10])
  56. clip();
  57. // cutview();