# Synopsis

PDX_MSGT gcr_NurbCurve(long option, MDA_PTR orig_db_ptr, char type, MDA_COUNT degree, MDA_COUNT num_of_ctrl_pts, double *knots, double *ctrl_pts, double bounds[2], int gdx_model, MDA_PTR *gdx_NC_ptr)

# Purpose

Create a GDX NURB Curve.

# Description

This function creates a GDX NURB Curve entity for the given input data. The data provided must result in a valid definition.

The control points need to be stored along with the weights in 4D homogenous form where the coordinates have been pre-multiplitied by the corresponding weights. Thus, the control points and weights are stored in a 4D array as X*W, Y*W, Z*W, and W. If the weights are all the same, then the curve is flagged as non-rational and all the control points are modified such that the weights are 1.0.

If any of the weights are different, the the curve is flagged as rational.

If any of the weights are zero, the curve is not created and an error is returned.

The GDX NURB Curve's planar, xy_planar, and plane_normal fields are set by calling gdx_SetNurbCurvePlanarFlag with the zero tolerance for point in plane check set to GDX COPLANAR_TOL.

The GDX NURB Curve's closed field is set using tolerance of GDX PARM_SPACE_PNT_TOL if GCR_PARM_DATA is specified. By default the GDX MODEL_SPACE_PNT_TOL will be used to determine closure.

The GDX NURB Curve's periodic field is set by examining the values specified in the knot array.

The orig_db_ptr argument should contain the database pointer of the entity that the new entity was created from (usually this should be obtained by the calling routine via mda_GetOrigDbptr) or MDA_NULL_PTR. See the mda_intro man page for more information about predecessor entities.

\fBRules\fR .IP • 3 degree > 0 .IP • 3 num_of_ctrl_pts > 1. .LP

# Input

## option

### GCR_NOVALIDATE

No validation will occur on the input data.

### GCR_PARM_DATA

Signifies parametric data (by default, model space data is assumed)

## orig_db_ptr

The original entities orig_db_ptr as obtained from the mda_GetOrigDbptr call, or MDA_NULL_PTR

## type

### GDX_NURB_GENERAL

The general form of the GDX NURB

### GDX_NURB_LINE

line

### GDX_NURB_ARC

Arc

### GDX_NURB_ELLIPSE

Ellipse

### GDX_NURB_PARABOLA

Parabola

### GDX_NURB_HYPERBOLA

hyperbola

### GDX_NURB_COMPOSITE

Composited

### GDX_NURB_OFFSET_CURVE

Offset curve

### GDX_NURB_POINT_CURV

Point curve

## degree

The algebraic degree of the basis functions

## num_of_ctrl_pts

The number of control points for the curve

## knots

MDA memory containging the curve knot sequence (non-decreasing). Always consumed by this function even on error.

## ctrl_pts

MDA memory containing the 4D X, Y, Z, W control point coordinates and weights. Assumes point multiplied by weight. Always consumed by this function even on error.

## bounds

The active parametric domain of the curve, or NULL. If value is NULL, gdx bounds[0] = gdx knot[degree] and gdx bounds[1] = gdx knot[number of knots - order]

## gdx_model

The GDX model for entity creation

# Output

## gdx_NC_ptr

Entity database pointer of the GDX NURB Curve

# Tolerances

          GDX COPLANAR_TOL
          GDX PARM_SPACE_PNT_TOL or
          GDX MODEL_SPACE_PNT_TOL
          GDX_KNOT_TOL
          .fi

# Return

          GCR_NOERR
          GCR_INVALID_MODEL
          Low level error return
          .fi