Skip to content

feat(editor): expose printable STL export - #727

Open
nicemit wants to merge 1 commit into
pascalorg:mainfrom
nicemit:feat/expose-print-stl-export
Open

feat(editor): expose printable STL export#727
nicemit wants to merge 1 commit into
pascalorg:mainfrom
nicemit:feat/expose-print-stl-export

Conversation

@nicemit

@nicemit nicemit commented Aug 28, 2026

Copy link
Copy Markdown

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-stl export path in the Settings UI.

How to test

  1. Run bun dev and open http://localhost:3002
  2. Open or create a project with printable geometry
  3. Open the sidebar → Export section
  4. Confirm both Export 3D print 3MF and Export 3D print STL files buttons are visible
  5. Click Export 3D print STL files — a zip should download
  6. Click Export 3D print 3MF — still works as before
  7. Run bun --cwd packages/editor run test -- print-export-button

Screenshots / screen recording

Screenshot_20260828_140351

Screenshot shows the new "Export 3D print STL files" button alongside the existing 3MF export in the Export panel.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Low Risk
UI-only wiring to an existing print-stl export 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.

preparePrintExport now takes an optional format (print-3mf or print-stl, default unchanged) and passes it through to modelExport while 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.

@nicemit
nicemit marked this pull request as ready for review August 28, 2026 08:50

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. print-export-button.tsxaria-busy now lies on the idle button: both buttons share isExporting, so exporting 3MF announces the STL button as busy too. Track the in-flight format (useState<PrintModelExportFormat | null>) and set aria-busy only on the active button. Keep both disabled during an export — that part is right, since they share one export pipeline.

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants