Diffusion Diagrams: Voronoi Cells and Centroids From Diffusion
Diffusion Diagrams: Voronoi Cells and Centroids From Diffusion
Diffusion Diagrams:
Voronoi Cells and Centroids from Diffusion
TU Berlin
Abstract
We define Voronoi cells and centroids based on heat diffusion. These heat cells and heat centroids coincide with the common
definitions in Euclidean spaces. On curved surfaces they compare favorably with definitions based on geodesics: they are
smooth and can be computed in a stable way with a single linear solve. We analyze the numerics of this approach and can
show that diffusion diagrams converge quadratically against the smooth case under mesh refinement, which is better than other
common discretization of distance measures in curved spaces. By factorizing the system matrix in a preprocess, computing
Voronoi diagrams or centroids amounts to just back-substitution. We show how to localize this operation so that the complexity
is linear in the size of the cells and not the underlying mesh. We provide several example applications that show how to benefit
from this approach.
Categories and Subject Descriptors (according to ACM CCS): I.3.5 [Computer Graphics]: Computational Geometry and Object
Modeling—Geometric algorithms
1. Introduction diagrams that are identical for Euclidean and spherical domains.
An important consequences of defining the bisectors based on heat
The notion of being closer is a fundamental geometric relation,
values, and not a derived measure of distance, is that they converge
which gives rise to Voronoi cells and centroids. It is commonly
quadratically. We demonstrate that generating curved Voronoi cells
defined based on a distance function. In the Euclidean domain, dis-
from heat is asymptotically as accurate as defining them from dis-
tances are continuous and can be easily computed. Consequently,
crete geodesics, while being much faster.
bisectors for Voronoi tessellations or centroids are also stable and
fast computations.
On curved surfaces, the most natural way to define distance is We also use heat to define centroids of cells (see Section 5).
the length of the shortest path between two points. This path is We can show that for large time values the heat centroid con-
a geodesic and the corresponding distance is called geodesic dis- verges against Euclidean centroids. For curved domains we find
tance. Geodesic distances are generally not continuous functions, that heat centroids provide more stable (and more intuitive) results
and their computation is more involved and potentially unstable. than geodesic centroids because of the underlying smooth function.
This has motivated alternative definitions of distance for curved
surfaces [LRF10, PS13, SdGP∗ 15, BF15]. All computations are based on the same linear system, which
Our main observation is that being closer can be computed based is factorized in a preprocessing step. Generating Voronoi tessella-
on a smooth function on the surface that may not satisfy the proper- tions for arbitrary generators or finding centroids of arbitrary cells
ties of distance. The function being smooth could overcome prob- only require back-substitutions. Moreover, we explain in Section 6
lems in stability of computation. And we may choose a function how to localize the solve – this means we can compute heat values
that can be computed quickly. We suggest to use heat diffusion for only where needed for comparison with other heat values. This idea
this purpose. Heat diffusion is smooth. An important property is extends existing methods in numerical linear algebra libraries and
that it is a monotone function of distance in Euclidean domains. should be of interest for other applications in geometry processing.
Computing heat diffusion on a discrete domain is well-understood
and amounts to solving a linear system. We recall basic properties
We demonstrate the relevance of our approach by tessellating
of the continuous and discrete heat equation in Section 2.
large meshes with centroidal Voronoi tessellations (CVT), and
We analyze the definition of bisectors (or Voronoi cells) based computing barycentric coordinates on surfaces (see Sec. 7). Lastly,
on heat values in Section 4. We show that heat values yield Voronoi we discuss more potential applications and future work in Sec. 8.
2. Discrete heat diffusion In the following sections we will also consider the more general
+ boundary conditions. Namely we want to generalize the heat source
Given a domain Ω, the heat kernel k : R × Ω × Ω describes how
to a surface patch C ⊂ M:
much heat diffuses from a point p ∈ Ω to a point q ∈ Ω in time t ∈
R+ . On a Riemannian manifold without boundary the heat kernel k(0, p, q) = χC (p) (9)
is the fundamental solution of the heat equation
Practically this amounts to setting
∂k = ∆p k
R
∂t CRb(p) dp
(1) h= . (10)
k(0, p, q) = δ(p − q), C 1 dp
Here, the denominator is just the area of the set C. Computing this
where ∆p is the Laplace-Beltrami operator in p and δ represents the integral is easy for piecewise linear sets, as they can be triangu-
Dirac delta. For Ω = Rd the heat kernel is explicitly given by the lated. For convenience, assume the mesh has been triangulated such
formula that the interior of each triangle is either completely inside or com-
pletely outside the set C. Each interior triangle f with vertex indices
!
1 kp − qk2
k(t, p, q) = exp − . (2) i, j, k contributes
(4πt)d/2 4t
1
Inverting this expression one obtains Varadhan’s formula [Var67] h( f ) = ei + e j + ek , i, j, k ∈ f , (11)
3
p
lim −4t log k(t, p, q) = kp − qk, (3) where ei denotes a canonical basis vector. The vector h represent-
t→0
ing the set C can then be built by summing up over the faces, i.e.
revealing the close connection of the heat kernel k(t, p, q) to dis- h = ∑ f ∈C h( f ). We can easily solve Eq. 7 repeatedly for different
tance which also generalizes to manifolds away from the cut lo- initial heat distributions if we have the Cholesky factorization of
cus [Var67]. the system matrix M − tLC . Computing heat diffusion then comes
down to one pass of forward and backsubstiution for the case of a
We are interested in heat diffusion on discrete surfaces embed-
singular heat source as well as for an area heat source.
ded in R3 , represented as triangulated surfaces. The mesh M =
(V, F) is composed of v vertex positions V ∈ R3×v and f triangu-
lar faces F ∈ Z3×f
v , defined as triples of vertex indices. We assume
3. Related work
the triangle mesh to be manifold. We focus on the computation of CVTs and geodesics on meshes
Every point p ∈ M on the mesh can be represented using embedded in R3 .
barycentric coordinates b(p) ∈ Rv with respect to the mesh ver-
tices such that Geodesics on meshes In principle, any algorithm computing
geodesic distances on meshes can be used to generate Voronoi dia-
p = V b(p). (4) grams. One of the earliest approaches generalizes fast marching on
Note that b(p) has at most three non-zero entries for any point p on regular grids to 3d triangle meshes [Set96]. However, this method
the mesh which are defined by the face f containing p. is inaccurate in presence of obtuse triangles. Several strategies to
deal with this problem have been proposed, e.g. [KS98], leading
To solve Eq. 1 numerically on a triangle mesh, following the to approximate solutions. Mitchell et al. [MMP87] describe an al-
same approach as Crane et al. [CWW13], we discretize the Lapla- gorithm to compute exact geodesic distances on triangle meshes
cian using the cotan-operator [PP93]. Using their notation, the which has been implemented by Surazhsky et al. [SSK∗ 05]. Chen
cotan-Laplacian is represented by L = M−1 LC where the diago- et al. [CH90] also propose a method to compute exact geodesic
nal (lumped) mass matrix M ∈ Rv×v and LC ∈ Rv×v are given distances which has been improved by Xin et al. [XW09] outper-
by forming both the latter and Surazhsky et al.’s code.
1
(LC u)i = ∑ (cot αi j + cot βi j )(u j − ui ) (5) Diffusion Solutions to the heat equation have been extensively
2 j,(i, j)∈ fk used in machine learning and geometry processing, for example
1 by Benjamin et al. [BPVR11] in the context of mesh segmentation.
Mii = ∑ a j. (6)
3 i∈ fj The central idea is to compute the fundamental solution to (1)
v
Here a j is the area of triangle j and u ∈ R is the vector of co- on a manifold. Given a discrete Laplacian L this solution can be
efficients with respect to the piecewise linear finite element basis. expressed as
Performing an implicit Euler step of length t for Eq. 1 amounts to k(t, p, q) = ∑ f (λk )φk (p)φk (q) (12)
solving the sparse, symmetric, positive-definite system k
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
the function f yields different notions of distance, notably commute of two or more cells are called the Voronoi diagram. It consists of
time distance for f (λ) = 1/λ [FPmRS07] and biharmonic distance edges, which are the intersections of exactly two Voronoi cells, and
for f (λ) = 1/λ2 [LRF10]. corners, which are the intersections of three or more Voronoi cells.
Computing these distances up to a specified accuracy is possible We define a Voronoi cell based on heat diffusion. As heat values
using only a subset of eigenvectors rendering these methods feasi- decrease from the source, we use
ble on meshes of moderate size. Patané et al. [PS13] compute fun-
damental solutions of the heat kernel by approximating the matrix Ci (t) = x ∈ Ω, k(t, x, pi ) ≥ k(t, x, p j ), i 6= j . (15)
exponential using Padé approximation. Our method can be under- A motivation for this definition is that it is equivalent to the above
stood as using a Padé approximation of order [0, 1]. Recently, Crane in Euclidean domains because k(t, p, q) is monotone in the squared
et al. [CWW13] introduced a fast approximate method to compute distance kp − qk2 (see Eq. 2).
geodesic distances based on heat diffusion. The central idea is to
diffuse an initial heat distribution by solving a sparse linear system Discrete approximation For computing a Voronoi cell on a trian-
and integrating the normalized gradients of the solution. Iterating gle mesh we compute a piecewise linear approximation of the heat
the normalization and integration step, Belyaev et al. [BF15] pro- equation as discussed in Section 2. For each generator pi we com-
pose an algorithm tailored to the task of finding the shortest dis- pute the corresponding heat distribution, which can be written as
tance to the boundary of a domain in R2 or R3 .
These methods inspired our use of heat diffusion to measure dis- (M − tL) U = (b(p0 ), b(p1 ), . . .) , (16)
tance. In contrast to Crane et al. we use heat diffusion directly as a
"pseudo" distance similar to Solomon et al. [SdGP∗ 15]. so that the i-th column of U represents the heat values correspond-
ing to generator pi . The rows of U correspond to the different heat
Centroidal Voronoi tessellations on meshes Many methods for values in each vertex. For an arbitrary point q on the mesh we can
the construction of CVTs on triangle meshes reduce the problem find the heat values by computing b(q)T U. This allows us to define
to the Euclidean case. Alliez et al. [ADVDI05] use a planar con- the Voronoi cell Ci as the set of points for which the i-th component
formal parameterization of the mesh to map a CVT with respect in the vector of heat values is larger than any other component:
to a spatially varying distance function on R2 to the mesh. This
T T
approach requires cutting the mesh into a disk. This is a challeng- Ci = x ∈ Ω, b(x) U ≥ b(x) U , i 6= j . (17)
i j
ing task in itself and might introduce misalignments at the seams.
Another common idea is to restrict CVTs in R3 to a surface mesh This allows us to assign every point on the mesh to one of the cells.
(see for example [YLL∗ 09]). Whenever the cells are large relative
to the variation of the metric this method fails to capture the dis- Tessellation Due to the piecewise linear distance functions the in-
tances on the surface. For example using few generators to define tersection of the Voronoi diagram with a face is piecewise linear as
intrinsic barycentric coordinates (see Sec. 7) really requires an in- well. Consider a triangle f = (i, j, k) containing part of the Voronoi
trinsic method. Moreover, close sheets and self-intersection can not diagram and the heat values at the triangle vertices
be handle by this method.
W f = (ei , e j , ek )T U. (18)
One of the few practical intrinsic methods for the computation
of CVTs was presented by Wang et al. [WYL∗ 15]. They employ a The maximal value in each row of W f represents the ‘closest’ gen-
modified and parallelized version of Xin et al.’s [XW09] implemen- erator of the corresponding vertex. We define the label of each ver-
tation of geodesic distances to rapidly compute intrinsic Voronoi tex as the index of the generator a vertex belongs to. To break ties
diagrams. The computation of cell centroids relies on the repeated (i.e. similar heat values in the vertex) we consider the neighborhood
evaluation of the exponential map at the cell vertices. Approximat- of a vertex inside the face f
ing centroids on planar projections of the cells is problematic in
f f f f
li = lim+ arg max W0,m + ε W1,m + W2,m (19)
terms of convergence and quality for large cells with high variation ε→0 m
in curvature. Our method in contrast produces cell centroid that are
and similarly find a label for j based on the second, and k based on
well defined and insensitive to noise and cell size.
the third row. Note that the label of a vertex depends on the face
being considered and the labels may be different if the vertex lies
4. Voronoi cells on a bisector (as indicated by vertices with more than one color in
Figure 1).
The notion of being closer may be used to tessellate a domain based
on a set of points in that domain. Concretely, given a domain Ω If (and only if) all its vertices on face f carry the same label it
as well as a set of points pi ∈ Ω, i ∈ {1, . . . , n}, called generators, can be assigned to one generator (this follows from convexity). If
the Voronoi tessellation is the decomposition of the domain Ω into not, the face needs to be subdivided. In the simplest case the inter-
Voronoi cells Ci ⊂ Ω consisting of the points x ∈ Ω that are not section consists of a single line segment and we can compute it by
further from pi than from any other of the generators p j : intersecting the two corresponding linear heat functions. Assume
f f
Ci = x ∈ Ω, d(x, pi ) ≤ d(x, p j ), i 6= j .
(14) li 6= l j . Then we find the intersection point on the edge between
vertex i and j by solving
Here, d : Ω×Ω 7→ R is a distance measure on Ω. The set of points x
f f f f
that are elements of more than one cell Ci , i.e. lie in the intersection bW0,li + (1 − b)W1,li = bW0,l j + (1 − b)W1,l j (20)
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
��-���� ������ �������� �-���� ������ ������
� �
◆ ◆ ◆ ◆ ◆ ◆◆◆ ◆
◆ ◆ ◆ ◆ ◆◆ ◆
����� ◆◆ ◆ ◆ ◆ ����� ◆◆ ◆
◆ ◆ ◆◆
◆ ◆◆◆ ◆ ◆ ■ ◆ ◆ ◆◆ ◆
◆◆ ●
■ ●■
■●
◆◆ ◆ ■■ ● ■ ◆◆ ◆ ●
■ ●
■
●
■ ●
■ ● ■●■
◆◆ ■ ■ ■■ ■● ◆◆ ◆ ● ● ■●
● ● ● ◆◆ ◆ ● ■
����� ◆◆ ◆◆ ■ ● ■● ● ����� ● ■
◆◆ ■ ■●■ ■ ●● ◆ ◆ ◆
■ ■ ●●■ ● ■
● ■ ● ■
◆ ■ ●● ◆ ◆ ● ●■ ■ ■
◆◆ ■■ ● ◆◆ ◆ ●●
■
◆◆ ■■ ●
■ ●●
◆ ◆◆
● ■ ● ●● ■■
����
����
■ ■ ■ ●●● ●
����� ◆ ◆◆ ■■ ■ ● ����� ■●●
●
■ ■
■ ● ●● ■ ■
◆ ◆ ●● ■
◆◆ ◆ ■
■ ■ ■ ●● ● ●●■ ■
◆
■■■ ●● ■●
●● ■ ■
��-� ■ ■■ ●●
��-� ■● ■●■
●
■
■ ●● ■
■■ ● ● ���������� ��������� ■ ● ���������� ���������
■■ ●● ●
■ ■ ��������� ���������
●● ■
●● ●
��-� ● ● ◆ ��������� ��-� ◆ ���������
���� ���� ������ ������� ���� ���� ������ �������
��-� ��-�
���� ���� ���� ���� � ���� ���� ���� ���� �
���� ���� ������ ���� ���� ������
Figure 3: Errors of bisectors approximated on triangulations of a sphere relative to mean edge length. The left is based on uniform vertex
distributions with one generator at the pole and another on the equator. The right plot is based on a distribution biased along the one axis
and the generators on opposite points on this axis. Both plots show the errors of exact polyhedral geodesics and heat diffusion using t = 20
and t = 2−7 . Examples of the meshes used in the experiments are shown as insets.
We also bias the distribution so that the average density varies based on diffusion. In this experiment heat diffusion is significantly
along the first coordinate axis. Such spheres with different densi- faster and also scales better with the number of vertices.
ties around the points p0 and p1 allow us to check if the bisectors
still converge to the ground truth, and how much they are affected 5. Centroids on surfaces
by differently sized triangles. Using this set of meshes, we measure
the error of the bisectors as a function of the edge length based on For Euclidean domains the centroid is the center of mass. For more
two values for the time step: t = 1 and t = 2−7 ≈ 0.008. For com- general domains one may employ the notion of Riemannian center
parison, we also compute the bisectors using polyhedral geodesics, of mass [Kar14], which can be defined as the point that minimizes
i.e. the exact distance on the piecewise linear surface, based on Kir- the integrated squared distance values to all points in the cell:
sanov’s implementation [SSK∗ 05]. We also include the biased ver-
Z
ci = arg min d 2 (x, y) dx. (22)
tex distribution and place the generators at p0 , p1 , which are on op- y∈Ω Ci
posite ends of the varying density. The resulting root mean squared
This definition works with arbitrary choices for the distance func-
errors relative to the mean edge lengths are shown in Figure 3. All
tion d(·, ·). For Riemannian surfaces a common choice for d(·, ·) is
plots clearly show the expected quadratic convergence for the diffu-
geodesic distance.
sion bisectors as well as for polyhedral distances. For the uniformly
sampled case the constant is better compared to the biased case. Using heat diffusion, we define the center analogously as the
Diffusion using large values for t seems to be slightly more robust point in a cell that generates the most heat within the cell when
to variations in triangle size, as can be seen in the slightly better re- diffused:
Z
sults for the biased vertex distribution for t = 1. Statistics based on
ci (t) = arg max k(t, x, y) dx. (23)
max-errors and/or max edge lengths show similar characteristics. y∈Ω Ci
1 1
rmse
rmse
1
2
0.50 implicit 0.50
3
timesteps
4
5
0.10 0.10
0.05 0.05
closest vertex
0.001 0.005 0.010 0.050 0.100 t 0.001 0.005 0.010 0.050 0.100
Figure 4: The heat center converges to the Euclidean centroid in the plane for large t. The horizontal line represents the distance to the
closes vertex, which is the optimum value for the discrete approximation. The effect is non-linear, so requires several linear time steps. For
large t the boundary of the finite disk distorts the result. While the non-linearity is clearly visible for irregular polygons (left), Euclidean
centroid and heat centroid are very similar for a wide range of parameters for well-behaved polygons (right).
Writing the exponential function as a series leads to limited to vertices, the error cannot be smaller than this value. We
2 4 see that, indeed, the discrete solution converges to this optimum
kx − yk kx − yk
Z
ci (t) = arg max 1− + − . . . dx (26) value as t grows, however, convergence requires several time steps.
y∈Ω Ci 4t 32t 2 This behavior should be expected, as the similarity between cen-
kx − yk4 troid and heat center is non-linear. The solutions tend to get worse
Z
= arg min kx − yk2 − + . . . dx. (27) for larger values of t because of boundary effects: the approxima-
y∈Ω Ci 8t
tion assumes an infinite plane, and once values start to be non-zero
We see that for t → ∞ the first term dominates, i.e. at the boundary the approximation is distorted. The two plots sug-
gest that Euclidean centroids are matched for smaller time values t
Z
lim ci (t) = arg min kx − yk2 (28)
t→∞ y∈Ω Ci if the polygon is well-shaped (i.e. roughly convex and symmetric).
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
tices in the mesh. This makes sense, as the solution of heat diffu-
sion is global, i.e. heat values are non-zero everywhere. However,
in our context, we typically need the solution only in a certain area
close to the heat source to compute bisectors or centroids. By set-
ting small values explicitly to zero we obtain an approximate solu-
tion at a runtime that is proportional to the number of values we are
actually interested in in contrast to a complete solve.
�
◆
●
■◆
▲
▼ ■
▲◆
●
▼ ●
■
▼
▲
◆
▲
▼
■
● ●
◆
●
▲
■
▼
■
����� ▼
▲
◆
●
■ ◆
▼▼▼ ▲
▼▼▼▼▼
����� ▲▲▲ ▼▼▼▼▼▼▼▼▼▼▼▼▼
▼ ▼ ▼ ▼▼▼
▲▲ ▼▼▼
◆◆ ▲▲ ▼▼
◆ ▲ ▼
����
����� ▲▲▲▲▲▲ ▼
◆
■ ●●●●●●●●●●●●●●●● ▲ ▲
● ▲●
▲●
■ ◆◆ ▲●
▲▲
●●●●●●●●●●●●●●
■ ■ ■ ■◆
■◆■■■■■■■■■■■■■■■ ▲▲■▲■■■■■■■■■■■
��-� ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ ▲◆▲◆▲◆
▲◆▲◆
Figure 6: The central Voronoi cell is computed using the heat ▲◆▲◆ ◆◆
▲▲▼ ▲
method. The left image shows the heat distribution, the middle im-
age the result of the selective solve, which restricts heat computa- ��-�
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
Model |V| Generators T f ac (m:s:ms) Mem (MB) min. φm (deg) φm (deg) T/iter (s:ms)
K LEIN -B OTTLE 35k 100 0:00:076 14 36.1 52.3 00:660
B IMBA 75k 1,000 0:00:202 34 33.7 52.0 00:289
C ASTING 109k 1,000 0:00:437 54 23.2 50.6 00:564
D RAGON 153k 1,500 0:00:479 71 27.6 51.6 00:786
B USTE 297k 2,000 0:01:324 149 35.7 52.8 01:951
K ITTEN 442k 2,000 0:03:069 244 38.4 53.6 03:536
F ERTILITY 499k 2,000 0:03:290 277 35.6 53.2 03:646
H APPY 608k 3,000 0:04:397 330 19.0 51.4 07:187
P IERROT 641k 1,000 0:06:011 367 33.8 52.8 03:838
B UDDHA 669k 2,000 0:06:348 388 28.4 51.7 06:342
P ENSATORE 886k 2,000 0:09:869 529 33.4 53.0 10:969
I SIDORE 4.2M 4,000 2:10:836 2867 23.2 50.6 84:000
Table 1: Statistics for results presented in Fig. 13. All timings were taken on an Intel 3.9 GhZ Core i7 processor using four threads. T f ac
stands for the time taken during pre-factorization. ‘Mem" reports the amount of memory required for storing the Cholesky factorization. φm
is the vector of the smallest interior angles per triangle of the Delaunay triangulation and φm the mean of this angle over all faces. The time
T/iter represents the average time for each iteration (construction of Voronoi diagram and finding cell centroids). In all cases we ran the
algorithm for 100 iterations.
When computing heat diffusion for centroid or distance computa- Parallelization The bulk of computation time (> 95%) is typically
tion of a cell Ci , we select all adjacent Voronoi cells of this cell. For spent during back substitution to solve the heat equation. This step
increased robustness we also include 2nd degree neighbors. The er- can be easily parallelized since we solve the equation for each cen-
ror due to the selective solve is small as illustrated in Fig. 6 and in troid (or Voronoi cell) independently. We use std::thread for
particular, is concentrated on the boundary of the region and neg- parallelization.
ligible in the area of interest. In the initial step, we estimate an
appropriate radius for each generator and compute the local neigh- Results We tested our approach on meshes varying in vertex count,
borhood using Dijkstra’s algorithm. triangle quality and curvature. For each mesh we generated a CVT
from a random initial distribution of the generators. The quality of
Centroids on faces The discrete energies we consider are all based the CVT can be measured based on the interior angles of its dual
on piecewise linear approximation. This means maxima, and there- triangulation. For easy comparison with related work we also report
fore centroids, necessarily coincide with vertices. For convergence the mean and minimum of the smallest interior angle per triangle.
of Lloyd’s method it is beneficial to move the generators smoothly Table 1 shows that the resulting tessellations are similar in regu-
on the surface over the course of the procedure. A possible solution larity compared to other approaches. Since the results depend on
would be to use higher order finite elements to solve the heat equa- random initialization, we report the best out of 5 runs with respect
tion, yet this would increase storage and computation requirements to mean interior angle.
of the factorization.
In terms of computational efficiency, we note that we have been
For the purpose of Lloyd’s algorithm, we decided to smooth the able to generate an intrinsic CVT on meshes with larger vertex
trajectories of generators by locally fitting bivariate quadratic poly- count than reported so far in the literature. To provide a rough com-
nomials to the piecewise linear heat function in the vicinity of the parison to Wang et al. [WYL∗ 15] we have run our algorithm on the
maximum c̃i and to compute the centroid as its unique maximizer. A RMADILLO model with the same number of generators on com-
More specifically, we first determine the heat centroid c̃i as de- parable hardware (2.6GHz Intel i5, four cores) and found a three-
tailed in the previous section. Then we select all faces incident to fold speed-up of the time needed per iteration (0.82s vs. 2.12s).
the vertex c̃i and project them onto the tangent plane at ci as de- Quality metrics in this experiment turned out to be very similar.
fined by the vertex normal at this point. Any choice of vertex nor- The diffusion CVT shows no sig-
mal could be used here, we decided to use the area weighted face nificant dependence on curvature. To
normals. Next, we fit a bivariate polynomial to the heat values at demonstrate this, we have generated 20
the projected vertices. Finally, we determine the triangle that con- and 500 sites on a torus and a sphere
tains the maximum of the polynomial and map this point back to (similar mesh resolution) scaled to unit
the geometry using barycentric coordinates. If the maximum is not area. After 100 iterations we measured
contained in a triangle we use the point on one of the triangles that the variance in cell area and obtained
is closest to the solution. values on the order of 10−6 for 20 sites
Even though this is just a local approximation, the quality of and 10−8 for 500 sites, for both the torus and the sphere. The in-
the resulting CVT is significantly increased using this method as set shows the torus with the sites color coded based on the squared
generators move freely on the surface. We observed an increase of difference to average area. There is apparently no systematic de-
the quality metric φm (see below) of up to 2◦ . pendence of area on curvature.
Figure 8: Dual Delaunay triangulation of a CVT computed using Figure 9: Intrinsic Voronoi diagrams enable interesting applica-
our algorithm. tions. Anisotropic CVTs are generated by immersing the surface
into R6 using positions and normals. For non-convex surfaces, this
The intrinsic nature of the computations allows applying the al- leads to self intersections. The Voronoi diagram on the Klein bot-
gorithm to surfaces that contain self intersections, i.e. that are not tle has been computed in R3 , where no embedding of the surface
properly embedded. This is important as many meshes encountered exists.
in practice contain self intersections. Figure 9 shows an example of
a CVT on an instance of the Klein bottle, which is an example of a
surface that cannot be embedded in R3 coordinates bi (q) at a point q have to fulfill the following require-
ments:
Meshing The regularity of a CVT induces dual Delaunay triangu-
lations with close-to-regular triangles (see Figure 8). This makes P OSITIVITY: bi (q) ≥ 0 for all i.
our approach attractive for computing high-quality base meshes as L AGRANGE PROPERTY: bi (p j ) = δi j .
needed e.g. in semi-regular re-meshing [Gus07]. As mentioned, the PARTITION OF UNITY: Coordinates at a point sum to 1, i.e.
intrinsic computation makes the meshing robust against the geo- ∑ni=1 bi (q) = 1.
metric properties of the embedding, such as proximity of differ- L INEAR PRECISION : The point is the weighted average of the fixed
ent parts of the surface. For generating high-resolution meshes the sites: q = ∑ni=1 bi (q)pi .
source mesh might need to be up-sampled, as the Voronoi diagrams Natural neighbor coordinates define barycentric coordinates using
cannot have more cells than the underlying mesh has vertices. Voronoi diagrams. The basic idea is to first form the Voronoi dia-
gram of the fixed sites pi and compute the area of each Voronoi cell
However, intrinsic computations are costly compared to dis-
ai . The barycentric coordinates of a point q are determined as fol-
tance computations in Euclidean space. For surfaces that are simple
lows: Construct a new Voronoi diagram with the added site q and
enough extrinsic approaches [YLL∗ 09] would be more appropriate.
compute the cell areas ãi and aq respectively. The coordinates are
Anisotropic centroidal Voronoi tessellations The Laplacian is an now defined as bi (q) = (ai − ãi )/aq . This definition motivates the
intrinsic operator and the cotan discretization consequently only alternative name area stealing coordinate.
depends on intrinsic properties such as edge lengths and angles. Given our fast approximation of Voronoi diagrams on meshes
This means our approach is independent of the ambient space and natural neighbor coordinates can be readily generalized to trian-
directly extends to higher co-dimension. We exploit this feature to gle meshes, however, for non-planar meshes linear precision can
get anisotropic CVTs that consider distances in positions as well as not carry over to curved domains. Figure 10 illustrates barycen-
normals: For a mesh with vertices pi and corresponding vertex nor- tric interpolation of texture coordinates. Out method is relatively
mals ni the mapping fλ : M 7→ R6 , pi → (p0i , p1i , p2i , λn0i , λn1i , λn2i ) slow compared to previous work. Rustamov [Rus10] generalizes 2d
lifts the mesh M into R6 [CG06]. In this immersion, intrinsic dis- barycentric coordinates to the surface case by using the exponential
tances also account for normal variation. Note that fλ is not nec- map. This method is limited to sites forming polygons whereas our
essarily injective and the mesh will generally have many self in- method can interpolate between arbitrary data points.
tersections. heat local We construct anisotropic centroidal Voronoi
Panozzo et al. [PBDSH13] compute approximate geodesic dis-
tessellations by evaluating Voronoi cells with respect to the immer-
tances by mapping the mesh to a higher dimensional space where
sion induced by fλ and cell centroids using the diffusion metric. To
Euclidean distances mimic geodesic distances on the original mesh.
fix the relative importance of normals in this computation we nor-
This approximation is used to define barycentric coordinates vari-
malize all meshes to a unit bounding box. In this setting we chose a
ationally. The resulting algorithm is very fast and robust, however,
value of λ = 0.05. Figure 9 shows to results that demonstrate how
the pre-computation is quite heavy and the approximation might
edges align with high-curvature regions.
fail. Moreover, negative weights might occur for coarse samplings.
Our algorithm has faster pre-computation time and can guarantee
7.2. Natural neighbor coordinates positive weights at the cost of much slower evaluation.
Voronoi diagrams can be used to define barycentric coordinates on
Blend skinning Another application of barycentric coordinates is
meshes using natural neighbor coordinates [Sib81] which are use-
blend skinning. Given a set of point handles on a mesh (usually
ful e.g. to interpolate data defined at fixed points.
structured in a skeletal hierarchy), the mesh should deform when
Let p1 , . . . , pn be points in the Euclidean domain. Barycentric the handles are moved. The influence of each handle on a given
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
[BPVR11] B ENJAMIN W., P OLK A. W., V ISHWANATHAN S., R AMANI [LRF10] L IPMAN Y., RUSTAMOV R. M., F UNKHOUSER T. A.: Bi-
K.: Heat walk: Robust salient segmentation of non-rigid shapes. Com- harmonic distance. ACM Trans. Graph. 29, 3 (July 2010), 27:1–27:11.
puter Graphics Forum 30, 7 (2011), 2097–2106. doi:10.1111/j. doi:10.1145/1805964.1805971. 1, 3
1467-8659.2011.02060.x. 2 [Ma06] M A L.: Partial convexity to the heat equation, 2006. arXiv
[CG06] C AÑAS G. D., G ORTLER S. J.: Surface remeshing in arbitrary preprint math/0604059. 7
codimensions. The Visual Computer 22, 9-11 (2006), 885–895. 10 [MMP87] M ITCHELL J. S., M OUNT D. M., PAPADIMITRIOU C. H.:
[CH90] C HEN J., H AN Y.: Shortest paths on a polyhedron. In Proceed- The discrete geodesic problem. SIAM Journal on Computing 16, 4
ings of the Sixth Annual Symposium on Computational Geometry (New (1987), 647–668. 2
York, NY, USA, 1990), SCG ’90, ACM, pp. 360–369. 2 [PBDSH13] PANOZZO D., BARAN I., D IAMANTI O., S ORKINE -
[CLL∗ 05] C OIFMAN R. R., L AFON S., L EE A. B., M AGGIONI M., H ORNUNG O.: Weighted averages on surfaces. ACM Transactions on
NADLER B., WARNER F., Z UCKER S. W.: Geometric diffusions as Graphics (proceedings of ACM SIGGRAPH) 32, 4 (2013), 60:1–60:12.
a tool for harmonic analysis and structure definition of data: Diffusion 10
maps. Proceedings of the National Academy of Sciences of the United [PP93] P INKALL U., P OLTHIER K.: Computing discrete minimal sur-
States of America 102, 21 (2005), 7426–7431. doi:10.1073/pnas. faces and their conjugates. Experim. Math. 2 (1993), 15–36. 2
0500334102. 2
[PS13] PATANÉ G., S PAGNUOLO M.: Heat diffusion kernel and distance
[CPS11] C RANE K., P INKALL U., S CHRÖDER P.: Spin transformations on surface meshes and point sets. Computers & Graphics 37, 6 (2013),
of discrete surfaces. ACM Trans. Graph. 30, 4 (July 2011), 104:1– 676–686. 1, 3
104:10. doi:10.1145/2010324.1964999. 11
[QHY∗ 16] Q IN Y., H AN X., Y U H., Y U Y., Z HANG J.: Fast and
[CWW13] C RANE K., W EISCHEDEL C., WARDETZKY M.: Geodesics exact discrete geodesic computation based on triangle-oriented wave-
in heat: A new approach to computing distance based on heat flow. front propagation. ACM Trans. Graph. 35, 4 (July 2016), 125:1–125:13.
ACM Trans. Graph. 32, 5 (Oct. 2013), 152:1–152:11. doi:10.1145/ doi:10.1145/2897824.2925930. 5
2516971.2516977. 2, 3, 4, 8, 11
[Rus10] RUSTAMOV R. M.: Barycentric coordinates on surfaces. Com-
[Dav11] DAVIS T. A.: User guide for ldl, a concise sparse cholesky pack- puter Graphics Forum 29, 5 (2010), 1507–1516. doi:10.1111/j.
age, 2011. 7, 8 1467-8659.2010.01759.x. 10
[DE13] D ZIUK G., E LLIOTT C. M.: Finite element methods for sur- [SA07] S ORKINE O., A LEXA M.: As-rigid-as-possible surface model-
face pdes*. Acta Numerica 22 (04 2013), 289–396. doi:10.1017/ ing. In Proceedings of the Fifth Eurographics Symposium on Geome-
S0962492913000056. 4 try Processing (Aire-la-Ville, Switzerland, Switzerland, 2007), SGP ’07,
[DRSL16] DAVIS T. A., R AJAMANICKAM S., S ID -L AKHDAR W. M.: Eurographics Association, pp. 109–116. 11
A survey of direct methods for sparse linear systems. Acta Numerica 25 [SdGP∗ 15] S OLOMON J., DE G OES F., P EYRÉ G., C UTURI M.,
(2016), 383–566. 7 B UTSCHER A., N GUYEN A., D U T., G UIBAS L.: Convolutional
[FPmRS07] F OUSS F., P IROTTE A., M . R ENDERS J., S AERENS M.: wasserstein distances: Efficient optimal transportation on geometric do-
Random-walk computation of similarities between nodes of a graph mains. ACM Trans. Graph. 34, 4 (July 2015), 66:1–66:11. doi:
with application to collaborative recommendation. IEEE Transactions 10.1145/2766963. 1, 3
on Knowledge and Data Engineering 19, 3 (March 2007), 355–369. [Set96] S ETHIAN J. A.: A fast marching level set method for monotoni-
doi:10.1109/TKDE.2007.46. 3 cally advancing fronts. Proceedings of the National Academy of Sciences
[Gus07] G USKOV I.: Manifold-based approach to semi-regular remesh- 93, 4 (1996), 1591–1595. 2
ing. Graphical Models 69, 1 (2007), 1 – 18. doi:http://dx.doi. [Sib81] S IBSON R.: A brief description of natural neighbour interpola-
org/10.1016/j.gmod.2006.05.001. 10 tion. Interpreting multivariate data 21 (1981), 21–36. 10
[Ham93] H AMILTON R. S.: A matrix Harnack estimate for the heat equa- [SSK∗ 05] S URAZHSKY V., S URAZHSKY T., K IRSANOV D., G ORTLER
tion. Communications in Analysis and Geometry 1, 1 (1993), 113–126. S. J., H OPPE H.: Fast exact and approximate geodesics on meshes. ACM
doi:10.4310/CAG.1993.v1.n1.a6. 7 Trans. Graph. 24, 3 (July 2005), 553–560. doi:10.1145/1073204.
[JBPS11] JACOBSON A., BARAN I., P OPOVI Ć J., S ORKINE O.: 1073228. 2, 5
Bounded biharmonic weights for real-time deformation. ACM Trans- [Var67] VARADHAN S. R. S.: On the behavior of the fundamental solu-
actions on Graphics (proceedings of ACM SIGGRAPH) 30, 4 (2011), tion of the heat equation with variable coefficients. Communications on
78:1–78:8. 11 Pure and Applied Mathematics 20, 2 (1967), 431–455. 2
[JP∗ 16] JACOBSON A., PANOZZO D., ET AL .: libigl: A simple C++ [WYL∗ 15] WANG X., Y ING X., L IU Y.-J., X IN S.-Q., WANG W., G U
geometry processing library, 2016. http://libigl.github.io/libigl/. 11 X., M UELLER -W ITTIG W., H E Y.: Intrinsic computation of centroidal
voronoi tessellation (cvt) on meshes. Computer-Aided Design 58 (2015),
[Kar14] K ARCHER H.: Riemannian center of mass and so called karcher
51–61. 3, 9
mean, 2014. 5
[XW09] X IN S.-Q., WANG G.-J.: Improving chen and han’s algorithm
[KCvO07] K AVAN L., C OLLINS S., Ž ÁRA J., O’S ULLIVAN C.: Skin- on the discrete geodesic problem. ACM Trans. Graph. 28, 4 (Sept. 2009),
ning with dual quaternions. In Proceedings of the 2007 Symposium on 104:1–104:8. 2, 3
Interactive 3D Graphics and Games (New York, NY, USA, 2007), I3D
’07, ACM, pp. 39–46. doi:10.1145/1230100.1230107. 11 [YLL∗ 09] YAN D.-M., L ÉVY B., L IU Y., S UN F., WANG W.: Isotropic
remeshing with fast and exact computation of restricted voronoi dia-
[KS98] K IMMEL R., S ETHIAN J. A.: Computing geodesic paths on man- gram. In Computer graphics forum (2009), vol. 28, Wiley Online Li-
ifolds. Proceedings of the National Academy of Sciences 95, 15 (1998), brary, pp. 1445–1454. 3, 10
8431–8435. 2
[LLW12] L U L., L ÉVY B., WANG W.: Centroidal voronoi tessellation of
line segments and graphs. Comput. Graph. Forum 31, 2pt4 (May 2012),
775–784. doi:10.1111/j.1467-8659.2012.03058.x. 11
[LPG12] L IU Y., P RABHAKARAN B., G UO X.: Point-based manifold
harmonics. Visualization and Computer Graphics, IEEE Transactions
on 18, 10 (2012), 1693–1703. doi:10.1109/TVCG.2011.152. 11
c 2017 The Author(s)
Computer Graphics Forum
c 2017 The Eurographics Association and John Wiley & Sons Ltd.
P. Herholz, F. Haase & M. Alexa / Diffusion Diagrams
Figure 13: Results obtained with our algorithm. See Tab. 1 for timings and statistics.