DeviationVectorsGenerator

class compas_fab.robots.DeviationVectorsGenerator[source]

Bases: object

Calculates equally distributed vectors that deviate from the specified one by a maximal angle of max_alpha.

Parameters:
axiscompas.geometry.Vector

The axis about which to calculate vectors.

max_alphafloat

The maximum angle in radians that a vector should deviate from the axis.

stepint

The number of how often to divide max_angle.

Yields:
list of compas.geometry.Vector

Examples

>>> generator = DeviationVectorsGenerator((0, 0, -1), math.radians(120), 1)
>>> [print(zaxis) for zaxis in generator]
Vector(x=0.000, y=0.000, z=-1.000)
Vector(x=-0.866, y=0.000, z=0.500)
Vector(x=0.433, y=0.750, z=0.500)
Vector(x=0.433, y=-0.750, z=0.500)
[None, None, None, None]