Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 7 additions & 8 deletions src/geode/mesh/core/solid_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,10 @@ 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 "
"around edge ",
edge_vertices[0], " ", edge_vertices[1], " (",
solid.point( edge_vertices[0] ).string(), " ",
solid.point( edge_vertices[1] ).string(),
"[SolidMesh::propagate_around_edge] Solid ", solid.name(),
": too many polyhedra around edge ", edge_vertices[0], " ",
edge_vertices[1], " (", solid.point( edge_vertices[0] ).string(),
" ", solid.point( edge_vertices[1] ).string(),
"). This is probably related to a bug in the polyhedron "
"adjacencies." );
return std::make_tuple( std::move( result ), true );
Expand Down Expand Up @@ -298,9 +297,9 @@ namespace
}
}
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
"[SolidMesh::compute_polyhedra_around_vertex] Too many polyhedra "
"around vertex ",
vertex_id, " (", solid.point( vertex_id ).string(),
"[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 "
"adjacencies." );
return result;
Expand Down
6 changes: 3 additions & 3 deletions src/geode/mesh/core/surface_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ namespace
}
}
OPENGEODE_EXCEPTION( safety_count < MAX_SAFETY_COUNT,
"[SurfaceMesh::polygons_around_vertex] Too many polygons "
"around vertex ",
vertex_id, " (", mesh.point( vertex_id ).string(),
"[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 "
"adjacencies." );
return result;
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