# Openbabel: Generate 3D depiction?

The process of creating 2D depictions is explained in detail here. This way, it is possible to create a 2D image via running e.g.

obabel -O 2d_depiction.png

However, how do I generate a ball and stick 3d depiction (as image) instead?

• Try: obabel -L pov – vapid Oct 26 '16 at 13:55
• By the way, there is a specific Open Babel forum to ask such questions.. – Geoff Hutchison Oct 26 '16 at 16:04

Open Babel does not generate "ball and stick 3D depictions" directly, because it's not a molecular visualization program.

There are a few formats supported in Open Babel to write out 3D depictions, e.g.:

But you can make a pseudo-3D "ball and stick" depiction in the SVG format:

obabel [file] -O file.svg -xS

• Personally, I'd recommend using a visualization software to make sure I get the view angle set the way I want. The only reason we added the -xS option was to generate previews for 100,000 molecules in PQR search results. – Geoff Hutchison Oct 26 '16 at 16:02
• Nice answer, thanks : ) Yeah, I know that automatic 3D structure depiction will most often lead to a bad view angle. But I just need them for quick evaluation of MD results and I am planning to integrate the visualization into the IPython notebook. – logical x 2 Oct 26 '16 at 16:16
• If you're integrating into iPython, you might also want to look at 3DMol.js which will give you interactive JavaScript views. e.g. py3Dmol – Geoff Hutchison Oct 26 '16 at 16:48
• 3DMol.js how could I overlook that, and I looked for molecular graphics packages a lot. If I could I would up vote two times for that comment : ) – logical x 2 Oct 28 '16 at 22:16
• I just tried it and managed to get py3Dmol running in like 2 min. $-$ interactive molecule visualization in the IPython notebook made easy : ) – logical x 2 Oct 28 '16 at 22:23