$fn = 64; // --- Parameters --- // Cup dimensions cup_radius = 35; cup_height = 140; wall_thickness = 3; // Mounting block dimensions block_width = 40; block_depth = 16; block_height = 50; block_offset_z = 20; // Distance from top of cup to top of block // Dovetail rail dimensions (Female slot for wall rail) rail_opening_height = 25; rail_inner_height = 35; rail_depth = 6; // --- Model --- difference() { union() { // Main cylindrical body cylinder(r=cup_radius, h=cup_height); // Top rim reinforcement translate([0, 0, cup_height]) rotate_extrude() translate([cup_radius, 0, 0]) circle(r=wall_thickness); // Mounting block (Self-supporting with 45-degree bottom taper) translate([-block_width/2, cup_radius - 5, cup_height - block_height - block_offset_z]) hull() { // Main rectangular block cube([block_width, block_depth + 5, block_height]); // Tapered base merging into the cup wall (eliminates need for supports) translate([0, 0, -(block_depth + 5)]) cube([block_width, 0.1, 0.1]); } } // Cup inner cavity translate([0, 0, wall_thickness]) cylinder(r=cup_radius - wall_thickness, h=cup_height + wall_thickness * 2); // Dovetail cutout (Horizontal slot to hang on rail) translate([0, cup_radius + block_depth, cup_height - (block_height/2) - block_offset_z]) hull() { // Outer opening at the back face translate([0, 0, 0]) cube([block_width + 2, 0.1, rail_opening_height], center=true); // Inner widened cavity translate([0, -rail_depth, 0]) cube([block_width + 2, 0.1, rail_inner_height], center=true); } }