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

Sphere example

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.2.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.2.0
File Actions
ferreus_rmt-0.2.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for ferreus_rmt-0.2.0-cp38-abi3-win_amd64.whl
ferreus_rmt-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for ferreus_rmt-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ferreus_rmt-0.2.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for ferreus_rmt-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
ferreus_rmt-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for ferreus_rmt-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 4.5 MB

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

Download URL ferreus_rmt-0.2.0-cp38-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
75bce3e21c3756f1bc45cd885d52f4703f5db09efc9810f16ec921a538c453a5
BLAKE2b-256 checksum
How to use checksums
050052713a4483a4c30bf09e9451559dc2d15d32d4644f5f5f83d416b2a34d25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / ferreus_rmt-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ferreus_rmt-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d9acf9f0246e9a41bbb0a743d1b6b1a8aea157e2027c2f37a5d60b618e3929c4
BLAKE2b-256 checksum
How to use checksums
c3621af872a86b4a462664d59fd39af0f788c0b2b8cbfa61db200df73654db75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

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

Download URL ferreus_rmt-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
Size 833.4 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2122bb0857ab80763f8a415eaee89ded63443087774cf6803a316759713a7319
BLAKE2b-256 checksum
How to use checksums
c5868abafe53706910cf016c415574cf039170a2d217f8187f3cb5862ff5c42b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

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

Download URL ferreus_rmt-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 1.1 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
af2ce0d3397947bcd76038358f3e46aba09f2dbeb69f2a09cb8ae46f09779ca4
BLAKE2b-256 checksum
How to use checksums
a7ba2d29b142bb3a597659edd3aca63f3b7b56c09488b4bc485dbcb84e15b4e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Security for ferreus-rmt 0.2.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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for ferreus_rmt-0.2.0-cp38-abi3-win_amd64.whl

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 Oct 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

4 release files Full provenance

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