tier-3-butt-hinge / google/gemma-4-e4b
1 run / 累計 35.6s / 累計 $0
google (self-hosted) gemma-4-e4b bare
bare (provider default effort)
run detail → render
no render
// ======================================================
// Furniture Butt Hinge Model (180 Degrees Open)
// Components: Left Leaf, Right Leaf, Pin Axis
// Dimensions: 30x25 leaf, D4 pin, 2mm thickness.
// ======================================================
// --- Global Parameters ---
LEAF_WIDTH = 25; // Width along X axis
LEAF_HEIGHT = 30; // Height along Y axis
THICKNESS = 2; // Thickness along Z axis
PIN_DIA = 4; // Pin diameter
KNUCKLE_OUTER_DIA = 8;
KNUCKLE_INNER_DIA = PIN_DIA + 0.3; // 4.3mm clearance hole
// Screw parameters (M3)
SCREW_DIAMETER_THROUGH = 3.2; // mm
SCREW_DEPTH_COUNTERBORE = 1; // mm
SCREW_COUNTERBORE_DIA = 6; // mm
// Y-coordinates for knuckle centers
KNUCKLE_Y_L = [-12, 0, 12]; // Left Leaf (Outer 2 + Center 1)
KNUCKLE_Y_R = [-6, 6]; // Right Leaf (Intermediate 2)
// Y-coordinates for screw holes (3 spots, approx 8mm pitch spacing)
SCREW_Y_POSITIONS = [-10, 0, 10];
// ======================================================
// 1. Pin Axis Component
// ======================================================
module pin_axis() {
translate([0, 0, -(THICKNESS/2)]) {
cylinder(h=LEAF_HEIGHT + 4, r=PIN_DIA/2, $fn=60);
}
}
// ======================================================
// 2. Single Leaf Module (Handles the basic shape and cutouts)
// @param is_left: True if this leaf should be modeled for the left side (X<0).
// False if for the right side (X>0).
// @param knuckles_y: Array of Y coordinates for knuckle placement.
module hinged_leaf(is_left = true, knuckles_y, screws_y) {
// Determine translation offset based on position
translate([-(LEAF_WIDTH/2) * (if(is_left)) : 1, 0, 0]) {
color([0.4, 0.2, 0.1]) { // Brownish color for wood look
difference() {
// A. Base Block (The solid leaf)
cube([LEAF_WIDTH, LEAF_HEIGHT, THICKNESS]);
// B. Cutouts to make space for knuckles and screws
union() {
// 1. Knuckle Holes (These holes must pass through the center axis Y=0)
for (y = knuckles_y) {
translate([0, y, -(THICKNESS/2)]) {
cylinder(h=THICKNESS + 0.1, r=(KNUCKLE_OUTER_DIA/2) + 0.5, $fn=60); // Slightly larger to guarantee removal
}
}
// 2. Screw Holes (3 spots per leaf)
for (y = screws_y) {
translate([0, y, -(THICKNESS/2)]) {
// Counterbore cut (D=6mm, Depth=1mm)
cylinder(h=SCREW_DEPTH_COUNTERBORE + 0.1, r=(SCREW_COUNTERBORE_DIA/2), $fn=36);
// Through hole (Must pass through the full thickness)
translate([0, y, SCREW_DEPTH_COUNTERBORE]) {
cylinder(h=THICKNESS + 0.1, r=(SCREW_DIAMETER_THROUGH/2), $fn=36);
}
}
}
// 3. Pin Axis Clearance (Must pass through all knuckles)
// This cutout ensures the central pin can rotate freely while leaving structural integrity around knuckle centers.
translate([0, -15, -(THICKNESS/2)]) { // Start slightly outside Y range to ensure full passage
cylinder(h=LEAF_HEIGHT + 3, r=(KNUCKLE_INNER_DIA / 2) + 0.3, $fn=60);
}
}
}
}
}
}
// ======================================================
// ASSEMBLY AND DISPLAY (180 Degree Open State)
// ======================================================
// Use a union to display all parts together in the final open configuration.
union() {
// 1. Left Leaf (X < 0 side)
// Knuckles: Y=-12, 0, 12
hinged_leaf(is_left = true, knuckles_y = KNUCKLE_Y_L, screws_y = SCREW_Y_POSITIONS);
// 2. Right Leaf (X > 0 side)
// Knuckles: Y=-6, 6
hinged_leaf(is_left = false, knuckles_y = KNUCKLE_Y_R, screws_y = SCREW_Y_POSITIONS);
// 3. Pin Axis (Central Pivot)
pin_axis();
} 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 ... ``` のフェンスで囲んで出力してください。 コードのみで、追加の説明は不要です。