@@ -301,7 +301,7 @@ def add_design_point(self, design_point: DesignPoint, **plotting_options) -> Non
301301 def plot_iter (
302302 self ,
303303 plotting_list : List [Any ],
304- filter : str = None ,
304+ name_filter : str = None ,
305305 ** plotting_options ,
306306 ) -> None :
307307 """
@@ -314,25 +314,25 @@ def plot_iter(
314314 ----------
315315 plotting_list : List[Any]
316316 List of objects you want to plot.
317- filter : str, default: None
317+ name_filter : str, default: None
318318 Regular expression with the desired name or names you want to include in the plotter.
319319 **plotting_options : dict, default: None
320320 Keyword arguments. For allowable keyword arguments, see the
321321 :meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
322322 """
323323 for object in plotting_list :
324- _ = self .plot (object , filter , ** plotting_options )
324+ _ = self .plot (object , name_filter , ** plotting_options )
325325
326326 # Override add function from plotter
327- def plot (self , object : Any , filter : str = None , ** plotting_options ) -> None :
327+ def plot (self , plottable_object : Any , name_filter : str = None , ** plotting_options ) -> None :
328328 """
329329 Add a custom mesh to the plotter.
330330
331331 Parameters
332332 ----------
333- object : Any
334- Object to add .
335- filter : str, default: None
333+ plottable_object : str, default: None
334+ Regular expression with the desired name or names you want to include in the plotter .
335+ name_filter : str, default: None
336336 Regular expression with the desired name or names you want to include in the plotter.
337337 **plotting_options : dict, default: None
338338 Keyword arguments. For allowable keyword arguments, depend of the backend implementation
@@ -351,24 +351,28 @@ def plot(self, object: Any, filter: str = None, **plotting_options) -> None:
351351 else :
352352 merge_components = None
353353 # Add the custom object to the plotter
354- if isinstance (object , DesignPoint ):
355- self .add_design_point (object , ** plotting_options )
356- elif isinstance (object , Sketch ):
357- self .add_sketch (object , ** plotting_options )
358- elif isinstance (object , Body ) or isinstance (object , MasterBody ):
359- self .add_body (object , merge_bodies , ** plotting_options )
360- elif isinstance (object , Design ) or isinstance (object , Component ):
361- self .add_component (object , merge_components , merge_bodies , ** plotting_options )
362- elif isinstance (object , List ) and object != [] and isinstance (object [0 ], pv .PolyData ):
363- self .add_sketch_polydata (object , ** plotting_options )
364- elif isinstance (object , List ):
365- self .plot_iter (object , filter , ** plotting_options )
366- elif isinstance (object , MeshObjectPlot ):
354+ if isinstance (plottable_object , DesignPoint ):
355+ self .add_design_point (plottable_object , ** plotting_options )
356+ elif isinstance (plottable_object , Sketch ):
357+ self .add_sketch (plottable_object , ** plotting_options )
358+ elif isinstance (plottable_object , Body ) or isinstance (object , MasterBody ):
359+ self .add_body (plottable_object , merge_bodies , ** plotting_options )
360+ elif isinstance (plottable_object , Design ) or isinstance (object , Component ):
361+ self .add_component (plottable_object , merge_components , merge_bodies , ** plotting_options )
362+ elif (
363+ isinstance (plottable_object , List )
364+ and plottable_object != []
365+ and isinstance (plottable_object [0 ], pv .PolyData )
366+ ):
367+ self .add_sketch_polydata (plottable_object , ** plotting_options )
368+ elif isinstance (plottable_object , List ):
369+ self .plot_iter (plottable_object , name_filter , ** plotting_options )
370+ elif isinstance (plottable_object , MeshObjectPlot ):
367371 self ._backend .pv_interface .set_add_mesh_defaults (plotting_options )
368- self ._backend .pv_interface .plot (object , filter , ** plotting_options )
372+ self ._backend .pv_interface .plot (plottable_object , name_filter , ** plotting_options )
369373 else :
370374 # any left type should be a PyVista object
371- self ._backend .pv_interface .plot (object , filter , ** plotting_options )
375+ self ._backend .pv_interface .plot (plottable_object , name_filter , ** plotting_options )
372376
373377 def show (
374378 self ,
0 commit comments