Skip to content

how to fill hole in mesh #3944

Answered by Fedr
Gihong-Yim asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

Suppose you have a

Mesh mesh = ...

Then you can find all holes in it using

auto holeRepresEdges = mesh.topology.findHoleRepresentiveEdges();

Each hole in the mesh will be represented by exactly one of its edge (having that hole to the left) in holeRepresEdges vector. The you can approach your task as follows:

// iterate over all holes
for ( auto e0 : holeRepresEdges )
{
    // iterate over all edges of the current hole
    for ( auto e : leftRing( mesh.topology, e0 ) )
    {
        auto v = mesh.topology.org( e );
        // all (v)s constitute the vertices of the current hole
    }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Gihong-Yim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants