# Tenacious B - @Seve somthing like this is int t...
Channel: #contributor
Source: https://discord.com/channels/1233487248129921135/1571014290582933545
Started: 2026-11-14T04:09:55.309000+00:00
Last activity: 2026-11-14T04:14:47.090000+00:00
## Tenacious B — 2026-11-14T04:09:54.909000+00:00
<@757706909351411845> somthing like this is int the works:
```tsx
/**
* ISO-style hex bolt and nut, sized from the metric thread table. The hex heads get the classic
* 30° chamfer by intersecting the prism with a double cone; threads are cosmetic grooves.
*/
import { defineParams, type ParamValues } from "tscad"
/** ISO 4014/4032 dimensions: thread Ø → [pitch, across-flats, head height, nut height]. */
const METRIC = {
M3: [0.5, 5.5, 2, 2.4],
M4: [0.7, 7, 2.8, 3.2],
M5: [0.8, 8, 3.5, 4.7],
M6: [1, 10, 4, 5.2],
M8: [1.25, 13, 5.3, 6.8],
M10: [1.5, 16, 6.4, 8.4],
M12: [1.75, 18, 7.5, 10.8],
} as const
export const params = defineParams({
size: { type: "choice", default: "M8", options: Object.keys(METRIC) as (keyof typeof METRIC)[], label: "Thread" },
length: { type: "number", default: 30, min: 8, max: 120, step: 1, unit: "mm", label: "Shank length" },
grooves: { type: "boolean", default: true, label: "Cosmetic thread" },
gap: { type: "number", default: 12, min: 0, max: 60, step: 1, unit: "mm", label: "Nut position" },
})
/** A hexagonal prism with both ends chamfered at 30°, standing on z = 0. */
function ChamferedHex({ acrossFlats, height, z = 0 }: { acrossFlats: number; height: number; z?: number }) {
const R = acrossFlats / Math.sqrt(3) // circumradius
const r0 = acrossFlats * 0.475 // chamfer starts just inside the flats
const r1 = R * 1.05 // ...and clears the corners
const c = (r1 - r0) * Math.tan(Math.PI / 6) // 30° chamfer
return (
{/* a barrel with 30° conical ends: cuts the chamfer at both ends of the prism */}
)
}
export default function BoltAndNut(p: ParamValues) {
const d = Number(p.size.slice(1))
const [pitch, af, headH, nutH] = METRIC[p.size]
const grooveCount = Math.floor((p.length * 0.7) / pitch)
return (
{/* shank with a chamfered tip */}
{/* cosmetic thread: a stack of shallow V-grooves along the lower 70% */}
{p.grooves && (
)}
)
}
```
## Seve — 2026-11-14T04:14:42.443000+00:00
amazing
## Seve — 2026-11-14T04:14:47.090000+00:00
yea this is exactly what we need