Skip to content

Commit 8ba517b

Browse files
committed
fix(qualiy): returns 0 if the volume is 0.
1 parent a3cccab commit 8ba517b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/geode/geometry/quality.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ namespace geode
166166
double tetrahedron_volume_to_edge_ratio( const Tetrahedron& tetra )
167167
{
168168
const auto signed_volume = geode::tetrahedron_signed_volume( tetra );
169+
if( signed_volume < 0. )
170+
{
171+
return 0.;
172+
}
169173
double sq_len{ 0 };
170174
const auto& vertices = tetra.vertices();
171175
for( const auto v0 : geode::LRange{ 3 } )

0 commit comments

Comments
 (0)