{"id":21474,"library":"isosurfaces","title":"isosurfaces","description":"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.","status":"active","version":"0.1.2","language":"python","source_language":"en","source_url":"https://github.com/jared-hughes/isosurfaces","tags":["isosurface","marching-squares","marching-cubes","scalar-field","contour"],"install":[{"cmd":"pip install isosurfaces","lang":"bash","label":"standard"}],"dependencies":[],"imports":[{"wrong":"from isosurfaces import marching_squares","symbol":"isoline","correct":"from isosurfaces import isoline"},{"symbol":"isosurface","correct":"from isosurfaces import isosurface"},{"symbol":"plot_isoline","correct":"from isosurfaces import plot_isoline"}],"quickstart":{"code":"from isosurfaces import marching_squares\nimport numpy as np\n\ndef f(x, y):\n    return x**2 + y**2 - 1\n\n# Sample the function on a grid\nxs = np.linspace(-2, 2, 100)\nys = np.linspace(-2, 2, 100)\nvalues = np.array([[f(x, y) for x in xs] for y in ys])\n\n# Extract isoline at value 0\nverts, edges = marching_squares(values, 0)\nprint(f\"Found {len(verts)} vertices, {len(edges)} edges\")","lang":"python","description":"Basic usage: sample a scalar field on a grid, then call marching_squares or marching_cubes."},"warnings":[{"fix":"Generate a regular grid of values (e.g., using np.meshgrid) before calling the function.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Map indices to world coordinates: x_world = x_min + (idx / (shape[0]-1)) * (x_max - x_min).","message":"The output vertices are in pixel/grid coordinates (indices), not world coordinates. You must scale/transform them yourself if needed.","severity":"gotcha","affected_versions":"all"},{"fix":"Pin version in requirements: isosurfaces==0.1.2","message":"Library is in early development (v0.1.x); API may change without notice. Expect breaking changes in minor versions.","severity":"gotcha","affected_versions":"0.1.x"}],"env_vars":null,"search_vec":"'0.1.2':19 '2d/3d':6 'cadenc':21 'construct':2 'contour':35 'cube':31 'current':17 'defin':9 'field':8,34 'function':12 'grid':16 'irregular':22 'isolines/isosurfaces':3 'isosurfac':1,25 'march':27,30 'marching-cub':29 'marching-squar':26 'minor':23 'patch':24 'releas':20 'scalar':7,33 'scalar-field':32 'squar':28 'uniform':15 'version':18","created_at":"2026-04-27T17:00:05.687406+00:00","updated_at":"2026-04-27T17:00:05.687406+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/jared-hughes/isosurfaces","docs":null,"changelog":null,"pypi":"https://pypi.org/project/isosurfaces/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}