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.
Track in-flight format for aria-busy, align button labels, and make preparePrintExport format required. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the review @Aymericr, addressed both items (plus making
|
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 unchanged preflight and export options; no auth or data-model changes.Overview
Adds a second Export 3D print STL control next to the existing 3MF button in the settings Export section, so users can download printable STL (zip) from the same UI.
preparePrintExportnow takes an explicitprint-3mforprint-stlformat instead of always callingprint-3mf; both paths still use the same fixed safe print options (scale, levels scope, structure content, no base). Export loading state tracks which format is running so one export disables both buttons and sets per-buttonaria-busy. Tests pass the format argument and assert STL uses the same profile as 3MF.Reviewed by Cursor Bugbot for commit e67e701. Bugbot is set up for automated code reviews on this repo. Configure here.