From 49758671bdcf6a7dcbf843152ddb173b2bb3ed9f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 19:03:47 +0000 Subject: [PATCH 1/2] docs: dt_mesh returns plain distance, not squared distance `api/distance.h`'s doc comment for `dt_mesh`'s `dist` output claimed "squared distances". It does not: the CPU suite pins the output against `std::sqrt(point_tri_sqdist(...))` (tests/lib-cpu/test_distance_mesh.cpp), i.e. the plain Euclidean point-to-triangle distance, signed when `_signed`. The neighbouring `dt_spline_*` docstrings say "best squared distance" and are correct -- their reference in tests/lib-cpu/test_distance_spline.cpp is an unrooted squared distance -- so only `dt_mesh` is corrected here. `dt_euclidean` / `dt_l1` document no output param at all (they are in-place) and are untouched. Doc-only; no behaviour change. Closes #74 Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z --- include/fastfields/api/distance.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fastfields/api/distance.h b/include/fastfields/api/distance.h index a4e51cc..f62c183 100644 --- a/include/fastfields/api/distance.h +++ b/include/fastfields/api/distance.h @@ -150,7 +150,10 @@ void dt_spline_gaussnewton( /** * @brief Compute the distance from a set of points to a triangular mesh. * - * @param dist Output tensor for squared distances (*B,) + * @param dist Output tensor for distances (*B,). NOT squared -- + * unlike the spline ops above, this is the plain + * Euclidean point-to-triangle distance, negative + * inside the surface when `_signed`. * @param nearest_vertex Output tensor for index of nearest vertex (*B,) * @param loc Input tensor for ND location of each point (*B, D) * @param vertices Input tensor for mesh vertices (N, D) From f320d8b6783bb0026959920772f10dec996ffa31 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 23:03:13 +0000 Subject: [PATCH 2/2] docs: wrap dt_mesh's _signed/naive param lines to the 80-column limit The `lint (clang-format, changed lines)` job failed on this branch. The cause is not the new text: `@param _signed` (81 cols) and `@param naive` (90 cols) predate this change, and clang-format reflows the whole doc block once any line inside it is touched, so it proposed breaking those two at column 80 with continuations starting at ` * `. Wrapping them by hand instead keeps the block's hanging-indent alignment and leaves clang-format with nothing to change (`git clang-format main` is now clean on this branch). Still doc-only. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z --- include/fastfields/api/distance.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/fastfields/api/distance.h b/include/fastfields/api/distance.h index f62c183..072d439 100644 --- a/include/fastfields/api/distance.h +++ b/include/fastfields/api/distance.h @@ -158,8 +158,10 @@ void dt_spline_gaussnewton( * @param loc Input tensor for ND location of each point (*B, D) * @param vertices Input tensor for mesh vertices (N, D) * @param faces Input tensor for mesh faces (M, D) - * @param _signed Whether to compute signed distances (inside negative) - * @param naive Whether to use the naive algorithm (no acceleration structure) + * @param _signed Whether to compute signed distances (negative + * inside the surface) + * @param naive Whether to use the naive algorithm (no + * acceleration structure) * @param stream Cuda stream on which to operate */ void dt_mesh(