Keywords

1 Introduction

Digital resources are nowadays fundamental in practically every aspect of human life. The possibility of easily sharing information, as well as the ability of executing complicated calculations, have made numerical models essential in all technical sciences. Computer Aided Design (CAD) models, in particular, provide a 3D digital description of an object’s geometry. These are widely employed in practically every engineering field and they are among the most used tools by designers and engineers.

When the original CAD model of an object is not available, different techniques can be used to produce a valid substitute. In this context, Reverse Engineering (RE) aims at the reconstruction of a 3D digital model (i.e. CAD model) using information extracted from a physical object. This process, also called “CAD reconstruction”, starts with measurements performed on the object. Depending on the object dimensions, the required accuracy and the type of hardware and software tools available to the reverse engineer, different techniques can be used to extract and process the required data.

This paper deals with the reconstruction of CAD models starting from 3D measured data and focuses, specifically, with the problem of retrieving CAD models of mechanical parts. Taking into consideration engineering applications, RE aims at reconstructing a parametric CAD model that is as close as possible to the original design of the part. The correct functioning of mechanical parts normally relies on a subset of functional geometric features; the geometry of these features is usually regulated by dimensions and geometric constraints. During the production phase, the precise manufacturing of functional features is essential to transfer the designer’s intentions to the physical part; analogously, during the RE process, the functional surfaces must be accurately acquired and reconstructed to retrieve the original design intent. Specifically, it is important to achieve not only the correct retrieval of dimensions, but also of the geometric relations and of the modelling combinatorial structure defining the shape of the object (i.e. feature tree). The retrieval of a parametric and associative description is generally sought due to the high versatility and applicability of the produced result; the feature tree, in fact, allows for fast and simple modifications to the retrieved geometry.

Several RE methods offer solutions to produce non-parametric models because their information structure is easier to handle and they do not rely on established CAD software as medium. Specifically, research has been generally oriented into developing automatic and semi-automatic solutions to reach this kind of result. However, hardly any solutions have been proposed that produce a high-quality result expressed in a parametric associative format. To this day, the only practical solution to obtain a parametric CAD model remains a RE process carried out within commercial RE-CAD software systems starting from 3D scanned data. Considering this hypothesis, the typical workflow is depicted in Fig. 1. The modelling step, where the parametric surfaces are created using the scanned data as reference, results to be the most influencing phase for the achievement of a satisfying result.

Fig. 1.
figure 1

RE workflow

Thanks to the development of commercial software systems, semi-automatic tools to perform every task depicted in Fig. 1 are nowadays available; the overall process, however, still remains tied to a human factor: a skilled user needs to guide the procedure across all phases. Indeed, the human intervention is essential to tune the procedure and, within the modelling step, to carefully select the reconstruction strategy (e.g. the order of operations to perform, which geometric relations to enforce, etc.). The importance of human contribution is further discussed in Sect. 2, in order to provide some perspective on the problems faced by reverse engineers.

Academic research, on the other hand, has been generally oriented towards the study of automatic procedures embracing the whole framework: these solutions, although interesting from a theoretical point of view, lack the required robustness, efficiency and reliability to be applied in real case scenarios. Moreover, they usually fail in producing parametric associative CAD models that can be easily handled and used in the CAD software of choice.

As a result, Fig. 1 represents the standard workflow that is adopted in practically every application. Although the industrial research has led to development of mature software tools, several bottlenecks and limitations could be improved. For the interested reader, a detailed analysis of the state of the art of RE software tools, focusing on the modelling step (Fig. 1) is provided in [1]. The present paper further expands the investigation of [1], providing an in-depth and hands-on description of the reverse modelling phase. Only through a detailed and practical description of the reverse modelling phase, presented in Sect. 3 following a reconstruction test case, it’s possible to identify the aspects that need to be addressed by researchers in the next future. Moreover, this work provides fresh insight into the strategies adopted to retrieve design intent and impose meaningful geometric relations during the reconstruction. It’s noteworthy, with this respect, that many key-aspects and details need an in-depth description, enriched by practical examples, to be fully appreciated by the reader. Evidently, this kind of perspective is not usually offered by most research papers due to length limitations; accordingly, this area still needs to be filled. Moreover, the software landscape is a fast-changing environment, which is constantly updated and improved with novel features and tools. Summing up, a practical description of reverse modelling carried out within RE software systems is required to contribute to a deeper understanding of CAD reconstruction.

2 Design Intent: The Human Factor

The 3D data measured on the object is not the only source of information available to determine its topology. Indeed, reference data is essential to infer original dimensions (e.g. lengths, angles); nevertheless, considering the retrieval of a modelling feature tree, it can be integrated by other sources. As explained in [2], the shapes of common mechanical parts “follow standard conventions arising from tradition, utility or engineering design”; accordingly, it may be convenient to acquire some information to improve the RE process. Useful cues to understand how a part was modelled in the first place can be extracted from multiple sources: (i) functioning of the object – known information on the performances required to the object; (e.g. the external surface of a piston is a cylinder, due to its function); (ii) fitting with other parts; (e.g. the features and surfaces defining a linear guide/slide are parallel; hence, they can be described by a single extrusion); (iii) manufacturing process, which can impose geometric constraints to guarantee the producibility of the part; similarly, typical defects induced by production processes can be taken into account and filtered out of the scanned data (e.g. part produced on the lathe are usually axial-symmetric, presence of draft angles in die-casting); (iv) existing know-how and information on the original design process of the object. (e.g. it is known that two planes on the object are orthogonal).

As an example, if the measured data were not “filtered” by considering the described aspects, manufacturing and wear-induced defects visible in the scanned data would always be included in the final reconstructed geometry. Moreover, some degree of human interpretation is advisable in order to prevent negative effects caused by incomplete data. Summing up, human intervention is required to guide the reconstruction process. The user contribution is essential for the reconstruction of an effective modelling tree and for a correct interpretation of the scanned data. These inputs cannot be easily integrated in an algorithm, as they are influenced by all the aspects previously described, which depend directly on an extended skill set, as well as on a critical analysis of the specific reconstruction.

On a more general level, every aspect of the user’ expertise can be useful for the retrieval of the original topology of a mechanical part. Specifically, the identification of the geometric constraints defining an object shape is a task that can be easily performed by a reverse engineer, while automatic algorithms can only provide a marginal contribution, since they lack direct knowledge of all the previously described aspects. This contribution is usually limited to the extraction and identification of geometric features within the segmented data [3] (i.e. classification step in Fig. 1). As Robert Fisher concludes in his discussion on knowledge-based reverse engineering [2], “Computers are good at data analysis and fitting; humans are good at recognizing and classifying patterns.”. Summing up, the human factor is an essential element in the interpretation of geometries.

3 Reverse Modelling

The use of dedicated RE software is the typical solution adopted for the reconstruction of mechanical parts. The efficiency and reliability of the tools hosted within such systems positively influence their application on a day-to-day basis. In this section, most limiting factors and general issues affecting even high-quality software systems are highlighted in order to pinpoint areas to be improved.

The dissertation closely follows the reconstruction of a CAD model of an Electrical Socket Adapter (ESA - Fig. 2(a)) to guide the reader. The chosen object can be enclosed in a bounding box of 55 × 45 × 35 mm and has been acquired by a 3D optical scanner (i.e. a Romer RS1 mounted on a 7520-SI absolute arm by Hexagon Metrology) to produce the mesh depicted in Fig. 2(b). The RS1 scanner is characterized by a volumetric accuracy of 30 µm [4]. The acquired data has been processed using standard procedures (data integration, smoothing, decimation). The reconstruction is performed within Geomagic Design X (GDX) 2016, a dedicated RE software that offer the most advanced features for the reconstruction of mechanical parts.

Fig. 2.
figure 2

(a) the ESA; (b) ESA 3D scanned data; (c) ESA classified regions.

Following the workflow of Fig. 1, the 3D data is first segmented into different regions; these are identified and isolated according to their geometrical properties. Depending on the specific tools offered by each software, segmentation usually leads to the direct identification of geometric features and primitives that are associated to the segmented regions (i.e. classification [3, 5]). The segmentation/classification result obtained in GDX can be tuned accordingly to a sensitivity and a smoothness parameter, which influence the size of the identified regions; the final result obtained for the ESA is depicted in Fig. 2(c).

Reverse modelling starts with a step that is usually not described in most dissertation on the topic: the information extracted in the classification step, together with other geometrical parameters obtained from the model, is used to orient the data in a convenient position to start the reconstruction. This choice is important, as it influences every downstream operation. Typical examples of geometric entities that are considered during this phase are symmetries, revolution axes, extrusion directions, plane faces, etc. GDX offers a dedicated tool able to compute a convenient data orientation: plausible alternatives to orient the data are suggested to the user, who performs the final choice. Alternatively, the user can extract a series of geometric elements (symmetry axes, significant points, planes, etc.) associated with the classified regions in order to produce a manual orientation of the model. The result obtained in the ESA case are visible in Fig. 3. The selected configuration is characterized by the x-axis parallel to: (i) the normal of the support plane and other planar features (e.g. top surface of the ESA), (ii) the revolution axis of the main cylindrical surface, (iii) the extrusion direction of extruded features. Moreover, symmetries and other geometric features contribute also to the identification of the translational component: the origin is placed at the centre of the object base, located along the main axis of symmetry. It’s important to note that, during the acquisition, the object was rigidly placed on a surface plate that has been acquired too; such planar surface, although not part of the object to be reconstructed, can be exploited as reference during the reconstruction.

Fig. 3.
figure 3

Initial alignment of the scanned data.

After data alignment, the user needs to devise an effective modelling strategy for the reconstruction of the specific part. Practically, a main geometric feature is usually selected by the user in order to start the modelling process. Such feature will serve as reference in all subsequent steps of the reconstruction chain. The whole process is controlled by the designer that, using a series of CAD-like functions, manually controls the reconstruction process. The actual modeling of the reconstructed object is achieved by applying CAD/RE tools capable of adapting mathematical surfaces upon the previously classified mesh data. Different categories of tools can be used, depending on the application and the desired result. For mechanical parts, a reconstruction process based on regular features is commonly the most applied strategy whenever allowed by the software. Conversely, freeform reconstruction tools, although often available, are used only when explicitly required by the presence of complex non-regular shapes within the object. On a practical level, the user selects one or more of the regions previously identified, decides which type of feature is best suited to reconstruct the surface and generates the mathematical surface using pre-built tools. These tools, as previously mentioned, provide the capability of building a geometrical feature tailored on a segmented/classified region or extracting information on its position and dimensions from the 3D data. Depending on the tool used, different options may be available to the user (e.g. acceptable deviation, number of iterations to be performed computing the final CAD surface, etc.).

Dealing with the ESA test case, the most convenient strategy would be to start with the reconstruction of the main body (i.e. the big purple cylinder in Fig. 2c). The reconstruction of wide surfaces in the first steps of the process is beneficial for the quality of the whole procedure; such areas are described by a large set of points, which accordingly hold the highest share of information on the object shape. Moreover, from a statistical perspective, the reconstruction of a surface performed on a large sample of points offers more reliable results.

The list of CAD operation performed for the ESA reconstruction is described in Table 1; most surfaces are reconstructed considering them as the result of an extrusion feature (i.e. surfaces described by a 2D profile translated along a direction). Once that a feature is reconstructed, following steps can exploit it as reference surface. Accordingly, the definition of the order of operations is an important element of the whole process: its structure determines the way geometric relations are established between features. Moreover, it should be built prioritizing most important regions and performing the same kind of choices that were previously described for the selection of the first feature.

Table 1. ESA reverse modeling operations.

All the surfaces are defined throughout various subsequent modeling steps, exploiting previously built features (e.g. 2D sketches) to generate a tree of relations between the geometric entities and always using the scanned data as reference. In advanced software all these relations are explicitly stored in a proper feature tree, which allows for later access and retrieval. As showed in Table 1, depending on the complexity of the model, several modelling steps are generally required to reach the desired result (Fig. 4).

Fig. 4.
figure 4

Result associated with the steps described in Table 1.

One of the most challenging aspects that the reverse engineer must face is the pursue of a correct balance between adherence to the scanned data and retrieval of original design intent. Acquired surfaces are affected by errors (acquisition, manufacturing). The original CAD model would have been flawless and characterized by dimensions that might be slightly different from those extrapolated by the scanned data.

Every time the engineer imposes a geometric relation (e.g. defining a surface as a cylinder, constraining the direction of a revolution axis, etc.) causes an increased deviation between CAD and reference surfaces. In other words, the “perfect” fit that would be obtained reconstructing a feature by pursuing only the minimization of point-to-point distances between the two objects is influenced by the introduction of additional aspects, hence changing an unconstrained minimization problem into a constrained one. As an example, let’s consider the reconstruction of a cylinder from a single tessellated surface acquired by a 3D scanner (Fig. 5). The imposition of an orthogonality relationship between the revolution axis of the cylinder and a given plane heavily modifies the shape of the reconstructed surface, introducing significant differences w.r.t. the original shape (Fig. 5(b)).

Fig. 5.
figure 5

Cylinder reconstruction performed in GDX; (a) original mesh; (b) cylinder reconstructed by minimizing the deviation error; (c) cylinder reconstructed as in (b) and imposing the orthogonality between the cylinder revolution axis and a given plane; (d) the two reconstructed cylinders: blue cylinder is (b) and grey is (c); (e) deviation map of cylinder (b); (f) deviation map of cylinder (c) (cylinder diameter: 25 mm, plane inclined by 1° w.r.t. the original extrusion)

Fig. 6.
figure 6

ESA feature tree and Reverse Modeling tree

Evidently, the reconstruction error w.r.t. the reference data (Fig. 5(f)) is made worse with the introduction of a geometric constraint. Although a constraint-free reconstruction could guarantee the minimum deviation error w.r.t. the scanned data, depending on the knowledge on the geometry that the reverse engineer has, this effect might be desired. Recalling the previous example, the orthogonality between the cylinder axis and the given plane could be known for sure a priori. This can happen also in real-case scenarios; the deviation from the reference data induced by the imposition of inferred or known constraints might be dimensionally minor, but nonetheless present. To reiterate, the progressive introduction of geometric relations guides last generated features away from the reference data.

The same phenomenon can be observed in the ESA test case. Specifically, the deviation map in Fig. 7 shows an error that is not evenly distributed on the surface of the pins – i.e. a map of local errors – rather a macroscopic error gradient that develops on the vertical surface of the pins. The effect is accentuated by the fact that the features of Fig. 7 are the last created within the ESA. As a result, the errors observed in the deviation map are influenced by all the geometric constraints introduced throughout the entire reconstruction (not only by the constraints directly imposed on the geometry of the pins). To reiterate, all the reconstruction choices heavily influence the last reconstruction phases. It’s usually at the end of the reconstruction, as a result, that the user becomes aware of possible mistakes made during the process.

Fig. 7.
figure 7

Reconstruction errors on the two pins. (a) reconstructed solid in grey and reference mesh in red; (b) deviation map of the obtained result.

The establishment of this error chain should be taken into consideration from the early stages of reconstruction, when drafting a reconstruction strategy and especially defining the order of operations. Once that the relations between the segmented and classified features are defined, a relation graph between features (e.g. Fig. 6) can be built. This type of graph, typical of many CAD applications (e.g. [6, 7]) is useful to plan the reconstruction, as the user should minimize the length of the relation chains. The first feature chosen to start the reconstruction, marked in green in Fig. 6, is reconstructed without any additional error ascribable to previous steps. Following steps are, on the other hand, affected by a chain of errors that depend on previous features. Accordingly, the features that depend directly on the first one (i.e. level 2, coloured in yellow in Fig. 6) are affected by the first level. The third level (coloured in red in Fig. 6) is even more affected by the chain of errors. It’s important to note that the choice of the first feature determines the creation of the coloured graph of Fig. 6. In other words, a valid strategy is able to minimize the length of the chains and the effects caused by the error build-up.

In order to amend these observed defects of the procedure, some kind of global error evaluation is needed. At the moment, in fact, each CAD feature is generated and adapted to the scanned surface considering only the deviation data computed on the considered feature and the corresponding segmented region. Consequently, whenever geometric constraints are introduced in the scenario, the minimization of the deviation error for a feature could impose significant errors in other areas of the model. A possible reverse engineering approach, implementing this philosophy through the fitting of a CAD template to scanned data, is described in [8].

All the above described problems are accentuated by the fact that bad choices made during the process are usually not easily amendable in a RE software. Reconstruction mistakes become evident usually towards the end of the reconstruction process, modeling the last features (i.e. the most affected by the bad choices of the reverse engineer). Sadly, the typical RE modeling environment does not allow an efficient and convenient way of modifying the reconstructed geometry; this is one of the major differences w.r.t. traditional CAD software.

In CAD software, a set of parametric and associative functions allow for a fast and dynamic editing of the modelled part. The modeling tree defining the geometry of the part can be edited in every aspect (e.g. changing a dimension, enforcing a geometric relation, varying a parameter of a 3D modeling feature, etc.) and the geometry of the object is updated according to the user’ input. As an example, the user would be able to change the diameter of a sphere freely, obtaining a sphere of different dimension.

RE software systems, on the other hand, do not entirely guarantee this kind of parametric/associative relations, at least not w.r.t mesh-based operations. As previously discussed, RE tools generate a CAD surface by adapting it upon a segmented region of the reference data. To the best of the authors’ knowledge, no RE software package guarantees an associativity relationship between CAD features and corresponding segmented mesh regions. As a result, modifications to the modeling history of the reconstructed CAD model do not involve a new evaluation of the mesh-derived feature parameters. Therefore, if users need to perform some changes to the modeling tree describing the shape of the object, they may obtain CAD features whose parameters (i.e. dimensions, position) are not correct with respect to the reference mesh. This concept is well described by the example in Fig. 8, where the reconstruction of a cylinder is depicted. In the example, the CAD feature is generated by means of an extrusion performed on a 2D sketch extracted from the original mesh. The 2D mesh-based sketch is obtained by cutting the mesh with a plane. Any change to the plane position/orientation is not reflected upon the sketch, resulting in a misinterpreted geometry within the following 3D modeling feature.

Fig. 8.
figure 8

Reconstruction of a cylinder: CAD cylinder (grey) obtained from a mesh-based 2D sketch that depends on a section plane (green). Position and orientation of the cutting plane is updated in (b). The 2D mesh sketch obtained (blue line) is not updated but only translated in (b).

Therefore, it is evident that any change to the feature tree, especially when performed at the end of the reconstruction process, may result in a significant error. Depending on the modifications made to the feature tree, a CAD model that is completely unrelated to the scanned data might be generated. Whenever the errors are macroscopic and evident, the user can correct the geometry, even if not efficientlyFootnote 1. With this respect, the only applicable solution for the reverse engineer is represented by a complete remake of the whole procedure. In this case, the user can start the reconstruction again, learning from the mistakes previously made and trying to attain a better result.

4 Conclusions

Many negative aspects, described in the article and clearly highlighted in the discussed case study, can be identified within the typical reconstruction framework, even when it is hosted in a dedicated RE software package. Firstly, a competent user, highly skilled in the use of the software environment and capable of choosing the most appropriate “reverse modeling” strategy, is fundamental. The consolidation and honing of these skills can be achieved only through experience, at the cost of numerous hours of practice on RE software. Secondly, the overall process is time consuming and, being manually controlled by the user, requires their physical presence during the entire operation. Specifically, depending on the complexity of the model to be reconstructed and the tools available, several hours (occasionally days) can be required to obtain a valid result.

Finally, it is important to consider the effects caused by uncertainties in this specific framework. Obviously, the presence of reconstruction errors is physiological in every reconstruction process. Both the manufacturing and the 3D scanning phases introduce errors in the reference data. However, the human factor must be also taken into account: in the “traditional” framework, the user needs to make several choices throughout the procedure. Which CAD/RE tools to use, which reconstruction strategy to follow, the type of geometric features to use in the model, are all examples of variables controlled by the reverse engineer. In other words, the user needs to interpret the original design intent of the part and to try to use the tools available to produce a digital model that reflects his interpretation. Due to the temporal succession of the modelling steps (Fig. 2), however, all the wrong modelling choices, together with the noise affecting the reference data, cause the generation of an error that builds up during the reconstruction chain. Therefore, last features generated and modelled tend to be distanced from the corresponding reference data. Consequently, the correct retrieval of dimensions and other parameters is, progressively, significantly hindered. These negative effects are exacerbated by the introduction of geometric constraints during the reconstruction. The introduction of such relations is necessary to produce a CAD model that is faithful to the original design intent of the part. Nevertheless, the introduction of any additional constraint in the reconstruction process inevitably guides the generated mathematical surfaces and features away from the reference data.

Finally, the lack of associativity w.r.t. the reference mesh is often responsible for an inefficient reconstruction that hinders the generation of more accurate and high-quality reconstructed models.