vibe-openscad

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

6 run / 累計 186.5s / 累計 $0.0900

openai gpt 6.1 sol bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 18.3s · 294/901t · $0.0096
SCAD (68 lines)
// 単位: mm
$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.01;

// 内側コーナーの幅方向中央を原点とする。
// 水平面の内側は Z=0、垂直面の内側は Y=0。
module bracket_body() {
    union() {
        // 水平フランジ
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

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

        // 両フランジを接続するコーナー部分
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }
}

// ローカル Z=0 が外側表面、+Z が板内部。
module countersunk_hole() {
    union() {
        translate([0, 0, -eps])
            cylinder(
                h = thickness + 2 * eps,
                d = hole_diameter
            );

        // 外側へ微小延長し、外側表面での直径を正確に保つ。
        translate([0, 0, -eps])
            cylinder(
                h = countersink_depth + eps,
                d1 = countersink_diameter
                     + (countersink_diameter - hole_diameter)
                     * eps / countersink_depth,
                d2 = hole_diameter
            );
    }
}

difference() {
    bracket_body();

    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();
    }
}
パラメータ (9) —
スライダを動かすと 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
14.2s · 294/701t · $0.0076
SCAD (57 lines)
// 単位: mm
// 内側コーナー: 原点
// 幅方向: X(左右対称)、水平面: +Y、垂直面: +Z
$fn = 96;

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

hole_d      = 4.5;
head_d      = 8;
sink_depth  = 2;
edge_offset = 10;
eps         = 0.01;

// ローカル +Z が板の内側を向く皿穴。
// z = 0 が外側表面。
module countersunk_hole() {
    union() {
        translate([0, 0, -eps])
            cylinder(h = thickness + 2 * eps, d = hole_d);

        cylinder(h = sink_depth, d1 = head_d, d2 = hole_d);

        translate([0, 0, -eps])
            cylinder(h = eps, d = head_d);
    }
}

difference() {
    union() {
        // 水平フランジ: 上面が z = 0
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

        // 垂直フランジ: 内側表面が y = 0
        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();
    }
}
medium (default) success →
medium
18.3s · 294/901t · $0.0096
SCAD (68 lines)
// 単位: mm
$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.01;

// 内側コーナーの幅方向中央を原点とする。
// 水平面の内側は Z=0、垂直面の内側は Y=0。
module bracket_body() {
    union() {
        // 水平フランジ
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

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

        // 両フランジを接続するコーナー部分
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }
}

// ローカル Z=0 が外側表面、+Z が板内部。
module countersunk_hole() {
    union() {
        translate([0, 0, -eps])
            cylinder(
                h = thickness + 2 * eps,
                d = hole_diameter
            );

        // 外側へ微小延長し、外側表面での直径を正確に保つ。
        translate([0, 0, -eps])
            cylinder(
                h = countersink_depth + eps,
                d1 = countersink_diameter
                     + (countersink_diameter - hole_diameter)
                     * eps / countersink_depth,
                d2 = hole_diameter
            );
    }
}

difference() {
    bracket_body();

    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();
    }
}
high success →
high
26.0s · 294/1273t · $0.0133
SCAD (61 lines)
$fn = 96;

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.01;

// ローカル +Z 方向へ切削。Z=0 が外側の板面。
module countersunk_hole() {
    translate([0, 0, -eps])
        cylinder(
            h = thickness + 2 * eps,
            d = hole_diameter
        );

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

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

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

        // 内側コーナーを原点に保ち、両フランジを接続。
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

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

        // 垂直面:外側(-Y 側)に皿座面。
        translate([x, -thickness, vertical_height / 2])
            rotate([-90, 0, 0])
                countersunk_hole();
    }
}
max success →
max
53.4s · 294/2417t · $0.0248
SCAD (55 lines)
$fn = 96;

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

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

eps = 0.01;
hole_x = width / 2 - edge_offset;

module countersunk_hole() {
    union() {
        translate([0, 0, -eps])
            cylinder(
                h = thickness + 2 * eps,
                d = hole_diameter
            );

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

difference() {
    union() {
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

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

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

    for (x = [-hole_x, hole_x]) {
        translate([x, depth / 2, -thickness])
            countersunk_hole();

        translate([x, -thickness, height / 2])
            rotate([-90, 0, 0])
                countersunk_hole();
    }
}
xhigh success →
xhigh
56.3s · 294/2450t · $0.0251
SCAD (61 lines)
$fn = 96;

// 寸法(mm)
width     = 50;
depth     = 40;
height    = 40;
thickness = 3;

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

eps = 0.01;

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

    // 円錐状の皿座面:表面で直径8mm、深さ2mmで直径4.5mm
    translate([0, 0, -eps])
        cylinder(
            h  = countersink_depth + eps,
            d1 = countersink_d
                 + (countersink_d - hole_d)
                 * eps / countersink_depth,
            d2 = hole_d
        );
}

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

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

        // 折れ部を埋め、両フランジを一体化
        translate([0, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

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

        // 垂直面:皿座面は背面(-Y 側)
        translate([x, -thickness, height / 2])
            rotate([-90, 0, 0])
                countersunk_hole();
    }
}