Package Fabrication Files
fab_packUse this when the user wants to get a part made: packages the fabrication files into one directory plus a zip, and returns links to public instant-quote pages. Pass { file | code } and output_dir; optional scope ('part', default — one script's files; 'bom' — the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json and vendor handoff texts), name (default 'part'), formats (default step, stl, 3mf, pdf-drawing, bom-csv; add 'dxf' for flat or sheet parts), and processes ('3d-print' | 'cnc' | 'sheet-cut') to filter the links (bom: also narrows which fabricated rows are packed). Each file is written by the export tool, so its gates apply; a format that fails is reported in files[] and the rest still ship. Also writes manifest.json and README.txt. quote_links lists JLC3DP, JLCCNC, PCBWay, Xometry, SendCutSend and Craftcloud with the pack file to upload to each. One body per file: multi-body files are rejected by every shop. DXF is written only for flat or sheet-metal parts. The McMaster handoff text carries part numbers only, because McMaster quantities are packs and pack sizes are not in the catalog yet. These are plain web pages: nothing is uploaded or ordered. The user opens the link and uploads the file. Run dfm_review first if you have not. Hosted server: pack files are written on the kernelCAD server and returned in downloads[].url; nothing is uploaded to a fabrication service.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. | |
| name | No | Base file name (letters, digits, '.', '_', '-'). Default 'part'. | |
| scope | No | Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json, vendor handoff texts, and per-process quote links. | |
| formats | No | Files to include. Default step, stl, 3mf, pdf-drawing, bom-csv. | |
| processes | No | Only return quote links for these processes. Default: all. | |
| output_dir | Yes | Directory to write the pack into (created if missing). Hosted server: only the directory name is used; the pack is written in a server-owned directory and returned as download links. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||