newton.utils.create_parallel_transport_cable_quaternions#

newton.utils.create_parallel_transport_cable_quaternions(points, *, twist_total=0.0)[source]#

Generate per-segment quaternions using a parallel-transport style construction.

The intended use is for rod/cable capsules whose internal axis is local +Z. The returned quaternions rotate local +Z to each segment direction, while minimizing twist between successive segments. Optionally, a total twist can be distributed uniformly along the cable.

Parameters:
  • points (Sequence[vec3f]) – Polyline points of length >= 2.

  • twist_total (float) – Total twist (radians) distributed along the cable (applied about the segment direction).

Returns:

List of wp.quat of length len(points) - 1.

Return type:

list[quatf]