MERGEN ( entity, ifail )
========================
Remove redundant topology from entity
Receives:
KI_tag_topology *entity --- entity to merge
Returns:
KI_cod_error *ifail --- failure indicator
Specific errors:
KI_none_mergeable no mergeable entities
KI_wrong_entity entity of wrong type
KI_unsuitable_entity Mixed body
KI_general_body general body
Description:
Redundant ('mergeable') edges and vertices are removed from the given
entity, which may be a body, face, edge or vertex.
A vertex will normally be mergeable if it is attached to only one edge, or
if it is attached to only two edges, with the same curve geometry.
An edge will normally be mergeable if it is a wire edge, or if the faces
on either side have the same surface geometry.
The allowed entity types are treated as follows:
Vertex:
The vertex will be removed if it is mergeable.
Edge:
If the edge is mergeable, it will be removed. If its vertices are then
mergeable, they will be removed.
Face:
Any mergeable wire edges in the face will be removed. Then any mergeable
vertices in or on the boundary of the face will be removed.
Body:
Mergeable edges and vertices are removed from the body until none remain.
If the body contains B-curves or B-surfaces then connected sets of edges
on each B-curve and connected sets of faces on each B-surface
will be merged into a single edge or face provided that the B-geometry
is capable of passing the composite geometry checks (see CHCKEN).
However if any of the B-curves or B-surfaces are not capable
of passing the composite geometry checks then these curves and surfaces
will be split to produce smaller curves and surfaces that do pass the
checks. These will then be merged as above.
Note that the composite geometry checks will only be performed if SLIPCO
(see SEINTP) is set to 0.
This function is not supported for general bodies.