GG hole filling with S-patches made easy Péter SalviBudapest University of Technology and EconomicsFebruary 27, 2020
Abstract
S-patches have been around for 30 years, but they are seldom used,and are considered more of a mathematical curiosity than a practical sur-face representation. In this article a method is presented for automaticallycreating S-patches of any degree or any number of sides, suitable for inclu-sion in a curve network with tangential continuity to the adjacent surfaces.The presentation aims at making the implementation straightforward; afew examples conclude the paper.
The S-patch [3] is the natural multi-sided generalization of the Bézier triangle.It has various nice mathematical properties, and has been known for a long time,but it has not become a standard surface representation like the tensor productBézier patch. It is easy to see why: the number of control points grows veryfast, and the control network becomes intricate even for surfaces of moderatecomplexity. For example, a 6-sided quintic patch has 252 control points (seeFigure 1), while a tensor product quintic surface has only 36.Interactive placement of such a large number of points is hardly possible, butthis does not mean that the whole representation should be discarded as imprac-tical. As we will see in the rest of the paper, it is particularly suitable for fillingmulti-sided holes while ensuring tangential continuity to adjacent surfaces—animportant problem in curve network based design.
A solution for hole filling with S-patches was first presented in [4], where quadraticand cubic surfaces are created based on Sabin nets. Although the equationsshown in the paper are also valid for higher degrees, some of the details areleft for the reader to figure out. The placement of interior control points, inparticular, is not discussed for degrees above cubic.A recent S-patch-based construction [2] gives a simple mechanism for G -continuous hole filling, even without twist constraints, but only for cubic bound-aries. Also, there are no details on the placement of interior control points.Generalized Bézier (GB) patches [7] present another approach to representmulti-sided Bézier surfaces. Tangential connection to adjacent patches is easilyachieved, and its simple control point structure makes it possible to edit the1 a r X i v : . [ c s . G R ] F e b igure 1: The control net of a 6-sided quintic S-patch.surface interior interactively. On the other hand, some common operations, likeanalytic derivative computation or exact degree elevation, are difficult or noteven possible.Transfinite surfaces (e.g. [6]) can also be used to fill multi-sided holes whenthe boundaries are not necessarily Bézier curves; some even have a limitedcontrol over the interior. An n -sided S-patch is defined over an n -gon, parameterized by generalized bary-centric coordinates λ = ( λ , . . . , λ n ) , e.g. Wachspress or mean value coordinates.(In the current paper, we will always use a regular polygon as the domain.) Itscontrol points { P s } are labeled by n non-negative integers whose sum is thedegree of the surface ( d ). We will use the notation L n,d for the set of all suchlabels, and ( s , . . . , s n ) = s ∈ L n,d for one particular label. It is easy to see that | L n,d | = (cid:0)(cid:0) nd (cid:1)(cid:1) = (cid:0) n + d − d (cid:1) .The surface point corresponding to a domain point with barycentric coordi-nates λ is defined as S ( λ ) = (cid:88) s ∈ L n,d P s · B d s ( λ ) = (cid:88) s ∈ L n,d P s · d ! (cid:81) ni =1 s i ! · n (cid:89) i =1 λ s i i , (1)where B d s ( λ ) are Bernstein polynomials with multinomial coefficients.The labeling system deserves closer inspection. We define the shift operation σ ± j ( s ) as decrementing s j and incrementing s j ± in label s , e.g. σ +2 (1 , ,
1) =(1 , , and σ − (1 , ,
2) = (0 , , . (Note that label indexing is cyclical.) P s issaid to be adjacent or connected to P ˆs , if σ ± j ( s ) = ˆs for some j . Also called the depth of the S-patch, to differentiate it from the (rational) polynomialdegree of the surface. We will not make this distinction here. Figure 2: The control net of a 5-sided cubic S-patch with labels. The boundarypanels on side 1 are highlighted.Control points with labels such that s i + s i +1 = d are on the i -th boundary,e.g. (0 , , , , , ∈ I , or (2 , , , , ∈ I , . Specifically, the j -th point onthe boundary has a label for which s i = d − j and s i +1 = j , ≤ j ≤ d (seeFigure 2). We will also refer to these labels by the notation s i,j .Differentiation of Eq. (1) shows that the first cross derivative at a boundarypoint is a combination of control points with labels such that s i + s i +1 ≥ d − for some i . These can be grouped on each side into d boundary panels . The j -thpanel consists of n points: s i,j , σ + j ( s i,j ) , σ + j +1 ( σ + j ( s i,j )) , σ + j +2 ( σ + j +1 ( σ + j ( s i,j ))) , . . . , until we get back to s i,j . The k -th point of this panel is also denoted by P ij,k , so P ij, = P ij +1 , . For example, in the five-sided cubic patch in Figure 2, { P ,k } contains control points with labels (0 , , , , , (0 , , , , , (0 , , , , , (1 , , , , , and (0 , , , , . Now that S-patches are defined, we can turn our attention to the n -sided holefilling problem. Let the boundary curves be given in Bézier form, with a commondegree d . Cross-derivative constraints are represented by a second row of controlpoints on all sides; the two control rows together are called a Bézier ribbon [7].We need to construct a surface that matches, for each side, the derivatives of a d × d -degree tensor product Bézier patch with the same two control rows, seeFigure 3a. 3 a) Boundary constraints(b) G boundary panels(c) Interior control points Figure 3: Stages of filling a five-sided hole with quintic boundary constraints.4et C ij,k denote the j -th control point in the k -th row on the i -th side ( ≤ i ≤ n , ≤ j ≤ d , ≤ k ≤ ). We assume that the constraints are twist-compatible, i.e., C i , = C i − d − , , C i , = C i − d, and C i , = C i − d − , for each i (usingcyclic indexing). This form of the boundary constraints is called a Sabin net in [4].The rest of this section will describe how to compute the correct boundarypanels for G interpolation of the cross-derivatives (Figure 3b), and how to setthe position of the remaining control points automatically (Figure 3c). G boundaries This section is based on [4], where the derivation of these equations can befound. In the paper explicit formulas are only given for the special cases of d = 2 and ; here we will look at the general degree case for the convenience ofthe reader.Before diving into the intricacies of tangential continuity, it is important tonote that the boundaries of an S-patch are Bézier curves with P ij, ( ≤ j ≤ d )as the control polygons, so if positional ( C ) interpolation is enough, it can bedone by setting P ij, = C ij, for every i and j .The conditions of tangential continuity with a Bézier triangle (or anotherS-patch) of the same degree are simple: (i) each boundary panel should be theaffine image of the domain polygon, and (ii) opposite boundary panels alongthe common boundary should be in the same plane.From (i) it follows that it suffices to set 3 points of each panel, 2 of whichare on the boundary, so only one extra point is needed, e.g. P ij,n . The n -sidedsetting introduces additional constraints, which can be satisfied only with anS-patch of degree d + 3 . Eventually we arrive at the equation P ij,n = P ij, + d ( d + 3) (cid:20) δ d ( j ) (cid:0) C ij, − C ij − , (cid:1) · c (cid:18) d − j − (cid:19) + δ d +12 ( j ) (cid:0) C ij − , − C ij − , (cid:1) · c (cid:18) d − j − (cid:19) + δ d +23 ( j ) (cid:0) C ij − , − C ij − , (cid:1) · c (cid:18) d − j − (cid:19) + δ d ( j ) (cid:0) C ij, − C ij, (cid:1) · (cid:18) dj (cid:19) + δ d +11 ( j ) (cid:0) C ij − , − C ij − , (cid:1) · (2 + 2 c ) (cid:18) dj − (cid:19) + δ d +22 ( j ) (cid:0) C ij − , − C ij − , (cid:1) · (cid:18) dj − (cid:19)(cid:21) / (cid:18) d + 2 j (cid:19) , (2)where c = − cos(2 π/n ) and δ hl ( j ) = (cid:40) l ≤ j ≤ h otherwise (3)(The boundary control points P ij, can be computed as in the C case, afterdegree elevating the Bézier ribbon 3 times.)5 1 01 -4
10 1 0 (a) Harmonic mask -8 10 2 -8 2 00 0 1 0 0 (b) Biharmonic mask Table 1: Masks used on tensor product Bézier control networks. The numberin bold is the coefficient of the control point the mask is applied to.The remaining control points in a panel are computed by the affine trans-formation. After solving π/n ) sin(2 π/n ) 1cos(4 π/n ) sin(4 π/n ) 1 · M T = ( P ij,n ) T ( P ij, ) T ( P ij, ) T (4)for M T , we get P ij,k = M · (cid:2) cos(2 kπ/n ) sin(2 kπ/n ) 1 (cid:3) T . (5) There are various heuristics for the placement of interior control points, mainlyfor lower-degree patches. The procedure presented here works for any S-patch,independently of the number of sides, the degree, or the type of continuity. It isbased on the work of Farin et al. [1], which shows that applying discrete maskson the control network of a tensor product Bézier surface can result, dependingon the masks used, in a Coons patch or a quasi-minimal surface. Monterdeet al. [5] investigated harmonic and biharmonic masks, and these are easilyapplicable to S-patches, as well.Table 1a shows the harmonic mask. For a tensor product Bézier patch withcontrol points Q i,j , this represents the equation system Q i +1 ,j + Q i − ,j + Q i,j +1 + Q i,j − − Q i,j = 0 , (6)i.e., each control point should be the average of its neighbors. If we fix theoutermost control rows, the system can be solved, resulting in a smooth distri-bution of points. This can be directly applied to S-patches, using the adjacencyrelation defined in Section 3. Note, however, that there can be different maskseven within one patch, as the valency of control points may vary.When the cross-derivatives are fixed at the boundary, it is natural to use abiharmonic mask (see Table 1b). This is computed by applying the harmonicmask on itself, which translates to S-patches in a straightforward way, see Al-gorithm 1. All examples in this paper were computed by this method. Surface quality of S-patches generated by the above procedure are generallyvery good, an example is shown in Figure 4. The 5-sided quintic Bézier ribbon6 lgorithm 1
Computing harmonic and biharmonic masks. harmonicMask(i):neighbors = indices adjacent to ifor j in neighbors:mask[j] = 1mask[i] = -length(neighbors)return mask biharmonicMask(i):mask = 0 for all indices for (j,wj) in harmonicMask(i):for (k,wk) inharmonicMask(j):mask[k] += wj * wkreturn mask
Figure 4: Isophotes of the surface shown in Figure 3c.comprises 40 control points, while the degree-elevated S-patch has 495 points(135 in boundary panels, 360 in the interior). G connection between adjacent surfaces is illustrated in Figure 5. Conclusion and future work
We have seen that S-patches can be useful as surfaces filling boundary loopsin curve networks. An explicit construction was shown that achieves tangentialcontinuity with adjacent surfaces by fixing the boundary panels of the patch.For the placement of the unconstrained control points, a new algorithm waspresented that can be used with surfaces of any degree.There are several interesting questions remaining, such as the effect of themasks on the surface (does it minimize some functional?), or a generalizationto curvature continuous connections.
Acknowledgements
This work was supported by the Hungarian Scientific Research Fund (OTKA,No. 124727). The author thanks Tamás Várady for his valuable comments.7igure 5: S-patches connected with G continuity (left: ribbons, right: con-tours). References [1] Gerald Farin and Dianne Hansford. Discrete Coons patches.
ComputerAided Geometric Design , 16(7):691–700, 1999.[2] Gerben J. Hettinga and Jiří Kosinka. Multisided generalisations of Gregorypatches.
Computer Aided Geometric Design , 62:166–180, 2018.[3] Charles T. Loop and Tony D. DeRose. A multisided generalization of Béziersurfaces.
ACM Transactions on Graphics , 8(3):204–234, 1989.[4] Charles T. Loop and Tony D. DeRose. Generalized B-spline surfaces of ar-bitrary topology. In , SIGGRAPH, pages 347–356. ACM, 1990.[5] Juan Monterde and Hassan Ugail. On harmonic and biharmonic Béziersurfaces.
Computer Aided Geometric Design , 21(7):697–715, 2004.[6] Péter Salvi, István Kovács, and Tamás Várady. Computationally efficienttransfinite patches with fullness control. In
Proceedings of the Workshop onthe Advances of Information Technology , pages 96–100, 2017.[7] Tamás Várady, Péter Salvi, and György Karikó. A multi-sided Bézier patchwith a simple control structure.