200 likes | 285 Views
Note on QEM Implementation. Algorithm Summary. 2D Version. Think clearly on how 2D is done and extrapolate how this will be done in 3D. Vertex Pos List edges List pairs … ?!. Edge Vertex v1, v2. Required on Data Structure. Preparation:
E N D
2D Version Think clearly on how 2D is done and extrapolate how this will be done in 3D
Vertex Pos List edges List pairs …?! Edge Vertex v1, v2 Required on Data Structure Preparation: Modify your sketch with the proposed data structure Able to remove points on contour
Center of ellipse: Visualizing Q Reference
Q for Initial Vertices v l2: a2x+b2y+c2=0 l1: a1x+b1y+c1=0 d2 (v,l1) = (a1x+b1y+c1)2 = (p1T v)2 = vT(p1p1T) v d2 (v,l2) = … = vT(p2p2T) v Q (v) = vT(p1p1T + p2p2T) v
Valid Pairs (1:edge) For each edge (v1v2): Compute v-bar from Q1 and Q2 Evaluate the contracting cost: vT(Q1+Q2)v v1 v2 Q1=Q(v1) Q2
Valid Pair (2: aggregation) • C(n,2) to select the pair whose distance is less than e v2 v1 Q2 Q1 Computation of v-bar and cost: same as case 1
Info Stored in a Pair • (v1,v2, Q1, Q2, v-bar, cost) • Sorted by cost value (start contracting from minimum cost) • More than one pair may be associated with the same vertex • When a vertex is changed, updates need to be done …
Example: update Pair contraction v1,Q1 v2,Q2 v3,Q3
Example: update v1,Q1 v1, Q1+Q2 v2,Q2 v3,Q3
Example: update Update all pairs involving v1 v1, Q1+Q2 v3,Q3
Least cost pair: v1 to stay, v2 to die Update v1 position New Q for v1 = Q1+Q2 Replace occurrence of v2 in all edges of v2 as v1 [doubly link] make v1 aware of these new edges remove degenerate edge (for case1) Update the pairs involving v1 Iteration v1 v2 Q1 Q2 v3 Q3
l1 (3,5) L1: y-5=0 L2: x+y-8 = 0 L3: x-5=0 v1 l2 v2 (5,3) l3 Numerical Example
l1 (3,5) v1 l2 v2 (5,3) l3 Example (cont)
Line Equation Thru Two Pts Reference