Detect non-manifold geometries using IfcOpenShell and OpenCascade
Sometimes, IFC models can contain shape representations that are not manifold. Is there a way to detect them using IfcOpenShell and OpenCascade ?
An example of shape that is not manifold
Comments
@aothms might know.
We have an implementation here in C++ https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcgeom_schema_agnostic/base_utils.cpp#L91 (which you can adapt to pythonocc if needed).
The bigger problem than (pure-topological) non-manifoldness is self-intersections I'd say. By default we already do a check on face boundary and extrusion basis self-intersections https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcgeom_schema_agnostic/wire_utils.cpp#L376 Which may lead to non-manifoldness in the shell, but self-intersecting faces is a more severe problem.
Hope that helps a bit. There's quite a few geometric problems typically in ifc models. We're also checking some aspects of those in validate.buildingsmart.org (https://github.com/buildingSMART/ifc-gherkin-rules/blob/main/features/GEM001_Closed-shell-edge-usage.feature)
A minor note that the built-in 3D print add-on in Blender also has a manifold geometry check, but that might not be what you're looking for.
Regarding the first scenario, are you considering using the topology module of OCCUtils ?
Are there models that illustrate the different cases of non-manifoldness ? I can try to generate and provide some myself
Not exhaustively, I think that would be a great idea, also when considering the different geometry modes of IFC, IfcManifoldSolidBrep, IfcTriangulatedFaceset IfcTesselatedFaceset IfcAdvancedBrep etc.
I personally don't use it because I'm familiar enough with the main OCC API..
Is what I have done very often on corroupted geometry.
All this might be possible in Python too.
cheers bernd