I. The Problem of Molding

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Polygon Triangulation
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 30, D Clipping 1/14 Clipping (pages , )
Computational Geometry
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hull obstacle start end Convex Hull Convex Hull
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
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.
Overlay of Two Subdivisions
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Computational Geometry -- Voronoi Diagram
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Brute-Force Triangulation
Computational Geometry
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
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.
Triangulating a monotone polygon
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Line Arrangement Chapter 6. Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.
1 Computer Graphics Clipping Fall FCC Line Clipping What happens when one or both endpoints of a line segment are not inside the specified drawing.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
Clipping Primitives. Clipping line Clipping rectangle: – x min to x max – y min to y max A point (x,y) lies within a clip rectangle and thus displayed.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Linear Programming Chap 2. The Geometry of LP  In the text, polyhedron is defined as P = { x  R n : Ax  b }. So some of our earlier results should.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Polygon Triangulation
Computational Geometry
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Introduction to Spatial Computing CSE 555
Introduction to Polygons
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
Fill Area Algorithms Jan
Algorithm design techniques Dr. M. Gavrilova
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
The Art Gallery Problem
Craig Schroeder October 26, 2004
Computational Geometry Capter:1-2.1
The Art Gallery Problem
Polygon Triangulation
Depth Estimation via Sampling
Convex Sets & Concave Sets
Prof. Harriet Fell Fall 2011 Lecture 9 – September 26, 2011
CHAPTER 33 Computational Geometry
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
Overlay of Two Subdivisions
Presentation transcript:

I. The Problem of Molding Does a given object have a mold from which it can be removed? Assumptions mold 1 The object is polyhedral. object not removable The mold has only one piece. Spherical objects cannot be manufactured using a mold of one piece. The object should be removed by only a single translation. mold 2 object removable Real screws cannot be removed by just a translation.

Castability How to choose the orientation? The object has a horizontal top facet – the only one not in contact with the mold. # possible orientations = # facets. Because every facet may become horizontal. An object is castable if it is removable from its mold for one of the orientations. How to determine that the object is castable? For each potential orientation, determine whether there exists a direction along which the object can be removed from the mold.

Making Things More Precise polyhedron 𝑃 The mold is a rectangular block with a concavity that exactly matches the polyhedron. top facet Its topmost facet is horizontal and chosen to be 𝒙𝒚-plane. Top facet of the polyhedron is coplanar with the 𝒙𝒚-plane. Ordinary facet 𝒇: a facet of the polyhedron that is not the top. 𝑭 : the facet in the mold that corresponds to 𝒇. Problem Decide whether a direction 𝒅 exists such that 𝑷 can be translated to infinity without colliding with the mold.

Necessary Condition for Removal 𝑑 has a positive z component. polyhedron 𝑃 𝑑 𝑧 The translation of a facet 𝑓 cannot penetrate into the corresponding facet 𝐹 of the mold. 𝑓 𝐹 blocks the translation if 𝑑 forms an angle >/2 with its outward normal. 𝑑 must make an angle >/2 with the outward normal of every facet of 𝑃.  (necessary condition) angle between two vectors  chosen to be in [0, ].

Also a Sufficient Condition Theorem The polyhedron can translate out of the mold in a direction 𝑑 iff 𝑑 makes an angle >/2 with the outward normal of all facets except the top one. Proof () By contradiction. Suppose 𝑑 makes an angle </2 with the outward normal of some facet 𝑓. Then any interior point of 𝑓 collides with the mold in the translation. () By contradiction. 𝑓 Suppose 𝑃 collides with the mold translating in direction 𝑑. 𝑃 𝑑 Let 𝑝 be the point on 𝑃 that collides with a facet 𝐹 of the mold. 𝑝 is about to move into the interior. 𝐹 𝑝 The outward normal 𝑛 of 𝐹 makes an angle >/2 with 𝑑. 𝑛 The outward normal of 𝑓 makes an angle </2 with 𝑑. #

One Trans. vs. Multiple Trans. Polyhedron removable by a sequence of translations.  There exists at least one direction 𝑑 which makes an angle  /2 with the outward normal of every polyhedron face.  Removable along the direction 𝑑. Allowing for multiple translations does not help.

Representing a Direction 𝑑 to make angle  /2 with the normal of every facet. 𝑧 𝑧=1 Every point (𝑥,𝑦,1) represents a direction. 𝑑 𝑦 𝑥 The set of all directions with a positive 𝑧 component is represented by the plane 𝑧=1.

Geometric Interpretation Let 𝑑=( 𝑑 𝑥 , 𝑑 𝑦 , 1). Let 𝑛=( 𝑛 𝑥 , 𝑛 𝑦 , 𝑛 𝑧 ) be the outward normal of one facet. Then 𝑧 𝑛 ∙ 𝑑 = 0 𝑧 =1 variables 𝑛 an area to one side of the line 𝑛∙𝑑 = 0 on the plane 𝑧 = 1 (the 𝑑 𝑥 - 𝑑 𝑦 plane) 𝑦 𝑥 when the facet is horizontal ( 𝑛 𝑥 = 𝑛 𝑦 =0), the constraint is either true for all 𝑑 or false for all 𝑑 (easy to verify).

Geometric Formulation Every non-horizontal facet defines a closed half-plane of 𝑧=1. The intersection of all such half-planes is the set of points that correspond to a direction in which the polygon can be removed. Given a set of half-planes, compute their common intersection. Castability test: Enumerate all facets as top facet. This can be done in expected time 𝑶( 𝒏 𝟐 ) and 𝑶(𝒏) storage. If 𝑷 is castable, a mold and a removal direction can be computed within the same time bound.

II. Intersection of Half-Planes ℎ 𝑖 : 𝑎 𝑖 𝑥 + 𝑏 𝑖 𝑦  𝑐 𝑖 1  𝑖  𝑛 each a convex set! Their intersection must be a convex set, more specifically, A convex polygonal region. At most 𝑛 edges. May be unbounded May degenerate into a line, segment, a point, or an empty set.

Some Possible Cases

A Divide-and-Conquer Algorithm IntersectHalfplane(𝐻) Input: A set 𝐻 of 𝑛 half-planes in the plane Output: The convex polygon region 𝐶 = ∩ℎ if |𝐻| = 1 then 𝐶  the unique half-plane ℎ  𝐻 else split 𝐻 into sets 𝐻 1 and 𝐻 2 of size 𝑛/2 and 𝑛/2. 𝐶 1  IntersectHalfplane( 𝐻 1 ) 𝐶 2  IntersectHalfplane( 𝐻 2 ) 𝐶  IntersectConvexRegion( 𝐶 1 , 𝐶 2 ) ℎ𝐻

Intersection of Convex Regions The intersection of two polygons in 𝑂((𝑛+𝑘) log⁡𝑛) time. #vertices #intersections Modify the algorithm to intersect two convex regions. Every intersection 𝑣 of an edge of one region with an edge of the other must be a vertex of the intersection region. 𝑣 The intersection region has  𝑛 edges and vertices.  𝑘  𝑛  IntersectConvexRegion takes time 𝑂(𝑛 log⁡𝑛).

The Recurrence Let 𝑇(𝑛) be the running time. 𝑂(1) if 𝑛= 1 𝑇(𝑛) = IntersectHalfplane(𝐻) Input: A set 𝐻 of 𝑛 half-planes in the plane Output: The convex polygon region 𝐶 = ∩ℎ if |𝐻| = 1 then 𝐶  the unique half-plane ℎ  𝐻 else split 𝐻 into sets 𝐻 1 and 𝐻 2 of size 𝑛/2 and 𝑛/2. 𝐶 1  IntersectHalfplane( 𝐻 1 ) 𝐶 2  IntersectHalfplane( 𝐻 2 ) 𝐶  IntersectConvexRegion( 𝐶 1 , 𝐶 2 ) // 𝑇(𝑛/2) // 𝑇(𝑛/2) // 𝑂(𝑛 log⁡𝑛) 𝑂(1) if 𝑛= 1 𝑇(𝑛) = 𝑂(𝑛 log⁡𝑛) + 2𝑇(𝑛/2), if 𝑛> 1.  𝑇(𝑛) = 𝑂(𝑛 log 2 ⁡𝑛)

Improvement Can we do better? Yes! The subroutine for intersection of convex regions is a transplant from that for intersecting two simple polygons. We made use of the convexity in our analysis. But we haven’t taken full advantage of convexity yet … Yes! Assumption (non-degeneracy): The regions to be intersected are 2-dimensional. (The degenerate cases are easier.)

Representing a Convex Region Left and right boundaries as sorted lists of half-planes during traversals from top to bottom. ℎ 1 ℎ 2 𝐶 ℎ 5 Denote the two lists by 𝐿 and 𝑅. ℎ 3 right boundary left boundary ℎ 4 Vertices can be easily computed by intersecting consecutive bounding lines. But they are stored explicitly. ℎ 6 𝐿(𝐶) : , ℎ 1 ℎ 5 , ℎ 4 A horizontal edge, if exists, belongs to the left boundary if bounding 𝐶 from above and to the right boundary otherwise. 𝑅(𝐶) : ℎ 2 , ℎ 3 , ℎ 6

Plane Sweep Again Assumption: no horizontal edge (easy to dealt with if not true). Sweep downward to merge two convex regions 𝐶 1 and 𝐶 2 . At most four edges intersecting the sweep line. l_e_C1, r_e_C1, l_e_C2, r_e_C2 Corresponding pointer set to nil if no intersection. 𝐶 1 r_e_C1 l_e_C1 r_e_C2 = nil l_e_C2 𝐶 2

No Event Queue Start at Next event point: the 𝑦-coordinate of the highest vertex of the two chains, or ∞ if one chain has one edge extending upward. Next event point: Highest of the lower endpoints of the four edges that intersect the sweep line. 𝑂(1) The new edge e is one of the following: 1. part of 𝐶 1 and on the left chain 2. part of 𝐶 1 and on the right chain 3. part of 𝐶 2 and on the left chain 4. part of 𝐶 2 and on the right chain

Left Boundary of Chain 1 𝑝: upper endpoint of 𝑒. Three possible cases involving 𝑒 and 𝑝 in the intersection 𝐶: 𝑝 lies inside 𝐶 2 𝑒 𝑝  𝐶 has an edge with 𝑝 as the upper endpoint. This can be determined by checking whether p is between l_e_C2 and r_e_C2. Add the half-plane with 𝑒 part of its boundary to the list 𝑳. 𝑒 l_e_C2 𝑝 𝑒 intersects l_e_C2. 𝑝 l_e_C2 𝑒  the intersection is a vertex of 𝐶.  the edge of 𝐶 starting at the vertex is either part of 𝑒 or l_e_C2. Add the appropriate edge(s) to the list 𝑳. 2 new edges

cont’d e intersects r_e_C2. 𝑝 𝑒 r_e_C2 𝑒 r_e_C2  both edges contributing an edge to 𝐶 starting at the intersection. Case 1. The new edges start at the intersection. Add the half-plane defining 𝑒 to 𝑳 and the one defining r_e_C2 to 𝑹. Case 2. The new edges end at the intersection. Do nothing because these edges have been discovered.

Running Time It takes 𝑂(1) time to handle an edge. Intersection of two convex polygonal regions takes 𝑂(𝑛) time. Recurrence for the total running time: 𝑇(𝑛) = 𝑂(1) if 𝑛=1 𝑂(𝑛)+2𝑇(𝑛/2), if 𝑛 > 1.  𝑇(𝑛)=𝑂(𝑛 log⁡𝑛) Theorem The common intersection of 𝑛 half-planes in the plane can be computed in 𝑂(𝑛 log⁡𝑛) time and 𝑂(𝑛) storage.