lucky_bamboo_pot.scad 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. include <geometry.scad>
  2. include <../config/lucky_bamboo_pot.scad>
  3. module lucky_bamboo_pot_top_base_shape() {
  4. half_depth = lucky_bamboo_pot_top_depth / 2;
  5. move_x = lucky_bamboo_pot_top_width / 2 - lucky_bamboo_pot_top_depth / 2;
  6. hull() {
  7. translate([-move_x, 0]) {
  8. rotate(90) {
  9. circle(r = half_depth);
  10. }
  11. }
  12. translate([move_x, 0]) {
  13. rotate(270) {
  14. circle(r = half_depth);
  15. }
  16. }
  17. }
  18. }
  19. module lucky_bamboo_pot_top_mounting_hole_shape() {
  20. circle(r = lucky_bamboo_pot_mounting_hole_diameter / 2);
  21. }
  22. module lucky_bamboo_pot_bamboo_holes_shape() {
  23. size = lucky_bamboo_pot_bamboo_diameter * 3;
  24. full_width = lucky_bamboo_pot_top_width - lucky_bamboo_pot_top_depth * 2;
  25. top_width = full_width - full_width % size;
  26. bottom_width = top_width - size;
  27. move_y = lucky_bamboo_pot_top_depth / 4;
  28. for (count = [-top_width / 2 : size : top_width / 2]) {
  29. translate([count, move_y]) {
  30. circle(r = lucky_bamboo_pot_bamboo_diameter / 2);
  31. }
  32. }
  33. for (count = [-bottom_width / 2 : size : bottom_width / 2]) {
  34. translate([count, -move_y]) {
  35. circle(r = lucky_bamboo_pot_bamboo_diameter / 2);
  36. }
  37. }
  38. }
  39. module lucky_bamboo_pot_top_shape() {
  40. move_x = lucky_bamboo_pot_top_width / 2 - lucky_bamboo_pot_top_depth / 2;
  41. move_y = lucky_bamboo_pot_top_depth / 4;
  42. difference() {
  43. lucky_bamboo_pot_top_base_shape();
  44. translate([move_x, move_y]) {
  45. lucky_bamboo_pot_top_mounting_hole_shape();
  46. }
  47. translate([-move_x, move_y]) {
  48. lucky_bamboo_pot_top_mounting_hole_shape();
  49. }
  50. translate([move_x, -move_y]) {
  51. lucky_bamboo_pot_top_mounting_hole_shape();
  52. }
  53. translate([-move_x, -move_y]) {
  54. lucky_bamboo_pot_top_mounting_hole_shape();
  55. }
  56. lucky_bamboo_pot_bamboo_holes_shape();
  57. }
  58. }
  59. module lucky_bamboo_pot_top_object() {
  60. color(lucky_bamboo_pot_top_color) {
  61. linear_extrude(height = lucky_bamboo_pot_top_thickness) {
  62. lucky_bamboo_pot_top_shape();
  63. }
  64. }
  65. }
  66. module lucky_bamboo_pot_handle_base_shape() {
  67. height = lucky_bamboo_pot_height;
  68. depth = lucky_bamboo_pot_top_depth + lucky_bamboo_pot_wall_margin;
  69. move_x = depth / 2;
  70. move_y = height / 2;
  71. rounding = lucky_bamboo_pot_handle_rounding;
  72. hull() {
  73. translate([move_x - rounding, move_y - rounding]) {
  74. circle(r = rounding);
  75. }
  76. translate([rounding - move_x, move_y - rounding]) {
  77. square(rounding * 2, center = true);
  78. }
  79. translate([rounding - move_x, rounding]) {
  80. square(rounding * 2, center = true);
  81. }
  82. }
  83. hull() {
  84. translate([move_x - rounding, rounding - move_y]) {
  85. circle(r = rounding);
  86. }
  87. translate([rounding - move_x, rounding - move_y]) {
  88. square(rounding * 2, center = true);
  89. }
  90. translate([rounding - move_x, -rounding]) {
  91. square(rounding * 2, center = true);
  92. }
  93. }
  94. }
  95. module lucky_bamboo_pot_object() {
  96. //lucky_bamboo_pot_top_object();
  97. lucky_bamboo_pot_handle_base_shape();
  98. }