vibe-openscad

iter-png-2/gemini-2.5-flash / tier-2-l-bracket

success tier 2

bare (gemini 2.5 flash)

render
bare render of tier-2-l-bracket
loading STL…
success 18.1s · 2008/1430t · $0.0042
SCAD (89 lines)
// L-bracket parameters
flange_width = 50;
flange_depth_horiz = 40;
flange_height_vert = 40;
plate_thickness = 3;

// Countersunk hole parameters (M4 screw)
// M4 specifies a major diameter of 4mm.
// A common clearance hole diameter is 4.5mm.
// A common countersunk head diameter is 8mm, with a depth of 2mm.
cs_hole_depth_cs = 2; // Depth of the conical countersunk part
cs_hole_radius_top = 8 / 2; // Radius at the top of the countersunk part
cs_hole_radius_bottom = 4.5 / 2; // Radius at the bottom of the countersunk part (same as through hole)
thru_hole_radius = 4.5 / 2; // Radius of the straight through hole

// Overall depth for the hole operation to ensure complete cut through the plate
hole_overall_depth = plate_thickness + 2; // plate_thickness (3mm) + extra (2mm) = 5mm

// Hole placement parameters
hole_margin = 10; // Distance from the edge to the center of the hole

// Module for a countersunk hole, defined to originate at [0,0,0] and extend along the +Z axis.
// The wide part of the countersink is at Z=0, and it extends upwards towards +Z.
// This allows easy rotation and translation to position the holes correctly for subtraction.
module countersunk_hole_m4() {
    union() {
        // Conical countersunk part (from Z=0 to Z=cs_hole_depth_cs)
        cylinder(h = cs_hole_depth_cs, r1 = cs_hole_radius_top, r2 = cs_hole_radius_bottom, $fn = 64);
        // Straight through hole part, starting from where the countersunk part ends
        translate([0, 0, cs_hole_depth_cs])
        cylinder(h = hole_overall_depth - cs_hole_depth_cs, r = thru_hole_radius, $fn = 64);
    }
}

difference() {
    // 1. Main L-bracket shape
    union() {
        // Horizontal flange:
        // Dimensions: [width, depth, thickness] = [50mm, 40mm, 3mm]
        // Placed with inner corner at [0,0,0].
        // Extends from X=0 to 50, Y=0 to 40, Z=0 to 3.
        // +Y direction is depth, +Z direction is upwards (thickness).
        cube([flange_width, flange_depth_horiz, plate_thickness]);

        // Vertical flange:
        // Dimensions: [width, thickness, height] = [50mm, 3mm, 40mm]
        // Placed with inner corner at [0,0,0].
        // Extends from X=0 to 50, Y=0 to 3, Z=0 to 40.
        // +Y direction is thickness (into the bracket), +Z direction is height.
        cube([flange_width, plate_thickness, flange_height_vert]);
    }

    // 2. Countersunk holes to subtract from the bracket
    // The countersunk_hole_m4 module creates a hole with its wide part at Z=0, extending along +Z.
    // We need to translate and rotate it to match the desired position and orientation
    // such that the countersink faces "outwards" from the bracket.

    // Horizontal flange holes:
    // Located on the top surface (Z = plate_thickness), facing outwards (towards +Z).
    // The inner corner is at [0,0,0], so the "outer" side of the horizontal flange is its top surface (Z=plate_thickness).
    // X-coordinate: Center of the flange (flange_width / 2).
    // Y-coordinates: hole_margin and (flange_depth_horiz - hole_margin).
    // Z-coordinate: Top surface of the flange (plate_thickness).
    // Rotation: [180, 0, 0] makes the hole point downwards (-Z), ensuring the countersink is on the top surface
    //           and recesses into the material from there.
    translate([flange_width / 2, hole_margin, plate_thickness])
    rotate([180, 0, 0]) // Rotate 180 deg around X-axis to point hole downwards
    countersunk_hole_m4();

    translate([flange_width / 2, flange_depth_horiz - hole_margin, plate_thickness])
    rotate([180, 0, 0]) // Rotate 180 deg around X-axis to point hole downwards
    countersunk_hole_m4();

    // Vertical flange holes:
    // Located on the front surface (Y = plate_thickness), facing outwards (towards +Y).
    // The inner corner is at [0,0,0], so the "outer" side of the vertical flange is its front surface (Y=plate_thickness).
    // X-coordinate: Center of the flange (flange_width / 2).
    // Y-coordinate: Front surface of the flange (plate_thickness).
    // Z-coordinates: hole_margin and (flange_height_vert - hole_margin).
    // Rotation: [90, 0, 0] makes the hole point towards +Y, ensuring the countersink is on the front surface
    //           and recesses into the material from there.
    translate([flange_width / 2, plate_thickness, hole_margin])
    rotate([90, 0, 0]) // Rotate 90 deg around X-axis to point hole towards +Y
    countersunk_hole_m4();

    translate([flange_width / 2, plate_thickness, flange_height_vert - hole_margin])
    rotate([90, 0, 0]) // Rotate 90 deg around X-axis to point hole towards +Y
    countersunk_hole_m4();
}
パラメータ (6)
スライダを動かすと openscad-wasm で再レンダリング

meta

runIditer-png-2_gemini-2.5-flash-3485c184afdb-2026-04-28T18-58-09-159Z
matrixIditer-png-2/gemini-2.5-flash
signature3485c184afdbd6e5…
providergoogle
modelgemini-2.5-flash
harnessbare
statussuccess
duration18.11s (wallclock: load + prompt eval + generation + network)
tokens2008 in / 1430 out
wallclock tok/s79.0 tok/s (end-to-end)
cost$0.0042
createdAt2026-04-28T18:58:09.159Z
gitCommit781e6c683dda
openscadOpenSCAD version 2026.04.27

iteration chain

各 iteration step は独立した benchmark run です。parentRunId で前段にリンクします。

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 ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。