.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_generated/gallery/render_povray_isosurface.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_generated_gallery_render_povray_isosurface.py: Isosurface with povray ====================== .. GENERATED FROM PYTHON SOURCE LINES 9-10 Render an isosurface and atoms with povray .. GENERATED FROM PYTHON SOURCE LINES 10-49 .. code-block:: Python import numpy as np from ase.build import bulk from ase.io import write density_cut_off = 0.15 rotation = '24x, 34y, 14z' atoms = bulk('Au', cubic=True) * (2, 2, 2) axis = np.linspace(-1, 1, 100) X, Y, Z = np.meshgrid(axis, axis, axis) isodata = np.exp(-0.5 * (X**2 + 2 * Y**2 + 3 * Z**2)) povray_settings = { 'pause': False, # Pause when done rendering (only if display) 'transparent': False, # Transparent background 'canvas_width': None, # Width of canvas in pixels 'canvas_height': 1024, # Height of canvas in pixels 'camera_dist': 25.0, # Distance from camera to front atom 'camera_type': 'orthographic angle 35', # 'perspective angle 20' 'textures': len(atoms) * ['ase3'], } generic_projection_settings = { 'rotation': rotation, 'radii': atoms.positions.shape[0] * [0.3], 'show_unit_cell': 1, } write( 'isosurface.pov', atoms, **generic_projection_settings, povray_settings=povray_settings, isosurface_data=dict(density_grid=isodata, cut_off=density_cut_off), ).render() .. image-sg:: /examples_generated/gallery/images/sphx_glr_render_povray_isosurface_001.png :alt: render povray isosurface :srcset: /examples_generated/gallery/images/sphx_glr_render_povray_isosurface_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none PosixPath('/builds/ase/ase-deploy/examples/gallery/isosurface.png') .. _sphx_glr_download_examples_generated_gallery_render_povray_isosurface.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: render_povray_isosurface.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: render_povray_isosurface.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: render_povray_isosurface.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_