From 03b277626fd112733f86ee66ade03a9e369471cb Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 8 Jun 2024 14:50:02 +1000 Subject: [PATCH] See #4832. Use shape.transformation.matrix in v0.8.0 --- src/ifcopenshell-python/ifcopenshell/util/shape.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape.py b/src/ifcopenshell-python/ifcopenshell/util/shape.py index 4b45c013e5..7280ecf76e 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/shape.py +++ b/src/ifcopenshell-python/ifcopenshell/util/shape.py @@ -158,8 +158,7 @@ def get_shape_matrix(shape) -> MatrixType: :return: A 4x4 numpy array representing the transformation matrix :rtype: MatrixType """ - m = shape.transformation.matrix.data - return np.array(([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])) + return np.array(shape.transformation.matrix).reshape((4, 4), order="F") def get_bbox_centroid(geometry) -> tuple[float, float, float]: