Unformatted text preview: UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry
Prof. Karen Daniels
Spring, 2010 O'Rourke Chapter 7 Search & Intersection Chapter 7 Search & Intersection
Segment-Segment Intersection Segment-Triangle Intersection Point in Polygon Point in Polyhedron Intersection of Convex Polygons Intersection of Segments Intersection of Nonconvex Polygons Extreme Point of Convex Polygon Extremal Polytope Queries Planar Point Location Segment-Segment Intersection Finding the actual intersection point Approach: parametric vs. slope/intercept parametric generalizes to more complex Parameterize each segment Lcd c a Lab b d intersections Lcd c C=d-c Lab b q(t)=c+tC d A=b-a a p(s)=a+sA Intersection: values of s, t such that p(s) =q(t) : a+sA=c+tC Segment-Triangle Intersection Determine if qr intersects plane containing triangle T. Let N=(A,B,C) be normal to :(x,y,z) (A,B,C)=D (i.e. = Ax + By + Cy = D) Find normal N using cross-products involving a, b, c parameterize qr: p(t) = q + t(r-q) D - (q N ) solve for t : t = (r - q) N using t, find point of intersection p if it exists p is in T iff its projection p' is in a projection* T' of T +-to xy, xz or yz-plane r c a T N p b q Classify relationship between p and T Barycentric coordinates Check results of 3 "left of edge" tests for p' with respect to T': +++ means p' inside T'. * avoid degeneracy by projecting out largest coordinate +-+ ++T' +++ -+- -++ --+ Point in Polygon q P Winding number Ray crossings standing at q, turn to follow border of P sum rotation to create signed angular turn + ccw - cw divide by 2 elegant but not practical: O(n) with large constant extend horizontal ray from q count number of intersections with P beware degenerate intersections!
O(n) even odd q is outside P q is inside P q P Compare with using LeftOn test when polygon is convex Point in Polyhedron P q r Winding number generalizes to 3D uses solid angle Assume each face is a triangle. Ray crossing generalizes to 3D (fraction of sphere surface used by cone at point) q inside P if odd number of crossings q outside P if even number of crossings = expected number of tries to get nondegenerate intersection Expected time O( n) Algorithm: POINT in POLYHEDRON (P, R, q) Compute bounding radius R loop forever r0 = random ray of length R r = q + r0 crossings = 0 for each triangle T of polyhedron P do SegTriInt(T, q, r) if degenerate intersection then go back to loop else increment crossings appropriately if crossings odd then q is inside P else q is outside P Exit Intersection of Convex Polygons For nonconvex n-vertex P and m...
View Full Document
- Spring '10
- Algorithms, Polyhedron, Polytope, planar point location, Extremal Polytope Queries