vibe-openscad

tier-2-l-bracket / gpt-5-2025-08-07

7 run / 累計 536.7s / 累計 $0.3592

openai gpt 5 2025-08-07 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 56.9s · 294/3720t · $0.0376
SCAD (46 lines)
// L-bracket with countersunk (counterbored) M4 holes
// Dimensions
w = 50;      // width (X)
d = 40;      // depth of horizontal flange (Y)
h = 40;      // height of vertical flange (Z)
t = 3;       // thickness

// Holes
dh = 4.5;    // through hole diameter
ds = 8;      // counterbore diameter
sd = 2;      // counterbore depth
edge = 10;   // hole offset from side edges along X

$fn = 64;

difference() {
  // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
  union() {
    // Horizontal flange: X=w, Y=d, Z=t
    cube([w, d, t], center=false);
    // Vertical flange: X=w, Y=t, Z=h
    cube([w, t, h], center=false);
  }

  // Horizontal flange holes (axis along Z), countersink from top (+Z)
  for (x = [edge, w - edge]) {
    // Through hole
    translate([x, d/2, -1])
      cylinder(h = t + 2, d = dh);
    // Counterbore from top face
    translate([x, d/2, t - sd])
      cylinder(h = sd, d = ds);
  }

  // Vertical flange holes (axis along Y), countersink from outside face (+Y)
  for (x = [edge, w - edge]) {
    // Through hole (centered, long enough to pass through thickness)
    translate([x, t/2, h/2])
      rotate([90, 0, 0])
        cylinder(h = t + 6, d = dh, center=true);
    // Counterbore from outside face at Y = +t, depth sd toward -Y
    translate([x, t, h/2])
      rotate([90, 0, 0])
        cylinder(h = sd, d = ds, center=false);
  }
}
パラメータ (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
29.9s · 294/2554t · $0.0259
SCAD (45 lines)
// L-bracket with countersunk holes
w = 50;          // width (X)
d = 40;          // depth of horizontal flange (Y)
h = 40;          // height of vertical flange (Z)
t = 3;           // thickness
eps = 0.1;

thru_d = 4.5;    // through hole diameter for M4
csk_d  = 8;      // countersink diameter
csk_h  = 2;      // countersink depth

// Hole placement
hx = w/2 - 10;   // X offset from center to be 10mm in from side edges
hy = d - 10;     // Y position for horizontal flange holes (10mm from free edge)
hz = h - 10;     // Z position for vertical flange holes (10mm from free edge)

difference() {
  // Bracket solid: inner corner at origin; horizontal +Y, vertical +Z
  union() {
    // Horizontal flange (X: -25..25, Y: 0..40, Z: 0..3)
    translate([-w/2, 0, 0]) cube([w, d, t], center=false);
    // Vertical flange (X: -25..25, Y: 0..3, Z: 0..40)
    translate([-w/2, 0, 0]) cube([w, t, h], center=false);
  }

  // Holes on horizontal flange (axis along Z)
  for (xsign = [-1, 1]) {
    translate([xsign*hx, hy, 0]) {
      // through hole
      translate([0, 0, -eps]) cylinder(d=thru_d, h=t+2*eps, $fn=64);
      // countersink from top (+Z) side, depth csk_h
      translate([0, 0, t - csk_h]) cylinder(d=csk_d, h=csk_h+eps, $fn=64);
    }
  }

  // Holes on vertical flange (axis along Y)
  for (xsign = [-1, 1]) {
    translate([xsign*hx, 0, hz]) {
      // through hole
      rotate([90, 0, 0]) translate([0, 0, -eps]) cylinder(d=thru_d, h=t+2*eps, $fn=64);
      // countersink from outside (+Y) side, depth csk_h
      rotate([90, 0, 0]) translate([0, 0, t - csk_h]) cylinder(d=csk_d, h=csk_h+eps, $fn=64);
    }
  }
}
medium (default) success
medium
56.9s · 294/3720t · $0.0376
SCAD (46 lines)
// L-bracket with countersunk (counterbored) M4 holes
// Dimensions
w = 50;      // width (X)
d = 40;      // depth of horizontal flange (Y)
h = 40;      // height of vertical flange (Z)
t = 3;       // thickness

// Holes
dh = 4.5;    // through hole diameter
ds = 8;      // counterbore diameter
sd = 2;      // counterbore depth
edge = 10;   // hole offset from side edges along X

$fn = 64;

difference() {
  // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
  union() {
    // Horizontal flange: X=w, Y=d, Z=t
    cube([w, d, t], center=false);
    // Vertical flange: X=w, Y=t, Z=h
    cube([w, t, h], center=false);
  }

  // Horizontal flange holes (axis along Z), countersink from top (+Z)
  for (x = [edge, w - edge]) {
    // Through hole
    translate([x, d/2, -1])
      cylinder(h = t + 2, d = dh);
    // Counterbore from top face
    translate([x, d/2, t - sd])
      cylinder(h = sd, d = ds);
  }

  // Vertical flange holes (axis along Y), countersink from outside face (+Y)
  for (x = [edge, w - edge]) {
    // Through hole (centered, long enough to pass through thickness)
    translate([x, t/2, h/2])
      rotate([90, 0, 0])
        cylinder(h = t + 6, d = dh, center=true);
    // Counterbore from outside face at Y = +t, depth sd toward -Y
    translate([x, t, h/2])
      rotate([90, 0, 0])
        cylinder(h = sd, d = ds, center=false);
  }
}
high success
high
117.9s · 294/11152t · $0.1119
SCAD (50 lines)
// L-bracket with counterbored holes
width = 50;      // X: plate width
length = 40;     // Y (horizontal depth) / Z (vertical height)
thickness = 3;

hole_d = 4.5;        // through-hole diameter
cbore_d = 8;         // counterbore diameter
cbore_depth = 2;     // counterbore depth
edge_inset = 10;     // inset from side edges along X
$fn = 64;
eps = 0.01;

module ycyl(d, h) { rotate([-90, 0, 0]) cylinder(d=d, h=h, center=false); }

module l_bracket() {
  translate([-width/2, 0, 0])
  difference() {
    // Base geometry: inner corner at (x: any, y=0, z=0), flanges to +Y and +Z
    union() {
      // Horizontal flange (extends +Y)
      cube([width, length, thickness], center=false);
      // Vertical flange (extends +Z)
      cube([width, thickness, length], center=false);
    }

    // Holes on horizontal flange (counterbore on top, z = thickness side)
    for (sx = [-1, 1]) {
      x = width/2 + sx*(width/2 - edge_inset);
      y = length/2;
      // Through hole
      translate([x, y, -eps]) cylinder(d=hole_d, h=thickness + 2*eps);
      // Counterbore (from outer/top face)
      translate([x, y, thickness - cbore_depth - eps])
        cylinder(d=cbore_d, h=cbore_depth + 2*eps);
    }

    // Holes on vertical flange (counterbore on outer side, y = thickness side)
    for (sx = [-1, 1]) {
      x = width/2 + sx*(width/2 - edge_inset);
      z = length/2;
      // Through hole along Y
      translate([x, -eps, z]) ycyl(d=hole_d, h=thickness + 2*eps);
      // Counterbore from outer face (y = thickness)
      translate([x, thickness - cbore_depth - eps, z])
        ycyl(d=cbore_d, h=cbore_depth + 2*eps);
    }
  }
}

l_bracket();
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
76.9s · 1475/4159t · $0.0434
diff vs bare: +0/-0
  // L-bracket with countersunk (counterbored) M4 holes
  // Dimensions
  w = 50;      // width (X)
  d = 40;      // depth of horizontal flange (Y)
  h = 40;      // height of vertical flange (Z)
  t = 3;       // thickness
  
  // Holes
  dh = 4.5;    // through hole diameter
  ds = 8;      // counterbore diameter
  sd = 2;      // counterbore depth
  edge = 10;   // hole offset from side edges along X
  
  $fn = 64;
  
  difference() {
    // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
    union() {
      // Horizontal flange: X=w, Y=d, Z=t
      cube([w, d, t], center=false);
      // Vertical flange: X=w, Y=t, Z=h
      cube([w, t, h], center=false);
    }
  
    // Horizontal flange holes (axis along Z), countersink from top (+Z)
    for (x = [edge, w - edge]) {
      // Through hole
      translate([x, d/2, -1])
        cylinder(h = t + 2, d = dh);
      // Counterbore from top face
      translate([x, d/2, t - sd])
        cylinder(h = sd, d = ds);
    }
  
    // Vertical flange holes (axis along Y), countersink from outside face (+Y)
    for (x = [edge, w - edge]) {
      // Through hole (centered, long enough to pass through thickness)
      translate([x, t/2, h/2])
        rotate([90, 0, 0])
          cylinder(h = t + 6, d = dh, center=true);
      // Counterbore from outside face at Y = +t, depth sd toward -Y
      translate([x, t, h/2])
        rotate([90, 0, 0])
          cylinder(h = sd, d = ds, center=false);
    }
  }
SCAD (46 lines)
// L-bracket with countersunk (counterbored) M4 holes
// Dimensions
w = 50;      // width (X)
d = 40;      // depth of horizontal flange (Y)
h = 40;      // height of vertical flange (Z)
t = 3;       // thickness

// Holes
dh = 4.5;    // through hole diameter
ds = 8;      // counterbore diameter
sd = 2;      // counterbore depth
edge = 10;   // hole offset from side edges along X

$fn = 64;

difference() {
  // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
  union() {
    // Horizontal flange: X=w, Y=d, Z=t
    cube([w, d, t], center=false);
    // Vertical flange: X=w, Y=t, Z=h
    cube([w, t, h], center=false);
  }

  // Horizontal flange holes (axis along Z), countersink from top (+Z)
  for (x = [edge, w - edge]) {
    // Through hole
    translate([x, d/2, -1])
      cylinder(h = t + 2, d = dh);
    // Counterbore from top face
    translate([x, d/2, t - sd])
      cylinder(h = sd, d = ds);
  }

  // Vertical flange holes (axis along Y), countersink from outside face (+Y)
  for (x = [edge, w - edge]) {
    // Through hole (centered, long enough to pass through thickness)
    translate([x, t/2, h/2])
      rotate([90, 0, 0])
        cylinder(h = t + 6, d = dh, center=true);
    // Counterbore from outside face at Y = +t, depth sd toward -Y
    translate([x, t, h/2])
      rotate([90, 0, 0])
        cylinder(h = sd, d = ds, center=false);
  }
}
i2 success
iter 2
68.8s · 1475/3724t · $0.0391
diff vs i1: +4/-4
- // L-bracket with countersunk (counterbored) M4 holes
+ // L-bracket with counterbored M4 holes
  // Dimensions
  w = 50;      // width (X)
  d = 40;      // depth of horizontal flange (Y)
  h = 40;      // height of vertical flange (Z)
  t = 3;       // thickness
  
  // Holes
  dh = 4.5;    // through hole diameter
  ds = 8;      // counterbore diameter
  sd = 2;      // counterbore depth
  edge = 10;   // hole offset from side edges along X
  
  $fn = 64;
  
  difference() {
    // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
    union() {
      // Horizontal flange: X=w, Y=d, Z=t
      cube([w, d, t], center=false);
      // Vertical flange: X=w, Y=t, Z=h
      cube([w, t, h], center=false);
    }
  
-   // Horizontal flange holes (axis along Z), countersink from top (+Z)
+   // Horizontal flange holes (axis along Z), counterbore from top (+Z)
    for (x = [edge, w - edge]) {
      // Through hole
      translate([x, d/2, -1])
        cylinder(h = t + 2, d = dh);
      // Counterbore from top face
      translate([x, d/2, t - sd])
        cylinder(h = sd, d = ds);
    }
  
-   // Vertical flange holes (axis along Y), countersink from outside face (+Y)
+   // Vertical flange holes (axis along Y), counterbore from outside face (+Y)
    for (x = [edge, w - edge]) {
      // Through hole (centered, long enough to pass through thickness)
      translate([x, t/2, h/2])
        rotate([90, 0, 0])
          cylinder(h = t + 6, d = dh, center=true);
      // Counterbore from outside face at Y = +t, depth sd toward -Y
-     translate([x, t, h/2])
+     translate([x, t - sd, h/2])
        rotate([90, 0, 0])
          cylinder(h = sd, d = ds, center=false);
    }
  }
SCAD (46 lines)
// L-bracket with counterbored M4 holes
// Dimensions
w = 50;      // width (X)
d = 40;      // depth of horizontal flange (Y)
h = 40;      // height of vertical flange (Z)
t = 3;       // thickness

// Holes
dh = 4.5;    // through hole diameter
ds = 8;      // counterbore diameter
sd = 2;      // counterbore depth
edge = 10;   // hole offset from side edges along X

$fn = 64;

difference() {
  // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
  union() {
    // Horizontal flange: X=w, Y=d, Z=t
    cube([w, d, t], center=false);
    // Vertical flange: X=w, Y=t, Z=h
    cube([w, t, h], center=false);
  }

  // Horizontal flange holes (axis along Z), counterbore from top (+Z)
  for (x = [edge, w - edge]) {
    // Through hole
    translate([x, d/2, -1])
      cylinder(h = t + 2, d = dh);
    // Counterbore from top face
    translate([x, d/2, t - sd])
      cylinder(h = sd, d = ds);
  }

  // Vertical flange holes (axis along Y), counterbore from outside face (+Y)
  for (x = [edge, w - edge]) {
    // Through hole (centered, long enough to pass through thickness)
    translate([x, t/2, h/2])
      rotate([90, 0, 0])
        cylinder(h = t + 6, d = dh, center=true);
    // Counterbore from outside face at Y = +t, depth sd toward -Y
    translate([x, t - sd, h/2])
      rotate([90, 0, 0])
        cylinder(h = sd, d = ds, center=false);
  }
}
i3 success
iter 3
129.3s · 1475/6190t · $0.0637
diff vs i2: +11/-8
  // L-bracket with counterbored M4 holes
  // Dimensions
  w = 50;      // width (X)
  d = 40;      // depth of horizontal flange (Y)
  h = 40;      // height of vertical flange (Z)
  t = 3;       // thickness
  
  // Holes
  dh = 4.5;    // through hole diameter
  ds = 8;      // counterbore diameter
  sd = 2;      // counterbore depth
- edge = 10;   // hole offset from side edges along X
+ edge_x = 10; // X margin from side edges (left/right)
+ row = 10;    // distance from outer edge of each face (Y/Z) toward inside
  
  $fn = 64;
  
  difference() {
    // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
    union() {
      // Horizontal flange: X=w, Y=d, Z=t
      cube([w, d, t], center=false);
      // Vertical flange: X=w, Y=t, Z=h
      cube([w, t, h], center=false);
    }
  
    // Horizontal flange holes (axis along Z), counterbore from top (+Z)
-   for (x = [edge, w - edge]) {
+   // Row located 10 mm from the outer Y edge (y = d - row)
+   for (x = [edge_x, w - edge_x]) {
      // Through hole
-     translate([x, d/2, -1])
+     translate([x, d - row, -1])
        cylinder(h = t + 2, d = dh);
      // Counterbore from top face
-     translate([x, d/2, t - sd])
+     translate([x, d - row, t - sd])
        cylinder(h = sd, d = ds);
    }
  
    // Vertical flange holes (axis along Y), counterbore from outside face (+Y)
-   for (x = [edge, w - edge]) {
-     // Through hole (centered, long enough to pass through thickness)
-     translate([x, t/2, h/2])
+   // Row located 10 mm from the outer Z edge (z = h - row)
+   for (x = [edge_x, w - edge_x]) {
+     // Through hole
+     translate([x, t/2, h - row])
        rotate([90, 0, 0])
          cylinder(h = t + 6, d = dh, center=true);
      // Counterbore from outside face at Y = +t, depth sd toward -Y
-     translate([x, t - sd, h/2])
+     translate([x, t - sd, h - row])
        rotate([90, 0, 0])
          cylinder(h = sd, d = ds, center=false);
    }
  }
SCAD (49 lines)
// L-bracket with counterbored M4 holes
// Dimensions
w = 50;      // width (X)
d = 40;      // depth of horizontal flange (Y)
h = 40;      // height of vertical flange (Z)
t = 3;       // thickness

// Holes
dh = 4.5;    // through hole diameter
ds = 8;      // counterbore diameter
sd = 2;      // counterbore depth
edge_x = 10; // X margin from side edges (left/right)
row = 10;    // distance from outer edge of each face (Y/Z) toward inside

$fn = 64;

difference() {
  // L-bracket body: inner corner at origin, horizontal +Y, vertical +Z
  union() {
    // Horizontal flange: X=w, Y=d, Z=t
    cube([w, d, t], center=false);
    // Vertical flange: X=w, Y=t, Z=h
    cube([w, t, h], center=false);
  }

  // Horizontal flange holes (axis along Z), counterbore from top (+Z)
  // Row located 10 mm from the outer Y edge (y = d - row)
  for (x = [edge_x, w - edge_x]) {
    // Through hole
    translate([x, d - row, -1])
      cylinder(h = t + 2, d = dh);
    // Counterbore from top face
    translate([x, d - row, t - sd])
      cylinder(h = sd, d = ds);
  }

  // Vertical flange holes (axis along Y), counterbore from outside face (+Y)
  // Row located 10 mm from the outer Z edge (z = h - row)
  for (x = [edge_x, w - edge_x]) {
    // Through hole
    translate([x, t/2, h - row])
      rotate([90, 0, 0])
        cylinder(h = t + 6, d = dh, center=true);
    // Counterbore from outside face at Y = +t, depth sd toward -Y
    translate([x, t - sd, h - row])
      rotate([90, 0, 0])
        cylinder(h = sd, d = ds, center=false);
  }
}