|
Blender V4.3
|
Classes | |
| struct | Segment |
| struct | Segments |
Enumerations | |
| enum | Side : uint8_t { Start = 0 , End = 1 } |
| enum | Distance : uint8_t { Min = 0 , Max = 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) |
| static void | get_intersections_of_curve_with_curves (const int src_curve, const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const Span< rcti > screen_space_curve_bounds, MutableSpan< bool > r_is_intersected_after_point, MutableSpan< float2 > r_intersection_distance) |
| static void | expand_trim_segment_direction (Segment &segment, const int direction, const bke::CurvesGeometry &src, const Span< bool > is_intersected_after_point, const Span< float2 > intersection_distance, MutableSpan< bool > point_is_in_segment) |
| static void | expand_trim_segment (Segment &segment, const bke::CurvesGeometry &src, const Span< bool > is_intersected_after_point, const Span< float2 > intersection_distance, MutableSpan< bool > point_is_in_segment) |
| bke::CurvesGeometry | trim_curve_segments (const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const Span< rcti > screen_space_curve_bounds, const IndexMask &curve_selection, const Vector< Vector< int > > &selected_points_in_curves, const bool keep_caps) |
Variables | |
| static constexpr int | BBOX_PADDING = 2 |
| static constexpr float | DISTANCE_FACTOR_THRESHOLD = 0.01f |
| Enumerator | |
|---|---|
| Min | |
| Max | |
Definition at line 832 of file grease_pencil_geom.cc.
| Enumerator | |
|---|---|
| Start | |
| End | |
Definition at line 831 of file grease_pencil_geom.cc.
|
static |
Expand a trim segment of one point by walking along the curve in both directions.
Definition at line 1155 of file grease_pencil_geom.cc.
References expand_trim_segment(), and expand_trim_segment_direction().
Referenced by expand_trim_segment(), and trim_curve_segments().
|
static |
Expand a trim segment by walking along the curve in forward or backward direction. A trim segments ends at an intersection with another curve, or at the outer end of the curve.
Definition at line 1079 of file grease_pencil_geom.cc.
References DISTANCE_FACTOR_THRESHOLD, expand_trim_segment_direction(), and blender::bke::CurvesGeometry::points_by_curve().
Referenced by expand_trim_segment(), and expand_trim_segment_direction().
|
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 942 of file grease_pencil_geom.cc.
References blender::math::clamp(), distance(), float, get_intersection_distance_of_segments(), and blender::math::length().
Referenced by get_intersection_distance_of_segments(), and get_intersections_of_curve_with_curves().
|
static |
For a curve, find all intersections with other curves.
Definition at line 975 of file grease_pencil_geom.cc.
References BBOX_PADDING, BLI_rcti_do_minmax_v(), BLI_rcti_init_minmax(), BLI_rcti_isect(), BLI_rcti_pad(), curve, blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), ELEM, blender::IndexRange::first(), FLT_MAX, get_intersection_distance_of_segments(), get_intersections_of_curve_with_curves(), int2, is_cyclic(), blender::math::isect_seg_seg(), blender::math::max(), blender::math::min(), blender::math::normalize(), blender::bke::CurvesGeometry::points_by_curve(), and size().
Referenced by get_intersections_of_curve_with_curves(), and trim_curve_segments().
| bke::CurvesGeometry blender::ed::greasepencil::trim::trim_curve_segments | ( | const bke::CurvesGeometry & | src, |
| const Span< float2 > | screen_space_positions, | ||
| const Span< rcti > | screen_space_curve_bounds, | ||
| const IndexMask & | curve_selection, | ||
| const Vector< Vector< int > > & | selected_points_in_curves, | ||
| const bool | keep_caps ) |
Definition at line 1172 of file grease_pencil_geom.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::ed::greasepencil::compute_topology_change(), blender::ed::greasepencil::trim::Segments::create_segment(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), DISTANCE_FACTOR_THRESHOLD, expand_trim_segment(), blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), get_intersections_of_curve_with_curves(), is_cyclic(), blender::IndexRange::last(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::greasepencil::trim::Segments::merge_adjacent_segments(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), pos, blender::ed::greasepencil::trim::Segments::segments, and trim_curve_segments().
Referenced by trim_curve_segments().
|
staticconstexpr |
Definition at line 836 of file grease_pencil_geom.cc.
Referenced by get_intersections_of_curve_with_curves().
|
staticconstexpr |
Definition at line 840 of file grease_pencil_geom.cc.
Referenced by expand_trim_segment_direction(), and trim_curve_segments().