# How to make two points move along a path keeping a fixed (direct) distance all along?

You know how a train wagon moves on its tracks? If it takes a curve only the wheels stay perfectly above the track, the rest of the wagon might get offset a bit.

This motion is exactly what I am trying to recreate in Blender.

Try one: Armature constraint and offset

First thing I tried was using an armature with two bones, one following my path with a constraint, the second just with an offset. On pretty straight paths this is very effective.

Pic 1: The green bone is the middle one, the blue one is the offset one, the orange line is my path and the circle represents the fixed distance for the second bone. The blue bone should always be on the crossing of the circle and the path.

However, this turned out to be ineffective for sharp turns, because the offset is not the direct distance (represented by the circle and purple line) but the distance via the curve (as seen in Pic 2, green).

Try two: Armature constraints and limit distance

Second way I tried is similar to the first, it uses an armature and two bones with a follow path constraint, the second having an offset. The only thing that's different is that I included a Limit Distance-constraint on the offset bone. This worked pretty well, as seen in Pic 3, except that it limits the distance after it follows the path, which means it isn't on the path anymore. The otherway around is even less effective (Limit Distance, then Follow Path) because then the position gotten from limiting the distance is used in following the path as well.

Third try: Line segment and curve modifier

The last option I tried, came from this post. It used a line segment and a curve modifier on it. This seemed very effective too, except I had the same problem as in my first try; it didn't use the direct distance (purple) but the curve distance (green) to bend the segment (Pic 4).

My final question

How can I make two points follow the same curve but with always a certain distance apart as the crow flies?

You can do it with animation nodes.

I use a loop to iterate over the points of the curve and calculate the distance between the two points.

Node tree:

result:

Note: the higher you increase the amount of the float range, the more precise the result will be. This is NOT an exact result, it is "just" an approximation. But the approximation will be really good if the amount is high enough.

Another possibility

... might be to give physics a try...But i am not sure whether it is what you want.

I gave the curve a rigid body after converting it to a mesh. Then a added an empty with rigid body constraint type "point":

result:

Note: i had to increase the substeps to 100 so that it worked realistic...

• Thanks for this answer. I have two questions: - Is this possible maybe with Geometry nodes? - What are the different objects in your node tree you used? Commented Oct 3, 2021 at 17:34
• at the current development of geometry nodes AFAIK it is not possible. I use a loop here and loops are not possible with geometry nodes right now. Commented Oct 3, 2021 at 17:39
• what do you mean with objects? i used a cylinder, a cube and a circle (which is the bezierpath)...if you mean that....the spline/curve is generated/created by the AN node tree Commented Oct 3, 2021 at 17:41
• a target in AN is an object which will be generated by AN. In this case it is a curve/spline and is the "cylinder"/distance between the two objects. I wanted to visualize the distance so that you can see it is constant and that it looks a bit better ;) Commented Oct 3, 2021 at 17:56
• i know - if you are new to animation nodes, this is hard to understand. But i am sure, if you learn it you will love it. Possibilities are amazing and it is really worth learning it. Commented Oct 3, 2021 at 17:57