Transforms in 3D¶
Transform 3D points between frames¶
- py123d.geometry.transform.convert_absolute_to_relative_points_3d_array(origin, points_3d_array)[source]¶
Converts 3D points from the absolute frame to the relative frame.
- Parameters:
- Raises:
TypeError – If the origin is not a PoseSE3 or np.ndarray.
- Return type:
- Returns:
The 3D points in the relative frame, indexed by
Point3DIndex.
- py123d.geometry.transform.convert_relative_to_absolute_points_3d_array(origin, points_3d_array)[source]¶
Converts 3D points from the relative frame to the absolute frame.
- Parameters:
- Raises:
TypeError – If the origin is not a PoseSE3 or np.ndarray.
- Return type:
- Returns:
The 3D points in the absolute frame, indexed by
Point3DIndex.
- py123d.geometry.transform.convert_points_3d_array_between_origins(from_origin, to_origin, points_3d_array)[source]¶
Converts 3D points from one origin frame to another origin frame.
- Parameters:
from_origin (
Union[PoseSE3,ndarray[tuple[Any,...],dtype[float64]]]) – The source origin state in the absolute frame, as a PoseSE3 or np.ndarray.to_origin (
Union[PoseSE3,ndarray[tuple[Any,...],dtype[float64]]]) – The target origin state in the absolute frame, as a PoseSE3 or np.ndarray.points_3d_array (
ndarray[tuple[Any,...],dtype[float64]]) – The 3D points in the source origin frame.
- Raises:
TypeError – If the origins are not PoseSE3 or np.ndarray.
- Return type:
- Returns:
The 3D points in the target origin frame, indexed by
Point3DIndex.
Transform SE3 poses between frames¶
- py123d.geometry.transform.convert_absolute_to_relative_se3_array(origin, se3_array)[source]¶
Converts an SE3 array from the absolute frame to the relative frame.
- Parameters:
- Raises:
TypeError – If the origin is not a PoseSE3 or np.ndarray.
- Return type:
- Returns:
The SE3 array in the relative frame, indexed by
PoseSE3Index.
- py123d.geometry.transform.convert_relative_to_absolute_se3_array(origin, se3_array)[source]¶
Converts an SE3 array from the relative frame to the absolute frame.
- Parameters:
- Raises:
TypeError – If the origin is not a PoseSE3 or np.ndarray.
- Return type:
- Returns:
The SE3 array in the absolute frame, indexed by
PoseSE3Index.
- py123d.geometry.transform.convert_se3_array_between_origins(from_origin, to_origin, se3_array)[source]¶
Converts an SE3 array from one origin frame to another origin frame.
- Parameters:
from_origin (
Union[PoseSE3,ndarray[tuple[Any,...],dtype[float64]]]) – The source origin state in the absolute frame, as a PoseSE3 or np.ndarray.to_origin (
Union[PoseSE3,ndarray[tuple[Any,...],dtype[float64]]]) – The target origin state in the absolute frame, as a PoseSE3 or np.ndarray.se3_array (
ndarray[tuple[Any,...],dtype[float64]]) – The SE3 array in the source origin frame.
- Raises:
TypeError – If the origins are not PoseSE3 or np.ndarray.
- Return type:
- Returns:
The SE3 array in the target origin frame, indexed by
PoseSE3Index.
Translation along frame axes¶
- py123d.geometry.transform.translate_se3_along_body_frame(pose_se3, vector_3d)[source]¶
Translates a SE3 state along a vector in the body frame.
- py123d.geometry.transform.translate_se3_along_x(pose_se3, distance)[source]¶
Translates a SE3 state along the X-axis.
- py123d.geometry.transform.translate_se3_along_y(pose_se3, distance)[source]¶
Translates a SE3 state along the Y-axis.
- py123d.geometry.transform.translate_se3_along_z(pose_se3, distance)[source]¶
Translates an SE3 state along the Z-axis.
- py123d.geometry.transform.translate_3d_along_body_frame(points_3d, quaternions, translation)[source]¶
Translates 3D points along a vector in the body frame defined by quaternions.
- Parameters:
points_3d (
ndarray[tuple[Any,...],dtype[float64]]) – Array of 3D points, index byPoint3DIndex.quaternions (
ndarray[tuple[Any,...],dtype[float64]]) – Array of quaternions, index byQuaternionIndex.translation (
ndarray[tuple[Any,...],dtype[float64]]) – Array of translation vectors, index byVector3DIndex.
- Return type:
- Returns:
The translated 3D points in the world frame, index by
Point3DIndex.