vibe-openscad

iter-png-2/gpt-5-mini / tier-3-butt-hinge

render_error tier 3
error
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-wURp5d/input.scad, line 49
Can't parse file '/tmp/render-wURp5d/input.scad'!

bare (gpt 5 mini)

render
no render
render_error 89.9s · 3007/5356t · $0.0115
openscad stl render failed (exit 1): ERROR: Parser error: syntax error in file ../../../../../tmp/render-wURp5d/input.scad, line 49
Can't parse file '/tmp/render-wURp5d/input.scad'!

SCAD (143 lines)
// openscad
// Corrected small butt hinge (assembled, 180° open)
// - Two leaves (30 x 25 x 2 mm), pin along Y, leaves lie flat in same plane (Z)
// - Knuckles: 5 segments (each 6 mm long along Y) at Y = [-12, -6, 0, 6, 12]
//   Left leaf knuckles at [-12, 0, 12], right leaf at [-6, 6]
// - Knuckle outer Ø8 mm, inner bore Ø4.6 mm
// - Pin Ø4 mm, length 32 mm (1 mm protruding each end)
// - Left and right are separate parts (not boolean-unioned) so they can rotate about pin
// - Countersunk M3 holes (3 per leaf) at Y = [-8, 0, 8], 5 mm from outer edge
//   Countersink Ø6 mm x depth 1 mm (from top surface) + through Ø3.2 mm

$fn = 64;

// Dimensions
plate_len = 30;       // along Y
plate_w = 25;         // along X (from hinge outward)
thickness = 2;        // along Z
half_th = thickness / 2;

knuckle_seg = 6;      // each segment length along Y
knuckle_positions = [-12, -6, 0, 6, 12];
left_knuckles = [-12, 0, 12];
right_knuckles = [-6, 6];

knuckle_r_out = 4;    // outer radius (Ø8)
knuckle_r_in = 2.3;   // inner bore radius (Ø4.6)

pin_dia = 4;
pin_r = pin_dia / 2;
pin_len = 32;         // along Y

screw_hole_positions = [-8, 0, 8];
screw_countersink_diam = 6;    // top diameter
screw_countersink_depth = 1;
screw_through_dia = 3.2;       // through hole
screw_offset_from_outer_edge = 5; // mm inward from outer edge along X

// Assembly: call parts separately so they remain distinct in the scene
color("silver") left_leaf();
color("silver") right_leaf();
color("gray") pin();


// Modules

module left_leaf() {
    // Base plate
    plate = translate([-plate_w, -plate_len/2, -half_th])
            cube([plate_w, plate_len, thickness]);

    // Knuckle box representing the plate half-space (X <= 0)
    knuckle_plate_box = translate([-plate_w, -plate_len/2, -100])
                        cube([plate_w, plate_len, 200]);

    // Build knuckle pieces attached to left plate by intersecting full knuckle cylinders with knuckle_plate_box
    knuckles = union();
    for (ypos = left_knuckles) {
        knuckle_cyl = translate([0, ypos, 0])
                        rotate([90, 0, 0])
                            cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
        knuckles = knuckles 
                + intersection() { knuckle_cyl; knuckle_plate_box; };
    }

    // Compose plate + knuckles, then subtract bores and screw holes
    difference() {
        union() {
            plate;
            knuckles;
        }

        // knuckle bores (along Y), subtract from left knuckles
        for (ypos = left_knuckles) {
            translate([0, ypos, 0])
                rotate([90, 0, 0])
                    cylinder(h = 60, r = knuckle_r_in, center=true);
        }

        // screw through holes and countersinks (from top Z = +half_th)
        for (hy = screw_hole_positions) {
            hole_x = -plate_w + screw_offset_from_outer_edge;
            // through hole (along Z)
            translate([hole_x, hy, -half_th - 1])
                cylinder(h = thickness + 2, r = screw_through_dia/2, center=false);
            // countersink frustum: small radius at bottom, large at top
            translate([hole_x, hy, half_th - screw_countersink_depth])
                cylinder(h = screw_countersink_depth, r1 = screw_through_dia/2, r2 = screw_countersink_diam/2, center=false);
        }
    }
}

module right_leaf() {
    // Base plate
    plate = translate([0, -plate_len/2, -half_th])
            cube([plate_w, plate_len, thickness]);

    // Knuckle box representing the plate half-space (X >= 0)
    knuckle_plate_box = translate([0, -plate_len/2, -100])
                        cube([plate_w, plate_len, 200]);

    // Build knuckle pieces attached to right plate by intersecting full knuckle cylinders with knuckle_plate_box
    knuckles = union();
    for (ypos = right_knuckles) {
        knuckle_cyl = translate([0, ypos, 0])
                        rotate([90, 0, 0])
                            cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
        knuckles = knuckles 
                + intersection() { knuckle_cyl; knuckle_plate_box; };
    }

    // Compose plate + knuckles, then subtract bores and screw holes
    difference() {
        union() {
            plate;
            knuckles;
        }

        // knuckle bores (along Y), subtract from right knuckles
        for (ypos = right_knuckles) {
            translate([0, ypos, 0])
                rotate([90, 0, 0])
                    cylinder(h = 60, r = knuckle_r_in, center=true);
        }

        // screw through holes and countersinks (from top Z = +half_th)
        for (hy = screw_hole_positions) {
            hole_x = plate_w - screw_offset_from_outer_edge;
            // through hole (along Z)
            translate([hole_x, hy, -half_th - 1])
                cylinder(h = thickness + 2, r = screw_through_dia/2, center=false);
            // countersink frustum: small radius at bottom, large at top
            translate([hole_x, hy, half_th - screw_countersink_depth])
                cylinder(h = screw_countersink_depth, r1 = screw_through_dia/2, r2 = screw_countersink_diam/2, center=false);
        }
    }
}

module pin() {
    // Pin axis along Y, centered at origin. Pin length extends 1 mm beyond knuckle ends.
    translate([0, 0, 0])
        rotate([90, 0, 0])
            cylinder(h = pin_len, r = pin_r, center=true);
}

meta

runIditer-png-2_gpt-5-mini-487f5601b697-2026-04-28T17-34-45-449Z
matrixIditer-png-2/gpt-5-mini
signature487f5601b697d658…
provideropenai
modelgpt-5-mini-2025-08-07
harnessbare
statusrender_error
duration89.93s (wallclock: load + prompt eval + generation + network)
tokens3007 in / 5356 out
wallclock tok/s59.6 tok/s (end-to-end)
cost$0.0115
createdAt2026-04-28T17:34:45.449Z
gitCommitbe87c9f2adaf
openscadOpenSCAD version 2026.04.27

iteration chain

各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。

prompt

OpenSCAD で、家具用の小型バット蝶番(butt hinge)を作ってください。
3 つのパーツ(左板、右板、ピン軸)が組み合わさって動作する完成品を、
「開いた状態(180°)」で 1 つの SCAD ファイルに配置して出力します。

寸法と配置:
- 板(leaf)2 枚: 30mm × 25mm × 厚さ 2mm の鉄板形状
  - 縦 30mm の辺がピン軸に沿う(ヒンジ軸方向)
  - 横 25mm の辺が回転で開く方向に伸びる
- ピン軸: 直径 4mm の円柱、長さ 32mm(両端 1mm ずつ knuckle から飛び出す)
- knuckle(筒部): 縦 30mm を 5 等分(各 6mm)に区切り、左板に 3 個・右板に 2 個を
  互い違いに配置(左板は外側 2 個 + 中央 1 個、右板は中間 2 個)
- knuckle 外径 8mm、内径はピン軸 + 0.3mm クリアランス(= 4.6mm 穴)
- 左板と右板はピン軸を共有して回転可能。180° 開いた状態で、両板の
  平らな面が同一平面に来るように配置する
- 各板の knuckle から離れた側に、M3 用の皿穴を 3 個ずつ
  (穴ピッチは板の縦方向に 8mm 間隔、皿穴は表面から見て直径 6mm × 深さ 1mm
  のテーパ + 直径 3.2mm の貫通穴)

座標系:
- ピン軸の中心線を Y 軸に重ねる(ピン軸は +Y 方向)
- 板の平らな面は Z 軸に直交し、左板が x<0 側、右板が x>0 側に伸びる(180° 開)
- knuckle は X=0 を中心とし、Y 方向に 6mm ずつ並ぶ

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。