# G^1 hole filling with S-patches made easy

S-patches have been around for 30 years, but they are seldom used, and are considered more of a mathematical curiosity than a practical surface representation. In this article a method is presented for automatically creating S-patches of any degree or any number of sides, suitable for inclusion in a curve network with tangential continuity to the adjacent surfaces. The presentation aims at making the implementation straightforward; a few examples conclude the paper.

## Authors

• 5 publications
• ### Smooth surface interpolation using patches with rational offsets

We present a new method for the interpolation of given data points and a...
02/03/2016 ∙ by Miroslav Lávička, et al. ∙ 0

• ### Toric degenerations of Bezier patches

The control polygon of a Bezier curve is well-defined and has geometric ...
06/25/2010 ∙ by Luis David Garcia-Puente, et al. ∙ 0

• ### Analytic Definition of Curves and Surfaces by Parabolic Blending

A procedure for interpolating between specified points of a curve or sur...
03/22/2005 ∙ by A. W. Overhauser, et al. ∙ 0

• ### Marching Surfaces: Isosurface Approximation using G^1 Multi-Sided Surfaces

Marching surfaces is a method for isosurface extraction and approximatio...
02/07/2015 ∙ by Gustavo Chávez, et al. ∙ 0

• ### Computationally efficient transfinite patches with fullness control

Transfinite patches provide a simple and elegant solution to the problem...
02/25/2020 ∙ by Péter Salvi, et al. ∙ 0

• ### Towards Hiding Adversarial Examples from Network Interpretation

Deep networks have been shown to be fooled rather easily using adversari...
12/06/2018 ∙ by Akshayvarun Subramanya, et al. ∙ 0

• ### On the CAD-compatible conversion of S-patches

S-patches have many nice mathematical properties. It is known since thei...
02/25/2020 ∙ by Péter Salvi, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

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 product Bézier patch. It is easy to see why: the number of control points grows very fast, and the control network becomes intricate even for surfaces of moderate complexity. For example, a 6-sided quintic patch has 252 control points (see Figure

1), while a tensor product quintic surface has only 36.

Interactive placement of such a large number of points is hardly possible, but this does not mean that the whole representation should be discarded as impractical. As we will see in the rest of the paper, it is particularly suitable for filling multi-sided holes while ensuring tangential continuity to adjacent surfaces—an important problem in curve network based design.

## 2 Previous work

A solution for hole filling with S-patches was first presented in [4], where quadratic and cubic surfaces are created based on Sabin nets. Although the equations shown in the paper are also valid for higher degrees, some of the details are left for the reader to figure out. The placement of interior control points, in particular, is not discussed for degrees above cubic.

A recent S-patch-based construction [2] gives a simple mechanism for -continuous hole filling, even without twist constraints, but only for cubic boundaries. Also, there are no details on the placement of interior control points.

Generalized Bézier (GB) patches [7] present another approach to represent multi-sided Bézier surfaces. Tangential connection to adjacent patches is easily achieved, and its simple control point structure makes it possible to edit the surface interior interactively. On the other hand, some common operations, like analytic derivative computation or exact degree elevation, are difficult or not even possible.

Transfinite surfaces (e.g. [6]) can also be used to fill multi-sided holes when the boundaries are not necessarily Bézier curves; some even have a limited control over the interior.

## 3 S-patches

An -sided S-patch is defined over an -gon, parameterized by generalized barycentric coordinates , e.g. Wachspress or mean value coordinates. (In the current paper, we will always use a regular polygon as the domain.) Its control points are labeled by non-negative integers whose sum is the degree111Also called the depth of the S-patch, to differentiate it from the (rational) polynomial degree of the surface. We will not make this distinction here. of the surface (). We will use the notation for the set of all such labels, and for one particular label. It is easy to see that .

The surface point corresponding to a domain point with barycentric coordinates is defined as

 S(λ)=∑s∈Ln,dPs⋅Bds(λ)=∑s∈Ln,dPs⋅d!∏ni=1si!⋅n∏i=1λsii, (1)

where are Bernstein polynomials with multinomial coefficients.

The labeling system deserves closer inspection. We define the shift operation as decrementing and incrementing in label , e.g.  and . (Note that label indexing is cyclical.) is said to be adjacent or connected to , if for some .

Control points with labels such that are on the -th boundary, e.g.  or . Specifically, the -th point on the boundary has a label for which and , (see Figure 2). We will also refer to these labels by the notation .

Differentiation of Eq. (1) shows that the first cross derivative at a boundary point is a combination of control points with labels such that for some . These can be grouped on each side into boundary panels. The -th panel consists of points:

 si,j, σ+j(si,j), σ+j+1(σ+j(si,j)), σ+j+2(σ+j+1(σ+j(si,j))), …,

until we get back to . The -th point of this panel is also denoted by , so . For example, in the five-sided cubic patch in Figure 2, contains control points with labels , , , , and .

## 4 Hole filling

Now that S-patches are defined, we can turn our attention to the -sided hole filling problem. Let the boundary curves be given in Bézier form, with a common degree . Cross-derivative constraints are represented by a second row of control points 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 -degree tensor product Bézier patch with the same two control rows, see Figure (a)a.

Let denote the -th control point in the -th row on the -th side (, , ). We assume that the constraints are twist-compatible, i.e., , and for each (using cyclic 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 boundary panels for interpolation of the cross-derivatives (Figure (b)b), and how to set the position of the remaining control points automatically (Figure (c)c).

### 4.1 G1 boundaries

This section is based on [4], where the derivation of these equations can be found. In the paper explicit formulas are only given for the special cases of and ; here we will look at the general degree case for the convenience of the reader.

Before diving into the intricacies of tangential continuity, it is important to note that the boundaries of an S-patch are Bézier curves with () as the control polygons, so if positional () interpolation is enough, it can be done by setting for every and .

The conditions of tangential continuity with a Bézier triangle (or another S-patch) of the same degree are simple: (i) each boundary panel should be the affine image of the domain polygon, and (ii) opposite boundary panels along the common boundary should be in the same plane.

From (i) it follows that it suffices to set 3 points of each panel, 2 of which are on the boundary, so only one extra point is needed, e.g. . The -sided setting introduces additional constraints, which can be satisfied only with an S-patch of degree . Eventually we arrive at the equation

 Pij,n =Pij,1+d(d+3)[δd1(j)(Cij,0−Cij−1,0)⋅2c(d−1j−1)+ δd+12(j)(Cij−1,0−Cij−2,0)⋅4c(d−1j−2)+ δd+23(j)(Cij−2,0−Cij−3,0)⋅2c(d−1j−3)+ δd0(j)(Cij,1−Cij,0)⋅(dj)+ δd+11(j)(Cij−1,1−Cij−1,0)⋅(2+2c)(dj−1)+
 δd+22(j)(Cij−2,1−Cij−2,0)⋅(dj−2)]/(d+2j), (2)

where and

 δhl(j)={1l≤j≤h0otherwise (3)

(The boundary control points can be computed as in the case, after degree elevating the Bézier ribbon 3 times.)

The remaining control points in a panel are computed by the affine transformation. After solving

 ⎡⎢⎣101cos(2π/n)sin(2π/n)1cos(4π/n)sin(4π/n)1⎤⎥⎦⋅MT=⎡⎢ ⎢ ⎢⎣c(Pij,n)T(Pij,1)T(Pij,2)T⎤⎥ ⎥ ⎥⎦ (4)

for , we get

 (5)

### 4.2 Interior control points

There are various heuristics for the placement of interior control points, mainly for 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 is based on the work of Farin et al.

[1], which shows that applying discrete masks on the control network of a tensor product Bézier surface can result, depending on the masks used, in a Coons patch or a quasi-minimal surface. Monterde et al. [5] investigated harmonic and biharmonic masks, and these are easily applicable to S-patches, as well.

Table (a)a shows the harmonic mask. For a tensor product Bézier patch with control points , this represents the equation system

 Qi+1,j+Qi−1,j+Qi,j+1+Qi,j−1−4Qi,j=0, (6)

i.e., each control point should be the average of its neighbors. If we fix the outermost control rows, the system can be solved, resulting in a smooth distribution of points. This can be directly applied to S-patches, using the adjacency relation defined in Section 3. Note, however, that there can be different masks even 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 a biharmonic mask (see Table (b)b). This is computed by applying the harmonic mask on itself, which translates to S-patches in a straightforward way, see Algorithm 1. All examples in this paper were computed by this method.

## 5 Examples

Surface quality of S-patches generated by the above procedure are generally very good, an example is shown in Figure 4. The 5-sided quintic Bézier ribbon comprises 40 control points, while the degree-elevated S-patch has 495 points (135 in boundary panels, 360 in the interior).

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 loops in curve networks. An explicit construction was shown that achieves tangential continuity with adjacent surfaces by fixing the boundary panels of the patch. For the placement of the unconstrained control points, a new algorithm was presented that can be used with surfaces of any degree.

There are several interesting questions remaining, such as the effect of the masks on the surface (does it minimize some functional?), or a generalization to 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.

## References

• [1] Gerald Farin and Dianne Hansford. Discrete Coons patches. Computer Aided Geometric Design, 16(7):691–700, 1999.
• [2] Gerben J. Hettinga and Jiří Kosinka. Multisided generalisations of Gregory patches. Computer Aided Geometric Design, 62:166–180, 2018.
• [3] Charles T. Loop and Tony D. DeRose. A multisided generalization of Bézier surfaces. ACM Transactions on Graphics, 8(3):204–234, 1989.
• [4] Charles T. Loop and Tony D. DeRose. Generalized B-spline surfaces of arbitrary topology. In 17th Conference on Computer Graphics and Interactive Techniques, SIGGRAPH, pages 347–356. ACM, 1990.
• [5] Juan Monterde and Hassan Ugail. On harmonic and biharmonic Bézier surfaces. Computer Aided Geometric Design, 21(7):697–715, 2004.
• [6] Péter Salvi, István Kovács, and Tamás Várady. Computationally efficient transfinite patches with fullness control. In Proceedings of the Workshop on the 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 patch with a simple control structure. Computer Graphics Forum, 35(2):307–317, 2016.