Int J Adv Manuf Technol (2000) 16:635–642
2000 Springer-Verlag London Limited
The Pre-Processing of Data Points for Curve Fitting in Reverse
Engineering
Ming-Chih Huang and Ching-Chih Tai
Department of Mechanical Engineering, Tatung University, Taipei, Taiwan
Reverse engineering has become an important tool for CAD puter-aided technology in the product development and manu-
model construction from the data points, measured by a coordi- facturing process, a geometric model of the part to be created
nate measuring machine (CMM), of an existing part. A major in the CAD system is required. However, there are some
problem in reverse engineering is that the measured points situations in product development in which a physical model
having an irregular format and unequal distribution are diffi- or sample is produced before creating the CAD model:
cult to fit into a B-spline curve or surface. The paper presents
a method for pre-processing data points for curve fitting in 1. Where a clay model, for example, in designing automobile
reverse engineering. The proposed method has been developed body panels, is made by the designer or artist based on
to process the measured data points before fitting into a B- conceptual sketches of what the panel should look like.
spline form. The format of the new data points regenerated by 2. Where a sample exists without the original drawing or
the proposed method is suitable for the requirements for fitting documentation definition.
into a smooth B-spline curve with a good shape. The entire 3. Where the CAD model representing the part has to be
procedure of this method involves filtering, curvature analysis, revised owing to design change during manufacturing.
segmentation, regressing, and regenerating steps. The method
is implemented and used for a practical application in reverse In all of these situations, the physical model or sample must
engineering. The result of the reconstruction proves the be reverse engineered to create or refine the CAD model.
viability of the proposed method for integration with current In contrast to this conventional manufacturing sequence,
commercial CAD systems. reverse engineering typically starts with measuring an existing
physical object so that a CAD model can be deduced in order
Keywords: Curve fitting; Pre-processing of data points; to exploit the advantages of CAD technologies. The process
Reverse engineering of reverse engineering can usually be subdivided into three
stages, i.e. data capture, data segmentation and CAD modelling
and/or updating [1,2]. A physical mock-up or prototype is first
measured by a coordinate measuring machine or a laser scanner
1. Introduction to acquire the geometric information in the form of 3D points.
The measured results are then segmented into topological
With the progress in the development of computer hardware regions for further processing. Each region represents a single
and software technology, the concept of computer-aided tech- geometric feature that can be represented mathematically by a
nology for product development has become more widely simple surface in the case of model reconstruction. CAD
accepted by industry. The gap between design and manufactur- modelling reconstructs the surface of a region and combines
ing is now being gradually narrowed through the development these surfaces into a complete model representing the measured
of new CAD technology. In a normal automated manufacturing part or prototype [3].
environment, the operation sequence usually starts from product In practical measuring cases, however, there are many situ-
design via geometric models created in CAD systems, and ations where the geometric information of a physical prototype
ends with the generation of machining instructions required to or sample cannot be measured completely and accurately to
convert raw material into a finished product, based on the reconstruct a good CAD model. Some data points of the
geometric model. To realise the advantages of modern com- measured surface may be irregular, have measurement errors,
or cannot be acquired. As shown in Fig. 1, the main surface
of measured object may have features such as holes, islands,
Correspondence and offprint requests to: Ming-Chih Huang, Depart-
ment of Mechanical Engineering, Tatung University, 40 Chungshan N
or roughness caused by manufacturing inaccuracy, consequently
Road, 3rd Section, Taipei 104, Taiwan. E-mail: mindy얀mgher. the CMM probe cannot capture the complete set of data points
[Link] to reconstruct the entire surface.
636 M.-C. Huang and C.-C. Tai
For B-spline curves, the degree of these polynomials is
controlled by a parameter k and is usually independent of the
number of control points, and the B-spline basis functions are
defined by the following expression:
Ni,1(u) = 再 1 if ui ⱕ u ⱕ ui+1
0 otherwise
(2)
and
u − ui ui+k+1 − u
Fig. 1. The general problems in a practical measuring case. Ni,k(u) = N (u) + N (u) (3)
ui+k − ui i,k−1 ui+k+1 − ui+1 i+1,k−1
Where k controls the degree (k−1) of the resulting poly-
Measurement of an existing object surface in reverse engin-
nomials in u and thus also controls the continuity of the curve.
eering can be achieved by using either contact probing or non-
A B-spline surface is defined in a similar way to a tensor
contact sensing probing techniques. Whatever technique is
product in a B-spline curve. It is also possible to define a
applied, there are many practical problems with acquiring data
B-spline surface having different degrees in the u- and v-direc-
points, for examples, noise, and incomplete data. Without
tions:
extensive processing to adjust the data points, these problems
冘冘
will cause the CAD model to be reconstructed with an unde- n m
sired shape. In order to rebuild the CAD model correctly and S(u,v) = pijNi,p (u) Ni,q (v) (0 ⱕ u ⱕ 1) (4)
satisfactorily, this paper presents a useful and effective method i=0 j=0
to pre-process the data points for curve fitting. Using the
proposed method, the data points are regenerated in a specified
format, which is suitable for fitting into a curve represented 3. Curve Fitting
in B-spline form without the problems previously mentioned.
After fitting all of the curves, the surface model can be Given a set of data points measured from existing object,
completed by connecting the curves. curve fitting is required to pass through the data points. The
least-squares fitting technique is the most used algorithm which
aims at approximating, based on an iterative method, a set of
2. The Theory of B-spline data points to form a B-spline [5–7].
Given a set of data points Qk, k = 0,1,2,. . .,n, that lie on an
Most of the surface-based CAD systems express shapes unknown curve P for certain parameter values uk,
required for modelling by parametric equations, such as in k = 0,1,2,. . .,n; it is necessary to determine an exact interp-
Bézier or B-spline forms. The most used is the B-spline form. olation or best fitting curve, P.
B-splines are the standard for representing freeform curves and To solve this problem, the parameter values (uk) for each
surfaces in current commercial CAD systems. B-spline curves of the data points must be assumed. The knot vector and the
and Bézier curves have many advantages in common [4]. degree of the curve are also determined. The degree in practical
Control points influence the curve shape in a predictable, applications is generally 3 (order = 4). The parameter values
natural way, making them good candidates for use in an can be determined by the chord length method:
冘
interactive environment. Both types of curve are variation n
diminishing, axis independent, and multivalued, and both exhi- Qk ⬵ P(uk) = piNi,p (uk) (k = 0,1,. . .,n) (5)
bit the convex hull property. However, it is the local control i=0
冘
of curve shape which is possible with B-splines that gives the i
technique an advantage over the Bézier technique, as does the 兩Qj − Qj−1兩.
ability to add control points without increasing the degree of
u0 = 0, ui =
j=1
(6)
冘
the curve. Considering the real-world applications requirement, n
the B-spline technique is used to represent curves and surfaces 兩Qj − Qj−1兩 .
in this research. j−1
A B-spline curve is a set of basis functions which combines
Given the parameter values, a knot vector that reflects the
the effects of n + 1 control points. A parametric B-spline curve
distribution of these parameters has the following form:
is given by
冘
n
p(u) = piNi,k (u) (0 ⱕ u ⱕ 1) (1) U = {0,0,. . .,0, V1,V2,. . .,Vn,1,1,. . .,1}
i=0
p+1 p+1
Pi = control points
冘
n + 1 = number of control points 1
j+p−1
Ni,k(u) = the B-spline basis functions Vj = ui (j = 1,2,. . .,n−p) (7)
p
u = parameter i=j
Pre-Processing of Data Points for Curve Fitting 637
Fig. 2. Curve fitting with unequal distribution of data points.
Fig. 3. Curve fitting with equal distribution of data points.
It can be proved that the coefficient matrix is totally positive
and banded with a bandwidth of less than p, therefore, the
linear system can be solved safely by Gaussian elimination
without pivoting.
Ni,p (uk) 兩i,k=0,. . .,n
Equation (5) can be written in a matrix form:
Q ⬵ NP (8)
where Q is an (m + 1) × 1 matrix, N is an (m + 1) × (n + 1)
matrix, and P is an (n + 1) × 1 matrix. Since m ⬎ n, this
equation is over-determined. The solution is
P* = (NT N)−1 NT Q (9)
4. The Requirement for Fitting a Set of
Data into a B-Spline Curve
In order to produce a B-spline curve with a “good shape”,
some characteristics are required to fit the data point set into
a curve presented in B-spline form. First, the data points must
Fig. 4. The procedure of data points pre-processing.
be in a well-ordered sequence. When applying the program to
fit a set of data points into a B-spline curve, the data points
must be read one by one in a specified order. If the data of a physical sample often has some features such as holes,
points are not in order, this will cause an undesired twist or islands, and radius fillets, which prevent the CMM probe from
an out-of-control shape of the B-spline curve. capturing data points with equal distribution. If a curve is
Secondly, an even dispersion of the data points is better for rebuilt by fitting data points with an unequal distribution, as
curve fitting. In the measuring procedure, some factors, such shown in Fig. 2, the generated curve may differ from the real
as the vibration of the machine, the noise in the system, and shape of the measured object. Figure 3 illustrates that a
the roughness of the surface of the measured object will smoother and more accurate reconstruction may be obtained
influence the result of the measurement. All of these phenom- by fitting an equally spaced set of data points.
ena will cause local shakes in the curve which passes through
the problem points. Therefore, a smooth gradation of the
location of the data points is necessary for generating a “high 5. The Pre-Processing of Data Points
quality” B-spline curve.
Having the data points equally distributed is important for To achieve the requirements for fitting a set of data points
improving the result of parameterisation for fitting a B-spline into a B-spline curve as mentioned above, it is very important
curve. As the mathematical presentation shows in Eq. (9), the and necessary that the data points must be pre-processed before
control points matrix [P] is determined by the basis functions curve fitting. In the following description, a useful and effective
[N] and data points [Q], where the basis functions [N] are method for pre-processing the data points for curve fitting is
determined by the parameters ui which are correspond to the presented. The concept of this method is to regress a set of
distribution of the data points. If the data points are distributed measuring data points into a non-parametric equation in implicit
unequally, the control points will also be distributed unequally or explicit form, and this equation must also satisfy the conti-
and will cause a lack of smoothness of the fitting curve. As nuity of the curvature. For a plane curve, the explicit non-
mentioned above, in practical measuring cases, the main surface parametric equation takes the general form: y = f(x). Figure 4
638 M.-C. Huang and C.-C. Tai
Fig. 5. Curvature is calculated by three discrete points on a circle.
illustrates an overview of the procedure to pre-process the data Fig. 6. The fillet of the model.
points for reverse engineering.
Data point filtering is the first step in displacing the unwanted
points and the noisy points. The original data points measured
from a physical prototype or an existing sample by a CMM
are in discrete format. When the measured points are plotted
in a diagram, the noisy points which obviously deviate from
the original curve can be selected and removed by a visual
search by the designer for extensive processing. In addition,
the distinct discontinuous points which apparently relate to Fig. 7. The curvature change of the fillet.
a sharp change in shape may also be separated easily for
further processing. e = (Y1 + Y2) (Y2 − Y1) (X3 − X2)
Many approaches have been developed for generating a f = (Y2 + Y3) (Y3 − Y2) (X2 − X1)
CAD model from measured points in reverse engineering. A g = (X1 − X3) (X2 − X1) (X3 − X2)
complex model is usually constructed by subdividing the com-
plete model into individual simple surfaces [8,9]. Each of the And, the curvature k of (X2, Y2) can be defined as:
individual surfaces defines a single feature in a CAD system 1 1
and a complete CAD model is obtained by further trimming, k= = (11)
r √((X0 − X2)2 + (Y0 − Y2)2)
blending and filleting, or using other surface-processing tools.
When the designer is given a set of unorganised data points Figure 6 illustrates an example in which the curvatures of a
measured from an existing object, data point segmentation is plane curve consisting of a data point set are calculated using
required to reconstruct a complete model by defining individual the previous method. The curvature of the curve determined
simple surfaces. Therefore, curvature analysis for the data by the data point set changes from 0 to 0.0333, as shown in
points is used for subdividing the data points into individual Fig. 7. This indicates that there is a fillet feature with a radius
groups. 30 in the data points set. Thus, these points can be isolated
In order to extract the profile curves for CAD model recon- from the original data points, and form a single feature. By
struction, in this step, data points are divided into different curvature analysis, the total array of data points is divided into
groups depending upon the result of curvature calculation and several groups. Each of these groups is a segmented form of
analysis of the data points. For each 2D curve, y = f(x), the the original data points which is devoid of any sharp change
curvature is defined as: in shape.
After segmentation, individual groups of data points are
d2 y separately regressed into explicit non-parametric equations, and
dx2 f″ then the data points can be regenerated from the regression
冋 冉 冊册
k= = (10)
dy 2 3/2 [1 + (f′)2]3/2 equation in a well-ordered sequence, with appropriate spacing
1+ and an equal distribution so that better fitting can be achieved.
dx
The format of the new data point set is valid for fitting into
If the data is expressed in discrete form, for any three a single simple B-spline curve without inner constraints, which
consecutive points in the same plane can be applied for further editing and modifying, such as
(X1,Y1) ·(X2,Y2) · (X3,Y3), the three points form a circle and trimming and extending. By combining individual curves to
the centre (X0,Y0) can be calculated as (see Fig. 5): construct all of the surfaces, designers may effortlessly achieve
a−b+c a complete CAD model conforming to the design intent.
X0 = Additionally, some regression errors are introduced by the
d
e−f+g regression operation between the measured points and the
Y0 = regression equation. In the following example, the order of the
−d
regression equation is discussed, because it bears a close
where relationship to the regression errors. Given a set of existing
a = (X1 + X2) (X2 − X1) (Y3 − Y2) data points, the set is regressed using a different order of the
b = (X2 + X3) (X3 − X2) (Y2 − Y1) regression (order = 2,3,4,5). Figure 8 illustrates the relationship
c = (Y1 − Y3) (Y2 − Y1) (Y3 − Y2) between the order of the regression equations and the regressed
d = 2[(X2 − X1) (Y3 − Y2) −(X3 − X2) (Y2 − Y1)] errors calculated by the root-mean-square (r.m.s.) method. This
Pre-Processing of Data Points for Curve Fitting 639
Fig. 8. The relationship between the order and the r.m.s. error.
Fig. 10. Configuration of system components for implementation.
Fig. 9. The procedure of implementation.
Fig. 11. The physical model of implementation.
figure shows that increasing the equation order causes a
decrease of the r.m.s. error. However, in most cases, when the
5th-order of the regression equation is used, the coefficient of in the implementation. The overall configuration of the system
the 5th-order item becomes zero. i.e. the r.m.s. error of the components is shown in Fig. 10.
4th-order equation is equal to the 5th-order equation. This First, the cross-sectional curves describing the shape of the
means that the designer only has to regress the data points implemented sample are measured by the CMM. The physical
into a 4th-order equation. In practice, a 4th-order equation has object which is typically of symmetric geometry, as shown in
already satisfied the demand for curvature continuity in CAD Fig. 11, is used in the implemented case. The CAD model of
model construction for industrial applications. a symmetric object can easily be constructed by mirroring the
symmetric features about the centreline. Therefore, some cross-
sectional curves which are symmetric require only data for
half the curve and then the other half can be mirrored to
6. Implementation generate the complete curve. The results of the measurement
is shown in Fig. 12.
In order to prove the effectiveness and feasibility of the When the measurement is completed, the individual data
proposed method – the pre-processing of data points for curve point sets representing different cross-sectional curves are pro-
fitting, an implemented case is developed following the steps of cessed separately. In this implemented case, the central cross-
the flowchart (Fig. 9). A Mitutoyo BN706 coordinate measuring sectional curve is processed as an instance to demonstrate the
machine equipped with a Renishaw PH9 touch probe and SAS procedure for pre-processing the data points, where 144 points
statistics software is used as a tool for system implementation. are obtained in this curve, as shown in Fig. 13(a). In the data
The measurement of the part surface is performed via standard points filtering step, the noisy points and distinct discontinuous
CMM control and measurement software (Geopak 2800). To points, which obviously deviate from the group of data points,
ensure that the proposed method is useful for practical appli- are removed directly for pre-processing. After filtering, the
cations, a commercial CAD system, Pro/Engineer, is integrated residual data consist of 132 points, as shown in Fig. 13(b). In
640 M.-C. Huang and C.-C. Tai
Fig. 14. Curvature variation of the central cross-sectional curve
determined by original points.
Fig. 12. The result of measurement.
Fig. 15. Smoothing the distribution of points by the median method.
Fig. 16. Curvature variation of the central cross-sectional curve
determined by new points.
order to segment the data points, the curvatures of the curve
representing the residual data points are calculated and plotted
in Fig. 14. As the surface of the implemented physical object
is unrefined, the curvature determined by these measured points
may greatly deviate from the original curve so that it is difficult
to achieve curve segmentation. To obtain the apparent curvature
variation, the measured points must be smoothed by the median
method before curvature calculation. Figure 15 describes the
algorithm of the median method in which point x1′, the new
coordinate of point x1, is the average of point x0, x1 and x2,
x1′ = (x0 + x1 + x2)/3. The result of the curvature calculation of
the new points, shown in Fig. 16, may be used to segment the
curve roughly. Observing the change of curvature and consider-
ing the scheme of surface construction, these filtered points
are divided into several groups which represent individual
Fig. 13. The steps of pre-processing the data points of the central feature curves, including the top curve, the side curve, and the
cross-sectional curve. fillet curve, as shown in Fig. 13(c) (refer to Fig. 16).
Pre-Processing of Data Points for Curve Fitting 641
Fig. 17. The entire procedure of CAD model reconstruction.
After the segmentation step, individual groups of data points feature curves, the various surfaces can be constructed with
are separately regressed into explicit non-parametric equations. the desired shape, using the different categories of surface
To eliminate the regression error caused by rough segmentation, construction schemes such as ruled surfaces, lofted surfaces,
remove several points at the start and end of each point group and Coons surfaces. A complex composite surface model is
before regression. For example, the segmented points for the then constructed by combining these surfaces.
top curve are the 28th to 118th point, and the equation, When the entire pre-processing procedure is completed, the
regressing the 31st to the 115th point, can be obtained as individual sets of regenerated data points can be transferred to
a commercial CAD system (Pro/Engineer is applied here) via
Z = 25.6343 + 0.975X − 0.0205X2 + 0.00019X3
the IGES format. All of the feature curves on the measured
− 6.50 × 10−7 X4 (12) object can be completely created by fitting different data points
sets, which are represented in B-spline form, as shown in
Depending on Eq. (12), the data points of the top curve can
Fig. 13(e,f). Interpolating the feature curves, the various sur-
be regenerated with a well-ordered sequence, pre-determined
faces can be constructed with the desired shape. Finally, the
spacing and equal distribution, as shown in Fig. 13(d). The
complete CAD model, as shown in Fig. 17, is achieved by
result of pre-processing the original data point measured by
combining the various surfaces, for the further design operation
the CMM allows smooth curves to be fitted to the regenerated
or modification.
data points. Points on a curve where the curvature is equal to
zero are called inflection points. In some situations, there is
more than one inflection point on a curve feature which
can be applied to construct complex sculptured surfaces. For 7. Conclusion
processing the data points fitting a single curve segment with
multiple inflection points, a higher-order regression equation Geometric modelling is a technology that is already used
must be used to regress the data points in order to generate extensively in industrial applications for developing new pro-
the shape of the curve. In applications of CAD, a curve-based ducts. Reverse engineering has become an important tool for
modelling technique is widely applied in industry. The part is CAD model construction for an existing part from the measur-
customarily divided into several cross-sections along a pre- ing data. A major difficulty in reverse engineering techniques
determined direction. Spatial curves for individual features are is to fit the irregular data points of an unequal distribution
first fitted through the cross-sectional data points. By blending into a B-spline curve. The procedure of the pre-processing of
642 M.-C. Huang and C.-C. Tai
data points for curve fitting in reverse engineering is described support provided by Tatung University, Taipei, Taiwan, under
in this paper. The method proposed has been developed to grant B86-1100-03.
process the data points measured from an existing object before
curve fitting, and then new data points are regenerated which
are suitable for the requirement for fitting into a smooth B- References
spline curve with a good shape. The entire procedure of
this method involves filtering, curvature analysis, segmentation, 1. N. V. Puntambekar, A. G. Jablokow and H. J. Sommer, “Unified
regressing, and regenerating steps. The proposed method is review of 3D model generation for reverse engineering”, Computer
implemented for practical applications in reverse engineering, Integrated Manufacturing Systems, 7(4), pp. 259–268, 1994.
and is an effective tool for integrating with current commercial 2. T. Varady, R. R. Martin, and J. Cox, “Reverse engineering of
CAD systems for reconstructing the geometric models of physi- geometric models – an introduction”, Computer-Aided Design,
29(4), pp. 255–268, 1997.
cal parts. 3. P. J. Hartly and C. J. Judd, “Parameterization and shape of B-
A broader interpretation of the term “reverse engineering” spline curve for CAD”, Computer-Aided Design, 29(4), pp. 255–
might perhaps involve deducing the intent of the original 268, 1997.
designer to some degree. An ideal system of reverse engineer- 4. Michael E. Mortenson, “Geometric Modeling”, John Wiley, 1985.
5. C. Menq and F. L. Chen, “Curve and surface approximation from
ing would be able to not only construct a complete geometric CMM measurement data”, Computers and Industrial Engineering,
model of the source object but also catch the initial design 30(2), pp. 211–225, 1996.
intent. By applying the method proposed above, designers may 6. M. J. Pratt, “Computer parametric surface approximations to dis-
regroup the data points in order to produce the individual crete data”, Computer-Aided Design, 2, pp. 165–171, 1985.
feature curves for reconstructing a complete CAD model of 7. D. F. Rogers, “Constrained B-spline curve and surface fitting”,
Computer-Aided Design, 21(10), pp. 641–648, 1989.
the source object to achieve the original design intent. 8. Hong-Tzong Yau and Jeng-Shyong Chen, “Reverse engineering
of complex geometry using rational B-splines”, Advanced Manu-
Acknowledgements facturing Technology, 13, pp. 548–555, 1997.
9. Weiyin Ma and Peiren He, “B-spline surface local updating with
The authors are indebted to Mr Cheng-Chou Lai for the unorganized points”, Computer-Aided Design, 30(11), pp. 853–
experimental work. The authors are also grateful for financial 862, 1998.