Skip to main content

Fast surface-following isosurface extraction

This library implements a surface-following variant of regularised marching tetrahedra (RMT) for extracting isosurfaces from implicit scalar fields.

Traditional isosurface extraction methods, such as marching cubes and marching tetrahedra, usually sample the full volume of interest. That can be expensive for costly implicit functions, and can produce meshes with large numbers of poorly shaped triangles.

Regularised marching tetrahedra combines marching tetrahedra with vertex clustering. The result is an isosurface mesh that remains consistent with the sampled field while typically using fewer faces and producing better-shaped triangles than standard marching tetrahedra or marching cubes.

This crate extends RMT with surface-following extraction. Instead of evaluating the implicit function across the entire volume, extraction starts from one or more user-provided seed points and expands across the surface. This is particularly useful for signed-distance fields, radial basis function (RBF) interpolants, and other implicit functions where evaluations are expensive and an approximate surface location is already known.

Seed points do not need to lie exactly on the target isosurface. Before wavefront expansion begins, each seed is projected onto the surface using a gradient-based search. Users may provide an analytic gradient function, or allow gradients to be estimated from the scalar field using central differences.

See the examples section for complete usage examples.


Features

  • Written in Rust
  • Regularised marching tetrahedra with vertex clustering
  • Reduced evaluation counts compared with full-volume sampling
  • Improved triangle quality compared with standard marching tetrahedra
  • Manifold, self-intersection-free mesh generation
  • Optional watertight extraction against an axis-aligned bounding box (AABB)

Install

pip install ferreus_rmt

Quick start

import numpy as np
from ferreus_rmt import build_isosurface

# Define the implicit function for a sphere.
def surface_fn(points: np.ndarray) -> np.ndarray:
    radius = 1.0
    return np.linalg.norm(points, axis=1) - radius

# Define the axis-aligned bounding box extents to extract the isosurface within:
# [xmin, ymin, zmin, xmax, ymax, zmax].
extents = np.array([-1.2, -1.2, -1.2, 1.2, 1.2, 1.2], dtype=np.float64)

# Define the resolution of the sample lattice.
resolution = 0.2

# Define the isovalue of the implicit function to surface.
isovalue = 0.0

# Define some seed points on, or near, the isosurface to seed the wavefront.
seed_points = np.array([[1.0, 0.0, 0.0], [-1.0, 0.0, 0.0]], dtype=np.float64)

# Extract the isosurface
mesh = build_isosurface(
    seed_points,
    extents,
    resolution,
    isovalue,
    surface_fn,
)

# Save the isosurface out to an obj file
mesh.save_obj("sphere.obj", "sphere")

Implicit sphere isosurface


References

  1. G.M. Treece, R.W. Prager, and A.H. Gee. Regularised marching tetrahedra: improved iso-surface extraction. Computers & Graphics, 23(4):583–598, 1999.

Attribution and licensing

This package was developed while the author was working at Maptek and has been approved for open-source distribution under the terms of the MIT license.

Unless otherwise stated, the following copyright applies:

Copyright (c) 2026 Maptek Pty Ltd.
All rights reserved.

This copyright applies to all files in this repository, whether or not an individual file contains an explicit notice.

The code is released under the MIT License - see the top-level LICENSE file for details.

Metadata

Release files for ferreus-rmt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for ferreus-rmt 0.1.0
File
ferreus_rmt-0.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
ferreus_rmt-0.1.0-cp38-abi3-manylinux_2_39_x86_64.whl CPython 3.8 abi3 Linux glibc 2.39+ x86-64 Details
ferreus_rmt-0.1.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
ferreus_rmt-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 3.5 MB

Release files / ferreus_rmt-0.1.0-cp38-abi3-win_amd64.whl

Download URL ferreus_rmt-0.1.0-cp38-abi3-win_amd64.whl
Size 910.9 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
539d8449b01f4b71e2103a201a7627f09eb566c6e458e8b802f9c63296c2a504
BLAKE2b-256 checksum
How to use checksums
8bbb5696c9e840875333ae4500c420dc075215d6283c32ab08bcbbc93aa7433e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release files / ferreus_rmt-0.1.0-cp38-abi3-manylinux_2_39_x86_64.whl

Download URL ferreus_rmt-0.1.0-cp38-abi3-manylinux_2_39_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
2903cc6915a569da6bcf7f0c71dda80279defa00c40779186f726abbd225f037
BLAKE2b-256 checksum
How to use checksums
e1f384fbe54e991be6bbcc6f404a3190e410f12d16609fd916a00bb77c9b3ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release files / ferreus_rmt-0.1.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL ferreus_rmt-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Size 641.1 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
38a8b07a211355748aac7d7cc797c4f17ccbc1c78b3db7b20c5050137fdb3642
BLAKE2b-256 checksum
How to use checksums
71d56f84c8f15eeb9ca60086ce0c61790485608610368bf11399370beea8918c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release files / ferreus_rmt-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL ferreus_rmt-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 913.9 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4fadc640b7e37abda89f5512312fdec1b3d9a084e410b7dcabb6a9716bdd6394
BLAKE2b-256 checksum
How to use checksums
f60ffcd1dc98787f97857efee5fdc291e037b4991f34b4642556622327be44bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page