vibe-openscad

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

6 run / 累計 550.6s / 累計 $0.0671

openai gpt 5.6 luna bare

bare (provider default effort)

run detail →
render
bare render of tier-3-butt-hinge
loading STL…
success 25.1s · 592/2207t · $0.0028
SCAD (109 lines)
$fn = 64;

plate_length = 30;
plate_width  = 25;
plate_thickness = 2;

pin_diameter = 4;
pin_radius = pin_diameter / 2;
pin_length = 32;

knuckle_length = 6;
knuckle_outer_diameter = 8;
knuckle_outer_radius = knuckle_outer_diameter / 2;
knuckle_inner_diameter = 4.6;
knuckle_inner_radius = knuckle_inner_diameter / 2;

hole_diameter = 3.2;
hole_radius = hole_diameter / 2;
countersink_diameter = 6;
countersink_radius = countersink_diameter / 2;
countersink_depth = 1;

plate_z0 = -plate_thickness / 2;
hole_y_positions = [7, 15, 23];

module cylinder_y(y, length, radius) {
    translate([0, y, 0])
        rotate([-90, 0, 0])
            cylinder(h = length, r = radius);
}

module knuckle_outer(y) {
    cylinder_y(y, knuckle_length, knuckle_outer_radius);
}

module knuckle_bore(y, extra = 0.2) {
    translate([0, y - extra, 0])
        rotate([-90, 0, 0])
            cylinder(
                h = knuckle_length + 2 * extra,
                r = knuckle_inner_radius
            );
}

module mounting_hole(x, y) {
    translate([x, y, plate_z0 - 1])
        cylinder(
            h = plate_thickness + 2,
            r = hole_radius
        );

    translate([x, y, plate_z0 + plate_thickness - countersink_depth])
        cylinder(
            h = countersink_depth + 0.01,
            r1 = hole_radius,
            r2 = countersink_radius
        );
}

module left_leaf() {
    difference() {
        union() {
            translate([-plate_width, 0, plate_z0])
                cube([plate_width, plate_length, plate_thickness]);

            knuckle_outer(0);
            knuckle_outer(12);
            knuckle_outer(24);
        }

        knuckle_bore(0);
        knuckle_bore(12);
        knuckle_bore(24);

        for (y = hole_y_positions)
            mounting_hole(-17, y);
    }
}

module right_leaf() {
    difference() {
        union() {
            translate([0, 0, plate_z0])
                cube([plate_width, plate_length, plate_thickness]);

            knuckle_outer(6);
            knuckle_outer(18);
        }

        knuckle_bore(6);
        knuckle_bore(18);

        for (y = hole_y_positions)
            mounting_hole(17, y);
    }
}

module hinge_pin() {
    cylinder_y(-1, pin_length, pin_radius);
}

color("dimgray")
    left_leaf();

color("silver")
    right_leaf();

color("lightgray")
    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
15.9s · 592/1832t · $0.0023
SCAD (114 lines)
$fn = 64;

// Dimensions
leaf_len      = 30;
leaf_width    = 25;
leaf_thick    = 2;

pin_d         = 4;
pin_r         = pin_d / 2;
pin_len      = 32;

knuckle_len   = 6;
knuckle_od    = 8;
knuckle_r     = knuckle_od / 2;
knuckle_id    = 4.6;
knuckle_ir    = knuckle_id / 2;

hole_d        = 3.2;
hole_r        = hole_d / 2;
csk_d         = 6;
csk_r         = csk_d / 2;
csk_depth     = 1;

plate_z       = 0;
axis_z        = plate_z + leaf_thick / 2;

// Cylinder along the Y axis
module y_cylinder(r, h, y0, x = 0, z = axis_z) {
    translate([x, y0, z])
        rotate([-90, 0, 0])
            cylinder(r = r, h = h);
}

// Countersunk through-hole along Z
module countersunk_hole(x, y) {
    union() {
        translate([x, y, plate_z - 0.1])
            cylinder(r = hole_r, h = leaf_thick + 0.2);

        translate([x, y, plate_z + leaf_thick - csk_depth])
            cylinder(
                r1 = hole_r,
                r2 = csk_r,
                h = csk_depth + 0.01
            );
    }
}

// Left leaf: x < 0, knuckles at segments 0, 2, 4
module left_leaf() {
    difference() {
        union() {
            // Flat leaf plate
            translate([-leaf_width, 0, plate_z])
                cube([leaf_width, leaf_len, leaf_thick]);

            // Three knuckles
            for (y0 = [0, 12, 24]) {
                y_cylinder(knuckle_r, knuckle_len, y0);
            }
        }

        // Knuckle bores
        for (y0 = [0, 12, 24]) {
            y_cylinder(knuckle_ir, knuckle_len + 0.2, y0 - 0.1);
        }

        // Three M3 countersunk holes
        for (y = [7, 15, 23]) {
            countersunk_hole(-15, y);
        }
    }
}

// Right leaf: x > 0, knuckles at segments 1, 3
module right_leaf() {
    difference() {
        union() {
            // Flat leaf plate
            translate([0, 0, plate_z])
                cube([leaf_width, leaf_len, leaf_thick]);

            // Two knuckles
            for (y0 = [6, 18]) {
                y_cylinder(knuckle_r, knuckle_len, y0);
            }
        }

        // Knuckle bores
        for (y0 = [6, 18]) {
            y_cylinder(knuckle_ir, knuckle_len + 0.2, y0 - 0.1);
        }

        // Three M3 countersunk holes
        for (y = [7, 15, 23]) {
            countersunk_hole(15, y);
        }
    }
}

// Pin axis, extending 1 mm beyond each end of the 30 mm knuckle stack
module hinge_pin() {
    color("silver")
        y_cylinder(pin_r, pin_len, -1);
}

// Assembly
color("dimgray")
    left_leaf();

color("dimgray")
    right_leaf();

hinge_pin();
medium (default) success →
medium
25.1s · 592/2207t · $0.0028
SCAD (109 lines)
$fn = 64;

plate_length = 30;
plate_width  = 25;
plate_thickness = 2;

pin_diameter = 4;
pin_radius = pin_diameter / 2;
pin_length = 32;

knuckle_length = 6;
knuckle_outer_diameter = 8;
knuckle_outer_radius = knuckle_outer_diameter / 2;
knuckle_inner_diameter = 4.6;
knuckle_inner_radius = knuckle_inner_diameter / 2;

hole_diameter = 3.2;
hole_radius = hole_diameter / 2;
countersink_diameter = 6;
countersink_radius = countersink_diameter / 2;
countersink_depth = 1;

plate_z0 = -plate_thickness / 2;
hole_y_positions = [7, 15, 23];

module cylinder_y(y, length, radius) {
    translate([0, y, 0])
        rotate([-90, 0, 0])
            cylinder(h = length, r = radius);
}

module knuckle_outer(y) {
    cylinder_y(y, knuckle_length, knuckle_outer_radius);
}

module knuckle_bore(y, extra = 0.2) {
    translate([0, y - extra, 0])
        rotate([-90, 0, 0])
            cylinder(
                h = knuckle_length + 2 * extra,
                r = knuckle_inner_radius
            );
}

module mounting_hole(x, y) {
    translate([x, y, plate_z0 - 1])
        cylinder(
            h = plate_thickness + 2,
            r = hole_radius
        );

    translate([x, y, plate_z0 + plate_thickness - countersink_depth])
        cylinder(
            h = countersink_depth + 0.01,
            r1 = hole_radius,
            r2 = countersink_radius
        );
}

module left_leaf() {
    difference() {
        union() {
            translate([-plate_width, 0, plate_z0])
                cube([plate_width, plate_length, plate_thickness]);

            knuckle_outer(0);
            knuckle_outer(12);
            knuckle_outer(24);
        }

        knuckle_bore(0);
        knuckle_bore(12);
        knuckle_bore(24);

        for (y = hole_y_positions)
            mounting_hole(-17, y);
    }
}

module right_leaf() {
    difference() {
        union() {
            translate([0, 0, plate_z0])
                cube([plate_width, plate_length, plate_thickness]);

            knuckle_outer(6);
            knuckle_outer(18);
        }

        knuckle_bore(6);
        knuckle_bore(18);

        for (y = hole_y_positions)
            mounting_hole(17, y);
    }
}

module hinge_pin() {
    cylinder_y(-1, pin_length, pin_radius);
}

color("dimgray")
    left_leaf();

color("silver")
    right_leaf();

color("lightgray")
    hinge_pin();
high success →
high
89.3s · 592/6772t · $0.0082
SCAD (92 lines)
$fn = 96;

// Dimensions
leaf_length = 30;
leaf_width  = 25;
leaf_thickness = 2;

knuckle_length = 6;
knuckle_outer_d = 8;
knuckle_inner_d = 4.6;

pin_d = 4;
pin_length = 32;

hole_d = 3.2;
countersink_d = 6;
countersink_depth = 1;

// The leaf overlaps the knuckle slightly for a connected solid.
// Each leaf remains exactly 25 mm wide.
left_leaf_x0  = -28;
right_leaf_x0 = 3;

hole_y = [7, 15, 23];

module countersunk_hole(x, y) {
    translate([x, y, -leaf_thickness / 2 - 0.01])
        cylinder(h = leaf_thickness + 0.02, d = hole_d);

    translate([x, y, 0])
        cylinder(
            h = countersink_depth,
            r1 = hole_d / 2,
            r2 = countersink_d / 2
        );
}

module leaf_plate(x0, hole_x) {
    difference() {
        translate([x0, 0, -leaf_thickness / 2])
            cube([leaf_width, leaf_length, leaf_thickness]);

        for (y = hole_y)
            countersunk_hole(hole_x, y);
    }
}

module knuckle(y0) {
    difference() {
        translate([0, y0, 0])
            rotate([-90, 0, 0])
                cylinder(h = knuckle_length, d = knuckle_outer_d);

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

module left_leaf_assembly() {
    union() {
        leaf_plate(left_leaf_x0, -15.5);

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

module right_leaf_assembly() {
    union() {
        leaf_plate(right_leaf_x0, 15.5);

        knuckle(6);
        knuckle(18);
    }
}

module hinge_pin() {
    translate([0, -1, 0])
        rotate([-90, 0, 0])
            cylinder(h = pin_length, d = pin_d);
}

color([0.42, 0.44, 0.47])
    left_leaf_assembly();

color([0.48, 0.50, 0.53])
    right_leaf_assembly();

color([0.72, 0.74, 0.78])
    hinge_pin();
max success →
max
312.1s · 592/31160t · $0.0375
SCAD (123 lines)
$fn = 96;

leaf_length    = 30;
leaf_width     = 25;
leaf_thickness = 2;

knuckle_count  = 5;
knuckle_length = leaf_length / knuckle_count;
knuckle_outer_d = 8;
knuckle_inner_d = 4.6;

pin_diameter   = 4;
pin_overhang   = 1;
pin_length     = leaf_length + 2 * pin_overhang;

through_hole_diameter = 3.2;
countersink_diameter  = 6;
countersink_depth     = 1;
hole_pitch            = 8;
hole_edge_inset       = 5;

leaf_root_x = knuckle_outer_d / 2;
hole_x      = leaf_root_x + leaf_width - hole_edge_inset;
hole_y      = [
    leaf_length / 2 - hole_pitch,
    leaf_length / 2,
    leaf_length / 2 + hole_pitch
];

cutter_eps = 0.01;

left_knuckle_starts  = [0, 2 * knuckle_length, 4 * knuckle_length];
right_knuckle_starts = [knuckle_length, 3 * knuckle_length];

module cylinder_y(h, d) {
    rotate([-90, 0, 0])
        cylinder(h = h, d = d, center = false);
}

module leaf_plate(side) {
    x_start = (side > 0)
        ? leaf_root_x
        : (-leaf_root_x - leaf_width);

    difference() {
        translate([x_start, 0, -leaf_thickness / 2])
            cube([leaf_width, leaf_length, leaf_thickness]);

        for (yy = hole_y) {
            translate([
                side * hole_x,
                yy,
                -leaf_thickness / 2 - cutter_eps
            ])
                cylinder(
                    h = leaf_thickness + 2 * cutter_eps,
                    d = through_hole_diameter,
                    center = false
                );

            translate([
                side * hole_x,
                yy,
                leaf_thickness / 2 - countersink_depth
            ])
                cylinder(
                    h = countersink_depth,
                    d1 = through_hole_diameter,
                    d2 = countersink_diameter,
                    center = false
                );
        }
    }
}

module knuckle(y_start) {
    translate([0, y_start, 0])
        difference() {
            cylinder_y(knuckle_length, knuckle_outer_d);

            translate([0, -cutter_eps, 0])
                cylinder_y(
                    knuckle_length + 2 * cutter_eps,
                    knuckle_inner_d
                );
        }
}

module left_part() {
    color([0.48, 0.50, 0.54])
        union() {
            leaf_plate(-1);

            for (y_start = left_knuckle_starts) {
                knuckle(y_start);
            }
        }
}

module right_part() {
    color([0.48, 0.50, 0.54])
        union() {
            leaf_plate(1);

            for (y_start = right_knuckle_starts) {
                knuckle(y_start);
            }
        }
}

module pin_part() {
    color([0.72, 0.74, 0.78])
        translate([0, -pin_overhang, 0])
            cylinder_y(pin_length, pin_diameter);
}

module assembly() {
    left_part();
    right_part();
    pin_part();
}

assembly();
xhigh success →
xhigh
83.0s · 592/11160t · $0.0135
SCAD (99 lines)
$fn = 64;

plate_length = 30;
plate_width = 25;
plate_thickness = 2;

pin_diameter = 4;
pin_length = 32;

knuckle_length = 6;
knuckle_outer_diameter = 8;
knuckle_inner_diameter = 4.6;

through_hole_diameter = 3.2;
countersink_diameter = 6;
countersink_depth = 1;

leaf_near_x = knuckle_outer_diameter / 2 - 0.2;
leaf_far_x = leaf_near_x + plate_width;
hole_x = 21.5;

module countersunk_hole(x, y) {
    translate([x, y, -plate_thickness / 2 - 0.1])
        cylinder(
            h = plate_thickness + 0.2,
            d = through_hole_diameter
        );

    translate([x, y, plate_thickness / 2 - countersink_depth])
        cylinder(
            h = countersink_depth,
            r1 = through_hole_diameter / 2,
            r2 = countersink_diameter / 2
        );
}

module leaf_plate(side) {
    x0 = side > 0 ? leaf_near_x : -leaf_far_x;
    screw_x = side > 0 ? hole_x : -hole_x;

    difference() {
        translate([x0, 0, -plate_thickness / 2])
            cube([plate_width, plate_length, plate_thickness]);

        for (y = [7, 15, 23])
            countersunk_hole(screw_x, y);
    }
}

module knuckle(y0) {
    translate([0, y0, 0])
        rotate([-90, 0, 0])
            difference() {
                cylinder(
                    h = knuckle_length,
                    d = knuckle_outer_diameter
                );

                translate([0, 0, -0.1])
                    cylinder(
                        h = knuckle_length + 0.2,
                        d = knuckle_inner_diameter
                    );
            }
}

module left_leaf() {
    color([0.52, 0.54, 0.58])
        union() {
            leaf_plate(-1);

            for (y = [0, 12, 24])
                knuckle(y);
        }
}

module right_leaf() {
    color([0.62, 0.64, 0.68])
        union() {
            leaf_plate(1);

            for (y = [6, 18])
                knuckle(y);
        }
}

module pin_axis() {
    color([0.35, 0.37, 0.40])
        translate([0, -1, 0])
            rotate([-90, 0, 0])
                cylinder(
                    h = pin_length,
                    d = pin_diameter
                );
}

left_leaf();
right_leaf();
pin_axis();