-
Notifications
You must be signed in to change notification settings - Fork 96
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
Improve handling of invalid shape construction. #385
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #385 +/- ##
==========================================
+ Coverage 85.91% 86.04% +0.12%
==========================================
Files 36 36
Lines 4444 4485 +41
==========================================
+ Hits 3818 3859 +41
Misses 626 626
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ 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.
Thanks! Would you mind updating our other bindings with this new enum value?
Right, will do. |
I added an entry for |
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.
Great, thank you!
Add `InvalidConstruction` to `Manifold::Error` and return empty manifolds with it set when manifold construction is attempted with invalid parameters - zero / negative dimensions for Cube - zero / negative radius for Sphere - zero / negative height for Extrude - empty CrossSection for Extrude/Revolve Also, Circle and Square have been updated to return empty CrossSections for similar arguments.
Fixes #379
Error::InvalidConstruction
, and add checks toManifold
constructors that return empty manifolds with this error when given invalid arguments (such as negative radius)CrossSection
, returning empty cross-sectionsCube
with negative dimensions, I noticed the semantic is to return mirrored cubes. To match this inCrossSection::Square
, I added a check that reverses the winding of the path to make sure the shape is still positive.