Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in hole filling algorithm #181

Open
thovide opened this issue Nov 27, 2023 · 1 comment
Open

Issue in hole filling algorithm #181

thovide opened this issue Nov 27, 2023 · 1 comment

Comments

@thovide
Copy link

thovide commented Nov 27, 2023

Hello,

the catch in hole filling code is using the wrong exception:

try
    {
        triangulate_hole(h); // do minimal triangulation
        refine();            // refine filled-in edges
    }
    catch (InvalidInputException& e)
    {
        // clean up
        hole_.clear();
        mesh_.remove_vertex_property(vlocked_);
        mesh_.remove_edge_property(elocked_);

        throw e;
    }

hole triangulation can raise topological exceptions. Then they're not catched and you don't clean the added properties. Which makes further usage of hole filling algorithm impossible (properties cannot be added anymore)

@dsieger
Copy link
Member

dsieger commented Nov 28, 2023

Thanks for reporting. This needs some thought though.

triangulate_hole() itself is only throwing an InvalidInputException in case of a non-manifold hole, which would be a violation of the input precondition. SurfaceMesh::add_face() — called in triangulate_hole() — can throw a TopologyException. I think it should be the responsibility of the direct caller to catch those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants