24 const int total_points = points_to_delete.
as_span().count(
false);
27 if (total_points == 0) {
31 int curr_dst_point_id = 0;
38 const IndexRange points = points_by_curve[curve_i];
39 const Span<bool> curve_points_to_delete = points_to_delete.
as_span().slice(points);
40 const bool curve_cyclic = src_cyclic[curve_i];
50 const bool is_last_segment_selected = curve_cyclic && ranges_to_keep.
first().first() == 0 &&
51 ranges_to_keep.
last().last() == points.
size() - 1;
52 const bool is_curve_self_joined = is_last_segment_selected && ranges_to_keep.
size() != 1;
53 const bool is_cyclic = ranges_to_keep.
size() == 1 && is_last_segment_selected;
58 const IndexRange range = ranges_to_keep[range_i];
61 for (
const int src_point : range.
shift(points.
first())) {
62 dst_to_src_point[curr_dst_point_id++] = src_point;
66 if (is_curve_self_joined && range_i == range_ids.
last()) {
68 for (
const int src_point : first_range.
shift(points.
first())) {
69 dst_to_src_point[curr_dst_point_id++] = src_point;
75 dst_to_src_curve.
append(curve_i);
80 const int total_curves = dst_to_src_curve.
size();
94 gather_attributes(src_attributes,
103 gather_attributes(src_attributes,
Low-level operations for curves.
Low-level operations for curves.
Span< T > as_span() const
MutableSpan< T > as_mutable_span()
constexpr int64_t first() const
constexpr IndexRange shift(int64_t n) const
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr IndexRange drop_front(int64_t n) const
constexpr MutableSpan drop_back(const int64_t n) const
void append(const T &value)
const T & last(const int64_t n=0) const
IndexRange index_range() const
Span< T > as_span() const
void remove_attributes_based_on_types()
OffsetIndices< int > points_by_curve() const
IndexRange curves_range() const
void update_curve_types()
MutableAttributeAccessor attributes_for_write()
AttributeAccessor attributes() const
MutableSpan< int > offsets_for_write()
bool nurbs_has_custom_knots() const
VArray< bool > cyclic() const
MutableSpan< bool > cyclic_for_write()
static bool is_cyclic(const Nurb *nu)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void copy(const GVArray &src, GMutableSpan dst, int64_t grain_size=4096)
Vector< IndexRange > find_all_ranges(const Span< T > span, const T &value)
void update_custom_knot_modes(const IndexMask &mask, const KnotsMode mode_for_regular, const KnotsMode mode_for_cyclic, bke::CurvesGeometry &curves)
auto attribute_filter_from_skip_ref(const Span< StringRef > skip)
bke::CurvesGeometry remove_points_and_split(const bke::CurvesGeometry &curves, const IndexMask &mask)
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
ListBase vertex_group_names