Repository navigation
Add float32 overload for signed_distance - #321
Open
alecjacobson wants to merge 4 commits into
Open
alecjacobson wants to merge 4 commits into
alecjacobson wants to merge 4 commits into
Conversation
Register a non-converting float overload before the existing default conversion. Preserve double inputs, mixed-dtype conversion, strided/read-only arrays, and integer face conversions. Pin libigl with scalar-generic pseudonormal arithmetic. Cover output precision, true float arithmetic, all sign methods, feature queries, 2D and bounds. Refs alecjacobson/pseudonormal-tests#1. Prepared with OpenAI Codex.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
igl.signed_distancecurrently converts float32 geometry and query points to double. Add a float instantiation so matching float32 arrays compute through libigl's float query path and return float32 distances, closest points, and normals. Face indices remain int64.The float overload requires matching input dtypes and is registered first so it also wins when face indices need conversion (for example int32 → int64). Float64 and mixed float32/float64 inputs retain the default double conversion. Strided and read-only arrays remain supported; no new keyword argument is required.
Pin libigl to
e810369e42090e66fc805370f9969771e93b431ffrom libigl/libigl#2586, which should land first. That standalone core PR includes the scalar-precision work from superseded #2583 and carries the nearest feature into 3D pseudonormal selection, eliminating feature-selection tolerances from the 3D signed-distance path. Final normal normalization is unchanged. Tracks alecjacobson/pseudonormal-tests#1.Validation
mainleaves every affected query source unchanged. Tests cover dtypes, C/F/strided/read-only arrays, int32/int64 indices, mixed-dtype conversion, existing sign methods, 2D, bounds, and a result distinguishing float arithmetic from double evaluation followed by a cast.d > 0.001 * bbd. It gives 150 float and 62 double disagreements, compared with 1,061 and 441 for the prior tuned core. Float has 90 invalid-normal queries, down from 369. Four new float disagreements occur on an exactly collapsed triangle with equally nearest features and opposing normal signs.Full report, limitations, and provenance.
Prepared by OpenAI Codex at the repository owner's request.