Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Shewchuck 2D Triangular Meshing.

Similar presentations


Presentation on theme: "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Shewchuck 2D Triangular Meshing."— Presentation transcript:

1 UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Shewchuck 2D Triangular Meshing

2 2D Mesh Generation Aspect Shewchuck Title Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator Source Conf:1 st Workshop on Applied CG, 1996 Application Areas geometric modeling; graphics Input Objects PSLG of object Aspect Shewchuck Dimensional ity 2D Problem/ Task (constrained) Delaunay triangulation; robustness Theory? Implementat ion? implementation ADTs & Data Structures triangular mesh; (constrained) Delaunay triangulation; Voronoi diagram; convex hulls; Guibas/Stolfi quad-edge; triangular data structure; PSLG; splaytree; heap Algorithmic Paradigms & Techniques sweep-line; geometric divide- and-conquer; incremental insertion Math Topics duality

3 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

4 Goals Construct 2D mesh of triangles for geometric modeling that: Construct 2D mesh of triangles for geometric modeling that: avoids small angles avoids small angles constrained Delaunay triangulation constrained Delaunay triangulation is efficient in time and space is efficient in time and space careful choice of data structures & algorithm careful choice of data structures & algorithm is robust is robust adaptive exact arithmetic adaptive exact arithmetic C code at http://www.cs.cmu.edu/~quake/triangle.html

5 Approach: Overview Based on Ruppert’s Delaunay Refinement Algorithm Based on Ruppert’s Delaunay Refinement Algorithm Input: Planar Straight Line Graph (PSLG) Input: Planar Straight Line Graph (PSLG) collection of vertices and line segments collection of vertices and line segments Step 1: Construct Delaunay triangulation of point set Step 1: Construct Delaunay triangulation of point set

6 Approach: Overview (continued) Step 2: Step 2: Start with the Delaunay triangulation of the point set Start with the Delaunay triangulation of the point set Add input segments Add input segments segments become constraints segments become constraints constrained Delaunay triangulation constrained Delaunay triangulation some differences

7 Approach: Overview (continued) Step 3: (not in Ruppert’s algorithm) Step 3: (not in Ruppert’s algorithm) Remove triangles from concavities Remove triangles from concavities “triangle-eating virus” “triangle-eating virus” Step 4: Step 4: Refine mesh to satisfy additional constraints on triangle’s minimum Refine mesh to satisfy additional constraints on triangle’s minimum angle size angle size area area

8 Step 1: Construct Delaunay Triangulation of Point Set Delaunay Triangulation Algorithms: Delaunay Triangulation Algorithms: O(nlogn) expected time: O(nlogn) expected time: Randomized incremental insertion Randomized incremental insertion Edge flipping restores empty circle property Edge flipping restores empty circle property O(nlogn) worst-case time: O(nlogn) worst-case time: Compute Voronoi diagram, then dualize Compute Voronoi diagram, then dualize Fortune’s plane sweep (parabolic front) Fortune’s plane sweep (parabolic front) O(nlogn) worst-case time: O(nlogn) worst-case time: Divide-and-Conquer Divide-and-Conquer alternating cuts alternating cuts Shewchuck experimental comparison [speed, correctness] fastest slowest [point location bottleneck] deBerg handout

9 Experimental Delaunay Triangulation Timings Note: Robust versions require more execution time.

10 Delaunay Triangulation Algorithms: Divide-and-Conquer O(nlogn) worst-case time O(nlogn) worst-case time Recursively halve input vertex set Recursively halve input vertex set Stop when size = 2 or 3 Stop when size = 2 or 3 Triangulate small set Triangulate small set forms edge(s) or triangle forms edge(s) or triangle Merge 2 triangulations Merge 2 triangulations Ghost triangles allow fast convex hull traversal Ghost triangles allow fast convex hull traversal Fit together like gear teeth Fit together like gear teeth

11 Step 2: Constrained Delaunay Triangulation Force mesh to conform to input line segments Force mesh to conform to input line segments User Chooses Approach: User Chooses Approach: Recursive segment subdivision Recursive segment subdivision Insert segment midpoint Insert segment midpoint Flip edges to restore Delaunay (empty circle) property Flip edges to restore Delaunay (empty circle) property Constrained Delaunay triangulation (default) Constrained Delaunay triangulation (default) Insert entire segment Insert entire segment Delete triangles it overlaps Delete triangles it overlaps Retriangulate regions on each side of segment Retriangulate regions on each side of segment No new vertices are inserted No new vertices are inserted

12 Step 4: Mesh Refinement Refine mesh to satisfy additional constraints on minimum triangle Refine mesh to satisfy additional constraints on minimum triangle angle size angle size area area Insert new vertices Insert new vertices Flip edges to restore Delaunay (empty circle) property Flip edges to restore Delaunay (empty circle) property Halting Issue: Halting Issue: Halts for angle constraint <= 20.7 o Halts for angle constraint <= 20.7 o May not halt for angle constraint >= 33.9 o May not halt for angle constraint >= 33.9 o

13 Step 4: Mesh Refinement (continued) Vertex Insertion Rules: Vertex Insertion Rules: Segment’s Diametral Circle Segment’s Diametral Circle smallest circle containing segment smallest circle containing segment any point in the circle encroaches on segment any point in the circle encroaches on segment split encroached segment split encroached segment insert vertex at midpoint insert vertex at midpoint Triangle’s Circumcircle Triangle’s Circumcircle circle through all 3 vertices circle through all 3 vertices bad triangle: bad triangle: angle too small angle too small area too large area too large split bad triangle split bad triangle insert vertex at circumcenter insert vertex at circumcenter Encroached segments have priority over bad triangles.

14 Step 4: Mesh Refinement (continued) Note: Figures are in left- to-right, top-to- bottom order

15 Implementation Issues: Representation Ghost triangles: Ghost triangles: connected in ring about a “vertex at infinity” connected in ring about a “vertex at infinity” facilitate convex hull traversal facilitate convex hull traversal + Topologically richer + Elegant - Slower - More memory edge-based representation tradeoffs triangle-based - Topologically less rich - Longer code + Faster + Less memory Shewchuck preference

16 Implementation Issues: Robustness Tests Tests Can influence program flow of control Can influence program flow of control Can classify entities (e.g. sweep-line events) Can classify entities (e.g. sweep-line events) Depend on correctness of geometric predicates Depend on correctness of geometric predicates Orientation (left/right/on) Orientation (left/right/on) In-Circle (in/out/on) In-Circle (in/out/on) Each computes sign of a determinant Each computes sign of a determinant Constructions Constructions Represent geometric objects Represent geometric objects incorrectness can be serious some incorrectness can sometimes be tolerated

17 Implementation Issues: Robustness (continued) Ideal Goal: real arithmetic for some operations Ideal Goal: real arithmetic for some operations Challenge: compounded roundoff error in floating- point arithmetic calculations: Challenge: compounded roundoff error in floating- point arithmetic calculations: Tests: can cause program Tests: can cause program to hang to hang to crash to crash to produce incorrect output to produce incorrect output wrong topology wrong topology Constructions: Constructions: can cause approximate results can cause approximate results What causes incorrectness?

18 Implementation Issues: Robustness (continued) Arithmetic Alternatives to Floating-Point: Arithmetic Alternatives to Floating-Point: Integer or rational exact arithmetic Integer or rational exact arithmetic fixed precision fixed precision extended precision extended precision Floating point + Floating point +  -testing  -testing robust topological decisions robust topological decisions filter: filter: identify adequate precision for an operation (bit complexity) identify adequate precision for an operation (bit complexity) if expressible as multivariate polynomial, degree gives clue if expressible as multivariate polynomial, degree gives clue floating-point comparisons except when correctness is threatened floating-point comparisons except when correctness is threatened Shewchuck adaptive precision (logical extreme of filter): Shewchuck adaptive precision (logical extreme of filter): compute quantity (e.g. sign of determinant) via successively more accurate approximations compute quantity (e.g. sign of determinant) via successively more accurate approximations stop when uncertainty in result is small stop when uncertainty in result is small No single solution fits all needs. Collection of techniques is needed. slow but sure fast but loose exact floating-pt hybrid time vs. error tradeoff

19 Implementation Issues: Robustness (continued) Shewchuck uses: Shewchuck uses: multi-stage adaptive precision for geometric primitives multi-stage adaptive precision for geometric primitives Orientation (left/right/on) Orientation (left/right/on) In-Circle (in/out/on) In-Circle (in/out/on) Each Each computes sign of a determinant computes sign of a determinant takes floating-point inputs takes floating-point inputs stops when uncertainty in result is small stops when uncertainty in result is small can reuse previous, less accurate approximations can reuse previous, less accurate approximations fast arbitrary precision arithmetic fast arbitrary precision arithmetic for small (yet extended) precision values for small (yet extended) precision values For general discussion of robustness issues and alternatives, see Strategic Directions in Computational Geometry Working Group Report Also see research by Prof. Victor Milenkovic: http://www.cs.miami.edu/~vjm.


Download ppt "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Shewchuck 2D Triangular Meshing."

Similar presentations


Ads by Google