An alignment-based repairing method for self-intersecting triangle mesh of adjacent curved surfaces
Patent Information
- Application Number
- CN202611254527.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-10-27
AI Technical Summary
[0008]本发明通过提供一种基于对齐的邻近曲面自交三角形网格修复方法,解决了现有技术中修复需人工干预且易偏离几何约束的问题,实现了基于原始几何的全自动闭环高保真修复
本发明通过获取待修复的含自相交缺陷的三角网格及三角网格对应的底层连续几何信息,对三角网格进行自相交检测,得到自相交三角单元对定位结果。在此步骤中,采用AABB树空间筛选与基于点-面、边-面关系的精确求交判定相结合,能够自动且快速地定位出局部的相交区域,无需人工指定修复范围或源/目标曲面,从而将修复范围限定在空间上离散且局部的极小区域内,这极大地缩小了对齐操作的作用范围,有效控制了后续处理中的计算消耗与网格增量,为整体自动化解算奠定了高效基础;针对各组发生自相交的三角单元对,根据三角单元与对应连续几何之间的空间位置关系,判定自相交三角单元对中的各三角单元所对应的几何区域属于内侧几何或者外侧几何,得到内外属性判定结果。该判定过程全程以原始底层连续几何信息作为参考基准,而非仅依赖离散网格数据,因此能够有效克服传统方法中单纯依赖网格求交产生的不确定性,确保了判定结果具备极高的几何保真度与准确率;同时,该步骤提供的分类结果可为后续修复环节选择“优先将外侧网格向内侧网格对齐”的优选策略提供权威数据支撑,这种单侧对齐的判定能有效避免两侧网格同时移动导致的结构塌陷与二次自交,大幅提升后续修复环节的收敛速度;根据内外属性判定结果,选择与内外属性判定结果相匹配的修复策略,对发生自相交的三角单元对执行局部修复操作,得到修复后的三角网格。当内外属性可被识别时,算法优先将外侧网格上的顶点向内侧网格进行重定位或插入对齐,这种策略通过有向的局部调整能够在减少节点插入量的前提下保证网格保形度,有效消除自交且不增加过多不必要的网格;而当遇到无法判别内外侧的复杂拓扑场景,或对齐点非法时,则触发基于最长边插点的对称细化策略,通过同步加密内外侧网格并投影至真实几何的方式来逼近连续曲面以解除相交,这种自适应调用的双路径修复机制,在保证几何特征不丢失的同时,显著提升了算法对不同电磁仿真模型的适应性与鲁棒性;对修复后的三角网格进行局部网格质量优化,得到优化后的三角网格。由于前面的局部对齐和对称细化操作可能在局部区域引入极小尺寸的狭长单元或自由边,该步骤能够及时通过边翻转、顶点平滑和边折叠等网格质量操作,消除对齐操作中可能诱发的拓扑缺陷与质量退化的单元,确保修复后的网格质量严格符合高精度电磁仿真求解器对表面法向一致性、边界闭合性与单元质量的标准要求,从而避免因网格劣化导致后续整体迭代过程发散,保障了修复结果具有物理上的适用性;对优化后的三角网格重新执行自相交检测,若仍存在自相交三角单元对,则返回循环执行;直至无自相交缺陷,将当前三角网格作为修复完成的三角网格输出。通过引入“自相交检测、几何内外判定、局部对齐操作、局部网格优化、选代复检”的完整闭环迭代机制,每轮修复后均进行严格的复检,有效克服了传统单次修复方案可能遗漏自交或产生新自交的隐患;在循环中不断消除相交单元直至收敛,最终实现全自动无人工介入的修复,输出符合电磁仿真批量迭代设计需求的优质水密网格,彻底解决了现有方案需人工反复干预的痛点。
Smart Images

Figure CN122989487A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electromagnetic simulation technology, and in particular to a method for repairing self-intersecting triangular meshes of adjacent curved surfaces based on alignment. Background Technology
[0002] In the field of electromagnetic simulation, during the generation of triangular meshes for engineering models such as antennas and microwave devices, many models contain near-nearest surfaces. Mesh generation is a crucial step in discretizing continuous geometry into computational units. However, due to the inconsistent sampling distribution of mesh nodes on different surfaces, near-nearest surfaces that were originally strictly separated in continuous geometry are prone to spatial penetration after discretization, resulting in mesh self-intersection defects.
[0003] Mesh self-intersections in electromagnetic simulations can disrupt electrical connectivity and dielectric continuity, such as short-circuiting insulation layers or cutting continuous conductors. This can ultimately cause the solver to fail to recognize material interfaces and crash, or output distorted physical results. Therefore, effectively eliminating mesh self-intersections caused by near-nearest surface discretization is a fundamental prerequisite for achieving high-precision electromagnetic simulations.
[0004] Currently, the repair methods for self-intersection defects in triangular meshes are mainly divided into two categories.
[0005] One type of method is represented by publication number CN121437804A. Its core process is: mapping the meshes of the source surface and the target surface to a two-dimensional parameter space, completing the intersection detection, region clipping and boundary extraction in the parameter space, and then aligning and splicing the boundaries of the two surface meshes by constructing a transition region mesh. However, this scheme has the following shortcomings: (1) It requires the user to specify the source surface and the target surface in advance. In actual engineering models, there is a lack of clear master-slave division basis, making it difficult to automate deployment; (2) It relies on the two-dimensional parameter space mapping throughout the process. When the model has high curvature surfaces or multi-connected complex topologies, the parameter space is prone to distortion, causing problems such as coordinate deviation and boundary cracks; (3) It is a single clipping and splicing process, lacking an iterative review and closed-loop repair mechanism. If self-intersection occurs again after repair, manual intervention is required repeatedly; (4) Based on the "source-target" binary master-slave framework, it is difficult to effectively handle multi-mesh intersection scenarios involving three or more surface layers.
[0006] Another type of method is represented by publication number CN120163954A. Its core process is as follows: preprocess the input mesh to generate a watertight mesh, locate the intersecting region based on octree partitioning and connected component analysis, reconstruct the tetrahedral mesh and repair it with rational number calculation, and then splice the repaired local mesh with the non-intersecting region. However, this scheme has the following shortcomings: (1) It completely deviates from the underlying continuous geometric information. All calculations are based on the discrete mesh itself. The vertices of the repaired mesh are prone to deviate from the original surface, and key edges and surface features may be distorted or lost; (2) It adopts the repair path of "surface, volume, surface". Each transformation introduces additional discretization error, and the surface mesh extracted from the tetrahedral mesh often has problems such as normal reversal and non-watertightness, which destroys the boundary closure and normal consistency conditions on which electromagnetic simulation depends.
[0007] In summary, existing triangular mesh self-intersection repair methods suffer from problems such as reliance on manual intervention, deviation from geometric constraints, inability to iteratively verify, and introduction of new defects after repair. There is an urgent need for a repair method that can run fully automatically, always use the original geometry as a constraint, has a closed-loop iterative mechanism, and can guarantee the quality of the output mesh. Summary of the Invention
[0008] This invention provides a method for repairing self-intersecting triangular meshes on adjacent curved surfaces based on alignment, which solves the problems of manual intervention and easy deviation from geometric constraints in the prior art, and realizes fully automatic closed-loop high-fidelity repair based on the original geometry.
[0009] This invention provides a method for repairing self-intersecting triangular meshes on adjacent surfaces based on alignment, the method comprising: S1, obtain the triangular mesh containing self-intersecting defects to be repaired and the corresponding bottom continuous geometric information of the triangular mesh, perform self-intersecting detection on the triangular mesh, and obtain the positioning result of the self-intersecting triangular element pair; S2, for each pair of triangular units that are self-intersecting, based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, determine whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and obtain the inner and outer attribute determination result. S3. Based on the determination results of the internal and external attributes, select a repair strategy that matches the determination results of the internal and external attributes, perform a local repair operation on the triangular element pairs that have self-intersecting, and obtain the repaired triangular mesh. S4, perform local mesh quality optimization on the repaired triangular mesh to obtain an optimized triangular mesh; S5, perform self-intersection detection again on the optimized triangular mesh. If there are still self-intersecting triangular element pairs, return to step S2 and repeat until there are no self-intersection defects. Then output the current triangular mesh as the repaired triangular mesh.
[0010] In one possible implementation, the step of performing self-intersection detection on the triangular mesh to obtain the self-intersection triangular element pair positioning knot includes: An AABB tree is constructed to spatially filter the triangular elements in the triangular mesh, resulting in candidate pairs of triangular elements. For each pair of candidate triangular elements, the edge-face intersection relationship is determined based on the point-face intersection relationship, and the intersection result is obtained by determining whether there is an intersection between the two triangular elements in the candidate triangular element pair according to the edge-face intersection relationship. Record all triangular unit pairs that are determined to intersect as the positioning results of the self-intersecting triangular unit pairs.
[0011] In one possible implementation, determining whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner or outer geometry based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, and obtaining the inner / outer attribute determination result, includes: For each pair of self-intersecting triangular elements, calculate the centroid of each triangular element in the pair, and project the centroid onto its corresponding continuous geometry to obtain the centroid projection point. Based on the centroid of each triangular unit and the corresponding centroid projection point, construct the convex pointer vector corresponding to each triangular unit; Calculate the dot product between the two convex pointer vectors corresponding to each group of self-intersecting triangular unit pairs to obtain the convex consistency index; When the convex consistency index meets the preset conditions, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and the inner and outer attribute determination result is obtained.
[0012] In one possible implementation, constructing the convex pointer vector corresponding to each triangular unit based on the centroid of each triangular unit and the corresponding centroid projection point includes: The direction vector from the centroid of each triangular unit to the corresponding centroid projection point is used as the convex pointer vector.
[0013] In one possible implementation, when the convexity consistency index meets a preset condition, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, thus obtaining the inner / outer attribute determination result, including: When the convex consistency index is greater than or equal to zero, for each pair of self-intersecting triangular elements, the centroid of the first triangular element is projected onto the continuous geometry corresponding to the first triangular element to obtain the first reference point; The first reference point is projected onto the continuous geometry corresponding to the second triangular unit to obtain the second reference point; Construct a position indication vector based on the first reference point and the second reference point; When the position indicator vector is consistent with the direction of the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the outer geometry, and the geometric region corresponding to the second triangular unit is determined to be the inner geometry, thus obtaining the inner and outer attribute determination result. When the position indication vector is inconsistent with the direction of the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the inner geometry and the geometric region corresponding to the second triangular unit is determined to be the outer geometry, thus obtaining the inner and outer attribute determination result.
[0014] In one possible implementation, the step of selecting a repair strategy that matches the internal and external attribute determination result, and performing a local repair operation on the self-intersecting triangular element pairs to obtain the repaired triangular mesh includes: Based on the internal and external attribute determination results, it is determined whether the geometric regions corresponding to the two triangular units in the self-intersecting triangular unit pair can be distinguished as either the inner geometry or the outer geometry, thus obtaining the distinguishability determination result. When the inner geometry and the outer geometry can be distinguished, an alignment-based repair strategy is adopted to align the triangular units in the self-intersecting triangular unit pair that are determined to be the outer geometry to the triangular units that are determined to be the inner geometry, so as to eliminate the intersection and obtain the aligned triangular units. When the inner and outer geometry cannot be distinguished, a refinement-based repair strategy is adopted. The two triangular units in the self-intersecting triangular unit pair are refined simultaneously, and the new vertices generated by the refinement are projected onto their respective continuous geometry to eliminate the intersection and obtain the refined triangular units.
[0015] In one possible implementation, the alignment-based repair strategy aligns the triangular units determined to be the outer geometry of the self-intersecting triangular unit pair with the triangular units determined to be the inner geometry to eliminate intersections and obtain aligned triangular units, including: The method employs an alignment-based repair strategy, aligning the triangular units determined to be outer geometry within the self-intersecting triangular unit pair to the triangular units determined to be inner geometry, including: The triangular element determined as the outer geometry in the self-intersecting triangular element pair is identified as the outer triangular element; Project the vertices of the inner triangular units of the self-intersecting triangular units onto the plane containing the outer triangular units to obtain the projection points; When the projection point is located inside the outer triangular unit, an alignment operation is performed based on the distance relationship between the projection point and the existing vertices of the outer triangular unit to obtain the aligned outer triangular unit.
[0016] In one possible implementation, the refinement-based repair strategy simultaneously refines the two triangular units in the self-intersecting triangular unit pair, and projects the newly refined vertices onto their respective continuous geometry to eliminate intersections, resulting in refined triangular units, including: Simultaneously perform the longest side midpoint insertion operation on the two triangular elements in the self-intersecting triangular element pair to obtain the triangular element after insertion. The newly inserted vertices are projected onto their respective continuous geometry to obtain the refined triangular units.
[0017] In one possible implementation, the step of performing local mesh quality optimization on the repaired triangular mesh to obtain an optimized triangular mesh includes: The local regions affected by the local repair operation in the repaired triangular mesh are identified to obtain the local regions to be optimized. Perform at least one of the following operations on the triangular units in the local region: edge flipping, vertex smoothing, and edge folding, to eliminate degenerate units and free edges introduced during the repair process, and obtain an optimized triangular mesh.
[0018] In one possible implementation, the step of outputting the current triangular mesh as the repaired triangular mesh until no self-intersection defects are found includes: When the self-intersecting test is re-performed and it is determined that there are no self-intersecting triangular element pairs, the result of the self-intersecting defect being eliminated is obtained. Based on the detection results, the current triangular mesh is output as the repaired triangular mesh.
[0019] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention acquires the triangular mesh containing self-intersecting defects to be repaired and the corresponding underlying continuous geometric information of the triangular mesh, performs self-intersection detection on the triangular mesh, and obtains the positioning results of self-intersecting triangular element pairs. In this step, the combination of AABB tree spatial filtering and precise intersection determination based on point-face and edge-face relationships can automatically and quickly locate local intersection regions without manually specifying the repair range or source / target surfaces, thus limiting the repair range to a spatially discrete and locally minimal region. This greatly reduces the scope of the alignment operation, effectively controls the computational consumption and mesh increment in subsequent processing, and lays an efficient foundation for overall automated solution. For each pair of self-intersecting triangular elements, based on the spatial positional relationship between the triangular element and the corresponding continuous geometry, it is determined whether the geometric region corresponding to each triangular element in the self-intersecting triangular element pair belongs to the inner geometry or the outer geometry, obtaining the inner / outer attribute determination result. The entire determination process uses the original, continuous geometric information at the bottom layer as a reference benchmark, rather than relying solely on discrete mesh data. Therefore, it can effectively overcome the uncertainty caused by simply relying on mesh intersection in traditional methods, ensuring that the determination results have extremely high geometric fidelity and accuracy. At the same time, the classification results provided by this step can provide authoritative data support for the subsequent repair stage to select the preferred strategy of "prioritizing the alignment of the outer mesh with the inner mesh". This single-sided alignment determination can effectively avoid structural collapse and secondary self-intersection caused by the simultaneous movement of meshes on both sides, greatly improving the convergence speed of the subsequent repair stage. Based on the determination results of the internal and external attributes, a repair strategy that matches the determination results of the internal and external attributes is selected, and local repair operations are performed on the triangular element pairs that have self-intersected, to obtain the repaired triangular mesh. When the internal and external attributes can be identified, the algorithm prioritizes relocating or inserting vertices on the outer mesh to the inner mesh for alignment. This strategy, through directed local adjustments, can ensure mesh shape preservation while reducing the number of node insertions, effectively eliminating self-intersections without adding too many unnecessary meshes. However, when encountering complex topological scenarios where the internal and external sides cannot be distinguished, or when the alignment points are illegal, a symmetric refinement strategy based on the longest edge insertion point is triggered. This approach approximates the continuous surface to eliminate intersections by simultaneously refining the internal and external meshes and projecting them onto the real geometry. This adaptive dual-path repair mechanism significantly improves the algorithm's adaptability and robustness to different electromagnetic simulation models while ensuring that geometric features are not lost. The repaired triangular mesh is then subjected to local mesh quality optimization to obtain an optimized triangular mesh.Since the preceding local alignment and symmetric refinement operations may introduce extremely small, elongated cells or free edges in local regions, this step can promptly eliminate topological defects and degraded cells that may be induced during the alignment operation through mesh quality operations such as edge flipping, vertex smoothing, and edge folding. This ensures that the quality of the repaired mesh strictly meets the standard requirements of the high-precision electromagnetic simulation solver for surface normal consistency, boundary closure, and cell quality, thereby avoiding divergence in the subsequent overall iteration process due to mesh degradation and ensuring the physical applicability of the repair results. The self-intersection detection is re-performed on the optimized triangular mesh. If self-intersecting triangular cell pairs still exist, the loop is returned to continue until there are no self-intersection defects. The current triangular mesh is then output as the repaired triangular mesh. By introducing a complete closed-loop iterative mechanism of "self-intersection detection, geometric interior and exterior determination, local alignment operation, local mesh optimization, and selection and re-inspection", a rigorous re-inspection is performed after each round of repair, which effectively overcomes the hidden dangers of missing self-intersections or generating new self-intersections in traditional single repair schemes. Intersecting elements are continuously eliminated in the loop until convergence, and finally fully automatic repair without human intervention is achieved. The high-quality watertight mesh that meets the requirements of batch iterative design for electromagnetic simulation is output, which completely solves the pain point of repeated manual intervention required by existing schemes. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the steps of the method for repairing self-intersecting triangular meshes on adjacent surfaces based on alignment, as provided in this embodiment of the invention. Figure 2 This is a schematic diagram of the discrete neighbor curves provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of two-dimensional spatial curve discretization provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a two-dimensional spatial vector construction provided in an embodiment of the present invention; Figure 5 This is a diagram of an iterative repair framework based on local alignment provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0022] This invention provides a method for repairing self-intersecting triangular meshes on adjacent surfaces based on alignment, see [link to relevant documentation]. Figure 1 The method includes: S1, obtain the triangular mesh containing self-intersecting defects to be repaired and the corresponding bottom continuous geometric information of the triangular mesh, perform self-intersecting detection on the triangular mesh, and obtain the positioning results of self-intersecting triangular element pairs; Specifically, in step S1, the triangular mesh is subjected to self-intersection detection to obtain the self-intersection triangular element pair positioning knot, including the following steps S11 to S13.
[0023] S11, Construct an AABB tree to spatially filter the triangular elements in the triangular mesh to obtain candidate triangular element pairs; S12, for each group of candidate triangular element pairs, determine the edge-face intersection relationship based on the point-face intersection relationship, and determine whether there is an intersection between the two triangular elements in the candidate triangular element pair based on the edge-face intersection relationship, and obtain the intersection determination result; S13, record all triangular unit pairs that are determined to be intersecting, as the positioning results of self-intersecting triangular unit pairs.
[0024] For example, data input and self-intersection detection are performed. The triangular mesh containing self-intersection defects to be repaired, along with the corresponding underlying continuous geometry, is imported. An AABB tree is constructed to spatially filter the triangular elements in the mesh, obtaining candidate triangular element pairs. For each candidate triangular element pair, the edge-face intersection relationship is determined based on the point-face intersection relationship, and the intersection between the two triangular elements in the candidate pair is determined based on the edge-face intersection relationship, yielding the intersection determination result. All triangular element pairs determined to be intersecting are recorded as the self-intersecting triangular element pair location results. The region corresponding to the self-intersecting triangular element pair location results is a discrete and local region to be repaired, narrowing the scope of the alignment operation and facilitating control of the overall mesh increment.
[0025] S2, for each pair of triangular units that are self-intersecting, based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, determine whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and obtain the inner and outer attribute determination result. Specifically, in step S2, based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and the inner and outer attribute determination result is obtained, including the following steps S21 to S24.
[0026] S21. For each pair of self-intersecting triangular elements, calculate the centroid of each triangular element in the pair, project the centroid onto its corresponding continuous geometry, and obtain the centroid projection point. S22, construct the convex pointer vector corresponding to each triangular unit based on the centroid of each triangular unit and the corresponding centroid projection point; Here, based on the centroid of each triangular unit and its corresponding centroid projection point, a convex pointer vector is constructed for each triangular unit, including: the direction vector pointing from the centroid of each triangular unit to its corresponding centroid projection point, which is used as the convex pointer vector.
[0027] S23, calculate the dot product between the two convex pointer vectors corresponding to each group of self-intersecting triangular unit pairs to obtain the convex consistency index; S24. When the convex consistency index meets the preset conditions, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and the inner and outer attribute determination results are obtained.
[0028] Here, when the convexity consistency index meets the preset conditions, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, thus obtaining the inner / outer attribute determination result, including: S241, When the convexity consistency index is greater than or equal to zero, for each pair of self-intersecting triangular elements, the centroid of the first triangular element is projected onto the continuous geometry corresponding to the first triangular element to obtain the first reference point; S242, Project the first reference point onto the continuous geometry corresponding to the second triangular element to obtain the second reference point; S243, construct a position indication vector based on the first reference point and the second reference point; S244, when the position indicator vector is in the same direction as the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the outer geometry and the geometric region corresponding to the second triangular unit is determined to be the inner geometry, and the inner and outer attribute determination results are obtained. S245, when the position indicator vector is inconsistent with the direction of the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the inner geometry and the geometric region corresponding to the second triangular unit is determined to be the outer geometry, and the inner and outer attribute determination results are obtained.
[0029] For example, since mesh self-intersection occurs because the inner mesh penetrates the outer mesh, it's best to keep one side of the mesh aligned with the other to avoid simultaneous local alignment on both sides, which could lead to new self-intersections. For each pair of self-intersecting triangular elements, the centroid of each triangular element in the pair is calculated and projected onto the corresponding continuous geometry to construct a discrete deviation vector. The consistency of the deviation vector's direction is determined by the vector dot product, and then combined with the relative position vectors to complete the inner and outer attribute labeling of the triangular elements. The specific idea and algorithm are as follows: like Figure 2As shown, since the mesh discretization is essentially a chord of the convex hull, and must be inside the convex hull, self-intersection of the mesh may occur even when only one convex side of a face is sufficiently close to the concave side of another face, without geometric contact. Therefore, it is first necessary to detect the local convexity and concavity of the continuous geometry.
[0030] like Figure 3 As shown, to simplify the problem and facilitate explanation, the concept of a convex pointer vector is introduced in two-dimensional space, and the curve... It is a convex set The boundary. After discretization, the resulting polygon consists of a set of line segments. Indicated. Due to line segment convex hull The chord, whose endpoints are all at Above, therefore line segment All in internal. in line segment Take a non-endpoint from above Calculate the point at orthogonal projection points on , can be called a vector It is a convex pointer vector, which can be used to fuzzy determine the geometric concavity and convexity properties of discrete regions.
[0031] like Figure 4 As shown, in two-dimensional space, local convex indicator vectors can be constructed using the methods described above. and Specifically, it is expressed as: ; ; in, Point Orthogonal projection points on continuous geometric boundaries; Represents discrete line segments The point on; Point Orthogonal projection points on continuous geometric boundaries; Represents discrete line segments The point on; Represents line segment The corresponding convex pointer vector; Represents line segment The corresponding convex pointer vector.
[0032] Both vectors actually point in the direction in which the curve bulges out. We construct the inner product. As a convex consistency indicator: ; in, Represents line segment The corresponding convex pointer vector; Represents line segment The corresponding convex pointer vector; Indicates the inner product.
[0033] like This indicates that the curves protrude in the same direction, and this is the main problem addressed in this invention. When To distinguish between the inside and outside of a curve, it is only necessary to calculate whether the positional relationship between the two sets of surfaces is consistent with the concavity / convexity relationship. The specific operation is as follows: Select any one of the intersecting line segments (e.g., ...). Select the non-endpoints on the intersecting line segments. , will point Projected onto its corresponding curve Above, the projection point is obtained. Use this as a reference point. Then project this point onto the curve containing another intersecting line segment. Up, obtain reference points Subsequently, two relative position indicator vectors are constructed. and : ; ; in, Point At continuous geometric boundaries (curves) orthogonal projection points on ) Represents discrete line segments The point on; Point Orthogonal projection points on continuous geometric boundaries; Represents discrete line segments The point on; This represents the relative position indicator vector, whose physical meaning is the projection reference point from surface 1. Projection point on surface 2 The direction vector; Represents a relative position indicator vector, and The directions are opposite, and their physical meaning is the projection point from surface 2. Projection reference point pointing to surface 1 The direction vector; Represents the projection point The continuous geometry (curve) corresponding to another intersecting line segment orthogonal projection points on ).
[0034] Determine if these two vectors are aligned with the direction of the convexity indicator vector. If they are aligned, it is the outer geometry; otherwise, it is the inner geometry. That is:
[0035]
[0036] in, Used to represent curves Is the geometry external geometry? Used to represent curves Is geometry C2 an outer geometry, i.e.: if The analysis shows that the curve For the outer geometry; conversely, if Then the curve The geometry is on the outside.
[0037] The spatial relationship between continuous 3D geometry and discrete meshes can be intuitively understood through an analogy between continuous 2D curves and their discrete line segments. Following this dimensional analogy, the inner and outer sides of the associated geometry can be roughly determined directly based on discrete triangular elements. Specifically, this method calculates the centroid of intersecting triangles. And project it onto the associated geometry to obtain the point. Then, the above formula is applied to determine the inner and outer sides of the geometry corresponding to the self-intersecting unit.
[0038] S3. Based on the results of the internal and external attribute determination, select a repair strategy that matches the results of the internal and external attribute determination, perform local repair operation on the triangular element pairs that have self-intersecting, and obtain the repaired triangular mesh. Specifically, in step S3, based on the internal and external attribute determination results, a repair strategy matching the internal and external attribute determination results is selected, and a local repair operation is performed on the triangular element pairs that have self-intersecting to obtain the repaired triangular mesh, including the following steps S31 to S34.
[0039] S31. Based on the results of the internal and external attribute determination, determine whether it is possible to distinguish whether the geometric regions corresponding to the two triangular units in the self-intersecting triangular unit pair belong to the inner geometry or the outer geometry, and obtain the distinguishability determination result. S32, when the inner geometry and outer geometry can be distinguished, an alignment-based repair strategy is adopted to align the triangular elements in the self-intersecting triangular element pair that are determined to be the outer geometry to the triangular elements that are determined to be the inner geometry, so as to eliminate the intersection and obtain the aligned triangular elements. Here, an alignment-based repair strategy is adopted to align the triangular units that are determined to be the outer geometry in the self-intersecting triangular unit pair to the triangular units that are determined to be the inner geometry, so as to eliminate the intersection and obtain the aligned triangular units, including the following steps S321 to S324.
[0040] S321, employing an alignment-based repair strategy, aligns the triangular elements determined to be the outer geometry in the self-intersecting triangular element pair to the triangular elements determined to be the inner geometry, including: S322, determine the triangular element that is determined to be the outer geometry in the self-intersecting triangular element pair, and use it as the outer triangular element; S323, Project the vertices of the inner triangular elements of the intersecting triangular elements onto the plane of the outer triangular elements to obtain the projection point; S324, when the projection point is located inside the outer triangular unit, perform an alignment operation based on the distance relationship between the projection point and the existing vertices of the outer triangular unit to obtain the aligned outer triangular unit.
[0041] S33. When the inner geometry and outer geometry cannot be distinguished, a refinement-based repair strategy is adopted. The two triangular elements in the self-intersecting triangular element pair are refined simultaneously, and the new vertices generated by the refinement are projected onto their respective continuous geometry to eliminate the intersection and obtain the refined triangular elements.
[0042] Here, a refinement-based repair strategy is adopted to refine the two triangular units in the self-intersecting triangular unit pair simultaneously, and project the new vertices generated by the refinement onto their respective continuous geometry to eliminate the intersection and obtain the refined triangular units, including the following steps S331 to S332.
[0043] S331, perform the longest side midpoint insertion operation on the two triangular elements in the self-intersecting triangular element pair at the same time to obtain the triangular element after the insertion; S332, the newly inserted vertices are projected onto their respective continuous geometry to obtain the refined triangular elements.
[0044] For example, if both triangular meshes are aligned with each other, adding new nodes to the inner triangular mesh will generate new self-intersecting triangular elements, making it difficult to control the mesh size. If the inner triangular elements are aligned with the outer triangular elements by moving vertices, it may cause the triangular mesh to collapse, reducing its shape preservation. Aligning the outer triangular elements with the inner triangular elements is a better strategy, which avoids adding too many triangular elements while ensuring the quality and shape preservation of the triangular mesh. The iterative repair framework based on local alignment is shown in the diagram below. Figure 5 As shown.
[0045] When the inner or outer side of the corresponding continuous geometry can be identified for a pair of self-intersecting triangular elements, the intersection is resolved through vertex relocation and alignment of the outer triangular mesh and vertex insertion alignment. Vertex relocation can reduce vertex insertion and improve the quality of triangular elements, while aligning the boundary vertices of the inner and outer triangular elements. However, when there is a large difference in vertex distribution between the inner and outer triangular elements, vertex relocation may lead to excessively sparse triangular elements in some areas of the outer mesh, and the collapse of the triangular mesh will cause new self-intersections. Therefore, vertex insertion alignment is required. The core principle of vertex insertion alignment is to use the vertices of the inner triangular elements as "probes" to calculate new aligned vertices, thereby quickly separating the two triangular meshes. Since the nearest neighbor surfaces are strictly non-intersecting in continuous geometry, the self-intersections are likely to be eliminated after the vertices of the inner and outer triangular elements are aligned.
[0046] The algorithm iterates through all self-intersecting triangular unit pairs. , ) and the continuous geometry that is judged as "outer". As the object to be modified, the inner triangular unit will be... vertex set Projected onto the outer triangular unit On the plane, the set of projection points is obtained. If set There exist vertices that are strictly located in Inside the , these vertices are calculated to The distances to the three vertices are calculated, and the maximum value of the minimum distance to the existing vertex is selected (as shown in the following formula), corresponding to the projection point. As the optimal candidate point.
[0047] according to Based on the proximity to existing triangular mesh vertices, perform one of the following two operations: a) Vertex repositioning and alignment: If and The distance to the nearest vertex is less than a numerical threshold. (For example If there is only one vertex, then the geometric vertices are considered to coincide in space. In this case, instead of refining the triangular units, vertex snapping or relocation is performed. This step eliminates self-intersections and avoids generating degenerate triangular units. For example, if there is only one vertex... exist Inside, and the shortest side distance If the vertex distance is less than the threshold, then the vertex corresponding to the outer triangular unit is repositioned to... The location.
[0048] b) Vertex insertion alignment: If and The distance to the nearest vertex is not less than a numerical threshold. Then in Insert a new node at the location and place the outer triangular unit. It splits into three new sub-triangular units. Through the above operations, after inserting a point inside the outer triangular unit, the newly inserted vertex and... The vertices in the triangle were aligned. While aligning, the quality of the three sub-triangles after the outer triangles were refined was ensured, preventing degradation.
[0049] The proposed algorithm for inserting points inside triangular units significantly accelerates convergence and reduces repeated intersections between triangular units. An alternative symmetric thinning strategy is employed when it's impossible to distinguish between the inner and outer sides of continuous geometry, or when vertex alignment is illegal.
[0050] Symmetric refinement operation: The longest edge is simultaneously interpolated on two intersecting triangular units, and the resulting vertex sets are projected onto their corresponding continuous geometries. This synchronous reduction of discretization error allows both discrete triangular meshes to simultaneously approximate their true continuous geometry, thus resolving the self-intersection problem collaboratively. Furthermore, using vertices in the longest edge is a superior triangular mesh refinement operation, preventing degradation of the triangular mesh quality. The symmetric refinement algorithm is mainly applied in the following two scenarios: a) When the geometric inner and outer sides cannot be distinguished, i.e., the convexity consistency index In this situation, the alignment operation described above cannot be completed.
[0051] b) When the self-intersecting triangular element pairs are successfully identified on the inside or outside of the corresponding continuous geometry, but Projecting vertices in the middle to Afterwards, It does not exist inside. The vertices projected onto this plane cannot be aligned by repositioning the vertices or by inserting points inside the outer triangular units.
[0052] S4. Perform local mesh quality optimization on the repaired triangular mesh to obtain the optimized triangular mesh. Specifically, in step S4, the repaired triangular mesh is locally optimized to obtain an optimized triangular mesh, including the following steps S41 to S42.
[0053] S41, Identify the local regions in the repaired triangular mesh affected by the local repair operation, and obtain the local regions to be optimized; S42, perform at least one of the following operations on the triangular elements in the local region: edge flipping, vertex smoothing, and edge folding, to eliminate the degenerate elements and free edges introduced during the repair process, and obtain the optimized triangular mesh.
[0054] For example, after performing local alignment on all self-intersecting triangular pairs, a round of mesh optimization is required, and it is necessary to check whether any new self-intersecting pairs are generated in order to avoid overall iteration divergence.
[0055] S5, re-perform self-intersection detection on the optimized triangular mesh. If self-intersecting triangular element pairs still exist, return to step S2 and repeat until there are no self-intersection defects. Then output the current triangular mesh as the repaired triangular mesh.
[0056] Specifically, in step S5, until there are no self-intersecting defects, the current triangular mesh is output as the repaired triangular mesh, including the following steps S51 to S52.
[0057] S51, when it is determined that there are no self-intersecting triangular element pairs after re-performing the self-intersecting test, the test result that the self-intersecting defect has been eliminated is obtained; S52, based on the detection results, output the current triangular mesh as the repaired triangular mesh.
[0058] For example, the processed mesh is re-tested for self-intersection. If self-intersection pairs still exist, the process returns to step S2 and repeats. If there are no self-intersection defects, the finally repaired triangular mesh is output.
[0059] This invention automatically locates intersecting unit pairs through self-intersection detection, eliminating the need for manual specification of the source and target surfaces. The repair process can run automatically, avoiding the problem of unclear surface selection rules in Solution 1, which makes automated deployment difficult.
[0060] This invention is based on original geometric calculations in three-dimensional space and does not involve two-dimensional UV parameter space mapping. Therefore, it does not have the problems of coordinate deviation and boundary cracks caused by parameter distortion in Scheme 1. When dealing with multi-layer approximately coincident surfaces, this invention adopts a method of independent judgment and repair of each pair of elements, which does not have the problem of interlayer thickness deviating from the original design due to the accumulation of mapping errors layer by layer in Scheme 1.
[0061] This invention forms a closed-loop repair process of "self-intersection detection, geometric interior and exterior determination, local alignment operation, local mesh optimization and iterative re-inspection". After each round of repair, the self-intersection is re-inspected, and self-intersection is continuously eliminated in the iteration until convergence. Therefore, it does not have the defect of Scheme 1, which requires repeated manual intervention if self-intersection reappears after a single cut and splice.
[0062] The vertex relocation, vertex insertion, and projection operations involved in this invention are all based on the query of the original geometric information, ensuring that the mesh vertices always fit the original geometry after repair. This avoids the defects of Scheme 2, which may cause the mesh vertices to deviate from the original surface and key features to be distorted and lost due to complete detachment from geometric constraints.
[0063] This invention directly repairs the surface mesh, which is a pure surface mesh operation and does not involve the conversion path of "surface, volume, surface". Therefore, it does not have the inherent problems caused by tetrahedral mesh reconstruction in Scheme 2: First, it avoids the smooth destruction of small gaps and extremely close surface structures during volume meshing; Second, it avoids the problems of normal reversal and non-watertightness that may occur when extracting surface mesh from volume mesh, ensuring that the surface normal consistency and watertightness of the output mesh meet the boundary conditions of electromagnetic simulation; Third, it avoids the additional computational overhead caused by volume mesh reconstruction and global remeshing.
[0064] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this invention can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0065] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present invention.
Claims
1. A method for repairing self-intersecting triangular meshes on adjacent surfaces based on alignment, characterized in that, include: S1, obtain the triangular mesh containing self-intersecting defects to be repaired and the corresponding bottom continuous geometric information of the triangular mesh, perform self-intersecting detection on the triangular mesh, and obtain the positioning result of the self-intersecting triangular element pair; S2, for each pair of triangular units that intersect each other, based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, determine whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and obtain the inner and outer attribute determination result. S3. Based on the determination results of the internal and external attributes, select a repair strategy that matches the determination results of the internal and external attributes, perform a local repair operation on the triangular element pairs that have self-intersecting, and obtain the repaired triangular mesh. S4, perform local mesh quality optimization on the repaired triangular mesh to obtain an optimized triangular mesh; S5, perform self-intersection detection again on the optimized triangular mesh. If there are still self-intersecting triangular element pairs, return to step S2 and repeat until there are no self-intersection defects. Then output the current triangular mesh as the repaired triangular mesh.
2. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 1, characterized in that, The step of performing self-intersection detection on the triangular mesh to obtain the self-intersection triangular element pair positioning knot includes: An AABB tree is constructed to spatially filter the triangular elements in the triangular mesh, resulting in candidate pairs of triangular elements. For each pair of candidate triangular elements, the edge-face intersection relationship is determined based on the point-face intersection relationship, and the intersection result is obtained by determining whether there is an intersection between the two triangular elements in the candidate triangular element pair according to the edge-face intersection relationship. Record all triangular unit pairs that are determined to intersect as the positioning results of the self-intersecting triangular unit pairs.
3. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 1, characterized in that, The step of determining whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry based on the spatial positional relationship between the triangular unit and the corresponding continuous geometry, and obtaining the inner / outer attribute determination result, includes: For each pair of self-intersecting triangular elements, calculate the centroid of each triangular element in the pair, and project the centroid onto its corresponding continuous geometry to obtain the centroid projection point. Based on the centroid of each triangular unit and the corresponding centroid projection point, construct the convex pointer vector corresponding to each triangular unit; Calculate the dot product between the two convex pointer vectors corresponding to each group of self-intersecting triangular unit pairs to obtain the convex consistency index; When the convex consistency index meets the preset conditions, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, and the inner and outer attribute determination result is obtained.
4. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 3, characterized in that, The step of constructing the convex pointer vector corresponding to each triangular unit based on the centroid of each triangular unit and the corresponding centroid projection point includes: The direction vector from the centroid of each triangular unit to the corresponding centroid projection point is used as the convex pointer vector.
5. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 3, characterized in that, When the convex consistency index meets the preset conditions, based on the directional consistency relationship between the convex pointer vector and the position indicator vector, it is determined whether the geometric region corresponding to each triangular unit in the self-intersecting triangular unit pair belongs to the inner geometry or the outer geometry, thus obtaining the inner / outer attribute determination result, including: When the convex consistency index is greater than or equal to zero, for each pair of self-intersecting triangular elements, the centroid of the first triangular element is projected onto the continuous geometry corresponding to the first triangular element to obtain the first reference point; The first reference point is projected onto the continuous geometry corresponding to the second triangular unit to obtain the second reference point; Construct a position indication vector based on the first reference point and the second reference point; When the position indicator vector is consistent with the direction of the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the outer geometry, and the geometric region corresponding to the second triangular unit is determined to be the inner geometry, thus obtaining the inner and outer attribute determination result. When the position indication vector is inconsistent with the direction of the convex pointer vector of the first triangular unit, the geometric region corresponding to the first triangular unit is determined to be the inner geometry and the geometric region corresponding to the second triangular unit is determined to be the outer geometry, thus obtaining the inner and outer attribute determination result.
6. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 1, characterized in that, The step of selecting a repair strategy that matches the internal and external attribute determination result based on the internal and external attribute determination result, and performing a local repair operation on the self-intersecting triangular element pairs to obtain the repaired triangular mesh includes: Based on the internal and external attribute determination results, it is determined whether the geometric regions corresponding to the two triangular units in the self-intersecting triangular unit pair can be distinguished as either the inner geometry or the outer geometry, thus obtaining the distinguishability determination result. When the inner geometry and the outer geometry can be distinguished, an alignment-based repair strategy is adopted to align the triangular units in the self-intersecting triangular unit pair that are determined to be the outer geometry to the triangular units that are determined to be the inner geometry, so as to eliminate the intersection and obtain the aligned triangular units. When the inner and outer geometry cannot be distinguished, a refinement-based repair strategy is adopted. The two triangular units in the self-intersecting triangular unit pair are refined simultaneously, and the new vertices generated by the refinement are projected onto their respective continuous geometry to eliminate the intersection and obtain the refined triangular units.
7. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 6, characterized in that, The method employs an alignment-based repair strategy, aligning the triangular units determined to be outer geometry within the self-intersecting triangular unit pair with the triangular units determined to be inner geometry to eliminate intersections and obtain aligned triangular units, including: The method employs an alignment-based repair strategy, aligning the triangular units determined to be outer geometry within the self-intersecting triangular unit pair to the triangular units determined to be inner geometry, including: The triangular element determined as the outer geometry in the self-intersecting triangular element pair is identified as the outer triangular element; Project the vertices of the inner triangular units of the self-intersecting triangular units onto the plane containing the outer triangular units to obtain the projection points; When the projection point is located inside the outer triangular unit, an alignment operation is performed based on the distance relationship between the projection point and the existing vertices of the outer triangular unit to obtain the aligned outer triangular unit.
8. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 6, characterized in that, The refinement-based repair strategy involves simultaneously refining the two triangular units in the self-intersecting triangular unit pair, and projecting the newly generated vertices onto their respective continuous geometry to eliminate intersections, resulting in refined triangular units. This includes: Simultaneously perform the longest side midpoint insertion operation on the two triangular elements in the self-intersecting triangular element pair to obtain the triangular element after insertion. The newly inserted vertices are projected onto their respective continuous geometry to obtain the refined triangular units.
9. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 1, characterized in that, The step of performing local mesh quality optimization on the repaired triangular mesh to obtain an optimized triangular mesh includes: The local regions affected by the local repair operation in the repaired triangular mesh are identified to obtain the local regions to be optimized. Perform at least one of the following operations on the triangular units in the local region: edge flipping, vertex smoothing, and edge folding, to eliminate degenerate units and free edges introduced during the repair process, and obtain an optimized triangular mesh.
10. The method for repairing self-intersecting triangular meshes based on aligned neighboring surfaces according to claim 1, characterized in that, The process of outputting the current triangular mesh as the repaired triangular mesh until no self-intersection defects are found includes: When the self-intersecting test is re-performed and it is determined that there are no self-intersecting triangular element pairs, the result of the self-intersecting defect being eliminated is obtained. Based on the detection results, the current triangular mesh is output as the repaired triangular mesh.
Citation Information
Patent Citations
Rapid local repair method for self-intersecting triangular mesh
CN120163954A
Boundary-maintained thin-wall structure curved surface triangular mesh alignment method
CN121437804A