vibe-openscad

bare-low/claude-sonnet-4-6 / tier-3-butt-hinge

success tier 3

bare (claude sonnet 4.6)

render
bare render of tier-3-butt-hinge
loading STL…
success 21.7s · 707/1324t · $0.0220
SCAD (115 lines)
// Butt Hinge - 180° open state
// Pin axis along Y, leaves flat in XZ plane at z=0..2

// Parameters
leaf_w = 25;    // width (x direction)
leaf_h = 30;    // height (y direction)
leaf_t = 2;     // thickness (z direction)

pin_d = 4;
pin_r = pin_d / 2;
pin_len = 32;

knuckle_od = 8;
knuckle_or = knuckle_od / 2;
knuckle_id = 4.6;
knuckle_ir = knuckle_id / 2;
knuckle_h = 6;

// Screw holes
screw_d = 3.2;
cs_d = 6;
cs_depth = 1;
screw_count = 3;
screw_pitch = 8;
screw_x_offset = leaf_w / 2; // center of screw zone

// Left leaf: x from -leaf_w to 0, knuckles at x=0 side
// Right leaf: x from 0 to leaf_w, knuckles at x=0 side
// Both leaves lie in z = -leaf_t to 0 plane (top face at z=0)

module countersunk_hole(depth=leaf_t) {
    // Countersink: cone from diameter cs_d at top to screw_d, depth cs_depth
    // Then through hole screw_d for remaining depth
    union() {
        cylinder(d1=cs_d, d2=screw_d, h=cs_depth, $fn=32);
        translate([0,0,-depth+cs_depth])
            cylinder(d=screw_d, h=depth-cs_depth+0.01, $fn=32);
    }
}

module knuckle() {
    difference() {
        cylinder(d=knuckle_od, h=knuckle_h, $fn=32);
        translate([0,0,-0.1])
            cylinder(d=knuckle_id, h=knuckle_h+0.2, $fn=32);
    }
}

module left_leaf() {
    // Leaf body: x from -leaf_w to 0, y from -1 to 29 (pin offset by 1), z from -leaf_t to 0
    // Pin starts at y=-1, so leaf y from 0 to 30 mapped to pin y 0..30
    // Actually: leaf y from 0 to 30, knuckles centered on x=0 edge
    
    difference() {
        union() {
            // Main leaf plate
            translate([-leaf_w, 0, -leaf_t])
                cube([leaf_w, leaf_h, leaf_t]);
            
            // Left leaf knuckles: positions 0,2,4 (y=0,12,24) -> centers at y=3,15,27
            // knuckle 1: y=0..6, knuckle 3: y=12..18, knuckle 5: y=24..30
            for(i = [0, 2, 4]) {
                translate([0, i*knuckle_h, -knuckle_od/2])
                    rotate([-90, 0, 0])
                        // knuckle centered on x=0, extending in +x direction around pin
                        // Actually knuckle is a cylinder along y axis
                        translate([0, 0, 0])
                            knuckle();
            }
        }
        
        // Screw holes on leaf (top face z=0, going down)
        // Screws along y axis, x centered at -leaf_w/2
        for(i = [0:screw_count-1]) {
            translate([-leaf_w/2, 4 + i*screw_pitch, 0])
                rotate([180, 0, 0])
                    countersunk_hole(leaf_t);
        }
    }
}

module right_leaf() {
    difference() {
        union() {
            // Main leaf plate
            translate([0, 0, -leaf_t])
                cube([leaf_w, leaf_h, leaf_t]);
            
            // Right leaf knuckles: positions 1,3 (y=6..12, y=18..24)
            for(i = [1, 3]) {
                translate([0, i*knuckle_h, -knuckle_od/2])
                    rotate([-90, 0, 0])
                        knuckle();
            }
        }
        
        // Screw holes
        for(i = [0:screw_count-1]) {
            translate([leaf_w/2, 4 + i*screw_pitch, 0])
                rotate([180, 0, 0])
                    countersunk_hole(leaf_t);
        }
    }
}

module pin() {
    translate([0, -1, -knuckle_od/2])
        rotate([-90, 0, 0])
            cylinder(d=pin_d, h=pin_len, $fn=32);
}

// Render all parts
color("silver") left_leaf();
color("silver") right_leaf();
color("gold")   pin();
パラメータ (13)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-low_claude-sonnet-4-6-3c3426314a75-2026-04-28T17-22-21-873Z
matrixIdbare-low/claude-sonnet-4-6
signature3c3426314a75d978…
provideranthropic
modelclaude-sonnet-4-6
harnessbare
statussuccess
duration21.66s (wallclock: load + prompt eval + generation + network)
tokens707 in / 1324 out
wallclock tok/s61.1 tok/s (end-to-end)
cost$0.0220
createdAt2026-04-28T17:22:21.873Z
gitCommitbe87c9f2adaf
openscadOpenSCAD version 2026.04.27

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