Method and system for generating workpiece surface measurement points, electronic equipment and readable storage medium
By performing discrete and auxiliary ball cross-section screening on the workpiece surface, the workpiece surface measurement points are generated, which solves the problems of high labor costs and long time in the prior art, and achieves rapid and accurate measurement points generation.
Patent Information
- Application Number
- CN202510202867.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, the layout of the surface measurement points of the workpiece is high labor cost and time, and the rules of the measurement points between the curved surfaces cannot be unified.
By using step D to discrete the surface of the workpiece, a surface node set is generated, the surface node on the surface boundary is selected as the center of the sphere, and the surface node on the intersection line segment is filtered as the measurement point until the surface node set is empty.
It realizes rapid automatic generation of measurement points, reduces manual investment, reduces measurement point generation time, and ensures that there is no overlap between the auxiliary ball and the surface intersection line.
Smart Images

Figure CN120145791A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of workpiece measurement point planning, and particularly to a method, a system, an electronic device, and a readable storage medium for generating measurement points on the surface of a workpiece. Background Art
[0002] The arrangement of measurement points on the surface of a workpiece is an important means to ensure that the size, shape, appearance, and function of the product meet the design requirements, and it also helps to improve production efficiency and product quality.
[0003] Currently, on the surface of parts or the body of a vehicle, measurement points are mainly set manually on the curved surface, and there is no rule between the points on the same curved surface; the rules for arranging points between curved surfaces cannot be unified; reasonable setting of points requires high personnel experience; and it takes a long time for personnel.
[0004] Therefore, to solve the above technical problems, it is urgent to propose a new technical means. Summary of the Invention
[0005] In view of this, to at least solve the problems of high labor cost and long time for arranging points, the present invention proposes a method, a system, an electronic device, and a readable storage medium for generating measurement points on the surface of a workpiece.
[0006] A method for generating measurement points on the surface of a workpiece provided by the present invention includes the following steps:
[0007] S1. Discretize the curved surface of the workpiece with a step size D to generate surface nodes, and obtain a surface node set PK;
[0008] S2. Select any surface node on the boundary of the curved surface as the center of a sphere, and make an auxiliary sphere with a radius of l;
[0009] Wherein, l = nD, and n is a natural number greater than 1;
[0010] S3. Determine the intersection line segment between the auxiliary sphere and the curved surface;
[0011] S4. Screen some surface nodes on the intersection line segment as measurement points to obtain a measurement point set MP;
[0012] S5. Screen out all surface nodes within the auxiliary sphere in the surface node set PK to obtain a surface node set PK1;
[0013] Wherein, all surface nodes within the auxiliary sphere include the surface nodes on the intersection line segment;
[0014] S6. Determine whether the surface node set PK1 is an empty set. If so, proceed to step S7; if not, use the measurement points in the measurement point set MP as the centers of spheres and l as the radius to construct auxiliary spheres, and repeat steps S3 - S5 until the surface node set PK1 is an empty set;
[0015] S7. Output the measurement point set MP.
[0016] Furthermore, before screening some of the surface nodes on the intersection line segment as measurement points, it also includes: sorting the surface nodes on the intersection line segment, and the sorting steps are as follows:
[0017] a. Calculate the vectors between any two surface nodes on the intersection line segment;
[0018] b. Select any one surface node on the intersection line segment as the initial starting point
[0019] c. Calculate the distance between the initial starting point and the remaining surface nodes on the intersection line segment except the initial starting point ;
[0020] d. According to the distance and the vector, determine the surface nodes adjacent to both sides of the initial starting point and
[0021] where L - side and R - side are the two sides of the initial starting point ; the surface node represents the adjacent surface node on the L - side of the initial starting point , and the surface node represents the adjacent surface node on the R - side of the initial starting point ;
[0022] If the initial starting point is a boundary point, then there is only one side where adjacent surface nodes need to be determined;
[0023] e. Take the surface nodes and as the initial starting points respectively and return to steps c and d respectively to determine the points on the L - side of the surface node , and the points on the R - side of the surface node until both the surface node and the surface node are boundary points;
[0024] f. According to the surface node initial starting point and surface nodes in order or according to the surface nodes initial starting point and surface nodes in order, sort the surface nodes in step e one by one;
[0025] g. Traverse the points on the intersection segment, select any unsorted surface node on the intersection segment as the initial starting point and return to step c-step f in turn until all the surface nodes on the intersection segment are sorted.
[0026] Furthermore, the step of determining the initial starting point according to the distance and the vector for the surface nodes on both sides and is as follows:
[0027] d11. Arbitrarily select a surface node on the intersection segment that has the minimum distance from the initial starting point as the surface node or
[0028] d12. When the surface node determined in step d11 is the surface node , then the surface node satisfies the following conditions;
[0029] When the surface node determined in step d11 is the surface node , then the surface node satisfies the following conditions;
[0030] Condition Ⅰ: The included angle between vector V m,R and vector V m,L is greater than the preset degree;
[0031] wherein, V m,R represents the vector between the initial starting point and the surface node , V m,L represents the vector between the initial starting point and the surface node ;
[0032] Condition Ⅱ: The distance from the surface node or the surface node to the initial starting point is the minimum;
[0033] Condition Ⅲ: The surface node or the surface node The distance to the initial starting point is less than 2D;
[0034] When the surface nodes on the L side or R side of the initial starting point do not satisfy Condition III, it indicates that the initial starting point is a boundary point.
[0035] Furthermore, after sorting the surface nodes on the intersection line segment, it further includes: segmenting according to the sequence numbers of the surface nodes on the intersection line segment.
[0036] Furthermore, in step S4, the measurement points are screened through the following steps:
[0037] S41. Calculate the arc length of the segmented intersection line segment, and determine whether the arc length of the segmented intersection line segment is less than or equal to the preset length C. If so, proceed to step S42; if not, proceed to step S43;
[0038] S42. Select a surface node on the segmented intersection line segment with a length less than or equal to the preset length C as a measurement point, and proceed to step S44;
[0039] The surface node selected as the measurement point satisfies:
[0040]
[0041] where N represents the sequence number of the surface node selected as the measurement point, L q represents the arc length of the qth segment of the intersection line segment, (x i , y i , z i ) and (x i+1 , y i+1 , z i+1 ) respectively represent the coordinates of surface node i and surface node i + 1, and D represents the step size;
[0042] S43. Select M surface nodes on the segmented intersection line segment with a length greater than the preset length C as measurement points, and proceed to step S44;
[0043] The number M of surface nodes selected as measurement points is calculated by the following formula:
[0044]
[0045] where, represents rounding down;
[0046] Select the surface nodes corresponding to the distances from the starting point and the ending point of the segmented intersection line segment to be as the first measurement point and the last measurement point respectively, and L y is calculated by the following formula:
[0047] L y = L q %C
[0048] Wherein, L y represents the remainder of L q divided by C;
[0049] Uniformly arrange M - 2 measurement points between the first measurement point and the last measurement point;
[0050] S44. Traverse all segments on the intersection segment, and repeat steps S41 - S43 until all measurement points on all intersection segment segments are set.
[0051] Furthermore, when screening measurement points for the Kth intersection segment, it also includes screening out the points on the Kth intersection segment that are close to the measurement points on the (K - 1)th intersection segment. The steps are as follows:
[0052] Calculate the distance between any two measurement points on the Kth intersection segment and the (K - 1)th intersection segment When is less than - 2D, screen out the vth measurement point on the Kth intersection segment;
[0053] Wherein, K - 1 u represents the uth measurement point on the (K - 1)th intersection segment.
[0054] Correspondingly, the present invention also provides a system for generating uniformly distributed workpiece surface measurement points, including: an acquisition module, a processing module I, and a processing module II;
[0055] The output end of the acquisition module is connected to the input end of the processing module I, and is used to acquire the surface information of the workpiece to be arranged with measurement points;
[0056] The output end of the processing module I is connected to the input end of the processing module II, and is used to generate a curved surface according to the surface information and discretize the curved surface to obtain a curved surface node set PK;
[0057] The processing module II is used to screen out a measurement point set MP from the curved surface node set PK.
[0058] Furthermore, it also includes a display module;
[0059] The input end of the display module is connected to the output end of the processing module II, and is used to display the measurement points in the measurement point set MP on the curved surface.
[0060] Correspondingly, the present invention also provides an electronic device, including:
[0061] A memory and a processor, where the memory is used to store a computer program, and when the computer program is executed by the processor, the method for generating measurement points on the surface of the workpiece described above is implemented.
[0062] Correspondingly, the present invention also provides a readable storage medium, in which computer instructions are stored, and when the computer instructions are executed by a processor, the method for generating measurement points on the surface of the workpiece described above is implemented.
[0063] Advantages of the present invention: By means of making an auxiliary sphere, measurement points are arranged on the intersection line segment between the curved surface and the auxiliary sphere, which can quickly and automatically generate measurement points, reduce the measurement point generation time, and reduce the manual input; the present invention also takes the measurement points as the centers of new auxiliary spheres, and screens out the remaining curved surface nodes on the curved surface except the measurement points inside the auxiliary sphere, which can ensure that there is no overlap in the intersection lines between each auxiliary sphere and the curved surface. Description of the Drawings
[0064] The present invention will be further described below with reference to the drawings and embodiments:
[0065] Figure 1 It is a flowchart of the present invention.
[0066] Figure 2 It is a schematic diagram of making an auxiliary sphere on the boundary of the curved surface in this embodiment.
[0067] Figure 3 It is a schematic diagram of determining the order of the curved surface nodes on the intersection line segment in this embodiment.
[0068] Figure 4 It is a schematic diagram of the intersection line segment of making auxiliary spheres twice in this embodiment. Detailed Embodiment
[0069] The following further explains the present invention with reference to the accompanying drawings of the specification:
[0070] A method for generating measurement points on the surface of a workpiece provided by the present invention includes the following steps:
[0071] S1. Discretize the curved surface of the workpiece with a step size D to generate curved surface nodes, and obtain a curved surface node set PK;
[0072] S2. Select any curved surface node on the boundary of the curved surface as the center of the sphere, and make an auxiliary sphere with a radius of l;
[0073] where l = nD, and n is a natural number greater than 1;
[0074] S3. Determine the intersection line segment between the auxiliary sphere and the curved surface;
[0075] S4. Screen out some of the curved surface nodes on the intersection line segment as measurement points to obtain a measurement point set MP;
[0076] S5. Remove all surface nodes within the auxiliary sphere from the surface node set PK to obtain a surface node set PK1;
[0077] Among them, all surface nodes within the auxiliary sphere include surface nodes on the intersection line segment;
[0078] S6. Determine whether the surface node set PK1 is an empty set. If so, proceed to step S7; if not, use the measurement points in the measurement point set MP as the centers of spheres, and use l as the radius to create auxiliary spheres, and repeat steps S3 - S5 until the surface node set PK1 is an empty set;
[0079] S7. Output the measurement point set MP. Through the above method, measurement points can be automatically generated quickly, reducing labor costs.
[0080] In this embodiment, in step S1, the surface of the workpiece is discretized with a step size D to generate surface nodes, obtaining a surface node set PK;
[0081] Among them, the step size D is set according to experience. The process of discretizing the surface is a prior art and will not be elaborated here; the surface nodes in this application can be points, grids, etc.; preferably, the surface is discretized into grids; the obtained surface node set PK includes the coordinates of each surface node.
[0082] Through the discretization process, a complex surface can be simplified into a series of discrete points or grids, making the measurement more accurate and efficient.
[0083] In this embodiment, in step S2, select any surface node on the boundary of the surface as the center of the sphere, and use l as the radius to create an auxiliary sphere; as Figure 2 shown; point O represents the center of the sphere; among them, l = nD, where n is a natural number greater than 1, and n is set according to experience. In this embodiment, n = 1000.
[0084] In this embodiment, in step S3, determine the intersection line segment between the auxiliary sphere and the surface. The intersection line segment refers to the intersection line segment between the boundary of the auxiliary sphere and the surface. As Figure 2 shown, the intersection line segment between the auxiliary sphere and the surface includes PL_1 and PL_2.
[0085] In this embodiment, since the obtained surface node set PK only includes the coordinates of surface nodes, and the auxiliary sphere and the surface may form multiple intersection line segments. If the surface nodes on the intersection line segment do not have a fixed order, it may be impossible to distinguish on which intersection line segment the subsequently determined measurement points are located, or a relatively complex method may be required to determine on which intersection line segment the measurement points are located;
[0086] To this end, before screening some of the surface nodes on the intersection segment as measurement points, it further includes: sorting the surface nodes on the intersection segment;
[0087] Before sorting the surface nodes on the intersection segment, it should also be determined which surface nodes are inside the auxiliary sphere and which surface nodes are on the intersection segment;
[0088] Specifically, calculate the distance between the surface node and the center of the sphere, and judge whether the surface node is inside the auxiliary sphere or on the intersection segment according to the distance. The judgment method is as follows:
[0089] When 0 < |OP i -l| < D, the surface node P i is the surface node on the intersection segment;
[0090] When OP i -l < -D, the surface node P i is the surface node inside the auxiliary sphere;
[0091] Where the subscript i is set to facilitate the representation of the distance between the surface node and the center of the sphere. At this time, the surface nodes have not been sorted yet;
[0092] Since the surface nodes are not necessarily on the boundary of the auxiliary sphere, judging according to the above judgment method can ensure that the surface node closest to the boundary of the auxiliary sphere is used as the point on the boundary of the auxiliary sphere (the point on the intersection segment);
[0093] The sorting steps are as follows:
[0094] a. Calculate the vector between any two surface nodes on the intersection segment;
[0095] b. Select any one surface node on the intersection segment as the initial starting point
[0096] c. Calculate the distance between the initial starting point and the remaining surface nodes on the intersection segment except the initial starting point ;
[0097] d. According to the distance and the vector, determine the surface nodes adjacent to both sides of the initial starting point and as shown in Figure 3 (a);
[0098] If the initial starting point is a boundary point, then there is only one side where adjacent surface nodes need to be determined;
[0099] Where the L side and the R side are the initial starting point On both sides of; the surface node Represents the initial starting point Points on the L side, the surface node Represents the initial starting point Points on the R side; if the L side corresponds to the initial starting point On the left side, then the R side corresponds to the initial starting point On the right side; if the L side corresponds to the initial starting point On the right side, then the R side corresponds to the initial starting point On the left side, as long as the definitions before and after are consistent;
[0100] Determining the initial starting point according to the distance and the vector Surface nodes on both sides And The steps are as follows:
[0101] d11. Arbitrarily select a surface node on the intersection segment that has the smallest distance from the initial starting point as the surface node Or That is, arbitrarily define a surface node on the intersection segment that has the smallest distance from the initial starting point as the surface node Or Or
[0102] d12. When the surface node determined in step d11 is the surface node , then the surface node Satisfies the following conditions;
[0103] When the surface node determined in step d11 is the surface node , then the surface node Satisfies the following conditions;
[0104] Condition Ⅰ: The included angle between vector V m,R And vector V m,L Is greater than a preset degree; the preset degree is set based on experience; in this embodiment, the radius l = 1000D, and the preset degree at this time is 90 degrees; it can ensure that the surface node And the surface node Are on both sides of the initial starting point ;
[0105] Wherein, V m,R Represents the vector between the initial starting point And the surface node , V m,L Represents the vector between the initial starting point And the surface node The vector between; the included angle between two vectors is calculated by the prior art and will not be elaborated here;
[0106] Condition II: The surface node Or the surface node To the initial starting point The distance is the smallest; it can ensure that the surface node Or the surface node Is an adjacent point of the initial starting point;
[0107] Condition III: The surface node Or the surface node To the initial starting point The distance is less than 2D;
[0108] When the initial starting point The surface nodes on the L side or R side of do not meet Condition III, indicating that the initial starting point Is a boundary point.
[0109] Condition III can screen out the situation where two adjacent surface points straddle segments; that is, when the initial starting point is the boundary point of the intersection segment segment, there should be adjacent surface nodes only on one side. However, when there are multiple segments of the intersection segment, there are surface nodes on both sides of the boundary point of the intersection segment segment, but they do not meet the adjacent condition. Therefore, the surface nodes on another intersection segment segment should not be used as Or Such as Figure 3 (b) shown, taking the L side as the left side and R as the right side as an example, there are two intersection segment segments. The initial starting point Is the boundary point. The initial starting point On the same intersection segment segment, there are only adjacent surface nodes on the right side, and the surface nodes on the left side are on another intersection segment segment; but since it is impossible to determine whether the surface nodes on the left side of the initial node are on the same intersection segment segment as the initial starting point only by the coordinate positions, Condition III is added for judgment. Normally, the distance between two adjacent surface nodes on the same intersection segment segment should be equal to D, but due to discretization into grids, there may be a certain error between the coordinate calculation positions and the actual positions;, therefore, the distance between the points on the left side of the initial starting point and the initial starting point is restricted to be less than 2D, so as to ensure that the points on both sides of the initial starting point are on the same intersection segment segment;
[0110] Figure 3(c), although there is only one intersection segment, the starting surface node and the ending surface node of the intersection segment are separated by the surface. Condition Ⅲ can also prevent taking the ending surface node on an intersection segment as the left-side point of the starting surface node. If there are extreme conditions where the starting surface node and the ending surface node of an intersection segment are separated by the surface and the distance is less than 2D, then the intersection segment is approximately regarded as a complete sphere.
[0111] e. Take the said surface nodes and respectively as new initial starting points and respectively return to step c and step d in sequence to determine the points on the L side of the said surface nodes and the points on the R side of the said surface nodes until both the said surface nodes and the said surface nodes are boundary points;
[0112] When the surface nodes on the L side of the surface node do not meet Condition Ⅲ, it indicates that the current surface node is a boundary point;
[0113] When the surface nodes on the R side of the surface node do not meet Condition Ⅲ, it indicates that the current surface node is a boundary point;
[0114] f. Sort the surface nodes in step e in sequence according to the order of the surface node , the initial starting point and the surface node or according to the order of the surface node , the initial starting point and the surface node ; The surface nodes in step e include the initial starting point;
[0115] Taking the order of the surface node , the initial starting point and the surface node as an example; Number the surface node which is a boundary point as 1, and number the R-side point of the boundary point , that is, the initial starting point as 2, number the R-side point of the initial starting point , that is, the surface node as 3, number the R-side point of the surface node as 4, and so on until numbering reaches the surface node
[0116] which is the boundary surface node in sequence, that is, number the boundary surface nodes in sequence Boundary surface nodes Number the R-side points up to the boundary surface nodes
[0117] Or sequentially number the boundary surface nodes Boundary surface nodes Number the L-side points up to the boundary surface nodes
[0118] g. Traverse the points on the intersection segment, and select any unordered surface node on the intersection segment as the initial starting point And sequentially return to steps c - f until all the surface nodes on the intersection segment are sorted. Through the above method, it is possible to provide a basis for subsequent measurement point layout, thereby simplifying the calculation.
[0119] Further, after sorting the surface nodes on the intersection segment, it further includes: segmenting according to the sequence numbers of the surface nodes on the intersection segment; judging how many segments there are in total based on the starting sequence number and the ending sequence number of the intersection segment, and how many surface nodes are on each segment; as Figure 2 shown, it includes two segments, PL_1 and PL_2. By segmenting the intersection segment, it is convenient to quickly determine the length of each segment of the intersection segment later, providing a basis for targeted layout of measurement points.
[0120] In this embodiment, in step S4, select some surface nodes on the intersection segment as measurement points to obtain a measurement point set MP, and the steps are as follows:
[0121] S41. Calculate the arc length of each segment of the intersection segment, and judge whether the arc length of the segment of the intersection segment is less than or equal to a preset length C. If so, enter step S42; if not, enter step S43;
[0122] Among them, the preset length C is set according to requirements, preferably The preset length C is the length for arranging one measurement point; calculating the arc length based on the surface nodes on the intersection segment is prior art and will not be elaborated here;
[0123] S42. Select a surface node on the segment of the intersection segment with a length less than or equal to the preset length C as a measurement point, and enter step S44;
[0124] The selected surface node as the measurement point satisfies:
[0125]
[0126] Among them, N represents the sequence number of the selected surface node as the measurement point, and L q represents the arc length of the q-th segment of the intersection segment, (xi , y i , z i ), and (x i+1 , y i+1 , z i+1 ) represent the coordinates of surface node i and surface node i + 1 respectively, and D represents the step size;
[0127] Through the above method, it can be ensured that the surface nodes selected as measurement points are located at the middle positions of the segments of the intersection line segment;
[0128] S43. Select M surface nodes on the segment of the intersection line segment whose length is greater than the preset length C as measurement points, and enter step S44;
[0129] The number M of surface nodes selected as measurement points is calculated by the following formula:
[0130]
[0131] That is: L q There are at least M - 1 sixths of the perimeters;
[0132] Among them, represents rounding down;
[0133] Select the surface nodes at distances of from the starting point and the ending point of the segment of the intersection line segment respectively as the first measurement point and the last measurement point, and L y is calculated by the following formula:
[0134] L y = L q % C
[0135] Among them, L y represents the remainder of L q divided by C; that is, the length remaining after subtracting M - 1 Cs from the segment of the intersection line segment;
[0136] Arrange M - 2 measurement points evenly between the first measurement point and the last measurement point;
[0137] In this embodiment, L y represents the length remaining after subtracting M - 1 from the segment of the intersection line segment. If the measurement points are arranged evenly starting directly from the starting point or the ending point, it will cause the segment of the intersection line segment not to conform to the arrangement rule of setting one measurement point for every length, thereby increasing the gap between the measurement points arranged in this step and the measurement points arranged in step S42, resulting in non-uniform arrangement. Therefore, arrange the first measurement point at a distance of from the starting point and at a distance of Arrange the Mth measurement point at a position, which can ensure that the arc length between the first measurement point and the Mth measurement point is M - 1 times at M - 1 times evenly set M - 2 measurement points on the arc length of M - 1 times, which can ensure that the arc length between each measurement point is
[0138] S44. Traverse all segments on the intersection segment, and repeat steps S41 - S43 until all measurement points on all intersection segment segments are set, obtaining the measurement point set MP. Through the above method, it can be ensured as much as possible that the arc length between each measurement point is the preset length C.
[0139] In this embodiment, in step S5, screen out all surface nodes within the auxiliary sphere in the surface node set PK, obtaining the surface node set PK1;
[0140] Among them, the surface nodes within the auxiliary sphere include the surface nodes on the intersection segment;
[0141] Figure 4 (a) only shows the surface nodes on the intersection segment and the center of the auxiliary sphere. Po1 represents the center of the first auxiliary sphere, Po2 represents the center of the second auxiliary sphere, and Po2 is also the measurement point on the intersection segment of the first auxiliary sphere and the surface; the intersection segment of the second auxiliary sphere and the surface should be represented as Figure 4 (a) before screening out the measurement points and the surface nodes within the sphere, but since all the surface nodes within the first auxiliary sphere and the measurement point set MP are screened out, the intersection segment of the second auxiliary sphere and the surface is as shown by the rectangular nodes in Figure 4 (b).
[0142] Through the above method, it is possible to avoid the repetition of the center of the sphere, thereby simplifying the computational complexity.
[0143] In this embodiment, in step S6, determine whether the surface node set PK1 is an empty set. If so, enter step S7; if not, use the measurement points in the measurement point set MP as the centers of the spheres, and make auxiliary spheres with a radius of l, and repeat steps S3 - S5 until the surface node set PK1 is an empty set;
[0144] Specifically, as Figure 4Taking (b) as an example, after screening out the surface nodes in the first auxiliary sphere, the surface node set PK1 is not an empty set. Further, taking the measurement points in the measurement point set MP as the centers of auxiliary spheres and using l as the radius, auxiliary spheres are constructed, that is, the second auxiliary sphere is constructed with the center Po2, and steps S3 - S5 are repeated; the intersection line segments of the second auxiliary sphere and the surface are determined, and the measurement points on the intersection line segments of the second auxiliary sphere and the surface are screened to form a new measurement point set MP. The new measurement point set MP contains the measurement points determined according to the first auxiliary sphere. Further, all the surface nodes in the second auxiliary sphere are screened out in the surface node set PK1 to form a surface node set PK2, and so on until the formed surface node set is an empty set, then step S7 is entered; if the formed surface node set is not an empty set, when selecting the measurement points in the measurement point set MP as the centers of auxiliary spheres, other measurement points are preferably selected as the centers of auxiliary spheres (that is, non-repeated measurement points are not selected), which can reduce the calculation amount. It should be noted that before screening the measurement points each time, the surface nodes on the intersection line segments need to be sorted and segmented to facilitate the subsequent screening of measurement points.
[0145] Further, to make the measurement points uniform and screen out the situation where the measurement points are too close, when screening the measurement points on the Kth intersection line segment, it also includes screening out the points on the Kth intersection line segment that are close to the measurement points on the (K - 1)th intersection line segment. The steps are as follows:
[0146] Calculate the distance between any two measurement points on the Kth intersection line segment and the (K - 1)th intersection line segment When is less than -2D, the vth measurement point on the Kth intersection line segment is screened out; C represents the length for arranging one measurement point. When is less than -2D, it means that within a distance less than C, two measurement points are set. Therefore, the later-arranged measurement point should be screened out to ensure the uniform arrangement of measurement points.
[0147] wherein, K - 1 u represents the uth measurement point on the (K - 1)th intersection line segment.
[0148] In this embodiment, in step S7, the measurement point set MP is output. The output measurement point set MP includes the measurement points on the intersection line segments of each auxiliary sphere and the surface. When the surface node set PK1 is an empty set, it means that all the surface nodes have been traversed, ensuring the integrity of the measurement point set.
[0149] Correspondingly, the present invention also provides a system for generating uniformly distributed workpiece surface measurement points, including: a collection module, a processing module I, and a processing module II;
[0150] The output end of the acquisition module is connected to the input end of the processing module I, and is used to acquire the surface information of the workpiece with measurement points to be arranged; the acquisition module can adopt a 3D scanner, a laser scanner, etc.; the acquired surface information can be point cloud data.
[0151] The output end of the processing module I is connected to the input end of the processing module II, and is used to generate a curved surface according to the surface information and discretize the curved surface to obtain a curved surface node set PK;
[0152] The processing module I can be software such as MATLAB, OpenCV, etc., and is used to process the surface information, generate a curved surface and discretize it;
[0153] The processing module II is used to screen out a measurement point set MP from the curved surface node set PK, and the processing module II screens the measurement point set MP according to the method for generating workpiece surface measurement points described above.
[0154] In this embodiment, a display module is further included;
[0155] The input end of the display module is connected to the output end of the processing module II, and is used to display the measurement points in the measurement point set MP in the curved surface for the user to view.
[0156] Correspondingly, the present invention also provides an electronic device, including:
[0157] A memory and a processor, the memory is used to store a computer program, and when the computer program is executed by the processor, the method for generating workpiece surface measurement points described above is implemented.
[0158] The device for executing the method for generating workpiece surface measurement points may further include: an input device and an output device.
[0159] The processor, the memory, the input device and the output device can be connected through a bus or other means.
[0160] The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for generating workpiece surface measurement points in the embodiments of the present application. The processor executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory, that is, implements the method for generating workpiece surface measurement points in the above method embodiments.
[0161] The memory may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created according to the use of the electronic device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided with respect to the processor, and these remote memories may be connected to the electronic device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0162] The input device may receive input digital or character information and generate signals related to user settings and function controls of the electronic device. The output device may include display devices such as a display screen.
[0163] The one or more modules are stored in the memory and, when executed by the one or more processors, execute the method for generating workpiece surface measurement points in any of the above method embodiments.
[0164] The above product may execute the method provided in the embodiments of the present application, and has function modules and beneficial effects corresponding to the execution of the method. Technical details not described in detail in this embodiment may be referred to the method provided in the embodiments of the present application.
[0165] The electronic device in the embodiments of the present application exists in various forms, including but not limited to:
[0166] (1) Mobile communication devices: These devices are characterized by having mobile communication functions and mainly aim to provide voice and data communication. Such terminals include: smart phones, multimedia phones, functional phones, and low-end phones, etc.
[0167] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have the characteristic of mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, etc.
[0168] (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video players, handheld game consoles, e-books, and smart toys and portable vehicle navigation devices.
[0169] (4) Other airborne electronic devices with data interaction functions, such as in-vehicle device installed in a vehicle.
[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the related technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0172] Correspondingly, the present invention also provides a readable storage medium, in which one or more programs including execution instructions are stored. The execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to be used for executing the steps of any one of the methods for generating workpiece surface measurement points described above in this application.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A method for generating measurement points on a workpiece surface, characterized in that: The following steps are involved: S1. discretize the surface of the workpiece using step size D, generate surface nodes, and obtain the surface node set PK; S2. Select any surface node on the boundary of the surface as the center of the sphere, and make an auxiliary sphere with l as the radius; Wherein, l = nD, n is a natural number greater than 1; S3. Determine the intersection line segment of the auxiliary ball and the curved surface; S4. Filtering some surface nodes on the intersection segment as measurement points to obtain a measurement point set MP; S5. Screening out all the surface nodes in the auxiliary sphere in the surface node set PK to obtain the surface node set PK1; Wherein, all the surface nodes in the auxiliary sphere include the surface nodes on the intersection segment; S6. Determine whether the surface node set PK1 is an empty set. If so, proceed to step S7; if not, use the measurement point in the measurement point set MP as the sphere center and l as the radius to make an auxiliary sphere, and repeat steps S3-S5 until the surface node set PK1 is an empty set; S7. Output the measurement point set MP.
2. The method for generating workpiece surface measurement points according to claim 1, characterized in that: Before selecting some of the surface nodes on the intersection line segment as measurement points, the method further includes: sorting the surface nodes on the intersection line segment, wherein the sorting steps are as follows: a. Calculate the vector between any two surface nodes on the intersection segment; b. Select any surface node on the intersection segment as the initial starting point c. Calculate the initial starting point The intersection line segment minus the initial starting point The distance between the remaining surface nodes other than ; d. Determine the initial starting point based on the distance and vector Adjacent surface nodes on both sides and Among them, the L side and the R side are the initial starting points On both sides; the surface nodes Indicates that at the initial starting point The adjacent surface node on the side, the surface node Indicates that at the initial starting point The adjacent surface nodes on the side; If the initial starting point If it is a boundary point, then only one side has adjacent surface nodes that need to be determined; e. The surface nodes and As the initial starting point And return to step c and step d respectively to determine the surface node side points, and the surface nodes side points until the surface node and the surface nodes All are boundary points; f. According to the surface nodes Initial starting point and surface nodes In order or by surface nodes Initial starting point and surface nodes Sort the surface nodes in step e in order; g. Traverse the points on the intersection line segment and select any unsorted surface node on the intersection line segment as the initial starting point And return to step c-step f in sequence until all the surface nodes on the intersection segment are sorted.
3. The method for generating workpiece surface measurement points according to claim 2, characterized in that: Determine the initial starting point according to the distance and the vector Surface nodes on both sides and The steps are as follows: d11. Randomly select a The surface node on the intersection segment with the smallest distance is the surface node or d12. When the surface node determined in step d11 is a surface node When the surface node The following conditions are met; When the surface node determined in step d11 is the surface node When the surface node The following conditions are met; Condition I: Vector V m,R With vector V m,L The angle is greater than a preset degree; Among them, V m,R Indicates the initial starting point With the surface node The vector between m,L Indicates the initial starting point With the surface node The vector between Condition II: The surface nodes Or the surface node To the initial starting point The distance is the smallest; Condition III: The surface nodes Or the surface node To the initial starting point The distance is less than 2D; When the initial starting point When the surface node on the side or R side does not meet condition III, it indicates the initial starting point is the boundary point.
4. The method for generating workpiece surface measurement points according to any one of claim 2 or claim 3, characterized in that: After sorting the surface nodes on the intersection line segment, the method further includes: segmenting the surface nodes on the intersection line segment according to the sequence numbers of the surface nodes on the intersection line segment.
5. The method for generating workpiece surface measurement points according to claim 4, characterized in that: In step S4, the measuring points are screened by the following steps: S41. Calculate the arc length of the intersection line segment, and determine whether the arc length of the intersection line segment is less than or equal to a preset length C. If yes, proceed to step S42; if no, proceed to step S43; S42. Select a surface node as a measurement point on the intersection line segment whose length is less than or equal to the preset length C, and proceed to step S44; The surface nodes selected as measurement points satisfy: Where N is the number of the surface node selected as the measurement point, L q represents the arc length of the qth segment of the intersection line segment, (x i ,y i , z i ) and (x i+1 ,y i+1 , z i+1 ) represent the coordinates of surface node i and surface node i+1 respectively, and D represents the step size; S43. Select M surface nodes as measurement points on the intersection line segment whose length is greater than the preset length C, and proceed to step S44; The number of surface nodes M selected as measurement points is calculated by the following formula: in, Indicates rounding down; Select the starting point and end point of the segment with the intersection line segment as The surface nodes of L correspond to the first and last measurement points respectively. y Calculated by the following formula: L y =L q %C Among them, L y Indicates L q remainder when divided by C; Evenly arrange M-2 measuring points between the first measuring point and the last measuring point; S44. Traverse all the segments on the intersection line segment and repeat steps S41-S43 until all the measurement points on the intersection line segments are set.
6. The method for generating workpiece surface measurement points according to claim 5, characterized in that: When screening the measurement points for the Kth intersection line segment, the steps also include screening out the points on the Kth intersection line segment that are close to the measurement points on the K-1th intersection line segment, and the steps are as follows: Calculate the distance between any two measurement points on the Kth intersection segment and the K-1th intersection segment when When it is less than -2D, the vth measurement point on the Kth intersection segment is screened out; Among them, K-1 u Represents the uth measurement point on the K-1th intersection segment.
7. A system for generating measurement points on a workpiece surface, characterized in that: include: Acquisition module, processing module I and processing module II; The output end of the acquisition module is connected to the input end of the processing module I, and is used to acquire the surface information of the workpiece where the measurement points are to be arranged; The output end of the processing module I is connected to the input end of the processing module II, and is used to generate a surface according to the surface information, and discretize the surface to obtain a surface node set PK; The processing module II is used to select the measurement point set MP from the surface node set PK.
8. The system for generating workpiece surface measurement points according to claim 7, characterized in that: Also includes a display module; The input end of the display module is connected to the output end of the processing module II, and is used to display the measurement points in the measurement point set MP on the curved surface.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for generating measurement points on the surface of a workpiece according to any one of claims 1 to 6 is implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method for generating measurement points on the surface of a workpiece according to any one of claims 1 to 6 is implemented.