10
Isotopic Approximation of Implicit Curves and Surfaces (Extended Abstract) Simon Plantinga and Gert Vegter Institute for Mathematics and Computing Science University of Groningen [email protected] [email protected] Abstract Implicit surfaces are defined as the zero set of a function F : R 3 R. Although several algo- rithms exist for generating piecewise linear approx- imations, most of them are based on a user-defined stepsize or bounds to indicate the precision, and therefore cannot guarantee topological correctness. Interval arithmetic provides a mechanism to deter- mine global properties of the implicit function. In this paper we present an algorithm that uses these properties to generate a piecewise linear approxima- tion of implicit curves and surfaces, that is isotopic to the curve or surface itself. The algorithm is sim- ple and fast, and is among the first to guarantee isotopy for implicit surface meshing. 1 Introduction Implicit functions provide a convenient repre- sentation of smooth surfaces. However, piece- wise linear approximations are often required, e.g. for visualization. Meshing algorithms can only compute function values at a finite num- ber of points. Since grid based schemes can miss important detail of the surface, correct topology usually cannot be guaranteed. To capture the global properties of implicit sur- faces, we somehow need to extract information about the surrounding of these points. Lips- chitz conditions give a bound on the gradient and can therefore sometimes discard the neigh- bourhood of a point. Another tool that can be used is interval arithmetic. In this paper we present an algorithm that cre- ates a regularly isotopic approximation for im- plicit curves in R 2 and for implicit surfaces in R 3 . Regularly isotopic means that the approxi- mation is equivalent to the curve or surface un- der continuous deformation within the embed- ding space. In particular, the approximation has the same topology as the implicit manifold. Our implicit surface meshing algorithm subdi- vides space using an octree. Interval arithmetic is used to decide which cells of the octree need to be subdivided further. After the subdivision, for each leaf of the tree a local approximation is constructed. The algorithm given in this paper is similar to other enumeration methods. The interval test that decides which cells need subdivision, is relatively simple. Compared to other enu- meration methods it adds little overhead, and is therefore quite fast. In section 2 we give an overview of the exist- ing techniques for implicit curve and surface approximation. Since our algorithm is based on interval arithmetic, in section 3 we give a brief overview of this technique. Section 4 ex- plains our approximation algorithm for implicit curves. After giving the algorithm, we will prove that the resulting piecewise linear ap- proximation is isotopic to the curve itself. Since both the algorithm and its proof will be gener- alized to the three-dimensional case, this sec- tion also provides an introduction to the mesh- ing of implicit surfaces. In section 5 we pro- vide a first step towards our meshing algorithm, by adapting the well-known marching cubes al- gorithm to construct isotopic approximations. 1

Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

Isotopic Approximation

of Implicit Curves and Surfaces

(Extended Abstract)

Simon Plantinga and Gert Vegter

Institute for Mathematics and Computing Science

University of Groningen

[email protected] [email protected]

Abstract

Implicit surfaces are defined as the zero set of

a function F : R3 → R. Although several algo-

rithms exist for generating piecewise linear approx-

imations, most of them are based on a user-defined

stepsize or bounds to indicate the precision, and

therefore cannot guarantee topological correctness.

Interval arithmetic provides a mechanism to deter-

mine global properties of the implicit function. In

this paper we present an algorithm that uses these

properties to generate a piecewise linear approxima-

tion of implicit curves and surfaces, that is isotopic

to the curve or surface itself. The algorithm is sim-

ple and fast, and is among the first to guarantee

isotopy for implicit surface meshing.

1 Introduction

Implicit functions provide a convenient repre-sentation of smooth surfaces. However, piece-wise linear approximations are often required,e.g. for visualization. Meshing algorithms canonly compute function values at a finite num-ber of points. Since grid based schemes canmiss important detail of the surface, correcttopology usually cannot be guaranteed. Tocapture the global properties of implicit sur-faces, we somehow need to extract informationabout the surrounding of these points. Lips-chitz conditions give a bound on the gradientand can therefore sometimes discard the neigh-bourhood of a point. Another tool that can beused is interval arithmetic.

In this paper we present an algorithm that cre-

ates a regularly isotopic approximation for im-plicit curves in R

2 and for implicit surfaces inR

3. Regularly isotopic means that the approxi-mation is equivalent to the curve or surface un-der continuous deformation within the embed-ding space. In particular, the approximationhas the same topology as the implicit manifold.Our implicit surface meshing algorithm subdi-vides space using an octree. Interval arithmeticis used to decide which cells of the octree needto be subdivided further. After the subdivision,for each leaf of the tree a local approximationis constructed.

The algorithm given in this paper is similarto other enumeration methods. The intervaltest that decides which cells need subdivision,is relatively simple. Compared to other enu-meration methods it adds little overhead, andis therefore quite fast.

In section 2 we give an overview of the exist-ing techniques for implicit curve and surfaceapproximation. Since our algorithm is basedon interval arithmetic, in section 3 we give abrief overview of this technique. Section 4 ex-plains our approximation algorithm for implicitcurves. After giving the algorithm, we willprove that the resulting piecewise linear ap-proximation is isotopic to the curve itself. Sinceboth the algorithm and its proof will be gener-alized to the three-dimensional case, this sec-tion also provides an introduction to the mesh-ing of implicit surfaces. In section 5 we pro-vide a first step towards our meshing algorithm,by adapting the well-known marching cubes al-gorithm to construct isotopic approximations.

1

Page 2: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

Section 6 extends the previous section by us-ing octrees instead of a regular grid, therebygreatly reducing the complexity of both the al-gorithm and the resulting mesh. Finally, in sec-tion 8 we discuss some possible improvementsand changes to our approximation scheme.

Main contribution This paper presents anew algorithm to approximate not necessar-ily algebraic regular implicit curves and sur-faces. For surfaces, it is one of the first schemesguaranteeing that the resulting mesh is iso-topic to the implicit surface. For curves, it isthe first practical algorithm giving this guaran-tee. Both algorithms are fast enough to be ofpractical use, and can easily be adapted to im-prove the accuracy of the approximation and todeal with singularities. We expect that the al-gorithm generalizes to isotopic approximationof all codimension one manifolds in Euclideanspaces.

2 Related work

Several algorithms exist for the approximationof implicit curves and surfaces, but very fewcan guarantee topological correctness. Sincewe can only compute function values at a fi-nite number of points, there is a risk of missingsome important detail of the curve or surface.Some approximation algorithms depend on auser specified value to give a trade-off betweenaccuracy and speed. Algorithms that do guar-antee a topologically correct result depend ei-ther on extra information about the underlyingimplicit function (e.g. algebraicity of surfacesor bounds on the Lipschitz conditions), or oninterval arithmetic.

In this section we will give an overview of thedifferent existing techniques for approximationof implicit curves and surfaces.

Curves The approximation schemes for ap-proximation of implicit curves can be roughlydivided in continuation methods and adaptiveenumeration techniques.

Continuation methods approximate the curveor surface by first finding seed points on all

components, and then using these as startingpoints for tracing these components.In [5] an implicit curve (a contour in R

3)is approximated using a predictor-correctormethod. Initial points are found by shootingrandom rays to the surface. In [11] we adaptedthis method to guarantee topological correct-ness of an approximation of the contour gen-erator, but to achieve this the relatively slowinterval Newton method was required. Also,the guarantee requires a small step size for thetracing process.Approximation schemes based on adaptive enu-meration start with a bounding box and sub-divide until the cells are ‘small enough’, for ex-ample using the local curvature. Then, for eachcell of the subdivided box a local approxima-tion is constructed. In [9] interval arithmeticis used to get a good approximation of implicitcurves. The size of the subdivided cells dependson the geometry of the curve. However, to ter-minate the subdivision process, the method re-quires user-specified bounds on cell size, and onthe variation of the normalized gradient withina cell. Although the edge length varies withthe curvature of the curve, it cannot guaranteetopology.As in this paper, [12] uses parametrizability tosubdivide a quadtree. This algorithm guaran-tees topological correctness, but because of aslightly weaker test for parametrizability, it re-quires a large number of (slow) interval Newtonsearches for intersection points.

Surfaces A continuation algorithm is givenin [7]. Starting with a seed point on the sur-face, a triangulation is generated by expandingover the surface, along the boundary of the tri-angulated part. As with curves, this algorithmdepends on seed points and on a user-specifiedstep size. The triangles of the resulting meshhave more or less the same size, independent ofthe geometry of the surface. An improvementof this algorithm using a dynamic triangle sizeis given in [1].Enumeration methods use either a regular gridor an octree to subdivide space. Regular gridsare used in the well know marching cubes algo-rithm [10]. The main purpose of these methodsis to mesh sampled voxel data, but they can

2

Page 3: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

easily be adapted to approximate implicit sur-faces. In [2], cubes are constructed along thesurface. Although this saves examining a largenumber of grid cells, there is a risk of miss-ing components of the implicit surface. An-other improvement of marching cubes is givenin [6]. The linear variation along an edge usedin marching cubes, is extended to trilinear vari-ation over the cube, using the function valuesat the eight corners of the cube. The algo-rithm guarantees that the approximation hasthe same topology as the isosurface of this tri-linear function. For implicit surfaces there isno such guarantee.

For dynamic surfaces, critical points indicatewhen, where and how the topology changes.This can be used to update the topology of thetriangulation, as in [13]. Also, the shrinkwrapalgorithm [14] can be adapted to use criticalpoints for updating the topology [4].

An algorithm for isotopic meshing based oncritical points is given in [3].

3 Interval arithmetic

One way to prevent rounding errors due to fi-nite precision numbers is to use interval arith-metic. These interval can be considered as avalue, together with an error bound.

An inclusion function �f for a functionf : R

m → Rn computes for each m-dimensional

interval I (i.e. an m-box) an n-dimensional in-terval �f(I) such that

x ∈ I ⇒ f(x) ∈ �f(I)

An inclusion function is convergent if the widthof the output interval converges to 0 when the(largest) width of the input interval shrinks to0.

For example, if f : R → R is the squaring func-tion f(x) = x2, then a convergent inclusionfunction �f([a, b]) is given by

{

[min(a2, b2),max(a2, b2)], a · b ≥ 0[0,max(a2, b2)], a · b < 0

When using interval arithmetic to preventrounding errors, the width of the intervalsshould be as small as possible in order to give

accurate results. We will use interval arith-metic in a different way, and compute functionvalues over large intervals. For example, if thefunction value computed over a large box re-sults in a strictly positive interval, we can con-clude that the function has no zeroes withinthat interval. In other words, the implicit man-ifold does not intersect this box.Convergent inclusion functions exist for the ba-sic operators and functions. To compute an in-clusion function it is often sufficient to replacethe standard number type (e.g. double) by aninterval type, using an appropriate interval li-brary, such as Filib++ [8].

4 Curves

In this section we will introduce an algorithmthat constructs a piecewise linear approxima-tion of an implicit curve S, such that theapproximation and S have the same (regu-lar) isotopy. The construction is based on aquadtree. After subdivision this quadtree isbalanced, i.e. the tree is further subdivided un-til two neighbouring squares differ at most afactor two in size.Possible improvements regarding accuracy andsingularities will be discussed in section 8.Let S = F−1(0) be a bounded implicit curve,where F : R

2 → R is a smooth function and 0is a regular value of F , i.e. the gradient ∇F isnon-zero at every point of the curve. The fol-lowing algorithm constructs an isotopic piece-wise linear approximation of S. Details are ex-plained right after the presentation of the algo-rithm.

Algorithm ApproximateCurve(F, B)Input. An implicit function F , and a square bound-

ing box B.Output. A piecewise linear approximation of the

curve F = 0.1. Initialize a quadtree T to the bounding square

B of F = 0.2. Subdivide T until for all leaves C we have 0 /∈

�F (C) ∨ 〈�∇F (C), �∇F (C)〉 > 0.3. BalanceQuadtree(T )4. for each edge of the quadtree5. do if the signs of F at its two endpoints

are opposite6. then construct a vertex at the mid-

point of the edge

3

Page 4: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

7. for each leaf C of quadtree T8. do if the leaf contains two vertices9. then connect the vertices by a line

segment10. if the leaf contains four vertices11. then find the two vertices on the

same side and connect each ofthem to one of the other ver-tices

Note that a single side of a cell may consistof two quadtree edges, if the neighbouring cellalong that side is subdivided. See Figures 13and 14. Each cell of the quadtree is thereforesurrounded by four to eight quadtree edges.The construction of the approximating edgeshandles only a few different cases of vertexplacement on the boundary of a cell: two ver-tices, or four vertices with two of them alongone side of the cell. In the correctness proof wewill show that these are the only possible cases.Before proving that this algorithm constructsan isotopic approximation, we will show thatthe resulting quadtree cells are parametrizableand prove that the algorithm terminates by ex-amining the interval condition:

0 /∈ �F (C) ∨ 〈�∇F (C),�∇F (C)〉 > 0.

The first clause discards cells where 0 /∈�F (C). Note that this discards boxes of whichwe are certain that they do not contain part ofthe curve S.The righthand clause implies that〈∇F (x),∇F (y)〉 > 0, for all x, y ∈ C.Hence, the direction of the gradient (and,therefore, of the curve) does not change morethan π/2 over C.The curve S is parametrizable in direction v,if every line parallel to v intersects S at mostonce.If 〈�∇F (C),�∇F (C)〉 > 0, at least one ofthe two terms �Fx(C) · �Fx(C) and �Fy(C) ·�Fy(C) (where we write Fx for ∂F

∂x) does not

contain 0. This implies that F is strictly in-creasing or decreasing in the x or y direc-tion, and therefore locally (i.e. within this cell)parametrizable in the direction of one of theaxes.When we continue the subdivision process, thesquares shrink towards a point. Since S is aregular curve, at least one of the two clauses

converges to a non-zero value. Therefore, thesubdivision process terminates.

After these observations we can move on to thefollowing theorem:

Theorem 4.1 The approximation of S con-structed by algorithm ApproximateCurve is(regularly) isotopic to S.

Proof To prove that the approximation is iso-topic to the implicit curve C we will proceed asfollows:

• Firstly, we construct an approximation us-ing a regular grid, assuming that S satis-fies certain constraints, and show that thisapproximation is isotopic to S.

• Secondly, we will remove the contraints onS.

• Finally, we will show that the approxi-mation constructed by the regular grid isequivalent to the one created by Approx-

imateCurve. To this end, we will showthat further subdivision of the quadtreedoes not change the isotopy of the cor-responding approximation. By repeatingthe subdivision process until the quadtreeis complete, we end up with a regular grid.This grid was already shown to be isotopicto the implicit curve.

Regular grid For the first part of the proofwe will start with a grid-based approxima-tion instead of a quadtree. Let G be a reg-ular grid, such that for each cell C we have0 /∈ �F (C) ∨ 〈�∇F (C),�∇F (C)〉 > 0. Fur-thermore we assume that F 6= 0 at the nodesof G, and that S intersects each edge of G atmost once. This implies that we have to con-struct at most one vertex at each edge of thegrid. Due to the inner product constraint, S isparametrizable in the direction of one of theaxes. Therefore we cannot have alternatingsigns of F at the vertices of C, since F wouldhave to increase along one edge, and decreasealong the other parallel edge (Figure 1). Weconclude that S intersects at most two edgesof C. For the approximation we connect thetwo midpoints of these two edges (if any) by astraight line segment s.

4

Page 5: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

Fig. 1: A sign configuration contradicting the innerproduct constraint. F decreases along the top edgeand increases along the bottom edge. It is thereforenot parametrizable in the x-direction. A similarargument holds for the y-direction.

The curve S is locally parametrizable, andtherefore cannot contain closed loops inside acell. Also, since S is a regular curve, there areno self-intersections. This implies that withinthe cell C, if there are two intersection pointsalong the edges, the part of the curve inside Cis isotopic to a line segment.In fact we can easily construct a deformationto move the curve locally to the segment s ofthe approximation. Suppose for example thatS is locally parametrizable in the y-direction,i.e. within the grid cell it is of the form y =f(x). If S intersects the left and right edge,the approximation has the same x-domain asS. By linear interpolation in the y-direction wecan continuously move this part of S to seg-ment s. If S does not intersect the left andright edge, we may need to stretch/shrink thex-domain first. An example is given in Fig-ure 2. By mapping [0, t] linearly to [0, 1

2] and

[t, 1] to [ 12, 1] the intersection point (t, 0) moves

to (1

2, 0). Now, both curves have the same x-

domain, so we can do a vertical interpolationagain. Note that an edge of the grid maps ontoitself. Therefore, we can stitch the local defor-mations within each square together, resultingin a global deformation that moves the wholeimplicit curve to the approximation.

PSfrag replacements

00 11 1

2t

Fig. 2: Deformation of the curve (left) to the ap-proximation (right).

Removing constraints In the second partof the proof we remove the constraints on S.

Suppose S intersects an edge of the grid morethan once. In this case the curve must beparametrizable in the direction perpendicularto this edge, for both adjacent cells. For twoadjacent intersection points α1 and α2 we lookat the curve between these two points. Us-ing the mean value theorem it is easy to seethat the inner product constraint prevents Sfrom bending ‘too much’ (i.e. more than π/2).Therefore, S cannot leave the two cells betweenα1 and α2 (Figure 3). By a local interpolationin the parametrizable direction between S andthe edge, we can continuously deform the partof S between α1 and α2 towards the edge, and‘push’ this part of S through the edge, therebyremoving the two intersection points. Sincewe can continue removing pairs of intersectionpoints, S is isotopic to a curve that intersectseach edge at most once, and hence it is isotopicto the piecewise linear approximation.

PSfrag replacements

α1α1 α2α2

Fig. 3: Multiple intersection along an edge. Thecurve on the right has too much curvature to satisfythe interval constraint.

If S passes through a node of the grid, we canagain deform S, this time by moving it contin-uously to F + ε = 0. For small ε this againyields an isotopy. We can take ε arbitrarilysmall using a symbolic perturbation, by con-sidering F to be strictly positive at a vertexwhenever F ≥ 0.

Quadtrees Now that we have removed theconstraints on F we complete the proof byshowing that the quadtree approximation isisotopic to the grid approximation. To thisend, we consider a leaf C of the quadtree T , to-gether with its approximation edges. When wesplit C, the inner product constraint still holdsfor its four children. Furthermore, since S isparametrizable within C, S is parametrizablein its children, and also in the same direction.The only topological changes can therefore oc-cur if subdivision introduces two new vertices

5

Page 6: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

at a single edge of C, as shown in Figure 4.

Fig. 4: Topological changes after subdivision

Since two new vertices were created, the neigh-bouring cell along the edge containing thesevertices is not subdivided. After subdivisionof C, the neighbouring cell will detect the twonew vertices and connect them either to eachother or to two existing vertices. Both typesof change correspond to ‘pushing’ part of thecurve through the edge. In the union of thecell and its neighbour the approximation is iso-topically unaltered.By subdividing the leaves of T we can turn itinto a complete quadtree, with the same ap-proximation as a regular grid. Since this doesnot change the isotopy of the approximation,the output of algorithm ApproximateCurve

is isotopic to S.

5 Marching cubes revisited

For the meshing of implicit surfaces we pro-ceed similarly to the two-dimensional case. Asa first step towards our meshing algorithm, weapproximate the surface on a regular grid, as-suming only single intersections on the edges.Later, we remove these constraints. In the nextsection we will present our meshing algorithm,using a balanced octree instead of a regulargrid.In this section we introduce a slightly modi-fied version of the well-known marching cubes(MC) algorithm. Recall that MC subdividesspace into a uniform cubic grid, constructinga triangulation for each cell of the grid, de-pending only on the function sign at its eightvertices1. The MC algorithm as introduced by

1Sometimes the function value at the vertices is used

to place a vertex by linear interpolation. Since our main

goal is topological correctness we will just put the vertex

at the centre of the edge.

Lorensen and Cline [10] cannot guarantee topo-logical correctness. Due to ambiguities in thesign configuration of a cell face, the resultingsurface could also contain holes. To fix theseproblems we will introduce a few assumptions,most of which can later be removed.

Let S be a regular, bounded, implicit surface,given as the zero set of a smooth functionF : R

3 → R, so S = F−1(0). Furthermore, weassume that 0 is a regular value of F , i.e., thegradient ∇F is non-zero at every point of thesurface.

For now, we will assume that S does not con-tain vertices of the uniform grid, and that Sintersects each edge of the grid at most once.Furthermore, the following interval conditionshould hold for each cell C:

0 /∈ �F (C) ∨ 0 /∈ 〈�∇F (C),�∇F (C)〉.

As in the 2-dimensional case, the righthandclause implies:

∀x, y ∈ C : 〈∇F (x),∇F (y)〉 6= 0.

Again we have that for each cell where 0 ∈�F (C) the surface S is parametrizable in thedirection of one of the axes.

For the signs at the vertices, there are 14 pos-sibilities (up to rotation, mirroring and changeof sign), shown in Figure 5.

PSfrag replacements

1 2 3 4 5

6 7 8 9 10

11 12 13 14

Fig. 5: The 14 possible sign configurations.

Configurations 5, 8, 12, 13 and 14 are impossi-ble, due to the interval condition. For examplein configuration 5 (see Figure 6), on edges cdand ef the function changes sign in oppositedirections. Therefore, F is not parametrizablein this direction. For ad, fg and for bf , dh we

6

Page 7: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

find that F is not parametrizable in the direc-tion of the other two axes, contradicting theinner product condition.For configurations 8, 12 and 14 a similar argu-ment holds. For configuration 13 we have tolook at the diagonal pairs (ac, eg), (bd, fh) and(ae, cg), and note that the inner product condi-tion does not depend on a particular coordinatesystem.

5

PSfrag replacements

a b

cd

e f

gh

Fig. 6: Configuration 5.

The remaining 9 configurations can now be tri-angulated. Two of these still contain an am-biguity (case 4 and 6 in Figure 7). To resolvethis, note that the ambiguity is due to the signconfiguration on a face of the cell. In bothcases we have a single face where the functionchanges sign along all of its four edges, result-ing in four vertices of the triangulation. Thereare two ways to connect these vertices pairwise.We will choose to connect them, such that theresulting segments are parallel to one of thevectors (1, 1, 0), (1, 0, 1) and (0, 1, 1), depend-ing on the orientation of the face. This choiceguarantees that the individual triangulations oftwo adjacent cells fit together. We have to showthat this choice does not affect the isotopy.

PSfrag replacements

1 2 3 4a 4b 5

6a 6b 7 8 9

Fig. 7: Triangulation of the subcubes.

Since cells have at most one ambiguous face, weregard the block of two cubes adjacent to sucha face (see Figure 8). Note that the border ofthe union of these two cubes does not containambiguities. The sign changes along the edgesof the shared face prevent a parametrization inthe direction of one of these edges. Both cubes

are therefore parametrizable in the vertical di-rection. Since the vertical component of thegradient does not disappear, the union of thesetwo cells is also parametrizable in the verticaldirection. This leads to only three possibilitiesto join two ambiguous cells, shown in Figure 8.

Fig. 8: Two cubes sharing an ambiguous face: twotype 4 cells, a type 4 and a type 6 cell, and twotype 6 cells.

For the ambiguous face we have two ways toconnect the vertices on the edges pairwise.Both possibilities are shown in Figure 9. Sinceboth choices lead to the same isotopic approx-imation, we can choose either of them, as longas the triangulations for both cells fit together.

Fig. 9: The two different triangulations of the threeambiguous cell combinations.

If the surface intersects the grid-faces in seg-ments connecting the intersections of S withthe edges of the grid, we are done. However, itis possible that S intersects a face of the gridin a closed curve, lying completely withing thatface (Figure 10). In this case both cubes adja-cent to this face must be parametrizable in thedirection perpendicular to this face. Also, the‘bubble’ does not leave the cube on the oppositeface, since that would require the gradient tochange more than π/2 (see also Figure 3). Bylinear interpolation we can continuously flat-ten the bubble towards the face, and push itthrough this face, thereby removing the inter-section loop.

7

Page 8: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

Fig. 10: Surface S intersects a face of the regulargrid in a closed loop.

As in the two-dimensional case we have to re-move the constraints on the function. The casewhere the surface passes through vertices of thegrid can be handled as with implicit curves, i.e.by considering F to be strictly positive when-ever F ≥ 0.

Now assume that S intersects an edge e of thegrid more than once, say at two consecutivepoints α and β (Figure 11). Since F changessign at α and at β, there is a point p between αand β where ∇F (p) is perpendicular to e. Thisgradient lies inside the gradient cone of all fourcubes adjacent to e. (Due to the interval con-straint all gradients over a cell lie within a conewith top angle π/2.) Therefore, in the union ofthese four cubes, the surface is parametrizablein this direction. Consider the plane through ein the direction of ∇F (p). Each of the two half-planes bounded by e intersect one of the cubes.Since ∇F (p) lies inside the cone of gradientsof this cube, the projection of ∇F (x) does notchange more than π/2 for x in the intersectionof this half-plane with the cube. Therefore inone of these two half-planes, the intersectionwith S consists of a connected curve betweenα and β. By linear interpolation in direction∇F (p) between this curve and e we can removethe pair α, β.

After removing all pairs of edge intersectionswe have continuously deformed the surface toone with only single edge intersections, forwhich the grid triangulation was shown to becorrect.

We conclude that, the triangulation of the reg-ular grid is isotopic to the implicit surface.

6 Octrees

In the previous section we have shown thata regular grid satisfying an interval constraintcan be used to create an isotopic approxima-

PSfrag replacements α

β

p∇F (p)

Fig. 11: Surface S intersects an edge of the regulargrid more than once.

tion of an implicit surface. In this extendedabstract we give a brief overview of how a bal-anced octree can be used to create an isotopicmesh.

The subdivision process is identical to the two-dimensional case. Starting with an octree ini-tialized to a bounding box B, we subdivide theleaves until for each leaf C we have

0 /∈ �F (C) ∨ 〈�∇F (C),�∇F (C)〉 > 0.

After the subdivision process, we balance theoctree.

Once we have constructed the octree, we canconstruct the approximation. First we put ver-tices at the center of each edge of the octreethat has opposite function signs at its end-points. Then, for each face of the octree weconnect these vertices pairwise with segments.For each cell of the octree, these segments formclosed chains on the boundary of the cell. If wehave two nested loops, we connect these twoloops with triangles, resulting in an annulus(Figure 12). Otherwise, we close each loop withtriangles, constructing a disk for each chain ofedges.

Fig. 12: The top face indicates the only case wheretwo nested loops occur, resulting in an annulus.All other configurations are triangulated as a setof disks.

In the full paper we give the details of how toresolve ambiguities when connecting the ver-tices with segments. We also show that furthersubdivision does not change the isotopy. As in

8

Page 9: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

the two-dimensional case this implies that theoctree mesh is isotopic to the implicit surface.

7 Results

Figure 13 and 14 show two examples of thecurve approximation algorithm. The quadtreeis also shown in the images. Both examplestook 0.04 seconds to compute.

In Figures 15, 16 and 17, three examples of im-plicit surface approximation are shown. Thealgorithm was implemented in gcc. The ta-ble below shows the number of leaves in theoctree before and after subdivision, the num-ber of triangles in the mesh, and the runningtime in seconds on a Pentium 667 MHz, run-ning Linux.

Surface Octree Balanced Triangles Time

Tangle 24648 24816 8704 0.8

Chair 232072 233402 43014 6.2

Bear 497596 688794 366746 113.0

Fig. 13: Implicit curve approximation of f(x, y) =x2(1 − x)(1 + x) − y2 + 0.01

8 Improvements

Both algorithms use balanced trees. This bal-ancing is not necessary for an isotopic result.Although the approximation for the leaves be-comes more complicated, removal of the bal-ancing would produce a slightly smaller ap-proximation.

The octree based approach allows for local up-dates if S changes only locally, for examplewhen using blobs or metaballs. For example,

Fig. 14: Implicit curve approximation of f(x, y) =x2 − xy + y4 + 0.0001

Fig. 15: Tangle cube f(x, y, z) = x4 − 5x2 + y4 −5y2 + z4 − 5z2 + 10

adding a single metaball does not change theimplicit function outside the influence regionof the metaball. Therefore, we only need toremesh the part of the octree intersecting thenew metaball.

Although the resulting approximation is iso-topic to S, is does not have to be close in termsof Hausdorff distance. To get a closer approx-imation the algorithm could be extended bysubdividing cells where 0 ∈ �F (C) to a givenminimal level.

For curves or surfaces containing singularities,the subdivision does not terminate. By usinga maximum depth for the subdivision level wecan mesh these curves and surfaces. Althoughthe isotopy close to a singularity is not guar-anteed, this results in an isotopic approxima-tion outside arbitrarily small bounding boxes

9

Page 10: Isotopic Approximation of Implicit Curves and Surfaces ...exact/pap/mesh/vegter/isotopic-meshing.pdfthe same topology as the isosurface of this tri-linear function. For implicit surfaces

Fig. 16: Chair f(x, y, z) =(

x2 + y2 + z2 − ak2)2

b(

(z − k)2 − 2x2) (

(z + k)2 − 2y2)

, for k = 5, a =0.95 and b = 0.8

Fig. 17: An implicit teddy bear together with itsapproximation. The bear consists of 48 metaballs.

around the singular points.

The algorithm can also be used for unboundedcurves and surfaces. Recall that the undetectedparts of the curves and surfaces cannot piercethrough opposite edges or faces of a cell. Bymaking the initial bounding box larger than thearea of interest, and discarding the outer cellsafterwards, we can construct an isotopic ap-proximation for an unbounded manifold withina given box.

References

[1] Samir Akkouche and Eric Galin. Adaptive im-plicit surface polygonization using marchingtriangles. In D. Duke and R. Scopigno, edi-tors, Computer Graphics Forum, volume 20(2),pages 67–80. Blackwell Publishing, 2001.

[2] Jules Bloomenthal. Polygonization of implicit

surfaces. Computer Aided Geometric Design,5:341–355, 1988.

[3] J.D. Boissonnat, D. Cohen-Steiner, andG. Vegter. Meshing implicit surfaces withcertified topology. Technical report, INRIA,Sophia Antipolis.

[4] A. Bottino, W. Nuij, and K. van Overveld.How to shrinkwrap through a critical point:an algorithm for the adaptive triangulation ofiso-surfaces with arbitrary topology. In Proc.Implicit Surfaces, pages 55–72, 1996.

[5] David Bremer and John F. Hughes. Rapid ap-proximate silhouette rendering of implicit sur-faces. In Proc. Implicit Surfaces, 1998.

[6] Evgeni V. Chernyaev. Marching cubes 33:Construction of topologically correct isosur-faces. Technical Report CERN CN 95–17,1995.

[7] Erich Hartmann. A marching method for thetriangulation of surfaces. The Visual Com-puter, 14(3):95–108, 1998.

[8] M. Lerch, G. Tischler, J. Wolff von Gudenberg,W. Hofschuster, and W. Kramer. Filib++interval library. http://www.math.uni-wuppertal.de/wrswt/software/filib.html.

[9] H. Lopes, J. B. Oliveira, and L. H.de Figueiredo. Robust adaptive polygonal ap-proximation of implicit curves. Computers andGraphics, 26(6):841–852, 2002.

[10] William E. Lorensen and Harvey E. Cline.Marching cubes: A high resolution 3d surfaceconstruction algorithm. In Proceedings of the14th annual conference on Computer graph-ics and interactive techniques, pages 163–169.ACM Press, 1987.

[11] Simon Plantinga and Gert Vegter. Contourgenerators of evolving implicit surfaces. InProceedings of the eighth ACM symposium onSolid modeling and applications, pages 23–32.ACM Press, 2003.

[12] John M. Snyder. Interval analysis for computergraphics. Computer Graphics, 26(2):121–130,1992.

[13] Barton T. Stander and John C. Hart. Guar-anteeing the topology of an implicit surfacepolygonization for interactive modeling. InProceedings of the 24th annual conference onComputer graphics and interactive techniques,pages 279–286. ACM Press/Addison-WesleyPublishing Co., 1997.

[14] C.W.A.M. van Overveld and B. Wywill.Shrinkwrap: An adaptive algorithm for poly-gonizing an implicit surface. Technical Report93/514/19, University of Calgary, March 1993.

10