4.7s
· 1073/248t · $0.0061
diff vs bare: +12/-12
- $fn = 96;
+ $fn = 128;
- // Main cup dimensions
+ // Cup dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
- handle_tube_r = 12; // radius of the ring tube
- handle_major_r = 22; // distance from torus center to tube center
+ handle_tube_r = 12; // radius of the ring section
+ handle_major_r = 18; // ring center to tube center
handle_center_z = height / 2;
- handle_center_x = outer_r + handle_major_r - 2; // slightly intersect cup wall
+ handle_center_x = outer_r + handle_major_r - 4; // intersect outer wall by tube radius
- module cup_body() {
+ module cup() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
- cylinder(h = height - bottom_thickness, r = outer_r - wall);
+ cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
- module handle_ring() {
+ module ring_handle() {
translate([handle_center_x, 0, handle_center_z])
- rotate([90, 0, 0])
- rotate_extrude(angle = 360)
+ rotate([0, 90, 0])
+ rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
circle(r = handle_tube_r);
}
union() {
- cup_body();
- handle_ring();
+ cup();
+ ring_handle();
}
SCAD (35 lines)
$fn = 128;
// Cup dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
handle_tube_r = 12; // radius of the ring section
handle_major_r = 18; // ring center to tube center
handle_center_z = height / 2;
handle_center_x = outer_r + handle_major_r - 4; // intersect outer wall by tube radius
module cup() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
module ring_handle() {
translate([handle_center_x, 0, handle_center_z])
rotate([0, 90, 0])
rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
circle(r = handle_tube_r);
}
union() {
cup();
ring_handle();
}
5.3s
· 1076/249t · $0.0061
diff vs i1: +11/-9
$fn = 128;
- // Cup dimensions
+ // Mug dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
- handle_tube_r = 12; // radius of the ring section
- handle_major_r = 18; // ring center to tube center
+ handle_ring_r = 12; // ring tube radius
handle_center_z = height / 2;
- handle_center_x = outer_r + handle_major_r - 4; // intersect outer wall by tube radius
- module cup() {
+ // Make the handle extend sufficiently outward while staying attached
+ handle_major_r = 24; // distance from handle center to tube center
+ handle_center_x = outer_r + handle_major_r - handle_ring_r + 2;
+
+ module mug() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
- module ring_handle() {
+ module handle() {
translate([handle_center_x, 0, handle_center_z])
rotate([0, 90, 0])
rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
- circle(r = handle_tube_r);
+ circle(r = handle_ring_r);
}
union() {
- cup();
- ring_handle();
+ mug();
+ handle();
}
SCAD (37 lines)
$fn = 128;
// Mug dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
handle_ring_r = 12; // ring tube radius
handle_center_z = height / 2;
// Make the handle extend sufficiently outward while staying attached
handle_major_r = 24; // distance from handle center to tube center
handle_center_x = outer_r + handle_major_r - handle_ring_r + 2;
module mug() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
module handle() {
translate([handle_center_x, 0, handle_center_z])
rotate([0, 90, 0])
rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
circle(r = handle_ring_r);
}
union() {
mug();
handle();
}
5.1s
· 1077/289t · $0.0068
diff vs i2: +6/-5
$fn = 128;
// Mug dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
- handle_ring_r = 12; // ring tube radius
+ handle_tube_r = 12; // tube radius of the ring handle
+ handle_outer_proj = 28; // outward projection from mug outer surface to handle outermost edge
handle_center_z = height / 2;
- // Make the handle extend sufficiently outward while staying attached
- handle_major_r = 24; // distance from handle center to tube center
- handle_center_x = outer_r + handle_major_r - handle_ring_r + 2;
+ // Place handle so it attaches to the mug outer wall and protrudes outward
+ handle_major_r = (handle_outer_proj - handle_tube_r) / 2 + handle_tube_r;
+ handle_center_x = outer_r + (handle_outer_proj - handle_tube_r) / 2;
module mug() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
module handle() {
translate([handle_center_x, 0, handle_center_z])
rotate([0, 90, 0])
rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
- circle(r = handle_ring_r);
+ circle(r = handle_tube_r);
}
union() {
mug();
handle();
}
SCAD (38 lines)
$fn = 128;
// Mug dimensions
outer_d = 80;
outer_r = outer_d / 2;
height = 100;
wall = 4;
bottom_thickness = 6;
// Handle dimensions
handle_tube_r = 12; // tube radius of the ring handle
handle_outer_proj = 28; // outward projection from mug outer surface to handle outermost edge
handle_center_z = height / 2;
// Place handle so it attaches to the mug outer wall and protrudes outward
handle_major_r = (handle_outer_proj - handle_tube_r) / 2 + handle_tube_r;
handle_center_x = outer_r + (handle_outer_proj - handle_tube_r) / 2;
module mug() {
difference() {
cylinder(h = height, r = outer_r);
translate([0, 0, bottom_thickness])
cylinder(h = height - bottom_thickness + 0.1, r = outer_r - wall);
}
}
module handle() {
translate([handle_center_x, 0, handle_center_z])
rotate([0, 90, 0])
rotate_extrude(convexity = 10)
translate([handle_major_r, 0, 0])
circle(r = handle_tube_r);
}
union() {
mug();
handle();
}