mesh.Mesh.rosette#

Mesh.rosette(n, angle=None, axis=2, around=(0.0, 0.0, 0.0), angle_spec=0.017453292519943295)#

Create rotational replications of a Mesh.

Parameters#

n: int

Number of copies to create

angle: float

Angle in between successive copies. If not provided, it is set to 360 / n.

axis: int (0,1,2) or float array_like (3,)

The rotation axis. An int speficies one of the global axes: 0 (X-axis), 1 (Y-axis) and 2 (Z-axis). Else, it is the direction vector of the axis.

around: float array_like (3,), optional

If provided, it species a point on the rotation axis. If not, the rotation axis goes through the origin of the global axes.

angle_spec: float, DEG or RAD, optional

The default (DEG) interpretes the angle in degrees. Use RAD to specify the angle in radians.

Returns#

Mesh

A Mesh with n rotational replications with given angular step. The original Mesh is the first of the n replicas.

Examples#

>>> M = Mesh(eltype='line2')
>>> print(M)
Mesh: n_nodes: 2, n_elems: 1, plexitude: 2, level: 1, eltype: line2
  BBox: [0. 0. 0.], [1. 0. 0.]
  Size: [1. 0. 0.]
  Length: 1.0
>>> M1 = M.rosette(4, angle=90.0, axis=2)
>>> print(M1.report(full=True))
Mesh: n_nodes: 5, n_elems: 4, plexitude: 2, level: 1, eltype: line2
  BBox: [-1. -1.  0.], [1. 1. 0.]
  Size: [2. 2. 0.]
  Length: 4.0
  Coords: [[ 0.  0.  0.]
           [ 1.  0.  0.]
           [ 0.  1.  0.]
           [-1.  0.  0.]
           [-0. -1.  0.]]
  Elems: [[0 1]
          [0 2]
          [0 3]
          [0 4]]