# Synopsis

PDX_MSGT gdx_ConvertSurfCmpEdgCrvToNurb(long option, MDA_PTR db_ptr, MDA_PTR gdx_new_ns_ptr, int model, double tolerance, int u_degree, int v_degree, int max_iters, void *gdx_nurbs_cec, double *max_dev)

# Purpose

Convert a GDX surface composite edge curve entity to an all GDX NURBS composite edge curve entity

# Description

Given a GDX composite edge curve entity that references NURBS or non-NURBS entities, converts the non-NURBS entities to NURBS. If the composite edge curve references GDX NURBS entities, the GDX NURBS entities are duplicated in the new model and referenced by the new GDX composite edge curve.

Parameter space curves are recomputed: .RS 4 o If the base surface was a non-NURBS surface that was converted to a NURBS surfaces, .RE .RS 4 o The gdx_new_ns_ptr is not MDA_NULL_PTR and/or the option mask equals GDX_USENURBSURF, .RE .RS 4 o The option mask equals GDX_NEWPARMCRV, .RE .RS 4 o The composite edge curve type indicates references to model space curves only. .RE .RS 4 o The composite edge curve type indicates references to model space curves are prefered and the original base curve was not NURBS. .RE .RS 4 o The parameter space curve(s) is missing. .RE

Model space curves are recomputed: .RS 4 o If the model space curves are not GDX NURB Curves .RE .RS 4 o If a new parameter space curve was computed and the preference flag is parameter space, .RE .RS 4 o The option GDX_NEWMODELCRV is set to recompute the model space curves. .RE .RS 4 o The model space curve(s) is missing and the original base surface is NURBS and the parameter space curves are not missing. .RE

The u_degree and v_degree are used to determine the degree of an offset surface or offset curve ( u_degree ) that needs to be converted to an approximate NURBS curve or surface. If the option mask GDX_USEUDEG is set then the @ u_degree is used to specify the degree of the parameter space curve created from projecting the NURBS model space curve to the NURBS surface (by default the degree of the existing parameter space curve or the maximum surface degree if the parameter space curve is missing is used for the degree of the parameter space curve). The tolerance and max_iters values apply to the NURBS curves or surface that are approximated. In addition, the tolerance applies to the test for curve and surface closure.

The GDX composite edge curve entity and all its subordinate entities must be valid GDX definitions.

The conversion is exact where the curve and surface entities convert extactly to the NURBS definition, otherwise the conversion is an approximation to tolerance. The projection of new parameter space curves and/or creation of new model space curves from parameter space curves is an approximation to tolerance.

# Input

## option

### GDX_COMMIT

Commit the GDX composite edge curve to the database

### GDX_KEEPRAT

Keep NURBS curves/surface rational when elevating the degree during conversion

### GDX_USEBASEDEG

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

### GDX_NEWPARMCRV

Recompute the parameter space trimming curve by projecting the NURBS model space curve to the NURBS surface in the cases where the base surface is already a NURBS surface

### GDX_NEWMODELCRV

Recompute the NURBS model space trimming curve from the computed NURBS parameter space trimming curve when the parameter space curve is recomputed. The preference flag will be set to parameter space curve prefered.

### GDX_USENURBSURF

Use the new GDX NURB Surface entity ( gdx_new_ns_ptr ) that was converted from non NURBS GDX entity

### GDX_USEUDEG

Use the U degree parameter ( u_degree ) for the degree of any new parameter space curves

### GDX_OPENCLOSED

Open a closed surface if the projection of the model space curves generates multiple parameter space curves accross seam closure.

## db_ptr

The GDX composite edge curve entity database pointer

## gdx_new_ns_ptr

The database pointer of the new GDX NURB Surface entity that should be used for the converted composite edge curve surface or MDA_NULL_PTR.

## model

The model to create the new GDX composite edge curve entity in

## tolerance

The conversion approximation tolerance.

## u_degree

The converted NURBS curve degree and/or the converted NURBS surface U degree

## v_degree

The converted NURBS surface V degree

## max_iters

The maximum iterations for convergence test

# Output

## gdx_nurbs_cec

The new GDX NURB composite edge curve entity database pointer or structure pointer

## max_dev

The maximum deviation of the model space curve to the surface.

# Tolerances

          MODEL_SPACE_PNT_TOL
          PARM_SPACE_PNT_TOL
          ANGLE_TOL
          ZERO_TOL
          CONVERGE_TOL
          KNOT_TOL
          PNT_PROJ_TOL
          PARALLEL_LINES_TOL
          COLLINEAR_TOL
          COPLANAR_TOL
          .fi

# Return

          GDX_NOERR
          GDX_NOMEMORY
          Low level error return
          .fi