vibe-openscad

tier-2-l-bracket / gpt-5.4-2026-03-05

7 run / 累計 144.7s / 累計 $0.1591

openai gpt 5.4 2026-03-05 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 7.4s · 294/467t · $0.0081
SCAD (57 lines)
$fn = 64;

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

// Hole specs
through_d = 4.5;
csink_d = 8;
csink_depth = 2;

// Hole positions
x1 = 10;
x2 = width - 10;
y_center = depth / 2;
z_center = height / 2;

module countersunk_hole_z_up(h=thickness) {
    union() {
        cylinder(h=h + 0.2, d=through_d);
        cylinder(h=csink_depth + 0.1, d=csink_d);
    }
}

module countersunk_hole_y_pos(h=thickness) {
    rotate([90, 0, 0])
        union() {
            cylinder(h=h + 0.2, d=through_d);
            cylinder(h=csink_depth + 0.1, d=csink_d);
        }
}

difference() {
    union() {
        // Horizontal flange: extends in +Y, top surface at z=0, thickness downward
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

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

    // Horizontal flange holes (countersink on outer/bottom side)
    translate([x1, y_center, -thickness - 0.05])
        countersunk_hole_z_up(thickness + 0.1);
    translate([x2, y_center, -thickness - 0.05])
        countersunk_hole_z_up(thickness + 0.1);

    // Vertical flange holes (countersink on outer/back side, -Y)
    translate([x1, -thickness - 0.05, z_center])
        countersunk_hole_y_pos(thickness + 0.1);
    translate([x2, -thickness - 0.05, z_center])
        countersunk_hole_y_pos(thickness + 0.1);
}
パラメータ (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
18.2s · 294/1009t · $0.0167
SCAD (53 lines)
$fn = 64;

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

through_d = 4.5;
csk_d = 8;
csk_depth = 2;

hole_offset_from_side = 10;

hole_x1 = -width/2 + hole_offset_from_side;
hole_x2 =  width/2 - hole_offset_from_side;
h_center_y = depth/2;
v_center_z = height/2;

difference() {
    union() {
        // Horizontal flange: inside face at z=0, extends +Y, thickness to -Z
        translate([-width/2, 0, -thickness])
            cube([width, depth, thickness]);

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

    // Horizontal flange holes (outer side = bottom, -Z)
    for (x = [hole_x1, hole_x2]) {
        // Through hole
        translate([x, h_center_y, -thickness - 0.1])
            cylinder(d = through_d, h = thickness + 0.2);

        // Countersunk seat
        translate([x, h_center_y, -thickness - 0.1])
            cylinder(d = csk_d, h = csk_depth + 0.1);
    }

    // Vertical flange holes (outer side = back, -Y)
    for (x = [hole_x1, hole_x2]) {
        // Through hole
        translate([x, -thickness - 0.1, v_center_z])
            rotate([-90, 0, 0])
                cylinder(d = through_d, h = thickness + 0.2);

        // Countersunk seat
        translate([x, -thickness - 0.1, v_center_z])
            rotate([-90, 0, 0])
                cylinder(d = csk_d, h = csk_depth + 0.1);
    }
}
medium (default) success
medium
7.4s · 294/467t · $0.0081
SCAD (57 lines)
$fn = 64;

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

// Hole specs
through_d = 4.5;
csink_d = 8;
csink_depth = 2;

// Hole positions
x1 = 10;
x2 = width - 10;
y_center = depth / 2;
z_center = height / 2;

module countersunk_hole_z_up(h=thickness) {
    union() {
        cylinder(h=h + 0.2, d=through_d);
        cylinder(h=csink_depth + 0.1, d=csink_d);
    }
}

module countersunk_hole_y_pos(h=thickness) {
    rotate([90, 0, 0])
        union() {
            cylinder(h=h + 0.2, d=through_d);
            cylinder(h=csink_depth + 0.1, d=csink_d);
        }
}

difference() {
    union() {
        // Horizontal flange: extends in +Y, top surface at z=0, thickness downward
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

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

    // Horizontal flange holes (countersink on outer/bottom side)
    translate([x1, y_center, -thickness - 0.05])
        countersunk_hole_z_up(thickness + 0.1);
    translate([x2, y_center, -thickness - 0.05])
        countersunk_hole_z_up(thickness + 0.1);

    // Vertical flange holes (countersink on outer/back side, -Y)
    translate([x1, -thickness - 0.05, z_center])
        countersunk_hole_y_pos(thickness + 0.1);
    translate([x2, -thickness - 0.05, z_center])
        countersunk_hole_y_pos(thickness + 0.1);
}
high success
high
88.5s · 294/5778t · $0.0930
SCAD (62 lines)
$fn = 64;

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

through_d = 4.5;
csk_d = 8;
csk_depth = 2;

edge_offset = 10;
eps = 0.1;

hole_x = width / 2 - edge_offset;

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

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

        // Corner material for a connected sharp bend
        translate([-width / 2, -thickness, -thickness])
            cube([width, thickness, thickness]);
    }
}

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

    // Countersink on outer side (bottom)
    translate([x, y, -thickness - eps])
        cylinder(h = csk_depth + eps, d1 = csk_d, d2 = through_d);
}

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

    // Countersink on outer side
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(h = csk_depth + eps, d1 = csk_d, d2 = through_d);
}

difference() {
    l_bracket();

    for (x = [-hole_x, hole_x]) {
        countersunk_hole_horizontal(x, depth / 2);
        countersunk_hole_vertical(x, height / 2);
    }
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
9.0s · 1426/535t · $0.0114
diff vs bare: +17/-13
  $fn = 64;
  
  // Dimensions
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  
  // Hole specs
  through_d = 4.5;
  csink_d = 8;
  csink_depth = 2;
  
  // Hole positions
  x1 = 10;
  x2 = width - 10;
  y_center = depth / 2;
  z_center = height / 2;
  
- module countersunk_hole_z_up(h=thickness) {
+ module countersunk_hole_z_down(h=thickness) {
      union() {
-         cylinder(h=h + 0.2, d=through_d);
          cylinder(h=csink_depth + 0.1, d=csink_d);
+         translate([0, 0, csink_depth])
+             cylinder(h=h - csink_depth + 0.2, d=through_d);
      }
  }
  
- module countersunk_hole_y_pos(h=thickness) {
-     rotate([90, 0, 0])
+ module countersunk_hole_y_neg(h=thickness) {
+     rotate([-90, 0, 0])
          union() {
-             cylinder(h=h + 0.2, d=through_d);
              cylinder(h=csink_depth + 0.1, d=csink_d);
+             translate([0, 0, csink_depth])
+                 cylinder(h=h - csink_depth + 0.2, d=through_d);
          }
  }
  
  difference() {
      union() {
-         // Horizontal flange: extends in +Y, top surface at z=0, thickness downward
+         // Horizontal flange: top face at z=0, extends +Y, thickness toward -Z
          translate([0, 0, -thickness])
              cube([width, depth, thickness]);
  
-         // Vertical flange: extends in +Z, thickness in -Y direction
+         // Vertical flange: inner face at y=0, extends +Z, thickness toward -Y
          translate([0, -thickness, 0])
              cube([width, thickness, height]);
      }
  
-     // Horizontal flange holes (countersink on outer/bottom side)
+     // Horizontal flange holes: on centerline, 10mm from left/right edges,
+     // countersink on outer face (bottom, -Z)
      translate([x1, y_center, -thickness - 0.05])
-         countersunk_hole_z_up(thickness + 0.1);
+         countersunk_hole_z_down(thickness + 0.1);
      translate([x2, y_center, -thickness - 0.05])
-         countersunk_hole_z_up(thickness + 0.1);
+         countersunk_hole_z_down(thickness + 0.1);
  
-     // Vertical flange holes (countersink on outer/back side, -Y)
+     // Vertical flange holes: on centerline, 10mm from left/right edges,
+     // countersink on outer face (back, -Y)
      translate([x1, -thickness - 0.05, z_center])
-         countersunk_hole_y_pos(thickness + 0.1);
+         countersunk_hole_y_neg(thickness + 0.1);
      translate([x2, -thickness - 0.05, z_center])
-         countersunk_hole_y_pos(thickness + 0.1);
+         countersunk_hole_y_neg(thickness + 0.1);
  }
SCAD (61 lines)
$fn = 64;

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

// Hole specs
through_d = 4.5;
csink_d = 8;
csink_depth = 2;

// Hole positions
x1 = 10;
x2 = width - 10;
y_center = depth / 2;
z_center = height / 2;

module countersunk_hole_z_down(h=thickness) {
    union() {
        cylinder(h=csink_depth + 0.1, d=csink_d);
        translate([0, 0, csink_depth])
            cylinder(h=h - csink_depth + 0.2, d=through_d);
    }
}

module countersunk_hole_y_neg(h=thickness) {
    rotate([-90, 0, 0])
        union() {
            cylinder(h=csink_depth + 0.1, d=csink_d);
            translate([0, 0, csink_depth])
                cylinder(h=h - csink_depth + 0.2, d=through_d);
        }
}

difference() {
    union() {
        // Horizontal flange: top face at z=0, extends +Y, thickness toward -Z
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

        // Vertical flange: inner face at y=0, extends +Z, thickness toward -Y
        translate([0, -thickness, 0])
            cube([width, thickness, height]);
    }

    // Horizontal flange holes: on centerline, 10mm from left/right edges,
    // countersink on outer face (bottom, -Z)
    translate([x1, y_center, -thickness - 0.05])
        countersunk_hole_z_down(thickness + 0.1);
    translate([x2, y_center, -thickness - 0.05])
        countersunk_hole_z_down(thickness + 0.1);

    // Vertical flange holes: on centerline, 10mm from left/right edges,
    // countersink on outer face (back, -Y)
    translate([x1, -thickness - 0.05, z_center])
        countersunk_hole_y_neg(thickness + 0.1);
    translate([x2, -thickness - 0.05, z_center])
        countersunk_hole_y_neg(thickness + 0.1);
}
i2 success
iter 2
7.3s · 1494/521t · $0.0113
diff vs i1: +21/-17
  $fn = 64;
  
  // Dimensions
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  
  // Hole specs
  through_d = 4.5;
  csink_d = 8;
  csink_depth = 2;
  
  // Hole positions
  x1 = 10;
  x2 = width - 10;
  y_center = depth / 2;
  z_center = height / 2;
  
- module countersunk_hole_z_down(h=thickness) {
+ module countersunk_hole_z_up(h=thickness) {
      union() {
-         cylinder(h=csink_depth + 0.1, d=csink_d);
+         cylinder(h=csink_depth, d=csink_d);
          translate([0, 0, csink_depth])
-             cylinder(h=h - csink_depth + 0.2, d=through_d);
+             cylinder(h=h - csink_depth, d=through_d);
      }
  }
  
- module countersunk_hole_y_neg(h=thickness) {
-     rotate([-90, 0, 0])
+ module countersunk_hole_y_pos(h=thickness) {
+     rotate([90, 0, 0])
          union() {
-             cylinder(h=csink_depth + 0.1, d=csink_d);
+             cylinder(h=csink_depth, d=csink_d);
              translate([0, 0, csink_depth])
-                 cylinder(h=h - csink_depth + 0.2, d=through_d);
+                 cylinder(h=h - csink_depth, d=through_d);
          }
  }
  
  difference() {
      union() {
-         // Horizontal flange: top face at z=0, extends +Y, thickness toward -Z
+         // Horizontal flange: inner top face at z=0, extends +Y, thickness toward -Z
          translate([0, 0, -thickness])
              cube([width, depth, thickness]);
  
-         // Vertical flange: inner face at y=0, extends +Z, thickness toward -Y
+         // Vertical flange: inner front face at y=0, extends +Z, thickness toward -Y
          translate([0, -thickness, 0])
              cube([width, thickness, height]);
      }
  
      // Horizontal flange holes: on centerline, 10mm from left/right edges,
      // countersink on outer face (bottom, -Z)
-     translate([x1, y_center, -thickness - 0.05])
-         countersunk_hole_z_down(thickness + 0.1);
-     translate([x2, y_center, -thickness - 0.05])
-         countersunk_hole_z_down(thickness + 0.1);
+     translate([x1, y_center, -thickness])
+         mirror([0, 0, 1])
+             countersunk_hole_z_up(thickness);
+     translate([x2, y_center, -thickness])
+         mirror([0, 0, 1])
+             countersunk_hole_z_up(thickness);
  
      // Vertical flange holes: on centerline, 10mm from left/right edges,
      // countersink on outer face (back, -Y)
-     translate([x1, -thickness - 0.05, z_center])
-         countersunk_hole_y_neg(thickness + 0.1);
-     translate([x2, -thickness - 0.05, z_center])
-         countersunk_hole_y_neg(thickness + 0.1);
+     translate([x1, -thickness, z_center])
+         mirror([0, 1, 0])
+             countersunk_hole_y_pos(thickness);
+     translate([x2, -thickness, z_center])
+         mirror([0, 1, 0])
+             countersunk_hole_y_pos(thickness);
  }
SCAD (65 lines)
$fn = 64;

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

// Hole specs
through_d = 4.5;
csink_d = 8;
csink_depth = 2;

// Hole positions
x1 = 10;
x2 = width - 10;
y_center = depth / 2;
z_center = height / 2;

module countersunk_hole_z_up(h=thickness) {
    union() {
        cylinder(h=csink_depth, d=csink_d);
        translate([0, 0, csink_depth])
            cylinder(h=h - csink_depth, d=through_d);
    }
}

module countersunk_hole_y_pos(h=thickness) {
    rotate([90, 0, 0])
        union() {
            cylinder(h=csink_depth, d=csink_d);
            translate([0, 0, csink_depth])
                cylinder(h=h - csink_depth, d=through_d);
        }
}

difference() {
    union() {
        // Horizontal flange: inner top face at z=0, extends +Y, thickness toward -Z
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

        // Vertical flange: inner front face at y=0, extends +Z, thickness toward -Y
        translate([0, -thickness, 0])
            cube([width, thickness, height]);
    }

    // Horizontal flange holes: on centerline, 10mm from left/right edges,
    // countersink on outer face (bottom, -Z)
    translate([x1, y_center, -thickness])
        mirror([0, 0, 1])
            countersunk_hole_z_up(thickness);
    translate([x2, y_center, -thickness])
        mirror([0, 0, 1])
            countersunk_hole_z_up(thickness);

    // Vertical flange holes: on centerline, 10mm from left/right edges,
    // countersink on outer face (back, -Y)
    translate([x1, -thickness, z_center])
        mirror([0, 1, 0])
            countersunk_hole_y_pos(thickness);
    translate([x2, -thickness, z_center])
        mirror([0, 1, 0])
            countersunk_hole_y_pos(thickness);
}
i3 success
iter 3
7.0s · 1480/467t · $0.0104
diff vs i2: +17/-21
  $fn = 64;
  
  // Dimensions
  width = 50;
  depth = 40;
  height = 40;
  thickness = 3;
  
  // Hole specs
  through_d = 4.5;
  csink_d = 8;
  csink_depth = 2;
  
  // Hole positions
  x1 = 10;
  x2 = width - 10;
  y_center = depth / 2;
  z_center = height / 2;
  
- module countersunk_hole_z_up(h=thickness) {
+ module countersunk_hole_z(h=thickness) {
      union() {
          cylinder(h=csink_depth, d=csink_d);
          translate([0, 0, csink_depth])
              cylinder(h=h - csink_depth, d=through_d);
      }
  }
  
- module countersunk_hole_y_pos(h=thickness) {
-     rotate([90, 0, 0])
+ module countersunk_hole_y(h=thickness) {
+     rotate([-90, 0, 0])
          union() {
              cylinder(h=csink_depth, d=csink_d);
              translate([0, 0, csink_depth])
                  cylinder(h=h - csink_depth, d=through_d);
          }
  }
  
  difference() {
      union() {
-         // Horizontal flange: inner top face at z=0, extends +Y, thickness toward -Z
+         // Horizontal flange: inner face at z=0, extends +Y, thickness toward -Z
          translate([0, 0, -thickness])
              cube([width, depth, thickness]);
  
-         // Vertical flange: inner front face at y=0, extends +Z, thickness toward -Y
+         // Vertical flange: inner face at y=0, extends +Z, thickness toward -Y
          translate([0, -thickness, 0])
              cube([width, thickness, height]);
      }
  
-     // Horizontal flange holes: on centerline, 10mm from left/right edges,
-     // countersink on outer face (bottom, -Z)
-     translate([x1, y_center, -thickness])
-         mirror([0, 0, 1])
-             countersunk_hole_z_up(thickness);
-     translate([x2, y_center, -thickness])
-         mirror([0, 0, 1])
-             countersunk_hole_z_up(thickness);
+     // Horizontal flange holes
+     // centerline of the face, 10mm from front/back edges along Y
+     // countersink on outer face (z = -thickness)
+     for (yy = [10, depth - 10])
+         translate([width / 2, yy, -thickness])
+             countersunk_hole_z(thickness);
  
-     // Vertical flange holes: on centerline, 10mm from left/right edges,
-     // countersink on outer face (back, -Y)
-     translate([x1, -thickness, z_center])
-         mirror([0, 1, 0])
-             countersunk_hole_y_pos(thickness);
-     translate([x2, -thickness, z_center])
-         mirror([0, 1, 0])
-             countersunk_hole_y_pos(thickness);
+     // Vertical flange holes
+     // centerline of the face, 10mm from bottom/top edges along Z
+     // countersink on outer face (y = -thickness)
+     for (zz = [10, height - 10])
+         translate([width / 2, -thickness, zz])
+             countersunk_hole_y(thickness);
  }
SCAD (61 lines)
$fn = 64;

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

// Hole specs
through_d = 4.5;
csink_d = 8;
csink_depth = 2;

// Hole positions
x1 = 10;
x2 = width - 10;
y_center = depth / 2;
z_center = height / 2;

module countersunk_hole_z(h=thickness) {
    union() {
        cylinder(h=csink_depth, d=csink_d);
        translate([0, 0, csink_depth])
            cylinder(h=h - csink_depth, d=through_d);
    }
}

module countersunk_hole_y(h=thickness) {
    rotate([-90, 0, 0])
        union() {
            cylinder(h=csink_depth, d=csink_d);
            translate([0, 0, csink_depth])
                cylinder(h=h - csink_depth, d=through_d);
        }
}

difference() {
    union() {
        // Horizontal flange: inner face at z=0, extends +Y, thickness toward -Z
        translate([0, 0, -thickness])
            cube([width, depth, thickness]);

        // Vertical flange: inner face at y=0, extends +Z, thickness toward -Y
        translate([0, -thickness, 0])
            cube([width, thickness, height]);
    }

    // Horizontal flange holes
    // centerline of the face, 10mm from front/back edges along Y
    // countersink on outer face (z = -thickness)
    for (yy = [10, depth - 10])
        translate([width / 2, yy, -thickness])
            countersunk_hole_z(thickness);

    // Vertical flange holes
    // centerline of the face, 10mm from bottom/top edges along Z
    // countersink on outer face (y = -thickness)
    for (zz = [10, height - 10])
        translate([width / 2, -thickness, zz])
            countersunk_hole_y(thickness);
}