# Synopsis

PDX_MSGT gdx_PointsToNurbSurf(long option, int model, double ***pnts, long npu, long npv, double *u_pars, double *v_pars, double max_error, MDA_PTR *gdx_ns_ptr)

# Purpose

Create GDX NURB Surface to within tolerance of mesh of points.

# Description

This routine fits a surface to an npu x npv rectangular mesh of points. The deviation error of the surface from the points can be specified. It can be set to zero to attain precise fit to the points, or greater than zero to obtain an approximation to the points. An approximation produces a Nurbs surface with less defining data than a precise fit, i.e. approximation yields data reduction.

# Input

## option

### GDX_LEAVE_LOCKED

If set, the returned entity will be left locked; in this case it is up to the caller to call mda_UnlockEntity for each entity returned. Note: the entity structure can be accessed via mda_GetLockedAddr.

### GDX_USEDEG1

Create degree 1 nurb surface.

## model

The GDX model for entity creation.

## pnts

precisely. If max_error > 0, the corres- pondence is only approximate, and not necessarily to within max_error.

## npu

Number of data points in the u-direction. npu > 1 must hold.

## npv

Number of data points in the v-direction. npv > 1 must hold.

## u_pars

If u_pars = NULL, it is not used. Otherwise, it is the npu u-direction parameter values. This allows the caller to specify a parameterization for the surface fit. If u_pars is passed in and

## max_error

The maximum desired geometric deviation error of the surface from the given points (measured in the perpendicular projection sense). max_error >= 0 must hold.

## v_pars

If v_pars = NULL, it is not used. Otherwise, it is the npv v-direction parameter values. Statements analogous to those for u_pars also hold for v_pars.

# Output

## gdx_ns_ptr

Database pointer of the GDX NURB Surface fitted to the data.

# Return

          GDX_NOERR
          GDX_BADDATA
          GDX_SINGULAREQS  (singular system of equations)
          Low level error return
          .fi