Three-dimensional model punching method, system, and related devices

By precisely determining the block and hole positions of the photopolymer 3D printed model, and using an octree structure and ray marking method, the uncertainty of the drilling position and depth was solved, thereby improving drilling efficiency and model stability.

CN117227174BActive Publication Date: 2026-11-24SHENZHEN ANYCUBIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311137071.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2026-11-24
Estimated Expiration
2043-09-01

AI Technical Summary

Technical Problem

In existing photopolymer 3D printing technology, determining the location and depth of holes in the model requires continuous trial and error by the user, and the drilling accuracy and efficiency are greatly affected by the complexity of the model.

Method used

By dividing the model to be drilled and the hole model into blocks, the hole positions are determined using an octree structure and ray marking method. The surface patches of the model to be drilled outside the hole model and the surface patches of the hole model inside the hole model are accurately selected and combined to form the target model with holes.

Benefits of technology

It improves the efficiency of model drilling and the stability of finished products, reduces the pressure of material adsorbed in the model cavity, promotes material discharge, maintains internal and external air pressure balance, and improves the quality of 3D printing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117227174B_ABST
    Figure CN117227174B_ABST
Patent Text Reader

Abstract

The application discloses a three-dimensional model punching method, system and related equipment, and the method comprises the following steps: dividing a to-be-punched model and a hole body model into blocks to obtain sub-blocks corresponding to the two models respectively; comparing the sub-blocks of the to-be-punched model and the sub-blocks of the hole body model to determine a face sheet of the to-be-punched model located outside the hole body model and a face sheet of the hole body model located inside the to-be-punched model; and combining the face sheet of the to-be-punched model and the face sheet of the hole body model to obtain a target hole model with a hole. The model is alternatively expressed in the form of sub-blocks, which is helpful to accurately screen out the face sheet of the to-be-punched model located outside the hole body model and the face sheet of the hole body model located inside the to-be-punched model in a fine-grained manner, so that the position and size of the hole in the to-be-punched model and other characteristics are efficiently analyzed, the timeliness of model punching is improved, and the stability of a finished model is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of modeling technology, and in particular to a method, system and related equipment for drilling holes in a three-dimensional model. Background Technology

[0002] 3D printing is a technology that uses computer technology to create three-dimensional models, which are then imported into a 3D printer for production. It enables the rapid production of high-precision and complex processes that are impossible in traditional manufacturing. Specifically, this technology utilizes the principle of a regular printer, connecting the 3D printer to a computer. Liquid or powder materials are loaded into the printer body, and under computer control, a laser injector accumulates the materials layer by layer, ultimately transforming the 3D blueprint on the computer into a physical object.

[0003] In the process of photopolymer 3D printing, a hollow structure is usually used to reduce material usage, meaning the model is hollow inside. For this hollow structure, it is usually necessary to add holes to reduce the pressure of the printing material adsorbed inside the model cavity, and at the same time, to allow the printing material remaining inside the cavity to be discharged during the printing process; after the model is formed, the added holes can also maintain the balance of atmospheric pressure inside and outside the model, effectively reducing the impact of changes in air pressure inside and outside the model on the stability of the model structure.

[0004] However, currently, users need to experiment repeatedly to determine the drilling location and depth in the model to obtain a satisfactory hole-filled model. Furthermore, the drilling accuracy and time are significantly affected by the increasing complexity of the model. Therefore, it is necessary to provide an effective solution to this problem. Summary of the Invention

[0005] This application provides a method, system, and related equipment for drilling holes in three-dimensional models, which enhances the stability of the finished three-dimensional model through efficient drilling.

[0006] The first aspect of this application provides a method for drilling holes in a three-dimensional model, including:

[0007] Divide the model to be drilled and the model of the hole into blocks to obtain the sub-blocks corresponding to the two models respectively;

[0008] The sub-blocks of the model to be punched and the sub-blocks of the hole model are compared to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched.

[0009] By combining the facets of the model to be drilled and the facets of the hole model, a target perforated model with holes is formed.

[0010] Optionally, when the tree structure is an octree structure, the process of establishing the octree structure of the model to be punched and the octree structure of the hole model includes:

[0011] Based on the endpoint information of all triangular facets in the mesh structure of the model to be drilled and the hole model, three-dimensional cubes of the model to be drilled and the hole model are respectively established, and the endpoint information is used to reflect the size of the model;

[0012] Each of the three-dimensional cubes is divided into eight equal-sized sub-blocks, and multiple threads are started to determine the sub-blocks to which the triangular facets belong;

[0013] If the number of layers of the sub-block to which the triangular facet belongs has not reached the preset deepest layer, the sub-block is divided into eight sub-blocks of equal size until the number of layers of the sub-blocks reaches the deepest layer, and an octree structure with the number of layers of the three-dimensional space as the deepest layer is established; wherein, the bottom sub-block at the deepest layer is used to store the triangular facets of the model.

[0014] Optionally, determining the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled based on the point element information of the first and second sub-triangular facets includes:

[0015] Based on the point element information of the first and second sub-triangular facets, construct the region vector corresponding to each triangular facet.

[0016] Based on the comparison of the positive and negative signs of the region vector of the undetermined facet and the contour vector of the reference model, it is determined whether the undetermined facet is inside or outside the reference model; wherein, when the undetermined facet is the first sub-triangular facet, the reference model is a hole model, and when the undetermined facet is the second sub-triangular facet, the reference model is a hole model.

[0017] Optionally, the step of dividing the first triangular facet into multiple first sub-triangular facets and the second triangular facet into multiple second sub-triangular facets based on the intersection segment between the first triangular facet and the second triangular facet includes:

[0018] Delete the first and second triangular facets that have been segmented.

[0019] Optionally, the process of generating the pore model includes:

[0020] Obtain the preset inner and outer aperture sizes, and the preset extension length inside and / or outside the model to be drilled;

[0021] The hole model is generated based on the inner and outer aperture sizes and the preset extension length.

[0022] Optionally, the three-dimensional model drilling method further includes: storing the facets of the model to be drilled and the hole model within sub-blocks of their respective models, the process including:

[0023] Place the dough pieces into the sub-blocks where the dough pieces are located, or into the empty sub-blocks adjacent to the location of the dough pieces;

[0024] If there is more than one sub-block at the location of the piece, then the piece is placed into any of the empty sub-blocks.

[0025] The method described in the first aspect of this application may be implemented using the content described in the second aspect of this application.

[0026] A second aspect of this application provides a three-dimensional model drilling system, including: a comparison unit and a processing unit;

[0027] The processing unit is used to divide the model to be punched and the hole body model into blocks to obtain sub-blocks corresponding to the two models respectively.

[0028] The comparison unit is used to compare the sub-blocks of the model to be punched with the sub-blocks of the hole model to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched.

[0029] The processing unit is also used to combine the facets of the model to be punched and the facets of the hole model to form a target perforated model with holes.

[0030] A third aspect of this application provides an electronic device, including:

[0031] Central processing unit, memory, and input / output interfaces;

[0032] The memory is either a short-term storage memory or a persistent storage memory;

[0033] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method described in the first aspect of the embodiments of this application or any specific implementation thereof.

[0034] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect of this application or any specific implementation thereof.

[0035] The fifth aspect of this application provides a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to perform the method described in the first aspect of this application or any specific implementation thereof.

[0036] As can be seen from the above technical solutions, the embodiments of this application have at least the following advantages:

[0037] Representing the model in the form of sub-blocks helps to accurately and finely screen the facets of the model to be drilled that are outside the hole model and the facets of the hole model that are inside the hole model. This allows for efficient determination of the position and size of the holes on the model to be drilled, thereby improving the timeliness of model drilling and ensuring the stability of the finished model. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0039] It should be noted that although the steps in the flowcharts (if any) involved in the embodiments are drawn sequentially according to the arrows, unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts involved in the embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0040] Figure 1 This is a flowchart illustrating a three-dimensional model drilling method according to some embodiments of this application;

[0041] Figure 2a This is a schematic diagram illustrating the drilling process in some embodiments of this application;

[0042] Figure 2b This is a schematic diagram of a tree-like data structure for some embodiments of this application;

[0043] Figure 2c This is a schematic diagram illustrating the drilling process in some embodiments of this application;

[0044] Figure 3 This is a schematic diagram of the intersection line segments of triangular facets in some embodiments of this application;

[0045] Figure 4 This is a schematic diagram of the triangular facets divided according to some embodiments of this application;

[0046] Figure 5 This is a schematic diagram of the ray marking method in some embodiments of this application;

[0047] Figure 6 This is a schematic diagram illustrating intersection tests of some embodiments of this application;

[0048] Figure 7 This is a flowchart illustrating a three-dimensional model drilling method according to some embodiments of this application;

[0049] Figure 8 A schematic diagram illustrating the generation of hole models for some embodiments of this application;

[0050] Figure 9 This is a schematic flowchart of an electronic device according to some embodiments of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0053] In the following description, expressions such as "one specific implementation" or "one specific example" describe a subset of all possible embodiments. However, it is understood that "one specific implementation" or "one specific example" can be the same or different subset of all possible embodiments and can be combined with each other without conflict. In the following description, the term "multiple" means at least two. When a certain value mentioned in this application reaches a threshold (if it exists), in some specific examples, it may include the former being greater than the latter. When "any" or "at least one" or similar expressions are mentioned, it specifically refers to any one of the listed examples or any combination of these examples.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0055] For ease of understanding, the definitions appearing in this application are explained below.

[0056] Octree: A tree used to describe three-dimensional space (such as...) Figure 2b The left side shows a tree-like data structure (a 3D cube). Each node in an octree represents a volume element of the cube, and each node has eight child nodes (which can be considered as child blocks). The sum of the volumes represented by the eight child nodes equals the volume of the parent node. An octree is an extension of a quadtree in three-dimensional space. In two dimensions, we have four quadrants, while in three dimensions, we have eight quadrants. Octrees are mainly used for spatial partitioning and nearest neighbor search. Implementation Figure 2b The principle of Octree on the right is as follows: subdivide the current cube into eight sub-cubes (i.e., sub-blocks); if any sub-cube contains multiple points, further subdivide it into eight sub-cubes; repeat the above operation so that each sub-cube contains at most one point, in short, recursively subdivide the cube into eight parts.

[0057] It should be noted that the terms "sub-block," "(three-dimensional) space," and "grid" mentioned in this application can all refer to the same thing and can all be used to refer to three-dimensional objects in a three-dimensional environment. Therefore, they can be used interchangeably or as annotations. A three-dimensional cube built according to the dimensions of the model to be drilled can be as follows: Figure 2a or Figure 2c As shown, the three-dimensional cube can be subdivided into multiple sub-blocks. Figure 2a or Figure 2c The illustrations show different overlap patterns between the hole model (cylindrical) and the model to be drilled. Other overlap patterns are also possible, and this application does not impose any limitations. The accompanying drawings are merely illustrative and for understanding purposes only. Figure 2aThe top layer can be denoted as layer 0, and the maximum recursion depth (which can be defined by the user) is 1, meaning it has been subdivided once. Furthermore, the triangle mentioned in this application (if any) refers to a triangular facet.

[0058] The method described in this application will be further explained in detail below.

[0059] Please see Figure 1 The first aspect of this application provides a specific embodiment of a three-dimensional model drilling method, which includes the following operation steps:

[0060] Step 11: Divide the model to be punched and the hole model into blocks to obtain the sub-blocks corresponding to the two models respectively.

[0061] Since holes are generally cylindrical, the hole model can be understood as a three-dimensional model in the shape of a cylinder (such as a solid cylinder), and its size represents the size of the hole to be generated on the model to be drilled. If multiple holes are to be drilled on the model to be drilled, multiple hole models can be constructed, and operations such as step 12 can be performed on the hole models in a similar manner. The order of execution of the operations (such as step 12) between the hole models is not limited, or they can be executed simultaneously, which can be determined by the user. Generally, after a hole is drilled, the target hole model will be used as the next model to be drilled and one more hole will be drilled, and so on, until all holes are added.

[0062] like Figure 2a As shown, when the model to be punched is a triangular prism, this sub-block can be understood as a cube built according to the length, width, and height of the triangular prism, which is divided into eight equal parts (step by step). The deepest sub-blocks are used to store the facets of the model, such as triangular facets.

[0063] Step 12: Compare the sub-blocks of the model to be punched with the sub-blocks of the hole model to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched.

[0064] In some implementations, the facets of each model can be stored within sub-blocks of their respective models. After dividing the model to be punched and the hole model into multiple sub-blocks, comparing the sub-blocks of the two helps to locate the sub-block containing the material of the model to be punched and the sub-block containing the material of the hole model. Then, by comparing the corresponding sub-blocks, the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched can be distinguished.

[0065] Step 13: Combine the facets of the model to be drilled and the facets of the hole model to create a target model with holes.

[0066] By combining the facets of the model to be punched and the facets of the hole model as distinguished above, a target hole model with holes added at the corresponding positions can be generated, thus completing the combination between the model to be punched and the hole model and realizing the generation of holes in the 3D model.

[0067] In summary, the embodiments of this application use sub-blocks to alternatively represent the model, which helps to accurately determine the facets of the model to be drilled outside the hole model and the facets of the hole model inside the hole model. This allows for efficient determination of the position and size of the holes on the model to be drilled, thereby improving the timeliness of model drilling and ensuring the stability of the finished model.

[0068] Based on the examples above, some specific possible implementation examples will be provided below. In practical applications, the implementation details of these examples can be combined or implemented separately as needed, depending on the corresponding functional principles and application logic.

[0069] Please see Figures 1 to 7 The first aspect of this application provides some other specific embodiments of a three-dimensional model drilling method, which may include the following operation steps:

[0070] Step 11: Divide the model to be punched and the hole model into blocks to obtain the sub-blocks corresponding to the two models respectively.

[0071] For details, please refer to the detailed description of step 11 in the previous embodiment, which will not be repeated here.

[0072] Step 12: Compare the sub-blocks of the model to be punched with the sub-blocks of the hole model to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched.

[0073] In some specific examples, the sub-blocks of the two models above are arranged in a tree structure, such as arranged as Figure 2b The octree structure shown; the specific operation process of step 12 may include: comparing and testing the sub-blocks of the two models in the tree structure (such as the bottom-level sub-blocks of their respective octrees) to determine the first triangular facet in the model to be drilled and the second triangular facet in the hole model; wherein the first triangular facet and the second triangular facet intersect; based on the intersection line segment between the first triangular facet and the second triangular facet, the first triangular facet is divided into multiple first sub-triangular facets, and the second triangular facet is divided into multiple second sub-triangular facets; based on the point element information of the first sub-triangular facet and the second sub-triangular facet, the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled are determined. In some embodiments, the point element may include the endpoints and / or internal points of the facet.

[0074] The tree structure described above can be an octree structure (e.g., Figure 2b Nested structures such as binary trees or KD trees are not specifically limited. This tree structure can be used to hierarchically summarize blocks in the model from large to small. This application mainly illustrates the implementation through an octree structure. In embodiments such as binary trees or KD trees, based on the principles of this invention, the above-mentioned block division method can also be applied. The facets in this application can be triangular in shape (referred to as triangular facets).

[0075] In some specific examples, the process of storing patches within their respective model sub-blocks may include: placing the patch within the sub-block where the patch is located, or placing it within an empty sub-block adjacent to the patch's location; if there is more than one sub-block at the patch's location, then the patch is placed within any of the empty sub-blocks. In some implementations, the location of a patch mainly refers to the area covered by the patch. The sub-block at that location may have overlapping areas covered by the patch and the corresponding sub-block. For example, if the area covered by a patch overlaps with the areas covered by multiple sub-blocks, then it can be considered that there is more than one sub-block at the patch's location.

[0076] For example, all the triangular faces of the model to be punched can be traversed, and these triangular faces (e.g., sequentially) can be placed into the grid of the octree structure A of the model. Here, "grid" can be understood as the sub-block of the position of triangular face T1 itself (e.g., ...). Figure 2a The sub-block 14), or an empty sub-block adjacent to that position (such as sub-block 13 adjacent to the aforementioned sub-block 14 and having spare space); similarly, traverse all triangular faces of the hole model and place these triangular faces into the grids of the octree structure B of the model. Then, perform intersection tests on all grids in octree structure A and all grids in octree structure B respectively. If grid M and grid N intersect, i.e., spatial intersection, then extract all triangular faces in grid M and all triangular faces in grid N. Further, perform intersection tests on all triangular faces in grid M and all triangular faces in grid N in turn. If the triangular faces intersect, mark them. Thus, the first triangular face in the model to be punched and the second triangular face in the hole model can be determined. Similarly, other tree structures can be used to replace the octree in this example to achieve intersection testing based on the tree structure. The depth of the tree structure, i.e., the number of layers, can be determined by the user.

[0077] Of course, you can also choose not to use some sub-blocks (such as those without faces) as reference objects, and only compare a portion of the sub-blocks of the model to reduce the amount of computation and time. For details, please see the explanation of the operation of "excluding sub-blocks that do not belong to the intersecting sub-block pair in the two models" below.

[0078] Considering that currently only triangular facets can be defined and identified, and that triangles are the basic building blocks of other polygons, the focus of this application is to subdivide triangular facets, rather than facets of other polygons. In other words, for facets with more sides, such as quadrilaterals, they should be divided into multiple triangular facets to meet computational needs and achieve more precise, finer-grained positioning of holes. Accordingly, based on the intersection line segment between two facets, the two facets containing the intersection line segment can be further subdivided into sub-triangular facets. Subsequently, the sub-triangular facets distributed outside or inside the model can be distinguished by the point element information of the sub-triangular facets, such as the coordinates or position information of the triangle vertices (i.e., endpoints), center, and / or centroid (the latter two being internal points).

[0079] After dividing the triangular facet into sub-triangular facets as described above, you can choose to delete the divided triangular facet (such as deleting the original intersecting triangular facet), and replace the original large facet with the sub-triangular facet obtained from the division. Accordingly, the deleted original triangular facet (large facet) does not need to use the ray method to mark whether it belongs to the interior or exterior of the model. Instead, the ray method is applied to the sub-triangular facet obtained from the division.

[0080] The process of calculating the line of intersection from intersecting triangles can be as follows: Figure 3 As shown, triangular facet 33 intersects with triangular facets 32 and 34 respectively, and 30 and 31 are intersection line segments. The process of subdividing the triangular facets can be described as follows: Figure 4 As shown, triangular facet 40 is an intersecting triangular facet (e.g., Figure 3 The triangular facet 33 shown is the large triangular facet to be subdivided. The triangular facets labeled 41, 42, 43, 44, and 45 are the sub-triangular facets after subdividing triangular facet 40 based on the intersection segments 30 and 31. In some embodiments, since the line segments are determined by the two points of the start and end, the sub-triangular facets can be subdivided based on the positions of the start and end points of the two intersection segments.

[0081] As one possible implementation, the operation of "determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the point element information of the first and second sub-triangular facets" can specifically include the ray marking method: drawing rays from the internal points of the first sub-triangular facet to the internal points of the hole model, and finding the first intersection point of the ray with the hole model; drawing rays from the internal points of the second sub-triangular facet to the internal points of the model to be drilled, and finding the second intersection point of the ray with the model to be drilled; and determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the number of the first and second intersection points.

[0082] For example, in embodiment i: Iterate through all the first sub-triangular faces obtained from the subdivision of the model to be drilled, take triangular face T1, and draw a ray from an interior point (e.g., the centroid) of triangular face T1 towards an interior point (e.g., the centroid) of the hole model. Perform an intersection test on this ray with the hole model to find the second sub-triangular face T2 that intersects with T1, and record the number of intersection points between the ray and the hole model. Similarly, in embodiment ii: Iterate through all the second sub-triangular faces obtained from the subdivision of the hole model, take triangular face T2, and draw a ray from an interior point (e.g., the centroid) of T2 towards an interior point (e.g., the centroid) of the model to be drilled. Perform an intersection test on this ray with the model to be drilled to find the first sub-triangular face T1 that intersects with T2, and record the number of intersection points between the ray and the hole model. Thus, based on the number of intersection points obtained by the ray method, the set of subdivision (sub)triangular faces can be marked internally or externally (see the ray marking method described later). It should be noted that the T1 declared in embodiment i is not necessarily the T1 pre-found declared in embodiment ii; the execution order of finding intersecting faces in embodiments i and ii is not limited, and the execution order of counting the number of intersection points is also not limited.

[0083] In some specific examples, the operation of "determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the number of the first intersection point and the number of the second intersection point" can specifically include: determining the sub-triangular facet inside the model when the number of the first intersection point and the number of the second intersection point are odd; and determining the sub-triangular facet outside the model when the number of the first intersection point and the number of the second intersection point are even.

[0084] In other words, if the number of intersection points is odd, the sub-triangular facet is marked as an internal triangular facet; if the number of intersection points is even, the sub-triangular facet is marked as an external triangular facet. The process of marking the internal and external triangular facets using the ray-mapping method described above can be as follows: Figure 5 As shown, 50 represents the model to be punched (the diagram shows the outline of the model), and 51 is the centroid of the triangular facet to be marked (belonging to the hole model). A ray is drawn from the centroid 51 towards an interior point of another model (e.g., towards the center of the model to be punched). This ray intersects the outline of 50 at point 52. Since there is only one (odd) intersection point, the triangular facet 51 can be marked as falling inside the model to be punched, i.e., the triangular facet to be marked is an internal triangle. Conversely, if the number of intersection points is even (because there are one in and one out intersection with the overall outline of the model), then the triangular facet to be marked falls outside the model to be punched, i.e., it is an external triangular facet. Similarly, this ray marking method can also be applied to the hole model, i.e., to determine whether a sub-triangular facet belonging to the model to be punched is inside or outside the hole model.

[0085] In some specific examples, the operation of "dividing the first triangular facet into multiple first sub-triangular facets and the second triangular facet into multiple second sub-triangular facets based on the intersection segments between the first and second triangular facets" may further include: selecting an intersection segment as the starting intersection segment, traversing other intersection segments except the starting intersection segment to find the selected intersection segment of the starting intersection segment, wherein the endpoint of the selected intersection segment is the same as the starting point of the starting intersection segment; if a selected intersection segment is found, the selected intersection segment is used as the next starting intersection segment, and the traversal continues to find the selected intersection segment of the next starting intersection segment; if the initial starting intersection segment is found as a selected intersection segment, the multiple selected intersection segments in the traversal process are connected end to end to form a closed polygon; selecting the first and second triangular facets corresponding to each selected intersection segment in the closed polygon as triangular facets to be processed, and dividing the triangular facets to be processed based on each selected intersection segment to obtain the first and second sub-triangular facets.

[0086] After selecting the intersecting sub-triangular facets, the intersection line segment of two intersecting triangular facets can be indicated. This intersection line segment consists of a starting point P1 and an ending point P2. This intersection line segment is located on the intersection line of the two intersecting triangles. Subsequently, multiple intersection lines can be connected end to end to form a closed polygon. Optionally, before forming a closed polygon, the method of this application embodiment may further include: for multiple facets in a model (the model to be punched or the hole model) that are completely overlapping before being subdivided, only one facet is selected to form an intersection line segment with a sub-facet of another model (the hole model or the model to be punched). That is, one facet is selected and the repeated processing of other identical facets is abandoned, so as to avoid the coplanar sub-facets forming multiple intersection line segments, which would complicate the subsequent process of forming a closed polygon and require a large amount of computing resources. In other words, redundant intersection points can be deleted to avoid having too many intersection line segments participating in the formation of a closed polygon, which would complicate the operation and prolong the processing progress.

[0087] The process described above, where intersecting line segments are connected end-to-end to form a closed polygon, can be as follows: Take any intersecting line segment L1 and its starting point P1. Traverse other intersecting line segments and find L2 (i.e., the selected intersecting line segment) and its ending point P2. If L2 satisfies the condition "P1 and P2 are equal", then mark L1 and L2 as connected. Furthermore, the method for determining whether a closed polygon can be formed is as follows: Starting from an intersecting line segment L1, find the next intersecting line segment L2 that connects to it. If it is found, continue searching for the next selected intersecting line segment that connects to L2 until L1 is finally found. This indicates that a closed polygon has been formed. If L1 is not found after traversing all segments, it means that a closed polygon cannot be formed, and the punching process should be terminated.

[0088] Next, based on the closed polygon formed above, take the triangular facets containing the intersecting line segments of the closed polygon, and divide these triangles into several sub-triangles (i.e., sub-triangular facets) according to the intersecting line segments, forming a set of (sub)triangles. Of course, you can also choose to delete the original intersecting triangles (i.e., the ones being divided), so that the subdivided sub-triangles replace the original intersecting triangles. For example, the Lawson algorithm or the Bowyer-Watson algorithm, which implements Delaunay triangulation, can be used to divide the original intersecting triangles (i.e., large facets) into several sub-facets.

[0089] Step 13: Combine the facets of the model to be drilled and the facets of the hole model to create a target model with holes.

[0090] After marking the sub-triangular faces inside or outside the model in step 12 (i.e., obtaining the triangle marking results), the required triangles can be selected and combined to form the model after drilling according to the following rules: Select all triangles marked as external in the model to be drilled (i.e., the first sub-triangular faces outside the hole model), and all triangles marked as internal in the hole model (i.e., the second sub-triangular faces inside the model to be drilled). The triangles from these two parts are used to form the new model, which is the final output result required by this implementation method—the target perforated model. In short, this combination rule means that each model leaves a part. It can be understood that from the perspective of the model to be drilled, the area to be left is the part outside the hole model, and the part inside the hole model is to be drilled and removed; conversely, from the perspective of the hole model, the area to be left is the part inside the model to be drilled, and the part outside the model to be drilled is not needed. Of course, in addition to the triangles in the two parts mentioned above, the construction of the target hole model may also utilize those original triangle patches that do not intersect and have not been deleted, which may vary depending on the actual situation.

[0091] As described above, the method of this application embodiment can quickly find the intersecting triangular facets between the two models, namely the first triangular facet and the second triangular facet, based on the intersection of the tree structure (such as an octree) between the model to be punched and the hole model. Using the sub-triangular facets obtained from the subdivision to replace the aforementioned intersecting triangular facets, and finding the number of ray intersection points between one model's sub-facet and the other model, it can further accurately locate whether a facet of one model is inside or outside the other model. In other words, this method can more granularly enhance the accuracy of marking the inside and outside of the triangular facets, thereby efficiently determining the position and size of the hole on the model to be punched, thus improving the efficiency of model punching and ensuring the stability of the finished model. Here, the improved punching efficiency can be understood as helping to reduce the residual printing material in the model's internal cavity, thereby reducing the model's curing time. Ensuring stability can be achieved in several ways: reducing the pressure of the printing material adsorbed in the model's internal cavity, effectively preventing the model from falling off the printing platform; facilitating the discharge of printing material remaining in the internal cavity during the printing process, saving raw materials; and ensuring that the atmospheric pressure inside and outside the model is the same after molding through the holes, eliminating the pressure caused by the difference between the internal and external atmospheric pressure, so that the model can maintain the balance of internal and external atmospheric pressure after molding, thereby improving the quality of the 3D printed structure.

[0092] The following will provide a more detailed explanation of some of the operations in the specific example in step 12.

[0093] To clarify, in some specific examples, the operation described above, "comparing and testing the sub-blocks of the model to be punched and the sub-blocks of the hole model to determine the first triangular facet in the model to be punched and the second triangular facet in the hole model," may specifically include: identifying the intersecting sub-block pairs formed between the sub-blocks of the two models, and excluding sub-blocks in the two models that do not belong to the intersecting sub-block pairs or do not contain facets; an intersecting sub-block pair refers to the intersection of a bottom-level sub-block of a tree structure with a bottom-level sub-block of another tree structure (such as the bottom-level sub-blocks of the octrees of the two models); for the triangular facet T1 within a bottom-level sub-block in the intersecting sub-block pair, determining whether T1 is... Whether the evaluation planes intersect; the evaluation plane refers to the plane containing the triangular facet T2 in the other bottom sub-block of the intersecting sub-block; if T1 and T2 intersect with their respective evaluation planes, then determine whether the first intersection interval and the second intersection interval overlap; the first intersection interval and the second intersection interval are the set of intersection points formed by the intersection lines of the T1 edge and the T2 edge with the plane, where the plane intersection line refers to the intersection line between the plane containing T1 and the evaluation plane; the overlapping first intersection interval and second intersection interval, respectively, are T1 and T2 corresponding to the triangular facets that intersect, so as to determine the first and second triangular facets of the intersecting sub-blocks.

[0094] For example, the idea of the Devillers & Guigue algorithm (referred to as the Devillers algorithm) can be used to determine the relative positional relationship among points, lines and planes in a triangle through the geometric meaning of the sign of the determinant formed by the vertices of the triangle, so as to determine whether two triangles intersect. Suppose two triangles T1 and T2 have vertices V10, V11, V12 and V20, V21, V22 respectively, the planes where these two triangles are located are π1 and π2 respectively, and their normal vectors are N1 and N2 respectively. The Devillers algorithm first determines the mutual positional relationship between one triangle and the plane where the other triangle is located, and excludes non-intersecting cases in advance. For example, the relationship between T1 and the evaluated plane π2 is judged by calculating the determinant [V20, V21, V22, V1i] (i=0,1,2): if all the determinant values are non-zero and have the same sign, T1 and T2 do not intersect; otherwise, T1 intersects π2. The intersection is further divided into the following cases: a) If all the determinant values are zero, T1 and T2 are coplanar, and the problem is transformed into a coplanar line segment intersection problem. b) If one of the determinant values is zero and the other two determinants have the same sign, only one point is in the plane. Test whether the vertex of T1 is inside T2; if yes, they intersect, otherwise they do not intersect; c) Otherwise, the vertices of T1 are located on both sides of the plane π2, including the case where one edge of T1 is in the plane π2.

[0095] After that, further tests are performed on T2 and π1 using a similar method. If the test is passed, each triangle must have a certain point on one side of the plane where the other triangle is located, and the other two points are on the other side. The algorithm cyclically permutes the vertices of each triangle separately so that V10 (V20) is located on one side of π2 (π1), and the other two points are located on the other side; at the same time, the vertices V21, V22 (V11, V12) are swapped to ensure that V10 (V20) is located above π2 (π1), that is, in the positive normal direction. After the above pre-exclusion and permutation operations, the adjacent edges V10V11, V10V12 of V10 and the adjacent edges V20V21, V20V22 of V20 intersect the intersection line L of the two planes at points in a fixed form, which are recorded as i, j, k, l (i<j, k<l) respectively, as shown in Figure 6 , the closed interval formed by these points on the plane intersection line L (i.e., the intersection point interval) is i1=[i,j], i2=[k,l]. So far, the intersection test problem of the two triangles is transformed into the overlap problem between the closed intervals i1 and i2. If the two overlap, the two triangles intersect; otherwise, the two triangles do not intersect. Generally, since the intersection point form is fixed, only the conditions k≤j and i≤l need to be satisfied, which indicates that the intervals overlap.

[0096] Still referring to Figure 2aFor example, similar to the octree sub-blocks of the model to be punched, the hole model can also be constructed into a three-dimensional cube according to its size. This cube can also be divided into eight equal sub-blocks, i.e., arranged according to the octree structure. In this way, there will be a sub-block of the hole model that overlaps with the sub-block 13 shown in the figure (which can be paired), thus forming a pair of intersecting sub-blocks. Of course, the hole model may have more than one sub-block that overlaps with the sub-block 13 shown in the figure.

[0097] As one possible implementation method, Figure 2a The triangular facets of the model to be punched (as shown in T1) can be placed into sub-block 14 according to their location, and rarely, if not, into sub-block 22. In other words, if a triangular facet is selected to be placed into its current sub-block, and that sub-block has enough space to hold the facet, meaning that the triangular facets of the model to be punched will not be placed into other sub-blocks such as 12 or 22, then sub-blocks 12 and 22, which do not contain facets, do not need to be compared with the sub-blocks of the hole model (the purpose of this comparison is to determine the required marked facets), and therefore do not need to be used as reference objects. This is because sub-blocks 12 and 22 do not contain facets themselves, or, in other words, these two sub-blocks are far from the location of the hole model, meaning there is no overlap in their positions, so they do not need to be compared to avoid increasing the amount of computation and operation time. Thus, we can exclude sub-blocks that do not belong to intersecting sub-block pairs or do not contain facets from the two models. That is, we can ignore the comparison process of non-intersecting sub-blocks or those without facets (not as reference objects) to reduce the waste of computing resources and time costs.

[0098] In some specific examples, the process of "determining the intersecting sub-block pairs formed between the sub-blocks of the two models" can include: determining pairs of intersecting sub-blocks between the two models based on the coordinates and dimensions of the sub-blocks; these pairs of sub-blocks are used to form intersecting sub-block pairs; and excluding sub-blocks in the two models that do not belong to intersecting sub-block pairs. Specifically, based on the vertex coordinates and dimensions of a sub-block, it can be determined whether the sub-block has a position point (such as a vertex or an interior point) that falls within another sub-block. If so, it indicates that the two sub-blocks are intersecting pairs; otherwise, they are not.

[0099] In some specific examples, when the tree structure is an octree structure, the above-mentioned "establishment process of the octree structure of the model to be punched and the hole model" may specifically include: based on the endpoint information of all triangular facets in the mesh structure of the model to be punched and the hole model, respectively, three-dimensional cubes of the model to be punched and the hole model are established, and the endpoint information is used to reflect the size of the model; each three-dimensional cube is divided into eight sub-blocks of equal size, and multiple threads are started to determine the sub-blocks to which the triangular facets belong; if the number of layers of the sub-block to which the triangular facet belongs has not reached the preset deepest layer, the sub-block is divided into eight sub-blocks of equal size until the number of layers of the sub-block reaches the deepest layer, and this layer is the bottom layer sub-block, thus establishing an octree structure with the deepest layer in the three-dimensional space; wherein, the bottom layer sub-block at the deepest layer is used to store the triangular facets of the model.

[0100] The process of building an octree structure can be as follows: Figure 7 As shown, the process includes the following steps S111 to S117 (taking the model to be drilled as an example):

[0101] S111, Set the maximum recursion depth. Specifically, for numerical values... Rounding up gives the maximum recursion depth, where x represents the total number of triangular faces in each model (such as the model to be drilled or the hole model). Generally, a maximum recursion depth of 3 to 5 is suitable, such as 4.

[0102] S112. Traverse all triangular faces of the model to be punched (or target model) to obtain model dimensions and establish a three-dimensional space cube. Traverse all triangular faces of the model to be punched and the hole model (or cylinder model). By analyzing the triangular faces, the points corresponding to the length, width, and height of the model can be obtained, thus obtaining the length L, width W, and height H of the model to be punched and the hole model respectively. Based on L, W, and H, establish the most complete top-level space cube (such as a cube and a cylinder). This top-level space cube can be understood as the three-dimensional space cube that can encompass the entire model to the greatest extent, that is, the largest size. Figure 2b The topmost cube shown (when it is not divided into blocks).

[0103] S113. Subdivide the three-dimensional cube of S112 into 8 equal-sized sub-blocks. For example, divide it into... Figure 2b The eight small cubes in the middle are shown.

[0104] S114. Start multiple threads to process the eight equally sized sub-blocks. Threading here helps improve the computer's CPU processing speed, reduces processing time, and allows all triangles of each model to be placed into their respective eight sub-blocks more quickly. Preferably, using eight threads to traverse and process the model's triangle faces allows for parallel octree collision detection, further accelerating the processing, improving generation efficiency, and significantly reducing the design time of the 3D model. Of course, the specific number of threads can be determined as needed.

[0105] S115. Each thread traverses the triangular facets of the model and determines whether the triangle is within the corresponding sub-block.

[0106] S116. If the current triangle is within the corresponding sub-block, and the sub-block's layer number has not reached the maximum layer limit (e.g., 4 layers) of the maximum recursion depth, then further divide the current sub-block into 8 smaller sub-blocks, that is, continue to divide the 8 grids sequentially until the specified maximum layer number is reached. The current space can form a tree structure with its 8 sub-blocks, and any node in the tree will have exactly eight or zero child nodes.

[0107] S117. If the number of layers in a sub-block reaches the maximum, then the triangular facets are saved to the queue corresponding to the current space. That is, the triangular facets can be saved in the sub-block with the maximum layer (deepest or lowest layer), and the triangular facets are stored sequentially in the queue-style storage structure corresponding to that sub-block. It should be noted that the storage structure for saving the model and its octree structure can be the same, or it can be a set of different structures.

[0108] As another possible implementation (different from the ray marking method described in step 12), the operation of "determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the point element information of the first and second sub-triangular facets" can specifically include (vector marking method): constructing the region vector corresponding to each triangular facet based on the point element information of the first and second sub-triangular facets; determining whether the facet to be determined is inside or outside the reference model based on the comparison relationship between the region vector of the facet to be determined and the contour vector of the reference model in terms of scalar sign; wherein, when the facet to be determined is the first sub-triangular facet, the reference model is the hole model, and when the facet to be determined is the second sub-triangular facet, the reference model is the model to be drilled; the comparison relationship includes the two scalar values ​​being one positive and one negative, both positive, or both negative.

[0109] For example, based on the point element information such as the endpoint coordinates and / or interior point coordinates of the sub-triangular facets, a region vector can be constructed to represent the positional characteristics of each sub-triangular facet. Since the vector carries a directional indication, the sign of the scalar value corresponding to the vector can be used to mark whether a sub-triangular facet of one model is inside or outside of another model. Specifically, if the region vector of the facet to be determined and the contour vector of the reference model have opposite scalar values, the facet to be determined can be marked as outside the reference model, i.e., the facet to be determined is an external triangle; conversely, if they are opposite, the facet to be determined is marked as inside the reference model, i.e., the facet to be determined is an internal triangle.

[0110] In some specific examples, the process of generating the above-mentioned hole model may include: obtaining the preset inner and outer hole diameters and the preset extension length inside and / or outside the model to be drilled; generating the hole model based on the inner and outer hole diameters and the preset extension length.

[0111] The process of generating a pore model based on the size of the hole can be as follows: Figure 8 As shown, the dimensions of the hole model represent the size of the hole to be generated on the model to be drilled. This hole model has an outer diameter of 11 (i.e., the outer hole diameter), an inner diameter of 10, an inner extension length of 12, and an outer extension length of 13. The inner extension length represents the depth of the hole within the model to be drilled. Of course, the actual hole size can be adjusted by modifying the hole parameters, thereby increasing design flexibility.

[0112] In summary, this application can draw a ray starting from an internal point of a triangular facet, such as its centroid, and using the direction from the centroid of the triangular facet to the center of the model as the ray direction. The number of intersection points between the ray and the model determines whether the facet is inside or outside the model. This improves the accuracy of finding whether a facet is inside or outside the model, i.e., the positioning (i.e., marking) precision. Furthermore, by using eight threads for searching, in addition to detecting intersection regions using an octree, the positioning speed for determining whether a facet is inside or outside the model can be further improved.

[0113] A second aspect of this application provides a specific example of a three-dimensional model drilling system, the system comprising: a comparison unit and a processing unit;

[0114] The processing unit is used to divide the model to be punched and the hole body model into blocks to obtain sub-blocks corresponding to the two models respectively.

[0115] The comparison unit is used to compare the sub-blocks of the model to be punched with the sub-blocks of the hole model to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched.

[0116] The processing unit is also used to combine the facets of the model to be punched and the facets of the hole model to form a target perforated model with holes added.

[0117] Optionally, the sub-blocks of the model to be punched and the sub-blocks of the hole model are arranged in a tree structure; the comparison unit is specifically used for:

[0118] The sub-blocks of the model to be punched and the sub-blocks of the hole model are compared and tested to determine the first triangular facet in the model to be punched and the second triangular facet in the hole model; wherein the first triangular facet and the second triangular facet intersect.

[0119] Based on the intersection line segment between the first triangular facet and the second triangular facet, the first triangular facet is divided into multiple first sub-triangular facets, and the second triangular facet is divided into multiple second sub-triangular facets.

[0120] Based on the point element information of the first and second sub-triangular facets, the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled are determined; the point elements include the endpoints and / or internal points of the facets.

[0121] Optionally, the comparison unit is specifically used for:

[0122] Draw rays from the interior points of the first sub-triangle facet to the interior points of the hole model, and find the first intersection point of the ray with the hole model; draw rays from the interior points of the second sub-triangle facet to the interior points of the model to be drilled, and find the second intersection point of the ray with the model to be drilled.

[0123] Based on the number of the first intersection point and the number of the second intersection point, the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled are determined respectively.

[0124] Optionally, the comparison unit is specifically used for:

[0125] The sub-triangle facets with an odd number of first and second intersection points are identified as sub-triangle facets located inside the model.

[0126] The sub-triangle facets that have an even number of first and second intersection points are defined as sub-triangle facets located outside the model.

[0127] Optionally, the comparison unit is specifically used for:

[0128] Select one intersection segment as the starting intersection segment, and traverse all other intersection segments except the starting intersection segment to find the selected intersection segments of the starting intersection segment. The endpoint of the selected intersection segment is the same as the starting point of the starting intersection segment.

[0129] If a selected intersection segment is found, it is used as the next starting intersection segment, and the process continues to traverse and find the next starting intersection segment as the selected intersection segment. If the initial starting intersection segment is found as the selected intersection segment, the multiple selected intersection segments in the traversal process are connected end to end to form a closed polygon.

[0130] Select the first and second triangular facets corresponding to each selected intersection line segment in the closed polygon as the triangular facets to be processed, and divide the triangular facets to be processed according to each selected intersection line segment to obtain the first and second sub-triangular facets.

[0131] Optionally, the comparison unit is specifically used for:

[0132] Identify the intersecting sub-block pairs formed between the sub-blocks of the model to be punched and the hole body model, and exclude sub-blocks in the model to be punched and the hole body model that do not belong to intersecting sub-block pairs or do not contain facets. An intersecting sub-block pair refers to the intersection of a bottom-level sub-block of one tree structure with a bottom-level sub-block of another tree structure.

[0133] For a triangular face T1 in one bottom-level sub-block of an intersecting sub-block pair, determine whether triangular face T1 intersects with the evaluation plane; the evaluation plane refers to the plane containing triangular face T2 in another bottom-level sub-block of the intersecting sub-block pair.

[0134] If triangular facets T1 and T2 intersect with their respective evaluation planes, then determine whether the first intersection interval and the second intersection interval overlap. The first intersection interval and the second intersection interval are the sets of intersection points formed by the intersection lines of the sides of triangular facets T1 and T2 with the planes, where the plane intersection line refers to the intersection line between the plane containing triangular facet T1 or triangular facet T2 and the corresponding evaluation plane.

[0135] The overlapping first and second intersection intervals are respectively identified as triangular facets T1 and T2, which are intersecting triangular facets, so as to determine the first and second triangular facets of the intersecting sub-blocks.

[0136] Optionally, the comparison unit is specifically used for:

[0137] Based on the coordinate and size information of the sub-blocks, pairs of sub-blocks that intersect with the model to be drilled and the hole model are identified. These pairs of sub-blocks are used to form pairs of intersecting sub-blocks.

[0138] Optionally, when the tree structure is an octree structure, the processing unit is specifically used for:

[0139] Based on the endpoint information of all triangular facets in the mesh structure of the model to be punched and the hole model, three-dimensional cubes of the model to be punched and the hole model are established respectively. The endpoint information is used to reflect the size of the model.

[0140] Each 3D cube is divided into eight equal-sized sub-blocks, and multiple threads are started to determine the sub-blocks to which the triangular facets belong.

[0141] If the number of sub-blocks to which the triangular facet belongs has not reached the preset deepest number, the sub-block is divided into eight sub-blocks of equal size until the number of sub-blocks reaches the deepest number, thus establishing an octree structure with the deepest number of three-dimensional space layers; among them, the bottom sub-blocks at the deepest level are used to store the triangular facets of the model.

[0142] Optionally, the comparison unit is specifically used for:

[0143] Based on the point element information of the first and second sub-triangles, construct the region vector corresponding to each triangle.

[0144] Based on the comparison of the positive and negative signs of the region vector of the undetermined facet and the contour vector of the reference model, it is determined whether the undetermined facet is inside or outside the reference model; where the undetermined facet is the first sub-triangular facet, the reference model is the hole model, and the undetermined facet is the second sub-triangular facet, the reference model is the model to be drilled.

[0145] Optionally, the comparison unit is specifically used for:

[0146] Delete the first and second triangular facets that have already been divided.

[0147] Optionally, the processing unit is specifically used for:

[0148] Obtain the preset inner and outer hole diameters, and the preset extension length inside and / or outside the model to be drilled;

[0149] A hole model is generated based on the inner and outer diameters and the preset extension length.

[0150] Optionally, the processing unit is specifically used for:

[0151] Place the dough pieces into the sub-blocks where the dough pieces are located, or into the empty sub-blocks adjacent to the location of the dough pieces;

[0152] If there is more than one sub-block at the location of the piece, then the piece is placed into any of the empty sub-blocks.

[0153] In this embodiment, the operations performed by each unit of the 3D model drilling system are similar to those described in the first aspect or any specific method embodiment of the first aspect, and will not be repeated here. Of course, the specific implementation process of each operation in the first aspect of this application can also be found in the relevant description of the second aspect.

[0154] Please see Figure 9The electronic device 900 of this application embodiment may include one or more central processing units (CPUs) 901 and a memory 905, wherein the memory 905 stores one or more applications or data.

[0155] The memory 905 can be volatile or persistent storage. The program stored in the memory 905 can include one or more modules, each module including a series of instruction operations on the electronic device. Furthermore, the central processing unit 901 can be configured to communicate with the memory 905 and execute the series of instruction operations stored in the memory 905 on the electronic device 900.

[0156] Electronic device 900 may also include one or more power supplies 902, one or more wired or wireless network interfaces 903, one or more input / output interfaces 904, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0157] The central processing unit 901 can perform the operations performed by the first aspect or any specific method embodiment of the first aspect, which will not be described in detail here.

[0158] This application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect or any specific implementation thereof.

[0159] This application provides a computer program product containing instructions or computer programs, which, when run on a computer, causes the computer to perform the method described in the first aspect or any specific implementation thereof.

[0160] It is understood that, in the various embodiments of this application, the sequence number of each step does not imply the order of execution. The execution order of each step should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0161] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system (if it exists) and device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0162] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system or apparatus, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0164] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0165] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product (computer program product) is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a business server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0166] In the embodiments of this application, Embodiment 1: A method for drilling holes in a three-dimensional model includes: dividing a model to be drilled and a hole model into blocks to obtain sub-blocks corresponding to the two models respectively; comparing the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the facets of the model to be drilled located outside the hole model and the facets of the hole model located inside the model to be drilled; and combining the facets of the model to be drilled and the facets of the hole model to form a target perforated model with holes added.

[0167] Example 2: According to the three-dimensional model drilling method described in Example 1, the sub-blocks of the model to be drilled and the sub-blocks of the hole model are arranged in a tree structure; comparing the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the facets of the model to be drilled outside the hole model and the facets of the hole model inside the model to be drilled includes: comparing and testing the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the first triangular facet in the model to be drilled and the second and third triangular facets in the hole model. A triangular facet; wherein the first triangular facet and the second triangular facet intersect; based on the intersection line segment between the first triangular facet and the second triangular facet, the first triangular facet is divided into multiple first sub-triangular facets, and the second triangular facet is divided into multiple second sub-triangular facets; based on the point element information of the first sub-triangular facet and the second sub-triangular facet, the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled are determined; the point element includes the endpoints and / or internal points of the facet.

[0168] Example 3: According to the three-dimensional model drilling method described in Example 2, the step of determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the point element information of the first sub-triangular facet and the second sub-triangular facet includes: drawing rays from the internal points of the first sub-triangular facet to the internal points of the hole model, and finding the first intersection point of the ray with the hole model; drawing rays from the internal points of the second sub-triangular facet to the internal points of the model to be drilled, and finding the second intersection point of the ray with the model to be drilled; and determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the number of the first intersection points and the number of the second intersection points.

[0169] Example 4: According to the three-dimensional model drilling method described in Example 3, the step of determining the first sub-triangular facet outside the hole model and the second sub-triangular facet inside the model to be drilled based on the number of the first intersection points and the number of the second intersection points includes: determining the sub-triangular facet when the number of the first intersection points and the number of the second intersection points are odd as the sub-triangular facet inside the model; and determining the sub-triangular facet when the number of the first intersection points and the number of the second intersection points are even as the sub-triangular facet outside the model.

[0170] Example 5: According to the three-dimensional model drilling method described in Example 2, the step of dividing the first triangular facet into multiple first sub-triangular facets and the second triangular facet into multiple second sub-triangular facets based on the intersection line segment between the first triangular facet and the second triangular facet includes: selecting an intersection line segment as the starting intersection line segment, traversing other intersection line segments except the starting intersection line segment to find the selected intersection line segment of the starting intersection line segment, wherein the endpoint of the selected intersection line segment is the same as the starting point of the starting intersection line segment; if the selected intersection line segment is found... If a selected intersection segment is found, it is used as the next starting intersection segment, and the search continues to find the next starting intersection segment. If the initial starting intersection segment is found as a selected intersection segment, the multiple selected intersection segments in the traversal process are connected end to end to form a closed polygon. The first and second triangular facets corresponding to each selected intersection segment in the closed polygon are selected as triangular facets to be processed, and the triangular facets to be processed are divided according to each selected intersection segment to obtain the first and second sub-triangular facets.

[0171] Example 6: According to the three-dimensional model drilling method described in Example 2, the comparison test of the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the first triangular facet in the model to be drilled and the second triangular facet in the hole model includes: determining the intersecting sub-block pairs formed between the respective sub-blocks of the model to be drilled and the hole model, and excluding sub-blocks in the model to be drilled and the hole model that do not belong to the intersecting sub-block pairs or do not contain facets, wherein the intersecting sub-block pair refers to the intersection of a bottom-level sub-block of one tree structure with a bottom-level sub-block of another tree structure; for the triangular facet T1 in one bottom-level sub-block of the intersecting sub-block pair, determining whether the triangular facet T1 intersects with the reference plane; the reference plane refers to the other... The plane containing the triangular face T2 within the bottom sub-block; if the triangular face T1 and the triangular face T2 intersect with their respective evaluation planes, then determine whether the first intersection interval and the second intersection interval overlap; the first intersection interval and the second intersection interval are the set of intersection points formed by the edges of the triangular face T1 and the edges of the triangular face T2 with the plane intersection lines, wherein the plane intersection line refers to the intersection line between the plane containing the triangular face T1 or the triangular face T2 and the corresponding evaluation plane; the overlapping first intersection interval and second intersection interval, respectively, are the triangular face T1 and the triangular face T2 corresponding to them as intersecting triangular facets, so as to determine the first triangular facet and the second triangular facet that intersect with the sub-block.

[0172] Example 7: According to the three-dimensional model drilling method described in Example 6, determining the intersecting sub-block pairs formed between the sub-blocks of the model to be drilled and the hole model includes: determining the pairs of sub-blocks that intersect between the two models based on the coordinate and size information of the sub-blocks, wherein the pairs of sub-blocks are used to form the intersecting sub-block pairs.

[0173] Example 8: According to the three-dimensional model punching method described in Example 2, when the tree structure is an octree structure, the process of establishing the octree structure of the model to be punched and the octree structure of the hole model includes: based on the endpoint information of all triangular facets in the mesh structure of the model to be punched and the hole model, three-dimensional cubes of the model to be punched and the hole model are established respectively, and the endpoint information is used to reflect the size of the model; each three-dimensional cube is divided into eight sub-blocks of equal size, and multiple threads are started to determine the sub-blocks to which the triangular facets belong respectively; if the number of layers of the sub-block to which the triangular facet belongs does not reach the preset deepest layer, the sub-block is divided into eight sub-blocks of equal size until the number of layers of the sub-block reaches the deepest layer, and an octree structure with the number of layers in the three-dimensional space is established as the deepest layer; wherein, the bottom sub-block at the deepest layer is used to store the triangular facets of the model.

[0174] Example 9: According to the three-dimensional model drilling method described in Example 2, the step of determining the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled based on the point element information of the first sub-triangular facet and the second sub-triangular facet includes: constructing a region vector corresponding to each triangular facet based on the point element information of the first sub-triangular facet and the second sub-triangular facet; determining whether the facet to be determined is inside or outside the reference model based on the comparison of the positive and negative signs of the region vector of the facet to be determined and the contour vector of the reference model; wherein, when the facet to be determined is the first sub-triangular facet, the reference model is the hole model, and when the facet to be determined is the second sub-triangular facet, the reference model is the model to be drilled.

[0175] Example 10: According to the three-dimensional model drilling method described in Example 2, the step of dividing the first triangular facet into multiple first sub-triangular facets and dividing the second triangular facet into multiple second sub-triangular facets based on the intersection line segment between the first triangular facet and the second triangular facet includes: deleting the divided first triangular facet and second triangular facet.

[0176] Example 11: According to the three-dimensional model drilling method described in Example 1, the process of generating the hole model includes: obtaining a preset inner and outer hole diameter size, and a preset extension length inside and / or outside the model to be drilled; generating the hole model based on the inner and outer hole diameter size and the preset extension length.

[0177] Example 12: According to the three-dimensional model drilling method described in Example 1, the three-dimensional model drilling method further includes: storing the face pieces of the model to be drilled and the hole model in the sub-blocks of their respective models. The process includes: placing the face pieces into the sub-block where the face piece is located, or placing them into an empty sub-block adjacent to the location of the face piece; if there is more than one sub-block where the face piece is located, then the face piece is placed into any one of the empty sub-blocks.

[0178] Example 13: A three-dimensional model drilling system, comprising: a comparison unit and a processing unit; the processing unit is used to divide the model to be drilled and the hole model into blocks to obtain sub-blocks corresponding to the two models respectively; the comparison unit is used to compare the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the facets of the model to be drilled located outside the hole model and the facets of the hole model located inside the model to be drilled; the processing unit is further used to combine the facets of the model to be drilled and the facets of the hole model to form a target perforated model with holes added.

[0179] Example 14: An electronic device includes: a central processing unit, a memory, and an input / output interface; the memory is a temporary storage memory or a persistent storage memory; the central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method described in any one of Examples 1 to 12.

[0180] Example 15: A computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in any one of Examples 1 to 12.

Claims

1. A method for drilling holes in a three-dimensional model, characterized in that, include: Divide the model to be drilled and the model of the hole into blocks to obtain the sub-blocks corresponding to the two models respectively; The sub-blocks of the model to be punched and the sub-blocks of the hole model are compared to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched. By combining the facets of the model to be drilled outside the hole model and the facets of the hole model inside the hole model, a target perforated model with holes is formed.

2. The three-dimensional model drilling method according to claim 1, characterized in that, The sub-blocks of the model to be drilled and the sub-blocks of the hole model are arranged in a tree structure. The step of comparing the sub-blocks of the model to be drilled with the sub-blocks of the hole model to determine the facets of the model to be drilled that are outside the hole model and the facets of the hole model that are inside the model to be drilled includes: The sub-blocks of the model to be drilled and the sub-blocks of the hole model are compared and tested to determine the first triangular facet in the model to be drilled and the second triangular facet in the hole model; wherein the first triangular facet and the second triangular facet intersect. Based on the intersection line segment between the first triangular facet and the second triangular facet, the first triangular facet is divided into multiple first sub-triangular facets, and the second triangular facet is divided into multiple second sub-triangular facets; Based on the point element information of the first sub-triangular facet and the second sub-triangular facet, the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled are determined; the point element includes the endpoints and / or internal points of the facet.

3. The three-dimensional model drilling method according to claim 2, characterized in that, The step of determining the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled, based on the point element information of the first and second sub-triangular facets, includes: Draw a ray from the interior point of the first sub-triangular facet to the interior point of the hole model, and find the first intersection point of the ray with the hole model; draw a ray from the interior point of the second sub-triangular facet to the interior point of the model to be drilled, and find the second intersection point of the ray with the model to be drilled; Based on the number of the first intersection points and the number of the second intersection points, the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled are determined respectively.

4. The three-dimensional model drilling method according to claim 3, characterized in that, The step of determining the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled, based on the number of the first intersection points and the number of the second intersection points, includes: The sub-triangle facets that have an odd number of first intersection points and an odd number of second intersection points are identified as sub-triangle facets located inside the model. The sub-triangle facets that have an even number of the first intersection points and the second intersection point are defined as sub-triangle facets located outside the model.

5. The three-dimensional model drilling method according to claim 2, characterized in that, The step of dividing the first triangular facet into multiple first sub-triangular facets and the second triangular facet into multiple second sub-triangular facets based on the intersection line segment between the first triangular facet and the second triangular facet includes: Select one intersection segment as the starting intersection segment, and traverse all other intersection segments except the starting intersection segment to find the selected intersection segments of the starting intersection segment, wherein the endpoint of the selected intersection segment is the same as the starting point of the starting intersection segment; If the selected intersection segment is found, the selected intersection segment is used as the next starting intersection segment, and the search continues to find the next selected intersection segment of the starting intersection segment; if the initial starting intersection segment is found as the selected intersection segment, the multiple selected intersection segments in the traversal process are connected end to end to form a closed polygon. The first and second triangular facets corresponding to each selected intersection line segment in the closed polygon are selected as triangular facets to be processed, and the triangular facets to be processed are subdivided according to each selected intersection line segment to obtain the first and second sub-triangular facets.

6. The three-dimensional model drilling method according to claim 2, characterized in that, The step of comparing and testing the sub-blocks of the model to be drilled and the sub-blocks of the hole model to determine the first triangular facet in the model to be drilled and the second triangular facet in the hole model includes: Identify the intersecting sub-block pairs formed between the sub-blocks of the model to be punched and the hole body model, and exclude sub-blocks in the model to be punched and the hole body model that do not belong to the intersecting sub-block pairs or do not have facets. The intersecting sub-block pair refers to the intersection of a bottom-level sub-block of a tree structure with a bottom-level sub-block of another tree structure. For a triangular face T1 within a bottom-layer sub-block of the intersecting sub-block pair, determine whether the triangular face T1 intersects with the evaluation plane; the evaluation plane refers to the plane containing the triangular face T2 within another bottom-layer sub-block of the intersecting sub-block pair. If the triangular facet T1 and the triangular facet T2 intersect with their respective evaluation planes, then it is determined whether the first intersection interval and the second intersection interval overlap. The first intersection interval and the second intersection interval are the sets of intersection points formed by the intersection lines of the sides of the triangular facet T1 and the sides of the triangular facet T2 with the planes, where the plane intersection line refers to the intersection line between the plane containing the triangular facet T1 or the triangular facet T2 and the corresponding evaluation plane. The overlapping first intersection interval and second intersection interval are respectively identified as the triangular facets T1 and T2 that are intersecting, so as to determine the first and second triangular facets that intersect with the sub-blocks.

7. The three-dimensional model drilling method according to claim 6, characterized in that, The determination of the intersecting sub-block pairs formed between the respective sub-blocks of the model to be drilled and the hole model includes: Based on the coordinate and size information of the sub-blocks, pairs of sub-blocks that intersect with each other are identified between the two models. These pairs of sub-blocks are used to form the intersecting sub-block pair.

8. The three-dimensional model drilling method according to claim 2, characterized in that, When the tree structure is an octree structure, the process of establishing the octree structure of the model to be punched and the octree structure of the hole model includes: Based on the endpoint information of all triangular facets in the mesh structure of the model to be drilled and the hole model, three-dimensional cubes of the model to be drilled and the hole model are respectively established, and the endpoint information is used to reflect the size of the model; Each of the three-dimensional cubes is divided into eight equal-sized sub-blocks, and multiple threads are started to determine the sub-blocks to which the triangular facets belong; If the number of layers of the sub-block to which the triangular facet belongs has not reached the preset deepest layer, the sub-block is divided into eight sub-blocks of equal size until the number of layers of the sub-blocks reaches the deepest layer, and an octree structure with the number of layers of the three-dimensional space as the deepest layer is established; wherein, the bottom sub-block at the deepest layer is used to store the triangular facets of the model.

9. The three-dimensional model drilling method according to claim 2, characterized in that, The step of determining the first sub-triangular facet located outside the hole model and the second sub-triangular facet located inside the model to be drilled, based on the point element information of the first and second sub-triangular facets, includes: Based on the point element information of the first and second sub-triangular facets, construct the region vector corresponding to each triangular facet. Based on the comparison of the positive and negative signs of the region vector of the undetermined facet and the contour vector of the reference model, it is determined whether the undetermined facet is inside or outside the reference model; wherein, when the undetermined facet is the first sub-triangular facet, the reference model is a hole model, and when the undetermined facet is the second sub-triangular facet, the reference model is a hole model.

10. The three-dimensional model drilling method according to claim 2, characterized in that, The step of dividing the first triangular facet into multiple first sub-triangular facets and the second triangular facet into multiple second sub-triangular facets based on the intersection line segment between the first triangular facet and the second triangular facet includes: Delete the first and second triangular facets that have been segmented.

11. The method for drilling holes in a three-dimensional model according to claim 1, characterized in that, The generation process of the pore model includes: Obtain the preset inner and outer aperture sizes, and the preset extension length inside and / or outside the model to be drilled; The hole model is generated based on the inner and outer aperture sizes and the preset extension length.

12. The three-dimensional model drilling method according to claim 1, characterized in that, The three-dimensional model drilling method further includes: storing the facets of the model to be drilled and the hole model within their respective sub-blocks, the process including: Place the dough pieces into the sub-blocks where the dough pieces are located, or into the empty sub-blocks adjacent to the location of the dough pieces; If there is more than one sub-block at the location of the piece, then the piece is placed into any of the empty sub-blocks.

13. A three-dimensional model drilling system, characterized in that, include: Comparison unit and processing unit; The processing unit is used to divide the model to be punched and the hole body model into blocks to obtain sub-blocks corresponding to the two models respectively. The comparison unit is used to compare the sub-blocks of the model to be punched with the sub-blocks of the hole model to determine the facets of the model to be punched that are outside the hole model and the facets of the hole model that are inside the model to be punched. The processing unit is further configured to combine the facets of the model to be drilled outside the hole model and the facets of the hole model inside the hole model to form a target perforated model with holes added.

14. An electronic device, characterized in that, include: Central processing unit, memory, and input / output interfaces; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 12.