newton.utils.create_straight_cable_points#

newton.utils.create_straight_cable_points(start, direction, length, num_segments)[source]#

Create straight cable polyline points.

This is a convenience helper for constructing positions inputs for ModelBuilder.add_rod.

Parameters:
  • start (vec3f) – First point in world space.

  • direction (vec3f) – World-space direction of the cable (need not be normalized).

  • length (float) – Total length of the cable (meters).

  • num_segments (int) – Number of segments (edges). The number of points is num_segments + 1.

Returns:

List of wp.vec3 points of length num_segments + 1.

Return type:

list[vec3f]