Add angled top

This commit is contained in:
Remi Rampin 2024-04-02 18:21:53 -04:00
parent ada885b1b8
commit 56c362fe0c
1 changed files with 17 additions and 7 deletions

View File

@ -12,6 +12,8 @@ thickness = 3;
bottom_roundness_percent = 85;
// Optional wall mount plate, 0 is no plate and 100 makes the planter a half-circle
wall_mount_percent = 30;
// Top angle
top_angle = 20;
module _end_of_customizer() {}
@ -111,19 +113,27 @@ module planter() {
bottom();
}
// Planter with optional wall mount plate
// Planter with optional wall mount plate and angled top
//
// If `wall_mount_percent` is 0, no plate, if 100, the planter is a half circle
if(wall_mount_percent > 0) {
difference() {
full_diameter = (diameter + thickness * 2) + cut_depth * 2;
wall_x = full_diameter / 2 * (1 - wall_mount_percent / 100);
if(wall_mount_percent > 0) {
wall_x = full_diameter / 2 * (1 - wall_mount_percent / 100);
wall_depth = full_diameter * sqrt(1 - (1 - wall_mount_percent / 100)^2);
wall_depth = full_diameter * sqrt(1 - (1 - wall_mount_percent / 100)^2);
chop_off(wall_x, thickness) {
chop_off(wall_x, thickness) {
planter();
}
} else {
planter();
}
} else {
planter();
// Angled top
translate([-diameter / 2, -full_diameter / 2, height])
rotate([0, top_angle, 0])
translate([-full_diameter / 2 + diameter / 2, 0, 0])
cube([full_diameter / cos(top_angle), full_diameter, full_diameter]);
}