# Remove inner line with EdgesGeometry

**URL:** <https://discourse.threejs.org/t/remove-inner-line-with-edgesgeometry/26769>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [May 30, 2021, 12:22pm UTC](https://discourse.threejs.org/t/remove-inner-line-with-edgesgeometry/26769 "2021-05-30T12:22:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_Haberle](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/stephan_haberle/32/14735_2.png) [@Stephan\_Haberle](https://discourse.threejs.org/u/Stephan_Haberle)\
**Post date:** [May 30, 2021, 12:22pm UTC](https://discourse.threejs.org/t/remove-inner-line-with-edgesgeometry/26769/1 "2021-05-30T12:22:55Z")

</div>

I’m creating an BufferGeometry. Now I’m trying to get the outer lines of the geometry with EdgesGeometry. This works fine with following code:  
const geometry = new THREE.BufferGeometry();  
geometry.setAttribute(‘position’, new THREE.BufferAttribute(vertices, 3));  
const edges = new THREE.EdgesGeometry(geometry);  
const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0xc4eaff }));

But it’s possible that there are “holes” in my BufferGeometry. Is there a way to remove those with EdgesGeometry?

What I get:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/5/0/50bca56e2dc1e35129ec44e0de9fc0968d154c56.png)

What I want:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/a/8/a8892fa04fd6307d04336de66f139eed3fea4167.png)

---

<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 30, 2021, 3:56pm UTC](https://discourse.threejs.org/t/remove-inner-line-with-edgesgeometry/26769/2 "2021-05-30T15:56:22Z")

</div>

`EdgesGeometry` visualizes all edges which are not shared. Hence, it will also visualize the mentioned holes of your geometry.

`EdgesGeometry` does not support your use case (rendering just the outline) by default. So I’m afraid you have to implement an enhanced version of `EdgesGeometry` that fulfills your requirements.

---

<div class="post-metadata">

**Author:** ![Stephan\_Haberle](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/stephan_haberle/32/14735_2.png) [@Stephan\_Haberle](https://discourse.threejs.org/u/Stephan_Haberle)\
**Post date:** [May 31, 2021, 5:22pm UTC](https://discourse.threejs.org/t/remove-inner-line-with-edgesgeometry/26769/3 "2021-05-31T17:22:42Z")

</div>

I’ve managed to solve the problem by:

1. Get a vert at the outer line in EdgesGeometry
2. ‘walk’ from vert to vert on outerline
3. Stop when first vert is reached again
4. Create a shape from the verts, extract lines
