vibe-openscad

bare-xhigh/claude-opus-4-7 / tier-3-butt-hinge

success tier 3

bare (claude opus 4.7)

render
bare render of tier-3-butt-hinge
loading STL…
success 19.4s · 748/1375t · $0.0381
SCAD (100 lines)
// Small butt hinge - opened 180 degrees
// Pin axis along Y, leaves on Z=0 plane

$fn = 64;

// ---- Parameters ----
leaf_long   = 30;   // along Y (hinge axis)
leaf_wide   = 25;   // along X (away from axis)
leaf_thick  = 2;

pin_dia     = 4;
pin_len     = 32;

knuckle_od  = 8;
knuckle_id  = pin_dia + 0.6;   // 4.6 mm hole
knuckle_seg = 6;               // 30/5

screw_clear = 3.2;
csk_dia     = 6;
csk_depth   = 1;
screw_count = 3;
screw_pitch = 8;

// ---- Knuckle (hollow cylinder) along Y ----
module knuckle(y_start, length) {
    translate([0, y_start, 0])
        rotate([-90, 0, 0])
            difference() {
                cylinder(h = length, d = knuckle_od);
                translate([0, 0, -0.1])
                    cylinder(h = length + 0.2, d = knuckle_id);
            }
}

// ---- Leaf plate with countersunk holes ----
// Plate extends from x = x_inner to x = x_inner + sign*leaf_wide
// The plate's inner edge (near knuckle) is tangent to knuckle OD
module leaf_plate(direction = 1) {
    // direction = -1 (left) or +1 (right)
    inner_x = direction * (knuckle_od / 2);
    outer_x = inner_x + direction * leaf_wide;
    x_min = min(inner_x, outer_x);

    difference() {
        // Plate: top face at z=0, bottom at z=-leaf_thick
        translate([x_min, -leaf_long/2, -leaf_thick])
            cube([leaf_wide, leaf_long, leaf_thick]);

        // Screw holes - centered along plate width, on far side from knuckle
        // Position screws roughly at 2/3 from knuckle (away from knuckle)
        screw_x = inner_x + direction * (leaf_wide * 0.65);

        for (i = [0 : screw_count - 1]) {
            y = -((screw_count - 1) * screw_pitch) / 2 + i * screw_pitch;

            // Through hole
            translate([screw_x, y, -leaf_thick - 0.1])
                cylinder(h = leaf_thick + 0.2, d = screw_clear);

            // Countersink (taper) - opens upward (top surface at z=0)
            translate([screw_x, y, -csk_depth])
                cylinder(h = csk_depth + 0.01,
                         d1 = screw_clear, d2 = csk_dia);
        }
    }
}

// ---- Left leaf: knuckles at outer (0..6, 24..30) and center (12..18) ----
module left_leaf() {
    color("silver") {
        leaf_plate(-1);
        // Knuckle Y positions (relative to leaf center at y=0):
        // segments: [-15,-9], [-9,-3], [-3,3], [3,9], [9,15]
        knuckle(-15, knuckle_seg);   // outer
        knuckle(-3,  knuckle_seg);   // center
        knuckle(9,   knuckle_seg);   // outer
    }
}

// ---- Right leaf: knuckles in intermediate positions (6..12, 18..24) ----
module right_leaf() {
    color("gainsboro") {
        leaf_plate(1);
        knuckle(-9, knuckle_seg);
        knuckle(3,  knuckle_seg);
    }
}

// ---- Pin ----
module pin() {
    color("dimgray")
        translate([0, -pin_len/2, 0])
            rotate([-90, 0, 0])
                cylinder(h = pin_len, d = pin_dia);
}

// ---- Assembly (180° open) ----
left_leaf();
right_leaf();
pin();
パラメータ (12)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIdbare-xhigh_claude-opus-4-7-08c1714c8307-2026-04-28T17-21-42-748Z
matrixIdbare-xhigh/claude-opus-4-7
signature08c1714c8307aba3…
provideranthropic
modelclaude-opus-4-7
harnessbare
statussuccess
duration19.45s (wallclock: load + prompt eval + generation + network)
tokens748 in / 1375 out
wallclock tok/s70.7 tok/s (end-to-end)
cost$0.0381
createdAt2026-04-28T17:21:42.748Z
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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。