# Making a line2 with dashed material

**URL:** <https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322>\
**Category:** Questions\
**Tags:** line2\
**Created:** [October 1, 2020, 2:40pm UTC](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322 "2020-10-01T14:40:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.dep](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dan.dep](https://discourse.threejs.org/u/dan.dep)\
**Post date:** [October 1, 2020, 2:40pm UTC](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322/1 "2020-10-01T14:40:34Z")

</div>

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](https://github.com/mrdoob/three.js/blob/22ed6755399fa180ede84bf18ff6cea0ad66f6c0/examples/main.css)) and a previous answer on this forum ([Dashed Line2 Material](https://discourse.threejs.org/t/dashed-line2-material/10825))

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](https://discourse.threejs.org/t/fat-lines-setting-geometry-data-does-not-work/14448/7))

this is a fiddle with what I’m trying to do: [https://jsfiddle.net/tkqd39jx/1/](https://jsfiddle.net/tkqd39jx/1/)

Any tips?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [October 1, 2020, 2:52pm UTC](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322/2 "2020-10-01T14:52:01Z")

</div>

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

> **[Edit fiddle - JSFiddle - Code Playground](https://jsfiddle.net/10ydqb6e/)**

---

<div class="post-metadata">

**Author:** ![dan.dep](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@dan.dep](https://discourse.threejs.org/u/dan.dep)\
**Post date:** [October 1, 2020, 3:54pm UTC](https://discourse.threejs.org/t/making-a-line2-with-dashed-material/19322/3 "2020-10-01T15:54:36Z")

</div>

Thank you very much! That was super helpful
