iter-png-3/gpt-4.1 / tier-2-offset-handle-mug
success tier 2
bare (gpt 4.1)
render
// マグ本体パラメータ
mug_outer_diameter = 80; // mm
mug_inner_diameter = 70; // mm
mug_height = 90; // mm
mug_wall_thickness = 5; // mm
mug_bottom_thickness = 6; // mm
// 取手パラメータ
handle_inner_height = 30; // mm
handle_inner_width = 25; // mm
handle_thickness = 12; // mm // 指が入りつつ頑丈さ優先
mug_radius = mug_outer_diameter / 2;
mug_inner_radius = mug_inner_diameter / 2;
// 取手スケッチ中心位置
handle_center_z = mug_height/2;
module mug_body() {
difference() {
cylinder(h = mug_height, r = mug_radius, $fn = 128);
translate([0, 0, mug_bottom_thickness])
cylinder(h = mug_height - mug_bottom_thickness, r = mug_inner_radius, $fn = 128);
}
}
module handle_D() {
// D字断面の外周
inner_r = handle_inner_height/2; // D字の半円内半径
outer_r = inner_r + handle_thickness;
// D字2Dプロファイル
// 左辺(本体接触)が直線、右辺が半円
handle_profile =
concat( // 下から上への直線
[ [0, -inner_r], [0, inner_r] ],
[ for (a = [90 : -1 : -90])
[handle_inner_width/2 + inner_r * cos(a), inner_r * sin(a)] ],
[ [handle_inner_width, -inner_r] ]
);
// 外周も同様にオフセット
handle_outer_profile =
concat(
[ [0, -outer_r], [0, outer_r] ],
[ for (a = [90 : -1 : -90])
[handle_inner_width/2 + outer_r * cos(a), outer_r * sin(a)] ],
[ [handle_inner_width, -outer_r] ]
);
// 2Dハンドル断面
polygon(
concat(
handle_outer_profile,
[for (i = [len(handle_profile)-1 : -1 : 0]) handle_profile[i]] // 内周を逆順で結ぶ
)
);
}
// 実体化
union() {
mug_body();
// 取手: X軸方向に平行で、マグ高さ中央に配置
translate([mug_radius, 0, handle_center_z]) // 本体外周に密着
rotate([90,0,0]) // 平面をY-Zに(マグ円筒に垂直に)
linear_extrude(height=handle_inner_width, center=true)
handle_D();
} パラメータ (8) —
スライダを動かすと openscad-wasm で再レンダリング
iteration chain
各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。
← parent
iter-png-2/gpt-4.1 success prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。