TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES

Similar documents
implicit surfaces, approximate implicitization, B-splines, A- patches, surface fitting

INF3320 Computer Graphics and Discrete Geometry

Topology Preserving Tetrahedral Decomposition of Trilinear Cell

Spline Functions on Triangulations

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Adaptive and Smooth Surface Construction by Triangular A-Patches

Physically-Based Modeling and Animation. University of Missouri at Columbia

Construct Piecewise Hermite Interpolation Surface with Blending Methods

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

08 - Designing Approximating Curves

Interactive Shape Control and Rapid Display of A- patches

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Isosurface Rendering. CSC 7443: Scientific Information Visualization

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Geometric Representations. Stelian Coros

Scalar Algorithms: Contouring

On a nested refinement of anisotropic tetrahedral grids under Hessian metrics

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Topological Issues in Hexahedral Meshing

Curves, Surfaces and Recursive Subdivision

Multi-level Partition of Unity Implicits

Computergrafik. Matthias Zwicker. Herbst 2010

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

A new 8-node quadrilateral spline finite element

9. Three Dimensional Object Representations

Using Isosurface Methods for Visualizing the Envelope of a Swept Trivariate Solid

Cover Page. Title: Surface Approximation Using Geometric Hermite Patches Abstract:

Design considerations

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

2D Spline Curves. CS 4620 Lecture 18

ECE 600, Dr. Farag, Summer 09

3D Modeling Parametric Curves & Surfaces

MARCHING CUBES AND VARIANTS

CS 465 Program 4: Modeller

Lecture IV Bézier Curves

CSC Computer Graphics

Normals of subdivision surfaces and their control polyhedra

Intro to Modeling Modeling in 3D

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Computer Graphics Curves and Surfaces. Matthias Teschner

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Central issues in modelling

arxiv: v1 [math.na] 20 Sep 2016

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

13.472J/1.128J/2.158J/16.940J COMPUTATIONAL GEOMETRY

Contouring and Isosurfaces. Ronald Peikert SciVis Contouring 2-1

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

Efficient Representation and Extraction of 2-Manifold Isosurfaces Using kd-trees

The Essentials of CAGD

Information Coding / Computer Graphics, ISY, LiTH. Splines

Geometric and Solid Modeling. Problems

Curves and Surfaces Computer Graphics I Lecture 10

Polygon Partitioning. Lecture03

Implicit Surfaces & Solid Representations COS 426

CS354 Computer Graphics Surface Representation IV. Qixing Huang March 7th 2018

Curves D.A. Forsyth, with slides from John Hart

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

Parameterization of triangular meshes

Direct Rendering of Trimmed NURBS Surfaces

Sung-Eui Yoon ( 윤성의 )

Parameterization. Michael S. Floater. November 10, 2011

Subdivision Curves and Surfaces: An Introduction

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Polygon Meshes and Implicit Surfaces

Ray Casting of Trimmed NURBS Surfaces on the GPU

Polygon Meshes and Implicit Surfaces

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Overview of 3D Object Representations

Normals of subdivision surfaces and their control polyhedra

Volume Illumination, Contouring

Outline. Properties of Piecewise Linear Interpolations. The de Casteljau Algorithm. Recall: Linear Interpolation

Surface Curvature Estimation for Edge Spinning Algorithm *

Adaptive Tessellation for Trimmed NURBS Surface

Polygonization of Implicit Surfaces

Curve Corner Cutting

Curves and Surfaces for Computer-Aided Geometric Design

Near-Optimum Adaptive Tessellation of General Catmull-Clark Subdivision Surfaces

Technical Report. Removing polar rendering artifacts in subdivision surfaces. Ursula H. Augsdörfer, Neil A. Dodgson, Malcolm A. Sabin.

Some Open Problems in Graph Theory and Computational Geometry

Outline. Reconstruction of 3D Meshes from Point Clouds. Motivation. Problem Statement. Applications. Challenges

Flank Millable Surface Design with Conical and Barrel Tools

Kai Hormann, N. Sukumar. Generalized Barycentric Coordinates in Computer Graphics and Computational Mechanics

G 2 Interpolation for Polar Surfaces

Subdivision Surfaces

CS-184: Computer Graphics

11/1/13. Polygon Meshes and Implicit Surfaces. Shape Representations. Polygon Models in OpenGL. Modeling Complex Shapes

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

Geometric Modeling in Graphics

Outline of the presentation

3D Modeling I. CG08b Lior Shapira Lecture 8. Based on: Thomas Funkhouser,Princeton University. Thomas Funkhouser 2000

On the graphical display of Powell-Sabin splines: a comparison of three piecewise linear approximations

BROUWER S FIXED POINT THEOREM. Contents

Interactive Deformation with Triangles

Isotopic Approximation of Implicit Curves and Surfaces (Extended Abstract)

A Flavor of Topology. Shireen Elhabian and Aly A. Farag University of Louisville January 2010

Contours & Implicit Modelling 1

2) For any triangle edge not on the boundary, there is exactly one neighboring

Scientific Visualization Example exam questions with commented answers

Transcription:

TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES Curtis Luk and Stephen Mann University of Waterloo, 200 University Ave W., Waterloo, Ontario, Canada cluk@uwaterloo.ca, smann@uwaterloo.ca Keywords: Abstract: Algebraic surfaces, A-patches, Tesselation. This work approaches the problem of triangulating algebraic curves and surfaces with a subdivision-style algorithm using A-patches. An algebraic curve or surface is converted from the monomial basis to the Bernstein- Bezier basis over a simplex. If the coefficients are all positive or all negative, then the curve or surface does not pass through the domain simplex. If the scalar Bernstein coefficients are of mixed sign and have a layer separating the positive from the negative, then the patch is in A-patch format and can be efficiently tessellated. Cases of mixed sign without a separating layer are resolved by subdividing the structure into a set of smaller patches and repeating the algorithm. Using A-patches to generate a tessellation of the surface has the advantage of reducing the amount of subdivision required. And because of the A-patch properties, we are guaranteed that features within the designated region will not be missed. 1 INTRODUCTION With modern graphics cards, it is possible to render implicit surfaces directly on the GPU without tessellating them. However, tessellation is still one viable method of rendering implicit surfaces, and fast, accurate methods of tessellation remain important. One prevalent method of triangulating implicit surfaces involves the use of subdivision, which is the process of dividing space into regions that can be recursively split into increasingly smaller regions. There are several advantages in using A-Patches to construct a triangular approximation of an algebraic surface, which are the ease in which A-Patches can be evaluated for low degree polynomials and the ease in which points on the surface can be found within an area that is in A-Patch form. Most importantly, it can be shown that a domain that conforms to specific A-Patch configurations has a small number of single-sheeted orientations that can exist within the patch. This removes various ambiguities that could pose problems when evaluating complex surfaces, such as self-intersections and singularities. Some subdivision algorithms require subdomains to be highly subdivided to generate a tessellation with a high sampling rate, which is used to generate a high quality surface approximation. The A-Patch method can finely tessellate surfaces with less use of repeated recursive subdivision of the target space. More importantly, our method will not misclassify multisheeted regions as having a single sheet, nor will it miss small, disconnected components within the region of interest. 1.1 Background An implicit surface in 3-space is the set of all points where F(x,y,z) = 0. If F is polynomial, then the surface is said to be algebraic. The problem of tessellating an implicit surface has been tackled in the past, and such schemes can be classified in one of several categories. Subdivision schemes such as Marching Cubes (Lorensen and Cline, 1987) attempt to find a polygonalization of an implicit surface by dividing the space into a three dimensional grid. The grid cells are further divided to smaller components. This class of algorithm can make the surface extremely costly to evaluate at areas of high precision. Ray casting is another method to generate a polygonalization of an algebraic surface, which is done by finding intersections between lines projected from an origin point and the surface. Although ray casting can tessellate a surface to any arbitrary degree of precision by casting an increasing number of rays, it must rely 82

TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES on alternate methods for detecting anomalies such as self-intersections and singularities. Also, although the method can sample an arbitrary number of points on the surface, ray casting cannot infer the topology of the surface without using a point cloud surface construction algorithm (Wang et al., 2005). There exists another class of approximating algebraic surfaces using piecewise parametric surfaces. Bajaj and Xu propose one such technique (Bajaj and Xu, 1997), with parametric surface patches being grown around pre-computed seed singularities. This method provides the advantage of generating a parametric representation of the surface (as opposed to a piecewise linear approximation) of the surface, although the process involved requires several major steps, including computation of the singularities, direct triangulation, and fitting parametric patches over the triangulation. On the other hand, Jepp, van Overveld, Wyvill, and Wyvill (Wyvill et al., 2000) propose a method combining marching cubes with subdivision surfaces to approximate an implicit surface. This method is capable of generating approximations at real-time speeds, but the accuracy of the surface in relation to the defined algebraic surface is sacrificed as a result. 1.2 Previous Work The concept of the trivariate Bernstein-Bézier basis representation within a tetrahedral volume is not new. Sederberg (Sederberg, 1985) defines such a structure, which he calls an algebraic surface patch, as a tool for modeling free form algebraic surfaces due to its ability to define a wide variety of surfaces with a low degree compared to parametric surfaces and since they inherently define half-spaces, which is useful for modeling solid geometry. Bajaj (Bajaj and Ihm, 1992) proposed using A-patches for fitting surface data and later (Bajaj et al., 1995) proposed a method of building models using piecewise A-patches. Specifically, a set of A-patches is used to construct models that are C 1 continuous and match the topology of the original model specification. A-patches were also proposed for constructing algebraic surfaces (Bajaj and Xu, 1997), although unlike the method presented here it uses the patches as spline surfaces that approximate the algebraic surface as opposed to using A-patch properties to compute points on the surface. The use of subdivision algorithms for tessellating algebraic surfaces is not a recent phenomenon, with Bloomenthal (Bloomenthal, 1988) proposing a tessellation method that relies on repeated subdivision of a domain space and surface-line intersection evaluation. Further, more recent work on subdivisionstyle polygonalization algorithms have been pursued by Belyaev and Ohtake (Ohtake and Belyaev, 2002) on implicit surfaces with sharp features. Unlike previous subdivision methods, our A-patch scheme relies on the tetrahedron as opposed to the cube as a unit space. This is due to the geometric requirements dictated by the structure of the A-patch, although subdividing a tetrahedron is a more difficult task than subdividing a cube. This paper will investigate both the theoretical and implementation aspects of the basic A-patch surface approximation method. We begin with a review of A-patches, after which we present an algorithm for finding a piecewise linear approximation to a 2D algebraic curve. We then generalize the algorithm to tessellate algebraic surfaces in 3D. 2 A-patch BASICS An algebraic surface patch (also known as an A- patch) is essentially a piece of an algebraic surface that is constrained within an arbitrary tetrahedron. The contour of the surface contained within the tetrahedron is determined by the weight of its control points. In A-patch form, the algebraic surface is represented in the Bernstein-Bézier basis. Normally, algebraics are represented as a vector of scalars that corresponds to the monomial basis M n (P) = x a y b z c, where 0 a,b,c and a + b + c = n. The Bernstein- Bézier basis in three-space is ( ) n B i n (P) = p i i 0 0 p i 1 1 p i 2 2 p i 3 3, where i = (i 0,i 1,i 2,i 3 ) with 0 i 0,i 1,i 2,i 3 and i 0 + i 1 + i 2 + i 3 = n and where p 0, p 1, p 2, p 3 are the Barycentric coordinates of P relative to a domain tetrahedron T = ABCD. The A-patch uses the Bernstein-Bézier basis to weigh scalar values in the following relationship: F(P) = C i B i n (P). i The scalar coefficients C i (also called control points) have no location in the space we are interested in, although one can imagine them to be distributed evenly across the triangular domain as Bernstein/Bézier control points of the patch as seen in Figure 1; this visualization will be particularly helpful when talking about the separating layer of control points in the later sections of this paper. For a Bernstein/Bézier representation to be an A-patch, its coefficients must satisfy 83

GRAPP 2009 - International Conference on Computer Graphics Theory and Applications C 020 C 110 C 200 C 011 C 1001 C 101 C 1100 C 1010 C 002 C 0200 C 2000 C 0110 C 0002 C 0011 C 0020 Figure 1: Visualizing the Bézier coefficients in the domain. certain conditions on their signs, as we will discuss in Sections 4 and 5. The two dimensional representation of a polynomial curve in monomial form is similar to its three dimensional surface counterpart. The only difference is that there is one less variable. This means that the monomial basis becomes M n (P) = x a y b, where 0 a,b and a+b = n. The bivariate Bernstein- Bézier basis is ( ) n B i n (P) = p i i 0 0 p i 1 1 p i 2 2, where i = (i 0,i 1,i 2 ) with 0 i 0,i 1,i 2 and i 0 +i 1 +i 2 = n and where p 0, p 1, and p 2 are the Barycentric coordinates of P relative to a domain triangle T = ABC. Standard change of basis algorithms can be used to convert between the monomial and Bernstein representations. Evaluating the algebraic function in Bernstein form at a point in the region can be accomplished by performing a de Casteljau evaluation of the A-patch. de Casteljau s algorithm also subdivides a curve into two sets of control points, each of which is the representation for the curve over a subdomain determined by the evaluation point. de Casteljau s algorithm can also subdivide higher order Bézier functions, although these methods become more complex as the dimension increases. For details on Bernstein- Bézier representations, change of bases, and subdivision algorithms, see (Farin, 2002). 2.1 Conditional A-patches and Application A-patches have six characteristics that are defined by Sederberg in his paper regarding algebraic surface patches (Sederberg, 1985). These come into play when we devise methods to generate tessellations from A-patches. We list the two properties that are most important for our purposes: Point Interpolation Property. F(P) at any of the tetrahedral vertices corresponds to the weight of the control point at that vertex. Line Interpolation Property. If the weights of all the control points along an edge are zero, then the edge interpolates the surface F(P) = 0. More importantly, Sederberg (Sederberg, 1985) (Sederberg and Anderson, 1985) and Guo (Guo, 1995) showed that if monotonicity conditions hold on edge lines of a tetrahedron then all parallel lines will intersect the algebraic surface at most once. Bajaj (Bajaj et al., 1995) elaborates on this by formalizing the concept of the three-sided and four-sided algebraic patch, both of which are shown to be singlesheeted and non-singular. In addition, the algebraic patches Bajaj propose do not require the monotonic conditions outlined by Sederberg, and instead impose restrictions on the signs of the coefficients. We restate Bajaj s definition of three and foursided A-patches: Definition: Three-sided Patch. Let the surface patch S F be smooth on the boundary of the tetrahedron T = e 0 e 1 e 2 e 3. If any open line segment (e j,α ) with α S j = {(α 1,α 2,α 3,α 4 ) T : α j = 0,α i > 0, i j α i = 1} intersects S F at most once (counting multiplicities), then we call S F a three-sided j-patch. Definition: Four-sided Patch. Let the surface patch S F be smooth on the boundary of the tetrahedron T = e 0 e 1 e 2 e 3 ). Let (i, j,k,l) be a permutation of (1,2,3,4). If any open line segment (α,β ) with α (e i e j ) and β (e k e l ) intersects S F at most once (counting multiplicities), then we call S F a four-sided i j-kl-patch. Using the above information we can generate approximations of surfaces and curves with three and four-sided A-patches and their two dimensional equivalent. To find this using just the Bernstein coefficients and the domain tetrahedron, we must find a set of edge points whose weights have opposite signs. From there we can find the point between the pairs where F(P) = 0. Sections 4 and 5 will elaborate on the basic outline provided here. 3 THEOREMS From the basic properties of A-patches we can derive a number of theorems that will be relevant to the A-patch tessellation algorithm. Although Bajaj states conditions for a single-sheeted surface, we must also determine regions that do not contain the surface. The following theorems justify the method to find these regions by finite subdivision of the region and investigation of the coefficients of the empty regions. Theorem 1: Given a d dimensional simplex T = V 0 V 1...V d and a dimension d, degree n polynomial 84

TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES F with Bernstein coefficients C i over T, if C i > 0 for all i then F(p) > 0 for all p T. Proof: This follows immediately from the Bernstein basis functions forming a convex combination over T. Theorem 2: Given a dimension d, degree n algebraic function F whose value is strictly greater than ε > 0 on the interior of a simplex T and where the Bernstein representation of F over T has coefficients of mixed sign. Then over any aligned subsimplex T s 1 of T with edge lengths no greater than of 2 N(2d+2)n /ε the size of those of T, the Bernstein coefficients of F over T s are all non-negative, where N < 0 is the most negative Bernstein coefficient of F represented over T. Proof Sketch: The proof proceeds by considering an arbitrary, aligned subsimplex whose edges are half the length of the initial simplex. We can show that the most negative coefficient of the subsimplex will be at least a fixed amount larger than the most negative coefficient of the initial simplex, where the fixed amount is dependent on ε, d, and n (i.e., it is independent of the Bernstein coefficients). From here, we just find the number of halvings needed to ensure that all the Bernstein coefficients are positive. See (Luk, 2008) for details. Lemma 3: For any set of simplices covering T where each simplex can be embedded in an aligned 1 subsimplex of T of size 2 N(2d+2)n /ε then the Bernstein coefficients of F over each subsimplex will be non-negative. Proof: The lemma follows immediately from the Theorem 2. Comments: The theorems and lemmas also hold for F(p) < 0, F(p) < ε < 0, etc. Also note that Lemma 3 is a very loose bound on the number of subdivisions needed to have all the coefficients be of one sign when working in a region where F(p) > 0; in general, we expect (and observed) much faster convergence than this. While Theorem 1 is a well known simple observation, Theorem 2 and Lemma 3 are new and are a specialized generalization of the property that the Bézier curve control polygon converges to the curve under repeated subdivision. 4 APPROXIMATING ALGEBRAIC CURVES We begin by presenting a method for finding a piecewise linear approximation to a 2D algebraic curve. We assume that the user has selected a region of interest, and that this region has been triangulated. We Figure 2: A possible separating layer in an ideal twopointed A-patch. The white have negative sign; the black have positive sign; the magenta is the separating layer, and the coefficients may have either sign. then find the Bernstein representation for the algebraic function over each triangle. After converting to Bernstein-Bézier format, it is necessary to determine whether each triangle contains the curve. This can be determined by examining the sign of the Bernstein coefficients. If all the coefficients of a triangle are non-zero and of one sign, then the curve does not pass through the triangle (Theorem 1), and the triangle need no longer be considered. Triangles with Bernstein-Bézier coefficients of mixed sign can be categorized into two different classes. The first is what we will refer to as a twopointed A-patch. For a Bernstein representation to be a two-pointed A-patch with domain triangle T = ABC, there must exist a vertex control point (assume it is A for discussion) such that F(A) does not have the same sign as F(B) and F(C). In addition, there must exist a layer of mixed-sign control points that separates a set of positive control points from a set of negative control points, illustrated in Figure 2. See (Bajaj and Xu, 1997) for a more formal definition of an A-patch. If the Bernstein representation is a two-pointed A-patch, then the curve can be approximated within the domain of the patch as described in the next section. Otherwise, we will perform a 4-to-1 subdivision of the triangle. The control points of the four new patches are computed and the search for a separating layer is performed on each subtriangle. In our implementation, we used a 4-to-1 subdivision (Böhm, 1983); however, a 2-to-1 subdivision would produced similar results and would be easier to implement (Peters, 1994). 4.1 Approximating the Curve Let ABC be the domain for a two-pointed A-patch F with a separating layer. In this situation, two of the corner Bézier coefficients will have one sign (e.g., 85

GRAPP 2009 - International Conference on Computer Graphics Theory and Applications Figure 3: Curve properties that are not present in an A-patch with a separating layer. F(A) > 0 and F(B) > 0), and the third coefficient (e.g., F(C) < 0) will have the opposite sign. Because of the separating property, the algebraic function s value at any point on the edge AB will have the same sign as F(A) and F(B). We will sample AB for a sequence of points, P 1,P 2,...,P s, and for each point P i, we consider the line between it and C. Again, because of the separating layer, there is one zero of F along the line segment P i C. A numerical search can quickly find this zero. Our piecewise linear approximation to the curve in this region is made by connecting this sequence points at which F is zero. The single-sheeted properties of the patch will guarantee that by interpolating from one vertex to the other we do not need to consider certain features, such as those seen in Figure 3. Figure 4 shows some examples of implicit curves evaluated in this manner. Lemma 3 ensures that we will eventually stop subdividing in regions that do not contain the curve. However, if there is a singularity in the curve, an A-patch over any triangular region containing this singularity will not have a separating layer. As the algorithm refines in this region, the singularity will become more and more localized, but if the precise location of the singularity is desired, another method must be used to find it. Figure 5 shows the subdivision of space of a curve that has a singularity. Notice the increasing depth of subdivision near the singularity. Also note that subdivision stops fairly quickly in regions not containing the curve, and that away from the singularity, the triangles were in A-patch format at a fairly coarse level, even if the curve just clipped a triangle or if the curve passed through the triangle at unusual angles. 5 TESSELLATING ALGEBRAIC SURFACES We now consider algebraic surfaces. To improve computational efficiency of the surface construction algorithm it is essential to have a good subdivision scheme. Unfortunately, unlike triangles the regular tetrahedron cannot be constructed from a small number of regular tetrahedra, which makes both subdivision and tetrahedron layout non-trivial problems. We chose to abandon the use of regular tetrahedra and worked with axis-aligned grids of cubes, with each cube containing a set of tetrahedra instead. The use of axis-aligned cubes has advantages in making the structure easier to understand and implement, as well as accommodating a reasonable subdivision scheme. We considered two schemes for A-patch layout and subdivision based on the axis-aligned cube. The first method is defined by dividing the cube into five separate tetrahedron, shown in Figure 7, left. This arrangement results in a cube that is created with a minimum number of A-patches. Unfortunately, in this layout adjacent cubes must be placed in a specific way such that the faces of each A-patch are shared with its neighbour otherwise tearing artifacts will appear when the final result is rendered. The second method divides the cube into twelve tetrahedron, outlined in Figure 7, right. This configuration has a couple of advantages, the first being that the faces of every patch along the face of a cube match perfectly with the faces of an adjacent cube s patches, provided that all the cubes follow the same A-patch layout. A second advantage is that the tetrahedron within the cube are of the same size and shape. Finally unlike the previous method there is no requirement for the cubes to be arranged in an octet to guarantee that the patch faces match up, which simplifies the implementation. Unfortunately this method also yields over twice the number of patches than the 5- patch cube over the same domain, which slows down the algorithm by a corresponding amount. Due to the decrease in the number of A-patch computations we decided to use the first method in the final implementation. 5.1 Criteria for Subdivision and Evaluation As with the evaluation of two dimensional A-patches we must determine whether or not the function lies within the domain. Again, by analyzing the pattern of the control points in the patch we can infer various characteristics about it. A-patches with mixed-sign control points fall under one of three categories, two of which are suitable for evaluation. The two ideal patches are outlined by Bajaj (Bajaj and Xu, 1997), which he refers to as three-sided and four-sided A-patches. Both three and four-sided A-patches contain a separating layer of control points similar to that found in the twodimensional case, although in this instance the control points extend in an extra dimension. Three-sided A-patches contain one vertex control point that has 86

TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES Figure 4: Curve approximations generated by the implementation. From upper left clockwise: x 4 +3x 2 y 2 +2y 4 2x 2 +3y 2 + 0.2 = 0, x 4 + 4x 2 y 2 + 4x 2 y 3x 2 + 3y 2 4y = 0, x 4 2x 2 + 2y 2 = 0, and 2x 3 2x 4 y 2 = 0. The right two examples show functions that have areas that cannot be approximated exactly at the point of the singularity. Figure 5: Subdivision near a singularity. Figure 7: A diagram of an axis-aligned cube containing five and twelve A-patches. V 0 v 0 = d+2 2d+2 V 0 +... C = 1 d+1 V 0 +... + 1 d+1 V d v 1 v 2 = 1 2(d+1) V 0 +... V 1 V 2 Figure 6: Variations in curve detail for A-patches containing the input function. a different sign than the other three while four-sided patches contain two pairs of vertex control points that have different signs from each other. Figure 8 shows an example of separating layers for three and foursided A-patches. Note that three-sided A-patches contain triangular-shaped surfaces while four-sided A-patches contain quadrilateral-shaped surfaces. If all the tetrahedron within a cube have entirely positive or negative control points and/or passes the three or four-sided A-patch criteria then it is possible to approximate the surface that passes through the cubic area using the method outlined in the next section. Otherwise we subdivide the cube into eight separate cubes. New Bernstein representations are computed for the tetrahedrons in the subdivided cubes, and the Figure 8: The separating layer of control points in a three and four-sided A-patch. The white have negative sign; the black have positive sign; the magenta is the separating layer, and the coefficients may have either sign. process is repeated until all the patches are in the desired configuration. This may require multiple levels of subdivision. 5.2 Tessellating the Surface Once we have determined which tetrahedron are A- patches, we can generate a piecewise linear approximation of the surface. We will use the same method to determine a zero-set of the implicit function within the domain of the patch as before, although the method for evaluating the surface differs between a three and four-sided patch. The main difference between the two situations lies in the number of points to evaluate and the method in which pivoting points are selected for finding a particular member of the zero-set. In the case of a three-sided patch, we know that F has one sign at three of the corners of the domain 87

GRAPP 2009 - International Conference on Computer Graphics Theory and Applications A D B C C D A B Figure 9: Tessellation of an A-patch: White points form a triangular grid on a face/edge are of one sign; the black point(s) has/have opposite sign. Red points are point on the surface. Each red point is calculated by connecting a white point to the black point and numerically searching for the zero. The green line illustrates this for one point, with the zero on the line being drawn in green rather than red. tetrahedron T = ABCD, and the opposite sign at the fourth corner. Assume that F has the same sign at A,B,C. Since we have a separating arrangement of control points, F has the same sign at all point on the interior of ABC. We setup a triangular grid across this face, and for each point P on the grid, we construct a line to D. The separating arrangement of coefficients ensure that F(P) and F(D) have opposite signs, and further that there is exactly one zero on the line segment PD. Again, we find this zero by a numerical search method. Having found a zero of F corresponding to each point on the triangular grid on triangle ABC, we connect these zero points in the triangular arrangement suggested by the triangular grid. This forms a piecewise linear approximation to F over T. In the four-sided patch case, things differ in that two corners of T = ABCD have one sign (e.g., F(A) > 0, F(B) > 0), while the other two corners have the opposite sign (e.g., F(C) < 0, F(d) < 0). In this case, we uniformly sample both line segments AB and CD, and form all connections between sample points on one edge to the sample points on the other edge. Along each line segment, there will be exactly one zero, which can be found with numerical search. The result will be a rectilinear grid that approximates F over T. The tessellation algorithm for both three and four-sided patches is illustrated in Figure 9. Note that unlike the other figures, in this figure the points are not representative of A-patch control points/coefficients, but instead are actual points in space. Figure 10 show several surfaces that were approximated using the implementation. Note that as described, it is possible that the subdivision of adjacent regions will be at different depths, which can lead to a non-watertight boundary. This in Figure 10: Planar and quadratic surface tessellations generated by the implementation. Clockwise from upper left: x 2 +y 2 +z 2 0.8 = 0, x+y+z+0.2 = 0, x 2 +y 2 z 0.8 = 0, and x 2 y 2 z 0.8 = 0. Magenta shows the tessellation. Figure 11: A comparison between a standard and stitched tessellation. turn can lead to pixel drop-out. We implemented a simple stitching scheme to address this problem (Figure 11) (Luk, 2008). 6 CONCLUSIONS The A-patch method for approximating implicit curves and surfaces is a sound one, both in theory and in practice. The theorems outlined in the Section 3 demonstrate the convergence of the algorithm in domains that do not contain the surface. But although the theory guarantees that we can eventually decide the surface does not exist in regions not containing the surface, so far we have no guarantees that the algorithm will find A-patches for portions of the space that do not contain singularities. However, our test cases show the effectiveness of the method in finding a surface approximation in domains that contain it, strongly suggesting that the method will converge to A-patches for portions of the surface not near sin- 88

TESSELLATING ALGEBRAIC CURVES AND SURFACES USING A-PATCHES Figure 12: Approximating surface singularities to an arbitrary precision using A-patches. The orange box identities an area with a high degree of subdivision. gularities. The big advantage of our algorithm is that for algebraics, it avoids certain problems in tessellating implicit surfaces. In particular, over the region of interest, our algorithm is guaranteed not to misclassify multiple sheets as a single sheet, nor will it miss small disconnected features. Simplices containing such features will not be in A-patch format, and the algorithm will subdivide the region until the multiple sheets are separated, the small disconnect components found, or the maximal subdivision depth is reached (in which case these regions are flagged as special). Like a vast majority of the algebraic approximation methods ours cannot properly identify the singularities of the algebraic surface unless it is coincident with a vertex control point of an A-patch. However, even in the worst case the A-patch method is capable of approximating a singularity point to an arbitrary distance from the point of singularity via subdivision, which gives us an unambiguous surface contour to work on to complete the surface approximation accurately. Figure 12 shows how repeated subdivision of an algebraic surface with a singularity can generate an infinitely close approximation of the singularity without ever finding it. Bloomenthal, J. (1988). Polygonization of implicit surfaces. Computer Aided Geometric Design, 5(4):341 355. Böhm, W. (1983). Subdividing multivariate splines. Computer-Aided Design, 15(6):345 352. Farin, G. (2002). Curves and Surfaces for CAGD. Morgan- Kauffmann. Guo, B. (May 1995). Quadric and cubic bitetrahedral patches. The Visual Computer, Volume 11, Number 5, pages 253 262. Lorensen, W. E. and Cline, H. E. (1987). Marching cubes: A high resolution 3d surface construction algorithm. Computer Graphics, Volume 21, Number 4, July 1987, pages 163 169. Luk, C. (2008). Tessellating algebraic curves and surfaces using A-Patches. Master s thesis, University of Waterloo. Ohtake, Y. and Belyaev, A. G. (December 2002). Dualprimal mesh optimization for polygonized implicit surfaces with sharp features. Journal of Computing and Information Science in Engineering, Volume 2, Issue 4, pages 277 284. Peters, J. (1994). Evaluation and approximate evaluation of multivariate bernstein form on a regularly partitioned simplex. ACM Transactions on Mathematical Software, 20(4):460 480. Sederberg, T. W. (1985). Piecewise algebraic surface patches. Computer Aided Geometric Design, Volume 2, Issues 1-3, pages 53 59. Sederberg, T. W. and Anderson, D. (1985). Steiner surface patches. Computer Graphics and Applications, IEEE, Volume 5, Issue 5, pages 23 36. Wang, J., Oliveira, M. M., and Kaufman, A. E. (2005). Reconstructing manifold and non-manifold surfaces from point clouds. 16th IEEE Visualization 2005 (VIS 2005), page 53. Wyvill, B., Jepp, P., van Overveld, K., and Wyvill, G. (2000). Subdivision surfaces for fast approximate implicit polygonization. REFERENCES Bajaj, C. L., Chen, J., and Xu, G. (1995). Modeling with cubic a-patches. ACM Transactions on Graphics, Volume 14, Issue 2, pages 103 133. Bajaj, C. L. and Ihm, I. (1992). Algebraic surface design with hermite interpolation. ACM Transactions on Graphics, Volume 11, Issue 1, pages 61 91. Bajaj, C. L. and Xu, G. (1997). Spline approximations of real algebraic surfaces. Journal of Symbolic Computation, Volume 23, Issue 2-3, pages 315 333. 89