Skip to content

Commit 32c5831

Browse files
authored
Merge pull request #1212 from Geode-solutions/fix/log-tet-edge-incident-facets
fix(Mesh): add more info in exception in TetrahedralSoli::edge_incide…
2 parents 7a23be9 + 120c7ff commit 32c5831

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

commitlint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default {
1+
const Configuration = {
22
extends: ["@commitlint/config-angular"],
33
rules: {
44
"scope-empty": [2, "never"],
@@ -12,5 +12,8 @@ export default {
1212
"subject-full-stop": [0],
1313
"type-case": [0],
1414
"type-empty": [0],
15+
"type-enum": [2, "always", ["feat", "fix", "perf"]],
1516
},
1617
}
18+
19+
export default Configuration

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)