Skip to content
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

Move O(n) operations to the initializer in exact_geodesics #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yutanoma
Copy link

Fixed exact_geodesics so that you do not need to run O(n) operations whenever you query the geodesic path.
This is especially useful when you have a fixed mesh/geometry and want to query the geodesic path multiple times.

Summary of contribution

  • Moved geom.requireCornerAngles() and geom.requireVertexGaussianCurvatures() to the initializer
  • Added clear_data() that clears the data except the ones associated with the mesh/geometry

Usage

std::vector<SurfacePoint> p0s, p1s;
// initialize your p0s/p1s here

GeodesicAlgorithmExact mmp(mesh, geometry);

for (int i = 0; i < p0s.size(); i++) {
  auto p0 = p0s[i];
  auto p1 = p1s[i];

  mmp.propagate({p0}, GEODESIC_INF, {p1});
  std::vector<SurfacePoint> path = mmp.traceBack(p1);
  // do science with your path here

  // clear the propagated data so that you can use `mmp` for another geodesic computation
  mmp.clear_data();
}

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.

1 participant