tier-2-hex-bolt / claude-opus-4-7
10 run / 累計 41.8s / 累計 $0.0932
prompt
OpenSCAD で、規格に準じた M8 サイズの六角ボルトを作ってください。
ねじ山自体は省略してよく、円柱のシャンクで構いません。
寸法は以下に従ってください:
- 頭部は六角柱で、対辺距離(across-flats)13mm、高さ 5.3mm
- シャンク(軸部)は直径 8mm、長さ 30mm の円柱
- ボルト全体の中心軸は +Z 軸方向
- 頭部の底面が原点(z=0)に来るように配置し、シャンクは z<0 側へ伸ばす
完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。
variant: effort
4.2s
· 267/199t · $0.0063
SCAD (14 lines)
// M8 hex bolt (threads omitted)
across_flats = 13;
head_height = 5.3;
shank_dia = 8;
shank_len = 30;
// Head: hexagonal prism, bottom at z=0
translate([0, 0, head_height/2])
cylinder(h = head_height, r = across_flats / sqrt(3), $fn = 6, center = true);
// Shank: cylinder extending into z<0
translate([0, 0, -shank_len])
cylinder(h = shank_len, d = shank_dia, $fn = 64);
—
4.0s
· 267/227t · $0.0070
SCAD (20 lines)
// M8 六角ボルト
// 頭部寸法
head_across_flats = 13;
head_height = 5.3;
// シャンク寸法
shank_diameter = 8;
shank_length = 30;
// 対辺距離から外接円半径を計算
head_radius = head_across_flats / 2 / cos(30);
// 頭部(六角柱)
translate([0, 0, 0])
cylinder(h = head_height, r = head_radius, $fn = 6);
// シャンク(円柱)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_diameter, $fn = 64);
4.6s
· 267/278t · $0.0083
SCAD (21 lines)
// M8 Hex Bolt (ISO standard, simplified without thread)
// Head: hex prism, across-flats 13mm, height 5.3mm
// Shank: cylinder, diameter 8mm, length 30mm
$fn = 64;
// Head dimensions
head_af = 13; // across-flats distance
head_height = 5.3; // head height
// Shank dimensions
shank_diameter = 8;
shank_length = 30;
// Hex head (centered, bottom at z=0)
translate([0, 0, 0])
cylinder(h = head_height, r = head_af / sqrt(3), $fn = 6);
// Shank (extends in -Z direction)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_diameter);
4.7s
· 267/309t · $0.0091
SCAD (22 lines)
// M8 hex bolt (simplified, no threads)
// Parameters
across_flats = 13; // head width across flats (mm)
head_height = 5.3; // head height (mm)
shank_dia = 8; // shank diameter (mm)
shank_len = 30; // shank length (mm)
// Derived: circumscribed circle radius from across-flats
head_radius = across_flats / sqrt(3);
module hex_bolt() {
// Head: hexagonal prism, bottom at z=0, extends to z=head_height
translate([0, 0, 0])
cylinder(h = head_height, r = head_radius, $fn = 6);
// Shank: cylinder extending downward (z<0)
translate([0, 0, -shank_len])
cylinder(h = shank_len, d = shank_dia, $fn = 64);
}
hex_bolt();
variant: thinking
4.0s
· 267/227t · $0.0070
SCAD (20 lines)
// M8 六角ボルト
// 頭部寸法
head_across_flats = 13;
head_height = 5.3;
// シャンク寸法
shank_diameter = 8;
shank_length = 30;
// 対辺距離から外接円半径を計算
head_radius = head_across_flats / 2 / cos(30);
// 頭部(六角柱)
translate([0, 0, 0])
cylinder(h = head_height, r = head_radius, $fn = 6);
// シャンク(円柱)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_diameter, $fn = 64);
adaptive (default) success →
4.7s
· 267/309t · $0.0091
SCAD (22 lines)
// M8 hex bolt (simplified, no threads)
// Parameters
across_flats = 13; // head width across flats (mm)
head_height = 5.3; // head height (mm)
shank_dia = 8; // shank diameter (mm)
shank_len = 30; // shank length (mm)
// Derived: circumscribed circle radius from across-flats
head_radius = across_flats / sqrt(3);
module hex_bolt() {
// Head: hexagonal prism, bottom at z=0, extends to z=head_height
translate([0, 0, 0])
cylinder(h = head_height, r = head_radius, $fn = 6);
// Shank: cylinder extending downward (z<0)
translate([0, 0, -shank_len])
cylinder(h = shank_len, d = shank_dia, $fn = 64);
}
hex_bolt();
—
iteration: iter-png
3.6s
· 1291/258t · $0.0129
diff vs bare: +0/-0
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);
SCAD (19 lines)
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);
3.4s
· 1291/258t · $0.0129
diff vs i1: +0/-0
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);
SCAD (19 lines)
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);
3.5s
· 1291/258t · $0.0129
diff vs i2: +0/-0
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);
SCAD (19 lines)
// M8 六角ボルト
// 頭部
// 対辺距離 13mm → 外接円直径 = 13 / cos(30) = 15.011mm
head_af = 13; // across-flats
head_height = 5.3;
head_d = head_af / cos(30);
// シャンク
shank_d = 8;
shank_length = 30;
// 頭部 (底面が z=0、上方向に伸びる)
translate([0, 0, head_height/2])
cylinder(h = head_height, d = head_d, center = true, $fn = 6);
// シャンク (z<0 側へ伸びる)
translate([0, 0, -shank_length])
cylinder(h = shank_length, d = shank_d, $fn = 64);