Skip to content

Commit 784c172

Browse files
committed
Check shell validity in accordance with IfcOpenShell@342cce8#commitcomment-31511282
1 parent 17077c7 commit 784c172

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/ifcgeom/IfcGeomFunctions.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,17 +349,19 @@ bool IfcGeom::Kernel::create_solid_from_faces(const TopTools_ListOfShape& face_l
349349
builder.Perform();
350350
shape = builder.SewedShape();
351351

352-
{
353-
BRepCheck_Analyzer ana(shape);
354-
if (!ana.IsValid()) {
355-
ShapeFix_Shape sfs(shape);
356-
sfs.Perform();
357-
shape = sfs.Shape();
358-
}
352+
BRepCheck_Analyzer ana(shape);
353+
valid_shell = ana.IsValid();
354+
355+
if (!valid_shell) {
356+
ShapeFix_Shape sfs(shape);
357+
sfs.Perform();
358+
shape = sfs.Shape();
359+
360+
BRepCheck_Analyzer reana(shape);
361+
valid_shell = reana.IsValid();
359362
}
360363

361-
BRepCheck_Analyzer ana(shape);
362-
valid_shell = ana.IsValid() != 0 && count(shape, TopAbs_SHELL) > 0;
364+
valid_shell &= count(shape, TopAbs_SHELL) > 0;
363365
} catch (const Standard_Failure& e) {
364366
if (e.GetMessageString() && strlen(e.GetMessageString())) {
365367
Logger::Error(e.GetMessageString());

0 commit comments

Comments
 (0)