vibe-openscad

tier-3-butt-hinge / gemma-4-26b-a4b-it

2 run / 累計 453.7s / 累計 $0

gemini gemma 4 26b a4b bare

bare (provider default effort)

run detail →
render
bare render of tier-3-butt-hinge
loading STL…
success 226.9s · 515/10651t · $0
SCAD (87 lines)
$fn = 50;

// --- Constants ---
LEAF_W = 25;
LEAF_H = 30;
LEAF_T = 2;
PIN_D = 4;
PIN_L = 32;
KNUCKLE_OD = 8;
KNUCKLE_ID = 4.6; // 4mm + 0.3mm clearance on both sides? 
                  // Actually, 4 + 0.3 = 4.3. 
                  // But the prompt says "4.6mm hole", so I'll use 4.6.
KNUCKLE_SEG = 6;
SCREW_D = 3.2;
SCREW_D_TOP = 6;
SCREW_DEPTH = 1;

// --- Modules ---

// Screw hole with countersink
module screw_hole() {
    difference() {
        // Through hole
        cylinder(d = SCREW_D, h = LEAF_T);
        // Countersink (taper)
        // Starts at d=3.2 at depth 1mm, expands to 6mm at the surface
        translate([0, 0, LEAF_T - SCREW_DEPTH])
            cylinder(d1 = SCREW_D, d2 = SCREW_D_TOP, h = SCREW_DEPTH);
    }
}

// Single leaf module
module leaf(is_left) {
    difference() {
        union() {
            // The metal plate
            if (is_left) {
                translate([-LEAF_W, 0, 0]) cube([LEAF_W, LEAF_H, LEAF_T]);
            } else {
                translate([0, 0, 0]) cube([LEAF_W, LEAF_H, LEAF_T]);
            }

            // The knuckles (cylindrical parts)
            for (i = [0:4]) {
                // Left leaf: 0, 2, 4 (3 knuckles); Right leaf: 1, 3 (2 knuckles)
                if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                    translate([0, i * KNUCKLE_SEG, - (KNUCKLE_OD - LEAF_T) / 2])
                        cylinder(d = KNUCKLE_OD, h = KNUCKLE_SEG);
                }
            }
        }

        // Subtraction: Pin axis holes in the knuckles
        for (i = [0:4]) {
            if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                translate([0, i * KNUCKLE_SEG, - (KNUCKLE_OD - LEAF_T) / 2])
                    cylinder(d = KNUCKLE_ID, h = KNUCKLE_SEG + 0.1);
            }
        }

        // Subtraction: M3 Screw holes
        for (j = [0:2]) {
            y_pos = 7 + j * 8; // 8mm pitch
            // Positioned on the far side of the knuckle
            x_pos = is_left ? -LEAF_W + 3 : LEAF_W - 3;
            translate([x_pos, y_pos, 0]) {
                screw_hole();
            }
        }
    }
}

// --- Final Assembly ---

union() {
    // Left Leaf
    leaf(true);
    
    // Right Leaf
    leaf(false);
    
    // Pin Axis
    // Centered at X=0, Z=middle of knuckle. 
    // Pin is 32mm, protruding 1mm from the 30mm hinge.
    translate([0, -1, (KNUCKLE_OD - LEAF_T) / 2])
        cylinder(d = PIN_D, h = PIN_L);
}
パラメータ (11) —
スライダを動かすと openscad-wasm で再レンダリング

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

variant: thinking

offnot run
—
adaptivenot run
—
dynamic (default) success →
dynamic
226.9s · 515/10651t · $0
SCAD (87 lines)
$fn = 50;

// --- Constants ---
LEAF_W = 25;
LEAF_H = 30;
LEAF_T = 2;
PIN_D = 4;
PIN_L = 32;
KNUCKLE_OD = 8;
KNUCKLE_ID = 4.6; // 4mm + 0.3mm clearance on both sides? 
                  // Actually, 4 + 0.3 = 4.3. 
                  // But the prompt says "4.6mm hole", so I'll use 4.6.
KNUCKLE_SEG = 6;
SCREW_D = 3.2;
SCREW_D_TOP = 6;
SCREW_DEPTH = 1;

// --- Modules ---

// Screw hole with countersink
module screw_hole() {
    difference() {
        // Through hole
        cylinder(d = SCREW_D, h = LEAF_T);
        // Countersink (taper)
        // Starts at d=3.2 at depth 1mm, expands to 6mm at the surface
        translate([0, 0, LEAF_T - SCREW_DEPTH])
            cylinder(d1 = SCREW_D, d2 = SCREW_D_TOP, h = SCREW_DEPTH);
    }
}

// Single leaf module
module leaf(is_left) {
    difference() {
        union() {
            // The metal plate
            if (is_left) {
                translate([-LEAF_W, 0, 0]) cube([LEAF_W, LEAF_H, LEAF_T]);
            } else {
                translate([0, 0, 0]) cube([LEAF_W, LEAF_H, LEAF_T]);
            }

            // The knuckles (cylindrical parts)
            for (i = [0:4]) {
                // Left leaf: 0, 2, 4 (3 knuckles); Right leaf: 1, 3 (2 knuckles)
                if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                    translate([0, i * KNUCKLE_SEG, - (KNUCKLE_OD - LEAF_T) / 2])
                        cylinder(d = KNUCKLE_OD, h = KNUCKLE_SEG);
                }
            }
        }

        // Subtraction: Pin axis holes in the knuckles
        for (i = [0:4]) {
            if ((is_left && i % 2 == 0) || (!is_left && i % 2 != 0)) {
                translate([0, i * KNUCKLE_SEG, - (KNUCKLE_OD - LEAF_T) / 2])
                    cylinder(d = KNUCKLE_ID, h = KNUCKLE_SEG + 0.1);
            }
        }

        // Subtraction: M3 Screw holes
        for (j = [0:2]) {
            y_pos = 7 + j * 8; // 8mm pitch
            // Positioned on the far side of the knuckle
            x_pos = is_left ? -LEAF_W + 3 : LEAF_W - 3;
            translate([x_pos, y_pos, 0]) {
                screw_hole();
            }
        }
    }
}

// --- Final Assembly ---

union() {
    // Left Leaf
    leaf(true);
    
    // Right Leaf
    leaf(false);
    
    // Pin Axis
    // Centered at X=0, Z=middle of knuckle. 
    // Pin is 32mm, protruding 1mm from the 30mm hinge.
    translate([0, -1, (KNUCKLE_OD - LEAF_T) / 2])
        cylinder(d = PIN_D, h = PIN_L);
}