blenderproc.python.utility.MathUtility module¶
-
class
blenderproc.python.utility.MathUtility.MathUtility[source]¶ Bases:
object-
static
_build_coordinate_frame_changing_transformation_matrix(destination_frame)[source]¶ Builds a transformation matrix that switches the coordinate frame.
Parameters: destination_frame ( list) – An array containing three elements, describing each axis of the destination coordinate frame based on the axes of the source frame. (Allowed values: “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”)Return type: ndarrayReturns: The transformation matrix
-
static
-
blenderproc.python.utility.MathUtility.build_transformation_mat(translation, rotation)[source]¶ Build a transformation matrix from translation and rotation parts.
Parameters: Return type: ndarrayReturns: The 4x4 transformation matrix.
-
blenderproc.python.utility.MathUtility.change_coordinate_frame_of_point(point, new_frame)[source]¶ Transforms the given point into another coordinate frame.
Example: [1, 2, 3] and [“X”, “-Z”, “Y”] => [1, -3, 2]
Parameters: - point (
Union[ndarray,list,Vector]) – The point to convert in form of a np.ndarray, list or mathutils.Vector. - new_frame (
List[str]) – An array containing three elements, describing each axis of the new coordinate frame based on the axes of the current frame. (Allowed values: “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”)
Return type: ndarrayReturns: The converted point also in form of a np.ndarray
- point (
-
blenderproc.python.utility.MathUtility.change_source_coordinate_frame_of_transformation_matrix(matrix, new_frame)[source]¶ Changes the coordinate frame the given transformation matrix is mapping from.
Given a matrix $T_A^B$ that maps from A to B, this function can be used to change the axes of A into A’ and therefore end up with $T_A’^B$.
Parameters: Return type: ndarrayReturns: The converted matrix is in form of a np.ndarray
-
blenderproc.python.utility.MathUtility.change_target_coordinate_frame_of_transformation_matrix(matrix, new_frame)[source]¶ Changes the coordinate frame the given transformation matrix is mapping to.
Given a matrix $T_A^B$ that maps from A to B, this function can be used to change the axes of B into B’ and therefore end up with $T_A^B’$.
Parameters: Return type: ndarrayReturns: The converted matrix is in form of a np.ndarray