vibe-openscad

bare-think-off/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 22.5s · 707/1436t · $0.0237
SCAD (122 lines)
// Butt Hinge - 180° open state
// Units: mm

// Parameters
leaf_width  = 25;   // X direction (away from pin)
leaf_height = 30;   // Y direction (along pin axis)
leaf_thick  = 2;    // Z direction

pin_dia     = 4;
pin_r       = pin_dia / 2;
pin_len     = 32;   // 1mm overhang each end

knuckle_od  = 8;
knuckle_or  = knuckle_od / 2;
knuckle_id  = pin_dia + 0.3;  // 4.6mm
knuckle_ir  = knuckle_id / 2;
knuckle_h   = 6;    // each knuckle height (30/5)

// Countersink screw holes (M3)
cs_top_dia  = 6;
cs_depth    = 1;
cs_hole_dia = 3.2;
screw_x_offset = leaf_width / 2;  // center of screw in X on the leaf
// 3 screws per leaf, spaced 8mm apart in Y, centered on leaf_height
screw_y_positions = [
    leaf_height/2 - 8*1,  // 7
    leaf_height/2,         // 15
    leaf_height/2 + 8*1   // 23
];

// Left leaf knuckles: positions 0,2,4 (outer two + center)
// Y start positions: 0,6,12,18,24  -> knuckle centers at 3,9,15,21,27
// Left: segments 0,2,4 -> centers at 3, 15, 27
// Right: segments 1,3  -> centers at 9, 21

left_knuckle_centers  = [3, 15, 27];
right_knuckle_centers = [9, 21];

$fn = 64;

// ─── Modules ───────────────────────────────────────────────────

module knuckle(center_y) {
    translate([0, center_y - knuckle_h/2, -knuckle_or])
    rotate([-90, 0, 0])
    difference() {
        cylinder(h = knuckle_h, r = knuckle_or);
        cylinder(h = knuckle_h, r = knuckle_ir);
    }
}

// A leaf with knuckles and screw holes.
// leaf_side: -1 = left (extends in -X), +1 = right (extends in +X)
// knuckle_centers: list of Y centers for knuckles
module leaf(leaf_side, knuckle_centers) {
    // leaf body
    // The leaf flat face is at Z=0 (top surface).
    // Leaf thickness goes downward: Z from -leaf_thick to 0.
    // Knuckle center is at X=0; leaf extends in leaf_side * X direction.
    
    difference() {
        union() {
            // Flat leaf plate
            translate([leaf_side > 0 ? 0 : -leaf_width,
                       0,
                       -leaf_thick])
                cube([leaf_width, leaf_height, leaf_thick]);
            
            // Knuckles
            for (cy = knuckle_centers) {
                knuckle(cy);
            }
        }
        
        // Screw countersinks
        // Screws placed at X = leaf_side * (leaf_width * 0.5)
        sx = leaf_side * (leaf_width / 2);
        for (sy = screw_y_positions) {
            translate([sx, sy, 0]) {
                // Countersink taper: from dia 6 at Z=0 to dia 3.2 at Z=-cs_depth
                cylinder(h = cs_depth,
                         r1 = cs_top_dia / 2,
                         r2 = cs_hole_dia / 2);
                // Through hole
                translate([0, 0, -leaf_thick])
                    cylinder(h = leaf_thick, r = cs_hole_dia / 2);
            }
        }
        
        // Trim knuckle area flush with leaf (remove knuckle overlap below leaf)
        // Actually knuckles are centered at Z=0 so they protrude above.
        // We need to cut the flat leaf area where knuckles intersect.
        // The leaf is at Z -leaf_thick..0; knuckles protrude from Z -knuckle_or..+knuckle_or
        // so below the leaf (Z < -leaf_thick) knuckle material should be removed.
        // We'll cut below -leaf_thick in the leaf span.
        translate([leaf_side > 0 ? 0 : -leaf_width,
                   0,
                   -knuckle_or - 1])
            cube([leaf_width, leaf_height, knuckle_or - leaf_thick + 1 + 0.01]);
    }
}

module pin_axis() {
    // Pin along Y axis, centered at origin, length 32mm
    translate([0, -pin_len/2, 0])
    rotate([-90, 0, 0])
    cylinder(h = pin_len, r = pin_r);
}

// ─── Assembly ──────────────────────────────────────────────────

// Left leaf: extends in -X direction
color("silver")
leaf(-1, left_knuckle_centers);

// Right leaf: extends in +X direction
color("silver")
leaf(1, right_knuckle_centers);

// Pin axis
color("gold")
pin_axis();
パラメータ (10)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-think-off_claude-sonnet-4-6-230fd64121a1-2026-04-28T17-22-44-360Z
matrixIdbare-think-off/claude-sonnet-4-6
signature230fd64121a1d496…
provideranthropic
modelclaude-sonnet-4-6
harnessbare
statussuccess
duration22.47s (wallclock: load + prompt eval + generation + network)
tokens707 in / 1436 out
wallclock tok/s63.9 tok/s (end-to-end)
cost$0.0237
createdAt2026-04-28T17:22:44.360Z
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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。