mesh.Mesh.offset#
- Mesh.offset(distance=1.0)#
Offset a tri3 Mesh with a certain distance.
Parameters#
- distance: float
Distance over which the points should be moved.
Returns#
- Mesh
A Mesh (eltype = “tri3”) obtained by moving each node of the input Mesh along the averaged normal vector at that node, by the specified distance. The averaged normal at a node is computed from the normals of all elements that node belongs to.
Examples#
>>> coords = Coords([[0.0, 0.0, 0.0], ... [1.0, 0.0, 0.1], ... [1.0, 1.0, 0.0], ... [0.0, 1.0, 0.1]]) >>> M = Mesh(coords,[[0,1,2],[2,3,0]],eltype='tri3') >>> M1 = M.offset(distance=1.0) >>> print(M1.coords) [[0. 0. 1. ] [0.901 0.099 1.0901] [1. 1. 1. ] [0.099 0.901 1.0901]]