feat(editor): expose printable STL export - #727
Conversation
Aymericr
left a comment
There was a problem hiding this comment.
Thanks — this is exactly the follow-up I left open in #331, and it's shaped the way I hoped: both actions stay on the fixed safe profile, preflight still gates the download, 3MF stays first as the recommended default, and the new test locks the STL path to the same profile the 3MF test does. I also checked this against #715 (the manifold/webpack module-graph problem): you don't touch the import chain, so it's neutral there — the browser-safe boundary is a separate track on my side, and nothing here makes it harder.
Two small things before I merge:
-
print-export-button.tsx—aria-busynow lies on the idle button: both buttons shareisExporting, so exporting 3MF announces the STL button as busy too. Track the in-flight format (useState<PrintModelExportFormat | null>) and setaria-busyonly on the active button. Keep both disabled during an export — that part is right, since they share one export pipeline. -
Labels: "Export 3D print 3MF" vs "Export 3D print STL files" isn't parallel, and the STL artifact is actually a zip of per-level STLs (
print_levels_1-100_<date>.zip). Make them "Export 3D print 3MF" / "Export 3D print STL" — the plural/zip detail is better carried by the downloaded filename than the button. Worth keeping them clearly distinct from the plain "Export STL" button that already lives in this panel, which "3D print" does.
The format default on preparePrintExport is only there so the old test call sites don't change — I'd make it a required parameter, but I won't hold the PR on that.
I checked for anything depending on the old "Export 3D print files" label — nothing in tests or docs references it, so the rename is safe. I've approved the workflow run; once the two items above are in I'll merge.
What does this PR do?
Exposes printable STL export in the settings panel Export section. Users can now download printable STL files (as a zip) via a dedicated button, using the same safe print profile as the existing 3MF export (
printScale: 100,printScope: levels,printContent: structure,printBase: none).Follow-up to Discussion #331 — exposes the existing internal
print-stlexport path in the Settings UI.How to test
bun devand open http://localhost:3002bun --cwd packages/editor run test -- print-export-buttonScreenshots / screen recording
Screenshot shows the new "Export 3D print STL files" button alongside the existing 3MF export in the Export panel.
Checklist
bun devbun checkto verify)mainbranchNote
Low Risk
UI-only wiring to an existing
print-stlexport path with shared preflight and options; no auth or data-model changes.Overview
Adds a dedicated Export 3D print STL files control next to the existing 3MF export in the settings Export section, replacing the single generic print export button.
preparePrintExportnow takes an optional format (print-3mforprint-stl, default unchanged) and passes it through tomodelExportwhile keeping the same fixed print options (levels, structure-only, no base, 100% scale). A unit test asserts STL uses that same profile and returns zip artifacts with STL metadata.Reviewed by Cursor Bugbot for commit ca1433a. Bugbot is set up for automated code reviews on this repo. Configure here.