Grid cell adjustment method and device, equipment and storage medium

By introducing reference lines and interactive actions to adjust the flow direction of grid cells in computer-aided design, the problem of poor quality of automatic generation of grid cells is solved, and the consistent matching of grid cells and reference lines is achieved, and the simulation results are improved. accuracy.

CN119150513APending Publication Date: 2024-12-17SHENZHEN YUNBO SOFTWARE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084731.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In existing computer-aided design technology, the randomness of automatically generated grid cells makes it difficult to coincide with the flow direction of special lines, resulting in poor quality of grid cells.

Method used

By introducing reference lines, determine the grid unit to be adjusted and its reference lines in response to interactive actions, adjust the flow direction of the grid unit according to the relative position and distance, so that it is consistent with the flow direction of the reference lines, and use adjustment angle and weight value calculation to accurately adjust the network Grid cells.

Benefits of technology

The overall quality of grid cells is improved, the flow direction inconsistency caused by the randomness of the automatic generation algorithm is reduced, and the matching degree between grid cells and reference lines is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150513A_ABST
    Figure CN119150513A_ABST
Patent Text Reader

Abstract

The invention discloses a grid cell adjustment method and device, equipment and a storage medium, and relates to the technical field of computer aided design, and the method comprises the steps: determining a to-be-adjusted grid cell and a reference line in response to an interaction action; wherein the reference line comprises one of a boundary line, a characteristic line or a virtual line; and according to the relative position of the to-be-adjusted grid unit and the reference line, adjusting the flow direction of the to-be-adjusted grid unit, so that the flow direction of the to-be-adjusted grid unit is consistent with that of the reference line. The invention aims to improve the quality of the grid unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer-aided design technology, and in particular to a grid unit adjustment method, device, equipment and storage medium. Background Art

[0002] In the field of computer-aided design technology, discretizing the solution area into grid cells is a crucial step. The quality of the grid cells directly affects the speed and accuracy of the simulation. When the grid cells are consistent with the flow direction of some special lines in the solution area, such as the boundary flow direction, the simulation results will be more consistent with the experimental results.

[0003] In related technologies, discretization is usually achieved based on automatic generation algorithms. By setting certain requirements and parameters, computer programs can automatically generate grid cells. However, there is a certain degree of randomness in the automatic generation process, which makes it difficult for the generated grid cells to be consistent with the flow direction of some special lines, and the quality of the grid cells is poor.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a method, device, equipment and storage medium for adjusting a grid unit, aiming to solve the technical problem of poor quality of the grid unit.

[0006] To achieve the above object, the present application proposes a method for adjusting a grid unit, the method comprising:

[0007] In response to the interactive action, determining the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line;

[0008] According to the relative position of the grid unit to be adjusted and the reference line, the flow direction of the grid unit to be adjusted is adjusted so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0009] In one embodiment, the step of determining the grid unit to be adjusted and the reference line in response to the interactive action, wherein the reference line includes one of a boundary line, a feature line or a virtual line, comprises:

[0010] In response to the interactive action, the reference line applicable to the grid unit to be adjusted is determined according to the distance between the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line.

[0011] In one embodiment, the number of the reference lines is at least two, and the step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference lines comprises:

[0012] Determining a weight value of each reference line according to a distance and / or an angle between the grid unit to be adjusted and the reference line;

[0013] Comparing the weight values ​​of all the reference lines, and determining the adjustment angle according to the comparison result;

[0014] According to the adjustment angle, the flow direction of the grid unit to be adjusted is adjusted.

[0015] In one embodiment, the step of determining the weight value of each reference line according to the interval distance and / or angle between the grid unit to be adjusted and the reference line comprises:

[0016] Determining the spacing distance between the grid unit to be adjusted and each of the reference lines according to the relative positions of the grid unit to be adjusted and the reference lines;

[0017] The weight value of each reference line is determined according to the interval distance between each reference line.

[0018] In one embodiment, the step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line includes:

[0019] Determine all unit boundary lines of the grid unit to be adjusted;

[0020] According to the relative position of the cell boundary line and the reference line, a target cell boundary line that meets a preset distance condition is selected;

[0021] Determining an angle between the reference line and the target unit boundary line according to a relative position of the target unit boundary line and the reference line;

[0022] If the grid unit to be adjusted is a rigid grid unit, all the unit boundary lines are adjusted according to the angle;

[0023] If the grid unit to be adjusted is a non-rigid grid unit, the boundary line of the target unit is adjusted according to the angle.

[0024] In one embodiment, if the grid unit to be adjusted is a non-rigid grid unit, the step of adjusting the boundary line of the target unit according to the angle includes:

[0025] If the grid unit to be adjusted is a non-rigid grid unit, determining a non-rigid adjustment angle and a rigid adjustment angle of the grid unit to be adjusted according to a preset deformation threshold and the angle;

[0026] The target unit boundary line is adjusted according to the non-rigid adjustment angle, and all the unit boundary lines are adjusted according to the rigid adjustment angle.

[0027] In one embodiment, after the step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, the method further includes:

[0028] Constructing a grid smoothing operator corresponding to the grid unit to be adjusted and the surrounding grid units, obtaining the grid smoothing operator to obtain the position to be adjusted of the surrounding grid units, and adjusting the surrounding grid units to the position to be adjusted; and / or

[0029] The edges to be topologically transformed between the grid unit to be adjusted and surrounding grid units are determined, and a topological transformation operation is performed on the edges to be topologically transformed.

[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes a grid unit adjustment device, the device comprising:

[0031] A determination module, configured to determine the grid unit to be adjusted and the reference line in response to the interactive action; wherein the reference line includes one of a boundary line, a feature line or a virtual line;

[0032] The adjustment module is used to adjust the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a grid unit adjustment device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the grid unit adjustment method as described above.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the grid unit adjustment method described above are implemented.

[0035] One or more technical solutions proposed in this application have at least the following technical effects:

[0036] The present application provides a method for adjusting a grid unit, which can accurately control the flow direction of the grid unit to be adjusted by introducing a reference line as a reference, so that it is consistent with the flow direction of the reference line. This helps to reduce the problem of inconsistent flow direction of the grid unit caused by the randomness of the automatic generation algorithm, thereby improving the overall quality of the grid unit. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A schematic diagram of a flow chart of a first embodiment of a method for adjusting a grid unit of the present application;

[0040] Figure 2 A schematic diagram of manual selection provided in Embodiment 1 of the method for adjusting the grid unit of the present application;

[0041] Figure 3 A schematic diagram of a quadrilateral surface mesh provided for the first embodiment of the method for adjusting mesh units of the present application;

[0042] Figure 4 A schematic diagram of a flow chart of a first embodiment of a method for adjusting a grid unit of the present application;

[0043] Figure 5 A schematic diagram of the adjustment effect provided in Embodiment 1 of the method for adjusting the grid unit of the present application;

[0044] Figure 6 A schematic diagram of a flow chart of a second embodiment of a method for adjusting a grid unit of the present application;

[0045] Figure 7 A schematic diagram of a flow chart of a second embodiment of a method for adjusting a grid unit of the present application;

[0046] Figure 8 A schematic diagram of the spacing distance provided for the second embodiment of the method for adjusting the grid unit of the present application;

[0047] Fig. 9 A flowchart diagram of a third embodiment of the method for adjusting a grid unit of the present application is provided;

[0048] Fig.10 A flowchart diagram of a third embodiment of the method for adjusting a grid unit of the present application is provided;

[0049] Fig.11 A schematic diagram of a flow chart of a fourth embodiment of a method for adjusting a grid unit of the present application;

[0050] Fig.12 Schematic diagram of various adjustment effects of the adjustment method of the grid unit of this application;

[0051] Fig.13 This is a schematic diagram of the module structure of the adjustment device of the grid unit in the embodiment of the present application;

[0052] Fig.14 Schematic diagram of the device structure of the hardware operating environment involved in the grid unit adjustment method in the embodiment of the present application.

[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0056] The main solution of the embodiment of the present application is: in response to an interactive action, determining the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line; according to the relative position of the grid unit to be adjusted and the reference line, adjusting the flow direction of the grid unit to be adjusted so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0057] The prior art usually generates grid cells automatically. Since the automatic generation algorithm used has a certain randomness, it is difficult for the generated grid cells to be consistent with the flow direction of the special lines, that is, the quality of the grid cells is poor.

[0058] To solve the above problems, the present application provides a solution to adjust the flow direction of the grid unit to be adjusted based on the flow direction of the reference line, so that the adjusted grid unit is consistent with the flow direction of the reference line in the solution area, thereby improving the quality of the grid unit.

[0059] It should be noted that the execution subject of this solution can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a grid unit adjustment device capable of realizing the above functions, etc. The following embodiments are described below taking the grid unit adjustment device as an example.

[0060] Based on this, the present application embodiment provides a method for adjusting a grid unit, referring to Figure 1 , Figure 1 This is a flow chart of a first embodiment of a method for adjusting a grid unit of the present application.

[0061] In this embodiment, the method for adjusting the grid unit includes steps S10 to S20:

[0062] Step S10, in response to the interactive action, determining the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line;

[0063] It should be noted that interactive actions refer to the operations performed by users when interacting with the interface, such as clicking, dragging, zooming, etc. Event listeners are set on the user interface. These listeners can listen to various events, such as click events, touch events, mouse movement events, etc., to capture user operation behaviors.

[0064] It should be noted that the grid area refers to the area where the model is located, which is divided into a series of grid cells. The grid cells to be adjusted are the grid cells in the grid area that need to have their flow direction adjusted. The reference line is a special line used to assist in adjusting the flow direction of the grid cells.

[0065] It should be noted that reference lines include boundary lines, feature lines or virtual lines, which play an important role in guiding the overall design and application of the model. Boundary lines refer to the boundary lines of the model; feature lines refer to special marking lines, symmetry axes, partition lines, cutting reference lines, etc. in the grid; virtual lines are lines drawn by users with a mouse or stylus in the grid area.

[0066] Optionally, when the user's interactive action is monitored, the reference line preset in the grid area is automatically selected, or the user's interactive action is parsed to obtain the reference line selected by the user, such as Figure 2 As for the grid cells to be adjusted, they can also be selected automatically or manually, which is not specifically limited here.

[0067] Figure 3 This is an automatically generated quadrilateral mesh. The green area is the mesh area, which is divided into several mesh units. It can be seen that the mesh units in the right rectangular box are consistent with the flow direction of the boundary, both in the vertical direction, while the mesh units in the left circle are serrated, which is inconsistent with the flow direction of the arc-shaped boundary. Therefore, the flow direction of the mesh units in the circle needs to be adjusted.

[0068] In another embodiment, referring to Figure 4 , step S10 may include step S11:

[0069] Step S11, in response to the interactive action, determining the reference line applicable to the grid unit to be adjusted according to the distance between the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line.

[0070] To facilitate understanding, the subsequent plans will use the boundary line as a reference line for explanation.

[0071] Optionally, the distances from key points of the grid unit to be adjusted, such as the center point, corner point, etc., to each boundary line in the grid area are calculated. Then, the boundary line closest to the grid unit to be adjusted is found from these calculated distances as a reference line.

[0072] Optionally, if the grid unit to be adjusted is located at a corner or edge of the grid area and is adjacent to multiple boundary lines, then a combination of these boundary lines may need to be considered to determine the reference line. For example, a distance threshold is pre-set, and in actual application, boundary lines less than the distance threshold are set as reference lines.

[0073] Optionally, a radiation distance may be set for each boundary line in advance according to the characteristics of each boundary line, and then corresponding radiation areas may be delineated in the grid area with each boundary line as the center according to the radiation distance. These areas may be circular, elliptical or other shapes. Thus, in actual application, if the grid unit to be adjusted falls within a certain radiation area, the boundary line is used as a reference line.

[0074] This solution selects the reference line required for adjustment based on the distance between the grid unit to be adjusted and the reference line. This setting can ensure that the selected reference line can reflect the actual situation of the grid unit to be adjusted, so that the adjustment process can adapt to different scenarios and requirements, thereby improving the accuracy and effectiveness of the adjustment.

[0075] Step S20, adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0076] It should be noted that the flow direction of the grid cell to be adjusted refers to the directional characteristics represented by the boundary of the grid cell to be adjusted. For example, in a square grid cell, the flow direction usually refers to the direction of each edge in the grid cell.

[0077] Optionally, according to the relative position of the grid unit to be adjusted and the reference line, the angle between the two is calculated to determine the angle to be rotated. The same value as the angle can be used, or a certain weight value can be superimposed. The weight value here can be input by the user or automatically calculated based on the program, and is not specifically limited here.

[0078] Furthermore, a reference point for the rotation of the grid unit is determined, which is usually the center point of the grid unit or a specific corner point. The grid unit is rotated according to the calculated rotation angle with the selected reference point as the center. During the rotation process, a rigid adjustment method may be adopted by default, that is, ensuring that the shape, size and other key characteristics of the grid unit remain unchanged, and only its direction is changed; or, a non-rigid adjustment method may be adopted by default, that is, not only the direction of the grid unit can be changed, but also its shape, size and other key characteristics; or, according to the importance of the grid unit, a rigid adjustment method or a non-rigid adjustment method may be flexibly selected, which is not specifically limited in this embodiment.

[0079] After the adjustment operation, the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0080] It should be noted that the flow direction of the grid unit to be adjusted is consistent with that of the reference line and can be divided into two cases:

[0081] The first one is that the flow directions of the two are exactly the same. Figure 5 As shown, when the number of reference lines is one, the angle between the reference line and the left side of the square grid unit is directly calculated, and then the square grid unit is rotated with the lower left corner point as the center, so that the left side of the rotated square grid unit remains parallel to the reference line.

[0082] The second type is that the flow directions of the two are basically consistent. During the adjustment process, only a slight adjustment is made to the grid unit to be adjusted, so that the flow direction of the grid unit to be adjusted approaches the flow direction of the reference line. Although this adjustment result will not make the flow directions of the two completely consistent, the angle between them will be significantly reduced compared to before the adjustment, thus achieving a softer flow coordination that meets the overall layout requirements.

[0083] This embodiment provides a method for adjusting a grid unit, which can accurately control the flow direction of the grid unit to be adjusted by introducing a reference line as a reference, so that it is consistent with the flow direction of the reference line. This helps to reduce the problem of inconsistent flow direction of the grid unit caused by the randomness of the automatic generation algorithm, thereby improving the overall quality of the grid unit.

[0084] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 6 , step S20 may include steps A10 to A30:

[0085] Step A10, determining a weight value of each reference line according to the spacing distance and / or angle between the grid unit to be adjusted and the reference line;

[0086] When the number of reference lines is at least two, it is necessary to consider alignment and balance in multiple directions, not just a single direction.

[0087] It should be noted that the weight value is a value used to measure the importance of each reference line in the adjustment process. This weight value reflects the influence of the reference line in determining the flow direction adjustment of the grid unit.

[0088] In a feasible implementation, if the angle between a grid unit and a reference line is the smallest, it means that the reference line may have a more obvious correlation and may be more helpful for adjusting the grid unit. Therefore, a higher angle weight value is given to the reference line.

[0089] A range of weight values ​​is pre-set for different angle categories, for example, parallel relationships (0-10 degrees) may receive the highest weight (3), nearly parallel relationships (10-30 degrees) may receive an intermediate weight (2), and other angles (30-90 degrees) may receive a lower weight (1).

[0090] In actual application, for each reference line, vector operations or trigonometric calculations are used to calculate the angle between the grid unit to be adjusted and the reference line. The reference lines are divided into different categories according to the angle, and then a specific weight value is assigned to each reference line according to the angle classification result.

[0091] In another possible implementation, referring to Figure 7 , step A10 may include steps A11 to A12:

[0092] Step A11, determining the spacing distance between the grid unit to be adjusted and each of the reference lines according to the relative positions of the grid unit to be adjusted and the reference lines;

[0093] Optionally, for each reference line, the closest geodesic distance between the reference line and the grid unit to be adjusted is calculated, and the distance is used as the interval distance between the reference line and the grid unit to be adjusted.

[0094] Optionally, for each reference line, the distance between the reference line and the center point of the grid unit to be adjusted is calculated, and the distance is used as the interval distance between the reference line and the grid unit to be adjusted.

[0095] Alternatively, if it is known that the grid cell to be adjusted has multiple cell boundary lines, such as a square grid cell including four cell boundary lines, for each reference line, the distance between it and the midpoint of each cell boundary line of the grid cell to be adjusted is calculated, and the closest midpoint is found, and the distance is used as the interval distance between the reference line and the grid cell to be adjusted.

[0096] like Figure 8As shown, for reference line 1, the closest thing to it is the left side of the square grid unit, so the distance d1 between reference line 1 and the midpoint of the left side is used as the spacing distance between reference line 1 and the grid unit to be adjusted; for reference line 2, the closest thing to it is the upper side of the square grid unit, so the distance d2 between reference line 2 and the midpoint of the upper side is used as the spacing distance between reference line 2 and the grid unit to be adjusted.

[0097] Step A12: determining a weight value of each reference line according to the interval distance between each reference line.

[0098] Optionally, weight value ranges are pre-set for different distance intervals, for example, distance interval 1 (0-10) can obtain the highest weight (3), distance interval 1 (10-20) can obtain an intermediate weight (2), and distance interval 3 (20-30) can obtain a lower weight (1). In actual application, for each reference line, a specific weight value is assigned to it according to the distance interval in which the reference line is separated from the grid unit to be adjusted.

[0099] Alternatively, the interval distance of each reference line is divided by the sum of the interval distances of all reference lines to obtain the ratio of the interval distances of each reference line. Since a larger ratio indicates that the reference line is closer to the grid unit to be adjusted, its weight value should be higher. Specifically, the ratio can be directly used as the weight value.

[0100] It can be understood that by considering the distance between the grid unit and the reference line, the spatial relationship between them can be more intuitively reflected, so as to more accurately evaluate the actual impact of the reference line on the adjustment of the grid unit. This helps to guide the adjustment process of the grid unit more effectively.

[0101] It can be understood that, compared with using image processing technology to determine the interval distance, the mathematical calculation method used in this solution does not require a large amount of data processing and image recognition, and is therefore more efficient and easier to implement.

[0102] In addition, the influence of distance and angle can be comprehensively considered, that is, weight values ​​can be set for the distance weight value and the angle weight value. For example, according to the formula, comprehensive weight value = distance weight value * 0.5 + angle weight value * 0.5, the influence of each reference line can be determined.

[0103] Step A20, comparing the weight values ​​of all the reference lines, and determining the adjustment angle according to the comparison result;

[0104] Step A30: adjusting the flow direction of the grid unit to be adjusted according to the adjustment angle.

[0105] The reference line with the largest weight value is used as the main reference line, and then the angle to be adjusted is determined by referring to the angle between the main reference line and the grid unit to be adjusted. This method focuses on the influence of the main reference line and uses its angle as the main basis for adjustment. It can consider the influence of the main reference line more intensively and independently to achieve a more accurate adjustment effect.

[0106] In addition to the main reference line, the influence of other reference lines is considered separately. That is, the angle corresponding to each reference line is calculated and multiplied by the weight value to obtain the corresponding adjustment angle, that is, adjustment angle 1 = angle corresponding to reference line 1 * weight value 1, adjustment angle 2 = angle corresponding to reference line 2 * weight value 2, and then the different parts of the grid unit to be adjusted are adjusted according to the adjustment angle of each reference line. This method calculates the influence of different reference lines separately, and can more flexibly customize the adjustment values ​​of different reference lines, thereby achieving more refined and personalized grid adjustment.

[0107] Considering the comprehensive influence of the main reference line and other reference lines, the overall adjustment angle is determined by weighted average. That is, the angle between the main reference line and other reference lines is multiplied by the corresponding weight value and then added to obtain the overall adjustment angle, that is, the overall adjustment angle = the corresponding angle of reference line 1 * weight value 1 + the corresponding angle of reference line 2 * weight value 2. In this way, the influence of multiple reference lines can be comprehensively considered, and the information of each reference line can be fully utilized to achieve a more comprehensive and integrated grid adjustment.

[0108] At this point, the flow direction of the grid unit to be adjusted can be adjusted according to the above adjustment angle.

[0109] This embodiment provides a method for adjusting a grid unit. When there are at least two reference lines, a weight value is determined according to the relative position of the grid unit to be adjusted and the reference line. This can more accurately reflect the influence of each reference line on the adjustment, so as to more accurately determine the adjustment angle, thereby achieving more accurate grid adjustment and optimizing the flow direction of the grid unit.

[0110] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Fig. 9 , step S20 may include steps B10 to B50:

[0111] Step B10, determining all unit boundary lines of the grid unit to be adjusted;

[0112] It should be noted that the grid cells are the basic units that make up the entire grid area. They can be quadrilaterals, hexahedrons, triangles, tetrahedrons or other polygonal shapes. The boundary lines of the grid cells are the dividing lines between these cells. They separate different cells and define the boundaries of each cell. Figure 8 As shown, the square grid unit includes four unit boundary lines. Specifically, grid post-processing software or algorithms can be used to identify the boundary line of each grid unit.

[0113] Step B20, screening out a target cell boundary line that meets a preset distance condition according to the relative position of the cell boundary line and the reference line;

[0114] For each cell boundary line in the grid, the distance between it and the reference line needs to be calculated. This distance can be the vertical distance between the boundary line and the reference line, or other distances defined according to actual needs. Then, the target cell boundary line is filtered out according to the preset distance condition.

[0115] For example, when the preset distance condition is a distance threshold, for a certain reference line, as long as the distance to the target unit boundary line is less than the distance threshold, it can be set as the target unit boundary line.

[0116] For example, when the preset distance condition is the nearest cell boundary line, the distances between all cell boundaries and a reference line are compared, and the cell boundary line with the smallest value is set as the target cell boundary line.

[0117] like Figure 8 As shown, for reference line 1, the closest thing to it is the left side of the square grid unit, so the left side is set as the target unit boundary line corresponding to reference line 1; similarly, the upper side is set as the target unit boundary line corresponding to reference line 2.

[0118] Step B30, determining an angle between the reference line and the target unit boundary line according to the relative positions of the target unit boundary line and the reference line;

[0119] Optionally, the direction vectors of the reference line and the target boundary line need to be calculated, and the direction vectors of these line segments can be calculated by taking the difference between two points. Then, the angle between the direction vectors of the reference line and the target unit boundary line is calculated using a dot product or an inverse cosine function.

[0120] Step B40, if the grid unit to be adjusted is a rigid grid unit, adjusting all the unit boundary lines according to the angle;

[0121] Step B50: If the grid unit to be adjusted is a non-rigid grid unit, adjust the boundary line of the target unit according to the angle.

[0122] If the grid unit to be adjusted is a rigid grid unit, the overall shape needs to be kept fixed. Therefore, during the rotation process, all unit boundary lines need to be adjusted synchronously to maintain the stability and consistency of the entire grid structure.

[0123] If the mesh unit to be adjusted is a non-rigid mesh unit, deformation is allowed. Therefore, during the rotation process, only the boundary line of the target unit needs to be adjusted synchronously. This processing method can more flexibly adapt to different rotation requirements and conditions while maintaining high mesh quality and accuracy. In a feasible implementation, refer to Fig.10 , step B50 may include steps B51 to B52:

[0124] Step B51, if the grid unit to be adjusted is a non-rigid grid unit, determining a non-rigid adjustment angle and a rigid adjustment angle of the grid unit to be adjusted according to a preset deformation threshold and the included angle;

[0125] Step B52: adjusting the target unit boundary line according to the non-rigid adjustment angle, and adjusting all the unit boundary lines according to the rigid adjustment angle.

[0126] It should be noted that the preset deformation threshold characterization is used to determine the maximum deformation range allowed for the current grid unit during the rotation process, and then to determine when non-rigid adjustment and rigid adjustment should be performed, which ensures that the accuracy of the grid unit will not be significantly reduced after adjustment.

[0127] The angle to be adjusted is determined according to the angle between the reference line and the boundary line of the target unit. When the grid unit to be adjusted is a non-rigid grid unit, it is necessary to analyze the angle to be adjusted and the preset deformation threshold.

[0128] On the one hand, the portion that is less than or equal to the preset deformation threshold is set as the non-rigid adjustment angle; on the other hand, the angle to be adjusted and the preset deformation threshold are subtracted, and then the angle difference is set as the rigid adjustment angle.

[0129] For example, it is known that the angle to be adjusted is The preset deformation threshold is

[0130] if At this time, the deformation threshold is not exceeded, so the non-rigid adjustment angle is set to Set the rigidity adjustment angle to 0.

[0131] if This means that part of the angle to be adjusted exceeds the deformation threshold. In this case, the non-rigid adjustment angle is set to Set the rigidity adjustment angle to

[0132] Furthermore, the target unit boundary line is first adjusted according to the non-rigid adjustment angle, and then all unit boundary lines are adjusted according to the rigid adjustment angle.

[0133] This embodiment provides a method for adjusting a grid unit. By screening out the target unit boundary line through a preset distance condition, the angle to be adjusted can be calculated more appropriately, thereby ensuring the precision and accuracy of the adjustment. At the same time, this step also helps to determine the adjustment object that needs to be rigidly adjusted later, thereby improving the efficiency of the overall adjustment process. In addition, the method allows different adjustment strategies to be adopted according to the type of grid unit. For rigid grid units, all unit boundary lines are adjusted according to the angle, which helps to maintain the overall shape and stability of the grid unit. For non-rigid grid units, only the target unit boundary line is adjusted, which provides greater flexibility and allows the grid to be more finely deformed in local areas.

[0134] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can refer to the above description, and will not be described in detail later. Fig.11 After step S20, steps C10 to C20 may also be included:

[0135] Step C10, constructing a grid smoothing operator corresponding to the grid unit to be adjusted and the surrounding grid units, obtaining the grid smoothing operator to obtain the position to be adjusted of the surrounding grid units, and adjusting the surrounding grid units to the position to be adjusted; and / or

[0136] Step C20: determining edges to be topologically transformed between the to-be-adjusted mesh unit and surrounding mesh units, and performing a topological transformation operation on the edges to be topologically transformed.

[0137] It is understandable that after adjustment, since the selected grid unit is closely connected with the surrounding grid units, the selected grid unit may affect the surrounding grid units after optimization. Therefore, it is optional to perform local optimization on the surrounding grid units.

[0138] Optionally, the optimization is performed by using a grid smoothing method, including but not limited to Laplace smoothing, uniformly weighted smoothing, and the like.

[0139] The specific steps are as follows: the selected grid unit to be adjusted and its surrounding grid units are represented as a set of vertices, each of which has its position coordinates. According to the topological structure of the grid, the adjacency relationship between the grid unit to be adjusted and its surrounding grid units is determined, and then a grid smoothing operator is constructed based on the connection relationship. Then, numerical optimization methods such as gradient descent and conjugate gradient are used to solve the problem in order to find the optimal vertex position adjustment solution. Finally, according to the optimal solution obtained, the position to be adjusted of the surrounding grid units is determined, and the position to be adjusted is adjusted to the position to be adjusted to complete the optimization.

[0140] Optionally, the optimization is performed by topological transformation, including but not limited to edge segmentation, edge exchange, etc.

[0141] The specific steps are to determine the edges to be topologically transformed based on the mesh quality evaluation criteria, such as the Dirac condition of the triangular mesh, the mesh deformation degree, the spectral characteristics of the mesh Laplace matrix, etc. According to the specific optimization requirements, perform the corresponding topological transformation operations, such as edge splitting or edge exchange, to change the connection relationship of the mesh, and then update the topological structure of the surrounding mesh units to ensure the correctness of the connection relationship.

[0142] For example, the surrounding grid cells are traversed to identify edges that are too long or cause poor shapes of adjacent cells as candidate edges. The split position is determined based on geometric characteristics such as curvature and the shape of adjacent cells, such as the midpoint of the candidate edge. A new node is inserted at the split position, and the topology of the grid is updated, including the edges connecting the new node to the original node.

[0143] For example, the surrounding grid cells are traversed to identify edge pairs that may improve the cell shape or grid topology through exchange. The quality indicators of the grid before and after the exchange, such as cell shape quality, grid smoothness, etc., are calculated, and the best edge pairs are selected for exchange. The original edge pairs are deleted, and new edge pairs are added to connect the originally unconnected nodes to update the grid topology.

[0144] This embodiment provides a method for adjusting a mesh unit. Through mesh smoothing operations, the smoothness of the mesh surface can be ensured, sharp edges or overly jagged surfaces can be avoided, and the mesh looks more natural and beautiful. Through topological transformation operations, the continuity of the topological structure of the mesh can be maintained, topological breaks or inconsistencies can be avoided, and the mesh can be ensured to remain intact and stable during the optimization process. Using mesh smoothing and / or topological transformation can accurately adjust the surrounding mesh units, making the optimization effect more precise and accurate, and improving the quality of optimization.

[0145] In order to help understand the implementation process of the grid unit adjustment method obtained by combining this embodiment with the above-mentioned embodiment 1, an example is given here:

[0146] 1. Multiple grid cells and one reference line:

[0147] Each grid unit determines the angle that needs to be adjusted according to its relative position with the reference line, and then adjusts the grid unit according to the angle so that the flow direction of the grid unit is consistent with that of the reference line. This can be further divided into two cases:

[0148] (1) Rigidity adjustment

[0149] Rotate the entire grid unit, the effect is as follows Fig.12 Shown in the upper left corner.

[0150] (2) Non-rigid adjustment

[0151] Only the cell boundary line closest to the reference line is rotated, the effect is as follows Fig.12 Shown in the lower left corner.

[0152] 2. One grid unit, two reference lines:

[0153] When two reference lines are selected, the program will automatically obtain the angle θ between the reference lines, the distance between the grid unit to be adjusted and each reference line, and the correspondence between the reference line and the unit boundary line. For example, Figure 8 The angle θ between the middle reference line 1 and the reference line 2, the spacing distance d1 of the reference line 1, the spacing distance d2 of the reference line 2, the left side corresponding to the reference line 1, and the upper side corresponding to the reference line 2.

[0154] When the above parameters satisfy the given relationship, the correspondence between the grid unit and the reference line can be determined. For example, when the angle θ is about 90 degrees, and the grid unit edges closest to the two reference lines are adjacent edges, it can be determined that the two edges of the grid unit are adjacent to the reference lines. Figure 8 After the corresponding relationship is determined, when adjusting the grid unit, both reference lines need to be considered at the same time. This can be further divided into two situations:

[0155] (1) Rigidity adjustment

[0156] Because the grid unit is rigid and can only be translated or rotated, it may not be possible to simultaneously meet the requirement of manifold consistency of the two reference lines. For example, the angle between the grid unit is 90 degrees, but the angle between the two reference lines is not equal to 90 degrees. In this case, a compromise needs to be made between the two reference lines. Therefore, it is necessary to determine the weight values ​​corresponding to the two reference lines.

[0157] At this point, based on the adjustment angles corresponding to each reference line, the weighted sum can be used as a reference to the weight value to obtain the overall rotation angle of the entire grid unit, so as to rotate the entire grid unit. The effect is as follows: Fig.12 Shown in the upper right corner.

[0158] (2) Non-rigid adjustment

[0159] For non-rigid adjustment, the weight values ​​corresponding to the two reference lines also need to be determined. However, during the adjustment process, there is no need to calculate the overall rotation angle. You only need to refer to the adjustment angle corresponding to each reference line and rotate the unit boundary line corresponding to each reference line. The effect is as follows: Fig.12 Shown in the lower right corner.

[0160] 3. One grid unit, multiple reference lines:

[0161] This situation is a generalization of the "one grid unit, two reference lines" situation. The correspondence between multiple reference lines and grid unit edges can also be determined based on the positional relationship, and corresponding weight values ​​can also be assigned to multiple reference lines. This situation will not be repeated here.

[0162] 4. Multiple grid cells and multiple reference lines:

[0163] This situation is a generalization of the "one grid unit, multiple reference lines" situation and the "multiple grid units, one reference line" situation. The correspondence between the reference lines and the grid unit edges can also be determined based on the positional relationship between the multiple reference lines. Corresponding weight values ​​can also be assigned between the multiple reference lines, and the grid units can be adjusted according to the flow direction of the corresponding reference lines.

[0164] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the adjustment method of the grid units of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0165] This application also provides a grid unit adjustment device, please refer to Fig.13 , the adjusting device of the grid unit comprises:

[0166] A determination module 10, for determining the grid unit and the reference line to be adjusted in response to the interactive action;

[0167] The adjustment module 20 is used to adjust the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line.

[0168] The grid unit adjustment device provided in the present application adopts the grid unit adjustment method in the above embodiment, which can solve the technical problem of poor quality of the grid unit. Compared with the prior art, the beneficial effects of the grid unit adjustment device provided in the present application are the same as the beneficial effects of the grid unit adjustment method provided in the above embodiment, and other technical features in the grid unit adjustment device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0169] The present application provides a device for adjusting a grid unit, the device for adjusting a grid unit comprising: at least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for adjusting the grid unit in the first embodiment described above.

[0170] Reference below Fig.14 , which shows a schematic diagram of the structure of the adjustment device of the grid unit suitable for implementing the embodiment of the present application. The adjustment device of the grid unit in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.14 The adjustment device of the grid unit shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0171] like Fig.14As shown, the adjustment device of the grid unit may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the adjustment device of the grid unit are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the adjustment device of the grid unit to communicate with other devices wirelessly or wired to exchange data. Although the figure shows the adjustment device of the grid unit with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0172] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0173] The grid unit adjustment device provided by the present application adopts the grid unit adjustment method in the above embodiment, which can solve the technical problem of poor quality of the grid unit. Compared with the prior art, the beneficial effects of the grid unit adjustment device provided by the present application are the same as the beneficial effects of the grid unit adjustment method provided by the above embodiment, and the other technical features in the grid unit adjustment device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0174] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0175] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0176] The present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is used to execute the method for adjusting the grid unit in the above embodiment.

[0177] The computer-readable storage medium provided in the present application may be a non-volatile storage medium or a volatile storage medium. For example, it may be a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0178] The computer-readable storage medium may be included in the adjustment device of the grid unit; or may exist independently without being assembled into the adjustment device of the grid unit.

[0179] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the grid unit adjustment device, the grid unit adjustment device: determines the grid unit to be adjusted and the reference line in response to the interactive action; wherein the reference line includes one of a boundary line, a feature line or a virtual line; and adjusts the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

[0180] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0181] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0182] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0183] The readable storage medium provided in the present application is a computer-readable storage medium, which stores a computer program for executing the above-mentioned method for adjusting the grid unit, and can solve the technical problem of poor quality of the grid unit. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the method for adjusting the grid unit provided in the above-mentioned embodiment, and will not be described in detail here.

[0184] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for adjusting the grid unit when executed by a processor.

[0185] The computer program product provided by this application can solve the technical problem of poor quality of grid units. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the grid unit adjustment method provided by the above embodiment, which will not be repeated here.

[0186] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for adjusting a grid unit, It is characterized in that The method comprises: In response to the interactive action, determining the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line; According to the relative position of the grid unit to be adjusted and the reference line, the flow direction of the grid unit to be adjusted is adjusted so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

2. The method according to claim 1, It is characterized in that The step of determining the grid unit to be adjusted and the reference line in response to the interactive action, wherein the reference line includes one of a boundary line, a feature line or a virtual line, comprises: In response to the interactive action, the reference line applicable to the grid unit to be adjusted is determined according to the distance between the grid unit to be adjusted and the reference line; wherein the reference line includes one of a boundary line, a feature line or a virtual line.

3. The method according to claim 1, It is characterized in that The number of the reference lines is at least two, and the step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference lines comprises: Determining a weight value of each reference line according to a distance and / or an angle between the grid unit to be adjusted and the reference line; Comparing the weight values ​​of all the reference lines, and determining the adjustment angle according to the comparison result; According to the adjustment angle, the flow direction of the grid unit to be adjusted is adjusted.

4. The method according to claim 3, It is characterized in that The step of determining the weight value of each reference line according to the interval distance and / or angle between the grid unit to be adjusted and the reference line comprises: Determining the spacing distance between the grid unit to be adjusted and each of the reference lines according to the relative positions of the grid unit to be adjusted and the reference lines; The weight value of each reference line is determined according to the interval distance between each reference line.

5. The method according to claim 1, It is characterized in that The step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line comprises: Determine all unit boundary lines of the grid unit to be adjusted; According to the relative position of the cell boundary line and the reference line, a target cell boundary line that meets a preset distance condition is selected; Determining an angle between the reference line and the target unit boundary line according to a relative position of the target unit boundary line and the reference line; If the grid unit to be adjusted is a rigid grid unit, all the unit boundary lines are adjusted according to the angle; If the grid unit to be adjusted is a non-rigid grid unit, the boundary line of the target unit is adjusted according to the angle.

6. The method according to claim 5, It is characterized in that If the grid unit to be adjusted is a non-rigid grid unit, the step of adjusting the boundary line of the target unit according to the angle includes: If the grid unit to be adjusted is a non-rigid grid unit, determining a non-rigid adjustment angle and a rigid adjustment angle of the grid unit to be adjusted according to a preset deformation threshold and the angle; The target unit boundary line is adjusted according to the non-rigid adjustment angle, and all the unit boundary lines are adjusted according to the rigid adjustment angle.

7. The method according to claim 1, It is characterized in that After the step of adjusting the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, the method further includes: Constructing a grid smoothing operator corresponding to the grid unit to be adjusted and the surrounding grid units, obtaining the grid smoothing operator to obtain the position to be adjusted of the surrounding grid units, and adjusting the surrounding grid units to the position to be adjusted; and / or The edges to be topologically transformed between the grid unit to be adjusted and surrounding grid units are determined, and a topological transformation operation is performed on the edges to be topologically transformed.

8. A device for adjusting a grid unit, It is characterized in that The device comprises: A determination module, configured to determine the grid unit to be adjusted and the reference line in response to the interactive action; wherein the reference line includes one of a boundary line, a feature line or a virtual line; The adjustment module is used to adjust the flow direction of the grid unit to be adjusted according to the relative position of the grid unit to be adjusted and the reference line, so that the flow direction of the grid unit to be adjusted is consistent with that of the reference line.

9. A device for adjusting a grid unit, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for adjusting the grid unit according to any one of claims 1 to 7.

10. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for adjusting the grid unit according to any one of claims 1 to 7 are implemented.