include <../config/bamboo_pot.scad> include <../config/thread.scad> include <../config/wall.scad> include module bamboo_pot_object() { module water_shape() { outside_radius = bamboo_pot_plant_entrance_diameter / 2 + bamboo_pot_thickness; inside_radius = outside_radius - bamboo_pot_thickness; difference() { circle(r = outside_radius); circle(r = inside_radius); } } module entrance_object() { inside_radius = bamboo_pot_plant_entrance_diameter / 2; outside_radius = inside_radius + bamboo_pot_thickness + thread_height / 2; flat_width = thread_top_diameter; module base_shape() { move = flat_width / 2; center_size = [flat_width, outside_radius * 2]; square(center_size, center = true); translate([-move, 0]) { circle(r = outside_radius); } translate([move, 0]) { circle(r = outside_radius); } } module shape() { move_center = thread_height / 2; difference() { base_shape(); translate([0, move_center]) { circle(r = inside_radius); } } } module base_object() { height = bamboo_pot_height; linear_extrude(height = height, center = true) { shape(); } } module mount_holes_object() { module hole_object() { height = bamboo_pot_thickness; move_y = outside_radius - height / 2; radius = bamboo_pot_mount_holes_diameter / 2; translate([0, move_y, 0]) { rotate([90, 0, 0]) { cylinder(r = radius, h = height, center = true); } } } move_x = flat_width / 2 - bamboo_pot_mount_holes_diameter; translate([-move_x, 0, 0]) { hole_object(); } translate([move_x, 0, 0]) { hole_object(); } } module bottom_hull_object() { height = bamboo_pot_hull_height; hole_move_y = thread_height / 2; thickness = 1 / $fn; module start_object() { translate([0, 0, -thickness]) { linear_extrude(height = thickness) { base_shape(); } } } module end_object() { linear_extrude(height = thickness) { translate([0, hole_move_y, 0]) { water_shape(); } } } module base_object() { hull() { translate([0, 0, height / 2]) { start_object(); } translate([0, 0, -height / 2]) { end_object(); } } } module water_hole_object() { radius = bamboo_pot_plant_entrance_diameter / 2; translate([0, hole_move_y, 0]) { cylinder(r = radius, h = height, center = true); } } difference() { base_object(); water_hole_object(); } } module bamboo_object() { height = bamboo_pot_height - bamboo_pot_thickness * 2; top = height / 2 - thread_top_diameter / 2; move_y = thread_height / 2 - outside_radius; mount_holes_z = bamboo_pot_height / 2 - bamboo_pot_mount_holes_margin; difference() { base_object(); translate([0, 0, mount_holes_z]) { mount_holes_object(); } for (count = [0 : wall_holes_space : height]) { translate([0, move_y, top - count]) { rotate([270, 0, 0]) { thread_object(); } } } } } module object() { move_bamboo = bamboo_pot_hull_height / 2; move_bottom_hull = -bamboo_pot_height / 2; translate([0, 0, move_bamboo]) { bamboo_object(); } translate([0, 0, move_bottom_hull]) { bottom_hull_object(); } } render() { object(); } } module water_object() { module base_object() { rotate_extrude(angle = 180) { move = bamboo_pot_water_size / 2 + bamboo_pot_plant_entrance_diameter / 2 + bamboo_pot_thickness; translate([move, 0]) { water_shape(); } } } move_center_z = bamboo_pot_water_size / 4 + bamboo_pot_plant_entrance_diameter / 2 + bamboo_pot_thickness; translate([0, 0, move_center_z]) { rotate([270, 0, 90]) { base_object(); } } } module watering_object() { module top_shape(inside = true) { radius = bamboo_pot_water_entrance / 2 + (inside ? 0 : bamboo_pot_thickness); circle(r = radius); } move = bamboo_pot_hull_height / 2; thickness = 1 / $fn; module base_object() { module bottom_object() { linear_extrude(height = thickness) { water_shape(); } } module top_object() { translate([0, 0, -thickness]) { linear_extrude(height = thickness) { top_shape(false); } } } hull() { translate([0, 0, move]) { top_object(); } translate([0, 0, -move]) { bottom_object(); } } } module hole_object() { module bottom_object() { radius = bamboo_pot_plant_entrance_diameter / 2; cylinder(r = radius, h = thickness); } module top_object() { translate([0, 0, -thickness]) { linear_extrude(height = thickness) { top_shape(true); } } } hull() { translate([0, 0, move]) { top_object(); } translate([0, 0, -move]) { bottom_object(); } } } difference() { base_object(); hole_object(); } } module water_level_set_object() { height = bamboo_pot_water_level; linear_extrude(height = height, center = true) { water_shape(); } } module final_object() { entrance_move_z = bamboo_pot_water_size / 4 + bamboo_pot_plant_entrance_diameter / 2 + bamboo_pot_thickness; entrance_move_y = -bamboo_pot_plant_entrance_diameter / 2 - thread_height / 2 - bamboo_pot_thickness - bamboo_pot_water_size / 2; water_move_z = -bamboo_pot_height / 2 - bamboo_pot_hull_height / 2; water_level_set_move_y = bamboo_pot_water_size / 2 + bamboo_pot_thickness + bamboo_pot_plant_entrance_diameter / 2; water_level_set_move_z = bamboo_pot_water_level / 2 + entrance_move_z - bamboo_pot_height / 2 - bamboo_pot_hull_height / 2; watering_move_y = water_level_set_move_y; watering_move_z = water_level_set_move_z + bamboo_pot_water_level / 2 + bamboo_pot_hull_height / 2; translate([0, entrance_move_y, entrance_move_z]) { entrance_object(); } translate([0, 0, water_move_z]) { water_object(); } translate([0, water_level_set_move_y, water_level_set_move_z]) { water_level_set_object(); } translate([0, watering_move_y, watering_move_z]) { watering_object(); } } color("#20B347") { render() { final_object(); } } }