-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: findSpan may be stuck in an infinite loop in this case. #16
Comments
Hi,
This at least cured my problems |
I stumbled upon the same issue and I'm relatively sure I know what's up. // For values of u that lies outside the domain
if (u > (knots[n + 1] - std::numeric_limits<T>::epsilon()))
{
return n;
}
if (u < (knots[degree] + std::numeric_limits<T>::epsilon()))
{
return degree;
} std::numeric_limits::epsilon() is defined to be FLT_EPSILON which is defined as That means if knots[n + 1] is indeed 1.0f, this works. By the nature of floating point representation however, the delta between a value and closest possible next value increases for bigger values. In my case where knots[n +1] was 3.0f, this delta is 2.384185791015625e-7 which is bigger than FLT_EPSILON (1.192092896e-07F). The question now is why this specific approach was chosen instead of just using <= and >= instead of < and > respectively. |
Hi, |
Hi ~ Tinynurbs is a nice library ~
But I encountered a problem when I was using the following code.
findSpan will be stuck in an infinite loop.
The text was updated successfully, but these errors were encountered: