Constructive entity geometric reconstruction method and system based on feature removal
Through the geometric reconstruction method of constructed entities with feature removal and intersection operations, the problem of low efficiency of constructed entities in the prior art is solved, fast and accurate reconstruction is achieved, and the quality of modeling results and the convenience of editing are ensured. .
Patent Information
- Application Number
- CN202411153617.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The existing geometric reconstruction methods for constructing entities have problems with inefficiency, and cannot quickly and accurately reconstruct complex models, and the generated CSG trees are poor in semantics and difficult to edit.
Using a geometric reconstruction method for constructing solids based on feature removal, the CSG tree is rebuilt by removing features such as cylindrical chamfers, conical chamfers, holes and stretched bodies in the model, segmenting the model into submodules, using intersection and difference operations to rebuild the CSG tree and follow the opposite Add features sequentially to generate reconstruction results.
Fast geometric reconstruction of structural solids is realized, ensuring the modeling results of watertight, manifold, and zero-volume surfaces, simplifying the model editing process, and improving the reconstruction speed.
Smart Images

Figure CN119478283A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics, and in particular to a method and system for constructing solid geometry reconstruction based on feature removal. Background Art
[0002] Constructive Solid Geometry (CSG) reconstruction is a crucial topic in industry. Based on the extracted volume primitives from a model, CSG reconstruction aims to restore the original modeling process using Boolean operations.
[0003] In the CSG reconstruction process, methods based on genetic algorithms and program synthesis are limited by long optimization times and produce overly complex CSG trees. Deep learning-based methods, however, cannot reconstruct complex models due to their voxel-based input.
[0004] It can be seen from this that the constructive solid geometry reconstruction method in the related art has a technical problem of low efficiency in constructive solid geometry reconstruction. Summary of the Invention
[0005] The present invention provides a method and system for constructive solid geometry reconstruction based on feature removal, which is used to solve the defect of low efficiency of constructive solid geometry reconstruction methods in the prior art, and realizes rapid reconstruction and ensures watertight, manifold, and zero-volume surface modeling results.
[0006] The present invention provides a method for constructive solid geometry reconstruction based on feature removal, comprising the following steps: performing feature removal and model segmentation on an input solid geometry model to obtain multiple submodules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, reinforcement ribs, holes, and stretched bodies; determining multiple body primitives of each submodule based on the face set of each submodule; determining a bounding box of the submodule 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 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 the body primitive containing the external voxels; adding the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result; performing primitive discretization and Boolean tree determination based on the constructive solid geometry reconstruction result to obtain a watertight, manifold, and zero-volume face modeling result.
[0007] According to a feature removal-based structural solid geometry reconstruction method provided by the present invention, feature removal and model segmentation are performed on an input solid geometric model to obtain multiple sub-modules, including: sequentially removing cylindrical chamfers, conical chamfers, annular chamfers and reinforcing ribs of the solid geometric model; iteratively removing holes and stretched bodies of 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; and performing model segmentation on the solid geometric model based on the cut points in the adjacency graph to obtain multiple sub-modules.
[0008] According to a method for constructing solid geometry reconstruction based on feature removal provided by the present invention, the method determines multiple body primitives of each submodule based on the face set of each submodule in the multiple submodules, including: determining multiple axes and face sets of the local coordinate system of each submodule in the multiple submodules, wherein the face set includes a plane corresponding to each axis in the multiple axes; when the face set in the local coordinate system is 1, the minimum bounding box under the plane for enclosing the submodule is assumed as a cuboid; when the face set in the local coordinate system is greater than 1, the multiple bounding boxes under all planes for enclosing the submodule are assumed as cuboids; and determining the body primitive set of the submodule based on the center point of the cuboid assumption and the normal of the cuboid assumption.
[0009] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, the method of dividing the bounding box into a target number of voxels in equal proportion based on the multiple body primitives includes: dividing the bounding box into a target number of voxels in equal proportion; dividing the voxels into multiple blocks based on the multiple body primitives; when the proportion of voxels located inside the block is greater than a voxel proportion threshold, treating all voxels in the block as internal voxels; when the proportion of voxels located outside the block is greater than the voxel proportion threshold, treating all voxels in the block as external voxels.
[0010] According to a feature removal-based constructive solid geometry reconstruction method provided by the present invention, the constructive solid geometry subtree of each submodule is reconstructed using intersection and difference operations, including: based on the body primitives and quadratic primitives of each submodule, constructing a subtree including intersection operations and difference operations, and a constructive solid geometry subtree using only union operations.
[0011] According to a method for constructive solid geometry reconstruction based on feature removal provided by the present invention, the removal features are added to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result, including: adding the removal features to the constructive solid geometry subtree of each submodule in the order of the stretch body, the hole, the reinforcement rib, the circular chamfer, the cone chamfer and the cylindrical chamfer; and combining all the constructive solid geometry subtrees as the constructive solid geometry reconstruction result.
[0012] The present invention also provides a structural solid geometry reconstruction system based on feature removal, comprising the following modules: a segmentation module for performing feature removal and model segmentation on an input solid geometry model to obtain a plurality of submodules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes, and stretched bodies; a first determination module for determining a plurality of body primitives of each submodule based on a face set of each submodule in the plurality of submodules; a second determination module for determining a bounding box of the submodule based on an intersection of the plurality of body primitives; a partitioning module for determining a bounding box of the submodule based on an intersection of the plurality of body primitives; and a second determination module for determining a bounding box of the submodule based on an intersection of the plurality of body primitives. Individual primitives divide the bounding box into a target number of voxels in equal proportion, wherein the voxels include internal voxels and external voxels; intersection and difference operations are used to reconstruct the constructive solid geometry subtree of each submodule, wherein the alternative root node of the constructive solid geometry subtree is the volume primitive containing the external voxels; 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; primitive discretization and Boolean tree judgment are performed based on the constructive solid geometry reconstruction result to obtain a watertight, manifold, and zero-volume-face modeling result.
[0013] The present invention also provides 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 program, the method for constructing solid geometry reconstruction based on feature removal as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for constructing solid geometry reconstruction based on feature removal as described above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described constructive solid geometry reconstruction methods based on feature removal.
[0016] The present invention provides a method and system for constructing solid geometry reconstruction based on feature removal, which removes features in a solid geometry model, such as cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes and stretches, and divides the solid geometry model into smaller sub-modules; the pre-removed features do not participate in the reconstruction process, but are added to the constructive solid geometry tree as additional nodes; this retains the semantic information of the constructive solid geometry tree while retaining geometric details, making it easy to edit the constructive solid geometry tree, and the decomposition of the model also reduces the number of primitives generated during the reconstruction process, thereby speeding up the reconstruction speed. Based on the constructive solid geometry reconstruction results, primitive discretization and Boolean tree judgment are performed to obtain a watertight, manifold, and zero-volume-face modeling result; thereby solving the technical problem of low efficiency of constructive solid geometry reconstruction in the constructive solid geometry reconstruction method in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is one of the flow charts of the constructive solid geometry reconstruction method based on feature removal provided by the present invention.
[0019] Figure 2 This is the second flow chart of the constructive solid geometry reconstruction method based on feature removal provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the primitive discretization provided by the present invention.
[0021] Figure 4 It is a schematic structural diagram of the triangle of the original surface of the primitive provided by the present invention.
[0022] Figure 5 It is a schematic diagram of the algorithm of Boolean tree determination provided by the present invention.
[0023] Figure 6 This is a comparison chart of the modeling accuracy of the reverse modeling provided by the present invention.
[0024] Figure 7 This is a comparison chart of the modeling accuracy of the forward modeling provided by the present invention.
[0025] Figure 8 It is a structural schematic diagram of the hole and the stretching body provided by the present invention.
[0026] Figure 9It is a schematic diagram of the generation and screening of rectangular parallelepiped primitives provided by the present invention.
[0027] Figure 10 It is a schematic diagram of adding cylindrical chamfers provided by the present invention.
[0028] Figure 11 It is a structural diagram of the model decomposition and reconstruction provided by the present invention.
[0029] Figure 12 It is a structural schematic diagram of the constructive solid geometry reconstruction system based on feature removal provided by the present invention.
[0030] Figure 13 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0031] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0032] Constructive Solid Geometry (CSG) reconstruction is a crucial topic in industry. Based on volume primitives extracted from a model, CSG reconstruction aims to restore the original modeling process using Boolean operations. Due to the simple representation and editability of CSG trees, they are widely used in reverse engineering, CAD / CAE integration, simulation, industrial manufacturing, industrial inspection, and virtual reality. While significant progress has been made in previous research, challenges remain in reconstruction accuracy and speed.
[0033] First, during the CSG reconstruction process, methods based on genetic algorithms and program synthesis are limited by long optimization times and produce overly complex CSG trees. Deep learning-based methods, due to their use of voxel inputs, are unable to reconstruct complex models. More importantly, none of these methods can accurately reconstruct the fine features of the original model, and the resulting CSG trees lack good semantics and cannot depict the modeling process, making them difficult to edit.
[0034] Secondly, during the forward modeling process, a watertight, manifold mesh with no zero-volume faces needs to be modeled based on the CSG tree and volume primitives. Existing methods first discretize the primitives into a mesh, then perform mesh intersection and triangle inside-outside determination, and finally use Boolean operators to determine whether the triangles should be retained. However, this method has obvious flaws. Under the premise of accurate calculation, the coplanarity of the original primitives cannot be retained due to the existence of discretization errors. For example, even if two triangles are discretized from a non-axis-aligned cuboid, the coplanarity cannot be guaranteed due to the rounding error of floating-point operations. Discretization errors can further lead to errors in inside-outside determination and triangle retention determination, resulting in the inclusion of zero-volume faces in the final result. In addition, existing Boolean operations divide triangles into only two categories: "inside" and "outside", which can lead to errors in triangle retention determination in extremely degenerate coplanar cases.
[0035] To address these issues, the present invention proposes a fast and reliable solid geometry modeling process. Unlike previous methods, after analyzing the user's modeling process, the present invention first removes features from the model, such as cylindrical chamfers, conical chamfers, torus chamfers, ribs, holes, and extrusions. It then uses detected planes to segment the model into smaller submodules. These pre-removed features are not included in the reconstruction process but are added to the CSG tree as additional nodes. This preserves both geometric details and the semantic information of the CSG tree, facilitating editing. Decomposing the model also reduces the number of primitives generated during reconstruction, thereby accelerating reconstruction. The present invention then constructs the CSG tree using a bottom-up strategy and incorporates model size-dependent parameters into the energy function to better capture detail. To preserve the coplanarity of volumetric primitives, this paper proposes a coplanar discretization approach, which uses large planes to construct primitives and then extracts the original triangles. Each triangle is assigned a label of "positive top," "negative top," "inside," or "outside," and a non-iterative Boolean tree decision that considers coplanarity is used to determine which triangles to retain. Sufficient experimental data show that the present invention achieves results superior to existing traditional methods and deep learning methods in reconstruction and forward modeling. It can not only quickly reconstruct but also ensure watertight, manifold, and zero-volume surface modeling results.
[0036] The purpose of the present invention is to address the defects of existing structural entity geometry reconstruction and provide an efficient reconstruction method to quickly reconstruct the grid into a CSG tree.
[0037] refer to Figure 1 , Figure 1 This is a flow chart of a constructive solid geometry reconstruction method based on feature removal provided by the present invention, which includes S1: model decomposition, feature removal, and model segmentation; S2: reconstruction of the CSG tree and addition of original features; and S3: forward modeling.
[0038] To achieve the above objectives, the present invention provides a method for constructing solid geometry reconstruction based on feature removal. The method comprises the following steps: Step S1, remove features in the model, including cylindrical chamfers, conical chamfers, annular chamfers, ribs, holes and stretched bodies, and segment the model using the detected plane.
[0039] Step S2: Reconstruct a CSG tree for each submodule and add the original features to the CSG tree block.
[0040] Step S3, using coplanar primitive discretization and Boolean operation judgment considering coplanarity to perform forward modeling, and obtain a forward modeling result that is watertight, manifold, and has no zero volume surface.
[0041] The present invention accelerates the reconstruction speed by decomposing the model, ensures the semantics of the CSG tree, facilitates model editing, and ensures that the modeling results can capture detailed features. It is very suitable for industrial fields such as CAD model reuse and reverse engineering.
[0042] refer to Figure 2 , Figure 2 This is the second flow chart of the method for constructing solid geometry reconstruction based on feature removal provided by the present invention, such as Figure 2 As shown, the method includes the following: Step 201 , performing feature removal and model segmentation on the input solid geometric model to obtain multiple sub-modules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, reinforcement ribs, holes, and stretched bodies.
[0043] In an embodiment of the present invention, features in an input solid geometric model are first detected and removed. 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.
[0044] It should be noted that due to the special cases where there are holes containing stretched bodies and stretched bodies containing holes, the holes and stretched bodies need to be removed iteratively, otherwise self-intersection will occur in the model.
[0045] In order to distinguish between ordinary holes and holes containing elongated bodies, and vice versa, the present invention proposes the following conclusions: In a connected, watertight, non-self-intersecting, manifold mesh, if a hole (extrusion) exists within a hole (extrusion), then the extrusion (hole) must pass through one of the bottom surfaces of the hole (extrusion).
[0046] Therefore, by checking whether an edge in the model intersects the bottom surface of the hole (stretched body), and whether the intersection point falls within the polygon of the bottom surface, the two complex situations mentioned above can be easily determined. To further simplify the model, using faces as points, adjacent faces are connected by edges to define an adjacency graph for the mesh. A pre-defined algorithm (for example, Tarjan's algorithm, an algorithm for finding strongly connected components in a directed graph) is used to find cut points in the graph, and the model is segmented using plane cut points. Compared to using arbitrary face segmentation to segment the model, this method is more consistent with the modeling process.
[0047] Step 202: Determine a plurality of volume primitives of each submodule based on a face set of each submodule in the plurality of submodules.
[0048] In an embodiment of the present invention, the six axes of the local coordinate system of each submodule are determined, wherein each submodule is assigned a local coordinate system, which usually takes its own center or a feature point as the origin and defines three main axes (such as X, Y, and Z axes, including the six axes).
[0049] The present invention selects a plane or none to obtain a face set. If only one plane exists in the local coordinate system, it is used as the basis for the face of the axis, and the minimum bounding box that encloses the module below the plane is selected as a cuboid hypothesis. Otherwise, only cuboid hypotheses with a face set greater than 1 are considered, and the bounding boxes of all faces in the local coordinate system are used as the cuboid hypothesis. Based on the center point and normal of the cuboid hypothesis, the set of volume primitives (cuboid primitives) for the submodule is determined.
[0050] Step 203: Determine the bounding box of the submodule based on the intersection of multiple volume primitives.
[0051] In the embodiment of the present invention, the quadratic primitive is directly extracted from the cylinder, cone, torus, and sphere. Since the space occupied by the quadratic surface is only a part of the primitive, in order to ensure the correct reconstruction, for each quadratic primitive , for which a bounding box needs to be provided as an additional primitive .
[0052] The present invention obtains the coordinate system of the surface and adjacent surfaces, and takes the intersection of the bounding boxes in multiple coordinate systems, that is, the bounding polyhedron, to replace the minimum rotation bounding box. This not only provides a tighter bounding, but also the coordinate system consistent with the rectangular primitive ensures the coplanarity in the modeling. as well as 、 Constitute a set of quadratic primitives.
[0053] Step 204 : Divide 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.
[0054] 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 .
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] refer to Figure 3 , Figure 3 It is a structural schematic diagram of the primitive discretization provided by the present invention.
[0061] 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: 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 3). Specifically, the rectangular parallelepiped primitive is composed of 6 large planes, and the cylinder is composed of two large upper and lower planes and discrete side planes. The cone is special in that its bottom surface is a large plane. Since it is necessary to ensure that the side surfaces intersect at the vertex and the intersection lines of the side surfaces and the adjacent side surfaces pass through the vertex, the present invention uses the side surfaces of the cone with a height slightly higher than the original height as the input side surfaces. After all the planes are discretized, the present invention clusters all the large planes, thereby ensuring that coplanar triangles share the same plane representation. In order to speed up the intersection of triangles, the present invention localizes each large plane as much as possible. Therefore, the smallest triangle that can surround the original primitive face is taken to represent the plane for intersection.
[0062] refer to Figure 4 , Figure 4 It is a schematic structural diagram of the triangle of the original surface of the primitive provided by the present invention.
[0063] In the embodiment of the present invention, the triangles belonging to the original faces of the primitives are extracted to obtain the discretized primitives. After the triangles are intersected, the points of the original faces are the intersection points of the three planes, and the edges are the intersection lines of the two planes. For the faces of the cuboid, cylinder, and cone, as shown in the following example: Figure 4 As shown in (a), starting from each external edge of the large plane, a breadth-first search is used to continuously explore the triangles adjacent to the current edge until the edge of the original primitive face is encountered. All unvisited triangles belong to the primitive face. For the side of the cone, as shown in Figure 4 As shown in (b), starting from any adjacent triangle at the cone vertex, use breadth-first search to continuously explore triangles adjacent to the current edge until the intersection of the side and the base is encountered. All visited triangles belong to the side of the cone. Finally, the set of all volume primitives is obtained. .
[0064] In the embodiment of the present invention, the process of Boolean tree determination is as follows: refer to Figure 5 , Figure 5 It is a schematic diagram of the algorithm of Boolean tree determination provided by the present invention.
[0065] Among them, such as Figure 5 As shown, the above algorithm is a pseudocode 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 this algorithm is to determine the category of a triangle by traversing the nodes of the decision tree and outputting the category label at a given node.
[0066] If the current node n is a specific node m, directly assign the label label(mi,t) of triangle t in Mprim to the label variable and end the algorithm.
[0067] If the current node n is not m, the algorithm continues to recursively calculate the labels of the left and right child nodes. This function receives a node and a triangle as input and returns the label of the triangle on the node.
[0068] For the left child, call label(n.left-child,t) to get the label and store it in the lleft variable. For the right child, call label(n.right_child,t) to get the label and store it in the lright variable.
[0069] Use the evaluate function to evaluate the current node n and 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 calculated label label.
[0070] In order to determine whether each triangle needs to be retained in the final result, the present invention needs to obtain the classification of the triangle at the root node of the CSG tree. For the reconstructed CSG tree, define For nodes Upper triangle In order to handle the degenerate coplanar situation, the present invention expands the triangle labels to "positive upper", "negative upper", "inside", and "outside". When it is a leaf node, it represents the triangle and the corresponding primitive Their inner and outer relationships can be determined by the winding number algorithm, and "positive up" and "negative up" can be determined by judging whether the normal direction of the triangle is consistent with the normal direction of the original face of the primitive.
[0071] The present invention designs a recursive algorithm to determine the triangle classification of the root node. The evaluation function generates a result based on the labels of the left and right subtrees and Boolean operators, so it can be represented using a truth table. When the triangle classification of the root node is "positive up" or "negative up," the triangle must be retained. Specifically, when the triangle classification is "negative up," the triangle normal must be reversed to obtain a watertight, topologically correct modeling result. Thus, the present invention achieves a watertight, manifold, topologically correct modeling result without zero-volume faces.
[0072] refer to Figure 6 , Figure 6 This is a comparison chart of the modeling accuracy of the reverse modeling provided by the present invention.
[0073] In inverse modeling, the present invention was compared with representative state-of-the-art methods, and a quantitative comparison of reconstruction accuracy and efficiency was performed on a dataset provided by InverseCSG. The present invention measured reconstruction accuracy using standard relative Hausdorff distance and relative volume difference. Compared with traditional algorithms, the present invention achieved orders of magnitude improvements in reconstruction accuracy and efficiency. Compared with deep learning algorithms, the present invention also significantly improved reconstruction accuracy. Figure 6 The results show that the present invention can effectively capture the details in the model.
[0074] refer to Figure 7 , Figure 7 This is a comparison chart of the modeling accuracy of the forward modeling provided by the present invention.
[0075] In forward modeling, the present invention is compared with the existing software OpenSCAD, and the forward modeling is measured from the perspective of modeling efficiency and modeling accuracy. Figure 7 The results presented in
[15] demonstrate that our method can reconstruct watertight, manifold, topologically correct models without zero-volume faces, while other methods produce zero-volume faces. It should be noted that even with tolerances applied, FreeCAD can still crash in certain situations. Quantitative comparisons show that our method outperforms open-source software. While Marchingcubes is faster, it cannot preserve sharp features in the model.
[0076] The present invention proposes a method for constructive solid geometry reconstruction based on feature removal. By decomposing the model and simplifying its submodules, reconstruction is accelerated, the semantics of the CSG tree is maintained, user editing is facilitated, and the modeling results effectively capture model details. The present invention also proposes a forward modeling method that considers coplanarity, resulting in a watertight, manifold, topologically correct modeling result without zero-volume surfaces.
[0077] Through the above steps of the embodiment of the present invention, the input solid geometry model is subjected to feature removal and model segmentation to obtain multiple submodules, wherein the removed features include: cylindrical chamfers, conical chamfers, torus chamfers, reinforcement ribs, holes, and stretched bodies; based on the face sets of each submodule in the multiple submodules, multiple body primitives of each submodule are determined; based on the intersection of the multiple body primitives, the bounding box of the submodule 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; the constructive solid geometry subtree of each submodule is reconstructed using intersection and difference operations, wherein the candidate root node of the constructive solid geometry subtree is the body primitive containing the external voxels; 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; based on the constructive solid geometry reconstruction result, primitive discretization and Boolean tree judgment are performed to obtain a watertight, manifold, and zero-volume face modeling result. This solves the technical problem of low efficiency of constructive solid geometry reconstruction methods in related technologies.
[0078] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, feature removal and model segmentation are performed on an input solid geometry model to obtain multiple submodules, including: Sequentially remove cylindrical chamfers, conical chamfers, annular chamfers and reinforcement ribs from solid geometric models; Iteratively remove holes and extrusions from solid geometry models; Taking the plane of the solid geometric model as a point, connecting the adjacent faces in the solid geometric model with edges, and constructing the adjacency graph of the solid geometric model; The solid geometric model is segmented based on the cut points in the adjacency graph to obtain multiple sub-modules.
[0079] refer to Figure 8 , Figure 8 It is a structural schematic diagram of the hole and the stretching body provided by the present invention.
[0080] In the embodiment of the present invention, first, the cylindrical chamfers, conical chamfers, annular chamfers, and reinforcement ribs in the model are sequentially removed, and then the holes and stretched bodies are iteratively removed.
[0081] It should be noted that due to the special cases of holes containing stretched bodies and stretched bodies containing holes, holes and stretched bodies need to be removed iteratively, otherwise self-intersections will occur in the model. Figure 8 As shown, in order to distinguish between ordinary holes and holes containing stretched bodies ( Figure 8 (a)) and ordinary stretches and stretches containing holes ( Figure 8 (b)), the present invention proposes the following conclusions: In a connected, watertight, non-self-intersecting, manifold mesh, if a hole (extrusion) exists within a hole (extrusion), then the extrusion (hole) must pass through one of the bottom surfaces of the hole (extrusion).
[0082] Therefore, by checking whether any edges in the model intersect the bottom surface of the hole (extrusion), and whether the intersection point falls within the polygon of the bottom surface, we can easily determine the two complex situations mentioned above. To further simplify the model, we use faces as points, connect adjacent faces with edges, define an adjacency graph for the mesh, use the Tarjan algorithm to find cut points in this graph, and use plane cut points to segment the model. Compared to using arbitrary face segmentation, this method is more consistent with the modeling process.
[0083] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, based on a face set of each submodule in a plurality of submodules, a plurality of volume primitives of each submodule is determined, comprising: Determine multiple axial directions and face sets of a local coordinate system of each submodule in the multiple submodules, wherein the face set includes a plane corresponding to each axial direction in the multiple 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 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 set of volume primitives of the submodule is determined.
[0084] In the embodiment of the present invention, on the six axes of the local coordinate system of each submodule, the present invention selects one plane or does not select one plane to obtain a face set.
[0085] If there is only one plane in the local coordinate system, the plane is used as the basis of the surface of the axis, and the minimum bounding box that can enclose the module below the plane is selected as the cuboid hypothesis.
[0086] Otherwise, only cuboid hypotheses with face sets greater than 1 are considered, and the bounding boxes of all faces in the local coordinate system are used as cuboid hypotheses.
[0087] refer to Figure 9 , Figure 9 It is a schematic diagram of the generation and screening of rectangular parallelepiped primitives provided by the present invention.
[0088] In particular, for a rectangular parallelepiped hypothesis with only two normal-opposite faces, the present invention arranges and combines the minimum and maximum values on the x, y, and z axes to obtain multiple rectangular parallelepiped hypotheses. For example, a two-dimensional example is Figure 9 As shown in (a), for all cuboid hypotheses, the present invention adopts the following three strategies to screen and obtain legal cuboid primitives.
[0089] For two adjacent faces in the cuboid hypothesis, their center points are 、 , the normal directions of the faces are 、 , to determine whether the adjacent faces need to reverse their normals to form a legal cuboid primitive. Specifically, if and , the adjacent faces do not need to reverse the normal direction, otherwise, Figure 9 (b) shows that the normal direction needs to be reversed. If some adjacent faces in a cuboid hypothesis need to be reversed and some do not, then it is rejected. In particular, for a cuboid hypothesis with two opposite faces, such as Figure 9 As shown in (c), if , you need to reverse the normal direction.
[0090] For the cuboid hypothesis, each face in the face set should be attached to the corresponding face on the cuboid. The present invention checks the distance between the six axes and the corresponding face of the cuboid hypothesis. If it is greater than a certain threshold ( Figure 9 (d)), then reject.
[0091] The minimum and maximum points of all bounding boxes are clustered in global coordinates to ensure coplanarity as much as possible. The cuboid hypothesis with the same maximum and minimum points is then eliminated.
[0092] The present invention directly extracts quadratic primitives from cylinders, cones, tori and spheres. Since the space occupied by the quadratic surface is only a part of the primitive, in order to ensure the correct reconstruction, for each quadratic primitive , for which a bounding box needs to be provided as an additional primitive The present invention obtains the coordinate system of the surface and adjacent surfaces, and takes the intersection of the bounding boxes in multiple coordinate systems, that is, the bounding polyhedron, to replace the minimum rotation bounding box. This not only provides a tighter bounding, but also the coordinate system consistent with the rectangular primitive ensures the coplanarity in the modeling. Quadratic Primitive as well as 、 Constitute a set of quadratic primitives.
[0093] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, a bounding box is divided into a target number of voxels in equal proportion based on a plurality of volume primitives, comprising: Divide the bounding box into the target number of voxels in equal proportions; Dividing the voxels into a plurality of blocks based on a plurality of volume primitives; When the proportion of voxels located inside the block is greater than the 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.
[0094] 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 Voxels. Due to input errors in the input model, directly judging the inside and outside of a single voxel often results 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 (i.e., the above-mentioned voxel ratio threshold) to judge the inside and outside of the block. For example, when more than 80% of the voxels in a 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 .
[0095] According to a constructive solid geometry reconstruction method based on feature removal provided by the present invention, the constructive solid geometry subtree of each submodule is reconstructed using intersection and difference operations, including: Based on the volume primitives and quadratic primitives of each submodule, a subtree including intersection and difference operations is constructed, as well as a constructive solid geometry subtree using only union operations.
[0096] In the embodiment of the present invention, the intersection and difference operations are used to reconstruct the CSG subtree. The present invention selects primitives containing external voxels. As the candidate root node of the subtree. Then, find the set of neighbor primitives that have intersecting voxels with the root primitive, denoted as .
[0097] The present invention uses a binary label set 、 Indicates whether to Perform intersection or difference operations. Therefore, the resulting subtree is , the space occupied by the subtree is The energy function of the reconstructed subtree is defined as:
[0098] in, Representation primitive The total energy, Indicates the number of primitives in the subtree; represents the reward for correctly reconstructed voxels; represents the penalty for incorrectly reconstructed voxels.
[0099] in, Limiting the number of primitives in a subtree:
[0100] in, represents the number of primitives in the subtree, Representation and Volume Primitives The relevant weights, For each element , all calculated 's value and adds it to the sum.
[0101] Among them, the definition ,in Representation object and objects Some measure or score of a set of shared attributes or characteristics, Representation object Relative to the object A measure or score of a unique set of attributes or characteristics. .therefore It measures the number of voxels that need to be corrected from misclassified to correctly classified for each additional primitive added to the subtree. is related to the size of the model, so the proposed method can better capture the details. . represents the reward for correctly reconstructed voxels:
[0102] in, represents the reward for correctly reconstructed voxels, Representation object Subset of With the correct set The intersection between Representation object The complete set of properties Neither belongs to the subset It is not in the correct set either The number of elements.
[0103] However, only rewarding correct reconstruction will make the subtree tend to contain fewer voxels. Therefore, in order to prevent internal voxels from being mistakenly excluded, the present invention adds the following penalty:
[0104] in, Representation object The punishment of being wrongly excluded, Representation object The complete set or universe of properties of represents a correct or desired set, Representation object A subset or set of attributes.
[0105] In order to obtain a valid subtree, when the subtree contains too many external voxels, i.e. , we discard the subtree. In general, let .
[0106] 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:
[0107] in, Represents the root node or category The overall matching error or score under Representation category The weight of Represents 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.
[0108] 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.
[0109] 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: 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. refer to Figure 10 , Figure 10 It is a schematic diagram of adding cylindrical chamfers provided by the present invention.
[0110] 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 .
[0111] 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: Step S1: Decompose the input mesh into a model, including feature removal and model segmentation.
[0112] 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.
[0113] Step S2: Perform bottom-up CSG reconstruction on the submodule and add original features.
[0114] In step S2, in order to speed up the reconstruction process, the present invention reconstructs the complex features and sub-models as separate sub-modules. The set of all modules is For each module First, a cuboid primitive and a quadratic primitive are generated, and then a subtree containing only intersection and difference operations and a CSG tree using only union operations are constructed. The embodiment of the present invention uses a greedy tree search to minimize the energy function.
[0115] In step S2, the present invention selects a plane or does not select it in the six axial directions of each local coordinate system to obtain a face set. If there is only one plane in the local coordinate system, the plane is used as the basis of the face of the axis, and the minimum bounding box that can enclose the module below the plane is selected as the rectangular parallelepiped hypothesis. Otherwise, only the rectangular parallelepiped hypotheses with a face set greater than 1 are considered, and the bounding boxes of all faces in the local coordinate system are used as rectangular parallelepiped hypotheses. In particular, for the rectangular parallelepiped hypothesis with only two normal-opposing faces, the present invention arranges and combines the minimum and maximum values on the x, y, and z axes to obtain multiple rectangular parallelepiped hypotheses. For all rectangular parallelepiped hypotheses, the present invention adopts the following three strategies for screening to obtain legal rectangular parallelepiped primitives.
[0116] For two adjacent faces in the cuboid hypothesis, their center points are 、 , the normal directions of the faces are 、 , to determine whether the adjacent faces need to reverse their normals to form a legal cuboid primitive. Specifically, if and , the adjacent faces do not need to reverse the normal direction, otherwise, they need to reverse the normal direction. If some adjacent faces in a rectangular parallelepiped hypothesis need to be reversed and some do not, then reject it. In particular, for a rectangular parallelepiped hypothesis with two opposite faces, if , you need to reverse the normal direction.
[0117] For the cuboid hypothesis, each face in the face set should be aligned with the corresponding face on the cuboid. The present invention checks the distance between the six axes and the corresponding face of the cuboid hypothesis, and rejects it if it is greater than a certain threshold.
[0118] The minimum and maximum points of all bounding boxes are clustered in global coordinates to ensure coplanarity as much as possible. The cuboid hypothesis with the same maximum and minimum points is then eliminated.
[0119] The present invention directly extracts quadratic primitives from cylinders, cones, tori and spheres. Since the space occupied by the quadratic surface is only a part of the primitive, in order to ensure the correct reconstruction, for each quadratic primitive , for which a bounding box needs to be provided as an additional primitive The present invention obtains the coordinate system of the surface and adjacent surfaces, and takes the intersection of the bounding boxes in multiple coordinate systems, that is, the bounding polyhedron, to replace the minimum rotation bounding box. This not only provides a tighter bounding, but also the coordinate system consistent with the rectangular primitive ensures the coplanarity in the modeling. Quadratic Primitive as well as 、 Constitute a set of quadratic primitives.
[0120] In step S2, 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 .
[0121] In step S2, the present invention uses intersection and difference operations to reconstruct the CSG subtree, and the present invention selects primitives containing external voxels As the candidate root node of the subtree. Then, find the set of neighbor primitives that have intersecting voxels with the root primitive, denoted as The present invention uses a binary label set 、 Indicates whether to Perform intersection or difference operations. Therefore, the resulting subtree is , the space occupied by the subtree is The energy function of the reconstructed subtree is defined as:
[0122] in, Representation primitive The total energy, Indicates the number of primitives in the subtree; represents the reward for correctly reconstructed voxels; represents the penalty for incorrectly reconstructed voxels.
[0123] in Limiting the number of primitives in a subtree:
[0124] in, represents the number of primitives in the subtree, Representation and Volume Primitives The relevant weights, For each element , all calculated 's value and adds it to the sum.
[0125] Among them, the definition ,in .therefore It measures the number of voxels that need to be corrected from misclassified to correctly classified for each additional primitive added to the subtree. is related to the size of the model, so the proposed method can better capture the details. . represents the reward for correctly reconstructed voxels:
[0126] in, represents the reward for correctly reconstructed voxels, Representation object Subset of With the correct set The intersection between Representation object The complete set of properties Neither belongs to the subset It is not in the correct set either The number of elements.
[0127] However, only rewarding correct reconstruction will make the subtree tend to contain fewer voxels. Therefore, in order to prevent internal voxels from being mistakenly excluded, the present invention adds the following penalty:
[0128] in, Representation object The punishment of being wrongly excluded, Representation object The complete set or universe of properties of represents a correct or desired set, Representation object A subset or set of attributes.
[0129] In order to obtain a valid subtree, when the subtree contains too many external voxels, i.e. , we discard the subtree. In general, let .
[0130] 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:
[0131] in, Represents the root node or category The overall matching error or score under Representation category The weight of Represents 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.
[0132] 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.
[0133] 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 is no residual part (red 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 .
[0134] Step S3: forward modeling is performed using primitive discretization considering coplanarity and a Boolean tree decision algorithm.
[0135] In step S3, in order to retain the coplanar characteristics of the primitives, the present invention directly discretizes the sphere and the ring, and discretizes the cuboid, the cylinder and the cone into plane parameters. Specifically, the cuboid primitive is composed of 6 large planes, and the cylinder is composed of two large upper and lower planes and a discretized side plane. The cone is relatively special. Its bottom surface is a large plane. Since it is necessary to ensure that the side surfaces intersect at the vertex and the intersection line of the side surface and the adjacent side surface passes through the vertex, the present invention uses the side surface of the cone with a height slightly higher than the original height as the input side surface. After discretizing all the planes, the present invention clusters all the large planes, thereby ensuring that coplanar triangles share the same plane representation. In order to speed up the intersection of triangles, the present invention localizes each large plane as much as possible. Therefore, the smallest triangle that can surround the original primitive face is taken to represent the plane for intersection.
[0136] In step S3, the present invention extracts the triangles belonging to the original faces of the primitives, thereby obtaining discretized primitives. After the triangles intersect, the points of the original faces are the intersection points of the three planes, and the edges are the intersection lines of the two planes. For the faces on the cuboid, cylinder, and base of the cone, starting from each external edge of the large plane, this article adopts breadth-first search, and continuously explores the triangles adjacent to the current edge until the edge of the original primitive face is encountered. All unvisited triangles belong to the face of the primitive. For the side of the cone, starting from any adjacent triangle at the vertex of the cone, use breadth-first search, and continuously explore the triangles adjacent to the current edge until the intersection line of the side and the base is encountered. All visited triangles belong to the side of the cone. Finally, this article obtains the set of all body primitives. .
[0137] In step S3, in order to determine whether each triangle needs to be retained in the final result, the present invention needs to obtain the classification of the triangle at the root node of the CSG tree. For the reconstructed CSG tree, define is the label of triangle t on node n. In order to handle the degenerate coplanar situation, the present invention expands the triangle labels to "positive upper", "negative upper", "inside", and "outside". When node n is a leaf node, it represents the triangle and the corresponding primitive The relationship between them. The determination of their internal and external relationships can be obtained by the winding number algorithm, and "positive up" and "negative up" can be obtained by judging whether the normal of the triangle is consistent with the normal of the original face of the primitive. The present invention designs a recursive algorithm to determine the triangle classification of the root node. Among them, the evaluation function obtains the result according to the labels of the left and right subtrees and the Boolean operation symbol, so it can be represented by a truth table. When the triangle of the root node is classified as "positive up" or "negative up", the triangle needs to be retained. In particular, when the triangle is classified as "negative up", it is necessary to reverse the normal of the triangle to obtain a watertight, topologically correct modeling result. Thus, the present invention obtains a watertight, manifold, topologically correct modeling result without zero volume faces.
[0138] This paper proposes a method for constructive solid geometry reconstruction based on feature removal. By decomposing the model and simplifying its submodules, this method accelerates reconstruction, maintains the semantics of the CSG tree, facilitates model editing, and ensures that the modeling results effectively capture model details. This paper also proposes a forward modeling method that considers coplanarity, resulting in a watertight, manifold, topologically correct modeling result without zero-volume surfaces.
[0139] The above experimental results and the constructed solid geometry reconstruction method can be used for reverse engineering modeling and have high practical application value.
[0140] The following describes a constructive solid geometry reconstruction system based on feature removal provided by the present invention. The constructive solid geometry reconstruction system based on feature removal described below and the constructive solid geometry reconstruction method based on feature removal described above can refer to each other.
[0141] refer to Figure 12 , Figure 12 It is a structural diagram of the constructive solid geometry reconstruction system based on feature removal provided by the present invention, which includes a segmentation module 1201, a first determination module 1202, a second determination module 1203, a division module 1204, a reconstruction module 1205, an addition module 1206 and an output module 1207.
[0142] Segmentation module 1201 is used to perform feature removal and model segmentation on the input solid geometric model to obtain multiple submodules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, reinforcement ribs, holes, and stretched bodies; A first determining module 1202 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 1203 is configured to determine a bounding box of the submodule based on the intersection of the plurality of volume primitives; A division module 1204 is configured to divide 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 1205 is configured to reconstruct 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 the external voxel; An adding module 1206 is 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; 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.
[0143] 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.
[0144] 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.
[0145] Furthermore, the logic instructions in the aforementioned memory 1330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0146] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the constructive solid geometry reconstruction method based on feature removal provided by the above methods. The method includes: performing feature removal and model segmentation on the input solid geometry model to obtain multiple sub-modules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, reinforcement ribs, holes and stretching bodies; based on the face set of each sub-module in the multiple sub-modules, determining the multiple sub-modules of each sub-module Individual primitives; based on the intersection of multiple volume primitives, determine the bounding box of the submodule; divide the bounding box into a target number of voxels in equal proportion based on multiple volume primitives, wherein the voxels include internal voxels and external voxels; use intersection and difference operations to reconstruct the constructive solid geometry subtree of each submodule, wherein the alternative root node of the constructive solid geometry subtree is the volume primitive containing the external voxels; add the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain the constructive solid geometry reconstruction result; perform primitive discretization and Boolean tree judgment based on the constructive solid geometry reconstruction result to obtain a watertight, manifold, and zero-volume surface modeling result.
[0147] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the constructive solid geometry reconstruction method based on feature removal provided by the above methods, the method comprising: performing feature removal and model segmentation on the input solid geometry model to obtain multiple sub-modules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, reinforcement ribs, holes and stretched bodies; based on the face set of each sub-module in the multiple sub-modules, determining multiple body primitives of each sub-module; based on the intersection of the multiple body primitives , determine the bounding box of the submodule; divide the bounding box into a target number of voxels in equal proportion based on multiple volume primitives, where the voxels include internal voxels and external voxels; use intersection and difference operations to reconstruct the constructive solid geometry subtree of each submodule, where the alternative root node of the constructive solid geometry subtree is the volume primitive containing the external voxels; add the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain the constructive solid geometry reconstruction result; perform primitive discretization and Boolean tree judgment based on the constructive solid geometry reconstruction result to obtain a watertight, manifold, and zero-volume surface modeling result.
[0148] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0149] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for geometric reconstruction of constructive solids 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, wherein the removed features include: cylindrical chamfer, conical chamfer, annular chamfer, ribs, holes and stretched bodies; Based on the face set of each submodule in the plurality of submodules, determining a plurality of volume primitives of each submodule; 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 entity, primitive discretization and Boolean tree determination are performed to obtain a watertight, manifold modeling result without zero volume surface.
2. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: 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 reinforcing 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.
3. The method for constructive 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 of the plurality of submodules, wherein the face set includes a plane corresponding to each of 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.
4. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: The step of dividing the bounding box into a target number of voxels in equal proportion based on the plurality of volume primitives comprises: Dividing the bounding box into a target number of voxels in equal proportion; 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.
5. 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.
6. The method for constructive solid geometry reconstruction based on feature removal according to claim 1, characterized in that: The step of 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: According to the order of the stretch body, the hole, the rib, the annular chamfer, the conical chamfer and the cylindrical chamfer, the removal features are added to the constructed solid geometry subtree of each submodule respectively; All of the constructed solid geometry subtrees are used as constructed solid geometry reconstruction results.
7. A constructive solid geometry reconstruction system based on feature removal, characterized in that: include: A segmentation module is used to perform feature removal and model segmentation on the input solid geometric model to obtain multiple sub-modules, wherein the removed features include: cylindrical chamfers, conical chamfers, annular chamfers, stiffeners, holes, and stretched bodies; A first determining module, configured to determine a plurality of volume primitives of each of the plurality of submodules based on a face set of each of the plurality of submodules; A second determination module, configured to determine a bounding box of the submodule based on an intersection of the plurality of volume primitives; A division module, configured to divide 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, used for 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 the external voxel; An adding module, used for adding the removed features to the constructive solid geometry subtree of each submodule in reverse order to obtain a constructive solid geometry reconstruction result; The 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, and zero-volume surface modeling result.
8. 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 method for constructing solid geometry reconstruction based on feature removal as described in any one of claims 1 to 6 is implemented.
9. 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 constructing solid geometry reconstruction based on feature removal as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for constructing solid geometry reconstruction based on feature removal as claimed in any one of claims 1 to 6 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
Three-dimensional building fine geometric reconstruction method integrating airborne and vehicle-mounted three-dimensional laser point clouds and streetscape images
CN111815776A
Building three-dimensional model simplification algorithm based on linear geometry fitting
CN113793418A
Generalized building three-dimensional geometric reconstruction method
CN115393542A
Cited By
CAD model fillet feature recognition and removal method based on graph neural network
CN121482415A