Skip to content

Commit

Permalink
You can now give material as a str
Browse files Browse the repository at this point in the history
  • Loading branch information
YHordijk committed May 17, 2024
1 parent a6e1259 commit 8baa831
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tcviewer/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ def draw_orbital(self, orb, gridd=None, isovalue=0.03, color1=[0, 0, 1], color2=
# and draw the isosurface with phase
self.draw_isosurface(gridd, isovalue=isovalue, color=[color1, color2], material=material, with_phase=True)

def draw_cub(self, cub: grid.Grid or str, isovalue=0.03, color1=[0, 0, 1], color2=[1, 0, 0], material=materials.orbital_shiny):
def draw_cub(self, cub: grid.Grid or str, isovalue=0.03, color1=[0, 0, 1], color2=[1, 0, 0], material='shiny'):
if isinstance(cub, str):
cub = grid.from_cub_file(cub)
if isinstance(material, str):
material = materials.orbital_material(material)
self.draw_molecule(cub.molecule)
self.draw_isosurface(cub, isovalue=isovalue, color=[color1, color2], material=material, with_phase=True)

Expand Down

0 comments on commit 8baa831

Please sign in to comment.