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?
No, since THREE.LineMaterial expects a special instanced geometry. THREE.EdgesGeometry only produces a THREE.BufferGeometry without the respective instanced data.
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);
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.
Hey @Mugen87, I tried your suggestion but the lines seemed to go all over the place.
I could not get the live example working because I could not figure out how to import the classes from the examples directory. However, I have extracted the code produces the mesh in question and included it below the image.
Basically trying add lines to the edges but just thicker.