detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a...

18
Computer-Aided Design 40 (2008) 76–93 www.elsevier.com/locate/cad Detecting approximate symmetries of discrete point subsets Ming Li * , Frank C. Langbein, Ralph R. Martin School of Computer Science, Cardiff University, Cardiff, UK Received 2 October 2006; accepted 5 June 2007 Abstract Detecting approximate symmetries of parts of a model is important when attempting to determine the geometrical design intent of approximate boundary-representation (B-rep) solid models produced e.g. by reverse engineering systems. For example, such detected symmetries may be enforced exactly on the model to improve its shape, to simplify its analysis, or to constrain it during editing. We give an algorithm to detect local approximate symmetries in a discrete point set derived from a B-rep model: the output comprises the model’s potential local symmetries at various automatically detected tolerance levels. Non-trivial symmetries of subsets of the point set are found as unambiguous permutation cycles, i.e. vertices of an approximately regular polygon or an anti-prism, which are sufficiently separate from other points in the point set. The symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed sets by one point at a time. Our symmetry cycle detection approach only depends on inter-point distances. The algorithm takes time O(n 4 ) where n is the number of input points. Results produced by our algorithm are demonstrated using a variety of examples. c 2007 Elsevier Ltd. All rights reserved. Keywords: Local approximate symmetry; Design intent; Reverse engineering 1. Introduction Many manufactured objects exhibit global and local symmetries as a feature of their design or function, or for ease of manufacturing or analysis [1]. Furthermore, symmetry is also common in natural shapes [2] and designers prefer symmetrical shapes for reasons of aesthetics and simplicity [3]. This is particularly true for engineering objects conventionally represented by boundary-representation (B-rep) models, such as the one shown in Fig. 1. While such symmetries may be explicitly represented along with a B-rep model, often they are not explicitly given, for example, where a model has been created by reverse engineering, or where a model has been transferred from one CAD system into another. Furthermore, in cases like these, the symmetries are often not exactly present, but only approximately present, due to measurement errors in the scanning process, and approximation and numerical errors in model reconstruction during reverse engineering [4]. Different Supported by EPSRC UK Grant GR/S69085/01. * Corresponding author. Tel.: +44 2920876751. E-mail addresses: [email protected] (M. Li), [email protected] (F.C. Langbein), [email protected] (R.R. Martin). CAD systems often use different tolerances [5], and what is symmetric in one CAD system may not be symmetric in another. Explicit detection of symmetries in such geometrical models has many potential uses: for example, to improve the shape of a model by enforcing intended symmetries, to enable faster analysis, to place constraints on editing operations, and so on. We are thus interested in detecting the symmetries intended by a designer in a B-rep model, but which are only approximately present. Our previous methods for geometric design intent detec- tion can detect global approximate symmetries [6], approxi- mate congruencies between sub-parts [7], and other local reg- ularities, e.g. parallel and orthogonal planes [8]. This paper considers a different issue not solved by such approaches: finding local approximate symmetries in a B-rep model. For example, the model in Fig. 1 has cylindrical holes arranged with an eight-fold rotational symmetry, and slots with a sixteen-fold rotational symmetry. To detect local symmetries, we use similar ideas to those used for global symmetric detection in [6,7]. As in these papers, we extract characteristic points from a solid model, which when used with connectivity and face type information, are sufficient to determine its symmetry, should symmetry 0010-4485/$ - see front matter c 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.cad.2007.06.007

Upload: others

Post on 10-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

Computer-Aided Design 40 (2008) 76–93www.elsevier.com/locate/cad

Detecting approximate symmetries of discrete point subsetsI

Ming Li∗, Frank C. Langbein, Ralph R. Martin

School of Computer Science, Cardiff University, Cardiff, UK

Received 2 October 2006; accepted 5 June 2007

Abstract

Detecting approximate symmetries of parts of a model is important when attempting to determine the geometrical design intent of approximateboundary-representation (B-rep) solid models produced e.g. by reverse engineering systems. For example, such detected symmetries may beenforced exactly on the model to improve its shape, to simplify its analysis, or to constrain it during editing. We give an algorithm to detectlocal approximate symmetries in a discrete point set derived from a B-rep model: the output comprises the model’s potential local symmetriesat various automatically detected tolerance levels. Non-trivial symmetries of subsets of the point set are found as unambiguous permutationcycles, i.e. vertices of an approximately regular polygon or an anti-prism, which are sufficiently separate from other points in the point set. Thesymmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed sets by one point at a time.Our symmetry cycle detection approach only depends on inter-point distances. The algorithm takes time O(n4) where n is the number of inputpoints. Results produced by our algorithm are demonstrated using a variety of examples.c© 2007 Elsevier Ltd. All rights reserved.

Keywords: Local approximate symmetry; Design intent; Reverse engineering

1. Introduction

Many manufactured objects exhibit global and localsymmetries as a feature of their design or function, or forease of manufacturing or analysis [1]. Furthermore, symmetryis also common in natural shapes [2] and designers prefersymmetrical shapes for reasons of aesthetics and simplicity [3].This is particularly true for engineering objects conventionallyrepresented by boundary-representation (B-rep) models, suchas the one shown in Fig. 1.

While such symmetries may be explicitly represented alongwith a B-rep model, often they are not explicitly given,for example, where a model has been created by reverseengineering, or where a model has been transferred fromone CAD system into another. Furthermore, in cases likethese, the symmetries are often not exactly present, but onlyapproximately present, due to measurement errors in thescanning process, and approximation and numerical errors inmodel reconstruction during reverse engineering [4]. Different

I Supported by EPSRC UK Grant GR/S69085/01.∗ Corresponding author. Tel.: +44 2920876751.

E-mail addresses: [email protected] (M. Li), [email protected](F.C. Langbein), [email protected] (R.R. Martin).

0010-4485/$ - see front matter c© 2007 Elsevier Ltd. All rights reserved.doi:10.1016/j.cad.2007.06.007

CAD systems often use different tolerances [5], and whatis symmetric in one CAD system may not be symmetric inanother.

Explicit detection of symmetries in such geometrical modelshas many potential uses: for example, to improve the shapeof a model by enforcing intended symmetries, to enable fasteranalysis, to place constraints on editing operations, and so on.We are thus interested in detecting the symmetries intended bya designer in a B-rep model, but which are only approximatelypresent.

Our previous methods for geometric design intent detec-tion can detect global approximate symmetries [6], approxi-mate congruencies between sub-parts [7], and other local reg-ularities, e.g. parallel and orthogonal planes [8]. This paperconsiders a different issue not solved by such approaches:finding local approximate symmetries in a B-rep model. Forexample, the model in Fig. 1 has cylindrical holes arranged withan eight-fold rotational symmetry, and slots with a sixteen-foldrotational symmetry.

To detect local symmetries, we use similar ideas to thoseused for global symmetric detection in [6,7]. As in thesepapers, we extract characteristic points from a solid model,which when used with connectivity and face type information,are sufficient to determine its symmetry, should symmetry

Page 2: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 77

Fig. 1. A B-rep model with many local symmetries.

be present. Essentially, these points are the vertices of theB-rep model, together with other special points needed tocharacterize curved edges and faces. For example, a straightline is characterized by its two end points, whereas for an edgeknown to be a circular arc, using one other point taken to be themid-point of the arc is sufficient to both fix its radius, and todetermine which of the two arcs between those end points wewant. A discussion of how to select these characteristic pointsis given in [7].

Note, then, that we start from a very different point of viewto symmetry approaches used in image processing, e.g. [9–12],and mesh processing [13–15]. These are designed to work ondense point data, where the point distributions are far moreimportant than locations of individual points. Generally, theiraim is to detect one or a few dominant approximate symmetriesby partial matching of images or meshes under user selectedtolerances. In contrast, we wish to find symmetries in B-repmodels that are intended to be exact, but are approximate dueto their origins. We furthermore wish to generate all possiblesubset symmetries, where any one may belong to quite a smallpart of the model (such as a hole, or row of slots in a complexmodel). We use as a basis a carefully selected and generatedpoint set from a B-rep model, not a dense point set coveringthe whole surface of the B-rep model. Our algorithm thusprocesses far fewer points than a mesh symmetry algorithm;in our algorithm, both the position, and existence, of everyindividual point is significant. However, we speculate that itmight be possible to apply our method to detecting symmetriesof meshes if a suitable means could be found for defining andextracting carefully chosen key feature points.

In summary, the main novel contribution of the paperis a rigorous definition of and an algorithm to detect localapproximate symmetries possessed by subsets of a set ofpoints in 2D or 3D. By letting this set of points be carefullychosen characteristic points extracted from a B-rep model asdescribed above, these approximate point subset symmetries inturn directly correspond to approximate local symmetries of anapproximate B-rep model. Finding approximately symmetricalsubsets of a point set is an important topic not addressedby previous work. Here we are considering points which the

symmetry maps in a one-to-one fashion onto each other. Mitraet al. [15] have considered the different problem of approximatemaps of dense point clouds representing part of the surface ofan object onto other dense point clouds from the same object—but these are not pointwise maps. Other related work is laterdiscussed in Section 2.

The detected symmetries include rotational symmetries androtation-reflection symmetries, i.e. vertices of an approximatelyregular polygon or an anti-prism. Each symmetry is representedas an unambiguous (permutation) cycle on that subset of points.Each symmetry corresponds to a transformation which maps asubset of the point set onto itself. As we assume that the inputmodel is approximate, the subset may only map approximatelyonto itself under the symmetry. A (permutation) cycle is asubset of a permutation whose elements trade places withone another. It describes the orbit of a single point underconsecutive application of a symmetry transformation (in theexact case), specifically under rotation and rotation-reflection.By unambiguous cycles we mean that the points involved inthe subset are sufficiently far away from other points in theinput point set, so that there is no chance of confusion as towhich point maps to which under the symmetry transformation,given its approximate nature. These ideas are explained morecarefully and rigorously in Section 3.

Note that in this paper we only concern ourselves withfinding each individual cycle separately. Thus, given a regularprism, we will output one cycle corresponding to the verticesat one end, and a separate cycle for the vertices at theother end—even though (at least in the exact case) these twopoint subsets share the same symmetry transformation. Clearly,extracting higher level information is important: merging thecycles found by the method given in this paper will beaddressed in future work. In the following, we shall alwaysmean a cycle when we talk about a symmetry, unless we sayotherwise.

Before we go further, we should just mention a specialcase. Clearly, every pair of points trivially defines an exacttwo-fold rotational symmetry, a reflection symmetry, and aninversion symmetry cycle. These cycles can be trivially ‘found’by simply enumerating every pair of points, and so arenot further discussed here. Thus, we consider how to findrotational symmetry cycles, i.e. vertices of an approximatelyregular polygon, and rotation-reflection symmetries, wherethe symmetry transformation comprises reflection in a planefollowed by rotation about an axis perpendicular to that plane,i.e. vertices of an anti-prism.

There are seven elementary symmetry transformations:reflection, inversion, translation, rotation, glide reflection,rotation reflection and screw translation [16]. However,discounting inversion and reflection, only two other kinds –rotation and rotation-reflection – have finite cycles (i.e. if weapply the symmetry operation enough times, the points go backto their original permutation). Translational symmetries, andglide reflections and screw translations, which are combinationsof translation respectively with reflection and rotation, mustalways be incomplete for finitely many points. Handlingincomplete symmetries, both of this kind, and e.g. incomplete

Page 3: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

78 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

rotational symmetries, is not straightforward and will also beaddressed in future work.

Although exact symmetry detection has been widely studied,e.g. [17,18], these methods cannot be directly extended toapproximate symmetries by simply replacing tests for equalityby tests for approximate equality. Algorithms for exactsymmetry detection rely on making local decisions about whichelements match under symmetry. For approximate symmetries,such decisions must be based on global properties. Pointmatching is no longer a Boolean property—points match to acertain degree, and in general, multiple potential matches haveto be considered, increasing algorithmic complexity [6].

We build on the basic idea of Brass’ work on detecting exactsubset symmetries [18]. For exact n-fold rotational symmetries,given three ordered points forming an isosceles triangle, theseuniquely determine a rotation mapping point one to point two,and point two to point three. Under recursive application of themap, we get point four and so on, expanding the initial seedset. During the expansion process, if a point is finally mappedback onto the first point, the expansion stops and the result is asymmetric regular polygon. While it is trivial to determine thesepoint mappings in the exact case, for approximate symmetriesthe points do not map exactly onto each other, but are onlymatched within a certain tolerance. Thus it becomes nontrivialto determine them.

Detecting local approximate symmetries raises furtherissues—which point subsets should be examined for symmetry,and under what tolerance they display symmetry. Thesetwo issues depend on each other. Our approach allows usto automatically determine tolerances at which approximatesymmetries of subsets are present, and does not requirepredefined tolerance bounds as input (also see [6]). Fixingsome coarsely chosen upper limit to acceptable tolerancescan help to reduce the number of unwanted approximatesymmetries detected. However, it cannot directly help in findinglocal approximate symmetries, where appropriate tolerancesmust be derived from the point set itself. Choosing tolerancesappropriate to the data is important, as typically for engineeringcomponents, quite different tolerances are used for differentfeatures of the same component.

Downstream processes may typically wish to merge thecycles found, or in other cases choose between them. Wenote that the tolerance information output by our method isimportant for any such processes which use the symmetries,e.g. to beautify reverse engineered models by solvinggeometrical constraint systems [8,19] or other applications forfurther selection between these detected symmetries [20]. Aftersymmetries at certain tolerances have been detected it is simplerto select suitable symmetries at suitable tolerances.

Based on the definition of global approximate symmetriesgiven in [6], we introduce in Section 3 a definition of ap-proximate subset symmetries, or unambiguous cycles, lead-ing to clear conditions under which approximate symmetriescan be said to be present. Using this definition, we thengive an algorithm for detecting approximate symmetries, byselecting symmetry seed sets and expanding them point by

point. The initial seed sets are approximate isosceles trian-gles. Each detected cycle that is sufficiently separate from otherpoints in the input point set represents an approximate subsetsymmetry.

We next discuss in more detail how our ideas are related toearlier work on exact and approximate symmetry detection. Ourdefinition of approximate symmetry is given in Section 3. Anoverview of our algorithm for finding approximate symmetriesin 2D is provided in Section 4, with further details in Section 5.Extension of the algorithm to 3D symmetry detection isgiven in Section 6. The time complexity of our symmetrydetection algorithm is analysed in Section 7. Practical examplesare discussed in Section 8, and conclusions are drawnin Section 9.

2. Previous work

We now discuss previous work on detection of exact andapproximate symmetry. Symmetry detection is used to referto two slightly different problems. Sometimes, it refers tofinding the symmetry transformation (if any) under which acertain point set is mapped onto itself. Alternatively, it canmean finding a symmetrical set which is close (according tosome similarity measure) to a set of points; in this case thetransformation itself need not be explicitly found. Symmetrydetection algorithms can be further classified as detectingeither global or subset (local) symmetries, and as trying tofind exact or approximate symmetries. Global symmetriesinvolve mapping the whole set onto itself, whereas subsetsymmetries only map a subset onto itself. The latter are harderto compute as the subset in addition to the symmetry has tobe identified. Exact symmetries preserve the point set exactlyunder transformation, whereas approximate symmetries mapthe point set onto itself within a tolerance. Different definitionsfor approximate symmetry exist depending on how matchingunder a tolerance is defined. This paper considers approximatesubset symmetries, for sets of discrete points. As noted earlier,such sets suffice to identify local symmetries in B-rep models.

Algorithms for detecting exact, global symmetries of pointsets and objects have been widely studied, e.g. [17,21–24].Exact symmetry detection for planar collections of points andlines can be done in O(n log n) time [21]. Detecting symmetriesof 3D point and line configurations, and polyhedra, has thesame complexity [17,21]. The basic idea used is to sort thepoints according to distances from the centroid, and then tocheck how many there are at each distance, which essentiallyreduces the complexity of the problem to that of a sortingalgorithm. Brass and Knauer [24] recently extended the ideato general 3D objects.

There are relatively few results on exact symmetriesof subsets. Brass [18] detects rotational symmetries byfinding rotational mappings based on isosceles triangles, andcombines them into symmetrical subsets efficiently using atree data structure. Mirror symmetries can easily be detectedby combining mirror planes generated by point pairs. This

Page 4: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 79

work was improved by Aloupis [25] using a randomisedapproach. Another approach to finding subset symmetriesin solid models was presented by Tate [26]. It is basedon matching pairs of edge loops and finding the isometriesthat relate them. The isometries are then grouped accordingto similarity. Their implementation finds mirror planes ofsymmetry.

Most previous work on approximate symmetries hasconsidered global approximate symmetries, using variousdefinitions of approximate symmetry. Iwanowski [27] pointedout that testing approximate symmetry in the plane is NP-hardif approximate symmetry is defined in terms of the existenceof an exactly symmetrical object near to the approximateobject. Alternatively, approximate symmetry may be definedas existence of a transformation mapping the point setapproximately onto itself within a certain tolerance; this yieldshigh-order polynomial time algorithms [22] for symmetrydetection. Mills et al. [6] give a method for approximateglobal symmetry detection that combines the combinatorialand geometrical nature of symmetries, resulting in a low-order polynomial time algorithm. A completely differentapproach to detecting global approximate symmetries is todefine an asymmetry measure [28,29]. Zabrodski [28] definesthis as the minimum, taken over all exactly symmetric shapeswith the desired symmetry, of the mean squared distancebetween points of the original shape and the symmetricalshape.

Finally, we turn to the case of approximate symmetriesof subsets of points. To our knowledge, no previous workaddresses this topic. (We again emphasize that we seekone-to-one correspondences between points, so our workis quite different from previous work on detecting localsymmetries in images e.g. [9,12] or meshes [14,15] whichuse dense sets of points). The difficulties of the problemlie in choosing point subsets for consideration, inferring thesymmetry transformations, and automatically determining thetolerance for each symmetry; furthermore, all of these issuesdepend on each other. The requirement to find all potentialapproximate symmetries at appropriate tolerances increases thedifficulty of the problem. We employ a similar definition ofapproximate symmetry to Mills et al. [6], but modify it sothat it can find subsets, based on the ideas for finding exactsymmetrical subsets given by Brass [18].

3. Approximate symmetries of point subsets

Exact symmetry is a well-defined concept and there areefficient algorithms to detect it. Approximate symmetry isharder to define—there is more than one way to do so,and to some extent, the most appropriate definition dependson the particular application. In this section, we give arigorous formalization of our particular concept of approximatesymmetry for use in design intent detection.

Throughout this paper we use the following notation:

Ed d-dimensional Euclidean space (here, d = 2or 3).

‖P − Q‖ Euclidean distance between points P, Q ∈ Ed .D(P) The set of distances {‖P − Q‖ : P, Q ∈ P} for a

set P of points.|P| The number of elements in a set P .brc The largest integer not greater than a real number

r .a = εb Equality of real numbers within tolerance ε:

|a − b| ≤ ε.a mod n Remainder of division of integer a by integer n

except when the remainder is 0 whereupon we setit to n as we use indices starting from 1.

Assume that a point set P has an exact, global symmetry.In Ed this symmetry T of P is fully determined by a mappingfrom d + 1 points S0 ⊂ P onto another d + 1 points S1 ⊂ P .The images of the remaining points P \S0 are fully determinedby mapping their distances from the points in S0 onto thecorresponding distances from the points in S1.

This mapping induces a permutation on the points in P .In the exact case these distances match exactly and uniquely,which allows for efficient symmetry detection algorithms thatextend partial matches to complete ones. In the approximatecase, however, T maps points and their distances onlyapproximately onto each other, and care is needed to find aglobally consistent matching between points. Just taking thebest match locally is insufficient, and in general, an expensivebacktracking approach is required. We have carefully chosenthe definition below for approximate symmetry so that it allowsan algorithm to be devised based on expanding local matcheswithout backtracking, enabling us to keep the efficiency of theapproach used in [6]. Approximate symmetry of a point set isdefined in terms of a permutation of the points which mapsdistances between the points approximately onto each other:

Definition 1 (Approximate Symmetry). Let P ⊂ Ed be a pointset. We call a pair (ε, σ ), for which ε ≥ 0 and σ is a permutationon P , an approximate symmetry of P if =ε is an equivalencerelation on D(P), and ‖P − Q‖ =ε ‖σ(P) − σ(Q)‖ for allP, Q ∈ P .

Note that an approximate symmetry with ε = 0 yields an exactsymmetry.

We now explain the ideas behind this definition. Thecondition that =ε forms an equivalence relation means thatthe set D(P) of all distances between the points P is groupedinto pairwise distinct subsets of approximately equal distances(equivalence classes). This partly recovers the exact matchingproperty of exact symmetries. In the exact case, given theimages P ′ of d + 1 points P , we can determine the otherpoints and their images by the distances from P and P ′. In theapproximate case with an arbitrary tolerance the distances onlymatch approximately and hence do not uniquely determine thepoints. By requiring that =ε forms an equivalence relation weavoid this situation: if two points have approximately (withinε) the same distances from a set of d + 1 points in P they

Page 5: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

80 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

Fig. 2. Some symmetries of a hexagon.

Fig. 3. Unambiguous symmetry.

are effectively identified with each other and treated as havingthe same approximate position. But note that this does not holdtrue for points not in P , which means for subsets we have tointroduce further conditions involving the complete point set.

For example, consider a 2D point set P = {Pk : 1 ≤

k ≤ 6} forming an approximate hexagon. Fig. 2 showsthree of its symmetries described by permutations: the mirrorsymmetry σ1 : (P1, P6), (P2, P5), (P3, P4) in Fig. 2(a); thethree-fold rotational symmetry σ2 : (P1, P3, P5), (P2, P4, P6)

in Fig. 2(b); and the six-fold rotational symmetry σ3 :

(P1, P2, P3, P4, P5, P6) in Fig. 2(c). If we were detectingsubset symmetries in the case in which P were a subset ofa larger point set, we would, however, only be interestedin detecting the six-fold symmetry σ3 for P . This is theonly symmetry whose permutation consists of a single cycle.The other permutations would be found at other times whenconsidering different subsets of the complete, larger point set.Thus, our algorithm detects symmetries in terms of singlecycles as these form the elementary symmetry structures of apoint set. In 2D the cycles correspond to the ordered verticesof regular polygons, while in 3D they may in addition be theordered alternate vertices taken from opposite ends of anti-prisms as further discussed in Section 6.2.

Following Definition 1, a tolerance interval Emin(C) ≤

ε < Emax(C) exists for ε at which a symmetry cycle C ispresent. These are called the minimal and maximal tolerancesof C. Emin(C) ensures equality of all the distances in the samedistance class—if Emin(C) were too small, various distanceswould no longer be considered equal, and the approximatesymmetry would no longer exist. Emax(C) separates differentclasses—if Emax(C) were too large, the approximate symmetrywould map a given point onto more than one possibility, and theapproximate symmetry would no longer be unambiguous. Werequire that Emin(C) < Emax(C) for C to be a proper cycle—see Theorem 1. Further discussion of this issue is given inSection 5.

For symmetries of point subsets in an input point set, wehave to consider another issue, to specify the subsets we areinterested in. Consider, for example in Fig. 3, P1, P2, P3,P4 construct an exact square and P5 is a point close to P4.

Fig. 4. Illustration of the expansion process.

Suppose P1, . . . , P5 form an input point set P . They yieldtwo subset symmetries given by the permutation cycles C1 :

(P1, P2, P3, P4), C2 : (P1, P2, P3, P5) at proper tolerancesε1, ε2 respectively, where ε1 < ε2. However, C2 is ambiguousas P5 can be replaced by P4 without changing the symmetrytransformation at tolerance ε2. We must avoid such cyclescontaining ambiguous points if the description of a symmetryby a cycle is to be unique. The following definition gives acondition for when a given cycle C belonging to a point setP is symmetric and sufficiently separate from the other pointsin P to avoid ambiguity: no point in P \ C can replace apoint in C such that C is still symmetric at the same tolerance.As an approximate symmetry can be present at a range oftolerance values, we must enforce this requirement at theminimal tolerance Emin(C).

Definition 2 (Unambiguous Cycle). Let C be a cycle formed bya subset of points from a point set P at the minimal tolerancee∗

= Emin(C). We say that C is unambiguous with respect to Pif C stops being a cycle at tolerance e∗ if we replace any pointin C by any point in P \ C.

Finally, we can now state what our algorithm computes:given a point set P ⊂ Ed , d = 2 or d = 3, our algorithmcomputes each of its unambiguous cycles Ck together with theirminimal tolerance εk = Emin(Ck), i.e. (Ck, εk), 1 ≤ k ≤ r .

4. Algorithm overview

In this section we provide an overview of our algorithm fordetecting approximate symmetries of a 2D point subset, eachrepresented as an unambiguous cycle. Further 2D algorithmdetails are given in Section 5. The algorithm for 3D point setsis similar, and is further described in Section 6.

The basic idea behind our symmetry detection algorithmcomes from the following ideas in the exact case. Let P1, P2, P3describe an isosceles triangle in which ‖P1 − P2‖ = ‖P2 − P3‖

and ‖P1 − P3‖ ≥ ‖P1 − P2‖ (see Fig. 4). These three pointsdefine a rotation, under a (partial) permutation that P1 movesto P2, and P2 moves to P3; this rotation potentially representsthe symmetry of a regular polygon. Suppose we now look foranother point P4 to extend this symmetry such that the rotationmaps P3 onto P4. We can find P4 by noting that P4 must satisfy‖P4 − P3‖ = ‖P2 − P1‖ and ‖P4 − P2‖ = ‖P3 − P1‖. Theseconstraints correspond to two possible locations for P4, andonly the one lying on the same side of the line P2 P3 as P1 isvalid and chosen. (In the approximate case we have to considerboth as explained below.) To proceed further, we can findthe next expansion point P5 by replacing (P1, P2, P3, P4) by

Page 6: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 81

Fig. 5. 2D approximate symmetry (unambiguous cycle) detection algorithm.

(P2, P3, P4, P5) in the above process. Applying this expansionprocess iteratively will eventually lead to a cycle correspondingto the ordered vertices of a regular polygon if it is present.

However, in the approximate case, determining the pointsinvolved in a symmetry using an expansion process is morecomplicated, due to the difficulty in determining whether twodistances are approximately the same, both because of the needto choose a tolerance, and due to the possible accumulation oferrors. To avoid accumulating expansion errors, we add furtherconstraints to determine the expansion point. For example, inorder to determine the expansion point P5 from the seed set(P1, P2, P3, P4) in Fig. 4, instead of simply requiring at sometolerance ε that ‖P5−P4‖ =ε ‖P4−P3‖ and ‖P5−P3‖ =ε ‖P4−

P2‖, we require the equality of all the distances within the samedistance group, i.e. ‖P5 − P4‖ =ε ‖Pk+1 − Pk‖, k = 1, 2, 3,‖P5 − P3‖ =ε ‖Pk+2 − Pk‖, k = 1, 2 and ‖P5 − P2‖ =ε ‖P4 −

P1‖. Note here that P5 is uniquely determined by these distanceequalities without any further conditions, at least in the exactcase.

Note that we do not base our approximate symmetrydetection algorithm on a predetermined tolerance, but instead,we find suitable tolerances as the algorithm proceeds. The ideasare based on three theorems discussed later in the paper. Weuse Theorem 1 to detect potential expansion points: if a pointP is to be a valid expansion point for seed set S, the followingrelationship must be satisfied: Emin(S∪{P}) < Emax(S∪{P});Emin(S ∪ {P}) and Emax(S ∪ {P}) are computed during thepoint expansion process from inter-point distances as explainedin detail in Section 5.2.2. However, more than one potentialexpansion point may exist in the input point set. We choosethe one which minimizes Emin(S ∪ {P}). This strategy tries toavoid adding any points that violate the unambiguity condition

while also ensuring that we always find any expansion pointwhich exists. Taking this idea further, a condition under whicha complete cycle can be found is provided in Theorem 2. Whilewe always choose the expansion point which minimizes thetolerance, this tolerance may increase as further points areadded during the expansion process. Hence, we still need tocheck the unambiguity condition for the final detected cyclebefore it is output; doing so is based on Theorem 3.

The algorithm itself, for detecting approximate symmetriesexpressed as unambiguous cycles, is listed in Fig. 5. It takes asinput a set of distinct 2D points P and outputs all unambiguouscycles as pairs (Ck, εk) where Ck lists the points in orderforming a cycle, and εk is the minimal tolerance at which Ckforms an unambiguous cycle. We assume no two input pointsare at the same location.

In Line 1 the output list of cycles T is initialized asempty. In Line 2 the distances between all pairs of points areprecomputed for efficiency. Lines 3–17 form an outer loop overall triples of points in P . These triples are seeds for the pointexpansion process, some of which will lead to unambiguouscycles. Each initial seed set forms an approximate, rather thanexact, isosceles triangle. The triple is put into an ordered list(P1, P2, P3) such that P1 maps to P2, and P2 to P3, and‖P1 − P3‖ ≥ ‖P2 − P3‖ ≥ ‖P1 − P2‖. We now considerexpanding a cycle starting from P1, P2, P3 (Line 3). Note thatthe same symmetry can be found starting with several differenttriples. Hence, we further check in Line 4 whether the triple isalready a contiguous part of a previously detected cycle and ifso, ignore it.

A given point triple may form an approximately regulartriangle, or may be expanded to a regular polygon with morethan 3 sides, or even both. We consider these cases respectively

Page 7: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

82 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

in Lines 5–7 and Lines 8–16. (Note that deciding which ofthese different cases is actually present in the model is notconsidered in this paper, but left as a problem for a downstreamprocess, guided by some higher level information: see [8]; herewe only detect what is unambiguously present in the modeldata). We first check, as a special case, if the three pointsform an approximately regular triangle, and output them if so(Lines 5–7). How this is done is described in Section 5.3.1.

We next check whether an unambiguous cycle containingmore than three points can be generated from the triple(Lines 8–16). To find the correct expansion point from a setS, first a set M of potential expansion points is determined(Line 9). As explained above, each such point P must satisfyEmin(S ∪ {P}) < Emax(S ∪ {P}). If any such points exist,i.e. M is not empty, we choose the point which minimizesthe tolerance required for the potential approximate symmetry(Line 11) and add it to S (Line 12). Expansion from theinitial three points is handled slightly differently from furtherexpansion points, as there are two possible locations for whichthe distances between the points match approximately, andthey both have to be considered, as we explain in detail inSection 5.3.2; this is omitted from the algorithm listing forsimplicity. Expansion stops when either no more expansionpoints can be found (Line 10) or a complete cycle has beendetected (Line 13). If a cycle is detected, we must further verifythat it satisfies the unambiguity condition, i.e. that there is noother point close to some point in S which can replace it andstill give the same symmetry at the same tolerance (Line 14). Ifverified, we accept this detected cycle as an unambiguous cycle(Line 15).

5. Unambiguous cycles of 2D point sets

We now give further details of our 2D unambiguous cycledetection algorithm outlined in Section 4. We first explore thebasic properties of the point expansion approach in Section 5.1.Using these ideas, we then show in Section 5.2 how to selectsuitable expansion points, compute the associated toleranceranges, and verify whether an expanded cycle is unambiguous.Section 5.3 considers conditions on the valid initial seed setsfor point expansion and how to expand them in the special caseof the fourth point.

5.1. Tolerance conditions for symmetry seed set expansion

In this section we derive the conditions imposing limits onthe tolerances under which a set S expanded by a point P maystill lead to an approximate symmetry. We also give theoremsstating when an expansion gives a cycle and when the cycleis unambiguous. We obtain these by analysing what conditionsare to be fulfilled for a list of consecutive points if they form acycle.

Let C ⊂ E2 be a cycle of c = |C| points at tolerance ε. Thecycle C = {Pk : 1 ≤ k ≤ c} can be seen as generated by apermutation that maps Pl to Pk , satisfying for each 1 ≤ r ≤

c − 1

‖Pl − P(l+r) mod c‖ =ε ‖Pk − P(k+r) mod c‖,

for 1 ≤ l, k ≤ c. (1)

Thus, all the distances between point pairs (Pl , Pk) with l −

k = r or l − k = c − r are approximately the same attolerance ε. Moreover, as =ε is an equivalence relation on theset D(C) of all distances between the points in C, each group ofdistances between point pairs with index differences r or c − rcorresponds to one equivalence class. Therefore the number ofdistance equivalence classes is bc/2c.

The equivalence classes play an essential role in theapproximate symmetry definition, Definition 1, and enforceconstraints on the tolerances allowed for a symmetrical set. Inthe following, we apply them to infer what condition a list ofconsecutive points should satisfy if it lies in a cycle.

Consider a subset S of s = |S| consecutive pointsPk+1, Pk+2, . . . , Pk+s from C, with indices taken modulo c.Clearly, Eq. (1) still holds for the distances between points inS and groups these in the same way as for C. We call a setwith such properties a (symmetry) seed set at tolerance ε. Thefact that the number of different distance classes in D(C) is

⌊ c2

⌋yields that the number of different distance classes in D(S) is

g(s, c) = min(

s − 1,⌊ c

2

⌋). (2)

Then for each 1 ≤ r ≤ g(s, c) we get a distance class

Gr (S) = {‖Pk − Pk+r‖ : 1 ≤ k ≤ s − r}

∪{‖Pk − Pk+r−c‖ : 1 ≤ k ≤ s + c − r}. (3)

Let

Drmin(S) = min(Gr (S)), Dr

max(S) = max(Gr (S)), (4)

respectively be the minimal and maximal distance in each classGr (S). Clearly, Dr

min(S) ≤ Drmax(S).

As S satisfies Eq. (1) and =ε is an equivalence relation onD(S), S being a seed set is equivalent to

Drmax(S) − Dr

min(S) ≤ ε, 1 ≤ r ≤ g(s, c),

Dr+1min (S) − Dr

max(S) > ε, 1 ≤ r ≤ g(s, c) − 1.(5)

These inequalities give a range of tolerance values ε for S tobe a seed set based on the actual distances between the pointsin S: ε must be large enough for all distances in each distanceclass Gr (S) to be approximately the same and small enough notto confuse different Gr (S). Furthermore, Eq. (5) is a conditionfor S being a seed set. Thus any subset of points satisfying Eq.(5) is a seed set which may lead to an unambiguous cycle C onexpansion.

For simplicity in the above tolerance condition derivation,we assume the potential cycle C that a seed set S may lie in (seeEq. (2)) is known. We discuss further in Section 5.2 how, duringthe point expansion process, the cycle and its size c = |C| aredetermined.

By defining the maximum size of all distance classes to bethe minimum matching tolerance

Emin(S) = max1≤r≤g(s,c)

(Drmax(S) − Dr

min(S)), (6)

Page 8: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 83

and the minimum distance between two consecutive distanceclasses as the maximum separation tolerance

Emax(S) = min1≤r≤g(s,c)−1

(Dr+1min (S) − Dr

max(S)), (7)

we can simplify Eq. (5) to

Emin(S) ≤ ε < Emax(S). (8)

Finally, then, to verify whether S is a suitable seed set, weonly have to check whether some ε exists for Eq. (8) to besatisfied, i.e. that:

Emin(S) < Emax(S). (9)

Thus Eq. (9) allows us to check the validity of a seed set withoutreference to any explicit tolerance ε, using only quantitiesderived from the set itself. We may now apply this result togive a condition to decide whether a seed set can be expanded:

Theorem 1. For a point set P ⊂ E2, let S ⊂ P be a seed set.The set S+ = S ∪ {P} with P ∈ P \ S is also a seed set if andonly if

Emin(S+) < Emax(S+). (10)

We now consider how to find Emin(S+) and Emax(S+).For each 1 ≤ r ≤ g(s + 1, c), let Dr

+ be the set of distancesbetween Ps+1 and the points in S that may have index gaps ror c − r to Ps+1 when Ps+1 is seen as the expansion point of S.We get

Dr+ =

{‖Ps+1 − Ps+1−r‖}, if s ≤

⌊ c

2

⌋;

{‖Ps+1 − Ps+1−r‖, ‖Ps+1 − Ps+1−(c−r)‖},

if s >⌊ c

2

⌋, r ≥ c − s.

Hence, we can write

Drmin(S+) = min(Dr

+ ∪ {Drmin(S)}),

Drmax(S+) = max(Dr

+ ∪ {Drmax(S)}). (11)

In the special case that r = g(s + 1, c) = s + 1, Drmin(S)

and Drmax(S) do not exist and we treat the sets {Dr

min(S)} and{Dr

max(S)} as empty.Eq. (11) tells us that instead of computing Dr

min(S+),Dr

max(S+), 1 ≤ r ≤ g(s + 1, c), based on Eq. (4), we canefficiently calculate them from the known values Dr

min(S),Dr

max(S), 1 ≤ r ≤ g(s, c), and the distance set Dr+. Similarly

this also leads to an efficient way to compute Emin(S+),Emax(S+).

From Eq. (11) it follows that Drmax(S+) ≥ Dr

max(S) andDr

min(S+) ≤ Drmin(S), and hence

Emin(S+) = max1≤r≤g(s+1,c)

(Drmax(S+) − Dr

min(S+))

≥ max1≤r≤g(s,c)

(Drmax(S) − Dr

min(S)) = Emin(S).

Similarly Emax(S+) ≤ Emax(S). Furthermore, Eq. (8) issatisfied for S+, so

Emin(S) ≤ Emin(S+) ≤ ε < Emax(S+) ≤ Emax(S), (12)

i.e. the additional point distances introduced by adding a newpoint to S such that the expanded set S+ remains a seed setgenerally reduces the range of valid tolerance values ε.

We now consider how expansion terminates. An initial seedset S is expanded consecutively by finding additional pointssatisfying Eq. (10) until either no further expansion points exist,or a cycle is found. In the former case there is no symmetry, asthere is no cycle. In the latter case the fully expanded seed setS is a symmetrical set at tolerance ε = Emin(S) < Emax(S) asit satisfies Eq. (1) and =ε is an equivalence relation on D(S).

A seed set describes a complete cycle if ‖Ps+1 − P1‖ ∈

G1(S), because in this case due to the definition of Gr (S), Eq.(3), we have k = s+1, r = 1, k+r −c = 1 and hence s+1 = c.Thus we get

Theorem 2. Let P ⊂ E2 be a point set and S ⊂ P withs points P1, P2, . . . , Ps ordered in sequence by the expansionprocess according to Theorem 1. S describes a cycle if ‖Ps −

P1‖ ∈ G1(S) and is approximately symmetric at toleranceEmin(S).

Note how our algorithm avoids accumulating expansionerrors by considering all possible distances to all other pointsin the seed set S. Errors could rapidly accumulate if the processsimply determines an expansion point merely by its distancesto the three previous points in the seed set.

A cycle S for a point set P is only unambiguous withrespect to P if there is no point in P \ S close to the pointsin S with respect to the symmetry tolerance ε. The followingtheorem, which follows from the above considerations, givesthe condition to verify this after a complete cycle has beenfound.

Theorem 3. Let C = {Pk, 1 ≤ k ≤ c} be a cycle withinP ⊂ E2 at tolerance ε = Emin(C). For each point Pk , letCk

−(P) be the point set generated by replacing Pk by anotherpoint P ∈ P \ C. C is an unambiguous subset of P if and onlyif Emin(Ck

−(P)) > ε for all choices of P ∈ P \ C.

How to efficiently apply the theorem to check unambiguity of acycle is further explained in Section 5.2.1.

5.2. Symmetry seed set expansion

In this section we illustrate in detail the point expansionprocess of a seed set S with s = |S| ≥ 3, such that theexpansion leads to an unambiguous cycle. How to obtain seedsets consisting of three points from the input set P is describedin Section 5.3. Repetitive application of this point expansionprocess is used in the overall algorithm to find unambiguouscycles.

5.2.1. Expansion point selectionThis section describes how to expand a seed set by

an additional point and verify that a resulting cycleis unambiguous. We use Theorems 1–3 for expansionpoint selection, the termination condition, and unambiguityverification respectively.

Page 9: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

84 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

Given a seed set S within an input point set P ,selecting a unique expansion point (if one exists) requires thedetermination of a suitable tolerance ε: once this has beendone, the unique expansion point P ∈ P \ S fulfilling Eq. (8)can be determined. Eq. (12) tells us that adding an additionalpoint may cause the range Emin(S) to Emax(S) of acceptabletolerance values to become narrower. Theorem 1 tells us thatwe can expand S by adding an additional point as long as somepoint exists for which this interval does not become empty. Wechoose amongst these points, if there are several, by taking theone which keeps the tolerances smallest, as we describe shortly.

Note that at no time during the expansion process are weable to fix a specific value for the tolerance ε. If we were toset ε to the minimal tolerance in the initial set Emin(S), thenit might not be possible to expand the initial set to a cycle asthis value could be too restrictive. Moreover, even if we wereto try all possible initial seed sets, and set the tolerance fromthem, the tolerance might have to be increased when addingadditional points as indicated by Eq. (12).

If we were to choose a tolerance ε larger than necessary,e.g. Emax(S) − δ for a very small δ, to include the additionalpoint in the symmetry, it might be possible to replace certainpoints in S with other points from P at the tolerance, violatingthe unambiguity condition, when a smaller value of ε would nothave this problem. In Fig. 3, for example, if we expand fromS = {P1, P2, P3} at tolerance Emax(S), Eq. (8) is satisfied byadding either P4 or P5. However, P5 is an unnecessary pointand can actually be ruled out using a smaller tolerance, say‖P4 − P5‖/2.

So instead of fixing the tolerance, we keep track of thetolerance interval and check whether there is any expansionpoint which can be added while keeping the tolerance withinthe interval given in Theorem 1.

To select a unique expansion point, we consider eachpotential expansion point P ∈ P \ S satisfying Emin(S+) <

Emax(S+) for S+ = S ∪ {P}. We compute Emin(S+) andchoose as the expansion point the one for which this toleranceis minimal.

If there is no point in P \ S satisfying Emin(S+) <

Emax(S+), no valid expansion point can be found and theexpansion process stops. If there is more than one pointminimizing Emin(S+), we have multiple expansion points andexpansion will also stop. However, using real arithmetic, sucha situation is unlikely to arise in practice.

Only after a complete cycle has been found, by checking thecondition ‖Ps+1 − P1‖ ∈ G1 (Theorem 2) for the expansionpoint Ps+1, can we compute the actual minimal tolerance forthe approximate symmetry. However, the resulting cycle maynot be unambiguous with respect to the input point set P , andfurther checking is required based on Theorem 3 as we nowexplain. For example, in Fig. 6, P1, P2, P3, P4 are points of anexact six-fold rotation. P5 does not exactly lie in the set, andP ′

4 is a point close to P4. Starting from P1, P2, P3, we find thenext expansion point P4 with a tolerance ε = 0 rather than P ′

4,which gives a larger tolerance ε′ > 0. The expansion processcontinues with P5 which increases the tolerance ε. At this newtolerance, it may be possible that P ′

4 can be used to replace P4

Fig. 6. Verification of unambiguity condition of a cycle.

while giving the same symmetry. We cannot simply concludethat P ′

4 can replace P4 simply based on ε > ε′, however, asthese tolerances are not based on the final cycle.

Unambiguity verification must be based on Theorem 3.Specifically, suppose C = {Pl : 1 ≤ l ≤ c} is a cycle of P attolerance ε = Emin(C) and let Ck

−(P) be the point set generatedby replacing Pk with another point P ∈ P \C. We need to checkthat for each 1 ≤ k ≤ c

Emin(Ck−(P)) > ε (13)

for each point P ∈ P \ C. However, instead of applying thisdirectly, we note that, for k > 3, if the point set Ck

− ∪ {P} issymmetrical, it must satisfy Emin(S∗

∪{P}) < Emax(S∗∪{P})

for S∗= {Pl , 1 ≤ l ≤ k − 1}. Hence, for each seed set

S = {Pk, 1 ≤ k ≤ s} generated during the point expansionprocess, if Ps+1 is the unique point in P \ C such that Emin(S ∪

{P}) < Emax(S ∪ {P}), we know that Eq. (13) will not besatisfied. If more than one point exists in P \ C such thatEmin(S ∪ {P}) < Emax(S ∪ {P}) is satisfied, we only needto verify Eq. (13) for these points to improve the algorithm’sefficiency.

As can be seen from the above, the validity and efficiencyof the point expansion approach mainly depends on thecomputation of Emin(S+) and Emax(S+) from given Emin(S)

and Emax(S), which we discuss next.

5.2.2. Minimal and maximal tolerance computationIn this section, an efficient algorithm is given for the

computation of Emin(S+) and Emax(S+) for P ∈ P \ S, whereS = {Pk : 1 ≤ k ≤ s} is a given seed set and S+ = S ∪ {P}.Eq. (11) is used for the computation of Dr

min(S+), Drmax(S+),

1 ≤ r ≤ g(s+1, c), from the known values Drmin(S), Dr

max(S),1 ≤ r ≤ g(s, c) where s = |S| and c is the number of pointsin the c-fold rotational symmetry that S may finally produce.While we do not know c in advance, it can be computed duringpoint expansion as described below.

Let Lk = ‖P − Ps+1−k‖, 1 ≤ k ≤ s. From Eq. (2), it can beseen that g(s+1, c) = g(s, c) or g(s+1, c) = g(s, c)+1. UsingEq. (11) for the computation of Dr

min(S+) and Drmax(S+), we

just need to decide which distance class Gr (S+), 1 ≤ r ≤

g(s + 1, c), each Lk , 1 ≤ k ≤ s should lie in if S+ is also aseed set. This is based on the following observation dependingon the slot P occupies in the symmetry:

1. If s ≤ bc/2c, Lk increases with k (see Fig. 7(a)).2. If s > bc/2c and c is an odd integer, Lk increases with

k at first until it reaches a maximum at k = bc/2c andk = bc/2c + 1 and then decreases (see Fig. 7(b)).

Page 10: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 85

Fig. 7. Various cases of distance classes during the point expansion process.

3. If s > bc/2c and c is an even integer, Lk increases with kat first until it reaches a maximum at k = bc/2c and thendecreases (see Fig. 7(c)).

Therefore, in each step of our consecutive point expansion,as s increases, we can determine whether Lk has reached amaximum. If not, we must have Lk ∈ Gk(S+); otherwise wecan now determine c. Once we know c, the computation ofDr

min(S+) and Drmax(S+) can be based on Eq. (11). Further

details are now explained.Suppose c is not yet known. In this case, we know that

s ≤ bc/2c. Therefore, g(s, c) = s − 1 and correspondingly,Ds−1

min (S) = Ds−1max(S). Furthermore, we have Lk ∈ Gk(S+),

1 ≤ k ≤ s − 1. However, Ls may possibly belong to any ofGs−2, Gs−1 or Gs for c = 2(s − 1), c = 2s − 1 and c ≥ 2srespectively, when S+ is a seed set. In Fig. 7, for example,given S = {P1, P2, P3, P4} for a valid expansion point P , cases(a), (b), (c) are those for which L4 belongs to G4, G3 and G2

respectively. Therefore, in order to decide to which distanceclass Ls actually belongs, we compute Emin(S+) and Emax(S+)

for the three possibilities of adding Ls to Gs , Gs−1 and Gs−2. Lsis then added to the class such that Emin(S+) has the smallestvalue while Emin(S+) < Emax(S+). If Ls is added to Gs , weleave c undetermined, and to get the next expansion point afterthis one, the above process is repeated. If Ls is added to Gs−1,we set c = 2s − 1. If Ls is added to Gs−2, we set c = 2(s − 1).Once c has been determined, Dr

min(S+) and Drmax(S+) can be

computed according to Eq. (11).Note that we do not estimate c from the angles set up by each

consecutive triple of points in S, since it is difficult to say in theapproximate case which c-fold rotational symmetry an anglecorresponds to without additional information (especially whenc is large). The above approach is compatible with our pointexpansion principle, choosing the point P that makes Emin(S+)

minimal among all points in P \ S.The following observation further simplifies the computa-

tion required during the point expansion. For a valid expansionpoint P , Emin(S+) < Emax(S+) must be satisfied. From Eqs.(6) and (7), we have that

max1≤k≤s

(|Lk − Dk′

min(S)|, |Lk − Dk′

max(S)|)

≤ Emin(S+) < Emax(S+) ≤ Emax(S),

where k′= k when k ≤ c or k′

= k − c when k > c. Thus, Lkmust lie in the open interval (Dk′

min(S) − Emax(S), Dk′

max(S) +

Emax(S)) for a valid expansion point, and we can ignoreany point not meeting this condition. This simple observationgreatly reduces the amount of computation required since mostpoints in P \ S typically fall into this category.

5.3. Initial symmetry seed sets

Finally, we describe in Section 5.3.1 conditions on a properinitial seed set consisting of three points for them to produce apotential cycle, and in Section 5.3.2 how to compute the firstexpansion point (which must be treated as a special case) fromsuch an initial seed set.

5.3.1. Conditions on initial seed setsOur point expansion process considers all unordered triples

of points in the input point set as candidates for cyclegeneration. However, Eq. (9) adds further conditions on aninitial seed for it to be capable of producing cycles, as we nowexplain. For this, let an initial seed set triple be the three pointsP1, P2, P3. Without loss of generality we assume the points areordered such that ‖P1 − P3‖ ≥ ‖P2 − P3‖ ≥ ‖P1 − P2‖.

First we consider the possibility that S possesses a three-foldrotational symmetry. In this case the minimal tolerance for S isEmin(S) = ‖P1 − P3‖ − ‖P1 − P2‖, the maximal differencebetween the edge lengths amongst these points. In order forthese points to represent a three-fold symmetry, in which wecannot confuse two points, we require that Emax(S) = ‖P1 −

P2‖. Hence, from Eq. (9),

‖P1 − P3‖ ≤ 2‖P1 − P2‖. (14)

Now suppose that S may be expanded to a symmetric setpossessing a c-fold symmetry with c > 3 and correspondinglyg(s, c) ≥ 2 (see Eq. (2)). From Eqs. (6) and (7) we obtain

Emin(S) = ‖P2 − P3‖ − ‖P1 − P2‖,

Emax(S) = ‖P1 − P3‖ − ‖P2 − P3‖.

For S to be a valid seed set, it must satisfy Emin(S) < Emax(S),i.e.

2‖P2 − P3‖ < ‖P1 − P3‖ + ‖P1 − P2‖. (15)

If only one of Eqs. (14) and (15) is satisfied, wecan immediately decide whether the points have three-foldsymmetry, or c-fold symmetry for some c > 3. However,Eqs. (14) and (15) are frequently both satisfied, specifically, if2‖P2−P3‖ < 3‖P1−P2‖. In this case, S can be plausibly eithera regular triangle or a suitable seed set for point expansion;this happens, for example, for the seed set S = {P1, P2, P3}

in Fig. 6. In such situations, we output both as potentialsymmetries detected in the point set (the problem of decidingwhich one should be present is left for downstream processing,where higher level information may be used; also see [8]).

5.3.2. Initial symmetry seed set expansionExpansion from the initial seed set S of three points is

different from the general point expansion process for a seedset S of |S| > 3 points, as we now discuss.

Before considering what may happen when we expand aninitial seed set S = {P1, P2, P3} in the approximate case, wefirst discuss the exact case (i.e. ε = 0). Eq. (1) requires that the

Page 11: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

86 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

Fig. 8. Special cases for point expansion.

following conditions must be satisfied for an expansion pointP4 with ε = 0:

‖P4 − P3‖ = ‖P2 − P3‖ = ‖P1 − P2‖,

‖P4 − P2‖ = ‖P1 − P3‖. (16)

These conditions determine two possible locations for P4,denoted P4 and P ′

4: see Fig. 8(a). They are the intersectionpoints of two circles with centre P3 and radius ‖P2 − P3‖, andcentre P2 with radius ‖P1 − P3‖. However, only P4 can leadto rotational symmetry and is the desired expansion point. Thetwo points can be distinguished in the exact case by which sideof the line P2 P3 they lie on. Specifically, we choose the pointP which lies on the same side of the line P2 P3 as P1 as theexpansion point, i.e. the point which fulfils

((P − P3) × (P2 − P3)) · ((P3 − P2) × (P1 − P2)) > 0. (17)

For ε > 0 the case is less straightforward, especially ifP1, P2, P3 almost lie in a line, which corresponds to a c-fold rotational symmetry with large c. In this case determiningthe sign of the left hand side of Eq. (17) is ill posed due tonumerical instabilities. Furthermore, note that a point which lieson the wrong side of the line may still belong to an approximatesymmetry. For example, see Fig. 8(b). Starting from the initialseed set S = {P1, P2, P3}, the point P4 should still be selectedeven though it lies on the opposite side of P2 P3 from P1: asymmetric set with small tolerance can still be generated usingthis point.

Our solution to this problem is to consider points on bothsides of the line and check whether a complete cycle can befound. In the exact case, if we expand P1, P2, P3, P4 further, weget a potential cycle, while exact expansion from P1, P2, P3, P ′

4would produce a zig-zag line, not a cycle. Consider Fig. 8,for example. Applying a further expansion step from bothS∪{P4} and S∪{P ′

4}, we would obtain P5 and P ′

5 respectively.P1, . . . , P5 form a seed set that may finally lead to a cycle,while P1, P2, P3, P ′

4, P ′

5 only yield a zig-zag line.Now consider the approximate case (ε > 0). Denote by P∗

the set of all points fulfilling Emin(S ∪ {P}) < Emax(S ∪ {P}),P ∈ P \ S. This set is divided into two categories: pointsP∗

s lying on the same side of the line P2 P3 as P1, and pointsP∗

d lying on the opposite side. We choose whichever pointminimizes Emin(S ∪ {P}) in P∗

s , and again in P∗

d , and dofurther point expansion from both in order not to lose potentialsymmetries. No unnecessary symmetries will be introducedby this strategy, as further explained. Provided we have no

symmetries like those in Fig. 8(b), expansion from the pointchosen from P∗

s produces a cycle (if it exists), while the pointfrom P∗

d can only give a zig-zag line. If, however, we have acase like Fig. 8(b), the selected points from P∗

s and P∗

d mayproduce two cycles which are only different in the fourth point,and are otherwise very close to each other. Selection betweenthem will be decided by further unambiguity checking—eitherone of them will be chosen, or neither of them.

Note that this situation can only arise when expanding aninitial seed set consisting of three points. If s = |S| ≥ 4,Ps+1 is uniquely determined by the point P that minimizesEmin(S ∪ {P}) amongst all valid expansion points in P \ S,as illustrated in Section 5.2.1.

6. Unambiguous cycles of 3D point sets

In this section we describe the modifications needed to our2D unambiguous cycle detection algorithm for 3D point sets.It is again based on the idea of expanding an initial seed setconsisting of three points. The main difference is that in the 3Dcase, we have to consider rotation-reflection cycles, i.e. verticesof an anti-prism, as well as rotation cycles.

6.1. Unambiguous cycle types in 3D

The unambiguous cycles that can arise in 3D are the orderedvertices of the following shapes: tetrahedrons, regular polygonsand anti-prisms (alternate vertices taken from opposite ends).Here, again, we start by considering exact symmetries of suchtypes.

The following theorem states the condition under which aninitial seed set can only be expanded into a point sequence lyingin a plane, leading to symmetry defined by a regular polygon:the fourth expansion point lies on the plane determined by theinitial seed set. As in the 2D case, expansion points from aninitial seed set are still determined by the distance constraintsas prescribed by Eq. (1) for ε = 0 or equivalently Emin(S) = 0.

Theorem 4. Assume throughout the tolerance ε = 0. LetS = {Pk : 1 ≤ k ≤ 4} ⊂ E3 be a coplanar seed set. Thenext expansion point P5 is uniquely determined by S such thatS ∪ {P5} is a seed set, and any further expansion of S resultsin a coplanar set.

Proof. A seed set is only prescribed by the distances betweenits points. From the analysis in 2D, P4 may lie to the left or rightof the line P2 P3 in the plane P1, P2, P3. We assume that P4 lieson the same side of the line P2 P3 as P1. The proof of the casewhere P4 lies on the other side proceeds in a similar manner.From Eq. (1), the fifth expansion point from S is determined by

‖P5 − P4‖ = ‖P1 − P2‖, ‖P5 − P3‖ = ‖P1 − P3‖,

‖P5 − P2‖ = ‖P1 − P4‖. (18)

This means that P5 lies at the intersection of three spheres: S1with centre P4 and radius ‖P1 − P2‖, S2 with centre P3 andradius ‖P1 − P3‖, S3 with centre P2 and radius ‖P1 − P4‖.S1 and S2 always intersect in a circle C with centre O on theline P3 P4 (see Fig. 9(a)). Let P5 and P ′

5 be the intersection

Page 12: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 87

Fig. 9. Analysis of 3D point expansion.

points between circle C and plane P1, P2, P3. P5 lies on thesame side of line P3 P4 as P2 and P ′

5 lies on the other side.P5 is the unique expansion point we are looking for. Firstly,‖P5 − P2‖ = ‖P1 − P4‖, as the polygons P1, P2, P3, P4 andP2, P3, P4, P5 are congruent. Next, as the line P2 P5 is parallelto P3 P4 and P3 P4 is perpendicular to the plane the circle C liesin, line P2 P5 is also perpendicular to the plane of C . Thus, thedistance between P2 and all other points on C than P5 is greaterthan ‖P2 − P5‖. Thus P5 is the unique point satisfying Eq. (18).

We now give a further analysis for other 3D symmetries.Let {P1, P2, P3} be an initial seed set of 3D points (see

Fig. 9(b)), and P4 be the next expansion point determinedby Eq. (1) at ε = 0. Hence, P4 must lie on the circle Cformed by the intersection of two spheres, with centre P3 andradius ‖P2 − P3‖, and P1 with radius ‖P1 − P3‖, respectively.Depending on the different locations of P4, different types ofsymmetry are possible.

Clearly, a regular tetrahedron is produced if all the distancesbetween each pair of points are the same. As noted inTheorem 4, if P4 lies on the plane P1 P2 P3, the points canbelong to a regular polygon. Finally, suppose P4 does notlie in the plane P1 P2 P3, and the dihedral angle (at edgeP2 P3) between the adjacent triangles P1 P2 P3 and P2 P3 P4 isβ. Continuing from P1, P2, P3, P4 there are two possibleexpansion points, P5 and P ′

5, such that Eq. (18) is satisfied (seeFig. 9(c)). P5 and P ′

5 lie on different sides of plane P2 P3 P4 andthey determine two triangles P3 P4 P5 and P3 P4 P ′

5 respectively,each of which makes a dihedral angle β with triangle P2 P3 P4along edge P3 P4. Suppose P5 lies on the same side of the planeP2 P3 P4 as P1 while P ′

5 on the other side. In a similar manner tothe 2D case, further expanding (P1, P2, P3, P4, P ′

5) produces azigzag line in 3D space, which is caused by evenly distributedpoints on a helix (leading to an infinite screw symmetry, whichwe ignore here). In the other case, (P1, P2, P3, P4, P5) leads toa uniquely determined rotation-reflection symmetry case.

In 3D, when finding unambiguous cycles involving thedetection of the orbit of a single point, there are twocases to consider: isometries which preserve orientation andisometries which invert the orientation of space. The orientationpreserving isometries are rotations giving regular polygonsas unambiguous cycles. The orientation inverting isometriesconsist of combinations of rotations and reflections, whichmeans we have to also consider elementary rotation-reflectionsymmetries as described above.

6.2. Point expansion in 3D in the approximate case

Section 6.1 analyses the cycles that may arise in 3D in theexact case. Based on these ideas, we now explain how similar

cycles can be obtained in 3D in the approximate case using apoint expansion approach starting from an initial three-pointseed set. In particular, we illustrate how the point expansionprocess used in the 2D case can be applied in 3D to rotation-reflection symmetry detection.

The core algorithm used for 3D unambiguous cycledetection is similar to the one used in 2D. Given an initial seedset S = {P1, P2, P3} taken from the input point set P ⊂ E3,we choose all possible expansion points P4 and then expandfurther from each of them if possible. As noted in Section 6.1,the fifth expansion point can be in two different positions ofwhich only one can lead to a valid unambiguous cycle. Thus,following a similar approach to the 2D case, we divide allpotential expansion points into two sets according to which sideof the plane P2 P3 P4 they lie on and use the same reasoningas in the 2D case to find in each set an optimal expansionpoint leading to an unambiguous set, if one exists. Finally, itsunambiguity condition is checked as in the 2D case.

However, applying this expansion process directly preventscertain rotation-reflection symmetries from being detected.This is because for a regular polygon, the distance equivalenceclasses as defined by Eq. (3) increase (in the sense of theirelements) as r (the index difference between points as used inEq. (3)) increases, but this is not satisfied for an anti-prism. Wehandle this case by distinguishing distance classes that containdistances between points at opposite ends of an anti-prism fromclasses containing distances between points from the same endof the anti-prism, as we now explain.

We recall some ideas from 2D point expansion: we startwith a 2D seed set S, s = |S| with maximal and minimaldistances Dr

min(S), Drmax(S), 1 ≤ r ≤ g(s, c) for each distance

class as defined by Eq. (4). For any point P ∈ P \ S we letLk = ‖P−Ps+1−k‖, 1 ≤ k ≤ s. The point expansion algorithmis based on Theorem 1, which states that the next expansionpoint P must satisfy Emin(S + {P}) < Emax(S + {P}). Thecomputation of Emin(S + {P}), Emax(S + {P}) involves twoimportant monotonicity conditions:

(i) Drmin(S) ≤ Dr

max(S) < Dr+1min (S) ≤ Dr+1

max(S) for S to be avalid seed set, which can be seen from Eq. (5);

(ii) Lk increases with k at first until a maximum is reached atk =

⌊ c2

⌋and then decreases (see Section 5.2.2).

In 3D, however, these monotonicity properties are in generalnot satisfied by a point set with rotation-reflection symmetry.For example, consider the points forming a rotation-reflectionsymmetry in Fig. 10. We may have ‖P5 − P3‖ < ‖P5 − P4‖

or even ‖P5 − P1‖ < ‖P5 − P4‖ if we increase the distancebetween the points on the top plane and bottom plane along thenormal direction. In such cases Emin(S +{P}), Emax(S +{P})

have to be handled differently so that Theorem 1 remains valid.When rotation-reflection symmetry is present, if we split

each set Drmin(S), Dr

max(S) and Lk into subsets with evenand odd indices, denoted as Dr,o

min(S), Dr,emin(S), Dr,o

max(S),Dr,e

max(S) and Lok, Le

k , we can see that a monotonicity conditionsimilar to the 2D condition (conditions (i) and (ii) listedabove) is separately satisfied by each subset. We can thenconsider the even and odd cases separately first, and then

Page 13: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

88 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

Fig. 10. Crown symmetry detection.

combine them together for rotation-reflection cycle generation.Specifically, for each point P ∈ P \ S, we first compute fromDr,o

min(S), Dr,omax(S), Lo

k and Dr,emin(S), Dr,e

max(S), Lek as described

in Section 5.2.2 to give Eomin(S ∪ {P}), Eo

max(S ∪ {P}) andEe

min(S∪{P}), Eemax(S∪{P}) respectively. If E x

min(S∪{P}) ≥

E xmax(S ∪ {P}) for x = o or x = e, the point P is not a

valid expansion point. Otherwise, we next set Emin(S ∪{P}) =

max(Eomin(S ∪ {P}), Ee

min(S ∪ {P})) and Emax(S ∪ {P}) =

min(Eomax(S ∪{P}), Ee

max(S ∪{P})) to maintain the interval ofvalid tolerances. If Emin(S ∪ {P}) ≥ Emax(S ∪ {P}), the pointis again not a valid expansion point. A similar idea is used togeneralize the unambiguity verification from 2D to 3D usingthe same computation for Emin(S ∪ {P}).

Finally, based on the above analysis, we note that for arotation-reflection symmetry, it may be possible that ‖P1 −

P3‖ < ‖P1 − P2‖ for the initial seed set. So the conditionon finding the initial three points for the seed set is relaxed tomax(|‖P1 − P3‖−‖P1 − P2‖|, |‖P1 − P3‖−‖P2 − P3‖|) < ε∗

with ε∗= min(‖P1 − P2‖, ‖P2 − P3‖, ‖P1 − P3‖).

7. Time complexity

The time complexity of our algorithm is O(Cn4), where n isthe number of points in the input point set and C is the maximalsymmetry order present (usually a small integer). This is easilyseen as all triples of points are taken as seed points, and theneach remaining point is considered as an expansion point ateach step until we have a cycle (or we exit without finding one).

Brass’ [18] presents a deterministic algorithm to find allexact local symmetries in O(n2.136+ε) time. Aloupis et al. [25]improve this using a randomised algorithm which can detectregular polygons with high probability in O(n2.068+ε) time.Although the time order of these algorithms is smaller, theyonly solve the exact problem and approximate symmetrydetection is much more complex as global properties have to beconsidered. No previous work on approximate local symmetry(i.e. regular polygon) detection exists as far as we know.Finding global approximate symmetry is NP-hard under thedefinition of Iwanowski [27]. Under other different definitionsprovided to facilitate detection, approximate global symmetrydetection requires high-order polynomial time: O(n8) usingAlt et al.’s method [22] and O(n3.5 log4 n) using Mills et al.’smethod [6]. In this context, we consider time O(n4) to beacceptable.

For large point sets, in the approximate case, there ispotentially a large number of unambiguous cycles. To increasethe speed of the algorithm, as well as the usefulness of theanswers, we suggest that feature detection algorithms, such asregularity feature trees [30], may help to reduce the complexity

of the problem for practical use, by dividing the input intoseveral smaller sub-problems.

8. Experiments

In this section we present various examples of using ourapproach to detect unambiguous cycles in 2D and 3D point sets.The algorithm was implemented on Linux in Matlab running ona Pentium 4 3.4 GHz with 1GB RAM. We would expect a C++implementation to be much quicker than this Matlab prototype.Section 8.1 considers 2D cases, and Section 8.2 shows casesderived from 3D CAD models.

Note that if C has a c-fold rotational symmetry at tolerance ε,by definition it must have subsets displaying a c′-fold rotationalsymmetry with tolerance not greater than ε for any factor c′

≥ 1of c. For clarity of presentation, such symmetries are not shownin these examples although they are also output. Furthermore,we do not show the detected three-fold symmetries or 3Dsymmetries consisting of four points, of which there are usuallymany.

Most spurious symmetries are only present at large tolerancevalues and can easily be suppressed if a user-supplied maximaltolerance of interest is given. Often it is very simple to selecta suitable cut-off tolerance after the symmetries at varioustolerances have been detected. However, as we are detectingapproximate symmetries, not all symmetries at small toleranceare automatically also symmetries which are intended. Ouralgorithm detects symmetries which are unambiguously presentin the data at various tolerance levels. Downstream processesmust decide which of these symmetries should be consideredfor further processing.

8.1. 2D examples

This section discusses the results of determining 2Dunambiguous cycles in various examples.

First, we considered the algorithm’s ability to detectintended symmetries in sets of points derived from regularshapes. We took 25 points from the vertices of a twelve-foldregular polygon of radius 1.0, one five-fold regular polygon ofradius 0.5 and two squares of radii 0.5 and 0.2. The twelve-fold regular polygon was placed at the origin and the otherscentre at various locations. In the example shown, these centreswere as (0.−0.25), (−0.2, 1.05), (1.5, 0.2), chosen to carefullyplace points from different polygons close to each other sowe could assess the quality of the results produced by thepoint expansion process. The coordinates of the points in eachoriginal exact regular polygon were disturbed by uniformlydistributed random errors less than 0.01, 0.04, 0.033 and 0.01respectively. Overall 30 randomly generated arrangements ofthis type were used for testing, one of which is shown inFig. 11. The left image shows the symmetries used to generatethe set, which were also detected successfully, and the rightimage shows additional unintended symmetries also detected.The tolerances at which these were present are also given in thetop-right legends.

All four initial polygons were detected in each test, takingan average time of 2.5s. Furthermore, at most five additional

Page 14: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 89

Fig. 11. 2D points with intended (left) and unintended (right) unambiguous cycles; running time for this example: 2.37 s.

Fig. 12. 2D points on a 4 × 4 regular grid and 20 random points.

symmetries were detected. As we are looking for approximatesymmetries, such additional sets cannot be avoided in general.As can be seen in Fig. 11, the unintended symmetries not onlyhave much larger tolerances (at least 10 times larger) than theintended symmetries, but also are inconsistent with some ofthe intended symmetries—for example, three points are sharedby the intended twelve-fold symmetry and the unintendedfive-fold symmetry. The tolerance information can be used incombination with a consistency check to separate the intendedfrom the unintended symmetries (see [8]).

The example in Fig. 11 shows the algorithm’s stability withrespect to noisy point sets with intended symmetries. To testthe algorithm’s behaviour given random points, examples likeFig. 12 were also considered. 36 points were generated of which16 were arranged on a 4 × 4 regular grid in [0, 1] × [0, 1] (darkpoints) and the other 20 were chosen randomly with a uniformprobability distribution in the same area (light points). Theselight points disturb the symmetries generated by the dark points.Over 30 tests on such arrangements were executed. Within at

most 10s, the 20 square symmetries induced by the points onthe 4 × 4 grid were always detected at tolerance zero (see thefirst four rows of Fig. 12). The random points led to severalother symmetries (at most five per test) also being detected;examples being given in the last row, with tolerances of 0.0459,0.0471, 0.0570, 0.0801, 0.1063 respectively.

Tests on uncorrelated random points uniformly distributedin [0, 1] × [0, 1] were also performed to test the algorithm’sperformance in detecting unintended symmetries. The results of30 tests using 30 random points are summarized in Fig. 13. Theblack line gives the running time in seconds, the red line showsthe number of detected symmetries, and the blue line indicatesapproximate tolerances multiplied by 100 in each test. As seenfrom the figure, in five tests no symmetry was found, in 16 testseither one or two symmetries were found, in seven tests eitherthree or four symmetries, and in two tests six symmetries weredetected. The tolerances of the symmetries found range from0.0159 to 0.0838. Such good performance strongly suggeststhat only few unintended symmetries, as detected by our

Page 15: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

90 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

Fig. 13. Experimental results on 30 tests of 30 2D random points. (Forinterpretation of the references to colour in this figure legend, the reader isreferred to the web version of this article.)

algorithm, are introduced by randomly distributed points. Allthe tests took 2–4s to compute, which shows the algorithm’sefficiency.

In summary, these and other 2D examples show thatour algorithm can robustly detect all potential intended 2Dsymmetries within one minute for up to about 100 points. Alsonote that for many typical CAD models, planar symmetriesdominate in engineering, e.g. see the complex model in Fig. 1.In such cases, the 2D symmetry detection algorithm can be useddirectly if these planes are detected explicitly beforehand.

8.2. 3D examples

In this section we show the performance of the 3D versionof our algorithm on discrete point sets extracted from CADmodels.

The MISUFA model in Fig. 15(a) came from Cadalog,Inc., http://www.ohyeahcad.com/, and the other two inFigs. 1 and 14(a) from the National Design Repository,http://www.designrepository.org/. For simplicity, the discretepoints used in our tests here were the model vertices instead of

Fig. 14. The symmetries of extracted points from the Vise-guide model.

Fig. 15. The symmetries of extracted points from the MISUFA model. (Forinterpretation of the references to colour in this figure legend, the reader isreferred to the web version of this article.)

being the complete set of characteristic points discussed earlier.These exact models were perturbed using uniformly distributedrandom errors dependent on the objects’ sizes; details aregiven later. This allows us to compare the symmetries that ouralgorithm detects with the intended symmetries that really exist.

In the first test, 68 discrete points were extracted fromthe model in Fig. 14(a). The maximal and minimal distancesbetween these distinct points are 2.3607 and 0.054 respectively.These extracted points were then disturbed by uniformlydistributed random errors less than 0.01. It took 38.9s to detectthe four hexagonal symmetries shown in Fig. 14(b). The samesymmetries are obtained when running our algorithm on theexact point set yielding tolerances 0, 0, 0.0154, 0.0154 forthe hexagonal symmetries in 36.2s. The two symmetries attolerance zero correspond to the two in Fig. 14(b) drawnin dashed lines. The non-zero tolerances for the other twosymmetries originate from the actual model. To further checkthe algorithm performance, the extracted points were disturbedby larger errors: uniformly distributed random errors of lessthan 0.05. Note that such errors are quite close to theminimal inter-point distance 0.054. Then, only two hexagonalsymmetries were detected respectively at tolerance 0.114 and

Page 16: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 91

Fig. 16. The symmetries of extracted points from the Monster model (see Fig. 1). (For interpretation of the references to colour in this figure legend, the reader isreferred to the web version of this article.)

0.122, which corresponds to the two symmetries originally attolerance zero (in dashed lines). The other two symmetrieswere no longer detected, as their regular distribution weredestroyed by such large induced errors. This demonstrates thatour algorithm is capable of detecting intended symmetries atlarge tolerances, but also only finds unambiguous symmetriesand yields overall fewer unintended symmetries. No otherunintended symmetries were detected during all the tests.

In the next example, the 123 vertices of the MISUFA modelin Fig. 15(a) were disturbed by uniformly distributed randomerrors of less than 0.02. (Maximal and minimal inter-pointdistances in the original exact model are 2.3607 and 0.054respectively). All the eight detected symmetries are shown inFig. 15(b) at similar tolerances on average 0.0247. The modelhas no global symmetries. The cycles detected by our algorithminclude four rotational cycles (blue lines) and four rotation-reflection cycles (red lines). The rotational symmetries areobvious hexagonal parts of the model; the rotation-reflectionsymmetries come from combination of rotational symmetries.

We also tested our algorithm with the Monster part in Fig. 1.A total of 438 points were extracted. As other examples, these

points were disturbed by uniformly distributed random errorsof less than 0.1. To improve the algorithm performance, we firstdivided the extracted points into 8 regions by planes orthogonalto the z coordinate axis at z heights −25, 0, 20, 40, 60, 70, 90(see Fig. 16(c)); the original z coordinates were in [−50, 100].(This planar division is straightforward for a user to do andis a reasonable approach, as planar symmetries dominate inengineering, and rotation-reflection symmetries also consist oftwo planar symmetries).

Using this approach, it took 345s to detect 58 unambiguouscycles. An overall view, a top view, a side view and a close-upview are shown in Fig. 16(a), (b), (c) and (d) respectively. Thedetected symmetries can be explained as (i) the five eight-foldrotational symmetries, drawn in red, with an average tolerance0.094, which come from the eight cylindrical holes; (ii) thefive sixteen-fold rotational symmetries, drawn in black, withaverage tolerance 0.1764, which come from the 16 slots aroundthe centre; (iii) the 24 smaller square symmetries along thesides, drawn in green, with average tolerance 0.1364, from thesquare slots at the sides; (iv) the 24 large square symmetriesalong the sides, drawn in red, with average tolerance 5.0100,

Page 17: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

92 M. Li et al. / Computer-Aided Design 40 (2008) 76–93

from the rectangular slots at the sides. As seen from themodel, the first three types at smaller tolerance are all intendedsymmetries, while the fourth type were originally rectangles butdetected as squares at a large tolerance.

In a manner similar to the above examples, we havetested our algorithm with various other approximate CADmodels, most of which were obtained from the NationalDesign Repository, http://www.designrepository.org/. Theywere perturbed by uniformly distributed random errors. Thesemodels include simple models such as cubes with some blendsor complex models such as the Monster model (Fig. 1). Thenumber of discrete points extracted from these models rangedfrom 36 to 438 and it took between 5s and 345s to detectsymmetries. In each case, all intended symmetries that couldbe detected at zero tolerance in the original CAD model weredetected as unambiguous cycles from the disturbed extractedpoints. In addition to these symmetries, other unintendedsymmetries were also detected; in all cases there was clearevidence in the model for their presence. Most unintendedsymmetries, however, were present at larger tolerances than theintended symmetries and, hence, could easily be identified.

Depending on the amount of noise added to the pointscompared to the distances between the points, some unintendedsymmetries were at the same tolerances as the intendedsymmetries. For these a downstream process would have toemploy a more sophisticated selection process, e.g. as discussedin [8]. When we added a larger amount of noise (on thelevel of the smallest distance between points), some intendedsymmetries were not detectable anymore. We note that suchcases cannot in general be avoided when detecting approximatesymmetries and our algorithm only detects symmetries forwhich there is clear, unambiguous evidence present in themodel.

Again, we note the advantage of our algorithm that instead ofselecting an arbitrary tolerance in advance, the algorithm selectssuitable tolerance levels as the symmetries are detected.

9. Conclusion

In this paper a novel definition of approximate subset sym-metries of discrete point sets has been given, together with analgorithm to find them. It is suitable for finding approximatesymmetries in B-rep models, by carefully choosing characteris-tic points from the model, including vertices and other specialpoints. Our algorithm avoids generating large numbers of spu-rious approximate symmetries by automatically deducing tol-erance levels at which subsets unambiguously exhibit symme-tries. Our experiments demonstrate the ability of our algorithmto find all expected symmetries. Only few unintended symme-tries are detected when tested in practice on CAD models. Thelatter are almost always found at larger tolerance values, givinga simple criterion to decide which symmetries are likely to beintended by the designer. Our algorithm takes time O(Cn4) fora point set with n points, and maximal symmetry order C . Inpractice, our prototype Matlab implementation detects symme-tries in an acceptable amount of time, in the context of a com-plete reverse engineering process, for example; furthermore wewould expect a C++ implementation to be considerably faster.

In this paper we detect unambiguous cycles whichdescribe orbits of points only. In future work we intendto consider the problem of combining such orbits into setswhich approximately share the same geometric symmetry—forexample, the five eight-fold symmetries in Fig. 16 can actuallybe merged into a single eight-fold rotational symmetry. We alsointend to investigate the use of this algorithm for design intentdetection.

Acknowledgements

We thank the reviewers for their comments, which havehelped to improve the paper.

References

[1] Mills B, Langbein F, Marshall A, Martin R. Estimate of frequen-cies of geometric regularities for use in reverse engineering ofsimple mechanical components. Tech. rep. GVG 2001–1, Geome-try and Vision Group, Dept. Computer Science, Cardiff University,http://ralph.cs.cf.ac.uk/papers/Geometry/survey.pdf;2001.

[2] Thompson DW. On growth and form. Cambridge University Press; 1917.p. 1942.

[3] Barratt K. Logic and design in art, science and mathematics. London:Herbert Press; 1989.

[4] Varady T, Martin R, Cox J. Reverse engineering of geometric models —an introduction. Computer-Aided Design 1997;29(4):255–68.

[5] Pratt M, Anderson B, Ranger T. Towards the standardized exchange ofparameterized feature-based CAD models. Computer-Aided Design 2005;37(12):1251–65.

[6] Mills B, Langbein F, Marshall A, Martin R. Approximate symmetrydetection for reverse engineering. In: Proc. 6th ACM symp. solid andphysical modeling. 2001. p. 241–8.

[7] Gao C, Langbein F, Marshall A, Martin R. Approximate congruencedetection of model features for reverse engineering. In: Proc. int. conf.shape modelling and applications. 2003. p. 69–77.

[8] Langbein F, Marshall D, Martin R. Choosing consistent constraints forbeautification of reverse engineered geometric models. Computer-AidedDesign 2004;36(3):261–78.

[9] Reisfeld D, Wolfson H, Yeshurun Y. Context-free attentional operators:The generalized symmetry transform. International Journal of ComputerVision 1995;14(2):119–30.

[10] Sun C, Sherrah J. 3D symmetry detection using the extended Gaussianimage. IEEE Transactions on Pattern Analysis and Machine Intelligence1997;19(2):164–8.

[11] Shen D, Ip H, Cheung K, Teoh E. Symmetry detection by generalizedcomplex (GC) moments: A close-form solution. IEEE Transactions onPattern Analysis and Machine Intelligence 1999;21(5):466–76.

[12] Loy G, Eklundh J. Detecting symmetry and symmetric constellations offeatures. In: ECCV 2006, Part II. LNCS, vol. 3952. Springer-Verlag; 2006.p. 508–21.

[13] Martinet A, Soler C, Holzschuch N, Sillion FX. Accurate detection ofsymmetries in 3D shapes. ACM Transactions on Graphics 2006;25(2):439–64.

[14] Podolak J, Shilane P, Golovinskiy A, Rusinkiewicz S, Funkhouser T. Aplanar-reflective symmetry transform for 3D shapes. ACM Transactionson Graphics 2006;25(3):549–59.

[15] Mitra N, Guibas L, Pauly M. Partial and approximate symmetry detectionfor 3D geometry. ACM Transactions on Graphics 2006;25(3):560–8.

[16] Lockwood E, Macmillan R. Geometric symmetry. Cambridge UniversityPress; 1978.

[17] Sugihara K. An n log n algorithm for determining the congruity ofpolyhedra. Journal of Computer and System Sciences 1984;29(11):36–47.

[18] Brass P. On finding maximum-cardinality symmetric subsets. Computa-tional Geometry 2003;24:19–25.

Page 18: Detecting approximate symmetries of discrete point subsets€¦ · symmetries are detected using a rigorous, tolerance-controlled, incremental approach, which expands symmetry seed

M. Li et al. / Computer-Aided Design 40 (2008) 76–93 93

[19] Gao X, Lin Q, Zhang G. A C-tree decomposition algorithm for 2D and 3Dgeometric constraint solving. Computer-Aided Design 2006;38(1):1–13.

[20] Kanatani K. Comments on ‘symmetry as a continuous feature’. IEEETransactions on Pattern Analysis and Machine Intelligence 1997;19(2):246–7.

[21] Wolter J, Woo T, Volz R. Optimal algorithm for symmetry detection intwo and three dimensions. The Visual Computer 1985;1:37–48.

[22] Alt H, Mehlhorn K, Wagener H, Welzl E. Congruence, similarity andsymmetries of geometric objects. Discrete Computational Geometry1988;3:237–56.

[23] Jiang X, Yu K, Bunke H. Detection of rotational and involutionalsymmetries and congruity of polyhedra. The Visual Computer 1996;12(4):193–201.

[24] Brass P, Knauer C. Testing congruence and symmetry for general 3-dimensional objects. Computational Geometry 2004;27:3–11.

[25] Aloupis G, Cardinal J, Collette S, Iacono J, Langerman S. Where tobuild a temple, and where to find one. In: 22nd European workshop oncomputational geometry. 2006. p. 1–4.

[26] Tate S, Jared G. Recognising symmetry in solid models. Computer-AidedDesign 2003;35(7):673–92.

[27] Iwanowski S. Testing approximate symmetry in the plane is NP-hard.Theoretical Computer Science 1991;80:227–62.

[28] Zabrodsky H, Pelog S, Avnir D. Symmetry as a continuous feature. IEEETransactions on Pattern Analysis and Machine Intelligence 1995;17(12):1154–66.

[29] Martin R, Dutta D. Tools for asymmetry rectification in shape design.Journal of Systems Engineering 1996;6:98–112.

[30] Li M, Langbein FC, Martin RR. Constructing regularity feature trees forsolid models. In: Proc. geometric modeling and processing. Springer;2006. p. 267–86.