Hello, I am learning how to sample multiple curves. Task is to distribute the points on multiple splines in vertex positions according to the spline parameter length (I know it can be achieved in another way easily). I am a bit confused how to specify the ID and connect all together to have these points correctly placed. Thanks!
curve points.blend (1.3 MB)
another approach still does not work;(
this is better, but I am sampling all curves, the last point and first in the next curve have the same position (looks like the start point is missing)
Use Evaluate on Domain in Spline mode:

Good luck.
thanks, I tried that before, something is wrong on my side…
Oh, right… I think I understand now what you are trying to do… Get rid of the first Sample Index… You don’t need to add anything. The Spline Parameter’s length will be sufficient.
In fact, for what you’re trying to do there. The following will be enough:
But for completeness this is what I think you’re trying to achieve:
As per this document, the index is evaluated from the points, so to get it to the Spline Domain you need the extra Sample index.
Good luck!
thanks absolutely complete, that is it, I could not get working, that curve index…
I was interested in how to evaluate that lenght values (any values) correctly along multiple splines, points are just visualisation.
Read that document I linked.
It helps to visualize where the Read evaluations are coming from:
trying to use this solution in another file, if accumulate field is involved, does it work the same way?
below the strange results. Could you tell please from first look what is wrong?
When I use the domain spline amount as index modulo for accumulate field and curve index it works ok.
It is hard to tell just by looking at that… The confusing bit is that even though the index comes from the red line as you’ve shown, it needs to match against the thing that you’re sampling… You can easily get into situations where you’re trying to sample indices that don’t exist.
e.g. if your target has 16 indices, but the source has 4, then chances are that you have to divide the index by 4, and Floor it. (Or mod it by 4)
For 80% of cases Sample Nearest will do the trick. For everything else, you have to be explicit about the index matching. (The example I gave earlier is a trivial case since there are as many points as there are curve-points so indices are guaranteed to match)
this is something I am still new in. The index comes from point field node its position is driven by the accumulate field x value converted to length sampled by sample curve node (seems to me very similar I trained in simplified file above). I can do all with the repeat zone and sampling all curves. But when I involve some booleans and other things the performance is horrible. So had thought to try this way and learn something new as well.
multipacking.zip (565.8 KB)
simplified situation (I hope)…
So, here the source is the curves and there are only so many control points per curve… The target is the points and you have way more points than there are indices in the source curve. Somehow you would need to keep track of the accumulated length per curve and switch to the next curve once the total is above the length… that isn’t something that is possible without a repeat zone or simulation zone as the logic implies that you have some type of feedback.
Sometimes it makes sense to re-frame the problem into something that doesn’t require feedback. E.g. resample the curves and wiggle the positions instead. That way you know up-front the amount of points so everything stays in alignment.
e.g.:
Donno if that will help you.
I need to keep the splines untouched - resampling in large scale scene and small distances did not perform well in my testing, now I better understand to the problem at least, thanks again!
Remember : You don’t need to keep the resampled curves… just use them for the Sampling and then forget about them… the rest of your network can carry on using the un-resampled curves.
yep you are right actually, wanted to try again, but realized, probably, it wont not work well when using instances in mixed large/small sizes randomly.
repeat zone (maybe it is slow?) and booleans in realized corner instances:
in 3ds max railclone is performance in similar tasks 10x faster and I have feeling blender is faster than max…
if I find the way to fit the packing lenghts to segment lenghts (segment length vs packed length ratio) and offset bit + correct the scale as I do per segment in the repeat zone, I think it might be win.
So, the strategy would be quite simple then… If you know the smallest length of an element, just resample the curves to that length… you can then use the accumulate as you did before and then just ignore any “leftover” points. Instance on Points selection has to have the leading value less than the Spline Length. Points are computationally not that expensive so this should work.
Note, to use the Spine Length read node, not the Curve Length.

…donno why that second node exists; I’ve never found a use for it, whereas the first one I use all the time.
The Curve Length node gives you the total length of all splines from the Curve Input whereas the Spline Length node returns the length per single spline. Kinda like as if you would put the Spline Length node to a Attribute Statistic node and use the Max output.
Thanks, I know…
I just never need it since all my curve node-groups are made for multi-splines. 
Thanks, I am estimating the smallest size AFTER the accfield on another limited points node by attribute statistic, to have the group ID for the acummulate field I need to know that value before, so maybe running another accumulate before just to get that value… now need to connect and find the things right way to compare each splines points to each splines lenght to delete leftovers…
no I am not there at all…;(
ID curve points.blend (1.9 MB)
Oh, right… in 4.0 you can abuse the points to curves node’s weight input to sort things. In 4.1 there is a dedicated sort elements node to do that.
Edit: get updated file below.
e.g.:Pack curve.blend (103.5 KB) (Saved in 4.1RC)
My approach appears to be way simpler. 
Edit: enabled Reset Children - that should give more consistent results with weird collection inputs.