Mesh model processing method and device, equipment, storage medium and program product

By combining the grid point threshold and the expected grid point number in the grid model to predict grid points and perform grid subdivision, the problem of poor grid subdivision quality in the existing technology is solved, and a higher quality grid subdivision is achieved.

CN119963717APending Publication Date: 2025-05-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311478773.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the prior art, the subdivision method of grid models cannot meet the subdivision needs of different grids, resulting in poor subdivision quality.

Method used

By obtaining the initial grid model, combining the grid point threshold and the expected grid point number of each initial grid boundary, the grid point number prediction is obtained to obtain the predicted grid point number, and based on this, the initial grid is subdivided to generate and update grid model.

Benefits of technology

The mesh subdivision quality of the mesh model is improved, so that the number of subdivision grid vertices of the target mesh matches the number of predicted grid points, meeting the subdivision needs of different initial mesh.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963717A_ABST
    Figure CN119963717A_ABST
Patent Text Reader

Abstract

The invention provides a grid model processing method and device, equipment, a storage medium and a program product. The method comprises the following steps: acquiring an initial grid model comprising at least one initial grid, wherein the initial grid comprises a plurality of initial grid boundaries; aiming at each initial grid model, in combination with a grid point number threshold value and an expected grid point number of each initial grid boundary, performing grid point number prediction on each initial grid boundary in the initial grid model to obtain a predicted grid point number of each initial grid boundary; and on the basis of the predicted grid point number of each initial grid boundary, performing grid subdivision on each initial grid in the initial grid model to obtain an updated grid model comprising a plurality of target grids, the target grid boundaries of the target grids being in one-to-one correspondence with the initial grid boundaries. According to the invention, the grid subdivision quality of the grid model can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a grid model processing method, device, equipment, storage medium and program product. Background Art

[0002] A mesh model is a model that approximates a three-dimensional object using a series of polygons (usually triangles or quadrilaterals) of similar size and shape.

[0003] In the related art, for the subdivision of the grid in the grid model, the grid is usually subdivided directly at equal intervals. Since different grids in the grid model may have different subdivision requirements, the subdivision method in the related art cannot meet the different subdivision requirements, resulting in poor quality of grid subdivision. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium and computer program product for processing a grid model, which can effectively improve the grid subdivision quality of the grid model.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides a method for processing a grid model, including:

[0007] Acquire an initial grid model including at least one initial grid, wherein the initial grid includes a plurality of initial grid boundaries;

[0008] For each of the initial grid models, combining a grid point number threshold and an expected grid point number of each of the initial grid boundaries, respectively predicting the number of grid points of each of the initial grid boundaries in the initial grid model to obtain a predicted number of grid points of each of the initial grid boundaries;

[0009] Based on the predicted number of grid points of each initial grid boundary, each initial grid in the initial grid model is meshed to obtain an updated grid model including a plurality of target grids, wherein the target grid boundaries of the target grids correspond one-to-one to the initial grid boundaries;

[0010] Wherein, each of the target grids of the updated grid model includes a plurality of subdivided grids, and the number of vertices of the subdivided grids on the boundaries of each of the target grids is equal to the corresponding number of predicted grid points.

[0011] The present application provides a grid model processing device, including:

[0012] An acquisition module, configured to acquire an initial grid model including at least one initial grid, wherein the initial grid includes a plurality of initial grid boundaries;

[0013] A prediction module is used for predicting the number of grid points of each initial grid boundary in the initial grid model according to the grid point number threshold and the expected number of grid points of each initial grid boundary, so as to obtain the predicted number of grid points of each initial grid boundary;

[0014] A mesh subdivision module is used to mesh each of the initial meshes in the initial mesh model based on the predicted number of grid points of each of the initial mesh boundaries, so as to obtain an updated mesh model including a plurality of target meshes, wherein the target mesh boundaries of the target meshes correspond one-to-one to the initial mesh boundaries; wherein each of the target meshes in the updated mesh model includes a plurality of subdivided meshes, and the number of vertices of the subdivided meshes on each of the target mesh boundaries of the target meshes is equal to the corresponding predicted number of grid points.

[0015] In the above scheme, the processing device of the above grid model also includes: an expectation module, which is used to perform the following processing for each initial grid boundary in the initial grid model: obtain the expected side length of the subdivided grid, and determine the boundary length of the initial grid boundary; divide the boundary length and the expected side length to obtain a division result; when the division result is an integer, determine the division result as the expected number of grid points of the initial grid boundary; when the division result is not an integer, round the division result to obtain the expected number of grid points of the initial grid boundary.

[0016] In the above scheme, the above expectation module is also used to perform the following processing on each of the initial grid boundaries in the initial grid model: sampling on the initial grid boundary to obtain multiple boundary sampling points on the initial grid boundary; obtaining the curvature of the initial grid boundary at each of the boundary sampling points, and weighted averaging each of the curvatures to obtain the target curvature of the initial grid boundary; obtaining the adjustment coefficient, multiplying the target curvature and the adjustment coefficient to obtain the expected number of grid points of the initial grid boundary.

[0017] In the above scheme, the above prediction module is also used to perform the following processing for each initial grid boundary in the initial grid model: obtain an initial grid point number threshold, and combine the initial grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the initial grid point number of the initial grid boundary; when the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, obtain a reference grid point number threshold, and the reference grid point number threshold is less than the initial grid point number threshold; combine the reference grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the reference grid point number of the initial grid boundary; determine the predicted grid point number of the initial grid boundary based on the reference grid point number and the initial grid point number.

[0018] In the above scheme, the above prediction module is also used to compare the reference grid point number and the initial grid point number; when the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, the initial grid point number is determined as the predicted grid point number of the initial grid boundary; when the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, the reference grid point number is determined as the predicted grid point number of the initial grid boundary.

[0019] In the above scheme, the above prediction module is also used to obtain a target grid point number threshold when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, and the target grid point number threshold is greater than the initial grid point number threshold; combine the target grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the target grid point number of the initial grid boundary; when the difference between the target grid point number and the corresponding expected grid point number is less than the target grid point number threshold, determine the target grid point number as the predicted grid point number of the initial grid boundary.

[0020] In the above scheme, the above prediction module is also used to determine the predicted grid point number as zero when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold; wherein the initial grid point number threshold is a positive integer greater than zero.

[0021] In the above scheme, the reference grid point number threshold includes the i-th reference grid point number threshold, 1≤i≤N, N is used to indicate the number of the reference grid point number threshold, and the numerical value of i is negatively correlated with the numerical value of the i-th reference grid point number threshold; the above prediction module is also used to traverse i and perform the following processing until the reference grid point number of the initial grid boundary is obtained: combining the i-th reference grid point number threshold and the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary, and obtaining the i-th reference grid point number threshold of the initial grid boundary. i reference grid point number; when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, the first reference grid point number is determined as the reference grid point number; when the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, the difference between the i-1-th reference grid point number and the corresponding expected grid point number is less than the i-1-th reference grid point number threshold, and i is greater than 1, the i-1-th reference grid point number is determined as the reference grid point number.

[0022] In the above scheme, the above prediction module is also used to perform the following processing for each initial grid boundary in the initial grid model: obtain grid point number constraints, the grid point number constraints include the jth grid point number constraints, 1≤j≤M, M is used to indicate the total number of grid point number constraints, and the numerical value of j is positively correlated with the constraint strength of the jth grid point number constraints; traverse j to perform the following processing until the predicted grid point number of the initial grid boundary is obtained: combine the grid point number threshold, the expected grid point number of the initial grid boundary and the jth grid point number constraint, perform the jth grid point number prediction on the initial grid boundary, and obtain the jth prediction result; when the jth prediction result indicates that the jth grid point number prediction can generate the jth predicted grid point number that satisfies the jth grid point number constraint, determine the jth predicted grid point number as the predicted grid point number of the initial grid boundary.

[0023] In the above scheme, the above prediction module is also used to perform the following processing for each initial grid boundary in the initial grid model: obtain grid point number constraints, the grid point number constraints include the jth grid point number constraints, 1≤j≤M, M is used to indicate the total number of the grid point number constraints, and the numerical value of j is positively correlated with the constraint strength of the jth grid point number constraints; from the grid point number constraints, determine the Tth grid point number constraints corresponding to the initial grid boundary, 1≤T≤M; traverse t to perform the following processing until the predicted grid point number of the initial grid boundary is obtained: combine the grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint, perform the tth grid point number prediction on the initial grid boundary to obtain the tth prediction result; when the tth prediction result indicates that the tth grid point number prediction can generate the tth predicted grid point number that satisfies the tth grid point number constraint, determine the tth predicted grid point number as the predicted grid point number of the initial grid boundary, where T≤t≤M.

[0024] In the above scheme, the above-mentioned grid subdivision module is also used to determine the target grid subdivision method of the initial grid for each of the initial grids in the initial grid model based on the predicted number of grid points of each of the initial grids, and to subdivide the initial grid according to the target grid subdivision method to obtain a target grid corresponding to the initial grid; wherein the target grid boundary of the target grid coincides with the initial grid boundary of the corresponding initial grid; and each of the initial grids in the initial grid model is replaced by the corresponding target grid to obtain the updated grid model.

[0025] In the above scheme, the above-mentioned grid subdivision module is also used to determine the grid point number constraint conditions satisfied between the predicted grid point numbers of the initial grid in combination with the predicted grid point numbers of the initial grid; obtain the mapping relationship between multiple preset constraints and corresponding preset grid subdivision methods, and compare the grid point number constraint conditions with each of the preset constraints in the mapping relationship respectively to obtain the comparison result corresponding to the grid point number constraint conditions; when the comparison result indicates that the grid point number constraint condition exists among the multiple preset constraints, the preset grid subdivision method corresponding to the grid point number constraint condition in the mapping relationship is determined as the target grid subdivision method of the initial grid.

[0026] An embodiment of the present application provides an electronic device, including:

[0027] A memory for storing computer executable instructions or computer programs;

[0028] The processor is used to implement the grid model processing method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0029] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute and implement the grid model processing method provided in the embodiment of the present application.

[0030] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the above-mentioned grid model processing method of the embodiment of the present application.

[0031] The embodiments of the present application have the following beneficial effects:

[0032] By combining the grid point number threshold and the expected grid point number of each initial grid boundary, the grid point number of each initial grid boundary is predicted respectively to obtain the predicted grid point number of each initial grid boundary. Based on the predicted grid point number of each initial grid boundary, each initial grid in the initial grid model is meshed to obtain an updated grid model including multiple target grids. Each target grid includes multiple subdivided grids, and the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. In this way, by meshing each initial grid in the initial grid model based on the predicted grid point number of each initial grid boundary, an updated grid model including multiple target grids is obtained, so that the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. Since the predicted grid point number corresponding to the initial grid is determined by the corresponding expected grid point number, different initial grids can meet the expected subdivision expectation of the expected grid point number when meshing, thereby meeting the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the grid model. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic diagram of the architecture of a grid model processing system provided in an embodiment of the present application;

[0034] Figure 2 is a schematic diagram of the structure of an electronic device for processing a grid model provided in an embodiment of the present application;

[0035] Figures 3 to 9 is a flowchart of a method for processing a grid model provided in an embodiment of the present application;

[0036] Fig.10It is a schematic diagram of the effect of mesh subdivision of a mesh model in the related art;

[0037] Figure 11 to Figure 12 It is a schematic diagram of the effect of the grid model processing method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0039] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0040] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0042] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0043] 1) Layout: It is a complete division of the surface of the mesh model, consisting of multiple polygonal blocks (Patch).

[0044] 2) Gridding: Also known as grid subdivision, it refers to the process of discretizing a grid model into quadrilaterals or triangles. In this application, it mainly refers to the process of discretizing within each block after dividing the grid model into multiple blocks.

[0045] 3) Inflection point: a point that is located at the boundaries of three or more blocks at the same time.

[0046] 4) Edge: An edge refers to a sub-edge or a combination of sub-edges between two inflection points in a block.

[0047] 5) Sub Edge: refers to the edge in the block boundary that cannot be further subdivided, and is also the most basic element that constitutes the edge.

[0048] 6) Layout subdivision: In the layout result, the process of determining the number of grid points to be rasterized on each sub-edge is called layout subdivision.

[0049] 7) Integer linear programming (ILP): Integer linear programming means that the variables (all or part) in the planning are restricted to integers. If the variables are restricted to integers in the linear model, it is called integer linear programming. Integer linear programming is used in this application to solve the number of grid points of each sub-edge in the layout, so as to complete the layout subdivision. Integer linear programming is a linear programming in which the variables take integer values. The general form is min Z, satisfying the condition Ax = b, or > 0, and taking integer values. In addition to the constraints of general linear programming, adding the requirement that the variables are integer values ​​has brought about profound changes in the problem, which has an impact on both theory and application. Thus, a unique branch of integer linear programming has been formed. If all the coordinates of a point x in the n-dimensional Euclidean space E are integers, then this point is called an integer point. All integer points in E0 are recorded as Z", which is a grid, and this grid is called an integer grid. Therefore, integer linear programming is a linear programming on an integer grid.

[0050] 8) Patch cluster: In order to quickly solve the integer linear programming, all or part of the connected patches are often grouped together to form a patch cluster, which is used as the input of the integer linear programming, thereby reducing the scale of the integer linear programming solution.

[0051] 9) Regularity constraint: the equality and inequality constraints that need to be satisfied between the number of grid points on each edge of the same block (i.e., the initial grid described above) in order to meet the corresponding regularity requirements of rasterization.

[0052] 10) Parity constraint: The sum of the number of grid points on each side of the same block must be an even number. Only when this condition is met can the final rasterization result contain only quadrilaterals and no triangles.

[0053] 11) Gridding Count Range Constraint: For each sub-edge on a block, the user needs to provide a target grid point number and the upper and lower bounds of the actual grid point number. The actual grid point number is between the given upper and lower bounds, and this constraint is called the grid point number range constraint. For example, for a certain edge, if the target grid point number is 5, the upper and lower bounds of the actual grid point number can be set to (3, 7).

[0054] 12) Singularity: On the surface of a quadrilateral mesh model, internal points with a degree other than 4 may have boundaries. Points on the boundary are called boundary points, otherwise they are called internal points. Boundary points with a degree other than 3 are called singular points. A good quadrilateral mesh often has fewer singular points, and the layout of the singular points is more reasonable.

[0055] 13) Gridding Type: The type of rasterization performed inside a block, which is exemplarily divided into three types in this application: strong regularity rasterization, weak regularity rasterization, and triangle rasterization.

[0056] 14) Strong Regularity Gridding (SRG): A type of gridding that can achieve quadrilateralization by introducing at most one singular point inside a block. The gridding result only contains quadrilaterals.

[0057] 15) Weak Regularity Gridding (WRG): A type of gridding that requires at least two singular points to be introduced inside a block to achieve quadrilateralization. The gridding result also only contains quadrilaterals.

[0058] 16) Triangular Gridding (TG): A method of achieving gridding by triangulating the interior of a block.

[0059] 17) Target Gridding Type: The worst gridding type that the user requires the block to achieve after layout subdivision. Generally speaking, based on the difficulty of solving and the gridding effect, the gridding types from best to worst are SRG, WRG, and TG. If no solution result can be obtained under the target gridding type, it means that the user's requirements cannot be met and the solution failure message is returned.

[0060] 18) Mesh Model: A model that uses a series of polygons (usually triangles or quadrilaterals) of similar size and shape to approximate a three-dimensional object.

[0061] 19) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

[0062] During the implementation of the embodiments of the present application, the applicant discovered that the related technology has the following problems:

[0063] In the related art, for the subdivision of the grid in the grid model, the grid is usually subdivided directly at equal intervals. Since different grids in the grid model may have different subdivision requirements, the subdivision method in the related art cannot meet the different subdivision requirements, resulting in poor quality of grid subdivision.

[0064] Embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for processing a mesh model, which can effectively improve the mesh subdivision quality of the mesh model. An exemplary application of the mesh model processing system provided in embodiments of the present application is described below.

[0065] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of the grid model processing system 100 provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0066] The terminal 400 is used for the user to use the client 410 to display the updated grid model on the graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0067] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, a car terminal, etc., but is not limited thereto. The electronic device provided in the embodiment of the present application may be implemented as a terminal or as a server. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application.

[0068] In some embodiments, the server 200 obtains an initial grid model, combines a grid point number threshold and an expected grid point number of each initial grid boundary, predicts the grid point number of each initial grid boundary, obtains a predicted grid point number, and based on the predicted grid point number, subdivides each initial grid in the initial grid model to obtain an updated grid model, and sends the updated grid model to the terminal 400.

[0069] In other embodiments, the terminal 400 obtains an initial grid model, combines a grid point number threshold and an expected grid point number of each initial grid boundary, predicts the grid point number of each initial grid boundary, obtains a predicted grid point number, and based on the predicted grid point number, subdivides each initial grid in the initial grid model to obtain an updated grid model, and sends the updated grid model to the server 200.

[0070] In other embodiments, the embodiments of the present application can be implemented with the aid of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.

[0071] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources.

[0072] See also Figure 2 , Figure 2 is a schematic diagram of a structure of an electronic device 500 for processing a grid model provided in an embodiment of the present application, wherein: Figure 2 The electronic device 500 shown may be Figure 1 The server 200 or the terminal 400 in Figure 2 The electronic device 500 shown includes: at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0073] Processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0074] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 430.

[0075] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0076] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0077] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0078] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0079] In some embodiments, the grid model processing device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A processing device 455 of a grid model stored in a memory 450 is shown, which may be software in the form of a program or a plug-in, and includes the following software modules: an acquisition module 4551, a prediction module 4552, and a grid subdivision module 4553. These modules are logical, and thus may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0080] In other embodiments, the processing device of the grid model provided in the embodiments of the present application can be implemented in hardware. As an example, the processing device of the grid model provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the processing method of the grid model provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0081] In some embodiments, the terminal or server can implement the processing method of the grid model provided in the embodiment of the present application by running a computer program or a computer executable instruction. For example, the computer program can be a native program (for example, a dedicated grid model processing program) or a software module in the operating system, for example, a processing module of the grid model that can be embedded in any program (such as an instant messaging client, an album program, an electronic map client, a navigation client); for example, it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0082] The processing method of the grid model provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server or terminal provided in the embodiment of the present application.

[0083] See also Figure 3 , Figure 3 is a flowchart of a method for processing a grid model provided in an embodiment of the present application, which will be combined with Figure 3 Steps 101 to 103 are shown for illustration. The grid model processing method provided in the embodiment of the present application can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. The following description will be given by taking the server alone as an example.

[0084] In step 101, an initial mesh model including at least one initial mesh is obtained.

[0085] In some embodiments, the mesh model is a model that uses a series of polygons (usually triangles) of similar size and shape to approximate a three-dimensional object, and the initial mesh model is a mesh model that includes at least one initial mesh.

[0086] In some embodiments, the initial mesh includes multiple initial mesh boundaries. For example, when the initial mesh is a square mesh, the four mesh edges of the square mesh are the initial mesh boundaries of the initial mesh. For another example, when the initial mesh is a triangular mesh, the three mesh edges of the triangular mesh are the initial mesh boundaries of the initial mesh.

[0087] In some embodiments, see Figure 4 , Figure 4 is a flowchart of a method for processing a grid model provided in an embodiment of the present application. Figure 3 Before step 102, the following steps may be performed for each initial grid boundary in each initial grid model: Figure 4 Steps 104A through 107A are shown to determine the desired number of grid points.

[0088] In step 104A, the expected side length of the subdivided mesh is obtained, and the boundary length of the initial mesh boundary is determined.

[0089] In some embodiments, the expected side length is used to indicate the expected side length of the subdivided grid. The expected side length is positively correlated with the size of the subdivided grid. The longer the expected side length is, the larger the size of the corresponding subdivided grid is. The shorter the expected side length is, the smaller the size of the corresponding subdivided grid is.

[0090] In step 105A, the boundary length and the expected side length are divided to obtain a division result.

[0091] As an example, the expression of the above division result can be:

[0092]

[0093] Among them, C is used to indicate the division result, B is used to indicate the boundary length, and Q is used to indicate the expected side length.

[0094] In step 106A, when the division result is an integer, the division result is determined as the expected number of grid points of the initial grid boundary.

[0095] In some embodiments, when the division result is an integer, it indicates that an integer multiple of the expected side length is the boundary length, that is, the side length can be equally divided into integer multiples of the expected side length, and the number of grid points is used to indicate the number of grid points on the boundary. Then the division result is the expected number of grid points of the initial grid boundary.

[0096] In step 107A, when the division result is not an integer, the division result is rounded to obtain the expected number of grid points of the initial grid boundary.

[0097] In some embodiments, when the division result is not an integer, it means that the integer multiple of the expected side length is not the boundary length, that is, the side length cannot be divided into integer multiples of the expected side length. The number of grid points is used to indicate the number of grid points on the boundary. The division result is rounded, and the rounded result is the expected number of grid points on the initial grid boundary.

[0098] In this way, by obtaining the expected side length of the subdivided grid and determining the boundary length of the initial grid boundary, the boundary length and the expected side length are divided to obtain a division result. When the division result is an integer, the division result is determined as the expected number of grid points in the initial grid boundary. Since the expected side length reflects the expected side length for the subdivided grid, the expected number of grid points in the initial grid boundary can be accurately obtained by dividing the boundary length and the expected side length.

[0099] In some embodiments, see Figure 5 , Figure 5 is a flowchart of a method for processing a grid model provided in an embodiment of the present application. Figure 3 Before step 102, the following steps may be performed for each initial grid boundary in each initial grid model: Figure 5 Steps 104B through 106B are shown to determine the desired number of grid points.

[0100] In step 104B, sampling is performed on the initial grid boundary to obtain a plurality of boundary sampling points on the initial grid boundary.

[0101] In some embodiments, the above step 1041B can be implemented in the following manner: performing multiple random samplings on the initial grid boundary to obtain boundary sampling points on the initial grid boundary corresponding to each random sampling.

[0102] In some other embodiments, the above step 1041B may be implemented in the following manner: performing equal-interval sampling on the initial grid boundary to obtain a plurality of boundary sampling points on the initial grid boundary.

[0103] In step 105B, the curvature of the initial mesh boundary at each boundary sampling point is obtained, and each curvature is weighted averaged to obtain a target curvature of the initial mesh boundary.

[0104] In some embodiments, the curvature is the rotation rate of the tangent direction angle to the arc length at a point on the curve, which is defined by differentiation and indicates the degree to which the curve deviates from a straight line. Mathematically, it is a numerical value indicating the curvature of the curve at a certain point.

[0105] As an example, the expression of the above target curvature can be:

[0106]

[0107] Where W is used to indicate the target curvature, W1 to W N It is used to indicate the curvature of the initial mesh boundary at each boundary sampling point, and N is used to indicate the number of boundary sampling points on the initial mesh boundary.

[0108] In step 106B, an adjustment coefficient is obtained, and the target curvature and the adjustment coefficient are multiplied to obtain the expected number of grid points of the initial grid boundary.

[0109] As an example, the expression for the expected number of grid points can be:

[0110] R=KW (3)

[0111] Wherein, R is used to indicate the expected number of grid points, W is used to indicate the target curvature, and K is used to indicate the adjustment coefficient.

[0112] In this way, by sampling on the boundary of the initial grid, a plurality of boundary sampling points on the boundary of the initial grid are obtained, the curvature of the initial grid boundary at each boundary sampling point is obtained, each curvature is weighted averaged to obtain the target curvature of the initial grid boundary, and the target curvature and the adjustment coefficient are multiplied to obtain the expected number of grid points of the initial grid boundary, so that the expected number of grid points of the initial grid boundary is positively correlated with the target curvature of the initial grid boundary, that is, the larger the target curvature, the larger the expected number of grid points corresponding to the initial grid boundary, so that according to the target curvature, the expected number of grid points corresponding to the initial grid boundary with different target curvatures is different, so that the initial grid is meshed based on the expected number of grid points, so that the larger the target curvature, the larger the mesh subdivision degree corresponding to the initial grid, and the smaller the target curvature, the smaller the mesh subdivision degree corresponding to the initial grid, so that different initial grids are meshed with different subdivision degrees, so as to meet the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the mesh model.

[0113] In step 102, for each initial grid model, the number of grid points of each initial grid boundary in the initial grid model is predicted in combination with the grid point number threshold and the expected number of grid points of each initial grid boundary to obtain the predicted number of grid points of each initial grid boundary.

[0114] In some embodiments, the difference between the predicted number of grid points and the corresponding expected number of grid points is less than a grid point number threshold.

[0115] In some embodiments, the above-mentioned process of grid point number prediction can be implemented by integer programming. Integer programming refers to the restriction of variables (all or part) in the programming to integers. If the variables are restricted to integers in a linear model, it is called integer linear programming. The popular methods for solving integer programming are often only applicable to integer linear programming. A type of mathematical programming that requires all or part of the variables in the solution of the problem to be integers. Integer programming can be further divided into linear, quadratic and nonlinear integer programming based on the composition of the constraints.

[0116] In some embodiments, the above-mentioned grid point number threshold corresponds to the grid point number boundary constraint condition in integer linear programming. The grid point number boundary constraint condition is described below.

[0117] In some embodiments, the grid point number boundary constraint condition can ensure that the predicted grid point number is within the upper and lower bounds given by the grid point number threshold. The grid point number boundary constraint condition can be expressed as:

[0118] x i -α i ≥ lb i ,x i +β i ≤ub i (4)

[0119] Among them, x i Used to indicate the number of prediction grid points, variable α i ,β i ∈N, indicating the number of predicted grid points x i The expected number of grid points The positive and negative deviations between the upper and lower limits are [lb i ,ub i ].

[0120] In some embodiments, see Figure 6 , Figure 6 is a flow chart of a method for processing a grid model provided in an embodiment of the present application, Figure 3 The step 102 shown can be performed for each initial grid boundary in the initial grid model. Figure 6 Steps 1021A to 1024A are implemented as shown.

[0121] In step 1021A, an initial grid point number threshold is obtained, and the initial grid point number threshold is combined with the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the initial grid point number of the initial grid boundary.

[0122] In some embodiments, different grid point number thresholds correspond to different grid point number boundary constraints, and the numerical value of the grid point number threshold is negatively correlated with the constraint degree of the grid point number boundary constraint, that is, the larger the numerical value of the grid point number threshold, the smaller the constraint degree of the corresponding grid point number boundary constraint, and the smaller the numerical value of the grid point number threshold, the greater the constraint degree of the corresponding grid point number boundary constraint.

[0123] In some embodiments, when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not meet the grid point number boundary constraint, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then the following two methods can be used to determine the predicted grid point number, which are explained below respectively.

[0124] In some embodiments, after executing the above step 1021A, the predicted number of grid points can also be determined in the following manner: when the difference between the initial number of grid points and the corresponding expected number of grid points is greater than or equal to the initial grid point number threshold, the target grid point number threshold is obtained, and the target grid point number threshold is greater than the initial grid point number threshold; combining the target grid point number threshold and the expected number of grid points of the initial grid boundary, the initial grid boundary is predicted to obtain the target number of grid points of the initial grid boundary; when the difference between the target number of grid points and the corresponding expected number of grid points is less than the target grid point number threshold, the target number of grid points is determined as the predicted number of grid points of the initial grid boundary.

[0125] In some embodiments, when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not satisfy the grid point number boundary constraint condition, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then, a target grid point number threshold value larger than the initial grid point number threshold value can be obtained to adopt a broader grid point number boundary constraint condition for grid point number prediction. When the difference between the obtained target grid point number and the corresponding expected grid point number is less than the target grid point number threshold value, it means that the obtained target grid point number satisfies the grid point number boundary constraint condition corresponding to the target grid point number threshold value. Then, the target grid point number is directly determined as the predicted grid point number of the initial grid boundary.

[0126] In some embodiments, when the difference between the target grid point number and the corresponding expected grid point number is greater than or equal to the target grid point number threshold, it means that the determined target grid point number does not satisfy the grid point number boundary constraint, which means that the target grid point number at this time cannot be used as the predicted grid point number. Then, a grid point number threshold larger than the target grid point number threshold can be obtained for grid point number prediction until the predicted grid point number that satisfies the grid point number boundary constraint is obtained.

[0127] In this way, when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not meet the grid point number boundary constraint condition, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then, a target grid point number threshold value larger than the initial grid point number threshold can be obtained to adopt a broader grid point number boundary constraint condition for grid point number prediction. When the difference between the obtained target grid point number and the corresponding expected grid point number is less than the target grid point number threshold, it means that the obtained target grid point number meets the grid point number boundary constraint condition corresponding to the target grid point number threshold. Then, the target grid point number is directly determined as the predicted grid point number of the initial grid boundary. In this way, it is ensured that the predicted grid point number can be determined, thereby ensuring the output stability of the predicted grid point number.

[0128] In other embodiments, after executing step 1021A above, the predicted number of grid points may also be determined in the following manner: when the difference between the initial number of grid points and the corresponding expected number of grid points is greater than or equal to the initial number of grid points threshold, the predicted number of grid points is determined to be zero.

[0129] In some embodiments, the initial grid point number threshold is a positive integer greater than zero.

[0130] In some embodiments, when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not satisfy the grid point number boundary constraint, which means that the initial grid point number at this time cannot be used as the predicted grid point number. In this case, zero can be determined as the predicted grid point number, that is, zero is less than the initial grid point number threshold.

[0131] In this way, when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not satisfy the grid point number boundary constraint, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then zero can be determined as the predicted grid point number, which ensures that the difference between the predicted grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, so that the predicted grid point number can satisfy the grid point number boundary constraint, effectively ensuring the effectiveness of the grid point number boundary constraint.

[0132] In step 1022A, when the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, a reference grid point number threshold is obtained.

[0133] In some embodiments, the reference grid point number threshold is less than the initial grid point number threshold.

[0134] In some embodiments, different grid point number thresholds correspond to different grid point number boundary constraints, and the numerical value of the grid point number threshold is negatively correlated with the constraint degree of the grid point number boundary constraint, that is, the larger the numerical value of the grid point number threshold, the smaller the constraint degree of the corresponding grid point number boundary constraint, and the smaller the numerical value of the grid point number threshold, the greater the constraint degree of the corresponding grid point number boundary constraint. The constraint degree of the grid point number boundary constraint is positively correlated with the accuracy of the predicted grid point number, that is, the greater the constraint degree of the grid point number boundary constraint, the higher the accuracy of the predicted grid point number that meets the grid point number boundary constraint.

[0135] In some embodiments, when the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, it means that the determined initial grid point number can satisfy the grid point number boundary constraint corresponding to the initial grid point number threshold. Then, a reference grid point number threshold that is less than the initial grid point number threshold can be obtained, so as to set a stronger grid point number boundary constraint through a smaller grid point number threshold and perform the grid point number threshold, in order to find a more accurate predicted grid point number, thereby effectively ensuring the prediction accuracy of the predicted grid point number.

[0136] In step 1023A, the reference grid point number threshold and the expected grid point number of the initial grid boundary are combined to predict the grid point number of the initial grid boundary to obtain the reference grid point number of the initial grid boundary.

[0137] In some embodiments, the reference grid point number threshold includes an i-th reference grid point number threshold, 1≤i≤N, and N is used to indicate the number of reference grid point number thresholds.

[0138] In some embodiments, the numerical value of i is negatively correlated with the numerical value of the i-th reference grid point number threshold, that is, the larger the numerical value of i, the larger the corresponding numerical value of the i-th reference grid point number threshold, and the smaller the numerical value of i, the smaller the corresponding numerical value of the i-th reference grid point number threshold.

[0139] In some embodiments, the larger the value of the i-th reference grid point number threshold, the smaller the constraint degree of the corresponding grid point number boundary constraint condition, and the smaller the value of the i-th reference grid point number threshold, the larger the constraint degree of the corresponding grid point number boundary constraint condition. The constraint degree of the grid point number boundary constraint condition is positively correlated with the accuracy of the predicted grid point number, that is, the larger the constraint degree of the grid point number boundary constraint condition, the higher the accuracy of the predicted grid point number that meets the grid point number boundary constraint condition.

[0140] In some embodiments, the above step 1023A can be implemented as follows: traverse i and perform the following processing until the reference grid point number of the initial grid boundary is obtained: combine the i-th reference grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the i-th reference grid point number of the initial grid boundary; when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, the first reference grid point number is determined as the reference grid point number; when the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, the difference between the i-1th reference grid point number and the corresponding expected grid point number is less than the i-1th reference grid point number threshold, and i is greater than 1, the i-1th reference grid point number is determined as the reference grid point number.

[0141] In some embodiments, when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, it means that the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold. At this time, there is no need to continue traversing i, that is, the reference grid point number threshold that is smaller than the first reference grid point number threshold will correspond to a more stringent grid point number boundary constraint. If the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold, then a more stringent grid point number boundary constraint will not result in a reference grid point number that satisfies the grid point number boundary constraint. In this case, the first reference grid point number can be directly determined as the reference grid point number.

[0142] In some embodiments, when the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, it means that the determined i-th reference grid point number cannot satisfy the grid point number boundary constraint corresponding to the i-th reference grid point number threshold; when the difference between the i-1-th reference grid point number and the corresponding expected grid point number is less than the i-1-th reference grid point number threshold, it means that the determined i-1-th reference grid point number can satisfy the grid point number boundary constraint corresponding to the i-1-th reference grid point number threshold, then the i-1-th reference grid point number can be determined as the reference grid point number.

[0143] As an example, the number of grid points of the initial grid boundary is predicted in combination with the first reference grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the first reference grid point number of the initial grid boundary; when the difference between the first reference grid point number and the corresponding expected number of grid points is less than the first reference grid point number threshold, the number of grid points of the initial grid boundary is predicted in combination with the second reference grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the second reference grid point number of the initial grid boundary; when the difference between the second reference grid point number and the corresponding expected number of grid points is greater than or equal to the second reference grid point number threshold and the difference between the first reference grid point number and the corresponding expected number of grid points is less than the first reference grid point number threshold, the first reference grid point number is determined as the reference grid point number.

[0144] As an example, the number of grid points of the initial grid boundary is predicted in combination with the first reference grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the first reference grid point number of the initial grid boundary; when the difference between the first reference grid point number and the corresponding expected grid point number is less than the first reference grid point number threshold, the number of grid points of the initial grid boundary is predicted in combination with the second reference grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the second reference grid point number of the initial grid boundary; when the difference between the second reference grid point number and the corresponding expected number of grid points is less than the second reference grid point number threshold, the number of grid points of the initial grid boundary is predicted in combination with the third reference grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the third reference grid point number of the initial grid boundary; when the difference between the third reference grid point number and the corresponding expected number of grid points is greater than or equal to the third reference grid point number threshold and the difference between the second reference grid point number and the corresponding expected number of grid points is less than the second reference grid point number threshold, the second reference grid point number is determined as the reference grid point number.

[0145] As an example, when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, the first reference grid point number is determined as the reference grid point number.

[0146] In this way, when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, it means that the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold. At this time, there is no need to continue traversing i, that is, the reference grid point number threshold that is smaller than the first reference grid point number threshold will correspond to a more stringent grid point number boundary constraint. If the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold, then the more stringent grid point number boundary constraint will not obtain the reference grid point number that satisfies the grid point number boundary constraint. In this case, the first reference grid point number can be directly determined as the reference grid point number, so there is no need to continue traversing, thereby effectively improving the efficiency of grid refinement.

[0147] In this way, when the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, it means that the determined i-th reference grid point number cannot meet the grid point number boundary constraint corresponding to the i-th reference grid point number threshold; when the difference between the i-1-th reference grid point number and the corresponding expected grid point number is less than the i-1-th reference grid point number threshold, it means that the determined i-1-th reference grid point number can meet the grid point number boundary constraint corresponding to the i-1-th reference grid point number threshold. Then the i-1-th reference grid point number can be determined as the reference grid point number, so that a more accurate reference grid point number can be found through traversal, which effectively improves the accuracy of the reference grid point number.

[0148] In step 1024A, the predicted number of grid points of the initial grid boundary is determined based on the reference number of grid points and the initial number of grid points.

[0149] In some embodiments, the above step 1024A can be implemented as follows: compare the reference grid point number and the initial grid point number; when the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, determine the initial grid point number as the predicted grid point number of the initial grid boundary; when the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, determine the reference grid point number as the predicted grid point number of the initial grid boundary.

[0150] Continuing with the above example, when the number of reference grid points is the second reference grid point number, the corresponding reference grid point number threshold is the second reference grid point number threshold, and the difference between the second reference grid point number and the corresponding expected grid point number is less than the second reference grid point number threshold, that is, the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, then the second reference grid point number is determined as the predicted grid point number of the initial grid boundary.

[0151] Continuing with the above example, when the number of reference grid points is the first reference grid point number, the corresponding reference grid point number threshold is the first reference grid point number threshold, and the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, that is, when the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, the initial grid point number is determined as the predicted grid point number of the initial grid boundary.

[0152] In this way, when the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, it means that the reference grid point number cannot meet the grid point number boundary constraint condition, then the initial grid point number can be determined as the predicted grid point number of the initial grid boundary; when the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, it means that the reference grid point number can meet the grid point number boundary constraint condition, then the reference grid point number is determined as the predicted grid point number of the initial grid boundary; by determining a more accurate predicted grid point number that can meet the grid point number boundary constraint condition from the reference grid point number and the initial grid point number, the accuracy of the determined predicted grid point number is effectively improved.

[0153] In some embodiments, see Figure 7 , Figure 7 is a flow chart of a method for processing a grid model provided in an embodiment of the present application, Figure 3 The step 102 shown can be performed for each initial grid boundary in the initial grid model. Figure 7 Steps 1021B to 1023B are implemented as shown.

[0154] In step 1021B, grid point number constraints are obtained, where the grid point number constraints include the j-th grid point number constraints.

[0155] In some embodiments, 1≤j≤M, M is used to indicate the total number of grid point constraint conditions, and the numerical value of j is positively correlated with the constraint strength of the jth grid point constraint condition.

[0156] As an example, the above-mentioned grid point number constraints include parity constraints, regularity constraints and grid point number boundary constraints, and the j-th grid point number constraint can be at least one of the above-mentioned parity constraints, regularity constraints and grid point number boundary constraints.

[0157] In some embodiments, the parity constraint is used to constrain in each initial grid that the sum of the number of grid points on the borders of all initial grids is an even number. The expression of the parity constraint can be:

[0158]

[0159] Among them, ∑ i x i is used to indicate each initial grid boundary of the initial grid, and n is used to indicate a positive integer.

[0160] In some embodiments, the regularity constraint conditions have different forms for different polygonal initial meshes, which will be described below respectively.

[0161] For the initial triangular mesh, the regularity constraint of the triangular block can be that the number of grid points on any one of its sides must be less than the sum of the number of grid points on the other two sides, that is:

[0162]

[0163] Among them, e i-1 、e i+1 、e i Three initial mesh boundaries indicating the initial mesh of triangles.

[0164] For the quadrilateral initial grid, the regularity constraint of the quadrilateral initial grid is that the number of grid points on its opposite sides is the same, that is:

[0165]

[0166] Among them, e i and e i+2 are the opposite sides of the quadrilateral initial mesh, that is, the non-adjacent initial mesh boundaries.

[0167] For the pentagonal initial grid, the regularity constraint of the pentagonal initial grid is that the sum of the number of grid points of any three connected edges is greater than the sum of the number of grid points of the remaining two connected edges, that is:

[0168]

[0169] Among them, e i-1 、e i 、e i+1 、e i-2 、e i+2 , used to indicate the initial mesh boundary of the pentagonal initial mesh.

[0170] For the hexagonal initial grid, the regularity constraints of the hexagonal initial grid are the following two constraints:

[0171] First, the number of grid points of any initial grid boundary is less than the sum of the number of grid points of the two initial grid boundaries between it, that is:

[0172]

[0173] Among them, e i 、e i+2 and e i-2 Used to indicate any initial mesh boundary, and the two initial mesh boundaries between them.

[0174] Secondly, the sum of the number of grid points of all three alternating edges is an even number, that is:

[0175]

[0176] In some embodiments, traversal j executes the following steps 1022B to 1023B until the predicted number of grid points of the initial grid boundary is obtained.

[0177] In step 1022B, the grid point number threshold, the expected grid point number of the initial grid boundary and the jth grid point number constraint are combined to perform the jth grid point number prediction on the initial grid boundary to obtain the jth prediction result.

[0178] As an example, the first grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the first grid point number constraint to obtain the first prediction result, wherein the first grid point number constraint may include a parity constraint, a regularity constraint and a grid point number boundary constraint, that is, when the first prediction result satisfies the first grid point number constraint, it means that the first prediction result satisfies the parity constraint, the regularity constraint, and the grid point number boundary constraint.

[0179] As an example, combining the grid point number threshold, the expected grid point number of the initial grid boundary and the second grid point number constraint, the second grid point number prediction is performed on the initial grid boundary to obtain the second prediction result, wherein the second grid point number constraint may include a parity constraint and a grid point number boundary constraint, which means that the second prediction result satisfies the parity constraint and the grid point number boundary constraint.

[0180] As an example, combining the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint, the third grid point number prediction is performed on the initial grid boundary to obtain the third prediction result, wherein the third grid point number constraint may include a grid point number boundary constraint, which means that the third prediction result satisfies the grid point number boundary constraint.

[0181] In step 1023B, when the jth prediction result indicates that the jth grid point number prediction can generate the jth predicted grid point number that satisfies the jth grid point number constraint, the jth predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0182] Continuing with the above example, the first grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the first grid point number constraint to obtain the first prediction result. When the first prediction result indicates that the first grid point number prediction can generate the first predicted grid point number that satisfies the first grid point number constraint, the first predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0183] Continuing with the above example, the first grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the first grid point number constraint to obtain the first prediction result; when the first prediction result indicates that the first grid point number prediction cannot generate the first predicted grid point number that satisfies the first grid point number constraint, the second grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the second grid point number constraint to obtain the second prediction result; when the second prediction result indicates that the second grid point number prediction can generate the second predicted grid point number that satisfies the second grid point number constraint, the second predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0184] Continuing with the above example, the grid point number threshold, the expected grid point number of the initial grid boundary and the first grid point number constraint are combined to predict the number of grid points for the first time on the initial grid boundary to obtain the first prediction result; when the first prediction result indicates that the first grid point number prediction cannot generate the first predicted grid point number that satisfies the first grid point number constraint, the grid point number threshold, the expected grid point number of the initial grid boundary and the second grid point number constraint are combined to predict the number of grid points for the second time on the initial grid boundary to obtain the second prediction result; when the second prediction result indicates that the second grid point number prediction cannot generate the second predicted grid point number that satisfies the second grid point number constraint, the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint are combined to predict the number of grid points for the third time on the initial grid boundary to obtain the third prediction result; when the third prediction result indicates that the third grid point number prediction can generate the third predicted grid point number that satisfies the third grid point number constraint, the third predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0185] In this way, by predicting the number of grid points in sequence from strong to weak grid point constraints, when the j-th prediction result indicates that the j-th grid point number prediction can generate the j-th predicted grid point number that satisfies the j-th grid point number constraint, the j-th predicted grid point number is determined as the predicted grid point number of the initial grid boundary, so that the optimal predicted grid point number can be found, and the grid point number constraint satisfied by the predicted grid point number is moderate, thereby effectively improving the prediction accuracy of the predicted grid point number.

[0186] In some embodiments, see Figure 8 , Figure 8 is a flow chart of a method for processing a grid model provided in an embodiment of the present application, Figure 3 The step 102 shown can be performed for each initial grid boundary in the initial grid model. Figure 8 Steps 1021C to 1024C are implemented as shown.

[0187] In step 1021C, the grid point number constraint is obtained.

[0188] In some embodiments, the grid point number constraint includes the jth grid point number constraint, 1≤j≤M, M is used to indicate the total number of grid point number constraints, and the numerical value of j is positively correlated with the constraint strength of the jth grid point number constraint.

[0189] As an example, the above-mentioned grid point number constraints include parity constraints, regularity constraints and grid point number boundary constraints, and the j-th grid point number constraint can be at least one of the above-mentioned parity constraints, regularity constraints and grid point number boundary constraints.

[0190] In step 1022C, the Tth grid point number constraint corresponding to the initial grid boundary is determined from the grid point number constraints.

[0191] In some embodiments, 1≤T≤M.

[0192] In some embodiments, the above step 1022C may be implemented in the following manner: in response to a selection operation on a grid point number constraint, determining the Tth grid point number constraint corresponding to the selected initial grid boundary from the grid point number constraints.

[0193] In some embodiments, the traversal t performs the following steps 1023C to 1024C until the predicted number of grid points of the initial grid boundary is obtained.

[0194] In step 1023C, the grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint are combined to perform the tth grid point number prediction on the initial grid boundary to obtain the tth prediction result.

[0195] As an example, when t=1, the first grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the first grid point number constraint to obtain the first prediction result, wherein the first grid point number constraint may include a parity constraint, a regularity constraint and a grid point number boundary constraint, that is, when the first prediction result satisfies the first grid point number constraint, it means that the first prediction result satisfies the parity constraint, the regularity constraint, and the grid point number boundary constraint.

[0196] As an example, when t=2, the second grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the second grid point number constraint to obtain the second prediction result, wherein the second grid point number constraint may include a parity constraint and a grid point number boundary constraint, which means that the second prediction result satisfies the parity constraint and the grid point number boundary constraint.

[0197] As an example, when t=3, the third grid point number prediction is performed on the initial grid boundary based on the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint to obtain the third prediction result, wherein the third grid point number constraint may include a grid point number boundary constraint, which means that the third prediction result satisfies the grid point number boundary constraint.

[0198] In step 1024C, when the tth prediction result indicates that the tth grid point number prediction can generate the tth predicted grid point number that satisfies the tth grid point number constraint, the tth predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0199] In some embodiments, T≤t≤M.

[0200] Continuing with the above example, when t=1, the grid point number threshold, the expected grid point number of the initial grid boundary, and the first grid point number constraint are combined to predict the first grid point number of the initial grid boundary to obtain the first prediction result; when the first prediction result indicates that the first grid point number prediction cannot generate the first predicted grid point number that satisfies the first grid point number constraint, the grid point number threshold, the expected grid point number of the initial grid boundary, and the second grid point number constraint are combined to predict the second grid point number of the initial grid boundary to obtain the second prediction result. When the second prediction result indicates that the second grid point number prediction cannot generate the second predicted grid point number that satisfies the second grid point number constraint, the third grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint to obtain the third prediction result; when the third prediction result indicates that the third grid point number prediction can generate the third predicted grid point number that satisfies the third grid point number constraint, the third predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0201] Continuing with the above example, when t=2, the second grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the second grid point number constraint to obtain the second prediction result; when the second prediction result indicates that the second grid point number prediction cannot generate the second predicted grid point number that satisfies the second grid point number constraint, the third grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint to obtain the third prediction result; when the third prediction result indicates that the third grid point number prediction can generate the third predicted grid point number that satisfies the third grid point number constraint, the third predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0202] Continuing with the above example, when t=3, the third grid point number prediction is performed on the initial grid boundary in combination with the grid point number threshold, the expected grid point number of the initial grid boundary and the third grid point number constraint to obtain the third prediction result. When the third prediction result indicates that the third grid point number prediction can generate the third predicted grid point number that satisfies the third grid point number constraint, the third predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

[0203] In this way, by obtaining the grid point number constraint, the Tth grid point number constraint corresponding to the initial grid boundary is determined from the grid point number constraint, and the grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint are combined to perform the tth grid point number prediction on the initial grid boundary to obtain the tth prediction result, so that it is possible to respond to the selection operation on the grid point number constraint, determine the Tth grid point number constraint corresponding to the selected initial grid boundary from the grid point number constraint, and start traversing from the Tth grid point number constraint to determine the best predicted grid point number, thereby effectively shortening the time for traversing to determine the predicted grid point number and effectively improving the generation efficiency of the predicted grid point number.

[0204] In step 103, each initial grid in the initial grid model is subdivided based on the predicted number of grid points of each initial grid boundary to obtain an updated grid model including a plurality of target grids.

[0205] In some embodiments, the target grid boundaries of the target grid correspond to the initial grid boundaries one-to-one, and the target grid boundaries of the target grid coincide with the corresponding initial grid boundaries.

[0206] In some embodiments, each target mesh of the updated mesh model includes a plurality of subdivided meshes, and the number of vertices of the subdivided meshes on the boundary of each target mesh of the target mesh is equal to the corresponding number of predicted grid points.

[0207] In some embodiments, for each target mesh boundary of the target mesh, the number of vertices of the subdivided mesh on the target mesh boundary of the target mesh is equal to the number of predicted grid points corresponding to the initial mesh boundary corresponding to the target mesh boundary.

[0208] In some embodiments, see Fig. 9 , Fig. 9 is a flow chart of a method for processing a grid model provided in an embodiment of the present application, Figure 3 The illustrated step 103 may be performed by Fig. 9 Steps 1031 to 1033 are shown to be implemented.

[0209] In step 1031, for each initial grid in the initial grid model, a target grid subdivision method of the initial grid is determined based on the predicted number of grid points of each initial grid.

[0210] In some embodiments, different grid subdivision methods require different constraints on the number of grid points of each predicted grid point of the initial grid.

[0211] In some embodiments, the above-mentioned step 1031 can be implemented in the following manner: combining the predicted grid point numbers of the initial grid, determining the grid point number constraints satisfied by the predicted grid point numbers of the initial grid; obtaining a mapping relationship between multiple preset constraints and corresponding preset grid subdivision methods, and comparing the grid point number constraints with each preset constraint in the mapping relationship, respectively, to obtain a comparison result corresponding to the grid point number constraint; when the comparison result indicates that there is a grid point number constraint among the multiple preset constraints, determining the preset grid subdivision method corresponding to the grid point number constraint in the mapping relationship as the target grid subdivision method of the initial grid.

[0212] As an example, refer to Table 1 below, which is a mapping relationship table between multiple preset constraint conditions and corresponding preset grid subdivision methods provided in an embodiment of the present application.

[0213] Table 1 Mapping relationship between multiple preset constraints and corresponding preset grid subdivision methods

[0214]

[0215] In some embodiments, the necessary and sufficient condition for strong regularity rasterization may be that the predicted number of grid points of the initial grid can satisfy the grid point number boundary constraint, parity constraint and regularity constraint; the necessary and sufficient condition for weak regularity rasterization may be that the predicted number of grid points of the initial grid can satisfy the grid point number boundary constraint and parity constraint; the necessary and sufficient condition for triangular rasterization may be that the predicted number of grid points of the initial grid can satisfy the grid point number boundary constraint.

[0216] As an example, when the grid point number constraints satisfied by the predicted grid point numbers of the initial grid are grid point number boundary constraints, parity constraints, and regularity constraints, the grid point number constraints are compared with the preset constraints in the mapping relationship respectively to obtain a comparison result corresponding to the grid point number constraints. If the comparison result indicates that there is a grid point number constraint among multiple preset constraints, the preset grid subdivision method corresponding to the grid point number constraint in the above mapping relationship, that is, strong regularity rasterization, is determined as the target grid subdivision method of the initial grid.

[0217] As an example, when the grid point number constraints satisfied by the predicted grid point numbers of the initial grid are grid point number boundary constraints and parity constraints, the grid point number constraints are compared with the preset constraints in the mapping relationship respectively to obtain a comparison result corresponding to the grid point number constraints. If the comparison result indicates that there is a grid point number constraint among multiple preset constraints, the preset grid subdivision method corresponding to the grid point number constraint in the above mapping relationship, that is, weak regularity rasterization, is determined as the target grid subdivision method of the initial grid.

[0218] In step 1032, the initial grid is subdivided according to the target grid subdivision method to obtain a target grid corresponding to the initial grid.

[0219] In some embodiments, a target grid boundary of a target grid coincides with an initial grid boundary of a corresponding initial grid.

[0220] In some embodiments, the grid subdivision method includes strong regularity rasterization, weak regularity rasterization and triangular rasterization, wherein strong regularity rasterization refers to a type of rasterization that requires only one singular point to be introduced inside the block to achieve quadrilateralization, and the rasterization result only contains quadrilaterals. Weak regularity rasterization refers to a type of rasterization that requires at least two singular points to be introduced inside the block to achieve quadrilateralization, and the rasterization result also only contains quadrilaterals. Triangular rasterization refers to a method of achieving rasterization by triangulation inside the block.

[0221] As an example, when the target grid subdivision method is strong regularity rasterization, the initial grid is subdivided according to the strong regularity rasterization to obtain the target grid corresponding to the initial grid.

[0222] In step 1033, each initial grid in the initial grid model is replaced with a corresponding target grid to obtain an updated grid model.

[0223] As an example, the initial grid model includes initial grid A, initial grid B and initial grid C. Initial grid A is replaced with the target grid corresponding to initial grid A, initial grid B is replaced with the target grid corresponding to initial grid B, and initial grid C is replaced with the target grid corresponding to initial grid C to obtain an updated grid model.

[0224] In this way, by combining the grid point number threshold and the expected grid point number of each initial grid boundary, the grid point number of each initial grid boundary is predicted respectively, and the predicted grid point number of each initial grid boundary is obtained. Based on the predicted grid point number of each initial grid boundary, each initial grid in the initial grid model is meshed and subdivided to obtain an updated grid model including multiple target grids, each target grid includes multiple subdivided grids, and the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. In this way, by meshing each initial grid in the initial grid model based on the predicted grid point number of each initial grid boundary, an updated grid model including multiple target grids is obtained, so that the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. Since the predicted grid point number corresponding to the initial grid is determined by the corresponding expected grid point number, different initial grids can meet the expected subdivision expectation of the expected grid point number when meshing, thereby meeting the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the grid model.

[0225] The following is an explanation of an exemplary application of the embodiments of the present application in an actual grid model application scenario.

[0226] The embodiments of the present application can be effectively applied in the layout subdivision module in the automatic retopology project. In the automatic retopology project, the embodiments of the present application will first identify the motion editing semantic area and the modeling editing semantic area based on the results of model understanding, and perform layout generation and layout subdivision; then generate the layout and subdivide the other areas (referred to as geometric areas in the embodiments of the present application) except the motion editing semantic area and the modeling editing semantic area; finally, rasterize the blocks in all areas according to the layout subdivision results.

[0227] In the above process, the layout generation and subdivision of the motion editing semantic area and the modeling editing semantic area only need to apply the mature templates summarized by artists to generate the layout and subdivision results that meet the requirements; for the geometric areas other than the motion editing semantic area and the modeling editing semantic area, after the layout is generated, the embodiment of the present application can model the layout subdivision problem as an integer linear programming through the embodiment of the present application, and then use the open source library to solve it. For all blocks, in order to obtain the best possible rasterization type, the embodiment of the present application adopts a downshift strategy so that the layout subdivision results can meet the requirements of strong regularity rasterization as much as possible. Within each constraint strength level, the embodiment of the present application also adopts an upper and lower bound constraint relaxation strategy to make the isometry in the solution result as optimal as possible.

[0228] By using the processing method of the grid model provided in the embodiment of the present application, on the one hand, it is possible to avoid introducing a large number of weight parameters, so that there is no need to tune parameters for different models, thereby improving the subdivision effect; on the other hand, it is also possible to greatly improve the solution speed, so that the general open source integer linear programming library can also meet the needs, thereby greatly reducing the development cost. Finally, due to the use of the downshift strategy and the upper and lower bound relaxation strategy, it is also possible to ensure that the algorithm obtains the best possible results within the time and space that the user can flexibly control.

[0229] In some embodiments, the layout subdivision of the motion editing semantic area and the geometric editing semantic area only needs to apply the template, which is irrelevant to the present invention, so only the layout subdivision scheme of the geometric area is described here. The embodiment of the present application first uniformly introduces the optimization goals and constraints in the modeling scheme based on integer linear programming (including strong regularity rasterization modeling, weak regularity rasterization modeling, and triangle rasterization modeling), and then introduces how to use the downshift strategy to perform modeling of different rasterization types at different constraint strength levels, and finally introduces how to implement the upper and lower bound constraint relaxation strategy within each constraint strength level, which will be explained separately below.

[0230] In some embodiments, for modeling based on integer linear programming, in order to reduce the complexity of the integer linear programming model, the embodiments of the present application often do not use the entire layout result as input at one time to establish a mathematical model, but put all or part of the blocks connected together to form a block group (Patch Cluster) as the input for solving the integer linear programming once. Since the generation method of the block group is irrelevant to the present invention, the embodiments of the present application can assume that all blocks on the current model have been divided into several block groups through a certain clustering algorithm. In the process of integer linear programming modeling of the current block group, there will be two types of sub-edges whose grid points have been determined in advance: 1) Sub-edges adjacent to the motion editing semantic area or the geometric editing semantic area; 2) Sub-edges adjacent to the block group for which the solution result has been obtained. In order to maintain compatibility, these sub-edges have the same number of grid points as their opposite sides. For these sub-edges, the embodiments of the present application directly set the number of grid points as a constant in the mathematical model.

[0231] For each sub-edge ei whose number of grid points is to be calculated, assume that its target number of grid points is The actual number of grid points is x i , and the upper and lower bounds of the number of grid points are This embodiment of the application introduces two additional variables Indicates the actual number of grid points x of the current sub-edge i The number of its target grid points The positive and negative deviations between them can define the optimization goals of all rasterization types as:

[0232] min∑ i α i +β i (11)

[0233] At the same time, the following grid point boundary constraints need to be given to ensure that the actual number of grid points is within the given upper and lower bounds:

[0234] x i -α i ≥ lb i ,x i +β i ≤ub i (12)

[0235] For the case where the rasterization result is required to be a quadrilateral (i.e., strong regularity rasterization and weak regularity rasterization), the embodiment of the present application also imposes a parity constraint, that is, in each block P, the sum of the number of grid points of all sub-edges is an even number:

[0236]

[0237] For the strong regularity rasterization type, the embodiment of the present application also imposes regularity constraints. The constraints have different forms for different polygonal blocks, which are introduced below.

[0238] Triangle: The necessary and sufficient condition for a triangle block to be strongly regularized is that the number of grid points on any one of its sides must be less than the sum of the number of grid points on the other two sides, that is:

[0239]

[0240] Quadrilateral: The necessary and sufficient condition for a quadrilateral block to be strongly regularized is that the number of grid points on its opposite sides is the same, that is,

[0241]

[0242] Pentagon: The necessary and sufficient condition for a pentagonal block to be strongly regularized is that the sum of the number of grid points of any three connected edges is greater than the sum of the number of grid points of the remaining two connected edges, that is,

[0243]

[0244] Hexagon: The necessary and sufficient conditions for a hexagonal block to be strongly regularized are: 1) The number of grid points on any edge is less than the sum of the number of grid points on the two edges that alternate with it, that is:

[0245]

[0246] The sum of the number of grid points of all three alternating edges is an even number, that is:

[0247]

[0248] For blocks with different numbers of edges, the embodiment of the present application only needs to add the above corresponding constraints to the constraint condition set of the model.

[0249] The above are the optimization objectives and all constraints of the integer linear programming model. It can be found that different rasterization types require different constraints. Table 2 summarizes the different constraints corresponding to different rasterization types.

[0250] Table 2 Correspondence between rasterization types and constraints

[0251]

[0252] Compared with the related technologies, the main advantages of the embodiments of the present application are mainly reflected in the following aspects: First, whether it is the optimization objective function or the constraints of the model, they are all linear expressions or inequalities. Therefore, the entire model belongs to an integer linear programming model, and can be quickly solved using the classic simplex algorithm + branch and bound method or the tangent plane method; secondly, weight parameters no longer appear in the model, and there is no need to tune parameters for different models; thirdly, different constraints can be imposed on different rasterization types, making it possible to generate mixed rasterization results of quadrilaterals and triangles, which meets the needs of art.

[0253] Generally speaking, according to the difficulty of solution and rasterization effect, the rasterization types are considered to be strong regularity rasterization, weak regularity rasterization and triangular rasterization from good to bad. However, strong regularity rasterization has the most constraints. If all blocks in the block group are required to meet the strong regularity constraints, it may not be possible to find a feasible solution; but if only the constraints corresponding to triangular rasterization are imposed on the blocks, the optimal solution may be missed.

[0254] In order to solve this problem, an embodiment of the present application proposes a downshift strategy, which allows the user to provide the target rasterization type for each block, that is, the worst tolerable rasterization type (if the user does not provide it, the default is triangle rasterization). Then this scheme starts with the optimal rasterization type for each block in the block group, and attempts to model and solve the integer linear programming. If successful (the number of sub-edge grid points can be determined based on the corresponding constraints), it returns, otherwise it continues to downshift until the actual rasterization type. The attempts here are divided into four levels, corresponding to different constraint strength levels, as shown in Table 2. Only when the current constraint strength level cannot obtain a feasible solution or times out, will the next constraint strength level be tried until a feasible solution is obtained, or the solution fails at the lowest constraint strength level. The algorithm process corresponding to the downshift strategy is as follows: set the rasterization type of all blocks to SRG, and then use the corresponding constraints to model and solve, and return true if successful; downgrade the rasterization type of the block with the target rasterization type of TG to WRG, and then use the corresponding constraints to model and solve, and return true if successful; downgrade the rasterization type of the block with the target rasterization type of WRG to WRG, and then use the corresponding constraints to model and solve, and return true if successful; downgrade the rasterization type of the block with the target rasterization type of TG to TG, and then use the corresponding constraints to model and solve, and return the solution result.

[0255] See Table 3 below, which is a table of correspondence between constraint strength levels and rasterization types provided in an embodiment of the present application.

[0256] Table 3 Correspondence between constraint strength levels and rasterization types provided in the embodiments of the present application

[0257]

[0258] In some embodiments, by adopting the downshift strategy, the target rasterization type can be flexibly specified. For example, for blocks in some important areas, the target rasterization type can be set to strong regularity; for blocks in less important areas (such as areas with poor visibility), the target rasterization type can be set to triangular regularity to improve the solution speed and solution success rate; after specifying the target rasterization type, the downshift strategy will still try to find the best result. From the test results, in most cases, the downshift strategy can obtain an actual rasterization type that is better than the target rasterization type.

[0259] In some embodiments, for the upper and lower bound constraint relaxation strategy, after adopting the downshift strategy, it is found that at each constraint strength level, whether the upper and lower bounds are reasonable also determines whether the model is bounded and the solution speed. To this end, the embodiment of the present application proposes an upper and lower bound constraint relaxation strategy based on the downshift strategy, so that within the same constraint strength level, the method of the embodiment of the present application can obtain the feasible solution with the best isometry. The specific method is: step one, when modeling and solving integer linear programming problems at each constraint strength level, execute the following steps two to four; step two, for each sub-edge with the number of grid points to be calculated, initialize the upper and lower bounds of its number of grid points to Then, according to the method in Section 3.2.1, integer linear programming modeling and solution are performed. If the solution fails, go to step three, otherwise go to step four; step three, it means that the loosest upper and lower bounds at the current constraint strength level cannot obtain a feasible solution, so the flag of solution failure at the current constraint strength level is returned; step four, record or update the current optimal solution result, and update δ=δ-1, and then perform integer linear programming modeling and solution again until the solution fails or the upper and lower bounds coincide; step five, return the current optimal solution as the final solution at the current constraint strength level.

[0260] In step 2 of the above method, δ is a floating value with upper and lower bounds, and the default initial value is 3. That is, the embodiment of the present application first sets the upper and lower bounds of the number of grid points for each sub-edge as Then solve it. If it fails, return directly. Otherwise, record the current solution and try to narrow the range of the upper and lower bounds to find a better solution. Repeat this cycle until no better solution can be obtained. Finally, return the best solution in the current record.

[0261] In some embodiments, see Fig.10 , Fig.10 This is a schematic diagram of the effect of mesh subdivision of mesh models in related technologies. For more complex models, the solution speed of related technologies is obviously very slow and cannot meet the needs. For simpler models, although the results can be obtained quickly, some local details of the mesh model will be irregular (such as Fig.10 In addition, since there are a large number of weight parameters that need to be coordinated in the optimization objective function, the distortion of the quadrilateralization results on some local details of the model is more obvious (such as Fig.10 91 in the figure).

[0262] In some embodiments, see Fig.11 , Fig.11 is a schematic diagram of the effect of the grid model processing method provided in the embodiment of the present application, Fig.11 Given and Fig.10The same grid model is used to obtain the subdivision result of the embodiment of the present application. It can be found that since the embodiment of the present application takes regularity as a constraint condition rather than an objective function, it can ensure that a given block meets the regularity requirement, thereby greatly reducing the distortion of the grid (such as Fig.11 In addition, since the embodiment of the present application can flexibly set the target number of grid points and the corresponding upper and lower bounds, a layout subdivision result that is sparser and closer to the target number of grid points can often be obtained than the integer nonlinear programming scheme, which to some extent also reduces the complexity of the model. If the user wants to get a denser model, he only needs to set the target number of grid points for each sub-edge to be larger.

[0263] In some embodiments, the target number of grid points is determined based on the length of the sub-edge, so that the gridding result has as many grids of uniform size as possible, i.e., uniform gridding. However, in some cases, the user wants the size of the grid to be related to the geometric complexity of the model surface, i.e., the grid in the area with rich details is denser, while the grid in the flat area is sparser.

[0264] In this case, you can sample at different positions of the current sub-edge, calculate the curvature σ of each sampling point, and then calculate the average curvature of these sampling points Then the target grid number of the current sub-edge can be obtained by Here k is the adjustment coefficient. In this case, the sub-edge with a larger average curvature has a larger number of target grid points. In this way, the layout subdivision related to the geometric complexity of the model surface can be achieved.

[0265] In some embodiments, the user is required to provide a target rasterization type (i.e., the worst rasterization type), and then all blocks are tried starting from strong regularity rasterization until they are downgraded to the worst rasterization type. In fact, in some applications, the user can also provide a customized optimal rasterization type. For example, for block A, the user can specify to try directly from WRG until TG; for block B, the user can even specify to try only TG...; In the case of providing a customized optimal rasterization type, the specific process of the downshift strategy evolves into: Step 1: For each block, if the user defines the optimal rasterization type, the user-defined optimal rasterization type is used for modeling, otherwise SRG is used for modeling. Then the entire block group is solved, and true is returned if successful; Step 2: For all blocks with a target rasterization type of SRG, if the current rasterization type is not lower than SRG, it is downgraded to SRG and modeled, otherwise it is modeled according to its current rasterization type. Then solve the entire block group, and return true if successful; Step 3: For all blocks whose target rasterization type is WRG, if the current rasterization type is not lower than WRG, downgrade it to WRG and model it, otherwise model it according to the current rasterization type. Then solve the entire block group, and return true if successful; for all blocks whose target rasterization type is TG, use the constraints corresponding to TG for modeling, then solve the entire block group, and return the solution result (true or false). Step 4: Users define the optimal rasterization type. On the one hand, it can achieve more flexible purposes. For example, for some special shapes or invisible areas, the user does think that the TG result will be more in line with the needs; on the other hand, since the constraints of ILP are reduced at each constraint strength level, it will also greatly accelerate the overall solution speed of layout subdivision.

[0266] In some embodiments, the same upper and lower bounds are set for all sub-edges in the block group in the same solution. However, in practice, the user may have a high tolerance for the upper and lower bounds of some sub-edges and a low tolerance for the upper and lower bounds of some sub-edges. Therefore, according to needs, users can provide different initial upper and lower bounds for different sub-edges. In this case, the upper and lower bound constraint relaxation strategy can be updated as follows: Step 1: When modeling and solving the integer linear programming problem at each constraint strength level, execute steps 2 to 4; Step 2: For each sub-edge with the number of grid points to be calculated, assuming that the initial deviation of the upper and lower bounds provided by the user is δi, update its floating initial value to δ i =min(δ i ,δ), and then initialize the upper and lower bounds of the number of grid points as: And perform integer linear programming modeling and solution. If the solution fails, go to step 3, otherwise go to step 4; step 3, at this time, it means that the loosest upper and lower bounds on the current constraint strength level cannot obtain a feasible solution, so the flag of solution failure on the current constraint strength level is returned; step 4, record or update the current optimal solution result, and update δ i =δ i -1, and then perform integer linear programming modeling and solving again until the solution fails or the upper and lower bounds coincide; step five, return the current optimal solution as the final solution at the current constraint strength level.

[0267] In the updated method, if the user has a small tolerance for the upper and lower bounds of a sub-edge, then δi can be set very small, so that in any ILP solution process, the upper and lower bounds of the sub-edge are very strict, so that the actual number of grid points of the edge in all feasible solutions can be guaranteed to be very close to the target number of grid points. This upper and lower bound constraint relaxation strategy can achieve more precise control over the final rasterization result, thereby better meeting user needs.

[0268] In some embodiments, see Fig.12 , Fig.12 is a schematic diagram of the effect of the method for processing a grid model provided in an embodiment of the present application. After the grid model is processed by the method for processing a grid model provided in an embodiment of the present application, the updated grid model obtained can be Fig.12 From the updated mesh model 121, updated mesh model 122, updated mesh module 123 and updated mesh model 124 shown in the figure, it can be seen that the updated mesh model obtained by the embodiment of the present application can meet the regularity requirements of the mesh, thereby greatly reducing the distortion of the mesh and making the subdivided mesh in the updated mesh model more natural.

[0269] In this way, by combining the grid point number threshold and the expected grid point number of each initial grid boundary, the grid point number of each initial grid boundary is predicted respectively, and the predicted grid point number of each initial grid boundary is obtained. Based on the predicted grid point number of each initial grid boundary, each initial grid in the initial grid model is meshed and subdivided to obtain an updated grid model including multiple target grids, each target grid includes multiple subdivided grids, and the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. In this way, by meshing each initial grid in the initial grid model based on the predicted grid point number of each initial grid boundary, an updated grid model including multiple target grids is obtained, so that the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. Since the predicted grid point number corresponding to the initial grid is determined by the corresponding expected grid point number, different initial grids can meet the expected subdivision expectation of the expected grid point number when meshing, thereby meeting the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the grid model.

[0270] It is understandable that in the embodiments of the present application, related data such as the initial grid model are involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0271] The following is a description of an exemplary structure of a grid model processing device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules in the processing device 455 of the grid model stored in the memory 450 may include: an acquisition module 4551, used to acquire an initial grid model including at least one initial grid, wherein the initial grid includes multiple initial grid boundaries; a prediction module 4552, used to predict the number of grid points of each initial grid boundary in the initial grid model in combination with a grid point number threshold and an expected number of grid points of each initial grid boundary for each initial grid model, so as to obtain the predicted number of grid points of each initial grid boundary; a grid subdivision module 4553, used to subdivide each initial grid in the initial grid model based on the predicted number of grid points of each initial grid boundary, so as to obtain an updated grid model including multiple target grids, wherein the target grid boundaries of the target grids correspond one-to-one to the initial grid boundaries; wherein each target grid of the updated grid model includes multiple subdivided grids, and the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted number of grid points.

[0272] In some embodiments, the processing device of the above-mentioned grid model also includes: an expectation module, which is used to perform the following processing for each initial grid boundary in the initial grid model: obtain the expected side length of the subdivided grid, and determine the boundary length of the initial grid boundary; divide the boundary length and the expected side length to obtain a division result; when the division result is an integer, determine the division result as the expected number of grid points of the initial grid boundary; when the division result is not an integer, round the division result to obtain the expected number of grid points of the initial grid boundary.

[0273] In some embodiments, the above-mentioned expectation module is also used to perform the following processing on each of the initial grid boundaries in the initial grid model: sampling on the initial grid boundary to obtain multiple boundary sampling points on the initial grid boundary; obtaining the curvature of the initial grid boundary at each of the boundary sampling points, and weighted averaging each of the curvatures to obtain the target curvature of the initial grid boundary; obtaining the adjustment coefficient, multiplying the target curvature and the adjustment coefficient to obtain the expected number of grid points of the initial grid boundary.

[0274] In some embodiments, the above-mentioned prediction module is also used to perform the following processing for each initial grid boundary in the initial grid model: obtain an initial grid point number threshold, and combine the initial grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the initial grid point number of the initial grid boundary; when the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, obtain a reference grid point number threshold, and the reference grid point number threshold is less than the initial grid point number threshold; combine the reference grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the reference grid point number of the initial grid boundary; determine the predicted grid point number of the initial grid boundary based on the reference grid point number and the initial grid point number.

[0275] In some embodiments, the above-mentioned prediction module is also used to compare the reference grid point number and the initial grid point number; when the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, the initial grid point number is determined as the predicted grid point number of the initial grid boundary; when the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, the reference grid point number is determined as the predicted grid point number of the initial grid boundary.

[0276] In some embodiments, the above-mentioned prediction module is also used to obtain a target grid point number threshold when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, and the target grid point number threshold is greater than the initial grid point number threshold; combine the target grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the target grid point number of the initial grid boundary; when the difference between the target grid point number and the corresponding expected grid point number is less than the target grid point number threshold, determine the target grid point number as the predicted grid point number of the initial grid boundary.

[0277] In some embodiments, the above-mentioned prediction module is also used to determine the predicted grid point number as zero when the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold; wherein the initial grid point number threshold is a positive integer greater than zero.

[0278] In some embodiments, the reference grid point number threshold includes an i-th reference grid point number threshold, 1≤i≤N, N is used to indicate the number of the reference grid point number thresholds, and the numerical value of i is negatively correlated with the numerical value of the i-th reference grid point number threshold; the above-mentioned prediction module is also used to traverse i and perform the following processing until the reference grid point number of the initial grid boundary is obtained: combining the i-th reference grid point number threshold and the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary, and obtaining the initial grid boundary the i-th reference grid point number; when the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, the first reference grid point number is determined as the reference grid point number; when the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, the difference between the i-1-th reference grid point number and the corresponding expected grid point number is less than the i-1-th reference grid point number threshold, and i is greater than 1, the i-1-th reference grid point number is determined as the reference grid point number.

[0279] In some embodiments, the above-mentioned prediction module is also used to perform the following processing for each of the initial grid boundaries in the initial grid model: obtain grid point number constraints, the grid point number constraints include the jth grid point number constraints, 1≤j≤M, M is used to indicate the total number of the grid point number constraints, and the numerical value of j is positively correlated with the constraint strength of the jth grid point number constraints; traverse j to perform the following processing until the predicted grid point number of the initial grid boundary is obtained: combine the grid point number threshold, the expected grid point number of the initial grid boundary and the jth grid point number constraint, and perform the jth grid point number prediction on the initial grid boundary to obtain the jth prediction result; when the jth prediction result indicates that the jth grid point number prediction can generate the jth predicted grid point number that satisfies the jth grid point number constraint, determine the jth predicted grid point number as the predicted grid point number of the initial grid boundary.

[0280] In some embodiments, the above-mentioned prediction module is also used to perform the following processing for each initial grid boundary in the initial grid model: obtain grid point number constraints, the grid point number constraints include the jth grid point number constraints, 1≤j≤M, M is used to indicate the total number of the grid point number constraints, and the numerical value of j is positively correlated with the constraint strength of the jth grid point number constraints; from the grid point number constraints, determine the Tth grid point number constraints corresponding to the initial grid boundary, 1≤T≤M; traverse t to perform the following processing until the predicted grid point number of the initial grid boundary is obtained: combine the grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint, perform the tth grid point number prediction on the initial grid boundary to obtain the tth prediction result; when the tth prediction result indicates that the tth grid point number prediction can generate the tth predicted grid point number that satisfies the tth grid point number constraint, determine the tth predicted grid point number as the predicted grid point number of the initial grid boundary, where T≤t≤M.

[0281] In some embodiments, the above-mentioned grid subdivision module is also used to determine the target grid subdivision method of the initial grid for each initial grid in the initial grid model based on the predicted number of grid points of each initial grid, and to subdivide the initial grid according to the target grid subdivision method to obtain a target grid corresponding to the initial grid; wherein the target grid boundary of the target grid coincides with the initial grid boundary of the corresponding initial grid; and each initial grid in the initial grid model is replaced by the corresponding target grid to obtain the updated grid model.

[0282] In some embodiments, the above-mentioned grid subdivision module is also used to determine the grid point number constraint conditions satisfied between the predicted grid point numbers of the initial grid in combination with the predicted grid point numbers of the initial grid; obtain a mapping relationship between multiple preset constraints and corresponding preset grid subdivision methods, and compare the grid point number constraint conditions with each of the preset constraints in the mapping relationship, respectively, to obtain a comparison result corresponding to the grid point number constraint condition; when the comparison result indicates that the grid point number constraint condition exists among the multiple preset constraints, the preset grid subdivision method corresponding to the grid point number constraint condition in the mapping relationship is determined as the target grid subdivision method of the initial grid.

[0283] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the above-mentioned grid model processing method of the embodiment of the present application.

[0284] The present application embodiment provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the grid model processing method provided by the present application embodiment, for example, Figure 3 The processing method of the mesh model is shown.

[0285] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various electronic devices including one or any combination of the above memories.

[0286] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0287] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0288] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0289] In summary, the embodiments of the present application have the following beneficial effects:

[0290] (1) By combining the grid point number threshold and the expected grid point number of each initial grid boundary, the grid point number of each initial grid boundary is predicted respectively to obtain the predicted grid point number of each initial grid boundary. Based on the predicted grid point number of each initial grid boundary, each initial grid in the initial grid model is meshed to obtain an updated grid model including multiple target grids. Each target grid includes multiple subdivided grids, and the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. In this way, by meshing each initial grid in the initial grid model based on the predicted grid point number of each initial grid boundary, an updated grid model including multiple target grids is obtained, so that the number of vertices of the subdivided grids on each target grid boundary of the target grid is equal to the corresponding predicted grid point number. Since the predicted grid point number corresponding to the initial grid is determined by the corresponding expected grid point number, different initial grids can meet the expected subdivision expectation of the expected grid point number when meshing, thereby meeting the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the grid model.

[0291] (2) By sampling on the boundary of the initial grid, a plurality of boundary sampling points on the boundary of the initial grid are obtained, the curvature of the boundary of the initial grid at each boundary sampling point is obtained, and each curvature is weighted averaged to obtain the target curvature of the boundary of the initial grid. The target curvature and the adjustment coefficient are multiplied to obtain the expected number of grid points on the boundary of the initial grid, so that the expected number of grid points on the boundary of the initial grid is positively correlated with the target curvature of the boundary of the initial grid, that is, the larger the target curvature, the larger the expected number of grid points on the boundary of the initial grid corresponding to the initial grid. Therefore, according to the target curvature, the expected number of grid points corresponding to the initial grid boundary of different target curvatures is different, so that the initial grid is meshed based on the expected number of grid points, so that the larger the target curvature, the larger the mesh subdivision degree corresponding to the initial grid, and the smaller the target curvature, the smaller the mesh subdivision degree corresponding to the initial grid. Therefore, different initial grids are meshed using different subdivision degrees, so as to meet the subdivision requirements of different initial grids, thereby effectively improving the mesh subdivision quality of the grid model.

[0292] (3) By obtaining the expected side length of the subdivided grid and determining the boundary length of the initial grid boundary, the boundary length and the expected side length are divided to obtain a division result. When the division result is an integer, the division result is determined as the expected number of grid points of the initial grid boundary. Since the expected side length reflects the expected side length for the subdivided grid, the expected number of grid points of the initial grid boundary can be accurately obtained by dividing the boundary length and the expected side length.

[0293] (4) When the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not satisfy the grid point number boundary constraint condition, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then, a target grid point number threshold that is larger than the initial grid point number threshold can be obtained to adopt a broader grid point number boundary constraint condition for grid point number prediction. When the difference between the obtained target grid point number and the corresponding expected grid point number is less than the target grid point number threshold, it means that the obtained target grid point number satisfies the grid point number boundary constraint condition corresponding to the target grid point number threshold. Then, the target grid point number is directly determined as the predicted grid point number of the initial grid boundary. In this way, it is ensured that the predicted grid point number can be determined, thereby ensuring the output stability of the predicted grid point number.

[0294] (5) When the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, it means that the determined initial grid point number does not satisfy the grid point number boundary constraint, which means that the initial grid point number at this time cannot be used as the predicted grid point number. Then zero can be determined as the predicted grid point number, which ensures that the difference between the predicted grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, so that the predicted grid point number can satisfy the grid point number boundary constraint, effectively ensuring the effectiveness of the grid point number boundary constraint.

[0295] (6) When the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, it means that the determined initial grid point number can satisfy the grid point number boundary constraint corresponding to the initial grid point number threshold. Then, a reference grid point number threshold that is less than the initial grid point number threshold can be obtained. By using a smaller grid point number threshold, a stronger grid point number boundary constraint can be set to perform the grid point number threshold, so as to find a more accurate predicted grid point number, thereby effectively ensuring the prediction accuracy of the predicted grid point number.

[0296] (7) When the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, it means that the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold. At this time, there is no need to continue traversing i. That is, the reference grid point number threshold that is smaller than the first reference grid point number threshold will correspond to a more stringent grid point number boundary constraint. If the first reference grid point number does not satisfy the grid point number boundary constraint corresponding to the first reference grid point number threshold, then the more stringent grid point number boundary constraint will not result in a reference grid point number that satisfies the grid point number boundary constraint. In this case, the first reference grid point number can be directly determined as the reference grid point number, so there is no need to continue traversing, thereby effectively improving the efficiency of grid refinement.

[0297] (8) When the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, it means that the determined i-th reference grid point number cannot satisfy the grid point number boundary constraint corresponding to the i-th reference grid point number threshold. When the difference between the i-1-th reference grid point number and the corresponding expected grid point number is less than the i-1-th reference grid point number threshold, it means that the determined i-1-th reference grid point number can satisfy the grid point number boundary constraint corresponding to the i-1-th reference grid point number threshold. Then the i-1-th reference grid point number can be determined as the reference grid point number, so that a more accurate reference grid point number can be found through traversal, which effectively improves the accuracy of the reference grid point number.

[0298] (9) When the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, it means that the reference grid point number cannot meet the grid point number boundary constraint condition, then the initial grid point number can be determined as the predicted grid point number of the initial grid boundary; when the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, it means that the reference grid point number can meet the grid point number boundary constraint condition, then the reference grid point number is determined as the predicted grid point number of the initial grid boundary; by determining a more accurate predicted grid point number that can meet the grid point number boundary constraint condition from the reference grid point number and the initial grid point number, the accuracy of the determined predicted grid point number is effectively improved.

[0299] (10) By predicting the number of grid points in order from strong to weak grid point constraints, when the j-th prediction result indicates that the j-th grid point prediction can generate the j-th predicted grid point number that satisfies the j-th grid point constraint, the j-th predicted grid point number is determined as the predicted grid point number of the initial grid boundary, so that the optimal predicted grid point number can be found, and the grid point constraint satisfied by the predicted grid point number is moderate, thereby effectively improving the prediction accuracy of the predicted grid point number.

[0300] (11) By obtaining the grid point number constraint, the Tth grid point number constraint corresponding to the initial grid boundary is determined from the grid point number constraint. The grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint are combined to perform the tth grid point number prediction on the initial grid boundary to obtain the tth prediction result. Thus, in response to the selection operation on the grid point number constraint, the Tth grid point number constraint corresponding to the selected initial grid boundary is determined from the grid point number constraint. Traversal is performed starting from the Tth grid point number constraint to determine the best predicted grid point number, thereby effectively shortening the time for traversing and determining the predicted grid point number and effectively improving the generation efficiency of the predicted grid point number.

[0301] (12) The grid model processing method provided in the embodiment of the present application can avoid introducing a large number of weight parameters, so that there is no need to tune parameters for different models, thereby improving the subdivision effect; on the other hand, it can also greatly improve the solution speed, so that the general open source integer linear programming library can also meet the needs, thereby greatly reducing the development cost. Finally, due to the use of the downshift strategy and the upper and lower bound relaxation strategy, it can also ensure that the algorithm can obtain the best possible results within the time and space that the user can flexibly control.

[0302] (13) First, the optimization objective function and constraints of the model are all linear expressions or inequalities. Therefore, the entire model belongs to an integer linear programming model, which can be quickly solved by the classic simplex algorithm + branch and bound method or the cutting plane method. Secondly, there are no weight parameters in the model, and there is no need to tune parameters for different models. Thirdly, different constraints can be imposed on different rasterization types, making it possible to generate mixed rasterization results of quadrilaterals and triangles, which meets the needs of art.

[0303] (14) By adopting the downshift strategy, the target rasterization type can be flexibly specified. For example, for blocks in some important areas, the target rasterization type can be set to strong regularity; for blocks in less important areas (such as areas with poor visibility), the target rasterization type can be set to triangular regularity to improve the solution speed and solution success rate; after specifying the target rasterization type, the downshift strategy will still try to find the best result. From the test results, in most cases, the downshift strategy can obtain an actual rasterization type that is better than the target rasterization type.

[0304] (15) In the updated method, if the user has a small tolerance for the upper and lower bounds of a sub-edge, then δi can be set very small, so that in any ILP solution process, the upper and lower bounds of the sub-edge are very strict, so that the actual number of grid points of the edge in all feasible solutions can be guaranteed to be very close to the target number of grid points. This upper and lower bound constraint relaxation strategy can achieve more precise control over the final rasterization result, thereby better meeting user needs.

[0305] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for processing a mesh model, characterized in that: The method comprises: Acquire an initial grid model including at least one initial grid, wherein the initial grid includes a plurality of initial grid boundaries; For each of the initial grid models, combining a grid point number threshold and an expected grid point number of each of the initial grid boundaries, respectively predicting the number of grid points of each of the initial grid boundaries in the initial grid model to obtain a predicted number of grid points of each of the initial grid boundaries; Based on the predicted number of grid points of each initial grid boundary, each initial grid in the initial grid model is meshed to obtain an updated grid model including a plurality of target grids, wherein the target grid boundaries of the target grids correspond one-to-one to the initial grid boundaries; Wherein, each of the target grids of the updated grid model includes a plurality of subdivided grids, and the number of vertices of the subdivided grids on the boundaries of each of the target grids is equal to the corresponding number of predicted grid points.

2. The method according to claim 1, characterized in that Before predicting the number of grid points of each initial grid boundary in the initial grid model by combining the grid point number threshold and the expected number of grid points of each initial grid boundary and obtaining the predicted number of grid points of each initial grid boundary, the method further includes: The following processing is performed for each of the initial grid boundaries in the initial grid model: Obtaining the expected side length of the subdivided grid and determining the boundary length of the initial grid boundary; Dividing the boundary length and the expected side length to obtain a division result; When the division result is an integer, determining the division result as the expected number of grid points of the initial grid boundary; When the division result is not an integer, the division result is rounded to obtain the expected number of grid points of the initial grid boundary.

3. The method according to claim 1, characterized in that Before predicting the number of grid points of each initial grid boundary by combining the grid point number threshold and the expected number of grid points of each initial grid boundary and obtaining the predicted number of grid points of each initial grid boundary, the method further includes: The following processing is performed for each of the initial grid boundaries in the initial grid model: Sampling is performed on the boundary of the initial grid to obtain a plurality of boundary sampling points on the boundary of the initial grid; Obtaining the curvature of the initial grid boundary at each of the boundary sampling points, and performing weighted averaging on each of the curvatures to obtain a target curvature of the initial grid boundary; An adjustment coefficient is obtained, and the target curvature and the adjustment coefficient are multiplied to obtain the expected number of grid points of the initial grid boundary.

4. The method according to claim 1, characterized in that: The combining the grid point number threshold and the expected grid point number of each of the initial grid boundaries to predict the number of grid points of each of the initial grid boundaries in the initial grid model to obtain the predicted number of grid points of each of the initial grid boundaries includes: The following processing is performed for each of the initial grid boundaries in the initial grid model: Obtaining an initial grid point number threshold, and combining the initial grid point number threshold with the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary to obtain an initial grid point number of the initial grid boundary; When the difference between the initial grid point number and the corresponding expected grid point number is less than the initial grid point number threshold, obtaining a reference grid point number threshold, wherein the reference grid point number threshold is less than the initial grid point number threshold; Combining the reference grid point number threshold and the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary to obtain a reference grid point number of the initial grid boundary; Based on the reference number of grid points and the initial number of grid points, a predicted number of grid points of the initial grid boundary is determined.

5. The method according to claim 4, characterized in that The step of determining the predicted number of grid points of the initial grid boundary based on the reference number of grid points and the initial number of grid points includes: comparing the reference number of grid points with the initial number of grid points; When the difference between the reference grid point number and the corresponding expected grid point number is greater than or equal to the reference grid point number threshold, determining the initial grid point number as the predicted grid point number of the initial grid boundary; When the difference between the reference grid point number and the corresponding expected grid point number is less than the reference grid point number threshold, the reference grid point number is determined as the predicted grid point number of the initial grid boundary.

6. The method according to claim 4, characterized in that After predicting the number of grid points of the initial grid boundary by combining the initial grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the initial number of grid points of the initial grid boundary, the method further includes: When the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, obtaining a target grid point number threshold, wherein the target grid point number threshold is greater than the initial grid point number threshold; Combining the target grid point number threshold and the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary to obtain the target grid point number of the initial grid boundary; When the difference between the target number of grid points and the corresponding expected number of grid points is less than the target number of grid points threshold, the target number of grid points is determined as the predicted number of grid points of the initial grid boundary.

7. The method according to claim 4, characterized in that After predicting the number of grid points of the initial grid boundary by combining the initial grid point number threshold and the expected number of grid points of the initial grid boundary to obtain the initial number of grid points of the initial grid boundary, the method further includes: When the difference between the initial grid point number and the corresponding expected grid point number is greater than or equal to the initial grid point number threshold, determining the predicted grid point number to be zero; The initial grid point number threshold is a positive integer greater than zero.

8. The method according to claim 4, characterized in that The reference grid point number threshold comprises an i-th reference grid point number threshold, 1≤i≤N, N is used to indicate the number of the reference grid point number thresholds, and the value of i is negatively correlated with the value of the i-th reference grid point number threshold; The step of combining the reference grid point number threshold and the expected grid point number of the initial grid boundary to predict the grid point number of the initial grid boundary to obtain the reference grid point number of the initial grid boundary includes: Traversing i and performing the following processing until the reference grid point number of the initial grid boundary is obtained: combining the i-th reference grid point number threshold and the expected grid point number of the initial grid boundary, predicting the grid point number of the initial grid boundary to obtain the i-th reference grid point number of the initial grid boundary; When the difference between the first reference grid point number and the corresponding expected grid point number is greater than or equal to the first reference grid point number threshold, determining the first reference grid point number as the reference grid point number; When the difference between the i-th reference grid point number and the corresponding expected grid point number is greater than or equal to the i-th reference grid point number threshold, the difference between the i-1th reference grid point number and the corresponding expected grid point number is less than the i-1th reference grid point number threshold, and i is greater than 1, the i-1th reference grid point number is determined as the reference grid point number.

9. The method according to claim 1, characterized in that: The combining the grid point number threshold and the expected grid point number of each of the initial grid boundaries to predict the number of grid points of each of the initial grid boundaries in the initial grid model to obtain the predicted number of grid points of each of the initial grid boundaries includes: The following processing is performed for each of the initial grid boundaries in the initial grid model: Obtaining a grid point number constraint condition, wherein the grid point number constraint condition includes a j-th grid point number constraint condition, 1≤j≤M, M is used to indicate the total number of the grid point number constraint conditions, and the value of j is positively correlated with the constraint strength of the j-th grid point number constraint condition; Traverse j and perform the following processing until the predicted number of grid points of the initial grid boundary is obtained: Combining the grid point number threshold, the expected grid point number of the initial grid boundary and the j-th grid point number constraint condition, performing a j-th grid point number prediction on the initial grid boundary to obtain a j-th prediction result; When the j-th prediction result indicates that the j-th grid point number prediction can generate the j-th predicted grid point number that satisfies the j-th grid point number constraint condition, the j-th predicted grid point number is determined as the predicted grid point number of the initial grid boundary.

10. The method according to claim 1, characterized in that The combining the grid point number threshold and the expected grid point number of each of the initial grid boundaries to predict the number of grid points of each of the initial grid boundaries in the initial grid model to obtain the predicted number of grid points of each of the initial grid boundaries includes: The following processing is performed for each of the initial grid boundaries in the initial grid model: Obtaining a grid point number constraint condition, wherein the grid point number constraint condition includes a j-th grid point number constraint condition, 1≤j≤M, M is used to indicate the total number of the grid point number constraint conditions, and the value of j is positively correlated with the constraint strength of the j-th grid point number constraint condition; Determining the Tth grid point number constraint condition corresponding to the initial grid boundary from the grid point number constraint conditions, 1≤T≤M; The following process is performed through t until the predicted number of grid points of the initial grid boundary is obtained: Combining the grid point number threshold, the expected grid point number of the initial grid boundary and the tth grid point number constraint, performing a tth grid point number prediction on the initial grid boundary to obtain a tth prediction result; When the tth prediction result indicates that the tth grid point number prediction can generate the tth predicted grid point number that satisfies the tth grid point number constraint condition, the tth predicted grid point number is determined as the predicted grid point number of the initial grid boundary, where T≤t≤M.

11. The method according to claim 1, characterized in that The method further comprises: performing mesh subdivision on each of the initial meshes in the initial mesh model based on the predicted number of grid points of each of the initial mesh boundaries to obtain an updated mesh model including a plurality of target meshes, including: For each of the initial grids in the initial grid model, based on the predicted number of grid points of each of the initial grids, determining a target grid subdivision method of the initial grid, and subdividing the initial grid according to the target grid subdivision method to obtain a target grid corresponding to the initial grid; wherein a target grid boundary of the target grid coincides with an initial grid boundary of the corresponding initial grid; Each of the initial grids in the initial grid model is replaced with the corresponding target grid to obtain the updated grid model.

12. The method according to claim 11, characterized in that The determining of a target grid subdivision method of the initial grid based on the predicted number of grid points of the initial grid comprises: Determine the grid point number constraint condition satisfied between the predicted grid point numbers of the initial grid in combination with the predicted grid point numbers of the initial grid; Acquire a mapping relationship between a plurality of preset constraint conditions and corresponding preset grid subdivision methods, and compare the grid point number constraint condition with each of the preset constraint conditions in the mapping relationship to obtain a comparison result corresponding to the grid point number constraint condition; When the comparison result indicates that the grid point number constraint condition exists among the multiple preset constraint conditions, the preset grid subdivision method corresponding to the grid point number constraint condition in the mapping relationship is determined as the target grid subdivision method of the initial grid.

13. A grid model processing device, characterized in that: The device comprises: An acquisition module, used to acquire an initial grid model including at least one initial grid, wherein the initial grid includes a plurality of initial grid boundaries; A prediction module is used for predicting the number of grid points of each initial grid boundary in the initial grid model according to the grid point number threshold and the expected number of grid points of each initial grid boundary, so as to obtain the predicted number of grid points of each initial grid boundary; A mesh subdivision module is used to mesh each of the initial meshes in the initial mesh model based on the predicted number of grid points of each of the initial mesh boundaries, so as to obtain an updated mesh model including a plurality of target meshes, wherein the target mesh boundaries of the target meshes correspond one-to-one to the initial mesh boundaries; wherein each of the target meshes in the updated mesh model includes a plurality of subdivided meshes, and the number of vertices of the subdivided meshes on each of the target mesh boundaries of the target meshes is equal to the corresponding predicted number of grid points.

14. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions or computer programs; A processor, configured to implement the grid model processing method according to any one of claims 1 to 12 when executing the computer executable instructions or computer program stored in the memory.

15. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a processor, the grid model processing method described in any one of claims 1 to 12 is implemented.

16. A computer program product comprising a computer program or computer executable instructions, characterized in that When the computer program or computer executable instructions are executed by a processor, the grid model processing method described in any one of claims 1 to 12 is implemented.