Skip to content

Commit d722547

Browse files
committed
Fuse openshells containig 1 single face
1 parent 596165f commit d722547

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/cpp/web-ifc/geometry/IfcGeometryProcessor.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,37 @@ namespace webifc::geometry
572572
mesh.children.push_back(temp);
573573
}
574574

575+
int unitaryFaces = 0;
576+
for(auto &child : mesh.children)
577+
{
578+
auto temp = _expressIDToGeometry[child.expressID];
579+
if(temp.numFaces < 4)
580+
{
581+
unitaryFaces++;
582+
}
583+
}
584+
585+
IfcGeometry newGeometry;
586+
if(unitaryFaces > 12)
587+
{
588+
for(auto &child : mesh.children)
589+
{
590+
auto temp = _expressIDToGeometry[child.expressID];
591+
newGeometry.AddGeometry(temp);
592+
}
593+
IfcComposedMesh newMesh;
594+
_expressIDToGeometry[expressID] = newGeometry;
595+
std::optional<glm::dvec4> shellColor = GetStyleItemFromExpressId(expressID);
596+
if (shellColor) {
597+
newMesh.color=shellColor.value();
598+
newMesh.hasColor=true;
599+
}
600+
newMesh.expressID = expressID;
601+
newMesh.hasGeometry = true;
602+
newMesh.transformation = glm::dmat4(1);
603+
return newMesh;
604+
}
605+
575606
return mesh;
576607
}
577608
case schema::IFCADVANCEDBREP:

0 commit comments

Comments
 (0)