1
votes

For a polygon which is defined as a hole in a triangular mesh, with each vertex defined with [x, y, z] coordinates, how can the inner angle between each edge be calculated? The hole is not planar, but can have arbitrary curvature.

The smallest angle between the edges can be calculated with the dot product. However, I want the inner angle in the interval [0, 360] degrees, and therefore need to know whether the inner angle is convex or concave. If it is concave, I can simply add 180 degrees to the angle acquired from the dot product.

Perhaps there is a way to use the normals of the surrounding triangles somehow?

enter image description here

1
In what programming language do you want/have to solve this problem? This will have also consequences for your data structures.jmizv
There is fairly complex hole filling algorithms already available. I don't think it is as easy as you have explained. Finding hole in mesh itself is a challenging task.codetiger
C++. Current choice of data structure is a std::vector, which contains the vertices which define the hole. I've seen that e.g. Liepa's hole filling algorithm uses the minimum dihedral angle as a cost function, while the approach I'm trying to implement is a variant of the advancing front method which I think uses the minimum vertex angle instead.deeplearningrobot
However, I think this problem is strictly mathematical. For instance, if the hole was planar, whether an angle is convex/concave could be determined by finding the normal of the hole and comparing it with the cross product of the two edges defining the angle (by the sign of their dot product). Unfortunately, this won't work when the hole is curved.deeplearningrobot

1 Answers

0
votes

If you can consistently define the order of vertices along the boundary, you can determine whether an edge is convex or concave by drawing a line segment to the angle edges and comparing the central vertex to that line segment:

enter image description here

As seen in the figure, I've defined a segment connecting the edges of an angle defined by vertices 1, 2, and 3. So long as your vertex ordering is consistent, the angle is either convex or concave based on whether the middle point of the angle (vertex 2 here) is to the left or the right of the line segment.