Blender V5.3
blender::bke::CurvesGeometry Class Reference

#include <BKE_curves.hh>

Inherits blender::CurvesGeometry.

Classes

struct  BlendWriteData

Public Member Functions

template<typename T>
VArray< T > adapt_domain (const VArray< T > &varray, AttrDomain from, AttrDomain to) const
Constructors/Destructor
 CurvesGeometry ()
 CurvesGeometry (int point_num, int curve_num)
 CurvesGeometry (const CurvesGeometry &other)
 CurvesGeometry (CurvesGeometry &&other)
CurvesGeometry & operator= (const CurvesGeometry &other)
CurvesGeometry & operator= (CurvesGeometry &&other)
 ~CurvesGeometry ()
Accessors
Span< int > offsets () const
MutableSpan< int > offsets_for_write ()
VArray< int8_t > curve_types () const
MutableSpan< int8_t > curve_types_for_write ()
void fill_curve_types (CurveType type)
void fill_curve_types (const IndexMask &selection, CurveType type)
void update_curve_types ()
Span< float3 > positions () const
MutableSpan< float3 > positions_for_write ()
VArray< float > radius () const
MutableSpan< float > radius_for_write ()
VArray< bool > cyclic () const
MutableSpan< bool > cyclic_for_write ()
VArray< int > resolution () const
MutableSpan< int > resolution_for_write ()
VArray< float > tilt () const
MutableSpan< float > tilt_for_write ()
VArray< int8_t > normal_mode () const
MutableSpan< int8_t > normal_mode_for_write ()
VArray< int8_t > handle_types_left () const
MutableSpan< int8_t > handle_types_left_for_write ()
VArray< int8_t > handle_types_right () const
MutableSpan< int8_t > handle_types_right_for_write ()
std::optional< Span< float3 > > handle_positions_left () const
MutableSpan< float3 > handle_positions_left_for_write ()
std::optional< Span< float3 > > handle_positions_right () const
MutableSpan< float3 > handle_positions_right_for_write ()
VArray< int8_t > nurbs_orders () const
MutableSpan< int8_t > nurbs_orders_for_write ()
VArray< int8_t > nurbs_knots_modes () const
MutableSpan< int8_t > nurbs_knots_modes_for_write ()
std::optional< Span< float > > nurbs_weights () const
MutableSpan< float > nurbs_weights_for_write ()
std::optional< Span< float2 > > surface_uv_coords () const
MutableSpan< float2 > surface_uv_coords_for_write ()
Span< float > nurbs_custom_knots () const
MutableSpan< float > nurbs_custom_knots_for_write ()
OffsetIndices< int > nurbs_custom_knots_by_curve () const
IndexMask nurbs_custom_knot_curves (IndexMaskMemory &memory) const
void nurbs_custom_knots_update_size ()
void nurbs_custom_knots_resize (int knots_num)
Span< MDeformVert > deform_verts () const
MutableSpan< MDeformVert > deform_verts_for_write ()
Operations
std::optional< Bounds< float3 > > bounds_min_max (bool use_radius=true) const
void count_memory (MemoryCounter &memory) const
std::optional< int > material_index_max () const
void resize (int points_num, int curves_num)
void tag_positions_changed ()
void tag_topology_changed ()
void tag_normals_changed ()
void tag_radii_changed ()
void tag_material_index_changed ()
void translate (const float3 &translation)
void transform (const float4x4 &matrix)
void calculate_bezier_auto_handles ()
void calculate_bezier_aligned_handles ()
void remove_points (const IndexMask &points_to_delete, const AttributeFilter &attribute_filter)
void remove_curves (const IndexMask &curves_to_delete, const AttributeFilter &attribute_filter)
void reverse_curves (const IndexMask &curves_to_reverse)
void remove_attributes_based_on_types ()
Domain Interpolation
AttributeAccessor attributes () const
MutableAttributeAccessor attributes_for_write ()
GVArray adapt_domain (const GVArray &varray, AttrDomain from, AttrDomain to) const
File reading/writing.
void blend_read (BlendDataReader &reader)
void blend_write_prepare (BlendWriteData &write_data, bool use_5_0_compatibility)
void blend_write (BlendWriter &writer, ID &id, const BlendWriteData &write_data)

#CurvesGeometry Inline Methods

int points_num () const
int curves_num () const
bool is_empty () const
IndexRange points_range () const
IndexRange curves_range () const
OffsetIndices< int > points_by_curve () const
bool has_curve_with_type (CurveType type) const
bool has_curve_with_type (Span< CurveType > types) const
bool is_single_type (CurveType type) const
const std::array< int, CURVE_TYPES_NUM > & curve_type_counts () const
bool nurbs_has_custom_knots () const
int evaluated_points_num () const
Span< int > bezier_evaluated_offsets_for_curve (int curve_index) const
Span< float > evaluated_lengths_for_curve (int curve_index, bool cyclic) const
float evaluated_length_total_for_curve (int curve_index, bool cyclic) const

Evaluation

IndexMask indices_for_curve_type (CurveType type, IndexMaskMemory &memory) const
IndexMask indices_for_curve_type (CurveType type, const IndexMask &selection, IndexMaskMemory &memory) const
Array< int > point_to_curve_map () const
OffsetIndices< int > evaluated_points_by_curve () const
bool has_cyclic_curve () const
Span< float3 > evaluated_positions () const
Span< float3 > evaluated_tangents () const
Span< float3 > evaluated_normals () const
void ensure_evaluated_lengths () const
void ensure_can_interpolate_to_evaluated () const
void interpolate_to_evaluated (int curve_index, GSpan src, GMutableSpan dst) const
void interpolate_to_evaluated (GSpan src, GMutableSpan dst) const

Additional Inherited Members

Public Attributes inherited from blender::CurvesGeometry
int * curve_offsets = nullptr
struct AttributeStorage attribute_storage
CustomData point_data
CustomData curve_data_legacy
int point_num = 0
int curve_num = 0
ListBaseT< struct bDeformGroup > vertex_group_names = {nullptr, nullptr}
int vertex_group_active_index = 0
int attributes_active_index = -1
bke::CurvesGeometryRuntime * runtime = nullptr
float * custom_knots = nullptr
int custom_knot_num = 0
char _pad [4] = {}

Detailed Description

A C++ class that wraps the DNA struct for better encapsulation and ease of use. It inherits directly from the struct rather than storing a pointer to avoid more complicated ownership handling.

Definition at line 156 of file BKE_curves.hh.

Constructor & Destructor Documentation

◆ CurvesGeometry() [1/4]

blender::bke::CurvesGeometry::CurvesGeometry ( )

◆ CurvesGeometry() [2/4]

◆ CurvesGeometry() [3/4]

blender::bke::CurvesGeometry::CurvesGeometry ( const CurvesGeometry & other)

Definition at line 106 of file curves_geometry.cc.

References blender::ImplicitSharingInfo::add_user(), blender::CurvesGeometry::attribute_storage, blender::CurvesGeometry::attributes_active_index, blender::bke::AttributeStorage::AttributeStorage(), blender::bke::CurvesGeometryRuntime::bake_materials, blender::BKE_defgroup_copy_list(), blender::bke::CurvesGeometryRuntime::bounds_cache, blender::bke::CurvesGeometryRuntime::bounds_with_radius_cache, CD_MASK_MDEFORMVERT, blender::CurvesGeometry::curve_num, blender::CurvesGeometry::curve_offsets, blender::bke::CurvesGeometryRuntime::curve_offsets_sharing_info, CurvesGeometry(), blender::CurvesGeometry::custom_knot_num, blender::bke::CurvesGeometryRuntime::custom_knot_offsets_cache, blender::CurvesGeometry::custom_knots, blender::bke::CurvesGeometryRuntime::custom_knots_sharing_info, blender::CustomData_init_from(), blender::bke::CurvesGeometryRuntime::evaluated_length_cache, blender::bke::CurvesGeometryRuntime::evaluated_normal_cache, blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, blender::bke::CurvesGeometryRuntime::evaluated_position_cache, blender::bke::CurvesGeometryRuntime::evaluated_tangent_cache, blender::bke::CurvesGeometryRuntime::has_cyclic_curve_cache, blender::bke::CurvesGeometryRuntime::max_material_index_cache, blender::bke::CurvesGeometryRuntime::nurbs_basis_cache, blender::CurvesGeometry::point_data, blender::CurvesGeometry::point_num, blender::CurvesGeometry::runtime, blender::bke::CurvesGeometryRuntime::type_counts, blender::CurvesGeometry::vertex_group_active_index, and blender::CurvesGeometry::vertex_group_names.

◆ CurvesGeometry() [4/4]

◆ ~CurvesGeometry()

Member Function Documentation

◆ adapt_domain() [1/2]

◆ adapt_domain() [2/2]

template<typename T>
VArray< T > blender::bke::CurvesGeometry::adapt_domain ( const VArray< T > & varray,
AttrDomain from,
AttrDomain to ) const
inline

Definition at line 500 of file BKE_curves.hh.

References blender::GVArray::GVArray(), T, and blender::GVArray::typed().

◆ attributes()

AttributeAccessor blender::bke::CurvesGeometry::attributes ( ) const

Definition at line 1951 of file curves_geometry.cc.

References blender::bke::AttributeAccessor::AttributeAccessor(), and blender::bke::curves::get_attribute_accessor_functions().

Referenced by blender::ed::greasepencil::apply_color_operation_for_mode(), attr_create_generic(), blender::ed::greasepencil::bake_grease_pencil_animation_exec(), blender::BKE_grease_pencil_material_index_used(), blender::bke::build_mesh_positions(), blender::ed::spreadsheet::GreasePencilLayerCurvesDomainViewItem::build_row(), blender::bke::compare_geometry::compare_curves(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_and_reorder_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::ed::curves::copy_data_to_geometry(), blender::bke::curves::copy_only_curve_domain(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::ed::greasepencil::create_curves_outline(), blender::create_dashes(), blender::create_envelope_strokes(), blender::bke::curve_to_mesh_sweep(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::ed::greasepencil::tests::draw_results(), blender::draw::DRW_curves_batch_cache_create_requested(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), evaluated_normals(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), export_hair_curves(), export_hair_curves_motion(), blender::geometry::extend_curves(), blender::geometry::extract_curves(), blender::geometry::extract_curves_points(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::bke::greasepencil::Drawing::fill_colors(), blender::geometry::fillet_curves(), blender::geometry::gather_curve_attributes_to_interpolate(), blender::geometry::gather_point_attributes_to_interpolate(), blender::geometry::gather_point_attributes_to_interpolate(), blender::ed::greasepencil::get_boundary_bounds(), blender::ed::sculpt_paint::greasepencil::get_single_stroke(), blender::bke::AttributeExistsFieldInput::get_varray_for_context(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::geometry::initialize_curves_builtin_attribute_defaults(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::geometry::join_curves_ranges(), material_index_max(), blender::modify_curves(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_transfer_attributes_cc::node_geo_exec(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_done(), blender::bke::greasepencil::Drawing::opacities(), blender::bke::greasepencil::Drawing::radii(), remove_attributes_based_on_types(), blender::nodes::node_geo_remove_attribute_cc::remove_attributes_recursive(), blender::ed::greasepencil::render_strokes(), blender::geometry::reorder_and_flip_curves(), blender::reorder_cyclic_curve_points(), blender::draw::request_attribute(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), reverse_curves(), blender::geometry::separate_curves_selection(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), transform(), blender::geometry::trim_curves(), and blender::bke::greasepencil::Drawing::vertex_colors().

◆ attributes_for_write()

MutableAttributeAccessor blender::bke::CurvesGeometry::attributes_for_write ( )

Definition at line 1956 of file curves_geometry.cc.

References blender::bke::curves::get_attribute_accessor_functions(), and blender::bke::MutableAttributeAccessor::MutableAttributeAccessor().

Referenced by blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::nodes::ForeachElementComponent::attributes_for_write(), blender::BKE_grease_pencil_material_index_remove(), blender::BKE_grease_pencil_material_remap(), blender::build_concurrent(), blender::build_sequential(), blender::ed::greasepencil::clipboard_paste_strokes_ex(), blender::ed::object::convert_curves_legacy_to_grease_pencil(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::ed::object::convert_curves_to_grease_pencil(), blender::geometry::convert_curves_to_nurbs(), blender::ed::object::convert_font_to_grease_pencil(), blender::geometry::copy_and_reorder_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::ed::curves::copy_data_to_geometry(), blender::bke::curves::copy_only_curve_domain(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::create_array_copies(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::ed::greasepencil::trim::create_curves_from_segments(), blender::create_dashes(), blender::create_envelope_strokes(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curves_copy_curve_selection(), CurvesGeometry(), blender::ed::greasepencil::segment::cut_caps(), blender::deform_drawing(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves_CurveGeometry(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_grease_pencil_task(), blender::geometry::extend_curves(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_curve_types(), blender::geometry::fillet_curves(), blender::geometry::gather_point_attributes_to_interpolate(), blender::ed::sculpt_paint::greasepencil::get_single_stroke(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::geometry::grease_pencil_remove_points_and_split(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::geometry::join_curves_ranges(), blender::MOD_lineart_gpencil_generate_v3(), blender::modify_fill_color(), blender::nodes::node_geo_transfer_attributes_cc::node_geo_exec(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_done(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), remove_attributes_based_on_types(), blender::geometry::remove_points_and_split(), blender::geometry::reorder_and_flip_curves(), blender::reorder_cyclic_curve_points(), blender::ed::curves::resize_curves(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), reverse_curves(), blender::ed::greasepencil::boolean::separate_fill_islands(), blender::ed::curves::separate_points(), blender::ed::sculpt_paint::set_fill_attributes(), blender::nodes::node_geo_set_material_index_cc::set_material_index_in_grease_pencil(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_geo_interpolate_curves_cc::store_output_attributes(), blender::geometry::subdivide_curves(), transform(), and blender::geometry::trim_curves().

◆ bezier_evaluated_offsets_for_curve()

Span< int > blender::bke::CurvesGeometry::bezier_evaluated_offsets_for_curve ( int curve_index) const
inline

Retrieve offsets into a Bezier curve's evaluated points for each control point. Stored in the same format as OffsetIndices. Call evaluated_points_by_curve() first to ensure that the evaluated offsets cache is current.

Definition at line 1070 of file BKE_curves.hh.

References blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, offsets(), blender::bke::curves::per_curve_point_offsets_range(), points_by_curve(), blender::CurvesGeometry::runtime, and blender::Span< T >::slice().

Referenced by blender::geometry::lookup_point_bezier(), blender::geometry::sample_curve_attribute(), and blender::bke::write_sharp_bezier_edges().

◆ blend_read()

◆ blend_write()

◆ blend_write_prepare()

◆ bounds_min_max()

◆ calculate_bezier_aligned_handles()

void blender::bke::CurvesGeometry::calculate_bezier_aligned_handles ( )

◆ calculate_bezier_auto_handles()

◆ count_memory()

◆ curve_type_counts()

◆ curve_types()

VArray< int8_t > blender::bke::CurvesGeometry::curve_types ( ) const

◆ curve_types_for_write()

MutableSpan< int8_t > blender::bke::CurvesGeometry::curve_types_for_write ( )

◆ curves_num()

int blender::bke::CurvesGeometry::curves_num ( ) const
inline

The number of curves in the data-block.

Definition at line 1005 of file BKE_curves.hh.

References blender::CurvesGeometry::curve_num.

Referenced by blender::ed::curves::append_primitive_curve(), blender::build_drawing(), blender::bke::calculate_result_offsets(), blender::ed::greasepencil::clipboard_paste_strokes_ex(), blender::bke::compare_geometry::compare_curves(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::bke::curves::nurbs::copy_custom_knots(), blender::bke::curves::copy_only_curve_domain(), blender::create_envelope_strokes(), blender::bke::curves_copy_curve_selection(), blender::bke::curves_copy_point_selection(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::curves_merge_endpoints(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), curves_range(), blender::ed::greasepencil::tests::draw_results(), blender::duplicate_strokes(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), ensure_evaluated_lengths(), evaluated_points_by_curve(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::greasepencil::execute_carver_on_drawing(), blender::ed::greasepencil::tests::expect_boolean_result_coord(), blender::geometry::extend_curves(), blender::ed::curves::extrude_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_curve_types(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::geometry::interpolate_curves_with_samples(), is_single_type(), blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical(), blender::geometry::reorder_curves_geometry(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), resize(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), blender::ed::greasepencil::tests::test_curve_boolean(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), blender::ed::greasepencil::trim::trim_curve_segments(), blender::geometry::trim_curves(), and blender::nodes::node_geo_curve_trim_cc::trim_curves().

◆ curves_range()

IndexRange blender::bke::CurvesGeometry::curves_range ( ) const
inline

Definition at line 1023 of file BKE_curves.hh.

References curves_num(), and blender::IndexRange::IndexRange().

Referenced by blender::ed::greasepencil::bake_grease_pencil_animation_exec(), calculate_bezier_auto_handles(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::create_envelope_strokes(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::curves_merge_endpoints(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::draw::DRW_curves_batch_cache_create_requested(), ensure_evaluated_lengths(), evaluated_normals(), evaluated_positions(), evaluated_tangents(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::greasepencil::execute_carver_on_drawing(), blender::geometry::extend_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::nodes::node_geo_curve_fillet_cc::fillet_curve(), blender::geometry::fillet_curves(), blender::geometry::find_connected_ranges(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::greasepencil::grease_pencil_primitive_exit(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), has_cyclic_curve(), indices_for_curve_type(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::ed::sculpt_paint::greasepencil::PaintOperation::interpolate_stroke_depth(), interpolate_to_evaluated(), blender::modify_drawing(), nurbs_custom_knot_curves(), nurbs_custom_knots_by_curve(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_spherical(), remove_curves(), blender::geometry::remove_points_and_split(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::ed::greasepencil::retrieve_visible_strokes(), blender::ed::sculpt_paint::set_fill_attributes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::nodes::node_geo_interpolate_curves_cc::store_output_attributes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), 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 blender::geometry::trim_curves().

◆ cyclic()

VArray< bool > blender::bke::CurvesGeometry::cyclic ( ) const

Whether the curve loops around to connect to itself, on the curve domain.

Definition at line 405 of file curves_geometry.cc.

References blender::bke::ATTR_CYCLIC, blender::CurvesGeometry::attribute_storage, blender::bke::Curve, and blender::bke::get_varray_attribute().

Referenced by calculate_bezier_auto_handles(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::create_dashes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::curves_merge_endpoints(), blender::ed::greasepencil::tests::draw_results(), blender::draw::DRW_curves_batch_cache_create_requested(), ensure_evaluated_lengths(), evaluated_length_total_for_curve(), evaluated_lengths_for_curve(), evaluated_normals(), evaluated_positions(), evaluated_tangents(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), has_cyclic_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::geometry::interpolate_curves(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::io::obj::OBJCurvesTest::run_nurbs_test(), blender::geometry::sample_curve_positions_and_handles(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), blender::bke::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::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::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::trim_catmull_rom_curves(), and blender::ed::greasepencil::trim::trim_curve_segments().

◆ cyclic_for_write()

◆ deform_verts()

Span< MDeformVert > blender::bke::CurvesGeometry::deform_verts ( ) const

Vertex group data, encoded as an array of indices and weights for every vertex.

Warning
: May be empty.

Definition at line 654 of file curves_geometry.cc.

References blender::CD_MDEFORMVERT, blender::CustomData_get_layer(), blender::CurvesGeometry::point_data, and blender::CurvesGeometry::point_num.

Referenced by blender::modify_curves().

◆ deform_verts_for_write()

◆ ensure_can_interpolate_to_evaluated()

void blender::bke::CurvesGeometry::ensure_can_interpolate_to_evaluated ( ) const

◆ ensure_evaluated_lengths()

◆ evaluated_length_total_for_curve()

float blender::bke::CurvesGeometry::evaluated_length_total_for_curve ( int curve_index,
bool cyclic ) const
inline

◆ evaluated_lengths_for_curve()

Span< float > blender::bke::CurvesGeometry::evaluated_lengths_for_curve ( int curve_index,
bool cyclic ) const
inline

Return a cache of accumulated lengths along the curve. Each item is the length of the subsequent segment (the first value is the length of the first segment rather than 0). This calculation is rather trivial, and only depends on the evaluated positions, but the results are used often, and it is necessarily single threaded per curve, so it is cached.

Parameters
cyclicThis argument is redundant with the data stored for the curve, but is passed for performance reasons to avoid looking up the attribute.

Definition at line 1088 of file BKE_curves.hh.

References cyclic(), blender::bke::CurvesGeometryRuntime::evaluated_length_cache, and blender::CurvesGeometry::runtime.

Referenced by evaluated_length_total_for_curve(), and blender::geometry::resample_to_uniform().

◆ evaluated_normals()

Span< float3 > blender::bke::CurvesGeometry::evaluated_normals ( ) const

Definition at line 1084 of file curves_geometry.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), attributes(), blender::bke::curves::poly::calculate_normals_minimum(), blender::bke::curves::poly::calculate_normals_z_up(), blender::CURVE_TYPE_POLY, curve_types(), curves_range(), cyclic(), blender::bke::evaluate_generic_data_for_curve(), blender::bke::CurvesGeometryRuntime::evaluated_normal_cache, evaluated_normals(), blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, evaluated_points_by_curve(), evaluated_points_num(), evaluated_tangents(), blender::VArrayCommon< T >::get_internal_single(), blender::blender::Span< T >::is_empty(), blender::VArrayCommon< T >::is_single(), blender::bke::AttributeAccessor::lookup(), normal_mode(), blender::NORMAL_MODE_FREE, blender::NORMAL_MODE_MINIMUM_TWIST, blender::NORMAL_MODE_Z_UP, blender::bke::normalize_span(), blender::bke::CurvesGeometryRuntime::nurbs_basis_cache, nurbs_orders(), nurbs_weights(), blender::threading::parallel_for(), blender::bke::Point, points_by_curve(), blender::Vector< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), resolution(), blender::bke::rotate_directions_around_axes(), blender::CurvesGeometry::runtime, blender::IndexRange::size(), blender::blender::Span< T >::slice(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), and tilt().

Referenced by blender::bke::build_mesh_positions(), evaluated_normals(), and blender::geometry::gather_point_attributes_to_interpolate().

◆ evaluated_points_by_curve()

◆ evaluated_points_num()

int blender::bke::CurvesGeometry::evaluated_points_num ( ) const
inline

The total number of points in the evaluated poly curve. This can depend on the resolution attribute if it exists.

Definition at line 1064 of file BKE_curves.hh.

References evaluated_points_by_curve().

Referenced by bounds_min_max(), ensure_evaluated_lengths(), evaluated_normals(), evaluated_positions(), and evaluated_tangents().

◆ evaluated_positions()

Span< float3 > blender::bke::CurvesGeometry::evaluated_positions ( ) const

Definition at line 872 of file curves_geometry.cc.

References blender::bke::curves::bezier::calculate_evaluated_positions(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear_and_shrink(), blender::array_utils::copy_group_to_group(), curve_type_counts(), blender::CURVE_TYPE_POLY, curve_types(), curves_range(), cyclic(), blender::Default, blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, evaluated_points_by_curve(), evaluated_points_num(), blender::bke::CurvesGeometryRuntime::evaluated_position_cache, evaluated_positions(), blender::bke::curves::fill_points(), blender::bke::curves::foreach_curve_by_type(), blender::exec_mode::grain_size(), handle_positions_left(), handle_positions_right(), blender::bke::curves::catmull_rom::interpolate_to_evaluated(), blender::bke::curves::nurbs::interpolate_to_evaluated(), is_single_type(), blender::bke::CurvesGeometryRuntime::nurbs_basis_cache, nurbs_orders(), nurbs_weights(), offsets(), blender::bke::curves::per_curve_point_offsets_range(), points_by_curve(), positions(), PRF_scope_with_name, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), resolution(), blender::CurvesGeometry::runtime, blender::MutableSpan< T >::slice(), and blender::Span< T >::slice().

Referenced by bounds_min_max(), blender::bke::build_mesh_positions(), ensure_evaluated_lengths(), evaluated_positions(), evaluated_tangents(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::geometry::trim_curves(), and blender::geometry::trim_evaluated_curves().

◆ evaluated_tangents()

◆ fill_curve_types() [1/2]

void blender::bke::CurvesGeometry::fill_curve_types ( const IndexMask & selection,
CurveType type )

◆ fill_curve_types() [2/2]

◆ handle_positions_left()

◆ handle_positions_left_for_write()

◆ handle_positions_right()

◆ handle_positions_right_for_write()

◆ handle_types_left()

◆ handle_types_left_for_write()

◆ handle_types_right()

◆ handle_types_right_for_write()

◆ has_curve_with_type() [1/2]

◆ has_curve_with_type() [2/2]

bool blender::bke::CurvesGeometry::has_curve_with_type ( Span< CurveType > types) const
inline

Definition at line 1038 of file BKE_curves.hh.

References blender::Span< T >::begin(), and blender::Span< T >::end().

◆ has_cyclic_curve()

◆ indices_for_curve_type() [1/2]

IndexMask blender::bke::CurvesGeometry::indices_for_curve_type ( CurveType type,
const IndexMask & selection,
IndexMaskMemory & memory ) const

◆ indices_for_curve_type() [2/2]

IndexMask blender::bke::CurvesGeometry::indices_for_curve_type ( CurveType type,
IndexMaskMemory & memory ) const

All of the curve indices for curves with a specific type.

Definition at line 786 of file curves_geometry.cc.

References curves_range(), and indices_for_curve_type().

Referenced by evaluated_tangents(), and indices_for_curve_type().

◆ interpolate_to_evaluated() [1/2]

◆ interpolate_to_evaluated() [2/2]

void blender::bke::CurvesGeometry::interpolate_to_evaluated ( int curve_index,
GSpan src,
GMutableSpan dst ) const

Evaluate a generic data to the standard evaluated points of a specific curve, defined by the resolution attribute or other factors, depending on the curve type.

Warning
This function expects offsets to the evaluated points for each curve to be calculated. That can be ensured with ensure_can_interpolate_to_evaluated.

Definition at line 1179 of file curves_geometry.cc.

References blender::BLI_assert(), curve_types(), blender::bke::evaluate_generic_data_for_curve(), blender::bke::CurvesGeometryRuntime::evaluated_offsets_cache, blender::bke::CurvesGeometryRuntime::nurbs_basis_cache, nurbs_orders(), nurbs_weights(), resolution(), blender::CurvesGeometry::runtime, blender::GMutableSpan::size(), and blender::GSpan::size().

Referenced by bounds_min_max(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), and blender::geometry::sample_curve_attribute().

◆ is_empty()

bool blender::bke::CurvesGeometry::is_empty ( ) const
inline

Return true if there are no curves in the geometry.

Definition at line 1013 of file BKE_curves.hh.

References blender::BLI_assert(), blender::CurvesGeometry::curve_num, and blender::CurvesGeometry::point_num.

Referenced by bounds_min_max(), blender::ed::curves::copy_data_to_geometry(), blender::nodes::node_geo_curve_fill_cc::curve_fill_calculate(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::deform_drawing(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::geometry::fillet_curves(), blender::nodes::node_geo_curve_fillet_cc::fillet_grease_pencil(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::geometry::interpolate_curves_with_samples(), blender::ed::greasepencil::join_curves(), blender::geometry::join_curves(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_set_position_cc::set_position_in_grease_pencil(), blender::geometry::subdivide_curves(), blender::bke::tests::TEST_F(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), blender::ed::greasepencil::trim::trim_curve_segments(), blender::nodes::node_geo_curve_trim_cc::trim_curves(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().

◆ is_single_type()

bool blender::bke::CurvesGeometry::is_single_type ( CurveType type) const
inline

Return true if all of the curves have the provided type.

Definition at line 1028 of file BKE_curves.hh.

References curve_type_counts(), and curves_num().

Referenced by bounds_min_max(), evaluated_points_by_curve(), evaluated_positions(), and blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec().

◆ material_index_max()

std::optional< int > blender::bke::CurvesGeometry::material_index_max ( ) const

Get the largest material index used by the geometry or nullopt if there are none. The returned value is clamped between 0 and MAXMAT even if the stored material indices may be out of that range.

Definition at line 1463 of file curves_geometry.cc.

References attributes(), blender::bke::Curve, blender::SharedCache< T >::data(), blender::SharedCache< T >::ensure(), blender::bounds::max(), blender::bke::CurvesGeometryRuntime::max_material_index_cache, and MAXMAT.

◆ normal_mode()

VArray< int8_t > blender::bke::CurvesGeometry::normal_mode ( ) const

Which method to use for calculating the normals of evaluated points (NormalMode). Call tag_normals_changed after changes.

Definition at line 427 of file curves_geometry.cc.

References blender::bke::ATTR_NORMAL_MODE, blender::CurvesGeometry::attribute_storage, blender::bke::Curve, and blender::bke::get_varray_attribute().

Referenced by evaluated_normals().

◆ normal_mode_for_write()

MutableSpan< int8_t > blender::bke::CurvesGeometry::normal_mode_for_write ( )

◆ nurbs_custom_knot_curves()

IndexMask blender::bke::CurvesGeometry::nurbs_custom_knot_curves ( IndexMaskMemory & memory) const

◆ nurbs_custom_knots()

Span< float > blender::bke::CurvesGeometry::nurbs_custom_knots ( ) const

◆ nurbs_custom_knots_by_curve()

◆ nurbs_custom_knots_for_write()

◆ nurbs_custom_knots_resize()

void blender::bke::CurvesGeometry::nurbs_custom_knots_resize ( int knots_num)

◆ nurbs_custom_knots_update_size()

◆ nurbs_has_custom_knots()

◆ nurbs_knots_modes()

◆ nurbs_knots_modes_for_write()

◆ nurbs_orders()

◆ nurbs_orders_for_write()

◆ nurbs_weights()

std::optional< Span< float > > blender::bke::CurvesGeometry::nurbs_weights ( ) const

◆ nurbs_weights_for_write()

◆ offsets()

Span< int > blender::bke::CurvesGeometry::offsets ( ) const

The index of the first point in every curve. The size of this span is one larger than the number of curves, but the spans will be empty if there are no curves/points.

Consider using points_by_curve rather than these offsets directly.

Definition at line 388 of file curves_geometry.cc.

References blender::CurvesGeometry::curve_num, and blender::CurvesGeometry::curve_offsets.

Referenced by bezier_evaluated_offsets_for_curve(), blender::bke::compare_geometry::compare_curves(), blender::geometry::copy_and_reorder_curves(), blender::create_envelope_strokes(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), evaluated_positions(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide_with_symmetry(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::geometry::reorder_and_flip_curves(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), blender::bke::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), and blender::geometry::trim_curves().

◆ offsets_for_write()

MutableSpan< int > blender::bke::CurvesGeometry::offsets_for_write ( )

Definition at line 395 of file curves_geometry.cc.

References blender::CurvesGeometry::curve_num, blender::CurvesGeometry::curve_offsets, blender::bke::CurvesGeometryRuntime::curve_offsets_sharing_info, blender::implicit_sharing::make_trivial_data_mutable(), and blender::CurvesGeometry::runtime.

Referenced by blender::build_concurrent(), blender::build_sequential(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_and_reorder_curves(), blender::ed::curves::copy_data_to_geometry(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::ed::greasepencil::trim::create_curves_from_segments(), blender::create_dashes(), blender::create_envelope_strokes(), blender::bke::curves_copy_curve_selection(), blender::bke::curves_copy_point_selection(), blender::ed::greasepencil::curves_merge_by_distance(), CurvesGeometry(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves_CurveGeometry(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::extend_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::curves::extrude_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::geometry::join_curves_ranges(), blender::MOD_lineart_gpencil_generate_v3(), blender::ed::space_node::node_draw_zones_and_frames(), blender::geometry::remove_points_and_split(), blender::geometry::reorder_and_flip_curves(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), and blender::geometry::trim_curves().

◆ operator=() [1/2]

CurvesGeometry & blender::bke::CurvesGeometry::operator= ( const CurvesGeometry & other)

Definition at line 156 of file curves_geometry.cc.

References CurvesGeometry().

◆ operator=() [2/2]

CurvesGeometry & blender::bke::CurvesGeometry::operator= ( CurvesGeometry && other)

Definition at line 202 of file curves_geometry.cc.

References CurvesGeometry().

◆ point_to_curve_map()

◆ points_by_curve()

OffsetIndices< int > blender::bke::CurvesGeometry::points_by_curve ( ) const
inline

The offsets of every curve into arrays on the points domain.

Definition at line 1058 of file BKE_curves.hh.

References blender::CurvesGeometry::curve_num, and blender::CurvesGeometry::curve_offsets.

Referenced by blender::ed::curves::append_point_knots(), bezier_evaluated_offsets_for_curve(), calculate_bezier_auto_handles(), blender::geometry::calculate_result_offsets(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::nodes::node_geo_interpolate_curves_cc::compute_point_counts_per_child(), blender::nodes::node_geo_interpolate_curves_cc::compute_points_per_curve_by_group(), blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::ed::greasepencil::boolean::create_curves_from_segments(), blender::create_dashes(), blender::create_envelope_strokes(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::deform_drawing(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), blender::ed::sculpt_paint::greasepencil::deselect_stroke(), blender::ed::greasepencil::tests::draw_results(), blender::draw::DRW_curves_batch_cache_create_requested(), evaluated_normals(), evaluated_points_by_curve(), evaluated_positions(), evaluated_tangents(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::greasepencil::execute_carver_on_drawing(), blender::ed::greasepencil::tests::expect_boolean_result_coord(), export_hair_curves(), export_hair_curves_motion(), blender::geometry::extend_curves(), blender::geometry::extract_curves(), blender::geometry::extract_greasepencil_layer_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::geometry::fill_bezier_data(), blender::geometry::fill_nurbs_data(), blender::geometry::fillet_curves(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical(), blender::ed::sculpt_paint::CutOperationExecutor::find_projected_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CutOperationExecutor::find_spherical_points_in_stroke(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::greasepencil::get_boundary_bounds(), blender::ed::sculpt_paint::greasepencil::get_single_stroke(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), hair_topology_matches(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::geometry::interpolate_curves(), blender::geometry::interpolate_curves_with_samples(), blender::ed::sculpt_paint::greasepencil::PaintOperation::interpolate_stroke_depth(), interpolate_to_evaluated(), blender::geometry::join_curves_ranges(), nurbs_custom_knots_by_curve(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), point_to_curve_map(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::sample_curve_attribute(), blender::geometry::sample_curve_positions_and_handles(), blender::ed::curves::select_linked_pick(), blender::ed::greasepencil::boolean::separate_fill_islands(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::greasepencil::smooth_stroke(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::geometry::trim_attribute_linear(), blender::geometry::trim_bezier_curves(), blender::geometry::trim_catmull_rom_curves(), blender::ed::greasepencil::trim::trim_curve_segment_ends(), blender::ed::greasepencil::trim::trim_curve_segments(), blender::geometry::trim_curves(), blender::ed::sculpt_paint::greasepencil::trim_end_points(), blender::geometry::trim_evaluated_curves(), blender::geometry::trim_polygonal_curves(), blender::ed::sculpt_paint::greasepencil::view_positions_from_curve_mask(), and blender::bke::write_sharp_bezier_edges().

◆ points_num()

int blender::bke::CurvesGeometry::points_num ( ) const
inline

The total number of control points in all curves.

Definition at line 1001 of file BKE_curves.hh.

References blender::CurvesGeometry::point_num.

Referenced by blender::ed::curves::append_primitive_curve(), blender::bke::build_mesh_positions(), blender::bke::compare_geometry::compare_curves(), blender::create_envelope_strokes(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::curves_intersections_and_points_sides(), blender::ed::greasepencil::curves_merge_by_distance(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::ed::greasepencil::tests::draw_results(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::duplicate_strokes(), evaluated_points_by_curve(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::greasepencil::execute_trim_on_drawing(), blender::ed::greasepencil::tests::expect_boolean_result_coord(), blender::geometry::extend_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::nodes::node_geo_curve_fillet_cc::fillet_curve(), blender::geometry::fillet_curves(), blender::geometry::fillet_curves_bezier(), blender::geometry::fit_poly_to_bezier_curves(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), hair_topology_matches(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::hard_eraser(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::geometry::interpolate_curves(), blender::geometry::interpolate_curves_with_samples(), blender::geometry::join_curves_ranges(), blender::modify_curves(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), point_to_curve_map(), points_range(), blender::bke::remember_deformed_grease_pencil_if_necessary(), blender::geometry::reorder_curves_geometry(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_uniform(), resize(), blender::ed::greasepencil::select_random_exec(), blender::ed::greasepencil::boolean::separate_fill_islands(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::geometry::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), blender::geometry::tests::TEST_F(), and blender::geometry::transform_grease_pencil_edit_hints().

◆ points_range()

◆ positions()

Span< float3 > blender::bke::CurvesGeometry::positions ( ) const

Definition at line 366 of file curves_geometry.cc.

References blender::bke::ATTR_POSITION, blender::CurvesGeometry::attribute_storage, blender::bke::get_span_attribute(), and blender::bke::Point.

Referenced by bounds_min_max(), calculate_bezier_aligned_handles(), calculate_bezier_auto_handles(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::ed::greasepencil::create_curves_outline(), blender::ed::greasepencil::curves_merge_endpoints_by_distance(), blender::ed::sculpt_paint::CutOperationExecutor::cut_curves(), blender::ed::greasepencil::tests::draw_results(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), evaluated_positions(), evaluated_tangents(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::greasepencil::tests::expect_boolean_result_coord(), export_hair_curves(), export_hair_curves_motion(), blender::ed::curves::pen_tool::extrude_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::ed::sculpt_paint::greasepencil::outline_stroke(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::io::obj::OBJCurvesTest::run_nurbs_test(), blender::geometry::sample_curve_positions_and_handles(), blender::ed::greasepencil::boolean::separate_fill_islands(), blender::ed::sculpt_paint::set_fill_attributes(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), blender::bke::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::tests::TEST_F(), blender::ed::curves::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(), blender::ed::greasepencil::tests::TEST_F(), blender::geometry::trim_bezier_curves(), blender::geometry::trim_catmull_rom_curves(), and blender::geometry::trim_polygonal_curves().

◆ positions_for_write()

MutableSpan< float3 > blender::bke::CurvesGeometry::positions_for_write ( )

Definition at line 371 of file curves_geometry.cc.

References blender::bke::ATTR_POSITION, blender::CurvesGeometry::attribute_storage, blender::bke::get_mutable_attribute(), and blender::bke::Point.

Referenced by blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::ed::greasepencil::boolean::curve_boolean_with_planes(), blender::deform_drawing(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::geometry::execute_realize_curve_task(), blender::geometry::extend_curves(), blender::ed::curves::pen_tool::extrude_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_shapes(), blender::geometry::interpolate_curves_with_samples(), blender::ed::sculpt_paint::greasepencil::PaintOperation::interpolate_stroke_depth(), blender::MOD_lineart_gpencil_generate_v3(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::sculpt_paint::greasepencil::outline_stroke(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_uniform(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::SmoothOperationExecutor::smooth(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook(), blender::geometry::subdivide_curves(), blender::subdivide_drawing(), transform(), translate(), blender::geometry::trim_bezier_curves(), blender::geometry::trim_catmull_rom_curves(), blender::geometry::trim_evaluated_curves(), and blender::geometry::trim_polygonal_curves().

◆ radius()

VArray< float > blender::bke::CurvesGeometry::radius ( ) const

◆ radius_for_write()

◆ remove_attributes_based_on_types()

◆ remove_curves()

◆ remove_points()

◆ resize()

void blender::bke::CurvesGeometry::resize ( int points_num,
int curves_num )

Change the number of curves and/or points.

Warning
To avoid redundant writes, newly created attribute values are not initialized. They must be initialized by the caller afterwards.

Definition at line 1266 of file curves_geometry.cc.

References blender::CurvesGeometry::attribute_storage, blender::BLI_assert(), blender::bke::Curve, blender::CurvesGeometry::curve_num, blender::CurvesGeometry::curve_offsets, blender::bke::CurvesGeometryRuntime::curve_offsets_sharing_info, curves_num(), blender::CustomData_realloc(), blender::bke::Point, blender::CurvesGeometry::point_data, blender::CurvesGeometry::point_num, points_num(), blender::bke::AttributeStorage::resize(), blender::implicit_sharing::resize_trivial_array(), and tag_topology_changed().

Referenced by blender::ed::greasepencil::compute_topology_change(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::bke::curves_copy_curve_selection(), blender::geometry::extend_curves(), blender::geometry::extract_greasepencil_layer_curves(), blender::geometry::extract_greasepencil_layer_points(), blender::ed::curves::extrude_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::object::mesh_data_to_grease_pencil(), remove_curves(), remove_points(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), blender::ed::greasepencil::tests::TEST_F(), and blender::geometry::trim_curves().

◆ resolution()

VArray< int > blender::bke::CurvesGeometry::resolution ( ) const

How many evaluated points to create for each segment when evaluating Bezier, Catmull Rom, and NURBS curves. On the curve domain. Values must be one or greater.

Definition at line 416 of file curves_geometry.cc.

References blender::bke::ATTR_RESOLUTION, blender::CurvesGeometry::attribute_storage, blender::bke::Curve, and blender::bke::get_varray_attribute().

Referenced by evaluated_normals(), evaluated_positions(), interpolate_to_evaluated(), interpolate_to_evaluated(), and blender::geometry::sample_curve_attribute().

◆ resolution_for_write()

MutableSpan< int > blender::bke::CurvesGeometry::resolution_for_write ( )

◆ reverse_curves()

void blender::bke::CurvesGeometry::reverse_curves ( const IndexMask & curves_to_reverse)

◆ surface_uv_coords()

std::optional< Span< float2 > > blender::bke::CurvesGeometry::surface_uv_coords ( ) const

◆ surface_uv_coords_for_write()

◆ tag_material_index_changed()

void blender::bke::CurvesGeometry::tag_material_index_changed ( )

Call after changing the "material_index" attribute.

Definition at line 1317 of file curves_geometry.cc.

References blender::bke::CurvesGeometryRuntime::max_material_index_cache, and blender::SharedCache< T >::tag_dirty().

◆ tag_normals_changed()

void blender::bke::CurvesGeometry::tag_normals_changed ( )

Call after changing the "tilt" or "up" attributes.

Definition at line 1309 of file curves_geometry.cc.

References blender::bke::CurvesGeometryRuntime::evaluated_normal_cache.

◆ tag_positions_changed()

◆ tag_radii_changed()

void blender::bke::CurvesGeometry::tag_radii_changed ( )

Call when making manual changes to the "radius" attribute. The attribute API will also call this in #finish() calls.

Definition at line 1313 of file curves_geometry.cc.

References blender::bke::CurvesGeometryRuntime::bounds_with_radius_cache.

◆ tag_topology_changed()

◆ tilt()

VArray< float > blender::bke::CurvesGeometry::tilt ( ) const

The angle used to rotate evaluated normals around the tangents after their calculation. Call tag_normals_changed after changes.

Definition at line 438 of file curves_geometry.cc.

References blender::bke::ATTR_TILT, blender::CurvesGeometry::attribute_storage, blender::bke::get_varray_attribute(), and blender::bke::Point.

Referenced by evaluated_normals().

◆ tilt_for_write()

MutableSpan< float > blender::bke::CurvesGeometry::tilt_for_write ( )

◆ transform()

◆ translate()

◆ update_curve_types()


The documentation for this class was generated from the following files: