Spectral analysis and low-frequency reconstruction for triangle meshes using the graph Laplacian.
david_fourier_smoothing.mp4
Low-frequency spectral reconstruction of Michelangelo's David, with k swept live in the Blender add-on — fewer modes give a smoother, more global shape; more modes restore fine detail. (Download the clip if the player doesn't load.)
visualize_eigen.mp4
Eigenmode visualization — a single graph-Laplacian eigenvector ("frequency") painted onto the mesh as a color attribute, sweeping from low, global modes to high-frequency detail. (Download the clip.)
FourierMesh treats mesh vertices as nodes in a graph (edges from triangle faces), builds the combinatorial graph Laplacian, and uses its eigenvectors as a mesh-specific Fourier basis. Low frequencies are smooth, global shape modes; high frequencies capture fine detail.
Keeping only the first k modes reconstructs a smoothed version of the mesh — useful for compression, denoising, and spectral geometry experiments.
For adjacency matrix W and degree matrix D, the combinatorial Laplacian is:
Eigenpairs satisfy (N, 3) project onto the basis:
Reconstruction with the first k modes:
git clone https://github.com/SentientPlatypus/FourierMesh.git
cd FourierMesh
python -m pip install -e .Development and examples:
python -m pip install -e ".[dev]"Optional slicer-friendly mesh repair (trimesh):
python -m pip install -e ".[slicer]"from FourierMesh import load_mesh_stl, reconstruct_mesh
vertices, faces = load_mesh_stl("model.stl")
v_smooth, lambdas = reconstruct_mesh(vertices, faces, k=24)Lower-level API:
from FourierMesh import mesh_fourier_transform, inverse_mesh_fourier
coeffs, U, lambdas = mesh_fourier_transform(vertices, faces, k=24)
v_smooth = inverse_mesh_fourier(coeffs, U, k=24)From the repository root (requires [dev] for plotting):
python examples/mesh_laplacian_david.py --k 30Use --max-faces 500 for a faster connected submesh. Omit it to run on the full STL.
Outputs:
- Comparison PNG under
tests/Artifacts/Mesh/ - Reconstructed STL under
tests/models/
A self-contained Blender add-on lives in blender/ — spectral smoothing and eigenmode visualization directly in the viewport, running on Blender's bundled numpy (no scipy or pip install needed).
- Spectral Smooth — low-pass reconstruct the active mesh. The eigenbasis is solved once and cached, so dragging
kin the redo panel (F9) updates live. - Visualize Eigenmode — paint a single Laplacian eigenvector onto the mesh as a color attribute to see individual mesh "frequencies".
Install by zipping the add-on folder and using Edit > Preferences > Add-ons > Install from Disk. Full instructions in blender/README.md.
| Mesh size | Solver |
|---|---|
Small (N ≤ 2048, full spectrum) |
Dense numpy.linalg.eigh |
Large or partial k |
Sparse scipy.sparse.linalg.eigsh |
Dense full eigendecomposition is O(N³); the library automatically uses sparse low-mode solves for larger inputs.
python -m pytestload_mesh_stl/save_mesh_stl— STL I/Omesh_laplacian_eigenmodes— lowest Laplacian eigenpairsmesh_fourier_transform— project vertex coords onto eigenbasisinverse_mesh_fourier— reconstruct from coefficientsreconstruct_mesh— one-call low-pass reconstruction
- Runtime:
numpy,scipy,numpy-stl - Development:
pytest,matplotlib - Optional:
trimesh(slicer extras)
Point-cloud Dirac-delta Fourier code lives on the dirac branch and is not part of the v0.2 mesh-focused API.
