small optimization

This commit is contained in:
Andrej730
2024-04-19 18:46:44 +05:00
parent 589b98053e
commit 9e79499532
3 changed files with 33 additions and 30 deletions
@@ -121,10 +121,10 @@ def get_local_placement(placement: ifcopenshell.entity_instance) -> MatrixType:
"""
if placement is None:
return np.eye(4)
if placement.PlacementRelTo is None:
if (rel_to := placement.PlacementRelTo) is None:
parent = np.eye(4)
else:
parent = get_local_placement(placement.PlacementRelTo)
parent = get_local_placement(rel_to)
return np.dot(parent, get_axis2placement(placement.RelativePlacement))