Skip to content

Commit

Permalink
excluding time series
Browse files Browse the repository at this point in the history
  • Loading branch information
mbwinkler committed Nov 6, 2024
1 parent 42e476e commit 7737470
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions weldx/transformations/local_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,20 @@ def as_homogeneous_matrix(self, translation_unit: UnitLike) -> np.ndarray:
time_dim = 1

rotation = np.resize(self.orientation.data, (time_dim, 3, 3))
translation = np.resize(
self.coordinates.data.to(translation_unit).m, (time_dim, 3)
)
homogeneous_matrix = np.resize(np.identity(4), (time_dim, 4, 4))
homogeneous_matrix[:, :3, :3] = rotation
homogeneous_matrix[:, :3, 3] = translation
coordinates = self.coordinates
if not isinstance(coordinates, TimeSeries):
translation = np.resize(
coordinates.data.to(translation_unit).m, (time_dim, 3)
)
homogeneous_matrix = np.resize(np.identity(4), (time_dim, 4, 4))
homogeneous_matrix[:, :3, :3] = rotation
homogeneous_matrix[:, :3, 3] = translation

return np.squeeze(homogeneous_matrix)
return np.squeeze(homogeneous_matrix)
else:
raise NotImplementedError(
"Cannot convert LCS with `TimeSeries` coordinates to homogeneous matrix"
)

def _interp_time_orientation(self, time: Time) -> xr.DataArray:
"""Interpolate the orientation in time."""
Expand Down

0 comments on commit 7737470

Please sign in to comment.