PK_MESH_fix_defects   

PK_ERROR_code_t                PK_MESH_fix_defects
(
--- received arguments ---
PK_MESH_t                      mesh,                --- mesh in which to fix
                                                    --- defects
const PK_MESH_fix_defects_o_t *options,             --- options structure

--- returned arguments ---
PK_MESH_fix_result_t    *const result,              --- function result
int                     *const n_resultant_meshes,  --- number of resultant
                                                    --- meshes
PK_MESH_t              **const resultant_meshes,    --- resultant meshes
PK_MESH_defect_array_t **const defect_array         --- defect array for each
                                                    --- resultant mesh
)


This function fixes defects on a mesh.


Specific Errors:
    PK_ERROR_bad_angle             max_foldover_angle is either < 0 or > pi/2
                                   (MILD)
    PK_ERROR_is_attached           the mesh is attached to a face (MILD)
    PK_ERROR_tolerance_too_loose   too many degenerate and flat mfacets are
                                   found on the mesh using the current linear
                                   tolerance (MILD)


This function performs the same series of checks on a mesh as
PK_MESH_find_defects, and fixes the defects found, if any. This function may
introduce new defects into the fixed mesh.

The function returns the resultant meshes in the array 'resultant_meshes', of
length 'n_resultant_meshes'.

For each resultant mesh, the function returns information about remaining and
introduced defects in the array 'defect_array', where each entry in the
'defect_array' refers to the item with the same index in the array
'resultant_meshes'. Remaining defects are those specified by the input options,
but which could not be resolved, and introduced defects are defects which were
introduced during the fixing process. The array may not include all defects in
the mesh.

If all options are left at their default value then all defects found and fixed
are invalidities corresponding to faults returnable by PK_GEOM_check. This
function is not implemented for meshes attached to faces.

See here for more information.