0

I create a Buffergeometry with my data and extract LineSegments to only show the outer 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 }));

Because there's an 'hole' in the data, I get e result something like this: enter image description here

Is there an easy way to remove the inner lines in my LineSegments to get e result like this: enter image description here

Stephan Häberle
  • 340
  • 2
  • 14
  • I was writing an answer when I realized you're using `EdgesGeometry`. I'm not sure how this object organizes its data, and I don't have time at the moment to explore it. However, the idea I was going for is you need to find a vertex that is on the outer edge, then walk the vertices that make up the segment chain of the outer edge. When you get back to the original vertex, any vertices that weren't visited can be discarded. – TheJim01 May 26 '21 at 14:35
  • Thanks for the hint. I'll check this out. What would you have used instead of `EdgesGeometry`? – Stephan Häberle May 27 '21 at 12:43
  • `EdgesGeometry` is a good helper. But because you want a specific behavior, I would create my own shapes manually. You might be able to look at `EdgesGeometry` to see how it discovers edges, and modify it to only capture the edges you want. – TheJim01 May 27 '21 at 13:23

0 Answers0