COSC 6114 Prof. Andy Mirzaian Quad Trees: Non-Uniform Mesh Generation.

Slides:



Advertisements
Similar presentations
Chapter 11 Trees Graphs III (Trees, MSTs) Reading: Epp Chp 11.5, 11.6.
Advertisements

Great Theoretical Ideas in Computer Science for Some.
Two Segments Intersect?
Polygon Triangulation
WSPD Applications.
Nearest Neighbor Search
INTERVAL TREE & SEGMENTATION TREE
Comments We consider in this topic a large class of related problems that deal with proximity of points in the plane. We will: 1.Define some proximity.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Fast Algorithms For Hierarchical Range Histogram Constructions
Heaps1 Part-D2 Heaps Heaps2 Recall Priority Queue ADT (§ 7.1.3) A priority queue stores a collection of entries Each entry is a pair (key, value)
Chapter 4: Trees Part II - AVL Tree
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Searching on Multi-Dimensional Data
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Brute-Force Triangulation
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Quadtrees Raster and vector.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
17. Computational Geometry Chapter 7 Voronoi Diagrams.
3. Delaunay triangulation
Mark Waitser Computational Geometry Seminar December Iterated Snap Rounding.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Quadtrees and Mesh Generation Student Lecture in course MATH/CSC 870 Philipp Richter Thursday, April 19 th, 2007.
The Art Gallery Problem
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Good Triangulations and Meshing Lecturer: Ofer Rothschild 1.
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
Delaunay Triangulations Presented by Glenn Eguchi Computational Geometry October 11, 2001.
Tools of Geometry Chapter 1 Vocabulary Mrs. Robinson.
Heapsort Based off slides by: David Matuszek
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
The BSP-tree from Prof. Seth MIT.. Motivation for BSP Trees: The Visibility Problem We have a set of objects (either 2d or 3d) in space. We have.
Lars Arge Presented by Or Ozery. I/O Model Previously defined: N = # of elements in input M = # of elements that fit into memory B = # of elements per.
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Arrangements and Duality Motivation: Ray-Tracing Fall 2001, Lecture 9 Presented by Darius Jazayeri 10/4/01.
Quadtrees: Non-Uniform Mesh Generation Universidad de Puerto Rico – Mayagüez Mathematics Department Computational Geometric Course Course Professor: Robert.
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
Maths & Technologies for Games Spatial Partitioning 2
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Polygon Triangulation
1 Schnyder’s Method. 2 Motivation Given a planar graph, we want to embed it in a grid We want the grid to be relatively small And we want an efficient.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
Spatial Data Management
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Computational Geometry
B+ Tree.
KD Tree A binary search tree where every node is a
Orthogonal Range Searching and Kd-Trees
The Art Gallery Problem
The Art Gallery Problem
Multidimensional Search Structures
Presentation transcript:

COSC 6114 Prof. Andy Mirzaian Quad Trees: Non-Uniform Mesh Generation

References: Applications: [M. de Berge et al] chapter 14 Marshal Bern [1997], “Triangulations,” in Handbook of Discrete and Computational Geometry, J.E. Goodman & J. O’Rourke (editors), chapter 22, 413-428. Applications: VLSI circuits in electrical devices heat emission – a design issue experiment with prototype automated simulation by finite-element methods MESH (uniform / non-uniform)

QUAD TREES Non-Uniform Mesh Generation Applications & Methodology: VLSI circuits in electrical devices heat emission – a design issue experiment with prototype; reject faulty design (expensive, time consuming) automated simulation by finite-element methods subdivide regions into sufficiently fine triangles or quadrangles: MESH (uniform/non-uniform) what is the influence of one mesh element on neighboring elements? mesh should be more refined near the “objects” and gracefully get coarser further away avoid mesh elements that have extreme aspect ratios (bounded angles) mesh elements should respect object borders.

Uniform vs Non-Uniform Mesh Sufficiently refined. Too many mesh elements (time & space) U = 2j integer grid U U

Uniform vs Non-Uniform Mesh Conforming Respect Input Well Shaped: bounded aspect ratio (e.g., angels  [45 : 90]) Steiner Points

Uniform vs Non-Uniform Mesh Unifrom Mesh too many triangles

Uniform vs Non-Uniform Mesh based on: Constrained Delaunay Triangulation small angels

Uniform vs Non-Uniform Mesh based on: QUAD TREE

Quad Trees for point sets NW 2 NE 1 SW 3 SE 4 1 NE 2 NW 3 SW 4 SE

Quad Trees for point sets 22 21 1 4 1 2 3 242 241 23 243 244 24 21 22 23 31 32 33 34 31 32 4 241 242 243 244 33 34

Quad Trees for point sets square/node: s Point set P  [xs : x’s ]  [ys : y’s ] xmid = (xs + x’s )/2 , ymid = (ys + y’s )/2 PNE = { p P | px > xmid , py > ymid } PNW = { p P | px  xmid , py > ymid } PSW = { p P | px  xmid , py  ymid } PSE = { p P | px > xmid , py  ymid } Keep splitting a square if it contains more than one data point. edge side corner

LEMMA: P = a set of points in the plane, LEMMA: P = a set of points in the plane, S = side length of root square for Quad Tree of P, C = smallest distance between pair of points in P, D = depth of Quad Tree. Then, D  log S/C + 3/2 . Proof: Any internal node contains at least 2 points of P. Node at depth i has side-length S/2i , diagonal length (S2)/2i  C So, i  log (S2)/C = log S/C + ½ . Deepest leaf has depth one more.

Balanced Quad Trees Scene gives un-balanced Quad Tree neighbor squares with un-balanced sides resulting mesh has tiny angles To achieve conformity and satisfy angle-bounds (aspect ratio), We need to balance the QuadTree. Balanced QuadTree: side-length ratio of any 2 neighboring squares = O(1).

Balanced Quad Trees Two squares are neighbors if they have overlapping sides but disjoint interiors. Quad Tree is balanced if any two leaf neighboring squares differ in side-length by at most 2, i.e, have depth difference  1.

Balanced Quad Trees Two squares are neighbors if they have overlapping sides but disjoint interiors. Quad Tree is balanced if any two leaf neighboring squares differ in side-length by at most 2, i.e, have depth difference  1. BALANCING

Balanced Quad Trees s = a leaf of Quad Tree T NN(s) WN(s) NN(s) = North Neighbor of s, is a node s’ in T s.t. (i) north edge of s is shared by s’ (ii) depth(s’)  depth(s) (i.e., square s’ not smaller than s) (iii) s’ is the smallest such square in T. SN(s), EN(s), WN(s) defined similarly. NN(s) WN(s) EN(s) s SN(s) SN(s) EN(s) s NN(s) WN(s)

Balanced Quad Trees These take O(D) time, D = height(T ). LEMMA: Given a leaf s in T , NN(s), NN(s), NN(s), NN(s) can be obtained in O( depth(s)). Proof: Let s’ = NN(s). From s, go up in T to lowest common ancestor of s & s’, then come down to s’. LEMMA: Leaf s should split   leaf s’ in T , s.t. s is one of NN(s’), NN(s’), NN(s’), or NN(s’), & depth(s’)  2 + depth(s). These take O(D) time, D = height(T ).

Balancing a Quad Tree while L   do if s has to split then do ALGORITHM BalancedQuadTree(T ) Input: Quad Tree T Output: a balanced version of T L  list of all leaves of T while L   do remove a leaf s from L if s has to split then do add 4 children sNE , sNW , sSE , sSW to s in T & update their object contents insert sNE , sNW , sSE , sSW into L check if sNE , sNW , sSE , sSW have neighbors that should split & add them to L end-if end-while return T end

THEOREM: Let T be a quad-tree with m nodes and height D THEOREM: Let T be a quad-tree with m nodes and height D. Then, the above algorithm constructs a balanced version of T that has O(m) nodes in O(Dm) time.

THEOREM: Let T be a quad-tree with m nodes and height D THEOREM: Let T be a quad-tree with m nodes and height D. Then, the above algorithm constructs a balanced version of T that has O(m) nodes in O(Dm) time. Proof: Step 1: takes O(m) time. Steps 2-9: each iteration adds 4-1 = 3 nodes to T & takes O(D) time to check O(1) neighboring nodes in L . Therefore, total time for the while-loop is O(D  # new nodes added). What is the number of added new nodes?

THEOREM: Let T be a quad-tree with m nodes and height D THEOREM: Let T be a quad-tree with m nodes and height D. Then, the above algorithm constructs a balanced version of T that has O(m) nodes in O(Dm) time. Proof: Step 1: takes O(m) time. Steps 2-9: each iteration adds 4-1 = 3 nodes to T & takes O(D) time to check O(1) neighboring nodes in L . Therefore, total time for the while-loop is O(D  # new nodes added). What is the number of added new nodes? Even though some leaf in s1 causes leaf s2 to split, that splitting cannot propagate to the neighbor s3 of the same size. [Proof by induction on node depth difference.] NW NE SW SE s1 s2 s3

THEOREM: Let T be a quad-tree with m nodes and height D THEOREM: Let T be a quad-tree with m nodes and height D. Then, the above algorithm constructs a balanced version of T that has O(m) nodes in O(Dm) time. Proof: Step 1: takes O(m) time. Steps 2-9: each iteration adds 4-1 = 3 nodes to T & takes O(D) time to check O(1) neighboring nodes in L . Therefore, total time for the while-loop is O(D  # new nodes added). What is the number of added new nodes? Even though some leaf in s1 causes leaf s2 to split, that splitting cannot propagate to the neighbor s3 of the same size. [Proof by induction on node depth difference.] NW NE SW SE s1 s2 s3 charge 1 to neighbor of equal size that causes splitting each square is charged  8 times. range of influence:

From Quad Trees to Meshes Root square contains polygonal objects, all vertices at integer grid points (U=2j), all edges are at angels 0, 45, 90, 135. Stop splitting when the square no longer intersects with any object edge, or when it has unit size. Balance the resulting Quad Tree for each leaf square s do: - if there is a diagonal object edge, fine; otherwise, add one such diagonal. - to make s conform to a neighboring smaller leaf, add O(1) horizontal or vertical or diagonal lines also. all angels 45 or 90.

Then, there is a non-uniform triangular mesh for S that is: THEOREM: Let S = a set of disjoint polygonal components inside the square [0 : U][0 : U] with properties stated earlier, & p(S) = total perimeter length of components in S. Then, there is a non-uniform triangular mesh for S that is: conforming, respects the input, triangle angles are 45 or 90, # triangles = O(p(S) log U), Construction time = O(p(S) log2 U). Proof: # triangles incident to an input segment of length L is  2(L+2). Thus, # cells in the quad-tree at the same depth is O(p(S)). Depth of quad-tree is at most O(log U). Thus, total # nodes in quad-tree is O(p(S) log U). The rest follows from previous discussion: m = O(p(S) log U) D = O(log U) O(Dm) = O(p(S) log2 U).

Notes & Comments [Bern 1997]: any polygonal domain with n vertices & no obtuse angles has a mesh consisting of O(n) non-obtuse triangles (i.e., all angels  90). Other applications of quad-trees (oct-trees in 3): computer graphics image analysis range queries hidden surface removal ray tracing medial axis transforms overlay of raster maps nearest neighbor query processing   

Exercises

Suppose a triangular mesh is needed inside a rectangle whose sides have length 1 and length k > 1. Steiner points may not be used on the sides, but they may be used inside the rectangles. Also assume that all triangles msut have angles between 30 and 90. Is it always possible to create a triangular mesh with these properties? Suppose it is possible to create a mesh for a particular input, what is the minimum number of Steiner points needed? The algorithm described produces non-obtuse triangulated mesh (provided all angles in the input have no obtuse angles). Prove that if a triangulation of a set P of points in the plane contains only non-obtuse triangles, then it must be the Delaunay triangulation of P. Describe an algorithm to construct an oct-tree of a given set P of n points in 3D. It is possible to reduce the size of a quad-tree of height D for a set of points (with real coordinates) inside a square from O((D+1)n) to D(n). The idea is to discard any node v that has only one child under which points are stored. The node is discarded by replacing the pointer from the parent of v to v with the pointer from parent to the only interesting child of v. Prove that the resulting tree has linear size. Can you also improve upon the O((D+1)n) construction time? We called a quad-tree balanced if every two adjacent squares of the quad-tree subdivision differ by no more that a factor of two in size. To save a constant factor in the number of extra nodes needed to balance a quad-tree, we could weaken the balance condition by allowing adjacent squares to differ by a factor of four in size. Can you still complete such a weakly balanced quad-tree subdivision to a mesh such that all angles are between 45 and 90 by using only O(1) triangles per square?

Suppose we make the balancing condition for quad-trees more severe: we no longer allow adjacent squares to differ by a factor two in sieze, but we require them to have exactly the same size. Is the number of nodes in the new balanced version still linear in the number of nodes of the original quad-tree? If not, can you say anything about this number? A quad-tree can also be used to store a subdivision for efficient point location. The idea is to keep splitting a bounding square of the subdivision until all leaf nodes correspond to squares that contain at most one vertex and only edges incident to that vertex, or no vertex and at most one edge. (a) Since a vertex can be incident to many edges, we need an additional data structure at the quad-tree leaves storing vertices. Which data structure would you use? (b) Describe the algorithm for constructing the point location data structure in detail, and analyze its running time. (c) Describe the query algorithm in detail, and analyze its running time. Quad-tree can be used to perform range queries. Describe an algorithm for querying a quad-tree on a set P of points with a query region R. Analyze the worst-case query time for the case where R is a rectangle, and for the case where R is a half-plane bounded by a vertical line. Compare quad-tree, kD-trees and range trees (studies previously). Discuss the advantages and disadvantages of each of these data structures.

END