bamboo_pot.scad 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. include <../config/bamboo_pot.scad>
  2. include <../config/thread.scad>
  3. include <../config/wall.scad>
  4. include <thread.scad>
  5. module bamboo_pot_object() {
  6. module entrance_object() {
  7. inside_radius
  8. = bamboo_pot_plant_entrance_diameter / 2;
  9. outside_radius
  10. = inside_radius
  11. + bamboo_pot_thickness
  12. + thread_height / 2;
  13. flat_width
  14. = thread_top_diameter;
  15. module base_shape() {
  16. move = flat_width / 2;
  17. center_size = [flat_width, outside_radius * 2];
  18. square(center_size, center = true);
  19. translate([-move, 0]) {
  20. circle(r = outside_radius);
  21. }
  22. translate([move, 0]) {
  23. circle(r = outside_radius);
  24. }
  25. }
  26. module shape() {
  27. move_center
  28. = thread_height / 2;
  29. difference() {
  30. base_shape();
  31. translate([0, move_center]) {
  32. circle(r = inside_radius);
  33. }
  34. }
  35. }
  36. module base_object() {
  37. height
  38. = bamboo_pot_height;
  39. linear_extrude(height = height, center = true) {
  40. shape();
  41. }
  42. }
  43. module mount_holes_object() {
  44. module hole_object() {
  45. height
  46. = bamboo_pot_thickness;
  47. move_y
  48. = outside_radius
  49. - height / 2;
  50. radius
  51. = bamboo_pot_mount_holes_diameter / 2;
  52. translate([0, move_y, 0]) {
  53. rotate([90, 0, 0]) {
  54. cylinder(r = radius, h = height, center = true);
  55. }
  56. }
  57. }
  58. move_x
  59. = flat_width / 2
  60. - bamboo_pot_mount_holes_diameter;
  61. translate([-move_x, 0, 0]) {
  62. hole_object();
  63. }
  64. translate([move_x, 0, 0]) {
  65. hole_object();
  66. }
  67. }
  68. module object() {
  69. height
  70. = bamboo_pot_height
  71. - bamboo_pot_thickness * 2;
  72. top
  73. = height / 2
  74. - thread_top_diameter / 2;
  75. move_y
  76. = thread_height / 2
  77. - outside_radius;
  78. mount_holes_z
  79. = bamboo_pot_height / 2
  80. - bamboo_pot_mount_holes_margin;
  81. difference() {
  82. base_object();
  83. translate([0, 0, mount_holes_z]) {
  84. mount_holes_object();
  85. }
  86. for (count = [0 : wall_holes_space : height]) {
  87. translate([0, move_y, top - count]) {
  88. rotate([270, 0, 0]) {
  89. thread_object();
  90. }
  91. }
  92. }
  93. }
  94. }
  95. render() {
  96. object();
  97. }
  98. }
  99. entrance_object();
  100. }