## 2 Related Work
### Primitive Fitting  
Fitting primitives from unstructured 3D data holds significant industrial applications [9] and has garnered considerable attention in computer-aided design research, especially within the realm of reverse engineering [10]. Previous studies have concentrated on segmenting input data--such as point clouds or triangular meshes--into regions and subsequently matching them with geometric primitives characterized by diverse types and parameters, with a focus on numerical optimization.  
Early methodologies incorporated probabilistic search techniques such as RANSAC [11] or variational optimization methods [12; 13] that iterated between primitive fitting and segmentation to accurately match primitive surface patches to input shapes represented as point clouds or triangular meshes. Subsequently, global optimization with structural constraints was applied to enhance local primitive fitting and ensure overall consistency [14; 15; 16]. [PERSON] et al. [17] introduced a methodology for fitting primitives from multi-view 3D point clouds. Rather than determining the geometric primitive type in each segmented patch, the authors employed various approximation tests to fit a parameterized geometric primitive. The accuracy of edges plays a pivotal role in the efficacy of this method, which produces intriguing outcomes when applied to dense 3D meshes with edges aligned well with the continuous boundaries of the actual object. [PERSON] et al. [18] introduced a robust method utilizing the Hough transform to recognize geometric primitives within 3D point clouds of mechanical CAD objects. The proposed approach effectively handles noise and outliers by detecting the primitives present in the point cloud and determining the optimal geometric parameters associated with them.  
In recent years, the emergence of machine learning has led to the adoption of more advanced techniques utilizing neural networks for learning data-driven priors. Convolutional neural networks (CNNs) have become common machine learning models in computer graphics, applied for identifying primitives and parameters from discrete datasets like point clouds and triangular meshes. CNN-based methods typically begin by classifyinginput points as potential segment anchors and then consolidating these classified points into groups through clustering and searching procedures. [PERSON] et al. (2019), [PERSON] et al. (2020), [PERSON] et al. (2018), and [PERSON] et al. (2022) trained point-based CNNs to allocate patch primitive types and parameters to each input point, effectively addressing segmentation and fitting challenges. This was accomplished by training on extensively annotated CAD datasets.  
The existing literature on primitive fitting primarily focuses on fitting basic geometric shapes, such as planes, cylinders, spheres, and cones, to point cloud data or mesh surfaces. Common techniques include least squares fitting, RANSAC algorithms, and hybrid approaches. Despite their widespread use, these methods frequently encounter several issues: high sensitivity to noise and outliers, difficulties handling complex geometries with intersecting primitives and intricate surface details, inefficiencies in processing large datasets, and the necessity for significant user intervention to guide the fitting process.  
Our proposed computational paradigm addresses these issues by employing a robust numerical optimization approach that minimizes sensitivity to noise and outliers, ensuring more accurate fitting of primitives. The unified mathematical framework we introduce can handle various primitive types, simplifying the process for complex geometries. Additionally, our method is designed to efficiently process large datasets with minimal computational overhead and reduces the need for user intervention by automating the extraction of cross-sectional sketches and feature paths from segmented mesh surfaces.