blenderproc.python.modules.provider.sampler.SphereModule module

class blenderproc.python.modules.provider.sampler.SphereModule.SphereModule(config)[source]

Bases: blenderproc.python.modules.main.Provider.Provider

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

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

{
  "provider":"sampler.Sphere",
  "center":[0, 0, 0],
  "radius": 2,
  "mode": "SURFACE"
}

Configuration:

Parameter Description Type
center Location of the center of the sphere. mathutils.Vector
radius The radius of the sphere. float
mode Mode of sampling. Determines the geometrical structure used for sampling. Available: SURFACE (sampling from the 2-sphere), INTERIOR (sampling from the 3-ball). string
run()[source]
Parameters:config – A configuration object containing the parameters necessary to sample.
Returns:A random point lying inside or on the surface of a solid sphere. Type: mathutils.Vector