Skip to content

Commit 6e7f903

Browse files
Merge pull request #1073 from Geode-solutions/fix/test-shp
fix(Model): check if unique vertices are set before computing ModelCo…
2 parents 5a1f566 + cdf32a7 commit 6e7f903

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/geode/model/helpers/component_mesh_edges.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ namespace geode
109109
const Model& model,
110110
const std::array< geode::index_t, 2 >& edge_unique_vertices )
111111
{
112+
if( edge_unique_vertices[0] == NO_ID
113+
|| edge_unique_vertices[1] == NO_ID )
114+
{
115+
return {};
116+
}
112117
const auto line_pairs =
113118
model_edge_pairs( model, edge_unique_vertices,
114119
geode::Line< Model::dim >::component_type_static() );
@@ -146,6 +151,11 @@ namespace geode
146151
surface_component_mesh_edges( const Model& model,
147152
const std::array< geode::index_t, 2 >& edge_unique_vertices )
148153
{
154+
if( edge_unique_vertices[0] == NO_ID
155+
|| edge_unique_vertices[1] == NO_ID )
156+
{
157+
return {};
158+
}
149159
const auto surface_pairs =
150160
model_edge_pairs( model, edge_unique_vertices,
151161
geode::Surface< Model::dim >::component_type_static() );
@@ -184,6 +194,11 @@ namespace geode
184194
const geode::BRep& model,
185195
const std::array< geode::index_t, 2 >& edge_unique_vertices )
186196
{
197+
if( edge_unique_vertices[0] == NO_ID
198+
|| edge_unique_vertices[1] == NO_ID )
199+
{
200+
return {};
201+
}
187202
const auto block_pairs = model_edge_pairs( model,
188203
edge_unique_vertices, geode::Block3D::component_type_static() );
189204
if( block_pairs.empty() )

0 commit comments

Comments
 (0)