import { paint } from '../material/paint' /** * The mark a person looks for when they want to adjust something. * * A gear: six teeth on a rim, filled, with a hole through the middle. Drawn * rather than described, from the four numbers a gear is — how far the root * sits from the centre, how far the tip does, how wide a tooth is at each, and * how large the hole is. A path written out is 470 characters nobody can read * or move; these are the values, and the drawing follows from them. * * It was a stroked ring with eight spikes reaching out of it, which is a sun. * The reference draws a solid six-tooth gear at 20 on a 24 grid — measured on * `/swap`, where it is the one control beside the trade tabs — and a hairline * outline beside a page of solid glyphs reads as a different family of marks * whatever shape it is. * * One copy. The trade shell draws it beside its tabs and a wizard draws it * beside its heading, and two hand-written cogs are two chances for the same * control to look like two controls. */ const TEETH = 6 /** Where the rim runs, and where a tooth reaches to. */ const ROOT = 8.6 const TIP = 11.2 /** Half the angle a tooth covers, at the rim and at its tip. The taper is the * difference between the two. */ const AT_ROOT = 21 const AT_TIP = 15.5 /** The hole. */ const BORE = 3.7 const HALF = 12 const on = (turn: number, from: number) => { const rad = (turn * Math.PI) / 180 const round = (n: number) => Math.round(n * 100) / 100 return `${round(HALF + from * Math.cos(rad))} ${round(HALF + from * Math.sin(rad))}` } const gear = (() => { const step = 360 / TEETH let d = `M${on(-AT_ROOT, ROOT)}` for (let i = 0; i < TEETH; i++) { const t = i * step d += `L${on(t - AT_TIP, TIP)}L${on(t + AT_TIP, TIP)}L${on(t + AT_ROOT, ROOT)}` d += `A${ROOT} ${ROOT} 0 0 1 ${on(t + step - AT_ROOT, ROOT)}` } // The bore, wound the other way, so a nonzero fill leaves it open. return `${d}ZM${on(0, BORE)}A${BORE} ${BORE} 0 1 0 ${on(180, BORE)}A${BORE} ${BORE} 0 1 0 ${on(360, BORE)}Z` })() export function Cog({ size = 20, colour = paint.quiet }: { size?: number; colour?: string } = {}) { return ( ) }