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(viaMesh.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.MESHorGeoType.CONVEX_MESH.shape_scale (Sequence[float]) – Shape scale factors [unitless].
offset (float) – Outward surface offset [m]. Use
0for the original surface.max_resolution (int) – Maximum grid dimension [voxels].
device (Device | str | None) – CUDA device for GPU allocations.
- Returns:
A
Meshrepresenting the offset isosurface, orNonewhen the shape type is unsupported (plane, heightfield) or the resulting mesh would be empty.- Return type:
Mesh | None