Repository navigation
Conversation
cadquery.func.fillet and cadquery.func.chamfer called Shape() on the builder even when Build() had failed. Shape() then builds again, and the second build of BRepFilletAPI_MakeFillet / MakeChamfer segfaults inside OCCT. Check IsDone() right after Build() and raise ValueError instead. Fixes CadQuery#2114
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2132 +/- ##
=======================================
Coverage 95.81% 95.81%
=======================================
Files 30 30
Lines 9605 9609 +4
Branches 1443 1445 +2
=======================================
+ Hits 9203 9207 +4
Misses 247 247
Partials 155 155 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been 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.
cadquery.func.filletandcadquery.func.chamfercallbuilder.Shape()even whenbuilder.Build()failed.Shape()then builds again, and that second build ofBRepFilletAPI_MakeFillet/BRepFilletAPI_MakeChamfersegfaults inside OCCT, so a fillet that is too large kills the process instead of raising.This checks
IsDone()right afterBuild()and raisesValueError, the same guard #2106 added formakeNSidedSurface. The check runs before_update_history, so a failed operation is not recorded in the history. The docstrings now list theValueError.Fixes #2114
Test
test_fillet_chamfer_failureintests/test_free_functions.pyfillets and chamfers every edge of a unit box by 0.5, which cannot be built, and expectsValueError.Fatal Python error: Segmentation fault(exit 139) for bothfilletandchamfertests/test_free_functions.py74 passedblack --check(CadQuery fork) is clean.mypy cadqueryreports the same errors before and after this change (missing OCP stubs in a pip install). On a pip install on macOS arm64, the full suite gives the same results asmaster:test_interpPlatealso fails onmasterthere, andtest_examples/test_jupyterneed docutils and IPython.