Spatial
Transform
Contains transforms for spatially manipulating the root system.
This module defines the spatial transforms needed for manipulating the root system using affline transformation matrices.
- deeprootgen.spatial.transform.get_transform_matrix(roll: float = 0, pitch: float = 0, yaw: float = 0, translation: list[float] = [0, 0, 0], reflect: list[float] = [1, 1, 1, 1], scale: list[float] = [1, 1, 1, 1]) ndarray [source]
Updates the transformation matrix.
- Args:
- roll (float):
Rotation about the x-axis in degrees.
- pitch (float):
Rotation about the y-axis in degrees.
- yaw (float):
Rotation about the z-axis in degrees.
- translation (list[float]):
Translation matrix.
- reflect (list[float]):
Reflection matrix.
- scale (list[float]):
Scaling matrix.
- Returns:
- np.ndarray:
Transformation matrix.
- deeprootgen.spatial.transform.get_x_rotation_matrix(theta: float) ndarray [source]
Construct a rotation matrix for the x axis.
- Args:
- theta (float):
The x rotation angle in degrees.
- Returns:
- np.ndarray:
The x rotation matrix.
- deeprootgen.spatial.transform.get_y_rotation_matrix(theta: float) ndarray [source]
Construct a rotation matrix for the y axis.
- Args:
- theta (float):
The y rotation angle in degrees.
- Returns:
- np.ndarray:
The y rotation matrix.
- deeprootgen.spatial.transform.get_z_rotation_matrix(theta: float) ndarray [source]
Construct a rotation matrix for the z axis.
- Args:
- theta (float):
The z rotation angle in degrees.
- Returns:
- np.ndarray:
The z rotation matrix.
- deeprootgen.spatial.transform.make_homogenous(arr: array) ndarray [source]
Adds an additional ‘W’ dimension of ones to the array. Performs a conversion from Cartesian coordinates to homogenous coordinates.
- Args:
- arr (float):
The array of Cartesian coordinates.
- Returns:
- np.ndarray:
The homogenous array.