vibe-openscad

tier-2-l-bracket / gpt-6-sol

6 run / 累計 147.7s / 累計 $0.1185

openai gpt 6 sol bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 17.4s · 294/1346t · $0.0140
SCAD (51 lines)
$fn = 64;

width = 50;
flange_length = 40;
thickness = 3;

hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;
edge_offset = 10;
eps = 0.01;

// 両フランジの内側コーナーを (Y, Z) = (0, 0) に配置
outer_edge = flange_length - thickness;
hole_position = (outer_edge - thickness) / 2;

difference() {
    union() {
        // 水平フランジ
        translate([-width/2, -thickness, -thickness])
            cube([width, flange_length, thickness]);

        // 垂直フランジ
        translate([-width/2, -thickness, -thickness])
            cube([width, thickness, flange_length]);
    }

    for (x = [-width/2 + edge_offset, width/2 - edge_offset]) {
        // 水平面:外側(下面)から皿穴を加工
        translate([x, hole_position, -thickness - eps])
            cylinder(d = hole_diameter, h = thickness + 2*eps);
        translate([x, hole_position, -thickness - eps])
            cylinder(
                d1 = countersink_diameter,
                d2 = hole_diameter,
                h = countersink_depth + eps
            );

        // 垂直面:外側(背面)から皿穴を加工
        translate([x, -thickness - eps, hole_position])
            rotate([-90, 0, 0])
                cylinder(d = hole_diameter, h = thickness + 2*eps);
        translate([x, -thickness - eps, hole_position])
            rotate([-90, 0, 0])
                cylinder(
                    d1 = countersink_diameter,
                    d2 = hole_diameter,
                    h = countersink_depth + eps
                );
    }
}
パラメータ (8) —
スライダを動かすと openscad-wasm で再レンダリング

prompt

OpenSCAD で、L 字に折れた金具(L-bracket)を作ってください。

形状:
- 水平面と垂直面の 2 つのフランジが直角に繋がっている
- 水平面は 50mm × 40mm(幅 × 奥行き)
- 垂直面は 50mm × 40mm(幅 × 高さ)
- 板厚はどちらも 3mm
- 内側コーナーが原点になるように配置(水平面は +Y 方向、垂直面は +Z 方向に伸びる)

皿穴(countersunk holes):
- 各面に 2 個ずつ、合計 4 個
- M4 ねじ用(貫通穴 Φ4.5mm + 皿座面 Φ8mm × 深さ 2mm)
- 各面の中心線上で、面の縁から 10mm 内側、左右対称に 2 個並べる
- 皿座面は外側(ボルト頭が当たる側)に向ける

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。

variant: effort

low success →
low
10.0s · 294/567t · $0.0063
SCAD (46 lines)
$fn = 64;

width = 50;
flange_length = 40;
thickness = 3;

hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;

hole_x = [-width / 2 + 10, width / 2 - 10];

difference() {
    union() {
        // 内側コーナーを Y=0, Z=0 に配置
        translate([-width / 2, 0, -thickness])
            cube([width, flange_length, thickness]);

        translate([-width / 2, -thickness, 0])
            cube([width, thickness, flange_length]);
    }

    for (x = hole_x) {
        // 水平面:外側(下面)に皿座面
        translate([x, flange_length / 2, -thickness])
            cylinder(h = thickness, d = hole_diameter);

        translate([x, flange_length / 2, -thickness])
            cylinder(
                h = countersink_depth,
                d1 = countersink_diameter,
                d2 = hole_diameter
            );

        // 垂直面:外側(背面)に皿座面
        translate([x, -thickness, flange_length / 2])
            rotate([-90, 0, 0]) {
                cylinder(h = thickness, d = hole_diameter);
                cylinder(
                    h = countersink_depth,
                    d1 = countersink_diameter,
                    d2 = hole_diameter
                );
            }
    }
}
medium (default) success →
medium
17.4s · 294/1346t · $0.0140
SCAD (51 lines)
$fn = 64;

width = 50;
flange_length = 40;
thickness = 3;

hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;
edge_offset = 10;
eps = 0.01;

// 両フランジの内側コーナーを (Y, Z) = (0, 0) に配置
outer_edge = flange_length - thickness;
hole_position = (outer_edge - thickness) / 2;

difference() {
    union() {
        // 水平フランジ
        translate([-width/2, -thickness, -thickness])
            cube([width, flange_length, thickness]);

        // 垂直フランジ
        translate([-width/2, -thickness, -thickness])
            cube([width, thickness, flange_length]);
    }

    for (x = [-width/2 + edge_offset, width/2 - edge_offset]) {
        // 水平面:外側(下面)から皿穴を加工
        translate([x, hole_position, -thickness - eps])
            cylinder(d = hole_diameter, h = thickness + 2*eps);
        translate([x, hole_position, -thickness - eps])
            cylinder(
                d1 = countersink_diameter,
                d2 = hole_diameter,
                h = countersink_depth + eps
            );

        // 垂直面:外側(背面)から皿穴を加工
        translate([x, -thickness - eps, hole_position])
            rotate([-90, 0, 0])
                cylinder(d = hole_diameter, h = thickness + 2*eps);
        translate([x, -thickness - eps, hole_position])
            rotate([-90, 0, 0])
                cylinder(
                    d1 = countersink_diameter,
                    d2 = hole_diameter,
                    h = countersink_depth + eps
                );
    }
}
high success →
high
17.7s · 294/1397t · $0.0146
SCAD (55 lines)
$fn = 64;

width = 50;
horizontal_depth = 40;
vertical_height = 40;
thickness = 3;

hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;
edge_offset = 10;
eps = 0.02;

hole_x = [-width / 2 + edge_offset, width / 2 - edge_offset];

difference() {
    union() {
        // 内側コーナーを (Y, Z) = (0, 0) に配置
        translate([-width / 2, 0, -thickness])
            cube([width, horizontal_depth, thickness]);

        translate([-width / 2, -thickness, 0])
            cube([width, thickness, vertical_height]);

        // 2 面をつなぐ外側コーナー
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

    for (x = hole_x) {
        // 水平面:外側(下面)に皿座面
        translate([x, horizontal_depth / 2, -thickness - eps])
            cylinder(h = thickness + 2 * eps, d = hole_diameter);

        translate([x, horizontal_depth / 2, -thickness])
            cylinder(
                h = countersink_depth,
                d1 = countersink_diameter,
                d2 = hole_diameter
            );

        // 垂直面:外側(-Y 側)に皿座面
        translate([x, -thickness - eps, vertical_height / 2])
            rotate([-90, 0, 0])
                cylinder(h = thickness + 2 * eps, d = hole_diameter);

        translate([x, -thickness, vertical_height / 2])
            rotate([-90, 0, 0])
                cylinder(
                    h = countersink_depth,
                    d1 = countersink_diameter,
                    d2 = hole_diameter
                );
    }
}
max success →
max
58.7s · 294/4975t · $0.0503
SCAD (55 lines)
$fn = 96;

width = 50;
depth = 40;
height = 40;
thickness = 3;

hole_diameter = 4.5;
countersink_diameter = 8;
countersink_depth = 2;
edge_offset = 10;
eps = 0.02;

// ローカル座標の Z=0 を外側表面とし、+Z 方向へ穴を開ける。
module countersunk_hole() {
    translate([0, 0, -eps])
        cylinder(d = hole_diameter, h = thickness + 2 * eps);

    translate([0, 0, -eps])
        cylinder(
            d1 = countersink_diameter
                 + (countersink_diameter - hole_diameter)
                   * eps / countersink_depth,
            d2 = hole_diameter,
            h = countersink_depth + eps
        );
}

difference() {
    union() {
        // 水平フランジ:内側表面 Z=0、+Y 方向へ延びる
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

        // 垂直フランジ:内側表面 Y=0、+Z 方向へ延びる
        translate([-width / 2, -thickness, 0])
            cube([width, thickness, height]);

        // 両フランジをつなぐ外側コーナー
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

    for (x = [-width / 2 + edge_offset,
              width / 2 - edge_offset]) {
        // 水平面:皿座面は -Z 側
        translate([x, depth / 2, -thickness])
            countersunk_hole();

        // 垂直面:皿座面は -Y 側
        translate([x, -thickness, height / 2])
            rotate([-90, 0, 0])
                countersunk_hole();
    }
}
xhigh success →
xhigh
26.5s · 294/1867t · $0.0193
SCAD (43 lines)
$fn = 96;

width = 50;
depth = 40;
height = 40;
thickness = 3;

hole_d = 4.5;
countersink_d = 8;
countersink_depth = 2;
edge_offset = 10;
eps = 0.01;

// 内側コーナーを Y=0, Z=0 に置く。
difference() {
    union() {
        // 水平フランジ:内側コーナーから +Y 方向へ 40 mm
        translate([-width/2, -thickness, -thickness])
            cube([width, depth + thickness, thickness]);

        // 垂直フランジ:内側コーナーから +Z 方向へ 40 mm
        translate([-width/2, -thickness, -thickness])
            cube([width, thickness, height + thickness]);
    }

    for (x = [-width/2 + edge_offset, width/2 - edge_offset]) {
        // 水平面:外側(下面)に皿座面
        translate([x, depth/2, -thickness - eps])
            cylinder(h = thickness + 2*eps, d = hole_d);
        translate([x, depth/2, -thickness])
            cylinder(h = countersink_depth,
                     d1 = countersink_d, d2 = hole_d);

        // 垂直面:外側(背面)に皿座面
        translate([x, -thickness - eps, height/2])
            rotate([-90, 0, 0])
                cylinder(h = thickness + 2*eps, d = hole_d);
        translate([x, -thickness, height/2])
            rotate([-90, 0, 0])
                cylinder(h = countersink_depth,
                         d1 = countersink_d, d2 = hole_d);
    }
}