TL;DR
Converting CAD models into clean triangle meshes is notoriously fragile because geometric approximations often conflict with the model's underlying topology. This paper introduces a "topology-first" meshing approach that treats the model's topological structure as an absolute invariant. By decoupling topological correctness from geometric accuracy, the algorithm guarantees a valid, watertight mesh for any user-defined tolerance level.
What Problem Does This Paper Address?
In computer-aided design (CAD), shapes are typically stored as Boundary Representations (B-Reps). A B-Rep combines two things: topology (the logical graph of how vertices, edges, and faces connect) and geometry (the actual 3D mathematical curves and surfaces).
The fundamental headache of CAD meshing is that these two components are often inconsistent. When a CAD kernel calculates where two complex surfaces intersect, it has to approximate the result using lower-order curves. To make matters worse, these curves are duplicated: they are represented both as a 3D curve and as 2D "trimming curves" projected onto each surface's parametric domain.
As a result, numerical round-off and approximation errors cause tiny gaps, overlaps, or self-intersecting loops in the 2D trims. Traditional meshing tools try to fix these issues after the fact using heuristic "healing" or stitching strategies, which frequently fail, crash, or produce non-manifold meshes on complex real-world models.
Methods
Instead of trying to repair geometric flaws post-hoc, the authors treat the B-Rep topology as a rigid, discrete skeleton that must be preserved. Crucially, they completely ignore the error-prone 2D trimming curves. Instead, they trim the parametric patches by tracing the boundary curves directly in 3D.
The pipeline operates in five distinct stages:
- Sampling: Independently discretize every curve into a polyline and every surface into a dense triangle mesh based on a user-defined tolerance ($\epsilon$).
- Curve Snapping: Snap the endpoints of the sampled 3D curves precisely to their corresponding topological vertices, using 1D Laplacian smoothing to distribute the displacement error smoothly.
- Loop Embedding: Project and trace the 3D curves onto the 3D surface mesh using a modified Dijkstra’s shortest-path algorithm. This cuts the surface mesh into clean topological disks.
- Stitching: Align the boundaries of adjacent surface patches and stitch them together, ensuring that shared edges have identical, conforming discretizations.
- Remeshing: Apply a topology-preserving isotropic remeshing step to improve triangle quality while strictly forbidding any edge swaps or collapses that would alter the original B-Rep structure.
Datasets
The method was evaluated using the ABS dataset, which provides a clean, one-to-one conversion of STEP files into an HDF5 format. The underlying CAD models come from two massive, real-world repositories:
- ABC Dataset: Models sourced from OnShape, utilizing the Parasolid CAD kernel.
- Fusion 360 Dataset: Models generated using Autodesk's proprietary CAD kernel.
In total, the authors tested their pipeline on over 10,000 distinct models.
Key Insights and Ideas
- Topology as an Invariant: The core "aha" moment is that if you enforce topology at the algorithmic level, geometric approximation becomes a safe dial to turn. A larger tolerance will produce a coarser, less accurate mesh, but it will never break the connectivity or cause the mesh to fail.
- Ditching the 2D Parametric Domain: The authors discovered that roughly 14% of trimming curves in the Fusion 360 dataset contain self-intersections when evaluated in the 2D parametric space. Tracing directly on the 3D mesh completely sidesteps this messy, error-prone parameterization inversion.
Key Results
The algorithm demonstrated remarkable robustness compared to industry-standard open-source tools like OpenCascade (OCC), Gmsh, NetGen, and Mefisto:
- Robustness: Out of over 10,000 models, the topology-first method successfully generated valid meshes for all of them. Only about 3% failed to complete within an 8-hour limit due to hardware resource constraints (memory/timeout), rather than algorithmic breakdown.
- Comparison: On highly complex models (such as a coffee grinder or an articulated lamp), standard tools frequently missed features, ran out of memory, or crashed entirely. The proposed method handled them seamlessly across coarse, default, and fine resolutions.
- Downstream Readiness: Because the output meshes strictly preserve face identifiers and adjacencies, they can be fed directly into tetrahedral mesh generators (like TetGen) for finite element analysis (FEA) without any manual cleanup.
Limitations and Future Work
While the method guarantees topological perfection, it only offers "best-effort" geometric preservation. If the input CAD geometry is severely distorted or ill-posed, the output mesh will still be topologically valid, but its geometric quality might be poor.
Additionally, if the input B-Rep topology itself is pathological or broken, the algorithm will faithfully reproduce those exact flaws rather than fixing them.
For future work, the authors suggest exploring how these topology-first principles could be integrated directly back into CAD kernels to improve the initial generation of surface intersections and trims.
Summary updated