vibe-openscad

tier-3-butt-hinge / gpt-5.6-terra

6 run / 累計 608.9s / 累計 $0.2743

openai gpt 5.6 terra bare

bare (provider default effort)

run detail →
render
bare render of tier-3-butt-hinge
loading STL…
success 37.7s · 592/3345t · $0.0413
SCAD (111 lines)
// 小型家具用バット蝶番(180°開状態)
// 単位: mm

$fn = 64;

// 基本寸法
leaf_length     = 30;
leaf_width      = 25;
leaf_thickness  = 2;

pin_diameter    = 4;
pin_length      = 32;

knuckle_od      = 8;
knuckle_id      = 4.6;
knuckle_length  = 6;

screw_diameter  = 3.2;
csk_diameter    = 6;
csk_depth       = 1;

// Y方向の皿穴位置(8mmピッチ)
screw_y = [7, 15, 23];


// Y軸方向の筒状 knuckle
module knuckle(y0) {
    difference() {
        translate([0, y0, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_od, h = knuckle_length);

        translate([0, y0 - 0.1, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_id, h = knuckle_length + 0.2);
    }
}


// 上面(+Z側)からのM3皿穴
module countersunk_hole(x, y) {
    // 貫通穴
    translate([x, y, -leaf_thickness / 2 - 0.1])
        cylinder(d = screw_diameter, h = leaf_thickness + 0.2);

    // 皿穴テーパ: Z=0 ~ Z=+1
    translate([x, y, 0])
        cylinder(
            d1 = screw_diameter,
            d2 = csk_diameter,
            h  = csk_depth
        );
}


// 左板: Y=0-6, 12-18, 24-30 に knuckle
module left_leaf() {
    difference() {
        union() {
            // 左板: X=-29 ~ -4, Y=0 ~ 30
            translate([-29, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            knuckle(0);
            knuckle(12);
            knuckle(24);
        }

        // 左板の皿穴
        for (y = screw_y)
            countersunk_hole(-24, y);
    }
}


// 右板: Y=6-12, 18-24 に knuckle
module right_leaf() {
    difference() {
        union() {
            // 右板: X=4 ~ 29, Y=0 ~ 30
            translate([4, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            knuckle(6);
            knuckle(18);
        }

        // 右板の皿穴
        for (y = screw_y)
            countersunk_hole(24, y);
    }
}


// ピン軸: Y=-1 ~ 31
module hinge_pin() {
    translate([0, -1, 0])
        rotate([-90, 0, 0])
            cylinder(d = pin_diameter, h = pin_length);
}


// 完成組立状態
color([0.25, 0.28, 0.32])
    left_leaf();

color([0.30, 0.33, 0.38])
    right_leaf();

color([0.72, 0.62, 0.32])
    hinge_pin();
パラメータ (11) —
スライダを動かすと 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 ... ``` のフェンスで囲んで出力してください。
コードのみで、追加の説明は不要です。

variant: effort

low success →
low
33.3s · 592/2850t · $0.0354
SCAD (115 lines)
$fn = 64;

// ------------------------------------------------------------
// Small furniture butt hinge
// Open position: 180 degrees
// Units: mm
// ------------------------------------------------------------

// Main dimensions
leaf_length      = 30;
leaf_width       = 25;
leaf_thickness   = 2;

pin_diameter     = 4;
pin_length       = 32;

knuckle_od       = 8;
knuckle_id       = 4.6;
knuckle_length   = 6;
knuckle_count    = 5;

hole_diameter    = 3.2;
csk_diameter     = 6;
csk_depth        = 1;
hole_pitch       = 8;
hole_x_offset    = 18;

module cylinder_y(d, length, y_start = 0) {
    translate([0, y_start, 0])
        rotate([-90, 0, 0])
            cylinder(d = d, h = length);
}

module countersunk_hole(x, y) {
    // Through hole
    translate([x, y, -leaf_thickness / 2 - 0.1])
        cylinder(d = hole_diameter, h = leaf_thickness + 0.2);

    // Countersink from upper surface
    translate([x, y, leaf_thickness / 2 - csk_depth])
        cylinder(
            h  = csk_depth + 0.05,
            d1 = hole_diameter,
            d2 = csk_diameter
        );
}

module knuckle(y_start) {
    difference() {
        cylinder_y(knuckle_od, knuckle_length, y_start);

        translate([0, y_start - 0.05, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_id, h = knuckle_length + 0.1);
    }
}

module left_leaf() {
    difference() {
        union() {
            // Leaf plate: X < 0
            translate([-leaf_width, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            // Left leaf knuckles: lower, center, upper
            knuckle(0);
            knuckle(12);
            knuckle(24);
        }

        // Mounting holes
        countersunk_hole(-hole_x_offset, 7);
        countersunk_hole(-hole_x_offset, 15);
        countersunk_hole(-hole_x_offset, 23);
    }
}

module right_leaf() {
    difference() {
        union() {
            // Leaf plate: X > 0
            translate([0, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            // Right leaf knuckles: alternating positions
            knuckle(6);
            knuckle(18);
        }

        // Mounting holes
        countersunk_hole(hole_x_offset, 7);
        countersunk_hole(hole_x_offset, 15);
        countersunk_hole(hole_x_offset, 23);
    }
}

module hinge_pin() {
    // Pin protrudes 1 mm beyond both knuckle ends
    translate([0, -1, 0])
        rotate([-90, 0, 0])
            cylinder(d = pin_diameter, h = pin_length);
}

// ------------------------------------------------------------
// Completed hinge assembly
// ------------------------------------------------------------

color([0.45, 0.45, 0.48])
    left_leaf();

color([0.50, 0.50, 0.53])
    right_leaf();

color([0.25, 0.25, 0.28])
    hinge_pin();
medium (default) success →
medium
37.7s · 592/3345t · $0.0413
SCAD (111 lines)
// 小型家具用バット蝶番(180°開状態)
// 単位: mm

$fn = 64;

// 基本寸法
leaf_length     = 30;
leaf_width      = 25;
leaf_thickness  = 2;

pin_diameter    = 4;
pin_length      = 32;

knuckle_od      = 8;
knuckle_id      = 4.6;
knuckle_length  = 6;

screw_diameter  = 3.2;
csk_diameter    = 6;
csk_depth       = 1;

// Y方向の皿穴位置(8mmピッチ)
screw_y = [7, 15, 23];


// Y軸方向の筒状 knuckle
module knuckle(y0) {
    difference() {
        translate([0, y0, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_od, h = knuckle_length);

        translate([0, y0 - 0.1, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_id, h = knuckle_length + 0.2);
    }
}


// 上面(+Z側)からのM3皿穴
module countersunk_hole(x, y) {
    // 貫通穴
    translate([x, y, -leaf_thickness / 2 - 0.1])
        cylinder(d = screw_diameter, h = leaf_thickness + 0.2);

    // 皿穴テーパ: Z=0 ~ Z=+1
    translate([x, y, 0])
        cylinder(
            d1 = screw_diameter,
            d2 = csk_diameter,
            h  = csk_depth
        );
}


// 左板: Y=0-6, 12-18, 24-30 に knuckle
module left_leaf() {
    difference() {
        union() {
            // 左板: X=-29 ~ -4, Y=0 ~ 30
            translate([-29, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            knuckle(0);
            knuckle(12);
            knuckle(24);
        }

        // 左板の皿穴
        for (y = screw_y)
            countersunk_hole(-24, y);
    }
}


// 右板: Y=6-12, 18-24 に knuckle
module right_leaf() {
    difference() {
        union() {
            // 右板: X=4 ~ 29, Y=0 ~ 30
            translate([4, 0, -leaf_thickness / 2])
                cube([leaf_width, leaf_length, leaf_thickness]);

            knuckle(6);
            knuckle(18);
        }

        // 右板の皿穴
        for (y = screw_y)
            countersunk_hole(24, y);
    }
}


// ピン軸: Y=-1 ~ 31
module hinge_pin() {
    translate([0, -1, 0])
        rotate([-90, 0, 0])
            cylinder(d = pin_diameter, h = pin_length);
}


// 完成組立状態
color([0.25, 0.28, 0.32])
    left_leaf();

color([0.30, 0.33, 0.38])
    right_leaf();

color([0.72, 0.62, 0.32])
    hinge_pin();
high success →
high
65.4s · 592/5586t · $0.0682
SCAD (87 lines)
// 小型バット蝶番(180°開いた状態)
// 単位: mm

$fn = 64;

// 基本寸法
leaf_length     = 30;
leaf_width      = 25;
leaf_thickness  = 2;

pin_diameter    = 4;
pin_length      = 32;

knuckle_od      = 8;
knuckle_id      = 4.6;
knuckle_length  = 6;

hole_diameter   = 3.2;
csk_diameter    = 6;
csk_depth       = 1;

// Y軸方向の円柱
module y_cylinder(y_start, length, diameter) {
    translate([0, y_start, 0])
        rotate([-90, 0, 0])
            cylinder(d = diameter, h = length);
}

// 中空 knuckle
module knuckle(y_start) {
    difference() {
        y_cylinder(y_start, knuckle_length, knuckle_od);

        translate([0, y_start - 0.02, 0])
            rotate([-90, 0, 0])
                cylinder(d = knuckle_id, h = knuckle_length + 0.04);
    }
}

// M3貫通穴 + 表面側皿穴
module countersunk_hole(x_pos, y_pos) {
    translate([x_pos, y_pos, -leaf_thickness / 2 - 0.05])
        cylinder(d = hole_diameter, h = leaf_thickness + 0.1);

    translate([x_pos, y_pos, 0])
        cylinder(
            h = csk_depth,
            d1 = hole_diameter,
            d2 = csk_diameter
        );
}

// 左右の板と knuckle
module hinge_leaf(side, knuckle_positions) {
    difference() {
        union() {
            // 左板: X=-29 ~ -4
            // 右板: X=  4 ~ 29
            translate([
                side < 0 ? -29 : 4,
                -leaf_length / 2,
                -leaf_thickness / 2
            ])
                cube([leaf_width, leaf_length, leaf_thickness]);

            // knuckle
            for (y_pos = knuckle_positions)
                knuckle(y_pos);
        }

        // knuckle から離れた外側寄りの M3皿穴 3個
        for (y_pos = [-8, 0, 8])
            countersunk_hole(side * 24, y_pos);
    }
}

// 左板: 外側2個 + 中央1個
color([0.32, 0.34, 0.36])
    hinge_leaf(-1, [-15, -3, 9]);

// 右板: 中間2個
color([0.38, 0.40, 0.42])
    hinge_leaf(1, [-9, 3]);

// ピン軸: knuckle 全長30mmに対して両端1mmずつ突出
color([0.15, 0.15, 0.16])
    y_cylinder(-16, pin_length, pin_diameter);
max no_code nocode →
no_code
356.8s
model returned empty response (stopReason=in_progress)
SCAD (1 lines)

no SCAD

xhigh success →
xhigh
78.0s · 592/7243t · $0.0881
SCAD (139 lines)
$fn = 64;

// ---------- 基本寸法 ----------
leaf_length    = 30;
leaf_width     = 25;
leaf_thickness = 2;

pin_diameter   = 4;
pin_length     = 32;

knuckle_od     = 8;
knuckle_id     = 4.6;
knuckle_length = 6;

screw_d        = 3.2;
countersink_d  = 6;
countersink_h  = 1;

hinge_radius   = knuckle_od / 2;
pin_overhang   = 1;

// Y方向の円柱
module cylinder_y(d, h) {
    rotate([-90, 0, 0])
        cylinder(d = d, h = h);
}

// M3用皿穴(上面 Z=+1 側から加工)
module countersunk_hole(x, y) {
    // 貫通穴
    translate([x, y, -leaf_thickness])
        cylinder(d = screw_d, h = leaf_thickness * 3);

    // 皿穴テーパ
    translate([x, y, leaf_thickness / 2 - countersink_h])
        cylinder(
            h  = countersink_h,
            d1 = screw_d,
            d2 = countersink_d
        );
}

// 左板用 knuckle
module left_knuckle(y0) {
    union() {
        // 筒部
        translate([0, y0, 0])
            cylinder_y(knuckle_od, knuckle_length);

        // 左板との接続部
        translate([-hinge_radius - 0.02, y0, -leaf_thickness / 2])
            cube([1.37, knuckle_length, leaf_thickness]);
    }
}

// 右板用 knuckle
module right_knuckle(y0) {
    union() {
        // 筒部
        translate([0, y0, 0])
            cylinder_y(knuckle_od, knuckle_length);

        // 右板との接続部
        translate([hinge_radius - 1.35, y0, -leaf_thickness / 2])
            cube([1.37, knuckle_length, leaf_thickness]);
    }
}

// 左板: knuckle は Y=0,12,24
module left_leaf() {
    difference() {
        union() {
            // 30 x 25 x 2 mm の左板
            translate([
                -hinge_radius - leaf_width,
                0,
                -leaf_thickness / 2
            ])
                cube([leaf_width, leaf_length, leaf_thickness]);

            // 左側 knuckle 3個
            for (y0 = [0, 12, 24])
                left_knuckle(y0);
        }

        // 左側 knuckle の軸穴
        for (y0 = [0, 12, 24])
            translate([0, y0 - 0.01, 0])
                cylinder_y(knuckle_id, knuckle_length + 0.02);

        // 左板のM3皿穴 3個
        for (y = [7, 15, 23])
            countersunk_hole(-hinge_radius - leaf_width + 6, y);
    }
}

// 右板: knuckle は Y=6,18
module right_leaf() {
    difference() {
        union() {
            // 30 x 25 x 2 mm の右板
            translate([
                hinge_radius,
                0,
                -leaf_thickness / 2
            ])
                cube([leaf_width, leaf_length, leaf_thickness]);

            // 右側 knuckle 2個
            for (y0 = [6, 18])
                right_knuckle(y0);
        }

        // 右側 knuckle の軸穴
        for (y0 = [6, 18])
            translate([0, y0 - 0.01, 0])
                cylinder_y(knuckle_id, knuckle_length + 0.02);

        // 右板のM3皿穴 3個
        for (y = [7, 15, 23])
            countersunk_hole(hinge_radius + leaf_width - 6, y);
    }
}

// ピン軸: Y=-1 ~ 31
module hinge_pin() {
    translate([0, -pin_overhang, 0])
        cylinder_y(pin_diameter, pin_length);
}

// ---------- 完成状態: 180度開 ----------
color([0.38, 0.42, 0.46])
    left_leaf();

color([0.42, 0.46, 0.50])
    right_leaf();

color([0.18, 0.20, 0.22])
    hinge_pin();