Synopsis

PDX_MSGT igeo_Convert142ToNurbs142(long option, MDA_PTR db_ptr, MDA_PTR db_ptr_new_128, EAM_STACK *stack, int model, double tolerance, int max_iters, int u_degree, int v_degree, MDA_PTR *db_ptr_142, double *max_dev)

Purpose

Convert an IGES 142 entity to an all IGES NURBS 142 entity

Description

Given an IGES 142 entity that references non-NURBS entities, converts the non-NURBS IGES entities to NURBS IGES entities. If the 142 references IGES NURBS entities, the IGES NURBS entities are duplicated in the new model and referenced by the new IGES 142 entity.

Parameter space curves are recomputed: .RS 4 o If the base surface was a non-NURBS IGES surface that was converted to a NURBS(IGES 128) surface, .RE .RS 4 o The db_ptr_new_128 is not MDA_NULL_PTR and/or the option mask equals IGEO_USENURBSURF, .RE .RS 4 o The option mask equals IGEO_NEWPARMCRV, .RE .RS 4 o The parameter space curve is missing (MDA_NULL_PTR), .RE .RS 4 o The original base curve was not NURBS and the preference flag indicates that the model space curve definition is prefered. .RE

Model space curves are recomputed: .RS 4 o If the model space curves are non-NURBS, .RE .RS 4 o The option masks equals IGEO_NEWMODELCRV, .RE .RS 4 o The model space curve is missing (MDA_NULL_PTR) and the preference is not for the model space curve definition and the original base surface is an IGES NURBS surface and the parameter space curve is not missing. .RE

The u_degree and v_degree are used to determine the degree of an IGES offset surface or an IGES offset curve ( u_degree ) that needs to be converted to an approximate IGES NURBS curve or surface. If the option mask IGEO_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 maximium 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.

By default the IGES entity matrix is applied to the IGES NURBS curve and all the IGES 142 non-pointer DE attributes are applied to the new NURBS base IGES 142 entity. If the model is the same as the db_ptr model than all the IGES pointer DE attributes, property pointers and associativity pointers are applied to the new IGES NURBS base 143 entity.

The IGES 142 entity and all its subordinate entities must be valid IGES definitions except for the cases where missing model or parameter space curves are supported.

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

IGES_NOMATRIX

Do not apply entity matrix to data

IGEO_KEEPRAT

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

IGEO_BASEDEG

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

IGEO_NEWPARMCRV

Recompute the parameter space trimming curve by projecting the NURBS model space curve to the NURBS surface

IGEO_NEWMODELCRV

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

IGEO_USENURBSURF

Use the new IGES 128 entity ( db_ptr_new_128) that was converted from a non IGES 128 entity

IGEO_USEUDEG

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

IGEO_OPENCLOSED

Open a closed surface if the projection of the model space curves generates multiple parameter space curves accross the seam closure. NOTE: If multiple parameter space curves still result, then the IGES 142 must be convert to an IGES 141

db_ptr

The IGES 142 entity database pointer

db_ptr_new_128

The database pointer of the new IGES 128 entity that should be used for the converted 142 surface or MDA_NULL_PTR.

stack

The entity attribute stack handle

model

The model to crete the new IGES 142 entity in

tolerance

The conversion approximation tolerance. Note: The MODEL_SPACE_PNT_TOL should be at least 2 orders of magnitude less than this tolerance for correct results.

max_iters

The maximium iterations for convergence test

u_degree

The converted NURBS curve degree and/or the converted NURBS surface U degree (should be >= 1). See description for IGEO_USEUDEG option above.

v_degree

The converted NURBS surface V degree (should be >= 1)

Output

db_ptr_142

The new IGES 142 entity database pointer

max_dev

The maximium 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

      IGEO_NOERR
      IGEO_NOMEMORY
      IGEO_NOPARMCRV
      IGEO_TOOMANYPARMCRV
      IGEO_NOMODELCURV
      IGEO_NOPARMCURV
      Low level error return
      .fi