iter-png-3/claude-sonnet-4-6 / tier-2-offset-handle-mug
success tier 2
bare (claude sonnet 4.6)
render
$fn = 128;
outer_r = 40;
inner_r = 35;
mug_h = 90;
bot_t = 6;
handle_z = mug_h / 2; // 高さ方向中央 = 45mm
h_space_h = 30; // 取手内側空間 高さ
h_space_w = 25; // 取手内側空間 幅
handle_t = 10; // 取手断面の太さ
// 各部寸法
// バーはX軸方向に伸びる。本体に食い込んで確実結合
bar_x_start = outer_r - 3;
bar_x_end = outer_r + h_space_w; // バー外端X
bar_x_len = bar_x_end - bar_x_start;
bar_z_top = handle_z + h_space_h / 2; // = 60
bar_z_bot = handle_z - h_space_h / 2; // = 30
// 半円アーム中心: (bar_x_end, handle_z)
// 半円の回転半径 (中心線ベース) = h_space_h/2 = 15
arc_cx = bar_x_end;
arc_cz = handle_z;
arc_r = h_space_h / 2; // = 15
// 上バー: Z中心 = bar_z_top, 断面 handle_t x handle_t
module top_bar() {
translate([bar_x_start, -handle_t/2, bar_z_top - handle_t/2])
cube([bar_x_len, handle_t, handle_t]);
}
// 下バー
module bot_bar() {
translate([bar_x_start, -handle_t/2, bar_z_bot - handle_t/2])
cube([bar_x_len, handle_t, handle_t]);
}
// 半円アーム: XZ平面内で -90°〜+90° の半円
// 各セグメントを hull() で繋ぐ
// 断面: handle_t x handle_t の立方体
module arc_arm() {
N = 48;
for (i = [0 : N-1]) {
a1 = -90 + 180 * i / N;
a2 = -90 + 180 * (i+1) / N;
x1 = arc_cx + arc_r * cos(a1);
z1 = arc_cz + arc_r * sin(a1);
x2 = arc_cx + arc_r * cos(a2);
z2 = arc_cz + arc_r * sin(a2);
hull() {
translate([x1 - handle_t/2, -handle_t/2, z1 - handle_t/2])
cube([handle_t, handle_t, handle_t]);
translate([x2 - handle_t/2, -handle_t/2, z2 - handle_t/2])
cube([handle_t, handle_t, handle_t]);
}
}
}
// バーと半円を滑らかに繋ぐジョイント
module top_joint() {
x1 = arc_cx + arc_r * cos(-90);
z1 = arc_cz + arc_r * sin(-90);
hull() {
translate([bar_x_end - handle_t/2, -handle_t/2, bar_z_top - handle_t/2])
cube([handle_t, handle_t, handle_t]);
translate([x1 - handle_t/2, -handle_t/2, z1 - handle_t/2])
cube([handle_t, handle_t, handle_t]);
}
}
module bot_joint() {
x1 = arc_cx + arc_r * cos(90);
z1 = arc_cz + arc_r * sin(90);
hull() {
translate([bar_x_end - handle_t/2, -handle_t/2, bar_z_bot - handle_t/2])
cube([handle_t, handle_t, handle_t]);
translate([x1 - handle_t/2, -handle_t/2, z1 - handle_t/2])
cube([handle_t, handle_t, handle_t]);
}
}
module handle() {
union() {
top_bar();
bot_bar();
arc_arm();
top_joint();
bot_joint();
}
}
module mug_body() {
difference() {
cylinder(r = outer_r, h = mug_h);
translate([0, 0, bot_t])
cylinder(r = inner_r, h = mug_h - bot_t + 0.1);
}
}
union() {
mug_body();
handle();
} パラメータ (7) —
スライダを動かすと openscad-wasm で再レンダリング
iteration chain
各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。
← parent
iter-png-2/claude-sonnet-4-6 success prompt
OpenSCAD で、向きが指定されたマグカップを作ってください。 本体: - 外径 80mm、内径 70mm(肉厚 5mm)、高さ 90mm の円筒形マグ - 底面の厚みは 6mm - 内側は飲み物を入れられるよう中空 取手(handle): - マグの **+X 軸方向の側面のみ** に付ける(他の方向には付けない) - 取手は D 字形状(外側が半円、本体側が直線)で、本体外周にしっかり接続する - 取手の内側の空間は高さ 30mm × 幅 25mm(指 3 本ぐらい入る) - 取手はマグの高さ方向の中央付近に付ける - 本体と取手は確実に union され、マニフォールド(隙間や宙吊りなし)を保つ 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。