# Artifact with Lathe Geometry and light

**URL:** <https://discourse.threejs.org/t/artifact-with-lathe-geometry-and-light/44927>\
**Category:** Questions\
**Tags:** lighting, geometry\
**Created:** [November 19, 2022, 11:07pm UTC](https://discourse.threejs.org/t/artifact-with-lathe-geometry-and-light/44927 "2022-11-19T23:07:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PDihax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pdihax/32/31211_2.png) [@PDihax](https://discourse.threejs.org/u/PDihax)\
**Post date:** [November 19, 2022, 11:07pm UTC](https://discourse.threejs.org/t/artifact-with-lathe-geometry-and-light/44927/1 "2022-11-19T23:07:18Z")

</div>

Hello, I’m new to the three js world and I’m doing a small project of a 3D printer that can print two types of objects (Extrusion and Revolution). For the revolution type I’m using LatheGeometry. I made a Path for every model I need. Here’s the code that creates the mesh

```nohighlight
shape = Curves[GUIController.Revolution_Shape].getPath()
shapeGeometry = new THREE.LatheGeometry( shape.getPoints(), GUIController.Print_Steps, 0, 2*Math.PI );
shapeGeometry = THREE.BufferGeometryUtils.mergeVertices(shapeGeometry, 0.05)
shapeGeometry.computeVertexNormals();
            
shapeMaterial = new THREE.MeshPhongMaterial({
color: GUIController.Print_Color,
clippingPlanes: [this.clippingPlane],
flatShading: false,
})
const print = new THREE.Mesh(shapeGeometry, shapeMaterial)

```

And here’s an example of one curve

```nohighlight
"A1": {
        getPath: () => {
            const path = new THREE.Path()
            path.moveTo(0.0,0.0)
            path.lineTo(-0.5,0.0)
            path.lineTo(-0.5,0.125)
            path.lineTo(-0.165,0.25)
            path.bezierCurveTo(-0.375,0.375,-0.375,0.625,-0.165,0.75)
            path.lineTo(-0.5,0.875)
            path.lineTo(-0.5,1.0)
            path.lineTo(0.0,1.0)
            return path
        },
        type: "Rev"
    }

```

Here’s the light of the scene

```nohighlight
/Add Point Light
const pointLightColor = 0xFFFFFF
const pointLightIntensity = 0.75
const pointLight = new THREE.PointLight(pointLightColor, pointLightIntensity)
pointLight.position.set(0, 5, 0)
scene.add(pointLight)

```

But, when the object is rendered it has a little artifact from where it started and ended the revolution

 ![Screenshot from 2022-11-19 20-03-56](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/d/6/d6bfe27d85a7445b66b6fd869c3d075a8aa9b72c.png)  
Does anyone knows what can be the cause? I tried not computing the vertexNormals and the artifact goes away but the lightning is all messed up. Been trying to fix this for a few days now and nothing worked

---

<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:** [November 20, 2022, 6:19pm UTC](https://discourse.threejs.org/t/artifact-with-lathe-geometry-and-light/44927/2 "2022-11-20T18:19:38Z")

</div>

> [@PDihax](#):
>
> ```javascript
> shapeGeometry = THREE.BufferGeometryUtils.mergeVertices(shapeGeometry, 0.05)
> shapeGeometry.computeVertexNormals();
> 
> ```

The vertices can’t be merged at the seam since uv-coordinates are different. It’s only possible to merge vertices if _all_ vertex data equal.
