コード例 #1
0
def _rotate_points(plist, axisdegree):
    """Return a list of points rotated around the origin

    The rotation is defined by three angles in degrees and the rotation order is
    z, y, x, each around the newly rotated axis.

    Parameters
    ----------
    - plist: list of Vector.
    - axisdegree: Vector with angles in deg.
    """
    newlist = []
    for v in plist:
        if axisdegree.z != 0:
            rota = Rotation(Vector(0, 0, 1), axisdegree.z)
            v = rota.multVec(v)

        if axisdegree.y != 0:
            rota = Rotation(Vector(0, 1, 0), axisdegree.y)
            v = rota.multVec(v)

        if axisdegree.x != 0:
            rota = Rotation(Vector(1, 0, 0), axisdegree.x)
            v = rota.multVec(v)

        newlist.append(v)

    return newlist
コード例 #2
0
def rotatePoints(plist, axisdegree):
    newlist = []
    for v in plist:
        if axisdegree.z != 0:
            rota = Rotation(Vector(0, 0, 1), axisdegree.z)
            v = rota.multVec(v)
                  
        if axisdegree.y != 0:
            rota = Rotation(Vector(0, 1, 0), axisdegree.y)
            v = rota.multVec(v)
            
        if axisdegree.x != 0:
            rota = Rotation(Vector(1, 0, 0), axisdegree.x)
            v = rota.multVec(v)
        
        newlist.append(v)
        
    return newlist