Algorithm Search⌘K

Definitionadvanced

Mean value coordinates

Also called Floater mean value coordinates.

Floater's weights from the tangents of half angles that express a point as a convex combination of polygon vertices, used for shape preserving parameterization.

Mean value coordinates are a way to write a point v0v_0 inside a star-shaped polygon v1,…,vdv_1, \ldots, v_d as a convex combination of the corners, v0=∑iλiviv_0 = \sum_i \lambda_i v_i with λi>0\lambda_i > 0 and ∑iλi=1\sum_i \lambda_i = 1. Michael Floater defined them in 2003 by a closed formula in the angles at v0v_0 and the distances to the corners. For a triangle they are the barycentric coordinates. For more corners there are many convex combinations that give v0v_0, and these are one choice that depends smoothly on the points and is always positive when v0v_0 sees every corner. Floater made them as weights for the Tutte embedding of a triangle mesh: they are positive, so the map has no flipped triangle, and they reproduce a planar mesh exactly. The name comes from the mean value property of harmonic functions, which the formula imitates.

Definition

Let v1,…,vdv_1, \ldots, v_d, d≥3d \ge 3, be the corners of a polygon in counterclockwise order, with indices taken mod dd, and let v0v_0 be a point in the interior of its kernel, the set of points from which every corner and edge is visible. Write ri=∥vi−v0∥>0r_i = \lVert v_i - v_0 \rVert > 0, and let αi∈(0,π)\alpha_i \in (0, \pi) be the angle at v0v_0 in the triangle (v0,vi,vi+1)(v_0, v_i, v_{i+1}). The mean value weights and mean value coordinates of v0v_0 are

wi=tan⁡(αi−1/2)+tan⁡(αi/2)ri,λi=wi∑j=1dwj.w_i = \frac{\tan(\alpha_{i-1}/2) + \tan(\alpha_i/2)}{r_i}, \qquad \lambda_i = \frac{w_i}{\sum_{j=1}^d w_j}.

With di=vi−v0d_i = v_i - v_0, the half-angle tangent has a formula without trigonometric functions:

tan⁡αi2=di×di+1riri+1+di⋅di+1,\tan\frac{\alpha_i}{2} = \frac{d_i \times d_{i+1}}{r_i r_{i+1} + d_i \cdot d_{i+1}},

where di×di+1d_i \times d_{i+1} is the orientation test value di,xdi+1,y−di,ydi+1,xd_{i,x} d_{i+1,y} - d_{i,y} d_{i+1,x}. The numerator is positive because v0v_0 is in the kernel, and the denominator is positive because αi<π\alpha_i < \pi.

Properties. The coordinates are defined by a formula, with no system to solve.

  1. Positive: αi∈(0,π)\alpha_i \in (0, \pi) gives tan⁡(αi/2)>0\tan(\alpha_i / 2) > 0, so wi>0w_i > 0 and λi>0\lambda_i > 0.
  2. Partition of unity: ∑iλi=1\sum_i \lambda_i = 1 by the definition.
  3. Linear reproduction: ∑iλivi=v0\sum_i \lambda_i v_i = v_0, so ∑iλif(vi)=f(v0)\sum_i \lambda_i f(v_i) = f(v_0) for every affine function ff.
  4. Smooth: the λi\lambda_i are smooth functions of v0,…,vdv_0, \ldots, v_d in the set where they are defined, and they do not change under a similarity of the plane.

Proof of 3. Put v0=0v_0 = 0 and let e(θ)=(cos⁡θ,sin⁡θ)e(\theta) = (\cos \theta, \sin \theta). Let ei=di/rie_i = d_i / r_i be the unit vector to viv_i. The sector between eie_i and ei+1e_{i+1} has angle αi\alpha_i, and the integral of e(θ)e(\theta) over it is tan⁡(αi/2) (ei+ei+1)\tan(\alpha_i/2)\,(e_i + e_{i+1}): after a rotation that puts eie_i at angle 00, the integral is (sin⁡αi,1−cos⁡αi)(\sin \alpha_i, 1 - \cos \alpha_i), and tan⁡(αi/2)(1+cos⁡αi,sin⁡αi)\tan(\alpha_i/2)(1 + \cos \alpha_i, \sin \alpha_i) is the same vector by the half-angle formulas. Because v0v_0 is in the kernel, the sectors cover the circle once, so their integrals add up to ∫02πe(θ) dθ=0\int_0^{2\pi} e(\theta)\, d\theta = 0. Collect the terms of each eie_i: it appears in sectors i−1i-1 and ii, so ∑i(tan⁡(αi−1/2)+tan⁡(αi/2)) ei=0\sum_i (\tan(\alpha_{i-1}/2) + \tan(\alpha_i/2))\, e_i = 0, that is ∑iwidi=0\sum_i w_i d_i = 0. Divide by ∑jwj>0\sum_j w_j > 0. □\square

On a surface. For a vertex v0v_0 of a triangle mesh in 3D with neighbours v1,…,vdv_1, \ldots, v_d in the order of its 1-ring, Floater uses the same formula with the angles αi\alpha_i of the 3D triangles at v0v_0. The weights are still positive. They do not depend on a flattening of the ring, and if the ring is planar they are the planar coordinates above.

Examples and non-examples

An exact example. Take v0=(0,0)v_0 = (0, 0) and the corners (3,4)(3, 4), (−5,12)(-5, 12), (−8,−15)(-8, -15), (7,−24)(7, -24), whose distances 5,13,17,255, 13, 17, 25 are integers. Then every quantity is rational.

ii di×di+1d_i \times d_{i+1} di⋅di+1d_i \cdot d_{i+1} tan⁡(αi/2)\tan(\alpha_i/2) αi\alpha_i
1 5656 3333 56/98=4/756/98 = 4/7 59.49°59.49°
2 171171 −140-140 171/81=19/9171/81 = 19/9 129.31°129.31°
3 297297 304304 297/729=11/27297/729 = 11/27 44.33°44.33°
4 100100 −75-75 100/50=2100/50 = 2 126.87°126.87°

The angles add up to 360°360°. The weights are w=(18/35,13/63,4/27,13/135)w = (18/35, 13/63, 4/27, 13/135), for example w1=(2+4/7)/5w_1 = (2 + 4/7)/5, and the coordinates are

λ=(81152,65304,35228,91912).\lambda = \left(\tfrac{81}{152}, \tfrac{65}{304}, \tfrac{35}{228}, \tfrac{91}{912}\right).

They are positive, they add up to 1, and ∑iλidi=(0,0)\sum_i \lambda_i d_i = (0, 0) exactly. Uniform weights 1/41/4 give ∑idi/4=(−3/4,−23/4)≠0\sum_i d_i / 4 = (-3/4, -23/4) \ne 0, so uniform weights do not reproduce this planar star, and a Tutte map with them moves v0v_0.

A triangle. For d=3d = 3 the coordinates are the barycentric coordinates, because three positive numbers with sum 1 and ∑λivi=v0\sum \lambda_i v_i = v_0 are unique for a nondegenerate triangle.

A point outside the kernel. If v0v_0 is inside a non-convex polygon but does not see every corner, some triangle (v0,vi,vi+1)(v_0, v_i, v_{i+1}) is clockwise. With unsigned angles the weights stay positive, but the sectors no longer cover the circle once, and the proof of property 3 fails: the result is not v0v_0. Hormann and Floater (2006) use signed angles instead. Then the formula reproduces linear functions for every point that is not on the boundary, but some λi\lambda_i can be negative, and the coordinates are no longer a convex combination.

Cotangent weights are not always positive. The discrete harmonic weights cot⁡α+cot⁡β\cot \alpha + \cot \beta of the cotangent Laplacian also reproduce linear functions, but a weight is negative when the two angles opposite an edge add up to more than π\pi. Mean value weights are positive for every star in the kernel case, which is why they suit the Tutte embedding.

  • Barycentric coordinates. The case d=3d = 3, and the model for all generalized barycentric coordinates: positive, a partition of unity, linear reproduction.
  • Wachspress coordinates. Rational functions of v0v_0 for convex polygons, with weights from the areas of the triangles at the corners. They are not defined for non-convex polygons, where mean value coordinates still are.
  • Discrete harmonic coordinates. The cotangent weights; they come from the minimum of the Dirichlet energy and can be negative.
  • Mean value coordinates in 3D. Ju, Schaefer and Warren (2005) and Floater, Kós and Reimers (2005) gave the same idea for a point inside a closed triangle mesh, with an integral over the unit sphere. They are used to deform a shape with a cage.
  • Convex combination maps. A Tutte embedding with any positive weights; mean value weights are the most common choice for mesh parameterization.

References

  1. Michael S. Floater, Mean value coordinates, Computer Aided Geometric Design 20(1), 2003, 19 to 27, the definition from the mean value theorem for harmonic functions, the proof that the weights are positive and reproduce linear functions, and their use for parameterization
  2. Kai Hormann and Michael S. Floater, Mean value coordinates for arbitrary planar polygons, ACM Transactions on Graphics 25(4), 2006, 1424 to 1441, the extension to points outside the kernel and to non-convex polygons with signed angles, where weights can be negative
  3. Michael S. Floater and Kai Hormann, Surface parameterization, a tutorial and survey, in Advances in Multiresolution for Geometric Modelling, Springer, 2005, 157 to 186, the comparison of uniform, harmonic, shape-preserving and mean value weights for barycentric mappings

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/VWYQAM/text.yaml