EdgesGeometry draws unwanted lines between holes

I’m using Three.js with React Three Fiber and running into an issue with EdgesGeometry. When I extrude a shape (from an SVG via Maker.js + SVGLoader.createShapes()), EdgesGeometry draws unwanted lines between holes, as if it’s connecting them.

Things I’ve tried:

  • Using path.toShapes(true)
  • Flipping winding with ShapeUtils.isClockWise() + shape.reverse()
  • Adjusting thresholdAngle on EdgesGeometry

All holes render correctly in the mesh itself, it’s just the edges that are wrong.

Happy to share a minimal React Three Fiber repro if needed!

Thanks

I believe the root cause for this issue is explained here:

Does applying a .mergeVertices( ) fix it?

mesh.geometry = BufferGeometryUtils.mergeVertices(mesh.geometry);

If not, it’s probably generating T-junctions which maaay be addressed by EdgesGeometry2(?) referenced in the thread mugen linked?