@@ -583,7 +583,8 @@ def _assign_colors(self):
583583 for key in self .stl_solids :
584584 mat = self .stl_materials [key ]
585585 if type (mat ) is str :
586- self .stl_colors [key ] = mat
586+ _color = material_colors .get (mat , material_colors ['other' ])
587+ self .stl_colors [key ] = _color
587588 elif len (mat ) == 2 :
588589 if mat [0 ] is np .inf : #eps_r
589590 self .stl_colors [key ] = material_colors ['pec' ]
@@ -615,7 +616,7 @@ def _add_logo_widget(self, pl):
615616
616617 def plot_solids (self , bounding_box = False , show_grid = False , anti_aliasing = None ,
617618 opacity = 1.0 , specular = 0.5 , smooth_shading = False ,
618- offscreen = False , ** kwargs ):
619+ off_screen = False , ** kwargs ):
619620 """
620621 Generates a 3D visualization of the imported STL geometries using PyVista.
621622
@@ -678,15 +679,15 @@ def plot_solids(self, bounding_box=False, show_grid=False, anti_aliasing=None,
678679 if show_grid :
679680 pl .add_mesh (self .grid , style = 'wireframe' , color = 'grey' , opacity = 0.3 , name = 'grid' )
680681
681- if offscreen :
682+ if off_screen :
682683 pl .export_html ('grid_plot_solids.html' )
683684 else :
684685 pl .show ()
685686
686687 def plot_stl_mask (self , stl_solid , cmap = 'viridis' , bounding_box = True , show_grid = True ,
687688 add_stl = 'all' , stl_opacity = 0. , stl_colors = None ,
688689 xmax = None , ymax = None , zmax = None ,
689- anti_aliasing = 'ssaa' , smooth_shading = False , offscreen = False ):
690+ anti_aliasing = 'ssaa' , smooth_shading = False , off_screen = False ):
690691
691692 """
692693 Interactive 3D visualization of the structured grid mask and imported STL geometries.
@@ -728,8 +729,8 @@ def plot_stl_mask(self, stl_solid, cmap='viridis', bounding_box=True, show_grid=
728729 maximum domain extent.
729730 anti_aliasing : {'ssaa', 'fxaa', None}, default 'ssaa'
730731 Anti-aliasing mode passed to `pl.enable_anti_aliasing`.
731- offscreen : bool, default False
732- If True, render offscreen and export the scene to
732+ off_screen : bool, default False
733+ If True, render off-screen and export the scene to
733734 ``grid_stl_mask_<stl_solid>.html``. If False, open an interactive window.
734735
735736 Notes
@@ -848,13 +849,13 @@ def update_clip(val, axis="x"):
848849 pl .add_mesh (pv .Box (bounds = (self .xmin , self .xmax , self .ymin , self .ymax , self .zmin , self .zmax )),
849850 style = "wireframe" , color = "black" , line_width = 2 , name = "domain_box" )
850851
851- if offscreen :
852+ if off_screen :
852853 pl .export_html (f'grid_stl_mask_{ stl_solid } .html' )
853854 else :
854855 pl .show ()
855856
856857 def inspect (self , add_stl = None , stl_opacity = 0.5 , stl_colors = None ,
857- anti_aliasing = 'ssaa' , smooth_shading = True , offscreen = False ):
858+ anti_aliasing = 'ssaa' , smooth_shading = True , off_screen = False ):
858859
859860 '''3D plot using pyvista to visualize
860861 the structured grid and
@@ -927,7 +928,7 @@ def clip(widget):
927928 pl .enable_3_lights ()
928929 pl .enable_anti_aliasing (anti_aliasing )
929930
930- if offscreen :
931+ if off_screen :
931932 pl .export_html ('grid_inspect.html' )
932933 else :
933934 pl .show ()
0 commit comments