File: reflect.py

package info (click to toggle)
python-pyvista 0.46.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 176,968 kB
  • sloc: python: 94,346; sh: 216; makefile: 70
file content (35 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
.. _reflect_example:

Reflect Meshes
~~~~~~~~~~~~~~

This example reflects a mesh across a plane using
:meth:`~pyvista.DataObjectFilters.reflect`.

"""

from __future__ import annotations

import pyvista
from pyvista import examples

# %%
# This example demonstrates how to reflect a mesh across a plane.
#
# Load an example mesh:
airplane = examples.load_airplane()

# %%
# Reflect the mesh across a plane parallel to Z plane and coincident with
# (0, 0, -100)
airplane_reflected = airplane.reflect((0, 0, 1), point=(0, 0, -100))

# %%
# Plot the reflected mesh:
p = pyvista.Plotter()
p.add_mesh(airplane, show_edges=True)
p.add_mesh(airplane_reflected, show_edges=True)
p.show()
# %%
# .. tags:: filter