synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities

Module for agglomeration utilities.

Module Contents

Functions

validate_3d_vector(→ numpy.ndarray)

Validate 3d vector.

sample_random_mass_points_in_mesh(...)

Sample random points inside of a mesh. The specified count is not matched

normalize_vector(→ numpy.ndarray)

get_random_direction(→ numpy.ndarray)

flatten_list(→ list)

synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities.validate_3d_vector(vector: numpy.ndarray | list | tuple) numpy.ndarray

Validate 3d vector.

Args:

vector (np.ndarray | list | tuple): vector in different data types

Raises:

ValueError: If vector has not exactly 3 elements.

Returns:

np.ndarray: vector as numpy array

synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities.sample_random_mass_points_in_mesh(mesh: trimesh.Trimesh, count: int) tuple[numpy.ndarray, numpy.ndarray]
Sample random points inside of a mesh. The specified count is not matched

exactly.

Args:

mesh (trimesh.Trimesh): Mesh to sample from. count (int): Approximate number of points

Returns:

tuple[np.ndarray, np.ndarray]: Number of points and associated weights.

synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities.normalize_vector(vector: numpy.ndarray) numpy.ndarray
synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities.get_random_direction() numpy.ndarray
synthpic2.recipe.synth_chain.feature_generation_steps.agglomeration.utilities.flatten_list(l: list[list]) list