export
Export printable 3D parts to organized folders as STEP, STL, 3MF, or PNG, plus print sheets, BOMs, images, and browser 3D views, ready for slicing or download.
Instructions
Export printable parts to parts//out/, sorted: print/ (3MF, STL, print sheet: for the
slicer), cad/ (STEP, GLB), images/, docs/ (BOM, view HTML), README.md. Default: every part, all variants. The
files must reach the user: on a remote server download_part brings them home.
parts: comma-separated part names from build() to build and export only those; variant: one
variant. Uses the pieces cached by an earlier build and leaves files already up to date as
they are (templates too); fresh=True builds and writes everything again.
formats: comma-separated from step (other CAD: Onshape, Fusion, FreeCAD), stl and 3mf
(slicers; 3MF keeps units), png (6-view preview + section views), glb (binary glTF, for web
and 3D apps), print (the print sheet, [_]print.md: size, filament and time
estimates, supports, tip-over, walls and infill, fits and hole compensation, PRINT_NOTES, for
the slicer, including declared hardware), hardware (versioned whole-assembly BOM JSON,
[]hardware.json), bom and bom_csv (the shopping list of that hardware as a
Markdown table, []_bom.md, and as CSV, _bom.csv; hardware_list returns it in
the result), or 'all'. Omit to use the user's formats setting (default: step, stl, 3mf and
png). Ask the user which they want if unclear.
view: a 3D view the user can turn in a browser, per variant: 'print' (default: the printable
parts on the bed), 'assembly' (assembly(d) with its stand-ins) or 'none'. Over HTTP it is a
signed link (no token, expires like the downloads); locally a self-contained HTML file in
out/docs/ (works offline). Offer it to the user after an export.
Over HTTP (a remote server) each file comes with a download link (no token needed, expires)
and a b123d-print://files/ resource link; download_part gets the whole part (script, out/,
ref/) in one zip. embed=True also puts files up to 2 MB into the result itself, for clients
that can neither fetch URLs nor read resources.
Before export, ALWAYS: check passes, design_metrics(name, style=...), suggest_orientation(name)
(the "Before printing" block of build_part and check lists what is missing). With the review
setting "warn" (default) export says what was skipped, here and on the print sheet; with
"required" it refuses until the steps are done. skip_review: only when the user said to export
without them, their reason (recorded on the print sheet).
Remote server (HTTP/SSH): the files stay on the server, as a temporary working copy deleted
when unused; bring the part home with download_part (one zip in the parts// layout).
Never use ssh, scp or a shell on the server: there is none.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| view | No | ||
| embed | No | ||
| fresh | No | ||
| parts | No | ||
| formats | No | ||
| variant | No | ||
| skip_review | No |