CRTSFA   

Equivalent PK functions: PK_SURF_make_sheet_trimmed

CRTSFA ( sf, sense, curves, etol, ftol, nopts, chopts, body, face, state, 
==========================================================================
         ifail )
         =======

  Creates a sheet body given surface and trimmed SP-curve data.

Receives:
  KI_tag_surface           *sf             --- surface of face
  KI_cod_logical           *sense          --- sense of face
 <KI_tag_list_list>        *curves         --- curves, one list for each
                                           --- loop of face
  double                   *etol           --- 3-space distance tolerance,
                                           --- stored on each edge
  double                   *ftol           --- 3-space distance tolerance
                                           --- stored on the face
 <KI_int_nitems>           *nopts          --- number of checking options
 <KI_cod_tsop>              chopts[nopts]  --- checking options

Returns:
 <KI_tag_body>             *body           --- sheet body created
 <KI_tag_face>             *face           --- face of 'by'
  KI_cod_rtts              *state          --- state code
  KI_cod_error             *ifail          --- failure indicator

Specific errors:
  KI_bad_sharing            sf referenced from other than supplied SP-curves
  KI_bad_basis_surf         SP-curve not on surface
  KI_has_parent             underlying SP-curve is not orphan
                            trimmed curve is not orphan
                            surface is not orphan
  KI_wrong_entity_in_list   underlying curve is not an SP-curve
                            list contained non trimmed curve
  KI_duplicate_list_item    curve geometry duplicated in lists
  KI_unsuitable_entity      surface does not pass checks
  KI_bad_option_data        incorrect checking option data
  KI_bad_tolerance          face tolerance is less than Parasolid tolerance
                            edge tolerance is less than Parasolid tolerance

Description:
  This function creates a sheet body with a single face, given surface
  geometry for the face and curve geometry for the edges.
  The topology of the resulting sheet will be inferred from the geometry.

  CRTSFA is designed primarily for importing geometric data of lower precision
  than Parasolid default. The geometry supplied to the routine need not,
  therefore, conform to Parasolid's standard tolerances. The user is responsible
  for specifying the distance tolerance parameters, the minimum distance two
  points have to be apart to be regarded as distinct, which will be stored
  with the face and edges of the resulting sheet body.

  'sf' will be the geometry attached to the single face of the body.  It
  can be of any type recognised by Parasolid, and must be orphan. If
  'sf' is a B-surface, it must be capable of passing the continuity
  checks imposed by CHCKEN.

  'sense' is a logical indicating whether the resultant face normal is aligned
  with the surface normal (set to true) or anti-aligned (false).

  'curves' is a list containing lists of trimmed curves (type TYCUTR)
  representing the edge geometry of the face. The basis curves of the supplied
  trimmed curves must always be SP-curves. Each sublist of 'curves' will
  contain the SP-curves geometry representing a single loop. 'curves' is not
  allowed to be null, except in the case of a wholly closed sheet with no loops
  e.g. whole sphere or torus. The trimmed curves will be attached to the fins
  of the edges of the created face. Note that each curve appearing in 'curves'
  must be orphan, and must reference an underlying SP-curve which is also
  orphan.

  The curve directions should be such that the intended face lies on the left
  of the curve when viewed in a direction opposing the face normal. The
  curves should be given in the correct order, following each other around
  the loop such that the end of any given curve is within tolerance of the
  start of the next one. Minimal corrective action will be attempted for
  input data not meeting these requirements, though this cannot be
  guaranteed to produce valid loops. The curve ordering must be correct
  as no attempt to reorder the curves is made.

  Note that CRTSFA can accept any trimmed surface formats supported by OUTSFA,
  although it will not incorporate SP-curves representing surface degeneracies
  into the model, as these have zero 3-space length. Similarly trimmed SP-curves
  shorter than the requisite tolerance (in terms of chord length) will not
  appear in the model (trimmed curves whose underlying SP-curve is closed are
  excepted).

  Note that two coincident opposing curves must be supplied if a wire edge
  (corresponding, for example, to a seam on a periodic surface) is required.
  In addition, CRTSFA will always create closed loop topology, regardless of
  the actual geometric closure of the supplied loops of SP-curves.

  All SP-curves satisfy the continuity requirements described under CRSPCU
  before introduction into a model by means of CRTSFA.

  The points stored on the vertices of the sheet body will be computed by
  Parasolid, so the application has no need to supply them. The position of
  the vertex is deemed to be the centroid point of all the trimmed curve ends
  meeting at the vertex. A suitable tolerance for the vertex is also computed.
  It should be noted that because the vertex point and tolerance are flexible
  to some extent, it is not necessary that consecutive trimmed curves meet to
  within twice 'etol' at the vertex. As a safeguard against potentially
  incorrectly ordered data, however, there will be a state code indicator
  returned when any computed vertex tolerance exceeds 10 times 'etol'.

  'etol' is a 3-space distance parameter, and will be stored with all of the
  edges of the resultant sheet. Refer to SETLEN for the meaning of this
  tolerance within a model. From an application point of view, the value of
  'etol' will reflect the accuracy of the sending system's curve data, and must
  be greater than or equal to Parasolid's linear tolerance. SETLEN can be used
  subsequently to modify the tolerance of any edge of the resultant sheet.

  'ftol' is again a 3-space distance parameter, and will be stored with the
  face of the created sheet. Refer to SETLEN for the meaning of this
  tolerance within a model. From the application point of view, the value of
  'ftol' will reflect the accuracy of the sending system's surface data. It is
  required that 'ftol' be less than or at most equal to 'etol'.

  There are three optional levels of checking available on the resulting
  sheet body. These can be employed by the application according to how much
  is known about the input data in terms of, for example, the consistency of
  the loops directions. Whichever option is used, CRTSFA will attempt to
  correct any inconsistencies found within the limits imposed by the checks.
  Note that each option is independent of the others.

  Option TSOPWR. This option allows the identification of wire topologies
  (e.g. seamlines) and will ensure that the correct topology is made in such
  cases.

  Option TSOPSX. This option enables the application to pick up
  self-intersections within the sheet. Checks made are:

  . All edges are tested pairwise with each other to detect points at which
    their fin curves intersect which are NOT model vertices. There is no
    possible corrective action that can be taken here. Such sheets will fail
    CHCKEN.

  Option TSOPLC. This will check that the loops of the face are consistent.
  With this option turned on:
   . Checks are made to check whether:
      . The loops are correctly contained (i.e. all inner hole loops lie within
        the boundary or peripheral loop, where such can be determined).
      . The combination of loops is a valid one for the surface type (for
        example, a set of loops on a plane contains just one peripheral positive
        loop and the rest negative hole ones).
   . If the above conditions are not met minimal corrective action is attempted.
     In an attempt to create valid loops CRTSFA may reverse loops,
     and investigate singularities of 'sf' introducing them into the face as
     isolated vertices if necessary. This corrective action is only attempted if
     the TSOPLC option is turned on, and there no guarantee of valid result
     being found.
  The resulting sheet is returned in 'body'.

  'face' is the single face to which the supplied surface geometry is
  attached.
  'state' is an indicator of the validity of the sheet after the chosen
  checking options have been performed on it. It is not intended to give
  detailed information (use CHCKEN for this). The returns are:

  RTTSOK. Indicates that either all selected checks passed, and any attempted
  corrections were successful, or no checks were requested.

  RTTSFR. Face is redundant with respect to the supplied tolerances. This is
  because all the supplied curves were too short with respect to 'etol' for
  the production of a valid face.

  RTTSCI. Indicates that no sense could be made of the input loops of
  curves. This means that they did not follow round in the loop direction
  as indicated earlier, and there may be vertex tolerances computed as a
  result which exceed 10 times 'etol'.

  RTTSSX. Indicates that the resultant sheet is self-intersecting because
  edges meet at a place other than a model vertex.

  RTTSLI. Indicates that the loop structure of the resulting sheet is in
  some way invalid (e.g. there is no peripheral loop on a planar surface),
  and attempts to correct the problem failed. Such sheets should NOT be
  subsequently passed to CRKNPA or KNITEN, or otherwise incorporated into
  solid bodies.

  RTTSEO. Indicates that the edges of the resulting sheet are incorrectly
  ordered at at least one of its vertices. This can be caused by the input data
  failing to comply with the convention on wire edges, for example.