bare-low/gpt-5-mini / tier-2-hex-bolt
success tier 2
bare (gpt 5 mini)
render
loading STL…
// 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(); prompt
OpenSCAD で、規格に準じた M8 サイズの六角ボルトを作ってください。 ねじ山自体は省略してよく、円柱のシャンクで構いません。 寸法は以下に従ってください: - 頭部は六角柱で、対辺距離(across-flats)13mm、高さ 5.3mm - シャンク(軸部)は直径 8mm、長さ 30mm の円柱 - ボルト全体の中心軸は +Z 軸方向 - 頭部の底面が原点(z=0)に来るように配置し、シャンクは z<0 側へ伸ばす 完成したコード全体を ```openscad ... ``` のフェンスで囲んで出力してください。コードのみで、追加の説明は不要です。