A workpiece spraying method

By converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model and fitting into a nurbs surface, the spraying problem of workpieces in complex surface structures is solved, and a complete spraying effect is achieved.

CN117019573BActive Publication Date: 2025-07-22CHINA RAILWAY ENG MASCH RES & DESIGN INST CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310680066.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2025-07-22
Estimated Expiration
2043-06-09

AI Technical Summary

Technical Problem

When spraying workpieces with complex surface structures, the prior art can easily lead to missed coating or repeated spraying, affecting the spraying effect.

Method used

By converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model and fitting it into at least one nurbs surface, a fitted workpiece model is formed and spray path planning is performed according to the fitted model.

Benefits of technology

Complete spraying of complex surfaces is achieved, avoiding missed coating and improving the spraying effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117019573B_ABST
    Figure CN117019573B_ABST
Patent Text Reader

Abstract

The present invention provides a workpiece spraying method, which relates to the field of workpiece modeling. The workpiece spraying method includes: obtaining the point cloud data of the original three-dimensional model according to the original three-dimensional model of the workpiece; obtaining the triangulated three-dimensional model of the workpiece according to the point cloud data; obtaining at least one NURBS surface according to the triangulated three-dimensional model; obtaining the fitted workpiece model of the workpiece according to all the NURBS surfaces; obtaining the spraying path of the workpiece according to the fitted workpiece model, and spraying the workpiece through the spraying path. In the workpiece spraying method of the present invention, the triangulated three-dimensional model is fitted into a fitted workpiece model with at least one NURBS surface, reducing the number of planes in the triangulated three-dimensional model and simplifying the number of curved surfaces on the model surface of the workpiece. Through the fitting of multiple NURBS surfaces, the complex structure on the surface of the workpiece is retained to the greatest extent, and the spraying plan is carried out for the complex surface, so that the complex surface can be completely sprayed, improving the spraying effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of workpiece modeling, and more particularly, to a workpiece spraying method. Background Art

[0002] Before spraying a workpiece, it is necessary to model the workpiece, scan the workpiece using a three-dimensional reconstruction device, etc., to obtain a raw three-dimensional model with high details. However, since the surface of the raw three-dimensional model is not a regular shape, it is difficult to perform subsequent path planning. Therefore, it is necessary to process the raw three-dimensional model to regularize it, that is, to fit the surface of the raw three-dimensional model with finite and fixed shape surfaces such as synthetic planes, quadratic surfaces, cylindrical surfaces, and spherical surfaces to form a fitting model. Then, path planning is performed on the fitting model to obtain a spraying path for spraying the workpiece, and the workpiece is sprayed by a nozzle according to the planned spraying path.

[0003] In the prior art, when constructing a fitting model of a raw three-dimensional model, it is easy to fit a complex structure into a simple shape surface, resulting in the loss of details of the fitting model, which has a great impact on spraying the workpiece, causing missed spraying or repeated spraying, resulting in poor spraying effects and affecting the quality of the workpiece. Summary of the Invention

[0004] The main technical problem to be solved by the present invention is how to perform detailed modeling on a workpiece with a complex surface structure and spray the workpiece according to the modeling.

[0005] To solve the above problems, the present invention provides a workpiece spraying method, including:

[0006] Obtaining point cloud data of the raw three-dimensional model according to the raw three-dimensional model of the workpiece;

[0007] Obtaining a triangulated three-dimensional model of the workpiece according to the point cloud data;

[0008] Obtaining at least one NURBS surface according to the triangulated three-dimensional model;

[0009] Obtaining a fitting workpiece model of the workpiece according to all the NURBS surfaces;

[0010] Obtaining a spraying path of the workpiece according to the fitting workpiece model, and spraying the workpiece through the spraying path.

[0011] Optionally, the obtaining the point cloud data of the raw three-dimensional model according to the raw three-dimensional model includes:

[0012] Establishing a three-dimensional coordinate system according to the raw three-dimensional model of the workpiece;

[0013] Based on the three-dimensional coordinate system and multiple sampling points on the original three-dimensional model, the point cloud data of the original three-dimensional model is obtained, and the point cloud data is a set of coordinates of each sampling point in the three-dimensional coordinate system.

[0014] Optionally, the point cloud data includes the sampling points on the surface of the original three-dimensional model; obtaining the triangulated three-dimensional model of the workpiece according to the point cloud data includes:

[0015] According to the coordinates of each sampling point and a preset triangulation rule, a triangular patch with three sampling points is obtained, where one sampling point serves as a vertex of the triangular patch;

[0016] The triangulated three-dimensional model is obtained according to the triangular patches.

[0017] Optionally, obtaining a triangular patch with three sampling points according to the coordinates of each sampling point and a preset triangulation rule includes:

[0018] According to the coordinates of each sampling point and the preset triangulation rule, two sampling points matching each sampling point are obtained;

[0019] Each sampling point is connected to the two matching sampling points to obtain the triangular patch.

[0020] Optionally, obtaining at least one NURBS surface according to the triangulated three-dimensional model includes:

[0021] According to the triangulated three-dimensional model, the normal vectors of all the triangular patches are obtained;

[0022] According to the normal vectors of all the triangular patches, the included angle between the normal vectors of any two adjacent triangular patches is obtained;

[0023] According to at least two adjacent triangular patches with the included angle less than a preset angle threshold, one NURBS surface is obtained.

[0024] Optionally, obtaining one NURBS surface according to at least two adjacent triangular patches with the included angle less than a preset angle threshold includes:

[0025] According to at least two adjacent triangular patches with the included angle less than the preset angle threshold, an initial fitting surface is obtained;

[0026] Through the initial fitting surface, the control points of the initial fitting surface are obtained;

[0027] According to the control points and a preset control point optimization algorithm, the optimized control points are obtained;

[0028] Use the initial fitting surface corresponding to the optimized control points as the NURBS surface.

[0029] Optionally, the obtaining of the optimized control points according to the control points and a preset control point optimization algorithm includes:

[0030] Input the control points into the preset control point optimization algorithm, where the preset control point optimization algorithm includes a Newton iteration algorithm, a gradient descent algorithm, and a genetic algorithm;

[0031] Adjust the positions of the control points through the preset control point optimization algorithm to reduce the error distance between the triangular patches and the initial fitting surface, where the error distance is the distance between the intersection point of the normal vector of each triangular patch and the initial fitting surface and the intersection point of the normal vector and the triangular patch;

[0032] When the error distance is less than a preset distance, stop adjusting the positions of the control points to obtain the optimized control points.

[0033] Optionally, the workpiece spraying method is applied to a painting robot, and the painting robot includes a spray head for spraying the spraying points of the workpiece; the spraying path includes the movement trajectory of the spraying points on the workpiece and the movement posture of the spray head;

[0034] The obtaining of the spraying path of the workpiece according to the fitted workpiece model includes:

[0035] Obtain the movement trajectory of the spraying points on the workpiece according to the preset movement trajectory on each NURBS surface of the fitted workpiece model;

[0036] Obtain the movement posture of the spray head according to the movement trajectory;

[0037] Obtain the spraying path of the workpiece according to the movement posture and the movement trajectory.

[0038] Optionally, the obtaining of the movement posture of the spray head according to the movement trajectory includes:

[0039] Obtain the attitude angle of the spray head according to the movement trajectory, where the attitude angle is the included angle between the axis of the spray head and the normal vector of the spraying point;

[0040] Obtain the movement posture of the spray head according to the attitude angle and the preset spraying distance between the spray head and the spraying point.

[0041] Optionally, obtaining the attitude angle of the nozzle according to the motion trajectory includes:

[0042] Obtaining the abscissa and ordinate of each spraying point according to the motion trajectory;

[0043] Obtaining the normal vector of the spraying point according to the abscissa and ordinate of each spraying point;

[0044] Taking the included angle between the normal vector of the spraying point and the axis of the nozzle as the attitude angle of the nozzle.

[0045] In the workpiece spraying method of the present invention, when converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model, the complex structure on the surface of the workpiece can be retained to the greatest extent, reducing the loss of surface details of the model; and then fitting the triangulated three-dimensional model into at least one NURBS surface. This is because although the triangulated three-dimensional model retains the surface details of the model, there are too many planes in the triangulated three-dimensional model, which may lead to an increase in the complexity of subsequent spraying path planning and other work. Therefore, by fitting the triangulated three-dimensional model into a fitting workpiece model with at least one NURBS surface, the number of planes in the triangulated three-dimensional model is reduced, and the number of curved surfaces on the model surface of the workpiece is simplified. At the same time, through the fitting of multiple NURBS surfaces, the complex structure on the surface of the workpiece can be retained to the greatest extent. Therefore, both the number of curved surfaces of the fitting workpiece model can be reduced, and the complex structure on the surface of the workpiece can be retained to the greatest extent. After performing spraying path planning for the retained fitting workpiece model and then spraying according to the planned spraying path, since the fitting workpiece model retains the complex structure on the surface of the workpiece, spraying is performed according to the spraying path of the complex surface part, enabling the complex surface to be completely sprayed, improving the spraying effect, and avoiding the occurrence of missed spraying. Description of the Drawings

[0046] Figure 1 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0047] Figure 2 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0048] Figure 3 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0049] Figure 4 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0050] Figure 5 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0051] Figure 6 It is a flowchart of the workpiece spraying method in an embodiment of the present invention;

[0052] Figure 7 This is the flowchart of the workpiece spraying method in the embodiment of the present invention;

[0053] Figure 8 This is the schematic diagram of the workpiece spraying device in the embodiment of the present invention;

[0054] Figure 9 This is the schematic diagram of the computer device in the embodiment of the present invention. Detailed implementation manners

[0055] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0056] The workpiece spraying method of the present invention, in combination with Figure 1 as shown, includes:

[0057] S1: Obtain the point cloud data of the original three-dimensional model according to the original three-dimensional model of the workpiece;

[0058] Specifically, according to the original data of the workpiece, the point cloud data of the original three-dimensional model is obtained through a computer program. Among them, the sampling points in the point cloud data form the surface of the original three-dimensional model, which can better show the surface details of the workpiece. However, the number of sampling points is large, and the subsequent processing of the workpiece cannot be carried out in the form of sampling points.

[0059] S2: Obtain the triangulated three-dimensional model of the workpiece according to the point cloud data;

[0060] Specifically, since the subsequent processing of the workpiece cannot be carried out in the form of sampling points, it is necessary to perform triangulation processing on the original three-dimensional model according to the point cloud data of the original three-dimensional model, process the points distributed on the surface of the original three-dimensional model, and fit them into multiple planes with normals, so that the model is completely covered by multiple planes, that is, the triangulated three-dimensional model.

[0061] S3: Obtain at least one NURBS surface according to the triangulated three-dimensional model;

[0062] Specifically, according to the triangulated three-dimensional model with multiple planes, fitting is performed, and part of the multiple planes are fitted into one NURBS surface. Among them, due to the different postures of the surface of the triangulated three-dimensional model, one triangulated three-dimensional model can be fitted into at least one NURBS surface.

[0063] S4: Obtain the fitted workpiece model of the workpiece according to all the NURBS surfaces;

[0064] Specifically, all the NURBS surfaces after fitting constitute the fitted model of the workpiece. According to the surface structure corresponding to the triangulated three-dimensional model, a surface model corresponding to the surface structure of the workpiece is constituted, that is, the fitted model.

[0065] S5: Obtain the spraying path of the workpiece according to the fitted workpiece model, and spray the workpiece through the spraying path.

[0066] Specifically, after obtaining the fitted workpiece model, since the fitted workpiece model is composed of NURBS surfaces, therefore, path planning can be performed on the NURBS surfaces to obtain local spraying paths corresponding to the NURBS surfaces, and all the local spraying paths can be integrated to obtain the overall spraying path of the workpiece.

[0067] In the workpiece spraying method of the present invention, when converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model, the complex structure on the surface of the workpiece can be retained to the greatest extent, and the loss of surface details of the model can be reduced; and then the triangulated three-dimensional model is fitted into at least one NURBS surface. Because although the triangulated three-dimensional model retains the surface details of the model, there are too many planes in the triangulated three-dimensional model, which may lead to an increase in the complexity of subsequent spraying path planning and other work. Therefore, by fitting the triangulated three-dimensional model into a fitted workpiece model with at least one NURBS surface, the number of planes in the triangulated three-dimensional model is reduced, and the number of curved surfaces on the surface of the workpiece model is simplified. At the same time, through the fitting of multiple NURBS surfaces, the complex structure on the surface of the workpiece can be retained to the greatest extent. Therefore, both the number of curved surfaces of the fitted workpiece model can be reduced, and the complex structure on the surface of the workpiece can be retained to the greatest extent. After performing spraying path planning for the retained fitted workpiece model, spraying is performed according to the planned spraying path. Because the fitted workpiece model retains the complex structure on the surface of the workpiece, spraying is performed according to the spraying path of the complex surface part, so that the complex surface is completely sprayed, the spraying effect is improved, and the phenomenon of missed spraying is avoided.

[0068] In the embodiment of the present invention, in combination with Figure 2 as shown, S1: Obtain the point cloud data of the original three-dimensional model according to the original three-dimensional model, including:

[0069] S11: Establish a three-dimensional coordinate system according to the original three-dimensional model of the workpiece;

[0070] S12: Obtain the point cloud data of the original 3D model based on the 3D coordinate system and multiple sampling points on the original 3D model, where the point cloud data is a set of coordinates of each sampling point in the 3D coordinate system.

[0071] In this embodiment, after obtaining the original 3D model of the workpiece, since the surface of the original 3D model is composed of multiple sampling points, exemplarily, the point cloud data can be obtained based on all the sampling points of the original 3D model. Or when only a local part of the workpiece needs to be sprayed, only the sampling points corresponding to this part of the original 3D model need to be obtained for local modeling. When obtaining the sampling point data on the original 3D model, the point cloud data includes the coordinates of each sampling point. Therefore, a 3D coordinate system needs to be established with the original 3D model as the reference. For example, the center of the original 3D model is used as the origin in the 3D coordinate system to establish it, so as to obtain the coordinates of the sampling points, and form the point cloud data of the original 3D model according to the coordinate information of the sampling points. Therefore, the point cloud data is a set of coordinates of each sampling point in the 3D coordinate system.

[0072] In the workpiece spraying method of the present invention, by obtaining the point cloud data of the original 3D model and using the coordinates of the sampling points as the information of the workpiece model, since the sampling point is a point in the model, multiple sampling points can clearly display the complex model surface of the workpiece. At the initial stage of the workpiece spraying method, the information on the surface of the original 3D model is refined as much as possible to facilitate subsequent fitting for complex structures.

[0073] In the embodiment of the present invention, as shown in combination with Figure 3 the point cloud data includes the sampling points on the surface of the original 3D model; S2: Obtain the triangularized 3D model of the workpiece according to the point cloud data, including:

[0074] S21: Obtain a triangular patch with three sampling points according to the coordinates of each sampling point and a preset triangulation rule, where one of the sampling points is used as a vertex of the triangular patch;

[0075] S22: Obtain the triangularized 3D model according to the triangular patches.

[0076] In this embodiment, according to the coordinates of the sampling points, the original three-dimensional model is triangulated. Since three sampling points can form a plane, the sampling points on the surface of the original three-dimensional model are fitted into triangular patches with the sampling points as vertices, and thus a triangulated three-dimensional model with multiple triangular patch planes can be obtained. Among them, for the preset triangulation rule for point cloud data triangulation, it can be the greedy triangulation method. The sampling points in the point cloud data are projected onto a local two-dimensional plane coordinate, and then triangulation within the coordinate plane is performed. Then, multiple triangular patches are obtained according to the topological connection relationship of the sampling points within the plane, and a triangulated three-dimensional model is formed by the triangular patches.

[0077] The workpiece spraying method of the present invention fits the original three-dimensional model of the workpiece into a triangulated three-dimensional model, converting the relationship between sampling points in the original three-dimensional model into the relationship between planes, so as to intuitively construct the surface of the workpiece with planes while ensuring the surface structure details of the workpiece.

[0078] In the embodiment of the present invention, in combination with Figure 4 as shown, obtaining a triangular patch with three of the sampling points according to the coordinates of each of the sampling points and a preset triangulation rule includes:

[0079] S211: According to the coordinates of each of the sampling points and the preset triangulation rule, obtain two of the sampling points that match each of the sampling points;

[0080] S212: Connect each of the sampling points with the two matching sampling points to obtain the triangular patch.

[0081] In this embodiment, corresponding two sampling points can be matched for each sampling point through the preset triangulation rule. After that, the determined three sampling points can be connected to form a plane. Among them, exemplarily, the preset triangulation rule can be the greedy projection triangulation rule, setting the minimum angle of the interior angle of the triangle after triangulation to 10° and the maximum angle of the interior angle of the triangle after triangulation to 120°.

[0082] The workpiece spraying method of the present invention fits triangular patches for ordered or unordered point clouds through the preset triangulation rule, converting points into surfaces, which is convenient for subsequent modeling and path planning during spraying.

[0083] In the embodiment of the present invention, in combination with Figure 5 as shown, the step S3: obtaining at least one nurbs surface according to the triangulated three-dimensional model includes:

[0084] S31: According to the triangulated three-dimensional model, obtain the normal vectors of all the triangular patches;

[0085] S32: Obtain the included angle between the normal vectors of any two adjacent triangular patches according to the normal vectors of all the triangular patches;

[0086] S33: Obtain a NURBS surface according to at least two adjacent triangular patches whose included angle is less than a preset angle threshold;

[0087] In this embodiment, since the current triangulated three-dimensional model has a large number of planes, it is necessary to fit the planes with relatively similar postures on this basis, that is, to fit them into the same surface. Therefore, it is necessary to obtain the pose of each plane. Through the normal vector of the triangular patch representing the plane, the pose between adjacent triangular patches can be obtained. A single triangular patch cannot be fitted, so it can only exist in the form of a single plane. If the included angle between the normal vectors of any two adjacent triangular patches is less than the preset angle threshold, it means that these two triangular patches have the condition to be fitted into one surface, that is, the pose difference between the planes corresponding to the two triangular patches is not large and can be fitted into a NURBS surface. If the included angles of the normal vectors of multiple triangular patches are all less than the preset angle threshold and are connected to each other through common edges, then the NURBS surface formed by the first two triangular patches is continuously expanded and extended to fit these multiple triangular patches into one NURBS surface. Since multiple triangular patches are fitted into one NURBS surface, a triangulated three-dimensional model includes at least one NURBS surface.

[0088] In the workpiece spraying method of the present invention, since the complex surface structure of the triangulated three-dimensional model usually produces a large pose change between two planes, by fitting the planes with similar postures on the surface of the triangulated three-dimensional model into one NURBS surface, the triangulated three-dimensional model is simplified, and the surface of the triangulated three-dimensional model is transformed from a large number of planes to a limited number of NURBS surfaces, ensuring the complex structure of the surface.

[0089] In the embodiment of the present invention, in combination with Figure 6 as shown, the S33: Obtain a NURBS surface according to at least two adjacent triangular patches whose included angle is less than a preset angle threshold, includes:

[0090] S331: Obtain an initial fitting surface according to at least two adjacent triangular patches whose included angle is less than the preset angle threshold;

[0091] S332: Obtain the control points of the initial fitting surface through the initial fitting surface;

[0092] S333: Obtain the optimized control points according to the control points and a preset control point optimization algorithm;

[0093] S334: Use the initial fitted surface corresponding to the optimized control points as the NURBS surface.

[0094] In this embodiment, two or more triangular patches with an included angle less than a preset angle threshold are fitted into an initial fitted surface. At this time, there may be too much error between the position of the initial fitted surface and the corresponding two or more triangular patches, that is, the fitted surface is not very close to the triangular patches, resulting in a large fitting error. Therefore, the control points are optimized by a preset optimized control point algorithm to control the position of the control points on the NURBS surface. Among them, the control points are obtained by setting the order of the surface. If the surface is set to the first order, it means there are 2 control points. By changing the control points, the shape of the NURBS surface is changed. Therefore, optimizing the control points can make the NURBS surface fitted from the triangular patches closer to the previous triangular patch structure, so as to control the fitting accuracy.

[0095] The workpiece spraying method of the present invention optimizes the control points through the corresponding preset control point algorithm, makes the fitted NURBS surface closer to the corresponding triangular patch pose, the fitted NURBS surface is more accurate, improves the fitting accuracy, and facilitates subsequent work such as spraying path planning.

[0096] In the embodiment of the present invention, the S333: According to the control points and the preset control point optimization algorithm, obtain the optimized control points, including:

[0097] Input the control points into the preset control point optimization algorithm, where the preset control point optimization algorithm includes Newton iteration algorithm, gradient descent algorithm, and genetic algorithm;

[0098] Through the preset control point optimization algorithm, adjust the position of the control points to reduce the error distance between the triangular patch and the initial fitted surface, where the error distance is the distance between the intersection point of the normal vector of each triangular patch and the initial fitted surface and the intersection point of the normal vector and the triangular patch;

[0099] When the error distance is less than the preset distance, stop adjusting the position of the control points to obtain the optimized control points.

[0100] In this embodiment, the preset optimization control point algorithm can be optimization algorithms such as Newton iteration, gradient descent, genetic algorithm, etc. By adjusting the positions of the control points with the preset algorithm, since the control points are used to change the shape of the NURBS surface, the error distance between the triangular patch and the initial fitting surface can be reduced through the control points, that is, the distance between the intersection point of the normal vector of each triangular patch and the initial fitting surface and the intersection point of the normal vector and the triangular patch. When the error distance is less than the preset distance, the triangular patch and the NURBS surface are the closest at this time, indicating that the optimization of the control points ends. Taking the initial fitting surface corresponding to the control points at this time as the NURBS surface can achieve the closest approximation between the NURBS surface and the triangular patch.

[0101] The workpiece spraying method of the present invention optimizes the control points through the corresponding preset control point algorithm to reduce the distance between the intersection point of the normal vector of each triangular patch and the initial fitting surface and the intersection point of the normal vector and the triangular patch, making the fitted NURBS surface closer to the corresponding triangular patch pose, making the fitted NURBS surface more accurate, improving the fitting accuracy, and facilitating subsequent work such as spraying path planning.

[0102] In the embodiment of the present invention, as shown in Figure 7 the workpiece spraying method is applied to a painting robot. The painting robot includes a spray head, and the spray head is used to spray the spraying points of the workpiece; the spraying path includes the movement trajectory of the spraying points on the workpiece and the movement posture of the spray head;

[0103] Step S5: Obtain the spraying path of the workpiece according to the fitted workpiece model, including:

[0104] S51: Obtain the movement trajectory of the spraying points on the workpiece according to the preset movement trajectory on each NURBS surface of the fitted workpiece model;

[0105] S52: Obtain the movement posture of the spray head according to the movement trajectory;

[0106] S53: Obtain the spraying path of the workpiece according to the movement posture and the movement trajectory.

[0107] In this embodiment, the NURBS surface constitutes the fitting workpiece model. Therefore, a fitting workpiece model correspondingly includes at least two NURBS surfaces. Among them, for each NURBS surface, a preset motion trajectory is planned, such as in a "zigzag" or "loop" shape. Through the preset motion trajectory, the NURBS surface is completely sprayed. When the NURBS surfaces corresponding to the fitting workpiece model are completely sprayed, the preset motion trajectories of all surfaces are used as the motion trajectory of the final spraying points on the workpiece. Then, through the motion trajectory on the surface, the corresponding motion posture of the nozzle can be obtained, including the angle and the distance between the nozzle and the workpiece. Through the motion posture and the motion trajectory of the spraying points on the workpiece, the spraying robot can be controlled to spray through the nozzle according to the above information.

[0108] For the workpiece spraying method of the present invention, by planning the path for each NURBS surface, the spraying path for the entire workpiece can be determined. At the same time, since each NURBS surface has a corresponding spraying plan, even for the complex structure of the workpiece, high-quality spraying can be performed according to the spraying path.

[0109] In the embodiment of the present invention, obtaining the motion posture of the nozzle according to the motion trajectory includes:

[0110] According to the motion trajectory, the attitude angle of the nozzle is obtained, and the attitude angle is the included angle between the axis of the nozzle and the normal vector of the spraying point;

[0111] According to the attitude angle and the preset spraying distance between the nozzle and the spraying point, the motion posture of the nozzle is obtained.

[0112] In this embodiment, when the nozzle sprays the workpiece, the angle between the nozzle and the workpiece needs to be considered. Therefore, the included angle between the axis of the nozzle and the normal vector of the current spraying point needs to be considered, and the distance between the nozzle and the workpiece is obtained according to the preset spraying distance, which is convenient for controlling the spraying range and spraying density.

[0113] For the workpiece spraying method of the present invention, by setting the distance and the angle between the nozzle and the workpiece, the spraying effect on the workpiece is controlled through the angle and the distance, improving the spraying accuracy and effect.

[0114] In the embodiment of the present invention, obtaining the attitude angle of the nozzle according to the motion trajectory includes:

[0115] According to the motion trajectory, the abscissa and ordinate of each spraying point are obtained;

[0116] According to the abscissa and ordinate of each spraying point, the normal vector of the spraying point is obtained;

[0117] Take the angle between the normal vector of the spraying point and the axis of the spray head as the attitude angle of the spray head.

[0118] In this embodiment, the nurbs surface equation is determined by the horizontal and vertical coordinates corresponding to the spraying points in the spraying trajectory in the three-dimensional coordinate system, and the normal vector is calculated through the surface equation. After obtaining the normal vector corresponding to the spraying point, according to the preset spray head angle, the angle between the spray head and the workpiece during spraying can be known.

[0119] In the workpiece spraying method of the present invention, the attitude angle of the spray head is solved through the horizontal and vertical coordinates of the spraying point, which can ensure that the spray head sprays the spraying point at the correct angle when spraying the corresponding spraying point, thereby optimizing the spraying effect.

[0120] Combined with Figure 8 As shown, the present invention also provides a workpiece spraying device 100, including:

[0121] A point cloud data acquisition unit 110, configured to obtain the point cloud data of the original three-dimensional model according to the original three-dimensional model of the workpiece;

[0122] A triangulation processing unit 120, configured to obtain the triangulated three-dimensional model of the workpiece according to the point cloud data;

[0123] A fitting unit 130, configured to obtain at least one nurbs surface according to the triangulated three-dimensional model;

[0124] A building unit 140, configured to obtain the fitting workpiece model of the workpiece according to all the nurbs surfaces;

[0125] A path planning and spraying unit 150, configured to obtain the spraying path of the workpiece according to the fitting workpiece model, and spray the workpiece through the spraying path.

[0126] Combined with Figure 9 As shown, the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0127] S1: Obtain the point cloud data of the original three-dimensional model according to the original three-dimensional model of the workpiece;

[0128] S2: Obtain the triangulated three-dimensional model of the workpiece according to the point cloud data;

[0129] S3: Obtain at least one nurbs surface according to the triangulated three-dimensional model;

[0130] S4: Obtain the fitted workpiece model of the workpiece according to all the NURBS surfaces;

[0131] S5: Obtain the spraying path of the workpiece according to the fitted workpiece model, and spray the workpiece through the spraying path.

[0132] In the workpiece spraying method of the present invention, when converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model, the complex structure on the surface of the workpiece can be retained to the greatest extent, and the loss of surface details of the model can be reduced; and then fitting the triangulated three-dimensional model into at least one NURBS surface. The reason is that although the triangulated three-dimensional model retains the surface details of the model, there are too many planes in the triangulated three-dimensional model, which may lead to an increase in the complexity of subsequent work such as spraying path planning. Therefore, by fitting the triangulated three-dimensional model into a fitted workpiece model with at least one NURBS surface, the number of planes in the triangulated three-dimensional model is reduced, and the number of curved surfaces on the model surface of the workpiece is simplified. At the same time, through the fitting of multiple NURBS surfaces, the complex structure on the surface of the workpiece can also be retained to the greatest extent. Therefore, both the number of curved surfaces of the fitted workpiece model can be reduced, and the complex structure on the surface of the workpiece can be retained to the greatest extent. After planning the spraying path for the retained fitted workpiece model, spraying is carried out according to the planned spraying path. Since the fitted workpiece model retains the complex structure on the surface of the workpiece, spraying is carried out according to the spraying path of the complex surface part, so that the complex surface is completely sprayed, the spraying effect is improved, and the phenomenon of missed spraying is avoided.

[0133] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0134] S1: Obtain the point cloud data of the original three-dimensional model according to the original three-dimensional model of the workpiece;

[0135] S2: Obtain the triangulated three-dimensional model of the workpiece according to the point cloud data;

[0136] S3: Obtain at least one NURBS surface according to the triangulated three-dimensional model;

[0137] S4: Obtain the fitted workpiece model of the workpiece according to all the NURBS surfaces;

[0138] S5: Obtain the spraying path of the workpiece according to the fitted workpiece model, and spray the workpiece through the spraying path.

[0139] In the workpiece spraying method of the present invention, when converting the original three-dimensional model of the workpiece into a triangulated three-dimensional model, the complex structure on the surface of the workpiece can be retained to the greatest extent, reducing the loss of surface details of the model. Then, fitting the triangulated three-dimensional model into at least one NURBS surface is because although the triangulated three-dimensional model retains the surface details of the model, there are too many planes in the triangulated three-dimensional model, which may lead to an increase in the complexity of subsequent spraying path planning and other work. Therefore, by fitting the triangulated three-dimensional model into a fitted workpiece model with at least one NURBS surface, the number of planes in the triangulated three-dimensional model is reduced, simplifying the number of curved surfaces on the surface of the workpiece model. At the same time, through the fitting of multiple NURBS surfaces, the complex structure on the surface of the workpiece can be retained to the greatest extent. Therefore, both the number of curved surfaces of the fitted workpiece model can be reduced and the complex structure on the surface of the workpiece can be retained to the greatest extent. After planning the spraying path for the retained fitted workpiece model, spraying is performed according to the planned spraying path. Since the fitted workpiece model retains the complex structure on the surface of the workpiece, spraying is performed according to the spraying path of the complex surface part, enabling the complex surface to be completely sprayed, improving the spraying effect, and avoiding the occurrence of missed spraying.

[0140] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The described program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0141] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0142] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather should be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A workpiece spraying method, characterized in that, Including: Based on the original three-dimensional model of the workpiece, obtain the point cloud data of the original three-dimensional model, specifically including: establishing a three-dimensional coordinate system according to the original three-dimensional model of the workpiece; obtaining the point cloud data of the original three-dimensional model according to the three-dimensional coordinate system and multiple sampling points on the original three-dimensional model, and the point cloud data is a set of coordinates of each sampling point in the three-dimensional coordinate system; Based on the point cloud data, obtain the triangulated three-dimensional model of the workpiece, specifically including: obtaining a triangular patch with three sampling points according to the coordinates of each sampling point and a preset triangulation rule, wherein, according to the coordinates of each sampling point and the preset triangulation rule, obtain two sampling points matching each sampling point; connect each sampling point with the two matching sampling points to obtain the triangular patch; one sampling point serves as a vertex of the triangular patch; obtain the triangulated three-dimensional model according to the triangular patch; Based on the triangulated three-dimensional model, obtain at least one NURBS surface, specifically including: obtaining the normal vectors of all the triangular patches according to the triangulated three-dimensional model; obtaining the included angle between the normal vectors of any two adjacent triangular patches according to the normal vectors of all the triangular patches; obtaining one NURBS surface according to at least two adjacent triangular patches whose included angle is less than a preset angle threshold; Based on all the NURBS surfaces, obtain the fitting workpiece model of the workpiece; Based on the fitting workpiece model, obtain the spraying path of the workpiece, and spray the workpiece through the spraying path.

2. The workpiece spraying method according to claim 1, characterized in that, The obtaining one NURBS surface according to at least two adjacent triangular patches whose included angle is less than a preset angle threshold includes: Obtaining an initial fitting surface according to at least two adjacent triangular patches whose included angle is less than the preset angle threshold; Obtaining the control points of the initial fitting surface through the initial fitting surface; Based on the control points and a preset control point optimization algorithm, obtain the optimized control points; Taking the initial fitting surface corresponding to the optimized control points as the NURBS surface.

3. The workpiece spraying method according to claim 2, characterized in that, The obtaining the optimized control points based on the control points and a preset control point optimization algorithm includes: Inputting the control points into the preset control point optimization algorithm, wherein the preset control point optimization algorithm includes Newton iteration algorithm, gradient descent algorithm and genetic algorithm; Adjusting the positions of the control points through the preset control point optimization algorithm to reduce the error distance between the triangular patch and the initial fitting surface, wherein the error distance is the distance between the intersection point of the normal vector of each triangular patch and the initial fitting surface and the intersection point of the normal vector and the triangular patch; When the error distance is less than a preset distance, stop adjusting the positions of the control points to obtain the optimized control points.

4. The workpiece spraying method according to claim 3, characterized in that, The workpiece spraying method is applied to a painting robot, and the painting robot includes a spray head for spraying the spraying points of the workpiece; The spraying path includes the movement trajectory of the spraying points on the workpiece and the movement posture of the spray head; The obtaining of the spraying path of the workpiece according to the fitted workpiece model includes: Obtaining the movement trajectory of the spraying points on the workpiece according to the preset movement trajectory on each of the nurbs surfaces of the fitted workpiece model; Obtaining the movement posture of the spray head according to the movement trajectory; Obtaining the spraying path of the workpiece according to the movement posture and the movement trajectory.

5. The workpiece spraying method according to claim 4, characterized in that, The obtaining of the movement posture of the spray head according to the movement trajectory includes: Obtaining the attitude angle of the spray head according to the movement trajectory, where the attitude angle is the included angle between the axis of the spray head and the normal vector of the spraying point; Obtaining the movement posture of the spray head according to the attitude angle and the preset spraying distance between the spray head and the spraying point.

6. The workpiece spraying method according to claim 5, characterized in that, The obtaining of the attitude angle of the spray head according to the movement trajectory includes: Obtaining the abscissa and ordinate of each spraying point according to the movement trajectory; Obtaining the normal vector of the spraying point according to the abscissa and ordinate of each spraying point; Taking the included angle between the normal vector of the spraying point and the axis of the spray head as the attitude angle of the spray head.

Citation Information

Patent Citations

  • Evolutionary algorithm for surface fitting in human body modeling

    CN102938008A

  • Intelligent full-process closed-loop spray painting robot based on spray painting target three-dimensional imaging technology

    CN104759379A

  • A building three-dimensional modeling and virtual scene generation system based on a depth image

    CN109685891A