blenderproc.python.sampler.Disk module¶
-
class
blenderproc.python.sampler.Disk.
Disk
[source]¶ Bases:
object
-
blenderproc.python.sampler.Disk.
disk
(center, radius, rotation=None, sample_from='disk', start_angle=0, end_angle=180)[source]¶ - 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.
Disk.sample( center=[0, 0, 4], radius=7, sample_from="circle" )
Example 2: Sample a point from a sector.
Disk.sample( center=[0, 0, 4], radius=7, sample_from="sector", start_angle=0, end_angle=90 )
Parameters: - center (
Union
[Vector
,ndarray
,List
[float
]]) – Center (in 3d space) of a 2d geometrical shape to sample from. - radius (
float
) – The radius of the disk. - rotation (
Union
[Vector
,ndarray
,List
[float
],None
]) – List of three (XYZ) Euler angles that represent the rotation of the 2d geometrical structure used for sampling in 3d space. - sample_from (
str
) – Mode of sampling. Defines the geometrical structure used for sampling, i.e. the shape to sample from. - start_angle (
float
) – 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. - end_angle (
float
) – 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.
Return type: ndarray
Returns: A random point sampled point on a circle/disk/arc/sector.