Modeling 3D Curves of Minimal Energy
Modeling 3D Curves of Minimal Energy
z z
Remco C. Veltkamp and Wieger Wesselink
z Technical University of Eindhoven, Department of Computing Science, P.O. Box 513, 5600 MB
Eindhoven, The Netherlands, e-mail: fremco,[email protected]
CWI, Department of Interactive Systems, Kruislaan 413, 1098 SJ Amsterdam, The Netherlands
Abstract
Modeling a curve through minimizing its energy yields an overall smooth curve. A common way to
model shape features is to perform the minimization subject to a number of interpolation constraints.
This way of modeling is attractive because the designer is not bothered with the precise representation of
the curve (e.g. control points). However, local shape specication by means of interpolation constraints
is very limited. On the other hand, local deformation by repositioning control points is powerful but very
laborious, and destroys the minimal energy property. In this paper, deform operators are introduced
for 3D curve modeling that have built-in energy terms that have an intuitive eect. These operators
allow local shape modication and do justice to the energy minimization way of modeling.
Keywords: Curve design, minimal energy, variational modeling.
1. Introduction
A curve that minimizes some suitable energy functional subject to a number of interpolation con-
straints is usually considered smooth. Modeling these minimal energy curves is a powerful way of
modeling. It allows the design of smooth curves satisfying a number of interpolation constraints, in
a very easy way. The associated energy functional typically depends on local properties of the curve
such as the tangent vector and curvature, in which case it is called the internal energy. A well known
example of such a functional is the bend energy. Because of its physical background, the bend energy
is commonly used (see [1], [9], [10], [2], [3]). Other energy functionals with a physical interpretation
have been studied as well [8]. Also, internal energy functionals can be developed that have some
desired eect, see for example the metrics described in [17].
There are two basic ways of interaction in the design process of a minimal energy curve. Firstly,
constraints can be imposed upon the curve. The most common constraints are point and tangent
interpolation. They can be used to sketch a rough outline of a curve. Secondly, an internal energy
functional can be chosen. With the choice of an internal energy the designer has a certain kind of
global control over the shape of the curve.
These two ways of interaction are useful, but sometimes they are not
exible enough. Flexibility
can be provided by operators that deform the curve locally. In the case of control point based curves
(e.g. Bezier curves or B-spline curves) this can easily be done by repositioning a few control points.
However, the deformed curve does in general not minimize an energy functional.
This paper introduces some design operators that do not suer from this problem. The eect
of such an operator is dened by an energy functional that has a desired deformation eect. Since
this functional depends on properties from outside the curve, it is called external. The internal and
external energies Eint and Eext are combined into one functional, the total energy Etot of the curve,
1
which has to be minimized:
Etot = Eint + Eext : (1)
One of the few examples of minimal energy curves with external energy are active contours in
image processing [12] [22]. They are guided towards contours in an image, under the in
uence of
`image forces'. These image forces deform a curve and they are expressed by means of external energy
terms. However, they depend on image data and are not used as a tool for interactive modeling.
Another dierence with our approach is that active contours are time-dependent. This results in an
increase of complexity and therefore in most practical implementations the active contours are discrete
curves. Another example of modeling minimal energy curves by means of external energy is given in
[6], but only spring forces are used to shape the curve. By contrast, in this paper we will present a
variety of shape operators modeled by external energy components, which are suitable for interactive
design of 3D minimal energy curves.
We have tested the concepts in a prototype system for modeling B-spline curves. However, the
idea is also applicable to Bezier curves or virtually any other class of curves. In order to improve
the speed of the computation the energy functionals are composed of quadratic expressions. This
results in a minimization problem with linear constraints, which is solved using a standard method.
Experiments show that these design operators are useful tools for interactive modeling.
In the following three sections we will discuss various means to model minimal energy curves.
Section 2 discusses the choice of internal energy. Section 3 is about modeling using constraints. Then,
in section 4, we introduce shape operators that work by adding a suitable external energy term to
the total energy functional. Section 5 discusses computational aspects. Some concluding remarks are
made in section 6.
2. Internal energy
The internal energy of a curve is the part of the total energy (1) that depends only on properties of
the curve itself. It determines the global shape of the curve. The internal energy that occurs most in
the literature is the bend energy (Ebend ):
Z
Ebend (x) = 2 (t)kx0 (t)k dt; (2)
For 3D curves, torsion describes the amount of twisting (planar curves have zero torsion). Twisting
can be reduced by adding the following term Etwist to the internal energy:
Z
Etwist (x) = 2 (t)kx0 (t)k dt; (4)
with the torsion of the curve (see [5]). Minimizing this twist energy restrains the curve at every
point from coming out of a plane. The result is a curve that is as
at as possible.
2
y
y
z z
x x
Figure 1: Left: minimal energy curve with point interpolation constraints. Right: with additional tangent
constraint.
For an interactive modeling program the evaluation and minimization of the expressions (2), (3),
and (4) would be computationally too expensive. Therefore they are approximated with the following
ones: Z
Estretch (x) = kx0 (t)k2 dt;
(5)
Z
Ebend (x) = kx00 (t)k dt;
2
(6)
Z
Etwist (x) = kx000 (t)k dt:
2
(7)
These approximations are frequently used (see for instance [8]). The advantage of these approximations
is that for e.g. B-spline curves they are quadratic functions of the control points (see section 5). This
is probably the reason for their popularity, since quadratic functions can be eÆciently minimized. A
disadvantage of the approximations (5), (6), and (7) is that they are parameterization dependent.
Generally speaking, the approximations will be worse when the absolute value of the derivative of
the curve is
uctuating more. Note that for an arclength parameterized curve (kx0 (t)k 1), the
approximations would be exact.
The following three subsections dene operators based on the stretch, bend, and twist energy that
aect a part of the curve. In all the following energy terms, f (t) is a weight function, which determines
the strength of the operator along the curve.
2.1. Tightener
The tightener operator controls the tightness of a part of the curve by reducing the length of that
part. This is done by adding the following term to the energy of the curve:
Zw
Etight (x) = f (t)kx0 (t)k2 dt: (8)
v
This is similar to the approximated stretch energy, but the strength (weight function) and the part of
the curve to which the operator applies is determined by the user.
2.2. Straightener
The straightener operator reduces the bending of a part of the curve. Applying this operator is done
by adding the following term to the energy of the curve:
Zw
Estr (x) = f (t)kx00 (t)k2 dt: (9)
v
3
z
x
y
This is essentially a weighted approximation to the bend energy, applied to only a part of the curve.
The weight function and the aected curve segment is under user control, while the bend energy
applies to the whole curve.
2.3. Flattener
The
attener operator
attens the curve, i.e. it tries to force the curve to lie in a plane. However, it
does not prescribe which plane, in contrast to the plane attractor (see section 4.1).
An energy term that has this eect is:
Zw
Eflat (x) = f (t)kx000 (t)k2 dt: (10)
v
This is essentially a weighted approximation to the twist energy, applied to only a part of the curve.
Similar to the operators above, the weight function and the aected curve segment is under user
control, while the twist energy applies to the whole curve.
3. Constraints
Constraints can be used to sketch a rough outline of the curve. The most commonly used constraints
are point and tangent interpolation. The point interpolation constraint x(t0 ) = p is illustrated in
gure 1 (left), which shows a minimal energy curve interpolating prescribed points. In order to
prevent the curve from collapsing to a single point in its strive to minimize its energy, at least two
specied endpoints should be interpolated.
A tangent interpolation constraint x0 (t0 ) = r forces the curve to attain a shape so as to have the
prescribed tangent at some point of the curve. This is illustrated in gure 1 (right), which shows
the left curve with an additional tangent constraint. Note that the length of the curve is increased
somewhat.
In addition to the common point and tangent interpolation constraints we have designed a point-
in-plane constraint n x(t0 ) = a, which forces a point x(t0 ) of the curve to lie in the plane n x = a.
A point-on-line constraint is the combination of two point-in-plane constraints, illustrated in gure 2.
The (innite) lines are denoted by line segments. The curve points x(ti ) are free to slide along the
lines so as to minimize the internal energy. Apart from the point-on-line constraints, there are two
point and tangent interpolation constraints at the endpoints of the curve.
4
z
x
z
y x
5
z
The grey line is the attractor which is applied to the curve segment between the two circles.
Let ` be the attractor curve. The part of the curve x in the interval [v; w] can be attracted to `
by an energy term of the following form:
Zw
Ecat (x) = f (t)kx(t) `(t)k2 dt: (12)
v
Minimizing this expression amounts to minimizing the total deviation between the curve segment and
the attractor curve. As for the plane attractor, this energy term has to compete with other terms,
which may restrain the design curve from interpolating the attractor curve.
For a straight line as attractor curve, we can also model the attraction operator as the combination
of two plane attractors. Given a straight line, we can construct two perpendicular planes through
the line. The resulting attraction is an attraction to the intersection line, which has the advantage
that the attractor does not depend on a parameterization of the line and the correspondence with the
parameterization of the curve, as for the arbitrary curve attractor in (12).
4.4. Director
The director is a design operator that tries to push the tangent along a segment of the curve in a
specied direction, as illustrated in gure 6. The small circles on the curve identify the parameter
interval [v; w] on the curve to which the operator is applied. Let r be the prescribed unit direction
vector. In any point on the curve the quantity kx0 rk2 measures the orthogonality between the
6
y y
z x z x
Figure 5: Left: curve with point attractor operator. Right: resulting minimal energy curve.
tangent vector x0 at the point and the vector r. The smaller the deviation between prescribed and
given tangent vector, the smaller the length of the cross product.
Therefore, a suitable energy term that tries to direct the tangent of the curve in the parameter
interval [v; w] into the specied direction is:
Zw
Edir (x) = f (t)kx0 (t) rk2 dt: (14)
v
Minimizing this expression amounts to minimizing the total deviation between the prescribed and
given tangent along the curve segment.
Figure 6: The direction (2; 1; 1) imposed on the curve segment between the circles.
7
y y
z x z x
Figure 7: Left: design curve and the prole. Right: minimal energy curve after applying the proler.
8
y y
z z
x
x
Figure 8: Left: curve with point repellor. Right: minimal energy curve after applying the repellor.
Most of the eect of this operator is that the point x(t0 ) slides along the curve to increase the
distance to p, but the shape of the curve is hardly changed. We can prevent this behavior by combining
the above energy term with the constraint that point x(t0 ) must remain on the line through p and
x(t0 ). This point repellor is illustrated in gure 8.
Similarly, we can build a point repellor applying to a curve segment, with energy term
1
Rw :
v f (t)kx(t) pk2
Just as we have the curve and plane attractor, we can construct a curve and plane repellor analogous
to the point repellor.
where the basis functions Nid are dened by the de Boor recursion relations:
t i+1 d 1 i+d t d 1
Nid(t) = Ni (t) + Ni+1 (t);
d d
1 if i 1 t < i;
Ni0 (t) = 0 otherwise.
The curve is dened over the domain [d 1; m + d 1]. m is the number of curve segments if all knots
in the domain are simple (do not coalesce).
9
In the rest of this section, the vector that contains the components of the control points of a
B-spline curve is denoted as P :
P = [P x : : : P m
0 ( P0y : : : P(m+d 1)y P0z : : : P(m+d 1)z ]T :
+d 1)x (18)
The subscripts x, y and z stand for the x, y and z -coordinates respectively. The dimension of P will
be denoted as g (so g = 3m + 3d). In our implementation we have used cubic B-spline curves (d = 3).
Pi Nid(t0 ) = p:
i=0
Hence a point interpolation constraint consists of three equations C T P = q , one for the each coor-
dinate, where the C 's are suitably chosen g -vectors and P is the vector dened in (18). Note that
these equations are linear in P , if t0 is xed. The value of t0 is determined automatically as the value
corresponding to the point of the curve closest to p.
A tangent constraint x0 (t0 ) = r takes the following form:
mX
+d 1
Pi N_ id (t0 ) = r:
i=0
If t0 is xed, the tangent constraint can be written in the form of three linear constraints C T P = q ,
one for the each coordinate, with the C 's suitably chosen g -vectors. In practice we use the tangent
constraint in combination with a point interpolation constraint, which determines the value of t0 .
A point-in-plane constraint n x(t0 ) = a expands into
mX
+d 1
(n Pi )Nid (t0 ) = a:
i=0
For a user-specied value of t0 , this equation is linear in the control points and can be written as a
single vector equation C T P = a. The point-on-line constraint is a combination of two point-in-plane
constraints. (The point interpolation is a combination of three point-in-plane constraint, but more
eÆciently represented as done above.)
td 1
10
mX
+d 1 mX
+d 1
tmZ+d 1
= Pi Pj Nid(t)Njd (t) dt:
i=0 j =0 td 1
This can be written in matrix form as Ebend (x) = P T Abend P , which is quadratic in P . The elements
of the g g -matrix Abend contain integrals of products of B-spline basis functions.
Substitution of the B-spline representation into the plane attractor energy functional (11) gives
Zw
Eplat (x) = f (t)(n x(t) a)2 dt
v
mX
+d 1 mX
+d 1 Zw mX
+d 1 Zw
= (Pi n)(Pj n) f (t)Nid (t)Njd (t) 2a (Pi n) Nid(t0 ) dt + a2 :
i=0 j =0 v i=0 v
This can be written as Eplat (x) = P P TA
plat P + cplat , with Aplat a g g-matrix, and Bplat
T
+ Bplat
a g -vector. Similarly, substitution of the B-spline representation into all the other energy functionals
except for the point repellor gives expressions that can be written in the form
E (x) = P T AP + B T P + c: (20)
The point repellor is a special case: its energy functional is not quadratic, but the reciprocal of a
quadratic function, which is easily veried by comparing the energy functional of the point repellor (16)
with the energy functional (13) of the point attractor. Substitution of the B-spline representation into
Eprep gives an expression of the form
1
P T Aprep T P + cprep :
P + 2Bprep
Now that we have seen that the energy functionals can be written as (reciprocals of) quadratic
functions in P , it's time to take a closer look at the matrices A and vectors B that constitute these
functions. We restrict ourselves to piecewise constant weight functions f (step functions), and the
curve ` in Ecat is polynomial. With this in mind, a careful examination of the energy functionals
learns that the computation of the matrices and vectors involves the computation of the following
primitive functions:
Nid (t);
Nid (t)Njd (t);
Z
N_ d (t)N_ jd (t) dt;
Z i (21)
Nid (t)Njd (t) dt;
Z
N d (t)Njd (t) dt;
Z i
tk Nid(t) dt; k = 0; : : : ; degree(`) + 1;
for 0 i; j m + d 1. Since the B-spline basis functions Nid are piecewise polynomial, these
primitive functions have to be computed for individual intervals [k; k + 1].
A basis function Nid is in the interval [k; k + 1] a degree d polynomial dened on the knots
fk d + 1; : : : ; k + dg. We have computed these coeÆcients with Mathematica [23] for the case d = 3
11
(cubic curves). They consist of large sums of terms, each of them depending on the knots. The
integrals (21) only have to be computed for 0 i; j 3, because of the following property of uniform
B-spline functions:
Nid(t) = Nid k (t kh); k 2 IN; k i;
for some h. All these polynomials have to be computed only once. Once they are stored, the compu-
tation of the matrices A and vectors B is nothing more than substitution of the parameter values v
and w in these polynomials. See for more details [21], which describes the case for planar non-uniform
B-splines.
5.4. Calculation
In the previous subsection we have seen that all the energy functionals that we use are (reciprocals
of) quadratic functions of the control points of a curve. Therefore the total energy Etot , which is a
linear combination of these functionals, can be written as a function in P of the following form:
X 1
Etot (P ) = P T AP + 2B T P + c + (22)
i P T Ai P + 2BiT P + ci
where the A's are g g -matrices, the B 's are g -vectors, and the c's are numbers.
We have also seen that all constraints are linear in P . So we have a minimization problem with
linear constraints of the following form:
Minimize Etot (P ) (23)
subject to C P = D; (24)
where C is an h g -matrix, and D is an h-vector, with h the number of constraints.
We solve this system in two steps. First the constraint equations (24) are used to eliminate some
variables from the minimization problem (23). This results in an unconstrained minimization problem
with an object function of the same form as (22). This unconstrained minimization problem is solved
using the conjugate gradient method, described in [13].
6. Concluding remarks
We have introduced a way of modeling minimal energy curves by means of operators that aect the
total energy of the curve. These operators eectively control groups of control points at once. The
tightener, straightener,
attener, and director directly in
uence the local behavior of the curve, the
other operators directly in
uence the position of a part of the curve. In this way we can deform the
curve locally, while the energy minimizing principles remain satised. By contrast, the internal energy
of a curve always has a global eect on its shape. This gives additional
exibility over the standard
way of minimal energy curve modeling (with constraints and internal energy only). The eectiveness
for planar curves has been demonstrated in [21]. Experiments show that these operators oer an
intuitive way of modeling.
In the current paper we have extended the set of operators. Some of the extra operators are also
applicable to planar curves, some are only sensible for 3D curves. The computational aspects of the
implementation have been described in section 5. The implemented system has no satisfactory user
interface for intuitive interaction. This nontrivial aspect is part of future work.
The same way of modeling applies to surfaces. Modeling is again commonly done by means of
constraints and by choosing the internal energy functional [16] [4] [14] [20] [11]. The use of external
energy components is again limited to spring forces [18]. We have designed a number of more
exible
operators that add external energy terms [19].
12
One may wonder what the actual physical meaning is of the constructed total energy of a curve.
The bend energy component Ebend has a physical justication, although it is an approximation. The
external energy components are designed heuristically so as to have the desired eect. The composition
of the internal and external energy functionals is a rather arbitrary weighted sum of the individual
components.
The modeling by means of external energy functionals also has its limitations. When the weight
factor of an external energy functional is increased to a very high level, the corresponding part of
the curve will almost exactly meet the specications of the operator. But the neighborhood of this
segment of the curve can be heavily disturbed when the energy in this portion of the curve dominates
the total energy of the curve so much that the rest is neglected. Then the neighborhood of this portion
will do anything to decrease the energy in this portion, even if this causes them to oscillate wildly.
When the user applies an external energy operator to a segment of the curve between certain
parameter values, the lengths of the curve segment corresponding to the parameter range before and
after minimization are generally not the same. This is caused by the fact that the curves are not
arclength parameterized.
To alleviate these two problems we can use hierarchical spline curves. A hierarchical spline is
the sum of a base curve and additional spline segments. The segments added to the base curve are
typically used to model local detail. Each external energy operators could add a new spline segment
to the hierarchical spline to provide the local renement. However, this would make the nal curve
dependent of the order in which the operators are applied. In our current concept, the operators have
no order dependent eect, since they aect one total energy functional for the whole curve.
References
[1] Garret Birkho and Carl R. de Boor. Piecewise Polynomial Interpolation and Approximation,
pages 164{190. Elsevier, 1965.
[2] Guido Brunnett, Hans Hagen, and Paolo Santarelli. Variational design of curves and surfaces.
Surveys on Mathematics for Industry, 3(1):1{27, 1993.
[3] Guido Brunnett and Johannes Kiefer. Interpolation with minimal-energy splines. Computer
Aided Design, 26(2):137{144, February 1994.
[4] George Celniker and Dave Gossard. Deformable curve and surface nite-elements for free-form
shape design. Computer Graphics, 25(4):257{266, July 1991.
[5] M. P. do Carmo. Dierential Geometry of Curves and Surfaces. Prentice-Hall, 1976.
[6] Lian Fang and David C. Gossard. Fitting 3D curves to unorganized data points using deformable
curves. In Tosiyasu L. Kunii, editor, Visual Computing, pages 535{543. Springer-Verlag, 1992.
[7] Gerald Farin. Curves and Surfaces for Computer Aided Geometric Design. Academic Press, 3rd
edition, 1993.
[8] Hans Hagen and G. Schulze. Variational principles in curve and surface design. In Hans Hagen and
Dieter Roller, editors, Geometric Modelling{Methods and Applications. Springer-Verlag, 1991.
[9] B. K. P. Horn. The curve of least energy. ACM Transactions on Mathematical Software, 9(4):441{
460, December 1983.
[10] Emery D. Jou and Weimin Han. Minimal-energy splines I: Plane curves with angle constraints.
Mathematical Methods in the Applied Sciences, 13:351{372, 1990.
[11] Michael Kallay. Constrained optimization in surface design. In Proceedings IFIP TC5/WG5.10
Working Conference on Modeling in Computer Graphics, Methods and Applications, 1993.
[12] M. Kass, A. Witkin, and D. Terzopoulos. Snakes: active contour models. International Journal
of Computer Vision, 1(4):321{331, 1988.
[13] David G. Luenberger. Linear and Non-Linear Programming. Addison-Wesley, 2nd edition, 1989.
[14] Henry Moreton and Carlo H. Sequin. Functional optimization for fair surface design. Computer
Graphics, 26(2), July 1992.
13
[15] William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. Numerical
Recipes in C, The Art of Scientic Computing. Cambridge University Press, 1988.
[16] T. Rando and J. A. Roulier. Designing faired parametric surfaces. Computer Aided Design,
23(7):492{497, September 1991.
[17] John Roulier, Thomas Rando, and Bruce Piper. Fairness and monotone curvature. In Charles K.
Chui, editor, Approximation Theory and Functional Analysis, pages 177{199. Academic Press,
1991.
[18] Demetri Terzopoulos and Hong Qin. Dynamic NURBS with geometric constraints and for inter-
active sculpting. Transactions on Graphics, 13(2):103{136, April 1994.
[19] Remco C. Veltkamp and Wieger Wesselink. Interactive variational spline surface design. Technical
Report, Technical University of Eindhoven, 1995.
[20] William Welch and Andrew Witkin. Variational surface modeling. ACM Computer Graphics,
26(2):157{166, July 1992.
[21] Wieger Wesselink and Remco C. Veltkamp. Interactive design of constrained variational curves.
Computer Aided Geometric Design (accepted for publication), 1995.
[22] D. J. Williams and M. Shah. A fast algorithm for active contours and curvature information.
CVGIP: Image Understanding, 1(55):14{26, 1992.
[23] S. Wolfram. Mathematica: A System for Doing Mathematics by Computer. Addison Wesley,
1991.
14