|
Blender V5.3
|
Classes | |
| class | Segment |
| struct | IntersectionPoint |
Typedefs | |
| using | EncodedConnection = int |
| using | SegmentConnections = VecBase<EncodedConnection, 2> |
Enumerations | |
| enum | Side : uint8_t { Start = 0 , End = 1 } |
Functions | |
| static float | get_intersection_distance_of_segments (const float2 &co_a, const float2 &co_b, const float2 &co_c, const float2 &co_d) |
| 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) |
| static void | find_intersections_between_curve_and_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, const int curve_i, Array< Vector< int > > &r_inters_per_curves, Vector< IntersectionPoint > &r_intersections) |
| 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 | store_segment_map_on_intersections (const Span< Segment > all_segments, MutableSpan< IntersectionPoint > intersections) |
| 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) |
| 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) |
| static bool | check_and_join_segments (Segment &first, const Segment &second) |
| 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) |
| int | decode_index (const EncodedConnection encoded) |
| Side | decode_side (const EncodedConnection encoded) |
| 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) |
| 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) |
| void | compute_bounding_boxes (const OffsetIndices< int > src_points_by_curve, const Span< float2 > screen_space_positions, MutableSpan< Bounds< float2 > > screen_space_bbox) |
| void | compute_bounding_boxes (const OffsetIndices< int > src_points_by_curve, const GroupedSpan< int > shapes, const Span< float2 > screen_space_positions, MutableSpan< Bounds< float2 > > screen_space_bbox) |
Variables | |
| static constexpr int | BBOX_PADDING = 2 |
| constexpr EncodedConnection | SEGMENT_CONNECTION_NULL = 0 |
Definition at line 136 of file grease_pencil_segments_intern.hh.
Definition at line 145 of file grease_pencil_segments_intern.hh.
| Enumerator | |
|---|---|
| Start | |
| End | |
Definition at line 19 of file grease_pencil_segments_intern.hh.
|
static |
Definition at line 492 of file grease_pencil_segments_geom.cc.
References check_and_join_segments(), blender::ed::greasepencil::segment::Segment::curve, End, blender::ed::greasepencil::segment::Segment::intersection_factor, blender::ed::greasepencil::segment::Segment::intersection_index, blender::ed::greasepencil::segment::Segment::points, and Start.
Referenced by check_and_join_segments(), and follow_segment_connections().
| void blender::ed::greasepencil::segment::compute_bounding_boxes | ( | const OffsetIndices< int > | src_points_by_curve, |
| const GroupedSpan< int > | shapes, | ||
| const Span< float2 > | screen_space_positions, | ||
| MutableSpan< Bounds< float2 > > | screen_space_bbox ) |
Definition at line 834 of file grease_pencil_segments_geom.cc.
References compute_bounding_boxes(), blender::offset_indices::GroupedSpan< T >::index_range(), and blender::threading::parallel_for().
| void blender::ed::greasepencil::segment::compute_bounding_boxes | ( | const OffsetIndices< int > | src_points_by_curve, |
| const Span< float2 > | screen_space_positions, | ||
| MutableSpan< Bounds< float2 > > | screen_space_bbox ) |
Definition at line 816 of file grease_pencil_segments_geom.cc.
References compute_bounding_boxes(), blender::offset_indices::OffsetIndices< T >::index_range(), and blender::threading::parallel_for().
Referenced by compute_bounding_boxes(), compute_bounding_boxes(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
| void blender::ed::greasepencil::segment::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 ) |
Definition at line 594 of file grease_pencil_segments_geom.cc.
References create_connections_from_curves(), blender::offset_indices::OffsetIndices< T >::index_range(), and blender::threading::parallel_for().
Referenced by create_connections_from_curves(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
| IntersectionPoint blender::ed::greasepencil::segment::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 ) |
Definition at line 203 of file grease_pencil_segments_geom.cc.
References create_intersection(), blender::ed::greasepencil::segment::IntersectionPoint::curve_i, blender::ed::greasepencil::segment::IntersectionPoint::curve_j, blender::ed::greasepencil::segment::IntersectionPoint::factor_i, blender::ed::greasepencil::segment::IntersectionPoint::factor_j, blender::ed::greasepencil::segment::IntersectionPoint::point_i, and blender::ed::greasepencil::segment::IntersectionPoint::point_j.
Referenced by create_intersection(), find_intersections_between_curve_and_curves(), and blender::ed::greasepencil::boolean::find_intersections_between_curves().
| void blender::ed::greasepencil::segment::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 ) |
Definition at line 479 of file grease_pencil_segments_geom.cc.
References create_segments_from_intersections(), create_segments_from_intersections_single_curve(), and blender::offset_indices::OffsetIndices< T >::index_range().
Referenced by create_segments_from_intersections(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
| int blender::ed::greasepencil::segment::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 ) |
Definition at line 366 of file grease_pencil_segments_geom.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::begin(), create_segments_from_intersections_single_curve(), blender::IndexRange::drop_back(), blender::Array< T, InlineBufferCapacity, Allocator >::end(), blender::ed::greasepencil::segment::IntersectionPoint::factor_for_curve(), blender::array_utils::fill_index_range(), blender::Array< T, InlineBufferCapacity, Allocator >::first(), blender::IndexRange::first(), blender::Span< T >::first(), blender::ed::greasepencil::segment::Segment::from_curve(), blender::ed::greasepencil::segment::Segment::from_intersections(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), blender::IndexRange::last(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::parallel_sort(), blender::ed::greasepencil::segment::IntersectionPoint::parameter_for_curve(), blender::ed::greasepencil::segment::IntersectionPoint::point_for_curve(), blender::Span< T >::size(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by create_segments_from_intersections(), create_segments_from_intersections_single_curve(), and blender::ed::greasepencil::boolean::execute_single_boolean().
| void blender::ed::greasepencil::segment::cut_caps | ( | bke::CurvesGeometry & | dst, |
| const Span< Segment > | segments, | ||
| const Span< bool > | segment_reversed, | ||
| const Span< bool > | cyclic, | ||
| const OffsetIndices< int > | segment_offsets ) |
Definition at line 530 of file grease_pencil_segments_geom.cc.
References blender::bke::CurvesGeometry::attributes_for_write(), blender::bke::Curve, cut_caps(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), and blender::threading::parallel_for().
Referenced by blender::ed::greasepencil::boolean::curve_boolean(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), cut_caps(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
| int blender::ed::greasepencil::segment::decode_index | ( | const EncodedConnection | encoded | ) |
Definition at line 584 of file grease_pencil_segments_geom.cc.
References blender::math::abs(), and decode_index().
Referenced by blender::ed::greasepencil::boolean::create_connections_from_intersection_points(), decode_index(), and follow_segment_connections().
| Side blender::ed::greasepencil::segment::decode_side | ( | const EncodedConnection | encoded | ) |
Definition at line 589 of file grease_pencil_segments_geom.cc.
References decode_side(), End, and Start.
Referenced by blender::ed::greasepencil::boolean::create_connections_from_intersection_points(), decode_side(), and follow_segment_connections().
| EncodedConnection blender::ed::greasepencil::segment::encode_index_and_side | ( | const int | index, |
| const Side | side ) |
Definition at line 579 of file grease_pencil_segments_geom.cc.
References encode_index_and_side(), and Start.
Referenced by blender::ed::greasepencil::boolean::create_connections_from_intersection_points(), and encode_index_and_side().
| void blender::ed::greasepencil::segment::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 ) |
Definition at line 317 of file grease_pencil_segments_geom.cc.
References find_intersections_between_all_curves(), find_intersections_between_curve_and_curves(), and blender::index_mask::IndexMask::foreach_index().
Referenced by find_intersections_between_all_curves(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
|
static |
Definition at line 221 of file grease_pencil_segments_geom.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), create_intersection(), blender::IndexRange::drop_back(), ELEM, find_intersections_between_curve_and_curves(), blender::index_mask::IndexMask::foreach_index(), get_intersection_distance_of_segments(), blender::IndexRange::index_range(), blender::bounds::intersect(), blender::math::isect_seg_seg(), blender::math::max(), blender::math::min(), blender::math::normalize(), blender::Bounds< T >::pad(), blender::IndexRange::size(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by find_intersections_between_all_curves(), and find_intersections_between_curve_and_curves().
| void blender::ed::greasepencil::segment::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 ) |
Definition at line 651 of file grease_pencil_segments_geom.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::BLI_assert(), BLI_assert_unreachable, check_and_join_segments(), decode_index(), decode_side(), End, blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), follow_segment_connections(), blender::Span< T >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::Vector< T, InlineBufferCapacity, Allocator >::remove_last(), SEGMENT_CONNECTION_NULL, blender::Span< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), and Start.
Referenced by blender::ed::greasepencil::boolean::execute_single_boolean(), follow_segment_connections(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
|
static |
Get the intersection distance of two line segments a-b and c-d. The intersection distance is defined as the normalized distance (0..1) from point a to the intersection point of a-b and c-d.
Definition at line 167 of file grease_pencil_segments_geom.cc.
References blender::math::abs(), blender::math::distance(), distance(), get_intersection_distance_of_segments(), and blender::math::safe_divide().
Referenced by find_intersections_between_curve_and_curves(), and get_intersection_distance_of_segments().
| void blender::ed::greasepencil::segment::store_segment_map_on_intersections | ( | const Span< Segment > | all_segments, |
| MutableSpan< IntersectionPoint > | intersections ) |
Definition at line 337 of file grease_pencil_segments_geom.cc.
References blender::ed::greasepencil::segment::IntersectionPoint::curve_i, End, blender::Span< T >::index_range(), blender::ed::greasepencil::segment::IntersectionPoint::segment_index_i, blender::ed::greasepencil::segment::IntersectionPoint::segment_index_j, Start, and store_segment_map_on_intersections().
Referenced by blender::ed::greasepencil::boolean::execute_single_boolean(), store_segment_map_on_intersections(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().
|
staticconstexpr |
Definition at line 17 of file grease_pencil_segments_intern.hh.
|
constexpr |
Definition at line 137 of file grease_pencil_segments_intern.hh.
Referenced by blender::ed::greasepencil::boolean::create_connections_from_intersection_points(), blender::ed::greasepencil::boolean::execute_single_boolean(), follow_segment_connections(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), and blender::ed::greasepencil::trim::trim_curve_segments().