-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add tol to cut and intersect #1332
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1332 +/- ##
=======================================
Coverage 94.29% 94.30%
=======================================
Files 26 26
Lines 5575 5583 +8
Branches 950 954 +4
=======================================
+ Hits 5257 5265 +8
Misses 187 187
Partials 131 131
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
One thing that I think is expected behavior but seems like it could confuse users, is that setting the tolerance too high will lead to no resulting geometry, with no error. The following code shows nothing in CQ-editor, but does not throw an error either. import cadquery as cq
box1 = cq.Workplane().box(10, 10, 10)
box2 = cq.Workplane().center(5, 5).box(10, 10, 10)
res = box2.intersect(box1, tol=3.0)
show_object(res) That is a contrived example, but it is not hard to imagine that it will happen with lower tolerances with complex geometry. There have been a few models in the KiCAD library that had fuse glitches. In those cases the issue was solved by shifting parts and/or breaking sharp edges between geometries, but I think there is potential there for the same kinds of issues with |
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.
I made one comment, but the code looks good to me and works as I expected when experimenting with it in CQ-editor. Thanks @adam-urbanczyk !
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. I've done some manual testing and did not find any problem.
Adds fuzzy cut and intersect