nail_mount.scad 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. include <../config/nail_mount.scad>
  2. include <../config/nail.scad>
  3. include <../config/wall.scad>
  4. include <nail.scad>
  5. include <thread.scad>
  6. function nail_mount_full_height() =
  7. nail_mount_bottom_thickness
  8. + nail_mount_wall_spacer_height
  9. + wall_thickness
  10. - nail_mount_wall_insertion_thickness_margin;
  11. module nail_mount_object() {
  12. module bottom_shape() {
  13. radius = wall_mounting_screws / 2
  14. + nail_mount_padding
  15. + nail_mount_wall_spacer_diameter_padding / 2;
  16. module base() {
  17. circle(r = radius);
  18. }
  19. nail_move = radius - nail_mount_padding / 2;
  20. difference() {
  21. base();
  22. nail_hole_shape(nail_move, 0);
  23. nail_hole_shape(-nail_move, 0);
  24. nail_hole_shape(0, nail_move);
  25. nail_hole_shape(0, -nail_move);
  26. }
  27. }
  28. module bottom_object() {
  29. thickness = nail_mount_bottom_thickness;
  30. linear_extrude(height = thickness, center = true) {
  31. bottom_shape();
  32. }
  33. }
  34. module wall_spacer_shape() {
  35. radius = wall_mounting_screws / 2
  36. + nail_mount_wall_spacer_diameter_padding / 2;
  37. circle(r = radius);
  38. }
  39. module wall_spacer_object() {
  40. thickness = nail_mount_wall_spacer_height;
  41. linear_extrude(height = thickness, center = true) {
  42. wall_spacer_shape();
  43. }
  44. }
  45. module wall_insertion_shape() {
  46. radius = wall_mounting_screws / 2;
  47. circle(r = radius);
  48. }
  49. module wall_insertion_object() {
  50. thickness = wall_thickness
  51. - nail_mount_wall_insertion_thickness_margin;
  52. linear_extrude(height = thickness, center = true) {
  53. wall_insertion_shape();
  54. }
  55. }
  56. move_bottom = nail_mount_bottom_thickness / 2
  57. - nail_mount_full_height() / 2;
  58. move_spacer = nail_mount_wall_spacer_height / 2
  59. + nail_mount_bottom_thickness
  60. - nail_mount_full_height() / 2;
  61. move_insertion = wall_thickness / 2
  62. - nail_mount_wall_insertion_thickness_margin / 2
  63. + nail_mount_wall_spacer_height
  64. + nail_mount_bottom_thickness
  65. - nail_mount_full_height() / 2;
  66. module base_object() {
  67. translate([0, 0, move_bottom]) {
  68. bottom_object();
  69. }
  70. translate([0, 0, move_spacer]) {
  71. wall_spacer_object();
  72. }
  73. translate([0, 0, move_insertion]) {
  74. wall_insertion_object();
  75. }
  76. }
  77. module thread() {
  78. position = nail_mount_full_height() / 2
  79. - thread_height / 2
  80. - nail_mount_thread_thickness;
  81. translate([0, 0, position]) {
  82. thread_object(false, nail_mount_full_height());
  83. }
  84. }
  85. color("#8440bf") {
  86. render() {
  87. difference() {
  88. base_object();
  89. thread();
  90. }
  91. }
  92. }
  93. }
  94. module nail_mount_pressure_shape() {
  95. outside = wall_mounting_screws / 2
  96. + nail_mount_pressure_padding;
  97. inside = thread_screw / 2;
  98. difference() {
  99. circle(r = outside);
  100. circle(r = inside);
  101. }
  102. }
  103. module nail_mount_pressure_object() {
  104. thickness = nail_mount_pressure_thickness;
  105. color("#7BBF40") {
  106. render() {
  107. linear_extrude(height = thickness, center = true) {
  108. nail_mount_pressure_shape();
  109. }
  110. }
  111. }
  112. }