Browse Source

Continue work on pot.

Cixo Develop 1 year ago
parent
commit
097236b658
3 changed files with 107 additions and 11 deletions
  1. 104 10
      assets/pot.scad
  2. 2 0
      config/pot.scad
  3. 1 1
      renders/pot.scad

+ 104 - 10
assets/pot.scad

@@ -1,11 +1,12 @@
 include <../config/pot.scad>
 include <../config/thread.scad>
+include <./thread.scad>
 
 module pot_object() {
-    module base_object(outsize) {
-        move_z = pot_height / 2 - pot_size / 2;
+    module base_object(outside) {
         move_x = thread_diameter / 2 + pot_thickness / 2;
-        size = outsize / 2;
+        move_z = pot_height / 2 - pot_size / 2;
+        size = outside / 2;
         
         hull() {
             translate([move_x, 0, -move_z]) {
@@ -26,15 +27,108 @@ module pot_object() {
         }
     }
 
-    render() {
-        difference() {
-            thickness = thread_height + pot_thickness * 2;
+    module watering_object() {
+        inside_radius = pot_watering_size / 2;
+        radius = inside_radius + pot_thickness;
+        connector_size = pot_watering_connector_size / 2;
+        connector_outside_size = connector_size + pot_thickness;
+
+        module input_object() {
+            module base() {
+                hull() {
+                    sphere(r = radius);
+                    
+                    cylinder(
+                        r = connector_outside_size, 
+                        h = radius * 2, 
+                        center = true
+                    );
+                }
+            }
+
+            difference() {
+                base();
+
+                sphere(r = inside_radius);
+                
+                cylinder(
+                    r = connector_size,
+                    h = radius * 2,
+                    center = true
+                );
+
+                translate([0, 0, radius / 2]) {
+                    size = [
+                        radius * 2,
+                        radius * 2,
+                        radius
+                    ];
+
+                    cube(size, center = true); 
+                }
+            }
+        }
+
+        render() {
+            input_object();
+        }
+
+        module connector_object() {
+            width = radius + pot_thickness * 2;
+            size = connector_size;
+            outside_size = connector_outside_size;
+            move = width + size;
 
-            base_object(pot_size + thickness);
-            
-            translate([0, thread_height / 2, thickness / 2]) {
-                base_object(pot_size);
+            translate([-move, 0, -radius]) {
+                rotate([90, 90, 0]) {
+                    rotate_extrude(angle = 90) {
+                        translate([move, 0, 0]) {
+                            difference() {
+                                circle(r = outside_size);
+                                circle(r = size);
+                            }
+                        }
+                    }
+                }
             }
         }
+
+        render() {
+            connector_object();
+        }
+    }
+
+    module base_pot_object() {
+        render() {
+            difference() {
+                thickness = thread_height + pot_thickness * 2;
+
+                base_object(pot_size + thickness);
+                
+                translate([0, thread_height / 2, thickness / 2]) {
+                    base_object(pot_size);
+                }
+            }
+        }
+    }
+
+    base_pot_object();
+    
+    watering_move_y 
+    = pot_size / 2 
+    + pot_thickness 
+    + thread_height / 2
+    + pot_watering_size / 2
+    + pot_thickness * 2
+    + pot_watering_connector_size;
+
+    watering_move_z 
+    = pot_height / 2
+    + pot_thickness;
+
+    translate([0, watering_move_y, watering_move_z]) {
+        rotate([0, 0, 90]) {
+            watering_object();
+        }
     }
 }

+ 2 - 0
config/pot.scad

@@ -1,3 +1,5 @@
 pot_size = 50;
 pot_height = 100;
 pot_thickness = 3;
+pot_watering_size = 30;
+pot_watering_connector_size = 5;

+ 1 - 1
renders/pot.scad

@@ -1,4 +1,4 @@
 include <../assets/pot.scad>
 
-$fn = 100;
+$fn = 20;
 pot_object();