In the following example the 3rd transform as an incorrect orientation. The Z axis isn't aligned with the chain plane
I think it must come from the parallelTransport()
from math3d.vectorN import Vector3, Vector3Array
from math3d.transformation import TransformationArray
from maya import cmds
positions = Vector3Array(
[Vector3([-7.3, 7.7, 7.5]),
Vector3([-7.5, 13.4, 1.2]),
Vector3([-2.9, 8.2, -3.6 ]),
Vector3([-0.1, 3.9, -5.3])]
)
normal = Vector3.planeNormal(*positions[:3])
chain = TransformationArray.chain(positions, normal=normal, axis="xz", negativeSide=False, endTransform=True)
for tfm in chain:
loc = cmds.spaceLocator(name="pos1")
cmds.xform(loc, matrix=tfm.asMatrix().flattened())