scene_synthesizer.utils.sample_volume_mesh

scene_synthesizer.utils.sample_volume_mesh(mesh, count, seed=None)

Use rejection sampling to produce points randomly distributed in the volume of a mesh. This is the same as trimesh.sample.volume_mesh but using a specified RNG.

Parameters:
  • mesh (trimesh.Trimesh) – Geometry to sample

  • count (int) – Number of points to return

  • seed (int, numpy.random._generator.Generator, optional) – A seed or random number generator. Defaults to None which creates a new default random number generator.

Returns:

Points in the volume of the mesh where n <= count

Return type:

(n, 3) float