-
Notifications
You must be signed in to change notification settings - Fork 60
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
Made Lofting algorithm throw Exception when side caps are invalid #999
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good in principle. One unit tests triggers the new exception, see here. We should investigate and make sure that all unit tests succeed before we merge.
As per our chat on MM: Let's make sure that this doesn't affect the TiGL performance too much. One option could be to activate the test only in debug mode (and optionally: If we have the check in debug mode only, we could use simple assertions rather than exceptions. I believe this is common for checks that are only performed in debug mode) |
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.
Can we add a simple test where this exception is thrown? We can use the same preprocessor directive in the test that only checks if the lofter throws in debug mode.
if(!BRepCheck_Analyzer(cap).IsValid()){ | ||
throw CTiglError("Error occured while building side caps. Built shape invalid."); | ||
} |
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.
if(!BRepCheck_Analyzer(cap).IsValid()){ | |
throw CTiglError("Error occured while building side caps. Built shape invalid."); | |
} | |
#ifdef DEBUG | |
if(!BRepCheck_Analyzer(cap).IsValid()){ | |
throw CTiglError("Error occured while building side caps. Built shape invalid."); | |
} | |
#endif |
Description
Throwing an exception while building the shells, using invalid side caps, prevents TiGL to build invalid solid shapes.
How Has This Been Tested?
Added test in testFuselageStandardProfileRectangle.cpp that checks for exception if side caps are invalid. If rectangular profile wires are built that cannot be used to create valid side caps, the exception is thrown.
Screenshots, that help to understand the changes(if applicable):
This solid (created by a rectangle profile with too large corner radius) is not valid. Building side caps from its closed, but entangled profile wire is not possible. Solids like this will not be built and used mistakenly, if exception is thrown.
Checklist: