vibe-openscad

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

success tier 3

bare (gpt 5 mini)

render
bare render of tier-3-butt-hinge
loading STL…
success 82.7s · 3132/5169t · $0.0111
SCAD (161 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)
// - 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

// Main assembly: left (x<0), right (x>0), pin along Y at X=0
union() {
    // Left leaf: spans X = -plate_w .. 0, Y = -plate_len/2 .. +plate_len/2, Z = -half_th .. +half_th
    color("silver") left_leaf();

    // Right leaf: spans X = 0 .. +plate_w
    color("silver") right_leaf();

    // Pin (separate part), centered at origin, axis along Y
    color("gray") pin();
}


// Modules

module left_leaf() {
    // Base plate
    translate([-plate_w, -plate_len/2, -half_th])
        union() {
            cube([plate_w, plate_len, thickness]); // X: -plate_w..0

            // Left knuckles (cylinders along Y), centered at X = 0
            for (ypos = left_knuckles) {
                // place cylinder so its centerline is at X=0 (so translate by +0 in this local coords),
                // but since plate origin is at X = -plate_w, knuckle X in world = 0 => local X = plate_w
                translate([plate_w, ypos + plate_len/2, 0])  // adjust Y because cube origin is at -plate_len/2
                    // rotate so cylinder axis is along Y: default is along Z, rotate X by 90 degrees
                    rotate([90, 0, 0])
                        cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
            }

            // Subtract inner bores of left knuckles (make them tubular)
            // Use difference outside union by doing a subtraction block after union
        }

    // Subtract bores and screw holes (perform difference)
    // We'll reconstruct with difference: plate+knuckles minus bores and screw holes
    // Build plate+knuckles again and subtract
    translate([0,0,0]) difference() {
        // plate+knuckles
        translate([-plate_w, -plate_len/2, -half_th]) {
            union() {
                cube([plate_w, plate_len, thickness]);

                for (ypos = left_knuckles) {
                    translate([plate_w, ypos + plate_len/2, 0])
                        rotate([90, 0, 0])
                            cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
                }
            }
        }

        // subtract knuckle bores: long cylinders along Y centered at X=0 (world coords)
        for (ypos = left_knuckles) {
            // Bore center at X=0, Y=ypos
            translate([0, ypos, -10]) // start below plates
                rotate([90, 0, 0])
                    cylinder(h = 20 + plate_len + 40, r = knuckle_r_in, center=false);
        }

        // subtract screw through holes and countersinks (on outward face X = -plate_w)
        for (hy = screw_hole_positions) {
            hole_x = -plate_w + screw_offset_from_outer_edge;
            // through hole (extend beyond plate thickness)
            translate([hole_x, hy, -half_th - 1])
                cylinder(h = thickness + 2, r = screw_through_dia/2, center=false);
            // countersink from top surface down screw_countersink_depth
            translate([hole_x, hy, half_th - screw_countersink_depth])
                cylinder(h = screw_countersink_depth, r1 = screw_countersink_diam/2, r2 = screw_through_dia/2, center=false);
        }
    }
}

module right_leaf() {
    // Base plate spanning X=0..+plate_w
    translate([0, -plate_len/2, -half_th])
        union() {
            cube([plate_w, plate_len, thickness]); // X: 0..plate_w

            // Right knuckles at world X=0 -> local X = 0
            for (ypos = right_knuckles) {
                translate([0, ypos + plate_len/2, 0])
                    rotate([90, 0, 0])
                        cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
            }
        }

    // Subtract bores and screw holes
    translate([0,0,0]) difference() {
        translate([0, -plate_len/2, -half_th]) {
            union() {
                cube([plate_w, plate_len, thickness]);

                for (ypos = right_knuckles) {
                    translate([0, ypos + plate_len/2, 0])
                        rotate([90, 0, 0])
                            cylinder(h = knuckle_seg, r = knuckle_r_out, center=true);
                }
            }
        }

        // subtract knuckle bores at world X=0
        for (ypos = right_knuckles) {
            translate([0, ypos, -10])
                rotate([90, 0, 0])
                    cylinder(h = 20 + plate_len + 40, r = knuckle_r_in, center=false);
        }

        // screw holes on outer face X = +plate_w
        for (hy = screw_hole_positions) {
            hole_x = plate_w - screw_offset_from_outer_edge;
            translate([hole_x, hy, -half_th - 1])
                cylinder(h = thickness + 2, r = screw_through_dia/2, center=false);
            translate([hole_x, hy, half_th - screw_countersink_depth])
                cylinder(h = screw_countersink_depth, r1 = screw_countersink_diam/2, r2 = screw_through_dia/2, center=false);
        }
    }
}

module pin() {
    // Pin axis along Y, center at origin. Rotate cylinder (Z->Y).
    translate([0, 0, 0])
        rotate([90, 0, 0])
            cylinder(h = pin_len, r = pin_r, center=true);
}
パラメータ (12)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIditer-png-1_gpt-5-mini-b6b6395279e0-2026-04-28T17-33-15-476Z
matrixIditer-png-1/gpt-5-mini
signatureb6b6395279e074b5…
provideropenai
modelgpt-5-mini-2025-08-07
harnessbare
statussuccess
duration82.65s (wallclock: load + prompt eval + generation + network)
tokens3132 in / 5169 out
wallclock tok/s62.5 tok/s (end-to-end)
cost$0.0111
createdAt2026-04-28T17:33:15.476Z
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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。