6.0s
· 1307/397t · $0.0017
diff vs bare: +11/-8
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
- handle_depth = 18;
handle_wall = 5;
+ handle_depth = 18;
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
- // D-shaped solid, open toward the mug body (-X side of the handle)
- translate([outer_d/2, 0, height/2])
+ // D-shaped handle opening toward the mug body (-X side)
+ // Built so the flat side can overlap the mug outer wall.
+ translate([outer_d/2 - 0.8, 0, height/2 - handle_clear_h/2])
rotate([0, 90, 0])
linear_extrude(height = handle_depth)
difference() {
- // outer profile: rectangle + semicircle on the outside
+ // outer profile
union() {
- translate([0, - (handle_clear_h/2 + handle_wall)])
+ translate([0, -(handle_clear_h/2 + handle_wall)])
square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
translate([handle_wall, 0])
- circle(r = (handle_clear_h/2 + handle_wall));
+ circle(r = handle_clear_h/2 + handle_wall);
}
- // inner void: rectangle + semicircle
+ // inner void
union() {
translate([0, -handle_clear_h/2])
square([handle_wall + 0.2, handle_clear_h], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2);
}
}
}
union() {
mug_body();
- // Slight overlap into the body to guarantee manifold union
+
+ // Place the handle at the mid-height and attach only on +X side
+ // Slight overlap ensures a manifold union without gaps.
translate([0.5, 0, 0])
handle_solid();
}
SCAD (53 lines)
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
handle_wall = 5;
handle_depth = 18;
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
// D-shaped handle opening toward the mug body (-X side)
// Built so the flat side can overlap the mug outer wall.
translate([outer_d/2 - 0.8, 0, height/2 - handle_clear_h/2])
rotate([0, 90, 0])
linear_extrude(height = handle_depth)
difference() {
// outer profile
union() {
translate([0, -(handle_clear_h/2 + handle_wall)])
square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2 + handle_wall);
}
// inner void
union() {
translate([0, -handle_clear_h/2])
square([handle_wall + 0.2, handle_clear_h], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2);
}
}
}
union() {
mug_body();
// Place the handle at the mid-height and attach only on +X side
// Slight overlap ensures a manifold union without gaps.
translate([0.5, 0, 0])
handle_solid();
}
3.2s
· 1329/403t · $0.0017
diff vs i1: +22/-23
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
handle_wall = 5;
handle_depth = 18;
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
- // D-shaped handle opening toward the mug body (-X side)
- // Built so the flat side can overlap the mug outer wall.
- translate([outer_d/2 - 0.8, 0, height/2 - handle_clear_h/2])
- rotate([0, 90, 0])
- linear_extrude(height = handle_depth)
- difference() {
- // outer profile
- union() {
- translate([0, -(handle_clear_h/2 + handle_wall)])
- square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
- translate([handle_wall, 0])
- circle(r = handle_clear_h/2 + handle_wall);
- }
+ // D-shaped handle with the flat side facing the mug body
+ // Built in YZ cross-section and extruded along +X
+ translate([outer_d/2 - 1.0, 0, height/2 - handle_clear_h/2])
+ rotate([0, 90, 0])
+ linear_extrude(height = handle_depth)
+ difference() {
+ // outer profile: rectangle on body side + semicircle outward
+ union() {
+ translate([0, -(handle_clear_h/2 + handle_wall)])
+ square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
+ translate([handle_wall, 0])
+ circle(r = handle_clear_h/2 + handle_wall);
+ }
- // inner void
- union() {
- translate([0, -handle_clear_h/2])
- square([handle_wall + 0.2, handle_clear_h], center = false);
- translate([handle_wall, 0])
- circle(r = handle_clear_h/2);
+ // inner void: 25mm wide x 30mm high
+ union() {
+ translate([0, -handle_clear_h/2])
+ square([handle_wall + 0.2, handle_clear_h], center = false);
+ translate([handle_wall, 0])
+ circle(r = handle_clear_h/2);
+ }
}
- }
}
union() {
mug_body();
- // Place the handle at the mid-height and attach only on +X side
- // Slight overlap ensures a manifold union without gaps.
- translate([0.5, 0, 0])
+ // Attach handle only on the +X side, centered vertically
+ translate([0.6, 0, 0])
handle_solid();
}
SCAD (52 lines)
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
handle_wall = 5;
handle_depth = 18;
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
// D-shaped handle with the flat side facing the mug body
// Built in YZ cross-section and extruded along +X
translate([outer_d/2 - 1.0, 0, height/2 - handle_clear_h/2])
rotate([0, 90, 0])
linear_extrude(height = handle_depth)
difference() {
// outer profile: rectangle on body side + semicircle outward
union() {
translate([0, -(handle_clear_h/2 + handle_wall)])
square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2 + handle_wall);
}
// inner void: 25mm wide x 30mm high
union() {
translate([0, -handle_clear_h/2])
square([handle_wall + 0.2, handle_clear_h], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2);
}
}
}
union() {
mug_body();
// Attach handle only on the +X side, centered vertically
translate([0.6, 0, 0])
handle_solid();
}
3.8s
· 1335/412t · $0.0018
diff vs i2: +9/-9
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
handle_wall = 5;
- handle_depth = 18;
+ handle_depth = 22; // radial extent from body toward outside
+ handle_embed = 3; // overlap into body for robust union
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
- // D-shaped handle with the flat side facing the mug body
- // Built in YZ cross-section and extruded along +X
- translate([outer_d/2 - 1.0, 0, height/2 - handle_clear_h/2])
+ // Create a D-shaped cross section in the YZ plane and extrude along +X.
+ // Flat side is toward the mug body, curved side outward.
+ translate([outer_d/2 - handle_embed, 0, height/2 - handle_clear_h/2])
rotate([0, 90, 0])
linear_extrude(height = handle_depth)
difference() {
- // outer profile: rectangle on body side + semicircle outward
union() {
+ // Outer boundary: flat-backed rectangle + semicircle
translate([0, -(handle_clear_h/2 + handle_wall)])
square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2 + handle_wall);
}
- // inner void: 25mm wide x 30mm high
+ // Inner void: 25mm wide x 30mm high
union() {
translate([0, -handle_clear_h/2])
square([handle_wall + 0.2, handle_clear_h], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2);
}
}
}
union() {
mug_body();
- // Attach handle only on the +X side, centered vertically
- translate([0.6, 0, 0])
- handle_solid();
+ // Handle only on the +X side, centered vertically, with guaranteed overlap
+ handle_solid();
}
SCAD (52 lines)
$fn = 128;
outer_d = 80;
inner_d = 70;
height = 90;
bottom_thickness = 6;
handle_clear_w = 25;
handle_clear_h = 30;
handle_wall = 5;
handle_depth = 22; // radial extent from body toward outside
handle_embed = 3; // overlap into body for robust union
module mug_body() {
difference() {
cylinder(h = height, d = outer_d);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, d = inner_d);
}
}
module handle_solid() {
// Create a D-shaped cross section in the YZ plane and extrude along +X.
// Flat side is toward the mug body, curved side outward.
translate([outer_d/2 - handle_embed, 0, height/2 - handle_clear_h/2])
rotate([0, 90, 0])
linear_extrude(height = handle_depth)
difference() {
union() {
// Outer boundary: flat-backed rectangle + semicircle
translate([0, -(handle_clear_h/2 + handle_wall)])
square([handle_wall, handle_clear_h + 2*handle_wall], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2 + handle_wall);
}
// Inner void: 25mm wide x 30mm high
union() {
translate([0, -handle_clear_h/2])
square([handle_wall + 0.2, handle_clear_h], center = false);
translate([handle_wall, 0])
circle(r = handle_clear_h/2);
}
}
}
union() {
mug_body();
// Handle only on the +X side, centered vertically, with guaranteed overlap
handle_solid();
}