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

Classes

class  CurveParameterFieldInput
class  CurveLengthParameterFieldInput
class  IndexOnSplineFieldInput

Functions

static void node_declare (NodeDeclarationBuilder &b)
static Array< float > accumulated_lengths_curve_domain (const bke::CurvesGeometry &curves)
static Array< float > calculate_curve_parameters (const bke::CurvesGeometry &curves)
static Array< float > calculate_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< float > calculate_point_parameters (const bke::CurvesGeometry &curves)
static void node_geo_exec (GeoNodeExecParams params)
static void node_register ()

Function Documentation

◆ accumulated_lengths_curve_domain()

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 accumulated_lengths_curve_domain(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::bke::CurvesGeometry::evaluated_length_total_for_curve(), i, and length().

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

◆ calculate_curve_parameters()

◆ calculate_point_lengths()

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 calculate_point_lengths(), blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::threading::parallel_for(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::resolution(), and result.

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

◆ calculate_point_parameters()

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

◆ convert_lengths_to_factors()

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

◆ node_declare()

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

◆ node_geo_exec()

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

◆ node_register()