PK_BODY_spin   


PK_ERROR_code_t         PK_BODY_spin
(
--- received arguments ---
PK_BODY_t               body,          --- minimum, wire or sheet body
const PK_AXIS1_sf_t    *axis,          --- spin axis
double                  angle,         --- spin angle
PK_LOGICAL_t            local_check,   --- whether local checking will be done

--- returned arguments ---
int              *const n_laterals,    --- number of laterals
PK_TOPOL_t      **const laterals,      --- new edges of faces (may be NULL)
PK_TOPOL_t      **const bases,         --- entities swept into laterals
                                       --- (may be NULL)
PK_local_check_t *const check_result   --- result of local check
)


This function spins a minimum body into a wire body, a wire body into a
sheet body, a sheet body into a solid body or a general body into a general
body.


Specific Errors:
    PK_ERROR_unsuitable_entity     Body is unsuitable for spin
    PK_ERROR_wrong_entity          Bad arguments
    PK_ERROR_bad_angle             Bad angle
    PK_ERROR_non_manifold          Can't spin body with non-manifold boundary
    PK_ERROR_impossible_spin       Can't determine spun geometry
    PK_ERROR_su_self_intersect     Spin would produce a self intersecting surf


The body to be spun is moved along an arc specified by the axis leaving
lateral entities in its wake. Bodies which may be spun, the laterals they
produce and the type of the resulting body are identified in the following
table.



    Spun Bodies           |         Laterals         |       Result
===========================================================================
Minimal body              |   One edge               |      Wire body
                          |                          |
Wire body                 |   One or more faces      |      Sheet body
                          |                          |
Sheet body                |   One or more faces      |      Solid body
                          |                          |
General body              |   One or more faces      |      General body
                          |       and edges          |
============================================================================

For every entry in 'laterals', there is a corresponding entry in 'bases'. This
array contains the topological entities extruded to create the lateral entities
For every lateral face there is a spun edge from the original body and for
every lateral edge there is a spun vertex.



Suitable Spin Entities:

   . Any minimal body not coincident with the axis of rotation.
   . Any wire body, either an open or closed loop of edges.
   . Any sheet body whose boundary is manifold.
   . Any general body with only one region and no edges with more than
     two faces.

Attempting to spin a body which is not one of the above will give rise
to one of PK_ERROR_wrong_entity, PK_ERROR_unsuitable_entity or
PK_ERROR_non_manifold as appropriate.



Permissible Spins:

   . A body may not be spun through more than 2pi or less than -2pi.
   . For a wire body none of the edges may be coincident with the axis, nor
     are they allowed to intersect the axis at any points other than at the
     ends of the wire.
   . For full spins of a sheet body the axis may not intersect the sheet at a
     single point, but it may be coincident with any edges of the sheet.
   . When the General topology session flag is enabled, full spins of single
     faced sheet bodies with "point contacts", at vertices, on the spin axis
     will be allowed.  The result will be a general body with non_manifold
     vertices for every "point contact".
   . For partial spins of a sheet body the restriction is that the axis
     may not intersect with any edges tangentially.  One special case is
     allowed when the curve of the edge is a circle orthogonal and
     tangential to the spin axis.
   . Bodies of revolution are created using a full spin. The spun entities
     are not deleted.

A body which has an edge whose attached curve is of the class PK_CLASS_icurve
(ie intersection curve), PK_CLASS_fcurve (ie foreign geometry),
PK_CLASS_spcurve (ie sp-curve), or PK_CLASS_cpcurve (ie constant parameter
curve) cannot be spun. However tolerant edges and sheet bodies, which have
curves of class PK_CLASS_spcurve (ie sp-curves) attached to their fins,
can be spun.

After a spin any coincident topology will not be fused or united.

Any new surfaces created are analytic surfaces if possible. If it is
not possible to use an analytic surface then the class of the new
surface will be PK_CLASS_spun or PK_CLASS_bsurf depending upon the most
recent call to PK_SESSION_set_swept_spun_surfs.

If local checking is switched on (local_check = PK_LOGICAL_true), consistency
checks will be made on newly created topological and geometrical
entities, and the result of the check returned.
A result of PK_local_check_ok_c indicates the body is valid. A result
of PK_local_check_negated_c indicates that the result body was originally
"inside out" but has been negated, and is now "positive" (has positive volume)
and valid. A result of PK_local_check_failed_c indicates the body
is self-intersecting and further modelling operations on it may fail.

If local_check is PK_LOGICAL_false, local checking will be switched off and
the result returned will be PK_local_check_no_c.

For general bodies, the body is copied, the copy is transformed,
corresponding vertices on the body and its copy are joined with
lateral edges, and corresponding edges are joined with lateral faces.
All the lateral entities are returned, both edges and faces.  The
result PK_local_check_negated_c is never returned since this has no
meaning for general bodies.