vibe-openscad

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

9 run / 累計 83.1s / 累計 $0.3136

claude fable 5 bare

bare (provider default effort)

run detail →
render
bare render of tier-2-hex-bolt
loading STL…
success 8.4s · 262/467t · $0.0260
SCAD (23 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側

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

$fn = 64;

module m8_hex_bolt() {
    union() {
        // 頭部(六角柱)
        // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
        cylinder(h = head_h, d = af / cos(30), $fn = 6);

        // シャンク(z<0 側へ)
        translate([0, 0, -shank_l])
            cylinder(h = shank_l, d = shank_d);
    }
}

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.1s · 262/231t · $0.0142
SCAD (14 lines)
// M8 六角ボルト(ねじ山省略)
$fn = 64;

af = 13;          // 対辺距離
head_h = 5.3;     // 頭部高さ
shank_d = 8;      // シャンク直径
shank_l = 30;     // シャンク長さ

// 頭部(六角柱): 底面が z=0
cylinder(h = head_h, d = af / cos(30), $fn = 6);

// シャンク: z<0 方向へ
translate([0, 0, -shank_l])
    cylinder(h = shank_l, d = shank_d);
mediumnot run
high (default) success
high
8.4s · 262/467t · $0.0260
SCAD (23 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側

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

$fn = 64;

module m8_hex_bolt() {
    union() {
        // 頭部(六角柱)
        // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
        cylinder(h = head_h, d = af / cos(30), $fn = 6);

        // シャンク(z<0 側へ)
        translate([0, 0, -shank_l])
            cylinder(h = shank_l, d = shank_d);
    }
}

m8_hex_bolt();
max success
max
14.0s · 262/1094t · $0.0573
SCAD (20 lines)
// M8 六角ボルト(ねじ山省略・円柱シャンク)

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

$fn = 64;        // 円柱の滑らかさ

module hex_bolt_m8() {
    // 頭部: 六角柱(底面が z=0、上方向 +Z へ)
    // $fn=6 の cylinder は外接円基準なので、対辺距離から外接円直径に換算
    cylinder(d = af / cos(30), h = head_h, $fn = 6);

    // シャンク: z = -shank_l から z = 0 まで(-Z 側へ伸ばす)
    translate([0, 0, -shank_l])
        cylinder(d = shank_d, h = shank_l);
}

hex_bolt_m8();
xhigh success
xhigh
9.6s · 262/722t · $0.0387
SCAD (20 lines)
// M8 六角ボルト(ねじ山省略・簡易モデル)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる

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

$fn = 64;        // 円柱の滑らかさ

module hex_bolt() {
    // 頭部:六角柱(対辺距離から外接円半径を算出)
    cylinder(h = head_h, r = af / 2 / cos(30), $fn = 6);

    // シャンク:円柱(z = -shank_l から z = 0 まで)
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}

hex_bolt();

variant: thinking

offnot run
adaptive (default) success
adaptive
9.6s · 262/722t · $0.0387
SCAD (20 lines)
// M8 六角ボルト(ねじ山省略・簡易モデル)
// 頭部底面が z=0、シャンクは z<0 側へ伸びる

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

$fn = 64;        // 円柱の滑らかさ

module hex_bolt() {
    // 頭部:六角柱(対辺距離から外接円半径を算出)
    cylinder(h = head_h, r = af / 2 / cos(30), $fn = 6);

    // シャンク:円柱(z = -shank_l から z = 0 まで)
    translate([0, 0, -shank_l])
        cylinder(h = shank_l, d = shank_d);
}

hex_bolt();
dynamicnot run

iteration: iter-png

i1 success
iter 1
9.3s · 1352/479t · $0.0375
diff vs bare: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側
  
  af   = 13;    // 頭部 対辺距離 (across-flats) [mm]
  head_h = 5.3; // 頭部高さ [mm]
  shank_d = 8;  // シャンク直径 [mm]
  shank_l = 30; // シャンク長さ [mm]
  
  $fn = 64;
  
  module m8_hex_bolt() {
      union() {
          // 頭部(六角柱)
          // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
          cylinder(h = head_h, d = af / cos(30), $fn = 6);
  
          // シャンク(z<0 側へ)
          translate([0, 0, -shank_l])
              cylinder(h = shank_l, d = shank_d);
      }
  }
  
  m8_hex_bolt();
SCAD (23 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側

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

$fn = 64;

module m8_hex_bolt() {
    union() {
        // 頭部(六角柱)
        // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
        cylinder(h = head_h, d = af / cos(30), $fn = 6);

        // シャンク(z<0 側へ)
        translate([0, 0, -shank_l])
            cylinder(h = shank_l, d = shank_d);
    }
}

m8_hex_bolt();
i2 success
iter 2
9.2s · 1352/474t · $0.0372
diff vs i1: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側
  
  af   = 13;    // 頭部 対辺距離 (across-flats) [mm]
  head_h = 5.3; // 頭部高さ [mm]
  shank_d = 8;  // シャンク直径 [mm]
  shank_l = 30; // シャンク長さ [mm]
  
  $fn = 64;
  
  module m8_hex_bolt() {
      union() {
          // 頭部(六角柱)
          // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
          cylinder(h = head_h, d = af / cos(30), $fn = 6);
  
          // シャンク(z<0 側へ)
          translate([0, 0, -shank_l])
              cylinder(h = shank_l, d = shank_d);
      }
  }
  
  m8_hex_bolt();
SCAD (23 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側

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

$fn = 64;

module m8_hex_bolt() {
    union() {
        // 頭部(六角柱)
        // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
        cylinder(h = head_h, d = af / cos(30), $fn = 6);

        // シャンク(z<0 側へ)
        translate([0, 0, -shank_l])
            cylinder(h = shank_l, d = shank_d);
    }
}

m8_hex_bolt();
i3 success
iter 3
9.4s · 1352/490t · $0.0380
diff vs i2: +0/-0
  // M8 六角ボルト(ねじ山省略)
  // 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側
  
  af   = 13;    // 頭部 対辺距離 (across-flats) [mm]
  head_h = 5.3; // 頭部高さ [mm]
  shank_d = 8;  // シャンク直径 [mm]
  shank_l = 30; // シャンク長さ [mm]
  
  $fn = 64;
  
  module m8_hex_bolt() {
      union() {
          // 頭部(六角柱)
          // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
          cylinder(h = head_h, d = af / cos(30), $fn = 6);
  
          // シャンク(z<0 側へ)
          translate([0, 0, -shank_l])
              cylinder(h = shank_l, d = shank_d);
      }
  }
  
  m8_hex_bolt();
SCAD (23 lines)
// M8 六角ボルト(ねじ山省略)
// 頭部底面が z=0、頭部は +Z 側、シャンクは -Z 側

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

$fn = 64;

module m8_hex_bolt() {
    union() {
        // 頭部(六角柱)
        // cylinder の $fn=6 は外接円基準なので、対辺距離から外接円径に変換
        cylinder(h = head_h, d = af / cos(30), $fn = 6);

        // シャンク(z<0 側へ)
        translate([0, 0, -shank_l])
            cylinder(h = shank_l, d = shank_d);
    }
}

m8_hex_bolt();