Content uploaded by Miklós Hoffmann

Author content

All content in this area was uploaded by Miklós Hoffmann on Dec 14, 2018

Content may be subject to copyright.

PLEASE, NOTE, THAT THIS IS A PREPRINT. THE FINAL VERSION OF

THE ACCEPTED MANUSCRIPT AND ADDITIONAL MATERIALS AND

RESEARCH DATA CAN BE FOUND HERE:

https://doi.org/10.1016/j.gmod.2018.12.001

1

An improved skinning algorithm for circles and spheres

providing smooth transitions

Kinga Kruppaa,∗, Roland Kunklia, Mikl´os Hoﬀmannb

aFaculty of Informatics, University of Debrecen, Debrecen, Hungary

bInstitute of Mathematics and Informatics, Eszterh´azy K´aroly University, Eger, Hungary

Abstract

Recently there has been a growing interest in the topic of skinning of circles

and spheres, since modeling based on these objects has been found useful in

areas such as medical applications and character animation. Among others, an

eﬃcient method was presented by Kunkli and Hoﬀmann [1], whilst Bastl et al.

also provided an eﬀective skinning algorithm [2]. In this study, we outline the

major advantages and disadvantages of these methods, and we show that there

are major insuﬃciencies in [2] in terms of dynamic modeling. We provide a

new, improved skinning technique, which preserves the advantages of the two

aforementioned algorithms and gives a solution to their arisen problems: it

can be used for real-time modeling due to the smooth alteration of skins, and

provides good results even in extreme cases. We overcome the problem of self-

intersections, and we extend the method to branched systems of circles and

spheres.

Keywords: skinning, circle, sphere, interpolation

2010 MSC: 65D17

∗Corresponding author

Email addresses: kruppa.kinga@inf.unideb.hu (Kinga Kruppa),

kunkli.roland@inf.unideb.hu (Roland Kunkli), hoffmann.miklos@uni-eszterhazy.hu

(Mikl´os Hoﬀmann)

Preprint submitted to Graphical Models December 14, 2018

1. Introduction

One of the most important areas in Computer Aided Geometric Design is

curve and surface modeling from point-based datasets. Several, now widely

known methods — speciﬁcally interpolation or approximation of a sequence of

points — have appeared in this topic (see the classical works [3, 4, 5]). Another5

paradigm of modeling has also been applied for several years: surface generation

based on a set of input curves, called skinning or blending, as it can be seen e.g.,

in [6, 7, 8]. In this skinning technique, a set of curves — typically orthogonal

planar cross-sections of a future surface — is given along a skeleton or spine

curve, and these cross-sections are swept by the computed surface, called skin.10

This surface, usually a spline surface, interpolates or approximates the section

curves. The method has been successfully applied in several applications from

medical surface reconstruction to CAGD in the last decades [9, 10, 11].

However, it is possible to extend the ideas of point-based interpolation and

skinning of cross-sections to blending other planar or spatial objects as well.15

Besides the well-known and widely used control point based modeling methods,

a novel approach has appeared in the creative industry and in the scientiﬁc ﬁeld

as well: curve and surface modeling based on circles and spheres. In this paper,

skinning is considered as a method of constructing interpolation curves for a set

of circles or constructing tubular-like surfaces to a sequence of spheres.20

This type of skinning is often mentioned along Medial Axis Transformation,

even though it is essentially diﬀerent and is used for a reversed problem: the

ﬁnal shape is given, and the aim is to ﬁnd a skeleton that represents the shape.

In our case, the aim is to design a shape using a discrete set of input circles.

However, there are some ﬁelds and applications that make use of the connection25

of the two approaches. For example, circle skinning methods can give a good

approximation for the contour reconstruction shown in [12].

Looking at the problem from a practical point of view, skinning can be ap-

plied in ﬁelds like molecular biology [13, 14] and medical image processing, for

example for reconstructing cardiovascular systems [15, 16]. These methods gen-30

3

erally use deep algebraic and analytical tools, which may lead to time-consuming

computation, contrary to our aim of real-time design. The sphere-based surface

modeling principle has become particularly popular in the animation indus-

try for modeling 3D articulated shapes and tubular-like surfaces with several

branches. Some recent methods use subdivision techniques for computing the35

surface from a set of given spheres along a skeleton by linearly blending them

and creating a coarse mesh [17, 18]. A clear advantage of these methods is

the ready-to-use ﬁnal subdivision surface (now standard in animation software)

but there are also drawbacks: the ﬁnal surface does not necessarily touch (in-

terpolate) the given spheres, and it can be time-consuming to create the base40

mesh by an evolutionary approach to avoid shrinkages. Existing commercial

software, such as ZSpheres R

by Pixologic apply this skinning method, but with

serious drawbacks, as it is discussed in [19]. A similar technique is applied for

simpliﬁcation of existing structures in [20].

Another approach of sphere-based surface modeling is to use polynomial45

curves and surfaces as skins. Several papers have been published in the last

couple of years providing sphere-based surface modeling algorithms. Some of

them also use evolutionary, iterative approach to ﬁnd the optimal skin [15, 21,

22, 23], however, these methods are not only time-consuming, but they also

depend on the initial position of the skin and may fall into local minima. Other50

methods use direct real-time computation of the skin, where the central problem

is to ﬁnd the most appropriate touching points on the given circles (in 2D) or

touching circles on the given spheres (in 3D) along which the skin will touch

the given dataset [1, 2, 19, 24, 25].

In this paper, we evaluate and improve these latter methods, fundamentally55

based on two diﬀerent recent techniques proposed by Kunkli and Hoﬀmann [1]

and by Bastl et al. [2]. We provide a new, improved skinning algorithm based

on these methods: preserving their advantages while oﬀering a solution to their

greatest insuﬃciencies, in terms of their behavior in extreme cases and the lack

of smooth transition in the designing phase.60

The paper is organized as follows. We brieﬂy recall the two above mentioned

4

skinning methods and discuss their advantages and drawbacks in Section 2. In

Section 3 we introduce our new, improved solution, and the results of the three

skinning methods are compared to each other in various situations of input data

in Section 4. In Section 5 we discuss the impact of our method, while Section 665

shows the possibility of extension to 3D and branching. Finally, Section 7 closes

the paper with the conclusion.

Throughout this paper, the corresponding ﬁgures to these skinning methods

are distinguished with three diﬀerent colors: the method of Kunkli and Hoﬀ-

mann is marked with blue, the method of Bastl et al. is marked with red, and70

our new solution is marked with green.

2. Evaluation of recent skinning methods

2.1. The skinning method of Kunkli and Hoﬀmann

Given an ordered set of circles, the method proposed by Kunkli and Hoﬀ-

mann [1] deﬁnes skinning as the construction of two G1continuous curves touch-75

ing each of the given circles at one point separately. The touching points are

determined by applying the solutions to the problem of Apollonius; then they

are separated into two groups for the “left” and for the “right” skin. Finally,

Hermite interpolation curves are constructed between every two neighboring

circles, for which the tangent lengths are computed with the help of the radical80

lines of the circle pairs.

This algorithm provides good results in general scenarios, and the skins

respond dynamically when the user modiﬁes the positions or the radii of the

circles during modeling. Since the touching points are derived from the solution

of the problem of Apollonius, it also guarantees that the touching points never85

lie inside any of the circles. Despite these advantages, in some extreme cases

the method has insuﬃciencies: the skins can intersect each other or the given

circles.

5

2.2. The skinning method of Bastl et al.

For a given sequence of circles, in the paper published by Bastl et al. [2],90

skinning is the construction of two at least G1continuous curves touching each

of the circles either along a circular arc deﬁned by two endpoints, or at one

point (as the arc degenarates into a midpoint if the positions of the circles

require). These touching points are deﬁned with the help of outer bitangents.

For the construction of the Hermite interpolation curves, the lengths of the95

corresponding tangent vectors are based on the distance of the touching points.

The algorithm generally provides excellent output, however, there are some

major disadvantages in the aspect of dynamic modeling.

Given a sequence of circles C={c1, c2, . . . , cn}, n ∈N, let us consider three

consecutive circles ci−1,ci, and ci+1 with their corresponding disks di−1,di,100

and di+1. Let ci−1∩ci=∅and ci∩ci+1 6=∅. Let the points Qiand Pi

be deﬁned on ci, originated from the left outer bitangents of ci−1and ci, and

ciand ci+1, respectively. The method of Bastl et al. deﬁnes the midpoint on

ciin diﬀerent ways — thus the position of the midpoint and the skin itself

suddenly change even if we minimally modify the positions of the circles. When105

Qi/∈di+1, then the midpoint (noted as Wi1in Fig. 1 (a)) is deﬁned by Piand

Qi. However, if we position ci+1 so that Qi∈di+1, then the midpoint (noted

as Wi2in Fig. 1 (b)) is redeﬁned with the help of Piand Ni2, where Ni2is an

intersection point of ciand ci+1. The same problem happens when ciand ci−1

intersect. Furthermore, even the midpoint Wican get inside the adjacent circle110

(see Fig. 1 (c)). To resolve this, Bastl et al. introduce weights to specify the

location of the midpoint on the arc. Even though choosing an accurate weight

would solve this problem, there is no algorithmic, exact solution to determine a

local weight for each circle.

Another problem occurs while switching between using a midpoint and a115

circular arc deﬁned by two touching points. The algorithm calculates the corre-

sponding tangent lengths diﬀerently in these two cases, and it does not change

them continuously. See Fig. 2 as an example: (a) shows the initial position of

circle ci+1, while (b) shows when it is minimally relocated.

6

(a) (b) (c)

Figure 1: In the method of Bastl et al., if Qi/∈di+1 then the midpoint is Wi1=Pi˙_Qi(a).

If we minimally change the position of ci+1, so that Qi∈di+1 , the midpoint is redeﬁned as

Wi2=Pi˙_Ni2(b). This causes a sudden change in the shape of the skin. In (c), we can see

that the midpoint can get inside ci+1.

(a) (b)

Figure 2: The sudden and signiﬁcant change of the tangent lengths using the method of

Bastl et al. At ﬁrst (a), ci+1 has two touching points, thus 2 ·Di+1 is used for tangent

length. If we slightly modify the position of ci+1 (b), it will only have one touching point, a

midpoint. In this case, 2 ·\

Di+1 will be used, which is clearly much shorter than 2·Di+1. The

cropped images show the switching from two touching points (a) to using a midpoint (b).

3. The new skinning algorithm120

In this section, we present a new technique combining the advantages of the

two skinning methods we had examined while giving solutions to their disadvan-

7

tages as well. We provide an algorithm that allows smooth transition of skins

without sudden changes in real-time designing. Based on [1] and [2], we now

give extended deﬁnitions both for the admissible conﬁguration of input circles125

and for the skins.

3.1. Deﬁnition of the problem

Deﬁnition 1. An ordered sequence of circles C={c1, c2, . . . , cn}, n ∈Nis

called an admissible conﬁguration, if the corresponding disks D={d1, d2, . . . , dn}

fulﬁll the following conditions (see Fig. 3 (a)):130

•di6⊂

n

S

j=1,j6=i

dj, i ∈ {1,2, . . . , n}

•di∩dj=∅, i, j ∈ {1,2, . . . , n}, j /∈ {i−2, i −1, i, i + 1, i + 2}

•di−1∩di+1 6=∅=⇒di−1∩di+1 ⊂dii∈ {2,3, . . . , n −1}

Regarding three consecutive circles ci−1,ci, and ci+1, let us consider the

line segment connecting the centers of ci−1and ci. The intersection point of135

the line segment and circle ciis denoted with Si1. Similarly, Si2can be created

using the centers of ciand ci+1. To exclude those cases when the positions of

the circles would yield extremely sharp turnarounds, we extend the conditions

of Deﬁnition 1 with the following criteria (see Fig. 3 (b)):

•Si1/∈ci+1, i ∈ {2,3, . . . , n −1}140

•Si2/∈ci−1, i ∈ {2,3, . . . , n −1}

Deﬁnition 2. Given an admissible conﬁguration of circles C={c1, c2, . . . , cn},

n∈N, let s(t)and ¯s(t)be two, at least G1continuous curves, called “left” skin

and “right” skin, satisfying the following criteria (see Fig. 4):

•Each circle ci(i∈ {1,2, . . . , n})has either two touching points Ui, Vi∈ci

145

where Ui, Vi∈s(t), or one touching point Wicalled “midpoint” where

Wi∈s(t). The tangent lines of ciand s(t)are identical at these points.

Analogously, in the case of ¯s(t), there exist either two points Ui, V ior a

midpoint Wi.

8

(a) (b)

Figure 3: Non-admissible conﬁguration of input circles. Besides the now standard exclusion

of input circles displayed in (a), the scenario in (b) shows sharp turnarounds. One can easily

obtain admissible conﬁguration by slightly repositioning e.g., the red circles.

(a) (b)

Figure 4: In (a), the touching points are correctly separated for the left and right skin, and

the directions of the tangent vectors are deﬁned correctly. Meanwhile, (b) shows when the

skins do not satisfy such conditions.

•In case of s(t)(“left” skin), each circle ciis considered with a negative150

(clockwise) orientation, and so as the d

UiVicircular arc deﬁned by Uiand

Vi. The relation UiViof the two points reﬂects the orientation as well.

The midpoint Wiis deﬁned as Wi∈d

ViUi,||Vi−Wi|| =||Ui−Wi||, and

denoted as Wi=Vi˙Ui.

For ¯s(t)(“right” skin), the orientation is considered as positive (counter-155

clockwise), and the touching points and arcs can be deﬁned similarly.

9

•In case of s(t), if the tangent vector(s) at the touching point(s) are ro-

tated by 90 degrees in clockwise direction, they point to the center of ci.

Analogously, the rotation is counterclockwise for the corresponding tangent

vectors of ¯s(t).160

•Ui, Vi, Wi/∈

n

S

j=1,j6=i

dj, where i∈ {1,2, . . . , n}. Same applies for Ui, V i,

and Wi.

The determination of the touching points and the tangent vectors at them

are of utmost importance in skinning. We now provide the computation for the

“left” skin; the “right” one can be computed analogously.165

3.2. Deﬁning touching points

Given an admissible sequence of input circles, we consider three consecutive

circles ci−1,ci, and ci+1 with their corresponding disks di−1,di, and di+1,i∈

{2, . . . , n −1}. As stated in Deﬁnition 2, the skin touches cieither along a

circular arc deﬁned by Uiand Vi, or at a single midpoint Wi. Let Qiand Pi

170

note the points on cioriginated from the left outer bitangents of circle ciand

ci−1, and ciand ci+1, respectively (see Fig. 5).

(a) (b)

Figure 5: Construction of the touching points using the outer bitangents. If UiVi, then

the skin touches cialong the circular arc [

UiVi. If not, then there is only one touching point:

the midpoint Wi.

If ci−1∩ci=∅, then Ui=Qi. Otherwise, we deﬁne the proper intersection

point Ni1. Let us note the center of ciby Oi(xi, yi), and the center of ci−1

10

by Oi−1(xi−1, yi−1). Now let Ni1be one of the intersection points for which175

it is true that by rotating the −−−−→

Oi−1Oivector in a counterclockwise direction

by less than 180 degrees, it has the same direction as −−−−−→

Oi−1Ni1(see Fig. 6).

Practically, Ni1(xNi1, yNi1) is the point of intersection for which the condition

(xi−xi−1)·(yNi1−yi−1)−(yi−yi−1)·(xNi1−xi−1)>0 holds.

180

Figure 6: Obtaining the suitable intersection point Ni1with the help of a counter-clockwise

rotation about the center of ci−1.

If ci∩ci+1 =∅, then Vi=Pi, else the proper intersection point Ni2, can be

determined analogously. Now we can deﬁne Uiand Viin the following way:

Ui=

Ni2,if Qi∈di+1

Qi,otherwise

Vi=

Ni1,if Pi∈di−1

Pi,otherwise

185

If UiVi, we have our ﬁnal touching points Uiand Vi, and the oriented

circular arc d

UiVi. If UiVi, then a midpoint has to be used. Now let us

consider li1, the line going through the centers of ci−1and ci; correspondingly

li2is deﬁned by the centers of ciand ci+1. We deﬁne Si1and Si2by intersecting

ciwith li1and li2. If Si1/∈[

PiQi, then V0

i=Vi, otherwise we deﬁne V0

ias190

follows:

V0

i=

Si1,if ci−1∩ci=∅

Ni1,otherwise

We can construct U0

ianalogously. If Si2/∈[

PiQi, then U0

i=Ui, else:

11

U0

i=

Si2,if ci∩ci+1 =∅

Ni2,otherwise

Finally we can deﬁne the new midpoint as W0

i=V0

i˙U 0

i. See Fig. 7 for all

possible variations.

To determine touching points for the ﬁrst and last circles, it is considered as195

c1and cneach has one touching point originated from the left outer bitangents

of c1and c2, and cn−1and cn, respectively. Thus, U1=V1=P1and Un=

Vn=Qn. Algorithm 1 shows the pseudocode of ﬁnding the touching points on

circle ci.

3.3. Determining tangent lengths200

After deﬁning all the contact points and arcs for the circles, we construct

cubic polynomial Hermite curves between each circle pair (ciand ci+1,i∈

{1, . . . , n −1}) whose endpoints are noted as Biand Ai+1. If UiVithen

Bi=Vi, else Bi=Wi. If Ui+1 Vi+1 then Ai+1 =Ui+1, else Ai+1 =Wi+1.

The corresponding tangent vectors are eiand fi, that are tangent to ciand ci+1

205

respectively. Their proper length is needed to be deﬁned in order to provide a

solution and avoid the suddenly and dramatically changing tangent lengths. The

method of Bastl et al. [2] lacks the continuous transition while switching between

two touching points and one (as explained in Fig. 2), i.e., when the arc length

deﬁned by Qiand Piis short in regard to the circumference of ci; while it behaves210

very well if the distance of the circles is quite large (see Fig. 8 (a)). Regarding

the method of Kunkli and Hoﬀmann [1], we can experience the opposite: even

though it provides continuously changing tangent lengths, it is not suitable

in such extreme cases (see Fig. 8 (b)). Considering these, we need a proper

combination of them to provide a solution. We prefer using the calculations215

of [1] when the arc length deﬁned by Qiand Piis short, but we favor the

calculations of [2] when the distance of the circles is diverse.

First, let us recall the starting and ending tangent lengths computed by the

method of Kunkli and Hoﬀmann. Let tinote the radical line of circles ciand

12

(a) W0

i=Si1˙_Si2(b) W0

i=Si1˙_Qi(c) W0

i=Si1˙_Ni2

(d) W0

i=Pi˙_Si2(e) W0

i=Pi˙_Qi(f) W0

i=Pi˙_Ni2

(g) W0

i=Ni1˙_Si2(h) W0

i=Ni1˙_Qi(i) W0

i=Ni1˙_Ni2

Figure 7: Deﬁnition of the midpoint on cion several examples. Various mutual positions of

the circles require diﬀerent ways to compute the location.

13

Algorithm 1 Deﬁning touching points on circle ci

1: procedure getTouchingPoints(i)

2: if i= 1 then

3: U1=V1=P1

4: else if i=nthen

5: Un=Vn=Qn

6: else

7: Ui=Qi,Vi=Pi

8: if Pi∈di−1then

9: Vi=Ni1

10: if Qi∈di+1 then

11: Ui=Ni2

12: if UiVithen

13: Ai=Ui,Bi=Vi

14: else

15: U0

i=Ui,V0

i=Vi

16: if Si1∈[

PiQithen

17: V0

i=Si1

18: if ci−1∩ci6=∅then

19: V0

i=Ni1

20: if Si2∈[

PiQithen

21: U0

i=Si2

22: if ci∩ci+1 6=∅then

23: U0

i=Ni2

24: W0

i=V0

i˙U 0

i

25: Ai=Bi=W0

i

14

c1

c2

c3

c4

c5

c6

(a)

c1

c2

c3

c4

c5

c6

(b)

Figure 8: Inadequate tangent length calculations in previous methods. In (a), the

insuﬃciency of the method of Bastl et al.[2] can be seen: the right skin intersects c3because

the deﬁned arc length is small. In (b), the generated skins between circles c4and c5get too

thin with the method of Kunkli and Hoﬀmann [1].

ci+1. Let dki1denote twice the distance of Biand ti; also let dki2denote twice220

the distance of Ai+1 and ti.

Bastl et al. compute the starting and ending tangent lengths in the following

way:

dbi1=

2· ||Bi−Vi||,if Bi=Wi

2· ||Bi−Vi+1||,otherwise

dbi2=

2· ||Ai+1 −Ui+1||,if Ai+1 =Wi+1

2· ||Ai+1 −Ui||,otherwise

Now let us consider the following notations:

•si1and si2: the arc length deﬁned by Qiand Pion ci; and Qi+1 and Pi+1

on ci+1,

•dcici+1 : the distance of the centers of ciand ci+1,225

•davg =1

n−1

n−1

P

j=1

dcjcj+1 : the average distance of the centers of two neigh-

boring circles,

•ri: the radius of circle ci.

15

Let di1and di2denote the new starting and ending tangent lengths at Bi

and Ai+1, respectively:230

dij=λij·dbij+1−λij·dkij(1)

λij= min sij

2riπ·dcici+1

k·davg

,1

where k∈R+,λij∈[0,1], i∈ {1,2, . . . , n −1}and j ∈ {1,2}.

The value of k— as a kind of shape parameter — can be chosen by the

user. Our experience showed that choosing k= 0.5 results in good output in

the problematic positions as well.

The detailed algorithm of creating the skin between circles ciand ci+1 is235

shown in Algorithm 2.

To summarize, after ﬁnding the touching points on the circles (Algorithm 1),

one can contruct the skin by applying Algorithm 2 to all circle pairs from the

admissible set of input circles. The construction is showed in Algorithm 3.

4. Results and comparison240

As a comparison, let us examine diﬀerent scenarios and generate the output

of each of the skinning methods.

Fig. 9 shows that the method of Kunkli and Hoﬀmann distorts the skin when

the circles are relatively far from each other: the skins intersect and they cut

into the circles as well. Our new algorithm solves these problems and generates245

appropriate skins for the given set of circles.

16

Algorithm 2 Construction of the skin for circle ciand ci+1

1: procedure computeSkin(i)

2: if Bi6=Aithen

3: Construct the circular arc [

AiBi

4: Let eibe the tangent vector at Bion ci

5: Let fibe the tangent vector at Ai+1 on ci+1

6: Let tibe the radical line of ciand ci+1

7: dki1= 2 ·distance(Bi, ti)

8: dki2= 2 ·distance(Ai+1 , ti)

9: if Bi=Aithen

10: dbi1= 2 · ||Bi−Vi||

11: else

12: dbi1= 2 · ||Bi−Vi+1 ||

13: if Ai+1 =Bi+1 then

14: dbi2= 2 · ||Ai+1 −Ui+1 ||

15: else

16: dbi2= 2 · ||Ai+1 −Ui||

17: keik=λi1·dbi1+ (1 −λi1)·dki1See Expression 1

18: kfik=λi2·dbi2+ (1 −λi2)·dki2

19: Construct the cubic Hermite interpolant given by {Bi, Ai+1,ei,fi}

Algorithm 3 Construction of the left skin for an admissible set of circles

Input: C={c1, c2, . . . , cn}, an admissible sequence of circles

Output: s(t), the left skin

1: for i=1;i≤n; i++ do

2: getTouchingPoints(i)see Algorithm 1

3: for i=1;i≤n−1; i++ do

4: computeSkin(i)see Algorithm 2

Regarding the method of Bastl et al., it does not allow dynamic modeling as

sudden changes happen both in terms of the touching points and the tangent

17

(a) (b)

Figure 9: Comparison of the method by Kunkli and Hoﬀmann [1] (a), and our new solution

(b). Even in such extreme cases, the new skins do not intersect the circles, nor the skins

themselves.

lengths. However, these problems do not arise using our skinning method. In

Fig. 10 (b), we can see that our algorithm changes the touching point on c3grad-250

ually when moving c2downwards; whilst Bastl et al. method is discontinuous in

the terms of the location of the touching point (see Fig. 10 (a)). Coming from

the construction, the new touching points do not get inside the circles; while

using the method of Bastl et al., they may fall inside other circles (see Fig. 11).

Fig. 12 shows that using our method, the change of the tangent lengths is in a255

continuous way.

For such problematic cases, we provide a more detailed comparison with

videos in [26].

5. Discussion

Regarding our new skinning technique, since the touching points are always260

out of the neighboring circles, and the tangent lines of the circles and the skins

are common at that touching points, we can prove that the skins of denser and

denser subsets of a family of circles converge to the envelope of the family (if

exists), at least locally.

Let us consider a continuous one-parameter family of circles having an enve-265

lope (we consider the skin and the envelope on one side of the family; the other

side works analogously). Also, let us consider one ﬁxed member of the family,

18

(a)

c1c2

c3

c4

c1c2

c3

c4

(b)

Figure 10: Continuously moving c2downwards from its original position, one can expect

continuous alteration of the touching point. Using the method of Bastl et al. (a), if we mark

the locations of the touching point on c3while c2is being moved, we can see that the

movement of the touching point is discontinuous. This yields a sudden “jump” of the

touching point with a signiﬁcant change in the shape of the skin as well. With our new

skinning method (b), the location of the touching point and the shape of the skin are

changing continuously.

ci. By picking two further members from the family of circles, on the opposite

sides of ci, let us denote them by ci−1and ci+1. Computing a skin along these

three circles, the resulting curves will evidently diﬀer from the envelope in most270

cases. But let the two circles ci−1and ci+1 converge to the ﬁxed circle ci— i.e.,

we consider circles from the family closer and closer to the original circle ciin

both sides — and let us suppose that these circles always form an admissible

set of circles in our terms. The computed touching point(s) on ciwill always

19

c1

c2

c3

c4

(a)

c1

c2

c3

c4

(b)

Figure 11: With the method of Bastl et al.(a), the midpoint is generated inside c4, and the

skin cuts into the circle. Our method (b) solves these kind of problems.

c2

c3

c4

c5

c6

c1

(a)

c2

c3

c4

c5

c6

c1

(b)

c2

c3

c4

c5

c6

c1

(c)

Figure 12: The method of Bastl et al. (red) changes the tangent length dramatically when

minimally moving a circle. Our method (green) continuously changes the tangent length,

thus it allows smooth dynamic design of the skin without intersecting the given circles. The

cropped pictures (b) and (c) show the generated skins for the slightly diﬀerently positioned

circle c5. (Note that some parts of the skins overlap, hence it is harder to separate them

visually.)

20

be out of the circles ci−1and ci+1, and in between the intersection points Ni1

275

and Ni2of ci−1and ci, and ciand ci+1, respectively. While the arc between

the two intersection points Ni1and Ni2is shrinking on ci, it always contains

the touching point(s). Applying the sandwich rule it is easy to see that the two

intersection points Ni1and Ni2, and the computed touching point(s) tend to

be identical if the family parameters of the two neighboring circles converge to280

the family parameter of the ﬁxed circle ci. But the deﬁnition of the envelope

of the family of circles is the limit of points of intersections of nearby circles.

Therefore, the touching point of the envelope and the computed touching point

of the skin tend to be identical. Moreover, the length of the tangent vector

at the touching point on citends to zero due to the fact that in Expression 1,285

both dbijand dkijtend to zero. Since the tangent directions of the skin always

coincide with the tangent directions of the circle ciat the touching points, and

this also holds for the tangent direction of the envelope, these tangent lines also

tend to be identical. That is — locally — the skin converges to be the envelope

of the family.290

5.1. Avoiding intersections of the skins

The problem of intersecting skins (called self-intersections in [2]) and inter-

section with the input circles are interesting and important issues in skinning.

The method of Bastl et al. oﬀers a solution to the latter problem. If the skinning

curves are considered as cubic B´ezier curves, then the skin can intersect the cir-295

cles when the control polygon is S-shaped. To resolve this, the exact position of

the midpoint is being changed along the circular arc, until the resulting control

polygon is C-shaped. This can be done by choosing a weight for the midpoint

to specify its exact position.

Building upon this idea, we now solve those cases when the skins intersect300

each other. Let us consider the two B´ezier curves (that are now C-shaped)

between two circles, and the starting and ending points: P0=Uiand P3=

Vifor the ﬁrst (“left”), and R0=Uiand R3=Vifor the second (“right”)

curve. Let P0P1P2P3and R0R1R2R3denote the convex hulls of the control

21

polygons. Derived from the deﬁnition of the constructed skins (see Section 3.1)305

the following conditions are satisﬁed:

•P0P3∩R0R3=∅

•P0, P3/∈R0R1R2R3

•R0, R3/∈P0P1P2P3

By examining only the intersections of the control polygons, we avoid the costly310

operation of obtaining the intersections of the two curves. To avoid the intersec-

tion, thus we can speciﬁcally modify the lengths of the ﬁrst and last sides of the

control polygons (P0P1,P2P3and R0R1,R2R3), so that they are shortened to

their closest intersection points. For details, see Algorithm 4. This way we can

reach that neither the control polygons (convex hulls) intersect each other, nor315

the curves. This implicitly solves those situations when the skins get too “thin”,

as the convex hulls can intersect even when the curves do not yet. Fig. 13 shows

the output of our method. Other than this algorithmic approach, the problem

of intersecting skins can be solved manually by changing the tangent lengths as

the user can adjust the shape parameter k.320

Even though [2] states that the B´ezier curve can always be transformed to

be C-shaped using weights to specify the location of the midpoint on the arc, in

such cases as in Fig. 2 (b), we can see that moving the midpoint along that short

arc does not yield a C-shape. Thus, in the future we plan to give a variation of

the Algorithm 4 so that it gives solution to S-shaped B´ezier curves as well.325

5.2. Generalization to convex planar shapes

Bastl et al. generalize their algorithm to closed convex parametric shapes,

and since our new technique ﬁnds the touching points in an analogous way —

using bitangents —, it is possible to extend it as well in principle. Obtaining Qi

and Piand the intersection points Ni1and Ni2is straightforward; only Si1and330

Si2are needed to be redeﬁned — we need to deﬁne the center of the shape. To

resolve this, ﬁrst we deﬁne the convex hull of the shape, then we determine the

22

(a) (b)

(c) (d)

Figure 13: In case of intersecting skins, we can apply Algorithm 4 step by step: (a) is the

original position of the skins between two circles; (b) and (c) shows when P1and R1are

moved. In this example P2does not need to be changed. In (d), the ﬁnal result can be seen

after moving R2.

smallest circle cisthat contains the closed shape (using e.g., [27]), whose center

can be used as the center of the shape.

For the tangent lengths, dbi1and dbi2can be calculated directly. To deter-335

mine dki1and dki2we can use the radical lines of cisand ci+1s. Once the centers

of the shapes are deﬁned, λi1and λi2can be computed as well.

6. Extensions

6.1. Skinning of spheres

Kunkli and Hoﬀmann deﬁned a technique to extend their planar algorithm340

to higher dimensions. For an admissible sequence of spheres, the aim is to

construct a G1continuous surface that touches each sphere along a circle and

is tangent to the spheres. To create the skinning surface, touching circles have

to be deﬁned: the method reduces the problem to the planar case and obtains

23

Algorithm 4 Solution to the intersecting skins

Input: control polygons P0P1P2P3and R0R1R2R3

Output: modiﬁed control polygons P0P1P2P3and R0R1R2R3

1: for j=0;j<4;j++do

2: Lj=P0P1∩RjR(j+1)%4

3: Mj=R0R1∩PjP(j+1)%4

4: P1=Ljwhere distance(P0, Lj)is the smallest

5: R1=Mjwhere distance(R0, Mj)is the smallest

6: for j=0;j<4;j++do

7: Lj=P2P3∩RjR(j+1)%4

8: Mj=R2R3∩PjP(j+1)%4

9: P2=Ljwhere distance(P3, Lj)is the smallest

10: R2=Mjwhere distance(R3, Mj)is the smallest

the touching circles based on the 2D solution. Patches between each pair of345

neighboring spheres are deﬁned by Hermite interpolants: corresponding points

are deﬁned on each pair of touching circles and get rotated along the circles

themselves. Tangent lengths are computed for the corresponding points on the

circles based on the radical plane of the two spheres (for details of computation

see [1]).350

The method of Bastl et al. uses the same approach to determine the touching

circles (in their case, it is possible to obtain one or two touching circles). Since

it is also based on the planar algorithm, and — as shown in Section 2.2 — the

localization of touching points has insuﬃciencies, it is clear that the problem

also occurs in higher dimension. However, they use a blending technique [28] to355

create patches between the spheres. The tangent length calculation that they

deﬁned for their planar solution is not used in their spatial algorithm.

Our approach is to extend our skinning method to 3D, fundamentally based

on the technique deﬁned in [1]. The requirements for an admissible conﬁguration

of spheres are analogous to the ones declared in Section 3. We construct a G1

360

continuous surface that is tangent to the spheres and touches each sphere along

24

one or two circles. If a sphere has two touching circles, the spherical part deﬁned

by them is also considered as a part of the skin. These circles are derived from

the touching points that we can acquire from the planar algorithm, and we use

Hermite curves to deﬁne the surface between two neighboring spheres.365

The tangent length calculation in Section 3.3 can be directly applied to

spheres; when needed, we can use surface area instead of arc lengths and cir-

cumference. Since the touching points have diﬀerent tangent lengths for the

“left” and the “right” skins on each circle in the planar case, in 3D the cal-

culated tangent lengths have to be interpolated along the touching circles. As370

a ﬁnal step, a spherical patch is calculated when a sphere has two touching

circles deﬁned. Fig. 14 shows the output of our algorithm extended to three

dimensions.

Figure 14: Extension to 3D. The skins consist of Hermite interpolants (green) and spherical

parts (gray).

The ﬁnal parametric surface is rational, since it can use the rational pa-

rameterization of the touching circle in its ﬁrst parameter and will follow the375

polynomial parameterization of the Hermite arc in its second parameter. Here

we note, that the surface can be optimized to avoid unnecessary distorsion by

applying rotation-minimizing frames, but it certainly increases the computa-

tional time (for details see [24]).

6.2. Branching380

Branching is possible in both the planar and spatial cases. To create branches

in 2D, the approach of Bastl et al. can be directly applied, for details see [2].

Fig. 15 shows the output of our skinning algorithm for a complex set of circles

with several branches.

25

Figure 15: Branching in 2D — skinning a complex set of circles with our new method.

Based on [1], Bana et al. [19] provided an algorithm for branching in 3D: they385

deﬁne a boundary curve with the help of the touching circle on the sphere to

which the branch is connected. Applying this approach, however, one can face

an obstacle as a sphere often has two touching circles in our algorithm. Even

though it is possible to deﬁne the boundary curve in two parts, the resulting

joining surface and the original surface would not assure G1continuity.390

Bastl et al. also extended their algorithm to branch skinning surfaces, but

besides a few ﬁgures as examples, they did not provide exact description how

they can determine the new touching circles.

We now give an algorithm for branching in 3D. Let us consider neighboring

spheres si−1, si, si+1, and let sicbe a sphere of a new branch connecting to395

si(i∈ {2, . . . , n −1}). The idea is to create two touching circles on si, then

construct a third one to which the new skinning surface can join. In case the ﬁrst

two circles intersect each other, we redeﬁne them in a way that they touch each

other at one point — thus the skinning surface provides a smooth connection.

The detailed algorithm is as follows. As Fig. 16 (a) shows, touching circle ti1

400

is originated from applying the basic algorithm to sic,si, and si+1; while ti2is

obtained from si−1,si, and sic. Let Simbe the plane that contains the center

of siand is perpendicular to the intersection line of the planes of ti1and ti2. As

it can be seen in Fig. 16 (b), intersecting Simwith siyields circle cim. Then the

points Pi1and Pi2are deﬁned by intersecting cimwith ti1and ti2, respectively.405

The touching circle to which siccan connect is ti3, which goes through Pi1and

26

(a) (b)

(c) (d)

(e)

Figure 16: The construction of the touching circles for branching. When the touching circles

ti1and ti2intersect, we provide an algorithm to redeﬁne the touching circles to avoid the

intersection.

27

Pi2, and its center is the midpoint of the two points (see Fig. 16 (c)). If ti1and

ti2intersect, then we deﬁne the bisector plane of the planes of ti1and ti2which

intersects ti3. By intersecting this plane with cim, the resulting point that is

farther from sicis Mi, as in Fig. 16 (d). Then ti1is redeﬁned so that it goes410

through Miand Pi1, and its center is the midpoint of the two points. ti2is

redeﬁned analogously using Miand Pi2. As shown in Fig. 16 (e), ti1and ti2

touch each other only at Mi, and they touch ti3at Pi1and at Pi2, respectively.

Fig. 17 shows the output of our branching algorithm in 3D. In theory it is

possible to construct branching without selecting one speciﬁc sphere by com-415

puting a suitable joining surface between more than two spheres as well, but it

is beyond the scope of this paper. For a possible solution of this kind of problem

see [25].

Figure 17: Branched skinning surfaces using our algorithm. The skins consist of Hermite

interpolants (green) and spherical parts (gray).

7. Conclusion

We studied the main advantages and disadvantages of recently developed420

circle and sphere skinning methods, and we provided a new, improved algorithm

preserving the beneﬁts of the method by Bastl et al. [2] and the one by Kunkli

and Hoﬀmann [1], whilst eliminating their drawbacks. We have seen that several

problems arose in the aspect of dynamic modeling, thus the aim of our new

skinning method was to give a solution to these ineﬃciencies. We have also425

extended the algorithm to the three-dimensional space and to branched shapes.

We introduced an algorithmic approach to the problem of intersecting skins as

28

well. The new, improved technique is fast, can be used for real-time modeling

due to the smooth alteration of skins, and provides good results even in extreme

cases.430

Acknowledgements

The ﬁrst author was supported by the ´

UNKP–17–3 New National Excel-

lence Program Of The Ministry Of Human Capacities.

The second author was supported by the ´

UNKP–17–4 New National Ex-

cellence Program Of The Ministry Of Human Capacities.435

The third author’s research was supported by the grant EFOP-3.6.1-16-

2016-00001 (Complex improvement of research capacities and services at Esz-

terhazy Karoly University) and by the construction EFOP-3.6.3-VEKOP-16-

2017-00002. The project was supported by the European Union, co-ﬁnanced by

the European Social Fund.440

References

[1] R. Kunkli, M. Hoﬀmann, Skinning of circles and spheres, Computer Aided

Geometric Design 27 (8) (2010) 611–621. doi:10.1016/j.cagd.2010.07.

003.

[2] B. Bastl, J. Kosinka, M. L´aviˇcka, Simple and branched skins of systems of445

circles and convex shapes, Graphical Models 78 (2015) 1–9. doi:10.1016/

j.gmod.2014.12.001.

[3] G. Farin, Curves and Surfaces for CAGD: A Practical Guide, 5th Edition,

Academic Press, 2002.

[4] G. Farin, J. Hoschek, M.-S. Kim, Handbook of Computer Aided Geometric450

Design, Elsevier, 2002.

[5] J. Hoschek, D. Lasser, Fundamentals of Computer Aided Geometric Design,

A.K. Peters, 1993.

29

[6] L. Piegl, W. Tiller, Surface skinning revisited, The Visual Computer 18 (4)

(2002) 273–283. doi:10.1007/s003710100156.455

[7] L. Piegl, W. Tiller, Surface approximation to scanned data, The Visual

Computer 16 (7) (2000) 386–395. doi:10.1007/PL00013393.

[8] X. Yang, J. Zheng, Approximate T-spline surface skinning, Computer-

Aided Design 44 (12) (2012) 1269–1276. doi:10.1016/j.cad.2012.07.

003.460

[9] C. D. Woodward, Skinning techniques for interactive B-spline surface in-

terpolation, Computer-Aided Design 20 (8) (1988) 441–451. doi:10.1016/

0010-4485(88)90002-4.

[10] D.-J. Yoo, Three-dimensional surface reconstruction of human bone using

a B-spline based interpolation approach, Computer-Aided Design 43 (8)465

(2011) 934–947. doi:10.1016/j.cad.2011.03.002.

[11] Y. Li, W. Chen, Y. Cai, A. Nasri, J. Zheng, Surface skinning using peri-

odic T-spline in semi-NURBS form, Journal of Computational and Applied

Mathematics 273 (2015) 116–131. doi:10.1016/j.cam.2014.05.026.

[12] F. F. Leymarie, P. Aparajeya, C. MacGillivray, Point-based medialness for470

movement computing, in: Proceedings of the 2014 International Workshop

on Movement and Computing, MOCO ’14, ACM, New York, NY, USA,

2014, pp. 31:31–31:36. doi:10.1145/2617995.2618001.

[13] M. L. Connolly, Analytical molecular surface calculation, Jour-

nal of Applied Crystallography 16 (1983) 548–558. doi:10.1107/475

S0021889883010985.

[14] H. Edelsbrunner, Deformable smooth surface design, Discrete & Computa-

tional Geometry 21 (1999) 87–115. doi:10.1007/PL00009412.

[15] J. Rossignac, B. Whited, G. Slabaugh, T. Fang, G. Unal, Pearling: 3D in-

teractive extraction of tubular structures from volumetric images, in: MIC-480

30

CAI Workshop on Interaction in Medical Image Analysis and Visualization,

2007.

[16] S. Piskin, G. Unal, A. Arnaz, T. Sarioglu, K. Pekkan, Tetralogy of Fallot

Surgical Repair: Shunt Conﬁgurations, Ductus Arteriosus and the Circle

of Willis, Cardiovascular Engineering and Technology 8 (2017) 107–119.485

doi:10.1007/s13239-017-0302-5.

[17] Z. Ji, L. Liu, Y. Wang, B-mesh: A modeling system for base meshes of

3d articulated shapes, Computer Graphics Forum 29 (7) 2169–2177. doi:

10.1111/j.1467-8659.2010.01805.x.

[18] X. Zhu, X. Jin, L. You, Analytical solutions for tree-like structure modelling490

using subdivision surfaces, Computer Animation and Virtual Worlds 26 (1)

(2015) 29–42. doi:10.1002/cav.1563.

[19] K. Bana, K. Kruppa, R. Kunkli, M. Hoﬀmann, KSpheres - an eﬃcient

algorithm for joining skinning surfaces, Computer Aided Geometric Design

31 (2014) 499–509. doi:10.1016/j.cagd.2014.08.003.495

[20] J.-M. Thiery, ´

E. Guy, T. Boubekeur, Sphere-Meshes: Shape Approximation

Using Spherical Quadric Error Metrics, ACM Transactions on Graphics

(TOG) 32 (6) (2013) 178:1–178:12. doi:10.1145/2508363.2508384.

[21] G. Slabaugh, G. Unal, T. Fang, J. Rossignac, B. Whited, Variational Skin-

ning of an Ordered Set of Discrete 2D Balls, in: F. Chen, B. J¨uttler (Eds.),500

Advances in Geometric Modeling and Processing, GMP 2008, Springer,

2008, pp. 450–461.

[22] G. Slabaugh, J. Rossignac, B. Whited, T. Fang, G. Unal, 3D Ball Skinning

using PDEs for Generation of Smooth Tubular Surfaces, Computer-Aided

Design 42 (2010) 18–26. doi:10.1016/j.cad.2009.03.004.505

[23] B. Blaschitz, Skinning of Circles and Spheres by Geometric Optimization

in Minkowski Space, Journal for Geometry and Graphics 18 (2) (2014)

159–172.

31

[24] M. Hoﬀmann, J. Monterde, E. Troll, Blending of spheres by rotation-

minimizing surfaces, Journal for Geometry and Graphics 19 (2) (2015)510

189–200.

[25] M. Bizzarri, M. L´aviˇcka, J. Kosinka, Skinning and blending with rational

envelope surfaces, Computer-Aided Design 87 (2017) 41–51. doi:10.1016/

j.cad.2017.02.002.

[26] K. Kruppa, R. Kunkli, M. Hoﬀmann, Comparison of skinning methods515

website, https://skinning.github.io/skinning-methods/, [Online; ac-

cessed October 20, 2018].

[27] E. Welzl, Smallest enclosing disks (balls and ellipsoids), in: H. Maurer

(Ed.), New Results and New Trends in Computer Science, Springer Berlin

Heidelberg, Berlin, Heidelberg, 1991, pp. 359–370.520

[28] M. Bizzarri, M. L´aviˇcka, Parameterizing rational oﬀset canal surfaces via

rational contour curves, Computer-Aided Design 45 (2013) 342–350. doi:

10.1016/j.cad.2012.10.017.

32