Critical polygon calculation method and device
By filtering invalid motion trajectory vectors and performing intersection calculations on the detection vectors when calculating the critical polygon, the problems of large computational load and low efficiency are solved, and efficient and accurate critical polygon calculation is achieved.
Patent Information
- Application Number
- CN202510998227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies involve enormous computational demands and are inefficient when calculating critical polygons, making it difficult to guarantee accuracy and improve processing speed in complex environments.
By determining the relative positions of the preset reference point and the moving polygon, the motion trajectory vector is calculated and invalid vectors are deleted. The detection vectors are extracted and intersection calculations are performed until the beginning and end are connected to determine the constituent vector edges of the critical polygon.
It significantly improves computational efficiency, optimizes the computation process, and enhances the accuracy and reliability of the results, making it suitable for engineering applications with high computational efficiency requirements.
Smart Images

Figure CN120876591A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of mathematics and computational geometry, and in particular to a method and apparatus for calculating critical polygons. Background Technology
[0002] With the rapid development of automation, robotics, and intelligent manufacturing, accurately calculating and optimizing motion trajectories has become a key technology in many engineering fields to ensure the efficient and safe operation of equipment or robots in complex environments. Among these methods, calculating the NoFit Polygon (NFP) is a common approach.
[0003] Currently, calculating critical polygon nonlinear programming (NFP) often requires path planning under numerous motion trajectories and spatial constraints. Due to the interactions between polygons and complex geometric calculations, traditional methods often need to handle a large number of trajectory segments and intersections during the calculation process, resulting in huge computational loads and low processing efficiency. Especially in complex dynamic environments, existing technologies struggle to improve computational efficiency while maintaining accuracy, leading to slow processing speeds and high consumption of computational resources.
[0004] Therefore, optimizing the calculation process of critical polygons (NFPs), reducing unnecessary calculations, and improving computational efficiency have become urgent problems to be solved. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a method and apparatus for calculating critical polygons to solve the problems of low calculation efficiency, slow processing speed and high consumption of computing resources.
[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0007] The first aspect of this invention discloses a method for calculating a critical polygon, the method comprising:
[0008] Determine the relative position between a preset reference point and the moving polygon; the preset reference point is a point on the moving polygon or any point inside or outside the moving polygon;
[0009] Based on the geometric description information of the fixed polygon and the moving polygon and the relative position, the motion trajectory vector generated by the preset reference point is calculated when the moving polygon moves along the fixed polygon, and invalid motion trajectory vectors are deleted according to the judgment rules to obtain the target motion trajectory vector;
[0010] Extract the detection vector from the target motion trajectory vector;
[0011] The intersection calculation is performed between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result;
[0012] The latest detection vector is re-determined based on the intersection calculation result, and it is determined whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector;
[0013] If the beginning and end are not connected, the constituent vector edges of the critical polygon are determined based on the intersection point between the previous detection vector and the latest detection vector, and the process returns to the step of performing the intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result.
[0014] If the beginning and end are connected, the critical polygon is calculated based on the constituent vector edges of all critical polygons.
[0015] Preferably, the step of calculating the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, based on the geometric description information of the fixed polygon and the moving polygon and the relative position, includes:
[0016] Obtain the point sequence of the fixed polygon, the clockwise vector edges of the fixed polygon, and the convex angles of the fixed polygon, and record them as the geometric description information of the fixed polygon;
[0017] Obtain the point list of the moving polygon, the clockwise direction vector edge of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon;
[0018] Based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, as well as the relative position, calculate the motion trajectory vector generated by the reference point when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and calculate the motion trajectory vector generated by the reference point when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
[0019] Preferably, the step of extracting the detection vector from the target motion trajectory vector includes:
[0020] Calculate the starting vector based on all target motion trajectory vectors, where the starting point of the starting vector is the extreme point;
[0021] The starting vector is used as the detection vector, wherein the starting point of the starting vector is used as the starting point of the critical polygon.
[0022] Preferably, the step of re-determining the latest detection vector based on the intersection calculation result includes:
[0023] Find the intersection point with the smallest distance to the starting point of the detection vector from the intersection calculation results;
[0024] Determine whether the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector;
[0025] If the intersection point is the intersection point of a target motion trajectory vector and the detection vector, then the latest detection vector is determined based on the target motion trajectory vector;
[0026] If the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, then the latest detection vector is determined from the multiple target motion trajectory vectors based on the direction of rotation when the moving polygon moves along the fixed polygon.
[0027] Preferably, determining the constituent vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector includes:
[0028] The intersection point between the previous detection vector and the latest detection vector is taken as the endpoint of the constituent vector edge of the critical polygon;
[0029] Take the starting point of the previous detection vector as the starting point of the constituent vector edges of the critical polygon;
[0030] The constituent vector edges of the critical polygon are determined based on the endpoint and the starting point.
[0031] A second aspect of the present invention discloses a calculation apparatus for a critical polygon, the apparatus comprising:
[0032] A determining unit is used to determine the relative position between a preset reference point and a moving polygon; the preset reference point is a point on the moving polygon or any point inside or outside the moving polygon;
[0033] The motion trajectory vector calculation unit is used to calculate the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, based on the geometric description information of the fixed polygon and the moving polygon and the relative position, and to delete invalid motion trajectory vectors according to the judgment rules to obtain the target motion trajectory vector.
[0034] Extraction unit, used to extract detection vector from the target motion trajectory vector;
[0035] The intersection calculation unit is used to perform intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result.
[0036] The judgment unit is used to redetermine the latest detection vector based on the intersection calculation result, and to determine whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector;
[0037] The component vector edge determination unit is used to determine the component vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector if the first and last ends are not connected, and then return to execute the intersection calculation unit.
[0038] The critical polygon calculation unit is used to calculate the critical polygon based on the component vector edges of all critical polygons if the two sides are connected end to end.
[0039] Preferably, the motion trajectory vector calculation unit includes:
[0040] The first acquisition module is used to acquire the point sequence of the fixed polygon, the clockwise vector edge of the fixed polygon, and the convex angle of the fixed polygon, and record them as the geometric description information of the fixed polygon.
[0041] The second acquisition module is used to acquire the point list of the moving polygon, the clockwise vector edge of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon.
[0042] The motion trajectory vector calculation module is used to calculate, based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, and the relative position, the motion trajectory vector generated by the reference point when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and the motion trajectory vector generated by the reference point when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
[0043] Preferably, the extraction unit is specifically used for:
[0044] Calculate the starting vector based on all target motion trajectory vectors, where the starting point of the starting vector is the extreme point; use the starting vector as the detection vector, where the starting point of the starting vector is the starting point of the critical polygon.
[0045] Preferably, the determining unit includes:
[0046] The search module is used to find the intersection point with the smallest distance from the starting point of the detection vector from the intersection calculation results;
[0047] The judgment module is used to determine whether the intersection point is an intersection point of multiple target motion trajectory vectors and the detection vector;
[0048] The first determining module is used to determine the latest detection vector based on the target motion trajectory vector if the intersection point is the intersection point of a target motion trajectory vector and the detection vector.
[0049] The second determining module is used to determine the latest detection vector from the multiple target motion trajectory vectors if the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, based on the direction of the moving polygon when it moves along the fixed polygon.
[0050] Preferably, the constituent vector edge determination unit includes:
[0051] The endpoint determination module is used to determine the intersection point between the previous detection vector and the latest detection vector as the endpoint of the constituent vector edge of the critical polygon.
[0052] The starting point determination module is used to take the starting point of the previous detection vector as the starting point of the constituent vector edges of the critical polygon;
[0053] The component vector edge determination module is used to determine the component vector edges of the critical polygon based on the endpoint and the starting point.
[0054] The present invention provides a method and apparatus for calculating critical polygons based on the above embodiments. The method calculates the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, based on the relative position of a preset reference point and the moving polygon, and the geometric description information of the fixed and moving polygons. Invalid motion trajectory vectors are deleted according to a judgment rule to obtain the target motion trajectory vector. A detection vector is extracted from the target motion trajectory vector and its intersection with the remaining target motion trajectory vectors is calculated to determine the constituent vector edges of the critical polygon and the latest detection vector. This process continues until the latest detection vector connects end-to-end with the initial detection vector. Thus, the critical polygon is calculated based on the constituent vector edges of all critical polygons. By deleting invalid motion trajectory vectors, the entire calculation process is optimized. The introduction of the concept of "detection vector" allows for more accurate judgment of the validity of trajectory vectors, enhancing the accuracy and reliability of the results. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0056] Figure 1 A flowchart illustrating a method for calculating a critical polygon, as provided in an embodiment of the present invention;
[0057] Figure 2 This is a first example diagram of the motion trajectory vector provided in an embodiment of the present invention;
[0058] Figure 3 This is a second example diagram of the motion trajectory vector provided in an embodiment of the present invention;
[0059] Figure 4 An example diagram of the intersection point provided in an embodiment of the present invention;
[0060] Figure 5 Another example diagram of the intersection point provided in the embodiment of the present invention;
[0061] Figure 6 Another example diagram of the intersection point provided in the embodiment of the present invention;
[0062] Figure 7 This is a structural block diagram of a computing device for a critical polygon provided in an embodiment of the present invention. Detailed Implementation
[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0064] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0065] As the background technology shows, when calculating the critical polygon NFP, due to the large number of motion trajectories and spatial constraints involved, traditional methods often face the problems of huge computational load and low efficiency at high accuracy.
[0066] Therefore, this invention provides a method and apparatus for calculating critical polygons. Based on the relative position of a preset reference point and a moving polygon, and the geometric description information of the fixed and moving polygons, the method calculates the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon. Invalid motion trajectory vectors are deleted according to a judgment rule to obtain the target motion trajectory vector. A detection vector is extracted from the target motion trajectory vector and its intersection with the remaining target motion trajectory vectors is calculated to determine the constituent vector edges of the critical polygon and the latest detection vector. This process continues until the latest detection vector connects end-to-end with the initial detection vector. Thus, the critical polygon is calculated based on the constituent vector edges of all critical polygons. By deleting invalid motion trajectory vectors, the entire calculation process is optimized, significantly improving processing speed. The introduction of the concept of a "detection vector" allows for more accurate judgment of the validity of trajectory vectors, enhancing the accuracy and reliability of the results.
[0067] See Figure 1 The flowchart illustrates a method for calculating a critical polygon according to an embodiment of the present invention. The method includes:
[0068] Step S101: Determine the relative position of the preset reference point and the moving polygon.
[0069] It should be noted that the preset reference point can be a point on the moving polygon or any point inside or outside the moving polygon. In other words, a fixed reference point is selected in advance, which can usually be a vertex of the moving polygon or the centroid (geometric center) of the moving polygon.
[0070] In the specific implementation step S101, the relative position of the preset reference point and the moving polygon is determined by comparing the position of the preset reference point with the coordinates of each vertex in the moving polygon, or by calculating the position of the preset reference point relative to each edge of the moving polygon.
[0071] Step S102: Based on the geometric description information and relative position of the fixed polygon and the moving polygon, calculate the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, and delete invalid motion trajectory vectors according to the judgment rules to obtain the target motion trajectory vector.
[0072] In the specific implementation step S102, based on the geometric description information of the fixed polygon and the moving polygon, as well as the relative position of the preset reference point and the moving polygon, the motion trajectory vector generated by the reference point when the moving polygon moves along the fixed polygon is calculated. Then, invalid trajectory vectors are eliminated by judgment rules, and finally, the valid target motion trajectory vector is obtained.
[0073] It should be noted that the specific process for calculating the trajectory vector of the reference point is as follows (processes A1 to A3) or (processes B1 to B3):
[0074] It should be noted that if the moving polygon turns clockwise when moving along the fixed polygon, the specific process of calculating the motion trajectory vector of the reference point is shown in processes A1 to A3.
[0075] Process A1: Obtain the point sequence of the fixed polygon, the clockwise vector edge of the fixed polygon, and the convex angle of the fixed polygon, and record them as the geometric description information of the fixed polygon.
[0076] Process A2: Obtain the point list of the moving polygon, the clockwise direction vector of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon.
[0077] Process A3: Based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, as well as their relative positions, calculate the motion trajectory vectors generated by the reference points when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and calculate the motion trajectory vectors generated by the reference points when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
[0078] It should be noted that if the moving polygon turns counterclockwise when moving along the fixed polygon, the specific process for calculating the motion trajectory vector of the reference point is shown in processes B1 to B3.
[0079] Process B1: Obtain the point sequence of the fixed polygon, the vector edges of the fixed polygon that turn counterclockwise, and the convex angles of the fixed polygon, and record them as the geometric description information of the fixed polygon.
[0080] Process B2: Obtain the point list of the moving polygon, the vector edges of the moving polygon that rotate counterclockwise, and the convex angles of the moving polygon, and record them as the geometric description information of the moving polygon.
[0081] Process B3: Based on the geometric description information of the fixed polygon and the moving polygon, as well as their relative positions, calculate the motion trajectory vectors generated by the reference points when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and calculate the motion trajectory vectors generated by the reference points when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
[0082] Understandably, the rules for determining invalid motion trajectory vectors from all reference points differ depending on the direction of rotation. Specifically:
[0083] When the moving polygon moves along the fixed polygon and turns clockwise, from the motion trajectory vectors generated by all reference points, select the motion trajectory vectors where the two points before and after the convex angle or one of the points is on the right side of the vector edge when the convex angle is connected to the vector edge. Record these motion trajectory vectors as invalid motion trajectory vectors and delete them to obtain the valid target motion trajectory vectors.
[0084] For example: see Figure 2 and Figure 3 The example diagram is shown. In Figure 2 In the diagram, the two points P0 and P2 before and after the convex angle P1 are on the right side of vector side AB. Figure 3 In the equation, among the two points P0 and P2 before and after the convex angle P1, P0 is to the right of the vector side AB. Therefore, the motion trajectory vector AB is determined to be an invalid motion trajectory vector, and this invalid motion trajectory vector is deleted.
[0085] When the moving polygon moves along the fixed polygon and turns counterclockwise, from the motion trajectory vectors generated by all reference points, select the motion trajectory vectors where the two points before and after the convex angle or one of the points is on the left side of the vector edge when the convex angle is connected to the vector edge. These motion trajectory vectors are marked as invalid motion trajectory vectors and deleted, thus obtaining the valid target motion trajectory vector.
[0086] Step S103: Extract the detection vector from the target motion trajectory vector.
[0087] In the specific implementation step S103, the target motion trajectory vector with the starting point as the extreme point is calculated from all target motion trajectory vectors. This target motion trajectory vector is used as the starting vector of the critical polygon, and the starting vector is used as the subsequent detection vector.
[0088] In other words, an initial vector is calculated based on all target motion trajectory vectors, with the starting point of the initial vector being the extreme point; this initial vector is then used as the detection vector. The starting point of the initial vector serves as the starting point of the critical polygon.
[0089] It should be noted that extreme points can be determined by different calculation methods, such as the vector product method, the farthest or nearest point method, the quadratic optimization method, etc. This embodiment of the invention does not impose specific limitations.
[0090] Step S104: Perform intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result.
[0091] In the specific implementation step S104, the intersection calculation is performed between the latest detection vector and each of the remaining target motion trajectory vectors. There are three possible results: first, the two vectors intersect at a point inside the vectors; second, the two vectors intersect at a point on the boundary of one or both vectors; and third, the two vectors do not intersect. The last result (i.e., the two vectors do not intersect) is discarded to obtain the final intersection calculation result.
[0092] Step S105: Based on the intersection calculation results, redetermine the latest detection vector and determine whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector.
[0093] In the specific implementation of step S105, the latest detection vector is re-determined based on the intersection calculation result. Then, it is determined whether the latest detection vector is connected end-to-end with the detection vector initially extracted from the target motion trajectory vector (i.e., the starting vector of the critical polygon). In other words, the end point of the latest detection vector is the starting point of the starting vector. If the latest detection vector is not connected end-to-end with the detection vector extracted from the target motion trajectory vector, step S106 is executed; if the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector, step S107 is executed.
[0094] Understandably, the specific process for re-determining the latest detection vector based on the intersection calculation results is as follows (processes C1 to C4):
[0095] Process C1: Find the intersection point with the smallest distance from the starting point of the detection vector from the intersection calculation results.
[0096] In the specific implementation process C1, the intersection point with the smallest distance to the starting point of the detection vector is found from all the intersection points of the intersection calculation results.
[0097] Process C2: Determine whether the intersection point is the intersection of multiple target trajectory vectors and the detection vector. If the intersection point is the intersection of one target trajectory vector and the detection vector, then execute process C3; if the intersection point is the intersection of multiple target trajectory vectors and the detection vector, then execute process C4.
[0098] Process C3: If the intersection point is the intersection point of a target motion trajectory vector and a detection vector, then determine the latest detection vector based on the target motion trajectory vector.
[0099] In the specific implementation of process C3, if the intersection point is the intersection point of a target motion trajectory vector and a detection vector, then the latest detection vector is determined based on the target motion trajectory vector.
[0100] It should be noted that if the intersection point is the intersection of a target motion trajectory vector and a detection vector, then the intersection point is taken as the starting point of the latest detection vector, and the ending point of the target motion trajectory vector is taken as the ending point of the latest detection vector, thus obtaining the latest detection vector.
[0101] For example Figure 4 The diagram shows an example of intersection points. The detection vector AB intersects the target trajectory vector CD at point P1. The detection vector AB intersects the target trajectory vector EF at point P2. The target trajectory vector CD intersects the target trajectory vector EF at point P3.
[0102] Since intersection point P1 is the intersection point with the smallest distance from the starting point A of detection vector AB, intersection point P1 is taken as the starting point of the latest detection vector, and the ending point D of the target motion trajectory vector CD is taken as the ending point of the latest detection vector, thus obtaining the latest detection vector P1D.
[0103] Process C4: If the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, then the latest detection vector is determined from the multiple target motion trajectory vectors based on the direction of the moving polygon when it moves along the fixed polygon.
[0104] In the specific implementation of process C4, if the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, then it is necessary to determine the latest detection vector from multiple target motion trajectory vectors based on the direction of the moving polygon when it moves along the fixed polygon (divided into clockwise and counterclockwise directions).
[0105] Specifically, when the moving polygon rotates clockwise while moving along the fixed polygon, the following will occur: Figure 5 The intersection situation is shown. That is, the intersection point of the detection vector AB with the target motion trajectory vectors CD and EF is P.
[0106] At this point, since the moving polygon rotates clockwise along the fixed polygon, the counterclockwise rotation angle of the target trajectory vector EF relative to the detection vector AB is greater than the counterclockwise rotation angle of the target trajectory vector CD relative to the detection vector AB. Therefore, the intersection point P is taken as the starting point of the latest detection vector, and the latest detection vector is determined to be PF.
[0107] Specifically, when the moving polygon rotates counterclockwise along the fixed polygon, the following will occur: Figure 6 The intersection situation is shown. Same as above. Figure 5 Similarly, the intersection point of the detection vector AB with both the target trajectory vectors CD and EF is P. However, the directions of the target trajectory vectors CD and EF are different from those of the target trajectory vectors EF. Figure 5 different.
[0108] At this point, since the moving polygon rotates counterclockwise along the fixed polygon, the clockwise rotation angle of the target trajectory vector EF relative to the detection vector AB is greater than the clockwise rotation angle of the target trajectory vector CD relative to the detection vector AB. Therefore, the intersection point P is taken as the starting point of the latest detection vector, and the latest detection vector is determined to be PC.
[0109] Step S106: If the first and last parts are not connected, determine the constituent vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector, and return to step S104.
[0110] In the specific implementation of step S106, when the latest detection vector is not connected to the detection vector extracted from the target motion trajectory vector, the constituent vector edges of the critical polygon are determined based on the intersection point between the previous detection vector and the latest detection vector, and then the process returns to step S104.
[0111] For example Figure 4 In this process, the intersection point P1 between the previous detection vector AB and the latest detection vector P1D is taken as the endpoint of the constituent vector edge of the critical polygon, and the starting point A of the previous detection vector AB is taken as the starting point of the constituent vector edge of the critical polygon, thus obtaining the constituent vector edge AP1 of the critical polygon.
[0112] For example Figure 5 In this process, the intersection point P between the previous detection vector AB and the latest detection vector PF is taken as the starting point of the constituent vector edge of the critical polygon, thus obtaining the constituent vector edge AP of the critical polygon.
[0113] Similarly, Figure 6 In the content shown, the intersection point P between the previous detection vector AB and the latest detection vector PC is taken as the starting point of the constituent vector edge of the critical polygon, and the constituent vector edge AP of the critical polygon is obtained.
[0114] Step S107: If the beginning and end are connected, the critical polygon is calculated based on the constituent vector edges of all critical polygons.
[0115] In the specific implementation step S107, when the latest detection vector is connected end to end with the detection vector extracted from the target motion trajectory vector, it can be determined that all the component vector edges of the critical polygon have been calculated. Finally, the critical polygon is calculated based on the component vector edges of all the critical polygons.
[0116] In this embodiment of the invention, by pre-screening invalid motion trajectory vectors, the workload of subsequent calculations is significantly reduced, thereby greatly improving computational efficiency, optimizing the entire calculation process, and increasing processing speed. Introducing the concept of "detection vectors" allows for more accurate determination of the validity of trajectory vectors. This not only improves computational efficiency but also enhances the accuracy and reliability of the results, making it particularly suitable for engineering applications with high computational efficiency requirements.
[0117] Corresponding to the method for calculating a critical polygon provided in the above embodiments of the present invention, see also... Figure 7 The diagram shows a structural block diagram of a computing device for a critical polygon provided in an embodiment of the present invention.
[0118] The device includes: a determination unit 701, a motion trajectory vector calculation unit 702, an extraction unit 703, an intersection calculation unit 704, a judgment unit 705, a constituent vector edge determination unit 706, and a critical polygon calculation unit 707.
[0119] The determining unit 701 is used to determine the relative position of a preset reference point and a moving polygon; the preset reference point is a point on the moving polygon or any point inside or outside the moving polygon.
[0120] The motion trajectory vector calculation unit 702 is used to calculate the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon based on the geometric description information and relative position of the fixed polygon and the moving polygon, and delete invalid motion trajectory vectors according to the judgment rules to obtain the target motion trajectory vector.
[0121] Extraction unit 703 is used to extract detection vector from target motion trajectory vector.
[0122] The intersection calculation unit 704 is used to perform intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result.
[0123] The judgment unit 705 is used to redetermine the latest detection vector based on the intersection calculation result, and to determine whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector.
[0124] The component vector edge determination unit 706 is used to determine the component vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector if the first and last ends are not connected, and then return to the intersection calculation unit 704 for execution.
[0125] The critical polygon calculation unit 707 is used to calculate the critical polygon based on the component vector edges of all critical polygons if the two ends are connected.
[0126] In this embodiment of the invention, by pre-screening invalid motion trajectory vectors, the workload of subsequent calculations is significantly reduced, thereby greatly improving computational efficiency, optimizing the entire calculation process, and increasing processing speed. Introducing the concept of "detection vectors" allows for more accurate determination of the validity of trajectory vectors. This not only improves computational efficiency but also enhances the accuracy and reliability of the results, making it particularly suitable for engineering applications with high computational efficiency requirements.
[0127] Combination Figure 7 The content shown is that the motion trajectory vector calculation unit 702 includes: a first acquisition module, a second acquisition module, and a motion trajectory vector calculation module.
[0128] The first acquisition module is used to acquire the point sequence of the fixed polygon, the clockwise vector edges of the fixed polygon, and the convex angles of the fixed polygon, and record them as the geometric description information of the fixed polygon.
[0129] The second acquisition module is used to acquire the point list of the moving polygon, the clockwise vector edge of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon.
[0130] The motion trajectory vector calculation module is used to calculate the motion trajectory vector generated by the reference point when all vector edges of the moving polygon move along all convex corners of the fixed polygon, based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, as well as their relative positions. It also calculates the motion trajectory vector generated by the reference point when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
[0131] Combination Figure 7 The content shown is extracted by unit 703, which is specifically used for: calculating the starting vector based on all target motion trajectory vectors, with the starting point of the starting vector being the extreme point; and using the starting vector as the detection vector, where the starting point of the starting vector is used as the starting point of the critical polygon.
[0132] Combination Figure 7 The content shown, the judgment unit 705, includes: a search module, a judgment module, a first determination module and a second determination module.
[0133] The search module is used to find the intersection point with the smallest distance from the starting point of the detection vector from the intersection calculation results.
[0134] The judgment module is used to determine whether the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector.
[0135] The first determining module is used to determine the latest detection vector based on the target motion trajectory vector if the intersection point is the intersection point of a target motion trajectory vector and a detection vector.
[0136] The second determining module is used to determine the latest detection vector from multiple target motion trajectory vectors if the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, based on the direction of the moving polygon when it moves along the fixed polygon.
[0137] Combination Figure 7 The contents shown constitute the vector edge determination unit 706, which includes: an endpoint determination module, a starting point determination module, and a vector edge determination module.
[0138] The endpoint determination module is used to determine the intersection point between the previous detection vector and the latest detection vector as the endpoint of the constituent vector edge of the critical polygon.
[0139] The starting point determination module is used to take the starting point of the previous detection vector as the starting point of the constituent vector edges of the critical polygon.
[0140] The component vector edge determination module is used to determine the component vector edges of the critical polygon based on the endpoint and the starting point.
[0141] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0142] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0143] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for calculating a critical polygon, characterized in that, The method includes: Determine the relative position between a preset reference point and the moving polygon; the preset reference point is a point on the moving polygon or any point inside or outside the moving polygon; Based on the geometric description information of the fixed polygon and the moving polygon and the relative position, the motion trajectory vector generated by the preset reference point is calculated when the moving polygon moves along the fixed polygon, and invalid motion trajectory vectors are deleted according to the judgment rules to obtain the target motion trajectory vector; Extract the detection vector from the target motion trajectory vector; The intersection calculation is performed between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result; The latest detection vector is re-determined based on the intersection calculation result, and it is determined whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector; If the beginning and end are not connected, the constituent vector edges of the critical polygon are determined based on the intersection point between the previous detection vector and the latest detection vector, and the process returns to the step of performing the intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result. If the beginning and end are connected, the critical polygon is calculated based on the constituent vector edges of all critical polygons.
2. The method according to claim 1, characterized in that, The step of calculating the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, based on the geometric description information of the fixed polygon and the moving polygon and the relative position, includes: Obtain the point sequence of the fixed polygon, the clockwise vector edges of the fixed polygon, and the convex angles of the fixed polygon, and record them as the geometric description information of the fixed polygon; Obtain the point list of the moving polygon, the clockwise direction vector edge of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon; Based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, as well as the relative position, calculate the motion trajectory vector generated by the reference point when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and calculate the motion trajectory vector generated by the reference point when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
3. The method according to claim 1, characterized in that, The step of extracting the detection vector from the target motion trajectory vector includes: Calculate the starting vector based on all target motion trajectory vectors, where the starting point of the starting vector is the extreme point; The starting vector is used as the detection vector, wherein the starting point of the starting vector is used as the starting point of the critical polygon.
4. The method according to claim 1, characterized in that, The step of re-determining the latest detection vector based on the intersection calculation result includes: Find the intersection point with the smallest distance to the starting point of the detection vector from the intersection calculation results; Determine whether the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector; If the intersection point is the intersection point of a target motion trajectory vector and the detection vector, then the latest detection vector is determined based on the target motion trajectory vector; If the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, then the latest detection vector is determined from the multiple target motion trajectory vectors based on the direction of rotation when the moving polygon moves along the fixed polygon.
5. The method according to claim 1, characterized in that, The step of determining the constituent vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector includes: The intersection point between the previous detection vector and the latest detection vector is taken as the endpoint of the constituent vector edge of the critical polygon; Take the starting point of the previous detection vector as the starting point of the constituent vector edges of the critical polygon; The constituent vector edges of the critical polygon are determined based on the endpoint and the starting point.
6. A computing device for a critical polygon, characterized in that, The device includes: A determining unit is used to determine the relative position between a preset reference point and a moving polygon; the preset reference point is a point on the moving polygon or any point inside or outside the moving polygon; The motion trajectory vector calculation unit is used to calculate the motion trajectory vector generated by the preset reference point when the moving polygon moves along the fixed polygon, based on the geometric description information of the fixed polygon and the moving polygon and the relative position, and to delete invalid motion trajectory vectors according to the judgment rules to obtain the target motion trajectory vector. Extraction unit, used to extract detection vector from the target motion trajectory vector; The intersection calculation unit is used to perform intersection calculation between the latest detection vector and the remaining target motion trajectory vectors in the target motion trajectory vector to obtain the intersection calculation result. The judgment unit is used to redetermine the latest detection vector based on the intersection calculation result, and to determine whether the latest detection vector is connected end-to-end with the detection vector extracted from the target motion trajectory vector; The component vector edge determination unit is used to determine the component vector edges of the critical polygon based on the intersection point between the previous detection vector and the latest detection vector if the first and last ends are not connected, and then return to execute the intersection calculation unit. The critical polygon calculation unit is used to calculate the critical polygon based on the component vector edges of all critical polygons if the two sides are connected end to end.
7. The apparatus according to claim 6, characterized in that, The motion trajectory vector calculation unit includes: The first acquisition module is used to acquire the point sequence of the fixed polygon, the clockwise vector edge of the fixed polygon, and the convex angle of the fixed polygon, and record them as the geometric description information of the fixed polygon. The second acquisition module is used to acquire the point list of the moving polygon, the clockwise vector edge of the moving polygon, and the convex angle of the moving polygon, and record them as the geometric description information of the moving polygon. The motion trajectory vector calculation module is used to calculate, based on the geometric description information of the fixed polygon and the geometric description information of the moving polygon, and the relative position, the motion trajectory vector generated by the reference point when all vector edges of the moving polygon move along all convex corners of the fixed polygon, and the motion trajectory vector generated by the reference point when all convex corners of the moving polygon move along all vector edges of the fixed polygon.
8. The apparatus according to claim 6, characterized in that, The extraction unit is specifically used for: Calculate the starting vector based on all target motion trajectory vectors, where the starting point of the starting vector is the extreme point; use the starting vector as the detection vector, where the starting point of the starting vector is the starting point of the critical polygon.
9. The apparatus according to claim 6, characterized in that, The judgment unit includes: The search module is used to find the intersection point with the smallest distance from the starting point of the detection vector from the intersection calculation results; The judgment module is used to determine whether the intersection point is an intersection point of multiple target motion trajectory vectors and the detection vector; The first determining module is used to determine the latest detection vector based on the target motion trajectory vector if the intersection point is the intersection point of a target motion trajectory vector and the detection vector. The second determining module is used to determine the latest detection vector from the multiple target motion trajectory vectors if the intersection point is the intersection point of multiple target motion trajectory vectors and the detection vector, based on the direction of the moving polygon when it moves along the fixed polygon.
10. The apparatus according to claim 6, characterized in that, The component vector edge determination unit includes: The endpoint determination module is used to determine the intersection point between the previous detection vector and the latest detection vector as the endpoint of the constituent vector edge of the critical polygon. The starting point determination module is used to take the starting point of the previous detection vector as the starting point of the constituent vector edges of the critical polygon; The component vector edge determination module is used to determine the component vector edges of the critical polygon based on the endpoint and the starting point.