Repository navigation
perf(cad): import solidworks assemblies faster and skip re-parsing unchanged step files - #206
Merged
Merged
Conversation
… solidworks exports
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local CAD imports were slower than they needed to be in two cases.
SolidWorks assemblies. The two halves of the import ran back to back: SolidWorks exported every part to STEP first, and occt only started meshing once the last export was done. Now meshing starts as soon as SolidWorks writes each part. The bridge appends every finished export to
out/exported.txt, and the server reads that list four times a second and meshes each new part while SolidWorks exports the rest. Each mesh runs in the caller's scope, so cancelling an import still stops every occt worker. Parts the list misses are meshed after the bridge's result, as before. occt still runs at most two workers across imports, and STEP and IGES imports now share that limit.exportPartsnow takes apreparefunction and returns each part's geometry instead of its STEP bytes.Unchanged STEP and IGES files. A Sync of an unchanged SolidWorks file already reused the latest snapshot, but STEP and IGES files were parsed again every time. That check now covers every format. An unchanged re-sync keeps the same snapshot instead of making an identical new one, so the rollback slot no longer fills with a copy.
Results, against real SolidWorks 2025:
apps/server/scripts/local-cad-import-timing.tsreruns the comparison on any file.A first import of a STEP file is not faster. Nearly all of its time is in occt-import-js parsing the file, already on its latest release.
Proof: the timing script before on
mainand after on this branch (peak RSS under 1.6 GB), the live SolidWorks test suite with the pillow block and virtual-component samples (30 passed), the updated unchanged-file test failing against the old import and passing with the new, and a cancel 45 s into a real 87-part import that exited cleanly with its job folder removed.Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved