Splines: Fix a single patch with both edges open

With only one patch, the open-last-edge adjustment assumed the first edge
was closed, so one knot interval came out as 2 instead of 1, and the
patch wasn't the Bezier patch a fully clamped cubic is. Positions were off
by up to about 7% of the patch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-30 11:11:23 -06:00
1 parent e8c39ed1a7
commit 22c2cea923
1 file changed
+2 -1
+2 -1
View File
@@ -150,7 +150,8 @@ private:
// knots[n + 2] = (float)n; // Got rid of this line optimized with KnotDiv
// knots[n + 3] = (float)n; // Got rid of this line optimized with KnotDiv
// knots[n + 4] = (float)n; // Got rid of this line optimized with KnotDiv
divs[n - 1]._4_1 = 1.0f / 2.0f;
// With a single patch whose first edge is open too, that knot interval is 1, not 2.
divs[n - 1]._4_1 = (n == 1 && (type & 1) != 0) ? 1.0f : 1.0f / 2.0f;
divs[n - 1]._5_2 = 1.0f;
divs[n - 1]._4_2 = 1.0f;
if (n > 1)