vibe-openscad

tier-2-l-bracket / claude-sonnet-5

7 run / 累計 1593.0s / 累計 $1.54

claude sonnet 5 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-l-bracket
loading STL…
success 90.8s · 381/9516t · $0.0959
SCAD (79 lines)
// =========================================
// L字金具 (L-bracket) with countersunk holes
// =========================================

width      = 50;   // X方向:幅
depth      = 40;   // Y方向:水平面の奥行き
height     = 40;   // Z方向:垂直面の高さ
thick      = 3;    // 板厚

hole_d     = 4.5;  // 貫通穴径 (M4用)
csk_d      = 8;    // 皿座面径
csk_depth  = 2;    // 皿座面深さ
edge_off   = 10;   // 縁からの穴中心オフセット

hole_x = width/2 - edge_off;  // = 15
eps    = 0.5;                 // ブーリアン演算用の余裕

$fn = 64;

// ---------- 本体形状 ----------
module bracket_body(){
    union(){
        // 水平面: 内側面 Z=0 (原点), 外側面 Z=-thick
        translate([-width/2, 0, -thick])
            cube([width, depth, thick]);

        // 垂直面: 内側面 Y=0 (原点), 外側面 Y=-thick
        translate([-width/2, -thick, 0])
            cube([width, thick, height]);

        // 内側コーナーを埋める補強ブロック(折り曲げ部の連続性確保)
        translate([-width/2, -thick, -thick])
            cube([width, thick, thick]);
    }
}

// ---------- 水平面用 皿穴(Z方向に貫通、外側=下面に皿座面) ----------
module h_hole(x, y){
    translate([x, y, 0]){
        // 貫通穴
        translate([0, 0, -thick - eps])
            cylinder(h = thick + 2*eps, d = hole_d);

        // 皿座面(外側 Z=-thick 側が広い)
        translate([0, 0, -thick - eps])
            cylinder(h = csk_depth + eps, r1 = csk_d/2, r2 = hole_d/2);
    }
}

// ---------- 垂直面用 皿穴(Y方向に貫通、外側=背面に皿座面) ----------
module v_hole(x, z){
    translate([x, 0, z])
        rotate([-90, 0, 0]){
            // 貫通穴
            translate([0, 0, -thick - eps])
                cylinder(h = thick + 2*eps, d = hole_d);

            // 皿座面(外側 Y=-thick 側が広い)
            translate([0, 0, -thick - eps])
                cylinder(h = csk_depth + eps, r1 = csk_d/2, r2 = hole_d/2);
        }
}

// ---------- 全ての穴 ----------
module all_holes(){
    // 水平面: 中心線 Y = depth/2, 左右対称にX方向へオフセット
    h_hole( hole_x, depth/2);
    h_hole(-hole_x, depth/2);

    // 垂直面: 中心線 Z = height/2, 左右対称にX方向へオフセット
    v_hole( hole_x, height/2);
    v_hole(-hole_x, height/2);
}

// ---------- 最終形状 ----------
difference(){
    bracket_body();
    all_holes();
}
パラメータ (9) —
スライダを動かすと 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
6.0s · 381/583t · $0.0066
SCAD (55 lines)
// L字金具
$fn = 60;

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

hole_d = 4.5;
csk_d = 8;
csk_depth = 2;
edge_offset = 10;
hole_x_offset = width/2 - edge_offset;

module countersunk_hole(depth_total) {
    union() {
        translate([0,0,-1])
            cylinder(d=hole_d, h=depth_total+2);
        translate([0,0,depth_total-csk_depth])
            cylinder(d1=hole_d, d2=csk_d, h=csk_depth+0.01);
    }
}

module horizontal_flange() {
    difference() {
        translate([-width/2, 0, 0])
            cube([width, depth, thickness]);
        
        // 皿穴は上面(外側、+Z側)から見て皿座面が上(外側)
        for (x = [-hole_x_offset, hole_x_offset]) {
            translate([x, depth - edge_offset, 0])
                translate([0,0,thickness - csk_depth])
                countersunk_hole(thickness);
        }
    }
}

module vertical_flange() {
    difference() {
        translate([-width/2, 0, 0])
            cube([width, thickness, height]);
        
        // 皿穴は外側(+Y側)に皿座面
        for (x = [-hole_x_offset, hole_x_offset]) {
            translate([x, thickness, height - edge_offset])
                rotate([90,0,0])
                translate([0,0,-(thickness)])
                countersunk_hole(thickness);
        }
    }
}

// 組み立て
horizontal_flange();
vertical_flange();
mediumnot run
—
high (default) success →
high
9.6s · 381/897t · $0.0097
SCAD (63 lines)
// L字金具 (L-bracket)
// 水平面: 50(幅X) x 40(奥行きY) x 3(厚みZ)
// 垂直面: 50(幅X) x 40(高さZ) x 3(厚みY)
// 内側コーナーが原点

width = 50;      // X方向の幅
depth = 40;      // 水平面の奥行き(Y)
height = 40;     // 垂直面の高さ(Z)
thickness = 3;   // 板厚

hole_dia = 4.5;      // 貫通穴径
csk_dia = 8;         // 皿座面径
csk_depth = 2;       // 皿座面深さ
edge_offset = 10;    // 縁から穴中心までの距離
hole_spacing = width - 2 * edge_offset; // 左右2穴の間隔

module countersunk_hole(depth_total) {
    // depth_total: 板厚全体を貫通させる長さ
    union() {
        // 貫通穴
        cylinder(h = depth_total * 2, d = hole_dia, center = true, $fn = 50);
        // 皿座面(円錐台) - 上端がcsk_dia, 下端がhole_dia
        translate([0, 0, depth_total/2 - csk_depth])
            cylinder(h = csk_depth + 0.01, d1 = hole_dia, d2 = csk_dia, $fn = 50);
    }
}

module horizontal_plate() {
    difference() {
        // 水平面: X: 0~50, Y: 0~40, Z: 0~3
        translate([0, 0, 0])
            cube([width, depth, thickness]);

        // 皿穴(外側=下面 Z=0 側に皿座面を向ける)
        for (x = [edge_offset, width - edge_offset]) {
            translate([x, depth - edge_offset, thickness/2])
                rotate([180, 0, 0])
                    countersunk_hole(thickness);
        }
    }
}

module vertical_plate() {
    difference() {
        // 垂直面: X: 0~50, Y: 0~3, Z: 0~40
        translate([0, 0, 0])
            cube([width, thickness, height]);

        // 皿穴(外側=手前面 Y=0 側に皿座面を向ける)
        for (x = [edge_offset, width - edge_offset]) {
            translate([x, thickness/2, edge_offset])
                rotate([-90, 0, 0])
                    countersunk_hole(thickness);
        }
    }
}

module l_bracket() {
    horizontal_plate();
    vertical_plate();
}

l_bracket();
max no_code nocode →
no_code
665.9s · 381/64000t · $0.6408
model returned empty response (stopReason=max_tokens)
SCAD (1 lines)

no SCAD

xhigh success →
xhigh
145.4s · 381/13381t · $0.1346
SCAD (71 lines)
// ===================================================
// L字金具 (L-bracket) パラメトリックモデル
// ===================================================

// ----- 基本寸法 -----
flange_width = 50;    // 幅 (X方向、共通)
h_depth      = 40;    // 水平面 奥行き (Y方向)
v_height     = 40;    // 垂直面 高さ (Z方向)
thickness    = 3;     // 板厚 (共通)

// ----- 皿穴(M4用)寸法 -----
hole_dia    = 4.5;    // 貫通穴 径
csink_dia   = 8;      // 皿座面 径
csink_depth = 2;      // 皿座面 深さ
edge_offset = 10;     // 幅方向の縁からの距離

hole_x = flange_width/2 - edge_offset; // 左右対称の穴X位置 (±15)

eps = 0.5;  // 貫通穴を確実に貫通させるための余裕

$fn = 64;

// ----- L字本体(内側コーナーが原点) -----
module bracket_base() {
    // 水平面フランジ(外側コーナーを埋めるようY方向に板厚分延長)
    translate([-flange_width/2, -thickness, -thickness])
        cube([flange_width, h_depth + thickness, thickness]);

    // 垂直面フランジ
    translate([-flange_width/2, -thickness, 0])
        cube([flange_width, thickness, v_height]);
}

// 水平面用 皿穴(Z方向に貫通、外側=下面 Z=-thickness に皿座面)
module csink_hole_horizontal(x, y) {
    // 貫通穴
    translate([x, y, -thickness - eps])
        cylinder(h = thickness + 2*eps, r = hole_dia/2);
    // 皿座面(外側が大径、内側に向かって縮径)
    translate([x, y, -thickness - 0.01])
        cylinder(h = csink_depth + 0.01, r1 = csink_dia/2, r2 = hole_dia/2);
}

// 垂直面用 皿穴(Y方向に貫通、外側=背面 Y=-thickness に皿座面)
module csink_hole_vertical(x, z) {
    // 貫通穴
    translate([x, -thickness - eps, z])
        rotate([-90, 0, 0])
            cylinder(h = thickness + 2*eps, r = hole_dia/2);
    // 皿座面(外側が大径、内側に向かって縮径)
    translate([x, -thickness - 0.01, z])
        rotate([-90, 0, 0])
            cylinder(h = csink_depth + 0.01, r1 = csink_dia/2, r2 = hole_dia/2);
}

// ----- 完成モデル -----
module l_bracket() {
    difference() {
        bracket_base();

        // 水平面の皿穴 x2(奥行き中央、幅方向に左右対称)
        csink_hole_horizontal( hole_x, h_depth/2);
        csink_hole_horizontal(-hole_x, h_depth/2);

        // 垂直面の皿穴 x2(高さ中央、幅方向に左右対称)
        csink_hole_vertical( hole_x, v_height/2);
        csink_hole_vertical(-hole_x, v_height/2);
    }
}

l_bracket();

variant: thinking

off success →
off
9.6s · 381/897t · $0.0097
SCAD (63 lines)
// L字金具 (L-bracket)
// 水平面: 50(幅X) x 40(奥行きY) x 3(厚みZ)
// 垂直面: 50(幅X) x 40(高さZ) x 3(厚みY)
// 内側コーナーが原点

width = 50;      // X方向の幅
depth = 40;      // 水平面の奥行き(Y)
height = 40;     // 垂直面の高さ(Z)
thickness = 3;   // 板厚

hole_dia = 4.5;      // 貫通穴径
csk_dia = 8;         // 皿座面径
csk_depth = 2;       // 皿座面深さ
edge_offset = 10;    // 縁から穴中心までの距離
hole_spacing = width - 2 * edge_offset; // 左右2穴の間隔

module countersunk_hole(depth_total) {
    // depth_total: 板厚全体を貫通させる長さ
    union() {
        // 貫通穴
        cylinder(h = depth_total * 2, d = hole_dia, center = true, $fn = 50);
        // 皿座面(円錐台) - 上端がcsk_dia, 下端がhole_dia
        translate([0, 0, depth_total/2 - csk_depth])
            cylinder(h = csk_depth + 0.01, d1 = hole_dia, d2 = csk_dia, $fn = 50);
    }
}

module horizontal_plate() {
    difference() {
        // 水平面: X: 0~50, Y: 0~40, Z: 0~3
        translate([0, 0, 0])
            cube([width, depth, thickness]);

        // 皿穴(外側=下面 Z=0 側に皿座面を向ける)
        for (x = [edge_offset, width - edge_offset]) {
            translate([x, depth - edge_offset, thickness/2])
                rotate([180, 0, 0])
                    countersunk_hole(thickness);
        }
    }
}

module vertical_plate() {
    difference() {
        // 垂直面: X: 0~50, Y: 0~3, Z: 0~40
        translate([0, 0, 0])
            cube([width, thickness, height]);

        // 皿穴(外側=手前面 Y=0 側に皿座面を向ける)
        for (x = [edge_offset, width - edge_offset]) {
            translate([x, thickness/2, edge_offset])
                rotate([-90, 0, 0])
                    countersunk_hole(thickness);
        }
    }
}

module l_bracket() {
    horizontal_plate();
    vertical_plate();
}

l_bracket();
adaptive (default) no_code nocode →
no_code
665.9s · 381/64000t · $0.6408
model returned empty response (stopReason=max_tokens)
SCAD (1 lines)

no SCAD

dynamicnot run
—