9.4s
· 1395/682t · $0.0144
diff vs bare: +23/-16
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
- handle_radius = 12;
- handle_tube_radius = 4;
+ handle_radius = 15;
+ handle_tube_radius = 3;
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
- // 取手
+ // 取手 - トーラス形状で作成
translate([outer_diameter/2 + handle_radius, 0, height/2]) {
- rotate([0, 90, 0]) {
- rotate_extrude($fn = 50) {
+ rotate([90, 0, 0]) {
+ rotate_extrude($fn = 60) {
translate([handle_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
+
+ // 取手をカップ本体に接続するための部分
+ hull() {
+ // カップ側面の接続点
+ translate([outer_diameter/2 - 2, 0, height/2 + handle_radius]) {
+ sphere(r = handle_tube_radius, $fn = 20);
+ }
+ translate([outer_diameter/2 - 2, 0, height/2 - handle_radius]) {
+ sphere(r = handle_tube_radius, $fn = 20);
+ }
+ // 取手側の接続点
+ translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 + handle_radius]) {
+ sphere(r = handle_tube_radius, $fn = 20);
+ }
+ translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 - handle_radius]) {
+ sphere(r = handle_tube_radius, $fn = 20);
+ }
+ }
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
-
- // 取手の内側をくり抜き
- translate([outer_diameter/2 + handle_radius, 0, height/2]) {
- rotate([0, 90, 0]) {
- rotate_extrude($fn = 50) {
- translate([handle_radius, 0, 0]) {
- circle(r = handle_tube_radius - 2, $fn = 20);
- }
- }
- }
- }
}
SCAD (52 lines)
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
handle_radius = 15;
handle_tube_radius = 3;
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
// 取手 - トーラス形状で作成
translate([outer_diameter/2 + handle_radius, 0, height/2]) {
rotate([90, 0, 0]) {
rotate_extrude($fn = 60) {
translate([handle_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
// 取手をカップ本体に接続するための部分
hull() {
// カップ側面の接続点
translate([outer_diameter/2 - 2, 0, height/2 + handle_radius]) {
sphere(r = handle_tube_radius, $fn = 20);
}
translate([outer_diameter/2 - 2, 0, height/2 - handle_radius]) {
sphere(r = handle_tube_radius, $fn = 20);
}
// 取手側の接続点
translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 + handle_radius]) {
sphere(r = handle_tube_radius, $fn = 20);
}
translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 - handle_radius]) {
sphere(r = handle_tube_radius, $fn = 20);
}
}
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
}
8.1s
· 1544/594t · $0.0135
diff vs i1: +17/-21
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
- handle_radius = 15;
+ handle_radius = 12;
handle_tube_radius = 3;
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
- // 取手 - トーラス形状で作成
- translate([outer_diameter/2 + handle_radius, 0, height/2]) {
+ // 取手をカップ本体に接続するための部分
+ translate([outer_diameter/2, 0, height/2]) {
rotate([90, 0, 0]) {
+ hull() {
+ // カップ側の接続点
+ translate([0, 0, 0])
+ cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
+ // 取手の中心位置
+ translate([handle_radius + 5, 0, 0])
+ cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
+ }
+ }
+ }
+
+ // リング状の取手
+ translate([outer_diameter/2 + handle_radius + 5, 0, height/2]) {
+ rotate([90, 0, 0]) {
rotate_extrude($fn = 60) {
translate([handle_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
-
- // 取手をカップ本体に接続するための部分
- hull() {
- // カップ側面の接続点
- translate([outer_diameter/2 - 2, 0, height/2 + handle_radius]) {
- sphere(r = handle_tube_radius, $fn = 20);
- }
- translate([outer_diameter/2 - 2, 0, height/2 - handle_radius]) {
- sphere(r = handle_tube_radius, $fn = 20);
- }
- // 取手側の接続点
- translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 + handle_radius]) {
- sphere(r = handle_tube_radius, $fn = 20);
- }
- translate([outer_diameter/2 + handle_radius + handle_radius, 0, height/2 - handle_radius]) {
- sphere(r = handle_tube_radius, $fn = 20);
- }
- }
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
}
SCAD (48 lines)
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
handle_radius = 12;
handle_tube_radius = 3;
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
// 取手をカップ本体に接続するための部分
translate([outer_diameter/2, 0, height/2]) {
rotate([90, 0, 0]) {
hull() {
// カップ側の接続点
translate([0, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
// 取手の中心位置
translate([handle_radius + 5, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
}
}
}
// リング状の取手
translate([outer_diameter/2 + handle_radius + 5, 0, height/2]) {
rotate([90, 0, 0]) {
rotate_extrude($fn = 60) {
translate([handle_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
}
8.7s
· 1480/614t · $0.0136
diff vs i2: +6/-6
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
- handle_radius = 12;
- handle_tube_radius = 3;
+ handle_outer_radius = 18; // 取手の外径を大きく
+ handle_tube_radius = 4; // 取手の太さを少し太く
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
// 取手をカップ本体に接続するための部分
translate([outer_diameter/2, 0, height/2]) {
rotate([90, 0, 0]) {
hull() {
// カップ側の接続点
translate([0, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
- // 取手の中心位置
- translate([handle_radius + 5, 0, 0])
+ // 取手の内側接続点
+ translate([handle_outer_radius - handle_tube_radius, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
}
}
}
// リング状の取手
- translate([outer_diameter/2 + handle_radius + 5, 0, height/2]) {
+ translate([outer_diameter/2 + handle_outer_radius - handle_tube_radius, 0, height/2]) {
rotate([90, 0, 0]) {
rotate_extrude($fn = 60) {
- translate([handle_radius, 0, 0]) {
+ translate([handle_outer_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
}
SCAD (48 lines)
// マグカップのパラメータ
outer_diameter = 80;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
handle_outer_radius = 18; // 取手の外径を大きく
handle_tube_radius = 4; // 取手の太さを少し太く
// 内径を計算
inner_diameter = outer_diameter - 2 * wall_thickness;
inner_height = height - bottom_thickness;
difference() {
union() {
// 外側のシリンダー(カップ本体)
cylinder(h = height, d = outer_diameter, $fn = 100);
// 取手をカップ本体に接続するための部分
translate([outer_diameter/2, 0, height/2]) {
rotate([90, 0, 0]) {
hull() {
// カップ側の接続点
translate([0, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
// 取手の内側接続点
translate([handle_outer_radius - handle_tube_radius, 0, 0])
cylinder(h = handle_tube_radius * 2, d = handle_tube_radius * 2, center = true, $fn = 20);
}
}
}
// リング状の取手
translate([outer_diameter/2 + handle_outer_radius - handle_tube_radius, 0, height/2]) {
rotate([90, 0, 0]) {
rotate_extrude($fn = 60) {
translate([handle_outer_radius, 0, 0]) {
circle(r = handle_tube_radius, $fn = 20);
}
}
}
}
}
// 内側をくり抜き
translate([0, 0, bottom_thickness]) {
cylinder(h = inner_height + 1, d = inner_diameter, $fn = 100);
}
}