# T-Spline Based Unifying Registration Procedure for Free-Form Surface Workpieces in Intelligent CMM
## 3 Technology of the System
### Establishment of a Unified Model  
Based on the advantages of the T-spline, this paper establishes a unified T-spline surface model for the entire measured free-form surface workpiece. The T-spline surface is a new representation method for a parameter surface that allows T-junctions. The T-mesh is formed by all of the control points. A T-spline surface is defined by the following formula [24,25]. \[S(s,t)=\frac{\sum\limits_{i=1}^{m}P_{i}w_{i}B_{i}(s,t)}{\sum\limits_{i=1}^{m}w _{i}B_{i}(s,t)} \tag{1}\]  
where \(P_{i}\) and \(w_{i}\) are the control points and weights, respectively, \(m\) is the number of control points. (s,t) is the parameter field coordinates. The corresponding T-spline blending function is  
\[B_{i}(s,t)=N[s_{i}](s)N[t_{i}](t) \tag{2}\]  
where \(N[s_{i}](s)\) and \(N[t_{i}](t)\) are the cubic B-spline basis functions associated with the knot vector, and they have the similar form. \[ \begin{array}{l}s_{i}=[s_{i0},s_{i1},s_{i2},s_{i3},s_{i4}]\text{, }t_{i}=[t_{i0},t_{i1},t_{i2},t_{i3},t_{i4}]\\ \\ N[s_{i}](s)=N_{0,3}(s)=\frac{s-s_{i0}}{s_{i3}-s_{i0}}N_{0,2}(s)+\frac{s_{i4}-s }{s_{i4}-s_{i1}}N_{1,2}(s)\\ \\ \frac{(s-s_{i0})^{3}}{(s_{i3}-s_{i0})(s_{i2}-s_{i0})},\text{ }s_{i0}\leq s<s_{i1}\\ \\ \frac{(s-s_{i0})^{2}(s_{i2}-s_{i0})}{(s_{i3}-s_{i0})(s_{i2}-s_{i0})}+\frac{(s-s_ {i0})(s_{i2}-s_{i0})(s-s_{i1})}{(s_{i2}-s_{i1})(s_{i3}-s_{i1})(s_{i3}-s_{i0})} \\ \\ +\frac{(s_{i4}-s)(s-s_{i1})^{2}}{(s_{i2}-s_{i1})(s_{i4}-s_{i1})(s_{i3}-s_{i1})} \text{, }s_{i1}\leq s<s_{i2}\\ \\ \frac{(s-s_{i0})(s_{i2}-s)}{(s_{i3}-s_{i0})(s_{i3}-s_{i0})}+\frac{(s-s_{i1})(s_ {i3}-s)(s_{i4}-s_{i1})}{(s_{i3}-s_{i2})(s_{i4}-s_{i1})(s_{i3}-s_{i1})}\\ \\ +\frac{(s_{i4}-s)^{2}(s_{i4}-s_{i1})}{(s_{i3}-s_{i2})(s_{i4}-s_{i1})}\text{, }s_{i2}\leq s<s_{i3}\\ \\ \frac{(s_{i4}-s)^{3}}{(s_{i4}-s_{i3})(s_{i4}-s_{i2})(s_{i4}-s_{i1})}\text{, }s_{i3} \leq s<s_{i4}\\ \\ 0\text{, }s<s_{i0}\text{ or }s>s_{i4}\end{array}  \tag{3}\]  
Based on the literature [30,33], the T-spline surface fitting is divided into the steps shown in Figure 3.  
To unify the representation of all free-form surface workpieces, the T-spline surface model database is established by fitting the T-spline surface formula for all of the free-form surfaces based on Figure 3. First, the triangular mesh is extracted from the designed model. There are many methods for parameterizing triangular meshes [39, 40, 41]. Conformational parameterization [42] is used in this paper due to its speed and effectiveness. The mean value parameterization method [43] is adopted after the conformal parameterization to facilitate the construction of the pre-image of the T-mesh. The parameter domain is split by the quad-tree. The result of the quad-tree is used to fit the T-spline surface as the pre-image of the T-mesh. Finally, the accuracy of the surface fitting is determined based on the needs of different applications. In this manner, a unified model is established. The basic principle of T-spline surface fitting is to minimize the distance between the triangular mesh and the surface S, and the f equation can be obtained  
\[E_{fit}(\mathrm{P}_{1},\mathrm{P}_{2},\cdots,\mathrm{P}_{m})=\sum_{i=1}^{n}(S(s_ {i},t_{i})-\mathrm{q}_{i})^{2} \tag{4}\]  
where \(q_{i}\) is the vertex of the triangular mesh and (\(\mathrm{s}_{i}\), \(t_{i}\)) are the parameter domain coordinates corresponding to the vertex of the triangular mesh. \(S_{\mathrm{ss}}(\mathrm{s}_{i},t_{i})\), \(S_{\mathrm{st}}(\mathrm{s}_{i},t_{i})\) and \(S_{tt}(\mathrm{s}_{i},t_{i})\) are the second order derivatives of \(S(\mathrm{s}_{i},t_{i})\).The following energy function is used to smooth the surface  
\[E_{fair}(\mathrm{P}_{1},\mathrm{P}_{2},\cdots,\mathrm{P}_{m})=\sum_{i=1}^{n} \Bigl{(}S_{\mathrm{ss}}^{2}(\mathrm{s}_{i},t_{i})+S_{\mathrm{st}}^{2}(\mathrm{ s}_{i},t_{i})+S_{tt}^{2}(\mathrm{s}_{i},t_{i})\Bigr{)} \tag{5}\]  
The overall objective function is  
\[E(\mathrm{P}_{1},\mathrm{P}_{2},\cdots,\mathrm{P}_{m})=E_{fit}+\sigma E_{fair} \tag{6}\]  
where the coefficient \(\sigma\) is generally between 0.01 and 0.1.