Blender  V3.3
Namespaces | Functions
blender::bke::curves Namespace Reference

Namespaces

 bezier
 
 catmull_rom
 
 nurbs
 
 poly
 

Functions

void copy_point_data (const CurvesGeometry &src_curves, const CurvesGeometry &dst_curves, Span< IndexRange > curve_ranges, GSpan src, GMutableSpan dst)
 
void copy_point_data (const CurvesGeometry &src_curves, const CurvesGeometry &dst_curves, IndexMask src_curve_selection, GSpan src, GMutableSpan dst)
 
template<typename T >
void copy_point_data (const CurvesGeometry &src_curves, const CurvesGeometry &dst_curves, const IndexMask src_curve_selection, const Span< T > src, MutableSpan< T > dst)
 
void fill_points (const CurvesGeometry &curves, IndexMask curve_selection, GPointer value, GMutableSpan dst)
 
template<typename T >
void fill_points (const CurvesGeometry &curves, const IndexMask curve_selection, const T &value, MutableSpan< T > dst)
 
bke::CurvesGeometry copy_only_curve_domain (const bke::CurvesGeometry &src_curves)
 
void fill_curve_counts (const bke::CurvesGeometry &curves, Span< IndexRange > curve_ranges, MutableSpan< int > counts)
 
void accumulate_counts_to_offsets (MutableSpan< int > counts_to_offsets, int start_offset=0)
 
IndexMask indices_for_type (const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, const CurveType type, const IndexMask selection, Vector< int64_t > &r_indices)
 
void foreach_curve_by_type (const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, IndexMask selection, FunctionRef< void(IndexMask)> catmull_rom_fn, FunctionRef< void(IndexMask)> poly_fn, FunctionRef< void(IndexMask)> bezier_fn, FunctionRef< void(IndexMask)> nurbs_fn)
 
Inline Curve Methods
int segments_num (const int points_num, const bool cyclic)
 
float2 encode_surface_bary_coord (const float3 &v)
 
float3 decode_surface_bary_coord (const float2 &v)
 

Function Documentation

◆ accumulate_counts_to_offsets()

void blender::bke::curves::accumulate_counts_to_offsets ( MutableSpan< int >  counts_to_offsets,
int  start_offset = 0 
)

Turn an array of sizes into the offset at each index including all previous sizes.

Definition at line 28 of file curves_utils.cc.

References BLI_assert, count, blender::IndexRange::drop_back(), blender::MutableSpan< T >::index_range(), blender::MutableSpan< T >::last(), and offset.

Referenced by blender::geometry::resample_to_uniform().

◆ copy_only_curve_domain()

bke::CurvesGeometry blender::bke::curves::copy_only_curve_domain ( const bke::CurvesGeometry src_curves)

Copy only the information on the point domain, but not the offsets or any point attributes, meant for operations that change the number of points but not the number of curves.

Warning
The returned curves have invalid offsets!

Definition at line 87 of file curves_utils.cc.

References CD_DUPLICATE, CD_MASK_ALL, CurvesGeometry::curve_data, blender::bke::CurvesGeometry::curves_num(), CustomData_copy(), and CurvesGeometry::runtime.

Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::fillet_curves(), and blender::geometry::subdivide_curves().

◆ copy_point_data() [1/3]

template<typename T >
void blender::bke::curves::copy_point_data ( const CurvesGeometry src_curves,
const CurvesGeometry dst_curves,
const IndexMask  src_curve_selection,
const Span< T src,
MutableSpan< T dst 
)

Definition at line 35 of file BKE_curves_utils.hh.

References copy_point_data(), and src.

◆ copy_point_data() [2/3]

void blender::bke::curves::copy_point_data ( const CurvesGeometry src_curves,
const CurvesGeometry dst_curves,
IndexMask  src_curve_selection,
GSpan  src,
GMutableSpan  dst 
)

◆ copy_point_data() [3/3]

void blender::bke::curves::copy_point_data ( const CurvesGeometry src_curves,
const CurvesGeometry dst_curves,
Span< IndexRange curve_ranges,
GSpan  src,
GMutableSpan  dst 
)

Copy the provided point attribute values between all curves in the #curve_ranges index ranges, assuming that all curves have the same number of control points in #src_curves and #dst_curves.

Definition at line 40 of file curves_utils.cc.

References blender::Span< T >::index_range(), and blender::threading::parallel_for().

Referenced by copy_point_data().

◆ decode_surface_bary_coord()

float3 blender::bke::curves::decode_surface_bary_coord ( const float2 v)
inline

Definition at line 474 of file BKE_curves.hh.

References v.

◆ encode_surface_bary_coord()

float2 blender::bke::curves::encode_surface_bary_coord ( const float3 v)
inline

Definition at line 468 of file BKE_curves.hh.

References blender::math::abs(), BLI_assert, and v.

◆ fill_curve_counts()

void blender::bke::curves::fill_curve_counts ( const bke::CurvesGeometry curves,
Span< IndexRange curve_ranges,
MutableSpan< int >  counts 
)

Copy the size of every curve in #curve_ranges to the corresponding index in #counts.

Definition at line 13 of file curves_utils.cc.

References blender::Span< T >::index_range(), and blender::threading::parallel_for().

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

◆ fill_points() [1/2]

template<typename T >
void blender::bke::curves::fill_points ( const CurvesGeometry curves,
const IndexMask  curve_selection,
const T value,
MutableSpan< T dst 
)

Definition at line 50 of file BKE_curves_utils.hh.

References curves, and fill_points().

◆ fill_points() [2/2]

void blender::bke::curves::fill_points ( const CurvesGeometry curves,
IndexMask  curve_selection,
GPointer  value,
GMutableSpan  dst 
)

◆ foreach_curve_by_type()

void blender::bke::curves::foreach_curve_by_type ( const VArray< int8_t > &  types,
const std::array< int, CURVE_TYPES_NUM > &  type_counts,
IndexMask  selection,
FunctionRef< void(IndexMask)>  catmull_rom_fn,
FunctionRef< void(IndexMask)>  poly_fn,
FunctionRef< void(IndexMask)>  bezier_fn,
FunctionRef< void(IndexMask)>  nurbs_fn 
)

◆ indices_for_type()

IndexMask blender::bke::curves::indices_for_type ( const VArray< int8_t > &  types,
const std::array< int, CURVE_TYPES_NUM > &  type_counts,
const CurveType  type,
const IndexMask  selection,
Vector< int64_t > &  r_indices 
)

◆ segments_num()

int blender::bke::curves::segments_num ( const int  points_num,
const bool  cyclic 
)
inline