|
Blender V5.3
|
Functions | |
| static bool | check_line_segment_lasso_intersection (const int2 &pos_a, const int2 &pos_b, const Span< int2 > mcoords) |
| static void | check_segments_in_lasso (const Span< float2 > screen_space_positions, const Span< Bounds< float2 > > screen_space_bbox, const Span< int2 > mcoords, const Span< Segment > all_segments, const IndexMask &editable_curves, const OffsetIndices< int > segments_by_curve, MutableSpan< bool > segments_to_keep) |
| static bke::CurvesGeometry | create_curves_from_segments (const bke::CurvesGeometry &src, const Span< Segment > segments, const Span< bool > segment_reversed, const Span< bool > cyclic, const OffsetIndices< int > segment_offsets) |
| bke::CurvesGeometry | trim_curve_segments (const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const Span< int2 > mcoords, const IndexMask &editable_curves, const IndexMask &visible_curves, const bool keep_caps) |
| bke::CurvesGeometry | trim_curve_segment_ends (const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const IndexMask &editable_curves, const IndexMask &visible_curves, const bool keep_caps) |
|
static |
Definition at line 42 of file grease_pencil_trim.cc.
References blender::BLI_lasso_is_edge_inside(), check_line_segment_lasso_intersection(), blender::Bounds< T >::intersects_segment(), IS_CLIPPED, blender::math::max(), blender::math::min(), and blender::Bounds< T >::pad().
Referenced by check_line_segment_lasso_intersection(), and check_segments_in_lasso().
|
static |
Definition at line 58 of file grease_pencil_trim.cc.
References check_line_segment_lasso_intersection(), check_segments_in_lasso(), blender::IndexRange::drop_back(), blender::ed::greasepencil::End, blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::math::interpolate(), blender::bounds::intersect(), blender::IndexRange::is_empty(), blender::IndexRange::last(), blender::Bounds< T >::max, blender::Bounds< T >::min, blender::bounds::min_max(), blender::IndexRange::size(), and blender::ed::greasepencil::Start.
Referenced by check_segments_in_lasso(), and trim_curve_segments().
|
static |
Definition at line 157 of file grease_pencil_trim.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::bke::CurvesGeometry::attributes_for_write(), create_curves_from_segments(), blender::bke::CurvesGeometry::cyclic_for_write(), blender::offset_indices::OffsetIndices< T >::data(), blender::ed::greasepencil::End, blender::offset_indices::OffsetIndices< T >::index_range(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), blender::IndexRange::last(), blender::bke::CurvesGeometry::offsets_for_write(), blender::threading::parallel_for(), blender::offset_indices::OffsetIndices< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ed::greasepencil::Start, and blender::offset_indices::OffsetIndices< T >::total_size().
Referenced by create_curves_from_segments(), trim_curve_segment_ends(), and trim_curve_segments().
| bke::CurvesGeometry blender::ed::greasepencil::trim::trim_curve_segment_ends | ( | const bke::CurvesGeometry & | src, |
| Span< float2 > | screen_space_positions, | ||
| const IndexMask & | editable_curves, | ||
| const IndexMask & | visible_curves, | ||
| bool | keep_caps ) |
Trim the editable curves from the start and end until intersection or self-intersection. If a curve does not have intersection it will be unmodified.
Note: All editable curves must also be visible.
| src | Curves geometry for target curves. |
| screen_space_positions | Screen-space positions computed in advance. |
| editable_curves | Mask of all curves that can be trimmed. |
| visible_curves | Mask of all curves that are visible. |
| keep_caps | If the start and end cap attributes should not be set to Flat. |
Definition at line 348 of file grease_pencil_trim.cc.
References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::ed::greasepencil::segment::compute_bounding_boxes(), blender::ed::greasepencil::segment::create_connections_from_curves(), create_curves_from_segments(), blender::ed::greasepencil::segment::create_segments_from_intersections(), blender::bke::CurvesGeometry::curves_num(), blender::ed::greasepencil::segment::cut_caps(), blender::ed::greasepencil::segment::find_intersections_between_all_curves(), blender::IndexRange::first(), blender::ed::greasepencil::segment::follow_segment_connections(), blender::index_mask::IndexMask::foreach_index(), blender::VArray< T >::from_single(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::is_empty(), blender::IndexRange::last(), blender::bke::CurvesGeometry::points_by_curve(), blender::ed::greasepencil::segment::SEGMENT_CONNECTION_NULL, blender::IndexRange::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ed::greasepencil::segment::store_segment_map_on_intersections(), and trim_curve_segment_ends().
Referenced by trim_curve_segment_ends(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().
| bke::CurvesGeometry blender::ed::greasepencil::trim::trim_curve_segments | ( | const bke::CurvesGeometry & | src, |
| Span< float2 > | screen_space_positions, | ||
| Span< int2 > | mcoords, | ||
| const IndexMask & | editable_curves, | ||
| const IndexMask & | visible_curves, | ||
| bool | keep_caps ) |
Trim all segments of editable curves that are inside of a given lasso region.
Note: All editable curves must also be visible.
| src | Curves geometry for target curves. |
| screen_space_positions | Screen-space positions computed in advance. |
| mcoords | Screen-space points that define the lasso region. |
| editable_curves | Mask of all curves that can be trimmed. |
| visible_curves | Mask of all curves that are visible. |
| keep_caps | If the start and end cap attributes should not be set to Flat. |
Definition at line 272 of file grease_pencil_trim.cc.
References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), check_segments_in_lasso(), blender::ed::greasepencil::segment::compute_bounding_boxes(), blender::ed::greasepencil::segment::create_connections_from_curves(), create_curves_from_segments(), blender::ed::greasepencil::segment::create_segments_from_intersections(), blender::bke::CurvesGeometry::curves_num(), blender::ed::greasepencil::segment::cut_caps(), blender::bke::CurvesGeometry::cyclic(), blender::ed::greasepencil::segment::find_intersections_between_all_curves(), blender::ed::greasepencil::segment::follow_segment_connections(), blender::bke::CurvesGeometry::is_empty(), blender::bke::CurvesGeometry::points_by_curve(), blender::ed::greasepencil::segment::SEGMENT_CONNECTION_NULL, blender::offset_indices::OffsetIndices< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ed::greasepencil::segment::store_segment_map_on_intersections(), and trim_curve_segments().
Referenced by blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), blender::ed::greasepencil::tests::TEST_F(), and trim_curve_segments().