Skip to content

Infinite loop in orient_polygon_soup in a degenerate case #8693

@sloriot

Description

@sloriot

I'm filling an issue as I observe an Infinite loop in orient_polygon_soup() in the function void duplicate_singular_vertices() that is extracting links of vertices to detect if a vertex is non-manifold (singular). I cannot reproduce the error in an isolated program, only in a complex one.

The problem happens here:

        if (next==v_id){
          /// turn the otherway round
          next = neighbors[0];
          do{
            P_ID other_p_id;
            std::tie(next, other_p_id) = next_ccw_vertex_around_target(next, v_id, polygons, edges, marked_edges);
            if (next==v_id) break;
            visited_polygons.insert(other_p_id);
            if(nb_link_ccs != 1)
              vertices_to_duplicate.back().second.push_back(other_p_id);
          }
          while(true);
        }

the pb happens because of a face having a degenerate edge, with the duplicated vertex being a T junction:

B----------------A
|                |
|                |
C-------DD-------E
|        |       |
|        |       |
|        |       |
F------- G-------H

f0: A-B-C-D-D-E
f1: E-D-G-H
f2: D-C-F-G

I'm not even sure we want to support such cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions