Hi,
I am exploring mesh data structures and came across the directed edge data structure. I have managed to get the data structure working but I am looking to detect something like a hole in the mesh. I am trying to find a boundary edge and then follow the hole to find all edges forming this hole. I tried looking for some examples and explanation lectures on boundary edge detection and following the hole but I was not able to find much.
I was wondering if someone could help me understand how you implement something like this?
void Mesh::FindBoundaryHole()
{
std::vector<int> boundary_edges;
for(uint32_t edge = 0; edge < vertices.size(); edge++)
{
int startEdge = FirstDirectedEdge[edge]; // start of the edge
int currentEdge = startEdge;
do
{
if(otherHalf[currentEdge] == -1)
{
boundary_edges.push_back(otherHalf[currentEdge]);
currentEdge = otherHalf[next(currentEdge)];
} else
{
currentEdge = next(otherHalf[currentEdge]);
}
} while (currentEdge != startEdge);
}
}