Synopsis

PDX_MSGT gdx_ConvertCurveToNurbCurve(long option, MDA_PTR gdx_curve_ptr, int model, double tolerance, int degree, int max_iters, void *gdx_nc)

Purpose

Convert a GDX curve entity to a GDX NURB Curve entity

Description

Converts a GDX curve entity to a GDX NURB curve entity. The GDX curve can be any GDX curve including a GDX NURB curve. If the GDX curve is a GDX NURB curve, then the GDX NURB curve is converted to another GDX NURB curve based on the degree, tolerance, rationality, and option. If the GDX NURB Curve is a rational curve the curve will be converted to a non-rational GDX NURB Curve of the desired degree unless the option GDX_KEEPRAT is set. If the degree is equal to or greater then the GDX NURB Curve degree and the option GDX_KEEPRAT is set, the the conversion is exact, otherwise the conversion is an approximation to tolerance. The degree value only applies when a GDX NURB Curve is converted to another GDX NURB Curve. The value of degree in this case must be > 0.

The tolerance value applies to entites that are GDX spline and/or offset curve entities. The max_iters value applies to GDX offset curve entities that are approximated as GDX NURB curves and GDX NURB curves that are approximated as GDX NURB curves 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 Curve is created.

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

If the curve is a GDX_COMP_CURVE and it contains degenerate curves (as determined by a tolerance of MODEL_SPACE_PNT_TOL), the degenerate curves will be skipped during the conversion.

Input

option

GDX_COMMIT

Commit the GDX NURB curve to the database

GDX_KEEPRAT

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

GDX_KEEPDEGEN

Do not check for degenerate curves in composite

gdx_curve_ptr

The GDX curve entity database pointer

model

The model to create the GDX NURB curve in

tolerance

The tolerance for approximating the GDX NURB curve in the case of converting an offset curve, a NURB curve to non-rational or lower degree, or for removing knots when a parametric spline is converted

degree

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

max_iters

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

Output

gdx_nc

The GDX NURB curve entity structure or database pointer

Tolerances

      MODEL_SPACE_PNT_TOL
      PNT_PROJ_TOL
      ANGLE_TOL
      .fi

Return

      GDX_NOERR
      GDX_ENTITYNOTCURVE
      Low level error return
      .fi