plate.scad 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. include <../config/plate.scad>
  2. include <ATX.scad>
  3. module plate_shape() {
  4. size = plate_size;
  5. holes = plate_holes;
  6. padding = plate_padding;
  7. hole = plate_hole;
  8. module corner(x = 0, y = 0) {
  9. translate([x, y]) {
  10. circle(r = padding);
  11. }
  12. }
  13. module board_mount_hole(hole = [0, 0]) {
  14. translate(hole) {
  15. circle(r = hole / 2);
  16. }
  17. }
  18. module base_shape() {
  19. hull() {
  20. move_x = size[0] / 2;
  21. move_y = size[1] / 2;
  22. corner(move_x, move_y);
  23. corner(-move_x, move_y);
  24. corner(move_x, -move_y);
  25. corner(-move_x, -move_y);
  26. }
  27. }
  28. module shape_with_mobo_mount() {
  29. difference() {
  30. base_shape();
  31. for (hole = holes) {
  32. board_mount_hole(hole);
  33. }
  34. }
  35. }
  36. shape_with_mobo_mount();
  37. }
  38. module plate_object() {
  39. linear_extrude(height = plate_thickness, center = true) {
  40. plate_shape();
  41. }
  42. }