Skip to content

Commit 9f544da

Browse files
Merge pull request #145 from Geode-solutions/fix/surface-mesh-empty
fix(BRepTopologyInspector): handle empty surface mesh
2 parents 32b7ee6 + 7ecacd0 commit 9f544da

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/geode/inspector/criterion/internal/component_meshes_adjacency.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ namespace
4646
OPENGEODE_EXCEPTION( edge_unique_vertices[0] != geode::NO_ID
4747
&& edge_unique_vertices[1] != geode::NO_ID,
4848
"[ComponentMeshesAdjacency] Missing unique_vertices" );
49+
OPENGEODE_EXCEPTION(
50+
edge_unique_vertices[0] < model.nb_unique_vertices()
51+
&& edge_unique_vertices[1] < model.nb_unique_vertices(),
52+
"[ComponentMeshesAdjacency] Wrong unique_vertices" );
4953
return !geode::detail::line_component_mesh_edges(
5054
model, edge_unique_vertices )
5155
.empty();

src/geode/inspector/topology/brep_blocks_topology.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ namespace
278278
for( const auto& surface_id : not_boundary_surfaces )
279279
{
280280
const auto& surface_mesh = brep.surface( surface_id ).mesh();
281+
if( surface_mesh.nb_polygons() == 0 )
282+
{
283+
continue;
284+
}
281285
const auto polygon_barycenter =
282286
surface_mesh.polygon_barycenter( 0 );
283287
bool is_dangling{ true };

0 commit comments

Comments
 (0)