Distance field-based CAD (Computer Aided Design) mesh de-chamfering method and system

Through a distance field-based method, the CAD model is converted into a triangular mesh, and local topological operations and energy minimization technology are used to solve the complexity of chamfer removal in the traditional method, achieving high-precision and stable grid de-chamfer operation.

CN120451467APending Publication Date: 2025-08-08ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510536099.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

When removing chamfers in CAD models, traditional methods face problems such as high-complex surface calculation difficulties, difficulty in ensuring topological consistency, cumulative error amplification, and non-manifold edges or self-interlace patches, resulting in an increase in the complexity of the de-chamfer task in complex scenarios.

Method used

The CAD model is converted into a triangular mesh using a distance field-based method, and the molecular areas are divided through curvature detection and local topology, and the grid deformation is performed by minimizing the distance field energy and constraints, repairing self-intersection problems and ensuring grid quality.

Benefits of technology

It realizes high-precision de-cavity operation in complex surface scenes, generates high-quality meshes, simplifies the quality requirements of input mesh, ensures C0 continuity and robust concave surface treatment, and avoids the limitations of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451467A_ABST
    Figure CN120451467A_ABST
Patent Text Reader

Abstract

The invention discloses a CAD mesh de-chamfering method and system based on a distance field, and belongs to the field of geometric processing. Comprising the following steps: S1, converting a CAD model into a triangular mesh, marking and extracting a chamfer area mesh, and dividing boundary sub-segments through curvature detection; s2, adjusting the topological connection relationship of the grids in the chamfering region through local topological operation, and dividing the sub-regions based on the subordination relationship between the vertexes and the boundary sub-segments; s3, mesh deformation: taking minimization of distance field energy as a target, taking the curvature upper limit in the sub-region and the triangular unit area lower limit as constraint conditions, and introducing an energy item to measure the satisfaction degree of the constraint conditions; and S4, selfing repair: identifying a negative curved surface triangular unit, repairing selfing and optimizing an adjacent unit, and improving the grid quality through local topology operation. And S5, repeating the steps until the generated grids meet the requirements. According to the method, the limitation of a traditional method in a complex curved surface scene is broken through, and controllable and customizable chamfering removing operation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of geometry processing, and in particular relates to a CAD mesh dechamfering method and system based on a distance field. Background Art

[0002] Computer-Aided Design (CAD) technology is one of the core tools of modern manufacturing and is widely used in mechanical manufacturing, aerospace, automotive industry, medical equipment and other fields. In the design of complex parts, chamfering is a basic geometric operation used to eliminate sharp edges and improve product safety, assembly adaptability and fatigue life. However, chamfered structures may become "redundant features" of the design in certain scenarios. For example, in reverse engineering, it is necessary to restore the original design intent from the mesh model scanned from the physical sample and remove the chamfers introduced by post-processing. In addition, the high curvature shape of the chamfer is limited by the size function constraint in the mesh subdivision, and a fine mesh needs to be generated for accurate discretization, which increases the consumption of computing resources. Such a fine mesh will also limit the performance of operations such as frame field optimization and quadrilateral block extraction.

[0003] Traditional chamfer removal methods rely on a "delete-extend-intersect" process. This involves deleting the chamfered face, then calculating the extension of adjacent faces and generating new edges through geometric intersection. While this process works well for simple geometries, it faces multiple challenges in complex scenarios:

[0004] First, CAD models can be obtained through direct or reverse engineering processes. Direct engineering techniques use free-form shapes and CAD modelers to create virtual models, while reverse engineering methods construct models based on data provided by 3D sensors. In reverse engineering, errors introduced by sensors, B-spline surface fitting tolerances during the parametric modeling phase, and Boolean operation accuracy all lead to geometric errors, making the resulting parameterized model inaccurately represent the intended geometry.

[0005] Furthermore, extending and intersecting surfaces presents computational challenges for highly complex surfaces. CAD models are often represented as B-spline or NURBS surfaces, and analytical intersection requires solving high-order nonlinear equations. This suffers from poor numerical stability and is prone to incomplete solutions due to floating-point errors.

[0006] These errors produce a cumulative amplification effect during the grid discretization stage due to factors such as sampling point selection, angle deviation, and linear deviation, further increasing the deviation.

[0007] Furthermore, topology requires that all parts of a polygonal model adhere to connectivity rules to avoid errors such as disconnected patches. However, the free edges of extended patches may penetrate adjacent geometry, forming non-manifold edges or self-intersecting patches. This necessitates empirical adjustments to the extension direction and length, making it difficult to ensure topological consistency between the extended patch and the original geometry. Such errors introduce additional complexity to the model and further complicate the task of chamfering. Summary of the Invention

[0008] In view of the above problems, the present invention provides a CAD mesh de-chamfering method and system based on a distance field, which is used to remove the chamfered shape of the CAD mesh.

[0009] In order to achieve the above object, the technical solution adopted by the present invention is:

[0010] In a first aspect, the present invention provides a method for de-chamfering a CAD mesh based on a distance field, characterized by comprising the following steps:

[0011] S1, converting the CAD model into a triangular mesh, marking and extracting the chamfer area mesh, and dividing the boundary sub-segments of the chamfer area mesh by curvature detection;

[0012] S2, adjusting the topological connection relationship of the chamfer area mesh through local topological operations, and dividing the chamfer area mesh into sub-areas based on the subordinate relationship between the vertices of each triangular unit and the boundary sub-segment in the chamfer area mesh;

[0013] S3, with the goal of minimizing the distance field energy, takes the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints, introduces an energy term to measure the degree of satisfaction of the constraints, and uses an optimization algorithm to deform the chamfer area mesh;

[0014] S4, identifies the triangular units located on the negative surface in the deformed chamfered area mesh, repairs the self-intersection problem of the triangular unit and its adjacent units, and further improves the mesh quality of the chamfered area through local topological operations.

[0015] S5, repeating steps S2-S4 until the generated mesh meets the user's requirements for size and quality.

[0016] In a second aspect, the present invention provides a CAD mesh de-chamfering system based on a distance field, which is used to implement the above-mentioned CAD mesh de-chamfering method based on a distance field.

[0017] The method of the present invention achieves high-precision geometric restoration and stable topology control through a four-stage process: (1) mesh conversion and chamfer region extraction; (2) preprocessing and sub-region division; (3) energy-driven mesh deformation; and (4) quality detection and optimization. Through multi-scale feature fusion and energy minimization framework, the present invention overcomes the limitations of traditional methods in complex surface scenarios and realizes controllable and customizable chamfering operations, with the following advantages:

[0018] (1) No need to build a high-quality mesh: a very coarse triangulation can be used for simplicity, such as from OpenCASCADE The mesh of OCCT is used as the CAD model mesh input; the vertex distribution is optimized by edge splitting / collapse operations to ensure uniform boundary edge lengths. Even if the input mesh has problems with over-density / over-sparse vertices, a high-quality initial mesh can still be generated.

[0019] (2) C0 continuity guarantee: the boundary vertices are fixed and only the internal vertices are moved to ensure that the deformed mesh is precisely aligned with the non-chamfered areas of the original model.

[0020] (3) Robust concave surface processing: The problem of concave self-intersection is solved through normal angle detection and boundary movement algorithm; vertices are allowed to move into the mesh to eliminate concave self-intersection, and the vertex position is adjusted under the constraint of quadratic surface through boundary movement algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 The flowchart of the method for de-chamfering a CAD mesh based on a distance field in one embodiment of the present invention is shown.

[0022] Figure 2 Schematic diagram of local operations in one embodiment of the present invention. The red part represents the edge to be folded / split / flipped. The left side is the input mesh, and the right side is the output mesh. (a) Edge folding operation is performed on the boundary edge, (b) Edge splitting operation is performed on the boundary edge, (c) Edge folding operation is performed on the internal edge, (d) Edge splitting operation is performed on the internal edge, and (e) Edge flipping operation is performed on the internal edge.

[0023] Figure 3 Schematic diagram of vertex movement direction for self-intersection repair in one embodiment of the present invention.

[0024] Figure 4 Schematic diagram of the mesh obtained in one embodiment of the present invention, where (a) is the initial CAD model, (c) is the pre-processed chamfered area mesh, (d) is the chamfered mesh after local deformation using the distance field-guided optimization method, and (b) is the final optimized mesh output.

[0025] Figure 5Schematic diagrams of meshes obtained in two other embodiments of the present invention, where (a) is the initial CAD model and (b) is the mesh output by the final optimization. DETAILED DESCRIPTION

[0026] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.

[0027] In one embodiment of the present invention, a terminal device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, wherein the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor is a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., and is the computing core and control core of the terminal. The processor is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement corresponding method processes or corresponding functions. The processor described in the embodiment of the present invention can be used for the operation of a CAD mesh de-chamfering method based on a distance field.

[0028] In one embodiment, the present invention provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. The computer-readable storage medium includes a built-in storage medium in the terminal device, which provides storage space and stores the operating system of the terminal, and may also include an extended storage medium supported by the terminal device. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-volatile memory), such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the distance field-based CAD mesh de-chamfering method in the above embodiment.

[0029] like Figure 1 As shown, in one embodiment of the present invention, a method for de-chamfering a CAD mesh based on a distance field is provided, comprising the following steps:

[0030] S1, converting the CAD model into a triangular mesh, marking and extracting the chamfer area mesh, and dividing the boundary sub-segments of the chamfer area mesh by curvature detection;

[0031] S2, adjusting the topological connection relationship of the chamfer area mesh through local topological operations, and dividing the chamfer area mesh into sub-areas based on the subordinate relationship between the vertices of each triangular unit and the boundary sub-segment in the chamfer area mesh;

[0032] S3, with the goal of minimizing the distance field energy, takes the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints, introduces an energy term to measure the degree of satisfaction of the constraints, and uses an optimization algorithm to deform the chamfer area mesh;

[0033] S4, identifies the triangular units located on the negative surface in the deformed chamfered area mesh, repairs the self-intersection problem of the triangular unit and its adjacent units, and further improves the mesh quality of the chamfered area through local topological operations.

[0034] S5, repeating steps S2-S4 until the generated mesh meets the user's requirements for size and quality.

[0035] In the present invention, step S1 converts the CAD model into a triangular mesh, which can be simplified by using a very rough triangulation, such as from Open CASCADE The mesh of (OCCT) is used as the CAD model mesh input. The high precision of the mesh is not considered here. The chamfered area is extracted and the boundary sub-segments are detected based on the meshed structure.

[0036] An optional implementation process of step S1 is as follows:

[0037] S11, triangulate each face of the CAD model separately, and discretize each face into a triangular mesh; according to the topological relationship between the facets, merge the triangular meshes of each facet to obtain a triangular mesh that is topologically homeomorphic to the input CAD model.

[0038] S12, marking and extracting the chamfered area mesh from the triangular mesh of step S11.

[0039] S13, according to the curvature detection method, identify boundary inflection points from the boundary vertices of each facet in the chamfer area mesh (composed of multiple facets), and divide the boundary sub-segments of each facet according to the inflection points; calculate the Hausdorff distance between the sub-segments, identify the overlapping sub-segments between the facets, eliminate the overlapping sub-segments to ensure the uniqueness of the boundaries, and construct a chamfer boundary set. The boundary sub-segments in this set are the boundary sub-segments of the chamfer area mesh.

[0040] In the present invention, step S2 is the process of preprocessing the chamfer area mesh, optimizing the vertex distribution through edge splitting / folding operations to ensure uniform boundary edge lengths. Even if the input mesh has vertices that are too dense / too sparse, and the network initialized in time is rough, a high-quality mesh can still be generated after optimization.

[0041] An optional implementation process of step S2 is as follows:

[0042] like Figure 2 As shown, the local topology operations include edge splitting, edge folding and Delaunay edge folding algorithms, which are used to optimize the cell size and cell angle of the mesh.

[0043] S21, optimize the unit size: the length range of each boundary edge e in the preset chamfer area is [l min ,l max ]; If the actual length of the boundary edge e is l e <l min , then the edge collapse local topology operation is applied to the boundary edge e, such as Figure 2 As shown in (a); if the actual side length of the boundary edge e is l e >l max , then the edge splitting local topology operation is applied to the boundary edge e, and the coordinates of the newly introduced vertices are taken as the midpoints of the vertices of the split edge e, such as Figure 2 As shown in (b);

[0044] Optimize unit angles: Determine the diagonal angles of adjacent triangles of each internal edge, and apply the Delaunay edge-flanging algorithm to the non-Delaunay edges whose sum of diagonal angles is greater than the threshold. For example, Figure 2 As shown in (e) in .

[0045] S22, based on the correspondence between the boundary sub-segment and the vertices of each triangular unit in the chamfered area mesh, if the vertex is not a boundary inflection point and belongs to a sub-segment, then the triangular unit is divided into the sub-area corresponding to the sub-segment, traversing all vertices, and each sub-area after division contains a group of triangular units.

[0046] S23, for triangular units that span sub-regions, adjust vertex distribution through local topological operations: for each edge of a triangular unit, if its two vertices belong to different sub-segments, then the edge is split by edge splitting operation, such as Figure 2As shown in (c) in , if its two vertices do not belong to any sub-segment, the edge is collapsed, as shown in Figure 2 As shown in (d) in the figure, it ensures that each triangle unit belongs to and only belongs to one sub-region to avoid conflicts in optimization objectives.

[0047] In this invention, step S3 uses an optimization algorithm to deform the chamfered area mesh. During deformation, boundary vertices are fixed, and only internal vertices are moved, ensuring that the deformed mesh is precisely aligned with the non-chamfered areas of the original model. Using first-order normals and second-order geometric information as distance field metrics, this approach balances overall shape with local details, achieving multi-scale fusion and controlling surface normal deviation to within ±1°.

[0048] An optional implementation process of step S3 is as follows:

[0049] With the goal of minimizing the distance field energy, and with the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints, an energy term is introduced to measure the degree of satisfaction of the constraints. The distance field calculation is modeled as the following optimization problem:

[0050] The target energy of this embodiment includes the following four items: E = E N +E Q +E I +E A , respectively reflecting the normal difference energy term E of the first-order geometric feature difference N , the quadratic surface energy term E that reflects the difference in second-order geometric characteristics Q , which reflects the curvature size of the sub-region, that is, the internal curvature energy term E of the smoothness of the sub-region I , reflecting the small area penalty energy term E of the minimum area of the triangle unit A .

[0051] Normal difference energy term: The goal of this term is to utilize the first-order geometric information of the non-chamfered adjacent surfaces and use the angle between the normals of the chamfered and non-chamfered areas as the distance field metric function to minimize the difference between the normal of the chamfered area and the normal of its non-chamfered adjacent surfaces, thereby ensuring normal continuity between the chamfered and non-chamfered areas.

[0052] Specifically, this embodiment measures the difference between the normal of the chamfered area and the normal of its non-chamfered adjacent surface in the following manner:

[0053]

[0054] in, represents the boundary of the chamfered area C, Represents a chamfered sub-region C iThe boundary of the chamfered area; θ is the angle between the edge normal of the boundary in the chamfered area and the edge normal of the non-chamfered area; s represents the arc length of the boundary edge, and ds is the tiny length element on the boundary.

[0055] In order to meet the goal of this embodiment, let the normal difference energy term E N To minimize and make it easier to calculate, it is calculated in a discretized way. In the discretized grid, Calculated using the following equivalent formula:

[0056]

[0057] where e j is a chamfered sub-region C i The border The boundary edge on θ j Represents the boundary edge e j In the chamfer sub-area C i The edge normal n c (e j ) and the edge normal n in the non-chamfered area n (e j ),|e j | is the edge e j length.

[0058] In order to save computing resources, this embodiment uses the normal outer product to calculate the sine of the angle to measure the energy size, rather than the angle itself. In addition, since this embodiment ensures that the distribution of boundary vertices is relatively uniform during the preprocessing stage and the length difference of the boundary edges is relatively small, the |e can be ignored in the actual calculation. j |weights, assuming all edges |e| are unit length.

[0059] Based on this, this embodiment can define the discretized E N as follows:

[0060]

[0061] Normal direction n of the edge of the non-chamfered area n (e j ) is a constant, and the normal direction of the chamfered area is n c (e j ) can be calculated by the following formula: where v j,0 and v j,1 They are the boundary edges e j Two vertices of v, v is simultaneously with v j,0 and v j,1 There are internal vertices connected by edges, that is, E N The independent variable is the coordinate of the internal vertex v:

[0062]

[0063] Quadric surface energy term: The goal of this term is to i , whose vertex v∈C i The non-chamfered adjacent surface S that falls in the sub-region i On the extension of.

[0064] First, in order to obtain the non-chamfered adjacent surface S i The parameterized expression function of the continuation of this embodiment is for the non-chamfered adjacent surface S i The upper vertex is sampled and least squares fitting is performed to calculate the parameterized equation of the quadratic surface. The result is represented by a 4×4 symmetric matrix Q. Based on this, the degree of deviation of the chamfered vertex from the quadratic surface is calculated. Specifically, this embodiment measures this distance field function in the following way:

[0065]

[0066] Among them, the chamfer area C is also represented in the form of a parametric surface, that is, the points on the surface are represented as functions of two independent parameters C(u,v), where u and v represent the parameters of the chamfer area C, and their value range determines the range of the surface; C(u,v) is the corresponding sampling point on the chamfer area; Q is the parametric fitting result of the quadratic surface.

[0067] Similarly, to meet the objectives of this embodiment, let the quadratic surface energy term E Q Minimize and make it easy to calculate, calculate it in a discretized way, and measure the degree of deviation between the chamfer vertex coordinate v and the quadratic surface Q:

[0068]

[0069] Internal curvature energy term: By adding a penalty function, the internal smoothness of the chamfered mesh is ensured, thus improving the mesh quality. Specifically, this embodiment hopes that the internal curvature of each sub-region in the chamfered area is as small as possible:

[0070]

[0071] Where H represents the curvature of the chamfered area C, represents the interior of the chamfered area C, and dA represents the tiny area element inside the chamfered area.

[0072] This embodiment adopts the existing solution to discretize it, that is, through adjacent triangular units f j 、f k The dihedral angle θ j,k The size and common edge e j,k Length|ej,k The product of | as a measure of discretization:

[0073] In order to save computational resources, we use adjacent triangle units f j 、f k The surface normal n(f j )、n(f k ) is used to calculate the cosine of the angle to measure the dihedral angle θ j,k size.

[0074] Based on this, this embodiment can define the discretized E I as follows:

[0075]

[0076] The face normal n(f j ) can be calculated by the following formula: where v j,0 、v j,1 、v j,2 is a triangular unit f j The three vertices of the equation include the boundary vertex coordinates as constant input and the internal vertex coordinates of the chamfered area as independent variable input, namely E I The independent variable is the coordinate of the internal vertex v:

[0077]

[0078] Small area penalty energy term: Improves the quality of chamfer meshes by adding a penalty function to avoid the generation of too small patches.

[0079] Specifically, due to computational accuracy issues, narrow faces can introduce higher computational errors. Therefore, a penalty function is added to the energy term to avoid the generation of narrow faces:

[0080]

[0081] Among them A upper and A lower These are the upper and lower limits of the area threshold of the narrow triangular unit concerned in this embodiment, and A is the area of a single triangular unit.

[0082] The small area penalty energy term does not expect to penalize large area triangles, but only focuses on areas smaller than a certain threshold (defined as a upper ) triangles. This penalty function penalizes potential triangle degeneration during the optimization process, preventing high computational errors introduced by approximating degenerate triangles. This helps improve mesh quality and avoid instabilities in numerical calculations.

[0083] This embodiment also uses a discrete method to calculate the small area penalty energy term E A :

[0084]

[0085] where w a is the small area penalty energy term E A The weight coefficient, f j It is sub-region C i This embodiment also uses the area vector to calculate the area of the triangular unit. j,0 、v j,1 、v j,2 is a triangular unit f j The three vertices of , including the boundary vertex coordinates as constant input, and the internal vertex coordinates of the chamfered area as independent variables input:

[0086]

[0087] Based on the above modeling results, the chamfer removal task is converted into an optimization problem for mesh deformation through the distance field, and the L-BFGS-B method is used to solve the above optimization problem.

[0088] In the present invention, step S4 fixes the self-intersection problem and further optimizes the mesh quality. The concave self-intersection problem is solved through normal angle detection and boundary movement algorithm; vertices are allowed to move into the mesh to eliminate concave self-intersection, and the vertex position is adjusted under the quadratic surface constraint through the boundary movement algorithm.

[0089] An optional implementation process of step S4 is as follows:

[0090] S41, concave vertex detection and normal analysis: detect whether the triangle unit is located on the negative surface by calculating the angle θ between the normal vector of the triangle unit and the normal vector of its adjacent surface in the non-chamfered area. If the angle θ is greater than the threshold θ0, it is determined that the triangle unit is located on the negative surface of its adjacent surface in the non-chamfered area, and self-intersection repair is triggered: adjust the vertex coordinates on the sub-segment of the sub-area to which the triangle unit belongs, such as Figure 3 As shown, the vertex is moved along the tangential direction of the subsegment at the vertex, and the vertex is kept on the adjacent surface of the non-chamfered area during the movement, that is, the quadratic surface constraint is satisfied; the vertex position is iteratively adjusted to ensure that the mesh has no self-intersection after deformation and meets the geometric characteristics of the adjacent surface.

[0091] S42, optimize mesh quality: set the lower limit l based on the length of each internal edge e of the chamfered area mesh min ; If the actual length of the internal side e is l e <l min , then the edge collapse local topology operation is applied to the internal edge e.

[0092] In the present invention, step S5 iteratively executes the optimization process until the generated mesh meets the user's requirements for size and quality.

[0093] An optional implementation process of step S5 is as follows:

[0094] Check the mesh changes to determine whether the mesh optimization has converged. That is, after the chamfered mesh is deformed, whether the distance field function value is less than the input threshold δ. If the condition is met, the optimization is terminated and the final mesh is output. If not, repeat steps S2-S4 until the generated mesh meets the requirements.

[0095] Figure 4 Schematic diagram of the mesh obtained in one embodiment of the present invention, where (a) is the initial CAD model, (c) is the pre-processed chamfered area mesh, (d) is the chamfered mesh after local deformation using the distance field-guided optimization method, and (b) is the final optimized mesh output.

[0096] Figure 5 Schematic diagrams of meshes obtained in two other embodiments of the present invention, wherein (a) is the initial CAD model and (b) is the mesh output by the final optimization.

[0097] This embodiment also provides a CAD mesh de-chamfering system based on a distance field, including:

[0098] A CAD model conversion module is used to convert the CAD model into a triangular mesh, mark and extract the chamfer area mesh, and divide the boundary sub-segments of the chamfer area mesh by curvature detection;

[0099] a chamfer preprocessing module, configured to adjust the topological connectivity of the chamfer region mesh through local topological operations, and to divide the chamfer region mesh into sub-regions based on the subordinate relationships between the vertices of each triangular unit and the boundary sub-segments in the chamfer region mesh;

[0100] The optimization deformation module is used to minimize the distance field energy, with the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints. An energy term is introduced to measure the degree of satisfaction of the constraints, and an optimization algorithm is used to deform the chamfer area mesh;

[0101] The result detection quality optimization module is used to identify the triangular elements located on the negative surface in the deformed chamfered area mesh, fix the self-intersection problem of the triangular elements and their adjacent elements, and further improve the mesh quality of the chamfered area through local topological operations.

[0102] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment, and the implementation methods of the remaining modules will not be repeated here. The system embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. Ordinary technicians in this field can understand and implement it without paying any creative work.

[0103] Embodiments of the system of the present invention can be applied to any device with data processing capabilities, such as a computer or other device. System embodiments can be implemented through software, hardware, or a combination of software and hardware. For example, a software implementation, as a logical device, is implemented by a processor of any device with data processing capabilities, reading corresponding computer program instructions from non-volatile memory into internal memory and executing them.

[0104] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they are not to be construed as limiting the scope of the present invention. Persons skilled in the art will readily appreciate that variations and modifications may be made without departing from the spirit of the present invention, and all such variations and modifications fall within the scope of protection of the present invention.

Claims

1. A CAD mesh de-chamfering method based on distance field, characterized in that: The following steps are involved: S1, converting the CAD model into a triangular mesh, marking and extracting the chamfer area mesh, and dividing the boundary sub-segments of the chamfer area mesh by curvature detection; S2, adjusting the topological connection relationship of the chamfer area mesh through local topological operations, and dividing the chamfer area mesh into sub-areas based on the subordinate relationship between the vertices of each triangular unit and the boundary sub-segment in the chamfer area mesh; S3, with the goal of minimizing the distance field energy, takes the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints, introduces an energy term to measure the degree of satisfaction of the constraints, and uses an optimization algorithm to deform the chamfer area mesh; S4, identifies the triangular units located on the negative surface in the deformed chamfered area mesh, repairs the self-intersection problem of the triangular unit and its adjacent units, and further improves the mesh quality of the chamfered area through local topological operations. S5, repeating steps S2-S4 until the generated mesh meets the user's requirements for size and quality.

2. A CAD mesh dechamfering method based on distance field according to claim 1, characterized in that: S1 includes: S11, triangulate each face of the CAD model separately, and discretize each face into a triangular mesh; according to the topological relationship between the facets, merge the triangular meshes of each facet to obtain a triangular mesh that is topologically homeomorphic to the input CAD model. S12, marking and extracting the chamfered area mesh from the triangular mesh of step S11; S13, identifying boundary inflection points from the boundary vertices of each facet in the chamfered area mesh according to the curvature detection method, and dividing the boundary sub-segments of each facet according to the inflection points; calculating the Hausdorff distance between the sub-segments, identifying the overlapping sub-segments between the faces, eliminating the overlapping sub-segments to ensure the uniqueness of the boundaries, and constructing a chamfered boundary set. The boundary sub-segments in this set are the boundary sub-segments of the chamfered area mesh.

3. The method for de-chamfering a CAD mesh based on a distance field according to claim 1, wherein: The local topological operations described in S2 include edge splitting, edge collapsing, and Delaunay edge-flanging algorithms; The range of the length of each boundary edge of the preset chamfer area is [l min ,l max ], if the actual length of the boundary edge e is l e <l min , then the edge folding local topology operation is applied to the boundary edge e; if the actual edge length of the boundary edge e is l e >l max , then the edge splitting local topology operation is applied to the boundary edge e, and the coordinates of the newly introduced vertex during edge splitting are taken as the midpoint of the vertex of the split edge e; the diagonal angles in the adjacent triangles of each internal edge are judged, and the Delaunay edge flipping algorithm local topology operation is applied to the non-Delaunay edges whose sum of diagonal angles is greater than the threshold. The sub-regions of the chamfer area mesh described in S2 include: According to the correspondence between the boundary sub-segment and the vertices of each triangle unit in the chamfer area mesh, if the vertex is not a boundary inflection point and belongs to a sub-segment, the triangle unit is divided into the sub-region corresponding to the sub-segment. After traversing all vertices, each sub-region contains a group of triangle units. For triangular units that span sub-regions, the vertex distribution is adjusted through local topological operations: for each edge of a triangular unit, if its two vertices belong to different sub-segments, an edge splitting operation is performed on the edge; if its two vertices do not belong to any sub-segment, an edge folding operation is performed on the edge to ensure that each triangular unit belongs to and only belongs to one sub-region.

4. The method for de-chamfering a CAD mesh based on a distance field according to claim 1, wherein: In S3, the target energy includes the following four items: E = E N +E Q +E I +E A , respectively reflecting the normal difference energy term E of the first-order geometric feature difference N , the quadratic surface energy term E that reflects the difference in second-order geometric characteristics Q , which reflects the curvature size of the sub-region, that is, the internal curvature energy term E of the smoothness of the sub-region I , reflecting the small area penalty energy term E of the minimum area of the triangle unit A ; Use the optimization algorithm to deform the chamfer area mesh. During deformation, the boundary vertices are fixed and only the internal vertices are moved to minimize the target energy.

5. The method for de-chamfering a CAD mesh based on a distance field according to claim 4, characterized in that: Normal difference energy term E N Specifically: Among them, C i represents the i-th sub-region, e j represents the boundary edge, n n Represents the edge normal.

6. The method for de-chamfering a CAD mesh based on a distance field according to claim 4, characterized in that: Quadric surface energy term E Q Specifically: Among them, v j,0 and v j,1 They are the boundary edges e j The two vertices of , the superscript T represents the transpose, Q represents the parameterized fitting result of the quadratic surface, and v represents the coordinates of the chamfer vertex.

7. The method for de-chamfering a CAD mesh based on a distance field according to claim 4, wherein: Internal curvature energy term E I Specifically: Among them, C i represents the i-th sub-region, Represents the chamfered sub-region C i The boundary of n(f j )、n(f k ) are adjacent triangular units f j 、f k The surface normal of |e j,k | represents adjacent triangular units f j 、f k The length of the common side.

8. The method for de-chamfering a CAD mesh based on a distance field according to claim 4, wherein: Small area penalty energy term E A Specifically: Among them, w a Represents the small area penalty energy term E A The weight coefficient, C i represents the i-th sub-region, f j Represents sub-region C i The triangular element on A(f j ) represents f j The area, A upper and A lower The upper and lower area thresholds for small triangular cells.

9. The method for de-chamfering a CAD mesh based on a distance field according to claim 1, wherein S4 include: S41, concave vertex detection and normal analysis: detect whether the triangular unit is located on the negative surface by calculating the angle θ between the normal vector of the triangular unit and the normal vector of the adjacent surface in the non-chamfered area. If the angle θ is greater than the threshold θ0, it is determined that the triangular unit is located on the negative surface of the adjacent surface of its non-chamfered area, and self-intersection repair is triggered: adjust the vertex coordinates on the sub-segment of the sub-area to which the triangular unit belongs, so that the vertex moves along the tangent direction of the sub-segment at the vertex, and keep the vertex on the adjacent surface of the non-chamfered area during the movement, that is, satisfy the quadratic surface constraint; iteratively adjust the vertex position to ensure that the deformed mesh has no self-intersection and meets the geometric characteristics of the adjacent surface; S42, optimize mesh quality: set the lower limit l based on the length of each internal edge e of the chamfered area mesh min ; If the actual length of the internal side e is l e <l min , then the edge collapse local topology operation is applied to the internal edge e.

10. A CAD mesh dechamfering system based on distance field, used to implement the CAD mesh dechamfering method according to claim 1, characterized in that: The system comprises: A CAD model conversion module is used to convert the CAD model into a triangular mesh, mark and extract the chamfer area mesh, and divide the boundary sub-segments of the chamfer area mesh by curvature detection; a chamfer preprocessing module, configured to adjust the topological connectivity of the chamfer region mesh through local topological operations, and to divide the chamfer region mesh into sub-regions based on the subordinate relationships between the vertices of each triangular unit and the boundary sub-segments in the chamfer region mesh; The optimization deformation module is used to minimize the distance field energy, with the upper limit of the curvature in the sub-region and the lower limit of the triangle unit area as constraints. An energy term is introduced to measure the degree of satisfaction of the constraints, and an optimization algorithm is used to deform the chamfer area mesh; The result detection quality optimization module is used to identify the triangular elements located on the negative surface in the deformed chamfered area mesh, fix the self-intersection problem of the triangular elements and their adjacent elements, and further improve the mesh quality of the chamfered area through local topological operations.