vibe-openscad

bare-think-off/gemma-4-31b-it / tier-3-butt-hinge

success tier 3

bare (gemma 4 31b)

render
bare render of tier-3-butt-hinge
loading STL…
success 31.2s · 515/1074t · $0
SCAD (95 lines)
// Parameters
leaf_h = 30;        // Height (along Y axis)
leaf_w = 25;        // Width (along X axis)
leaf_t = 2;         // Thickness
pin_d = 4;          // Pin diameter
pin_l = 32;         // Pin length
knuckle_od = 8;     // Knuckle outer diameter
knuckle_id = pin_d + 0.3; // Knuckle inner diameter
knuckle_seg = 6;    // Segment length (30/5)

$fn = 64;

module screw_hole() {
    // M3 Countersink: 6mm diameter, 1mm depth taper
    cylinder(h = 1, r1 = 3, r2 = 1.6); 
    // M3 Clearance: 3.2mm diameter through hole
    translate([0, 0, -1]) cylinder(h = leaf_t + 2, r = 1.6);
}

module leaf_with_knuckles(is_left) {
    union() {
        // Main leaf plate
        translate([is_left ? -leaf_w : 0, 0, -leaf_t/2])
            cube([leaf_w, leaf_h, leaf_t]);

        // Knuckles
        for (i = [0 : 4]) {
            // Left leaf gets segments 0, 2, 4 (indices)
            // Right leaf gets segments 1, 3
            if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                translate([0, i * knuckle_seg, 0])
                difference() {
                    cylinder(h = knuckle_seg, d = knuckle_od, center = true);
                    cylinder(h = knuckle_seg + 1, d = knuckle_id, center = true);
                }
            }
        }

        // Screw holes (3 holes, 8mm pitch)
        for (j = [0 : 2]) {
            translate([
                is_left ? -leaf_w + 5 : leaf_w - 5, 
                (leaf_h/2) - (leaf_h/2) + (j + 1) * 8 - 8, // centered logic
                leaf_t/2
            ])
            // Recalculate Y for 8mm pitch centered in 30mm (e.g. 7, 15, 23)
            // Using fixed offsets from bottom: 7, 15, 23
            translate([0, (j+1)*8 - 8, 0]) // Adjusted below in final loop
            rotate([90, 0, 0]) screw_hole();
        }
    }
}

// Corrected screw hole placement for the leaf
module leaf_fixed(is_left) {
    union() {
        // Plate
        translate([is_left ? -leaf_w : 0, 0, -leaf_t/2])
            cube([leaf_w, leaf_h, leaf_t]);
        
        // Knuckles
        for (i = [0 : 4]) {
            if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                translate([0, i * knuckle_seg + knuckle_seg/2, 0])
                difference() {
                    cylinder(h = knuckle_seg, d = knuckle_od, center = true);
                    cylinder(h = knuckle_seg + 1, d = knuckle_id, center = true);
                }
            }
        }
        
        // Holes at Y = 7, 15, 23
        for (y_pos = [7, 15, 23]) {
            translate([is_left ? -leaf_w + 5 : leaf_w - 5, y_pos, leaf_t/2])
            rotate([90, 0, 0]) screw_hole();
        }
    }
}

// Final Assembly
// Pin Axis: Y axis
// Left Leaf: x < 0
// Right Leaf: x > 0
// Opened state: 180 degrees (plates on same plane Z)

// 1. Left Leaf
color("silver") leaf_fixed(true);

// 2. Right Leaf
color("silver") leaf_fixed(false);

// 3. Pin
color("gray") 
translate([0, -1, 0]) 
cylinder(h = pin_l, d = pin_d);
パラメータ (7) —
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-think-off_gemma-4-31b-it-c033660093c6-2026-10-06T19-39-13-526Z
matrixIdbare-think-off/gemma-4-31b-it
signaturec033660093c6d075…
providergoogle
modelgemma-4-31b-it
harnessbare
statussuccess
duration31.22s (wallclock: load + prompt eval + generation + network)
tokens515 in / 1074 out
wallclock tok/s34.4 tok/s (end-to-end)
cost$0
createdAt2026-10-06T19:39:13.526Z
gitCommitf9f85ea20c03
openscadOpenSCAD version 2026.09.23

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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。