1 2013rossignac / 22 advances and challenges in the design of compact representations of meshes and...
TRANSCRIPT
120132013RossignacRossignac / 22/ 22
Advances and challenges in the design of compact representations of meshes and complexes
Jarek Rossignac Jarek Rossignac School of Interactive ComputingSchool of Interactive Computing
Georgia TechGeorgia Tech
220132013RossignacRossignac / 22/ 22
CATRAT
We want Constant Amortized Time (CAT) cost operatorsfor Random Access and Traversal (RAT) of the mesh•Access vertices and faces using (nearly) consecutive IDs
– For (int v = 0; v<V; v++) processVertex(v);– For (int f = 0; f<F; f++) processFace(f);
•Given vertex, v, obtain an incident face, f(v)•Given face, f, obtain a bounding vertex, v(f)Given tuple (f,v) of a face f and a bounding vertex v, obtain:•Next tuple (“swing” clockwise) around v•Next tuple (“walk” cw) around f
Want the time cost of each operatorto be constant (on average) and small
v(f,v)v(f,v)f(f,v)f(f,v) ff
vv
320132013RossignacRossignac / 22/ 22
Example of an edge-based scheme
For each face f, store a reference to one of its bounding edgesFor each vertex v, store a reference to one incident edgeFor each edge e, store references to•Its 2 bounding vertices•Its 2 incident faces•Its 2 following edges along each face
Cost = F + V + 6E references (32-bit integers) In a planar triangulation:F = 2V – 4E = 3VCost = 2V + V + 18 V = 21V = 672 bpv (bits per vertex)
Zipper reduces this cost to 12 bpv
420132013RossignacRossignac / 22/ 22
Prior art: Mesh connectivity storage cost
Winged-edge [Baumgart’72]: 27Winged-edge [Baumgart’72]: 27VVWinged-edge [Baumgart’72]: 27Winged-edge [Baumgart’72]: 27VV
Surface-Mesh [Surface-Mesh [Sieger, Botsch‘Sieger, Botsch‘11] : 2111] : 21VVSurface-Mesh [Surface-Mesh [Sieger, Botsch‘Sieger, Botsch‘11] : 2111] : 21VV
Directed-edge [Campagna, Directed-edge [Campagna, Kobbelt, SeidelKobbelt, Seidel’’98]: 1398]: 13VVDirected-edge [Campagna, Directed-edge [Campagna, Kobbelt, SeidelKobbelt, Seidel’’98]: 1398]: 13VV
ECT [ECT [Rossignac, Safonova, Szymczak‘01]: 13‘01]: 13VVECT [ECT [Rossignac, Safonova, Szymczak‘01]: 13‘01]: 13VV
Stable catalogs [Castelli, Stable catalogs [Castelli, DevillersDevillers’’06]: 7.606]: 7.6VVStable catalogs [Castelli, Stable catalogs [Castelli, DevillersDevillers’’06]: 7.606]: 7.6VV
RAT Star vertices [Kallmann, RAT Star vertices [Kallmann, ThalmannThalmann’’01]: 1501]: 15VVRAT Star vertices [Kallmann, RAT Star vertices [Kallmann, ThalmannThalmann’’01]: 1501]: 15VV
Tripod [Snoeyink, Tripod [Snoeyink, SpeckmannSpeckmann’’99]: 799]: 7VVTripod [Snoeyink, Tripod [Snoeyink, SpeckmannSpeckmann’’99]: 799]: 7VV
SOT [SOT [Gurung, RossignacGurung, Rossignac’’09 09 SPMSPM]: 6]: 6VVSOT [SOT [Gurung, RossignacGurung, Rossignac’’09 09 SPMSPM]: 6]: 6VV
SQuad [SQuad [Gurung, Laney, Lindstrom, RossignacGurung, Laney, Lindstrom, Rossignac’’11 11 EurographicsEurographics]: 4]: 4VVSQuad [SQuad [Gurung, Laney, Lindstrom, RossignacGurung, Laney, Lindstrom, Rossignac’’11 11 EurographicsEurographics]: 4]: 4VV
LR / BELR [LR / BELR [Gurung, Luffel, Lindstrom, RossignacGurung, Luffel, Lindstrom, Rossignac’’11 11 SIGGRAPHSIGGRAPH]: 2]: 2VV / 55 bpv / 55 bpvLR / BELR [LR / BELR [Gurung, Luffel, Lindstrom, RossignacGurung, Luffel, Lindstrom, Rossignac’’11 11 SIGGRAPHSIGGRAPH]: 2]: 2VV / 55 bpv / 55 bpv
Zipper [Zipper [Gurung, Luffel, Lindstrom, RossignacGurung, Luffel, Lindstrom, Rossignac’’12 12 SPMSPM] : 12 bpv] : 12 bpvZipper [Zipper [Gurung, Luffel, Lindstrom, RossignacGurung, Luffel, Lindstrom, Rossignac’’12 12 SPMSPM] : 12 bpv] : 12 bpv
Theoretical limit [Tutte’62]. Achievable in theory: Succinct Theoretical limit [Tutte’62]. Achievable in theory: Succinct Reps [Aleardi, Devillers, SchaeffferReps [Aleardi, Devillers, Schaefffer’’06]: 3.25 bpv06]: 3.25 bpvTheoretical limit [Tutte’62]. Achievable in theory: Succinct Theoretical limit [Tutte’62]. Achievable in theory: Succinct Reps [Aleardi, Devillers, SchaeffferReps [Aleardi, Devillers, Schaefffer’’06]: 3.25 bpv06]: 3.25 bpv
[Blandford, Blelloch, [Blandford, Blelloch, Cardoze, Cardoze, Kadow,Kadow,’’03]: 2.503]: 2.5VV
[Blandford, Blelloch, [Blandford, Blelloch, Cardoze, Cardoze, Kadow,Kadow,’’03]: 2.503]: 2.5VV
N-tuples [Brisson’89]: 63N-tuples [Brisson’89]: 63VVN-tuples [Brisson’89]: 63N-tuples [Brisson’89]: 63VV
RAT Half-edge [MantyleRAT Half-edge [Mantyle’’88, Kettner’99] : 3388, Kettner’99] : 33VVRAT Half-edge [MantyleRAT Half-edge [Mantyle’’88, Kettner’99] : 3388, Kettner’99] : 33VV
Locally decompressible RAT [Locally decompressible RAT [Yoon, LindstromYoon, Lindstrom’’07 07 TVCGTVCG]: 8 bpv]: 8 bpvLocally decompressible RAT [Locally decompressible RAT [Yoon, LindstromYoon, Lindstrom’’07 07 TVCGTVCG]: 8 bpv]: 8 bpv
TT
ESQ (editable SQuad) [ESQ (editable SQuad) [Castelli, Devillers, RossignacCastelli, Devillers, Rossignac’’12 12 SIBGRAPI ]: 4]: 4VVESQ (editable SQuad) [ESQ (editable SQuad) [Castelli, Devillers, RossignacCastelli, Devillers, Rossignac’’12 12 SIBGRAPI ]: 4]: 4VV
rr V = V = rr × 32 bits per vertex × 32 bits per vertex
bb bpv = bpv = bb bits per vertex bits per vertex
520132013RossignacRossignac / 22/ 22
Corner-based operators
Access:v(f): an arbitrary vertex bounding given face f (f = 0,1,2…F-1)f(v): an arbitrary face incident upon given vertex (v = 0,1,2…V-1)
Traversal:n(f,v): next vertex after v (“walking” cw) around face f s(f,v): next face after f (“swinging” cw) around vertex v
SIMPLIFIED NOTATION:
Corner c=(f,v) as place marker for RATn(f,v) is now written c.ns(f,v) is now written c.s
Bijections between corners and
half-edges, edge-uses, oriented-edges, darts…
c.nc.nc.sc.s ff
vv cc
620132013RossignacRossignac / 22/ 22
Corners operators for triangle meshes
Assign consecutive integer IDs to the 3 corners of each triangle
•Core operatorsc.v : the vertex of corner cc.t : the triangle of corner cv.c : an arbitrary corner of vertex vt.c : an arbitrary corner of triangle tc.n : next corner around c.tc.o : opposite (in adjacent triangle)
•Derived operatorsc.s = c.n.o.n swing around c.vc.p = c.n.n (previous in c.t)c.l = c.n.o (left)c.r = c.p.o (right)c.u = c.r.p (unswing around c.v)
720132013RossignacRossignac / 22/ 22
Extended Corner Table (ECT): 13V
Based on previously proposed Corner Table (CT):
“Edgebreaker on a Corner Table: A simple technique for representing and compressing triangulated surfaces”,
J. Rossignac, A. Safonova, A. Szymczak.
Book chapter in
Hierarchical and Geometrical Methods in Scientific Visualization,
Farin, G., Hagen, H. and Hamann, B., eds.
Springer-Verlag, Heidelberg, Germany. Pages 41-50, January 2003.
ECT stores back pointer C[v] from vertex to one incident corner
820132013RossignacRossignac / 22/ 22
Extended Corner Table (ECT)
Geometry: short int X[V], Y[V], Z[V]16-bit coordinates relative to AABB
Yields 1/32 mm accuracy over a 2 m aircraft engine
Connectivity: int C[V], V[3T], O[3T] v.c = C[v], c.v = V[c], c.o = O[c]
stored in look-up tablesc.t = c/3, t.c = 3t
Since corners of t have consecutive IDsc.n = c.t.c + (c+1)%3
Since corners of t are sorted (orientation)
Storage cost (14.5V = 464 bpv)Geometry: 3*0.5 = 1.5VConnectivity ECT= 6T+V = 13.0V (90% of total storage)
For simplicity, assume low-genus, manifold mesh: T ≈ 2V
920132013RossignacRossignac / 22/ 22
SCT: Corner Table for Simplicial Complexes“SCT: Simplicial Corner Table”, J. Rossignac & X. Zhu, in preparation.
• Same data structure as ECT
• Extends topology to support–Non-manifold edges
–Non-manifold vertices
–Wires (dangling edges)
• 6 corners per triangle–3 on each side
• Side-preserving crawl (spider)–c.s and c.o do not cross surface
• New operator–To cross surface
1020132013RossignacRossignac / 22/ 22
CT extended to tetrahedra“TetStreamer: Compressed Back-to-Front Transmission of Delaunay Tetrahedra Meshes”, U. Bischoff and J. Rossignac, Proceedings of the Data Compression Conference, IEEE Computer Society, 2005. .
• Same data structure as CT–V[] and O[]
–4 corners per tet
• Use wedge as place marker for RAT
• Wedge operators (mimic corner ones)–Swing around edge
–Next wedge in tet from vertex
–Cross wedge
–Use test to compute twist• Between face-adjacent tets
1120132013RossignacRossignac / 22/ 22
SOT (Sorted O Table) for triangle meshes: 6V
“SOT: Compact Representation for Triangle and Tetrahedral Meshes”,
T. Gurung and J. Rossignac,
Georgia Institute of Technology,
SIC Technical Report GT-IC-10-01, 2010
Start with ECT: C, V, O tablesMatch each v with unique t Sort triangles so that matched t has same ID as its matching vertex Discard C & V tables (no longer needed)!
To compute c.v, swing (c=c.s) until c < 3V
1220132013RossignacRossignac / 22/ 22
Linear cost construction of SOT
Start with V & O tables
Traversal matches each vertex with unique triangle
1320132013RossignacRossignac / 22/ 22
Extending SOT to tetrahedron meshes: 4T
“SOT: Compact representation for Tetrahedral Meshes”,
T. Gurung and J. Rossignac.
ACM Symposium on Solid and Physical Modeling (SPM), 79-88. 2009.
4 references per tet
Trivial combination of the extension of CT to tet meshes and of the SOT idea
1420132013RossignacRossignac / 22/ 22
SOT Construction
Start with V & O tables (for tet meshes)
Depth-first traversal to match each vertex with unique tet
Renumber tets so that matched tet has same ID as its vertex
Discard the V table
To compute the ID of vertex v from a corner c, we may need to visit all tets incident on v
Same as visiting all triangles on a sphere (boundary of star(v))
1520132013RossignacRossignac / 22/ 22
SQuad (sorted quads): 4V
“SQuad: Compact Representation for Triangle Meshes”,
T. Gurung, D. Laney (LLNL), P. Lindstrom (LLNL), and J. Rossignac. Eurographics 2011.
Published as a journal paper in the
Computer Graphics Forum Journal (CGF) 30(2): 355-364.
Match most v with two adjacent t’s (quad), sort quads, store only 4 (external) c.s swings per quad(the internal ones are implicit)
1620132013RossignacRossignac / 22/ 22
SQuad construction and representation
Starts with depth-first traversal (as for SOT)
But try to pair each matched triangle with an unmatched adjacent neighbor that is also incident on the matching vertex (only 2 candidates, try right first)
Store only 4 outer swings per quad
Single triangle groups stored using same structure
Unmatched triangles stored at the end of the table
Do not store V[]: instead swing as in SOT
97% triangles 97% triangles are pairedare paired
1720132013RossignacRossignac / 22/ 22
SQuad preserves memory coherence
Squad preserves vertex order
So it mostly preserves memory coherence
Except for unmatched triangles (which are stored at the end)
1820132013RossignacRossignac / 22/ 22
ESQ: Editable SQuad“ESQ: Editable SQuad representation for triangle meshes”, L. Castelli Aleardi, O. Devillers, J. Rossignac. IEEE sponsored Conference on Graphics, Patterns and Images (SIBGRAPI), August 22, 2012, Brazil.
Extend the different types of groups: V, VT, VTT, T, VVT…?
Use a separate array for each type (fixe size)
Support constant time local edits: Valence-3 Vertex deletion
Edge flip
Triangle split
Reform groups locallyMany configurations
Update arrays (no holes)
1920132013RossignacRossignac / 22/ 22
LR : 2V“LR: Compact connectivity representation for triangle meshes”,
Topraj Gurung, Peter Lindstrom, Mark Luffel, Jarek Rossignac.
ACM SIGGRAPH 2011.
Published as a journal paper in the ACM Transactions on Graphics (TOG), 30(4): 67, August 2011.
Arrange quad diagonals along quasi-Hamiltonian cycle (ring), store v.L / v.R, + exceptions
2020132013RossignacRossignac / 22/ 22
Ring Expander (LR ring construction)
0.005% of vertices 0.005% of vertices are not in the ringare not in the ring
Compute a nearly-Hamiltonian cycle in a meshCompute a nearly-Hamiltonian cycle in a mesh
2120132013RossignacRossignac / 22/ 22
Triangle types (relative to ring)
Subscripts: number of ring edges
•T0 have no ring edges (splits)
•T1 have one ring edge (most common)
•T2 have two ring edge (dead-ends)
Superscripts: warts & exceptions
•Wart: adjacent (T0w,T2
w) pair
•Non-wart T0’s and their T1i neighbors
are exceptions
Triangles in warts: 2.35%Triangles in warts: 2.35%Non-wart TNon-wart T00: 1.05%: 1.05%
2220132013RossignacRossignac / 22/ 22
Numbering elements and storing data in LR
Vertices: numbered along ring
•v.P previous ring vertex (implicit)
•v.N next ring vertex (implicit)
•v.L left neighbor (stored as L[v] in L array)
•v.R right neighbor (stored in R array)
Triangles: Match v with 2 triangles sharing edge (v , v.N)
Implicitly numbered 2v and 2v+1
Corners: Numbered around quad: v.i = 8v+iSkip .3 to avoid cost of division by 3
2v+12v+12v2v
2320132013RossignacRossignac / 22/ 22
Computing c.o
Case 2:Case 2:test: v.L.P.L == v.Ntest: v.L.P.L == v.N
Case 1::test: v.L == v.N.L
A few cases. Here are two examples:A few cases. Here are two examples:
2420132013RossignacRossignac / 22/ 22
Wart “skipping” (LR)
• Each T2w is associated with two ring edges (has 2 slots)
(v.P,v) and (v,v.N)
• LR stores T0w in the first slot
u = tip vertex of matching T0w
L[v.P]=u and L[v]=v.P
Saves 15 refs per wart20% storage cost reduction, resulting in cost =1.08T
2520132013RossignacRossignac / 22/ 22
BELR: 52 bpv
• Relative indexing: – Stores delta (v.L – v)%V instead of v.L
– Can often be represented using 16 bits
– Uses a ring-expander that makes shorter corridors• Compromise between corridor length and (T0 count)
Depth firstDepth first Breadth firstBreadth firstOptimizedOptimized
2620132013RossignacRossignac / 22/ 22
Zipper: 12 bpv
“Zipper: A compact connectivity data structure for triangle meshes”,
T. Gurung, M. Luffel, P. Lindstrom, and J. Rossignac.
ACM Symposium on Solid and Physical Modeling, October 2012.
Journal of Computer-Aided Design. 45(2): 262-269 (2013).
– Store most v.L and v.R as 2-bit deltas (gaps)
– Use only 6 refs per T0 exception
– An improved ring construction leading to fewer exceptions
Stores connectivity using only 6 bits per triangle57×× better than Surface-Mesh [Sieger’11]35×× better than Directed-Edge [Campagna’98]4.4×× better than BELR [GLLR SIGGRAPH’11]
Linear time cost construction Local connectivity changes: non constant costConstant time access and traversal operators 2××-3×× faster than BELR, 3×× slower than LR 15% slower in app than Surface-Mesh [Sieger‘11]
2720132013RossignacRossignac / 22/ 22
Zipper stores a 3-bit code per ring triangle•2-bit delta: v.ΔL= v.P.L–v.L (when it is 0, 1, 2, or 3)
All deltas are ≥ 0, except at T0’s
If v has valence ≤ 6, then 0 ≤ ΔL ≤ 3
Stats: v.ΔL = 0 (29%), 1 (44%), 2 (19%), 3 (4%)
•1-bit wart markerCode ‘111’ identifies an exception: v.L stored explicitly
(The rare warts with delta=3 are treated as exceptions.)
2-bit deltas
2820132013RossignacRossignac / 22/ 22
Decoding v.L and v.R quickly (Zipper)
To compute v.L without summing all preceding deltas:– Force an exception every 32-vertex block
– Distribute 3-bit (delta+wart) codes into three 32-bit words (hi,mid,lo)
– Use bitwise AND to compute mask identifying exceptions (111)
– Use a population count (POPCNT ) instruction to count set bits (number of exceptions) and identify index of preceding exception
– Compute sum of deltas from it to v using POPCNT
•Using POPCNT instead of loop improves speed 10x
2920132013RossignacRossignac / 22/ 22
Computing opposites in T1 and T2 (Zipper)
• From T1 to T1 (trivial when delta is 0 or 1)
• From T0 to a T1 or T2
With each T0 , we store 3 vertex refs (c.v, u, v)
We use v.L/v.R & v.P to infer c.o in constant time
3020132013RossignacRossignac / 22/ 22
Computing opposites in T0 (Zipper)
We store T0’s in a 4-ary cuckoo hash [Fotakis&’03])
With each T0 we store only 6 references:• 3 IDs of opposite corner (hash values)
– Can discard hash if c.o not required by application
• 3 vertex refs (c.v, u, v)
To get from a corner c in a T1 to c.o in a T0
• Use c as hash key, which returns 4 candidates for c.o• For the correct c.o, c.o.t is incident upon c.p.v and c.n.v
3120132013RossignacRossignac / 22/ 22
Ring Bender (Zipper)
• Reduce the number of T0 triangles by 2.3x
– Every T0 is connected to a T2 by a corridor of T1’s
– Rearrange ring to remove T1’s in T0:T1…T1:T2 corridors
to make (T0,T2 ) adjacent (wart)
– Increases warts from 2.35% to 3.2%
– Reduces number of exceptions
– Saves about 1 bpt
3220132013RossignacRossignac / 22/ 22
Storage and speed results (Zipper)
• Storage: median 5.98 bpt– Worst case models: Buddha (13.37 bpt) and Thai (7.97 bpt)
Average (excluding Buddha & Thai): 5.89 bpt
– Fixed storage cost: 5 bpt (5 words for 32 triangles block)3 words for codes, a reference into an exception table, and a reference for the forced exception.
– Variable cost: increase exception count by 3% adds 1 bpt
• Performance of c.v and c.o when mesh fits in memory:– Zipper ops are 2-3x faster than BELR,
– Zipper ops are 1.8-3.6x slower than LR
– In applications (graph distance): •15% slower than Surface Mesh [Sieger’11]
Representation Time
Surface Mesh 1.00
CT 0.85
LR 0.83
Zipper 1.18
3320132013RossignacRossignac / 22/ 22
Summary & future challenges
• Summary for Zipper– Stores connectivity using only 6T bits
• 35x better than Directed-Edge [Campagna’98]• 4.4x better than BELR [GLLR SIGGRAPH’11]
– Linear time cost construction• No constant cost connectivity changes
– Constant time access and traversal operators• 2x-3x faster than BELR, 3x slower than LR, • In app (distance): 15% slower than Surface Mesh [Sieger’11]
• Interesting (or impossible?) challenges• Zipper-64: 5 bpt?• Application to general polygon mesh connectivity: 5 bpv?• Support non-manifold complexes?• Support streaming?• Support connectivity changes?• Apply to tetrahedron meshes?
3420132013RossignacRossignac / 22/ 22
Zipper extended to polygon Y-meshes: 6 bpv
• General position polygon mesh– Assume manifold
– No 4 planes intersect
– Each vertex has valence 3
• Use Zipper to represent its dual graph– 12 bits per primal face
– Primal mesh has twice as many vertices as faces
• For more general polygon meshes– Must split vertices
• Dual of triangulating polygonal faces
3520132013RossignacRossignac / 22/ 22
Recap
Extend ECT to support simplicial complexes
SOT: 6V Match (VT groups), renumber matched triangles, store O
Extend SOT to tetrahedron meshes
SQuad: 4V Match (VTT groups) renumber matched triangles, store 2 swings per tri
ESQ: Modify SQuad to support local edit at constant cost
LR: 2V (BELR 1.6V) Build quasi-Hamiltonian ring, store v.L , v.R, exceptions (T0 and neighbors)BELR: store deltas (v.L - v / v.R – v), optimize ring: deltas fit in 16 bits
Zipper: 0.19 V Store gaps (v.L – v.P.L / v.R – v.P.R), encode most of them with 2 bits, improve ring and reduce number and cost of exceptions
Apply Zipper to Y-meshes (valence-3 polygon meshes)