platform.scad 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. include <../config/platform.scad>
  2. include <../config/thread.scad>
  3. include <../config/wall.scad>
  4. include <thread.scad>
  5. module platform_support_object() {
  6. module base_shape() {
  7. move_x = platform_support_depth / 2 - platform_rounding;
  8. move_y = platform_support_height / 2 - platform_rounding;
  9. size = platform_rounding;
  10. hull() {
  11. translate([-move_x, move_y]) {
  12. square(size * 2, center = true);
  13. }
  14. translate([move_x, move_y]) {
  15. circle(r = size);
  16. }
  17. translate([-move_x, -move_y]) {
  18. circle(r = size);
  19. }
  20. }
  21. }
  22. module base_object() {
  23. thickness = platform_support_thickness;
  24. rotate([90, 0, 0]) {
  25. linear_extrude(height = thickness, center = true) {
  26. base_shape();
  27. }
  28. }
  29. }
  30. module base_thread_object() {
  31. oversize = max(
  32. platform_support_depth,
  33. platform_support_height
  34. );
  35. render() {
  36. thread_object(false, oversize);
  37. }
  38. }
  39. module wall_thread_object(move_y = 0, move_z = 0) {
  40. move_x = -platform_support_depth / 2
  41. + thread_height / 2
  42. + platform_support_screw_thickness;
  43. translate([move_x, move_y, move_z]) {
  44. rotate([0, 270, 0]) {
  45. base_thread_object();
  46. }
  47. }
  48. }
  49. module wall_threads_object() {
  50. base_move_y = platform_support_thickness
  51. - platform_support_thickness % wall_holes_space;
  52. base_move_z = platform_support_height
  53. - platform_support_height % wall_holes_space;
  54. move_y = base_move_y / 2;
  55. move_z = base_move_z / 2;
  56. for (count_y = [-move_y : wall_holes_space : move_y]) {
  57. for (count_z = [-move_z : wall_holes_space : move_z]) {
  58. wall_thread_object(count_y, count_z);
  59. }
  60. }
  61. }
  62. difference() {
  63. base_object();
  64. wall_threads_object();
  65. }
  66. }