Synopsis
PDX_MSGT gdx_ConvertCBSToContNurbCBS(long option, MDA_PTR db_ptr, int model, double tolerance, int u_degree, int v_degree, int max_iters, double g1_tol, int *num_of_curve_faces, MDA_PTR **db_ptr_curve_faces, double *max_dev)
Purpose
Convert a GDX Curve Bounded Surface entity to an all G1 continuous GDX NURB Curve Bounded Surface entity
Description
Given a GDX Curve Bounded Surface entity, creates a new GDX curve bounded face entity and converts any non-NURBS entities to NURBS and converts all the GDX composite edge curve entities that may reference non-NURBS GDX entities to reference GDX NURBS entities. If the original GDX Curve Bounded Surface entity and/or GDX composite edge curve entities already reference GDX NURBS entities, the NURBS entities are duplicated in model and the new GDX Curve Bounded Surface and GDX composite edge curve entities references the duplicate GDX NURBS entities.
Parameter space curves for the new GDX NURBS composite edge curve entities are recomputed: .RS 4 o If the base surface was not a GDX NURB Surface which resulted in a conversion to a GDX NURB Surfaces, .RE .RS 4 o The option mask equals GDX_NEWPARMCRV, .RE .RS 4 o The parameter space curve for a given composite edge curve is MDA_NULL_PTR (missing), .RE .RS 4 o The original base curve for a given composite edge curve was not NURBS and the preference is the model space curve .RE .RS 4 o The base GDX NURB 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 a GDX NURB Curve, .RE .RS 4 o The option mask equals GDX_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 a GDX NURB Surface and the preference is not the model space curve, .RE .RS 4 o The option GDX_SPLITDISC was specified and a discontinuity occurs within the parametric domain of the outer trimming boundary. .RE
If the outer boundary of the GDX Curve Bounded Surface is the natural boundary of the surface, and the option mask is set to GDX_NEWMODELCRV, GDX_NEWMODELCRV, or GDX_SPLITDISC then both the model and parameter space curves are created as new GDX NURB Curves and a new outer GDX composite edge curve entity is created.
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 GDX_SPLITDISC is specified, the GDX NURB Curve Bounded Surface entities are split at the point where they are not G1 continuous within g1_tol tolerance. For the option GDX_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) and there must be no seam crossings.
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 gdx_ConvertOffsetToNurbCurve and gdx_ConvertOffsetSurfToNurbSurf for more information). If the option mask GDX_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.
The GDX Curve Bounded Surface entity and all its subordinate entities must be valid GDX 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 GDX NURB Curve Bounded Surface entites must be freed by the application. If the calling application is not part of libgdx, a call to gdx_Free() must be made to free the list. All data created during the conversion process is freed on an error.
Input
option
GDX_KEEPRAT
Keep NURBS curves/surface rational when elevating the degree during conversion
GDX_USEBASEDEG
Use the base surface U and V degree for the degree of the offset surface
GDX_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
GDX_NEWMODELCRV
Recompute the NURBS model space curve from the computed NURBS parameter space curve. The curve preference flag will be set to parameter space curve prefered.
GDX_USEUDEG
Use the U degree parameter ( u_degree) for the degree of any new parameter space curves
GDX_SPLITDISC
Split the GDX NURB Curve Bounded Surface entities that are G1 discontinuous
GDX_OPENCLOSED
Open a closed surface if the projection of the model space curves generates multiple parameter space curves accross the seam closure
db_ptr
The GDX no seam crossing Curve Bounded Surface entity database pointer
model
The model to create the new GDX curve bounded face entity(s) in
tolerance
The conversion approximation tolerance.
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
max_iters
The maximium iterations for convergence test
g1_tol
The G1 continuity tolerance measured as the difference in the tangent vectors as measured in radians
Output
num_of_curve_faces
The number of new GDX NURB Curve Bounded Surface entities
db_ptr_curve_faces
The new GDX NURB Curve Bounded Surface entity database pointers (must be freed by the application, using gdx_Free if the application is not part of libgdx)
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
GDX_NOERR
GDX_NOMEMORY
Low level error return
.fi