import { BOBBIN_SEGMENTS, bobbinDimensions, bobbinProfiles, validateBobbin } from "../spinning-bobbin"; import type { CadKernel, CadParameters, Manifold } from "./kernel"; /** Original three-piece bobbin. Layout contains exactly the three printed parts; * the customer's metal shaft and adhesive are never included in the CAD solid. */ export function buildSpinningBobbin(k: CadKernel, input: CadParameters): Manifold { validateBobbin(input); const d = bobbinDimensions(input); const pieces = bobbinProfiles(input).map((profile, i) => k.move(k.keep(k.polygon(profile).revolve(BOBBIN_SEGMENTS)), [d.centers[i], 0, 0])); return k.union(...pieces); }