.. role:: blue :class: blue Constructing Triangulation for a Face ===================================== .. _Constructing_Triangulation_for_a_Face_: .. kernel version: The method .. code-block:: cpp void CalculateGrid( const MbFace & face, const MbStepData & stepData, bool edgePoints, MbGrid & grid, bool dualSeams = true ); approximates a face with triangular and quadrilateral plates. The input parameters of the method are: - *face* – face; - *stepData* – data for calculating the approximation step; - *edgePoints* – flag for using spatial points; - *dualSeams* – flag for seam processing. The output parameter of the method is the triangulation *grid*. The method is declared in the *tri_face.h* file. The *stepData* parameter controls the density of the triangulation and contains data for calculating the step when moving along the face surface. The *stepData* parameter is described in the subsection :ref:`Triangulation Calculation Control `. For different values of *stepData.stepType*, different triangulation data of *grid* are filled. If *stepData.stepType* contains the *ist_MipStep* mask, the *grid.params* set is filled. If *stepData.stepType* contains the *ist_CollisionStep* or *ist_ParamStep* mask, the *grid.params*, *grid.points* and *grid.normals* sets are filled. In all other cases, the *grid.params* and *grid.points* sets are filled. Fig. 1 shows a triangulation of a planar face with the *ist_SpaceStep* mask: .. figure:: ../../pictures/R.1.5.1.png :width: 9cm :align: center Fig. 1 Fig. 2 shows a triangulation of a curved face with the *ist_SpaceStep* mask. .. figure:: ../../pictures/R.1.5.2.png :width: 9cm :align: center Fig. 2 This method is called when constructing polygonal objects by the :blue:`CalculateMesh`\() and :blue:`AddYourMesh`\() methods if *note.grid* == true.