newton.geometry.collide_plane_cylinder#

newton.geometry.collide_plane_cylinder(plane_normal, plane_pos, cylinder_center, cylinder_axis, cylinder_radius, cylinder_half_height)[source]#

Core contact geometry calculation for plane-cylinder collision.

Uses two contact modes:

  • Flat-surface mode (near upright): fixed-orientation stable tripod on the near cap plus one deepest rim point.

  • Rolling mode: 1 deepest rim point + 2 side-generator contacts + 1 near-cap rim contact (one generator typically merges with the deepest point, leaving 3 contacts).

Parameters:
  • plane_normal (vec3f) – Normal vector of the plane.

  • plane_pos (vec3f) – Position point on the plane.

  • cylinder_center (vec3f) – Center position of the cylinder.

  • cylinder_axis (vec3f) – Axis direction of the cylinder.

  • cylinder_radius (float) – Radius of the cylinder.

  • cylinder_half_height (float) – Half height of the cylinder.

Returns:

contact_dist: Vector of contact distances (MAXVAL for unpopulated). contact_pos: Matrix of contact positions (one per row). contact_normal: Contact normal (plane normal).

Return type:

Tuple containing