LaplaceMeshSmoothing
Laplacian filtering in the context of mesh denoising
Install / Use
/learn @chengkunli96/LaplaceMeshSmoothingREADME
LaplaceMeshSmoothing
This repository is about Laplacian filtering in the context of mesh denoising. The main contributions are
- compute the mean curvature of a mesh by Uniform Laplace and Cotangent Laplace respectively.
- compute mesh's Gaussian curvature.
- reconstruct the mesh with k eigenvectors.
- implementation of explicit and implicit Laplacian mesh smoothing.
More details can be found in this report.
Requirements
This code has been test under python 3.6.12, and the libraries I used as following,
- open3d==0.12.0
- trimesh==3.9.1
- numpy==1.19.2
- matplotlib==3.3.2
- argparse==1.4.0
- scipy==1.5.4
File structure
datathe data for testing our algorithm.docsthe report of my experiment.srcincludes all of the source code.part*.pyin this files, I've done several experiment (check the report, you'll understand what I've done).toolsfloder is a package I build to implement core algorithmLaplaceOperator.py- the core codetools.py- some tool function, like show mesh in open3d gui
Easy using
Fistly, you should import the nessary module.
import trimesh
import tools.LaplaceOperator # our python package
For computing mean curvature matrix H and Gaussian curvature K of the mesh, you can do:
tm = trimesh.load(mesh_file_path) # load mesh
Obj = LaplaceOperator.LaplaceOperator(tm)
H = Obj.getMeanCurvature(mode='uniform') # also, you can use 'cotan'
K = Obj.getGaussianCurvature()
For spectral analysis which reconstruct the mesh with k eigenvectors, you can do:
newtm = Obj.decompose(k) # k is the num of eigenvectors you want
For mesh smoothing, do following
# lr is the step size for every iteration. maxIter is the number of iteration
# you can also change mode to 'explicit' to do smooth
newtm = Obj.smooth(lr=step_size, maxIter=iteration, mode='implicit')
Experiment
You can read the code of my experiments to find out the usage with more detail.
The first experiment is about Uniform Laplace mean curvature and Gaussian curvature.
# Argument '--obj' is used to indicate the 3D object we use, and the mesh I use here can be found in data folder.
# and use'--mode mean' is to show the mean curvature.
python part1.py --obj lilium_s.obj --mode mean
python part1.py --obj plane.obj --mode mean
# Argument ‘--mode gaussian’ is to show the mean curvature.
python part1.py --obj plane.obj --mode gaussian
python part1.py --obj lilium_s.obj --mode gaussian
And then for the mean curvature by Cotangent laplace
python part3.py --obj plane.obj
python part3.py --obj lilium_s.obj
As for doing spectral analysis,
# Use '--k' to set the number of eigenvectors
pyhon part4.py --k 60
In terms of the explicit Laplacian mesh smoothing,
# '--step_size' is to set the step size lambda of iteration
# '--iteration' is to set the number of iteration
python part5.py --obj fandisk_ns.obj --step_size 1e-5 --iteration 50
To see the performace of the implicit Laplacian mesh smoothing,
# '--step_size' is to set the step size lambda of iteration
# '--iteration' is to set the number of iteration
python part5.py --obj fandisk_ns.obj --step_size 1e-5 --iteration 50
Some samples
For spectral analysis, if you run part4.py, finnaly you will get as following.

Besides, the picture below shows the results of the explicit Laplacian mesh smoothing.

Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
