How can I determine the end point of a spline 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

2 Likes