skillfed

isosurfaces

Construct isolines/isosurfaces over a 2D/3D scalar field defined by a function (not a uniform grid)

isosurfaces v0.1.2 182.9K downloads/30d#10,081 on PyPI39
Permissive license MIT AGING released

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 isosurfaces

uv

uv add isosurfaces

poetry

poetry add isosurfaces

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

isoline extraction from functionisosurface generation 2d 3dcontour curves level setsimplicit surface samplingquadtree-based contouringscalar field visualizationmarching squares alternative
computational-geometryimplicit-surfacesadaptive-sampling

More Mathematics packages