From 56c362fe0c4af08456d3b972913eefe41640c835 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Tue, 2 Apr 2024 18:21:53 -0400 Subject: [PATCH] Add angled top --- planter.scad | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/planter.scad b/planter.scad index 4edc0a2..d914ea3 100644 --- a/planter.scad +++ b/planter.scad @@ -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]); }