Distribute and center points along curve

Hello all,
I’m trying to center evenly the points along a curve… I’m sure there’s an easy way to do it but I don’t know how…
I created a curve with length about 10 meters, divided it by a specific length, say 3 meters.
I’ve got 3 points : one at 3m, 2nd at 6m, 3rd at 9m.
Now I want to move them along the curve to “center” them: 1st at 2m, 2nd at 5m, 3rd at 8m.
Would someone know how to do it with any length and number of points?

I hope I understood you correctly. If you mean “with any length” that the division should be “proportional”, then you can use Evaluate Curve and reparameterize the curve and think of it as having the length 1.0 unit. Then you can define points as “percent”, or, between 0.0 and 1.0, like so:

// Rolf

Is this what you are talking about?

center.gh (11.3 KB)

If you have a curve and know the number of points you want - Divide Curve

https://rhino.github.io/components/vector/divideCurve.html

Thank you Nils, RIL and j porral but it’s not exactly that…
I need to distribute the points the way the distance between them is exactly x, and the first and last segments would have the same length.
Like this image:

Yeah thank you Aris! It’s exactly what I wanted!

Hello again,
I’ve adjusted the routine a way it doesn’t leave less than a half of the distance between the points in the extremities. It works for one curve.

But it becomes harder when I have multiple curves… Is there a way to apply the same rule for several curves at once?
eg. in the image below, I have one segment with 3 points and 1.87m from the extremities, and another with 4 points and 1.82m
test center.gh (8.3 KB)

just graft the curve component output.
edit:
also here is a way to do it with one less component (the “%” symbol in the expression replaces the mod.

center.gh (7.6 KB)

Wonderful! Didn’t know that exists… thank you

You’ll want to use Evaluate Length instead with Normalized set to true. Eval curve divides the domain which isn’t necessarily correlated with the curves length.