mesh.Mesh.reverse#
- Mesh.reverse(sel=None, inplace=False)#
Reverse some or all elements of a Mesh.
Reversing an element has the following meaning:
for 1D elements: reverse the traversal direction,
for 2D elements: reverse the direction of the positive normal,
for 3D elements: reverse inside and outside directions of the element’s border surface. This also changes the sign of the element’s volume.
Parameters#
- sel: int or boolean array_like, optional
The selected elements to be reversed. Default is to reverse all elements.
Returns#
- Mesh
A Mesh like the input but with the specified elements reversed.
Notes#
The
reflect()method by default calls this method to undo the element reversal caused by the reflection operation.Examples#
>>> M = Mesh(eltype='tri3') >>> print(M.elems) [[0 1 2]] >>> M1 = M.reverse() >>> print(M1.elems) [[2 1 0]] >>> print(M.elems) [[0 1 2]] >>> print(M.reverse(inplace=True).elems) [[2 1 0]]