## AfdApplyEStep

(cagd_lib/afd_cube.c:168)
Prototype:

      void AfdApplyEStep(CagdRType Coef[4])

Description:
Given four coefficents of a cubic afd polynomial, apply the E ( step 1 ) in place.
Parameters:

Coef: | Four coefficients of the AFD basis functions.
--- | ---

Returned Value:

void

Keywords:
forward differencing

## AfdApplyLn

(cagd_lib/afd_cube.c:73)
Prototype:

      void AfdApplyLn(CagdRType Coef[4], int n)

Description:
Given four coefficents of a cubic afd polynomial, apply the L ( half the step size ) n times to them, in place. We basically precomputed L^n and apply it here once. Every instance of L half the domain and so L^n divides the domain by 2^n.
Parameters:

Coef: | Four coefficients of the AFD basis functions.
--- | ---
n: | How many times to compute the L transform.

Returned Value:

void

Keywords:
forward differencing

## AfdBzrCrvEvalToPolyline

(cagd_lib/afd_cube.c:245)
Prototype:

      void AfdBzrCrvEvalToPolyline(CagdCrvStruct *Crv,
                                   int FineNess,
                                   CagdRType *Points[])

Description:
Samples the curves at FineNess location equally spaced in the Bezier parametric domain [0..1]. If Cache is enabled, and FineNess is power of two, upto or equal to CacheFineNess, the cache is used, otherwise the points are evaluated manually for each of the samples. Data is saved at the Points array of vectors (according to Curve PType), each vector is assumed to be allocated for FineNess CagdRType points. Bezier curve must be cubic.
Parameters:

Crv: | A cubic Bezier curve to piecewuise linear sample using AFD.
--- | ---
FineNess: | Of samples.
Points: | Whre to put the piecewise linear approximation.

Returned Value:

void

See Also:
BzrCrvEvalToPolyline
Keywords:
forward differencing

## AfdCnvrtCubicBzrToAfd

(cagd_lib/afd_cube.c:45)
Prototype:

      void AfdCnvrtCubicBzrToAfd(CagdRType Coef[4])

Description:
Given four coefficents of a cubic Bezier curve, computes the four coefficients of the cubic afd basis functions, in place.
Parameters:

Coef: | Converts, in place, cubic Bezier Coef to AFD Coef.
--- | ---

Returned Value:

void

Keywords:
forward differencing

## AfdComputePolyline

(cagd_lib/afd_cube.c:199)
Prototype:

      void AfdComputePolyline(CagdRType Coef[4],
                              CagdRType *Poly,
                              int Log2Step,
                              CagdBType NonAdaptive)

Description:
Given four coefficents of a cubic Bezier curve, computes the four coefficients of the cubic afd basis functions and step along them to create a piecewise polynomial approximating the curve. If NonAdaptive is TRUE then 2^Log2Step constant steps are taken, creating 2^Log2Step + 1 points along the curve. Otherwise the full blown adaptive algorithm is used.
Parameters:

Coef: | Four coefficients of a cubic Bezier curve.
--- | ---
Poly: | Where to put the polyline computed.
Log2Step: | How many steps to take (2 to the power of this).
NonAdaptive: | if TRUE, ignore the adaptive option.

Returned Value:

void

Keywords:
forward differencing

## BspC1Srf2Polygons

(cagd_lib/bsp2poly.c:173)
Prototype:

      CagdPolygonStruct *BspC1Srf2Polygons(CagdSrfStruct *Srf,
                                           int FineNess,
                                           CagdBType ComputeNormals,
                                           CagdBType FourPerFlat,
                                           CagdBType ComputeUV)

Description:
Routine to convert a single C1 continuouse Bspline srf to a set of triangles approximating it. FineNess is a finess control on result and the larger it is more triangles may result. A value of 10 is a good starting value. NULL is returned in case of an error, otherwise list of CagdPolygonStruct.
Parameters:

Srf: | To approximate into triangles.
--- | ---
FineNess: | Control on accuracy, the higher the finer.
ComputeNormals: | If TRUE, normal information is also computed.
FourPerFlat: | If TRUE, four triangles are created per flat surface. If FALSE, only 2 triangles are created.
ComputeUV: | If TRUE, UV values are stored and returned as well.

Returned Value:

CagdPolygonStruct *: A list of polygons with optional normal and/or UV parametric information. NULL is returned in case of an error.

See Also:
BzrSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons SymbSrf2Polygons TrimSrf2Polygons
Keywords:
polygonization surface approximation

## BspCrv2Polyline

(cagd_lib/bsp2poly.c:639)
Prototype:

      CagdPolylineStruct *BspCrv2Polyline(CagdCrvStruct *Crv,
                                          int SamplesPerCurve,
                                          BspKnotAlphaCoeffType *A,
                                          CagdBType OptiLin)

Description:
Routine to approx. a single Bspline curve as a polyline with SamplesPerCurve samples. Polyline is always E3 CagdPolylineStruct type. Curve is refined equally spaced in parametric space, unless the curve is linear in which the control polygon is simply being copied. If A is specified, it is used to refine the curve. NULL is returned in case of an error, otherwise CagdPolylineStruct.
Parameters:

Crv: | To approximate as a polyline.
--- | ---
SamplesPerCurve: | Number of samples to approximate with.
A: | Alpha matrix (Oslo algorithm) if precumputed.
OptiLin: | If TRUE, optimize linear curves.

Returned Value:

CagdPolylineStruct *: A polyline representing the piecewise linear approximation from, or NULL in case of an error.

See Also:
BzrCrv2Polyline BspSrf2Polylines IritCurve2Polylines SymbCrv2Polyline
Keywords:
piecewise linear approximation polyline

## BspCrvBiNormal

(cagd_lib/cbsp_aux.c:526)
Prototype:

      CagdVecStruct *BspCrvBiNormal(CagdCrvStruct *Crv,
                                    CagdRType t,
                                    CagdBType Normalize)

Description:
Returns a (unit) vector, equal to the binormal to Crv at parameter value t. Algorithm: insert (order - 1) knots and using 3 consecutive control points at the refined location (p1, p2, p3), compute to binormal to be the cross product of the two vectors (p1 - p2) and (p2 - p3). Since a curve may have not BiNormal at inflection points or if the 3 points are colinear, NULL will be returned at such cases.
Parameters:

Crv: | Crv for which to compute a (unit) binormal.
--- | ---
t: | The parameter at which to compute the unit binormal.
Normalize: | f TRUE, attempt is made to normalize the returned vector. If FALSE, length is a function of given parametrization.

Returned Value:

CagdVecStruct *: A pointer to a static vector holding the binormal information.

Keywords:
binormal

## BspCrvCoxDeBoorBasis

(cagd_lib/bspcoxdb.c:115)
Prototype:

      CagdRType *BspCrvCoxDeBoorBasis(CagdRType *KnotVector,
                                      int Order,
                                      int Len,
                                      CagdRType t,
                                      int *IndexFirst)

Description:
Returns a pointer to a vector of size Order, holding values of the non zero basis functions of a given curve at given parametric location t. This vector SHOULD NOT BE FREED. Although it is dynamically allocated, the returned pointer does not point to the beginning of this memory and it it be maintained by this routine (i.e. it might be freed next time this routine is being called). IndexFirst returns the index of first non zero basis function for the given parameter value t. Uses the recursive Cox de Boor algorithm, to evaluate the Bspline basis functions. Algorithm: Use the following recursion relation with B(i,0) == 1.

             t     -    t(i)            t(i+k)    -   t
    B(i,k) = --------------- B(i,k-1) + --------------- B(i+1,k-1)
             t(i+k-1) - t(i)            t(i+k) - t(i+1)

Starting with constant Bspline (k == 0) only one basis function is non zero and is equal to one. This is the constant Bspline spanning interval t(i)...t(i+1) such that t(i) <= t < t(i+1). We then raise this constant Bspline to the prescribed Order and find in this process all the basis functions that are non zero in t for order Order. Sound simple hah!?
Parameters:

KnotVector: | To evaluate the Bspline Basis functions for this space.
--- | ---
Order: | Of the geometry.
Len: | Number of control points in the geometry. The length of KnotVector is equal to Len + Order.
t: | At which the Bspline basis functions are to be evaluated.
IndexFirst: | Index of the first Bspline basis function that might be non zero.

Returned Value:

CagdRType *: A vector of length Order thats holds the values of the Bspline basis functions for the given t. A Bspline of order Order might have at most Order non zero basis functions that will hence start at IndexFirst and upto (*IndexFirst + Order - 1).

Keywords:
evaluation Bsplines

## BspCrvCoxDeBoorIndexFIrst

(cagd_lib/bspcoxdb.c:200)
Prototype:

      int BspCrvCoxDeBoorIndexFirst(CagdRType *KnotVector,
                                    int Order,
                                    int Len,
                                    CagdRType t)

Description:
Computes the index of the first non zero basis function as returned by the BspCrvCoxDeBoorBasis function.
Parameters:

KnotVector: | To evaluate the Bspline Basis functions for this space.
--- | ---
Order: | Of the geometry.
Len: | Number of control points in the geometry. The length of KnotVector is equal to Len + Order.
t: | At which the Bspline basis functions are to be evaluated.

Returned Value:

int: The index.

Keywords:
evaluation Bsplines

## BspCrvCreateCircle

(cagd_lib/cagd_arc.c:239)
Prototype:

      CagdCrvStruct *BspCrvCreateCircle(CagdPtStruct *Center, CagdRType Radius)

Description:
Creates a circle at the specified position as a rational quadratic Bspline curve. Circle is always paralell to the XY plane.
Parameters:

Center: | Of circle to be created.
--- | ---
Radius: | Of circle to be created.

Returned Value:

CagdCrvStruct *: A circle centered at Center and radius Radius that is parallel to the XY plane represented as a rational quadratic Bspline curve.

See Also:
BspCrvCreateUnitCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle
Keywords:
circle

## BspCrvCreatePCircle

(cagd_lib/cagd_arc.c:337)
Prototype:

      CagdCrvStruct *BspCrvCreatePCircle(CagdPtStruct *Center, CagdRType Radius)

Description:
Approximates a circle as a cubic polynomial Bspline curve at the specified position and radius. Construct the circle as four 90 degrees arcs of polynomial cubic Bezier segments using predefined constants. See Faux & Pratt "Computational Geometry for Design and Manufacturing" for a polynomial approximation to a circle.
Parameters:

Center: | Of circle to be created.
--- | ---
Radius: | Of circle to be created.

Returned Value:

CagdCrvStruct *: A circle approximation centered at Center and radius Radius that is parallel to the XY plane represented as a polynomial cubic Bspline curve.

See Also:
BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreateUnitPCircle
Keywords:
circle

## BspCrvCreateUnitCircle

(cagd_lib/cagd_arc.c:195)
Prototype:

      CagdCrvStruct *BspCrvCreateUnitCircle(void)

Description:
Creates a circle at the specified position as a rational quadratic Bspline curve. Constructs a unit circle as 4 90 degrees arcs of rational quadratic Bezier segments using a predefined constants.
Parameters:

None

Returned Value:

CagdCrvStruct *: A rational quadratic bsplinecurve representing a unit circle.

See Also:
BspCrvCreateCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle
Keywords:
circle

## BspCrvCreateUnitPCircle

(cagd_lib/cagd_arc.c:274)
Prototype:

      CagdCrvStruct *BspCrvCreateUnitPCircle(void)

Description:
Approximates a unit circle as a cubic polynomial Bspline curve. Construct a circle as four 90 degrees arcs of polynomial cubic Bezier segments using predefined constants. See Faux & Pratt "Computational Geometry for Design and Manufacturing" for a polynomial approximation to a circle.
Parameters:

None

Returned Value:

CagdCrvStruct *: A cubic polynomial Bspline curve approximating a unit circle

See Also:
BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle
Keywords:
circle

## BspCrvDegreeRaise

(cagd_lib/cbsp_aux.c:354)
Prototype:

      CagdCrvStruct *BspCrvDegreeRaise(CagdCrvStruct *Crv)

Description:
Returns a new curve, identical to the original but with one degree higher.
Parameters:

Crv: | To raise it degree by one.
--- | ---

Returned Value:

CagdCrvStruct *: A curve with one degree higher representing the same geometry as Crv.

Keywords:
degree raising

## BspCrvDegreeRaiseN

(cagd_lib/cbsp_aux.c:297)
Prototype:

      CagdCrvStruct *BspCrvDegreeRaiseN(CagdCrvStruct *Crv, int NewOrder)

Description:
Returns a new curve, identical to the original but with order N. Degree raise is computed by multiplying by a constant 1 curve of order
Parameters:

Crv: | To raise its degree to a NewOrder.
--- | ---
NewOrder: | NewOrder for Crv.

Returned Value:

CagdCrvStruct *: A curve of order NewOrder representing the same geometry as Crv.

Keywords:
degree raising

## BspCrvDerive

(cagd_lib/cbsp_aux.c:651)
Prototype:

      CagdCrvStruct *BspCrvDerive(CagdCrvStruct *Crv)

Description:
Returns a new curve, equal to the given curve, differentiated once. Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:

##

    Q(i) = (k - 1) * (P(i+1) - P(i)) / (Kv(i + k) - Kv(i + 1)), i = 0 to k-2.

    Parameters:

     Crv:        To differentiate.

    Returned Value:

      CagdCrvStruct *:   Differentiated curve.

    See Also:

      BzrCrvDerive
      CagdCrvDerive
      BzrCrvDeriveRational
      BspCrvDeriveRational

    Keywords:

      derivatives

     BspCrvDomain   (cagd_lib/bsp_gen.c:209)

    Prototype:

      void BspCrvDomain(CagdCrvStruct *Crv, CagdRType *TMin, CagdRType *TMax)

    Description:

Returns the parametric domain of a Bspline curve.
Parameters:

Crv: | To get its parametric domain.
--- | ---
TMin: | Where to put the minimal domain's boundary.
TMax: | Where to put the maximal domain's boundary.

Returned Value:

void

See Also:
CagdCrvDomain
Keywords:
domain parametric domain

## BspCrvEvalAtParam

(cagd_lib/cbspeval.c:98)
Prototype:

      CagdRType *BspCrvEvalAtParam(CagdCrvStruct *Crv, CagdRType t)

Description:
Returns a pointer to a static data, holding the value of the curve at given parametric location t. The curve is assumed to be Bspline. Uses the Cox de Boor recursive algorithm.
Parameters:

Crv: | To evaluate at the given parametric location t.
--- | ---
t: | The parameter value at which the curve Crv is to be evaluated.

Returned Value:

CagdRType *: A vector holding all the coefficients of all components of curve Crv's point type. If for example the curve's point type is P2, the W, X, and Y will be saved in the first three locations of the returned vector. The first location (index 0) of the returned vector is reserved for the rational coefficient W and XYZ always starts at second location of the returned vector (index 1).

See Also:
CagdCrvEval BzrCrvEvalAtParam BzrCrvEvalVecAtParam BspCrvEvalVecAtParam BspCrvEvalCoxDeBoor CagdCrvEvalToPolyline
Keywords:
evaluation

## BspCrvEvalCoxDeBoor

(cagd_lib/bspcoxdb.c:41)
Prototype:

      CagdRType *BspCrvEvalCoxDeBoor(CagdCrvStruct *Crv, CagdRType t)

Description:
Returns a pointer to a static data, holding the value of the curve at the prescribed parametric location t. Uses the recursive Cox de-Boor algorithm, to evaluate the spline, which is not very efficient if many evaluations of the same curve are necessary Use knot insertion when multiple evaluations are to be performed.
Parameters:

Crv: | To evaluate at the given parametric location t.
--- | ---
t: | The parameter value at which the curve Crv is to be evaluated.

Returned Value:

CagdRType *: A vector holding all the coefficients of all components of curve Crv's point type. If for example the curve's point type is P2, the W, X, and Y will be saved in the first three locations of the returned vector. The first location (index 0) of the returned vector is reserved for the rational coefficient W and XYZ always starts at second location of the returned vector (index 1).

Keywords:
evaluation Bsplines

## BspCrvEvalVecAtParam

(cagd_lib/cbspeval.c:42)
Prototype:

      CagdRType BspCrvEvalVecAtParam(CagdRType *Vec,
                                     int VecInc,
                                     CagdRType *KnotVector,
                                     int Order,
                                     int Len,
                                     CagdBType Periodic,
                                     CagdRType t)

Description:
Assumes Vec holds control points for scalar Bspline curve of order Order length Len and knot vector KnotVector. Evaluates and returns that curve value at parameter value t. Vec is incremented by VecInc (usually by 1) after each iteration.
Parameters:

Vec: | Coefficents of a scalar Bspline univariate function.
--- | ---
VecInc: | Step to move along Vec.
KnotVector: | Knot vector of associated geoemtry.
Order: | Order of associated geometry.
Len: | Length of control vector.
Periodic: | If this geometry is Periodic.
t: | Parameter value where to evaluate the curve.

Returned Value:

CagdRType: Geometry's value at parameter value t.

Keywords:
evaluation

## BspCrvHasBezierKV

(cagd_lib/bsp_knot.c:29)
Prototype:

      CagdBType BspCrvHasBezierKV(CagdCrvStruct *Crv)

Description:
Returns TRUE iff the given curve has no interior knot open end KV.
Parameters:

Crv: | To check for KV that mimics Bezier polynomial curve.
--- | ---

Returned Value:

CagdBType: TRUE if same as Bezier curve, FALSE otherwise.

Keywords:
conversion

## BspCrvHasOpenEC

(cagd_lib/bsp_knot.c:89)
Prototype:

      CagdBType BspCrvHasOpenEC(CagdCrvStruct *Crv)

Description:
Returns TRUE iff the given Bspline curve has open end coditions.
Parameters:

Crv: | To check for open end conditions.
--- | ---

Returned Value:

CagdBType: TRUE, if curve has open end conditions, FALSE otherwise.

Keywords:
open end conditions

## BspCrvIntegrate

(cagd_lib/cbsp_aux.c:738)
Prototype:

      CagdCrvStruct *BspCrvIntegrate(CagdCrvStruct *Crv)

Description:
Returns a new Bspline curve, equal to the integral of the given Bspline crv. The given Bspline curve should be nonrational.

##

                l            l               l       l+1
      /        /-            -      /        -   P    -
     |        | \     n      \     |  n      \    i   \              n+1
     | C(t) = | / P  B (t) = / P   | B (t) = / -----  / ( t   - t ) B   (t) =
    /        /  -  i  i      -  i /   i      - n + 1  -    j+n   j   j
               i=0          i=0             i=0     j=i+1

           l+1 j-1
            -   -
        1   \   \                 n+1
    = ----- /   / P  ( t   - t ) B   (t)
      n + 1 -   -  i    j+n   j   j
           j=1 i=0

    Parameters:

     Crv:         Curve to integrate.

    Returned Value:

      CagdCrvStruct *:   Integrated curve.

    See Also:

      BzrCrvIntegrate
      CagdCrvIntegrate

    Keywords:

      integrals

     BspCrvInterpPts   (cagd_lib/cbsp_int.c:44)

    Prototype:

      CagdCrvStruct *BspCrvInterpPts(CagdPtStruct *PtList,
                                     int Order,
                                     int CrvSize,
                                     CagdParametrizationType ParamType,
                                     CagdBType Periodic)

    Description:

Given a set of points, PtList, computes a Bspline curve of order Order that interpolates or least square approximates the set of points. The size of the control polygon of the resulting Bspline curve defaults to the number of points in PtList (if CrvSize = 0). However, this number is can smaller to yield a least square approximation. The created curve can be parametrized as specified by ParamType.
Parameters:

PtList: | List of points to interpolate/least square approximate.
--- | ---
Order: | Of interpolating/approximating curve.
CrvSize: | Number of degrees of freedom (control points) of the interpolating/approximating curve.
ParamType: | Type of parametrization.
Periodic: | Constructed curve should be Periodic. Periodic necessitates uniform knot sequence in ParamType.

Returned Value:

CagdCrvStruct *: Constructed interpolating/approximating curve.

Keywords:
interpolation least square approximation

## BspCrvInterpPtsError

(cagd_lib/cbsp_int.c:293)
Prototype:

      CagdRType BspCrvInterpPtsError(CagdCrvStruct *Crv,
                                     CagdPtStruct *PtList,
                                     CagdParametrizationType ParamType,
                                     CagdBType Periodic)

Description:
Given a set of points, and a curve least square fitting them using the BspCrvInterpPts function, computes an error measure as a the maximal distance between the curve and points (L1 norm).
Parameters:

Crv: | Curve that was fitted to the data set.
--- | ---
PtList: | The data set.
ParamType: | Parameter values at with curve should interpolate PtList.
Periodic: | Constructed curve should be Periodic. Periodic necessitates uniform knot sequence in ParamType.

Returned Value:

CagdRType: Error measured in the L1 norm.

Keywords:
error estimation interpolation least square approximation

## BspCrvInterpolate

(cagd_lib/cbsp_int.c:194)
Prototype:

      CagdCrvStruct *BspCrvInterpolate(CagdCtlPtStruct *PtList,
                                       int NumPts,
                                       CagdRType *Params,
                                       CagdRType *KV,
                                       int Length,
                                       int Order,
                                       CagdBType Periodic)

Description:
Given set of points, PtList, parameter values the curve should interpolate or approximate these points, Params, and the expected knot vector, KV, length Length and order Order of the Bspline curve, computes the Bspline curve's coefficients. All points in PtList are assumed of the same type. If Periodic, Order - 1 more constraints (and DOF's) are added so that the first Order - 1 points are the same as the last Order - 1 points.
Parameters:

PtList: | List of points to interpolate/least square approximate.
--- | ---
NumPts: | Size of PtList.
Params: | At which to interpolate the points in PtList.
KV: | Computed knot vector for the constructed curve.
Length: | Number of degrees of freedom (control points) of the interpolating/approximating curve.
Order: | Of interpolating/approximating curve.
Periodic: | Constructed curve should be Periodic.

Returned Value:

CagdCrvStruct *: Constructed interpolating/approximating curve.

Keywords:
interpolation least square approximation

## BspCrvKnotInsert

(cagd_lib/bspboehm.c:60)
Prototype:

      CagdCrvStruct *BspCrvKnotInsert(CagdCrvStruct *Crv, CagdRType t)

Description:
Returns a new curve refined at t (t is inserted as a new knot in Crv). If however the multiplicity of t in the current knot vector is equal (or greater!?) to the degree or t is not in the curve's parametric domain, no new knot is insert and NULL is returned instead. Control mesh is updated as follows (P is old ctl polygon, Q is new): Let Index be the last knot in old knot vector less than t and let j be j = Index - order + 1. Also let k be the curve order. Then,

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

##

     Case 1: Q(i) = P(i), i <= j

                    t     -    t(i)        t(i+k-1)  -   t
     case 2: Q(i) = --------------- P(i) + --------------- P(i-1), j

     Note: Altough works, this is not the optimal way to insert many knot!
     See also the BspKnotEvalAlpha set of routines.

    For more see:
    "Recursive proof of Boehm's knot insertion technique", by Phillip J Barry
    Ronald N Goldman, CAD, Volume 20 number 4 1988, pp 181-182.
    Which also references the original 1980 paper by Boehm.

    Parameters:

     Crv:      To refine by adding a new knot with value equal to t. If Crv
                 is a periodic curve, it is first unwrapped to a float end
                 condition curve.
     t:        New knot to insert into Crv.

    Returned Value:

      CagdCrvStruct *:  The refined curve.

    See Also:

      BspCrvKnotInsertNSame
      BspCrvKnotInsertNDiff
      BspSrfKnotInsert
      BspKnotEvalAlphaCoef

    Keywords:

      refinement
      knot insertion

     BspCrvKnotInsertNDiff   (cagd_lib/cbsp_aux.c:200)

    Prototype:

      CagdCrvStruct *BspCrvKnotInsertNDiff(CagdCrvStruct *Crv,
                                           CagdBType Replace,
                                           CagdRType *t, int n)

    Description:

     Inserts n knot with different values as defined by the vector t. If,
    however, Replace is TRUE, the knot are simply replacing the current knot
    vector.

    Parameters:

     Crv:        To refine by insertion (upto) n knot of value t.
     Replace:    if TRUE, the n knots in t should replace the knot vector
                   of size n of Crv. Sizes must match. If False, n new knots
                   as defined by t will be introduced into Crv.
     t:          New knots to introduce/replace knot vector of Crv.
     n:          Size of t.

    Returned Value:

      CagdCrvStruct *:   Refined Crv with n new knots.

    Keywords:

      refinement
      subdivision

     BspCrvKnotInsertNSame   (cagd_lib/cbsp_aux.c:152)

    Prototype:

      CagdCrvStruct *BspCrvKnotInsertNSame(CagdCrvStruct *Crv, CagdRType t, int n)

    Description:

     Inserts n knot, all with the value t. In no case will the multiplicity of
    a knot be greater or equal to the curve order.

    Parameters:

     Crv:        To refine by insertion (upto) n knot of value t.
     t:          Parameter value of new knot to insert.
     n:          Maximum number of times t should be inserted.

    Returned Value:

      CagdCrvStruct *:   Refined Crv with n knots of value t.

    Keywords:

      refinement
      subdivision

     BspCrvMaxCoefParam   (cagd_lib/bsp_knot.c:1027)

    Prototype:

      CagdRType BspCrvMaxCoefParam(CagdCrvStruct *Crv, int Axis, CagdRType *MaxVal)

    Description:

    Finds the parameter value with the largest coefficient of the curve using
    nodes values to estimate the coefficients' parameters.

    Parameters:

     Crv:           To compute the parameter node value of the largest
                      coefficient.
     Axis:          Which axis should we search for maximal coefficient?
                      1 for X, 2 for Y, etc.
     MaxVal:        The coefficient itself will be place herein.

    Returned Value:

      CagdRType:     The node parameter value of the detected maximal
                     coefficient.

    Keywords:

      extremum

     BspCrvNew   (cagd_lib/bsp_gen.c:129)

    Prototype:

      CagdCrvStruct *BspCrvNew(int Length, int Order, CagdPointType PType)

    Description:

      Allocates the memory required for a new Bspline curve.

    Parameters:

     Length:     Number of control points
     Order:      The order of the curve
     PType:      Type of control points (E2, P3, etc.).

    Returned Value:

      CagdCrvStruct *:   An uninitialized freeform Bspline curve.

    See Also:

      BzrCrvNew
      BspPeriodicCrvNew
      CagdCrvNew
      CagdPeriodicCrvNew
      TrimCrvNew

    Keywords:

      allocation

     BspCrvNoraml   (cagd_lib/cbsp_aux.c:615)

    Prototype:

      CagdVecStruct *BspCrvNormal(CagdCrvStruct *Crv,
                                  CagdRType t,
                                  CagdBType Normalize)

    Description:

    Returns a (unit) vector, equal to the normal of Crv at parameter value t.
      Algorithm: returns the cross product of the curve tangent and binormal.

    Parameters:

     Crv:       Crv for which to compute a (unit) normal.
     t:         The parameter at which to compute the unit normal.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the normal
                        information.

    Keywords:

      normal

     BspCrvOpenEnd   (cagd_lib/bsp_gen.c:274)

    Prototype:

      CagdCrvStruct *BspCrvOpenEnd(CagdCrvStruct *Crv)

    Description:

      Returns a curve with open end conditions, similar to given curve.
      Open end curve is computed by extracting a subregion from Crv that is
    the entire curve's parametric domain, by inserting multiple knots at the
    domain's boundary.

    Parameters:

     Crv:     To convert to a new curve with open end conditions.

    Returned Value:

      CagdCrvStruct *: Same curve as Crv but with open end conditions.

    See Also:

      BspSrfOpenEnd

    Keywords:

      open end conditions

     BspCrvSubdivAtParam   (cagd_lib/cbsp_aux.c:33)

    Prototype:

      CagdCrvStruct *BspCrvSubdivAtParam(CagdCrvStruct *Crv, CagdRType t)

    Description:

    Given a Bspline curve - subdivides it into two sub-curves at the given
    parametric value.
      Returns pointer to first curve in a list of two subdivided curves.
      The subdivision is achieved by inserting (order-1) knot at the given
    parameter value t and spliting the control polygon and knot vector at that
    location.

    Parameters:

     Crv:       To subdivide at parametr value t.
     t:         Parameter value to subdivide Crv at.

    Returned Value:

      CagdCrvStruct *:  A list of the two subdivided curves.

    Keywords:

      subdivision
      refinement

     BspCrvTangent   (cagd_lib/cbsp_aux.c:428)

    Prototype:

      CagdVecStruct *BspCrvTangent(CagdCrvStruct *Crv,
                                   CagdRType t,
                                   CagdBType Normalize)

    Description:

    Returns a (unit) vector, equal to the tangent to Crv at parameter value t.
      Algorithm: insert (order - 1) knots and return control polygon tangent.

    Parameters:

     Crv:       Crv for which to compute a (unit) tangent.
     t:         The parameter at which to compute the unit tangent.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the tangent
                        information.

    Keywords:

      tangent

     BspKnotAffineTrans   (cagd_lib/bsp_knot.c:481)

    Prototype:

      void BspKnotAffineTrans(CagdRType *KnotVector,
                              int Len,
                              CagdRType Translate,
                              CagdRType Scale)

    Description:

    Applies an affine transformation to the given knot vector. Note affine
    transformation on the knot vector does not change the Bspline curve.
      Knot vector is translated by Translate amount and scaled by Scale as

     KV[i] = (KV[i] - KV[0]) * Scale + (KV0 + Translate).

      All transformation as taken place in place.

    Parameters:

     KnotVector:     To affinely transform.
     Len:            Of knot vector. This is not the length of the curve or
                       surface using this knot vector.
     Translate:      Amount to translate the knot vector.
     Scale:          Amount to scale the knot vector.

    Returned Value:

      void

    See Also:

      BspKnotScale
      BspKnotAffineTrans2

    Keywords:

      knot vectors
      affine transformation

     BspKnotAffineTrans2   (cagd_lib/bsp_knot.c:519)

    Prototype:

      void BspKnotAffineTrans2(CagdRType *KnotVector,
                               int Len,
                               CagdRType MinVal,
                               CagdRType MaxVal)

    Description:

    Applies an affine transformation to the given knot vector. Note affine
    transformation on the knot vector does not change the Bspline curve.
      Knot vector is translated and scaled so as to span the domain from
    MinVal top MaxVal. This works for open end condition curves only.

     KV[i] = (KV[i] - KV[0]) * Scale + MinVal,

    where Scale = (MaxVal - MinVal) / (KV[Len - 1] - KV[0]).
      All transformation as taken place in place.

    Parameters:

     KnotVector:     To affinely transform.
     Len:            Of knot vector. This is not the length of the curve or
                       surface using this knot vector.
     MinVal, MaxVal:  ew parametric domain of knot vector.

    Returned Value:

      void

    See Also:

      BspKnotScale
      BspKnotAffineTrans

    Keywords:

      knot vectors
      affine transformation

     BspKnotAllC1Discont   (cagd_lib/bsp_knot.c:1311)

    Prototype:

      CagdRType *BspKnotAllC1Discont(CagdRType *KnotVector,
                                     int Order,
                                     int Length,
                                     int *n)

    Description:

    Scans the given knot vector for all potential C1 discontinuity. Returns
    a vector holding the parameter values of the potential C1 discontinuities,
    NULL of none found.
      Sets n to length of returned vector.
      Assumes knot vector has open end condition.
      A knot vector with multiplicity of a knot of (Order - 1) can be C1
    discontinuous at that knot. However, this is only a necessary condition
    for C1 discontinuity in the geometry.

    Parameters:

     KnotVector:    To test for potential C1 dicontinuities.
     Order:         Of geometry that exploits KnotVector.
     Length:        Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     n:             Length of returned vector - number of potential C1
                      discontinuities found.

    Returned Value:

      CagdRType *:   Vector holding all parametr values with potential C1
                     discontinuities.

    Keywords:

      knot vectors
      continuity
      discontinuity

     BspKnotAverage   (cagd_lib/bsp_knot.c:843)

    Prototype:

      CagdRType *BspKnotAverage(CagdRType *KnotVector, int Len, int Ave)

    Description:

    Creates a new knot vector from the given KnotVector that averages Ave
    consequetive knots.
     Resulting vector will have (Len - Ave + 1) elements.

    Parameters:

     KnotVector:    To average out.
     Len:           Length of KnotVector. This is not the length of the
                      curve or surface using this knot vector.
     Ave:           How many knots to average each time.

    Returned Value:

      CagdRType *:   The averaged knot vector of length (Len - Ave + 1).

    See Also:

      BspKnotNodes

    Keywords:

      knot vectors
      node values

     BspKnotC1Discont   (cagd_lib/bsp_knot.c:1259)

    Prototype:

      CagdBType BspKnotC1Discont(CagdRType *KnotVector,
                                 int Order,
                                 int Length,
                                 CagdRType *t)

    Description:

    Scans the given knot vector to a potential C1 discontinuity.
      Returns TRUE if found one and set t to its parameter value.
      Assumes knot vector has open end condition.
      A knot vector with multiplicity of a knot of (Order - 1) can be C1
    discontinuous at that knot. However, this is only a necessary condition
    for C1 discontinuity in the geometry.

    Parameters:

     KnotVector:    To test for potential C1 dicontinuities.
     Order:         Of geometry that exploits KnotVector.
     Length:        Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     t:             Where to put the parameter value (knot) that can be C2
                      discontinuous.

    Returned Value:

      CagdBType:     TRUE if found a potential C1 discontinuity, FALSE
                     otherwise.

    Keywords:

      knot vectors
      continuity
      discontinuity

     BspKnotContinuityMergeTwo   (cagd_lib/bsp_knot.c:756)

    Prototype:

      CagdRType *BspKnotContinuityMergeTwo(CagdRType *KnotVector1,
                                           int Len1,
                                           int Order1,
                                           CagdRType *KnotVector2,
                                           int Len2,
                                           int Order2,
                                           int ResOrder,
                                           int *NewLen)

    Description:

    Merges two knot vector KnotVector1 and KnotVector2 of length Len1 and Len2
    respectively into one, from geometries of orders Order1 and Order2.
      Merged knot vector is for order ResOrder so that the resulting curve can
    represent the discontinuities in both geometries.
      Assumes both knot vectors are open end spanning the same domain.

    Parameters:

     KnotVector1:   First  knot vector.
     Len1:          Length of KnotVector1. This is not the length of the
                      curve or surface using this knot vector.
     Order1:        Order of first knot vector's geometry.
     KnotVector2:   Second knot vector.
     Len2:          Length of KnotVector2. This is not the length of the
                      curve or surface using this knot vector.
     Order2:        Order of secon knot vector's geometry.
     ResOrder:      Expected order of geometry that will use the merged
                      knot vector.
     NewLen:        To save the size of the knot vector that contains the
                      merged knot vectors.

    Returned Value:

      CagdRType *:   The merged knot verctor (KnotVector1 U KnotVector2).

    Keywords:

      knot vectors
      compatibility
      refinement

     BspKnotCopy   (cagd_lib/bsp_knot.c:546)

    Prototype:

      CagdRType *BspKnotCopy(CagdRType *KnotVector, int Len)

    Description:

    Creates an identical copy of a given knot vector KnotVector of length Len.

    Parameters:

     KnotVector:   Knot vector to duplicate
     Len:          Length of knot vector. This is not the length of the curve
                     or surface using this knot vector.

    Returned Value:

      CagdRType *:  The duplicated knot vector.

    Keywords:

      allocation
      knot vectors

     BspKnotEvalAlphaCoef   (cagd_lib/cagdoslo.c:77)

    Prototype:

      BspKnotAlphaCoeffType *BspKnotEvalAlphaCoef(int k,
                                                  CagdRType *KVT,
                                                  int LengthKVT,
                                                  CagdRType *KVt,
                                                  int LengthKVt)

    Description:

    Computes the values of the alpha coefficients, Ai,k(j) of order k:

            n              n    m                   m    n
            _              _    _                   _    _
     C(t) = \ Pi Bi,k(t) = \ Pi \ Ai,k(j) Nj,k(t) = \  ( \ Pi Ai,k(j) ) Nj,k(t)
            /              /    /                   /    /
            -              -    -                   -    -
           i=0            i=0  j=0                 j=0  i=0

    Let T be the original knot vector and let t be the refined one, i.e. T is
    a subset of t.
      The Ai,k(j) are computed from the following recursive definition:

                1, T(i) <= t(i) < T(i+1)
              /
    Ai,1(j) =
              \
                0, otherwise.

              T(j+k-1) - T(i)             T(i+k) - T(j+k-1)
    Ai,k(j) = --------------- Ai,k-1(j) + --------------- Ai+1,k-1(j)
              T(i+k-1) - T(i)             T(i+k) - T(i+1)

    LengthKVT + k is the length of KVT and similarly LengthKVt + k is the
    length of KVt. In other words, LengthKVT and LengthKVt are the control
    points len...

    The output matrix has LengthKVT rows and LengthKVt columns (#cols > #rows)
    ColIndex/Length hold LengthKVt pairs of first non zero scalar and length of
    non zero values in that column, so not all LengthKVT scalars are blended.

    Parameters:

     k:           Order of geometry.
     KVT:         Original knot vector.
     LengthKVT:   Length of original control polygon with KVT knot vector.
     KVt:         Refined knot vector. Must contain all knots of KVT.
     LengthKVt:   Length of refined control polygon with KVt knot vector.

    Returned Value:

      BspKnotAlphaCoeffType *:   A matrix to multiply the coefficients of the
                                 geometry using KVT, in order to get the
                                 coefficients under the space defined using
                                 KVt that represent the same geometry.

    See Also:

      BspKnotFreeAlphaCoef
      BspKnotEvalAlphaCoefMerge
      BspCrvKnotInsert

      BspSrfKnotInsert

    Keywords:

      alpha matrix
      refinement

     BspKnotEvalAlphaCoefMerge   (cagd_lib/cagdoslo.c:205)

    Prototype:

      BspKnotAlphaCoeffType *BspKnotEvalAlphaCoefMerge(int k,
                                                       CagdRType *KVT,
                                                       int LengthKVT,
                                                       CagdRType *NewKV,
                                                       int LengthNewKV)

    Description:

    Same as EvalAlphaCoef but the new knot set NewKV is merged with KVT to
    form the new knot vector KVt.

    Parameters:

     k:           Order of geometry.
     KVT:         Original knot vector.
     LengthKVT:   Length of original knot vector.
     NewKV:       A sequence of new knots to introduce into KVT.
     LengthNewKV:  ength of new knot sequence.

    Returned Value:

      BspKnotAlphaCoeffType *:   A matrix to multiply the coefficients of the
                                 geometry using KVT, in order to get the
                                 coefficients under the space defined using
                                 KVt that represent the same geometry.

    See Also:

      BspKnotFreeAlphaCoef
      BspKnotEvalAlphaCoef
      BspCrvKnotInsert

      BspSrfKnotInsert

    Keywords:

      alpha matrix
      refinement

     BspKnotFindMult   (cagd_lib/bsp_knot.c:1216)

    Prototype:

      int BspKnotFindMult(CagdRType *KnotVector, int Order, int Len, CagdRType t)

    Description:

    Returns the multiplicity of knot t in knot vector KnotVector, zero if
    none.

    Parameters:

     KnotVector:    To test multiplicity of knot value t at.
     Order:         Of geometry that exploits KnotVector.
     Len:           Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     t:             The knot to verify the multiplicity of.

    Returned Value:

      int:           Multiplicity of t in KnotVector.

    Keywords:

      knot vectors

     BspKnotFirstIndexG   (cagd_lib/bsp_knot.c:294)

    Prototype:

      int BspKnotFirstIndexG(CagdRType *KnotVector, int Len, CagdRType t)

    Description:

    Returns the index of the first knot which is greater than t in the given
    knot vector KnotVector of length Len. APX_EQ_EPS is used for equality.
      Parameter t is assumed to be in the parametric domain for the knot
    vector.

    Parameters:

     KnotVector:    To search for a knot with the G relation to t.
     Len:           Of knot vector. This is not the length of the
                      curve/surface using this KnotVector.
     t:             The parameter value to search for the G relation.

    Returned Value:

      int:           Index of first knot in KnotVector that is greater than t
                     or Len if t is greater than last knot in KnotVector.

    Keywords:

      knot vectors

     BspKnotFreeAlphaCoef   (cagd_lib/cagdoslo.c:167)

    Prototype:

      void BspKnotFreeAlphaCoef(BspKnotAlphaCoeffType *A)

    Description:

    Frees the BspKnotAlphaCoeffType data structrure.

    Parameters:

     A:      Alpha matrix to free.

    Returned Value:

      void

    See Also:

      BspKnotEvalAlphaCoef
      BspKnotEvalAlphaCoefMerge
      BspCrvKnotInsert

      BspSrfKnotInsert

    Keywords:

      alpha matrix
      refinement

     BspKnotHasBezierKV   (cagd_lib/bsp_knot.c:71)

    Prototype:

      CagdBType BspKnotHasBezierKV(CagdRType *KnotVector, int Len, int Order)

    Description:

    Returns TRUE iff the given knot vector has no interior knots and it has
    an open end cond.

    Parameters:

     KnotVector:   To check for open end and no interior knots conditions.
     Len:          Of knot vector.
     Order:        Of curve/surface the exploits this knot vector.

    Returned Value:

      CagdBType:    TRUE if has open end conditions and no interior knots,
                    FALSE otherwise.

    Keywords:

      knot vectors
      conversion

     BspKnotHasOpenEC   (cagd_lib/bsp_knot.c:159)

    Prototype:

      CagdBType BspKnotHasOpenEC(CagdRType *KnotVector, int Len, int Order)

    Description:

    Returns TRUE iff the given knot vector has open end conditions.

    Parameters:

     KnotVector:   To check for open end condition.
     Len:          Of knot vector.
     Order:        Of curve/surface the exploits this knot vector.

    Returned Value:

      CagdBType:     TRUE if KV has open end conditions.

    Keywords:

      knot vectors
      open end conditions

     BspKnotInsertMult   (cagd_lib/bsp_knot.c:1168)

    Prototype:

      CagdRType *BspKnotInsertMult(CagdRType *KnotVector,
                                   int Order,
                                   int *Len,
                                   CagdRType t,
                                   int Mult)

    Description:

    Inserts Mult knots with value t into the knot vector KnotVector.
      Attempt is made to make sure t in knot vector domain.
      If a knot equal to t (up to APX_EQ) already exists with multiplicity i
    only (Mult - i) knot are being inserted into the new knot vector.
      Len is updated to the resulting knot vector.
      It is possible to DELETE a knot using this routine by specifying
    multiplicity less then current multiplicity!
      This function only constructs a refined knot vector and does not
    compute the actual refined coefficients.

    Parameters:

     KnotVector:    To insert new knot t in.
     Order:         Of geometry that exploits KnotVector.
     Len:           Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     t:             The new knot t to insert.
     Mult:          The multiplicity that this knot should have in resulting
                      knot vector.

    Returned Value:

      CagdRType *:   A new knot vector derived from KnotVector that has
                     a mltiplicity of exacly Mult at the knot t.

    Keywords:

      knot vectors
      knot insertion
      refinement

     BspKnotInsertOne   (cagd_lib/bsp_knot.c:1129)

    Prototype:

      CagdRType *BspKnotInsertOne(CagdRType *KnotVector,
                                  int Order,
                                  int Len,
                                  CagdRType t)

    Description:

      Creates a new vector with t inserted as a new knot. Attempt is made to
    make sure t is in the knot vector domain.
      No test is made for the current multiplicity of knot t in KnotVector.
      This function only constructs a refined knot vector and does not
    compute the actual refined coefficients.

    Parameters:

     KnotVector:    To insert new knot t in.
     Order:         Of geometry that exploits KnotVector.
     Len:           Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     t:             The new knot t to insert.

    Returned Value:

      CagdRType *:   A new knot vector larger by one than KnotVector that
                     contains t.

    Keywords:

      knot vectors
      knot insertion
      refinement

     BspKnotLastIndexL   (cagd_lib/bsp_knot.c:261)

    Prototype:

      int BspKnotLastIndexL(CagdRType *KnotVector, int Len, CagdRType t)

    Description:

    Returns the index of the last knot which is less t in the given knot
    vector KnotVector of length Len. APX_EQ_EPS is used for equality.
      Parameter t is assumed to be in the parametric domain for the knot
    vector.

    Parameters:

     KnotVector:    To search for a knot with the L relation to t.
     Len:           Of knot vector. This is not the length of the
                      curve/surface using this KnotVector.
     t:             The parameter value to search for the L relation.

    Returned Value:

      int:           Index of last knot in KnotVector that is less than t or
                     -1 if t is below the first knot.

    Keywords:

      knot vectors

     BspKnotLastIndexLE   (cagd_lib/bsp_knot.c:229)

    Prototype:

      int BspKnotLastIndexLE(CagdRType *KnotVector, int Len, CagdRType t)

    Description:

    Returns the index of the last knot which is less than or equal to t in the
    given knot vector KnotVector of length Len. APX_EQ_EPS is used in equality.
      Parameter t is assumed to be in the parametric domain for the knot
    vector.

    Parameters:

     KnotVector:    To search for a knot with the LE relation to t.
     Len:           Of knot vector. This is not the length of the
                      curve/surface using this KnotVector.
     t:             The parameter value to search for the LE relation.

    Returned Value:

      int:           Index of last knot in KnotVector that is LE t, or -1 if
                     t is below the first knot.

    Keywords:

      knot vectors

     BspKnotMakeRobustKVm knot vectors   (cagd_lib/bsp_knot.c:1444)

    Prototype:

      void BspKnotMakeRobustKV(CagdRType *KV, int Len)

    Description:

    Given a knot vector, make sure adjacent knots that are close "enough" are
    actually identical. Important for robustness of subdiv/refinement algs.

    Parameters:

     KV:        Knot vector to make robust, in place.
     Len:       Length of knot vector KV.

    Returned Value:

      void

    Keywords:

     BspKnotMergeTwo   (cagd_lib/bsp_knot.c:673)

    Prototype:

      CagdRType *BspKnotMergeTwo(CagdRType *KnotVector1,
                                 int Len1,
                                 CagdRType *KnotVector2,
                                 int Len2,
                                 int Mult,
                                 int *NewLen)

    Description:

    Merges two knot vector KnotVector1 and KnotVector2 of length Len1 and Len2
    respectively into one. If Mult is not zero then knot multiplicity is
    tested not to be larger than Mult value.
      NewLen is set to new KnotVector length.

    Parameters:

     KnotVector1:   First  knot vector.
     Len1:          Length of KnotVector1. This is not the length of the
                      curve or surface using this knot vector.
     KnotVector2:   Second knot vector.
     Len2:          Length of KnotVector2. This is not the length of the
                      curve or surface using this knot vector.
     Mult:          Maximum multiplicity to allow in merged knot vector.
     NewLen:        To save the size of the knot vector that contains the
                      merged knot vectors.

    Returned Value:

      CagdRType *:   The merged knot verctor (KnotVector1 U KnotVector2).

    Keywords:

      knot vectors
      compatibility
      refinement

     BspKnotNodes   (cagd_lib/bsp_knot.c:900)

    Prototype:

      CagdRType *BspKnotNodes(CagdRType *KnotVector, int Len, int Order)

    Description:

    Creates a new vector with the given KnotVector Node values. The given
    knot vector is assumed to have open end conditions.
      The nodes are the approximated parametric value associated with the each
    control point. Therefore for a knot vector of length Len and order Order
    there are Len - Order control points and therefore nodes.
      Nodes are defined as (k = Order - 1 or degree):

            i+k
             -                            First Node N(i = 0)
             \
             / KnotVector(j)              Last Node  N(i = Len - k - 2)
             -
           j=i+1
    N(i) = -----------------
                  k

    Parameters:

     KnotVector:    To average out as nodes.
     Len:           Length of KnotVector. This is not the length of the
                      curve or surface using this knot vector.
     Order:         Of curve or surface that exploits this knot vector.

    Returned Value:

      CagdRType *:   The nodes computed for the given knot vector.

    See Also:

      BspKnotAverage

    Keywords:

      knot vectors
      node values

     BspKnotParamInDomain   (cagd_lib/bsp_knot.c:199)

    Prototype:

      CagdBType BspKnotParamInDomain(CagdRType *KnotVector,
                                     int Len,
                                     int Order,
                                     CagdBType Periodic,
                                     CagdRType t)

    Description:

    Returns TRUE iff t is in the parametric domain as define by the knot
    vector KnotVector, its length Len, and the order Order.

    Parameters:

     KnotVector:    To verify t is indeed in.
     Len:           Length of curve/surface using KnotVector. This is NOT the
                      length of KnotVector which is equal to (Length + Order).
     Order:         Order of curve/surface using KnotVector.
     Periodic:      TRUE if this KnotVector is periodic.
     t:             Parametric value to verify.

    Returned Value:

      CagdBType:    TRUE, if t is contained in the parametric domain, FALSE
                    otherwise.

    Keywords:

      parametric domain
      knot vectors

     BspKnotParamValues   (cagd_lib/bsp_knot.c:1368)

    Prototype:

      CagdRType *BspKnotParamValues(CagdRType PMin,
                                    CagdRType PMax,
                                    int NumSamples,
                                    CagdRType *C1Disconts,
                                    int NumC1Disconts)

    Description:

     Routine to determine where to sample along the provided paramtric domain,
    given the C1 discontinuities along it.
      Returns a vector of length NumSamples.
      If C1Disconts != NULL (NumC1Disconts > 0), C1Discont is being freed.

    Parameters:

     PMin:            Minimum of parametric domain.
     PMax:            Maximum of parametric domain.
     NumSamples:      To allocate for the vector of samples.
     C1Disconts:      A vector of potential C1 discontinuities in the
                        (PMin, PMax) domain. This vector is freed by this
                        routine, if it is not NULL.
     NumC1Disconts:   Length of C1Discont. if zero then C1Discont == NULL.

    Returned Value:

      CagdRType *:    A vector of the suggested set of sampling locations.

    Keywords:

      piecewise linear approximation
      knot vectors

     BspKnotPrepEquallySpaced   (cagd_lib/cagdoslo.c:242)

    Prototype:

      CagdRType *BspKnotPrepEquallySpaced(int n, CagdRType Tmin, CagdRType Tmax)

    Description:

    Prepares a refinement vector for the given knot vector domain with n
    inserted knots equally spaced.

    Parameters:

     n:       Number of knots to introduce.
     Tmin:    Minimum domain to introduce knots.
     Tmax:    Maximum domain to introduce knots.

    Returned Value:

      CagdRType *: A vector of n knots uniformly spaced between TMin and TMax.

    Keywords:

      refinement

     BspKnotReverse   (cagd_lib/bsp_knot.c:577)

    Prototype:

      CagdRType *BspKnotReverse(CagdRType *KnotVector, int Len)

    Description:

    Reverse a knot vector of length Len.  Reversing of knot vector keeps the
    knots monotonically non-decreasing as well as the parametric domain. Only
    the spaces between the knots are being flipped. For example the knot
    vector:

                           [0 0 0 0 1 2 2 6 6 6 6]

    is reversed to be:

                           [0 0 0 0 4 4 5 6 6 6 6]

    Parameters:

     KnotVector:   Knot vector to be reversed.
     Len:          Length of knot vector. This is not the length of the curve
                     or surface using this knot vector.

    Returned Value:

      CagdRType *:  The reversed knot vector.

    Keywords:

      knot vectors
      reverse

     BspKnotScale   (cagd_lib/bsp_knot.c:446)

    Prototype:

      void BspKnotScale(CagdRType *KnotVector, int Len, CagdRType Scale)

    Description:

    Applies a scale transformation to the given knot vector. Note scale
    transformation on the knot vector does not change the Bspline curve.
      Knot vector is scaled by Scale as KV[i] = KV[i] * Scale.
      Scaling is taken place in place.

    Parameters:

     KnotVector:     To affinely transform.
     Len:            Of knot vector. This is not the length of the curve or
                       surface using this knot vector.
     Scale:          Amount to scale the knot vector.

    Returned Value:

      void

    See Also:

      BspKnotAffineTrans
      BspKnotAffineTrans2

    Keywords:

      knot vectors
      affine transformation

     BspKnotSubtrTwo   (cagd_lib/bsp_knot.c:617)

    Prototype:

      CagdRType *BspKnotSubtrTwo(CagdRType *KnotVector1,
                                 int Len1,
                                 CagdRType *KnotVector2,
                                 int Len2,
                                 int *NewLen)

    Description:

    Returns a knot vector that contains all the knots in KnotVector1 that are
    not in KnotVector2.
      NewLen is set to new KnotVector length.

    Parameters:

     KnotVector1:   First  knot vector.
     Len1:          Length of KnotVector1. This is not the length of the
                      curve or surface using this knot vector.
     KnotVector2:   Second knot vector.
     Len1:          Length of KnotVector2. This is not the length of the
                      curve or surface using this knot vector.
     NewLen:        To save the size of the knot vector that contains the
                      computed subset of KnotVector1 / KnotVector2.

    Returned Value:

      CagdRType *:   The subset of knot in KnotVector1 that are not in
                     KnotVector2 (KnotVector1 / KnotVector2).

    Keywords:

      knot vectors
      compatibility
      refinement

     BspKnotUniformFloat   (cagd_lib/bsp_knot.c:365)

    Prototype:

      CagdRType *BspKnotUniformFloat(int Len, int Order, CagdRType *KnotVector)

    Description:

    Returns a uniform floating knot vector for Len Control points and order
    Order. The actual length of the KV is Len + Order.
    If KnotVector is NULL it is being allocated dynamically.

    Parameters:

     Len:          Of control polygon/mesh of curve/surface that are to use
                     this knot vector.
     Order:        Of the curve/surface that are to use this knot vector.
     KnotVector:   If new knot vector is to be saved here, otherwise a new
                     space is allocated.

    Returned Value:

      CagdRType *:  The created uniform floating knot vector, either newly
                    allocated or given in Knotvector and just initialized.

    Keywords:

      knot vectors
      floating end conditions
      end conditions

     BspKnotUniformOpen   (cagd_lib/bsp_knot.c:403)

    Prototype:

      CagdRType *BspKnotUniformOpen(int Len, int Order, CagdRType *KnotVector)

    Description:

    Returns a uniform open knot vector for Len Control points and order
    Order. The actual length of the KV is Len + Order.
    If KnotVector is NULL it is being allocated dynamically.

    Parameters:

     Len:          Of control polygon/mesh of curve/surface that are to use
                     this knot vector.
     Order:        Of the curve/surface that are to use this knot vector.
     KnotVector:   If new knot vector is to be saved here, otherwise a new
                     space is allocated.

    Returned Value:

      CagdRType *:  The created uniform open knot vector, either newly
                    allocated or given in Knotvector and just initialized.

    Keywords:

      knot vectors
      open end conditions
      end conditions

     BspKnotUniformPeriodic   (cagd_lib/bsp_knot.c:327)

    Prototype:

      CagdRType *BspKnotUniformPeriodic(int Len, int Order, CagdRType *KnotVector)

    Description:

    Returns a uniform periodic knot vector for Len Control points and order
    Order. The actual length of the KV is Len + Order + Order - 1.
    If KnotVector is NULL it is being allocated dynamically.

    Parameters:

     Len:          Of control polygon/mesh of curve/surface that are to use
                     this knot vector.
     Order:        Of the curve/surface that are to use this knot vector.
     KnotVector:   If new knot vector is to be saved here, otherwise a new
                     space is allocated.

    Returned Value:

      CagdRType *:  The created uniform periodic knot vector, either newly
                    allocated or given in Knotvector and just initialized.

    Keywords:

      knot vectors
      periodic end conditions
      end conditions

     BspMakeReparamCurve   (cagd_lib/cbsp_int.c:423)

    Prototype:

      CagdCrvStruct *BspMakeReparamCurve(CagdPtStruct *PtsList,
                                         int Order,
                                         int DegOfFreedom)

    Description:

      Computes a reparametrization scalar Bspline curve, y(x), so that each at
    each point in PtsList, the curve parameter value of X is evaluated into Y.

    Parameters:

     PtsList:       List of points on the reparametrization curve.
     Order:         of reparametrization curve.
     DegOfFreedom:  of reparametrization curve (== number of coefficients).

    Returned Value:

      CagdCrvStruct *:  Result of reparametrization curve, computed using
                   list squares fit.

    See Also:

      BspCrvInterpolate

    Keywords:

     BspPeriodicCrvNew   (cagd_lib/bsp_gen.c:172)

    Prototype:

      CagdCrvStruct *BspPeriodicCrvNew(int Length,
                                       int Order,
                                       CagdBType Periodic,
                                       CagdPointType PType)

    Description:

      Allocates the memory required for a new, possibly periodic, Bspline
    curve.

    Parameters:

     Length:     Number of control points
     Order:      The order of the curve
     Periodic:   Is this curve periodic?
     PType:      Type of control points (E2, P3, etc.).

    Returned Value:

      CagdCrvStruct *:   An uninitialized freeform Bspline curve. If Periodic
                         is FALSE, this function is identical to BspCrvNew.

    See Also:

      BzrCrvNew
      BspCrvNew
      CagdCrvNew
      CagdPeriodicCrvNew
      TrimCrvNew

    Keywords:

      allocation

     BspPeriodicSrfNew   (cagd_lib/bsp_gen.c:88)

    Prototype:

      CagdSrfStruct *BspPeriodicSrfNew(int ULength,
                                       int VLength,
                                       int UOrder,
                                       int VOrder,
                                       CagdBType UPeriodic,
                                       CagdBType VPeriodic,
                                       CagdPointType PType)

    Description:

      Allocates the memory required for a new, possibly periodic, Bspline
    surface.

    Parameters:

     ULength:      Number of control points in the U direction.
     VLength:      Number of control points in the V direction.
     UOrder:       The order of the surface in the U direction.
     VOrder:       The order of the surface in the V direction.
     UPeriodic:    Is this surface periodic in the U direction?
     VPeriodic:    Is this surface periodic in the V direction?
     PType:        Type of control points (E2, P3, etc.).

    Returned Value:

      CagdSrfStruct *:   An uninitialized freeform Bspline surface. If both
                         UPeriodic and VPeriodic are FALSE, this function is
                         identical to BspSrfNew.

    See Also:

      BspSrfNew
      BzrSrfNew
      CagdSrfNew
      CagdPeriodicSrfNew
      TrimSrfNew

    Keywords:

      allocation

     BspSrf2Curves   (cagd_lib/bsp2poly.c:549)

    Prototype:

      CagdCrvStruct *BspSrf2Curves(CagdSrfStruct *Srf, int NumOfIsocurves[2])

    Description:

      Routine to extract from a Bspline surface NumOfIsoline isocurve list
    in each param. direction.
      Iso parametric curves are sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise list of CagdCrvStruct.

    Parameters:

     Srf:             To extract isoparametric curves from.
     NumOfIsocurves:  In each (U or V) direction.

    Returned Value:

      CagdCrvStruct *:  List of extracted isoparametric curves. These curves
                        inherit the order and continuity of the original Srf.
                        NULL is returned in case of an error.

    See Also:

      BspSrf22Polylines
      BzrSrf2PCurves
      SymbSrf2Curves

    Keywords:

      curves
      isoparametric curves

     BspSrf2PolygonSetErrFunc   (cagd_lib/bsp2poly.c:32)

    Prototype:

      CagdSrfErrorFuncType BspSrf2PolygonSetErrFunc(CagdSrfErrorFuncType Func)

    Description:

      Sets the surface approximation error function.  The error function
    will return a negative value if this patch must be purged or otherwise a
    non negative error measure.

    Parameters:

     Func:        New function to use, NULL to disable.

    Returned Value:

      CagdPlErrorFuncType:  Old value of function.

    See Also:

      BspSrf2Polygons

    Keywords:

     BspSrf2Polygons   (cagd_lib/bsp2poly.c:76)

    Prototype:

      CagdPolygonStruct *BspSrf2Polygons(CagdSrfStruct *Srf,
                                         int FineNess,
                                         CagdBType ComputeNormals,
                                         CagdBType FourPerFlat,
                                         CagdBType ComputeUV)

    Description:

      Routine to convert a single Bspline surface to set of triangles
    approximating it. FineNess is a fineness control on result and the larger
    is more triangles may result. A value of 10 is a good start value.
    NULL is returned in case of an error, otherwise list of CagdPolygonStruct.
      This routine looks for C1 discontinuities in the surface and splits it
    into C1 continuous patches to invoke BspC1Srf2Polygons to gen. polygons.

    Parameters:

     Srf:              To approximate into triangles.
     FineNess:         Control on accuracy, the higher the finer.
     ComputeNormals:   If TRUE, normal information is also computed.
     FourPerFlat:      If TRUE, four triangles are created per flat surface.
                         If FALSE, only 2 triangles are created.
     ComputeUV:        If TRUE, UV values are stored and returned as well.

    Returned Value:

      CagdPolygonStruct *:  A list of polygons with optional normal and/or
                            UV parametric information.
                            NULL is returned in case of an error.

    See Also:

      BspSrf2PolygonSetErrFunc
      BzrSrf2Polygons
      IritSurface2Polygons

      IritTrimSrf2Polygons
      SymbSrf2Polygons
      TrimSrf2Polygons

      BspC1Srf2Polygons
      CagdSrf2Polygons

    Keywords:

      polygonization
      surface approximation

     BspSrf2Polylines   (cagd_lib/bsp2poly.c:399)

    Prototype:

      CagdPolylineStruct *BspSrf2Polylines(CagdSrfStruct *Srf,
                                           int NumOfIsocurves[2],
                                           int SamplesPerCurve)

    Description:

      Routine to convert a single Bspline surface to NumOfIsolines polylines
    in each parametric direction with SamplesPerCurve in each isoparametric
    curve.
      Polyline are always E3 of CagdPolylineStruct type.
      Iso parametric curves are sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise list of
    CagdPolylineStruct. Attempt is made to extract isolines along C1
    discontinuities first.

    Parameters:

     Srf:                 Srf to extract isoparametric curves from.
     NumOfIsocurves:      To extarct from Srf in each (U or V) direction.
     SamplesPerCurve:     Fineness control on piecewise linear curve
                            approximation.

    Returned Value:

      CagdPolylineStruct *: List of polygons representing a piecewise linear
                            approximation of the extracted isoparamteric
                            curves or NULL is case of an error.

    See Also:

      BspCrv2Polyline
      BzrSrf2Polylines
      IritSurface2Polylines

      IritTrimSrf2Polylines
      SymbSrf2Polylines
      TrimSrf2Polylines
      CagdSrf2Polylines

    Keywords:

      polylines
      isoparametric curves

     BspSrfCrvFromMesh   (cagd_lib/sbspeval.c:301)

    Prototype:

      CagdCrvStruct *BspSrfCrvFromMesh(CagdSrfStruct *Srf,
                                       int Index,
                                       CagdSrfDirType Dir)

    Description:

    Extracts a curve from the mesh of a tensor product Bspline surface Srf in
    direction Dir at index Index.

    Parameters:

     Srf:       To extract a curve from.
     Index:     Index along the mesh of Srf to extract the curve from.
     Dir:       Direction of extracted curve. Either U or V.

    Returned Value:

      CagdCrvStruct *:   A curve from Srf. This curve inherit the order and
                         continuity of surface Srf in direction Dir. However,
                         thiscurve is not on surface Srf, in general.

    See Also:

      CagdCrvFromSrf
      BzrSrfCrvFromSrf
      BspSrfCrvFromSrf

      CagdCrvFromMesh
      BzrSrfCrvFromMesh

    Keywords:

      isoparametric curves
      curve from mesh

     BspSrfCrvFromSrf   (cagd_lib/sbspeval.c:217)

    Prototype:

      CagdCrvStruct *BspSrfCrvFromSrf(CagdSrfStruct *Srf,
                                      CagdRType t,
                                      CagdSrfDirType dir)

    Description:

    Extracts an isoparametric curve out of the given tensor product Bspline
    surface in direction Dir at the parameter value of t.
      Operations should prefer the CONST_U_DIR, in which the extraction is
    somewhat faster if that is possible.

    Parameters:

     Srf:       To extract an isoparametric ocurve from.
     t:         Parameter value of extracted isoparametric curve.
     dir:       Direction of the isocurve on the surface. Either U or V.

    Returned Value:

      CagdCrvStruct *:  An isoparametric curve of Srf. This curve inherits the
                        order and continuity of surface Srf in direction Dir.

    See Also:

      CagdCrvFromSrf
      BzrSrfCrvFromSrf
      CagdCrvFromMesh
      BzrSrfCrvFromMesh

      BspSrfCrvFromMesh

    Keywords:

      isoparametric curves
      curve from surface

     BspSrfDegreeRaise   (cagd_lib/sbsp_aux.c:563)

    Prototype:

      CagdSrfStruct *BspSrfDegreeRaise(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns a new Bspline surface, identical to the original but with one
    degree higher, in the requested direction Dir.

    Parameters:

     Srf:        To raise it degree by one.
     Dir:        Direction of degree raising. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A surface with one degree higher in direction Dir,
                        representing the same geometry as Srf.

    See Also:

      CagdSrfDegreeRaise
      BzrSrfDegreeRaise
      TrimSrfDegreeRaise

    Keywords:

      degree raising

     BspSrfDerive   (cagd_lib/sbsp_aux.c:730)

    Prototype:

      CagdSrfStruct *BspSrfDerive(CagdSrfStruct *Srf,
                                  CagdSrfDirType Dir)

    Description:

    Returns a new surface equal to the given surface, differentiated once in
    the direction Dir.
      Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:

    Q(i) = (k - 1) * (P(i+1) - P(i)) / (Kv(i + k) - Kv(i + 1)), i = 0 to k-2.

    This is applied to all rows/cols of the surface.

    Parameters:

     Srf:        To differentiate.
     Dir:        Direction of differentiation. Either U or V.

    Returned Value:

      CagdSrfStruct *:   Differentiated surface.

    See Also:

      CagdSrfDerive
      BzrSrfDerive
      BzrSrfDeriveRational
      BspSrfDeriveRational

    Keywords:

      derivatives
      partial derivatives

     BspSrfDomain   (cagd_lib/bsp_gen.c:242)

    Prototype:

      void BspSrfDomain(CagdSrfStruct *Srf,
                        CagdRType *UMin,
                        CagdRType *UMax,
                        CagdRType *VMin,
                        CagdRType *VMax)

    Description:

      Returns the parametric domain of a Bspline surface.

    Parameters:

     Srf:       To get its parametric domain.
     UMin:      Where to put the minimal U domain's boundary.
     UMax:      Where to put the maximal U domain's boundary.
     VMin:      Where to put the minimal V domain's boundary.
     VMax:      Where to put the maximal V domain's boundary.

    Returned Value:

      void

    See Also:

      CagdSrfDomain
      TrimSrfDomain

    Keywords:

      domain
      parametric domain

     BspSrfEvalAtParam   (cagd_lib/sbspeval.c:45)

    Prototype:

      CagdRType *BspSrfEvalAtParam(CagdSrfStruct *Srf, CagdRType u, CagdRType v)

    Description:

    Evaluates the given tensor product Bspline surface at a given point, by
    extracting an isoparamteric curve along u from the surface and evaluating
    the curve at parameter v.

                  u -->
        +----------------------+
        |P0                Pi-1|
      V |Pi               P2i-1|  Parametric space orientation - control mesh.
      | |                      |
      v |Pn-i              Pn-1|
        +----------------------+

    Parameters:

     Srf:       Surface to evaluate at the given (u, v) location.
     u, v:      Location where to evaluate the surface.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of curve Crv's point type. If for example the curve's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      CagdSrfEval
      BzrSrfEvalAtParam
      BspSrfEvalAtParam2
      TrimSrfEval

    Keywords:

      evaluation
      Bsplines

     BspSrfEvalAtParam2   (cagd_lib/sbspeval.c:175)

    Prototype:

      CagdRType *BspSrfEvalAtParam2(CagdSrfStruct *Srf, CagdRType u, CagdRType v)

    Description:

      This function is the same as BspSrfEvalAtParam above. Cleaner, but much
    less efficient.
      Evaluates the given tensor product Bspline surface at a given point, by
    extracting an isoparamteric curve along u from the surface and evaluating
    the curve at parameter v.

    Parameters:

     Srf:       Surface to evaluate at the given (u, v) location.
     u, v:      Location where to evaluate the surface.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of curve Crv's point type. If for example the curve's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      CagdSrfEval
      BzrSrfEvalAtParam
      BspSrfEvalAtParam
      TrimSrfEval

    Keywords:

      evaluation
      Bsplines

     BspSrfHasBezierKVs   (cagd_lib/bsp_knot.c:47)

    Prototype:

      CagdBType BspSrfHasBezierKVs(CagdSrfStruct *Srf)

    Description:

    Returns TRUE iff the given surface has no interior knot open end KVs.

    Parameters:

     Srf:       To check for KVs that mimics Bezier polynomial surface.

    Returned Value:

      CagdBType:  TRUE if same as Bezier curve, FALSE otherwise.

    Keywords:

      conversion

     BspSrfHasOpenEC   (cagd_lib/bsp_knot.c:107)

    Prototype:

      CagdBType BspSrfHasOpenEC(CagdSrfStruct *Srf)

    Description:

    Returns TRUE iff the given Bspline surface has open end coditions.

    Parameters:

     Srf:      To check for open end conditions.

    Returned Value:

      CagdBType:  TRUE, if surface has open end conditions, FALSE otherwise.

    Keywords:

      open end conditions

     BspSrfHasOpenECDir   (cagd_lib/bsp_knot.c:129)

    Prototype:

      CagdBType BspSrfHasOpenECDir(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns TRUE iff the given Bspline surface has open end coditions in the
    specified direction.

    Parameters:

     Srf:      To check for open end conditions.
     Dir:      Either the U or the V parametric direction.

    Returned Value:

      CagdBType:  TRUE, if surface has open end conditions, FALSE otherwise.

    Keywords:

      open end conditions

     BspSrfInterpPts   (cagd_lib/sbsp_int.c:52)

    Prototype:

      CagdSrfStruct *BspSrfInterpPts(CagdPtStruct **PtList,
                                     int UOrder,
                                     int VOrder,
                                     int SrfUSize,
                                     int SrfVSize,
                                     CagdParametrizationType ParamType)

    Description:

    Given a set of points, PtList, computes a Bspline surface of order UOrder
    by VOrder that interpolates or least square approximates the given set of
    points.
      PtList is a NULL terminated array of linked lists of CagdPtStruct
    structs.
      All linked lists in PtList must have the same length.
      U direction of surface is associated with array, V with the linked
    lists.
      The size of the control mesh of the resulting Bspline surface defaults
    to the number of points in PtList (if SrfUSize = SrfVSize = 0).
      However, either numbers can smaller to yield a least square
    approximation of the gievn data set.
      The created surface can be parametrized as specified by ParamType.

    Parameters:

     PtList:      A NULL terminating array of linked list of points.
     UOrder:      Of the to be created surface.
     VOrder:      Of the to be created surface.
     SrfUSize:    U size of the to be created surface. Must be at least as
                    large as the array PtList.
     SrfVSize:    V size of the to be created surface. Must be at least as
                    large as the length of each list in PtList.
     ParamType:   Type of parametrization.

    Returned Value:

      CagdSrfStruct *:   Constructed interpolating/approximating surface.

    Keywords:

      interpolation
      least square approximation

     BspSrfInterpScatPts   (cagd_lib/sbsp_int.c:319)

    Prototype:

      CagdSrfStruct *BspSrfInterpScatPts(CagdCtlPtStruct *PtList,
                                         int UOrder,
                                         int VOrder,
                                         int USize,
                                         int VSize,
                                         CagdRType *UKV,
                                         CagdRType *VKV)

    Description:

    Given a set of scattered points, PtList, computes a Bspline surface of
    order UOrder by VOrder that interpolates or least square approximates the
    given set of scattered points.
      PtList is a NULL terminated lists of CagdPtStruct structs, with each
    point holding (u, v, x [, y[, z]]).  This is, E3 points create an E1
    scalar surface and E5 points create an E3 surface,

    Parameters:

     PtList:      A NULL terminating array of linked list of points.
     UOrder:      Of the to be created surface.
     VOrder:      Of the to be created surface.
     USize:       U size of the to be created surface.
     VSize:       V size of the to be created surface.
     UKV:         Expected knot vector in U direction, NULL for uniform open.
     VKV:         Expected knot vector in V direction, NULL for uniform open.

    Returned Value:

      CagdSrfStruct *:   Constructed interpolating/approximating surface.

    Keywords:

      interpolation
      least square approximation

     BspSrfInterpolate   (cagd_lib/sbsp_int.c:214)

    Prototype:

      CagdSrfStruct *BspSrfInterpolate(CagdCtlPtStruct *PtList,
                                       int NumUPts,
                                       int NumVPts,
                                       CagdRType *UParams,
                                       CagdRType *VParams,
                                       CagdRType *UKV,
                                       CagdRType *VKV,
                                       int ULength,
                                       int VLength,
                                       int UOrder,
                                       int VOrder)

    Description:

    Given a set of points on a rectangular grid, PtList, parameter values the
    surface should interpolate or approximate these grid points, U/VParams,
    the expected two knot vectors of the surface, U/VKV, the expected lengths
    U/VLength and orders U/VOrder of the Bspline surface, computes the Bspline
    surface's coefficients.
      All points in PtList are assumed of the same type.

    Parameters:

     PtList:     A long linked list (NumUPts * NumVPts) of points to
                   interpolated or least square approximate.
     NumUPts:    Number of points in PtList in the U direction.
     NumVPts:    Number of points in PtList in the V direction.
     UParams:    Parameter at which surface should interpolate or
                   approximate PtList in the U direction.
     VParams:    Parameter at which surface should interpolate or
                   approximate PtList in the V direction.
     UKV:        Requested knot vector form the surface in the U direction.
     VKV:        Requested knot vector form the surface in the V direction.
     ULength:    Requested length of control mesh of surface in U direction.
     VLength:    Requested length of control mesh of surface in V direction.
     UOrder:     Requested order of surface in U direction.
     VOrder:     Requested order of surface in U direction.

    Returned Value:

      CagdSrfStruct *:   Constructed interpolating/approximating surface.

    Keywords:

      interpolation
      least square approximation

     BspSrfKnotInsert   (cagd_lib/bspboehm.c:142)

    Prototype:

      CagdSrfStruct *BspSrfKnotInsert(CagdSrfStruct *Srf,
                                      CagdSrfDirType Dir,
                                      CagdRType t)

    Description:

    Returns a new surface refined at t (t is inserted as a new knot in Srf)
    in parametric directipn Dir. See BspCrvKnotInsert for the mathematical
    background of this knot insertion algorithm.

    Parameters:

     Srf:      To refine by adding a new knot with value equal to t. If Srf
                 is a periodic curve, it is first unwrapped to a float end
                 condition curve.
     Dir:      Of refinement, either U or V.
     t:        New knot to insert into Srf.

    Returned Value:

      CagdSrfStruct *:  The refined surface.

    See Also:

      BspSrfKnotInsertNSame
      BspSrfKnotInsertNDiff
      BspCrvKnotInsert
      BspKnotEvalAlphaCoef

    Keywords:

      refinement
      knot insertion

     BspSrfKnotInsertNDiff   (cagd_lib/sbsp_aux.c:386)

    Prototype:

      CagdSrfStruct *BspSrfKnotInsertNDiff(CagdSrfStruct *Srf,
                                           CagdSrfDirType Dir,
                                           int Replace,
                                           CagdRType *t,
                                           int n)

    Description:

     Inserts n knot with different values as defined by the vector t. If,
    however, Replace is TRUE, the knot are simply replacing the current knot
    vector.

    Parameters:

     Srf:        To refine by insertion (upto) n knot of value t.
     Dir:        Direction of refinement. Either U or V.
     Replace:    if TRUE, the n knots in t should replace the knot vector
                   of size n of Srf. Sizes must match. If False, n new knots
                   as defined by t will be introduced into Srf.
     t:          New knots to introduce/replace knot vector of Srf.
     n:          Size of t.

    Returned Value:

      CagdSrfStruct *:    Refined Srf with n new knots in direction Dir.

    Keywords:

      refinement
      subdivision

     BspSrfKnotInsertNSame   (cagd_lib/sbsp_aux.c:311)

    Prototype:

      CagdSrfStruct *BspSrfKnotInsertNSame(CagdSrfStruct *Srf,
                                           CagdSrfDirType Dir,
                                           CagdRType t,
                                           int n)

    Description:

     Inserts n knot, all with the value t in direction Dir. In no case will
    the multiplicity of a knot be greater or equal to the curve order.

    Parameters:

     Srf:        To refine by insertion (upto) n knot of value t.
     Dir:        Direction of refinement. Either U or V.
     t:          Parameter value of new knot to insert.
     n:          Maximum number of times t should be inserted.

    Returned Value:

      CagdSrfStruct *:  Refined Srf with n knots of value t in direction Dir.

    Keywords:

      refinement
      subdivision

     BspSrfMaxCoefParam   (cagd_lib/bsp_knot.c:1072)

    Prototype:

      CagdRType *BspSrfMaxCoefParam(CagdSrfStruct *Srf, int Axis, CagdRType *MaxVal)

    Description:

    Finds the parameter value with the largest coefficient of the surface
    using nodes values to estimate the coefficients' parameters.
    Returns a pointer to a static array of two elements holding U and V.

    Parameters:

     Srf:           To compute the parameter node value of the largest
                      coefficient.
     Axis:          Which axis should we search for maximal coefficient?
                      1 for X, 2 for Y, etc.
     MaxVal:        The coefficient itself will be place herein.

    Returned Value:

      CagdRType *:   The node UV parameter values of the detected maximal
                     coefficient.

    Keywords:

      extremum

     BspSrfMeshNormals   (cagd_lib/sbsp_aux.c:962)

    Prototype:

      CagdVecStruct *BspSrfMeshNormals(CagdSrfStruct *Srf,
                                       int UFineNess,
                                       int VFineNess)

    Description:

    Evaluates the unit normals of a surface at a mesh defined by subdividing
    the parametric space into a grid of size UFineNess by VFineNess.
      The normals are saved in a linear CagdVecStruct vector which is
    allocated dynamically. Data is saved u inc. first.
      This routine is much faster than evaluating normal for each point,
    individually.

    Parameters:

     Srf:          To compute normals on a grid of its parametric domain.
     UFineNess:    U Fineness of imposed grid on Srf's parametric domain.
     VFineNess:    V Fineness of imposed grid on Srf's parametric domain.

    Returned Value:

      CagdVecStruct *:   An vector of unit normals (u increments first).

    See Also:

      CagdSrfNormal
      BspSrfNormal
      SymbSrfNormalSrf

    Keywords:

      normal

     BspSrfMeshNormalsSymb   (cagd_lib/sbsp_aux.c:1159)

    Prototype:

      CagdVecStruct *BspSrfMeshNormalsSymb(CagdSrfStruct *Srf,
                                           int UFineNess,
                                           int VFineNess)

    Description:

    Evaluates the unit normals of a surface at a mesh defined by subdividing
    the parametric space into a grid of size UFineNess by VFineNess.
      The normals are saved in a linear CagdVecStruct vector which is
    allocated dynamically. Data is saved u inc. first.
      This routine is much faster than evaluating normal for each point,
    individually.

    Parameters:

     Srf:          To compute normals on a grid of its parametric domain.
     UFineNess:    U Fineness of imposed grid on Srf's parametric domain.
     VFineNess:    V Fineness of imposed grid on Srf's parametric domain.

    Returned Value:

      CagdVecStruct *:   An vector of unit normals (u increments first).

    Keywords:

      normal

     BspSrfNew   (cagd_lib/bsp_gen.c:35)

    Prototype:

      CagdSrfStruct *BspSrfNew(int ULength,
                               int VLength,
                               int UOrder,
                               int VOrder,
                               CagdPointType PType)

    Description:

      Allocates the memory required for a new Bspline surface.

    Parameters:

     ULength:      Number of control points in the U direction.
     VLength:      Number of control points in the V direction.
     UOrder:       The order of the surface in the U direction.
     VOrder:       The order of the surface in the V direction.
     PType:        Type of control points (E2, P3, etc.).

    Returned Value:

      CagdSrfStruct *:   An uninitialized freeform Bspline surface.

    See Also:

      BzrSrfNew
      BspPeriodicSrfNew
      CagdSrfNew
      CagdPeriodicSrfNew
      TrimSrfNew

    Keywords:

      allocation

     BspSrfNormal   (cagd_lib/sbsp_aux.c:902)

    Prototype:

      CagdVecStruct *BspSrfNormal(CagdSrfStruct *Srf,
                                  CagdRType u,
                                  CagdRType v,
                                  CagdBType Normalize)

    Description:

    Evaluate the (unit) normal of a surface at a given parametric location.
      If we fail to compute the normal at given location we retry by moving a
    tad.

    Parameters:

     Srf:        Bspline surface to evaluate (unit) normal vector for.
     u, v:       Parametric location of required (unit) normal.
     Normalize:  If TRUE, attempt is made to normalize the returned vector.
                   If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the (unit) normal
                        information.

    See Also:

      CagdSrfNormal
      BzrSrfNormal
      BspSrfMeshNormals
      SymbSrfNormalSrf

    Keywords:

      normal

     BspSrfOpenEnd   (cagd_lib/bsp_gen.c:305)

    Prototype:

      CagdSrfStruct *BspSrfOpenEnd(CagdSrfStruct *Srf)

    Description:

      Returns a surface with open end conditions, similar to given surface.
      Open end surface is computed by extracting a subregion from Srf that is
    the entire surface's parametric domain, by inserting multiple knots at the
    domain's boundary.

    Parameters:

     Srf:     To convert to a new curve with open end conditions.

    Returned Value:

      CagdSrfStruct *: Same surface as Srf but with open end conditions.

    See Also:

      BspCrvOpenEnd

    Keywords:

      open end conditions

     BspSrfSubdivAtParam   (cagd_lib/sbsp_aux.c:50)

    Prototype:

      CagdSrfStruct *BspSrfSubdivAtParam(CagdSrfStruct *Srf,
                                         CagdRType t,
                                         CagdSrfDirType Dir)

    Description:

    Given a Bspline surface - subdivides it into two sub-surfaces at the given
    parametric value.
      Returns pointer to first surface in a list of two subdivided surfaces.

    Parameters:

     Srf:      To subdivide at parameter value t.
     t:        Parameter value to subdivide Srf at.
     Dir:      Direction of subdivision. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A list of the two subdivided surfaces.

    See Also:

      CagdSrfSubdivAtParam
      BzrSrfSubdivAtParam
      TrimSrfSubdivAtParam

    Keywords:

      subdivision
      refinement

     BspSrfTangent   (cagd_lib/sbsp_aux.c:852)

    Prototype:

      CagdVecStruct *BspSrfTangent(CagdSrfStruct *Srf,
                                   CagdRType u,
                                   CagdRType v,
                                   CagdSrfDirType Dir,
                                   CagdBType Normalize)

    Description:

    Evaluates the (unit) tangent to a surface at a given parametric location
    (u, v) and given direction Dir.

    Parameters:

     Srf:        Bspline surface to evaluate (unit) tangent vector for.
     u, v:       Parametric location of required (unit) tangent.
     Dir:        Direction of tangent vector. Either U or V.
     Normalize:  If TRUE, attempt is made to normalize the returned vector.
                   If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the (unit)
                        tangent information.

    See Also:

      CagdSrfTangent
      BzrSrfTangent

    Keywords:

      tangent

     BzrCrv2Polyline   (cagd_lib/bzr2poly.c:431)

    Prototype:

      CagdPolylineStruct *BzrCrv2Polyline(CagdCrvStruct *Crv, int SamplesPerCurve)

    Description:

      Routine to approx. a single Bezier curve as a polyline with
    SamplesPerCurve samples. Polyline is always E3 CagdPolylineStruct type.
      Curve is sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise CagdPolylineStruct.

    Parameters:

     Crv:              To approximate as a polyline.
     SamplesPerCurve:  Number of samples to approximate with.

    Returned Value:

      CagdPolylineStruct *:  A polyline representing the piecewise linear
                             approximation from, or NULL in case of an error.

    See Also:

      BspCrv2Polyline
      BzrSrf2Polylines
      IritCurve2Polylines

      SymbCrv2Polyline

    Keywords:

      piecewise linear approximation
      polyline

     BzrCrvBiNormal   (cagd_lib/cbzr_aux.c:275)

    Prototype:

      CagdVecStruct *BzrCrvBiNormal(CagdCrvStruct *Crv,
                                    CagdRType t,
                                    CagdBType Normalize)

    Description:

    Returns a (unit) vector, equal to the binormal to Crv at parameter value t.
      Algorithm: insert (order - 1) knots and using 3 consecutive control
    points at the refined location (p1, p2, p3), compute to binormal to be the
    cross product of the two vectors (p1 - p2) and (p2 - p3).
      Since a curve may have not BiNormal at inflection points or if the 3
    points are colinear, NULL will be returned at such cases.

    Parameters:

     Crv:       Crv for which to compute a (unit) binormal.
     t:         The parameter at which to compute the unit binormal.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the binormal
                        information.

    Keywords:

      binormal

     BzrCrvCreateArc   (cagd_lib/cagd_arc.c:59)

    Prototype:

      CagdCrvStruct *BzrCrvCreateArc(CagdPtStruct *Start,
                                     CagdPtStruct *Center,
                                     CagdPtStruct *End)

    Description:

    Creates an arc at the specified position as a rational quadratic Bezier
    curve.
      The arc is assumed to be less than 180 degrees from Start to End in the
    shorter path as arc where Center as arc center.

    Parameters:

     Start:       Point of beginning of arc.
     Center:      Point of arc.
     End:         Point of end of arc.

    Returned Value:

      CagdCrvStruct *: A rational quadratic Bezier curve representing the arc.

    Keywords:

      circle
      arc

     BzrCrvCreateArc   (cagd_lib/cagd_arc.c:138)

    Prototype:

      CagdCrvStruct *BzrCrvCreateArc2(CagdPtStruct *Center,
                                      CagdRType Radius,
                                      CagdRType StartAngle,
                                      CagdRType EndAngle)

    Description:

    Creates an arc at the specified position as a rational quadratic Bspline
    curve, with two Bezier pieces.
      The arc is defined from StartAngle to EndAngle, and is assumed to be
    less than 180 degrees from Start to End.

    Parameters:

     Center:      Point of arc.
     Radius:      Of arc.
     StartAngle:  Starting angle of arc, in radians.
     EndAngle:    End angle of arc, in radians.

    Returned Value:

      CagdCrvStruct *: A rational quadratic Bezier curve representing the arc.

    Keywords:

      circle
      arc

     BzrCrvDegreeRaise   (cagd_lib/cbzr_aux.c:127)

    Prototype:

      CagdCrvStruct *BzrCrvDegreeRaise(CagdCrvStruct *Crv)

    Description:

    Returns a new curve, identical to the original but with one degree higher.
    Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:

                         i            k-i
    Q(0) = P(0), Q(i) = --- P(i-1) + (---) P(i), Q(k) = P(k-1).
                         k             k

    Parameters:

     Crv:        To raise it degree by one.

    Returned Value:

      CagdCrvStruct *:  A curve of one order higher representing the same
                        geometry as Crv.

    Keywords:

      degree raising

     BzrCrvDegreeRaiseN   (cagd_lib/cbzr_aux.c:84)

    Prototype:

      CagdCrvStruct *BzrCrvDegreeRaiseN(CagdCrvStruct *Crv, int NewOrder)

    Description:

    Returns a new curve, identical to the original but with order N.
      Degree raise is computed by multiplying by a constant 1 curve of order

    Parameters:

     Crv:        To raise its degree to a NewOrder.
     NewOrder:   NewOrder for Crv.

    Returned Value:

      CagdCrvStruct *:  A curve of order NewOrder representing the same
                        geometry as Crv.

    Keywords:

      degree raising

     BzrCrvDerive   (cagd_lib/cbzr_aux.c:409)

    Prototype:

      CagdCrvStruct *BzrCrvDerive(CagdCrvStruct *Crv)

    Description:

    Returns a new curve, equal to the given curve, differentiated once.
    Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:
    Q(i) = (k - 1) * (P(i+1) - P(i)), i = 0 to k-2.

    Parameters:

     Crv:        To differentiate.

    Returned Value:

      CagdCrvStruct *:   Differentiated curve.

    See Also:

      CagdCrvDerive
      BspCrvDerive
      BzrCrvDeriveRational
      BspCrvDeriveRational

    Keywords:

      derivatives

     BzrCrvEvalAtParam   (cagd_lib/cbzreval.c:158)

    Prototype:

      CagdRType *BzrCrvEvalAtParam(CagdCrvStruct *Crv, CagdRType t)

    Description:

    Returns a pointer to a static data, holding the value of the curve at
    given parametric location t. The curve is assumed to be Bezier.

    Parameters:

     Crv:      To evaluate at the given parametric location t.
     t:        The parameter value at which the curve Crv is to be evaluated.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of curve Crv's point type. If for example the curve's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      CagdCrvEval
      BspCrvEvalAtParam
      BspCrvEvalVecAtParam

      BzrCrvEvalVecAtParam
      BspCrvEvalCoxDeBoor
      CagdCrvEvalToPolyline

    Keywords:

      evaluation

     BzrCrvEvalToPolyline   (cagd_lib/cbzreval.c:203)

    Prototype:

      void BzrCrvEvalToPolyline(CagdCrvStruct *Crv,
                                int FineNess,
                                CagdRType *Points[])

    Description:

    Samples the curve at FineNess location equally spaced in the curve's
    parametric domain.

    Parameters:

     Crv:         To approximate as a polyline.
     FineNess:    Control on number of samples.
     Points:      Where to put the resulting polyline.
     A:           Optional alpha matrix for refinement.

    Returned Value:

      int:         The actual number of samples placed in Points. Always
                   less than or eaul to FineNess.

    See Also:

      CagdCrvEval
      BspCrvEvalAtParam
      BzrCrvEvalVecAtParam

      BspCrvEvalVecAtParam
      BspCrvEvalCoxDeBoor
      CagdCrvEvalToPolyline

    Keywords:

      conversion
      refinement
      evaluation

     BzrCrvEvalVecAtParam   (cagd_lib/cbzreval.c:116)

    Prototype:

      CagdRType BzrCrvEvalVecAtParam(CagdRType *Vec,
                                     int VecInc,
                                     int Order,
                                     CagdRType t)

    Description:

    Assumes Vec holds control points for scalar bezier curve of order Order,
    and evaluates and returns that curve value at parameter value t.
      Vec is incremented by VecInc (usually by 1) after each iteration.

    Parameters:

     Vec:            Coefficents of a scalar Bspline univariate function.
     VecInc:         Step to move along Vec.
     Order:          Order of associated geometry.
     t:              Parameter value where to evaluate the curve.

    Returned Value:

      CagdRType:      Geometry's value at parameter value t.

    See Also:

      CagdCrvEval
      BspCrvEvalAtParam
      BzrCrvEvalAtParam

      BspCrvEvalVecAtParam
      BspCrvEvalCoxDeBoor
      CagdCrvEvalToPolyline

    Keywords:

      evaluation

     BzrCrvIntegrate   (cagd_lib/cbzr_aux.c:471)

    Prototype:

      CagdCrvStruct *BzrCrvIntegrate(CagdCrvStruct *Crv)

    Description:

    Returns a new Bezier curve, equal to the integral of the given Bezier
    crv.
    The given Bezier curve should be nonrational.

                n            n               n       n+1
      /        /-            -      /        -   P    -
     |        | \     n      \     |  n      \    i   \  n+1
     | C(t) = | / P  B (t) = / P   | B (t) = / -----  / B   (t) =
    /        /  -  i  i      -  i /   i      - n + 1  -  j
               i=0          i=0             i=0     j=i+1

           n+1 j-1
            -   -
        1   \   \     n+1
    = ----- /   / P  B   (t)
      n + 1 -   -  i  j
           j=1 i=0

    Parameters:

     Crv:         Curve to integrate.

    Returned Value:

      CagdCrvStruct *:   Integrated curve.

    See Also:

      BspCrvIntegrate
      CagdCrvIntegrate

    Keywords:

      integrals

     BzrCrvNew   (cagd_lib/bzr_gen.c:59)

    Prototype:

      CagdCrvStruct *BzrCrvNew(int Length, CagdPointType PType)

    Description:

      Allocates the memory required for a new Bezier curve.

    Parameters:

     Length:     Number of control points
     PType:      Type of control points (E2, P3, etc.).

    Returned Value:

      CagdCrvStruct *:   An uninitialized freeform Bezier curve.

    See Also:

      BspCrvNew
      BspPeriodicCrvNew
      CagdCrvNew
      CagdPeriodicCrvNew
      TrimCrvNew

    Keywords:

      allocation

     BzrCrvNoraml   (cagd_lib/cbzr_aux.c:372)

    Prototype:

      CagdVecStruct *BzrCrvNormal(CagdCrvStruct *Crv,
                                  CagdRType t,
                                  CagdBType Normalize)

    Description:

    Returns a (unit) vector, equal to the normal of Crv at parameter value t.
      Algorithm: returns the cross product of the curve tangent and binormal.

    Parameters:

     Crv:       Crv for which to compute a (unit) normal.
     t:         The parameter at which to compute the unit normal.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the normal
                        information.

    Keywords:

      normal

     BzrCrvSetCache   (cagd_lib/cbzreval.c:54)

    Prototype:

      void BzrCrvSetCache(int FineNess, CagdBType EnableCache)

    Description:

    Sets the bezier sampling cache - if enabled, a Bezier can be evaluated
    directly from presampled basis function.

    Parameters:

     FineNess:       Number of samples to support (power of 2).
     EnableCache:    Are we really planning on using this thing?

    Returned Value:

      void

    Keywords:

      evaluation
      caching

     BzrCrvSubdivAtParam   (cagd_lib/cbzr_aux.c:30)

    Prototype:

      CagdCrvStruct *BzrCrvSubdivAtParam(CagdCrvStruct *Crv, CagdRType t)

    Description:

    Given a Bezier curve - subdivides it into two sub-curves at the given
    parametric value.
      Returns pointer to first curve in a list of two subdivided curves.

    Parameters:

     Crv:       To subdivide at parametr value t.
     t:         Parameter value to subdivide Crv at.

    Returned Value:

      CagdCrvStruct *:  A list of the two subdivided curves.

    Keywords:

      subdivision
      refinement

     BzrCrvTangent   (cagd_lib/cbzr_aux.c:173)

    Prototype:

      CagdVecStruct *BzrCrvTangent(CagdCrvStruct *Crv,
                                   CagdRType t,
                                   CagdBType Normalize)

    Description:

    Returns a (unit) vector, equal to the tangent to Crv at parameter value t.
      Algorithm: pseudo subdivide Crv at t and using control point of
    subdivided curve find the tangent as the difference of the 2 end points.

    Parameters:

     Crv:       Crv for which to compute a (unit) tangent.
     t:         The parameter at which to compute the unit tangent.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the tangent
                        information.

    Keywords:

      tangent

     BzrSrf2Curves   (cagd_lib/bzr2poly.c:368)

    Prototype:

      CagdCrvStruct *BzrSrf2Curves(CagdSrfStruct *Srf, int NumOfIsocurves[2])

    Description:

      Routine to extract from a bezier surface NumOfIsoline isocurve list
    in each param. direction.
      Iso parametric curves are sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise list of CagdCrvStruct.

    Parameters:

     Srf:             To extract isoparametric curves from.
     NumOfIsocurves:  In reach (U or V) direction

    Returned Value:

      CagdCrvStruct *:  List of extracted isoparametric curves. These curves
                        inherit the order and continuity of the original Srf.
                        NULL is returned in case of an error.

    See Also:

      BzrSrf22Polylines
      BspSrf2PCurves
      SymbSrf2Curves

    Keywords:

      curves
      isoparametric curves

     BzrSrf2Polygons   (cagd_lib/bzr2poly.c:45)

    Prototype:

      CagdPolygonStruct *BzrSrf2Polygons(CagdSrfStruct *Srf,
                                         int FineNess,
                                         CagdBType ComputeNormals,
                                         CagdBType FourPerFlat,
                                         CagdBType ComputeUV)

    Description:

      Routine to convert a single Bezier surface to set of triangles
    approximating it. FineNess is a fineness control on result and the larger
    is more triangles may result. A value of 10 is a good start value.
    NULL is returned in case of an error, otherwise list of CagdPolygonStruct.

    Parameters:

     Srf:              To approximate into triangles.
     FineNess:         Control on accuracy, the higher the finer.
     ComputeNormals:   If TRUE, normal information is also computed.
     FourPerFlat:      If TRUE, four triangles are created per flat surface.
                         If FALSE, only 2 triangles are created.
     ComputeUV:        If TRUE, UV values are stored and returned as well.

    Returned Value:

      CagdPolygonStruct *:  A list of polygons with optional normal and/or
                            UV parametric information.
                            NULL is returned in case of an error.

    See Also:

      BspSrf2Polygons
      IritSurface2Polygons
      IritTrimSrf2Polygons

      SymbSrf2Polygons
      TrimSrf2Polygons
      CagdSrf2Polygons

    Keywords:

      polygonization
      surface approximation

     BzrSrf2Polylines   (cagd_lib/bzr2poly.c:298)

    Prototype:

      CagdPolylineStruct *BzrSrf2Polylines(CagdSrfStruct *Srf,
                                           int NumOfIsocurves[2],
                                           int SamplesPerCurve)

    Description:

      Routine to convert a single Bezier surface to NumOfIsolines polylines
    in each parametric direction with SamplesPerCurve in each isoparametric
    curve.
      Polyline are always E3 of CagdPolylineStruct type.
      Iso parametric curves are sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise list of
    CagdPolylineStruct.

    Parameters:

     Srf:                 Srf to extract isoparametric curves from.
     NumOfIsocurves:      To extarct from Srf in each (U or V) direction.
     SamplesPerCurve:     Fineness control on piecewise linear curve
                            approximation.

    Returned Value:

      CagdPolylineStruct *: List of polygons representing a piecewise linear
                            approximation of the extracted isoparamteric
                            curves or NULL is case of an error.

    See Also:

      BzrCrv2Polyline
      BspSrf2Polylines
      IritSurface2Polylines

      IritTrimSrf2Polylines
      SymbSrf2Polylines
      TrimSrf2Polylines
      CagdSrf2Polylines

    Keywords:

      polylines
      isoparametric curves

     BzrSrfCrvFromMesh   (cagd_lib/sbzreval.c:152)

    Prototype:

      CagdCrvStruct *BzrSrfCrvFromMesh(CagdSrfStruct *Srf,
                                       int Index,
                                       CagdSrfDirType Dir)

    Description:

    Extracts a curve from the mesh of a tensor product Bezier surface Srf in
    direction Dir at index Index.

    Parameters:

     Srf:       To extract a curve from.
     Index:     Index along the mesh of Srf to extract the curve from.
     Dir:       Direction of extracted curve. Either U or V.

    Returned Value:

      CagdCrvStruct *:   A curve from Srf. This curve inherit the order and
                         continuity of surface Srf in direction Dir. However,
                         thiscurve is not on surface Srf, in general.

    See Also:

      CagdCrvFromSrf
      BzrSrfCrvFromSrf
      BspSrfCrvFromSrf

      CagdCrvFromMesh
      BspSrfCrvFromMesh

    Keywords:

      isoparametric curves
      curve from mesh

     BzrSrfCrvFromSrf   (cagd_lib/sbzreval.c:82)

    Prototype:

      CagdCrvStruct *BzrSrfCrvFromSrf(CagdSrfStruct *Srf,
                                      CagdRType t,
                                      CagdSrfDirType Dir)

    Description:

    Extracts an isoparametric curve out of the given tensor product Bezier
    surface in direction Dir at the parameter value of t.
      Operations should prefer the CONST_U_DIR, in which the extraction is
    somewhat faster if that is possible.

    Parameters:

     Srf:       To extract an isoparametric ocurve from.
     t:         Parameter value of extracted isoparametric curve.
     dir:       Direction of the isocurve on the surface. Either U or V.

    Returned Value:

      CagdCrvStruct *:  An isoparametric curve of Srf. This curve inherits the
                        order and continuity of surface Srf in direction Dir.

    See Also:

      CagdCrvFromSrf
      BspSrfCrvFromSrf
      CagdCrvFromMesh
      BzrSrfCrvFromMesh

      BspSrfCrvFromMesh

    Keywords:

      isoparametric curves
      curve from surface

     BzrSrfDegreeRaise   (cagd_lib/sbzr_aux.c:114)

    Prototype:

      CagdSrfStruct *BzrSrfDegreeRaise(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns a new Bezier surface, identical to the original but with one
    degree higher, in the requested direction Dir.
    Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:

                         i            k-i
    Q(0) = P(0), Q(i) = --- P(i-1) + (---) P(i), Q(k) = P(k-1).
                         k             k

    This is applied to all rows/cols of the surface.

    Parameters:

     Srf:        To raise it degree by one.
     Dir:        Direction to degree raise. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A surface with one degree higher in direction Dir,
                        representing the same geometry as Srf.

    See Also:

      CagdSrfDegreeRaise
      BspSrfDegreeRaise
      TrimSrfDegreeRaise

    Keywords:

      degree raising

     BzrSrfDerive   (cagd_lib/sbzr_aux.c:197)

    Prototype:

      CagdSrfStruct *BzrSrfDerive(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns a new surface equal to the given surface, differentiated once in
    the direction Dir.
      Let old control polygon be P(i), i = 0 to k-1, and Q(i) be new one then:

    Q(i) = (k - 1) * (P(i+1) - P(i)), i = 0 to k-2.

    This is applied to all rows/cols of the surface.

    Parameters:

     Srf:        To differentiate.
     Dir:        Direction of differentiation. Either U or V.

    Returned Value:

      CagdSrfStruct *:   Differentiated surface.

    See Also:

      CagdSrfDerive
      BspSrfDerive
      BzrSrfDeriveRational
      BspSrfDeriveRational

    Keywords:

      derivatives
      partial derivatives

     BzrSrfEvalAtParam   (cagd_lib/sbzreval.c:44)

    Prototype:

      CagdRType *BzrSrfEvalAtParam(CagdSrfStruct *Srf, CagdRType u, CagdRType v)

    Description:

    Evaluates the given tensor product Bezier surface at a given point, by
    extracting an isoparamteric curve along u from the surface and evaluating
    the curve at parameter v.

                  u -->
        +----------------------+
        |P0                Pi-1|
      V |Pi               P2i-1|  Parametric space orientation - control mesh.
       ||                      |
       v|Pn-i              Pn-1|
        +----------------------+

    Parameters:

     Srf:       Surface to evaluate at the given (u, v) location.
     u, v:      Location where to evaluate the surface.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of curve Crv's point type. If for example the curve's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      CagdSrfEval
      BspSrfEvalAtParam
      BspSrfEvalAtParam2
      TrimSrfEval

    Keywords:

      evaluation
      Bezier

     BzrSrfNew   (cagd_lib/bzr_gen.c:29)

    Prototype:

      CagdSrfStruct *BzrSrfNew(int ULength, int VLength, CagdPointType PType)

    Description:

    Allocates the memory required for a new Bezier surface.

    Parameters:

     ULength:      Number of control points in the U direction.
     VLength:      Number of control points in the V direction.
     PType:        Type of control points (E2, P3, etc.).

    Returned Value:

      CagdSrfStruct *:   An uninitialized freeform Bezier surface.

    See Also:

      BspSrfNew
      BspPeriodicSrfNew
      CagdSrfNew
      CagdPeriodicSrfNew
      TrimSrfNew

    Keywords:

      allocation

     BzrSrfNormal   (cagd_lib/sbzr_aux.c:320)

    Prototype:

      CagdVecStruct *BzrSrfNormal(CagdSrfStruct *Srf,
                                  CagdRType u,
                                  CagdRType v,
                                  CagdBType Normalize)

    Description:

    Evaluate the (unit) normal of a surface at a given parametric location.
      If we fail to compute the normal at given location we retry by moving a
    tad.

    Parameters:

     Srf:        Bezier surface to evaluate (unit) normal vector for.
     u, v:       Parametric location of required (unit) normal.
     Normalize:  If TRUE, attempt is made to normalize the returned vector.
                   If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the (unit) normal
                        information.

    See Also:

      CagdSrfNormal
      BspSrfNormal
      SymbSrfNormalSrf

    Keywords:

      normal

     BzrSrfSubdivAtParam   (cagd_lib/sbzr_aux.c:44)

    Prototype:

      CagdSrfStruct *BzrSrfSubdivAtParam(CagdSrfStruct *Srf,
                                         CagdRType t,
                                         CagdSrfDirType Dir)

    Description:

    Given a Bezier surface - subdivides it into two sub-surfaces at the given
    parametric value.
      Returns pointer to first surface in a list of two subdivided surfaces.

    Parameters:

     Srf:      To subdivide at parameter value t.
     t:        Parameter value to subdivide Srf at.
     Dir:      Direction of subdivision. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A list of the two subdivided surfaces.

    See Also:

      CagdSrfSubdivAtParam
      BspSrfSubdivAtParam
      TrimSrfSubdivAtParam

    Keywords:

      subdivision
      refinement

     BzrSrfTangent   (cagd_lib/sbzr_aux.c:270)

    Prototype:

      CagdVecStruct *BzrSrfTangent(CagdSrfStruct *Srf,
                                   CagdRType u,
                                   CagdRType v,
                                   CagdSrfDirType Dir,
                                   CagdBType Normalize)

    Description:

    Evaluates the (unit) tangent to a surface at a given parametric location
    u, v) and given direction Dir.

    Parameters:

     Srf:        Bezier surface to evaluate (unit) tangent vector for.
     u, v:       Parametric location of required (unit) tangent.
     Dir:        Direction of tangent vector. Either U or V.
     Normalize:  If TRUE, attempt is made to normalize the returned vector.
                   If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the (unit)
                        tangent information.

    See Also:

      CagdSrfTangent
      BspSrfTangent

    Keywords:

      tangent

     CagdBBoxArrayFree   (cagd_lib/cagd2gen.c:698)

    Prototype:

      void CagdBBoxArrayFree(CagdBBoxStruct *BBoxArray, int Size)

    Description:

    Deallocates and frees an array of BBox structure.

    Parameters:

     BBoxArray:    To be deallocated.
     Size:         Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdBBoxArrayNew   (cagd_lib/cagd1gen.c:492)

    Prototype:

      CagdBBoxStruct *CagdBBoxArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of BBox structures.

    Parameters:

     Size:      Size of BBox array to allocate.

    Returned Value:

      CagdBBoxStruct *:  An array of BBox structures of size Size.

    Keywords:

      allocation

     CagdBBoxCopy   (cagd_lib/cagd1gen.c:886)

    Prototype:

      CagdBBoxStruct *CagdBBoxCopy(CagdBBoxStruct *BBox)

    Description:

    Allocates and copies all slots of a BBox structure.

    Parameters:

     BBox:       To be copied.

    Returned Value:

      CagdBBoxStruct *:  A duplicate of BBox.

    Keywords:

      copy

     CagdBBoxCopyList   (cagd_lib/cagd2gen.c:91)

    Prototype:

      CagdBBoxStruct *CagdBBoxCopyList(CagdBBoxStruct *BBoxList)

    Description:

    Allocates and copies a list of bbox structures.

    Parameters:

     BBoxList:       To be copied.

    Returned Value:

      CagdBBoxStruct *:  A duplicated list of bbox's.

    Keywords:

      copy

     CagdBBoxFree   (cagd_lib/cagd2gen.c:651)

    Prototype:

      void CagdBBoxFree(CagdBBoxStruct *BBox)

    Description:

    Deallocates and frees all slots of a BBox structure.

    Parameters:

     BBox:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdBBoxFreeList   (cagd_lib/cagd2gen.c:673)

    Prototype:

      void CagdBBoxFreeList(CagdBBoxStruct *BBoxList)

    Description:

    Deallocates and frees a BBox structure list:

    Parameters:

     BBoxList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdBBoxNew   (cagd_lib/cagd1gen.c:520)

    Prototype:

      CagdBBoxStruct *CagdBBoxNew(void)

    Description:

    Allocates and resets all slots of a BBox structure.

    Parameters:

     None

    Returned Value:

      CagdBBoxStruct *:  A BBox structure.

    Keywords:

      allocation

     CagdBilinearSrf   (cagd_lib/cagdruld.c:123)

    Prototype:

      CagdSrfStruct *CagdBilinearSrf(CagdPtStruct *Pt00,
                                     CagdPtStruct *Pt01,
                                     CagdPtStruct *Pt10,
                                     CagdPtStruct *Pt11)

    Description:

    Constructs a bilinear surface between the four provided points.

    Parameters:

     Pt00, Pt01, Pt10, Pt11:  he four points to consturct a bilinear between.

    Returned Value:

      CagdSrfStruct *:  A bilinear surface with four corners at Ptij.

    Keywords:

      Bilinear surface
      surface constructors

     CagdBoolSumSrf   (cagd_lib/cagdbsum.c:156)

    Prototype:

      CagdSrfStruct *CagdOneBoolSumSrf(CagdCrvStruct *BndryCrv)

    Description:

    Constructs a Boolean sum surface using the single boundary curve.
      The curve is subdivided into four, equally spaced in parameter space,
    sub-regions which are used as the four curves to the Boolean sum
    constructor. See CagdBoolSumSrf.

    Parameters:

     BndryCrv:   To be subdivided into four curves for a Boolean sum
                   construction.

    Returned Value:

      CagdSrfStruct *:  A Boolean sum surface constructed using given curve

    Keywords:

      Boolean sum
      surface constructors

     CagdBoolSumSrf   (cagd_lib/cagdbsum.c:33)

    Prototype:

      CagdSrfStruct *CagdBoolSumSrf(CagdCrvStruct *CrvLeft,
                                    CagdCrvStruct *CrvRight,
                                    CagdCrvStruct *CrvTop,
                                    CagdCrvStruct *CrvBottom)

    Description:

    Constructs a Boolean sum surface using the four provided boundary curves.
      Curve's end points must meet at the four surface corners if surface
    boundary are to be identical to the four given curves.

    Parameters:

     CrvLeft:    Left boundary curve of Boolean sum surface to be created.
     CrvRight:   Right boundary curve of Boolean sum surface to be created.
     CrvTop:     Top boundary curve of Boolean sum surface to be created.
     CrvBottom:  Bottom boundary curve of Boolean sum surface to be created.

    Returned Value:

      CagdSrfStruct *:  A Boolean sum surface constructed using given four
                        curves.

    Keywords:

      Boolean sum
      surface constructors

     CagdCoerceCrvTo   (cagd_lib/cagdcoer.c:336)

    Prototype:

      CagdCrvStruct *CagdCoerceCrvTo(CagdCrvStruct *Crv, CagdPointType PType)

    Description:

    Coerces a curve to a new point type PType. If given curve is E1 or P1
    and requested new type is E2 or P2 the Y coefficients are updated to
    hold the parametric domain of the curve.

    Parameters:

     Crv:       To be coerced to a new point type PType.
     PType:     New point type for Crv.

    Returned Value:

      CagdCrvStruct *:  The new, coerced to PType, curve.

    Keywords:

      coercion

     CagdCoercePointTo   (cagd_lib/cagdcoer.c:228)

    Prototype:

      void CagdCoercePointTo(CagdRType *NewPoint,
                             CagdPointType NewPType,
                             CagdRType *Points[CAGD_MAX_PT_SIZE],
                             int Index,
                             CagdPointType OldPType)

    Description:

    Coerces Srf/Crv Point from index Index of Points array of Type PType to a
    new type NewPType. If however Index < 0 Points is considered single point.

    Parameters:

     NewPoint:  Where the coerced information is to besaved.
     NewPType:  Point type of the coerced new point.
     Points:    Array of vectors if Index >= 0, a single point if Index < 0.
     Index:     Index into the vectors of Points.
     OldPType:  Point type to be expected from Points.

    Returned Value:

      void

    Keywords:

      coercion

     CagdCoercePointsTo   (cagd_lib/cagdcoer.c:287)

    Prototype:

      void CagdCoercePointsTo(CagdRType *Points[],
                              int Len,
                              CagdPointType OldPType,
                              CagdPointType NewPType)

    Description:

    Coerces an array of vectors, Points. of point type OldPType to point type
    NewPType, in place.

    Parameters:

     Points:    Where the old and new points are placed.
     Len:       Length of vectors in the array of vectors, Points.
     OldPType:  Point type to be expected from Points.
     NewPType:  Point type of the coerced new point.

    Returned Value:

      void

    Keywords:

      coercion

     CagdCoerceSrfTo   (cagd_lib/cagdcoer.c:381)

    Prototype:

      CagdSrfStruct *CagdCoerceSrfTo(CagdSrfStruct *Srf, CagdPointType PType)

    Description:

    Coerces a surface to a new point type PType. If given surface is E1 or P1
    and requested new type is E3 or P3 the Y and Z coefficients are updated to
    hold the parametric domain of the surface.

    Parameters:

     Srf:       To be coerced to a new point type PType.
     PType:     New point type for Srf.

    Returned Value:

      CagdSrfStruct *:  The new, coerced to PType, surface.

    Keywords:

      coercion

     CagdCoerceToE2   (cagd_lib/cagdcoer.c:32)

    Prototype:

      void CagdCoerceToE2(CagdRType *E2Point,
                          CagdRType *Points[CAGD_MAX_PT_SIZE],
                          int Index,
                          CagdPointType PType)

    Description:

    Coerce Srf/Crv Point from index Index of Points array of Type PType to a
    point type E2.
      If however Index < 0 Points is considered single point.

    Parameters:

     E2Point:   Where the coerced information is to besaved.
     Points:    Array of vectors if Index >= 0, a single point if Index < 0.
     Index:     Index into the vectors of Points.
     PType:     Point type to be expected from Points.

    Returned Value:

      void

    Keywords:

      coercion

     CagdCoerceToE3 coercion   (cagd_lib/cagdcoer.c:78)

    Prototype:

      void CagdCoerceToE3(CagdRType *E3Point,
                          CagdRType *Points[CAGD_MAX_PT_SIZE],
                          int Index,
                          CagdPointType PType)

    Description:

    Coerce Srf/Crv Point from index Index of Points array of Type PType to a
    point type E3.
      If however Index < 0 Points is considered single point.

    Parameters:

     E3Point:   Where the coerced information is to besaved.
     Points:    Array of vectors if Index >= 0, a single point if Index < 0.
     Index:     Index into the vectors of Points.
     PType:     Point type to be expected from Points.

    Returned Value:

      void

    Keywords:

     CagdCoerceToP2   (cagd_lib/cagdcoer.c:131)

    Prototype:

      void CagdCoerceToP2(CagdRType *P2Point,
                          CagdRType *Points[CAGD_MAX_PT_SIZE],
                          int Index,
                          CagdPointType PType)

    Description:

    Coerce Srf/Crv Point from index Index of Points array of Type PType to a
    point type P2.
      If however Index < 0 Points is considered single point.

    Parameters:

     P2Point:   Where the coerced information is to besaved.
     Points:    Array of vectors if Index >= 0, a single point if Index < 0.
     Index:     Index into the vectors of Points.
     PType:     Point type to be expected from Points.

    Returned Value:

      void

    Keywords:

      coercion

     CagdCoerceToP3   (cagd_lib/cagdcoer.c:179)

    Prototype:

      void CagdCoerceToP3(CagdRType *P3Point,
                          CagdRType *Points[CAGD_MAX_PT_SIZE],
                          int Index,
                          CagdPointType PType)

    Description:

    Coerce Srf/Crv Point from index Index of Points array of Type PType to a
    point type P3.
      If however Index < 0 Points is considered single point.

    Parameters:

     P3Point:   Where the coerced information is to besaved.
     Points:    Array of vectors if Index >= 0, a single point if Index < 0.
     Index:     Index into the vectors of Points.
     PType:     Point type to be expected from Points.

    Returned Value:

      void

    Keywords:

      coercion

     CagdCrv2CtrlPoly   (cagd_lib/cagdmesh.c:24)

    Prototype:

      CagdPolylineStruct *CagdCrv2CtrlPoly(CagdCrvStruct *Crv)

    Description:

    Extracts the control polygon of a curve as a polyline.

    Parameters:

     Crv:        To extract a control polygon from.

    Returned Value:

      CagdPolylineStruct *:  The control polygon of Crv.

    Keywords:

      control polygon

     CagdCrvBBox   (cagd_lib/cagdbbox.c:68)

    Prototype:

      void CagdCrvBBox(CagdCrvStruct *Crv, CagdBBoxStruct *BBox)

    Description:

    Computes a bounding box for a freeform curve.

    Parameters:

     Crv:      To compute a bounding box for.
     BBox:     Where bounding information is to be saved.

    Returned Value:

      void

    See Also:

      CagdCrvListBBox
      CagdSrfBBox
      CagdTightBBox

    Keywords:

      bbox
      bounding box

     CagdCrvBiNormal   (cagd_lib/cagd_aux.c:1092)

    Prototype:

      CagdVecStruct *CagdCrvBiNormal(CagdCrvStruct *Crv,
                                     CagdRType t,
                                     CagdBType Normalize)

    Description:

    Given a curve Crv and a parameter value t, returns the (unit) binormal
    direction of Crv at t.

    Parameters:

     Crv:       To compute (unit) binormal vector for.
     t:         Location where to evaluate the binormal of Crv.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit binormal
                        information.

    Keywords:

      binormal

     CagdCrvCopy   (cagd_lib/cagd1gen.c:654)

    Prototype:

      CagdCrvStruct *CagdCrvCopy(CagdCrvStruct *Crv)

    Description:

    Allocates and copies all slots of a curve structure.

    Parameters:

     Crv:       To be copied.

    Returned Value:

      CagdCrvStruct *:  A duplicate of Crv.

    Keywords:

      copy

     CagdCrvCopyList   (cagd_lib/cagd1gen.c:965)

    Prototype:

      CagdCrvStruct *CagdCrvCopyList(CagdCrvStruct *CrvList)

    Description:

    Allocates and copies a list of curve structures.

    Parameters:

     CrvList:       To be copied.

    Returned Value:

      CagdCrvStruct *:  A duplicated list of curves.

    Keywords:

      copy

     CagdCrvCrvInter   (cagd_lib/cagd_cci.c:117)

    Prototype:

      CagdPtStruct *CagdCrvCrvInter(CagdCrvStruct *Crv1,
                                    CagdCrvStruct *Crv2,
                                    CagdRType Eps)

    Description:

      Computes the intersection points, if any, of the two given curves.

    Parameters:

     Crv1, Crv2:  Two curves to compute their intersection points.
     Eps:         Accuracy of computation.

    Returned Value:

      CagdPtStruct *:   List of intersection points.  Each points would
          contain (u1, u, 0.0).

    See Also:

      CagdCrvTanAngularSpan

    Keywords:

     CagdCrvDegreeRaise   (cagd_lib/cagd_aux.c:644)

    Prototype:

      CagdCrvStruct *CagdCrvDegreeRaise(CagdCrvStruct *Crv)

    Description:

    Returns a new curve representing the same curve as Crv but with its degree
    raised by one.

    Parameters:

     Crv:       To raise its degree.

    Returned Value:

      CagdCrvStruct *:  A curve with same geometry as Crv but with one degree
                        higher.

    Keywords:

      degree raising

     CagdCrvDegreeRaiseN   (cagd_lib/cagd_aux.c:676)

    Prototype:

      CagdCrvStruct *CagdCrvDegreeRaiseN(CagdCrvStruct *Crv, int NewOrder)

    Description:

    Returns a new curve representing the same curve as Crv but with its degree
    raised to NewOrder

    Parameters:

     Crv:        To raise its degree.
     NewOrder:   Expected new order of the raised curve.

    Returned Value:

      CagdCrvStruct *:  A curve with same geometry as Crv but with order that
                        is equal to NewOrder.

    Keywords:

      degree raising

     CagdCrvDerive   (cagd_lib/cagd_aux.c:333)

    Prototype:

      CagdCrvStruct *CagdCrvDerive(CagdCrvStruct *Crv)

    Description:

    Given a curve, computes its derivative curve (Hodograph).

    Parameters:

     Crv:      To compute its Hodograph curve.

    Returned Value:

      CagdCrvStruct *:  Resulting hodograph.

    See Also:

      BzrCrvDerive
      BspCrvDerive
      BzrCrvDeriveRational
      BspCrvDeriveRational

    Keywords:

      derivatives
      Hodograph

     CagdCrvDomain   (cagd_lib/cagd_aux.c:33)

    Prototype:

      void CagdCrvDomain(CagdCrvStruct *Crv, CagdRType *TMin, CagdRType *TMax)

    Description:

      Returns the parametric domain of a curve.

    Parameters:

     Crv:       To get its parametric domain.
     TMin:      Where to put the minimal domain's boundary.
     TMax:      Where to put the maximal domain's boundary.

    Returned Value:

      void

    See Also:

      BspCrvDomain

    Keywords:

      domain
      parametric domain

     CagdCrvEval   (cagd_lib/cagd_aux.c:74)

    Prototype:

      CagdRType *CagdCrvEval(CagdCrvStruct *Crv, CagdRType t)

    Description:

    Given a curve and parameter value t, evaluate the curve at t.

    Parameters:

     Crv:      To evaluate at the given parametric location t.
     t:        The parameter value at which the curve Crv is to be evaluated.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of curve Crv's point type. If for example the curve's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      BzrCrvEvalAtParam
      BspCrvEvalAtParam
      BzrCrvEvalVecAtParam

      BspCrvEvalVecAtParam
      BspCrvEvalCoxDeBoor
      CagdCrvEvalToPolyline

    Keywords:

      evaluation

     CagdCrvEvalToPolyline   (cagd_lib/cbspeval.c:134)

    Prototype:

      int CagdCrvEvalToPolyline(CagdCrvStruct *Crv,
                                int FineNess,
                                CagdRType *Points[],
                                BspKnotAlphaCoeffType *A,
                                CagdBType OptiLin)

    Description:

    Samples the curve at FineNess location equally spaced in the curve's
    parametric domain.
      Computes a refinement alpha matrix (If FineNess > 0), refines the curve
    and uses refined control polygon as the approximation to the curve.
      If FineNess == 0, Alpha matrix A is used instead.
      Returns the actual number of points in polyline (<= FineNess).
    Note this routine may be invoked with Bezier curves as well as Bspline.

    Parameters:

     Crv:         To approximate as a polyline.
     FineNess:    Control on number of samples.
     Points:      Where to put the resulting polyline.
     A:           Optional alpha matrix for refinement.
     OptiLin:     If TRUE, optimize linear curves.

    Returned Value:

      int:         The actual number of samples placed in Points. Always
                   less than or eaul to FineNess.

    See Also:

      BzrCrvEvalToPolyline
      AfdBzrCrvEvalToPolyline
      CagdCrvEval

    Keywords:

      conversion
      refinement
      evaluation

     CagdCrvFirstMoments   (cagd_lib/cbsp_int.c:361)

    Prototype:

      void CagdCrvFirstMoments(CagdCrvStruct *Crv,
                               int n,
                               CagdPType Loc,
                               CagdVType Dir)

    Description:

      Computes zero and first moments of a curve.

    Parameters:

     Crv:     To compute zero and first moment.
     n:       Number of samples the curve should be sampled at.
     Loc:     Center of curve as zero moment.
     Dir:     Main direction of curve as first moment.

    Returned Value:

      void

    Keywords:

     CagdCrvFree   (cagd_lib/cagd2gen.c:178)

    Prototype:

      void CagdCrvFree(CagdCrvStruct *Crv)

    Description:

    Deallocates and frees all slots of a curve structure.

    Parameters:

     Crv:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdCrvFreeList   (cagd_lib/cagd2gen.c:210)

    Prototype:

      void CagdCrvFreeList(CagdCrvStruct *CrvList)

    Description:

    Deallocates and frees a curve structure list:

    Parameters:

     CrvList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdCrvFromMesh   (cagd_lib/cagd_aux.c:790)

    Prototype:

      CagdCrvStruct *CagdCrvFromMesh(CagdSrfStruct *Srf,
                                     int Index,
                                     CagdSrfDirType Dir)

    Description:

    Extracts a curve from the mesh of surface Srf in direction Dir at index
    Index.

    Parameters:

     Srf:       To extract a curve from.
     Index:     Index along the mesh of Srf to extract the curve from.
     Dir:       Direction of extracted curve. Either U or V.

    Returned Value:

      CagdCrvStruct *:   A curve from Srf. This curve inherit the  order and
                         continuity of surface Srf in direction Dir. However,
                         thiscurve is not on surface Srf, in general.

    See Also:

      CagdCrvFromSrf
      BzrSrfCrvFromSrf
      BspSrfCrvFromSrf
      BzrSrfCrvFromMesh

      BspSrfCrvFromMesh
      CagdCrvToMesh

    Keywords:

      isoparametric curves
      curve from mesh

     CagdCrvFromSrf   (cagd_lib/cagd_aux.c:750)

    Prototype:

      CagdCrvStruct *CagdCrvFromSrf(CagdSrfStruct *Srf,
                                    CagdRType t,
                                    CagdSrfDirType Dir)

    Description:

    Extracts an isoparametric curve from the surface Srf in direction Dir at
    the parameter value of t.

    Parameters:

     Srf:       To extract an isoparametric curve from.
     t:         Parameter value of extracted isoparametric curve.
     Dir:       Direction of extracted isoparametric curve. Either U or V.

    Returned Value:

      CagdCrvStruct *:   An isoparametric curve of Srf. This curve inherit the
                         order and continuity of surface Srf in direction Dir.

    See Also:

      BzrSrfCrvFromSrf
      BspSrfCrvFromSrf
      CagdCrvFromMesh
      BzrSrfCrvFromMesh

      BspSrfCrvFromMesh
      TrngCrvFromTriSrf

    Keywords:

      isoparametric curves
      curve from surface

     CagdCrvIntegrate   (cagd_lib/cagd_aux.c:365)

    Prototype:

      CagdCrvStruct *CagdCrvIntegrate(CagdCrvStruct *Crv)

    Description:

    Given a curve, compute its integral curve.

    Parameters:

     Crv:      To compute its integral curve.

    Returned Value:

      CagdCrvStruct *:  Resulting integral curve.

    See Also:

      BzrCrvIntegrate
      BspCrvIntegrate

    Keywords:

      integrals

     CagdCrvListBBox   (cagd_lib/cagdbbox.c:126)

    Prototype:

      void CagdCrvListBBox(CagdCrvStruct *Crvs, CagdBBoxStruct *BBox)

    Description:

    Computes a bounding box for a list of freeform curves.

    Parameters:

     Crvs:     To compute a bounding box for.
     BBox:     Where bounding information is to be saved.

    Returned Value:

      void

    See Also:

      CagdCrvBBox
      CagdSrfBBox
      CagdTightBBox

    Keywords:

      bbox
      bounding box

     CagdCrvMatTransform   (cagd_lib/cagd2gen.c:1132)

    Prototype:

      void CagdCrvMatTransform(CagdCrvStruct *Crv, CagdMType Mat)

    Description:

    Applies an homogeneous transformation, in place, to the given curve Crv as
    specified by homogeneous transformation Mat.

    Parameters:

     Crv:       To be transformed.
     Mat:       Defining the transformation.

    Returned Value:

      void

    See Also:

      CagdTransform
      CagdSrfMatTransform
      CagdMatTransform

    Keywords:

      scaling
      rotation
      translation
      transformations

     CagdCrvMinMax   (cagd_lib/cagdbbox.c:332)

    Prototype:

      void CagdCrvMinMax(CagdCrvStruct *Crv,
                         int Axis,
                         CagdRType *Min,
                         CagdRType *Max)

    Description:

    Computes a min max bound on a curve in a given axis.
      The curve is not coerced to anything and the given axis is tested
    directly where 0 is the W axis and 1, 2, 3 are the X, Y, Z etc.

    Parameters:

     Crv:      To test for minimum/maximum.
     Axis:     0 for W, 1 for X, 2 for Y etc.
     Min:      Where minimum found value should be place.
     Max:      Where maximum found value should be place.

    Returned Value:

      void

    Keywords:

      bbox
      bounding box
      minimum
      maximum

     CagdCrvNew   (cagd_lib/cagd1gen.c:32)

    Prototype:

      CagdCrvStruct *CagdCrvNew(CagdGeomType GType, CagdPointType PType, int Length)

    Description:

      Allocates the memory required for a new curve.

    Parameters:

     GType:      Type of geometry the curve should be - Bspline, Bezier etc.
     PType:      Type of control points (E2, P3, etc.).
     Length:     Number of control points

    Returned Value:

      CagdCrvStruct *:   An uninitialized freeform curve.

    See Also:

      BzrCrvNew
      BspPeriodicCrvNew
      bspCrvNew
      CagdPeriodicCrvNew
      TrimCrvNew

    Keywords:

      allocation

     CagdCrvNodes   (cagd_lib/bsp_knot.c:937)

    Prototype:

      CagdRType *CagdCrvNodes(CagdCrvStruct *Crv)

    Description:

    Returns the nodes of a freeform curve.

    Parameters:

     Crv:      To compute node values for.

    Returned Value:

      CagdRType *: Node values of the given curve.

    Keywords:

      node values

     CagdCrvNormal   (cagd_lib/cagd_aux.c:1167)

    Prototype:

      CagdVecStruct *CagdCrvNormalXY(CagdCrvStruct *Crv,
                                     CagdRType t,
                                     CagdBType Normalize)

    Description:

    Given a curve Crv and a parameter value t, returns the (unit) normal
    direction of Crv at t, that is consistent over inflection points.
      That is, this normal is not flipped over inflection points and is always
    90 rotation from the tangent vector.
      Needless to say, this function is for two dimensional palanr curves.

    Parameters:

     Crv:       To compute (unit) normal vector for.
     t:         Location where to evaluate the normal of Crv.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit normal
                        information.

    Keywords:

      normal

     CagdCrvNormal   (cagd_lib/cagd_aux.c:1128)

    Prototype:

      CagdVecStruct *CagdCrvNormal(CagdCrvStruct *Crv,
                                   CagdRType t,
                                   CagdBType Normalize)

    Description:

    Given a curve Crv and a parameter value t, returns the (unit) normal
    direction of Crv at t.

    Parameters:

     Crv:       To compute (unit) normal vector for.
     t:         Location where to evaluate the normal of Crv.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit normal
                        information.

    Keywords:

      normal

     CagdCrvRefineAtParams   (cagd_lib/cagd_aux.c:550)

    Prototype:

      CagdCrvStruct *CagdCrvRefineAtParams(CagdCrvStruct *Crv,
                                           CagdBType Replace,
                                           CagdRType *t,
                                           int n)

    Description:

    Given a curve - refines it at the given n knots as defined by vector t.
    If Replace is TRUE, the values in t replaces current knot vector.
    Returns pointer to refined surface (Note a Bezier curve will be converted
    into a Bspline curve).

    Parameters:

     Crv:       To refine.
     Replace:   If TRUE, t holds knots in exactly the same length as the
                  length of the knot vector of Crv and t simply replaces the
                  knot vector.
     t:         Vector of knots with length of n.
     n:         Length of vector t.

    Returned Value:

      CagdCrvStruct *:  A refined curve of Crv after insertion of all the
                        knots as specified by vector t of length n.

    Keywords:

      refinement
      subdivision

     CagdCrvRegionFromCrv   (cagd_lib/cagd_aux.c:465)

    Prototype:

      CagdCrvStruct *CagdCrvRegionFromCrv(CagdCrvStruct *Crv,
                                          CagdRType t1,
                                          CagdRType t2)

    Description:

    Given a curve - extracts a sub-region within the domain specified by t1
    and t2.

    Parameters:

     Crv:       To extract a sub-region from.
     t1, t2:    Parametric domain boundaries of sub-region.

    Returned Value:

      CagdCrvStruct *:  Sub-region extracted from Crv from t1 to t2.

    Keywords:

      regions
      subdivision

     CagdCrvReverse   (cagd_lib/cagd_aux.c:586)

    Prototype:

      CagdCrvStruct *CagdCrvReverse(CagdCrvStruct *Crv)

    Description:

    Returns a new curve that is the reversed curve of Crv by reversing the
    control polygon and the knot vector of Crv is a Bspline curve.
    See also BspKnotReverse.

    Parameters:

     Crv:       To be reversed.

    Returned Value:

      CagdCrvStruct *:   Reversed curve of Crv.

    Keywords:

      reverse

     CagdCrvSubdivAtParam   (cagd_lib/cagd_aux.c:432)

    Prototype:

      CagdCrvStruct *CagdCrvSubdivAtParam(CagdCrvStruct *Crv, CagdRType t)

    Description:

    Given a curve - subdivides it into two curves at the given parameter
    value t.
       Returns pointer to first curve in a list of two subdivided curves.

    Parameters:

     Crv:      To subdivide at the prescibed parameter value t.
     t:        The parameter to subdivide the curve Crv at.

    Returned Value:

      CagdCrvStruct *:  A list of the two curves resulting from the process
                        of subdivision.

    Keywords:

      subdivision

     CagdCrvTanAngularSpan   (cagd_lib/cagd_cci.c:52)

    Prototype:

      CagdBType CagdCrvTanAngularSpan(CagdCrvStruct *Crv,
                                      CagdVType Dir,
                                      CagdRType *AngularSpan)

    Description:

      Given a curve, computes the angular span of its tangent field, in XY
    plane.

    Parameters:

     Crv:          Curve to consider
     Dir:          General, median, direction of tangent field, in XY plane.
     AngularSpan:  Maximal deviation of tangent field from Dir, in radians.

    Returned Value:

      CagdBType:    TRUE if angular span of curve is less than 180 degrees,
              FALSE otherwise.  In the later case, Dir and Angle are invalid.

    See Also:

      CagdCrvCrvInter

    Keywords:

     CagdCrvTangent   (cagd_lib/cagd_aux.c:1056)

    Prototype:

      CagdVecStruct *CagdCrvTangent(CagdCrvStruct *Crv,
                                    CagdRType t,
                                    CagdBType Normalize)

    Description:

    Given a curve Crv and a parameter value t, returns the (unit) tangent
    direction of Crv at t.

    Parameters:

     Crv:       To compute (unit) tangent vector for.
     t:         Location where to evaluate the tangent of Crv.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit tanegnt
                        information.

    Keywords:

      tangent

     CagdCrvToMesh   (cagd_lib/cagd_aux.c:830)

    Prototype:

      void CagdCrvToMesh(CagdCrvStruct *Crv,
                         int Index,
                         CagdSrfDirType Dir,
                         CagdSrfStruct *Srf)

    Description:

    Substitutes a row/column of surface Srf from the given curve Crv at
    surface direction Dir and mesh index Index. Curve must have the same
    PtType/Length as the surface in the selected direction.

    Parameters:

     Crv:       To substitute into the surface Srf.
     Index:     Of mesh where the curve Crv should be substituted in.
     Dir:       Either U or V.
     Srf:       That a row or a column of should be replaced by Crv.

    Returned Value:

      void

    See Also:

      CagdCrvFromSrf
      CagdCrvFromMesh

    Keywords:

      curve from mesh

     CagdCrvTransform   (cagd_lib/cagd2gen.c:1000)

    Prototype:

      void CagdCrvTransform(CagdCrvStruct *Crv,
                            CagdRType *Translate,
                            CagdRType Scale)

    Description:

    Applies an affine transform, in place, to given curve Crv as specified by
    Translate and Scale.
      Each control point is first translated by Translate and then scaled by
    Scale.

    Parameters:

     Crv:         To be affinely transformed.
     Translate:   Translation amount.
     Scale:       Scaling amount.

    Returned Value:

      void

    See Also:

      CagdSrfTransform
      CagdTransform
      CagdCrvMatTransform

    Keywords:

      scaling
      translation
      transformations

     CagdCtlPtArrayFree   (cagd_lib/cagd2gen.c:488)

    Prototype:

      void CagdCtlPtArrayFree(CagdCtlPtStruct *CtlPtArray, int Size)

    Description:

    Deallocates and frees an array of CtlPt structure.

    Parameters:

     CtlPtArray:     To be deallocated.
     Size:           Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdCtlPtArrayNew   (cagd_lib/cagd1gen.c:335)

    Prototype:

      CagdCtlPtStruct *CagdCtlPtArrayNew(CagdPointType PtType, int Size)

    Description:

    Allocates and resets all slots of an array of CtlPt structures.

    Parameters:

     Size:      Size of CtlPt array to allocate.

    Returned Value:

      CagdCtlPtStruct *:  An array of CtlPt structures of size Size.

    Keywords:

      allocation

     CagdCtlPtCopy   (cagd_lib/cagd1gen.c:811)

    Prototype:

      CagdCtlPtStruct *CagdCtlPtCopy(CagdCtlPtStruct *CtlPt)

    Description:

    Allocates and copies all slots of a CtlPt structure.

    Parameters:

     CtlPt:       To be copied.

    Returned Value:

      CagdUVStruct *:  A duplicate of CtlPt.

    Keywords:

      copy

     CagdCtlPtCopyList   (cagd_lib/cagd1gen.c:1081)

    Prototype:

      CagdCtlPtStruct *CagdCtlPtCopyList(CagdCtlPtStruct *CtlPtList)

    Description:

    Allocates and copies a list of CtlPt structures.

    Parameters:

     CtlPtList:       To be copied.

    Returned Value:

      CagdCtlPtStruct *:  A duplicated list of CtlPt's.

    Keywords:

      copy

     CagdCtlPtFree   (cagd_lib/cagd2gen.c:441)

    Prototype:

      void CagdCtlPtFree(CagdCtlPtStruct *CtlPt)

    Description:

    Deallocates and frees all slots of a CtlPt structure.

    Parameters:

     CtlPt:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdCtlPtFreeList   (cagd_lib/cagd2gen.c:463)

    Prototype:

      void CagdCtlPtFreeList(CagdCtlPtStruct *CtlPtList)

    Description:

    Deallocates and frees a CtlPt structure list:

    Parameters:

     CtlPtList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdCtlPtNew   (cagd_lib/cagd1gen.c:364)

    Prototype:

      CagdCtlPtStruct *CagdCtlPtNew(CagdPointType PtType)

    Description:

    Allocates and resets all slots of a CtlPt structure.

    Parameters:

     None

    Returned Value:

      CagdUVStruct *:  A CtlPt structure.

    Keywords:

      allocation

     CagdCubicHermiteCrv   (cagd_lib/hermite.c:29)

    Prototype:

      CagdCrvStruct *CagdCubicHermiteCrv(CagdPType Pt1,
                                         CagdPType Pt2,
                                         CagdVType Dir1,
                                         CagdVType Dir2)

    Description:

      Construct a cubic Bezier curve using the Hermite constraints - two
    positions and two tangents.

    Parameters:

     Pt1, Pt2:   Starting and end points of curve.
     Dir1, Dir2:  tarting and end vectors of curve.

    Returned Value:

      CagdCrvStruct *:   A cubic Bezier curve, satisfying the four constrants.

    Keywords:

      Hermite

     CagdCubicHermiteSrf   (cagd_lib/hermite.c:68)

    Prototype:

      CagdSrfStruct *CagdCubicHermiteSrf(CagdCrvStruct *Pos1Crv,
                                         CagdCrvStruct *Pos2Crv,
                                         CagdCrvStruct *Dir1Crv,
                                         CagdCrvStruct *Dir2Crv)

    Description:

      Construct a cubic Bezier curve using the Hermite constraints - two
    positions and two tangents.

    Parameters:

     Pos1Crv, Pos2Crv:  Starting and end curves of surface.
     Dir1Crv, Dir1Crv:  Starting and end tangent fields surface.

    Returned Value:

      CagdSrfStruct *:   A cubic by something Bezier surface, satisfying the
                         four constrants. The other something degree is the
                         largest of the four given curves.

    Keywords:

      Hermite

     CagdDbg   (cagd_lib/cagd_dbg.c:26)

    Prototype:

      void CagdDbg(void *Obj)

    Description:

    Prints curves and surfaces to stderr. Should be linked to programs for
    debugging purposes, so curves and surfaces may be inspected from the
    debugger.

    Parameters:

     Obj:       Either a curve or a surface - to be printed to stderr.

    Returned Value:

      void

    Keywords:

      debugging

     CagdDescribeError   (cagd_lib/cagd_err.c:96)

    Prototype:

      char *CagdDescribeError(CagdFatalErrorType ErrorNum)

    Description:

    Returns a string describing a the given error. Errors can be raised by
    any member of this cagd library as well as other users. Raised error will
    cause an invokation of CagdFatalError function which decides how to handle
    this error. CagdFatalError can for example, invoke this routine with the
    error type, print the appropriate message and quit the program.

    Parameters:

     ErrorNum:   Type of the error that was raised.

    Returned Value:

      char *:     A string describing the error type.

    Keywords:

      error handling

     CagdDistPtPlane   (cagd_lib/mshplanr.c:177)

    Prototype:

      CagdRType CagdDistPtPlane(CagdPlaneStruct *Plane,
                                CagdRType **Points,
                                int Index,
                                int MaxDim)

    Description:

    Computes and returns distance between point Index and given plane which is
    assumed to be normalized, so that the A B C plane;s normal has a unit
    length.
      Also assumes the Points are non rational with MaxDim dimension.

    Parameters:

     Plane:      To compute the distance to.
     Points:     To compute the distance from.
     Index:      Index in Points for the point to consider.
     MaxDim:     Number of dimensions to consider. Less or equal to three.

    Returned Value:

      CagdRType:   Resulting distance.

    Keywords:

      point plane distance

     CagdDistanceTwoCtlPts   (cagd_lib/mshplanr.c:31)

    Prototype:

      CagdRType CagdDistanceTwoCtlPts(CagdRType **Points,
                                      int Index1,
                                      int Index2,
                                      CagdPointType PType)

    Description:

    Computes the distance between two control points at given indices Index?.
    Only E2 or E3 point types are supported.

    Parameters:

     Points:    To compute the distance between.
     Index1:    Index of first point to consider.
     Index2:    Index of second point to consider.
     PType:     Type of points. Must be E2 or E3

    Returned Value:

      CagdRType:    Euclidean distance between the two points.

    Keywords:

      distance

     CagdEditSingleCrvPt   (cagd_lib/cagdedit.c:33)

    Prototype:

      CagdCrvStruct *CagdEditSingleCrvPt(CagdCrvStruct *Crv,
                                         CagdCtlPtStruct *CtlPt,
                                         int Index,
                                         CagdBType Write)

    Description:

    Provides the way to modify/get a single control point into/from the curve.

    Parameters:

     Crv:        Curve to be modified/query.
     CtlPt:      New control point to be substituted into Crv. Must carry the
                   same PType as Crv if to be written to Crv.
     Index:      In curve CRV's control polygon to substitute/query CtlPt.
     Write:      If TRUE CtlPt is copied into Crv, if FALSE the point is
                   copied from Crv to CtlPt.

    Returned Value:

      CagdCrvStruct *: If Write is TRUE, the new modified curve, if WRITE is
                       FALSE, NULL.

    Keywords:

      curve editing

     CagdEditSingleSrfPt   (cagd_lib/cagdedit.c:88)

    Prototype:

      CagdSrfStruct *CagdEditSingleSrfPt(CagdSrfStruct *Srf,
                                         CagdCtlPtStruct *CtlPt,
                                         int UIndex,
                                         int VIndex,
                                         CagdBType Write)

    Description:

    Provides the way to modify/get a single control point into/from a surface.

    Parameters:

     Srf:        Surface to be modified/query.
     CtlPt:      New control point to be substituted into Srf. Must carry the
                   same PType as Srf if to be written to Srf.
     UIndex, VIndex:  n surface Srf's control mesh to substitute/query CtlPt.
     Write:      If TRUE CtlPt is copied into Srf, if FALSE the point is
                   copied from Srf to CtlPt.

    Returned Value:

      CagdCrvStruct *: If Write is TRUE, the new modified curve, if WRITE is
                       FALSE, NULL.

    Keywords:

      surface editing

     CagdEstimateCrvColinearity   (cagd_lib/mshplanr.c:247)

    Prototype:

      CagdRType CagdEstimateCrvColinearity(CagdCrvStruct *Crv)

    Description:

    Tests polygonal colinearity by testing the distance of interior control
    points from the line connecting the two control polygon end points.
      Returns a relative ratio of deviation from line relative to its length.
      Zero means all points are colinear.
      If two end points are same (no line can be fit) IRIT_INFNTY is returned.

    Parameters:

     Crv:       To measure its colinearity.

    Returned Value:

      CagdRType:    Colinearity relative measure.

    Keywords:

      conversion
      colinearity

     CagdEstimateSrfPlanarity   (cagd_lib/mshplanr.c:334)

    Prototype:

      CagdRType CagdEstimateSrfPlanarity(CagdSrfStruct *Srf)

    Description:

    ests mesh colinearity by testing the distance of interior points from the
    plane thru 3 corner points.
      Returns a relative ratio of deviation from plane relative to its size.
      Zero means all points are coplanar.
      If end points are same ( no plane can be fit ) IRIT_INFNTY is returned.

    Parameters:

     Srf:        To measure its coplanarity.

    Returned Value:

      CagdRType:    Coplanarity measure.

    Keywords:

      conversion
      coplanarity

     CagdEvaluateSurfaceVecField   (cagd_lib/cagd_aux.c:287)

    Prototype:

      void CagdEvaluateSurfaceVecField(CagdVType Vec,
                                       CagdSrfStruct *VecFieldSrf,
                                       CagdRType U,
                                       CagdRType V)

    Description:

    Evaluates a vector field surface to a unit size vector. If fails, moves a
    tad until success. Useful for normal field evaluations.

    Parameters:

     Vec:            Where resulting unit length vector is to be saved.
     VecFieldSrf:    A surface representing a vector field.
     U, V:           Parameter locations.

    Returned Value:

      void

    Keywords:

      normal
      vector field

     CagdExtrudeSrf   (cagd_lib/cagdextr.c:28)

    Prototype:

      CagdSrfStruct *CagdExtrudeSrf(CagdCrvStruct *Crv, CagdVecStruct *Vec)

    Description:

    Constructs an extrusion surface in the Vector direction for the given
    profile curve. Input curve can be either a Bspline or a Bezier curve and
    the resulting output surface will be of the same type.

    Parameters:

     Crv:     To exturde in direction specified by Vec.
     Vec:     Direction as well as magnitude of extursion.

    Returned Value:

      CagdSrfStruct *:   An extrusion surface with Orders of the original
                         Crv order and 2 in the extrusion direction.

    Keywords:

      surface constructors

     CagdFatalError   (cagd_lib/cagd_ftl.c:27)

    Prototype:

      void CagdFatalError(CagdFatalErrorType ErrID)

    Description:

    Trap Cagd_lib errors right here. Provides a default error handler for the
    cagd library. Gets an error description using CagdDescribeError, prints it
    and exit the program using exit.

    Parameters:

     ErrID:      Error type that was raised.

    Returned Value:

      void

    Keywords:

      error handling

     CagdFitPlaneThruCtlPts   (cagd_lib/mshplanr.c:73)

    Prototype:

      CagdRType CagdFitPlaneThruCtlPts(CagdPlaneStruct *Plane,
                                       CagdPointType PType,
                                       CagdRType **Points,
                                       int Index1,
                                       int Index2,
                                       int Index3,
                                       int Index4)

    Description:

    Fits a plane through the four points from Points indices Index?. Points
    may be either E2 or E3 only.
      Returns 0.0 if failed to fit a plane, otherwise a measure on the size of
    the mesh data (distance between points) is returned.

    Parameters:

     Plane:       To compute and save here.
     PType:       Point type expected of four points. Must be E2 or E3.
     Points:      Point array where to look for the four points.
     Index?:      Four indices of the points.

    Returned Value:

      CagdRType:     Measure  on the distance between the data points, 0.0 if
                     fitting failed.

    Keywords:

      plane fit

     CagdIChooseK   (cagd_lib/cbzreval.c:310)

    Prototype:

      CagdRType CagdIChooseK(int i, int k)

    Description:

    Evaluates the following (in floating point arithmetic):

                           k         k!
                          ( ) = -------------
                           i    i! * (k - i)!

    Parameters:

     i, k:   Coefficients of i choose k.

    Returned Value:

      CagdRType:   Result of i choose k, in floating point, to prevent from
                   overflows.

    Keywords:

      evaluation
      combinatorics

     CagdIsClosedCrv   (cagd_lib/cagd1gen.c:1110)

    Prototype:

      CagdBType CagdIsClosedCrv(CagdCrvStruct *Crv)

    Description:

      Returns TRUE if the curve is a closed loop.

    Parameters:

     Crv:       To test for a closed loop.

    Returned Value:

      CagdBType:    TRUE if closed, FALSE otherwise.

    Keywords:

     CagdListAppend   (cagd_lib/cagd2gen.c:963)

    Prototype:

      VoidPtr CagdListAppend(VoidPtr List1, VoidPtr List2)

    Description:

    Appends two lists, in place.

    Parameters:

     List1, List2:  Two lists of cagd objects to append, in place.

    Returned Value:

      VoidPtr:       Appended list.

    Keywords:

     CagdListInsert   (cagd_lib/cagd2gen.c:885)

    Prototype:

      VoidPtr CagdListInsert(VoidPtr List,
                             VoidPtr NewElement,
                             CagdCompFuncType CompFunc,
                             CagdBType InsertEqual)

    Description:

      Inserts a new element NewElement into an ordered list List.  Ordering
    is prescribed by CompFunc.

    Parameters:

     List:        The list to update, in place. Can be empty list.
     NewElement:  New element to insert, in place into List.
     CompFunc:    A comparison function.  Gets two elements of the list and
                    compare and return a positive, zero, or negative values
                    if first elements is smaller, equal, larger than second
                    element, strcmp style.
     InsertEqual:  f TRUE, a new item that is found to be equal to an item in
                    the list will be insert anyway. If FALSE, NULL is returned
                    and no modification is made to the list, if equal.

    Returned Value:

      VoidPtr:     The updated list.  NULL if !InsertEqual and found equality.
                   If NULL is returned, no modification was made to List.

    Keywords:

     CagdListLast   (cagd_lib/cagd2gen.c:846)

    Prototype:

      VoidPtr CagdListLast(VoidPtr List)

    Description:

    Returns the last element of given list of cagd library objects.

    Parameters:

     List:       To return its last element,

    Returned Value:

      VoidPtr:    Last element.

    Keywords:

     CagdListLength   (cagd_lib/cagd2gen.c:939)

    Prototype:

      int CagdListLength(VoidPtr List)

    Description:

    Computes the length of a list.

    Parameters:

     List:          List of cagd objects.

    Returned Value:

      int:           Length of list.

    Keywords:

     CagdListReverse   (cagd_lib/cagd2gen.c:814)

    Prototype:

      VoidPtr CagdListReverse(VoidPtr List)

    Description:

    Reverses a list of cagd library objects, in place.

    Parameters:

     List:       To be reversed.

    Returned Value:

      VoidPtr:    Reversed list.

    Keywords:

      reverse

     CagdMakeCrvsCompatible   (cagd_lib/cagdcmpt.c:37)

    Prototype:

      CagdBType CagdMakeCrvsCompatible(CagdCrvStruct **Crv1,
                                       CagdCrvStruct **Crv2,
                                       CagdBType SameOrder,
                                       CagdBType SameKV)

    Description:

    Given two curves, makes them compatible by:
    1. Coercing their point type to be the same.
    2. Making them have the same curve type.
    3. Raising the degree of the lower one to be the same as the higher.
    4. Refining them to a common knot vector (If Bspline and SameOrder).

    Note 3 is performed if SameOrder TRUE, 4 if SameKV TRUE.
    Both curves are modified IN PLACE.

    Parameters:

     Crv1, Crv2:  Two curves to be made compatible, in place.
     SameOrder:   If TRUE, this routine make sure they share the same order.
     SameKV:      If TRUE, this routine make sure they share the same
                    knot vector and hence continuity.                           *

    Returned Value:

      CagdBType:   TRUE if successful, FALSE otherwise.

    Keywords:

      compatibility

     CagdMakeSrfsCompatible   (cagd_lib/cagdcmpt.c:185)

    Prototype:

      CagdBType CagdMakeSrfsCompatible(CagdSrfStruct **Srf1,
                                       CagdSrfStruct **Srf2,
                                       CagdBType SameUOrder,
                                       CagdBType SameVOrder,
                                       CagdBType SameUKV,
                                       CagdBType SameVKV)

    Description:

    Given two surfaces, makes them compatible by:
    1. Coercing their point type to be the same.
    2. Making them have the same curve type.
    3. Raising the degree of the lower one to be the same as the higher.
    4. Refining them to a common knot vector (If Bspline and SameOrder).

    Note 3 is performed if SameOrder TRUE, 4 if SameKV TRUE.
    Both surface are modified IN PLACE.

    Parameters:

     Srf1, Srf2:  Two surfaces to be made compatible, in place.
     SameUOrder:  If TRUE, this routine make sure they share the same U
                    order.
     SameVOrder:  If TRUE, this routine make sure they share the same
                    order.
     SameUKV:     If TRUE, this routine make sure they share the same U
                    knot vector and hence continuity.                           *
     SameVKV:     If TRUE, this routine make sure they share the same
                    knot vector and hence continuity.

    Returned Value:

      CagdBType:   TRUE if successful, FALSE otherwise.

    Keywords:

      compatibility

     CagdMatTransform   (cagd_lib/cagd2gen.c:1265)

    Prototype:

      void CagdMatTransform(CagdRType **Points,
                            int Len,
                            int MaxCoord,
                            CagdBType IsNotRational,
                            CagdMType Mat)

    Description:

    Applies an homogeneous transformation, in place, to given set of points
    Points which as array of vectors, each vector of length Len.
      Array Points optionally contains (if !IsNotRational) in Points[0] the
    weights coefficients and in Points[i] the coefficients of axis i, up to
    and include MaxCoord (X = 1, Y = 2, etc.).

    Parameters:

     Points:         To be affinely transformed. Array of vectors.
     Len:            Of vectors of Points.
     MaxCoord:       Maximum number of coordinates to be found in Points.
     IsNotRational:  Do we have weights as vector Points[0]?
     Mat:       Defining the transformation.

    Returned Value:

      void

    See Also:

      CagdTransform
      CagdSrfMatTransform
      CagdCrvMatTransform

    Keywords:

      scaling
      rotation
      translation
      transformations

     CagdMatchDistNorm   (cagd_lib/crvmatch.c:306)

    Prototype:

      CagdRType CagdMatchDistNorm(CagdVType T1,
                                  CagdVType T2,
                                  CagdVType P1,
                                  CagdVType P2)

    Description:

      Computes the distance norm to the matching.

    Parameters:

     T1:   pointer to tangent to the first curve at i-th point.
     T2:   pointer to tangent to the second curve at j-th point.
     P1:   pointer to value of the first curve at i-th point.
     P2:   pointer to value of the second curve at j-th point.

    Returned Value:

      CagdRType: A numeric matching value, the smaller the better.

    Keywords:

      correspondance
      matching

     CagdMatchDistNorm   (cagd_lib/crvmatch.c:335)

    Prototype:

      CagdRType CagdMatchBisectorNorm(CagdVType T1,
                                      CagdVType T2,
                                      CagdVType P1,
                                      CagdVType P2)

    Description:

      Computes the distance norm to the matching.

    Parameters:

     T1:   pointer to tangent to the first curve at i-th point.
     T2:   pointer to tangent to the second curve at j-th point.
     P1:   pointer to value of the first curve at i-th point.
     P2:   pointer to value of the second curve at j-th point.

    Returned Value:

      CagdRType: A numeric matching value, the smaller the better.

    Keywords:

      correspondance
      matching

     CagdMatchMorphNorm   (cagd_lib/crvmatch.c:383)

    Prototype:

      CagdRType CagdMatchMorphNorm(CagdVType T1,
                                   CagdVType T2,
                                   CagdVType P1,
                                   CagdVType P2)

    Description:

      Computes the default morphing norm to the matching.

    Parameters:

     T1:   pointer to tangent to the first curve at i-th point.
     T2:   pointer to tangent to the second curve at j-th point.
     P1:   pointer to value of the first curve at i-th point.
     P2:   pointer to value of the second curve at j-th point.

    Returned Value:

      CagdRType: -1 for no matching or the cost of the matching for the point
                  between zero and one.

    Keywords:

      correspondance
      matching

     CagdMatchRuledNorm   (cagd_lib/crvmatch.c:415)

    Prototype:

      CagdRType CagdMatchRuledNorm(CagdVType T1,
                                   CagdVType T2,
                                   CagdVType P1,
                                   CagdVType P2)

    Description:

      Computes the default ruled norm to the matching.

    Parameters:

     T1:   pointer to tangent to the first curve at i-th point.
     T2:   pointer to tangent to the second curve at j-th point.
     P1:   pointer to value of the first curve at i-th point.
     P2:   pointer to value of the second curve at j-th point.

    Returned Value:

      CagdRType: -1 for no matching or the cost of the matching for the point
                  between zero and one.

    Keywords:

      correspondance
      matching

     CagdMatchingTwoCurves   (cagd_lib/crvmatch.c:850)

    Prototype:

      CagdCrvStruct *CagdMatchingTwoCurves(CagdCrvStruct *Crv1,
                                           CagdCrvStruct *Crv2,
                                           int Reduce,
                                           int SampleSet,
                                           int ReparamOrder,
                                           int RotateFlag,
                                           int AllowNegativeNorm,
                                           CagdMatchNormFuncType MatchNormFunc)

    Description:

      Gets two freeform curves, Crv1, nd Crv2, computes a new parametrization
    to Crv2 using composition between Crv2 and a computed reparametrization
    that establishes a matching correspondance between Crv1 and Crv2.

    Parameters:

     Crv1:   The first curve.
     Crv2:   The second curve.
     Reduce:  he degrees of freedom of the reparametrization curve. The
               larger this number is, the better the reparametrization will be
               at the cost of more computation. Must be less than SampleSet
     SampleSet:     Number of samples the two curves are sampled at. The
               larger this number is, the better the reparametrization will be
     ReparamOrder:  Order of reparametrization curve.
     RotateFlag:  se or not use rotation in finding best matching
     AllowNegativeNorm:  If TRUE, negative norms are locally allowed.
     MatchNormFunc:   pointer to the matching norm.

    Returned Value:

      CagdCrvStruct *: The second curve, Crv2, after reparametrization that
                       matches the first curve.

    Keywords:

      correspondance
      matching

     CagdMergeBBox   (cagd_lib/cagdbbox.c:299)

    Prototype:

      void CagdMergeBBox(CagdBBoxStruct *DestBBox, CagdBBoxStruct *SrcBBox)

    Description:

    Merges (union) two bounding boxes into one, in place.

    Parameters:

     DestBBox:    One BBox operand as well as the result.
     SrcBBox:     Second BBox operand.

    Returned Value:

      void

    Keywords:

      bbox
      bounding box

     CagdMergeCrvCrv   (cagd_lib/cagdcmrg.c:40)

    Prototype:

      CagdCrvStruct *CagdMergeCrvCrv(CagdCrvStruct *Crv1,
                                     CagdCrvStruct *Crv2,
                                     int InterpolateDiscont)

    Description:

    Merges two curves by connecting the end of Crv1 to the beginning of Crv2.
     If the end of Crv1 is identical to the beginning of Crv2 then the result
    is as expected. However, if the curves do not meet, their end points are
    linearly interpolated if InterpolateDiscont is TRUE or simply blended out
    in a freeform shape if InterpolateDiscont is FALSE.

    Parameters:

     Crv1:                 To connect to Crv1's starting location at its end.
     Crv2:                 To connect to Crv2's end location at its start.
     InterpolateDiscont:   If TRUE, linearly interpolate discontinuity.

    Returned Value:

      CagdCrvStruct *:     The merged curve.

    Keywords:

      merge

     CagdMergeCrvList   (cagd_lib/cagdcmrg.c:172)

    Prototype:

      CagdCrvStruct *CagdMergeCrvList(CagdCrvStruct *CrvList, int InterpDiscont)

    Description:

    Merges a list of curves by connecting the end of one curve to the begining
    of the next. See also CagdMergeCrvCrv.

    Parameters:

     CrvList:              To connect into one curve.
     InterpolateDiscont:   If TRUE, linearly interpolate discontinuity.

    Returned Value:

      CagdCrvStruct *:     The merged curve.

    Keywords:

      merge

     CagdMergeCrvPt   (cagd_lib/cagdcmrg.c:209)

    Prototype:

      CagdCrvStruct *CagdMergeCrvPt(CagdCrvStruct *Crv, CagdPtStruct *Pt)

    Description:

    Merges a curve and a point by connecting the end of Crv to Pt, using a
    linear segment.

    Parameters:

     Crv:          To connect to Pt its end.
     Pt:           To connect to Crv's end point.

    Returned Value:

      CagdCrvStruct *:     The merged curve.

    Keywords:

      merge

     CagdMergePointType   (cagd_lib/cagdcoer.c:440)

    Prototype:

      CagdPointType CagdMergePointType(CagdPointType PType1, CagdPointType PType2)

    Description:

    Returns a point type which spans the spaces of both two given point types.

    Parameters:

     PType1, PType2:  o point types to find the point type of their union.

    Returned Value:

      CagdPointType:  A point type of the union of the spaces of PType1 and
                      PType2.

    Keywords:

      coercion

     CagdMergePtCrv   (cagd_lib/cagdcmrg.c:292)

    Prototype:

      CagdCrvStruct *CagdMergePtCrv(CagdPtStruct *Pt, CagdCrvStruct *Crv)

    Description:

    Merges a point and a curve by connecting Pt to the starting point of Crv,
    using a linear segment.

    Parameters:

     Pt:           To connect to Crv's starting point.
     Crv:          To connect to Pt its starting point.

    Returned Value:

      CagdCrvStruct *:     The merged curve.

    Keywords:

      merge

     CagdMergePtPt   (cagd_lib/cagdcmrg.c:374)

    Prototype:

      CagdCrvStruct *CagdMergePtPt(CagdPtStruct *Pt1, CagdPtStruct *Pt2)

    Description:

    Merges two points by connecting Pt1 to Pt2, using a linear segment.

    Parameters:

     Pt1, Pt2:     Two points to connect using a linear segment.

    Returned Value:

      CagdCrvStruct *:     The merged curve.

    Keywords:

      merge

     CagdMergeSrfList   (cagd_lib/cagdsmrg.c:300)

    Prototype:

      CagdSrfStruct *CagdMergeSrfList(CagdSrfStruct *SrfList,
                                      CagdSrfDirType Dir,
                                      CagdBType SameEdge,
                                      int InterpolateDiscont)

    Description:

    Merges a list of surfaces by connecting the end of one surface to the
    begining of the next. See also CagdMergeSrfSrf.

    Parameters:

     SrfList:              To connect into one surface.
     Dir:                  Direction the merge should take place. Either U
                             or V.
     SameEdge:             If the two surfaces sharea common edge.
     InterpolateDiscont:   If TRUE, linearly interpolate discontinuity.

    Returned Value:

      CagdSrfStruct *:     The merged surface.

    Keywords:

      merge

     CagdMergeSrfSrf   (cagd_lib/cagdsmrg.c:41)

    Prototype:

      CagdSrfStruct *CagdMergeSrfSrf(CagdSrfStruct *Srf1,
                                     CagdSrfStruct *Srf2,
                                     CagdSrfDirType Dir,
                                     CagdBType SameEdge,
                                     int InterpolateDiscont)

    Description:

    Merges two surfaces in the requested direction Dir.
     If SameEdge, it is assumed last edge of Srf1 is identical to first edge
    of Srf2 and one row is dropped from new mesh. Otherwise a ruled surface is
    fit between the two edges.

    Parameters:

     Srf1:                 To connect to Srf1's starting boundary at its end.
     Srf2:                 To connect to Srf2's end boundary at its start.
     Dir:                  Direction the merge should take place. Either U
                             or V.
     SameEdge:             If the two surfaces sharea common edge.
     InterpolateDiscont:   If TRUE, linearly interpolate discontinuity.

    Returned Value:

      CagdSrfStruct *:     The merged surface.

    Keywords:

      merge

     CagdPeriodicCrvNew   (cagd_lib/cagd1gen.c:81)

    Prototype:

      CagdCrvStruct *CagdPeriodicCrvNew(CagdGeomType GType,
                                        CagdPointType PType,
                                        int Length,
                                        CagdBType Periodic)

    Description:

      Allocates the memory required for a new, possibly periodic, curve.

    Parameters:

     GType:      Type of geometry the curve should be - Bspline, Bezier etc.
     PType:      Type of control points (E2, P3, etc.).
     Length:     Number of control points
     Periodic:   Is this curve periodic?

    Returned Value:

      CagdCrvStruct *:   An uninitialized freeform curve.

    See Also:

      BzrCrvNew
      BspCrvNew
      BspPeriodicCrvNew
      CagdCrvNew
      TrimCrvNew

    Keywords:

      allocation

     CagdPeriodicSrfNew   (cagd_lib/cagd1gen.c:188)

    Prototype:

      CagdSrfStruct *CagdPeriodicSrfNew(CagdGeomType GType,
                                        CagdPointType PType,
                                        int ULength,
                                        int VLength,
                                        CagdBType UPeriodic,
                                        CagdBType VPeriodic)

    Description:

      Allocates the memory required for a new, possibly periodic, surface.

    Parameters:

     GType:      Type of geometry the surface should be - Bspline, Bezier etc.
     PType:      Type of control points (E2, P3, etc.).
     ULength:    Number of control points in the U direction.
     VLength:    Number of control points in the V direction.
     UPeriodic:  Is this surface periodic in the U direction?
     VPeriodic:  Is this surface periodic in the V direction?

    Returned Value:

      CagdSrfStruct *:   An uninitialized freeform surface.

    See Also:

      BzrSrfNew
      BspSrfNew
      BspPeriodicSrfNew
      CagdSrfNew
      TrimSrfNew

    Keywords:

      allocation

     CagdPlaneArrayFree   (cagd_lib/cagd2gen.c:628)

    Prototype:

      void CagdPlaneArrayFree(CagdPlaneStruct *PlaneArray, int Size)

    Description:

    Deallocates and frees an array of plane structure.

    Parameters:

     PlaneArray:     To be deallocated.
     Size:           Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdPlaneArrayNew   (cagd_lib/cagd1gen.c:440)

    Prototype:

      CagdPlaneStruct *CagdPlaneArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of Plane structures.

    Parameters:

     Size:      Size of Plane array to allocate.

    Returned Value:

      CagdPlaneStruct *:  An array of Plane structures of size Size.

    Keywords:

      allocation

     CagdPlaneCopy   (cagd_lib/cagd1gen.c:861)

    Prototype:

      CagdPlaneStruct *CagdPlaneCopy(CagdPlaneStruct *Plane)

    Description:

    Allocates and copies all slots of a Plane structure.

    Parameters:

     Plane:       To be copied.

    Returned Value:

      CagdPlaneStruct *:  A duplicate of Plane.

    Keywords:

      copy

     CagdPlaneCopyList   (cagd_lib/cagd2gen.c:62)

    Prototype:

      CagdPlaneStruct *CagdPlaneCopyList(CagdPlaneStruct *PlaneList)

    Description:

    Allocates and copies a list of plane structures.

    Parameters:

     PlaneList:       To be copied.

    Returned Value:

      CagdPlaneStruct *:  A duplicated list of planes.

    Keywords:

      copy

     CagdPlaneFree   (cagd_lib/cagd2gen.c:581)

    Prototype:

      void CagdPlaneFree(CagdPlaneStruct *Plane)

    Description:

    Deallocates and frees all slots of a plane structure.

    Parameters:

     Plane:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPlaneFreeList   (cagd_lib/cagd2gen.c:603)

    Prototype:

      void CagdPlaneFreeList(CagdPlaneStruct *PlaneList)

    Description:

    Deallocates and frees a plane structure list:

    Parameters:

     PlaneList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPlaneNew   (cagd_lib/cagd1gen.c:468)

    Prototype:

      CagdPlaneStruct *CagdPlaneNew(void)

    Description:

    Allocates and resets all slots of a Plane structure.

    Parameters:

     None

    Returned Value:

      CagdUVStruct *:  A Plane structure.

    Keywords:

      allocation

     CagdPointsBBox   (cagd_lib/cagdbbox.c:262)

    Prototype:

      void CagdPointsBBox(CagdRType **Points, int Length, CagdBBoxStruct *BBox)

    Description:

    Computes a bounding box for a set of control points.

    Parameters:

     Points:     To compute bounding box for.
     Length:     Length of vectors of Points array.
     BBox:       Where bounding information is to be saved.

    Returned Value:

      void

    Keywords:

      bbox
      bounding box

     CagdPointsHasPoles   (cagd_lib/cagd2gen.c:1320)

    Prototype:

      CagdBType CagdPointsHasPoles(CagdRType **Points, int Len)

    Description:

      Returns TRUE if the given control points have poles - that is have both
    negative and positive weights.                                             N

    Parameters:

     Points:      Control points to consider.
     Len:         Number of points in Points.

    Returned Value:

      CagdBType:   TRUE if has poles, FALSE otherwise.

    Keywords:

     CagdPolyApproxErrEstimate   (cagd_lib/poly_err.c:43)

    Prototype:

      int CagdPolyApproxErrEstimate(CagdPolyErrEstimateType Method, int Samples)

    Description:

      Sets the methods of sampling the error of a polygonal approximation.

    Parameters:

     Method:     1. Samples one distance at the center of each polygon.
                   2. Samples Samples samples uniformly distributed in the
                      parametric area of each polygon and selects the maximum.
                   3. Samples Samples samples uniformly distributed in the
                      parametric area of each polygon and selects the average.
     Samples:    Number of samples to sample in the parametric domain of each
                   polygon.

    Returned Value:

      int:        Old sampling method + Old sampling rate << 8

    Keywords:

      polygonization
      error estimate

     CagdPolyApproxErrs   (cagd_lib/poly_err.c:114)

    Prototype:

      CagdRType *CagdPolyApproxErrs(CagdSrfStruct *Srf, CagdPolygonStruct *Polys)

    Description:

      Returns the errors between the surface and its polygonal approx.

    Parameters:

     Srf:       Approximated surface.
     Polys:     The given polygonal approximation.
                  Assumes UV slots are computed and updated in Polys.

    Returned Value:

      CagdRType *:   Errors between surface and its polygons. A vector of size
                  (number of polygons + 1) holding the maximal error of each
                  polygon. The last element of the vector will be negative.

    Keywords:

      polygonization
      error estimate

     CagdPolyApproxMaxErr   (cagd_lib/poly_err.c:80)

    Prototype:

      CagdRType CagdPolyApproxMaxErr(CagdSrfStruct *Srf, CagdPolygonStruct *Polys)

    Description:

      Returns the maximal error between the surface and its polygonal approx.

    Parameters:

     Srf:       Approximated surface.
     Polys:     The given polygonal approximation.
                  Assumes UV slots are computed and updated in Polys.

    Returned Value:

      CagdRType:   Maximal error between surface and polygonal approximation

    Keywords:

      polygonization
      error estimate

     CagdPolygonArrayNew   (cagd_lib/cagd1gen.c:544)

    Prototype:

      CagdPolygonStruct *CagdPolygonArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of Polygon structures.

    Parameters:

     Size:      Size of Polygon array to allocate.

    Returned Value:

      CagdPolygonStruct *:  An array of Polygon structures of size Size.

    Keywords:

      allocation

     CagdPolygonCopy   (cagd_lib/cagd1gen.c:911)

    Prototype:

      CagdPolygonStruct *CagdPolygonCopy(CagdPolygonStruct *Poly)

    Description:

    Allocates and copies all slots of a Polygon structure.

    Parameters:

     Poly:       To be copied.

    Returned Value:

      CagdPolygonStruct *:  A duplicate of Polygon.

    Keywords:

      copy

     CagdPolygonCopyList   (cagd_lib/cagd2gen.c:149)

    Prototype:

      CagdPolygonStruct *CagdPolygonCopyList(CagdPolygonStruct *PolyList)

    Description:

    Allocates and copies a list of polygon structures.

    Parameters:

     PolyList:       To be copied.

    Returned Value:

      CagdPolygontruct *:  A duplicated list of polygons.

    Keywords:

      copy

     CagdPolygonFree   (cagd_lib/cagd2gen.c:768)

    Prototype:

      void CagdPolygonFree(CagdPolygonStruct *Poly)

    Description:

    Deallocates and frees all slots of a polygon structure.

    Parameters:

     Poly:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPolygonFreeList   (cagd_lib/cagd2gen.c:790)

    Prototype:

      void CagdPolygonFreeList(CagdPolygonStruct *PolyList)

    Description:

    Deallocates and frees a polygon structure list:

    Parameters:

     PolyList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPolygonNew   (cagd_lib/cagd1gen.c:572)

    Prototype:

      CagdPolygonStruct *CagdPolygonNew(void)

    Description:

    Allocates and resets all slots of a Polygon structure.

    Parameters:

     None

    Returned Value:

      CagdPolygonStruct *:  A Polygon structure.

    Keywords:

      allocation

     CagdPolygonSetErrFunc   (cagd_lib/cagd2gen.c:1357)

    Prototype:

      CagdPlgErrorFuncType CagdPolygonSetErrFunc(CagdPlgErrorFuncType Func)

    Description:

      Sets the polygon approximation error function.  The error function
    will return a negative value if this triangle must be purged or otherwise
    a non negative error measure.

    Parameters:

     Func:        New function to use, NULL to disable.

    Returned Value:

      CagdPlErrorFuncType:  Old value of function.

    Keywords:

     CagdPolylineArrayNew   (cagd_lib/cagd1gen.c:596)

    Prototype:

      CagdPolylineStruct *CagdPolylineArrayNew(int Length, int Size)

    Description:

    Allocates and resets all slots of an array of Polyline structures.

    Parameters:

     Size:      Size of Polyline array to allocate.

    Returned Value:

      CagdPolylineStruct *:  An array of Polyline structures of size Size.

    Keywords:

      allocation

     CagdPolylineCopy   (cagd_lib/cagd1gen.c:936)

    Prototype:

      CagdPolylineStruct *CagdPolylineCopy(CagdPolylineStruct *Poly)

    Description:

    Allocates and copies all slots of a Polyline structure.

    Parameters:

     Poly:       To be copied.

    Returned Value:

      CagdPolylineStruct *:  A duplicate of Polyline.

    Keywords:

      copy

     CagdPolylineCopyList   (cagd_lib/cagd2gen.c:120)

    Prototype:

      CagdPolylineStruct *CagdPolylineCopyList(CagdPolylineStruct *PolyList)

    Description:

    Allocates and copies a list of polyline structures.

    Parameters:

     PolyList:       To be copied.

    Returned Value:

      CagdPolylineStruct *:  A duplicated list of polylines.

    Keywords:

      copy

     CagdPolylineFree   (cagd_lib/cagd2gen.c:721)

    Prototype:

      void CagdPolylineFree(CagdPolylineStruct *Poly)

    Description:

    Deallocates and frees all slots of a polyline structure.

    Parameters:

     Poly:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPolylineFreeList   (cagd_lib/cagd2gen.c:744)

    Prototype:

      void CagdPolylineFreeList(CagdPolylineStruct *PolyList)

    Description:

    Deallocates and frees a polyline structure list:

    Parameters:

     PolyList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPolylineNew   (cagd_lib/cagd1gen.c:626)

    Prototype:

      CagdPolylineStruct *CagdPolylineNew(int Length)

    Description:

    Allocates and resets all slots of a Polyline structure.

    Parameters:

     None

    Returned Value:

      CagdPolylineStruct *:  A Polyline structure.

    Keywords:

      allocation

     CagdPrimCone2Srf   (cagd_lib/cagdprim.c:148)

    Prototype:

      CagdSrfStruct *CagdPrimCone2Srf(CagdVType Center,
                                      CagdRType MajorRadius,
                                      CagdRType MinorRadius,
                                      CagdRType Height,
                                      CagdBType Rational)

    Description:

      A surface constructor of a truncated cone, centered at Center and radii
    of MajorRadius and MinorRadius. A MinorRadius of zero would construct a
    regular cone.  Otherwise, a truncated cone.

    Parameters:

     Center:        of constructed cone (center of its base).
     MajorRadius:   of constructed cone.
     MinorRadius:   of constructed cone.
     Height:        of constructed cone.
     Rational:      If TRUE exact ration sphere is created.  If FALSE an
                      approximated integral surface is created.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing a cone.

    See Also:

      CagdPrimSphereSrf
      CagdPrimTorusSrf
      CagdPrimConeSrf

      CagdPrimCylinderSrf

    Keywords:

     CagdPrimConeSrf   (cagd_lib/cagdprim.c:211)

    Prototype:

      CagdSrfStruct *CagdPrimConeSrf(CagdVType Center,
                                     CagdRType Radius,
                                     CagdRType Height,
                                     CagdBType Rational)

    Description:

      A surface constructor of a cone, centered at Center and radii of
    MajorRadius and MinorRadius.  A MinorRadius of zero would construct a
    regular cone.  Otherwise, a truncated cone.

    Parameters:

     Center:        of constructed cone (center of its base).
     Radius:        of constructed cone's base.
     Height:        of constructed cone.
     Rational:      If TRUE exact ration sphere is created.  If FALSE an
                      approximated integral surface is created.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing a cone.

    See Also:

      CagdPrimSphereSrf
      CagdPrimTorusSrf
      CagdPrimCone2Srf

      CagdPrimCylinderSrf

    Keywords:

     CagdPrimCylinderSrf   (cagd_lib/cagdprim.c:240)

    Prototype:

      CagdSrfStruct *CagdPrimCylinderSrf(CagdVType Center,
                                         CagdRType Radius,
                                         CagdRType Height,
                                         CagdBType Rational)

    Description:

      A surface constructor of a Cylinder, centered at Center and radii of
    Radius and MinorRadius.

    Parameters:

     Center:        of constructed Cylinder (center of its base).
     Radius:        of constructed Cylinder.
     Height:        of constructed Cylinder.
     Rational:      If TRUE exact ration sphere is created.  If FALSE an
                      approximated integral surface is created.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing a cylinder.

    See Also:

      CagdPrimSphereSrf
      CagdPrimTorusSrf
      CagdPrimCone2Srf
      CagdPrimConeSrf

    Keywords:

     CagdPrimSphereSrf   (cagd_lib/cagdprim.c:36)

    Prototype:

      CagdSrfStruct *CagdPrimSphereSrf(CagdVType Center,
                                       CagdRType Radius,
                                       CagdBType Rational)

    Description:

      A surface constructor of a sphere, centered at Center and radius Radius.

    Parameters:

     Center:   of constructed sphere.
     Radius:   of constructed sphere.
     Rational:  f TRUE exact ration sphere is created.  If FALSE an
                    approximated integral surface is created.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing a sphere.

    See Also:

      CagdPrimTorusSrf
      CagdPrimCone2Srf
      CagdPrimConeSrf
      CagdPrimCylinderSrf

    Keywords:

     CagdPrimTorusSrf   (cagd_lib/cagdprim.c:91)

    Prototype:

      CagdSrfStruct *CagdPrimTorusSrf(CagdVType Center,
                                      CagdRType MajorRadius,
                                      CagdRType MinorRadius,
                                      CagdBType Rational)

    Description:

      A surface constructor of a torus, centered at Center and radii of
    MajorRadius and MinorRadius.

    Parameters:

     Center:        of constructed torus.
     MajorRadius:   of constructed torus.
     MinorRadius:   of constructed torus.
     Rational:      If TRUE exact ration sphere is created.  If FALSE an
                      approximated integral surface is created.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing a torus.

    See Also:

      CagdPrimSphereSrf
      CagdPrimCone2Srf
      CagdPrimConeSrf

      CagdPrimCylinderSrf

    Keywords:

     CagdPromoteCrvToSrf   (cagd_lib/cagdruld.c:155)

    Prototype:

      CagdSrfStruct *CagdPromoteCrvToSrf(CagdCrvStruct *Crv, CagdSrfDirType Dir)

    Description:

    Promotes a curve to a surface by creating a ruled surface between the
    curve to itself. Dir controls if the curve should be U or V surface
    direction.
      The resulting surface is degenerate in that its speed is zero in the
    ruled direction and hence thesurface is not regular.

    Parameters:

     Crv:      A Crv to promote into a surface
     Dir:      Direction of ruling. Either U or V.

    Returned Value:

      CagdSrfStruct *: The surface promoted from Crv.

    Keywords:

     CagdPtArrayFree   (cagd_lib/cagd2gen.c:418)

    Prototype:

      void CagdPtArrayFree(CagdPtStruct *PtArray, int Size)

    Description:

    Deallocates and frees an array of Pt structure.

    Parameters:

     PtArray:     To be deallocated.
     Size:        Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdPtArrayNew   (cagd_lib/cagd1gen.c:284)

    Prototype:

      CagdPtStruct *CagdPtArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of Pt structures.

    Parameters:

     Size:      Size of Pt array to allocate.

    Returned Value:

      CagdPtStruct *:  An array of Pt structures of size Size.

    Keywords:

      allocation

     CagdPtCopy   (cagd_lib/cagd1gen.c:786)

    Prototype:

      CagdPtStruct *CagdPtCopy(CagdPtStruct *Pt)

    Description:

    Allocates and copies all slots of a Pt structure.

    Parameters:

     Pt:       To be copied.

    Returned Value:

      CagdPtStruct *:  A duplicate of Pt.

    Keywords:

      copy

     CagdPtCopyList   (cagd_lib/cagd1gen.c:1052)

    Prototype:

      CagdPtStruct *CagdPtCopyList(CagdPtStruct *PtList)

    Description:

    Allocates and copies a list of point structures.

    Parameters:

     PtList:       To be copied.

    Returned Value:

      CagdPtStruct *:  A duplicated list of points.

    Keywords:

      copy

     CagdPtFree   (cagd_lib/cagd2gen.c:371)

    Prototype:

      void CagdPtFree(CagdPtStruct *Pt)

    Description:

    Deallocates and frees all slots of a point structure.

    Parameters:

     Pt:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPtFreeList   (cagd_lib/cagd2gen.c:393)

    Prototype:

      void CagdPtFreeList(CagdPtStruct *PtList)

    Description:

    Deallocates and frees a point structure list:

    Parameters:

     PtList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdPtNew   (cagd_lib/cagd1gen.c:311)

    Prototype:

      CagdPtStruct *CagdPtNew(void)

    Description:

    Allocates and resets all slots of a Pt structure.

    Parameters:

     None

    Returned Value:

      CagdPtStruct *:  A Pt structure.

    Keywords:

      allocation

     CagdRuledSrf   (cagd_lib/cagdruld.c:33)

    Prototype:

      CagdSrfStruct *CagdRuledSrf(CagdCrvStruct *Crv1,
                                  CagdCrvStruct *Crv2,
                                  int OtherOrder,
                                  int OtherLen)

    Description:

    Constructs a ruled surface between the two provided curves.
    OtherOrder and OtherLen (equal for Bezier) specifies the desired order and
    refineness level (if Bspline) of the other ruled direction.

    Parameters:

     Crv1, Crv2:  he two curves to form a ruled surface in between.
     OtherOrder:  sually two, but one can specify higher orders in the ruled
                   direction. OtherOrder must never be larger than OrderLen.
     OtherLen:   Usually two control points in the ruled direction which
                   necesitates a linear interpolation.

    Returned Value:

      CagdSrfStruct *:  The rule surface.

    Keywords:

      ruled surface
      surface constructors

     CagdSetLinear2Poly   (cagd_lib/cagd2gen.c:1450)

    Prototype:

      void CagdSetLinear2Poly(CagdLin2PolyType Lin2Poly)

    Description:

    Sets the way (co)linear surfaces are converted into polygons.

    Parameters:

     Lin2Poly:  Specification.

    Returned Value:

      void

    Keywords:

      polygonization
      polygonal approximation

     CagdSrf2CtrlMesh   (cagd_lib/cagdmesh.c:57)

    Prototype:

      CagdPolylineStruct *CagdSrf2CtrlMesh(CagdSrfStruct *Srf)

    Description:

    Extracts the control mesh of a surface as a list of polylines.

    Parameters:

     Srf:        To extract a control mesh from.

    Returned Value:

      CagdPolylineStruct *:  The control mesh of Srf.

    Keywords:

      control mesh

     CagdSrf2Polygons   (cagd_lib/cagd_aux.c:203)

    Prototype:

      CagdPolygonStruct *CagdSrf2Polygons(CagdSrfStruct *Srf,
                                          int FineNess,
                                          CagdBType ComputeNormals,
                                          CagdBType FourPerFlat,
                                          CagdBType ComputeUV)

    Description:

      Routine to convert a single freeform surface to set of triangles
    approximating it. FineNess is a fineness control on result and the larger
    is more triangles may result. A value of 10 is a good start value.
    NULL is returned in case of an error, otherwise list of CagdPolygonStruct.

    Parameters:

     Srf:              To approximate into triangles.
     FineNess:         Control on accuracy, the higher the finer.
     ComputeNormals:   If TRUE, normal information is also computed.
     FourPerFlat:      If TRUE, four triangles are created per flat surface.
                         If FALSE, only 2 triangles are created.
     ComputeUV:        If TRUE, UV values are stored and returned as well.

    Returned Value:

      CagdPolygonStruct *:  A list of polygons with optional normal and/or
                            UV parametric information.
                            NULL is returned in case of an error.

    See Also:

      BzrSrf2Polygons
      BspSrf2Polygons
      CagdCrv2Polyline
      CagdSrf2Polylines.

    Keywords:

      evaluation
      polygonal approximation

     CagdSrf2Polylines   (cagd_lib/cagd_aux.c:252)

    Prototype:

      CagdPolylineStruct *CagdSrf2Polylines(CagdSrfStruct *Srf,
                                            int NumOfIsocurves[2],
                                            int SamplesPerCurve)

    Description:

      Routine to convert a single Bspline surface to NumOfIsolines polylines
    in each parametric direction with SamplesPerCurve in each isoparametric
    curve.
      Polyline are always E3 of CagdPolylineStruct type.
      Iso parametric curves are sampled equally spaced in parametric space.
      NULL is returned in case of an error, otherwise list of
    CagdPolylineStruct. Attempt is made to extract isolines along C1
    discontinuities first.

    Parameters:

     Srf:                 Srf to extract isoparametric curves from.
     NumOfIsocurves:      To extarct from Srf in each (U or V) direction.
     SamplesPerCurve:     Fineness control on piecewise linear curve
                            approximation.

    Returned Value:

      CagdPolylineStruct *: List of polygons representing a piecewise linear
                            approximation of the extracted isoparamteric
                            curves or NULL is case of an error.

    See Also:

      BspCrv2Polyline
      BzrSrf2Polylines
      IritSurface2Polylines

      IritTrimSrf2Polylines
      SymbSrf2Polylines
      TrimSrf2Polylines

    Keywords:

      polylines
      isoparametric curves

     CagdSrfBBox   (cagd_lib/cagdbbox.c:155)

    Prototype:

      void CagdSrfBBox(CagdSrfStruct *Srf, CagdBBoxStruct *BBox)

    Description:

    Computes a bounding box for a freeform surface.

    Parameters:

     Srf:      To compute a bounding box for.
     BBox:     Where bounding information is to be saved.

    Returned Value:

      void

    See Also:

      CagdCrvBBox
      CagdSrfListBBox
      CagdTightBBox

    Keywords:

      bbox
      bounding box

     CagdSrfCopy   (cagd_lib/cagd1gen.c:702)

    Prototype:

      CagdSrfStruct *CagdSrfCopy(CagdSrfStruct *Srf)

    Description:

    Allocates and copies all slots of a surface structure.

    Parameters:

     Srf:       To be copied.

    Returned Value:

      CagdSrfStruct *:  A duplicate of Srf.

    Keywords:

      copy

     CagdSrfCopyList   (cagd_lib/cagd1gen.c:994)

    Prototype:

      CagdSrfStruct *CagdSrfCopyList(CagdSrfStruct *SrfList)

    Description:

    Allocates and copies a list of surface structures.

    Parameters:

     SrfList:       To be copied.

    Returned Value:

      CagdSrfStruct *:  A duplicated list of surfaces.

    Keywords:

      copy

     CagdSrfDegreeRaise   (cagd_lib/cagd_aux.c:711)

    Prototype:

      CagdSrfStruct *CagdSrfDegreeRaise(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns a new surface representing the same surface as Srf but with its
    degree raised by one.

    Parameters:

     Srf:       To raise its degree.
     Dir:       Direction of degree raising. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A surface with same geometry as Srf but with one
                        degree higher.

    See Also:

      BzrSrfDegreeRaise
      BspSrfDegreeRaise
      TrimSrfDegreeRaise

    Keywords:

      degree raising

     CagdSrfDerive   (cagd_lib/cagd_aux.c:399)

    Prototype:

      CagdSrfStruct *CagdSrfDerive(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Given a surface, computes its partial derivative in the prescibed
    direction Dir.

    Parameters:

     Srf:      To compute its derivative surface in direction Dir.
     Dir:      Direction of differentiation. Either U or V.

    Returned Value:

      CagdSrfStruct *:  Resulting partial derivative surface.

    See Also:

      BzrSrfDerive
      BspSrfDerive
      BzrSrfDeriveRational
      BspSrfDeriveRational

    Keywords:

      derivatives
      partial derivatives

     CagdSrfDomain   (cagd_lib/cagd_aux.c:114)

    Prototype:

      void CagdSrfDomain(CagdSrfStruct *Srf,
                         CagdRType *UMin,
                         CagdRType *UMax,
                         CagdRType *VMin,
                         CagdRType *VMax)

    Description:

      Returns the parametric domain of a surface.

    Parameters:

     Srf:       To get its parametric domain.
     UMin:      Where to put the minimal U domain's boundary.
     UMax:      Where to put the maximal U domain's boundary.
     VMin:      Where to put the minimal V domain's boundary.
     VMax:      Where to put the maximal V domain's boundary.

    Returned Value:

      void

    See Also:

      BspSrfDomain

    Keywords:

      domain
      parametric domain

     CagdSrfEval   (cagd_lib/cagd_aux.c:157)

    Prototype:

      CagdRType *CagdSrfEval(CagdSrfStruct *Srf, CagdRType u, CagdRType v)

    Description:

    Given a surface and parameter values u, v, evaluate the surface at (u, v).

    Parameters:

     Srf:     To evaluate at the given parametric location (u, v).
     u, v:    The parameter values at which the curve Crv is to be evaluated.

    Returned Value:

      CagdRType *:  A vector holding all the coefficients of all components
                    of surface Srf's point type. If for example the surface's
                    point type is P2, the W, X, and Y will be saved in the
                    first three locations of the returned vector. The first
                    location (index 0) of the returned vector is reserved for
                    the rational coefficient W and XYZ always starts at second
                    location of the returned vector (index 1).

    See Also:

      CagdCrvEval
      BspSrfEvalAtParam
      BzrSrfEvalAtParam

      BspSrfEvalAtParam2
      TrimSrfEval

    Keywords:

      evaluation

     CagdSrfFree   (cagd_lib/cagd2gen.c:234)

    Prototype:

      void CagdSrfFree(CagdSrfStruct *Srf)

    Description:

    Deallocates and frees all slots of a surface sstructure.

    Parameters:

     Srf:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdSrfFreeList   (cagd_lib/cagd2gen.c:277)

    Prototype:

      void CagdSrfFreeList(CagdSrfStruct *SrfList)

    Description:

    Deallocates and frees a surface structure list:

    Parameters:

     SrfList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdSrfFromCrvs   (cagd_lib/cagdcsrf.c:33)

    Prototype:

      CagdSrfStruct *CagdSrfFromCrvs(CagdCrvStruct *CrvList, int OtherOrder)

    Description:

    Constructs a surface using a set of curves. Curves are made to be
    compatible and then each is substituted into the new surface's mesh as a
    row.
      If the OtherOrder is less than the number of curves, number of curves is
    used.
      A knot vector is formed with uniform open end for the other direction,
    so it interpolates the first and last curves.
      Note, however, that only the first and the last curves are interpolated
    if OtherOrder is greater than 2.

    Parameters:

     CrvList:      List of curves to consturct a surface with.
     OtherOrder:   Other order of surface.

    Returned Value:

      CagdSrfStruct *:  Constructed surface from curves.

    Keywords:

      surface constructors

     CagdSrfListBBox   (cagd_lib/cagdbbox.c:235)

    Prototype:

      void CagdSrfListBBox(CagdSrfStruct *Srfs, CagdBBoxStruct *BBox)

    Description:

    Computes a bounding box for a list of freeform surfaces.

    Parameters:

     Srfs:     To compute a bounding box for.
     BBox:     Where bounding information is to be saved.

    Returned Value:

      void

    See Also:

      CagdCrvBBox
      CagdSrfBBox
      CagdTightBBox

    Keywords:

      bbox
      bounding box

     CagdSrfMatTransform   (cagd_lib/cagd2gen.c:1194)

    Prototype:

      void CagdSrfMatTransform(CagdSrfStruct *Srf, CagdMType Mat)

    Description:

    Applies an homogeneous transformation, in place, to the given surface Srf
    as specified by homogeneous transformation Mat.

    Parameters:

     Srf:       To be transformed.
     Mat:       Defining the transformation.

    Returned Value:

      void

    See Also:

      CagdTransform
      CagdCrvMatTransform
      CagdMatTransform

    Keywords:

      scaling
      rotation
      translation
      transformations

     CagdSrfMinMax   (cagd_lib/cagdbbox.c:378)

    Prototype:

      void CagdSrfMinMax(CagdSrfStruct *Srf,
                         int Axis,
                         CagdRType *Min,
                         CagdRType *Max)

    Description:

    Computes a min max bound on a surface in a given axis.
      The surface is not coerced to anything and the given axis is tested
    directly where 0 is the W axis and 1, 2, 3 are the X, Y, Z etc.

    Parameters:

     Srf:      To test for minimum/maximum.
     Axis:     0 for W, 1 for X, 2 for Y etc.
     Min:      Where minimum found value should be place.
     Max:      Where maximum found value should be place.

    Returned Value:

      void

    Keywords:

      bbox
      bounding box
      minimum
      maximum

     CagdSrfNew   (cagd_lib/cagd1gen.c:130)

    Prototype:

      CagdSrfStruct *CagdSrfNew(CagdGeomType GType,
                                CagdPointType PType,
                                int ULength,
                                int VLength)

    Description:

      Allocates the memory required for a new surface.

    Parameters:

     GType:      Type of geometry the surface should be - Bspline, Bezier etc.
     PType:      Type of control points (E2, P3, etc.).
     ULength:    Number of control points in the U direction.
     VLength:    Number of control points in the V direction.

    Returned Value:

      CagdSrfStruct *:   An uninitialized freeform surface.

    See Also:

      BzrSrfNew
      BspPeriodicSrfNew
      BspSrfNew
      CagdPeriodicSrfNew
      TrimSrfNew

    Keywords:

      allocation

     CagdSrfNodes   (cagd_lib/bsp_knot.c:976)

    Prototype:

      CagdRType *CagdSrfNodes(CagdSrfStruct *Srf, CagdSrfDirType Dir)

    Description:

    Returns the nodes of a freeform surface.

    Parameters:

     Srf:      To compute node values for.
     Dir:      Either the U or the V parametric direction.

    Returned Value:

      CagdRType *: Node values of the given surface and given parametric
                   direction.

    Keywords:

      node values

     CagdSrfNormal   (cagd_lib/cagd_aux.c:1266)

    Prototype:

      CagdVecStruct *CagdSrfNormal(CagdSrfStruct *Srf,
                                   CagdRType u,
                                   CagdRType v,
                                   CagdBType Normalize)

    Description:

    Given a surface Srf and a parameter values u, v, returns the (unit) normal
    vector of Srf.

    Parameters:

     Srf:       To compute (unit) normal vector for.
     u, v:      Location where to evaluate the normal of Srf.
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit normal
                        information.

    See Also:

      BzrSrfNormal
      BspSrfNormal
      SymbSrfNormalSrf
      TrngTriSrfNrml

      pSrfMeshNormals

    Keywords:

      normal

     CagdSrfRefineAtParams   (cagd_lib/cagd_aux.c:1015)

    Prototype:

      CagdSrfStruct *CagdSrfRefineAtParams(CagdSrfStruct *Srf,
                                           CagdSrfDirType Dir,
                                           CagdBType Replace,
                                           CagdRType *t,
                                           int n)

    Description:

    Given a surface - refines it at the given n knots as defined by vector t.
      If Replace is TRUE, the values in t replaces current knot vector.
      Returns pointer to refined surface (Note a Bezier surface will be
    converted into a Bspline surface).

    Parameters:

     Srf:       To refine.
     Dir:       Direction of refinement. Either U or V.
     Replace:   If TRUE, t holds knots in exactly the same length as the
                  length of the knot vector of Srf and t simply replaces the
                  knot vector.
     t:         Vector of knots with length of n.
     n:         Length of vector t.

    Returned Value:

      CagdSrfStruct *:  A refined curve of Srf after insertion of all the
                        knots as specified by vector t of length n.

    Keywords:

      refinement
      subdivision

     CagdSrfRegionFromSrf   (cagd_lib/cagd_aux.c:932)

    Prototype:

      CagdSrfStruct *CagdSrfRegionFromSrf(CagdSrfStruct *Srf,
                                          CagdRType t1,
                                          CagdRType t2,
                                          CagdSrfDirType Dir)

    Description:

    Given a surface - extracts a sub-region within the domain specified by t1
    and t2, in the direction Dir.

    Parameters:

     Srf:       To extract a sub-region from.
     t1, t2:    Parametric domain boundaries of sub-region.
     Dir:       Direction of region extraction. Either U or V.

    Returned Value:

      CagdSrfStruct *:  Sub-region extracted from Srf from t1 to t2.

    Keywords:

      regions
      subdivision

     CagdSrfReverse   (cagd_lib/cagd_aux.c:1363)

    Prototype:

      CagdSrfStruct *CagdSrfReverse2(CagdSrfStruct *Srf)

    Description:

    Returns a new surface that is the reversed surface of Srf by flipping the
    U and the V directions of the surface.
    See also BspKnotReverse.

    Parameters:

     Srf:       To be reversed.

    Returned Value:

      CagdSrfStruct *:   Reversed surface of Srf.

    See Also:

      CagdSrfReverse

    Keywords:

      reverse

     CagdSrfReverse   (cagd_lib/cagd_aux.c:1300)

    Prototype:

      CagdSrfStruct *CagdSrfReverse(CagdSrfStruct *Srf)

    Description:

    Returns a new surface that is the reversed surface of Srf by reversing the
    control mesh and the knot vector (if Bspline surface) of Srf in the U
    direction. See also BspKnotReverse.

    Parameters:

     Srf:       To be reversed.

    Returned Value:

      CagdSrfStruct *:   Reversed surface of Srf.

    See Also:

      CagdSrfReverse2

    Keywords:

      reverse

     CagdSrfSubdivAtParam   (cagd_lib/cagd_aux.c:898)

    Prototype:

      CagdSrfStruct *CagdSrfSubdivAtParam(CagdSrfStruct *Srf,
                                          CagdRType t,
                                          CagdSrfDirType Dir)

    Description:

    Given a surface - subdivides it into two sub-surfaces at given parametric
    value t in the given direction Dir.
      Returns pointer to first surface in a list of two subdivided surfaces.

    Parameters:

     Srf:      To subdivide at the prescibed parameter value t.
     t:        The parameter to subdivide the curve Crv at.
     Dir:      Direction of subdivision. Either U or V.

    Returned Value:

      CagdSrfStruct *:  A list of the two surfaces resulting from the process
                        of subdivision.

    Keywords:

      subdivision

     CagdSrfTangent   (cagd_lib/cagd_aux.c:1225)

    Prototype:

      CagdVecStruct *CagdSrfTangent(CagdSrfStruct *Srf,
                                    CagdRType u,
                                    CagdRType v,
                                    CagdSrfDirType Dir,
                                    CagdBType Normalize)

    Description:

    Given a surface Srf and a parameter values u, v, returns the (unit)
    tangent vector of Srf in direction Dir.

    Parameters:

     Srf:       To compute (unit) tangent vector for.
     u, v:      Location where to evaluate the tangent of Srf.
     Dir:       Direction of tangent, Either U or V.                          *
     Normalize:  f TRUE, attempt is made to normalize the returned vector.
                  If FALSE, length is a function of given parametrization.

    Returned Value:

      CagdVecStruct *:  A pointer to a static vector holding the unit tangent
                        information.

    See Also:

      BzrSrfTangent
      BspSrfTangent

    Keywords:

      tangent

     CagdSrfTransform   (cagd_lib/cagd2gen.c:1045)

    Prototype:

      void CagdSrfTransform(CagdSrfStruct *Srf,
                            CagdRType *Translate,
                            CagdRType Scale)

    Description:

    Applies an affine transform, in place, to given surface Srf as specified
    by Translate and Scale.
      Each control point is first translated by Translate and then scaled by
    Scale.

    Parameters:

     Crv:         To be affinely transformed.
     Translate:   Translation amount.
     Scale:       Scaling amount.

    Returned Value:

      void

    See Also:

      CagdCrvTransform
      CagdTransform
      CagdSrfMatTransform

    Keywords:

      scaling
      translation
      transformations

     CagdSurfaceRev   (cagd_lib/cagdsrev.c:39)

    Prototype:

      CagdSrfStruct *CagdSurfaceRev(CagdCrvStruct *Crv)

    Description:

    Constructs a surface of revolution around the Z axis of the given profile
    curve. Resulting surface will be a Bspline surface, while input may be
    either a Bspline or a Bezier curve.

    Parameters:

     Crv:        To create surface of revolution around Z with.

    Returned Value:

      CagdSrfStruct *:  Surface of revolution.

    Keywords:

      surface of revolution
      surface constructors

     CagdSurfaceRevPolynomialApprox   (cagd_lib/cagdsrev.c:135)

    Prototype:

      CagdSrfStruct *CagdSurfaceRevPolynomialApprox(CagdCrvStruct *Crv)

    Description:

    Constructs a surface of revolution around the Z axis of the given profile
    curve. Resulting surface will be a Bspline surface, while input may be
    either a Bspline or a Bezier curve.
      Resulting surface will be a polynomial Bspline surface, approximating a
    surface of revolution using a polynomial circle approx.
    (See Faux & Pratt "Computational Geometry for Design and Manufacturing").

    Parameters:

     Crv:        To approximate a surface of revolution around Z with.

    Returned Value:

      CagdSrfStruct *:  Surface of revolution approximation.

    Keywords:

      surface of revolution
      surface constructors

     CagdSweepAxisRefine   (cagd_lib/cagdswep.c:515)

    Prototype:

      CagdCrvStruct *CagdSweepAxisRefine(CagdCrvStruct *Axis,
                                         CagdCrvStruct *ScalingCrv,
                                         int RefLevel)

    Description:

      Routine to refine the axis curve, according to the scaling curve to
    better approximate the requested sweep operation.

    Parameters:

     Axis:         Axis to be used in future sweep operation with the
                     associated ScalingCrv.
     ScalingCrv:   To use as an estimate on refinement to apply to Axis.
     RefLevel:     Some refinement control. Keep it low like 2 or 3.

    Returned Value:

      CagdCrvStruct *:  Refined Axis curve.

    Keywords:

      sweep
      refinement

     CagdSweepSrf   (cagd_lib/cagdswep.c:71)

    Prototype:

      CagdSrfStruct *CagdSweepSrf(CagdCrvStruct *CrossSection,
                                  CagdCrvStruct *Axis,
                                  CagdCrvStruct *ScalingCrv,
                                  CagdRType Scale,
                                  VoidPtr Frame,
                                  CagdBType FrameIsCrv)

    Description:

    Constructs a sweep surface using the following curves:
    1. CrossSection - defines the basic cross section of the sweep. Must be
       in the XY plane.
    2. Axis - a 3D curve the CrossSection will be swept along such that the
       Axis normal aligns with the Y axis of the cross section. If Axis is
       linear (i.e. no normal), the normal is picked randomly or to fit the
       non linear part of the Axis (if any).
    3. Scale - a scaling curve for the sweep, If NULL a scale of Scale is
       used.
    4. Frame - a curve or a vector that specifies the orientation of the sweep
       by specifying the axes curve's binormal. If Frame is a vector, it is a
       constant binormal. If Frame is a curve (FrameIsCrv = TRUE), it is
       assumed to be a vector field binormal. If NULL, it is computed from
       the Axis curve's pseudo Frenet frame, that minimizes rotation.

      This operation is only an approximation. See CagdSweepAxisRefine for a
    tool to refine the Axis curve and improve accuracy.

    Parameters:

     CrossSection:  Of the constructed sweep surface.
     Axis:          Of the constructed sweep surface.
     ScalingCrv:    Optional scale or profiel curve.
     Scale:         if no Scaling Crv, Scale is used to apply a fixed scale
                      on the CrossSection curve.
     Frame:         An optional vector or a curve to specified the binormal
                      orientation. Otherwise Frame must be NULL.
     FrameIsCrv:    If TRUE Frame is a curve, if FALSE a vector (if Frame is
                      not NULL).

    Returned Value:

      CagdSrfStruct *:  Constructed sweep surface.

    Keywords:

      sweep
      surface constructors

     CagdTightBBox   (cagd_lib/cagdbbox.c:36)

    Prototype:

      CagdBType CagdTightBBox(CagdBType TightBBox)

    Description:

    Computes a bounding box for a freeform curve.

    Parameters:

     TightBBox:   TRUE for tight bbox on freeform curves and surfaces, FALSE
                    for loose bbox that is derived using the control poly/mesh.

    Returned Value:

      int:         old value.

    See Also:

      CagdCrvBBox
      CagdSrfBBox

    Keywords:

      bbox
      bounding box

     CagdTransform   (cagd_lib/cagd2gen.c:1099)

    Prototype:

      void CagdTransform(CagdRType **Points,
                         int Len,
                         int MaxCoord,
                         CagdBType IsNotRational,
                         CagdRType *Translate,
                         CagdRType Scale)

    Description:

    Applies an affine transform, in place, to given set of points Points which
    as array of vectors, each vector of length Len.
      Array Points optionally contains (if !IsNotRational) in Points[0] the
    weights coefficients and in Points[i] the coefficients of axis i, up to
    and include MaxCoord (X = 1, Y = 2, etc.).
    Points are translated and scaled as prescribed by Translate and Scale.
      Each control point is first translated by Translate and then scaled by
    Scale.

    Parameters:

     Points:         To be affinely transformed. Array of vectors.
     Len:            Of vectors of Points.
     MaxCoord:       Maximum number of coordinates to be found in Points.
     IsNotRational:  Do we have weights as vector Points[0]?
     Translate:      Translation amount.
     Scale:          Scaling amount.

    Returned Value:

      void

    See Also:

      CagdSrfTransform
      CagdCrvTransform

    Keywords:

      scaling
      translation
      transformations

     CagdUVArrayFree   (cagd_lib/cagd2gen.c:348)

    Prototype:

      void CagdUVArrayFree(CagdUVStruct *UVArray, int Size)

    Description:

    Deallocates and frees an array of UV structure.

    Parameters:

     UVArray:     To be deallocated.
     Size:        Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdUVArrayNew   (cagd_lib/cagd1gen.c:233)

    Prototype:

      CagdUVStruct *CagdUVArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of UV structures.

    Parameters:

     Size:      Size of UV array to allocate.

    Returned Value:

      CagdUVStruct *:  An array of UV structures of size Size.

    Keywords:

      allocation

     CagdUVCopy   (cagd_lib/cagd1gen.c:761)

    Prototype:

      CagdUVStruct *CagdUVCopy(CagdUVStruct *UV)

    Description:

    Allocates and copies all slots of a UV structure.

    Parameters:

     UV:       To be copied.

    Returned Value:

      CagdUVStruct *:  A duplicate of UV.

    Keywords:

      copy

     CagdUVCopyList   (cagd_lib/cagd1gen.c:1023)

    Prototype:

      CagdUVStruct *CagdUVCopyList(CagdUVStruct *UVList)

    Description:

    Allocates and copies a list of UV structures.

    Parameters:

     UVList:       To be copied.

    Returned Value:

      CagdUVStruct *:  A duplicated list of UV's.

    Keywords:

      copy

     CagdUVFree   (cagd_lib/cagd2gen.c:301)

    Prototype:

      void CagdUVFree(CagdUVStruct *UV)

    Description:

    Deallocates and frees all slots of a UV structure.

    Parameters:

     UV:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdUVFreeList   (cagd_lib/cagd2gen.c:323)

    Prototype:

      void CagdUVFreeList(CagdUVStruct *UVList)

    Description:

    Deallocates and frees a UV structure list:

    Parameters:

     UVList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdUVNew   (cagd_lib/cagd1gen.c:260)

    Prototype:

      CagdUVStruct *CagdUVNew(void)

    Description:

    Allocates and resets all slots of a UV structure.

    Parameters:

     None

    Returned Value:

      CagdUVStruct *:  A UV structure.

    Keywords:

      allocation

     CagdVecArrayFree   (cagd_lib/cagd2gen.c:558)

    Prototype:

      void CagdVecArrayFree(CagdVecStruct *VecArray, int Size)

    Description:

    Deallocates and frees an array of vector structure.

    Parameters:

     VecArray:     To be deallocated.
     Size:         Of the deallocated array.

    Returned Value:

      void

    Keywords:

      free

     CagdVecArrayNew   (cagd_lib/cagd1gen.c:389)

    Prototype:

      CagdVecStruct *CagdVecArrayNew(int Size)

    Description:

    Allocates and resets all slots of an array of Vec structures.

    Parameters:

     Size:      Size of Vec array to allocate.

    Returned Value:

      CagdVecStruct *:  An array of Vec structures of size Size.

    Keywords:

      allocation

     CagdVecCopy   (cagd_lib/cagd1gen.c:836)

    Prototype:

      CagdVecStruct *CagdVecCopy(CagdVecStruct *Vec)

    Description:

    Allocates and copies all slots of a Vec structure.

    Parameters:

     Vec:       To be copied.

    Returned Value:

      CagdUVStruct *:  A duplicate of Vec.

    Keywords:

      copy

     CagdVecCopyList   (cagd_lib/cagd2gen.c:33)

    Prototype:

      CagdVecStruct *CagdVecCopyList(CagdVecStruct *VecList)

    Description:

    Allocates and copies a list of vector structures.

    Parameters:

     VecList:       To be copied.

    Returned Value:

      CagdVecStruct *:  A duplicated list of vectors.

    Keywords:

      copy

     CagdVecFree   (cagd_lib/cagd2gen.c:511)

    Prototype:

      void CagdVecFree(CagdVecStruct *Vec)

    Description:

    Deallocates and frees all slots of a vector structure.

    Parameters:

     Vec:       To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdVecFreeList   (cagd_lib/cagd2gen.c:533)

    Prototype:

      void CagdVecFreeList(CagdVecStruct *VecList)

    Description:

    Deallocates and frees a vector structure list:

    Parameters:

     VecList:  To be deallocated.

    Returned Value:

      void

    Keywords:

      free

     CagdVecNew   (cagd_lib/cagd1gen.c:416)

    Prototype:

      CagdVecStruct *CagdVecNew(void)

    Description:

    Allocates and resets all slots of a Vec structure.

    Parameters:

     None

    Returned Value:

      CagdVecStruct *:  A Vec structure.

    Keywords:

      allocation

     CnvrtBezier2BsplineCrv   (cagd_lib/cbzr_aux.c:552)

    Prototype:

      CagdCrvStruct *CnvrtBspline2BezierCrv(CagdCrvStruct *Crv)

    Description:

    Converts a Bspline curve into a set of Bezier curves by subdividing the
    Bspline curve at all its internal knots.
      Returned is a list of Bezier curves.

    Parameters:

     Crv:     A Bspline curve to convert to a Bezier curve.

    Returned Value:

      CagdCrvStruct *:   A list of Bezier curves representing the Bspline
                         curve Crv.

    See Also:

      CnvrtBezier2BsplineCrv
      CnvrtBezier2PowerCrv
      CnvrtPower2BezierCrv

    Keywords:

      conversion

     CnvrtBezier2BsplineCrv   (cagd_lib/cbzr_aux.c:515)

    Prototype:

      CagdCrvStruct *CnvrtBezier2BsplineCrv(CagdCrvStruct *Crv)

    Description:

    Converts a Bezier curve into Bspline curve by adding an open knot vector.

    Parameters:

     Crv:     A Bezier curve to convert to a Bspline curve.

    Returned Value:

      CagdCrvStruct *:   A Bspline curve representing Bezier curve Crv.

    See Also:

      CnvrtBspline2BezierCrv
      CnvrtBezier2PowerCrv
      CnvrtPower2BezierCrv

    Keywords:

      conversion

     CnvrtBezier2BsplineSrf   (cagd_lib/sbzr_aux.c:369)

    Prototype:

      CagdSrfStruct *CnvrtBezier2BsplineSrf(CagdSrfStruct *Srf)

    Description:

    Converts a bezier surface into a Bspline surface by adding open end
    knot vector with no interior knots.

    Parameters:

     Srf:       Bezier surface to convert to a Bspline surface.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface representing same geometry as Srf.

    See Also:

      CnvrtBspline2BezierSrf

    Keywords:

      conversion

     CnvrtBezier2BsplineSrf   (cagd_lib/sbzr_aux.c:409)

    Prototype:

      CagdSrfStruct *CnvrtBspline2BezierSrf(CagdSrfStruct *Srf)

    Description:

    Convert a Bspline surface into a set of Bezier surfaces by subdiving the
    Bspline surface at all its internal knots.
      Returned is a list of Bezier surface.

    Parameters:

     Srf:       Bspline surface to convert to a Bezier surface.

    Returned Value:

      CagdSrfStruct *:  A list of Bezier surfaces representing same geometry
                        as Srf.

    See Also:

      CnvrtBezier2BsplineSrf

    Keywords:

      conversion

     CnvrtBezier2PowerCrv   (cagd_lib/cbzr_pwr.c:57)

    Prototype:

      CagdCrvStruct *CnvrtBezier2PowerCrv(CagdCrvStruct *Crv)

    Description:

    Converts the given curve from Bezier basis functions to a Power basis
    functions. Using:

            n
            __
     n      \     j-i n   j   j
    B (t) = /  (-1)  ( ) ( ) t
     i      --        j   i
           j=i
                                               n-i
    Which can be derived by expanding the (1-t)    term in bezier basis
    function definition as:

             n-i
              __
         n-i  \  n-i      j
    (1-t)   = / (   ) (-t)        using binomial expansion.
              --  j
             j=0

    This routine simply take the weight of each Bezier basis function B(t) and
    spread it into the different power basis t^j function scaled by:

          j-i n   j
      (-1)   ( ) ( )
              j   i

    Parameters:

     Crv:       To convert into Power basis function representation.

    Returned Value:

      CagdCrvStruct *:  Same geometry, but in the Power basis.

    See Also:

      CnvrtBezier2BsplineCrv
      CnvrtBspline2BezierCrv
      CnvrtPower2BezierCrv

    Keywords:

      power basis
      conversion

     CnvrtBezier2PowerSrf   (cagd_lib/cbzr_pwr.c:187)

    Prototype:

      CagdSrfStruct *CnvrtBezier2PowerSrf(CagdSrfStruct *Srf)

    Description:

    Power to Bezier conversion from surfaces.

    Parameters:

     Srf:       To convert into Power basis function representation.

    Returned Value:

      CagdSrfStruct *:  Same geometry, but in the Power basis.

    Keywords:

      power basis
      conversion

     CnvrtFloat2OpenSrf   (cagd_lib/sbsp_aux.c:1295)

    Prototype:

      CagdSrfStruct *CnvrtFloat2OpenSrf(CagdSrfStruct *Srf)

    Description:

    Converts a Bspline surface to a Bspline surface with open end conditions.

    Parameters:

     Srf:       Bspline surface to convert to open end conditions.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface with open end conditions,
                        representing the same geometry as Srf.

    See Also:

      CnvrtPeriodic2FloatSrf

    Keywords:

      conversion

     CnvrtPeriodic2FloatCrv   (cagd_lib/cbsp_aux.c:886)

    Prototype:

      CagdCrvStruct *CnvrtFloat2OpenCrv(CagdCrvStruct *Crv)

    Description:

    Converts a Bspline curve to a Bspline curve with open end conditions.

    Parameters:

     Crv:       Bspline curve to convert to open end conditions.

    Returned Value:

      CagdCrvStruct *:  A Bspline curve with open end conditions,
                        representing the same geometry as Crv.

    Keywords:

      conversion

     CnvrtPeriodic2FloatCrv   (cagd_lib/cbsp_aux.c:839)

    Prototype:

      CagdCrvStruct *CnvrtPeriodic2FloatCrv(CagdCrvStruct *Crv)

    Description:

    Converts a Bspline curve to a Bspline curve with floating end conditions.

    Parameters:

     Crv:       Bspline curve to convert to floating end conditions. Assume
                  Crv is either periodic or has floating end condition.

    Returned Value:

      CagdCrvStruct *:  A Bspline curve with floating end conditions,
                        representing the same geometry as Crv.

    Keywords:

      conversion

     CnvrtPeriodic2FloatSrf   (cagd_lib/sbsp_aux.c:1224)

    Prototype:

      CagdSrfStruct *CnvrtPeriodic2FloatSrf(CagdSrfStruct *Srf)

    Description:

    Converts a Bspline surface into a Bspline surface with floating end
    conditions.

    Parameters:

     Srf:       Bspline surface to convert to floating end conditions. Assume
                  Crv is either periodic or has floating end condition.

    Returned Value:

      CagdSrfStruct *:  A Bspline surface with floating end conditions,
                        representing the same geometry as Srf.

    See Also:

      CnvrtFloat2OpenSrf

    Keywords:

      conversion

     CnvrtPolyline2LinBsplineCrv   (cagd_lib/cbsp_aux.c:802)

    Prototype:

      CagdCrvStruct *CnvrtPolyline2LinBsplineCrv(CagdPolylineStruct *Poly)

    Description:

    Returns a new linear Bspline curve constructed from the given polyline.

    Parameters:

     Poly:     To convert to a linear bspline curve.

    Returned Value:

      CagdCrvStruct *:  A linear Bspline curve representing Poly.

    See Also:

      UserPolylines2LinBsplineCrvs
      UserPolyline2LinBsplineCrv

    Keywords:

      linear curves
      conversion

     CnvrtPower2BezierCrv   (cagd_lib/cbzr_pwr.c:118)

    Prototype:

      CagdCrvStruct *CnvrtPower2BezierCrv(CagdCrvStruct *Crv)

    Description:

    Converts the given curve from Power basis functions to Bezier basis
    functions. Using:

         n    j
         __  ( )
      i  \    i    n
     t = /  ----- B (t)
         --   n    j
         j=i ( )
              i

    This routine simply take the weight of each Power basis function t^i and
    spread it into the different basis basis function B(t) scaled by:

        j   / n
       ( ) / ( )
        i /   i

    Parameters:

     Crv:        To convert to Bezier basis functions.

    Returned Value:

      CagdCrvStruct *:   Same geometry, in the Bezier basis functions.

    See Also:

      CnvrtBezier2BsplineCrv
      CnvrtBspline2BezierCrv
      CnvrtBezier2PowerCrv

    Keywords:

      power basis
      conversion

     CnvrtPower2BezierSrf   (cagd_lib/cbzr_pwr.c:206)

    Prototype:

      CagdSrfStruct *CnvrtPower2BezierSrf(CagdSrfStruct *Srf)

    Description:

    Bezier to Power conversion from surfaces.

    Parameters:

     Srf:       To convert into Bezier basis function representation.

    Returned Value:

      CagdSrfStruct *:  Same geometry, but in the Bezier basis.

    Keywords:

      power basis
      conversion