def test_toon_shading(): from chemlab.db import ChemlabDB, CirDB from chemlab.io import datafile from chemlab.graphics import colors from chemlab.core.molecule import guess_bonds cdb = ChemlabDB() #mol = cdb.get('molecule', 'example.norbornene') mol = datafile('tests/data/3ZJE.pdb').read('system') v = QtViewer() #v.widget.post_processing = FXAAEffect(v.widget) #v.widget.post_processing = SSAOEffect(v.widget, kernel_size=64, kernel_radius=1.0, ssao_power=2.0) v.widget.camera.autozoom(mol.r_array) #sr = v.add_renderer(AtomRenderer, mol.r_array, # mol.type_array, 'impostors', # shading='toon') #sr = v.add_renderer(AtomRenderer, mol.r_array, # mol.type_array, 'polygons', # shading='toon') ar = v.add_renderer(BallAndStickRenderer, mol.r_array, mol.type_array, guess_bonds(mol.r_array, mol.type_array), shading='toon') v.run()
def test_toon_shading(): from chemlab.core.molecule import guess_bonds cdb = ChemlabDB() #mol = cdb.get('molecule', 'example.norbornene') mol = datafile('tests/data/3ZJE.pdb').read('system') v = QtViewer() #v.widget.post_processing = FXAAEffect(v.widget) #v.widget.post_processing = SSAOEffect(v.widget, kernel_size=64, kernel_radius=1.0, ssao_power=2.0) v.widget.camera.autozoom(mol.r_array) #sr = v.add_renderer(AtomRenderer, mol.r_array, # mol.type_array, 'impostors', # shading='toon') #sr = v.add_renderer(AtomRenderer, mol.r_array, # mol.type_array, 'polygons', # shading='toon') ar = v.add_renderer(BallAndStickRenderer, mol.r_array, mol.type_array, guess_bonds(mol.r_array, mol.type_array), shading='toon') v.run()
def test_bond_guessing(): from chemlab.core.molecule import guess_bonds from chemlab.db import ChemlabDB, CirDB from chemlab.graphics import display_molecule from chemlab.io import datafile #mol = ChemlabDB().get('molecule', 'example.norbornene') import time #mol = CirDB().get('molecule', 'caffeine') mol = datafile('tests/data/3ZJE.pdb').read('molecule') t = time.time() bonds = guess_bonds(mol.r_array, mol.type_array) print 'elapsed', time.time() - t mol.bonds = bonds display_molecule(mol)