How can I determine the end point of a spline in PCG?

I want to use PCG to place objects using spline sampler. How can I determine the start and end points of the spline so that I can place different objects at the beginning and end for finishing touches?

  1. Parametric Evaluation: Splines are typically defined by parametric equations. To find the endpoint, you can evaluate the spline function at its endpoint parameter value. This value may be explicitly defined or inferred from the spline’s control points.
  2. Control Points: In many cases, splines are defined by control points (e.g., Bezier or B-spline control points). The endpoint can be one of these control points or derived from them.
  3. Length-Based: If you want to find a specific endpoint based on a certain length along the spline, you can iterate along the spline, accumulating the arc length until you reach the desired length. This can be useful for animations or simulations where you need to travel a certain distance along the spline.
  4. Interpolation: For splines that interpolate a set of keyframes or waypoints, the endpoint may be defined explicitly as the last keyframe or waypoint.
  5. Tangent or Normal Vector: Depending on your use case, you might be interested in the tangent or normal vector at the endpoint. These vectors can be calculated using differentiation techniques or geometric properties of the spline.

Did you ever figure this out?

I am trying to find the end point in PCG.

For the first Index, its always zero, so just set a Attribute Select node to 0 like so:

To find the last index:
You can find the last index by using a Copy Attribute node, setting that to $Index and Index → Add a Get Attribute from Index node (Set input to Index) → Inbetween those two add a Sort Attributes node → Add a Get Point Count Node → Add a Subtract node → Add a Float to your Graph as a Parameter and set it to -1 → Attach the -1 into the B input of the Subtract node → Plugin this outcome into the Index of the Attribute Select from Subtract node.

Bit of a hassle, but it works - hope it helps!

You need to create a feedback loop for splines (if you have multiple) My example is based on a landscape node but its the same logic