# 2010

SIGGRAPH 2010 Lp Centroidal Voronoi Tesselations Bruno Lévy and Yang Liu...

SIGGRAPH 2010

Lp Centroidal Voronoi Tesselations Bruno Lévy and Yang Liu

Overview • 1. Motivations • 2. Blowing Square Bubbles • 3. Algorithm • 4. Applications and Results • 5. Conclusions and Future Work

1. Motivations – Hex meshing

1. Motivations – Why Hexes ? Tet Meshing

Hex Meshing

1. Fully Automated 2. Millions of elements in minutes/seconds 3. Adequate for some analysis 4. Inaccurate for other Analysis

1. Partially Automated, some Manual 2. Millions of elements in days/weeks/months 3. Preferred by some analysts for solution quality

[Matt Staten] (Sandial Labs)

2. Blowing Square Bubbles

p=2

p=4

p=8

….

2. Blowing Square Bubbles

Disclaimer: This presentations contains live demos. Crashes may occur. The presenter assumes no liability.

3. Algorithm Standard CVT:

F= i

∫ Vor(i)

2

(xi – x)

dx

3. Algorithm Standard CVT:

F= i

2

(xi – x)

dx

Vor(i)

Lp CVT:

F= i

∫ Vor(i)

p

M(x) (xi – x)

p

dx

3. Algorithm Lp CVT:

F= i

p

M(x) (xi – x)

p

dx

Vor(i)

Anisotropy, encodes desired orientation Riemannian metric G = Mt M

3. Algorithm Lp CVT:

F= i

p

M(x) (xi – x)

p

dx

Vor(i)

Lp norm: || x || If p is even: || x ||

p p p

= xp + yp + zp = xp + yp + zp

3. Algorithm Lp CVT:

F= i

p

M(x) (xi – x)

Vor(i)

Optimization with LBFGS (quasi-Newton) For each iterate X(k): Compute F(X(k)) and F(X(k))

p

dx

3. Algorithm

F= i

∫ Vor(i)

Computing F(X(k)) and F(X(k))

p

M(x) (xi – x)

p

dx

3. Algorithm

F= i

∫ Vor(i)

Computing F(X(k)) and F(X(k))

xi Vor(xi)

p

M(x) (xi – x)

p

dx

3. Algorithm

F= i

∫ Vor(i)

Computing F(X(k)) and F(X(k))

Vor(xi) clipped by Domain.

p

M(x) (xi – x)

p

dx

3. Algorithm

F= i

Computing F(X(k)) and F(X(k))

p

M(x) (xi – x)

p

dx

Vor(i)

An example in 3D (cross-section) Computing the intersection between a 3D Voronoi diagram and the interior of a polygonal mesh - DEMO

3. Algorithm

F= i

∫ Vor(i)

Computing F(X(k)) and F(X(k))

p

M(x) (xi – x)

p

dx

3. Algorithm

p

M(x) (xi – x)

p

Computing F(X(k)) and F(X(k))

Integration simplex

dx

T

C1 C2

Problem #1: FT(xi,C1,C2)

xi

3. Algorithm

Computing F(X(k)) and F(X(k))

xi

p

M(x) (xi – x)

p

dx

T

C1 C2

Problem #1: FT(xi,C1,C2) Problem #2: C1(xi, xj, xk)

3. Algorithm

Lp-CVT: the making of…. (not in the paper)

p

M(x) (xi – x)

p

dx

T The formula is terrible…

* When in doubt, use brute force * I’d rather write programs that write programs than write programs [Tom Duff, Bell Labs] Programming Pearls John Bentley

3. Algorithm

∫ T

p

M(x) (xi – x)

p

dx

Lp-CVT: the making of…. (not in the paper) template struct vec3g { vec3g(T x_in, T y_in, T z_in) : x(x_in), y(y_in), z(z_in) { } T length2() const { return x*x+y*y+z*z ; } T length() const { return sqrt(length()) ; } T x,y,z ; };

typedef vec3g vec3 ; typedef vec3g vec3s ;

3. Algorithm

Lp-CVT: the making of…. Problem #1: FT(xi,C1,C2)

inline vec3s tri_point( const vec3s& p1, const vec3s& p2, const vec3s& p3, const vec3s& p4, const Expression& u, const Expression& v, const Expression& w ){ Expression t = 1 - u - v - w ; return u*p1 + v*p2 + w*p3 + t*p4 ; } inline Expression tri_dist( const vec3s& p1, const vec3s& p2, const vec3s& p3, const vec3s& p4, const Expression& u, const Expression& v, const Expression& w, const vec3s& q ){ M(x) return length_Lp(M, q - tri_point(p1,p2,p3,p4,u,v,w)) ; }

∫ T

p

(xi – x)

p

dx

3. Algorithm

Lp-CVT: the making of…. Problem #1: FT(xi,C1,C2)

inline Expression LpCVT_energy_symbolic( const vec3s& p1, const vec3s& p2, const vec3s& p3, const vec3s& p4 ){ symbol u("u"), v("v"), w("w") ; Expression result = tetra_volume(p1,p2,p3,p4) * integ(u, 0, 1, integ(v, 0, 1-u, integ(w, 0, 1-u-v, tri_dist(p1,p2,p3,p4,u,v,w,p1) ) ) M(x) ); return result ; }

∫ T

p

(xi – x)

p

dx

3. Algorithm Intersections of bisectors

pi

Lp-CVT: the making of…. Problem #2: C(xi, xj, xk) vec3g three_planes_intersection( const Plane& P1, const Plane& P2, const Plane& P3 ){ T b00, b01, b02, b10, b11, b12, b20, b21, b22 ; // Note: b is transposed comatrix3x3( P1.a, P1.b, P1.c, P2.a, P2.b, P2.c, P3.a, P3.b, P3.c, b00, b10, b20, b01, b11, b21, b02, b12, b22 ); return -T(1) / det3x3( P1.a, P1.b, P1.c, P2.a, P2.b, P2.c, P3.a, P3.b, P3.c ) * vec3g( P1.d * b00 + P2.d * b01 + P3.d * b02, P1.d * b10 + P2.d * b11 + P3.d * b12, P1.d * b20 + P2.d * b21 + P3.d * b22 ); }

3. Algorithm

Lp-CVT: the making of…. Assembling F and F

F(pi,p1,p2)

xi

C(xi,xj,xk) C(xi,xl,xm)

FunctionCompose class + chain rule to compute derivatives

Lp-CVT: the making of….

3. Algorithm

p

M(x) (xi – x)

p

dx

T

Math-O-Matic

Written in C++ + Ginac

It works ! (the 2D demo is done with this « symbolic » code), but too slow for 3D

Lp-CVT: the making of….

3. Algorithm

p

M(x) (xi – x)

p

dx

T Written in C++ + Ginac, Instanciation with Exp class.

Math-O-Matic

void eval_F_Lp( unsigned int n, const double* X, double& F_Lp, double* grad_F_Lp );

It works ! (the 2D demo is done with this « symbolic » code), but too slow for 3D

3. Algorithm Can we do better ? Do not let the computer think for us,

We need to crank the algebra…

3. Algorithm : chalk and board

univariate, 1D version can we have a nD version on simplices ? [Lasserre and Avrachenkov 2000]

3. Algorithm : chalk and board Homogeneous polynomial in polar form H(): example: x4 = H(x,x,x,x) H(x,x,x,x) = x1 * x2 * x3 * x4

replace degree q with multilinear form of q variables

3. Algorithm : chalk and board Homogeneous polynomial in polar form H(): example: x4 = H(x,x,x,x) H(x,x,x,x) = x1 * x2 * x3 * x4

replace degree q with multilinear form of q variables

nD version (n: dimension; q: degree of the polynomial) [Lasserre and Avrachenkov 2000]

3. Algorithm : chalk and board p2 p1

x1

p3

C2

C4 C3

3. Algorithm : chalk and board p2 p1

x1

F=

p3

x - x1

T(x1,C2,C3,C4)

C2

C4 C3

p

dx

3. Algorithm : chalk and board p2 p1

F=

p3

p

x - x1

dx

T(x1,C2,C3,C4) Translate x1 at origin :

x1

C2

F= C4 C3

p

x

dx

T(0,C2-x1,C3-x1,C4-x1)

3. Algorithm : chalk and board

nD version (n: dimension; q: degree of the polynomial)

F=

p

x

dx p

T(0,C2-x1,C3-x1,C4-x1)

3. Algorithm : chalk and board

nD version (n: dimension; q: degree of the polynomial)

F=

H(x,x) = xp H(x1,…,xp) = x1*…*xp p

x

dx p

T(0,C2-x1,C3-x1,C4-x1)

U1 = C2-x1; U2 = C3-x1; U3 = C4-x1

U2 U3 U1

3. Algorithm : chalk and board

nD version (n: dimension; q: degree of the polynomial)

F=

H(x,x) = xp H(x1,…,xp) = x1*…*xp p

x

U1 = C2-x1; U2 = C3-x1; U3 = C4-x1

dx p

T(0,C2-x1,C3-x1,C4-x1) Vol(T)

∑ (U * U * U

10 p!

i1, i2, ... ip in (1,2,3)

F=

i1

i2

i3 ...* Uip)

U2 U3 U1

This solves problem #1

3. Algorithm : chalk and board

nD version (n: dimension; q: degree of the polynomial)

F=

H(x,x) = xp H(x1,…,xp) = x1*…*xp p

x

U1 = C2-x1; U2 = C3-x1; U3 = C4-x1

dx p

T(0,C2-x1,C3-x1,C4-x1) Vol(T)

∑ (U * U * U

10 p!

i1, i2, ... ip in (1,2,3)

F=

i1

i2

i3 ...* Uip)

U2 U3 U1

This solves problem #1 Problem #2 [Minka] Matrix computation

3. Algorithm : chalk and board Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

x0

C x3 x1

x2

3. Algorithm : chalk and board Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

x0

C = intersection of 3 bisector planes

C x3 x1

x2

3. Algorithm : chalk and board Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

x0

C = intersection of 3 bisector planes

C x3 x1

x2

3. Algorithm : chalk and board Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

3. Algorithm : chalk and board Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

3. Algorithm : chalk and board x0

Problem #2 : circumcenters and their derivatives [Minka] Matrix computation

C x3

x1

x2

3. Algorithm : chalk and board x0

C

Can the results be reproduced by a grad student ?

x3

x1

x2

3. Algorithm : chalk and board x4

C x3

x1

x2

Source code on the DVD

4. Applications and Results

p =2 M(x) = ppal dir. of curvature.

4. Applications and results

p =2 M(x) = Normal anisotropy.

Feature-sensitive meshing

4. Applications and results p =2 M(x) = Normal anisotropy.

CSG-Remeshing - DEMO

Feature-sensitive meshing

4. Applications and results

p =8 M(x) = ppal dir. of curvature.

4. Applications and results + many other examples in paper and supplemental material.

4. Applications and results

Demo

5. Future Work

To L and beyond !

5. Future Work

L

CVT, structured meshing

CVT for line segment and graphs (Accepted pending rev.)

Aknowledgements • Bytes

: CGAL (Delaunay triangulation)

• Triangles: [email protected], Digital Michelangelo • Euros

: European Research Council GOODSHAPE ERC-StG-205693

Rhaleb Zayer, Wenping Wang, Jean-Francois Remacle, Nicolas Saugnier, DongMing Yan, Loic Maréchal, Pierre Alliez, Tamal Dey, Pierre Alliez, David Bommes, Leif Kobbelt