bare-low/o3 / tier-3-butt-hinge
success tier 3
bare (o3)
render
// Butt hinge (opened 180°) ---------------------------
// Parameters
leaf_w = 25; // width (X direction)
leaf_h = 30; // height (Y direction)
leaf_t = 2; // thickness (Z)
kn_d_out = 8; // knuckle outer diameter
kn_d_in = 4.6; // knuckle inner diameter (= pin Ø + 0.3)
kn_len = 6; // each knuckle length
pin_d = 4; // pin diameter
pin_len = 32; // pin total length (30 + 1 + 1)
hole_d = 3.2; // through-hole diameter
cs_d = 6; // countersink top diameter
cs_depth = 1; // countersink depth
hole_off = 20; // X position of holes from origin (±)
hole_pitch = 8; // Y spacing between holes
$fn = 64;
// Main assembly
module hinge()
{
// pin
rotate([90,0,0])
translate([0,0,-pin_len/2])
cylinder(d=pin_d, h=pin_len);
// leaves
leaf(side = -1); // left leaf (x < 0)
leaf(side = 1); // right leaf (x > 0)
}
// Leaf with knuckles and holes
// side = -1 (left), +1 (right)
module leaf(side = -1)
{
// Base plate
translate([side*(leaf_w * -0.5 - kn_d_out/2), -leaf_h/2, 0])
difference()
{
// plate
cube([leaf_w, leaf_h, leaf_t]);
// countersunk holes
for(i=[-1,0,1]) // three holes
{
y_pos = leaf_h/2 + i*hole_pitch; // convert i index to Y
translate([side*hole_off, y_pos, 0])
countersunk_hole();
}
}
// Knuckles
for(idx=[0:4])
{
// decide if this knuckle belongs to this leaf
knuckle_to_side = (idx % 2 == 0) ? -1 : 1; // even -> left, odd -> right
if(knuckle_to_side == side)
{
y_center = -leaf_h/2 + kn_len/2 + idx*kn_len;
// Solid cylinder knuckle (outer)
translate([0, y_center, 0])
rotate([90,0,0])
cylinder(d=kn_d_out, h=kn_len);
// Bore for pin clearance
translate([0, y_center, 0])
rotate([90,0,0])
#cylinder(d=kn_d_in, h=kn_len); // use "#" for preview of hole
}
}
}
// Countersunk hole (subtractive)
module countersunk_hole()
{
union()
{
// through hole
translate([0,0,-1]) // extend a bit below plate for clean subtraction
cylinder(d=hole_d, h=leaf_t+2);
// countersink (straight-walled approximation)
translate([0,0,leaf_t-cs_depth])
cylinder(d=cs_d, h=cs_depth+0.01); // slight overlap
}
}
// --- Render ---
hinge(); パラメータ (13) —
スライダを動かすと 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 ... ``` のフェンスで囲んで出力してください。 コードのみで、追加の説明は不要です。