Skip to content

Commit

Permalink
Merge pull request #2363 from RubioJr9/superquadric_hole_fix
Browse files Browse the repository at this point in the history
Fix for Holes in Superquadric Tensor Glyphs
  • Loading branch information
dcwhite committed Feb 7, 2022
2 parents 39fa832 + 57499b5 commit 58f20dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Graphics/Glyphs/GlyphGeomUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ class SCISHARE GlyphGeomUtility

inline double GlyphGeomUtility::spow(double e, double x)
{
if (std::abs(e) < 1.0e-14)
return 0.0;
static const auto EPSILON = 1.0e-6;
// This for round off of very small numbers.
if (std::abs(e) < EPSILON)
e = 0.0;

if (e < 0.0)
return -std::pow(-e, x);
else
Expand Down

0 comments on commit 58f20dd

Please sign in to comment.