blenderproc.python.modules.provider.sampler.DiskModule module¶
-
class
blenderproc.python.modules.provider.sampler.DiskModule.
DiskModule
(config)[source]¶ Bases:
blenderproc.python.modules.main.Provider.Provider
Samples a point on a 1-sphere (circle), or on a 2-ball (disk, i.e. circle + interior space), or on an arc/sector with an inner angle less or equal than 180 degrees. Returns a 3d mathutils.Vector sampled point.
Example 1: Sample a point from a 1-sphere.
{ "provider": "sampler.Disk", "sample_from": "circle", "center": [0, 0, 4], "radius": 7 }
Example 1: Sample a point from a sector.
{ "provider": "sampler.Disk", "sample_from": "sector", "center": [0, 0, 4], "radius": 7, "start_angle": 0, "end_angle": 90 }
Configuration:
Parameter Description Type center Center (in 3d space) of a 2d geometrical shape to sample from. mathutils.Vector radius The radius of the disk. float rotation List of three (XYZ) Euler angles that represent the rotation of the 2d geometrical structure used for sampling in 3d space. Default: [0, 0, 0]. mathutils.Vector sample_from Mode of sampling. Defines the geometrical structure used for sampling, i.e. the shape to sample from. Default: “disk”. Available: [“disk”, “circle”, “sector”, “arc”]. string start_angle Start angle in degrees that is used to define a sector/arc to sample from. Must be smaller than end_angle. Arc’s/sector’s inner angle (between start and end) must be less or equal than 180 degrees. Angle increases in the counterclockwise direction from the positive direction of X axis. Default: 0. float end_angle End angle in degrees that is used to define a sector/arc to sample from. Must be bigger than start_angle. Arc’s/sector’s inner angle (between start and end) must be less or equal than 180 degrees. Angle increases in the counterclockwise direction from the positive direction of X axis. Default: 180. float