# 模型修复

模型修复是几何处理与计算机图形学中的一类算法，用于检测并修复网格模型与CAD模型中的孔洞、缝隙、自相交、退化元素及非流形构型等缺陷。缺陷有其特征性来源。激光扫描仪无法捕获被遮挡区域，从而留下孔洞；镶嵌后的CAD面片存在微小位移，从而留下缝隙；而多面片镶嵌、形变或部件的粗心组合则会产生自相交。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup> 综述文献将修复算法分为两类：直接编辑多边形的基于网格的方法，以及通过中间体素网格进行修复的基于体的方法。<sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 缺陷分类 | 孔洞（闭合边界环内部的缺失表面）与缝隙（面片之间边界链不连通的无面区域）相区分；其他目标包括自相交、退化面、非流形边与顶点，以及翻转的法向。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup> |
| 两大方法族 | 基于网格的方法直接在多边形上修正错误；基于体的方法通过体素网格间接修复。<sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> |
| 鲁棒性–保真度权衡 | 基于体的输出是流形且无自相交的，但呈“团块状”，丢失尖锐的角、边以及原始镶嵌结构。<sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> |
| 补洞复杂度 | 动态规划三角剖分的运行时间为 \( O(n^{3}) \)；将搜索范围缩小到边界顶点的三维Delaunay三角剖分，在多数情况下可降至 \( O(n \log n) \)；CGAL基准测试使用了边界顶点数为963和7657的孔洞。<sup>[3](https://doc.cgal.org/latest/PMP_Mesh_repair/index.html)</sup> |
| 体素规模 | 一种混合八叉树修复方法在2 GB内存的个人计算机上可达到高达 \( 4096^{3} \) 的体素分辨率，对于中等复杂度的物体只需几分钟。<sup>[4](https://dl.acm.org/doi/10.1145/1095878.1095883)</sup> |
| 工具保证 | MeshFix将单个闭合实体转换为一个水密三角网格，消除奇点、自相交和退化元素，同时保持无缺陷区域不变。<sup>[5](https://github.com/MarcoAttene/MeshFix-V2.1/blob/master/README.txt)</sup> |
| 精确方法的可靠性 | 一条精确网格排列流水线在所测试的各项后置条件上，对10,000个真实世界网格的修复成功率达到100%。<sup>[6](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)</sup> |

## 工作原理

**缺陷通过廉价的组合与几何测试来发现。** 孔洞表现为边界边的闭合环，边界边即仅与一个面相关联的边。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup> 一条边若只有一个关联三角形则归类为边界边，恰好有两个则归类为2-连通边，多于两个则归类为奇异边；奇异边与奇异顶点标志着非流形构型。<sup>[7](https://iris.cnr.it/retrieve/4e1a2e69-5cea-4752-a123-99ffae308f9e/prod_392193-doc_184445.pdf)</sup> 当一个面的两个顶点位置重合或所有顶点共线时，该面计为退化面。<sup>[8](https://github.com/CGAL/cgal/blob/194cdcf5462fe0edcf6327ac6af532df29c439ca/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h)</sup> 自相交的检测相对容易，kd树使搜索变得高效，但由于固有的歧义和有限精度算术，解决自相交却很困难。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup><sup> • </sup><sup>[9](http://wscg.zcu.cz/wscg2007/Papers_2007/short/B79-full.pdf)</sup>

**由此引出两条修复原则。** 基于网格的方法仅在个别缺陷附近修改网格，保持表面其余部分不变；许多基于体的方法通过体素或距离场中间表示重建整个输入，以牺牲无瑕疵区域的精度换取鲁棒性，不过混合体素方法可以仅修复局部缺陷区域。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup> 综述文献建议将检测步骤与修正步骤明确分离，以便用户控制修复内容。<sup>[9](http://wscg.zcu.cz/wscg2007/Papers_2007/short/B79-full.pdf)</sup>

## 实现方式

**体素修复**将模型体素化，确定每个网格单元的内部/外部符号（通常通过有符号距离场），并用等值面方法重建表面，如Lorensen和Cline于1987年报告的移动立方体法。<sup>[10](https://doi.org/10.1145/37402.37422)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> 结果是无自相交的二维流形，但体素化既不修正位置错误的顶点，也不修正三角化错误的表面；它只是在等值面提取后将模型变为二维流形。<sup>[9](http://wscg.zcu.cz/wscg2007/Papers_2007/short/B79-full.pdf)</sup> 网格到体素的转换会丢失结构细节与连通性，增加数据冗余，并在高分辨率下变得内存开销巨大。<sup>[11](https://www.mdpi.com/2072-4292/14/2/289)</sup>

**基于表面的修复**分阶段填充每个孔洞：对边界环进行三角剖分，细化面片，并对其进行光顺以匹配周围形状与顶点密度。<sup>[12](https://diglib.eg.org/server/api/core/bitstreams/f7b15c83-bc9f-4286-9ec5-c81a02143f34/content)</sup> 寻找孔洞边界的流形、无相交三角剖分是NP难问题，因此实用方法采用以最小面积、最小距离或角度度量为指导的启发式方法，其中Barequet和Sharir的最小面积动态规划三角剖分被广泛采用。<sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup><sup> • </sup><sup>[13](https://doi.org/10.1016/0167-8396%2894%2900011-g)</sup> 面片之间的缝隙通过缝合成对的重复边界边来闭合，重叠的扫描面片通过拉链法合并，即移除重叠三角形，以另一个面片为界裁剪其中一个面片，并丢弃裁剪产生的细长碎片。<sup>[3](https://doc.cgal.org/latest/PMP_Mesh_repair/index.html)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> 实用经验法则：高度精细、特征丰富且仅有孤立缺陷的网格应局部修复以保留细节；存在多种缺陷类型的严重损坏网格则更适合全局修复。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup>

## 起源

该领域由若干前驱工作发展而来。Barequet和Sharir于1995年提出的动态规划方法通过对三维多边形进行最小权重三角剖分来填充多面体边界中的缝隙。<sup>[13](https://doi.org/10.1016/0167-8396%2894%2900011-g)</sup> Gueziec、Taubin、Lazarus和Hom于2001年的切割缝合工作将多边形集合转换为流形表面。<sup>[14](https://doi.org/10.1109/2945.928166)</sup> Liepa于2003年的补洞方法将最小面积三角剖分推广到包含细化与光顺的流程。<sup>[12](https://diglib.eg.org/server/api/core/bitstreams/f7b15c83-bc9f-4286-9ec5-c81a02143f34/content)</sup> Nooruddin和Turk（2003）将体素技术应用于简化与修复，Ju（2004）引入了基于八叉树的多边形模型鲁棒修复。<sup>[15](https://doi.org/10.1109/tvcg.2003.1196006)</sup><sup> • </sup><sup>[16](https://doi.org/10.1145/1015706.1015815)</sup> Bischoff、Pavic和Kobbelt于2005年的自动恢复方法仅在缺陷体素中重新生成网格部分。<sup>[4](https://dl.acm.org/doi/10.1145/1095878.1095883)</sup> Patel、Marcum和Remotigue（2006）研究了CAD模型拓扑的自动生成，Sagawa和Ikeuchi（2008）通过自适应分辨率下有符号距离场的符号翻转来填充孔洞。<sup>[17](https://doi.org/10.1002/fld.1166)</sup><sup> • </sup><sup>[18](https://doi.org/10.1109/tpami.2007.70726)</sup> Campen和Kobbelt（2010）引入了精确的基于平面的自相交解决方法，Attene于2010年的轻量级算法成为MeshFix，并于2014年扩展至直接修复自相交网格。<sup>[19](https://doi.org/10.1111/j.1467-8659.2009.01609.x)</sup><sup> • </sup><sup>[20](https://doi.org/10.1007/s00371-010-0416-3)</sup><sup> • </sup><sup>[21](https://doi.org/10.1016/j.gmod.2014.09.002)</sup> Zhou、Grinspun、Zorin和Jacobson于2016年的网格排列实现了精确实体修复。<sup>[6](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)</sup> 权威综述为Veleba和Felkel（2007）、Ju（2009）以及Attene、Campen和Kobbelt（2013）。<sup>[9](http://wscg.zcu.cz/wscg2007/Papers_2007/short/B79-full.pdf)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup><sup> • </sup><sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup>

## 变体

**补洞。** Liepa的流水线依次执行边界识别、三角剖分、细化和光顺；其 \( O(n^{3}) \) 的三角剖分意味着具有数百条边界边的孔洞需要数分钟而非数秒。<sup>[12](https://diglib.eg.org/server/api/core/bitstreams/f7b15c83-bc9f-4286-9ec5-c81a02143f34/content)</sup> CGAL将搜索范围缩小到边界顶点三维Delaunay三角剖分的面，先最小化最差二面角再最小化总面积，在多数情况下将运行时间降至 \( O(n \log n) \)。<sup>[3](https://doc.cgal.org/latest/PMP_Mesh_repair/index.html)</sup>

**体素与精确修复。** Ju的八叉树方法可鲁棒地修复多边形模型，<sup>[16](https://doi.org/10.1145/1015706.1015815)</sup> Bischoff及其同事的混合变体在体素网格内同时定位缝隙与相交，仅在缺陷体素中重新生成网格部分，在2 GB内存的个人计算机上对于中等复杂度物体可在几分钟内达到 \( 4096^{3} \) 体素。<sup>[4](https://dl.acm.org/doi/10.1145/1095878.1095883)</sup> Attene的MeshFix在400多个低质量数字化模型上测试无一失败（不保证收敛），计算高效，且相比同类算法以更少的三角形产生更精确的结果。<sup>[20](https://doi.org/10.1007/s00371-010-0416-3)</sup> 在精确性方面，Campen和Kobbelt将网格转换为基于平面的BSP表示，对不含真正退化面的闭合输入保证精确相交；网格排列对此进行了扩展，还能消除嵌套组件的歧义。<sup>[19](https://doi.org/10.1111/j.1467-8659.2009.01609.x)</sup><sup> • </sup><sup>[6](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)</sup>

**CAD修复。** 边界表示修复与网格修复不同：非法布尔运算结果源于虚假的相交边，可通过逐边局部自适应容差估计的集合推理来修正。<sup>[22](https://arxiv.org/pdf/2310.10351)</sup>

## 应用

**3D打印。** Attene的STL修复仅假设文件语法有效，将外壳拆分为实体部分和片状部分，并将片状组件增厚为薄实体。<sup>[7](https://iris.cnr.it/retrieve/4e1a2e69-5cea-4752-a123-99ffae308f9e/prod_392193-doc_184445.pdf)</sup> 一个注意事项：外壳计算会移除内部空腔，这在打印应包含空腔的模型时并不合适。<sup>[6](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)</sup> **扫描清理**使用补洞处理被遮挡区域，并使用拉链法合并重叠的部分扫描。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> 已发表的关于游戏或电影资产流水线以及有限元网格划分的案例研究尚属空白。

## 局限与替代方案

**失败模式与方法族相对应。** 体素采样用不规则三角化的倒角替代尖锐的边和角，造成走样和高 \( L_{\infty} \) 失真；扩展移动立方体和对偶轮廓等特征保持等值面提取仍无法精确再现所有几何特征，且原始镶嵌结构无法恢复。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> 依赖网格的体素修复可能产生难以处理的拓扑变化和几何偏差。<sup>[6](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)</sup> 在表面方法方面，某些三维多边形无法在不产生自相交的情况下进行三角剖分，对于具有数百条边的孔洞，动态规划填充变得极其耗时，而具有多个边界环且无可用示例的复杂孔洞仍未得到充分解决。<sup>[1](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)</sup><sup> • </sup><sup>[2](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)</sup> 流行工具都是近似性的：NetFABB用往往粗糙的新三角形修补开放边界，Meshmixer以近似为代价修复边界，Blender的3D Print Toolbox附加组件随Blender一同发布，提供网格检查、补洞以及“流形化”等修复选项，MeshLab和MeshFix迭代执行移除与修补，但不保证收敛或修复成功。<sup>[7](https://iris.cnr.it/retrieve/4e1a2e69-5cea-4752-a123-99ffae308f9e/prod_392193-doc_184445.pdf)</sup> 精确的基于平面的方法和网格排列方法能保持几何形状，但仅适用于包围实体的输入，不适用于开放网格。<sup>[7](https://iris.cnr.it/retrieve/4e1a2e69-5cea-4752-a123-99ffae308f9e/prod_392193-doc_184445.pdf)</sup> 输出质量通常以输入与输出表面之间的Hausdorff距离来衡量。<sup>[23](https://par.nsf.gov/servlets/purl/10293572)</sup>

**近期工作扩展了该领域。** 一项TVCG方法引入了基于光线追踪的视觉度量，用于评估可见性、朝向和开放度，修复缝隙、孔洞、自相交、退化元素和不一致朝向，同时保留UV坐标，并在ShapeNet和Thingi10K的数百个模型上进行了评估。<sup>[24](https://dl.acm.org/doi/10.1109/TVCG.2023.3348829)</sup> 在学习方面，MeshGPT（Siddiqui及其同事，2023）使用仅解码器Transformer生成三角网格，并展示了部分网格补全能力，但受限于对量化网格面令牌序列化序列的自回归推理。<sup>[25](https://doi.org/10.48550/arxiv.2311.15475)</sup>

## References

1. [Polygon Mesh Repairing: An Application Perspective (Attene, Campen, Kobbelt, ACM Computing Surveys 2013)](http://pers.ge.imati.cnr.it/attene/PersonalPage/pdf/survey_meshrepair.pdf)
2. [Fixing Geometric Errors on Polygonal Models: A Survey (Ju, JCST 2009)](https://jcst.ict.ac.cn/en/article/pdf/preview/1508.pdf)
3. [CGAL 6.2 - Polygon Mesh Repair: User Manual](https://doc.cgal.org/latest/PMP_Mesh_repair/index.html)
4. [Automatic restoration of polygon models (Bischoff, Pavic, Kobbelt, ACM TOG 2005)](https://dl.acm.org/doi/10.1145/1095878.1095883)
5. [MeshFix V2.1 README (Marco Attene, IMATI-GE / CNR)](https://github.com/MarcoAttene/MeshFix-V2.1/blob/master/README.txt)
6. [Mesh Arrangements for Solid Geometry (Zhou, Grinspun, Zorin, and Jacobson, SIGGRAPH 2016)](https://www.cs.columbia.edu/cg/mesh-arrangements/mesh-arrangements-for-solid-geometry-siggraph-2016-zhou-et-al.pdf)
7. [As-exact-as-possible repair of unprintable STL files (Attene)](https://iris.cnr.it/retrieve/4e1a2e69-5cea-4752-a123-99ffae308f9e/prod_392193-doc_184445.pdf)
8. [CGAL Polygon_mesh_processing/repair.h source](https://github.com/CGAL/cgal/blob/194cdcf5462fe0edcf6327ac6af532df29c439ca/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair.h)
9. [Survey of errors in surface representation and their detection and correction (Veleba & Felkel, WSCG 2007)](http://wscg.zcu.cz/wscg2007/Papers_2007/short/B79-full.pdf)
10. [William E. Lorensen, Harvey E. Cline (1987). Marching cubes: A high resolution 3D surface construction algorithm. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/37402.37422)
11. [LIMOFilling: Local Information Guide Hole-Filling and Sharp Feature Recovery for Manifold Meshes (Remote Sensing, 2022)](https://www.mdpi.com/2072-4292/14/2/289)
12. [Filling holes in meshes (Liepa, Symposium on Geometry Processing 2003)](https://diglib.eg.org/server/api/core/bitstreams/f7b15c83-bc9f-4286-9ec5-c81a02143f34/content)
13. [Filling gaps in the boundary of a polyhedron (Computer Aided Geometric Design, 1995)](https://doi.org/10.1016/0167-8396%2894%2900011-g)
14. [A. Gueziec and colleagues (2001). Cutting and stitching: converting sets of polygons to manifold surfaces. IEEE Transactions on Visualization and Computer Graphics.](https://doi.org/10.1109/2945.928166)
15. [F.S. Nooruddin, G. Turk (2003). Simplification and repair of polygonal models using volumetric techniques. IEEE Transactions on Visualization and Computer Graphics.](https://doi.org/10.1109/tvcg.2003.1196006)
16. [Tao Ju (2004). Robust repair of polygonal models. ACM Transactions on Graphics.](https://doi.org/10.1145/1015706.1015815)
17. [Paresh S. Patel, David L. Marcum, Michael G. Remotigue (2006). Automatic CAD model topology generation. International Journal for Numerical Methods in Fluids.](https://doi.org/10.1002/fld.1166)
18. [Ryusuke Sagawa, Katsushi Ikeuchi (2008). Hole Filling of a 3D Model by Flipping Signs of a Signed Distance Field in Adaptive Resolution. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/tpami.2007.70726)
19. [Marcel Campen, Leif Kobbelt (2010). Exact and Robust (Self‐)Intersections for Polygonal Meshes. Computer Graphics Forum.](https://doi.org/10.1111/j.1467-8659.2009.01609.x)
20. [Marco Attene (2010). A lightweight approach to repairing digitized polygon meshes. The Visual Computer.](https://doi.org/10.1007/s00371-010-0416-3)
21. [Marco Attene (2014). Direct repair of self-intersecting meshes. Graphical Models.](https://doi.org/10.1016/j.gmod.2014.09.002)
22. [Automatic repair of flawed boolean resulting models in CAD kernels (2023)](https://arxiv.org/pdf/2310.10351)
23. [Surface Remeshing: A Systematic Literature Review of Methods and Research Directions](https://par.nsf.gov/servlets/purl/10293572)
24. [Visual-Preserving Mesh Repair (IEEE TVCG)](https://dl.acm.org/doi/10.1109/TVCG.2023.3348829)
25. [Siddiqui, Yawar and colleagues (2023). MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2311.15475)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Numerical, string, and geometric algorithms › Computational geometry

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/model-repair

English original: https://www.edgepedia.org/model-repair
