Skip to content

Conversation

@zfergus
Copy link
Member

@zfergus zfergus commented Jan 13, 2026

Description

Add signed distance computations for point-plane, point-line, and line-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.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • New unit tests

…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.
Copilot AI review requested due to automatic review settings January 13, 2026 00:23
Copy link
Contributor

Copilot AI left a 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, and line_line with distance, gradient, and Hessian functions
  • Refactored normal computation API by renaming edge_vertex_* functions to point_line_* and edge_edge_* functions to line_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
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.42%. Comparing base (ab06c2f) to head (34c46d3).
⚠️ Report is 1 commits behind head on main.

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              
Flag Coverage Δ
unittests 97.42% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zfergus zfergus merged commit 6e2fd31 into main Jan 13, 2026
21 checks passed
@zfergus zfergus deleted the signed-distance branch January 13, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants