Skip to main content

Module marching_cubes

Module marching_cubes 

Source
Expand description

Marching Cubes isosurface extraction from volumetric grids.

Given a VolumetricGrid and an isovalue, produces a triangle mesh (vertices, normals, indices) suitable for WebGL/WebGPU rendering.

Structs§

DualPhaseMesh
Dual-phase isosurface result for orbital visualization.
IsosurfaceMesh
A triangle mesh extracted from an isosurface.

Functions§

compute_angle_weighted_normals
Compute angle-weighted vertex normals for smooth shading.
flip_normals_outward
Ensure consistent outward-facing normal orientation.
marching_cubes
Extract an isosurface from a volumetric grid using Marching Cubes.
marching_cubes_dual
Extract dual-phase isosurfaces (positive and negative lobes).
mesh_to_interleaved
Export mesh data in WASM-ready format: interleaved position+normal Float32Arrays.
simplify_mesh
Mesh simplification: weld duplicate vertices and remove degenerate triangles.