A method, device, equipment and storage medium for determining the positional relationship between a point and an irregular hexahedron unit
By constructing the method of surrounding box, centroid and covariance matrix normal vector, the calculation complexity and robustness of non-regular hexahedral position determination are solved, and efficient and accurate position relationship determination is achieved.
Patent Information
- Application Number
- CN202510626529.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-05-15
AI Technical Summary
The prior art has complex calculations, insufficient accuracy and poor robustness when processing non-regular hexahedrons of aircraft components, making it difficult to meet real-time and accuracy requirements.
By determining the bounding box of the irregular hexahedron, constructing a covariance matrix using the centroid and deviation vectors, determining the normal vector, and calculating signed distances based on the fitted plane equation to determine the positional relationship of the point.
The efficiency of determining the position relationship between points and irregular hexahedral units is improved, the accuracy and robustness of the calculation are improved, and the real-time requirements are met.
Smart Images

Figure CN120145563B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of aircraft simulation, and particularly relates to a method, device, equipment and storage medium for determining the positional relationship between a point and an irregular hexahedron unit. Background Art
[0002] In three-dimensional space, determining the positional relationship between a point and a hexahedron is a basic problem in the field of computational geometry, and is widely used in engineering and scientific calculations such as computer graphics, computer-aided design, finite element analysis, and physical collision detection.
[0003] However, the existing technologies have problems such as complex calculations, insufficient accuracy, and poor robustness when dealing with irregular hexahedrons corresponding to the mesh models of aircraft components, and it is difficult to meet the actual requirements. Currently, common methods for determining the position of a point and a polyhedron include the Ray-Casting method and the Face Crossing method.
[0004] Among them, the Ray-Casting method first emits a ray from the point to be detected in the aircraft simulation space, and then counts the number of intersection points between the ray and the surface of the polyhedron to determine the internal and external positions of the point. However, this method has a high computational complexity, is difficult to meet the real-time requirements, is not robust enough in dealing with boundary cases, is prone to misjudgment, and there is no special processing method for the case where the vertices are not coplanar.
[0005] In addition, the Face Crossing method determines the position information by judging the positional relationship between the point to be detected in the aircraft simulation space and each face corresponding to the hexahedron of the aircraft component mesh model. However, this method has insufficient support for non-strictly coplanar cases in application, is prone to numerical errors when dealing with boundary cases, and needs to solve the problem of the consistency of the normal vector direction in the implementation process.
[0006] That is to say, most of the above methods assume that each face of the hexahedron is composed of strictly coplanar vertices. However, due to numerical errors, discretization, or geometric simplification, the faces of the hexahedron in actual applications are often not strictly coplanar, resulting in inaccurate judgments by traditional methods. At the same time, the above methods lack an effective fast rejection mechanism, have a high computational complexity, are difficult to meet the real-time requirements, and are not robust enough in dealing with boundary cases, and are prone to misjudgment or calculation failure.
[0007] As can be seen from the above, how to improve the determination efficiency of the positional relationship between a point and an irregular hexahedron unit in the process of determining the positional relationship between a point and an irregular hexahedron unit is an urgent problem to be solved at present. Summary of the Invention
[0008] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for determining the positional relationship between a point and an irregular hexahedron unit, which can improve the determination efficiency of the positional relationship between a point and an irregular hexahedron unit during the determination process. The specific scheme is as follows:
[0009] In a first aspect, the present application provides a method for determining the positional relationship between a point and an irregular hexahedron unit, including:
[0010] Determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component grid model, and determine the bounding box corresponding to the irregular hexahedron of the aircraft body component grid model based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinate;
[0011] Based on the coordinate information corresponding to the point to be detected in the aircraft simulation space, judge whether the point to be detected is located inside the bounding box. If it is located inside the bounding box, use the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component grid model to centralize each vertex in the plane to obtain the corresponding deviation vectors;
[0012] Determine the covariance matrix based on each deviation vector, the coordinate information of the centroid and each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane;
[0013] Determine the target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance.
[0014] Optionally, the step of determining the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component grid model, and determining the bounding box corresponding to the irregular hexahedron of the aircraft body component grid model based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinate includes:
[0015] Determine the topological structure information including each vertex corresponding to the irregular hexahedron of the aircraft body component grid model and the centroid corresponding to each plane; the topological structure information includes the connection relationship between each vertex in each plane corresponding to the irregular hexahedron of the aircraft body component grid model; the circumferential directions corresponding to each plane are all the same;
[0016] Determine the first maximum value and the first minimum value of the coordinate information of each vertex on the x-axis in the three-dimensional coordinates, determine the second maximum value and the second minimum value of the coordinate information of each vertex on the y-axis in the three-dimensional coordinates, and determine the third maximum value and the third minimum value of the coordinate information of each vertex on the z-axis in the three-dimensional coordinates;
[0017] Based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value and the third minimum value, establish a bounding box corresponding to the irregular hexahedron of the aircraft body component grid model in the three-dimensional coordinates.
[0018] Optionally, determine whether the point to be detected in the aircraft simulation space is located inside the bounding box based on the coordinate information corresponding to the point to be detected. If it is located inside the bounding box, centralize each vertex in the plane corresponding to the plane of the irregular hexahedron of the aircraft body component grid model to obtain the corresponding deviation vectors, including:
[0019] Obtain the coordinate information corresponding to the point to be detected in the aircraft simulation space, and sequentially determine whether the coordinate information corresponding to the point to be detected is less than the first minimum value, the second minimum value and the third minimum value to obtain the corresponding first judgment result, second judgment result and third judgment result. If there is a result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first judgment result, the second judgment result and the third judgment result, set the point to be detected as being outside the bounding box and perform an elimination operation on the point to be detected;
[0020] If there is no result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first judgment result, the second judgment result and the third judgment result, sequentially determine whether the coordinate information corresponding to the point to be detected is greater than the first maximum value, the second maximum value and the third maximum value to obtain the corresponding fourth judgment result, fifth judgment result and sixth judgment result. If there is a result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth judgment result, the fifth judgment result and the sixth judgment result, set the point to be detected as being outside the bounding box and perform an elimination operation on the point to be detected;
[0021] If there is no result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth judgment result, the fifth judgment result and the sixth judgment result, set the position relationship corresponding to the point to be detected as the point to be detected being inside the bounding box;
[0022] Perform a centroid determination operation based on the coordinate information corresponding to each vertex in the plane to obtain the centroid corresponding to the plane, and determine the deviation vectors corresponding to each vertex based on the centroid and the coordinate information of each vertex in the plane.
[0023] Optionally, the method of determining the covariance matrix based on each deviation vector, the centroid, and the coordinate information of each vertex, and setting the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane includes:
[0024] Determine the covariance matrix based on each deviation vector, the centroid, the coordinate information of each vertex, and the number of vertices; the covariance matrix is used to characterize the correlation and dispersion degree among the vertices;
[0025] Determine several eigenvalues corresponding to the covariance matrix and the eigenvectors corresponding to each eigenvalue based on the covariance matrix, and set the eigenvector corresponding to the smallest eigenvalue among the eigenvalues as the normal vector corresponding to the plane.
[0026] Optionally, after determining the covariance matrix based on each deviation vector, the centroid, and the coordinate information of each vertex, and setting the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane, the method further includes:
[0027] Determine the centroid corresponding to the irregular hexahedron of the aircraft body component grid model, and determine the vector to be processed corresponding to each centroid based on each centroid and the centroid;
[0028] Perform a dot product calculation on each vector to be processed and the normal vector to obtain a dot product calculation result, and determine whether the dot product calculation result is positive. If the dot product calculation result is positive, reverse the normal vector corresponding to the dot product calculation result to obtain a new normal vector.
[0029] Optionally, the method of determining the target fitting plane equation based on the normal vector and the corresponding centroid, and determining the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance includes:
[0030] Determine the target fitting plane equation corresponding to the plane based on the normal vector and the corresponding centroid, and then use the target fitting plane equation and based on the centroid and the normal vector to determine the constant term in the target fitting plane equation;
[0031] Determine the signed distance from the point to be detected to each of the planes based on the coordinate information corresponding to the point to be detected, the normal vector, and the constant term, so as to determine the position information corresponding to the point to be detected based on the magnitude relationship between each signed distance and the corresponding tolerance parameter; the position information includes that the point to be detected is inside the irregular hexahedron of the grid model of the aircraft body component, the point to be detected is on the surface of the irregular hexahedron of the grid model of the aircraft body component, and the point to be detected is outside the irregular hexahedron of the grid model of the aircraft body component.
[0032] Optionally, determining the position information corresponding to the point to be detected based on the magnitude relationship between each signed distance and the corresponding tolerance parameter includes:
[0033] Determine the characteristic dimension corresponding to the irregular hexahedron of the grid model of the aircraft body component based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value, and the third minimum value, and then determine the tolerance parameter based on the characteristic dimension;
[0034] Judge whether there is a negative signed distance less than the tolerance parameter among each of the signed distances. If there is a negative signed distance less than the tolerance parameter among each of the signed distances, determine the point to be detected corresponding to the negative signed distance less than the tolerance parameter as being outside the irregular hexahedron of the grid model of the aircraft body component;
[0035] Judge whether each of the signed distances is a positive value. If each of the signed distances is a positive value, then judge whether each of the signed distances is greater than the tolerance parameter. If each of the signed distances is greater than the tolerance parameter, determine the point to be detected corresponding to the signed distance as being inside the irregular hexahedron of the grid model of the aircraft body component;
[0036] Judge whether the absolute value corresponding to each of the signed distances is not greater than the tolerance parameter. If the absolute value corresponding to each of the signed distances is not greater than the tolerance parameter, determine the point to be detected corresponding to the signed distance as being on the surface of the irregular hexahedron of the grid model of the aircraft body component.
[0037] In a second aspect, the present application provides a device for determining the positional relationship between a point and an irregular hexahedron unit, including:
[0038] The bounding box determination module is configured to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component grid model, and determine the bounding box corresponding to the irregular hexahedron of the aircraft body component grid model based on the minimum and maximum values in each direction of the three-dimensional coordinates of the coordinate information of each vertex;
[0039] The deviation vector determination module is configured to determine whether the point to be detected in the aircraft simulation space is located inside the bounding box based on the coordinate information corresponding to the point to be detected. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component grid model is used to centralize each vertex in the plane, and the corresponding deviation vectors are obtained;
[0040] The normal vector determination module is configured to determine the covariance matrix based on each deviation vector, the centroid, and the coordinate information of each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane;
[0041] The position information determination module is configured to determine the target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance.
[0042] In a third aspect, the present application provides an electronic device, including:
[0043] A memory for storing a computer program;
[0044] A processor for executing the computer program to implement the foregoing method for determining the position relationship between a point and an irregular hexahedron unit.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the foregoing method for determining the position relationship between a point and an irregular hexahedron unit.
[0046] As can be seen from the above, before determining the positional relationship between a point and an irregular hexahedron unit in this application, it is necessary to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component grid model, and determine the bounding box corresponding to the irregular hexahedron based on the minimum and maximum values of each vertex in each direction in the three-dimensional coordinates; determine whether the point to be detected is located inside the bounding box based on the coordinate information corresponding to the point to be detected. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively; a covariance matrix is determined based on each deviation vector, the centroid, and the coordinate information of each vertex, and the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix is set as the normal vector of the plane; a target fitting plane equation is determined based on the normal vector and the corresponding centroid, and the signed distance from the point to be detected to each plane is determined based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance and the preset internal conditions.
[0047] As can be seen, this application first needs to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component grid model, and determine the bounding box corresponding to the irregular hexahedron based on the minimum and maximum values of each vertex in each direction in the three-dimensional coordinates; subsequently, determine whether the point to be detected is located inside the bounding box based on the coordinate information corresponding to the point to be detected. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively; then, a covariance matrix is determined based on each deviation vector, the centroid, and the coordinate information of each vertex, and the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix is set as the normal vector of the plane; finally, a target fitting plane equation is determined based on the normal vector and the corresponding centroid, and the signed distance from the point to be detected to each plane is determined based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance and the preset internal conditions. In this way, the efficiency of determining the positional relationship between a point and an irregular hexahedron unit is improved, thereby enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative efforts.
[0049] Figure 1 It is a flowchart of a method for determining the positional relationship between a point and an irregular hexahedron unit disclosed in this application;
[0050] Figure 2 Schematic diagram of a specific non-regular hexahedron topological structure disclosed in this application;
[0051] Figure 3 Schematic diagram of the construction of a specific axial bounding box disclosed in this application;
[0052] Figure 4 Schematic diagram of a specific rapid culling process disclosed in this application;
[0053] Figure 5 Schematic diagram of a specific algorithm verification case disclosed in this application;
[0054] Figure 6 Schematic diagram of the overall flow of a specific algorithm disclosed in this application;
[0055] Figure 7 Schematic diagram of the structure of a device for determining the positional relationship between a point and a non-regular hexahedron unit disclosed in this application;
[0056] Figure 8 Schematic diagram of the structure of an electronic device disclosed in this application. Detailed implementation manners
[0057] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0058] In three-dimensional space, determining the positional relationship between a point and a polyhedron is a basic problem in the field of computational geometry and is widely used in engineering and scientific calculations such as computer graphics, computer-aided design, finite element analysis, and physical collision detection. However, the existing technologies have problems such as complex calculations, insufficient accuracy, and poor robustness when dealing with non-regular hexahedrons, and it is difficult to meet the actual requirements. Therefore, this application provides a method for determining the positional relationship between a point and a non-regular hexahedron unit, which can improve the determination efficiency of the positional relationship between a point and a non-regular hexahedron unit during the determination process.
[0059] See Figure 1 As shown, the embodiments of the present invention disclose a method for determining the positional relationship between a point and a non-regular hexahedron unit, including:
[0060] Step S11: Determine the topological structure information including the coordinate information of each vertex corresponding to the non-regular hexahedron of the aircraft body component grid model, and determine the bounding box corresponding to the non-regular hexahedron of the aircraft body component grid model based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinate system.
[0061] In a specific embodiment, in the process of determining the positional relationship between the non-regular hexahedron obtained after simulating the body components on the aircraft and the point to be detected, the embodiment of the present application needs to obtain the topological structure information corresponding to the above non-regular hexahedron. Among them, the body components on the aircraft include but are not limited to the wings, engines and fuselage of the aircraft. The topological structure information includes the 8 vertex coordinates of the hexahedron and the node connection relationships of each face. In addition, the six faces of the hexahedron are respectively defined as sets including 4 vertices, and the schematic diagram of the topological structure of the non-regular hexahedron is as Figure 2 shown. In a specific embodiment, the bottom surface is composed of vertices constituting a counterclockwise arrangement. The top surface is composed of vertices forming a counterclockwise arrangement. The four side surfaces are respectively composed of vertices , , , forming, and each face maintains a consistent surrounding direction. At the same time, obtain the coordinates corresponding to the point to be detected.
[0062] Furthermore, after obtaining the topological structure information corresponding to the non-regular hexahedron, the embodiment of the present application needs to construct an axial bounding box (AABB, Axis-Aligned Bounding Box) of the hexahedron based on the topological structure information, and the schematic diagram is as Figure 3As shown. Specifically, determining the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft airframe component grid model, and determining the bounding box corresponding to the irregular hexahedron based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinates may include: determining the centroid corresponding to each plane of the topological structure information including each vertex corresponding to the irregular hexahedron of the aircraft airframe component grid model; the topological structure information includes the connection relationship between each vertex in each plane corresponding to the irregular hexahedron; the surrounding directions corresponding to each plane are all the same; determining the first maximum value and the first minimum value of the coordinate information of each vertex on the x-axis in the three-dimensional coordinates, and determining the second maximum value and the second minimum value of the coordinate information of each vertex on the y-axis in the three-dimensional coordinates, and determining the third maximum value and the third minimum value of the coordinate information of each vertex on the z-axis in the three-dimensional coordinates; establishing a bounding box corresponding to the irregular hexahedron in the three-dimensional coordinates based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value and the third minimum value.
[0063] In a specific implementation manner, the process of constructing the axial bounding box of the hexahedron based on the topological structure information is as follows: traverse the 8 vertices of the hexahedron, and calculate the minimum and maximum values of each vertex in the three directions of X, Y, and Z respectively, so as to obtain the boundary range of the bounding box , where the determination formula for determining the boundary range of the bounding box is as follows:
[0064] ;
[0065] ;
[0066] ;
[0067] Then the expression of the boundary range of the constructed axial bounding box is as follows:
[0068] ;
[0069] where, is the boundary range of the axial bounding box of the hexahedron.
[0070] Step S12, judging whether the to-be-detected point is located inside the bounding box based on the coordinate information corresponding to the to-be-detected point in the aircraft simulation space. If it is located inside the bounding box, then centralize each vertex in the plane corresponding to the irregular hexahedron of the aircraft airframe component grid model by using the centroid corresponding to the plane, and obtain the corresponding deviation vectors.
[0071] In this embodiment, after obtaining the axial bounding box corresponding to the non-regular hexahedron of the aircraft body component mesh model and the coordinate information corresponding to the point to be detected, the embodiments of the present application need to remove the points to be detected located outside the non-regular hexahedron, and the schematic diagram is as shown in Figure 4 wherein, both p1 and p2 are points to be detected. That is, the embodiments of the present application can quickly remove the points obviously outside the hexahedron by checking whether the point to be detected is inside the bounding box, thereby effectively reducing unnecessary complex calculations. Specifically, determining whether the point to be detected is inside the bounding box based on the coordinate information corresponding to the point to be detected may include: obtaining the coordinate information corresponding to the point to be detected in the aircraft simulation space, and sequentially determining whether the coordinate information corresponding to the point to be detected is less than the first minimum value, the second minimum value, and the third minimum value, to obtain the corresponding first judgment result, second judgment result, and third judgment result. If there is a result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first judgment result, the second judgment result, and the third judgment result, the point to be detected is set to be outside the bounding box, and an operation of removing the point to be detected is performed.
[0072] In a specific implementation manner, for the point to be detected , if or or or or or , it can be determined that the point to be detected is outside the bounding box and the judgment is terminated. If the target point is inside the bounding box, that is, it satisfies and and and and and , then the subsequent steps can be entered.
[0073] In addition, if the point to be detected in the aircraft simulation space is inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron is used to centralize each vertex in the plane, and the corresponding deviation vectors can be obtained, including: if there is no result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first judgment result, the second judgment result, and the third judgment result, then it is successively determined whether the coordinate information corresponding to the point to be detected is greater than the first maximum value, the second maximum value, and the third maximum value, and the corresponding fourth judgment result, fifth judgment result, and sixth judgment result are obtained. If there is a result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth judgment result, the fifth judgment result, and the sixth judgment result, the point to be detected is set to be outside the bounding box, and the point to be detected is removed; if there is no result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth judgment result, the fifth judgment result, and the sixth judgment result, the position relationship corresponding to the point to be detected is set to the point to be detected is inside the bounding box; the centroid determination operation is performed based on the coordinate information corresponding to each vertex in the plane to obtain the centroid corresponding to the plane, and the deviation vectors corresponding to each vertex are determined based on the centroid and the coordinate information corresponding to each vertex in the plane.
[0074] Step S13: Determine the covariance matrix based on each of the deviation vectors, the centroid, and the coordinate information of each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane.
[0075] In this embodiment, after obtaining the deviation vectors, the embodiments of the present application need to construct a covariance matrix based on each deviation vector, the centroid, and the coordinate information of each vertex . Among them, the expression of the covariance matrix M of each vertex in the X, Y, and Z directions is as follows:
[0076] ;
[0077] Among them, is the centralization vector of the th vertex, that is, the deviation of the th vertex relative to the centroid. is the number of points, , , , is the centroid of the plane.
[0078] It is worth noting that the elements in the covariance matrix reflect the correlation and dispersion degree between different dimensions of the point set. In addition, since the plane is a two-dimensional geometric object, which is a flat surface, that is, the point set has a large dispersion in the plane direction and a small dispersion in the direction perpendicular to the plane. Therefore, in the process of plane fitting in the embodiments of the present application, the direction with the smallest variance in the data dispersion is set as the direction of the plane normal vector, that is, the eigenvector corresponding to the smallest eigenvalue of the covariance matrix is set as the direction of the plane normal vector, that is, the normal vector of the fitted plane is obtained as .
[0079] Specifically, determining the covariance matrix based on the coordinate information of each deviation vector, centroid and each vertex, and setting the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane may include: determining the covariance matrix based on the coordinate information of each deviation vector, centroid, each vertex and the number of vertices; the covariance matrix is used to characterize the correlation and dispersion degree between each vertex; determining several eigenvalues corresponding to the covariance matrix and the eigenvectors corresponding to each eigenvalue respectively based on the covariance matrix, and setting the eigenvector corresponding to the smallest eigenvalue among each eigenvalue as the normal vector corresponding to the plane.
[0080] Further, the embodiments of the present application can verify the direction of the obtained normal vector according to the relative positions of the hexahedron center and the center of each face of the non-regular hexahedron of the aircraft body component grid model, so as to ensure that the normal vector points to the outside of the hexahedron. Specifically, after determining the covariance matrix based on the coordinate information of each deviation vector, centroid and each vertex, and setting the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane, it may further include: determining the centroid corresponding to the non-regular hexahedron, and determining the vector to be processed corresponding to each centroid based on each centroid and the centroid; calculating the dot product of each vector to be processed and the normal vector to obtain the dot product calculation result, and judging whether the dot product calculation result is a positive value. If the dot product calculation result is a positive value, then reversing the normal vector corresponding to the dot product calculation result to obtain a new normal vector.
[0081] In a specific implementation manner, the process of adjusting the normal vector is as follows: First, calculate the geometric center of the hexahedron , and the calculation formula is as follows:
[0082] ;
[0083] Subsequently, calculate the centroid corresponding to this face , and the calculation formula is as follows:
[0084] ;
[0085] Furthermore, calculate the centroid of the surface The vector pointing to the center of the hexahedron is , and the calculation formula is as follows:
[0086] ;
[0087] Then, calculate the dot product formula of the normal vector and the vector as follows:
[0088] ;
[0089] Among them, is the dot product operation result of the normal vector and the vector , is the normal vector of the fitting plane . In addition, if the obtained dot product is positive, it means that the normal vector points to the inside of the hexahedron, and then the direction of the above normal vector is reversed to ensure that the normal vector points to the outside of the hexahedron, as shown in Figure 5 (a) and Figure 5 (b), where p1, p2, and p3 are all points to be detected, the pentagrams and dotted lines in the figure are the normal vectors corresponding to p1, p2, and p3, and the pentagrams are the vector directions corresponding to each normal vector. It is worth mentioning that the formula for reversing the direction of the normal vector is as follows:
[0090] .
[0091] Step S14: Determine the target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance.
[0092] In this embodiment, it is necessary to sequentially construct the fitting plane equation of each surface of the irregular hexahedron of the aircraft body component grid model, and the expression is as follows:
[0093] ;
[0094] Among them, is the plane normal vector, is the offset of the plane from the origin, and the value of determines the position of the plane in space.
[0095] Subsequently, eliminate in the above formula through the centering operation. First, calculate the average coordinates of all vertices of the plane to be fitted, that is, the centroid of the plane , and the formula for determining the centroid is as follows:
[0096] ;
[0097] Furthermore, centralize all the vertices in the plane to obtain the deviation of each point relative to the centroid of the point set , and the formula for determining the deviation is as follows:
[0098] ;
[0099] And satisfies the following formula:
[0100] ;
[0101] Then the above fitting plane equation can be rewritten as:
[0102] ;
[0103] Where are the four vertices of the plane to be fitted. The above formula can make the plane pass through the centroid and eliminate the parameter in the plane equation, thereby transforming the plane problem into a problem that only considers the plane normal vector and improving the stability of the algorithm by reducing the complexity of numerical calculations.
[0104] Finally, the embodiments of the present application need to solve the final fitting plane equation. That is, by finding the plane normal vector to calculate the parameter in the plane equation. Since the plane always passes through the average value of the input points, the following formula can be obtained:
[0105] ;
[0106] Finally, the obtained plane fitting equation is as follows:
[0107] ;
[0108] It is worth mentioning that after completing the fitting operation on the six faces of the non-regular hexahedron of the aircraft body component mesh model, the embodiment of the present application needs to calculate the signed distance from the point to be detected to each fitting plane. Specifically, based on the normal vector and the corresponding centroid, the target fitting plane equation is determined, and based on the target fitting plane equation, the signed distance from the point to be detected to each plane is determined, so as to determine the position information corresponding to the point to be detected based on each signed distance, which may include: determining the target fitting plane equation corresponding to the plane based on the normal vector and the corresponding centroid, and then using the target fitting plane equation and based on the centroid and the normal vector to determine the constant term in the target fitting plane equation; determining the signed distance from the point to be detected to each plane based on the coordinate information, normal vector and constant term corresponding to the point to be detected, so as to determine the position information corresponding to the point to be detected based on the magnitude relationship between each signed distance and the corresponding tolerance parameter; the position information includes that the point to be detected is inside the non-regular hexahedron, the point to be detected is on the surface of the non-regular hexahedron, and the point to be detected is outside the non-regular hexahedron.
[0109] In a specific embodiment, for each fitting plane, the embodiment of the present application needs to calculate the point The expression of the signed distance is as follows:
[0110] ;
[0111] where is the determination result of the signed distance between the point and the fitting plane, is the corrected normal vector, is the coordinate of the point to be detected, is the constant term of the fitting plane equation.
[0112] It is worth mentioning that the embodiment of the present application needs to dynamically calculate the tolerance parameter TOLERANCE based on the characteristic size of the hexahedron to handle the numerical calculation error and the judgment error caused by the vertices being approximately coplanar using the tolerance parameter. That is, the tolerance parameter is used to judge whether a point is on a surface, and the tolerance parameter is used for boundary condition processing, so as to ensure the robustness of the method and be able to adapt to hexahedron models of different scales. It is worth mentioning that the calculation formula of the tolerance parameter TOLERANCE is as follows:
[0113] ;
[0114] ;
[0115] where , , , , and is the boundary range of the bounding box, is the length corresponding to the longest side in the bounding box.
[0116] In this embodiment, after obtaining the signed distance and the tolerance parameter, the embodiment of the present application needs to comprehensively judge the position relationship between the point to be detected in the aircraft simulation space and the hexahedron based on the signed distance to determine whether the point is located inside, outside, or on the surface of the hexahedron, and the specific process is as Figure 6 shown. Specifically, determining the position information corresponding to the point to be detected based on the magnitude relationship between each signed distance and the corresponding tolerance parameter may include: determining the characteristic dimension corresponding to the irregular hexahedron based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value, and the third minimum value, and then determining the tolerance parameter based on the characteristic dimension; judging whether there is a signed distance that is a negative number less than the tolerance parameter among the signed distances. If there is a signed distance that is a negative number less than the tolerance parameter among the signed distances, the point to be detected corresponding to the signed distance that is a negative number less than the tolerance parameter is determined to be located outside the irregular hexahedron; judging whether all the signed distances are positive values. If all the signed distances are positive values, then judging whether all the signed distances are greater than the tolerance parameter. If all the signed distances are greater than the tolerance parameter, the point to be detected corresponding to the signed distance is determined to be located inside the irregular hexahedron; judging whether the absolute value corresponding to each signed distance is not greater than the tolerance parameter. If the absolute value corresponding to each signed distance is not greater than the tolerance parameter, the point to be detected corresponding to the signed distance is determined to be located on the surface of the irregular hexahedron.
[0117] In a specific implementation manner, if the signed distance from a point to any plane is a negative value, that is, it satisfies , then the point is located outside the hexahedron; if the signed distances from the point to all planes are positive values, and the absolute values of all distances are greater than the preset tolerance, that is, it satisfies , then the point is located inside the hexahedron; if the signed distance from the point to any plane is within the preset tolerance range, that is, it satisfies , then the point is located on the surface of the hexahedron.
[0118] As can be seen from the above, before determining the positional relationship between a point and an irregular hexahedron unit in the embodiments of the present application, it is first necessary to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the grid model of the aircraft body component, and determine the bounding box corresponding to the irregular hexahedron based on the minimum and maximum values of each vertex in each direction in the three-dimensional coordinates; subsequently, based on the coordinate information corresponding to the point to be detected, it is judged whether the point to be detected is located inside the bounding box. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component grid model is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively; then, based on each deviation vector, the coordinate information of the centroid and each vertex, a covariance matrix is determined, and the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix is set as the normal vector of the plane; finally, based on the normal vector and the corresponding centroid, the target fitting plane equation is determined, and the signed distance from the point to be detected to each plane is determined based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance and the preset internal conditions. In this way, the efficiency of determining the positional relationship between a point and an irregular hexahedron unit is improved.
[0119] Correspondingly, as shown in Figure 7 the present application also provides a device for determining the positional relationship between a point and an irregular hexahedron unit, including:
[0120] A bounding box determination module 11, configured to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the grid model of the aircraft body component, and determine the bounding box corresponding to the irregular hexahedron of the grid model of the aircraft body component based on the minimum and maximum values of each vertex in each direction in the three-dimensional coordinates;
[0121] A deviation vector determination module 12, configured to judge whether the point to be detected is located inside the bounding box based on the coordinate information corresponding to the point to be detected in the aircraft simulation space. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component grid model is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively;
[0122] A normal vector determination module 13, configured to determine a covariance matrix based on each deviation vector, the centroid and the coordinate information of each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane;
[0123] A position information determination module 14, configured to determine a target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each of the planes based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each of the signed distances.
[0124] As can be seen from the above, before determining the position relationship between a point and an irregular hexahedron unit in the embodiment of the present application, it is first necessary to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component mesh model, and determine the bounding box corresponding to the irregular hexahedron based on the minimum and maximum values of each vertex in each direction in the three-dimensional coordinates; subsequently, based on the coordinate information corresponding to the point to be detected, it is determined whether the point to be detected is inside the bounding box. If it is inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively; then, a covariance matrix is determined based on each deviation vector, the centroid, and the coordinate information of each vertex, and the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix is set as the normal vector of the plane; finally, a target fitting plane equation is determined based on the normal vector and the corresponding centroid, and the signed distance from the point to be detected to each plane is determined based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance and a preset internal condition. In this way, the efficiency of determining the position relationship between a point and an irregular hexahedron unit is improved.
[0125] In some specific embodiments, the bounding box determination module 11 may specifically include:
[0126] A centroid determination unit, configured to determine the topological structure information including each vertex corresponding to the irregular hexahedron of the aircraft body component mesh model and the centroid corresponding to each plane; the topological structure information includes the connection relationship between each vertex in each plane corresponding to the irregular hexahedron of the aircraft body component mesh model; the surrounding directions corresponding to each plane are all the same;
[0127] A maximum and minimum value determination unit, configured to determine a first maximum value and a first minimum value of the coordinate information of each vertex on the x-axis in the three-dimensional coordinates, determine a second maximum value and a second minimum value of the coordinate information of each vertex on the y-axis in the three-dimensional coordinates, and determine a third maximum value and a third minimum value of the coordinate information of each vertex on the z-axis in the three-dimensional coordinates;
[0128] A bounding box determination subunit, configured to establish a bounding box corresponding to the irregular hexahedron of the aircraft body component grid model in the three-dimensional coordinates based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value, and the third minimum value.
[0129] In some specific embodiments, the deviation vector determination module 12 may specifically include:
[0130] A first point to be detected elimination unit, configured to obtain the coordinate information corresponding to a point to be detected in the aircraft simulation space, and sequentially determine whether the coordinate information corresponding to the point to be detected is less than the first minimum value, the second minimum value, and the third minimum value, to obtain corresponding first, second, and third determination results. If there is a result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first, second, and third determination results, the point to be detected is set to be located outside the bounding box, and an elimination operation is performed on the point to be detected;
[0131] A second point to be detected elimination unit, configured to, if there is no result indicating that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value among the first, second, and third determination results, sequentially determine whether the coordinate information corresponding to the point to be detected is greater than the first maximum value, the second maximum value, and the third maximum value, to obtain corresponding fourth, fifth, and sixth determination results. If there is a result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth, fifth, and sixth determination results, the point to be detected is set to be located outside the bounding box, and an elimination operation is performed on the point to be detected;
[0132] A position relationship determination unit of the point to be detected, configured to, if there is no result indicating that the coordinate information corresponding to the point to be detected is greater than the corresponding maximum value among the fourth, fifth, and sixth determination results, set the position relationship corresponding to the point to be detected as the point to be detected is located inside the bounding box;
[0133] A deviation vector determination subunit, configured to perform a centroid determination operation based on the coordinate information corresponding to each vertex in the plane to obtain a centroid corresponding to the plane, and determine deviation vectors corresponding to each vertex based on the centroid and the coordinate information corresponding to each vertex in the plane.
[0134] In some specific embodiments, the normal vector determination module 13 may specifically include:
[0135] A covariance matrix determination unit, configured to determine a covariance matrix based on each of the deviation vectors, the centroid, the coordinate information of each vertex, and the number of vertices; the covariance matrix is used to characterize the correlation and dispersion degree among the vertices;
[0136] A first normal vector determination subunit, configured to determine a plurality of eigenvalues corresponding to the covariance matrix and eigenvectors corresponding to each of the eigenvalues based on the covariance matrix, and set the eigenvector corresponding to the eigenvalue with the smallest value among the eigenvalues as the normal vector corresponding to the plane.
[0137] In some specific embodiments, the point and non-regular hexahedron unit position relationship determination device may further include:
[0138] A centroid determination unit, configured to determine the centroid corresponding to the non-regular hexahedron of the aircraft body component grid model, and determine a to-be-processed vector corresponding to each centroid based on each centroid and the centroid.
[0139] A second normal vector determination subunit, configured to calculate the dot product of each to-be-processed vector and the normal vector to obtain a dot product calculation result, and determine whether the dot product calculation result is positive. If the dot product calculation result is positive, reverse the normal vector corresponding to the dot product calculation result to obtain a new normal vector.
[0140] In some specific embodiments, the position information determination module 14 may specifically include:
[0141] A constant term determination unit, configured to determine a target fitting plane equation corresponding to the plane based on the normal vector and the corresponding centroid, and then use the target fitting plane equation and determine the constant term in the target fitting plane equation based on the centroid and the normal vector.
[0142] A position information determination unit, configured to determine the signed distance from the to-be-detected point to each plane based on the coordinate information corresponding to the to-be-detected point, the normal vector, and the constant term, so as to determine the position information corresponding to the to-be-detected point based on the magnitude relationship between each signed distance and the corresponding tolerance parameter; the position information includes that the to-be-detected point is located inside the non-regular hexahedron of the aircraft body component grid model, the to-be-detected point is located on the surface of the non-regular hexahedron of the aircraft body component grid model, and the to-be-detected point is located outside the non-regular hexahedron of the aircraft body component grid model.
[0143] In some specific embodiments, the position information determination module 14 may specifically include:
[0144] A tolerance parameter determination unit is configured to determine a characteristic dimension corresponding to the irregular hexahedron of the aircraft airframe component grid model based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value, and the third minimum value, and then determine a tolerance parameter based on the characteristic dimension;
[0145] A first signed distance judgment unit is configured to judge whether there is a signed distance that is a negative number less than the tolerance parameter among the signed distances. If there is a signed distance that is a negative number less than the tolerance parameter among the signed distances, the detection point corresponding to the signed distance that is a negative number less than the tolerance parameter is determined to be located outside the irregular hexahedron of the aircraft airframe component grid model;
[0146] A second signed distance judgment unit is configured to judge whether all the signed distances are positive values. If all the signed distances are positive values, it is judged whether all the signed distances are greater than the tolerance parameter. If all the signed distances are greater than the tolerance parameter, the detection point corresponding to the signed distance is determined to be located inside the irregular hexahedron of the aircraft airframe component grid model;
[0147] A third signed distance judgment unit is configured to judge whether the absolute values corresponding to all the signed distances are not greater than the tolerance parameter. If the absolute values corresponding to all the signed distances are not greater than the tolerance parameter, the detection point corresponding to the signed distance is determined to be located on the surface of the irregular hexahedron of the aircraft airframe component grid model.
[0148] Furthermore, an embodiment of the present application also discloses an electronic device. Figure 8 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure cannot be considered as any limitation on the scope of use of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the method for determining the position relationship between a point and an irregular hexahedron unit disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0149] In this embodiment, the power supply 23 is used to provide operating voltages for the various hardware devices on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations thereof are not provided herein; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type thereof can be selected according to specific application requirements, and specific limitations are not provided herein.
[0150] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be transient storage or permanent storage.
[0151] Among them, the operating system 221 is used to manage and control the various hardware devices and the computer program 222 on the electronic device 20, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of implementing the method for determining the position relationship between points and non-regular hexahedron units executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks.
[0152] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the method for determining the position relationship between points and non-regular hexahedron units disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated herein.
[0153] In this specification, the various embodiments are described in a progressive manner, and the key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0154] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner 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 implementation should not be considered to exceed the scope of this application.
[0155] The steps of the methods or algorithms described in combination with the embodiments disclosed in this document can be implemented directly by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0156] Finally, it should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0157] The above has introduced the technical solutions provided by this application in detail. Specific examples are used in this document to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A method for determining the positional relationship between a point and an irregular hexahedron unit, characterized in that, Including: Determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft airframe component grid model, and determine the bounding box corresponding to the irregular hexahedron of the aircraft airframe component grid model based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinates; the aircraft airframe component grid model is a grid model obtained by performing structured grid division on the three-dimensional model of the target airframe component of the aircraft; Based on the coordinate information corresponding to the point to be detected in the aircraft simulation space, determine whether the point to be detected is located inside the bounding box. If it is located inside the bounding box, use the centroid corresponding to the plane on the irregular hexahedron of the aircraft airframe component grid model to centralize each vertex in the plane, and obtain the corresponding deviation vectors; Determine the covariance matrix based on each deviation vector, the centroid, and the coordinate information of each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane; specifically: determine the covariance matrix based on each deviation vector, the centroid, the coordinate information of each vertex, and the number of vertices; determine several eigenvalues corresponding to the covariance matrix and the eigenvectors corresponding to each eigenvalue, and set the eigenvector corresponding to the smallest eigenvalue among each eigenvalue as the normal vector corresponding to the plane; the covariance matrix is used to characterize the correlation and dispersion degree among each vertex; Determine the target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each signed distance.
2. The method for determining the positional relationship between a point and a non-regular hexahedron unit according to claim 1, wherein The determination of the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft airframe component grid model, and the determination of the bounding box corresponding to the irregular hexahedron of the aircraft airframe component grid model based on the minimum and maximum values of the coordinate information of each vertex in each direction in the three-dimensional coordinates includes: Determine the topological structure information including each vertex corresponding to the irregular hexahedron of the aircraft airframe component grid model and the centroid corresponding to each plane; the topological structure information includes the connection relationship among each vertex in each plane corresponding to the irregular hexahedron of the aircraft airframe component grid model; the surrounding directions corresponding to each plane are all the same; Determine the first maximum value and the first minimum value of the coordinate information of each vertex on the x-axis in the three-dimensional coordinates, determine the second maximum value and the second minimum value of the coordinate information of each vertex on the y-axis in the three-dimensional coordinates, and determine the third maximum value and the third minimum value of the coordinate information of each vertex on the z-axis in the three-dimensional coordinates; A bounding box corresponding to the irregular hexahedron of the aircraft body component mesh model is established in the three-dimensional coordinates based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value and the third minimum value.
3. The method for determining the positional relationship between a point and a non-regular hexahedron unit according to claim 2, wherein The method of determining whether the point to be detected is located inside the bounding box based on the coordinate information corresponding to the point to be detected in the aircraft simulation space, and if the point to be detected is located inside the bounding box, centralizing each of the vertices in the plane using the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component mesh model to obtain the corresponding deviation vectors, includes: Obtaining coordinate information corresponding to a point to be detected in an aircraft simulation space, and determining in turn whether the coordinate information corresponding to the point to be detected is less than the first minimum value, the second minimum value, and the third minimum value, to obtain corresponding first, second, and third judgment results; if any of the first, second, and third judgment results indicates that the coordinate information corresponding to the point to be detected is less than the corresponding minimum value, setting the point to be detected as being located outside the bounding box, and performing a removal operation on the point to be detected; If there is no result among the first judgment result, the second judgment result and the third judgment result that indicates that the coordinate information corresponding to the to-be-detected point is less than the corresponding minimum value, then judge in turn whether the coordinate information corresponding to the to-be-detected point is greater than the first maximum value, the second maximum value and the third maximum value, and obtain the corresponding fourth judgment result, fifth judgment result and sixth judgment result; if there is a result among the fourth judgment result, the fifth judgment result and the sixth judgment result that indicates that the coordinate information corresponding to the to-be-detected point is greater than the corresponding maximum value, then set the to-be-detected point to be located outside the bounding box, and perform a removal operation on the to-be-detected point; If there is no result among the fourth judgment result, the fifth judgment result and the sixth judgment result that indicates that the coordinate information corresponding to the to-be-detected point is greater than the corresponding maximum value, the position relationship corresponding to the to-be-detected point is set as that the to-be-detected point is located inside the bounding box; A centroid determination operation is performed based on the coordinate information corresponding to each vertex in the plane to obtain the centroid corresponding to the plane, and a deviation vector corresponding to each vertex is determined based on the coordinate information corresponding to the centroid and each vertex in the plane.
4. The method for determining the positional relationship between a point and a non-regular hexahedron unit according to any one of claims 1 to 3, characterized in that, After determining the covariance matrix based on the coordinate information of each of the deviation vectors, the centroid and each of the vertices, and setting the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane, the method further includes: Determine a centroid corresponding to the irregular hexahedron of the aircraft body component grid model, and determine a vector to be processed corresponding to each centroid based on each centroid and the centroid; Calculate the dot product of each of the vectors to be processed and the normal vector to obtain the dot product calculation result, and determine whether the dot product calculation result is positive. If the dot product calculation result is positive, reverse the normal vector corresponding to the dot product calculation result to obtain a new normal vector.
5. The method for determining the positional relationship between a point and a non-regular hexahedron unit according to claim 2, wherein Determining the target fitting plane equation based on the normal vector and the corresponding centroid, and determining the signed distance from the point to be detected to each of the planes based on the target fitting plane equation, so as to determine the position information corresponding to the point to be detected based on each of the signed distances, includes: Determine the target fitting plane equation corresponding to the plane based on the normal vector and the corresponding centroid, and then use the target fitting plane equation and based on the centroid and the normal vector to determine the constant term in the target fitting plane equation; Determine the signed distance from the point to be detected to each of the planes based on the coordinate information corresponding to the point to be detected, the normal vector, and the constant term, so as to determine the position information corresponding to the point to be detected based on the magnitude relationship between each of the signed distances and the corresponding tolerance parameter; the position information includes that the point to be detected is inside the irregular hexahedron of the aircraft body component grid model, the point to be detected is on the surface of the irregular hexahedron of the aircraft body component grid model, and the point to be detected is outside the irregular hexahedron of the aircraft body component grid model.
6. The method for determining the positional relationship between a point and a non-regular hexahedron unit according to claim 5, wherein Determining the position information corresponding to the point to be detected based on the magnitude relationship between each of the signed distances and the corresponding tolerance parameter, includes: Determine the characteristic dimension corresponding to the irregular hexahedron of the aircraft body component grid model based on the first maximum value, the first minimum value, the second maximum value, the second minimum value, the third maximum value, and the third minimum value, and then determine the tolerance parameter based on the characteristic dimension; Determine whether there is a signed distance that is a negative number less than the tolerance parameter among each of the signed distances. If there is a signed distance that is a negative number less than the tolerance parameter among each of the signed distances, determine the point to be detected corresponding to the signed distance that is a negative number less than the tolerance parameter as being outside the irregular hexahedron of the aircraft body component grid model; Determine whether each of the signed distances is positive. If each of the signed distances is positive, determine whether each of the signed distances is greater than the tolerance parameter. If each of the signed distances is greater than the tolerance parameter, determine the point to be detected corresponding to the signed distance as being inside the irregular hexahedron of the aircraft body component grid model; Determine whether the absolute value corresponding to each of the signed distances is not greater than the tolerance parameter. If the absolute value corresponding to each of the signed distances is not greater than the tolerance parameter, determine the point to be detected corresponding to the signed distance as being on the surface of the irregular hexahedron of the aircraft body component grid model.
7. A determination device for the positional relationship between a point and an irregular hexahedron unit, characterized in that Includes: The bounding box determination module is used to determine the topological structure information including the coordinate information of each vertex corresponding to the irregular hexahedron of the aircraft body component mesh model, and determine the bounding box corresponding to the irregular hexahedron of the aircraft body component mesh model based on the minimum and maximum values in each direction of the three-dimensional coordinates of the coordinate information of each vertex; The deviation vector determination module is used to judge whether the point to be detected in the aircraft simulation space is located inside the bounding box based on the coordinate information corresponding to the point to be detected. If it is located inside the bounding box, the centroid corresponding to the plane on the irregular hexahedron of the aircraft body component mesh model is used to centralize each vertex in the plane to obtain the corresponding deviation vectors respectively; The normal vector determination module is used to determine the covariance matrix based on each deviation vector, the coordinate information of the centroid and each vertex, and set the eigenvector corresponding to the smallest eigenvalue among several eigenvalues in the covariance matrix as the normal vector of the plane; specifically: determine the covariance matrix based on each deviation vector, the centroid, the coordinate information of each vertex and the number of vertices; determine several eigenvalues corresponding to the covariance matrix and the eigenvectors corresponding to each eigenvalue respectively, and set the eigenvector corresponding to the smallest eigenvalue among each eigenvalue as the normal vector corresponding to the plane; the covariance matrix is used to characterize the correlation and dispersion degree among each vertex; The position information determination module is used to determine the target fitting plane equation based on the normal vector and the corresponding centroid, and determine the signed distance from the point to be detected to each plane based on the target fitting plane equation, so as to judge the position information corresponding to the point to be detected based on each signed distance.
8. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for executing the computer program to implement the method for determining the position relationship between a point and an irregular hexahedron unit according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, For storing a computer program, wherein the computer program, when executed by the processor, implements the method for determining the position relationship between a point and an irregular hexahedron unit according to any one of claims 1 to 6.
Citation Information
Patent Citations
Tunnel direct current resistivity inversion grid optimization method based on double-orientation indication combination
CN115292878A
Rapid ray tracing method based on structure electromagnetic model equivalence and related equipment
CN117974888A