62
Point Location Problem in Computational Geometry I4B01 張張張 Ref: Computational Geometry, Preparata and Shamos, Chap. 2

Point Location Problem in Computational Geometry

  • Upload
    cana

  • View
    59

  • Download
    0

Embed Size (px)

DESCRIPTION

Point Location Problem in Computational Geometry. I4B01 張繼文 Ref: Computational Geometry, Preparata and Shamos, Chap. 2. Topics. Point Location Problem for Polygon Planar Subdivision. Point in Polygon. Single-shot approach Division wedges for the convex inclusion. - PowerPoint PPT Presentation

Citation preview

  • Point Location Problem in Computational GeometryI4B01 Ref: Computational Geometry, Preparata and Shamos, Chap. 2

  • TopicsPoint Location Problem forPolygonPlanar Subdivision

  • Point in PolygonSingle-shot approachDivision wedges for the convex inclusion

  • Problem (polygon inclusion)Given a simple polygon P and a point Z, is Z in P?

  • The single-shot approachIN: odd number of crossingsOUT: even number of crossingsthe result holds for concave polygons tooAssume that L intersects P and that L does not pass any vertex of P.

  • Degenerate CasesIf just one vertex of an edge belongs to L, then it must be counted if it is the vertex with larger ordinate, and ignored otherwiseIf both vertices of an edge belong to L, this edge must be ignoredXXX1,2543

  • TheoremWhether a point Z is internal to a simple N-gon P can be determined in O( N ) time, without preprocessing.

  • Division Wedges for Convex InclusionThe method relies on the convexity of P.The vertices of a polygon occur in angular order about any internal point, Q.Treating Q as the origin of polar coordinates.

  • ProcedureCONVEX INCLUSION1. Given a query point Z, determine by binary search the wedge in which it lies.2. Determine that point Z lies between the rays defined by Pi and Pi+1

  • TheoremThe inclusion question for a convex N-gon can be answered in O( log N ) time, given O( N ) space and O( N ) preprocessing time.

  • A star-shaped polygon

  • TheoremThe kernel Q can be founded in O( N ) time.The inclusion question for an N-vertex star-shaped polygon can be answered in O( log N ) time and O( N ) storage, after O( N ) preprocessing time.

  • Point Location in a planar subdivisionThe slab methodThe chain methodThe triangulation refinement method

  • The slab methodDivide the plane into easily manageable sectionsDivide the graph into slabs. Draw a vertical line through every vertex of the graph

  • The slab methodAll edges intersecting a slab Have no endpoint in the slabDont cross each other

  • Slab Method (cont)Sort vertices in ascending x order.For each interval ( Vi, Vi+1 ), store the segments crossing the interval ordered from top to bottom.For a query pointUse binary search to determine the slab2. Use binary search to determine the face

  • Worst Case in Storage

  • TheoremPoint-location in an N-vertex planar subdivision can be effected in O( log N )time using O( N2 ) storages.

  • The Chain MethodDefinition :A chain C = ( u1, , up ) is a planar straight-line graph with vertex set { u1, , up } and edge set { (ui, ui+1) : i = 1, , p-1 }

  • The Monotone ChainDefinition : A chain C = ( u1, , up ) is said to be monotone with respect to a straight line L if a line orthogonal to L intersects C in exactly one point.

  • Where does the query point lie?

  • A query point lies ?The projection of P on L can be located with a binary search in a unique interval ( L(ui), L(ui+1) )Determine on which side of the line containing uiui+1 the query point lies.

  • The Chain MethodSuppose there is a set C = { C1, , Cr } of a polygon, we can apply the bisection to find the region query point lies.

  • The Chain Method (cont)If there are r chains in C and the longest chain has p vertices, then the search worst-case time is O( log p * log r )

  • Steps to Construct the Chains First, regularize the PSLGSecond, assign weights on the graph using weight-balancing algorithmThird, construct chains by traversing the graph

  • Definitions(for chains monotone w.r.t. y)A vertex vj is said to be regular if there are vertices y(vi) < y(vj) < y(vk) such that ( vi, vj ) and ( vi, vk ) are edges of G.2. Graph G is said to be regular if each yi is regular for 1 < j < N

  • Regularize Nonregular Vertices (remove cusps)Definition: cusp2-pass sweep-line to remove cuspsConnect to the upper end point of the lower neighbor

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Example: cusp removal

  • Weight Assignment of EdgesAll edges satisfy :1. Each edge has positive weight2. For each Vj( j 1, N ), Win(Vi) = Wout(Vj)

    PS. Vin( Vi ) = | IN(v) |Vout( Vi ) = | OUT(v) |

  • WEIGHT-BALANCING REGULAR PSLG1. Initialization Begin for each edge e do W(e) = 12. First passfor( i = 2; i Vout(Vi)) { d1 = leftmost outgoing edge of Vi W(d1) = Win(Vi) Vout(Vi) + 1 }}

  • WEIGHT-BALANCING REGULAR PSLG (cont)3. Second passFor (i = N-1; i >= 2; i--){ Wout(Vi) = sum of weight of outgoing edges of Viif (Wout(Vi) > Win(Vi)) { d2 = leftmost incoming edge of ViW(d2) = Wout(Vi) Win(Vi) + W(d2) }}

  • Example: Initialization

  • Example: 1st passX 23 XX 2if (Win(Vi) > Vout(Vi)) { d1 = leftmost outgoing edge(Vi) W(d1) = Win(Vi) Vout(Vi) + 1}

  • Example: 2nd pass3 Xif (Wout(Vi) > Win(Vi)) { d2 = leftmost incoming edge (Vi) W(d2) = Wout(Vi) Win(Vi) + W(d2) }

  • Example: final result

  • Ex: construct chains2002011000010010000000Start from top; traverse the leftmost possible branch

  • Ex: Polygon and Monotone Chains

  • TheoremTime complexity : O( log2 N )Space complexity : O( N )Preprocessing time: O( N log N ) 1. Sorting N vertex of PSLG in O(NlogN)2. Construct status structure, each node need O(logN)

  • The triangulation refinement methodThe triangles connecting the points satisfies an "empty circle" property: the circumcircle of each triangle does not contain any of the points. It is in some sense the most natural way to triangulate a set of points.

  • Triangulate w/ these 5 points;First insert P5

  • Inserting P2

  • Inserting P3

  • Inserting P1

  • 1716151918Inserting P4

  • The corresponding search-directed tree79105648111213141716151918

  • TheoremPoint location in an N-vertex planar subdivision can be effected in O( log N ) time using O( N ) storage, given O( N log N ) preprocessing time.

  • ExerciseApply the chain method to determine which region the point P lies.

    ABCDEFABCDEFPG