Quadtrees and Meshing

Similar documents
Mesh Generation. Quadtrees. Geometric Algorithms. Lecture 9: Quadtrees

1. Meshes. D7013E Lecture 14

Range Searching II: Windowing Queries

Algorithms for GIS:! Quadtrees

Computational Geometry

Geometric Structures 2. Quadtree, k-d stromy

Computation Geometry Exercise Range Searching II

Organizing Spatial Data

Point Location in Delaunay Triangulations

Computational Geometry Exercise Duality

Delaunay Triangulations. Presented by Glenn Eguchi Computational Geometry October 11, 2001

Computational Geometry Lecture Duality of Points and Lines

Computational Geometry

Polygon decomposition. Motivation: Art gallery problem

CMSC 754 Computational Geometry 1

UNIVERSITY OF WATERLOO Faculty of Mathematics

Spatial Data Structures

Delaunay Triangulations

Image Rotation Using Quad Tree

Spatial Data Structures

Spatial Data Structures

Computational Geometry Lecture Delaunay Triangulation

Projects & Polygon Triangulation

CSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms. Lecturer: Shi Li

Spatial Data Structures

Computational Geometry

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

CS6100: Topics in Design and Analysis of Algorithms

K-structure, Separating Chain, Gap Tree, and Layered DAG

Overview of Unstructured Mesh Generation Methods

Lecture 3: Art Gallery Problems and Polygon Triangulation

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

An improvement in the build algorithm for Kd-trees using mathematical mean

Spatial Data Structures

Constrained Delaunay Triangulations (CDT)

Intersection Acceleration

CMSC 425: Lecture 10 Geometric Data Structures for Games: Index Structures Tuesday, Feb 26, 2013

Algorithm SLOWCONVEXHULL(P) Input. A set P of points in the plane. Output. A list L containing the vertices of CH(P) in clockwise order. 1. E /0. 2.

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem

More Hidden Surface Removal

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Ray Tracing Acceleration Data Structures

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

2) For any triangle edge not on the boundary, there is exactly one neighboring

Polygon Triangulation. (slides partially by Daniel Vlasic )

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

CS 532: 3D Computer Vision 11 th Set of Notes

Ma/CS 6b Class 26: Art Galleries and Politicians

Computational Geometry

PARALLEL CONSTRUCTION OF QUADTREES AND QUALITY TRIANGULATIONS

Week 7 Convex Hulls in 3D

Voronoi diagram and Delaunay triangulation

Polygon Triangulation. (slides partially by Daniel Vlasic )

Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here)

An Implementation of a Near-Linear Polygon Triangulation Algorithm for General Polygons

CPSC / Sonny Chan - University of Calgary. Collision Detection II

A New Progressive Lossy-to-Lossless Coding Method for 2.5-D Triangle Mesh with Arbitrary Connectivity

Chapter 10 Polygons and Area

CS 532: 3D Computer Vision 14 th Set of Notes

Discrete Mathematics I So Practice Sheet Solutions 1

6.2 Classification of Closed Surfaces

Line segment intersection. Family of intersection problems

Geometric Data Structures for Computer Graphics

The Art Gallery Problem: An Overview and Extension to Chromatic Coloring and Mobile Guards

Geometric Data Structures for Computer Graphics

Geometric Modeling. Bing-Yu Chen National Taiwan University The University of Tokyo

Motivation: Art gallery problem. Polygon decomposition. Art gallery problem: upper bound. Art gallery problem: lower bound

SPERNER S LEMMA MOOR XU

Henneberg construction

On a nested refinement of anisotropic tetrahedral grids under Hessian metrics

Lesson 2 7 Graph Partitioning

Module 8: Range-Searching in Dictionaries for Points

GEOMETRIC SEARCHING PART 2: RANGE SEARCH

implementing the breadth-first search algorithm implementing the depth-first search algorithm

Visibility: Finding the Staircase Kernel in Orthogonal Polygons

Computational Geometry

Algorithms for Graph Visualization Layered Layout

Triangulating the Square and Squaring the Triangle: Quadtrees and Delaunay Triangulations are Equivalent

COMP 175: Computer Graphics April 11, 2018

Insertions and Deletions in Delaunay Triangulations using Guided Point Location. Kevin Buchin TU Eindhoven

Computational Geometry. Lecture 17

Ray Tracing: Intersection

Multidimensional Indexes [14]

Combinatorics of Beacon-based Routing in Three Dimensions

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165

Trapezoidal Maps. Notes taken from CG lecture notes of Mount (pages 60 69) Course page has a copy

Treewidth and graph minors

Project 3: Point Location

Foundations of Multidimensional and Metric Data Structures

Algorithms for Graph Visualization Layered Layout

3D Representation and Solid Modeling

Computational Geometry

Average case analysis of dynamic geometric optimization

Algorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree

A Comparison of Two Fully-Dynamic Delaunay Triangulation Methods

Subdivision Surfaces

UNIVERSITÀ DEGLI STUDI DI ROMA TRE Dipartimento di Informatica e Automazione. Constrained Simultaneous and Near-Simultaneous Embeddings

Algorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree

Polygon Partitioning. Lecture03

Transcription:

Computational Geometry Lecture INSTITUT FÜR THEORETISCHE INFORMATIK FAKULTÄT FÜR INFORMATIK Tamara Mchedlidze Darren Strash 14.12.2015

Motivation: Meshing PC Board Layouts To simulate the heat produced on boards we can use the finite element method (FEM): decompose the board in small homogeneous elements (e.g., triangles) mesh heat generation and impact on neighbors for each element known approximate numerically the entire heat generation of board Quality properties of FEM: the finer the mesh, the better the approximation the larger the mesh, the faster the calculation the more compact the elements, the faster the convergence Goal: adaptive mesh size (small on materials, otherwise coarser) fat triangles (not too narrow)

Adaptive Triangular Mesh Given: Square Q = [0, U] [0, U] for power of two U = 2 j with octilinear, integer-coordinate polygons inside. disallowed triangle vertices Goal: Triangular mesh for Q with the following properties no triangle vertex in interior of triangular mesh

Adaptive Triangular Mesh Given: Square Q = [0, U] [0, U] for power of two U = 2 j with octilinear, integer-coordinate polygons inside. not part of the mesh Goal: Triangular mesh for Q with the following properties no triangle vertex in interior of triangular mesh input edges must be part of the triangulation

Adaptive Triangular Mesh Given: Square Q = [0, U] [0, U] for power of two U = 2 j with octilinear, integer-coordinate polygons inside. narrow angles Goal: Triangular mesh for Q with the following properties valid { no triangle vertex in interior of triangular mesh input edges must be part of the triangulation triangle angle between 45 and 90

Adaptive Triangular Mesh Given: Square Q = [0, U] [0, U] for power of two U = 2 j with octilinear, integer-coordinate polygons inside. uniform mesh Goal: Triangular mesh for Q with the following properties valid { no triangle vertex in interior of triangular mesh input edges must be part of the triangulation triangle angle between 45 and 90 adaptive (i.e., fine at the polygon edges, otherwise coarser) Do we already have meaningful triangulations of Q?

Delaunay Triangulation? maximize smallest angle is defined for points and ignores existing edges

Delaunay Triangulation? maximize smallest angle is defined for points and ignores existing edges can still produce very small angles

Delaunay Triangulation? maximize smallest angle is defined for points and ignores existing edges can still produce very small angles does not use additional Steiner points Allowed angles, but uniform Allowed angles and adaptive 512 triangles 52 triangles

Quadtrees Def.: A quadtree is a rooted tree, where each internal node has 4 children. Each node corresponds to a square, and the squares of the leaves form a partition of the root square. edges sides NE NW SW SE squares neighbors

Quadtrees Def.: A quadtree is a rooted tree, where each internal node has 4 children. Each node corresponds to a square, and the squares of the leaves form a partition of the root square. Def.: For a point set P in a square Q = [x Q, x Q ] [y Q, y Q ] define the quadtree T (P ) if P 1 then T (P ) is a leaf, then Q stores P otherwise let x mid = x Q+x Q and y 2 mid = y Q+y Q and 2 P NE := {p P p x > x mid and p y > y mid } P NW := {p P p x x mid and p y > y mid } P SW := {p P p x x mid and p y y mid } P SE := {p P p x > x mid and p y y mid } T (P ) has root v v, then Q has 4 children storing P i and Q i (i {NE, NW, SW, SE}).

Example

Quadtree Properties The recursive definition of quadtrees leads directly to an algorithm for constructing them. What is the depth of a quadtree on n points? Lemma 1: The depth of T (P ) is at most log(s/c) + 3/2, where c is the smallest distance in P and s is the length of a side of Q. Theorem 1: A quadtree T (P ) on n points with depth d has O((d + 1)n) nodes and can be constructed in O((d + 1)n) time.

Finding Neighbors NorthNeighbor(v, T ) Input: Nodes v in quadtree T Output: Deepest node v not deeper than v with v.q to the north. Neighbor of v.q if v = root(t ) then return nil π parent(v) if v = SW -/SE-child of π then return NW -/NE-child of π µ NorthNeighbor(π, T ) if µ = nil or µ leaf then return µ else if v = NW -/NE-child of π then return SW -/SE-child of µ Theorem 2: Let T be a quadtree with depth d. The neighbor of a node v in any direction can be found in O(d + 1) time.

Balanced Quadtrees Def.: A quadtree is called balanced if any two neighboring squares differ at most a factor two in size. A quadtree is called balanced if its subdivision is balanced.

Balancing Quadtrees BalanceQuadtree(T ) Input: Quadtree T Output: A balanced version of T L List of all leaves of T while L not empty do µ extract leaf from L if µ.q too large then Divide µ.q into four parts and put four leaves in T add new leaves to L if µ.q now has neighbors that are too large then add it to L return T Thm 3: Let T be a quadtree with m nodes and depth d. The balanced version T B of T has O(m) nodes and can be constructed in O((d + 1)m) time.

Quadtrees and Adaptive Triangular Meshes Given: Recall: Square Q = [0, U] [0, U] for power of two U = 2 j with octilinear, integer-coordinate polygons inside. Goal: valid Idea: { Triangular mesh for Q with the following properties no triangle vertex in interior of triangular mesh input edges must be part of the triangulation triangle angle between 45 and 90 adaptive (i.e., fine at the polygon edges, otherwise coarser) Squares and edges are finished Use a quadtree as the basis for the triangular mesh! Adaptation: Split squares until they are no longer cut by a polygon or have size 1

From Quadtree to Triangular Mesh Obs.: when the interior of a square in a quadtree is intersected by an edge, then it is a diagonal. How do you get a valid triangular mesh? nodes on interior edges Diagonals for all remaining squares?

From Quadtree to Triangular Mesh Obs.: when the interior of a square in a quadtree is intersected by an edge, then it is a diagonal. How do you get a valid triangular mesh? angle is too small Diagonals for all remaining squares? Use subdivision nodes in triangulation? no!

From Quadtree to Triangular Mesh Obs.: when the interior of a square in a quadtree is intersected by an edge, then it is a diagonal. How do you get a valid triangular mesh? Diagonals for all remaining squares? Use subdivision nodes in triangulation? no! no! Balance quadtree and, if necessary, add a Steiner vertex!

Algorithm GenerateMesh(S) Input: Set S octilinear, integer-coordinate polygons in Q = [0, 2 j ] [0, 2 j ] Output: valid, adaptive triangular mesh for S T CreateQuadtree T BalanceQuadtree(T ) D DCEL for subdivisions of Q by T foreach Face f in D do if int(f) S then add appropriate diagonals in f to D else if Nodes only on the corners of f then add a diagonal in f to D else generate Steiner point in the middle of f and connect it to all nodes in f of D return D

Summary Theorem 4: For a set S of disjoint octilinear, integer-coordinate polygons with total perimeter p(s) in a square Q = [0, U] [0, U] we can compute in O(p(S) log 2 U) time a valid adaptive triangular mesh with O(p(S) log U) triangles.

Discussion Are there quadtree variants with space linear in n? Yes, if you contract internal nodes with only one non-empty child you get a so-called compressed quadtree (see exercise); a more advanced data structure is the skip quadtree with O(n) space and insert, remove, and search in O(log n) time. [Eppstein et al., 05] What other applications are there? Quadtrees are frequently used in practice in Computer Graphics, Image Processing, GIS and others, for range queries, although they are theoretically worse than range trees or kd-trees. (see exercise) As always: higher dimensions? Quadtrees can be easily generalized to higher dimensions. Then they are also called octrees.