vibe-openscad

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

6 run / 累計 202.2s / 累計 $0.4835

openai gpt 5.6 sol bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 19.8s · 294/1489t · $0.0461
SCAD (77 lines)
$fn = 64;

width      = 50;
flange_len = 40;
thickness  = 3;

hole_d     = 4.5;
csink_d    = 8;
csink_depth = 2;

hole_x = width / 2 - 10;
horizontal_y = flange_len / 2;
vertical_z   = flange_len / 2;

eps = 0.01;

module bracket() {
    union() {
        // Horizontal flange
        translate([-width / 2, 0, -thickness])
            cube([width, flange_len, thickness]);

        // Vertical flange
        translate([-width / 2, -thickness, 0])
            cube([width, thickness, flange_len]);

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

module horizontal_countersunk_hole(x, y) {
    // Through-hole
    translate([x, y, -thickness - eps])
        cylinder(
            h = thickness + 2 * eps,
            d = hole_d
        );

    // Countersink from the outer/bottom surface
    translate([x, y, -thickness - eps])
        cylinder(
            h = csink_depth + eps,
            d1 = csink_d,
            d2 = hole_d
        );
}

module vertical_countersunk_hole(x, z) {
    // Through-hole
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(
                h = thickness + 2 * eps,
                d = hole_d
            );

    // Countersink from the outer/back surface
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(
                h = csink_depth + eps,
                d1 = csink_d,
                d2 = hole_d
            );
}

difference() {
    bracket();

    for (x = [-hole_x, hole_x])
        horizontal_countersunk_hole(x, horizontal_y);

    for (x = [-hole_x, hole_x])
        vertical_countersunk_hole(x, vertical_z);
}
パラメータ (7) —
スライダを動かすと 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
18.8s · 294/1401t · $0.0435
SCAD (57 lines)
$fn = 64;

width = 50;
flange_depth = 40;
flange_height = 40;
thickness = 3;

through_d = 4.5;
countersink_d = 8;
countersink_depth = 2;

hole_x = width / 2 - 10;
eps = 0.1;

difference() {
    union() {
        // Horizontal flange: +Y, thickness toward -Z
        translate([-width / 2, 0, -thickness])
            cube([width, flange_depth, thickness]);

        // Vertical flange: +Z, thickness toward -Y
        translate([-width / 2, -thickness, 0])
            cube([width, thickness, flange_height]);

        // Sharp outside corner joining both flanges
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

    // Horizontal flange holes; countersinks face downward/outward
    for (x = [-hole_x, hole_x]) {
        translate([x, flange_depth / 2, -thickness - eps])
            cylinder(h = thickness + 2 * eps, d = through_d);

        translate([x, flange_depth / 2, -thickness - eps])
            cylinder(
                h = countersink_depth + eps,
                d1 = countersink_d,
                d2 = through_d
            );
    }

    // Vertical flange holes; countersinks face backward/outward
    for (x = [-hole_x, hole_x]) {
        translate([x, -thickness - eps, flange_height / 2])
            rotate([-90, 0, 0])
                cylinder(h = thickness + 2 * eps, d = through_d);

        translate([x, -thickness - eps, flange_height / 2])
            rotate([-90, 0, 0])
                cylinder(
                    h = countersink_depth + eps,
                    d1 = countersink_d,
                    d2 = through_d
                );
    }
}
medium (default) success →
medium
19.8s · 294/1489t · $0.0461
SCAD (77 lines)
$fn = 64;

width      = 50;
flange_len = 40;
thickness  = 3;

hole_d     = 4.5;
csink_d    = 8;
csink_depth = 2;

hole_x = width / 2 - 10;
horizontal_y = flange_len / 2;
vertical_z   = flange_len / 2;

eps = 0.01;

module bracket() {
    union() {
        // Horizontal flange
        translate([-width / 2, 0, -thickness])
            cube([width, flange_len, thickness]);

        // Vertical flange
        translate([-width / 2, -thickness, 0])
            cube([width, thickness, flange_len]);

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

module horizontal_countersunk_hole(x, y) {
    // Through-hole
    translate([x, y, -thickness - eps])
        cylinder(
            h = thickness + 2 * eps,
            d = hole_d
        );

    // Countersink from the outer/bottom surface
    translate([x, y, -thickness - eps])
        cylinder(
            h = csink_depth + eps,
            d1 = csink_d,
            d2 = hole_d
        );
}

module vertical_countersunk_hole(x, z) {
    // Through-hole
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(
                h = thickness + 2 * eps,
                d = hole_d
            );

    // Countersink from the outer/back surface
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(
                h = csink_depth + eps,
                d1 = csink_d,
                d2 = hole_d
            );
}

difference() {
    bracket();

    for (x = [-hole_x, hole_x])
        horizontal_countersunk_hole(x, horizontal_y);

    for (x = [-hole_x, hole_x])
        vertical_countersunk_hole(x, vertical_z);
}
high success →
high
49.5s · 294/3576t · $0.1087
SCAD (80 lines)
$fn = 96;

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

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

edge_offset = 10;
epsilon     = 0.01;

hole_x_positions = [
    edge_offset,
    width - edge_offset
];

extended_countersink_d =
    countersink_d
    + (countersink_d - hole_d) * epsilon / countersink_depth;

module horizontal_countersunk_hole(x, y) {
    union() {
        translate([x, y, -thickness - epsilon])
            cylinder(
                h = thickness + 2 * epsilon,
                d = hole_d
            );

        translate([x, y, -thickness - epsilon])
            cylinder(
                h  = countersink_depth + epsilon,
                d1 = extended_countersink_d,
                d2 = hole_d
            );
    }
}

module vertical_countersunk_hole(x, z) {
    union() {
        translate([x, -thickness - epsilon, z])
            rotate([-90, 0, 0])
                cylinder(
                    h = thickness + 2 * epsilon,
                    d = hole_d
                );

        translate([x, -thickness - epsilon, z])
            rotate([-90, 0, 0])
                cylinder(
                    h  = countersink_depth + epsilon,
                    d1 = extended_countersink_d,
                    d2 = hole_d
                );
    }
}

difference() {
    union() {
        // Horizontal flange: +Y direction
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

        // Vertical flange: +Z direction
        translate([0, -thickness, 0])
            cube([width, thickness, height]);

        // Sharp outer corner connection
        translate([0, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }

    for (x = hole_x_positions)
        horizontal_countersunk_hole(x, depth / 2);

    for (x = hole_x_positions)
        vertical_countersunk_hole(x, height / 2);
}
max success →
max
50.1s · 294/4262t · $0.1293
SCAD (76 lines)
$fn = 96;

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

hole_d     = 4.5;
csk_d      = 8;
csk_depth  = 2;
edge_offset = 10;
eps         = 0.02;

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

module bracket_body() {
    union() {
        // Horizontal flange: extends in +Y, thickness toward -Z
        translate([-width / 2, -thickness, -thickness])
            cube([width, depth + thickness, thickness]);

        // Vertical flange: extends in +Z, thickness toward -Y
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, height + thickness]);
    }
}

module horizontal_countersunk_hole(x, y) {
    union() {
        translate([x, y, -thickness - eps])
            cylinder(h = thickness + 2 * eps, d = hole_d);

        translate([x, y, -thickness - eps])
            cylinder(h = eps, d = csk_d);

        translate([x, y, -thickness])
            cylinder(
                h  = csk_depth,
                d1 = csk_d,
                d2 = hole_d
            );
    }
}

module vertical_countersunk_hole(x, z) {
    union() {
        translate([x, -thickness - eps, z])
            rotate([-90, 0, 0])
                cylinder(h = thickness + 2 * eps, d = hole_d);

        translate([x, -thickness - eps, z])
            rotate([-90, 0, 0])
                cylinder(h = eps, d = csk_d);

        translate([x, -thickness, z])
            rotate([-90, 0, 0])
                cylinder(
                    h  = csk_depth,
                    d1 = csk_d,
                    d2 = hole_d
                );
    }
}

difference() {
    bracket_body();

    for (x = hole_x_positions)
        horizontal_countersunk_hole(x, depth / 2);

    for (x = hole_x_positions)
        vertical_countersunk_hole(x, height / 2);
}
xhigh success →
xhigh
44.2s · 294/3606t · $0.1096
SCAD (72 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;

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

module bracket_body() {
    union() {
        // Horizontal flange: +Y, outer face at Z = -thickness
        translate([-width / 2, 0, -thickness])
            cube([width, depth, thickness]);

        // Vertical flange: +Z, outer face at Y = -thickness
        translate([-width / 2, -thickness, 0])
            cube([width, thickness, height]);

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

module horizontal_countersunk_hole(x, y) {
    // Through-hole
    translate([x, y, -thickness - eps])
        cylinder(h = thickness + 2 * eps, d = hole_d);

    // Countersink opening toward the outer, lower face
    translate([x, y, -thickness])
        cylinder(
            h  = countersink_depth,
            d1 = countersink_d,
            d2 = hole_d
        );
}

module vertical_countersunk_hole(x, z) {
    // Through-hole
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 2 * eps, d = hole_d);

    // Countersink opening toward the outer, rear face
    translate([x, -thickness, z])
        rotate([-90, 0, 0])
            cylinder(
                h  = countersink_depth,
                d1 = countersink_d,
                d2 = hole_d
            );
}

difference() {
    bracket_body();

    for (x = hole_x_positions) {
        horizontal_countersunk_hole(x, depth / 2);
        vertical_countersunk_hole(x, height / 2);
    }
}