# Synopsis

PDX_MSGT igeo_Convert143ToNurbs144(long option, MDA_PTR db_ptr, EAM_STACK *stack, int model, double tolerance, int max_iters, int u_degree, int v_degree, int *num_144, MDA_PTR **i144_ptr, double *max_dev)

# Purpose

Convert an IGES 143 entity to one or more all IGES NURBS 144 entities

# Description

Given an IGES 143 entity that references non-NURBS entities, converts the non-NURBS entities to NURBS and converts all the 141 entities that reference non-NURBS IGES entities to reference IGES NURBS entities. If the IGES 143 and/or IGES 141 entities reference IGES NURBS entities, the IGES NURBS entities are duplicated in the new model and referenced by the new IGES 143 and IGES 141 entities.

Parameter space curves are recomputed: .RS 4 o If the base surface was a non-NURBS surface that was converted to a NURBS(IGES 128) surfaces, .RE .RS 4 o The option mask equals IGEO_NEWPARMCRV, .RE .RS 4 o The bounded surface type indicates references to model space curves only. .RE

Model space curves are recomputed: .RS 4 o If the model space curves are not IGES NURBS 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 IGEO_NEWMODELCRV is set to recompute the model space curves, .RE .RS 4 o The option IGEO_OPENCLOSED was specified and the surface was closed and the outer boundary in parameter space traverses the complete parameter domain in U and/or V. .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 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 143 non-pointer DE attributes are applied to the new NURBS base IGES 143 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 IGES NURBS base 143 entity.

The IGES 143 entity and all its subordinate entities must be valid IGES 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. The resulting 143 entity is check to see if it can directly map to an IGES 144 entity (the base surface is not closed and/or no seams are crossed) in which case one 144 entity will be created. If the 143 entity can not map directly to a single IGES 144 entity (for example if the 143 has seams and a trimming curve crosses a seam), the 143 is split into 2 or more 144 entities. After conversion to the IGES NURBS 144 entities, the converted IGES NURBS 143 is deleted.

If the option IGEO_OPENCLOSED is specified and the base surface is closed in the U and/or V parametric direction, the base IGES NURBS surface is opened. If the extents of the outer trimming boundary do not span the parametric domain of the base surface, the IGES NURBS surface is relimited to include the parametric extents of the outer trimming boundary of the IGES NURBS 144. Otherwise, the surface is split in half in each parametric direction that is closed and new IGES NURBS 144 entities are created.

The array of IGES NURBS 144 database pointers must be freed by the application. If the application is not part of libiges, the database pointers must be freed using iges_Free.

# 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

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

### IGEO_NEWMODELCRV

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

### IGEO_OPENCLOSED

Open a closed base surface by relimiting of subdividing.

### IGEO_USEUDEG

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

## db_ptr

The IGES 143 entity database pointer

## stack

The entity attribute stack handle

## model

The model to crete the new IGES 143 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 to insure 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

## num_144

The number of NURBS IGES 144 entities created

## i144_ptr

The new NURBS IGES 144 entity database pointers (must be freed by the application, using iges_Free if the application is not part of libiges).

## 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
          Low level error return
          .fi