vibe-openscad

tier-2-l-bracket / gpt-5.4-mini-2026-03-17

7 run / 累計 182.3s / 累計 $0.0787

openai gpt 5.4 mini 2026-03-17 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 4.5s · 294/368t · $0.0012
SCAD (53 lines)
// L-bracket with countersunk holes
// Units: mm

$fn = 96;

flange_w = 50;
horiz_d  = 40;
vert_h   = 40;
thickness = 3;

// Hole parameters
hole_d = 4.5;
csk_d  = 8;
csk_h  = 2;
edge_inset = 10;

// Geometry helpers
module countersunk_hole(total_thickness, thru_d, csk_d, csk_h) {
    union() {
        cylinder(h = total_thickness, d = thru_d);
        translate([0, 0, total_thickness - csk_h])
            cylinder(h = csk_h, d1 = thru_d, d2 = csk_d);
    }
}

module horizontal_flange() {
    difference() {
        cube([flange_w, horiz_d, thickness], center = false);

        for (x = [edge_inset, flange_w - edge_inset]) {
            translate([x, horiz_d/2, thickness])
                rotate([180, 0, 0])
                    countersunk_hole(thickness, hole_d, csk_d, csk_h);
        }
    }
}

module vertical_flange() {
    difference() {
        cube([flange_w, thickness, vert_h], center = false);

        for (x = [edge_inset, flange_w - edge_inset]) {
            translate([x, thickness/2, vert_h])
                rotate([180, 0, 0])
                    countersunk_hole(thickness, hole_d, csk_d, csk_h);
        }
    }
}

union() {
    horizontal_flange();
    vertical_flange();
}
パラメータ (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
8.7s · 294/1091t · $0.0034
SCAD (60 lines)
$fn = 96;

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

hole_d = 4.5;
cs_d   = 8;
cs_h   = 2;

module countersunk_hole_z(z0, through_h, cs_from_top=true) {
    // Hole axis: Z
    union() {
        cylinder(d = hole_d, h = through_h, center = false);
        if (cs_from_top)
            translate([0, 0, through_h - cs_h])
                cylinder(d = cs_d, h = cs_h, center = false);
        else
            cylinder(d = cs_d, h = cs_h, center = false);
    }
}

module countersunk_hole_y(y0, through_h, cs_from_outer=true) {
    // Hole axis: Y
    rotate([-90, 0, 0]) {
        union() {
            cylinder(d = hole_d, h = through_h, center = false);
            if (cs_from_outer)
                translate([0, 0, through_h - cs_h])
                    cylinder(d = cs_d, h = cs_h, center = false);
            else
                cylinder(d = cs_d, h = cs_h, center = false);
        }
    }
}

difference() {
    union() {
        // Horizontal flange: X = centered, Y = +, Z = 0..thickness
        translate([-width/2, 0, 0])
            cube([width, depth, thickness], center = false);

        // Vertical flange: X = centered, Y = 0..thickness, Z = +
        translate([-width/2, 0, 0])
            cube([width, thickness, height], center = false);
    }

    // Horizontal flange holes (axis Z), countersink on outer side (top, +Z)
    for (x = [-width/2 + 10, width/2 - 10]) {
        translate([x, 10, 0])
            countersunk_hole_z(0, thickness, true);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = [-width/2 + 10, width/2 - 10]) {
        translate([x, 0, 10])
            countersunk_hole_y(0, thickness, true);
    }
}
medium (default) success
medium
4.5s · 294/368t · $0.0012
SCAD (53 lines)
// L-bracket with countersunk holes
// Units: mm

$fn = 96;

flange_w = 50;
horiz_d  = 40;
vert_h   = 40;
thickness = 3;

// Hole parameters
hole_d = 4.5;
csk_d  = 8;
csk_h  = 2;
edge_inset = 10;

// Geometry helpers
module countersunk_hole(total_thickness, thru_d, csk_d, csk_h) {
    union() {
        cylinder(h = total_thickness, d = thru_d);
        translate([0, 0, total_thickness - csk_h])
            cylinder(h = csk_h, d1 = thru_d, d2 = csk_d);
    }
}

module horizontal_flange() {
    difference() {
        cube([flange_w, horiz_d, thickness], center = false);

        for (x = [edge_inset, flange_w - edge_inset]) {
            translate([x, horiz_d/2, thickness])
                rotate([180, 0, 0])
                    countersunk_hole(thickness, hole_d, csk_d, csk_h);
        }
    }
}

module vertical_flange() {
    difference() {
        cube([flange_w, thickness, vert_h], center = false);

        for (x = [edge_inset, flange_w - edge_inset]) {
            translate([x, thickness/2, vert_h])
                rotate([180, 0, 0])
                    countersunk_hole(thickness, hole_d, csk_d, csk_h);
        }
    }
}

union() {
    horizontal_flange();
    vertical_flange();
}
high success
high
155.4s · 294/22533t · $0.0677
SCAD (40 lines)
$fn = 64;

w = 50;
d = 40;
h = 40;
t = 3;

hole_d = 4.5;
cs_d = 8;
cs_depth = 2;

module cs_hole_z(ypos) {
    translate([0, ypos, 0]) {
        cylinder(d = hole_d, h = t);
        translate([0, 0, t - cs_depth])
            cylinder(d1 = hole_d, d2 = cs_d, h = cs_depth);
    }
}

module cs_hole_y(zpos) {
    translate([0, 0, zpos])
        rotate([90, 0, 0]) {
            cylinder(d = hole_d, h = t);
            translate([0, 0, t - cs_depth])
                cylinder(d1 = hole_d, d2 = cs_d, h = cs_depth);
        }
}

difference() {
    union() {
        translate([-w/2, 0, 0]) cube([w, d, t]);
        translate([-w/2, 0, 0]) cube([w, t, h]);
    }

    for (ypos = [10, d - 10])
        cs_hole_z(ypos);

    for (zpos = [10, h - 10])
        cs_hole_y(zpos);
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
3.3s · 1327/387t · $0.0017
diff vs bare: +27/-26
- // L-bracket with countersunk holes
- // Units: mm
- 
  $fn = 96;
  
- flange_w = 50;
- horiz_d  = 40;
- vert_h   = 40;
- thickness = 3;
+ // Dimensions
+ w = 50;      // flange width
+ d = 40;      // horizontal flange depth
+ h = 40;      // vertical flange height
+ t = 3;       // thickness
  
  // Hole parameters
- hole_d = 4.5;
- csk_d  = 8;
- csk_h  = 2;
- edge_inset = 10;
+ through_d = 4.5;
+ csk_d = 8;
+ csk_depth = 2;
+ inset = 10;
  
- // Geometry helpers
- module countersunk_hole(total_thickness, thru_d, csk_d, csk_h) {
+ // Countersunk hole cutout along +Z, with countersink on the top side
+ module csk_cut(hole_len) {
      union() {
-         cylinder(h = total_thickness, d = thru_d);
-         translate([0, 0, total_thickness - csk_h])
-             cylinder(h = csk_h, d1 = thru_d, d2 = csk_d);
+         cylinder(h = hole_len, d = through_d);
+         translate([0, 0, hole_len - csk_depth])
+             cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
      }
  }
  
+ // Horizontal flange: X width, Y depth, Z thickness
  module horizontal_flange() {
      difference() {
-         cube([flange_w, horiz_d, thickness], center = false);
+         cube([w, d, t], center = false);
  
-         for (x = [edge_inset, flange_w - edge_inset]) {
-             translate([x, horiz_d/2, thickness])
-                 rotate([180, 0, 0])
-                     countersunk_hole(thickness, hole_d, csk_d, csk_h);
+         for (x = [inset, w - inset]) {
+             translate([x, d/2, 0])
+                 csk_cut(t);
          }
      }
  }
  
+ // Vertical flange: X width, Y thickness, Z height
+ // Positioned so inner corner is at the origin and it extends in +Z.
+ // Countersink is on the outside face at Y = thickness side.
  module vertical_flange() {
      difference() {
-         cube([flange_w, thickness, vert_h], center = false);
+         cube([w, t, h], center = false);
  
-         for (x = [edge_inset, flange_w - edge_inset]) {
-             translate([x, thickness/2, vert_h])
-                 rotate([180, 0, 0])
-                     countersunk_hole(thickness, hole_d, csk_d, csk_h);
+         for (x = [inset, w - inset]) {
+             translate([x, 0, h - t])
+                 rotate([180, 0, 0])  // make countersink face outward (+Y)
+                     csk_cut(t);
          }
      }
  }
  
  union() {
      horizontal_flange();
      vertical_flange();
  }
SCAD (54 lines)
$fn = 96;

// Dimensions
w = 50;      // flange width
d = 40;      // horizontal flange depth
h = 40;      // vertical flange height
t = 3;       // thickness

// Hole parameters
through_d = 4.5;
csk_d = 8;
csk_depth = 2;
inset = 10;

// Countersunk hole cutout along +Z, with countersink on the top side
module csk_cut(hole_len) {
    union() {
        cylinder(h = hole_len, d = through_d);
        translate([0, 0, hole_len - csk_depth])
            cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
    }
}

// Horizontal flange: X width, Y depth, Z thickness
module horizontal_flange() {
    difference() {
        cube([w, d, t], center = false);

        for (x = [inset, w - inset]) {
            translate([x, d/2, 0])
                csk_cut(t);
        }
    }
}

// Vertical flange: X width, Y thickness, Z height
// Positioned so inner corner is at the origin and it extends in +Z.
// Countersink is on the outside face at Y = thickness side.
module vertical_flange() {
    difference() {
        cube([w, t, h], center = false);

        for (x = [inset, w - inset]) {
            translate([x, 0, h - t])
                rotate([180, 0, 0])  // make countersink face outward (+Y)
                    csk_cut(t);
        }
    }
}

union() {
    horizontal_flange();
    vertical_flange();
}
i2 success
iter 2
2.9s · 1340/398t · $0.0017
diff vs i1: +19/-16
  $fn = 96;
  
  // Dimensions
- w = 50;      // flange width
- d = 40;      // horizontal flange depth
- h = 40;      // vertical flange height
- t = 3;       // thickness
+ w = 50;      // flange width (X)
+ d = 40;      // horizontal flange depth (Y)
+ h = 40;      // vertical flange height (Z)
+ t = 3;       // plate thickness
  
  // Hole parameters
  through_d = 4.5;
  csk_d = 8;
  csk_depth = 2;
  inset = 10;
  
- // Countersunk hole cutout along +Z, with countersink on the top side
- module csk_cut(hole_len) {
+ // Countersunk through-hole along +Z, countersink on the +Z side
+ module csk_hole_z(hole_h) {
      union() {
-         cylinder(h = hole_len, d = through_d);
-         translate([0, 0, hole_len - csk_depth])
+         cylinder(h = hole_h, d = through_d);
+         translate([0, 0, hole_h - csk_depth])
              cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
      }
  }
  
- // Horizontal flange: X width, Y depth, Z thickness
+ // Countersunk through-hole along +Y, countersink on the +Y side
+ module csk_hole_y(hole_h) {
+     rotate([-90, 0, 0])
+         csk_hole_z(hole_h);
+ }
+ 
+ // Horizontal flange: lies in XY plane, thickness in Z
  module horizontal_flange() {
      difference() {
          cube([w, d, t], center = false);
  
          for (x = [inset, w - inset]) {
              translate([x, d/2, 0])
-                 csk_cut(t);
+                 csk_hole_z(t);
          }
      }
  }
  
- // Vertical flange: X width, Y thickness, Z height
- // Positioned so inner corner is at the origin and it extends in +Z.
- // Countersink is on the outside face at Y = thickness side.
+ // Vertical flange: lies in XZ plane, thickness in Y
  module vertical_flange() {
      difference() {
          cube([w, t, h], center = false);
  
          for (x = [inset, w - inset]) {
-             translate([x, 0, h - t])
-                 rotate([180, 0, 0])  // make countersink face outward (+Y)
-                     csk_cut(t);
+             translate([x, t, h/2])
+                 csk_hole_y(t);
          }
      }
  }
  
  union() {
      horizontal_flange();
      vertical_flange();
  }
SCAD (57 lines)
$fn = 96;

// Dimensions
w = 50;      // flange width (X)
d = 40;      // horizontal flange depth (Y)
h = 40;      // vertical flange height (Z)
t = 3;       // plate thickness

// Hole parameters
through_d = 4.5;
csk_d = 8;
csk_depth = 2;
inset = 10;

// Countersunk through-hole along +Z, countersink on the +Z side
module csk_hole_z(hole_h) {
    union() {
        cylinder(h = hole_h, d = through_d);
        translate([0, 0, hole_h - csk_depth])
            cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
    }
}

// Countersunk through-hole along +Y, countersink on the +Y side
module csk_hole_y(hole_h) {
    rotate([-90, 0, 0])
        csk_hole_z(hole_h);
}

// Horizontal flange: lies in XY plane, thickness in Z
module horizontal_flange() {
    difference() {
        cube([w, d, t], center = false);

        for (x = [inset, w - inset]) {
            translate([x, d/2, 0])
                csk_hole_z(t);
        }
    }
}

// Vertical flange: lies in XZ plane, thickness in Y
module vertical_flange() {
    difference() {
        cube([w, t, h], center = false);

        for (x = [inset, w - inset]) {
            translate([x, t, h/2])
                csk_hole_y(t);
        }
    }
}

union() {
    horizontal_flange();
    vertical_flange();
}
i3 success
iter 3
2.9s · 1351/394t · $0.0017
diff vs i2: +6/-6
  $fn = 96;
  
  // Dimensions
- w = 50;      // flange width (X)
- d = 40;      // horizontal flange depth (Y)
- h = 40;      // vertical flange height (Z)
+ w = 50;      // width
+ d = 40;      // horizontal flange depth (+Y)
+ h = 40;      // vertical flange height (+Z)
  t = 3;       // plate thickness
  
  // Hole parameters
  through_d = 4.5;
  csk_d = 8;
  csk_depth = 2;
  inset = 10;
  
  // Countersunk through-hole along +Z, countersink on the +Z side
  module csk_hole_z(hole_h) {
      union() {
          cylinder(h = hole_h, d = through_d);
          translate([0, 0, hole_h - csk_depth])
              cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
      }
  }
  
  // Countersunk through-hole along +Y, countersink on the +Y side
  module csk_hole_y(hole_h) {
      rotate([-90, 0, 0])
          csk_hole_z(hole_h);
  }
  
- // Horizontal flange: lies in XY plane, thickness in Z
+ // Horizontal flange: X by Y, thickness in Z
  module horizontal_flange() {
      difference() {
          cube([w, d, t], center = false);
  
          for (x = [inset, w - inset]) {
              translate([x, d/2, 0])
                  csk_hole_z(t);
          }
      }
  }
  
- // Vertical flange: lies in XZ plane, thickness in Y
+ // Vertical flange: X by Z, thickness in Y
  module vertical_flange() {
      difference() {
          cube([w, t, h], center = false);
  
          for (x = [inset, w - inset]) {
-             translate([x, t, h/2])
+             translate([x, t/2, h/2])
                  csk_hole_y(t);
          }
      }
  }
  
  union() {
      horizontal_flange();
      vertical_flange();
  }
SCAD (57 lines)
$fn = 96;

// Dimensions
w = 50;      // width
d = 40;      // horizontal flange depth (+Y)
h = 40;      // vertical flange height (+Z)
t = 3;       // plate thickness

// Hole parameters
through_d = 4.5;
csk_d = 8;
csk_depth = 2;
inset = 10;

// Countersunk through-hole along +Z, countersink on the +Z side
module csk_hole_z(hole_h) {
    union() {
        cylinder(h = hole_h, d = through_d);
        translate([0, 0, hole_h - csk_depth])
            cylinder(h = csk_depth, d1 = through_d, d2 = csk_d);
    }
}

// Countersunk through-hole along +Y, countersink on the +Y side
module csk_hole_y(hole_h) {
    rotate([-90, 0, 0])
        csk_hole_z(hole_h);
}

// Horizontal flange: X by Y, thickness in Z
module horizontal_flange() {
    difference() {
        cube([w, d, t], center = false);

        for (x = [inset, w - inset]) {
            translate([x, d/2, 0])
                csk_hole_z(t);
        }
    }
}

// Vertical flange: X by Z, thickness in Y
module vertical_flange() {
    difference() {
        cube([w, t, h], center = false);

        for (x = [inset, w - inset]) {
            translate([x, t/2, h/2])
                csk_hole_y(t);
        }
    }
}

union() {
    horizontal_flange();
    vertical_flange();
}