pot.scad 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. include <../config/pot.scad>
  2. include <../config/thread.scad>
  3. include <./thread.scad>
  4. module pot_object() {
  5. module base_object(outside) {
  6. move_x = thread_diameter / 2 + pot_thickness / 2;
  7. move_z = pot_height / 2 - pot_size / 2;
  8. size = outside / 2;
  9. hull() {
  10. translate([move_x, 0, -move_z]) {
  11. sphere(r = size);
  12. }
  13. translate([move_x, 0, move_z]) {
  14. cylinder(r = size, h = size * 2, center = true);
  15. }
  16. translate([-move_x, 0, -move_z]) {
  17. sphere(r = size);
  18. }
  19. translate([-move_x, 0, move_z]) {
  20. cylinder(r = size, h = size * 2, center = true);
  21. }
  22. }
  23. }
  24. module watering_object() {
  25. inside_radius = pot_watering_size / 2;
  26. radius = inside_radius + pot_thickness;
  27. connector_size = pot_watering_connector_size / 2;
  28. connector_outside_size = connector_size + pot_thickness;
  29. module input_object() {
  30. module base() {
  31. hull() {
  32. sphere(r = radius);
  33. cylinder(
  34. r = connector_outside_size,
  35. h = radius * 2,
  36. center = true
  37. );
  38. }
  39. }
  40. difference() {
  41. base();
  42. sphere(r = inside_radius);
  43. cylinder(
  44. r = connector_size,
  45. h = radius * 2,
  46. center = true
  47. );
  48. translate([0, 0, radius / 2]) {
  49. size = [
  50. radius * 2,
  51. radius * 2,
  52. radius
  53. ];
  54. cube(size, center = true);
  55. }
  56. }
  57. }
  58. render() {
  59. input_object();
  60. }
  61. module connector_object() {
  62. width = radius + pot_thickness * 2;
  63. size = connector_size;
  64. outside_size = connector_outside_size;
  65. move = width + size;
  66. translate([-move, 0, -radius]) {
  67. rotate([90, 90, 0]) {
  68. rotate_extrude(angle = 90) {
  69. translate([move, 0, 0]) {
  70. difference() {
  71. circle(r = outside_size);
  72. circle(r = size);
  73. }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. render() {
  80. connector_object();
  81. }
  82. }
  83. module base_pot_object() {
  84. render() {
  85. difference() {
  86. thickness = thread_height + pot_thickness * 2;
  87. base_object(pot_size + thickness);
  88. translate([0, thread_height / 2, thickness / 2]) {
  89. base_object(pot_size);
  90. }
  91. }
  92. }
  93. }
  94. base_pot_object();
  95. watering_move_y
  96. = pot_size / 2
  97. + pot_thickness
  98. + thread_height / 2
  99. + pot_watering_size / 2
  100. + pot_thickness * 2
  101. + pot_watering_connector_size;
  102. watering_move_z
  103. = pot_height / 2
  104. + pot_thickness;
  105. translate([0, watering_move_y, watering_move_z]) {
  106. rotate([0, 0, 90]) {
  107. watering_object();
  108. }
  109. }
  110. }