Registry / data / isosurfaces

isosurfaces

JSON →
library0.1.2pypypi✓ verified 82d ago

Construct isolines/isosurfaces over a 2D/3D scalar field defined by a function (not a uniform grid). Current version: 0.1.2. Release cadence: irregular, minor patches.

pip install isosurfaces
INSTALL
IMPORT
SIG · ISOSURFACES
I
isosurfaces
datapythonv0.1.2
Install
3.6s avg
Import
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.6s · import 0.000s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

isoline
from isosurfaces import isoline
from isosurfaces import marching_squares
isosurface
from isosurfaces import isosurface
plot_isoline
from isosurfaces import plot_isoline

Basic usage: sample a scalar field on a grid, then call marching_squares or marching_cubes.

from isosurfaces import marching_squares import numpy as np def f(x, y): return x**2 + y**2 - 1 # Sample the function on a grid xs = np.linspace(-2, 2, 100) ys = np.linspace(-2, 2, 100) values = np.array([[f(x, y) for x in xs] for y in ys]) # Extract isoline at value 0 verts, edges = marching_squares(values, 0) print(f"Found {len(verts)} vertices, {len(edges)} edges")
Debug
Known issues
gotchaThe input to marching_squares/marching_cubes must be a 2D/3D numpy array of scalar values on a rectangular grid, not a function. The library does not handle adaptive sampling; you must pre-sample the field.
fix
Generate a regular grid of values (e.g., using np.meshgrid) before calling the function.
affects: all
gotchaThe output vertices are in pixel/grid coordinates (indices), not world coordinates. You must scale/transform them yourself if needed.
fix
Map indices to world coordinates: x_world = x_min + (idx / (shape[0]-1)) * (x_max - x_min).
affects: all
gotchaLibrary is in early development (v0.1.x); API may change without notice. Expect breaking changes in minor versions.
fix
Pin version in requirements: isosurfaces==0.1.2
affects: 0.1.x
Upgrade
Version history
0.1.2latest on PyPI · released Feb 26, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
isosurfaces — pip install isosurfaces · libregistry