Adding shapes to lines

I am looking for some guidance on the best way to create lines which include additional shapes, like this…

My end goal is to have a simple function whereby I specify a start and end point and it works out how many evenly spaced shapes I can get, so then if I change the length of the line the shapes update accordingly…Before I go down the wrong path, I just want to see if anyone had a fancy way of doing this?

I was going to use the normal line stuff threejs has (maybe the fat lines so I can control with) and then either use sprites or geometry to add the shapes and then put everything in a group - is there a better approach, perhaps with shaders?

Just cook this pattern from these primitives

1 Like

You will need to “walk” the line on the cpu, and place the dots along it.

Just so I am understanding correctly, I could look to modify the fat lines shader three already has, to include these shapes?

Yes, you can inject into a fat line, or just draw connected shapes using primitives. Because that seems to be what you were asking for originally. But I assume you need a 3D environment and not a simple flat pattern, so fat line modification is probably what you are looking for.

Yes, 3D, thanks a lot, I’ve never done such thing, but ill give it a go!