LibCapy - bezier

Bezier surface class.

Macros:

Enumerations:

None.

Typedefs:

None.

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 (double const* const in, double* const out).

Exception(s):

May raise CapyExc_StreamWriteError.

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

2022-02-06
in LibCapy,
30 views
Copyright 2021-2023 Baillehache Pascal