Skip to content
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

Merged
merged 9 commits into from
Aug 30, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/geometry/CTiglPatchShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <StdFail_NotDone.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <Geom_Plane.hxx>
#include <BRepCheck_Analyzer.hxx>

namespace
{
Expand Down Expand Up @@ -70,6 +71,9 @@ void CTiglPatchShell::AddSideCap(TopoDS_Wire const& boundaryWire)
BRepBuilderAPI_FindPlane Searcher( boundaryWire, _tolerance );
if (Searcher.Found()) {
cap = BRepBuilderAPI_MakeFace(Searcher.Plane(), boundaryWire);
if(!BRepCheck_Analyzer(cap).IsValid()){
throw CTiglError("Error occured while building side caps. Built shape invalid.");
}
merakulix marked this conversation as resolved.
Show resolved Hide resolved
Ok = true;
}
else {
Expand All @@ -78,6 +82,11 @@ void CTiglPatchShell::AddSideCap(TopoDS_Wire const& boundaryWire)
if (MF.IsDone())
{
cap = MF.Face();
#ifdef DEBUG
if(!BRepCheck_Analyzer(cap).IsValid()){
throw CTiglError("Error occured while building side caps. Built shape invalid.");
}
#endif
Ok = true;
}
}
Expand Down
Loading