From 8baa831a4847f32f32dbd8612852d2bd0f949f79 Mon Sep 17 00:00:00 2001 From: Yuman Hordijk Date: Fri, 17 May 2024 12:15:15 +0200 Subject: [PATCH] You can now give material as a str --- src/tcviewer/screen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tcviewer/screen.py b/src/tcviewer/screen.py index f8e882f..7a521c1 100644 --- a/src/tcviewer/screen.py +++ b/src/tcviewer/screen.py @@ -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)