# How to make Indexed BufferGeometry Fat Line?

**URL:** <https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754>\
**Category:** Questions\
**Tags:** fat-lines\
**Created:** [May 29, 2021, 4:11pm UTC](https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754 "2021-05-29T16:11:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonnavis](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gonnavis/32/11428_2.png) [@gonnavis](https://discourse.threejs.org/u/gonnavis)\
**Post date:** [May 29, 2021, 4:11pm UTC](https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754/1 "2021-05-29T16:11:04Z")

</div>

For example, how to turn this demo to fat line version?  
https://codepen.io/gonnavis/embed/preview/JjWOjdG?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=JjWOjdG

I tried [`examples/Line2`](https://codepen.io/gonnavis/pen/qBrVBKm) and [`examples/WireFrame`](https://codepen.io/gonnavis/pen/rNyYNYV) but all failed.  
And seems `examples/LineSegments2` is very different from `src/LineSegments`, so can not be used directly.

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [May 29, 2021, 6:41pm UTC](https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754/2 "2021-05-29T18:41:51Z")

</div>

Do you know these examples from the [Collection of examples from discourse.threejs.org](https://discourse.threejs.org/t/collection-of-examples-from-discourse-threejs-org/4315) ?

[FatLineEdges](https://hofk.de/main/discourse.threejs/2020/FatLineEdges/FatLineEdges.html) 2020

![2021-05-29 20.40.52](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/e/e/ee0202d0cd6b78fe967220f98c6a844d665f3176.png)

[eXtended eXamples](https://hofk.de/main/discourse.threejs/2019/Xindex2019.html) 2019:  
 ![2021-05-29 20.39.51](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/4/443b60f36a6e90eea2444c2170267a468eb7014b.png)

![2021-05-29 20.39.41](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/6/86175c677af8d41874af41fdd223a956a159c42f.png)

---

<div class="post-metadata">

**Author:** ![gkjohnson](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gkjohnson/32/2298_2.png) [@gkjohnson](https://discourse.threejs.org/u/gkjohnson)\
**Post date:** [May 29, 2021, 6:54pm UTC](https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754/3 "2021-05-29T18:54:23Z")

</div>

If you don’t want to use the `setPositions` function on LineSegments2 you can use the [LineSegmentsGeometry.fromLineSegments](https://github.com/mrdoob/three.js/blob/89f0b932ae3664a377b09a0c3bf1604fae1980e9/examples/jsm/lines/LineSegmentsGeometry.js#L141-L160) function to convert your existing object to thick lines.

---

<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:** [May 29, 2021, 7:47pm UTC](https://discourse.threejs.org/t/how-to-make-indexed-buffergeometry-fat-line/26754/4 "2021-05-29T19:47:10Z")

</div>

It seems this a non-indexed geometry. So it is necessary to convert the indexed geometry to a triangle soup via [BufferGeometry.toNonIndexed()](https://threejs.org/docs/index.html?q=bufferge#api/en/core/BufferGeometry.toNonIndexed).
