mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
shape_builder.create_axis2_placement_3d_from_matrix - small optimization
create_axis2_placement_3d now is fine with numpy arrays
This commit is contained in:
@@ -743,9 +743,7 @@ class ShapeBuilder:
|
|||||||
"""
|
"""
|
||||||
if matrix is None:
|
if matrix is None:
|
||||||
matrix = np.eye(4, dtype=float)
|
matrix = np.eye(4, dtype=float)
|
||||||
return self.create_axis2_placement_3d(
|
return self.create_axis2_placement_3d(position=matrix[:3, 3], z_axis=matrix[:3, 2], x_axis=matrix[:3, 0])
|
||||||
position=matrix[:, 3][:3].tolist(), z_axis=matrix[:, 2][:3].tolist(), x_axis=matrix[:, 0][:3].tolist()
|
|
||||||
)
|
|
||||||
|
|
||||||
def create_axis2_placement_2d(
|
def create_axis2_placement_2d(
|
||||||
self, position: VectorType = (0.0, 0.0), x_direction: Optional[VectorType] = None
|
self, position: VectorType = (0.0, 0.0), x_direction: Optional[VectorType] = None
|
||||||
|
|||||||
Reference in New Issue
Block a user