# Delete line created using buffergeometry

**URL:** <https://discourse.threejs.org/t/delete-line-created-using-buffergeometry/10396>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [October 22, 2019, 6:32am UTC](https://discourse.threejs.org/t/delete-line-created-using-buffergeometry/10396 "2019-10-22T06:32:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milind\_anantwar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/milind_anantwar/32/5281_2.png) [@milind\_anantwar](https://discourse.threejs.org/u/milind_anantwar)\
**Post date:** [October 22, 2019, 6:32am UTC](https://discourse.threejs.org/t/delete-line-created-using-buffergeometry/10396/1 "2019-10-22T06:32:53Z")

</div>

Hi, I am creating the polygon using array of points using following code:

```
var lineGeometry = new THREE.BufferGeometry();
lineGeometry.addAttribute('position', new THREE.BufferAttribute(pointsArray, 3));
// material
var lineMaterial = new THREE.LineBasicMaterial({
    color: 0x2f58d3,
    linewidth: 2
});

// line
line = new THREE.Line(lineGeometry, lineMaterial);

scene.add(line);
meshesFoorDesign.push(line);

```

I need to remove all the meshes including polygon if user clicks on clear button. I am using below code for doing this. It is doing the job for three js meshes however polygons drawn using buffergeometry and line is not deleted. Any help would be appriciated.

```
for (var i = 0; i < meshesFoorDesign.length; i++) {
            var sceneMesh = meshesFoorDesign[i];

             if (typeof (sceneMesh) == "undefined")
                 continue;
             scene.remove(sceneMesh);
             sceneMesh.geometry.dispose();
             sceneMesh.material.dispose();
}

```

Version : 103

---

<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 22, 2019, 3:38pm UTC](https://discourse.threejs.org/t/delete-line-created-using-buffergeometry/10396/2 "2019-10-22T15:38:17Z")

</div>

I’m afraid I’m unable to reproduce the issue with this live example: [https://jsfiddle.net/e16h0umg/1/](https://jsfiddle.net/e16h0umg/1/)

Removing the lines works fine with `R103` and `R109`(latest version).

Can you modify the live example in order to demonstrate the issue?
