Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Meshing in (nearly)-Optimal Time Benoît Hudson Carnegie Mellon University Joint work with Todd Phillips and Gary Miller (to appear IMR’06) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Running a simulation: Scientists provide model & equations incompressible Navier-Stokes flow Numerical analysts translate to a linear system Ax = b Finite Element Method Computational geometers produce finite element meshes September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Bring me… a mesh September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Formal statement Input: a PLC (points, segments, …) in Rd Output: Delaunay of input vertices plus Steiner points all features appear good radius-edge September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Formal statement Input: a PLC (points, segments, …) in Rd Output: Delaunay of input vertices plus Steiner points conforms quality September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Prior work: triangulations m: #vertices Prior work: triangulations L: largest distance s: smallest distance L/s º spread Normally: L/s Î poly(n) [Hudson/Miller/Phillips06] O(m + n lg L/s) in any dimension [Chew92]: guaranteed quality [Ruppert95]: quality AND size [Shewchuk97]: implementation (Triangle) Many: 3+D, fewer caveats Not many: time bounds. [Spielman/Teng/Üngör02]: O(polylog L/s) parallel [Miller04]: O( (m + n) polylog(L/s)) [Har-Peled/Üngör05]: O(m + n lg n) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Prior work: quadtrees 2D [Bern/Eppstein/Gilbert92]: O(m+ n lg n) assuming L/s Î poly(n) 3D [Mitchell/Vavasis99]: O(m + n lg n) for point sets; O(mn) with features More recent work: parallelize, reduce output size (cf. [Har-Peled/Üngör05]) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Outline Intro Ruppert’s algorithm Sparse Voronoi Refinement (SVR) SVR runtime proofs Implementation details Pie-in-the-sky September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Ruppert’s algorithm on point sets Input: P Ì [1/3, 2/3]d Procedure: Add a bounding box B = {0, 0.5, 1.0}d Compute Delaunay of P È B While $ skinny triangle Insert its circumcenter September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Ruppert: handling input segments When inserting circumcenter: If $ a segment near the point, yield to the segment: insert its midpoint instead Near º inside diametral circle of segment September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Local feature size Define local feature size: lfs(p) º distance to 2nd nearest input from p Continuous version of nearest neighbour lfs(p) p September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Ruppert: spacing Key theorem for Ruppert’s results: In the final mesh, for all vertices v: NN(v) ³ c lfs(v) Proof: induction over insertions. lfs(v) v NN(v) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Ruppert: runtime Output-sensitive: Input has n vertices and segments Output has m vertices Compute Delaunay of P È B: O(n lg n) While $ skinny triangle: O(m) iterations Insert its circumcenter: ??? September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Ruppert: cost of insertions An insertion can cost O(m) Maybe not all can cost O(m)? September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Jernej Barbic’s W(n2) proof Number of input points: n Number of output points: m=O(n) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Delaunay triangulation of the input: Lots of skinny triangles. We choose to split the one shaded in grey. September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Big “fan” of triangles appears: high cost September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch We have established a self-repeating pattern … September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Lots of work continues… September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Total work proven to be: (n2) Number of input points: O(n) Number of output points: m=O(n) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch 3D: W(n2) example Picture due to Sariel Har-Peled, FOCS’01 September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch 3D: W(very bad) example Initial Delaunay has W(n2) tetrahedra. W(n2) work to build it; worse: W(n2) space Likely possible to get W(n3) work. [Erickson01]: “Nice point sets can have nasty Delaunay triangulations” [Me]: natural examples probably OK, but engineered surfaces look like worst-case examples. September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Does it matter? Situation: user needs one mesh, which will be heavily used. Production time is almost irrelevant. Output size is critical. Situation: mesh used only once. Production time is a limiting factor. September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Outline Intro Ruppert’s algorithm Sparse Voronoi Refinement (SVR) SVR runtime proofs Implementation details Pie-in-the-sky September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: intuition All bad examples have arbitrarily skinny triangles Fix: Never allow quality to fall excessively September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
SVR vs. Ruppert Input: P Ì [1/3, 2/3]d Procedure: Circumcircle has radius r. Yield if $ point at dist (1-e) r Input: P Ì [1/3, 2/3]d Procedure: Add a bounding box B = {0, 0.5, 1.0}d Compute Delaunay of P È B While $ triangle that is skinny OR contains uninserted input Try to insert its circumcenter If $ nearby uninserted point, yield to it September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: intuition All bad examples have arbitrarily skinny triangles Fix: Never allow quality to fall excessively Catch-phrase: Ruppert refinement conforms immediately, then iteratively achieves quality SVR achieves quality immediately, then iteratively conforms We interleave conforming and refinement September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: example September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
SVR and input features (2D) Almost same as Ruppert, but: Must check for yielding to input points before Checking for yielding to segments. September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: spacing In the final mesh, for all vertices v: NN(v) ³ c lfs(v) Proof: same as for Ruppert Yields size optimality for point sets lfs(v) v NN(v) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Outline Intro Ruppert’s algorithm Sparse Voronoi Refinement (SVR) SVR runtime proofs Implementation details Pie-in-the-sky September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: key property One key lemma to prove them all: No triangle has radius-edge > r’ Proof Sketch: Bad quality º big empty circle near dense points Variant of sizing proof Þ cleaning skinnies is safe (doesn’t create dense packings) Other variant Þ conforming is safe Empty circles don’t grow September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: runtime Compute Delaunay of B: O(1) While $ bad triangles: O(m) iterations Insert its circumcenter or yield: ??? September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: two costs What’s the cost of inserting a point into the Delaunay triangulation? How do we keep track of uninserted inputs? September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: insert cost SVR mesh always has good radius/edge [MTTW’96] prove good radius/edge Þ bounded degree Bounded degree Þ each insertion is O(1) September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch SVR: point location Point location data structure: each triangle holds a set of uninserted points. Insertion: fix point / triangle mapping Query: " triangle t intersecting grey circle, " points p in t, check if p Î grey circle September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Point location costs Fact: Insertion creates O(1) triangles [due to quality] O(1) time per point for relocation Fact: Empty circles intersect O(1) triangles [due to quality] Þ O(1) triangles checked in query O(1) time per point checked September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Point location costs But: can have O(n) points in the triangles! Amortize: want all unaccounted costs to sum to O(n lg n) Use a packing argument [STU02], [Miller04] September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Insert relocation cost NN(q) q is a new vertex destroys p’s triangle forces relocation Fact: NN(q) Î Q |pq| q p September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Ball packing q1 Consider insertions at distance [d,2d] Each has empty ball of radius Q(d) Þ O(1) balls max Þ O(lg L/s) total relocations per input q3 q5 q2 p q4 September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Query costs Query looks at p from q Point q’ is inserted near q. Fact: |pq| ~ NN(q) And NN(q) ~ NN(q’) Þ Packs like insert case (1-e) q’ q p September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Outline Intro Ruppert’s algorithm Sparse Voronoi Refinement (SVR) SVR runtime proofs Implementation details Pie-in-the-sky September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Knobs to turn ~20° in 2d Quality (radius/edge) bound r Yield restriction e For termination, need: r (1-e)d ³ 2d-3/2 Mesh size: shrinks as e ® 0, r ® ¥ Runtime: grows as e ® 0 until O(méd/2ù+1) Runtime: ??? as r ® ¥ or r ® 0 Guess: want e almost 0, r smaller than √2 September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Decisions to make Many decisions are left arbitrary: what input point to yield to which skinny triangle to fix which non-empty triangle to refine No good sense yet; need experiments. Probable: pick closest point; fix biggest (or smallest?) triangle September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Circumcenters / Off-centers Any point near circumcenter works Ungor: off-centers: defined to create a fat triangle Off-centers should work in SVR also September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Curse of dimensionality Bounds assume d is O(1): hide 2O(d) terms. If d ~ Q(log log n), add a O(log n) factor If d ~ Q(log n), let’s go shopping n ~ 1 billion Þ log n ~ 30 Rule of thumb: break down at d ~ 10 We live in 3-D Þ meshing works September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Less fundamental restrictions SVR now: input features highly restricted must intersect at ³ 90° must have O(1) points on convex hull must have bounded aspect ratio (no struts) SVR now: builds conforming Delaunay prefer constrained Delaunay Future work. September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Future work Input points affected only O(lg L/s) times Almost certainly can be done in parallel: O(polylog(L/s)) steps with O(m) processors. O(polylog(L/s)) steps with ¥ processors is best known [STU92] September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch More Future work Input points affected only O(lg L/s) times Almost certainly can be done dynamically: A new point should affect only O(lg L/s) decisions. Preliminary [with Acar, unpublished] September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch
Benoît Hudson - Berkeley Graphics Lunch Remember only this SVR produces: a small simplicial mesh in optimal time handles input features (segments, faces, …) Key property: always bounded quality: SVR achieves quality immediately, then iteratively conforms September 7, 2006 Benoît Hudson - Berkeley Graphics Lunch