This here works because lines have the same tangent vector everywhere. If you’re dealing with curved splines, then you’ll have to compute some sort of average tangent, or maybe just look at the start-end vector.
A vector (in 3d-space) is an ordered triplet of numbers. One telling you the amount this vector travels along the world X axis, one for y and one for z. You can write a vector like (x,y,z). Points (in 3d-space) are also ordered triplets of numbers, although in this case they are coordinates rather than factors.
Since vectors are points are both triplets, they are easy to convert into each other, even though the meaning of the numbers is different. Grasshopper doesn’t have a component for grouping similar vectors, but it does have one for grouping similar points, so that’s why we have to convert the data from one type (vectors) into another (points).
The Point Group component uses a distance metric to figure out which points in a cloud would belong to the same group. This is a bit awkward since what we really want is an angle metric between vector directions rather than a distance metric between points. And if you need exact control over angles we’ll have to do some trig to figure out a conversion between those. However you can probably just pick the threshold with some manual fiddling until you have a value that works.