newton.JointType#

class newton.JointType(value)[source]#

Bases: IntEnum

Enumeration of joint types supported in Newton.

constraint_count(num_axes)#

Returns the number of velocity-level bilateral kinematic constraints for this joint type.

Parameters:

num_axes (int) – The number of DoF axes for the joint.

Returns:

The number of bilateral kinematic constraints for the joint.

Return type:

int

Notes

  • For PRISMATIC and REVOLUTE joints, this equals 5 (single DoF axis).

  • For FREE and DISTANCE joints, cts_count = 0 since it yields no constraints.

  • For FIXED joints, cts_count = 6 since it fully constrains the associated bodies.

dof_count(num_axes)#

Returns the number of degrees of freedom (DoF) in velocity and the number of coordinates in position for this joint type.

Parameters:

num_axes (int) – The number of axes for the joint.

Returns:

A tuple (dof_count, coord_count) where:
  • dof_count: Number of velocity degrees of freedom for the joint.

  • coord_count: Number of position coordinates for the joint.

Return type:

tuple[int, int]

Notes

  • For PRISMATIC and REVOLUTE joints, both values are 1 (single axis).

  • For BALL joints, dof_count is 3 (angular velocity), coord_count is 4 (quaternion).

  • For FREE and DISTANCE joints, dof_count is 6 (3 translation + 3 rotation), coord_count is 7 (3 position + 4 quaternion).

  • For FIXED joints, both values are 0.

BALL = 2#

allows rotation about all three axes (3 DoF, quaternion parameterization).

Type:

Ball joint

CABLE = 7#

one linear (stretch) and one angular (isotropic bend/twist) DoF.

Type:

Cable joint

D6 = 6#

Generic joint with up to 3 translational and 3 rotational degrees of freedom.

Type:

6-DoF joint

DISTANCE = 5#

keeps two bodies at a distance within its joint limits (6 DoF, 7 coordinates).

Type:

Distance joint

FIXED = 3#

locks all relative motion (0 DoF).

Type:

Fixed joint

FREE = 4#

allows full 6-DoF motion (translation and rotation, 7 coordinates).

Type:

Free joint

PRISMATIC = 0#

allows translation along a single axis (1 DoF).

Type:

Prismatic joint

REVOLUTE = 1#

allows rotation about a single axis (1 DoF).

Type:

Revolute joint