question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WireframeGeometry generates duplicate edges

See original GitHub issue

WireframeGeometry generates duplicate edges for both indexed and non-indexed buffer geometry.

This is true by inspection, as the code does not test for duplicate xyz-coordinates.

A simple non-indexed example is:

const geometry = new THREE.TetrahedronGeometry( 1, 0 ); // 6 unique edges

const wireframe = new THREE.WireframeGeometry( geometry ); // 12 edges

BoxGeometry( 1, 1, 1 ) is a simple indexed example.

Duplicating an edge is not a problem most of the time, but when using dashed lines, it is a problem.


EDIT: Actually, instead of “duplicate edges”, they should be referred to as “coincident edges”: A -> B = B -> A.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
WestLangleycommented, Jul 6, 2021

@Mugen87 Thanks for looking at this.

EdgesGeometry appears to work correctly. It uses a hardwired precision value and compares vertex coordinates.

TBH, I was surprised a threshold is used at all. In a well-formed geometry, there may be repeated vertices, but if the coordinates are not exactly equal, then, well, they are not repeat values.

1reaction
Mugen87commented, Jul 6, 2021

but when using dashed lines, it is a problem.

Indeed, that does not look right: https://jsfiddle.net/dhq9zrx8/2/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Three.JS wireframe material - all polygons vs. just edges
WireframeGeometry will render all edges. EdgesGeometry will render the hard edges only. Also see this related answer on how to render both a ......
Read more >
events firing multiple times when adding LineSegments ...
I need a wireframe that highlights every edge of a model, but couldn't find a helper for that. Beta Was this translation helpful?...
Read more >
Curve All Edges flattens wireframe geometry - eMastercam.com
Hello - I am running Mastercam 2018. I imported a model, it was an iges file. I could not select on any edges...
Read more >
AutoCAD LT 2023 Help | About Creating 3D Wireframe Models
Note: You can use the XEDGES command to create wireframe geometry from regions, 3D solids, surfaces, and meshes. The extracted edges form a...
Read more >
Chapter 6 - TherealChrisReillyAviationPortfolioMaybe
The procedure to create a copy of sketched 2d wireframe geometry is first select ... Select an edge of the face, move the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found