Object model construction method, performance testing method and related devices
By classifying and filtering feature lines in geometric files based on angle thresholds, the method enhances object model precision, addressing the issue of redundant lines and improving grid reconstruction quality for applications like finite element analysis and computational fluid dynamics.
Patent Information
- Application Number
- CN202510559058.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-30
AI Technical Summary
In the prior art, when building an object model based on geometric files, the model accuracy is poor due to redundant feature lines, which cannot meet the precise calculation requirements of engineering applications.
By identifying the normal vectors, boundary lines and grid vertices of the grid, classifying and removing redundant feature lines, filtering targets and candidate feature lines using set angle thresholds, and finally building an object model.
It improves the accuracy of object models and improves the calculation accuracy of engineering applications such as finite element analysis and computational fluid dynamics.
Smart Images

Figure CN120088430B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of modeling technology, and in particular to an object model building method, a performance testing method and related devices. Background Art
[0002] In actual engineering applications, the method of constructing object models based on meshes stored in geometry files has been widely used. For example, in engineering applications such as finite element analysis and computational fluid dynamics, accurate feature lines can better characterize the model boundary and ensure accurate calculation of the flow field in the boundary area. However, the meshes stored in the geometry file are not ideal meshes. Extracting feature lines based only on the dihedral angle method may have a lot of redundancy. If they are not preprocessed, the generated object model will have poor accuracy. Therefore, it is necessary to provide a method that can build a more accurate object model based on geometry files. Summary of the invention
[0003] Based on this, the present invention provides an object model construction method, a performance testing method and related devices to solve the defect in the prior art that the constructed object model has poor accuracy due to redundant feature lines in the geometric file.
[0004] To achieve the above object, an embodiment of the present invention provides an object model construction method, comprising:
[0005] Read the mesh data of the geometry file and identify the normal vectors, boundary lines and mesh vertices of all meshes;
[0006] Classifying the boundary lines, taking the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold and the boundary lines existing only in one of the grids as target feature lines, and taking the common boundary lines of adjacent grids that are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold, the minimum value of the set angle range is equal to the second set angle threshold, and the first set angle threshold is greater than the second set angle threshold;
[0007] Eliminating the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a standby feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines;
[0008] An object model is constructed according to the target feature line and the feature line to be used.
[0009] To achieve the above object, an embodiment of the present invention further provides a performance testing method, comprising:
[0010] Acquire target grid data, wherein the target grid data is grid data of a geometry file of an object to be analyzed;
[0011] Processing the target grid data using the object model construction method described in any of the above embodiments to obtain an object model of the object to be analyzed;
[0012] A performance testing operation associated with the object to be analyzed is performed based on the object model of the object to be analyzed.
[0013] To achieve the above object, an embodiment of the present invention further provides an object model construction device, comprising:
[0014] The information acquisition module is used to read the mesh data of the geometry file and identify the normal vectors, boundary lines and mesh vertices of all meshes;
[0015] a boundary line classification module, configured to classify the boundary lines, and to classify the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold value, and the boundary lines existing only in one of the grids as target feature lines, and to classify the common boundary lines of adjacent grids which are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold value, the minimum value of the set angle range is equal to the second set angle threshold value, and the first set angle threshold value is greater than the second set angle threshold value;
[0016] A feature line screening module is used to eliminate the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a stand-by feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines;
[0017] The model building module is used to build an object model according to the target feature line and the feature line to be used.
[0018] To achieve the above object, an embodiment of the present invention further provides a performance testing device, comprising:
[0019] A data acquisition module, used to acquire target grid data, wherein the target grid data is grid data of a geometry file of an object to be analyzed;
[0020] An object model building module, configured to process the target grid data using the object model building method described in any of the above embodiments to obtain an object model of the object to be analyzed;
[0021] A performance testing module, configured to perform performance testing operations associated with the object to be analyzed based on the object model of the object to be analyzed.
[0022] To achieve the above object, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the object model construction method described in any of the above embodiments or the performance testing method described in the above embodiments is implemented.
[0023] To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. When the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the object model construction method described in any of the above embodiments or the performance testing method described in the above embodiments.
[0024] To achieve the above object, an embodiment of the present invention further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the object model construction method described in any of the above embodiments or the performance testing method described in the above embodiments is implemented.
[0025] Compared with the prior art, the object model construction method, performance testing method, and related devices disclosed in the embodiments of the present invention first identify the normal vectors, boundary lines, and grid vertices of all grids by reading the grid data of the geometric file; then, by classifying the boundary lines, the common boundary lines of adjacent grids with a normal vector angle greater than the first set angle threshold and the boundary lines that exist in only one grid are used as target feature lines; if the common boundary line of adjacent grids is not marked as the target feature line, and the normal vector angle of the adjacent grids is greater than the first set angle threshold and less than the second set angle threshold, then this common boundary line is used as a candidate feature line for further analysis of the candidate feature line in the future; then, by performing elimination processing on the candidate feature lines, so that in each grid vertex with at least two candidate feature lines, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set angle threshold, effectively eliminating redundant feature lines; finally, by constructing an object model based on the target feature lines and the candidate feature lines obtained after the elimination processing, the accuracy of the constructed object model is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] To more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0027] Figure 1 is a schematic flowchart of a method for constructing an object model provided by an embodiment of the present invention;
[0028] Figure 2 is a schematic diagram of a simplified model of an automobile in STL format provided by an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of an automobile model provided by an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of an automobile model provided by an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of an automobile model provided by an embodiment of the present invention;
[0032] Figure 6 is a schematic structural diagram of an object model construction device provided by an embodiment of the present invention;
[0033] Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Specific embodiments
[0034] 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 some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0035] See Figure 1 , Figure 1 is a schematic flowchart of a method for constructing an object model provided by an embodiment of the present invention. Specifically, the method for constructing an object model includes steps S11 to S14:
[0036] S11. Read the mesh data of the geometric file and identify the normal vectors, boundary lines, and mesh vertices of all meshes.
[0037] It is worth noting that the geometry file stores data such as the mesh normal vector, boundary line and mesh vertex. Taking the geometry data as a standard tessellation language file as an example, the Standard Tessellation Language (STL) file format is a relatively common format for triangular meshes. This format is a standard file format developed by 3D Systems. STL files usually consist of a series of triangular facets to approximate the surface of an object. It is one of the common representation methods of the surface mesh of a three-dimensional geometric model. The processing and extraction of STL files are of great significance in the fields of computer-aided design, computer graphics and engineering analysis. There are two main forms of STL files: ASCII format and binary format. In these two formats, the surface geometry of the object is stored in triangles as the basic unit. Each triangle is described by its vertex coordinates and normal vector. Extracting the feature lines of the STL file based only on the dihedral angle method has more redundancy or the feature line angle is too small. If no processing is involved, the quality of the generated mesh is poor, which makes it difficult for the calculation to converge or even diverge, resulting in poor accuracy of the constructed model. Please refer to Figure 2 The simplified model diagram of a car in STL format is shown. Exemplarily, in step S11, the mesh data in the STL file is first read to identify the normal vectors, boundary lines and mesh vertices of all meshes.
[0038] S12. Classify the boundary lines, and take the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold and the boundary lines that only exist in one of the grids as target feature lines, and take the common boundary lines of adjacent grids that are not marked as target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold, the minimum value of the set angle range is equal to the second set angle threshold, and the first set angle threshold is greater than the second set angle threshold.
[0039] Specifically, in step S12, the boundary line is preliminarily screened, specifically in the following manner: if the boundary line is only a boundary line of a grid, the boundary line is considered to be a target feature line. If the boundary line is a common boundary line of two adjacent grids, the normal vector angle of the adjacent grids is determined according to the normal vectors of the adjacent grids. If the normal vector angle is greater than a first set angle threshold, the common boundary line is considered to be a target feature line. This method of determining the target feature line is relatively simple to calculate and has a high computational efficiency. The car model constructed only based on the target feature line can be seen in Figure 3As shown; if the included angle between the normal vectors is less than or equal to the first set included angle threshold and greater than or equal to the second set included angle threshold, then this common boundary line is used as a candidate feature line for further analysis of this common boundary line in the subsequent process. Optionally, the first set included angle threshold can be 87°, 89°, 90°, etc., and the second set included angle threshold can be 29°, 30°, 31°, etc. The first set included angle threshold and the second set included angle threshold are not limited to the above specific values and can be set according to the actual situation and are not limited herein.
[0040] S13. Perform a removal process on the candidate feature lines, such that for each candidate feature line in the same target grid vertex, the included angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set included angle threshold, to obtain the feature lines for use; wherein, the target grid vertex refers to a grid vertex having at least two candidate feature lines.
[0041] Specifically, in step S13, further screening of the boundary lines is performed, and the specific method is: determine the included angle between each pair of candidate feature lines on the same grid vertex, and perform a removal process on the candidate feature lines according to the included angle between each pair of candidate feature lines, such that in the same grid vertex, if this grid vertex has multiple candidate feature lines, then the included angle between each candidate feature line and at least one other candidate feature line should be greater than or equal to the third set included angle threshold.
[0042] S14. Construct an object model based on the target feature lines and the feature lines for use.
[0043] It can be understood that the target feature lines and the candidate feature lines (i.e., the feature lines for use) obtained after the removal process can significantly reflect the shape and structure of the object, usually representing the parts where the shape of the geometric body changes most violently, or the boundaries where the included angle between adjacent surfaces is relatively large, and can include sharp edges, ridge lines, contour lines, etc. of the object. These lines play a key structural support role in the object model and are an important manifestation of the model features. In step S14, an accurate object model can be constructed using the target feature lines and the feature lines for use. For example, an accurate three-dimensional map, a three-dimensional car model, etc. object models can be constructed using the above method, improving the quality of grid reconstruction and being beneficial to subsequent engineering applications such as finite element analysis or computational fluid dynamics analysis. For the car model constructed using the method described in the embodiments of the present invention, reference can be made to Figure 4 As shown.
[0044] Compared with the prior art, in the embodiments of the present invention, the final feature lines are extracted by analyzing the included angle between adjacent surfaces, verifying the included angle of the feature lines of the grid vertices, etc., improving the efficiency and accuracy of feature line extraction, ensuring the generation quality of the object model as much as possible, and improving the accuracy of grid reconstruction.
[0045] In a preferred embodiment, based on steps S11 to S14, the process of eliminating the candidate feature lines so that, at the same target grid vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold to obtain the feature lines for use includes:
[0046] Calculate the angles between all pairs of candidate feature lines on the same grid vertex;
[0047] Eliminate the first feature line from the candidate feature lines to obtain the feature lines for use; wherein, the angle between the first feature line and any other candidate feature line at its grid vertex is less than the third set angle threshold; the third set angle threshold is greater than the second set angle threshold and less than the first set angle threshold.
[0048] Specifically, analyze the candidate feature lines. If there are only two candidate feature lines at a grid vertex and the angle between them is less than the third set angle threshold, then both of these candidate feature lines are marked for deletion. For grid vertices with multiple candidate feature lines, calculate the angle between each pair of candidate feature lines, find the maximum angle between each candidate feature line and other candidate feature lines. If the angle between a certain candidate feature line and other candidate feature lines is less than the third set angle threshold, then delete this candidate feature line and retain the candidate feature line with a larger angle, thereby retaining the edges with significant geometric features.
[0049] Optionally, the third set angle threshold can be 60°, 61°, 62°, etc. The third set angle threshold is not limited to the above specific values and can be set according to the actual situation, which is not limited here.
[0050] In a preferred embodiment, based on steps S11 to S14, the process of constructing an object model according to the target feature lines and the feature lines for use includes:
[0051] Identify the two endpoints of each feature line for use;
[0052] Eliminate the isolated feature lines and simple feature connections from the feature lines for use to obtain the second feature lines; wherein, the number of edges connected to any endpoint of the isolated feature line is 1, and the simple feature connection has a "V" - shaped structure, and the sum of the number of edges connected to the endpoints of any candidate feature line forming the simple feature connection is 3;
[0053] Construct an object model according to the target feature lines and the second feature lines.
[0054] Specifically, "isolated" or simple connected standby feature lines are deleted, and the specific method is as follows: for each standby feature line, first check the number of adjacent feature lines at its two end points. If both endpoints (starting point and ending point) of a standby feature line are isolated points (that is, the number of adjacent feature lines is 1), then the standby feature line is considered to be an isolated feature line; if the standby feature lines form a specific "V"-shaped structure and for any standby feature line that forms a "V"-shaped structure, the sum of the number of adjacent feature lines of the endpoints of the standby feature line is 3, then the "V"-shaped structure is considered to be a simple feature line. Finally, the isolated feature lines and simple feature lines are eliminated. The car model constructed using this implementation can be seen in Figure 5 As shown, Figure 5 is Figure 4 Isolated feature lines and simple feature lines are eliminated based on the proposed method.
[0055] In a preferred embodiment, based on steps S11 to S14, the step of reading the mesh data of the geometry file and identifying the normal vectors, boundary lines and mesh vertices of all meshes includes:
[0056] Reading the geometry file line by line, when encountering a preset start mark, constructing a new set of mesh data groups, and continuing to read the geometry file, recording the face mark, normal vector and vertex coordinates of the read mesh in the mesh data group until encountering a preset end mark;
[0057] Each of the grid data groups is traversed, all boundary lines of each grid are identified, and the boundary lines of the grid are represented in the form of vertex coordinate pairs, each boundary line is associated with the face identifier of the grid where it is located, and an adjacency list is constructed.
[0058] Specifically, first, read the mesh data (such as triangular mesh data) from the geometric file. Taking the STL file as an example, first, read the STL file line by line, extract the keywords of each line to judge the current content. When encountering the start identifier of the face identifier, record the face identifier; then, identify the normal vector of the triangular mesh, and extract the vertex coordinates when reading the vertex information; when encountering the end identifier, it indicates the end of a mesh, and record the triangle number of the mesh. Through this process, gradually construct the names, normal vectors, vertex coordinates, triangle numbers, etc. of each mesh. Second, in the process of extracting and de-duplicating the boundary lines of the triangular mesh, first initialize a set to store unique edges, then identify the three edges (i.e., the three boundary lines) of each triangular mesh, and represent the edges as vertex coordinate pairs in a specific order (such as lexicographical order). Then, insert the extracted edges into the set, and use the characteristics of the set to automatically remove duplicates. After traversing the triangular mesh, the set will only contain unique edges, and finally convert it into the required format for subsequent processing. Third, in the process of obtaining the triangle numbers on both sides of each edge, first traverse the set, associate each edge with the index (i.e., the triangle number) of the adjacent triangles, construct an adjacency list, and this adjacency list records the triangle numbers corresponding to each edge, so as to establish the association between the edge and the triangles on the left and right sides.
[0059] Further, the classification of the boundary lines, taking the common boundary lines of adjacent meshes with the normal vector angle greater than the first set angle threshold and the boundary lines existing only in one of the meshes as the target feature lines, and taking the common boundary lines of adjacent meshes that are not marked as the target feature lines and the normal vector angle is within the set angle range as the candidate feature lines, includes:
[0060] Traverse the adjacency list to determine the number of meshes where each boundary line is located;
[0061] When the number of meshes where the first boundary line is located is 1, take the first boundary line as the target feature line; where the first boundary line is any one of all the boundary lines;
[0062] When the number of meshes where the first boundary line is located is 2, determine the normal vector angle according to the normal vectors of the two meshes where the first boundary line is located, take the first boundary line with the normal vector angle greater than the first set angle threshold as the target feature line, and take the first boundary line that is not marked as the target feature line and the normal vector angle is within the set angle range as the candidate feature line.
[0063] Specifically, the classification process of boundary lines is as follows: 1. Traverse the adjacency list and check the number of triangles corresponding to the edge. If it contains only one triangle, record the edge in the feature line list featureLines (for example, add the index of the edge to featureLines). Then, if an edge contains two triangles, compare the face identifiers of the two triangles. If they are different, the edge is also recorded in featureLines. 2. For edges with 2 corresponding triangles, classify the edges as target feature lines, candidate feature lines, or non-feature lines by calculating the cosine value of the angle between the normal vectors of the triangles on both sides of each edge. First, traverse all edges, skip the edges marked as target feature lines in featureLines, and then determine the type of edge by calculating the normal vector angle between adjacent triangles (that is, adjacent meshes). If the angle between adjacent triangles is greater than the first set angle threshold (such as 89°), the edge is marked as a feature line; if the angle between adjacent triangles is greater than or equal to the second set angle threshold (generally the default is 31°) and less than or equal to the first set angle threshold, the index of the edge is added to the candidate feature line list candidateFeatureLines, and the index of the edge is deleted from featureLines; if the angle between adjacent triangles is less than the second set angle threshold, the edge is regarded as a non-feature line and the index of the edge is deleted from featureLines.
[0064] Further, the candidate feature lines are eliminated so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, to obtain the feature lines to be used, including:
[0065] Determine the angles between all the candidate feature lines located on the same mesh vertex;
[0066] When there are only two candidate feature lines on the first mesh vertex and the angle between the two candidate feature lines on the first mesh vertex is less than a third set angle threshold, the two candidate feature lines of the first mesh vertex are eliminated; wherein the first mesh vertex is any one of all the mesh vertices;
[0067] When the number of the candidate feature lines on the first mesh vertex is greater than 2, and the angles between a first candidate feature line on the first mesh vertex and other candidate feature lines on the first mesh vertex are all less than a third set angle threshold, the first candidate feature line is eliminated; wherein the first candidate feature line is any one of all the candidate feature lines on the first mesh vertex;
[0068] The candidate feature lines that have been eliminated are used as standby feature lines.
[0069] Specifically, an adjacency relationship with candidate feature lines is established for each grid vertex. The specific process is as follows: 1. First, traverse all candidate feature lines. For each candidate feature line, extract two endpoints (i.e., the starting point and the ending point. Generally, the endpoints are grid vertices), and associate the feature line with these two endpoints. After the traversal is completed, the adjacency relationship will include the set of adjacent candidate feature lines for each endpoint, thus establishing the association relationship between the endpoints and the candidate feature lines. 2. By calculating the angle between each pair of candidate feature lines, delete the candidate feature lines with too small an angle with other candidate feature lines. First, traverse the set of adjacent candidate feature lines for each endpoint. If a certain endpoint has only two candidate feature lines and the angle between them is less than the third set angle threshold (such as 60°), then these two candidate feature lines are marked for deletion. For an endpoint with multiple candidate feature lines, calculate the angle between each pair of candidate feature lines, and find the maximum and minimum angle values of each candidate feature line with other candidate feature lines. If the maximum angle of a certain candidate feature line with other candidate feature lines is less than the third set angle threshold, then delete this candidate feature line. Further, among the remaining candidate feature lines, delete the isolated feature lines and simple feature connections, and add the finally remaining candidate feature lines (i.e., the feature lines to be used) to featureLines, thus retaining the edges with significant geometric features. Finally, the edges recorded in featureLines can be used to construct the object model.
[0070] Compared with the prior art, the method provided by the embodiment of the present invention, first, identifies the normal vectors, boundary lines, and grid vertices of all grids by reading the grid data of the geometric file; then, by classifying the boundary lines, the common boundary lines of adjacent grids with a normal vector angle greater than the first set angle threshold, and the boundary lines existing in only one grid are used as target feature lines; if the common boundary line of adjacent grids is not marked as the target feature line, and the normal vector angle of the adjacent grids is greater than the first set angle threshold and less than the second set angle threshold, then this common boundary line is used as a candidate feature line for further analysis of the candidate feature line; then, by performing a rejection process on the candidate feature line, so that for each grid vertex with at least two candidate feature lines, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set angle threshold, effectively eliminating redundant feature lines; finally, by constructing an object model according to the target feature line and the candidate feature line obtained after the rejection process, the accuracy of the constructed object model is improved.
[0071] An embodiment of the present invention also provides a performance testing method, including:
[0072] Obtain target grid data, where the target grid data is the grid data of the geometric file of the object to be analyzed;
[0073] Process the target mesh data by using the object model construction method described in any of the above embodiments to obtain the object model of the object to be analyzed;
[0074] Perform a performance test operation associated with the object to be analyzed based on the object model of the object to be analyzed.
[0075] Exemplarily, the objects to be analyzed cover various items in various application fields, such as vehicles, airplanes, engines, ships, etc. The performance test operation can be either a limit performance test for the structural characteristics of the object to be analyzed, or a sloshing characteristic test for a ship, or a flow-around phenomenon test for an elastic wing, etc.
[0076] Compared with the prior art, the method provided by the embodiment of the present invention, first, identifies the normal vectors, boundary lines, and mesh vertices of all meshes by reading the mesh data of the geometric file of the object to be analyzed; then, by classifying the boundary lines, the common boundary lines of adjacent meshes with the included angle of the normal vectors greater than the first set included angle threshold, and the boundary lines existing only in one mesh are used as target feature lines; if the common boundary line of adjacent meshes is not marked as the target feature line, and the included angle of the normal vectors of the adjacent meshes is greater than the first set included angle threshold and less than the second set included angle threshold, then this common boundary line is used as a candidate feature line for further analysis of the candidate feature line in the future; then, by performing a rejection process on the candidate feature lines, so that in each mesh vertex with at least two candidate feature lines, the included angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set included angle threshold, effectively removing redundant feature lines; finally, by constructing an object model according to the target feature lines and the candidate feature lines obtained after the rejection process, the accuracy of the constructed object model is improved; performing a performance test operation associated with the object to be analyzed based on the constructed object model improves the accuracy of the performance test.
[0077] See Figure 6 , the embodiment of the present invention also provides an object model construction device, including:
[0078] An information acquisition module 21, configured to read the mesh data of the geometric file and identify the normal vectors, boundary lines, and mesh vertices of all meshes;
[0079] The boundary line classification module 22 is used to classify the boundary lines, and take the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold value, and the boundary lines existing only in one of the grids as target feature lines, and take the common boundary lines of adjacent grids that are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold value, the minimum value of the set angle range is equal to the second set angle threshold value, and the first set angle threshold value is greater than the second set angle threshold value;
[0080] The feature line screening module 23 is used to eliminate the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a standby feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines;
[0081] The model building module 24 is used to build an object model according to the target feature line and the feature line to be used.
[0082] It is worth noting that the working principle of the object model building device provided in the above embodiments can refer to the working process of the object model building method provided in any of the above embodiments, which will not be described in detail here.
[0083] Compared with the prior art, the object model construction device provided by the embodiment of the present invention first identifies the normal vectors, boundary lines and mesh vertices of all meshes by reading the mesh data of the geometry file; then, by classifying the boundary lines, the common boundary lines of adjacent meshes whose normal vector angles are greater than a first set angle threshold, and the boundary lines that only exist in one mesh are taken as target feature lines; if the common boundary lines of adjacent meshes are not marked as the target feature lines, and the normal vector angles of the adjacent meshes are greater than the first set angle threshold and less than the second set angle threshold, the common boundary lines are taken as candidate feature lines, so as to further analyze the candidate feature lines later; then, the candidate feature lines are eliminated so that in each mesh vertex having at least two candidate feature lines, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set angle threshold, thereby effectively eliminating redundant feature lines; finally, the object model is constructed according to the target feature lines and the candidate feature lines obtained after the elimination process, thereby improving the accuracy of the constructed object model.
[0084] The embodiment of the present invention further provides a performance testing device, including:
[0085] A data acquisition module, used to acquire target grid data, wherein the target grid data is grid data of a geometry file of an object to be analyzed;
[0086] An object model construction module, configured to process the target mesh data by using the object model construction method described in any of the above embodiments to obtain an object model of the object to be analyzed;
[0087] A performance test module, configured to perform a performance test operation associated with the object to be analyzed based on the object model of the object to be analyzed.
[0088] Compared with the prior art, the device provided by the embodiments of the present invention, firstly, identifies the normal vectors, boundary lines and mesh vertices of all meshes by reading the mesh data of the geometric file of the object to be analyzed; then, by classifying the boundary lines, the common boundary lines of adjacent meshes with the included angle between normal vectors greater than the first set included angle threshold, and the boundary lines existing in only one mesh are used as target feature lines; if the common boundary line of adjacent meshes is not marked as the target feature line, and the included angle between the normal vectors of the adjacent meshes is greater than the first set included angle threshold and less than the second set included angle threshold, then this common boundary line is used as a candidate feature line for further analysis of the candidate feature line in the subsequent step; then, by performing a rejection process on the candidate feature lines, so that in each mesh vertex having at least two candidate feature lines, the included angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set included angle threshold, effectively removing redundant feature lines; finally, by constructing an object model according to the target feature lines and the candidate feature lines obtained after the rejection process, the accuracy of the constructed object model is improved; and a performance test operation associated with the object to be analyzed is performed based on the constructed object model, improving the accuracy of the performance test.
[0089] See Figure 7 , the embodiments of the present invention further provide an electronic device, including a processor 31, a memory 32, and a computer program stored in the memory 32 and configured to be executed by the processor 31. When the processor 31 executes the computer program, the steps in the embodiments of the above object model construction method or the steps in the embodiments of the performance test method are implemented, such as Figure 1 S11~S14 in ; alternatively, when the processor 31 executes the computer program, the functions of each module in the above device embodiments are implemented.
[0090] Exemplarily, the computer program can be divided into one or more modules. The one or more modules are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device. For example, the computer program can be divided into multiple modules, and the specific functions of each module are as follows:
[0091] Information acquisition module 21, for reading the mesh data of the geometry file, identifying all mesh normal vectors, boundary lines and mesh vertices;
[0092] The boundary line classification module 22 is used to classify the boundary lines, and take the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold value, and the boundary lines existing only in one of the grids as target feature lines, and take the common boundary lines of adjacent grids that are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold value, the minimum value of the set angle range is equal to the second set angle threshold value, and the first set angle threshold value is greater than the second set angle threshold value;
[0093] The feature line screening module 23 is used to eliminate the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a standby feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines;
[0094] The model building module 24 is used to build an object model according to the target feature line and the feature line to be used.
[0095] The specific working process of each module can refer to the working process of the object model building device described in the above embodiment, which will not be repeated here.
[0096] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The electronic device may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will appreciate that the electronic device may also include an input / output device, a network access device, a bus, etc.
[0097] The processor 31 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The processor 31 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits.
[0098] The memory 32 can be used to store the computer programs and / or modules. The processor 31 realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory 32, and by calling the data stored in the memory 32. The memory 32 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory 32 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a Flash Card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0099] Among them, if the modules integrated in the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-described embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 31, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0100] An embodiment of the present invention further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the object model construction method or performance testing method described in any of the above embodiments is implemented.
[0101] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for constructing an object model, characterized in that, include: Reading mesh data of a geometry file, identifying normal vectors, boundary lines and mesh vertices of all meshes; the format of the geometry file is an STL file format; Classifying the boundary lines, taking the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold and the boundary lines existing only in one of the grids as target feature lines, and taking the common boundary lines of adjacent grids that are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold, the minimum value of the set angle range is equal to the second set angle threshold, and the first set angle threshold is greater than the second set angle threshold; Eliminating the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a standby feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines; constructing an object model according to the target feature line and the feature line to be used; The candidate feature lines are eliminated so that, in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, to obtain the feature lines to be used, including: Calculate the angles between all the candidate feature lines on the same mesh vertex; The first feature line is eliminated from the candidate feature lines to obtain a stand-by feature line; wherein the angle between the first feature line and any other candidate feature line of the mesh vertex where it is located is smaller than a third set angle threshold; the third set angle threshold is larger than the second set angle threshold and smaller than the first set angle threshold.
2. The object model construction method according to claim 1, characterized in that, The step of constructing an object model according to the target feature line and the to-be-used feature line comprises: Identifying two endpoints of each of the feature lines to be used; Eliminate isolated feature lines and simple feature lines from the standby feature lines to obtain a second feature line; wherein the number of edges connected to any endpoint of the isolated feature line is 1, the simple feature line is in a "V" shape, and the sum of the number of edges connected to the endpoints of any candidate feature line constituting the simple feature line is 3; An object model is constructed according to the target feature line and the second feature line.
3. The method for constructing an object model according to claim 1, wherein The step of reading mesh data of a geometry file and identifying normal vectors, boundary lines, and mesh vertices of all meshes includes: Reading the geometry file line by line, when encountering a preset start mark, constructing a new set of mesh data groups, and continuing to read the geometry file, recording the face mark, normal vector and vertex coordinates of the read mesh in the mesh data group until encountering a preset end mark; Each of the grid data groups is traversed, all boundary lines of each grid are identified, and the boundary lines of the grid are represented in the form of vertex coordinate pairs, each boundary line is associated with the face identifier of the grid where it is located, and an adjacency list is constructed.
4. The object model construction method according to claim 3, characterized in that Classifying the boundary lines, taking the common boundary lines of adjacent meshes with the included angle of the normal vectors greater than the first set angle threshold and the boundary lines existing in only one of the meshes as target feature lines, and taking the common boundary lines of adjacent meshes that are not marked as the target feature lines and whose normal vector included angle is within the set angle range as candidate feature lines, includes: Traversing the adjacency list to determine the number of meshes where each boundary line is located; When the number of meshes where the first boundary line is located is 1, taking the first boundary line as the target feature line; where the first boundary line is any one of all the boundary lines; When the number of meshes where the first boundary line is located is 2, determining the included angle of the normal vectors according to the normal vectors of the two meshes where the first boundary line is located, taking the first boundary line with the included angle of the normal vectors greater than the first set angle threshold as the target feature line, and taking the first boundary line that is not marked as the target feature line and whose normal vector included angle is within the set angle range as the candidate feature line.
5. The object model construction method according to claim 4, characterized in that, Performing elimination processing on the candidate feature lines so that, at the same target mesh vertex, the included angle between each candidate feature line and at least one other candidate feature line is greater than or equal to the third set angle threshold, to obtain the feature lines to be used, includes: Determining the included angles between all pairs of candidate feature lines at the same mesh vertex; When there are only two candidate feature lines at the first mesh vertex and the included angle between the two candidate feature lines at the first mesh vertex is less than the third set angle threshold, eliminating the two candidate feature lines at the first mesh vertex; where the first mesh vertex is any one of all the mesh vertices; When the number of candidate feature lines at the first mesh vertex is greater than 2 and the included angle between the first candidate feature line and the other candidate feature lines at the first mesh vertex is less than the third set angle threshold, eliminating the first candidate feature line; where the first candidate feature line is any one of all the candidate feature lines at the first mesh vertex; Taking the candidate feature lines after elimination as the feature lines to be used.
6. A performance testing method, characterized in that, Includes: Obtaining target mesh data, where the target mesh data is the mesh data of the geometric file of the object to be analyzed; the format of the geometric file is the STL file format; Processing the target mesh data by using the object model construction method according to any one of claims 1 to 5 to obtain the object model of the object to be analyzed; Performing a performance test operation associated with the object to be analyzed based on the object model of the object to be analyzed.
7. An object model construction device, characterized in that, Includes: An information acquisition module, configured to read the mesh data of the geometric file and identify the normal vectors, boundary lines, and mesh vertices of all meshes; the format of the geometric file is the STL file format; a boundary line classification module, configured to classify the boundary lines, and to classify the common boundary lines of adjacent grids whose normal vector angle is greater than a first set angle threshold value, and the boundary lines existing only in one of the grids as target feature lines, and to classify the common boundary lines of adjacent grids which are not marked as the target feature lines and whose normal vector angle is within a set angle range as candidate feature lines; wherein the maximum value of the set angle range is equal to the first set angle threshold value, the minimum value of the set angle range is equal to the second set angle threshold value, and the first set angle threshold value is greater than the second set angle threshold value; A feature line screening module is used to eliminate the candidate feature lines so that in the same target mesh vertex, the angle between each candidate feature line and at least one other candidate feature line is greater than or equal to a third set angle threshold, thereby obtaining a stand-by feature line; wherein the target mesh vertex refers to a mesh vertex having at least two candidate feature lines; A model building module, used for building an object model according to the target feature line and the feature line to be used; The characteristic line screening module is specifically used for: Calculate the angles between all the candidate feature lines on the same mesh vertex; The first feature line is eliminated from the candidate feature lines to obtain a stand-by feature line; wherein the angle between the first feature line and any other candidate feature line of the mesh vertex where it is located is smaller than a third set angle threshold; the third set angle threshold is larger than the second set angle threshold and smaller than the first set angle threshold.
8. A performance testing device, characterized in that, include: A data acquisition module is used to acquire target mesh data, wherein the target mesh data is mesh data of a geometry file of an object to be analyzed; the format of the geometry file is an STL file format; An object model building module, configured to process the target grid data using the object model building method according to any one of claims 1 to 5 to obtain an object model of the object to be analyzed; The performance testing module is used to perform a performance testing operation associated with the object to be analyzed based on the object model of the object to be analyzed.
9. An electronic device, characterized in that, The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the object model building method according to any one of claims 1 to 5 or the performance testing method according to claim 6 is implemented.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the object model building method according to any one of claims 1 to 5 or the performance testing method according to claim 6.
11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the object model building method according to any one of claims 1 to 5 or the performance testing method according to claim 6 is implemented.
Citation Information
Patent Citations
Method of extracting specified surface mesh characteristic line based on stl file
CN106096620A
A method for repairing defects and holes in three-dimensional mesh model based on characteristic lines
CN109410334A