-
Notifications
You must be signed in to change notification settings - Fork 39
Add signed distance computations #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e-line geometries - Implemented `point_plane_signed_distance`, `point_plane_signed_distance_gradient`, and `point_plane_signed_distance_hessian` functions for computing signed distances from a point to a triangle's plane. - Introduced `point_line_signed_distance`, `point_line_signed_distance_gradient`, and `point_line_signed_distance_hessian` functions for point-line distance calculations. - Refactored existing normal computation functions to support point-line geometry. - Added unit tests for signed distance calculations, including gradient and Hessian checks using finite differences. - Updated CMake configuration to include new test files for signed distance computations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds signed distance computation functions for point-plane, point-line, and line-line geometries, complete with gradient and Hessian calculations. It also refactors existing normal computation functions by renaming "edge-vertex" to "point-line" and "edge-edge" to "line-line" for improved clarity and consistency.
Changes:
- Added three new signed distance modules:
point_plane,point_line, andline_linewith distance, gradient, and Hessian functions - Refactored normal computation API by renaming
edge_vertex_*functions topoint_line_*andedge_edge_*functions toline_line_* - Added comprehensive unit tests with finite difference validation for all new signed distance functions
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/src/tests/distance/test_signed_distance.cpp |
New test file validating signed distance computations and their derivatives using finite differences |
tests/src/tests/distance/CMakeLists.txt |
Added new test file to build configuration |
tests/src/tests/candidates/test_normals.cpp |
Updated to use renamed normal functions and added tests for point-line normal Hessian |
src/ipc/geometry/normal.hpp |
Renamed edge-vertex/edge-edge functions to point-line/line-line, added new function declarations for Hessians |
src/ipc/geometry/normal.cpp |
Implemented point-line normal Jacobian and Hessian functions, renamed existing functions |
src/ipc/distance/signed/point_plane.* |
New files implementing signed point-to-plane distance with derivatives |
src/ipc/distance/signed/point_line.* |
New files implementing signed point-to-line distance (2D) with derivatives |
src/ipc/distance/signed/line_line.* |
New files implementing signed line-to-line distance (3D) with derivatives |
src/ipc/distance/signed/CMakeLists.txt |
New build configuration for signed distance subdirectory |
src/ipc/distance/point_plane.cpp |
Updated to use triangle_normal function for consistency |
src/ipc/distance/CMakeLists.txt |
Added signed distance subdirectory to build |
src/ipc/candidates/edge_vertex.cpp |
Updated to use renamed point_line_* functions |
src/ipc/candidates/edge_edge.cpp |
Updated to use renamed line_line_* functions |
python/src/geometry/normal.cpp |
Updated Python bindings to use renamed function names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
==========================================
+ Coverage 97.41% 97.42% +0.01%
==========================================
Files 150 153 +3
Lines 23761 23917 +156
Branches 802 805 +3
==========================================
+ Hits 23146 23302 +156
Misses 615 615
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Add signed distance computations for point-plane, point-line, and line-line geometries
point_plane_signed_distance,point_plane_signed_distance_gradient, andpoint_plane_signed_distance_hessianfunctions for computing signed distances from a point to a triangle's plane.point_line_signed_distance,point_line_signed_distance_gradient, andpoint_line_signed_distance_hessianfunctions for point-line distance calculations.Type of change
How Has This Been Tested?