hinge.scad 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. include <../config/hinge.scad>
  2. module hinge_object() {
  3. module mount_shape() {
  4. height = hinge_height;
  5. width = hinge_screw + hinge_walls * 2;
  6. radius = width / 2;
  7. move_y = height / 2;
  8. module mount_base() {
  9. hull() {
  10. translate([0, move_y]) {
  11. circle(r = radius);
  12. }
  13. translate([0, -move_y]) {
  14. circle(r = radius);
  15. }
  16. }
  17. }
  18. module mount_holes() {
  19. space = height / (hinge_screws_count - 1);
  20. for (count = [-move_y : space : move_y]) {
  21. translate([0, count]) {
  22. circle(r = hinge_screw / 2);
  23. }
  24. }
  25. }
  26. difference() {
  27. mount_base();
  28. mount_holes();
  29. }
  30. }
  31. module mount_object() {
  32. linear_extrude(height = hinge_thickness, center = true) {
  33. mount_shape();
  34. }
  35. }
  36. mount_object();
  37. }