Grid Boolean operation method, device, electronic device and storage medium

By calculating the intersection type of the triangle mesh and performing corresponding triangulation processing, the problem of low computational efficiency of traditional mesh Boolean operations in complex models is solved, and more efficient Boolean operations are achieved.

CN115880458BActive Publication Date: 2024-11-15北京瑞医博科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211590255.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-12
Publication Date
2024-11-15
Estimated Expiration
2042-12-12

AI Technical Summary

Technical Problem

Traditional mesh Boolean operations are inefficient in computing when processing complex or unclosed triangular mesh models, resulting in slow model calculation speed.

Method used

By calculating the intersection points of the closed triangle mesh, judging the intersection point type, and triangulation is performed based on the judgment results. Finally, Boolean operations are performed on the identification mesh and the segmented mesh to improve the calculation efficiency.

Benefits of technology

Through triangulation processing of different intersection types, the Boolean computing speed is significantly accelerated and the model calculation efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115880458B_ABST
    Figure CN115880458B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a mesh Boolean operation method, device, electronic device and storage medium. The mesh Boolean operation method includes: calculating and obtaining the intersection of a first closed triangular mesh and a second closed triangular mesh; judging the intersection type of the intersection to obtain the judgment result of the intersection; triangulating the triangular mesh where the intersection is located according to the processing method corresponding to the judgment result to obtain a triangulated mesh; marking the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first marked mesh, a second marked mesh and a triangulated marked mesh; performing Boolean operation on the first marked mesh, the second marked mesh and the triangulated marked mesh to obtain a Boolean operation result mesh. Through the above steps, the triangular mesh where the intersection is located can be triangulated in different ways according to different intersection types, thereby accelerating the Boolean operation speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer graphics, and in particular to a grid Boolean operation method, device, electronic device and storage medium. Background Art

[0002] Boolean operations are digital symbolic logic deduction methods, including union, intersection, and subtraction. This logic operation method is used in graphics processing operations to combine simple basic graphics to produce new shapes, and has developed from two-dimensional Boolean operations to three-dimensional graphics Boolean operations. Due to Boole's special contribution to symbolic logic operations, logical operations are called Boolean operations in many computer languages, and their results are called Boolean values.

[0003] Traditional mesh Boolean operations are performed by inputting two closed triangular mesh data and then performing intersection and complement operations to achieve the desired effect. However, when performing data operations, due to the complexity of the input data, for example, some models are not closed or the model scale is large, the model calculation efficiency is low. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a grid Boolean operation method, device, electronic device and storage medium to at least partially solve the above problems.

[0005] According to a first aspect of an embodiment of the present invention, a mesh Boolean operation method is provided, comprising: calculating and obtaining the intersection of a first closed triangular mesh and a second closed triangular mesh; performing intersection type judgment on the intersection to obtain a judgment result of the intersection; performing triangulation processing on the triangular mesh where the intersection is located according to a processing method corresponding to the judgment result to obtain a triangulated mesh; performing identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh; performing Boolean operation processing on the first identification mesh, the second identification mesh and the triangulated identification mesh to obtain a Boolean operation result mesh.

[0006] In another implementation of the present invention, the calculating and obtaining the intersection of the first closed triangular mesh and the second closed triangular mesh includes: performing BVH structure processing on the first closed triangular mesh and the second closed triangular mesh to obtain the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure; calculating and obtaining the intersection of the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure.

[0007] In another implementation of the present invention, the calculation and obtaining of the intersection of the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure includes: calculating the intersection of the first closed triangular mesh and the first closed triangular mesh BVH acceleration structure to obtain a first intersection; calculating the intersection of the second closed triangular mesh and the second closed triangular mesh BVH acceleration structure to obtain a second intersection.

[0008] In another implementation of the present invention, the method further includes: constructing a first triangular face including the first intersection point based on the first intersection point; and constructing a second triangular face including the second intersection point based on the second intersection point.

[0009] In another implementation of the present invention, the intersection type judgment is performed on the intersection to obtain the judgment result of the intersection, including: deduplication processing is performed on the first intersection and the second intersection to obtain a first deduplication intersection and a second deduplication intersection; and intersection type judgment is performed on the first deduplication intersection and the second deduplication intersection to obtain a judgment result.

[0010] In another implementation of the present invention, the triangulated mesh where the intersection is located is processed in a processing method corresponding to the judgment result to obtain a triangulated mesh, including: constructing a first deduplicated triangular face containing the first deduplicated intersection and a second deduplicated triangular face containing the second deduplicated intersection according to the first deduplicated intersection and the second deduplicated intersection respectively; for the first deduplicated intersection whose judgment result meets the first intersection type, triangulating the first deduplicated triangular face according to a first triangulation algorithm, and for the first deduplicated intersection whose judgment result meets the second intersection type, triangulating the first deduplicated triangular face according to a second triangulation algorithm to obtain a first triangulated mesh; for the second deduplicated intersection whose judgment result meets the first intersection type, triangulating the second deduplicated triangular face according to the first triangulation algorithm, and for the second deduplicated intersection whose judgment result meets the second intersection type, triangulating the second deduplicated triangular face according to the second triangulation algorithm to obtain a second triangulated mesh.

[0011] In another implementation of the present invention, the identification processing of the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh includes: identification processing of the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh.

[0012] According to a second aspect of an embodiment of the present invention, a mesh Boolean operation device is provided, comprising: an intersection calculation module, used to calculate and obtain the intersection of a first closed triangular mesh and a second closed triangular mesh; an intersection type judgment module, used to perform intersection type judgment on the intersection to obtain a judgment result of the intersection; a triangulation module, used to perform triangulation processing on the triangular mesh where the intersection is located according to a processing method corresponding to the judgment result to obtain a triangulated mesh; an identification processing module, used to perform identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulation identification mesh; a Boolean operation module, used to perform Boolean operation processing on the first identification mesh, the second identification mesh and the triangulation identification mesh to obtain a Boolean operation result mesh.

[0013] According to a third aspect of an embodiment of the present invention, there is provided an electronic device comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0014] According to a fourth aspect of an embodiment of the present invention, there is provided a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0015] In the scheme of the embodiment of the present invention, the intersection of the first closed triangular mesh and the second closed triangular mesh is calculated and obtained; the intersection type is judged on the intersection to obtain the judgment result of the intersection; the triangular mesh where the intersection is located is triangulated according to the processing method corresponding to the judgment result to obtain a triangulated mesh; the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh are marked to obtain a first marked mesh, a second marked mesh and a triangulated marked mesh; the first marked mesh, the second marked mesh and the triangulated marked mesh are Boolean operated to obtain a Boolean operation result mesh. Through the above steps, the triangular mesh where the intersection is located can be triangulated in different ways according to different intersection types, thereby accelerating the Boolean operation speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0017] Figure 1 A schematic diagram of an example mesh Boolean operation.

[0018] Figure 2A The figure is a flowchart of a mesh Boolean operation method according to an embodiment of the present invention.

[0019] Figure 2B Schematic diagram of mesh Boolean operation according to an embodiment of the present invention.

[0020] Figure 2C Schematic diagram of mesh Boolean operation according to an embodiment of the present invention.

[0021] Figure 2D Schematic diagram of mesh Boolean operation according to an embodiment of the present invention.

[0022] Figure 3 FIG. 4 is a schematic block diagram of a grid Boolean operation device according to an embodiment of the present invention.

[0023] Figure 4 FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and in detail below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.

[0025] It should be understood that the terms "first", "second", and "third" in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

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

[0027] Figure 1 Schematic diagram of an example mesh Boolean operation method. The mesh Boolean operation method of this example includes: inputting a triangular closed mesh Ma and a triangular closed mesh Mb into a Boolean operation model; performing a Boolean operation on the triangular closed mesh Ma and the triangular closed mesh Mb to obtain a processed triangular closed mesh.

[0028] The mesh Boolean operation method in the above example can calculate triangular closed meshes, but the complexity of the input data, for example, some triangular networks are not closed, which may cause calculation crashes. In addition, when the mesh scale is large, the model calculation speed will be very slow.

[0029] Figure 2A The exemplary process of a mesh Boolean operation method of an embodiment of the present invention is shown. The mesh Boolean operation method of this embodiment includes:

[0030] S210: Calculate and obtain the intersection points of the first closed triangular mesh and the second closed triangular mesh.

[0031] It should be noted that the triangular mesh here is a type of polygonal mesh, which is a data structure used in computer graphics to build models for various irregular objects.

[0032] S220: Perform intersection type determination on the intersection to obtain a determination result of the intersection.

[0033] S230: Perform triangulation processing on the triangular mesh where the intersection point is located according to the processing method corresponding to the judgment result to obtain a triangulated mesh.

[0034] S240: performing identification processing on the first closed triangular mesh, the second closed triangular mesh, and the triangulated mesh to obtain a first identified mesh, a second identified mesh, and a triangulated identified mesh.

[0035] S250: Perform Boolean operation processing on the first identification grid, the second identification grid and the triangulation identification grid to obtain a Boolean operation result grid.

[0036] It should be noted that the Boolean operation here is a digital symbolized logic deduction method, including union, intersection, and subtraction. This logic operation method is used in graphics processing operations to combine simple basic graphics to produce new shapes, and develop from two-dimensional Boolean operations to three-dimensional graphics Boolean operations. By performing union, difference, and intersection operations on two or more objects, a new object shape is obtained. Common Boolean operations: Union, Intersection, and Subtraction (difference, including AB and BA).

[0037] In the scheme of the embodiment of the present invention, the intersection of the first closed triangular mesh and the second closed triangular mesh is calculated and obtained; the intersection type is judged on the intersection to obtain the judgment result of the intersection; the triangular mesh where the intersection is located is triangulated according to the processing method corresponding to the judgment result to obtain a triangulated mesh; the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh are marked to obtain a first marked mesh, a second marked mesh and a triangulated marked mesh; the first marked mesh, the second marked mesh and the triangulated marked mesh are Boolean operated to obtain a Boolean operation result mesh. Through the above steps, the triangular mesh where the intersection is located can be triangulated in different ways according to different intersection types, thereby accelerating the Boolean operation speed.

[0038] In a possible implementation, the calculating and obtaining the intersection of the first closed triangular mesh and the second closed triangular mesh includes: performing BVH structure processing on the first closed triangular mesh and the second closed triangular mesh to obtain the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure; calculating and obtaining the intersection of the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure.

[0039] It should be noted that the BVH acceleration structure here refers to the Bounding Volume Hierarchy (BVH), i.e., the hierarchical bounding volume. In BVH, all geometric objects will be enclosed in the leaf nodes of the Bounding Volume, and the Bounding Volume will continue to be enclosed in a larger Bounding Volume, and the final root node will enclose the entire scene recursively. It is often used to accelerate collision detection and ray tracing, and can reduce the time complexity to the logarithmic level of the number of objects.

[0040] Specifically, the first closed triangle mesh and the second closed triangle mesh can be input into a graphics processor, and BVH data processing can be performed on the first closed triangle mesh and the second closed triangle mesh to obtain a first closed triangle mesh BVH acceleration structure and a second closed triangle mesh BVH acceleration structure. In this way, the Boolean operation processing efficiency can be improved.

[0041] In a possible implementation, the calculating and obtaining the intersection of the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure includes: calculating the intersection of the first closed triangular mesh and the first closed triangular mesh BVH acceleration structure to obtain a first intersection; calculating the intersection of the second closed triangular mesh and the second closed triangular mesh BVH acceleration structure to obtain a second intersection.

[0042] It should be noted that if Figure 2B As shown, when calculating the intersection of two closed triangle meshes, if only the three edges of the shadow triangle are used to calculate whether there is an intersection with the transparent triangle, no intersection can be obtained. In this case, the three edges of the transparent triangle must be used to find the intersection with the shadow triangle to obtain two intersections. In order to fully calculate the intersection of two closed triangle meshes, the first intersection can be obtained by calculating the intersection of the first closed triangle mesh and the first closed triangle mesh BVH acceleration structure; the second intersection can be obtained by calculating the intersection of the second closed triangle mesh and the second closed triangle mesh BVH acceleration structure.

[0043] Specifically, the intersection of each edge in the first closed triangular mesh and the BVH acceleration structure of the second closed triangular mesh can be calculated to obtain the first intersection; the intersection of each edge in the second closed triangular mesh and the BVH acceleration structure of the first closed triangular mesh can be calculated to obtain the second intersection. In the above manner, the intersection of the closed triangular mesh can be fully calculated.

[0044] In a possible implementation, the method further includes: constructing a first triangular face including the first intersection point according to the first intersection point; and constructing a second triangular face including the second intersection point according to the second intersection point. By means of the above method, the efficiency of triangular face processing can be improved.

[0045] In one possible implementation, the performing intersection type judgment on the intersection to obtain the judgment result of the intersection includes: performing deduplication processing on the first intersection and the second intersection to obtain a first deduplication intersection and a second deduplication intersection; performing intersection type judgment on the first deduplication intersection and the second deduplication intersection to obtain a judgment result.

[0046] It should be noted that, since the first intersection point and the second intersection point may overlap, it is necessary to remove the overlapping points in the intersection point in the above manner to improve the triangulation efficiency.

[0047] In a possible implementation, the triangulated mesh where the intersection is located is triangulated according to the processing method corresponding to the judgment result to obtain a triangulated mesh, including: constructing a first deduplicated triangular face containing the first deduplicated intersection and a second deduplicated triangular face containing the second deduplicated intersection according to the first deduplicated intersection and the second deduplicated intersection respectively; for the first deduplicated intersection whose judgment result meets the first intersection type, triangulating the first deduplicated triangular face according to a first triangulation algorithm, and for the first deduplicated intersection whose judgment result meets the second intersection type, triangulating the first deduplicated triangular face according to a second triangulation algorithm to obtain a first triangulated mesh; for the second deduplicated intersection whose judgment result meets the first intersection type, triangulating the second deduplicated triangular face according to the first triangulation algorithm, and for the second deduplicated intersection whose judgment result meets the second intersection type, triangulating the second deduplicated triangular face according to the second triangulation algorithm to obtain a second triangulated mesh.

[0048] It should be noted that, here, the first deduplicated intersection whose judgment result meets the first intersection type is subjected to the triangulation processing of the first deduplicated triangular face according to the first triangulation algorithm, which means that the first deduplicated intersection whose judgment result meets the first intersection type is subjected to the triangulation processing of the first deduplicated triangular face containing the first deduplicated intersection meeting the first intersection type according to the first triangulation algorithm; the other triangulation processing methods are similar. For example, if the intersection on a triangular face meets the first intersection type, the triangulation processing of the triangular face is subjected to the triangulation processing of the first triangulation algorithm.

[0049] Preferably, the first deduplicated intersection points and the second deduplicated intersection points can be sorted to obtain first sorted deduplicated intersection points and second sorted deduplicated intersection points; based on the first sorted deduplicated intersection points, a first deduplicated triangular surface including the first sorted deduplicated intersection points is constructed; based on the second sorted deduplicated intersection points, a second deduplicated triangular surface including the second sorted deduplicated intersection points is constructed.

[0050] It should be noted that the subdivision processing of the first deduplicated triangular face and the subdivision processing of the second deduplicated triangular face can be performed in parallel, and the subdivision processing of multiple triangular faces can be performed at the same time, thereby improving the triangulation rate.

[0051] It should be noted that if Figure 2CAs shown, the first type of intersection here refers to the intersection point that has only one intersection line and is connected to the two sides of the triangle, and the second type of intersection here refers to other types of intersection points other than the first type of intersection point. The first triangulation algorithm here refers to the triangulation algorithm that directly triangulates according to the intersection point and the vertices of the triangle where the intersection point is located, and the second triangulation algorithm here refers to the triangulation algorithm that first performs topological processing on the intersection point and then performs triangulation according to the intersection point after topological processing.

[0052] For example, Figure 2D As shown, the second triangulation algorithm can be specifically as follows: for the triangle ABC, there are two intersection lines inside it, namely p1p2 and q1q2. Each intersection point p1, p2, q1, q2 on the edge is moved perpendicular to the edge inward by a small distance (such as 1e-6, the distances may not be equal), and the moved point set and the three vertices of ABC are recorded to construct a boundary point set Co = {A, B, C, p1', p2', q1', q2'}. The set C0 is added with the internal points, and the point set is triangulated using the Delaunay triangulation method to obtain a topological relationship set cells between the points. The topological relationship set is traversed to check whether each triangle vertex belongs to Co. If so, it is deleted to obtain the final topological relationship set cells1, and then the moved points in the topological relationship set are restored to obtain the final triangulated data.

[0053] Through the above method, the triangulated surface where the intersection point is located can be subdivided according to the type of intersection point, which effectively improves the efficiency of triangulation processing.

[0054] In a possible implementation, the identification processing of the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh includes: identification processing of the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh.

[0055] It should be noted that since the Boolean difference operation includes two operations: first closed triangular mesh - second closed triangular mesh and second closed triangular mesh - first closed triangular mesh, in order to distinguish the two operation modes, the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh can be identified.

[0056] Specifically, the operation mode of the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh can be judged based on the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure, and the triangular faces in the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh can be processed by operation identification.

[0057] Figure 3 Schematic block diagram of a grid Boolean operation device according to another embodiment of the present invention. The solution of the embodiment of the present invention can be applied to electronic devices, including but not limited to: terminal devices with communication functions or electronic devices with interactive behavior capabilities.

[0058] The mesh Boolean operation device of this embodiment includes: an intersection calculation module, which is used to calculate and obtain the intersection of the first closed triangular mesh and the second closed triangular mesh; an intersection type judgment module, which is used to perform intersection type judgment on the intersection and obtain the judgment result of the intersection; a triangulation module, which is used to perform triangulation processing on the triangular mesh where the intersection is located according to the processing method corresponding to the judgment result to obtain a triangulated mesh; an identification processing module, which is used to perform identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh; a Boolean operation module, which is used to perform Boolean operation processing on the first identification mesh, the second identification mesh and the triangulated identification mesh to obtain a Boolean operation result mesh.

[0059] In other examples, the intersection calculation module is specifically used to: perform BVH structure processing on the first closed triangular mesh and the second closed triangular mesh to obtain a first closed triangular mesh BVH acceleration structure and a second closed triangular mesh BVH acceleration structure; calculate and obtain the intersection of the first closed triangular mesh BVH acceleration structure and the second closed triangular mesh BVH acceleration structure.

[0060] In other examples, the intersection calculation module is specifically used to: calculate the intersection of the first closed triangular mesh and the first closed triangular mesh BVH acceleration structure to obtain a first intersection; calculate the intersection of the second closed triangular mesh and the second closed triangular mesh BVH acceleration structure to obtain a second intersection.

[0061] In some other examples, the intersection calculation module is specifically used to: construct a first triangular face containing the first intersection point according to the first intersection point; and construct a second triangular face containing the second intersection point according to the second intersection point. In some other examples, the intersection type judgment module is specifically used to: perform deduplication processing on the first intersection point and the second intersection point to obtain a first deduplication intersection point and a second deduplication intersection point; and perform intersection type judgment on the first deduplication intersection point and the second deduplication intersection point to obtain a judgment result.

[0062] In other examples, the triangulation module is specifically used to: construct a first deduplicated triangular face containing the first deduplicated intersection and a second deduplicated triangular face containing the second deduplicated intersection according to the first deduplicated intersection and the second deduplicated intersection respectively; for the first deduplicated intersection whose judgment result meets the first intersection type, perform triangulation processing on the first deduplicated triangular face according to a first triangulation algorithm, and for the first deduplicated intersection whose judgment result meets the second intersection type, perform triangulation processing on the first deduplicated triangular face according to a second triangulation algorithm to obtain a first triangulated mesh; for the second deduplicated intersection whose judgment result meets the first intersection type, perform triangulation processing on the second deduplicated triangular face according to the first triangulation algorithm, and for the second deduplicated intersection whose judgment result meets the second intersection type, perform triangulation processing on the second deduplicated triangular face according to the second triangulation algorithm to obtain a second triangulated mesh.

[0063] In other examples, the identification processing module is specifically used to: perform identification processing on the first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh.

[0064] Reference Figure 4 , shows a schematic structural diagram of an electronic device according to another embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0065] like Figure 4 As shown, the electronic device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 storing a program 410 , and a communication bus 408 .

[0066] The processor, the communication interface, and the memory communicate with each other via a communication bus. The communication interface is used to communicate with other electronic devices or servers. The processor is used to execute a program, and specifically can execute the relevant steps in the above method embodiment. Specifically, the program may include a program code, and the program code includes computer operation instructions.

[0067] The processor may be a CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0068] The memory is used to store programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0069] The program can be specifically used to enable the processor to perform the following operations: calculate and obtain the intersection of the first closed triangular mesh and the second closed triangular mesh; perform intersection type judgment on the intersection to obtain the judgment result of the intersection; perform triangulation processing on the triangular mesh where the intersection is located according to the processing method corresponding to the judgment result to obtain a triangulated mesh; perform identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulation identification mesh; perform Boolean operation processing on the first identification mesh, the second identification mesh and the triangulation identification mesh to obtain a Boolean operation result mesh.

[0070] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the patent protection scope of the embodiments of the present invention should be defined by the claims. The systems, devices, modules or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions.

[0071] For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0072] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0073] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0076] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0077] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0078] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0079] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0080] The present invention may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific transactions or implement specific abstract data types. The present invention may also be practiced in distributed computing environments where transactions are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0081] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A mesh Boolean operation method, comprising: Calculate and obtain the intersection of the first closed triangular mesh and the second closed triangular mesh; Performing intersection type judgment on the intersection to obtain a judgment result of the intersection; According to the processing method corresponding to the judgment result, triangulation processing is performed on the triangular mesh where the intersection point is located to obtain a triangulation mesh; Performing identification processing on the first closed triangular mesh, the second closed triangular mesh, and the triangulated mesh to obtain a first identified mesh, a second identified mesh, and a triangulated identified mesh; A Boolean operation is performed on the first identification grid, the second identification grid, and the triangulation identification grid to obtain a Boolean operation result grid.

2. The method according to claim 1, wherein: The calculating and obtaining the intersection of the first closed triangular mesh and the second closed triangular mesh comprises: Performing BVH structure processing on the first closed triangular mesh and the second closed triangular mesh to obtain a first closed triangular mesh BVH acceleration structure and a second closed triangular mesh BVH acceleration structure; An intersection point between the first closed triangle mesh BVH acceleration structure and the second closed triangle mesh BVH acceleration structure is calculated and obtained.

3. The method according to claim 2, wherein: The calculating and obtaining the intersection of the first closed triangle mesh BVH acceleration structure and the second closed triangle mesh BVH acceleration structure includes: Calculate an intersection point between the first closed triangular mesh and the first closed triangular mesh BVH acceleration structure to obtain a first intersection point; An intersection point between the second closed triangular mesh and the second closed triangular mesh BVH acceleration structure is calculated to obtain a second intersection point.

4. The method according to claim 3, wherein: The method further comprises: According to the first intersection point, a first triangular face including the first intersection point is constructed; according to the second intersection point, a second triangular face including the second intersection point is constructed.

5. The method according to claim 4, wherein: The step of determining the type of the intersection to obtain a determination result of the intersection includes: Performing deduplication processing on the first intersection point and the second intersection point to obtain a first deduplication intersection point and a second deduplication intersection point; Intersection point types are determined for the first deduplicated intersection points and the second deduplicated intersection points to obtain a determination result.

6. The method according to claim 5, wherein: The triangulation process is performed on the triangular mesh where the intersection point is located according to the processing method corresponding to the judgment result to obtain the triangulation mesh, including: According to the first deduplicated intersection point and the second deduplicated intersection point, construct a first deduplicated triangular face containing the first deduplicated intersection point and a second deduplicated triangular face containing the second deduplicated intersection point respectively; For the first deduplicated intersection whose judgment result meets the first intersection type, performing a triangulation process on the first deduplicated triangular surface according to a first triangulation algorithm, and for the first deduplicated intersection whose judgment result meets the second intersection type, performing a triangulation process on the first deduplicated triangular surface according to a second triangulation algorithm, to obtain a first triangulated triangular mesh; For the second deduplicated intersection points whose judgment results meet the first intersection type, the second deduplicated triangular faces are triangulated according to the first triangulation algorithm; and for the second deduplicated intersection points whose judgment results meet the second intersection type, the second deduplicated triangulated faces are triangulated according to the second triangulation algorithm to obtain a second triangulated triangular mesh.

7. The method according to claim 6, wherein: The step of performing identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identified mesh, a second identified mesh and a triangulated identified mesh comprises: The first closed triangular mesh, the second closed triangular mesh, the first subdivided triangular mesh and the second subdivided triangular mesh are marked to obtain a first marked mesh, a second marked mesh and a triangulated marked mesh.

8. A grid Boolean operation device, comprising: An intersection calculation module, used to calculate and obtain the intersection of the first closed triangular mesh and the second closed triangular mesh; An intersection type judgment module, used to judge the intersection type of the intersection and obtain a judgment result of the intersection; A triangulation module, configured to perform triangulation processing on the triangular mesh where the intersection point is located according to a processing method corresponding to the judgment result, so as to obtain a triangulation mesh; An identification processing module, used for performing identification processing on the first closed triangular mesh, the second closed triangular mesh and the triangulated mesh to obtain a first identification mesh, a second identification mesh and a triangulated identification mesh; The Boolean operation module is used to perform Boolean operation processing on the first identification grid, the second identification grid and the triangulation identification grid to obtain a Boolean operation result grid.

9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 7.

10. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.