newton.utils.create_plane_mesh#

newton.utils.create_plane_mesh(width, length)[source]#

Create a rectangular plane mesh in the XY plane.

Generates vertices and triangle indices for a flat rectangular plane lying in the XY plane (Z=0) with upward-pointing normals.

Parameters:
  • width (float) – Width of the plane in the X direction.

  • length (float) – Length of the plane in the Y direction.

Returns:

A tuple containing:
  • vertices (np.ndarray): Float32 array of shape (4, 8) where each vertex contains [x, y, z, nx, ny, nz, u, v] (position, normal, UV coords). All vertices have Z=0 and normals pointing up (0, 0, 1).

  • indices (np.ndarray): Uint32 array of 6 triangle indices forming 2 triangles with counterclockwise winding.

Return type:

tuple[np.ndarray, np.ndarray]