# Determining whether an edge on a mesh is convex or concave

This topic is 3379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Can anyone suggest a robust way of determining whether an edge on a mesh is convex or concave? An edge is concave if the interior angle between the triangles connected by the edge is > 180 degrees, so any suggestion how to get that (or the exterior angle) would solve the problem.

##### Share on other sites
If na and nb are the normals of the both adjacent faces, and pa and pb vertices of the both faces that are not connected to the edge in question, wherein na and pa belongs to the face A, and nb and pb to the face B, then

( pb - pa ) . na <= 0 => ridge edge

as well as

( pb - pa ) . na > 0 => valley edge

where "ridge edge" denotes what you have named convex edge, and "valley edge" denotes what you've named concave edge.

You can avoid numerical inaccuracies in nearly flat connections to be classified if you compute the dot-product of the both normals and compare that with a defined threshold, and do the above decision only of the threshold is exceeded.

##### Share on other sites
check if opposite vertex on one of the triangle is back-facing the other triangle's plane.

e.g. triangle A, B, C, and C, B, D are linked by edge BC.

check if A is back facing or front facing the plane of [C, B, D].

##### Share on other sites
Thanks, gonna try it out when I get the time :)

##### Share on other sites

This topic is 3379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.