-
Notifications
You must be signed in to change notification settings - Fork 156
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
Logarithmic map and geodesic tracing for general polygon meshes #169
Comments
I see that #195 adds support for polygonal DEC operators and makes the vector heat solver work on polygon meshes. Thanks @nzfeng! That's great because a log map will provide a way (or is at least part of one) to trace geodesic paths across the polygon mesh surface that will connect any two points, with the following procedure:
However#195 does not (yet?) include an implementation of log map computation for polygon meshes. I have been trying to utilize the polygonal vector heat solver to implement the log map algorithm from the paper by myself, but got stuck. I am not actually trained in DDG so I am not really sure whether what I am trying actually helps. I am more programmer than mathematician. Here's what I have done so far. (The source point I used in this screenshot is under the wrist, where a watch strap would usually touch.) Transporting a horizontal direction ("H_0" in the Vector Heat Method paper) works flawlessly. This is shown as yellow arrows in my screenshot. The next step to compute the initial conditions for the radial field ("R" in the original paper, appendix A) is where I got stuck. I do not know how to generalize the hat functions for triangles to polygons. My personal uneducated guess is that the hat function for triangles came from barycentric coordinates (at least the formula for it equals that of the barycentric weight for a triangle vertex). If that is the case, is a generalized barycentric coordinate weight the answer? But if it is, then is there still a closed form solution for the integral of the vertex outward ball? Both Wachspress coordinates and mean value Coordinates are nonlinear and have sums and products and even square roots in the denominators. Will I need a quadrature to calculate the contributions to vertices for the initial condition? I have also considered another option. Would it be possible to use a gradient operator on the scalar geodesic distance map obtained by scalar heat diffusion, and skip the whole radial field diffusion step by directly calculating the distance gradient? de Goes et al defined a gradient operator for the polygon faces (and I used it above, that's shown as purple arrows), is it possible to come up with one for vertices as well? If yes, how do I do it? In another attempt, I attempted to simply go through each vertex and add the differences in geodesic distance between its neighbors multiplied by unit vectors pointing from the neighbor back to the vertex itself. This naive version of a "vertex gradient operator" is not correct and does not work, not even crudely. Any ideas @nmwsharp? |
My use case
Given a manifold polygon mesh
trace a geodesic path between the two points. If it is not the shortest, at least be straightest (Polthier and Schmies [1998]).
I will use such an algorithm to cut up a surface with profile curves (i.e. curves on a surface). In practice, profile curves are polylines with vertices projected onto the polygon mesh. The idea is that these curve polyline segments become new edges on existing faces, splitting them, while preserving the shape of the original mesh. The curve is discretized finely enough such that most polyline segments have both endpoints inside one face, and these are of no concern. The exceptions are the focus of this issue, when segment endpoints do not reside in one face.
Mock up usage (made with Blender)
Polygon mesh is given (quad mesh in this example), plus the highlighted points. The highlighted points are endpoints of the geodesic trace query, and the query results are the edges drawn across the faces, represented as ordered edge intersection points.
My current but insufficient workarounds
In the simple case that the endpoints of a segment reside on different faces that share exactly one edge (sometimes, see the last failure case below), I work around the problem by calculating where the curve segment would intersect the shared edge if the adjacent faces were unfolded. The intersection point is used to subdivide both the curve segment and the mesh edge so that the curve conforms to the surface. This workaround calculates a straightest geodesic (see first mockup image), but it does not cover all cases. Specifically, it cannot handle the following cases of segment endpoint locations that I have encountered:
How can I help?
If no one is working on such a solution, how can I do it myself? Off the top of my head, I recognize several changes that must be made to implement the algorithm:
SurfacePoint
type needs to support varying numbers of components for a face point, depending on the face.VectorHeatSolver::computeLogMap
function need to be updated to support general polygonal meshes.computeLogMap
function calculates the log map for a point in a face by taking the barycentric weighted average of the log maps from vertices adjacent to the face. I will need to modify it to use generalized barycentric coordinates or some other interpolation scheme.traceGeodesic
function uses barycentric coordinates for geodesic tracing in triangles, so it needs to be modified to use some other tangent space parameterization to perform the trace in general polygons.Holdover options
Since this problem is only part of a larger project, I have to choose some other workaround that does not fail in the meantime. I am aware that I can simply triangulate the given mesh, perhaps with constrained Delaunay triangulation, then use the existing
computeLogMap
andtraceGeodesic
functions. However, as noted by Fernando de Goes, Andrew Butts, and Mathieu Desbrun. [2020], Figure 2, triangulating a mesh may lead to inaccurate parameterizations, and I would like to avoid that where possible. I am open to suggestions.The text was updated successfully, but these errors were encountered: