Bezier surface class.
Macros:
Maximum order and dimension for a CapyBezier
Enumerations:
None.
Typedefs:
Iteration windows for CapyBezierIterator
Struct CapyBezier :
Struct CapyBezier's properties:
Inherits CapyMathFun
Order
Number of control points
Look up table for the binomial values
Look up table for the index in a given dimension of a given control points
Control points. Ordered as follow, for example for a 2d->1d bilinear ctrls[0] : in={0,0} ctrls[1] : in={1,0} ctrls[2] : in={0,1} ctrls[3] : in={1,1}
Vector to memorise the control points' weight during evaluation. Ordered as that->ctrls
Struct CapyBezier's methods:
Destructor
Get a reference to the control point of a given ID.
Input argument(s):
id: the ID of the control point
Output and side effect(s):
Return a pointer to the control point (CapyVec of dimension dimOut)
Set the values of the control point of given ID.
Input argument(s):
id: the ID of the control point
vals: the value to set
Get a reference to the control point at a given index in each input dimension.
Input argument(s):
idx: the indices of the control point
Output and side effect(s):
Return a pointer to the control point (CapyVec of dimension dimOut)
Set the values of the control point at a given index in each input dimension.
Input argument(s):
idx: the indices of the control point
vals: the value to set
Save the CapyBezier to a binary stream
Input argument(s):
stream: the binary stream to save onto
Exception(s):
May raise CapyExc_StreamWriteError
Export the CapyBezier as a C function to a stream
Input argument(s):
stream: the stream to save onto
name: the name of the function
Output and side effect(s):
The exported function's interface is void
Exception(s):
May raise CapyExc_StreamWriteError.
Struct CapyBezierPosition :
Struct CapyBezierPosition's properties:
Struct CapyBezierPosition's methods:
None.
Struct CapyBezierIterator :
Struct CapyBezierIterator's properties:
Index of the current step in the iteration
Returned data type
List of windows
Bezier associated to the iteration
Epsilon for the step of iteration using euclidean distance along the Bezier curve (default: 0.1)
Memory pool for the windows
Struct CapyBezierIterator's methods:
Destructor
Reset the iterator
Output and side effect(s):
Return the first position of the iteration
Move the iterator to the next position
Output and side effect(s):
Return the next position of the iteration
Check if the iterator is on a valid position
Output and side effect(s):
Return true if the iterator is on a valid position, else false
Get the current position of the iteration
Output and side effect(s):
Return the current position
Struct CapyBezierSpline :
Struct CapyBezierSpline's properties:
Inherits CapyMathFun
Number of segments per input dimension
Tensor of CapyBezier curves. Ordered the same way as the contol points in the Bezier curve. All curves must have the same dimIn and dimOut but they can have various order. The continuity of the spline is not enforced. Initialised to Bezier curve of order 0 and default values. The spline's 't' parameters goes from 0 to nbSegment. For a given 't', the floor(t)-th curve is used.
Total number of Bezier curves
Struct CapyBezierSpline's methods:
Destructor
Get the Bezier curve at a given location in the tensor
Input argument(s):
idx: the indices of the segment
Output and side effect(s):
Return a reference to the segment.
Set the Bezier curve at a given location in the tensor
Input argument(s):
idx: the indices of the segment
curve: the Bezier curve
Output and side effect(s):
The reference to the curve is updated. If there was a previous refererence, it is destructed prior to update.
Functions:
Create a CapyBezier
Input argument(s):
order: the order of the Bezier object
dimIn: number of inputs
dimOut: number of outputs
Output and side effect(s):
Return a CapyBezier
Allocate memory for a new CapyBezier and create it
Input argument(s):
order: the order of the Bezier object
dimIn: number of inputs
dimOut: number of outputs
Output and side effect(s):
Return a CapyBezier
Exception(s):
May raise CapyExc_MallocFailed.
Allocate memory for a new CapyBezier and load it from a binary stream
Input argument(s):
stream: the binary stream to load the Bezier from
Output and side effect(s):
Return a CapyBezier
Exception(s):
May raise CapyExc_MallocFailed, CapyExc_StreamReadError.
Free the memory used by a CapyBezier* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyBezier to free
Create an iterator on a CapyBezier
Input argument(s):
bezier: the bezier on which to iterate
Output and side effect(s):
Return the iterator
Allocate memory and create an iterator on a CapyBezier
Input argument(s):
bezier: the bezier on which to iterate
Output and side effect(s):
Return the iterator
Free the memory used by a pointer to an iterator and reset '*that' to NULL
Input argument(s):
that: a pointer to the iterator to free
Create a CapyBezierSpline
Input argument(s):
nbSegment: array of dimIn integer, number of segments per input dimension
dimIn: number of inputs
dimOut: number of outputs
Output and side effect(s):
Return a CapyBezierSpline
Allocate memory for a new CapyBezierSpline and create it
Input argument(s):
nbSegment: array of dimIn integer, number of segments per input dimension
dimIn: number of inputs
dimOut: number of outputs
Output and side effect(s):
Return a CapyBezierSpline
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyBezierSpline* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyBezierSpline to free