PK_BODY_fix_blends   

PK_ERROR_code_t               PK_BODY_fix_blends
(
--- received arguments ---
PK_BODY_t                     body,         --- edge to have blends fixed
const PK_BODY_fix_blends_o_t *options,      --- options structure [PF]

--- returned arguments ---
int                    *const n_blends,     --- number of blend faces
PK_FACE_t             **const blends,       --- created blend faces
PK_FACE_array_t       **const unders,       --- underlying topology/geometry
int                   **const topols,       --- topols that have been replaced
PK_blend_fault_t       *const fault,        --- status
PK_EDGE_t              *const fault_edge,   --- first edge for which blend
                                            --- can't be fixed
                                            --- (may be PK_ENTITY_null)
PK_ENTITY_t            *const fault_topol   --- topology associated with
                                            --- fault (may be PK_ENTITY_null)
)


This function changes any edges of the given body which have had blends set on
them by the PK_EDGE_set_blend_ functions, into faces with the appropriate
surface geometry.

This function offers partial support for facet geometry [PF]


Specific Errors:
    PK_ERROR_cant_fix_blends        can't fix blends in body (SERIOUS)
    PK_ERROR_general_body           general body (MILD)
    PK_ERROR_not_implemented        user options not implemented (MILD)
    PK_ERROR_bad_partition          user supplied partition is invalid (MILD)
    PK_ERROR_bad_combination        user supplied options are incompatible
                                    (MILD)
    PK_ERROR_clashing_limits        user supplied edge limit definitions
                                    clash or are ambiguous (MILD)
    PK_ERROR_not_in_same_body       topology has been supplied in an option
                                    which does not belong to 'body' (MILD)
    PK_ERROR_not_in_same_partition  sheet body supplied to cap the blend is
                                    in a different partition to 'body' (MILD)


Any edges of the body which have blend attributes are changed into full faces
with the appropriate blending surface geometry.

The PK_BODY_fix_blends_o_t structure contains user control options. See its
documentation for detail.

PK_BODY_fix_blends returns the number of created blend faces,
and three arrays:

 'blends' will contain 'n_blends' faces, which are the created blend faces.

 'unders' The contents of 'unders' will depend on the 'tracking_type' option.
          If the 'tracking_type' option is set to PK_blend_track_type_unders_c
          then 'unders' will contain an array of 'n_blends' arrays of
          integers. Each array will contain the ( possibly dead ) tags of the
          originating topology or geometry used to determine the equivalent
          blend face in 'blends'. In general these will be the tags of the two
          underlying faces of the blend, along with any other data that
          determined the geometry of the blend face, such as a cliff edge.

          For faces derived from a limit point the array will instead contain
          a negative integer refering to -1 times the index of the
          appropriate point in the user-supplied 'limit_points' array.

          For faces derived from a limit vertex the array will instead contain
          the tag of the original vertex associated with the limit.

          For faces derived from a user-supplied capping sheet body the array
          will contain the tag of the appropriate face in the user-supplied
          capping sheet body.

          For faces derived from a user-supplied capping surface the array
          will contain the tag of the original surface.

          For faces derived from a user-supplied limit face or limit fin the
          array will contain the tag of the original limit face or limit fin.

          For faces derived from patching the region of a limit the array
          will contain the tag(s) of the original user-supplied limit face(s)
          or limit fin(s). It will also contain the (possibly dead) underlying
          faces defining the patch. In the situation where the face is
          derived from a limit face and that limit face is also an underlying
          face of the patch then that face may appear twice in the array.


          If the 'tracking_type' option is set to PK_blend_track_type_basic_c
          then 'unders' will contain the underlying faces associated with the
          blends. The underlying faces of a blend are the faces whose geometry
          determines the blend surface geometry. Some of the face tags may be
          null. This occurs if there is no face in the final body with the
          appropriate surface geometry, which can be the case if a face has
          been entirely blended away, or for the cliff side of a cliffedge
          blend. However, if the 'output_sheet' option is used and a blend
          sheet body created the face tags will not be null. When blend faces
          have arisen from the face/faces of a user-supplied capping sheet
          body, the face tags will always be null, as such a blend face is
          deemed to have no direct association with the faces of the body
          being blended.

 'topols' will contain 'n_blends' integers. These integers are usually the
          tags of the edges which were blended to produce this set of blends.
          The tags will in general be dead unless the 'output_sheet' option
          is chosen and a blend sheet body created. The same value may occur
          several times in this list if, for example, a blend has overflowed,
          since all the corresponding faces in 'blends' were caused by the
          same blend attribute. Where blend faces have arisen from the
          face/faces of a user-supplied capping sheet body, the corresponding
          integer in this list will be the tag of the appropriate original
          face, upon the relevant user-supplied capping sheet body.

If this function returns PK_ERROR_no_errors, the result of the operation
will be indicated by the value of 'fault'. When this value is not
PK_blend_fault_no_fault_c or PK_blend_fault_repaired_c, it indicates an
operation failure. An edge that was selected to be blended associated with the
error may be returned in 'fault_edge'. Topology associated with the error may
also be returned in 'fault_topol'. See the documentation for PK_blend_fault_t
for details. This error information can be used to locate the reason for the
failure to fix the blend. Note that only the first error will be returned.

Note that blends created with the property 'draw_fix' set to PK_LOGICAL_false
will not be fixed.

Blends can be created on general bodies, so long as the portion of the body in
the neighbourhood of the blend is locally manifold.