vibe-openscad

tier-2-hex-bolt / gpt-5.4-2026-03-05

7 run / 累計 32.9s / 累計 $0.0341

openai gpt 5.4 2026-03-05 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-hex-bolt
loading STL…
success 4.2s · 200/183t · $0.0033
SCAD (20 lines)
$fn = 64;

// M8 hex bolt (thread omitted)
// Head: hex prism, across flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Head bottom face at z = 0, shank extends toward negative Z

head_af = 13;
head_h = 5.3;
shank_d = 8;
shank_l = 30;

// For a regular hexagon, across-flats = sqrt(3) * circumradius
hex_r = head_af / sqrt(3);

union() {
    cylinder(h = head_h, r = hex_r, $fn = 6);
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}
パラメータ (4)
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

variant: effort

low success
low
8.2s · 200/311t · $0.0054
SCAD (7 lines)
$fn = 64;

union() {
    cylinder(h = 5.3, r = 13 / sqrt(3), $fn = 6);
    translate([0, 0, -30])
        cylinder(h = 30, d = 8);
}
medium (default) success
medium
4.2s · 200/183t · $0.0033
SCAD (20 lines)
$fn = 64;

// M8 hex bolt (thread omitted)
// Head: hex prism, across flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Head bottom face at z = 0, shank extends toward negative Z

head_af = 13;
head_h = 5.3;
shank_d = 8;
shank_l = 30;

// For a regular hexagon, across-flats = sqrt(3) * circumradius
hex_r = head_af / sqrt(3);

union() {
    cylinder(h = head_h, r = hex_r, $fn = 6);
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}
high success
high
7.5s · 200/395t · $0.0067
SCAD (12 lines)
head_af = 13;
head_height = 5.3;
shank_diameter = 8;
shank_length = 30;

head_r = head_af / sqrt(3);

union() {
    cylinder(h = head_height, r = head_r, $fn = 6);
    translate([0, 0, -shank_length])
        cylinder(h = shank_length, d = shank_diameter, $fn = 64);
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
3.1s · 1048/189t · $0.0051
diff vs bare: +1/-1
  $fn = 64;
  
  // M8 hex bolt (thread omitted)
  // Head: hex prism, across flats = 13 mm, height = 5.3 mm
  // Shank: cylinder, diameter = 8 mm, length = 30 mm
  // Head bottom face at z = 0, shank extends toward negative Z
  
  head_af = 13;
  head_h = 5.3;
  shank_d = 8;
  shank_l = 30;
  
- // For a regular hexagon, across-flats = sqrt(3) * circumradius
+ // For a regular hexagon, across flats = 2 * apothem = sqrt(3) * circumradius
  hex_r = head_af / sqrt(3);
  
  union() {
      cylinder(h = head_h, r = hex_r, $fn = 6);
      translate([0, 0, -shank_l])
          cylinder(h = shank_l, d = shank_d);
  }
SCAD (20 lines)
$fn = 64;

// M8 hex bolt (thread omitted)
// Head: hex prism, across flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Head bottom face at z = 0, shank extends toward negative Z

head_af = 13;
head_h = 5.3;
shank_d = 8;
shank_l = 30;

// For a regular hexagon, across flats = 2 * apothem = sqrt(3) * circumradius
hex_r = head_af / sqrt(3);

union() {
    cylinder(h = head_h, r = hex_r, $fn = 6);
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}
i2 success
iter 2
2.8s · 1054/182t · $0.0050
diff vs i1: +1/-1
  $fn = 64;
  
  // M8 hex bolt (thread omitted)
  // Head: hex prism, across flats = 13 mm, height = 5.3 mm
  // Shank: cylinder, diameter = 8 mm, length = 30 mm
  // Head bottom face at z = 0, shank extends toward negative Z
  
  head_af = 13;
  head_h = 5.3;
  shank_d = 8;
  shank_l = 30;
  
- // For a regular hexagon, across flats = 2 * apothem = sqrt(3) * circumradius
+ // For a regular hexagon, across flats = sqrt(3) * circumradius
  hex_r = head_af / sqrt(3);
  
  union() {
      cylinder(h = head_h, r = hex_r, $fn = 6);
      translate([0, 0, -shank_l])
          cylinder(h = shank_l, d = shank_d);
  }
SCAD (20 lines)
$fn = 64;

// M8 hex bolt (thread omitted)
// Head: hex prism, across flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Head bottom face at z = 0, shank extends toward negative Z

head_af = 13;
head_h = 5.3;
shank_d = 8;
shank_l = 30;

// For a regular hexagon, across flats = sqrt(3) * circumradius
hex_r = head_af / sqrt(3);

union() {
    cylinder(h = head_h, r = hex_r, $fn = 6);
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}
i3 success
iter 3
3.0s · 1047/197t · $0.0052
diff vs i2: +2/-1
  $fn = 64;
  
  // M8 hex bolt (thread omitted)
  // Head: hex prism, across flats = 13 mm, height = 5.3 mm
  // Shank: cylinder, diameter = 8 mm, length = 30 mm
+ // Bolt axis: +Z direction
  // Head bottom face at z = 0, shank extends toward negative Z
  
  head_af = 13;
  head_h = 5.3;
  shank_d = 8;
  shank_l = 30;
  
- // For a regular hexagon, across flats = sqrt(3) * circumradius
+ // For a regular hexagon, across flats = 2 * apothem = sqrt(3) * circumradius
  hex_r = head_af / sqrt(3);
  
  union() {
      cylinder(h = head_h, r = hex_r, $fn = 6);
      translate([0, 0, -shank_l])
          cylinder(h = shank_l, d = shank_d);
  }
SCAD (21 lines)
$fn = 64;

// M8 hex bolt (thread omitted)
// Head: hex prism, across flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Bolt axis: +Z direction
// Head bottom face at z = 0, shank extends toward negative Z

head_af = 13;
head_h = 5.3;
shank_d = 8;
shank_l = 30;

// For a regular hexagon, across flats = 2 * apothem = sqrt(3) * circumradius
hex_r = head_af / sqrt(3);

union() {
    cylinder(h = head_h, r = hex_r, $fn = 6);
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}