Expand description
Marching cubes isosurface extraction from 3D scalar fields.
Converts a scalar field (orbital ψ or density ρ) into a triangle mesh at a specified isovalue. Reference: Lorensen & Cline, SIGGRAPH 1987.
GPU path: dispatches a WGSL compute shader that processes each voxel independently, then reads back the generated triangle vertices. CPU path: triple-nested loop (always available as fallback).
Structs§
- McOutput
- Triangle mesh output from marching cubes.
Functions§
- marching_
cubes_ cpu - CPU marching cubes on a 3D scalar field.
- marching_
cubes_ gpu - GPU dispatch for marching cubes isosurface extraction.
- marching_
cubes_ with_ report - Marching cubes with automatic GPU/CPU backend selection.
- smooth_
mesh_ normals - Smooth vertex normals by averaging at shared positions.