vibe-openscad

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

7 run / 累計 529.4s / 累計 $0.0878

openai gpt 5 mini 2025-08-07 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 90.9s · 294/7490t · $0.0151
SCAD (48 lines)
// openscad
$fn = 64;

// Parameters
w = 50;             // width (X)
len = 40;           // flange length (Y for horizontal, Z for vertical)
t = 3;              // thickness
hole_d = 4.5;       // through hole diameter for M4
cs_d = 8;           // countersink seat diameter
cs_depth = 2;       // countersink depth

// Hole X positions: 10mm from each lateral edge (symmetric)
hole_x = [10, w - 10];

// Centers along the face midline
h_y = len/2;    // horizontal flange holes: Y coordinate
v_z = len/2;    // vertical flange holes: Z coordinate

module bracket() {
    // Horizontal flange: X:0..w, Y:0..len, Z:0..t
    translate([0,0,0]) cube([w, len, t], center=false);
    // Vertical flange: X:0..w, Y:0..t, Z:0..len
    translate([0,0,0]) cube([w, t, len], center=false);
}

module subtract_holes() {
    // Horizontal flange holes (axis Z), countersink on outer side (+Z)
    for (x = hole_x) {
        // through hole (centered in thickness)
        translate([x, h_y, t/2]) cylinder(h=100, r=hole_d/2, center=true);
        // countersink pocket from outer face (+Z), depth cs_depth
        translate([x, h_y, t - cs_depth/2]) cylinder(h=cs_depth, r=cs_d/2, center=true);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = hole_x) {
        // through hole (axis along Y), center at Y = t/2
        translate([x, t/2, v_z]) rotate([90,0,0]) cylinder(h=100, r=hole_d/2, center=true);
        // countersink pocket from outer face (+Y), depth cs_depth (axis along Y)
        translate([x, t - cs_depth/2, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=true);
    }
}

// Final part: union of flanges minus holes/countersinks
difference() {
    bracket();
    subtract_holes();
}
パラメータ (6)
スライダを動かすと 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
43.7s · 294/2531t · $0.0051
SCAD (81 lines)
// L-bracket with countersunk holes
// Inner corner at origin. Horizontal flange: +Y, thickness along +Z.
// Vertical flange: +Z, thickness along +Y.

$fn = 64;

// Parameters
width = 50;      // X dimension for both flanges
depth = 40;      // Y for horizontal flange
height = 40;     // Z for vertical flange
thickness = 3;   // plate thickness

// Countersink / hole parameters (M4)
clearance_dia = 4.5;
countersink_dia = 8;
countersink_depth = 2;

// Hole positions: 10 mm from left/right edges (X = 10 and X = width-10)
// and 10 mm from outer edge of each flange inward:
// - horizontal flange outer edge at Y = depth -> holes at Y = depth - 10
// - vertical flange outer edge at Z = height -> holes at Z = height - 10
hole_x = [10, width - 10];
hole_y_horizontal = depth - 10;
hole_z_vertical = height - 10;

// Build bracket (union of two plates)
module l_bracket() {
    // horizontal plate: spans X:0..width, Y:0..depth, Z:0..thickness
    cube([width, depth, thickness], center=false);
    // vertical plate: spans X:0..width, Y:0..thickness, Z:0..height
    translate([0,0,0])
        cube([width, thickness, height], center=false);
}

// Countersunk through hole along Z (for horizontal flange)
// countersink faces outward (+Z)
module countersunk_hole_Z(dia_clear, dia_cs, cs_depth) {
    // through hole (make sure long enough to cut through both potential overlaps)
    difference() {
        // through hole
        translate([0,0,-10])
            cylinder(h=thickness+height+20, r=dia_clear/2, center=false);
        // countersink cone located at outer side (+Z)
        // create cone that starts at Z = thickness (outer surface) and goes down by cs_depth
        translate([0,0,thickness - cs_depth])
            cylinder(h=cs_depth, r1=dia_cs/2, r2=0, center=false);
    }
}

// Countersunk through hole along Y (for vertical flange)
// countersink faces outward (+Y)
module countersunk_hole_Y(dia_clear, dia_cs, cs_depth) {
    difference() {
        // through hole along Y
        translate([0,-10,0])
            rotate([0,90,0])
                cylinder(h=thickness+depth+20, r=dia_clear/2, center=false);
        // countersink cone located at outer side (+Y)
        // create cone that starts at Y = thickness (outer surface) and goes inward by cs_depth
        translate([0, thickness - cs_depth, 0])
            rotate([0,90,0])
                cylinder(h=cs_depth, r1=dia_cs/2, r2=0, center=false);
    }
}

// Assemble final part with holes subtracted
difference() {
    l_bracket();

    // Horizontal flange holes (along Z)
    for (x = hole_x) {
        translate([x, hole_y_horizontal, 0])
            countersunk_hole_Z(clearance_dia, countersink_dia, countersink_depth);
    }

    // Vertical flange holes (along Y)
    for (x = hole_x) {
        translate([x, 0, hole_z_vertical])
            countersunk_hole_Y(clearance_dia, countersink_dia, countersink_depth);
    }
}
medium (default) success
medium
90.9s · 294/7490t · $0.0151
SCAD (48 lines)
// openscad
$fn = 64;

// Parameters
w = 50;             // width (X)
len = 40;           // flange length (Y for horizontal, Z for vertical)
t = 3;              // thickness
hole_d = 4.5;       // through hole diameter for M4
cs_d = 8;           // countersink seat diameter
cs_depth = 2;       // countersink depth

// Hole X positions: 10mm from each lateral edge (symmetric)
hole_x = [10, w - 10];

// Centers along the face midline
h_y = len/2;    // horizontal flange holes: Y coordinate
v_z = len/2;    // vertical flange holes: Z coordinate

module bracket() {
    // Horizontal flange: X:0..w, Y:0..len, Z:0..t
    translate([0,0,0]) cube([w, len, t], center=false);
    // Vertical flange: X:0..w, Y:0..t, Z:0..len
    translate([0,0,0]) cube([w, t, len], center=false);
}

module subtract_holes() {
    // Horizontal flange holes (axis Z), countersink on outer side (+Z)
    for (x = hole_x) {
        // through hole (centered in thickness)
        translate([x, h_y, t/2]) cylinder(h=100, r=hole_d/2, center=true);
        // countersink pocket from outer face (+Z), depth cs_depth
        translate([x, h_y, t - cs_depth/2]) cylinder(h=cs_depth, r=cs_d/2, center=true);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = hole_x) {
        // through hole (axis along Y), center at Y = t/2
        translate([x, t/2, v_z]) rotate([90,0,0]) cylinder(h=100, r=hole_d/2, center=true);
        // countersink pocket from outer face (+Y), depth cs_depth (axis along Y)
        translate([x, t - cs_depth/2, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=true);
    }
}

// Final part: union of flanges minus holes/countersinks
difference() {
    bracket();
    subtract_holes();
}
high success
high
170.8s · 294/14862t · $0.0298
SCAD (58 lines)
// L-bracket with countersunk holes (inner corner at origin)
// Horizontal flange: +Y direction
// Vertical flange: +Z direction

$fn = 64;

width = 50;        // X dimension
depth = 40;        // horizontal flange depth (Y)
height = 40;       // vertical flange height (Z)
thickness = 3;     // plate thickness

hole_d = 4.5;      // through hole diameter for M4
cs_d = 8;          // countersink diameter
cs_depth = 2;      // countersink depth
edge_offset = 10;  // distance from face edges for holes

module bracket() {
    union() {
        // horizontal flange (X × Y × Z)
        translate([0, 0, 0]) cube([width, depth, thickness]);
        // vertical flange (X × Y(thickness) × Z)
        translate([0, 0, 0]) cube([width, thickness, height]);
    }
}

module horiz_countersunk_hole(x, y) {
    // countersink (flat-bottom) on outside (top) of horizontal flange
    translate([x, y, thickness - cs_depth])
        cylinder(h = cs_depth, r = cs_d/2);
    // through hole
    translate([x, y, -5])
        cylinder(h = thickness + 10, r = hole_d/2);
}

module vert_countersunk_hole(x, z) {
    // countersink (flat-bottom) on outside (outer Y face) of vertical flange
    translate([x, thickness - cs_depth/2, z])
        rotate([90, 0, 0])
            cylinder(h = cs_depth, r = cs_d/2, center = true);
    // through hole (axis along Y)
    translate([x, thickness/2, z])
        rotate([90, 0, 0])
            cylinder(h = 200, r = hole_d/2, center = true);
}

difference() {
    bracket();

    // horizontal flange holes (centerline along X)
    for (ypos = [edge_offset, depth - edge_offset]) {
        horiz_countersunk_hole(width/2, ypos);
    }

    // vertical flange holes (centerline along X)
    for (zpos = [edge_offset, height - edge_offset]) {
        vert_countersunk_hole(width/2, zpos);
    }
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
57.9s · 1498/4327t · $0.0090
diff vs bare: +11/-10
  // openscad
  $fn = 64;
  
  // Parameters
  w = 50;             // width (X)
  len = 40;           // flange length (Y for horizontal, Z for vertical)
  t = 3;              // thickness
  hole_d = 4.5;       // through hole diameter for M4
  cs_d = 8;           // countersink seat diameter
  cs_depth = 2;       // countersink depth
+ eps = 0.1;          // small margin for boolean robustness
  
  // Hole X positions: 10mm from each lateral edge (symmetric)
  hole_x = [10, w - 10];
  
  // Centers along the face midline
- h_y = len/2;    // horizontal flange holes: Y coordinate
- v_z = len/2;    // vertical flange holes: Z coordinate
+ h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
+ v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)
  
  module bracket() {
      // Horizontal flange: X:0..w, Y:0..len, Z:0..t
      translate([0,0,0]) cube([w, len, t], center=false);
      // Vertical flange: X:0..w, Y:0..t, Z:0..len
      translate([0,0,0]) cube([w, t, len], center=false);
  }
  
  module subtract_holes() {
      // Horizontal flange holes (axis Z), countersink on outer side (+Z)
      for (x = hole_x) {
-         // through hole (centered in thickness)
-         translate([x, h_y, t/2]) cylinder(h=100, r=hole_d/2, center=true);
-         // countersink pocket from outer face (+Z), depth cs_depth
-         translate([x, h_y, t - cs_depth/2]) cylinder(h=cs_depth, r=cs_d/2, center=true);
+         // through hole: a little oversize in length to ensure clean subtraction
+         translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
+         // countersink pocket from outer face (+Z), depth cs_depth, flush at Z = t
+         translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r=cs_d/2, center=false);
      }
  
      // Vertical flange holes (axis Y), countersink on outer side (+Y)
      for (x = hole_x) {
-         // through hole (axis along Y), center at Y = t/2
-         translate([x, t/2, v_z]) rotate([90,0,0]) cylinder(h=100, r=hole_d/2, center=true);
-         // countersink pocket from outer face (+Y), depth cs_depth (axis along Y)
-         translate([x, t - cs_depth/2, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=true);
+         // through hole along Y (rotate cylinder), oversize length for robust subtraction
+         translate([x, -eps, v_z]) rotate([90,0,0]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
+         // countersink pocket from outer face (+Y), depth cs_depth, flush at Y = t
+         translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=false);
      }
  }
  
  // Final part: union of flanges minus holes/countersinks
  difference() {
      bracket();
      subtract_holes();
  }
SCAD (49 lines)
// openscad
$fn = 64;

// Parameters
w = 50;             // width (X)
len = 40;           // flange length (Y for horizontal, Z for vertical)
t = 3;              // thickness
hole_d = 4.5;       // through hole diameter for M4
cs_d = 8;           // countersink seat diameter
cs_depth = 2;       // countersink depth
eps = 0.1;          // small margin for boolean robustness

// Hole X positions: 10mm from each lateral edge (symmetric)
hole_x = [10, w - 10];

// Centers along the face midline
h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)

module bracket() {
    // Horizontal flange: X:0..w, Y:0..len, Z:0..t
    translate([0,0,0]) cube([w, len, t], center=false);
    // Vertical flange: X:0..w, Y:0..t, Z:0..len
    translate([0,0,0]) cube([w, t, len], center=false);
}

module subtract_holes() {
    // Horizontal flange holes (axis Z), countersink on outer side (+Z)
    for (x = hole_x) {
        // through hole: a little oversize in length to ensure clean subtraction
        translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // countersink pocket from outer face (+Z), depth cs_depth, flush at Z = t
        translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r=cs_d/2, center=false);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = hole_x) {
        // through hole along Y (rotate cylinder), oversize length for robust subtraction
        translate([x, -eps, v_z]) rotate([90,0,0]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // countersink pocket from outer face (+Y), depth cs_depth, flush at Y = t
        translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=false);
    }
}

// Final part: union of flanges minus holes/countersinks
difference() {
    bracket();
    subtract_holes();
}
i2 success
iter 2
34.1s · 1541/3095t · $0.0066
diff vs i1: +8/-8
  // openscad
- $fn = 64;
+ $fn = 128;
  
  // Parameters
  w = 50;             // width (X)
  len = 40;           // flange length (Y for horizontal, Z for vertical)
  t = 3;              // thickness
  hole_d = 4.5;       // through hole diameter for M4
- cs_d = 8;           // countersink seat diameter
+ cs_d = 8;           // countersink seat diameter (top)
  cs_depth = 2;       // countersink depth
  eps = 0.1;          // small margin for boolean robustness
  
  // Hole X positions: 10mm from each lateral edge (symmetric)
  hole_x = [10, w - 10];
  
  // Centers along the face midline
  h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
  v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)
  
  module bracket() {
      // Horizontal flange: X:0..w, Y:0..len, Z:0..t
      translate([0,0,0]) cube([w, len, t], center=false);
      // Vertical flange: X:0..w, Y:0..t, Z:0..len
      translate([0,0,0]) cube([w, t, len], center=false);
  }
  
  module subtract_holes() {
      // Horizontal flange holes (axis Z), countersink on outer side (+Z)
      for (x = hole_x) {
-         // through hole: a little oversize in length to ensure clean subtraction
+         // through hole (along Z)
          translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
-         // countersink pocket from outer face (+Z), depth cs_depth, flush at Z = t
-         translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r=cs_d/2, center=false);
+         // conical countersink pocket from outer face (+Z): top radius cs_d/2 -> bottom radius hole_d/2
+         translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
      }
  
      // Vertical flange holes (axis Y), countersink on outer side (+Y)
      for (x = hole_x) {
-         // through hole along Y (rotate cylinder), oversize length for robust subtraction
+         // through hole along Y (rotate cylinder)
          translate([x, -eps, v_z]) rotate([90,0,0]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
-         // countersink pocket from outer face (+Y), depth cs_depth, flush at Y = t
-         translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r=cs_d/2, center=false);
+         // conical countersink pocket from outer face (+Y): top radius cs_d/2 -> bottom radius hole_d/2
+         translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
      }
  }
  
  // Final part: union of flanges minus holes/countersinks
  difference() {
      bracket();
      subtract_holes();
  }
SCAD (49 lines)
// openscad
$fn = 128;

// Parameters
w = 50;             // width (X)
len = 40;           // flange length (Y for horizontal, Z for vertical)
t = 3;              // thickness
hole_d = 4.5;       // through hole diameter for M4
cs_d = 8;           // countersink seat diameter (top)
cs_depth = 2;       // countersink depth
eps = 0.1;          // small margin for boolean robustness

// Hole X positions: 10mm from each lateral edge (symmetric)
hole_x = [10, w - 10];

// Centers along the face midline
h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)

module bracket() {
    // Horizontal flange: X:0..w, Y:0..len, Z:0..t
    translate([0,0,0]) cube([w, len, t], center=false);
    // Vertical flange: X:0..w, Y:0..t, Z:0..len
    translate([0,0,0]) cube([w, t, len], center=false);
}

module subtract_holes() {
    // Horizontal flange holes (axis Z), countersink on outer side (+Z)
    for (x = hole_x) {
        // through hole (along Z)
        translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // conical countersink pocket from outer face (+Z): top radius cs_d/2 -> bottom radius hole_d/2
        translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = hole_x) {
        // through hole along Y (rotate cylinder)
        translate([x, -eps, v_z]) rotate([90,0,0]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // conical countersink pocket from outer face (+Y): top radius cs_d/2 -> bottom radius hole_d/2
        translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
    }
}

// Final part: union of flanges minus holes/countersinks
difference() {
    bracket();
    subtract_holes();
}
i3 success
iter 3
41.0s · 1558/3372t · $0.0071
diff vs i2: +8/-6
  // openscad
  $fn = 128;
  
  // Parameters
  w = 50;             // width (X)
  len = 40;           // flange length (Y for horizontal, Z for vertical)
  t = 3;              // thickness
  hole_d = 4.5;       // through hole diameter for M4
- cs_d = 8;           // countersink seat diameter (top)
+ cs_d = 8;           // countersink seat diameter (outer)
  cs_depth = 2;       // countersink depth
  eps = 0.1;          // small margin for boolean robustness
  
  // Hole X positions: 10mm from each lateral edge (symmetric)
  hole_x = [10, w - 10];
  
  // Centers along the face midline
  h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
  v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)
  
  module bracket() {
      // Horizontal flange: X:0..w, Y:0..len, Z:0..t
      translate([0,0,0]) cube([w, len, t], center=false);
      // Vertical flange: X:0..w, Y:0..t, Z:0..len
      translate([0,0,0]) cube([w, t, len], center=false);
  }
  
  module subtract_holes() {
      // Horizontal flange holes (axis Z), countersink on outer side (+Z)
      for (x = hole_x) {
          // through hole (along Z)
          translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
-         // conical countersink pocket from outer face (+Z): top radius cs_d/2 -> bottom radius hole_d/2
-         translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
+         // conical countersink pocket from outer face (+Z): outer (top) radius cs_d/2 -> inner (bottom) radius hole_d/2
+         // place base at inner face (t - cs_depth) so it expands toward outer face at z=t
+         translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r1=hole_d/2, r2=cs_d/2, center=false);
      }
  
      // Vertical flange holes (axis Y), countersink on outer side (+Y)
      for (x = hole_x) {
          // through hole along Y (rotate cylinder)
-         translate([x, -eps, v_z]) rotate([90,0,0]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
-         // conical countersink pocket from outer face (+Y): top radius cs_d/2 -> bottom radius hole_d/2
-         translate([x, t - cs_depth, v_z]) rotate([90,0,0]) cylinder(h=cs_depth, r1=cs_d/2, r2=hole_d/2, center=false);
+         rotate([90,0,0]) translate([x, -eps, v_z]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
+         // conical countersink pocket from outer face (+Y): outer radius cs_d/2 -> inner radius hole_d/2
+         // place base at inner face (t - cs_depth) so it expands toward outer face at y=t
+         rotate([90,0,0]) translate([x, t - cs_depth, v_z]) cylinder(h=cs_depth, r1=hole_d/2, r2=cs_d/2, center=false);
      }
  }
  
  // Final part: union of flanges minus holes/countersinks
  difference() {
      bracket();
      subtract_holes();
  }
SCAD (51 lines)
// openscad
$fn = 128;

// Parameters
w = 50;             // width (X)
len = 40;           // flange length (Y for horizontal, Z for vertical)
t = 3;              // thickness
hole_d = 4.5;       // through hole diameter for M4
cs_d = 8;           // countersink seat diameter (outer)
cs_depth = 2;       // countersink depth
eps = 0.1;          // small margin for boolean robustness

// Hole X positions: 10mm from each lateral edge (symmetric)
hole_x = [10, w - 10];

// Centers along the face midline
h_y = len/2;    // horizontal flange holes: Y coordinate (centerline of horizontal face)
v_z = len/2;    // vertical flange holes: Z coordinate (centerline of vertical face)

module bracket() {
    // Horizontal flange: X:0..w, Y:0..len, Z:0..t
    translate([0,0,0]) cube([w, len, t], center=false);
    // Vertical flange: X:0..w, Y:0..t, Z:0..len
    translate([0,0,0]) cube([w, t, len], center=false);
}

module subtract_holes() {
    // Horizontal flange holes (axis Z), countersink on outer side (+Z)
    for (x = hole_x) {
        // through hole (along Z)
        translate([x, h_y, -eps]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // conical countersink pocket from outer face (+Z): outer (top) radius cs_d/2 -> inner (bottom) radius hole_d/2
        // place base at inner face (t - cs_depth) so it expands toward outer face at z=t
        translate([x, h_y, t - cs_depth]) cylinder(h=cs_depth, r1=hole_d/2, r2=cs_d/2, center=false);
    }

    // Vertical flange holes (axis Y), countersink on outer side (+Y)
    for (x = hole_x) {
        // through hole along Y (rotate cylinder)
        rotate([90,0,0]) translate([x, -eps, v_z]) cylinder(h=t + 2*eps, r=hole_d/2, center=false);
        // conical countersink pocket from outer face (+Y): outer radius cs_d/2 -> inner radius hole_d/2
        // place base at inner face (t - cs_depth) so it expands toward outer face at y=t
        rotate([90,0,0]) translate([x, t - cs_depth, v_z]) cylinder(h=cs_depth, r1=hole_d/2, r2=cs_d/2, center=false);
    }
}

// Final part: union of flanges minus holes/countersinks
difference() {
    bracket();
    subtract_holes();
}