Modeling of Surfaces with Fair Reflection Line Pattern

Modeling of Surfaces with Fair Reflection Line Pattern
Joachim Loos, Günther Greiner, Hans-Peter Seidel
Graphische Datenverarbeitung
Universität Erlangen
Am Weichselgarten 9
91058 Erlangen, Germany
Abstract
Inspection of reflection line patterns is a standard way
to check the quality of free form surfaces. In this paper, we
describe an approach which enables the designer to control during the modeling process the reflection line pattern
by approximating a specified family of reflection lines. Our
method directly operates on the commonly used B-spline
format, and produces fair surfaces. The approach is based
on the minimization of a suitable error functional. A minimization algorithm based on data dependent quadratic error functionals provides an efficient numerical solution. The
potential of the method will be demonstrated by applying it
to two standard modeling problems: “surface fairing” and
“surface reconstruction”.
1 Introduction
In automotive industry, there is a long tradition to judge
the quality of surfaces by inspecting reflection lines on the
objects. Formerly these lines were generated by placing the
real object in front of a set of parallel light lines. Nowadays,
reflection lines are simulated on the computer and then will
be mapped as texture during display of the CAD model.
Besides reflection lines (see [8, 7] for more details),
there are several other methods for surface interrogation,
e.g. displaying color encoded curvatures on the surface [2],
focal surfaces [4], isolines of curvatures [10] and isophotes
(isolines of brightness) [11].
Reflection lines and isophotes are very popular probably
because they are familiar to the designer from “real” world
experiments. Moreover, they are very sensitive to small
shape deviations and, last but not least, modern graphics
hardware allows rendering of reflection lines and isophotes
at interactive rates.
Figure 1.1. Part of a car, displayed as shaded image (top),
with isophotes (middle) and with reflection lines (bottom)
Reflection lines are created by simulating the reflection
of a family of light lines in 3D-space at the surface. They
are viewer dependent and assume a specular reflecting surface. Isophotes are curves of equal brightness (intensity) on
a diffuse surface, being illuminated by a point light source.
In the most common cases, the light source lies at infinity. In Fig. 1.1 the mudguard of a car is displayed. Besides
isophotes and reflection lines the Gouraud-shaded image of
the model is shown.
Due to the popularity of isophotes and reflection lines,
there is a need for a surface design tool that directly operates on these features, allowing the user to specify the
desired lines and automatically generate the corresponding
surface shape. In this paper, we present a method, which
constructs a surface geometry from given isophotes or reflection lines, and allows the user to define arbitrary linear
constraints somewhere, for example boundary constraints.
Since exact interpolation of the user specified data is in most
cases inherently impossible, our algorithm finds an approximation which comes as close as possible to the desired surface shape.
1.1 Previous Work
Andersson [1] finds a surface which interpolates a family of isophotes by establishing a first order partial differential equation (PDE) for the surface. Unfortunately, this
approach requires imposing certain C 1 -constraints for part
of the boundary, whereas the remaining boundary is determined by integrating the PDE. It is impossible to require
additional constraints, nor is it possible to leave out constraints which are needed to solve the PDE. Therefore, local changes of the surface shape are also impossible. Furthermore, even if the constraints are correctly specified, the
solution can still be useless, because of self intersections.
Since the solution is composed as a finite number of curves,
it is not obvious, how an appropriate conversion into a CAD
format should be done. Much earlier in 1980, Klass [8] used
a PDE approach to interpolate reflection lines. Of course
this technique suffers from the same problems as the application to isophotes in [1]. Moreover, Klass used a linearized version of the correct PDE, thus only allowing small
changes in existing reflection lines. In order to circumvent
these problems, a new kind of pseudo reflection lines was
introduced in [7], allowing local control. However, these
reflection lines do not have a direct physical meaning and
are probably not familiar to most CAD designers. A new
approach to constructing geometry from reflection patterns
was given in [5] in order to reconstruct the topography of a
human cornea. This method was only used for reconstructing an already existing geometry.
1.2 Overview
In the paper we present a unified approach to the problem
of adapting surface geometry to given isophotes or reflection lines resp. We establish an appropriate error functional,
which gives a reasonable measure of how accurately a given
set of isophotes or reflection lines is approximated. We also
present an efficient method to minimize the error. Since we
do not require exact interpolation of the given family of
lines, we are able to impose arbitrary linear constraints. By
this approach it is also possible to change a given surface
shape locally. Although exact interpolation of given lines is
often inherently impossible, the computed approximations
are absolutely satisfying in most cases, as will be demonstrated by examples. In addition, if the constraints allow
interpolation, our algorithm will compute the interpolating
solution. Finally, the surface is represented in the standard
B-spline format.
The approaches for isophotes and reflection lines respectively are very similar. However for isophotes, the resulting
formulas are simpler. Therefore we will at first treat this
case in great detail (Section 2). We will end up with a cost
functional which has to be minimized in order to find the optimal solution. Then in Section 3 this approach is extended
to the task of approximating reflection lines. We present an
efficient method for minimizing the cost functionals in Section 4, guaranteeing quadratic convergence. In Section 5 we
demonstrate, how our method can be applied in the areas of
surface fairing and surface reconstruction.
2 The Variational Approach to Isophote Approximation
In this presentation, we will assume that our surface F
is represented as the graph of a function, i.e. F (u; v ) =
(u; v; f (u; v)), where f is a function on the rectangular domain = [0; 1]2 . We will not distinguish between F and
f . Let l = (a; b; c) be the normalized vector pointing to the
light source at infinity, illuminating F , which is assumed to
(,fu ;,fv ;1)
u Fv
p 2 2 be
be a diffuse reflector. Let n = kF
Fu Fv k =
1+fu +fv
the normal vector of F . According to the Lambertian Law,
the light intensity I f is given by
If =
c , afu , bfv
hnjli = p
1 + fu2 + fv2
(2.1)
The isophotes of f are the isolines of I f (u; v ), i.e. curves
(u(t); v(t)) with I f (u(t); v(t)) = const:. Now consider a
given intensity function I . We want to find a surface f ,
subject to user defined constraints, such that the isolines of
I f and I are as similar as possible. A first obvious approach would state the following error measure J for the
unknown surface f :
Z
Z 1 , afu , bfv
f
J (f ) = (I , I ) = ( p
, I )
1+f +f
2
2
2
u
2
v
A much better measure is given by
J (f ) =
=
Z
(rI f , rI )
Z
2
(2.2)
The minimization method we introduce in Sec. 4 requires an explicit representation of the error measure. More
precisely, we want to represent J in the form J (f ) =
K (fu ; fv ; fuu ; fuv ; fvv ). In order to do so, we have to express rI f in terms of the first and second derivatives of f .
Differentiation of 2.1 leads to
R
Iuf =
(Iuf , Iu )2 + (Ivf , Iv )2
In fact, since gradient information is taken into account, we
can expect that the error measure defined in Eq. 2.2 generally leads to smooth solutions.
Besides considerations about smooth solvability, approximating the gradient of the light intensity makes much more
sense, because the designer is usually not interested in fixing a specific light intensity along a curve on the surface.
He is rather interested in specifying the direction of the
isophotes. In fact, since the gradient of I is perpendicular
to the isolines of I , there is a direct correspondence between rI and the tangent directions of the isophotes. Some
examples show that statements about isophotes are in fact
statements about rI as we illustrate in Fig. 2.2: Singular
isophotes correspond to zeros of rI and dense isophotes
indicate a high gradient of I .
Ivf =
,afuu , bfuv
(1 + fu2 + fv2 ) 12
fu fuu + fv fuv )
+ (afu + bfv , c)(
(1 + fu2 + fv2 ) 32
(2.3)
(1 + fu2 + fv2 ) 12
+ (afu + bfv , c2)(fu f2uv 32+ fv fvv )
(1 + fu + fv )
,afuv , bfvv
(2.4)
Finally, we get the required representation by inserting
Eqs. 2.3, 2.4 into Eq. 2.2.
3 The Error Functional for Reflection Lines
As in the case of isophotes, we will assume that the surface F we consider, is represented as the graph of a function, i.e. F (u; v ) = (u; v; f (u; v )). Since reflection lines are
viewer dependent, we have to fix a viewer position. For simplicity, we assume that viewer and light source are located
at infinity. Let s be the vector pointing towards the viewer.
An eye ray emerging from the viewer, is reflected at the
surface into a direction r. Because the viewer lies in infinity, r depends only on the surface normal n at the point of
reflection. A simple calculation shows
r = 2hsjnin , s
(3.5)
where we assume krk = ksk = 1 (Fig. 3.3). This is easily
+s
verified by checking krr+
sk = n and kr k = 1.
n
r
s
F(u0,v0)
Figure 3.3.
a)
b)
Figure 2.2. a) singular isophotes , vanishing
gradient b) dense isophotes , high gradient
The light line which is “seen” by r depends on the kind
of light source and its orientation in space. In our implementation, we incorporated two types of light source, which we
refer to as axial or radial light lines.
φ=
φ=π
3π
2
φ=
The axial light source is a family of straight (light)-lines,
all parallel to a vector z 2 IR3 , which determines the orientation. Moving these lines to infinity (perpendicular to z ),
the projection onto the unit sphere, assigns a longitude to
each light line (See Fig. 3.4). By completing z to an orthonormal coordinate system (x; y; z ) we can parameterize
the longitudes from 0 to 2 as shown in Fig. 3.4. Thus, every
angle 2 [0; 2 [ determines a unique light line l . The radial light source is composed of circles in infinity (however,
we still call them light “lines”), all circles being perpendicular to z . The projection onto the sphere maps them onto
latitudes, which we number from 0 to (Fig. 3.5). Thus, in
this case there is one light line l for each 2]0; [.
Regardless which light source we use, every point
F (u0 ; v0 ) on F corresponds to a certain light line l resp.
l , which can be identified with its corresponding angle. We
call the longitudinal coordinate of r in the case of an axial
light source, and the latitudinal coordinate for radial light
lines.
We are now able to compute for each point F (u0 ; v0 )
its corresponding longitudinal or latitudinal coordinate resp.
The reflected ray r is given by Eq. 3.5. In the case of an
axial light source, the coordinate is computed by tan =
hrjyi
hrjyi
hrjxi , i.e. = arctan hrjxi which can be extracted from
Fig. 3.4. In the radial case, we have cos = hrjz i, thus
π
2
z
φ=0
r
φ
ry
rx
y
x
Figure 3.4. axial light source
= arccoshrjz i
Eq. 3.5 allows to represent the coordinates
terms of (u; v ). We call
I (u; v) = (u; v) = arctan
θ=0
hrjyi
hrjxi
and
in
(3.6)
(in the axial case) and
z
θ=
I (u; v) = cos (u; v) = hrjz i
π
4
(3.7)
(in the radial case) the height field of reflection (HFR) on
r
θ
θ=
θ=
@@@ θ = π
Figure 3.5. radial light source
3π
4
π
2
F . (We clarify later, why we take the cosine for radial light
lines.) Each reflection line of F is then given by an implicit
equation I (u; v ) = i0 .
This enables us to extend the approach we used for
isophotes to reflection lines. A constellation of surface,
viewer position and light source determines a HFR I (u; v ),
defining the reflection lines as isolines of I . The task is as
follows: Fix a certain viewer position and a HFR I on and find a surface f , such that its HFR I f approximates I as well as possible.
By imitating the isophotes approach, it is evident how to
establish the proper error measure for reflection lines:
Z
Z
J (f ) := (rI f , rI )2 = (Iuf , Iu )2 + (Ivf , Iv )2
Just as in the case of isophotes, we want to explicitly represent the functional in the form J (f ) =
R K (f ; f ; f
; fuv ; fvv ). Therefore, we have to express
the partial derivatives of I with respect to u and v , by the
first and second order derivatives of f .
In the following computation, we use g 0 as a substitution
@g
@g
for @u
or @v
resp., g being an arbitrary function on . In
u
v
uu
the axial case, differentiation of Eq. 3.6 leads to
hrjxihr0 jyi , hrjyihr0 jxi
I 0 = 0 =
hrjxi2 + hrjyi2
(3.8)
The computation is much simpler for radial light lines; from
Eq. 3.7 we conclude
I 0 = hr0 jz i
(Now it should be clear, why we did not use I
as coordinate function. We would get I 0 =
(3.9)
= arccos rz
r jz i
, p h,h
r jz i2
0
1
which is singular at r = z !)
Now we have to compute r0 . This is done equally for the
two types of light sources. From Eq. 3.5 we derive
r0 = 2hsjn0 in + 2hsjnin0
(3.10)
Differentiating the normal vector leads to
n0 =
(Fu Fv )0 , hnj(Fu Fv )0 in
kFu Fv k
(Fu Fv )0 is computed by
(Fu Fv )u = Fuu Fv + Fu Fuv
(Fu Fv )v = Fuv Fv + Fu Fvv
and(3.11)
(3.12)
depending on the differential operator. We remember that F
is represented as the graph of the function f and finally get
0f 1
0f 1
uu
uv
(Fu Fv )u = , @fuv A (Fu Fv )v = , @fvv A :(3.13)
0
0
Backward insertion of Eqs. 3.10 - 3.13 into Eq. 3.9 and
Eq. 3.8 resp., we finally get the required representation of
rI . This allows us to compute K = (rI , rI )2 at any
point in the parameter space, in terms of the first and second
derivatives of f . Remark that we do not require an explicit
formula for K . It is sufficient to have a procedure which
evaluates K (fu ; fv ; fuu ; fuv ; fvv ).
We benefit from this representation in the following section, which is dedicated to the minimization of the error
functional.
4 Minimization of the Functional
In the previous sections, we showed how we can represent the error measure in the form
J (f ) =
Z
K (fu ; fv ; fuu ; fuv ; fvv )
where K : IR5 ! IR is a function in the derivatives of f up
to order two. The integrand K is of course dependent on the
configuration of light sources and is different for isophotes
and reflection lines. However, for the understanding of this
section, it is sufficient to know that K can be evaluated by
a numerical procedure.
We us a Ritz-Galerkin approach for the numerical treatment of our problem, i.e. we consider a finite dimensional
subspace of V of C 2 (
). In our implementation we have
chosen V being the space of bicubic tensor product Bsplines over a uniform knot sequence (see [6]). Then we
have to find f 2 V such that J (f ) J (f ) for every
f 2 V . Since conventional numerical methods are very time
consuming, we try to approximate J by quadratic functionals. The minimization of quadratic functionals can be done
very efficiently, in fact it can be reduced to solving a linear
system of equations. Using basis functions with local support (e.g. B-splines) the system is sparse, allowing to use
very efficient linear solvers. (For more details on the minimization of quadratic functionals see e.g. [3].)
Our strategy is as follows: Assume we have an initial
surface f 0 , which is a rough approximation to the minimum
f of J . Now find a local quadratic approximation Jf 0 to J
at ff 0 . Minimization of Jf 0 yields a new, hopefully better
approximation f 1 to f . Of course this procedure can be
iterated, leading to a sequence (f i )i2IN . Provided that the
approximations Jf i are chosen carefully, we can hope that
!1
the sequence converges: f i ,! f .
In order to achieve a good local approximation of J at
f 0 , we take advantage of the Taylor expansion of K , omitting the terms of degree higher than two. So the quadratic
approximation of J is
i
Jf 0 (f ) = J (f 0 ) +
Z
rK (L(f ))t L(h)
1Z
0
(4.14)
+ 2 L(h)t Hess K (L(f 0))L(h)
where h := f , f 0 and Hess K denotes the Hessian of K .
We use the abbreviation L(f ) := (fu ; fv ; fuu ; fuv ; fvv ).
By definition, Jf 0 (f ) = Jf 0 (f 0 + h) is quadratic in
h, therefore allowing an
efficient minimization. It can be
shown that this approximation leads to a quadratically converging sequence f i with limit f , presumed that f i is sufficiently close to the minimum f . In fact, the algorithm is
the well known Newton iteration applied to the gradient of
J . and therefore, the algorithm finds a zero of rJ . Starting
in a neighborhood of f , this zero will be the minimum f .
Setting up the linear system which underlies the
quadratic minimization problem, the matrix entries are
given by L(Bi )t Hess K (L(f 0 ))L(Bj ), which has to be
evaluated for each pair of B-spline basis functions (Bi ; Bj );
computing the right hand vector of the linear system requires the computation of terms rK (L(f 0 ))L(Bj ). There-
Jf air
fore, we have to evaluate the first and second partial derivatives of K at a given L(f 0 ) 2 IR5 . This is done by numerical
differentiation.
where
e.g.
is a simple quadratic fairing functional,
5 Applications
The functional
Jf air (I ) =
Z
2
2
2
Iuu
+ 2Iuv
+ Ivv
:
Z
Japprox (I ) = (I , I 0 )2
5.1 Surface Fairing
Geometric models which are obtained by reverse engineering methods, show often very small perturbations in
surface shape, due to errors in measurement. Reflection
lines are an excellent tool to detect those small range deviations. In order to eliminate these errors, the surface has
to be faired. There are a lot of techniques which perform
fairing directly on the geometry of the surface. However,
this strategy has the disadvantage that the fairing procedure
may distort the overall distribution of the reflection line pattern.
If reflection lines are used as surface interrogation tool,
it is more natural to perform the fairing procedure on the
reflection lines and to adapt the surface to the resulting
smooth lines. Thus, the user first smoothes the lines while
retaining the global look, and the system computes the appropriate surface automatically.
Fig. 5.6 illustrates the fairing strategy. First the user specifies a region where the reflection lines and the surface
should be faired. The outside region remains fixed.
measures the deviation of the new HFR to the existing
one. The weight 2 [0; 1] allows to control to which
extent the lines should be smoothed.
Now compute a new surface f , which approximates
the smoothed reflection lines. We use the minimization
procedure from Section 4. Here, we impose f to interpolate the derivatives up to order two of the previous
surface f . These ensures that the reflection lines of f connect tangent continuous to the lines in the outside
region.
An example is given in Fig. 5.7. The left picture shows
the initial surface with obvious curvature perturbations. The
picture in the middle shows the smoothed lines, being texture mapped onto the initial surface. The right picture shows
the faired surface, which was computed by approximating
the line pattern of the middle picture.
region of
interest
faired
lines
previous
lines
Figure 5.7. Initial surface, faired lines, faired
surface
5.2 Surface Reconstruction
Figure 5.6. Local fairing of lines and surface
We proceed as follows:
Compute the height field of reflection I 0 , which corresponds to the reflection lines of the surface f . In order
to obtain a B-spline representation of I 0 , we evaluate
I 0 on a regular grid and interpolate the sampled data.
Smooth the HFR I 0 by minimizing a functional
Jline (I ). Jline is of the form
Jline (I ) = Jf air (I ) + (1 , )Japprox (I ) ;
In the previous example we tried to interpolate artificial
reflection lines which may not correspond to a surface
geometry. We had to find an approximation. If however,
a set of reflection lines, which is created from an existing
surface is used as input, our algorithm is capable to
reconstruct the original surface. We applied our method
to reconstruct the geometry of spectacle lenses. Since
mechanical measurements often do not provide satisfying
accuracy, it seems reasonable to use optical measuring
based on specular reflection. The arrangement of camera,
light lines and lens is illustrated in Fig. 5.9. The orientation
picture, we used the reconstruction method we developed,
on the right picture a normal fitting method was applied.
Note the different scales on the vertical axis!
Figure 5.8. reflection pattern of a progressive
lens
a)
viewer
z
radial
light source
spectacle
lens
Figure 5.9. Concentric circles are reflected
onto the lens
of the radial light lines is given by z = (0; 0; 1), which
also points to viewer position. The arrangement is adopted
from Halstead et.al. [5], where it was used to reconstruct
the topography of human cornea. The reconstruction algorithm used there is based on fitting a set of normal vectors
which are obtained by backward ray tracing. In our example, we used a CAD-model of a progressive addition lenses
(see [9]). We used this type of lens, because it has an increasing mean curvature along its vertical axis, and therefore exhibits a more interesting reflection pattern than unifocal lenses. (Fig. 5.8).
The error plots in Fig. 5.10 show the difference between
the original lens geometry, and the surface which was reconstructed by adaption to the reflection lines. On the left
b)
Figure 5.10. Error plot: a) our method b) a normal fitting method
References
[1] R. Andersson. Surface design based on brightness intensity
or isophotes-theory and practice. In J. Hoschek and P. Kaklis, editors, Advanced Course on FAIRSHAPE, pages 131–
143. B. G. Teubner, 1996.
[2] J. C. Dill and D. F. Rogers. Color graphics and ship hull surface curvature. In D. F. Rogers, B. C. Nehrling, and C. Kuo,
editors, Computer Applications in the Automation of Ship-
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
yard Operation and Ship Design, pages 197–205. NorthHolland, USA, 1982.
G. Greiner. Variational design and fairing of spline surfaces.
Computer Graphics Forum (Proc. Eurographics ’94), pages
143–154, 1994.
H. Hagen. Surface interrogation algorithms. IEEE Computer Graphics & Appl., pages 53–60, 1992.
M. Halstead, B. Barsky, S. Klein, and R. Mandell. Reconstructing curved surfaces from specular reflection patterns
using spline surface fitting of normals. In H. Rushmeier,
editor, SIGGRAPH 96 Conference Proceedings, pages 335–
342. Addison Wesley, Aug. 1996.
J. Hoschek and D. Lasser. Fundamentals of Computer Aided
Geometric Design. AKPeters, Wellesley MA, 1993.
E. Kaufmann and R. Klass. Smoothing surfaces using reflection lines for families of splines. Computer-Aided Design,
20(6):312–316, 1988.
R. Klass. Correction of local surface irregularities using
reflection lines. Computer-Aided Design, 12:73–77, Mar.
1980.
J. Loos, G. Greiner, and H.-P. Seidel. A variational approach
to progressive lens design. Computer Aided Design, 1998.
to be published.
H. Nowacki and R. Gnatz. Geometrisches Modellieren (Geometric Modelling). Springer-Verlag, Berlin, 1983.
T. Poeschl. Detecting surface irregularities using isophotes.
Computer Aided Geometric Design, 1(2):163–168, 1984.