|  | @@ -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);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +}
 |