Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/geode/mesh/core/solid_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ namespace
} while( facet.polyhedron_id != first_polyhedron
&& safety_count < MAX_SAFETY_COUNT );
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
"[SolidMesh::propagate_around_edge] Too many polyhedra "
"[SolidMesh::propagate_around_edge] Solid: ", solid.name(),
" - Too many polyhedra "
"around edge ",
edge_vertices[0], " ", edge_vertices[1], " (",
solid.point( edge_vertices[0] ).string(), " ",
Expand Down Expand Up @@ -298,7 +299,9 @@ namespace
}
}
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
"[SolidMesh::compute_polyhedra_around_vertex] Too many polyhedra "
"[SolidMesh::compute_polyhedra_around_vertex] Solid: ",
solid.name(),
" Too many polyhedra "
"around vertex ",
vertex_id, " (", solid.point( vertex_id ).string(),
"). This is probably related to a bug in the polyhedra "
Expand Down
3 changes: 2 additions & 1 deletion src/geode/mesh/core/surface_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ namespace
}
}
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
"[SurfaceMesh::polygons_around_vertex] Too many polygons "
"[SurfaceMesh::polygons_around_vertex] Surface: ", mesh.name(),
" Too many polygons "
"around vertex ",
vertex_id, " (", mesh.point( vertex_id ).string(),
"). This is probably related to a bug in the polygon "
Expand Down
27 changes: 20 additions & 7 deletions src/geode/mesh/helpers/repair_polygon_orientations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,29 @@ namespace

absl::FixedArray< geode::index_t > compute_bad_oriented_polygons()
{
absl::FixedArray< bool > visited( mesh_.nb_polygons(), false );
for( const auto p : geode::Range{ mesh_.nb_polygons() } )
try
{
if( visited[p] )
absl::FixedArray< bool > visited( mesh_.nb_polygons(), false );
for( const auto p : geode::Range{ mesh_.nb_polygons() } )
{
continue;
if( visited[p] )
{
continue;
}
queue_.emplace( p );
visited[p] = true;
process_polygon_queue( visited );
}
queue_.emplace( p );
visited[p] = true;
process_polygon_queue( visited );
}
catch( geode::OpenGeodeException& e )
{
const auto msg =
absl::StrCat( "Surface ", mesh_.name(), " - ", e.what() );
throw( geode::OpenGeodeException( msg ) );
}
catch( ... )
{
throw;
}
return get_bad_oriented_polygons();
}
Expand Down