From 5f86c6d1c2e4fbcd50939ca17062414d172e3578 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 3 Mar 2025 13:45:48 +0500 Subject: [PATCH] shape_builder.create_axis2_placement_3d_from_matrix - small optimization create_axis2_placement_3d now is fine with numpy arrays --- src/ifcopenshell-python/ifcopenshell/util/shape_builder.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py index fb33cdbede..952ebae5ab 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py +++ b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py @@ -743,9 +743,7 @@ class ShapeBuilder: """ if matrix is None: matrix = np.eye(4, dtype=float) - return self.create_axis2_placement_3d( - position=matrix[:, 3][:3].tolist(), z_axis=matrix[:, 2][:3].tolist(), x_axis=matrix[:, 0][:3].tolist() - ) + return self.create_axis2_placement_3d(position=matrix[:3, 3], z_axis=matrix[:3, 2], x_axis=matrix[:3, 0]) def create_axis2_placement_2d( self, position: VectorType = (0.0, 0.0), x_direction: Optional[VectorType] = None