wall_hanger.scad 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. include <../config/wall_hanger.scad>
  2. include <../config/wall.scad>
  3. function wall_hanger_size() =
  4. wall_mounting_screws * 2;
  5. module wall_hanger_object() {
  6. module base_shape() {
  7. size = wall_hanger_size();
  8. rounding = wall_hanger_rounding;
  9. move = size / 2 - rounding;
  10. small_move = move + rounding / 2;
  11. hull() {
  12. translate([move, -move]) {
  13. square(rounding * 2, center = true);
  14. }
  15. translate([move, move]) {
  16. circle(r = rounding);
  17. }
  18. translate([small_move, small_move]) {
  19. square(rounding, center = true);
  20. }
  21. translate([-move, -move]) {
  22. circle(r = rounding);
  23. }
  24. translate([-small_move, -small_move]) {
  25. square(rounding, center = true);
  26. }
  27. }
  28. }
  29. module base_object() {
  30. size = wall_hanger_size();
  31. module base() {
  32. rotate([270, 180, 0]) {
  33. linear_extrude(height = size, center = true) {
  34. base_shape();
  35. }
  36. }
  37. }
  38. thickness = wall_thickness / 3;
  39. module insertion() {
  40. radius = wall_mounting_screws / 2;
  41. move_z = wall_hanger_size() / 2 - wall_hanger_size() / 2;
  42. move_x = -wall_hanger_size() / 2 - thickness / 2;
  43. translate([move_x, 0, move_z]) {
  44. rotate([90, 0, 90]) {
  45. cylinder(r = radius, h = thickness, center = true);
  46. }
  47. }
  48. }
  49. translate([thickness / 2, 0, 0]) {
  50. base();
  51. insertion();
  52. }
  53. }
  54. base_object();
  55. }