Taku Komura
Barycentric Coordinates and L-System
Taku Komura
Overview
1. Barycentric coordinates
Wachspress Coordinates
Mean Value Coordinates
Harmonic Coordinates
2. L-system
Taku Komura
Topology for Interpolation
Remember we introduced topology such that we can do interpolation
Taku Komura
Interpolation
Geometric interpolation – derive the global coordinates for a position in parametric cell space
Attribute interpolation – derive the attribute value for a position defined in parametric cell space
∑∑=
i i
i ii
w
pwv
∑∑=
i i
i ii
w
fwvf ][ˆ
∑ j j
i
w
ware called barycentric coordinates
Taku Komura
Barycentric Coordinates
Taku Komura
Example of Barycentric Coordinates
Simple 2D shapes
Simple 3D
W0 = 1-r-s
W1 = r
W2 = s
p0 p
1
p2
s
r
W0 = (1-r)(1-s)
W1 = r(1-s)
W2 = (1-r)s
W3 = rs
s
r
p3
p2
p0
p1
1 0 ,1 ≤≤=∑ ii WW
Taku Komura
What about interpolation for general polygons?
x
p0
p1
p2
p3
p4
p5
r
s
Any quick solutions?
Taku Komura
Quick Solution Subdivision into triangles / tetrahedra
– And then use the barycentric coordinates explained in slide 6 within the triangle / tetrahedron.
Only C0 continuous at the boundary Non-smooth transitions at the boundary of triangles
x
p0
p1
p2
p3
p4
p5
r
s
Taku Komura
Wachspress coordinates
Only works with convex polygons
A(a,b,c) is the signed area of triangle abc
http://www.lidberg.se/math/shapetransforms/wachspress.html
Taku Komura
Mean Value Coordinates
A good and smooth barycentric coordinates that can smoothly interpolate the boundary values
Also works with concave polygons
There is also a 3D version
Taku Komura
What are the required features of barycentric coordinates?
Interpolates values at vertices
Linear on boundary
Smooth on interior
Not affected by points that you need to travel a lot to reach within the polygon
Taku Komura
Let's compare
convex polygons[Wachspress 1975]
closed polygons[Floater 2003, Hormann 2004]
Taku Komura
Previous Work
convex polygons[Wachspress 1975]
closed polygons[Floater 2003, Hormann 2004]
Taku Komura
Previous Work
convex polygons[Wachspress 1975]
closed polygons[Floater 2003, Hormann 2004]
Taku Komura
Previous Work
convex polygons[Wachspress 1975]
closed polygons[Floater 2003, Hormann 2004]
Taku Komura
What are the required features of barycentric coordinates?
Interpolates values at vertices
Linear on boundary
Smooth on interior
→ Mean Value Coordinates perform good
Not affected by points that you need to travel a lot to reach within the polygon
Taku Komura
Application:Surface Deformation
∑∑=
i i
i ii
w
pwv
ipv
Taku Komura
Application:Surface Deformation
∑∑=
i i
i ii
w
pwv
ipv
Taku Komura
Application:Surface Deformation
∑∑=
i i
i ii
w
pwv
ˆˆ
ip̂
∑∑=
i i
i ii
w
pwv
ipv
v̂
Taku Komura
Application:Surface Deformation
∑∑=
i i
i ii
w
pwv
vip
∑∑=
i i
i ii
w
pwv
ˆˆ
v̂
ip̂
Taku Komura
ApplicationsBoundary Value Problems
Taku Komura
ApplicationsSolid Textures
Extend texture to interior
Taku Komura
ApplicationsSurface Deformation
Control Mesh Surface Computing Weights Deformation
216 triangles 30,000 triangles 1.9 seconds 0.03 seconds
Taku Komura
ApplicationsSurface Deformation
Control Mesh Surface Computing Weights Deformation
98 triangles 96,966 triangles 3.3 seconds 0.09 seconds
Taku Komura
What are the required features of barycentric coordinates?
Interpolates values at vertices
Linear on boundary
Smooth on interior
Not affected by points that you need to travel a lot to reach within the polygon
Taku Komura
Interpolation : problem polygon
ill-formed polygon
− poor interpolation results based on point distance due to narrow concavity
Problem: This vertex has too strong an influence in the red region
http://www.youtube.com/watch?v=egf4m6zVHUI
Shows the problem of mean value coordinates at 1:54
Taku Komura
Harmonic CoordinatesThe problem with Mean Value Coordinates is that their
values are affected by the Euclidean distance but not the distance that needs to be traveled
Affected by geometrically close points
Harmonic Scalar Field
– The value depends on the distance traveled inside the polygon
Not affected by geometrically close but topologically far points
Taku Komura
Harmonic Coordinates : Procedure
• Discretize the space (adding a 2D/3D grid)
• For each vertex i of the cage, set the potential value of vi to 1, and the rest to 0
• Compute the potential for all the grid points j (f^j_i) by solving a Laplace equation (as taught in Lecture 16)
• (f^j_1, f^j_2, ...., f^j_n) is the harmonic coordinates for each grid point j
• The global position of point j can be expressed in the form
P = f^j_1 v1 + f^j_2 v2 + … + f^j_n vn
Taku Komura
Editing the shape by Harmonic Coordinates
• Edit the shape by moving the control points (points of the cage)
• The new location of each vertex is computed by
where (v1’,v2’,...,vn’) are the new positions of the control points
P’ = f^j_1 v1’ + f^j_2 v2’ + … + f^j_n vn’
Taku Komura
Harmonic Coordinates: comparison
Before editing Edited by MVC Edited by HC
Taku Komura
Barycentric Coordinates Summary
Triangulation / Tetrahedralization
Only C0 continuous at the boundaries
Wachspress coordinates
Can only handle convex objects
Mean value coordinates
Can handle concave objects well to some extent
Values affected by geometrically close points
Defined outside the polygon too
Harmonic Coordinates
Can handle concave objects well
Only defined inside the polygon
Taku Komura
Overview
1. Barycentric coordinates
Wachspress Coordinates
Mean Value Coordinates
Harmonic Coordinates
2. L-system
Taku Komura
What is an L-System ?
Lindenmayer system, or L-System, was introduced in 1968 by the biologist Aristid LindemmayerA mathematical theory on plant development. The central concept of L-systems is that of rewriting. It is a technique for defining complex objects by successively replacing parts of a simple initial object using a set of rewriting rules or production.
Taku Komura
L-Systems
Expanding the strings based on the deterministic rulesThe rewriting process starts from an initial string called the axiom. At each derivation step, all letters in the current string are replaced simultaneously by applying their associated productions.
Taku Komura
ExampleVariables a, bAxiom : aRULES: a->aba, b->bbb
How does it go on then?Step #0 : a (axiom)Step #1 : abaStep #2 : aba bbb aba Step #3 : aba bbb aba bbb bbb bbb aba bbb aba Step #4 : ...Because there is exactly one rewriting rule for each letter, the resulted strings will be deterministic . Because each letter was replaced regardless what neighbors it has, the rewriting rules are context-free
Taku Komura
Turtle interpretation of L-strings
A turtle is sitting on a sheet of paper facing in a certain direction,
The tail of the turtle is a bit dirty. Thus, it leaves a trail along the paper.
By interpreting a L-string, the turtle leaves the trail along the paper
Taku Komura
Turtle interpretation of L-strings
In 2D, for example, the state of the turtle is defined by its position and its heading vectorGiven the step size d and the angle increment δ, the turtle's movements can respond to the commands represented by the L-symbols : F Move forward a step of length d and connect the new position with the last position by a line segment. + Turn left by angle (counter clockwise) - Turn right by angle (clockwise). δ
δ
Taku Komura
Bracketed L-systems
In order to specify the data structure for presenting axial trees, the concept of ``strings with brackets'' was introduced
The L-system's alphabet is extended by two new commands
[ Push the current state of the turtle onto a stack.
] Pop a state from the stack and make it the current state of the turtle.
Taku Komura
LParser
Axiom: FFFF[C]>>>>>>>>>[C]>>>>>>>>>[C]>>>>>>>>>[C]Rules: C=F!F[c---C]C> : rotation (10 degrees) around the forward axis-: rotation (10 degrees) around the horizontal axis! : decrement thickness with 0.7 c : increment in color index
Taku Komura
LParser(Example)
Axiom: FFFF[C]>>>>>>>>>[C]>>>>>>>>>[C]>>>>>>>>>[C] Rules: C=F!F[c---C]C
> : rotation around the forward axis
- : rotation around the horizontal axis
! : decrement thickness with 0.7
Taku Komura
LParser
Rules: C=F!F[c---C]C
> : rotation around the forward axis-: rotation around the horizontal axis
! : decrement thickness with 0.7
Taku Komura
LParser : Make it look better by adding more rotations
: C=F!^+F^+;'[c---C]
^ : rotation around the vertical axis
Taku Komura
Stochastic L-systems
To avoid the artificial regularity of models generated by deterministic L-system, variation of turtle interpretation and/or randomization of L-productions are needed.For example, the productions :
p1 : a -> (0.7) b a
p2 : a -> (0.3) c aare 2 rewriting rules for the letter a. In one derivation step, either p1 or p2 will be applied to each occurrence of a, according to the given distribution (0.7 and 0.3).
Taku Komura
Other exampleshttp://vimeo.com/7192863
Taku Komura
Summary
Barycentric coordinates
Wachstress coordinates
Mean value coordinates
Harmonic Coordinates
L-system
ReferencesHarmonic Coordinates for Character Articulation, SIGGRAPH 2007
Mean Value Coordinates for Closed Triangular Meshes, SIGGRAPH 2005
Barycentric and Wachspress coordinates in two dimensions: theory and implementation for shape transformations, Petter Lidberg