Skip to content

Commit

Permalink
Merge pull request #1073 from Geode-solutions/fix/test-shp
Browse files Browse the repository at this point in the history
fix(Model): check if unique vertices are set before computing ModelCo…
  • Loading branch information
MelchiorSchuh authored Jan 16, 2025
2 parents 5a1f566 + cdf32a7 commit 6e7f903
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/geode/model/helpers/component_mesh_edges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ namespace geode
const Model& model,
const std::array< geode::index_t, 2 >& edge_unique_vertices )
{
if( edge_unique_vertices[0] == NO_ID
|| edge_unique_vertices[1] == NO_ID )
{
return {};
}
const auto line_pairs =
model_edge_pairs( model, edge_unique_vertices,
geode::Line< Model::dim >::component_type_static() );
Expand Down Expand Up @@ -146,6 +151,11 @@ namespace geode
surface_component_mesh_edges( const Model& model,
const std::array< geode::index_t, 2 >& edge_unique_vertices )
{
if( edge_unique_vertices[0] == NO_ID
|| edge_unique_vertices[1] == NO_ID )
{
return {};
}
const auto surface_pairs =
model_edge_pairs( model, edge_unique_vertices,
geode::Surface< Model::dim >::component_type_static() );
Expand Down Expand Up @@ -184,6 +194,11 @@ namespace geode
const geode::BRep& model,
const std::array< geode::index_t, 2 >& edge_unique_vertices )
{
if( edge_unique_vertices[0] == NO_ID
|| edge_unique_vertices[1] == NO_ID )
{
return {};
}
const auto block_pairs = model_edge_pairs( model,
edge_unique_vertices, geode::Block3D::component_type_static() );
if( block_pairs.empty() )
Expand Down

0 comments on commit 6e7f903

Please sign in to comment.