# Synopsis

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

# Purpose

Convert a GDX offset surface to a GDX NURB Surface

# Description

Converts a GDX offset surface entity to a GDX NURB Surface entity.

The base GDX surface definition is converted to a NURBS surface. The NURBS surface is used to create an approximate offset NURBS surface to within a tolerance of tolerance. The current MODEL_SPACE_PNT_TOL should be at least 2 orders of magnitude less then the tolerance value for reasonable results. The u_degree and v_degree determine the degree of the offset surface in each parametric direction. The degree should be at least equivalent to the degree of the base surface and a higher degree will produce less data for the approximation of the offset surface.

The tolerance value is a measure of the distance that the offset surface can vary from the true offset. The max_iters is the maximium number of iterations that a span in the original base surface converted to a NURBS curve is subdivided for offsetting to approximate the true offset. Typically only several iterations are required for convergence to the tolerance, but a discontinuous base surface or a base surface whose offset distance is greater than the minimium radius of curvature may never converge to the requested tolerance. A max_iters value of around ten(10) is recommended.

The u_degree, max_iters, and tolerance values are also used for the conversion of surfaces that contain GDX offset surface base entities as defining surface which require an approximate conversion to a NURBS definition. The tolerance value also applies for closure test.

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

The GDX offset surface entity and the subordinate surface entity must be valid GDX definitions.

The conversion is an approximate conversion.

# Input

## option

### GDX_COMMIT

Commit the GDX NURB Surface to the database

### GDX_USEBASEDEG

Use the degree of the base surface for the offset surface

## db_ptr

The valid GDX offset surface entity database pointer

## model

The model to create the GDX NURB Surface in

## tolerance

The tolerance for the base to NURBS conversion and closure test

## u_degree

The converted NURBS surface U degree

## v_degree

The converted NURBS surface V degree

## max_iters

The maximium iterations for convergence test

# Output

## gdx_nurb_surf

The GDX NURB Surface entity database pointer or the structure pointer

# Tolerances

          MODEL_SPACE_PNT_TOL
          PNT_PROJ_TOL
          ANGLE_TOL
          ZERO_TOL
          .fi

# Return

          GDX_NOERR
          GDX_INVALIDMODEL
          GDX_INVALIDENTITYTYPE
          Low level error return
          .fi