Skip to content

Commit cadf73a

Browse files
committed
fix(RepairPolygonsOrientation): detecte cases not orientable
1 parent b5633ba commit cadf73a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/geode/mesh/helpers/repair_polygon_orientations.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,20 @@ namespace
7979
{
8080
const auto adj =
8181
mesh_.polygon_adjacent_edge( { cur_polygon, e } );
82-
if( !adj || visited[adj->polygon_id] )
82+
if( !adj )
8383
{
8484
continue;
8585
}
86+
if( visited[adj->polygon_id] )
87+
{
88+
OPENGEODE_DATA_EXCEPTION(
89+
cur_polygon_reorient
90+
== reorient_polygon_[adj->polygon_id],
91+
"[RepairPolygonOrientations] Mobius strip "
92+
"detected, polygons orientations can not be "
93+
"repaired" );
94+
continue;
95+
}
8696
const auto e_next = e == vertices.size() - 1 ? 0 : e + 1;
8797
const auto adj_vertices =
8898
mesh_.polygon_edge_vertices( adj.value() );

0 commit comments

Comments
 (0)