|
Blender V5.0
|
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 |
| enum blender::ed::greasepencil::trim::Distance : uint8_t |
| Enumerator | |
|---|---|
| Min | |
| Max | |
Definition at line 907 of file grease_pencil_geom.cc.
| enum blender::ed::greasepencil::trim::Side : uint8_t |
| Enumerator | |
|---|---|
| Start | |
| End | |
Definition at line 906 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 1230 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 1154 of file grease_pencil_geom.cc.
References DISTANCE_FACTOR_THRESHOLD, End, expand_trim_segment_direction(), Max, Min, blender::bke::CurvesGeometry::points_by_curve(), and Start.
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 1017 of file grease_pencil_geom.cc.
References blender::math::clamp(), distance(), 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 1050 of file grease_pencil_geom.cc.
References BBOX_PADDING, BLI_rcti_do_minmax_v(), BLI_rcti_init_minmax(), BLI_rcti_isect(), BLI_rcti_pad(), 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(), is_cyclic(), blender::math::isect_seg_seg(), Max, blender::math::max(), Min, 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 1247 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, End, expand_trim_segment(), blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), get_intersections_of_curve_with_curves(), blender::ed::greasepencil::trim::Segment::intersection_distance, is_cyclic(), blender::ed::greasepencil::trim::Segment::is_intersected, blender::IndexRange::last(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::greasepencil::trim::Segments::merge_adjacent_segments(), blender::ed::greasepencil::trim::Segment::point_range, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), pos, blender::ed::greasepencil::trim::Segments::segments, Start, and trim_curve_segments().
Referenced by trim_curve_segments(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().
|
staticconstexpr |
Definition at line 911 of file grease_pencil_geom.cc.
Referenced by get_intersections_of_curve_with_curves().
|
staticconstexpr |
Definition at line 915 of file grease_pencil_geom.cc.
Referenced by expand_trim_segment_direction(), and trim_curve_segments().