Skip to content

Commit c06827b

Browse files
committed
fix(Logger): add more details about non manifold edges
1 parent ff9b35b commit c06827b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/geode/inspector/criterion/manifold/surface_edge_manifold.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ namespace
5151
{ polygon_id, polygon_edge_id } )
5252
};
5353
if( !polygons_around_edges
54-
.try_emplace( polygon_edge_vertex_cycle,
55-
std::make_pair( 1, false ) )
56-
.second )
54+
.try_emplace( polygon_edge_vertex_cycle,
55+
std::make_pair( 1, false ) )
56+
.second )
5757
{
5858
polygons_around_edges[polygon_edge_vertex_cycle].first += 1;
5959
}
@@ -82,11 +82,12 @@ namespace geode
8282
{
8383
for( const auto& edge : edge_to_polygons_around( mesh_ ) )
8484
{
85-
if( edge.second.second && edge.second.first != 1 )
85+
const auto [nb_incident_polygons, on_border] = edge.second;
86+
if( on_border && nb_incident_polygons != 1 )
8687
{
8788
return false;
8889
}
89-
if( !edge.second.second && edge.second.first != 2 )
90+
if( !on_border && nb_incident_polygons != 2 )
9091
{
9192
return false;
9293
}
@@ -101,19 +102,22 @@ namespace geode
101102
};
102103
for( const auto& edge : edge_to_polygons_around( mesh_ ) )
103104
{
104-
if( edge.second.second && edge.second.first != 1 )
105+
const auto [nb_incident_polygons, on_border] = edge.second;
106+
if( on_border && nb_incident_polygons != 1 )
105107
{
106108
non_manifold_edges.add_issue( edge.first.vertices(),
107109
absl::StrCat( "Edge between vertices with index ",
108110
edge.first.vertices()[0], " and index ",
109-
edge.first.vertices()[1], " is not manifold." ) );
111+
edge.first.vertices()[1],
112+
" is not manifold (detected as on border)." ) );
110113
}
111-
if( !edge.second.second && edge.second.first != 2 )
114+
if( !on_border && nb_incident_polygons != 2 )
112115
{
113116
non_manifold_edges.add_issue( edge.first.vertices(),
114117
absl::StrCat( "Edge between vertices with index ",
115118
edge.first.vertices()[0], " and index ",
116-
edge.first.vertices()[1], " is not manifold." ) );
119+
edge.first.vertices()[1],
120+
" is not manifold (detected as not on border)." ) );
117121
}
118122
}
119123
return non_manifold_edges;

0 commit comments

Comments
 (0)