natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
64 stars 29 forks source link

nat::wire3d is plotting polygons when there should only be triangles - not a problem with rgl::wire3d #511

Open Jsalas424 opened 1 year ago

Jsalas424 commented 1 year ago

Hello,

I am using wire3d to plot a mesh3d object with the plotly backend. I noticed that there are polygons on my mesh. The data is only triangles and when I check with RGL, I also only see triangles:

RGL:

rgl::wire3d(mesh)
image

nat:

options(nat.plotengine = 'plotly')
wire3d(mesh,
       add = FALSE
)
image

What I do notice is that I scroll around the RGL plot, sometimes vertices seem to disappear and it looks like a polygon exists where there isn't one due to the lighting effects.

Mesh Code: https://pastebin.com/raw/xmUtHhtt