# Synopsis

PDX_MSGT gdx_ConvertSurfaceToNurbSurf(long option, MDA_PTR gdx_surf_ptr, int model, double tolerance, int u_degree, int v_degree, int max_iters, void *gdx_nurb_surf)

# Purpose

Convert a GDX surface entity to a GDX NURB Surface entity

# Description

Converts a GDX surface entity to a GDX NURB surface entity. The GDX surface can be any GDX surface including a GDX NURB surface. If the GDX surface is a GDX NURB surface, then the GDX NURB surface is converted to another GDX NURB surface based on the degree, tolerance, rationality, and option. If the GDX NURB Surface is a rational surface the surface will be converted to a non-rational GDX NURB Surface of the desired degree unless the option GDX_KEEPRAT is set. If the u_degree and the v_degree is equal to or greater then the GDX NURB Surface U degree and V degree respectively and the option GDX_KEEPRAT is set, the the conversion is exact, otherwise the conversion is an approximation to tolerance. The u_degree and v_degree values only apply when a GDX NURB Surface or GDX Offset surface is converted to another GDX NURB Surface. The values of u_degree and v_degree in this case must be > 0.

The tolerance value applies to entites that are GDX spline and/or offset surface entities. The max_iters value applies to GDX offset surface entities that are approximated as GDX NURB surfaces and GDX NURB surfaces that are approximated as GDX NURB surfaces of lower degree and/or non-rational.

For all entities that have an exact conversion, the conversion is geometrically exact to the precision of the input data and to machine precision. Otherwise the conversion is an approximate conversion to a tolerance.

If a conversion error occurs any data created during the conversion is deleted and no GDX NURB Surface is created.

The GDX surface entity must be a valid GDX surface definition.

Tolerances .nf MODEL_SPACE_PNT_TOL ZERO_TOL PNT_PROJ_TOL ANGLE_TOL SINGULAR_TOL KNOT_TOL .fi

# Input

## option

Conversion option

## GDX_COMMIT

Commit the GDX NURB surface to the database

## GDX_KEEPRAT

Keep a rational NURBS surface rational for degree elevation or no degree change

## GDX_USEBASEDEG

Use the base surface U and V degree for the degree of the offset surface

## gdx_surf_ptr

Database pointer of GDX entity.

## model

The model to create the GDX NURB surface in

## tolerance

The tolerance for approximating the GDX NURB surface in the case of converting an offset surface or a NURB surface to non-rational or lower degree.

## u_degree

The U degree to approximate the GDX NURB surface when a GDX NURB is converted to another GDX NURB surface

## v_degree

The V degree to approximate the GDX NURB surface when a GDX NURB is converted to another GDX NURB surface

## max_iters

The maximum iteration count to test for convergence to the approximation tolerance

# Output

## gdx_nurb_surf

The GDX NURB surface entity structure or database pointer

# Return

          GDX_NOERR
          GDX_ENTITYNOTSURFACE
          Low level error return
          .fi