differt.geometry module

differt.geometry module#

Geometries for building scenes.

Classes

Paths(vertices, objects[, mask, ...])

A convenient wrapper class around path vertices and object indices.

SBRPaths(vertices, objects[, mask, ...])

Paths method generated with shooting-and-bouncing method.

TriangleMesh(vertices, triangles[, ...])

A simple geometry made of triangles.

Transformations

Utilities to transform 3D coordinates.

rotation_matrix_along_axis(angle, axis)

Return a rotation matrix to rotate coordinates along a given axis.

rotation_matrix_along_x_axis(angle)

Return a rotation matrix to rotate coordinates along x axis.

rotation_matrix_along_y_axis(angle)

Return a rotation matrix to rotate coordinates along y axis.

rotation_matrix_along_z_axis(angle)

Return a rotation matrix to rotate coordinates along z axis.

cartesian_to_spherical(xyz)

Transform Cartesian coordinates to spherical coordinates.

spherical_to_cartesian(rpa)

Transform spherical coordinates to Cartesian coordinates.

Misc

Miscellaneous utilities.

assemble_paths(from_vertices, ...[, to_vertices])

Assemble paths vertices by concatenating start-, intermediate, and end-vertices.

fibonacci_lattice(n[, dtype, frustum])

Return a lattice of vertices on the unit sphere.

merge_cell_ids(cell_ids_a, cell_ids_b)

Merge two arrays of cell indices as returned by Paths.multipath_cells.

min_distance_between_cells(cell_vertices, ...)

Compute the minimal (Euclidean) distance between vertices in different cells.

normalize(vectors[, keepdims])

Normalize vectors and also return their length.

perpendicular_vectors(u)

Generate a vector perpendicular to the input vectors.

orthogonal_basis(u)

Generate v and w, two other arrays of unit vectors that form with input u an orthogonal basis.

path_lengths(paths)

Compute the path length of each path.

triangles_contain_vertices_assuming_inside_same_plane(...)

Return whether each triangle contains the corresponding vertex, but assuming the vertex lies in the same plane as the triangle.

viewing_frustum(viewing_vertex, ...[, ...])

Compute the viewing frustum as seen by one viewer.