Repository navigation
Add FlipOutContext: fast repeated point-to-point FlipOut queries on one mesh - #259
Open
mfagerlund wants to merge 1 commit into
Open
mfagerlund wants to merge 1 commit into
mfagerlund wants to merge 1 commit into
Conversation
…sic triangulation per mesh FlipEdgeNetwork::constructFromDijkstraPath builds a fresh signpost triangulation and path network per query, which is ~98% of a point-to-point query on large meshes. FlipOutContext keeps a flat intrinsic triangulation per mesh, finds the initial edge path with A* (Dijkstra order, Euclidean heuristic), runs the same shortening loop, and undoes its flips after each query. Paths are identical to the shipped route (same halfedge sequences); tests check this on four meshes.
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.
Motivation
For a single vertex-to-vertex geodesic,
FlipEdgeNetwork::constructFromDijkstraPath()+iterativeShorten()spends almost all of its time on setup that doesn't depend on the query. Profile of one query on a 48k-vertex mesh (horse):SignpostIntrinsicTriangulationconstructionFlipEdgeNetworkconstructioniterativeShorten()The shortening itself is under 2% of the query.
What this adds
FlipOutContext(flip_geodesics_context.h/.cpp) is built once per mesh and answers vertex-to-vertex queries:shortestEdgePath, so it returns the same path;iterativeShorten(): same wedge-angle queue, flip test, epsilons and angle updates;The existing
FlipEdgeNetworkcode is unchanged; this is a separate class.Same output
The tests (
flip_geodesics_context_test.cpp) check, on spot, bob_small, fox and cat_head (two of them with boundary), 40 random pairs each:FlipEdgeNetworkroute, and the same length within 1e-12 relative;getPathPolyline()point by point.On 14 benchmark meshes (300 random pairs each, 4,200 queries) no length differs from the shipped route by more than 1e-9 relative, and the flip counts match.
Speed
Ryzen 9 3950X, MSVC Release, 300 random vertex pairs per mesh, geometric mean over 14 meshes (1.8k–112k vertices):
The docs page for flip geodesics gets a short section with usage.
Happy to adjust naming, scope or API to fit the library.