mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix linking project missing offsets for instances of complex geometry
After ba2456a if main IFC project had an offset and linked object had more than 333 faces, then it was imported at it's original location instead, missing an offset.
Also processing occurrences should be now more optimized, since we reuse the same verts buffer instead of recreating it 10 times.
This commit is contained in:
@@ -157,6 +157,20 @@ def np_angle_signed(a: VectorType, b: VectorType) -> float:
|
||||
return np.arctan2(det, dot)
|
||||
|
||||
|
||||
def np_translation_matrix(vector: VectorType) -> npt.NDArray[np.float64]:
|
||||
"""Get translation matrix.
|
||||
|
||||
Designed to be similar to mathutils Matrix.Rotation but to use numpy.
|
||||
|
||||
:param vector: 3D translation vector.
|
||||
:return: An 4x4 identity matrix with a translation
|
||||
"""
|
||||
eye = np.eye(4, dtype=np.float64)
|
||||
M_TRANSLATION = (slice(0, 3), 3)
|
||||
eye[M_TRANSLATION] = vector
|
||||
return eye
|
||||
|
||||
|
||||
def np_rotation_matrix(
|
||||
angle: float, size: int, axis: Optional[Union[Literal["X", "Y", "Z"], VectorType]] = None
|
||||
) -> np.ndarray:
|
||||
|
||||
Reference in New Issue
Block a user