-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify STL export to enable non-relative tolerancing and speed up export. #1432
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1432 +/- ##
==========================================
- Coverage 94.32% 94.31% -0.01%
==========================================
Files 28 28
Lines 5813 5809 -4
Branches 994 993 -1
==========================================
- Hits 5483 5479 -4
Misses 198 198
Partials 132 132 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor tweak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mesh.Perform() is called by the constructor, so calling it again doubles runtime
Unfortunately I cannot reproduce the doubled runtime or performance benefit of removing the call. I agree the the Perform call can be removed.
I believe OCCT skips building the mesh again if it already exists.
I did find significant performance improvement with the parallel option enabled.
In one example, time to generate a large mesh with 4.5e6 facets, ~220MB STL file, was 18 seconds vs 122 seconds.
I'd suggest to enable the parallel flag by default. It is enabled for boolean operations:
cadquery/cadquery/occ_impl/shapes.py
Line 1053 in 7bc8c00
parallel: bool = True, |
Interesting the difference here - I’m running Windows + Pip package, I wonder if that’s a source of the difference
Can do - I only did not in order to not change any current behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some bike-shedding
Thanks @brhubbar ! |
First off, thank you for building this tool - it's been awesome to get to know! Greatly appreciate the API and the comments contained throughout, and it has saved me a lot of headache!
In the event that a model has very large and very small geometries, relative sizing for the mesh results in one of those scales being severely over- or under-resolved. For example, a dodecagon might be sufficient for a small hole, but a large hole requires many more facets to be properly represented. With relative sizing, getting the large hole up to a sufficient resolution results in the small hole meshing down to sizes that approach floating point errors and result in geometry collapses.
Also, the docs explicitly state that mesh.Perform() is called by the constructor, so calling it again doubles runtime with no change in the result (that I've been able to observe)
None of the changes here modify the existing default behavior.
This PR is ready for review ✔️