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 (https://github.com/mrdoob/three.js/blob/22ed6755399fa180ede84bf18ff6cea0ad66f6c0/examples/main.css) 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: https://jsfiddle.net/tkqd39jx/1/

Any tips?

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

Thank you very much! That was super helpful