MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / _format_clash

Function _format_clash

src/ifcquery/ifcquery/clash.py:84–95  ·  view source on GitHub ↗

Format a single clash result to dict.

(clash_result, geom_tree: ifcopenshell.geom.tree, model: ifcopenshell.file)

Source from the content-addressed store, hash-verified

82
83
84def _format_clash(clash_result, geom_tree: ifcopenshell.geom.tree, model: ifcopenshell.file) -> dict[str, Any]:
85 """Format a single clash result to dict."""
86 # clash result .a/.b are C++ wrapper entity_instances without .Name;
87 # look up the Python entity from the model by id for proper serialization
88 other = model.by_id(clash_result.b.id())
89 return {
90 "element": _ref(other),
91 "type": geom_tree.get_clash_type(clash_result.clash_type),
92 "distance": clash_result.distance,
93 "p1": list(clash_result.p1),
94 "p2": list(clash_result.p2),
95 }
96
97
98def clash(

Callers 1

clashFunction · 0.85

Calls 4

get_clash_typeMethod · 0.80
_refFunction · 0.70
by_idMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected