Synopsis

PDX_MSGT gdx_ConvertNurbToNurbCurve(long option, MDA_PTR gdx_nc_ptr, int model, double tolerance, int degree, int max_iters, MDA_PTR *gdx_new_nc_ptr)

Purpose

Convert a GDX NURB Curve to another GDX NURB Curve

Description

Converts a GDX NURB curve entity to another GDX NURB curve entity. The conversion converts the NURBS curve to a lower or higher degree.

By default, when the curve is converted, the new curve is non-rational and all curves are converted. The GDX_KEEP_RAT option can be specified to keep curves rational when the degree is increased. The GDX_RATIONAL_ONLY option can be specified, so that only rational NURBS are converted. Finally, the GDX_DEGREE_1 option can be specified to keep curves that are degree 1.

The tolerance and max_iters values apply to the NURBS curve that is approximated as the new GDX NURB Curve. The tolerance is the measure of how far the lower degree and/or non-rational curve can vary from the original curve. The max_iters is the maximium number of iterations that a span in the original NURBS curve is subdivided for approximating the new NURBS curve. Typically only several iterations are required for convergence to the tolerance, but a discontinuous original NURBS curve may never converge to the required tolerance.

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

The GDX NURB Curve entity must be a valid GDX definition.

If the GDX NURB Curve is converted to a higher degree and optionally kept rational the conversion is an exact conversion to machine precision. Otherwise, the conversion is an approximation to tolerance.

Input

option

GDX_COMMIT

Commit the GDX NURB Curve to the database

GDX_KEEPRAT

Keep rational when elevating the degree

GDX_RATIONAL_ONLY

Convert only rational NURBS

GDX_KEEP_DEGREE_1

Keep degree 1 curves degree 1

gdx_nc_ptr

The valid GDX NURB Curve entity database pointer

model

The model to create the GDX NURB Curve in

tolerance

The conversion approximation tolerance

degree

The converted NURBS curve degree

max_iters

The maximium iterations to allow for convergence to tolerance

Output

gdx_new_nc_ptr

The GDX NURB curve entity database pointer or structure pointer

Tolerances

      MODEL_SPACE_PNT_TOL
      PNT_PROJ_TOL
      ANGLE_TOL
      ZERO_TOL
      .fi

Return

      GDX_NOERR
      GDX_ENTITY_NOT_NURBS
      GDX_INVALIDMODEL
      Low level error return
      .fi