@@ -301,7 +301,7 @@ def add_design_point(self, design_point: DesignPoint, **plotting_options) -> Non
301
301
def plot_iter (
302
302
self ,
303
303
plotting_list : List [Any ],
304
- filter : str = None ,
304
+ name_filter : str = None ,
305
305
** plotting_options ,
306
306
) -> None :
307
307
"""
@@ -314,25 +314,25 @@ def plot_iter(
314
314
----------
315
315
plotting_list : List[Any]
316
316
List of objects you want to plot.
317
- filter : str, default: None
317
+ name_filter : str, default: None
318
318
Regular expression with the desired name or names you want to include in the plotter.
319
319
**plotting_options : dict, default: None
320
320
Keyword arguments. For allowable keyword arguments, see the
321
321
:meth:`Plotter.add_mesh <pyvista.Plotter.add_mesh>` method.
322
322
"""
323
323
for object in plotting_list :
324
- _ = self .plot (object , filter , ** plotting_options )
324
+ _ = self .plot (object , name_filter , ** plotting_options )
325
325
326
326
# 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 :
328
328
"""
329
329
Add a custom mesh to the plotter.
330
330
331
331
Parameters
332
332
----------
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
336
336
Regular expression with the desired name or names you want to include in the plotter.
337
337
**plotting_options : dict, default: None
338
338
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:
351
351
else :
352
352
merge_components = None
353
353
# 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 ):
367
371
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 )
369
373
else :
370
374
# 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 )
372
376
373
377
def show (
374
378
self ,
0 commit comments