IDFSEN   

Equivalent PK functions: PK_BODY_identify_facesets

IDFSEN ( target, tool, targed, tooled, targvx, toolvx, nopts, opts, topol, 
===========================================================================
         targsu, toolsu, targbo, toolbo, targrj, toolrj, ifail )
         =======================================================

  Identifies facesets of one or two bodies

Receives:
  KI_tag_body              *target         --- target body
 <KI_tag_body>             *tool           --- tool body
 <KI_tag_list_edge>        *targed         --- list of common edges on target
 <KI_tag_list_edge>        *tooled         --- list of common edges on tool
 <KI_tag_list_vertex>      *targvx         --- list of common points on target
 <KI_tag_list_vertex>      *toolvx         --- list of common points on tool
 <KI_int_nitems>           *nopts          --- number of options
  KI_cod_idop               opts[nopts]    --- option codes
 <KI_tag_list_topology>    *topol          --- topology in selected facesets

Returns:
  KI_tag_list_list         *targsu         --- surviving facesets on target
  KI_tag_list_list         *toolsu         --- surviving facesets on tool
  KI_tag_list_edge         *targbo         --- bounds of facesets on target
  KI_tag_list_edge         *toolbo         --- bounds of facesets on tool
  KI_tag_list_list         *targrj         --- rejected facesets on target
  KI_tag_list_list         *toolrj         --- rejected facesets on tool
  KI_cod_error             *ifail          --- failure code

Specific errors:
  KI_inconsistent_facesets  failure to identify facesets
  KI_non_manifold           boolean would result in non manifold body
  KI_unsuitable_topology    an item in topol is from boundary or wrong body
  KI_topol_not_from_body    edge/vertex is not from target/tool as expected
  KI_wire_body              target or tool is wire body
  KI_contradictory_request  lists of common vertices are not the same length
                            lists of common edges are not the same length
                            no boolean option supplied with two bodies
                            boolean option supplied with no tool
                            no topology given for selected faceset
                            more than one boolean option supplied
  KI_general_body           general body

Description:
  If two bodies are given, with loops of coincident edges and points of contact,
  the facesets that would survive a boolean (unite, intersect or subtract) are
  determined.  To further restrict the parts of the tool that survive, facesets
  can be filtered out by giving one or more pieces of topology from each
  faceset.  Each piece of topology can be a face, edge or vertex in the tool and
  should be in a faceset that would survive the selected boolean; if it is an
  edge or vertex it should not be on the boundary of the faceset.  If any
  facesets are given, all facesets in the tool that are not selected facesets
  will not survive and the target facesets will be adjusted accordingly.
  Coincident edges (and points) must be given in the same order in both lists,
  it is the users responsibility to check this.  If the result of the boolean,
  taking into account any selected facesets, would be non-manifold then the
  ifail KI_non_manifold will be returned.

  If no tool is given, then the target will be divided into facesets by the
  edges given, all facesets will be returned as surviving unless facesets are
  selected.  Facesets are selected as above, except the topology must be from
  the target body.  When no tool is given it is impossible to simulate a
  boolean.

  Any void inside the target (or tool) will be a separate faceset (or facesets)
  and its survival will be determined as for other facesets.  If facesets are
  selected, then a void in the tool (or target if only one body) will not
  survive unless it is selected with a piece of topology.

  Any rubber faces will be ignored and will not be in any returned faceset.
  Facesets are not 'connected' across rubber faces.

  The surviving and rejected facesets of the target (and tool if appropriate)
  are returned as lists of lists.  Each list is the list of faces in one
  faceset.  If there is no tool, the appropriate lists of lists will be set to
  null.

  The returned edges will be the list of edges that divide the surviving and
  rejected facesets of the target, and also a matching list of edges on the tool
  (or null if there is no tool).  These edges will be some or all of the common
  edges received.

  The options for IDOP are:

      IDOPUN: Simulate unite.  There must be a tool body given.

      IDOPIN: Simulate intersection.  There must be a tool body given.

      IDOPSU: Simulate subtraction.  There must be a tool body given.

      IDOPFS: Select one or more facesets to survive.  One or more
              pieces of topology must be given in 'topol' to specify the
              facesets.  If a tool is given, the topology must be in the tool.

  This function is not supported for general bodies.