AfdApplyAntiLStep

(afd_cube.c:230)

Prototype:

  void AfdApplyAntiLStep(CagdRType Coef[4])


Description:

Given four coefficents of a cubic afd polynomial, apply the anti L step, in place.

Parameters:

Coef: Four coefficients of the AFD basis functions.


Returned Value:

void


See Also:

AfdApplyLStep AfdApplyEStep AfdApplyLn AfdCnvrtCubicBzrToAfd AfdComputePolyline AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


AfdApplyEStep

(afd_cube.c:180)

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


See Also:

AfdApplyAntiLStep AfdApplyLStep AfdApplyLn AfdCnvrtCubicBzrToAfd AfdComputePolyline AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


AfdApplyLStep

(afd_cube.c:205)

Prototype:

  void AfdApplyLStep(CagdRType Coef[4])


Description:

Given four coefficents of a cubic afd polynomial, apply the L step, in place.

Parameters:

Coef: Four coefficients of the AFD basis functions.


Returned Value:

void


See Also:

AfdApplyAntiLStep AfdApplyEStep AfdApplyLn AfdCnvrtCubicBzrToAfd AfdComputePolyline AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


AfdApplyLn

(afd_cube.c:81)

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


See Also:

AfdApplyAntiLStep AfdApplyLStep AfdApplyEStep AfdCnvrtCubicBzrToAfd AfdComputePolyline AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


AfdBzrCrvEvalToPolyline

(afd_cube.c:313)

Prototype:

  void AfdBzrCrvEvalToPolyline(const 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, up to 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 piecewise linear sample using AFD.
FineNess: Of samples.
Points: Where to place the piecewise linear approximation. Assumed to be valid with respect to the dimension of Crv.


Returned Value:

void


See Also:

AfdApplyAntiLStep AfdApplyLStep AfdApplyEStep AfdApplyLn AfdCnvrtCubicBzrToAfd AfdComputePolyline

Keywords:

forward differencing


AfdCnvrtCubicBzrToAfd

(afd_cube.c:49)

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


See Also:

AfdApplyAntiLStep AfdApplyLStep AfdApplyEStep AfdApplyLn AfdComputePolyline AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


AfdComputePolyline

(afd_cube.c:265)

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


See Also:

AfdApplyAntiLStep AfdApplyLStep AfdApplyEStep AfdApplyLn AfdCnvrtCubicBzrToAfd AfdBzrCrvEvalToPolyline

Keywords:

forward differencing


BBoxDiagonalInitCrvCalculator

(cbsp_fit.c:2035)

Prototype:

  static CagdCrvStruct *BBoxDiagonalInitCrvCalculator(CagdPType *PtList,
                                                      int NumOfPoints,
                                                      int Length,
                                                      int Order,
                                                      CagdBType Periodic)


Description:

Computes an initial b-spline fitting curve which is a diagonal of the points cloud bounding box.

Parameters:

PtList: Points cloud.
NumOfPoints: Number of points in PtList.
Length: The desired length of the output b-spline curve.
Order: The desired order of the output b-spline curve.
Periodic: TRUE for periodic output curve, FALSE for open end.


Returned Value:

CagdCrvStruct *: B-spline curve which is a bounding box diagonal [/] of the points cloud.


Keywords:

InitFittingCrvCalculatorFuncType bounding box diagonal


BBoxPerimeterInitCrvCalculator

(cbsp_fit.c:1504)

Prototype:

  static CagdCrvStruct *BBoxPerimeterInitCrvCalculator(CagdPType *PtList,
                                                       int NumOfPoints,
                                                       int Length,
                                                       int Order,
                                                       CagdBType Periodic)


Description:

Computes an initial b-spline fitting curve which control points lies on a perimeter of the points cloud bounding box

Parameters:

PtList: Points cloud.
NumOfPoints: Number of points in PtList.
Length: The desired length of the output b-spline curve.
Order: The desired order of the output b-spline curve.
Periodic: TRUE for periodic output curve, FALSE for open end.


Returned Value:

CagdCrvStruct *: B-spline curve with control points equally spread on a perimeter of the points cloud bounding box.


Keywords:

InitFittingCrvCalculatorFuncType bounding box diagonal


BspBasisFuncMultEval

(bspcoxdb.c:330)

Prototype:

  CagdBspBasisFuncEvalStruct *BspBasisFuncMultEval(const CagdRType *KnotVector,
                                                   int KVLength,
                                                   int Order,
                                                   CagdBType Periodic,
                                                   CagdRType *Params,
                                                   int NumOfParams,
                                                   CagdBspBasisFuncMultEvalType
                                                                        EvalType)


Description:

Computes multiple evaluations of the given spline space basis functions, as prescribed by KnotVector and Order, at the requested NumOfParams parameter values, Params.

Parameters:

KnotVector: Knot sequence defining the spline space.
KVLength: Length of KnotVector.
Order: Of the spline space.
Periodic: TRUE if space is periodic.
Params: At which to evaluate and compute the spline functions.
NumOfParams: Size of Params vector.
EvalType: Type of evaluation requested: value (position), 1st derivative, or 2nd derivative.


Returned Value:

CagdBspBasisFuncEvalStruct *: A vector of size NumOfParams of evaluation results, each holding the index of the first non zero basis function and the (at most) Order non zero basis function values.


See Also:



Keywords:




BspBasisFuncMultEvalFree

(bspcoxdb.c:473)

Prototype:

  void BspBasisFuncMultEvalFree(CagdBspBasisFuncEvalStruct *Evals,
                                int NumOfParams)


Description:

Frees the allocated structure for multiple evaluations.

Parameters:

Evals: Structure to free.
NumOfParams: Size of Evals - number of parameter evaluations we have.


Returned Value:

void


See Also:



Keywords:




BspBasisFuncMultEvalPrint

(bspcoxdb.c:441)

Prototype:

  void BspBasisFuncMultEvalPrint(const CagdBspBasisFuncEvalStruct *Evals,
                                 int Order,
                                 CagdRType *Params,
                                 int NumOfParams)


Description:

Prints to stdout the allocated structure for multiple evaluations.

Parameters:

Evals: Structure to print.
Order: Of evaluated basis functions.
Params: Parameters the basis functions were evaluated at.
NumOfParams: Size of Evals/Params - number of parameters/evaluations.


Returned Value:

void


See Also:



Keywords:




BspC1Srf2PolygonsSamples

(bsp2poly.c:431)

Prototype:

  CagdBType BspC1Srf2PolygonsSamples(const CagdSrfStruct *Srf,
                                     int FineNess,
                                     CagdBType ComputeNormals,
                                     CagdBType ComputeUV,
                                     CagdRType **PtWeights,
                                     CagdPtStruct **PtMesh,
                                     CagdVecStruct **PtNrml,
                                     CagdUVStruct **UVMesh,
                                     int *FineNessU,
                                     int *FineNessV)


Description:

Routine to uniformly sample a single C1 continuous Bspline srf as grid. FineNess is a fineness control on the result and the larger it is more samples may result. A value of 10 is a good starting value. FALSE is returned in case of an error, TRUE otherwise.

Parameters:

Srf: To sample in a grid.
FineNess: Control on accuracy, the higher the finer.
ComputeNormals: If TRUE, normal information is also computed.
ComputeUV: If TRUE, UV values are stored and returned as well.
PtWeights: Weights of the evaluations, if rational, to detect poles. NULL if surface nor rational.
PtMesh: Evaluted positions of grid of samples.
PtNrml: Evaluted normals of grid of samples or NULL if none.
UVMesh: Evaluted UV vals of grid of samples or NULL if none.
FineNessU, FineNessV: Actual size of PtMesh, PtNrml, UVMesh.


Returned Value:

CagdBType: FALSE is returned in case of an error, TRUE otherwise.


See Also:

BzrSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons BspSrf2PolygonsSamplesNuNv

Keywords:

polygonization surface approximation


BspCrv2Polyline

(bsp2poly.c:928)

Prototype:

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


Description:

Routine to approx. a single B-spline 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 precomputed.
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


BspCrvAllEuclideanC1Discont

(cagd_aux.c:2098)

Prototype:

  CagdPtStruct *BspCrvAllEuclideanC1Discont(const CagdCrvStruct *Crv,
                                            IrtBType EuclideanC1Discont,
                                            IrtRType Tolerance)


Description:

Compute, for the given curve, all C^1 potential discontinuity locations.

Parameters:

Crv: To subdivide at all C^1 discontinuity locations.
EuclideanC1Discont: TRUE to compute the C1 discontinuities and verify them in the Euclidean space. FALSE to only consider C1 discontinuities by knot multiplicity in parametric space.
Tolerance: f parametric C1 discontinuity that is also a Euclidean discontinuity - deviation from inner product of unit tangents before and after discontinuity by less than Tolerance (1.0 if tangent identical, 0.0 if orthogonal, -1.0 if opposite). Ignored if < -1.0 or EuclideanC1Discont is FALSE.


Returned Value:

CagdPtStruct *: Locations of C1 discontinuities.


See Also:

CagdCrvSubdivAtParams BspKnotAllC1Discont BspCrvsSubdivAtAllDetectedLocations CagdCrvSubdivAtAllC0Discont CagdCrvSubdivAtAllC1Discont

Keywords:




BspCrvBiNormalMalloc

(cbsp_aux.c:792)

Prototype:

  CagdVecStruct *BspCrvBiNormalMalloc(const 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 collinear, 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 vector holding the binormal information. Always an E3 vector.


Keywords:

binormal


BspCrvBiNormalToData

(cbsp_aux.c:746)

Prototype:

  CagdVecStruct *BspCrvBiNormalToData(const CagdCrvStruct *Crv,
                                      CagdRType t,
                                      CagdBType Normalize,
                                      CagdVecStruct *Vec)


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 collinear, 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.
Vec: A pointer to a vector holding the binormal information


Returned Value:

CagdVecStruct *: A pointer to a vector holding the binormal information. Always an E3 vector.


Keywords:

binormal


BspCrvCoxDeBoorBasis

(bspcoxdb.c:169)

Prototype:

  CagdRType *BspCrvCoxDeBoorBasis(const CagdRType *KnotVector,
                                  int Order,
                                  int Len,
                                  CagdBType Periodic,
                                  CagdRType t,
                                  int *IndexFirst,
                                  CagdRType *Basis)


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 B-spline 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 B-spline (k == 0) only one basis function is non zero and is equal to one. This is the constant B-spline spanning interval t(i)...t(i+1) such that t(i) <= t < t(i+1). We then raise this constant B-spline 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 B-spline 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 (+(Order-1) if periodic).
Periodic: TRUE if freeform is periodic.
t: At which the B-spline basis functions are to be evaluated.
IndexFirst: Index of the first B-spline basis function that might be non zero.
Basis: Where evaluated basis functions are going to be saved.


Returned Value:

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


Keywords:

evaluation B-splines


BspCrvCoxDeBoorIndexFirst

(bspcoxdb.c:282)

Prototype:

  int BspCrvCoxDeBoorIndexFirst(const 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 B-spline 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 B-spline basis functions are to be evaluated.


Returned Value:

int: The index.


Keywords:

evaluation B-splines


BspCrvCreateApproxHelix

(cagd_arc.c:838)

Prototype:

  CagdCrvStruct *BspCrvCreateApproxHelix(CagdRType NumOfLoops,
                                         CagdRType Pitch,
                                         CagdRType Radius,
                                         int Sampling,
                                         int CtlPtsPerLoop)


Description:

Constructs an approximated polynomial helix curve, along the +Z axis.

Parameters:

NumOfLoops: Number of loops in the helix - can be fractional.
Pitch: Essentially the size of the helix. A Pitch of one will step one unit in Z for one full circle.
Radius: Radius of helix. If radius is negative, the radius will change monotonically from zero to abs(Radius) at the end.
Sampling: Number of samples to compute on the helix. Should be several hundreds for a reasonable result.
CtlPtsPerLoop: umber of control points to use per loop. Use at least 5 for a reasonable approximation.


Returned Value:

CagdCrvStruct *: A helix B-spline curve approximation.


See Also:

BspCrvCreateCircle BspCrvCreateApproxSine BspCrvCreateApproxSpiral

Keywords:




BspCrvCreateApproxSine

(cagd_arc.c:893)

Prototype:

  CagdCrvStruct *BspCrvCreateApproxSine(CagdRType NumOfCycles,
                                        int Sampling,
                                        int CtlPtsPerCycle)


Description:

Constructs an approximated polynomial sine curve.

Parameters:

NumOfCycles: Number of cycles in the sine - can be fractional.
Sampling: Number of samples to compute on the sine. Should be several hundreds for a reasonable result.
CtlPtsPerCycle: umber of control points to use per cycle. Use at least 5 for a reasonable approximation.


Returned Value:

CagdCrvStruct *: A sine wave Bspline curve approximation.


See Also:

BspCrvCreateCircle BspCrvCreateApproxSine BspCrvCreateApproxHelix

Keywords:




BspCrvCreateApproxSpiral

(cagd_arc.c:780)

Prototype:

  CagdCrvStruct *BspCrvCreateApproxSpiral(CagdRType NumOfLoops,
                                          CagdRType Pitch,
                                          int Sampling,
                                          int CtlPtsPerLoop)


Description:

Constructs an approximated spiral curve (not rational!)

Parameters:

NumOfLoops: Number of loops in the spiral - can be fractional.
Pitch: Essentially the size of the spiral. A Pitch of one will construct a roughly size-one spiral curve.
Sampling: Number of samples to compute on the spiral. Should be several hundreds for a reasonable result.
CtlPtsPerLoop: umber of control points to use per loop. Use at least 5 for a reasonable approximation.


Returned Value:

CagdCrvStruct *: A spiral B-spline curve approximation.


See Also:

BspCrvCreateCircle BspCrvCreateApproxSine BspCrvCreateApproxHelix

Keywords:




BspCrvCreateCircle

(cagd_arc.c:364)

Prototype:

  CagdCrvStruct *BspCrvCreateCircle(const CagdPtStruct *Center, CagdRType Radius)


Description:

Creates a circle at the specified position as a rational quadratic B-spline curve. Circle is always parallel to the XY plane.

Parameters:

Center: Of circle to be created, NULL for origin.
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 B-spline curve.


See Also:

BspCrvCreateUnitCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle BspCrvCreateUnitPCircleQuadTol BspCrvCreateUnitPCircleCubicTol CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc

Keywords:

circle


BspCrvCreatePCircle

(cagd_arc.c:479)

Prototype:

  CagdCrvStruct *BspCrvCreatePCircle(const CagdPtStruct *Center,
                                     CagdRType Radius)


Description:

Approximates a circle as a cubic polynomial B-spline 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, NULL for origin.
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 B-spline curve.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreateUnitPCircle BspCrvCreateUnitPCircleQuadTol BspCrvCreateUnitPCircleCubicTol CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc

Keywords:

circle


BspCrvCreatePCircleTol

(cagd_arc.c:731)

Prototype:

  CagdCrvStruct *BspCrvCreatePCircleTol(const CagdPtStruct *Center,
                                        CagdRType Radius,
                                        int Order,
                                        int Cont,
                                        CagdRType Tol)


Description:

Approximates a circle as a quadratic or cubic polynomial B-spline curve at the specified position and radius, and of required Order and continuity. Construct the circle as n arcs of polynomial quadratic/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.
Order: Of approximating polynomial - can be either 3 (quadratic) or 4 (cubic).
Cont: Desired continuity: 0 for C^0 between the arc segments, 1 for C^1 continuity between the arc segments.
Tol: Tolerance of approximation - no less than 1e-15 for a unit size circle.


Returned Value:

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


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreateUnitPCircle BspCrvCreateUnitPCircleQuadTol BspCrvCreateUnitPCircleCubicTol CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc

Keywords:

circle


BspCrvCreateUnitCircle

(cagd_arc.c:311)

Prototype:

  CagdCrvStruct *BspCrvCreateUnitCircle(void)


Description:

Creates a circle at the specified position as a rational quadratic B-spline 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 B-spline curve representing a unit circle.


See Also:

BspCrvCreateCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle BspCrvCreateUnitPCircleQuadTol BspCrvCreateUnitPCircleCubicTol CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc

Keywords:

circle


BspCrvCreateUnitPCircle

(cagd_arc.c:403)

Prototype:

  CagdCrvStruct *BspCrvCreateUnitPCircle(void)


Description:

Approximates a unit circle as a cubic polynomial B-spline 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 B-spline curve approximating a unit circle


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle BspCrvCreateUnitPCircleQuadTol BspCrvCreateUnitPCircleCubicTol CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc BspCrvCreateApproxSpiral

Keywords:

circle


BspCrvCreateUnitPCircleCubicTol

(cagd_arc.c:634)

Prototype:

  CagdCrvStruct *BspCrvCreateUnitPCircleCubicTol(CagdRType Tol, int Cont)


Description:

Creates a cubic polynomial B-spline curve that approximates a unit circle to a specified tolerance. Implements method 2 from: "Good Approximation of Circles by-curvature-continuous Bezier curves" by Dokken, Lyche, and Morken, CAGD, June 1990, pp 33-41.

Parameters:

Tol: Tolerance of approximation, Tol > 1e-13. Sets the maximally allowed deviation from the exact unit square.
Cont: or 1 for C^0 or C^1 continuity. Ignored as result is C^1 & G^2.


Returned Value:

CagdCrvStruct *: A rational quadratic B-spline curve representing a unit circle, to within Tol.


See Also:

BspCrvCreateCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc BspCrvCreateUnitPCircleQuadTol

Keywords:

circle


BspCrvCreateUnitPCircleQuadTol

(cagd_arc.c:521)

Prototype:

  CagdCrvStruct *BspCrvCreateUnitPCircleQuadTol(CagdRType Tol, int Cont)


Description:

Creates a quadratic polynomial B-spline curve that approximates a uni circle to a specified tolerance. Implements methos 2 and 5 from: "Planar curve offset based on circle approximation", CAD Vol 28, No 8, pp 617-630, 1996, by Lee, Kim and Elber.

Parameters:

Tol: Tolerance of approximation, Tol > 1e-13. Sets the maximally allowed deviation from the exact unit square.
Cont: or 1 for C^0 or C^1 continuity.


Returned Value:

CagdCrvStruct *: A rational quadratic B-spline curve representing a unit circle, to within Tol. int: Desired continuity: 0 for C^0 for some better accuracy or 1 for C^1 continuity requiring more control points.


See Also:

BspCrvCreateCircle BspCrvCreatePCircle BspCrvCreateUnitPCircle CagdCreateConicCurve CagdCrvCreateArc BzrCrvCreateArc BspCrvCreateUnitPCircleCubicTol

Keywords:

circle


BspCrvDegreeRaise

(cbsp_aux.c:463)

Prototype:

  CagdCrvStruct *BspCrvDegreeRaise(const 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

(cbsp_aux.c:406)

Prototype:

  CagdCrvStruct *BspCrvDegreeRaiseN(const 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

(cbsp_aux.c:991)

Prototype:

  CagdCrvStruct *BspCrvDerive(const CagdCrvStruct *Crv, CagdBType DeriveScalar)


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) = Degree * (P(i+1) - P(i)) / (Kv(i + k) - Kv(i + 1)), i = 0 to k-2.


Parameters:

Crv: To differentiate.
DeriveScalar: TRUE to differentiate each channel independently. FALSE to treat geometry as a rational differentiation.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

BzrCrvDerive CagdCrvDerive SymbCrvDeriveRational BspCrvDeriveScalar

Keywords:

derivatives


BspCrvDeriveScalar

(cbsp_aux.c:1071)

Prototype:

  CagdCrvStruct *BspCrvDeriveScalar(const 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.

For a Euclidean curve this is the same as CagdCrvDerive but for a rational curve the returned curve is not the vector field but simply the derivatives of all the curve's coefficients, including the weights.

Parameters:

Crv: To differentiate.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

BzrCrvDerive CagdCrvDerive SymbCrvDeriveRational BspCrvDerive BzrCrvDeriveScalar CagdCrvDeriveScalar

Keywords:

derivatives


BspCrvDomain

(bsp_gen.c:218)

Prototype:

  void BspCrvDomain(const 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


BspCrvEvalAtParamMalloc

(cbspeval.c:134)

Prototype:

  CagdRType *BspCrvEvalAtParamMalloc(const CagdCrvStruct *Crv, CagdRType t)


Description:

Returns a pointer to a dynamically allocated data, holding the value of the curve at given parametric location t. The curve is assumed to be B-spline. 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). This vector is allocated dynamically.


See Also:

CagdCrvEvalToData BzrCrvEvalAtParamToData BzrCrvEvalVecAtParam BspCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline BspCrvEvalAtParamToData

Keywords:

evaluation


BspCrvEvalAtParamToData

(cbspeval.c:101)

Prototype:

  void BspCrvEvalAtParamToData(const CagdCrvStruct *Crv,
                               CagdRType t,
                               CagdRType *R)


Description:

Computes the value of the curve position at parameter t, into R. The curve is assumed to be B-spline. 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.
R: 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).


Returned Value:

void


See Also:

CagdCrvEvalToData BzrCrvEvalAtParamToData BzrCrvEvalVecAtParam BspCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline BspCrvEvalAtParamToData

Keywords:

evaluation


BspCrvEvalCoxDeBoorMalloc

(bspcoxdb.c:106)

Prototype:

  CagdRType *BspCrvEvalCoxDeBoorMalloc(const CagdCrvStruct *Crv, CagdRType t)


Description:

Returns a pointer to a dynamically allocated 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 B-splines


BspCrvEvalCoxDeBoorToData

(bspcoxdb.c:43)

Prototype:

  void BspCrvEvalCoxDeBoorToData(const CagdCrvStruct *Crv,
                                 CagdRType t,
                                 CagdRType *Pt)


Description:

Evaluates into a pointer of 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.
Pt: 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).


Returned Value:

void


Keywords:

evaluation B-splines


BspCrvEvalVecAtParam

(cbspeval.c:42)

Prototype:

  CagdRType BspCrvEvalVecAtParam(const CagdRType *Vec,
                                 int VecInc,
                                 const 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


BspCrvExtension

(bsp_gen.c:758)

Prototype:

  CagdCrvStruct *BspCrvExtension(const CagdCrvStruct *OrigCrv,
                                 const CagdBType *ExtDirs,
                                 CagdRType Epsilon,
                                 CagdBType RemoveExtraKnots)


Description:

Extends a B-spline curve. The domain of Crv is extended, such that the trace coincides with the input curve's trace over the original domain. An interface function for the one-sided curve extension function. OrigCrv can have "ExtntScl" real attributes to scale the extension in Euclidean space (for same Epsilon parametric extension.

Parameters:

OrigCrv: The curve to be extended.
ExtDirs: A boolean array of size 2 to determine the required directions of extension MinDmn, MaxDmn. A NULL here means (TRUE, TRUE).
Epsilon: The length of the requested extension, in the param. domain.
RemoveExtraKnots: f FALSE, the resulting curve will not have minimal multiplicity at the first internal knot on the extension side.


Returned Value:

CagdCrvStruct *: The new extended curve.


See Also:

BspCrvExtraKnotRmv BspSrfExtension BspCrvExtensionOneSide

Keywords:




BspCrvExtensionOneSide

(bsp_gen.c:822)

Prototype:

  CagdCrvStruct *BspCrvExtensionOneSide(const CagdCrvStruct *OrigCrv,
                                        CagdBType MinDmn,
                                        CagdRType Epsilon,
                                        CagdRType ExtntScl,
                                        CagdBType RemoveExtraKnots)


Description:

Extends a B-spline curve, at the min/max end. The domain of Crv is extended, such that the trace coincides with the original trace over the original domain. Assumes Crv has open end conditions. If ExtntScl != 1, the curve might also undergo refinements.

Parameters:

OrigCrv: The curve to be extended.
MinDmn: TRUE for min domain extension, FALSE for max domain extension.
Epsilon: The length of the extension in the domain.
ExtntScl: scaling factor on the extension (for the same epsilon in the parametric domain).
RemoveExtraKnots: f FALSE, the resulting curve will not have minimal multiplicity at the first internal knot on the extension side.


Returned Value:

CagdCrvStruct *: The new extended curve.


See Also:

BspCrvExtraKnotRmv BspSrfExtension

Keywords:




BspCrvExtraKnotRmv

(bsp_gen.c:1017)

Prototype:

  CagdCrvStruct *BspCrvExtraKnotRmv(const CagdCrvStruct *Crv,
                                    int RmvIndex)


Description:

Reverse operation of the knot insertion, assuming it is guaranteed that the knot currently does not have its minimal multiplicity, that is: it is possible to remove it and maintain the exact trace. Indices and conventions follow Boehm's Knot Insertion algo, as in E. Cohen, R.F. Riesenfeld, G. Elber, "Geometric Modeling with Splines: an Introduction", CH 07.

Parameters:

Crv: The curve to be updated.
RmvIndex: The index in the knot vector of the knot to be removed.


Returned Value:

CagdCrvStruct *: The new updated curve.


See Also:

BspCrvExtensionOneSide BspSrfExtension

Keywords:




BspCrvFitLstSqr

(cbsp_int.c:1019)

Prototype:

  CagdCrvStruct *BspCrvFitLstSqr(const CagdCrvStruct *Crv,
                                 int Order,
                                 int Size,
                                 CagdBType Periodic,
                                 CagdParametrizationType ParamType,
                                 CagdBType EndPtInterp,
                                 CagdBType EvalPts,
                                 CagdRType *Err)


Description:

Fits a curve to the give curve by sampling points on Crv and fitting a curve of orders Order and Size control points. Error is measured by the difference between the original and the fitted surface, as maximum error norm.

Parameters:

Crv: Curve to fit a new curve to.
Order: Of the to be created curve.
Size: Control polygon size of the to be created curve.
Periodic: Constructed curve should be Periodic.
ParamType: Type of parametrization.
EndPtInterp: RUE to force Crv's end point interpolation. Has affect only if has open end-conditions.
EvalPts: TRUE to evaluate the samples points at equal parametric interval, FALSE to simply copy the control points.
Err: The maximum error is updated into here


Returned Value:

CagdCrvStruct *: Fitted curve.


See Also:

BspCrvInterpPts

Keywords:




BspCrvHasBezierKV

(bsp_knot.c:35)

Prototype:

  CagdBType BspCrvHasBezierKV(const 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

(bsp_knot.c:98)

Prototype:

  CagdBType BspCrvHasOpenEC(const CagdCrvStruct *Crv)


Description:

Returns TRUE iff the given B-spline curve has open end conditions.

Parameters:

Crv: To check for open end conditions.


Returned Value:

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


See Also:

BspSrfHasOpenEC

Keywords:

open end conditions


BspCrvIntegrate

(cbsp_aux.c:1113)

Prototype:

  CagdCrvStruct *BspCrvIntegrate(const 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 BspSrfIntegrate CagdCrvIntegrate

Keywords:

integrals


BspCrvInterpBuildKVs

(cbsp_int.c:328)

Prototype:

  void BspCrvInterpBuildKVs(const CagdCtlPtStruct *PtList,
                            int Order,
                            int CrvSize,
                            CagdParametrizationType ParamType,
                            CagdBType Periodic,
                            CagdRType **RetPtKnots,
                            CagdRType **RetKV)


Description:


Build knot sequence and sampling parameter for the given data to interpolate, curve type and the parameterization type desired.

Parameters:

PtList: List of point to interpolate.
Order: Order of interpolating curve.
CrvSize: Number of control points in interpolating curve.
ParamType: Parametrization type: Uniform, chord length, etc.
Periodic: TRUE for a periodic interpolating curve
RetPtKnots: arameter values assigned to the interpolation.
RetKV: Knot sequence built for the interpolation, unless CAGD_KV_NODAL_PARAM in which case the KV is assumed given.


Returned Value:

void


Keywords:




BspCrvInterpPts

(cbsp_int.c:142)

Prototype:

  CagdCrvStruct *BspCrvInterpPts(const 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.


See Also:

BspCrvInterpolate BspCrvInterpPts2 MvarBspCrvInterpVecs

Keywords:

interpolation least square approximation


BspCrvInterpPts2

(cbsp_int.c:215)

Prototype:

  CagdCrvStruct *BspCrvInterpPts2(const CagdCtlPtStruct *PtList,
                                  int Order,
                                  int CrvSize,
                                  CagdParametrizationType ParamType,
                                  CagdBType Periodic,
                                  CagdBType EndPtInterp)


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.
EndPtInterp: TRUE to force Crv's end point interpolation. Has affect only if has open end-conditions.


Returned Value:

CagdCrvStruct *: Constructed interpolating/approximating curve.


See Also:

BspCrvInterpolate BspCrvInterpPts

Keywords:

interpolation least square approximation


BspCrvInterpPts3

(cbsp_int.c:280)

Prototype:

  CagdCrvStruct *BspCrvInterpPts3(const CagdCtlPtStruct *PtList,
                                  const CagdRType *Params,
                                  const CagdRType *KV,
                                  int Length,
                                  int Order,
                                  CagdBType Periodic)


Description:

Given a set of points, PtList, and parameter values the curve should interpolate or approximate these points, Params, and the expected knot vector, KV, length Length and order Order of the B-spline curve, computes the B-spline 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. Same as BspCrvInterpolate but forces end points to be interpolated.

Parameters:

PtList: List of points to interpolate/least square approximate.
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, NULL if singular.


Keywords:

interpolation least square approximation


BspCrvInterpPtsError

(cbsp_int.c:1395)

Prototype:

  CagdRType BspCrvInterpPtsError(const CagdCrvStruct *Crv,
                                 const 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

(cbsp_int.c:581)

Prototype:

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


Description:

Given a set of points, PtList, and 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 he 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.
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, NULL if singular.


Keywords:

interpolation least square approximation


BspCrvIsC1DiscontAt

(cbspeval.c:295)

Prototype:

  CagdBType BspCrvIsC1DiscontAt(const CagdCrvStruct *Crv, CagdRType t)


Description:

Examines the control polygon at given parametric location for a real C1 discontinuity, in Euclidean space.

Parameters:

Crv: Curves to examine for a C1 discontinuity.
t: Parameter value to examine at.


Returned Value:

CagdBType: TRUE if Crv has a C1 discontinuity at parameter t, FALSE otherwise.


See Also:

BspSrfIsC1DiscontAt

Keywords:




BspCrvKnotC0Discont

(bsp_gen.c:370)

Prototype:

  CagdBType BspCrvKnotC0Discont(const CagdCrvStruct *Crv, CagdRType *t)


Description:

Scans the given knot vector of the given curve for a potential C0 discontinuity. Looks for multiplicities in the knot sequence and then examine the mesh if indeed the mesh is discontinuous at that location. Assumes knot vectors has open end condition.

Parameters:

Crv: To examine its potential discontinuity.
t: Where to put the parameter value (knot) that can be C0 discontinuous.


Returned Value:

CagdBType: TRUE if found a C0 discontinuity, FALSE otherwise.


See Also:

BspCrvKnotC1Discont BspCrvKnotC2Discont BspKnotC0Discont BspCrvMeshC1Continuous BspCrvKnotC1Discont

Keywords:

knot vectors continuity discontinuity


BspCrvKnotC1Discont

(bsp_gen.c:404)

Prototype:

  CagdBType BspCrvKnotC1Discont(const CagdCrvStruct *Crv, CagdRType *t)


Description:

Scans the given knot vector of the given curve for a potential C1 discontinuity. Looks for multiplicities in the knot sequence and then examine the mesh if indeed the mesh is discontinuous at that location. Assumes knot vectors has open end condition.

Parameters:

Crv: To examine its potential discontinuity.
t: Where to put the parameter value (knot) that can be C1 discontinuous.


Returned Value:

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


See Also:

BspCrvKnotC0Discont BspCrvKnotC2Discont BspKnotC1Discont BspCrvMeshC1Continuous

Keywords:

knot vectors continuity discontinuity


BspCrvKnotC2Discont

(bsp_gen.c:438)

Prototype:

  CagdBType BspCrvKnotC2Discont(const CagdCrvStruct *Crv, CagdRType *t)


Description:

Scans the given knot vector of the given curve for a potential C2 discontinuity. Looks for multiplicities in the knot sequence and then examine the mesh if indeed the mesh is discontinuous at that location. Assumes knot vectors has open end condition.

Parameters:

Crv: To examine its potential discontinuity.
t: Where to put the parameter value (knot) that can be C1 discontinuous.


Returned Value:

CagdBType: TRUE if found a C2 discontinuity, FALSE otherwise.


See Also:

BspCrvKnotC0Discont BspCrvKnotC1Discont BspKnotC1Discont BspCrvMeshC1Continuous

Keywords:

knot vectors continuity discontinuity


BspCrvKnotInsert

(bspboehm.c:60)

Prototype:

  CagdCrvStruct *BspCrvKnotInsert(const 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

(cbsp_aux.c:302)

Prototype:

  CagdCrvStruct *BspCrvKnotInsertNDiff(const 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

(cbsp_aux.c:253)

Prototype:

  CagdCrvStruct *BspCrvKnotInsertNSame(const 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

(bsp_knot.c:1803)

Prototype:

  CagdRType BspCrvMaxCoefParam(const 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


BspCrvMeshC0Continuous

(bsp_gen.c:472)

Prototype:

  CagdBType BspCrvMeshC0Continuous(const CagdCrvStruct *Crv,
                                   int Idx,
                                   CagdRType Tol)


Description:

Examine the control polygon of the given curve at index Idx for a real C0 discontinuity in the mesh. This index will typically be for a knot multiplicity potential discont.

Parameters:

Crv: To examine its potential discontinuity.
Idx: Index of control point where to examine the discontinuity. if 0, curve is assumed closed and beginning/end is examined.
Tol: Tolerance allowed for distance deviation.


Returned Value:

CagdBType: TRUE if continuous there, FALSE otherwise.


See Also:

BspKnotC1Discont BspCrvMeshC1Continuous

Keywords:




BspCrvMeshC1Continuous

(bsp_gen.c:509)

Prototype:

  CagdBType BspCrvMeshC1Continuous(const CagdCrvStruct *Crv,
                                   int Idx,
                                   CagdRType *CosAngle)


Description:

Examine the control polygon of the given curve at index Idx for a real C1 discontinuity in the mesh. This index will typically be for a knot multiplicity potential discont.

Parameters:

Crv: To examine its potential discontinuity.
Idx: Index of control point where to examine the discontinuity. if 0, curve is assumed closed and beginning/end is examined.
CosAngle: If not NULL, updated with the cosine of the deviation angle.


Returned Value:

CagdBType: TRUE if continuous there, FALSE otherwise.


See Also:

BspKnotC1Discont BspCrvMeshC0Continuous

Keywords:




BspCrvMoebiusTransform

(cbsp_aux.c:1181)

Prototype:

  CagdCrvStruct *BspCrvMoebiusTransform(const CagdCrvStruct *CCrv, CagdRType c)


Description:

Apply the Moebius transformation to a rational Bspline curve. See "Moebius reparametrization of rational Bsplines", by Lee & Lucian, CAGD 8 (1991) pp 213-215.

Parameters:

CCrv: Curve to apply the Moebius transformation to.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the curve. If c == 0, the first and last weights are made equal.


Returned Value:

CagdCrvStruct *: The modified curve with the same shape but different speed.


See Also:

BzrCrvMoebiusTransform BspSrfMoebiusTransform

Keywords:




BspCrvNew

(bsp_gen.c:133)

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


BspCrvNormalMalloc

(cbsp_aux.c:962)

Prototype:

  CagdVecStruct *BspCrvNormalMalloc(const 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 vector holding the normal information. Always an E3 vector.


Keywords:

normal


BspCrvNormalToData

(cbsp_aux.c:926)

Prototype:

  CagdVecStruct *BspCrvNormalToData(const CagdCrvStruct *Crv,
                                    CagdRType t,
                                    CagdBType Normalize,
                                    CagdVecStruct *N)


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.
N: A pointer to a vector holding the normal information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the normal information. Always an E3 vector.


Keywords:

normal


BspCrvOpenEnd

(bsp_gen.c:283)

Prototype:

  CagdCrvStruct *BspCrvOpenEnd(const 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

(cbsp_aux.c:161)

Prototype:

  CagdCrvStruct *BspCrvSubdivAtParam(const 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


BspCrvSubdivCtlPoly

(cbsp_aux.c:54)

Prototype:

  void BspCrvSubdivCtlPoly(const CagdCrvStruct *Crv,
                           CagdRType **LPoints,
                           CagdRType **RPoints,
                           int LLength,
                           int RLength,
                           CagdRType t,
                           int Mult)


Description:

Apply B-spline subdivision to the given curve Crv at parameter value t, and save the result in curves' LPoints/RPoints.

Parameters:

Crv: To subdivide at parameter value t.
LPoints, RPoints: Where the results are kept.
LLength, RLength: Lengths of respective vectors.
t: Parameter value to subdivide Crv at.
Mult: Current multiplicity of t in the knot sequence.


Returned Value:

void


See Also:

BzrCrvSubdivCtlPoly BspCrvSubdivAtParam

Keywords:




BspCrvTangentToData

(cbsp_aux.c:544)

Prototype:

  CagdVecStruct *BspCrvTangentToData(const CagdCrvStruct *Crv,
                                     CagdRType t,
                                     CagdBType Normalize,
                                     CagdVecStruct *Tan)


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. The unnormalized normal does not equal dC/dt in its magnitude, only in its direction.

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, returned is an unnormalized vector in the right direction of the tangent.
Tan: A pointer to a vector holding the tangent information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the tangent information. An Ek, k >= 3 vector, depending on dimension k of Crv.


Keywords:

tangent


BspCrvsSubdivAtAllDetectedLocations

(cagd_aux.c:1964)

Prototype:

  CagdCrvStruct *BspCrvsSubdivAtAllDetectedLocations(const CagdCrvStruct *Crvs,
                                                     CagdCrvTestingFuncType
                                                                   CrvTestFunc)


Description:

Subdivides the given curve Crv at all locations CrvTesTFunc detects. Examples for CrvTesTFunc can be BspCrvKnotC0Discont or BspCrvKnotC1Discont.

Parameters:

Crvs: Curves to subdivide at all detected locations by CrvTestFunc.
CrvTestFunc: Curve testing function, like BspCrvKnotC0Discont.


Returned Value:

CagdCrvStruct *: Set of subdivided surfaces, or NULL if nothing was detected.


See Also:

BspSrfsSubdivAtAllDetectedLocations CagdCrvSubdivAtAllC1Discont BspCrvKnotC0Discont BspCrvKnotC1Discont

Keywords:




BspGenBasisFuncsAsCurves

(bsp_gen.c:1391)

Prototype:

  CagdCrvStruct *BspGenBasisFuncsAsCurves(int Order,
                                          int Length,
                                          const CagdRType *KV)


Description:

Creates a list of curves representing the B-spline basis functions of the given space (order and knot sequence). All basis functions will be scaled to fit into the unit square [0, 1]^2. If the space is periodic, Length should reflect this in the input (i.e. length should be enlarged by order - 1).

Parameters:

Order: Of space to create basis functions for.
Length: Number of control points in this space.
KV: Knot sequence of this space, of length (Order + Length).


Returned Value:

CagdCrvStruct *: Length curves representing the basis functions.


See Also:

BspGenKnotsGeometryAsCurves

Keywords:




BspGenKnotsGeometryAsCurves

(bsp_gen.c:1478)

Prototype:

  CagdCrvStruct *BspGenKnotsGeometryAsCurves(int Order,
                                             int Length,
                                             const CagdRType *KV,
                                             CagdRType SizeOfKnot)


Description:

Creates a list of linear B-spline curves representing the B-spline knots in the given space (order and knot sequence). All knots will be scaled to fit just below the unit square [0, 1]^2. If the space is periodic, Length should reflect this in the input (i.e. length should be enlarged by order - 1).

Parameters:

Order: Of space to create the geometry of the knots for.
Length: Number of control points in this space.
KV: Knot sequence of this space, of length (Order + Length).
SizeOfKnot: The size of the plot knot. Knots are created as triangles


Returned Value:

CagdCrvStruct *: Length curves representing the Length knots.


See Also:

BspGenBasisFuncsAsCurves

Keywords:




BspIsKnotDiscontUniform

(bsp_knot.c:696)

Prototype:

  CagdEndConditionType BspIsKnotDiscontUniform(int Len,
                                               int Order,
                                               const CagdRType *KnotVector)


Description:

Tests the given knot vector for discontinuous uniformity and open/float end conditions. That is all interior knots are of multiplicity Order-1 and are uniformly spaced.

Parameters:

Len: Of control polygon/mesh of curve/surface that is using this knot vector.
Order: Of the curve/surface that is using this knot vector.
KnotVector: The knot vector to verify.


Returned Value:

CagdEndConditionType: CAGD_END_COND_GENERAL if general knot vector, or CAGD_END_COND_OPEN/FLOAT/PERIODIC if knot vector is uniform with open/float/periodic end conditions.


Keywords:

knot vectors end conditions


BspIsKnotUniform

(bsp_knot.c:628)

Prototype:

  CagdEndConditionType BspIsKnotUniform(int Len,
                                        int Order,
                                        const CagdRType *KnotVector)


Description:

Tests the given knot vector for uniformity and open/float end conditions.

Parameters:

Len: Of control polygon/mesh of curve/surface that is using this knot vector.
Order: Of the curve/surface that is using this knot vector.
KnotVector: The knot vector to verify.


Returned Value:

CagdEndConditionType: CAGD_END_COND_GENERAL if general knot vector, or CAGD_END_COND_OPEN/FLOAT/PERIODIC if knot vector is uniform with open/float/periodic end conditions.


Keywords:

knot vectors end conditions


BspKnotAffineTrans

(bsp_knot.c:846)

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 + (KV[0] + 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 BspKnotAffineTransOrder

Keywords:

knot vectors affine transformation


BspKnotAffineTrans2

(bsp_knot.c:890)

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 B-spline 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 BspKnotAffineTransOrder2

Keywords:

knot vectors affine transformation


BspKnotAffineTransOrder

(bsp_knot.c:937)

Prototype:

  void BspKnotAffineTransOrder(CagdRType *KnotVector,
                               int Order,
                               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[Order-1]) * Scale + (KV[Order-1] + Translate).

All transformation as taken place in place.

Parameters:

KnotVector: To affinely transform.
Order: Order of the space using this knot vector.
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


BspKnotAffineTransOrder2

(bsp_knot.c:983)

Prototype:

  void BspKnotAffineTransOrder2(CagdRType *KnotVector,
                                int Order,
                                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 to MaxVal.
  KV[i] = (KV[i] - KV[Order - 1]) * Scale + MinVal,

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

Parameters:

KnotVector: To affinely transform.
Order: Order of the space using this knot vector.
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 BspKnotAffineTrans2

Keywords:

knot vectors affine transformation


BspKnotAllC0Discont

(bsp_knot.c:2548)

Prototype:

  CagdRType *BspKnotAllC0Discont(const CagdRType *KnotVector,
                                 int Order,
                                 int Length,
                                 int *n)


Description:

Scans the given knot vector for all potential C0 discontinuity. Returns a vector holding the parameter values of the potential C0 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 can be C0 discontinuous at that knot. However, this is only a necessary condition for C0 discontinuity in the geometry.

Parameters:

KnotVector: To test for potential C0 discontinuities.
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 C0 discontinuities found.


Returned Value:

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


Keywords:

knot vectors continuity discontinuity


BspKnotAllC1Discont

(bsp_knot.c:2614)

Prototype:

  CagdRType *BspKnotAllC1Discont(const 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 discontinuities.
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, zero if none.


Returned Value:

CagdRType *: Vector holding all parameter values with potential C1 discontinuities, allocated dynamically, NULL if none.


Keywords:

knot vectors continuity discontinuity


BspKnotAlphaLoopBlendNotPeriodic

(cagdoslo.c:812)

Prototype:

  void BspKnotAlphaLoopBlendNotPeriodic(const BspKnotAlphaCoeffStruct *A,
                                        int IMin,
                                        int IMax,
                                        const CagdRType *OrigPts,
                                        CagdRType *RefPts)


Description:

Blend the input control points using the given Alpha matrix. A non periodic case is assumed.

Parameters:

A: Alpha matrix to use.
IMin, IMax: omain of refined controls points to blend.
OrigPts: original coefficients.
RefPts: Refined (returned) coefficients.


Returned Value:

void


See Also:

BspKnotEvalAlphaCoef BspKnotAlphaLoopBlendPeriodic BspKnotAlphaLoopBlendStep

Keywords:




BspKnotAlphaLoopBlendPeriodic

(cagdoslo.c:891)

Prototype:

  void BspKnotAlphaLoopBlendPeriodic(const BspKnotAlphaCoeffStruct *A,
                                     int IMin,
                                     int IMax,
                                     const CagdRType *OrigPts,
                                     int OrigLen,
                                     CagdRType *RefPts)


Description:

Blend the input control points using the given Alpha matrix. A non periodic case is assumed.

Parameters:

A: Alpha matrix to use.
IMin, IMax: omain of refined controls points to blend.
OrigPts: original coefficients.
OrigLen: Original length of OrigPts.
RefPts: Refined (returned) coefficients.


Returned Value:

void


See Also:

BspKnotEvalAlphaCoef BspKnotAlphaLoopBlendNotPeriodic BspKnotAlphaLoopBlendStep

Keywords:




BspKnotAlphaLoopBlendStep

(cagdoslo.c:999)

Prototype:

  void BspKnotAlphaLoopBlendStep(const BspKnotAlphaCoeffStruct *A,
                                 int IMin,
                                 int IMax,
                                 const CagdRType *OrigPts,
                                 int OrigPtsStep,
                                 int OrigLen,
                                 CagdRType *RefPts,
                                 int RefPtsStep)


Description:

Blend the input control points using the given Alpha matrix. A non periodic case is assumed.

Parameters:

A: Alpha matrix to use.
IMin, IMax: omain of refined controls points to blend.
OrigPts: original coefficients.
OrigPtsStep: teps between adjacent coefficients, in multi-dim. arrays.
OrigLen: Original length of OrigPts.
RefPts: Refined (returned) coefficients.
RefPtsStep: teps between adjacent refined coefficients, in multi-dim. arrays.


Returned Value:

void


See Also:

BspKnotEvalAlphaCoef BspKnotAlphaLoopBlendNotPeriodic BspKnotAlphaLoopBlendPeriodic

Keywords:




BspKnotAverage

(bsp_knot.c:1452)

Prototype:

  CagdRType *BspKnotAverage(const 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


BspKnotC0Discont

(bsp_knot.c:2231)

Prototype:

  CagdBType BspKnotC0Discont(const CagdRType *KnotVector,
                             int Order,
                             int Length,
                             CagdRType *t)


Description:

Scans the given knot vector to a potential C0 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) can be C0 discontinuous at that knot. However, this is only a necessary condition for C0 discontinuity in the geometry.

Parameters:

KnotVector: To test for potential C0 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 C0 discontinuous.


Returned Value:

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


See Also:

BspSrfKnotC1Discont BspKnotC1Discont BspKnotC2Discont BspKnotAllC1Discont

Keywords:

knot vectors continuity discontinuity


BspKnotC1Discont

(bsp_knot.c:2311)

Prototype:

  CagdBType BspKnotC1Discont(const 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 discontinuities.
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 C1 discontinuous.


Returned Value:

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


See Also:

BspSrfKnotC1Discont BspKnotC0Discont BspKnotC2Discont BspKnotAllC1Discont

Keywords:

knot vectors continuity discontinuity


BspKnotC2Discont

(bsp_knot.c:2390)

Prototype:

  CagdBType BspKnotC2Discont(const CagdRType *KnotVector,
                             int Order,
                             int Length,
                             CagdRType *t)


Description:

Scans the given knot vector to a potential C2 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 C2 discontinuous at that knot. However, this is only a necessary condition for C2 discontinuity in the geometry.

Parameters:

KnotVector: To test for potential C1 discontinuities.
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 C1 discontinuous.


Returned Value:

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


See Also:

BspSrfKnotC1Discont BspKnotC0Discont BspKnotC1Discont BspKnotAllC1Discont

Keywords:

knot vectors continuity discontinuity


BspKnotCnDiscont

(bsp_knot.c:2471)

Prototype:

  CagdBType BspKnotCnDiscont(const CagdRType *KnotVector,
                             int Order,
                             int Length,
                             int n,
                             CagdRType *t)


Description:

Scans the given knot vector to a potential C-n discontinuity, for a prescribed n. 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 - n) can be C-n discontinuous at that knot. However, this is only a necessary condition for C-n discontinuity in the geometry.

Parameters:

KnotVector: To test for potential C-n discontinuities.
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: The degree of the C-n discontinuity.
t: Where to put the parameter value (knot) that can be C-n discontinuous.


Returned Value:

CagdBType: TRUE if found a potential C-n discontinuity, FALSE otherwise.


See Also:

BspSrfKnotC1Discont BspKnotC0Discont BspKnotC2Discont

Keywords:

knot vectors continuity discontinuity


BspKnotContinuityMergeTwo

(bsp_knot.c:1317)

Prototype:

  CagdRType *BspKnotContinuityMergeTwo(const CagdRType *KnotVector1,
                                       int Len1,
                                       int Order1,
                                       const 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 second 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

(bsp_knot.c:1017)

Prototype:

  CagdRType *BspKnotCopy(CagdRType *DstKV, const CagdRType *SrcKV, int Len)


Description:

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

Parameters:

DstKV: Destination address or NULL for a whole new copy.
SrcKV: 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 (destination) knot vector.


Keywords:

allocation knot vectors


BspKnotCopyAlphaCoef

(cagdoslo.c:548)

Prototype:

  BspKnotAlphaCoeffStruct *BspKnotCopyAlphaCoef(const BspKnotAlphaCoeffStruct *A)


Description:

Copies the BspKnotAlphaCoeffStruct data structure.

Parameters:

A: Alpha matrix to copy.


Returned Value:

BspKnotAlphaCoeffStruct *: Copied matrix.


See Also:

BspKnotEvalAlphaCoef BspKnotEvalAlphaCoefMerge BspKnotFreeAlphaCoef BspCrvKnotInsert BspSrfKnotInsert

Keywords:

alpha matrix refinement


BspKnotDegreeRaisedKV

(bsp_knot.c:1096)

Prototype:

  CagdRType *BspKnotDegreeRaisedKV(const CagdRType *KV,
                                   int Len,
                                   int Order,
                                   int NewOrder,
                                   int *NewLen)


Description:

Computes a knot vector for a freeform that will fit the freeform if it was degree raised to NewOrder.

Parameters:

KV: Current knot vector of freeform.
Len: Length of the freeform - number of control points.
Order: Order of the freeform.
NewOrder: ew order of the freeform.
NewLen: New length of (dynamically) allocated knot vector.


Returned Value:

CagdRType *: A new knot vector, allocated dynamically, that would fit this same freeform if degree raised.


Keywords:




BspKnotDiscontUniformOpen

(bsp_knot.c:580)

Prototype:

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


Description:

Returns a discontinuous uniform open knot vector for Len Control points and order Order. The actual length of the KV is Len + Order. The generated sequence is of the form "0 0 0 0 1 1 1 2 2 2 ... n n n n" and Hence Len + Order must equal 2 * Order + 3 * x * (Order - 1). If KnotVector is NULL it is being allocated dynamically.

Parameters:

Len: Of control polygon/mesh of curve/surface that is to use this knot vector.
Order: Of the curve/surface that is 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 d conditions


BspKnotDoubleKnots

(bsp_knot.c:1411)

Prototype:

  CagdRType *BspKnotDoubleKnots(const CagdRType *KnotVector, int *Len, int Order)


Description:

Creates a new knot vector from the given KnotVector that includes knot values in the middle of any two adjacent knots that are different in value.

Parameters:

KnotVector: To average out.
Len: Length of KnotVector. This is not the length of the curve or surface using this knot vector. Len is updated in the end to the length of the returned vector.
Order: Order of freeform geometry using this knot sequence.


Returned Value:

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


See Also:

BspKnotNodes

Keywords:

knot vectors node values


BspKnotEvalAlphaCoef

(cagdoslo.c:88)

Prototype:

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


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.
Periodic: If the refinement is for a periodic entity.


Returned Value:

BspKnotAlphaCoeffStruct *: 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 BspKnotAlphaLoopBlendPeriodic BspKnotAlphaLoopBlendNotPeriodic BspKnotAlphaLoopBlendStep

Keywords:

alpha matrix refinement


BspKnotEvalAlphaCoefIdentity

(cagdoslo.c:432)

Prototype:

  static BspKnotAlphaCoeffStruct *BspKnotEvalAlphaCoefIdentity(int k,
                                                               CagdRType *KVT,
                                                               int LengthKVT,
                                                               int Periodic)


Description:

Computes an identity (diagonal) Alpha matrix. In cases it is used, for efficiency reasons...

Parameters:

k: Order of geometry.
KVT: knot vector. Both in and out.
LengthKVT: Length of control polygon with the KVT knot vector.
Periodic: If the refinement is for a periodic entity.


Returned Value:

BspKnotAlphaCoeffStruct *: 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 BspKnotAlphaLoopBlendPeriodic BspKnotAlphaLoopBlendNotPeriodic BspKnotAlphaLoopBlendStep BspKnotEvalAlphaCoef

Keywords:

alpha matrix refinement


BspKnotEvalAlphaCoefMerge

(cagdoslo.c:708)

Prototype:

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


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.
Periodic: If the refinement is for a periodic entity.


Returned Value:

BspKnotAlphaCoeffStruct *: 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

(bsp_knot.c:2035)

Prototype:

  int BspKnotFindMult(const 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 (Len + Order).
t: The knot to verify the multiplicity of.


Returned Value:

int: Multiplicity of t in KnotVector.


Keywords:

knot vectors


BspKnotFirstIndexG

(bsp_knot.c:378)

Prototype:

  int BspKnotFirstIndexG(const 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. IRIT_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

(cagdoslo.c:647)

Prototype:

  void BspKnotFreeAlphaCoef(BspKnotAlphaCoeffStruct *A)


Description:

Frees the BspKnotAlphaCoeffStruct data structure.

Parameters:

A: Alpha matrix to free.


Returned Value:

void


See Also:

BspKnotEvalAlphaCoef BspKnotEvalAlphaCoefMerge BspKnotCopyAlphaCoef BspCrvKnotInsert BspSrfKnotInsert

Keywords:

alpha matrix refinement


BspKnotHasBezierKV

(bsp_knot.c:77)

Prototype:

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


Description:

Returns TRUE iff the given knot vector of length (Len + Order) has no interior knots and it has an open end conditions.

Parameters:

KnotVector: To check for open end and no interior knots conditions.
Len: Of control mesh of this 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

(bsp_knot.c:179)

Prototype:

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


Description:

Returns TRUE iff the given knot vector of length (Len + Order) has open end conditions.

Parameters:

KnotVector: To check for open end condition.
Len: Of control mesh of this 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

(bsp_knot.c:1979)

Prototype:

  CagdRType *BspKnotInsertMult(const 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 IRIT_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

(bsp_knot.c:1939)

Prototype:

  CagdRType *BspKnotInsertOne(const 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

(bsp_knot.c:331)

Prototype:

  int BspKnotLastIndexL(const 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. IRIT_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

(bsp_knot.c:283)

Prototype:

  int BspKnotLastIndexLE(const 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. IRIT_APX_EQ_UEPS 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


BspKnotMakeRobustKV

(bsp_knot.c:2776)

Prototype:

  CagdBType 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:

CagdBType: TRUE if the knot sequence has been modified.


See Also:

BspKnotVerifyKVValidity

Keywords:

knot vectors


BspKnotMergeTwo

(bsp_knot.c:1229)

Prototype:

  CagdRType *BspKnotMergeTwo(const CagdRType *KnotVector1,
                             int Len1,
                             const 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


BspKnotMinDmnBzrIdx

(bsp_knot.c:2136)

Prototype:

  int BspKnotMinDmnBzrIdx(const CagdRType *KnotVector,
                          int Len,
                          int Order,
                          CagdRType MinDmn,
                          CagdRType Eps)


Description:

Compute the index (starting from zero) of the Bezier polynomial domain that starts at MinDmn.

Parameters:

KnotVector: To derive a specific Bezier domain for.
Len: Length of the KnotVector.
Order: The order of the basis functions using this KnotVector.
MinDmn: The minimum of the Bezier domain we seek its index.
Eps: Tolerance of approximated equal knot.


Returned Value:

int: The computed index, or -1 if error.


See Also:

BspKnotsMultiplicityVector

Keywords:




BspKnotMultiplicity

(bsp_knot.c:422)

Prototype:

  int BspKnotMultiplicity(const CagdRType *KnotVector, int Len, int Idx)


Description:

Computes the multiplicity of given knot index Idx in KnotVector,

Parameters:

KnotVector: To compute the multiplicity of knot index Idx.
Len: Of knot vector. This is not the length of the curve/surface using this KnotVector.
Idx: Index of knot to compute its multiplicity.


Returned Value:

int: Multiplicity of the knot. At least one.


Keywords:




BspKnotNode

(bsp_knot.c:1581)

Prototype:

  CagdRType BspKnotNode(const CagdRType *KnotVector, int i, int Order)


Description:

Computes a parameter value estimation (as a node value) for the i'th control point. The parameter value (the node) is defined as (k = Order - 1 or degree):
        i+k
         -
         \
         / KnotVector(j)
         -
       j=i+1
N(i) = -----------------
              k


Parameters:

KnotVector: To average out as nodes. Can be NULL in which case a Bezier case is assumed.
i: Index of control points. First index is zero.
Order: Of curve or surface that exploits this knot vector.


Returned Value:

CagdRType: The node value as a parameter value estimation for the i'th control point.


See Also:

BspKnotAverage BspKnotNodes BspKnotPeriodicNodes

Keywords:

knot vectors node value


BspKnotNodes

(bsp_knot.c:1515)

Prototype:

  CagdRType *BspKnotNodes(const 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 BspKnotPeriodicNodes

Keywords:

knot vectors node values


BspKnotParamInDomain

(bsp_knot.c:246)

Prototype:

  CagdBType BspKnotParamInDomain(const 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

(bsp_knot.c:2677)

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


BspKnotPeriodicNodes

(bsp_knot.c:1632)

Prototype:

  CagdRType *BspKnotPeriodicNodes(const 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 periodic 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 periodic 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 BspKnotNodes

Keywords:

knot vectors node values


BspKnotPrepEquallySpaced

(cagdoslo.c:756)

Prototype:

  CagdRType *BspKnotPrepEquallySpaced(const CagdRType *KV,
                                      int KVLen,
                                      int KVOrder,
                                      int *n,
                                      CagdRType Tmin,
                                      CagdRType Tmax)


Description:


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

Parameters:

KV: The knot vector to refine.
KVLen: The total length of the KV (Control polygon Length + Order).
KVOrder: he order of the space.
n: Number of knots to introduce. Returns the actual introduced which can be a bit less if a knot already found in proximity.
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

(bsp_knot.c:1054)

Prototype:

  CagdRType *BspKnotReverse(const 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

(bsp_knot.c:770)

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:

BspKnotTranslate BspKnotAffineTrans BspKnotAffineTrans2

Keywords:

knot vectors affine transformation


BspKnotSortKVMonotone

(bsp_knot.c:3011)

Prototype:

  void BspKnotSortKVMonotone(CagdRType *KV, int Len)


Description:

Verify and sort the given knot sequence, in place, so it is monotone.

Parameters:

KV: To verify and ensure it is monotone, in place.
Len: Length of KV.


Returned Value:

void


See Also:

BspKnotVerifyKVValidity

Keywords:




BspKnotSubtrTwo

(bsp_knot.c:1158)

Prototype:

  CagdRType *BspKnotSubtrTwo(const CagdRType *KnotVector1,
                             int Len1,
                             const 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.
Len2: 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


BspKnotTranslate

(bsp_knot.c:806)

Prototype:

  void BspKnotTranslate(CagdRType *KnotVector, int Len, CagdRType Trans)


Description:

Applies a translation transformation to the given knot vector. Note translation transformation on the knot vector does not change the Bspline curve. Knot vector is translated by Trans as KV[i] = KV[i] + Trans. Translation is taken place in place.

Parameters:

KnotVector: To translate.
Len: Of knot vector. This is not the length of the curve or surface using this knot vector.
Trans: Amount to translate the knot vector.


Returned Value:

void


See Also:

BspKnotScale BspKnotAffineTrans BspKnotAffineTrans2

Keywords:

knot vectors affine transformation


BspKnotUniformFloat

(bsp_knot.c:495)

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 is to use this knot vector.
Order: Of the curve/surface that is 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

(bsp_knot.c:534)

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 is to use this knot vector.
Order: Of the curve/surface that is 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

(bsp_knot.c:456)

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 is to use this knot vector.
Order: Of the curve/surface that is 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


BspKnotVectorsSame

(bsp_knot.c:2822)

Prototype:

  CagdBType BspKnotVectorsSame(const CagdRType *KV1,
                               const CagdRType *KV2,
                               int Len,
                               CagdRType Eps)


Description:

Compare the two knot vectors for similarity.

Parameters:

KV1, KV2: The two knot vectors to compare.
Len: Length of knot vectors.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if knot vectors are the same, FALSE otherwise.


See Also:

CagdCtlPointsSame CagdCrvsSame CagdSrfsSame

Keywords:




BspKnotVerifyKVValidity

(bsp_knot.c:2899)

Prototype:

  int BspKnotVerifyKVValidity(CagdRType *KV, int Order, int Len, CagdRType Tol)


Description:

Verify that the given knot sequence is a valid one up to tolerance Tol. That is no more than order knots are similar up to Tol and that the knot sequence is monotone. Updated in place, if can.

Parameters:

KV: To validate its knots in, place.
Order: Of the knot sequence.
Len: Such that Len + Order equals the number of knots in KV.
Tol: Tolerance to consider two knots the same.


Returned Value:

int: 1 if valid, -1 if was validated in place and is valid now, 0 if failed to validate.


See Also:

BspKnotSortKVMonotone

Keywords:




BspKnotVerifyPeriodicKV

(bsp_knot.c:2854)

Prototype:

  void BspKnotVerifyPeriodicKV(CagdRType *KV, int Order, int Len)


Description:

Update the two ends (knots outside the curve's domain) to match the same spacing as the inner knots on the other end... Updates KV in place.

Parameters:

KV: To update its knots outside the entity's domain.
Order: Of the entity.
Len: Such that Len + Order equals the number of knots in KV.


Returned Value:

void


Keywords:




BspKnotsGetIntervals

(bsp_knot.c:2184)

Prototype:

  void BspKnotsGetIntervals(const CagdRType *KV,
                            int KVLen,
                            CagdRType **KnotIntervals,
                            int *IntervalCount)


Description:

Computes the knot intervals of the given knot sequence (i.e. a sequence of unique knot values). For example: (0, 0, 0, 1, 2, 2, 3, 3, 3) will be converted to KnotIntervals: (0, 1, 2, 3) and KnotCount of 4. The knot sequence is returned in KnotIntervals (allocated inside the function) and its length in IntervalCount.

Parameters:

KV: To derive its knot intervals.
KVLen: Length of the KnotVector.
KnotIntervals: (Out parameter) Vector of the knot intervals (unique values found in KV). Allocated dynamically & returned.
IntervalCount: (Out parameter) The resulting size of KnotIntervals - number of actual intervals found.


Returned Value:

void


See Also:

BspKnotsMultiplicityVector

Keywords:

knot vectors


BspKnotsMultiplicityVector

(bsp_knot.c:2086)

Prototype:

  int BspKnotsMultiplicityVector(const CagdRType *KnotVector,
                                 int Len,
                                 CagdRType *KnotValues,
                                 int *KnotMultiplicities,
                                 CagdRType Eps)


Description:

Computes the multiplicity/value vectors of the given knot sequence. For example: (0, 0, 0, 1, 2, 2, 3, 3, 3) will be converted to: KnotValues of (0, 1, 2, 3) and KnotMultiplicities of (3, 1, 2, 3). KnotValues and KnotMultiplicities are assumed big enough vectors to hold the result.

Parameters:

KnotVector: To derive its multiplicity/value vectors.
Len: Length of the KnotVector.
KnotValues: Vector of the unique values found in KnotVector.
KnotMultiplicities: ultiplicities of unique values found in Knotvector. Can be NULL to ignore.
Eps: Tolerance of approximated equal knot.


Returned Value:

int: Size of vectors KnotValues/KnotMultiplicities.


See Also:

BspKnotsGetIntervals

Keywords:

knot vectors


BspMakeReparamCurve

(cbsp_int.c:1717)

Prototype:

  CagdCrvStruct *BspMakeReparamCurve(const 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:




BspMeshC1PtsCollinear

(bsp_gen.c:629)

Prototype:

  CagdBType BspMeshC1PtsCollinear(const CagdPType Pt0,
                                  const CagdPType Pt1,
                                  const CagdPType Pt2,
                                  CagdRType *LenRatio)


Description:

Examines the collinearity of the given three points and also verify (if First FALSE) or compute the lengths ratios.

Parameters:

Pt0, Pt1, Pt2: Three points to check for collinearity along possible C^1 discont.
LenRatio: To verify (if !IRIT_INFNTY) or compute (if IRIT_INFNTY).


Returned Value:

CagdBType: TRUE if collinear, FALSE otherwise.


See Also:

BspSrfMeshC1Continuous TrivTVMeshC1Continuous BspSrfMeshC1Continuous

Keywords:




BspPeriodicCrvNew

(bsp_gen.c:181)

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

(bsp_gen.c:92)

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


BspPtSamplesToKV

(cbsp_int.c:517)

Prototype:

  CagdRType *BspPtSamplesToKV(const CagdRType *PtsSamples,
                              int NumPts,
                              int CrvOrder,
                              int CrvLength)


Description:

Given NumPts parameter values (in PtsSamples), construct a knot vector for a curve of order CrvOrder and CrvLength control points to fit to this data set.

Parameters:

PtsSamples: he parameter values of the data.
NumPts: Number of parameters in PtsSamples.
CrvOrder: Order of curve that will employ the constructed knot vector.
CrvLength: Length of curve that will employ constructed knot vector.


Returned Value:

CagdRType *: Constructed knot vector.


See Also:

BspKnotAverage

Keywords:




BspReparameterizeCrv

(cbsp_aux.c:1732)

Prototype:

  void BspReparameterizeCrv(CagdCrvStruct *Crv,
                            CagdParametrizationType ParamType)


Description:

Reparameterize a curve to follow a desired parametrization.

Parameters:

Crv: The curve to update its paraametrization.
ParamType: The desired parametrization type: uniform, chord len., etc.


Returned Value:

void


See Also:

BspCrvInterpBuildKVs BspReparameterizeSrf

Keywords:




BspReparameterizeSrf

(sbsp_aux.c:1994)

Prototype:

  void BspReparameterizeSrf(CagdSrfStruct *Srf,
                            CagdSrfDirType Dir,
                            CagdParametrizationType ParamType)


Description:

Reparameterize a surface to follow a desired parametrization.

Parameters:

Srf: The surface to update its paraametrization.
Dir: Parametric direction to reparameterize.
ParamType: The desired parametrization type: uniform, chord len., etc.


Returned Value:

void


See Also:

BspCrvInterpBuildKVs BspReparameterizeCrv

Keywords:




BspSrf2Curves

(bsp2poly.c:835)

Prototype:

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


Description:

Routine to extract from a B-spline 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

(bsp2poly.c:105)

Prototype:

  CagdSrfErrorFuncType BspSrf2PolygonSetErrFunc(CagdSrfErrorFuncType Func,
                                                void *Data)


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.
Data: Optional reference to data to transfer to the function.


Returned Value:

CagdSrfErrorFuncType: Old value of function.


See Also:

BspSrf2Polygons

Keywords:




BspSrf2Polygons

(bsp2poly.c:146)

Prototype:

  IPPolygonStruct *BspSrf2Polygons(const CagdSrfStruct *Srf,
                                   CagdSrf2PlsInfoStrct *TessInfo)


Description:

Routine to convert a single B-spline 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 IPPolygonStruct. 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.
TessInfo: Auxiliary tessellation information.


Returned Value:

IPPolygonStruct *: 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 CagdSrf2Polygons TrimSrf2Polygons BspC1Srf2Polygons CagdSrf2Polygons

Keywords:

polygonization surface approximation


BspSrf2PolygonsN

(bsp2poly.c:252)

Prototype:

  IPPolygonStruct *BspSrf2PolygonsN(const CagdSrfStruct *Srf,
                                    int Nu,
                                    int Nv,
                                    CagdBType ComputeNormals,
                                    CagdBType FourPerFlat,
                                    CagdBType ComputeUV)


Description:

Routine to convert a single B-spline 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 IPPolygonStruct. 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.
Nu, Nv: The number of uniform samples in U and V of surface.
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:

IPPolygonStruct *: 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 CagdSrf2Polygons TrimSrf2Polygons BspC1Srf2Polygons CagdSrf2Polygons BspSrf2Polygons BzrSrf2PolygonsN CagdSrf2PolygonsN

Keywords:

polygonization surface approximation


BspSrf2PolygonsSamplesNuNv

(bsp2poly.c:312)

Prototype:

  CagdBType BspSrf2PolygonsSamplesNuNv(const CagdSrfStruct *Srf,
                                       int Nu,
                                       int Nv,
                                       CagdBType ComputeNormals,
                                       CagdBType ComputeUV,
                                       CagdRType **PtWeights,
                                       CagdPtStruct **PtMesh,
                                       CagdVecStruct **PtNrml,
                                       CagdUVStruct **UVMesh)


Description:

Routine to uniformly sample a single Bspline srf as a grid. Nu and Nv fix the grid's sizes. FALSE is returned in case of an error, TRUE otherwise.

Parameters:

Srf: To sample in a grid.
Nu, Nv: The number of uniform samples in U and V of surface.
ComputeNormals: If TRUE, normal information is also computed.
ComputeUV: If TRUE, UV values are stored and returned as well.
PtWeights: Weights of the evaluations, if rational, to detect poles. NULL if surface nor rational.
PtMesh: Evaluted positions of grid of samples.
PtNrml: Evaluted normals of grid of samples or NULL if none.
UVMesh: Evaluted UV vals of grid of samples or NULL if none.


Returned Value:

CagdBType: FALSE is returned in case of an error, TRUE otherwise.


See Also:

BspSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons BzrSrf2PolygonsSamples BspC1Srf2PolygonsSamples

Keywords:




BspSrf2Polylines

(bsp2poly.c:682)

Prototype:

  CagdPolylineStruct *BspSrf2Polylines(const 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


BspSrfC1DiscontCrvs

(sbspeval.c:467)

Prototype:

  CagdCrvStruct *BspSrfC1DiscontCrvs(const CagdSrfStruct *Srf)


Description:

Extracts the C1 discontinuity curves from the given Bspline surface. This routine detects potential discontinuities in the control mesh by seeking knots of Order-1 multiplicity. Potential discontinuities that materialize as real (by examining the mesh itself along that line) are extracted as isoparametric curves.

Parameters:

Srf: To extract its C1 discontinuity curves.


Returned Value:

CagdCrvStruct *: The C1 discontinuities as a list of isoaprametric curves.


See Also:

BspSrfCrvFromSrf BspKnotAllC1Discont BspSrfIsC1DiscontAt BspSrfHasC1Discont

Keywords:




BspSrfCrvFromMesh

(sbspeval.c:387)

Prototype:

  CagdCrvStruct *BspSrfCrvFromMesh(const 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

(sbspeval.c:294)

Prototype:

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


Description:

Extracts an isoparametric curve out of the given tensor product B-spline 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 curve 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

(sbsp_aux.c:620)

Prototype:

  CagdSrfStruct *BspSrfDegreeRaise(const 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 BspSrfDegreeRaiseN

Keywords:

degree raising


BspSrfDegreeRaiseN

(sbsp_aux.c:789)

Prototype:

  CagdSrfStruct *BspSrfDegreeRaiseN(const CagdSrfStruct *Srf,
                                    int NewUOrder,
                                    int NewVOrder)


Description:

Returns a new Bspline surface, identical to the original but with higher degrees, as prescribed by NewUOrder, NewVOrder.

Parameters:

Srf: To raise its degree.
NewUOrder: New U order of Srf.
NewVOrder: New V order of Srf.


Returned Value:

CagdSrfStruct *: A surface with higher degrees as prescribed by NewUOrder/NewVOrder.


See Also:

CagdSrfDegreeRaise BzrSrfDegreeRaise TrimSrfDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaiseN CagdSrfDegreeRaiseN

Keywords:

degree raising


BspSrfDerive

(sbsp_aux.c:863)

Prototype:

  CagdSrfStruct *BspSrfDerive(const CagdSrfStruct *Srf,
                              CagdSrfDirType Dir,
                              CagdBType DeriveScalar)


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.
DeriveScalar: TRUE to differentiate each channel independently. FALSE to treat geometry as a rational differentiation.


Returned Value:

CagdSrfStruct *: Differentiated surface.


See Also:

CagdSrfDerive BzrSrfDerive SymbSrfDeriveRational BspSrfDeriveScalar

Keywords:

derivatives partial derivatives


BspSrfDeriveScalar

(sbsp_aux.c:985)

Prototype:

  CagdSrfStruct *BspSrfDeriveScalar(const 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. For a Euclidean surface this is the same as BspSrfDerive but for a rational surface the returned surface is not the vector field but simply the derivatives of all the surface's coefficients, including the weights.

Parameters:

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


Returned Value:

CagdSrfStruct *: Differentiated curve.


See Also:

BzrSrfDerive CagdSrfDerive SymbSrfDeriveRational BspSrfDerive BzrSrfDeriveScalar CagdSrfDeriveScalar

Keywords:

derivatives


BspSrfDomain

(bsp_gen.c:251)

Prototype:

  void BspSrfDomain(const 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


BspSrfEvalAtParamMalloc

(sbspeval.c:259)

Prototype:

  CagdRType *BspSrfEvalAtParamMalloc(const CagdSrfStruct *Srf,
                                     CagdRType u,
                                     CagdRType v,
                                     void **Cache)


Description:

Evaluates the given tensor product B-spline surface at a given point, by extracting an isoparametric 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.
Cache: Optional cache for faster repeated evaluations of same U values.


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). This vector is allocated dynamically.


See Also:

CagdSrfEvalMalloc BzrSrfEvalAtParamToData BspSrfEvalAtParamToData BspSrfEvalAtParamToData TrimSrfEvalToData

Keywords:

evaluation B-splines


BspSrfEvalAtParamToData

(sbspeval.c:44)

Prototype:

  void BspSrfEvalAtParamToData(const CagdSrfStruct *Srf,
                               CagdRType u,
                               CagdRType v,
                               CagdRType *R)


Description:


Evaluates the given tensor product B-spline surface at a given point, by extracting the basis functions in U/V and blending them with the 2D matrix of the relevant control points.
              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.
R: Where evaluated point should be saved.


Returned Value:

void


See Also:

CagdSrfEvalToData BzrSrfEvalAtParamToData BspSrfEvalAtParamToData BspSrfEvalAtParamMalloc TrimSrfEvalToData

Keywords:

evaluation B-splines


BspSrfEvalAtParamToDataOld

(sbspeval.c:148)

Prototype:

  void BspSrfEvalAtParamToDataOld(const CagdSrfStruct *Srf,
                                  CagdRType u,
                                  CagdRType v,
                                  CagdRType *R)


Description:


Evaluates the given tensor product B-spline surface at a given point, by extracting an isoparametric 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.
R: Where evaluated point should be saved.


Returned Value:

void


See Also:

CagdSrfEvalToData BzrSrfEvalAtParamToData BspSrfEvalAtParamToData BspSrfEvalAtParamMalloc TrimSrfEvalToData

Keywords:

evaluation B-splines


BspSrfExtension

(bsp_gen.c:1211)

Prototype:

  CagdSrfStruct *BspSrfExtension(const CagdSrfStruct *OrigSrf,
                                 const CagdBType *ExtDirs,
                                 CagdRType EpsilonU,
                                 CagdRType EpsilonV,
                                 CagdBType RemoveExtraKnots)


Description:


Extension of a B-spline surface, in any (or more than one) of the four optional directions of the 2D domain. The domain is extended, such that the trace coincides with the original trace over the original domain. Assumes open end conditions (in both knot vectors u and v). OrigSrf can have "ExtntSclU*" and/or "ExtntSclV*" real attrs. to scale the extension in Euclidean space (for same Epsilon parametric extension. If ExtntSclU/V != 1, the surface might also undergo refinements.

Parameters:

OrigSrf: The surface to be extended.
ExtDirs: A vector of four boolean values to set the extension directions. The convention is MinU, MinV, MaxU, MaxV. if NULL, all four directions are extended.
EpsilonU: The length of the extension in the u direction.
EpsilonV: The length of the extension in the v direction.
RemoveExtraKnots: f FALSE, the resulting surface will not have minimal multiplicity at the first internal knot on the extension side. This is boolean controls all extensions that were performed, one decision for all of them.


Returned Value:

CagdSrfStruct *: The new extended surface.


See Also:

BspCrvExtensionOneSide BspCrvExtraKnotRmv

Keywords:




BspSrfFitLstSqr

(sbsp_int.c:367)

Prototype:

  CagdSrfStruct *BspSrfFitLstSqr(const CagdSrfStruct *Srf,
                                 int UOrder,
                                 int VOrder,
                                 int USize,
                                 int VSize,
                                 CagdParametrizationType ParamType,
                                 CagdRType *Err)


Description:

Fits a surface to the give surface by sampling points on Srf and fitting a surface of orders U/Order and U/VSize control points. Error is measured by the difference between the original and the fitted surface, as maximum error norm.

Parameters:

Srf: Surface to fit a new surface to.
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.
ParamType: Type of parametrization.
Err: The maximum error is updated into here


Returned Value:

CagdSrfStruct *: Fitted surface.


See Also:

BspSrfInterpPts

Keywords:




BspSrfHasBezierKVs

(bsp_knot.c:53)

Prototype:

  CagdBType BspSrfHasBezierKVs(const 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 surface, FALSE otherwise.


Keywords:

conversion


BspSrfHasC1Discont

(sbspeval.c:540)

Prototype:

  CagdBType BspSrfHasC1Discont(const CagdSrfStruct *Srf, int E3C1Discont)


Description:

Examines if the given Bspline surface has C^1 discontinuities. This routine detects potential discontinuities in the control mesh by seeking knots of Order-1 multiplicity. if E3C1Discont is TRUE, only parametric discontinuities that materialize as real (by examining the mesh itself along that line) are reported as true.

Parameters:

Srf: To examine for C^1 discontinuity curves.
E3C1Discont: If TRUE examine if real Euclidean C1 discont.


Returned Value:

CagdBType: True if Srf has C^1 discontinuities, false otherwise. curves.


See Also:

BspSrfC1DiscontCrvs BspKnotAllC1Discont BspSrfIsC1DiscontAt

Keywords:




BspSrfHasOpenEC

(bsp_knot.c:121)

Prototype:

  CagdBType BspSrfHasOpenEC(const CagdSrfStruct *Srf)


Description:

Returns TRUE iff the given B-spline surface has open end conditions.

Parameters:

Srf: To check for open end conditions.


Returned Value:

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


See Also:

BspCrvHasOpenEC

Keywords:

open end conditions


BspSrfHasOpenECDir

(bsp_knot.c:146)

Prototype:

  CagdBType BspSrfHasOpenECDir(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Returns TRUE iff the given B-spline surface has open end conditions 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


BspSrfIntegrate

(sbsp_aux.c:1013)

Prototype:

  CagdSrfStruct *BspSrfIntegrate(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Returns a new Bspline surface, equal to the integral of the given Bspline srf. The given Bspline surface should be nonrational.

Parameters:

Srf: Surface to integrate.
Dir: Direction of integration. Either U or V.


Returned Value:

CagdSrfStruct *: Integrated surface.


See Also:

BzrSrfIntegrate BspCrvIntegrate CagdSrfIntegrate

Keywords:

integrals


BspSrfInterpPts

(sbsp_int.c:106)

Prototype:

  CagdSrfStruct *BspSrfInterpPts(const 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

(sbsp_int.c:467)

Prototype:

  CagdSrfStruct *BspSrfInterpScatPts(const 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]]). That 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.


See Also:

BspSrfInterpScatPtsC0Bndry

Keywords:

interpolation least square approximation


BspSrfInterpScatPts2

(sbsp_int.c:688)

Prototype:

  CagdSrfStruct *BspSrfInterpScatPts2(const CagdCtlPtStruct *PtList,
                                      int UOrder,
                                      int VOrder,
                                      int USize,
                                      int VSize,
                                      CagdRType *UKV,
                                      CagdRType *VKV,
                                      CagdRType *MatrixCondition)


Description:

This function is a variation BspSrfInterpScatPts function that is less accurate/stable but is faster. The difference is that we solve a LSQ problem as A'*A*Vertices=A'*points where A' is the transpose matrix of A. This method is also refered to as pseudo inverse. The SVD decomposition is still used to calculate the above equation set. Given a set of scattered points, PtList, the function computes a Bspline surface of order UOrder by VOrder that interpolates or least square approximates the M given set of scattered points. PtList is a NULL terminated lists of CagdPtStruct structs, with each point holding (u, v, x [, y[, z]]). That 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.
MatrixCondition: ddress of a IrtRType to return SVD matrix condition number to. if NULL, this option is ignored


Returned Value:

CagdSrfStruct *: Constructed interpolating/approximating surface.


Keywords:

interpolation least square approximation


BspSrfInterpScatPtsC0Bndry

(sbsp_int.c:602)

Prototype:

  CagdSrfStruct *BspSrfInterpScatPtsC0Bndry(const CagdCtlPtStruct *PtList,
                                            const CagdCrvStruct *UMinCrv,
                                            const CagdCrvStruct *UMaxCrv,
                                            const CagdCrvStruct *VMinCrv,
                                            const CagdCrvStruct *VMaxCrv)


Description:

Solves a least squares problem as in BspSrfInterpScatPts but forces the four boundary curves to be interpolated.

Parameters:

PtList: A NULL terminating array of linked list of points.
UMinCrv, UMaxCrv, VMinCrv, VMaxCrv: The four boundary curves. UMin and UMax curves must be in the same function space as are VMin and VMax. This function space is also defining the function space of the fitted surface,


Returned Value:

CagdSrfStruct *: Constructed interpolating/approximating surface.


See Also:

BspSrfInterpScatPts

Keywords:

interpolation least square approximation


BspSrfInterpolate

(sbsp_int.c:243)

Prototype:

  CagdSrfStruct *BspSrfInterpolate(const CagdCtlPtStruct *PtList,
                                   int NumUPts,
                                   int NumVPts,
                                   const CagdRType *UParams,
                                   const CagdRType *VParams,
                                   const CagdRType *UKV,
                                   const 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 B-spline surface, computes the B-spline 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 V direction.


Returned Value:

CagdSrfStruct *: Constructed interpolating/approximating surface.


Keywords:

interpolation least square approximation


BspSrfIsC1DiscontAt

(sbspeval.c:605)

Prototype:

  CagdBType BspSrfIsC1DiscontAt(const CagdSrfStruct *Srf,
                                CagdSrfDirType Dir,
                                CagdRType t)


Description:

Examines the mesh at given parametric location for a C1 discontinuity.

Parameters:

Srf: Surface to examine for C1 discontinuity.
Dir: Parametric direction to examine at.
t: Parameter value to examine at.


Returned Value:

CagdBType: TRUE if Srf has a C1 discontinuity at parameter t in direction Dir, FALSE otherwise.


See Also:

BspSrfC1DiscontCrvs BspKnotAllC1Discont BspSrfMeshC1Continuous BspSrfHasC1Discont

Keywords:




BspSrfKnotC0Discont

(bsp_gen.c:560)

Prototype:

  CagdBType BspSrfKnotC0Discont(const CagdSrfStruct *Srf,
                                CagdSrfDirType Dir,
                                CagdRType *t)


Description:

Scans the given knot vector of the given surface for a potential C0 discontinuity. Looks for multiplicities in the knot sequence and then examine the mesh if indeed the mesh is discontinuous at that location. Assumes knot vectors has open end condition.

Parameters:

Srf: To examine its potential discontinuity across Dir.
Dir: Direction to examine the discontinuity across.
t: Where to put the parameter value (knot) that can be C0 discontinuous.


Returned Value:

CagdBType: TRUE if found a C0 discontinuity, FALSE otherwise.


See Also:

BspSrfKnotC1Discont BspKnotC1Discont BspSrfMeshC1Continuous

Keywords:

knot vectors continuity discontinuity


BspSrfKnotC1Discont

(bsp_gen.c:596)

Prototype:

  CagdBType BspSrfKnotC1Discont(const CagdSrfStruct *Srf,
                                CagdSrfDirType Dir,
                                CagdRType *t)


Description:

Scans the given knot vector of the given surface for a potential C1 discontinuity. Looks for multiplicities in the knot sequence and then examine the mesh if indeed the mesh is discontinuous at that location. Assumes knot vectors has open end condition.

Parameters:

Srf: To examine its potential discontinuity across Dir.
Dir: Direction to examine the discontinuity across.
t: Where to put the parameter value (knot) that can be C1 discontinuous.


Returned Value:

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


See Also:

BspSrfKnotC0Discont BspKnotC1Discont BspSrfMeshC1Continuous

Keywords:

knot vectors continuity discontinuity


BspSrfKnotInsert

(bspboehm.c:143)

Prototype:

  CagdSrfStruct *BspSrfKnotInsert(const 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

(sbsp_aux.c:423)

Prototype:

  CagdSrfStruct *BspSrfKnotInsertNDiff(const CagdSrfStruct *Srf,
                                       CagdSrfDirType Dir,
                                       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:

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

(sbsp_aux.c:352)

Prototype:

  CagdSrfStruct *BspSrfKnotInsertNSame(const 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


BspSrfMaxCoefParamMalloc

(bsp_knot.c:1906)

Prototype:

  CagdRType *BspSrfMaxCoefParamMalloc(const 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 an 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


BspSrfMaxCoefParamToData

(bsp_knot.c:1853)

Prototype:

  CagdRType *BspSrfMaxCoefParamToData(const CagdSrfStruct *Srf,
                                      int Axis,
                                      CagdRType *MaxVal,
                                      CagdRType *UV)


Description:

Finds the parameter value with the largest coefficient of the surface using nodes values to estimate the coefficients' parameters. Returns a pointer to an 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.
UV: The node UV parameter values of the detected maximal coefficient.


Returned Value:

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


Keywords:

extremum


BspSrfMeshC1Continuous

(bsp_gen.c:684)

Prototype:

  CagdBType BspSrfMeshC1Continuous(const CagdSrfStruct *Srf,
                                   CagdSrfDirType Dir,
                                   int Idx)


Description:

Examine the mesh of the given surface across direction Dir in index of mesh Index for a real discontinuity in the mesh. This index will typically be for a knot multiplicity potential discont.

Parameters:

Srf: To examine its potential discontinuity across Dir.
Dir: Direction to examine the discontinuity across.
Idx: Index where to examine the discontinuity.


Returned Value:

CagdBType: TRUE if continuous there, FALSE otherwise.


See Also:

BspKnotC1Discont BspSrfIsC1DiscontAt BspMeshC1PtsCollinear

Keywords:




BspSrfMeshNormals

(sbsp_aux.c:1298)

Prototype:

  CagdVecStruct *BspSrfMeshNormals(const 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 BzrSrfMeshNormals BspSrfMeshNormalsSymb

Keywords:

normal


BspSrfMeshNormalsSymb

(sbsp_aux.c:1600)

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).


See Also:

CagdSrfNormal BspSrfNormal SymbSrfNormalSrf BspSrfMeshNormals

Keywords:

normal


BspSrfMoebiusTransform

(sbsp_aux.c:1674)

Prototype:

  CagdSrfStruct *BspSrfMoebiusTransform(const CagdSrfStruct *CSrf,
                                        CagdRType c,
                                        CagdSrfDirType Dir)


Description:

Apply the Moebius transformation to a ration Bspline surface. See "Moebius reparametrization of rational Bsplines", by Lee & Lucian, CAGD 8 (1991) pp 213-215.

Parameters:

CSrf: Surface to apply the Moebius transformation to.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the surface, along each row or column. If c == 0, the first and last weights are made equal, in the first row/column.
Dir: Direction to apply the Moebius transformation, row or col. If Dir == CAGD_BOTH_DIR, the transformation is applied to both the row and column directions, in this order.


Returned Value:

CagdSrfStruct *: The modified surface with the same shape but different speeds.


See Also:

BspCrvMoebiusTransform BzrSrfMoebiusTransform

Keywords:




BspSrfNew

(bsp_gen.c:39)

Prototype:

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


Description:

Allocates the memory required for a new B-spline 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


BspSrfNormalMalloc

(sbsp_aux.c:1264)

Prototype:

  CagdVecStruct *BspSrfNormalMalloc(const 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 vector holding the (unit) normal information, allocated dynamically.


See Also:

CagdSrfNormal BzrSrfNormal BspSrfMeshNormals SymbSrfNormalSrf BspSrfNormalToData

Keywords:

normal


BspSrfNormalToData

(sbsp_aux.c:1199)

Prototype:

  CagdVecStruct *BspSrfNormalToData(const CagdSrfStruct *Srf,
                                    CagdRType u,
                                    CagdRType v,
                                    CagdBType Normalize,
                                    CagdVecStruct *Normal)


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: B-spline 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.
Normal: A pointer to a vector holding the (unit) normal information.


Returned Value:

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


See Also:

CagdSrfNormal BzrSrfNormal BspSrfMeshNormals SymbSrfNormalSrf BspSrfNormalMalloc

Keywords:

normal


BspSrfOpenEnd

(bsp_gen.c:323)

Prototype:

  CagdSrfStruct *BspSrfOpenEnd(const 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 surface with open end conditions. Input can also be periodic.


Returned Value:

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


See Also:

BspCrvOpenEnd

Keywords:

open end conditions


BspSrfSubdivAtParam

(sbsp_aux.c:64)

Prototype:

  CagdSrfStruct *BspSrfSubdivAtParam(const 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


BspSrfTangentToData

(sbsp_aux.c:1145)

Prototype:

  CagdVecStruct *BspSrfTangentToData(const CagdSrfStruct *Srf,
                                     CagdRType u,
                                     CagdRType v,
                                     CagdSrfDirType Dir,
                                     CagdBType Normalize,
                                     CagdVecStruct *Tan)


Description:

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

Parameters:

Srf: B-spline surface to evaluate (unit) tangent vector for.
u, v: Parametric location of required (unit) tangent.
Dir: The OTHER direction (for historic reasons...) 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.
Tan: A pointer to a vector holding the (unit) tangent information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the (unit) tangent information. An Ek, k >= 3 vector, depending on dimension k of Srf.


See Also:

CagdSrfTangent BzrSrfTangent

Keywords:

tangent


BspSrfsSubdivAtAllDetectedLocations

(cagd_aux.c:2302)

Prototype:

  CagdSrfStruct *BspSrfsSubdivAtAllDetectedLocations(const CagdSrfStruct *Srf,
                                                     CagdSrfTestingFuncType
                                                                   SrfTestFunc)


Description:

Subdivides the given surface Srf at all locations SrfTesTFunc detects. Examples for SrfTesTFunc can be BspSrfKnotC0Discont or BspSrfKnotC1Discont.

Parameters:

Srf: Surface to subdivide at all detected locations by SrfTestFunc.
SrfTestFunc: Surface testing function, like BspSrfKnotC0Discont.


Returned Value:

CagdSrfStruct *: Set of subdivided surfaces, or NULL if nothing was detected.


See Also:

BspSrfKnotC0Discont BspSrfKnotC1Discont BspCrvsSubdivAtAllDetectedLocations

Keywords:




BspVecSpreadEqualItems

(bsp_knot.c:3034)

Prototype:

  CagdBType BspVecSpreadEqualItems(CagdRType *Vec, int Len, CagdRType MinDist)


Description:

Given a monotone vector of reals, spread (almost) equal items so they are MinDist apart while keeping the minimal and maximal values the same.

Parameters:

Vec: Vector of reals to spread (almost) equal items in. Modified in place.
Len: Length of vector Vec.
MinDist: he minimal distance two adjacent item should have.


Returned Value:

CagdBType: TRUE if successful, FALSE if cannot be done (MinDist too large).


Keywords:




BzrCrv2Polyline

(bzr2poly.c:1166)

Prototype:

  CagdPolylineStruct *BzrCrv2Polyline(const 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


BzrCrvBiNormalMalloc

(cbzr_aux.c:672)

Prototype:

  CagdVecStruct *BzrCrvBiNormalMalloc(const 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 collinear, 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 vector holding the binormal information. Always an E3 vector.


Keywords:

binormal


BzrCrvBiNormalToData

(cbzr_aux.c:567)

Prototype:

  CagdVecStruct *BzrCrvBiNormalToData(const CagdCrvStruct *Crv,
                                      CagdRType t,
                                      CagdBType Normalize,
                                      CagdVecStruct *Vec)


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 collinear, 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.
Vec: A pointer to a vector holding the binormal information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the binormal information. Always an E3 vector.


Keywords:

binormal


BzrCrvCreateArc

(cagd_arc.c:50)

Prototype:

  CagdCrvStruct *BzrCrvCreateArc(const CagdPtStruct *Start,
                                 const CagdPtStruct *Center,
                                 const 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.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle CagdCreateConicCurve CagdCrvCreateArc BspCrvCreateUnitPCircle CagdCrvCreateArcCCW CagdCrvCreateArcCW

Keywords:

circle arc


BzrCrvDegreeRaise

(cbzr_aux.c:251)

Prototype:

  CagdCrvStruct *BzrCrvDegreeRaise(const 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 its degree by one.


Returned Value:

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


See Also:

BzrCrvDegreeReduce BzrCrvDegreeRaiseN PwrCrvDegreeRaise

Keywords:

degree raising


BzrCrvDegreeRaiseN

(cbzr_aux.c:203)

Prototype:

  CagdCrvStruct *BzrCrvDegreeRaiseN(const CagdCrvStruct *Crv, int NewOrder)


Description:


Returns a new curve, identical to the original but with order NewOrder. 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.


See Also:

BzrCrvDegreeRaise PwrCrvDegreeRaiseN

Keywords:

degree raising


BzrCrvDegreeReduce

(cbzr_aux.c:322)

Prototype:

  CagdCrvStruct *BzrCrvDegreeReduce(const CagdCrvStruct *Crv)


Description:

Returns a new curve, usually similar to the original but with one degree smaller. Let old control polygon be P(i), i = 0 to n, and Q(i) be new one. Then:
         n P(i) - i Q_r(i-1)
Q_r(i) = ------------------- ,   i = 0, 1, ... , n - 1.
                n - i


           n P(i) - (n - i) Q_l(i)
Q_l(i-1) = ----------------------- ,   i = n, n - 1, ... , 1.
                      i

and
                     i
                    __
               1    \     2n
    g(i) = -------  /    (  )
            (2n-1)  --    2j
           2        j=0

yielding,
    Q(i) = (1 - g(i)) Q_r(i) + g(i) Q_l(i).

See also "Curves and Surfaces for Computer Aided Geometric Design" Gerald Farin. Academic Press, Inc. Third Edition.

Parameters:

Crv: To reduce its degree by one.


Returned Value:

CagdCrvStruct *: A curve of one order lower representing a similar geometry to Crv. The result is optimal in the infinity norm and will be identical to the given curve if the original curve was degree raised.


See Also:

BzrCrvDegreeRaise SymbBzrDegReduce

Keywords:

degree reduction degree raising.


BzrCrvDerive

(cbzr_aux.c:768)

Prototype:

  CagdCrvStruct *BzrCrvDerive(const CagdCrvStruct *Crv, CagdBType DeriveScalar)


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.
DeriveScalar: TRUE to differentiate each channel independently. FALSE to treat geometry as a rational differentiation.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

CagdCrvDerive BspCrvDerive SymbCrvDeriveRational BzrCrvDeriveScalar

Keywords:

derivatives


BzrCrvDeriveScalar

(cbzr_aux.c:818)

Prototype:

  CagdCrvStruct *BzrCrvDeriveScalar(const 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.

For a Euclidean curve this is the same as CagdCrvDerive but for a rational curve the returned curve is not the vector field but simply the derivatives of all the curve's coefficients, including the weights.

Parameters:

Crv: To differentiate.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

BzrCrvDerive CagdCrvDerive SymbCrvDeriveRational. BspCrvDerive BzrCrvDeriveScalar CagdCrvDeriveScalar

Keywords:

derivatives


BzrCrvEvalAtParamMalloc

(cbzreval.c:220)

Prototype:

  CagdRType *BzrCrvEvalAtParamMalloc(const CagdCrvStruct *Crv, CagdRType t)


Description:

Returns a pointer to a dynamically allocated 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). This vector is allocated dynamically.


See Also:

CagdCrvEvalToData BspCrvEvalAtParamToData BspCrvEvalVecAtParam BzrCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline BzrCrvEvalAtParam

Keywords:

evaluation


BzrCrvEvalAtParamToData

(cbzreval.c:259)

Prototype:

  void BzrCrvEvalAtParamToData(const CagdCrvStruct *Crv,
                               CagdRType t,
                               CagdRType *Pt)


Description:

Returns a pointer to a dynamic 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.
Pt: 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).


Returned Value:

void


See Also:

CagdCrvEvalToData BspCrvEvalAtParamToData BspCrvEvalVecAtParam BzrCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline BzrCrvEvalAtParamToData

Keywords:

evaluation


BzrCrvEvalBasisFunc

(cbzreval.c:47)

Prototype:

  CagdRType BzrCrvEvalBasisFunc(int i, int k, CagdRType t)


Description:

Evaluates the i'th Bezier basis function of order k, at parametric value t (t in [0..1]).
  The functions is:                i     i          k - i - 1
                      Bi,k-1(t) = ( ) * t  * (1 - t)
                                  k-1                                      *


Parameters:

i: I'th basis function.
k: Order of the basis function.
t: Parameter value at which to evaluate the Bezier basis function.


Returned Value:

CagdRType: Value of basis function.


See Also:

BzrCrvEvalBasisFuncs

Keywords:




BzrCrvEvalBasisFuncs

(cbzreval.c:357)

Prototype:

  CagdRType *BzrCrvEvalBasisFuncs(int k, CagdRType t, CagdRType *Vec)


Description:


Evaluates the vector of Bezier basis functions of order k, at parametric value t (t in [0..1]).
  The functions are:               i     i          k - i - 1
                      Bi,k-1(t) = ( ) * t  * (1 - t)
                                  k-1                                      *


Parameters:

k: Order of the basis function.
t: Parameter value at which to evaluate the Bezier basis function.
Vec: ector to hold the result, of length Order k.


Returned Value:

CagdRType *: Value of basis function's vector . Same as Vec.


See Also:

BzrCrvEvalBasisFunc

Keywords:




BzrCrvEvalToPolyline

(cbzreval.c:306)

Prototype:

  void BzrCrvEvalToPolyline(const 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 over number of samples.
Points: Where to put the resulting polyline. Assumed to be valid with respect to the dimension of Crv.


Returned Value:

void


See Also:

CagdCrvEvalToData BspCrvEvalAtParamToData BzrCrvEvalVecAtParam BspCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline

Keywords:

conversion refinement evaluation


BzrCrvEvalVecAtParam

(cbzreval.c:168)

Prototype:

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


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: Coefficients of a scalar B-spline univariate function.
VecInc: Step to move along Vec.
Order: Order of associated geometry.
t: Parameter value where to evaluate the curve.
BasisFuncs: Optional basic functions, if not NULL, in which case t is ignored.


Returned Value:

CagdRType: Geometry's value at parameter value t.


See Also:

CagdCrvEvalToData BspCrvEvalAtParamToData BzrCrvEvalAtParamToData BspCrvEvalVecAtParam BspCrvEvalCoxDeBoorToData CagdCrvEvalToPolyline

Keywords:

evaluation


BzrCrvIntegrate

(cbzr_aux.c:861)

Prototype:

  CagdCrvStruct *BzrCrvIntegrate(const 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 BzrSrfIntegrate CagdCrvIntegrate

Keywords:

integrals


BzrCrvInterp2

(bzr_intr.c:453)

Prototype:

  CagdBType BzrCrvInterp2(IrtRType *Result, const IrtRType *Input, int Size)


Description:


Interpolates the given Input data sets at node points and place the Bezier coefficients in Result.

Parameters:

Result: Where the interpolated control points will be placed.
Input: Points to interpolate at node parameter values.
Size: Of control polygon. Same as the Bezier order.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


Keywords:

interpolation


BzrCrvMoebiusTransform

(cbzr_aux.c:1029)

Prototype:

  CagdCrvStruct *BzrCrvMoebiusTransform(const CagdCrvStruct *CCrv, CagdRType c)


Description:

Apply the Moebius transformation to a rational Bezier curve.

Parameters:

CCrv: Curve to apply the Moebius transformation to.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the curve. If c == 0, the first and last weights are made equal.


Returned Value:

CagdCrvStruct *: The modified curve with the same shape but different speed.


See Also:

BspCrvMoebiusTransform BzrSrfMoebiusTransform

Keywords:




BzrCrvNew

(bzr_gen.c:61)

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 PwrCrvNew

Keywords:

allocation


BzrCrvNormalMalloc

(cbzr_aux.c:739)

Prototype:

  CagdVecStruct *BzrCrvNormalMalloc(const 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 vector holding the normal information. Always an E3 vector.


Keywords:

normal


BzrCrvNormalToData

(cbzr_aux.c:703)

Prototype:

  CagdVecStruct *BzrCrvNormalToData(const CagdCrvStruct *Crv,
                                    CagdRType t,
                                    CagdBType Normalize,
                                    CagdVecStruct *N)


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.
N: A pointer to a vector holding the normal information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the normal information. Always an E3 vector.


Keywords:

normal


BzrCrvSetCache

(cbzreval.c:99)

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.
EnableCache: Are we really planning on using this thing?


Returned Value:

void


Keywords:

evaluation caching


BzrCrvSubdivAtParam

(cbzr_aux.c:166)

Prototype:

  CagdCrvStruct *BzrCrvSubdivAtParam(const 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.


See Also:

BzrSubdivCtlPoly BspCrvSubdivAtParam

Keywords:

subdivision refinement


BzrCrvSubdivCtlPoly

(cbzr_aux.c:46)

Prototype:

  void BzrCrvSubdivCtlPoly(CagdRType * const *Points,
                           CagdRType **LPoints,
                           CagdRType **RPoints,
                           int Length,
                           CagdPointType PType,
                           CagdRType t)


Description:

Apply Bezier subdivision to the given curve at parameter value t, and save the result in data LPoints/RPoints. Note this function could also be called from a B-spline curve with a Bezier knot sequence.

Parameters:

Points: To subdivide at parametr value t.
LPoints, RPoints: Where the results are kept.
Length: Of this Bezier curve.
PType: Points types we have here.
t: Parameter value to subdivide curve at.


Returned Value:

void


See Also:

BzrCrvSubdivAtParam BspCrvSubdivCtlPoly BzrCrvSubdivCtlPolyStep

Keywords:




BzrCrvSubdivCtlPolyStep

(cbzr_aux.c:106)

Prototype:

  void BzrCrvSubdivCtlPolyStep(CagdRType * const *Points,
                               CagdRType **LPoints,
                               CagdRType **RPoints,
                               int Length,
                               CagdPointType PType,
                               CagdRType t,
                               int Step)


Description:

Apply Bezier subdivision to the given data at parameter value t, and save the result in data LPoints/RPoints. Note this function could also be called from a B-spline curve with a Bezier knot sequence. This function is used to Bezier subdivide surfaces (See Step size!).

Parameters:

Points: To subdivide at parametr value t.
LPoints, RPoints: Where the results are kept.
Length: Of this Bezier curve.
PType: Points types we have here.
t: Parameter value to subdivide data at.
Step: Stride along the data, 1 for curves, ULength for a surface subdivision along V.


Returned Value:

void


See Also:

BzrCrvSubdivAtParam BspCrvSubdivCtlPoly BzrCrvSubdivCtlPoly

Keywords:




BzrCrvTangentToData

(cbzr_aux.c:398)

Prototype:

  CagdVecStruct *BzrCrvTangentToData(const CagdCrvStruct *Crv,
                                     CagdRType t,
                                     CagdBType Normalize,
                                     CagdVecStruct *Tan)


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, returned is an unnormalized vector in the right direction of the tangent.
Tan: A pointer to a vector holding the tangent information.


Returned Value:

CagdVecStruct *: A pointer to a vector holding the tangent information. An Ek, k >= 3 vector, depending on dimension k of Crv.


Keywords:

tangent


BzrSrf2Curves

(bzr2poly.c:1100)

Prototype:

  CagdCrvStruct *BzrSrf2Curves(const 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

(bzr2poly.c:140)

Prototype:

  IPPolygonStruct *BzrSrf2Polygons(const CagdSrfStruct *Srf,
                                   CagdSrf2PlsInfoStrct *TessInfo)


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 IPPolygonStruct.

Parameters:

Srf: To approximate into triangles.
TessInfo: All auxiliary information/state to tessellate.


Returned Value:

IPPolygonStruct *: 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 CagdSrf2Polygons TrimSrf2Polygons CagdSrf2Polygons

Keywords:

polygonization surface approximation


BzrSrf2PolygonsN

(bzr2poly.c:192)

Prototype:

  IPPolygonStruct *BzrSrf2PolygonsN(const CagdSrfStruct *Srf,
                                    int Nu,
                                    int Nv,
                                    CagdBType ComputeNormals,
                                    CagdBType FourPerFlat,
                                    CagdBType ComputeUV)


Description:

Routine to convert a single freeform surface to set of triangles approximating it using a uniform fixed resolution of Nu x Nv. NULL is returned in case of an error, otherwise list of IPPolygonStruct.

Parameters:

Srf: To approximate into triangles.
Nu, Nv: The number of uniform samples in U and V of surface.
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:

IPPolygonStruct *: 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 CagdSrf2PolygonStrip CagdSrf2Polygons

Keywords:

evaluation polygonal approximation


BzrSrf2PolygonsSamples

(bzr2poly.c:847)

Prototype:

  CagdBType BzrSrf2PolygonsSamples(const CagdSrfStruct *Srf,
                                   int FineNess,
                                   CagdBType ComputeNormals,
                                   CagdBType ComputeUV,
                                   CagdRType **PtWeights,
                                   CagdPtStruct **PtMesh,
                                   CagdVecStruct **PtNrml,
                                   CagdUVStruct **UVMesh,
                                   int *FineNessU,
                                   int *FineNessV)


Description:

Routine to uniformly sample a single Bezier srf as a grid. FineNess is a fineness control on the result and the larger it is, more samples may result. A value of 10 is a good starting value. FALSE is returned in case of an error, TRUE otherwise.

Parameters:

Srf: To sample in a grid.
FineNess: Control on accuracy, the higher the finer.
ComputeNormals: If TRUE, normal information is also computed.
ComputeUV: If TRUE, UV values are stored and returned as well.
PtWeights: Weights of the evaluations, if rational, to detect poles. NULL if surface not rational.
PtMesh: Evaluated positions of grid of samples.
PtNrml: Evaluated normals of grid of samples or NULL if none.
UVMesh: Evaluated UV vals of grid of samples or NULL if none.
FineNessU, FineNessV: Actual size of PtMesh, PtNrml, UVMesh.


Returned Value:

CagdBType: FALSE is returned in case of an error, TRUE otherwise.


See Also:

BspSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons BzrSrf2PolygonsSamplesNuNv

Keywords:

polygonization surface approximation


BzrSrf2PolygonsSamplesNuNv

(bzr2poly.c:921)

Prototype:

  CagdBType BzrSrf2PolygonsSamplesNuNv(const CagdSrfStruct *Srf,
                                       int Nu,
                                       int Nv,
                                       CagdBType ComputeNormals,
                                       CagdBType ComputeUV,
                                       CagdRType **PtWeights,
                                       CagdPtStruct **PtMesh,
                                       CagdVecStruct **PtNrml,
                                       CagdUVStruct **UVMesh)


Description:

Routine to uniformly sample a single Bezier srf as a grid. Nu and Nv fix the grid's sizes. FALSE is returned in case of an error, TRUE otherwise.

Parameters:

Srf: To sample in a grid.
Nu, Nv: The number of uniform samples in U and V of surface.
ComputeNormals: If TRUE, normal information is also computed.
ComputeUV: If TRUE, UV values are stored and returned as well.
PtWeights: Weights of the evaluations, if rational, to detect poles. NULL if surface not rational.
PtMesh: Evaluted positions of grid of samples.
PtNrml: Evaluted normals of grid of samples or NULL if none.
UVMesh: Evaluted UV vals of grid of samples or NULL if none.


Returned Value:

CagdBType: FALSE is returned in case of an error, TRUE otherwise.


See Also:

BspSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons BzrSrf2PolygonsSamples

Keywords:




BzrSrf2Polylines

(bzr2poly.c:1027)

Prototype:

  CagdPolylineStruct *BzrSrf2Polylines(const 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

(sbzreval.c:212)

Prototype:

  CagdCrvStruct *BzrSrfCrvFromMesh(const 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

(sbzreval.c:130)

Prototype:

  CagdCrvStruct *BzrSrfCrvFromSrf(const 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 curve 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

(sbzr_aux.c:162)

Prototype:

  CagdSrfStruct *BzrSrfDegreeRaise(const 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 PwrSrfDegreeRaise PwrSrfDegreeRaiseN

Keywords:

degree raising


BzrSrfDegreeRaiseN

(sbzr_aux.c:250)

Prototype:

  CagdSrfStruct *BzrSrfDegreeRaiseN(const CagdSrfStruct *Srf,
                                    int NewUOrder,
                                    int NewVOrder)


Description:

Returns a new Bezier surface, identical to the original but with higher degrees, as prescribed by NewUOrder, NewVOrder.

Parameters:

Srf: To raise its degrees.
NewUOrder: New U order of Srf.
NewVOrder: New V order of Srf.


Returned Value:

CagdSrfStruct *: A surface with higher degrees as prescribed by NewUOrder/NewVOrder.


See Also:

CagdSrfDegreeRaise BzrSrfDegreeRaise TrimSrfDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaiseN CagdSrfDegreeRaiseN PwrSrfDegreeRaise PwrSrfDegreeRaiseN

Keywords:

degree raising


BzrSrfDerive

(sbzr_aux.c:415)

Prototype:

  CagdSrfStruct *BzrSrfDerive(const CagdSrfStruct *Srf,
                              CagdSrfDirType Dir,
                              CagdBType DeriveScalar)


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.
DeriveScalar: TRUE to differentiate each channel independently. FALSE to treat geometry as a rational differentiation.


Returned Value:

CagdSrfStruct *: Differentiated surface.


See Also:

CagdSrfDerive BspSrfDerive SymbSrfDeriveRational BzrSrfDeriveScalar

Keywords:

derivatives partial derivatives


BzrSrfDeriveScalar

(sbzr_aux.c:489)

Prototype:

  CagdSrfStruct *BzrSrfDeriveScalar(const 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. For a Euclidean surface this is the same as CagdCrvDerive but for a rational surface the returned surface is not the vector field but simply the derivatives of all the surface's coefficients, including the weights.

Parameters:

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


Returned Value:

CagdSrfStruct *: Differentiated curve.


See Also:

BzrSrfDerive CagdSrfDerive SymbSrfDeriveRational BspSrfDerive BspSrfDeriveScalar CagdSrfDeriveScalar

Keywords:

derivatives


BzrSrfEvalAtParamMalloc

(sbzreval.c:95)

Prototype:

  CagdRType *BzrSrfEvalAtParamMalloc(const CagdSrfStruct *Srf,
                                     CagdRType u,
                                     CagdRType v)


Description:

Evaluates the given tensor product Bezier surface at a given point, by extracting an isoparametric 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 BspSrfEvalAtParamToData TrimSrfEval BzrSrfEvalAtParamToData

Keywords:

evaluation Bezier


BzrSrfEvalAtParamToData

(sbzreval.c:49)

Prototype:

  void BzrSrfEvalAtParamToData(const CagdSrfStruct *Srf,
                               CagdRType u,
                               CagdRType v,
                               CagdRType *R)


Description:


Evaluates the given tensor product Bezier surface at a given point, by extracting an isoparametric 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.
R: 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).


Returned Value:

void


See Also:

CagdSrfEval BspSrfEvalAtParam BspSrfEvalAtParamToData TrimSrfEval BzrSrfEvalAtParam

Keywords:

evaluation Bezier


BzrSrfIntegrate

(sbzr_aux.c:517)

Prototype:

  CagdSrfStruct *BzrSrfIntegrate(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:


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

Parameters:

Srf: Surface to integrate.
Dir: Direction of integration. Either U or V.


Returned Value:

CagdSrfStruct *: Integrated surface.


See Also:

BspSrfIntegrate BzrCrvIntegrate CagdSrfIntegrate

Keywords:

integrals


BzrSrfMeshNormals

(sbzr_aux.c:750)

Prototype:

  CagdVecStruct *BzrSrfMeshNormals(const 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 BspSrfMeshNormals

Keywords:

normal


BzrSrfMoebiusTransform

(sbzr_aux.c:954)

Prototype:

  CagdSrfStruct *BzrSrfMoebiusTransform(const CagdSrfStruct *CSrf,
                                        CagdRType c,
                                        CagdSrfDirType Dir)


Description:

Apply the Moebius transformation to a ration Bezier surface.

Parameters:

CSrf: Surface to apply the Moebius transformation to.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the surface, along each row or column. If c == 0, the first and last weights are made equal, in the first row/column.
Dir: Direction to apply the Moebius transformation, row or col. If Dir == CAGD_BOTH_DIR, the transformation is applied to both the row and column directions, in this order.


Returned Value:

CagdSrfStruct *: The modified surface with the same shape but different speeds.


See Also:

BzrCrvMoebiusTransform BspSrfMoebiusTransform

Keywords:




BzrSrfNew

(bzr_gen.c:30)

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 PwrSrfNew

Keywords:

allocation


BzrSrfNormalMalloc

(sbzr_aux.c:717)

Prototype:

  CagdVecStruct *BzrSrfNormalMalloc(const 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 vector holding the (unit) normal information.


See Also:

CagdSrfNormal BspSrfNormal SymbSrfNormalSrf

Keywords:

normal


BzrSrfNormalToData

(sbzr_aux.c:657)

Prototype:

  CagdVecStruct *BzrSrfNormalToData(const CagdSrfStruct *Srf,
                                    CagdRType u,
                                    CagdRType v,
                                    CagdBType Normalize,
                                    CagdVecStruct *Normal)


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.
Normal: A pointer to a vector holding the (unit) normal information.


Returned Value:

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


See Also:

CagdSrfNormal BspSrfNormal SymbSrfNormalSrf

Keywords:

normal


BzrSrfSubdivAtParam

(sbzr_aux.c:118)

Prototype:

  CagdSrfStruct *BzrSrfSubdivAtParam(const 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


BzrSrfSubdivCtlMesh

(sbzr_aux.c:53)

Prototype:

  void BzrSrfSubdivCtlMesh(CagdRType * const *Points,
                           CagdRType **LPoints,
                           CagdRType **RPoints,
                           int ULength,
                           int VLength,
                           CagdPointType PType,
                           CagdRType t,
                           CagdSrfDirType Dir)


Description:

Apply Bezier subdivision to the given curve at parameter value t, and save the result in data LPoints/RPoints. Note this function could also be called from a B-spline curve with a Bezier knot sequence.

Parameters:

Points: To subdivide at parametr value t.
LPoints, RPoints: Where the results are kept.
ULength, VLength: Of this Bezier surface, dimensions of Points.
PType: Points types we have here.
t: Parameter value to subdivide curve at.
Dir: Direction of subdivision.


Returned Value:

void


See Also:

BzrCrvSubdivAtParam BspCrvSubdivCtlPoly BzrCrvSubdivCtlPolyStep

Keywords:




BzrSrfTangentToData

(sbzr_aux.c:606)

Prototype:

  CagdVecStruct *BzrSrfTangentToData(const CagdSrfStruct *Srf,
                                     CagdRType u,
                                     CagdRType v,
                                     CagdSrfDirType Dir,
                                     CagdBType Normalize,
                                     CagdVecStruct *Tangent)


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: The OTHER direction (for historic reasons...) 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.
Tangent: A pointer to a vector holding the (unit) tangent information.


Returned Value:

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


See Also:

CagdSrfTangent BspSrfTangent

Keywords:

tangent


BzrZeroSetNoSubdiv

(bzrzrfct.c:1166)

Prototype:

  CagdPtStruct *BzrZeroSetNoSubdiv(const CagdCrvStruct *Crv,
                                   int Axis,
                                   CagdRType NumericTol,
                                   CagdRType SubdivTol)


Description:

Finds the zeros of a given curve assuming it is a scalar. Employs factoring out of roots without subdivision.

Parameters:

Crv: A curve to find zeros of.
Axis: The axis along which to find roots.
NumericTol: he numeric tolerance up to which solution is required.
SubdivTol: The tolerance up to which subdivision is to be done.


Returned Value:

CagdPtStruct *: List of solutions as tuples of the form (root, multiplicity).


See Also:

MvarCrvZeroSet CagdCrvCrvInter SymbCrvZeroSet CagdCrvZeroSet SymbCrvCrvInter SymbScalarCrvLowDegZeroSet.

Keywords:




Cagd2PolyClipPolysAtPoles

(bzr2poly.c:102)

Prototype:

  CagdBType Cagd2PolyClipPolysAtPoles(CagdBType ClipPolysAtPoles)


Description:

Sets the option of clipping polylines and polygon at poles (when the rational curves/surface goes to infinity due to division by zero.). If ClipPolysAtPoles == IRIT_QUERY_INT_PROP, current state is only queried.

Parameters:

ClipPolysAtPoles: New setting to use or IRIT_QUERY_INT_PROP to query.


Returned Value:

CagdBType: Old value.


See Also:

CagdSrf2Polygons CagdSrf2PolygonFast CagdSrf2PolygonStrip CagdSrf2PolygonMergeCoplanar

Keywords:




CagdAllWeightsNegative

(cagd2gen.c:2190)

Prototype:

  CagdBType CagdAllWeightsNegative(CagdRType * const *Points,
                                   CagdPointType PType,
                                   int Len,
                                   CagdBType Flip)


Description:

Returns TRUE if the given control points have negative weights.

Parameters:

Points: Control points to consider and possibly modify in place.
PType: Input point type, as given in Points.
Len: Number of points in Points.
Flip: If TRUE, flips all weights (and points coefficients) in place, so we end up with positive weights only.


Returned Value:

CagdBType: TRUE if original has negative weights, FALSE otherwise.


See Also:

CagdPointsHasPoles CagdAllWeightsSame

Keywords:




CagdAllWeightsSame

(cagd2gen.c:2284)

Prototype:

  CagdBType CagdAllWeightsSame(CagdRType * const *Points, int Len)


Description:

Returns TRUE if given control points has identical weights throughout.

Parameters:

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


Returned Value:

CagdBType: TRUE if all weights are the same, FALSE otherwise.


See Also:

CagdCrvBBox CagdSrfBBox GMBBSetBBoxPrecise SymbCrvPosNegWeights CagdPointsHasPoles CagdAllWeightsNegative

Keywords:




CagdAreClosedCrvs

(cagd1gen.c:1414)

Prototype:

  CagdBType CagdAreClosedCrvs(const CagdCrvStruct *Crvs,
                              const CagdSrfStruct *Srf)


Description:

Returns TRUE if the curves form a closed loop.

Parameters:

Crvs: To test if form a closed loop.
Srf: If not NULL, Crvs are assumed in the parameteric space of Srf, and crossing a boundary of Srf can still be valid loop. Otherwise, if NULL, curves end points are compared directly.


Returned Value:

CagdBType: TRUE if closed, FALSE otherwise.


See Also:

CagdIsClosedCrv CagdIsClosedSrf CagdIsZeroLenCrv

Keywords:




CagdBBoxArrayFree

(cagd2gen.c:761)

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

(cagd1gen.c:529)

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

(cagd1gen.c:1062)

Prototype:

  CagdBBoxStruct *CagdBBoxCopy(const 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


CagdBBoxFree

(cagd2gen.c:739)

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


CagdBBoxNew

(cagd1gen.c:551)

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

(cagdruld.c:127)

Prototype:

  CagdSrfStruct *CagdBilinearSrf(const CagdPtStruct *Pt00,
                                 const CagdPtStruct *Pt01,
                                 const CagdPtStruct *Pt10,
                                 const CagdPtStruct *Pt11,
                                 CagdPointType PType)


Description:

Constructs a bilinear surface between the four provided points.

Parameters:

Pt00, Pt01, Pt10, Pt11: he four points to construct a bilinear between.
PType: The point time and hence dimension of these four points.


Returned Value:

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


Keywords:

Bilinear surface surface constructors


CagdBlendTwoSurfaces

(hermite.c:410)

Prototype:

  CagdSrfStruct *CagdBlendTwoSurfaces(const CagdSrfStruct *Srf1,
                                      const CagdSrfStruct *Srf2,
                                      int BlendDegree,
                                      CagdRType TanScale)


Description:

Blends the two given surfaces along the u (first) parameter value. Returned surface will start and Srf1(UMin) and terminate at Srf2(UMax). Continuity is governed by the blending degree. 2 for C^0, 4 for C^1. Odd degree will be rounded up to the next even degree. Uses Hermite interpolation for the C^1 case.

Parameters:

Srf1: First surface to blend.
Srf2: Second surface to blend.
BlendDegree: egree of the blending function in U. 2 for C^0, 4 for C^1, 6 for C^2.
TanScale: If C^1, sets the tangency scale factor.


Returned Value:

CagdSrfStruct *: Resulting blended surface.


See Also:



Keywords:




CagdBlossomDegreeRaiseMat

(blossom.c:935)

Prototype:

  CagdBlsmAlphaCoeffStruct *CagdBlossomDegreeRaiseMat(const CagdRType *KV,
                                                      int Order,
                                                      int Len)


Description:

Computes a new degree raising matrix to degree raise once the following function space, defined using the Order, and knot vector KV of length Len + Order (Len is the length of the control poly/mesh using KV).

Parameters:

KV: Of space to degree raise.
Order: Of space to degree raise.
Len: Of control poly/mesh.


Returned Value:

CagdBlsmAlphaCoeffStruct *: Degree raising matrix.


See Also:

CagdCrvBlossomDegreeRaise CagdSrfBlossomDegreeRaise CagdCrvDegreeRaise CagdBlossomDegreeRaiseNMat CagdDegreeRaiseMatProd

Keywords:




CagdBlossomDegreeRaiseNMat

(blossom.c:1031)

Prototype:

  CagdBlsmAlphaCoeffStruct *CagdBlossomDegreeRaiseNMat(const CagdRType *KV,
                                                       int Order,
                                                       int NewOrder,
                                                       int Len)


Description:

Computes a degree raising matrix to degree raise the following function space to order NewOrder. The space is defined using the Order, and knot ector KV of length Len + Order (Len is the length of the control poly/mesh using KV).

Parameters:

KV: Of space to degree raise.
Order: Of space to degree raise.
NewOrder: Destination order to raise to.
Len: Of control poly/mesh.


Returned Value:

CagdBlsmAlphaCoeffStruct *: Degree raising matrix.


See Also:

CagdCrvBlossomDegreeRaise CagdSrfBlossomDegreeRaise CagdCrvDegreeRaise CagdBlossomDegreeRaiseMat CagdDegreeRaiseMatProd

Keywords:




CagdBlossomEval

(blossom.c:437)

Prototype:

  CagdRType CagdBlossomEval(const CagdRType *Pts,
                            int PtsStep,
                            int Order,
                            const CagdRType *Knots,
                            int KnotsLen,
                            const CagdRType *BlsmVals,
                            int BlsmLen)


Description:

Computes the Blossom over the given points, Pts, with knot sequence Knots, and Blossoming factors BlsmVals. Evaluation is conducted via the Cox - De Boor algorithm with a possibly different parameter at each iteration as prescribed via the Blossoming factors. Note that the Bezier case is supported via the case for which the Knots are NULL. This function assumes no Order multiplicity of knots in interior of KV.

Parameters:

Pts: Coefficeints or scalar control points to blossom.
PtsStep: Step size between coefficients, typically one.
Order: Order of the freeform geometry,
Knots: Knots of the freeform geometry. If NULL assumed Bezier.
KnotsLen: Length of Knots knot vectors.
BlsmVals: Blossoming values to consider.
BlsmLen: Length of BlsmVals vector.


Returned Value:

CagdRType: Evaluated Blossom


See Also:

CagdCrvBlossomDegreeRaise CagdBlossomEvalSymb

Keywords:




CagdBlsmAddRowAlphaCoef

(blossom.c:1645)

Prototype:

  void CagdBlsmAddRowAlphaCoef(CagdBlsmAlphaCoeffStruct *A,
                               CagdRType *Coefs,
                               int ARow,
                               int ColIndex,
                               int ColLength)


Description:

Updates one row, ARow, in the blossom alpha matrix. New coefficients are being added to the current values from ColIndex to ColIndex+ColLength-1.

Parameters:

A: The current blossome alpha matrix to update.
Coefs: The coefficients to add to the alpha matrix in row ARow.
ARow: The row in A to update.
ColIndex: Starting index in column Col to update.
ColLength: umber of coefficients to update in column Col.


Returned Value:

void


See Also:

CagdBlsmEvalSymb CagdBlsmAllocAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmSetDomainAlphaCoef

Keywords:




CagdBlsmAllocAlphaCoef

(blossom.c:1430)

Prototype:

  CagdBlsmAlphaCoeffStruct *CagdBlsmAllocAlphaCoef(int Order,
                                                   int Length,
                                                   int NewOrder,
                                                   int NewLength,
                                                   CagdBType Periodic)


Description:

Allocates the CagdBlsmAlphaCoeffStruct data structrure.

Parameters:

Order, Length: Current Order and Length of current function space.
NewOrder, NewLength: New function space, after the blossom.
Periodic: TRUE, if periodic.


Returned Value:

CagdBlsmAlphaCoeffStruct *: Allocated blossom Alpha matrix.


See Also:

CagdCrvBlossomDegreeRaise CagdBlossomEvalSymb CagdBlsmAddRowAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmSetDomainAlphaCoef

Keywords:

alpha matrix blossom


CagdBlsmCopyAlphaCoef

(blossom.c:1515)

Prototype:

  CagdBlsmAlphaCoeffStruct *CagdBlsmCopyAlphaCoef(const CagdBlsmAlphaCoeffStruct
                                                                             *A)


Description:

Copies the CagdBlsmAlphaCoeffStruct data structrure.

Parameters:

A: Blossom alpha matrix to copy.


Returned Value:

CagdBlsmAlphaCoeffStruct *: Copied matrix.


See Also:

CagdCrvBlossomDegreeRaise CagdBlossomEvalSymb CagdBlsmAddRowAlphaCoef CagdBlsmAllocAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmSetDomainAlphaCoef

Keywords:

alpha matrix refinement


CagdBlsmEvalSymb

(blossom.c:83)

Prototype:

  CagdRType *CagdBlsmEvalSymb(int Order,
                              const CagdRType *Knots,
                              int KnotsLen,
                              const CagdRType *BlsmVals,
                              int BlsmLen,
                              int *RetIdxFirst,
                              int *RetLength,
                              CagdRType *RetVec,
                              void *Cache)


Description:

Same as CagdBlossomEval, but computes the result symbolically. That is, get the contribution of each input coefficients to this blossom. This function assumes no Order multiplicity of knots in interior of KV.

Parameters:

Order: Order of the freeform geometry,
Knots: Knots of the freeform geometry. If NULL assumed Bezier.
KnotsLen: Length of Knots knot vectors.
BlsmVals: Blossoming values to consider.
BlsmLen: Length of BlsmVals vector.
RetIdxFirst: ndex of first input coefficient to blend returned vector with.
RetLength: Length of returned blend vector.
RetVec: Vector of blending values of the input coefficients for this blossom evaluation. This vector is maintained by this function and should not be freed by the caller of this function. No need to provide both Cache and RetVec.
Cache: Optional Cache (can be NULL) to use as created by CagdBlsmEvalSymbAllocCache. No need to provide both Cache and RetVec.


Returned Value:

CagdRType *: Same as RetVec.


See Also:

CagdBlsmEvalSymbFreeCache CagdBlsmEvalSymbAllocCache CagdCrvBlossomDegreeRaise CagdBlossomEval CagdBlsmAddRowAlphaCoef CagdBlsmAllocAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmSetDomainAlphaCoef

Keywords:




CagdBlsmEvalSymbAllocCache

(blossom.c:363)

Prototype:

  void *CagdBlsmEvalSymbAllocCache()


Description:

Auxiliary function of CagdBlsmEvalSymb to allocate a cache for the blossom evaluations.

Parameters:

None


Returned Value:

void *: Allocated new cache.


See Also:

CagdBlsmEvalSymb CagdBlsmEvalSymbFreeCache

Keywords:




CagdBlsmEvalSymbFreeCache

(blossom.c:391)

Prototype:

  void CagdBlsmEvalSymbFreeCache(void *Cache)


Description:

Auxiliary function of CagdBlsmEvalSymb to free a cache for the blossom evaluations.

Parameters:

Cache: Blossom cache to free.


Returned Value:

void


See Also:

CagdBlsmEvalSymb CagdBlsmEvalSymbAllocCache

Keywords:




CagdBlsmFreeAlphaCoef

(blossom.c:1603)

Prototype:

  void CagdBlsmFreeAlphaCoef(CagdBlsmAlphaCoeffStruct *A)


Description:

Frees the CagdBlsmAlphaCoeffStruct data structrure.

Parameters:

A: Blossom Alpha matrix to free.


Returned Value:

void


See Also:

CagdCrvBlossomDegreeRaise CagdBlossomEvalSymb CagdBlsmAddRowAlphaCoef CagdBlsmAllocAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmSetDomainAlphaCoef

Keywords:

alpha matrix blossom


CagdBlsmScaleAlphaCoef

(blossom.c:1688)

Prototype:

  void CagdBlsmScaleAlphaCoef(CagdBlsmAlphaCoeffStruct *A, CagdRType Scl)


Description:

Scale all the coefficients in the given blossom alpha matrix by Scl.

Parameters:

A: Blossom alpha matrix to scale all it coefficients.
Scl: Scaling factor.


Returned Value:

void


See Also:

CagdBlsmEvalSymb CagdBlsmAllocAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmSetDomainAlphaCoef CagdBlsmAddRowAlphaCoef

Keywords:




CagdBlsmSetDomainAlphaCoef

(blossom.c:1715)

Prototype:

  void CagdBlsmSetDomainAlphaCoef(CagdBlsmAlphaCoeffStruct *A)


Description:

Update domain bounds ColIndex/ColLength in the blossom alpha matrix A.

Parameters:

A: Blossom alpha matrix to update its ColIndex/ColLength settings, in place.


Returned Value:

void


See Also:

CagdBlsmEvalSymb CagdBlsmAllocAlphaCoef CagdBlsmCopyAlphaCoef CagdBlsmFreeAlphaCoef CagdBlsmScaleAlphaCoef CagdBlsmAddRowAlphaCoef

Keywords:




CagdBndryAsOneCrvFromSrf

(cagd_aux.c:2749)

Prototype:

  CagdCrvStruct *CagdBndryAsOneCrvFromSrf(const CagdSrfStruct *Srf)


Description:

Extracts the four boundaries of a given surface, as a single closed curve.

Parameters:

Srf: To extract the boundary from.


Returned Value:

CagdCrvStruct *: A closed curve, formed from the boundaries of Srf.


See Also:

CagdBndryCrvsFromSrf CagdBndryCrvFromSrf

Keywords:

curve from surface


CagdBndryCrvFromSrf

(cagd_aux.c:2680)

Prototype:

  CagdCrvStruct *CagdBndryCrvFromSrf(const CagdSrfStruct *Srf,
                                     CagdSrfBndryType Bndry)


Description:

Extracts one boundary curve of the given surface.

Parameters:

Srf: To extract the boundary from.
Bndry: The boundary to extract.


Returned Value:

CagdCrvStruct *: The extracted boundary curve.


Keywords:

isoparametric curves curve from surface


CagdBndryCrvsFromSrf

(cagd_aux.c:2719)

Prototype:

  CagdCrvStruct **CagdBndryCrvsFromSrf(const CagdSrfStruct *Srf,
                                       CagdCrvStruct *Crvs[4])


Description:

Extracts the four boundary curves of the given surface.

Parameters:

Srf: To extract the boundary from.
Crvs: A pointer to a vector of four curve pointers, representing the four boundaries of surface Srf in order of UMin, UMax, VMin, VMax.


Returned Value:

CagdCrvStruct **: A pointer to a vector of four curve pointers, representing the four boundaries of surface Srf in order of UMin, UMax, VMin, VMax.


Keywords:

isoparametric curves curve from surface


CagdBoolSumSrf

(cagdbsum.c:56)

Prototype:

  CagdSrfStruct *CagdBoolSumSrf(const CagdCrvStruct *CCrvLeft,
                                const CagdCrvStruct *CCrvRight,
                                const CagdCrvStruct *CCrvTop,
                                const CagdCrvStruct *CCrvBottom)


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.
                          bottom
                     +----->-->-----+
                     |              |
                     ^              ^
                     |              |
                left |              | right
                     |              |
                     ^              ^
                     |              |
                     +----->-->-----+
                           top


Parameters:

CCrvLeft: Left boundary curve of Boolean sum surface to be created.
CCrvRight: Right boundary curve of Boolean sum surface to be created.
CCrvTop: Top boundary curve of Boolean sum surface to be created.
CCrvBottom: ottom boundary curve of Boolean sum surface to be created.


Returned Value:

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


See Also:

MvarTrivarBoolSum CagdBoolSumSrfRtnl

Keywords:

Boolean sum surface constructors


CagdBoolSumSrfRtnl

(cagdbsum.c:511)

Prototype:

  CagdSrfStruct *CagdBoolSumSrfRtnl(const CagdCrvStruct *CrvLeft,
                                    const CagdCrvStruct *CrvRight,
                                    const CagdCrvStruct *CrvTop,
                                    const 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.
                          bottom
                     +----->-->-----+
                     |              |
                     ^              ^
                     |              |
                left |              | right
                     |              |
                     ^              ^
                     |              |
                     +----->-->-----+
                           top

This function is similar to CagdBoolSumSrf but if rational it will not raise the degrees at the cost of changing the internal parametrization

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: ottom boundary curve of Boolean sum surface to be created.


Returned Value:

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


See Also:

MvarTrivarBoolSumRtnl CagdBoolSumSrf

Keywords:

Boolean sum surface constructors


CagdBspCrvPDMFitting

(cbsp_fit.c:1316)

Prototype:

  static CagdCrvStruct *CagdBspCrvPDMFitting(
                                    CagdPType *PtList,
                                    int NumOfPoints,
                                    CagdCrvStruct *InitCrv,
                                    RegTermCalculatorFuncType CalcRegularization,
                                    RegMatrixCalculatorFuncType CalcRegMatrix,
                                    int MaxIterations,
                                    CagdRType ErrorLimit,
                                    CagdRType ErrorChangeLimit,
                                    CagdRType Lambda)


Description:

Calculates b-spline curve that fits (approximates) the given points Using input init curve, PDM fitting method and specified regularization term.

Parameters:

PtList: Points cloud we want to approximate.
NumOfPoints: Number of points in PtList.
InitCrv: Pointer to an initial fitting curve. Its order and length will be taken as order and length of the desired fitting curve.
CalcRegularization: ointer to a function that should be used for calculating regularization term value.
CalcRegMatrix: ointer to a function that should be used for calculating regularization term minimization matrix.
MaxIterations: aximum iterations to perform (stop condition).
ErrorLimit: Minimum error (stop condition).
ErrorChangeLimit: inimum error change (stop condition).
Lambda: Weight of regularization term.


Returned Value:

CagdCrvStruct *: B-spline curve that fits the input points cloud.


See Also:

CagdBspCrvSDMFitting

Keywords:

points cloud approximization


CagdBspCrvSDMFitting

(cbsp_fit.c:1141)

Prototype:

  static CagdCrvStruct *CagdBspCrvSDMFitting(
                                    CagdPType *PtList,
                                    int NumOfPoints,
                                    CagdCrvStruct *InitCrv,
                                    RegTermCalculatorFuncType CalcRegularization,
                                    RegMatrixCalculatorFuncType CalcRegMatrix,
                                    int MaxIterations,
                                    CagdRType ErrorLimit,
                                    CagdRType ErrorChangeLimit,
                                    CagdRType Lambda)


Description:

Calculates b-spline curve that fits (approximates) the given points Using input init curve, SDM fitting method and specified regularization term.

Parameters:

PtList: Points cloud we want to approximate.
NumOfPoints: Number of points in PtList.
InitCrv: Pointer to an initial fitting curve. Its order and length will be taken as order and length of the desired fitting curve.
CalcRegularization: ointer to a function that should be used for calculating regularization term value.
CalcRegMatrix: ointer to a function that should be used for calculating regularization term minimization matrix.
MaxIterations: aximum iterations to perform (stop condition).
ErrorLimit: Minimum error (stop condition).
ErrorChangeLimit: inimum error change (stop condition).
Lambda: Weight of regularization term.


Returned Value:

CagdCrvStruct *: B-spline curve that fits the input points cloud.


See Also:

CagdBspCrvPDMFitting

Keywords:

points cloud approximization


CagdBsplineCrvFitting

(cbsp_fit.c:234)

Prototype:

  CagdCrvStruct *CagdBsplineCrvFitting(CagdPType *PtList,
                                       int NumOfPoints,
                                       int Length,
                                       int Order,
                                       CagdBType IsPeriodic,
                                       CagdBspFittingType AgorithmType,
                                       int MaxIter,
                                       CagdRType ErrorLimit,
                                       CagdRType ErrorChangeLimit,
                                       CagdRType Lambda)


Description:

Calculates b-spline curve that fits (approximates) the given points cloud using SD error function and Energy2 regulation function. There are three stop conditions: 1) 100 iterations 2) Error = 0.1 3) Error change = 0.005 The initial curve is a least square approximating b-spline.

Parameters:

PtList: Points cloud we want to approximate.
NumOfPoints: Number of points in PtList.
Length: The desired length of the output b-spline curve.
Order: The desired order of the output b-spline curve.
IsPeriodic: TRUE for periodic output curve, FALSE for open end.
AgorithmType: itting algorithm type (CAGD_PDM_FITTING, CAGD_SDM_FITTING, etc).
MaxIter: Maximum iterations to perform (stop condition).
ErrorLimit: Minimum error (stop condition).
ErrorChangeLimit: inimum error change (stop condition).
Lambda: Weight of regularization term.


Returned Value:

CagdCrvStruct *: Output b-spline curve.


Keywords:




CagdBsplineCrvFittingWithInitCrv

(cbsp_fit.c:166)

Prototype:

  CagdCrvStruct *CagdBsplineCrvFittingWithInitCrv(CagdPType *PtList,
                                                  int NumOfPoints,
                                                  CagdCrvStruct *InitCrv,
                                                  CagdBspFittingType AgorithmType,
                                                  int MaxIter,
                                                  CagdRType ErrorLimit,
                                                  CagdRType ErrorChangeLimit,
                                                  CagdRType Lambda)


Description:

Calculates b-spline curve that fits (approximates) the given points cloud using SD error function and Energy2 regulation function. There are three stop conditions: 1) Maximum iterations. 2) Error = 0 (i.e. curve passes through all the points) 3) Error change = 0 (the iteration gives no improvement)

Parameters:

PtList: Points cloud we want to approximate.
NumOfPoints: Number of points in PtList.
InitCrv: Initial fitting curve.
AgorithmType: itting algorithm type (CAGD_PDM_FITTING, CAGD_SDM_FITTING, etc).
MaxIter: Maximum iterations to perform (stop condition).
ErrorLimit: Minimum error (stop condition).
ErrorChangeLimit: inimum error change (stop condition).
Lambda: Weight of regularization term.


Returned Value:

CagdCrvStruct *: Output b-spline curve.


Keywords:




CagdCnvrtBsp2BzrCrv

(cbzr_aux.c:945)

Prototype:

  CagdCrvStruct *CagdCnvrtBsp2BzrCrv(const CagdCrvStruct *CCrv)


Description:

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

Parameters:

CCrv: A B-spline curve to convert to a Bezier curve.


Returned Value:

CagdCrvStruct *: A list of Bezier curves representing the B-spline curve Crv.


See Also:

CagdCnvrtBzr2BspCrv CagdCnvrtBzr2PwrCrv CagdCnvrtPwr2BzrCrv

Keywords:

conversion


CagdCnvrtBsp2BzrSrf

(sbzr_aux.c:858)

Prototype:

  CagdSrfStruct *CagdCnvrtBsp2BzrSrf(const CagdSrfStruct *CSrf)


Description:

Convert a B-spline surface into a set of Bezier surfaces by subdividing the B-spline surface at all its internal knots. Returned is a list of Bezier surface.

Parameters:

CSrf: B-spline surface to convert to a Bezier surface.


Returned Value:

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


See Also:

CagdCnvrtBzr2BspSrf

Keywords:

conversion


CagdCnvrtBsp2OpenCrv

(cbsp_aux.c:1629)

Prototype:

  CagdCrvStruct *CagdCnvrtBsp2OpenCrv(const 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


CagdCnvrtBsp2OpenSrf

(sbsp_aux.c:1937)

Prototype:

  CagdSrfStruct *CagdCnvrtBsp2OpenSrf(const 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.


Keywords:

conversion


CagdCnvrtBzr2BspCrv

(cbzr_aux.c:905)

Prototype:

  CagdCrvStruct *CagdCnvrtBzr2BspCrv(const 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:

CagdCnvrtBsp2BzrCrv CagdCnvrtBzr2PwrCrv CagdCnvrtPwr2BzrCrv

Keywords:

conversion


CagdCnvrtBzr2BspSrf

(sbzr_aux.c:815)

Prototype:

  CagdSrfStruct *CagdCnvrtBzr2BspSrf(const CagdSrfStruct *Srf)


Description:

Converts a Bezier surface into a B-spline surface by adding open end knot vector with no interior knots.

Parameters:

Srf: Bezier surface to convert to a B-spline surface.


Returned Value:

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


See Also:

CagdCnvrtBsp2BzrSrf

Keywords:

conversion


CagdCnvrtBzr2PwrCrv

(bzr_pwr.c:57)

Prototype:

  CagdCrvStruct *CagdCnvrtBzr2PwrCrv(const 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:

CagdCnvrtBzr2BspCrv CagdCnvrtBsp2BzrCrv CagdCnvrtPwr2BzrCrv

Keywords:

power basis conversion


CagdCnvrtBzr2PwrSrf

(bzr_pwr.c:195)

Prototype:

  CagdSrfStruct *CagdCnvrtBzr2PwrSrf(const CagdSrfStruct *Srf)


Description:


Converts the given surface from Bezier basis functions to a Power basis functions. Using:
        n
        __
 n      \      p-i n   p   p
B (t) = /  (-1)   ( ) ( ) t
 i      --         p   i
        p=i


or
               n   m
               __  __
 n     m       \   \     p-i n   p     q-j  m   q   p  q
B (u) B (v) =  /   /  (-1)  ( ) ( ) (-1)   ( ) ( ) u  v
 i     j       --  --        p   i          q   j
              p=i q=j


This routine simply take the weight of each product of two Bezier basis functions Bi(u) Bj(v) and spread it into the different power basis u^j v^k functions scaled by:
     p-i n   p     q-j  m   q
  (-1)  ( ) ( ) (-1)   ( ) ( )
         p   i          q   j


Parameters:

Srf: To convert into Power basis function representation.


Returned Value:

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


Keywords:

power basis conversion


CagdCnvrtCrvToCtlPts

(cbsp_aux.c:1688)

Prototype:

  CagdCtlPtStruct *CagdCnvrtCrvToCtlPts(const CagdCrvStruct *Crv)


Description:


Convert a curve into a list of control points.

Parameters:

Crv: To the curve to convert to list of control points.


Returned Value:

CagdCtlPtStruct *: List of control points of curve Crv.


Keywords:




CagdCnvrtCrvToSrf

(cagdruld.c:161)

Prototype:

  CagdSrfStruct *CagdCnvrtCrvToSrf(const CagdCrvStruct *Crv, CagdSrfDirType Dir)


Description:

Promotes a curve to a surface by creating a constant surface in the new direction. 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 the surface is not regular.

Parameters:

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


Returned Value:

CagdSrfStruct *: The surface promoted from Crv.


Keywords:




CagdCnvrtFloat2OpenCrv

(cbsp_aux.c:1574)

Prototype:

  CagdCrvStruct *CagdCnvrtFloat2OpenCrv(const CagdCrvStruct *Crv)


Description:

Converts a float 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


CagdCnvrtFloat2OpenSrf

(sbsp_aux.c:1902)

Prototype:

  CagdSrfStruct *CagdCnvrtFloat2OpenSrf(const CagdSrfStruct *Srf)


Description:

Converts a float 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:

CagdCnvrtPeriodic2FloatSrf

Keywords:

conversion


CagdCnvrtLinBspCrv2Polyline

(cbsp_aux.c:1469)

Prototype:

  CagdPolylineStruct *CagdCnvrtLinBspCrv2Polyline(const CagdCrvStruct *Crv,
                                                  CagdBType FilterIdentical)


Description:

Returns a new polyline in E3 representing same geometry as the given linear B-spline curve.

Parameters:

Crv: A linear B-spline curve to convert to a polyline.
FilterIdentical: TRUE to filter almost identical adjacent vertices.


Returned Value:

CagdPolylineStruct *: A polyline same as linear curve Crv.


See Also:

UserPolylines2LinBsplineCrvs UserPolyline2LinBsplineCrv CagdCnvrtPolyline2LinBspCrv CagdCnvrtPtList2Polyline

Keywords:

linear curves conversion


CagdCnvrtPeriodic2FloatCrv

(cbsp_aux.c:1521)

Prototype:

  CagdCrvStruct *CagdCnvrtPeriodic2FloatCrv(const 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


CagdCnvrtPeriodic2FloatSrf

(sbsp_aux.c:1827)

Prototype:

  CagdSrfStruct *CagdCnvrtPeriodic2FloatSrf(const 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 Srf 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:

CagdCnvrtFloat2OpenSrf

Keywords:

conversion


CagdCnvrtPolyline2LinBspCrv

(cbsp_aux.c:1444)

Prototype:

  CagdCrvStruct *CagdCnvrtPolyline2LinBspCrv(const CagdPolylineStruct *Poly,
                                             CagdPointType PType)


Description:

Returns a new linear B-spline curve constructed from the given polyline. consecutive Identical points in the polyline are skipped.

Parameters:

Poly: To convert to a linear B-spline curve.
PType: Typically CAGD_PT_E3_TYPE but can be any other type.


Returned Value:

CagdCrvStruct *: A linear B-spline curve representing Poly.


See Also:

UserPolylines2LinBsplineCrvs CagdCnvrtPolyline2LinBspCrv CagdCnvrtLinBspCrv2Polyline CagdCnvrtPtList2Polyline CagdCnvrtIritPolyline2CagdPolyline CagdCnvrtPolyline2LinBspCrv2

Keywords:

linear curves conversion


CagdCnvrtPolyline2LinBspCrv2

(cbsp_aux.c:1364)

Prototype:

  CagdCrvStruct *CagdCnvrtPolyline2LinBspCrv2(const CagdPolylineStruct *Poly,
                                              CagdPointType PType,
                                              CagdBType SkipIdenticalPoints)


Description:

Returns a new linear B-spline curve constructed from the given polyline. consecutive Identical points in the polyline are skipped if specified only.

Parameters:

Poly: To convert to a linear B-spline curve.
PType: Typically CAGD_PT_E3_TYPE but can be any other type.
SkipIdenticalPoints: RUE iff consecutive points are to be skipped.


Returned Value:

CagdCrvStruct *: A linear B-spline curve representing Poly.


See Also:

UserPolylines2LinBsplineCrvs CagdCnvrtPolyline2LinBspCrv CagdCnvrtLinBspCrv2Polyline CagdCnvrtPtList2Polyline CagdCnvrtIritPolyline2CagdPolyline CagdCnvrtPolyline2LinBspCrv

Keywords:

linear curves conversion


CagdCnvrtPolyline2PtList

(cbsp_aux.c:1322)

Prototype:

  CagdPtStruct *CagdCnvrtPolyline2PtList(const CagdPolylineStruct *Poly)


Description:

Converts a polyline into a list of points.

Parameters:

Poly: Input polyline to convert into a point list.


Returned Value:

CagdPtStruct *: Converted point list.


See Also:

CagdCnvrtLinBspCrv2Polyline CagdCnvrtPolyline2LinBspCrv CagdCnvrtPtList2Polyline

Keywords:




CagdCnvrtPtList2Polyline

(cbsp_aux.c:1269)

Prototype:

  CagdPolylineStruct *CagdCnvrtPtList2Polyline(const CagdPtStruct *Pts,
                                               CagdPolylineStruct **Params)


Description:

Converts a list of points into a polyline in E3.

Parameters:

Pts: Input point list to convert into a polyline.
Params: Optional polylines of parameters if found is saved here.


Returned Value:

CagdPolylineStruct *: Converted polyline.


See Also:

CagdCnvrtLinBspCrv2Polyline CagdCnvrtPolyline2LinBspCrv CagdCnvrtPolyline2PtList

Keywords:




CagdCnvrtPwr2BzrCrv

(bzr_pwr.c:124)

Prototype:

  CagdCrvStruct *CagdCnvrtPwr2BzrCrv(const 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:

CagdCnvrtBzr2BspCrv CagdCnvrtBsp2BzrCrv CagdCnvrtBzr2PwrCrv

Keywords:

power basis conversion


CagdCnvrtPwr2BzrSrf

(bzr_pwr.c:276)

Prototype:

  CagdSrfStruct *CagdCnvrtPwr2BzrSrf(const CagdSrfStruct *Srf)


Description:


Converts the given surface from Power basis functions to Bezier basis functions. Using:
              u -->
    +----------------------+
    |P0                Pi-1|
  v |Pi               P2i-1|  Parametric space orientation - control mesh.
  | |                      |
  v |Pn-i              Pn-1|
    +----------------------+


        n   m    i    j
        __  __  ( )  ( )
  p q   \   \    p    q    n     m
 u v =  /   /  ---------- B (u) B (v)
        --  --   n    m    i     j
        i=p j=q ( )  ( )
                 p    q


        i   j    i    j
        __  __  ( )  ( )
        \   \    p    q
 C    = /   /  ---------- A
  ij    --  --   n    m    pq
        p=0 q=0 ( )  ( )
                 p    q


Parameters:

Srf: To convert into Bezier basis function representation.


Returned Value:

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


Keywords:

power basis conversion


CagdCoerceCrvTo

(cagdcoer.c:747)

Prototype:

  CagdCrvStruct *CagdCoerceCrvTo(const CagdCrvStruct *Crv,
                                 CagdPointType PType,
                                 CagdBType AddParametrization)


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, if AddParametrization.

Parameters:

Crv: To be coerced to a new point type PType.
PType: New point type for Crv.
AddParametrization: If TRUE, the input is a scalar curve and the requested output is 2D, add a parametrization to newly added axis.


Returned Value:

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


Keywords:

coercion


CagdCoerceCrvsTo

(cagdcoer.c:713)

Prototype:

  CagdCrvStruct *CagdCoerceCrvsTo(const CagdCrvStruct *Crv,
                                  CagdPointType PType,
                                  CagdBType AddParametrization)


Description:

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

Parameters:

Crv: To be coerced to a new point type PType.
PType: New point type for Crv.
AddParametrization: If TRUE, the input is a scalar curve and the requested output is 2D, add a parametrization to newly added axis.


Returned Value:

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


Keywords:

coercion


CagdCoercePointTo

(cagdcoer.c:251)

Prototype:

  void CagdCoercePointTo(CagdRType *NewPoint,
                         CagdPointType NewPType,
                         CagdRType * const *Points,
                         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 be saved.
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

(cagdcoer.c:535)

Prototype:

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


Description:

Coerces an array of vectors of 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

(cagdcoer.c:854)

Prototype:

  CagdSrfStruct *CagdCoerceSrfTo(const CagdSrfStruct *Srf,
                                 CagdPointType PType,
                                 CagdBType AddParametrization)


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, if AddParametrization.

Parameters:

Srf: To be coerced to a new point type PType.
PType: New point type for Srf.
AddParametrization: If TRUE, the input is a scalar surface and the requested output is 3D, add a parametrization to newly added axis.


Returned Value:

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


Keywords:

coercion


CagdCoerceSrfsTo

(cagdcoer.c:820)

Prototype:

  CagdSrfStruct *CagdCoerceSrfsTo(const CagdSrfStruct *Srf,
                                  CagdPointType PType,
                                  CagdBType AddParametrization)


Description:

Coerces a list of surfaces to a new point type PType. If given surfaces are E1 or P1 and requested new type is E2 or P2 the Y coefficients are updated to hold the parametric domain of surface, if AddParametrization.

Parameters:

Srf: To be coerced to a new point type PType.
PType: New point type for Srf.
AddParametrization: If TRUE, the input is a scalar surface and the requested output is 2D, add a parametrization to newly added axis.


Returned Value:

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


Keywords:

coercion


CagdCoerceToE2

(cagdcoer.c:32)

Prototype:

  void CagdCoerceToE2(CagdRType *E2Point,
                      CagdRType * const 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 be saved.
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

(cagdcoer.c:93)

Prototype:

  void CagdCoerceToE3(CagdRType *E3Point,
                      CagdRType * const 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 be saved.
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


CagdCoerceToP2

(cagdcoer.c:154)

Prototype:

  void CagdCoerceToP2(CagdRType *P2Point,
                      CagdRType * const 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 be saved.
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

(cagdcoer.c:202)

Prototype:

  void CagdCoerceToP3(CagdRType *P3Point,
                      CagdRType * const 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 be saved.
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


CagdConic2Quadric

(cagd_cnc.c:1272)

Prototype:

  CagdBType CagdConic2Quadric(CagdRType *A,
                              CagdRType *B,
                              CagdRType *C,
                              CagdRType *D,
                              CagdRType *E,
                              CagdRType *F,
                              CagdRType *G,
                              CagdRType *H,
                              CagdRType *I,
                              CagdRType *J)


Description:

Construct rational quadric surface above (and below) the given conic in the XY plane of Z height. The conic is given in the A-F coefficients as A x^2 + B xy + C y^2 + D x + E y + F = 0 and the quadric is returned in the A-J coefficients as: A x^2 + B y^2 + C z^2 + D xy + E xz + F yz + G x + H y + I z + J = 0.

Parameters:

A, B, C, D, E, F, G, H, I, J: Input - in A-F the conic and in J the Z height. Output - the new 10 coefficients of the quadric.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdCreateQuadricSrf CagdEllipse3Points CagdEllipse4Points CagdEllipseOffset

Keywords:




CagdConicMatTransform

(cagd_cnc.c:1123)

Prototype:

  CagdBType CagdConicMatTransform(CagdRType *A,
                                  CagdRType *B,
                                  CagdRType *C,
                                  CagdRType *D,
                                  CagdRType *E,
                                  CagdRType *F,
                                  CagdMType Mat)


Description:

Transform given conic form A x^2 + B xy + C y^2 + D x + E y + F = 0, using Mat, in the XY plane. Algorithm:
1. Convert the implicit conic to a matrix form as:
                [ A  B/2  0  D/2] [x]

   [x, y, 0, 1] [B/2  C   0  E/2] [y] = P^T M P = 0

                [ 0   0   1   0 ] [0]

                [D/2 E/2  0   F ] [1]

2. Compute N = Mat^{-1} the inverse of the desired transformation.

3. Compute K = N M N^T and decompose K back to A-F coefficients.


Parameters:

A, B, C, D, E, F: The six coefficients of the conic. Updated in place.
Mat: Transformation matrix in the XY plane.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdQuadricMatTransform CagdSrfTransfrom CagdCrvTransform

Keywords:

implicit


CagdCreateConicCurve

(cagd_cnc.c:57)

Prototype:

  CagdCrvStruct *CagdCreateConicCurve(CagdRType A,
                                      CagdRType B,
                                      CagdRType C,
                                      CagdRType D,
                                      CagdRType E,
                                      CagdRType F,
                                      CagdRType ZLevel,
                                      CagdBType RationalEllipses)


Description:


Construct rational quadratic curve out of the 6 coefficients of the conic section: A x^2 + B xy + C y^2 + D x + E y + F = 0. Based on: Bezier Curves and Surface Patches on Quadrics, by Josef Hoschek, Mathematical methods in Computer aided Geometric Design II, Tom Lyche and Larry L. Schumaker (eds.), pp 331-342, 1992.

Parameters:

A, B, C, D, E, F: The six coefficients of the conic curve.
ZLevel: Sets the Z level of this XY parallel conic curve.
RationalEllipses: TRUE for ration ellipses, FALSE for a polynomial approximation.


Returned Value:

CagdCrvStruct *: A quadratic curve representing the conic.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle CagdCrvCreateArc BzrCrvCreateArc CagdCreateConicCurve2 CagdCreateQuadricSrf

Keywords:




CagdCreateConicCurve2

(cagd_cnc.c:226)

Prototype:

  CagdCrvStruct *CagdCreateConicCurve2(CagdRType A,
                                       CagdRType B,
                                       CagdRType C,
                                       CagdRType D,
                                       CagdRType E,
                                       CagdRType F,
                                       CagdRType ZLevel,
                                       const CagdRType *PStartXY,
                                       const CagdRType *PEndXY,
                                       CagdBType RationalEllipses)


Description:

Construct rational quadratic curve out of the 6 coefficients of the conic section: A x^2 + B xy + C y^2 + D x + E y + F = 0.

Parameters:

A, B, C, D, E, F: The six coefficients of the conic curve.
ZLevel: Sets the Z level of this XY parallel conic curve.
PStartXY, PEndXY: Domain of conic section - starting/end points, in the XY plane. If NULL, the most complete conic possible is created.
RationalEllipses: TRUE for rational ellipses (if full ellipse), FALSE for a polynomial approximation.


Returned Value:

CagdCrvStruct *: A quadratic curve representing the conic.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle CagdCrvCreateArc BzrCrvCreateArc CagdCreateConicCurve CagdCreateQuadricSrf

Keywords:




CagdCreateConicCurveSingular

(cagd_cnc.c:466)

Prototype:

  CagdCrvStruct *CagdCreateConicCurveSingular(CagdRType A,
                                              CagdRType B,
                                              CagdRType C,
                                              CagdRType D,
                                              CagdRType E,
                                              CagdRType F,
                                              CagdRType ZLevel)


Description:

Handles construction of singular conics, when the conic degenerates into line/2lines out of the 6 coefficients: A x^2 + B xy + C y^2 + D x + E y + F = 0. The conic is singular if the following 3x3 determinant vanishes:
           |   A      0.5*B   0.5*D  |
           |  0.5*B     C     0.5*E  |
           |  0.5*D   0.5*E    F     |

See also http://mathworld.wolfram.com/QuadraticCurve.html.

Parameters:

A, B, C, D, E, F: The six coefficients of the singular conic curve.
ZLevel: Sets the Z level of this XY parallel conic curve.


Returned Value:

CagdCrvStruct *: A line/list of lines representing the singular conic.


See Also:

CagdCreateConicCurve

Keywords:




CagdCreateQuadricSrf

(cagd_cnc.c:1339)

Prototype:

  CagdSrfStruct *CagdCreateQuadricSrf(CagdRType A,
                                      CagdRType B,
                                      CagdRType C,
                                      CagdRType D,
                                      CagdRType E,
                                      CagdRType F,
                                      CagdRType G,
                                      CagdRType H,
                                      CagdRType I,
                                      CagdRType J)


Description:

Construct rational quadric surface out of the 9 coefficients of: A x^2 + B y^2 + C z^2 + D xy + E xz + F yz + G x + H y + I z + J = 0. Based on: Bezier Curves and Surface Patches on Quadrics, by Josef Hoschek, Mathematical methods in Computer aided Geometric Design II, Tom Lyche and Larry L. Schumaker (eds.), pp 331-342, 1992.

Parameters:

A, B, C, D, E, F, G, H, I, J: The ten coefficients of the quadric.


Returned Value:

CagdSrfStruct *: A quadric surface representing the given form.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle CagdCrvCreateArc BzrCrvCreateArc CagdCreateConicCurve CagdCreateConicCurve2 CagdConic2Quadric

Keywords:




CagdCrv2CtrlPoly

(cagdmesh.c:24)

Prototype:

  CagdPolylineStruct *CagdCrv2CtrlPoly(const CagdCrvStruct *Crv)


Description:

Extracts the control polygon of a curve as a polyline in E3.

Parameters:

Crv: To extract a control polygon from.


Returned Value:

CagdPolylineStruct *: The control polygon of Crv.


Keywords:

control polygon


CagdCrv2DNormalField

(cagd_aux.c:878)

Prototype:

  CagdCrvStruct *CagdCrv2DNormalField(const CagdCrvStruct *Crv)


Description:

Given a curve assumed to be planar, computes a normal field for the curve by rotating the tangent field 90 degrees.

Parameters:

Crv: To compute a normal field for. This normal field is well defined at inflection points and is not flipped there.


Returned Value:

CagdCrvStruct *: Resulting normal field.


See Also:

CagdCrvDerive CagdCrvDeriveScalar

Keywords:

derivatives normal field


CagdCrv2Polyline

(bsp2poly.c:1016)

Prototype:

  CagdPolylineStruct *CagdCrv2Polyline(const CagdCrvStruct *Crv,
                                       int SamplesPerCurve,
                                       CagdBType OptiLin)


Description:

Routine to approx. a single curve as a polyline with TolSamples samples/tolerance. Polyline is always E3 CagdPolylineStruct type. NULL is returned in case of an error, otherwise CagdPolylineStruct.

Parameters:

Crv: To approximate as a polyline.
SamplesPerCurve: Number of samples to compute on polyline.
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:

BspCrv2Polyline BzrCrv2Polyline IritCurve2Polylines

Keywords:

piecewise linear approximation polyline


CagdCrvArcLenPoly

(cagdcmrg.c:1530)

Prototype:

  CagdRType CagdCrvArcLenPoly(const CagdCrvStruct *Crv)


Description:

Computes a bound on the arc length of a curve by computing the length of its control polygon.

Parameters:

Crv: To bound its length.


Returned Value:

CagdRType: An upper bound on the curve Crv length as the length of Crv's control polygon.


See Also:

CagdLimitCrvArcLen CagdSrfAvgArgLenMesh CagdCrvAreaPoly

Keywords:

arc length


CagdCrvAreaPoly

(cagdcmrg.c:1613)

Prototype:

  CagdRType CagdCrvAreaPoly(const CagdCrvStruct *Crv)


Description:

Given a curve, returns the signed XY area below (in Y) the control polygon of the curve. For a closed control polygon, it will equal the XY area in the control polygon.

Parameters:

Crv: Curve to compute the XY area below (int Y) the control polygon.


Returned Value:

CagdRType: The signed area.


See Also:

CagdCrvArcLenPoly

Keywords:




CagdCrvAverageValue

(cagdbbox.c:864)

Prototype:

  CagdRType CagdCrvAverageValue(const CagdCrvStruct *Crv, int Axis)


Description:

Computes an average value of all control points of given curve in a given axis. Rational values are taken into account (projected into Euclidean space first).

Parameters:

Crv: To compute an average value of its control mesh, in some Axis.
Axis: 1 for X, 2 for Y etc.


Returned Value:

CagdRType: Average value.


See Also:

CagdCrvMinMax CagdPointsBBox CagdSrfAverageValue

Keywords:

bbox bounding box minimum maximum


CagdCrvBBox

(cagdbbox.c:67)

Prototype:

  CagdBBoxStruct *CagdCrvBBox(const 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:

CagdBBoxStruct *: BBox.


See Also:

CagdCrvListBBox CagdSrfBBox GMBBSetBBoxPrecise CagdIgnoreNonPosWeightBBox CagdPolygonBBox CagdCrvIsConstant

Keywords:

bbox bounding box


CagdCrvBiNormalMalloc

(cagd_aux.c:3192)

Prototype:

  CagdVecStruct *CagdCrvBiNormalMalloc(const 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 vector holding the unit binormal information.


Keywords:

binormal


CagdCrvBiNormalToData

(cagd_aux.c:3156)

Prototype:

  CagdVecStruct *CagdCrvBiNormalToData(const CagdCrvStruct *Crv,
                                       CagdRType t,
                                       CagdBType Normalize,
                                       CagdVecStruct *Vec)


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.
Vec: A pointer to a vector holding the unit binormal information.


Returned Value:

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


Keywords:

binormal


CagdCrvBlossomDegreeRaise

(blossom.c:1195)

Prototype:

  CagdCrvStruct *CagdCrvBlossomDegreeRaise(const CagdCrvStruct *Crv)


Description:

Computes a new curve with its degree raised once, given curve Crv, using blossoming.

Parameters:

Crv: Curve to degree raise.


Returned Value:

CagdCrvStruct *: Degree raised curve, or NULL if error.


See Also:

CagdCrvBlossomDegreeRaiseN BspCrvDegreeRaise BzrCrvDegreeRaise CagdCrvDegreeRaise CagdSrfBlossomDegreeRaise

Keywords:




CagdCrvBlossomDegreeRaiseN

(blossom.c:1084)

Prototype:

  CagdCrvStruct *CagdCrvBlossomDegreeRaiseN(const CagdCrvStruct *Crv,
                                            int NewOrder)


Description:

Computes a new curve with its degree raised to NewOrder, given curve Crv, using blossoming.

Parameters:

Crv: Curve to degree raise.
NewOrder: New desired order of curve Crv.


Returned Value:

CagdCrvStruct *: Degree raised curve, or NULL if error.


See Also:

CagdCrvBlossomDegreeRaise BspCrvDegreeRaise BzrCrvDegreeRaise CagdCrvDegreeRaise CagdSrfBlossomDegreeRaiseN

Keywords:




CagdCrvBlossomEvalMalloc

(blossom.c:631)

Prototype:

  CagdRType *CagdCrvBlossomEvalMalloc(const CagdCrvStruct *Crv,
                                      const CagdRType *BlsmVals,
                                      int BlsmLen)


Description:

Computes the Blossom over the given curve, Crv, and Blossoming factors BlsmVals.

Parameters:

Crv: Curve to blossom.
BlsmVals: Blossoming values to consider.
BlsmLen: Length of BlsmVals vector; assumed less than curve order!


Returned Value:

CagdRType *: Evaluated Blossom.


See Also:

CagdSrfBlossomEval CagdSrfBlossomEvalU CagdSrfBlossomEvalToData

Keywords:




CagdCrvBlossomEvalToData

(blossom.c:578)

Prototype:

  CagdRType *CagdCrvBlossomEvalToData(const CagdCrvStruct *Crv,
                                      const CagdRType *BlsmVals,
                                      int BlsmLen,
                                      CagdRType *BlossomVals,
                                      void *BlsmCache)


Description:

Computes the Blossom over the given curve, Crv, and Blossoming factors BlsmVals.

Parameters:

Crv: Curve to blossom.
BlsmVals: Blossoming values to consider.
BlsmLen: Length of BlsmVals vector; assumed less than curve order!
BlossomVals: Evaluated Blossom will be saved here.
BlsmCache: Optional cache (can be NULL) to use, as allocated by CagdBlsmEvalSymbAllocCache and freed by CagdBlsmEvalSymbFreeCache.


Returned Value:

CagdRType *: Evaluated Blossom.


See Also:

CagdSrfBlossomEval CagdSrfBlossomEvalU

Keywords:




CagdCrvCopy

(cagd1gen.c:735)

Prototype:

  CagdCrvStruct *CagdCrvCopy(const 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

(cagd1gen.c:1158)

Prototype:

  CagdCrvStruct *CagdCrvCopyList(const 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


CagdCrvCreateArc

(cagd_arc.c:137)

Prototype:

  CagdCrvStruct *CagdCrvCreateArc(const CagdPtStruct *Center,
                                  CagdRType Radius,
                                  CagdRType StartAngle,
                                  CagdRType EndAngle)


Description:

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

Parameters:

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


Returned Value:

CagdCrvStruct *: A rational quadratic Bezier (or Bspline) curve representing the arc.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle CagdCreateConicCurve BzrCrvCreateArc BspCrvCreateUnitPCircle CagdCrvCreateArcCCW CagdCrvCreateArcCW

Keywords:

circle arc


CagdCrvCreateArcCCW

(cagd_arc.c:203)

Prototype:

  CagdCrvStruct *CagdCrvCreateArcCCW(const CagdPtStruct *Start,
                                     const CagdPtStruct *Center,
                                     const CagdPtStruct *End)


Description:

Creates a counter clockwise arc at the specified position as a rational quadratic Bspline curve, with up to two Bezier pieces. The arc is defined from Start to End, and is assumed to be less than or eual to 360 degrees (full circle, if Start == End).

Parameters:

Start: Starting position of arc.
Center: Center point of arc.
End: End position of arc.


Returned Value:

CagdCrvStruct *: A rational quadratic Bezier (or Bspline) curve representing the arc, or NULL if error.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle CagdCreateConicCurve BzrCrvCreateArc BspCrvCreateUnitPCircle CagdCrvCreateArc CagdCrvCreateArcCW

Keywords:

circle arc


CagdCrvCreateArcCW

(cagd_arc.c:275)

Prototype:

  CagdCrvStruct *CagdCrvCreateArcCW(const CagdPtStruct *Start,
                                    const CagdPtStruct *Center,
                                    const CagdPtStruct *End)


Description:

Creates a counter clockwise arc at the specified position as a rational quadratic B-spline curve, with up to two Bezier pieces. The arc is defined from Start to End, and is assumed to be less than or equal to 360 degrees (full circle, if Start == End).

Parameters:

Start: Starting position of arc.
Center: Center point of arc.
End: End position of arc.


Returned Value:

CagdCrvStruct *: A rational quadratic Bezier (or B-spline) curve representing the arc, or NULL if error.


See Also:

BspCrvCreateCircle BspCrvCreateUnitCircle BspCrvCreatePCircle CagdCreateConicCurve BzrCrvCreateArc BspCrvCreateUnitPCircle CagdCrvCreateArc CagdCrvCreateArcCCW

Keywords:

circle arc


CagdCrvCrvInter

(cagd_cci.c:397)

Prototype:

  CagdPtStruct *CagdCrvCrvInter(const CagdCrvStruct *Crv1,
                                const 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, u2, 0.0).


See Also:

CagdCrvTanAngularSpan SymbCrvCrvInter UserSrfSrfInter CagdCrvCrvInterArrangment

Keywords:

cci


CagdCrvCrvInterArrangment

(cagd_cci.c:838)

Prototype:

  CagdCrvStruct *CagdCrvCrvInterArrangment(const CagdCrvStruct *ArngCrvs,
                                           CagdBType SplitCrvs,
                                           CagdRType Eps)


Description:

Computes the intersections in the plane between all given curves and optionally split the curves at those parameters. If the curves are not split, a list of intersection parameters is returned in an attribute called "InterPts", holding the parameter in X coordinate of pts.

Parameters:

ArngCrvs: Curves to intersect.
SplitCrvs: TRUE, to also split the curves at detected intersections.
Eps: Tolerance of CCI computations.


Returned Value:

CagdCrvStruct *: (Sub) curves as split due to cci's, or identical curves with "InterPts" attributes.


See Also:

CagdCrvCrvInter SymbCrvCrvInter CagdCrvsLowerEnvelop

Keywords:

cci


CagdCrvCrvMakeJoinMatch

(cagdcmrg.c:661)

Prototype:

  void CagdCrvCrvMakeJoinMatch(CagdCrvStruct **Crv1,
                               CagdCrvStruct **Crv2,
                               IrtRType Tolerance,
                               CagdBType G1Continuity,
                               CagdBType ClosedLoop)


Description:

If Crv1 and Crv2 share an endpoint (up to Tolerance), then the shared endpoint of each curve is updated to the average of both points, so the two curves will meet precisecely. Crv1 and Crv2 will be reversed as needed so the last point of Crv1 will be the same as the first point of Crv2. If G1Continuity is TRUE, then the one but last and second endpoints will be also modified to ensure G1 continuity. If ClosedLoop is TRUE and the curves share two endpoints, then they will be matched at both of these endpoints, making them a closed loop.

Parameters:

Crv1: To modify its end to meet Crv2's starting location, in place.
Crv2: To modify its end to meet Crv2's starting location, in place.
Tolerance: o consider two end points the same.
G1Continuity: If TRUE, ensure G1 continuity.
ClosedLoop: If TRUE, try matching the curves at both endpoints.


Returned Value:

void


See Also:

CagdCrvListMakeJoinMatch

Keywords:

match


CagdCrvDegreeRaise

(cagd_aux.c:2202)

Prototype:

  CagdCrvStruct *CagdCrvDegreeRaise(const 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_aux.c:2264)

Prototype:

  CagdCrvStruct *CagdCrvDegreeRaiseN(const 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


CagdCrvDegreeReduce

(cagd_aux.c:2232)

Prototype:

  CagdCrvStruct *CagdCrvDegreeReduce(const 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


CagdCrvDeletePoint

(cagdedit.c:150)

Prototype:

  CagdCrvStruct *CagdCrvDeletePoint(const CagdCrvStruct *Crv, int Index)


Description:

Delete a point at Index from curve Crv. Returned curve's length is smaller by one than the length of Crv. Knot vector is updated (if Bspline curve) to a uniform open. Order of curve is reduced if greater than new number of control points.

Parameters:

Crv: Input curve to delete a point from.
Index: Index of control point to delete from Crv.


Returned Value:

CagdCrvStruct *: A new curve of length smaller by one than Crv.


See Also:

CagdCrvInsertPoint

Keywords:




CagdCrvDerive

(cagd_aux.c:708)

Prototype:

  CagdCrvStruct *CagdCrvDerive(const 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 SymbCrvDeriveRational CagdCrvDeriveScalar CagdCrvScalarCrvSlopeBounds

Keywords:

derivatives Hodograph


CagdCrvDeriveScalar

(cagd_aux.c:743)

Prototype:

  CagdCrvStruct *CagdCrvDeriveScalar(const CagdCrvStruct *Crv)


Description:

Given a curve, computes the derivative of all is scalar components. For a Euclidean curve this is the same as CagdCrvDerive but for a rational curve the returned curves is not the vector field but simply the derivatives of all the curve's coefficients, including the weights.

Parameters:

Crv: To compute derivatives of all its components.


Returned Value:

CagdCrvStruct *: Resulting derivative.


See Also:

BzrCrvDerive BspCrvDerive SymbCrvDeriveRational CagdCrvDerive BzrCrvDeriveScalar BspCrvDeriveScalar

Keywords:

derivatives Hodograph


CagdCrvDomain

(cagd_aux.c:42)

Prototype:

  void CagdCrvDomain(const 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


CagdCrvEvalMalloc

(cagd_aux.c:176)

Prototype:

  CagdRType *CagdCrvEvalMalloc(const 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). This vector is allocated dynamically.


See Also:

CagdCrvEval2Data

Keywords:

evaluation


CagdCrvEvalToData

(cagd_aux.c:134)

Prototype:

  void CagdCrvEvalToData(const CagdCrvStruct *Crv, CagdRType t, CagdRType *R)


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.
R: 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).


Returned Value:

void


See Also:

BzrCrvEvalAtParamMalloc BspCrvEvalAtParamMalloc BzrCrvEvalVecAtParamMalloc BspCrvEvalVecAtParamMalloc BspCrvEvalCoxDeBoorMalloc CagdCrvEvalToPolylineMalloc

Keywords:

evaluation


CagdCrvEvalToPolyline

(cbspeval.c:176)

Prototype:

  int CagdCrvEvalToPolyline(const CagdCrvStruct *Crv,
                            int FineNess,
                            CagdRType *Points[],
                            BspKnotAlphaCoeffStruct *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 B-spline.

Parameters:

Crv: To approximate as a polyline.
FineNess: Control on number of samples.
Points: Where to put the resulting polyline. Assumed to be valid with respect to the dimension of Crv.
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 equal to FineNess.


See Also:

BzrCrvEvalToPolyline AfdBzrCrvEvalToPolyline CagdCrvEval

Keywords:

conversion refinement evaluation


CagdCrvFirstMoments

(cbsp_int.c:1649)

Prototype:

  void CagdCrvFirstMoments(const 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

(cagd2gen.c:186)

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

(cagd2gen.c:237)

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_aux.c:2800)

Prototype:

  CagdCrvStruct *CagdCrvFromMesh(const 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, this curve is not on surface Srf, in general.


See Also:

CagdCrvFromSrf BzrSrfCrvFromSrf BspSrfCrvFromSrf BzrSrfCrvFromMesh BspSrfCrvFromMesh CagdCrvToMesh

Keywords:

isoparametric curves curve from mesh


CagdCrvFromSrf

(cagd_aux.c:2649)

Prototype:

  CagdCrvStruct *CagdCrvFromSrf(const 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


CagdCrvIncCnstrct

(crv_inc_cnstrct.c:662)

Prototype:

  CagdCrvStruct *CagdCrvIncCnstrct(CagdCrvIncCnstrctType Op,
                                   CagdRType *Params,
                                   CagdCrvIncCnstrctStruct **CrvIncCnstrct)


Description:

An incremental constructor for planar curves, inserting one entity (typically a point) at a time, as governed by Op.

Parameters:

Op: Controls the new incremental operation. If new information is relative to previous location and no previous location was given, zero is assumed. All angles are in degrees. The different operations are CAGD_CRV_INC_CNSTRCT_INIT - Initialized the incremental construction. No parameters are expected. CAGD_CRV_INC_CNSTRCT_XY - Appends a new XY location. Expects (X, Y) as Params. CAGD_CRV_INC_CNSTRCT_X - Appends a new XY location. Expects (X) as Params (Y is same as last point). CAGD_CRV_INC_CNSTRCT_Y - Appends a new XY location. Expects (Y) as Params (X is same as last point). CAGD_CRV_INC_CNSTRCT_DELTA_XY - Appends a new XY location. Expects (DeltaX, DeltaY) as Params, as relative locations to previous location. CAGD_CRV_INC_CNSTRCT_DELTA_X - Appends a new XY location. Expects (DeltaX) as Params, as relative location to previous X location. Y is same as last point. CAGD_CRV_INC_CNSTRCT_DELTA_Y - Appends a new XY location. Expects (DeltaY) as Params, as relative location to previous Y location. X is same as last point. CAGD_CRV_INC_CNSTRCT_DELTA_X_AND_Y - Appends a new XY location. Expects (DeltaX, Y) as Params. A new Y location and a relative X location to previous X. CAGD_CRV_INC_CNSTRCT_DELTA_Y_AND_X - Appends a new XY location. Expects (X, DeltaY) as Params. A new X location and a relative Y location to previous Y. CAGD_CRV_INC_CNSTRCT_DIST_ALPHA - Appends a new XY location. Expects (d, Alpha) as Params. A new XY location relative to last location in polar coordinates as (d cos(Alpha), d sin(Alpha)). CAGD_CRV_INC_CNSTRCT_DIST_DELTA_ALPHA - Appends a new XY location. Expects (d, DeltaAlpha) as Params. A new XY location relative to last location in polar coordinates as (d cos(LastAlpha + DeltaAlpha), d sin(LastAlpha + DeltaAlpha). CAGD_CRV_INC_CNSTRCT_DELTA_X_DELTA_ALPHA - Appends a new XY location. Expects (DeltaX, DeltaAlpha) as Params. Seeks a new XY location in direction LastAlpha + DeltaAlpha until it intersects the line X = LastX + DeltaX. CAGD_CRV_INC_CNSTRCT_DELTA_Y_DELTA_ALPHA - Appends a new XY location. Expects (DeltaY, DeltaAlpha) as Params. Seeks a new XY location in direction LastAlpha + DeltaAlpha until it intersects the line Y = LastY + DeltaY. CAGD_CRV_INC_CNSTRCT_ALPHA_LINE - Appends a new XY location. Expects (Alpha, X2, Y2, Alpha2) as Params. Seeks a new XY location in direction Alpha from current location at the intersection with the line defined by (X, Y) in direction Alpha2. CAGD_CRV_INC_CNSTRCT_ARC - Modifies the last XY location. Expects (R, F) as Params. Replaces the last segment with an arc that ends at the two end points of the segment. Positive R for an arc on the left, Negative on the right. If F is non zero, the other left/right arc is provided (note there are four ways to connect two points with C/CW arcs). CAGD_CRV_INC_CNSTRCT_ADD_INTERMEDIATE - Modifies last XY location. Expects (A, D, W) as Params. Adds interior (control) points to the last segment. A is between zero and one setting the distance along the segment (A = 0 starting point, 1 end point). D is the signed distance (positive for the left size) orthogonal to the line segment. Finally W sets the weight of the new (control) points. This feature enable the creation of arbitrary degree spline curves. if all W are 1.0, a polynomial curve is created. CAGD_CRV_INC_CNSTRCT_ROUND_LAST - Rounds the last entered point. Expects (R) as the parameter, the radius of the round. CAGD_CRV_INC_CNSTRCT_CHAMFER_LAST - Chamfers the last entered point. Expects (C) as the parameter, the size of the chamfer, that linearly connects the two tangency points of a rounding of size C. CAGD_CRV_INC_CNSTRCT_CURVE_PARAMS - Sets default curve parameters. Expects (d, KV) as Params. The parameter d sets the degree of all fore coming constructed non-linear curves (has internal control point) and KV sets the knot sequence to use which is one of uniform open (0), uniform float (1), or uniform periodic (2). CAGD_CRV_INC_CNSTRCT_CLOSE - Terminate the constriction. Expects (P, d) as Params. If P is negative the shape is closed to the initial location. If P is positive an open curve will be created. If P = +/-2 all sharp corners are going to be chamfered as controlled by d. If P = +/-3 all sharp corners will be rounded by radius d.
Params: ee descriptions under Op.
CrvIncCnstrct: A handle that is used locally to hold intermediate data.


Returned Value:

CagdCrvStruct *: NULL, unless Op = CAGD_CRV_INC_CNSTRCT_CLOSE in which case, the created curve is returned.


See Also:

CagdCrvIncCnstrctPrint CagdCrvIncCnstructSize CagdCrvIncCnstrctList

Keywords:




CagdCrvIncCnstrctError

(crv_inc_cnstrct.c:1011)

Prototype:

  const char *CagdCrvIncCnstrctError(CagdCrvIncCnstrctStruct *CrvIncCnstrct)


Description:

In interface function to function CagdCrvIncCnstrct, that returns an error description if was an error. Should be called after CagdCrvIncCnstrct is invoked.

Parameters:

CrvIncCnstrct: An array of incremental curve construction commands.


Returned Value:

const char *: The error string description or NULL if no error.


See Also:

CagdCrvIncCnstrctPrint CagdCrvIncCnstructSize CagdCrvIncCnstrct CagdCrvIncCnstrctList

Keywords:




CagdCrvIncCnstrctList

(crv_inc_cnstrct.c:1040)

Prototype:

  CagdCrvStruct *CagdCrvIncCnstrctList(CagdCrvIncCnstrctInputStruct *CrvIncInput,
                                       char **ErrorStr)


Description:

In interface function to function CagdCrvIncCnstrct, that accepts am array of incremental curve construction commands. The array must start INIT command and must terminate with a CLOSE command.

Parameters:

CrvIncInput: An array of incremental curve construction commands.
ErrorStr: Updated to NULL if no error, or an error description if was an error (allocated dynamically).


Returned Value:

CagdCrvStruct *: The constructed curve.


See Also:

CagdCrvIncCnstrctPrint CagdCrvIncCnstructSize CagdCrvIncCnstrct

Keywords:




CagdCrvIncCnstrctPrint

(crv_inc_cnstrct.c:511)

Prototype:

  void CagdCrvIncCnstrctPrint(CagdCrvIncCnstrctStruct *CrvIncCnstrct)


Description:

Prints the current accumulated data in the incremental build.

Parameters:

CrvIncCnstrct: Accumulated data to print.


Returned Value:

void


See Also:

CagdCrvIncCnstrct CagdCrvIncCnstrctList CagdCrvIncCnstrctSize

Keywords:




CagdCrvIncCnstrctSize

(crv_inc_cnstrct.c:557)

Prototype:

  int CagdCrvIncCnstrctSize(CagdCrvIncCnstrctStruct *CrvIncCnstrct)


Description:

Returns number of points inserted so far.

Parameters:

CrvIncCnstrct: Current state of incrementally build curve.


Returned Value:

int: Number of inserted points so far.


See Also:

CagdCrvIncCnstrct CagdCrvIncCnstrctList CagdCrvIncCnstrctPrint

Keywords:




CagdCrvInsertPoint

(cagdedit.c:94)

Prototype:

  CagdCrvStruct *CagdCrvInsertPoint(const CagdCrvStruct *Crv,
                                    int Index,
                                    const CagdPType Pt)


Description:

Inserts a new point Pt at Index into curve Crv. Returned curve's length is larger by one than the length of Crv. Knot vector is updated (if Bspline curve) to a uniform open.

Parameters:

Crv: Input curve to insert a new point into.
Index: Index of control point to insert into Crv. Zero inserts at first location in Crv.
Pt: New point to insert that will be coerced to Crv point type.


Returned Value:

CagdCrvStruct *: A new curve of length larger by one than Crv.


See Also:

CagdCrvDeletePoint

Keywords:




CagdCrvIntegrate

(cagd_aux.c:845)

Prototype:

  CagdCrvStruct *CagdCrvIntegrate(const 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


CagdCrvIsConstant

(cagdbbox.c:138)

Prototype:

  CagdBType CagdCrvIsConstant(const CagdCrvStruct *Crv, IrtRType Eps)


Description:

Checks if this curve is a constant(s) curve.

Parameters:

Crv: To check if constant or not.
Eps: Tolerance of equality allowed.


Returned Value:

CagdBType: TRUE if indeed a constant(s) valued curve.


See Also:

CagdCrvBBox CagdSrfIsConstant

Keywords:

bbox bounding box


CagdCrvIsCtlPolyMonotone

(cagd_aux.c:958)

Prototype:

  int CagdCrvIsCtlPolyMonotone(const CagdCrvStruct *Crv, int Axis, CagdRType Eps)


Description:

Examines if the given curve's control polygon is monotone in given Axis.

Parameters:

Crv: To examine if monotone in axis Axis.
Axis: 1 for X, 2 for Y, etc.
Eps: For monotonicity epsilon test. Zero for strictly monotone.


Returned Value:

int: 1 if increasingly monotone in axis Axis, -1 if decreasingly monotone and 0 otherwise.


Keywords:




CagdCrvListBBox

(cagdbbox.c:107)

Prototype:

  CagdBBoxStruct *CagdCrvListBBox(const 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:

CagdBBoxStruct *: BBox.


See Also:

CagdCrvBBox CagdSrfBBox GMBBSetBBoxPrecise

Keywords:

bbox bounding box


CagdCrvListMakeJoinMatch

(cagdcmrg.c:818)

Prototype:

  CagdCrvStruct *CagdCrvListMakeJoinMatch(const CagdCrvStruct *CrvList,
                                          IrtRType Tolerance,
                                          CagdBType G1Continuity,
                                          CagdBType ClosedLoop)


Description:

Modifies the given curves so each curve will share a common endpoint with its consecutive curve in the given list, given that these curves already have a pair of endpoints which are close up to Tolerance. If G1Contniuity is TRUE, then the curves are also modified so they share a tangent at their endpoints If ClosedLoop is TRUE, the last curve is also matched with the first one. The result is returned as a newly allocated list of curves.

Parameters:

CrvList: To match their endpoints.
Tolerance: To consider two end points the same.
G1Continuity: If TRUE, ensure G1 continuity.
ClosedLoop: If TRUE, match the last curve with the first one.


Returned Value:

CagdCrvStruct *: The matched curves.


See Also:

CagdCrvCrvMakeJoinMatch

Keywords:

match


CagdCrvListMatTransform

(cagd2gen.c:1626)

Prototype:

  CagdCrvStruct *CagdCrvListMatTransform(const CagdCrvStruct *Crvs,
                                         CagdMType Mat)


Description:

Applies an homogeneous transformation, to the given list of curves Crvs as specified by homogeneous transformation Mat.

Parameters:

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


Returned Value:

CagdCrvStruct *: Returned transformed curves.


See Also:

CagdTransform CagdSrfMatTransform CagdMatTransform CagdCrvRotateToXY CagdCrvMatTransform

Keywords:

scaling rotation translation transformations


CagdCrvMatTransform

(cagd2gen.c:1563)

Prototype:

  CagdCrvStruct *CagdCrvMatTransform(const CagdCrvStruct *Crv,
                                     CagdMType Mat)


Description:

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

Parameters:

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


Returned Value:

CagdCrvStruct *: Returned transformed curve.


See Also:

CagdTransform CagdSrfMatTransform CagdMatTransform CagdCrvRotateToXY CagdCrvListMatTransform

Keywords:

scaling rotation translation transformations


CagdCrvMinMax

(cagdbbox.c:821)

Prototype:

  void CagdCrvMinMax(const 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


See Also:

CagdCrvAverageValue CagdPointsBBox CagdSrfMinMax

Keywords:

bbox bounding box minimum maximum


CagdCrvMoebiusTransform

(cagd_aux.c:920)

Prototype:

  CagdCrvStruct *CagdCrvMoebiusTransform(const CagdCrvStruct *Crv, CagdRType c)


Description:

Given a curve, compute its moebius transformation.

Parameters:

Crv: To compute its moebius transformation.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the curve. If c == 0, the first and last weights are made equal.


Returned Value:

CagdCrvStruct *: Resulting curve after the moebius transformation.


See Also:

BzrCrvMoebiusTransform BspCrvMoebiusTransform

Keywords:

moebius transformation


CagdCrvNew

(cagd1gen.c:47)

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 - B-spline, 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

(bsp_knot.c:1684)

Prototype:

  CagdRType *CagdCrvNodes(const 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


CagdCrvNormalMalloc

(cagd_aux.c:3259)

Prototype:

  CagdVecStruct *CagdCrvNormalMalloc(const 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 vector holding the unit normal information.


Keywords:

normal


CagdCrvNormalToData

(cagd_aux.c:3223)

Prototype:

  CagdVecStruct *CagdCrvNormalToData(const CagdCrvStruct *Crv,
                                     CagdRType t,
                                     CagdBType Normalize,
                                     CagdVecStruct *N)


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.
N: A pointer to a vector holding the unit normal information.


Returned Value:

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


Keywords:

normal


CagdCrvNormalXYToData

(cagd_aux.c:3292)

Prototype:

  CagdVecStruct *CagdCrvNormalXYToData(const CagdCrvStruct *Crv,
                                       CagdRType t,
                                       CagdBType Normalize,
                                       CagdVecStruct *Vec)


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.
Vec: A pointer to a vector holding the unit normal information.


Returned Value:

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


Keywords:

normal


CagdCrvOnOneSideOfLine

(cagd_aux.c:3815)

Prototype:

  CagdBType CagdCrvOnOneSideOfLine(const CagdCrvStruct *Crv,
                                   CagdRType X1,
                                   CagdRType Y1,
                                   CagdRType X2,
                                   CagdRType Y2)


Description:

Examines if the given curve is totally on one side of the line prescribed by points (X1, Y1) and (X2, Y2), in the XY plane.

Parameters:

Crv: Curve to examine if totally on one side of the line, in XY plane.
X1, Y1: First points defining the line in the XY plane.
X2, Y2: First points defining the line in the XY plane.


Returned Value:

CagdBType: TRUE if Crv totlally on one side of the line between (X1, Y1) and (X2, Y2), in the XY plane, or FALSE otherwise.


Keywords:




CagdCrvOrientationFrame

(cagdswep.c:537)

Prototype:

  CagdBType CagdCrvOrientationFrame(const CagdCrvStruct *Crv,
                                    CagdRType CrntT,
                                    CagdVecStruct *Tangent,
                                    CagdVecStruct *Normal,
                                    CagdVecStruct **MallocedNrmls,
                                    int *MallocedNrmlsVecSize,
                                    CagdBType FirstTime)


Description:

Estimates an orientation frame (tangent and normal) for the given curve at the given parameter t.

Parameters:

Crv: Curve to evaluate orientation frame for.
CrntT: Parameter value where to evaluate.
Tangent: Of curve at parameter value t.
Normal: Of curve at parameter value t.
MallocedNrmls: Vectors of malloced samples will be created and saved here if first time and will be used if !FirstTime.
MallocedNrmlsVecSize: Size of malloced vector will be saved here if first time and will be used if !FirstTime.
FirstTime: TRUE if first time to compute a frame for this curve.


Returned Value:

CagdBType: TRUE if computed, FALSE if error/failed.


Keywords:

orientation frame sweep surface constructors


CagdCrvQuadDirectInterp

(cbsp_int.c:2299)

Prototype:

  CagdCrvStruct *CagdCrvQuadDirectInterp(const CagdCrvStruct *Crv,
                                         CagdRType InflectStretch)


Description:

Constructs a quadratic B-spline curve that interpolates the given control points of the input planar (in XY) curve. The quadratic B-spline interpolating curve is constructed directly by adjusting knot spacing. No linear system is solved!

Parameters:

Crv: To interpolate its control points. Assumed to have at least 3 control points, with adjacent control points that are not collinear.
InflectStretch: Factor to affect the stretch in inflection points. 1.0 is a good start.


Returned Value:

CagdCrvStruct *: Interpolating curve, or NULL if error.


See Also:



Keywords:




CagdCrvQuadTileAssumeSrf

(crv2quad.c:401)

Prototype:

  CagdCrvQuadTileStruct *CagdCrvQuadTileAssumeSrf(CagdSrfStruct *Srf)


Description:

Creates a quad tile structure from an existing surface. In this function, the surface pointer is taken into the quad tile structure, and therefore SHOULD NOT BE FREED EXTERNALLY.

Parameters:

Srf: The surface from which to create the quad tile.


Returned Value:

CagdCrvQuadTileStruct *: A quad tile structure containing the surface.


See Also:

CagdCrvQuadTileFromSrf

Keywords:

curve tiling


CagdCrvQuadTileCopy

(crv2quad.c:171)

Prototype:

  CagdCrvQuadTileStruct *CagdCrvQuadTileCopy(const CagdCrvQuadTileStruct *Tile)


Description:

Allocates and copies a quad tile structure.

Parameters:

Tile: To be copied.


Returned Value:

CagdCrvQuadTileStruct *: A duplicate of Tile.


Keywords:

copy


CagdCrvQuadTileCopyList

(crv2quad.c:201)

Prototype:

  CagdCrvQuadTileStruct *CagdCrvQuadTileCopyList(
                                          const CagdCrvQuadTileStruct *Tiles)


Description:

Allocates and copies a list of quad tile structures.

Parameters:

Tiles: To be copied.


Returned Value:

CagdCrvQuadTileStruct *: A duplicated list of quad tiles.


Keywords:

copy


CagdCrvQuadTileFromSrf

(crv2quad.c:462)

Prototype:

  CagdCrvQuadTileStruct *CagdCrvQuadTileFromSrf(const CagdSrfStruct *Srf)


Description:

Creates a quad tile structure from an existing surface. In this function, the surface is copied into the quad tile structure.

Parameters:

Srf: The surface from which to create the quad tile.


Returned Value:

CagdCrvQuadTileStruct *: A quad tile structure containing the surface.


See Also:

CagdCrvQuadTileAssumeSrf

Keywords:

curve tiling


CagdCrvRefineAtParams

(cagd_aux.c:1679)

Prototype:

  CagdCrvStruct *CagdCrvRefineAtParams(const 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 B-spline 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


CagdCrvRefineUniformly

(cagd_aux.c:1718)

Prototype:

  CagdCrvStruct *CagdCrvRefineUniformly(const CagdCrvStruct *Crv, int RefLevel)


Description:

Refine the given curve by adding RefLevel knots in the middle of any interior knot interval.

Parameters:

Crv: To refine.
RefLevel: Refinement level - how many knots to insert in each interval.


Returned Value:

CagdCrvStruct *: Refined curve.


See Also:

CagdCrvRefineAtParams CagdCrvRefineUniformly2

Keywords:




CagdCrvRefineUniformly2

(cagd_aux.c:1781)

Prototype:

  CagdCrvStruct *CagdCrvRefineUniformly2(const CagdCrvStruct *Crv, int n)


Description:

Refine the given curve by adding RefLevel knots in the middle of any interior knot interval.

Parameters:

Crv: To refine.
n: How many knots to insert.


Returned Value:

CagdCrvStruct *: Refined curve.


See Also:

CagdCrvRefineAtParams CagdCrvRefineUniformly

Keywords:




CagdCrvRegionFromCrv

(cagd_aux.c:1528)

Prototype:

  CagdCrvStruct *CagdCrvRegionFromCrv(const 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.


See Also:

CagdCrvRegionFromCrvWrap

Keywords:

regions subdivision


CagdCrvRegionFromCrvWrap

(cagd_aux.c:1624)

Prototype:

  CagdCrvStruct *CagdCrvRegionFromCrvWrap(const CagdCrvStruct *Crv,
                                          CagdRType t1,
                                          CagdRType t2)


Description:

Given a periodic curve, extracts a sub-region within the domain specified by t1 and t2. If t1 is greater than t2, the resulting curve subregion id from t1 to the end of the curve and then from the start of the curve to 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.


See Also:

CagdCrvRegionFromCrv

Keywords:

regions subdivision


CagdCrvReverse

(cagd_aux.c:1851)

Prototype:

  CagdCrvStruct *CagdCrvReverse(const 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 B-spline curve. See also BspKnotReverse.

Parameters:

Crv: To be reversed.


Returned Value:

CagdCrvStruct *: Reversed curve of Crv.


See Also:

CagdCrvReverseUV

Keywords:

reverse


CagdCrvReverseUV

(cagd_aux.c:1926)

Prototype:

  CagdCrvStruct *CagdCrvReverseUV(const CagdCrvStruct *Crv)


Description:

Returns a new curve in which the first two (UV or XY)) coordinates are reversed from the input Crv.

Parameters:

Crv: To be UV reversed.


Returned Value:

CagdCrvStruct *: UV reversed curve of Crv.


See Also:

CagdCrvReverse

Keywords:

reverse


CagdCrvRotateToXY

(cagd2gen.c:2101)

Prototype:

  CagdCrvStruct *CagdCrvRotateToXY(const CagdCrvStruct *Crv)


Description:

Rotates the given (hopefully planar) curve to the XY plane. If the curve is not planar, the rotation is heuristic and is not optimal in any sense.

Parameters:

Crv: To rotate, to the XY plane.


Returned Value:

CagdCrvStruct *: Rotated Crv if reasonably successfull, NULL if failed.


See Also:

CagdCrvTransform CagdCrvMatTransform CagdCrvRotateToXYMat

Keywords:




CagdCrvRotateToXYMat

(cagd2gen.c:2023)

Prototype:

  CagdBType CagdCrvRotateToXYMat(const CagdCrvStruct *Crv, IrtHmgnMatType Mat)


Description:

Computes a rotation matrix to rotate the given (hopefully planar) curve to the XY plane, in place. If the curve is not planar, the rotation is heuristic and is not optimal in any sense.

Parameters:

Crv: To compute a matrix that rotate (and possibly translate) Crv to the XY plane.
Mat: Defining the transformation.


Returned Value:

CagdBType: TRUE if reasonably successfully, FALSE if failed.


See Also:

CagdCrvTransform CagdCrvMatTransform CagdCrvRotateToXY

Keywords:




CagdCrvScalarCrvSlopeBounds

(cagd_aux.c:778)

Prototype:

  void CagdCrvScalarCrvSlopeBounds(const CagdCrvStruct *Crv,
                                   CagdRType *MinSlope,
                                   CagdRType *MaxSlope)


Description:

Compute slopes' bounds to a scalar curve.

Parameters:

Crv: Scalar curve to estimate its extreme slopes.
MinSlope: inimal slope detected.
MaxSlope: aximal slope detected.


Returned Value:

void


See Also:

CagdCrvDerive

Keywords:




CagdCrvScale

(cagd2gen.c:1193)

Prototype:

  void CagdCrvScale(CagdCrvStruct *Crv, const CagdRType *Scale)


Description:

Applies a nonuniform scaling transform, in place, to given curve Crv as specified by Scale.

Parameters:

Crv: To be non-uniformly scaled.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfTransform CagdTransform CagdCrvMatTransform CagdCrvRotateToXY CagdCrvTransform

Keywords:

scaling transformations


CagdCrvScaleCenter

(cagd2gen.c:1230)

Prototype:

  void CagdCrvScaleCenter(CagdCrvStruct *Crv, const CagdRType *Scale)


Description:

Applies a nonuniform scaling transform, in place, to given curve Crv as specified by Scale.

Parameters:

Crv: To be non-uniformly scaled.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfTransform CagdTransform CagdCrvMatTransform CagdCrvRotateToXY CagdCrvTransform

Keywords:

scaling transformations


CagdCrvSetDomain

(cagd_aux.c:79)

Prototype:

  CagdCrvStruct *CagdCrvSetDomain(CagdCrvStruct *Crv,
                                  CagdRType TMin,
                                  CagdRType TMax)


Description:

Affinely reset the parametric domain of a curve, in place.

Parameters:

Crv: To reset its parametric domain.
TMin: Minimal domain's new boundary.
TMax: Maximal domain's new boundary.


Returned Value:

CagdCrvStruct *: Modified curve, in place.


See Also:

BspCrvDomain BspKnotAffineTrans2 CagdSrfSetDomain

Keywords:

domain parametric domain


CagdCrvSubdivAtAllC0Discont

(cagd_aux.c:2027)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtAllC0Discont(const CagdCrvStruct *Crv,
                                             IrtBType EuclideanC0Discont,
                                             IrtRType Tolerance)


Description:

Subdivides the given curve at all C^0 potential discontinuity locations.

Parameters:

Crv: To subdivide at all C^0 discontinuity locations.
EuclideanC0Discont: TRUE to compute the C0 discontinuities and verify them in the Euclidean space. FALSE to only consider C0 discontinuities by knot multiplicity in parametric space.
Tolerance: f parametric C0 discontinuity that is also a Euclidean discontinuity - th eallowed distance.


Returned Value:

CagdCrvStruct *: Curve segments result from the subdivision.


See Also:

CagdCrvSubdivAtParams BspKnotAllC1Discont BspCrvsSubdivAtAllDetectedLocations CagdCrvSubdivAtAllC1Discont

Keywords:




CagdCrvSubdivAtAllC1Discont

(cagd_aux.c:2171)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtAllC1Discont(const CagdCrvStruct *Crv,
                                             IrtBType EuclideanC1Discont,
                                             IrtRType Tolerance)


Description:

Subdivides the given curve at all C^1 potential discontinuity locations.

Parameters:

Crv: To subdivide at all C^1 discontinuity locations.
EuclideanC1Discont: TRUE to compute the C1 discontinuities and verify them in the Euclidean space. FALSE to only consider C1 discontinuities by knot multiplicity in parametric space.
Tolerance: f parametric C1 discontinuity that is also a Euclidean discontinuity - deviation from inner product of unit tangents before and after discontinuity by less than Tolerance (1.0 if tangent identical, 0.0 if orthogonal, -1.0 if opposite). Ignored if < -1.0 or EuclideanC1Discont is FALSE.


Returned Value:

CagdCrvStruct *: Curve segments result from the subdivision.


See Also:

CagdCrvSubdivAtParams BspKnotAllC1Discont BspCrvsSubdivAtAllDetectedLocations CagdCrvSubdivAtAllC0Discont BspCrvAllEuclideanC1Discont

Keywords:




CagdCrvSubdivAtParam

(cagd_aux.c:1233)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtParam(const 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.


See Also:

CagdCrvSubdivAtParams

Keywords:

subdivision


CagdCrvSubdivAtParams

(cagd_aux.c:1440)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtParams(const CagdCrvStruct *CCrv,
                                       const CagdPtStruct *Pts,
                                       CagdRType Eps,
                                       CagdBType PurgeTooSmallSegs,
                                       int *Proximity)


Description:

Given a curve - subdivides it into curves at all the given parameter values Pts. Pts is assumed to hold the parameters in order in the first point coordinate. Returns pointer to first curve in a list of subdivided curves.

Parameters:

CCrv: Curve to split at all parameter values as prescribed by Pts. Bezier curves are promoted to B-spline curves in this function.
Pts: Ordered list of parameter values (first coordinate of point) to split curve Crv at.
Eps: parameter closer than Eps to boundary or other parameters are ignored.
PurgeTooSmallSegs: TRUE to purge too small curve segments in result.
Proximity: A 3 bits marker to return if the first (last) parameter was too close to the boundary and/or two middle parameters were too close and one of them was ignored as follows, 0x01 - first parameter to split at was too close to the boundary. 0x02 - last parameter to split at was too close to the boundary. 0x04 - a middle parameter was too close to another parameter.


Returned Value:

CagdCrvStruct *: List of splitted curves, in order.


See Also:

CagdCrvSubdivAtParam CagdCrvSubdivAtParams2 CagdCrvSubdivAtParams3

Keywords:




CagdCrvSubdivAtParams2

(cagd_aux.c:1300)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtParams2(const CagdCrvStruct *CCrv,
                                        const CagdPtStruct *Pts,
                                        int Idx,
                                        CagdRType Eps,
                                        CagdBType PurgeTooSmallSegs,
                                        int *Proximity)


Description:

Given a curve - subdivides it into curves at all the given parameter values Pts. Pts can hold the parameters in any order in the Idx point coordinate. Returns pointer to first curve in a list of subdivided curves.

Parameters:

CCrv: Curve to split at all parameter values as prescribed by Pts. Bezier curves are promoted to B-spline curves in this function.
Pts: Unordered list of parameter values (first coordinate of point) to split curve Crv at.
Idx: Index of parameter in Pts points: 0 for X, 1 for Y, etc.
Eps: parameter closer than Eps and/or closer to boundary than Eps are ignored.
PurgeTooSmallSegs: TRUE to purge too small curve segments in result.
Proximity: A 3 bits marker to return if the first (last) parameter was too close to the boundary and/or two middle parameters were too close and one of them was ignored as follows 0x01 - first parameter to split at was too close to the boundary. 0x02 - last parameter to split at was too close to the boundary. 0x04 - a middle parameter was too close to another parameter.


Returned Value:

CagdCrvStruct *: List of splitted curves, in order.


See Also:

CagdCrvSubdivAtParam CagdCrvSubdivAtParams CagdCrvSubdivAtParams3

Keywords:




CagdCrvSubdivAtParams3

(cagd_aux.c:1378)

Prototype:

  CagdCrvStruct *CagdCrvSubdivAtParams3(const CagdCrvStruct *CCrv,
                                        CagdRType *Prms,
                                        int PrmsLen,
                                        CagdRType Eps,
                                        CagdBType PurgeTooSmallSegs,
                                        int *Proximity)


Description:

Given a curve - subdivides it into curves at all the given parameter values in Prms. Prms can hold the parameters in any order. Returns pointer to first curve in a list of subdivided curves.

Parameters:

CCrv: Curve to split at all parameter values as prescribed by Pts. Bezier curves are promoted to B-spline curves in this function.
Prms: Unordered list of parameter values (first coordinate of point) to split curve Crv at. Sorted in place.
PrmsLen: ength pf Prms vector.
Eps: parameter closer than Eps and/or closer to boundary than Eps are ignored.
PurgeTooSmallSegs: TRUE to purge too small curve segments in result.
Proximity: A 3 bits marker to return if the first (last) parameter was too close to the boundary and/or two middle parameters were too close and one of them was ignored as follows 0x01 - first parameter to split at was too close to the boundary. 0x02 - last parameter to split at was too close to the boundary. 0x04 - a middle parameter was too close to another parameter.


Returned Value:

CagdCrvStruct *: List of splitted curves, in order.


See Also:

CagdCrvSubdivAtParam CagdCrvSubdivAtParams CagdCrvSubdivAtParams2

Keywords:




CagdCrvTanAngularSpan

(cagd_cci.c:67)

Prototype:

  CagdBType CagdCrvTanAngularSpan(const CagdCrvStruct *Crv,
                                  CagdVType ConeDir,
                                  CagdRType *AngularSpan)


Description:

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

Parameters:

Crv: Curve to consider
ConeDir: 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:




CagdCrvTangentToData

(cagd_aux.c:3118)

Prototype:

  CagdVecStruct *CagdCrvTangentToData(const CagdCrvStruct *Crv,
                                      CagdRType t,
                                      CagdBType Normalize,
                                      CagdVecStruct *Tan)


Description:

Given a curve Crv and a parameter value t, returns the (unit) tangent direction of Crv at t. The unnormalized normal does not equal dC/dt in its magnitude, only in its direction.

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, returned is an unnormalized vector in the right direction of the tangent.
Tan: A pointer to a vector holding the unit tanegnt information.


Returned Value:

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


Keywords:

tangent


CagdCrvToMesh

(cagd_aux.c:2840)

Prototype:

  void CagdCrvToMesh(const 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

(cagd2gen.c:1153)

Prototype:

  void CagdCrvTransform(CagdCrvStruct *Crv,
                        const 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, NULL for non.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfTransform CagdTransform CagdCrvMatTransform CagdCrvRotateToXY CagdCrvScale

Keywords:

scaling translation transformations


CagdCrvTwoCrvsOrient

(crvmatch.c:1204)

Prototype:

  CagdBType CagdCrvTwoCrvsOrient(CagdCrvStruct *Crv1, CagdCrvStruct *Crv2, int n)


Description:

Check if macthed points on the given two curves are closer as is or when one of the curves is reversed.

Parameters:

Crv1, Crv2: The two curvs to consider.
n: Number of samples to take on the curves.


Returned Value:

CagdBType: TRUE if needs to reverse, FALSE if as is is better.


Keywords:




CagdCrvUnitMaxCoef

(cagd2gen.c:1892)

Prototype:

  CagdCrvStruct *CagdCrvUnitMaxCoef(CagdCrvStruct *Crv)


Description:

Normalize in place the given curve so its maximal coefficient is of unit size. Each axis is treated independently, including W.

Parameters:

Crv: urve to normalize in place its coefficients.


Returned Value:

CagdCrvStruct *: Normalized curve, in place


See Also:

CagdSrfUnitMaxCoef

Keywords:




CagdCrvUpdateLength

(cagd1gen.c:2575)

Prototype:

  CagdCrvStruct *CagdCrvUpdateLength(CagdCrvStruct *Crv, int NewLength)


Description:

Resize the length of the curve, in place. The new curve is not the same as the original while a minimal effort is invested to keep it similar.

Parameters:

Crv: Curve to update its length.
NewLength: New length to reallocate for the curve.


Returned Value:

CagdCrvStruct *: Resized curve, in place.


See Also:

CagdSrfUpdateLength

Keywords:




CagdCrvZeroNumericStep

(bzrzrfct.c:820)

Prototype:

  CagdBType CagdCrvZeroNumericStep(const CagdCrvStruct *Crv,
                                   CagdCrvStruct *DCrv,
                                   CagdRType Seed,
                                   CagdBType LeftOut,
                                   CagdBType RightOut,
                                   CagdBType CheckEndPts,
                                   CagdRType *Solution,
                                   CagdRType NumericTol)


Description:

Newton-Raphson method for a Bezier or a B-spline curve.

Parameters:

Crv: A scalar curve to find zero of. Either a Bezier or B-spline.
DCrv: The hodograph of Crv. Optional and can be NULL to be computed on the fly.
Seed: Initial guess to start the NR iterations from.
LeftOut: If TRUE, let the method stray outside the left boundary of the domain of search.
RightOut: If TRUE, let the method stray outside the right boundary of the domain of search.
CheckEndPts: TRUE, check for roots at end-points of domain.
Solution: The solution point to return.
NumericTol: umeric tolerance within which solution is required.


Returned Value:

CagdBType: TRUE if solution was found, otherwise FALSE.


See Also:

MvarCrvZeroSet CagdCrvCrvInter SymbCrvZeroSet SymbCrvCrvInter SymbScalarCrvLowDegZeroSet CagdCrvZeroSet.

Keywords:




CagdCrvZeroSet

(bzrzrfct.c:84)

Prototype:

  CagdPtStruct *CagdCrvZeroSet(const CagdCrvStruct *Crv,
                               int Axis,
                               int NRInit,
                               CagdRType NumericTol,
                               CagdRType SubdivTol)


Description:

Finds the zeros of a given curve along the required axis along with multiplicities of zeros. Employs factoring out of (t) and (1-t) terms after subdivision at roots already discovered.

Parameters:

Crv: A curve to find zeros on prescribed axis.
Axis: The axis for which zeros are to be found - 1 for X etc.
NRInit: Indicates how to initialize Newton-Raphson method. A value of 0 indicates seed value 0.5, values 1 and 2 indicate seeds computed by intersecting the control polygon of Crv with the domain axis, with 1 implying an intersection close to the middle of the domain and 2 implying the first intersection.
NumericTol: he numeric tolerance up to which solution is required.
SubdivTol: The tolerance up to which subdivision is to be done.


Returned Value:

CagdPtStruct *: List of solutions as tuples of the form (root, multiplicity).


See Also:

MvarCrvZeroSet CagdCrvCrvInter SymbCrvZeroSet SymbCrvCrvInter SymbScalarCrvLowDegZeroSet CagdCrvZeroSetC0

Keywords:




CagdCrvZeroSetC0

(bzrzrfct.c:135)

Prototype:

  CagdPtStruct *CagdCrvZeroSetC0(const CagdCrvStruct *Crv,
                                 int Axis,
                                 int NRInit,
                                 CagdRType NumericTol,
                                 CagdRType SubdivTol)


Description:

Finds the zeros of a given curve along the required axis along with multiplicities of zeros. Employs factoring out of (t) and (1-t) terms after subdivision at roots already discovered. Curve is assumed to be C0 continuous.

Parameters:

Crv: A curve to find zeros on prescribed axis.
Axis: The axis for which zeros are to be found - 1 for X etc.
NRInit: Indicates how to initialize Newton-Raphson method. A value of 0 indicates seed value 0.5, values 1 and 2 indicate seeds computed by intersecting the control polygon of Crv with the domain axis, with 1 implying an intersection close to the middle of the domain and 2 implying the first intersection.
NumericTol: he numeric tolerance up to which solution is required.
SubdivTol: The tolerance up to which subdivision is to be done.


Returned Value:

CagdPtStruct *: List of solutions as tuples of the form (root, multiplicity). Note multiplicity will be IRIT_MAX_INT if a whole region was detected as zero.


See Also:

MvarCrvZeroSet CagdCrvCrvInter SymbCrvZeroSet SymbCrvCrvInter SymbScalarCrvLowDegZeroSet CagdCrvZeroSet.

Keywords:




CagdCrvonSrfBndry

(cagd1gen.c:2769)

Prototype:

  CagdSrfBndryType CagdCrvonSrfBndry(const CagdCrvStruct *Crv,
                                     const CagdSrfStruct *Srf)


Description:

Checks if given UV curve is on the boundary of Srf.

Parameters:

Crv: UV Curve to check if on the boundary of Srf.
Srf: Surface to check if Crv is on its boundary.


Returned Value:

CagdSrfBndryType: Boundary that Crv is on or CAGD_NO_BNDRY otherwise.


See Also:

CAGD_PT_ON_BNDRY

Keywords:




CagdCrvsRelation

(cagd1gen.c:1867)

Prototype:

  int CagdCrvsRelation(const CagdCrvStruct *Crv1,
                       const CagdCrvStruct *Crv2,
                       CagdRType ParialOverlapRatio,
                       int *Crv1StartOn2,
                       int *Crv1EndOn2,
                       int *Crv2StartOn1,
                       int *Crv2EndOn1,
                       CagdRType *Crv1StartOn2Prm2,
                       CagdRType *Crv1EndOn2Prm2,
                       CagdRType *Crv2StartOn1Prm1,
                       CagdRType *Crv2EndOn1Prm1,
                       CagdRType *RelOverlap,
                       CagdRType Eps)


Description:

See if the given two curves are related to each other (within Eps). Related means sharing some common region (to within Eps). Tested by examining the distances of the end points of one curve to the other.

Parameters:

Crv1, Crv2: The two curves to consider their relation.
ParialOverlapRatio: Ratio (between zero and one) to consider the result as partial overlap (both directions).
Crv1StartOn2: et to TRUE if start pt of Crv1 is on Crv2 (within Eps).
Crv1EndOn2: Set to TRUE if end pt of Crv1 is on Crv2 (within Eps).
Crv2StartOn1: et to TRUE if start pt of Crv2 is on Crv1 (within Eps).
Crv2EndOn1: Set to TRUE if end pt of Crv2 is on Crv1 (within Eps).
Crv1StartOn2Prm2: Parameter on Crv2 at which Crv1StartOn2 event occurs.
Crv1EndOn2Prm2: Parameter on Crv2 at which Crv1EndOn2 event occurs.
Crv2StartOn1Prm1: Parameter on Crv1 at which Crv2StartOn1 event occurs
Crv2EndOn1Prm1: Parameter on Crv1 at which Crv2EndOn1 event occurs.
RelOverlap: A vector of size 3 to be updated with the: (OverPortionCrv1, OverlapPortionCrv2, CommonArcLen). Only maximal relative overlap is computed.
Eps: Tolerance to consider the two curves as related.


Returned Value:

int: 0 if the curves are not related or, 1 if Crv1 contains Crv2, -1 if Crv1 contains Crv2 (flipped), 2 if Crv2 contains Crv1, -2 if Crv2 contains Crv1 (flipped), 3 if Crv1 and curve Crv2 have the same start/end location, -3 if Crv1 and curve Crv2 have flipped start/end location, 4 if the two curves partially overlap. -4 if the two curves partially overlap (flipped).


See Also:

CagdCrvsSame

Keywords:




CagdCrvsSame

(cagd1gen.c:1711)

Prototype:

  CagdBType CagdCrvsSame(const CagdCrvStruct *Crv1,
                         const CagdCrvStruct *Crv2,
                         CagdRType Eps)


Description:

Compare the two lists of curves for similarity.

Parameters:

Crv1, Crv2: The two curves to compare.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if curves are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdCrvsSame2 CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdCrvsSameFuncSpace

Keywords:




CagdCrvsSame2

(cagd1gen.c:1757)

Prototype:

  CagdBType CagdCrvsSame2(const CagdCrvStruct *Crv1,
                          const CagdCrvStruct *Crv2,
                          CagdRType Eps)


Description:

Compare the two curves for similarity, after bringing them to a common function space, by degree raising and refinement.

Parameters:

Crv1, Crv2: The two curves to compare.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if curves are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D

Keywords:




CagdCrvsSame3

(cagd1gen.c:1796)

Prototype:

  CagdBType CagdCrvsSame3(const CagdCrvStruct *Crv1,
                          const CagdCrvStruct *Crv2,
                          CagdRType Eps,
                          CagdBType *Reversed)


Description:

Compare the two curves for similarity, as is and in reverse.

Parameters:

Crv1, Crv2: The two curves to compare.
Eps: Tolerance of equality.
Reversed: Optional parameter to be set if the curves are reversed. Can be NULL to ignore.


Returned Value:

CagdBType: TRUE if curves are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D

Keywords:




CagdCrvsSameFuncSpace

(cagd1gen.c:1673)

Prototype:

  CagdBType CagdCrvsSameFuncSpace(const CagdCrvStruct *Crv1,
                                  const CagdCrvStruct *Crv2,
                                  CagdRType Eps)


Description:

Compare the two curves for similarity of their function space.

Parameters:

Crv1, Crv2: The two curves to compare.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if curves are in same function space, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdCrvsSame2 CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdCrvsSame

Keywords:




CagdCrvsSameUptoRigidScl2D

(cagd1gen.c:1625)

Prototype:

  CagdBType CagdCrvsSameUptoRigidScl2D(const CagdCrvStruct *Crv1,
                                       const CagdCrvStruct *Crv2,
                                       IrtPtType Trans,
                                       CagdRType *Rot,
                                       CagdRType *Scl,
                                       CagdRType Eps)


Description:

Compare the two planar curves for similarity up to rigid motion and scale in the XY plane.

Parameters:

Crv1, Crv2: The two curves to compare.
Trans: Translation amount to apply to Crv1 to bring to Crv2 (after rotation/scale).
Rot, Scl: Rotation and scale amounts to apply to Crv1 to bring to Crv2 (before translation). Rot is specified in degrees.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if curves are the same, FALSE otehrwise. Trans & Rot are valid only if this function returns TRUE.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdCrvsSame CagdSrfsSameUptoRigidScl2D

Keywords:




CagdCtlMeshAverageValue

(cagdbbox.c:780)

Prototype:

  CagdRType CagdCtlMeshAverageValue(CagdRType * const *Pts,
                                    int Length,
                                    int Axis)


Description:

Computes an average value of all control points of given control mesh in a given axis. Rational values are taken into account (projected into Euclidean space first).

Parameters:

Pts: To compute an average value of its control mesh, in some Axis.
Length: The number of control points in the control mesh.
Axis: 1 for X, 2 for Y etc.


Returned Value:

CagdRType: Average value.


See Also:

CagdCrvMinMax CagdPointsBBox CagdSrfAverageValue CagdSrfAverageValue

Keywords:

bbox bounding box minimum maximum


CagdCtlMeshsSame

(cagdcoer.c:312)

Prototype:

  CagdBType CagdCtlMeshsSame(CagdRType * const Mesh1[],
                             CagdRType * const Mesh2[],
                             int Len,
                             CagdRType Eps)


Description:

Compare the two control meshes for similarity.

Parameters:

Mesh1, Mesh2: Two control meshes to compare.
Len: Length of control meshes.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if control meshes are the same, FALSE otherwise.


See Also:

BspKnotVectorsSame CagdRealVecSame CagdCrvsSame CagdSrfsSame

Keywords:




CagdCtlMeshsSameUptoRigidScl2D

(cagdcoer.c:422)

Prototype:

  CagdBType CagdCtlMeshsSameUptoRigidScl2D(CagdRType * const Mesh1[],
                                           CagdRType * const Mesh2[],
                                           int Len,
                                           IrtPtType Trans,
                                           CagdRType *Rot,
                                           CagdRType *Scl,
                                           CagdRType Eps)


Description:

Compare the two control meshes for similarity up to rigid motion and scale. Comparison is conducted in the XY plane and only X and Y (and W) are considered.

Parameters:

Mesh1, Mesh2: Two control meshes to compare.
Len: Length of control meshes.
Trans: Translation amount to apply second to Mesh1 to bring to Mesh2.
Rot, Scl: Rotation and scale amounts to apply first to Mesh1 to bring to Mesh2. Rot is specified in degrees.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if control meshes are the same, FALSE otherwise.


See Also:

BspKnotVectorsSame CagdCrvsSame CagdSrfsSame

Keywords:




CagdCtlPtArrayFree

(cagd2gen.c:574)

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

(cagd1gen.c:372)

Prototype:

  CagdCtlPtStruct *CagdCtlPtArrayNew(CagdPointType PtType, int Size)


Description:

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

Parameters:

PtType: Point type of control point.
Size: Size of CtlPt array to allocate.


Returned Value:

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


Keywords:

allocation


CagdCtlPtBBox

(cagdbbox.c:469)

Prototype:

  void CagdCtlPtBBox(const CagdCtlPtStruct *CtlPt, CagdBBoxStruct *BBox)


Description:

Computes a bounding box for a control point.

Parameters:

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


Returned Value:

void


See Also:

CagdPolygonListBBox CagdPointsBBox CagdPointsBBox2

Keywords:

bbox bounding box


CagdCtlPtCopy

(cagd1gen.c:987)

Prototype:

  CagdCtlPtStruct *CagdCtlPtCopy(const CagdCtlPtStruct *CtlPt)


Description:

Allocates and copies all slots of a CtlPt structure.

Parameters:

CtlPt: To be copied.


Returned Value:

CagdCtlPtStruct *: A duplicate of CtlPt.


Keywords:

copy


CagdCtlPtCopyList

(cagd1gen.c:1303)

Prototype:

  CagdCtlPtStruct *CagdCtlPtCopyList(const 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

(cagd2gen.c:526)

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

(cagd2gen.c:549)

Prototype:

  void CagdCtlPtFreeList(CagdCtlPtStruct *CtlPtList)


Description:

Deallocates and frees a CtlPt structure list:

Parameters:

CtlPtList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdCtlPtListBBox

(cagdbbox.c:505)

Prototype:

  CagdBType CagdCtlPtListBBox(const CagdCtlPtStruct *CtlPts,
                              CagdBBoxStruct *BBox)


Description:

Computes a bounding box for a list of control points.

Parameters:

CtlPts: To computes its bbox. All ctlpts should be of the same type.
BBox: Where bounding information is to be saved.


Returned Value:

CagdBType: TRUE if successful, FALSE if error.


See Also:

CagdCtlPtBBox CagdPointsBBox CagdPointsBBox2

Keywords:




CagdCtlPtNew

(cagd1gen.c:401)

Prototype:

  CagdCtlPtStruct *CagdCtlPtNew(CagdPointType PtType)


Description:

Allocates and resets all slots of a CtlPt structure.

Parameters:

PtType: Point type of control point.


Returned Value:

CagdCtlPtStruct *: A CtlPt structure.


Keywords:

allocation


CagdCubicCrvFit

(hermite.c:109)

Prototype:

  CagdCrvStruct *CagdCubicCrvFit(const CagdCrvStruct *Crv)


Description:

Construct a cubic Bezier curve that fits the input curve end points and end derivatives.

Parameters:

Crv: To approximate as a cubic.


Returned Value:

CagdCrvStruct *: A cubic Bezier curve, fitting the end position and tangent values.


See Also:

CagdCubicHermiteCrv CagdQuaraticCrvFit SymbApproxCrvAsBzrCubics

Keywords:

Hermite


CagdCubicHermiteCrv

(hermite.c:32)

Prototype:

  CagdCrvStruct *CagdCubicHermiteCrv(const CagdPType Pt1,
                                     const CagdPType Pt2,
                                     const CagdVType Dir1,
                                     const 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.


See Also:

CagdCubicCrvFit CagdCubicHermiteCrv2

Keywords:

Hermite


CagdCubicHermiteCrv2

(hermite.c:73)

Prototype:

  CagdCrvStruct *CagdCubicHermiteCrv2(const CagdRType *Pt1,
                                      const CagdRType *Pt2,
                                      const CagdRType *Dir1,
                                      const CagdRType *Dir2,
                                      int Dim)


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.
Dim: Dimension of points (and hence also curve).


Returned Value:

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


See Also:

CagdCubicCrvFit CagdCubicHermiteCrv

Keywords:

Hermite


CagdCubicHermiteSrf

(hermite.c:218)

Prototype:

  CagdSrfStruct *CagdCubicHermiteSrf(const CagdCrvStruct *CPos1Crv,
                                     const CagdCrvStruct *CPos2Crv,
                                     const CagdCrvStruct *CDir1Crv,
                                     const CagdCrvStruct *CDir2Crv)


Description:

Construct a cubic surface using the Hermite constraints - two positions and two tangents. Other direction's degree depends on input.

Parameters:

CPos1Crv, CPos2Crv: Starting and end curves of surface.
CDir1Crv, CDir2Crv: Starting and end tangent fields surface.


Returned Value:

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


Keywords:

Hermite


CagdCubicSrfFit

(hermite.c:521)

Prototype:

  CagdSrfStruct *CagdCubicSrfFit(const CagdSrfStruct *Srf)


Description:

Construct a bicubic Bezier surface that fits the input surface corner points and corner derivatives.

Parameters:

Srf: To approximate as a bicubic.


Returned Value:

CagdSrfStruct *: A bicubic Bezier surface, fitting the corners positions and corners tangents.


See Also:

CagdCubicHermiteSrf CagdQuaraticSrfFit CagdCubicCrvFit

Keywords:

Hermite


CagdDbg

(cagd_dbg.c:29)

Prototype:

  void CagdDbg(const 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


CagdDbgDsp

(cagd_dbg.c:82)

Prototype:

  void CagdDbgDsp(const void *Obj)


Description:

Views curves and surfaces in a display device. 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 displayed.


Returned Value:

void


Keywords:

debugging


CagdDegreeRaiseMatProd

(blossom.c:862)

Prototype:

  CagdBlsmAlphaCoeffStruct *CagdDegreeRaiseMatProd(CagdBlsmAlphaCoeffStruct *A1,
                                                   CagdBlsmAlphaCoeffStruct *A2)


Description:

Computes the product of two adjacent degree raising matrices. Matrices are adjacent if A1 raises from Order to Order+k and A2 from Order+k to Order+n. Returned matrix is a degree raising matrix from Order to Order+n.

Parameters:

A1, A2: matrices to multiply.


Returned Value:

CagdBlsmAlphaCoeffStruct *: Resulting product matrix.


See Also:

CagdBlossomDegreeRaiseMat CagdCrvDegreeRaise

Keywords:




CagdDescribeError

(cagd_err.c:113)

Prototype:

  const 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:

const char *: A string describing the error type.


Keywords:

error handling


CagdDistCrvLine

(cagd_cci.c:153)

Prototype:

  CagdRType CagdDistCrvLine(const CagdCrvStruct *Crv, CagdLType Line)


Description:

Given a curve and a line in the XY Plane, finds a bound on the minimal signed distance between the two. Returns positive/negative minimal expected distance if curve on either side of the line or zero if might intersect. Computation is performed by measuring the signed distance between the line and all control points of the curve.

Parameters:

Crv: Planar curve to compute its signed distance to the line. Assumed to be a Bezier or a Bspline curve.
Line: Line Equations, in the XY plane.


Returned Value:

CagdRType: Zero if might intersect. Otherwise, a bound on the minimal possible distance, signed.


See Also:

SymbDistCrvLine SymbLclDistCrvLine

Keywords:

curve line distance


CagdDistPtPlane

(mshplanr.c:143)

Prototype:

  CagdRType CagdDistPtPlane(CagdPlaneStruct const *Plane,
                            CagdRType * const *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


CagdDistTwoCtlPt

(cagdcoer.c:981)

Prototype:

  CagdRType CagdDistTwoCtlPt(CagdRType * const *Pt1,
                             int Index1,
                             CagdRType * const *Pt2,
                             int Index2,
                             CagdPointType PType)


Description:

Computes the L2 distance between two arbitrary control points.

Parameters:

Pt1, Index1, Pt2, Index2: Two Control points to compute distance between, and indices into the vectors of Points, Pt1 and Pt2. If, however, Index? < 0, Pt? is a single point.
PType: Type of points Pt?.


Returned Value:

CagdRType: The distance between Pt1 and Pt2


Keywords:




CagdDistTwoCtlPt2

(cagdcoer.c:1018)

Prototype:

  CagdRType CagdDistTwoCtlPt2(CagdRType * const *Points,
                              int Index1,
                              int Index2,
                              CagdPointType PType)


Description:

Computes the L2 distance between two arbitrary control points of some freeform.

Parameters:

Points: The vector of Control points of the freeform.
Index1, Index2: The two indices of the two control points.
PType: Type of points Pt?.


Returned Value:

CagdRType: The distance between Pt1 and Pt2


Keywords:




CagdEditSingleCrvPt

(cagdedit.c:33)

Prototype:

  CagdCrvStruct *CagdEditSingleCrvPt(const 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

(cagdedit.c:213)

Prototype:

  CagdSrfStruct *CagdEditSingleSrfPt(const 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:

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


Keywords:

surface editing


CagdEllipse3Points

(cagd_cnc.c:692)

Prototype:

  CagdBType CagdEllipse3Points(CagdPType Pt1,
                               CagdPType Pt2,
                               CagdPType Pt3,
                               CagdRType *A,
                               CagdRType *B,
                               CagdRType *C,
                               CagdRType *D,
                               CagdRType *E,
                               CagdRType *F)


Description:

Constructs an ellipse in the XY plane through the given 3 points of minimal area. The A,B,C,D,E,F coefficients of the bounding ellipse as in A x^2 + B xy + C y^2 + D x + E y + F = 0. are returned.
  Algorithm:
1. Compute center,  C := (Pt1 + Pt2 + Pt3) / 3

                                   3
2. Computer a 2x2 matrix  N = 1/3 Sum (Pti - C) (Pti - C)^T
                                  i=1

3. M = N^{-1}

4. The ellipse E: (P - C)^T M (P - C) - Z = 0,    Z constant, P = (x, y).

See also: "Exact Primitives for Smallest Enclosing Ellipses", by Bernd Gartner and Sven Schonherr, Proceedings of the 13th annual symposium on Computational geometry, 1997.

Parameters:

Pt1, Pt2, Pt3: The 3 input points. Assumed non-colnear.
A, B, C, D, E, F: oefficients of the computed bounding ellipse.


Returned Value:

CagdBType: TRUE if succesful, FALSE otherwise.


See Also:

CagdEllipseOffset CagdCreateConicCurve CagdCreateConicCurve2 CagdEllipse4Points

Keywords:

ellipse


CagdEllipse4Points

(cagd_cnc.c:859)

Prototype:

  CagdBType CagdEllipse4Points(CagdPType Pt1,
                               CagdPType Pt2,
                               CagdPType Pt3,
                               CagdPType Pt4,
                               CagdRType *A,
                               CagdRType *B,
                               CagdRType *C,
                               CagdRType *D,
                               CagdRType *E,
                               CagdRType *F)


Description:

Constructs an ellipse in the XY plane through the given 4 points of minimal area. The A,B,C,D,E,F coefficients of the bounding ellipse as in A x^2 + B xy + C y^2 + D x + E y + F = 0. are returned.
  Algorithm:

1. Using the four points (x1,y1)..(x4,y4), the following matrices: | x1^2 y1^2 2*x1*y1 2*x1 2*y1 1 | ACBDEF = | x2^2 y2^2 2*x2*y2 2*x2 2*y2 1 | | x3^2 y3^2 2*x3*y3 2*x3 2*y3 1 | | x4^2 y4^2 2*x4*y4 2*x4 2*y4 1 | | 2*x1*y1 2*x1 2*y1 1 | matBDEF = | 2*x2*y2 2*x2 2*y2 1 | | 2*x3*y3 2*x3 2*y3 1 | | 2*x4*y4 2*x4 2*y4 1 | and the following vectors: x = | A C B D E F | Zeros = | 0 0 0 0 | are defined, and the 4 point interpolation constraints can be written as: ACBDEF * x = Zeros 2. Using this, the following can be written: BDEFfromAC = inv(matBDEF)*ACBDEF which, by construction, is a matrix in the form: | AB CB 1 0 0 0 | BDEFfromAC = | AD CD 0 1 0 0 | | AE CE 0 0 1 0 | | AF CF 0 0 0 1 | Where AB, AD, AE, AF, CB, CD, CE, CF are functions of (x1,y1)..(x4,y4). Using the previous equations, it is possible to write: BDEFfromAC * x = Zeros And conclude the following equations: AB * A + CB * C + B = 0 AD * A + CD * C + D = 0 AE * A + CE * C + E = 0 AF * A + CF * C + F = 0 3. The A..F ellipse coefficients can be scaled so that C = 1 - A, allowing the following equations to be written, using the previous step: C(A) = (-1) * A + 1 B(A) = (CB - AB) * A - CB D(A) = (CD - AD) * A - CD E(A) = (CE - AE) * A - CE F(A) = (CF - AF) * A - CF 4. This allows writing the ellipse area function: area(A) = f(A)^3 / g(A)^2 where: f(A) = A*C(A)-B(A)^2 g(A) = -d(A)^2*C(A)+2*d(A)*E(A)*B(A)-E(A)^2*A+F(A)*A*C(A)-F(A)*B(A)^2 as a function of A alone. The extreme (minimum) area values can be found by locating where its derivative with respect to A equals zero, by solving the cubic polynomial: (-3*diff(f(A),A)*g(A) + 2*f(A)*diff(g(A),A)) which coefficients are defined using AB, AD, AE, AF, CB, CD, CE, CF mentioned above. If solutions for A exist, they define the other ellipse coefficients (B, C, D, E, F) as mentioned above. If these coefficients define an ellipse, they are returned to the user. Otherwise, the function returns false. See also: "Exact Primitives for Smallest Enclosing Ellipses", by Bernd Gartner and Sven Schonherr, Proceedings of the 13th annual symposium on Computational geometry, 1997.

Parameters:

Pt1, Pt2, Pt3, Pt4: The 4 input points. Assumed in general position.
A, B, C, D, E, F: oefficients of the computed bounding ellipse.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdEllipseOffset CagdCreateConicCurve CagdCreateConicCurve2

Keywords:

ellipse


CagdEllipseOffset

(cagd_cnc.c:1029)

Prototype:

  CagdBType CagdEllipseOffset(CagdRType *A,
                              CagdRType *B,
                              CagdRType *C,
                              CagdRType *D,
                              CagdRType *E,
                              CagdRType *F,
                              CagdRType Offset)


Description:

Update the implicit form of the given ellipse with some offset Offset.

Parameters:

A, B, C, D, E, F: The six coefficients of the ellipse.
Offset: Offset amount.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdEllipse3Points CagdEllipse4Points CagdEllipse4Points CagdCreateConicCurve CagdCreateConicCurve2

Keywords:

ellipse


CagdEstimateCrvCollinearity

(mshplanr.c:213)

Prototype:

  CagdRType CagdEstimateCrvCollinearity(const CagdCrvStruct *Crv)


Description:

Tests polygonal collinearity 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 collinear. If two end points are same (no line can be fit) IRIT_INFNTY is returned.

Parameters:

Crv: To measure its collinearity.


Returned Value:

CagdRType: Collinearity relative measure.


Keywords:

conversion collinearity


CagdEstimateSrfPlanarity

(mshplanr.c:301)

Prototype:

  CagdRType CagdEstimateSrfPlanarity(const CagdSrfStruct *Srf)


Description:

ests mesh collinearity 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_aux.c:666)

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

(cagdextr.c:32)

Prototype:

  CagdSrfStruct *CagdExtrudeSrf(const CagdCrvStruct *CCrv,
                                const CagdVecStruct *Vec)


Description:

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

Parameters:

CCrv: To extrude in direction specified by Vec.
Vec: Direction as well as magnitude of extrusion.


Returned Value:

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


See Also:

CagdZTwistExtrudeSrf CagdExtrudeSrfList

Keywords:

surface constructors


CagdExtrudeSrfList

(cagdextr.c:125)

Prototype:

  CagdSrfStruct *CagdExtrudeSrfList(const CagdCrvStruct *Crvs,
                                    const CagdVecStruct *Vec)


Description:

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

Parameters:

Crvs: To extrude in direction specified by Vec.
Vec: Direction as well as magnitude of extrusion.


Returned Value:

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


See Also:

CagdZTwistExtrudeSrf.

Keywords:

surface constructors


CagdFatalError

(cagd_ftl.c:56)

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

(mshplanr.c:37)

Prototype:

  CagdRType CagdFitPlaneThruCtlPts(CagdPlaneStruct *Plane,
                                   CagdPointType PType,
                                   CagdRType * const *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.
Index1, Index2, Index3, Index4: Four indices of the points.


Returned Value:

CagdRType: Measure the distance between the data points, Negative value if fitting failed.


Keywords:

plane fit


CagdIChooseK

(cbzreval.c:402)

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


CagdIcKJcMIJcKM

(cbzreval.c:445)

Prototype:

  CagdRType CagdIcKJcMIJcKM(int i, int j, int k, int m)


Description:


Evaluates the following (in floating point arithmetic):
                       k     m     k + m
                      ( ) * ( ) / (     )
                       i     j     i + j


Parameters:

i, j, k, m: Coefficients of i choose k and j choose m.


Returned Value:

CagdRType: Result of the above expression, in floating point, to prevent from overflows.


Keywords:

evaluation combinatorics


CagdIgnoreNonPosWeightBBox

(cagdbbox.c:35)

Prototype:

  CagdBType CagdIgnoreNonPosWeightBBox(CagdBType IgnoreNonPosWeightBBox)


Description:


Computes a bounding box for a freeform curve.

Parameters:

IgnoreNonPosWeightBBox: TRUE to ignore negative and zero weight control points in the bounding box computation.


Returned Value:

CagdBType: old value.


See Also:

CagdCrvBBox CagdSrfBBox GMBBSetBBoxPrecise SymbCrvPosNegWeights

Keywords:

bbox bounding box


CagdInsertInterPoints

(cagd_cci.c:774)

Prototype:

  CagdPtStruct *CagdInsertInterPoints(CagdRType t1,
                                      CagdRType t2,
                                      CagdRType Eps,
                                      CagdPtStruct **InterList)


Description:

Insert t1/t2 values into InterList, provided no equal t1/t2 value exists already in the list. List is in ascending order with respect to t1.

Parameters:

t1, t2: New parameter values to insert to InterList list.
Eps: Accuracy of insertion computation.
InterList: List to update, in place.


Returned Value:

CagdPtStruct *: A reference to the constructed and inserted point.


See Also:

CagdInsertInterPointReset

Keywords:




CagdIsClosedCrv

(cagd1gen.c:1360)

Prototype:

  CagdBType CagdIsClosedCrv(const 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.


See Also:

CagdAreClosedCrvs CagdIsClosedSrf CagdIsZeroLenCrv

Keywords:




CagdIsClosedSrf

(cagd1gen.c:1565)

Prototype:

  CagdBType CagdIsClosedSrf(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Returns TRUE if the surface is closed in the given direction. That is, if the min curve boundary equal the max curve boundary

Parameters:

Srf: To test for a closed boundary.
Dir: Direction to test if surface is closed. Either U or V.


Returned Value:

CagdBType: TRUE if closed, FALSE otherwise.


See Also:

CagdIsClosedCrv

Keywords:




CagdIsCrvInsideCH

(cagdbbox.c:1016)

Prototype:

  int CagdIsCrvInsideCH(const CagdCrvStruct *Crv,
                        const IrtE2PtStruct *CHPts,
                        int NumCHPts)


Description:

Identifying whether the given curve is inside the convex hull. Test is conducted by verifying that all the control points of Crv are inside the convex hull.

Parameters:

Crv: The input curve.
CHPts: Points in convex hull in GMR2Struct form.
NumCHPts: Number of Points in the convex hull.


Returned Value:

int: TRUE if successful, FALSE otherwise.


See Also:

CagdIsCrvInsideCirc GMConvexHull

Keywords:




CagdIsCrvInsideCirc

(cagdbbox.c:972)

Prototype:

  CagdBType CagdIsCrvInsideCirc(const CagdCrvStruct *Crv,
                                const CagdRType Center[2],
                                CagdRType Radius)


Description:

Tests if a Crv is contained in the given prescribed circle. Test is conducted by verifying that all the control points of Crv are inside the circle.

Parameters:

Crv: Curve to test for containment in the circle.
Center: Center of the circle to test against.
Radius: Radius of the circle to test against.


Returned Value:

CagdBType: TRUE if Crv is indeed inside the circle, FALSE otherwise.


See Also:

CagdIsCrvInsideCH MvarIsCrvInsideCirc

Keywords:




CagdIsZeroLenCrv

(cagd1gen.c:1336)

Prototype:

  CagdBType CagdIsZeroLenCrv(const CagdCrvStruct *Crv, CagdRType Eps)


Description:

Checks if the given curve is degenerate and have almost zero length.

Parameters:

Crv: Curve to examine.
Eps: Epsilon to consider the curve degenerate below this length.


Returned Value:

CagdBType: TRUE if zero length, FALSE otherwise.


See Also:

CagdIsClosedCrv CagdIsZeroLenSrfBndry

Keywords:




CagdIsZeroLenSrfBndry

(cagd1gen.c:1515)

Prototype:

  CagdBType CagdIsZeroLenSrfBndry(const CagdSrfStruct *Srf,
                                  CagdSrfBndryType Bndry,
                                  CagdRType Eps)


Description:

Checks if the prescribed boundary of the given surface is degenerate and has an almost zero length.

Parameters:

Srf: Surface to examine its boundary.
Bndry: he boundary, out of the four of Srf, to examine.
Eps: Epsilon to consider the curve degenerate below this length.


Returned Value:

CagdBType: TRUE if zero length, FALSE otherwise.


See Also:

CagdIsClosedCrv CagdIsZeroLenCrv

Keywords:




CagdLimitCrvArcLen

(cagdcmrg.c:1569)

Prototype:

  CagdCrvStruct *CagdLimitCrvArcLen(const CagdCrvStruct *Crv, CagdRType MaxLen)


Description:

Subdivides the given curves to curves, each with size of control polygon less than or equal to MaxLen. Returned is a list of curves.

Parameters:

Crv: To subdivide into curves, each with control polygon length less than MaxLen.
MaxLen: Maximum length of control polygon to allow.


Returned Value:

CagdCrvStruct *: List of subdivided curves from Crv, each with control polygon size of less than MaxLen.


See Also:

CagdCrvArcLenPoly CagdSrfAvgArgLenMesh CagdCrvAreaPoly

Keywords:

arc length


CagdLinCrvLinCrvInter

(cagd_cci.c:228)

Prototype:

  CagdPtStruct *CagdLinCrvLinCrvInter(const CagdCrvStruct *Crv1,
                                      const CagdCrvStruct *Crv2)


Description:

Computes all the intersection points of two piecewise liner curves.

Parameters:

Crv1, Crv2: Two piecewise linear curves to compute their intersection points.


Returned Value:

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


See Also:



Keywords:




CagdLineFitToPts

(cbsp_int.c:1871)

Prototype:

  CagdRType CagdLineFitToPts(CagdPtStruct *PtList,
                             CagdVType LineDir,
                             CagdPType LinePos)


Description:

Given set of points, PtList, fits a line using least squares fit to them.

Parameters:

PtList: List of points to interpolate/least square approximate.
LineDir: A unit vector of the line.
LinePos: A point on the computed line.


Returned Value:

CagdRType: Average distance between a point and the fitted line, or IRIT_INFNTY if failed.


See Also:

MvarLineFitToPts

Keywords:

interpolation least square approximation


CagdListAppend

(cagd2gen.c:992)

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:




CagdListFind

(cagd2gen.c:1023)

Prototype:

  IrtBType CagdListFind(const VoidPtr List, const VoidPtr Item)


Description:

Search for an element in a given list. A pointer comparison is used.

Parameters:

List: The list of elements.
Item: Item to find.


Returned Value:

IrtBType: TRUE if found, FALSE otherwise.


Keywords:




CagdListLast

(cagd2gen.c:915)

Prototype:

  VoidPtr CagdListLast(const 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

(cagd2gen.c:968)

Prototype:

  int CagdListLength(const VoidPtr List)


Description:

Computes the length of a list.

Parameters:

List: List of cagd objects.


Returned Value:

int: Length of list.


Keywords:




CagdListNth

(cagd2gen.c:1055)

Prototype:

  VoidPtr CagdListNth(const VoidPtr List, int n)


Description:

Gets the nth item in the given list, or NULL if error. First item is item n = 0.

Parameters:

List: List to fetch the nth item.
n: The item to fetch from List.


Returned Value:

VoidPtr: Fetched item or NULL of error.


See Also:

CagdListLast CagdListFind

Keywords:




CagdListPrev

(cagd2gen.c:943)

Prototype:

  VoidPtr CagdListPrev(const VoidPtr List, const VoidPtr Item)


Description:

Returns the element previous to given Item in List of cagd library objs.

Parameters:

List: To seek the previous element to Item.
Item: Item to seek its prev.


Returned Value:

VoidPtr: Previous item to Item or NULL if not found (or Item is the first item in List).


Keywords:




CagdListReverse

(cagd2gen.c:880)

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


CagdListSort

(cagd2gen.c:1092)

Prototype:

  VoidPtr CagdListSort(VoidPtr List,
                       CagdBType Ascending,
                       CagdCompFuncType SortCmprFunc)


Description:

Sort a given linked list in place according to some integer attribute value.

Parameters:

List: The linked list of objects with attributes to sort.
Ascending: Ascending (TRUE) or descending (FALSE) order.
SortCmprFunc: Sorting function.


Returned Value:

VoidPtr: Head of the sorted list.


Keywords:




CagdMakeCrvsCompatible

(cagdcmpt.c:40)

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.


See Also:

CagdMakeCrvsCompatible2

Keywords:

compatibility


CagdMakeCrvsCompatible2

(cagdcmpt.c:94)

Prototype:

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


Description:

Given two curves, makes them compatible by: 1. Making them have the same curve type. 2. Raising the degree of the lower one to be the same as the higher. 3. Refining them to a common knot vector (If Bspline and SameOrder). Note 2 is performed if SameOrder TRUE, 3 if SameKV TRUE. Both curves are modified IN PLACE. Note here point type can be different and will stay different.

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.


See Also:

CagdMakeCrvsCompatible

Keywords:

compatibility


CagdMakeSrfsCompatible

(cagdcmpt.c:240)

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 V 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 V knot vector and hence continuity.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdMakeSrfsCompatible2

Keywords:

compatibility


CagdMakeSrfsCompatible2

(cagdcmpt.c:302)

Prototype:

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


Description:

Given two surfaces, makes them compatible by: 1. Making them have the same curve type. 2. Raising the degree of the lower one to be the same as the higher. 3. Refining them to a common knot vector (If Bspline and SameOrder). Note 2 is performed if SameOrder TRUE, 3 if SameKV TRUE. Both surface are modified IN PLACE. Note here point type can be different and will stay different.

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 V 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 V knot vector and hence continuity.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdMakeSrfsCompatible

Keywords:

compatibility


CagdMatTransform

(cagd2gen.c:1768)

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


CagdMatTransform2

(cagd2gen.c:1840)

Prototype:

  void CagdMatTransform2(CagdRType **NewPoints,
                         const CagdRType **OldPoints,
                         int Len,
                         int MaxCoord,
                         CagdBType IsNotRational,
                         CagdMType Mat)


Description:

Applies an homogeneous transformation, in place, to given set of points Points which in array of E3/P3 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:

NewPoints: To be affinely transformed. Array of E3/P3 vectors.
OldPoints: Original set of E3/P3 points to be transformed.
Len: Of vectors of Points.
MaxCoord: Maximal coordinate to transform.
IsNotRational: Do we have weights as vector Points[0]?
Mat: Defining the transformation.


Returned Value:

void


See Also:

CagdTransform CagdMatTransform

Keywords:

scaling rotation translation transformations


CagdMatchBisectorNorm

(crvmatch.c:355)

Prototype:

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


Description:

Computes the bisector norm to the matching.

Parameters:

T1: pointer to unit tangent to the first curve at i-th point.
T2: pointer to unit 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.


See Also:

CagdMatchDistNorm CagdMatchRuledNorm CagdMatchMorphNorm CagdMatchingTwoCurves

Keywords:

correspondence matching


CagdMatchDistNorm

(crvmatch.c:322)

Prototype:

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


Description:

Computes the distance norm to the matching, || P1 - P2 ||.

Parameters:

T1: pointer to unit tangent to the first curve at i-th point.
T2: pointer to unit 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.


See Also:

CagdMatchBisectorNorm CagdMatchRuledNorm CagdMatchMorphNorm CagdMatchingTwoCurves

Keywords:

correspondance matching


CagdMatchMorphNorm

(crvmatch.c:407)

Prototype:

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


Description:

Computes the default morphing norm to the matching, 1.0 - < T1, T2 >.

Parameters:

T1: pointer to unit tangent to the first curve at i-th point.
T2: pointer to unit 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.


See Also:

CagdMatchDistNorm CagdMatchBisectorNorm CagdMatchRuledNorm CagdMatchingTwoCurves

Keywords:

correspondence matching


CagdMatchRuled2Norm

(crvmatch.c:490)

Prototype:

  CagdRType CagdMatchRuled2Norm(const CagdVType T1,
                                const CagdVType T2,
                                const CagdVType P1,
                                const CagdVType P2)


Description:

Computes the default ruled norm to the matching, < T1 x (P2 - P1), T2 x (P2 - P1) > must be non negative and then the norm is 1.0 - MIN( || T1 x (P2 - P1) ||^2, || T2 x (P2 - P1) ||^2 ) / || P2 - P1 ||^2.

Parameters:

T1: pointer to unit tangent to the first curve at i-th point.
T2: pointer to unit 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, the minimum (non negative) the better.


See Also:

CagdMatchDistNorm CagdMatchBisectorNorm CagdMatchMorphNorm CagdMatchingTwoCurves CagdMatchRuledNorm

Keywords:

correspondence matching


CagdMatchRuledNorm

(crvmatch.c:445)

Prototype:

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


Description:

Computes the default ruled norm to the matching, < T1 x (P2 - P1), T2 x (P2 - P1) > must be non negative and then the norm is 1.0 - < T1, T2 >.

Parameters:

T1: pointer to unit tangent to the first curve at i-th point.
T2: pointer to unit 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, the minimum (non negative) the better.


See Also:

CagdMatchDistNorm CagdMatchBisectorNorm CagdMatchMorphNorm CagdMatchingTwoCurves CagdMatchRuledNorm

Keywords:

correspondence matching


CagdMatchingFixCrv

(crvmatch.c:900)

Prototype:

  void CagdMatchingFixCrv(CagdCrvStruct *Crv)


Description:

Fix the input curve to be monotone.

Parameters:

Crv: The input curve to be fixed.


Returned Value:

void


Keywords:

correspondance matching


CagdMatchingFixVector

(crvmatch.c:849)

Prototype:

  void CagdMatchingFixVector(int *OldVec, CagdRType *NewVec, int Len)


Description:

Fix the input integer vector, so that NewVec is increasingly monotone.

Parameters:

OldVec: The input vector.
NewVec: The output (fixed) vector
Len: The length of the vector.


Returned Value:

void


Keywords:

correspondance matching


CagdMatchingPolyTransform

(crvmatch.c:934)

Prototype:

  void CagdMatchingPolyTransform(CagdRType **Poly,
                                 int Len,
                                 CagdRType NewBegin,
                                 CagdRType NewEnd)


Description:

Affine transform a set of points, so its new end locations are NewBegin and NewEnd, respectively.

Parameters:

Poly: A pointer to points to change.
Len: The length of the input poly.
NewBegin: he new begin.
NewEnd: The new end.


Returned Value:

void


Keywords:

correspondance matching


CagdMatchingTwoCurves

(crvmatch.c:1023)

Prototype:

  CagdCrvStruct *CagdMatchingTwoCurves(const CagdCrvStruct *Crv1,
                                       const CagdCrvStruct *Crv2,
                                       int Reduce,
                                       int SampleSet,
                                       int ReparamOrder,
                                       int RotateFlag,
                                       int AllowNegativeNorm,
                                       int ReturnReparamFunc,
                                       CagdBType MinimizeMaxError,
                                       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.
ReturnReparamFunc: If TRUE, return the reparamterization function instead of Crv2 reparametrized.
MinimizeMaxError: TRUE for minimizing maximal error, FALSE to minimize the error's sum over the entire domain.
MatchNormFunc: pointer to the matching norm.


Returned Value:

CagdCrvStruct *: The second curve, Crv2, after reparametrization that matches the first curve. Error of returned result is saved in an "_Error" attr.


See Also:

CagdMatchDistNorm CagdMatchBisectorNorm CagdMatchMorphNorm CagdMatchRuledNorm

Keywords:

correspondence matching


CagdMatchingVectorTransform

(crvmatch.c:966)

Prototype:

  void CagdMatchingVectorTransform(CagdRType *Vec,
                                   CagdRType NewBegin,
                                   CagdRType NewEnd,
                                   int Len)


Description:

Affine transform a set of vectors, so its new end locations are NewBegin and NewEnd, respectively.

Parameters:

Vec: The input and the output vector.
NewBegin: he new begin.
NewEnd: The new end.
Len: The length of the input vector.


Returned Value:

void


Keywords:

correspondance matching


CagdMergeCrvCrv

(cagdcmrg.c:71)

Prototype:

  CagdCrvStruct *CagdMergeCrvCrv(const CagdCrvStruct *CCrv1,
                                 const CagdCrvStruct *CCrv2,
                                 CagdBType InterpolateDiscont,
                                 CagdRType MergeEps)


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. If one of the curves is NULL, a copy of other curve is simply returned.

Parameters:

CCrv1: To connect to Crv1's starting location at its end.
CCrv2: To connect to Crv2's end location at its start.
InterpolateDiscont: If TRUE, linearly interpolate discontinuity.
MergeEps: Epsilon to consider end points the same.


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvList CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergeCrvCtlPt

(cagdcmrg.c:1122)

Prototype:

  CagdCrvStruct *CagdMergeCrvCtlPt(const CagdCrvStruct *Crv,
                                   const CagdCtlPtStruct *CtlPt)


Description:

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

Parameters:

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


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvPt CagdMergePtCrv

Keywords:

merge


CagdMergeCrvList

(cagdcmrg.c:190)

Prototype:

  CagdCrvStruct *CagdMergeCrvList(const CagdCrvStruct *CrvList,
                                  CagdBType InterpDiscont,
                                  CagdRType MergeEps)


Description:

Merges a list of curves by connecting the end of one curve to the beginning of the next. I.e. curves are assumed in order.

Parameters:

CrvList: To connect into one curve.
InterpDiscont: If TRUE, linearly interpolate discontinuity.
MergeEps: Epsilon to consider end points the same.


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvCrv CagdMergeCrvList2 CagdMergeCrvList3 CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergeCrvList1

(cagdcmrg.c:235)

Prototype:

  CagdCrvStruct *CagdMergeCrvList1(CagdCrvStruct *CrvList,
                                   IrtRType Tolerance,
                                   CagdBType InterpDiscont)


Description:

Merges a list of curves by connecting end points that are (almost) the same, in place.

Parameters:

CrvList: To connect into larger curves.
Tolerance: To consider two end points the same.
InterpDiscont: If TRUE, linearly interpolate discontinuity.


Returned Value:

CagdCrvStruct *: The merged curves.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvCrv CagdMergeCrvList CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergeCrvList2

(cagdcmrg.c:335)

Prototype:

  CagdCrvStruct *CagdMergeCrvList2(CagdCrvStruct *CrvList,
                                   IrtRType Tolerance,
                                   CagdBType InterpDiscont)


Description:

Merges a list of curves by connecting end points that are (almost) the same, in place.

Parameters:

CrvList: To connect into larger curves, and free in place.
Tolerance: To consider two end points the same.
InterpDiscont: If TRUE, linearly interpolate discontinuity.


Returned Value:

CagdCrvStruct *: The merged curves.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvCrv CagdMergeCrvList CagdMergeCrvList3 CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergeCrvList3

(cagdcmrg.c:583)

Prototype:

  CagdCrvStruct *CagdMergeCrvList3(CagdCrvStruct *CrvList,
                                   IrtRType Tolerance,
                                   CagdBType InterpDiscont)


Description:

Merges a list of curves by connecting end points that are (almost) the same, in place. Uses the generic merging package in geom_lib.

Parameters:

CrvList: To connect into larger curves. Expected to be open ended.
Tolerance: To consider two end points the same.
InterpDiscont: f TRUE, linearly interpolate discontinuity.


Returned Value:

CagdCrvStruct *: The merged curves, or NULL if error.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvCrv CagdMergeCrvList CagdMergeCrvList2 CagdMergeCrvCtlPt CagdMergeCtlPtCrv GMMergeSameGeometry

Keywords:

merge


CagdMergeCrvPt

(cagdcmrg.c:974)

Prototype:

  CagdCrvStruct *CagdMergeCrvPt(const CagdCrvStruct *Crv, const 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.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergePtCrv CagdMergeCrvCrv CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergeCtlPtCrv

(cagdcmrg.c:1147)

Prototype:

  CagdCrvStruct *CagdMergeCtlPtCrv(const CagdCtlPtStruct *CtlPt,
                                   const CagdCrvStruct *Crv)


Description:

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

Parameters:

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


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergeCrvPt CagdMergeCrvCrv CagdMergeCrvPt CagdMergePtCrv

Keywords:

merge


CagdMergeCtlPtCtlPt

(cagdcmrg.c:1314)

Prototype:

  CagdCrvStruct *CagdMergeCtlPtCtlPt(const CagdCtlPtStruct *Pt1,
                                     const CagdCtlPtStruct *Pt2,
                                     int MinDim)


Description:

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

Parameters:

Pt1, Pt2: Two control points to connect using a linear segment.
MinDim: Minimal ctlpts dimension to build the curve with, 2 for E2 or P2, etc.


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergePtPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvCrv CagdMergePtPt2 CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergePointTypes

(cagdcoer.c:950)

Prototype:

  CagdPointType CagdMergePointTypes(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

(cagdcmrg.c:998)

Prototype:

  CagdCrvStruct *CagdMergePtCrv(const CagdPtStruct *Pt, const 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.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtPt CagdMergeCrvPt CagdMergeCrvCrv CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergePtPt

(cagdcmrg.c:1170)

Prototype:

  CagdCrvStruct *CagdMergePtPt(const CagdPtStruct *Pt1, const 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.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvCrv CagdMergePtPt2 CagdMergePtPtLen CagdMergeUvUv CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergePtPt2

(cagdcmrg.c:1257)

Prototype:

  CagdCrvStruct *CagdMergePtPt2(const CagdPType Pt1, const CagdPType 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.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvCrv CagdMergePtPt CagdMergePtPtLen CagdMergeUvUv CagdMergeCrvCtlPt CagdMergeCtlPtCrv

Keywords:

merge


CagdMergePtPtLen

(cagdcmrg.c:1221)

Prototype:

  CagdCrvStruct *CagdMergePtPtLen(const CagdPtStruct *Pt1,
                                  const CagdPtStruct *Pt2,
                                  int Len)


Description:

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

Parameters:

Pt1, Pt2: Two points to connect using a linear segment.
Len: The dimension of the points.


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvCrv CagdMergePtPt CagdMergePtPt2 CagdMergeUvUv

Keywords:

merge


CagdMergeSrfList

(cagdsmrg.c:407)

Prototype:

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


Description:

Merges a list of surfaces by connecting the end of one surface to the beginning 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 share a common edge.
InterpolateDiscont: If TRUE, linearly interpolate discontinuity.


Returned Value:

CagdSrfStruct *: The merged surface.


Keywords:

merge


CagdMergeSrfList2

(cagdsmrg.c:784)

Prototype:

  CagdSrfStruct *CagdMergeSrfList2(CagdSrfStruct *SrfList,
                                   CagdSrfDirType Dir,
                                   IrtRType Tolerance,
                                   CagdBType InterpDiscont)


Description:

Merges a list of surfaces by connecting boundary edges that are (almost) the same, in place.

Parameters:

SrfList: To connect into larger surfaces.
Dir: Merger along U or V.
Tolerance: To consider two boundary edges the same.
InterpDiscont: If TRUE, linearly interpolate discontinuity.


Returned Value:

CagdSrfStruct *: The merged surfaces.


See Also:

CagdMergeSrfSrf CagdMergeSrfList CagdMergeSrfList3U CagdMergeSrfList3V

Keywords:

merge


CagdMergeSrfList3U

(cagdsmrg.c:1140)

Prototype:

  CagdSrfStruct *CagdMergeSrfList3U(CagdSrfStruct *SrfList,
                                    IrtRType Tolerance,
                                    CagdBType InterpDiscont)


Description:

Merges a list of surfaces by connecting shared boundaries that are (almost) the same, in place. Uses the generic merging package in geom_lib.

Parameters:

SrfList: To connect into larger surfaces. Expected to be open ended.
Tolerance: To consider two shared boundaries the same.
InterpDiscont: f TRUE, linearly interpolate discontinuity.


Returned Value:

CagdSrfStruct *: The merged surfaces, or NULL if error.


See Also:

CagdMergeSrfSrf CagdMergeSrfList CagdMergeSrfList2 GMMergeSameGeometry CagdMergeSrfList3V

Keywords:

merge


CagdMergeSrfList3V

(cagdsmrg.c:1369)

Prototype:

  CagdSrfStruct *CagdMergeSrfList3V(CagdSrfStruct *SrfList,
                                    IrtRType Tolerance,
                                    CagdBType InterpDiscont)


Description:

Merges a list of surfaces by connecting shared boundaries that are (almost) the same, in place. Uses the generic merging package in geom_lib.

Parameters:

SrfList: To connect into larger surfaces. Expected to be open ended.
Tolerance: To consider two shared boundaries the same.
InterpDiscont: f TRUE, linearly interpolate discontinuity.


Returned Value:

CagdSrfStruct *: The merged surfaces, or NULL if error.


See Also:

CagdMergeSrfSrf CagdMergeSrfList CagdMergeSrfList2 GMMergeSameGeometry CagdMergeSrfList3U

Keywords:

merge


CagdMergeSrfSrf

(cagdsmrg.c:110)

Prototype:

  CagdSrfStruct *CagdMergeSrfSrf(const CagdSrfStruct *CSrf1,
                                 const CagdSrfStruct *CSrf2,
                                 CagdSrfDirType Dir,
                                 CagdBType SameEdge,
                                 CagdBType 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:

CSrf1: To connect to Srf2's starting boundary at its end.
CSrf2: To connect to Srf1's end boundary at its start.
Dir: Direction the merge should take place. Either U or V.
SameEdge: If the two surfaces share a common edge - If considered same edge, SameEdge can be - 0. Edge is not similar. 1. Copy row of 1st surface as the shared row/col. 2. Copy row of 2nd surface as the shared row/col. This is also the default behavior for other SameEdge values. 3. Equally blend respective row/col as shared.
InterpolateDiscont: If TRUE, linearly interpolate discontinuity.


Returned Value:

CagdSrfStruct *: The merged surface.


Keywords:

merge


CagdMergeUvUv

(cagdcmrg.c:1283)

Prototype:

  CagdCrvStruct *CagdMergeUvUv(const CagdUVType UV1, const CagdUVType UV2)


Description:

Merges two UV coordinates by connecting UV1, UV2, using a linear segment.

Parameters:

UV1, UV2: Two UV coordinates to connect using a linear segment.


Returned Value:

CagdCrvStruct *: The merged curve.


See Also:

CagdMergeCtlPtCtlPt CagdMergePtCrv CagdMergeCrvPt CagdMergeCrvCrv CagdMergePtPt CagdMergePtPtLen CagdMergePtPt2

Keywords:

merge


CagdOneBoolSumSrf

(cagdbsum.c:581)

Prototype:

  CagdSrfStruct *CagdOneBoolSumSrf(const 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


CagdOrientCrvAsCrv2EndPts

(cagd1gen.c:2093)

Prototype:

  CagdCrvStruct *CagdOrientCrvAsCrv2EndPts(const CagdCrvStruct *OrntCrv,
                                           const CagdCrvStruct *Crv)


Description:

Reorient curve OrntCrv so it two end points match Crv.

Parameters:

OrntCrv: Reorient this curve by flipping, so it matches the two end points of Crv.
Crv: Original curve to possibly reverse OrntCrv to fit its end pts.


Returned Value:

CagdCrvStruct *: New version of OrntCrv or NULL if failed.


See Also:

CagdOrientSrfAsSrf4Corners

Keywords:




CagdOrientSrfAsSrf4Corners

(cagd1gen.c:2169)

Prototype:

  CagdSrfStruct *CagdOrientSrfAsSrf4Corners(const CagdSrfStruct *OrntSrf,
                                            const CagdSrfStruct *Srf)


Description:

Reorient a new surface OrntSrf so it four corners match Srf.

Parameters:

OrntSrf: Reorient this surface by flipping and reverseing, so it matches the four corners of Srf.
Srf: Original surface to reverse/flip OrntSrf to fit its 4 corners.


Returned Value:

CagdSrfStruct *: New version of OrntSrf or NULL if failed.


See Also:

CagdOrientCrvAsCrv2EndPts

Keywords:




CagdPDError

(cbsp_fit.c:441)

Prototype:

  static CagdRType CagdPDError(const CagdPType Point, const CagdPType FootPoint)


Description:

Computes PD (Point Distance) error for a single point, which is: *
                        2
  e      =  ||P(tk)-Xk||
   PD,k


Parameters:

Point: (Xk) Points to calculate the error for.
FootPoint: P(tk)) Footpoint (the closest point to Xk on the curve)


Returned Value:

CagdRType: PD error.


Keywords:




CagdPeriodicCrvNew

(cagd1gen.c:119)

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

(cagd1gen.c:221)

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

(cagd2gen.c:716)

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

(cagd1gen.c:477)

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

(cagd1gen.c:1037)

Prototype:

  CagdPlaneStruct *CagdPlaneCopy(const 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

(cagd2gen.c:99)

Prototype:

  CagdPlaneStruct *CagdPlaneCopyList(const 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


CagdPlaneFitToPts

(cbsp_int.c:1963)

Prototype:

  CagdRType CagdPlaneFitToPts(const CagdPtStruct *PtList,
                              IrtPlnType Pln,
                              IrtVecType MVec,
                              IrtPtType Cntr,
                              IrtRType *CN)


Description:

Given set of points, PtList, fits an (approximated) plane fit to them.

Parameters:

PtList: List of points to fit an approximated plane.
Pln: The fitted plane's coefficients.
MVec: Direction in the plane with the major change.
Cntr: The centroid of the data.
CN: Condition number of the fitting. The smaller this number is the more planar the input is.


Returned Value:

CagdRType: Average distance between a point and the fitted plane, or IRIT_INFNTY if failed.


Keywords:

approximation


CagdPlaneFitToPts2

(cbsp_int.c:2012)

Prototype:

  CagdRType CagdPlaneFitToPts2(CagdRType * const *Points,
                               int NumPts,
                               CagdPointType PType,
                               IrtPlnType Pln,
                               IrtVecType MVec,
                               IrtPtType Cntr,
                               IrtRType *CN)


Description:

Given set of points, PtList, fits an (approximated) plane fit to them.

Parameters:

Points: List of points to fit an approximated plane, in format as in CagdCrvStruct or CagdSrfStruct.
NumPts: Length of the vector of Points.
PType: Type of points in Points.
Pln: The fitted plane's coefficients.
MVec: Direction in the plane with the major change.
Cntr: The centroid of the data.
CN: Condition number of the fitting. The smaller this number is the more planar the input is.


Returned Value:

CagdRType: Average distance between a point and the fitted plane, or IRIT_INFNTY if failed.


Keywords:

approximation


CagdPlaneFitToPts3

(cbsp_int.c:2056)

Prototype:

  CagdRType CagdPlaneFitToPts3(CagdPType * const Points,
                               int NumPts,
                               IrtPlnType Pln,
                               IrtVecType MVec,
                               IrtPtType Cntr,
                               IrtRType *CN)


Description:

Given set of points, PtList, fits an (approximated) plane fit to them.

Parameters:

Points: List of points to fit an approximated plane,
NumPts: Length of the vector of Points.
Pln: The fitted plane's coefficients.
MVec: Direction in the plane with the major change.
Cntr: The centroid of the data.
CN: Condition number of the fitting. The smaller this number is the more planar the input is.


Returned Value:

CagdRType: Average distance between a point and the fitted plane, or IRIT_INFNTY if failed.


Keywords:

approximation


CagdPlaneFree

(cagd2gen.c:668)

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

(cagd2gen.c:691)

Prototype:

  void CagdPlaneFreeList(CagdPlaneStruct *PlaneList)


Description:

Deallocates and frees a plane structure list:

Parameters:

PlaneList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdPlaneNew

(cagd1gen.c:505)

Prototype:

  CagdPlaneStruct *CagdPlaneNew(void)


Description:

Allocates and resets all slots of a Plane structure.

Parameters:

None


Returned Value:

CagdPlaneStruct *: A Plane structure.


Keywords:

allocation


CagdPointsBBox

(cagdbbox.c:627)

Prototype:

  void CagdPointsBBox(CagdRType * const *Points,
                      int Length,
                      int Dim,
                      CagdRType *BBoxMin,
                      CagdRType *BBoxMax)


Description:

Computes a bounding box for a set of control points, in any dimension.

Parameters:

Points: To compute bounding box for.
Length: Length of vectors of Points array.
Dim: Dimensions of points, typically 3 for R^3.
BBoxMin, BBoxMax: Where bounding information is to be saved.


Returned Value:

void


See Also:

CagdPointsBBox2 CagdCtlPtBBox

Keywords:

bbox bounding box


CagdPointsBBox2

(cagdbbox.c:556)

Prototype:

  void CagdPointsBBox2(CagdRType * const *Points,
                       int Min,
                       int Max,
                       int Dim,
                       CagdRType *BBoxMin,
                       CagdRType *BBoxMax)


Description:

Computes a bounding box for a set of E1/E2/E3 control points.

Parameters:

Points: To compute bounding box for.
Min, Max: Range to examine in the points array, from Min to Max, inclusively.
Dim: Dimensions of points, typically 3 for R^3. A negative value means to compute only -Dim dimension.
BBoxMin, BBoxMax: Where bounding information is to be saved.


Returned Value:

void


See Also:

CagdPointsBBox CagdCtlPtBBox

Keywords:

bbox bounding box


CagdPointsHasPoles

(cagd2gen.c:2131)

Prototype:

  int CagdPointsHasPoles(CagdRType * const *Points, int Len, int *Sign)


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.
Sign: If no poles, the sign of the weights. Can be NULL to ignore.


Returned Value:

int: TRUE if has poles, FALSE otherwise.


See Also:

CagdAllWeightsNegative CagdAllWeightsSame

Keywords:




CagdPolyApproxErrEstimate

(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

(poly_err.c:116)

Prototype:

  CagdRType *CagdPolyApproxErrs(const CagdSrfStruct *Srf,
                                const 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

(poly_err.c:81)

Prototype:

  CagdRType CagdPolyApproxMaxErr(const CagdSrfStruct *Srf,
                                 const 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

(cagd1gen.c:572)

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


CagdPolygonBBox

(cagdbbox.c:364)

Prototype:

  void CagdPolygonBBox(const CagdPolygonStruct *Poly, CagdBBoxStruct *BBox)


Description:

Computes a bounding box for a cagd polygon.

Parameters:

Poly: To computes its bbox.
BBox: Where bounding information is to be saved.


Returned Value:

void


See Also:

CagdPolygonListBBox CagdCrvBBox CagdSrfBBox

Keywords:




CagdPolygonCopy

(cagd1gen.c:1085)

Prototype:

  CagdPolygonStruct *CagdPolygonCopy(const 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

(cagd2gen.c:157)

Prototype:

  CagdPolygonStruct *CagdPolygonCopyList(const CagdPolygonStruct *PolyList)


Description:

Allocates and copies a list of polygon structures.

Parameters:

PolyList: To be copied.


Returned Value:

CagdPolygonStruct *: A duplicated list of polygons.


Keywords:

copy


CagdPolygonFree

(cagd2gen.c:827)

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

(cagd2gen.c:856)

Prototype:

  void CagdPolygonFreeList(CagdPolygonStruct *PolyList)


Description:

Deallocates and frees a polygon structure list:

Parameters:

PolyList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdPolygonListBBox

(cagdbbox.c:415)

Prototype:

  void CagdPolygonListBBox(const CagdPolygonStruct *Polys, CagdBBoxStruct *BBox)


Description:

Computes a bounding box for a list of cagd polygons.

Parameters:

Polys: To computes its bbox.
BBox: Where bounding information is to be saved.


Returned Value:

void


See Also:

CagdPolygonBBox CagdCrvListBBox CagdSrfListBBox

Keywords:




CagdPolygonNew

(cagd1gen.c:605)

Prototype:

  CagdPolygonStruct *CagdPolygonNew(int Len)


Description:

Allocates and resets all slots of a Polygon structure.

Parameters:

Len: Number of vertices


Returned Value:

CagdPolygonStruct *: A Polygon structure.


Keywords:

allocation


CagdPolygonSetErrFunc

(cagd2gen.c:2392)

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:

CagdPlgErrorFuncType: Old value of function.


Keywords:




CagdPolygonStripNew

(cagd1gen.c:635)

Prototype:

  CagdPolygonStruct *CagdPolygonStripNew(int Len)


Description:

Allocates and resets all slots of a Polygon structure as a strip.

Parameters:

Len: Number of polygons in strip.


Returned Value:

CagdPolygonStruct *: A Polygon structure.


Keywords:

allocation


CagdPolylineArrayNew

(cagd1gen.c:668)

Prototype:

  CagdPolylineStruct *CagdPolylineArrayNew(int Length, int Size)


Description:

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

Parameters:

Length: Length of each polyline in the polyline array.
Size: Size of Polyline array to allocate.


Returned Value:

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


Keywords:

allocation


CagdPolylineCopy

(cagd1gen.c:1129)

Prototype:

  CagdPolylineStruct *CagdPolylineCopy(const 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

(cagd2gen.c:128)

Prototype:

  CagdPolylineStruct *CagdPolylineCopyList(const 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

(cagd2gen.c:779)

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

(cagd2gen.c:803)

Prototype:

  void CagdPolylineFreeList(CagdPolylineStruct *PolyList)


Description:

Deallocates and frees a polyline structure list:

Parameters:

PolyList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdPolylineNew

(cagd1gen.c:699)

Prototype:

  CagdPolylineStruct *CagdPolylineNew(int Length, int PtDim)


Description:

Allocates and resets all slots of a Polyline structure.

Parameters:

Length: Length of polyline.
PtDim: Dimension of polyline, typically 3.


Returned Value:

CagdPolylineStruct *: A Polyline structure.


Keywords:

allocation


CagdPrimBoxSrf

(cagdprim.c:557)

Prototype:

  CagdSrfStruct *CagdPrimBoxSrf(CagdRType MinX,
                                CagdRType MinY,
                                CagdRType MinZ,
                                CagdRType MaxX,
                                CagdRType MaxY,
                                CagdRType MaxZ)


Description:

A surface constructor of a box, parallel to main axes.

Parameters:

MinX, MinY, MinZ: Minimum range of box model.
MaxX, MaxY, MaxZ: Maximum range of box model.


Returned Value:

CagdSrfStruct *: Constructed box model, as a set of six bilinear srfs.


Keywords:




CagdPrimCone2Srf

(cagdprim.c:804)

Prototype:

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


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. Axis of cone is Z axis.

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.
Caps: Do we want caps (top and/or bottom) for the cone?


Returned Value:

CagdSrfStruct *: A Bspline surface representing a cone.


See Also:

CagdPrimPlaneSrf CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimConeSrf CagdPrimCylinderSrf

Keywords:




CagdPrimConeSrf

(cagdprim.c:880)

Prototype:

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


Description:

A surface constructor of a cone, centered at Center, radii of Radius, and height of Height. Axis of cone is Z axis.

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.
Caps: Do we want caps (top and/or bottom) for the cone?


Returned Value:

CagdSrfStruct *: A Bspline surface representing a cone.


See Also:

CagdPrimPlaneSrf CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimCylinderSrf

Keywords:




CagdPrimCrvFrom4Pts

(cagdprim.c:142)

Prototype:

  CagdCrvStruct *CagdPrimCrvFrom4Pts(const CagdPType P1,
                                     const CagdPType P2,
                                     const CagdPType P3,
                                     const CagdPType P4,
                                     CagdBType Closed)


Description:

Creates a piecewise linear closed B-spline curve from 4 points in general position. Note points need not be co-planar.

Parameters:

P1, P2, P3, P4: The four corner points of the curve, in 3-space.
Closed: TRUE to close the curve. That is, last, 5th, point will be duplicated and equal to first.


Returned Value:

CagdCrvStruct *: Constructed linear B-spline curve.


See Also:

CagdPrimPlaneSrf CagdPrimRectangleCrv

Keywords:




CagdPrimCubeSphereSrf

(cagdprim.c:656)

Prototype:

  CagdSrfStruct *CagdPrimCubeSphereSrf(const CagdVType Center,
                                       CagdRType Radius,
                                       CagdBType Rational)


Description:

A surface constructor of a sphere, centered at Center and radius Radius. Constructs the rational sphere out of six patches in a cube topology. See also: "Tiling the Sphere with Rational Bezier Patches" by Jim Cobb.

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 list of six B-spline surfaces representing a sphere.


See Also:

CagdPrimPlaneSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimSphereSrf

Keywords:




CagdPrimCylinderSrf

(cagdprim.c:912)

Prototype:

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


Description:

A surface constructor of a Cylinder, centered at Center, radii of Radius, and height of Height. Axis of cylinder is Z axis.

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.
Caps: Do we want caps (top and/or bottom) for the cone?


Returned Value:

CagdSrfStruct *: A Bspline surface representing a cylinder.


See Also:

CagdPrimPlaneSrf CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf

Keywords:




CagdPrimPlaneFromE3Crv

(cagdprim.c:282)

Prototype:

  CagdSrfStruct *CagdPrimPlaneFromE3Crv(const CagdCrvStruct *Crv,
                                        const IrtPlnType Plane)


Description:

Build a planar srf, large enough to accommodate the given curve in it. The curve is assumed planar and in general E3 position.

Parameters:

Crv: Planar curve in general E3 position.
Plane: Optional plane equation of the planar surface. If not given (can be NULL) computed from Crv directly.


Returned Value:

CagdSrfStruct *: Constructed plane, as a bilinear surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf CagdPrimPlaneSrf2 CagdPrimPlanePlaneSpanBBox

Keywords:




CagdPrimPlanePlaneSpanBBox

(cagdprim.c:496)

Prototype:

  CagdSrfStruct *CagdPrimPlanePlaneSpanBBox(const CagdBBoxStruct *BBox,
                                            const IrtPlnType Pln)


Description:

Builds a planar surface, large enough to span all of BBox as the plane specified by Pln.

Parameters:

BBox: To make sure Plane spans beyond it in all dimensions.
Pln: The plane to build specifications.


Returned Value:

CagdSrfStruct *: The constructed plane.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf CagdPrimPlaneSrf2 CagdPrimPlaneFromE3Crv CagdPrimPlaneYZSrf

Keywords:




CagdPrimPlaneSrf

(cagdprim.c:187)

Prototype:

  CagdSrfStruct *CagdPrimPlaneSrf(CagdRType MinX,
                                  CagdRType MinY,
                                  CagdRType MaxX,
                                  CagdRType MaxY,
                                  CagdRType ZLevel)


Description:

A surface constructor of a plane, parallel to XY plane at level Zlevel.

Parameters:

MinX, MinY: Minimum X coordinates of plane.
MaxX, MaxY: Maximum Y coordinates of plane.
ZLevel: Z level of plane, parallel to the XY plane.


Returned Value:

CagdSrfStruct *: Constructed plane, as a bilinear surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf2 CagdPrimPlaneFromE3Crv CagdPrimPlanePlaneSpanBBox

Keywords:




CagdPrimPlaneSrf2

(cagdprim.c:235)

Prototype:

  CagdSrfStruct *CagdPrimPlaneSrf2(CagdPType Cntr,
                                   CagdVType Vec1,
                                   CagdVType Vec2)


Description:

A surface constructor of a plane, in general position: centered around Center and spanned by Vec1 and Vec2 that are two independent vectors.

Parameters:

Cntr: The center of the constructed plane.
Vec1, Vec2: wo vectors spanning the plane (also sets the plane's size).


Returned Value:

CagdSrfStruct *: Constructed plane, as a bilinear surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf CagdPrimPlaneFromE3Crv

Keywords:




CagdPrimPlaneSrfOrderLen

(cagdprim.c:347)

Prototype:

  CagdSrfStruct *CagdPrimPlaneSrfOrderLen(CagdRType MinX,
                                          CagdRType MinY,
                                          CagdRType MaxX,
                                          CagdRType MaxY,
                                          CagdRType ZLevel,
                                          int Order,
                                          int Len)


Description:

A surface constructor of a plane, parallel to XY plane at level Zlevel.

Parameters:

MinX, MinY: Minimum XY coordinates of plane.
MaxX, MaxY: Maximum XY coordinates of plane.
ZLevel: Z level of plane, parallel to the XY plane.
Order: Order of plane surface that is requested.
Len: Number of control points (via refinement).


Returned Value:

CagdSrfStruct *: Constructed surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimPlaneSrf CagdPrimPlaneSrf2 CagdPrimPlaneSrf2 CagdPrimPlaneFromE3Crv CagdPrimPlanePlaneSpanBBox

Keywords:




CagdPrimPlaneXZSrf

(cagdprim.c:398)

Prototype:

  CagdSrfStruct *CagdPrimPlaneXZSrf(CagdRType MinX,
                                    CagdRType MinZ,
                                    CagdRType MaxX,
                                    CagdRType MaxZ,
                                    CagdRType YLevel)


Description:

A surface constructor of an XZ plane, parallel to XZ plane at level Ylevel.

Parameters:

MinX, MinZ: Minimum X coordinates of plane.
MaxX, MaxZ: Maximum Z coordinates of plane.
YLevel: Y level of plane, parallel to the XZ plane.


Returned Value:

CagdSrfStruct *: Constructed plane, as a bilinear surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf CagdPrimPlaneSrf2 CagdPrimPlaneFromE3Crv CagdPrimPlanePlaneSpanBBox

Keywords:




CagdPrimPlaneYZSrf

(cagdprim.c:449)

Prototype:

  CagdSrfStruct *CagdPrimPlaneYZSrf(CagdRType MinY,
                                    CagdRType MinZ,
                                    CagdRType MaxY,
                                    CagdRType MaxZ,
                                    CagdRType XLevel)


Description:

A surface constructor of an YZ plane, parallel to YZ plane at level Ylevel.

Parameters:

MinY, MinZ: Minimum Y coordinates of plane.
MaxY, MaxZ: Maximum Z coordinates of plane.
XLevel: X level of plane, parallel to the YZ plane.


Returned Value:

CagdSrfStruct *: Constructed plane, as a bilinear surface.


See Also:

CagdPrimSphereSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimRectangleCrv CagdPrimPlaneSrf CagdPrimPlaneSrf2 CagdPrimPlaneFromE3Crv CagdPrimPlanePlaneSpanBBox

Keywords:




CagdPrimRectangleCrv

(cagdprim.c:90)

Prototype:

  CagdCrvStruct *CagdPrimRectangleCrv(CagdRType MinX,
                                      CagdRType MinY,
                                      CagdRType MaxX,
                                      CagdRType MaxY,
                                      CagdRType ZLevel)


Description:

A curve constructor of a rectangle, parallel to XY plane at level Zlevel.

Parameters:

MinX, MinY: Minimum XY coordinates of rectangle.
MaxX, MaxY: Maximum XY coordinates of rectangle.
ZLevel: Z level of rectangle, parallel to the XY plane.


Returned Value:

CagdCrvStruct *: Constructed curve.


See Also:

CagdPrimPlaneSrf CagdPrimCrvFrom4Pts

Keywords:




CagdPrimSphereSrf

(cagdprim.c:598)

Prototype:

  CagdSrfStruct *CagdPrimSphereSrf(const 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:

CagdPrimPlaneSrf CagdPrimTorusSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf CagdPrimCubeSphereSrf

Keywords:




CagdPrimTorusSrf

(cagdprim.c:741)

Prototype:

  CagdSrfStruct *CagdPrimTorusSrf(const 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:

CagdPrimPlaneSrf CagdPrimSphereSrf CagdPrimCone2Srf CagdPrimConeSrf CagdPrimCylinderSrf

Keywords:




CagdPtArrayFree

(cagd2gen.c:503)

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

(cagd1gen.c:296)

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

(cagd1gen.c:937)

Prototype:

  CagdPtStruct *CagdPtCopy(const 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

(cagd1gen.c:1245)

Prototype:

  CagdPtStruct *CagdPtCopyList(const 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

(cagd2gen.c:408)

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

(cagd2gen.c:431)

Prototype:

  void CagdPtFreeList(CagdPtStruct *PtList)


Description:

Deallocates and frees a point structure list:

Parameters:

PtList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdPtNew

(cagd1gen.c:323)

Prototype:

  CagdPtStruct *CagdPtNew(void)


Description:

Allocates and resets all slots of a Pt structure.

Parameters:

None


Returned Value:

CagdPtStruct *: A Pt structure.


Keywords:

allocation


CagdPtPolyline2EkPolyline

(bzr2poly.c:1229)

Prototype:

  CagdPolylineStruct *CagdPtPolyline2EkPolyline(
                                  CagdRType * const Polyline[CAGD_MAX_PT_SIZE],
                                  int n,
                                  int MaxCoord,
                                  CagdBType IsRational)


Description:

Routine to convert a possibly rational polyline to a CagdPolylineStruct Ek, k >= 3, format.

Parameters:

Polyline: A vector of evaluations with MaxCoord each evaluation.
n: Number of evaluation (length of Polyline).
MaxCoord: Number of coordinates in the polyline Polyline.
IsRational: TRUE, if original curve was rational, FALSE otherwise.


Returned Value:

CagdPolylineStruct *: A list of E3 polylines representing the piecewise linear approximation. Typically, only one polyline, unless the (rational) curve has poles.


See Also:

BzrCrv2Polyline BspSrf2Polylines IritCurve2Polylines SymbCrv2Polyline

Keywords:

piecewise linear approximation polyline


CagdPtsSortAxis

(cbsp_int.c:1816)

Prototype:

  CagdPtStruct *CagdPtsSortAxis(CagdPtStruct *PtList, int Axis)


Description:

Sorts given list of points based on their increasing order in axis Axis. Sorting is done in place.

Parameters:

PtList: List of points to sort.
Axis: Axis to sort along: 1,2,3 for X,Y,Z.


Returned Value:

CagdPtStruct *: Sorted list of points, in place.


Keywords:




CagdQuadCrvToQuadsLineSweep

(crv2quad.c:288)

Prototype:

  CagdCrvQuadTileStruct *CagdQuadCrvToQuadsLineSweep(const CagdCrvStruct *Crv,
                                                     CagdBType OutputSrfs)


Description:

Computes the covering of a closed planar curve in quadrilateral tiles using the line sweep algorithm. This function includes preprocessing, and error handling by attempting multiple rotations.

Parameters:

Crv: The curve to cover in tiles.
OutputSrfs: A flag for choosing whether to output ruled surfaces (if TRUE) or pairs of curves (forming the limits of the ruled surfaces).


Returned Value:

CagdCrvQuadTileStruct *: A list of either ruled surfaces, or pairs of curves (forming the bounadry of the ruled surfaces.


See Also:

CagdCrvPartitionIntoBoolSums

Keywords:

untrimming


CagdQuadCurveListWeightedQuadrangulation

(crv_quad.c:1905)

Prototype:

  CagdSrfStruct *CagdQuadCurveListWeightedQuadrangulation(
                                                  const CagdCrvStruct *CrvList,
                                                  CagdQuadSrfWeightFuncType
                                                                    WeightFunc,
                                                  int ApproxOrder)


Description:

Tiles list of curves with tensor product surfaces using minimal weighted quadrangulation algorithm.

Parameters:

CrvList: curve list to quadrangulate.
WeightFunc: uad surface weight function to optimize for the quadrangulation algorithm.
ApproxOrder: f not zero, the results surfaces will be approximated to surfaces with of this given order. The approximation is done before the composition.


Returned Value:

CagdSrfStruct *: List of tensor product surfaces tiling Crv.


Keywords:




CagdQuadCurveWeightedQuadrangulation

(crv_quad.c:1681)

Prototype:

  CagdSrfStruct *CagdQuadCurveWeightedQuadrangulation(const CagdCrvStruct *Crv,
                                                      CagdQuadSrfWeightFuncType
                                                                     WeightFunc,
                                                      int ApproxOrder)


Description:

Tiles a curve with tensor product surfaces using minimal weighted quadrangulation algorithm.

Parameters:

Crv: curve to quadrangulate.
WeightFunc: uad surface weight function to optimize for the quadrangulation algorithm.
ApproxOrder: f not zero, the results surfaces will be approximated to surfaces with of this given order. The approximation is done before the composition.


Returned Value:

CagdSrfStruct *: List of tensor product surfaces tiling Crv.


Keywords:




CagdQuadGetQuadSrfCombinedWeightFactors

(crv_quad.c:506)

Prototype:

  void CagdQuadGetQuadSrfCombinedWeightFactors(IrtRType *JacobianFactor,
                                               IrtRType *ConformFactor,
                                               IrtRType *RegularityFactor)


Description:

Gets the factor multiplied by each weight function in the combined weight function QuadSrfCombinedWeight.

Parameters:

JacobianFactor: actor of QuadSrfJacobianWeight weight function.
ConformFactor: actor of QuadSrfConformWeight weight function.
RegularityFactor: actor of QuadSrfRegularPolyWeight weight function.


Returned Value:

void


See Also:

CagdQuadSrfCombinedWeight CagdQuadSetQuadSrfCombinedWeightFactors.

Keywords:




CagdQuadSetQuadSrfCombinedWeightFactors

(crv_quad.c:478)

Prototype:

  void CagdQuadSetQuadSrfCombinedWeightFactors(IrtRType JacobianFactor,
                                               IrtRType ConformFactor,
                                               IrtRType RegularityFactor)


Description:

Sets the factor multiplied by each weight function in the combined weight function QuadSrfCombinedWeight.

Parameters:

JacobianFactor: actor of QuadSrfJacobianWeight weight function.
ConformFactor: actor of QuadSrfConformWeight weight function.
RegularityFactor: actor of QuadSrfRegularPolyWeight weight function.


Returned Value:

void


See Also:

CagdQuadSrfCombinedWeight CagdQuadGetQuadSrfCombinedWeightFactors.

Keywords:




CagdQuadSrfCombinedWeight

(crv_quad.c:430)

Prototype:

  IrtRType CagdQuadSrfCombinedWeight(const CagdSrfStruct *QuadSrf,
                                     const CagdCrvStruct *BoundaryCrv,
                                     const CagdPolylineStruct *SampledPolygon,
                                     const int *VIndices,
                                     int numV)


Description:

Computes weight function based on a combination of Jacobian, conformality and the regularity of a given surface. The factor multiplied by each weight function can be set using SetQuadSrfCombinedWeightFactors function.

Parameters:

QuadSrf: The given surface, built from four curve pieces of BoundaryCrv.
BoundaryCrv: he curve being quadratized.
SampledPolygon: he representative polygon of BoundaryCrv.
VIndices: n array of vertices indices from SampledPolygon that forms a quad.
numV: umber of vertices of the quad (length of VIndices).


Returned Value:

IrtRType: The weight of the given quad surface.


See Also:

CagdQuadSrfJacobianWeight CagdQuadSrfConformWeight CagdQuadSrfRegularPolyWeight GMQuadAreaPerimeterRatioWeightFunc CagdQuadSetQuadSrfCombinedWeightFactors.

Keywords:




CagdQuadSrfConformWeight

(crv_quad.c:327)

Prototype:

  IrtRType CagdQuadSrfConformWeight(const CagdSrfStruct *QuadSrf,
                                    const CagdCrvStruct *BoundaryCrv,
                                    const CagdPolylineStruct *SampledPolygon,
                                    const int *VIndices,
                                    int numV)


Description:

Computes weight function based on orthogonality of iso-curves of a given surface. More orthogonal iso curve are assigned lower weight. A large weight is assigned for triangular surfaces.

Parameters:

QuadSrf: The given surface, built from four curve pieces of BoundaryCrv.
BoundaryCrv: he curve being quadratized.
SampledPolygon: he representative polygon of BoundaryCrv.
VIndices: n array of vertices indices from SampledPolygon that forms a quad.
numV: umber of vertices of the quad (length of VIndices).


Returned Value:

IrtRType: The weight of the given quad surface.


See Also:

CagdQuadSrfJacobianWeight CagdQuadSrfRegularPolyWeight CagdQuadSrfCombinedWeight.

Keywords:




CagdQuadSrfJacobianWeight

(crv_quad.c:287)

Prototype:

  IrtRType CagdQuadSrfJacobianWeight(const CagdSrfStruct *QuadSrf,
                                     const CagdCrvStruct *BoundaryCrv,
                                     const CagdPolylineStruct *SampledPolygon,
                                     const int *VIndices,
                                     int numV)


Description:

Computes weight function based on Jacobian of a given surface. If the jacobian changes signm an infinite weight is returned, otherwise JMax/JMin is returned, where JMin and JMax are the minimal and maximal values of the Jacobian. A large weight is assigned for triangular surfaces.

Parameters:

QuadSrf: The given surface, built from four curve pieces of BoundaryCrv.
BoundaryCrv: he curve being quadratized.
SampledPolygon: he representative polygon of BoundaryCrv.
VIndices: n array of vertices indices from SampledPolygon that forms a quad.
numV: umber of vertices of the quad (length of VIndices).


Returned Value:

IrtRType: The weight of the given quad surface.


See Also:

CagdQuadSrfConformWeight CagdQuadSrfRegularPolyWeight CagdQuadSrfCombinedWeight.

Keywords:




CagdQuadSrfRegularPolyWeight

(crv_quad.c:394)

Prototype:

  IrtRType CagdQuadSrfRegularPolyWeight(const CagdSrfStruct *QuadSrf,
                                        const CagdCrvStruct *BoundaryCrv,
                                        const CagdPolylineStruct *SampledPolygon,
                                        const int *VIndices,
                                        int numV)


Description:

Computes weight function based on regularity of a given surface. Regularity is approximated by the representative polygonal quad as: (0.75 * QuadArea + 0.05 * QuadPerimeter + 0.10 * EdgesMaxMinRatio). A large weight is assigned for triangular surfaces.

Parameters:

QuadSrf: The given surface, built from four curve pieces of BoundaryCrv.
BoundaryCrv: he curve being quadratized.
SampledPolygon: he representative polygon of BoundaryCrv.
VIndices: n array of vertices indices from SampledPolygon that forms a quad.
numV: umber of vertices of the quad (length of VIndices).


Returned Value:

IrtRType: The weight of the given quad surface.


See Also:

CagdQuadSrfJacobianWeight CagdQuadSrfConformWeight CagdQuadSrfCombinedWeight.

Keywords:




CagdQuadraticCrvFit

(hermite.c:149)

Prototype:

  CagdCrvStruct *CagdQuadraticCrvFit(const CagdCrvStruct *Crv)


Description:

Construct a quadratic Bezier curve that fits the input curve end points and aims for Same tangent directions. If Crv is planar and not singular i. e. parallel tangents) G1 continuity is ensured.

Parameters:

Crv: To approximate as a quadratic.


Returned Value:

CagdCrvStruct *: A quadratic Bezier curve, fitting the end position tangent directions if planar, and not singular.


See Also:

CagdCubicHermiteCrv CagdCubicCrvFit SymbApproxCrvAsBzrQuadratics

Keywords:

Hermite


CagdQuadraticSrfFit

(hermite.c:571)

Prototype:

  CagdSrfStruct *CagdQuadraticSrfFit(const CagdSrfStruct *Srf)


Description:

Construct a biquadratic Bezier surface that fits the input surface corner points and aims for same corner tangent directions. If Srf planar and not singular (i. e. parallel tangents) G1 continuity is ensured.

Parameters:

Srf: To approximate as a quadratic.


Returned Value:

CagdSrfStruct *: A biquadratic Bezier surface, fitting end positions and tangent directions if planar, and not singular.


See Also:

CagdCubicHermiteSrf CagdCubicSrfFit CagdQuadraticCrvFit

Keywords:

Hermite


CagdQuadricMatTransform

(cagd_cnc.c:1198)

Prototype:

  CagdBType CagdQuadricMatTransform(CagdRType *A,
                                    CagdRType *B,
                                    CagdRType *C,
                                    CagdRType *D,
                                    CagdRType *E,
                                    CagdRType *F,
                                    CagdRType *G,
                                    CagdRType *H,
                                    CagdRType *I,
                                    CagdRType *J,
                                    CagdMType Mat)


Description:

Transform given quadric form A x^2 + B y^2 + C z^2 + D xy + E xz + F yz + G x + H y + I z + J = 0, using Mat. Algorithm:
1. Convert the implicit quadric to a matrix form as:
                [ A  D/2 E/2 G/2] [x]

   [x, y, z, 1] [D/2  B  F/2 H/2] [y] = P^T M P = 0

                [E/2 F/2  C  I/2] [z]

                [G/2 H/2 I/2  J ] [1]

2. Compute N = Mat^{-1} the inverse of the desired transformation.

3. Compute K = N M N^T and decompose K back to A-J coefficients.


Parameters:

A, B, C, D, E, F, G, H, I, J: The ten coefficients of the quadric. Updated in place.
Mat: Transformation matrix.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdConicMatTransform CagdSrfTransfrom CagdCrvTransform

Keywords:

implicit


CagdQuinticHermiteSrf

(hermite.c:303)

Prototype:

  CagdSrfStruct *CagdQuinticHermiteSrf(const CagdCrvStruct *CPos1Crv,
                                       const CagdCrvStruct *CPos2Crv,
                                       const CagdCrvStruct *CDir1Crv,
                                       const CagdCrvStruct *CDir2Crv,
                                       const CagdCrvStruct *C2Dir1Crv,
                                       const CagdCrvStruct *C2Dir2Crv)


Description:


Construct a cubic surface using the Hermite constraints - two positions and two tangents. Other direction's degree depends on input.

Parameters:

CPos1Crv, CPos2Crv: Starting and end curves of surface.
CDir1Crv, CDir2Crv: Starting and end tangent fields surface.
C2Dir1Crv, C2Dir2Crv: Starting and end 2nd derivative 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


CagdRayTraceBzrSrf

(bez_clip.c:111)

Prototype:

  CagdBType CagdRayTraceBzrSrf(CagdPType StPt,
                               CagdVType Dir,
                               const CagdSrfStruct *BzrSrf,
                               CagdUVStruct **IntrPrm,
                               CagdPtStruct **IntrPt)


Description:

Computing the intersection of a rational Bezier surface with a ray. Based on algorithm described in Computer Graphics, Volume 24, Number 4, August 1990: "Ray Tracing Trimmed Rational Surface Patches",written by Tomoyuki Nishita, Thomas W.Sederberg and Masanori Kakimoto.

Parameters:

StPt: Start point of the ray.
Dir: Direction of the ray.
BzrSrf: A rational Bezier surface to be ray-traced.
IntrPrm: ay/Bezier surface intersection parameter (of the surface).
IntrPt: Ray/Bezier surface intersection points.


Returned Value:

CagdBType: FALSE if no intersection, TRUE for intersection(s).


Keywords:




CagdRealVecSame

(cagdcoer.c:372)

Prototype:

  CagdBType CagdRealVecSame(CagdRType const *Vec1,
                            CagdRType const *Vec2,
                            int Len,
                            CagdRType Eps)


Description:

Compare the two real vectors for similarity.

Parameters:

Vec1, Vec2: Two vectors to compare.
Len: Length of the two vectors.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if vectors are the same, FALSE otherwise.


See Also:

BspKnotVectorsSame CagdCtlMeshsSame CagdCrvsSame CagdSrfsSame

Keywords:




CagdReorderCurvesInLoop

(cagdbsum.c:650)

Prototype:

  CagdCrvStruct *CagdReorderCurvesInLoop(CagdCrvStruct *UVCrvs)


Description:

Properly reorder given curves of one closed loops, in place. That is, input is assumed to define a complete loop where one curve ends where another begins. Compare end points in R^3 (XYZ). Input curves can be in arbitrary order and even partially reversed. Orientation of loop will be following first curve in the list.

Parameters:

UVCrvs: Curves forming one loop to reorder so end point of one curve is the beginning of the next curve.


Returned Value:

CagdCrvStruct *: Curves properly reordered in loop.


See Also:

CagdSrfFromNBndryCrvs

Keywords:




CagdRuledSrf

(cagdruld.c:33)

Prototype:

  CagdSrfStruct *CagdRuledSrf(const CagdCrvStruct *CCrv1,
                              const CagdCrvStruct *CCrv2,
                              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:

CCrv1, CCrv2: 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 ruled surface.


Keywords:

ruled surface surface constructors


CagdSDError

(cbsp_fit.c:482)

Prototype:

  static CagdRType CagdSDError(const CagdPType Point,
                               const CagdPType FootPoint,
                               const CagdRType Distance,
                               const CagdPType Tangent,
                               const CagdPType Normal,
                               const CagdRType Curvature)


Description:

Computes SD (Squared Distance) error for a single point, which is: *
             /   dk             T     2               T       2
             |  -----[(P(tk)-Xk) * Tk]  +  [(P(tk)-Xk)  *  Nk]  ,if dk<0
  e      =  <   dk-pk
   SD,k      |               T     2
             |  [(P(tk) - Xk] * Ni]                         ,if 0=
Parameters:

Point: (Xk) Points to calculate the error for.
FootPoint: P(tk)) Footpoint (the closest point to Xk on the curve)
Distance: (dk) Distance between Point and FootPoint
Tangent: (Tk) Curve tangent at Footpoint.
Normal: (Nk) Curve normal at Footpoint.
Curvature: (pk) Curve curvature at Footpoint.


Returned Value:

CagdRType: SD error.


Keywords:




CagdScale

(cagd2gen.c:1490)

Prototype:

  void CagdScale(CagdRType **Points,
                 int Len,
                 int MaxCoord,
                 const CagdRType *Scale)


Description:


Applies a scale 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 scaled as prescribed 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.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfScale CagdCrvScale CagdTransform

Keywords:

scaling transformations


CagdScaleCenter

(cagd2gen.c:1527)

Prototype:

  void CagdScaleCenter(CagdRType **Points,
                       int Len,
                       int MaxCoord,
                       const CagdRType *Scale)


Description:

Applies a scale transform, in place, to given set of points Points which as array of vectors, each vector of length Len. The scale is applied around the center of the geometry at hand. 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 scaled as prescribed by Scale.

Parameters:

Points: To be scaled. Array of vectors.
Len: Of vectors of Points.
MaxCoord: Maximum number of coordinates to be found in Points.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfScale CagdCrvScale CagdTransform

Keywords:

scaling transformations


CagdScaleWeights

(cagd2gen.c:2249)

Prototype:

  CagdBType CagdScaleWeights(CagdRType * const *Points,
                             CagdPointType PType,
                             int Len,
                             CagdRType WScale)


Description:

Scale all weights, in place, (and control points as needed) by WScale. This operation has no affect on the shape/geometry aside from normalization.

Parameters:

Points: Control points to scale, in place.
PType: Input point type, as given in Points.
Len: Number of points in Points.
WScale: The scaling factor of the knots.


Returned Value:

CagdBType: TRUE if original has negative weights, FALSE otherwise.


See Also:

CagdPointsHasPoles CagdAllWeightsSame

Keywords:




CagdSetFatalErrorFunc

(cagd_ftl.c:28)

Prototype:

  CagdSetErrorFuncType CagdSetFatalErrorFunc(CagdSetErrorFuncType ErrorFunc)


Description:

Sets the error function to be used by Cagd_lib.

Parameters:

ErrorFunc: New error function to use.


Returned Value:

CagdSetErrorFuncType: Old error function reference.


Keywords:

error handling


CagdSetLinear2Poly

(cagd2gen.c:2514)

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


CagdSparseMatFree

(sbsp_int.c:926)

Prototype:

  void CagdSparseMatFree(CagdSparseMatStruct *Mat)


Description:

Free the memory of the sparse matrix (including all the memory allocated for the cells and for the indicator array.

Parameters:

Mat: Pointer to the sparse matrix.


Returned Value:

void


See Also:

CagdSparseMatNew

Keywords:

Sparse matrix allocation


CagdSparseMatMultNonSparseResult

(sbsp_int.c:1130)

Prototype:

  IrtRType *CagdSparseMatMultNonSparseResult(CagdSparseMatStruct *Mat1,
                                             CagdSparseMatStruct *Mat2)


Description:

Multiply two sparse matrices (the result is non-sparse matrix), Result = Mat1 * Mat2. NULL will be returned if the input matrix sizes' are incompatible.

Parameters:

Mat1: Pointer to first sparse matrix.
Mat2: Pointer to second sparse matrix.


Returned Value:

IrtRType *: An array containing the member values of the non sparse matrix. The array size will be (Mat1->RowNum * Mat2->ColNum) The matrix member should be accessed as Result[Row*Mat2->ColNum +Col]


Keywords:

Sparse matrix Multiplication


CagdSparseMatNew

(sbsp_int.c:874)

Prototype:

  CagdSparseMatStruct *CagdSparseMatNew(int RowNum, int ColNum, int AddIndicator)


Description:

Allocates memory and initialize a sparse matrix of size RowNum, ColNum.

Parameters:

RowNum: Number of rows in the matrix.
ColNum: Number of columns inthe matrix.
AddIndicator: Boolean indicating whether to allocate memory and initialize the indicator of cell existance.


Returned Value:

CagdSparseMatStruct *: Pointer to allocated sparse matrix.


See Also:

CagdSparseMatFree

Keywords:

Sparse matrix allocation


CagdSparseMatNewCell

(sbsp_int.c:1021)

Prototype:

  void CagdSparseMatNewCell(CagdSparseMatStruct *Mat,
                            int CellRow,
                            int CellCol,
                            IrtRType CellValue)


Description:

Add a cell to the sparse matrix in the appropriate row and column.

Parameters:

Mat: Pointer to the sparse matrix.
CellRow: The new cell row index.
CellCol: The new cell col index.
CellValue: he Value stored in the cell.


Returned Value:

void


See Also:



Keywords:

Sparse matrix allocation


CagdSparseMatTranspose

(sbsp_int.c:1189)

Prototype:

  CagdSparseMatStruct *CagdSparseMatTranspose(CagdSparseMatStruct *Mat,
                                              CagdBType AddIndicator)


Description:

Returns the tranpose of the matrix in the input. The newly allocated matrix is returned in sparse format (with or without an indicator as pointed in the AddIndicator parameter).

Parameters:

Mat: Pointer to the sparse matrix we want to transpose.
AddIndicator: f TRUE, the returned matrix will contain a bit indicator.


Returned Value:

CagdSparseMatStruct *: Newly allocated sparse matrix which is the transpose of the input matrix.


Keywords:

Sparse matrix Transpose


CagdSrf2CtrlMesh

(cagdmesh.c:60)

Prototype:

  CagdPolylineStruct *CagdSrf2CtrlMesh(const CagdSrfStruct *Srf)


Description:

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

Parameters:

Srf: To extract a control mesh from.


Returned Value:

CagdPolylineStruct *: The control mesh of Srf.


See Also:

CagdSrf2KnotLines CagdSrf2KnotCurves

Keywords:

control mesh


CagdSrf2Curves

(cagd_aux.c:626)

Prototype:

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


Description:

Routine to extract from a 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:

BspSrf2PCurves BzrSrf2Curves SymbSrf2Curves

Keywords:

curves isoparametric curves


CagdSrf2KnotCurves

(cagdmesh.c:200)

Prototype:

  int CagdSrf2KnotCurves(const CagdSrfStruct *Srf,
                         CagdCrvStruct **UKnotLines,
                         CagdCrvStruct **VKnotLines)


Description:

Extracts a list of knot curves along all knots in U and V of Srf.

Parameters:

Srf: To extract a knot curves from.
UKnotLines: The extracted U knot lines.
VKnotLines: The extracted V knot lines.


Returned Value:

int: TRUE if successful, FALSE if error.


See Also:

CagdSrf2CtrlMesh CagdSrf2KnotLines CagdSrf2KnotPolylines TrimSrf2KnotCurves

Keywords:

control mesh knots knot lines knot curves


CagdSrf2KnotLines

(cagdmesh.c:119)

Prototype:

  CagdPolylineStruct *CagdSrf2KnotLines(const CagdSrfStruct *Srf)


Description:

Extracts a polyline grid along all knot in U and V as a list of polylines in E3.

Parameters:

Srf: To extract the knot liens in E3 from.


Returned Value:

CagdPolylineStruct *: The control mesh of Srf.


See Also:

CagdSrf2CtrlMesh CagdSrf2KnotCurves

Keywords:

control mesh knots knot lines


CagdSrf2KnotPolylines

(cagd_aux.c:564)

Prototype:

  CagdPolylineStruct *CagdSrf2KnotPolylines(const CagdSrfStruct *Srf,
                                            int SamplesPerCurve,
                                            BspKnotAlphaCoeffStruct *A)


Description:

Routine to extract from a single B-spline surface all internal knot line curves, in each parametric direction with SamplesPerCurve in each curve. Polyline are always E3 of CagdPolylineStruct type. NULL is returned in case of an error, otherwise list of CagdPolylineStruct.

Parameters:

Srf: Srf to extract isoparametric curves from.
SamplesPerCurve: Fineness control on piecewise linear curve approximation.
A: Alpha matrix (Oslo algorithm) if precomputed.


Returned Value:

CagdPolylineStruct *: List of polygons representing a piecewise linear approximation of the extracted isoparametric knot curves or NULL if none or in case of an error.


See Also:

BspCrv2Polyline BzrSrf2Polylines IritSurface2Polylines IritTrimSrf2Polylines SymbSrf2Polylines TrimSrf2Polylines CagdSrf2Polylines BspSrf2Polylines CagdSrf2KnotCurves

Keywords:

polylines isoparametric curves


CagdSrf2PolyAdapSetAuxDataFunc

(cagd2ply.c:182)

Prototype:

  CagdSrfAdapAuxDataFuncType
                CagdSrf2PolyAdapSetAuxDataFunc(CagdSrfAdapAuxDataFuncType Func)


Description:

Sets the surface approximation auxiliary function. This function will be invoked on each subdivision step during the approximation process, for auxiliary processing that are application specific.

Parameters:

Func: New function to use, NULL to disable.


Returned Value:

CagdSrfAdapAuxDataFuncType: Old value of function.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolyAdapSetPolyGenFunc CagdSrf2PolyAdapSetErrFunc

Keywords:




CagdSrf2PolyAdapSetErrFunc

(cagd2ply.c:148)

Prototype:

  CagdSrfErrorFuncType CagdSrf2PolyAdapSetErrFunc(CagdSrfErrorFuncType Func,
                                                  void *Data)


Description:

Sets the surface approximation error function. The error function will return a negative value if this patch is flat enough, and positive value if flat enough. Either case, the magnitude will equal to the actual error.

Parameters:

Func: New function to use, NULL to disable.
Data: New function data to use, NULL to disable.


Returned Value:

CagdSrfErrorFuncType: Old value of function.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolyAdapSetAuxDataFunc CagdSrf2PolyAdapSetPolyGenFunc

Keywords:




CagdSrf2PolyAdapSetPolyGenFunc

(cagd2ply.c:214)

Prototype:

  CagdSrfAdapPolyGenFuncType
                CagdSrf2PolyAdapSetPolyGenFunc(CagdSrfAdapPolyGenFuncType Func)


Description:

Sets the function to convert flat surface rectangle domains into polygons.

Parameters:

Func: New function to use, NULL to disable.


Returned Value:

CagdSrfAdapPolyGenFuncType: Old value of function.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolyAdapSetAuxDataFunc CagdSrf2PolyAdapSetErrFunc

Keywords:




CagdSrf2PolyAdapSetTessInfoDataFunc

(cagd2ply.c:1758)

Prototype:

  CagdSrfAdapAuxDataFuncType CagdSrf2PolyAdapSetTessInfoDataFunc(
                                               CagdSrf2PlsInfoStrct *TessInfo,
                                               CagdSrfAdapAuxDataFuncType Func)


Description:

Sets the surface approximation auxiliary function. This function will be invoked on each subdivision step during the approximation process, for auxiliary processing that are application specific.

Parameters:

TessInfo: All auxiliary information/state to tessellate.
Func: New function to use, NULL to disable.


Returned Value:

CagdSrfAdapAuxDataFuncType: Old value of function.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolyAdapSetPolyGenFunc CagdSrf2PolyAdapSetErrFunc

Keywords:




CagdSrf2PolyAdapSetTessInfoGenFunc

(cagd2ply.c:1793)

Prototype:

  CagdSrfAdapPolyGenFuncType CagdSrf2PolyAdapSetTessInfoGenFunc(
                                                CagdSrf2PlsInfoStrct *TessInfo,
                                                CagdSrfAdapPolyGenFuncType Func)


Description:

Sets the function to convert flat surface rectangle domains into polygons.

Parameters:

TessInfo: All auxiliary information/state to tessellate.
Func: New function to use, NULL to disable.


Returned Value:

CagdSrfAdapPolyGenFuncType: Old value of function.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolyAdapSetAuxDataFunc CagdSrf2PolyAdapSetErrFunc

Keywords:




CagdSrf2PolygonFast

(bsp2poly.c:72)

Prototype:

  CagdBType CagdSrf2PolygonFast(CagdBType PolygonFast)


Description:

Sets the polygonal approximation of surfaces to create polygonal data ast and approximated (if TRUE) or slowly and exact (if FALSE).

Parameters:

PolygonFast: New setting to use.


Returned Value:

CagdBType: Old value.


See Also:

CagdSrf2Polygons CagdSrf2PolygonStrip CagdSrf2PolygonMergeCoplanar

Keywords:




CagdSrf2PolygonMergeCoplanar

(bzr2poly.c:68)

Prototype:

  CagdBType CagdSrf2PolygonMergeCoplanar(CagdBType MergeCoplanarPolys)


Description:

Sets the polygonal approximation of surfaces to mrge or not adjacent coplanar polygons into one. The default is to apply this optimization but in cases where a uniform mesh is need, it should be disabled.

Parameters:

MergeCoplanarPolys: New setting to use.


Returned Value:

CagdBType: Old value.


See Also:

CagdSrf2Polygons CagdSrf2PolygonFast CagdSrf2PolygonStrip Cagd2PolyClipPolysAtPoles

Keywords:




CagdSrf2PolygonStrip

(bsp2poly.c:43)

Prototype:

  CagdBType CagdSrf2PolygonStrip(CagdBType PolygonStrip)


Description:

Sets the polygonal approximation of surfaces to create polygonal strips (if TRUE) or regular individual polygons (if FALSE). If TRUE this hints the ability and desire to use polygonal strips but it does not guarantee that only polygonal strips would indeed be returned. Regular polygonal data should always be handled as well.

Parameters:

PolygonStrip: New setting to use.


Returned Value:

CagdBType: Old value.


See Also:

CagdSrf2Polygons CagdSrf2PolygonFast CagdSrf2PolygonMergeCoplanar

Keywords:




CagdSrf2Polygons

(cagd_aux.c:402)

Prototype:

  IPPolygonStruct *CagdSrf2Polygons(const CagdSrfStruct *Srf,
                                    CagdSrf2PlsInfoStrct *TessInfo)


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 IPPolygonStruct.

Parameters:

Srf: To approximate into triangles.
TessInfo: All auxiliary information/state to tessellate.


Returned Value:

IPPolygonStruct *: 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 CagdSrf2PolygonStrip CagdSrf2PolygonsN

Keywords:

evaluation polygonal approximation


CagdSrf2PolygonsGenPolys

(bzr2poly.c:254)

Prototype:

  IPPolygonStruct *CagdSrf2PolygonsGenPolys(const CagdSrfStruct *Srf,
                                            CagdRType *PtWeights,
                                            CagdPtStruct *PtMesh,
                                            CagdVecStruct *PtNrml,
                                            CagdUVStruct *UVMesh,
                                            int FineNessU,
                                            int FineNessV,
                                            CagdSrf2PlsInfoStrct *TessInfo)


Description:

Routine to convert uniform grid samples of a freeform srf to a set of triangles/rectangles/polystrips approximating it.

Parameters:

Srf: To approximate into triangles.
PtWeights: Weights of the evaluations, if rational, to detect poles. NULL if surface not rational. Freed by this function.
PtMesh: Evaluated positions of grid of samples. Freed by this function.
PtNrml: Evaluated normals of grid of samples or NULL if none. Freed by this function.
UVMesh: Evaluated UV vals of grid of samples or NULL if none. Freed by this function.
FineNessU, FineNessV: Actual size of PtMesh, PtNrml, UVMesh.
TessInfo: All auxiliary information/state to tessellate.


Returned Value:

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


See Also:

BzrSrf2Polygons BspSrf2Polygons IritSurface2Polygons IritTrimSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons

Keywords:

polygonization surface approximation


CagdSrf2PolygonsN

(cagd_aux.c:454)

Prototype:

  IPPolygonStruct *CagdSrf2PolygonsN(const CagdSrfStruct *Srf,
                                       int Nu,
                                       int Nv,
                                       CagdBType ComputeNormals,
                                       CagdBType FourPerFlat,
                                       CagdBType ComputeUV)


Description:

Routine to convert a single freeform surface to set of triangles approximating it using a uniform fixed resolution of Nu x Nv. NULL is returned in case of an error, otherwise list of IPPolygonStruct.

Parameters:

Srf: To approximate into triangles.
Nu, Nv: The number of uniform samples in U and V of surface.
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:

IPPolygonStruct *: 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 CagdSrf2PolygonStrip CagdSrf2Polygons

Keywords:

evaluation polygonal approximation


CagdSrf2Polylines

(cagd_aux.c:514)

Prototype:

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


Description:

Routine to convert a single B-spline 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


CagdSrfA2PGridFetchPts

(cagd2pl2.c:567)

Prototype:

  CagdSrfPtStruct *CagdSrfA2PGridFetchPts(struct CagdA2PGridStruct *A2PGrid,
                                          CagdSrfDirType Dir,
                                          int StartIndex,
                                          int EndIndex,
                                          int OtherDirIndex,
                                          CagdSrfPtStruct **LastPt,
                                          CagdBType Reversed)


Description:

Fetch an interval of sampled points along isoparametric direction.

Parameters:

A2PGrid: This grid data structure.
Dir: Are we to fetch sampled points along U or V direction?
StartIndex, EndIndex: Limit indices along this direction to fetch.
OtherDirIndex: Index along the other direction to fetch points.
LastPt: Will be set to last point in linked list.
Reversed: TRUE to fetch the linked list reversed.


Returned Value:

CagdSrfPtStruct *: Sampled points.


See Also:

CagdSrfA2PGridInit

Keywords:




CagdSrfA2PGridFetchRect

(cagd2pl2.c:490)

Prototype:

  CagdSrfPtStruct *CagdSrfA2PGridFetchRect(struct CagdA2PGridStruct *A2PGrid,
                                           int UIndex1,
                                           int VIndex1,
                                           int UIndex2,
                                           int VIndex2)


Description:

Fetch a all sampled points in the rectangle region defined from [UIndex1, VIndex1] to [UIndex2, VIndex2].

Parameters:

A2PGrid: This grid data structure.
UIndex1, VIndex1: Start point of rectangle domain.
UIndex2, VIndex2: End point of rectangle domain.


Returned Value:

CagdSrfPtStruct *: List of points found around the rectangle, or NULL if error.


See Also:

CagdSrfA2PGridInit

Keywords:




CagdSrfA2PGridFree

(cagd2pl2.c:112)

Prototype:

  void CagdSrfA2PGridFree(struct CagdA2PGridStruct *A2PGrid)


Description:

Free the grid data structure.

Parameters:

A2PGrid: The data structure to free.


Returned Value:

void


See Also:

CagdSrfA2PGridInit

Keywords:




CagdSrfA2PGridInit

(cagd2pl2.c:75)

Prototype:

  struct CagdA2PGridStruct *CagdSrfA2PGridInit(const CagdSrfStruct *Srf)


Description:

Initializes a data structure to efficiently save UV sample locations on a surface and allow fast fetching of them as well.

Parameters:

Srf: Surface to prepare the grid structure point sampling support.


Returned Value:

struct CagdA2PGridStruct *: The structure if successful, NULL otherwise.


See Also:

CagdSrfAdap2Polygons

Keywords:




CagdSrfA2PGridInsertUV

(cagd2pl2.c:156)

Prototype:

  void CagdSrfA2PGridInsertUV(struct CagdA2PGridStruct *A2PGrid,
                              int UIndex,
                              int VIndex,
                              CagdRType u,
                              CagdRType v)


Description:

Insert one UV location to sample the surfaces, into the data grid.

Parameters:

A2PGrid: This grid data structure.
UIndex, VIndex: Indices of these U / V parameter values.
u, v: The parameter values.


Returned Value:

void


See Also:

CagdSrfA2PGridInit

Keywords:




CagdSrfA2PGridProcessUV

(cagd2pl2.c:290)

Prototype:

  CagdBType CagdSrfA2PGridProcessUV(struct CagdA2PGridStruct *A2PGrid)


Description:

Once all surface sampled points are insert, this function is invoked to process the data for fast fetch. Two vectors, UGridVec and VGridVec are processed and updated to hold evaluate surface locations. Each entry in UGridVec (respectively in VGridVec) will hold a linked list of surface evaluated locations sort in V for that particular U value.

Parameters:

A2PGrid: This grid data structure.


Returned Value:

CagdBType: TRUE if successful, FALSE otherwise.


See Also:

CagdSrfA2PGridInit

Keywords:




CagdSrfAdap2PolyDefErrFunc

(cagd2ply.c:251)

Prototype:

  CagdRType CagdSrfAdap2PolyDefErrFunc(const CagdSrfStruct *Srf,
                                       CagdRType Tolerance,
                                       void *AuxData)


Description:

Tolerance evaluation of flatness for given surface. Constructs a plane from the four corner points, if possible, and measure distance to rest of control points.

Parameters:

Srf: Surface to test for flatness.
Tolerance: s to be used by the flatness testing.
AuxData: Optional call back data. Ignored here.


Returned Value:

CagdRType: Negative value if flat enough, positive if not flat. Either case, magnitude will equal to the actual error.


See Also:

CagdSrfIsCoplanarCtlMesh CagdSrfIsLinearBndryCtlMesh CagdSrfAdap2Polygons

Keywords:




CagdSrfAdap2PolyEvalNrmlBlendedUV

(cagd2ply.c:1563)

Prototype:

  CagdRType *CagdSrfAdap2PolyEvalNrmlBlendedUV(const CagdRType *UV1,
                                               const CagdRType *UV2,
                                               const CagdRType *UV3,
                                               void *EvalNrmlCache,
                                               CagdRType *Nrml)


Description:

Compute the normal to the surface very close to UV1 in the triangle defined by UV1/UV2/UV3.

Parameters:

UV1: To compute the surface normal close to.
UV2, UV3: wo other UV''s of the triangle.
EvalNrmlCache: Cache to speed up normal evaluation.
Nrml: Where result will be saved.


Returned Value:

CagdRType *: Computed normal. Same as Nrml.


See Also:

CagdSrfAdap2Polygons

Keywords:




CagdSrfAdap2Polygons

(cagd2ply.c:615)

Prototype:

  IPPolygonStruct *CagdSrfAdap2Polygons(const CagdSrfStruct *Srf,
                                        VoidPtr AuxSrfData,
                                        CagdSrf2PlsInfoStrct *TessInfo)


Description:

Routine to convert a single surface to set of polygons approximating it. Tolerance is a tolerance control on result, typically related to the the accuracy of the approximation. A value of 0.1 is a good rough start. NULL is returned in case of an error or use of call back function to get a hold over the created polygons, otherwise list of IPPolygonStruct.

Parameters:

Srf: To approximate into triangles.
AuxSrfData: Optional data structure that will be passed to all subdivided sub-surfaces, or NULL if not needed. See also CagdSrf2PolyAdapSetAuxDataFunc.
TessInfo: Aux. information for the srf to polys conv.


Returned Value:

IPPolygonStruct *: A list of polygons with optional normal and/or UV parametric information. NULL is returned in case of an error or if use of call back function to collect the polygons.


See Also:

CagdSrf2PolygonSetErrFunc CagdSrfAdap2PolyDefErrFunc CagdSrf2PolyAdapSetErrFunc CagdSrf2PolyAdapSetAuxDataFunc CagdSrf2PolyAdapSetPolyGenFunc BzrSrf2Polygons CagdSrf2Polygons CagdSrf2Polygons TrimSrf2Polygons BspC1Srf2Polygons CagdSrf2Polygons

Keywords:

polygonization surface approximation


CagdSrfAdapGetE3Pt

(cagd2ply.c:290)

Prototype:

  static void CagdSrfAdapGetE3Pt(CagdRType *E3Point,
                                 CagdRType * const Points[CAGD_MAX_PT_SIZE],
                                 int Index,
                                 CagdPointType PType)


Description:

Fetches an E3 point at given Index. Input control points are assumed E3 or P3 only.

Parameters:

E3Point: Where the coerced information is to be saved.
Points: The control points vector of the surface.
Index: Index into the vectors of Points.
PType: Point type of Srf.


Returned Value:

void


Keywords:

coercion


CagdSrfAdapRectPolyGen

(cagd2ply.c:1325)

Prototype:

  IPPolygonStruct *CagdSrfAdapRectPolyGen(const CagdSrfStruct *Srf,
                                          CagdSrfPtStruct *SrfPtList,
                                          const CagdSrfAdapRectStruct *Rect,
                                          CagdSrf2PlsInfoStrct *TessInfo)


Description:

Converts the given circular list of surface points into polygons. The list is assumed a convex parametric domain (which ease the process of decomposition).

Parameters:

Srf: B-spline surface with no discontinuities to approximate into triangles.
SrfPtList: Circular list of a convex surface domain to convert to triangles.
Rect: The rectangular domain to convert to polygons.
TessInfo: All auxiliary information/state to tessellate.


Returned Value:

IPPolygonStruct *: List of polygons out of the closed srf pt list; Could be NULL if polygons are call back created.


See Also:

CagdSrfAdap2Polygons CagdSrf2PolygonSetErrFunc CagdSrfAdap2PolyDefErrFunc CagdSrf2PolyAdapSetErrFunc CagdSrf2PolyAdapSetAuxDataFunc

Keywords:

polygonization surface approximation


CagdSrfAre2SrfsSharingBndry

(cagdsmrg.c:62)

Prototype:

  CagdBType CagdSrfAre2SrfsSharingBndry(CagdSrfStruct *Srf1,
                                        CagdSrfBndryType Bndry1,
                                        CagdSrfStruct *Srf2,
                                        CagdSrfBndryType Bndry2,
                                        IrtRType Tolerance)


Description:

Compare designated two boundaries of given two surfaces for similarity.

Parameters:

Srf1: First surface to consider.
Bndry1: First boundary of first surface to consider.
Srf2: Second surface to consider.
Bndry2: Second boundary of first surface to consider.
Tolerance: olerance of similarity.


Returned Value:

CagdBType: TRUE if similar, FALSE otherwise.


See Also:

MvarAre2MVsSharingBndry

Keywords:




CagdSrfArea

(cagd2ply.c:1715)

Prototype:

  CagdRType CagdSrfArea(const CagdSrfStruct *Srf, CagdRType Tol)


Description:

Compute an approximated surface area by polygonalizing Srf...

Parameters:

Srf: Surface to approximate its surface area.
Tol: Of approximation.


Returned Value:

CagdRType: Approximated surface area.


See Also:

TrivSrfArea

Keywords:




CagdSrfAverageValue

(cagdbbox.c:939)

Prototype:

  CagdRType CagdSrfAverageValue(const CagdSrfStruct *Srf, int Axis)


Description:

Computes an average value of all control points of given surface in a given axis. Rational values are taken into account (projected into Euclidean space first).

Parameters:

Srf: To compute an average value of its control mesh, in some Axis.
Axis: 1 for X, 2 for Y etc.


Returned Value:

CagdRType: Average value.


See Also:

CagdSrfMinMax CagdPointsBBox CagdCrvAverageValue

Keywords:

bbox bounding box minimum maximum


CagdSrfAvgArgLenMesh

(cagdsmrg.c:484)

Prototype:

  CagdRType CagdSrfAvgArgLenMesh(const CagdSrfStruct *Srf,
                                 CagdRType *AvgULen,
                                 CagdRType *AvgVLen)


Description:

Computes an average of edge lengths of edges of the control mesh of the given surface in the U direction and in the V direction.

Parameters:

Srf: To computer average mesh edge length in the U and the V directions.
AvgULen, AvgVLen: Average length of edges of the control mesh of Srf in the U and V mesh directions.


Returned Value:

CagdRType: The ratio of AvgULen / AvgVLen.


See Also:

CagdCrvArcLenPoly CagdLimitCrvArcLen

Keywords:

arc length


CagdSrfBBox

(cagdbbox.c:177)

Prototype:

  CagdBBoxStruct *CagdSrfBBox(const 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:

CagdBBoxStruct *: BBox.


See Also:

CagdCrvBBox CagdSrfListBBox GMBBSetBBoxPrecise CagdIgnoreNonPosWeightBBox CagdPolygonBBox

Keywords:

bbox bounding box


CagdSrfBelowPlane

(cagdbbox.c:288)

Prototype:

  CagdBType CagdSrfBelowPlane(const CagdSrfStruct *Srf, const CagdRType Pln[4])


Description:

Examines if the given surface is entirely below a given plane.

Parameters:

Srf: The surface examine if below the plane Pln.
Pln: First points defining the line in the XY plane.


Returned Value:

CagdBType: TRUE if Srf is entirely below Pln, or FALSE otherwise.


Keywords:




CagdSrfBlossomDegreeRaise

(blossom.c:1385)

Prototype:

  CagdSrfStruct *CagdSrfBlossomDegreeRaise(const CagdSrfStruct *Srf,
                                           CagdSrfDirType Dir)


Description:

Computes a new surface with its degree raised once, given surface Srf, using blossoming.

Parameters:

Srf: Surface to degree raise.
Dir: Direction of degree raising. Either U or V.


Returned Value:

CagdSrfStruct *: Degree raised surface, or NULL if error.


See Also:

CagdSrfBlossomDegreeRaiseN BspSrfDegreeRaise BzrSrfDegreeRaise CagdSrfDegreeRaise CagdCrvBlossomDegreeRaise

Keywords:




CagdSrfBlossomDegreeRaiseN

(blossom.c:1222)

Prototype:

  CagdSrfStruct *CagdSrfBlossomDegreeRaiseN(const CagdSrfStruct *Srf,
                                            int NewUOrder,
                                            int NewVOrder)


Description:

Computes a new surface with its degree raised to NewOrder, given surface Srf, using blossoming.

Parameters:

Srf: Surface to degree raise.
NewUOrder: New U order of Srf.
NewVOrder: New V order of Srf.


Returned Value:

CagdSrfStruct *: Degree raised surface, or NULL if error.


See Also:

CagdSrfBlossomDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaise CagdSrfDegreeRaise CagdCrvBlossomDegreeRaiseN

Keywords:




CagdSrfBlossomEvalMalloc

(blossom.c:757)

Prototype:

  CagdRType *CagdSrfBlossomEvalMalloc(const CagdSrfStruct *Srf,
                                      const CagdRType *BlsmUVals,
                                      int BlsmULen,
                                      const CagdRType *BlsmVVals,
                                      int BlsmVLen)


Description:

Computes the Blossom over the given surface, Srf, and Blossoming factors BlsmU/VVals.

Parameters:

Srf: Surface to blossom.
BlsmUVals: U Blossoming values to consider.
BlsmULen: Length of BlsmUVals vector; assumed less than Srf U order!
BlsmVVals: V Blossoming values to consider.
BlsmVLen: Length of BlsmVVals vector; assumed less than Srf V order!


Returned Value:

CagdRType *: Evaluated Blossom.


See Also:

CagdSrfBlossomEvalU CagdCrvBlossomEval

Keywords:




CagdSrfBlossomEvalToData

(blossom.c:671)

Prototype:

  CagdRType *CagdSrfBlossomEvalToData(const CagdSrfStruct *Srf,
                                      const CagdRType *BlsmUVals,
                                      int BlsmULen,
                                      const CagdRType *BlsmVVals,
                                      int BlsmVLen,
                                      CagdRType *BlossomVals,
                                      void *BlsmCache)


Description:

Computes the Blossom over the given surface, Srf, and Blossoming factors BlsmU/VVals.

Parameters:

Srf: Surface to blossom.
BlsmUVals: U Blossoming values to consider.
BlsmULen: Length of BlsmUVals vector; assumed less than Srf U order!
BlsmVVals: V Blossoming values to consider.
BlsmVLen: Length of BlsmVVals vector; assumed less than Srf V order!
BlossomVals: Evaluated Blossom will be placed here.
BlsmCache: Optional cache (can be NULL) to use, as allocated by CagdBlsmEvalSymbAllocCache and freed by CagdBlsmEvalSymbFreeCache.


Returned Value:

CagdRType *: Evaluated Blossom.


See Also:

CagdSrfBlossomEvalU CagdCrvBlossomEval CagdCrvBlossomEvalMalloc

Keywords:




CagdSrfBlossomEvalU

(blossom.c:794)

Prototype:

  CagdCrvStruct *CagdSrfBlossomEvalU(const CagdSrfStruct *Srf,
                                     const CagdRType *BlsmUVals,
                                     int BlsmULen,
                                     void *BlsmCache)


Description:

Computes the Blossom over the given surface, Srf, and Blossoming factors BlsmUVals, in the U direction only. Returned is a curve in V.

Parameters:

Srf: Surface to blossom.
BlsmUVals: U Blossoming values to consider.
BlsmULen: Length of BlsmUVals vector; assumed less than Srf U order!
BlsmCache: Optional cache (can be NULL) to use, as allocated by CagdBlsmEvalSymbAllocCache and freed by CagdBlsmEvalSymbFreeCache.


Returned Value:

CagdCrvStruct *: Evaluated Blossom in U as a curve in V. This curve holds as many control points as Srf has in the V direction.


See Also:

CagdSrfBlossomEval CagdCrvBlossomEval

Keywords:




CagdSrfCopy

(cagd1gen.c:824)

Prototype:

  CagdSrfStruct *CagdSrfCopy(const 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

(cagd1gen.c:1187)

Prototype:

  CagdSrfStruct *CagdSrfCopyList(const 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_aux.c:2573)

Prototype:

  CagdSrfStruct *CagdSrfDegreeRaise(const 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


CagdSrfDegreeRaiseN

(cagd_aux.c:2611)

Prototype:

  CagdSrfStruct *CagdSrfDegreeRaiseN(const CagdSrfStruct *Srf,
                                     int NewUOrder,
                                     int NewVOrder)


Description:

Returns a new surface, identical to the original but with higher degrees, as prescribed by NewUOrder, NewVOrder.

Parameters:

Srf: To raise its degree.
NewUOrder: New U order of Srf.
NewVOrder: New V order of Srf.


Returned Value:

CagdSrfStruct *: A surface with higher degrees as prescribed by NewUOrder/NewVOrder.


See Also:

CagdSrfDegreeRaise BzrSrfDegreeRaise TrimSrfDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaiseN BspSrfDegreeRaiseN

Keywords:

degree raising


CagdSrfDerive

(cagd_aux.c:1024)

Prototype:

  CagdSrfStruct *CagdSrfDerive(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Given a surface, computes its partial derivative in the prescribed 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 SymbSrfDeriveRational CagdSrfDeriveScalar

Keywords:

derivatives partial derivatives


CagdSrfDeriveScalar

(cagd_aux.c:1069)

Prototype:

  CagdSrfStruct *CagdSrfDeriveScalar(const CagdSrfStruct *Srf,
                                     CagdSrfDirType Dir)


Description:

Given a surface, computes its partial derivative in the prescibed direction Dir of all is scalar components. For a Euclidean surface this is the same as CagdSrfDerive but for a rational surface the returned surfaces is not the vector field but simply the derivatives of all the surface's coefficients, including the weights.

Parameters:

Srf: To compute derivatives of all its components.
Dir: Direction of differentiation. Either U or V.


Returned Value:

CagdSrfStruct *: Resulting derivative.


See Also:

BzrSrfDerive BspSrfDerive SymbSrfDeriveRational CagdSrfDerive BzrSrfDeriveScalar BspSrfDeriveScalar

Keywords:

derivatives Hodograph


CagdSrfDomain

(cagd_aux.c:210)

Prototype:

  void CagdSrfDomain(const 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 CagdSrfSetDomain

Keywords:

domain parametric domain


CagdSrfEffiNrmlEval

(nrmleval.c:82)

Prototype:

  CagdVecStruct *CagdSrfEffiNrmlEval(CagdRType u,
                                     CagdRType v,
                                     CagdBType Normalize,
                                     CagdVecStruct *RetVec,
                                     void *EvalCache)


Description:

Evaluate the surface normal at the given (u, v) surface location. The normal is normalized if Normalize is TRUE. For best performance normal locations with the same U values should be invoking this function in a sequence before moving on to a different U value.

Parameters:

u, v: Parameter values of the location on the surface to compute the normal for. For efficiency, no test is made as for the validity of the (u, v) position.
Normalize: f TRUE, the normal is normalized into a unit length.
RetVec: Where the result is going to be saved.
EvalCache: Evaluation cache computed by CagdSrfEffiNrmlPrelude.


Returned Value:

CagdVecStruct *: A pointer to RetVec. An all zero vector is returned if failed to compute.


See Also:

CagdSrfNormal CagdSrfEffiNrmlPrelude CagdSrfEffiNrmlPostlude

Keywords:




CagdSrfEffiNrmlPostlude

(nrmleval.c:165)

Prototype:

  void CagdSrfEffiNrmlPostlude(void *EvalCache)


Description:

Released all data structures allocated by this efficient normal evaluation routines.

Parameters:

EvalCache: Evaluation cache computed by CagdSrfEffiNrmlPrelude to free.


Returned Value:

void


See Also:

CagdSrfNormal CagdSrfEffiNrmlEval CagdSrfEffiNrmlPrelude

Keywords:




CagdSrfEffiNrmlPrelude

(nrmleval.c:35)

Prototype:

  void *CagdSrfEffiNrmlPrelude(const CagdSrfStruct *Srf)


Description:

Do the necessary preprocessing so we can efficiently evaluate normal on Srf. For best efficiency normals with same U values should be evaluated in a sequence, before moving to the next U.

Parameters:

Srf: To preprocess for fast normal evaluations.


Returned Value:

void *: The computed cache to use.


See Also:

CagdSrfNormal CagdSrfEffiNrmlEval CagdSrfEffiNrmlPostlude

Keywords:




CagdSrfEstimateCurveness

(bzr2poly.c:1303)

Prototype:

  void CagdSrfEstimateCurveness(const CagdSrfStruct *Srf,
                                CagdRType *UCurveness,
                                CagdRType *VCurveness)


Description:

Estimate a relative surface curveness measure in U and V (no twist consideration). A flat surface (or a bilinear) would return two zeros. A highly curved surface would return values near one.

Parameters:

Srf: To consider.
UCurveness: The surface curveness in the U direction.
VCurveness: The surface curveness in the V direction.


Returned Value:

void


Keywords:




CagdSrfEval4Corners

(cagd1gen.c:2139)

Prototype:

  void CagdSrfEval4Corners(const CagdSrfStruct *Srf,
                           CagdPType P00,
                           CagdPType P01,
                           CagdPType P10,
                           CagdPType P11)


Description:

Simple function to evaluate a surface at its four corners.

Parameters:

Srf: Surface to evaluate at its four corners.
P00, P01, P10, P11: The four evaluated corners in E3.


Returned Value:

void


See Also:



Keywords:




CagdSrfEvalMalloc

(cagd_aux.c:368)

Prototype:

  CagdRType *CagdSrfEvalMalloc(const 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). This vector is allocated dynamically.


See Also:

CagdCrvEvalToData BspSrfEvalAtParamToData BzrSrfEvalAtParamToData CagdCrvEvalMalloc CagdSrfEvalToData TrimSrfEvalToData

Keywords:

evaluation


CagdSrfEvalToData

(cagd_aux.c:321)

Prototype:

  void CagdSrfEvalToData(const CagdSrfStruct *Srf,
                         CagdRType u,
                         CagdRType v,
                         CagdRType *R)


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.
R: 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).


Returned Value:

void


See Also:

CagdCrvEvalToData BspSrfEvalAtParamToData BzrSrfEvalAtParamToData BspSrfEvalAtParamToData BzrSrfEvalAtParamToData TrimSrfEvalToData

Keywords:

evaluation


CagdSrfExtensionDup

(cagd2gen.c:2322)

Prototype:

  CagdSrfStruct *CagdSrfExtensionDup(const CagdSrfStruct *Srf,
                                     CagdSrfBndryType Bndry)


Description:

Extends a closed surface by duplicating it, in desired boundary dir.

Parameters:

Srf: Surface to extend.
Bndry: One (or two - UMin/UMax or VMin/VMax together) of the four boundaries of the surface.


Returned Value:

CagdSrfStruct *: Extended surface or NULL if failed (i.e. not closed).


See Also:

BspSrfExtension

Keywords:




CagdSrfFree

(cagd2gen.c:261)

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

(cagd2gen.c:313)

Prototype:

  void CagdSrfFreeList(CagdSrfStruct *SrfList)


Description:

Deallocates and frees a surface structure list:

Parameters:

SrfList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdSrfFromCrvs

(cagdcsrf.c:142)

Prototype:

  CagdSrfStruct *CagdSrfFromCrvs(const CagdCrvStruct *CrvList,
                                 int OtherOrder,
                                 CagdEndConditionType OtherEC,
                                 IrtRType *OtherParamVals)


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. If OtherOrder is negative, the absolute value is employed and a periodic surface is constructed in the other direction. A knot vector is formed with OtherEC end conditions for the other direction Note, however, that only the first and the last curves are interpolated if open end conditions are selected and OtherOrder is greater than 2.

Parameters:

CrvList: List of curves to consturct a surface with.
OtherOrder: Other order of surface.
OtherEC: End condition in the other (non CrvList) srf direction.
OtherParamVals: f not NULL, updated with other direction set parameters of the curves in the new surfaces.


Returned Value:

CagdSrfStruct *: Constructed surface from curves.


See Also:

CagdSrfInterpolateCrvs

Keywords:

surface constructors


CagdSrfFromNBndryCrvs

(cagdbsum.c:797)

Prototype:

  CagdSrfStruct *CagdSrfFromNBndryCrvs(const CagdCrvStruct *Crvs,
                                       CagdBType MinimizeSize)


Description:

Builds tensor product surfaces that spans the given list of surface boundary curves in one closed loop. Can be 1 to 6 input boundary curves, and 1 to 2 surfaces are returned.

Parameters:

Crvs: To build 1/2 surfaces with these curves as boundaries.
MinimizeSize: If true, minimize the size of the output, on expense of accuracy. N


Returned Value:

CagdSrfStruct *: One or two planar surfaces spanning the curves.


See Also:

CagdReorderCurvesInLoop

Keywords:




CagdSrfIntegrate

(cagd_aux.c:1108)

Prototype:

  CagdSrfStruct *CagdSrfIntegrate(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Given a surface, compute its integral surface.

Parameters:

Srf: To compute its integral surface.
Dir: Direction of integration. Either U or V.


Returned Value:

CagdSrfStruct *: Resulting integral surface.


See Also:

BzrSrfIntegrate BspSrfIntegrate

Keywords:

integrals


CagdSrfInterpolateCrvs

(cagdcsrf.c:289)

Prototype:

  CagdSrfStruct *CagdSrfInterpolateCrvs(const CagdCrvStruct *CrvList,
                                        int OtherOrder,
                                        CagdEndConditionType OtherEC,
                                        CagdParametrizationType OtherParam,
                                        IrtRType *OtherParamVals)


Description:

Constructs a surface using a set of curves. Curves are made to be compatible and then interpolated by the created surfaces. If the OtherOrder is less than the number of curves, number of curves is used. If OtherOrder is negative, the absolute value is employed and a periodic surface is constructed in the other direction. A knot vector is formed with OtherEC end conditions for the other direction.

Parameters:

CrvList: List of curves to consturct a surface with.
OtherOrder: Other order of surface.
OtherEC: End condition in the other (non CrvList) srf direction.
OtherParam: Currently only Chord length and uniform are supported.
OtherParamVals: f not NULL, updated with other direction set parameters of the curves in the new surfaces.


Returned Value:

CagdSrfStruct *: Constructed surface from curves.


See Also:

CagdSrfFromCrvs CagdSrfInterpolateCrvsChordLenParams

Keywords:

surface constructors interpolation


CagdSrfInterpolateCrvsChordLenParams

(cagdcsrf.c:214)

Prototype:

  CagdRType *CagdSrfInterpolateCrvsChordLenParams(const CagdCrvStruct *CrvList)


Description:

Computes parameters to interpolate the given curves at, as a surface. Estimate a middle point from each curve and set parameters based on chord length from each middle point to the next.

Parameters:

CrvList: List of curves to consturct a surface with.


Returned Value:

CagdRType *: Vectors of parameters normalized to [0, 1] of parameters, of size of number of curves, allocated dynamically.


See Also:

CagdSrfFromCrvs CagdSrfInterpolateCrvs CagdSrfInterpolateCrvs

Keywords:

surface constructors


CagdSrfIsConstant

(cagdbbox.c:326)

Prototype:

  CagdBType CagdSrfIsConstant(const CagdSrfStruct *Srf, IrtRType Eps)


Description:

Checks if this surface is a constant surface.

Parameters:

Srf: To check if constant or not.
Eps: Tolerance of equality allowed.


Returned Value:

CagdBType: TRUE if indeed a constant(s) valued surface.


See Also:

CagdSrfBBox CagdCrvIsConstant

Keywords:

bbox bounding box


CagdSrfIsCoplanarCtlMesh

(cagd2ply.c:491)

Prototype:

  CagdRType CagdSrfIsCoplanarCtlMesh(const CagdSrfStruct *Srf)


Description:

evaluate the coplanarity of the control mesh for a given surface. Constructs a plane from the four corner points, if possible, and measure distance to rest of control points.

Parameters:

Srf: Surface to test for flatness of its control mesh.


Returned Value:

CagdRType: A bound on the distance between the control points and the plane fitted to the four corners.


See Also:

CagdSrfAdap2Polygons CagdSrfAdap2PolyDefErrFunc

Keywords:




CagdSrfIsLinearBndryCtlMesh

(cagd2ply.c:455)

Prototype:

  CagdRType CagdSrfIsLinearBndryCtlMesh(const CagdSrfStruct *Srf)


Description:

Evaluate the linearity of the boundary of the control mesh for a given surface. Constructs a line for each boundary, if possible, and measure distance to rest of control points on that boundary.

Parameters:

Srf: Surface to test for linearity of of its control mesh's boundary.


Returned Value:

CagdRType: A bound on the distance between the control mesh boundary and a linear rectangle connecting the four corners.


See Also:

CagdSrfAdap2Polygons CagdSrfAdap2PolyDefErrFunc

Keywords:




CagdSrfIsLinearCtlMesh

(cagd2ply.c:414)

Prototype:

  CagdRType CagdSrfIsLinearCtlMesh(const CagdSrfStruct *Srf, CagdBType Interior)


Description:

Evaluate the linearity of the control mesh for a given surface. Constructs a line for each row/col, if possible, and measure distance to rest of control points on that row/col.

Parameters:

Srf: Surface to test for linearity of its control mesh's boundary.
Interior: TRUE to handle interior rows/columns only. FALSE to check Boundary as well.


Returned Value:

CagdRType: A bound on the distance between the control mesh boundary and a linear rectangle connecting the four corners.


See Also:

CagdSrfAdap2Polygons CagdSrfAdap2PolyDefErrFunc CagdSrfIsLinearBndryCtlMesh CagdSrfIsLinearCtlMeshOneRowCol

Keywords:




CagdSrfIsLinearCtlMeshOneRowCol

(cagd2ply.c:332)

Prototype:

  CagdRType CagdSrfIsLinearCtlMeshOneRowCol(const CagdSrfStruct *Srf,
                                            int Idx,
                                            CagdSrfDirType Dir)


Description:

Evaluate the linearity of the control mesh for a given surface, along ne row or column. Constructs a line through the two end points and measure distance to rest of control points on that row/col.

Parameters:

Srf: Surface to test for linearity of its control mesh's row/col.
Idx: Of row/column.
Dir: A row or column specification.


Returned Value:

CagdRType: A bound on the distance between the control points on the row/col and the line through end points of that row/column.


See Also:

CagdSrfAdap2Polygons CagdSrfAdap2PolyDefErrFunc CagdSrfIsLinearBndryCtlMesh CagdSrfIsLinearCtlMesh

Keywords:




CagdSrfIsPtIndexBoundary

(cagd1gen.c:2731)

Prototype:

  CagdSrfBndryType CagdSrfIsPtIndexBoundary(CagdSrfStruct *Srf, int PtIdx)


Description:

Checks if the given control point index (in the Points vector of control points in CagdSrfStruct) is of a boundary control point.

Parameters:

Srf: Surface to examine if PtIdx is of a boundary control point.
PtIdx: Index into Points vectors to examine if of a boundary point.


Returned Value:

CagdSrfBndryType: Boundary type, or CAGD_NO_BNDRY if interior.


Keywords:




CagdSrfListBBox

(cagdbbox.c:260)

Prototype:

  CagdBBoxStruct *CagdSrfListBBox(const 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:

CagdBBoxStruct *: BBox


See Also:

CagdCrvBBox CagdSrfBBox CagdPolygonListBBox GMBBSetBBoxPrecise

Keywords:

bbox bounding box


CagdSrfListMatTransform

(cagd2gen.c:1725)

Prototype:

  CagdSrfStruct *CagdSrfListMatTransform(const CagdSrfStruct *Srfs,
                                         CagdMType Mat)


Description:

Applies an homogeneous transformation, to the given list of surfaces Srfs as specified by homogeneous transformation Mat.

Parameters:

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


Returned Value:

CagdSrfStruct *: Returned transformed surfaces.


See Also:

CagdTransform CagdSrfMatTransform CagdMatTransform CagdSrfMatTransform

Keywords:

scaling rotation translation transformations


CagdSrfMakeBoundryIndexUMin

(cagd_aux.c:3773)

Prototype:

  CagdSrfStruct *CagdSrfMakeBoundryIndexUMin(const CagdSrfStruct *Srf,
                                             int BndryIdx)


Description:

Reverse the surface so the boundary index (0,..,3) for (UMin, UMax, VMin VMax) will become the UMin boundary.

Parameters:

Srf: Surface to reverse.
BndryIdx: oundary index, between 0 to 3 as (UMin, UMax, VMin, VMax)


Returned Value:

CagdSrfStruct *: Properly reversed surface, NULL if error.


See Also:

CagdSrfReverse CagdSrfReverse2 CagdSrfReverseDir

Keywords:




CagdSrfMatTransform

(cagd2gen.c:1661)

Prototype:

  CagdSrfStruct *CagdSrfMatTransform(const CagdSrfStruct *Srf,
                                     CagdMType Mat)


Description:

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

Parameters:

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


Returned Value:

CagdSrfStruct *: Returned transformed surface.


See Also:

CagdTransform CagdCrvMatTransform CagdMatTransform CagdSrfListMatTransform

Keywords:

scaling rotation translation transformations


CagdSrfMinMax

(cagdbbox.c:896)

Prototype:

  void CagdSrfMinMax(const 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


See Also:

CagdSrfAverageValue CagdPointsBBox CagdCrvMinMax

Keywords:

bbox bounding box minimum maximum


CagdSrfMoebiusTransform

(cagd_aux.c:1155)

Prototype:

  CagdSrfStruct *CagdSrfMoebiusTransform(const CagdSrfStruct *Srf,
                                         CagdRType c,
                                         CagdSrfDirType Dir)


Description:

Given a surface, compute its moebius transformation.

Parameters:

Srf: Surface to apply the Moebius transformation to.
c: The scaling coefficient - c^n is the ratio between the first and last weight of the surface, along each row or column. If c == 0, the first and last weights are made equal, in the first row/column.
Dir: Direction to apply the Moebius transformation, row or col. If Dir == CAGD_BOTH_DIR, the transformation is applied to both the row and column directions, in this order.


Returned Value:

CagdSrfStruct *: Resulting surface after the moebius transformation.


See Also:

BzrSrfMoebiusTransform BspSrfMoebiusTransform

Keywords:

moebius transformation


CagdSrfNew

(cagd1gen.c:151)

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

(bsp_knot.c:1730)

Prototype:

  CagdRType *CagdSrfNodes(const 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


CagdSrfNormalMalloc

(cagd_aux.c:3436)

Prototype:

  CagdVecStruct *CagdSrfNormalMalloc(const 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 vector holding the unit normal information.


See Also:

BzrSrfNormal BspSrfNormal SymbSrfNormalSrf TrngTriSrfNrml pSrfMeshNormals

Keywords:

normal


CagdSrfNormalToData

(cagd_aux.c:3395)

Prototype:

  CagdVecStruct *CagdSrfNormalToData(const CagdSrfStruct *Srf,
                                     CagdRType u,
                                     CagdRType v,
                                     CagdBType Normalize,
                                     CagdVecStruct *Normal)


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.
Normal: A pointer to a vector holding the unit normal information.


Returned Value:

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


See Also:

BzrSrfNormal BspSrfNormal SymbSrfNormalSrf TrngTriSrfNrml pSrfMeshNormals

Keywords:

normal


CagdSrfPtCopy

(cagd1gen.c:962)

Prototype:

  CagdSrfPtStruct *CagdSrfPtCopy(const CagdSrfPtStruct *Pt)


Description:

Allocates and copies all slots of a surface Pt structure.

Parameters:

Pt: To be copied.


Returned Value:

CagdSrfPtStruct *: A duplicate of SrfPt.


Keywords:

copy


CagdSrfPtCopyList

(cagd1gen.c:1274)

Prototype:

  CagdSrfPtStruct *CagdSrfPtCopyList(const CagdSrfPtStruct *SrfPtList)


Description:

Allocates and copies a list of surface point structures.

Parameters:

SrfPtList: To be copied.


Returned Value:

CagdSrfPtStruct *: A duplicated list of points.


Keywords:

copy


CagdSrfPtFree

(cagd2gen.c:455)

Prototype:

  void CagdSrfPtFree(CagdSrfPtStruct *SrfPt)


Description:

Deallocates and frees all slots of a point structure.

Parameters:

SrfPt: To be deallocated.


Returned Value:

void


Keywords:

free


CagdSrfPtFreeList

(cagd2gen.c:478)

Prototype:

  void CagdSrfPtFreeList(CagdSrfPtStruct *SrfPtList)


Description:

Deallocates and frees a point structure list:

Parameters:

SrfPtList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdSrfPtNew

(cagd1gen.c:347)

Prototype:

  CagdSrfPtStruct *CagdSrfPtNew(void)


Description:

Allocates and resets all slots of a Surface Pt structure.

Parameters:

None


Returned Value:

CagdSrfPtStruct *: A surface Pt structure.


Keywords:

allocation


CagdSrfRefineAtParams

(cagd_aux.c:3071)

Prototype:

  CagdSrfStruct *CagdSrfRefineAtParams(const 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 B-spline 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_aux.c:2943)

Prototype:

  CagdSrfStruct *CagdSrfRegionFromSrf(const 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


CagdSrfRegionFromSrf2

(cagd_aux.c:3030)

Prototype:

  CagdSrfStruct *CagdSrfRegionFromSrf2(const CagdSrfStruct *Srf,
                                       CagdRType UMin,
                                       CagdRType UMax,
                                       CagdRType VMin,
                                       CagdRType VMax)


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.
UMin, UMax, VMin, VMax: Parametric domain boundaries of sub-region.


Returned Value:

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


Keywords:

regions subdivision


CagdSrfReverse

(cagd_aux.c:3591)

Prototype:

  CagdSrfStruct *CagdSrfReverse(const CagdSrfStruct *Srf)


Description:

Returns a new surface that is the reversed surface of Srf by reversing the control mesh and the knot vector (if B-spline 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 CagdSrfReverseDir

Keywords:

reverse


CagdSrfReverse2

(cagd_aux.c:3706)

Prototype:

  CagdSrfStruct *CagdSrfReverse2(const 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 CagdSrfReverseDir CagdSrfMakeBoundryIndexUMin

Keywords:

reverse


CagdSrfReverseDir

(cagd_aux.c:3615)

Prototype:

  CagdSrfStruct *CagdSrfReverseDir(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

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

Parameters:

Srf: To be reversed.
Dir: Direction to reverse the Mesh along. Either U or V.


Returned Value:

CagdSrfStruct *: Reversed surface of Srf.


See Also:

CagdSrfReverse CagdSrfReverse2 CagdSrfMakeBoundryIndexUMin

Keywords:

reverse


CagdSrfScale

(cagd2gen.c:1311)

Prototype:

  void CagdSrfScale(CagdSrfStruct *Srf, const CagdRType *Scale)


Description:

Applies a nonuniform scaling transform, in place, to given Srf as specified by Scale.

Parameters:

Srf: To be non-uniformly scaled.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdCrvTransform CagdTransform CagdSrfMatTransform CagdSrfTransform

Keywords:

scaling transformations


CagdSrfScaleCenter

(cagd2gen.c:1348)

Prototype:

  void CagdSrfScaleCenter(CagdSrfStruct *Srf, const CagdRType *Scale)


Description:

Applies a nonuniform scaling transform, in place, to given Srf as specified by Scale.

Parameters:

Srf: To be non-uniformly scaled.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdCrvTransform CagdTransform CagdSrfMatTransform CagdSrfTransform CagdSrfScale

Keywords:

scaling transformations


CagdSrfSetDomain

(cagd_aux.c:253)

Prototype:

  CagdSrfStruct *CagdSrfSetDomain(CagdSrfStruct *Srf,
                                  CagdRType UMin,
                                  CagdRType UMax,
                                  CagdRType VMin,
                                  CagdRType VMax)


Description:

Affinely set the parametric domain of a surface, in place.

Parameters:

Srf: To set its parametric domain.
UMin: Minimal domain's new U boundary.
UMax: Maximal domain's new U boundary.
VMin: Minimal domain's new V boundary.
VMax: Maximal domain's new V boundary.


Returned Value:

CagdSrfStruct *: Modified surface, in place.


See Also:

BspSrfDomain BspKnotAffineTrans2 CagdCrvSetDomain CagdSrfDomain

Keywords:

domain parametric domain


CagdSrfSetMakeOnlyTri

(cagd2gen.c:2488)

Prototype:

  CagdBType CagdSrfSetMakeOnlyTri(CagdBType OnlyTri)


Description:

Sets a flag to control if only triangles are to be generated from the tesselation code. If TRUE only triangular polygons will be in the output set

Parameters:

OnlyTri: TRUE for triangles only, FALSE otherwise.


Returned Value:

CagdBType: Old value of flag.


See Also:

CagdSrfSetMakeRectFunc CagdSrf2Polygons CagdSrfAdap2Polygons CagdMakeTriangle CagdSrfSetMakeTriFunc

Keywords:




CagdSrfSetMakeRectFunc

(cagd2gen.c:2456)

Prototype:

  CagdSrfMakeRectFuncType CagdSrfSetMakeRectFunc(CagdSrfMakeRectFuncType Func)


Description:

Sets the call back function to generate rectangles. The function will be invoked with each rectangle in the polygonal approximation. Default call back function used is IPSetRectangle.

Parameters:

Func: New function to use, NULL to disable.


Returned Value:

CagdSrfMakeRectFuncType: Old value of function.


See Also:

CagdSrfSetMakeTriFunc CagdSrf2Polygons CagdSrfAdap2Polygons IPSetRectangle CagdSrfSetMakeOnlyTri

Keywords:




CagdSrfSetMakeTriFunc

(cagd2gen.c:2424)

Prototype:

  CagdSrfMakeTriFuncType CagdSrfSetMakeTriFunc(CagdSrfMakeTriFuncType Func)


Description:

Sets the call back function to generate triangles. The function will be invoked with each triangle in the polygonal approximation. Default call back function used is CagdMakeTriangle.

Parameters:

Func: New function to use, NULL to disable.


Returned Value:

CagdSrfMakeTriFuncType: Old value of function.


See Also:

CagdSrfSetMakeRectFunc CagdSrf2Polygons CagdSrfAdap2Polygons CagdMakeTriangle CagdSrfSetMakeOnlyTri

Keywords:




CagdSrfSrfMakeJoinMatch

(cagdsmrg.c:722)

Prototype:

  CagdBType CagdSrfSrfMakeJoinMatch(CagdSrfStruct **Srf1,
                                    CagdSrfStruct **Srf2,
                                    CagdSrfDirType Dir,
                                    CagdRType Tolerance,
                                    CagdBType PreserveOrientation)


Description:

If Srf1 and Srf2 (approximately) share a boundary in the given direction, then the shared boundary curve of each surface is updated to the average of both boundary curves, so the two surfaces will meet precisecely. This function assumes Srf1 and Srf2 have the same lengthesand orders.

Parameters:

Srf1: To modify its end to meet Srf2's starting location, in place.
Srf2: To modify its end to meet Srf1's starting location, in place.
Dir: The direction of the boundary curves to be matched.
Tolerance: To consider two points the same.
PreserveOrientation: If false, Srf1 and Srf2 will be reversed as needed to ensure that the end curve of Srf1 is the same as the initial curve of Srf2 in the given direction. Otherwise, the surfaces' won't be reversed.


Returned Value:

CagdBType: TRUE if matching has been done succesfully.


Keywords:

match


CagdSrfSubdivAtAllC0Discont

(cagd_aux.c:2363)

Prototype:

  CagdSrfStruct *CagdSrfSubdivAtAllC0Discont(const CagdSrfStruct *Srf)


Description:

Subdivides the surface at all C^0 potential discontinuity locations.

Parameters:

Srf: To subdivide at all C^0 discontinuity locations.


Returned Value:

CagdSrfStruct *: Surfaces that result from the subdivision.


See Also:

CagdSrfSubdivAtParams BspKnotAllC1Discont CagdSrfsSubdivAtAllC0Discont BspSrfsSubdivAtAllDetectedLocations CagdSrfsSubdivAtAllC1Discont CagdSrfsSubdivAtAllC0Discont

Keywords:




CagdSrfSubdivAtAllC1Discont

(cagd_aux.c:2419)

Prototype:

  CagdSrfStruct *CagdSrfSubdivAtAllC1Discont(const CagdSrfStruct *Srf)


Description:

Subdivides the surface at all C^1 potential discontinuity locations.

Parameters:

Srf: To subdivide at all C^1 discontinuity locations.


Returned Value:

CagdSrfStruct *: Surfaces that result from the subdivision.


See Also:

CagdSrfSubdivAtParams BspKnotAllC1Discont CagdSrfSubdivAtAllC0Discont BspSrfsSubdivAtAllDetectedLocations CagdSrfsSubdivAtAllC1Discont

Keywords:




CagdSrfSubdivAtAllCnDiscont

(cagd_aux.c:2474)

Prototype:

  CagdSrfStruct *CagdSrfSubdivAtAllCnDiscont(const CagdSrfStruct *Srf, int n)


Description:

Subdivides a surface at all C^n potential discontinuity locations.

Parameters:

Srf: To subdivide at all C^n discontinuity locations.
n: Level of discontinuity to consider.


Returned Value:

CagdSrfStruct *: A list Surfaces that result from the subdivision.


See Also:

CagdSrfsSubdivAtAllC0Discont CagdSrfsSubdivAtAllC1Discont

Keywords:




CagdSrfSubdivAtParam

(cagd_aux.c:2908)

Prototype:

  CagdSrfStruct *CagdSrfSubdivAtParam(const 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


CagdSrfSubdivAtPoles

(cagd_aux.c:2520)

Prototype:

  CagdSrfStruct *CagdSrfSubdivAtPoles(const CagdSrfStruct *Srf, CagdRType Tol)


Description:

Given a surface - subdivides it at domain with poles (zero deniminator). Subdivision will terminate either when the domain size is smaller than Tol or the current patch has only positive (or only negative weights). Patches with whole negative weights are scaled by -1, and an attribute "NegPoles" is attached to them.

Parameters:

Srf: To subdivide at all poles.
Tol: Domain size to subdive to this tolerance.


Returned Value:

CagdSrfStruct *: A list of surface patches with only positive weights.


See Also:

CagdCrvSubdivAtParams CagdCrvSubdivAtPoles

Keywords:

subdivision


CagdSrfTangentToData

(cagd_aux.c:3351)

Prototype:

  CagdVecStruct *CagdSrfTangentToData(const CagdSrfStruct *Srf,
                                      CagdRType u,
                                      CagdRType v,
                                      CagdSrfDirType Dir,
                                      CagdBType Normalize,
                                      CagdVecStruct *Tan)


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: The OTHER direction (for historic reasons...) of tangent vector. Either U or V.
Normalize: f TRUE, attempt is made to normalize the returned vector. If FALSE, length is a function of given parametrization.
Tan: A pointer to a vector holding the unit tangent information.


Returned Value:

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


See Also:

BzrSrfTangent BspSrfTangent

Keywords:

tangent


CagdSrfTransform

(cagd2gen.c:1271)

Prototype:

  void CagdSrfTransform(CagdSrfStruct *Srf,
                        const 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:

Srf: To be affinely transformed.
Translate: Translation amount, NULL for non.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdCrvTransform CagdTransform CagdSrfMatTransform

Keywords:

scaling translation transformations


CagdSrfUVDirOrthoE3Malloc

(cagd_aux.c:3565)

Prototype:

  CagdUVType *CagdSrfUVDirOrthoE3Malloc(const CagdSrfStruct *Srf,
                                        const CagdUVType *UV,
                                        const CagdUVType *UVDir)


Description:

Computes a new parametric direction OrthoUVDir that is orthogonal, in Euclidean space, to given parametric UVDir at parametric position UV of Srf. Clearly both Srf(OrthoUVDir) and Srf(UVDir) are in the tangent space.

Parameters:

Srf: Surface to compute orthogonal direction to, in its tangent plane.
UV: Location on Srf where to compute the orthogonal direction.
UVDir: irection to compute its orthogonal direction in Euclidean space.


Returned Value:

CagdUVType *: UV direction that is orthogonal to UVDir, in Euclidean space, allocated dynamically. NULL, if error.


Keywords:




CagdSrfUVDirOrthoE3ToData

(cagd_aux.c:3468)

Prototype:

  CagdUVType *CagdSrfUVDirOrthoE3ToData(const CagdSrfStruct *Srf,
                                        const CagdUVType *UV,
                                        const CagdUVType *UVDir,
                                        CagdUVType *OrthoUVDir)


Description:

Computes a new parametric direction OrthoUVDir that is orthogonal, in Eculidean space, to given parametric UVDir at parametric position UV of Srf. Clearly both Srf(OrthoUVDir) and Srf(UVDir) are in the tangent space.

Parameters:

Srf: Surface to compute orthogonal direction to, in its tangent plane.
UV: Location on Srf where to compute the orthogonal direction.
UVDir: irection to compute its orthogonal direction in Euclidean space.
OrthoUVDir: UV direction that is orthogonal to UVDir, in Euclidean space.


Returned Value:

CagdUVType *: UV direction that is orthogonal to UVDir, in Euclidean space. NULL, if error.


Keywords:




CagdSrfUnitMaxCoef

(cagd2gen.c:1956)

Prototype:

  CagdSrfStruct *CagdSrfUnitMaxCoef(CagdSrfStruct *Srf)


Description:

Normalize in place the given surface so its maximal coefficient is of unit size. Each axis is treated independently, including W.

Parameters:

Srf: urface to normalize in place its coefficients.


Returned Value:

CagdSrfStruct *: Normalized surface, in place.


See Also:

CagdCrvUnitMaxCoef

Keywords:




CagdSrfUpdateLength

(cagd1gen.c:2638)

Prototype:

  CagdSrfStruct *CagdSrfUpdateLength(CagdSrfStruct *Srf,
                                     int NewLength,
                                     CagdSrfDirType Dir)


Description:

Resize the mesh length of the surface, in place. The new surface is not the same as the original while a minimal effort is invested to keep the surface similar.

Parameters:

Srf: Surface to update its mesh length.
NewLength: New length to reallocate for the surface.
Dir: Direction to resize the mesh length, U or V.


Returned Value:

CagdSrfStruct *: Resized surface, in place.


See Also:

CagdCrvUpdateLength

Keywords:




CagdSrfsSame

(cagd1gen.c:2287)

Prototype:

  CagdBType CagdSrfsSame(const CagdSrfStruct *Srf1,
                         const CagdSrfStruct *Srf2,
                         CagdRType Eps)


Description:

Compare the two lists of surfaces for similarity.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if surfaces are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdSrfsSame2 CagdSrfsSame3 CagdSrfsSame4 CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSameCorners CagdSrfsSameFuncSpace

Keywords:




CagdSrfsSame2

(cagd1gen.c:2354)

Prototype:

  CagdBType CagdSrfsSame2(const CagdSrfStruct *Srf1,
                          const CagdSrfStruct *Srf2,
                          CagdRType Eps,
                          int *Modified)


Description:

Compare the two surfaces for similarity, after bringing them to a common function space, by degree raising and refinement.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Eps: Tolerance of equality.
Modified: 0 if no surface was refined/degree raised, 1 if Srf1 was refined/degree raised, 2 if Srf2 was refined/degree raised, 3 if both Srf1 and Srf2 were refined/degree raised. This parameter is optional and can be NULL.


Returned Value:

CagdBType: TRUE if surfaces are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdSrfsSame3 CagdSrfsSame4 CagdSrfsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSameCorners

Keywords:




CagdSrfsSame3

(cagd1gen.c:2410)

Prototype:

  CagdBType CagdSrfsSame3(const CagdSrfStruct *Srf1,
                          const CagdSrfStruct *Srf2,
                          CagdRType Eps,
                          int *Modified)


Description:

Compare the two surfaces for similarity, after bringing them to a common function space, by degree raising and refinement, and UV reversing.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Eps: Tolerance of equality.
Modified: 0x00 if no surface was refined/degree raised, 0x01 if Srf1 was refined/degree raised, 0x02 if Srf2 was refined/degree raised, 0x03 if both Srf1 and Srf2 were refined/degree raised. 0x10 if Srf2 was reversed in U 0x20 if Srf2 was reversed in V 0x30 if Srf2 was reversed in U and in V 0x80 if Srf2 was flipped in U with V This parameter is optional and can be NULL.


Returned Value:

CagdBType: TRUE if surfaces are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdSrfsSame2 CagdSrfsSame4 CagdSrfsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSameCorners

Keywords:




CagdSrfsSame4

(cagd1gen.c:2465)

Prototype:

  CagdBType CagdSrfsSame4(const CagdSrfStruct *Srf1,
                          const CagdSrfStruct *Srf2,
                          CagdRType Eps,
                          int *Modified)


Description:

Compare the two surfaces for similarity, after bringing them to a common function space, by degree raising and refinement, and UV reversing.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Eps: Tolerance of equality.
Modified: 0x00 if no surface was refined/degree raised, 0x01 if Srf1 was refined/degree raised, 0x02 if Srf2 was refined/degree raised, 0x03 if both Srf1 and Srf2 were refined/degree raised. 0x10 if Srf2 was reversed in U 0x20 if Srf2 was reversed in V 0x30 if Srf2 was reversed in U and in V 0x80 if Srf2 was flipped in U with V This parameter is optional and can be NULL.


Returned Value:

CagdBType: TRUE if surfaces are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdSrfsSame CagdSrfsSame2 CagdSrfsSame3 CagdSrfsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSameCorners

Keywords:




CagdSrfsSameCorners

(cagd1gen.c:2041)

Prototype:

  CagdBType CagdSrfsSameCorners(const CagdSrfStruct *Srf1,
                                const CagdSrfStruct *Srf2,
                                CagdRType Eps)


Description:

Compare the four corners of the given two surfaces for similarity.

Parameters:

Srf1, Srf2: The two surfaces to compare their four corners.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if surfaces share the same corners, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdSrfsSame2 CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSame

Keywords:




CagdSrfsSameFuncSpace

(cagd1gen.c:2240)

Prototype:

  CagdBType CagdSrfsSameFuncSpace(const CagdSrfStruct *Srf1,
                                  const CagdSrfStruct *Srf2,
                                  CagdRType Eps)


Description:

Compare the two surfaces for similarity of their function space.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if surfaces are in same function space, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdSrfsSame2 CagdCrvsSameUptoRigidScl2D CagdSrfsSameUptoRigidScl2D CagdSrfsSameCorners CagdSrfsSame

Keywords:




CagdSrfsSameUptoRigidScl2D

(cagd1gen.c:2001)

Prototype:

  CagdBType CagdSrfsSameUptoRigidScl2D(const CagdSrfStruct *Srf1,
                                       const CagdSrfStruct *Srf2,
                                       IrtPtType Trans,
                                       CagdRType *Rot,
                                       CagdRType *Scl,
                                       CagdRType Eps)


Description:

Compare the two lists of surfaces for similarity up to rigid motion and scale in the XY plane.

Parameters:

Srf1, Srf2: The two surfaces to compare.
Trans: Translation amount to apply to Srf1 to bring to Srf2 (after rotation/scale).
Rot, Scl: Rotation and scale amounts to apply to Srf1 to bring to Srf2 (before translation). Rot is specified in degrees.
Eps: Tolerance of equality.


Returned Value:

CagdBType: TRUE if surfaces are the same, FALSE otherwise.


See Also:

CagdCtlMeshsSame BspKnotVectorsSame CagdCrvsSame CagdCrvsSameUptoRigidScl2D

Keywords:




CagdSrfsSubdivAtAllC0Discont

(cagd_aux.c:2396)

Prototype:

  CagdSrfStruct *CagdSrfsSubdivAtAllC0Discont(const CagdSrfStruct *Srfs)


Description:

Subdivides the given list of surfaces at all C^0 potential discontinuity locations.

Parameters:

Srfs: To subdivide at all C^0 discontinuity locations.


Returned Value:

CagdSrfStruct *: Surfaces that result from the subdivision.


See Also:

CagdSrfSubdivAtParams BspKnotAllC1Discont CagdSrfsSubdivAtAllC1Discont BspSrfsSubdivAtAllDetectedLocations CagdSrfSubdivAtAllC0Discont

Keywords:




CagdSrfsSubdivAtAllC1Discont

(cagd_aux.c:2452)

Prototype:

  CagdSrfStruct *CagdSrfsSubdivAtAllC1Discont(const CagdSrfStruct *Srfs)


Description:

Subdivides the given list of surfaces at all C^1 potential discontinuity locations.

Parameters:

Srfs: To subdivide at all C^1 discontinuity locations.


Returned Value:

CagdSrfStruct *: Surfaces that result from the subdivision.


See Also:

CagdSrfSubdivAtParams BspKnotAllC1Discont CagdSrfsSubdivAtAllC0Discont BspSrfsSubdivAtAllDetectedLocations CagdSrfSubdivAtAllC1Discont

Keywords:




CagdStructOnceCoercePointsTo

(cagdcoer.c:621)

Prototype:

  VoidPtr CagdStructOnceCoercePointsTo(CagdRType * const *OldPoints,
                                       const VoidPtr OldStruct,
                                       int OldStructLen,
                                       int ExtraMem,
                                       int PtsLen,
                                       CagdPointType OldPType,
                                       CagdPointType NewPType)


Description:

Coerces an array of vectors of points of point type OldPType to point type NewPType, while duplicating the parent's structure.

Parameters:

OldPoints: Where the old points in OldStruct are placed.
OldStruct: A pointer to the original structure hold Points.
OldStructLen: Sizeof OldStruct structure.
ExtraMem: Do we seek to allocate extra memory at the end?
PtsLen: 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:

VoidPtr: A duplicated parent structure with new point types.


Keywords:

coercion


CagdSurfaceRev

(cagdsrev.c:47)

Prototype:

  CagdSrfStruct *CagdSurfaceRev(const CagdCrvStruct *CCrv)


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:

CCrv: To create surface of revolution around Z with.


Returned Value:

CagdSrfStruct *: Surface of revolution.


See Also:

CagdSurfaceRev2 CagdSurfaceRevAxis CagdSurfaceRev2Axis CagdSurfaceRevPolynomialApprox

Keywords:

surface of revolution surface constructors


CagdSurfaceRev2

(cagdsrev.c:218)

Prototype:

  CagdSrfStruct *CagdSurfaceRev2(const CagdCrvStruct *Crv,
                                 CagdBType PolyApprox,
                                 CagdRType StartAngle,
                                 CagdRType EndAngle)


Description:

Constructs a surface of revolution around the Z axis of the given profile curve from StartAngle to EndAngle. 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.
PolyApprox: RUE for a polynomial approximation, FALSE for a precise rational construction.
StartAngle: tarting Angle to consider rotating Crv from, in degrees.
EndAngle: Terminating Angle to consider rotating Crv from, in degrees.


Returned Value:

CagdSrfStruct *: Surface of revolution.


See Also:

CagdSurfaceRev CagdSurfaceRevAxis CagdSurfaceRev2Axis CagdSurfaceRevPolynomialApprox

Keywords:

surface of revolution surface constructors


CagdSurfaceRev2Axis

(cagdsrev.c:301)

Prototype:

  CagdSrfStruct *CagdSurfaceRev2Axis(const CagdCrvStruct *Crv,
                                     CagdBType PolyApprox,
                                     CagdRType StartAngle,
                                     CagdRType EndAngle,
                                     const CagdVType Axis)


Description:

Constructs a surface of revolution around vector Axis of the given profile curve from StartAngle to EndAngle. 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 Axis.
PolyApprox: RUE for a polynomial approximation, FALSE for a precise rational construction.
StartAngle: tarting Angle to consider rotating Crv from, in degrees.
EndAngle: Terminating Angle to consider rotating Crv from, in degrees.
Axis: Of rotation of Crv. This axis is always through the origin.


Returned Value:

CagdSrfStruct *: Surface of revolution.


See Also:

CagdSurfaceRev CagdSurfaceRev2 CagdSurfaceRev2Axis CagdSurfaceRevPolynomialApprox

Keywords:

surface of revolution surface constructors


CagdSurfaceRevAxis

(cagdsrev.c:166)

Prototype:

  CagdSrfStruct *CagdSurfaceRevAxis(const CagdCrvStruct *Crv, CagdVType Axis)


Description:

Constructs a surface of revolution around vector Axis of the given profile curve. Resulting surface will be a B-spline surface, while input may be either a B-spline or a Bezier curve.

Parameters:

Crv: To create surface of revolution around Axis.
Axis: Of rotation of Crv. This axis is always through the origin.


Returned Value:

CagdSrfStruct *: Surface of revolution.


See Also:

CagdSurfaceRev CagdSurfaceRev2 CagdSurfaceRev2Axis CagdSurfaceRevPolynomialApprox

Keywords:

surface of revolution surface constructors


CagdSurfaceRevPolynomialApprox

(cagdsrev.c:350)

Prototype:

  CagdSrfStruct *CagdSurfaceRevPolynomialApprox(const 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. Crv is assumed planar in a plane holding the Z axis.


Returned Value:

CagdSrfStruct *: Surface of revolution approximation.


See Also:

CagdSurfaceRev CagdSurfaceRev2 CagdSurfaceRevAxis CagdSurfaceRev2Axis

Keywords:

surface of revolution surface constructors


CagdSweepAxisRefine

(cagdswep.c:799)

Prototype:

  CagdCrvStruct *CagdSweepAxisRefine(const CagdCrvStruct *Axis,
                                     const 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: If sweep is to have one, NULL otherwise.
RefLevel: Some refinement control. Keep it low like 2 or 3.


Returned Value:

CagdCrvStruct *: Refined Axis curve.


See Also:

CagdSweepSrfError CagdSweepSrf

Keywords:

sweep refinement


CagdSweepComputeNormalOrientation

(cagdswep.c:410)

Prototype:

  CagdBType CagdSweepComputeNormalOrientation(const CagdCrvStruct *Axis,
                                              CagdVType FrameVec,
                                              CagdCrvStruct *FrameCrv,
                                              CagdRType *PrevT,
                                              CagdRType CrntT,
                                              CagdVecStruct *Tangent,
                                              CagdVecStruct *Normal,
                                              CagdBType FirstTime)


Description:

Estimates a normal for the orientation frame at the given parameter t.

Parameters:

Axis: Axis curve of sweep.
FrameVec: Binormal constant of orientation frame, if not NULL.
FrameCrv: Binormal vector field of orientation frame, if not NULL.
PrevT: Previous parameter value where to evaluate.
CrntT: Parameter value where to evaluate.
Tangent: of Axis curve at parameter value t.
Normal: An estimated normal for the orientation frame.
FirstTime: TRUE if first time to compute the normal.


Returned Value:

CagdBType: TRUE if computed, FALSE otherwise.


Keywords:

orientation frame sweep


CagdSweepCosineHalfAngle

(cagdswep.c:640)

Prototype:

  CagdRType CagdSweepCosineHalfAngle(CagdRType **Points, int Index)


Description:

Computes the cosine of half the angle between the two vectors between the three consecutive control points Index-1, Index, and Index+1.

Parameters:

Points: Points to consider.
Index: at indices Index-1, Index, and Index+1.


Returned Value:

CagdRType: Cosine of half the angle between the given three points


Keywords:

orientation frame sweep surface constructors


CagdSweepGenTransformMatrix

(cagdswep.c:760)

Prototype:

  void CagdSweepGenTransformMatrix(CagdMType Mat,
                                   CagdRType *Trans,
                                   CagdVecStruct *Normal,
                                   CagdVecStruct *Tangent,
                                   CagdRType Scale,
                                   CagdRType NormalScale)


Description:

Routine to prepare a transformation matrix to do the following (in this order): scale by Scale, rotate such that X axis is in Normal dir and Y is collinear with the BiNormal and then translate by Trans. Algorithm: given the Trans vector, it forms the 4th line of Mat. Dir is used to form the second line (the first 3 lines set the rotation), and finally Scale is used to scale first 3 lines/columns to the needed scale: | Nx Ny Nz 0 | A transformation which takes the coord | Bx By Bz 0 | system into T, N & B as required and [X Y Z 1] * | Tx Ty Tz 0 | then translate it to C. T, N, B are | Cx Cy Cz 1 | scaled by Scale. T is exactly Tangent (unit vec). N is set to be Normal and B their cross product. All argument vectors are assumed to be normalized to a unit length.

Parameters:

Mat: To place the newly computed transformation.
Trans: Translation factor.
Normal: Normal direction to prescribe orientation.
Tangent: Tangent direction to prescribe orientation.
Scale: Scale factor.
NormalScale: Scale factor in the normal vector direction.


Returned Value:

void


See Also:

CagdSweepSrfError CagdSweepSrf

Keywords:

orientation frame sweep surface constructors


CagdSweepSrf

(cagdswep.c:97)

Prototype:

  CagdSrfStruct *CagdSweepSrf(const CagdCrvStruct *CrossSection,
                              const CagdCrvStruct *Axis,
                              const CagdCrvStruct *ScalingCrv,
                              CagdRType Scale,
                              const VoidPtr Frame,
                              int FrameOption)


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. Can be several curves to be blended along the Axis. 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 (FrameOption == 2), 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. If more than one curve is given as a linked list of curves, the cross sections are modified as we progresses along the sweep, blending between the cross sections so that last cross section is used in the last parameter value of the Axis.
Axis: Of the constructed sweep surface.
ScalingCrv: Optional scale or profile curve. NULL if none. The Y axis of this curve is using as scaling as the function of the parametrization. X axis can be used to define a 2D parametric curve so this curve can be displayed but X is ignored by this function.
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 specify the binormal orientation. Otherwise, Frame must be NULL.
FrameOption: If 2 Frame is a curve, if 0 or 1 a vector (if Frame is not NULL). If 0, the vector is used just to init the first frame.


Returned Value:

CagdSrfStruct *: Constructed sweep surface.


See Also:

CagdSweepSrfError CagdSweepAxisRefine

Keywords:

sweep surface constructors


CagdSweepSrfC1

(cagdswep.c:1000)

Prototype:

  CagdSrfStruct *CagdSweepSrfC1(const CagdCrvStruct *CrossSection,
                                const CagdCrvStruct *Axis,
                                const CagdCrvStruct *ScalingCrv,
                                CagdRType Scale,
                                const VoidPtr Frame,
                                int FrameOption,
                                CagdCrvCornerType CornerType,
                                CagdRType C1DiscontCropTol)


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. Can be several curves to be blended along the Axis. 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). Can be C^1 discontinuous. 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 (FrameOption == 2), 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. If more than one curve is given as a linked list of curves, the cross sections are modified as we progresses along the sweep, blending between the cross sections so that last cross section is used in the last parameter value of the Axis.
Axis: Of the constructed sweep surface. Can be C1 discont.
ScalingCrv: Optional scale or profile curve. NULL if none. The Y axis of this curve is using as scaling as the function of the parametrization. X axis can be used to define a 2D parametric curve so this curve can be displayed but X is ignored by this function.
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.
FrameOption: If 2 Frame is a curve, if 0 or 1 a vector (if Frame is not NULL). If 0, the vector is used just to init the first frame.
CornerType: C^1 discont. joint corner type - 1. For splitting and computing sweeps of individual C^1 cont. axes. 2. For rounded joints (circular if input is rational). 3. For chamfered joints. 4. For mitered joints.
C1DiscontCropTol: dditional epsilon to crop surfaces at intersection.


Returned Value:

CagdSrfStruct *: Constructed sweep surface.


See Also:

CagdSweepSrfError CagdSweepAxisRefine CagdSweepSrf

Keywords:

sweep surface constructors


CagdSweepSrfC1AdjSrfsInterDmn

(cagdswep.c:1199)

Prototype:

  CagdBType CagdSweepSrfC1AdjSrfsInterDmn(const CagdSrfStruct *PrevSrf,
                                          const CagdSrfStruct *NextSrf,
                                          CagdRType C1DiscontCropTol,
                                          CagdRType *PrevSrfVMax,
                                          CagdRType *NextSrfVMin)


Description:

Check if two adjacent surfaces at a C^1 discontinuity intersect. If they do intersect, returns their (V, the sweep parametric direction) domain of intersection.

Parameters:

PrevSrf: Previous surface before the C^1 discontinuity.
NextSrf: Next surface after the C^1 discontinuity.
C1DiscontCropTol: dditional epsilon to crop surfaces at intersection.
PrevSrfVMax: VMax to clip PrevSrf at, if the two srfs intersect.
NextSrfVMin: VMin to clip NextSrf at, if the two srfs intersect.


Returned Value:

CagdBType: TRUE if surfaces intersects, FALSE otherwise.


See Also:

CagdSweepSrfC1

Keywords:




CagdSweepSrfError

(cagdswep.c:1535)

Prototype:

  CagdSrfStruct *CagdSweepSrfError(const CagdSrfStruct *SweepSrf,
                                   const CagdCrvStruct *CrossSection,
                                   const CagdCrvStruct *Axis,
                                   const CagdCrvStruct *ScalingCrv,
                                   CagdRType Scale)


Description:

Computes an upper bound on the error as a scalar function over the sweep surface approximation, SweepSrf, as a field over the domain of SweepSrf, given the sweep surface construction parameters. This operation is only an approximation. See CagdSweepAxisRefine for a tool to refine the Axis curve and improve accuracy. Error is computed as:
     SweepErr(u, v) = || CrossSection(u) * Scale(v) || ^ 2  -
                      || SweepSrf(u, v) - Axis(v) || ^ 2

where scale(v) is constant Scale if no scaling crv.

Parameters:

SweepSrf: A computed approximated sweep surface, given the params.
CrossSection: Of the constructed sweep surface. If more than one curve is given as a linked list of curves, the cross sections are modified as we progresses along the sweep, blending between the cross sections so that last cross section is used in the last parameter value of the Axis.
Axis: Of the constructed sweep surface.
ScalingCrv: Optional scale or profile curve. NULL if none. The Y axis of this curve is using as scaling as the function of the parametrization. X axis can be used to define a 2D parametric curve so this curve can be displayed but X is ignored by this function.
Scale: If no Scaling Crv, Scale is used to apply a fixed scale on the CrossSection curve.


Returned Value:

CagdSrfStruct *: A scalar field represented the error as L2 distance square from the precise sweep surface.


See Also:

CagdSweepSrf CagdSweepAxisRefine

Keywords:

sweep surface constructors approximation error


CagdTransform

(cagd2gen.c:1400)

Prototype:

  void CagdTransform(CagdRType **Points,
                     int Len,
                     int MaxCoord,
                     CagdBType IsNotRational,
                     const 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. At most 3 for R^3.
IsNotRational: Do we have weights as vector Points[0]?
Translate: Translation amount, NULL for non.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfTransform CagdCrvTransform CagdTransform2

Keywords:

scaling translation transformations


CagdTransform2

(cagd2gen.c:1441)

Prototype:

  void CagdTransform2(CagdRType **Points,
                      int Len,
                      int MaxCoord,
                      CagdBType IsNotRational,
                      const 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, NULL for non.
Scale: Scaling amount.


Returned Value:

void


See Also:

CagdSrfTransform CagdCrvTransform CagdTransform

Keywords:

scaling translation transformations


CagdUVArrayFree

(cagd2gen.c:385)

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

(cagd1gen.c:245)

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

(cagd1gen.c:911)

Prototype:

  CagdUVStruct *CagdUVCopy(const 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

(cagd1gen.c:1216)

Prototype:

  CagdUVStruct *CagdUVCopyList(const 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

(cagd2gen.c:337)

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

(cagd2gen.c:360)

Prototype:

  void CagdUVFreeList(CagdUVStruct *UVList)


Description:

Deallocates and frees a UV structure list:

Parameters:

UVList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdUVNew

(cagd1gen.c:272)

Prototype:

  CagdUVStruct *CagdUVNew(void)


Description:

Allocates and resets all slots of a UV structure.

Parameters:

None


Returned Value:

CagdUVStruct *: A UV structure.


Keywords:

allocation


CagdUpdateBndryCrvInSrf

(cagdbsum.c:365)

Prototype:

  int CagdUpdateBndryCrvInSrf(CagdSrfStruct *Srf,
                              const CagdCrvStruct *Crv,
                              CagdSrfBndryType SrfBndry)


Description:

Update one boundary of surface Srf using the given curve Crv.

Parameters:

Srf: Surface to update one of its boundaries.
Crv: Curve information to update with the selected boundary of Srf.
SrfBndry: he boundary in Srf to update with Crv.


Returned Value:

int: TRUE, if successful, FALSE otherwise.


See Also:



Keywords:




CagdVecArrayFree

(cagd2gen.c:645)

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

(cagd1gen.c:426)

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

(cagd1gen.c:1012)

Prototype:

  CagdVecStruct *CagdVecCopy(const CagdVecStruct *Vec)


Description:

Allocates and copies all slots of a Vec structure.

Parameters:

Vec: To be copied.


Returned Value:

CagdVecStruct *: A duplicate of Vec.


Keywords:

copy


CagdVecCopyList

(cagd2gen.c:70)

Prototype:

  CagdVecStruct *CagdVecCopyList(const 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

(cagd2gen.c:597)

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

(cagd2gen.c:620)

Prototype:

  void CagdVecFreeList(CagdVecStruct *VecList)


Description:

Deallocates and frees a vector structure list:

Parameters:

VecList: To be deallocated.


Returned Value:

void


Keywords:

free


CagdVecNew

(cagd1gen.c:453)

Prototype:

  CagdVecStruct *CagdVecNew(void)


Description:

Allocates and resets all slots of a Vec structure.

Parameters:

None


Returned Value:

CagdVecStruct *: A Vec structure.


Keywords:

allocation


CagdZTwistExtrudeSrf

(cagdextr.c:165)

Prototype:

  CagdSrfStruct *CagdZTwistExtrudeSrf(const CagdCrvStruct *CCrv,
                                      CagdBType Rational,
                                      CagdRType ZPitch)


Description:

Constructs a full circular twisted/rotated extrusion surface in the +Z direction for the given profile curve. Input curve can be either a B-spline or a Bezier curve.

Parameters:

CCrv: To twist and extrude in the +Z direction.
Rational: TRUE to construct a rational (and precise) twist, FALSE to approximate using polynomials.
ZPitch: The +Z amount for full 360 degrees. If zero, the result will be a planar (degenerated) surface. A negative value will reverse the twist.


Returned Value:

CagdSrfStruct *: A twisted extrusion surface.


See Also:

CagdExtrudeSrf

Keywords:

surface constructors


Energy1Calc

(cbsp_fit.c:1865)

Prototype:

  static CagdRType Energy1Calc(CagdCrvStruct *Crv)


Description:

Calculates the curve first derivative energy integral:
   /            2
   | ||Crv'(t)||  dt
   /


Parameters:

Crv: A curve to derive and integrate.


Returned Value:

CagdRType: The calculated integral value.


Keywords:

RegTermCalculatorFuncType


Energy1MatrixCalc

(cbsp_fit.c:1917)

Prototype:

  static void Energy1MatrixCalc(CagdCrvStruct *Crv,
                                CagdRType *A,
                                CagdRType *b,
                                CagdRType Lambda)


Description:


Calculates the curve first derivative energy (see Energy1Calc) minimization matrix. The calculated coefficients are ADDED to A and b.

Parameters:

Crv: Input b-spline curve.
A: Input/output initialized matrix, which size = 2 * Crv -> Length x 2 * Crv -> Length.
b: Input/output initialized offset vector, which size = 2 * Crv -> Length x 1.
Lambda: Weight.


Returned Value:

void


Keywords:

RegMatrixCalculatorFuncType


Energy2Calc

(cbsp_fit.c:1672)

Prototype:

  static CagdRType Energy2Calc(CagdCrvStruct *Crv)


Description:

Calculates the curve second derivative energy integral:
   /             2
   | ||Crv''(t)||  dt
   /


Parameters:

Crv: A curve to derive and integrate.


Returned Value:

CagdRType: The calculated integral value.


Keywords:

RegTermCalculatorFuncType


Energy2MatrixCalc

(cbsp_fit.c:1722)

Prototype:

  static void Energy2MatrixCalc(CagdCrvStruct *Crv,
                                CagdRType *A,
                                CagdRType *b,
                                CagdRType Lambda)


Description:


Calculates the curve second derivative energy (see Energy2Calc) minimization matrix. The calculated coefficients are ADDED to A and b.

Parameters:

Crv: Input b-spline curve.
A: Input/output initialized matrix, which size = 2 * Crv -> Length x 2 * Crv -> Length.
b: Input/output initialized offset vector, which size = 2 * Crv -> Length x 1.
Lambda: Weight.


Returned Value:

void


Keywords:

RegMatrixCalculatorFuncType


LeastSquareInitCrvCalculator

(cbsp_fit.c:1459)

Prototype:

  static CagdCrvStruct *LeastSquareInitCrvCalculator(CagdPType *PtList,
                                                     int NumOfPoints,
                                                     int Length,
                                                     int Order,
                                                     CagdBType Periodic)


Description:

Computes an initial b-spline fitting curve that least square approximates the input points.

Parameters:

PtList: Points cloud.
NumOfPoints: Number of points in PtList.
Length: The desired length of the output b-spline curve.
Order: The desired order of the output b-spline curve.
Periodic: TRUE for periodic output curve, FALSE for open end.


Returned Value:

CagdCrvStruct *: The calculated b-spline curve.


Keywords:

InitFittingCrvCalculatorFuncType


PDMErrorCalc

(cbsp_fit.c:533)

Prototype:

  static CagdRType PDMErrorCalc(int NumOfPoints,
                                CagdPType *Points,
                                CagdPType *FootPoints)


Description:

Computes PD Minimization method error, which is: *
  NumOfPoints
     ----
  1  \
  -  /     e
  2  ----   PD,k
      k=1
                        2
  e      =  ||P(tk)-Xk||
   PD,k


Parameters:

NumOfPoints: Number of points in the points cloud.
Points: (X) Points cloud. Array of points with size = NumOfPoints.
FootPoints: P(t)) Footpoints (the closest points on the curve) array. Array size must be 'NumOfPoints'.


Returned Value:

CagdRType: PD error.


See Also:

CagdSDError

Keywords:




PDMatrixCalc

(cbsp_fit.c:1617)

Prototype:

  static void PDMatrixCalc(int Length,
                           int NumOfPoints,
                           CagdPType *Points,
                           CagdRType *Basis,
                           CagdPType *FootPoints,
                           CagdRType *A, /* MATRIX */
                           CagdRType *b)


Description:


Calculates the PD error minimization equation Matrix and offset vector, i.e. A and b of the Ax=b equation. The caluclated values are ADDED to the A and b parameters The order of variables in x is assumed to be: (D1_x,D2_x,...,DLength_x,D1_y,D2_y,...,DLength_y)

Parameters:

Length: Fitting curve Length.
NumOfPoints: umber of points in the points cloud.
Points: Points cloud. Array of points with size = NumOfPoints.
Basis: Array of size (NumOfPoints * Length) containing basis function coefficients at the foot points
FootPoints: Footpoints (the closest points on the curve) array of size NumOfPoints.
A: Input/output matrix (2Length * 2Length).
b: Input/output offset vector (2Length * 1).


Returned Value:

void


Keywords:

PD error


PwrCrvDegreeRaise

(cpwr_aux.c:286)

Prototype:

  CagdCrvStruct *PwrCrvDegreeRaise(const CagdCrvStruct *Crv)


Description:

Returns a new curve, identical to the original but with one degree higher. Adds one more, highest degree coefficient, that is identically zero.

Parameters:

Crv: To raise its degree by one.


Returned Value:

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


See Also:

BzrCrvDegreeRaiseN BzrCrvDegreeRaise PwrCrvDegreeRaiseN

Keywords:

degree raising


PwrCrvDegreeRaiseN

(cpwr_aux.c:239)

Prototype:

  CagdCrvStruct *PwrCrvDegreeRaiseN(const CagdCrvStruct *Crv, int NewOrder)


Description:

Returns a new curve, identical to the original but with order NewOrder. Degree raise is computed by adding zeros at high order coefs.

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.


See Also:

BzrCrvDegreeRaise BzrCrvDegreeRaiseN PwrCrvDegreeRaise

Keywords:

degree raising


PwrCrvDerive

(cpwr_aux.c:116)

Prototype:

  CagdCrvStruct *PwrCrvDerive(const CagdCrvStruct *Crv, CagdBType DeriveScalar)


Description:

Returns a new curve, equal to the given curve, differentiated once.

Parameters:

Crv: To differentiate.
DeriveScalar: TRUE to differentiate each channel independently. FALSE to treat geometry as a rational differentiation.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

CagdCrvDerive BspCrvDerive SymbCrvDeriveRational

Keywords:

derivatives


PwrCrvDeriveScalar

(cpwr_aux.c:170)

Prototype:

  CagdCrvStruct *PwrCrvDeriveScalar(const CagdCrvStruct *Crv)


Description:

Returns a new curve, equal to the given curve, differentiated once. For a Euclidean curve this is the same as CagdCrvDerive but for a rational curve the returned curve is not the vector field but simply the derivatives of all the curve's coefficients, including the weights.

Parameters:

Crv: To differentiate.


Returned Value:

CagdCrvStruct *: Differentiated curve.


See Also:

PwrCrvDerive CagdCrvDerive SymbCrvDeriveRational BspCrvDerive PwrCrvDeriveScalar CagdCrvDeriveScalar

Keywords:

derivatives


PwrCrvEvalAtParamMalloc

(cpwr_aux.c:41)

Prototype:

  CagdRType *PwrCrvEvalAtParamMalloc(const CagdCrvStruct *Crv, CagdRType t)


Description:

Returns a pointer to a dynamically allocated data, holding the value of the curve at given parametric location t. The curve is assumed to be a power basis. Evaluation is conducted using the Horner rule.

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:

CagdCrvEvalToData BspCrvEvalAtParamToData BzrCrvEvalAtParamToData PwrCrvEvalAtParamToData BspCrvEvalAtParamMalloc

Keywords:

evaluation


PwrCrvEvalAtParamToData

(cpwr_aux.c:80)

Prototype:

  void PwrCrvEvalAtParamToData(const CagdCrvStruct *Crv,
                               CagdRType t,
                               CagdRType *Buf)


Description:

Updates the given data (Buf) to hold the value of the curve at given parametric location t. The curve is assumed to be a power basis. Evaluation is conducted using the Horner rule.

Parameters:

Crv: To evaluate at the given parametric location t.
t: The parameter value at which the curve Crv is to be evaluated.
Buf: 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).


Returned Value:

void


See Also:

CagdCrvEvalToData BspCrvEvalAtParamToData BzrCrvEvalAtParamToData PwrCrvEvalAtParamToData

Keywords:

evaluation


PwrCrvIntegrate

(cpwr_aux.c:195)

Prototype:

  CagdCrvStruct *PwrCrvIntegrate(const CagdCrvStruct *Crv)


Description:

Returns a new Bezier curve, equal to the integral of the given power

Parameters:

Crv: Curve to integrate.


Returned Value:

CagdCrvStruct *: Integrated curve.


See Also:

BspCrvIntegrate BzrSrfIntegrate CagdCrvIntegrate

Keywords:

integrals


PwrCrvNew

(bzr_gen.c:128)

Prototype:

  CagdCrvStruct *PwrCrvNew(int Length, CagdPointType PType)


Description:

Allocates the memory required for a new Power basis curve.

Parameters:

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


Returned Value:

CagdCrvStruct *: An uninitialized freeform Power basis curve.


See Also:

BspCrvNew BspPeriodicCrvNew CagdCrvNew CagdPeriodicCrvNew TrimCrvNew BzrCrvNew

Keywords:

allocation


PwrSrfDegreeRaise

(sbzr_aux.c:306)

Prototype:

  CagdSrfStruct *PwrSrfDegreeRaise(const CagdSrfStruct *Srf, CagdSrfDirType Dir)


Description:

Returns a new power basis 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 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 BzrSrfDegreeRaise TrimSrfDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaiseN CagdSrfDegreeRaiseN PwrSrfDegreeRaiseN

Keywords:

degree raising


PwrSrfDegreeRaiseN

(sbzr_aux.c:345)

Prototype:

  CagdSrfStruct *PwrSrfDegreeRaiseN(const CagdSrfStruct *Srf,
                                    int NewUOrder,
                                    int NewVOrder)


Description:

Returns a new power basis surface, identical to the original but with higher degrees, as prescribed by NewUOrder, NewVOrder.

Parameters:

Srf: To raise its degrees.
NewUOrder: New U order of Srf.
NewVOrder: New V order of Srf.


Returned Value:

CagdSrfStruct *: A surface with higher degrees as prescribed by NewUOrder/NewVOrder.


See Also:

CagdSrfDegreeRaise BzrSrfDegreeRaise TrimSrfDegreeRaise BspSrfDegreeRaise BzrSrfDegreeRaiseN CagdSrfDegreeRaiseN PwrSrfDegreeRaise

Keywords:

degree raising


PwrSrfNew

(bzr_gen.c:97)

Prototype:

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


Description:

Allocates the memory required for a new Power basis 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 Power basis surface.


See Also:

BspSrfNew BspPeriodicSrfNew CagdSrfNew CagdPeriodicSrfNew TrimSrfNew BzrSrfNew

Keywords:

allocation


SDMErrorCalc

(cbsp_fit.c:592)

Prototype:

  static CagdRType SDMErrorCalc(int NumOfPoints,
                                CagdPType *Points,
                                CagdPType *FootPoints,
                                CagdRType *Distances,
                                CagdPType *Tangents,
                                CagdPType *Normals,
                                CagdRType *Curvatures,
                                CagdBType *IsOuter)


Description:

Computes SD Minimization method error, which is: *
  NumOfPoints
     ----
  1  \
  -  /     e
  2  ----   SD,k
      k=1
             /   dk             T     2               T       2
             |  -----[(P(tk)-Xk) * Tk]  +  [(P(tk)-Xk)  *  Nk]  ,if dk<0
  e      =  <   dk-pk
   SD,k      |              T     2
             |  [(P(tk) - Xk] * Ni]                         ,if 0=
NOTE: The size of each array must be 'NumOfPoints'.

Parameters:

NumOfPoints: umber of points in the points cloud.
Points: (X) Points cloud. Array of points with size = NumOfPoints.
FootPoints: (P(t)) Footpoints (the closest points on the curve) array.
Distances: (d) Array of distances between each point to the corresponding footpoint.
Tangents: (T) Array of curve tangents at each footpoint.
Normals: (N) Array of curve normals at each footpoint.
Curvatures: (p) Array of curve curvature radiuses at each footpoint.
IsOuter: Array of booleans that indicates outer points.


Returned Value:

CagdRType: SD error.


See Also:

CagdSDError

Keywords:




SDMatrixCalc

(cbsp_fit.c:320)

Prototype:

  static void SDMatrixCalc(int Length,
                           int NumOfPoints,
                           CagdPType *Points,
                           CagdRType *Basis,
                           CagdPType *FootPoints,
                           CagdRType *Distances,
                           CagdPType *Tangents,
                           CagdPType *Normals,
                           CagdRType *Curvatures,
                           CagdBType *IsOuter,
                           CagdRType *A,
                           CagdRType *b)


Description:

Calculates the SD error minimization equation Matrix and offset vector, i.e. A and b of the Ax=b equation. The caluclated values are ADDED to the A and b parameters The order of variables in x is assumed to be: (D1_x,D2_x,...,DLength_x,D1_y,D2_y,...,DLength_y) NOTE: The size of each array except Basis must be 'NumOfPoints'.

Parameters:

Length: Fitting curve Length.
NumOfPoints: umber of points in the points cloud.
Points: Points cloud. Array of points with size = NumOfPoints.
Basis: Array of size (NumOfPoints * Length) containing basis function coefficients at the foot points
FootPoints: Footpoints (the closest points on the curve) array.
Distances: Array of distances between each point to the corresponding footpoint.
Tangents: Array of curve tangents at each footpoint.
Normals: Array of curve normals at each footpoint.
Curvatures: Array of curve curvature radiuses at each footpoint.
IsOuter: Array of booleans that indicates outer points.
A: Input/output matrix (2Length * 2Length).
b: Input/output offset vector (2Length * 1).


Returned Value:

void


Keywords:

SD error