Skip to content

Commit cebb874

Browse files
feat: add point cloud transformation utilities and LCP metric
- Add transform_point_cloud() and transform_point_cloud_parallel() for creating transformed copies - Add transform_point_cloud_inplace() and transform_point_cloud_inplace_parallel() for memory-efficient transforms - Move LCP score computation to metrics module as LCPMetric class - Update RANSAC and 4PCS registration to use the new LCPMetric - Fix RANSAC convergence check logic using sliding window approach - Add comprehensive benchmarks comparing sequential vs parallel and in-place vs copy transforms - Add unit tests for all transformation functions - Add example demonstrating transformation usage Performance findings: - Sequential is faster for clouds < 100K points due to thread overhead - Parallel shows benefits for clouds > 1M points - In-place transforms are generally 1.5-2x faster and save memory 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a6ddbfa commit cebb874

File tree

13 files changed

+1839
-63
lines changed

13 files changed

+1839
-63
lines changed

CLAUDE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cpp-toolbox is a comprehensive C++ library providing reusable components for acc
1111
### Primary Development Flow
1212

1313
**Configure with CMake preset:**
14+
1415
```bash
1516
# Configure (example for Linux with Clang 21 and TBB)
1617
cmake -S . -B build/build-linux-clang-21-tbb --preset build-linux-clang-21-tbb
@@ -20,6 +21,7 @@ cmake --build build/build-linux-clang-21-tbb -j $(nproc)
2021
```
2122

2223
**Run tests and benchmarks:**
24+
2325
```bash
2426
# Run all tests
2527
build/build-linux-clang-21-tbb/bin/cpp-toolbox_test
@@ -35,6 +37,7 @@ build/build-linux-clang-21-tbb/bin/cpp-toolbox_benchmark "[pcl]" --benchmark-sam
3537
```
3638

3739
**Development utilities:**
40+
3841
```bash
3942
# Format code before committing
4043
make format
@@ -49,6 +52,7 @@ make docs
4952
### Alternative Build Systems
5053

5154
**xmake:**
55+
5256
```bash
5357
xmake
5458
xmake run cpp-toolbox_test
@@ -96,6 +100,7 @@ The codebase follows a modular architecture with clear separation:
96100
- Use provided type aliases (e.g., `PointCloud`, `KDTree`)
97101

98102
### Key Naming Conventions (from CODE_STYLE.md)
103+
99104
- Classes, structs, enums, functions, variables: `lower_case`
100105
- Protected/private members: `m_` prefix + `lower_case`
101106
- Template parameters: `CamelCase`
@@ -105,13 +110,15 @@ The codebase follows a modular architecture with clear separation:
105110
## Common Development Tasks
106111

107112
### Adding New PCL Component
113+
108114
1. Create interface in `src/include/cpp-toolbox/pcl/<category>/`
109115
2. If templated, add implementation in corresponding `impl/` subdirectory
110116
3. Add to module's main header (e.g., `features.hpp`, `descriptors.hpp`)
111117
4. Create unit test in `test/pcl/`
112118
5. Add benchmark if performance-critical
113119

114120
### Running Specific Tests
121+
115122
```bash
116123
# Run tests with specific tag
117124
build/build-linux-clang-21-tbb/bin/cpp-toolbox_test "[knn]"
@@ -124,6 +131,7 @@ build/build-linux-clang-21-tbb/bin/cpp-toolbox_test --list-tests
124131
```
125132

126133
### Debugging Build Issues
134+
127135
- Check `CMakeUserPresets.json` for correct configuration
128136
- Ensure dependencies are fetched: `cmake --preset=dev`
129137
- For TBB support: install system TBB or let CMake fetch it
@@ -134,4 +142,5 @@ build/build-linux-clang-21-tbb/bin/cpp-toolbox_test --list-tests
134142
- Thread pool singleton is available via `ThreadPoolSingleton::instance()`
135143
- PCL components are designed to work with PCL library types but provide own implementations
136144
- Memory-mapped file support for efficient large file processing
137-
- Extensive use of concepts and SFINAE for type safety in C++17/20
145+
- Extensive use of concepts and SFINAE for type safety in C++17
146+
- Commit in english and do not use chinse

CMakeUserPresets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
"CMAKE_C_COMPILER": "clang-21",
125125
"CMAKE_LINKER": "lld-21",
126126
"CMAKE_CXX_FLAGS": "-stdlib=libc++"
127-
// "CMAKE_BUILD_TYPE": "Debug"
128127
}
129128
},
130129
{

benchmark/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ list(APPEND BENCHMARK_FILES
44
# ${CMAKE_SOURCE_DIR}/test/my_catch2_main.cpp
55
concurrent/parallel_benc.cpp
66
types/types_benc.cpp
7+
types/point_transform_bench.cpp
78
file/memory_mapped_file_benc.cpp
89
pcl/downsampling_benc.cpp
910
pcl/knn_benc.cpp

0 commit comments

Comments
 (0)