# Blurred LatheGeometry output

**URL:** <https://discourse.threejs.org/t/blurred-lathegeometry-output/4428>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [October 9, 2018, 3:22am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428 "2018-10-09T03:22:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbourne](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mbourne/32/2866_2.png) [@mbourne](https://discourse.threejs.org/u/mbourne)\
**Post date:** [October 9, 2018, 3:22am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428/1 "2018-10-09T03:22:40Z")

</div>

I’ve adapted a LatheGeometry pen (Pot Maker, by Don Pinkus, which fills the frame) to load in a div, here: [https://www.intmath.com/math-art-code/solid-revolution-maker.php](https://www.intmath.com/math-art-code/solid-revolution-maker.php)

The result is blurry, as follows:

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/0/0703ac68aeb8480749799e95e072e67d6279daa5.jpeg)

The relevant function is as follows:

```
function addLathe(points = []) {
  let normalizedPoints = [];
  for (let i = 0; i < points.length; i++) {
	let scale = globals.cameraDimensions.frustrumSize;
	let absDistanceFromCenter = Math.abs(-canvasFromLeft + points[i].x - canvasWidth / 2);
	let nWidth = absDistanceFromCenter / (canvasWidth / 2);
	let nHeight = (-canvasFromTop + points[i].y) * -1 / canvasHeight;
	normalizedPoints.push(
	  new THREE.Vector2(
		nWidth * globals.cameraDimensions.right,
		nHeight * scale + globals.cameraDimensions.top
	  )
	);
  }
  var geometry = new THREE.LatheGeometry(normalizedPoints, 60 );
  geometry.mergeVertices();
  var material = new THREE.MeshNormalMaterial({
	side: THREE.DoubleSide
  });
  //material.magFilter = THREE.NearestFilter;
  //material.minFilter = THREE.LinearMipMapLinearFilter;
  
  var lathe = new THREE.Mesh(geometry, material);
  if (globals.objects.lathe) {
	scene.remove(globals.objects.lathe);
  }
  globals.objects.lathe = lathe;
  scene.add(globals.objects.lathe);
}

```

I experimented with `magFilter` and `minFilter` on the material, but it didn’t make a difference.

I suspect it’s a problem with the normalizing and/or scaling, but couldn’t fix it.

Also, on updating to r97, I"m now seeing “Faceless geometries are not supported.” I couldn’t figure out how to fix that.

---

<div class="post-metadata">

**Author:** ![calrk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/calrk/32/2746_2.png) [@calrk](https://discourse.threejs.org/u/calrk)\
**Post date:** [October 9, 2018, 3:54am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428/2 "2018-10-09T03:54:20Z")

</div>

The renderer’s size (300x150 pixels) isn’t set to the correct size for your canvas (450x450 pixels) as shown by the attached image. (red box in image)  
You can fix this by setting the renderer’s size to match the canvas `renderer.setSize(450,450);` (blue box in image)  
 ![image](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/f/fcc55779e2664d181eddc88e2d8d94ea6b7987ce.png)

---

<div class="post-metadata">

**Author:** ![mbourne](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mbourne/32/2866_2.png) [@mbourne](https://discourse.threejs.org/u/mbourne)\
**Post date:** [October 9, 2018, 8:43am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428/3 "2018-10-09T08:43:52Z")

</div>

Perfect - thank you. It’s fixed now.

Any ideas on how to fix “Faceless geometries are not supported”?

---

<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 9, 2018, 9:39am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428/4 "2018-10-09T09:39:32Z")

</div>

I think this happens since you call `LatheGeometry()` with just a single point. I suggest you use `LatheBufferGeometry` and remove the call of `mergeVertices()`. Alternatively, you only create an instance of `LatheGeometry` if `normalizedPoints` has at least two points.

BTW: `minFilter` and `magFilter` are properties of `Texture` and not of `Material`. So setting them on a material has no effect.

---

<div class="post-metadata">

**Author:** ![mbourne](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mbourne/32/2866_2.png) [@mbourne](https://discourse.threejs.org/u/mbourne)\
**Post date:** [October 9, 2018, 11:33am UTC](https://discourse.threejs.org/t/blurred-lathegeometry-output/4428/5 "2018-10-09T11:33:08Z")

</div>

Creating `LatheGeometry` only when there are 2 or more points fixed it. Thanks a lot!
