Feature removal based construction entity geometry reconstruction method and system
By removing features and decomposing the model and reconstructing the CSG tree in combination with intersection and difference operations, the problem of low efficiency in geometric reconstruction of constructed entities in existing technologies is solved, and fast and accurate reconstruction of complex models is achieved, as well as the watertightness and topological correctness of the modeling results.
Patent Information
- Application Number
- CN202411153617.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-08-21
AI Technical Summary
In the existing technology, the method of constructing solid geometry reconstruction has the problem of low efficiency. Especially in the CSG reconstruction process, genetic algorithms and deep learning methods cannot quickly reconstruct complex models and cannot accurately reconstruct small features, resulting in poor semantics of CSG trees and difficulty in editing. In addition, existing methods cannot guarantee watertight, manifold, and zero-volume surface modeling results.
By removing features from the input model, such as segmentation of cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes, and stretched bodies, the model is decomposed into sub-modules, and the CSG tree is reconstructed using intersection and difference operations. In addition, a coplanar discretization method is introduced in the Boolean tree judgment to ensure the watertightness and topological correctness of the modeling results.
It achieves fast reconstruction of complex models, retains the semantic information of CSG tree, is easy to edit, and can generate watertight, manifold, and zero-volume surface modeling results, improving reconstruction efficiency and accuracy.
Smart Images

Figure CN119478283B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer graphics, and in particular to a feature removal-based CSG reconstruction method and system. BACKGROUND
[0002] CSG reconstruction is a very important topic in the industry. Based on the extracted body primitives in the model, the purpose of CSG reconstruction is to restore the original modeling process using Boolean operations.
[0003] In related technologies, during the CSG reconstruction process, genetic algorithms and program synthesis methods are limited by long optimization times and produce overly complex CSG trees. Methods based on deep learning cannot reconstruct complex models due to the use of voxel inputs.
[0004] Therefore, the CSG reconstruction method in related technologies has the technical problem of low CSG reconstruction efficiency. SUMMARY
[0005] The present application provides a feature removal-based CSG reconstruction method and system to solve the defect of low CSG reconstruction efficiency in the prior art, enabling fast reconstruction and ensuring watertight, manifold, and zero-volume surface modeling results.
[0006] The present application provides a feature removal-based CSG reconstruction method, including the following steps. Feature removal and model segmentation are performed on the input solid geometry model to obtain multiple sub-modules, wherein the removed features include cylindrical chamfer, conical chamfer, ring chamfer, reinforcing rib, hole, and stretched body; based on the face set of each sub-module in the multiple sub-modules, multiple body primitives of each sub-module are determined; based on the intersection of the multiple body primitives, a bounding box of the sub-module is determined; based on the multiple body primitives, the bounding box is proportionally divided into a target number of voxels, wherein the voxels include internal voxels and external voxels; using intersection and difference operations, the CSG sub-tree of each sub-module is reconstructed, wherein the candidate root node of the CSG sub-tree is a body primitive containing the external voxels; the removed features are added to the CSG sub-tree of each sub-module in reverse order to obtain a CSG reconstruction result; based on the CSG reconstruction result, primitive discretization and Boolean tree determination are performed to obtain a watertight, manifold, and zero-volume surface modeling result.
[0007] The application provides a feature-removing-based construction entity geometry reconstruction method, which comprises the following steps: sequentially removing the cylindrical chamfer, the conical chamfer, the circular ring chamfer and the reinforcing rib of an input entity geometry model to obtain a plurality of sub-modules; iteratively removing the hole and the stretch body of the entity geometry model; taking the plane of the entity geometry model as a point, connecting the adjacent surfaces in the entity geometry model by edges to construct an adjacency graph of the entity geometry model; and performing model segmentation on the entity geometry model based on the cut points in the adjacency graph to obtain the plurality of sub-modules.
[0008] The application provides a feature-removing-based construction entity geometry reconstruction method, which comprises the following steps: determining a plurality of volume primitives of each sub-module in the plurality of sub-modules based on the face set of the each sub-module, wherein the face set comprises a plane corresponding to each axis direction in the plurality of axis directions of a local coordinate system of the each sub-module; when the face set of the local coordinate system is 1, taking the minimum bounding box under the plane for surrounding the sub-module as a cuboid assumption; when the face set of the local coordinate system is greater than 1, taking a plurality of bounding boxes under all planes for surrounding the sub-module as cuboid assumptions; and determining the volume primitive set of the sub-module based on the center point of the cuboid assumption and the normal of the cuboid assumption.
[0009] The application provides a feature-removing-based construction entity geometry reconstruction method, which comprises the following steps: dividing the bounding box into a target number of voxels in a proportional manner based on the plurality of volume primitives; dividing the voxels into a plurality of blocks based on the plurality of volume primitives; when the proportion of the voxels located inside the block is greater than a voxel proportion threshold, taking all voxels of the block as internal voxels; and when the proportion of the voxels located outside the block is greater than the voxel proportion threshold, taking all voxels of the block as external voxels.
[0010] The application provides a feature-removing-based construction entity geometry reconstruction method, which comprises the following steps: reconstructing the construction entity geometry sub-tree of each sub-module by using intersection and difference operations, wherein the construction entity geometry sub-tree of each sub-module is constructed based on the volume primitive and the quadratic primitive of the each sub-module, and the sub-tree comprises intersection and difference operations and only uses an AND operation.
[0011] According to the feature removal based construction entity geometry reconstruction method provided by the application, the removed features are added into the construction entity geometry sub-tree of each sub-module in reverse order to obtain a construction entity geometry reconstruction result, which comprises: adding the removed features into the construction entity geometry sub-tree of each sub-module in the order of the stretch body, the hole, the reinforcing rib, the circular ring chamfer, the circular cone chamfer and the circular cylinder chamfer; and combining all the construction entity geometry sub-trees as the construction entity geometry reconstruction result.
[0012] The application further provides a feature removal based construction entity geometry reconstruction system, which comprises the following modules: a segmentation module, which is used for feature removal and model segmentation on an input entity geometry model to obtain a plurality of sub-modules, wherein the removed features comprise a circular cylinder chamfer, a circular cone chamfer, a circular ring chamfer, a reinforcing rib, a hole and a stretch body; a first determination module, which is used for determining a plurality of volume primitives of each sub-module based on the face set of the sub-module; a second determination module, which is used for determining a bounding box of the sub-module based on the intersection of the volume primitives; a division module, which is used for dividing the bounding box into a target number of voxels in equal proportions based on the volume primitives, wherein the voxels comprise internal voxels and external voxels; reconstructing a construction entity geometry sub-tree of each sub-module using intersection and difference operations, wherein the candidate root node of the construction entity geometry sub-tree is a volume primitive containing the external voxels; adding the removed features into the construction entity geometry sub-tree of each sub-module in reverse order to obtain a construction entity geometry reconstruction result; and performing primitive discretization and Boolean tree determination based on the construction entity geometry reconstruction result to obtain a modeling result of watertightness, manifold and zero-volume-face-free.
[0013] The application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the feature removal based construction entity geometry reconstruction method according to any one of the above when executing the program.
[0014] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program implements the feature removal based construction entity geometry reconstruction method according to any one of the above when executed by a processor.
[0015] The application further provides a computer program product, which comprises a computer program, and the computer program implements the feature removal based construction entity geometry reconstruction method according to any one of the above when executed by a processor.
[0016] The application provides a feature-removing-based construction entity geometry reconstruction method and system, which removes features in an entity geometry model, such as a cylindrical chamfer, a conical chamfer, a circular ring chamfer, a reinforcing rib, a hole and a stretched body, and divides the entity geometry model into smaller sub-modules; the pre-removed features do not participate in the reconstruction process, but are added as additional nodes to the construction entity geometry tree; this retains the semantic information of the construction entity geometry tree while retaining the geometric details, makes the editing of the construction entity geometry tree easy, reduces the number of primitives generated in the reconstruction process, and thus speeds up the reconstruction speed, and based on the reconstruction result of the construction entity geometry, primitive discretization and Boolean tree determination can be performed to obtain a modeling result of watertight, manifold and zero-volume surface free; and the technical problem of low efficiency of the construction entity geometry reconstruction method in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description one by one. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative effort.
[0018] Figure 1 is one of the flowcharts of the feature-removing-based construction entity geometry reconstruction method provided by the application.
[0019] Figure 2 is the second flowchart of the feature-removing-based construction entity geometry reconstruction method provided by the application.
[0020] Figure 3 is the structure diagram of the primitive discretization provided by the application.
[0021] Figure 4 is the structure diagram of the triangle of the original face of the primitive provided by the application.
[0022] Figure 5 is the algorithm diagram of the Boolean tree determination provided by the application.
[0023] Figure 6 is the modeling accuracy comparison diagram of the reverse modeling provided by the application.
[0024] Figure 7 is the modeling accuracy comparison diagram of the forward modeling provided by the application.
[0025] Figure 8 is the structure diagram of the hole and the stretched body provided by the application.
[0026] Figure 9is a schematic diagram of the cuboid primitive generation and screening provided by the present application.
[0027] Figure 10 is a schematic diagram of adding a cylindrical chamfer provided by the present application.
[0028] Figure 11 is a structural schematic diagram of model decomposition and reconstruction provided by the present application.
[0029] Figure 12 is a structural schematic diagram of the feature-based removal of the constructive solid geometry reconstruction system provided by the present application.
[0030] Figure 13 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0031] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0032] Constructive solid geometry (CSG) reconstruction is a very important topic in the industry. Based on the extracted body primitives in the model, the purpose of CSG reconstruction is to restore the original modeling process using Boolean operations. Due to the simple expression and editability of CSG trees, it is widely used in reverse engineering, CAD / CAE integration, simulation, industrial manufacturing, industrial detection, virtual reality fields. Although the existing research work has made great progress, there are still challenges in reconstruction accuracy and speed.
[0033] First, in the process of CSG reconstruction, the genetic algorithm-based and program synthesis-based methods are limited by long optimization time and produce overly complex CSG trees. The deep learning-based method cannot reconstruct complex models due to the use of voxel input. More importantly, the above methods cannot accurately reconstruct the fine features in the original model, and the obtained CSG tree does not have good semantics and cannot depict the modeling process, which makes editing difficult.
[0034] Secondly, in the forward modeling process, it is necessary to model the watertight, manifold, and zero-volume-free surface mesh according to the CSG tree and the volume primitive. The existing method first discretizes the primitive into a mesh, then performs mesh intersection, triangle inside-outside judgment, and finally determines whether the triangle is retained according to the Boolean operator. However, such a method has obvious defects. On the premise of accurate calculation, due to the existence of discretization error, the coplanar characteristics in the original primitive cannot be preserved. For example, even if a non-axis-aligned cuboid is discretized into two triangles, due to the rounding error of floating-point operation, the two triangles cannot be guaranteed to be coplanar. Discretization error will further cause errors in inside-outside judgment and triangle retention judgment, resulting in the final result containing zero-volume surfaces. In addition, in the existing Boolean operation, triangles are only divided into "inside" and "outside" two categories, which will cause errors in triangle retention judgment in the case of extremely degenerate coplanar.
[0035] To solve the above problems, the present application provides a fast and reliable entity geometry modeling process. Unlike previous methods, after analyzing the user's modeling process, the present application first removes the features in the model, such as cylindrical chamfer, conical chamfer, ring chamfer, reinforcing rib, hole and stretched body, and uses the detected plane to divide the model into smaller sub-modules. The pre-removed features do not participate in the reconstruction process, but are added as additional nodes to the CSG tree. This preserves the geometric details while preserving the semantic information of the CSG tree, making it easy to edit the CSG tree. Decomposition of the model also reduces the number of primitives generated during the reconstruction process, thereby speeding up the reconstruction. Then, the present application uses a bottom-up strategy to construct the CSG tree, and introduces model size related parameters in the energy function to better capture details. In order to preserve the coplanar characteristics of the volume primitive, this paper proposes a coplanar discretization method, that is, using large planes to construct primitives and extracting original triangles. Each triangle is assigned a "positive", "negative", "inside" or "outside" label, and a coplanar, non-iterative Boolean tree judgment is used to determine the retention of the triangle. Extensive experimental data show that the present application has better results than existing traditional methods and deep learning methods in reconstruction and forward modeling, not only can quickly reconstruct, but also can guarantee watertight, manifold, and zero-volume-free modeling results.
[0036] The purpose of the present application is to overcome the defects of the existing construction entity geometry reconstruction, and provide an efficient reconstruction method for quickly reconstructing the mesh into a CSG tree.
[0037] Reference Figure 1 , Figure 1 is one of the flowcharts of the feature-removed construction entity geometry reconstruction method provided by the present application, which comprises S1, model decomposition, feature removal and model segmentation. S2, reconstruct the CSG tree and add the original features. S3, forward modeling.
[0038] To achieve the above object, the application provides a feature-removing-based geometric reconstruction method of a construction entity.
[0039] Step S1, removing features in the model, including cylindrical chamfer, conical chamfer, circular ring chamfer, reinforcing rib, hole and stretch body, and segmenting the model with detected planes.
[0040] Step S2, reconstructing a CSG tree for each sub-module, and adding original features to the CSG tree block.
[0041] Step S3, using coplanar primitive discretization and coplanar-considering Boolean operation judgment to perform forward modeling, to obtain watertight, manifold and zero-volume-surface-free forward modeling results.
[0042] The application accelerates the reconstruction speed by decomposing the model, guarantees the semantic nature of the CSG tree, facilitates model editing, guarantees that the modeling results can capture detailed features, and is very suitable for CAD model reuse, reverse engineering and other industrial fields.
[0043] Reference Figure 2 , Figure 2 is a flowchart of the feature-removing-based geometric reconstruction method of a construction entity provided by the application, as shown in Figure 2 , the method comprises the following steps.
[0044] Step 201, removing features and model segmentation of the input entity geometric model to obtain a plurality of sub-modules, wherein the removed features include cylindrical chamfer, conical chamfer, circular ring chamfer, reinforcing rib, hole and stretch body.
[0045] In the embodiment of the application, the features in the input entity geometric model are first detected and removed, specifically, the cylindrical chamfer, conical chamfer, circular ring chamfer and reinforcing rib in the model are sequentially removed, and then the hole and stretch body are iteratively removed.
[0046] It should be noted that due to the special case that the hole contains the stretch body and the stretch body contains the hole, the hole and the stretch body need to be iteratively removed, otherwise self-intersection will occur in the model.
[0047] In order to distinguish between ordinary holes and holes containing stretch bodies, and ordinary stretch bodies and stretch bodies containing holes, the application proposes the following conclusions:
[0048] In the connected, watertight, non-self-intersecting and manifold mesh, if there is a stretch body (hole) in the hole (stretch body), the stretch body (hole) must pass through one of the bottom surfaces of the hole (stretch body).
[0049] Therefore, the above two complex situations can be simply judged by checking whether the bottom surface of the edge and the hole (stretching body) intersects in the model and the intersection point falls within the polygon of the bottom surface. In order to further simplify the model, the faces are taken as points, the adjacent faces are connected by edges, the adjacency graph of the mesh is defined, the cut point in the graph is found by using a preset algorithm (for example, Tarjan algorithm, an algorithm for finding strongly connected components in a directed graph), and the model is divided by the cut point of the type plane. Compared with dividing the model by using any face, the application is more in line with the modeling process.
[0050] In step 202, a plurality of volume primitives of each sub-module are determined based on the face set of each sub-module in the plurality of sub-modules.
[0051] In the embodiment of the application, six axial directions of the local coordinate system of each sub-module are determined, wherein each sub-module is assigned a local coordinate system, the coordinate system usually takes its own center or a certain feature point as the origin, and defines three main axes (such as X, Y and Z axes, including six axial directions).
[0052] In the embodiment of the application, a plane is selected or not selected to obtain the face set. If there is only one plane in the local coordinate system, the plane is selected as the basis of the face of the axis, and the smallest bounding box that can enclose the module below the plane is selected as the cuboid assumption. Otherwise, only the cuboid assumption with the face set greater than 1 is considered, and the bounding box of all faces in the local coordinate system is taken as the cuboid assumption. Based on the center point of the cuboid assumption and the normal of the cuboid assumption, the volume primitive (cuboid primitive) set of the sub-module is determined.
[0053] In step 203, the bounding box of the sub-module is determined based on the intersection of the plurality of volume primitives.
[0054] In the embodiment of the application, the quadratic volume primitive is directly extracted from the cylinder, cone, torus and spherical surface. Since the space occupied by the quadratic surface is only a part of the volume primitive, in order to ensure correct reconstruction, for each quadratic volume primitive , a bounding box is provided as an additional primitive .
[0055] In the embodiment of the application, the coordinate system of the curved surface and the adjacent face is obtained, and the intersection of the bounding boxes in the multiple coordinate systems, that is, the bounding polyhedron, is obtained to replace the minimum rotating bounding box. This not only provides a tighter bounding, but also ensures the coplanar characteristics in modeling by using the coordinate system consistent with the cuboid primitive. The quadratic volume primitive and , constitute the quadratic volume primitive set.
[0056] In step 204, the bounding box is equally divided into a target number of voxels based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels.
[0057] In the embodiment of the present invention, in order to measure the reconstruction quality, the present invention divides the bounding box of a module into Since the input model has input errors, directly judging the inside and outside of a single voxel will often result in errors. Therefore, the present invention uses volume primitives to divide the voxels into multiple blocks, and uses the majority of voxels in the block to judge the inside and outside of the block. For example, when more than 80% of the voxels in the block are internal voxels, all voxels in the block are considered to be internal. The set of all internal voxels in the module is represented as , primitive The internal voxel set of .
[0058] Step 205 : reconstructing the constructive solid geometry subtree of each submodule using intersection and difference operations, wherein the candidate root node of the constructive solid geometry subtree is a volume primitive containing external voxels.
[0059] In an embodiment of the present invention, based on the volume primitives and quadratic primitives of each submodule, a subtree including intersection and difference operations and a constructive solid geometry subtree using only union operations are constructed.
[0060] Step 206 , adding the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result.
[0061] In this embodiment of the present invention, after obtaining the CSG tree for each module, the present invention preferably adds the original features to the CSG tree in the reverse order: extrusions, holes, ribs, annular chamfers, conical chamfers, and cylindrical chamfers. Specifically, for cylindrical chamfers, the present invention uses a bounding polyhedron rather than a minimum rotation bounding box. This bounding polyhedron ensures that no residual parts remain in the reconstruction result.
[0062] Step 207 : performing primitive discretization and Boolean tree determination based on the geometric reconstruction result of the constructive entity to obtain a watertight, manifold modeling result without zero volume surfaces.
[0063] refer to Figure 3 , Figure 3 It is a structural schematic diagram of the primitive discretization provided by the present invention.
[0064] In an embodiment of the present invention, the process of performing primitive discretization based on the geometric reconstruction result of the constructive solid is as follows:
[0065] like Figure 3 As shown, in the embodiment of the present invention, in order to retain the coplanar characteristics of the primitives, the present invention directly discretizes the sphere and the ring, and discretizes the cuboid, cylinder and cone into plane parameters ( Figure 3Specifically, the cuboid primitive is composed of 6 large planes, the cylinder is composed of two large planes and a discrete side plane, and the cone is more special, with its base being a large plane. Since the sides of the cone must intersect at the apex and the intersection line of the side and the adjacent side must pass through the apex, the height of the side of the cone used as the input is slightly higher than the original height. After discretizing all the planes, the present application clusters all the large planes, thereby ensuring that the coplanar triangles share the same plane representation. In order to accelerate the intersection of triangles, the present application localizes each large plane as much as possible, and therefore, the smallest triangle that can enclose the original primitive plane is taken to represent the plane for intersection.
[0066] Reference Figure 4 , Figure 4 is a structural diagram of the triangle of the original plane of the primitive provided by the present application.
[0067] In the embodiment of the present application, the triangle belonging to the original plane of the primitive is extracted, thereby obtaining the discretized primitive. After the intersection of the triangles, the point of the original plane is the intersection point of three planes, and the edge is the intersection line of two planes. For the faces on the cuboid, cylinder and the base of the cone, as shown in Figure 4 (a), starting from each external edge of the large plane, a breadth-first search is used to constantly explore the triangles adjacent to the current edge until the edge of the original primitive plane is encountered, and all the triangles that have not been visited belong to the plane of the primitive. For the side of the cone, as shown in Figure 4 (b), starting from any adjacent triangle at the apex of the cone, a breadth-first search is used to constantly explore the triangles adjacent to the current edge until the intersection line of the side and the base is encountered, and all the visited triangles belong to the side of the cone. Finally, all the sets of volume primitives are obtained.
[0068] In the embodiment of the present application, the process of the Boolean tree determination is as follows:
[0069] Reference Figure 5 , Figure 5 is an algorithm diagram of the Boolean tree determination provided by the present application.
[0070] As shown in Figure 5 , the above algorithm is a pseudo code for classifying triangles in a decision tree (or similar data structure) and returning the label of a given triangle at a specific node. The purpose of the algorithm is to determine the category of a triangle by traversing the nodes of the decision tree and outputting the category label at the given node.
[0071] If the current node n is a certain specific node m, the label of the triangle t in Mprim, label(mi,t), is directly assigned to the label variable, and the algorithm ends.
[0072] If the current node n is not m, the algorithm continues to recursively compute the labels of the left and right child nodes. The function receives a node and a triangle as input and returns the label of the triangle on that node.
[0073] For the left child node, the label is obtained by calling label(n.left-child, t) and stored in the variable lleft. For the right child node, the label is obtained by calling label(n.right_child, t) and stored in the variable lright.
[0074] The evaluate function is used to evaluate the current node n, as well as the labels of the left and right child nodes (lleft and lright) to generate the final label of the triangle t on the current node n. The output of the evaluate function is assigned to the label variable. Finally, the algorithm returns the computed label label.
[0075] To determine whether each triangle needs to be preserved in the final result, the invention needs to get the classification of the triangle at the root node of the CSG tree. For the reconstructed CSG tree, define the label of the node for the upper triangle . To handle the degenerate coplanar case, the invention extends the label of the triangle to "up", "down", "in", "out". When the node is a leaf node, it represents the relationship between the triangle and the corresponding primitive . Their in-out relationship can be determined by the winding number algorithm, and "up" and "down" can be determined by judging whether the normal of the triangle and the normal of the original face of the primitive are consistent.
[0076] The invention designs a recursive algorithm to determine the classification of the triangle at the root node. Among them, the evaluation function gets the result according to the labels of the left and right child nodes and the Boolean operator symbol, so it can be represented using a truth table. When the triangle classification of the root node is "up" or "down", the triangle needs to be preserved. In particular, when the classification of the triangle is "down", the normal of the triangle needs to be reversed to get a watertight, topologically correct modeling result. Thus, the invention gets a modeling result that is watertight, manifold, topologically correct, and has no zero-volume faces.
[0077] Reference Figure 6 , Figure 6 is the modeling accuracy comparison chart of the reverse modeling provided by the invention.
[0078] In reverse modeling, the embodiments of the present application are compared with representative state-of-the-art methods. On the dataset provided by InverseCSG, quantitative comparisons of reconstruction accuracy and efficiency are performed. The reconstruction accuracy is measured by the standard Hausdorff distance and the relative volume difference. Compared with traditional algorithms, the present application has an order of magnitude improvement in reconstruction accuracy and reconstruction efficiency. Compared with deep learning algorithms, the present application has a very large improvement in reconstruction accuracy. Figure 6 The results show that the present application can effectively capture the details in the model.
[0079] Reference Figure 7 , Figure 7 is a comparison chart of modeling accuracy provided by the present application for forward modeling.
[0080] In forward modeling, the present application is compared with the existing software OpenSCAD, and the forward modeling is measured from the modeling efficiency and the modeling accuracy. Figure 7 The results presented in the present application can reconstruct watertight, manifold, topologically correct, and zero-volume surface modeling results, while other methods will produce zero-volume surfaces. It should be noted that even if FreeCAD uses a tolerance, it will still crash in some cases. The quantitative comparison results show that the present application is better than the open source software. Although Marchingcubes is faster, it cannot preserve the sharp features in the model.
[0081] Through the embodiments of the present application, a feature removal based method for reconstructing solid geometry is proposed. By decomposing the model, simplifying the sub-modules, accelerating the reconstruction speed, guaranteeing the semantic nature of the CSG tree, facilitating user editing of the model, and ensuring that the modeling results can effectively capture the model details. The present application also proposes a forward modeling method considering coplanarity, which can obtain watertight, manifold, topologically correct, and zero-volume surface modeling results.
[0082] By the above steps of the embodiment of the present application, the input entity geometric model is subjected to feature removal and model segmentation to obtain a plurality of sub-modules, wherein the removed features include: cylindrical chamfer, conical chamfer, circular ring chamfer, reinforcing rib, hole and stretched body; based on the face set of each sub-module in the plurality of sub-modules, a plurality of volume primitives of each sub-module are determined; based on the intersection of the plurality of volume primitives, a bounding box of the sub-module is determined; the bounding box is equally divided into a target number of voxels based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels; using intersection and difference operations, a constructed entity geometric sub-tree of each sub-module is reconstructed, wherein the candidate root node of the constructed entity geometric sub-tree is a volume primitive containing the external voxels; the removed features are added to the constructed entity geometric sub-tree of each sub-module in reverse order to obtain a constructed entity geometric reconstruction result; based on the constructed entity geometric reconstruction result, primitive discretization and Boolean tree determination are performed to obtain a modeling result of watertight, manifold and zero-volume-face-free. Thus, the technical problem of low efficiency of the related art construction entity geometric reconstruction method is solved.
[0083] According to the construction entity geometric reconstruction method based on feature removal provided by the present application, the input entity geometric model is subjected to feature removal and model segmentation to obtain a plurality of sub-modules, comprising:
[0084] Sequentially removing the cylindrical chamfer, conical chamfer, circular ring chamfer and reinforcing rib of the entity geometric model;
[0085] Iteratively removing the hole and stretched body of the entity geometric model;
[0086] Taking the plane of the entity geometric model as a point and connecting the adjacent faces in the entity geometric model with edges to construct an adjacency graph of the entity geometric model;
[0087] Based on the cut points in the adjacency graph, the entity geometric model is subjected to model segmentation to obtain a plurality of sub-modules.
[0088] Reference Figure 8 , Figure 8 is a structural schematic diagram of the hole and the stretched body provided by the present application.
[0089] In the embodiment of the present application, the cylindrical chamfer, conical chamfer, circular ring chamfer and reinforcing rib in the model are sequentially removed first, and then the hole and stretched body are iteratively removed.
[0090] It should be noted that due to the special cases that the hole contains the stretched body and the stretched body contains the hole, the hole and the stretched body need to be iteratively removed, otherwise self-intersection will occur in the model. As shown in Figure 8 In order to distinguish the ordinary hole and the hole containing the stretched body ( Figure 8 (a) and the ordinary stretched body and the stretched body containing the hole ( Figure 8 (b), the present application proposes the following conclusions:
[0091] In a connected, watertight, self-intersection-free, manifold mesh, if there is a stretch (hole) in the hole (stretch), the stretch (hole) must pass through one of the bottom surfaces of the hole (stretch).
[0092] Therefore, by checking whether the edges and the bottom surface of the hole (stretch) intersect in the model and the intersection point falls within the polygon of the bottom surface, the above two complex situations can be simply determined. In order to further simplify the model, the faces are taken as points, the adjacent faces are connected by edges, the adjacency graph of the mesh is defined, the cut points in the graph are found using the Tarjan algorithm, and the model is divided by the cut points of the type plane. Compared with dividing the model using any face, the application is more in line with the modeling process.
[0093] According to the application, a feature-based entity geometry reconstruction method is provided, which is based on the face set of each sub-module in a plurality of sub-modules, and determines a plurality of volume primitives of each sub-module, including:
[0094] Determine the plurality of axial directions of the local coordinate system of each sub-module and the face set, wherein the face set includes a plane corresponding to each axial direction in the plurality of axial directions;
[0095] When the face set of the local coordinate system is 1, the smallest bounding box for surrounding the sub-module under the plane is taken as the cuboid assumption;
[0096] When the face set of the local coordinate system is greater than 1, a plurality of bounding boxes for surrounding the sub-module under the plane are taken as the cuboid assumption;
[0097] Based on the center point of the cuboid assumption and the normal direction of the cuboid assumption, the volume primitive set of the sub-module is determined.
[0098] In the embodiment of the application, in the 6 axial directions of the local coordinate system of each sub-module, the application selects one plane or does not select, to obtain the face set.
[0099] If there is only one plane in the local coordinate system, the plane is taken as the basis of the face of the axis, and the smallest bounding box that can surround the module under the plane is selected as the cuboid assumption.
[0100] Otherwise, only the cuboid assumption with a face set greater than 1 is considered, and the bounding box of all faces under the local coordinate system is taken as the cuboid assumption.
[0101] Reference Figure 9 , Figure 9 The application provides a schematic diagram of the cuboid primitive generation and screening.
[0102] In particular, for the cuboid assumption with only two oppositely normal faces, the invention arranges the minimum and maximum values of the cuboid assumption on the x, y, z axes to obtain multiple cuboid assumptions, as shown in the two-dimensional example of Figure 9 (a). For all cuboid assumptions, the invention uses the following three strategies to screen to obtain legal cuboid primitives.
[0103] For two adjacent faces in the cuboid assumption, the center points are , , and the normals of the faces are , , respectively. , , the adjacent faces do not need to be reversed, and vice versa, as shown in Figure 9 (b). If some adjacent faces need to be reversed and some do not need to be reversed in a cuboid assumption, it is rejected. In particular, for the cuboid assumption with two oppositely normal faces, as shown in Figure 9 (c), , the normal needs to be reversed.
[0104] For a cuboid assumption, each face in the face set should be attached to the corresponding face on the cuboid. The invention checks the distance between the faces on the six axes and the corresponding faces of the cuboid assumption. Figure 9 (d), if it is greater than a certain threshold, it is rejected.
[0105] The minimum and maximum points of all the bounding boxes obtained are clustered in the global coordinates to ensure the coplanar property as much as possible.
[0106] The invention directly extracts quadratic body primitives from cylinders, cones, rings, and spherical surfaces. Since the space occupied by the quadratic surface is only a part of the body primitive, in order to ensure correct reconstruction, for each quadratic body primitive , a bounding box needs to be provided as an additional primitive . The invention obtains the coordinate system of the surface and the adjacent surface, and takes the intersection of the bounding boxes in multiple coordinate systems, i.e. surrounds the polyhedron, to replace the minimum rotating bounding box. This not only provides a tighter bounding, but also ensures the coplanar property in modeling with the same coordinate system as the cuboid primitive. The quadratic body primitive and constitute a set of quadratic body primitives.
[0107] According to the feature removal-based entity geometry reconstruction method provided by the invention, a bounding box is divided into a target number of voxels based on multiple body primitives, including:
[0108] The bounding box is divided into a target number of voxels in proportion;
[0109] The voxels are divided into a plurality of blocks based on a plurality of volume primitives;
[0110] When the proportion of voxels located inside the block is greater than the voxel proportion threshold, all voxels of the block are internal voxels;
[0111] When the proportion of voxels located outside the block is greater than the voxel proportion threshold, all voxels of the block are external voxels.
[0112] In the embodiments of the present application, in order to measure the reconstruction quality, the present application divides the bounding box of a module into voxels in proportion. Due to input errors of the input model, direct inside-outside judgment on a single voxel often has errors, so the present application divides the voxels into a plurality of blocks using volume primitives, and uses the majority of voxels in the block (i.e. the voxel proportion threshold) to judge the inside and outside of the block, for example, when more than 80% of the voxels in the block are internal voxels, it is considered that all voxels in the block are inside. The set of all internal voxels in the module is represented as , the internal voxel set of the primitive is .
[0113] According to the feature removal-based construction entity geometry reconstruction method provided by the present application, the intersection and difference operations are used to reconstruct the construction entity geometry sub-tree of each sub-module, which includes:
[0114] Based on the volume primitives and the quadratic primitives of each sub-module, the sub-tree including intersection and difference operations is constructed, and the construction entity geometry sub-tree using only the AND operation is constructed.
[0115] In the embodiments of the present application, the intersection and difference operations are used to reconstruct the CSG sub-tree, and the present application selects the primitive containing the external voxels as the candidate root node of the sub-tree. Then, the neighbor primitive set having intersecting voxels with the root node primitive is found, denoted as .
[0116] The present application uses a binary tag set , to indicate whether to perform intersection or difference operation on the primitive . Therefore, the obtained sub-tree is , and the space occupied by the sub-tree is . The energy function of the reconstructed sub-tree is defined as:
[0117]
[0118] wherein, representing the number of primitives in the subtree; the total energy, representing the number of primitives in the subtree; representing the reward for correctly reconstructed voxels; representing the penalty for incorrectly reconstructed voxels.
[0119] where, limiting the number of primitives in the subtree:
[0120]
[0121] where, representing the number of primitives in the subtree, representing the weight associated with the volume primitive , representing the penalty for incorrectly reconstructed voxels. for each element , the value of is computed and added to the sum.
[0122] where, represents some measure or score of the shared properties or characteristics set of the object and the object , represents some measure or score of the properties or characteristics set that is unique to the object relative to the object . Where . Thus measures the order of magnitude of the number of voxels that need to be corrected from incorrect to correct classification for each additional primitive added to the subtree. Since and the size of the model are related, the method herein is able to better capture details. In general, let . representing the reward for correctly reconstructed voxels:
[0123]
[0124] where, representing the reward for correctly reconstructed voxels, represents the intersection between the subset of the object and the correct set , represents the number of elements in the complete properties set of the object that neither belong to the subset nor to the correct set .
[0125] However, only rewarding correct reconstruction would make the sub-tree tend to contain less voxels, so to prevent the interior voxels being wrongly discarded, the invention adds a penalty as follows:
[0126]
[0127] wherein, represents the object being wrongly discarded, represents the object 's complete attribute set or universe, represents a certain correct or desired set, represents the object 's subset or attribute set.
[0128] To get an effective sub-tree, when the sub-tree contains too many exterior voxels, i.e. , we discard the sub-tree. Generally, let .
[0129] The invention uses and operates a reconstructed CSG tree. The reconstructed sub-trees and the primitives completely inside the module constitute the alternative set of the reconstructed CSG tree , the invention adopts binary set to represent whether the primitive participates in the final operation. Therefore, the CSG tree can be recorded as , and the space occupied by the CSG tree is . The objective function of the reconstructed CSG tree is defined as:
[0130]
[0131] wherein, represents the total matching error or score under the root node or category , represents the weight of the category , represents the number of objects under the root node or category , represents a certain attribute or score of the object , represents the intersection size between the attribute set of the root node or category and the correct set , i.e. the number of elements common to both.
[0132] wherein, , generally let . And similarly, measures the order of magnitude of the interior voxels that need to be added for each primitive in the CSG tree.
[0133] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, the removed features are added to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result, including:
[0134] Add the removal features to the constructive solid geometry subtree of each submodule in the order of extrusion, hole, rib, annular chamfer, conical chamfer, and cylindrical chamfer.
[0135] refer to Figure 10 , Figure 10 It is a schematic diagram of adding cylindrical chamfers provided by the present invention.
[0136] After obtaining the CSG tree of each module, the embodiment of the present invention adds the original features to the CSG tree in the reverse order, i.e., stretching body, hole, reinforcement rib, annular chamfer, conical chamfer, cylindrical chamfer. In particular, for cylindrical chamfer, Figure 10 As shown, the present invention uses a bounding polyhedron instead of a minimum rotation bounding box. The bounding polyhedron ensures that there is no residual part in the reconstruction result. If the bounding box set in the multi-coordinate system is , then the CSG tree after adding chamfers is ,in is the cylindrical primitive corresponding to the chamfer. Finally, the present invention takes the sum of all trees as the CSG reconstruction result, which is recorded as .
[0137] refer to Figure 11 , Figure 11 This is a schematic diagram of the structure of the model decomposition and reconstruction provided by the present invention, which includes model decomposition, CSG reconstruction and forward modeling. Specifically, it includes the following steps:
[0138] Step S1: Decompose the input mesh into a model, including feature removal and model segmentation.
[0139] In step S1, the present invention first detects and removes the features of the model. Specifically, the present invention first sequentially removes cylindrical chamfers, conical chamfers, annular chamfers, and reinforcing ribs in the model, and then iteratively removes holes and stretched bodies. To further simplify the model, the adjacency graph of the mesh is defined using faces as points and connecting adjacent faces with edges. The Tarjan algorithm is used to find the cut points in the graph, and the model is segmented using the cut points of type plane. Compared with using arbitrary faces to segment the model, the present invention is more consistent with the modeling process.
[0140] Step S2: Perform bottom-up CSG reconstruction on the submodule and add original features.
[0141] In step S2, in order to accelerate the reconstruction process, the present application reconstructs both complex features and sub-models as separate sub-modules, and the collection of all modules is For each module , first generate the cuboid primitive and the quadric primitive, then construct the sub-tree containing only intersection and difference operations, and the CSG tree using only union operations. The embodiment of the present application uses a greedy tree search to minimize the energy function.
[0142] In step S2, in each local coordinate system, the present application selects one plane or none in the 6 axial directions, obtaining a face set. If there is only one plane in the local coordinate system, take the plane as the basis of the face of the axis, and select the smallest bounding box that can enclose the module below the plane as the cuboid hypothesis. Otherwise, only consider the cuboid hypothesis with more than one face, and take the bounding box of all faces in the local coordinate system as the cuboid hypothesis. In particular, for the cuboid hypothesis with only two opposite faces, the present application arranges and combines the minimum and maximum values on the x, y, and z axes to obtain multiple cuboid hypotheses. For all cuboid hypotheses, the present application uses the following three strategies to screen to obtain legal cuboid primitives.
[0143] For two adjacent faces in the cuboid hypothesis, the center points are , , and the normal vectors are , . Determine whether the adjacent faces need to be reversed in normal direction to form a legal cuboid primitive. Specifically, if and , the adjacent faces do not need to be reversed in normal direction, otherwise they need to be reversed in normal direction. If some adjacent faces need to be reversed and some do not in a cuboid hypothesis, it is rejected. In particular, for a cuboid hypothesis with two opposite faces, if , the normal direction needs to be reversed.
[0144] For the cuboid hypothesis, each face in the face set should be attached to the corresponding face on the cuboid. The present application checks the distance between the face and the corresponding face on the cuboid in the 6 axial directions. If the distance is greater than a certain threshold, it is rejected.
[0145] Cluster the minimum and maximum points of all bounding boxes in the global coordinate to ensure co-planar characteristics as much as possible. Then eliminate the cuboid hypotheses with the same minimum and maximum points.
[0146] The present application directly extracts the quadric body primitive from the cylinder, cone, torus, and sphere. Since the space occupied by the quadric surface is only a part of the body primitive, in order to ensure correct reconstruction, for each quadric body primitive , it needs to provide a bounding box as an additional primitive The present application obtains the coordinate system of the curved surface and the adjacent surface, and takes the intersection of the bounding boxes in multiple coordinate systems, i.e. the bounding polyhedron, to replace the minimum rotating bounding box. This can not only provide tighter bounding, but also make the coplanar characteristics in modeling guaranteed by the coordinate system consistent with the cuboid primitive. and , constitute the set of quadric primitives.
[0147] In step S2, in order to measure the reconstruction quality, the present application proportionally divides the bounding box of a module into voxels. Since there are input errors in the input model, directly judging the inside and outside of a single voxel often has errors, so the present application divides the voxels into multiple blocks using the body primitive, and judges the inside and outside of a block using the majority of voxels in the block, for example, when more than 80% of the voxels in a block are inside voxels, it is considered that all the voxels in the block are inside. The set of all the inside voxels in a module is denoted as , and the set of inside voxels of the primitive is .
[0148] In step S2, the present application uses intersection and difference operations to reconstruct the CSG subtree. The present application selects the primitive containing the outside voxels as the candidate root node of the subtree. Then, the set of neighbor primitives having intersecting voxels with the root node primitive is found, denoted as . The present application uses a binary tag set , to indicate whether to perform intersection or difference operation on the primitive . Thus, the obtained subtree is , and the space occupied by the subtree is . The energy function of the reconstructed subtree is defined as:
[0149]
[0150] wherein represents the total energy of the body primitive , and represents the number of primitives in the subtree; represents the reward for the correctly reconstructed voxels; represents the punishment for the incorrectly reconstructed voxels.
[0151] wherein limits the number of primitives in the subtree:
[0152]
[0153] wherein represents the number of primitives in the subtree, represents the weight associated with the body primitive , represents the value computed for each element , and accumulated in the sum.
[0154] where the definition is given by . Thus measures the order of magnitude of the number of voxels that need to be corrected from misclassification to correct classification for each additional primitive added in the subtree. Since is related to the size of the model, the method herein is able to better capture details. In general, let . represents the reward for correctly reconstructed voxels:
[0155]
[0156] where represents the reward for correctly reconstructed voxels, represents the intersection between the subset of the object and the correct set , represents the number of elements in the complete set of attributes of the object that neither belong to the subset nor to the correct set .
[0157] However, rewarding only correct reconstruction would make the subtree tend to contain fewer voxels, so to prevent internal voxels from being wrongly excluded, the invention adds the following penalty:
[0158]
[0159] where represents the penalty for wrongly excluded objects, represents the complete set or universe of attributes of the object , represents a certain correct or desired set, represents the subset or set of attributes of the object .
[0160] To obtain an effective subtree, we discard the subtree when it contains too many external voxels, i.e. , in general, let .
[0161] In step S2, the present invention uses and operates the reconstructed CSG tree. The reconstructed subtree and the primitives completely inside the module constitute the reconstructed CSG tree Alternative set of , the present invention adopts binary set To represent whether the primitive participates in the final operation. Therefore, the CSG tree can be recorded as , the space occupied by the CSG tree is The objective function of reconstructing the CSG tree is defined as:
[0162]
[0163] in, Indicates the root node or category The overall matching error or score under Representation category The weight of Indicates the root node or category The number of objects under Representation object An attribute or rating of Represents the root node or category The attribute collection With the correct set The size of the intersection between them is the number of elements they have in common.
[0164] in, , general order .and similar, A measure of the amount of internal voxel size that needs to be increased for each primitive added to the CSG tree.
[0165] In step S2, after obtaining the CSG tree of each module, the present invention first adds the original features to the CSG tree in the reverse order, i.e., stretching body, hole, reinforcement rib, annular chamfer, cone chamfer, and cylindrical chamfer. In particular, for cylindrical chamfer, the present invention uses a bounding polyhedron instead of a minimum rotation bounding box. The bounding polyhedron ensures that there are no residual parts (red parts) in the reconstruction result. If the bounding box set in the multi-coordinate system is , then the CSG tree after adding chamfers is ,in is the cylindrical primitive corresponding to the chamfer. Finally, the present invention takes the sum of all trees as the CSG reconstruction result, which is recorded as .
[0166] Step S3: forward modeling is performed using primitive discretization considering coplanarity and a Boolean tree decision algorithm.
[0167] In step S3, to preserve the coplanar property of the primitives, the present application directly discretizes the sphere, the torus, and discretizes the cuboid, the cylinder and the cone into planar parameters. Specifically, the cuboid primitive is composed of 6 large planes, the cylinder is composed of two large planes and the discretized side planes. The cone is more special, its base is a large plane. Since the side planes must intersect at the apex and the intersection line of the side plane and the adjacent side plane must pass through the apex, the present application uses the side plane of the cone with a slightly higher height than the original height as the input side plane. After discretizing all the planes, the present application clusters all the large planes, thereby ensuring that the coplanar triangles share the same plane representation. To accelerate the triangle intersection, the present application localizes each large plane as much as possible, and therefore, the smallest triangle that can enclose the original primitive face is taken to represent the plane for intersection.
[0168] In step S3, the present application extracts the triangles belonging to the original face of the primitive, thereby obtaining the discretized primitive. After the triangle intersection, the points of the original face are the intersection points of three planes, and the edges are the intersection lines of two planes. For the faces of the cuboid, the cylinder and the base of the cone, starting from each external edge of the large plane, the present application uses breadth-first search to constantly explore the triangles adjacent to the current edge until the edge of the original primitive face is encountered, and all the unvisited triangles belong to the face of the primitive. For the side face of the cone, starting from any adjacent triangle at the apex of the cone, the breadth-first search is used to constantly explore the triangles adjacent to the current edge until the intersection line of the side face and the base face is encountered, and all the visited triangles belong to the side face of the cone. Finally, the present application obtains all the sets of volume primitives .
[0169] In step S3, to determine whether each triangle needs to be preserved in the final result, the present application needs to obtain the classification of the triangle at the root node of the CSG tree. For the reconstructed CSG tree, the present application defines as the label of the triangle t at the node n. To handle the degenerate coplanar case, the present application extends the label of the triangle to "positive up", "negative up", "inside" and "outside". When the node n is a leaf node, it represents the relationship between the triangle and the corresponding primitive . Their inside and outside relationship can be determined by the winding number algorithm, and "positive up" and "negative up" can be determined by judging whether the normal of the triangle is consistent with the normal of the original face of the primitive. The present application designs a recursive algorithm to determine the triangle classification of the root node. The evaluation function obtains the result according to the labels of the left and right sub-trees and the Boolean operator symbol, and therefore it can be represented by a truth table. When the triangle classification of the root node is "positive up" or "negative up", the triangle needs to be preserved. Specifically, when the triangle classification is "negative up", the normal of the triangle needs to be reversed to obtain a watertight, topologically correct modeling result. Thus, the present application obtains a modeling result that is watertight, manifold, topologically correct and without zero-volume faces.
[0170] The application provides a feature-removing-based constructive solid geometry reconstruction method, which simplifies sub-modules through model decomposition, accelerates reconstruction speed, guarantees semantic of CSG tree, facilitates user to edit model and guarantees that modeling result can effectively capture model details.
[0171] The experimental result and the constructive solid geometry reconstruction method can be used for modeling of reverse engineering and have high practical application value.
[0172] The feature-removing-based constructive solid geometry reconstruction system provided by the application is described below, and the feature-removing-based constructive solid geometry reconstruction system described below can be correspondingly referred to the feature-removing-based constructive solid geometry reconstruction method described above.
[0173] Reference Figure 12 , Figure 12 FIG. 1 is a structural schematic diagram of the feature-removing-based constructive solid geometry reconstruction system provided by the application, which comprises a segmentation module 1201, a first determination module 1202, a second determination module 1203, a division module 1204, a reconstruction module 1205, an adding module 1206 and an output module 1207.
[0174] The segmentation module 1201 is used for feature removal and model segmentation of an input solid geometry model to obtain a plurality of sub-modules, wherein the removed features include cylindrical chamfer, conical chamfer, ring chamfer, reinforcing rib, hole and stretched body.
[0175] The first determination module 1202 is used for determining a plurality of volume primitives of each sub-module based on a face set of the each sub-module.
[0176] The second determination module 1203 is used for determining a bounding box of the sub-module based on an intersection of the plurality of volume primitives.
[0177] The division module 1204 is used for proportionally dividing the bounding box into a target number of voxels based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels.
[0178] The reconstruction module 1205 is used for reconstructing a constructive solid geometry sub-tree of the each sub-module using intersection and difference operations, wherein an alternative root node of the constructive solid geometry sub-tree is a volume primitive containing the external voxels.
[0179] The adding module 1206 is used for adding the removed features to the constructive solid geometry sub-tree of the each sub-module in reverse order to obtain a constructive solid geometry reconstruction result.
[0180] The output module 1207 is used to perform primitive discretization and Boolean tree determination based on the geometric reconstruction result of the constructed entity to obtain a watertight, manifold modeling result without zero volume surfaces.
[0181] Specifically, the above-mentioned constructive solid geometry reconstruction system based on feature removal provided by the present invention can implement all the method steps implemented in the above-mentioned constructive solid geometry reconstruction method embodiment based on feature removal, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0182] Figure 13 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 13 As shown, the electronic device may include: a processor 1310 , a communication interface 1320 , a memory 1330 and a communication bus 1340 , wherein the processor 1310 , the communication interface 1320 and the memory 1330 communicate with each other via the communication bus 1340 . The processor 1310 can call the logic instructions in the memory 1330 to execute a constructive solid geometry reconstruction method based on feature removal, which includes: removing features and segmenting the input solid geometry model to obtain multiple sub-modules, wherein the removed features include: cylindrical chamfers, conical chamfers, torus chamfers, reinforcement ribs, holes, and stretched bodies; determining multiple body primitives of each sub-module based on the face set of each sub-module in the multiple sub-modules; determining the bounding box of the sub-module based on the intersection of the multiple body primitives; dividing the bounding box into a target number of voxels in equal proportion based on the multiple body primitives, wherein the voxels include internal voxels and external voxels; reconstructing the constructive solid geometry subtree of each sub-module using intersection and difference operations, wherein the alternative root node of the constructive solid geometry subtree is the body primitive containing the external voxels; adding the removed features to the constructive solid geometry subtree of each sub-module in reverse order to obtain a constructive solid geometry reconstruction result; performing primitive discretization and Boolean tree judgment based on the constructive solid geometry reconstruction result to obtain a watertight, manifold, and zero-volume face modeling result.
[0183] In addition, the logic instructions in the memory 1330 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0184] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the feature-removing-based construction entity geometry reconstruction method provided by the above-mentioned methods, the method comprising: performing feature removal and model segmentation on an input entity geometry model to obtain a plurality of sub-modules, wherein the removed features include: cylindrical chamfer, conical chamfer, annular chamfer, reinforcing rib, hole and stretched body; determining a plurality of volume primitives of each sub-module based on the face set of each sub-module; determining the bounding box of the sub-module based on the intersection of the plurality of volume primitives; dividing the bounding box into a target number of voxels in equal proportions based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels; reconstructing the construction entity geometry sub-tree of each sub-module using intersection and difference operations, wherein the candidate root node of the construction entity geometry sub-tree is the volume primitive containing the external voxels; adding the removed features to the construction entity geometry sub-tree of each sub-module in reverse order to obtain a construction entity geometry reconstruction result; and performing primitive discretization and Boolean tree judgment based on the construction entity geometry reconstruction result to obtain a watertight, manifold and zero-volume-face-free modeling result.
[0185] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a feature-removing-based construct entity geometry reconstruction method provided by any of the above methods, the method comprising: performing feature removal and model segmentation on an input entity geometry model to obtain a plurality of sub-modules, wherein the features removed include: cylindrical chamfer, conical chamfer, annular chamfer, reinforcing rib, hole, and stretched body; determining a plurality of volume primitives of each sub-module based on a face set of each sub-module; determining a bounding box of the sub-module based on intersections of the plurality of volume primitives; dividing the bounding box into a target number of voxels in equal proportions based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels; reconstructing a construct entity geometry sub-tree of each sub-module using intersection and difference operations, wherein a candidate root node of the construct entity geometry sub-tree is a volume primitive containing an external voxel; adding the features removed to the construct entity geometry sub-tree of each sub-module in reverse order to obtain a construct entity geometry reconstruction result; and performing primitive discretization and Boolean tree determination based on the construct entity geometry reconstruction result to obtain a modeling result of watertight, manifold, and zero-volume-face-free.
[0186] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0187] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in terms of the contribution to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0188] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for constructing solid geometry reconstruction based on feature removal, characterized in that: include: The input solid geometric model is subjected to feature removal and model segmentation to obtain multiple submodules. The features removed include cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes, and stretched bodies. Determining a plurality of volume primitives of each submodule based on a face set of each submodule in the plurality of submodules; Determining a bounding box of the submodule based on the intersection of the plurality of volume primitives; Dividing the bounding box into a target number of voxels in equal proportion based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels; Reconstructing a constructive solid geometry subtree of each submodule using intersection and difference operations, wherein the candidate root node of the constructive solid geometry subtree is a volume primitive containing the external voxel; Adding the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result; Based on the geometric reconstruction result of the constructed solid, primitive discretization and Boolean tree determination are performed to obtain a watertight, manifold, and zero-volume surface-free modeling result; The input solid geometric model is subjected to feature removal and model segmentation to obtain multiple submodules, including: Sequentially remove cylindrical chamfers, conical chamfers, annular chamfers and reinforcement ribs from solid geometric models; iteratively removing holes and stretched bodies from the solid geometric model; Taking the plane of the solid geometric model as a point, connecting adjacent faces in the solid geometric model with edges, and constructing an adjacency graph of the solid geometric model; The solid geometric model is segmented based on the cut points in the adjacency graph to obtain a plurality of sub-modules.
2. The method for constructing solid geometry reconstruction based on feature removal according to claim 1, characterized in that: The step of determining a plurality of volume primitives of each submodule based on a face set of each submodule in the plurality of submodules comprises: Determine a plurality of axial directions and a face set of a local coordinate system of each submodule in the plurality of submodules, wherein the face set includes a plane corresponding to each axial direction in the plurality of axial directions; When the face set of the local coordinate system is 1, the minimum bounding box for enclosing the submodule under the plane is assumed to be a cuboid; When the face set of the local coordinate system is greater than 1, multiple bounding boxes for enclosing the submodules under all planes are assumed to be cuboids; Based on the center point of the assumed cuboid and the normal direction of the assumed cuboid, a volume primitive set of the submodule is determined.
3. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: The dividing the bounding box into a target number of voxels in equal proportion based on the plurality of volume primitives comprises: Divide the bounding box into a target number of voxels in equal proportions; dividing the voxel into a plurality of blocks based on the plurality of volume primitives; When the proportion of voxels located inside the block is greater than a voxel proportion threshold, all voxels in the block are regarded as internal voxels; When the proportion of voxels outside the block is greater than the voxel proportion threshold, all voxels in the block are regarded as external voxels.
4. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: The method of reconstructing the constructive solid geometry subtree of each submodule using intersection and difference operations includes: Based on the volume primitives and quadratic primitives of each submodule, a subtree including intersection and difference operations and a constructive solid geometry subtree using only union operations are constructed.
5. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: Adding the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result includes: Adding the removal features to the constructed solid geometry subtree of each submodule in the order of the stretched body, the hole, the stiffener, the annular chamfer, the conical chamfer, and the cylindrical chamfer; All of the constructive solid geometry subtrees are used as constructive solid geometry reconstruction results.
6. A constructive solid geometry reconstruction system based on feature removal, characterized in that: include: The segmentation module is used to remove features and segment the input solid geometric model to obtain multiple sub-modules. The removed features include: cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes, and stretched bodies. A first determining module is configured to determine a plurality of volume primitives of each of the plurality of submodules based on a face set of each submodule; A second determining module, configured to determine a bounding box of the submodule based on an intersection of the plurality of volume primitives; a partitioning module, configured to partition the bounding box into a target number of voxels in equal proportion based on the plurality of volume primitives, wherein the voxels include internal voxels and external voxels; a reconstruction module, configured to reconstruct a constructive solid geometry subtree of each submodule using intersection and difference operations, wherein the candidate root node of the constructive solid geometry subtree is a volume primitive containing the external voxel; An adding module, configured to add the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result; An output module is used to perform primitive discretization and Boolean tree determination based on the geometric reconstruction result of the constructed entity to obtain a watertight, manifold modeling result without zero volume surfaces; The input solid geometric model is subjected to feature removal and model segmentation to obtain multiple submodules, including: Sequentially remove cylindrical chamfers, conical chamfers, annular chamfers and reinforcement ribs from solid geometric models; iteratively removing holes and stretched bodies from the solid geometric model; Taking the plane of the solid geometric model as a point, connecting adjacent faces in the solid geometric model with edges, and constructing an adjacency graph of the solid geometric model; The solid geometric model is segmented based on the cut points in the adjacency graph to obtain a plurality of sub-modules.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the constructive solid geometry reconstruction method based on feature removal according to any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for constructive solid geometry reconstruction based on feature removal according to any one of claims 1 to 5 is implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for constructive solid geometry reconstruction based on feature removal according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Access method of topological element of three-dimensional CSG-BRep (Constructive Solid Geometry-Boundary Representation) model
CN105022910A
Large-scene airborne point cloud semantic modeling method
CN110120097A