A method, device, equipment and medium for calculating the advancement direction of a volume grid layer
In the three-dimensional mesh generation, the node surface area angle clustering and plane normal optimization of the target surface mesh are solved, and efficient and accurate calculation of the advance direction of the body mesh layer is achieved.
Patent Information
- Application Number
- CN202510920714.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-07-04
Smart Images

Figure CN120430199B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of fluid simulation calculation technology, and in particular to a method, device, equipment and medium for calculating the propulsion direction of a volume grid layer. Background Art
[0002] Volume mesh is an essential part of fluid simulation calculations. The quality of volume meshes obtained by different generation methods will vary, and the quality of the mesh has an important impact on the stability and accuracy of the final flow field calculation. Different types of volume meshes have different scopes of application. Boundary layer meshes near the wall are suitable for relatively square and body-fitting prismatic meshes to better depict the flow with large velocity gradients in the boundary layer, while far-field meshes away from the wall usually use isotropic meshes such as tetrahedrons and Cartesian meshes to take into account the applicability of the mesh. For three-dimensional models with complex geometric features, no matter what type of volume mesh is used, in certain feature point areas, the use of traditional volume mesh layer advancement methods is likely to cause the mesh quality to not meet the calculation requirements. Therefore, it is necessary to improve the traditional volume mesh layer advancement method to improve the volume mesh quality in the feature area.
[0003] Based on this, the existing technology proposes the idea of advancing grid growth optimization layer by layer, specifically discretizing the boundaries of two-dimensional graphics to generate initial grid points; establishing corresponding objective functions and constraints based on grid quality requirements, and constructing an optimized mathematical model; using a sequential least squares algorithm to solve the established mathematical model and optimize the distribution of grid points; at each "corner point", three new grid point coordinates are generated through optimization to form a more optimized quadrilateral grid unit, that is, a high-quality grid, to solve the problem of poor grid quality caused by irregular generation of grid points at the "corner points", but the situation of generating three-dimensional grids (such as prismatic grids) is not explained.
[0004] Furthermore, the near-field prismatic grid can be considered a structured grid, with grids added layer by layer based on the object's surface mesh. During this layer-by-layer addition process, the "top surface" of the previous layer of mesh acts as the "bottom surface" of the next layer of mesh. Once a "bottom surface" mesh is obtained, the propulsion direction and distance of each node (also called a propulsion node or grid point) of the bottom surface mesh are determined based on its properties and user input, thereby propulsing a layer of near-field mesh. This makes the determination of propulsion direction and distance a core element of the layer propulsion method.
[0005] Currently, single-layer meshes are created by pushing nodes, which can be considered a stretching operation on the bottom mesh, with the push direction acting as the direction of the stretching operation. Conventional methods for calculating the push direction use node normals, either directly or indirectly. However, this method has limitations because the node normal always tends to align more closely with the normal of adjacent surfaces with a larger angle (i.e., the normal will be excessively biased toward planes with a larger number of meshes, causing deviations in the push direction). Summary of the Invention
[0006] In view of this, the present invention provides a method, device, equipment and medium for calculating the propulsion direction of a volume mesh layer to solve the problem that the existing technology ignores the calculation error of the node normal, thereby affecting the calculation accuracy of the propulsion direction, causing the propulsion direction to be wrong, and making it difficult to ensure high-quality volume meshes.
[0007] In a first aspect, the present invention provides a method for calculating a volume mesh layer advancement direction, the method comprising:
[0008] determining a target surface mesh, the target surface mesh including a plurality of target nodes;
[0009] For each target node, multiple mesh patches of the current target node are obtained from the target surface mesh, each mesh patch contains the current target node;
[0010] Perform mesh facet clustering based on the angles between all mesh facets of the current target node to determine at least one target plane of the current target node;
[0011] Calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane;
[0012] Based on the angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, the current propulsion direction of the current target node is optimized to determine the target propulsion direction of the current target node.
[0013] The present invention determines a target surface mesh containing multiple target nodes, and obtains multiple mesh facets of each target node from the target surface mesh; calculates the angle between each mesh facet, and clusters them according to the angle, so as to automatically identify the different planes where the current target node is located; calculates the plane normal of each target plane, and determines the current propulsion direction of the current target node according to each plane normal, and then optimizes the direction based on the angle between the current propulsion direction of the current target node and the propulsion direction of the adjacent node, so as to determine the target propulsion direction of the current target node, and can eliminate local direction mutations; the propulsion direction calculation method combining the above-mentioned geometric analysis with direction optimization can overcome the propulsion direction deviation caused by the number of grids, which not only avoids the error in the node propulsion direction and thus ensures the quality of the body grid, but also effectively improves the propulsion direction calculation efficiency, and provides a theoretical basis for the accurate calculation of the propulsion direction of the body grid layer.
[0014] In an optional embodiment, clustering mesh faces based on angles between all mesh faces of the current target node to determine at least one target plane of the current target node includes:
[0015] Calculate the unit normal of each mesh face of the current target node respectively;
[0016] Calculating the first angle between the unit normals corresponding to any two mesh facets respectively, and determining whether the first angle is less than a first preset threshold;
[0017] When the first angle is smaller than a first preset threshold, a patch set consisting of two mesh patches corresponding to the first angle is determined as the target plane.
[0018] The present invention performs clustering based on the relationship between the first angle between the unit normals corresponding to any two mesh facets of the current target node and a first preset threshold, which can significantly improve the computational efficiency of the volume mesh layer advancement direction while ensuring the target plane recognition accuracy.
[0019] In an optional embodiment, calculating the plane normal of each target plane separately includes:
[0020] For each target plane, calculate the unit normal and mesh area of each mesh patch in the current target plane;
[0021] Multiply the unit normal of each mesh patch by the mesh area to obtain the product corresponding to each mesh patch;
[0022] Accumulating the products of all mesh facets to obtain a first value, and summing the mesh areas of all mesh facets to obtain a second value;
[0023] A ratio of the first value to the second value is calculated, and the ratio is determined as the plane normal of the current target plane.
[0024] The present invention determines the plane normal by designing a weighted strategy of the unit normal of each mesh facet and the mesh area, which can significantly improve the accuracy, effectiveness and robustness of the volume mesh layer propulsion direction calculation while ensuring the accuracy of normal vector calculation.
[0025] In an optional implementation, determining the current propulsion direction of the current target node based on the plane normal of each target plane includes:
[0026] The plane normals of each target plane are averaged to obtain the current propulsion direction of the current target node.
[0027] The present invention determines the current propulsion direction of the current target node by averaging the normal vectors of each target plane, which can achieve weighted fusion of the directions of each plane, effectively avoiding the sudden change of the propulsion direction caused by the normal of a single plane, thereby improving the calculation accuracy of the propulsion direction and greatly ensuring the quality of the volume mesh.
[0028] In an optional embodiment, optimizing the current propulsion direction of the current target node based on the angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node to determine the target propulsion direction of the current target node includes:
[0029] Calculate the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node;
[0030] Determining whether the target angle is less than a second preset threshold;
[0031] When the target angle is not less than a second preset threshold, the current propulsion direction of the current target node is optimized using the current propulsion directions of other target nodes adjacent to the current target node to obtain the target propulsion direction of the current target node.
[0032] The present invention is designed to optimize the propulsion direction of the current target node based on the neighborhood direction consistency constraint. Specifically, the angle between the propulsion direction of the current target node and the propulsion direction of the adjacent node is calculated, and the propulsion direction of the current target node is forced to be consistent with the propulsion direction of the adjacent target node. That is, when the angle is less than the second preset threshold, it is not adjusted, and when it is greater than the second preset threshold, it is optimized. This can make the optimized propulsion direction more consistent with the adjacent nodes, help avoid node propulsion direction errors, and effectively ensure the quality of the volume mesh.
[0033] In an optional implementation, optimizing the current propulsion direction of the current target node by using the current propulsion directions of other target nodes adjacent to the current target node includes:
[0034] The current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node are averaged to obtain the optimized propulsion direction;
[0035] The optimized propulsion direction is used as the current propulsion direction of the target node, and the step of calculating the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node is returned until the target angles between the current propulsion direction of the current target node and the current propulsion directions of all other target nodes adjacent to the current target node are all less than the second preset threshold.
[0036] The present invention gradually eliminates directional mutations by repeatedly averaging the optimization method of the propulsion direction of the current node and the neighboring nodes, thereby achieving local optimization of the propulsion direction, helping to overcome the propulsion direction deviation caused by the number of grids, and thus ensuring the quality of the volume grid.
[0037] In an optional embodiment, the method for calculating the volume mesh layer advancement direction further includes:
[0038] Calculating a second angle between a unit normal of a target surface mesh and unit normals of other surface meshes adjacent to the target surface mesh;
[0039] Determine a reference node from each target node according to the second angle, and determine the target propulsion direction of the reference node as a reference direction;
[0040] The target propulsion direction of the current target node is smoothed using the reference direction.
[0041] The present invention automatically identifies characteristic areas that are geometrically closely related to the current target surface mesh by calculating the normal angles between surface meshes, selects the reference directions of the reference nodes in these areas, and smoothes the target propulsion direction of the current target node. This ensures that the smoothed propulsion direction remains consistent across the surface area, helps to ensure the calculation progress of the propulsion direction, further ensures the quality of the volume mesh, and provides a theoretical basis for the accurate calculation of the propulsion direction of the volume mesh layer.
[0042] In an optional embodiment, obtaining multiple mesh patches of the current target node from the target surface mesh includes:
[0043] Get all mesh patches containing the current target node from the target surface mesh;
[0044] Target mesh faces belonging to only one volume mesh are selected from all mesh faces, and the target mesh faces are used as mesh faces of the current target node.
[0045] By screening target mesh patches that belong to only one volume mesh, the present invention can ensure that each mesh patch belongs to only a single volume mesh, thereby avoiding topological confusion caused by patch sharing, achieving precise constraints on the mesh topology structure, and helping to ensure accurate calculation of the advancement direction of subsequent volume mesh layers.
[0046] In an optional embodiment, the method for calculating the volume mesh layer advancement direction further includes:
[0047] The volume mesh layer is advanced according to the preset step size and the target advancement direction of each target node, and the target node corresponding to the target surface mesh of the next layer of volume mesh is obtained. Then, the step of obtaining multiple mesh facets of the current target node from the target surface mesh is returned for each target node.
[0048] The present invention advances the volume mesh layer by presetting the step size and the target advancement direction of each target node, so that the next layer of volume mesh can dynamically adapt to the geometric changes of the previous layer, further achieving the high efficiency, geometric adaptability and physical accuracy of volume mesh generation.
[0049] In a second aspect, the present invention provides a device for calculating a volume grid layer advancement direction, the device comprising:
[0050] A surface mesh determination module is used to determine a target surface mesh, where the target surface mesh includes a plurality of target nodes;
[0051] A mesh patch acquisition module is used to acquire multiple mesh patches of the current target node from the target surface mesh for each target node, each mesh patch containing the current target node;
[0052] A mesh plane determination module, configured to cluster mesh faces based on the angles between all mesh faces of a current target node, and determine at least one target plane of the current target node;
[0053] a first direction determination module, configured to calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane;
[0054] The second direction determination module is used to optimize the current propulsion direction of the current target node based on the angle between the current propulsion directions of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, and determine the target propulsion direction of the current target node.
[0055] The device for calculating the propulsion direction of a volume grid layer of the present invention obtains multiple grid facets of each target node from a target surface grid containing multiple target nodes, calculates the angle between each grid facet, and clusters them according to the angle to automatically identify the different planes where the current target node is located; calculates the plane normal of each target plane, and determines the current propulsion direction of the current target node according to each plane normal, and then optimizes the direction based on the angle between the current propulsion direction of the current target node and the propulsion direction of the adjacent node to determine the target propulsion direction of the current target node, which can eliminate local direction mutations; specifically, the propulsion direction calculation method combining the above-mentioned geometric analysis with direction optimization can effectively overcome the propulsion direction deviation caused by the number of grids, thereby avoiding node propulsion direction errors, greatly ensuring the quality of the volume grid, and helping to improve the propulsion direction calculation efficiency, providing a theoretical basis for the accurate calculation of the propulsion direction of the volume grid layer.
[0056] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to thereby execute a method for calculating the advancement direction of a volume grid layer according to the first aspect or any corresponding embodiment thereof.
[0057] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute a method for calculating a volume grid layer advancement direction according to the first aspect or any corresponding embodiment thereof.
[0058] The method and device for calculating the propulsion direction of a volume grid layer of the present invention overcome the propulsion direction deviation caused by the number of grids through a propulsion direction calculation method that combines geometric analysis with direction optimization. Specifically, multiple grid facets of each target node are obtained from a target surface grid containing multiple target nodes; the angle between each grid facet is calculated, and different planes where the current target node is located are automatically identified based on the angle clustering; the plane normal of each target plane is calculated, and the current propulsion direction of the current target node is determined based on each plane normal. Direction optimization is performed based on the angle between the current propulsion direction of the current target node and the propulsion direction of the adjacent node to determine the target propulsion direction of the current target node. This not only avoids node propulsion direction errors and further ensures the quality of the volume grid; it also effectively improves the calculation efficiency of the propulsion direction, providing a theoretical basis for the accurate calculation of the propulsion direction of the volume grid layer. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0060] Figure 1 is a schematic flow chart of a method for calculating a volume grid layer advancing direction according to an embodiment of the present invention;
[0061] Figure 2 is a flow chart of another method for calculating the advancing direction of a volume mesh layer according to an embodiment of the present invention;
[0062] Figure 3 Schematic diagram of the process of calculating the node propulsion direction;
[0063] Figure 4 It is a schematic diagram of the propulsion node at the feature;
[0064] Figure 5 It is a comparative diagram of the calculation of the node advancement direction;
[0065] Figure 6 It is a schematic diagram of the smoothing of the node's advancing direction;
[0066] Figure 7 is a structural block diagram of a device for calculating a volume grid layer advancement direction according to an embodiment of the present invention;
[0067] Figure 8 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0068] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0069] An embodiment of the present invention provides an embodiment of a method for calculating the advancement direction of a volume grid layer. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0070] In this embodiment, a method for calculating the advancement direction of a volume grid layer is provided. Figure 1 FIG. 1 is a flow chart of a method for calculating the volume grid layer advancing direction according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0071] Step S101: determining a target surface mesh, where the target surface mesh includes a plurality of target nodes.
[0072] In this embodiment, target nodes, also called propulsion nodes, are essentially mesh nodes (i.e., all mesh nodes in a surface mesh are propulsion nodes). It should be noted that in the field of computational meshes, mesh nodes are defined as coordinate points in space, such as three-dimensional coordinates (x, y, z), used to define geometric positions. They are the most basic units of a mesh. Surface meshes are two-dimensional surface mesh units formed by connecting mesh nodes and used to describe the boundaries or surface geometry of an object. Volume meshes are three-dimensional space-filling units surrounded by surface meshes or mesh nodes and used to discretize the computational domain.
[0073] In this embodiment, the specific content and acquisition method of the target surface mesh can be known by referring to the common knowledge in the art, and will not be described in detail here.
[0074] Step S102 : for each target node, obtain multiple mesh patches of the current target node from the target surface mesh, each mesh patch including the current target node.
[0075] It should be noted that a mesh patch refers to a finite area formed by a group of connected mesh nodes connected according to a topological relationship. Common patch forms include triangular patches (consisting of 3 vertices and 3 edges), quadrilateral patches (consisting of 4 vertices), etc.
[0076] Step S103 : performing mesh facet clustering based on the angles between all mesh facets of the current target node to determine at least one target plane of the current target node.
[0077] In this embodiment, a target plane contains at least one mesh patch of similar category.
[0078] Step S104 : Calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane.
[0079] In this embodiment, the plane normal is the normal vector of the plane. The specific calculation method can be known by referring to the relevant content in the field, and will not be described in detail here.
[0080] Step S105 , optimizing the current propulsion direction of the current target node based on the angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, and determining the target propulsion direction of the current target node.
[0081] The method for calculating the propulsion direction of the volume mesh layer in the embodiment of the present invention determines a target surface mesh containing multiple target nodes, and obtains multiple mesh facets of each target node from the target surface mesh; calculates the angle between each mesh facet, and clusters them according to the angle, so as to automatically identify the different planes where the current target node is located; calculates the plane normal of each target plane, and determines the current propulsion direction of the current target node according to each plane normal, and then optimizes the direction based on the angle between the current propulsion direction of the current target node and the propulsion direction of the adjacent node to determine the target propulsion direction of the current target node. This method can overcome the propulsion direction deviation caused by the number of meshes, not only avoids the node propulsion direction error and ensures the quality of the volume mesh, but also effectively improves the propulsion direction calculation efficiency, and provides a theoretical basis for the accurate calculation of the propulsion direction of the volume mesh layer.
[0082] In this embodiment, a method for calculating the advancement direction of a volume grid layer is provided. Figure 2 FIG. 1 is a flow chart of another method for calculating the advancing direction of a volume grid layer according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0083] Step S201: Determine the target surface mesh. The target surface mesh includes multiple target nodes. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0084] Step S202 : for each target node, obtain multiple mesh patches of the current target node from the target surface mesh, each mesh patch including the current target node.
[0085] Specifically, in step S202, obtaining multiple mesh patches of the current target node from the target surface mesh includes:
[0086] Step A1: Obtain all mesh patches containing the current target node from the target surface mesh.
[0087] In this embodiment, the specific method of obtaining mesh facets can be obtained by referring to conventional operations in the field, such as searching for all mesh facets associated with the current target node based on the information of each mesh vertex in the target surface mesh (such as the information including the vertex position and other attributes) (such as by searching for all edges connected to the node and then further finding the faces to which these edges belong). This is only for illustrative purposes.
[0088] Step A2: Filter out target mesh faces that belong to only one volume mesh from all mesh faces, and use the target mesh faces as mesh faces of the current target node.
[0089] It should be noted that a mesh patch may belong to multiple volume meshes at the same time (such as the shared boundary of adjacent volume meshes), or it may belong to only one volume mesh (such as the external boundary patch of the model); when a mesh patch belongs to multiple volume meshes, it usually serves as the internal interface between the volume meshes; when a mesh patch belongs to only one volume mesh, it usually serves as the external boundary of the volume mesh.
[0090] In this embodiment, a specific method for screening mesh facets belonging to only one volume mesh can be obtained by referring to conventional operations in the art, such as determining the number of volume meshes to which the mesh facets belong.
[0091] In the embodiment of the present invention, by screening target mesh faces that belong to only one volume mesh, it can be ensured that each mesh face belongs to only a single volume mesh, thereby avoiding topological confusion caused by facet sharing, achieving precise constraints on the mesh topology structure, and helping to ensure accurate calculation of the advancement direction of subsequent volume mesh layers.
[0092] Step S203 : performing mesh facet clustering based on the angles between all mesh facets of the current target node to determine at least one target plane of the current target node.
[0093] Specifically, the above step S203 includes:
[0094] Step S2031 , calculating the unit normal of each mesh facet of the current target node respectively.
[0095] In this embodiment, the unit normal is used to represent the orientation of the mesh face (such as the outer surface or the inner surface), which can be obtained according to the conventional unit vector calculation method in this field and will not be described in detail here.
[0096] Step S2032: Calculate the first angle between the unit normals corresponding to any two mesh facets, and determine whether the first angle is less than a first preset threshold.
[0097] In this embodiment, the specific value of the first angle can be determined by referring to the vector angle calculation formula in this field; the specific value of the first preset threshold can be adaptively adjusted according to actual needs. For example, the first preset threshold is 15°, which is only used as an example.
[0098] Step S2033: When the first angle is smaller than a first preset threshold, a patch set consisting of two mesh patches corresponding to the first angle is determined as a target plane.
[0099] In the embodiment of the present invention, clustering is performed based on the relationship between the first angle between the unit normals corresponding to any two mesh facets of the current target node and the first preset threshold, which can significantly improve the computational efficiency of the volume mesh layer advancement direction while ensuring the target plane recognition accuracy.
[0100] Step S204 : Calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane.
[0101] Specifically, the above step S204 includes:
[0102] Step S2041 : For each target plane, calculate the unit normal and mesh area of each mesh facet in the current target plane.
[0103] In this embodiment, the relevant content of the unit normal can be found in the previous text and will not be repeated here; the specific value of the grid area can be determined by referring to the relevant calculation formulas in the field (such as the area formulas of triangles and quadrilaterals, or the projection area formula of any polygonal facet in three-dimensional space).
[0104] Step S2042 : Multiply the unit normal of each mesh face by the mesh area to obtain the product corresponding to each mesh face.
[0105] Step S2043: Accumulate the products of all mesh facets to obtain a first value, and sum the mesh areas of all mesh facets to obtain a second value.
[0106] Step S2044: Calculate the ratio of the first value to the second value, and determine the ratio as the plane normal of the current target plane.
[0107] In this embodiment, the plane normal is determined by designing a weighted strategy of the unit normal of each mesh facet and the mesh area, which can significantly improve the accuracy, effectiveness and robustness of the volume mesh layer propulsion direction calculation while ensuring the accuracy of the normal vector calculation.
[0108] Step S2045 , average the plane normals of each target plane to obtain the current propulsion direction of the current target node.
[0109] In this embodiment, the current propulsion direction of the current target node is determined by averaging the normal vectors of each target plane, which can achieve weighted fusion of the directions of each plane, effectively avoiding the sudden change in propulsion direction caused by a single plane normal, thereby improving the calculation accuracy of the propulsion direction and greatly ensuring the quality of the volume mesh.
[0110] Step S205 , optimizing the current propulsion direction of the current target node based on the angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, and determining the target propulsion direction of the current target node.
[0111] It should be noted that step S205 aims to optimize the propulsion direction through neighborhood direction consistency constraints. Specifically, by calculating the angle between the propulsion directions of adjacent nodes, the current target node's propulsion direction is forced to remain consistent with that of adjacent target nodes, thereby avoiding "direction islands" caused by sudden changes in local direction. For example, in a transition region on a curved surface, if the angle between the propulsion directions of adjacent nodes exceeds a threshold (e.g., 30°), the current direction is optimized through weighted averaging or interpolation, resulting in a smooth vector flow across the entire direction.
[0112] Specifically, the above step S205 includes:
[0113] Step S2051 , calculating a target angle between a current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node.
[0114] In this embodiment, the specific calculation method of the target angle can be found in the above text and will not be repeated here.
[0115] Step S2052: Determine whether the target angle is less than a second preset threshold.
[0116] In this embodiment, the specific value of the second preset threshold is adaptively adjusted according to actual needs and is not limited in detail here.
[0117] Step S2053: When the target angle is not less than the second preset threshold, the current propulsion direction of the current target node is optimized using the current propulsion directions of other target nodes adjacent to the current target node to obtain the target propulsion direction of the current target node.
[0118] In this embodiment, the optimization of the propulsion direction of the current target node is achieved by designing a neighborhood direction consistency constraint, which can make the optimized propulsion direction more consistent with the adjacent nodes, help avoid node propulsion direction errors, and effectively ensure the quality of the volume mesh.
[0119] Specifically, in step S2053, optimizing the current advancing direction of the current target node by using the current advancing directions of other target nodes adjacent to the current target node includes:
[0120] Step B1: average the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node to obtain an optimized propulsion direction.
[0121] Step B2: Use the optimized propulsion direction as the current propulsion direction of the target node, and return to the step of calculating the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node, until the target angles between the current propulsion direction of the current target node and the current propulsion directions of all other target nodes adjacent to the current target node are all less than the second preset threshold.
[0122] In the embodiment of the present invention, by repeatedly averaging the optimization method of the propulsion direction of the current node and the neighboring nodes, the direction mutation is gradually eliminated, and the local optimization of the propulsion direction is achieved, which helps to overcome the propulsion direction deviation caused by the number of grids and thus ensure the quality of the volume grid.
[0123] It should be noted that in this embodiment, by introducing a reference direction to smooth the target propulsion direction of the current target node, global smoothing of the propulsion direction can be achieved. Therefore, the calculation method of the volume grid layer propulsion direction of this embodiment also includes:
[0124] Step C1, calculating a second angle between a unit normal of a target surface mesh and unit normals of other surface meshes adjacent to the target surface mesh.
[0125] Step C2: determining a reference node from each target node according to the second angle, and determining the target propulsion direction of the reference node as the reference direction.
[0126] It should be noted that the calculation of the propulsion direction is based on a single node and its adjacent facets, and the mesh is composed of a series of nodes and facets. The addition of a single volume mesh unit in a layer of mesh usually uses three to four adjacent nodes and node propulsion directions. If the propulsion directions between adjacent nodes differ too much, the newly generated volume mesh will inevitably be illegal or of reduced quality. This phenomenon is particularly evident in the feature area. Therefore, the smoothing operation of the propulsion direction is mainly performed near the feature area, where the feature area is defined by the angle between the normals of two adjacent face meshes. If the angle is greater than a given value, the common edge of the two face meshes is a feature edge, and the nodes at both ends of the feature edge are feature points. The given angle value is generally 45° (note that this value can be adaptively adjusted according to actual needs).
[0127] In this embodiment, the reference node is a feature point (ie, a target node within a feature area).
[0128] Step C3: Use the reference direction to smooth the target propulsion direction of the current target node.
[0129] It should be noted that smoothing refers to the process of optimizing geometric models such as meshes, curves, and surfaces through specific algorithms to reduce sharp corners, mutations, or irregular features in the model, making it smoother and more uniform. Furthermore, high-quality meshes (such as triangles and tetrahedral meshes) require uniform node distribution and regular unit shapes (such as avoiding overly narrow and long triangles). Smoothing can improve mesh quality and enhance calculation accuracy. Therefore, in this embodiment, the normal angle between surface meshes is calculated to automatically identify feature areas that are closely geometrically related to the current target surface mesh, and the reference directions of the reference nodes in these areas are selected to smooth the target propulsion direction of the current target node. This ensures that the smoothed propulsion direction remains consistent across the surface area, helps to ensure the calculation progress of the propulsion direction, further ensures the quality of the volume mesh, and provides a theoretical basis for the accurate calculation of the propulsion direction of the volume mesh layer.
[0130] It should be noted that, in this embodiment, the hierarchical expansion of the volume mesh can be achieved through iterative advancement and step size control. Specifically, the advancement direction of each node obtained by calculating the current surface mesh and the set advancement step size are used to generate the next layer of volume mesh, that is, the advancement direction of the target node of the next layer is recalculated after each advancement, so that the new layer of mesh can dynamically adapt to the geometric changes of the previous layer (such as sharp corners, concave cavities), effectively avoiding the mesh distortion caused by traditional fixed direction advancement. Therefore, the calculation method of the volume mesh layer advancement direction of this embodiment also includes: advancing the volume mesh layer according to the preset step size and the target advancement direction of each target node, obtaining the target node corresponding to the target surface mesh of the next layer of volume mesh, and returning to execute the step of obtaining multiple mesh facets of the current target node from the target surface mesh for each target node.
[0131] It should be noted that the specific value of the preset step size can be adjusted adaptively based on actual needs. For example, the step size should ensure that the thickness of each mesh layer is strictly controllable (for example, if the first layer is set to 0.1mm and the growth rate is 1.2, the second layer is set to 0.12mm) to avoid sudden changes in inter-layer thickness that may cause mesh quality degradation. The inter-layer thickness deviation can be controlled within ±5%, which is for illustrative purposes only.
[0132] In the embodiment of the present invention, by presetting the step size and the target advancement direction of each target node, the volume mesh layer is advanced separately, so that the next layer of volume mesh can dynamically adapt to the geometric changes of the previous layer, further achieving the high efficiency, geometric adaptability and physical accuracy of volume mesh generation.
[0133] In a specific embodiment, the current single-layer mesh is obtained by pushing the node, and the conventional method for calculating the pushing direction is to directly or indirectly use the node normal, which is generally obtained by the weighted sum of the normals of a circle of triangles adjacent to the node. The specific calculation formula is as follows.
[0134]
[0135] Among them, i is the node number, j is the number of the adjacent surface mesh, N i and N j are the normals of node i and adjacent surface mesh j, is the weight coefficient of the adjacent surface mesh, and its value is related to the normal angle between node i and adjacent surface mesh j. The normal N of node i is obtained by iterative solution. i , the normal N of node i can be found through the above calculation formula (1) i Each time, it will move toward the adjacent surface with a larger angle N j Closer, this type of forward calculation has certain limitations. Note that i and j represent node numbers, and their specific values can be adaptively set based on actual needs. For example, naming different node numbers with natural numbers, such as i representing node 1, is for illustrative purposes only.
[0136] It should be explained that argmin() in formula (1) is used to find the value of the independent variable at which the function achieves the minimum value. For example, for the function f(x), argmin(f(x)) represents the value of x that makes f(x) achieve the minimum value among all possible values of x.
[0137] Based on this, this embodiment takes into account the important role of the propulsion direction in the propulsion of the volume mesh layer, and accordingly proposes a clustering-based node propulsion direction calculation method, aiming to better correct the propulsion direction at the feature points. This embodiment shows obvious advantages over the traditional conventional weighted method in actual effects, and also derives a feature-oriented multi-directional generation method. Figure 3 The process flow diagram of node propulsion direction calculation is shown in Figure 1. The core of this process is the propulsion direction calculation of mesh nodes, the feature-oriented calculation of multiple propulsion directions, and the smoothing of propulsion directions, which can overcome the problem of propulsion direction deviation caused by the number of meshes. Figure 3 , including the following steps:
[0138] 1. Input the original surface mesh.
[0139] In this embodiment, the original surface mesh is input as an input file into a self-developed program to realize the calculation of the node propulsion direction.
[0140] It should be explained that for any legal surface mesh model, the feature edges include concave edges and convex edges. The points covered by the feature edges are regarded as feature points, and the remaining points are regarded as non-feature points. If the adjacent area of a feature point is traversed in a certain direction, multiple feature edges will be traversed in sequence; and because it is a directed traversal, there is also a group of facet units between every two feature edges. Obviously, there are as many groups of adjacent facets as there are adjacent feature edges. It should be noted that in this embodiment, the feature points corresponding to only one adjacent feature edge are regarded as a degenerate case where the two feature edges overlap into one.
[0141] In a specific embodiment, Figure 4 It is a schematic diagram of the propulsion node at the feature. It should be noted that point A in the figure is a feature point adjacent to 3 feature edges and 9 facets; the feature edges are recorded as the first, second, and third feature edges in counterclockwise order ( Figure 4 (not shown); accordingly, the facets between the first and second characteristic edges are F1, F2, F3, F4, F5, and F6; the facets between the second and third characteristic edges are F7 and F8; and the facet between the third and first characteristic edges is F9. Due to the existence of characteristic edges, within the neighborhood of a point, a subdomain quasi-plane (i.e., the target plane of this embodiment, obtained by facet clustering) can be naturally distinguished. See Figure 4 , the three groups of facets contained in the feature point A in the figure are (F1, F2, F3, F4, F5, F6, F7, F8, F9), which belong to three subdomain quasi-planes R1, R2, and R3 respectively (determined by subsequent steps, the specific content of the subdomain quasi-plane can be found in Figure 5 ). Note that the arrows in the figure represent the corresponding patch normal vectors of patches F1, F2, F3, F4, F5, F6, F7, F8, and F9, respectively. In this embodiment, for each subdomain quasi-plane, its quasi-plane normal vector can be obtained by weighted averaging the patch normal vectors within the quasi-plane; the normal of feature point A is obtained by directly averaging the normal vectors of the subdomain quasi-planes that intersect there.
[0142] 2. Find the adjacent surface mesh of the propulsion node.
[0143] In this embodiment, this step aims to traverse all adjacent mesh cells of the propulsion node. Specifically, all mesh facets located on the "top" surface of the propulsion layer surrounding the propulsion node are obtained, the "inner side" of the propulsion layer is eliminated, and the remaining mesh facets are numbered counterclockwise, starting with any mesh facet centered on the propulsion node, such as F1, F2, F3, F4, etc.
[0144] It should be noted that, in general, part of the mesh facets adjacent to the advancement node are the "top surface" of the mesh advancement layer (that is, if the mesh facet to which the current advancement node belongs only belongs to one volume mesh, then the mesh facet belongs to the "top surface" of the mesh advancement layer), and part of them are the "inner side surfaces" of the mesh advancement layer. Since the "inner side surfaces" do not undergo layer advancement growth, it is only necessary to obtain the "top surface" of the mesh advancement layer for advancement direction calculation.
[0145] 3. Generate subdomain quasi-planes based on clustering.
[0146] It should be noted that Figure 5 This is a comparative diagram of node propulsion direction calculation. As can be seen from the figure, at the feature point, because the subdomain quasi-plane R1 region has the largest number of mesh elements, conventional methods will cause the feature point normal to be excessively offset toward subdomain quasi-plane R1. However, the feature point normal obtained using the clustering method in this embodiment is not affected by the number of subdomain quasi-plane meshes and is not excessively biased toward the subdomain quasi-plane region with a large number of elements.
[0147] In this embodiment, the unit normals of all mesh facets obtained in the above step 2 are calculated in this step, which are respectively recorded as n1, n2, n3, n4, etc.; then the angles between the unit normals of the mesh facets are calculated, which are respectively recorded as A<n1,n2> , A<n1,n3> , A<n1,n4> , A<n2,n3> ...; aggregate the mesh faces with angles smaller than a given value into a set of subdomain quasi-planes, denoted as R1, R2, R3...; where the given value is generally 5° and can be adaptively adjusted according to actual needs.
[0148] 4. Calculate the quasi-plane normal of each subdomain.
[0149] In this embodiment, in this step, the normal vector of the subdomain quasi-plane is weightedly calculated based on the unit normal vectors and mesh areas of all surface meshes within the subdomain quasi-plane. The specific calculation formula is as follows.
[0150]
[0151] Among them, NRx represents the normal vector of the subdomain plane Rx, nk represents the normal vector of the patch k belonging to the subdomain plane Rx, and Area(nk) represents the mesh area of the patch k.
[0152] 5. Calculate the advancement direction of the advancement node.
[0153] In this embodiment, this step directly performs directional average calculation based on the normal vectors of the quasi-planes of each subdomain to obtain the propulsion direction of the propulsion node. Taking the propulsion node A as an example, the specific expression is as follows.
[0154]
[0155] Here, expression (3) indicates that the angles between the direction vector of the propulsion node A (i.e., NA) and the normal vectors of all subdomain quasi-planes containing the node (i.e., NR1, NR2, NR3, ..., NRx) are equal.
[0156] 6. Determine whether the angle between the node's advancement direction and the adjacent node is less than the set value.
[0157] In this embodiment, after completing the calculation of all propulsion node directions, this step is used to cyclically determine whether the angle between each node's propulsion direction and all its adjacent nodes (the angle between each node's propulsion direction and the adjacent nodes is obtained by the spatial vector angle calculation formula) is less than a set value, wherein the set value is generally 45° (this value can be adaptively adjusted according to actual needs); if the angle with the propulsion direction of a certain adjacent node is greater than the set value, the propulsion direction of the node is optimized, that is, a propulsion direction is added, and the newly added propulsion direction is the average of the original propulsion directions of the two nodes (that is, the "perform multi-directional node propulsion" step in the figure). This cyclic determination is repeated until the angle between the propulsion directions of all nodes is less than the set value.
[0158] 7. Smooth the node advancement direction.
[0159] In this embodiment, the smoothing operation of the propulsion direction in this step is mainly performed near the feature area, where the feature area is based on the two adjacent surface meshes F i and F j Normal angle A <F i ,F j > is defined as angle A <F i ,F j > is greater than a given value, then the two adjacent surface meshes F i and F j The common edge of the feature edge is the feature edge; the nodes at both ends of the feature edge are the feature points. The angle is generally set to 45° (this value can be adjusted according to actual needs). When smoothing the node advancement direction, the strategy of fixing the advancement direction of the feature point and smoothing the advancement direction of the nodes near the feature point is adopted. The specific effect is as follows Figure 6 shown; among them, Figure 6 (a) in the figure indicates that the advancing direction of the convex part is smooth. Figure 6 (b) in the figure shows that the advancing direction of the concave part is smooth.
[0160] It should be noted that the propulsion direction of the fixed feature points remains unchanged, that is, the propulsion direction of the right-angle point (feature point) in the graph is fixed, and the propulsion direction of the adjacent points is adjusted. The adjustment is based on the fact that the angle between the three propulsion directions should not change too drastically. Figure 6In (a), the propulsion directions of the three points above are such that the angle between the first and second points is 0° before smoothing, and the angle between the second and third points is 45°. After smoothing, the difference between the two can be reduced, for example, by setting the change in the angle between the three adjacent points to no more than 20° each time. Figure 6 The understanding of smoothing adaptability in (b) will not be elaborated here.
[0161] Therefore, the above steps complete the calculation process of the node propagation direction, that is, the calculation of the propagation direction of the volume mesh layer is completed. It should be noted that the node propagation direction can be calculated and a propagation distance can be set to propagate the nodes to obtain new nodes for the next layer of the volume mesh.
[0162] In summary, in the embodiment of the present invention, after obtaining multiple mesh patches of each target node from the target surface mesh containing multiple target nodes, the angle between each mesh patch is calculated, and clustering is performed according to the angle to automatically identify the different planes where the current target node is located; after calculating the plane normal of each target plane and determining the current propulsion direction of the current target node according to each plane normal, direction optimization is performed based on the angle between the current propulsion direction of the current target node and the propulsion direction of the adjacent node to determine the target propulsion direction of the current target node, which can eliminate local direction mutations; specifically, the propulsion direction calculation method that combines the above-mentioned geometric analysis with direction optimization can effectively overcome the propulsion direction deviation caused by the number of grids, thereby avoiding the node propulsion direction error, greatly ensuring the quality of the volume mesh, and helping to improve the propulsion direction calculation efficiency, providing a theoretical basis for the accurate calculation of the propulsion direction of the volume mesh layer.
[0163] This embodiment also provides a device for calculating the direction of advancement of a volume grid layer. This device is used to implement the above-mentioned embodiments and preferred embodiments, and the details that have been described will not be repeated. As used below, the term "module" refers to a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0164] The present invention provides a device for calculating the advancement direction of a volume grid layer, such as Figure 7 As shown, the device includes:
[0165] The surface mesh determination module 701 is used to determine a target surface mesh, where the target surface mesh includes a plurality of target nodes.
[0166] The mesh patch acquisition module 702 is configured to acquire, for each target node, a plurality of mesh patches of the current target node from the target surface mesh, each mesh patch including the current target node.
[0167] The mesh plane determining module 703 is configured to perform mesh facet clustering based on the angles between all mesh facets of the current target node, and determine at least one target plane of the current target node.
[0168] The first direction determination module 704 is configured to calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane.
[0169] The second direction determination module 705 is used to optimize the current propulsion direction of the current target node based on the angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, and determine the target propulsion direction of the current target node.
[0170] In some optional embodiments, the mesh patch acquisition module 702 includes: a first acquisition submodule and a second acquisition submodule; wherein, the first acquisition submodule is used to acquire all mesh patches containing the current target node from the target surface mesh; the second acquisition submodule is used to filter out target mesh patches belonging to only one body mesh from all mesh patches, and use the target mesh patches as the mesh patches of the current target node.
[0171] In some optional embodiments, the grid plane determination module 703 includes: a first plane determination submodule, a second plane determination submodule and a third plane determination submodule; wherein the first plane determination submodule is used to respectively calculate the unit normal of each grid facet of the current target node; the second plane determination submodule is used to respectively calculate the first angle between the unit normals corresponding to any two grid faces, and determine whether the first angle is less than a first preset threshold; the third plane determination submodule is used to determine the facet set consisting of the two grid faces corresponding to the first angle as the target plane when the first angle is less than the first preset threshold.
[0172] In some optional embodiments, the first direction determination module 704 includes: a first calculation submodule, a second calculation submodule, a third calculation submodule, a fourth calculation submodule and a fifth calculation submodule; wherein the first calculation submodule is used to calculate the unit normal and grid area of each grid face in the current target plane for each target plane; the second calculation submodule is used to multiply the unit normal and grid area of each grid face respectively to obtain the product corresponding to each grid face; the third calculation submodule is used to accumulate the products of all grid faces to obtain a first value, and sum the grid areas of all grid faces to obtain a second value; the fourth calculation submodule is used to calculate the ratio of the first value to the second value, and determine the ratio as the plane normal of the current target plane; the fifth calculation submodule is used to average the plane normals of each target plane to obtain the current propulsion direction of the current target node.
[0173] In some optional embodiments, the second direction determination module 705 includes: a first direction determination submodule, a second direction determination submodule and a third direction determination submodule; wherein, the first direction determination submodule is used to calculate the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node; the second direction determination submodule is used to determine whether the target angle is less than a second preset threshold; the third direction determination submodule is used to optimize the current propulsion direction of the current target node using the current propulsion directions of other target nodes adjacent to the current target node when the target angle is not less than the second preset threshold, so as to obtain the target propulsion direction of the current target node.
[0174] In some optional embodiments, the third direction determination submodule includes: a first optimization unit and a second optimization unit; wherein, the first optimization unit is used to average the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node to obtain an optimized propulsion direction; the second optimization unit is used to use the optimized propulsion direction as the current propulsion direction of the target node, and return to execute the step of calculating the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node, until the target angle between the current propulsion direction of the current target node and the current propulsion directions of all other target nodes adjacent to the current target node is less than a second preset threshold.
[0175] In some optional embodiments, the device also includes: a propulsion direction smoothing module and a volume mesh layer propulsion module; wherein the propulsion direction smoothing module is used to calculate the second angle between the unit normal of the target surface mesh and the unit normals of other surface meshes adjacent to the target surface mesh; determine the reference node from each target node according to the second angle, and determine the target propulsion direction of the reference node as the reference direction; use the reference direction to smooth the target propulsion direction of the current target node; the volume mesh layer propulsion module is used to perform volume mesh layer propulsion according to the preset step size and the target propulsion direction of each target node, obtain the target node corresponding to the target surface mesh of the next layer of volume mesh, and return to execute the step of obtaining multiple mesh facets of the current target node from the target surface mesh for each target node.
[0176] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0177] The calculation device for the volume grid layer advancement direction 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.
[0178] The device for calculating the propulsion direction of a volume mesh layer in an embodiment of the present invention overcomes the propulsion direction deviation caused by the number of meshes by calculating the propulsion direction by combining geometric analysis with direction optimization. This not only avoids node propulsion direction errors and further ensures the quality of the volume mesh; it also effectively improves the calculation efficiency of the propulsion direction and provides a theoretical basis for the accurate calculation of the propulsion direction of the volume mesh layer.
[0179] The present invention also provides a computer device, see Figure 8 , Figure 8 is a structural diagram of the above-mentioned computer device provided in an optional embodiment of the present invention, such as Figure 8As shown, the computer device includes: one or more processors 10, a 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 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 computer device provides some necessary operations (for example, determined as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0180] 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.
[0181] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0182] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0183] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0184] The computer device further includes a communication interface 30 for the main control chip to communicate with other devices or a communication network.
[0185] A computer-readable storage medium is also provided in an embodiment of the present invention. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor main control chip or 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 a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0186] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for calculating the advancement direction of a volume grid layer, characterized in that: The method comprises: Determining a target surface mesh, wherein the target surface mesh includes a plurality of target nodes; For each target node, obtain multiple mesh patches of the current target node from the target surface mesh, each mesh patch containing the current target node; Performing mesh facet clustering based on the angles between all mesh facets of the current target node to determine at least one target plane of the current target node; Calculating the plane normal of each target plane respectively, and determining the current propulsion direction of the current target node based on the plane normal of each target plane; Optimizing the current propulsion direction of the current target node based on an angle between the current propulsion direction of other target nodes adjacent to the current target node and the current propulsion direction of the current target node to determine the target propulsion direction of the current target node includes: Calculating a target angle between a current propulsion direction of the current target node and current propulsion directions of other target nodes adjacent to the current target node; Determining whether the target angle is less than a second preset threshold; When the target angle is not less than the second preset threshold, the current propulsion direction of the current target node is optimized using the current propulsion directions of other target nodes adjacent to the current target node to obtain the target propulsion direction of the current target node.
2. The method for calculating the volume grid layer advancement direction according to claim 1, characterized in that: The performing mesh facet clustering based on the angles between all mesh facets of the current target node to determine at least one target plane of the current target node includes: Calculating the unit normal of each mesh face of the current target node respectively; Calculating a first angle between unit normals corresponding to any two mesh facets, and determining whether the first angle is less than a first preset threshold; When the first angle is smaller than a first preset threshold, a patch set consisting of two mesh patches corresponding to the first angle is determined as a target plane.
3. The method for calculating the volume grid layer advancement direction according to claim 2, characterized in that: The step of respectively calculating the plane normal of each target plane includes: For each target plane, calculate the unit normal and mesh area of each mesh patch in the current target plane; Multiply the unit normal of each mesh patch by the mesh area to get the product corresponding to each mesh patch; Accumulating the products of all mesh facets to obtain a first value, and summing the mesh areas of all mesh facets to obtain a second value; A ratio of the first value to the second value is calculated, and the ratio is determined as the plane normal of the current target plane.
4. The method for calculating the volume grid layer advancement direction according to claim 1, characterized in that: The determining the current propulsion direction of the current target node based on the plane normal of each target plane includes: The plane normals of each target plane are averaged to obtain the current propulsion direction of the current target node.
5. The method for calculating the volume grid layer advancement direction according to claim 1, characterized in that: The optimizing the current advancing direction of the current target node by utilizing the current advancing directions of other target nodes adjacent to the current target node includes: averaging the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node to obtain an optimized propulsion direction; The optimized propulsion direction is used as the current propulsion direction of the target node, and the step of calculating the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node is returned to execute until the target angles between the current propulsion direction of the current target node and the current propulsion directions of all other target nodes adjacent to the current target node are all less than the second preset threshold.
6. The method for calculating the volume grid layer advancement direction according to claim 1, characterized in that: The method further comprises: Calculating a second angle between a unit normal of the target surface mesh and unit normals of other surface meshes adjacent to the target surface mesh; Determining a reference node from each target node according to the second angle, and determining the target propulsion direction of the reference node as a reference direction; The target propulsion direction of the current target node is smoothed using the reference direction.
7. The method for calculating the volume grid layer advancement direction according to claim 1, characterized in that: The step of obtaining a plurality of mesh patches of a current target node from the target surface mesh comprises: Obtain all mesh patches containing the current target node from the target surface mesh; A target mesh surface belonging to only one volume mesh is screened out from all mesh surfaces, and the target mesh surface is used as the mesh surface of the current target node.
8. The method for calculating the volume grid layer advancement direction according to any one of claims 1 to 7, characterized in that: The method further comprises: The volume mesh layer is advanced according to the preset step size and the target advancement direction of each target node, and the target node corresponding to the target surface mesh of the next layer of volume mesh is obtained, and the step of obtaining multiple mesh facets of the current target node from the target surface mesh for each target node is returned to be executed.
9. A device for calculating the advancement direction of a volume grid layer, characterized in that: The device comprises: A surface mesh determination module is used to determine a target surface mesh, wherein the target surface mesh includes a plurality of target nodes; A mesh patch acquisition module is used to acquire, for each target node, a plurality of mesh patches of the current target node from the target surface mesh, each mesh patch including the current target node; a mesh plane determination module, configured to perform mesh facet clustering based on the angles between all mesh facets of the current target node, and determine at least one target plane of the current target node; a first direction determination module, configured to calculate the plane normal of each target plane respectively, and determine the current propulsion direction of the current target node based on the plane normal of each target plane; The second direction determination module is used to optimize the current propulsion direction of the current target node based on the angle between the current propulsion directions of other target nodes adjacent to the current target node and the current propulsion direction of the current target node, and determine the target propulsion direction of the current target node, including: calculating the target angle between the current propulsion direction of the current target node and the current propulsion directions of other target nodes adjacent to the current target node; judging whether the target angle is less than a second preset threshold; when the target angle is not less than the second preset threshold, optimizing the current propulsion direction of the current target node using the current propulsion directions of other target nodes adjacent to the current target node to obtain the target propulsion direction of the current target node.
10. A computer device, characterized in that: The computer device includes: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for calculating the volume grid layer advancement direction according to any one of claims 1 to 8 by executing the computer instructions.
11. 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 method for calculating the volume grid layer advancement direction according to any one of claims 1 to 8.
Citation Information
Patent Citations
Free-form surface slicing method and device based on implicit model
CN117002010A
Method for automatically identifying building roof structure based on airborne point cloud
CN119810635A