rotation_generator Namespace Reference


class  refAxis


def generate (normalVector, aMin=-360, aMax=360, cMin=-360, cMax=360, compound=False)
def relAngle (vec, ref)

Function Documentation

◆ generate()

def rotation_generator.generate (   normalVector,
  aMin = -360,
  aMax = 360,
  cMin = -360,
  cMax = 360,
  compound = False 
Generates Gcode rotation to align a vector (alignVector) with the positive Z axis.

It first rotates around the Z axis (C rotation)
to align the vector the positive Y axis. Then around the X axis
(A rotation).

The min and max arguments dictate the range of motion allowed rotation in
the respective axis.
Default assumes continuous rotation.

Returns a list of path commands for the shortest valid solution

If compound is False, axis moves will be broken out to individual commands

The normalVector input from a typical face (f) can be obtained like this:

    u, v = f.ParameterRange[:2]
    n = f.normalAt(u,v)
    plm = obj.getGlobalPlacement()
    rot = plm.Rotation
    normalVector = rot.multVec(n

◆ relAngle()

def rotation_generator.relAngle (   vec,
Takes a vector and a reference axis (refAxis) vector. Calculates the
relative angle.  The result is returned in degrees (plus or minus)

References relAngle().

Referenced by relAngle().