I'm not sure I understood you correctly, but obviously you want to instantiate two different meshes at the points of another mesh. Like this:
The following is what you want to achieve:
- At the points of the mesh, one shape is to be instantiated.
- In the center of the edges the other shape should be instantiated, stretching it to the length of the edge.
Therefore I assume the following two simplified shapes in my example:
Instantiating the circular shape at the vertices is easy, but the edges are a little trickier here.
You could, of course, just scale the mesh, but that didn't seem to me to be particularly helpful in this case, because that would cause the mesh itself to lose its actual shape.
In your example, however, you show a mesh that could be split down the middle, and all the points that lie on the X-axis in the positive range could be moved to the right, and all those that lie in the negative range further to the left. This would minimize the deformation or keep the original idea of the shape.
So this task can be solved something like this:
Here I first capture the normals of the edges, and the vector between two endpoints of an edge (the direction of the edge). Since the normals of the edges can behave strangely when the underlying mesh is deformed, I use a trick here with the cross product so that I can reliably get the upvector for aligning the objects.
You can find countless variations of how to align objects along an edge or a normal here on this platform, in case the illustration isn't entirely clear to you.
Stretching the object or moving the points along the edge direction to the length of the edge is a bit more extensive.
As mentioned before, here I move the points depending on their X-position to the left or to the right along the direction vector of the edge.
For this you need additionally on the one hand the information about the length of your object, and on the other hand of course the information about the length of each edge.
By subtracting the length of the object from the length of the edge, dividing this value and multiplying it by $-1$ or $+1$ (left or right), you get a value that you can use to scale the direction vector of an edge and finally as an offset to move the individual points of your objects previously instantiated at the centers of the edges.
If you apply this to your mesh, it looks something like this:
And if you warp the mesh (for example, as I did here in this example) so that you get edges of different lengths, then it looks like this: