PEXNURBCurve(3) — Subroutines
Name
PEXNURBCurve - Non-Uniform Rational B-spline Curve Primitive
Synopsis
void PEXNURBCurve(Display ∗display, XID resource_id, PEXOCRequestType req_type, int rationality, int order, float ∗knots, unsigned int count, PEXArrayOfCoord points, double tmin, double tmax)
Arguments
displayA pointer to a display structure returned by a successful XOpenDisplay call.
resource_idThe resource identifier of the renderer or structure.
req_typeThe request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).
rationalityThe type of B-spline curve, whether rational or non-rational (PEXRational or PEXNonRational).
orderThe order of the polynomial expression.
knotsAn array of floats specifying the B-spline curve knots.
countThe number of control points that define the curve.
pointsAn array of control points defining the B-spline curve.
tminThe minimum parameter value at which to evaluate the curve.
tmaxThe maximum parameter value at which to evaluate the curve.
Returns
None
Description
This function creates a non-uniform B-spline curve output primitive.
The curve order is specified as a positive number. PEXGetImpDepConstants can be called to determine the largest supported value for curve order. The spline shape is specified using a list of knots in the parametric coordinate space and a list of control points in modeling coordinates. The number of control points must be at least as large as the order. The number of knots is the sum of the curve order plus the number of control points. The sequence of knots must be non-decreasing, i.e. t(0) <= t(1) <= ... <= t(k-1) where k is the number of knots.
If the rationality is PEXRational, the control points must be specified in homogeneous (4D) modeling coordinates. PEXlib assumes that 4D modeling coordinates (x,y,z) have already been multiplied by the homogeneous coordinate (w). If the rationality is PEXNonRational, the control points must be specified in non-homogeneous (3D) modeling coordinates.
Evaluation of the spline is restricted to a specific region in the parametric coordinate space. The parametric limits, tmin and tmax, specify the region in the parametric coordinate space over which the spline is to be evaluated (tmin must be less than tmax). The parametric bounds must also satisfy the restriction tmin >= t(order), tmax <= t(k+1-order).
Depending on the ASF attributes, line color, line type, line width and curve approximation attributes are obtained either directly from the current line attributes or from the line bundle.
If the specified curve order is not supported, the output primitive is stored in a structure, but when rendered, the primitive is ignored and has no visual effect.
Also, the curve order must not be less than one.
Data Structures
typedef union {
PEXCoord2D ∗point_2d;
PEXCoord ∗point;
PEXCoord4D ∗point_4d;
} PEXArrayOfCoord;
See also the PEXStructuresman page.
Errors
BadPEXOutputCommand
The output command contains an invalid value.
BadPEXRenderer
The specified renderer resource identifier is invalid.
BadPEXStructure
The specified structure resource identifier is invalid.
See Also
PEXSetLineType, PEXSetLineWidth, PEXSetLineColorIndex, PEXSetLineColor,
PEXSetLineBundleIndex, PEXSetCurveApprox, PEXGetImpDepConstants