isoext
GPU-accelerated iso-surface extraction for PyTorch
An iso-surface is the set of points where a 3D scalar field equals a chosen value: the shape described by a signed distance function, or the boundary of a density volume. Fields like these come from neural networks, simulations and scans, while most tools consume triangle meshes. isoext is a growing collection of iso-surface extraction methods that turn such fields into triangle meshes 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.
Features
- Extraction methods — sharing one grid interface, with more on the way
- Marching Cubes — the classic primal method, with a choice of lookup tables
vega(default) — MC33 with the corrected interior testlewiner— the topology-correct MC33 tables of scikit-imagenagae— reflection-free tableslorensen— the original 1987 tables
- Marching Tetrahedra — ambiguity-free extraction by splitting cells into tetrahedra
- Dual Contouring — one vertex per cell, placed on sharp features
ju(default) — from surface normals, the original QEF methodcarrera— from the signed distance samples alone, without normals
- Surface Nets — smooth dual meshes without needing normals
- Dual Marching Cubes — sharp features with one vertex per surface sheet, so crossing sheets stay separate; takes any of the marching cubes tables above
- Marching Cubes — the classic primal method, with a choice of lookup tables
- Grids
- Dense uniform grids for full volumes
- Sparse grids that only store cells near the surface, so memory scales with area instead of volume
- Interactive viewer — meshes and grid overlays in the browser, built on viser; scenes can be embedded in static web pages
- SDF toolbox — primitives from spheres to a Mandelbulb, CSG operations, signed distances to triangle meshes on a GPU BVH, and gradient and smoothing utilities
Installation
Requires Python 3.10 or newer and PyTorch with CUDA support. pip install
builds the extension from source, which needs a CUDA toolkit of version
12.4 or newer and a C++ compiler. Prebuilt Linux wheels per CUDA version
are attached to the GitHub releases; the
installation guide
shows how to install them.
pip install isoext
Quick Start
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 | 5.4 ms | 1.9 ms |
| marching_tetrahedra | 6.7 ms | 3.2 ms |
| dual_contouring | 7.0 ms | 2.3 ms |
| surface_nets | 6.9 ms | 2.2 ms |
| dual_marching_cubes | 9.0 ms | 3.5 ms |
See the performance page for the full table, the method variants, and how to reproduce it.
Documentation
See the full documentation for guides on grids, extraction methods, and the API reference.
Acknowledgements
isoext builds on:
- PyTorch — fields and meshes are exchanged as torch tensors
- nanobind — Python bindings for the CUDA core
- Thrust — GPU primitives used throughout the extraction pipeline
- viser — powers the interactive viewer
- scikit-build-core — the build system
Two marching cubes variants adapt existing implementations: the lewiner lookup tables are converted from scikit-image, and the vega variant is a port of MC33_c_library by David Vega (MIT License). The mesh SDF builds and traverses its bounding volume hierarchy with cuBQL by NVIDIA (Apache License 2.0), vendored under ext/cuBQL.
The test meshes of isoext.assets are downloaded from their authors on first use: the bunny, armadillo and dragon from the Stanford Computer Graphics Laboratory (research use), and Spot from Keenan Crane (public domain).
The algorithms themselves come from published papers, cited on each method's documentation page and collected in the references.
License
MIT License. See LICENSE for details.
Metadata
Release files for isoext 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| isoext-1.0.0.tar.gz | 249.9 kB | Without provenance | Details for isoext-1.0.0.tar.gz |
Release files / isoext-1.0.0.tar.gz
| Download URL | isoext-1.0.0.tar.gz |
|---|---|
| Size | 249.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
389e4a455ea0364f7fd5a82fbc5d298c7cd94cc565ccffe64e6eb0cdfd89ec0e
|
|
BLAKE2b-256 checksum How to use checksums |
4238f291794b653aa7fa3826a1276ff33e2c63b51142cc1157c1d9fe6c6826d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for isoext 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.