Introduction to the NURBS surface hole-filling module and its API
Description of the functional module of the NURBS curvature filling hole
This function is encapsulated in a library function called ResurfNurbs. The ResurfNurbs library function provides a function to supplement a hole with a NURBS curvature for certain geometrys. The NURBS curvature fills the hole and reaches the G1 line of the hole. The ResurfNurbs library function provides a continuous G0/G1 numerical report.
Figure 1 below is a geometric model with holes:
(Chart 1)
Figure 2 picks up the blue hole boundary line as an input parameter to generate the NURBS curve:
(Chart 2)
Figure 3 generated a cut of the NRUBS curve fill hole:
(Chart 3)
Figure 4 is a continuous G1 deviation report on the public boundary line between a hole NURBS and the adjacent NURBS curve.
(Chart 4)
ResurfNurbs library functionIt can generate a tailoring face to fill a hole, and a non-cutted quadrilateral to fill a hole. Specifically, a curve of that type fills a hole, and the user can choose from the form of the hole boundary.
API Call Process
Called API must be strictly enforced in the following form:
Step 1: Initialize I don't know. Call RsFillHoleByNurbs Start() for initialization;
Step 2: Enter boundary line I don't know. Call RsFilillHoleByNurbs AppendBundaryCurve() to add a 3D curve or call RsFilillHoleByNurbs AppendSurfaceEdge() to add a curved boundary line. These boundary lines must be enclosed in a closed circle, and their end-ends and end-points should not be too close.
Step 3: Parameter Settings I don't know. Call RsFilleHoleByNurbs SetSmoothFactor() to set a curved smoothness.
Step 4: Parameter Settings I don't know. Call RsFilleHoleByNurbs SetDrapSurfaceType() to set the type of the curve;
Step 5: Generate Curve I don't know. Call RsFilillHoleByNurbs DoFill() to perform side-generated production;
Step 6: Fetch generated curve data I don't know. Call RsFillHoleByNurbs GetNurbs() to get a generated NURBS curve;
Step 7: If you generate a cropping face, get the data on the boundary curve I don't know. Call RsFilillHoleByNurbs Get2DTrimmingCurveCount() to get the number of curves on the cropring; call RsFilillHoleByNurbs Get2DTrimmingCurve() to get the data on the Article I 2D Boundary Line; call RsFilillHoleByNurbs Get3DTrimmingCurve() to get the data on the Article I 3D Line;
Step 8: Get a continuity report on the new curve boundary lineI don't know. Call RsFilillHoleByNurbs GetMaxG1ReportData (double** point x, double** point y, double** point**point z, double**angles, int* point num); RsFilleByNurbs GetG1ReportData (double** point x, double** point y, double**.double**angles, int* point**mint num; RsFilleHelbyNubs Get GpotMaxG0ReportData (double**point x, double**dob**doublint**gim Goint Gunit Gbut Dou.
Step9 : End Call 。 RsFillHoleByNurbs_End() 。
API Parameter Description
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Start();
Functions: Initialization. The interface is the function that must be first called.
Parameters: The interface does not have parameters.
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_AppendBoundaryCurve(double* cpx, double* cpy, double* cpz, double* weight, int ctrlp_num, int is_rational, int degree, double* knot);
Functions: Add a 3D NURBS curve as a boundary line. 3D NURBS curve refers to a space curve that is not on the curve.
Enter parameter description:
- int ctrlp_num Number of control points in the curve;
- int is_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* cpx : x-coordinate for store curve control point, long as ctrlp num;
- double* cpy: store y-coordinates for the top point of the curve control, long as ctrlp num;
- double* cpz: x-coordinate to store curve control point, ctrlp num;
- double* weight: store the power of the curve to control the vertex, with a length of ctrlp num; if the curve is an insignificant B bar curve, weight can be empty;
(Figure 5. Green 3D curve)
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_AppendSurfaceEdge(double* cpu, double* cpv, double* curve_weight, int ctrlp_num, int is_curve_rational, int degree, double* knot,int iso_type, int continuity, int hasface, 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 a curve (surface Edge) as a boundary line. Curved boundary curve (surface Edge) refers to a curve that falls on the curve and is defined by a two-dimensional curve in the space of the 2D parameters of a curve.
Enter parameter description:
Parameters contain two parts: the NURBS curve data and the NURBS curve data.
NURBS Curve Data:
- 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;
Data on curved boundary curves :
- 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;
- int iso_type: Whether the curve is equal:
- -1: The curve is 3d without curved information;
- 0: Non-equivalent; .
- 1: x_iso;
- 2: y_iso;
- 3: west iso; u=u to start
- 4: South iso; v=v to start point
- 5: East iso; u=u to end point
- 6: north iso; v=v to end point
- int continuity: Consistency of new curves on this curve, 0: G0; 1: G1
- int hasface: The value is always 1
(Figure 6. Blue curve (surface edge))
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_SetSmoothFactor(double factor);
Functions: control the smoothness of the new face.
Enter parameter description:
(a) double factor: [0.0001,1.0] values between the larger and smoother;
extern "C" __declspec(dllimport) void void RsFillHoleByNurbs_SetDrapSurfaceType(int type);
Functions: Sets the surface construction direction, according to the selected construction mode, and specifies whether the resulting surface is trimmed.
Enter parameter description:
int type:
- 0 --- autocalculating stretches, generate a trimmed surfaces.
- 1 - stretches along the x-axis and produces a tailored face
- 2 - stretching along y-axis to create a tailored face
- 3 - stretching along the z-axis to generate the cut face
(Figure 7. The blue curve fills a hole with a tailor face)
- 4 - Fixed four boundary lines stretching to generate non-reciprocal curvatures ... The program automatically calculates 4 angles.
(Figure 8. The blue curve fills a hole with a non-heared face)
- 5 - Fixed four boundary lines stretching to produce the first type of cones (coons) non-critic surface ... The program automatically calculates 4 angles.
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_DoFill();
Functions: Execute curve generation.
extern "C" __declspec(dllimport) bool RsFillHoleByNurbs_GetNurbs(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 *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) int RsFillHoleByNurbs_Get2DTrimmingCurveCount();
Functions: returns the number of border lines for the new cropping face. If the new curve is the non-cuted side, the number is 0, and if the cropped side, these boundary curves form a boundary ring. Each border curve can be retrieved from the 3D curve in the position of the 2D curve and the physical curve.
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Get2DTrimmingCurve(int index, int* ctrlp_num, int* degree, double** knot, double** cpu, double** cpv);
Functions: given index, removes the 2D curve data from the boundary ring.
Output Parameters:
Data of curved boundary curve:
- int index: 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 RsFillHoleByNurbs_Get3DTrimmingCurve(int index, int* ctrlp_num, int* degree, double** knot, double** cpx, double** cpy, double** cpz);
Functions: given index, remove the 3D curve data from the boundary ring.
Output Parameters:
Data of curved boundary curve:
- int index: id id on the boundary ring;
- int *ctrlp_num Number of control points in the curve;
- 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** cpx : store x-point coordinates of the top of the curve, with ctrlp num length;
- double** cpy: store the y-point coordinates of the top of the curve, with a length of ctrlp num;
- double** cpz: x-point coordinates for store curve control point, long as ctrlp num;
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_End();
Functions: End curve generation.
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Clear();
Functions: Clear all data, reset.
extern "C" __declspec(dllimport) bool RsFillHoleByNurbs_GetStatus();
Functions: See if a curve is successfully generated.
Return value:
- true :NURBS was successfully produced;
- false :No curves generated;
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetMaxG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num);
Functions: Report the largest G1 continuous deviation angle on each segment of the boundary in a state of successful curve generation. If the boundary line is a curved curve, there is a continuous G1 angle deviation; if the boundary line is a 3D curve, there is no continuous G1 angle deviation.
Output Parameters:
- double** point_x : x-coordinate fraction of the point where the maximum continuous G1 angle deviation is located on the boundary line, which is *point num;
- double** point_y: y-coordinates at the point of the maximum continuous G1 angle deviation on the boundary line, which is *point num;
- double** point_z: x-coordinates at the point of the maximum continuous G1 angle deviation on the boundary line, which is *point num;
- double** deviation: the G0-continuous Spectra-Range-Range at the point at which the largest G1-continuous margin is present on the boundary line. The group size is *point num;
- int* point_numNumber of continuous boundary lines capable of measuring G1;
(Chart 9)
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num);
Functions: Report the largest continuous G1 deviation angle at a number of discrete points on the curved boundary line in a state of successful curve generation. If the border line is a curved curve, there is a continuous G1 angle deviation; if the border line is a 3D curve, there is no continuous G1 angle deviation.
Output Parameters:
- double** point_x : x-coordinates at the point of the continuous G1 angle deviation on the boundary line, which is *point num;
- double** point_y: y-coordinates at the point of the continuous G1 angle deviation on the boundary line, which is *point num;
- double** point_z(i) z-coordinates at the point where the G1 continuous angle deviation value is located on the boundary line, which is of *point num size;
- double** deviation: G0-continuous spectra at the point of the G1-continuous spectra at the boundary line. The group size is *point num;
- int* point_num: Number of discrete points on the boundary line;
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetMaxG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num);
Functions: The largest G0 continuous distance deviation is reported for each section of the boundary line in a state of success in generating a curve. Each line of the curve, whether a curve or a 3D curve, has a G0 continuous distance deviation value.
Output Parameters:
- double** point_x : x-coordinates at the point of the maximum continuous distance deviation of G0 on the boundary line, which is *point num;
- double** point_y: y-coordinates at the point of the maximum continuous distance deviation of G0 on the boundary line, which is *point num;
- double** point_z: x-coordinates at the point of the maximum continuous distance deviation of G0 on the boundary line, the size of which is *point num;
- double** deviation: the G0 continuous margin at the point of the maximum continuous distance deviation of the G0 on the boundary line. The group size is *point num;
- int* point_numNumber of continuous boundary lines capable of measuring G0;

(Chart 10)
extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num);
Functions: Report a G0 continuous distance deviation at a number of discrete points on the boundary line in a state of success in generating a curve. Each line on the curve, whether a curve or a 3D curve, has a G0 continuous distance deviation value.
Output Parameters:
- double** point_x : x-coordinate fraction of the point where the G0 continuous distance deviation value is located on the boundary line, which is *point num;
- double** point_y: y-coordinates at the point where the G0 continuous distance deviation value is located in the boundary line, which is *point num;
- double** point_z: x-coordinates at the point where the G0 continuous distance deviation value is located on the boundary line, which is of *point num size;
- double** deviation: G0 continuous margin at the point of the G0 continuous distance margin on the boundary line. The group size is *point num;
- int* point_num: Number of discrete points;