190 likes | 313 Views
UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010. Shewchuck 2D Triangular Meshing. Shewchuck. Aspect. 2D. Dimensional. ity. (constrained) Delaunay. Problem/. triangulation; robustness. Task. implementation. Theory?.
E N D
UMass Lowell Computer Science 91.504Advanced AlgorithmsComputational GeometryProf. Karen DanielsSpring, 2010 Shewchuck 2D Triangular Meshing
Shewchuck Aspect 2D Dimensional ity (constrained) Delaunay Problem/ triangulation; robustness Task implementation Theory? Implementat ion? triangular mesh; (constrained) ADTs & Delaunay triangulation; Data Voronoi diagram; convex hulls; Structures Guibas/Stolfi quad - edge; triangular data structure; PSLG; splay tree; heap sweep - line; geometric divide - Algorithmic and - conquer; in cremental Paradigms insertion & Techniques duality Math Topics 2D Mesh Generation Shewchuck Aspect Title Triangle: Engineering a 2D Q uality Mesh Generator and Delaunay Triangulator st Source Conf : 1 Workshop on Applied CG , 1996 geometric modeling; graphics Application Areas PSLG of object Input Objec ts
Shewchuck 2D Triangular Meshing “Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator” Jonathan Richard Shewchuck http://www.cs.cmu.edu/~jrs/jrspapers.html
Goals • Construct 2D mesh of triangles for geometric modeling that: • avoids small angles • constrained Delaunay triangulation • is efficient in time and space • careful choice of data structures & algorithm • is robust • adaptive exact arithmetic C code at http://www.cs.cmu.edu/~quake/triangle.html
Approach: Overview • Based on Ruppert’s Delaunay Refinement Algorithm • Input: Planar Straight Line Graph (PSLG) • collection of vertices and line segments • Step 1: Construct Delaunay triangulation of point set
Approach: Overview (continued) • Step 2: • Start with the Delaunay triangulation of the point set • Add input segments • segments become constraints • constrained Delaunay triangulation some differences
Approach: Overview (continued) • Step 3: (not in Ruppert’s algorithm) • Remove triangles from concavities • “triangle-eating virus” • Step 4: • Refine mesh to satisfy additional constraints on triangle’s minimum • angle size • area
Step 1: Construct Delaunay Triangulation of Point Set • Delaunay Triangulation Algorithms: • O(nlogn) expected time: • Randomized incremental insertion • Edge flipping restores empty circle property • O(nlogn) worst-case time: • Compute Voronoi diagram, then dualize • Fortune’s plane sweep (parabolic front) • O(nlogn) worst-case time: • Divide-and-Conquer • alternating cuts deBerg handout slowest [point location bottleneck] Shewchuck experimental comparison [speed, correctness] fastest
Experimental Delaunay Triangulation Timings Note: Robust versions require more execution time.
Delaunay Triangulation Algorithms:Divide-and-Conquer • O(nlogn) worst-case time • Recursively halve input vertex set • Stop when size = 2 or 3 • Triangulate small set • forms edge(s) or triangle • Merge 2 triangulations • Ghost triangles allow fast convex hull traversal • Fit together like gear teeth
Step 2: Constrained Delaunay Triangulation • Force mesh to conform to input line segments • User Chooses Approach: • Recursive segment subdivision • Insert segment midpoint • Flip edges to restore Delaunay (empty circle) property • Constrained Delaunay triangulation (default) • Insert entire segment • Delete triangles it overlaps • Retriangulate regions on each side of segment • No new vertices are inserted
Step 4: Mesh Refinement • Refine mesh to satisfy additional constraints on minimum triangle • angle size • area • Insert new vertices • Flip edges to restore Delaunay (empty circle) property • Halting Issue: • Halts for angle constraint <= 20.7o • May not halt for angle constraint >= 33.9o
Step 4: Mesh Refinement (continued) • Vertex Insertion Rules: • Segment’s Diametral Circle • smallest circle containing segment • any point in the circle encroaches on segment • split encroached segment • insert vertex at midpoint • Triangle’s Circumcircle • circle through all 3 vertices • bad triangle: • angle too small • area too large • split bad triangle • insert vertex at circumcenter Encroached segments have priority over bad triangles.
Step 4: Mesh Refinement (continued) Note: Figures are in left-to-right, top-to-bottom order
triangle-based edge-based - Topologically less rich - Longer code + Faster + Less memory + Topologically richer + Elegant - Slower - More memory representation tradeoffs Implementation Issues: Representation Shewchuck preference • Ghost triangles: • connected in ring about a “vertex at infinity” • facilitate convex hull traversal
Implementation Issues: Robustness incorrectness can be serious • Tests • Can influence program flow of control • Can classify entities (e.g. sweep-line events) • Depend on correctness of geometric predicates • Orientation (left/right/on) • In-Circle (in/out/on) • Each computes sign of a determinant • Constructions • Represent geometric objects some incorrectness can sometimes be tolerated
Implementation Issues: Robustness (continued) What causes incorrectness? • Ideal Goal: real arithmetic for some operations • Challenge: compounded roundoff error in floating-point arithmetic calculations: • Tests: can cause program • to hang • to crash • to produce incorrect output • wrong topology • Constructions: • can cause approximate results
exact floating-pt hybrid slow but sure fast but loose time vs. error tradeoff Implementation Issues: Robustness (continued) • Arithmetic Alternatives to Floating-Point: • Integer or rational exact arithmetic • fixed precision • extended precision • Floating point + • e-testing • robust topological decisions • filter: • identify adequate precision for an operation (bit complexity) • if expressible as multivariate polynomial, degree gives clue • floating-point comparisons except when correctness is threatened • Shewchuck adaptive precision (logical extreme of filter): • compute quantity (e.g. sign of determinant) via successively more accurate approximations • stop when uncertainty in result is small No single solution fits all needs. Collection of techniques is needed.
Implementation Issues: Robustness (continued) • Shewchuck uses: • multi-stage adaptive precision for geometric primitives • Orientation (left/right/on) • In-Circle (in/out/on) • Each • computes sign of a determinant • takes floating-point inputs • stops when uncertainty in result is small • can reuse previous, less accurate approximations • fast arbitrary precision arithmetic • for small (yet extended) precision values For general discussion of robustness issues and alternatives, see StrategicDirections in Computational Geometry Working Group Report Also see research by Prof. Victor Milenkovic: http://www.cs.miami.edu/~vjm.