A cell filling method, device, storage medium and computer equipment

By globally dividing and re-dividing the components to be filled, parallel computing is achieved, which solves the time-consuming and low-efficiency problems in large-scale cell filling tasks, improves filling efficiency and avoids software crashes.

CN120472130BActive Publication Date: 2025-09-26ZHEJIANG LAB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510969931.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-26
Estimated Expiration
2045-07-15

AI Technical Summary

Technical Problem

When faced with large-scale cell filling tasks, existing technologies have the problems of long filling time and low efficiency, especially when using target commercial software, which may cause software crashes and fail to meet production needs.

Method used

By globally dividing the component to be filled, a global grid unit that matches the component as a whole is generated, and then it is divided twice and filled in blocks to achieve parallel calculation and improve filling efficiency.

Benefits of technology

It shortens the cell filling time, improves filling efficiency, avoids software crashes, and meets the needs of large-scale production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472130B_ABST
    Figure CN120472130B_ABST
Patent Text Reader

Abstract

The present application provides a cell filling method, apparatus, storage medium and computer equipment, wherein the method comprises: obtaining component information of a component to be filled and cell information of cells to be used; determining a grid coordinate array of a global grid unit to be divided corresponding to the component to be filled based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information; dividing the global grid unit based on the number of blocks, the coordinate dimension with the largest number of grid units and the grid coordinate array to obtain a sub-coordinate array corresponding to each grid unit block; each of the grid unit blocks includes at least one grid unit; and filling the cells to be used in each of the grid unit blocks based on the sub-coordinate array and the cell information to obtain a filled component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of advanced manufacturing and design technology, and in particular to a cell filling method, apparatus, storage medium and computer equipment. Background Art

[0002] Lattice structures, due to their lightweight, high specific strength and stiffness, excellent impact resistance, and energy absorption, hold broad application prospects in rail transportation, aerospace, navigation, biomedicine, and automotive manufacturing. By packing a large number of cells into a component to form a lattice structure, a reliable component with these advantages can be obtained. However, conventional cell-filling methods suffer from long filling times and low efficiency when faced with tens of thousands of cells. Summary of the Invention

[0003] In view of this, the present application provides a cell filling method, apparatus, storage medium and computer equipment to increase the cell filling speed and improve the filling efficiency when performing cell filling, especially when performing large-scale lattice filling.

[0004] Specifically, this application is implemented through the following technical solutions:

[0005] In a first aspect, an embodiment of the present disclosure provides a cell filling method, comprising:

[0006] Obtaining component information of the component to be filled and cell information of the cell to be used;

[0007] Determine, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of the global grid cells to be divided corresponding to the component to be filled;

[0008] Divide the global grid unit according to the number of blocks, the coordinate dimension with the largest number of grid units, and the grid coordinate array to obtain a sub-coordinate array corresponding to each grid unit block; each grid unit block includes at least one grid unit;

[0009] The cells to be used are filled in each of the grid unit blocks according to the sub-coordinate array and the cell information to obtain a filled component.

[0010] In a possible implementation, filling the to-be-used cells in each of the grid unit blocks according to the sub-coordinate array and the cell information to obtain a filled component includes:

[0011] Determining a vertex label of each cell vertex in the cell to be used according to the cell vertex information in the cell information;

[0012] Determine the cell boundary information of the cell to be used and the face labels of each cell face of the cell to be used according to the vertex label of each cell vertex; the cell boundary information is used to indicate the associated boundary face, associated boundary edge and associated angle of each cell vertex;

[0013] For any of the grid unit blocks, traverse each grid unit in the grid unit block and determine a fill flag of the currently traversed grid unit; the fill flag is used to indicate whether the grid unit needs to be filled with the cell to be used;

[0014] If the fill flag is a preset flag, fill the grid unit with the cell to be used, and determine the fill information of the filled grid unit according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid unit in the sub-coordinate array;

[0015] The filled component is determined according to the filling information corresponding to each grid unit.

[0016] In a possible implementation, determining the filling information of the filled grid cell according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid cell in the sub-coordinate array includes:

[0017] According to the parity of the unit coordinates of the grid unit in each coordinate dimension, the local vertex coordinates of the cell vertex of the cell to be used in the cell to be used are adjusted and converted into a global coordinate system to obtain the global vertex coordinates of the cell vertex;

[0018] Determining a target cell face having a neighboring grid cell according to a face label of each cell face and the parity of the cell coordinates in each coordinate dimension;

[0019] Performing a face culling operation on the cell to be used according to the fill flag of the neighboring grid unit of the target cell face to obtain each retained cell face of the cell to be used;

[0020] Adjusting the vertex order of each cell vertex on each of the retained cell faces according to the parity of the cell coordinates in each dimension of the grid cell to obtain an adjusted vertex order;

[0021] Filling information of the filled grid unit is determined according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information.

[0022] In a possible implementation, determining filling information of the filled grid unit according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information includes:

[0023] Taking the grid cell as the center, traverse each neighboring grid cell of the grid cell;

[0024] Storing the cell boundary information in a grid unit boundary array and creating a vertex index array for the grid unit; the vertex index array is used to store a mapping relationship between a local vertex index of each cell vertex of the cell to be used in the grid unit and a default global vertex index;

[0025] Obtaining cell boundary information of the currently traversed neighboring grid cell from the grid cell boundary array, and determining a boundary type and a boundary sequence number of a shared boundary between the grid cell and the currently traversed neighboring grid cell based on the cell boundary information of the grid cell and the cell boundary information of the currently traversed neighboring grid cell;

[0026] According to the boundary type and the target global vertex index of the cell vertex on the shared boundary indicated by the boundary sequence number in the corresponding vertex index array, updating the corresponding mapping relationship of the cell vertex on the shared boundary in the vertex index array to obtain an updated vertex index array;

[0027] Filling information of the filled grid unit is determined according to the updated vertex index array, the global vertex coordinates and the adjusted vertex order.

[0028] In a possible implementation, determining filling information of the filled mesh unit according to the updated vertex index array, the global vertex coordinates, and the adjusted vertex order of the retained cell face includes:

[0029] Determine, based on whether the mapping relationship of the cell vertices is adjusted, unmapped cell vertices in the to-be-used cell, and add the unmapped cell vertices to the constructed global vertex set based on the global vertex coordinates of the unmapped cell vertices, and adjust the mapping relationship of the unmapped cell vertices in the updated vertex index array according to the order in which the unmapped cell vertices are added, to obtain an adjusted vertex index array; the adjusted vertex index array is used to update the vertex index arrays of the other grid cells when the grid cell serves as a neighbor grid cell of the other grid cells;

[0030] Determining the global vertex index of the retained cell face from the adjusted vertex index array according to the adjusted vertex order;

[0031] According to the global vertex index of the reserved cell face, the reserved cell face is added to the constructed global face set to obtain filling information of the filled grid unit.

[0032] In a possible implementation, after determining the filling information of the filled grid unit, the method further includes:

[0033] According to the adjusted vertex index array, the cell boundary information of the cell to be used in the grid unit boundary array is updated.

[0034] In a possible implementation, determining the cell boundary information of the cell to be used and the surface labels of each cell surface of the cell to be used according to the vertex label of each cell vertex includes:

[0035] Predicting the boundary face number, boundary edge number, and corner number associated with the cell vertex according to the dimension values ​​of the vertex label in each coordinate dimension;

[0036] Determine the associated boundary face, associated boundary edge, and associated angle of the cell vertex according to the boundary face sequence number, the boundary edge sequence number, and the angle sequence number;

[0037] Determine the cell boundary information according to the associated boundary faces, associated boundary edges and associated angles of each cell vertex;

[0038] An AND operation is performed on the vertex labels of each cell vertex included in each cell face to obtain a face label of each cell face.

[0039] In a possible implementation manner, determining the fill flag of the currently traversed grid unit includes:

[0040] Sampling the grid cells in each coordinate dimension according to the number of sampling points set in each coordinate dimension to obtain the sampling point coordinates of each sampling point in each coordinate dimension;

[0041] For each coordinate dimension, normalizing the sampling point coordinates of each sampling point on the coordinate dimension to obtain the normalized coordinates of each sampling point;

[0042] Determining the target coordinates of each normalized coordinate in the three-dimensional world coordinate system according to the grid starting coordinates;

[0043] The fill flag of the grid unit is determined according to each of the target coordinates.

[0044] In a possible implementation, determining the filled component according to the filling information corresponding to each grid unit includes:

[0045] Determining a target lattice for each of the grid unit blocks according to the filling information corresponding to each of the grid units;

[0046] For each grid unit block, performing a Boolean operation on the target point matrix corresponding to the grid unit block and the component information of the component to be filled, to obtain an initial Boolean result corresponding to the grid unit block;

[0047] Filtering the discrete connected components in the initial Boolean result to obtain a target Boolean result;

[0048] Generate a filling result corresponding to the grid unit block according to the target Boolean result;

[0049] The filled component is rendered according to the filling result of each grid unit block.

[0050] In a possible implementation, before determining the grid coordinate array of the global grid cells to be divided corresponding to the component to be filled based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, the method further includes:

[0051] According to the component information, performing vertex deduplication, flow pattern repair, and self-intersection repair on the component to be filled, to obtain repaired component information;

[0052] According to the cell information, vertex duplication, flow pattern problem repair and self-intersection problem repair are performed on the cell to be used to obtain the repaired cell information.

[0053] In a possible implementation, after obtaining the repaired cell information, the method further includes:

[0054] Determining the cell size, minimum side length, and shortest distance between cell vertices of the cell to be used according to the repaired cell information;

[0055] Determining a boundary tolerance range according to the minimum side length, the shortest distance, and the cell size;

[0056] Taking the minimum value in the boundary tolerance range as the boundary adsorption value, performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value to obtain an adsorption result;

[0057] Pre-filling the cells to be used according to the adsorption result and the preset filling size, and determining whether the pre-filled cells to be used have flow pattern problems and / or self-intersection problems;

[0058] If so, the boundary adsorption value is updated using the preset step size, and the step of performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value is returned to, until there is no flow type problem and self-intersection problem in the pre-filled cell to be used, or the updated boundary adsorption value exceeds the boundary tolerance range.

[0059] In a possible implementation, determining, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of the global grid cells to be divided corresponding to the component to be filled includes:

[0060] Determine the size of the component to be filled in each coordinate dimension according to the coordinate information of each component vertex;

[0061] Determining the number of grids in each coordinate dimension according to the coordinates of the grid starting point, the size in each coordinate dimension, and the cell size;

[0062] The grid coordinate array is determined according to the number of grids in each coordinate dimension and the cell size.

[0063] In a second aspect, an embodiment of the present disclosure further provides a cell filling device, the device comprising:

[0064] An acquisition module, used to acquire component information of a component to be filled and cell information of a cell to be used;

[0065] a determination module, configured to determine, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of the global grid cells to be divided corresponding to the component to be filled;

[0066] a partitioning module, configured to partition the global grid cell according to the number of blocks, the coordinate dimension with the largest number of grid cells, and the grid coordinate array, to obtain a sub-coordinate array corresponding to each grid cell block; each grid cell block includes at least one grid cell;

[0067] A filling module is used to fill the cells to be used in each of the grid unit blocks according to the sub-coordinate array and the cell information to obtain a filled component.

[0068] In a third aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned first aspect, or the steps in any possible implementation of the first aspect when executed.

[0069] In a fourth aspect, an optional implementation of the present disclosure further provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and runnable on the processor, wherein the processor is configured to execute the computer program stored in the memory, and wherein the computer program, when executed by the processor, implements the above-mentioned first aspect, or the steps in any possible implementation of the first aspect.

[0070] The cell filling method, device, storage medium and computer equipment provided by the embodiments of the present disclosure first globally divide the component to be filled according to the coordinate information of the component vertices in the component information and the cell size of the cell to be used, so as to divide the global grid unit that matches the component to be filled as a whole, and complete the preliminary division of the component to be filled on the whole. Then, by performing a secondary division of the global grid unit, it is possible to divide the cell filling task of the component to be filled into sub-filling tasks of each grid unit block that constitutes the component to be filled. Finally, by filling each grid unit block in blocks, parallel calculation of the component to be filled can be achieved, thereby shortening the component filling time and improving the component filling efficiency.

[0071] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 This is a flow chart of a cell filling method shown in an exemplary embodiment of the present application;

[0073] Figure 2 1 is a schematic diagram of a cube corresponding to the boundary of a cell to be used, shown in an exemplary embodiment of the present application;

[0074] Figure 3 This is a schematic diagram of a specific implementation process of cell filling shown in an exemplary embodiment of the present application;

[0075] Figure 4 1 is a hardware structure diagram of a computer device where a cell filling device 400 is located, as shown in an exemplary embodiment of the present application;

[0076] Figure 5 Schematic diagram of a cell filling device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0077] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0078] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0079] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0080] Research has found that existing technologies typically use commercial software to implement dot-matrix filling tasks. However, when faced with large-scale dot-matrix filling tasks, such as filling tens of thousands or millions of cells, the sheer volume of data means that using this software for one-time filling significantly increases the cell processing time, potentially even causing the software to crash and fail to complete the task, making it unsuitable for large-scale production. Therefore, reducing the time spent on dot-matrix filling and improving its efficiency has become a pressing technical challenge.

[0081] Based on the above research, the present disclosure provides a cell filling method, device, storage medium and computer equipment. According to the coordinate information of the component vertices in the component information and the cell size of the cell to be used, the component to be filled is first globally divided, which can realize the division of global grid units that match the component to be filled as a whole, and complete the preliminary division of the component to be filled on the whole. Then, by performing a secondary division of the global grid units, the cell filling task of the component to be filled can be divided into sub-filling tasks of each grid unit block that constitutes the component to be filled. Finally, by filling each grid unit block in blocks, parallel calculation of the component to be filled can be realized, thereby shortening the component filling time and improving the component filling efficiency.

[0082] The defects in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below are all contributions made by the inventors to the present disclosure during the disclosure process.

[0083] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0084] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0085] To facilitate understanding of this embodiment, a cell filling method disclosed in an embodiment of the present disclosure is first introduced in detail. The executor of the cell filling method provided in the embodiment of the present disclosure is generally a terminal device or other processing device with a certain computing capability, wherein the terminal device may be a user equipment (UE), a mobile device, a terminal device, a personal digital assistant (PDA), a handheld device, a computer device, etc.; in some possible implementations, the cell filling method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0086] The cell filling method provided by the embodiment of the present disclosure is described below by taking a computer device as an example of an execution subject.

[0087] like Figure 1 FIG. 1 is a flowchart of a cell filling method provided by an embodiment of the present disclosure, which may include the following steps:

[0088] S101: Obtain component information of a component to be filled and cell information of a cell to be used.

[0089] Here, a component to be filled is a device that requires cells to be filled. By filling a certain number of cells in the component to be filled, a component with a lattice structure is obtained. Component information is used to indicate component vertex information and component facet information of the component to be filled. Component vertex information can include vertex information for each vertex of the component to be filled. Vertex information can include, for example, coordinate information and vertex indexes of the component vertices in the global coordinate system corresponding to the component to be filled. The coordinate information can specifically be coordinates in the three-dimensional world coordinate system (XYZ coordinate system). Component facet information can include facet information for each triangular facet of the component to be filled. Facet information can include, for example, facet positions and vertex information of each vertex in the global coordinate system. Based on the coordinate information of each vertex in the component vertex information, the component size of the component to be filled can be determined. For example, the component size in each coordinate dimension can be determined by subtracting the maximum and minimum coordinates of all component vertices in that dimension.

[0090] To-be-used cells are cells that can be filled into a component, and all to-be-used cells are identical. Cell information indicates the vertex information and cell patch information of the to-be-used cells. The vertex information can include vertex information for each cell vertex in the local coordinate system corresponding to the to-be-used cell; the patch information can include patch information for each triangular patch (i.e., cell face) of the to-be-used cell. The cell size indicated by the cell information can be calculated based on the vertex information of each cell vertex in the cell information.

[0091] In a specific implementation, a component file corresponding to the component to be filled and a cell file corresponding to the cell to be used can be obtained, and component information can be obtained from the component file, and cell information can be obtained from the cell file. Both the component file and the cell file can be files in a preset format, such as a stereolithography (STL) format and / or an object file (Obj) format.

[0092] Optionally, if the number of blocks for dividing the component to be filled and the starting point position of the lattice for meshing the component to be filled are pre-specified, the number of blocks and the starting point position of the lattice can be obtained at the same time as the component information and cell information are obtained.

[0093] In one embodiment, to avoid quality problems in the filled components caused by lattice design problems after large-scale lattice filling, which would require high repair costs, pre-filling and repair of the cells to be used can be used before executing the following S102. This allows for the prediction of possible quality problems and repairs in advance with a small amount of computation, thus pre-processing the lattice design problems. Specifically, the following steps 1 and 2 can be used to automatically repair the lattice design problems:

[0094] Step 1: Based on the component information, perform vertex deduplication, flow pattern repair, and self-intersection repair on the component to be filled, and obtain the repaired component information.

[0095] During specific implementation, it is possible to determine whether the component to be filled has duplicate vertices based on the coordinate information of each component vertex in the component information. If so, the component vertices can be deduplicated to obtain the deduplicated vertices of each component. If not, it can be determined that there is no vertex overlap problem. At the same time, the component to be filled can be detected for flow type problems and self-intersection problems based on the component vertex information and component facet information in the component information to determine whether there are non-flow type problems and non-self-intersection problems. If not, it can be determined that there are no quality problems in the component to be filled, and the component to be filled can be directly used as the repaired component and the following S102~S104 can be executed. If so, the preset technology library can be used to repair the flow type problem and self-intersection problem of the component to be filled to obtain the repaired component information.

[0096] For example, according to the component information, the component to be filled can be deduplicated, flow pattern problems and self-intersection problems can be repaired to obtain a repaired component file, and then the repaired component information can be obtained from the modified component file.

[0097] Step 2: Based on the cell information, perform vertex deduplication, flow pattern repair, and self-intersection repair on the cells to be used, and obtain the repaired cell information.

[0098] Exemplarily, the steps of cell repair are similar to the component repair process in step 1 above, and will not be repeated here.

[0099] For example, based on the cell vertex information and cell patch information in the cell information, the cells to be used can be subjected to the following three quality checks: checking for vertex overlap, checking for flow pattern issues, and checking for non-self-intersection issues. Based on the results of these three quality checks, any quality issues in the cells to be used are identified and repaired accordingly, resulting in a repaired cell file. The repaired cell information can then be retrieved from the modified cell file.

[0100] In one embodiment, after obtaining the modified cell information, the cells to be used can be pre-filled in steps A through E to perform secondary quality inspection and repair on the cells to be used. Pre-filling solves the patch issues during filling by ensuring geometric alignment, avoiding patch intersections, repairing non-manifold edges, improving capture efficiency, simplifying the geometric structure, and ensuring the consistency of the filled structure, ensuring that the generated structure meets the flow and non-self-intersection conditions.

[0101] Step A: According to the repaired cell information, determine the cell size, minimum side length, and shortest distance between cell vertices of the cell to be used.

[0102] In specific implementations, the cell size of the cell to be used can be determined from the repaired cell information, and the side lengths of the cell structure of the cell to be used and the distances between the cell vertices can be determined based on the cell vertex information and cell patch information in the repaired cell information. The minimum side length of the cell structure can be determined from the side lengths, and the shortest distance can be determined from the distances between the cell vertices.

[0103] Step B: Determine the boundary tolerance range based on the minimum edge length, shortest distance, and cell size.

[0104] Here, the boundary tolerance range is used to indicate the value range of the adsorption boundary value snap when the cell is to be used for boundary adsorption.

[0105] In specific implementations, the minimum value can be determined from the shortest distance and the minimum edge length. The ratio of the minimum value to the cell size is then determined, and the maximum snapping boundary value, snap, is determined based on this ratio. The boundary tolerance range is determined based on the maximum snapping boundary value, snap, and the preset minimum snapping value of 0. In other words, the boundary tolerance range is [0, c * min (minimum edge length, shortest distance) / cell size], where c is a preset coefficient.

[0106] Step C: Taking the minimum value in the boundary tolerance range as the boundary adsorption value, performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value to obtain an adsorption result.

[0107] Here, because the vertices on adjacent faces will need to be merged when filling the unused cells later, and floating-point errors may occur during filling, which may result in the inability to accurately identify vertices on the boundary. Therefore, before filling, all cell vertices in the unused cells whose distance to the boundary is less than the boundary adsorption value will be adsorbed to the cell boundary to solve the problem of unidentified cell vertices. Among them, if the boundary adsorption value is too large or too small, cells that were originally flow-shaped and non-self-intersecting may become non-flow-shaped and self-intersecting during filling, resulting in filling failure. Therefore, in specific applications, it is necessary to adjust the boundary adsorption value based on the actual error of the boundary cell vertices to find the optimal adsorption value for adsorption.

[0108] In specific implementation, we can start from the minimum value in the boundary tolerance range, and use the minimum value as the boundary adsorption value to perform boundary adsorption on each cell vertex of the cell to be used to obtain the adsorption result. The boundary adsorption process can be:

[0109] The cell size is determined based on the vertex information of the cell vertices. Based on the cell size, the coordinates of all the cell vertices to be used are normalized to the range [0, 1]. Based on the current snap value, cell points close to the boundary are snapped to the boundary. That is, points closer to the boundary than the snap are forcibly set to 0 or 1 to avoid boundary problems caused by numerical errors.

[0110] Step D: Pre-filling the cells to be used according to the adsorption result and the preset filling size, and determining whether the pre-filled cells to be used have flow pattern problems and / or self-intersection problems.

[0111] Here, the preset filling size is used to pre-fill the cells to be used, with the purpose of filling the cells to be used after adsorption into an array with the preset filling size. The preset filling size may be, for example, 2×2×2.

[0112] In specific implementations, after obtaining the adsorption results, the adsorbed cells to be used can be pre-filled according to the preset filling size of 2×2×2 to obtain the filled cells to be used. The filled cells to be used are then tested for flow pattern and self-intersection issues to determine whether there are non-flow pattern and / or non-self-intersection issues. If not, it can be determined that the currently used boundary adsorption value has a reliable adsorption effect. The cells to be used that have been adsorbed according to the currently used boundary adsorption value will be used as the cells to be used to be filled later. If so, step E below is executed.

[0113] Step E: If yes, update the boundary adsorption value using the preset step size, and return to the step of performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value, until there is no flow pattern problem and self-intersection problem in the pre-filled cell to be used, or the updated boundary adsorption value exceeds the boundary tolerance range.

[0114] Here, the preset step size may be set based on experience or may be determined based on the maximum value in the boundary tolerance range, and is not specifically limited in the embodiment of the present disclosure.

[0115] In a specific implementation, if boundary adsorption is completed using the current snap and it is determined that the filled unused cell has flow pattern and / or self-intersection problems, the current snap is unreasonable. The sum of the current snap and the preset step size can be used as a new snap, and the process returns to step C of "performing boundary adsorption on each cell vertex of the unused cell according to the boundary adsorption value to obtain an adsorption result." Boundary adsorption is then re-performed on the unused cell to obtain a new adsorption result. Based on the new adsorption result and the preset filling size, the unused cell is pre-filled, and it is determined whether the pre-filled unused cell has flow pattern and / or self-intersection problems. This process continues until the pre-filled unused cell has no flow pattern and self-intersection problems, and the current snap is used as the final snap. Alternatively, if the current snap exceeds the boundary tolerance range (e.g., the current snap is less than 0), it is determined that the unused cell has quality problems and cannot be filled into a reliable unfilled component. An error message is generated and fed back to the relevant user, allowing the unused cell to be adjusted and refilled.

[0116] That is, the present application can set a suitable step value (i.e., preset step size) according to the obtained boundary tolerance range, start from the minimum value in the boundary tolerance range as the snap, perform boundary adsorption on the cell vertices according to the current snap, and then fill the adsorbed cells to be used with 2×2×2, and detect whether the flow type and non-self-intersection are met after filling. If so, select the current snap, otherwise determine the new snap = snap + step value, and cyclically perform boundary adsorption on the cell vertices according to the current snap until a snap that meets the conditions is found to obtain the repaired cell.

[0117] In this way, redundant data is further reduced by deduplicating vertices of the cells to be used and the components to be filled, and the cells to be used and the components to be filled can smoothly enter the subsequent filling process by repairing the flow pattern problem and the self-intersection problem. In order to avoid possible quality problems of the overall structure, this problem is solved by pre-filling, and boundary adsorption is used to ensure geometric alignment. Since the boundary adsorption values ​​required for different structures are different, problems will arise if the boundary adsorption value is too large or too small. If the boundary adsorption value is too large, the cell vertices may be adsorbed to inappropriate positions, resulting in the merging of multiple vertices, thereby destroying the flow pattern properties or introducing self-intersection. If the boundary adsorption value is too small, the cell vertices may not be effectively adsorbed to the boundary, resulting in geometric discontinuities in the filled structure. Therefore, this application uses the minimum side length in the geometric information of the cell structure itself and the shortest distance between the cell vertices to calculate the boundary tolerance range, find the appropriate boundary adsorption value by traversing, and use this boundary adsorption value to repair the cells, which can avoid quality problems after large-scale lattice filling at a lower cost.

[0118] S102: Determine a grid coordinate array of global grid cells to be divided corresponding to the component to be filled according to the coordinate information of each component vertex in the component information and the cell size indicated by the cell information.

[0119] Here, the global grid cell is used to indicate the grid cells obtained after the component to be filled is meshed, and the grid coordinate array (xArray, yArray, zArray) is used to indicate the corresponding cell coordinates of each divided grid cell in the component to be filled. The cell coordinates include coordinates in the three dimensions of XYZ.

[0120] In specific implementations, since the cell sizes of all cells to be used in the component to be filled are consistent, after obtaining the component information, the component to be filled can be mesh initialized based on the component information and cell size, obtaining a grid coordinate array of the global grid cells to be divided into corresponding to the component to be filled. For example, the length, width, and height information of the component to be filled can be determined based on the coordinate information of each component's vertices. Using this length, width, and height information and the cell size, the component to be filled can be initially meshed to obtain a global grid cell composed of each grid cell.

[0121] In one embodiment, the above S102 may be implemented according to the following steps:

[0122] S102-1: Determine the size of the component to be filled in each coordinate dimension according to the coordinate information of each component vertex.

[0123] For example, the xyz coordinates of each component vertex can be determined based on the coordinate information of each component vertex, and then the component size of the component to be filled in each coordinate dimension can be determined based on the xyz coordinates of each component vertex.

[0124] S102-2: Determine the number of grids in each coordinate dimension according to the coordinates of the grid starting point, the size in each coordinate dimension, and the cell size.

[0125] Here, if the dot matrix starting point position is pre-specified, the coordinates of the grid starting point are the dot matrix starting point position. If the dot matrix starting point position is not pre-specified, the minimum bounding box coordinates of the component to be filled can be used as the grid starting point. The minimum bounding box coordinates can be, for example, the minimum xyz coordinates of the vertices of each component.

[0126] In specific implementations, the coordinate range in each coordinate dimension can be determined based on the component size in each coordinate dimension and the coordinate values ​​of the grid starting point in each coordinate dimension. The coordinate range in each dimension is used as the global grid range. For example, the size in each coordinate dimension can be subtracted from the value of the coordinate of the grid starting point in the corresponding coordinate dimension to obtain the global grid range in each coordinate dimension. Then, by dividing the global grid range by the cell size and rounding up, the number of grids in each coordinate dimension is obtained. The number of grids in each coordinate dimension is the grid size of the global grid unit.

[0127] S102-3: Determine the grid coordinate array according to the number of grids and cell size in each coordinate dimension.

[0128] In specific implementations, the coordinate values ​​of each grid cell in each coordinate dimension can be determined based on the number of grid cells in each coordinate dimension and the cell size in each coordinate dimension. Based on the coordinate values ​​of each grid cell in each coordinate dimension, a grid coordinate array (xArray, yArray, zArray) is generated.

[0129] In this way, according to the component size, grid starting point and cell size, the grid initialization for the component to be filled can be achieved, and the grid coordinate array (xArray, yArray, zArray) of the global grid cell can be obtained.

[0130] S103: Divide the global grid unit according to the number of blocks, the coordinate dimension of the largest grid unit, and the grid coordinate array to obtain a sub-coordinate array corresponding to each grid unit block; each grid unit block includes at least one grid unit.

[0131] Here, the number of blocks is used to indicate the number of grid cell blocks obtained after the grid cell is divided into blocks. The number of blocks can be set according to the processing capability of the thread. For example, when the thread can process a file of 1GB in size, the number of blocks can be determined according to the size of 1GB. The coordinate dimension with the most grid cells is the dimension with the largest number of grid cells. For ease of description, this dimension will be defined as the longest dimension below. After dividing the global grid cells, the number of grid cells on each coordinate dimension can also be obtained, and the longest dimension can be determined based on this number. It can be understood that the number of blocks is between 1 and the number of grid cells on the longest dimension.

[0132] A grid cell block may include at least one grid cell, and the sub-coordinate array includes the cell coordinates of each grid cell in the grid cell block.

[0133] In specific implementations, the grid cells in the coordinate dimension with the most grid cells can be evenly divided according to the number of blocks along the longest dimension to obtain grid cell blocks. The grid cells in coordinate dimensions other than the longest dimension remain unchanged. For example, if the longest dimension is Y, the grid cells in dimension Y can be evenly divided according to the number of blocks to obtain grid cell blocks. Each grid cell block includes grid cells in the X and Z dimensions.

[0134] Among them, when evenly dividing, if the number of grid cells on the longest dimension can divide the number of blocks, the number of grid cells in each obtained grid cell block is the same; if the number of grid cells on the longest dimension cannot divide the number of blocks, the last grid cell block in each obtained grid cell block will include the grid cells remaining after the division.

[0135] It is understandable that the grid cells on the coordinate dimension with the most grid cells can also be non-uniformly divided on the longest dimension according to the number of blocks to obtain grid cell blocks; wherein, the non-uniform division requires specifying the block size of each grid cell block and the starting point position of each grid cell block.

[0136] After obtaining each grid cell block, for each grid cell block, the subarray corresponding to the grid cell block can be extracted from the grid coordinate array (xArray, yArray, zArray) based on its starting offset and number of grid cells in the longest dimension. For example, for each grid cell block, one cell corresponds to one grid cell. Assuming that the number of grid cells in the longest dimension is longestDim, the number of grid cells n = longestDim / parts contained in each grid cell block in this dimension is determined based on the number of blocks parts. All grid cell blocks in the other two dimensions are the same. Assuming that the longest dimension is Y, that is, the yArray array will be divided into different grid cell blocks, and each grid cell block of xArray and zArray must be copied. For the first grid cell block of yArray, the offset is 0 at this time, and the extraction array index is 0 to n-1. The offset of the next grid cell block is = n, and the extraction array index is n to 2n, ..., and so on, until the last grid cell block. For the number of grid cells in the last block, if longestDim is divisible by parts, then the number of grid cells in the last block is also n. If it is not divisible, then the number of grid cells in the last block is longestDim%parts.

[0137] Steps S102 and S103 prepare data for subsequent operations. Based on the component's size characteristics, the longest dimension is selected as the basis for division to obtain individual grid cells. This helps optimize the subsequent parallel computing strategy for each grid cell. This approach enables more efficient and balanced parallel processing, ensuring full utilization of computing resources and improving overall computing performance.

[0138] S104: filling cells to be used in each grid unit block according to the sub-coordinate array and cell information to obtain a filled component.

[0139] Here, the filled component is a component to be filled with cells to be used.

[0140] In a specific implementation, after obtaining each grid cell block, multiple threads can be used to parallel fill each grid cell block. Specifically, for each grid cell block, threads equal in number to the number of grid cells in the grid cell block can be used to perform cell filling on each grid cell in the grid cell block based on the sub-coordinate array and cell information to obtain filled grid cells. Filled grid cell blocks are then obtained based on each filled grid cell, and filled components are obtained based on each filled grid cell block.

[0141] For example, whether to fill the grid cell can be determined based on the cell coordinates of each grid cell in the sub-coordinate array. If so, the cells to be used are tiled in the grid cell and the cell parts exceeding the grid cell are removed based on the cell vertex information and cell patch information in the cell information of the cells to be used, thereby obtaining the filled grid cell.

[0142] In this way, the component to be filled is first globally partitioned according to the coordinate information of the component vertices in the component information and the cell size of the cells to be used. This can be used to divide the global grid cells that match the entire component to be filled, completing the initial division of the component to be filled. Then, by performing a secondary division of the global grid cells, the cell filling task of the component to be filled can be divided into sub-filling tasks for the individual grid cell blocks that make up the component to be filled. Finally, by filling each grid cell block in blocks, parallel computing of the component to be filled can be achieved, thereby shortening the component filling time and improving the component filling efficiency.

[0143] In one embodiment, the above S104 can be implemented according to the following steps:

[0144] S104 - 1 : Determine the vertex label of each cell vertex in the cell to be used according to the cell vertex information in the cell information.

[0145] Here, the boundary of a cell to be used can be a Figure 2The cube shown has six faces (i.e., X=0, X=1, Y=0, Y=1, Z=0, Z=1), 12 edges (0-11), and eight corners (0-7). The vertex label indicates the position of the cell's vertices in three-dimensional space. This label can be an 8-bit unsigned number, with the lower six bits (i.e., bits 0-5, Z1|Z0|Y1|Y0|X1|X0) representing the position of the cell's vertices in three-dimensional space. Each two bits represent the direction of a coordinate axis.

[0146] In a specific implementation, for a cell to be used, each cell vertex of the cell to be used may be traversed in sequence, and for the currently traversed cell vertex, the vertex label of the cell vertex may be determined based on the vertex information of the cell vertex indicated in the cell vertex information. For example, based on the vertex information of the cell vertex, the coordinate value in each coordinate dimension may be checked to see if it is 0 or 1. If so, the bit at the corresponding position of the vertex label may be set to 1.

[0147] For example, vertex labels are calculated based on vertex information and can be used to subsequently calculate offsets for boundary faces, edges, and corners. This information can then be used to determine whether to remove these boundaries during subsequent cell tiling. The offsets can be understood as the ordinal numbers corresponding to boundary faces, edges, and corners, as described below. Specifically, for the cell to be used, each vertex can be traversed. For each vertex (i ranging from 0 to the number of vertices - 1), its vertex label is initialized to 0. The six attribute indices of the vertex (j ranging from 0 to 5) are traversed, and label values ​​are set based on the vertex information of the cell to be used. For example, the dimension dim = j / 2 of the current attribute is calculated. The i-th vertex of the cell to be used is checked to see if it is equal to j%2 in this dimension. If so, the j-th bit of the vertex label is set to 1; otherwise, the j-th bit of the vertex label is set to 0. For example, if the vertex information of a cell vertex is (0, 0.5, 1), the vertex label for this vertex can be 0b100001.

[0148] S104-2: Determine the cell boundary information of the cell to be used and the face labels of each cell face of the cell to be used according to the vertex label of each cell vertex; the cell boundary information is used to indicate the associated boundary face, associated boundary edge and associated angle of each cell vertex.

[0149] Here, the cell boundary information boundary is used to indicate the cell vertices included on each boundary surface corresponding to the cell to be used, the cell vertices included on each boundary edge, and the cell vertices corresponding to each corner point. The cell surface can be each triangular facet of the cell to be used.

[0150] The associated boundary surface of the cell vertex is the boundary surface where the cell vertex is located, the associated boundary edge of the cell vertex is the boundary edge where the cell vertex is located, and the associated angle of the cell vertex is the corner point where the cell vertex is located.

[0151] In a specific implementation, for each cell vertex in the cell to be used, the various boundary faces on which the cell vertex is located can be determined based on the vertex label of the cell vertex, and these boundary faces are used as the associated boundary faces of the cell vertex. At the same time, the local vertex index of the cell vertex in the cell to be used is stored in the vertex index array corresponding to the face numbers of these boundary faces. At the same time, the various boundary edges on which the cell vertex is located can be determined based on the vertex label of the cell vertex, and these boundary edges are used as the associated boundary edges of the cell vertex. At the same time, the local vertex index of the cell vertex in the cell to be used is stored in the vertex index array corresponding to the edge numbers of these boundary edges. Furthermore, based on the vertex label of the cell vertex, a corner point on which the cell vertex is located is determined and this corner point is used as the associated angle of the cell vertex. At the same time, the local vertex index of the cell vertex in the cell to be used is used as the angle number of the associated angle. Among them, a vertex cell has at most three associated boundary faces, belongs to at most three associated boundary edges, and can only belong to one associated angle. Then, the cell boundary information of the cell to be used can be determined based on the vertex index array corresponding to the face number of each boundary face of the cell to be used, the vertex index array corresponding to the edge number of each boundary edge, and the angle number of each corner.

[0152] For ease of understanding, the above steps for determining cell boundary information can be understood as: traversing all cell vertices to be used, screening and classifying them, and classifying them according to their position on the boundary. Because each boundary surface can have multiple cell vertices, each edge can also have multiple cell vertices, and a corner point can only have one cell vertex, if the cell vertex belongs to a boundary surface or boundary edge, it is added to the corresponding vertex index array for storage; if the cell vertex is a corner point, the corner point number is directly assigned to the vertex index of the cell vertex.

[0153] At the same time, for each cell face of the cell to be used, the face label of the cell face can be determined according to the vertex labels of each cell vertex on the cell face.

[0154] In one embodiment, the above S104-2 may be implemented according to the following steps:

[0155] S104-2-1: Based on the dimension values ​​of the vertex labels in each coordinate dimension, predict the boundary face number, boundary edge number, and corner number associated with the cell vertex.

[0156] In specific implementation, each cell vertex of the cell to be used can be traversed. For the currently traversed cell vertex, the numbers of the boundary faces, the numbers of the boundary edges, and the number of an associated angle associated with the cell vertex can be determined based on the values ​​of the vertex label of the cell vertex in each coordinate dimension. Among them, the numbers of the boundary faces associated with the cell vertex can be determined according to the following steps:

[0157] Traverse the values ​​of the vertex labels of the cell vertices in each coordinate dimension. For the currently traversed coordinate dimension, if the value of the coordinate dimension is not 0 or 1, it means that there is no associated boundary surface in the coordinate dimension. If the value of the coordinate dimension is 0 or 1, the associated boundary surface serial number = 2*dim+h can be determined, where dim is the set value corresponding to the currently traversed coordinate dimension, where the set value of the X dimension is 0, the set value of the Y dimension is 1, and the set value of the Z dimension is 2. h represents the high-order flag of the currently traversed coordinate dimension, where the high-order flag is used to indicate whether it is the maximum boundary or the minimum boundary, for example, 0 represents the minimum boundary and 1 represents the maximum boundary. By traversing each coordinate dimension, the serial numbers of the various boundary surfaces associated with the cell vertex can be determined, that is, the various associated boundary surfaces where the cell vertex is located can be determined. Among them, a cell vertex is located at most three associated boundary surfaces.

[0158] The sequence numbers of the boundary edges associated with the cell vertices can be determined by following the steps below:

[0159] Traverse the values ​​of the vertex labels of the cell vertices in each coordinate dimension. For the currently traversed coordinate dimension, determine whether the values ​​in the other two coordinate dimensions are 0 or 1. If not, it means that there is no associated boundary edge in this coordinate dimension. If so, the associated boundary edge sequence number can be determined = dim*4+hj*2+hi, where hj and hi are the high-order flags of the other two coordinate dimensions. By traversing each coordinate dimension, the sequence numbers of the boundary edges associated with the cell vertex can be determined, that is, the associated boundary edges on which the cell vertex is located can be determined. Among them, a cell vertex is located on at most three associated boundary edges.

[0160] For the corner number associated with the cell vertex, the corner number = 4*h2+2*h1+h0, where h2 is the high-order flag of the Z dimension, h1 is the high-order flag of the Y dimension, and h0 is the high-order flag of the X dimension. A cell vertex can only be or not be a corner point, that is, a cell vertex is associated with at most one corner point.

[0161] S104-2-2: Determine the associated boundary face, associated boundary edge, and associated angle of the cell vertex according to the boundary face sequence number, boundary edge sequence number, and angle sequence number.

[0162] S104-2-3: Determine cell boundary information according to the associated boundary faces, associated boundary edges, and associated angles of each cell vertex.

[0163] In specific implementation, based on the above S104-2-1, the boundary face sequence number, boundary edge sequence number, and angle sequence number associated with each cell vertex can be determined. Then, for each boundary face, the cell vertices included in the boundary face can be determined based on the face sequence number of the boundary face and the boundary face sequence number associated with each cell vertex (that is, the associated boundary faces of each cell vertex are determined), and the local vertex indexes of these cell vertices in the cell to be used are stored in the vertex index array corresponding to the face sequence number of the boundary face. For each boundary edge, the cell vertices included in the boundary edge can be determined based on the edge sequence number of the boundary edge and the boundary edge sequence number associated with each cell vertex (that is, the associated boundary edges of each cell vertex are determined), and the local vertex indexes of these cell vertices in the cell to be used are stored in the vertex index array corresponding to the edge sequence number of the boundary edge. For each corner point, we can determine the cell vertex at each corner point based on the corner numbers associated with each cell vertex and the corner number of each corner point. We then use the local vertex index of the cell vertex in the cell to be used to update the corner number of each corner point. This yields the vertex index arrays for the six boundary faces (X=0, X=1, Y=0, Y=1, Z=0, Z=1), the vertex index arrays for the 12 boundary edges, and the vertex indices for the eight corner points, effectively obtaining the cell boundary information for the cell to be used.

[0164] S104-2-4: Perform an AND operation on the vertex labels of each cell vertex included in each cell face to obtain a face label of each cell face.

[0165] In a specific implementation, for each cell face to be used, the vertex labels of the cell vertices included in the cell face can be ANDed together to obtain the face label of the cell face. That is, face label = v0 & v1 & v2, where v0, v1, and v2 represent the vertex labels of the three cell vertices on the cell face.

[0166] S104-3: For any grid cell block, traverse each grid cell in the grid cell block and determine the fill flag of the currently traversed grid cell; the fill flag is used to indicate whether the grid cell needs to be filled with cells to be used.

[0167] Here, the fill flag is used to indicate whether the grid cell needs to be filled with unused cells, that is, to indicate the fill status of the grid cell. Specifically, the fill flag can include two values, one for indicating that the grid cell needs to be filled, and the other for indicating that the grid cell does not need to be filled. Exemplarily, the two values ​​can be 0 and 1, where 0 can indicate that it does not need to be filled, and 1 can indicate that it needs to be filled.

[0168] Among them, when filling each grid cell block in parallel, concurrent processing can also be used for each grid cell in any grid cell block, and each thread processes the calculation of the fill flag of a grid cell, wherein the calculation of the fill flag of each grid cell is also independent. After obtaining the fill flag of each grid cell, the fill flag can be added to the flag array corresponding to the grid cell block, so as to be used in subsequent filling. In specific implementation, for any grid cell in any grid cell block, the signed distance function (SDF) value of the grid cell can be determined based on the cell coordinate of the grid cell in the sub-coordinate array, and the fill flag of the grid cell can be determined based on the size of the value.

[0169] When filling cells to be used, for any grid cell block, each grid cell in the grid cell block can be traversed and the fill flag of the currently traversed grid cell can be determined from the flag array corresponding to the grid cell block. Alternatively, the fill flag of each grid cell in the grid cell block can be determined using the above steps when traversing each grid cell in the grid cell block.

[0170] In one embodiment, the step of "determining the fill flag of the grid unit" in S104-3 can be implemented according to the following steps T1 to T4:

[0171] T1: Sample the grid cells in each coordinate dimension according to the number of sampling points set in each coordinate dimension to obtain the sampling point coordinates of each sampling point in each coordinate dimension.

[0172] Here, the number of sampling points may be a preset number of points, and the number of sampling points set in each coordinate dimension may be the same or different, which is not limited in this application.

[0173] In a specific implementation, for any grid cell in any grid cell block, sampling can be performed on each coordinate dimension according to the number of sampling points set in each coordinate dimension to obtain sampling points in each coordinate dimension. Then, for each sampling point in each coordinate dimension, the sampling point coordinates of each sampling point in that coordinate dimension are determined.

[0174] T2: For each coordinate dimension, normalize the sampling point coordinates of each sampling point in the coordinate dimension to obtain the normalized coordinates of each sampling point.

[0175] In a specific implementation, for each coordinate dimension, the sampling point coordinates of each sampling point in the coordinate dimension can be normalized to a range of 0-1, thereby obtaining the normalized coordinates of each sampling point. In this way, normalization will obtain a mapping relationship between the sampling points in each grid cell and the three-dimensional space. Based on this mapping relationship, the normalized coordinates of the sampling points can be mapped to the actual three-dimensional space.

[0176] T3: Determine the target coordinates of each normalized coordinate in the 3D world coordinate system based on the grid starting coordinates.

[0177] Here, the grid starting coordinates may be the coordinates of the lower left corner of the grid unit, or the starting coordinates of the global grid unit.

[0178] In specific implementation, the normalized coordinates of each sampling point in each coordinate dimension can be mapped to the actual three-dimensional space according to the grid starting coordinates, and the target coordinates of each normalized coordinate in the three-dimensional world coordinate system can be obtained.

[0179] T4: Determine the fill flag of the grid cell according to the coordinates of each target.

[0180] In a specific implementation, the SDF value of each sampling point of the grid cell can be calculated. If the SDF value of at least one sampling point is less than 0, the fill flag of the grid cell is determined to be 1; conversely, if the SDF values ​​of all sampling points are less than or equal to 0, the fill flag of the grid cell can be determined to be 0.

[0181] Then, according to the fill flags of the respective grid cells in the grid cell block, a flag array corresponding to the grid cell block can be obtained.

[0182] S104-4: If the fill flag is the preset flag, the cell to be used is filled into the grid unit, and the filling information of the filled grid unit is determined based on the cell boundary information, the face label of the cell to be used and the parity of the cell coordinates of the currently traversed grid unit in the sub-coordinate array.

[0183] Here, the filling information is used to indicate the vertex information, patch information, etc. of the cells to be used after the cells to be used are filled into the grid cell. For example, the filling information may include information such as the boundary faces and cell faces that are retained after the cells to be used are filled into the grid cell, the retained boundary edges, the retained corner points, the retained cell vertices, the order of vertices on the retained boundary faces, and the global vertex coordinates of the retained cell vertices. The preset flag bit may be a flag bit indicating that the grid cell needs to be filled.

[0184] For example, if the fill flag of the currently traversed grid cell is 1, the cells to be used can be tiled to the grid cell, and the cell information is adjusted based on the cell boundary information, face label, and the parity of the cell coordinates of the currently traversed grid cell in the sub-coordinate array to improve the consistency and seamless connection of different grid cells after filling, and avoid the generation of redundant faces. Among them, adjusting the cell information can include adjusting the vertex coordinates of cell vertices, adjusting the vertex order of cell vertices on the cell face, and eliminating shared faces, shared edges, and shared corners of the cells to be used filled in adjacent grid cells.

[0185] In one embodiment, the step of determining the filling information in S104-4 above may be implemented as follows:

[0186] S104-4-1: According to the parity of the cell coordinates of the grid cell in each coordinate dimension, the local vertex coordinates of the cell vertex of the cell to be used in the cell to be used are adjusted and converted to the global coordinate system to obtain the global vertex coordinates of the cell vertex.

[0187] During specific implementation, for any grid cell currently traversed, vertex coordinate transformation processing can be performed on the grid cell to obtain global vertex coordinates. For example, the coordinate dimensions with odd coordinate values ​​can be determined based on the parity of the coordinate values ​​of the grid cell's cell coordinates in each coordinate dimension. For each coordinate dimension with an odd coordinate value, the local vertex coordinates of each cell vertex of the cell to be used in the coordinate dimension are flipped. For example, if the coordinate value of the grid cell in the X dimension is an odd number, the local vertex coordinates of the cell to be used in the X dimension are X0, which will become 1-X0 after flipping, and the flipping of other coordinate dimensions is the same. Among them, the local vertex coordinates are the coordinates of the cell vertex in the cell coordinate system of the cell to be used. For ease of understanding, the local vertex coordinates can be understood and replaced with the normalized cell vertex coordinates. During the grid tiling process, the main things stored are vertices V and faces F (a face is represented by a combination of three vertex indices). These V and F are composed of the vertices and faces of the cells to be used tiled in the grid units. In addition to mapping the local vertex coordinates of the cells to be used to the global vertex coordinates, the cell boundary information and face labels are also used to determine which faces are culled and do not need to be added to F, and which cell vertices have been stored and do not need to be added to V, thereby avoiding the storage of a large number of duplicate faces and vertices.

[0188] If the coordinate values ​​of the cell coordinates of the grid cell in each coordinate dimension are all even numbers, the local vertex coordinates of each cell vertex of the cell to be used in each coordinate dimension can be used as the initial vertex coordinates of each cell vertex. If the coordinate values ​​of the cell coordinates of the grid cell in at least one coordinate dimension are odd numbers, the local vertex coordinates of each cell vertex of the cell to be used in these coordinate dimensions can be flipped, and the initial vertex coordinates of each cell vertex of the cell to be used can be determined based on the flipped local vertex coordinates and the unflipped local vertex coordinates. After obtaining the initial vertex coordinates, the initial vertex coordinates can be converted from the cell coordinate system of the cell to be used to the global coordinate system corresponding to the component to be filled, and the global vertex coordinates of the cell to be used in the global coordinate system can be obtained. The global coordinate system can be a three-dimensional world coordinate system.

[0189] For example, local vertex coordinates are generally normalized to the range of 0-1, and the initial vertex coordinates are also in the range of 0-1. Multiplying the initial vertex coordinates by the cell size of the corresponding dimensions gives the relative vertex offsets of the vertices of the cell to be used. Then, by adding the vertex offsets of each cell vertex to the cell coordinates of the current grid cell, the actual positions of the vertices of the cell to be used in this grid cell can be obtained, that is, the global vertex coordinates of the vertices of the cell to be used in this grid cell can be obtained.

[0190] S104-4-2: Determine the target cell face having neighboring grid cells based on the face label of each cell face and the parity of the cell coordinates in each coordinate dimension.

[0191] S104-4-3: Performing a face culling operation on the cell to be used according to the fill flags of the neighboring grid cells of the target cell face, and obtaining each retained cell face of the cell to be used.

[0192] Here, the neighboring grid cell is the neighboring cell of the currently traversed grid cell.

[0193] In specific implementation, for the currently traversed grid unit, the faces of the cells to be used filled in the grid unit can be culled to eliminate the cells to be used in the grid unit and the cell faces shared with the cells to be used filled in the neighboring grid units, thereby avoiding the repeated generation of cell faces and finally obtaining the face information of the grid unit.

[0194] Specifically, each cell face of the cell to be used can be traversed, and for the currently traversed cell face, the associated boundary face of the cell face can be determined based on the face label of the cell face. That is, based on the face label, it can be determined whether the cell face is located on the boundary face at X=0, the boundary face at X=1, the boundary face at Y=0, the boundary face at Y=1, the boundary face at Z=0, or the boundary face at Z=1.

[0195] Then, the coordinates of the neighboring grid cells are dynamically calculated, that is, based on the face sequence number of the associated boundary surface of the cell face, the sequence number of the neighboring grid cells in the coordinate dimension corresponding to the associated boundary surface is determined. For example, if the associated boundary surface of the cell face is face 0 and the cell coordinates of the current grid cell in the coordinate dimension corresponding to the associated boundary surface are odd, or if the associated boundary surface of the cell face is face 1 and the cell coordinates of the grid cell in the coordinate dimension corresponding to the associated boundary surface are even, then it can be determined that the face sequence number of the neighboring cell grid of the cell face in the coordinate dimension corresponding to the associated boundary surface = the face sequence number of the associated boundary surface + 1; otherwise, it can be determined that the face sequence number of the neighboring cell grid of the cell face in the coordinate dimension corresponding to the associated boundary surface = the face sequence number of the associated boundary surface - 1. Among them, taking the case that the associated boundary surface of the current grid cell is face X=0, the coordinate dimension corresponding to the current grid cell in the associated boundary surface is the X dimension.

[0196] Then verify the existence of the neighboring grid cells, that is, determine whether the face sequence number of the neighboring cell grid of the cell face in the coordinate dimension corresponding to the associated boundary face is within the grid range of the currently traversed cell face, and determine whether the fill flag of the neighboring cell grid is a preset flag. If it is determined that the face sequence number is within the grid range of the currently traversed cell face and the fill flag of the neighboring cell grid is a preset flag, it can be determined that the cell face is a target cell face with a neighboring grid cell, and the target cell face is eliminated to avoid repeated generation of faces. If it is determined that the face sequence number is not within the grid range of the currently traversed cell face, and / or the fill flag of the neighboring cell grid is not a preset flag, it can be determined that the cell face is a reserved cell face with no neighboring grid cells. In this way, by traversing each cell face of the to-be-used cell in sequence, it is possible to determine and eliminate the target cell faces that need to be eliminated when the to-be-used cell is tiled to the currently traversed grid cell, obtain a face list corresponding to each reserved cell face, and use this face list as the face list of the currently traversed grid cell.

[0197] S104-4-4: According to the parity of the unit coordinates of the grid unit in each dimension, the vertex order of each cell vertex on each retained cell face is adjusted to obtain an adjusted vertex order.

[0198] In specific implementation, after obtaining each retained cell face, the vertex order of the retained cell face can be adjusted. Specifically, according to the parity of the cell coordinates of the grid unit in each coordinate dimension, the vertex order of the retained cell face is swapped to ensure that after the vertex coordinates are mirrored, the normal direction of the triangle face still conforms to the preset direction rule. For example, if the cell coordinates of the grid unit are odd in a certain dimension, the original vertex order of the retained cell face can be adjusted to obtain the correct vertex order. For example, if the original vertex order is abc, it can be adjusted to bac to ensure that the normal vector of the retained cell face is reversed.

[0199] S104-4-5: Determine filling information of the filled grid unit according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information.

[0200] In specific implementation, the cells to be used that need to be filled in the currently traversed grid unit can be tiled in the currently traversed grid unit based on the global vertex coordinates of each cell vertex and the adjusted vertex order of the cell face, and the filling information of the filled grid unit can be determined based on the cell boundary information of the cells to be used and the tiling results.

[0201] In one embodiment, the present application also needs to address the boundary sharing issue between adjacent grid cells to avoid duplicate allocation of shared vertices. Specifically, the shared boundaries (faces, edges, corners) of adjacent cells to be used are checked and vertex indices are mapped to avoid duplicate creation. Specifically, for the above S104-4-5, the following steps can also be implemented:

[0202] S104-4-5-1: Taking the grid cell as the center, traverse each neighboring grid cell of the grid cell.

[0203] In specific implementation, for the currently traversed grid cell, each neighboring grid cell can be identified and traversed in sequence, with the cell coordinates (x, y, z) of the grid cell as the center. The neighboring grid cells are the 26 grid cells (x+dx, y+dy, z+dz) surrounding the currently traversed grid cell, where the values ​​of dx, dy, and dz are all in the range of [-1, 0, 1].

[0204] S104-4-5-2: Store the cell boundary information in the grid unit boundary array and create a vertex index array for the grid unit; the vertex index array is used to store the mapping relationship between the local vertex index of each cell vertex in the grid unit to be used and the default global vertex index.

[0205] Here, after obtaining the cell boundary information of the cells to be used, a grid cell boundary array, boundaries, can be initialized. The array is initially empty. As the grid cells are continuously traversed and the cells to be used are continuously filled into the grid cells, the array can gradually store the cell boundary information of each cell to be used filled into the grid cell. That is, as the cells to be used are continuously tiled into each grid cell, the array needs to store the cell boundary information of each grid cell to achieve independent cell boundary information storage for each grid cell. The amount of cell boundary information stored in the grid cell boundary array, boundaries, is related to the number of grid cells that need to be filled corresponding to the component to be filled.

[0206] The default global vertex index can be a preset index in the global coordinate system that is set for each cell vertex when the vertex index array is created for the mesh unit. For example, the default global vertex index can be -1. The default global vertex index corresponding to each array in the vertex index array is -1. The default global index corresponding to each array will be updated later when shared boundaries are determined and unmapped cell vertices are added to the global vertex set.

[0207] In a specific implementation, for the currently traversed grid cell, if the fill flag of the grid cell is set to the preset flag, the cell boundary information boundary determined for the grid cell based on S104-2 above can be stored in the grid cell boundary array boundaries. Furthermore, a vertex index array newVertexIndex can be created for the grid cell. The length of this array is the same as the number of cell vertices. This array is used to record the mapping relationship between the local vertex index of the currently used cell and the default global vertex index. In other words, the vertex index array is used to store the mapping relationship between the local vertex index of each cell vertex in the currently used cell and the default global vertex index. The global vertex index is the vertex index in the three-dimensional world coordinate system. Neighboring grid cell shared boundary determination is used to update the global index of the final merged grid vertex to avoid repeated storage of the same vertex. The local vertex indices corresponding to the faces, edges, and corners of the currently used cell are found and stored from the cell boundary information. This is used to calculate the face label and update the global vertex index when determining the shared boundary, thereby facilitating rapid determination during the grid merging process.

[0208] S104-4-5-3: Obtain the cell boundary information of the currently traversed neighboring grid cell from the grid cell boundary array, and determine the boundary type and boundary sequence number of the shared boundary between the grid cell and the currently traversed neighboring grid cell based on the cell boundary information of the grid cell and the cell boundary information of the currently traversed neighboring grid cell.

[0209] During specific implementation, for the currently traversed grid cell, each neighboring grid cell of the grid cell can be traversed in sequence. For the currently traversed neighboring grid cell, it can be determined whether the cell boundary information (i.e., neighborBoundary) of the currently traversed neighboring grid cell exists in the grid cell boundary array boundaries. If not, the next neighboring grid cell can be traversed directly. If so, the cell boundary information neighborBoundary of the currently traversed neighboring grid cell can be obtained. Based on the cell boundary information Boundary of the currently traversed grid cell and the cell boundary information neighborBoundary of the currently traversed neighboring grid cell, the shared boundaries between the currently traversed grid cell and the currently traversed neighboring grid cell, as well as the boundary type and boundary sequence number of each shared boundary, are determined. Among them, the shared boundary type can include a shared boundary surface type, a shared boundary edge type, and a shared corner point type.

[0210] S104-4-5-4: Update the corresponding mapping relationship of the cell vertices on the shared boundary in the vertex index array according to the boundary type and the target global vertex index of the cell vertices on the shared boundary indicated by the boundary sequence number, and obtain the updated vertex index array.

[0211] Here, the vertex index array corresponding to the cell vertex on the shared boundary is the vertex index array of the neighboring grid cell where the shared boundary is located. The target global vertex index can be the global vertex index stored in the vertex index array of the neighboring grid cell where the shared boundary is located. Since each cell vertex in the neighboring grid cell may already be in the constructed global vertex set, the target global vertex index of the cell vertex on the shared boundary is also the index of the cell vertex in the constructed global vertex set.

[0212] Specifically, the cell boundary information neighborBoundary of the neighboring grid cell stores: the mapping relationship between the local vertex index of each cell vertex of the cell to be used filled by the neighboring grid cell and the target global vertex index in the grid cell. After determining the boundary type and boundary sequence number of the shared boundary, the mapping relationship of the cell vertices on the shared boundary in the cell boundary information Boundary of the currently traversed grid cell in the newVertexIndex of the grid cell can be updated to the mapping relationship of the cell vertices on the shared boundary in the neighboring grid cell in the neighborBoundary, thereby using the target global vertex index of the cell vertex on the shared boundary to replace the default global vertex index of the cell vertex in the newVertexIndex of the grid cell, and obtain the updated newVertexIndex of the grid cell. For example, first determine the shared boundary type. If the location index of a neighboring grid cell is offset from the location index of the current grid cell in only one coordinate dimension, i.e., they are adjacent in one coordinate dimension and have the same index values ​​in the remaining coordinate dimensions, then the shared boundary type between the current grid cell and the neighboring grid cell can be determined to be a shared boundary surface type. If the location index of the neighboring grid cell is adjacent to the location index of the current grid cell in two coordinate dimensions, then the shared boundary type between the current grid cell and the neighboring grid cell can be determined to be a shared boundary edge type. If the location index of the neighboring grid cell is adjacent to the location index of the current grid cell in three coordinate dimensions, then the shared boundary type between the current grid cell and the neighboring grid cell can be determined to be a shared corner type. Adjust the search direction. Specifically, if the cell coordinates in the coordinate dimension are odd, then flip the search direction. For example, if the cell coordinates in the X dimension are odd, then dx = -dx, and the same applies to the other dimensions. Here, since the local vertex coordinates of the cell to be used in the odd dimension are mirrored during the above-mentioned vertex coordinate adjustment process, the cell coordinates in the odd dimension need to be reversed to match the local vertex index stored in the cell boundary information (that is, to match the normalized cell vertex coordinates). The boundary sequence number of the shared boundary is calculated based on the shared boundary type: if the shared boundary type is a shared boundary face type, the coordinate dimension dim with the offset is found, and the face sequence number of the shared boundary face is determined based on the coordinate dimension dim = 2*dim+(d[dim]>0), where if the coordinate dimension dim with the offset is the X dimension, d[dim] means dx=d[0]; if the coordinate dimension dim with the offset is the Y dimension, d[dim] means dy is d[1]; if the coordinate dimension dim with the offset is the Z dimension, d[dim] means dz is d[2].If the shared boundary type is a shared boundary edge type, determine the dimension dim of the shared boundary edge's axis, and calculate the edge index of the shared boundary edge based on the dimension dim of the edge axis: dim*4+(d[j]>0)*2+(d[i]>0); where dim is the value corresponding to the dimension dim of the edge axis, and d[j] and d[i] represent the values ​​corresponding to the two coordinate dimensions with offsets. If the shared boundary type is a shared corner point type, determine the corner index of the shared corner point: 4*(dz>0)+2*(dy>0)+(dx>0), where dz, dx, and dy represent the values ​​corresponding to the Z, X, and Y dimensions with offsets, respectively.

[0213] Then, based on the obtained shared boundary type and the boundary sequence number of the shared boundary, the vertex index array newVertexIndex of the currently traversed grid unit can be readjusted to ensure that the shared boundaries of the two grid units reference the same global vertex index to avoid repeated generation. Specifically, if it is a shared boundary surface, the mapping relationship of all cell vertices on the shared boundary surface of the currently traversed grid unit in the vertex index array newVertexIndex can be updated to the mapping relationship of all cell vertices on the shared boundary surface in the neighboring grid unit, that is, the default global vertex index of all cell vertices on the shared boundary surface of the currently traversed grid unit is mapped to the target global vertex index of the corresponding shared boundary surface of the neighboring grid unit, ensuring that both reference the same global vertex index. If it is a shared boundary edge, the mapping relationship of all cell vertices on the shared boundary edge of the currently traversed grid unit in the vertex index array newVertexIndex can be mapped to the mapping relationship of all cell vertices on the shared boundary edge in the neighboring grid unit, that is, the default global vertex index of all cell vertices on the shared boundary edge of the currently traversed grid unit is mapped to the target global vertex index of the corresponding shared boundary edge of the neighboring grid unit, ensuring that the vertex indexes at the shared boundary edge are consistent. If it is a shared corner point, the mapping relationship of the cell vertices on the shared corner point in the neighboring grid unit can be assigned to the mapping relationship of the cell vertices on the shared corner point of the currently traversed grid unit in the vertex index array newVertexIndex, that is, the target global vertex index of the cell vertex on the shared corner point in the neighboring grid unit is assigned to the default global vertex index of the corresponding corner point of the currently traversed grid unit, ensuring that the global vertex indexes of the corner point positions are consistent.

[0214] In this way, based on the shared boundary with the neighboring grid cells, the vertex index array newVertexIndex of the currently traversed grid cell can be updated to obtain an updated vertex index array.

[0215] S104-4-5-5: Determine the filling information of the filled grid unit according to the updated vertex index array, the global vertex coordinates and the adjusted vertex order.

[0216] In specific implementation, the cell information of the cells to be used filled in the grid unit can be determined based on the updated vertex index array, adjusted vertex coordinates, retained cell faces and adjusted vertex order, thereby obtaining the filling information of the filled grid unit.

[0217] In one embodiment, the above S104-4-5-5 can be implemented according to the following steps:

[0218] S104-4-5-5-1: Determine the unmapped cell vertices in the cell to be used based on whether the mapping relationship of the cell vertices is adjusted, and add the unmapped cell vertices to the constructed global vertex set based on the global vertex coordinates of the unmapped cell vertices, and adjust the mapping relationship of the unmapped cell vertices in the updated vertex index array using the order in which the unmapped cell vertices are added to obtain an adjusted vertex index array; the adjusted vertex index array is used to update the vertex index arrays of other grid cells when the grid cell serves as a neighbor grid cell of other grid cells.

[0219] Here, the purpose of cell tiling is to obtain the vertices V and patches F after the lattice is filled. Therefore, when tiling each cell to be used, its unmapped cell vertices must be added to V. The same applies to patches. Mapped cell vertices and patches do not need to be stored repeatedly, reducing redundant computation and memory usage. The constructed global vertex set is the vertex set consisting of the cell vertices corresponding to each currently filled grid cell. Unmapped cell vertices are cell vertices that are not on the shared boundary. The updated vertex index array stores the mapping relationship between the local vertex index and the default global vertex index for each cell. Therefore, after adding unmapped cell vertices to the constructed global vertex set, their mapping relationship must be adjusted to ensure that the mapping relationship of the unmapped cell vertices is consistent in the global coordinate system. The addition order indicates the order in which unmapped cell vertices are added to the constructed global vertex set. This order can be used as the target global vertex index for the unmapped cell vertex to update the default global vertex index of the unmapped cell vertex.

[0220] In specific implementation, after the filling information of the filled grid unit, a grid merging operation can be performed, that is, the cell vertices and cell faces obtained above are merged into the global grid unit, and the mapping relationship of the vertex index is processed at the same time. Among them, when the grid is merged, it only cares about merging local data into the global grid unit, and does not care about how the cell boundary information is stored. Specifically, vertex processing and facet processing can be performed. Vertex processing is: traversing all cell vertices of the currently filled cells to be used, for the currently traversed cell vertex, it can be based on whether the mapping relationship of the cell vertex is adjusted (that is, determining whether the corresponding mapping relationship of the cell vertex in the vertex index array is updated). If not, it can be determined that the currently traversed cell vertex is the unmapped cell vertex retained by the cell to be used, and the unmapped cell vertex is added to the currently constructed global vertex set V and the order of adding the unmapped cell vertices is determined, and an association relationship is established between the adding order and the global vertex coordinates of the unmapped cell vertex. At the same time, the mapping relationship between the local vertex index of the unmapped cell vertices and the default global vertex index stored in the updated vertex index array can be updated to a mapping relationship between the local vertex index of the unmapped cell vertices and the addition order, thereby obtaining an adjusted vertex index array. In the adjusted vertex index array, the mapping relationship between the local vertex index of each cell vertex of the cell to be used and the target global vertex index is stored.

[0221] With respect to the adjusted vertex index array, the vertex index array may update vertex index arrays of other grid cells when the grid cell serves as a neighboring grid cell of the other grid cells.

[0222] If the mapping relationship of the cell vertices has been adjusted, the currently traversed cell vertex can be directly ignored, because the cell vertex has been saved to the constructed global vertex set V when filling the neighboring grid cells, and the global vertex index of the cell vertex can be shared through the vertex index array of the neighboring grid cells.

[0223] S104-4-5-5-2: According to the adjusted vertex order, determine the global vertex index of the retained cell face from the adjusted vertex index array.

[0224] In specific implementation, all the retained cell faces of the cell to be used can be added to the global face set F, and according to the adjusted vertex order of the retained cell faces, the mapping relationship between the local vertex index and the global vertex index of the retained cell faces can be obtained from the adjusted vertex index array, thereby realizing the conversion of the local vertex index of the retained cell faces into the global vertex index, that is, the sharing of the vertex index array between the retained cell faces of the neighboring grid units and the retained cell faces of the currently traversed grid units can be realized.

[0225] For example, the newVertexIndex array stores the global index of the cell vertex. In step S104-4-5-4, newVertexIndex stores the index of the cell vertex that has been stored in the shared boundary judgment (if the neighboring grid unit has this cell vertex, the index is assigned, otherwise it is -1). When merging meshes, the global V and F need to be updated. If it is -1, the vertex coordinates of the cell vertex are added to the global vertex set, and the vertex index stored in newVertexIndex is updated in the order of addition. To update the global patch, since newVertexIndex has been updated, the cell face needs to be adjusted. All cell vertices on all cell faces need to be traversed, and according to the sequence number i of the cell vertex, the vertex index stored in the global face is changed to newVertexIndex[i].

[0226] For example, when initially creating a vertex index array for a grid cell, the default global vertex index corresponding to each array in the vertex index array is -1. For example, each cell vertex in the vertex index array is . Where n is the number of cell vertices. When determining the shared boundary with the neighboring grid cells, if the 0th and n-2th cell vertices are found to be cell vertices on the shared boundary, the default global vertex indexes of the 0th and n-2th cell vertices can be updated based on the target global vertex indexes in the vertex index array of the neighboring grid cells. Assuming that the target global vertex indexes of the 0th and n-2th cell vertices are 100~n+98, after updating the vertex index array of the grid cell using the target global vertex index, the updated vertex index array is . We can then know that the n-1th and nth cell vertices are unmapped vertices, so when adding the n-1th and nth cell vertices to the constructed global vertex set, we can determine that the order of addition is 200 and 201 respectively, and then we can determine that the adjusted vertex index array is .

[0227] S104-4-5-5-3: According to the global vertex index of the retained cell face, the retained cell face is added to the constructed global face set to obtain the filling information of the filled grid unit.

[0228] For example, for the currently traversed grid cell, the reserved cell faces can be added to the currently constructed global patch set based on the global vertex index of the reserved cell vertex corresponding to the to-be-used cell filled in the grid cell. Then, the filling information of the filled grid cell can be determined based on the latest constructed global vertex set and the latest constructed global patch set.

[0229] In one embodiment, after determining the filling information of the filled grid unit, it is also necessary to update the cell boundary information of the currently traversed grid unit. Here, after the grid is merged, the cell boundary information of the currently traversed grid unit can be updated. This is because the vertex index of the cell vertex will be remapped after the grid is merged, so the cell boundary information of the to-be-used cells filled in the currently traversed grid unit must also be mapped synchronously. The step of updating the cell boundary information of the currently traversed grid unit only updates the boundary data of the currently traversed grid unit, does not affect the global grid unit, but provides the correct index for the subsequent shared processing of adjacent grid units.

[0230] Specifically, the cell boundary information of the cells to be used in the grid cell boundary array can be updated according to the adjusted vertex index array. For example, the cell boundary information of each grid cell needs to be stored during the tiling process, and the cell boundary information also needs to be updated after the index is remapped, because when judging the shared boundary with the neighboring grid cell, it is necessary to query the global cell boundary information neighborBoundary of the neighboring grid cell from the boundaries array. Therefore, after determining the adjusted vertex index array of the cell to be used, the cell boundary information boundary determined by the grid cell stored in the grid cell boundary array boundaries can be updated according to the target global vertex index indicated by these adjusted vertex index arrays to obtain the global cell boundary information of the grid cell. Based on the above filling process, the merged vertex V and face F of each grid cell in each grid cell block can be obtained. For example, if the cell boundary information boundary of a corner point of the grid cell stored in the grid cell boundary array boundaries is serial number 0, then the serial number 0 in the cell boundary information of the corner point can be updated to 100 according to the target global vertex index 100 corresponding to the serial number 0 in the adjusted vertex index array.

[0231] This application uses a vertex labeling-based approach, enabling efficient identification of boundary elements through bitwise operations. Vertex order adjustment and mirror flipping ensure the consistency and seamless connection of face normals. Face labels and parity rules are determined through bitwise operations to achieve constant-time complexity (O(1) complexity). Face culling prevents the repeated generation of shared faces between adjacent voxels (cubic grid cells), reducing redundant computation and memory usage while ensuring seamless connection of the generated mesh.

[0232] S104-5: Determine a filled component according to the filling information corresponding to each grid unit.

[0233] In specific implementation, for any grid unit block, the filling information of the grid unit block can be obtained according to the filling information corresponding to each grid unit in the grid unit block, and then the filled components corresponding to the components to be filled can be determined according to the filling information of each grid unit block.

[0234] In one embodiment, the above S104-5 can be implemented according to the following steps:

[0235] S104-5-1: Determine the target lattice of each grid unit block according to the filling information corresponding to each grid unit.

[0236] During specific implementation, for each grid unit block, a target lattice filled with cells to be used corresponding to the grid unit block may be assembled according to the filling information of each grid unit in the grid unit block.

[0237] S104-5-2: For each grid unit block, perform a Boolean operation on the target point matrix corresponding to the grid unit block and the component information of the component to be filled, and obtain an initial Boolean result corresponding to the grid unit block.

[0238] Here, the initial Boolean result indicates vertex information and patch information.

[0239] During implementation, for each grid cell block, a preset library can be used to perform an intersection operation on the target point matrix corresponding to the grid cell block and the component information of the component to be filled, thereby obtaining the initial Boolean result corresponding to the grid cell block. The preset library can be, for example, the Computational Geometry Algorithms Library (CGAL), a powerful open-source C++ library used to solve complex problems in computational geometry. Its core function is to provide efficient, reliable, and rigorously tested geometric algorithms to quickly implement complex geometric computation tasks.

[0240] Optionally, in order to avoid calculation failure and generation of empty structures due to precision issues when using the CGAL library for Boolean operations, the target lattice corresponding to the grid unit block and the component information of the component to be filled can be translated and rotated by a preset angle, and then a Boolean operation is performed based on the translated and rotated target lattice and component information. After the operation is successful, the operation result is reversely rotated and translated to obtain the initial Boolean result.

[0241] S104-5-3: Filter the discrete connected components in the initial Boolean result to obtain the target Boolean result.

[0242] In specific implementations, the connected components in the initial Boolean result can be determined based on the vertex and patch information indicated in the initial Boolean result. Then, using a preset minimum connectivity size, the discrete connected components in the connected components are filtered to obtain the target Boolean result. This allows filtering out smaller discrete connected components, further optimizing the filled vertices and patches.

[0243] S104-5-4: Generate a filling result corresponding to the grid unit block based on the target Boolean result.

[0244] Here, the filling result corresponding to the grid unit block may be a filled unit block file corresponding to the grid unit block, and the file may be a file in a preset format.

[0245] During specific implementation, an STL or Obj file corresponding to the mesh unit block may be generated according to the vertex information and facet information in the target Boolean result of the mesh unit block.

[0246] S104-5-5: Render the filled component according to the filling result of each grid unit block.

[0247] In specific implementations, the filling results for each grid cell block corresponding to the component to be filled can be combined according to the position of the grid cell block to obtain a target filling result corresponding to the component to be filled. The target filling result can be a file in a preset format, such as an STL or Obj file. The target filling result can then be rendered and photographed to obtain the filled component.

[0248] In this way, the present application greatly reduces the number of cells involved in the calculation by marking whether each grid cell is filled, setting sampling points in the grid cell and judging the filling status with the help of SDF, significantly saving space and time, effectively avoiding complex Boolean operations between large-scale triangular facets, and greatly shortening the processing time. When the cells are tiled, by processing the cell boundary information and merging the grids of adjacent cells, it is ensured that the generated grid cells are continuous and consistent, ensuring the quality of the grid cells while also reducing the amount of data for vertices and facets, greatly reducing the time required for subsequent Boolean operations. In addition, combined with block parallel acceleration technology, the time for processing tens of thousands of cells is further shortened. At the same time, by filtering the connected components, the quality of the final generated STL is guaranteed while also reducing the size of the STL file.

[0249] like Figure 3 FIG. 1 is a schematic diagram of a specific implementation process of cell filling provided by this application, which may include the following steps:

[0250] Importing cells and components can specifically include loading components (i.e., obtaining component information for the component to be filled) and loading cells (i.e., obtaining cell information for the cell to be used). Vertex deduplication, quality inspection, and repair (repair of flow pattern issues and self-intersection issues) can be performed on the loaded components to generate the repaired components (i.e., repaired component information). Vertex deduplication, quality inspection and repair, pre-filling (2×2×2), vertex adsorption (i.e., boundary adsorption), and quality inspection (i.e., determining whether the pre-filled cells to be used have flow pattern issues and / or self-intersection issues) can be performed on the loaded cells in this order. If the quality inspection passes, the repaired cells can be generated. If not, the process returns to the vertex adsorption step until the pre-filled cells to be used have no flow pattern issues and no self-intersection issues.

[0251] Grid calculation and division, namely, generating grid coordinates (i.e., determining the grid coordinate array of the global grid cells that need to be divided corresponding to the components to be filled) and grid division (i.e., determining the grid coordinate array of the global grid cells that need to be divided corresponding to the components to be filled, and using the grid coordinate array to divide the global grid cells to obtain individual grid cell blocks).

[0252] Block filling and parallel calculation, that is, for each grid unit block divided, these grid unit blocks can be filled in parallel with the cells to be used to obtain the filling results corresponding to each grid unit block. Among them, the filling process of each grid unit block may include grid filling mark (i.e., calculating the filling flag of the grid unit), cell tiling (i.e., executing the above step S104), Boolean operation (i.e., executing the above S104-5-1~S104-5-2), and structural optimization (i.e., executing the above S104-5-3~S104-5-4). Figure 3 In FIG, a filling process of n grid unit blocks is exemplarily shown. The filling process of each grid unit block in the n grid unit blocks is similar to the filling process of the first grid unit block.

[0253] Get the result file, that is, get the filling result corresponding to each grid unit block. Figure 3 In the example, the filling result corresponding to each grid unit block is an STL file, and STL1~n represents the filling result files corresponding to the 1st to nth grid unit blocks respectively.

[0254] Rendering file, that is, rendering the filled component according to the filling result corresponding to each grid unit block.

[0255] In general, this application uses pre-filling and repair of cells to predict possible quality problems in advance with a smaller amount of calculation and repair them in advance, avoiding the need for high-cost repairs when quality problems arise in the subsequent large-scale dot matrix filling. Through the grid filling marking algorithm, sampling points are set in the grid units and the filling status is judged with the help of SDF, which greatly reduces the number of calculated cells, significantly saves space and time, effectively avoids complex Boolean operations between large-scale triangular facets, and greatly shortens the processing time. When tiling cells, the method of mirroring, boundary surface processing, and vertex facet merging is used to ensure the quality of the mesh while further reducing the amount of data of vertices and facets, which will greatly reduce the time required for subsequent Boolean operations. In addition, combined with block parallel acceleration technology, the time for processing tens of thousands of cells is further shortened. At the same time, by filtering the connected components, the size of the STL file is reduced while ensuring the quality of the STL.

[0256] To facilitate understanding of the embodiments of the present disclosure, a specific implementation process of the cell filling method of the present application is provided below, including:

[0257] Step s1: Import component and cell files:

[0258] Obtain the component file corresponding to the component to be filled and the cell file of the cell to be used. The component file and cell file can be in stl or obj format. After importing, a series of processing steps are required to process the files. The steps are as follows:

[0259] 1. Component repair: Component repair mainly includes vertex deduplication, detection and repair of flow pattern and self-intersection problems, and generation of repaired component STL files.

[0260] 2. Cell repair: The initial repair of cells is the same as the component repair steps. The vertex information and face information of the repaired cells are obtained. Then, the repaired cells are pre-filled and re-checked and repaired according to the following steps:

[0261] Calculate the cell size, the minimum side length of the cell structure, and the shortest distance between cell vertices;

[0262] Determine the boundary tolerance range. First, calculate the maximum value of the boundary tolerance snap. The maximum value of snap is set to min (minimum side length, shortest distance) / cell size, that is, the boundary tolerance range is [0, c*min (minimum side length, shortest distance) / cell size], where c is the preset coefficient.

[0263] Find a suitable snap. According to the boundary value obtained in the previous step, set a suitable step value. Starting from the minimum boundary value, perform boundary adsorption on the cell vertices according to the current snap, and then fill the cell with 2×2×2. Check whether the flow type and non-self-intersection are met after filling. If so, select the current snap value. Otherwise, snap=snap+step value. Repeat the previous steps until a snap that meets the conditions is found.

[0264] Step s2: Grid calculation and division:

[0265] It includes two steps: grid initialization and grid division, and finally generates a grid coordinate array. The specific steps are as follows:

[0266] 1. Grid initialization, where grid initialization includes obtaining the coordinate arrays (xArray, yArray, zArray) of the global grid cells based on the component size, lattice starting point, and cell size. It includes the following steps:

[0267] ① Determine the grid starting point: The grid starting point is determined by the input lattice starting point position. If no lattice starting point is input, the minimum bounding box coordinates of the component are used as the starting point.

[0268] ②Calculate the grid range: obtain it by subtracting the coordinates of the grid starting point from the maximum coordinates of the component;

[0269] ③Calculate the grid size: This refers to the number of grid cells in each coordinate dimension, which is obtained by dividing the grid range obtained above by the cell size and rounding up;

[0270] ④ Initialize the grid coordinate array: Calculate the grid coordinate array (xArray, yArray, zArray) for each coordinate dimension based on the grid size and cell size.

[0271] 2. Meshing: Meshing is the process of dividing the entire fill area into multiple parts for subsequent parallel processing. It includes the following steps:

[0272] ① Determine the longest dimension: find the dimension with the largest number of grid cells and use this dimension as the partitioning dimension;

[0273] ② Initialize the grid coordinate array: Initialize the grid coordinate array according to the input number of blocks, and obtain the sub-coordinate array corresponding to each grid cell block. Specifically, the number of grid cells is evenly divided along the longest dimension, and the last part will contain the remaining number of grid cells. The number of blocks is limited to between 1 and the number of grid cells along the longest dimension;

[0274] ③ Initialize the sub-coordinate array of each grid cell block: For each grid cell block, extract the corresponding sub-coordinate array from the grid coordinate array (xArray, yArray, zArray) based on its starting offset and the number of grid cells in the longest dimension.

[0275] Step s3: Fill in blocks and calculate in parallel:

[0276] Block filling means assigning each grid unit block to a thread for processing based on the number of blocks, that is, each thread processes one grid unit block. The processing logic of each part is independent and includes the following steps:

[0277] 1. Grid fill flag array calculation: Calculate the fill status of all grid cells in each grid cell block and store the status in an array. The calculation of each grid cell is also processed concurrently, with each thread processing the calculation of the fill flag of one grid cell. The calculation of the fill flag of each grid cell is also independent, including the following steps:

[0278] ① Normalize the sub-point coordinates, set the number of sampling points in each coordinate dimension, and normalize the sampling point coordinates of each dimension to the range of 0-1;

[0279] ② Calculate the actual coordinates of the target point and map the normalized sampling point coordinates to the actual three-dimensional space coordinates according to the grid starting coordinates;

[0280] ③ Set the fill flag and calculate the SDF value of all the above target points. If any target point is less than 0, the fill flag is marked as 1. If all target points are not less than or equal to 0, the fill flag is marked as 0.

[0281] 2. Cell tiling: Tiling the lattice structure to the specified grid unit, filling the lattice into the shell according to the fill flag. If it is 1, fill it, and adjust the vertices and faces of the lattice according to the unit coordinates and parity of the unit to be used, and finally generate a complete grid model. It includes the following sub-steps:

[0282] 1) Construct the initial cell boundary information boundary: Based on the cell structure, a boundary information structure is constructed. This structure records which cell vertices are located on the boundary surface, boundary edge, and corner position. Traverse all cell vertices for processing, and perform the following operations on each cell vertex:

[0283] Calculate the label of the cell vertex; calculate the associated boundary face serial number, and store the local vertex index in the array of the serial numbered face in the cell boundary information; calculate the associated boundary edge serial number, and store the local vertex index in the array of the serial numbered edge in the boundary information; calculate the boundary corner serial number, and update the local vertex index to the corner serial number of the serial numbered corner point;

[0284] 2) Initialize the face label: traverse all the cell faces of the cell, perform an AND operation on the three vertex labels contained in the cell face (v0&v1&v2) to obtain the face label value of the face;

[0285] 3) Initialize the grid cell boundary array boundaries: Create a new grid cell boundary array to store the cell boundary information of all grid cells;

[0286] 4) Traverse all grid cells and perform the following steps for each grid cell:

[0287] 4-1): Determine whether the fill flag of the grid cell is 1, if so, continue, otherwise jump out of this loop;

[0288] 4-2): Store the initial boundary information boundary of the grid cell into boundaries;

[0289] 4-3): Vertex coordinate transformation: traverse all cell vertices of the cell. If the grid cell has an odd number in a certain dimension, flip the local vertex coordinates of the cell vertex in that dimension and transform them to the global coordinate system to obtain the global vertex coordinates of each cell vertex in the global coordinate system.

[0290] 4-4): Face culling: Faces shared by adjacent cells are eliminated using face labels (faceLabels) to avoid duplicate generation, ultimately obtaining the face information of the grid cell. The specific operation is to traverse all the faces of the cell, and then for each face, the following steps are performed: determine which boundary face it is on based on the face label, dynamically calculate the coordinates of the neighbor, and verify the existence of the neighbor; finally, the final face list is obtained: only the faces that have not been culled are retained;

[0291] 4-5) Face vertex order adjustment: For each retained cell face, swap the vertex order of the cell face according to the parity of the cell coordinates of the grid unit to ensure that after the vertex coordinates are mirrored, the normal direction of the triangle face still conforms to the predetermined direction rule, that is, pointing outward;

[0292] 4-6): Deal with the boundary sharing problem between adjacent grid cells to avoid duplicate allocation of shared vertices: The specific steps are as follows:

[0293] Create a newVertexIndex array with the same length as the number of cell vertices, which is used to record the mapping relationship between the local vertex index of the current cell to be used and the default global vertex index; the default global vertex index can be -1; traverse all neighboring grid cells, and for each neighboring grid cell: obtain the boundary information neighborBoundary of the neighboring grid cell in the boundaries array. If there is no boundary information, skip this loop and traverse the next neighboring grid cell; determine the type of the shared boundary between the neighboring grid cell and the grid, and return the boundary type and boundary sequence of the shared boundary; based on the shared boundary type and boundary type and boundary sequence obtained above, readjust the vertex index array newVertexIndex (specifically, update the mapping relationship of the cell vertices on the shared boundary in the newVertexIndex array, so that the global vertex index of the cell vertices on these shared boundaries in the newVertexIndex array is updated to the target global vertex index, but the global vertex index of the cell vertices on the non-shared boundary is still -1), to ensure that the shared boundaries of the two grid cells reference the same global vertex to avoid duplicate generation;

[0294] 4-7): Mesh merging: Merge the cell vertices and faces obtained above into the global mesh unit, and process the vertex index mapping at the same time. The specific steps are as follows:

[0295] 1. Vertex processing: Traverse all vertices of the cell. If the vertex is not mapped, add the vertex to the global vertex set V according to its global vertex coordinates. Update the default global vertex index of the unmapped vertex in the newVertexIndex array of the currently traversed grid cell using the order of addition. Since the vertex index of the mapped vertex has already been updated in steps 4-6, the mapped vertex is skipped directly (that is, the target global vertex index of the mapped vertex is shared through newVertexIndex).

[0296] 2. Face processing: Add all cell faces to the global face set (F) and convert the face's vertex index to the global vertex index (through the latest newVertexIndex mapping).

[0297] 4-8) Update the cell boundary information for the current mesh unit: After mesh merging, the vertex indices of the cell vertices are remapped, so the cell boundary information must also be synchronized. This step only updates the boundary data of the current mesh cell and does not affect the global mesh, but it provides the correct indices for subsequent sharing of adjacent mesh cells. The final result is the merged vertex V and face F.

[0298] Step s4: Boolean operation, that is, performing an intersection operation on the filled lattice and the shell to obtain the Boolean structure.

[0299] Step s5: Generate STL, that is, generate various STL files based on the point and surface data of each grid unit block generated in parallel in the previous step.

[0300] Step s6: Render STL, that is, combine the multiple STL files generated by the block filling in the above steps together, render and take pictures, and generate a picture of the overall effect.

[0301] Corresponding to the aforementioned embodiment of the cell filling method, the present application also provides an embodiment of a cell filling device.

[0302] The embodiment of the cell filling device of the present application can be applied to a computer device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the computer device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running it. From the hardware level, if Figure 4 As shown, this is a hardware structure diagram of the computer device where the cell filling device 400 of this application is located. Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown, the computer device where the apparatus in the embodiment is located may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0303] Please refer to Figure 5 , is a schematic diagram of a cell filling device provided in an embodiment of the present application, comprising:

[0304] An acquisition module 501 is used to acquire component information of a component to be filled and cell information of a cell to be used;

[0305] A determination module 502 is configured to determine a grid coordinate array of global grid cells to be divided corresponding to the component to be filled based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information;

[0306] A division module 503 is configured to divide the global grid cell according to the number of blocks, the coordinate dimension with the largest number of grid cells, and the grid coordinate array, to obtain a sub-coordinate array corresponding to each grid cell block; each grid cell block includes at least one grid cell;

[0307] The filling module 504 is configured to fill each of the grid unit blocks with the cells to be used according to the sub-coordinate array and the cell information to obtain a filled component.

[0308] In a possible implementation, the filling module 504, when filling the to-be-used cells in each grid unit block according to the sub-coordinate array and the cell information to obtain a filled component, is configured to:

[0309] Determining a vertex label of each cell vertex in the cell to be used according to the cell vertex information in the cell information;

[0310] Determining cell boundary information of the cell to be used and face labels of each cell face of the cell to be used according to the vertex label of each cell vertex; the cell boundary information is used to indicate an associated boundary face, an associated boundary edge, and an associated angle of each cell vertex;

[0311] For any of the grid unit blocks, traverse each grid unit in the grid unit block and determine a fill flag of the currently traversed grid unit; the fill flag is used to indicate whether the grid unit needs to be filled with the cell to be used;

[0312] If the fill flag is a preset flag, the grid unit is filled with the cell to be used, and the fill information of the filled grid unit is determined according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid unit in the sub-coordinate array;

[0313] The filled component is determined according to the filling information corresponding to each grid unit.

[0314] In a possible implementation, the filling module 504, when determining the filling information of the filled grid cell according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid cell in the sub-coordinate array, is configured to:

[0315] According to the parity of the unit coordinates of the grid unit in each coordinate dimension, the local vertex coordinates of the cell vertex of the cell to be used in the cell to be used are adjusted and converted into a global coordinate system to obtain the global vertex coordinates of the cell vertex;

[0316] Determining a target cell face having a neighboring grid cell according to a face label of each cell face and the parity of the cell coordinates in each coordinate dimension;

[0317] Performing a face culling operation on the cell to be used according to the fill flag of the neighboring grid unit of the target cell face to obtain each retained cell face of the cell to be used;

[0318] Adjusting the vertex order of each cell vertex on each of the retained cell faces according to the parity of the cell coordinates in each dimension of the grid cell to obtain an adjusted vertex order;

[0319] Filling information of the filled grid unit is determined according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information.

[0320] In a possible implementation, the filling module 504, when determining the filling information of the filled grid unit according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information, is configured to:

[0321] Taking the grid cell as the center, traverse each neighboring grid cell of the grid cell;

[0322] Storing the cell boundary information in a grid unit boundary array and creating a vertex index array for the grid unit; the vertex index array is used to store a mapping relationship between a local vertex index of each cell vertex of the cell to be used in the grid unit and a default global vertex index;

[0323] Obtaining cell boundary information of the currently traversed neighboring grid cell from the grid cell boundary array, and determining a boundary type and a boundary sequence number of a shared boundary between the grid cell and the currently traversed neighboring grid cell based on the cell boundary information of the grid cell and the cell boundary information of the currently traversed neighboring grid cell;

[0324] According to the boundary type and the target global vertex index of the cell vertex on the shared boundary indicated by the boundary sequence number in the corresponding vertex index array, updating the corresponding mapping relationship of the cell vertex on the shared boundary in the vertex index array to obtain an updated vertex index array;

[0325] Filling information of the filled grid unit is determined according to the updated vertex index array, the global vertex coordinates and the adjusted vertex order.

[0326] In a possible implementation, the filling module 504, when determining the filling information of the filled mesh unit according to the updated vertex index array, the global vertex coordinates, and the adjusted vertex order of the retained cell face, is configured to:

[0327] Determine, based on whether the mapping relationship of the cell vertices is adjusted, unmapped cell vertices in the to-be-used cell, and add the unmapped cell vertices to the constructed global vertex set based on the global vertex coordinates of the unmapped cell vertices, and adjust the mapping relationship of the unmapped cell vertices in the updated vertex index array according to the order in which the unmapped cell vertices are added, to obtain an adjusted vertex index array; the adjusted vertex index array is used to update the vertex index arrays of the other grid cells when the grid cell serves as a neighbor grid cell of the other grid cells;

[0328] Determining the global vertex index of the retained cell face from the adjusted vertex index array according to the adjusted vertex order;

[0329] According to the global vertex index of the reserved cell face, the reserved cell face is added to the constructed global face set to obtain filling information of the filled grid unit.

[0330] In a possible implementation, after determining the filling information of the filled grid unit, the filling module 504 is further configured to:

[0331] According to the adjusted vertex index array, the cell boundary information of the cell to be used in the grid unit boundary array is updated.

[0332] In a possible implementation, the filling module 504, when determining the cell boundary information of the cell to be used and the surface labels of each cell surface of the cell to be used according to the vertex label of each cell vertex, is configured to:

[0333] Predicting the boundary face number, boundary edge number, and corner number associated with the cell vertex according to the dimension values ​​of the vertex label in each coordinate dimension;

[0334] Determine the associated boundary face, associated boundary edge, and associated angle of the cell vertex according to the boundary face sequence number, the boundary edge sequence number, and the angle sequence number;

[0335] Determine the cell boundary information according to the associated boundary faces, associated boundary edges and associated angles of each cell vertex;

[0336] An AND operation is performed on the vertex labels of each cell vertex included in each cell face to obtain a face label of each cell face.

[0337] In a possible implementation, the filling module 504, when determining the fill flag of the currently traversed grid unit, is configured to:

[0338] Sampling the grid cells in each coordinate dimension according to the number of sampling points set in each coordinate dimension to obtain the sampling point coordinates of each sampling point in each coordinate dimension;

[0339] For each coordinate dimension, normalizing the sampling point coordinates of each sampling point on the coordinate dimension to obtain the normalized coordinates of each sampling point;

[0340] Determining the target coordinates of each normalized coordinate in the three-dimensional world coordinate system according to the grid starting coordinates;

[0341] The fill flag of the grid unit is determined according to each of the target coordinates.

[0342] In a possible implementation, the filling module 504, when determining the filled component according to the filling information corresponding to each grid unit, is configured to:

[0343] Determining a target lattice for each of the grid unit blocks according to the filling information corresponding to each of the grid units;

[0344] For each grid unit block, performing a Boolean operation on the target point matrix corresponding to the grid unit block and the component information of the component to be filled, to obtain an initial Boolean result corresponding to the grid unit block;

[0345] Filtering the discrete connected components in the initial Boolean result to obtain a target Boolean result;

[0346] Generate a filling result corresponding to the grid unit block according to the target Boolean result;

[0347] The filled component is rendered according to the filling result of each grid unit block.

[0348] In a possible implementation, the apparatus further includes a repair module 505, which, before determining the grid coordinate array of the global grid cells to be divided corresponding to the component to be filled based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, is configured to:

[0349] According to the component information, performing vertex deduplication, flow pattern repair, and self-intersection repair on the component to be filled, to obtain repaired component information;

[0350] According to the cell information, vertex duplication, flow pattern problem repair and self-intersection problem repair are performed on the cell to be used to obtain the repaired cell information.

[0351] In a possible implementation, the apparatus further includes a repair module 505, which, after obtaining the repaired cell information, is further configured to:

[0352] Determining the cell size, minimum side length, and shortest distance between cell vertices of the cell to be used according to the repaired cell information;

[0353] Determining a boundary tolerance range according to the minimum side length, the shortest distance, and the cell size;

[0354] Taking the minimum value in the boundary tolerance range as the boundary adsorption value, performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value to obtain an adsorption result;

[0355] Pre-filling the cells to be used according to the adsorption result and the preset filling size, and determining whether the pre-filled cells to be used have flow pattern problems and / or self-intersection problems;

[0356] If so, the boundary adsorption value is updated using the preset step size, and the step of performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value is returned to, until there is no flow type problem and self-intersection problem in the pre-filled cell to be used, or the updated boundary adsorption value exceeds the boundary tolerance range.

[0357] In a possible implementation, the determining module 502, when determining the grid coordinate array of the global grid cells to be divided corresponding to the component to be filled based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, is configured to:

[0358] Determine the size of the component to be filled in each coordinate dimension according to the coordinate information of each component vertex;

[0359] Determining the number of grids in each coordinate dimension according to the coordinates of the grid starting point, the size in each coordinate dimension, and the cell size;

[0360] The grid coordinate array is determined according to the number of grids in each coordinate dimension and the cell size.

[0361] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0362] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0363] Embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by the data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0364] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can be implemented as, special-purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).

[0365] Computers suitable for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to such mass storage devices to receive data from them or to transmit data to them, or both. However, a computer does not necessarily have such devices. In addition, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0366] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0367] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of specific embodiments of specific inventions. Certain features described in multiple embodiments within this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claimed as such, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of the sub-combination.

[0368] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0369] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the particular order shown or sequential sequence to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0370] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A cell filling method, characterized in that: The method comprises: Obtaining component information of the component to be filled and cell information of the cell to be used; Determine, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of the global grid cells to be divided corresponding to the component to be filled; Divide the global grid unit according to the number of blocks, the coordinate dimension with the largest number of grid units, and the grid coordinate array to obtain a sub-coordinate array corresponding to each grid unit block; each grid unit block includes at least one grid unit; Determining, according to the cell vertex information in the cell information, a vertex label of each cell vertex in the cell to be used; the vertex label is used to indicate the position information of the cell vertex in the three-dimensional space; Determining, according to the vertex label of each cell vertex, cell boundary information of the cell to be used and the surface label of each cell face of the cell to be used; the cell boundary information is used to indicate the associated boundary face, associated boundary edge, and associated angle of each cell vertex; the surface label is obtained by performing an AND operation on the vertex labels of each cell vertex on the cell face; For any of the grid unit blocks, traverse each grid unit in the grid unit block and determine a fill flag of the currently traversed grid unit; the fill flag is used to indicate whether the grid unit needs to be filled with the cell to be used; If the fill flag is a preset flag, the grid unit is filled with the cell to be used, and the fill information of the filled grid unit is determined according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid unit in the sub-coordinate array; A filled component is determined according to the filling information corresponding to each grid unit.

2. The method according to claim 1, characterized in that The determining the filling information of the filled grid cell according to the cell boundary information of the cell to be used, the surface label, and the parity of the cell coordinates of the currently traversed grid cell in the sub-coordinate array includes: According to the parity of the unit coordinates of the grid unit in each coordinate dimension, the local vertex coordinates of the cell vertex of the cell to be used in the cell to be used are adjusted and converted into a global coordinate system to obtain the global vertex coordinates of the cell vertex; Determining a target cell face having a neighboring grid cell according to a face label of each cell face and the parity of the cell coordinates in each coordinate dimension; Performing a face culling operation on the cell to be used according to the fill flag of the neighboring grid unit of the target cell face to obtain each retained cell face of the cell to be used; Adjusting the vertex order of each cell vertex on each of the retained cell faces according to the parity of the cell coordinates in each dimension of the grid cell to obtain an adjusted vertex order; Filling information of the filled grid unit is determined according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information.

3. The method according to claim 2, characterized in that The determining of filling information of the filled grid unit according to the global vertex coordinates, the adjusted vertex order, and the cell boundary information includes: Taking the grid cell as the center, traverse each neighboring grid cell of the grid cell; Storing the cell boundary information in a grid unit boundary array and creating a vertex index array for the grid unit; the vertex index array is used to store a mapping relationship between a local vertex index of each cell vertex of the cell to be used in the grid unit and a default global vertex index; Obtaining cell boundary information of the currently traversed neighboring grid cell from the grid cell boundary array, and determining a boundary type and a boundary sequence number of a shared boundary between the grid cell and the currently traversed neighboring grid cell based on the cell boundary information of the grid cell and the cell boundary information of the currently traversed neighboring grid cell; According to the boundary type and the target global vertex index of the cell vertex on the shared boundary indicated by the boundary sequence number in the corresponding vertex index array, updating the corresponding mapping relationship of the cell vertex on the shared boundary in the vertex index array to obtain an updated vertex index array; Filling information of the filled grid unit is determined according to the updated vertex index array, the global vertex coordinates and the adjusted vertex order.

4. The method according to claim 3, characterized in that The step of determining filling information of the filled grid unit according to the updated vertex index array, the global vertex coordinates, and the adjusted vertex order of the retained cell face includes: Determine, based on whether the mapping relationship of the cell vertices is adjusted, unmapped cell vertices in the to-be-used cell, and add the unmapped cell vertices to the constructed global vertex set based on the global vertex coordinates of the unmapped cell vertices, and adjust the mapping relationship of the unmapped cell vertices in the updated vertex index array according to the order in which the unmapped cell vertices are added, to obtain an adjusted vertex index array; the adjusted vertex index array is used to update the vertex index arrays of the other grid cells when the grid cell serves as a neighbor grid cell of the other grid cells; Determining the global vertex index of the retained cell face from the adjusted vertex index array according to the adjusted vertex order; According to the global vertex index of the reserved cell face, the reserved cell face is added to the constructed global face set to obtain filling information of the filled grid unit.

5. The method according to claim 4, characterized in that After determining the filling information of the filled grid cells, the following is also included: According to the adjusted vertex index array, the cell boundary information of the cell to be used in the grid unit boundary array is updated.

6. The method according to claim 1, wherein The step of determining the cell boundary information of the cell to be used and the surface labels of each cell surface of the cell to be used according to the vertex label of each cell vertex includes: Predicting the boundary face number, boundary edge number, and corner number associated with the cell vertex according to the dimension values ​​of the vertex label in each coordinate dimension; Determine the associated boundary face, associated boundary edge, and associated angle of the cell vertex according to the boundary face sequence number, the boundary edge sequence number, and the angle sequence number; Determine the cell boundary information according to the associated boundary faces, associated boundary edges and associated angles of each cell vertex; An AND operation is performed on the vertex labels of each cell vertex included in each cell face to obtain a face label of each cell face.

7. The method according to claim 1, characterized in that The determining of the fill flag of the currently traversed grid unit includes: Sampling the grid cells in each coordinate dimension according to the number of sampling points set in each coordinate dimension to obtain the sampling point coordinates of each sampling point in each coordinate dimension; For each coordinate dimension, normalizing the sampling point coordinates of each sampling point on the coordinate dimension to obtain the normalized coordinates of each sampling point; Determining the target coordinates of each normalized coordinate in the three-dimensional world coordinate system according to the grid starting coordinates; The fill flag of the grid unit is determined according to each of the target coordinates.

8. The method according to claim 1, characterized in that The determining the filled component according to the filling information corresponding to each grid unit includes: Determining a target lattice for each of the grid unit blocks according to the filling information corresponding to each of the grid units; For each grid unit block, performing a Boolean operation on the target point matrix corresponding to the grid unit block and the component information of the component to be filled, to obtain an initial Boolean result corresponding to the grid unit block; Filtering the discrete connected components in the initial Boolean result to obtain a target Boolean result; Generate a filling result corresponding to the grid unit block according to the target Boolean result; The filled component is rendered according to the filling result of each grid unit block.

9. The method according to claim 1, characterized in that Before determining the grid coordinate array of the global grid cells to be divided corresponding to the component to be filled according to the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, the method further includes: According to the component information, performing vertex deduplication, flow pattern repair, and self-intersection repair on the component to be filled, to obtain repaired component information; According to the cell information, vertex duplication, flow pattern problem repair and self-intersection problem repair are performed on the cell to be used to obtain the repaired cell information.

10. The method according to claim 9, characterized in that After obtaining the repaired cell information, it also includes: Determining the cell size, minimum side length, and shortest distance between cell vertices of the cell to be used according to the repaired cell information; Determining a boundary tolerance range according to the minimum side length, the shortest distance, and the cell size; Taking the minimum value in the boundary tolerance range as the boundary adsorption value, performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value to obtain an adsorption result; Pre-filling the cells to be used according to the adsorption result and the preset filling size, and determining whether the pre-filled cells to be used have flow pattern problems and / or self-intersection problems; If so, the boundary adsorption value is updated using the preset step size, and the step of performing boundary adsorption processing on each cell vertex of the cell to be used according to the boundary adsorption value is returned to, until there is no flow type problem and self-intersection problem in the pre-filled cell to be used, or the updated boundary adsorption value exceeds the boundary tolerance range.

11. The method according to claim 1, wherein The step of determining, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of a global grid cell to be divided corresponding to the component to be filled, includes: Determine the size of the component to be filled in each coordinate dimension according to the coordinate information of each component vertex; Determining the number of grids in each coordinate dimension according to the coordinates of the grid starting point, the size in each coordinate dimension, and the cell size; The grid coordinate array is determined according to the number of grids in each coordinate dimension and the cell size.

12. A cell filling device, characterized in that: The device comprises: An acquisition module, used to acquire component information of a component to be filled and cell information of a cell to be used; a determination module, configured to determine, based on the coordinate information of each component vertex in the component information and the cell size indicated by the cell information, a grid coordinate array of the global grid cells to be divided corresponding to the component to be filled; a partitioning module, configured to partition the global grid cell according to the number of blocks, the coordinate dimension with the largest number of grid cells, and the grid coordinate array, to obtain a sub-coordinate array corresponding to each grid cell block; each grid cell block includes at least one grid cell; A filling module is used to determine the vertex label of each cell vertex in the cell to be used according to the cell vertex information in the cell information; the vertex label is used to indicate the position information of the cell vertex in the three-dimensional space; according to the vertex label of each cell vertex, the cell boundary information of the cell to be used and the face label of each cell face of the cell to be used are determined; the cell boundary information is used to indicate the associated boundary face, associated boundary edge and associated angle of each cell vertex; the face label is obtained by performing an AND operation on the vertex labels of each cell vertex on the cell face; for any of the grid unit blocks, Each grid cell in the grid cell block is traversed to determine a fill flag of the currently traversed grid cell; the fill flag is used to indicate whether the grid cell needs to be filled with the cell to be used; if the fill flag is a preset flag, the cell to be used is filled into the grid cell, and the fill information of the filled grid cell is determined according to the cell boundary information of the cell to be used, the face label and the parity of the cell coordinates of the currently traversed grid cell in the sub-coordinate array; and a filled component is determined according to the fill information corresponding to each of the grid cells.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Three-period minimal curved surface structure efficient design system for multiple application scenes

    CN118194588A