vibe-openscad

tier-2-l-bracket / o3-2025-04-16

7 run / 累計 382.8s / 累計 $0.2178

openai o3 2025-04-16 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 53.9s · 294/3792t · $0.0309
SCAD (54 lines)
// L-bracket with countersunk holes
// Dimensions
WIDTH       = 50;   // X direction (common width of both flanges)
DEPTH       = 40;   // Y direction of horizontal flange
HEIGHT      = 40;   // Z direction of vertical flange
THK         = 3;    // Plate thickness

// Hole parameters
HOLE_D      = 4.5;  // Through-hole diameter (M4 clearance)
CSK_D       = 8;    // Countersink seat diameter
CSK_DEPTH   = 2;    // Countersink depth
EDGE_OFFSET = 10;   // Distance of hole-centres from side edges
$fn = 64;           // Circle resolution

difference() {
    // --- Plates -----------------------------------------------------------
    union() {
        // Horizontal flange (lies in XY plane, thickness +Z)
        cube([WIDTH, DEPTH, THK], center = false);

        // Vertical flange (stands in YZ plane, thickness –Y)
        translate([0, -THK, 0])
            cube([WIDTH, THK, HEIGHT], center = false);
    }

    // --- Countersunk holes ------------------------------------------------
    // Horizontal flange holes (axis = Z)
    for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
        y = DEPTH / 2;

        // Through hole
        translate([x, y, -1])
            cylinder(h = THK + 2, d = HOLE_D);

        // Countersink (from top surface downward)
        translate([x, y, THK - CSK_DEPTH])
            cylinder(h = CSK_DEPTH + 1, d = CSK_D);
    }

    // Vertical flange holes (axis = Y)
    for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
        z = HEIGHT / 2;

        // Through hole
        translate([x, -THK - 1, z])
            rotate([90, 0, 0])
                cylinder(h = THK + 2, d = HOLE_D);

        // Countersink (from outer side toward inside)
        translate([x, -THK, z])
            rotate([90, 0, 0])
                cylinder(h = CSK_DEPTH + 1, d = CSK_D);
    }
}
パラメータ (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
37.6s · 294/2205t · $0.0182
SCAD (46 lines)
// Parameters
plate_w   = 50;   // width (X)
plate_d   = 40;   // depth / height (Y or Z)
thickness = 3;    // plate thickness
hole_d    = 4.5;  // through hole
csk_d     = 8;    // countersink diameter
csk_h     = 2;    // countersink depth
edge_off  = 10;   // hole offset from free edge
hole_pos  = 15;   // half pitch in X

// Main model
difference() {
    union() {
        // Horizontal flange (lies in +Y, thickness -Z)
        translate([-plate_w/2, 0, -thickness])
            cube([plate_w, plate_d, thickness]);

        // Vertical flange (lies in +Z, thickness +Y)
        translate([-plate_w/2, 0, 0])
            cube([plate_w, thickness, plate_d]);
    }

    // Horizontal holes & countersinks (axis Z)
    for (x = [-hole_pos, hole_pos]) {
        translate([x, plate_d - edge_off, 0]) {
            // through hole
            cylinder(d = hole_d, h = thickness + 2, center = false);
            // countersink (outer side, bottom)
            translate([0, 0, -thickness])
                cylinder(d = csk_d, h = csk_h, center = false);
        }
    }

    // Vertical holes & countersinks (axis Y)
    for (x = [-hole_pos, hole_pos]) {
        translate([x, 0, plate_d - edge_off]) {
            // through hole
            rotate([0, 90, 0])
                cylinder(d = hole_d, h = thickness + 2, center = false);
            // countersink (outer side, +Y)
            translate([0, thickness, 0])
                rotate([0, 90, 0])
                    cylinder(d = csk_d, h = csk_h, center = false);
        }
    }
}
medium (default) success
medium
53.9s · 294/3792t · $0.0309
SCAD (54 lines)
// L-bracket with countersunk holes
// Dimensions
WIDTH       = 50;   // X direction (common width of both flanges)
DEPTH       = 40;   // Y direction of horizontal flange
HEIGHT      = 40;   // Z direction of vertical flange
THK         = 3;    // Plate thickness

// Hole parameters
HOLE_D      = 4.5;  // Through-hole diameter (M4 clearance)
CSK_D       = 8;    // Countersink seat diameter
CSK_DEPTH   = 2;    // Countersink depth
EDGE_OFFSET = 10;   // Distance of hole-centres from side edges
$fn = 64;           // Circle resolution

difference() {
    // --- Plates -----------------------------------------------------------
    union() {
        // Horizontal flange (lies in XY plane, thickness +Z)
        cube([WIDTH, DEPTH, THK], center = false);

        // Vertical flange (stands in YZ plane, thickness –Y)
        translate([0, -THK, 0])
            cube([WIDTH, THK, HEIGHT], center = false);
    }

    // --- Countersunk holes ------------------------------------------------
    // Horizontal flange holes (axis = Z)
    for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
        y = DEPTH / 2;

        // Through hole
        translate([x, y, -1])
            cylinder(h = THK + 2, d = HOLE_D);

        // Countersink (from top surface downward)
        translate([x, y, THK - CSK_DEPTH])
            cylinder(h = CSK_DEPTH + 1, d = CSK_D);
    }

    // Vertical flange holes (axis = Y)
    for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
        z = HEIGHT / 2;

        // Through hole
        translate([x, -THK - 1, z])
            rotate([90, 0, 0])
                cylinder(h = THK + 2, d = HOLE_D);

        // Countersink (from outer side toward inside)
        translate([x, -THK, z])
            rotate([90, 0, 0])
                cylinder(h = CSK_DEPTH + 1, d = CSK_D);
    }
}
high success
high
78.5s · 294/5298t · $0.0430
SCAD (44 lines)
// L-bracket with countersunk M4 holes
$fn = 64;

thickness = 3;
width     = 50;
length    = 40;          // depth of horizontal / height of vertical flange
hole_d    = 4.5;
sink_d    = 8;
sink_h    = 2;
xholes    = [10, width-10];

// Countersunk hole, axis along +Z, outer face at z = 0
module csunk(th = thickness) {
    // countersink
    cylinder(d = sink_d, h = sink_h, center = false);
    // through-hole (extra length to guarantee cut-through)
    translate([0, 0, sink_h])
        cylinder(d = hole_d, h = th + 1, center = false);
}

difference() {
    // -----------------------------------------------------------------
    // Solid bracket
    union() {
        // Horizontal flange (extends +Y, thickness in -Z)
        translate([0, 0, -thickness])
            cube([width, length, thickness], center = false);

        // Vertical flange (extends +Z, thickness in -Y)
        translate([0, -thickness, 0])
            cube([width, thickness, length], center = false);
    }

    // -----------------------------------------------------------------
    // Holes – horizontal flange (outer face at Z = -thickness)
    for (x = xholes)
        translate([x, length/2, -thickness])
            csunk();

    // Holes – vertical flange (outer face at Y = -thickness)
    for (x = xholes)
        translate([x, -thickness, length/2])
            rotate([90, 0, 0]) csunk();
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
69.6s · 1562/3365t · $0.0300
diff vs bare: +35/-29
- // L-bracket with countersunk holes
- // Dimensions
- WIDTH       = 50;   // X direction (common width of both flanges)
- DEPTH       = 40;   // Y direction of horizontal flange
- HEIGHT      = 40;   // Z direction of vertical flange
- THK         = 3;    // Plate thickness
+ // L-bracket with countersunk M4 holes
+ //------------------------------------------------
+ WIDTH       = 50;   // common width of both flanges (X)
+ DEPTH       = 40;   // depth of horizontal flange   (Y)
+ HEIGHT      = 40;   // height of  vertical flange   (Z)
+ THK         = 3;    // plate thickness
  
  // Hole parameters
- HOLE_D      = 4.5;  // Through-hole diameter (M4 clearance)
- CSK_D       = 8;    // Countersink seat diameter
- CSK_DEPTH   = 2;    // Countersink depth
- EDGE_OFFSET = 10;   // Distance of hole-centres from side edges
- $fn = 64;           // Circle resolution
+ HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
+ CSK_D       = 8;    // countersink seat diameter
+ CSK_DEPTH   = 2;    // countersink depth
+ EDGE_OFF    = 10;   // distance of hole centres from left/right edges
+ $fn         = 64;   // circle quality
  
+ // Small extra length for subtraction robustness
+ EPS = 0.2;
+ 
+ //------------------------------------------------
  difference() {
-     // --- Plates -----------------------------------------------------------
+ 
+     // ----- plates ---------------------------------------------------------
      union() {
-         // Horizontal flange (lies in XY plane, thickness +Z)
+         // horizontal flange (XY plane, thickness +Z)
          cube([WIDTH, DEPTH, THK], center = false);
  
-         // Vertical flange (stands in YZ plane, thickness –Y)
+         // vertical flange (XZ plane, thickness –Y)
          translate([0, -THK, 0])
              cube([WIDTH, THK, HEIGHT], center = false);
      }
  
-     // --- Countersunk holes ------------------------------------------------
-     // Horizontal flange holes (axis = Z)
-     for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
+     // ----- holes ----------------------------------------------------------
+ 
+     // horizontal flange holes (axis = Z)
+     for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          y = DEPTH / 2;
  
-         // Through hole
-         translate([x, y, -1])
-             cylinder(h = THK + 2, d = HOLE_D);
+         // through-hole
+         translate([x, y, -EPS])
+             cylinder(h = THK + 2*EPS, d = HOLE_D);
  
-         // Countersink (from top surface downward)
+         // countersink (from top surface downward)
          translate([x, y, THK - CSK_DEPTH])
-             cylinder(h = CSK_DEPTH + 1, d = CSK_D);
+             cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  
-     // Vertical flange holes (axis = Y)
-     for (x = [EDGE_OFFSET, WIDTH - EDGE_OFFSET]) {
+     // vertical flange holes (axis = Y)
+     for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          z = HEIGHT / 2;
  
-         // Through hole
-         translate([x, -THK - 1, z])
+         // through-hole
+         translate([x, -THK - EPS, z])
              rotate([90, 0, 0])
-                 cylinder(h = THK + 2, d = HOLE_D);
+                 cylinder(h = THK + 2*EPS, d = HOLE_D);
  
-         // Countersink (from outer side toward inside)
+         // countersink (from outer face inward)
          translate([x, -THK, z])
              rotate([90, 0, 0])
-                 cylinder(h = CSK_DEPTH + 1, d = CSK_D);
+                 cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  }
SCAD (60 lines)
// L-bracket with countersunk M4 holes
//------------------------------------------------
WIDTH       = 50;   // common width of both flanges (X)
DEPTH       = 40;   // depth of horizontal flange   (Y)
HEIGHT      = 40;   // height of  vertical flange   (Z)
THK         = 3;    // plate thickness

// Hole parameters
HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
CSK_D       = 8;    // countersink seat diameter
CSK_DEPTH   = 2;    // countersink depth
EDGE_OFF    = 10;   // distance of hole centres from left/right edges
$fn         = 64;   // circle quality

// Small extra length for subtraction robustness
EPS = 0.2;

//------------------------------------------------
difference() {

    // ----- plates ---------------------------------------------------------
    union() {
        // horizontal flange (XY plane, thickness +Z)
        cube([WIDTH, DEPTH, THK], center = false);

        // vertical flange (XZ plane, thickness –Y)
        translate([0, -THK, 0])
            cube([WIDTH, THK, HEIGHT], center = false);
    }

    // ----- holes ----------------------------------------------------------

    // horizontal flange holes (axis = Z)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        y = DEPTH / 2;

        // through-hole
        translate([x, y, -EPS])
            cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from top surface downward)
        translate([x, y, THK - CSK_DEPTH])
            cylinder(h = CSK_DEPTH, d = CSK_D);
    }

    // vertical flange holes (axis = Y)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        z = HEIGHT / 2;

        // through-hole
        translate([x, -THK - EPS, z])
            rotate([90, 0, 0])
                cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from outer face inward)
        translate([x, -THK, z])
            rotate([90, 0, 0])
                cylinder(h = CSK_DEPTH, d = CSK_D);
    }
}
i2 success
iter 2
40.9s · 1570/2869t · $0.0261
diff vs i1: +0/-0
  // L-bracket with countersunk M4 holes
  //------------------------------------------------
  WIDTH       = 50;   // common width of both flanges (X)
  DEPTH       = 40;   // depth of horizontal flange   (Y)
  HEIGHT      = 40;   // height of  vertical flange   (Z)
  THK         = 3;    // plate thickness
  
  // Hole parameters
  HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
  CSK_D       = 8;    // countersink seat diameter
  CSK_DEPTH   = 2;    // countersink depth
  EDGE_OFF    = 10;   // distance of hole centres from left/right edges
  $fn         = 64;   // circle quality
  
  // Small extra length for subtraction robustness
  EPS = 0.2;
  
  //------------------------------------------------
  difference() {
  
      // ----- plates ---------------------------------------------------------
      union() {
          // horizontal flange (XY plane, thickness +Z)
          cube([WIDTH, DEPTH, THK], center = false);
  
          // vertical flange (XZ plane, thickness –Y)
          translate([0, -THK, 0])
              cube([WIDTH, THK, HEIGHT], center = false);
      }
  
      // ----- holes ----------------------------------------------------------
  
      // horizontal flange holes (axis = Z)
      for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          y = DEPTH / 2;
  
          // through-hole
          translate([x, y, -EPS])
              cylinder(h = THK + 2*EPS, d = HOLE_D);
  
          // countersink (from top surface downward)
          translate([x, y, THK - CSK_DEPTH])
              cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  
      // vertical flange holes (axis = Y)
      for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          z = HEIGHT / 2;
  
          // through-hole
          translate([x, -THK - EPS, z])
              rotate([90, 0, 0])
                  cylinder(h = THK + 2*EPS, d = HOLE_D);
  
          // countersink (from outer face inward)
          translate([x, -THK, z])
              rotate([90, 0, 0])
                  cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  }
SCAD (60 lines)
// L-bracket with countersunk M4 holes
//------------------------------------------------
WIDTH       = 50;   // common width of both flanges (X)
DEPTH       = 40;   // depth of horizontal flange   (Y)
HEIGHT      = 40;   // height of  vertical flange   (Z)
THK         = 3;    // plate thickness

// Hole parameters
HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
CSK_D       = 8;    // countersink seat diameter
CSK_DEPTH   = 2;    // countersink depth
EDGE_OFF    = 10;   // distance of hole centres from left/right edges
$fn         = 64;   // circle quality

// Small extra length for subtraction robustness
EPS = 0.2;

//------------------------------------------------
difference() {

    // ----- plates ---------------------------------------------------------
    union() {
        // horizontal flange (XY plane, thickness +Z)
        cube([WIDTH, DEPTH, THK], center = false);

        // vertical flange (XZ plane, thickness –Y)
        translate([0, -THK, 0])
            cube([WIDTH, THK, HEIGHT], center = false);
    }

    // ----- holes ----------------------------------------------------------

    // horizontal flange holes (axis = Z)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        y = DEPTH / 2;

        // through-hole
        translate([x, y, -EPS])
            cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from top surface downward)
        translate([x, y, THK - CSK_DEPTH])
            cylinder(h = CSK_DEPTH, d = CSK_D);
    }

    // vertical flange holes (axis = Y)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        z = HEIGHT / 2;

        // through-hole
        translate([x, -THK - EPS, z])
            rotate([90, 0, 0])
                cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from outer face inward)
        translate([x, -THK, z])
            rotate([90, 0, 0])
                cylinder(h = CSK_DEPTH, d = CSK_D);
    }
}
i3 success
iter 3
48.3s · 1570/4437t · $0.0386
diff vs i2: +0/-0
  // L-bracket with countersunk M4 holes
  //------------------------------------------------
  WIDTH       = 50;   // common width of both flanges (X)
  DEPTH       = 40;   // depth of horizontal flange   (Y)
  HEIGHT      = 40;   // height of  vertical flange   (Z)
  THK         = 3;    // plate thickness
  
  // Hole parameters
  HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
  CSK_D       = 8;    // countersink seat diameter
  CSK_DEPTH   = 2;    // countersink depth
  EDGE_OFF    = 10;   // distance of hole centres from left/right edges
  $fn         = 64;   // circle quality
  
  // Small extra length for subtraction robustness
  EPS = 0.2;
  
  //------------------------------------------------
  difference() {
  
      // ----- plates ---------------------------------------------------------
      union() {
          // horizontal flange (XY plane, thickness +Z)
          cube([WIDTH, DEPTH, THK], center = false);
  
          // vertical flange (XZ plane, thickness –Y)
          translate([0, -THK, 0])
              cube([WIDTH, THK, HEIGHT], center = false);
      }
  
      // ----- holes ----------------------------------------------------------
  
      // horizontal flange holes (axis = Z)
      for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          y = DEPTH / 2;
  
          // through-hole
          translate([x, y, -EPS])
              cylinder(h = THK + 2*EPS, d = HOLE_D);
  
          // countersink (from top surface downward)
          translate([x, y, THK - CSK_DEPTH])
              cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  
      // vertical flange holes (axis = Y)
      for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
          z = HEIGHT / 2;
  
          // through-hole
          translate([x, -THK - EPS, z])
              rotate([90, 0, 0])
                  cylinder(h = THK + 2*EPS, d = HOLE_D);
  
          // countersink (from outer face inward)
          translate([x, -THK, z])
              rotate([90, 0, 0])
                  cylinder(h = CSK_DEPTH, d = CSK_D);
      }
  }
SCAD (60 lines)
// L-bracket with countersunk M4 holes
//------------------------------------------------
WIDTH       = 50;   // common width of both flanges (X)
DEPTH       = 40;   // depth of horizontal flange   (Y)
HEIGHT      = 40;   // height of  vertical flange   (Z)
THK         = 3;    // plate thickness

// Hole parameters
HOLE_D      = 4.5;  // through-hole diameter (M4 clearance)
CSK_D       = 8;    // countersink seat diameter
CSK_DEPTH   = 2;    // countersink depth
EDGE_OFF    = 10;   // distance of hole centres from left/right edges
$fn         = 64;   // circle quality

// Small extra length for subtraction robustness
EPS = 0.2;

//------------------------------------------------
difference() {

    // ----- plates ---------------------------------------------------------
    union() {
        // horizontal flange (XY plane, thickness +Z)
        cube([WIDTH, DEPTH, THK], center = false);

        // vertical flange (XZ plane, thickness –Y)
        translate([0, -THK, 0])
            cube([WIDTH, THK, HEIGHT], center = false);
    }

    // ----- holes ----------------------------------------------------------

    // horizontal flange holes (axis = Z)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        y = DEPTH / 2;

        // through-hole
        translate([x, y, -EPS])
            cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from top surface downward)
        translate([x, y, THK - CSK_DEPTH])
            cylinder(h = CSK_DEPTH, d = CSK_D);
    }

    // vertical flange holes (axis = Y)
    for (x = [EDGE_OFF, WIDTH - EDGE_OFF]) {
        z = HEIGHT / 2;

        // through-hole
        translate([x, -THK - EPS, z])
            rotate([90, 0, 0])
                cylinder(h = THK + 2*EPS, d = HOLE_D);

        // countersink (from outer face inward)
        translate([x, -THK, z])
            rotate([90, 0, 0])
                cylinder(h = CSK_DEPTH, d = CSK_D);
    }
}