| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- include <../config/bamboo_pot.scad>
- include <../config/thread.scad>
- include <../config/wall.scad>
- include <thread.scad>
- 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();
- }
- }
- }
|