bottom.scad 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. include <../config/pot.scad>
  2. function bottom_size() = [
  3. (pot_wall_thickness + single_pot_size.x) * pot_count + pot_wall_thickness,
  4. single_pot_size.y + pot_wall_thickness * 2,
  5. single_pot_size.z + pot_wall_thickness
  6. ];
  7. module bottom_object() {
  8. function bottom_size_no_rounding() = [
  9. bottom_size().x - wall_rounding * 2,
  10. bottom_size().y - wall_rounding * 2
  11. ];
  12. function pot_size_no_rounding() = [
  13. single_pot_size.x - wall_rounding * 2,
  14. single_pot_size.y - wall_rounding * 2
  15. ];
  16. module base_shape(minimal = true) {
  17. minkowski() {
  18. square(bottom_size_no_rounding(), center = true);
  19. circle(r = wall_rounding);
  20. }
  21. module stabilisator() {
  22. move = stabilisator_width / 2 - stabilisator_size / 2;
  23. hull() {
  24. translate([0, move]) {
  25. circle(r = stabilisator_size / 2);
  26. }
  27. translate([0, -move]) {
  28. circle(r = stabilisator_size / 2);
  29. }
  30. }
  31. }
  32. if (!minimal) {
  33. translate([bottom_size().x / -2, 0]) {
  34. translate([bottom_size().x / 3, 0]) {
  35. stabilisator();
  36. }
  37. translate([bottom_size().x / 3 * 2, 0]) {
  38. stabilisator();
  39. }
  40. }
  41. }
  42. }
  43. module pot_shape() {
  44. minkowski() {
  45. square(pot_size_no_rounding(), center = true);
  46. circle(r = wall_rounding);
  47. }
  48. }
  49. module pots_shape() {
  50. edge
  51. = bottom_size().x / 2
  52. - single_pot_size.x / 2
  53. - pot_wall_thickness;
  54. move = single_pot_size.x + pot_wall_thickness;
  55. for (count = [-edge : move : edge]) {
  56. translate([count, 0]) {
  57. pot_shape();
  58. }
  59. }
  60. }
  61. module vent_hole_object() {
  62. module hole() {
  63. rotate([90, 0, 0]) {
  64. cylinder(
  65. r = vent_hole_diameter / 2,
  66. h = bottom_size().y,
  67. center = true
  68. );
  69. }
  70. }
  71. translate([0, 0, single_pot_size.z / 2]) {
  72. hole();
  73. }
  74. translate([0, 0, single_pot_size.z / 4 * 3]) {
  75. hole();
  76. }
  77. }
  78. module vent_holes_object() {
  79. edge
  80. = bottom_size().x / 2
  81. - single_pot_size.x / 2
  82. - pot_wall_thickness;
  83. move = single_pot_size.x + pot_wall_thickness;
  84. for (count = [-edge : move : edge]) {
  85. translate([count, 0]) {
  86. vent_hole_object();
  87. }
  88. }
  89. }
  90. module pots_object() {
  91. difference() {
  92. linear_extrude(height = single_pot_size.z) {
  93. difference() {
  94. base_shape();
  95. pots_shape();
  96. }
  97. }
  98. vent_holes_object();
  99. }
  100. }
  101. module base_object() {
  102. linear_extrude(height = pot_wall_thickness) {
  103. base_shape(minimal = false);
  104. }
  105. }
  106. color(bottom_color) {
  107. render() {
  108. base_object();
  109. translate([0, 0, pot_wall_thickness]) {
  110. pots_object();
  111. }
  112. }
  113. }
  114. }