$fn = 64; // --- Parameters --- cup_height = 80; // Total height of the cup cup_bottom_radius = 45; // Radius at the base cup_top_radius = 55; // Radius before the top flare flare_radius = 62; // Radius at the very top lip flare_height = 15; // Height of the flared section wall_thickness = 3; // Thickness of the cup walls base_thickness = 4; // Thickness of the solid bottom inner_fillet_radius = 10; // Radius of the inner bottom curve (for easy scooping) chamfer_size = 1.5; // Bottom chamfer to prevent elephant's foot // --- Geometry --- union() { difference() { // Main Outer Body union() { // Anti-elephant foot chamfer at the base cylinder(h = chamfer_size, r1 = cup_bottom_radius - chamfer_size, r2 = cup_bottom_radius); // Main tapered body translate([0, 0, chamfer_size - 0.01]) cylinder(h = cup_height - flare_height - chamfer_size + 0.02, r1 = cup_bottom_radius, r2 = cup_top_radius); // Top flared section translate([0, 0, cup_height - flare_height]) cylinder(h = flare_height, r1 = cup_top_radius, r2 = flare_radius); } // Inner Cavity Cutout union() { // Flat center of the inner bottom translate([0, 0, base_thickness]) cylinder(h = inner_fillet_radius + 0.01, r = cup_bottom_radius - wall_thickness - inner_fillet_radius); // Rounded inner bottom corner for easily scooping tokens translate([0, 0, base_thickness + inner_fillet_radius]) rotate_extrude() translate([cup_bottom_radius - wall_thickness - inner_fillet_radius, 0, 0]) circle(r = inner_fillet_radius); // Main inner tapered cavity translate([0, 0, base_thickness + inner_fillet_radius - 0.01]) cylinder(h = cup_height - flare_height - base_thickness - inner_fillet_radius + 0.02, r1 = cup_bottom_radius - wall_thickness, r2 = cup_top_radius - wall_thickness); // Inner top flare (extended 1mm to ensure clean manifold cut) translate([0, 0, cup_height - flare_height]) cylinder(h = flare_height + 1, r1 = cup_top_radius - wall_thickness, r2 = flare_radius - wall_thickness + ((flare_radius - cup_top_radius) / flare_height)); } } // Smooth rounded rim at the very top translate([0, 0, cup_height]) rotate_extrude() translate([flare_radius - wall_thickness/2, 0, 0]) circle(r = wall_thickness/2); }