vibe-openscad

tier-2-l-bracket / claude-haiku-4-5-20251001

5 run / 累計 30.6s / 累計 $0.0286

claude haiku 4.5 2025-10-01 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 5.4s · 361/776t · $0.0042
SCAD (86 lines)
// L-bracket with countersunk holes

// Parameters
horizontal_width = 50;  // mm
horizontal_depth = 40;  // mm
vertical_width = 50;    // mm
vertical_height = 40;   // mm
thickness = 3;          // mm

// Hole parameters
hole_diameter = 4.5;    // mm
countersink_diameter = 8;  // mm
countersink_depth = 2;  // mm
hole_offset_from_edge = 10;  // mm from edge
holes_spacing = 20;     // mm between holes

// Main L-bracket shape
module l_bracket() {
    // Horizontal flange (XY plane, at Z=0)
    cube([horizontal_width, horizontal_depth, thickness]);
    
    // Vertical flange (XZ plane, at Y=0)
    cube([vertical_width, thickness, vertical_height]);
}

// Countersunk hole
module countersunk_hole(depth = 50) {
    // Through hole
    cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink
    cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
}

// Holes for horizontal flange (top side, Z direction)
module horizontal_flange_holes() {
    // Holes positioned on the centerline (Y = horizontal_depth/2)
    // Two holes symmetrically placed
    hole_y = horizontal_depth / 2;
    
    // Left hole
    hole_x_left = hole_offset_from_edge;
    translate([hole_x_left, hole_y, thickness]) {
        rotate([180, 0, 0]) {
            countersunk_hole();
        }
    }
    
    // Right hole
    hole_x_right = horizontal_width - hole_offset_from_edge;
    translate([hole_x_right, hole_y, thickness]) {
        rotate([180, 0, 0]) {
            countersunk_hole();
        }
    }
}

// Holes for vertical flange (front side, Y direction)
module vertical_flange_holes() {
    // Holes positioned on the centerline (X = vertical_width/2)
    // Two holes symmetrically placed
    hole_x = vertical_width / 2;
    
    // Bottom hole
    hole_z_bottom = hole_offset_from_edge;
    translate([hole_x, 0, hole_z_bottom]) {
        rotate([-90, 0, 0]) {
            countersunk_hole();
        }
    }
    
    // Top hole
    hole_z_top = vertical_height - hole_offset_from_edge;
    translate([hole_x, 0, hole_z_top]) {
        rotate([-90, 0, 0]) {
            countersunk_hole();
        }
    }
}

// Main assembly
difference() {
    l_bracket();
    horizontal_flange_holes();
    vertical_flange_holes();
}
パラメータ (10)
スライダを動かすと 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: thinking

off (default) success
off
5.4s · 361/776t · $0.0042
SCAD (86 lines)
// L-bracket with countersunk holes

// Parameters
horizontal_width = 50;  // mm
horizontal_depth = 40;  // mm
vertical_width = 50;    // mm
vertical_height = 40;   // mm
thickness = 3;          // mm

// Hole parameters
hole_diameter = 4.5;    // mm
countersink_diameter = 8;  // mm
countersink_depth = 2;  // mm
hole_offset_from_edge = 10;  // mm from edge
holes_spacing = 20;     // mm between holes

// Main L-bracket shape
module l_bracket() {
    // Horizontal flange (XY plane, at Z=0)
    cube([horizontal_width, horizontal_depth, thickness]);
    
    // Vertical flange (XZ plane, at Y=0)
    cube([vertical_width, thickness, vertical_height]);
}

// Countersunk hole
module countersunk_hole(depth = 50) {
    // Through hole
    cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink
    cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
}

// Holes for horizontal flange (top side, Z direction)
module horizontal_flange_holes() {
    // Holes positioned on the centerline (Y = horizontal_depth/2)
    // Two holes symmetrically placed
    hole_y = horizontal_depth / 2;
    
    // Left hole
    hole_x_left = hole_offset_from_edge;
    translate([hole_x_left, hole_y, thickness]) {
        rotate([180, 0, 0]) {
            countersunk_hole();
        }
    }
    
    // Right hole
    hole_x_right = horizontal_width - hole_offset_from_edge;
    translate([hole_x_right, hole_y, thickness]) {
        rotate([180, 0, 0]) {
            countersunk_hole();
        }
    }
}

// Holes for vertical flange (front side, Y direction)
module vertical_flange_holes() {
    // Holes positioned on the centerline (X = vertical_width/2)
    // Two holes symmetrically placed
    hole_x = vertical_width / 2;
    
    // Bottom hole
    hole_z_bottom = hole_offset_from_edge;
    translate([hole_x, 0, hole_z_bottom]) {
        rotate([-90, 0, 0]) {
            countersunk_hole();
        }
    }
    
    // Top hole
    hole_z_top = vertical_height - hole_offset_from_edge;
    translate([hole_x, 0, hole_z_top]) {
        rotate([-90, 0, 0]) {
            countersunk_hole();
        }
    }
}

// Main assembly
difference() {
    l_bracket();
    horizontal_flange_holes();
    vertical_flange_holes();
}
adaptivenot run
dynamicnot run

iteration: iter-png

i1 success
iter 1
6.7s · 1893/958t · $0.0067
diff vs bare: +23/-31
  // L-bracket with countersunk holes
  
  // Parameters
  horizontal_width = 50;  // mm
  horizontal_depth = 40;  // mm
  vertical_width = 50;    // mm
  vertical_height = 40;   // mm
  thickness = 3;          // mm
  
  // Hole parameters
  hole_diameter = 4.5;    // mm
  countersink_diameter = 8;  // mm
  countersink_depth = 2;  // mm
  hole_offset_from_edge = 10;  // mm from edge
- holes_spacing = 20;     // mm between holes
  
- // Main L-bracket shape
- module l_bracket() {
-     // Horizontal flange (XY plane, at Z=0)
-     cube([horizontal_width, horizontal_depth, thickness]);
-     
-     // Vertical flange (XZ plane, at Y=0)
-     cube([vertical_width, thickness, vertical_height]);
- }
- 
  // Countersunk hole
  module countersunk_hole(depth = 50) {
      // Through hole
      cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
      
      // Countersink
      cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
  }
  
- // Holes for horizontal flange (top side, Z direction)
+ // Main L-bracket shape
+ // Inner corner at origin, horizontal flange extends in +Y, vertical flange extends in +Z
+ module l_bracket() {
+     // Horizontal flange (XY plane, at Z=0 to Z=thickness)
+     // Extends from X=0 to X=width, Y=0 to Y=depth, Z=0 to Z=thickness
+     cube([horizontal_width, horizontal_depth, thickness]);
+     
+     // Vertical flange (XZ plane, at Y=0 to Y=thickness)
+     // Extends from X=0 to X=width, Y=0 to Y=thickness, Z=0 to Z=height
+     cube([vertical_width, thickness, vertical_height]);
+ }
+ 
+ // Holes for horizontal flange (top side, Z direction, countersink facing up)
  module horizontal_flange_holes() {
-     // Holes positioned on the centerline (Y = horizontal_depth/2)
-     // Two holes symmetrically placed
      hole_y = horizontal_depth / 2;
      
      // Left hole
      hole_x_left = hole_offset_from_edge;
-     translate([hole_x_left, hole_y, thickness]) {
-         rotate([180, 0, 0]) {
-             countersunk_hole();
-         }
+     translate([hole_x_left, hole_y, -0.1]) {
+         countersunk_hole(thickness + 0.2);
      }
      
      // Right hole
      hole_x_right = horizontal_width - hole_offset_from_edge;
-     translate([hole_x_right, hole_y, thickness]) {
-         rotate([180, 0, 0]) {
-             countersunk_hole();
-         }
+     translate([hole_x_right, hole_y, -0.1]) {
+         countersunk_hole(thickness + 0.2);
      }
  }
  
- // Holes for vertical flange (front side, Y direction)
+ // Holes for vertical flange (front side, Y direction, countersink facing forward -Y)
  module vertical_flange_holes() {
-     // Holes positioned on the centerline (X = vertical_width/2)
-     // Two holes symmetrically placed
      hole_x = vertical_width / 2;
      
      // Bottom hole
      hole_z_bottom = hole_offset_from_edge;
-     translate([hole_x, 0, hole_z_bottom]) {
-         rotate([-90, 0, 0]) {
-             countersunk_hole();
+     translate([hole_x, -0.1, hole_z_bottom]) {
+         rotate([0, 0, 0]) {
+             countersunk_hole(thickness + 0.2);
          }
      }
      
      // Top hole
      hole_z_top = vertical_height - hole_offset_from_edge;
-     translate([hole_x, 0, hole_z_top]) {
-         rotate([-90, 0, 0]) {
-             countersunk_hole();
-         }
+     translate([hole_x, -0.1, hole_z_top]) {
+         countersunk_hole(thickness + 0.2);
      }
  }
  
  // Main assembly
  difference() {
      l_bracket();
      horizontal_flange_holes();
      vertical_flange_holes();
  }
SCAD (78 lines)
// L-bracket with countersunk holes

// Parameters
horizontal_width = 50;  // mm
horizontal_depth = 40;  // mm
vertical_width = 50;    // mm
vertical_height = 40;   // mm
thickness = 3;          // mm

// Hole parameters
hole_diameter = 4.5;    // mm
countersink_diameter = 8;  // mm
countersink_depth = 2;  // mm
hole_offset_from_edge = 10;  // mm from edge

// Countersunk hole
module countersunk_hole(depth = 50) {
    // Through hole
    cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink
    cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
}

// Main L-bracket shape
// Inner corner at origin, horizontal flange extends in +Y, vertical flange extends in +Z
module l_bracket() {
    // Horizontal flange (XY plane, at Z=0 to Z=thickness)
    // Extends from X=0 to X=width, Y=0 to Y=depth, Z=0 to Z=thickness
    cube([horizontal_width, horizontal_depth, thickness]);
    
    // Vertical flange (XZ plane, at Y=0 to Y=thickness)
    // Extends from X=0 to X=width, Y=0 to Y=thickness, Z=0 to Z=height
    cube([vertical_width, thickness, vertical_height]);
}

// Holes for horizontal flange (top side, Z direction, countersink facing up)
module horizontal_flange_holes() {
    hole_y = horizontal_depth / 2;
    
    // Left hole
    hole_x_left = hole_offset_from_edge;
    translate([hole_x_left, hole_y, -0.1]) {
        countersunk_hole(thickness + 0.2);
    }
    
    // Right hole
    hole_x_right = horizontal_width - hole_offset_from_edge;
    translate([hole_x_right, hole_y, -0.1]) {
        countersunk_hole(thickness + 0.2);
    }
}

// Holes for vertical flange (front side, Y direction, countersink facing forward -Y)
module vertical_flange_holes() {
    hole_x = vertical_width / 2;
    
    // Bottom hole
    hole_z_bottom = hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_bottom]) {
        rotate([0, 0, 0]) {
            countersunk_hole(thickness + 0.2);
        }
    }
    
    // Top hole
    hole_z_top = vertical_height - hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_top]) {
        countersunk_hole(thickness + 0.2);
    }
}

// Main assembly
difference() {
    l_bracket();
    horizontal_flange_holes();
    vertical_flange_holes();
}
i2 success
iter 2
6.4s · 1922/920t · $0.0065
diff vs i1: +2/-7
  // L-bracket with countersunk holes
  
  // Parameters
  horizontal_width = 50;  // mm
  horizontal_depth = 40;  // mm
  vertical_width = 50;    // mm
  vertical_height = 40;   // mm
  thickness = 3;          // mm
  
  // Hole parameters
  hole_diameter = 4.5;    // mm
  countersink_diameter = 8;  // mm
  countersink_depth = 2;  // mm
  hole_offset_from_edge = 10;  // mm from edge
  
  // Countersunk hole
  module countersunk_hole(depth = 50) {
      // Through hole
      cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
      
      // Countersink
      cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
  }
  
  // Main L-bracket shape
- // Inner corner at origin, horizontal flange extends in +Y, vertical flange extends in +Z
  module l_bracket() {
      // Horizontal flange (XY plane, at Z=0 to Z=thickness)
-     // Extends from X=0 to X=width, Y=0 to Y=depth, Z=0 to Z=thickness
      cube([horizontal_width, horizontal_depth, thickness]);
      
      // Vertical flange (XZ plane, at Y=0 to Y=thickness)
-     // Extends from X=0 to X=width, Y=0 to Y=thickness, Z=0 to Z=height
      cube([vertical_width, thickness, vertical_height]);
  }
  
  // Holes for horizontal flange (top side, Z direction, countersink facing up)
  module horizontal_flange_holes() {
      hole_y = horizontal_depth / 2;
      
      // Left hole
      hole_x_left = hole_offset_from_edge;
      translate([hole_x_left, hole_y, -0.1]) {
          countersunk_hole(thickness + 0.2);
      }
      
      // Right hole
      hole_x_right = horizontal_width - hole_offset_from_edge;
      translate([hole_x_right, hole_y, -0.1]) {
          countersunk_hole(thickness + 0.2);
      }
  }
  
- // Holes for vertical flange (front side, Y direction, countersink facing forward -Y)
+ // Holes for vertical flange (front side, Y direction, countersink facing outward -Y)
  module vertical_flange_holes() {
      hole_x = vertical_width / 2;
      
      // Bottom hole
      hole_z_bottom = hole_offset_from_edge;
      translate([hole_x, -0.1, hole_z_bottom]) {
-         rotate([0, 0, 0]) {
-             countersunk_hole(thickness + 0.2);
-         }
+         countersunk_hole(thickness + 0.2);
      }
      
      // Top hole
      hole_z_top = vertical_height - hole_offset_from_edge;
      translate([hole_x, -0.1, hole_z_top]) {
          countersunk_hole(thickness + 0.2);
      }
  }
  
  // Main assembly
  difference() {
      l_bracket();
      horizontal_flange_holes();
      vertical_flange_holes();
  }
SCAD (73 lines)
// L-bracket with countersunk holes

// Parameters
horizontal_width = 50;  // mm
horizontal_depth = 40;  // mm
vertical_width = 50;    // mm
vertical_height = 40;   // mm
thickness = 3;          // mm

// Hole parameters
hole_diameter = 4.5;    // mm
countersink_diameter = 8;  // mm
countersink_depth = 2;  // mm
hole_offset_from_edge = 10;  // mm from edge

// Countersunk hole
module countersunk_hole(depth = 50) {
    // Through hole
    cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink
    cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
}

// Main L-bracket shape
module l_bracket() {
    // Horizontal flange (XY plane, at Z=0 to Z=thickness)
    cube([horizontal_width, horizontal_depth, thickness]);
    
    // Vertical flange (XZ plane, at Y=0 to Y=thickness)
    cube([vertical_width, thickness, vertical_height]);
}

// Holes for horizontal flange (top side, Z direction, countersink facing up)
module horizontal_flange_holes() {
    hole_y = horizontal_depth / 2;
    
    // Left hole
    hole_x_left = hole_offset_from_edge;
    translate([hole_x_left, hole_y, -0.1]) {
        countersunk_hole(thickness + 0.2);
    }
    
    // Right hole
    hole_x_right = horizontal_width - hole_offset_from_edge;
    translate([hole_x_right, hole_y, -0.1]) {
        countersunk_hole(thickness + 0.2);
    }
}

// Holes for vertical flange (front side, Y direction, countersink facing outward -Y)
module vertical_flange_holes() {
    hole_x = vertical_width / 2;
    
    // Bottom hole
    hole_z_bottom = hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_bottom]) {
        countersunk_hole(thickness + 0.2);
    }
    
    // Top hole
    hole_z_top = vertical_height - hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_top]) {
        countersunk_hole(thickness + 0.2);
    }
}

// Main assembly
difference() {
    l_bracket();
    horizontal_flange_holes();
    vertical_flange_holes();
}
i3 success
iter 3
6.7s · 1821/1024t · $0.0069
diff vs i2: +23/-11
  // L-bracket with countersunk holes
  
  // Parameters
  horizontal_width = 50;  // mm
  horizontal_depth = 40;  // mm
  vertical_width = 50;    // mm
  vertical_height = 40;   // mm
  thickness = 3;          // mm
  
  // Hole parameters
  hole_diameter = 4.5;    // mm
  countersink_diameter = 8;  // mm
  countersink_depth = 2;  // mm
  hole_offset_from_edge = 10;  // mm from edge
  
- // Countersunk hole
- module countersunk_hole(depth = 50) {
+ // Countersunk hole - drilled from one side, countersink on the other side
+ module countersunk_hole_horizontal() {
      // Through hole
-     cylinder(h = depth, r = hole_diameter / 2, center = false, $fn = 32);
+     cylinder(h = thickness + 0.2, r = hole_diameter / 2, center = false, $fn = 32);
      
-     // Countersink
-     cylinder(h = countersink_depth, r = countersink_diameter / 2, center = false, $fn = 32);
+     // Countersink on top (Z+ direction)
+     translate([0, 0, thickness - countersink_depth])
+         cylinder(h = countersink_depth + 0.1, r = countersink_diameter / 2, center = false, $fn = 32);
  }
  
+ module countersunk_hole_vertical() {
+     // Through hole
+     cylinder(h = thickness + 0.2, r = hole_diameter / 2, center = false, $fn = 32);
+     
+     // Countersink on front (Y- direction)
+     translate([0, -countersink_depth, 0])
+         cylinder(h = countersink_depth + 0.1, r = countersink_diameter / 2, center = false, $fn = 32);
+ }
+ 
  // Main L-bracket shape
  module l_bracket() {
      // Horizontal flange (XY plane, at Z=0 to Z=thickness)
      cube([horizontal_width, horizontal_depth, thickness]);
      
      // Vertical flange (XZ plane, at Y=0 to Y=thickness)
      cube([vertical_width, thickness, vertical_height]);
  }
  
- // Holes for horizontal flange (top side, Z direction, countersink facing up)
+ // Holes for horizontal flange (top side, countersink facing up +Z)
  module horizontal_flange_holes() {
      hole_y = horizontal_depth / 2;
      
      // Left hole
      hole_x_left = hole_offset_from_edge;
      translate([hole_x_left, hole_y, -0.1]) {
-         countersunk_hole(thickness + 0.2);
+         countersunk_hole_horizontal();
      }
      
      // Right hole
      hole_x_right = horizontal_width - hole_offset_from_edge;
      translate([hole_x_right, hole_y, -0.1]) {
-         countersunk_hole(thickness + 0.2);
+         countersunk_hole_horizontal();
      }
  }
  
- // Holes for vertical flange (front side, Y direction, countersink facing outward -Y)
+ // Holes for vertical flange (front side, countersink facing outward -Y)
  module vertical_flange_holes() {
      hole_x = vertical_width / 2;
      
      // Bottom hole
      hole_z_bottom = hole_offset_from_edge;
      translate([hole_x, -0.1, hole_z_bottom]) {
-         countersunk_hole(thickness + 0.2);
+         rotate([90, 0, 0])
+             countersunk_hole_vertical();
      }
      
      // Top hole
      hole_z_top = vertical_height - hole_offset_from_edge;
      translate([hole_x, -0.1, hole_z_top]) {
-         countersunk_hole(thickness + 0.2);
+         rotate([90, 0, 0])
+             countersunk_hole_vertical();
      }
  }
  
  // Main assembly
  difference() {
      l_bracket();
      horizontal_flange_holes();
      vertical_flange_holes();
  }
SCAD (85 lines)
// L-bracket with countersunk holes

// Parameters
horizontal_width = 50;  // mm
horizontal_depth = 40;  // mm
vertical_width = 50;    // mm
vertical_height = 40;   // mm
thickness = 3;          // mm

// Hole parameters
hole_diameter = 4.5;    // mm
countersink_diameter = 8;  // mm
countersink_depth = 2;  // mm
hole_offset_from_edge = 10;  // mm from edge

// Countersunk hole - drilled from one side, countersink on the other side
module countersunk_hole_horizontal() {
    // Through hole
    cylinder(h = thickness + 0.2, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink on top (Z+ direction)
    translate([0, 0, thickness - countersink_depth])
        cylinder(h = countersink_depth + 0.1, r = countersink_diameter / 2, center = false, $fn = 32);
}

module countersunk_hole_vertical() {
    // Through hole
    cylinder(h = thickness + 0.2, r = hole_diameter / 2, center = false, $fn = 32);
    
    // Countersink on front (Y- direction)
    translate([0, -countersink_depth, 0])
        cylinder(h = countersink_depth + 0.1, r = countersink_diameter / 2, center = false, $fn = 32);
}

// Main L-bracket shape
module l_bracket() {
    // Horizontal flange (XY plane, at Z=0 to Z=thickness)
    cube([horizontal_width, horizontal_depth, thickness]);
    
    // Vertical flange (XZ plane, at Y=0 to Y=thickness)
    cube([vertical_width, thickness, vertical_height]);
}

// Holes for horizontal flange (top side, countersink facing up +Z)
module horizontal_flange_holes() {
    hole_y = horizontal_depth / 2;
    
    // Left hole
    hole_x_left = hole_offset_from_edge;
    translate([hole_x_left, hole_y, -0.1]) {
        countersunk_hole_horizontal();
    }
    
    // Right hole
    hole_x_right = horizontal_width - hole_offset_from_edge;
    translate([hole_x_right, hole_y, -0.1]) {
        countersunk_hole_horizontal();
    }
}

// Holes for vertical flange (front side, countersink facing outward -Y)
module vertical_flange_holes() {
    hole_x = vertical_width / 2;
    
    // Bottom hole
    hole_z_bottom = hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_bottom]) {
        rotate([90, 0, 0])
            countersunk_hole_vertical();
    }
    
    // Top hole
    hole_z_top = vertical_height - hole_offset_from_edge;
    translate([hole_x, -0.1, hole_z_top]) {
        rotate([90, 0, 0])
            countersunk_hole_vertical();
    }
}

// Main assembly
difference() {
    l_bracket();
    horizontal_flange_holes();
    vertical_flange_holes();
}