Format a single clash result to dict.
(clash_result, geom_tree: ifcopenshell.geom.tree, model: ifcopenshell.file)
| 82 | |
| 83 | |
| 84 | def _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 | |
| 98 | def clash( |
no test coverage detected