| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- include <../config/bamboo_pot.scad>
- include <../config/thread.scad>
- include <../config/wall.scad>
- include <thread.scad>
- module bamboo_pot_object() {
- 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 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();
- }
- }
- }
- }
- }
- render() {
- object();
- }
- }
- entrance_object();
- }
|