Triangular surface mesh model generation method and device, equipment, medium and product
By generating an adaptive scale field and iteratively shrinking the bounding box, the problem of adhesion between adjacent areas of components is solved, and the generation quality of the triangulated surface mesh model and the accuracy and stability of the simulation process are improved.
Patent Information
- Application Number
- CN202510931776.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-17
AI Technical Summary
Existing envelope surface generation methods easily cause component adhesion when processing adjacent areas between components, affecting the precision and accuracy of simulation analysis.
By generating an adaptive scale field, determining the adaptive size of each vertex, and iteratively shrinking the bounding box, a triangular surface mesh model is generated to prevent parts from sticking and improve the accuracy of the simulation process.
It effectively prevents parts from sticking together in the generated model, improving the generation quality of the triangular surface mesh model and the accuracy and stability of the subsequent simulation process.
Smart Images

Figure CN120807833A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of simulation analysis, and particularly relates to a triangular surface mesh model generation method, device, equipment, medium and product. BACKGROUND
[0002] With the improvement of the requirements for the safety, environmental protection and comfort of automobiles, fluid mechanics and thermodynamics problems need to be considered more comprehensively in automobile design. Whole vehicle computational fluid dynamics (CFD) is an important tool in the development process of whole vehicle aerodynamic and thermal dynamic performance.
[0003] The pre-processing process plays a crucial role as the first step of the whole vehicle CFD analysis. The pre-processing process mainly includes: efficiently cleaning the free edges, punctured surfaces, non-manifold topological structures and the like existing in the original geometric model, generating a closed, manifold, non-intersecting watertight surface mesh, which is referred to as an envelope surface operation. On the basis of generating the envelope surface, the space is discretized for the external flow field to form a flow field body mesh for high-performance solution calculation, which is referred to as a body mesh generation process. As can be seen, the efficiency and quality of the geometric cleaning directly determine the accuracy, stability and efficiency of the subsequent simulation solution calculation, so a high-performance geometric cleaning method should be able to accurately depict the features of the concerned regions (such as the front bumper grille, engine compartment, chassis and the like) according to the actual needs of the CFD simulation, and at the same time, appropriately simplify some irrelevant features (such as small slit regions) that affect the stability of the CFD simulation.
[0004] Under the complex whole vehicle geometric boundary, although the existing adaptive envelope surface method can adaptively retain the key features of the model according to the surface curvature of each component, it cannot effectively maintain the original local features when processing the adjacent regions between components (such as regions where the components are in contact or close to each other), which is prone to cause component adhesion and affect the accuracy and accuracy of the subsequent solution calculation. SUMMARY
[0005] Therefore, the present application provides a triangular surface mesh model generation method, device, equipment, medium and product to solve the problem that the existing envelope surface generation method is prone to cause component adhesion when processing the adjacent regions between components, affecting the accuracy and accuracy of the simulation analysis.
[0006] In a first aspect, the present application provides a triangular surface mesh model generation method, which comprises:
[0007] An original mesh model is obtained, and an adaptive scale field of the original mesh model is generated; wherein the original mesh model comprises a plurality of triangular facets, and the adaptive scale field comprises a first adaptive size of each vertex in the triangular facet;
[0008] clipping the first adaptive size to obtain a second adaptive size of each vertex;
[0009] searching a target mesh region between any two components in the original mesh model, the target mesh region having a distance between vertices less than a first distance threshold, and determining a third adaptive size of each vertex in the target mesh region; wherein for each vertex in the target mesh region, the third adaptive size of the vertex is less than the second adaptive size of the vertex;
[0010] constructing a bounding box enveloping the original mesh model, and iteratively shrinking the bounding box based on the second adaptive size and the third adaptive size to generate the triangular surface mesh model.
[0011] The first adaptive size of each vertex is determined based on the original mesh model, and a local feature quantitative representation of the original mesh model is obtained to obtain an adaptive scale field. Then, the adaptive scale field is clipped to obtain a second adaptive size of each vertex. For a target mesh region having a distance between vertices less than a first distance threshold, which may have a risk of adhesion, the adaptive scale field of the target mesh region is further corrected to obtain a third adaptive size of each vertex in the target mesh region, so as to prevent the components from being adhered in the generated model, improve the generation quality of the triangular surface mesh model, and improve the accuracy of the subsequent simulation process. Further, based on the second adaptive size and the third adaptive size, the bounding box enveloping the original mesh model is iteratively shrunk, so that the surface of the bounding box is constantly close to the original mesh model, and the triangular surface mesh model is generated.
[0012] In an optional embodiment, the triangular surface mesh model is generated by iteratively shrinking the bounding box based on the second adaptive size and the third adaptive size, and the method comprises:
[0013] According to the second adaptive size and the third adaptive size, a target adaptive size of each vertex in each triangular facet in the original mesh model is obtained;
[0014] triangulating the bounding box to obtain a plurality of boundary surfaces;
[0015] For each boundary surface, a first projection point of the boundary surface on the original mesh model is determined, and a local shrinkage size of the boundary surface is obtained according to the target adaptive size of each vertex in the target triangular facet where the first projection point is located;
[0016] If the minimum circumscribed sphere radius of each boundary surface is greater than the local shrinkage size of the boundary surface, and the minimum circumscribed sphere radius is not less than the circumscribed sphere radius threshold, the bounding box is shrunk to obtain a new boundary surface, and the step of determining the first projection point of each boundary surface on the original mesh model is returned until the iteration ends, and a triangular surface mesh model of the original mesh model is obtained.
[0017] The application determines the local shrinkage size based on the second adaptive size and the third adaptive size, and determines a higher-priority circumscribed sphere radius threshold, and stops the shrinkage if the minimum circumscribed sphere radius of the boundary surface is less than the circumscribed sphere radius threshold, so as to automatically smooth the slit area, effectively smooth some slit structures that have little effect on the subsequent simulation accuracy but are not conducive to the solution stability, and improve the stability of the simulation.
[0018] In an optional embodiment, the target adaptive size of each vertex in each triangular facet in the original mesh model is obtained according to the second adaptive size and the third adaptive size, including:
[0019] For each triangular facet in the original mesh model, if the triangular facet is located in the target mesh region, the third adaptive size is taken as the target adaptive size of each vertex in the triangular facet; if the triangular facet is not located in the target mesh region, the second adaptive size is taken as the target adaptive size of each vertex in the triangular facet.
[0020] The application is aimed at the case that the parts are close to each other and the adjacent areas have a greater impact on the subsequent simulation results, and based on the user-specified parts that need to be prevented from contact, the target mesh region where the parts are located is quickly searched, and a very small third adaptive size is set for each vertex in the target mesh region, so as to prevent the parts from sticking together in the generated model, thereby improving the generation quality of the triangular surface mesh model and the accuracy of the subsequent simulation process.
[0021] In an optional embodiment, the local shrinkage size of the boundary surface is obtained according to the target adaptive size of each vertex in the target triangular facet where the first projection point is located, including:
[0022] The weight of each vertex in the target triangular facet is determined;
[0023] The local shrinkage size of the boundary surface is calculated based on the weight and the target adaptive size of each vertex in the target triangular facet.
[0024] The application calculates the local shrinkage size of the boundary surface according to the weight and the target adaptive size of each vertex in the target triangular facet corresponding to the boundary surface, so as to shrink the boundary surface based on the local shrinkage size.
[0025] In an optional implementation, the boundary box is shrunk to obtain a new boundary surface, comprising:
[0026] An implicit offset surface of the original mesh model is determined; the implicit offset surface is a surface inside the original mesh model and having a distance less than a second distance threshold from the original mesh model;
[0027] Finite tetrahedrons and infinite tetrahedrons associated with each boundary surface of the boundary box are determined; the finite tetrahedrons are inside the boundary box, and the infinite tetrahedrons are outside the boundary box;
[0028] For each boundary surface, if a first intersection point between a first line connecting a circumscribed sphere center of the finite tetrahedron associated with the boundary surface and a circumscribed sphere center of the infinite tetrahedron associated with the boundary surface and the implicit offset surface is detected, the first intersection point is taken as a boundary point;
[0029] For each boundary surface, if the first intersection point between the first line and the implicit offset surface is not detected, and the finite tetrahedron associated with the boundary surface intersects the original mesh model, a second projection point of the circumscribed sphere center of the finite tetrahedron associated with the boundary surface on the original mesh model is determined, a second intersection point between a second line connecting the second projection point and the circumscribed sphere center of the finite tetrahedron associated with the boundary surface and the implicit offset surface is determined, and the second intersection point is taken as the boundary point;
[0030] The boundary box is shrunk based on the boundary points, and a new boundary surface is obtained according to the shrunk boundary box.
[0031] In the case of meeting the shrinkage condition, the implicit offset surface of the original mesh model and the finite tetrahedron and the infinite tetrahedron corresponding to each boundary surface are determined, the boundary points of the shrunk boundary box are more accurately determined based on the geometric relationship between the finite tetrahedron, the infinite tetrahedron and the implicit offset surface, so as to shrink the boundary box by using the boundary points, so that the boundary box is constantly close to the surface of the original mesh model, thereby generating a triangular surface mesh model.
[0032] In an optional implementation, the method further comprises:
[0033] A K-dimensional tree of the first component and a K-dimensional tree of the second component are respectively constructed; the K-dimensional tree comprises leaf nodes and non-leaf nodes, the leaf nodes comprise vertices of the component in the original mesh model, and the non-leaf nodes comprise a bounding box formed by the vertices in the leaf nodes contained by the non-leaf nodes;
[0034] The distance between the vertices of the first component and the second component in the original mesh model is determined based on the K-dimensional trees corresponding to the first component and the second component respectively.
[0035] The application constructs a K-dimensional tree through hierarchical bounding boxes, searches a region where vertices of two components are close to each other quickly by using the K-dimensional tree, excludes irrelevant regions, and reduces the calculation amount of accurate calculation.
[0036] In an optional implementation, the distance between vertices of the first component and the second component in the original mesh model is determined based on the K-dimensional trees corresponding to the first component and the second component, and includes:
[0037] For each vertex of the first component, the first nearest neighbor vertex of the second component is queried based on the K-dimensional tree corresponding to the second component, and a first vertex distance between the vertex and the first nearest neighbor vertex is calculated.
[0038] For each vertex of the second component, the second nearest neighbor vertex of the first component is queried based on the K-dimensional tree corresponding to the first component, and a second vertex distance between the vertex and the second nearest neighbor vertex is calculated.
[0039] The K-dimensional tree is used to quickly search the nearest neighbor vertex between two components, and then the vertex distance between the queried vertex and the nearest neighbor vertex is determined, so that unnecessary accurate calculation is avoided, and the search efficiency of the target mesh region with a risk of adhesion is improved. Through bidirectional query between two components, the region with a risk of adhesion is avoided to be missed.
[0040] In an optional implementation, the adaptive scale field of the original mesh model is generated, and includes:
[0041] The Gaussian curvature and the mean curvature of each vertex in the original mesh model are determined.
[0042] The first adaptive size of each vertex is calculated according to the Gaussian curvature and the mean curvature, and the adaptive scale field of the original mesh model is obtained.
[0043] The Gaussian curvature and the mean curvature of each vertex are calculated, the adaptive scale field for measuring the sharpness of the local surface features of the original mesh model is calculated by using the Gaussian curvature, the mean curvature and the approximate error controlled by human, and the geometric features of the original mesh model are preserved.
[0044] In an optional implementation, the first adaptive size is clamped to obtain the second adaptive size of each vertex, and includes:
[0045] The first adaptive size is corrected based on a preset size range to obtain the second adaptive size of each vertex.
[0046] The preset size range is used to correct the first adaptive size of each vertex to obtain the second adaptive size of each vertex, so that the generated mesh is prevented from being too large, and the accuracy of the triangular surface mesh model is ensured. Moreover, the generated mesh is prevented from being too small, so that the calculation amount is reduced when the triangular surface mesh model is used for analysis, and the calculation efficiency is improved.
[0047] In a second aspect, the present application provides a triangular surface mesh model generation device, which comprises:
[0048] A first processing module is configured to acquire an original mesh model and generate an adaptive size field of the original mesh model, wherein the original mesh model comprises a plurality of triangular facets, and the adaptive size field comprises a first adaptive size of each vertex in the triangular facets.
[0049] A second processing module is configured to clamp the first adaptive size to obtain a second adaptive size of each vertex.
[0050] A third processing module is configured to search a target mesh region between any two components in the original mesh model, wherein the target mesh region is a region in which the distance between vertices is less than a first distance threshold, and determine a third adaptive size of each vertex in the target mesh region, wherein the third adaptive size of each vertex in the target mesh region is less than the second adaptive size of the vertex.
[0051] A fourth processing module is configured to construct a bounding box enveloping the original mesh model, and iteratively shrink the bounding box based on the second adaptive size and the third adaptive size to generate a triangular surface mesh model.
[0052] In a third aspect, the present application provides a computer device, which comprises a memory and a processor, the memory and the processor are communicatively connected, and the memory stores computer instructions, and the processor executes the computer instructions to perform the triangular surface mesh model generation method of the first aspect or any one of the corresponding embodiments.
[0053] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the triangular surface mesh model generation method of the first aspect or any one of the corresponding embodiments.
[0054] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions, and the computer instructions are used to make a computer execute the triangular surface mesh model generation method of the first aspect or any one of the corresponding embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the specific embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0056] Figure 1 is a flowchart of a triangular surface mesh model generation method according to an embodiment of the present application;
[0057] Figure 2 is a flowchart of another triangular surface mesh model generation method according to an embodiment of the present application;
[0058] Figure 3 is a flowchart of a K-dimensional tree construction method according to an embodiment of the present application;
[0059] Figure 4 is a schematic diagram of a target mesh region according to an embodiment of the present application;
[0060] Figure 5 is a flowchart of still another triangular surface mesh model generation method according to an embodiment of the present application;
[0061] Figure 6 is a structural block diagram of a triangular surface mesh model generation device according to an embodiment of the present application;
[0062] Figure 7 is a hardware structure schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0064] According to an embodiment of the present application, a triangular surface mesh model generation method embodiment is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0065] The embodiment provides a triangular surface mesh model generation method, which can be used for a device such as a computer, a tablet computer and the like for mesh model generation, Figure 1 is a flowchart of the triangular surface mesh model generation method according to the embodiment of the application, as shown in the figure, the flowchart comprises the following steps: Figure 1
[0066] In step S101, an original mesh model is acquired, and an adaptive scale field of the original mesh model is generated; wherein the original mesh model comprises a plurality of triangular facets, and the adaptive scale field comprises a first adaptive size of each vertex in the triangular facets.
[0067] Specifically, for an input mesh model, a splitting operation is performed on a non-manifold edge in the input mesh model, the input mesh model is converted into a manifold geometry, and an original mesh model is obtained. The non-manifold edge refers to an edge shared by more than two faces, and the original mesh model is a standard triangular mesh, each edge of which is shared by at most two triangular faces. It should be noted that the input mesh model can be a whole vehicle mesh model, a mesh model of a key component of a whole vehicle, etc., and the specific selection can be made according to the actual simulation scene, and the application is not limited in this regard.
[0068] In step S101, the original mesh model comprises a plurality of triangular facets, for each triangular facet, the curvature radius of each vertex in the triangular facet is calculated, and then the first adaptive size of each vertex is obtained. The first adaptive size is used to measure the sharpness of the local surface features of the original mesh model, and the adaptive scale field of the original mesh model is obtained. The adaptive scale field represents the expected size of the local triangular facets determined by the adaptive algorithm. The sharper the feature is, the smaller the expected size of the local triangular facets is, and more triangular faces are required to represent.
[0069] In step S102, the first adaptive size is clamped to obtain a second adaptive size of each vertex.
[0070] Specifically, the user can set an expected discrete size range of each component in advance, and the first adaptive size of each vertex in the adaptive scale field is corrected based on the expected discrete size range to obtain a second adaptive size of each vertex.
[0071] In step S103, a target mesh region with a vertex separation distance less than a first distance threshold between any two components in the original mesh model is searched, and a third adaptive size of each vertex in the target mesh region is determined; wherein for each vertex in the target mesh region, the third adaptive size of the vertex is less than the second adaptive size of the vertex.
[0072] Specifically, since the original mesh model often contains hundreds of parts, which involve tens of millions of triangular facets, and the connection relationship and proximity relationship between parts are complex, the related art causes complete loss of local area features when depicting the connection relationship between parts, and causes two parts to be stuck together when depicting the proximity relationship between parts during surface geometry cleaning of the original mesh model.
[0073] In step S103, if the target mesh region in which the vertices are spaced apart by a distance less than the first distance threshold is detected, the surface parts are at risk of sticking together, and a minimum third adaptive size is set for each vertex in the target mesh region through the anti-contact operation, and the third adaptive size of the vertex is smaller than the corresponding second adaptive size. By performing the anti-contact operation on the target mesh region, the sticking together of the parts in the generated model is prevented, thereby improving the generation quality of the triangular surface mesh model and improving the accuracy of the subsequent simulation process.
[0074] In step S104, a bounding box enveloping the original mesh model is constructed, and the bounding box is iteratively shrunk based on the second adaptive size and the third adaptive size to generate the triangular surface mesh model.
[0075] Specifically, the bounding box can be a rectangular bounding box enveloping the original mesh model. According to the second adaptive size and the third adaptive size, the target adaptive size of each vertex is determined, so that the bounding box is continuously shrunk based on the target adaptive size, so that the surface of the bounding box continuously approaches the original mesh model, and the triangular surface mesh model is generated.
[0076] The triangular surface mesh model generation method provided in this embodiment first determines the first adaptive size of each vertex based on the original mesh model, obtains a local feature quantitative representation of the original mesh model, and obtains an adaptive scale field. Then, the adaptive scale field is clamped to obtain the second adaptive size of each vertex. For the target mesh region in which the vertices that are at risk of sticking together are spaced apart by a distance less than the first distance threshold, the adaptive scale field of the target mesh region is further modified to obtain the third adaptive size of each vertex in the target mesh region, so as to prevent the parts from sticking together in the generated model, thereby improving the generation quality of the triangular surface mesh model and improving the accuracy of the subsequent simulation process. Further, based on the second adaptive size and the third adaptive size, the bounding box enveloping the original mesh model is iteratively shrunk, so that the surface of the bounding box continuously approaches the original mesh model, and the triangular surface mesh model is generated.
[0077] In this embodiment, a triangular surface mesh model generation method is provided, which can be used for devices for generating mesh models, such as computers, tablet computers, etc. Figure 2 is a flowchart of the triangular surface mesh model generation method according to an embodiment of the present application, as shown in Figure 2As shown, the flow includes the following steps:
[0078] In step S201, an original mesh model is acquired, and an adaptive scale field of the original mesh model is generated; wherein the original mesh model includes a plurality of triangular facets, and the adaptive scale field includes a first adaptive size of each vertex in the triangular facets.
[0079] Specifically, the Gaussian curvature and the mean curvature of each vertex in the original mesh model are determined. Wherein the Gaussian curvature and the mean curvature can be calculated according to the following formula:
[0080]
[0081] Wherein, v i represents the i-th vertex in the triangular facet, k G (v i ) represents the Gaussian curvature of the i-th vertex in the triangular facet, θ j is the j-th neighborhood angle of the i-th vertex in the triangular facet, and A is the Voronoi area of the triangular facet, represents the number of neighborhood angles of the i-th vertex in the triangular facet, k(v i ) is the mean curvature of the i-th vertex in the triangular facet, represents the number of vertices in the triangular facet, k M (v i ) represents the principal curvature of the i-th vertex in the triangular facet.
[0082] Further, according to the Gaussian curvature and the mean curvature, the first adaptive size of each vertex is calculated to obtain the adaptive scale field of the original mesh model. Wherein the first adaptive size of each vertex can be calculated according to the following formula:
[0083]
[0084] Wherein, L(v i ) represents the first adaptive size of the i-th vertex in the triangular facet, r i represents the curvature radius of the i-th vertex in the triangular facet, and ε is an artificial approximation error (generally 1 / 1000 of the length of the input bounding box).
[0085] The embodiments of the present application calculate the Gaussian curvature and the mean curvature of each vertex, use the Gaussian curvature, the mean curvature and the artificial approximation error to calculate the adaptive scale field for measuring the sharp degree of the local surface features of the original mesh model, and retain the geometric features of the original mesh model.
[0086] In step S202, the first adaptive size is clamped to obtain the second adaptive size of each vertex.
[0087] Specifically, the first adaptive size is modified based on a preset size range to obtain a second adaptive size for each vertex. The preset size range refers to the user-specified expected discrete size range of the component to which the triangle patch belongs. This preset size range is used to clamp the size of the patches near the component in the resulting watertight triangulated surface mesh. The preset size range can be different for different components.
[0088] In some embodiments, based on a preset size range of a component specified in advance by the user [T min , T max ], the first adaptive size L(v i ) to obtain the second adaptive size of each vertex. The correction formula can be as follows:
[0089]
[0090] Among them, L(v i )′ represents the second adaptive size of the i-th vertex in the triangle patch, T min Indicates the minimum value of the preset size range, T max Indicates the maximum value of the preset size range, L(v) min Indicates the minimum value of the first adaptive size of all vertices on the component, L(v) max Indicates the maximum value of the first adaptive size of all vertices on this component.
[0091] The present embodiment uses a preset size range to modify the first adaptive size of each vertex to obtain a second adaptive size for each vertex, thereby preventing the generated mesh from being too large and ensuring the accuracy of the triangular surface mesh model. It also prevents the generated mesh from being too small, thereby reducing the amount of computation required when performing analysis using the triangular surface mesh model, thereby improving computational efficiency.
[0092] Step S203: Search for a target mesh area in which the distance between vertices of any two components in the original mesh model is less than a first distance threshold, and determine a third adaptive size of each vertex in the target mesh area; wherein, for each vertex in the target mesh area, the third adaptive size of the vertex is less than the second adaptive size of the vertex.
[0093] In some optional implementations, the steps of determining the distance between vertices are as follows:
[0094] Step a1, constructing a K-dimensional tree of the first component and the second component respectively; wherein the K-dimensional tree includes leaf nodes and non-leaf nodes, the leaf nodes include the vertices of the components in the original mesh model, and the non-leaf nodes include the bounding boxes formed by the vertices in the leaf nodes contained in the non-leaf nodes.
[0095] Specifically, components that need to be prevented from contact can be determined in advance, two components in a group, for each component in the group, an Axis-Aligned Bounding Box (AABB) tree of the complete component is generated using all the triangular facets of the component. Then all the vertex data of each component is extracted to build a corresponding K-Dimensional (KD) tree for the component.
[0096] In some embodiments, the data structure of the KD tree node is defined first: the KD tree includes leaf nodes and non-leaf nodes, wherein the non-leaf nodes can include other non-leaf nodes or leaf nodes, and each layer of non-leaf nodes contains a bounding box (i.e. an AABB tree), a split axis, a split position, a left child node pointer, and a right child node pointer. That is, each non-leaf node contains two paths, each path is connected to a non-leaf node or a leaf node of the next layer, and the bottom leaf node stores a list of vertices of the triangular facets that make up the component.
[0097] For example, the KD tree of the first component is taken as an example, the first component includes a plurality of triangular facets, each triangular facet includes a plurality of vertices, the bottom of the KD tree of the first component includes a plurality of leaf nodes, a leaf node X stores all the vertices contained in a triangular facet, and the parent node of the leaf node X is a non-leaf node Y which stores a bounding box formed by all the vertices contained in the leaf node X.
[0098] As shown in Figure 3 The construction of the KD tree starts from the root node, calculates a global bounding box by traversing all the vertices of the component, and stores all the triangular facets of the component in the root node. Then, the recursive splitting phase is entered, and a candidate splitting scheme is generated for each of the x, y, and z dimensions. When splitting in a certain dimension, the median method that ensures tree balance or the approximate median method that appropriately sacrifices balance to improve efficiency is used to select the split point, which can be a median vertex located at the middle position of the current bounding box or an approximate median vertex located at the approximate middle position of the current bounding box. The current bounding box is split using the split point. For example, the quickselect algorithm can be used to determine the median vertex for splitting the current bounding box, thereby determining the split point. The split point is a vertex in the triangular facets of the component.
[0099] It should be noted that the current bounding box refers to the bounding box that needs to be split in the current recursive process. The current bounding box in the first recursion is the global bounding box corresponding to the root node, and the current bounding box in the second recursion is the bounding box corresponding to the left and right child nodes of the root node.
[0100] In this embodiment, again refer to Figure 3For example, in the x-dimension, if the target vertex is the median vertex or the approximate median vertex, and the target vertex is the root node, the pivot corresponding to the x-coordinate of the target vertex is the split axis. The vertices with x-coordinates less than the split axis are placed on the left side of the split axis, and the vertices with x-coordinates greater than the split axis are placed on the right side of the split axis. Then, all the vertices on the left side of the split axis form a bounding box, which is the left child node of the root node, and all the vertices on the right side of the split axis form a bounding box, which is the right child node of the root node. Then, the above algorithm is repeatedly executed for the left child node and the right child node of the root node, that is, the root node is continuously split downward to generate a large number of non-leaf nodes, until the splitting terminates, the bottom leaf nodes are reached, and the KD tree corresponding to the part is obtained.
[0101] In some embodiments, after generating candidate split schemes in the x, y, and z dimensions, respectively, the optimal split scheme is selected by the surface area heuristic (SAH). The SAH evaluates the cost of each candidate split scheme by a cost function, determines the cost function based on the weighted sum of the surface areas of the left and right child nodes of the split point and the number of triangular patches, and selects the candidate split scheme that minimizes the cost function as the optimal split scheme. The cost function can be expressed as:
[0102]
[0103] where Cost(S) represents the total cost, C t represents the cost of traversing all nodes (usually set to 1), C i represents the cost of ray intersection testing (usually set to 1.5 to 2), A L represents the surface area of the bounding box formed by all the left child nodes of the current split point, A R represents the surface area of the bounding box formed by all the right child nodes of the current split point, A P represents the current bounding box surface area, N L the number of all left child nodes of the current split point, N R the number of all right child nodes of the current split point.
[0104] In the above embodiments, it is necessary to determine whether the termination condition is met (which can be a triangular patch number threshold, a bounding box volume threshold, a maximum tree depth threshold, etc.) each time the splitting is performed. In this process, memory usage can also be reduced by empty node pruning and triangular patch index optimization, and the construction efficiency and query performance can be balanced by early termination of the splitting. The specific process can be referred to the detailed description of related technologies, which will not be described here. The finally formed KD tree is divided by space hierarchy, which subdivides the dense region more finely and keeps larger nodes in the sparse region, thereby laying a foundation for subsequent efficient query.
[0105] Step a2, determining the vertex distance between the first part and the second part in the original mesh model based on the K-dimensional tree corresponding to the first part and the second part respectively.
[0106] Specifically, the vertex distance between the first part and the second part in the original mesh model is quickly measured by using the KD tree corresponding to the first part and the second part respectively.
[0107] In some embodiments, for each vertex of the first part, the first nearest neighbor vertex of the second part is queried based on the K-dimensional tree corresponding to the second part, and the first vertex distance between the vertex and the first nearest neighbor vertex is calculated. For each vertex of the second part, the second nearest neighbor vertex of the first part is queried based on the K-dimensional tree corresponding to the first part, and the second vertex distance between the vertex and the second nearest neighbor vertex is calculated.
[0108] Exemplarily, each vertex on part A is selected as a query point to query the first nearest neighbor vertex on part B with the shortest distance, and then each vertex on part B is selected as a query point to query the second nearest neighbor vertex on part A with the shortest distance. When the query starts, the minimum distance d min :
[0109]
[0110] wherein, represents the minimum coordinate value of the bounding box in the i-th dimension, represents the maximum coordinate value of the bounding box in the i-th dimension, P i represents the coordinate value of the query point in the i-th dimension.
[0111] Further, the path of the non-leaf node that produces the minimum distance d min is selected for further search in the next layer. According to the above steps, in the subsequent deeper traversal process, only the minimum distance between each layer of non-leaf node bounding box (i.e. AABB tree) and the query point needs to be calculated, so as to directly skip the nodes and their sub-trees that do not produce the minimum distance, and avoid unnecessary accurate calculation. Until the leaf node of the KD tree is reached, the vertex with the shortest distance to the query point is found, so as to quickly search the nearest neighbor vertex of the adjacent part corresponding to the query point on the KD tree structure, and determine the vertex distance between the query point and the nearest neighbor vertex.
[0112] The embodiment of the present application utilizes the KD tree to quickly search the nearest neighbor vertex between two components, and then determines the vertex distance between the query vertex and the nearest neighbor vertex, thereby avoiding unnecessary accurate calculation and improving the search efficiency of the target mesh region with the risk of adhesion. Through bidirectional query between the two components, the region with the risk of adhesion is avoided to be missed.
[0113] In step S203, as shown in the figure, Figure 4 If the vertex distance is less than the first distance threshold set in advance, the surface first component and the second component have the risk of adhesion, and the target mesh region with the vertex distance less than the first distance threshold needs to be specially marked, and a third adaptive size L(v i )″ smaller than the second adaptive size is set for each vertex in the target mesh region.
[0114] In step S204, a bounding box enveloping the original mesh model is constructed, and the bounding box is iteratively shrunk based on the second adaptive size and the third adaptive size to generate the triangular surface mesh model.
[0115] Specifically, the above step S204 includes:
[0116] In step S2041, the target adaptive size of each vertex in each triangular patch in the original mesh model is obtained according to the second adaptive size and the third adaptive size.
[0117] In some embodiments, for each triangular patch in the original mesh model, if the triangular patch is located in the target mesh region, the third adaptive size is taken as the target adaptive size of each vertex in the triangular patch; if the triangular patch is not located in the target mesh region, the second adaptive size is taken as the target adaptive size of each vertex in the triangular patch.
[0118] The embodiment of the present application is suitable for the case that the components are close to each other and the adjacent regions have a greater impact on the subsequent simulation results. Based on the user-specified part of the components that need to be prevented from contact, the target mesh region where these components are located is quickly searched, and a third adaptive size smaller than the second adaptive size is set for each vertex in the target mesh region, so that the target mesh region is prevented from contact to prevent the components from being adhered in the generated model, thereby improving the generation quality of the triangular surface mesh model and the accuracy of the subsequent simulation process.
[0119] In step S2042, a bounding box enveloping the original mesh model is constructed, and the bounding box is triangulated to obtain a plurality of boundary surfaces.
[0120] Specifically, an AABB tree is generated for the original mesh model, a slightly larger rectangular bounding box capable of enveloping the entire original mesh model is constructed outside the AABB tree, and 3D Delaunay triangulation is performed on the bounding box to divide the bounding box into a plurality of tetrahedrons, the surface of each tetrahedron is taken as a boundary surface, and the shape of each boundary surface is a triangle. For a specific process of 3D Delaunay triangulation, please refer to the detailed description of the related art, which will not be repeated here.
[0121] In step S2043, for each boundary surface, a first projection point of the boundary surface on the original mesh model is determined, and a local shrinkage size of the boundary surface is obtained according to a target adaptive size of each vertex in a target triangular facet in which the first projection point is located.
[0122] Specifically, the weight of each vertex in the target triangular facet is determined, and the local shrinkage size of the boundary surface is calculated based on the weight of each vertex in the target triangular facet and the target adaptive size.
[0123] In some embodiments, the inner normal vector and the barycenter of each boundary surface are calculated, the intersection point of the barycenter and the original mesh model is determined as the first projection point, the target adaptive size of the three vertices of the target triangular facet corresponding to the first projection point is obtained, and the local shrinkage size a is calculated through the target adaptive size:
[0124] a = (w1L(v1) + w2L(v2) + w3L(v3)) / ζ, w1 + w2 + w3 = 1 (6)
[0125] wherein ζ is a shrinkage scale artificially set, w1, w2, and w3 are the weights of the three vertices of the target triangular facet, respectively, and L(v1), L(v2), and L(v3) are the target adaptive sizes of the three vertices of the target triangular facet, respectively. It should be noted that the weight of each vertex can be determined according to the curvature of the vertex, or the weight of each vertex can be artificially set.
[0126] According to the weight and the target adaptive size of each vertex in the target triangular facet corresponding to the boundary surface, the local shrinkage size of the boundary surface is calculated, so as to shrink the boundary surface based on the local shrinkage size.
[0127] In step S2044, for each boundary surface, if it is detected that the minimum circumscribed sphere radius of the boundary surface is greater than the local shrinkage size of the boundary surface, and the minimum circumscribed sphere radius is not less than the circumscribed sphere radius threshold, the bounding box is shrunk to obtain a new boundary surface, and step S2043 is returned until the iteration ends, and a triangular surface mesh model of the original mesh model is obtained.
[0128] Specifically, there are some narrow gap regions in the whole vehicle geometry which have little influence on the accuracy of subsequent CFD simulation but are not conducive to the stability of solution, such as the fine gap on the model surface, the narrow flow channel surrounded by multiple components, etc. When generating the mesh, these narrow gap regions are to be cleaned up to improve the stability of CFD analysis. However, when processing some small narrow gap regions in the whole vehicle geometry, due to human negligence or data defects caused by data format conversion, the adaptive size of the narrow gap region is likely to be smaller than the characteristic size of the region, which leads to the ineffective simplification of the model features. These narrow gap regions will continue to be retained in the mesh model, which will affect the quality of the subsequent triangular surface mesh model generation, and have an adverse effect on the accuracy and stability of the subsequent CFD analysis solution (especially obvious).
[0129] Therefore, the embodiment considers the narrow gap region (feature is extremely small), and sets a higher priority contraction condition if the triangular facet is too small. The user sets the minimum value T min of the preset size range for the component where the narrow gap region is located in advance, and infers the circumscribed sphere radius threshold R min according to T min . Assuming that the triangular facet formed in the narrow gap region after contraction is an equilateral triangle with a side length of T min , the circumscribed sphere radius threshold R min is calculated according to the following formula:
[0130]
[0131] wherein a, b, c are the side lengths of the equilateral triangle (in the inference algorithm, it is assumed that the triangular facet is an equilateral triangle with a side length of T min , that is, the values of a, b, and c are all T min ).
[0132] Specifically, for each boundary surface, it is necessary to continuously traverse whether the boundary surface can be contracted, and the specific contraction condition is that the minimum circumscribed sphere radius φ(f) of the boundary surface is greater than the local contraction size a of the boundary surface, and the minimum circumscribed sphere radius φ(f) of the boundary surface is not less than the circumscribed sphere radius threshold R min .
[0133] It should be noted that the local contraction size a of the boundary surface is generally less than the circumscribed sphere radius threshold R min , and if the minimum circumscribed sphere radius φ(f) of the boundary surface has been smaller than the circumscribed sphere radius threshold R min during the contraction of the boundary surface, it is determined that the contraction is stopped.
[0134] The embodiment of the application determines a local shrinkage size based on a second adaptive size and a third adaptive size. Moreover, based on a minimum value of a part preset size range specified in advance by a user, a higher-priority circumscribed sphere radius threshold is inversely deduced through a relationship between a triangle side length and a circumscribed sphere radius, and if a minimum circumscribed sphere radius of a boundary surface is smaller than the circumscribed sphere radius threshold, the shrinkage is stopped, automatic smoothing of a slit region is realized, and thus some slit structures that have little influence on subsequent CFD simulation accuracy but are unfavorable to solution stability are effectively smoothed, and the stability of simulation analysis is improved.
[0135] In some optional embodiments, the step of shrinking the bounding box is as follows:
[0136] Step b1, determining an implicit offset surface of the original mesh model; the implicit offset surface is a surface located inside the original mesh model and having a distance smaller than a second distance threshold from the original mesh model.
[0137] Specifically, the implicit offset surface is set for the original mesh model, and the implicit offset surface is a function surface defined in space, and a zero-equal surface thereof is located at a certain offset inside the original mesh model. Subsequent boundary points inserted through triangulation fall on the implicit offset surface instead of directly falling on the surface of the original mesh model, which is beneficial to guarantee the watertightness of the generated model.
[0138] Step b2, determining a finite tetrahedron and an infinite tetrahedron associated with each boundary surface of the bounding box; wherein the finite tetrahedron is located inside the bounding box, and the infinite tetrahedron is located outside the bounding box.
[0139] Specifically, the boundary surface of the bounding box is defined as a "door" for distinguishing inside and outside information of the boundary surface. An unlimited point is added outside each boundary surface of the bounding box, and triangulation is performed based on the unlimited point and a vertex of the original mesh model, so that the bounding box is further divided into multiple tetrahedrons, so that units processed in subsequent processing steps are all tetrahedrons. The tetrahedron outside the bounding box is an infinite tetrahedron, and the tetrahedron inside the bounding box is marked as a finite tetrahedron. Each boundary surface is associated with a finite tetrahedron and an infinite tetrahedron.
[0140] Step b3, for each boundary surface, if a first connecting line between a circumscribed sphere center of the finite tetrahedron associated with the boundary surface and a circumscribed sphere center of the infinite tetrahedron associated with the boundary surface and the implicit offset surface have a first intersection point, the first intersection point is taken as a boundary point.
[0141] Step b4, for each boundary surface, if it is detected that there is no first intersection point between the first connecting line and the implicit offset surface, and the finite tetrahedron associated with the boundary surface intersects the original mesh model, a second projection point of the circumscribed sphere center of the finite tetrahedron associated with the boundary surface on the original mesh model is determined, a second intersection point between a second connecting line between the second projection point and the circumscribed sphere center of the finite tetrahedron associated with the boundary surface and the implicit offset surface is determined, and the second intersection point is taken as the boundary point.
[0142] Step b5, the boundary box is shrunk based on the boundary point, and a new boundary surface is obtained according to the shrunk boundary box.
[0143] In the embodiment of the present application, if the minimum circumscribed sphere radius φ(f) of the door is greater than the local shrinkage size α, and the minimum circumscribed sphere radius is not less than the circumscribed sphere radius threshold, the boundary box is shrunk. For each boundary surface, the first intersection point between the first connecting line of the circumscribed sphere center of the finite tetrahedron and the infinite tetrahedron and the implicit offset surface is found, and if the first intersection point is found, the first intersection point is taken as the boundary point and inserted into the triangulation. If there is no first intersection point, it is further judged whether the finite tetrahedron intersects the original mesh model, and if there is intersection, the circumscribed sphere center of the finite tetrahedron is projected onto the original mesh model, the projection method can select the nearest point projection, the second projection point is connected with the circumscribed sphere center of the finite tetrahedron, the second intersection point between the second connecting line and the implicit offset surface is found, and the second intersection point is inserted into the triangulation. If neither of the two methods finds a suitable intersection point, the finite tetrahedron corresponding to the boundary surface is marked as an infinite tetrahedron. According to the above steps, the cycle is repeated until the shrinkage condition is not met, and the generated triangular surface mesh model is obtained.
[0144] In the case of meeting the shrinkage condition, the embodiment of the present application determines the implicit offset surface of the original mesh model and the finite tetrahedron and the infinite tetrahedron corresponding to each boundary surface, and more accurately determines the shrunk boundary point based on the geometric relationship between the finite tetrahedron, the infinite tetrahedron and the implicit offset surface, so as to shrink the boundary box by using the boundary point, so that the boundary box is close to the surface of the original mesh model, thereby generating the triangular surface mesh model.
[0145] The triangular surface mesh model generation scheme of the present application will be described in detail below in combination with a specific application example, as shown in FIG. 1, the application example includes the following steps: Figure 5
[0146] Step S1, reading the whole vehicle surface mesh model.
[0147] Step S2, calculate the curvature of each vertex in the whole vehicle surface mesh model, and calculate the adaptive scale field based on the curvature. The adaptive scale field includes the first adaptive size of each vertex, which is used to measure the sharpness of the local features of the surface of the whole vehicle surface mesh model.
[0148] Step S3, correct the adaptive scale field based on the user-defined partial component discrete size (i.e., the preset size range corresponding to the component). Thus, the second adaptive size of each vertex is obtained.
[0149] Step S4, construct a KD tree for the user-defined anti-contact part.
[0150] Step S5, based on the constructed KD tree, quickly locate the triangular facets whose distance between adjacent components is less than the anti-contact threshold (i.e., the target mesh region whose vertices are separated by a distance less than the first distance threshold), and further correct the adaptive scale field. Thus, the third adaptive size of the vertices in the target mesh region is obtained, and the second adaptive size and the third adaptive size are integrated to obtain the target adaptive size of each vertex.
[0151] Step S6, generate an AABB tree based on the whole vehicle surface mesh model, construct a slightly larger rectangular bounding box outside it (the boundary surface is defined as a door), and perform 3D Delaunay triangulation.
[0152] Step S7, add unlimited points outside the door, and define finite tetrahedrons and infinite tetrahedrons.
[0153] Step S8, calculate the minimum circumscribed sphere radius of the door, and project the center of gravity of the door along its normal direction to the whole vehicle surface to obtain a first projection point.
[0154] Step S9, based on the adaptive scale field of the three vertices of the target triangular facet where the first projection point is located, calculate the local shrinkage size.
[0155] Step S10, determine whether the minimum circumscribed sphere radius of the boundary surface is greater than the local shrinkage size. If the result is yes, execute step S11; otherwise, skip this boundary surface.
[0156] Step S11, determine whether the minimum circumscribed sphere radius of the boundary surface is less than the termination threshold (i.e., the circumscribed sphere radius threshold). If the result is no, execute step S12; otherwise, skip this boundary surface.
[0157] Step S12, connect the circumscribed sphere centers of the finite tetrahedrons and the infinite tetrahedrons of the boundary surface to obtain a first connecting line.
[0158] Step S13, judging whether the first line intersects with the implicit offset surface, if the result of the judgment is yes, the first intersection point of the intersection is inserted into the triangulation as a boundary point; otherwise, step S14 is executed.
[0159] Step S14, judging whether the finite tetrahedron intersects with the input whole vehicle surface mesh model, if the result of the judgment is yes, the center of the circumscribed sphere of the finite tetrahedron is projected to the whole vehicle surface mesh model to obtain a second projection point, the second intersection point of the second line between the center of the circumscribed sphere and the second projection point and the implicit offset surface is obtained, and the second intersection point is inserted into the triangulation as a boundary point; otherwise, step S16 is executed.
[0160] Step S15, based on the inserted boundary point, the finite / infinite label of the new tetrahedron is set, the boundary triangle is obtained, and step S8 is returned to enter the next round of contraction.
[0161] Step S16, the finite tetrahedron is marked as an infinite tetrahedron.
[0162] Step S17, judging whether the contraction queue of the boundary surface needing to be contracted in the current round is empty, if the result of the judgment is yes, the result surface is extracted, and the triangular surface mesh model is generated; otherwise, step S12 is returned.
[0163] The application firstly calculates the curvature based on the input whole vehicle surface mesh model, obtains the local feature quantitative representation of the grid surface, and obtains an adaptive scale field. Then, for the expected discrete size range of the part component specified by the user, the adaptive scale field is corrected by using the upper and lower limit mapping method. For the adjacent components which need to be added with anti-contact setting specified by the user, the fast search positioning of the possible adhesion area of the adjacent components is realized by constructing the AABB tree and KD tree structure, and the adaptive scale field of this part of the area is further corrected to obtain the final adaptive scale field (including the target adaptive size of each vertex). After obtaining the final adaptive scale field, the input whole vehicle surface mesh model is placed in a bounding box, the scale information of the grid model surface is obtained by using the projection method, and the bounding box is continuously contracted inward according to the scale information to finally obtain a triangular surface mesh model approximating the whole vehicle surface mesh model.
[0164] The application quickly searches and positions the area where the adjacent components may be adhered, sets a more fine third adaptive size for this part of the area, and effectively avoids the adhesion problem through the anti-contact operation. At the same time, for the small gap area, the circumscribed sphere radius threshold is speculated to prevent the boundary surface from further splitting and contracting in these areas, so as to smoothly handle the mechanical energy of the small gap area and realize feature simplification.
[0165] A triangular surface mesh model generation apparatus is also provided in the embodiments, which is configured to implement the above-described embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
[0166] The embodiments provide a triangular surface mesh model generation apparatus, as shown in Figure 6 includes:
[0167] The first processing module 601 is configured to obtain an original mesh model and generate an adaptive scale field of the original mesh model, wherein the original mesh model includes a plurality of triangular patches, and the adaptive scale field includes a first adaptive size of each vertex in the triangular patches.
[0168] The second processing module 602 is configured to clamp the first adaptive size to obtain a second adaptive size of each vertex.
[0169] The third processing module 603 is configured to search a target mesh region between any two components in the original mesh model, wherein the target mesh region has a vertex spacing distance less than a first distance threshold, and determine a third adaptive size of each vertex in the target mesh region, wherein the third adaptive size of each vertex in the target mesh region is less than the second adaptive size of the vertex.
[0170] The fourth processing module 604 is configured to construct a bounding box that encloses the original mesh model, iteratively shrink the bounding box based on the second adaptive size and the third adaptive size, and generate a triangular surface mesh model.
[0171] In some optional embodiments, the first processing module 601 is further configured to:
[0172] determine a Gaussian curvature and an average curvature of each vertex in the original mesh model;
[0173] calculate the first adaptive size of each vertex according to the Gaussian curvature and the average curvature, and obtain the adaptive scale field of the original mesh model.
[0174] In some optional embodiments, the second processing module 602 is further configured to:
[0175] correct the first adaptive size based on a preset size range to obtain the second adaptive size of each vertex.
[0176] In some optional embodiments, the third processing module 603 is further configured to:
[0177] constructing a K-dimensional tree of the first part and the second part respectively; wherein, the K-dimensional tree comprises leaf nodes and non-leaf nodes, the leaf nodes comprise vertices of the parts in the original mesh model, and the non-leaf nodes comprise bounding boxes formed by vertices in the leaf nodes contained by the non-leaf nodes;
[0178] determining the vertex distance between the first part and the second part in the original mesh model based on the K-dimensional trees corresponding to the first part and the second part respectively.
[0179] In some optional embodiments, the third processing module 603 is further configured to:
[0180] for each vertex of the first part, querying the first nearest neighbor vertex of the second part based on the K-dimensional tree corresponding to the second part, and calculating the first vertex distance between the vertex and the first nearest neighbor vertex;
[0181] for each vertex of the second part, querying the second nearest neighbor vertex of the first part based on the K-dimensional tree corresponding to the first part, and calculating the second vertex distance between the vertex and the second nearest neighbor vertex.
[0182] In some optional embodiments, the fourth processing module 604 is further configured to:
[0183] obtaining the target adaptive size of each vertex in each triangular facet in the original mesh model according to the second adaptive size and the third adaptive size;
[0184] triangulating the bounding box to obtain a plurality of boundary surfaces;
[0185] for each boundary surface, determining a first projection point of the boundary surface on the original mesh model, and obtaining a local shrinkage size of the boundary surface according to the target adaptive size of each vertex in the target triangular facet where the first projection point is located;
[0186] for each boundary surface, if it is detected that the minimum circumscribed sphere radius of the boundary surface is greater than the local shrinkage size of the boundary surface, and the minimum circumscribed sphere radius is not less than the circumscribed sphere radius threshold, shrinking the bounding box to obtain a new boundary surface, and returning to the step of determining the first projection point of each boundary surface on the original mesh model until the iteration ends, to obtain the triangular surface mesh model of the original mesh model.
[0187] In some optional embodiments, the fourth processing module 604 is further configured to:
[0188] For each triangular facet in the original mesh model, if the triangular facet is located in the target mesh region, the third adaptive size is taken as the target adaptive size of each vertex in the triangular facet; if the triangular facet is not located in the target mesh region, the second adaptive size is taken as the target adaptive size of each vertex in the triangular facet.
[0189] In some optional embodiments, the fourth processing module 604 is further configured to:
[0190] determine the weight of each vertex in the target triangular facet;
[0191] calculate the local shrinkage size of the boundary surface based on the weight of each vertex in the target triangular facet and the target adaptive size.
[0192] In some optional embodiments, the fourth processing module 604 is further configured to:
[0193] determine an implicit offset surface of the original mesh model; the implicit offset surface is a surface located inside the original mesh model and having a distance less than the second distance threshold from the original mesh model;
[0194] determine a finite tetrahedron and an infinite tetrahedron associated with each boundary surface of the bounding box; the finite tetrahedron is located inside the bounding box, and the infinite tetrahedron is located outside the bounding box;
[0195] for each boundary surface, if a first intersection point between a first line and the implicit offset surface is detected, the first intersection point is taken as a boundary point, where the first line is between the circumcenter of the finite tetrahedron associated with the boundary surface and the circumcenter of the infinite tetrahedron associated with the boundary surface;
[0196] for each boundary surface, if no first intersection point between the first line and the implicit offset surface is detected, and the finite tetrahedron associated with the boundary surface intersects the original mesh model, a second projection point of the circumcenter of the finite tetrahedron associated with the boundary surface on the original mesh model is determined, a second intersection point between a second line and the implicit offset surface is determined, and the second intersection point is taken as a boundary point, where the second line is between the second projection point and the circumcenter of the finite tetrahedron associated with the boundary surface;
[0197] shrink the bounding box based on the boundary points, and obtain new boundary surfaces according to the shrunk bounding box.
[0198] Further function descriptions of the above-mentioned modules and units are the same as those of the corresponding embodiments, and will not be repeated here.
[0199] The triangular surface mesh model generation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0200] The embodiment of the present invention also provides a computer device having the above Figure 6 The triangular surface mesh model generation device shown.
[0201] See also Figure 7 , Figure 7 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0202] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0203] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0204] The memory 20 can include a program storage area and a data storage area, where the program storage area can store an operating system, application programs required for at least one function, and the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely from the processor 10, which can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0205] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk, and can also include a combination of the above-mentioned types of memories.
[0206] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 can be connected through a bus or other means, Figure 7 For example, by way of example, through a bus connection.
[0207] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), etc. The display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.
[0208] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0209] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in a computer readable medium includes but is not limited to source files, executable files, installation package files, etc. Correspondingly, the way of executing computer program instructions by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0210] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method for generating a triangular surface mesh model, characterized in that: The method comprises: Acquire an original mesh model and generate an adaptive scale field of the original mesh model; wherein the original mesh model includes a plurality of triangular facets, and the adaptive scale field includes a first adaptive size of each vertex in the triangular facets; Clamping the first adaptive size to obtain a second adaptive size of each vertex; Searching for a target mesh region in which a distance between vertices of any two components in the original mesh model is less than a first distance threshold, and determining a third adaptive size of each vertex in the target mesh region; wherein, for each vertex in the target mesh region, the third adaptive size of the vertex is less than the second adaptive size of the vertex; A bounding box enveloping the original mesh model is constructed, and the bounding box is iteratively shrunk based on the second adaptive size and the third adaptive size to generate a triangular surface mesh model.
2. The method according to claim 1, characterized in that The iteratively shrinking the bounding box based on the second adaptive size and the third adaptive size to generate a triangular surface mesh model includes: Obtaining a target adaptive size for each vertex in each triangle in the original mesh model according to the second adaptive size and the third adaptive size; triangulate the bounding box to obtain a plurality of bounding surfaces; For each boundary surface, determining a first projection point of the boundary surface on the original mesh model, and obtaining a local contraction size of the boundary surface according to a target adaptive size of each vertex in a target triangle patch where the first projection point is located; For each boundary surface, if it is detected that the minimum circumscribed sphere radius of the boundary surface is greater than the local contraction size of the boundary surface, and the minimum circumscribed sphere radius is not less than the circumscribed sphere radius threshold, the bounding box is contracted to obtain a new boundary surface, and the process of determining the first projection point of each boundary surface on the original mesh model is returned to the step until the iteration is completed to obtain a triangular surface mesh model of the original mesh model.
3. The method according to claim 2, characterized in that Obtaining a target adaptive size of each vertex in each triangle in the original mesh model according to the second adaptive size and the third adaptive size includes: For each triangular face in the original mesh model, if the triangular face is located in the target mesh area, the third adaptive size is used as the target adaptive size of each vertex in the triangular face; if the triangular face is not located in the target mesh area, the second adaptive size is used as the target adaptive size of each vertex in the triangular face.
4. The method according to claim 3, characterized in that The obtaining of the local shrinkage size of the boundary surface according to the target adaptive size of each vertex in the target triangle patch where the first projection point is located includes: Determining the weight of each vertex in the target triangle; Based on the weight of each vertex in the target triangle patch and the target adaptive size, a local contraction size of the boundary surface is calculated.
5. The method according to claim 2, characterized in that The step of shrinking the bounding box to obtain a new bounding surface includes: Determining an implicit offset surface of the original mesh model; the implicit offset surface is a surface located inside the original mesh model and having a distance from the original mesh model less than a second distance threshold; Determining a finite tetrahedron and an infinite tetrahedron associated with each bounding surface of the bounding box; wherein the finite tetrahedron is located inside the bounding box and the infinite tetrahedron is located outside the bounding box; For each boundary surface, if it is detected that a first intersection point exists between a first line connecting the circumscribed sphere center of a finite tetrahedron and the circumscribed sphere center of an infinite tetrahedron associated with the boundary surface and the implicit offset surface, the first intersection point is used as a boundary point; For each boundary surface, if it is detected that there is no first intersection point between the first connecting line and the implicit offset surface, and the finite tetrahedron associated with the boundary surface intersects with the original mesh model, then determining a second projection point of the circumscribed sphere center of the finite tetrahedron associated with the boundary surface on the original mesh model, determining a second intersection point between a second connecting line between the second projection point and the circumscribed sphere center of the finite tetrahedron associated with the boundary surface and the implicit offset surface, and using the second intersection point as a boundary point; The bounding box is shrunk based on the boundary points, and a new boundary surface is obtained according to the shrunk bounding box.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Constructing a K-dimensional tree of the first component and the second component respectively; wherein the K-dimensional tree includes leaf nodes and non-leaf nodes, the leaf nodes include vertices of the components in the original mesh model, and the non-leaf nodes include bounding boxes formed by vertices in the leaf nodes contained in the non-leaf nodes; Based on the K-dimensional trees corresponding to the first component and the second component respectively, a distance between vertices of the first component and the second component in the original mesh model is determined.
7. The method according to claim 6, characterized in that The determining, based on the K-dimensional trees corresponding to the first component and the second component respectively, the distance between the vertices of the first component and the second component in the original mesh model includes: For each vertex of the first component, query the vertex and a first nearest neighbor vertex of the second component based on the K-dimensional tree corresponding to the second component, and calculate a first vertex distance between the vertex and the first nearest neighbor vertex; For each vertex of the second component, based on the K-dimensional tree corresponding to the first component, query the vertex and the second nearest neighbor vertex of the first component, and calculate the second vertex distance between the vertex and the second nearest neighbor vertex.
8. The method according to any one of claims 1 to 5, characterized in that Generating the adaptive scale field of the original grid model includes: Determining the Gaussian curvature and the mean curvature of each vertex in the original mesh model; A first adaptive size of each vertex is calculated according to the Gaussian curvature and the average curvature to obtain an adaptive scale field of the original mesh model.
9. The method according to claim 8, characterized in that The clamping of the first adaptive size to obtain a second adaptive size of each vertex includes: The first adaptive size is modified based on a preset size range to obtain a second adaptive size for each vertex.
10. A triangular surface mesh model generation device, characterized in that: The device comprises: A first processing module is configured to obtain an original mesh model and generate an adaptive scale field of the original mesh model; wherein the original mesh model includes a plurality of triangular facets, and the adaptive scale field includes a first adaptive size of each vertex in the triangular facets; a second processing module, configured to clamp the first adaptive size to obtain a second adaptive size of each vertex; a third processing module, configured to search for a target mesh region in which a distance between vertices of any two components in the original mesh model is less than a first distance threshold, and determine a third adaptive size of each vertex in the target mesh region; wherein, for each vertex in the target mesh region, the third adaptive size of the vertex is less than the second adaptive size of the vertex; The fourth processing module is configured to construct a bounding box enveloping the original mesh model, and iteratively shrink the bounding box based on the second adaptive size and the third adaptive size to generate a triangular surface mesh model.
11. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the triangular surface mesh model generation method according to any one of claims 1 to 9 by executing the computer instructions.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the triangular surface mesh model generation method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the triangular surface mesh model generating method according to any one of claims 1 to 9.