newton.geometry.compute_offset_mesh#

newton.geometry.compute_offset_mesh(shape_type, shape_geo=None, shape_scale=(1.0, 1.0, 1.0), offset=0.0, max_resolution=48, device=None)[source]#

Compute the offset (Minkowski-inflated) isosurface mesh of a shape.

For primitive shapes with analytical SDFs (sphere, box, capsule, cylinder, ellipsoid, cone) this evaluates the SDF directly on a dense grid, avoiding NanoVDB volume construction. For mesh / convex-mesh shapes with a pre-built SDF (via Mesh.build_sdf()), the existing volume or texture SDF is reused. Only when no pre-built SDF is available does this fall back to constructing a temporary NanoVDB volume.

Parameters:
  • shape_type (int) – Geometry type identifier from GeoType.

  • shape_geo (Mesh | None) – Source mesh geometry when shape_type is GeoType.MESH or GeoType.CONVEX_MESH.

  • shape_scale (Sequence[float]) – Shape scale factors [unitless].

  • offset (float) – Outward surface offset [m]. Use 0 for the original surface.

  • max_resolution (int) – Maximum grid dimension [voxels].

  • device (Device | str | None) – CUDA device for GPU allocations.

Returns:

A Mesh representing the offset isosurface, or None when the shape type is unsupported (plane, heightfield) or the resulting mesh would be empty.

Return type:

Mesh | None