points_mapper
align_with_z_axis(polar_axis, normalized=False)
Calculate the rotation matrix to align the polar axis with the z-axis.
cartesian_to_spherical(coords)
closed_mesh_to_plane(coords, center=None, polar_axis=None)
Map points on a closed mesh onto a 2D plane.
First, the coordinates are projected on a sphere. Next, the polar angles are mapped from [0, pi] to [pi/2, pi]. Finally, the coordinates are projected onto the xy-plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords |
ndarray
|
Numpy array of 3D cartesian coordinates. |
required |
center |
ndarray
|
Numpy array of 3D center coordinates. If None, center is set to the mean of all coordinates. Defaults to None. |
None
|
polar_axis |
ndarray
|
Numpy array of a 3D vector. The coordinates are first rotated so that the polar axis aligns with the z-axis. Defaults to [0, 0, 1]. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
2D cartesian coordinates. |
closed_mesh_to_sphere(coords, center=None, polar_axis=None)
Map points on a closed mesh onto a spher.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords |
ndarray
|
Numpy array of 3D cartesian coordinates. |
required |
center |
ndarray
|
Numpy array of 3D center coordinates. If None, center is set to the mean of all coordinates. Defaults to None. |
None
|
polar_axis |
ndarray
|
Numpy array of a 3D vector. The coordinates are first rotated so that the polar axis aligns with the z-axis. Defaults to [0, 0, 1] |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ndarray |
ndarray
|
3D cartesian coordinates. |