exact computation of the medial axis of a polyhedrongeom/papers/documents/articles/...tion, and...

43
Exact Computation of the Medial Axis of a Polyhedron Tim Culver John Keyser Dinesh Manocha think3 Texas A&M University University of North Carolina Sudbury, MA College Station, TX Chapel Hill, NC Abstract We present an accurate algorithm to compute the internal Voronoi diagram and medial axis of a 3-D polyhedron. It uses exact arithmetic and exact representations for accurate compu- tation of the medial axis. The algorithm works by recursively finding neighboring junctions along the seam curves. To speed up the computation, we have designed specialized algo- rithms for fast computation with algebraic curves and surfaces. These algorithms include lazy evaluation based on multivariate Sturm sequences, fast resultant computation, culling operations, and floating-point filters. The algorithm has been implemented and we highlight its performance on a number of examples. Key words: Medial axis; Voronoi diagram; Robustness; Exact arithmetic 1 Introduction The medial axis of a solid object is its skeletal surface. The skeleton reduces the dimension of a solid while preserving its basic shape. The medial axis also captures proximity information about opposing points on the solid’s boundary. The medial axis was first proposed by Blum [3] for biological shape measurement. It has also been used in a number of other applications, including path planning, finite element mesh generation, automated injection molding simulation and feature recognition. Researchers have proposed the medial axis transform as an alternate representation to B-rep and CSG in a design and interrogation system [21,40]. Supported in part by ARO Contract DAAH04-96-1-0257, NSF award 9876914, ONR Young Investigator Award (N00014-97-1-0631), Intel and DOEASCI grant. Preprint submitted to Elsevier Preprint 29 June 2003

Upload: others

Post on 28-Feb-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Exact Computation of the Medial Axis of aPolyhedron �

Tim Culver John Keyser Dinesh Manocha

think3 Texas A&M University University of North CarolinaSudbury, MA College Station, TX Chapel Hill, NC

Abstract

We present an accurate algorithm to compute the internal Voronoi diagram and medial axisof a 3-D polyhedron. It uses exact arithmetic and exact representations for accurate compu-tation of the medial axis. The algorithm works by recursively finding neighboring junctionsalong the seam curves. To speed up the computation, we have designed specialized algo-rithms for fast computation with algebraic curves and surfaces. These algorithms includelazy evaluation based on multivariate Sturm sequences, fast resultant computation, cullingoperations, and floating-point filters. The algorithm has been implemented and we highlightits performance on a number of examples.

Key words: Medial axis; Voronoi diagram; Robustness; Exact arithmetic

1 Introduction

The medial axis of a solid object is its skeletal surface. The skeleton reduces thedimension of a solid while preserving its basic shape. The medial axis also capturesproximity information about opposing points on the solid’s boundary.

The medial axis was first proposed by Blum [3] for biological shape measurement.It has also been used in a number of other applications, including path planning,finite element mesh generation, automated injection molding simulation and featurerecognition. Researchers have proposed the medial axis transform as an alternaterepresentation to B-rep and CSG in a design and interrogation system [21,40].

� Supported in part by ARO Contract DAAH04-96-1-0257, NSF award 9876914, ONRYoung Investigator Award (N00014-97-1-0631), Intel and DOE ASCI grant.

Preprint submitted to Elsevier Preprint 29 June 2003

Page 2: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

The medial axis of a solid is the closure of the locus of all points within the solidthat have two or more closest points on the boundary of the solid. � In general,the medial axis of a three-dimensional solid is a non-manifold surface. When thesolid is a polyhedron, the medial surface is piecewise algebraic of degree two. Thealgebraic surfaces are quadrics, and each quadric surface is the bisector of twoboundary features (vertex, edge, or face). The medial axis of a polyhedron is asubset of the Voronoi diagram of a polyhedron, that is, the generalized Voronoidiagram of the vertices, edges, and faces. Given the internal portion of the Voronoidiagram of a polyhedron, a few easily-identified surfaces are removed to form themedial axis.

Our terminology for the parts of the polyhedral medial axis follows Sheehy et al.[37]. The quadric surfaces are called sheets. The sheets are stitched together alongseam curves. The seams meet at junction points. The total number of sheets, seams,and junctions is, in the worst case, �����, where � is the total number of faces,edges, and vertices in the polyhedron. The best known upper bound is ������� forany positive �.

Many polyhedral medial axis algorithms use either a spatial subdivision or someform of discrete representation of the surface. Sheehy et al. [37] assert that be-cause of the inherent complexity of a continuous approach, one must use someform of discretization. However, it is hard to accurately and efficiently computethe medial axis based on a discrete representation. In the last few years, a numberof authors have proposed computing the medial axis based on a tracing approach[6,29,38]. Starting with a known junction (for instance, a vertex of the polyhedron),they trace along its incident seams and discover the adjacent junction points. Theseauthors solve systems of polynomial equations using floating-point arithmetic andrepresent seam curves with a piecewise-linear approximation. The accuracy of themedial axis varies with the step size and the tolerances used for computing the junc-tion points. Since the medial topology is sensitive to perturbations, it is difficult todesign an accurate algorithm using limited-precision arithmetic.

Accurate and robust computation using finite precision arithmetic is a major openproblem in solid modeling. One solution to the precision problem is to use exactarithmetic. Algorithms based on exact arithmetic have been proposed in domainsfor which rational arithmetic suffices, for example, Boolean combinations of poly-hedral solids [14]. However, the polyhedral medial axis requires algebraic curvesand surfaces. An exact solution requires more than rational arithmetic: one mustmanipulate roots of polynomials. Floating-point methods are attractive for effi-ciency reasons, but it is difficult to compute tight bounds on numerical error, mak-ing tolerance-based algorithms unreliable.

In this paper, we present an accurate algorithm to compute the medial axis of a

� Some authors include points outside the solid as well; this alternative construction is alsoknown as the symmetry set.

2

Page 3: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

3-D polyhedron with rational vertex coordinates. We expand upon the algorithmpresented at the ACM Symposium on Solid Modeling and Applications [8]. Thepresent article gives further algorithmic detail, describes a complete implementa-tion, and demonstrates the effectiveness of the system. The full algorithm is givenin Culver [7].

Our two main results are an accurate, reliable algorithm for computing the continu-ous medial axis of a polyhedron, and major efficiency enhancements that bring therunning time down to a point where it is now practical to compute the continuousmedial axis of a polyhedron with hundreds of faces. In the course of designing andimplementing the algorithm, we have obtained new results for several subproblems:

� Three exact seam searching algorithms. The fundamental step in our medial axisalgorithm is based on ordering points along an algebraic seam curve. We presentthree different algorithms for this operation, corresponding to three represen-tations for the seam curve.

� Efficient intersection of three algebraic surfaces. A medial axis junction pointlies at the intersection of three quadric surfaces. We describe an efficient algo-rithm for isolating and refining solutions to a system of three low-degree poly-nomial equations in three variables, based on multivariate Sturm sequences andthe Macaulay resultant.

� Parametric forms for bisector surfaces of points, lines, planes. The medial axisconsists of quadric surfaces, which necessarily admit rational parametrizations.We present practical methods for computing parametrizations of all of the surfacetypes that occur in the medial axis.

� Improvements to the overall running time. No asymptotically efficient algorithmfor this problem is known. We present two high-level strategies for improvingthe running time on a class of inputs that is common in practice.

Organization. The rest of the paper is organized as follows. Section 2 surveys theprevious work in medial axis computation and exact geometric computation. Sec-tion 3 gives an overview of our algorithm and describes the exact representationsof the elements of the medial axis. Sections 4 through 7 develop the medial axisalgorithm. Section 8 summarizes the various methods we use to improve the per-formance of our algorithm at all levels. Section 9 discusses degeneracies in themedial axis and how we handle them. Sections 10 and 11 describe our implementa-tion, demonstrate its performance on a few polyhedra, and analyze the effectivenessof the efficiency techniques. We conclude in section 12. In an appendix we providecase-by-case methods for parametrizing bisector surfaces.

3

Page 4: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

2 Previous work

There is considerable work on medial axis computation in solid modeling and com-putational geometry. The various approaches can be classified into two main cat-egories: discrete methods based on sampling, and continuous methods that do notrely on the sufficiency of some sampling. In this section, we mention several no-table methods in each category.

Sampling points on the surface. Many authors have computed the medial axis usingthe Voronoi diagram of a set of points located on the polyhedron’s surface. Usuallythe result is an approximation to the medial axis. Sheehy et al. [37] adaptively refinethe sampling until all adjacency relationships are revealed. From this, the exactmedial axis may be constructed. However, the overall complexity of this approachis not well understood.

Spatial sampling. Another popular approach is to subdivide space, and compute anapproximation to the medial axis at the resolution of the cells. The approximationcan be considered an image of the medial axis, and does not contain a complete de-scription of the adjacency relationships. Among implementations of this approach,those of Vleugels and Overmars [41] and Etzion and Rappaport [13] are notablein that subdivision continues until the adjacency relationships are revealed. In thiscontext, it is difficult to resolve degenerate and near-degenerate configurations, butthe approximation is sufficient for some applications.

2-D continuous algorithms. The classic divide-and-conquer algorithm for the two-dimensional medial axis problem was proposed by Lee [26]. Fortune has presenteda sweepline algorithm [15]. There are no algorithms that extend these approachesto 3-D in the literature. Held describes wavefront-propagation algorithms for 2-Dpolygons [20] and for convex 3-D polyhedra [19].

3-D tracing algorithms. Most practical algorithms for computing the continuous 3-D medial axis are based on the tracing approach. Starting from a junction point, aseam emanating from the junction is followed. The seam terminates at another junc-tion. Once this point is found, the algorithm recursively forks and follows all seamsemanating from that junction. The key step is the search for the seam terminator.In the two-dimensional medial axis problem, the search is limited to smaller andsmaller subchains of the polygon. No such property holds for the three-dimensionalproblem; each terminating junction is found at the expense of a search of (in theworst case) the entire polyhedron. Thus the complexity is proportional to both theinput size � of the polyhedron and the output size � of the medial axis. The algo-rithm’s worst-case behavior is necessarily at least a factor of � larger than optimal���� time. A tight upper bound on �, the size of the medial axis, is currently notknown. Examining the worst case, it is known that � � ������� for any � � �,as shown by Agarwal et al. [2]. We know of no example where � exceeds �����.

4

Page 5: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

But regardless of the value of �, the complexity of the tracing algorithm is at leasta factor of � worse than the optimal ���� time.

Milenkovic [29] proposed the 3-D tracing algorithm and discussed its complexity.Chiang [6] presented an algorithm for computing the medial axis of a planar regionbounded by piecewise �� curves. The algorithm involves tracing branches usingsystems of polynomial equations. Sherbrooke, Patrikalakis and Brisson [38] havepresented a variation on the algorithm. Their method explicitly traces along theseam, creating a piecewise-linear approximation to the curve. The authors haveapplied their algorithm to generate the medial axis of a number of polyhedra. Reddyand Turkiyyah [33] have presented another version of the tracing algorithm andcompared it to an algorithm based on the Voronoi diagram of a set of points on theboundary.

Exact geometric computation. Exact arithmetic has proven useful in the linear do-main. Exact arithmetic implies that numbers are computed to full precision. Byallowing arbitrary bit lengths, any rational number can be computed and storedexactly. For linear objects, rational numbers are usually all that is required to per-form a geometric operation. In the solid modeling community, exact arithmetic hasbeen used successfully for applications involving linear objects (see, for example,Fortune [14]). Recently-developed libraries like LEDA and CGAL also providesupport for exact arithmetic and other forms of exact computation.

In the non-linear domain, exact arithmetic becomes more difficult to apply effec-tively. Bit length tends to grow more quickly in computations of higher algebraicdegree. Also, computations on non-linear objects often require algebraic numbers,which cannot be explicitly represented by a finite number of bits. Techniques usingbit-length estimates may require bit lengths which grow, in the worst case, expo-nentially with algebraic degree [5]. One approach to this problem is to use fieldextensions to allow representations of each new number as it is computed. Manycomputer algebra systems and symbolic libraries provide support for field exten-sions. However, computing with such numbers can be quite expensive. Another ap-proach is to represent an algebraic number as the unique root of a polynomial (withrational coefficients) within a rational interval. Since the interval containing theroot can be tightened on demand, one obtains exact answers to queries such as thesign of the number. In one dimension, this can be accomplished through the use ofSturm sequences. In higher dimensions, multivariate Sturm sequences (Milne [30],Pedersen [32]) represent algebraic points as isolated roots of systems of equations.Keyser et al. have applied these methods to curve intersection problems in 2-D [24]and to the problem of CSG boundary evaluation [23].

5

Page 6: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

3 Algorithm overview

Our approach builds on the tracing algorithms proposed by Milenkovic [29], Sheehyet al. [38], and Reddy and Turkiyyah [33]. However, instead of computing a piece-wise linear approximation, we exactly compute all the components of the medialaxis. Essentially, we construct the adjacency graph of the medial axis while travers-ing it.

Our terminology is similar to that of Sheehy et al.The input polyhedron consistsof faces, edges, and vertices. The coordinates of the vertices are assumed to berational numbers. The faces, edges, and vertices are collectively called boundaryelements. The medial axis consists of sheets, seams, and junctions. The sheets aretrimmed quadric surfaces. The seams are algebraic curves with rational coefficients,and the junctions are points whose coordinates are algebraic numbers of degree atmost 8. A sheet is said to be governed by two boundary elements, meaning that thesheet is equidistant from those two elements. A seam is governed by three or moreelements, and a junction by four or more. The squared distance function associatedwith a point, line, or plane is the square of the Euclidean distance from that objectto an arbitrary point in space. If the point, line, or plane is denoted �, we write thesquared distance function of � as ��

��� ��. The squared distance function is an

algebraic expression in � and � of degree two.

The medial axis is a subset of the generalized Voronoi diagram of the faces, edges,and vertices. Our algorithm computes the portion of the generalized Voronoi di-agram that lies within the polyhedron. As a post-process, it then removes certainsheets, leaving the medial axis. The sheets removed are the bisectors of a face withits edge, or of an edge with its vertex.

3.1 Tracing algorithm

The algorithm starts by finding a single seam. For example, if the polyhedron has aconvex, trivalent vertex (having exactly three incident edges), then its three incidentfaces generate a seam. If no vertex of the polyhedron is trivalent, a more sophisti-cated technique is used to begin the algorithm with an initial seam. This techniqueis discussed in section 7.

Each remaining boundary element � in the polyhedron is then considered as a po-tential quadruple ��� �� �� �� generating a junction point on the seam. One seeksthe element �� whose candidate junction �� comes first along the seam, measuredby arc length. The ingredients of the search are

� the seam governors �� �� ��;� the starting point ��, a junction point governed by, say, ��� �� �� ���;

6

Page 7: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

� the search direction �, one of the two tangent directions at ��.

The determination of �� and �� is based not on taking tiny steps along the seam,but on an accurate topological analysis of the curve.

The newly-found junction point may be a vertex of the polyhedron. In this case, thebranch of computation finishes, and an unsearched seam is taken from a to-do list.Otherwise, the junction point is equidistant from (ignoring degeneracies for now)four boundary elements ��� �� �� ���. Assuming the junction point has not alreadybeen visited, three new seams are inserted in the to-do list: those corresponding to��� �� ��� ��� �� ��� and ��� �� ���. When the to-do list is empty, the algorithmterminates.

The medial axis transform of an object consists of its medial axis together with aradius function, which assigns to each point on the axis the radius of the maximalball at that point. The radius function is constructed by composing the parametricform of a sheet, quadratic in � and , with the distance function to either of itsgovernors, a quadratic in � and �. The radius function is in general the squareroot of a degree-four expression in � and .

3.2 Exact arithmetic

We assume that the boundary of the polyhedron can be represented using rationalnumbers. However, the medial axis generally has no exact, explicit representationin rational numbers. There is a fundamental limitation to the use of exact rationalarithmetic in Euclidean geometry: constructions on rational numbers often result inalgebraic numbers. For an example in the plane, consider the set of points equidis-tant from the line � � and the line � � (figure 1). The bisector of these twolines is the union of the lines � ��� �

���� and � ��� � �

���. The twobisector lines cannot be described individually using only rational numbers. Eachline’s equation has algebraic numbers of degree 2. Describing the line by two pointson the line does not avoid the difficulty, since there is only one point on either linewith rational � and coordinates (the origin).

� �

Fig. 1. (a) The lines � � � and � � �. (b) Their bisector is the pair of lines represented by��

� � ��� � �� � �, an equation that does not factor over the rationals.

7

Page 8: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Exact arithmetic with these numbers is possible by computing in an extended field.In the example above, this technique amounts to representing all numbers as � ���

�, where � and � are rational. However, computing in an extended field is signif-icantly more expensive than computing over the rationals, especially when the fieldextension grows over the computation.

3.3 Exact geometric representations

This section describes our exact representations for the sheets, seams, and junctionsof the medial axis. The parts are illustrated in figure 2.

A sheet is the bisector of two boundary elements. Sheets are quadric surfaces,amenable to two different representations: an implicit form

� �� �� � �

where � is a polynomial of total degree 2, and a rational parametric form

���� �

� �� �� �� �

� �� ���� �

� �� �

where � � �, and � each are polynomials of total degree 2. It is well-known thatboth representations have specific advantages in computer-aided geometric design(Sederberg [34], Sederberg and Chen [35]). Our medial axis algorithm always usesthe implicit form, and also uses the parametric form whenever its coefficients arerational. Section 5 discusses sheet morphology and the computation of the implicitand parametric forms.

A seam curve lies on three different sheets. It is represented as the intersectionof any two of these sheets. An explicit rational parameterization of these curvesis, in general, impossible, so the curves are kept in implicit form. The implicitform ��� � � � is obtained by substituting the parametric form of one surface(when its coefficients are rational) into the implicit form of the other. Computations

Seam

Sheet

Vertex-junction

Junction (internal)

Fig. 2. The geometric elements of the medial axis

8

Page 9: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

involving the curve are usually formulated in the �� � plane. Section 6 describesthe representation of seams and algorithms for searching them.

A junction is an algebraic point, represented jointly by

� a system of three algebraic equations in three variables with rational coefficients;� a three-dimensional box with rational coordinates containing exactly one root of

the system.

An implementation of 3-D Sturm sequences in exact arithmetic can find a boxwith a single root, and refine its size arbitrarily. Our technique is based on the vol-ume function of Milne [30]. Reasoning about the point typically involves reasoningabout the box, and shrinking the box until a query can be answered unambiguously.Junction computation is discussed in section 7.

4 Domain polytopes

The Voronoi region of a boundary element is the set of points closer to that bound-ary element than to any other. We define the domain polytope of a boundary elementto be the closure of the set of points closer to that boundary element than to anyof its adjacent vertices, edges, and faces in the polyhedron. By this definition, thedomain polytope clearly contains the Voronoi region. The domain polytope of anytype of boundary element is defined by the intersection of a finite collection of

crowns

skirts

Fig. 3. The domain polytopes corresponding to a face (top row), an edge (middle row), anda vertex (bottom row).

9

Page 10: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

linear half-spaces. It is a convex region that is in most cases unbounded. The threetypes of domain polytope are illustrated in figure 3.

� The face polytope is formed by taking the inward half-space defined by the faceitself, and a half-space orthogonal to each edge. It is the unbounded space sweptout by the face as it moves orthogonally toward the interior of the polyhedron.

� The edge polytope is formed by four half-spaces. Two are crowns, planes orthog-onal to the edge at the vertices, and two are skirts, planes containing the edgeand orthogonal to the adjacent faces. The edge polytope is tent-shaped, with aninterior angle less than �.

� The vertex polytope is formed by a crown from each incident edge. The shape ofthe vertex polytope is pyramidal.

The domain polytope is a construction with many uses throughout the medial axisalgorithm. The word “domain” connotes the fact that its interior is exactly the re-gion in �� ��-space where the boundary element’s distance function is valid. Thisproperty is used to limit the �� � parametric domain for some bisector surfaces (seesections A.3 and A.4). Another useful property is that the domain polytope containsthe Voronoi region. This is useful for culling away potential seam terminators dur-ing the search step (see section 8.2). A third important property is that the domainpolytope of the element � has positive volume if and only if �’s internal Voronoiregion has positive volume. A boundary element is called active if its polytopehas positive volume. Only active elements can govern portions of the medial axis,and inactive elements can be ignored. We classify the active and inactive elementsbefore computing the medial axis.

In summary, domain polytopes are useful in that they are simple, linear, and locallydefined. We compute polytopes with a randomized incremental algorithm describedby Mulmuley [31]. The algorithm runs in ��� ��� expected time, where � is thenumber of plane equations. In many situations, � may safely be assumed to bea small constant. Numerically, our implementation uses exact arithmetic with afloating-point filter. The fundamental geometric operation in the incremental algo-rithm is the orientation test for four planes. This predicate describes the position ofthe intersection point of three planes relative to a fourth plane. The algorithm needsonly the sign of the predicate. The predicate can be expressed as the sign of theratio of a �� � determinant and a � determinant, the matrix entries being takenfrom the planes’ equations and the point’s coordinates. Our floating-point filter isthe determinant sign method described in Culver [7].

5 Bisectors

The implicit and parametric forms of a bisector surface are computed from its twogovernors. This section describes the construction of both forms.

10

Page 11: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

5.1 Bisector morphology

In table 1, we show all of the bisectors that arise in the medial axis of a polyhedron.Note that some of the non-generic configurations arise in perfectly generic polyhe-dra. For instance, the bisector of a plane and a line in the plane occurs between theVoronoi region of a face and that of an adjacent edge. The last column indicateswhether the coefficients of the parametric form of the surface are rational numbers(the implicit form always has rational coefficients).

5.2 Implicit form

The implicit form of the bisector is the equation

� �� �� � �

where � is a polynomial of total degree 2. The polynomial � is the difference oftwo squared distance functions.

The morphology of the bisector surface can be determined entirely from the im-plicit form; see, for example, Spain [39]. However, it is also possible to deduce themorphology from the configuration of the governors. This is more efficient thanan analysis of � , and often reveals other useful information. For instance, classi-fying a point-plane bisector requires testing whether the point lies on the plane.This determines whether the bisector is a paraboloid or a degenerate line. But if thepoint lies behind the plane (that is, outside the polyhedron from the face’s point ofview), then the bisector surface does not participate in the medial axis, and it canbe skipped.

5.3 Parametric form

Every quadric surface has a rational parametrization (see an algebraic geometrytext such as Shafarevich [36], pp. 6–7 and 38). That is, every bisector surface in themedial axis of a polyhedron can be represented as

���� �

� �� �� �� �

� �� ���� �

� �� �

where � � �, and � are polynomials of total degree at most 2. The polynomials� � �, and � are required by our medial axis algorithm and also by the usualsurface representations in solid modeling systems.

Instead of using a general surface parametrization method such as stereographic

11

Page 12: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Governors Configuration Bisector Coeffs in �?

Point-point Generic Plane Yes

Point-line Generic Parabolic cylinder (� � ��) Yes

Incident Plane Yes

Point-plane Generic Circular paraboloid (� � �� � �

�) Yes

Incident Line Yes

Line-line Generic Hyperbolic paraboloid (� � ��� �

�) Yes

Incident Orthogonal plane pair (�� � �� � �) No

Parallel Plane Yes

Line-plane Generic Elliptical cone (�� � �� � �

�) No

Parallel Parabolic cylinder Yes

Line lies on plane Plane Yes

Plane-plane Generic Orthogonal plane pair No

Parallel Plane Yes

Perpendicular Orthogonal plane pair YesTable 1The bisectors that arise in the medial axis.

projection, we use specialized methods for the various bisector morphologies. Ouremphasis is on practical parametrizations, amenable to representation as trimmedrational Bezier patches. Stereographic projection solves the problem in mathemat-ical generality. However, it does not in itself ensure that the relevant part of thesurface is covered by any finite �� � domain. By “relevant” we mean the portionof the surface that lies within the domain polytopes of both governors. This is theportion that could participate in the medial axis, and for practical reasons, it oughtto be free of parametric oddities, such as approaching � as one approaches a fi-nite boundary of the surface. Such oddities are common when one attempts to solvethe problem with stereographic projection.

The parametrizations are specialized on a case-by-case basis. The details are te-dious but unobvious, so we have included them in appendix A. The main result isthe formulation of parametric representations for all of the bisector surfaces thatoccur in the polyhedral medial axis. These methods are useful beyond their ap-plication in our medial axis algorithm, for example in computing or displaying acontinuous representation of a medial axis found by any algorithm.

12

Page 13: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

6 Seams and tracing

The fundamental step in the medial axis algorithm is seam tracing. Given a seamcurve and one of its junctions as a starting point, the goal is to identify and com-pute the terminator—the junction at the other end of the seam. The terminator’sgovernors are the seam’s governors, together with another governor to be identi-fied. Tracing begins by forming a list of candidate governors. In the simplest case,all � active boundary elements are candidates. Associated with each candidate areas many as eight points, the solutions to three quadratic equations. So the tracing al-gorithm may consider up to �� candidate terminators. The terminator is the first ofthese points encountered when moving along the seam curve away from the knownendpoint.

Seam tracing is essentially the problem of ordering points along an algebraic curve.We propose three algorithms for seam tracing. Each algorithm uses a different rep-resentation of the seam curve. The algorithm is chosen based on the availabilityof parametric bisectors, which is determined by the type and configuration of theseam governors.

In this section, we enumerate all possible morphologies for bisector surfaces andseam curves for all configurations of governors. Each is suited to a different con-figuration, and they may be thought of roughly as evaluation of curves in one-dimensional, in two-dimensional, and in three-dimensional space. The ten combi-nations of boundary elements are listed in figure 4, with the most general seamcurve type for each combination. The analysis method (third column) correspondsto a choice of three algorithms, described in sections 6.1–6.3 below.

6.1 Rational parametric curves

In a few configurations, the seam is a rational space curve. The parametric formfor the curve is straightforward to derive, using techniques similar to those in sec-tion 5.3. When this form exists, and its coefficients are rational, we perform a one-dimensional search along the curve parameter for the terminator. Each candidateterminator is represented as the root of a degree-four polynomial in a rational in-terval. Sorting points along a rational parametric curve is a matter of choosing thecandidate interval that is closest, on one side, to the starting junction. The intervalsare reduced as necessary until the minimum interval is distinct from the others.

13

Page 14: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Governors Generic seam Analysis method

Point-point-point Line 6.1

Point-point-line Parabola 6.1

Point-point-plane Conic 6.1

Point-line-line Quartic 6.2

Point-line-plane Quartic 6.2

Point-plane-plane Conic 6.2

Line-line-line Quartic 6.2

Line-line-plane Quartic 6.2

Line-plane-plane Conic 6.3

Plane-plane-plane Line 6.3

Fig. 4. Some curves that arise as seams in the medial axis.

6.2 Non-rational curves lying on rational surfaces

In many cases, there is no rational parametrization of the curve with rational coor-dinates. However, we sometimes have a parametrization in rational numbers of asurface that contains the curve. In such cases, we form an implicit representationof the algebraic curve in the parametric domain of that surface.

In the cases represented by the first eight rows of figure 4, at least one surface�� from the three bisector surfaces admits a rational parametrization with rationalcoefficients. Using the parametric form of ��, we pull the seam curve back to the�� � plane. We then apply the topological analysis algorithm described in Keyseret al. [24], which decomposes the curve into segments that are monotonic in � andin .

For each candidate boundary element �, we construct the bisector surface �� as-sociated with one of the seam governors. The intersection curve of �� and �� ispulled back to the same �� � domain, forming a “candidate curve.” The candidateterminators are the intersection points of the candidate curve with the seam curve.Though both curves can be degree four, they still intersect in at most eight points.Using the topological decomposition of the seam curve, it is then a simple matterto order the candidate terminators and find the first one along the seam curve.

14

Page 15: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

6.3 Non-rational curves lying on algebraic surfaces

In the last two seam combinations, line-plane-plane and plane-plane-plane, the bi-sector surfaces (cones and plane-pairs) may not have rational parametric forms withrational coefficients. Rather than performing arithmetic in an extension field, wenote that in these two cases (including degenerate configurations) the seam curveis always a conic or a line, and elect to treat these cases with specialized three-dimensional methods. The candidate junctions are all isolated in �� ��-spaceusing 3-D Sturm sequences. The isolation method is described in section 8.

For the generic plane-plane-plane case, the equidistant point set corresponds to fourlines meeting at the intersection of the planes. The various slopes of these lines areall irrational. The seam is contained in one of the eight “branches” of this curve, andthe plane equations of the three governors distinguish points on this branch frompoints on the others. The ordering among the candidate junctions is determined by,say, their �-coordinates.

For the generic line-plane-plane case, the curve consists of two non-intersectingconics lying in perpendicular planes. The two planes’ slopes are generally irra-tional. One conic is the seam, while the other is irrelevant. Candidate junctions onthe irrelevant conic can be culled away by testing against the plane equations of thetwo governing planes. The curve, represented implicitly by the intersection of twobisector surfaces ��� �� � �, ��� �� � �, is then projected onto the �-planeby eliminating � from the pair of surface equations using the standard Sylvesterresultant [9]. Before projecting, we transform the system so that eliminating � cor-responds to projection onto a plane close to the plane in which the conic lies. Theprojected curve is a quartic in � and . It is the product of two conics, but cannotbe factored over the rationals. A suitable domain is chosen and the curve topologyroutine is run on the quartic curve. The boxes containing the candidate junctionsproject to hexagons, as 3-D boxes generally do. If the projections overlap, the 3-Dboxes are shrunk and reprojected.

7 Junctions

Before tracing a seam, the algorithm must decide which seams to trace, and inwhich direction. Both of these issues are questions of the local geometry of themedial axis at the seam’s starting point. This section describes the local geometryat a junction, and gives methods for finding valid seams and their initial directions.

Consider a junction governed by elements ��� � � � ���where � � �. In the genericcase, � � � and each of the three-element subsets of ��� �� �� ��� govern a seam.One problem is the choice of one of the two tangent directions along the seam.

15

Page 16: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Also, a junction may be degenerate. We define a degenerate junction as a junc-tion with more than four governors. When � � �, not all three-element subsetsactually govern seams, and the non-redundant triples must be identified. These twoproblems—the choice between two search directions and the identification of inci-dent seams—are solved by comparing seam tangent vectors with bisector tangentplanes.

Junction points fall into two categories: internal junctions and vertex-junctions. Aninternal junction � is characterized by:

� � is equidistant from four or more boundary elements;� this distance is positive, and � lies in the interior of the polyhedron;� � being equidistant from five or more boundary elements is indicative of a truly

degenerate situation;� the coordinates of � are algebraic numbers of degree at most eight.

A vertex-junction � is characterized by:

� � coincides with a vertex of the polyhedron;� � is equidistant from several boundary elements, but this distance is zero;� the number of equidistant boundary elements is quite commonly more than four,

as it includes all incident faces and (reflex) edges;� the coordinates of � are rational by assumption.

It is clearly advantageous to distinguish these two types of junction point in theimplementation. It can be argued (see [38]) that the connectivity properties of themedial axis make it feasible to avoid searching out of vertex-junctions at all—theyserve as “sinks” for the recursion. Doing so typically removes many degeneratejunctions from consideration. However, the problem of degenerate interior junc-tions remains. Degenerate interior junctions are not rare—they arise dependably inmodels of artificial objects possessing symmetry.

For any type of junction—interior or vertex, degenerate or non-degenerate—thefollowing predicate decides whether a potential incident seam is a part of the medialaxis. Let � be a subset of the set of junction governors, and � � be its complement,so that � � � � � ��� � � � ���. Let � have at least three elements. For each pair�� ��� where � � and �� � �, let ��� ��� be the tangent plane to the bisectorsurface of � and �� at the junction point. Let � be one of the two tangent vectorsto the curve equidistant from the elements in �. The seam defined by � and �participates in the medial axis if and only if for every pair �� ���, the vector �,compared to ��� ���, points toward � and away from ��. Note that a particular �may not generate a seam, and that if ���� does generate a seam, then �����cannot.

There are��

�possible seams incident to our vertex, ignoring (for the sake of

analysis) the possibility that a seam may be governed by more than three ele-

16

Page 17: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

ments. Checking a seam requires constructing ��� � tangent planes. Checking allpossible seams, then, requires �

���� ��� ��

���� � vector-versus-plane checks. For

a non-degenerate interior vertex, we know there is a seam for each �, and it is just amatter of choosing a � for each one. This requires only four tangent plane checks.For a very degenerate vertex, though, the exhaustive method can be expensive.

Comparison of the vector � to the plane � is performed in exact arithmetic asfollows. The seam is represented implicitly in� as the intersection of two surfaces.A seam tangent � may be found by crossing the gradients of the two surfaces. Theplane � is the orthogonal complement of the gradient � of the bisector surface������ �� � ��

��� �� � �. When the surface is written this way (instead of in

the opposite order), the gradient points “towards” �, so the predicate on � can beevaluated as the sign of � � �. The latter expression is the determinant of the threegradient vectors. The determinant is expanded symbolically in terms of � and �,and forms a cubic polynomial in those variables. If the rational box containing thejunction point lies entirely on one side of the zero set of this cubic polynomial, thenthe sign can be evaluated at any of the eight corners.

8 Efficiency improvements

The exact tracing algorithm presented in the foregoing sections has two sources ofinefficiency: it is asymptotically suboptimal, and it is based entirely on exact arith-metic. In this section, we present techniques that alleviate both sorts of inefficiency.Sections 8.1 and 8.2 mitigate the asymptotic complexity of the algorithm by reduc-ing, in typical cases, the number of candidate junctions considered during a seamtrace. Sections 8.3 through 8.5 present three techniques that significantly reduce thecost of exact computation without sacrificing accuracy.

8.1 Recursive subdivision of space

The tracing algorithm finds a terminating junction for each seam. The number ofcandidate junctions may be as many as ����, where � is the number of faces, edges,and vertices of the input polyhedron. In practice, the expense is in computing thecandidate junctions, not comparing them. Any technique which rules out candi-date elements without examining the corresponding candidate junctions is likely tospeed up the tracing algorithm.

Some boundary elements can be rejected before the associated junctions are com-puted. In this section and the next, we describe two methods for rejecting candi-date boundary elements. Either method can be used as a pre-process to the tracingalgorithm. Neither method reduces the asymptotic worst-case complexity of the

17

Page 18: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

algorithm, though both reduce its running time significantly in practice.

Several authors have proposed spatial subdivision algorithms for approximatingthe medial axis or computing it completely. Our method is related to those ofMilenkovic [29] and Etzion and Rappaport [13].

Subdivision begins by finding a bounding cube for the polyhedron. The boundingcube is divided recursively into eight sub-cubes. The subdivision continues recur-sively until one of several termination conditions occurs. The termination condi-tions, and the reason for preferring a cube to a general bounding box, are describedbelow.

Each cube is called a cell. Associated with each cell is a list of boundary elements,called the governors of the cell. The defining property of a cell’s governor list is thatit contains all boundary elements whose internal Voronoi region intersects the cell.Put another way, the list is a superset of the set of closest boundary elements to allpoints in the cell. This property is the only invariant maintained during subdivision.The subdivision could consist entirely of cells governed by all boundary elements,in which case nothing at all is revealed about the medial axis. But for many poly-hedra, it is possible to compute a cell division of higher quality, revealing most orall of the medial axis topology.

At the heart of the algorithm are three criteria for removing a governor from acell’s governor list. They can be applied in any order. The order of applicationdoes, however, affect the quality of the subdivision. Consider a single cell � withthe governor list �. Let � � be any governor of �. Then � can be removed fromthe list if any of the following conditions hold.

(1) Polytope exclusion. The domain polytope of � does not intersect �. (The do-main polytope is defined in section 4.)

(2) Distance exclusion. There exists another governor � � � such that the centerof � is closer to �� than to �, and the difference in distance is greater than thediameter of �.

(3) Bisector exclusion. There exists another governor � � � such that all pointsin the cell are closer to �� than to �, and the cell lies entirely within the domainpolytope of ��.

Criteria 1 and 2 were proposed by Milenkovic [29]. His version of criterion 1 isslightly looser; it is equivalent to intersecting the domain polytope with the circum-sphere of the cell. Criterion 3 was proposed by Gottschalk and Culver [17].

When a cell’s governor list is reduced to three or fewer, the cell is immediatelyremoved. A cell having four governors is subdivided until it reaches a minimumtree depth ��. A cell having five or more governors is subdivided to a deeper level�� in the hope that it will break up into cells with fewer governors.

18

Page 19: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

The result of the spatial subdivision algorithm is a collection of governor lists. Ifthe medial axis is generic and the subdivision proceeds far enough, each list hasfour governors. A four-governor list may correspond to a single junction, manyjunctions, or no junctions at all.

The subdivision algorithm can be implemented in exact arithmetic, since it requiresonly rational arithmetic. However, it is possible to implement the algorithm safelyin floating-point arithmetic. Tolerances are introduced to outweigh the effects ofroundoff error. The tolerance is manifested as a slight expansion of the cell bound-aries. For instance, in the bisector exclusion rule, the range of the quadric functionis computed in floating-point and then expanded slightly. Such a simple toleranc-ing scheme is feasible because we are only culling—there is no harm to overallcorrectness as long as we conservatively keep governors that are numerically closeto being eliminated. An interesting topic for future work is to compute a lowerbound on each of the tolerances based on the input precision.

For details of the three culling criteria, proofs that no actual junction’s governorsare eliminated, and observations on the most effective ways to apply the criteria,we refer the reader to Culver [7].

8.2 Polytope pairs

An alternate preprocess for speeding up the search algorithm is based on the domainpolytopes defined in section 4. For each each pair of governors, the preprocess teststheir polytopes for mutual intersection inside the bounding box of the polyhedron.If the polytopes do not intersect, the governors cannot be Voronoi neighbors. If thepolytopes do intersect, each governor is put on the other’s sorted list of potentialneighbors.

During the main algorithm, the lists are used as follows. When the seam governedby �� �� �� is traced, the desired fourth governor �� must be a Voronoi neighborof all three seam governors. The tracing algorithm then limits its attention to thegovernors which are on all three lists.

The preprocessing involves��

�steps, each of which performs a polytope intersec-

tion and a list insertion. The polytope intersection usually takes constant time inpractice, since the polytopes are typically defined by fewer than ten planes. Thelist insertion takes ����� time. The overall preprocessing running time is thus���� ���. The memory required is ����� pointers. The asymptotic running timeof the complete medial axis algorithm is not increased, since the list-intersectionstep takes at worst ���� time for each seam traced—the same amount of time thatwas already committed to examining all the other boundary elements.

The preprocessing time of ���� ��� is not significantly different from the com-

19

Page 20: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

plexity of the medial axis algorithm, which takes at least ����� time without such apreprocessing heuristic. Moreover, the constants in the preprocessing time are muchsmaller than those in the medial axis implementation, since the polytope intersec-tion step involves only linear geometric computation (signs of �� � determinants).

The polytope pair test is often not as effective as spatial subdivision. The mainadvantage to the polytope pair test is that its behavior is predictable in terms oftime and resource consumption.

8.3 Elimination

In our exact algorithm, roots of systems are computed only to the precision nec-essary. Root representations are exact, but implicit, and the geometric algorithmsusually pay attention only to the rational box containing the root. At all times, therational box is shrunk only as much as necessary to answer the query. This is a formof “lazy evaluation” of solutions to polynomial systems.

The efficiency of floating-point arithmetic can be leveraged against the problem offinding roots to systems. While isolating roots is based on bisection, an initial esti-mate to the root can be based on a floating-point approximation. Three-dimensionalroot finding proceeds in three steps:

(1) Using 3-D Sturm sequences, count the number of roots in a bounding box.(2) Using multivariate Newton-Raphson iteration, locate the roots and construct

small, disjoint rational boxes around them.(3) Using 3-D Sturm sequences, verify that each box contains a single root.

Usually the Newton-Raphson method finds the roots to very high precision in verylittle time. In such a case, the rational box is very small and further refining willusually not be necessary. In other cases, the floating-point method may not be ableto distinguish closely-spaced roots. When this happens, the Sturm sequence com-putation will detect that a box contains more than one root. The roots are thenisolated by bisection.

The fundamental 2-D kernel operation is isolating and refining curve-curve inter-sections. The bivariate Sturm sequence is an appropriate tool, but a more efficientmethod has been developed for the MAPC library [24]. This method, based onSylvester resultants and univariate root solving, consistently outperforms bivariateSturm. Unfortunately, the method does not generalize easily to three dimensions.

The elimination stage turns a multivariate root-counting problem into a univariateroot-counting problem. To solve a system of three equations in � and �, a fourthvariable � and a fourth equation � � �� � �� � !��� � "� are adjoined. Thevariables ! " are constants, the coordinates of a corner of the rational box. The

20

Page 21: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

variables � and � are eliminated from the system, leaving a single polynomial in�, the volume function # ���.

The elimination is accomplished with Macaulay’s resultant [28], which representsthe resultant as the quotient of the determinant of a matrix $ and the determinantof a sub-matrix $ �. When the system consists of three quadrics in � and �,as it does in the worst case for the medial axis problem, $ is an �� � �� matrixwhose entries are constants and linear polynomials in the variable �. The methodis detailed in Culver [7].

We arrange the rows of $ and $ � so that $ � depends only on the coefficients ofthe system, and does not contain ! " or �. The denominator ����$ �� is thena constant, so no polynomial division is necessary. One only needs to check thatthe denominator matrix is nonsingular. Since the denominator is independent of thepoint � ! "� in space at which the Sturm sequence is evaluated, so it needs to bechecked only once per system. Unfortunately, the Macaulay denominator can besingular, even when the system is geometrically well-defined. The singular denom-inator does not signify anything about the system; it means only that the methodhas failed. This eventuality is discussed in section 9 below.

The Macaulay numerator is arranged into block form:

$ �

��� % &

�� ! "� '� ! "� � �(

��

where % and & contain coefficients of the system, and � and ' depend on thepoint � ! "�. The matrix % is a �� � �� matrix and the matrix ' is � � �.By performing block Gaussian elimination on this matrix, the bulk of the workof taking the determinant of the Macaulay numerator is performed before ! "are known. The precomputation consists of finding the )* -decomposition of %and computing ����%� and %��&. Then, for each � ! "�, the method computes+ � '�� � �%��&� and the �� � symbolic determinant ����+ � �(�. An exactmethod for computing the polynomial ����+ � �(� is to substitute nine differ-ent numeric values for �, compute the nine determinants in exact arithmetic, andsolve for the polynomial coefficients with Vandermonde interpolation. The deter-minant ����$� is then given by ����%� � ����+ � �(�. The volume function isthen # ��� � ����%� � ����+ � �(�, ����$ ��. Constant factors are irrelevant forsequence evaluation, though, so ����+ � �(� is used as the volume function, after% and $ � are checked for singularity.

21

Page 22: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

8.4 Sequence evaluation

Once the volume function # ��� is computed, the next step is to compute the numberof negative real roots this univariate polynomial. A well-known exact method is the(univariate) Sturm sequence.

The Sturm sequence of a square-free univariate polynomial ���� can be evaluatedby constructing the actual sequence of polynomials ������ ����� ����� � � � ������where ����� � ���� ����� � � ����, and, for - � � � � � , �� � � �������� �����.Here � ���� is the derivative of � and ����� �� gives the remainder on polyno-mial division of � by �. This evaluation algorithm is similar to Euclid’s algorithmfor computing the GCD of two polynomials. For low-degree polynomials, suchas the degree-8 volume function # ��� arising in isolating roots of three quadricsurfaces, this approach can be practical. An implementation based on adaptive-precision arithmetic has been developed as part of the PRECISE library [25].

For higher-degree polynomials, the subresultant polynomial remainder sequencealgorithm [4] can improve efficiency by avoiding the exponential coefficient growthin the polynomial��' operations. The subresultant algorithm computes the coef-ficients of the sequence’s polynomials as determinants of matrices. For root count-ing, one needs only the signs of the constant terms of the polynomials in the se-quence. The problem is thus reduced to computing the signs of determinants ofmatrices with rational entries, or equivalently, with integer entries. The determi-nant sign evaluation problem is discussed in Culver [7].

8.5 Using numerical eigenvalues

Evaluating the Sturm sequence of # ��� is inexpensive compared to the computa-tion of the symbolic determinant # ��� � ����+ � �(�. Though + is a fairly smallmatrix, its entries usually have bit lengths many times larger than the bit lengthsin the input polyhedron. It is often possible to circumvent this symbolic determi-nant by computing the numerical eigenvalues of a floating-point approximation tothe matrix �+ . The resulting technique is a floating-point filter for computing thesigns of the roots of the volume function without computing the volume function’scoefficients explicitly.

The expensive degree-8 univariate polynomial # ��� is used only to evaluate theSturm sequence of # ��� at � � �. The evaluation produces a small integer ���� ���,the number of variations in the Sturm sequence of # ��� at 0. The number of varia-tions is equal to the number of negative roots of # ��� plus the number of complexconjugate root pairs. Since # ��� is given by the matrix determinant ����+ � �(�,it is equal to the characteristic polynomial of the matrix�+ . Therefore the roots of# ��� are the eigenvalues of�+ . The eigenvalues can be computed quite efficiently

22

Page 23: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

by a numerical routine, such as the DGEEV routine of LAPACK [10]. The moresubtle issue is the reliability of this operation.

The accuracy of numerical eigenvalues is an important and well-studied problem.For a treatment, see Golub and van Loan [16]. The Gershgorin Circle Theorem isone of the main results. Informally, it states that if a matrix is perturbed slightly, theeigenvalues move within certain disks in the complex plane. The theorem appliesto eigenvalue algorithms such as the one implemented in the LAPACK library.LAPACK’s algorithm applies a series of similarity transformations to the matrixto convert it to a “upper quasi-triangular” matrix, that is, with � � � and � � �blocks on the diagonal. The diagonal elements �.� of the transformed matrix are theeigenvalues. The net perturbation by the similarity transformations is small, andGershgorin’s theorem can be applied to the results of LAPACK’s algorithm. Theresult is that the true eigenvalues .� lie within the union of certain disks centered atthe computed eigenvalues �.�. Further, if � of the disks form a connected domain thatis isolated from the other disks, then the domain contains exactly � true eigenvalues.The details of this result are given in Demmel et al. [10].

The circle theorem gives a sufficient condition for the reliability of the numericaleigenvalues. The number of negative real eigenvalues of�+ is correct unless eitherof the following conditions occurs:

� A disk contains the complex number 0.� Two or more disks overlap, and any of them touches the real line.

The conditions are illustrated in figure 5.

Each real root of # ��� corresponds to the signed volume of the 3-D box with onecorner at a root of the 3-D system and the opposite corner at the point of evaluation� ! "�. This implies that whenever the evaluation point is at a small distance Æfrom a root, the volume function # ��� has a root whose magnitude is on the order

Fig. 5. The Gershgorin disks in the complex plane can be used to gauge the reliability ofeigenvalue signs. (a) Even with some types of overlap, the signs can be reliably determined.This example has one negative eigenvalue, one positive eigenvalue, and three complex con-jugate pairs. (b) The eigenvalue signs are ambiguous. This example illustrates all four basictypes of sign ambiguity.

23

Page 24: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

of �. Such a root can be expected to produce a Gershgorin disk that contains thecomplex number 0.

In fact, this situation occurs frequently in practice. Usually, Newton-Raphson iter-ation produces a high-precision approximation to each 3-D root. A small rationalbox, say with side Æ, is drawn about the approximate root, and the 3-D Sturm se-quence is evaluated at each of the eight corners. Every corner is close to a root ofthe system, so for all eight evaluations, the volume function has a tiny root on theorder of Æ�, causing the eigenvalue filter to fail. The sign variation in this tiny rootis exactly what the 3-D Sturm sequence is attempting to measure.

The problem can be circumvented at some cost. Let .� be a real eigenvalue whosesign is in doubt. Suppose that the rest of the eigenvalues .� � � � .� are each knownto be positive, negative, or imaginary. Since

�����.�� � �����.�� � � � �����.�� � ����������+��

the sign of the tiny root can be derived from the sign of the determinant of �+ .Finding ����������+�� is expensive, but the exact alternative involves computingthe nine exact determinants �����+ � �(� � � � � � � � �� and exactly solvinga � � � Vandermonde system, so the filter is still a win. This case—one tiny realeigenvalue, the others well-separated—is the common one for this algorithm. Thefilter may fail if the 3-D system has roots that are close together. Also, it may failif a root lies very close to the evaluation point in one or more coordinates, that is,close to one or more of the planes � � � ! � � ".

In summary, the roots of # ��� are the eigenvalues of �+ . The construction of# ��� can be reliably circumvented when its roots are well-separated, in the com-plex plane, from each other and from 0. The separation condition can be evaluatedreliably by examining the eigenvalues of �+ and their Gershgorin disks. In a par-ticularly common case, all of the disks are well-separated except for one near 0. Inthis case, only the sign of the constant term of # ���, or equivalently the determinantof �+ , needs to be computed exactly.

9 Handling degeneracies

The medial axis algorithm presented here assumes a non-degenerate medial axis.For example, when ordering candidate junctions along a seam curve, it is assumedthat there is not a tie for the first junction point along the curve. This section de-scribes the degeneracies that arise in the medial axis problem. These degeneraciesare of only a few types, and many can be detected and dealt with explicitly duringthe course of the algorithm. Only three forms of degeneracy pose a problem to themedial axis seam-tracing algorithm:

24

Page 25: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

� the junction with more than four governors,� the seam with more than three governors, and� the degree-four seam with a singular point.

The first two forms are common in solids possessing symmetry. They are illus-trated in figure 6. Accounting for the excess governors requires minor provisions inthe seam tracing algorithm. We describe these provisions in this section. We alsoillustrate and discuss the third form of degeneracy, the singular seam, which is anopen problem. Finally we describe the types of degeneracy which arise incidentallyduring the algorithm and are not indicative of a degenerate medial axis.

9.1 The degenerate junction

A junction is said to be degenerate when it is equidistant from five or more bound-ary elements. Our algorithm detects degenerate junction points by a three-stageprocess.

(1) During the searching step, the box containing the starting point overlaps withthe box containing a candidate end point, even after the intervals or boxes havebeen reduced to a reasonably small size. This signals that the junction may bedegenerate.

(2) Check whether the four bisector surfaces involved actually meet at some point,using the Dixon resultant [11].

(3) If so, either further refine the root to the precision recommended by Canny’sgap theorem [5], or check for a root of the system

�� �� � � �� � � �� � � �� �� ���

inside the overlap of the boxes.

The first two steps may be regarded as filters for avoiding step 3 where possible. Ifthe junction is found to be degenerate, the new governor is adjoined to the list ofjunction governors, and the collection of incident seams is re-evaluated as describedin section 7.

� �

Fig. 6. The two common forms of medial axis degeneracy. (a) A cube has one degener-ate junction. The junction has six governors instead of four. (b) A rectangular box withdimensions ��� �� �� has two degenerate junctions (five governors instead of four) and onedegenerate seam (four governors instead of three).

25

Page 26: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

9.2 The degenerate seam

A seam is degenerate when it is governed by four or more boundary elements.Our algorithm does not need to do extra work to discover degenerate seams. Such aseam is analyzed using three of its governors, while a fourth governor is necessarilydiscovered during the search for the ending junction. While attempting to isolate azero-dimensional solution to this system, the algorithm encounters a Sturm volumefunction that is identically zero, meaning that the solutions set is infinite. When thisoccurs, the extra governor is simply added to the list of seam governors.

Another form of seam degeneracy is the singular seam curve. A seam curve ofdegree higher than two can have a singular point, that is, a point at which there isno unique seam tangent. An example is shown in figure 7. The curve is the set ofpoints equidistant from three lines. The lines, each defined by a pair of points, are

�� � ��� � �� �� � ����� � ��� � �� �� � ����� � ��� � �� �� � ���

The lines �� �� are skew, so their bisector is a hyperbolic paraboloid. Likewise forthe lines �� ��. Intersecting these two bisector surfaces, we find that the curve is theunion of two parabolas intersecting tangentially. The singular point does not lie onany of the lines. This example is due to Little [27].

Singular seam curves pose a problem for any tracing-based algorithm. All such al-gorithms assume that each seam curve has two ends, so that given one end, the othercan be computed. If a tracing algorithm were to come across the seam curve givenin figure 7, it may need to find the singular point and find both parabolas. The sin-gular point occurs where the seam tangent is the zero vector. The seam tangent can

Fig. 7. A degree-four seam curve with a singular point. The curve is the union of twoparabolas intersecting tangentially.

26

Page 27: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

be defined as the cross product of two bisector normals. The singular point can bedefined by the simulateous vanishing of the three coordinates of the seam tangentvector, each of which is a quadratic equation in � �. So in principle, the singularpoint can be found by intersecting three quadric surfaces. This does not, however,solve the problem of tracing the singular seam curve. A general solution may in-volve an analysis of the singularity by algebraic techniques such as the “blowup”transformation [36].

9.3 Incidental degeneracies

Though the medial axis is inherently degenerate in only a few ways, the algorithmitself introduces further degeneracies. Such incidental degeneracies are the result ofarbitrary choices made in the course of the algorithm. In practice, these can often bealleviated by introducing a random variable into the arbitrary choice. This sectionidentifies the most important incidental degeneracies in the medial axis algorithm.

Resultants. Macaulay’s formulation of the resultant is only well-defined for a genericchoice of coefficients. Specifically, there is a small subset of polynomial systemsfor which the Macaulay formulation takes the form �,�. In theory, the subset isso small that a random affine transformation on the variables � � removes thisdegeneracy with probability 1. In practice, the affine transformation trick does notalways repair the Macaulay denominator. But it works often enough to repay the ef-fort spent implementing it. Therefore, our implementation of 3-D Sturm sequencesmanipulates not rectangular boxes, but parallelepipeds. Even with a random affinetransformation, some systems may still fail due to special or missing coefficients.In medial axis computation, this can usually be alleviated by switching to an equiv-alent problem: simply pick different surfaces. A junction is defined by the inter-section of three surfaces, but for any particular junction, there are always at leastsix surfaces to choose from (the pairwise bisectors of the four governors). Thesetwo techniques are sufficient for computing the entire medial axis for many mod-els. However, to be totally rid of this problem, a symbolic perturbation may benecessary.

Parametric surfaces. The parametrization of the sheets is arbitrary. Once the para-metrization is chosen, degeneracies can occur in the plane which pose a challengeto the curve topology algorithm. For instance, a turning point of the seam curvemay lie at the corner of the �� �-domain. The implementation must be prepared todetect such problems, and expand or recompute the parametric domain as neces-sary.

27

Page 28: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

10 Implementation and results

In this section we describe our implementation of the algorithm and highlight itsperformance on a few polyhedra.

The algorithm has been fully implemented in C++. Routines for root isolation inone, two, and three dimensions take advantage of the efficiency techniques describedin this article. We use the bigint and bigrational exact arithmetic types inthe LiDIA library [18]. The MAPC library [24] contains polynomial data structuresand algebraic routines used in 1-D and 2-D seam tracing. The LAPACK [10] libraryis used for its floating-point LU-decomposition, eigenvalue, and SVD routines. ThePRECISE library [25] is used for its adaptive-precision Sturm sequence and deter-minant sign routines. The implementation consists of about 50,000 lines of C++code, including MAPC but excluding the other libraries.

As a postprocessing step, the seam curves are tessellated into polygonal chainsin the respective parametric domains of their sheets. The chains are then used astrimming boundaries for Bezier patches, one patch per sheet. For the images shownhere, the trimmed patches are then triangulated and rendered by the OpenGL graph-ics library.

Our implementation is complete except for the degeneracy-handling techniques ofsection 9. Currently our implementation stops tracing when it reaches a degenerateinternal junction. Degenerate seams are therefore not traced, since they necessarilyhave degenerate ends. Such degeneracies are not uncommon, occurring in severalof the example models presented in this section. In the case of a single degener-ate junction, our implementation is able to approach it along all incident seams,resulting in a correct output. However, any degenerate seams are missing. Further,the missing seams can disconnect the medial axis, causing our implementation totrace only a portion of it. In order to give as much meaning to our timing resultsas possible, we have traced the non-degenerate portions of the medial axis one byone where necessary. For example, the medial axis in figure 11 was found in threeportions.

Table 2 summarizes the running time on the examples shown. Times are reportedfor an SGI computer with an R12000 processor running at 300 MHz. The times re-ported include the spatial subdivision preprocess, seam tracing, and sheet identifi-cation. Time spent converting an input model with floating-point vertices to rationalnumbers is inconsequential, so we omit it.

Time spent in seam polygonization has also been omitted from the running time.The tessellation of algebraic curves is a challenging problem, and we have imple-mented only a simple solution for the purpose of visualizing small examples. In ourlarger examples, we render the seams as line segments.

28

Page 29: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Polyhedron Input complexity Output complexity Running time

faces edges vert. sheets seams jct.

L (8) 10 22 14 30 34 11 ��� seconds

Groove (9) 16 38 24 69 88 36 �� minutes

Pizza (10) 56 124 70 848 2116 946 ���� minutes

Bracket (11) 252 378 124 950 1439 453 ��� hours

Bagel (12) 104 156 52 745 1032 437 ��� minutes

Venus (13) 250 375 127 1627 2147 975 � hoursTable 2Performance on some example polyhedra. Running times are on an SGI computer with anR12000 processor running at 300 MHz.

Figure 8 shows a simple non-convex polyhedron and its medial axis. The medialsurfaces are parts of planes and cones.

A more complex example is given in figure 9. This polyhedron is an octagonal boxwith two opposing grooves. The two non-convex edges are separated by a verysmall gap. Visualizing the entire medial axis is difficult. Figure 9(d) shows the me-dial axis with the outer parts removed. The remaining sheets form a surface similarto a hyperbolic paraboloid, but formed mainly of cylinders, cones, and planes. Thesmall hyperbolic paraboloid that is the bisector of the two reflex edges is shownin figure 9(e). Each of the paraboloid’s four edges is a single branch of a (planar)hyperbola.

Table 3 shows the time taken by an average 3-D Sturm computation. The compu-tation proceeds in two stages. The first stage computes the Macaulay denominatorand the portion of the Macaulay numerator that is not dependent on the evaluationpoint. The second stage computes the number of permanencies in the volume func-tion at a given point in space. In order to compute the number of roots in a box, thesecond stage is repeated once for each corner.

� � /

Fig. 8. A simple non-convex polyhedron: an L-shaped box. (a) The polyhedron. (b) Itsseam curves. (c) The central sheets.

29

Page 30: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

� �

/ �

Fig. 9. A polyhedron with two grooves. (a) The polyhedron. (b) Its seam curves. (c) Its me-dial axis. (d) The part of the medial axis which does not meet the boundary, magnified ��.(e) The central sheet is a hyperbolic paraboloid, the bisector of the two grooves. Magnified����.

Fig. 10. The “iron maiden pizza box” and a schematic of its medial axis.

Task Average time (sec)

Set up system ����

Evaluate at one point ����

Count roots in one box ���� � �� ���� � ���

Table 3Average timing for quadric-quadric-quadric 3-D Sturm operations in the Venus model.Only the systems of full degree ��� �� �� are included in this average.

30

Page 31: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Fig. 11. A CAD model of a bracket and a schematic of its medial axis. The medial axis hasa few degenerate junctions, indicated by the isolated points. The implementation currentlysupports tracing only seams having at least one generic junction.

Fig. 12. An irregularly-faceted torus and a schematic of its medial axis showing the centralseams.

11 Analysis

In this section we analyze the performance of the implementation and the efficacyof the filters.

The overall running times in table 2 demonstrate that the algorithm runs in a reason-able amount of time on polyhedra with hundreds of faces. However, the reportedtimes vary widely among the examples. In this section, we account for the variationby identifying the major contributing factors to the overall running time. We alsodiscuss the efficacy of the filters and other efficiency improvements.

To understand the efficiency of an algorithm, the first consideration is combinatorial

31

Page 32: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

� � /

Fig. 13. A model of the Venus de Milo sculpture. The medial axis of this asymmetrical poly-hedron has no degenerate seams or junctions. It does have many small seams and sheets.(a) Venus. (b) Its seam curves as line segments. (c) The “central” seams, those that do nothave an endpoint on the boundary.

complexity. The tracing algorithm is sensitive to both the input complexity (numberof faces, edges, and vertices) and the output complexity (number of sheets, seams,and junctions). The output complexity can be approximately the same as the inputcomplexity, or it can be much larger. For example, the pizza box model has fewerfaces, edges, and vertices than the Venus model, but a medial axis of about the samecomplexity.

In this section, our emphasis is not on combinatorial complexity, but rather on prac-tical efficiency: the ability of an implementation to produce accurate results in a rea-sonable amount of time. Though our running times for large models are measuredin hours rather than minutes, the reliability we have gained by our exact approachenables us to tackle larger inputs than pure floating-point methods seem to allow.

11.1 Execution profile

Execution profiles for the models are shown in table 4. Most of the time is spent in3-D Sturm operations, which are both expensive and common. The next significantcontributor is the spatial subdivision stage.

32

Page 33: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

Polyhedron Time spent in the most significant routines (seconds) Total time

Spatial 3-D Sturm 3-D Sturm 2-D All other (seconds)

subdiv. setup evaluation tracing routines

L (8) ��� � ��� ��� ��� ���

Groove (9) ��� ���� �� �� �� ���

Pizza (10) ��� ���� �� � �� ��� �����

Bracket (11) ���� ������ �� �� �� ������

Bagel (12) ���� ���� ��� �� ��� �����

Venus (13) ����� � ��� �� �� ���� ���� ������

Table 4Breakdown of time spent in the most expensive routines. The routines are mutually exclu-sive. “2-D tracing” includes bisector parametrization, curve topology, 2-D junction loca-tion, and junction ordering.

11.2 Factors affecting running time

This section identifies the factors that largely determine the running time. The list isnot exhaustive; rather, it focuses on the factors that have shown to be most importantin practice.

Combinatorial complexity of input and output. The algorithm’s running time de-pends on both the input complexity � and the output complexity �.

Input bit complexity. For an expression evaluated in exact arithmetic, the execu-tion time is sensitive to the input bit length. Since the medial axis running timeis dominated by such exact computations, the input bit complexity is important.For example, the Venus model is the output of a simplification algorithm workingin floating-point arithmetic. Its vertices are input as single-precision floating-pointnumbers and converted to exact rational numbers with numerators and denomina-tors of approximately 24 bits in length. By contrast, the pizza box’s vertices arecompact rational numbers such as �, and �,�. This is one of the main reasonsthat the pizza box finishes so much sooner than Venus. Venus is, of course, a morerealistic example.

Algebraic degree. A convex polyhedron has a completely linear medial axis. For ageneral polyhedron, curved bisectors occur only near concave features. The numberof high-degree medial axis features is related to the number of concave boundaryfeatures.

Clearance between junctions. Usually the Newton-Raphson approximation to ajunction is fairly accurate, and the 3-D Sturm operation simply serves to verifyits accuracy. But whenever two candidate junctions on a seam are sufficiently close

33

Page 34: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

together, the rational boxes must be reduced to determine their ordering. The im-pact of this on the total running time is surprisingly small, though, since refining aroot is inexpensive compared to finding it in the first place (as evidenced by table 3).

11.3 Efficacy of filters

Our accurate approach to the medial axis would not be practical without the ef-ficiency techniques. In this section we examine the benefits of these techniques.Table 5 gives a numerical summary of the effect of the filters on a few of the exam-ples. In some cases it was impractical to measure the running time of the completelyunaccelerated tracing algorithm; here we have made an estimate by multiplying thetime taken by an average 3-D Sturm operation (in the accelerated algorithm) bythe precise number of 3-D Sturm computations required by the unaccelerated algo-rithm (the number of seams in the medial axis times four less than the number ofactive boundary elements).

Spatial subdivision. For larger inputs, by far the most important efficiency tech-nique is the spatial subdivision preprocess. In essence, this numerical preprocessalleviates the poor asymptotic behavior of the tracing algorithm. The subdivisionstep significantly narrows down the possibilities for the topology of the medialaxis. In fact, many seams have only one possible terminating element; the rest areeliminated during subdivision. For these seams, the cost of tracing a single seam isjust the cost of locating a single junction point. On the whole, few extra candidatejunctions are created.

Efficient 3-D Sturm sequences. The two important efficiency techniques are par-tial evaluation and the eigenvalue-based floating-point filter. In section 8.5 we ar-gued that the eigenvalue filter could speed up sequence evaluation by nearly afactor of ten. Testing the filter on small polyhedra such as “groove” supports thisclaim. Comparing eigenvalue-filtered sequence evaluation to the purely exact Van-dermonde method, the filtered method outperformed the exact method by a factor

Polyhedron Running time Running time Running time

without eigenvalue filter without eigenvalue filter

or subdivision

Groove (9) 152 seconds 221 seconds 8880 seconds

Pizza (10) 22.9 minutes 40.9 minutes 66 hours (estimated)

Bagel (12) 18.5 minutes 36.1 minutes 107 hours (estimated)Table 5The effect of two of the efficiency techniques on running times for some of the examplepolyhedra.

34

Page 35: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

of 9. Since sequence evaluation is a bottleneck in the overall algorithm, the speedupof 9 improves the total running time significantly. As reflected in the running timesin table 5, the overall running time is improved by as much as a factor of 2. Withthe eigenvalue filter, sequence evaluation takes a small fraction of the total runningtime, effectively shifting the bottleneck entirely to the setup stage of the 3-D Sturmoperation.

12 Conclusions and future work

We have presented an accurate algorithm to compute the medial axis of a 3-D poly-hedron using exact computation. We have also highlighted a number of techniquesto improve its efficiency, and demonstrated its performance on a few polyhedra. Thealgorithm has been implemented in C++, incorporating the efficiency techniquespresented here. Techniques based on modular arithmetic, floating-point filters, lazyevaluation, and spatial subdivision combine to improve the efficiency of the systemby orders of magnitude.

One important area for future work is the treatment of degeneracies. At a verydegenerate junction (one with � � � governors), the exhaustive checking of allgovernor triples becomes very expensive, since the complexity grows with ��. Inthe future, we would like to understand the combinatorial structure of the seams in-cident to a junction point, to allow for more efficient searching among these seams.

The algorithm as a whole would benefit from a uniform treatment of degenerateconfigurations. We would like to investigate the use of perturbation techniques tosystematically handle degeneracies.

The problem of degree-four seam curves with singular points is unsolved. It re-mains to be seen whether the most effective method would involve detecting andanalyzing the singular points or removing them with symbolic perturbation.

Lastly, we would like to improve the performance of our implementation to thepoint where the running time is always within 1–2 orders of magnitude of a floating-point implementation of a similar algorithm. Such improvements will most likelycome from new floating-point filters.

A Bisector parametrization

In each case, the goal is to find rational expressions for � � � in terms of � andto find a rectangular region of the �� �-plane whose image under the parametri-zation covers the relevant portion of the bisector. The second part of the problem,

35

Page 36: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

finding a domain, is in some cases more difficult than the parametrization.

The degenerate morphologies are mentioned briefly at the end of each section; themissing details for these constructions are straightforward.

A.1 Edge-edge

The generic edge-edge bisector is a hyperbolic paraboloid. The parametric formu-lation is from Elber and Kim [12], who construct a parametrization for the bisectorsurface of two rational space curves. We review their method here, since two of theother cases are based on analogous constructions.

Let � vary linearly along one edge, so that � � � at one endpoint and � � � atthe other endpoint. Let similarly parametrize the other edge. As � and vary overthe unit interval, denote the corresponding edge-points � and 0 . For � �� � ,associate a unique point 1 on the bisector as the intersection of the three planes:

� the plane orthogonal to the first edge and containing �;� the plane orthogonal to the second edge and containing 0 ;� the planar bisector of the points � and 0 .

The coefficients of the first two plane equations vary linearly with � and . Thecoefficients of the third are quadratic expressions in � and . By Cramer’s rule, thesolution to the linear equation is a rational expression in these coefficients. Thus,the resulting parametrization is a polynomial expression in � and .

The idea is equivalent to mapping each point on the bisector surface to its orthog-onal projection onto each of the two edges. The bisector point can participate inthe medial axis only if its projection onto each edge-line lies within the edge, thatis, when � �� � . Therefore, the unit square maps to a portion of the surfaceincluding all bisector points that can lie on the medial axis.

The procedure described here works when the edge-lines are skew. When they areparallel, the bisector is a plane, as in the vertex-vertex case. When the edge-linesintersect, the bisector is a plane-pair with irrational coefficients, as in the face-facecase.

A.2 Vertex-face

The generic vertex-face bisector is a circular paraboloid. By analogy with the edge-edge case, we let � parametrize the face-plane linearly. Let � be the point corre-sponding to �� �. A unique point 1 on the bisector is formed by the intersection

36

Page 37: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

of

� the line orthogonal to the face and through �;� the planar bisector of � and the vertex.

An argument similar to the one in the previous section (A.1) applies to show thatthis yields a polynomial parametrization. Further, any �� �-domain that containsthe entire face must contain the relevant part of the bisector. This solution is equiv-alent to projecting the bisector onto the face-plane.

If the vertex lies on the face-plane, the bisector is not a surface at all: it is a line,namely the line orthogonal to the plane at the vertex. The line is a redundant partof the medial axis and can be ignored.

A.3 Vertex-edge

The generic vertex-edge bisector is a parabolic cylinder. Let � be a parameter alongthe edge, varying linearly from 0 and 1 between the endpoints. Construct any line� orthogonal to the plane containing the vertex and the edge, and let parametrize�. Define the points � and 0 as before. Construct a point on the bisector by theintersection of

� the plane orthogonal to the edge at �;� the plane orthogonal to � at 0 ;� the planar bisector of the points � and 0 .

There remains the question of finding a bounded range for . Our algorithm makesuse of the intersection of the domain polytopes of the two governors. The inter-section is a polytope containing the relevant part of the bisector. The polytope’svertices are projected onto �, and the extreme projections are used as the endpointsof the -interval.

If the vertex is one of the edge’s endpoints, the bisector is the plane orthogonal tothe edge and containing the vertex. The plane’s coefficients are rational.

A.4 Vertex-vertex

The bisector of two points is a plane. When the implicit form of the bisector iscomputed as in section 5.2, the quadratic terms cancel, leaving the plane equation.Finding a parametrization is equivalent to finding three non-collinear points123on the plane. The plane is parametrized by, say, 1 � ��2� 1 � � �3� 1 �.

In order to find a bounded domain, intersect the two domain polytopes with the

37

Page 38: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

bisector plane. This yields a convex polygon. Find the �� �-coordinates of thepolygon’s vertices, and extend the � and intervals to contain these points.

A.5 Face-face

The generic bisector of two signed planes is a plane. However, the implicit form’squadratic terms do not cancel as they do in the point-point case. In fact, the implicitform gives not only the bisector plane, but also an orthogonal plane. One planeis the desired bisector, lying inside the polyhedron from the point of view of thegovernors. The other plane is perpendicular, lying outside the polyhedron from thepoint of view of the governors. It is therefore not part of the medial axis.

The implicit form can be factored into two linear equations, one for each plane,but in general, the coefficients are irrational. Rather than compute directly withirrational numbers, or use an approximate representation of the plane, we structurethe algorithm so as to rely only on the implicit form. We then must take care todiscard the effects of the irrelevant second plane as they appear. This representationchoice may seem unusual, but it is motivated by the fundamental considerations ofexact arithmetic laid out in section 3.2.

Let � be the line at the intersection of the face-planes. Generally, � contains all pointswith rational coordinates on the bisector plane-pair. Choose two points 12 on �. Athird, non-collinear point 3 is found by scaling the face normals to have the samelength, taking the average, and adding the average normal to 1 . The coordinatesof 3 are rational if and only if the scaling can be done with a rational number,that is, if the ratio of the lengths of the face normals is rational. This can be easilychecked by testing whether the ratio of the squared lengths is a square number.Usually it is not, but when it is, the parametric form of the plane can be used, andthe degree-two implicit form can be replaced with the degree-one plane equation.This happens when, for instance, the two faces are perpendicular. Otherwise, thebisector plane is computed by the same procedure in approximate arithmetic, forvisualization and output.

The important case of coplanar adjacent faces is simpler. The bisector plane hasrational coefficients and contains the two common vertices and a third point foundby adding the common face-normal to a vertex. Coplanar adjacent faces occurwhenever a non-convex face has been split into convex subfaces. Coplanar non-adjacent faces do not have a relevant bisector. Parallel, non-coplanar faces have aplanar bisector with rational coefficients.

38

Page 39: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

The generic edge-edgebisector is a hyperbolicparaboloid. Isoparamet-ric curves are shown.

The generic vertex-facebisector is a circularparaboloid. Isoparamet-ric curves are shown.

The generic vertex-edgebisector is a paraboliccylinder. Isoparametriccurves are shown.

The generic face-face bisector is aplane. The bisector plane is horizon-tal in this figure. The implicit formyields an orthogonal plane pair whichcannot generally be separated with-out irrational numbers.

The generic edge-face bisector is anelliptical cone. The top half can par-ticipate in the medial axis. The para-metric form generally involves irra-tional numbers, so the algorithm re-lies on the implicit form only.

A.6 Edge-face

The generic bisector of a line and a plane is an elliptical cone. The vertex of thecone has rational coordinates, and lies at the intersection of the line and the plane.In general, the vertex is the only point on the cone with rational coordinates, andno rational parametrization exists with rational coefficients. Only the implicit formis used by the medial axis algorithm.

An approximate rational parametrization is nonetheless useful for applications insolid modeling. The parametric form of the elliptical cone is computed in floating-point arithmetic and included in the output. A right circular cone in standard posi-tion is mapped by an affine transformation to the bisector. The cone �� � �� � �

is parametrized ��� ��

� � ��

��

� � �� ��

There exists an affine transformation from this cone to the bisector, though its co-efficients are irrational. In floating-point arithmetic, the origin is mapped to thevertex of the bisector cone and the circle at � � � to a cross-sectional ellipse of the

39

Page 40: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

bisector.

With this parametrization, one line in the cone corresponds to � � �. Any finite�-interval excludes this line and a surrounding region on both sides. The algorithmchooses the position of the � � � line so that it does not lie in the relevant portionof the bisector. There are two cases. First, if the line-plane intersection lies outsidethe face or on the face’s boundary, the � � � line is placed so that the projectionof its “upper half” lies outside the face. The “upper half” is the portion of the linelying on the positive (interior) side of the face-plane. In the second case, the line-plane intersection lies inside the face. Here the � � � line is placed anywhereoutside the domain polytope of the edge.

If the edge and face are coplanar, the bisector is the plane through the edge orthog-onal to the face, and has rational coefficients.

If the edge and face are non-coplanar but parallel, the bisector is a parabolic cylin-der; it can be computed in the following way. Let run along the edge. Let � runacross the face in any direction that is not parallel to ’s direction, so that �� �parametrizes the plane. Construct a point on the bisector by intersecting

� the line orthogonal to the face at �� �;� the planar bisector of the face-point at �� � and the edge-point at .

References

[1] S. S. Abhyankar and C. Bajaj. Automatic parametrizations of rational curves andsurfaces III: Algebraic plane curves. Computer Aided Geometric Design, 5:309–321,1988.

[2] P. K. Agarwal, B. Aronov, and M. Sharir. Computing envelopes in four dimensionswith applications. SIAM Journal on Computing, 26:1714–1732, 1997.

[3] H. Blum. A transformation for extracting new descriptors of shape. In W. Wathen-Dunn, editor, Models for the Perception of Speech and Visual Form, pages 362–380.MIT Press, 1967.

[4] J. S. Brown and J.F. Traub. On Euclid’s algorithm and the theory of subresultant.Journal of ACM, 18(4):505–514, 1971.

[5] J. Canny. The Complexity of Robot Motion Planning. ACM – MIT Press DoctoralDissertation Award Series. MIT Press, Cambridge, MA, 1987.

[6] C.-S. Chiang. The Euclidean distance transform. Ph.D. thesis, Dept. Comput. Sci.,Purdue Univ., West Lafayette, IN, August 1992. Report CSD-TR 92-050.

[7] T. Culver. Computing the medial axis of a polyhedron reliably and efficiently. PhDthesis, University of North Carolina-Chapel Hill, 2000.

40

Page 41: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

[8] T. Culver, J. Keyser, and D. Manocha. Accurate computation of the medial axis of apolyhedron. In Proc. Symposium on Solid Modeling and Applications, pages 179–190,1999.

[9] J. H. Davenport, Y. Siret, and E. Tournier. Computer Algebra: Systems and algorithmsfor algebraic computation. Academic Press, London, 2 edition, 1993.

[10] J. Demmel. LAPACK: A portable linear algebra library for supercomputers. In Proc.of the 1989 IEEE Control Systems Society Workshop on Computer-Aided ControlSystem Design, Tampa, FL, Dec 1989. IEEE.

[11] A. L. Dixon. The eliminant of the equations of four quadric surfaces. Proc. LondonMath. Soc., pages 340–352, 1910.

[12] G. Elber and M. S. Kim. The bisector surface of freedom rational space curves.Technical Report CIS 9619, Dept. Comput. Sci., Technion, 1996.

[13] M. Etzion and A. Rappoport. Computing the Voronoi diagram of a 3-D polyhedronby separate computation of its symbolic and geometric parts. In Proc. Symposium onSolid Modeling and Applications, pages 167–178, 1999.

[14] S. Fortune. Polyhedral modeling with multiprecision integer arithmetic. Comput.Aided Design, 29(2):123–133, 1997.

[15] S. Fortune. A sweepline algorithm for Voronoi diagrams. Algorithmica, 2:153–174,1987.

[16] G. H. Golub and C. F. van Loan. Matrix computations. Johns Hopkins UniversityPress, Baltimore, MD, 2nd edition, 1989.

[17] S. Gottschalk and T. Culver. Intersecting a quadric surface with a box. TechnicalReport TR99-038, University of North Carolina-Chapel Hill, 1999.

[18] LiDIA Group. A library for computational number theory. Technical report, THDarmstadt, Fachbereich Informatik, Institut fur Theoretische Informatik, 1997.

[19] M. Held. On computing Voronoi diagrams of convex polyhedra by means of wavefront propagation. In Proc. 6th Canadian Conference on Computational Geometry,pages 128–133, 1994.

[20] M. Held. Voronoi diagrams and offset curves of curvilinear polygons. Comput. AidedDesign, 30(4):287–300, April 1998.

[21] C. M. Hoffmann. How to construct the skeleton of CSG objects. In A. Bowyerand J. Davenport, editors, Proc. of the Fourth IMA Conference, The Mathematics ofSurfaces, University of Bath, UK, September 1990. Oxford University Press, 1994.

[22] J. K. Johnstone. The sorting of points along an algebraic curve. PhD thesis, CornellUniversity, Department of Computer Science, 1987.

[23] J. Keyser, S. Krishnan, and D. Manocha. Efficient and accurate B-rep generationof low degree sculptured solids using exact arithmetic I: Representations. ComputerAided Geometric Design, 16(9):841–859, October 1999.

41

Page 42: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

[24] J. Keyser, T. Culver, D. Manocha, and S. Krishnan. MAPC: A library for efficientand exact manipulation of algebraic points and curves. In Proc. 15th Annual ACMSymposium on Computational Geometry, pages 360–369, 1999.

[25] S. Krishnan, M. Foskey, J. Keyser, T. Culver, and D. Manocha. PRECISE: Efficientmultiprecision evaluation of algebraic roots and predicates for reliable geometriccomputation. Technical Report TR00-008, U. of North Carolina-Chapel Hill, 2000.

[26] D. T. Lee. Medial axis transformation of a planar shape. IEEE Trans. Pattern Anal.Mach. Intell., PAMI-4(4):363–369, 1982.

[27] J. Little. Personal communication, 2000.

[28] F. S. Macaulay. On some formulae in elimination. Proc. London MathematicalSociety, 1(33):3–27, May 1902.

[29] V. Milenkovic. Robust construction of the Voronoi diagram of a polyhedron. In Proc.5th Canadian Conference on Computational Geometry, pages 473–478, 1993.

[30] P. S. Milne. On the solutions of a set of polynomial equations. In Symbolic andNumerical Computation for Artificial Intelligence, pages 89–102, 1992.

[31] K. Mulmuley. Computational Geometry: An Introduction Through RandomizedAlgorithms. Prentice Hall, Englewood Cliffs, NJ, 1993.

[32] P. Pedersen. Multivariate Sturm theory. In Proc. AAECC, pages 318–332. Springer-Verlag, 1991.

[33] J. Reddy and G. Turkiyyah. Computation of 3D skeletons using a generalizedDelaunay triangulation technique. Comput. Aided Design, 27(9):677–694, 1995.

[34] T. W. Sederberg. Implicit and parametric curves and surfaces for computer aidedgeometric design. PhD thesis, Purdue University, 1983.

[35] T. W. Sederberg and F. Chen. Implicitization using moving curves and surfaces.Proc. International Conference on Computer Graphics and Interactive Techniques,pages 301–308, 1995.

[36] I. Shafarevich. Basic Algebraic Geometry I: Varieties in Projective Space. Springer-Verlag, 2 edition, 1994. Translated by Miles Reid.

[37] D. J. Sheehy, C. G. Armstrong, and D. J. Robinson. Shape description by medialsurface construction. IEEE Trans. Visualizat. Comput. Graph., 2(1):62–72, March1996.

[38] E. C. Sherbrooke, N. M. Patrikalakis, and E. Brisson. An algorithm for the medial axistransform of 3d polyhedral solids. IEEE Trans. Visualizat. Comput. Graph., 2(1):45–61, March 1996.

[39] B. Spain. Analytical Quadrics. Pergamon Press, 1960.

[40] V. Srinivasan, L. R. Nackman, J.-M. Tang, and S. N. Meshkat. Automatic meshgeneration using the symmetric axis transform of polygonal domains. Proc. IEEE,80(9):1485–1501, September 1992.

42

Page 43: Exact Computation of the Medial Axis of a Polyhedrongeom/papers/documents/articles/...tion, and demonstrates the effectiveness of the system. The full algorithm is given in Culver

[41] J. Vleugels and M. Overmars. Approximating generalized Voronoi diagrams in anydimension. Technical Report UU-CS-1995-14, Department of Computer Science,Utrecht University, 1995.

43