1

I've got a BufferGeometry from which I extract the edges and display the lines:

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 }));
scene.add(line);

Now I've got a quite complex shape. There are extracted edges which do not exist from this shape (see pictures below). My first thought was, that there are maybe little holes in my shape, but when I display the whole mesh I don't see any holes.

Has anyone got an idea why this is happening?

LineSegments:

enter image description here

Mesh:

enter image description here

If needed, here's the code for displaying the mesh:

const geometry = new THREE.BufferGeometry();
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
const mesh = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({color: 0x77a6f2, side: THREE.DoubleSide}));
scene.add(mesh);

Mesh with LineSegments overlay (only part of it due to the visibility):

enter image description here

Stephan Häberle
  • 340
  • 2
  • 14
  • 1
    AFAICS, the root cause for this issue is explained here: https://github.com/mrdoob/three.js/issues/10517 – Mugen87 Jul 01 '21 at 07:38
  • You can try using an `thresholdAngle` (second parameter of [EdgesGeometry](https://threejs.org/docs/index.html?q=edges#api/en/geometries/EdgesGeometry)): `new THREE.EdgesGeometry(geometry, 20)`. But since the last image looks very "jaggy", the mesh seems to be corrupted, @Mugen87 might already point to the right issue. – Brakebein Jul 01 '21 at 17:46

0 Answers0