pysdic.create_2d_triangle_3_polar#

create_2d_triangle_3_polar(*, r_bounds=None, t_bounds=None, r_array=None, t_array=None, n_r=None, n_t=None, direct=True, close=False, stick=False, stick_eps=1e-06, diagonal='first', seed=None, uv_layout=0)[source]#

Create a 2D triangle_3 mesh (\(E = 2\)) of a polar grid: an annulus, a disk or a sector.

The quadrangle_4 polar grid (see pysdic.create_2d_quadrangle_4_polar()) is split into triangles with pysdic.quadrangle_4_to_triangle_3().

If stick is True, the vertices at the center (radius lower than stick_eps) are merged into a single vertex at the origin. The triangles that become degenerated are removed, and the unused vertices too, so the indexing of the vertices of the polar grid is no longer valid. Use it for a disk (r_bounds=(0, R)) or a sector of a disk.

See also

pysdic.create_3d_triangle_3_cylindrical() for a 3D cylindrical surface.

Parameters:
Returns:

The 2D triangle_3 mesh, with a UV map.

Return type:

pysdic.Mesh

Examples

A closed unit disk.

1import numpy
2from pysdic import create_2d_triangle_3_polar
3
4n_t = 24
5mesh = create_2d_triangle_3_polar(
6    r_bounds=(0, 1), n_r=5, t_bounds=(0, 2 * numpy.pi * (1 - 1 / n_t)), n_t=n_t,
7    close=True, stick=True,
8)
9print(mesh.n_vertices, mesh.n_elements)  # 97 168