Skip to content

Commit 88f3118

Browse files
committed
fix(Mesh): add more info in exception in TetrahedralSoli::edge_incident_facets
1 parent 7a23be9 commit 88f3118

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/geode/mesh/core/tetrahedral_solid.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,11 @@ namespace geode
193193
{
194194
std::array< PolyhedronFacet, 2 > facets;
195195
index_t count{ 0 };
196+
const auto solid_vertices = this->polyhedron_vertices( tetrahedron_id );
196197
for( const auto v : LRange{ 4 } )
197198
{
198-
const auto solid_vertex =
199-
this->polyhedron_vertex( { tetrahedron_id, v } );
200-
if( solid_vertex != edge_vertices[0]
201-
&& solid_vertex != edge_vertices[1] )
199+
if( solid_vertices[v] != edge_vertices[0]
200+
&& solid_vertices[v] != edge_vertices[1] )
202201
{
203202
OPENGEODE_EXCEPTION( count < 2,
204203
"[TetrahedralSolid::edge_incident_facets] Given edge "
@@ -207,6 +206,12 @@ namespace geode
207206
count++;
208207
}
209208
}
209+
OPENGEODE_EXCEPTION( count == 2,
210+
"[TetrahedralSolid::edge_incident_facets] Given tetrahedron has "
211+
"more than two times given vertices (",
212+
edge_vertices[0], ", ", edge_vertices[1], "): ", solid_vertices[0],
213+
", ", solid_vertices[1], ", ", solid_vertices[2], ", ",
214+
solid_vertices[3] );
210215
return facets;
211216
}
212217

0 commit comments

Comments
 (0)