Skip to content

Commit

Permalink
Fixed vertex::calc_rms_curvature()
Browse files Browse the repository at this point in the history
If the result of the curvature calculation is less than zero, a
curvature value of zero is returned.
  • Loading branch information
Pseudomanifold committed Feb 19, 2011
1 parent 88a068d commit 9164c68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,11 @@ double vertex::calc_rms_curvature() const
double H = this->calc_mean_curvature();
double K = this->calc_gaussian_curvature();

return(sqrt(4*H*H-2*K));
double squared_curvature = 4*H*H-2*K;
if(squared_curvature < 0)
return(0.0);
else
return(sqrt(squared_curvature));
}


Expand Down

0 comments on commit 9164c68

Please sign in to comment.