bare-think-off/gemini-3.5-flash / tier-2-l-bracket
success tier 2
bare (gemini 3.5 flash)
render
// L-bracket parameters
width = 50; // Width of the bracket (X direction)
depth = 40; // Depth of the horizontal flange (Y direction)
height = 40; // Height of the vertical flange (Z direction)
thickness = 3; // Thickness of the bracket
// Screw hole parameters (M4 countersunk)
d_hole = 4.5; // Through hole diameter
d_sink = 8.0; // Countersink maximum diameter
h_sink = 2.0; // Countersink depth
hole_offset = 10; // Distance from the edge
$fn = 60; // Smoothness of circles
module countersunk_hole() {
// Generates a countersunk hole along the Z-axis
// The head of the screw is on the Z+ side, pointing downwards (Z-)
union() {
// Through hole (extended to ensure clean cut)
translate([0, 0, -20])
cylinder(d = d_hole, h = 40);
// Countersink cone
translate([0, 0, -0.01])
cylinder(d1 = d_hole, d2 = d_sink, h = h_sink + 0.01);
// Excess upper cylinder for clean subtraction
translate([0, 0, h_sink])
cylinder(d = d_sink, h = 10);
}
}
difference() {
// 1. Bracket Base Shape (with inner corner at origin [0,0,0])
union() {
// Horizontal flange (Y+ direction)
// Outside is at Z = -thickness
translate([-width/2, 0, -thickness])
cube([width, depth, thickness]);
// Vertical flange (Z+ direction)
// Outside is at Y = -thickness
translate([-width/2, -thickness, 0])
cube([width, thickness, height]);
}
// 2. Holes on the Horizontal Flange
// Outside surface is at Z = -thickness. Screw enters from Z- (outside) towards Z+ (inside).
// We rotate the hole 180 degrees around X-axis so the head is on the Z- side.
translate([-(width/2 - hole_offset), depth - hole_offset, -thickness])
rotate([180, 0, 0])
countersunk_hole();
translate([width/2 - hole_offset, depth - hole_offset, -thickness])
rotate([180, 0, 0])
countersunk_hole();
// 3. Holes on the Vertical Flange
// Outside surface is at Y = -thickness. Screw enters from Y- (outside) towards Y+ (inside).
// We rotate the hole -90 degrees around X-axis so the head is on the Y- side.
translate([-(width/2 - hole_offset), -thickness, height - hole_offset])
rotate([-90, 0, 0])
countersunk_hole();
translate([width/2 - hole_offset, -thickness, height - hole_offset])
rotate([-90, 0, 0])
countersunk_hole();
} パラメータ (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 ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。