get_shape_matrix - small optimization

reuse existing matrix instead of recreating new
This commit is contained in:
Andrej730
2025-01-13 14:43:08 +05:00
parent 5c0a7af830
commit 7a49f1611e
@@ -145,7 +145,7 @@ def get_shape_matrix(shape: ShapeElementType) -> MatrixType:
:param shape: Shape output calculated by IfcOpenShell
:return: A 4x4 numpy array representing the transformation matrix
"""
return np.array(shape.transformation.matrix).reshape((4, 4), order="F")
return np.frombuffer(shape.transformation_buffer, "d").reshape((4, 4), order="F")
def get_bbox_centroid(geometry: ShapeType) -> tuple[float, float, float]: