platform.scad 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. include <../config/platform.scad>
  2. include <../config/thread.scad>
  3. include <corner.scad>
  4. include <wall.scad>
  5. function platform_full_support_depth()
  6. = platform_support_depth
  7. + thread_height
  8. + platform_thickness;
  9. module platform_mount_object() {
  10. rounding = corner_radius;
  11. holes_width
  12. = platform_width
  13. - rounding * 2
  14. - thread_screw * 2
  15. - platform_side_thickness * 2;
  16. holes_height
  17. = platform_height
  18. - rounding * 2
  19. - thread_screw * 2
  20. - platform_side_thickness;
  21. module base_shape() {
  22. move_x = platform_width / 2 - rounding;
  23. move_y = platform_height / 2 - rounding;
  24. hull() {
  25. corner(move_x, move_y);
  26. corner(-move_x, move_y);
  27. corner(move_x, -move_y);
  28. corner(-move_x, -move_y);
  29. }
  30. }
  31. base_thickness
  32. = platform_thickness
  33. + thread_height;
  34. module base_object() {
  35. linear_extrude(height = base_thickness, center = true) {
  36. base_shape();
  37. }
  38. }
  39. module bottom_object() {
  40. center = base_thickness / 2 - thread_height / 2;
  41. render() {
  42. difference() {
  43. base_object();
  44. translate([0, 0, center]) {
  45. rotate([180, 0, 0]) {
  46. width = holes_width;
  47. height = holes_height;
  48. thickness = platform_thickness;
  49. wall_thread_object(width, height, thickness);
  50. }
  51. }
  52. }
  53. }
  54. }
  55. module side_shape() {
  56. module cutout_shape() {
  57. move_x
  58. = platform_width / 2
  59. - platform_side_thickness
  60. - rounding;
  61. move_top_y
  62. = platform_height / 2
  63. - platform_side_thickness
  64. - rounding;
  65. move_bottom_y
  66. = -platform_height / 2
  67. + rounding;
  68. hull() {
  69. corner(move_x, move_top_y);
  70. corner(-move_x, move_top_y);
  71. corner(move_x, move_bottom_y, false);
  72. corner(-move_x, move_bottom_y, false);
  73. }
  74. }
  75. module bottom_cutout_shape() {
  76. bottom
  77. = rounding / 2
  78. - platform_height / 2;
  79. translate([0, bottom]) {
  80. square([platform_width, rounding], center = true);
  81. }
  82. }
  83. render() {
  84. difference() {
  85. base_shape();
  86. cutout_shape();
  87. bottom_cutout_shape();
  88. }
  89. }
  90. }
  91. module side_object() {
  92. thickness = platform_support_depth;
  93. linear_extrude(height = thickness, center = true) {
  94. side_shape();
  95. }
  96. }
  97. bottom_center
  98. = thread_height / 2
  99. + platform_thickness / 2
  100. - platform_full_support_depth() / 2;
  101. side_center
  102. = platform_support_depth / 2
  103. + thread_height
  104. + platform_thickness
  105. - platform_full_support_depth() / 2;
  106. translate([0, 0, bottom_center]) {
  107. bottom_object();
  108. }
  109. translate([0, 0, side_center]) {
  110. side_object();
  111. }
  112. }