Making a line2 with dashed material

Hi, I’m trying to make a line2 with dashed material. The geometry is a LineGeometry() and the material is LineMaterial().
I saw the examples ( and a previous answer on this forum (Dashed Line2 Material)

But it’s not working for me, i think it might be because I’m drawing a geometry that has a InstancedBufferGeometry, since this is the main difference. (From this post: Fat Lines: Setting geometry data does not work)

this is a fiddle with what I’m trying to do:

Any tips?

Whenever you compute new vertices, you have to recompute line distances:

Thank you very much! That was super helpful