angler.scad 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. include <../config/angler.scad>
  2. module angler_object() {
  3. depth = angler_depth;
  4. height = angler_height;
  5. width = angler_width;
  6. thickness = angler_thickness;
  7. rounding = thickness / 2;
  8. module outside_shape() {
  9. move_x = angler_depth / 2 - rounding;
  10. move_y = angler_height / 2 - rounding;
  11. hull() {
  12. translate([-move_x, move_y]) {
  13. square(rounding * 2, center = true);
  14. }
  15. translate([move_x, move_y]) {
  16. circle(r = rounding);
  17. }
  18. translate([-move_x, -move_y]) {
  19. circle(r = rounding);
  20. }
  21. }
  22. }
  23. module outside_object() {
  24. rotate([90, 0, 0]) {
  25. linear_extrude(height = angler_thickness, center = true) {
  26. outside_shape();
  27. }
  28. }
  29. }
  30. module inside_shape() {
  31. move_x = depth / 2 - rounding;
  32. move_y = height / 2 - rounding;
  33. hull() {
  34. translate([-move_x, move_y]) {
  35. square(rounding * 2, center = true);
  36. }
  37. translate([move_x, move_y]) {
  38. circle(r = rounding);
  39. }
  40. }
  41. hull() {
  42. translate([-move_x, move_y]) {
  43. square(rounding * 2, center = true);
  44. }
  45. translate([-move_x, -move_y]) {
  46. circle(r = rounding);
  47. }
  48. }
  49. }
  50. module inside_object() {
  51. rotate([90, 0, 0]) {
  52. size = width - thickness * 2;
  53. linear_extrude(height = size, center = true) {
  54. inside_shape();
  55. }
  56. }
  57. }
  58. module base_object() {
  59. move = width / 2 - thickness / 2;
  60. inside_object();
  61. translate([0, move, 0]) {
  62. outside_object();
  63. }
  64. translate([0, -move, 0]) {
  65. outside_object();
  66. }
  67. }
  68. base_object();
  69. }