Synopsis

PDX_MSGT igeo_Convert144ToContNurbs144(long option, MDA_PTR db_ptr, EAM_STACK *stack, int model, double tolerance, int max_iters, int u_degree, int v_degree, double g1_tol, int *num_of_144, MDA_PTR **db_ptr_144, double *max_dev)

Purpose

Convert an IGES 144 entity to an all G1 continuous IGES NURBS 144 entity

Description

Given an IGES 144 entity, creates a new IGES 144 and converts any non-NURBS entities to NURBS and converts all the 142 entities that may reference non-NURBS IGES entities to reference IGES NURBS entities. If the original IGES 144 and/or IGES 142 entities already reference IGES NURBS entities, the NURBS entities are duplicated in model and the new IGES 144 and IGES 142 entities references the duplicate IGES NURBS entities.

Parameter space curves for the new IGES NURBS 142 entities are recomputed: .RS 4 o If the base surface was not an IGES NURBS surface which resulted in a conversion to a NURBS (IGES 128) surfaces, .RE .RS 4 o The option mask equals IGEO_NEWPARMCRV, .RE .RS 4 o The parameter space curve for a given trimming curve (IGES 142) is MDA_NULL_PTR (missing), .RE .RS 4 o The original base curve for a given trimming curve (IGES 142) was not NURBS and the preference is the model space curve .RE .RS 4 o The base IGES NURBS surface was modified due to internal G0 and/or G1 discontinuities. .RE

Model space curves are recomputed: .RS 4 o If the model space curve(s) are not an IGES NURBS curve, .RE .RS 4 o The option mask equals IGEO_NEWMODELCRV, .RE .RS 4 o The model space curve of a given trimming curve is MDA_NULL_PTR (missing) and the original base surface is an IGES NURBS surface and the preference is not the model space curve, .RE .RS 4 o The option IGEO_SPLITDISC was specified and a discontinuity occurs within the parametric domain of the outer trimming boundary. .RE

If the outer boundary of the 144 is the natural boundary of the surface, and the option mask is set to IGEO_NEWMODELCRV, IGEO_NEWMODELCRV, or IGEO_SPLITDISC then both the model and parameter space curves are created as new IGES NURBS curves and a new outer IGES 142 entity is created changing the boundary type flag is changed to 1.

If the base converted NURBS surface is not G1 continuous within g1_tol tolerance everwhere, the base NURBS surface is forced to be G1 continuous by default. If the option IGEO_SPLITDISC is specified, the IGES NURBS 144 entities are split at the point where they are not G1 continuous within g1_tol tolerance. For the option IGEO_SPLITDISC the model space and the corresponding parameter space curves must have the correct orientation(the outer boundary must be counterclockwise oriented in parameter space and the inner boundaries clockwise oriented). The non-pointer DE parameter data of the surface is associated with the curve entities created in this case.

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 (see igeo_Convert130To126 and igeo_Convert140To128 for more information). 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 144 non-pointer DE attributes are applied to the new NURBS base IGES 144 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 144 entity.

The IGES 144 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 list of 1 or more new IGES NURBS 144 entites ( db_ptr_144) must be freed by the application. If the application is not part of libiges, iges_Free must be used to free this list. All data created during the conversion process is freed on an error. It is recommended that the application call the function igeo_DeleteGDXData to free the GDX entities created for both the original and any new IGES 144 entities unless the IGES 144 entities will be reused by the IGES or GDX Geometry subsystems.

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_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

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 parameter space curve prefered.

IGEO_USEUDEG

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

IGEO_SPLITDISC

Split the IGES NURBS 144 entities that are G1 discontinuous

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 144 must be convert to an IGES 143

IGEO_BASEDEG

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

db_ptr

The IGES 144 entity database pointer

stack

The entity attribute stack handle

model

The model to crete the new IGES 144 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 for entities that require approximation

v_degree

The converted NURBS surface V degree for entities that require approximation

g1_tol

The G1 continuity tolerance measured as the difference in the tangent vectors as measured in radians

Output

num_of_144

The number of new IGES 144 entities

db_ptr_144

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