DeviationVectorsGenerator

class compas_fab.robots.DeviationVectorsGenerator(axis, max_alpha, step)[source]

Bases: object

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

Parameters
  • axis (compas.geometry.Vector) – The axis about which to calculate vectors.

  • max_alpha (float) – The maximum angle in radians that a vector should deviate from the axis.

  • step (int) – 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)
>>> [zaxis for zaxis in generator]
[Vector(0.000, 0.000, -1.000), Vector(-0.866, 0.000, 0.500), Vector(0.433, 0.750, 0.500), Vector(0.433, -0.750, 0.500)]