Prefabricated part contour vertex sorting method and system
By using data packet information in the intelligent production line to determine the vertex coordinates of prefabricated components and perform coordinate processing and sorting according to the rotation, the problem of inaccurate vertex sorting of prefabricated components is solved, improving the accuracy of equipment operations and the intelligent production line Production stability.
Patent Information
- Application Number
- CN202411443960.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, the ordering of the contour vertices of prefabricated components is not accurate enough, especially after the prefabricated components rotate, resulting in the automatic scriber being unable to work normally and the processing fails.
All vertex coordinates of the prefabricated component are determined through the data packet information, and whether to rotate is performed. If rotated, rotate 90° counterclockwise and coordinate conversion are performed to form the initial set of vertices. Then determine whether reordering is needed. If necessary, a final vertex set is generated; if not, the initial vertex set is used.
It improves the accuracy and adaptability of the vertex sorting of prefabricated components, avoids equipment operation failures or processing errors caused by sorting errors, and ensures the normal production of smart production lines.
Smart Images

Figure CN119396357A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent production line technology, and in particular to a method and system for sorting vertices of prefabricated component contours. Background Art
[0002] In the operation of the central control system and intelligent equipment, the corresponding action instructions are generally executed according to the data packets based on industry standards. In particular, the automatic oiling machine and the automatic marking machine need to perform operations according to the arrangement order of the vertices of the prefabricated component contour (applicable to the outer contour, the contour with missing corners, the contour with holes, and the contour with embedded parts) in the data packet. Under normal circumstances, the prefabricated components are usually standard quadrilaterals. If the prefabricated components have missing corners or concave points, the prefabricated components are non-standard polygons. At this time, the order of the vertices of the prefabricated component contours is particularly important.
[0003] In the prior art, if the order of contour vertices provided by the data packet is not arranged in a certain order, the automatic marking machine will not be able to work properly; and when some prefabricated components are rotated, the coordinates of all contour vertices will change. At this time, if the vertex coordinates before rotation are sorted, processing will fail. Summary of the invention
[0004] The problem solved by the invention is how to improve the accuracy of sorting the vertices of the outline of the polygonal prefabricated component.
[0005] In order to solve the above problems, the present invention provides a method for sorting vertices of prefabricated component contours, comprising:
[0006] Determine all vertex coordinates of the prefabricated component according to the data packet information;
[0007] Determine whether the prefabricated component is rotated. If the prefabricated component is rotated, rotate the vertices of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component and convert the coordinates of the rotated vertices to obtain an initial vertex set;
[0008] Determine whether the vertices of the prefabricated component need to be reordered according to the initial vertex set. If so, reorder the vertices of the prefabricated component according to the initial vertex set to generate the final vertex set of the prefabricated component. If not, use the initial vertex set as the final vertex set.
[0009] Optionally, after determining whether the prefabricated component is rotated, the method further includes:
[0010] If the prefabricated component is not rotated, the vertex set in the data packet information is used as the initial vertex set.
[0011] Optionally, determining all vertex coordinates of the prefabricated component according to the data packet information includes:
[0012] According to the data packet information, the initial vertex coordinates of the prefabricated component are obtained;
[0013] Determine whether the initial vertex coordinates contain decimals;
[0014] If yes, the initial vertex coordinates with decimals are rounded, and the rounded initial vertex coordinates are used as the vertex coordinates;
[0015] If not, the initial vertex coordinates are used as the vertex coordinates.
[0016] Optionally, if the prefabricated component is rotated, the vertex of the prefabricated component is rotated 90° counterclockwise according to the vertex coordinates of the prefabricated component and the coordinates of the rotated vertex are converted, including:
[0017] According to the data packet information, the vertex coordinates of the prefabricated component before rotation and the long side of the prefabricated component are obtained;
[0018] Rotate the vertex of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component;
[0019] According to the change of the long side of the prefabricated component before and after the rotation, the vertex coordinates before the rotation are converted to obtain the vertex coordinates after the rotation;
[0020] Pre-sorting is performed according to the rotated vertex coordinates to obtain the initial vertex set.
[0021] Optionally, the pre-sorting according to the rotated vertex coordinates to obtain the initial vertex set includes:
[0022] Determining the reference coordinates of the prefabricated component according to the vertex coordinates after the rotation;
[0023] Pre-sorting the reference coordinates in a preset order to obtain a sorted sequence of the rotated vertex coordinates;
[0024] The sorted sequence is used as the initial vertex set.
[0025] Optionally, judging whether the vertices of the prefabricated component need to be reordered according to the initial vertex set includes:
[0026] According to the initial vertex set, obtaining the number of vertices of the prefabricated component;
[0027] When the number of vertices is a preset number, determining that the vertex coordinates of the prefabricated component do not need to be reordered;
[0028] When the number of vertices is greater than the preset number, it is determined that the vertex coordinates of the prefabricated component need to be reordered.
[0029] Optionally, the reordering of the vertices of the prefabricated component according to the initial vertex set to generate the final vertex set of the prefabricated component includes:
[0030] Generate an empty vertex set;
[0031] Adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty, thereby obtaining a new vertex set;
[0032] The new vertex set is used as the final vertex set of the prefabricated component.
[0033] Optionally, the adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty to obtain a new vertex set includes:
[0034] Determining reference vertex coordinates of the prefabricated component according to the initial vertex set;
[0035] Add the reference vertex coordinates to the empty vertex set and delete the reference vertex coordinates in the initial vertex set;
[0036] After deleting the reference vertex coordinates in the initial vertex set, setting an integer parameter and initializing the integer parameter to 0;
[0037] According to the integer parameter, the remaining vertex coordinates in the initial vertex set are added to the empty vertex set in the preset order, and the remaining vertex coordinates in the initial vertex set are deleted until the initial vertex set is empty, thereby obtaining the new vertex set.
[0038] Optionally, the adding the remaining vertex coordinates in the initial vertex set to the empty vertex set in the preset order according to the integer parameter includes:
[0039] According to the integer parameter and in the preset order, adding the remaining vertex coordinates from the initial vertex set to the empty vertex set;
[0040] Wherein, each time a remaining vertex coordinate is added to the empty vertex set, the integer parameter is increased by 1, and according to the parity of the integer parameter, the remaining vertex coordinate is selected from the initial vertex set and added to the empty vertex set.
[0041] The present invention also provides a prefabricated component contour vertex sorting system, comprising:
[0042] A coordinate processing unit, used to determine the coordinates of all vertices of the prefabricated component according to the data packet information;
[0043] a first sorting unit, for determining whether the prefabricated component is rotated, and if the prefabricated component is rotated, rotating the vertices of the prefabricated component counterclockwise by 90° according to the vertex coordinates of the prefabricated component and performing coordinate conversion on the rotated vertices to obtain an initial vertex set;
[0044] The second sorting unit is used to determine whether the vertices of the prefabricated component need to be reordered according to the initial vertex set. If so, the vertices of the prefabricated component are reordered according to the initial vertex set to generate the final vertex set of the prefabricated component. If not, the initial vertex set is used as the final vertex set.
[0045] The method and system for sorting the vertices of the prefabricated component outline of the present invention accurately determine the coordinates of all vertices of the prefabricated component through the data packet information, and determine whether the prefabricated component has been rotated. If the prefabricated component has been rotated, the coordinates will be converted according to the vertex coordinates after rotation to form an initial vertex set, thereby ensuring that even after the prefabricated component is rotated, the vertex coordinates can correctly reflect their relative positions in the prefabricated component polygon. Subsequently, it is further determined whether the initial vertex set meets the final sorting requirements. If necessary, it will be re-sorted based on the initial set to generate a final vertex set; if the initial set meets the requirements, it will be directly used as the final set, which not only takes into account the possible rotation of the prefabricated component, but also ensures the accuracy and adaptability of vertex sorting through pre-sorting and conditional judgment, avoiding equipment operation failure or processing errors caused by vertex sorting errors, and effectively ensuring the correct operation of the equipment and even the production rhythm of the entire intelligent production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flow chart of a method for sorting vertices of prefabricated component outlines according to an embodiment of the present invention;
[0047] Figure 2 This is one of the schematic diagrams of the vertices of the outline of a prefabricated component in another embodiment of the present invention;
[0048] Figure 3 This is a second schematic diagram of the contour vertices of a prefabricated component in another embodiment of the present invention;
[0049] Figure 4 It is a structural schematic diagram of a prefabricated component contour vertex sorting system in another embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0051] Combination Figure 1 As shown, the present invention provides a method for sorting vertices of prefabricated component contours, comprising:
[0052] S100: Determine all vertex coordinates of the prefabricated component according to the data packet information.
[0053] Specifically, in a preferred embodiment of the present invention, the PKPM system can be combined with the prefabricated component design model to output a PCXML data package of the prefabricated component based on the industry standard, so the PCXML data package contains the coordinate information of all vertices of the prefabricated component.
[0054] S110: Determine whether the prefabricated component is rotated. If the prefabricated component is rotated, rotate the vertices of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component and convert the coordinates of the rotated vertices to obtain an initial vertex set.
[0055] Specifically, after obtaining all the vertex coordinates of the prefabricated component, it is necessary to determine whether the prefabricated component needs to be rotated. This judgment is based on the design and production requirements of the prefabricated component, and can be determined by parsing the relevant attributes of the prefabricated component in the PCXML data packet. If the prefabricated component needs to be rotated, the vertex coordinates of the prefabricated component need to be sorted in the x-direction and the y-direction to ensure that the first vertex with the smallest x coordinate and the smallest y coordinate is used as the reference position of the outer contour of the prefabricated component. The purpose of pre-sorting is to prepare for generating a clockwise sorted vertex list. After the pre-sorting is completed, the vertex set obtained is the initial vertex set. This set is the starting point of the subsequent sorting algorithm and contains the vertex coordinates adjusted according to the rotation.
[0056] S120: Determine whether the vertices of the prefabricated component need to be reordered based on the initial vertex set; if so, reorder the vertices of the prefabricated component based on the initial vertex set to generate the final vertex set of the prefabricated component; if not, use the initial vertex set as the final vertex set.
[0057] Specifically, first, the initial vertex set needs to be evaluated to determine whether it has met the requirements of clockwise sorting. This evaluation is based on the geometric characteristics of the prefabricated component. In the pre-sorting step, all vertices of the prefabricated component have been sorted in the x-direction and the y-direction, and the first vertex with the smallest x coordinate and the smallest y coordinate is set as the reference position. If the pre-sorted vertex set has formed a sequence arranged in clockwise order, then no further re-sorting is required. If the pre-sorted vertex set does not form a clockwise arrangement, or there are concave points that cause the vertex order to not meet the process requirements, then it is necessary to enter the re-sorting step. After completing the re-sorting step, the vertex set obtained is the final vertex set. The final vertex set is arranged in a clockwise order, which meets the requirements of intelligent equipment such as automatic oiling machines and automatic marking machines for the order of vertices of the prefabricated component contours.
[0058] The method for sorting the vertices of the prefabricated component outline of the present invention accurately determines the coordinates of all vertices of the prefabricated component through the data packet information, and determines whether the prefabricated component has been rotated. If the prefabricated component has been rotated, the coordinates will be converted according to the vertex coordinates after rotation to form an initial vertex set, thereby ensuring that even after the prefabricated component is rotated, the vertex coordinates can correctly reflect their relative positions in the prefabricated component polygon. Subsequently, it is further determined whether the initial vertex set meets the final sorting requirements. If necessary, it will be re-sorted based on the initial set to generate a final vertex set; if the initial set meets the requirements, it will be directly used as the final set, which not only takes into account the possible rotation of the prefabricated component, but also ensures the accuracy and adaptability of vertex sorting through pre-sorting and conditional judgment, avoiding equipment operation failure or processing errors caused by vertex sorting errors, and effectively ensuring the correct operation of the equipment and even the production rhythm of the entire intelligent production line.
[0059] In the embodiment of the present invention, after determining whether the prefabricated component is rotated, the method further includes:
[0060] If the prefabricated component is not rotated, the vertex set in the data packet information is used as the initial vertex set.
[0061] In this embodiment, if the prefabricated component does not need to be rotated, and thus the vertex coordinates will not change, the contour vertex positions do not need to be processed, and the vertex set in the data packet information can be directly used as the initial vertex set.
[0062] The method for sorting vertices of the prefabricated component outline of the present invention determines whether the vertices need to be processed by pre-determining whether the prefabricated component is rotated, thereby improving the intelligence and automation of sorting the vertices of the prefabricated component outline.
[0063] In the embodiment of the present invention, the step of determining all vertex coordinates of the prefabricated component according to the data packet information includes:
[0064] According to the data packet information, the initial vertex coordinates of the prefabricated component are obtained;
[0065] Determine whether the initial vertex coordinates contain decimals;
[0066] If yes, the initial vertex coordinates with decimals are rounded, and the rounded initial vertex coordinates are used as the vertex coordinates;
[0067] If not, the initial vertex coordinates are used as the vertex coordinates.
[0068] In this embodiment, first, the initial vertex coordinates of the prefabricated component need to be parsed from the PCXML data packet. These coordinates are the basis of the prefabricated component outline and are used for subsequent sorting and processing. After obtaining the initial vertex coordinates, it is necessary to check whether these coordinates contain decimals. Due to the precision problem of floating-point numbers, the coordinates provided in the data packet may contain multiple digits after the decimal point, such as 0.000001 or 1600.00003. If it is found that there are decimals in the initial vertex coordinates, these coordinates need to be rounded. The purpose of rounding is to eliminate the precision error of floating-point numbers and ensure that the comparison of vertex coordinates is accurate in subsequent sorting and comparison operations. In a preferred embodiment of the present invention, rounding is usually performed by rounding to convert the coordinates into integer form. After the rounding process is completed, the processed coordinates are used as the initial vertex coordinates. These coordinates will be used in subsequent rotation conversion, pre-sorting and clockwise sorting steps. If the initial vertex coordinates are already integers, or the decimal part does not affect the precision requirements of sorting and comparison, these initial vertex coordinates can be used directly without rounding.
[0069] The prefabricated component outline vertex sorting method of the present invention ensures the accuracy of the basic data for subsequent sorting and processing by accurately extracting the initial vertex coordinates of the prefabricated components from the data packet. Secondly, the vertex coordinates with decimals are rounded to an integer, which effectively avoids the influence of floating point precision errors on sorting accuracy and enhances the stability and reliability of data processing.
[0070] In the embodiment of the present invention, if the prefabricated component is rotated, the vertex of the prefabricated component is rotated 90° counterclockwise according to the vertex coordinates of the prefabricated component and the coordinates of the rotated vertex are converted, including:
[0071] According to the data packet information, the vertex coordinates of the prefabricated component before rotation and the long side of the prefabricated component are obtained;
[0072] Rotate the vertex of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component;
[0073] According to the change of the long side of the prefabricated component before and after the rotation, the vertex coordinates before the rotation are converted to obtain the vertex coordinates after the rotation;
[0074] Pre-sorting is performed according to the rotated vertex coordinates to obtain the initial vertex set.
[0075] In this embodiment, it is first necessary to obtain the original vertex coordinates and long side information of the prefabricated component from the PCXML data packet. This information is the basis for the rotation conversion of the prefabricated component. Figure 2 and Figure 3 As shown, the prefabricated component is Figure 2 Arrange Rotate To Figure 3 Arrangement, the rotation of the prefabricated component involves a 90° counterclockwise rotation, which will cause the direction of the long side of the prefabricated component to change. According to whether the long side of the prefabricated component before rotation is horizontal (SlabLenIsHorizontal), the conversion formula of the vertex coordinates after rotation can be determined. In a preferred embodiment of the present invention, if the long side is horizontal, the x-coordinate and y-coordinate of the vertex after rotation need to be adjusted according to a specific mathematical relationship to ensure that the vertex correctly reflects its position in the rotated space. After the coordinate conversion is completed, the vertices are pre-sorted using these rotated coordinates. This step is to ensure that the vertex set is preliminarily sorted according to the spatial layout after rotation, thereby obtaining an initial vertex set. In a preferred embodiment of the present invention, let the length of the prefabricated component be L, the width of the prefabricated component be W, whether the long side of the prefabricated component before rotation is horizontal is SlabLenIsHorizontal, and the reference position of the lower left corner of the prefabricated component is (P x0 , P y0 ), the vertex position before rotation is (P x , P y ), the vertex position after rotation is (P x ′,P y ′). Before and after the rotation, the prefabricated component always takes the lower left corner as the reference position. The length and width of the prefabricated component can be obtained by parsing the specific XML nodes in the prefabricated component data package, and whether the original long side of the prefabricated component is horizontal can be parsed and inferred from the positions of the four vertices of the outer contour in the data package.
[0076] If SlabLenIsHorizontal is true, that is, the long side of the precast component is vertical after rotating 90° counterclockwise, the position conversion relationship between the vertex before and after the rotation is as follows:
[0077] P x ′=P x0 +W-(P y -P y0 )(1);
[0078] P y ′=P y0 +(P x -P x0 )(2);
[0079] Similarly, if SlabLenIsHorizontal is false, that is, the long side of the precast component is horizontal after 90° counterclockwise rotation, the y-coordinate conversion relationship between the vertex before rotation and the vertex after rotation is the same as formula (2), and the x-coordinate conversion relationship is shown in formula (3):
[0080] P x ′=P x0 +L-(P y -P y0 )(3).
[0081] The method for sorting the vertices of the prefabricated component outlines of the present invention improves the adaptability and accuracy of the sorting algorithm through precise coordinate conversion and pre-sorting, thereby adapting to the rotation changes of the prefabricated components and ensuring that the vertices can be accurately sorted even when the shape and position of the prefabricated components change.
[0082] In the embodiment of the present invention, the pre-sorting according to the rotated vertex coordinates to obtain the initial vertex set includes:
[0083] Determining the reference coordinates of the prefabricated component according to the vertex coordinates after the rotation;
[0084] Pre-sorting the reference coordinates in a preset order to obtain a sorted sequence of the rotated vertex coordinates;
[0085] The sorted sequence is used as the initial vertex set.
[0086] In this embodiment, it is first necessary to determine the reference coordinates of the prefabricated component based on the rotated vertex coordinates. In a preferred embodiment of the present invention, the reference coordinates are usually the vertex at the lower left corner of the prefabricated component, which serves as the starting point for sorting and provides a reference point for subsequent vertex sorting. Next, based on this reference coordinate, all vertices are pre-sorted in a preset axial order, wherein the preset axial order may be first in the x direction and then in the y direction, so as to ensure that the vertex set is arranged in a certain order on the two-dimensional plane, thereby forming a sorting sequence. This sorting sequence captures the relative positional relationship of the vertices in the prefabricated component, laying the foundation for generating the final clockwise sorted vertex list.
[0087] The prefabricated component outline vertex sorting method of the present invention can effectively capture and express the positional relationship between vertices by determining the reference coordinates and performing pre-sorting, which is crucial for the subsequent clockwise sorting. Secondly, the pre-sorting process simplifies the complexity of the sorting algorithm because it provides an ordered starting point for the algorithm and reduces the disorder that needs to be processed.
[0088] In the embodiment of the present invention, judging whether the vertices of the prefabricated component need to be reordered according to the initial vertex set includes:
[0089] According to the initial vertex set, obtaining the number of vertices of the prefabricated component;
[0090] When the number of vertices is a preset number, determining that the vertex coordinates of the prefabricated component do not need to be reordered;
[0091] When the number of vertices is greater than the preset number, it is determined that the vertex coordinates of the prefabricated component need to be reordered.
[0092] In this embodiment, it is first necessary to determine the number of vertices of the prefabricated component based on the initial vertex set to determine whether reordering is required. The number of vertices of the prefabricated component is directly related to the geometric shape of the prefabricated component. If the prefabricated component is a standard quadrilateral, then the number of vertices is 4. In this case, all vertices are convex points and do not need to be reordered. However, if the number of vertices of the prefabricated component is greater than 4, this indicates that the prefabricated component contains at least one concave point or missing corner. At this time, the outline of the prefabricated component is a non-standard polygon and may need to be reordered to ensure that the vertices are correctly arranged in a clockwise direction. In a preferred embodiment of the present invention, the number of vertices of the prefabricated component outline is n. If n=4, it means that the outline of the prefabricated component is a standard quadrilateral and all vertices are convex points. Figure 2 and Figure 3 As shown, if n is 10, it means that the contour of the prefabricated component contains 2 missing corners, and the contour polygon contains at least 2 concave points.
[0093] The method for sorting the vertices of the prefabricated component outline of the present invention can quickly determine whether most prefabricated components of simple shapes need further processing by judging the preset number, thereby avoiding unnecessary sorting operations and improving the overall sorting efficiency. For prefabricated components with more than the preset number of vertices, it is ensured that the vertices of complex shapes are re-sorted as necessary to meet the process requirements and the accuracy of equipment operation.
[0094] In the embodiment of the present invention, the step of reordering the vertices of the prefabricated component according to the initial vertex set to generate the final vertex set of the prefabricated component includes:
[0095] Generate an empty vertex set;
[0096] Adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty, thereby obtaining a new vertex set;
[0097] The new vertex set is used as the final vertex set of the prefabricated component.
[0098] In this embodiment, an empty vertex set is first created, which will be used to store the reordered vertex coordinates. Next, vertex coordinates are selected from the initial vertex set according to the preset axial order and added to the newly created empty vertex set. In this process, the selected vertex coordinates are deleted from the initial vertex set at the same time to ensure that each vertex is processed only once. This operation continues until the initial vertex set is completely empty. At this time, the new vertex set already contains all vertices, but they are arranged in a new, preset clockwise order, ensuring that the reordering of vertex coordinates can be reorganized in a specific order to meet the requirements of subsequent process flow or equipment operation.
[0099] The method for sorting the vertices of the prefabricated component outline of the present invention can flexibly customize the sorting mode of the vertices according to specific process requirements or equipment operation characteristics by generating an empty vertex set and re-adding vertex coordinates in a preset order. At the same time, it can also adapt to prefabricated components of different shapes and features. Whether it is a prefabricated component with a regular shape or a prefabricated component with complex geometric features, accurate vertex sorting can be obtained through this process.
[0100] In the embodiment of the present invention, the adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty to obtain a new vertex set includes:
[0101] Determining reference vertex coordinates of the prefabricated component according to the initial vertex set;
[0102] Add the reference vertex coordinates to the empty vertex set and delete the reference vertex coordinates in the initial vertex set;
[0103] After deleting the reference vertex coordinates in the initial vertex set, setting an integer parameter and initializing the integer parameter to 0;
[0104] According to the integer parameter, the remaining vertex coordinates in the initial vertex set are added to the empty vertex set in the preset order, and the remaining vertex coordinates in the initial vertex set are deleted until the initial vertex set is empty, thereby obtaining the new vertex set.
[0105] In this embodiment, the reference vertex coordinates of the prefabricated component are first determined, usually the vertex at the lower left corner of the prefabricated component, as the starting point for sorting. The reference vertex coordinates are added to the empty vertex set and deleted from the initial vertex set, which is the first step in the sorting process. Subsequently, an integer parameter is set and initialized to track and control the selection logic in the sorting process. The integer parameter is initialized to 0, and how to select the next vertex coordinate in the initial vertex set is determined according to a preset order. In a preferred embodiment of the present invention, the preset order is usually the x-axis and then the y-axis. In each iteration, according to the parity of the integer parameter, the vertex closest to the x or y coordinate of the vertex currently added to the empty vertex set is selected, added to the empty vertex set, and deleted from the initial vertex set. This process is repeated until the initial vertex set is empty, at which time all vertices are already included in the empty vertex set and are reordered in a clockwise direction.
[0106] The method for sorting the contour vertices of prefabricated components of the present invention takes the reference vertex as the starting point and sorts in a preset order, thereby ensuring that the order of the vertex set matches the actual geometric shape of the prefabricated components. At the same time, an integer parameter is used to control the selection logic in the sorting process, thereby increasing the stability of the sorting algorithm and reducing sorting errors caused by random selection.
[0107] In the embodiment of the present invention, the adding the remaining vertex coordinates in the initial vertex set to the empty vertex set according to the integer parameter and in the preset order includes:
[0108] According to the integer parameter and in the preset order, adding the remaining vertex coordinates from the initial vertex set to the empty vertex set;
[0109] Wherein, each time a remaining vertex coordinate is added to the empty vertex set, the integer parameter is increased by 1, and according to the parity of the integer parameter, the remaining vertex coordinate is selected from the initial vertex set and added to the empty vertex set.
[0110] In this embodiment, the present invention uses an integer parameter to control the order in which vertex coordinates are added, ensuring that the vertices are added to the empty vertex set in a preset order. Specifically, the integer parameter is initialized to 0, and the value of the parameter increases by 1 each time the vertex coordinates are added from the initial vertex set to the empty vertex set. The parity of the integer parameter determines the basis for selecting the next vertex coordinate: if the integer parameter is an even number, it means selecting the vertex in the x-axis direction; if it is an odd number, it means selecting the vertex in the y-axis direction. This parity-based decision-making process ensures that the vertex coordinates can be added sequentially in a clockwise or counterclockwise direction, meeting the specific requirements for sorting the vertices of the prefabricated component outline. In a preferred embodiment of the present invention, the end vertex can be taken from the vertex set that already contains the reference vertex and set to P. rear If the integer parameter is an even number, find the vertex that matches P from the initial vertex set. rear The vertex with equal x coordinates and the smallest y coordinate difference is set as P next ; If the integer parameter is an odd number, find the vertex that matches P from the initial vertex set rear The vertex with equal y coordinates and the smallest x coordinate difference is set as P next , the vertex P next Add to the vertex set that already contains the base vertex and remove P from the initial vertex set next Vertex, and the integer parameter value is incremented by 1.
[0111] The method for sorting vertices of prefabricated component outlines of the present invention uses the parity of integer parameters to determine the order of adding vertices, so that the sorting process becomes more orderly and predictable, and uses integer parameters to adapt to prefabricated components of different shapes, including those with complex outlines, to ensure the correct sorting of vertex coordinates.
[0112] The present invention accurately determines all vertex coordinates of prefabricated components through data packet information, and determines whether the prefabricated components are required to rotate according to the MES order. If the prefabricated components have rotational movements, coordinate conversion will be performed based on the rotated vertex coordinates to form an initial vertex set, thereby ensuring that even after the prefabricated components are rotated, the vertex coordinates can correctly reflect their relative positions in the polygon. Subsequently, it is further determined whether the initial vertex set meets the final sorting requirements. If necessary, it will be re-sorted based on the initial vertex set to generate a final vertex set; if the initial vertex set meets the requirements, it will be directly used as the final vertex set, which not only takes into account the possible rotation of the prefabricated components, but also ensures the accuracy and adaptability of vertex sorting through pre-sorting and conditional judgment, avoiding equipment operation failures or processing errors caused by vertex sorting errors, and effectively ensuring the correct operation of the equipment and even the production rhythm of the entire intelligent production line.
[0113] Combination Figure 4As shown, the present invention also provides a prefabricated component contour vertex sorting system, comprising:
[0114] A coordinate processing unit, used to determine the coordinates of all vertices of the prefabricated component according to the data packet information;
[0115] a first sorting unit, for determining whether the prefabricated component is rotated, and if the prefabricated component is rotated, rotating the vertices of the prefabricated component counterclockwise by 90° according to the vertex coordinates of the prefabricated component and performing coordinate conversion on the rotated vertices to obtain an initial vertex set;
[0116] The second sorting unit is used to determine whether the vertices of the prefabricated component need to be reordered according to the initial vertex set. If so, the vertices of the prefabricated component are reordered according to the initial vertex set to generate the final vertex set of the prefabricated component. If not, the initial vertex set is used as the final vertex set.
[0117] The prefabricated component outline vertex sorting system of the present invention accurately determines all vertex coordinates of the prefabricated component through data packet information, and determines whether the prefabricated component has been rotated. If the prefabricated component has been rotated, the coordinate conversion will be performed based on the vertex coordinates after rotation to form an initial vertex set, thereby ensuring that even after the prefabricated component is rotated, the vertex coordinates can correctly reflect their relative positions in the prefabricated component polygon. Subsequently, it is further determined whether the initial vertex set meets the final sorting requirements. If necessary, it will be re-sorted based on the initial set to generate a final vertex set; if the initial set meets the requirements, it will be directly used as the final set, which not only takes into account the possible rotation of the prefabricated component, but also ensures the accuracy and adaptability of vertex sorting through pre-sorting and conditional judgment, avoiding equipment operation failure or processing errors caused by vertex sorting errors, and effectively ensuring the correct operation of the equipment and even the production rhythm of the entire intelligent production line.
[0118] 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 such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0119] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may 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 the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for sorting vertices of prefabricated component contours, characterized in that: include: Determine all vertex coordinates of the prefabricated component according to the data packet information; Determine whether the prefabricated component is rotated. If the prefabricated component is rotated, rotate the vertices of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component and convert the coordinates of the rotated vertices to obtain an initial vertex set; Determine whether the vertices of the prefabricated component need to be reordered according to the initial vertex set. If so, reorder the vertices of the prefabricated component according to the initial vertex set to generate the final vertex set of the prefabricated component. If not, use the initial vertex set as the final vertex set.
2. The method for sorting the contour vertices of prefabricated components according to claim 1, characterized in that: After determining whether the prefabricated component is rotated, the method further includes: If the prefabricated component is not rotated, the vertex set in the data packet information is used as the initial vertex set.
3. The method for sorting vertices of prefabricated component contours according to claim 1, characterized in that: The step of determining all vertex coordinates of the prefabricated component according to the data packet information includes: According to the data packet information, the initial vertex coordinates of the prefabricated component are obtained; Determine whether the initial vertex coordinates contain decimals; If yes, the initial vertex coordinates with decimals are rounded, and the rounded initial vertex coordinates are used as the vertex coordinates; If not, the initial vertex coordinates are used as the vertex coordinates.
4. The method for sorting vertices of prefabricated component contours according to claim 1, characterized in that: If the prefabricated component is rotated, the vertex of the prefabricated component is rotated 90° counterclockwise according to the vertex coordinates of the prefabricated component and the coordinates of the rotated vertex are converted, including: According to the data packet information, the vertex coordinates of the prefabricated component before rotation and the long side of the prefabricated component are obtained; Rotate the vertex of the prefabricated component 90° counterclockwise according to the vertex coordinates of the prefabricated component; According to the change of the long side of the prefabricated component before and after the rotation, the vertex coordinates before the rotation are converted to obtain the vertex coordinates after the rotation; Pre-sorting is performed according to the rotated vertex coordinates to obtain the initial vertex set.
5. The method for sorting vertices of prefabricated component contours according to claim 3, characterized in that: The pre-sorting according to the rotated vertex coordinates to obtain the initial vertex set includes: Determining the reference coordinates of the prefabricated component according to the vertex coordinates after the rotation; Pre-sorting the reference coordinates in a preset order to obtain a sorted sequence of the rotated vertex coordinates; The sorted sequence is used as the initial vertex set.
6. The method for sorting the contour vertices of prefabricated components according to claim 5, characterized in that: The step of judging whether the vertices of the prefabricated components need to be reordered according to the initial vertex set includes: According to the initial vertex set, obtaining the number of vertices of the prefabricated component; When the number of vertices is a preset number, determining that the vertex coordinates of the prefabricated component do not need to be reordered; When the number of vertices is greater than the preset number, it is determined that the vertex coordinates of the prefabricated component need to be reordered.
7. The method for sorting the contour vertices of prefabricated components according to claim 6, characterized in that: The step of reordering the vertices of the prefabricated component according to the initial vertex set to generate the final vertex set of the prefabricated component comprises: Generate an empty vertex set; Adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty, thereby obtaining a new vertex set; The new vertex set is used as the final vertex set of the prefabricated component.
8. The method for sorting vertices of prefabricated component contours according to claim 7, characterized in that: The step of adding the vertex coordinates in the initial vertex set to the empty vertex set in a preset order and deleting the vertex coordinates in the initial vertex set until the initial vertex set is empty to obtain a new vertex set includes: Determining reference vertex coordinates of the prefabricated component according to the initial vertex set; Add the reference vertex coordinates to the empty vertex set and delete the reference vertex coordinates in the initial vertex set; After deleting the reference vertex coordinates in the initial vertex set, setting an integer parameter and initializing the integer parameter to 0; According to the integer parameter, the remaining vertex coordinates in the initial vertex set are added to the empty vertex set in the preset order, and the remaining vertex coordinates in the initial vertex set are deleted until the initial vertex set is empty, thereby obtaining the new vertex set.
9. The method for sorting vertices of the prefabricated component contour according to claim 8, characterized in that: The adding the remaining vertex coordinates in the initial vertex set to the empty vertex set according to the integer parameter and in the preset order includes: According to the integer parameter and in the preset order, adding the remaining vertex coordinates from the initial vertex set to the empty vertex set; Wherein, each time a remaining vertex coordinate is added to the empty vertex set, the integer parameter is increased by 1, and according to the parity of the integer parameter, the remaining vertex coordinate is selected from the initial vertex set and added to the empty vertex set.
10. A prefabricated component contour vertex sorting system, characterized in that: include: A coordinate processing unit, used to determine the coordinates of all vertices of the prefabricated component according to the data packet information; a first sorting unit, for determining whether the prefabricated component is rotated, and if the prefabricated component is rotated, rotating the vertices of the prefabricated component counterclockwise by 90° according to the vertex coordinates of the prefabricated component and performing coordinate conversion on the rotated vertices to obtain an initial vertex set; The second sorting unit is used to determine whether the vertices of the prefabricated component need to be reordered according to the initial vertex set. If so, the vertices of the prefabricated component are reordered according to the initial vertex set to generate the final vertex set of the prefabricated component. If not, the initial vertex set is used as the final vertex set.