Blender  V3.3
Functions
blender::bke::curves::catmull_rom Namespace Reference

Functions

int calculate_evaluated_num (int points_num, bool cyclic, int resolution)
 
void interpolate_to_evaluated (GSpan src, bool cyclic, int resolution, GMutableSpan dst)
 
void interpolate_to_evaluated (const GSpan src, const bool cyclic, const Span< int > evaluated_offsets, GMutableSpan dst)
 
template<typename T >
static T calculate_basis (const T &a, const T &b, const T &c, const T &d, const float parameter)
 
template<typename T >
static void evaluate_segment (const T &a, const T &b, const T &c, const T &d, MutableSpan< T > dst)
 
template<typename T , typename RangeForSegmentFn >
static void interpolate_to_evaluated (const Span< T > src, const bool cyclic, const RangeForSegmentFn &range_fn, MutableSpan< T > dst)
 
template<typename T >
static void interpolate_to_evaluated (const Span< T > src, const bool cyclic, const int resolution, MutableSpan< T > dst)
 
template<typename T >
static void interpolate_to_evaluated (const Span< T > src, const bool cyclic, const Span< int > evaluated_offsets, MutableSpan< T > dst)
 

Function Documentation

◆ calculate_basis()

template<typename T >
static T blender::bke::curves::catmull_rom::calculate_basis ( const T a,
const T b,
const T c,
const T d,
const float  parameter 
)
static

Definition at line 25 of file curve_catmull_rom.cc.

References Freestyle::a, usdtokens::b(), Freestyle::c, and t.

◆ calculate_evaluated_num()

int blender::bke::curves::catmull_rom::calculate_evaluated_num ( int  points_num,
bool  cyclic,
int  resolution 
)

Calculate the number of evaluated points that interpolate_to_evaluated is expected to produce.

Parameters
points_numThe number of points in the curve.
resolutionThe resolution for each segment.

Definition at line 12 of file curve_catmull_rom.cc.

References max, and blender::bke::curves::segments_num().

Referenced by blender::bke::calculate_evaluated_offsets(), and interpolate_to_evaluated().

◆ evaluate_segment()

template<typename T >
static void blender::bke::curves::catmull_rom::evaluate_segment ( const T a,
const T b,
const T c,
const T d,
MutableSpan< T dst 
)
static

◆ interpolate_to_evaluated() [1/5]

void blender::bke::curves::catmull_rom::interpolate_to_evaluated ( const GSpan  src,
const bool  cyclic,
const Span< int >  evaluated_offsets,
GMutableSpan  dst 
)

Evaluate the Catmull Rom curve. The size of each segment and its offset in the #dst span is encoded in #evaluated_offsets, with the same method as #CurvesGeometry::offsets().

Definition at line 156 of file curve_catmull_rom.cc.

References blender::attribute_math::convert_to_static_type(), and src.

◆ interpolate_to_evaluated() [2/5]

template<typename T >
static void blender::bke::curves::catmull_rom::interpolate_to_evaluated ( const Span< T src,
const bool  cyclic,
const int  resolution,
MutableSpan< T dst 
)
static

◆ interpolate_to_evaluated() [3/5]

template<typename T , typename RangeForSegmentFn >
static void blender::bke::curves::catmull_rom::interpolate_to_evaluated ( const Span< T src,
const bool  cyclic,
const RangeForSegmentFn &  range_fn,
MutableSpan< T dst 
)
static
Parameters
range_fnReturns an index range describing where in the #dst span each segment should be evaluated to, and how many points to add to it. This is used to avoid the need to allocate an actual offsets array in typical evaluation use cases where the resolution is per-curve.

Definition at line 52 of file curve_catmull_rom.cc.

References evaluate_segment(), blender::MutableSpan< T >::first(), blender::MutableSpan< T >::last(), blender::threading::parallel_for(), blender::MutableSpan< T >::slice(), and src.

◆ interpolate_to_evaluated() [4/5]

template<typename T >
static void blender::bke::curves::catmull_rom::interpolate_to_evaluated ( const Span< T src,
const bool  cyclic,
const Span< int >  evaluated_offsets,
MutableSpan< T dst 
)
static

◆ interpolate_to_evaluated() [5/5]

void blender::bke::curves::catmull_rom::interpolate_to_evaluated ( GSpan  src,
bool  cyclic,
int  resolution,
GMutableSpan  dst 
)

Evaluate the Catmull Rom curve. The length of the #dst span should be calculated with calculate_evaluated_num and is expected to divide evenly by the src span's segment size.

Definition at line 141 of file curve_catmull_rom.cc.

References blender::attribute_math::convert_to_static_type(), and src.

Referenced by interpolate_to_evaluated().