Skip to content

Commit 756e2b5

Browse files
authored
Merge pull request #2 from lanxinger/claude/meshdenoiser-review-011CUs34Px5ptyMUMZsNjghj
Add batch processing support to MeshDenoiser
2 parents 847c65f + acae7fe commit 756e2b5

File tree

4 files changed

+592
-51
lines changed

4 files changed

+592
-51
lines changed

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Build directories
2+
build/
3+
_build/
4+
cmake-build-*/
5+
6+
# IDE files
7+
.vscode/
8+
.idea/
9+
*.swp
10+
*.swo
11+
*~
12+
13+
# CMake generated files
14+
CMakeCache.txt
15+
CMakeFiles/
16+
cmake_install.cmake
17+
Makefile
18+
*.cmake
19+
20+
# Compiled binaries
21+
*.exe
22+
*.out
23+
*.app
24+
*.dylib
25+
*.so
26+
*.dll
27+
28+
# Object files
29+
*.o
30+
*.obj
31+
32+
# macOS
33+
.DS_Store

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
cmake_minimum_required(VERSION 3.18)
22
project(meshsdfilter-builder LANGUAGES CXX)
33

4+
# Set C++17 standard for filesystem support
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
49
include(FetchContent)
510
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
611

README.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MeshSDFilter requires:
1919

2020
OpenMP is an open standard for shared-memory parallelism; compilers that support it (e.g. GCC, Clang with `libomp`, MSVC) let MeshSDFilter run heavy loops across multiple CPU cores.
2121

22-
> Note: MeshSDFilter expects Eigen to be discoverable via `find_package(Eigen3)`. Our CI installs Eigen per-platform so you dont have to.
22+
> Note: MeshSDFilter expects Eigen to be discoverable via `find_package(Eigen3)`. Our CI installs Eigen per-platform so you don't have to.
2323
> You can also point CMake at a local Eigen install with `-DEIGEN3_INCLUDE_DIR=/path/to/eigen` if needed.
2424
2525
## Build (local)
@@ -87,13 +87,74 @@ xattr -cr meshdenoiser-macos/
8787
- This wrapper repo is MIT by default (you can change it), and preserves upstream notices.
8888

8989
## Using the tools
90+
91+
### Single File Processing
9092
```bash
9193
# Filter
9294
MeshSDFilter FilteringOptions.txt input_mesh.ply output_mesh.ply
9395
# Denoise
9496
MeshDenoiser DenoisingOptions.txt input_mesh.ply output_mesh.ply
9597
```
96-
- A detail-preserving MeshDenoiser preset is in `MeshDenoiserDefaults.txt` (outer iterations 1, lambda 0.15, eta 2.2, mu 0.2, nu 0.25). Copy it to your working folder or pass it directly; raise lambda/eta or the iteration count only if you want stronger smoothing.
98+
99+
### Batch Processing
100+
Process multiple mesh files at once by providing directories instead of individual files:
101+
102+
```bash
103+
# Process all mesh files in input_dir/ and save to output_dir/
104+
MeshDenoiser DenoisingOptions.txt input_dir/ output_dir/
105+
```
106+
107+
Batch processing features:
108+
- **Automatically discovers** all supported mesh files in the input directory
109+
- **Preserves filenames** - each output file has the same name as its input
110+
- **Creates output directory** if it doesn't exist
111+
- **Progress indicators** - animated spinner showing loading, denoising, and saving progress
112+
- **Real-time feedback** - displays mesh statistics (vertices, faces) and elapsed time
113+
- **Error handling** - continues processing remaining files if one fails
114+
- **Summary report** - displays success/failure counts and average processing time
115+
116+
Example:
117+
```bash
118+
# Process a directory of scanned meshes
119+
MeshDenoiser MeshDenoiserDefaults.txt scanned_meshes/ cleaned_meshes/
120+
```
121+
122+
Output example:
123+
```
124+
Batch processing mode
125+
Input directory: scanned_meshes/
126+
Output directory: cleaned_meshes/
127+
128+
Found 3 mesh file(s) to process
129+
130+
[1/3] scan001.obj
131+
Loaded mesh (12543 vertices, 25086 faces) (0.12s)
132+
Complete (2.45s)
133+
134+
[2/3] scan002.ply
135+
Loaded mesh (8421 vertices, 16842 faces) (0.08s)
136+
Complete (1.89s)
137+
138+
[3/3] model.gltf
139+
Loaded mesh (15632 vertices, 31264 faces) (0.15s)
140+
Complete (3.12s)
141+
142+
==================================
143+
Batch processing complete
144+
Successful: 3
145+
Failed: 0
146+
Total: 3
147+
Time: 7.56s (avg: 2.52s per file)
148+
```
149+
150+
The progress indicator shows:
151+
- **Loading phase**: Spinner animation with vertex/face count on completion
152+
- **Denoising phase**: Spinner animation with elapsed time
153+
- **Saving phase**: Quick spinner during file write
154+
- Terminal animation works in interactive shells; falls back to simple dots in pipes/logs
155+
156+
### Supported Formats
157+
- A detail-preserving MeshDenoiser preset is in `MeshDenoiserDefaults.txt` (outer iterations 1, lambda 0.15, eta 2.2, mu 0.2, nu 0.25). Copy it to your working folder or pass it directly; raise lambda/eta or the iteration count only if you want stronger smoothing.
97158
- `MeshDenoiser` accepts:
98159
- Traditional formats: OBJ, PLY, OFF, STL (via OpenMesh)
99160
- glTF formats: `.gltf`, `.glb` (via tinygltf)

0 commit comments

Comments
 (0)