6.9s
· 1390/508t · $0.0197
diff vs bare: +8/-6
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
- handle_r = 12; // 取手のリング半径(穴の半径)
- handle_thick = 6; // 取手の太さ
+ handle_r = 20; // 取手のリング半径(穴の半径)→指が通るサイズに拡大
+ handle_thick = 8; // 取手の太さを増やしてしっかりした取手に
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
- // カップの中心高さに配置
- translate([outer_d / 2, 0, height / 2])
+ // 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
+ // カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
+ translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
- // 取手の一部がカップ内部に被らないよう、外側部分のみ残す
+ // 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
- cylinder(h = height + 1, d = outer_d - 0.01);
+ translate([0, 0, -1])
+ cylinder(h = height + 2, d = outer_d - 0.01);
}
}
SCAD (39 lines)
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
handle_r = 20; // 取手のリング半径(穴の半径)→指が通るサイズに拡大
handle_thick = 8; // 取手の太さを増やしてしっかりした取手に
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
// 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
// カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
// 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
translate([0, 0, -1])
cylinder(h = height + 2, d = outer_d - 0.01);
}
}
5.6s
· 1491/464t · $0.0191
diff vs i1: +4/-4
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
- handle_r = 20; // 取手のリング半径(穴の半径)→指が通るサイズに拡大
- handle_thick = 8; // 取手の太さを増やしてしっかりした取手に
+ handle_r = 12; // 取手のリング半径(課題指定どおり)
+ handle_thick = 8; // 取手の太さ
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
- // 取手の中心を、リングがカップ外周にしっかり接続される位置に配置
- // カップ外周(x = outer_d/2)にリング内側が来るように、中心を外側にオフセット
+ // リングがカップ外周から十分はみ出すように、
+ // リングの内側端をカップ外周に少しめり込ませて接続する
translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
// 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
translate([0, 0, -1])
cylinder(h = height + 2, d = outer_d - 0.01);
}
}
SCAD (39 lines)
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
handle_r = 12; // 取手のリング半径(課題指定どおり)
handle_thick = 8; // 取手の太さ
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
// リングがカップ外周から十分はみ出すように、
// リングの内側端をカップ外周に少しめり込ませて接続する
translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
// 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
translate([0, 0, -1])
cylinder(h = height + 2, d = outer_d - 0.01);
}
}
6.9s
· 1447/567t · $0.0214
diff vs i2: +6/-5
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
- handle_r = 12; // 取手のリング半径(課題指定どおり)
- handle_thick = 8; // 取手の太さ
+ handle_r = 18; // 取手リングの中心半径(指が通るサイズに拡大)
+ handle_thick = 7; // 取手の太さ
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
- // リングがカップ外周から十分はみ出すように、
- // リングの内側端をカップ外周に少しめり込ませて接続する
- translate([outer_d / 2 + handle_r - handle_thick/2, 0, height / 2])
+ // リングをカップ側面にしっかり接続するため、
+ // リング内端をカップ外周に少しめり込ませる
+ overlap = 3;
+ translate([outer_d/2 + handle_r - overlap, 0, height/2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
// 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
translate([0, 0, -1])
cylinder(h = height + 2, d = outer_d - 0.01);
}
}
SCAD (40 lines)
// マグカップ
$fn = 100;
outer_d = 80; // 外径
height = 100; // 高さ
wall = 4; // 肉厚
bottom = 6; // 底厚
handle_r = 18; // 取手リングの中心半径(指が通るサイズに拡大)
handle_thick = 7; // 取手の太さ
module mug() {
difference() {
// 外側
cylinder(h = height, d = outer_d);
// 内側くり抜き
translate([0, 0, bottom])
cylinder(h = height - bottom + 1, d = outer_d - 2 * wall);
}
}
module handle() {
// リングをカップ側面にしっかり接続するため、
// リング内端をカップ外周に少しめり込ませる
overlap = 3;
translate([outer_d/2 + handle_r - overlap, 0, height/2])
rotate([90, 0, 0])
rotate_extrude($fn = 80)
translate([handle_r, 0, 0])
circle(d = handle_thick);
}
union() {
mug();
// 取手のうちカップ内部に入り込む部分はカット
difference() {
handle();
translate([0, 0, -1])
cylinder(h = height + 2, d = outer_d - 0.01);
}
}