diff options
Diffstat (limited to 'source/blender/blenlib/BLI_length_parameterize.hh')
-rw-r--r-- | source/blender/blenlib/BLI_length_parameterize.hh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_length_parameterize.hh b/source/blender/blenlib/BLI_length_parameterize.hh index e4a4e9cbb9c..6fe1c6513a2 100644 --- a/source/blender/blenlib/BLI_length_parameterize.hh +++ b/source/blender/blenlib/BLI_length_parameterize.hh @@ -77,4 +77,22 @@ void create_uniform_samples(Span<float> lengths, MutableSpan<int> indices, MutableSpan<float> factors); +/** + * For each provided sample length, find the segment index and interpolation factor. + * + * \param lengths: The accumulated lengths of the original elements being sampled. + * Could be calculated by #accumulate_lengths. + * \param sample_lengths: Sampled locations in the #lengths array. Must be sorted and is expected + * to be within the range of the #lengths values. + * \param cyclic: Whether the points described by the #lenghts input is cyclic. This is likely + * redundant information theoretically. + * \param indices: The index of the previous point at each sample. + * \param factors: The portion of the length in each segment at each sample. + */ +void create_samples_from_sorted_lengths(Span<float> lengths, + Span<float> sample_lengths, + bool cyclic, + MutableSpan<int> indices, + MutableSpan<float> factors); + } // namespace blender::length_parameterize |