OpenChemistry / avogadrolibs

Avogadro libraries provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
https://two.avogadro.cc/
BSD 3-Clause "New" or "Revised" License
466 stars 174 forks source link

Molecular orbital rendering with Flying Edges is incorrect (negative mesh) #1827

Open ghutchis opened 4 hours ago

ghutchis commented 4 hours ago

Here's a rendering of the LUMO for benzene (file is attached - unzip to get benzene.fchk):

Screenshot 2024-11-28 at 7 20 43 PM

With the current code, I get a very different look:

Screenshot 2024-11-28 at 7 22 43 PM

The problem is with the mesh for the negative isosurface (it's the mesh2 in the code). The code sets m_reverseWinding and inverts the iso value (i.e., not 0.03 but -0.03)

For example, the triangles are a bit weird too:

Screenshot 2024-11-28 at 7 28 06 PM

benzene.fchk.zip

ghutchis commented 4 hours ago

@perminder-17 - any thoughts on this? It seems as if the Flying Edges is gluing together the two parts of the mesh even though the isovalues are very small.