Introduction to NURBS Surface Fill Holes Function Module

Download the stand-alone application for testing this feature from here. Find the following GUI in the application for this feature.

The feature is encapsulated in a package called ResurfNurbs. For the phenomenon of holes or defects in some geometries, the ResurfNurbs library function provides the function of compensating for the defects of holes with NURBS surfaces. After the NURBS surface fills the hole, it reaches G1 continuous at the hole boundary. The ResurfNubbs library function provides a continuous numerical report of G0/G1.

Figure 1 below is a geometric model with holes :

图1

( Figure 1 )

Fig. 2 Pick up the blue hole boundary line as the input parameter to generate the NURBS surface :

图2

(Figure 2)

Figure 3 generates a clipped NRUBS surface fill hole :

图3

(Figure 3)

Figure 4 shows the G1 continuity deviation report of the hole NURBS and the adjacent NURBS surface on the common boundary line:

图4

(Figure 4)

The ResurfNurbs library function can generate both clipped surface fill holes and non-clipped quad surface fill holes. Specifically filling holes with that type of surface, the user can choose based on the shape of the hole boundary.

 

API Call

Calling the API must be strictly enforced in the following form:

Step 1: Initialization . Call RsFillHoleByNurbs_Start() for initialization;

Step 2: Enter the boundary line . Call RsFillHoleByNurbs_AppendBoundaryCurve() to add a 3D curve or RsFillHoleByNurbs_AppendSurfaceEdge() to add a surface boundary line. These boundary lines must be enclosed in a closed loop, and their end-to-end distance from end to end should not be too large.

Step 3: Parameter settings . Call RsFillHoleByNurbs_SetSmoothFactor() to set the surface smoothness.

Step 4: Set the parameters . Call RsFillHoleByNurbs_SetDrapSurfaceType() to set the shape type of the surface;

Step 5: Generate Surface . Call RsFillHoleByNurbs_DoFill() to perform surface generation;

Step 6: Get the generated surface data . Call RsFillHoleByNurbs_GetNurbs() to get the resulting NURBS surface;

Step 7: If the crop surface is generated, get the data of the clipping boundary curve . Call RsFillHoleByNurbs_Get2DTrimmingCurveCount() to get the number of boundary curves on the clipping ring; Call RsFillHoleByNurbs_Get2DTrimmingCurve() to get the data for the ith 2D clipping boundary line; Call RsFillHoleByNurbs_Get3DTrimmingCurve() to get the data for the ith 3D cropped boundary line;

Step 8: Get the report for the coninuity on the new surface edge. Call RsFillHoleByNurbs_GetMaxG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num); RsFillHoleByNurbs_GetG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num); RsFillHoleByNurbs_GetMaxG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num); RsFillHoleByNurbs_GetG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num); checkG0/G1 continuity on surface edges.

Step9 : End calling. RsFillHoleByNurbs_End() .

 

API parameter description

  extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Start();

Function : Initialize the function. This interface is the function that must be called first .

Parameters : The interface has no 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);

Function : Add a 3D NURBS curve as a boundary line. A 3D NURBS curve is a spatial curve that is not on a surface.

Input parameter description

图5. 绿色为3D 曲线

( Figure 5. Green is a 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);

Function : Add a surface edge as a boundary line. A surface edge is a curve that falls on a surface, defined by a two-dimensional curve on a surface's 2D parameter space.

Input parameter description

The parameter contains two parts: NURBS surface data and surface boundary curve data.

NURBS Surface Data

Data of surface boundary curves

图6. 蓝色为曲面曲线(surface edge)

( Figure 6. Blue is the surface edge )

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_SetSmoothFactor(double factor);

Function : Control the smoothness of new surfaces .

Input parameter description

double factor : [0.0001,1.0], the larger the surface, the smoother it is ;

 

extern "C" __declspec(dllimport) void void RsFillHoleByNurbs_SetDrapSurfaceType(int type);

Function: Set the stretch form of the surface, and set whether the surface is a cropped surface according to the value of the stretch form.

Input parameter description

int type:

图7. 蓝色曲线内为用裁剪曲面填充孔洞

( Figure 7. Fill the holes with clipped surfaces in the blue curve )

 

图8. 蓝色曲线内为用非裁剪曲面填充孔洞

( Figure 8. Inside the blue curve is filled with a non-clipping surface )

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_DoFill();

Function: Perform surface 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);

Function: Get data for new NURBS surfaces.

Output parameter description

 

 

 

extern "C" __declspec(dllimport) int RsFillHoleByNurbs_Get2DTrimmingCurveCount();

Function: Returns how many boundary lines the new clipping surface consists of. If the new surface is a non-clipping surface, this number is 0. If it is a clipping surface, these boundary curves form a bounding ring. Each boundary curve can be taken from a 2D curve on the parameter domain and a 3D curve on the physical surface position.

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Get2DTrimmingCurve(int index, int* ctrlp_num, int* degree, double** knot, double** cpu, double** cpv);

Function: Given an index, take out the index 2D curve data on the boundary ring.

Output parameter description

Data of surface boundary curves :

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Get3DTrimmingCurve(int index, int* ctrlp_num, int* degree, double** knot, double** cpx, double** cpy, double** cpz);

Function: Given an index, retrieve the index 3D curve data on the bounding ring.

Output parameter description

Data of surface boundary curves :

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_End();

Function: End surface generation 。

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_Clear();

Function: Erase all data, reset .

 

extern "C" __declspec(dllimport) bool RsFillHoleByNurbs_GetStatus();

Function: See if the surface is successfully generated.

Return value :

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetMaxG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num);

Function: Reports the maximum G1 continuous deviation angle on each boundary line in the state of successful surface generation. If the boundary line is a surface curve, there is a continuous angular deviation value of G1. If the boundary line is a 3D curve, there is no G1 continuous angular deviation value.

Output parameter description:

图9

( Figure 9)

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetG1ReportData(double** point_x, double** point_y, double** point_z, double** angles, int* point_num);

Function: Reports the maximum G1 continuous deviation angle of a batch of discrete points on the surface boundary line when the surface is successfully generated. If the input boundary line is a surface curve, there is a continuous angular deviation value of G1; If the input boundary line is a 3D curve, there is no G1 continuous angular deviation value.

Output parameter description:

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetMaxG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num);

Function: Reports the maximum G0 continuous distance deviation on each boundary line in the state of successfully generating the surface. Each boundary line of the surface, whether it is a surface curve or a 3D curve, has a G0 continuous distance deviation value.

Output parameter description:

 

图10

(Figure 10)

 

extern "C" __declspec(dllimport) void RsFillHoleByNurbs_GetG0ReportData(double** point_x, double** point_y, double** point_z, double** deviation, int* point_num);

Function: Reports the G0 continuous distance deviation of a batch of discrete points on the boundary line in the state of successfully generating the surface. Each boundary line of the surface, whether it is a surface curve or a 3D curve, has a G0 continuous distance deviation value.

Output parameter description:

Back to top