Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ PEXNURBSurface(3) — Open3D 4.96

Media Vault

Software Library

Restoration Projects

Artifacts Sought

PEXNURBSurface(3)  —  Subroutines

Name

PEXNURBSurface - Non-Uniform Rational B-spline Surface Primitive

Synopsis

void PEXNURBSurface(Display ∗display, XID resource_id, PEXOCRequestType req_type, int rationality, int uorder, int vorder, float ∗uknots, float ∗vknots, unsigned int col_count, unsigned int row_count, PEXArrayOfCoord points, unsigned int curve_count, PEXListOfTrimCurve ∗trim_curves)

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 surface, whether rational or non-rational (PEXRational or PEXNonRational).

uorderThe order of the polynomial expression in the u direction. 

vorderThe order of the polynomial expression in the v direction. 

uknotsAn array of floats specifying the B-spline curve knots in the u direction. 

vknotsAn array of floats specifying the B-spline curve knots in the v direction. 

col_countThe number of columns in the points array (number of points in the u direction). 

row_countThe number of rows in the points array (number of points in the v direction). 

pointsAn array of points defining the B-spline surface. 

curve_countThe number of trimming curves. 

trim_curvesA pointer to a list of trimming curves. 

Returns

None

Description

This function creates a non-uniform B-spline surface output primitive. 

The surface is generated as a function of the parametric variables u and v.  The u and v order must be positive integers and indicate the order of the surface in each of the u and v parameter dimensions.  PEXGetImpDepConstants can be called to determine the largest supported value for surface u and v order. The spline shape is specified using two lists of knots in the parametric coordinate space, plus an array of control points specified in modeling coordinates.  The u and v knot sequences must each form a non-decreasing sequence of numbers. The column count indicates the number of control points in the u direction and the row count indicates the number of control points in the v direction. The control points are stored in the array in row-major order (i.e., the column number varies fastest as vertices are stored in the array) and the rows increase in the direction of increasing v. The number of knots in the u direction is the sum of the order in the u direction and column count. The number of knots in the v direction is the sum of the order in the v direction and row count. The number of control points in each direction must be at least as large as the corresponding order.

The minimum and maximum knot values define the range over which the B-spline surface is evaluated in the u or v parametric direction,. 

If the rationality is PEXRational, the control point list must be specified in homogeneous (4D) modeling coordinates.  If rationality is PEXNonRational, the control point list must be specified in non-homogeneous (3D) modeling coordinates.

In addition to the parametric bounds, a list of trimming loops may also be specified.  Trimming loops serve to further restrict the region in parametric coordinate space over which the surface is evaluated.  Each trimming loop is defined as a list of one or more B-spline trimming curves that are connected head-to-tail.  Each trim curve is a completely specified NURB curve, i.e. it is rational or non-rational, has its own order, etc.  The list must be explicitly closed so that the tail of the last curve joins the head of the first.  Each trimming curve is parameterized independently.  If there is floating point inaccuracy in closure or in head-to-tail connectivity between curves, closure or connectivity will be assumed.  Trimming loops are defined in the parameter space of the surface and may not go outside the parameter space of the surface. 

When no trimming loops are specified, the rectangular parameter limits of the surface are renderer as the edges of the surface based on the edge flag attribute. 

Trimming loops define the region of the surface that is to be rendered based on the following two rules:  (1) a point is in the portion of the surface to be rendered if any ray projected from it to infinity has an odd number of intersections with trimming loops, and (2) traveling in the direction of a trimming loop, the portion of the surface to be trimmed away should be on the right and the portion to be retained should be on the left.  In other words, a loop defined in counter-clockwise order will cause the interior of the loop to be retained and the exterior to be trimmed away.  A clockwise loop will cause the exterior of the loop to be retained and the interior to be trimmed away.  If loops are nested, they must alternate in direction.  In all cases, the outermost loop must be counter-clockwise.  No trimming curve may intersect itself and no trimming loop may intersect itself or any other trimming loop.  Trimming loops that do not obey these rules will result in implementation-dependent behavior. 

Each trimming curve has a visibility flag that controls its visibility for the purposes of surface edge display.  Depending on the surface edge attributes and the visibility flags associated with trimming curves, the curves in trimming loops may be drawn as surface edges. 

All attributes affecting the representation of fill area sets also affect the representation of the non-unform B-spline surface primitive.  In addition, the surface approximation is used to determine how to approximate the B-spline surface and the parametric surface characteristics are used to specify the appearance of the surface. 

If either of the specified surface orders are not supported, the output primitive is stored in a structure, but when rendered, the primitive is ignored and has no visual effect. 

Trimming curve specification must abide by the constraints of NURB curve (e.g. number of control points at least as large as the order, non-decreasing knot sequence, order plus number of controls points equals the number of knots).  Also, the trim curve order must not be less than two. 

Data Structures

typedef union {
    PEXCoord2D          ∗point_2d;
    PEXCoord            ∗point;
    PEXCoord4D          ∗point_4d;
} PEXArrayOfCoord;
typedef struct {
    unsigned short      count;
    PEXTrimCurve        ∗curves;
} PEXListOfTrimCurve;
typedef struct {
    PEXSwitch           visibility;
    unsigned char       reserved;
    unsigned short      order;
    PEXCoordType        rationality;
    PEXEnumTypeIndex    approx_method;
    float               tolerance;
    float               tmin, tmax;
    PEXListOfFloat      knots;
    unsigned short      count;
    PEXArrayOfCoord     control_points;
} PEXTrimCurve;
typedef unsigned char   PEXSwitch;
typedef unsigned short  PEXCoordType;
typedef short           PEXEnumTypeIndex;
typedef struct {
    unsigned short      count;
    float               ∗floats;
} PEXListOfFloat;
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

PEXSetInteriorStyle, PEXSetInteriorStyleIndex, PEXSetSurfaceColorIndex,
PEXSetSurfaceColor, PEXSetReflectionAttributes, PEXSetReflectionModel,
PEXSetSurfaceInterpMethod, PEXSetBFInteriorStyle, PEXSetBFInteriorStyleIndex,
PEXSetBFSurfaceColorIndex, PEXSetBFSurfaceColor, PEXSetBFReflectionAttributes,
PEXSetBFReflectionModel, PEXSetBFSurfaceInterpMethod, PEXSetSurfaceApprox,
PEXSetFacetCullingMode, PEXSetFacetDistinguishFlag,
PEXSetPatternSize, PEXSetPatternAttributes, PEXSetPatternAttributes2D,
PEXSetInteriorBundleIndex, PEXSetSurfaceEdgeFlag, PEXSetSurfaceEdgeType,
PEXSetSurfaceEdgeWidth, PEXSetSurfaceEdgeColor, PEXSetSurfaceEdgeColorIndex,
PEXSetEdgeBundleIndex, PEXSetParaSurfCharacteristics, PEXGetImpDepConstants

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026