g2 surface interpolation over general topology curve...

10
Pacific Graphics 2014 J. Keyser, Y. J. Kim, and P. Wonka (Guest Editors) Volume 33 (2014), Number 7 G 2 Surface Interpolation Over General Topology Curve Networks Péter Salvi, Tamás Várady Budapest University of Technology and Economics Abstract The basic idea of curve network-based design is to construct smoothly connected surface patches, that interpolate boundaries and cross-derivatives extracted from the curve network. While the majority of applications demands only tangent plane (G 1 ) continuity between the adjacent patches, curvature continuous connections (G 2 ) may also be required. Examples include special curve network configurations with supplemented internal edges, “master- slave” curvature constraints, and general topology surface approximations over meshes. The first step is to assign optimal surface curvatures to the nodes of the curve network; we discuss different optimization procedures for various types of nodes. Then interpolant surfaces called parabolic ribbons are created along the patch boundaries, which carry first and second derivative constraints. Our construction guarantees that the neighboring ribbons, and thus the respective transfinite patches, will be G 2 continuous. We extend Gregory’s multi-sided surface scheme in order to handle parabolic ribbons, involving the blending functions, and a new sweepline parameterization. A few simple examples conclude the paper. Categories and Subject Descriptors (according to ACM CCS): Computer Graphics [I.3.5]: Computational Geometry and Object Modeling—curvenet-based design, transfinite surfaces, Gregory patches, G 2 continuity 1. Introduction In curve network-based design, surface models are directly defined by a collection of free-form curves, arranged into a single 3D network with general topology. Curves may come from (i) sketch input, (ii) feature curves extracted from orthogonal views, (iii) curves traced on triangular meshes or (iv) direct 3D editing. Once the curves are defined, all the surfaces are generated automatically. This calls for a repre- sentation based on geometric information extracted solely from the boundaries. Transfinite surface interpolation is a natural choice, as it does not require a grid of control points to define the interior shape, and all n boundaries are han- dled uniformly, unlike in the case of trimmed quadrilateral surfaces. The ability to interactively edit prescribed bound- aries and cross-derivatives is also an advantage in contrast to recursive subdivision schemes. The first step of surface generation is to compute cross- directional data, such as tangent planes and curvatures that are shared by adjacent patches. Then interpolant surfaces, called ribbons, are generated, that carry first or second- degree cross-derivative constraints to be eventually interpo- lated by the transfinite surfaces. The majority of multi-sided transfinite surfaces are de- fined over convex domains, combining only linear ribbon surfaces and enabling G 1 continuity between the adjacent patches. At the same time, there are several practical design situations, where this approach is not sufficient, and higher degree continuity is required. (i) It often occurs that additional curves need to be in- serted into the curve network to make it suitable for apply- ing patches with convex domains. The supplemented curves must be compatible with the already defined ribbons, and it is particularly important to produce seamless transitions along these curves. Examples include handling curve con- figurations with concave angles, or connecting disjoint loops with prescribed slopes (see Figure 9 later in Section 5). (ii) Another important situation is when a designer wants to create a G 2 connection based on two existing G 1 patches. He may want to retain one surface (the master), and modify the adjacent patch (the slave) accordingly, see Figure 8, or may prefer an averaged target curvature, see Figure 7. c 2014 The Author(s) Computer Graphics Forum c 2014 The Eurographics Association and John Wiley & Sons Ltd. Published by John Wiley & Sons Ltd.

Upload: others

Post on 17-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

Pacific Graphics 2014J. Keyser, Y. J. Kim, and P. Wonka(Guest Editors)

Volume 33 (2014), Number 7

G2 Surface Interpolation OverGeneral Topology Curve Networks

Péter Salvi, Tamás Várady

Budapest University of Technology and Economics

AbstractThe basic idea of curve network-based design is to construct smoothly connected surface patches, that interpolateboundaries and cross-derivatives extracted from the curve network. While the majority of applications demandsonly tangent plane (G1) continuity between the adjacent patches, curvature continuous connections (G2) may alsobe required. Examples include special curve network configurations with supplemented internal edges, “master-slave” curvature constraints, and general topology surface approximations over meshes.The first step is to assign optimal surface curvatures to the nodes of the curve network; we discuss differentoptimization procedures for various types of nodes. Then interpolant surfaces called parabolic ribbons are createdalong the patch boundaries, which carry first and second derivative constraints. Our construction guarantees thatthe neighboring ribbons, and thus the respective transfinite patches, will be G2 continuous. We extend Gregory’smulti-sided surface scheme in order to handle parabolic ribbons, involving the blending functions, and a newsweepline parameterization. A few simple examples conclude the paper.

Categories and Subject Descriptors (according to ACM CCS): Computer Graphics [I.3.5]: Computational Geometryand Object Modeling—curvenet-based design, transfinite surfaces, Gregory patches, G2 continuity

1. Introduction

In curve network-based design, surface models are directlydefined by a collection of free-form curves, arranged intoa single 3D network with general topology. Curves maycome from (i) sketch input, (ii) feature curves extracted fromorthogonal views, (iii) curves traced on triangular meshesor (iv) direct 3D editing. Once the curves are defined, all thesurfaces are generated automatically. This calls for a repre-sentation based on geometric information extracted solelyfrom the boundaries. Transfinite surface interpolation is anatural choice, as it does not require a grid of control pointsto define the interior shape, and all n boundaries are han-dled uniformly, unlike in the case of trimmed quadrilateralsurfaces. The ability to interactively edit prescribed bound-aries and cross-derivatives is also an advantage in contrast torecursive subdivision schemes.

The first step of surface generation is to compute cross-directional data, such as tangent planes and curvatures thatare shared by adjacent patches. Then interpolant surfaces,called ribbons, are generated, that carry first or second-

degree cross-derivative constraints to be eventually interpo-lated by the transfinite surfaces.

The majority of multi-sided transfinite surfaces are de-fined over convex domains, combining only linear ribbonsurfaces and enabling G1 continuity between the adjacentpatches. At the same time, there are several practical designsituations, where this approach is not sufficient, and higherdegree continuity is required.

(i) It often occurs that additional curves need to be in-serted into the curve network to make it suitable for apply-ing patches with convex domains. The supplemented curvesmust be compatible with the already defined ribbons, andit is particularly important to produce seamless transitionsalong these curves. Examples include handling curve con-figurations with concave angles, or connecting disjoint loopswith prescribed slopes (see Figure 9 later in Section 5).

(ii) Another important situation is when a designer wantsto create a G2 connection based on two existing G1 patches.He may want to retain one surface (the master), and modifythe adjacent patch (the slave) accordingly, see Figure 8, ormay prefer an averaged target curvature, see Figure 7.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and JohnWiley & Sons Ltd. Published by John Wiley & Sons Ltd.

Page 2: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

n = 2

n = 3

n > 3

Figure 1: Node configurations by # of independent curves.

(iii) A third example is when we have a general topologycurve network defined over a mesh and would like to obtaina good approximation of the interior data points (see Fig-ure 10). Clearly, if we extract not only the normal vectors,but also curvature information from the underlying mesh,approximation will be more accurate.

In this paper our interest is to generate smooth, cur-vature continuous transfinite surface patches over a curvenetwork using parabolic ribbons. This is a complex topic,and most papers in the literature only deal with one ofits specific facets. Twist compatibility of bi-parametric sur-face patches around vertices was studied, amongst others,in [Sel81, Pet91], the construction and the properties ofcurve networks were investigated in [VH96, Her96]. Thenecessary conditions to embed a curve network into a G2

surface were recently analyzed in [HPS12]. Methods to cre-ate fair curve networks were suggested in [MS94]. Curva-ture continuous extensions of the Gregory patch were pro-posed in [GH89, HM99]. Recent developments in transfinitesurface interpolation also include two new multi-sided patchrepresentations proposed in [SVR14].

In this paper, we try to give a comprehensive view of thesubject, examining general topology curve networks, surfacecurvatures at vertices, twist compatibility, ribbon generation,and transfinite surface representations, as well as some prac-tical applications.

The rest of the paper is organized as follows. In Section 2we discuss how to assign optimal surface curvatures to thevertices of the network, that make G2 interpolation possible.Then, in Section 3, methods to compute linear and parabolicinterpolants are discussed. In Section 4, we introduce an ex-tended scheme of Gregory patches, using a new sweeplineparameterization, that merges parabolic ribbons and thus en-ables curvature continuous connections. A few examples il-lustrate our surface scheme in Section 5.

2. Surface Curvatures for G2 networks

Prior to generating our surface model, we need to ensure thatthe defining network is G2. We need to assign optimal sur-face curvatures to the vertices, and in special cases slightlyadjust some curves to meet the G2 conditions.

In this section we will focus on how to determine opti-

mal surface curvatures in different cases. Assume we haven (at least C2 continuous) curves meeting at a vertex; someof them terminates there, others pass through it. Here n de-notes the number of “independent” curves, which is not nec-essarily equal to the valence of the vertex. For example, thevalence of an X-node is four, but it represents only two in-dependent curves (Figure 1).

We assume that the curves share a common tangent plane.This has a local coordinate system; the tangent of the ithcurve spans an angle ωi with the local x-axis. Each curveis also characterized by its normal curvature, denoted by ki.We want to determine an optimal surface curvature, that isdefined by two unknown principal curvatures κ1 and κ2, andan unknown orientation of the first principal direction, de-fined by the angle λ = ∠(e1,x) to the x axis. Assume thatthese quantities are known, then the normal curvature at an-gle ω is defined by Euler’s equation

κ(ω) = κ1 cos2(ω−λ)+κ2 sin2(ω−λ). (1)

Our goal is to compute an optimal triplet of (κ1,κ2,λ), thatminimizes the given normal curvature deviations in leastsquares sense, i.e.,

n

∑i=1

(κ(ωi)− ki)2 = min . (2)

We will follow the approach suggested in [VH96], wherethe above non-linear system of equations is transformedinto a linear system using another triplet of unknowns(W1,W2,W12), where

W1 = κ1 cos2λ+κ2 sin2

λ, (3)

W2 = κ1 sin2λ+κ2 cos2

λ, (4)

W12 = (κ1−κ2)sinλcosλ. (5)

Using these quantities the curvature constraints are

κ(ωi) =W1 cos2ωi +W2 sin2

ωi +W122sinωi cosωi. (6)

After computing (W1,W2,W12), the optimal surface curva-ture (κ1,κ2,λ) can be easily determined. We will further an-alyze the above general approach for various n values. In thispaper we have extended the basic algorithm of [VH96] tomeet the requirements of G2 curvenet-based design, notablycases (i) and (iv).

(i) Underdetermined case. Corner nodes, T-nodes and X-nodes are very frequently encountered in free-form curvenetworks (Figure 1, n = 2). In this case, we have two con-straints and three unknowns, thus the system is underdeter-mined and an additional constraint is needed. We proposeminimizing the squared sum of the principal curvature radii,which attempts to avoid flat surface areas and equalize thetwo values. The optimization

κ(ωi) = ki, i ∈ {1,2} (7)1κ2

1+

1κ2

2= min . (8)

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 3: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

Figure 2: Normal fence and mean curvature map.

leads to a third-degree equation — details can be found inAppendix A. There are two exceptions: at umbilical pointsk1 = k2, so we set κ1 and κ2 accordingly, and choose λ ar-bitrarily. When one of the curvatures, say k2, is zero (e.g. atthe side of a cylinder), the larger principal curvature κ1 isuniquely determined, substituting ω1 into Euler’s equation.

(ii) Solving the system. Typical edge configurations forn = 3 — Y-node, T-node with two legs, etc. — are de-picted in Figure 1. We have three constraints and three un-knowns, so we can solve the system, and the surface cur-vature matches the three prescribed normal curvatures. Thespecial situations of (i) need to be treated here, as well. (Analternative method was proposed in [VH96] to avoid hyper-bolic surface curvatures, when possible.)

(iii) Minimizing the system. For n > 3, we perform theabove least-squares minimization, but the result surface cur-vature only approximates the prescribed normal curvatures.As we wish to have an exact match, the curves involved mayneed to be modified. Details of this algorithm are discussedin [VH96], as well. Our practical experience shows that themajority of vertex nodes will fall into cases (i) or (ii), andcurve tweaking occurs only in a few cases. Even then, thechanges are relatively small, hardly noticeable visually.

(iv) Constrained minimization. There is a special case ofn > 3, when we wish to optimize surface curvature, whileone particular curvature constraint κ(ω0) = k0 must be re-tained. We minimize the expression ∑(κ(ωi)− ki)

2 usingthe Lagrange multiplicator method. Details can be found inAppendix A. We will apply this calculation for averagingsurface curvatures in the next section.

3. Computing Ribbons

As discussed earlier, cross-derivatives need to be extractedsolely from the curve network. Once two ribbons on the op-posite sides of a common boundary are set G1 or G2 contin-uous, the corresponding transfinite surfaces will inherit thisproperty. Two ribbons are G1 (tangent plane) continuous, iftheir first cross-derivatives are perpendicular to a commonsweep of normal vectors (called normal fence) along the

Figure 3: Normal curvature arcs and Gauss curvature map.

common boundary. Figure 2 shows an example, where thefence is rendered as a series of yellow lines.

When we require G2 (curvature) continuity between twosurfaces, we apply the Linkage Curve Theorem [PW92]:

Two surfaces tangent along a C1-smooth linkagecurve are curvature continuous, if and only if atevery point of the linkage curve, their normal cur-vature agrees for an arbitrary direction other thanthe tangent of the linkage curve.

This means that if we have a particular directional sweepalong the common boundary, and the normal curvatures ofthe two ribbons in this direction are always the same, thenG2 continuity is satisfied. Figure 3 shows an example withcommon normal curvatures rendered as circular arcs. (Thematching colors of the Gauss map show G2 continuity.)

In the rest of this section, we will investigate how to de-termine normals and curvatures from a curve network.

3.1. Preliminaries

A ribbon is a bi-parametric surface R(s,d); s is the side pa-rameter, and d is the distance parameter. The side parameterruns in the interval [0,1] along the boundary curve. The dis-tance parameter is defined in the cross direction; it is zero onthe boundary and increases as we move away from it.

For a given n-sided patch, there is a loop of curves, Pi(si),and we need to create the corresponding ribbons Ri(si,di),i ∈ [1 . . .n]. The parameters (si,di) can also be regarded asfunctions that map values from a common polygonal domain(see Section 4.3). Note also that the indexing is circular with1 coming after n and vice versa, and we have Pi−1(1)=Pi(0)for all i.

Given a boundary curve Pi(si) and the correspondingcross-derivative Ti(si), a linear ribbon can be written as

Ri(si,di) = Pi(si)+diTi(si). (9)

The equation of a parabolic ribbons is given as

Ri(si,di) = Pi(si)+diTi(si)+12

d2i Ci(si), (10)

where Ci(si) denotes the second cross-derivative.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 4: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

3.2. Normal Fence, Linear Ribbons and Compatibility

At vertices of the network, all curve tangents are in a com-mon plane. For each boundary Pi(si), we create a normalfence Ni(si) that interpolates the normals at the related cor-ners, and minimizes its rotation along the boundary; thisis the well-known rotation-minimizing frame or RMF. Anexact (closed form) solution of the underlying differentialequation cannot be determined, but approximations can becomputed via a sequence of discrete points [WJZL08].

The cross-derivatives of the ribbons can be defined as

Ti(si) :=∂

∂diRi(si,0) (11)

= α(si)Di(si)+β(si)∂

∂siRi(si,0),

where α(si) and β(si) are scalar functions, and Di(si) rep-resents a direction vector function, that is perpendicular toNi(si) everywhere. One trivial choice for Di is

Di(si) = Ni(si)×∂

∂siRi(si,0), (12)

but other definitions are also possible. Di(si) represents acommon vector function assigned to the boundary, so G1

continuity is obviously satisfied.

The scalar functions must satisfy end conditions at thecorner points (si = 0 and si = 1). There are further degreesof freedom to define these in order to optimize the shapeof the patch. For example, cross-derivatives at the middle ofthe boundary (si = 0.5) can be prescribed for manual shapeediting. Alternatively, these can be optimized by fairing al-gorithms, which is subject of ongoing research.

The next issue is how to define ribbons that are compati-ble with the prescribed surface curvatures of the network. Itis well-known from differential geometry [Pet91] that oncethe ingoing curves match a common surface curvature, therealways exists a set of compatible twist vectors (mixed partialderivatives) at this corner. The “height” of the twist vectorsis unambiguously defined by the first and second derivativesof the curves and the Gaussian curvature (K), thus the twistvector of a compatible ribbon R must satisfy the followingcondition at the corner:

∂2

∂s∂dR·N =

(∂

2

∂s2 R ·N

)(∂

2

∂d2 R ·N

)−K

∥∥∥∥ ∂

∂sR× ∂

∂dR∥∥∥∥2

.

(13)This also indirectly determines D′ ·N, since the normal com-ponent of the twist vectors must also satisfy

∂2

∂s∂dR ·N = αD′ ·N +βP′′ ·N. (14)

An essential consequence of the above equation is that for acurvature compatible normal fence N′ ·N is also constrained,and instead of the RMF, we have to compute a more gen-eral normal fence, that approximates a smoothly varying se-

Surface 1 Surface 2 Average

Figure 4: Curvature averaging, visualized in the tangentplane. The red line shows the constrained direction.

quence of normal vectors and satisfies the derivative con-straints at the two ends, as well, e.g. by constrained fitting.

3.3. Normal Curvatures Along the Edges

We constrain the opposite curvatures to be identical, whichensures curvature continuity by the Linkage Curve Theo-rem. It would be nice to naturally blend surface curvaturesof (κ1,κ2,λ) from one endpoint to the other, which woulddefine a “rotation minimizing curvature” function, but thisseems to be a difficult problem and no such algorithm isknown to the authors. Instead we discuss two important prac-tical cases.

(i) The simplest method is to enforce a master-slave re-lationship, when we preserve the curvature function of themaster patch, and enforce this to the slave to achieve a G2

connection.

(ii) It is more challenging to ensure G2 continuity by aver-aging. Assuming we have already generated two G1 patches,we wish to compute a surface curvature at every point, suchthat it (i) interpolates the normal curvature of the commonboundary, and (ii) approximates the surface curvatures of thetwo adjacent patches. This problem can be solved using theconstrained surface curvature method of the previous sec-tion. At a given point, let ω0 be the tangent direction of theboundary curve and k0 its curvature. We take several curva-ture “measurements” in further ωi directions from both sur-faces, denoted by kA

i and kBi , and define a target curvature as

the mean of these two values, i.e., ki = (kAi +kB

i )/2. Then weminimize ∑(κ(ωi)− ki)

2 using the constraint κ(ω0) = k0.This method is visually demonstrated in Figure 4, where nor-mal curvatures are drawn using the Euler equation.

3.4. Parabolic Arcs and Parabolic Ribbons

After the surface curvature along the boundary is deter-mined, we need to compute appropriate parabolic arcs in thelocal sweeping planes defined by Ti(si) and Ni(si). The nor-mal curvature κ(si) in the direction of Ti(si) is calculatedusing Euler’s formula. We still have some freedom in deter-mining the exact arcs, as only the tangent direction and thecurvature is constrained.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 5: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

For ease of computation, let us transform the parabolic arcof Ri at a fixed si into a local coordinate system, where thefirst point is the origin, and the tangent of the arc is the localx-axis. Then at a given boundary point, the equation of theparabola can be written as a quadratic Bézier curve of threecontrol points:

Ri(si,di) = B20(di) · (0,0)+B2

1(di) · (l(si)/2,0)

+B22(di) · (l(si),h(si)) . (15)

Assuming that the width of the parabolic ribbon l(si) is thesame as the corresponding linear one, h(si) can be expressedby means of the prescribed curvature as h(si) =

12 κ(si)l2(si),

which defines the second and third control points of theparabolic arc. As a result, parabolic ribbons can either bedirectly evaluated by the above formula or represented as anapproximating B-spline surface.

4. G2 Gregory Surfaces

At this point we assume that the ribbons have already beendetermined. Various transfinite surface schemes exist to in-terpolate ribbons, see the review in [VRS11]. In this paperwe elaborate an extended version of the classical Gregorypatch. Its equation is

S(u,v) =n

∑i=1

Ii,i−1(si(u,v),si−1(u,v))Bi,i−1(u,v), (16)

where Ii,i−1 is a corner interpolant between boundary curvesi and i− 1, and Bi,i−1 denotes a blending function of therelated corner. The parameter function si(u,v) is associatedwith the ith side of the polygonal domain; we omit its argu-ments for brevity. Let us analyze these constituents below.

4.1. Corner Interpolants

Corner interpolants are formulated by two adjacent side-based (linear or parabolic) ribbons. It is well-known fromthe classical theory of Boolean-sum surfaces, that in orderto cancel out unwanted terms coming from two side inter-polants, a correction patch Qi,i−1 needs to be subtracted (seealso Section 4.4):

Ii,i−1(si,si−1) = Ri−1(si−1,si)+Ri(si,1− si−1)

−Qi,i−1(si,si−1). (17)

If we also consider Ii+1,i(si+1,si), it is apparent that Rioccurs with two different parameterizations in the surfaceequation, which we will denote by R−i (si,di = 1−si−1), andR+

i (si,di = si+1).

4.2. Blending Functions

Transfinite surface schemes generally combine individualinterpolants by special blending functions, that ensure re-quired interpolation properties. For Gregory patches, cornerblends are used, that yield 1 at a given corner, then gradually

Figure 5: Blend functions with m= 2 (left) and m= 3 (right).

vanish on the adjacent sides, and become zero as we reachthe remaining sides of the polygonal domain.

For each (u,v) point in the domain, we determine an n-tuple of distance values ∆i(u,v). The distance ∆i is zero onthe ith side and increases monotonously as we move towardsthe center of the domain. These values may represent anydistance measure with the above properties; for example, wemay use distances on sweeping lines, or perpendicular dis-tances dropped to the respective sides of the polygon.

Let Di1...ik = ∏ j /∈{i1...ik}∆mj , then the corner blend is de-

fined as

Bi,i−1(u,v) =Di,i−1

∑ j D j, j−1

(=

1/(∆i∆i−1)m

∑ j 1/(∆ j∆ j−1)m

). (18)

This function satisfies our requirements — it yields 1 atthe (i− 1, i) corner, ensures a “gradual” 1 → 0 transitionalong sides i− 1 and i as we move away from the corner,and then vanishes on the remaining sides. Note, that the ex-pression in the brackets shows an efficient way to computeblends in the interior of the domain, however, the main for-mula must be used in the vicinity of polygon sides, wheresome ∆i ≤ ε, to avoid singularities.

The exponent m controls the variation of the ribbons;compare the two images in Figure 5. This ensures that theresulting surface retains the (m−1)-th derivatives of the rib-bons. We use m = 2 for linear ribbon patches, and m = 3for parabolic ones, to achieve G1 and G2 continuity, respec-tively.

4.3. Parameterization

The goal of parameterization is to determine local parame-ters for the corner interpolants from a given (u,v) point. Inthis paper — for simplicity’s sake — we use regular polyg-onal domains. Previous research [VRS11] has shown thatfor extreme boundary configurations, i.e., very uneven sidelengths or sudden curvature changes, the use of irregularpolygons can improve surface quality.

Let us determine the parameter si for the ith side. Tradi-tionally, Gregory patches are parameterized by radial sweep-ing lines [CG84] (Figure 6a), connecting the domain point

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 6: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

(a) Radial

(0,0) (1,0)(s,0)

(u,v)a b

(b) Sweep construction (c) Constrained sweep

Figure 6: Parameterizations.

in question to the intersection of the extended polygon sidesi− 1 and i+ 1. This is suitable for G1 continuous surfaces,but further differential properties are required for G2 con-tinuity. As discussed earlier, ribbon Ri has two parameteri-zations. It is necessary that these be identical at every pointalong the boundary, so the parametric speed of si−1 and si+1should be the same:

− ∂si−1∂w

=∂si+1∂w

(=

∂di

∂w

), (19)

where ∂

∂w denotes differentiation along an arbitrary paramet-ric direction in (u,v), i.e., w is equal either to u or v, or anycombination of them. While ribbons R−i and R+

i have differ-ent parameters in the interior of the domain, we refer to theseparameterizations uniformly by di, when the above conditionapplies on side i.

This condition can be satisfied, if we create sweepinglines by a special construction using Hermite polynomials.Without loss of generality, let the base edge be a segmentfrom (0,0) to (1,0), a and b edge vectors associated withsides i− 1 and i+ 1, respectively, and (u,v) the point to bemapped, see Figure 6b. Then we can construct the equation

(u,v) = (s,0)+d [a ·H(s)+b ·H(1− s)] , (20)

where H(s) = 2s3−3s2+1 is the third-degree Hermite poly-nomial†, and s and d are unknown. This leads to a fourth-degree equation in s, but that does not pose any difficultyfor real-time computation, as efficient algorithms exist forsolving higher degree polynomial equations [PTVF92], andvalues for a given resolution can also be cached. The re-sult is depicted in Figure 6c. Here Ii,i−1 is parametrized bythe green and blue sweeplines, Ii+1,i by the red and green;at the bottom the blue sweeplines of side i− 1 and the redsweeplines of side i+1 are identical in a differential sense.

† Using fifth-degree Hermite polynomials instead also ensures

− ∂2si−1∂w2 =

∂2si+1∂w2

(= ∂

2di∂w2

), resulting in C2 interpolation.

4.4. Correction Terms

Now we return to corner interpolants and investigate thepartial derivatives of two — linear or parabolic — ribbons,meeting at a common corner point. We need a single inter-polant surface, but the partial derivatives are not necessarilyidentical, which poses the well-known problem of twist in-compatibility. Let us introduce the notation ti = 1−si−1. Wewould need

∂p+q

∂spi ∂tq

iRi(0,0) =

∂p+q

∂tqi ∂sp

iRi−1(1,0)

=: Wp,q p,q ∈ {0,1,2}. (21)

The curve network satisfies this equation for p = q = 0, asthe boundaries meet at a fixed corner point. It is also naturalto require that the equation holds for p = 0, q = 1 and p = 1,q = 0, constraining the first cross-derivatives of the ribbonsto the tangents of the neighboring curves. When some par-tial derivatives of the ribbons are not compatible, we needto apply Gregory’s rational twists. These replace the con-stant vectors Wp,q by rational expressions combining the twoparametric variables (see below). The correction patch forG2 corner interpolants is defined as

Qi,i−1(si, ti) = Pi(0)+ siW1,0 + tiW0,1 + sitiW1,1

+12

s2i W2,0 +

12

t2i W0,2 +

12

s2i tiW2,1

+12

sit2i W1,2 +

14

s2i t2

i W2,2, (22)

where each W is a rational function of si and ti. Their com-putation is fairly straightforward, generalizing the classicalGregory twists [Wor84]. As an illustration, we show onesuch term, the remaining ones are similar:

W1,2(si, ti) =s2

i∂

2

∂t2i

Ti−1(1)+ ti ∂

∂siCi(0)

s2i + ti

. (23)

Substituting 0 for either si or ti eliminates one of the con-flicting partial derivatives where needed.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 7: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

(a) Dolphin model (curve network courtesy of C. Grimm). (b) Isophotes — G1 (top) and G2 (bottom).

Figure 7: Continuity between Gregory patches of a complex model.

For G1 curve networks, the twist vectors are often not setcompatible, and Gregory terms must be used. In our G2 case,the curves match a common surface curvature at each node,so the compatibility constraints of W2,0, W0,2 for the curvesand W1,1 for the twists are satisfied. However, rational cor-rections need to be applied for the remaining terms of W2,1,W1,2 and W2,2.

5. Examples

Surface models in this paper were generated by a prototypesystem written in C++. Table 1 demonstrates computationtimes for G1 vs. G2 representations, evaluating a test objectshown in Fig. 7a. It consists of two 2-sided, four 3-sided,five 4-sided, two 5-sided and two 6-sided patches; and thenetwork contains 10 B-spline curves. While normal fencegeneration is really fast, parabolic ribbons require signifi-cantly more computation, as these are based on samplingand curvature estimations using the initial G1 patches. Onceparabolic ribbons are ready, the actual evaluation of surfacepoints increases only to a minor extent (by a factor of 1.5).

The close-up view in Figure 7b shows an X-node withlinear vs. parabolic ribbons; the target curvatures were com-puted by the averaging method in Section 3.3. It can be seen,that with parabolic ribbons the isophotes change smoothlyacross the shared boundaries, showing G2 continuity.

In the rest of this section, we present some applications ofparabolic ribbons.

5.1. Master-Slave Constructions

In computer-aided design, surfaces are typically defined bya well-defined hierarchy; for example, fillets smoothly join

Ribbon computation Surface model evaluationG1 0.02s 2.6sG2 5.1s 4.0s

Table 1: Average running times on a 2.8GHz CPU.The surface model was evaluated at 4000 sample points.

large primary surfaces, vertex blends connect several fil-lets, and so on. In the context of transfinite surfaces, thismeans that curvature information needs to be propagatedalong some boundary curves. We wish to retain the curvatureof master surfaces, and enforce curvature constraints to ad-

Figure 8: Vertex blend with three master surfaces.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 8: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

(a) Concave angle. (b) Unevenly spaced loop of boundary edges. (c) Internal loop.

Figure 9: Improved surfacing using connection curves.

jacent slave surfaces. This can be accomplished by extract-ing cross curvatures from the master, and generating slavesusing G2 transfinite patches. Such an example is shown inFigure 8, where a setback vertex blend was created, satis-fying curvature continuity joining three fillets, i.e., we havethree master surfaces, and one slave in the middle.

5.2. Difficult Curve Network Configurations

While most of the time G1 transfinite surface interpolation issufficient to produce a collection of smooth convex patches,there are certain cases, where we need to insert artificial con-nection curves into the network in order to handle complexconfigurations or avoid shape artifacts, e.g.:

• curve loops with a concave angle,• unevenly spaced loop of boundary edges,• connecting disjoint loops (holes).

Examples are shown in Figure 9. In these cases, first we in-sert connection curves, and create G1 patches. After takingthe average of the curvatures, we compute parabolic ribbonsand regenerate the patches, now with curvature continuity.As a result, seamlines within these composite patches can-not be noticed visually. In practical design applications it isassumed that the composite patches are automatically gen-erated, and connection curves remain hidden from the users.

5.3. Mesh Approximation

Creating a highly compressed representation for a mesh is animportant task, that can be accomplished by general topol-

ogy surfaces. First, a network of curves is drawn on themesh, which also defines a multi-sided patch structure. Bydeducing boundary curves and cross-derivatives from themesh, transfinite surfaces are created that nicely approxi-mate the data points of the entire model. Using locally esti-mated normal vectors, we can create normal fences and lin-ear ribbons for G1 patches. Estimating local curvatures alongthe boundaries, as well, makes it possible to create parabolicribbons and G2 patches, which will produce smoother andmore accurate surface models (see Figure 10).

6. Conclusion and Future Work

We have discussed an approach for G2 transfinite surfaceinterpolation, by (i) assigning curvatures to the nodes andedges of a general topology curve network, (ii) creatingparabolic ribbons, and (iii) interpolating these with a G2 ex-tension of Gregory patches, based on corner interpolants anda special sweepline parameterization. Continuity issues andthe computation of linear and parabolic ribbons were ex-plained in details. A few applications where G2 ribbons areneeded have also been presented.

It should be noted that G2 surface patches are more sensi-tive to the quality of the defining network than their G1 coun-terparts; so applying fairing methods for curves and ribbonsremains a challenging subject for future research. Anotherarea of interest is to determine optimal transfinite patchesfor approximating triangular meshes. We also plan to applyGPU-s to speed up computations.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 9: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

Figure 10: Deviation from the mesh using linear (left) and parabolic (right) ribbons. Relative deviations with respect to thebounding box are (-0.38%, +0.45%) for the G1, and (-0.22%, +0.11%) for the G2 case.

Acknowledgements

This work was supported by the Hungarian Scientific Re-search Fund (OTKA, No. 101845). The pictures in this pa-per were generated by the Sketches system developed byShapEx Ltd., Budapest. The contribution of György Karikóto develop this prototype system is highly appreciated.

References[CG84] CHARROT P., GREGORY J. A.: A pentagonal surface

patch for computer aided geometric design. Computer Aided Ge-ometric Design 1, 1 (1984), 87–94.

[GH89] GREGORY J. A., HAHN J. M.: A C2 polygonal surfacepatch. Computer Aided Geometric Design 6, 1 (1989), 69–75.

[Her96] HERMANN T.: G2 interpolation of free form curve net-works by biquintic Gregory patches. Computer Aided GeometricDesign 13, 9 (1996), 873–893.

[HM99] HALL R., MULLINEUX G.: Continuity betweenGregory-like patches. Computer Aided Geometric Design 16, 3(1999), 197–216.

[HPS12] HERMANN T., PETERS J., STROTMAN T.: Curve net-works compatible with G2 surfacing. Computer Aided GeometricDesign 29, 5 (2012), 219–230.

[MS94] MORETON H. P., SEQUIN C. H.: Minimum variationcurves and surfaces for computer-aided geometric design. In De-signing Fair Curves and Surfaces, Sapidis N. S., (Ed.). SIAM,1994, pp. 123–159.

[Pet91] PETERS J.: Smooth interpolation of a mesh of curves.Constructive Approximation 7, 1 (1991), 221–246.

[PTVF92] PRESS W. H., TEUKOLSKY S. A., VETTERLINGW. T., FLANNERY B. P.: Numerical recipes in C (2nd ed.): theart of scientific computing. Cambridge University Press, 1992.

[PW92] PEGNA J., WOLTER F.-E.: Geometrical criteria to guar-antee curvature continuity of blend surfaces. Journal of Mechan-ical Design 114, 1 (1992), 201–210.

[Sel81] SELESNICK S. A.: Local invariants and twist vectors incomputer-aided geometric design. Computer Graphics and Im-age Processing 17, 2 (1981), 145–160.

[SVR14] SALVI P., VÁRADY T., ROCKWOOD A.: Ribbon-basedtransfinite surfaces. Computer Aided Geometric Design (2014).

[VH96] VÁRADY T., HERMANN T.: Best fit surface curvature atvertices of topologically irregular curve networks. In Mathemat-ics of Surfaces VI (1996), Clarendon Press, pp. 411–427.

[VRS11] VÁRADY T., ROCKWOOD A., SALVI P.: Transfinitesurface interpolation over irregular n-sided domains. ComputerAided Design 43, 11 (2011), 1330–1340.

[WJZL08] WANG W., JÜTTLER B., ZHENG D., LIU Y.: Compu-tation of rotation minimizing frames. Transactions on Graphics27, 1 (2008), 2.

[Wor84] WORSEY A.: A modified C2 Coons’ patch. ComputerAided Geometric Design 1, 4 (1984), 357–360.

Appendix A: Surface Curvature Formulae

The details of computing surface curvatures for cases (i) and (iv) inSection 2 are given, as follows.

Underdetermined CaseWe write W1 and W2 in terms of W12 as

Wi = aiW12 +bi, i ∈ {1,2},

using

a1 = 2(s2c2s21− s1c1s2

2)/d, b1 = (k1s22− k2s2

1)/d,

a2 = 2(s1c1c22− s2c2c2

1)/d, b2 = (k2c21− k1c2

2)/d,

where d = s22c2

1− s21c2

2, si = sinωi, and ci = cosωi. Applying

1/κ21 +1/κ

22 =

κ21 +κ2

2

κ21κ2

2=

W 21 +W 2

2 +2W 212[

W1W2−W 212]2

= f (W1,W2,W12) = f (W12),

leads to the third-degree equation

f ′(W12) = c3W 312 + c2W 2

12 + c1W12 + c0 = 0,

where the coefficients ci are

c3 = 2((a1−a2)

2−a1a2(a21 +a2

2)+2),

c2 = 6(1−a1a2)(a1b1 +a2b2),

c1 = 2(

2(

b21 +b2

2 +b1b2

)−3a1a2

(b2

1 +b22

)),

c0 = −2(

a1b32 +a2b3

1

).

Solving the equation gives W12, and from that W1 and W2 can bedetermined. Using the equations

κ1,2 = (W1 +W2±√

D)/2,

D = W 21 +W 2

2 −2W1W2 +4W 212,

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.

Page 10: G2 Surface Interpolation Over General Topology Curve Networkssalvi.chaosnet.org/texts/ribbons-pg.pdf · 2016-01-14 · P. Salvi, T. Várady / G2 Surface Interpolation OverGeneral

P. Salvi, T. Várady / G2 Surface Interpolation Over General Topology Curve Networks

we can compute the principal curvatures; we get the angle λ from

sin2λ =

W1−κ1

κ2−κ1.

Note, that there is a slight ambiguity here — we need the negativeroot when W12 < 0, and the positive otherwise.

Constrained Case

In the same vein as above, we write the minimization as

∑i

(W1c2

i +W2s2i +2W12sici− ki

)2→ min,

and augment it with a Λ multiplicator:

f (W1,W2,W12,Λ) = ∑i

(W1c2

i +W2s2i +2W12sici− ki

)2

(W1c2

0 +W2s20 +2W12s0c0− k0

).

We need to solve the equation system ∂

∂λf = 0, ∂

∂W1f = 0, ∂

∂W2f = 0,

∂W12f = 0, leading toc2

0 s20 s0c0 0

2c4i 2s2

i c2i 4sic3

i c20

2s2i c2

i 2s4i 4s3

i ci s20

2sic3i 2s3

i ci 4s2i c2

i s0c0

·

W1W2W12Λ

=

k0

2c2i ki

2s2i ki

2siciki

,with an implicit sum for all terms with an i index. Note, that if the ωidirections are fixed, we can speed up the computation by precom-puting the LU decomposition of this matrix.

Appendix B: Proof of Continuity

We provide here the outline of a proof that extended Gregorypatches match the parabolic ribbons in a G2 sense. To save space,arguments of some functions are omitted, when this cannot causeany ambiguity. From here onwards, we evaluate points on the ithside, where ∆i = 0, si−1 = 1 and si+1 = 0.

The reproduction of the cross-derivatives on side i depends onIi,i−1 and Ii+1,i. These, per definition, interpolate the R−i and R+

iribbons, respectively, i.e.,

Ii,i−1(si,1) = Ri(si,0) = Ii+1,i(0, si),

∂wIi,i−1(si,1) =

∂wRi(si,0) =

∂wIi+1,i(0, si),

∂2

∂w2Ii,i−1(si,1) =

∂2

∂w2R−i (si,0),

∂2

∂w2R+

i (si,0) =∂2

∂w2Ii+1,i(0, si),

where Ri is used to signify when R−i and R+i are the same. The di-

rection w is equal to u or v, or an arbitrary direction in the domain, asbefore. Recall our parameterization requirement from Section 4.3,

−∂si−1

∂w=

∂si+1

∂w

(=

∂di

∂w

),

that ensures the equality of first derivatives, since

∂si−1R−i

∂si−1

∂w=

∂si+1R+

i∂si+1

∂w.

The second derivatives, on the other hand, are different.

We will use two important properties of the blending functionsrelated to the ith boundary, which we list here without proof:

Bi,i−1 +Bi+1,i = 1, (24)

∂k

∂wkB j, j−1 = 0, j /∈ {i, i+1}, k ∈ {1,2} (25)

From the above it also follows that

∂k

∂wk(B j, j−1 +B j+1, j) = 0, j /∈ {i−1, i+1}, k ∈ {1,2} (26)

In the following subsections we prove that the surface reproducesthe parabolic ribbon in C0, C1, and G2 sense.

C0 continuity. This is trivially true, using property (24):

S = R−i Bi,i−1 +R+i Bi+1,i

= Ri(si,0)(Bi,i−1 +Bi+1,i) = Ri(si,0).

C1 continuity. Half of the equation vanishes due to (25), leaving

∂wS =

∂wR−i Bi,i−1 +

∂wR+

i Bi+1,i

+

[R−i

∂wBi,i−1 +R+

i∂

∂wBi+1,i

].

Since R−i = R+i , we can use property (26) to eliminate the last term:

∂wS =

∂wRi(si,0)(Bi+1,i−Bi,i−1) =

∂wRi(si,0).

G2 continuity. Similarly, we can eliminate a large part of theequation using (25) again, after which the following remains:

∂2

∂w2S = 2

[∂

∂wR−i

∂wBi,i−1 +

∂wR+

i∂

∂wBi+1,i

]+

∂2

∂w2R−i Bi,i−1 +

∂2

∂w2R+

i Bi+1,i

+

[R−i

∂2

∂w2Bi,i−1 +R+

i∂2

∂w2Bi+1,i

].

The first and last terms vanish due to (26). Substituting the deriva-tives of R−i and R+

i into the equation, we get

∂2

∂w2S = P′i (si)

∂2si

∂w2+Ti(si)

(∂2si+1

∂w2Bi+1,i +

∂2si−1

∂w2Bi,i−1

)+P′′i (si)

(∂si

∂w

)2

+2T ′i (si)∂si

∂w∂di

∂w+Ci(si)

(∂di

∂w

)2

,

using the equivalent ∂di∂w instead of − ∂si−1

∂w and ∂si+1∂w . The first and

second derivatives by di are much simpler:

∂diS =

∂diRi(si,0) = Ti(si),

∂2

∂d2i

S = Ci(si)+ξi ·Ti(si),

where ξi is an appropriate constant. Consequently, the curvature inthis direction is

κ =Ti(si)× (Ci(si)+ξ ·Ti(si))

‖Ti(si)‖3 =Ti(si)×Ci(si)

‖Ti(si)‖3 ,

which is the same as the curvature of the ribbon Ri, thus this provesG2 continuity via the Linkage Curve Theorem.

c© 2014 The Author(s)Computer Graphics Forum c© 2014 The Eurographics Association and John Wiley & Sons Ltd.