Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PovRay Mesh Colors / Transparency Not Exported Correctly #1179

Closed
maciekofficial opened this issue Sep 30, 2022 · 7 comments · Fixed by #1300
Closed

PovRay Mesh Colors / Transparency Not Exported Correctly #1179

maciekofficial opened this issue Sep 30, 2022 · 7 comments · Fixed by #1300

Comments

@maciekofficial
Copy link

In Avogadro 1.2 one can export PovRay file to generate high resolution image. In Avogadro 1.97 the feature is there in File->Export->Molecule, but it exports only molecule without mesh/surface. It would be great to export molecule along with the surface.

@ghutchis
Copy link
Member

ghutchis commented Oct 1, 2022

That was a bit weird - it actually computed the mesh, but didn't write it to the file. Check out #1180 - but if you have an example file or two, it would help a lot. Not sure this is exactly correct.

@maciekofficial
Copy link
Author

First, sorry for delayed answer...

I did some small testing on Kubuntu 20.04.5 LTS with Avogadro 1.93.0 (from the Ubuntu repository), 1.97.0 and 1.97.0_Nightly, both in AppImage format. I used a small cube file with spin density generated in ORCA 5.0.3 (oSQ_spindens.cube.zip).

The cube file opens well in all tested versions and mesh can be generated.

The command used in testing for rendering with PovRay was:
povray +Iname.pov +Oname.png +W1024 +H768 +V +D +FN +Q9 +P +UD +UL +UV +A +AM2 +UA

In Avogadro 1.93.0 in menu File->Export there is an option "PovRay Render". It exports *.pov files, however they do not include the mesh that has been calculated and displayed. The pov and rendered png files are given as avogadro_1.93.0.zip

In Avogadro 1.97.0 and 1.97.0_Nightly the option "PovRay Render" is not available in File->Export. I exported the pov file using File->Export->Molecule. This option generates pov files using Open Babel and thus file babel_povray3.inc is required for PovRay rendering. The data for mesh rendering are not included in the pov file and final molecule result is significantly different from what is displayed in Avogadro (different style). Results are enclosed as avogadro_1.97.0_Nightly.zip and avogadro_1.97.0.zip. The file babel_povray3.inc used in rendering is also attached.
In Avogadro 1.93.0 File->Export->Molecule can also be used but to the same end.

Hope this will be somewhat helpful.

If there is any more testing that I can do, please let me know.

With best of regards,
Maciek

oSQ_spindens.cube.zip
avogadro_1.93.0.zip
avogadro_1.97.0.zip
avogadro_1.97.0_Nightly.zip
babel_povray3.inc.zip

@ghutchis
Copy link
Member

ghutchis commented Oct 6, 2022

Can you send me a screenshot of your File => Export submenu? I don't know how it wouldn't show up...

Screen Shot 2022-10-06 at 11 58 30 AM

The build at #1180 would have mesh support .. at the very least I can see that it writes out the mesh data and it seems comparable to Avogadro 1.x.

Obviously 1.93 and 1.97 wouldn't have mesh support because it's only in the #1180 branch for now.

And no, export to Open Babel would not include the mesh because Open Babel doesn't have a concept of a mesh - it's a cheminformatics library.

Did you try the AppImage from #1180?

@maciekofficial
Copy link
Author

Using the AppImage from #1180, I think I've found the source of the problem. When user interface language is set to American English, the sub menu File => Export shows up as it should:
En_US

I had interface set to British English (exported from system language) and then some options from this sub menu were missing:
En_GB

The problem exists for Canadian and Australian English, polski/Polish, espanol de Espana/Spanish, but not for Deutsch/German, and it also affects the Win64 version.

The build at #1180 exports mesh to a pov file, however it seems that in the process:

  • mesh transparency is set to 100%, so the mesh doesn't show up in rendering and this happens regardless of "Opacity" slider setting in View Configuration
    Opacity
  • colors for the positive and negative parts of the mesh are the same

Both can be fixed in the pov file. Just in case, I am sending the original and corrected pov file (pov_files.zip). I changed line 21105 and line 82134

line 21105:	pigment { rgbt <1.0, 0.0, 0.0, 0.0> }  // WAS: pigment { rgbt <1.0, 0.0, 0.0, 1.0> }
line 82134:	pigment { rgbt <1.0, 0.0, 0.0, 0.0> }  // WAS: pigment { rgbt <1.0, 0.0, 0.0, 1.0> }

Render results:
povray +Iname.pov +Oname.png +W1024 +H768 +V +D +FN +Q9 +P +UD +UL +UV +A +AM2 +UA

  1. Pov file as exported from Avogadro2
    original

  2. Fixed transparency in line 21105
    fixed_transparency_21105

  3. Fixed transparency and color in line 82134:
    fixed_transparency_and_color_82134

ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue May 10, 2023
…of MO

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue May 10, 2023
…of MO

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis ghutchis changed the title PovRay PovRay Mesh Colors / Transparency Not Exported Correctly May 10, 2023
ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue May 10, 2023
…of MO

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@github-actions
Copy link
Contributor

Here are the build results
Avogadro2.AppImage
macOS.dmg
Ubuntu-Latest.tar.gz
Win64.exe
Artifacts will only be retained for 90 days.

@github-actions
Copy link
Contributor

Here are the build results
macOS.dmg
Ubuntu-Latest.tar.gz
Win64.exe
Artifacts will only be retained for 90 days.

ghutchis added a commit that referenced this issue May 11, 2023
Fix #1179 (finally) setting the colors and transparency of MO
@github-actions
Copy link
Contributor

Here are the build results
Avogadro2.AppImage
Ubuntu-Latest.tar.gz
Win64.exe
Artifacts will only be retained for 90 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants