Introduce chop_off(), generic flat chopping module
This commit is contained in:
parent
c892623e0f
commit
f052e18303
26
planter.scad
26
planter.scad
|
@ -29,6 +29,25 @@ module half_sphere(d) {
|
|||
}
|
||||
}
|
||||
|
||||
module chop_off(x, thickness) {
|
||||
assert($children == 1);
|
||||
|
||||
difference() {
|
||||
children(0);
|
||||
|
||||
translate([-500 - x, -500, -500])
|
||||
cube([500, 1000, 1000]);
|
||||
}
|
||||
|
||||
hull()
|
||||
intersection() {
|
||||
children(0);
|
||||
|
||||
translate([-x, -500, -500])
|
||||
cube([thickness, 1000, 1000]);
|
||||
}
|
||||
}
|
||||
|
||||
// The body, a full cylinder with ridges
|
||||
//
|
||||
// Its diameter is calculated from `diameter` (for the hollow inside), `thickness`, and `cut_depth`.
|
||||
|
@ -99,14 +118,9 @@ if(wall_mount_percent > 0) {
|
|||
|
||||
wall_depth = full_diameter * sqrt(1 - (1 - wall_mount_percent / 100)^2);
|
||||
|
||||
difference() {
|
||||
chop_off(wall_x, thickness) {
|
||||
planter();
|
||||
translate([-wall_x - full_diameter, -wall_depth / 2, -full_diameter - 1])
|
||||
cube([full_diameter, wall_depth, height + full_diameter + 2]);
|
||||
}
|
||||
|
||||
translate([-wall_x, -wall_depth / 2, 0])
|
||||
cube([thickness, wall_depth, height]);
|
||||
} else {
|
||||
planter();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue