TIER 4 · COMPLEX GEOMETRY·t4_02

A hex bolt: a regular hexagonal head 13mm across flats and 8mm tall, with a cylindrical shaft 10mm in diameter and 30mm long below the head.

Claude Opus 4.6Zoo ML-ephantGemini 2.5 FlashGPT-5Text2CadQuery (Qwen 3B)
CADQUERY (PYTHON)SOURCE
✗ No variable named 'result' found after exec()
import cadquery as cq
import math
from cadquery.vis import show

# --- Part 1: Hex Bolt ---
sketch_scale = 0.13

# Scaled dimensions
scaled_x1 = 0.0 * sketch_scale
scaled_y1 = 0.0275 * sketch_scale
scaled_x2 = 0.065 * sketch_scale
scaled_y2 = 0.0 * sketch_scale
scaled_x3 = 0.13 * sketch_scale
scaled_y3 = 0.0275 * sketch_scale
scaled_x4 = 0.13 * sketch_scale
scaled_y4 = 0.1025 * sketch_scale
scaled_x5 = 0.065 * sketch_scale
scaled_y5 = 0.13 * sketch_scale
scaled_x6 = 0.0 * sketch_scale
scaled_y6 = 0.1025 * sketch_scale

# Hole parameters (scaled)
hole_center_x = 0.065 * sketch_scale
hole_center_y = 0.065 * sketch_scale
hole_radius = 0.05 * sketch_scale

# Extrusion depth
extrude_depth = 0.08 + 0.08

# Create the hexagonal head
hex_head = (
    cq.Workplane("XY")
    .moveTo(scaled_x1, scaled_y1)
    .lineTo(scaled_x2, scaled_y2)
    .lineTo(scaled_x3, scaled_y3)
    .lineTo(scaled_x4, scaled_y4)
    .lineTo(scaled_x5, scaled_y5)
    .lineTo(scaled_x6, scaled_y6)
    .close()
    .extrude(extrude_depth)
)

# Create the hole
hole = (
    cq.Workplane("XY")
    .circle(hole_radius)
    .extrude(extrude_depth)
    .translate((hole_center_x, hole_center_y, 0))
)

# Cut the hole from the hex head
hex_bolt = hex_head.cut(hole)

# --- Coordinate System Transformation for Part 1 ---
hex_bolt = hex_bolt.rotate((0, 0, 0), (0, 0, 1), -90)
hex_bolt = hex_bolt.translate((0, 0.16, 0))

# Export to STL
cq
COMPARE · SAME PROMPT
Claude Opus 4.6
Zoo ML-ephant
Gemini 2.5 Flash
GPT-5
no output