blenderproc.python.sampler.Sphere module

Samples a point from the surface or from the interior of solid sphere.

blenderproc.python.sampler.Sphere.sphere(center, radius, mode)[source]

Samples a point from the surface or from the interior of solid sphere.

https://math.stackexchange.com/a/87238 https://math.stackexchange.com/a/1585996

Example 1: Sample a point from the surface of the solid sphere of a defined radius and center location.

Sphere.sample(
    center=Vector([0, 0, 0]),
    radius=2,
    mode="SURFACE"
)
Parameters:
  • center (Union[Vector, ndarray, list]) – Location of the center of the sphere.

  • radius (float) – The radius of the sphere.

  • mode (str) – Mode of sampling. Determines the geometrical structure used for sampling. Available: SURFACE (sampling from the 2-sphere), INTERIOR (sampling from the 3-ball).

Return type:

ndarray