Skip to content

Commit

Permalink
Adding Blender rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Nov 14, 2023
1 parent dc975e8 commit b358b87
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 267 deletions.
2 changes: 2 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.npy
*.jpg
*.ply
*.png
*.txt
26 changes: 26 additions & 0 deletions examples/blender_render.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pyqint import Molecule, PyQInt, FosterBoys, GeometryOptimization, HF
from pyqint import BlenderRender
import pyqint
import numpy as np
import matplotlib.pyplot as plt
import os

#
# Plot the isosurfaces for the CO molecule
#

print(pyqint.__version__)
outpath = os.path.dirname(__file__)

def main():
mol = Molecule('CO')
mol.add_atom('C', 0, 0, -1.08232106)
mol.add_atom('O', 0, 0, 1.08232106)
res = HF().rhf(mol, 'sto3g')
resfb = FosterBoys(res).run()

br = BlenderRender()
br.render_molecular_orbitals(res['mol'], res['cgfs'], resfb['orbc'], outpath)

if __name__ == '__main__':
main()
2 changes: 2 additions & 0 deletions examples/foster_boys.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def optimize_co():

res = GeometryOptimization().run(mol, 'sto3g')

print(res['data']['nuclei'])

return res['data']

def build_contourplot(cgfs, coeff, sz=2, npts=50, plane='xy'):
Expand Down
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: "pyqint"
version: "0.13.1.0"
version: "0.14.0.0"

source:
path: .
Expand Down
2 changes: 1 addition & 1 deletion pyqint/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.13.1.0"
__version__ = "0.14.0.0"

3 changes: 3 additions & 0 deletions pyqint/blender/blender_render_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ def set_environment(settings):
Specify canvas size, remove default objects, reset positions of
camera and light, define film and set background
"""
print('Set render engine to: CYCLES')
bpy.context.scene.render.engine = 'CYCLES'
print('Set rendering device to GPU')
bpy.context.scene.cycles.device = 'GPU'
bpy.context.scene.render.resolution_x = settings['resolution']
bpy.context.scene.render.resolution_y = settings['resolution']
print('Setting resolution to: ', settings['resolution'])
bpy.context.scene.cycles.samples = 1024
bpy.context.scene.cycles.tile_size = 2048

Expand Down
245 changes: 0 additions & 245 deletions pyqint/blender/blender_render_molecules.py

This file was deleted.

Loading

0 comments on commit b358b87

Please sign in to comment.