strong_angler.scad 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. include <../config/strong_angler.scad>
  2. function strong_angler_size() = [
  3. (
  4. strong_angler_target_screws_margin
  5. * strong_angler_target_screws_count.x
  6. + strong_angler_target_screws_margin
  7. ),
  8. (
  9. strong_angler_target_screws_margin
  10. * strong_angler_target_screws_count.y
  11. + strong_angler_target_screws_margin
  12. ),
  13. strong_angler_height
  14. ];
  15. module strong_angler_target_cutoff(oversized = false) {
  16. diameter = strong_angler_target_screw_diameter;
  17. padding = strong_angler_target_screw_padding;
  18. margin = strong_angler_target_screws_margin;
  19. width = strong_angler_size().x;
  20. height = strong_angler_size().y;
  21. move_x = width / 2 - margin;
  22. move_y = height / 2 - margin;
  23. module hole(vector_x = 0, vector_y = 0) {
  24. translate([vector_x, vector_y]) {
  25. if (oversized) {
  26. circle(d = diameter + padding * 2);
  27. } else {
  28. circle(d = diameter);
  29. }
  30. }
  31. }
  32. for (count_x = [-move_x : margin : move_x]) {
  33. for (count_y = [-move_y : margin : move_y]) {
  34. hole(count_x, count_y);
  35. }
  36. }
  37. }
  38. module strong_angler_wall_cutoff(oversized = false) {
  39. diameter = strong_angler_wall_screw_diameter;
  40. padding = strong_angler_wall_screw_padding;
  41. if (oversized) {
  42. circle(d = diameter + padding * 2);
  43. } else {
  44. circle(d = diameter);
  45. }
  46. }
  47. module strong_angler_object() {
  48. width = strong_angler_size().x;
  49. depth = strong_angler_size().y;
  50. height = strong_angler_size().z;
  51. rounding = strong_angler_rounding;
  52. thickness = strong_angler_thickness;
  53. module corner(vector = [0, 0, 0]) {
  54. translate(vector) {
  55. sphere(r = rounding);
  56. }
  57. }
  58. module base_object() {
  59. move_x = width / 2 - rounding;
  60. move_y = depth / 2 - rounding;
  61. move_z = height / 2 - rounding;
  62. hull() {
  63. corner([move_x, move_y, move_z]);
  64. corner([-move_x, move_y, move_z]);
  65. corner([move_x, -move_y, move_z]);
  66. corner([-move_x, -move_y, move_z]);
  67. corner([move_x, move_y, -move_z]);
  68. corner([-move_x, move_y, -move_z]);
  69. }
  70. }
  71. module target_cutoff() {
  72. move_z = height / 2;
  73. move_top = move_z - thickness / 2;
  74. thickness_bottom = height - thickness;
  75. move_bottom = move_top - thickness / 2 - thickness_bottom / 2;
  76. translate([0, 0, move_top]) {
  77. linear_extrude(height = thickness, center = true) {
  78. strong_angler_target_cutoff(oversized = false);
  79. }
  80. }
  81. translate([0, 0, move_bottom]) {
  82. linear_extrude(height = thickness_bottom, center = true) {
  83. strong_angler_target_cutoff(oversized = true);
  84. }
  85. }
  86. }
  87. module wall_cutoff() {
  88. move_y = depth / 2;
  89. move_top = move_y - thickness / 2;
  90. bottom_thickness = depth - thickness;
  91. move_bottom = move_top - bottom_thickness / 2 - thickness / 2;
  92. module hole(size = 0, oversized = false) {
  93. rotate([90, 0, 0]) {
  94. linear_extrude(height = size, center = true) {
  95. strong_angler_wall_cutoff(oversized);
  96. }
  97. }
  98. }
  99. translate([0, move_top, 0]) {
  100. hole(thickness, false);
  101. }
  102. translate([0, move_bottom, 0]) {
  103. hole(bottom_thickness, true);
  104. }
  105. }
  106. module final_object() {
  107. difference() {
  108. base_object();
  109. target_cutoff();
  110. wall_cutoff();
  111. }
  112. }
  113. color("#404080") {
  114. render() {
  115. final_object();
  116. }
  117. }
  118. }