Slow WireframeGeometry creation

Hello,

I create a wireframe mesh that gets overlayed on top of the 3D mesh (see image below).

image

The cost of creating the WireframeGeometry seems quite high, with virtually all the time spent in WireframeGeometry.isUniqueEdge(). It’s significantly slower than creating the 3D mesh itself:

image

Does anyone know whether there is a faster way to create a wireframe overlayed on top of a mesh?

Thanks

@kermado

WireframeGeometry eliminates duplicated edges, so you cannot avoid .isUniqueEdges. As an alternative, have you tried to use the .wireframe property of your original mesh material?

– Pavel

Thanks. This is indeed much more efficient.

1 Like