Nov 4, 2016 - Tension-determined surface. Constant mean curvature surfaces. Gradient projection. Volume preserving. Mesh optimization. a b s t r a c t.
Computers & Graphics 61 (2016) 50–59
Contents lists available at ScienceDirect
Computers & Graphics journal homepage: www.elsevier.com/locate/cag
Technical Section
A framework for modeling high quality tension-determined surfaces$ Long Ma a, Yuanfeng Zhou a, Hao Pan b, Caiming Zhang a,n a b
Shandong University, No. 1500 Shunhua Road Jinan, Shandong Province, China Microsoft Research Asia, Building 2, No. 5 Dan Ling Street, Haidian District, Beijing, China
art ic l e i nf o
a b s t r a c t
Article history: Received 8 June 2016 Received in revised form 17 October 2016 Accepted 19 October 2016 Available online 4 November 2016
Many surfaces in nature are determined by the equilibrium of surface tension and external forces, such as air pressure or gravity. Such surfaces, to be called tension-determined surfaces (TDS), are widely used in architectural design and industrial design. A well-known example is the minimal surface which has a zero mean curvature. Existing methods for modeling general TDS, which are normally represented as triangle mesh surfaces, have difficulty in achieving both uniform curvature distribution and high mesh quality. In this paper, we present a novel framework for generating high quality triangular meshes that accurately approximate TDS. While the simultaneous optimization of both surface tension energy and mesh quality is generally infeasible due to conflict, the proposed method resolves the conflict by constraining the two energies into the orthogonal normal and tangent subspaces respectively; to optimize the energies in constrained subspaces, we first project the energy gradients into the subspaces and then combine the projections to drive a stable and convergent optimization process. Experiments show that our method produces better results than previous works in terms of both accuracy of curvature approximation and the mesh quality of the output TDS. & 2016 Elsevier Ltd. All rights reserved.
Keywords: Tension-determined surface Constant mean curvature surfaces Gradient projection Volume preserving Mesh optimization
1. Introduction Surface generation is an important research topic in computeraided geometric design and computer graphics. There are abundant surface shapes that are determined by an equilibrium to the effect of surface tension. For example, soap films are surfaces determined by surface tension and boundaries, and are well known as the minimal surfaces. Soap bubbles are determined by the balance between air pressure and surface tension, and they are known as surfaces with constant mean curvatures. Water drops also attain their special shapes under the influence of both surface tension and gravity. We will refer to this kind of surfaces as tension-determined surfaces, or TDS for short. Because of their aesthetic appearance, which is due to smoothly changing curvature, the tension-determined surfaces find many applications in arts, architectural design, and industrial product design. Recent studies on TDS include applications in architecture [1] and computer simulation [2]. Euler–Lagrange equation [3] is applied to derive an analytic solution of modeling minimal surfaces [4]. As an application of complex variable functions [5], the Weierstrass equation [6] is proposed to find the common solution of minimal surfaces. ☆ n
This article was recommended for publication by D. Panozzo. Corresponding author.
http://dx.doi.org/10.1016/j.cag.2016.10.001 0097-8493/& 2016 Elsevier Ltd. All rights reserved.
Unfortunately, as boundary conditions become more complex, finding the analytic solution of TDS is almost impossible. So in general, triangular meshes are used as discrete approximations to TDS. Based on triangular mesh representation, many surface evolution methods are proposed. While Pinkall and Polthier [7] use Dirichlet energy minimization for generating minimal surfaces, a great number of methods are based on the Mean Curvature Flow (MCF) [8] which evolves the surface following discrete mean curvature vectors defined on triangular meshes [9]. Surface evolution along MCF may encounter singularities, which can be avoided by modifying the MCF with special treatments [10]. The naive geometric flows for surface form-finding do not take the discrete mesh quality into consideration; meanwhile, the flow process may severely degrade the mesh quality, causing numerical difficulties that prevent successful form-finding. To solve this problem, various augmentations to geometric flows are proposed. Bobenko and Springborn [11] use edge-flip to improve the mesh quality of a discrete minimal surface solved by MCF. Crane et al. [12] introduced a conformal Willmore flow to fair a mesh while maintaining the quality of the input mesh. Elliott and Fritz [13] study the effect of reparameterization which resembles conformal mapping for mesh quality improvement in MCF. Nealen et al. [14] apply Laplace operator for optimizing mesh quality and employ optimized sparse linear solvers for acceleration. Barret et al. [15,16] propose a creative idea for optimizing mesh quality and vertex distribution by moving vertices along the tangent planes of the surface.
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
Surface Evolver developed by Brakke [17] is a well known, open-source software for discrete tension-determined surface generation in practice. Its main idea is to minimize an energy function related to the surface area by altering vertex positions, and apply a volume-restoring motion for vertex update to enforce volume constraints. Mesh quality is improved by vertex averaging and edge-flip operations, in an ad hoc manner, that has not taken into consideration the energy minimization; thus often the mesh optimization step does not respect the minimization of surface energy. This compromises the quality of the surfaces modeled using Surface Evolver. Pan et al. [18] integrate centroidal Voronoi tessellation (CVT) into the optimization framework of constant mean curvature surfaces, a special type of TDS. Compared with Surface Evolver, this method has an objective function which combines mesh quality and surface shape, thus allowing more robust computation of constant mean curvature surfaces. However, surfaces by this method tend to have relatively large curvature approximation error due to the asymptotic equivalence of the proposed energy to the true surface area functional. There is also a defect that its formulation is not readily extensible to modeling general TDS other than constant mean curvature surfaces. Real-time construction of tension-determined surfaces has also been studied to meet the requirement of animations. Zhang et al. [19] present a Lagrangian deformable surface model for a physically plausible animation of water drops and their interactions with solid surfaces in real time. Wang et al. [20] propose a smallscale simulation of fluids in real-time. These kinds of algorithms are mainly focused on simulation of fluids, and therefore mesh quality and surface accuracy of the generated surfaces have a large room for improvement. We propose a new general method for modeling discrete tension-determined surfaces. Our method takes the gradients of the surface tension energy and the mesh quality energy, resolves their conflict by projecting them into different subspaces, and finally combines them to drive a convergent optimization process that produces high quality tension-determined surfaces with better quality and accuracy than the previous methods. Extensive examples demonstrate the effectiveness of the proposed method for computing various kinds of tension-determined surfaces (cf. Section 5).
2. Related work There are many algorithms for tension-determined surfaces generation by now. Here we mainly introduce three representative methods. The simplest method is the MCF method which is to minimize the surface area directly along the mean curvature flow. Surface Evolver improved the MCF method to generate more applicable surfaces. Mesh optimization operations such as edgeflip and vertex averaging are also included in Surface Evolver. On the other hand, the CVT-CMC method applied the centroidal Voronoi tessellation(CVT) to generate minimal surfaces and constant mean curvature surfaces with a volume adjustable parameter.
where 1 ringðP i Þ is the set of the 1-ring neighboring vertices around Pi. The quantities αij and βij are the two opposite angles of edge P i P j , as shown in Fig. 1. The surface area can be minimized along the opposite direction of the mean curvature flow. However, this method does not take mesh quality into account. The optimization iterations degrade mesh quality and can hardly converge. Hence, this method is rarely used in practice directly. However, the mean curvature flow method forms the basis of many follow-up work and improved methods. 2.2. Surface evolver Surface Evolver [17,23] is one of the methods extending the mean curvature flow method. Its improvements include extending the energy formulation, and enabling volume preservation and mesh optimization. It is a practical and popular software for generating tension-determined surfaces. Surface area is the basic tension energy defined in Surface Evolver. Gravitational potential energy or other forms of potential energies can be optionally appended: Z E ¼ A þ UdV; ð2Þ V
where A, U and V respectively denote the surface area, the potential function and the volume enclosed by the surface, respectively. Surface Evolver can enforce the volume V to converge strictly to a given value V0 through iterations. The main idea to restrict the volume is based on Lagrange multiplier and volume correction. This method will be applied in our method. In Surface Evolver, vertex averaging is the main optimization method for surface generation. The objective function is given by Q¼
N X ! jP i C i j2 ; i¼1
where Ci is the centroid of the region Ωi comprising the triangles around the vertex Pi (Fig. 2). Apart from this, Surface Evolver also supports edge-flip operations to change the topological structure of the mesh. Edge-flip operations ensure the maximal empty circle property [24] of the mesh. If a surface generation requires both minimizing the mean curvature error and optimizing the mesh quality, the operations of mesh optimization and tension-determined energy minimization should be carried out alternately in Surface Evolver. However,
Fig. 1. Discrete mean curvature flow.
2.1. Mean curvature flow Mean curvature flow method [21,22] is a direct method to minimize the area of a high quality surface. The mean curvature flow at a vertex Pi for a triangular mesh is defined as: 2
∂A ¼ H i ni ¼ ∂xi
P
α
β
!
j A 1 ringðP i Þ ðcot ij þcot ij ÞP j P i
AV ðPi Þ
;
51
ð1Þ Fig. 2. Voronoi area and 1-ring facets.
52
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
experiments show that it is not an easy task to resolve the conflict between these two energy terms in Surface Evolver: minimizing the tension-determined energy may degrade mesh quality, while optimizing the mesh quality may increase the mean curvature error. Users often find these alternating operations fussy and confusing as to what should be the best strategy for interleaving the operations for mesh optimization and surface evolution. Furthermore, if the quality of the input mesh is poor, the generated result mesh will likely be worse. Our proposed method is targeted at solving this problem and the examples in Section 5 show its superior results.
Fig. 3. Minimization in different subspaces. (a) Minimization of the area term A along the normal direction of a vertex Pi; (b) Minimization of the mesh optimization term Q in the tangent plane τi of Pi; (c) The composition of the two minimization components resulting in the optimization direction (in green) for Pi.
2.3. CVT-CMC Pan et al. [18] proposed a CVT-CMC method which extended the centroidal Voronoi tessellation (CVT) framework for generating high quality constant mean curvature (CMC) discrete surfaces. The CVT energy is defined as the sum of the rotational inertia of the Voronoi area of every inner vertex Pi with coordinate xi in a given domain M: k Z X J x x i J 2 dσ ; ð3Þ ECVT ðMÞ ¼ i¼1
Vi
where Vi is the Voronoi cell of site Pi, as shown in Fig. 2. The Voronoi cells fV ki ¼ 1 g form a partition of M called a Voronoi tessellation. A CVT can be obtained by minimizing ECVT(M). But by now, no method is discovered to calculate the global minimum of CVT energy. Lloyd's method is the simplest method to generate CVT [25]. The concrete operation is moving every vertex Pi to the centroid Gi of its Voronoi area: ! xi ≔xi þ P i Gi : In our paper, we adopt the Lloyd's method with minor improvements for mesh quality optimization. CVT energy is proved to be asymptotically equivalent to the squared surface area [18]. Hence, if there is no constraint, minimizing CVT energy can approximate a minimal surface. A constant mean curvature surface can be generated by minimizing the following objective function: ECMC ¼ ECVT þ tV;
ð4Þ
where V is the volume enclosed by the surface. The CVT-CMC method can optimize the mesh quality simultaneously, but its mean curvature error can be larger than the methods based on mean curvature flow, because the CVT energy is not strictly equivalent to surface area when the number of vertices is finite. Moreover, the CVT-CMC method can neither generate surfaces with a given volume, nor append other forms of energy for more general surfaces. Our method addressed these problems. To summarize, the aforementioned methods cannot generate discrete tension-determined surfaces with both low mean curvature error and high mesh quality. In view of this, we present a novel framework based on an efficient optimization method which we introduce in the subsequent sections.
3. Our method In order to construct high quality discrete tension-determined surfaces, the key problem is to solve the conflicts in optimizing the tension energy (E in Eq. (2)) and mesh optimization energy ðQ ¼ ECVT Þ. We present a new framework to restrain their mutual effects and solve for the optimal energy in two different subspaces in the normal direction and in the tangent plane instead of optimizing a complex objective function directly.
3.1. Projection-based energy optimization The minimization conditions of the two objective functions E and Q cannot be satisfied simultaneously in general. Our idea for resolving this conflict is to restrain the active spaces of E and Q to achieve their constrained minima simultaneously; this can avoid the alternating operations in Surface Evolver. Specifically, we search for the minimum of E along its negative gradient projected on the normal direction ni of each vertex Pi (Fig. 3(a)) (denoted as vEjP i ), and search for the minimum of Q along its negative gradient projected on the tangent plane τi (Fig. 3(b)) (denoted as vQ jPi ), and then combine the two projected motions together (Fig. 3(c)) to yield the desired optimization direction (vi ): 8 ∂E > > ni ; vEjP i ¼ ∂x n i > i > < ∂Q ∂Q > vQ jPi ¼ ∂xi þ ∂xi ni ni ; > > > : vi ¼ αvEjP þ β vQ jP ; i i where α; β Z 0 are scalar coefficients for combining the two motions. Note that the vE and vQ are always orthogonal to each other, showing the minimization of E and Q in constrained subspaces do not interfere with each other. Remark. Note that although we can find the combined motion v to reduce the energies E and Q in their restrained subspaces, we cannot prove that v is integrable, or equivalently, we cannot provide an objective function which assumes v as its gradient. This fact indeed restricts the tools available for solving the optimization problem: without a unified objective function, we cannot apply common optimization methods that require line search to evaluate the function and find the best step size along v. However, as we show in subsequent sections, we carefully design the combination coefficients α and β to ensure fast convergence in practice. When convergence, the vertex motion vanishes, and the final result satisfies: 8 ∂E < ∂x ni ¼ 0; i ∂Q : ∂x ni ¼ 0: i
We analyze the existence of solution to the above system of equations in Section 3.6, after presenting some key observations: in Section 3.2, we show that for a single mesh vertex, its normal vector defined by volume gradient is independent of the vertex, and based on the fact, in Section 3.3, we further show that the mesh evolution in the normal direction becomes a convex problem. Finally in Section 3.6, drawing on the uniqueness of solutions to the convex problem of normal motions, we demonstrate how the normal motion for surface tension energy minimization and the tangential motion for mesh quality optimization are nicely separated.
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
In Sections 3.4 and 3.5 we present how to find the stepsizes for the two separated movements of vE and vQ , and in Section 3.7 the edge flipping operations for mesh topology update is discussed. 3.2. Normal estimation There are many algorithms for approximating the normal vector at a vertex of a triangle mesh [9]. As we require that the estimation of the normal should be insensitive to Pi to ensure stability during optimization, we take the normal at each vertex Pi as P F A 1 ringðP i Þ AF j nF j ni ¼ P j ð5Þ F j A 1 ringðPi Þ AF j nF j j; which is derived from the gradient of the volume: X ∂V AF j nF j ¼ 3 ; ∂x i F A 1 ringðP Þ j
ð6Þ
i
where F j A 1 ringðP i Þ is a facet in the 1-ring neighborhood of Pi, and nF j its normal vector. It can be proved that ni is independent of Pi and is determined only by the 1-ring neighboring vertices of Pi. This property ensures that the space of normal motions for surface tension energy optimization and the tangential motions for mesh quality optimization are well separated and independent from the varying vertex. 3.3. Tension energy minimization along normal When a vertex is moved, it only affects the area of triangles in the 1-ring neighborhood. Let Pi move along its normal ni (c.f. Eq. (5)), t denote the move distance, and Ai(t) denote the total area of the facets in the 1-ring neighborhood of Pi with new position, we have X Ai ðtÞ ¼ AF j ðxi þ tni Þ: F j A 1 ringðP i Þ
53
On the other hand, as we vary the mesh vertex along normal direction, the optimality condition becomes d A0i ðtÞ ¼ λ V ðtÞ: dt According to the definition of vertex normal (Section 3.2), we ∂V d know that dt VðtÞ ¼ ∂x j , which is independent of vertex Pi. In fact, i for general tension determined surface energies the problem can be transformed into solving the equation A0i ðtÞ ¼ c;
ð9Þ
with c depending on the specific problem (see Section 5 for diverse problems). According to the monotonicity of Ai 0 ðtÞ, this equation has at most a unique root. Because the function Ai(t) has a complicated form, it is impossible to get the analytic root of Eq. (9). While numerical root-finding methods like Newton's method or bisection method can be used to search for the solution, they generally take quite a few iterations and too much time. We instead derive a simple and effective method to estimate t for every iteration, as presented in the next subsection. After the solution ti of Eq. (9) is derived, t i ni will be the normal component of the adjustment for a vertex: v i J ¼ t i ni : In the fixed volume case, the normal component should append a volume correction term to compensate the difference to volume constraint, as is done similarly in [17]: 0 , ! X ∂V 2 ∂V @ ð10Þ vi J ¼ t i ni þ ðV 0 VÞ ; ∂xj ∂xi P AM j
where V and V0 are the current volume and target volume constraint respectively. When the volume is correct (V ¼ V 0 ), the correction term disappears automatically. 3.4. Estimating the movement along normal
Then A0i ðtÞ ¼
d ∂A ðtÞ A ðtÞ ¼ i ni dt i ∂xi
In the Appendix, we prove that Ai(t) is convex: 2
d Ai ðtÞ Z 0; dt 2
ð7Þ A0i ðtÞ
is monotonic. which implies that Now we consider several typical TDS energies. For the case of minimal surfaces, the aim is to minimize Ai(t) which is equivalent to A0i ðtÞ ¼ 0; for all vertices. In the case of constant mean curvature surfaces with fixed volume constraint, the constraint is introduced to the surface energy through a Lagrange multiplier λ which is geometrically the surface mean curvature:
φ ¼ Aþ λðV V 0 Þ; where V and V0 are the volume and target volume constraint respectively. On one hand, when the surface energy is minimized through varying mesh vertices, we have for the i-th vertex ∂A ∂V ∂V þλ ¼ 0; ∂xi ∂xi ∂xi which gives an evaluation of the Lagrange multiplier as , X ∂A ∂V ∂V 2 λ¼ : ∂xi ∂xi ∂xi P AM i
ð8Þ
In order to solve Eq. (9), we make an approximation about Ai(t): when the triangles incident to Pi are similar as a result of mesh quality optimization by vertex tangential motions, Ai(t) can be approximated by a function of the following form (see details in Appendix) qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð11Þ Ai ðtÞ ¼ a þ bðs0 þ tÞ2 : Then we have A2i ðtÞ ¼ a þ bðs0 þtÞ2 ; By taking successive derivatives with respect to t on both sides of the equation, we have Ai ðtÞA0i ðtÞ ¼ bðs0 þ tÞ; ″ A02 i ðtÞ þ Ai ðtÞAi ðtÞ ¼ b:
Letting t¼ 0, we obtain the unknown coefficients: 8 ″ b ¼ A02 > i ð0Þ þ Ai ð0ÞAi ð0Þ > < Ai ð0ÞA0i ð0Þ s0 ¼ b > > : 2 a ¼ A2i ð0Þ bs0 In the equation, Ai ð0Þ is simply the sum of areas of the facets around Pi, and the derivatives can be computed through: ∂A n; ∂xi i ∂ ∂A A″i ð0Þ ¼ ni ni : ∂xi ∂xi
A0i ð0Þ ¼
By taking derivatives for both sides of Eq. (11) and letting A0i ðtÞ ¼ c, we
54
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
have the t solving Eq. (9) as 0 sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi a Ai ð0Þ@ Ai ð0ÞA″i ð0Þ 0 c Ai ð0ÞA: ti ¼ c s0 ¼ 2 2 b b c2 b bc
ð12Þ
This equation has a unique real root if and only if c2 o b. From Eq. (12), with some derivation we can find that when ti ¼0 meaning the vertex no longer moves, we have A0i ð0Þ ¼ c (Eq. (9)), i.e. the surface tension energy is minimized. 3.5. Estimating the tangential movement The mesh optimization is restricted to the tangent plane. We take Lloyd's algorithm to derive the movement of a mesh vertex for minimizing the CVT energy, and project the movement to the tangent plane of the vertex: ! ! ui ¼ P i Gi ðP i Gi ni Þni : While Lloyd's algorithm amounts to a gradient descent method without step size control [25], we tried to search for a larger step size s, to accelerate the convergence on the tangent plane: ! ! vi ? ¼ si ui ¼ si P i Gi ðP i Gi ni Þni ; ðsi 4 1Þ: ð13Þ Due to the complexity of CVT energy, we can only find the best coefficient si by line search. But here we take an empirical value of the step size rather than doing line search, again for the sake of faster computation. From experiments we find that si ¼ 2 is a fair approximation. The value can be related to that when the seed vertex moves, the boundary of its Voronoi cell moves with about only half the speed of its seed vertex. This is only an experience value without theoretical justification, but in all our experiments it does work efficiently and never cause mesh degeneration. Combining the area minimization component and mesh optimization component, the final adjustment of a vertex Pi is vi ¼ vi J þ vi ? : 3.6. Existence of solution There is no unified energy in our method. So the existence of the final solution is not obvious. In this section we construct a model to show the existence of the solution. Assume that all the vertices of mesh M are fixed except the vertex Pi. According to the property of the normal (Section 3.2), ni is irrelevant to Pi. Thus a parallel fiber bundle F can be set up along ni in the space. For a constant c derived from surface tension energies (see Section 3.3), according to the convexity of Ai(t), a piece of fiber l A F contains a unique position xc A l, such that when Pi is put at xc , ∂A ni ¼ c: ∂x All the positions xc in the fibers l A F form a continuous surface S (Fig. 4) which is a section of F . Now suppose Pi is constrained on the surface S. Then the surface tension energy is trivially minimized, and the target boils down to mesh quality optimization, ! which is to find a point P i A S such that P i Gi J ni , where Gi is the barycenter of the Voronoi area of Pi. Considering that the point Gi is always centralized inside the 1-ring neighbors, we conjecture ! that a solution P i A S such that P i Gi J ni always exists. While our vertex normal motion would place Pi on S, the tangential ! vertex motion is designed to search for P i Gi J ni . As the same analysis applies to every mesh vertex, when our algorithm stops it finds the solution of the optimization problem as defined in Section 3.1.
Fig. 4. Visualization of solution space. The surface S is the space of points satisfying ∂A ∂x ni ¼ c, where c ¼ 2, ni ¼ ð0; 0; 1Þ, the coordinate points around Pi is kπ ð cos kπ 3 ; sin 3 ; 0Þ; k ¼ 0; 1; …; 5. The shape of S resembles a flattened hat, where the center and the outer area are higher.
3.7. Edge flipping operation We apply edge flipping operations to accompany the vertex tangential motions for achieving high mesh quality, as is standard for the CVT-based mesh optimization method [18] as well as other mesh improvement methods [11,17]. The edge flipping operation effectively constructs an extrinsic Delaunay triangulation of the mesh vertices, which is dual to the restricted Voronoi tessellation defined by the mesh vertices on the underlying surface. The principal condition of Delaunay triangulation is that the circumscribed circle of every triangular facet contains no other vertices. This is equivalent to that the sum of 2 angles facing a common edge is less than π (Fig. 5). As we flatten a pair of adjacent triangles P i P j P k and P j P i P k to plane, according to the property of the constant sum of inner angles, there is at most one of the following two equations holds:
▵
▵
∠P i P k P j þ ∠P j P k P l o π
ð14Þ
∠P k P i P l þ ∠P l P j P k o π
ð15Þ
If (14) holds, the edge P i P j meets the Delaunay condition; if (15) holds, edge P i P j can be flipped to form new facets ▵P k P i P l and ▵P l P j P k . Since flipping one edge may make adjacent edges illegal with respect to the Delaunay condition, we use a set data structure to keep all the potentially affected edges. The algorithm is shown in Algorithm 1. Algorithm 1. Edge flip algorithm.
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
55
4. Algorithmic details Algorithm 2 shows the procedure for constructing tensiondetermined surfaces. In the algorithm, algorithm 1 is called to improve the topological (i.e., edge connection) quality of the mesh. The calculation of the adjustment vi is summarized in Algorithm 3. Algorithm 2. Tension-determined surfaces generation algorithm.
Fig. 5. Delaunay condition.
precision for floating point numbers. To be specific, we treat r ðNÞ of the N-th iteration as a stable minimum when r ðN þ 1Þ ; r ðN þ 2Þ ; …; r ðN þ Nmax Þ are no smaller than r ðNÞ and no edge is flipped during the subsequent iterations N þ 1, …, N þ N max , for a certain preset value Nmax . The mesh at the N-th iteration is output as the resulting surface. Typically, we set N max to 100–300. The advantage of this termination condition is that the final result can approximate well up to the limit of the data type accuracy.
5. Experimental results and comparisons
Algorithm 3. Calculation of the adjustments for every vertex.
We evaluate the new TDS generation method in terms of the quality and accuracy of the output mesh and the allowed flexibility in modeling various TDS. Minimal surfaces, constant mean curvature surfaces and droplet surfaces will be taken as examples. Surface Evolver [17] and the CVT-CMC method [18] are considered the most powerful tools to generate such surfaces, and we shall make comparisons with them. All experiments were carried out on an Intel(R) Core(TM) i5-4590 3.30-GHz CPU (Intel Corp.) with 8 GB of memory. In Surface Evolver, every iteration contains a tension-determined energy minimization operation, an edge flip operation and a mesh optimization operation to generate and optimize the mesh simultaneously. Mesh qualities are expressed as the statistical distribution of the smallest angle of each facet of the resulting mesh. A better mesh should have the smallest angles of all facets equal to 60° approximately. 5.1. Minimal surface generation
4.1. Termination condition We take the maximum length of vertex movements as an indicator to trigger the termination of iterations: r ¼ maxjvi j; Pi A M
ð16Þ
where vi is the movement of Pi during an iteration. The iteration process terminates when r vanishes within the limit of machine
Minimal surfaces have the simplest tension-determined energy (E ¼A). While the ideal mean curvature of a continuous minimal surface is zero, the mean curvature of a triangular mesh requires a proper estimation [26]. The method by Meyer et al. [9] is known as the best discrete approximation of mean curvature by now, and is used here to evaluate the accuracy of mean curvature. Figs. 6 and 7 compare the resulting discrete approximation for two known minimal surfaces generated by Surface Evolver, the CVT-CMC method and our method. Approximated mean curvature at each vertex is color-coded and a dark blue surface indicates the desirable (close to) zero mean curvature. It can be seen that our method can generate accurate minimal surfaces in terms of mean curvature approximation that are comparable to those generated by Surface Evolver. 5.2. Constant mean curvature surface generation Constant mean curvature (CMC) surfaces can be generated by fixing the volume or by appending a volume determined energy to
56
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
Fig. 6. Schwarz minimal surface. (a) The input mesh that spans 6 boundary rings. (b) Surface Evolver attains high accuracy in approximating mean curvature, however, the mesh quality is unsatisfactory. (c) CVT method generates a discrete minimal surface with superior mesh quality, but with larger mean curvature errors. (d) Our method both ensures high accuracy in mean curvature and high mesh quality. While the curvature accuracy of our method is even better than that of Surface Evolver, the mesh quality is also comparable to the CVT-CMC method. (For interpretation of the references to color in this figure caption, the reader is referred to the web version of this paper.)
Fig. 8. Generating CMC surfaces with different volumes. (a) The input mesh that spans a screwed torus. It can be seen that the mean curvature error of the CVT-CMC method is generally large. Larger mean curvature errors appear at singular vertices; meshes generated by Surface Evolver had lower mesh quality and therefore suffers from worse mean curvature accuracy. Our method can achieve both high mesh quality and thus more accurate CMC surfaces. (For interpretation of the references to color in this figure caption, the reader is referred to the web version of this paper.)
volume. In order to make comparisons, we use linear search to determine the proper t for the CVT-CMC given a fixed volume. The theoretic mean curvature can also be calculated from the volume and we take λ in Eq. (8) as the ideal mean curvature. The mean curvature error is then determined by the difference between the discrete mean curvature approximation and the ideal mean curvature, and is color-coded at the vertices on the resulting meshes. From Fig. 8, we can see that our method achieves the best of both Surface Evolver and the CVT-CMC method in generating CMC surfaces of high mesh quality and high accuracy in mean curvature given a specific volume. We also point out that larger mean curvature errors are found at singular vertices, that is, vertices not of degree six. Therefore eliminating vertex singularities is necessary to generate more accurate surfaces. 5.3. Flexibility of allowed energy Fig. 7. Seifert surface. (a) The input mesh that spans the Borromean rings. The results of the different methods in (b), (c) and (d) show that our method is comparable to Surface Evolver in terms of mean curvature accuracy and to the CVT-CMC method in terms of mesh quality. Another point to note is that the mean curvature errors are larger at vertices with more negative Gauss curvatures. (For interpretation of the references to color in this figure caption, the reader is referred to the web version of this paper.)
the CVT energy [18]. While different fixed volumes can be specified in Surface Evolver and our method for generating CMC surfaces, this is not directly achievable for the CVT-CMC method since the coefficient t in Eq. (4) does not relate immediately to the
Our method can also append gravitational potential energy to the objective function just as Surface Evolver. Droplets can therefore be simulated. In our method, we can directly append the gravity component to the area A:
ρgz V; σ where σ is the surface tension coefficient; g is the gravity acceleration, z is the height. Then λ can be expressed as E ¼ Aþ
λ¼
X ∂A
Pi A M
∂xi
þ
ρgzi ∂V ∂V σ ∂xi ∂xi
,
∂V ∂xi
2
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
57
and (9) becomes ρg ∂V j: Ai 0 ðtÞ ¼ λ þ zi σ ∂xi The CVT-CMC method, on the other hand, cannot handle the gravitational potential energy because it is not clear how to incorporate gravity potential properly into the formulation. Therefore, we only compare with Surface Evolver in terms of mesh quality and the results are shown in Fig. 9. There are two common types of droplets in nature. The first one is the hanging droplet from a pipe, whose shape is affected by the radius of the pipe. Another one is the lying droplet, in which the contact angle of the droplet surface with the underlying plane plays an important role. Experimental comparisons show that our method yields droplets with higher mesh quality than Surface Evolver in both cases.
Fig. 10. Input mesh independence. From a simple mesh, two methods (random sampling and subdivision) are used to increase the number of facets and vertices and result in different mesh qualities. Our method produces the same level of output accuracy and quality for both inputs, while there are noticeable variations in the mean curvature errors for the output meshes generated by Surface Evolver.
5.4. Robustness to input mesh quality Starting from a simple mesh that spans a given boundary, an input mesh with a required vertex density can be generated by using either subdivision or random sampling with a subsequent remeshing step. Fig. 10 shows that our method can generate high quality and accurate TDS irrespective of the quality of the input mesh. This is due to the fact that our method takes advantage of the robust remeshing capability of the CVT method. We also note from our experiments that random sampling is better than subdivision for generating input meshes as it has more flexible control over the number of vertices of the final surfaces.
Fig. 11. Compatibility of constraints and energies. (a) is the minimal surface generation in the top of Fig. 10. (b) is the hemisphere generation in Fig. 12.
5.5. Convergence and timing In our framework, we expect the final converged result satisfies:
λ
ni ¼ 0 (if without volume control, λ ¼ 0); ! ! 2. P i Gi J ni or j PG ni j ¼ 0; 3. V ¼ V 0 (when there is volume control). 1.
∂A ∂V ∂xi þ ∂xi
The simultaneous satisfaction of the three conditions indicates the compatibility of the objectives of mesh quality optimization and
Fig. 9. Water drop generation. In (b) and (c), the same gravity acceleration ðg ¼ 9:806 m=s2 Þ is assigned to generate hanging droplets. The liquid property resembles that of water (ρ ¼ 998 kg=m3 , σ ¼ 0:073 N=m); the pipe radius is 2.5 mm and the volume is 0.075 mL. The same gravity and liquid property are used in (e) and (f). The contact angle is θ ¼ 3π 4 and the volume of liquid is 0.1 mL.
surface tension energy minimization. Since the three values get very close to 0, we compute and plot their logarithm values. The first two values are associated with every vertex, but we only show the largest among the vertices. From Fig. 11, we can see that the 3 indicators all converge to a small value less than 10 14 that is close to the limit of machine precision and is much smaller than the scale of the edge lengths of the mesh. This shows that we optimized the tension determined energy and mesh quality energy without conflict or unconvergence. Mesh optimization and tension-determined energy minimization are independent operations in Surface Evolver, and as discussed before, this does not resolve the conflict of the two objective functions. To evaluate the convergence of the methods and their computation time, we use the generation of the hemisphere as an example. All the coordinates of vertices of the mesh are recorded after each iteration for the methods. We then plot the logarithm of the maximal movement of the vertices (log 10 r) against the iterations (Fig. 12). It can be seen that the value log 10 r staggers around 4 for Surface Evolver, while for the CVT-CMC method and our method, the value can be less than 10 14 (Fig. 12 (a) and (b)). The CVT-CMC method converges much faster than others, because it has an objective function and applies the quasi-Newton L-BFGS optimization method for super-linear convergence [18]. Fig. 12(c) and (d) shows the time taken for each method when generating the Schwarz minimal surface and a hemisphere, respectively. We can see that in the minimal surface generation, our method takes a little more time than CVT-CMC method per iteration. However, the required iterations in CVT-CMC are much fewer than our method. So the total time consumption of our method is one order of magnitude more than CVT-CMC method. But in the fixed volume case, in order to make comparison, the volume weight (t in Eq. (4)) has to be determined by search to satisfy the volume constraint. So the CVT-CMC method is not easy to use in this case. The Surface Evolver takes the longest time per
58
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
Fig. 13. This example shows that when the shape of the input mesh (a) is far from the final mesh (a disk), the surface evolution will encounter singularities.
Fig. 12. Comparisons in convergence and computation time. (a) A hemisphere is generated using three methods. (b) Surface Evolver cannot attain a good convergence, while CVT method and our method can converge to less than 10 14, where CVT method converges very fast. (c) Time taken for generating the Schwarz minimal surface (Fig. 6). (d) Time taken for generating the hemisphere in (a). Surface evolver takes more time than CVT-CMC method and our method per iteration.
iteration, and it cannot reach a strict convergence, so it does not fit for high accuracy case. In terms of running time, the time consumption per iteration of our method depends on the number of vertices. From the generation of the hemisphere surface with 309 free vertices, every iteration per vertex consumes about 1:2 10 6 s, with 4074 iterations and 1452 s in total. Meanwhile, the Surface Evolver and CVT-CMC methods exhibit similar per iteration time costs, with values being 1:3 10 5 s and 3:4 10 6 s respectively.
6. Conclusions We presented a new scheme of computing tension-determined surfaces (TDS) with high mesh quality. Exploiting the behaviors of surface tension energies and mesh quality energy in the subspaces parallel and orthogonal to normal vector respectively, we have shown that projection is able to resolve the conflict between the two energies. Experiments showed that our method can attain both higher accuracy and superior mesh quality over existing methods. It allows volume control and the flexibility in handling more general energies by appending other potential energies, which is as flexible as Surface Evolver. We showed examples to confirm that combining the tension-determined energy and mesh quality energy with the projection method can achieve convergence than alternatively minimizing them. Limitation: There are several limitations with our method. First, as is common to geometric flow methods, if the shape of the input mesh is too far from the final surface, we may face singularities (Fig. 13). Second, the projection method does not have a unified energy function, so standard energy driven optimization methods like gradient descent or the accelerated optimization methods like (quasi-)Newton methods cannot be applied; on the other hand, our proposed scheme of searching in the two subspaces is like gradient descent, and does need more iterations to converge compared with for example the CVT-CMC method. Future work: In many surface generation problems, as long as the shape of a surface is changed by moving vertices along their
normal directions, our projection scheme can potentially be applied to improve the mesh quality at low computational costs. We shall further explore in this direction. Finding a unified objective function combining both area and mesh quality is another future work to achieve faster convergence. Our method can be used in other architectural geometry modeling tasks. Appending more degrees of freedom, e.g. different surface tension coefficients over the surface, can model structures satisfying more flexible architectural conditions (e.g. mechanical properties defined by materials). To explore such extensions and applications will be a practical work in the future. Kazhdan et al. [10] present a method to avoid singularities during the surface evolution by modifying the MCF. Combining their method with our projection method is another interesting research problem in the future.
Acknowledgments This work was supported in part by the National Natural Science Foundation of China (NSFC) (Nos. 61332015, 61572288, 61373078), the Fundamental Research Funds of Shandong University (No. 2015JC009).
Appendix Proof of (7) and (11). We take an arbitrary facet ▵P i P j P k , around Pi, then the area vector of ▵P i P j P k can be expressed as (Fig. 14): 1 ! ! Aijk ¼ ðP j P k P k P i Þ 2 When Pi is moved along its normal n with distance t, the area vector is changed to: t ! Aijk ðtÞ ¼ Aijk þ ðP j P k ni Þ 2 So the area can be expressed as 2 t ! A2ijk ðtÞ ¼ Aijk þ ðP j P k ni Þ 2 Eq. (17) can be transformed into the following form 0 12 ! ! ðP j P k ni Þ Aijk ðP j P k ni Þ2 @ 2 A t þ 2 ! Aijk ðtÞ ¼ 4 ðP j P k ni Þ2 ! ððP j P k ni Þ Aijk Þ2 þ ! ðP j P k ni Þ2
ð17Þ
L. Ma et al. / Computers & Graphics 61 (2016) 50–59
59
References
Fig. 14. Convex property of Ai(t).
From this equation, we can see that Aijk(t) has the form of qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi a þ bðt þ s0 Þ2 . Ai(t) is the sum of expressions of this form over the 1-ring neighbors. Because the 1-ring triangles are close to congruence after mesh quality improvement through tangential motions, the coefficients a; b; s0 would become very similar among all neighboring triangles as well. Thus we make the approximation qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi that Ai(t) has the same form of a þ bðt þ s0 Þ2 (Eq. (11)). Next we show that Ai(t) is a convex function. Take the derivatives for both sides of (17): Aijk ðtÞA0ijk ðtÞ ¼
2 1 ! 1 ! P P ni t þ ðP j P k ni Þ Aijk 4 j k 2
1 ! ¼ ðP j P k nÞ Aijk ðtÞ 2
ð18Þ
Then take derivatives for both sides of (18): 1 ! 2 Aijk ðtÞA″ijk ðtÞ þ A02 ijk ðtÞ ¼ ðP j P k ni Þ 4
ð19Þ
Subtract squared (18) from A2ijk ðtÞ times of (19): ! 1 ! A3ijk ðtÞA″ijk ðtÞ ¼ ððP j P k ni Þ2 A2ijk ðtÞ ððP j P k nÞ Aijk ðtÞÞ2 Þ 4 1 ! ¼ ððP j P k nÞ Aijk ðtÞÞ2 Z 0 4 According to Aijk ðtÞ Z 0, we can derive A″ijk ðtÞ Z 0 This means all the areas of the facets around Pi is a convex function about t, so does their sum Ai(t), which proves Eq. (7).
[1] Brew J, Lewis W. Computational form-finding of tension membrane structures non-finite element approaches: Part 1. Use of cubic splines in finding minimal surface membranes. Int J Numer Methods Eng 2003;56(5):651–68. [2] Chen KC, Chen PS, Wong SK. A hybrid method for water droplet simulation. In: Proceedings of the 11th ACM SIGGRAPH international conference on virtualreality continuum and its applications in industry. ACM; Ocean Engineering, 2012. p. 341–4. [3] Smith DR. Variational methods in optimization. Cour Corp 1998. [4] Oprea J. Differential geometry and its applications. MAA 2007. [5] Saff EB, Snider AD. Fundamentals of complex analysis for mathematics, science, and engineering. Prentice-Hall; 1976. [6] Meeks WH, Ros A, Rosenberg H, Pirola GP. The global theory of minimal surfaces in flat spaces Lecture Notes in Mathematics, Springer; 2002. [7] Pinkall U, Polthier K. Computing discrete minimal surfaces and their conjugates. Exp Math 1993;2(1):15–36. [8] Xu G, Pan Q, Bajaj CL. Discrete surface modelling using partial differential equations. Comput Aided Geom Des 2006;23(2):125–45. [9] Meyer M, Desbrun M, Schröder P, Barr AH. Discrete differential-geometry operators for triangulated 2-manifolds. In: Visualization and mathematics III. Springer; 2003, p. 35–57. [10] Kazhdan M, Solomon J, Benchen M. Can mean-curvature flow be modified to be non-singular. Comput Graph Forum 2012;31(5):1745–54. [11] Bobenko AI, Springborn BA. A discrete Laplace–Beltrami operator for simplicial surfaces. Discret Comput Geom 2007;38(4):740–56. [12] Crane K, Pinkall U, Schröder P. Robust fairing via conformal curvature flow. ACM Trans Graph 2013;32(4):61. [13] Elliott CM, Fritz H. On approximations of the curve shortening flow and of the mean curvature flow based on the deturck trick. IMA J Numer Anal 2016, 10. 1145/1174429.1174494. [14] Nealen A, Igarashi T, Sorkine O, Alexa M. Laplacian mesh optimization 2006. [15] Barrett JW, Garcke H, Nurnberg R. On the variational approximation of combined second and fourth order geometric evolution equations. SIAM J Sci Comput 2007. [16] Barrett JW, Garcke H, Nurnberg R. On the parametric finite element approximation of evolving hypersurfaces in r 3. J Comput Phys 2008;227(9):4281–307. [17] Brakke KA. The surface evolver. Exp Math 1992;1(2):141–65. [18] Pan H, Choi YK, Liu Y, Hu W, Du Q, Polthier K, et al. Robust modeling of constant mean curvature surfaces. ACM Trans Graph 2012;31(4) [85-]. [19] Zhang Y, Wang H, Wang S, Tong Y, Zhou K. A deformable surface model for real-time water drop animation. IEEE Trans Vis Comput Graph 2012;18 (8):1281–9. [20] Wang H, Mucha PJ, Turk G. Water drops on surfaces. ACM Trans Graph 2005;24(3):921–9. [21] Lu C, Cao Y, Mumford D. Surface evolution under curvature flows. J Vis Commun Image Represent 2002;13(1):65–81. [22] Desbrun M, Meyer M, Schröder P, Barr AH. Implicit fairing of irregular meshes using diffusion and curvature flow. In: Proceedings of the 26th annual conference on computer graphics and interactive techniques. ACM Press/AddisonWesley Publishing Co.; 1999. p. 317–24. [23] Brakke KA. Surface evolver manual. Mathematics Department, Susquehanna University, Selinsgrove, PA; 1994; 17870(2.24). [24] Dyer R, Zhang H, Möller T. Delaunay mesh construction. In: Symposium on geometry processing, 2007. p. 273–82. [25] Du Q, Faber V, Gunzburger M. Centroidal Voronoi tessellations: applications and algorithms. SIAM Rev 1999;41(4):637–76. [26] Polthier K, Rossman W. Discrete constant mean curvature surfaces and their index. In: Visualization and mathematics. Citeseer; 2002. p. 47–77.