vibe-openscad

tier-2-hex-bolt / claude-opus-5

7 run / 累計 43.4s / 累計 $0.0803

claude opus 5 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-hex-bolt
loading STL…
success 6.5s · 262/436t · $0.0122
SCAD (23 lines)
// M8 hex bolt (JIS/ISO style, threads omitted)

// --- Parameters ---
head_across_flats = 13;    // 対辺距離 (mm)
head_height       = 5.3;   // 頭部高さ (mm)
shank_diameter    = 8;     // シャンク直径 (mm)
shank_length      = 30;    // シャンク長さ (mm)

$fn = 64;

// 対辺距離 -> 外接円半径
head_radius = head_across_flats / sqrt(3);

module m8_hex_bolt() {
    // 頭部: 底面が z=0、+Z 方向へ
    cylinder(h = head_height, r = head_radius, $fn = 6);

    // シャンク: z=0 から -Z 方向へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter);
}

m8_hex_bolt();
パラメータ (4) —
スライダを動かすと openscad-wasm で再レンダリング

prompt

OpenSCAD で、規格に準じた M8 サイズの六角ボルトを作ってください。
ねじ山自体は省略してよく、円柱のシャンクで構いません。

寸法は以下に従ってください:
- 頭部は六角柱で、対辺距離(across-flats)13mm、高さ 5.3mm
- シャンク(軸部)は直径 8mm、長さ 30mm の円柱
- ボルト全体の中心軸は +Z 軸方向
- 頭部の底面が原点(z=0)に来るように配置し、シャンクは z<0 側へ伸ばす

完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。

variant: effort

low success →
low
5.2s · 262/317t · $0.0092
SCAD (24 lines)
// M8 hex bolt (thread omitted, plain cylindrical shank)

$fn = 64;

head_across_flats = 13;   // 対辺距離
head_height       = 5.3;  // 頭部高さ
shank_diameter    = 8;    // シャンク径
shank_length      = 30;   // シャンク長

module hex_head(af, h) {
    // 六角柱: 対辺距離 af (外接円直径 = af / cos(30))
    cylinder(h = h, d = af / cos(180 / 6), $fn = 6);
}

module m8_bolt() {
    // 頭部: 底面 z=0、上方 +Z へ
    hex_head(head_across_flats, head_height);

    // シャンク: z=0 から -Z 方向へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter);
}

m8_bolt();
mediumnot run
—
high (default) success →
high
4.8s · 262/310t · $0.0091
SCAD (26 lines)
// M8 hex bolt (ISO 4014 style, threads omitted)

// ---- Parameters ----
head_af     = 13;    // across-flats [mm]
head_height = 5.3;   // head height [mm]
shank_dia   = 8;     // shank diameter [mm]
shank_len   = 30;    // shank length [mm]

$fn = 120;

// ---- Model ----
module hex_head(af, h) {
    // circumscribed-circle diameter from across-flats
    cylinder(h = h, d = af / cos(180 / 6), $fn = 6);
}

module m8_bolt() {
    // head: bottom face at z = 0, extends to +Z
    hex_head(head_af, head_height);

    // shank: extends to -Z
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

m8_bolt();
max success →
max
6.9s · 262/457t · $0.0127
SCAD (33 lines)
// M8 hex bolt (ISO 4014 style, simplified: unthreaded cylindrical shank)
// Head: hexagonal prism, across-flats 13 mm, height 5.3 mm
// Shank: diameter 8 mm, length 30 mm
// Axis: +Z. Head bottom face at z = 0, shank extends into z < 0.

$fn = 100;

// ---- Parameters ----------------------------------------------------
head_af     = 13;    // across-flats (対辺距離) [mm]
head_height = 5.3;   // 頭部高さ [mm]
shank_dia   = 8;     // シャンク直径 [mm]
shank_len   = 30;    // シャンク長さ [mm]

// ---- Modules -------------------------------------------------------
module hex_head(across_flats, h) {
    // circumscribed circle diameter from across-flats
    cylinder(h = h, d = across_flats / cos(30), $fn = 6);
}

module shank(d, l) {
    translate([0, 0, -l])
        cylinder(h = l, d = d);
}

module m8_hex_bolt() {
    union() {
        hex_head(head_af, head_height);
        shank(shank_dia, shank_len);
    }
}

// ---- Render --------------------------------------------------------
m8_hex_bolt();
xhigh success →
xhigh
8.3s · 262/558t · $0.0153
SCAD (24 lines)
// M8 六角ボルト(ねじ山省略・シャンクは円柱)
// 頭部底面が z = 0、シャンクは -Z 方向へ

// ---- 寸法パラメータ ----
head_af     = 13;    // 頭部 対辺距離 (across-flats)
head_height = 5.3;   // 頭部 高さ
shank_dia   = 8;     // シャンク 直径 (M8)
shank_len   = 30;    // シャンク 長さ

$fn = 96;            // 円柱の分割数

// 対辺距離 -> 外接円半径
head_r = head_af / sqrt(3);

module hex_bolt_m8() {
    // 頭部(六角柱): z = 0 〜 head_height
    cylinder(h = head_height, r = head_r, $fn = 6);

    // シャンク(円柱): z = 0 〜 -shank_len
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

hex_bolt_m8();

variant: thinking

off success →
off
4.8s · 262/310t · $0.0091
SCAD (26 lines)
// M8 hex bolt (ISO 4014 style, threads omitted)

// ---- Parameters ----
head_af     = 13;    // across-flats [mm]
head_height = 5.3;   // head height [mm]
shank_dia   = 8;     // shank diameter [mm]
shank_len   = 30;    // shank length [mm]

$fn = 120;

// ---- Model ----
module hex_head(af, h) {
    // circumscribed-circle diameter from across-flats
    cylinder(h = h, d = af / cos(180 / 6), $fn = 6);
}

module m8_bolt() {
    // head: bottom face at z = 0, extends to +Z
    hex_head(head_af, head_height);

    // shank: extends to -Z
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

m8_bolt();
adaptive (default) success →
adaptive
6.9s · 262/457t · $0.0127
SCAD (33 lines)
// M8 hex bolt (ISO 4014 style, simplified: unthreaded cylindrical shank)
// Head: hexagonal prism, across-flats 13 mm, height 5.3 mm
// Shank: diameter 8 mm, length 30 mm
// Axis: +Z. Head bottom face at z = 0, shank extends into z < 0.

$fn = 100;

// ---- Parameters ----------------------------------------------------
head_af     = 13;    // across-flats (対辺距離) [mm]
head_height = 5.3;   // 頭部高さ [mm]
shank_dia   = 8;     // シャンク直径 [mm]
shank_len   = 30;    // シャンク長さ [mm]

// ---- Modules -------------------------------------------------------
module hex_head(across_flats, h) {
    // circumscribed circle diameter from across-flats
    cylinder(h = h, d = across_flats / cos(30), $fn = 6);
}

module shank(d, l) {
    translate([0, 0, -l])
        cylinder(h = l, d = d);
}

module m8_hex_bolt() {
    union() {
        hex_head(head_af, head_height);
        shank(shank_dia, shank_len);
    }
}

// ---- Render --------------------------------------------------------
m8_hex_bolt();
dynamicnot run
—