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_3mesh (\(E = 2\)) of a polar grid: an annulus, a disk or a sector.The
quadrangle_4polar grid (seepysdic.create_2d_quadrangle_4_polar()) is split into triangles withpysdic.quadrangle_4_to_triangle_3().If
stickis True, the vertices at the center (radius lower thanstick_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:
r_bounds (Tuple[Real, Real] | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.t_bounds (Tuple[Real, Real] | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.r_array (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.t_array (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.n_r (Integral | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.n_t (Integral | None) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.direct (bool) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.close (bool) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.uv_layout (Integral) – See
pysdic.create_2d_quadrangle_4_polar(). Here, the radius \(r = 0\) is accepted.stick (bool, optional (default:
False)) – If True, the vertices at the center are merged (see above).stick_eps (Real, optional (default:
1e-6)) – The radius below which a vertex is at the center (non-negative).diagonal (str, optional (default:
"first")) – The diagonal used to split the quadrangles:"first","second","alternate"or"random".seed (Optional[Union[Integral, numpy.random.Generator]], optional (default:
None)) – The seed ofdiagonal="random".
- Returns:
The 2D
triangle_3mesh, with a UV map.- Return type:
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