--- id: isosurfaces version: "0.1.2" license: MIT license_treatment: permissive maintenance: aging --- # isosurfaces — Construct isolines/isosurfaces over a 2D/3D scalar field defined by a function (not a uniform grid) License: permissive · Maintenance: aging · Downloads: 182.9K/mo ## 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 above — 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 pip install isosurfaces uv add isosurfaces 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_current - Install friction: low - Maintenance: aging - Downloads: 182.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags isoline extraction from function, isosurface generation 2d 3d, contour curves level sets, implicit surface sampling, quadtree-based contouring, scalar field visualization, marching squares alternative, computational-geometry, implicit-surfaces, adaptive-sampling [View on SkillFed](https://skillfed.io/packages/isosurfaces) · [View on PyPI](https://pypi.org/project/isosurfaces/)