File: reflect.py

package info (click to toggle)
python-pyvista 0.44.1-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 159,804 kB
  • sloc: python: 72,164; sh: 118; makefile: 68
file content (32 lines) | stat: -rw-r--r-- 636 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
"""
.. _reflect_example:

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

This example reflects a mesh across a plane.

"""

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()