2. Pruebas de aceptación y medidas para el comisionamiento
2.5 Datos del haz para XIO
Point-sphere hierarchies are completely encoded in the previously introduced cluster set C and are built bottom-up starting with the leaf points (all the points in P, thus, the finest resolution). First, clustering and hierarchy level definition is performed, and then, minimally bounding spheres are computed for each cluster recursively. The whole process is outlined in Figure3.9and an exemplary point-sphere hierarchy is shown in Figure3.10. When clustering is carried out, points are grouped into clusters of K points according to their similarity. This similarity is currently defined as the regular Euclidean distance, but other criteria are possible, such as the geodesic distance, or implementations that take into account the normal vectors or quality values of the points. The branching factor NK (default, NK = 4) is the actual parameter defined by the user in order to control
the number of points in a cluster, with K automatically adjusted. In regular situations, K = NK, except when there are not enough points or the distance between them is above
a given threshold, as detailed later.
The first point or seed point is randomly chosen and the next most similar K points are located in the neighborhood. At this stage, the support structure which matches surface voxels and projected points mentioned in Section3.2.1 is used in order to avoid quadratic complexity during the search. A cluster of K elements is formed using the initial seed point and the next K − 1 closest neighbors. The Kth closest neighboring
point is used as the initial seed point for the next cluster. Before jumping to the next cluster, the point in the cluster closest to the average or center of mass (CoM) is selected as the cluster parent point. This process is repeated until all the elements belong to some cluster. When this occurs, the algorithm starts grouping the parent points of the previously defined clusters. The stopping criterion of this recursion is met when the top level of the tree which contains only one cluster is reached. This one cluster is the root cluster in level L = 1.
Given a branching factor NK, each level L > 1 in the hierarchy will have approxi-
mately NK times more points than the previous higher level L − 1:
NP,L= NKNP,L−1, NP,L= ¢ NP (NK)L−1 • , (3.40)
with NP being the total number of points in P and NP,L the number of points in level
L. The points in each level sample the whole object surface with a different resolution s which can be modeled with (3.16) and (3.40):
sL= sL−1
p
NK. (3.41)
NL=
†
logNK NP
£
, (3.42)
and it is the level number of the leaf points, that consist of all points in P.
The explained sequential clustering approach can yield clusters containing points that are much further away from each other than on average in the level. That occurs because the only criterion for building the next adjacent cluster is finding the closest point to the current cluster; additionally, it is not guaranteed that a list of closest points not assigned to clusters is going to be as compact as a proper cluster. In order to eliminate those exceptions, a distance threshold is defined between a parent point Piand the other
cluster points Pj: kPi− Pjk ≤ 3 4NKs √ 3(pNK)NL−L; (3.43)
this heuristic threshold distance in (3.43) is obtained assuming that points should be a maximum of 3
4NK voxels away from each other (worst case, in diagonal) and considering
that the resolution between levels varies according to (3.41). When a point yields a distance value above the threshold, it is pulled out from the cluster and assigned to a neighboring cluster in which it fulfills the threshold criterion. Therefore, although the target size of a cluster is always NK, the real number of points K of each cluster is
determined on the fly. It may happen that a point which was pulled out does not fulfill the threshold for any neighboring cluster; in that case, a single-point cluster is created with it. Relaxing (3.43) helps to eliminate the number of single-point clusters, but it lowers the average compactness of all the other clusters.
After a level L is clustered, all generated clusters are added to C in their order of creation. As a result, the first clusters of C belong to the last level L = NL and contain
leaf points, and the very last cluster in C is the root cluster c1 in level L = 1. Every
time a cluster c is added to the hierarchy, all available cluster values necessary in (3.44) are registered: L, K, the addresses in P of the K cluster points and also the reciprocal addresses between children and parent clusters (i. e., {&cc
j}and &cp). Note that although
the number of clusters NC is determined at the end of the clustering process, it can be
estimated as NC ' NL X i=0 (NK)i. (3.44)
After building the point-tree, the sphere-tree is created upon it. To that purpose, bounding spheres for each cluster are computed recursively. Minimally bounding spheres [FG04] are calculated using the CGAL library [FGH+16] (see Figure 3.9 (b)). Each cluster sphere contains all the cluster points and all the children cluster points until
Table 3.3: Summary of structures, values, and queries that are defined in primitive and enhanced pointshells (P).
Sets Values Online Call Description
Primitive P P {(P, n)iP}
iP=NP
iP=1 P, n ∈ R
3 All 6D points in P form an unordered list which is completely accessed in realtime calls without hierarchies.
Enhanced P P {(P, n, q)iP}
iP=NP
iP=1 P, n ∈ R
3, q ∈ R Only selected 7D points referenced from clusters in Q are accessed. C {ciC}
iC=NC
iC=1 see (3.32) Addresses to clusters (c) in C are
pushed to the queue Q for later access during realtime calls. Each c contains addresses to points in P. Q {ciQ}
iQ=NQ
iQ=1 Q ⊆ C The FIFO queue Q is not a
constant structure in P (as P or C), but is created every haptic cycle by adding likely colliding clusters from C.
reaching the leaf level. Thus, the result is an optimally wrapped sphere-tree, similar to the one defined in [WZ09b], where each cluster sphere contains all its children points, but not the children spheres. All points to be enclosed are detected by simply following the children cluster addresses stored in each cluster during the point-tree generation. In this phase, the maximum quality value qmaxalong all the points within the sphere is also
computed and saved in the cluster.
This sphere hierarchy enables rapidly locating likely collision areas performing sphere checks, as explained in Section3.3. Figure3.10shows the point-sphere tree of the Stan- ford Bunny and Table 3.3 summarizes and compares the most important structures of primitive and enhanced pointshells.
Enhanced pointshells can also be saved in files. All files used for this work were gener- ated in less than 20 seconds and have a size smaller than 2 MB using resolutions slightly smaller than s = 5 mm in desktop-sized objects. Refer to [SHPH08] and Figure3.16 for more information on generation time, file size, and further exemplary snapshots.