Skip to content

feat(editor): add print-ready model exports - #701

Merged
Aymericr merged 19 commits into
mainfrom
feat/print-ready-export
Aug 21, 2026
Merged

feat(editor): add print-ready model exports#701
Aymericr merged 19 commits into
mainfrom
feat/print-ready-export

Conversation

@Aymericr

@Aymericr Aymericr commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an experimental print-ready export path to the editor while preserving the existing GLB, STL, and OBJ exports unchanged.

  • Exports millimeter, Z-up 3MF packages or binary STL fallbacks.
  • Supports architectural-only or full-scene content, per-level parts, optional separate plinths, scale, and minimum-feature preflight.
  • Compiles structural shells with Manifold in a worker and reports disconnected components, winding, thickness, and unsupported geometry.
  • Keeps manufacturing logic inside @pascal-app/editor; @pascal-app/viewer has no diff from main.
  • Cleans up temporary geometry and invalidates stale async preparation results.
  • Adds deterministic golden-house coverage plus classic STL/OBJ visibility regression tests.

How to test

  1. Open the editor Settings panel and confirm Export GLB, Export STL, and Export OBJ still appear and work through the existing path.
  2. In Print files, choose scope, scale, format, base, and output; prepare a visible level and download the generated package.
  3. Run bun check, bun run test, bun run check-types, and bun run build.

Screenshots / screen recording

Local production-build smoke test at 1440 x 1000 confirmed the classic export controls and print-ready card render together without console or page errors.

Checklist

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

Note

Medium Risk
Large new mesh-compilation and export pipeline (Manifold worker, CSG topology checks) can produce incorrect or blocked print files, but it is editor-only and does not change auth or persisted scene data.

Overview
Adds an experimental print-ready export path in Settings: millimeter, Z-up 3MF (or binary STL) with scale, structure-vs-everything content, whole-scene or per-level packages, optional plinth, and a prepare/preflight step before download.

Structural prints compile canonical solids with Manifold in a worker, then run topology/volume/winding checks and optional minimum-feature thickness against wall/slab/roof semantics. Blocked reports prevent download; spanning stairs/elevators are omitted from level parts.

Classic GLB/STL/OBJ remain, now with a visible-nodes-only toggle (hidden nodes pruned by default). Export returns artifacts instead of always downloading immediately. A Settings sidebar tab is added in the editor app.

Reviewed by Cursor Bugbot for commit fcf8202. Bugbot is set up for automated code reviews on this repo. Configure here.

@Aymericr
Aymericr merged commit 91e78dc into main Aug 21, 2026
4 checks passed
@Aymericr
Aymericr deleted the feat/print-ready-export branch August 21, 2026 21:24

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fcf8202. Configure here.

}
} finally {
if (generation === generationRef.current) setIsPreparing(false)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overlapping print prepares race

High Severity

Changing any print option or nodes while a prepare is running bumps generationRef and forces isPreparing back to false, even though the in-flight modelExport keeps going. Inputs stay editable during prepare, so a second prepare can start immediately. Those calls share a non-refcounted setExporting flag, so the first finish can clear exporting before the second clones, leaving instanced plants as proxy colliders in the later artifact.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fcf8202. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant