Explorar o código

Add top of the pots and submission with animation.

Cixo Develop hai 11 meses
pai
achega
ba49ad6637
Modificáronse 5 ficheiros con 199 adicións e 3 borrados
  1. 153 0
      assets/top.scad
  2. 3 3
      config/pot.scad
  3. 13 0
      config/top.scad
  4. 26 0
      renders/submission.scad
  5. 4 0
      renders/top.scad

+ 153 - 0
assets/top.scad

@@ -0,0 +1,153 @@
+include <../config/pot.scad>
+include <../config/top.scad>
+include <bottom.scad>
+
+function top_size() = [
+    bottom_size().x + top_wall_thickness * 2,
+    bottom_size().y + top_wall_thickness * 4 + curtain_space * 2,
+    bottom_size().z
+];
+
+module top_object() {
+    function base_size() = [
+        top_size().x,
+        top_size().y
+    ];
+
+    function base_size_no_rounding() = [
+        base_size().x - wall_rounding * 2,
+        base_size().y - wall_rounding * 2
+    ];
+
+    module cable_hole_shape() {
+        circle(r = cable_hole / 2);
+    }
+
+    module cable_holes() {
+        edge
+        = bottom_size().x / 2
+        - single_pot_size.x / 2
+        - pot_wall_thickness;
+        
+        move = single_pot_size.x + pot_wall_thickness;
+
+        for (count = [-edge : move : edge]) {
+            translate([count, 0]) {
+                cable_hole_shape();
+            }
+        }
+    }
+
+    module base_shape() {
+        difference() {
+            minkowski() {
+                square(base_size_no_rounding(), center = true);
+                circle(r = wall_rounding);
+            }
+
+            cable_holes();
+        }
+    }
+
+    module base_object() {
+        linear_extrude(height = top_wall_thickness) {
+            base_shape();
+        }
+    }
+
+    module diode_hole_shape() {
+        square(diode_size, center = true);
+    }
+
+    module place_shape(cable = true) {
+        function place_size_no_rounding() = [
+            single_pot_size.x - (wall_rounding + top_placer_margin) * 2,
+            single_pot_size.y - (wall_rounding + top_placer_margin) * 2
+        ];
+
+        render() {
+            difference() {
+                minkowski() {
+                    square(place_size_no_rounding(), center = true);
+                    circle(r = wall_rounding);
+                }
+                
+                if (cable) {
+                    cable_hole_shape();
+                } else {
+                    diode_hole_shape();
+                }
+            }
+        }
+    }
+
+    module placer_shape(cable = true) {
+        edge
+        = bottom_size().x / 2
+        - single_pot_size.x / 2
+        - pot_wall_thickness;
+        
+        move = single_pot_size.x + pot_wall_thickness;
+
+        for (count = [-edge : move : edge]) {
+            translate([count, 0]) {
+                place_shape(cable); 
+            }
+        }
+    }
+
+    module placer_object(cable = true) {
+        linear_extrude(height = top_placer_thickness / 2) {
+            placer_shape(cable);
+        }
+    }
+
+    module curtain_shape() {
+        module curtain() {
+            move = top_size().x / 2 - wall_rounding;
+
+            render() {
+                hull() {
+                    translate([move, 0]) {
+                        circle(r = wall_rounding);
+                    }
+
+                    translate([-move, 0]) {
+                        circle(r = wall_rounding);
+                    }
+                }
+            }
+        }
+
+        position = top_size().y / 2 - wall_rounding;
+
+        translate([0, position]) {
+            curtain();
+        }
+
+        translate([0, -position]) {
+            curtain();
+        }
+    }
+
+    module curtain_object() {
+        linear_extrude(height = curtain_height) {
+            curtain_shape();
+        }
+    }
+
+    color(top_color) {
+        render() {
+            base_object();
+            
+            translate([0, 0, top_wall_thickness]) {
+                placer_object(cable = true);
+                curtain_object();
+            }
+
+            translate([0, 0, top_wall_thickness + top_placer_thickness / 2]) {
+                placer_object(cable = false);
+            }
+        }
+    }
+}

+ 3 - 3
config/pot.scad

@@ -1,8 +1,8 @@
 single_pot_size = [30, 30, 100];
 wall_rounding = 4;
 pot_wall_thickness = 3;
-pot_count = 6;
+pot_count = 4;
 vent_hole_diameter = 10;
-stabilisator_size = 30;
-stabilisator_width = 140;
+stabilisator_size = 20;
+stabilisator_width = 100;
 bottom_color = "green";

+ 13 - 0
config/top.scad

@@ -0,0 +1,13 @@
+include <pot.scad>
+
+top_wall_thickness = 5;
+curtain_space = 15;
+top_placer_thickness = 4;
+top_placer_margin = 0.5;
+cable_hole = 2;
+diode_size = [7, 7];
+top_color = "lightgreen";
+
+curtain_height 
+= single_pot_size.z 
+- curtain_space;

+ 26 - 0
renders/submission.scad

@@ -0,0 +1,26 @@
+/* 
+ * Animation setup:
+ * FPS: 30
+ * Steps: 100
+ */
+
+include <../config/pot.scad>
+include <../config/top.scad>
+
+include <../assets/bottom.scad>
+include <../assets/top.scad>
+
+bottom_object();
+
+top_position 
+= single_pot_size.z 
++ pot_wall_thickness
++ top_wall_thickness;
+
+$fn = 20;
+
+translate([0, 0, top_position + top_position * (1 - $t)]) {
+    rotate([180, 0, 0]) {
+        top_object();
+    }
+}

+ 4 - 0
renders/top.scad

@@ -0,0 +1,4 @@
+include <../assets/top.scad>
+
+$fn = 100;
+top_object();