Using Fat lines for edges

line
lines
meshlines
#1

Is it possible to use the fat lines in conjunctions with the edgesgeometry?

my previous (working) code is like this…

let edges = new THREE.EdgesGeometry(mesh.geometry, angleThreshold);
let material = new THREE.LineBasicMaterial({ color: 0x000000 });
let lines = new THREE.LineSegments(edges,material ));
   mesh.add(lines); 

And i tried the following, but I just get a complete mess:

let edges = new THREE.EdgesGeometry(mesh.geometry, angleThreshold);
let material =  new THREE.LineMaterial({ color: 0x000000, width:1 })
let lines = new THREE.LineSegments(edges, material);
   mesh.add(lines); 

hrees the result, notice the random massive lines all over

I feel like i must be missing something really obvious?

#2

No, since THREE.LineMaterial expects a special instanced geometry. THREE.EdgesGeometry only produces a THREE.BufferGeometry without the respective instanced data.

#3

Thanks for the (extremely!) quick confirmation.

I assume that then means there is no way for me to get thicker edges for my meshes?

Once again, I appreciate your help.

#4

You can try to use THREE.LineSegmentsGeometry.fromEdgesGeometry() and then pass the resulting geometry to THREE.LineSegments.

let edges = new THREE.EdgesGeometry(mesh.geometry, angleThreshold);
let geometry = new THREE.LineSegmentsGeometry().fromEdgesGeometry( edges );
let material =  new THREE.LineMaterial({ color: 0x000000, width:1 })
let lines = new THREE.LineSegments(geometry, material);
mesh.add(lines); 
2 Likes
#5

thanks for the suggestion, unfortunately I get this which is not what I was expecting at all!!!

#6

Can you please share a live example with your code?

#7

Well its part of a large app which has a lot occurring , so easier said than done, however I can try to strip out some code and get it online, though I suspect for a proper test I would need to load my models in (rather than simple THREE geometry) which I’m not sure how to do if hosted online. I shall attempt using some of the three examples and my models and update the results here in case it’s of interest to anyone.

Many thanks