.. role:: blue :class: blue Polygon Mesh Segmentation Editing ================================= .. _Polygon_mesh_segmentation_editing_: .. kernel version: Often, polygon mesh models, being the result of 3D scanning, have a complex internal structure with the presence of "noise" – random outliers of points outside the dimensions of a face. The transformation of such meshes implies a denser interaction with the user, since automatic recognition is difficult. Several tools are provided for correcting segmentation results. The method .. code-block:: cpp MbResultType SegmentMesh( bool createSurfaces = true ); performs segmentation of the given polygon mesh. The input parameter of the method is: - *createSurfaces* – flag used for creating surfaces on segments. If the algorithm works successfully, the method returns *rt_Success*, otherwise the method returns an error code from the :blue:`MbResultType` enumeration. The method .. code-block:: cpp void UniteSegments( size_t firstSegmentIdx, size_t secondSegmentIdx ); merges two segments in the current polygon mesh segmentation. Method input parameters are: - *firstSegmentIdx* – index of the first segment to merge; - *secondSegmentIdx* – index of the second segment to merge. The result of the union is available through the collection returned by the :blue:`GetSegmentedMesh`\() method. The method .. code-block:: cpp MbResultType SegmentMeshBySeparators( const std::vector> & separators ); performs segmentation of the polygonal mesh by segment delimiters. The input parameter of the method is: - *separators* – an array of separators, each of which contains a path along the vertices of the mesh whose edges separate the segments. If the algorithm works successfully, the method returns *rt_Success*, otherwise the method returns an error code from the :blue:`MbResultType` enumeration.