mesh.Mesh.reflect#

Mesh.reflect(dir=0, pos=0.0, reverse=True)#

Reflect the coordinates in one of the coordinate directions.

This applies the reflect() transformation on the coords of the Mesh, and then by default does a reversal of the elements.

Parameters#

dir: int (0,1,2)

Global axis direction of the reflection: 0 (X-axis), 1 (Y-axis) and 2 (Z-axis). Default is 0 or X-axis.

pos: float

Offset of the mirror plane from origin (default 0.0)

reverse: bool, optional

If True (default), the reverse() method is called after the reflection to undo the element reversal caused by the reflection of its coordinates. This has in most cases the desired effect. If not, the user can set this to False to skip the element reversal.

Examples#

>>> M = Mesh(eltype='line2')
>>> print(M.coords)
[[0. 0. 0.]
 [1. 0. 0.]]
>>> M1 = M.reflect(dir=0)
>>> print(M1.coords)
[[ 0. 0. 0.]
 [-1. 0. 0.]]