Download presentation
Presentation is loading. Please wait.
Published byPhillip Sparks Modified over 6 years ago
1
2018/6/11 Intersection of Nonconvex Polygons Using the Alternate Hierarchical Decomposition, AHD by Rizwan Bulbul, and Andrew U. Frank Department of Geoinformation and Cartography Vienna University of Technology Vienna, Austria Intersection computation is one of the fundamental operations of computational geometry. This paper presents an algorithm for intersection computation between two polygons (convex/nonconvex, with nonintersecting edges, and with or without holes). The approach is based on the decomposed representation of polygons, alternate hierarchica1l decomposition (AHD), that decomposes the nonconvex polygon into its convex components (convex hulls) arranged hierarchically in a tree data structure called convex hull tree (CHT). Only the basic operation of intersection of two convex hulls is geometric (for which well known algorithms exist) and the other operations are repeated application of this by traversing tree structures. May 12, 2010 AGILE 2010
2
Representation of Geometry is still Difficult
2018/6/11 Representation of Geometry is still Difficult Observe not what we can do, but what application problems are not yet approached: 3D geometry Geometry with Movement
3
Regular Geometry needs Real Numbers
2018/6/11 Regular Geometry needs Real Numbers Computers do REALs, which are approximations only: a/b * b <> a <> (a*b)/b Example problems: Test for point in polygon depends on order. Topology becomes not invariant under rotation!
4
Current solution (theoretically correct):
2018/6/11 Current solution (theoretically correct): Approximate coordinates with REALs Explicit representation of topology Avoid testing the same property twice, because it could produce inconsistencies. Theory of simplicial complex; base of ISO standard (OGC simple features)
5
Practice Subdivision in simplices produces too much data.
2018/6/11 Practice Subdivision in simplices produces too much data. Usually, the current 2D algorithm work ok using double precision REALs. No solution for 3D, 2D + time, 3D + time...
6
New Approach (after 20 years!):
2018/6/11 New Approach (after 20 years!): Approximation → big rationals Subdivisions in triangles → convex polytopes as base geometric element Big rationals: rationals (exactly homogenous coordinates) represented with big integers (i.e. integers which grow in size, limited only by size of memory)
7
Big Rationals Precise representation of straight line geometry.
2018/6/11 Big Rationals Precise representation of straight line geometry. a/b * b = a (still not invariant under rotation) Contrary to (old) published reports, comparable speed to DOUBLE up to 100 digits length.
8
2018/6/11 Convex polytopes Fundamental geometric operations on geometric figures: Intersection Union Intersection of convex polytope is convex! Union – Intersection are dual!
9
Representation of Convex Polytopes
2018/6/11 Representation of Convex Polytopes Represented as collection of points (in any dimension) Other representations (e.g. faces, edges) follow with convex hull algorithm (efficient, well known) Algorithm for n-D (using category theory and functional programming language)
10
Not all objects are convex!
2018/6/11 Not all objects are convex! Geometries with holes, non-convex figures: Take convex hull. Too much: subtract convex hull of what is too much. Too little now: add convex hull of what has been subtracted too much...
11
Level of detail (LoD) Representation
2018/6/11 Level of detail (LoD) Representation Representation can be used for a gradual (level of detail) rendering: Stop when enough detail is found.
12
INTRODUCTION Intersection Problem
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Intersection Problem Intersection computation Intersection detection Intersection computation – a fundamental operation Given two polygons (convex/nonconvex, with or without holes) compute the intersection region; Intersection computation is one of the fundamental operations of computational geometry. It provides basis for computing other Boolean operations like union and difference etc. Also, it is the most expensive operation computationally, roughly taking 80 % of the running time. The intersection operation has two problems, intersection detection and intersection computation. The intersection detection between two convex objects is a basic geometric operation (Chazelle and Dobkin 1987) and a great account of the topic can be found in (David 1997). We are not focusing on the issue of intersection detection and for simplicity we assume hereafter that the objects under consideration for intersection computation do intersect. The Problem: Given two polygons (convex or nonconvex, with nonintersecting edges, and with or without holes), compute the intersection region that may be; Empty (Figure 1 left most) Convex (Figure 2 second from left) Nonconvex (Figure 3 second last from left) A set of convex and/or nonconvex disjoint regions (Figure 4 right most) This paper presents an algorithm for intersection computation between two polygons (convex/nonconvex, with nonintersecting edges, and with or without holes). The approach is based on AHD. 12/17
13
AHD Alternate Hierarchical Decomposition Approach
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Approach Recursive Convex hull tree, CHT Dimension Independence Convex hull computation Use any existing algorithm AHD is a recursive approach whose implementation is robust, efficient and scalable to any dimensions. AHD decomposes the given nonconvex polytope into a set of component convex hulls that are represented hierarchically in a convex hull tree, CHT. CHT is a tree of convex hulls in which the root node contains the convex hull of the input polytope, non- leaf nodes contain convex hulls of the nonconvex delta regions (notches) of the nonconvex structure whose convex hull is represented by parent node. Leaf nodes contain the convex hulls of the convex delta regions. The positively signed convex hulls represent the convex regions to be included while the negatively signed convex hulls represent convex regions to be excluded. The AHD consists of two steps: (1) convex hull computation, and (2) delta region/s extraction (using symmetric difference). The process is then recursively applied to the delta regions until the input region is convex. Delta region extraction Symmetric difference Split connected regions 13/17
14
AHD Alternate Hierarchical Decomposition- Example Hole
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Hole Convex Hull Tree, CHT Suppose that we are given a 2-D nonconvex polytope with a hole (H) in dual space (as shown in Fig. top left) as input. The application of AHD results in the decomposition of the input into its component convex hulls (Fig. bottom left). The complete AHD process is illustrated in (Fig. right). 14/17
15
INTERSECTION Assumptions Flat objects Simple
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Flat objects Simple Intersection detection – not addressed May contain holes or nested holes “Left handed rule” for edge representations – counterclockwise orientation Our approach for intersection computation between geometric objects is based on following assumptions and simplifications; The objects are flat objects i.e. lines, polygons and polyhedra. For demonstration purposes we will confine ourselves to 2D polygons only. The objects are simple polygons although the solution can handle self intersecting edges with few modifications (section 9). We are focusing on the intersection computation problem. The intersection detection problem is not considered that itself is a challenging problem and algorithms exist in literature (e.g. (Chazelle and Dobkin 1987; Shamos and Hoey 1976)). The objects may contain holes or nested holes e.g. a hole within a hole in which case the two regions have opposite orientation of edges. In Figure 2a, region 5 is within region 4 and both have opposite orientation. The edge representations are based on “Left-handed” rule, the boundary edges are oriented anticlockwise while the hole edges are oriented clockwise. A region is represented by a single or multiple polygons. We have demonstrated our solution for intersection computation on a pair of polygons. Our solution is extendible for intersection computation involving more than two polygons. Demonstrated here for a pair of polygons- extendible for multiple polygons 15/17
16
INTERSECTION Our Approach 16/17 2018/6/11 INTRODUCTION AHD ASSUMPTIONS
SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The closure of the basic intersection operation (Convex-convex intersection, CCINT) over convex sets is the most important property. Thus our approach exploits this property for computing convex-nonconvex Intersection, CNINT, by recursively applying CCINT between convex hull of the convex object and the component convex hulls of the nonconvex object. Similarly, the intersection between two nonconvex polygons (Nonconvex-nonconvex intersection, NNINT) is computed by recursively traversing CHT of one of the nonconvex objects with CNINT. The NNINT is the generic intersection operation, GINT, because it deals all the three cases as it is based on CNINT, which in turn is based on CCINT as shown in Figure 3. 16/17
17
INTERSECTION Convex Convex 17/17 2018/6/11 INTRODUCTION AHD
ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The basic operation is closed under intersection and the result is always a convex region. The intersection computation between two convex polygons is the basic operation (for which known solutions exist). Any of the existing solutions can be used but we have provided an algorithm for intersection computation between two convex polygons using convex hulls. Figure shows two convex polygons and demonstrates their intersection at data structure level. 17/17
18
INTERSECTION Convex-convex : Algorithm 18/17 2018/6/11 INTRODUCTION
AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES We have provided an algorithm for convex-convex intersection, the pseudocode of which is provided. The algorithm uses the QuickHull algorithm (O'Rourke 1998) for convex hull computation and compIntPoints routine computes the intersection points by pairing the intersecting delta edges. 18/17
19
INTERSECTION Convex Nonconvex 19/17 2018/6/11 INTRODUCTION AHD
ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The process of intersection computation between a convex polygon and a nonconvex polygon involves the repeated application of basic operation between the convex hull of the convex polygon and the convex hull components of the nonconvex polygon that are traversed recursively in CHT. The resulting convex hull of each basic operation is then placed in the resultant CHT at position same as the position of component convex hull of the nonconvex polygon involved in the basic operation. The further recursive processing of children trees of a component convex hull is stopped if the basic operation involving that component convex hull is null. This avoids unnecessary computations reducing the overall number of operations. Figure (top left) shows a convex polygon A and a nonconvex polygon B with their components numbered. Figure (top middle) shows the data structure representation of the input polygons A and B. The process starts by computation of basic operation between convex hull of convex polygon A (that is a1) and the convex hull of the nonconvex polygon B (that is the root b1). Since b1, the component convex hull of the nonconvex polygon is at root the result of basic operation between a1 and b1 will form the root of the resultant CHT as shown in (top right). The process is then recursively applied to the children trees of b1. Since the intersection between convex hull a1 and b3 is null, the child tree of b3 containing convex hull b4 will not be processed further (Figure bottom middle). The resultant intersection is a nonconvex region that is represented by two convex hull components as shown in Figure (bottom left). The processing (merging) of the resultant CHT, containing two component convex hulls results in the resultant intersection region as shown in Figure (bottom right). a1 b1 a1 b2 19/17
20
INTERSECTION Convex-nonconvex: Algorithm 20/17 2018/6/11 INTRODUCTION
AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The intersection operation between a convex and a nonconvex polygon is not closed under intersection. The pseudocode of the CNINT is shown. 20/17
21
INTERSECTION Nonconvex Nonconvex 21/17 2018/6/11 INTRODUCTION AHD
ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The intersection operation for a convex polygon and a nonconvex polygon is used to compute the intersection between two nonconvex polygons represented by CHTs. Suppose two intersecting nonconvex polygons A and B. The decomposed convex hull components of both nonconvex polygons and their CHTs are shown in Figure (Fig left top). The intersection process starts by taking the convex-nonconvex intersection between convex hull of nonconvex polygon B (b1) and the CHT of the nonconvex polygon A ( Fig left middle). Since the intersection between b1 and a2 convex components is null the result is a single node CHT having the convex hull (a1∩ b1) which is then intersected recursively with all the children trees of convex hull b1 of the nonconvex polygon B. Since, b1 has only one child (which is also a single node representing a convex hull) the intersection of (a1∩b1) and child tree (Fig left bottom) results in a convex hull (a1∩b2) represented in a single node CHT as shown in Fig left bottom . The resultant CHT containing (a1∩b2) is then added (grafted) back to the parent intersection CHT containing single node (a1∩b1). Thus, the result is a nonconvex region shown as shaded (in yellow) in Fig (left top) and the resultant CHT shown in Fig (rightmost) If the result of convex-nonconvex intersection is a set of disjoint regions (a set of CHTs, each representing a region) then for each CHT of the disjoint region, the same process is repeated independently of the other CHTs representing the disjoint intersection regions. 21/17
22
INTERSECTION Generic Intersection - Algorithm 22/17 2018/6/11
INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES The nonconvex-nonconvex intersection is implemented as a generic intersection operation, the pseudocode of which is shown. The algorithm for generic intersection operation incorporates the previous two intersection operations. It is generic in the sense that it computes the intersection of two polygons (convex or nonconvex and with or without holes). 22/17
23
INTERSECTION Our Approach - Example 23/17 2018/6/11 INTRODUCTION AHD
ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES r1 r2 Here we give a demostrative example of the Generic intersection algorithm. For Figure From left to right (top row) Input polygons (b) Decomposed input (c) CNINT of CHT of A and convex hull of B (d) Result of (c) (e) Result in (c) is simplified and two disjoint regions result From left to right (bottom row) r1 ∩ first child of B (g) Result of (f) (h) Remove (g) from r1 (i) Result in (h) ∩ second child tree of B 23/17
24
INTERSECTION Our Approach - Example Result: set of disjoint regions
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Result: set of disjoint regions For Figure From left to right (top row) (j) r2 ∩ first child of B (k) Result of (j) (l) Remove result in (k) from r2 From left to right (bottom row) (m) Result in (l) ∩ second child tree of B (n) Result of (m) (o) Remove (n) from (l) (p) Disjoint intersection regions 24/17
25
INTERSECTION Special Cases 25/17 2018/6/11 INTRODUCTION AHD
ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Case Specially treated? Complete overlap No One is inside other Edges overlap Points overlap Intersection is a line Yes Intersection is a point The intersection of two polygons may be a point (left bottom), a line (lef middle), polygon or a combination consisting of the three (right middle). In cases where the intersection region is not a polygon or a set of polygons, special treatment is needed. A variety of special cases for the basic intersection have been shown in (O'Rourke 1998) and few are shown in Figure. Since our approach is based on basic intersection operation, we need not to tackle the special cases for convex-nonconvex or nonconvex-nonconvex intersection operations. If the special cases are tackled for basic operation, other operations based on it will also tackle the special cases. For special cases like complete or partial overlap our approach do not need any special treatment. However, for cases when the intersection is a point or a line we need special treatment which is achieved by making changes not in the main intersection algorithms but in the QuickHull module and the build function of the AHD process. Table 2 lists special cases and whether these cases are specially treated in our algorithm or not. 25/17
26
INTERSECTION Conclusion Improvements and Future Work
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Based on basic intersection operation between two convex hulls Dimension independent Ease of implementation – Haskell Numerical robustness Hierarchical tree data structure, CHT CHT allows reduced number of computations Deals most special cases Useful for applications where decomposed output is needed Basic Operation:Our approach is based on the basic intersection operation between two convex polygons. Thus it exploits the benefits associated with convexity. Dimension Independent:Uses convex polytopes (convex hulls in dual space), so it is easily extendible for n-dimensions. Dimension independent implementation of AHD has been already been implemented and published (GeoComputation 2009, UNSW Sydney, Australia, December 2009 ). Ease of implementation-Haskell: Our approach is easily implementable. The approach is implemented in Haskell (Jones 2003) It is a functional programming language that supports lazy evaluation, higher order functions, and big numbers (big integers, big rational etc.). The code is compact having only 137 lines of code. Less code means less errors and ease of maintenance. The CCINT and CNINT operations are computed by recursively traversing the CHT of nonconvex polygon using map higher order function. Also, all the points are represented by their homogenous big integer coordinates. Numerical robustness: Big integers in Haskell are represented as “Integer” data type and they allow arbitrary precision arithmetic limited by the size of the main memory. Thus, the use of big integers allows robust intersection computations operations avoiding rounding errors. Robustness is an important issue in geometric computations (David 1997). CHT:It uses a single hierarchical tree data structure called convex hull tree which is an arbitrary tree of convex hulls. The data structure has two methods build and process for populating and accessing the stored data in the data structure. Reduced No. of computations:The tree data structure allows reduced number of computations. We process the children trees of a node only if the intersection is not null. We proceed in a branch in CHT if the intersection is not null. Rule is “an object A can not intersect with the component hulls of object B, if object A is not intersecting with the convex hull of object B”. Special cases:Most of the special cases need no special treatment like overlapping edges etc. Some require few modifications like when the result has dangling edges or points etc. Decomposed output:In some applications, the result of Boolean operation may be needed to be decomposed e.g. Vatti (1992) mentions a case when decomposed output is useful. So our approach is useful for applications where the decomposed output is needed in the form of convex components. Improvements and Future Work: The approach can be improved by slight modifications. For example; For cases where region is represented by multiple polygons we have to make the representation of a polygonal region as a list of convex hull trees rather than a tree. For the self intersection cases, some preprocessing can be done involving the computation of intersection points of intersecting edges, updating the intersecting edges and then ultimately segregating the closed regions formed, so as to represent it with multiple simple polygons. The idea is to convert/decompose a nonsimple polygon with multiple simple polygons or use any established method to deal nonsimplicity first and then continue with our solution. The future goal is to devise a solution which has following properties; Supports other Boolean operations union and symmetric difference etc. We have implemented the union and symmetric difference operations based on AHD and the work will be presented soon. Since AHD is dimension independent having single implementation, we are currently looking at the implementation of AHD as a an addition to the existing geometric model of cityGML (which is based on the GML3 geometric model). Improvements and Future Work Multiple polygons Non simple polygons Other Boolean operations – Union, Symmetric difference, Point in a polygon City modelling 26/17
27
INTERSECTION References 27/17
2018/6/11 INTRODUCTION AHD ASSUMPTIONS SPECIAL CASES OUR APPROACH CONCLUSION REFERENCES Chazelle, B. and D. P. Dobkin "Intersection of convex objects in two and three dimensions." Journal of the ACM (JACM) 34(1):1-27. David, M. Mount "Geometric intersection." In Handbook of discrete and computational geometry: CRC Press, Inc. Bulbul, Rizwan and Andrew U. Frank "AHD: The Alternate Hierarchical Decomposition of Nonconvex Polytopes (Generalization of a Convex Polytope Based Spatial Data Model)." In 17th International Conference on Geoinformatics. Fairfax, USA. Shamos, Michael Ian and Dan Hoey "Geometric intersection problems." In Proceedings of the 17th Annual Symposium on Foundations of Computer Science: IEEE Computer Society. O'Rourke, Joseph Computational Geometry in C (Cambridge Tracts in Theoretical Computer Science): Cambridge University Press. Jones, Simon Haskell 98 Language and Libraries: The Revised Report: {Cambridge University Press}. Bulbul, Rizwan, Farid Karimipour and Andrew Frank "A Simplex based Dimension Independent Approach for Convex Decomposition of Nonconvex polytopes." In 10th lnternational Conference on GeoComputation (GeoComputation 2009). UNSW, Sydney, Australia. Vatti, Bala R "A Generic Solution to Polygon Clipping." Communications of the ACM 35(7):57-63. Some of the references of the paper referred in the presentation notes are shown here. Rest can be found in the paper. 27/17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.