warp.geometry#

Geometry processing operations.

This module provides functions to process 2D and 3D geometry and their associated topological data structures (e.g., meshes), and GPU-accelerated isosurface extraction.

Dense-grid isosurface backends take a 3-D warp.float32 field sampled at grid nodes and share the IsoSurfaceBase interface, so they can be swapped without changing calling code: IsoSurfaceMarchingCubes produces triangles, and IsoSurfaceNets produces triangles or quads.

Sparse extraction skips the dense grid entirely. sparse_marching_cubes() takes an implicit function and builds a Lipschitz octree around the level set, so cost scales with surface area rather than volume. lipschitz_octree() and sparse_marching_cubes_from_cells() expose its two stages separately.

The Python API includes array-level functions, such as swept_volume_mesh(), that launch kernels over a whole mesh or grid. The kernel API includes Warp functions, such as swept_volume_sdf(), that evaluate a single point and may be called from your own warp.kernel() definitions and other Warp functions.

Usage:

This module must be explicitly imported:

import warp.geometry

Python API#

IsoSurfaceBase

Abstract base class for isosurface extraction from dense 3D scalar fields.

IsoSurfaceMarchingCubes

A reusable context for marching cubes surface extraction.

IsoSurfaceNets

A reusable isosurface extractor using Surface Nets.

OBBMeasureType

Objective minimized when searching for an oriented bounding box.

SweptVolumeSignMode

Method used to classify inside/outside when evaluating the per-mesh SDF.

delaunay_edge_flip

Flip non-Delaunay interior edges in place until all are Delaunay or max passes is reached.

lipschitz_octree

Return max-depth octree cells that may intersect a level set of a Lipschitz-bounded implicit field.

oriented_bounding_box

Approximate an oriented bounding box (OBB) of a point set by sampling orientations.

oriented_bounding_boxes

Approximate an oriented bounding box (OBB) of each of several point sets in one pass.

sparse_marching_cubes

Extract an isosurface from an implicit function using a Lipschitz octree.

sparse_marching_cubes_from_cells

Extract an isosurface from an explicit set of occupied cells and corner values.

swept_volume_bounds

Return the world-space axis-aligned bounds of every mesh over every pose.

swept_volume_field

Compute a dense regular-grid discretization of the swept-volume pseudo signed-distance function.

swept_volume_mesh

Extract the swept volume (motion envelope) of animated rigid meshes.

tri_tri_adjacency

Build triangle-triangle adjacency for a triangle mesh.

Kernel API#

find_triangle_neighbor_edge_index

Return the local edge of triangle shared with neighbor.

intersect_aabb_aabb

Test whether two closed axis-aligned bounding boxes overlap.

intersect_seg_aabb

Test whether a closed segment intersects an axis-aligned bounding box.

intersect_seg_tri

Test whether a closed segment intersects a triangle.

intersect_tri_aabb

Test whether a triangle intersects a closed axis-aligned bounding box.

intersect_tri_tri

Test whether two triangles intersect.

self_intersect_tri_tri

Test whether two triangles intersect beyond their topologically shared boundary.

super_fibonacci

Return the i-th of n rotations spread near-uniformly over SO(3).

swept_volume_sdf

Evaluate the swept-volume pseudo signed distance at a single point.