forked from FlorianRhiem/mogli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved code style and PEP8 conformance (examples)
- Loading branch information
1 parent
23ecb61
commit d683755
Showing
3 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
""" | ||
Example for drawing a molecule using mogli and GR | ||
""" | ||
import gr | ||
import mogli | ||
|
||
molecules = mogli.read('examples/dna.xyz') | ||
gr.clearws() | ||
gr.setviewport(0, 1, 0, 1) | ||
mogli.draw(molecules[0], bonds_param=1.15, camera=((60, 0, 0), | ||
(0, 0, 0), | ||
(0, 1, 0))) | ||
(0, 0, 0), | ||
(0, 1, 0))) | ||
gr.settextalign(gr.TEXT_HALIGN_CENTER, gr.TEXT_VALIGN_TOP) | ||
gr.text(0.5, 1.0, 'DNA example') | ||
gr.updatews() | ||
gr.updatews() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
""" | ||
Example for exporting a molecule to an HTML5 file using mogli | ||
""" | ||
import mogli | ||
|
||
molecules = mogli.read('examples/dna.xyz') | ||
mogli.BOND_RADIUS = 0.05 | ||
mogli.export(molecules[0], 'dna.html', width=1920, height=1080, | ||
bonds_param=1.15, camera=((40, 0, 0), | ||
(0, 0, 0), | ||
(0, 1, 0))) | ||
(0, 1, 0))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
""" | ||
Example for interactively displaying a molecule using mogli | ||
""" | ||
import mogli | ||
|
||
molecules = mogli.read('examples/dna.xyz') | ||
for molecule in molecules: | ||
mogli.show(molecule, bonds_param=1.15) | ||
mogli.show(molecule, bonds_param=1.15) |