Fix invalid IfcGrid cartesian points (774a770)

They were saved as 4d coordinates, not 2d.
This commit is contained in:
Andrej730
2025-04-30 19:34:41 +05:00
parent 814c16d3ee
commit c7a29d5604
3 changed files with 23 additions and 9 deletions
@@ -129,6 +129,16 @@ def np_to_4x4(matrix_3x3: np.ndarray) -> np.ndarray:
return matrix_4x4
def np_apply_matrix(vectors: SequenceOfVectors, matrix: npt.NDArray) -> npt.NDArray:
"""
:param vectors: Nx3 array of vectors.
:param matrix: 4x4 transformation matrix.
"""
m3x3 = matrix[:3, :3]
translation = matrix[:3, 3]
return vectors @ m3x3.T + translation
def np_angle(a: VectorType, b: VectorType) -> float:
"""Get angle between vectors in radians.
Designed to work similar to `Vector.angle`.