Streaming Construction of Delaunay Triangulationsjrs/papers/dtstalk.pdf · 2007-09-04 · Streaming...
Transcript of Streaming Construction of Delaunay Triangulationsjrs/papers/dtstalk.pdf · 2007-09-04 · Streaming...
University of California at BerkeleyJonathan Shewchuk
Delaunay TriangulationsStreaming Construction of
Joint work with Martin Isenburg, Yuanxin Liu, & Jack Snoeyink
Delaunay TriangulationsStreaming Construction of
Or, ‘‘How we compute supercomputer−sized Delaunay triangulations on anordinary laptop computer.’’
Every point set has a Delaunay triangulation. Think ofit as a function that takes a set of points and outputs atriangulation.
The Delaunay Triangulation
The Delaunay Triangulation
...is a triangulation whose triangles are all Delaunay.
An triangle is Delaunay if it has an empty circumscribingcircle − one that encloses no vertex.
The circumcircle of every Delaunay triangle is empty.
The Delaunay Triangulation
Terrain Databases and
Contouring
Geographical Information Systems
Applications of Triangulations
Rendering
Elevation Collection by LIDAR
Related Work
Amenta, Choi, & Rote [2003] use
triangulation construction.
randomized insertion ordersbiased
to improvevirtual memory performance of 3D Delaunay
Related Work
Amenta, Choi, & Rote [2003] use
triangulation construction.
randomized insertion ordersbiased
Agarwal, Arge, and Yi [2005] implemented
(1 billion triangles on desktop machine.)
to improvevirtual memory performance of 3D Delaunay
an external memory 2D triangulator basedon randomized divide−and−conquer.
Related Work
Amenta, Choi, & Rote [2003] use
triangulation construction.
randomized insertion ordersbiased
Agarwal, Arge, and Yi [2005] implemented
(1 billion triangles on desktop machine.)
Blandford, Blelloch, and Kadow [2006]implemented a 3D parallel triangulator.(10 billion tetrahedra on 64 processors.)
to improvevirtual memory performance of 3D Delaunay
an external memory 2D triangulator basedon randomized divide−and−conquer.
Streaming Delaunay
Streaming Computation
A restricted version of out−of−core computation.
Algorithm makes one (or a few) pass(es)over input stream, and writes output stream.
Streaming Computation
A restricted version of out−of−core computation.
Algorithm makes one (or a few) pass(es)over input stream, and writes output stream.
Processes data in memory buffer muchsmaller than the stream sizes.
Streaming Computation
A restricted version of out−of−core computation.
Algorithm makes one (or a few) pass(es)over input stream, and writes output stream.
Processes data in memory buffer muchsmaller than the stream sizes.
Nothing is stored temporarily to disk.
Advantages of Streaming
Streaming tools can run concurrently ina pipeline.
Often much faster than other out−of−corealgorithms!
Our Accomplishments
9 billion triangles in 6.6 hours on a laptop.
Our Accomplishments
9 billion triangles in 6.6 hours on a laptop.
12 times faster than Agarwal−Arge−Yi.
Our Accomplishments
9 billion triangles in 6.6 hours on a laptop.
800 million tetrahedra in under 3 hours.
12 times faster than Agarwal−Arge−Yi.
Algorithm Choice
Theconstructing Delaunay triangulations.
incremental insertion algorithm for
Algorithm Choice
Theconstructing Delaunay triangulations.
incremental insertion algorithm for
We have little control over the order of pointsin the input stream.
Why?
Algorithm Choice
Theconstructing Delaunay triangulations.
incremental insertion algorithm for
We have little control over the order of pointsin the input stream.
We modified existing, sequential Delaunaytriangulation codes (2D & 3D) for streaming.
Why?
Insert one vertex at a time.
Bowyer−Watson Algorithm
Insert one vertex at a time.Remove all triangles/tetrahedra that are no longer Delaunay.
Bowyer−Watson Algorithm
Insert one vertex at a time.Remove all triangles/tetrahedra that are no longer Delaunay.Retriangulate the cavity with a fan around the new vertex.
Bowyer−Watson Algorithm
Spatial Finalization
Spatial Finalization
finalization regions.Subdivide space into
Spatial Finalization
finalization regions.
spatial finalization tagsthat indicate ‘‘there are nomore points in this region.’’
Point stream
Finalized point stream
Inject into the stream
Subdivide space into
Spatial Finalization: Why?
Triangles whosecircumscribingcircles lie entirelyin finalized spacecan be written todisk immediately.
Regions not yet finalized
Finalized space
Triangles whosecircumscribing
Regions not yet finalized
Finalized space
circles intersectan unfinalizedregion remainin memory.
Streaming Delaunay Pipeline
TriangulatorFinalizer
The Finalizer
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.
1
How to Finalize
Computebounding box.Finalization grid.
1
2
1
1 1
2 2
3 4
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
4
1 1
11
1
3
4 2
4
5
5
5
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
1111
4 1
2 1246
5
5
5
6
7
1
6
6 7
5
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
2
2 11
3
4
25
2
21
54
32
3
5
63
77
78
9
7
6
1 6
6 6
7
5
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
2
1454
5
7
4 3 4 2 3
5
5
9
4 6 6 7 6
2776
63
77
78
9
7
6
1 6
6 6
7
5
7 4
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
5
761
6
7
6
8
6
7 3 6
2776779
4 6 6 6 7 6 5
8
46
67
66
58
87
9
5
5
7 4
How to Finalize
Computebounding box.Finalization grid.Count points.
1
2
9
6
75
761
666
7 8
9
4 6
6
7
5
2
67
7
66
8 5 7 6 8
466875
67
37
7
7 4
How to Finalize
Computebounding box.Finalization grid.Count points.Store ‘‘sprinklepoints.’’
1
2
466687
86
5
2
5
7
4
6
7
7589
6
6 7664
7
73
1
79
77
6
7
6 6
7
5 7
6
6
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
466687
86
5
2
5
7
4
6
7
7589
6
6 7664
7
73
1
79
776
5 5 6
5
2 3
4
6
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
5 2
466687
86
5
2
5
7
4
6
7
7589
6
6 7664
8 6 7
736
5
44
42
1 1 2
5
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
5
761
66
7
2
466687
86
5
2
5
7
46
6
7
6
7589
553
6
1
634
3
1
2
6
4
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
5
761
666
7 8 7
79 7
3 6
2
4
1
66687
4
86545
5
7
5
24
23
5
5
1
232
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
9
5
761
666
7 8 7
79
4 6
7
3 6 8 3
7 2
67
7
6
5
6
2
434253
2 7
3
211
1
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
9
6
5
761
666
7 8 7
79
4 6
7
3 6 8 3
7
5
2
67
7
66
8 5 7 6 8
466875
6
2
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
9
6
75
761
666
7 8 7
79
4 6
7
3 6 8 3
7
5
2
67
7
66
8 5 7 6 8
466875
6
How to Finalize
Computebounding box.Finalization grid.
Output finalizedpoints.
Count points.Store ‘‘sprinklepoints.’’
Release chunks.Inject finalizationtags.
1
2
3
pointsofchunk
pointsofchunk
Streaming Point Format# npoints 22514# bb_min_f 0 0 192.25
# datatype SP_FLOATv 0 3 193.1v 0.4375 3.5 193.11v 0.59375 4 193.09v 0.6875 4.5 193.11v 0.90625 2.5 193.13v 0.90625 4.5 193.07x cell 2732v 0 7.5 192.91v 0.21875 9 192.93v 0.53125 9 192.99v 0.8125 7.5 192.96v 0.9375 9 193.04v 1.03125 9.5 193.06v 1.65625 8.5 193.04x cell 2740v 0.21875 0 193.06
# bb_max_f 122.5 158.5 215.7
finalization tag
finalization tag
Spatial CoherenceThe correlation between the proximity of points inspace and their proximity in the stream.
Spatial CoherenceThe correlation between the proximity of points inspace and their proximity in the stream.
Spatial CoherenceThe correlation between the proximity of points inspace and their proximity in the stream.
Spatial CoherenceThe correlation between the proximity of points inspace and their proximity in the stream.
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Danger: Potential Quadratic Time
Point Reordering by Finalizer
Chunking:all points arrive, then releasing them together.
Buffering points in a region until
Points in a chunk are randomly reordered.
Point Reordering by Finalizer
Chunking:all points arrive, then releasing them together.
Buffering points in a region until
Points in a chunk are randomly reordered.
Sprinkling: Promoting a small random sampleof ‘‘sprinkle points’’ to earlier in the stream.
Circumvents danger of quadratic behavior.
The Triangulator
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
triangulation.Update
Regions not yet finalized
Finalized space
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
triangulation.Update
When tag arrives:
triangles.Identify final
Write them out &free their memory.
Regions not yet finalized
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
Start at newesttriangle.
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
Start at newesttriangle.Walk to point.
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
Start at newesttriangle.Walk to point.
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
Start at newesttriangle.Walk to point.If that fails,restart fromcell triangle.If that fails,do exhaustivesearch.
Streaming Delaunay Triangulation
When point arrives:
triangle.Locate enclosing
triangulation.Update
Streaming Delaunay Triangulation
When tag arrives:
triangles.Identify final
Only these triangles
New triangles(since last tag).
need to be checked:
for this tag.Triangles waiting
Streaming Delaunay Triangulation
When tag arrives:
triangles.Identify final
Checked trianglesthat aren’t final areassigned a tag towait for.
Results
Results
Us: 12 min finalize + 36 min triang. = 48 min.
Agarwal−Arge−Yi:3 hr sort + 7.5 hr triang. = 10.5 hr.
Results
107 min finalize + 278 min triang. = 6 hr 25 min.425 MB finalize + 11 MB triang. = 436 MB.
3D
tetrahedra
& 795 MB.in 2:41 hrs
points.)finalized(Pre−
815 million
3D Streaming Delaunay
for surface scans.Circumspheresare too big.
3D Streaming Delaunay
Does not work
Delaunay triangulation of a random sample.
3D Streaming Delaunay
Future work: spherical finalization regions from
Delaunay triangulation of a random sample.
3D Streaming Delaunay
Future work: spherical finalization regions from
Conclusions
sorting doesn’t help.
Conclusions
Most real−world points sets have lots ofspatial coherence
sorting doesn’t help.
Conclusions
Most real−world points sets have lots ofspatial coherence
Like aikido: Use your opponent’s spatialcoherence against him.
sorting doesn’t help.
Conclusions
Most real−world points sets have lots ofspatial coherence
Like aikido: Use your opponent’s spatialcoherence against him.
Not an external memory algorithm!No temporary storage to disk.
sorting doesn’t help.
Conclusions
Most real−world points sets have lots ofspatial coherence
Like aikido: Use your opponent’s spatialcoherence against him.
Not an external memory algorithm!No temporary storage to disk.
12 times faster than best previous 2D approach.
sorting doesn’t help.
Conclusions
Most real−world points sets have lots ofspatial coherence
Like aikido: Use your opponent’s spatialcoherence against him.
Not an external memory algorithm!No temporary storage to disk.
Streaming triangulation can be piped directlyto another streaming application.
12 times faster than best previous 2D approach.
Streaming Digital Elevation Maps
Streaming Contour Extraction
Thanks
Kevin Yi at Duke supplied the Neuse RiverBasin data.
Martin Isenburg & Yuanxin ‘‘Leo’’ Liu did mostof the programming.