Description of the NURBS curve-backer function module and library function API description
Introduction to the NURBS Curveback Reparation Capability Module
This function is encapsulated in a library function called ResurfSurfmap. NURBS curvatures were achieved for the backlash compensation. Full function calls code reference cases。
API Call Process
Called API must be strictly enforced in the following form:
Step 1: Initialize I don't know. Call surfmap_start() Initialization;
Step 2: Enter original gridI don't know. By Call surfmap_import_origstl() Read.stl file import original grid. Or call.surfmap_set_origmesh() Imports raw grid data.
Step 3: Enter the target gridI don't know. By Call surfmap_import_tragetstl() Read the .stl file import target grid. Or call.surfmap_set_newmesh() Imports target grid data.
Step 4: Enter original NURBS curveI don't know. Call surfmap_AppendNurbsData() ,surfmap_Append2DLoop_start(), surfmap_Append2DNurbCurveInLoop(), surfmap_Append2DLoop_end() Equivalent functions import original NURBS curve data;
Or call.surfmap_import_origsurface_igs() Importing surface data from igs files.
Step 5:Set VariableI don't know. Call surfmap_setFeed() Set a curvature;
Step 6: Execute Curve TransformI don't know. Call surfmap_domap() Executing curvatures;
Step 7: Acquiring data on new curves after transformation, and data on the cut boundary curves on new curves 。
Call surfmap_GetNewFaceCount() Number of new pieces to be acquired;
Call surfmap_GetLoopCount() Number of clippings obtained from the face of the face;
Callsurfmap_GetNurbs(a) Access to the chalk data corresponding to faceid;
Callsurfmap_Get2DTrimmingCurveCount() How many shearing curves are available on a ring;
Callsurfmap_Get2DTrimmingCurve(b) Obtain data from the 2D cropper NURBS curve;
Or call.surfmap_export_newsurface_igsDirectly export the surface data to anigs file;
Step 8: Curve transformation over.I don't know. Callsurfmap_end() Ending arctic deformation;
API Parameter Description
extern "C" __declspec(dllimport) void surfmap_Start();
Functions: Initialization. The interface is the function that must be first called.
Parameters: The interface does not have parameters.
extern "C" __declspec(dllimport) bool surfmap_import_origstl(char filename[1024]);
Functions: Imports the .stl file of the original grid.
Enter parameters:char filename[1024] Path to: .stl file;
Return value:true : Success;false: Failure;
extern "C" __declspec(dllimport) bool surfmap_import_tragetstl(char filename[1024]);
Functions: Imports the .stl file of the deforming target grid.
Enter parameters:char filename[1024] Path to: .stl file;
Return value:true : Success;false: Failure;
extern "C" __declspec(dllimport) void surfmap_AppendNurbsData(double* surf_cpx, double* surf_cpy, double* surf_cpz, double* surf_weight, int u_num, int v_num,
int is_surf_rational, int u_degree, int v_degree, double* u_knot, double* v_knot);
Functions: Add an original NURBS curve.
Enter parameter description:
- int u_num : Number of control points on the curve in U direction;
- int v_num: Number of control points on the curve in V direction;
- int u_degree: Number of curves in U direction;
- int v_degree: Number of curves in V direction;
- int is_surf_rational: Whether the Curve is a Rational NURBS Curve. 0 for the rarity B syllable; 1 for the rarity NURBS syllable;
- double* u_knot: Curve knot vector in U direction, length u num+u delee+1
- double* v_knot: Curved knot vector in V direction, v num+v delee+1
- double* surf_cpx: x-weight coordinates of the curve control point, length of u num*v num, in the direction of v;
- double* surf_cpy: y-weight coordinates of the curve control point, length of u num*v num, arranged in v direction;
- double* surf_cpz: z-weight coordinates of the warp control point, length of u num*v num, arranged in the direction of v;
- double* surf_weight(i) A weight on the curve control point, with a length of u num*v num, arranged in the direction of v; if the curve is a sane B line, the value can be empty;
extern "C" __declspec(dllimport) void void surfmap_Append2DLoop_start();
Functions: If the additional side is the cut side, start adding a clipping to the side. Adds the cropring in the order in which you add the outside ring to the inner ring. The outermost ring consists of a tailor curve in the direction of the reverse clockwise, and the inner circle in the direction of the clockwise.
Enter parameter description: None
extern "C" __declspec(dllimport) void surfmap_Append2DNurbCurveInLoop(double* cpu, double* cpv, double* curve_weight, int ctrlp_num, int is_curve_rational, int degree, double* knot);
Functions: Add a 2D curve to the new cropring.
Enter parameter description:
- int ctrlp_num Number of control points in the curve;
- int is_curve_rational: Is this curve a rational NURBS curve? 0 for non-reasonable B-column curves; 1 for rational NURBS curves;
- int degree : number of curves; ctrlp numZXENTTY0XZ=(degree+1); ctrlp num==(degree+1) the curve is Bezier curve;
- double* knot : the knot vector of the curve. ctrlp num+degree+1 length;
- double* cpu : store the u-direction coordinates of the top of the curve, with a length of ctrlp num;
- double* cpv: store the v-direction coordinates of the top point of the curve control, with a length of ctrlp num;
- double* curve_weight: store the power of the curve control point, with a length of ctrlp num; if the curve is a non-reasonable B-line curve, Curve water can be empty;
extern "C" __declspec(dllimport) void surfmap_Append2DLoop_end();
Functions: End of adding cropring.
Enter parameter description: None
extern "C" __declspec(dllimport) void surfmap_setFeed(double feed);
Functions: Sets a curvature.
Enter parameter description: double feed: a value between (0,1.0) controls a surface morphing.
extern "C" __declspec(dllimport) bool surfmap_domap();
Functions: Execute a curvature.
extern "C" __declspec(dllimport) int surfmap_GetNewFaceCount();
Functions: the number of new faces to be obtained.
extern "C" __declspec(dllimport) int surfmap_GetLoopCount(int faceid);
Functions: get the number of clippings on a new side.
Description of output parameters: int faceid: id.
extern "C" __declspec(dllimport) int surfmap_Get2DTrimmingCurveCount(int faceid, int loopid);
Functions: to get the number of shearing curves on the loopid root ring on the new face of faceid.
Description of output parameters:
- int faceid : Curvedid;
- int loopid : id of the cropring;
extern "C" __declspec(dllimport) bool surfmap_GetNurbs(int faceid, int* u_num, int* v_num, int* u_degree, int* v_degree, double** u_knot, double** v_knot, double** cpx, double** cpy, double** cpz);
Functions: Get data on the new NURBS curve.
Description of output parameters:
- int faceid : Curvedid;
- int *u_num : Number of control points on the curve in U direction;
- int *v_num: Number of control points on the curve in V direction;
- int *u_degree: Number of curves in U direction;
- int *v_degree: Number of curves in V direction;
- double** u_knot: Curves in U-directed knot vector with u num+u delee+1 length;
- double** v_knot: Curvature knot vector in V direction, v num+v delee+1 length;
- double** cpx: x-weight coordinates of the curve control point, length of u num*v num, in the direction of v;
- double** cpy: y-weight coordinates of the curve control point, length of u num*v num, arranged in v direction;
- double** cpz: z-weight coordinates of the warp control point, length of u num*v num, arranged in the direction of v;
extern "C" __declspec(dllimport) void surfmap_Get2DTrimmingCurve(int faceid, int loopid, int curveid, int* ctrlp_num, int* degree, double** knot, double** cpu, double** cpv);
Functions: given curved id (faceid), given to the id (loopid) of the cutring, extracts the curveid 2D curve data from the boundary ring.
Output Parameters:
Data of curved boundary curve:
- int faceid : Curvedid;
- int loopid : id of the cropring;
- int curveid : id id on the boundary ring;
- int *ctrlp_num Number of control points in the curve;
- int *degree Number of curves;
- double** knot : the knot vector of the curve. ctrlp num+degree+1 length;
- double** cpu : store the u-direction coordinates of the top of the curve, with a length of ctrlp num;
- double** cpv: store the v-direction coordinates of the top point of the curve control, with a length of ctrlp num;
extern "C" __declspec(dllimport) void surfmap_end();
Functions: End of the curve.