newton.geometry.create_box_mesh#

newton.geometry.create_box_mesh(half_extents, duplicate_vertices=False)[source]#

Create a box mesh with the given half extents.

Parameters:
  • half_extents (list[float] | tuple[float, float, float] | vec3f) – Half extents of the box along each axis (x, y, z).

  • duplicate_vertices (bool) – If True, duplicate vertices for each face to enable proper flat shading. Each face will have its own 4 vertices (24 total), allowing distinct normals per face. If False (default), use 8 shared corner vertices for a more compact representation.

Returns:

A tuple of (vertices, indices) numpy arrays.

Return type:

tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]]