27using bke::CurvesGeometry;
33 const int samples_num)
37 sample_by_point[0] = 0.0f;
39 sample_by_point[i] = sample_by_point[i - 1] +
math::distance(positions[i - 1], positions[i]);
41 sample_by_point.
last() = cyclic ? sample_by_point[points.
size() - 1] +
43 sample_by_point[points.
size() - 1];
46 constexpr float length_epsilon = 1e-4f;
47 if (sample_by_point.
last() <= length_epsilon) {
51 const float total_length = sample_by_point.
last();
53 const float length_to_sample_count =
math::safe_divide(
float(samples_num), total_length);
54 for (
float &sample_value : sample_by_point) {
55 sample_value *= length_to_sample_count;
58 return sample_by_point;
73 const int num_free_samples = num_dst_points - int(src_points.
size());
75 src_positions, cyclic, num_free_samples);
77 int samples_start = 0;
78 for (
const int src_point_i : src_points) {
79 dst_sample_offsets[src_point_i] = samples_start;
82 const int free_samples =
math::round(sample_by_point[src_point_i + 1]) -
84 samples_start += 1 + free_samples;
88 dst_sample_offsets.
last() = num_dst_points;
96 const int num_dst_points = r_indices.
size();
100 if (num_dst_points == 0) {
103 if (num_dst_points == 1) {
104 r_indices.
first() = 0;
105 r_factors.
first() = 0.0f;
112 if (src_points.
size() == 1) {
114 r_factors.
fill(0.0f);
122 if (num_dst_points >= src_points.
size()) {
128 for (
const int src_point_i : src_points.
index_range()) {
129 const IndexRange samples = dst_samples_by_src_point[src_point_i];
131 r_indices.
slice(samples).
fill(src_point_i);
133 const int sample = samples[sample_i];
134 const float factor =
float(sample_i) / samples.
size();
135 r_factors[
sample] = factor;
141 positions, cyclic, num_dst_points - (cyclic ? 0 : 1));
143 for (
const int src_point_i : src_points.
index_range()) {
144 const float sample_start = sample_by_point[src_point_i];
145 const float sample_end = sample_by_point[src_point_i + 1];
149 for (
const int sample : samples) {
150 r_indices[
sample] = src_point_i;
152 sample_end - sample_start);
156 r_indices.
last() = src_points.
size() - 1;
157 r_factors.
last() = 0.0f;
172 const int index = r_indices[i];
173 const float factor = r_factors[i];
174 const bool is_last_segment =
index >= points_num - 1;
176 if (is_last_segment && factor > 0.0f) {
177 reverse_indices.
append(points_num - 1);
178 reverse_factors.
append(1.0f - factor);
183 const int index = r_indices[i];
184 const float factor = r_factors[i];
185 const bool is_last_segment =
index >= points_num - 1;
189 if (is_last_segment) {
193 reverse_factors.
append(1.0f - r_factors[i]);
198 reverse_factors.
append(0.0f);
207 const int curve_index,
219 const int points_num = positions.
size();
221 for (
const int i : reverse_positions.
index_range()) {
222 reverse_positions[i] = positions[points_num - 1 - i];
239 const std::array<int, CURVE_TYPES_NUM> &type_counts)
245 if (
ELEM(name,
"handle_type_left",
"handle_type_right",
"handle_left",
"handle_right")) {
248 if (
ELEM(name,
"nurbs_weight")) {
266 return !no_interpolation.
contains(name);
293 const GVArray src_from_attribute = *src_from_attributes.
lookup(names[i], domain);
294 if (src_from_attribute) {
297 const GVArray src_to_attribute = *src_to_attributes.
lookup(names[i], domain, data_type);
299 result.src_from.append(src_from_attribute);
303 const GVArray src_to_attribute = *src_to_attributes.
lookup(names[i], domain);
310 result.src_to.append(src_to_attribute);
314 names[i], domain, data_type);
315 result.dst.append(std::move(dst_attribute));
343 if (iter.name ==
"position") {
347 names.
add(iter.name);
375 if (iter.name ==
"curve_type") {
379 names.
add(iter.name);
393 const GSpan src_data,
408 const int dst_points_num = dst_data.
size();
414 if constexpr (!std::is_same_v<T, std::string>) {
419 dst_curve_mask.
foreach_index([&](
const int i_dst_curve,
const int pos) {
420 const int i_src_curve = src_curve_indices[pos];
421 if (i_src_curve < 0) {
425 const IndexRange src_points = src_points_by_curve[i_src_curve];
426 const IndexRange dst_points = dst_points_by_curve[i_dst_curve];
430 dst_sample_indices.
slice(dst_points),
431 dst_sample_factors.
slice(dst_points),
432 dst.
slice(dst_points));
435 const IndexRange src_evaluated_points = src_evaluated_points_by_curve[i_src_curve];
436 evaluated_data.reinitialize(src_evaluated_points.
size());
438 i_src_curve, src.
slice(src_points), evaluated_data.as_mutable_span());
447 const int dst_i = dst_points[i];
448 const int dst_index = dst_sample_indices[dst_i];
449 const float dst_factor = dst_sample_factors[dst_i];
451 offsets[dst_index], offsets[dst_index + 1]);
453 const float segment_parameter = segment_eval.
first() +
454 dst_factor * segment_eval.
size();
456 dst_sample_indices_eval[i] =
math::floor(segment_parameter);
457 dst_sample_factors_eval[i] =
math::mod(segment_parameter, 1.0f);
461 const int src_size = src_points.
size();
462 const int eval_size = src_evaluated_points.
size();
465 const int dst_i = dst_points[i];
466 const int dst_index = dst_sample_indices[dst_i];
467 const float dst_factor = dst_sample_factors[dst_i];
469 const float segment_parameter = (dst_index + dst_factor) *
float(eval_size) /
472 dst_sample_indices_eval[i] =
math::floor(segment_parameter);
473 dst_sample_factors_eval[i] =
math::mod(segment_parameter, 1.0f);
477 const int resolution = resolutions[i_src_curve];
480 const int dst_i = dst_points[i];
481 const int dst_index = dst_sample_indices[dst_i];
482 const float dst_factor = dst_sample_factors[dst_i];
484 const float segment_parameter = (dst_index + dst_factor) * resolution;
486 dst_sample_indices_eval[i] =
math::floor(segment_parameter);
487 dst_sample_factors_eval[i] =
math::mod(segment_parameter, 1.0f);
492 dst_sample_indices_eval,
493 dst_sample_factors_eval,
494 dst.slice(dst_points));
503 const float t = parameter;
504 const float s = 1.0f - parameter;
506 s * (3.0f * t - 1.0f),
507 9.0f * t * t - 10.0f * t,
508 10.0f * s - 9.0f * s * s,
509 t * (3.0f * t - 2.0f),
514 const int src_index_last,
517 int src_index_a = src_index - 1;
518 int src_index_b = src_index;
519 int src_index_c = src_index + 1;
520 int src_index_d = src_index + 2;
522 if (src_index_a == -1) {
524 src_index_a = src_index_last;
531 if (src_index_c > src_index_last) {
533 src_index_c -= src_index_last;
536 src_index_c = src_index_last;
540 if (src_index_d > src_index_last) {
542 src_index_d -= src_index_last;
545 src_index_d = src_index_last;
549 return int4(src_index_a, src_index_b, src_index_c, src_index_d);
571 const int i_prev = (i - 1 + dst_points.
size()) % dst_points.
size();
572 const int i_next = (i + 1) % dst_points.
size();
575 if (cyclic || i != 0) {
582 if (cyclic || i != dst_points.
size() - 1) {
609 const int src_index = dst_indices[i];
610 const float src_factor = dst_factors[i];
612 const int i_prev = (i - 1 + dst_points.
size()) % dst_points.
size();
613 const float src_factor_prev = dst_factors[i_prev];
615 const int i_next = (i + 1) % dst_points.
size();
616 const float src_factor_next = dst_factors[i_next];
620 const float3 &pos_a = src_pos[src_indices[0]];
621 const float3 &pos_b = src_pos[src_indices[1]];
622 const float3 &pos_c = src_pos[src_indices[2]];
623 const float3 &pos_d = src_pos[src_indices[3]];
625 if (src_factor == 0.0f) {
626 dst_pos[i] = src_pos[src_index];
629 const float3 derivative = 0.5f * (pos_c - pos_a);
630 dst_right[i] = dst_pos[i] + derivative / 3.0f;
631 dst_left[i] = dst_pos[i] - derivative / 3.0f;
633 if ((cyclic || i != 0) && dst_indices[i_prev] == src_index - 1) {
634 dst_left[i] = dst_pos[i] + (dst_left[i] - dst_pos[i]) * (1.0f - src_factor_prev);
636 if ((cyclic || i != dst_points.
size() - 1) && dst_indices[i_next] == src_index) {
637 dst_right[i] = dst_pos[i] + (dst_right[i] - dst_pos[i]) * src_factor_next;
649 dwdt, pos_a, pos_b, pos_c, pos_d);
652 dst_right[i] = dst_pos[i] + derivative / 3.0f;
653 dst_left[i] = dst_pos[i] - derivative / 3.0f;
655 if ((cyclic || i != 0) && dst_indices[i_prev] == src_index - 1) {
656 dst_left[i] = dst_pos[i] + (dst_left[i] - dst_pos[i]) * (src_factor - src_factor_prev);
658 if ((cyclic || i != dst_points.
size() - 1) && dst_indices[i_next] == src_index) {
659 dst_right[i] = dst_pos[i] + (dst_right[i] - dst_pos[i]) * (src_factor_next - src_factor);
686 const int src_index = dst_indices[i];
687 const float src_factor = dst_factors[i];
689 const int i_prev = (i - 1 + dst_points.
size()) % dst_points.
size();
690 const float src_factor_prev = dst_factors[i_prev];
692 const int i_next = (i + 1) % dst_points.
size();
693 const float src_factor_next = dst_factors[i_next];
695 if (src_factor == 0.0f) {
696 dst_pos[i] = src_pos[src_index];
697 dst_left[i] = src_left[src_index];
698 dst_right[i] = src_right[src_index];
700 if ((cyclic || i != 0) && dst_indices[i_prev] == src_index - 1) {
701 dst_left[i] = dst_pos[i] + (dst_left[i] - dst_pos[i]) * (1.0f - src_factor_prev);
703 if ((cyclic || i != dst_points.
size() - 1) && dst_indices[i_next] == src_index) {
704 dst_right[i] = dst_pos[i] + (dst_right[i] - dst_pos[i]) * src_factor_next;
707 dst_types_left[i] = src_types_left[src_index];
708 dst_types_right[i] = src_types_right[src_index];
711 const int src_index_next = (src_index + 1) % src_pos.
size();
715 src_right[src_index],
716 src_left[src_index_next],
717 src_pos[src_index_next],
724 if ((cyclic || i != 0) && dst_indices[i_prev] == src_index) {
726 dst_left[i] = dst_pos[i] +
727 (dst_left[i] - dst_pos[i]) * (src_factor - src_factor_prev) / src_factor;
729 if ((cyclic || i != dst_points.
size() - 1) && dst_indices[i_next] == src_index) {
732 dst_right[i] = dst_pos[i] + (dst_right[i] - dst_pos[i]) * (src_factor_next - src_factor) /
775 const int dst_points_num = dst_positions.
size();
782 dst_curve_mask.
foreach_index([&](
const int i_dst_curve,
const int pos) {
783 const int i_src_curve = src_curve_indices[pos];
784 if (i_src_curve < 0) {
788 const bool cyclic = src_cyclic[i_src_curve];
790 const IndexRange src_points = src_points_by_curve[i_src_curve];
791 const IndexRange dst_points = dst_points_by_curve[i_dst_curve];
796 const Span<int> dst_indices = dst_sample_indices.
slice(dst_points);
811 dst_types[i_dst_curve],
831 dst_types[i_dst_curve],
867 const float mix_factor,
870 if (mix_factor == 0.0f) {
873 else if (mix_factor == 1.0f) {
890 if constexpr (!std::is_same_v<T, std::string>) {
891 const Span<T> from = src_from.typed<T>();
892 const Span<T> to = src_to.typed<T>();
893 const MutableSpan<T> dst_typed = dst.typed<T>();
894 selection.foreach_index(
895 [&](const int curve) {
896 const float mix_factor = mix_factors[curve];
897 if (mix_factor == 0.0f) {
898 dst_typed[curve] = from[curve];
900 else if (mix_factor == 1.0f) {
901 dst_typed[curve] = to[curve];
904 dst_typed[curve] = math::interpolate(from[curve], to[curve], mix_factor);
907 exec_mode::grain_size(512));
920 [&](
const int curve) {
923 if constexpr (!std::is_same_v<T, std::string>) {
924 const Span<T> from = src_from.typed<T>();
925 const Span<T> to = src_to.typed<T>();
926 const MutableSpan<T> dst_typed = dst.typed<T>();
928 from.slice(range), to.slice(range), mix_factors[curve], dst_typed.slice(range));
962 [&](
const int curve) {
963 for (
const int i : groups[curve]) {
978 dst_curve_mask.
foreach_index([&](
const int i_dst_curve,
const int pos) {
979 const int i_from_curve = from_curve_indices[pos];
980 const int i_to_curve = to_curve_indices[pos];
982 if (i_from_curve < 0) {
983 dst_curve_types[i_dst_curve] = to_types[i_to_curve];
986 if (i_to_curve < 0) {
987 dst_curve_types[i_dst_curve] = from_types[i_from_curve];
991 const int8_t from_type = from_types[i_from_curve];
1019 const float mix_factor,
1053 from_curves, to_curves, dst_curves);
1055 from_curves, to_curves, dst_curves);
1064 [&](
const int i_dst_curve,
const int pos) {
1065 const int i_from_curve = from_curve_indices[pos];
1066 const int i_to_curve = to_curve_indices[pos];
1067 if (i_from_curve >= 0 && i_to_curve >= 0) {
1068 mix_factors[i_dst_curve] = mix_factor;
1069 mix_from_to[i_dst_curve] =
true;
1070 exclusive_from[i_dst_curve] =
false;
1071 exclusive_to[i_dst_curve] =
false;
1073 else if (i_to_curve >= 0) {
1074 mix_factors[i_dst_curve] = 1.0f;
1075 mix_from_to[i_dst_curve] =
false;
1076 exclusive_from[i_dst_curve] =
false;
1077 exclusive_to[i_dst_curve] =
true;
1080 mix_factors[i_dst_curve] = 0.0f;
1081 mix_from_to[i_dst_curve] =
false;
1082 exclusive_from[i_dst_curve] =
true;
1083 exclusive_to[i_dst_curve] =
false;
1097 for (
const int i_attribute : point_attributes.
dst.index_range()) {
1099 if (!point_attributes.
dst[i_attribute]) {
1103 const GSpan src_from = point_attributes.
src_from[i_attribute];
1104 const GSpan src_to = point_attributes.
src_to[i_attribute];
1114 dst_points_by_curve,
1117 from_sample_indices,
1118 from_sample_factors,
1122 dst_points_by_curve,
1128 mix_arrays(from_samples, to_samples, mix_factors, dst_curve_mask, dst_points_by_curve, dst);
1133 dst_points_by_curve,
1136 from_sample_indices,
1137 from_sample_factors,
1143 dst_points_by_curve,
1170 dst_points_by_curve,
1173 from_sample_indices,
1174 from_sample_factors,
1182 dst_points_by_curve,
1197 dst_points_by_curve,
1203 dst_points_by_curve,
1209 dst_points_by_curve,
1215 dst_points_by_curve,
1220 dst_points_by_curve,
1226 for (
const int i_attribute : curve_attributes.
dst.index_range()) {
1228 if (!curve_attributes.
dst[i_attribute]) {
1232 const GSpan src_from = curve_attributes.
src_from[i_attribute];
1233 const GSpan src_to = curve_attributes.
src_to[i_attribute];
1251 mix_arrays(from_samples, to_samples, mix_factors, mix_curve_mask, dst);
1274 const int curve_index,
1280 const Span<float> segment_lengths =
curves.evaluated_lengths_for_curve(curve_index, cyclic);
1283 r_segment_indices.
fill(0);
1284 r_factors.
fill(0.0f);
1290 segment_lengths, !cyclic, r_segment_indices, r_factors);
1303 const float mix_factor,
1326 [&](
const int i_dst_curve,
const int pos) {
1327 const int i_from_curve = from_curve_indices[pos];
1328 const int i_to_curve = to_curve_indices[pos];
1330 const IndexRange dst_points = dst_points_by_curve[i_dst_curve];
1334 from_curves_cyclic[i_from_curve],
1340 to_curves_cyclic[i_to_curve],
1341 dst_curve_flip_direction[i_dst_curve],
1351 from_sample_indices,
1353 from_sample_factors,
Low-level operations for curves.
#define BLI_assert_unreachable()
Span< T > as_span() const
MutableSpan< T > as_mutable_span()
const T & last(const int64_t n=0) const
IndexRange index_range() const
const CPPType & type() const
MutableSpan< T > typed() const
const CPPType & type() const
const CPPType & type() const
static GVArray from_span(GSpan span)
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &memory)
constexpr int64_t first() const
constexpr int64_t size() const
constexpr bool is_empty() const
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr IndexRange index_range() const
static constexpr IndexRange from_begin_end_inclusive(const int64_t begin, const int64_t last)
constexpr IndexRange drop_front(int64_t n) const
constexpr int64_t size() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr void fill(const T &value) const
constexpr T & first() const
constexpr IndexRange index_range() const
constexpr void copy_from(Span< T > values) const
constexpr T & last(const int64_t n=0) const
bool contains(const Key &key) const
constexpr Span slice(int64_t start, int64_t size) const
constexpr const T & first() const
constexpr int64_t size() const
constexpr const T & last(const int64_t n=0) const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
void append(const T &value)
void reserve(const int64_t min_capacity)
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
GAttributeReader lookup(const StringRef name) const
MutableSpan< int8_t > handle_types_left_for_write()
VArray< int8_t > curve_types() const
void ensure_can_interpolate_to_evaluated() const
void update_curve_types()
void calculate_bezier_auto_handles()
MutableSpan< float3 > positions_for_write()
MutableSpan< int8_t > handle_types_right_for_write()
std::optional< Span< float3 > > handle_positions_right() const
VArray< bool > cyclic() const
AttributeAccessor attributes() const
Span< float3 > positions() const
void interpolate_to_evaluated(int curve_index, GSpan src, GMutableSpan dst) const
void tag_topology_changed()
MutableSpan< float3 > handle_positions_right_for_write()
std::optional< Span< float3 > > handle_positions_left() const
Span< int > bezier_evaluated_offsets_for_curve(int curve_index) const
MutableSpan< int8_t > curve_types_for_write()
VArray< int8_t > handle_types_left() const
void ensure_evaluated_lengths() const
OffsetIndices< int > evaluated_points_by_curve() const
MutableSpan< float3 > handle_positions_left_for_write()
const std::array< int, CURVE_TYPES_NUM > & curve_type_counts() const
VArray< int > resolution() const
VArray< int8_t > handle_types_right() const
OffsetIndices< int > points_by_curve() const
MutableAttributeAccessor attributes_for_write()
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
constexpr Span slice(int64_t start, int64_t size) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
void fill_index_range(MutableSpan< T > span, const T start=0)
T mix4(const float4 &weights, const T &v0, const T &v1, const T &v2, const T &v3)
void to_static_type(const CPPType &cpp_type, Fn &&fn)
Insertion insert(const float3 &point_prev, const float3 &handle_prev, const float3 &handle_next, const float3 &point_next, float parameter)
float4 calculate_basis(const float parameter)
bool attribute_name_is_anonymous(const StringRef name)
AttrType cpp_type_to_attribute_type(const CPPType &type)
constexpr ParallelGrainSize grain_size(int grain_size)
static void sample_catmull_rom_curve_positions_handles(const bool cyclic, const IndexRange src_points, const Span< float3 > src_pos, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, const int8_t dst_type, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
static AttributesForInterpolation retrieve_attribute_spans(const Span< StringRef > names, const CurvesGeometry &src_from_curves, const CurvesGeometry &src_to_curves, const bke::AttrDomain domain, CurvesGeometry &dst_curves)
static AttributesForInterpolation gather_curve_attributes_to_interpolate(const CurvesGeometry &from_curves, const CurvesGeometry &to_curves, CurvesGeometry &dst_curves)
static void mix_arrays(const Span< T > from, const Span< T > to, const float mix_factor, const MutableSpan< T > dst)
void interpolate_curves_with_samples(const bke::CurvesGeometry &from_curves, const bke::CurvesGeometry &to_curves, Span< int > from_curve_indices, Span< int > to_curve_indices, Span< int > from_sample_indices, Span< int > to_sample_indices, Span< float > from_sample_factors, Span< float > to_sample_factors, const IndexMask &dst_curve_mask, float mix_factor, bke::CurvesGeometry &dst_curves, IndexMaskMemory &memory)
static void sample_poly_curve_positions_handles(const bool cyclic, const Span< float3 > src_pos, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, const int8_t dst_type, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
static void sample_curve_positions_and_handles(const bke::CurvesGeometry &src_curves, const Span< int > src_curve_indices, const OffsetIndices< int > dst_points_by_curve, const VArray< int8_t > dst_types, const IndexMask &dst_curve_mask, const Span< int > dst_sample_indices, const Span< float > dst_sample_factors, MutableSpan< float3 > dst_positions, MutableSpan< float3 > dst_handles_left, MutableSpan< float3 > dst_handles_right, MutableSpan< int8_t > dst_handle_types_left, MutableSpan< int8_t > dst_handle_types_right)
static float4 calculate_catmull_rom_basis_derivative(const float parameter)
static Array< float > build_point_to_sample_map(const Span< float3 > positions, const bool cyclic, const int samples_num)
static void mix_curve_type(const Span< int > from_curve_indices, const Span< int > to_curve_indices, const VArray< int8_t > &from_types, const VArray< int8_t > &to_types, const IndexMask &dst_curve_mask, MutableSpan< int8_t > dst_curve_types)
void sample_curve_padded(const Span< float3 > positions, bool cyclic, MutableSpan< int > r_indices, MutableSpan< float > r_factors)
static void sample_curve_attribute(const bke::CurvesGeometry &src_curves, const Span< int > src_curve_indices, const OffsetIndices< int > dst_points_by_curve, const GSpan src_data, const IndexMask &dst_curve_mask, const Span< int > dst_sample_indices, const Span< float > dst_sample_factors, GMutableSpan dst_data)
static void mix_handle_type_arrays(const Span< int8_t > src_from, const Span< int8_t > src_to, const IndexMask &group_selection, const OffsetIndices< int > groups, const MutableSpan< int8_t > dst)
static int4 get_catmull_rom_indices(const int src_index, const int src_index_last, const bool cyclic)
static void sample_curve_uniform(const bke::CurvesGeometry &curves, const int curve_index, const bool cyclic, const bool reverse, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
void interpolate_curves(const bke::CurvesGeometry &from_curves, const bke::CurvesGeometry &to_curves, Span< int > from_curve_indices, Span< int > to_curve_indices, const IndexMask &dst_curve_mask, Span< bool > dst_curve_flip_direction, float mix_factor, bke::CurvesGeometry &dst_curves, IndexMaskMemory &memory)
static bool interpolate_attribute_to_curves(const StringRef name, const std::array< int, CURVE_TYPES_NUM > &type_counts)
static void assign_samples_to_segments(const int num_dst_points, const Span< float3 > src_positions, const bool cyclic, MutableSpan< int > dst_sample_offsets)
static int8_t mix_handle_type(const int8_t from_type, const int8_t to_type)
static AttributesForInterpolation gather_point_attributes_to_interpolate(const CurvesGeometry &from_curves, const CurvesGeometry &to_curves, CurvesGeometry &dst_curves)
static bool interpolate_attribute_to_poly_curve(const StringRef name)
static void reverse_samples(const int points_num, MutableSpan< int > r_indices, MutableSpan< float > r_factors)
static void sample_bezier_curve_positions_handles(const bool cyclic, const IndexRange src_points, const Span< float3 > src_pos, const Span< float3 > src_handle_left, const Span< float3 > src_handle_right, const Span< int8_t > src_types_left, const Span< int8_t > src_types_right, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
void sample_uniform_reverse(Span< float > accumulated_segment_lengths, bool include_first_point, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
void interpolate(const Span< T > src, const Span< int > indices, const Span< float > factors, MutableSpan< T > dst)
void sample_uniform(Span< float > accumulated_segment_lengths, bool include_last_point, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
T safe_divide(const T &a, const T &b)
T distance(const T &a, const T &b)
T interpolate(const T &a, const T &b, const FactorT &t)
T mod(const T &a, const T &b)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< int32_t, 4 > int4
VecBase< float, 4 > float4
VecBase< float, 3 > float3
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Vector< bke::GSpanAttributeWriter > dst
Vector< GVArraySpan > src_from
Vector< GVArraySpan > src_to