BuildingInformationModel.compute_connections
- BuildingInformationModel.compute_connections(tolerance=0.001, minimum_area=0.01, element_types=None, create_ifc_relations=True)
Detect geometric contacts between building elements and add them as connection edges.
Uses a two-stage broadphase filter:
BVH spatial search with inflated AABBs to find rough neighbours.
Tight world-space AABB overlap test to discard false positives.
Then performs face-level contact detection on remaining pairs. Discovered contacts are stored as
"connection"relationship records on the interaction graph, alongside any existing relationships.- Parameters:
- tolerancefloat, optional
Distance tolerance for the coplanarity check (metres). Default
1e-3.- minimum_areafloat, optional
Minimum area of a valid contact polygon (m²). Default
1e-2.- element_typeslist[str], optional
IFC type names to include (e.g.
["IfcWall", "IfcSlab"]). Subclass matching applies, so"IfcWall"includesIfcWallStandardCase. IfNone, all non-spatial elements with geometry are considered.- create_ifc_relationsbool, optional
If
True(default), also createIfcRelConnectsElementsentities in the IFC file so that discovered connections persist on save/reload.
- Returns:
- int
Number of new connection edges created.