Utilities (geomdb.utils)

geomdb.utils.apply_mask(voxel, mask)

Create a new voxelation by applying the mask.

Parameters:
  • voxel (VoxelGrid) – The input voxelation,

  • mask (ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]) – The masking array.

Return type:

VoxelGrid

Returns:

The masked voxelation.

geomdb.utils.create_mask(sparse_indices, shape)

Convert sparse indices to a masking array.

Parameters:
  • sparse_indices (ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]) – The sparse indices of shape (n,3).

  • shape (tuple[int, ...]) – Shape of the target voxelation.

Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

Returns:

The masking array for the target voxelation.

geomdb.utils.ravel(sparse_indices, shape)

Ravel sparse indices into a flat index array of shape.

Parameters:
  • sparse_indices (ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]) – The sparse indices of shape (n,3).

  • shape (tuple[int, ...]) – Shape of the target voxelation.

Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

Returns:

The flat index array of shape (n,).

geomdb.utils.resolve_dependency(req_props, edges)
Return type:

list[str]

geomdb.utils.scene_to_notebook(scene, width=200, height=200)