Blender V4.3
blender::nodes::node_geo_curve_spline_parameter_cc Namespace Reference

Classes

class  CurveLengthParameterFieldInput
 
class  CurveParameterFieldInput
 
class  IndexOnSplineFieldInput
 

Functions

static void node_declare (NodeDeclarationBuilder &b)
 
static Array< floataccumulated_lengths_curve_domain (const bke::CurvesGeometry &curves)
 
static Array< floatcalculate_curve_parameters (const bke::CurvesGeometry &curves)
 
static Array< floatcalculate_point_lengths (const bke::CurvesGeometry &curves, const FunctionRef< void(MutableSpan< float >, float)> postprocess_lengths_for_curve)
 
static void convert_lengths_to_factors (MutableSpan< float > lengths, const float total_curve_length)
 
static Array< floatcalculate_point_parameters (const bke::CurvesGeometry &curves)
 
static void node_geo_exec (GeoNodeExecParams params)
 
static void node_register ()
 

Function Documentation

◆ accumulated_lengths_curve_domain()

static Array< float > blender::nodes::node_geo_curve_spline_parameter_cc::accumulated_lengths_curve_domain ( const bke::CurvesGeometry & curves)
static

For lengths on the curve domain, a basic interpolation from the point domain would be useless, since the average parameter for each curve would just be 0.5, or close to it. Instead, the value for each curve is defined as the portion of the total length of all curves at its start.

Definition at line 31 of file node_geo_curve_spline_parameter.cc.

References length().

Referenced by calculate_curve_parameters(), and blender::nodes::node_geo_curve_spline_parameter_cc::CurveLengthParameterFieldInput::get_varray_for_context().

◆ calculate_curve_parameters()

static Array< float > blender::nodes::node_geo_curve_spline_parameter_cc::calculate_curve_parameters ( const bke::CurvesGeometry & curves)
static

◆ calculate_point_lengths()

static Array< float > blender::nodes::node_geo_curve_spline_parameter_cc::calculate_point_lengths ( const bke::CurvesGeometry & curves,
const FunctionRef< void(MutableSpan< float >, float)> postprocess_lengths_for_curve )
static

Return the length of each control point along each curve, starting at zero for the first point. Importantly, this is different than the length at each evaluated point. The implementation is different for every curve type:

  • Catmull Rom Curves: Use the resolution to find the evaluated point for each control point.
  • Poly Curves: Copy the evaluated lengths, but we need to add a zero to the front of the array.
  • Bezier Curves: Use the evaluated offsets to find the evaluated point for each control point.
  • NURBS Curves: Treat the control points as if they were a poly curve, because there is no obvious mapping from each control point to a specific evaluated point.

Definition at line 81 of file node_geo_curve_spline_parameter.cc.

References blender::threading::parallel_for(), and result.

Referenced by calculate_point_parameters(), and blender::nodes::node_geo_curve_spline_parameter_cc::CurveLengthParameterFieldInput::get_varray_for_context().

◆ calculate_point_parameters()

static Array< float > blender::nodes::node_geo_curve_spline_parameter_cc::calculate_point_parameters ( const bke::CurvesGeometry & curves)
static

◆ convert_lengths_to_factors()

static void blender::nodes::node_geo_curve_spline_parameter_cc::convert_lengths_to_factors ( MutableSpan< float > lengths,
const float total_curve_length )
static

◆ node_declare()

static void blender::nodes::node_geo_curve_spline_parameter_cc::node_declare ( NodeDeclarationBuilder & b)
static

Definition at line 14 of file node_geo_curve_spline_parameter.cc.

References b, and blender::nodes::SocketDeclaration::description.

Referenced by node_register().

◆ node_geo_exec()

static void blender::nodes::node_geo_curve_spline_parameter_cc::node_geo_exec ( GeoNodeExecParams params)
static

Definition at line 283 of file node_geo_curve_spline_parameter.cc.

References node_geo_exec(), and params.

Referenced by node_geo_exec(), and node_register().

◆ node_register()

static void blender::nodes::node_geo_curve_spline_parameter_cc::node_register ( )
static