isoext¶
GPU-accelerated iso-surface extraction for PyTorch
A power-8 Mandelbulb, extracted with isoext.marching_cubes:
219k vertices in about 4 ms. Drag to rotate.
isoext extracts iso-surfaces from scalar fields on the GPU. The field
values come in as a PyTorch tensor and the mesh comes back as tensors, so
it fits directly into training loops and other GPU pipelines. Marching
cubes and dual contouring are implemented, on both dense and sparse grids.
Quick Example¶
import isoext
from isoext import viewer
grid = isoext.UniformGrid([256, 256, 256])
grid.set_values(grid.get_points().norm(dim=-1) - 0.8) # Sphere
vertices, faces = isoext.marching_cubes(grid)
server = viewer.show(vertices, faces) # opens the mesh in the browser
isoext.write_obj("sphere.obj", vertices, faces)
Performance¶
Median extraction times for a sphere SDF on an RTX 5090:
Algorithm |
uniform 512³ |
sparse 512³ |
|---|---|---|
marching_cubes |
4.8 ms |
1.4 ms |
dual_contouring |
7.0 ms |
2.3 ms |
See Performance for the full table and how to reproduce it.