Next Article in Journal
Special Issue Editorial “Blockchain-Enabled Technology for IoT Security, Privacy and Trust”
Previous Article in Journal
JKRL: Joint Knowledge Representation Learning of Text Description and Knowledge Graph
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Framework for Detection of Exact Global and Partial Symmetry in 3D CAD Models

1
Faculty of Mechanical Engineering and Naval Architecture, University of Zagreb, Ivana Lucica 5, 10002 Zagreb, Croatia
2
Department of Mathematics, Faculty of Science, University of Zagreb, Bijenicka cesta 30, 10000 Zagreb, Croatia
*
Author to whom correspondence should be addressed.
Symmetry 2023, 15(5), 1058; https://doi.org/10.3390/sym15051058
Submission received: 30 March 2023 / Revised: 27 April 2023 / Accepted: 30 April 2023 / Published: 10 May 2023
(This article belongs to the Section Engineering and Materials)

Abstract

:
The most common way to retrieve symmetry information (i.e., the planes and axes of symmetry) in 3D CAD models is through visual recognition by engineers. However, engineers are not able to visually recognize exact symmetry in any CAD model, and their ability to recognize symmetry decreases as the number of CAD models increases. To overcome these limitations, computer-aided symmetry detection is employed, which enables the (semi)automatic extraction of the symmetry information in CAD models. Hence, the present paper introduces a symmetry detection framework for 3D CAD models with boundary representation. The novelty of this research was that it addressed the detection of exact and partial axi- and reflectional symmetry in CAD models with analytic and numeric surfaces. Further, symmetry measures were proposed to differentiate exact, partial, or non-symmetry in the CAD model. The framework was implemented into a state-of-the-art CAD system and subjected to performance and time complexity validation. The results showed that the implemented framework’s performance was 0.94 F1-score, and the time complexity was linear with respect to the number of faces in the CAD model. Hence, it was concluded that the framework is suitable for industrial applications to support engineers in symmetry detection.

1. Introduction

Symmetry is an important geometric property often exploited in mechanical engineering. It is useful in engineering drawing [1] and design [2], manufacturing [3], engineering simulation [4], knowledge discovery [5,6], vibration analysis [7], assembly [8], robotics [9], and so on. In engineering design, the existence or lack of symmetry in parts or assemblies can be an important factor to consider during computer-aided design (CAD). Designing parts and (sub)assemblies symmetrically can simplify the three-dimensional (3D) modeling process by reducing the complexity and number of individual parts or simplify the assembly process and reduce assembly errors [8]. For instance, the number of individual parts in the assembly CAD model can be reduced by replacing mirrored parts with one symmetrical part [2]. Designing a part with multiple reflectional symmetries usually results in shortened handling times and can also reduce the possibility of assembly errors caused by incorrect part orientation [10]. The design engineer may need to verify if the CAD model is exactly symmetrical and, thus, the design intent is met. In finite element analysis, the symmetry of the CAD model can be exploited to idealize the model and reduce its mesh size, which can considerably shorten the simulation run-time [4]. Hence, the extraction of the symmetry information (i.e., of the planes, axes, or points of symmetry) from 3D CAD models is of vital importance, not only during CAD but also in many downstream activities such as computer-aided engineering (CAE), computer-aided process planning (CAPP), computer-aided manufacturing (CAM), etc. However, the symmetry information is seldom directly stored in native CAD models and never in the neutral exchange file formats (e.g., STEP, IGS, Parasolid, etc.). For that purpose, computer-aided symmetry detection (CASD) is employed, which enables the (semi)automatic extraction of the symmetry information using the 3D CAD model as input or any other 3D or 2D digital object.
In terms of mathematics, an object is symmetrical if it is invariant under geometric transformations such as reflection, rotation, translation, or combinations of these [11] (e.g., dihedral symmetry is a combination of reflectional and rotational symmetry [12]). Symmetry can be exact (perfect) or approximate (imperfect). Those two types of symmetry are distinguished based on the distance function d(M,T(M)), which measures the distance between the shape M and its transformation T(M) [13]. The distance function is evaluated within a specific tolerance ε, such that d(M,T(M)) < ε. When ε ≅ 0 then the CASD is considered exact, otherwise approximate. For engineering applications, detecting exact symmetry in mechanical parts needs to be at least within the manufacturing accuracy [3], i.e., ε = 10−6.
Mechanical parts exhibit either global, partial, or local symmetry. Global symmetry implies that the whole part is symmetrical. Partial symmetry denotes that the whole part is nearly symmetrical, but the existence of additional geometrical features corrupts that symmetry [8]. Local symmetry refers to the case when certain portions of the part are symmetrical. Several basic types of symmetry are common in mechanical parts (Figure 1) [5,6]: reflectional (mirror or bilateral), rotational (axisymmetry and cyclic symmetry), and translational (repetitive) symmetry. Reflectional symmetry implies that the part is invariant under mirroring about a plane. Axisymmetry and cyclic symmetry are two types of rotational symmetry. Axisymmetry denotes that the part is invariant under all rotations about a central axis. Cyclic symmetric parts are invariant under rotation about a central axis by an angle of 360°/N, where N is the number of repeats at angular intervals. Translational symmetric parts are invariant under sliding in some direction. In addition to the basic types of symmetry, mechanical parts may exhibit more than one type of symmetry. For instance, a mechanical part can be simultaneously reflectional and cyclic symmetric (Figure 1c).
The most common way to retrieve symmetry information in mechanical parts is through visual recognition by engineers [14,15]. As the number of 3D CAD models increases, the ability of engineers to visually recognize symmetry decreases. In addition, exact symmetry cannot be detected by visual recognition in any CAD model [16]. Therefore, to support engineers, the present study proposes a framework to automate the detection of exact and partial reflectional and axisymmetry by identifying the planes and axes of symmetry in the 3D CAD models.

1.1. Computer-Aided Symmetry Detection

CASD has been the subject in different research fields, such as mathematics [17], mechanical engineering [8], computer engineering [18], civil engineering [19], medicine [20], etc. When it comes to mechanical engineering, CASD has been explored for retrieval [21], compression [22], and alignment [23,24] of 3D CAD models, finite element analysis [4], design for assembly [8], and in reverse engineering for detection of design intent in scanned 3D CAD models [25].
CASD techniques can be classified based on different criteria: input, accuracy, scale, and distance metrics. The input data for symmetry detection are either continuous [3,8,11] or discrete [26,27,28,29]. In terms of accuracy, the outcome of symmetry detection may be exact [3,8,11] or approximate [26,27,28,29] symmetry. If the input is continuous, the expected outcome of the symmetry detection is exact symmetry. On the other hand, if the input is discrete, the expected outcome of CASD is approximate symmetry. The common input models for CASD are solid 3D CAD models [3,8,11], cable-strut structures [12,30], voxel models [28], NURBS models [21,24], point clouds [29,31,32], and mesh models [33], etc. Most CASD techniques require complete input models [3,11,12,14,18,26,27,28,30,32], while some can handle incomplete input models [25,29,31,32]. Some CASD techniques use the initial input models for further processing and conversion. For example, mesh models may be converted into point clouds [32] or voxel models [28], or the 3D model is transformed into a 2D representation, such as an image [26] or a projected view [34]. In regards to the scale, the CASD techniques address the recognition of global [3,8,11,26,27,28,29], partial [4,8], and local [3,11,25] symmetry. From the perspective of distance metrics, symmetry detection techniques are divided into extrinsic [3,8,11,26] and intrinsic [20,27,28]. Extrinsic symmetry most often uses Euclidean distance between points to measure the symmetry, while intrinsic symmetry is measured by different metrics such as geodesic [27]. The CASD techniques related to 3D objects are focused on recognizing reflectional [3,8,11,26,27,28,29,30], axisymmetry [3,4,11], cyclic [4,11], translational [11,25], and dihedral symmetry [30], etc. The subject of this study is the detection of exact global and partial axi- and reflectional symmetry in solid 3D CAD models.

1.2. Planes and Axes of Symmetry Candidates

The common strategy for many CASD techniques [3,8,11,12,14,15,29,30,31,33,34] is to first generate a set of candidates for the planes of symmetry and/or the axis of symmetry from the given input model. The candidates are, for instance, obtained by principal component analysis [14,15,27], pair matching [8,11,35], incremental rotations around the centroid/center of mass [12,30], from the intrinsic surface properties [3,36], etc. Some of the proposed techniques [12,14,30] are constrained to only detect candidates that pass through a reference point (e.g., origin, centroid, or center of mass), which is, however, only suitable for objects exhibiting exact symmetry [11]. As a result of the candidate generation process, there may be several identical planes and axes in existence. Therefore, eliminating duplicates may further reduce the number of candidates [8,29]. In the second step, the generated candidates are assessed to identify the possible existence of the actual planes and/or axes of symmetry among them. The assessment of the candidates includes searching for the optimal among them [3,8,11] or evaluating each candidate with respect to the input model’s geometry [12,14,15,30]. A large number of planes and axes of symmetry candidates can lead to a time-consuming computation [29], limiting them in practical application. Hence, the goal is to reduce the number of candidates as much as possible without misdetection of the actual planes and axes of symmetry.

1.3. Symmetry Detections in 3D CAD Models

The early work on CASD in CAD focused on detecting the axis of symmetry in 2D polygons [37,38], which is not applicable to complex 3D CAD models in engineering design. The approaches are almost entirely focused on detecting exact symmetry [3,8,11,14,16,35,36,39,40] and rarely on approximate symmetry [25]. Further, the majority of the approaches studied symmetry on single parts [3,8,11,14,16,35,36,39] and seldom on assemblies [40]. Most of the approaches related to 3D CAD models studied symmetry detection from the boundary representation (B-rep) perspective [3,8,11,14,25,35,36] and less often from the perspective of design features [16,39,40].
Jiang et al. studied symmetry detection from the feature perspective using design features, Boolean operations, and the feature (history) tree for the detection of exact reflectional and axisymmetry in parts [16,39] and assemblies [40]. Those studies are restricted to native CAD models and are applicable only to specific CAD software. In addition, the approach may be sensitive to the designer’s bad modeling habits, such as redundant feature modeling and modeling symmetric shapes using non-symmetric features. Design features are restricted to a particular CAD system, while using the B-rep is applicable among different CAD systems. Hence, Tate et al. [8,35] proposed the detection of exact and partial reflectional and rotational symmetry from the B-rep perspective using a loop-based approach (a loop is a closed circuit of edges bounding a face). Planes and axes of symmetry candidates are generated by matching identical loop pairs through their properties (loop area, centroid, normal vectors, etc.). The planes and axes of symmetry candidates are additionally rationalized by eliminating duplicates. Finally, the candidates are ranked according to the cumulative area of their associated loops, and the highest ranked is identified as the actual planes and axes of symmetry. The study addressed the determination of loop properties of analytical surfaces (planes, cylinders, cones, spheres, and tori) and numerical surfaces (only B-spline surfaces were considered but with certain approximations). One of the limitations of the approach in the implementation was the imprecision of geometric and topological definitions in Spatial Technology ACIS Solid Modeler. Another similar research by Li et al. [3,36] proposed the divide-and-conquer strategy for detecting exact global and partial axi- and reflectional symmetry using faces of the B-rep as input. Preliminary, the B-Rep model’s topology was first transformed into hypergraph data structures to generate maximal surfaces and curves by merging the adjacent surfaces and curves. For instance, to obtain a maximal surface, two adjacent half-cylinders can be merged into one full cylinder. Then, in the divide phase, the planes and axes of symmetry candidates were obtained through the intrinsic surface parameters and their intersections of one, two, or three adjacent faces. In the conquer phase, the local symmetry properties were propagated to the global level by matching coincident local candidates into a global one. The drawback of the study is that it addressed only analytical surfaces, and it may become difficult to obtain the candidates from surfaces composed of complex intersection curves. Both approaches [3,8,35,36] rely upon propagating the symmetry properties from the local to the global level over the B-rep. In other words, the local planes and axes of symmetry are generated from the geometry and propagate to global planes and axes of symmetry. Li et al. [11] proposed a graph-based approach using congruence-labelled adjacency graph (CLAG) and frequent sub-graph mining (FSM) to extract multi-scale (i.e., at different geometric scales) symmetric regions and extract symmetry relations among these regions. The proposed approach addressed exact reflectional, rotational, and translational symmetry. The candidates are generated similarly as in [8]. The study is limited to plane and quadric surfaces. Another graph-based approach by Li et al. [25] proposed a solution for detecting the design intent using symmetry in approximate B-rep models from reverse engineering. Firstly, the model is by means of the regularity feature tree (RFT) decomposed into more straightforward closed volumes to detect the design intent as congruencies, symmetries, and symmetric arrangements from the RFT. The focus is set to detect local approximate reflectional, rotational, and translational symmetry and is limited to analytical surfaces. Recently, Buric et al. [14,15] addressed the detection of exact axi- and reflectional symmetry using faces as input and a vector-based calculation procedure. Apart from analytical surfaces, the study also included numerical surfaces (B-spline, revolved, and blended surface). Only three planes and three axes of symmetry candidates were obtained from the principal axes of inertia passing through the center of gravity (COG). Consequently, the approach did not apply to partially symmetric 3D CAD models or those exhibiting exact reflectional symmetries misaligned with the principal axes of symmetry.
To summarize, the main limitation of the previously mentioned approaches is that most considered only analytical surfaces for symmetry detection, while numerical surfaces were most often not included. In addition, most approaches are too time-consuming for practical applications [3,11,36]. Therefore, the present paper introduces a symmetry detection framework that addresses the mentioned drawbacks. The proposed framework represents an improvement of the symmetry detection approach proposed in [14,15]. Additionally, the prior approaches do not provide an appropriate symmetry measure to quantify the symmetry in the 3D CAD model.

1.4. Symmetry Measures

Several researchers attempt to propose symmetry measures to quantify the amount of symmetry expressed as a numerical value in the range between 0 and 1. Marola [41] proposed the coefficient of symmetry β for evaluating reflectional symmetry in planar images with respect to a given axis of symmetry. The coefficient of symmetry β is defined as:
β = w ( x , y )   w ( x ¯ , y ¯ )   d x d y w 2 ( x , y )   d x d y ,
where w ( x , y ) and w ( x ¯ , y ¯ ) are the intensity functions of two symmetric points P ( x , y ) and P ( x ¯ , y ¯ ) with respect to the axis of symmetry. The coefficient of symmetry ranges in 0 ≤ β ≤ 1, where β = 1 indicates exact symmetry and β = 0 non-symmetry. Another research by Zabrodsky et al. [42] introduced the symmetry distance (SD) applicable to reflectional or rotational symmetry in 2D shapes represented by a sequence of points (i.e., polygons). SD is defined as the minimum mean squared distance between the points of the two shapes:
SD = 1 j i = 0 j 1 P i P ^ i 2 ,
where P represents the shape and P ^ its symmetry transform, while j is the number of points in the sequence. The SD enables a comparison of the “amount” of symmetry of different shapes and the “amount” of different symmetries of a single shape. If SD = 0, the shape is perfectly symmetric. The authors also present a way to extend the SD to 3D shapes represented by points sampled on a plane and projected on the object. Another study by Kulkarni et al. [43] proposed the degree of symmetry (DOS) to measure reflectional symmetry in 2D polygons:
DOS = 1 SD   ( A , B ) Area   ( A ) + Area   ( B ) ,
SD ( A , B ) = Area A B Area A B ,
where SD is the symmetric difference, and A and B are two sets. If the shape is symmetric, the DOS equals 1 since SD = 0. The larger the value of SD, the greater the non-symmetry.
To sum up, the previously mentioned symmetry measures are mainly focused on the 2D, and their extension to the 3D domain would be challenging. Hence, an appropriate symmetry measure applicable to 3D CAD models with B-rep is required, which has been addressed in the present study.

1.5. Similarity Measures

One of the common ways to detect the planes and axes of symmetry candidates in CAD models is by pair matching of identical B-rep elements (e.g., loops) using their geometric properties [44] (e.g., loop area, the number of edges, etc.). However, this may be an inadequate criterion as two differently shaped elements may have the same properties. Instead, the intention is to use a similarity measure from statistics to match similar B-rep elements.
A common similarity measure from statistics is the Jaccard index (or Jaccard similarity coefficient) used to measure the similarity between two finite data sets (X and Y), which is defined as the size of the intersection divided by the size of the union:
J ( X , Y ) = X Y X Y .
For instance, Seifoddini et al. [45] used the Jaccard index for clustering purposes to measure the similarity between machines and parts and group them together. Another similarity measure, the Cosine similarity, computes the cosine of the angle between two vectors A and B (or it can also be expressed in terms of two finite data sets):
C S = cos θ = A B A B = X Y X Y ,
where X and Y represent the cardinalities of the sets. Zehtaban et al. [46] used the Opitz code system (where alphanumerical digits represent the CAD model’s features) and the Cosine similarity to compute the similarity measure between two Opitz code vectors. Alternative similarity measures related to the Jaccard index are the Sørensen–Dice coefficient (the size of the intersection divided by the sum of elements in each set times 0.5), Szymkiewicz–Simpson coefficient or Overlap coefficient (the size of the intersection divided by the smaller size of two data sets), and the Braun-Blanquet coefficient (the size of the intersection divided by the larger size of two data sets). Generally, similarity measures range between 0 (dissimilarity) and 1 (absolute similarity). All mentioned similarity measures have the same numerators (the number of common features in both data sets), while the main difference between them derives from the denominators. The Jaccard index and Braun-Blanquet coefficient are conservative similarity measures penalizing differences between sets. Compared to them, the Sørensen–Dice coefficient and Cosine similarity produce less penalization, indicating higher similarity. Those two similarity measures result in nearly identical scores as long as the difference in the size between the two sets is not too large. The Szymkiewicz–Simpson coefficient is the least conservative measure, which can even lead to a score of 1 if one set is a proper subset of the other set, independent of the size of those two sets. The proposed application of the similarity measure in the framework is to assess if two faces are similar.

2. Materials and Methods

The present study proposes a symmetry detection framework to overcome the highlighted limitations of the past symmetry detection approaches. The framework represents an improvement and upgrade of the past symmetry detection approach proposed in [14,15]. However, the improvement in this study is that it deals with the detection of multiple reflectional and partial symmetries in 3D CAD models comprising analytical and numerical surfaces (B-spline and revolved surfaces). In addition, the study proposes symmetry measures for distinguishing exact, partial, or non-symmetrical 3D CAD models. As shown in Figure 2, the framework consists of several steps.
First, the B-rep of the input 3D CAD model is analyzed and classified. Then, the plane and axes of symmetry candidates are generated. The proposed framework utilizes a hybrid approach where the candidates are derived from the principal axes of inertia, single faces, as well as matching of similar face pairs. The generated candidates are subjected to trimming, where duplicates and unsuitable candidates are removed. In the symmetry detection step, the final candidates are evaluated to identify the actual planes and axes of symmetry and visualize them in the 3D CAD model.

2.1. B-Rep Analysis

Solids are in most state-of-the-art CAD systems described using the B-rep technique [47]. Two basic elements of the B-rep data structure are topology, defining the structure, and geometry, defining the shape of the CAD model. The basic topological elements are faces, edges, and vertices, and their underlying geometric elements are surfaces, curves, and points. Additionally, the B-rep data structure often contains other topological elements such as loops, shells, co-edges, and so on. The use of the B-rep as input [3,4,8,11,14] has the advantage that it is a neutral approach extendable to different CAD systems and file formats (native as well as neutral).
The analysis of the B-rep of the 3D CAD models is an important step of the framework that includes the classification, designation, and computation of specific properties of the topology and its underlying geometry. Surfaces are classified based on their type: planar, cylindrical, conical, spherical, toroidal, blended, revolved, and B-spline surface, etc. Classification is necessary because only surfaces of the same class will be compared in the later steps. Each face in the 3D CAD model is designated with a unique name (e.g., planes with PL1, PL2, PL3, PL4, …, cylinders with CY1, CY2, CY3, CY4, …, cones with CO1, CO2, CO3, CO4, …, B-spline surface with BS1, BS2, BS3, BS4, …, and so on) to enable its tracking and accessibility at any time. For each face, the underlying surface properties need to be computed: e.g., surface area, face centroid or center, face normal, and angle (which indicates if the surface is closed or open). The later steps use the computed properties to evaluate symmetrical face pairs and stand-alone faces.

Computing Surface Properties

Implicit equations and parametric functions are the two most common techniques for representing curves and surfaces in geometric modeling [48]. It is difficult to compute a point on a curve or surface using implicit forms, while parametric forms make it difficult to determine if a given point lies on the curve or surface. Therefore, a surface or a curve is often described using both techniques. The implicit equation of a surface in Euclidean space R3 is defined by the equation:
S ( x , y , z ) = 0 .
The parametric representation of a surface S in Euclidean space is of the form:
R ( u , v ) = x ( u , v ) , y ( u , v ) , z ( u , v ) ,
where u and v represent dimensionless parameters. The unit normal vector at any point on the surface S can be calculated using the following equation:
n = N N = R u × R v R u × R v
where R u = R / u and R v = R / v are the tangent vectors. By integrating the length of the normal vector to the surface over the appropriate domain D in the parametric uv plane, the surface area can be computed as following:
A = D d S = D R u × R v d u d v = D N d u d v .
Apart from the normal vector, for particular surfaces (cylinder, cone, torus, and revolved surface) the axis vector is used instead, which can be retrieved from the parameters that define the corresponding analytical surfaces (e.g., a cylinder is defined by an origin, radius, and axis direction). The face centroid C can be evaluated as following:
C ( x C , y C , z C ) = A x A , A y A , A z A = D x d S A , D y d S A , D z d S A .
The centroid may be located on or outside the face. For instance, the centroid of a cylinder will always be located outside the face, while those of a plane usually on the face. As the normal vector can only be computed for points lying on the face, the face center needs to be used for certain surface types (Table 1). The face center can be obtained from the uv mid-point of the surface R ( u mid , v mid ) , where umid = (umin + umax)/2 and vmid = (vmin + vmax)/2. Finally, a summary of the relevant vectors and points for each surface type is given in Table 1.

2.2. Generating Planes and Axes of Symmetry Candidates

The planes and axes of symmetry candidates are generated through pair matching of similar faces, from single faces, and from the principal axes of inertia. The pair matching of similar faces of the planar surface type is used to generate the planes of symmetry candidates. Single faces of the cylindrical surface type are employed to identify the axes of symmetry candidates. Additionally, to cover candidates for revealing exact global symmetries, three planes and three axes of symmetry candidates are always generated from the principal axes of inertia, as described in [14,15].

2.2.1. Planes of Symmetry Candidates

To generate the planes of symmetry candidates from similar face pairs, the following similarity evaluation criteria are established: area ratio and Cosine similarity. The Jaccard index and Braun-Blanquet coefficient may underestimate similarity, while the Szymkiewicz–Simpson coefficient may overestimate similarity. Hence, the Cosine similarity (alternatively, the Sørensen–Dice coefficient can be selected) emerges as the most suitable choice for measuring the similarity between two faces.
The area ratio (AR) is defined as the ratio of surface areas of two faces and is computed for each face (k is the total number of planar surfaces in the CAD model):
A R = A   i A   j ;   i , j 1 , ... , k ;   i j .
The AR is always calculated such that AiAj, so its value is always ≤1. The significance of AR is that it is used to quickly filter face pairs that are considered dissimilar. Hence, the threshold values for AR have been set to 0.85. Each face pair having AR above the threshold values is further processed to evaluate its similarity using the Cosine similarity. By reinterpreting faces as a set of edges, the Cosine similarity can be used to measure the similarity between two faces. Let φ = F 1 , ... , F k be the set of faces of the plane surface type up to k in the input 3D CAD model. Each face consists of a subset of edges of E 1 , ... , E l . As already stated, the Cosine similarity is defined as the number of common elements in the two finite data sets divided by the square root of their multiplied cardinalities:
C S ( F i , F j ) = F i F j F i F j ;   i , j 1 , ... , k .
To compute the Cosine similarity, the edges of each face are designated using a string code (e.g., “oLI10”). The first letter of the designation of the string code indicates whether the edge belongs to an outer “o” or inner “i” loop. The second two letters describe the type of the underlying curve, “LI” for line, “CI” for circle, “EL” for ellipse, “BC” for B-spline curve, and so on. Finally, the last part of the designation represents the length of the curve. An illustrative example of the string code generation is shown in Figure 3, while Table 2 provides several examples of face pairs and their corresponding Cosine similarity scores.
The peak number of the planes of symmetry candidates n POSC depends on the number of face pairs. As face pairs are computed only from faces of the planar surface type, the peak value of n POSC can be calculated using the following equation:
n POSC = n PL n PL 1 2 .
where n PL is the number of faces of the planar surface type in the CAD model. After the identification of similar face pairs, the corresponding planes of symmetry candidates are generated using the plane equation, which is defined by a point M(xM, yM, zM) and the normal vector to the plane n = ( a , b , c ) :
a x x M + b y y M + c z z M = 0 .
The corresponding mid-point M is computed between the two face centroids for each face pair:
M ( x M , y M , z M ) = x C 1 + x C 2 2 , y C 1 + y C 2 2 , z C 1 + z C 2 2 .
The normal vector to the plane of symmetry candidate is computed from the face normals, based on three possible arrangements between two faces (Figure 4): parallel, coplanar, or arbitrarily angled.
If two faces are parallel, then the unit normal vector n to the plane of symmetry candidate is equal to either one of the face normals:
n = a , b , c = n 1   or   n = a , b , c = n 2 .
If two faces are coplanar, then the unit normal vector n to the plane of symmetry candidate is calculated from the centroid points of the faces:
n = a , b , c = V V ,   V = x C 2 x C 1 , y C 2 y C 1 , z C 2 z C 1 .
Finally, if a face pair is neither parallel nor coplanar, i.e., the faces are arbitrarily angled, the unit normal vector n to the plane of symmetry candidate is computed as the resultant vector from the two face normals:
n = a , b , c = R R ,   R = n 1 n 2 .
In addition to the planes of symmetry candidates obtained from similar face pairs, three additional planes are always generated from the 3D model’s principal axes of inertia (as described in [14]) to cover candidates for revealing exact global symmetries.

2.2.2. Axes of Symmetry Candidates

Axisymmetric parts, whether exact or partially symmetric, dominantly consist of cylindrical surfaces that make up the symmetry (see Figure 5).
Thus, in the proposed framework, the axes of symmetry candidates are obtained from the faces of the cylindrical surface type. The peak number of axes of symmetry candidates n AOSC is equal to the number of faces of the cylindrical surface type n CY in the 3D CAD model:
n AOSC = n CY .
The axes of symmetry candidates are defined by the line equation:
x x a o = y y a p = z z a q ,
where o, p, and q are the cylinder’s axis direction vector components a = ( o , p , q ) , while A(xa, ya, za) represents any point on the cylinder’s axis. Apart from the axes of symmetry candidates obtained from single faces of the cylindrical surface type, additional three axes are always generated from the 3D model’s principal axes of inertia [11] to cover candidates for revealing exact global symmetries.

2.3. Trimming Planes and Axes of Symmetry Candidates

Once the planes and axes of symmetry candidates have been generated, they are subjected to trimming where possible duplicates or unsuitable candidates are eliminated. Duplicate candidates are those which are coincident with each other (i.e., the planes or axes lie upon each other). This can be queried with Equations (15) and (21) and with the length of the cross-product between the plane normals or the axis directions, which needs to be zero. Unsuitable candidates are those which are significantly distanced from the COG and, therefore, not expected to become the actual planes or axes of symmetry. Exact reflectional or axisymmetric 3D CAD models can have planes or axes of symmetries that pass through the COG, and their direction matches the principal axes’ directions [14]. However, this will not apply to partially symmetric models, although their planes and axes of symmetries will still be close to the centroid [49]. Hence, to take advantage of this, the point-to-plane distance dPOSC can be exploited for computing the distance between the COG and the plane of symmetry candidate:
d POSC = a x C + b y C + c z C + d a 2 + b 2 + c 2 .
where d = a x M b y M c z M . Analogically, the point-to-line distance dAOSC between the COG and the axis of symmetry candidate can be obtained from the following equation:
d AOSC = P C × a a ,
where point C x C , y C , z C represents the COG, while P is any point on the axis.
Finally, to trim unsuitable candidates, dPOSC or dAOSC should be less than the maximum allowed distance δ, i.e., dPOSCδ and dAOSCδ. The δ has been defined empirically, based on the 3D CAD model’s minimum bounding box:
δ = 0.05 Δ L x 2 + Δ L y 2 + Δ L z 2 ,
where ΔL represents the lengths of the 3D CAD model’s bounding box in the corresponding directions (x, y, or z).

2.4. Symmetry Detection

Once identified, each final plane and axis of symmetry candidate is evaluated with respect to the 3D CAD model’s geometry. For that purpose, two approaches are used: (i) for reflectional symmetry and (ii) for axisymmetry.

2.4.1. Reflectional Symmetry

The faces of reflectional symmetric 3D CAD models can be divided into two categories: face pairs and stand-alone faces. A face pair essentially consists of two faces that are reflectional symmetric with respect to the observed plane of symmetry candidate. A stand-alone face is basically a single face intersected by the observed plane of symmetry candidate and divided into two equal reflectional symmetric parts.
Face pairs are identified using a pairwise comparison between all faces of the same surface type. A face pair is considered symmetrical with respect to the plane of symmetry candidate when four criteria are fulfilled: equality, coincidence, and orientation. The equality criterion is satisfied if the subtraction of the surface areas of two faces is below an error tolerance ε:
A i A j ε .
To evaluate the coincidence criterion, the mid-point between two face centroids for each face pair is evaluated with respect to the corresponding plane of symmetry candidate by means of the point-to-plane distance analogous to Equation (22), in this case, denoted as dM. The point-to-plane distance dM needs to be within a specified tolerance dM ≤ ε to fulfill the coincidence criterion. The final criterion that needs to be met by the face pair is the orientation criterion. For that purpose, the cross-product vector p between the orientation vector v and the plane of symmetry normal vector n is calculated for each face pair:
p = v × n .
For each face pair, the orientation vector v is computed based on the arrangement between their faces: parallel, coplanar, and arbitrarily oriented faces (analogous to the cases in Figure 4). The orientation vector of a face pair is calculated from the normal vectors at the face center or their axis vectors at the face centroid. If a face pair is parallel, then the orientation vector can be obtained from one of the face normals. In case a face pair is coplanar, then the orientation vector is obtained using Equation (18). The orientation vector of an arbitrarily oriented face pair is obtained from Equation (19). Finally, the face pair fulfills the orientation criterion if the length of the cross-product vector is zero:
p = 0 .
All stand-alone faces in the 3D CAD model that do not belong to a symmetrical face pair need to fulfill the coincidence criterion, i.e., that their face center or centroid lies on the plane of symmetry candidate, which is also queried with dM ≤ ε.
Finally, the 3D CAD model is considered exactly symmetric if the sum of the number of pair faces nFP and stand-alone faces nSA is in equilibrium with the total number of faces n in the 3D CAD model:
n FP + n SA = n .
Otherwise, if the equation above is not in equilibrium, the 3D CAD model may be partially symmetric. By further rearrangement of the equation above, the symmetrical faces index (SFI) can be introduced:
SFI = n FP + n SA n .
The SFI is the ratio between the number of symmetrical faces (face pairs and stand-alone faces) and the total number of faces in the 3D CAD model. It is calculated for each plane of symmetry candidate and ranges between 0 (non-symmetry) and 1 (exact global reflectional symmetry). If SFI < 1, the 3D CAD model shall be further investigated for the existence of partial reflectional symmetry.

2.4.2. Axisymmetry

The faces in exact axisymmetric 3D B-rep CAD models are stand-alone faces, and they must fulfill two criteria: coincidence and orientation. A face is axisymmetric with respect to the axis of symmetry candidate if its centroid or center intersects with the axis of symmetry candidate, which is queried with the point-to-line distance from Equation (23), in this case, designate as dA. The coincidence criterion is fulfilled if dA ≤ ε. On the other hand, the orientation criterion is queried with the cross-product vector r computed between the face vector f (normal or axis vector) and the axis of symmetry candidate orientation vector a :
r = f × a .
The orientation criterion is met if the length of the cross-product vector is zero:
r = 0 .
The 3D CAD model exhibits axisymmetry if the number of all stand-alone faces n SA is in equilibrium with the total number of faces n in the 3D CAD model:
n SA = n .
In the case of axisymmetry, the number of symmetrical face pairs is zero and can be eliminated from the Equation (29), so the SFI turns into:
SFI = n SA n ,
Hence, the SFI is the ratio between the number of stand-alone faces and the total number of faces in the 3D CAD model. As for reflectional symmetry, SFI is also calculated for each axis of symmetry candidate and ranges between 0 (non-symmetry) and 1 (exact global axisymmetry). If SFI < 1, the 3D CAD model shall be further investigated for the existence of partial axisymmetry.

2.4.3. Global Symmetry Index

In order to quantitatively evaluate the existence of symmetry in the B-rep CAD model, the global symmetry index (GSI) is introduced, which is defined as the ratio between the symmetrical surface area and the total surface area of the 3D CAD model:
GSI = S sym d A sym S d A .
To simplify the calculation process, the equation above can be further expressed in terms of the faces:
GSI = A sym A ,
where Asym represents the sum of the surface area of symmetrical faces (face pairs and/or stand-alone faces), while A the total surface area of the 3D CAD model. The GSI applies to axisymmetry and reflectional symmetry and is computed for each plane and axis of symmetry candidates. The GSI ranges from 0 (non-symmetry) to 1 (exact global symmetry). In the case of partial symmetry, the GSI will be somewhere close to 1, while the threshold value GSITH, below which the 3D CAD model is not considered partially symmetric anymore, needs to be determined by testing. If the 3D CAD model exhibits exact global symmetry, i.e., SFI = 1, the GSI will also be GSI = 1. The SFI measures the symmetry of the topology, while the GSI measures the symmetry of the geometry in the B-rep CAD model.

2.4.4. Flowchart of the Symmetry Detection

The symmetry detection step described in the previous sections can be summarized in one flowchart shown in Figure 6.

2.5. Visualization of the Planes and Axes of Symmetry

The symmetry information will be provided by visualizing the detected planes and/or axes of symmetry in the 3D CAD model. A plane of symmetry can be created using the unit normal vector and any point on the plane (the mid-point between the two similar faces). In contrast, an axis of symmetry can be created using the unit axis vector and any point on the axis.

2.6. Implementation

The proposed framework was implemented into the commercial CAD system Solidworks 2020 using its application programming interface (API). The CAD system has been exploited as an interpreter of the input model, while its API has been used to retrieve and compute the topological and geometrical properties of B-rep. As a result of this, it is important to emphasize that any other CAD system and its API could also be used for that purpose. However, one of the main advantages of the Solidworks API compared to other CAD systems is the possibility to access the complete API object hierarchy even with the low-level programming languages [14], making it suitable for various tasks. The API functionalities enable the direct or indirect retrieval or computation of the 3D CAD model properties (e.g., face centroids, face centers, surface areas, COG, etc.).
Many CAD systems (e.g., Solidworks, Siemens NX, Solid Edge, etc.) use the Parasolid geometric modeling kernel, which supports not only analytical surfaces (plane, cylinder, cone, sphere, and torus) but also revolved, B-spline, blend, offset, extrusion, and foreign surfaces. The selected input model for the implemented symmetry detection framework is the neutral STEP file format. The blend, offset, extrusion, and foreign surface were excluded from the implementation as those surface types are related to the Parasolid file format and were not identified in the 3D CAD models with the STEP file format. The computation accuracy of the CASD has been set to ε = 10−6 m, which is in the range of the manufacturing accuracy in mechanical engineering.
To improve the visualization of the symmetry detection results, a graphical user interface (GUI) has been proposed. In addition, to store the symmetry detection results permanently for each CAD model, a result file in *.txt format has been proposed, which can be loaded to the GUI anytime for visualization purposes.

2.6.1. Graphical User Interface

The GUI provides a set of commands that enables the processing and postprocessing of the CASD in the CAD models. The processing includes the automated B-rep analysis, generation and trimming of the planes and axes of symmetry candidates, and assessing the candidates in the symmetry detection step. Postprocessing includes the retrieval and visualization of the results. The visualization includes the highlighting and coloring possibilities of the detected symmetric and asymmetric faces in the CAD model.
The framework has been implemented at the macro level using the Visual Basic for Application (VBA) programming language. Although macros are computationally slower compared to add-ins or stand-alone applications, they are easier and faster to implement because they do not run on their own memory space. The developed macro was named Symmetry Detector and its GUI is shown in Figure 7. Symmetry Detector is not only a CASD tool, but it also enables the postprocessing of the detected symmetric and asymmetric faces in the 3D CAD models (e.g., their selection and coloring) and provides information about the corresponding symmetry measures (SFI, and GSI), type of symmetry, and number of faces, etc.

2.6.2. Result File

Apart from the visualization of the planes and axes of symmetries in the 3D CAD models, the symmetry detection results are also permanently stored in the result file (*.txt format). The result file is named exactly as the part name and contains information for the GUI that can be used anytime for visualization purposes. It is a compound of the following parts (Figure A1): general information, a list of faces and their properties, COG and axes of inertia, an overview and count of the surfaces, a list of planes and axes of symmetry and their symmetric faces, and a count of the planes and axes of symmetry.

3. Results

3.1. Validation

The main scope of the validation was to assess the performance [26] and time complexity [50] of the proposed symmetry detection framework. The performance is important to estimate if the proposed framework can correctly classify the symmetry and find the POS and AOS to support the engineer in symmetry detection. The time complexity or running time is important for assessing if the CASD can be obtained reasonably for industrial applications. Further, the validation was conducted to reveal any unexpected computational or technical issues. For that purpose, a test–debug–test [51] implementation cycle has been conducted to check against the intended functionality and to make modifications if the functionalities were not provided. The validation also included the assessment of the global symmetry index threshold GSITH value to define the border between partial symmetry and non-symmetry in the CAD models.
The proposed framework attempts to identify the corresponding planes and axes of symmetry in the 3D CAD model and identify whether the detected symmetry is exact global reflectional symmetry, partial reflectional symmetry, exact global axisymmetry, partial axisymmetry, or non-symmetry. Hence, the evaluation of the framework’s performance can be observed as a classification problem. For that purpose, the F1-score [26] can be used, which is expressed as the harmonic mean of precision and recall:
F 1 - score = 2 precision recall precision + recall = 2 TP 2 TP + FP + FN ,
where TP represents the true positive, FP the false positive, and FN the false negative results of the symmetry detection. A true positive result denotes the existence of symmetry in the 3D CAD model when it does exist. A false positive result indicates the existence of symmetry in the 3D CAD model when it does not exist. A false negative result denotes that symmetry does not exist in the 3D CAD model when it exists. The F1-score measures the performance of the implemented framework and can be used for comparison with the performances of other methods [26].
The time complexity has been evaluated theoretically and experimentally using the Big-O complexity chart [50], which expresses the time complexity as a function of the input size, i.e., the number of faces n in the 3D CAD model.
The implemented symmetry detection framework was tested on the collected data with the described scope of validation. To ensure reliable results, the symmetry detection framework was tested for all 3D CAD models on the same hardware, namely on a Dell Precision Working station with Intel i7-1165G7 up to 4.7 GHz processor and 16 GB RAM.

3.2. Data Collection

To validate the implemented symmetry detection framework, a set of 3D CAD models in the neutral STEP file format (*.stp) have been collected from various online CAD model libraries [52,53,54]. In total, 300 3D CAD models were used for validation (200 reflectional symmetric, 60 axisymmetric, and 40 non-symmetric). For comparison, the validation of prior symmetry detection approaches has been performed on a smaller number of B-rep CAD models (up to 150) [8,14,36]. All collected models were single parts with one body and manifold geometry. An example of the collected set of 3D CAD models is shown in Figure 8. To ensure a representative sample of the different surface types that may occur in 3D CAD models of mechanical parts, various groups of parts according to the manufacturing process (casting, molding, forming, and machining) were collected.
Figure 9 shows the bar charts of different surfaces and their relative frequencies for the CAD models in neutral STEP format. The surfaces are adequately represented in the collected 3D CAD models, indicating the applicability of the framework.

3.3. Performance

Figure 10 shows a sample of the 3D CAD models and the output of the symmetry detection, i.e., the detected POS and AOS. The models are global reflectional symmetric (GRS), partial reflectional symmetric (PRS), global axisymmetric (GAS), partial axisymmetric (PAS), and non-symmetric (NS).
For the examination of the TP, FP, and FN symmetry detection outcomes, exact and partial symmetry were evaluated together and not separately. Hence, the calculated F1-score represents the overall score of the symmetry detection framework. To be on the conservative side, a TP result was only considered if all possible planes and the axis of symmetries were detected in the 3D CAD model. Analogically, an FP was considered if just one plane or axis of symmetry had been wrongly declared, or FN if just one plane or axis of symmetry in the CAD model was missed. The results of the evaluation are given in Table 3. Based on that, the symmetry detection framework’s performance for the given CAD model set has been calculated as F1-score = 0.94.
The testing has revealed that the framework may be sensitive to 3D CAD models exhibiting multiple reflectional symmetries. The failure to detect reflectional symmetry is related to the lack of planar surfaces used by the framework to identify the planes of symmetry candidates. Figure 11 shows some typical 3D CAD models with FN symmetry detection outcomes (the mechanical parts where this can happen are gears or parts that are dominantly compounds of cylindrical surfaces). Although, in that case, several planes of symmetry have been detected from the principal axes of inertia, the symmetry detection in those parts can be considered incomplete.
The computational accuracy of the implemented symmetry detection framework, which has been set to the manufacturing accuracy in mechanical engineering (ε = 10−6 m), can be achieved for analytical surface types but, in some cases, not for the numerical surfaces (particularly B-splines, revolved, and blended surfaces). For instance, sometimes, two symmetric faces may have different values of the surface areas, even when they have been created by a mirroring operation, and should be equal. At this point, further research is needed to investigate whether that is an implementation issue (related to the particular CAD system used) or a numerical problem (across different CAD systems) caused by the approximation of numerical surfaces in geometric modeling. The second type of failure of the computational accuracy is related to the calculation of the face center from the surface parameterization (Figure 12).
Li et al. [55] showed that uniform sampling in the parameter domain may lead to a non-uniform sampling of the surface. Hence, using the uv mid-point to calculate the face center represents a more straightforward approach than the right one. Supposing the face centers of two symmetric faces have been computed wrong. In that case, the faces will not be equally distanced from the POSC and their normal vectors will differ, eventually resulting in non-detection of the reflectional symmetric face pair. Analogically, a wrong computed face center of a stand-alone face may not lie on a plane or axis of symmetry. The mentioned failure is characteristic of numerical surfaces (e.g., B-spline and revolved surfaces), and it will not result in an overall miss-detection of symmetry in the 3D CAD model. Only certain symmetric faces may be categorized as non-symmetric, resulting in a slightly reduction of the GSI score (e.g., Figure 10 parts (1), (11) and (12)).
The proposed framework is robust and independent of the 3D CAD model’s position and orientations in the 3D modeling space. That is important as the 3D CAD model’s COG does not necessarily need to be coincident (or close to) the origin, or its principal axes of inertia may be misaligned with the coordinate axes of the modeling space.
In particular cases, by detecting multiple reflectional symmetries in the CAD model, the proposed framework consequently detects cyclic symmetry (Figure 13). However, the interpretation of this type of symmetry is up to the user since there is no adequate measure yet. Hence, apart from exact global and partial axisymmetry, the proposed framework generally enables the detection of rotational symmetries.

3.4. Time Complexity

The time complexity has been estimated theoretically and experimentally as in the studies [3,8,35,36]. The theoretically estimated time complexity represents the worst-case with the longest running time, where for each step of the framework, only the highest-order term is considered because this term dominates over the other terms on large inputs [50]. In the B-rep Analysis step, all faces in the CAD model are looped to designate them and compute their properties, which takes linear time, i.e., O(n). In the candidate generation and trimming step, the generated planes and axes of symmetry candidates are mutually compared for trimming. The time complexity in this step depends on the number of faces of the planar (nPL) and cylindrical (nCY) surface type in the CAD model. However, the most conservative case is when the CAD model entirely consists of planar surfaces (n = nPL), then the time complexity can be expressed in terms of n, and this step requires, in worst-case O(n2), time. The same applies to the symmetry detection step, where the pairwise comparisons between faces also require O(n2) time. The visualization step involves the loop of all candidates. Supposing the most conservative case (n = nPL), the time complexity is in worst-case O(n). Finally, the time complexities are summarized in Table 4.
As mentioned, the experimental time complexity has been obtained through testing on the collected 3D CAD models, and the results for each particular step are shown in Figure 14, as well as the overall time complexity of the symmetry detection framework in Figure 15.
Comparing the theoretical and experimental time complexity, there is a difference between them, particularly for the candidate generation and trimming and symmetry detection steps, as well as for the overall symmetry detection framework. In those cases, theoretical time complexities have been estimated to O(n2) time, while the experimental to O(n) time. One reason for that might be because the theoretical time complexity represents the worst-case, for instance, if all faces in the 3D CAD model would be of only one surface type (e.g., planes). However, it is noticeable that the collected CAD models are a mix of different surface types, and not all faces in the 3D CAD model require pairwise comparison, only those of the same surface type. Hence, the actual number of inputs is less than the total number of faces in the CAD model. It corresponds to the highest number of faces of the particular surface type. Based on that, the experimental time complexity represents the average running time. Another reason for the linear trend of the experimental time complexities might be that the number of inputs, i.e., faces, need to be considerably larger to produce the quadratic trend.

3.5. Global Symmetry Index Threshold

For the estimation of the global symmetry index threshold value GSITH, Figure 15 gives the plot of the GSI vs SFI for each 3D CAD model. The 3D CAD models were divided into three categories: exact global, partial, and non-symmetric. As already stated, the SFI measures the symmetry of the topology, while GSI measures the symmetry of the geometry. Exact global symmetry implies that SFI = 1 and GSI = 1. In the case of partial symmetry, SFI < 1 and GSI ≥ GSITH. Non-symmetry implies SFI < 1 and GSI < GSITH. Based on the results (Figure 16) for the given set of CAD models, the global symmetry index threshold value can be set to approx. GSITH = 0.70 as the border between partial symmetry and non-symmetry. However, this is only a proposal, and it can be left to the user to select its own GSITH.

4. Discussion

The experimental testing of the framework has been conducted on a representative sample of 300 CAD models typical for industrial applications. The past studies, however, performed the testing on a considerably smaller number of CAD models. For instance, Li. et al. [2,35] used 45 CAD models, while Tate et al. [15,36] used no more than 10. The time complexity of the framework has been evaluated experimentally to O(n) time. Hence, it requires less computation time compared to the studies [3,8,35,36], which estimated their algorithms to O(n4) and close to O(n2) time. The performance of the framework expressed with F1-score = 0.94 is close to those of the CASD technique proposed by Gothandaraman et al. [26], which was assessed to be F1-score = 0.95.
Unlike the past studies [3,8,35,36], which used only analytical geometry as input for symmetry detection, the proposed framework applies to analytical, as well as numerical geometry, which has been created unintentionally (e.g., when fillet or chamfer features are used to round off or break edges, the CAD system may automatically create B-spline surfaces). In the future, the framework shall be tested on more complex parts (e.g., airplane wing, car body, turbine blade, or products with a complex aesthetic shape) that contain intentionally created numerical geometry obtained by means of surface design tools. Although the implemented framework was limited to the STEP file, including analytical, revolved, and B-Spline surface types, in the future, it could be easily extended to other surface types available in the Parasolid file format (e.g., extrusion, offset, blend surfaces, etc.). The past studies [3,8,35,36] create the candidates from the local symmetry properties of the B-rep and propagate them over the topology to the global level. Consequently, no metrics for quantifying the symmetry in the CAD models were established. In addition, those studies did not perform any verification of the candidates with respect to the geometry. The present study, however, verifies each candidate with respect to the geometry and attempts to establish the metrics for distinguishing exact, partial, and non-symmetric 3D CAD models by introducing appropriate symmetry measures (symmetrical faces index and global symmetry index).
Future research will also be focused on improving the face center calculation from the uv mid-point, which may sometimes be computationally inaccurate for certain numerical surfaces. Further, the framework should be improved to enable symmetry detection in CAD models without planar surfaces exhibiting multiple reflectional symmetries.

5. Conclusions

In the present study, a symmetry detection framework is proposed, which represents an upgrade of the previous research [14,15], which was limited to CAD models with exact symmetry (reflectional and axisymmetry) and the detection of up to three planes and axes of symmetry candidates obtained from the principal axes of inertia. Hence, the novelty of this framework is the extension of symmetry detection to 3D CAD models with analytic and numeric geometry exhibiting multiple symmetries or those being partially symmetrical. The theoretical background of the framework is very general and relies upon the B-rep properties, which means that it could be implemented in many other CAD systems. The implemented symmetry detection framework has been validated in terms of performance, measured with the F1-score, and time complexity, measured with the Big-O charts. The results show that the overall F1-score is 0.94, and the time complexity is O(n). Based on that, it can be concluded that the proposed framework can support engineers in the detection of symmetry and is appropriate for industrial applications.

Author Contributions

Conceptualization, M.B.; methodology, M.B.; software, M.B.; validation, M.B.; formal analysis, M.B.; investigation, M.B.; resources, M.B.; data curation, M.B.; writing—original draft preparation, M.B.; writing—review and editing, S.S. and T.B.; visualization, M.B.; supervision, S.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Figure A1. An example of the result file for a part with one detected plane of symmetry.
Figure A1. An example of the result file for a part with one detected plane of symmetry.
Symmetry 15 01058 g0a1

References

  1. Simmons, C.H.; Phelps, N. Manual of Engineering Drawing Technical Product Specification and Documentation to British and International Standards, 4th ed.; Butterworth-Heinemann: Oxford, UK, 2012. [Google Scholar]
  2. Giesecke, F.E.; Lockhart, S.; Goodman, M.; Johnson, C. Technical Drawing with Engineering Graphics, 15th ed.; Pearson Education: Hoboken, NJ, USA, 2016. [Google Scholar]
  3. Li, K.; Foucault, G.; Leon, J.; Trlin, M. Fast global and partial reflective symmetry analyses using boundary surfaces of mechanical. Comput. Aided Des. 2014, 53, 70–89. [Google Scholar] [CrossRef]
  4. Tierney, C.; Boussuge, F.; Robinson, T.; Nolan, D.; Armstrong, C. Efficient symmetry-based decomposition for meshing quasi-axisymmetric assemblies. Comput. Aided Des. Appl. 2019, 16, 478–495. [Google Scholar] [CrossRef]
  5. Ma, Z.; Zhang, T.; Liu, F.; Yang, J. Knowledge discovery in design instances of mechanical structure symmetry. Adv. Mech. Eng. 2015, 7, 1–19. [Google Scholar] [CrossRef]
  6. Qiu, Q.; Chen, X.; Yang, C.; Feng, P. Classification and Effects of Symmetry of Mechanical Structure and Its Application in Design. Symmetry 2022, 13, 683. [Google Scholar] [CrossRef]
  7. Zingoni, A. Insights on the vibration characteristics of double-layer cable nets of D4h symmetry. Int. J. Solids Struct. 2018, 135, 261–273. [Google Scholar] [CrossRef]
  8. Tate, S.; Jared, G. Recognising symmetry in solid models. Comput. Aided Des. 2003, 35, 673–692. [Google Scholar] [CrossRef]
  9. Li, W.H.; Zang, A.M.; Kleeman, L. Bilateral Symmetry Detection for Real-time Robotics Applications. Int. J. Robot. Res. 2008, 27, 785–814. [Google Scholar] [CrossRef]
  10. Deng, X.; Wang, J. Research on the manufacturing of mechanical parts based on the theory of space symmetry group. Acad. J. Manuf. Eng. 2017, 15, 64–71. [Google Scholar]
  11. Li, C.; Li, M.; Gao, S. Multi-scale symmetry detection of CAD models. Comput. Aided Des. Appl. 2018, 16, 50–66. [Google Scholar] [CrossRef]
  12. Zingoni, A. Symmetry recognition in group-theoretic computational schemes for complex structural systems. Comput. Struct. 2012, 94, 34–44. [Google Scholar] [CrossRef]
  13. Mitra, N.; Pauly, M.; Wand, M.; Ceylan, D. Symmetry in 3D Geometry: Extraction and Applications. Comput. Graph. Forum. 2013, 32, 1–23. [Google Scholar] [CrossRef]
  14. Buric, M.; Brcic, M.; Bojcetic, N.; Skec, S. Computer-Aided Detection of Exact Reflection and Axisymmetry in B-rep CAD Models. In Proceedings of the CAD’22, Beijing, China, 11–13 July 2022. [Google Scholar] [CrossRef]
  15. Buric, M.; Brcic, M.; Bojcetic, N.; Skec, S. Computer-Aided Detection of Exact Reflection and Axisymmetry in B-rep CAD Models. Comput. Aided Des. Appl. 2023, 20, 884–897. [Google Scholar] [CrossRef]
  16. Jiang, J.; Chen, Z.; He, K. A feature-based method of rapidly detecting global exact symmetries in CAD models. Comput. Aided Des. 2013, 45, 1081–1094. [Google Scholar] [CrossRef]
  17. Alcázara, J.G.; Hermosoa, C.; Muntinghb, G. Symmetry Detection of Rational Space Curves from their Curvature and Torsion. Comput. Aided Geom. Des. 2015, 33, 51–65. [Google Scholar] [CrossRef]
  18. Nagar, R.; Raman, S. 3DSymm: Robust and Accurate 3D Reflection Symmetry Detection. Pattern Recognit. 2020, 107, 107483. [Google Scholar] [CrossRef]
  19. Xue, F.; Chen, K.; Lu, W. Architectural Symmetry Detection from 3D Urban Point Clouds: A Derivative-Free Optimization (DFO) Approach. In Advances in Informatics and Computing in Civil and Construction Engineering: Proceedings of the 35th CIB W78 2018 Conference: IT in Design, Construction, and Management; Springer: Berlin/Heidelberg, Germany, 2019; pp. 513–519. [Google Scholar] [CrossRef]
  20. Fotouhi, J.; Taylor, G.; Unberath, M.; Johnson, A.; Lee, S.C.; Osgood, G.; Navab, N. Exploring Partial Intrinsic and Extrinsic Symmetry in 3D Medical Imaging. Med. Image Anal. 2020, 72, 102127. [Google Scholar] [CrossRef]
  21. Dang, Q.; Morin, G.; Mouysset, S. Symmetry and Fourier Descriptor: A Hybrid Feature for NURBS based B-Rep Models Retrieval. In Proceedings of the Eurographics Workshop on 3D Object Retrieval, Strasbourg, France, 6 April 2014; pp. 45–52. [Google Scholar] [CrossRef]
  22. Tayangkanon, T.; Sompagdee, P.; Li, X. 3D Model Compression over ASCII Encoded Using Rotational and Reflective Symmetry. In Proceedings of the 10th International Conference on Knowledge and Smart Technology (KST 2018), Chiangmai, Thailand, 21 January–3 February 2018; pp. 53–58. [Google Scholar] [CrossRef]
  23. Tedjokusumo, J.; Leow, W.K. Normalization and Alignment of 3D Objects Based on Bilateral Symmetry Planes. In Advances in Multimedia Modeling; MMM 2007, Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2006; Volume 4351, pp. 74–78. [Google Scholar] [CrossRef]
  24. Dang, Q.; Mouysset, S.; Morin, G. Symmetry-Based Alignment for 3D Model Retrieval. In Proceedings of the 12th International Workshop on Content-Based Multimedia Indexing (CBMI), Klagenfurt, Austria, 18–20 June 2014. [Google Scholar] [CrossRef]
  25. Li, M.; Langbein, F.; Martin, R. Detecting design intent in approximate CAD models using symmetry. Comput. Aided Des. 2010, 42, 183–201. [Google Scholar] [CrossRef]
  26. Gothandaraman, R.; Jha, R.; Muthuswamy, S. Reflectional and rotational symmetry detection of CAD models based on point cloud processing. In Proceedings of the IEEE 4th Conference on Information & Communication Technology (CICT), Chennai, India, 3–5 December 2020. [Google Scholar] [CrossRef]
  27. He, C.; Wang, L.; Zhang, Y.; Wang, C. Dominant Symmetry Plane Detection for Point-Based 3D Models. Adv. Multimed. 2020, 5, 8861367. [Google Scholar] [CrossRef]
  28. Gao, L.; Zhang, L.; Meng, H.; Ren, Y.H.; Lai, Y.K.; Kobbelt, L. PRS-Net: Planar Reflective Symmetry Detection Net for 3D. IEEE Trans. Vis. Comput. Graph. 2021, 27, 3007–3018. [Google Scholar] [CrossRef]
  29. Hruda, L.; Kolingerová, I.; Váša, L. Robust, fast and flexible symmetry plane detection based on differentiable symmetry measure. Vis. Comput. 2022, 38, 555–571. [Google Scholar] [CrossRef]
  30. Chen, Y.; Linzi, F.; Feng, J. Automatic and Exact Symmetry Recognition of Structures Exhibiting High-Order Symmetries. J. Comput. Civ. Eng. 2018, 32, 04018002. [Google Scholar] [CrossRef]
  31. Hruda, L. Symmetry Detection in Geometric Models. Master’s Thesis, University of West Bohemia, Plzen, Czech Republic, May 2018. [Google Scholar]
  32. Ji, P.; Liu, X. A fast and efficient 3D reflection symmetry detector based on neural networks. Multimed. Tools. Appl. 2019, 78, 35471–35492. [Google Scholar] [CrossRef]
  33. Hruda, L.; Dvorak, J. Estimating Approximate Plane of Symmetry of 3D Triangle Meshes. In Proceedings of the CESCG 2017: The 21st Central European Seminar on Computer Graphics, Wien, Austria, 12 April 2017. [Google Scholar]
  34. Li, B.; Johan, H.; Ye, Y.; Lu, Y. Efficient 3D reflection symmetry detection: A view-based approach. Graph. Models 2016, 83, 2–14. [Google Scholar] [CrossRef]
  35. Tate, S.J. Symmetry and Shape Analysis for Assembly-Oriented CAD. Ph.D. Thesis, Cranfield University, Bedford, UK, May 2000. [Google Scholar]
  36. Li, K. Shape Analysis of B-Rep CAD Models to Extract Partial and Global Symmetries. PhD Thesis, University Grenoble, Saint-Martin-d’Hères, France, November 2011. [Google Scholar]
  37. Davis, L.S. Understanding Shape: II. Symmetry. IEEE Trans. Syst. Man Cybern. 1977, 7, 204–212. [Google Scholar]
  38. Parui, S.K.; Dutta Majumder, D. Symmetry analysis by computer. Pattern Recognit. 1983, 16, 63–67. [Google Scholar] [CrossRef]
  39. Jiang, J.; Chen, Z.; He, K. A feature-based approach for detecting global symmetries in CAD models with free-form surfaces. In Proceedings of the 13th International Conference on Computer-Aided Design and Computer Graphics, Guangzhou, China, 16–18 November 2013; pp. 383–384. [Google Scholar] [CrossRef]
  40. Jiang, J.; Gong, Q.; Chen, Z.; He, K.; Ruang, R. A Feature-based Method of Rapidly Detecting Global Symmetries of Static Assembly CAD Models. Jisuanji Fuzhu Sheji Yu Tuxingxue Xuebao/J. Comput.-Aided Des. Comput. Graph. 2017, 29, 950–957. [Google Scholar]
  41. Marola, G. On the Detection of the Axes of Symmetry of Symmetric and Almost Symmetric Planar Images. IEEE Trans. Pattern Anal. Mach. Intell. 1989, 11, 104–108. [Google Scholar] [CrossRef]
  42. Zabrodsky, H.; Peleg, S.; Avnir, D. Symmetry as a continuous feature. IEEE Trans. Pattern Anal. Mach. Intell. 1995, 17, 1154–1166. [Google Scholar] [CrossRef]
  43. Kulkarni, P.; Dutta, D.; Saigal, R. An Investigation of Techniques for Asymmetry Rectification. J. Mech. Des. 1995, 117, 620–626. [Google Scholar] [CrossRef]
  44. Cardone, A.; Gupta, S.K.; Deshmukh, A.; Karnik, M. Machining feature-based similarity assessment algorithms for prismatic machined parts. Comput. Aided Des. 2006, 38, 954–972. [Google Scholar] [CrossRef]
  45. Seifoddini, H.; Djassemi, M. Merits of the production volume based similarity coefficient in machine cell formation. J. Manuf. Syst. 1995, 14, 35–44. [Google Scholar] [CrossRef]
  46. Zehtaban, L.; Elazhary, O.; Roller, R. A framework for similarity recognition of CAD models. J. Comput. Des. Eng. 2016, 3, 274–285. [Google Scholar] [CrossRef]
  47. Stroud, I.; Nagy, H. Solid Modelling and CAD Systems: How to Survive a CAD System; Springer: London, UK, 2011. [Google Scholar] [CrossRef]
  48. Piegl, L.; Tiller, W. The NURBS Book, 2nd ed.; Springer: New York, NY, USA, 1996. [Google Scholar]
  49. Parry-Barwick, S.; Bowyer, A. Symmetry analysis and geometric modelling. In Proceedings of the DCTA’93, Digital Image Computing-Techniques and Applications, Sydney, NSW, Australia, 8–10 December 1993. [Google Scholar]
  50. Sipser, M. Introduction to the Theory of Computation, 3rd ed.; Cengage Learning: Boston, MA, USA, 2021. [Google Scholar]
  51. Blessing, L.; Chakrabarti, A. DRM, a Design Research Methodology; Springer: London, UK, 2009. [Google Scholar] [CrossRef]
  52. GrabCAD. Available online: https://grabcad.com/dashboard (accessed on 10 October 2022).
  53. PARTcommunity. Available online: https://b2b.partcommunity.com/community/ (accessed on 10 October 2022).
  54. TraceParts. Available online: https://www.traceparts.com/en (accessed on 10 October 2022).
  55. Li, Y.; Wang, W.; Tu, C. Optimal Sampling of Parametric Surfaces. Comput. Aided Des. Appl. 2012, 9, 55–60. [Google Scholar] [CrossRef]
Figure 1. Mechanical parts exhibit different types of symmetry (from left to right): (a) reflectional symmetry, (b) axisymmetry, (c) cyclic symmetry, and (d) translational symmetry.
Figure 1. Mechanical parts exhibit different types of symmetry (from left to right): (a) reflectional symmetry, (b) axisymmetry, (c) cyclic symmetry, and (d) translational symmetry.
Symmetry 15 01058 g001
Figure 2. Flowchart of the proposed framework for detection of exact global and partial symmetry.
Figure 2. Flowchart of the proposed framework for detection of exact global and partial symmetry.
Symmetry 15 01058 g002
Figure 3. An example of the string code designation.
Figure 3. An example of the string code designation.
Symmetry 15 01058 g003
Figure 4. Arrangements between two faces of the planar surface type: (a) parallel, (b) coplanar, and (c) arbitrarily angled.
Figure 4. Arrangements between two faces of the planar surface type: (a) parallel, (b) coplanar, and (c) arbitrarily angled.
Symmetry 15 01058 g004
Figure 5. An example of a partially axisymmetric part compound of cylindrical surfaces CY1, CY2, and CY3 which can be used to derive the axes of symmetry candidates.
Figure 5. An example of a partially axisymmetric part compound of cylindrical surfaces CY1, CY2, and CY3 which can be used to derive the axes of symmetry candidates.
Symmetry 15 01058 g005
Figure 6. Flow chart of the Symmetry Detection step.
Figure 6. Flow chart of the Symmetry Detection step.
Symmetry 15 01058 g006
Figure 7. The Symmetry Detector GUI.
Figure 7. The Symmetry Detector GUI.
Symmetry 15 01058 g007
Figure 8. An illustrative sample of the collected 3D CAD models.
Figure 8. An illustrative sample of the collected 3D CAD models.
Symmetry 15 01058 g008
Figure 9. Bar charts showing the relative frequencies of the surfaces for the collected 3D CAD models.
Figure 9. Bar charts showing the relative frequencies of the surfaces for the collected 3D CAD models.
Symmetry 15 01058 g009
Figure 10. A sample of CAD models with the detected planes and axes of symmetry.
Figure 10. A sample of CAD models with the detected planes and axes of symmetry.
Symmetry 15 01058 g010
Figure 11. Some typical CAD models with FN symmetry detection outcomes.
Figure 11. Some typical CAD models with FN symmetry detection outcomes.
Symmetry 15 01058 g011
Figure 12. Using the uv mid-point (e.g., u = 0.5 and v = 0.5) in the parameter domain to compute the center point on the surface may not necessarily represent the actual face center (left). To compute the face center, different values of the uv parameters may be required (right).
Figure 12. Using the uv mid-point (e.g., u = 0.5 and v = 0.5) in the parameter domain to compute the center point on the surface may not necessarily represent the actual face center (left). To compute the face center, different values of the uv parameters may be required (right).
Symmetry 15 01058 g012
Figure 13. Several illustrative examples of 3D CAD models exhibiting multiple reflectional symmetries which are also cyclic symmetric.
Figure 13. Several illustrative examples of 3D CAD models exhibiting multiple reflectional symmetries which are also cyclic symmetric.
Symmetry 15 01058 g013
Figure 14. Big-O charts of different steps of the symmetry detection framework.
Figure 14. Big-O charts of different steps of the symmetry detection framework.
Symmetry 15 01058 g014
Figure 15. Experimental time complexity of the symmetry detection framework.
Figure 15. Experimental time complexity of the symmetry detection framework.
Symmetry 15 01058 g015
Figure 16. Global Symmetry Index vs. Symmetrical Faces Index plot.
Figure 16. Global Symmetry Index vs. Symmetrical Faces Index plot.
Symmetry 15 01058 g016
Table 1. Different surface types and their relevant vector and point.
Table 1. Different surface types and their relevant vector and point.
Surface TypeRelevant VectorRelevant Point
Plane Normal vectorCentroid
CylinderOpenNormal vectorCenter
ClosedAxis vectorCentroid
ConeOpenNormal vectorCenter
ClosedAxis vectorCentroid
Sphere Normal vectorCenter
TorusOpenNormal vectorCenter
ClosedAxis vectorCentroid
RevolvedOpenNormal vectorCenter
ClosedAxis vectorCentroid
B-spline Normal vectorCenter
Table 2. An example of similar face pairs and their Cosine similarity scores.
Table 2. An example of similar face pairs and their Cosine similarity scores.
Face PairsCosine Similarity
Symmetry 15 01058 i0011
Symmetry 15 01058 i0020.93
Symmetry 15 01058 i0030.76
Symmetry 15 01058 i0040.67
Symmetry 15 01058 i0050.62
Symmetry 15 01058 i0060
Table 3. Results of F1-score.
Table 3. Results of F1-score.
TypeNo. of CAD Models
TP269
FP0
FN31
F1-score0.94
Table 4. The theoretically obtained time complexity of the symmetry detection framework.
Table 4. The theoretically obtained time complexity of the symmetry detection framework.
StepTime Complexity
B-rep AnalysisO(n)
Candidate generation and trimmingO(n2)
Symmetry DetectionO(n2)
VisualizationO(n)
Symmetry Detection FrameworkO(n2)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Buric, M.; Bosner, T.; Skec, S. A Framework for Detection of Exact Global and Partial Symmetry in 3D CAD Models. Symmetry 2023, 15, 1058. https://doi.org/10.3390/sym15051058

AMA Style

Buric M, Bosner T, Skec S. A Framework for Detection of Exact Global and Partial Symmetry in 3D CAD Models. Symmetry. 2023; 15(5):1058. https://doi.org/10.3390/sym15051058

Chicago/Turabian Style

Buric, Mladen, Tina Bosner, and Stanko Skec. 2023. "A Framework for Detection of Exact Global and Partial Symmetry in 3D CAD Models" Symmetry 15, no. 5: 1058. https://doi.org/10.3390/sym15051058

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop