PK_BODY_repair_shells   

PK_ERROR_code_t                  PK_BODY_repair_shells
(
--- received arguments ---
PK_BODY_t                        body,     --- body to repair
const PK_BODY_repair_shells_o_t *options,  --- options structure

--- returned arguments ---
PK_SHELL_repair_stat_t    *const status,   --- status returned
PK_TOPOL_track_r_t        *const tracking  --- tracking information
)


This function attempts to repair the shell and region structure of the given
'body'.



Introduction
The following repairs are implemented:

  - Regions with no shells are deleted.
  - Shells with no faces, edges or vertices are deleted.
  - Any shells whose topological contents are interlinked with those of
    another shell are merged.
  - Any shell whose topological contents are not fully connected to each other
    will be split into multiple shells each of which will be fully connected.
  - Any regions having the following property are merged:
      o spatial extents of the regions are intersecting and the volume of the
        common segment is non-zero,
      o the common segment contains all shells of the related regions.
  - Any region whose spatial extent is disconnected will be split into
    multiple regions each of which will have connected spatial extent.
  - Faces will be reoriented within shells to make the shells consistently
    oriented where necessary.
  - Faces will be reversed in order to have them point away from solid regions
    where this is required.
  - The region and shell structure will be re-organised to ensure correct
    containment.
  - The external void region will be identified. Its type will be set to void
    and it will be placed at the head of the list of regions in the body.


Restrictions and Limitations
This function will not repair physical (geometric) clashes, for example
face-face intersections, but will repair topological clashes between shells,
for example where two faces, each in a different shell, share a common edge.


User option
The PK_BODY_repair_shells_o_t structure contains user control options. See
its documentation for details.

Tracking
The PK_TOPOL_track_t structure contains topology tracking information for the
operation. See its documentation for details.

Error handling
If this function returns PK_ERROR_no_errors, the result of the operation will
be indicated by the value of the 'status'. For more information regarding
the status code refer to the PK documentation of PK_SHELL_repair_stat_t.