Ts: fix buggy derivative cases, and improve test coverage.
authorPixneb <Pixneb@users.noreply.github.com>
Sat, 3 Feb 2024 03:59:14 +0000 (19:59 -0800)
committerpixar-oss <pixar-oss@users.noreply.github.com>
Sat, 3 Feb 2024 04:11:16 +0000 (20:11 -0800)
commit976dd6fd42ccabfe432cba308e6e315c92e11617
treeb7e7730aea1723aa5bac373b2ec326b8d7ff1607
parentbf57f55e5400e2ca8caf130136ce4ca117362e1e
Ts: fix buggy derivative cases, and improve test coverage.

Derivatives are supposed to reflect what happens in value evaluation.  There
were several cases where derivatives disagreed with the curve shape given by
value evaluation.

Most of these cases involved linear and/or held knots.

Some example cases - not an exhaustive list:

- Derviatives at all linear knots were incorrectly evaluated from one of the
  spline's extrapolation slopes.

- Ineffective tangent values on linear and held knots were incorrectly being
  considered at neighboring knots.

- Ineffective extrapolation-facing tangent values on Bezier knots were
  incorrectly being returned verbatim, even when held extrapolation means that
  these slopes are zero.  This was the only case involving Bezier knots.

This change completely rewrites Ts_Eval, and partially rewrites some of its
helpers.  Some test baselines that codified the incorrect behavior have been
updated.

Add testTsDerivatives.  I believe this covers all possible derivative cases.

Derivatives are well-defined for value types that are, in the language of
TsTraits, extrapolatable.  This is a bit of a misnomer.  It is true that
"extrapolatable" means "we will perform extrapolation".  But it also means "we
can determine a slope".

(Internal change: 2313969)
pxr/base/ts/CMakeLists.txt
pxr/base/ts/data.h
pxr/base/ts/evalUtils.cpp
pxr/base/ts/keyFrame.cpp
pxr/base/ts/keyFrame.h
pxr/base/ts/testenv/testTsDerivatives.py [new file with mode: 0644]
pxr/base/ts/testenv/testTsSpline.py
pxr/base/ts/testenv/testTs_HardToReach.cpp
pxr/base/ts/types.h