Euclidian Transformations


EuclideanTransform

Class containing the Euclidian transforms which can be applied to a geometry.

transformations: list property

All the Euclidian transformations which were applied to the geometry in chronological order.

Returns:
  • list

    List of Euclidian transformations.

center: np.ndarray | tuple | list property

Center of mass of the geometry.

Returns:
  • ndarray | tuple | list

    Position vector of the center of mass of the geometry.

scale: float | list property

Scale factor of the geometry.

Returns:
  • float | list

    Scale factor.

rotation_matrix: np.ndarray property

Rotation matrix applied to the geometry.

Returns:
  • ndarray

    Rotation matrix (3, 3).

rotation_axis: np.ndarray | tuple | list property

Vector representing the axis of rotation.

Returns:
  • ndarray | tuple | list

    Axis of rotation.

rotation_angle: float | int property

Angle by which the geometry is rotated around the axis of rotation.

Returns:
  • float | int

    Angle of rotation.

set_location(center)

Set the position of the geometry in 3D space.

Parameters:
  • center (ndarray | tuple | list) –

    3vector which defines the new position of the geometry.

move(move_vector)

Move the geometry by a vector.

Parameters:
  • move_vector (ndarray | tuple | list) –

    3vector by which the geometry is moved.

set_scale(scale)

Sets the scaling of the geometry.

Parameters:
  • scale (float | int) –

    Scaling factor.

rescale(scale)

Multiplies the existing scaling of the geometry by the scale factor.

Parameters:
  • scale (float | int) –

    Scale factor.

get_rotation_matrix(angle, axis) staticmethod

Get the rotation matrix from the rotation angle and axis of rotation.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

Returns:
  • tuple

    Rotation matrix (3, 3).

set_rotation(angle, axis)

Sets the rotation matrix from the rotation angle and axis.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

rotate_rotvec(angle, axis)

Multiplies the previous existing rotation matrix by a rotation matrix calculated from the angle and axis of rotation.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

rotate_matrix(rotation_matrix)

Multiplies the previous existing rotation matrix by a given rotation matrix.

Parameters:
  • rotation_matrix (ndarray | tuple | list) –

    Rotation matrix (3, 3).

rotate(*inputs)

Rotates the geometry by a rotation matrix or a rotation vector.

Parameters:
  • inputs (ndarray | tuple, default: () ) –

    Rotation metrix or angle and axis vector.

apply(function_, co_, params_)

Apply the transformations to the geometry (SDF).

Parameters:
  • function_ (Callable[[ndarray, tuple], ndarray]) –

    Original SDF

  • co_ (ndarray) –

    Point cloud of coordinates with shape (D, N); D - number of dimensions (2 or 3); N - number of points in the point cloud.

  • params_ (tuple) –

    Parameters of the SDF.

Returns:
  • ndarray

    Signed Distance field of shape (N,).

EuclideanTransformPoints

Class containing the Euclidian transforms which can be applied to a point cloud.

transformations: list property

All the Euclidian transformations which were applied to the point cloud in chronological order.

Returns:
  • list

    List of Euclidian transformations.

center: np.ndarray | tuple | list property

Center of mass of the point cloud.

Returns:
  • ndarray | tuple | list

    Position vector of the center of mass of the point cloud.

scale: np.ndarray | tuple | list | float | int property

Scale factors of the point cloud.

Returns:
  • ndarray | tuple | list | float | int

    Scale factor.

rotation_matrix: np.ndarray property

Rotation matrix applied to the point cloud.

Returns:
  • ndarray

    Rotation matrix (3, 3).

rotation_axis: np.ndarray | tuple | list property

Vector representing the axis of rotation.

Returns:
  • ndarray | tuple | list

    Axis of rotation.

rotation_angle: float | int property

Angle by which the point cloud is rotated around the axis of rotation.

Returns:
  • float | int

    Angle of rotation.

set_location(center)

Set the position of the point cloud in 3D space.

Parameters:
  • center (ndarray | tuple | list) –

    3vector which defines the new position of the point cloud.

move(move_vector)

Move the point cloud by a vector.

Parameters:
  • move_vector (ndarray | tuple | list) –

    3vector by which the point cloud is moved.

set_scale(scale)

Sets the scaling of the point cloud.

Parameters:
  • scale (ndarray | tuple | list | float | int) –

    Scaling factors.

rescale(scale)

Multiplies the existing scaling of the point cloud by the scale factors.

Parameters:
  • scale (ndarray | tuple | list | float | int) –

    Scale factors.

get_rotation_matrix(angle, axis) staticmethod

Get the rotation matrix from the rotation angle and axis of rotation.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

Returns:
  • tuple

    Rotation matrix (3, 3).

set_rotation(angle, axis)

Sets the rotation matrix from the rotation angle and axis.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

rotate_rotvec(angle, axis)

Multiplies the previous existing rotation matrix by a rotation matrix calculated from the rotation angle and axis of rotation.

Parameters:
  • angle (float | int) –

    Angle of rotation.

  • axis (ndarray | tuple | list) –

    Axis of rotation.

rotate_matrix(rotation_matrix)

Multiplies the previous existing rotation matrix by a given rotation matrix.

Parameters:
  • rotation_matrix (ndarray | tuple | list) –

    Rotation matrix (3, 3).

rotate(*inputs)

Rotates by a rotation matrix or a rotation vector.

Parameters:
  • inputs (ndarray | tuple, default: () ) –

    Rotation metrix or angle and axis vector.

apply(points_)

Apply the transformations to the point cloud.

Parameters:
  • points_ (ndarray) –

    Point cloud of shape (D, N)

Returns:
  • ndarray

    Transformed point cloud of shape (D, N).