vibe-openscad

tier-2-hex-bolt / gpt-5-mini-2025-08-07

7 run / 累計 139.3s / 累計 $0.0251

openai gpt 5 mini 2025-08-07 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-hex-bolt
loading STL…
success 20.8s · 200/1868t · $0.0038
SCAD (16 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる
r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
head_height = 5.3;
shank_d = 8;
shank_h = 30;

union() {
    // 六角頭部(底面 z=0 -> 天面 z=head_height)
    linear_extrude(height = head_height)
        circle(r = r, $fn = 6);

    // シャンク(上面 z=0、下面 z=-shank_h)
    translate([0, 0, -shank_h])
        cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
}
パラメータ (3)
スライダを動かすと openscad-wasm で再レンダリング

prompt

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

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

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

variant: effort

low success
low
15.3s · 200/895t · $0.0018
SCAD (32 lines)
// M8 hex bolt (simplified: no threads, cylindrical shank)
// Head: hexagonal prism, across-flats = 13 mm, height = 5.3 mm
// Shank: cylinder, diameter = 8 mm, length = 30 mm
// Head bottom at z = 0, shank extends to z < 0, central axis along +Z

$fn = 64; // smooth cylinder

module hex_head(across_flats = 13, height = 5.3) {
    // For a regular hexagon: across_flats = R * sqrt(3)  => circumradius R = across_flats / sqrt(3)
    R = across_flats / sqrt(3);
    // Create a 6-sided regular polygon with circumradius R, centered at origin
    linear_extrude(height = height, center = false, convexity = 10)
        polygon(points = [ for(i = [0:5]) let(a = i*360/6) [ R*cos(a), R*sin(a) ] ]);
}

module shank(diameter = 8, length = 30) {
    // Cylinder with top at z = 0, extending to negative z
    translate([0,0,-length]) // move base to z = -length
        translate([0,0,0]) // ensures top at z=0 after cylinder creation
            cylinder(h = length, d = diameter, center = false);
}

// Assemble: head from z=0 up, shank from z=0 down
union() {
    // Head: bottom at z = 0
    translate([0,0,0]) hex_head(13, 5.3);
    // Shank: top at z = 0, extends to z = -30
    shank(8, 30);
}

// Optional: create a module and call it (already assembled above)
// bolt();
medium (default) success
medium
20.8s · 200/1868t · $0.0038
SCAD (16 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる
r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
head_height = 5.3;
shank_d = 8;
shank_h = 30;

union() {
    // 六角頭部(底面 z=0 -> 天面 z=head_height)
    linear_extrude(height = head_height)
        circle(r = r, $fn = 6);

    // シャンク(上面 z=0、下面 z=-shank_h)
    translate([0, 0, -shank_h])
        cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
}
high success
high
52.3s · 200/4004t · $0.0081
SCAD (20 lines)
// M8 六角ボルト(ねじ山省略、シャンクは円柱)
// 頭部底面が z=0、シャンクは z<0 側へ伸ばす

// 寸法(mm)
af = 13;             // 対辺距離 (across-flats)
head_h = 5.3;        // 頭部高さ
shank_d = 8;         // シャンク直径
shank_len = 30;      // シャンク長さ

// 六角柱用の外接円直径(円周上の頂点間の直径)
head_d = 2 * af / sqrt(3);

union() {
    // 六角頭部(底面が z=0)
    cylinder(h = head_h, d = head_d, $fn = 6, center = false);

    // シャンク(z=-shank_len .. 0)
    translate([0, 0, -shank_len])
        cylinder(h = shank_len, d = shank_d, $fn = 64, center = false);
}
maxnot run
xhighnot run

iteration: iter-png

i1 success
iter 1
9.8s · 1062/977t · $0.0022
diff vs bare: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、シャンクは z<0 側へ伸びる
  r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
  head_height = 5.3;
  shank_d = 8;
  shank_h = 30;
  
  union() {
      // 六角頭部(底面 z=0 -> 天面 z=head_height)
      linear_extrude(height = head_height)
          circle(r = r, $fn = 6);
  
      // シャンク(上面 z=0、下面 z=-shank_h)
      translate([0, 0, -shank_h])
          cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
  }
SCAD (16 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる
r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
head_height = 5.3;
shank_d = 8;
shank_h = 30;

union() {
    // 六角頭部(底面 z=0 -> 天面 z=head_height)
    linear_extrude(height = head_height)
        circle(r = r, $fn = 6);

    // シャンク(上面 z=0、下面 z=-shank_h)
    translate([0, 0, -shank_h])
        cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
}
i2 success
iter 2
10.0s · 1062/1086t · $0.0024
diff vs i1: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、シャンクは z<0 側へ伸びる
  r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
  head_height = 5.3;
  shank_d = 8;
  shank_h = 30;
  
  union() {
      // 六角頭部(底面 z=0 -> 天面 z=head_height)
      linear_extrude(height = head_height)
          circle(r = r, $fn = 6);
  
      // シャンク(上面 z=0、下面 z=-shank_h)
      translate([0, 0, -shank_h])
          cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
  }
SCAD (16 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる
r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
head_height = 5.3;
shank_d = 8;
shank_h = 30;

union() {
    // 六角頭部(底面 z=0 -> 天面 z=head_height)
    linear_extrude(height = head_height)
        circle(r = r, $fn = 6);

    // シャンク(上面 z=0、下面 z=-shank_h)
    translate([0, 0, -shank_h])
        cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
}
i3 success
iter 3
10.5s · 1062/1371t · $0.0030
diff vs i2: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、シャンクは z<0 側へ伸びる
  r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
  head_height = 5.3;
  shank_d = 8;
  shank_h = 30;
  
  union() {
      // 六角頭部(底面 z=0 -> 天面 z=head_height)
      linear_extrude(height = head_height)
          circle(r = r, $fn = 6);
  
      // シャンク(上面 z=0、下面 z=-shank_h)
      translate([0, 0, -shank_h])
          cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
  }
SCAD (16 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる
r = 13 / sqrt(3); // 六角形の外接円半径(対辺距離13mm に対応)
head_height = 5.3;
shank_d = 8;
shank_h = 30;

union() {
    // 六角頭部(底面 z=0 -> 天面 z=head_height)
    linear_extrude(height = head_height)
        circle(r = r, $fn = 6);

    // シャンク(上面 z=0、下面 z=-shank_h)
    translate([0, 0, -shank_h])
        cylinder(h = shank_h, r = shank_d / 2, $fn = 64);
}