Debian Codegraph @

examples/01-filter/reflect.py

raw
1 """
2 .. _reflect_example:
3
4 Reflect Meshes
5 ~~~~~~~~~~~~~~
6
7 This example reflects a mesh across a plane using
8 :meth:`~pyvista.DataObjectFilters.reflect`.
9
10 """
11
12 import pyvista as pv
13 from pyvista import examples
14
15 # %%
16 # This example demonstrates how to reflect a mesh across a plane.
17 #
18 # Load an example mesh:
19 airplane = examples.load_airplane()
20
21 # %%
22 # Reflect the mesh across a plane parallel to Z plane and coincident with
23 # (0, 0, -100)
24 airplane_reflected = airplane.reflect((0, 0, 1), point=(0, 0, -100))
25
26 # %%
27 # Plot the reflected mesh:
28 pl = pv.Plotter()
29 pl.add_mesh(airplane, show_edges=True)
30 pl.add_mesh(airplane_reflected, show_edges=True)
31 pl.show()
32 # %%
33 # .. tags:: filter