Class xlifepp::subdivision::SurfMeshTriSphere#
-
class SurfMeshTriSphere : public xlifepp::subdivision::TriangleMesh#
-
Inheritence diagram for xlifepp::subdivision::SurfMeshTriSphere:
Collaboration diagram for xlifepp::subdivision::SurfMeshTriSphere:
Public Functions
-
SurfMeshTriSphere(const std::vector<std::pair<real_t, dimen_t>> &rots, const int nboctants, const number_t nbsubdiv = 0, const number_t order = 1, const number_t type = 1, const real_t radius = 1., const Point Center = Point(0, 0, 0), const number_t minVertexNum = 1, const number_t minElementNum = 1)#
-
main constructor
Build a mesh of triangles by successive subdivisions over the surface of a sphere.
- Parameters:
-
rots – rotations to be applied to the sphere to get its final position. Each rotation, if any, is defined by an angle in degrees and the number of the absolute axis (1, 2 or 3) around which the rotation is made. Each rotation is applied in turn to the sphere starting from the canonical initial position where the sphere is centered at the origin and its local axes are parallel to the absolute axes.
nboctants – number of octants to be filled nboctants may take a value in [0, 8]. If nboctants=0, a mesh of the whole sphere is computed starting from an icosahedron, which leads to a less structured mesh than the one obtained with nboctants=8. For the half-sphere (4 octants) and the sphere (8 octants), when a spherical subdivision is requested (argument type different from 0, see below), the initial mesh may consist of one single triangle instead of respectively 4 and 8 triangles, which reduces the number of triangles of the final mesh by a factor 4 and 8 respectively. In order to activate this behaviour, nboctants must take the value -4 and -8 respectively.
nbsubdiv – subdivision level (0 by default) nbsubdiv = 0 corresponds to the initial mesh. For nbsubdiv > 0, each triangle is subdivided into 4 triangles with the same orientation as the original one: if the first triangle is (1,2,3), the vectors 12x13 define the exterior normal to the face.
order – order of the triangles in the final mesh (1 by default) The default value is 1, which leads to a P1 mesh, in which case each triangle is defined by its 3 vertices. For higher orders, the supplemental vertices correspond to the regular Lagrange mesh. Moreover, if the second argument (type) is non 0, these vertices lie on the sphere. See below the two possible ways to compute these vertices.
type – type of the subdivision (1 by default) . if type = 0, the algorithm leads to a simple (flat) subdivision of the initial mesh where new vertices are all the midpoints of the edges. . if type = 1, the algorithm leads to a subdivision where the vertices belonging to a prescribed boundary are computed so that they lie on the sphere ; they are computed as the radial projections of the vertices of the Lagrange mesh of order k over the triangular chord face.
radius – radius of the sphere (1. by default)
Center – center of the sphere ((0,0,0) by default)
minVertexNum – minimum number associated to the vertices of the mesh (1 by default)
minElementNum – minimum number associated to the elements of the mesh (1 by default)
-
SurfMeshTriSphere(const std::vector<std::pair<real_t, dimen_t>> &rots, const int nboctants, const number_t nbsubdiv = 0, const number_t order = 1, const number_t type = 1, const real_t radius = 1., const Point Center = Point(0, 0, 0), const number_t minVertexNum = 1, const number_t minElementNum = 1)#