Boolean Operations With Supershapes
Yohan Fougerolle
1,2∗, Andrei Gribok
1, Sebti Foufou
2, Frédéric Truchetet
2, and Mongi A. Abidi
1 1IRIS Lab. - University of Tennessee
2Le2i - CNRS - Université de Bourgogne
334 Ferris Hall - Knoxville, TN, 37996
12 rue de la fonderie - 71200 Le Creusot
USA
France
Abstract
In this paper, we present an efficient algorithm to compute multiple regularized boolean operations with globally deformed supershapes. The input is a Constructive Solid Geometry Tree (CSG-Tree) that contains the regularized boolean operations (Union, Intersection and Difference), the parameters of the supershapes, and the global deformations. The output is an implicit equation and the resulting surface is the locus where the implicit function sign changes. Solutions for this equation are explicitly generated using the supershape parametric representation which means all the points generated are lying exactly on the final surface. Depending on the chosen R-function, this equation is continuous and differentiable everywhere. The proposed approach has many potential applications ranging from mechanical engineering to shape recognition and data compression.
1
Introduction
A common research area between computer graphics and computer vision deals with the representation, the analysis, and the combination of various shapes to provide better accuracy, more compactness and to increase the ease of use of primitives and algorithms needed to model shapes always more complex. Developments in these representations are not only interesting from a mathematical point of view, but also have become necessary for technological improvements and are widely used in many applications as for example in the automotive and airplane industries, in architecture, in medicine, in mechanical engineering or in the advertising sector. Computer aided geometric design, which is mainly based on geometry, applied mathematics and computer science, provides the necessary algorithms for the required curve and surface representations. In the field of solid modelling, two complementary approaches can be considered, one dealing with the primitives and their properties and the other studying the possible ways to efficiently combine them.
1.1
Compact and Accurate primitives
Two methods for curve and surface representation can be distinguished, namely the representation by implicit versus para-metric equations.
Parametric representations use a map (parameterization) to completely describe curves and surfaces. In most cases, Bern-stein polynomials and B-spline basis functions are used for the representation of the polynomials yielding the so-called (Bernstein-) Bézier respectively B-spline curves and surfaces. In both cases, these representations are easily converted one into the other. Rational B-splines are commonly referred to as NURBS (Non Uniform Rational B-Splines) and we refer the reader to [1] for further information. Rational parametric curves and surfaces - including polynomial ones as special cases - may be converted to implicit algebraic forms by implicitization techniques. Last case to be considered is subdivision surfaces where a coarse initial mesh is refined to converge to a limit surface. Until Stam’s work [2] it was believed that a subdivision surface did not admit an exact parametric representation everywhere. Stam shows that a subdivision surface
can be represented by a set of eigenbasis functions everywhere and unifies two important shape representations: polygonal meshes and parametric surfaces. One of the most useful characteristic of parametric representation is that vertices but also normals, tangents or even curvatures can be computed directly (if differential properties are guaranteed). Due to the very useful geometrical relation between the curve itself and its control mesh the Bézier, B-spline and subdivision surfaces are easy and natural to handle and have thus become the standard for representation in the current commercial CAD systems.
The implicit method of representing surfaces uses a single-valued function of multiple variables. The surface is the locus of points for which the function has some constant value. The implicit representation is well-suited for a special form of geometric modeling, so-called solid modeling. There exist many methods ranging from skeletal based approach, distance function, algebraic surfaces to partial differential equations. We focus on quadric surfaces and their extension because many solid modeling systems are based on quadric primitives and include planes, spheres, right circular cylinders and right circular cones, but also more complex-shaped quadrics such as ellipsoids, hyperboloids and paraboloids . Quadric surfaces also find applications in the area of image processing, and in the context of computer graphics they have been generalized to so-called superquadrics. Superquadrics introduced by A.H. Barr [3, 4] have been used as a quantitative model for various applications in computer environments, both in computer graphics and in computer vision [5, 6, 7]. Many works have been done to increase the degrees of freedom of superquadrics: Löffelmann et al. deal with parameterization [8], DeCarlo et al. and Tigges et al. blend multiple models [9, 10] and free form deformations are considered by Bardinet et al. [11, 12]. Other methods include hyperquadrics [13], ratioquadrics [14] and more recently, Zhou et al. considered a function instead of a fixed number as exponent in the superquadrics equation [15]. If superellipses have been proved to be very useful and convenient by their compactness and their both parametric and implicit representations, they fail to easily represent simple polygons despite the techniques proposed to increase their degrees of freedom. The problem of the orthogonal system of coordinates of superquadrics has recently been overcome by the supershapes - presented as superquadrics with rational or irrational symmetry - proposed by Gielis et al. [16, 17]. Derived from superellipses formulation, the representation is slightly different from superquadrics, but an implicit representation can be deduced from the parametric form proposed by Gielis, which preserves both the implicit and parametric representations.
1.2
Solid modelling and boolean operations
Solid modeling deals with the design and representation of physical objects. The notion of solid modelling appeared in the early 1970’s, in response to very specific needs for informational completeness in mechanical geometric modelling systems and to transfer schematics, graphs and drawings from books into computers. This important notion has been promoted largely through Requicha’s work [18] and mathematical foundations to combine implicit functions have been proposed in R-functions theory by Rvachev [?]. One of the main emphases of solid modeling has been on the consistency of models generated where boolean operations, such as regularized unions, intersections and differences, play a fundamental role. Boolean operations are a natural way of constructing complex solid objects out of simpler primitives and are used in various applications in mechanical engineering, computer graphics, robotics, and computer vision. Two major approaches are used in solid modelling: constructive solid geometry (CSG) and boundary representations (B-Rep). Both of these representations have different inherent strengths and weaknesses, for example, a CSG object is always valid in the sense that its surface is closed, orientable and encloses a volume. A B-Rep object does not necessarily have these properties, but CAD object design and rendering are easier with this model. The properties of the object also heavily depend on the primitives used: implicit functions turn to be easier to combine than parametric representations but can not be displayed as simply. Recently, Rappoport et al. proposed a method for interactive display of CSG models using widely available graphics hardware[19]. Wyvill et al. proposed the BlobTree, a structure to combine boolean operations, deformations and models that are defined with a skeletal implicit surface system (Blinn Objects) [20]. Biermann et al. proposed a method to model free-form solids using subdivision surfaces [21]. Properties of the proposed algorithms - such as speed, accuracy, easiness of use and implementation - heavily depend on the nature of the considered primitives. Methods using implicit functions usually provide simple solutions for boolean operations but the resulting implicit surface has to be polygonized using classical Marching Cubes-like techniques which only provide an approximation of the desired solutions but no explicit formula. On the other hand, techniques using parametric surfaces directly generate points lying exactly on the surface (an higher order derivatives), but they have a higher time complexity due to the need for a "Face-To-Face" intersection algorithm and additional pre-processing steps.
1.3
Contributions
Based on supershape representation and R-functions theory, our approach - keeping most of advantages of implicit and parametric representations - provides an implicit equation whose zero-set represents the resulting surface and a parametric domain for generating the solutions of this equation. The implicit formulation reduces the algorithm time complexity used to evaluate the parts that must be kept from every primitive. All the points created in the resulting mesh lie exactly on the surface, and approximation is only made on the frontiers of the parametric domain for the solutions.
The contributions of this paper are an extension of the literature in solid modeling by the use of recent and versatile primitives and an efficient algorithm based on R-functions to compute multiple boolean operations with globally deformed supershapes characterized by its low time complexity and its accuracy: Boolean operation between two primitives is linear in the number of vertices considered and the points of the generated mesh are lying exactly on the surface defined by the zero set of the resulting R-function .
1.4
Outline
The rest of the paper is organized as follows: Section two presents R-functions and important properties. In the third section we present supershapes and the global deformations considered in this paper. We present in more details our algorithm in section four. The fifth section gives and analyzes some experimental results. In the sixth section we discuss our assumptions and hypothesis. The final section presents our conclusions and future work.
2
R-Functions and their properties
The theory of R-functions was developed by V.I. Rvachev in the 60’s [22] . Although the theory was primarily aimed at solving the inverse problem of analytical geometry it subsequently found numerous applications in mathematical physics, optimization, pattern recognition and other areas of applied as well as pure mathematics. In this paper we are specifically interested in applications of the R-functions theory to the inverse problem of analytical geometry. The forward problem of analytical geometry is to study the properties of curves and surfaces with known analytical equations such as lines, circles, parabolas, planes and spheres. The inverse problem is to deduce an analytical description (formula) of a geometrical object having its drawing. Such problem was solved using different methods only for the simplest objects. However difficulties that had been encountered seemingly left little hope for the solution of this problem in general settings and for arbitrary objects and shapes. All those efforts were focused on curves and surfaces which can be represented by a polynomial equation and most results had been obtained for polynomials up to the second order relegating curves and surfaces of higher orders to the special literature. In [23, 24] Rvachev showed that combining Boolean algebra - and more general n-values algebra with a set of functions which is only slightly richer than polynoms - the inverse problem of analytic geometry can be solved in general. By solving the problem we mean that an arbitrary shape can be described by a single analytical equation f = 0 or inequality
f ≥ 0 which would be satisfied only on the borders or in the interior of the object respectively. Additionally the resulting
function would be differentiable a given number of times. The theory of R-functions is based on the set theory and Boolean algebra. To introduce R-functions lets start with a Euler diagramm presented in Fig.1(a).
(a) Euler Diagram composed by 3 circles (b) Boolean Quadrants
The shaded area can be represented by the following Boolean function performed for each point of circles CO, CA, and CBcentered respectively at O,A and B.
D = CO∨ (CA∧ CB) (1)
Assuming that zero has a plus or minus sign we can introduce the following predicate that maps a real variable x into a Boolean variable depending on its sign.
S (x) = 1
2(1 + sign (x)) (2)
Let’s the inequalities: f1(x, y) ≥ 0, f2(x, y) ≥ 0 and f3(x, y) ≥ 0 define the areas CO, CA, and CB respectively.
Note that these inequalities hold only in the interior points of the corresponding areas and equations hold on their borders. Substituting these inequalities into equation (1) using predicate (2) we obtain the predicate equation :
F (S(f1(x, y)), S(f2(x, y)), S(f3(x, y))) = 1 (3a)
or
S(f1(x, y)) ∨ (S(f2(x, y)) ∧ S(f3(x, y))) = 1 (3b)
where F is a boolean function and fiin (0,1)
These predicate equation defines the same area as equation (1). Predicate equations are an important intermediate step towards analytical formulas of geometrical shapes. Using predicate (2) we can now introduce R-functions. Every nondegen-erative(??) point on a plane having coordinates (x,y) can be mapped into a set of Boolean variables X, Y by
X = S(x), Y = S(y)
Notice that there are four different combinations of two Boolean variables (for couples (0,0), (0,1) , (1,0), (1,1)). It means that each real valued point on the plane can be mapped into one of these combinations of Boolean variables. Notice that four different combinations of Boolean variables define four different quadrants on the plane as shown in Fig. 2
A function f (x, y) which has a constant sign in each of the quadrants is called an R-function. That is for R-function
S(f (x, y)) = F = constwhere F is a Boolean variable
Notice that every Boolean combination X,Y in Fig.1(b) corresponds to a unique quadrant and hence a Boolean variable
F , so we can write
S(f (x, y)) = F (S(x), S(y))
The link with solid modeling appears more clearly when considering that every solid can be represented by a real-valued function. The zero-set of this function usually represents the surface of the object and positive values describe its exterior (or its interior, depending on the conventions adopted). In other words, in its simplest and most commonly used form, a function
f may be used as a characteristic function for a point set to distinguish if a point P is belonging to the set or not, simply by
considering the sign of f (P ). As a binary variable, sign can be treated as a Boolean variable (true, false). We refer the reader to [?, 25] for discussions about the zero case and its membership to one partition or both. Theory of R-functions [?, 25] provides an algorithmic method for constructing functions that exactly represent virtually any geometric shape of interest in engineering. It is shown in Rvachev’s book [?] that an infinite number of R-functions correspond to every Boolean function. Just as any logical function can be written using only three operations ¬, ∨, and ∧, every R-function may be written as a composition of the three corresponding elementary R-functions. Many functions have been proposed to describe boolean union, intersection and negation. Differential properties of the three most common branches of functions are studied in [26].
2.1
Properties of R
αRα: 1
1 + α ³
x + y ±px2+ y2− 2αxy´where α(f
1, f2) is an arbitrary symmetric function such that −1 < α(f1, f2) ≤ 1
(4) Setting α to 1 leads to the simplest and more popular R-functions: R-conjunction min(x,y) and R-disjunction max(x,y). Unfortunately, these functions are not differentiable along the line x=y. Two other solutions are proposed to solve the loss of these differential properties.
2.2
R
0mand R
p: an improvement for R
αdifferential drawbacks
To solve the loss of differentiability along the line x = y two other functions Rm0 and Rpare proposed. Rm
0 :
³
x + y ±px2+ y2´ ¡x2+ y2¢m2where m is any even positive integer (5)
Shapiro shows in [26] that Rm0 is m times differentiable everywhere, including the corner point x = y = 0 and all partial derivatives are identically zero. But Rm0 is not normalized. Normalization is achieved by Rpfunction which is normalized
but not differentiable at the corner point x = y = 0.
Rp: x + y ± (xp+ yp)
1
pfor any even positive integer p (6)
2.3
N-ary R-functions
Each of the Rα, Rm0, and Rpfunctions have their own strengths and weaknesses and are defined to handle two arguments.
More than two arguments can be handled by the following "chain" functions:
i=n^ i=1 (m) xi≡ n X i=1 (−1)mxm i (xi− |xi|) + n Y i=1 xm i (xi+ |xi|) i=n_ i=1 (m) xi≡ n X i=1 xm i (xi+ |xi|) − n Y i=1 xm i (−1)m(xi− |xi|)
for any m integer
(7)
Negation properties are also conserved and we have:
i=n^ i=1 (m) xi≡ i=n_ i=1 (m) xi i=n_ i=1 (m) xi≡ i=n^ i=1 (m) xi (8)
These chain functions can be used to decrease the depth of the CSG Tree and therefore can turn the time complexity for a node from O (n log n) to O (n) where n is the number of primitives. An example of CSG Tree simplification using chain functions is shown in Fig.2.3. Finally, using these functions allows to define a very simple CSG Tree composed by the difference of two subtrees. The first subtree is the union of all the parts used to model the body and the hull of the object. Each primitive can be defined as multiple intersecting other primitives. The second subtree is the union of all the parts to be extracted and parts can be represented as multiple intersecting primitives.
(a) Final Object. (b) A possible decomposition. (c) A binary CSG Tree. (d) A N-ary CSG Tree.
3
Supershapes and global deformations
Supershapes have been recently presented by Gielis [16, 17] as an extension of superquadrics. Deriving from the superellipse representation, a term mφ4 , m ∈ R+, is introduced to allow a rational or irrational number of symmetry. Three shape coef-ficients n1, n2, n3are considered and by setting n26= n3asymmetrical shapes can now be generated. In polar coordinates,
the radius r of a superpolygon is defined by the equation 9.
r (φ) = 1 n1 r¯ ¯ ¯1acos ³ mφ 4 ´¯¯ ¯n2+ ¯ ¯ ¯1bsin ³ mφ 4 ´¯¯ ¯n3
with a, b, and ni∈ R+and m ∈ R+∗ (9)
Parameters a > 0 and b > 0 control the size of the polygon, m ≥ 0 defines the number of symmetry axis can also be seen as the number of sectors in which the plane is divided. Coefficients n1, n2and n3control the shape.
For m = 4 and n2= n3, the original superellipses are obtained. When m is a natural number, non self intersecting closed
curves are obtained and regular polygons can be generated by setting the shape coefficients to specific values as shown in [17]. If m = pq is a rational number, p represents the number of sectors and q represents the number of rotations needed to close the curve which leads to closed self intersecting curves like a pentagram for example. If m is an irrational or transcendental number, the curve will never close and patterns will not repeat. For solid modelling applications, we need non self intersecting closed curves which implies we consider m as an natural number.
Extension to 3D is performed by the spherical product of two super polygons (Eq.10) as done for superquadrics in [4].
g ⊗ h = ssxy(u, v)(u, v) sz(u, v) = µ gx(u) gy(u) ¶ ⊗ µ hx(v) hy(v) ¶ = ggxy(u).h(u).hxx(v)(v) hy(v) (10)
A 3D supershape is therefore describe by 12 coefficients, 4 for the size, 6 for the shape and 2 for the symmetry axis. To simplify the notation and in order to stay close from the superquadric representation we consider unit supershapes (a =
b = 1) that are scaled among the 3 axis (x,y,z). A 3D supershape is therefore described by a set of 11 parameters Λ = {a1, a2, a3, m, n1, n2, n3, M, N1, N2, N3}. A condensed parametric version can be written as:
x(θ, φ)y(θ, φ) z(θ, φ) =
aa12rr11(θ)r(θ)r22(φ) cos θ cos φ(φ) sin θ cos φ
a3r2(φ) sin φ ( −π ≤ θ < π −π 2 ≤ φ ≤ π2 (11)
In [17] are proposed two similar distance functions applied to the projected point onto two orthogonal planes as implicit function for supershapes. Analytically, we deduce an implicit form for supershapes from the previous parametric representa-tion, a geometric interpretation is shown in Fig.3(a):
F (x, y, z) = x2+ y2+ r2
1z2− r21r22= 0 (12)
The following implicit equation, derived from the parametric form has been chosen for its stability and smoothness. This function is defined everywhere but at the origin (r > 0 by definition of superpolygon radius in Eq.9).
F (x, y, z) = x 2+ y2+ r2 1z2 r2 1r22 − 1 = 0 (13)
We see that supershapes conserve a very useful property from superquadrics : they have both an implicit representation and a parametric representation.
To increase the range of shapes that can be modelled, we consider three global transformations (tapering, twisting and bending). Any other global deformation can be used if it’s reversible. Futhermore, deformations are not only applied to single primitives but to complete subtree as proposed by Wyvill [20].
(a) (b) Intensity of the scalar field
Figure 3: Geometric interpretation of supershape implicit equation and intensity of the scalar field generated for a planar section z=cte. On Fig.3(a), a point Piin cartesian coordinates is expressed in spherical coordinates, angles θ and φ are then
reintroduced into the supershape parametric equation to generate the point pi which is the intersection of the supershape
surface and the half line [O, Pi). Many techniques to combine Piand piare possible such as difference of the norms or scalar
product. Fig .3(b) shows the intensity of the scalar field for a plane z= cte: positive values define the inside of the object and range from blue (F = 0+) to red (F is maximum), the outside of the object is defined by negative values and is represented in grey scale (white = 0−, grey/black = minimum).
(a) m=4, M=4, ni=Ni=1000 (b) m=5, M=4, n1=2, n3=n3=5,Ni=100 (c) m=8, M=8, n1=N1=100,n2=n3=N2=N3=30 (d) m=3, M=4, n1=4, n2= n3= 20, Ni= 100, Ni=100
X = fx(x) = µ kx a3 z + 1 ¶ x Y = fy(y) = µ ky a3z + 1 ¶ y Z = z
Variables kxand kyrepresent the tapering factors along the x and y axes respectively in the object-centered coordinate system
with −1 ≤ kx, ky≤ 1.
The twisting correspond to a rotation along an arbitrary axis parallel to the z-axis and is defined by
X = (x − Ox) cos ω + (y − Oy) sin ω + Ox Y = − (x − Ox) sin ω + (y − Oy) cos ω + Oy Z = z
where ω = αz, α represents the total rotation angle and Ox, Oycoordinates of the center of rotation
The bending deformation defined by Jakli˘c and Solina [6] was specified for superquadric representation, i.e., recovering bent superquadric models from 2D range images of objects. Differing from the bending deformation defined by Barr [4], which only permits bending in a single plane, an additional parameter α is introduced to the bending deformation. This additional parameters allows for bending in any plane that goes through the z axis of the object coordinate system.
The bending deformation is defined by the following equations :
X = x + (R − r) cosα Y = y + (R − r) sinα Z = µ 1 k − r ¶ sinγ (14)
where k represents the curvature of the bending plane, and α the bending angle around the z-axis. Other intermediate parameters γ, r and R are evaluated using:
γ = z × k r =px2+ y2cosθ R = 1 k− µ 1 k− r ¶ cosγ θ = α − β β = arctany x
The complete transformation applied to each Node of the tree is defined as follows :
D(x, y, z) = (Scaling ◦ T apering ◦ T wisting ◦ Bending ◦ Rotation ◦ T ranslation) (x, y, z)
4
Algorithm
The input of the algorithm is a CSG Tree of supershapes. Each node defines a boolean operation (union or intersection) and contains a flag to define the orientation of the surface (used for differences that are a composition on intersection and negation). Each node also contains the parameters of all the transformation (global deformations and homogenous tranfor-mations). Leaves of the tree contain additional supershape parameters. At the beginning of the process, vertices and faces are stored in the leaves of the CSG tree. At the end of the process, the resulting 3D mesh, which is a subset of the union off
all the oriented primitive, is stored at the root. Our algorithm is composed of two main operations. In the first subsection a fast direct solution is proposed evaluate the intersection between two or many subtrees. Knowledge of the intersection object allows to keep vertices and faces from the subtrees that are needed to construct the resulting object and defines faces that are going to be splitted then merged in the second subsection.
4.1
Intersection evaluation
Since we are dealing with supershapes that have implicit and parametric representations, we can generate vertices lying exactly on the surface of every primitive with simple algorithms in a short amount of time. We are therefore dealing with meshes that are described by two equivalent representations. Our goal is now become a classical problem with mesh-mesh boolean operation, or more generally with parametric object boolean operation : we need to be able to determine the parts from each object that must be kept and then merged together to construct the final object. Instead of considering a polygon/polygon intersection approach (which turns to have a time complexity in O (n log n) at the best) we use the R-function associated to every subtree to flag every vertex : for each vertex of each subtree, the sign of the resulting implicit function (direct implicit function if the subtree is a supershape or resulting R-function if the subtree is not a single primitive) determines if a vertex is lying in, on or out the other sub-objects. The time complexity of this operation therefore turns to become linear in the number of vertices to be evaluated because a single function is called for each vertex. A simple example is shown with two spheres in Fig.5(a). In deep blue and deep red are the 3D points that are detected "inside" the other subtree. On Fig.5(b) can be seen the faces that are kept depending on the boolean operation.
(a) Detection of vertices belonging to the intersection between two spheres
(b) Complete faces and vertices kept depending on the boolean operation, missing faces are crossed by an intersection curve
The only assumption made to isolate the intersecting faces is that an edge is crossed only once by one intersection curve. If this hypothesis is not verified, the parametric space of the primitive is locally subdivided to refine the mesh as much as desired as shown in [21]. In theory, the only way to know if such condition is not verified is to solve the equation
SubtreeLef t = SubtreeRight which is not our purpose. So in practice, instead of considering only the vertices of a face,
we take in account an over-sample of each edge and we count the number of sign changes. We can afford an additional virtual over-sampling because time complexity of the evaluation of the intersection stays linear in the number of vertices evaluated by the use of the implicit equation of supershape. From our experiences, starting with primitives that are polygonized finely enough (at least 100*100 faces) and considering an over-sample of 10 is largely sufficient to correctly detect faces that must be subdivided and additionnal subdivision may be directly applied to refine the mesh when it’s needed because of the parametric representation.
4.2
Splitting and Merging
In this section we do the last operations needed to achieve a boolean operation between two subtrees. In a first time we split faces that are crossed by the intersection curves to define the part of surfaces that must be kept. The last operation consists in merging the split faces to close the final mesh.
As mentioned before, we consider that a face is crossed only once by one intersection curve. This means that if we consider an arbitrary edge crossed by an intersection curve, the sign of the implicit function applied to its extremities is opposed. The implicit R-function applied to an edge is continuous and monotonous and therefore admits a zero-set point
(Fig.5(c)). A simple dichotomy method is used on the parametric domain of the involved primitives to approximate this 3D point. As a vertex generated by a parametric primitive, the implicit function associated will be zero. This vertex is therefore lying exactly on the resulting surface but is only an approximation of the theoretical intersection point. The criterion used to stop the refinement is |F (P ) ≤ ε| where ε is a constant provided by the user and the sign of F (P ) is consistent with the boolean operation. Other criteria such as distance to the surface of the other object can be used, in practice our ε is set to
10−6. For a better accuracy, an additional user parameter δ can also be used to bound the length of edges representing the
intersection curve as shown in Fig. 5(d).
(c) Sequence of faces crossed by an intersection curve. On a parametric segment the approximating intersection point I+or I−depends on the Boolean operation
(d) Step 1 : optional subdivision to bound the maximum length of segments approximating the
intersection curve to δ
(e) Intersection curve approximations depending on the Boolean operation
(f) Split face after triangulation
Figure 5: Splitting process
The last operation performed is the merging of the parts needed to obtain the final mesh. Faces that have not been splitted and their vertices are copied into a bigger mesh. For both objects, Vertices introduced to represent the approximation of the intersection curve in the split faces are ordered to define the final intersection curve and fill the stripe between the two surfaces. We refer to [21] for the technique used. An additional fusion and replacement of identical or close vertices is performed to reduce the number of faces used and to avoid flat triangles or multiple identical points. On the top of Fig. 4.2 we show the result of the difference between two spheres with a coarse sampling and a large ² = 10−3 without merging, notice the hole between the two parts. On the bottom is shown the results with common values used in our experiments i.e a minimum sampling of 100x100 faces, ² = 10−6 and δ = 10−2. These values increase the number of faces generated and therefore the number of faces to be split but avoid the introduction of almost flat triangles.
5
Results
We present in this section three results using our algorithm. The bolt is the simplest object and is obtained by the composition of five supershapes. The piston is a more complex object with its nine primitives and the propeller example uses deformations (combination of slight bending, tapering and twisting).
Figure 6: Results of Boolean operation between two spheres
6
Discussion
Our main concern for discussion is on the definition of the resulting surface. It is commonly considered that a surface is representing an iso-value for its implicit function, the zero set in most of cases. Unfortunately some cases may occur where zero values of the resulting R-Function are inside the object. This situation happens when the union of tangent objects is performed. Therefore, considering the surface only as the zero set of the function is not sufficient in our case to describe all the cases and some additional assumptions on the model must be made to avoid ambiguities. We present in this section few concepts to solve this problem and discuss their major advantages and drawbacks.
An immediate solution is not only to consider the surface as the function zero set, but also assert its sign changes in a given neighborhood. Related to the algorithm, it adds one final step which consists to evaluate the R-function on neighborhood of points. But in practice, evaluating sampled values on small balls enclosing zero value points does not guarantee a correct result nor solve the problem of zeros inside. Another approach is to consider a blending function as mentioned by Wyvill in [20]. This corresponds to add a quantity of material depending on the distance between the two primitives. This approach is well known, widely used and is especially useful to generate smooth links between objects. But if this solution solves the problem of zero values inside the object, its drawbacks for our solution is the loss of the parametric domain to generate the solutions for the resulting R-Function : with this approach, the resulting mesh is no longer defined by a subset of the primitive surfaces. In other words, the solution to generate the resulting surface must use classical implicit surface meshing techniques such as the marching cubes. This implies that we lose the ability to generate efficiently and exactly points lying on the surface. Nevertheless, in order to provide a more natural and convenient modeling tool and if the theoretical solution of the R-function is not needed, a small intensity blending function can be used during unions to model objects with tangent primitives. The last two approaches come from Rvachev who considers patches enclosing the zero value domain and therefore performs unions with additional objects. In other words, he eliminates object tangency by overlapping patches. This solution also solves inside zero value problem but is not applicable in practice. First, and this is true for other methods too, these tangent parts must be defined, which implies to directly solve equation systems and therefore leads to complicated if not unsolvable equation systems. Then, even if the inside zero values could be efficiently determined, the definition of the patch itself is critical and also leads to complex equation solving problems. The second solution consists in using a three valued logic
(a) Final Object. (b) A binary CSG Tree.
(c) Scalar Field generated by the resulting R-Function. (d) Zoom on merged frontiers of two supershapes
Figure 7: Bolt
instead of our two valued logic. (WARNING NOT SURE : Dr Gribock can you confirm??) Rvachev proves the problem of inverse analytical geometry (correct term?) is solvable in this system (the inside, the outside and the surface), but this leads to other practical problems and is not as comfortable and natural as Boolean logic.
So, in practice and in the context of modeling, a slight blending can be used to perform unions of tangent objects if the user is aware of the tangency but, if the zero set of the function and the definition domain of the solutions are the primary goals, it is to the user to model properly his CSG Tree and assert that there is no tangency between primitives and we chose in the results section to consider models without tangency.
7
Conclusions and future work
In this paper, we have proposed an efficient algorithm based on R-functions theory to compute boolean operations with supershapes. The method proposed preserves most of the interesting properties of implicit methods and parametric methods: time complexity stays linear but rendering is kept simple with the parametric form of the primitives used. In input, we consider a CSG tree that contains the parameters of the supershapes, the boolean operations, and the global deformations. The output includes three components: an implicit equation whose zero-set represents the surface, a union of parametric intervals to generate 3D points lying on the surface, and a 3D mesh whose points are lying exactly on the resulting surface. The only approximation made is on the borders of the parametric domain for the solutions. As a subset of the union of all the primitive parametric intervals, the parametric interval considered as solution is a subset of the theoretical parametric solution. These two intervals tend to be equal when ε tends to zero . This approximation is due to the dichotomy process used to split the faces and the parametric interval : we are not able to explicitly solve the equation representing the intersection of
(a) A binary CSG Tree. (b) Zoom on merged frontiers of two supershapes
(c) Resulting object (d) From another view (e) Intensity of the scalar field generated
Figure 8: Piston
many objects so we approximate the parametric solutions within a ε-precision. Moreover, our solution is generic in the sense that any primitive that can be represented by both parametric and implicit equation can be used which allows us to consider objects such supertoroids or Dupin cyclides. Global deformations are considered but local deformations can also be adapted as soon as they are reversible.
As future work, we are going to extend the list of the primitives that can be used with this algorithm. Being now able to represent complex shapes with a CSG Tree of primitives and a single equation, we are also going to study possible solutions to extract the CSG Tree and the parameters of the primitives from a cloud of points or a 3D mesh and apply our method to reverse engineering and computer vision in a larger sense.
References
[1] L. Piegl and W. Tiller, The NURBS Book, Springer, second edition, 1997.
[2] J. Stam, “Exact evaluation of catmull-clark subdivision surfaces at arbitrary parameter values,” 1998, pp. 395–404.
[3] A. H. Barr, “Superquadrics and angle-preserving transformations,” IEEE Computer Graphics and Applications, vol. 1, no. 1, pp. 481–484, 1981.
[4] A. H. Barr, “Global and local deformation of solid primitives,” Computer Graphics, vol. 18, no. 3, pp. 21–30, 1984.
[5] M. E. Montiel, A. S. Aguado, and E. Zaluska, “Surface subdivision for generating superquadrics,” The Visual Computer, vol. 14, no. 1, pp. 1–17, 1998.
[6] A. Jakli˘c, A. Leonardis, and F. Solina, Segmentation and recovery of superquadrics, Kluwer Academic Publisher, Dordrecht, 2000. [7] A. Jakli˘c and F. Solina, “Moments of superellipsoids and their application to range image registration,” IEEE Transactions on
(a) A binary CSG Tree. (b) Zoom on merged frontiers of two supershapes
(c) Final Object. (d) Horizontal section and intensity of the resulting R-function
(e) Transversal section and intensity of the resulting R-function
Figure 9: Propeller
[8] H. Löffelmann and E. Gröller, “Parameterizing superquadrics,” Tech. Rep., University of Vienna, 1994.
[9] D. DeCarlo and D. Metaxas, “Shape evolution with structural and topological changes using blending,” IEEE Transactions on Pattern
Analysis and Machine Intelligence, vol. 20, pp. 1186–1205, 1998.
[10] M. Tigges, M.S.T. Carpendale, and B. Wyvill, “Generalized distances metrics in implicit surface modelling,” Skigraph99.
[11] E. Bardinet, L. D. Cohen, and N. Ayache, “Fitting of iso-surfaces using superquadrics and free-form deformations,” Seattle, Wash-ington, June 24-25 1994, pp. 0–1, In Proceedings of the IEEE Workshop on Biomedical Image Analysis (WBIA’94).
[12] E. Bardinet, L. D. Cohen, and N. Ayache, “Superquadrics and free-form deformations : A global model to fit and track 3d medical data,” .
[13] V. Vaerman, C. Fabregas, and G. Menegaz, “The hyperquadrics: an efficient parametric surface representation,” 1997.
[14] Carole Blanc and Christophe Schlick, “Ratioquadrics: an alternative model for superquadrics,” The Visual Computer, vol. 12, no. 8, pp. 420–428, 1996.
[15] L. Zhou and C. Kambhamettu, “Extending superquadrics with exponent functions: Modeling and reconstruction,” Graphical Models, vol. 63, no. 1, pp. 1–20, 2001.
[16] J.Gielis, “A generic geometric transformation that unifies a wide range of natural and abstract shapes,” American Journal of Botany, vol. 90, pp. 333–338, 2003.
[17] Johan Gielis, Bert Beirinckx, and Edwin Bastiaens, “Superquadrics with rational and irrational symmetry,” 2003, Symposium on Solid Modeling and Applications.
[18] H. B. Voelcker and A. A. G. Requicha, “Research in solid modeling at the university of rochester : 1972-1987,” In L. Piegl, editor, Fundamental Developments in Computer-Aided Modeling, Academic Press, London, 1993.
[19] A. Rappoport and S. Spitz, “Interactive boolean operations for conceptual design of 3-d solids,” 1997, Proceedings of Siggraph 97. [20] B. Wyvill, A. Guy, and E. Galin, “Extending the CSG tree - warping, blending and boolean operations in an implicit surface modeling
system,” Computer Graphics Forum, vol. 18, no. 2, pp. 149–158, 1999.
[21] H. Biermann, D. Kristjansson, and D. Zorin, “Approximate boolean operations on free-form solids,” in SIGGRAPH 2001 Conference
Proceedings, Los Angeles, California, August 2001, pp. 185–194.
[22] V. L. Rvachev, Geometric Applications of Logic Algebra, Naukova Dumka, 1967, In Russian.
[23] V. L. Rvachev, Methods of Logic Algebra in Mathematical Physics, Naukova Dumka, 1974, In Russian. [24] V. L. Rvachev, Theory of R-functions and some applications, Naukova Dumka, 1982, In Russian.
[25] V. Shapiro, “Theory of R-functions and applications : A primer,” Tech. Rep. TR91-1219, Computer Science Department, Cornell University, Ithaca, NY, 1991.
[26] V. Shapiro and I. Tsukanov, “Implicit functions with guaranteed differential properties,” in Symposium on Solid Modeling and