.. role:: blue :class: blue Recognition Tolerance ===================== .. _Recognition_tolerance_: .. kernel version: One of the key settings for converting a polygonal mesh into a model with a boundary representation is the value of recognition tolerance. The tolerance of the method is determined by the maximum allowable deviation of the recognized surfaces from the vertices of the polygonal mesh. The user can set the tolerance required in the calculations, or the default value will be used. In the case when the parameter of the deviation of the faces from the mesh is not known in advance, you can use the relative tolerance, which will be calculated based on the size of the original body. Thus, in the case of an unsatisfactory result of the algorithm, the user can influence it by changing the recognition tolerance parameter. Several functions of the :blue:`MbMeshProcessor` class are used to control the tolerance value. The method .. code-block:: cpp void SetRelativeTolerance( double tolerance ); sets the value of relative tolerance. When using relative tolerance, the deviation of the faces of the body from the mesh is checked relative to the dimensions of the current mesh. The input parameter to the method is: - *tolerance* – relative tolerance value. To obtain an absolute recognition error, the *tolerance* value will be multiplied by the diagonal of the bounding cube of the polygonal mesh or a collection of model elements. Thus, for a given relative tolerance equal to 1.0, the value of the absolute tolerance will be calculated based on the size of the model. The method .. code-block:: cpp void SetTolerance( double tolerance ); sets the absolute tolerance of surface recognition and expansion of mesh segments. The input parameter to the method is: - *tolerance* – absolute tolerance value. This method must be called before calling the :blue:`SegmentMesh`\() method. The default absolute accuracy is 0.1. The method .. code-block:: cpp double GetTolerance() const; transmits the value of the current absolute tolerance used in recognizing surfaces and expanding mesh segments. The method returns the absolute tolerance as a *double* type value.