vibe-openscad

tier-2-hex-bolt / claude-opus-4-8

10 run / 累計 50.3s / 累計 $0.1163

claude opus 4.8 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-hex-bolt
loading STL…
success 4.1s · 262/290t · $0.0086
SCAD (22 lines)
// M8 六角ボルト
// 頭部: 対辺距離 13mm, 高さ 5.3mm
// シャンク: 直径 8mm, 長さ 30mm

across_flats = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

// 対辺距離から外接円半径を計算
head_radius = across_flats / 2 / cos(30);

module hex_bolt() {
    // 頭部(六角柱) z=0 から z=head_height へ
    cylinder(h = head_height, r = head_radius, $fn = 6);

    // シャンク(円柱) z=0 から z=-shank_length へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter, $fn = 64);
}

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
4.6s · 262/291t · $0.0086
SCAD (19 lines)
// M8 六角ボルト
$fn = 100;

// 寸法
across_flats = 13;      // 対辺距離
head_height  = 5.3;     // 頭部高さ
shank_dia    = 8;       // シャンク直径
shank_len    = 30;      // シャンク長さ

// 対辺距離から外接円半径を計算
head_radius = across_flats / (2 * cos(30));

// 頭部(六角柱):底面が z=0、上面が z=head_height
translate([0, 0, head_height/2])
    cylinder(h = head_height, r = head_radius, center = true, $fn = 6);

// シャンク(円柱):z=0 から z<0 方向へ伸ばす
translate([0, 0, -shank_len])
    cylinder(h = shank_len, d = shank_dia, $fn = 100);
mediumnot run
high (default) success
high
4.7s · 262/306t · $0.0090
SCAD (22 lines)
// M8 hex bolt (simplified, no threads)

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

$fn = 100;

module hex_bolt() {
    // 頭部: 六角柱 (底面 z=0, 上面 z=head_height)
    // 対辺距離から外接円半径を計算
    r_head = across_flats / sqrt(3);
    cylinder(h = head_height, r = r_head, $fn = 6);

    // シャンク: z<0 側へ伸ばす
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

hex_bolt();
max success
max
4.9s · 260/316t · $0.0092
SCAD (22 lines)
// M8 Hex Bolt (simplified, no threads)
// Head: hex prism, across-flats = 13mm, height = 5.3mm
// Shank: cylinder, diameter = 8mm, length = 30mm
// Head bottom at z=0, shank extends to z<0

$fn = 100;

across_flats = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

// across-flats to circumscribed circle radius for hexagon
// width across flats = sqrt(3) * r  =>  r = af / sqrt(3)
hex_radius = across_flats / sqrt(3);

// Head: hexagonal prism above z=0
cylinder(h = head_height, r = hex_radius, $fn = 6);

// Shank: cylinder below z=0
translate([0, 0, -shank_length])
    cylinder(h = shank_length, d = shank_diameter);
xhigh success
xhigh
4.7s · 262/302t · $0.0089
SCAD (22 lines)
// M8 六角ボルト

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

$fn = 100;

module hex_bolt() {
    // 頭部:六角柱(底面が z=0、上方向へ伸ばす)
    // 対辺距離から外接円半径を算出
    head_r = across_flats / sqrt(3);
    cylinder(h = head_height, r = head_r, $fn = 6);

    // シャンク:z<0 側へ伸ばす
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

hex_bolt();

variant: thinking

off success
off
4.7s · 262/306t · $0.0090
SCAD (22 lines)
// M8 hex bolt (simplified, no threads)

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

$fn = 100;

module hex_bolt() {
    // 頭部: 六角柱 (底面 z=0, 上面 z=head_height)
    // 対辺距離から外接円半径を計算
    r_head = across_flats / sqrt(3);
    cylinder(h = head_height, r = r_head, $fn = 6);

    // シャンク: z<0 側へ伸ばす
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

hex_bolt();
adaptive (default) success
adaptive
4.7s · 262/302t · $0.0089
SCAD (22 lines)
// M8 六角ボルト

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

$fn = 100;

module hex_bolt() {
    // 頭部:六角柱(底面が z=0、上方向へ伸ばす)
    // 対辺距離から外接円半径を算出
    head_r = across_flats / sqrt(3);
    cylinder(h = head_height, r = head_r, $fn = 6);

    // シャンク:z<0 側へ伸ばす
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_dia);
}

hex_bolt();
dynamicnot run

iteration: iter-png

i1 success
iter 1
6.2s · 1313/460t · $0.0181
diff vs bare: +0/-0
  // M8 六角ボルト
  // 頭部: 対辺距離 13mm, 高さ 5.3mm
  // シャンク: 直径 8mm, 長さ 30mm
  
  across_flats = 13;
  head_height = 5.3;
  shank_diameter = 8;
  shank_length = 30;
  
  // 対辺距離から外接円半径を計算
  head_radius = across_flats / 2 / cos(30);
  
  module hex_bolt() {
      // 頭部(六角柱) z=0 から z=head_height へ
      cylinder(h = head_height, r = head_radius, $fn = 6);
  
      // シャンク(円柱) z=0 から z=-shank_length へ
      translate([0, 0, -shank_length])
          cylinder(h = shank_length, d = shank_diameter, $fn = 64);
  }
  
  hex_bolt();
SCAD (22 lines)
// M8 六角ボルト
// 頭部: 対辺距離 13mm, 高さ 5.3mm
// シャンク: 直径 8mm, 長さ 30mm

across_flats = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

// 対辺距離から外接円半径を計算
head_radius = across_flats / 2 / cos(30);

module hex_bolt() {
    // 頭部(六角柱) z=0 から z=head_height へ
    cylinder(h = head_height, r = head_radius, $fn = 6);

    // シャンク(円柱) z=0 から z=-shank_length へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter, $fn = 64);
}

hex_bolt();
i2 success
iter 2
5.7s · 1313/472t · $0.0184
diff vs i1: +0/-0
  // M8 六角ボルト
  // 頭部: 対辺距離 13mm, 高さ 5.3mm
  // シャンク: 直径 8mm, 長さ 30mm
  
  across_flats = 13;
  head_height = 5.3;
  shank_diameter = 8;
  shank_length = 30;
  
  // 対辺距離から外接円半径を計算
  head_radius = across_flats / 2 / cos(30);
  
  module hex_bolt() {
      // 頭部(六角柱) z=0 から z=head_height へ
      cylinder(h = head_height, r = head_radius, $fn = 6);
  
      // シャンク(円柱) z=0 から z=-shank_length へ
      translate([0, 0, -shank_length])
          cylinder(h = shank_length, d = shank_diameter, $fn = 64);
  }
  
  hex_bolt();
SCAD (22 lines)
// M8 六角ボルト
// 頭部: 対辺距離 13mm, 高さ 5.3mm
// シャンク: 直径 8mm, 長さ 30mm

across_flats = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

// 対辺距離から外接円半径を計算
head_radius = across_flats / 2 / cos(30);

module hex_bolt() {
    // 頭部(六角柱) z=0 から z=head_height へ
    cylinder(h = head_height, r = head_radius, $fn = 6);

    // シャンク(円柱) z=0 から z=-shank_length へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter, $fn = 64);
}

hex_bolt();
i3 success
iter 3
5.9s · 1313/454t · $0.0179
diff vs i2: +0/-0
  // M8 六角ボルト
  // 頭部: 対辺距離 13mm, 高さ 5.3mm
  // シャンク: 直径 8mm, 長さ 30mm
  
  across_flats = 13;
  head_height = 5.3;
  shank_diameter = 8;
  shank_length = 30;
  
  // 対辺距離から外接円半径を計算
  head_radius = across_flats / 2 / cos(30);
  
  module hex_bolt() {
      // 頭部(六角柱) z=0 から z=head_height へ
      cylinder(h = head_height, r = head_radius, $fn = 6);
  
      // シャンク(円柱) z=0 から z=-shank_length へ
      translate([0, 0, -shank_length])
          cylinder(h = shank_length, d = shank_diameter, $fn = 64);
  }
  
  hex_bolt();
SCAD (22 lines)
// M8 六角ボルト
// 頭部: 対辺距離 13mm, 高さ 5.3mm
// シャンク: 直径 8mm, 長さ 30mm

across_flats = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

// 対辺距離から外接円半径を計算
head_radius = across_flats / 2 / cos(30);

module hex_bolt() {
    // 頭部(六角柱) z=0 から z=head_height へ
    cylinder(h = head_height, r = head_radius, $fn = 6);

    // シャンク(円柱) z=0 から z=-shank_length へ
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter, $fn = 64);
}

hex_bolt();