mathew7k5b
mathew7k5b

Reputation: 237

How to detect if selected vertex lies on the border of a triangle mesh?

I have a triangle mesh that is represented with a list of vertex coordinates, triangles are stored in a list of vertex indices and a list of corner indices. I also have a corner table that stores coordinate of a vertex, next corner, previous corner, opposite corner and right and left corner (of an incident triangle). In my program user can select a vertex, but I have a trouble detecting whether the selected point lies on border of the mesh or not (because then it requires unique handling). I managed to detect, whether the triangle it lies on is a boundary triangle. But how can I check if the selected vertex is also a boundary vertex?

Upvotes: 0

Views: 1377

Answers (1)

BDL
BDL

Reputation: 22165

There are multiple ways to identify a boundary vertex.

A vertex v is a boundary vertex

  • If it belongs to at least one boundary edge (edge with only one adjacent face) or
  • If the neighborhood of v in the the vertex-edge graph does not form a loop.

If you want to identify a vertices v in a triangular mesh, you could count for each neighborhood vertex w how many (v,w) edges exist. If there exists a vertex w with just one (v,w) edge, then the vertex v (and also the vertex w) will be boundary vertices.

Upvotes: 2

Related Questions