mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 11:46:33 +00:00
Check shell validity in accordance with https://github.com/IfcOpenShell/IfcOpenShell/commit/342cce89d70a5ded5fb1bf52d87383bfce5021ca#commitcomment-31511282
This commit is contained in:
@@ -349,17 +349,19 @@ bool IfcGeom::Kernel::create_solid_from_faces(const TopTools_ListOfShape& face_l
|
|||||||
builder.Perform();
|
builder.Perform();
|
||||||
shape = builder.SewedShape();
|
shape = builder.SewedShape();
|
||||||
|
|
||||||
{
|
BRepCheck_Analyzer ana(shape);
|
||||||
BRepCheck_Analyzer ana(shape);
|
valid_shell = ana.IsValid();
|
||||||
if (!ana.IsValid()) {
|
|
||||||
ShapeFix_Shape sfs(shape);
|
if (!valid_shell) {
|
||||||
sfs.Perform();
|
ShapeFix_Shape sfs(shape);
|
||||||
shape = sfs.Shape();
|
sfs.Perform();
|
||||||
}
|
shape = sfs.Shape();
|
||||||
|
|
||||||
|
BRepCheck_Analyzer reana(shape);
|
||||||
|
valid_shell = reana.IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
BRepCheck_Analyzer ana(shape);
|
valid_shell &= count(shape, TopAbs_SHELL) > 0;
|
||||||
valid_shell = ana.IsValid() != 0 && count(shape, TopAbs_SHELL) > 0;
|
|
||||||
} catch (const Standard_Failure& e) {
|
} catch (const Standard_Failure& e) {
|
||||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||||
Logger::Error(e.GetMessageString());
|
Logger::Error(e.GetMessageString());
|
||||||
|
|||||||
Reference in New Issue
Block a user