bare-high/o4-mini / tier-2-offset-handle-mug
success tier 2
bare (o4 mini)
render
// mug 本体パラメータ
outer_d = 80;
inner_d = 70;
height = 90;
bottom_t = 6;
// 取手パラメータ
handle_open_h = 30; // 空間 高さ
handle_open_w = 25; // 空間 幅
handle_wall = 5; // 取手肉厚
handle_depth = 20; // 取手奥行
// 計算
wall_t = (outer_d - inner_d)/2; // マグ肉厚 5
R_i = handle_open_h/2;
rect_i = handle_open_w - R_i;
T = handle_wall;
R_o = R_i + T;
rect_o = rect_i + T;
// D字形状モジュール(半円+直線)
module D_shape(r, rect_w) {
union() {
translate([0, -r]) square([rect_w, 2*r]);
difference() {
translate([rect_w, 0]) circle(r = r, $fn = 64);
translate([-1000, -1000]) square([rect_w + 1000, 2000]);
}
}
}
// D字リング(外側D−内側D)
module D_ring() {
difference() {
D_shape(R_o, rect_o);
translate([T, 0]) D_shape(R_i, rect_i);
}
}
// 取手形状
module handle() {
rotate([90, 0, 0])
linear_extrude(height = handle_depth, center = true)
D_ring();
}
// マグ本体
module mug() {
difference() {
cylinder(r = outer_d/2, h = height, $fn = 100);
translate([0, 0, bottom_t])
cylinder(r = inner_d/2, h = height - bottom_t, $fn = 100);
}
}
// 結合
union() {
mug();
translate([outer_d/2, 0, height/2])
handle();
} パラメータ (8) —
スライダを動かすと openscad-wasm で再レンダリング
prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。