Files
test2/source
Lukas Tönne 7495d5222b Fix: Grease Pencil interpolation on cyclic curves shifts end point
Fix for unreported issue with Grease Pencil interpolation tool: on cyclic curves
the last point is interpolated between the end points of the curve, especially
noticeable with sequence interpolation.

This required handling a corner case in the curve sample mapping function.
This function is complex and hard to verify with the operator alone, leading to
frequent issues and discovery of yet more corner cases. For this reason i
refactored the sampling function and added new unit tests.
This should help avoid regressions and make it clear how the function is
expected to behave in various corner cases.

The `sample_curve_padded` function has been moved into the geometry module,
since the `sculpt_paint` module does not have tests yet and is intended mostly
for higher-level operator code. The function has been split to separate out the
"reverse" sampling mode, which reduces complexity. Reverse sampling is done by
first reversing the input curve points, doing regular sampling, and then
reversing the resulting samples.

The function can now sample to larger or smaller sample arrays:
- Larger output arrays have a point aligned with each source point as before,
  with the rest of the points evenly distributed over the source curve.
  This ensures that the output curve matches the source as closely as possible,
  especially for poly curves.
- Smaller output arrays are uniformly sampled along the length of the source
  curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/141946
2025-07-17 12:05:23 +02:00
..