Freedom-of-Form-Foundation / anatomy3d

A CAD tool for humanoid anatomy alterations. See the anatomy3d-blender repository for more recent work.
https://freedomofform.org/1856/3d-anatomy-project-scope-phase-1-focus-on-a-limb-joint/
GNU General Public License v2.0
7 stars 5 forks source link

Write debug safety checks for all polynomial functions and polynomial splines to reject infinities or NaNs #68

Closed Lathreas closed 2 years ago

Lathreas commented 2 years ago

As we discussed during the meeting, indeed it would be much cleaner to "explicitly not support" infinities or NaNs as inputs for polynomial functions, since they are expected to fail anyway. We should aim to write debug asserts that check for infinities as input parameters in polynomial 'solve' functions.

Note though that outputs don't need to be (and perhaps even shouldn't be) checked, since Solve() sometimes doesn't have a solution, in which case it returns NaN, which is perfectly valid. Of course, the function that calls Solve() must check whether the return value is NaN before continuing.