isosurfaces
Construct isolines/isosurfaces over a 2D/3D scalar field defined by a function (not a uniform grid)
What it is and what it does
Isosurfaces is a Python library for extracting level curves (isolines in 2D) and level surfaces (isosurfaces in 3D) from scalar fields defined by mathematical functions. Rather than sampling uniformly over a grid like traditional marching squares algorithms, it uses a quadtree-based adaptive sampling strategy to focus computational effort on regions where the implicit surface actually exists, avoiding wasted samples in empty space.
The library implements the approach from a 2010 Computer Graphics Forum paper on isosurfaces over simplicial partitions of multiresolution grids. It depends only on numpy and is typed, supporting Python 3.8 through 3.12. You provide a function f(x, y) or f(x, y, z), a bounding box, and parameters controlling sampling depth and density, and it returns the curves or surfaces as collections of points.
Use it for:
- Visualizing level curves of mathematical functions for educational or exploratory analysis.
- Extracting contours from 2D scalar fields (e.g., temperature, pressure, or potential maps) more efficiently than uniform grid sampling.
- Generating 3D isosurfaces from volumetric data defined implicitly by a function.
- Creating topographic-style maps or contour plots where adaptive sampling avoids redundant computation.
- Prototyping geometric algorithms that require accurate implicit surface representation without full grid evaluation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Constructs isolines and isosurfaces of 2D and 3D scalar fields defined by functions, using a quadtree-based approach to efficiently sample only regions near the implicit surface.
Yes, if you need to extract isolines or isosurfaces from implicit functions and want an adaptive alternative to uniform grid methods. The low install friction and permissive license make it accessible. However, note that maintenance is aging (last update February 2024, no commits in over 900 days)—suitable for stable use cases, but not for projects requiring active development or rapid bug fixes.
Install
isosurfaces on PyPI
pip
pip install isosurfacesuv
uv add isosurfacespoetry
poetry add isosurfacesInstalling isosurfaces
Before you install
Low friction: pure Python wheel with only numpy as a runtime dependency. Maintenance status is aging—last release was in February 2024 and the repository has not been updated in over 900 days, though it remains active and unarchived.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
from isosurfaces import plot_isoline
import numpy as np
def f(x, y):
return y * (x - y) ** 2 - 4 * x - 8
curves = plot_isoline(
lambda u: f(u[0], u[1]),
np.array([-8, -6]),
np.array([8, 6]),
min_depth=3,
max_quads=1000,
)
for curve in curves:
print(curve)
Verify before relying
- Whether the quadtree approach provides meaningful performance gains over grid-based methods for typical use cases.
- API stability and whether breaking changes are likely given the aging maintenance status.
- Whether 3D isosurface generation is fully implemented or still experimental.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | aging — 900 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 182,935/month — #10,081 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: isosurfaces-0.1.2-py3-none-any.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
cu2quConverts cubic Bézier curves to quadratic…
permissive · top 15,000 on PyPI
xtgeoXTGeo manipulates subsurface reservoir…
copyleft · top 15,000 on PyPI
opensimplexGenerates OpenSimplex noise across 2D, 3D, and…
permissive · top 15,000 on PyPI
kneedDetects knee (elbow) points in curves using the…
unclear · top 15,000 on PyPI
rdpImplements the Ramer-Douglas-Peucker algorithm…
permissive · top 15,000 on PyPI
fill-voidsFills interior voids in 2D and 3D binary images…
copyleft · top 15,000 on PyPI
pyclothoidsPyclothoids provides a Python interface to…
unclear · top 15,000 on PyPI
ocp-gordonInterpolates networks of curves into smooth…
permissive · top 15,000 on PyPI
geoh5pygeoh5py provides a Python API to read, write,…
copyleft · top 15,000 on PyPI