68 const std::optional<int> point_start,
69 const std::optional<int> point_end,
70 const std::optional<float> factor_start,
71 const std::optional<float> factor_end,
72 const std::optional<int> inter_index_start,
73 const std::optional<int> inter_index_end);
83 if constexpr (std::is_invocable_r_v<void, Fn, int64_t, int64_t>) {
131 const float factor_i,
132 const float factor_j,
Low-level operations for grease pencil.
constexpr IndexRange index_range() const
int2 edge(Side side) const
bool has_intersection(Side side) const
void foreach_point(Fn &&fn) const
int wrap_index(int i) const
IndexRange point_range() const
int intersection_index[2]
static Segment from_curve(int curve_i, IndexRange points, bool cyclic)
constexpr Segment()=default
static Segment from_intersections(int curve_i, IndexRange points, const std::optional< int > point_start, const std::optional< int > point_end, const std::optional< float > factor_start, const std::optional< float > factor_end, const std::optional< int > inter_index_start, const std::optional< int > inter_index_end)
float intersection_factor[2]
void cut_caps(bke::CurvesGeometry &dst, const Span< Segment > segments, const Span< bool > segment_reversed, const Span< bool > cyclic, const OffsetIndices< int > segment_offsets)
EncodedConnection encode_index_and_side(const int index, const Side side)
constexpr EncodedConnection SEGMENT_CONNECTION_NULL
void compute_bounding_boxes(const OffsetIndices< int > src_points_by_curve, const Span< float2 > screen_space_positions, MutableSpan< Bounds< float2 > > screen_space_bbox)
IntersectionPoint create_intersection(const int point_i, const int point_j, const float factor_i, const float factor_j, const int curve_i, const int curve_j)
void create_segments_from_intersections(const Span< Vector< int > > inters_per_curves, const OffsetIndices< int > points_by_curve, const Span< IntersectionPoint > &intersections, const VArray< bool > &cyclic, Vector< Segment > &all_segments, MutableSpan< int > segments_num_per_curve)
void store_segment_map_on_intersections(const Span< Segment > all_segments, MutableSpan< IntersectionPoint > intersections)
int decode_index(const EncodedConnection encoded)
int create_segments_from_intersections_single_curve(const int curve_k, const Span< Vector< int > > inters_per_curves, const OffsetIndices< int > points_by_curve, const Span< IntersectionPoint > &intersections, const VArray< bool > &cyclic, Vector< Segment > &all_segments)
Side decode_side(const EncodedConnection encoded)
VecBase< EncodedConnection, 2 > SegmentConnections
void follow_segment_connections(const Span< Segment > all_segments, const Span< bool > segments_to_keep, const Span< SegmentConnections > segment_connections, Vector< Segment > &segments, Vector< int > &segment_offset_data, Vector< bool > &segment_reversed, Vector< bool > &cyclic)
static constexpr int BBOX_PADDING
void find_intersections_between_all_curves(const Span< float2 > screen_space_positions, const Span< Bounds< float2 > > screen_space_bbox, const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, const IndexMask &visible_curves, Array< Vector< int > > &r_inters_per_curves, Vector< IntersectionPoint > &r_intersections)
void create_connections_from_curves(const OffsetIndices< int > segments_by_curve, const Span< bool > segments_to_keep, const VArray< bool > &is_cyclic, MutableSpan< SegmentConnections > segment_connections)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< int32_t, 2 > int2
float point_for_curve(const int curve) const
constexpr IntersectionPoint()=default
int other_curve(const int curve) const
float parameter_for_curve(const int curve) const
float factor_for_curve(const int curve) const