4.5s
· 1392/503t · $0.0039
diff vs bare: +8/-15
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
- handle_radius = 12;
+ handle_tube_radius = 12; // 取手チューブの半径
+ handle_major_radius = 25; // 取手の中心までの距離
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
- // 取手(リング状)
+ // 取手(リング状トーラス)
module handle() {
- handle_distance = outer_radius + handle_radius;
-
- // 取手の中心位置
- translate([handle_distance, 0, handle_center_height])
- rotate([0, 90, 0])
- torus(r = handle_radius, R = handle_radius * 0.5);
+ translate([0, 0, handle_center_height])
+ rotate([0, 0, 0])
+ rotate_extrude(angle = 180, $fn = 100)
+ translate([handle_major_radius, 0, 0])
+ circle(r = handle_tube_radius, $fn = 100);
}
- // トーラス(ドーナツ状)を描画するモジュール
- module torus(r = 10, R = 3) {
- rotate_extrude($fn = 100)
- translate([r, 0, 0])
- circle(r = R, $fn = 100);
- }
-
// 全体の組み立て
union() {
cup_body();
handle();
}
SCAD (39 lines)
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
handle_tube_radius = 12; // 取手チューブの半径
handle_major_radius = 25; // 取手の中心までの距離
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
// 取手(リング状トーラス)
module handle() {
translate([0, 0, handle_center_height])
rotate([0, 0, 0])
rotate_extrude(angle = 180, $fn = 100)
translate([handle_major_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 100);
}
// 全体の組み立て
union() {
cup_body();
handle();
}
4.1s
· 1354/481t · $0.0038
diff vs i1: +4/-5
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
handle_tube_radius = 12; // 取手チューブの半径
- handle_major_radius = 25; // 取手の中心までの距離
+ handle_major_radius = 50; // 取手の中心までの距離
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
// 取手(リング状トーラス)
module handle() {
translate([0, 0, handle_center_height])
- rotate([0, 0, 0])
- rotate_extrude(angle = 180, $fn = 100)
- translate([handle_major_radius, 0, 0])
- circle(r = handle_tube_radius, $fn = 100);
+ rotate_extrude($fn = 100)
+ translate([handle_major_radius, 0, 0])
+ circle(r = handle_tube_radius, $fn = 100);
}
// 全体の組み立て
union() {
cup_body();
handle();
}
SCAD (38 lines)
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
handle_tube_radius = 12; // 取手チューブの半径
handle_major_radius = 50; // 取手の中心までの距離
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
// 取手(リング状トーラス)
module handle() {
translate([0, 0, handle_center_height])
rotate_extrude($fn = 100)
translate([handle_major_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 100);
}
// 全体の組み立て
union() {
cup_body();
handle();
}
4.5s
· 1335/575t · $0.0042
diff vs i2: +8/-5
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
handle_tube_radius = 12; // 取手チューブの半径
- handle_major_radius = 50; // 取手の中心までの距離
+ handle_major_radius = 38; // 取手の中心までの距離(カップ外周から十分にはみ出す)
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
- // 取手(リング状トーラス)
+ // 取手(片側に付くリング状トーラスの一部)
module handle() {
translate([0, 0, handle_center_height])
- rotate_extrude($fn = 100)
- translate([handle_major_radius, 0, 0])
- circle(r = handle_tube_radius, $fn = 100);
+ rotate([0, 0, -30])
+ difference() {
+ rotate_extrude(angle = 60, $fn = 100)
+ translate([handle_major_radius, 0, 0])
+ circle(r = handle_tube_radius, $fn = 100);
+ }
}
// 全体の組み立て
union() {
cup_body();
handle();
}
SCAD (41 lines)
// マグカップのパラメータ
outer_diameter = 80;
outer_radius = outer_diameter / 2;
height = 100;
wall_thickness = 4;
bottom_thickness = 6;
inner_radius = outer_radius - wall_thickness;
// 取手のパラメータ
handle_tube_radius = 12; // 取手チューブの半径
handle_major_radius = 38; // 取手の中心までの距離(カップ外周から十分にはみ出す)
handle_center_height = height / 2;
// メインのマグカップ本体
module cup_body() {
difference() {
// 外側の円柱
cylinder(r = outer_radius, h = height, $fn = 100);
// 内側をくり抜く(底面の厚みを考慮)
translate([0, 0, bottom_thickness])
cylinder(r = inner_radius, h = height - bottom_thickness + 1, $fn = 100);
}
}
// 取手(片側に付くリング状トーラスの一部)
module handle() {
translate([0, 0, handle_center_height])
rotate([0, 0, -30])
difference() {
rotate_extrude(angle = 60, $fn = 100)
translate([handle_major_radius, 0, 0])
circle(r = handle_tube_radius, $fn = 100);
}
}
// 全体の組み立て
union() {
cup_body();
handle();
}