vibe-openscad

bare/gemini-2.5-flash-lite / tier-3-butt-hinge

success tier 3

bare (gemini 2.5 flash-lite)

render
bare render of tier-3-butt-hinge
loading STL…
success 5.6s · 515/1135t · $0.0005
SCAD (98 lines)
// Parameters
leaf_width = 25;
leaf_height = 30;
leaf_thickness = 2;
pin_diameter = 4;
pin_length = 32;
knuckle_outer_diameter = 8;
knuckle_inner_diameter = pin_diameter + 0.3;
knuckle_height = 6; // 30mm / 5 equal parts
num_knuckles_left = 3;
num_knuckles_right = 2;
m3_countersink_diameter = 6;
m3_countersink_depth = 1;
m3_hole_diameter = 3.2;
m3_hole_spacing = 8;

module pin() {
    cylinder(h = pin_length, d = pin_diameter, center = true);
}

module knuckle(side_multiplier) {
    difference() {
        cylinder(h = knuckle_height, d = knuckle_outer_diameter, center = true);
        cylinder(h = knuckle_height + 0.1, d = knuckle_inner_diameter, center = true); // +0.1 to ensure clean cut
    }
}

module leaf(side) {
    // Base leaf shape
    cube([leaf_thickness, leaf_width, leaf_height], center = true);

    // Mount holes
    translate([side * (leaf_thickness / 2), 0, -m3_hole_spacing]) {
        m3_countersink(side);
    }
    translate([side * (leaf_thickness / 2), 0, 0]) {
        m3_countersink(side);
    }
    translate([side * (leaf_thickness / 2), 0, m3_hole_spacing]) {
        m3_countersink(side);
    }
}

module m3_countersink(side) {
    rotate([90, 0, 0]) {
        cylinder(h = m3_countersink_depth, d = m3_countersink_diameter, center = true);
        translate([0, 0, m3_countersink_depth]) {
            cylinder(h = m3_hole_diameter, d = m3_hole_diameter, center = true);
        }
    }
}

// Assemble the hinge in 180 degree open state
module butt_hinge() {
    // Pin
    pin();

    // Left leaf and its knuckles
    left_leaf_x_offset = -knuckle_outer_diameter / 2 - leaf_thickness / 2;
    translate([left_leaf_x_offset, 0, 0]) {
        leaf(-1); // Left side
    }

    // Knuckles for the left leaf (interleaved)
    knuckle_y_offset_start = -(num_knuckles_left - 1) * knuckle_height / 2;
    for (i = [0 : num_knuckles_left - 1]) {
        // Knuckles for the left leaf are on the "outer" side relative to the pin
        // When open 180, left leaf is on x < 0, right leaf is on x > 0.
        // Knuckles for left leaf should be on the side closer to its leaf, so their outer surfaces will align with leaf surfaces when closed.
        // For 180 degree open, the knuckles will be on the "outside" of the pin's central axis.
        // Left leaf is on x < 0. Knuckles are on the "outer" side of the pin.
        translate([0, knuckle_y_offset_start + i * knuckle_height, 0]) {
            knuckle(-1); // Left side
        }
    }

    // Right leaf and its knuckles
    right_leaf_x_offset = knuckle_outer_diameter / 2 + leaf_thickness / 2;
    translate([right_leaf_x_offset, 0, 0]) {
        leaf(1); // Right side
    }

    // Knuckles for the right leaf (interleaved)
    knuckle_y_offset_start_right = -(num_knuckles_right - 1) * knuckle_height / 2;
    for (i = [0 : num_knuckles_right - 1]) {
        // Knuckles for the right leaf are on the "outer" side relative to the pin.
        // For 180 degree open, the knuckles will be on the "outside" of the pin's central axis.
        // Right leaf is on x > 0. Knuckles are on the "outer" side of the pin.
        translate([0, knuckle_y_offset_start_right + i * knuckle_height, 0]) {
            knuckle(1); // Right side
        }
    }
}

// Position the hinge at the origin
translate([0, 0, 0]) {
    butt_hinge();
}
パラメータ (13)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare_gemini-2.5-flash-lite-45682bfa0318-2026-04-28T17-21-13-431Z
matrixIdbare/gemini-2.5-flash-lite
signature45682bfa03183af5…
providergoogle
modelgemini-2.5-flash-lite
harnessbare
statussuccess
duration5.57s (wallclock: load + prompt eval + generation + network)
tokens515 in / 1135 out
wallclock tok/s203.7 tok/s (end-to-end)
cost$0.0005
createdAt2026-04-28T17:21:13.431Z
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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。