Hyperquadrics: Smoothly deformable shapes with convex polyhedral bounds

Hyperquadrics: Smoothly deformable shapes with convex polyhedral bounds

COMPUTER VISION, GRAPHICS, AND IMAGE PROCESSING 44, 191-210 (1988) Hyperquadrics: Smoothly Deformable Shapes with Convex Polyhedral Bounds':' ANDREW ...

1MB Sizes 1 Downloads 22 Views

COMPUTER VISION, GRAPHICS, AND IMAGE PROCESSING 44, 191-210 (1988)

Hyperquadrics: Smoothly Deformable Shapes with Convex Polyhedral Bounds':' ANDREW J. H A N S O N

Artificial Intelligence Center, Computer and Information Sciences Division, SRI International, Menlo Park, California 94025 Received November 16, 1986; accepted May 31, 1988 We present a new approach to the problem of modeling smoothly deformable shapes with convex polyhedral bounds. Our hyperquadric modeling primitives, which include superquadrics as a special case, can be viewed as hyperplanar slices of deformed hyperspheres. As the original hypersphere is deformed to its bounding hypercube, the slices undergo corresponding smooth deformations to convex polytopes. The possible shape classes include arbitrary convex polygons and polyhedra, as well as taperings and distortions that are not naturally included within the conventional superquadric framework. By generalizing Blinn's "blobby" approach to modeling complex objects, we construct single equations for nonconvex, composite shapes starting with our basic convex primitives. Hyperquadrics are of potential interest for the generation of synthetic images, for automated image interpretation and for psychological models of geometric shape representation, manipulation, and perception. © 1988 Academic Press, Inc. 1. I N T R O D U C T I O N

Models of geometric shapes are required for many tasks that involve the description and understanding of spatial phenomena. In computer graphics applications, we need models that produce realistic impressions of the objects being depicted. In psychology, we need general models with perceptually relevant parameters so that we can quantify psychologically significant shape characteristics. To automate the extraction of shape information from real images, we must have geometric models that are broad enough to encompass naturally produced shapes, yet simple enough to allow us to solve for their parameters. Unified approaches to shape modeling that meet all these criteria are clearly very desirable. Pentland [9] has argued that many of the required features are in fact produced by the conventional superquadric approach [1, 3], with the addition of linear tapering and quadratic bending [4]; he suggests using these primitives as elements of a shape grammar that would correspond to the way people think of physical objects (see, e.g., [5]). However, since the geometric limits of superquadrics are Cartesian cubes, a shape grammar based on superquadrics is necessarily severely restricted. In this paper, we solve the problem of finding new shape primitives that retain the basic elegance of superquadrics while having geometric limits corresponding to arbitrary convex polytopes. To achieve this, we imagine that we live in a very high-dimensional world and construct what for us would be conventional superquadrics based on hyperspheres; then we intersect a set of hyperplanes with our high-dimensional superquadrics to produce low-dimensional objects. Shapes such as triangles and tetrahedra that cannot be constructed using superquadrics then *This research was supported in part by National Science Foundation Grant IST-8511751, and in part by Defense Advanced Research Projects Agency Contract M D A 903-86-C-0084. 191 0734-189X/88 $3.00

Copyright© 1988 by AcademicPress, Inc. All rightsof reproductionin any form reserved.

192

ANDREW J. HANSON

arise naturally. We will refer to the class of shapes generated using this approach as

hyperquadrics. While we could in principle construct nonconvex and composite shapes from elementary hyperquadrics using standard constructive solid geometry techniques [7], we adopt instead an alternative method related to Blinn's "blobby" model [5a] that uses slices of high-dimensional geometric objects to produce elegant single equations for complex objects. In the following sections, we first present some background and motivating observations, followed by mathematical details of the hyperquadric approach. We then discuss methods for solving the shape equations and present some examples. Finally, we introduce our techniques for generating composite shapes. 2. B A C K G R O U N D AND MOTIVATION

The simple superquadric equation x

vl+

y

v2

(1) sl

Is21

was popularized by Piet Hein and has been used for shape design by architects and furniture designers [1]. The solutions of Eq. (1) can be parameterized as x = s 1 sign(cos 0)[cos 01~1

(2)

y = s 2 sign(sin 0 )1sin 01~2,

where a i = 2/3'i. This is a mapping from Eq. (1) to the unit circle. Varying "/i from oo down to 0 (or a/from 0 to o~) interpolates among biaxially symmetric contours, as shown in Fig. 1. The geometric outer limits of the shape described by Eq. (1) are determined by its behavior when the exponents are large. Large exponents in turn dominate when their arguments approach unity. The bounding geometry of Eq. (1) is therefore the intersection of the orthogonal strips bounded by the following pairs of equations: x --

= l ~ x =

_+Sl

s1

Y

(3) 1 --+y

+s 2.

$2

~=

=0

,7= 2

3,= 1

3,= 0

FIE;. 1. The behavior of the solutions of Eqs. (1) and (2) as the parameters a = 2 / y are varied. The dotted line is the bounding box for all solutions; the dashed line bounds the convex deformations. The heavy dots are the fixed points of the deformations.

HYPERQUADRICS

193

When 71 = 72 = 1, the figure described by Eq. (1) becomes the diamond, + -- = 1,

(4)

S2

which forms the inner bound of the convex solutions and is the topological dual of the outer bounding box. For exponents smaller than unity, the shape becomes concave. The superquadric concept is easily generalized to describe surfaces in three dimensions [1, 3]. The unmodulated equation X ~1 +

y

Y2

--

Z ",'3 +

--

S1

=

1

(5)

S3

is solved by the parameterization x = s I sign(cos 0 cos q~)lcos 0 cos ~1~ y = s 2 sign(sin Ocos ~)1 sin 0 cos q~]":

(6)

z = s 3 sign(sin q~)[sin ~1 ~3 with a i = 2 / 7 i . The modulated equation ( x ~,l - -

\1 S1 I

y :,l ..1-

~2/vl

Z Y2

+

- -

= 1

-

s2

(v)

$3

is similarly solved by x = s 1 sign(cos 0 cos +)lcos 01 ~tlICON~)l a2 y = s 2 sign(sin 0 cos q,)lsin Ol" Icos q~l~:

(8)

z = s 3 sign(sin +)1 sin ~1,~2. These equations describe cubes, cylinders, spheres, octahedra, and the interpolations among such figures. In Fig. 2, we illustrate the deformations of the resulting surface for equal exponents. As in the two-dimensional case, the exterior solution boundaries can be determined from the equations X --

"}'S 1

= l - - , x =

S1 i

Y

I=1 ~y

+s 2

(9)

$2 I Z --

=

1 ~

z

=

+s

3,

S3

which describe the faces of a cube. The inner boundary of convex shapes is the

194

ANDREW J. HANSON

-r = 0o

,7 = 2

3,=

o~= 0

0<=

0<=2

1

1

-r=

0

o~=,~

FIG. 2. The behavior of the solutions of Eqs. (5) through (8) with equal exponents a = 2/T. The cube is the bounding surface of all solutions; the fixed points of the deformation are represented by heavy dots.

octahedron

zl

+

+ -- = 1 ,

(10)

S3

found by setting 7i = 1. We now observe that, while it was impossible to form a triangle in any way from the two-dimensional superquadric (1), whose family of solutions is shown in Fig. 1, we can get a triangle from the three-dimensional superquadric Eq. (5) by intersecting a plane with the 3' = 1 octahedron at a triangular face. As Y varies from I to o0, this triangle deforms smoothly through a circle to its dual triangle, the intersection of the plane with a corner of the resulting cube; we show how this happens in Fig. 3. Alternatively, if we translate the plane along its perpendicular direction while letting 3' ---, oe, the intersection of the plane with the resulting cube changes from a triangle to a hexagon to another (dual) triangle, as shown in Fig. 4. The crucial feature distinguishing Eq. (5), when intersected with a plane, from Eq. (1) is the addition of a third term corresponding to the projection of the third axis onto two-dimensional space. With three terms, we can obtain triangles, pentagons, and hexagons in addition to quadrilaterals, whereas only quadrilaterals are possible with two terms. We deduce that by introducing equations with arbitrary numbers of linear terms raised to powers, we may generate shapes whose bounding polytopes have arbitrary numbers of faces. In the next section, we study the mathematical properties of such

o •y =

a=2

1

~=

o~=1

A

2

,,/=

=o

a=O

FIG. 3. Constructing a triangle by intersecting a plane with a superquadric octahedron and deforming it to its dual by changing the exponent y of Eq. (5).

HYPERQUADRICS

195

4P"

4P"

MIDDLE

BOTTOM

i

TOP

FIG. 4. Constructing a triangle by intersecting it near a comer of the cube "/-~ oo and deforming it through a hexagon to its dual triangle by changing the position of the planar intersection for fixed 3'.

equations and present an interpretation in terms of the geometry of hyperspherical mappings. 3. THE HYPERQUADRIC EQUATIONS

We now show how to generalize the superquadric equations (1), (5), and (7) to encompass shapes whose limiting boundaries are arbitrary convex polytopes. 3.1. Derivation First, let x be a D-dimensional vector and consider N >_ D linear, independent functions Ha(X ) of the form

o /<(x)

=

)

Era,x,+<,

(11)

i=1

where rai and d a are constants. A strip in D-space bounded by a pair of (D - 1)dimensional hyperplanes is described by the equations I n a ( x ) l = 1 -~ H a ( x ) = + 1 .

(12)

We observe that intersections of strips of the form specified by th& equation produce arbitrary convex polytopes. Exploiting the analogy between Eq. (12) and Eqs. (3) and (9), we deduce that we may construct equations with the desired bounding geometry by considering a sum of terms of the form (11) raised to arbitrary powers. The basic hyperquadric equation is thus N

n ( x ) = E % l / < ( x ) I ~° = c .

(13)

a=l

Here we have introduced for generality the sign oa = + 1 that determines whether the hyperquadric is elliptic or hyperbolic in nature. The constant C is chosen to be unity for elliptic shapes; for hyperbolic shapes, C = + 1 distinguishes between classes of hyperboloids (e.g., hyperboloids of one or two sheets in three dimensions), and C = 0 produces the degenerate conic case. In the hyperbolic case, the asymptotic surfaces of Eq. (12) bound the volume inaccessible to hyperboloids.

196

ANDREW

(a)

I

J. H A N S O N

~'

(b)

i i i i i i i i i i i i~!ii i i i

v

I

i!i i i i i i i i i i i i i]i i i i i i i i i i[i i••••1•!ii i i i i i i i i i i i i i i i i i iIi i

....................................................................................... !

]i!i!![!!!ii!i~i ~iilrii~i~iiiiii

!

,

........................

,

'

=:

qiiiiiJi]]i!iiiiiiiiiiiiiii]iiJili~,

...............................

'

X

,

i[iiiiiiiii!iiil ...................................

,

X

%!!1!!~ . . . .

FIG. 5. (a) A strip of the plane defined by the equation Ixl ~ 1. ( b ) A n o t h e r strip, lY - 11 < 1. (c) A third strip, ix + y[ _< 1. (d) T h e triangular bounding region designed by taking the intersection of the three strips shown: The shape described by the corresponding three terms in Eq. (15) deforms smoothly from an ellipse to the bounding triangular region as the exponents vary from % = 2 ~ oe. Figures with any convex polygonal limiting boundary can be designed naturally using this method. Exactly analogous techniques can be used to design three-dimensional figures with arbitrary polyhedral limits phrased as intersections of three-dimensional strips.

If desired, the hyperquadric equation may be modified to produce generalizations of the superellipse, Eq. (7), i.e., forms with degenerate exponents such as

+.-"

+lnu_l(x)

-

+[HN(X ) Iv'-' = 1 .

(14)

3.2. Properties We now examine some properties of Eq. (13). "Clay-like" shape control. In order to get a better intuitive understanding of the nature of Eq. (13), let us consider a simple example in two dimensions with three terms, Ixl ~' + lY - 11 v2 + Ix + y l v3 = 1.

(15)

The bounding strips of each term are shown in Fig. 5, along with the triangle in which they intersect; this triangle is the extremal bound of the shape described by Eq. (15) in the limit of large exponents. In Fig. 6, we show how increasing each exponent in turn with the others small pulls the shape toward the corresponding boundary. Figure 6d shows the smooth elliptical shape described by Eq. (15) with 7~- = 2. Hyperspherical limit. For ordinary superquadrics, a spherical form results when all the exponents are equal to two. For hyperquadrics, when 7a = 2, Eq. (13) becomes a quadratic but possibly nondiagonal form.

HYPERQUADRICS

(a)

(b)

(c)

(d)

197

FIG. 6. Deforming separate portions of the boundary of Eq. (15) independently. (a) Only the exponent of Ixl large, that is "/t >> 2. (b) Only the exponent of lY - 11 large. (c) Only the exponent of Ix + Y l large. (d) All exponents approaching 2. Equation (15) thus allows relatively independent control of the deformation characteristics of the edges of the asymptotic figure.

When convenient, we choose a coordinate system that reduces Eq. (13) to a symmetric, diagonal form as the exponents approach two; we will find this notation useful in several other contexts as well. We define /L(x)

=

D E raiXi ~- da i=1

D xi t --m" E Pai-'~i -~- PaO~o i=1 D X# = E Palz--,

(16)

where t = x o is a constant parameter that is interpretable as the distance to a constant hyperplane in a ( D + 1)-dimensional space D of whose dimensions are spanned by x. We do not require t = 0 because that would impose unwarranted restrictions on the classes of shapes that could be represented. The condition that

X~

N

=

E

a= 1

/~=0

Yo

S~

be reducible to a diagonal quadratic form when Va = 2 for all a thus becomes N a=l =

where ~-~= ± 1, depending on the elliptic or hyperbolic nature of the shape.

(17)

198

A N D R E W J. HANSON

Interpretation in terms of hyperplanar sections. Next, we show that when we impose the restrictions (17) on the form of Eq. (13), we may interpret the elliptic case of Eq. (13) in terms of intersections of hyperplanes with superquadric deformations of hyperspheres. Similar interpretations hold for the hyperbolic cases. The superquadric equation (7) may be generalized to an arbitrary dimension N by writing N

E

Xa ~

S~

= 1,

(18)

a=l

where X is a vector in N Euclidean dimensions with components Xa, a = 1 , . . . , N. We omit possible hyperbolic signs oa for clarity. The solutions of Eq. (18) are expressed by mapping them into an undeformed hypersphere using X a = Sa

sign(Ua)[ U~[~o

0/a = 2 / y a

N E (U~) 2 = 1.

(19)

a=l

If we introduce a family of K orthogonal (N - 1)-dimensional hyperplanes, N Vk • X =

E PakXa = ~'k, a=l

k = 1 .... , K,

(20)

their intersection is another hyperplane of (N - K ) dimensions. Intersecting this hyperplane in turn with Eq. (18) and taking K = N - D, we find a D-dimensional subspace. Now we transform X to a new basis, Xa

-Sa

D

N-D

= E P,,i xi + i=1

si

E

vakXk,

(21)

k=l

where x D i = 1 . . . . , D, are the remaining Cartesian coordinates in D-space and is an N x D matrix obeying Or - p = 1D and 0z • v = 0. If we define

I&,l

t PaO-~o=

N-D E Pak~k, k=l

(22)

we complete the identification of Eq. (18) with Eq. (13) under the stated assumptions. Since the bounding limits of superquadrics in high dimensions are Cartesian hypercubes, the class of bounds of Eq. (13) thus consists of intersections of hyperplanes with hypercubes [13]. Surface normals. The left-hand side of Eq. (13) is essentially a non-Riemannian metric describing a family of hypersurfaces parameterized by a constant distance from the origin; the equation thus provides an "inside/outside" test that determines

HYPERQUADRICS

199

whether or not a point x is inside the deformed hypersphere (or in a particular hyperbolic domain). Small changes in the distance from the origin evolve the surface in the direction of the local gradient. The normal to the surface, n, is thus found by evaluating the gradient of the equation at a point on the surface and normalizing to unity if desired [6]: OH ni - -- -

OXi

N ~ 3,a%lO[ to-1 sign(H~)r~i. a=l

(23)

Surface curvature. The curvature in three dimensions is computed by considering the surface to be a graph covered by a number of local single-valued patches z(x, y). Each particular patch (e.g., the northern or southern hemisphere of a 2-sphere) is defined using

(24)

f ( x , y, z) = f ( x , y, z ( x , y ) ) = H(x) - C = 0.

Using the implicit function theorem, we may compute the patch derivatives in terms of H(x) to be

Oz(x,y) Ox~ 02z(x, y )

ax~ axj

(Of)-10f -

7z

(OH)-I OH

Oxi -

[OH]-1(

I

)

02H

~

Ox, Oz

02H (25)

ax~ ax------j+ axj Ox~ az +

Oz m02H Oz Oz 02H I ax~ axj az + Ox~ axj -O-Z ~'

where we use the notation x a = x, x 2 = y. We now invoke the standard formula [6] to compute the scalar curvature K at a point (x, y) in a surface patch z(x, y) defined implicitly by H(x):

K(x, y)

022 02Z = Ox2 Oy 2

02Z

1+(0z.ff~_x) 7+2 ~0Z

2 2.

(26)

The curvature can be used in computer graphics applications to determine whether or not a more detailed surface tesselation is needed at any particular point.

4. SOLVING THE EQUATIONS The hyperquadric equation (13) differs in an essential way from the N-dimensional superquadric equation (18) because the number of terms N exceeds the number D of spherical variables that might be used to parameterize the solution. Explicitly parameterized solutions such as Eq. (19) are therefore not generally obtainable. Fortunately, very satisfactory numerical solutions can be obtained quickly using standard numerical methods. Since the solutions of the N-dimensional equation (17) are bounded by the hypercube X a = _+Sa, the elliptic solutions of Eq. (13) are bounded by the projec-

200

ANDREW J. HANSON

tions of that hypercube into D-dimensional space. However, the specific bounds for a given slice are determined by the intersection of the slice with the hypercube and may be quite different from the outer limits of the projected hypercube. Several methods may be used in practice to solve Eq. (13). Among these are the following: • Direct search of a spatial lattice for all points lying within the surface boundaries. • Choose a grid on a hypersphere and evolve each point in the direction of the normal until it crosses the surface. • Start from an approximate solution with a radial surface parameterization and apply Newton's method to refine the radial solutions. We next describe in detail the last approachto solving Eq. (13) in the elliptic case. Good numerical solutions to the hyperquadric equations can be found by examining approximate solutions to the equations derived from t h e exact N-dimensional superquadric parameterizations. We begin by defining a parameterization ( u i ) of the unit D-sphere in (D + 1) dimensions: NEWTON'S METHOD FOR A RADIAL PARAMETERIZATION.

u0 = sin4~ ul = cos 0 cos ¢1 "'" cos ¢~-2

cos

u 2 = sin 0 cos eOl • "" cos +D-2 COS (27) UD_ 1 = sin q>o_1 cOS ~bD_2 COSq~ u D = sin q>o-2 cos +,

where 0 < 0 < 2~r, - r r / 2 < q,j < ,r/2, - ~ r / 2 < ~p < 7r/2, and D

Y'. (ui) 2 + (Uo) 2 = 1.

(28)

i=1

Next, we exploit the parallels between the N-space and the (D + 1)-space coordinate systems by defining D

X/x

Xa = Sa E Pap-=0 S~ D Ua = E Pa~Ut~"

(29)

(30)

t~=0

Note that Eq. (30) gives an interesting explicit mapping from the equation of a sphere in N-space to that in (D + 1)-space because N

D

E (Ua) 2 = • affil

iffil

(ui) 2 + (Uo) a = 1.

(31)

HYPERQUADRICS

201

Substituting Eqs. (29) and (30) into both sides of Eq. (19), we find

Z)

x ~ , ( D ) p,,~,-- = sign ~ PavUv

/~=0

S~

D2/'~° E p~.U,

v=O

.

(32)

v=O

Invoking the constraint Eq. (17), we find the approximate solution

Xi = Si E Pai sign

PavUv

PavUv

.

(33)

Unless D = N or Ya = 2, Eq. (33) is not a true solution for xi(u,) because p . pa- is singular and substituting Eq. (33) back into Eq. (32) will not give a self-consistent result. To solve the equations numerically, we begin with a fixed value of + and write

xj = r( O, 41 .... ,4D-2)Uj( O, 41 .... , 4D-2, 1~) t = Uo = sinqJ,

(34)

where u i is defined by Eq. (27). The equation to be solved now takes the form

F(r)=

N

D

E

E OalxxP"

a=ll/z=0

f ' ( r ) -~

"/a S/~ {

--1

(35)

~ .ya ~ Pap__ "la-1

[ D

a=l

\/~=0

x~

1/~=0

X ) ~

sign[ ~_, p~,~s~

S/z

/z i=1

ui ' Pai-Si

Newton's method is then used to solve Eq. (35) at each (0, 4~) for r0 such that

F(ro) = O.

(36)

Note that points of inflection are common in these equations, so that the "fail-safe" Newton's method described in reference [11] is usually required. This value of ro is then inserted in Eq. (34) to compute the numerical values of xi(O, 4~)- A good initial value for r may be found by substituting the approximate solution Eq. (33) for { x i } into Eq. (34), [ D

~ 1/2

r(O,4k) ~ (COS~)-IIj~=I(Xj)2 j



(37)

5. EXAMPLES

We now present some typical shapes that can be modeled using the hyperquadric techniques derived in the previous sections.

202

ANDREW J. HANSON

Two dimensions.

In two dimensions, we write Eq. (13) as N

Z

Isal(Aa x + Bay +

Dat)l ~°= a,

a=l

A 2 = B 2 = D 2 = 1,

(38)

A.B=B.D=A.D=0.

We define x ( O ) = r ( 0 ) c o s 0 c o s +, y ( O ) = r ( 0 ) s i n 0 cos q~,

(39)

t = sin +, and solve numerically for r(O). The asymptotic bounds of the allowed shapes as Ya ~ oc are Aax + Bay + Dat = +_sa.

(40)

When A a and B a are << 1 for a given index a, the bounds are far outside the space of real solutions and have little effect; sets of A a and B a that are relatively near unity dominate. These asymptotic bounding lines can be used in a user interface to constrain the shape in a predictable way; in a hierarchical modeling process, adding additional asymptotes (i.e., increasing N ) is analogous to "patting a lump of clay" to mold it with successively greater precision into the desired shape. Whether or not this "feel" can be achieved in practice depends on the intelligence built into a particular user interface. We can visualize t as a "time" parameter determining how far along the direction D to take our planar slice. For N = 3, the equations reduce exactly to a slice through a conventional three-dimensional superquadric made by a plane at distance from the origin parameterized by t. In Figs. 7 through 10, we show some typical shapes, including a triangle deformed to its dual by varying 7, a triangle deformed to its dual for 7a = 1 by varying t, a

FIG. 7.

A triangle deforming to its dual triangle by varying 7-

HYPERQUADRICS

FIG. 8.

203

A triangle deforming to its dual triangle for ), = 1 by varying t.

FIG. 9. A hexagon derived from an octahedron deforming through a circle to the corresponding hexagon derived from a cube by varying ~,.

FIG. 10.

An assortment of 2-dimensional figures, including taperings and distortions.

204

ANDREW J. HANSON

hexagon deformed through a circle to another hexagon, and some random complex polygons, including tapering of squares. Three dimensions. In three dimensions, we analogously write the equations as N

E

S a l ( Aa X "3I- Bay + Caz + Dat ) Ir° = 1,

a=1 A2 = B 2 = C 2 = D 2 = 1,

(41)

A'B=A'C=A'D=0

B'C=B'D=C'D=0, define x = r(8, ~)cos 8 cos ~ cos qJ y = r(O, ff)sinScos ~ cos

(42)

z = r(O, ~)sin q~cos t = sin~, and solve for r(6, ~). The full equations describe a shape in a space one dimension higher than the space we are working in; t then parameterizes a flat three-dimensional slice through a four-dimensional shape, and in three-space (x, y, z) describe the desired two-dimensional surface as functions of 0 and ~. The bounding polyhedron of Eq. (41) is given by equations of pairs of parallel planes perpendicular to the direction (A,, Ba, Ca), Aax + Bay + Caz "}- Dat = i s a.

(43)

Once again, these planes are the asymptotic boundaries of the possible shapes generated as 3% --+ ~ . The asymptotic planes can be used to guide a hierarchical modeling process, because each additional increment of N adds another asymptote given by Eq. (43). In Figs. 11 through 14, we present a number of three-dimensional shapes, including many that cannot be achieved by the usual superquadric methods. These

FIG. 11. A tetrahedrondeformingthrougha sphere to a truncated tetrahedronby varying7.

HYPERQUADRICS

205

FIG. 12. A tetrahedron deforming through a truncated cube to its dual tetrahedron for 7 ~ 1 by varying the value of the slice t through the 4-dimensional fundamental shape.

FIG. 13.

A truncated dodecahedron deforming through a sphere to a dodecahedron by varying 3'.

FIG. 14. An assortment of 3-dimensional hyperquadric figures that could not have been generated using standard superquadrics.

206

A N D R E W J. HANSON

FIG. 15. An N = 5 hyperquadric shape with parameters chosen to resemble a human head. From left to right, we show a full front view, a slight turn, and a right profile view. This shape illustrates some of the clay-like modeling flexibility of the hyperquadric approach.

figures show a tetrahedron being deformed through a sphere to a truncated tetrahedron by varying 3', the same tetrahedron as it deforms through a truncated cube to its dual when the t-slice is varied, a truncated dodecahedron deforming through a sphere to a regular dodecahedron, and some miscellaneous shapes. Finally, in Fig. 15, we sculpt an approximation to a human head by adjusting the various powers and parameters of the hyperquadric model with N = 5. Three sets of parameters are needed just to define the basic bounding rectangular solid; one additional set controls the "jaw," and another the back of the "neck." This figure illustrates the remarkable ability of hyperquadric shapes to model irregular natural objects with an economical and elegant parameterization. 6. COMPOSITE HYPERQUADRICS

Given the hyperquadric equations for smoothly deformable shapes with convex polyhedral bounds, we are now faced with the problem of combining the properties of several such equations in a set-theoretic manner to construct nonconvex shapes from arbitrary unions, complements, and intersections of the convex shapes. We could achieve this in an ordinary constructive solid geometry framework [7] by using elliptic and hyperbolic hyperquadric equations separately, tesselating the surfaces, and computing the intersections of positive and negative volumes. Unfortunately, this procedure produces artifacts at the intersections of pairs of components that cannot be easily removed without retesselating and recomputing the intersections in an ad hoc manner. Furthermore, the computation of normals for computer rendering purposes is ill-defined at intersection nodes, even though most objects that might be modeled in this way actually have smoothed junctions among the parts. Instead, we adopt an alternative approach closely related to Blinn's "blobby" model methods [5a]. By combining expotentials of the equations of component shapes, we can achieve well-defined normals, computable local curvature, and controllable smoothing at part junctions. We begin by observing that sums of exponentials of individual quasi-algebraic equations produce what is in effect a "hilly landscape" in an arbitrarily high dimension with hill tops or sink holes centered around each component equation. By carefully choosing the coefficients of the terms determining the "hill elevations" and passing an appropriate hyperplane (or other hypersuffaee) through the terrain, we find we can construct arbitrary composites of the elementary shapes. The

HYPERQUADRICS

F1G. 16.

207

A simple shape constructed as a planar cross-section of single "hill."

equation for composite hyperquadrics is thus K ~_, c k

exp( -

H k

(x) = w,

(44)

k=l

where x is a D-dimensional vector, Hk(X) is an arbitrary hyperquadric of the form of Eq. (13), and w is the "height" of the D-dimensional surface. Adapting the formulas (23)-(26) for the normals and the local curvature is straightforward; the curvature can be used to discover when a surface region is so strongly curved that it should be retesselated at a finer level of detail. In the limit with all exponents equal to two, Eq. (44) reduces to a sum of Gaussians. The coefficients c k may be either positive or negative, corresponding to whether a particular elementary shape Hk(X) contributes as a union or as a complement in the overall configuration. The variable w is in some sense a non-Riemannian distance function giving the distance of any point in space from the origin. The value of w and the relative scales in each term are adjusted so that the solutions of Eq. (44) produce the desired shape. Solutions of the composite equations can be attempted by using the approximate solution for each individual hyperquadric component, evolving in the normal direction to locate the true surface solution and merging surface patches. A more systematic, but time-consuming, technique is to compute sets of successively more precise lattice points in the volume enclosed by the solution; given such a lattice, one may use volume-based surface reconstruction approaches such as those of [2, 8]. The basic concept of our method is illustrated in Fig. 16 in two dimensions with the value of w being the third dimension: passing the w = const plane through the exponential hill, we find an ordinary hyperquadric shape. In Fig. 17, we show the result of adding two exponentials to produce the smoothed union of two hyperquadrics, and in Fig. 18, we subtract one term from another to produce a nonconvex two-dimensional shape.

FIG. 17.

l

Unions of shapes are constructed by taking cross-sections of sums of the component shapes.

208

FIG. 18.

ANDREW J. HANSON

Indentations are constructed by subtracting one term from another to make a "valley."

The three-dimensional case is exactly analogous, only much more difficult to visualize; we must consider the exponential terms in the equations in four dimensions before passing the w = const hyperplane through the hypersurface. Holes of any desired form can be inserted using negative terms; to make holes that taper smoothly as they exit a surrounding figure, a negative hyperboloid should be used. In Fig. 19 we show a dumbbell-like object with two orthogonal holes produced by hyperbolic hyperquadrics with negative coefficients in the overall equation; surface reconstruction and rendering was carried out using Baker's method [2]. More complex structures such as linked chains can also be constructed straightforwardly. We note that there is no intrinsic reason to restrict ourselves to constant planes; an arbitrary hypersurface with planar topology could be used instead if a convenient parameterization were available. 7. CONCLUSIONS A~,ID FUTURE WORK

The hyperquadric equation, Eq. (13), is the most economical possible method for describing quasi-algebraic surfaces of any dimension that have convex polyhedral bounds and deform smoothly to spheres; an equation with fewer parameters would

FIG. 19. A 3-dimensional object with two orthogonal holes. This figure results from taking a 3-dimensional slice through a 4-dimensional landscape that includes one elliptical shape and two negative hyperboloidal shapes.

HYPERQUADRICS

209

lack the number of degrees of freedom to describe each bounding hyperplane. Using the approach of Section 6, we may construct single equations describing surfaces that are arbitrary unions of hyperquadrics and their complements, thus allowing the solution of any constructive solid geometry problem. Among the applications currently under exploration are: • Interactive modeling. The basic mathematical construction procedures for designing a hyperquadric shape are described in Section 5. To fully realize the potential of the approach for interactive scene modeling, interactive tools are needed to manipulate the mathematical parameters using a higher level vocabulary. We are currently designing such tools to help emphasize the "clay-like" nature of the modeling primitives. In particular, sophisticated approaches are needed to constrain the complex interactions among elementary shapes in the process of designing composite shapes using the techniques of Section 6. • Recovering shape from images. The hyperquadric primitives can be used in model-based image interpretation problems to recover shape from shading and shape from range data. Substantial progress has already been made in this area using the limited vocabulary of superquadrics [9, 10, 12]. Hyperquadrics provide a new, intrinsically hierarchical extension to the superquadric approach; we are examining procedures that begin with a rough fit of a shape to a small number of terms in the hyperquadric form Eq. (13) and then add terms until no further improvement in the object description is apparent. This algorithm is the measurement-oriented counterpart of the creative procedure followed by a sculptor, who may begin the design of a sculpture by cutting successive planes from a rectangular block of clay to produce a polyhedron containing the desired shape.

The hyperquadric method provides a unified approach to generic shape description for modeling and understanding spatial phenomena. For computer graphics applications, hyperquadrics supply flexible models of complex objects that have easily computed graphics properties and produce good qualitative perceptual impressions. For image analysis, the approach supplies a new and potentially powerful technique for the hierarchical extraction of shape information from image and range data. And, finally, the "clay-like" features of both the elementary hyperquadric shape deformations and our construction technique for composite objects provide flexible tools for quantifying the psychological perception, representation, and manipulation of shape primitives. ACKNOWLEDGMENTS

The author thanks Alex Pentland for introducing him to superquadrics, and Harlyn Baker for assistance with surface visualization techinques. REFERENCES 1. J. Allard, Note on squares and cubes, Math. Mag. 37, 1964, 210-214. (For an overview of Piet Hein's role in popularizing the superellipse, see M. Gardener's Mathematical Games column, "The Superellipse," Sci. Amer. 213, 1965, 222-234. 2. H. H. Baker, Building, visualizing, and computing on surfaces of evolution, IEEE Comput. Graphics Appl. 8, 1988, 31-41; see also The weaving wall in tracking, mapping, and surface reconsrtuction, Int. J. Comput. Vision, in press. 3. A. H. Barr, Superquadrics and angle-preserving transformations, IEEE Comput. Graphics Appl. 1, 1981, 11-23. 4. A. H. Barr, Global and local deformations of solid primitives, Comput. Graphics 18, 1984, 21-30.

210

ANDREW J. HANSON

5. I. Biederman, Human image understanding: Recent research and a theory, Comput. Vision Graphics Image Process. 32, 1985, 29-73. 5a.J.F. Blinn, A generalization of algebraic surface drawing, ACM Trans. Graphics I, 1982, 235-256. 6. L. P. Eisenhart, A Treatise on the Differential Geometry of Curves and Surfaces, Dover, New York, 1960 (1909). 7. D. H. Laidlaw, W. B. Trumbore, and J. F. Hughes, Constructive solid geometry for polyhedral objects, in 1986 SIGGRAPH Proceedings, pp. 161-170. 8. W. E. Lorensen and H. E. Cline, Marching cubes: A high resolution 3D surface construction algorithm, in 1987 SIGGRAPH Proceedings, pp. 163-169. 9. A. P. Pentland, Perceptual organization and the representation of natural form, Artif. Intell. 28, 1986, 293-331. 10. A. P. Pentland, Recognition by Parts, SRI Technical Note 406, Menlo Park, CA, 1986. 11. W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, Numerical Recipes, Cambridge University Press, London, 1986. 12. F. Solina and R. Bajcsy, Range image interpretation of mail pieces with superquadrics, in Proceedings, AAAI-87, pp. 733-737. 13. D. M. Y. Sommerville, An Introduction to the Geometry of N Dimensions, Dover, New York, 1958 (1929).