bare-think-off/claude-opus-5 / tier-3-butt-hinge
success tier 3
bare (claude opus 5)
render
// ============================================================
// Small Butt Hinge for Furniture (open 180 degrees)
// - Left leaf : x < 0 (3 knuckles : outer 2 + center 1)
// - Right leaf : x > 0 (2 knuckles : intermediate 2)
// - Pin : along +Y axis, dia 4mm, length 32mm
// ============================================================
$fn = 64;
// ---------------- Parameters ----------------
leaf_len = 30; // along Y (hinge axis)
leaf_wid = 25; // along X (opening direction)
leaf_thk = 2; // plate thickness (Z)
pin_dia = 4;
pin_len = 32; // 1mm protrusion at each end
knuckle_od = 8;
knuckle_clr = 0.3;
knuckle_id = pin_dia + knuckle_clr; // 4.6
seg = leaf_len / 5; // 6mm each
gap = 0.2; // axial clearance between knuckles
// countersunk screw holes (M3)
hole_dia = 3.2;
cs_dia = 6;
cs_depth = 1;
hole_pitch = 8; // along Y
hole_x_off = leaf_wid - 6; // distance from axis to hole centres
y0 = -leaf_len/2; // = -15
// ---------------- Helper modules ----------------
// counter-sunk hole, drilled from +Z surface downward
module cs_hole() {
translate([0, 0, -leaf_thk])
cylinder(h = leaf_thk * 3, d = hole_dia, center = false);
translate([0, 0, leaf_thk/2 - cs_depth])
cylinder(h = cs_depth, d1 = hole_dia, d2 = cs_dia);
translate([0, 0, leaf_thk/2])
cylinder(h = leaf_thk, d = cs_dia);
}
// three counter-sunk holes for one leaf ( sign = -1 left, +1 right )
module leaf_holes(sign) {
for (i = [-1, 0, 1])
translate([sign * hole_x_off, i * hole_pitch, 0])
cs_hole();
}
// one knuckle barrel segment
module knuckle(y_start, len) {
translate([0, y_start + gap/2, 0])
rotate([-90, 0, 0])
difference() {
cylinder(h = len - gap, d = knuckle_od);
translate([0, 0, -1])
cylinder(h = len + 2, d = knuckle_id);
}
}
// flat plate of one leaf ( sign = -1 left, +1 right )
module leaf_plate(sign) {
// plate spans from knuckle outer radius out to leaf_wid
x_start = knuckle_od/2 - 1; // slight overlap into knuckle
translate([ sign < 0 ? -leaf_wid : x_start, -leaf_len/2, -leaf_thk/2])
cube([ leaf_wid - x_start, leaf_len, leaf_thk]);
}
// web that blends plate into the knuckle barrels
module web(sign, y_start, len) {
translate([ sign < 0 ? -knuckle_od/2 : 0, y_start + gap/2, -leaf_thk/2])
cube([knuckle_od/2, len - gap, leaf_thk]);
}
// ---------------- Left leaf (x < 0) : segments 0, 2, 4 ----------------
module left_leaf() {
color("silver")
difference() {
union() {
leaf_plate(-1);
for (i = [0, 2, 4]) {
knuckle(y0 + i*seg, seg);
web(-1, y0 + i*seg, seg);
}
}
// keep the bore clear of the web material
rotate([-90, 0, 0])
translate([0, 0, -leaf_len])
cylinder(h = leaf_len * 3, d = knuckle_id);
leaf_holes(-1);
}
}
// ---------------- Right leaf (x > 0) : segments 1, 3 ----------------
module right_leaf() {
color("silver")
difference() {
union() {
leaf_plate(1);
for (i = [1, 3]) {
knuckle(y0 + i*seg, seg);
web(1, y0 + i*seg, seg);
}
}
rotate([-90, 0, 0])
translate([0, 0, -leaf_len])
cylinder(h = leaf_len * 3, d = knuckle_id);
leaf_holes(1);
}
}
// ---------------- Pin ----------------
module pin() {
color("dimgray")
rotate([-90, 0, 0])
translate([0, 0, -pin_len/2])
union() {
cylinder(h = pin_len, d = pin_dia);
// small head chamfers at both ends
translate([0, 0, pin_len - 0.4])
cylinder(h = 0.4, d1 = pin_dia, d2 = pin_dia - 0.8);
translate([0, 0, 0])
cylinder(h = 0.4, d1 = pin_dia - 0.8, d2 = pin_dia);
}
}
// ---------------- Assembly (180 degrees open) ----------------
left_leaf();
right_leaf();
pin(); パラメータ (12) —
スライダを動かすと 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 ... ``` のフェンスで囲んで出力してください。 コードのみで、追加の説明は不要です。