Compaction Algorithms for Non- Convex Polygons and Their Applications

Total Page:16

File Type:pdf, Size:1020Kb

Compaction Algorithms for Non- Convex Polygons and Their Applications Compaction Algorithms for Non- Convex Polygons and Their Applications The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters Citation Li, Zhenyu. 1994. Compaction Algorithms for Non-Convex Polygons and Their Applications. Harvard Computer Science Group Technical Report TR-15-94. Citable link http://nrs.harvard.edu/urn-3:HUL.InstRepos:25619464 Terms of Use This article was downloaded from Harvard University’s DASH repository, and is made available under the terms and conditions applicable to Other Posted Material, as set forth at http:// nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of- use#LAA Compaction Algorithms for NonConvex Polygons and Their Applications A thesis presented by Zhenyu Li to The Division of Applied Sciences in partial fulllment of the requirement for the degree of Do ctor of Philosophy in the sub ject of Computer Science Harvard University Cambridge Massachusetts May c by Zhenyu Li All rights reserved Contents List of Figures Introduction Automated Marker Making Cutting and Packing Problems Twodimensional Packing and Marker Making Pro ject Background Problem Representation for Marker Making Compaction Description and Examples Motivation Denitions and a Lower Bound Related Work Contribution A PositionBased Optimization Mo del A VelocityBased Optimization Mo del Complexity Organization of the Thesis Compaction Using a VelocityBased Optimization Mo del High Level Description of the Compaction Algorithm Collision Detection Collision Detection For Two Translating Polygons A Collision Detection Algorithm Finding Vertexedge Touching Pairs Type of Contact A Simple Algorithm A Sweepline Algorithm An Alternative Algorithm Nonp enetration Constraints Bounds on the Velocities NonPenetration Constraints for VertexVertex Contacts Performance The Theory of Minkowski Sum and Dierence Background Polygon Intersection and Containment Problems Conguration Space Approach Denitions and Prop erties Applications Intersection and Containment Intersection Containment Algorithms for Computing Minkowski Sums Convex Polygons Simple Polygons Starshap ed Polygons Monotone Polygons Compaction Using a PositionBased Optimization Mo del The Theory of a PositionBased Optimization Mo del NonOverlapping Conditions for Two Translating Polygons A Lo cality Heuristic Linear Constraints with the Boundaries of the Container The Positionbased Compaction Algorithm Running Time and Robustness Compaction Functions Leftward Compaction Vector Compaction Bumping Gravity Compaction Separation of Overlapping Polygons and Database Driven Marker Mak ing Denition and Complexity Algorithm for Separating Overlapping Polygons Layout Made Easy Database Driven Automated Marker Making Shap e Matching Criteria An Example Cut Planning Compaction with Small Rotations Rotational Compaction by Relaxation Translational Relaxation of a Single Polygon Rotational Compaction of a Single Polygon Algorithm for Rotational Compaction Using Relaxation Rotational Compaction Using Linearization Formulation for Translation Only Compaction Other VertexEdge Supp orting Pair Linearization The Algorithm Examples Comparison of the Two Rotational Compaction Metho ds Floating Distance Between Polygons Controlling the Distance Between Polygons Linear Constraints for Floating Maximize the Minimum Distance Between Polygons Separating Polygons by a Sp ecic Distance Maximizing the Overall Distance b etween Polygons Uniform Distribution of Free Areas Maximize the Minimum Distance Between Polygons An Alternative Metho d Floating For Overlapped Layouts Mixed Integer Programming Mo del for Compaction and TwoDimensional Packing Limitation of the Lo cality Heuristic MIP Formulation for Optimal TwoDimensional PackingCompaction Algorithms for Finding Convex Covering MIP Formulation for Multiple Containment Problem The Complexity of the Compaction Problem Introduction The PSPACEHardness of Compaction Review of the Warehouseman Problem PSPACEhardness Pro of Compaction in an Exp onential Number of Moves Finding a Lo cal Minimum Requires an Exp onential Number of Moves Conclusion A Vectors and Cross Pro ducts Bibliography List of Figures A human generated pants marker in apparel manufacturing Marker co ordinate systems and p oints on the b oundary of a piece Another leftward compaction example General compaction minimizing the area of the b ounding rectangle Strip compaction minimizing the length of a xed width b ounding rectangle Reduction of strip compaction to general compaction Reduction of PARTITION to strip compaction An example of vertexedge contact An example of vertexvertex contact a The vertex A of P touches the edge BC of Q P moves with velocity u and Q moves with velocity v b The p osition of P and Q after time interval t A vertexedge supp orting pair The Minkowski sum for a circle and a square The Minkowski sum and intersection detection Minkowski sum and nonoverlapping placement The Minkowski dierence and p olygon containment problem The Minkowski sum of two starshap ed p olygons The nearest convex region in the exterior of the Minkowski sum An example of leftward compaction input An example of leftward compaction output The human generated pants marker in Figure after leftward compaction Left A human generated pants marker RightThe human generated marker after compaction An example of vector compaction An example of op ening a gap An example of gravity compaction Reduction of PARTITION to separation of overlapping p olygons Minkowski sum of two slightly overlapped p olygons Marker generated by matching and substitution Marker after elimination of overlaps and leftward compaction Length in eciency Marker after adjustment on small p olygons Length in eciency The corresp onding marker generated by a human Length eciency An example of translational relaxation for p olygon An example of rotational relaxation for p olygon An example of rotational compaction using relaxation a human generated marker and the result rotational compaction using relaxation An.
Recommended publications
  • 3 Polygons in Architectural Design
    ARTS IMPACT LESSON PLAN Vis ual Arts and Math Infused Lesson Lesson Three: Polygons in Architectural Design Author: Meredith Essex Grade Level: Fifth Enduring Understanding Polygons are classified according to properties and can be combined in architectural designs. Lesson Description (Use for family communication and displaying student art) Students praCtiCe drawing a variety of geometriC figures using math/arChitectural drawing tools. Students then observe, name, and Classify polygons seen in urban photos and arChitectural plans. Students design a bridge, tower, or building combining three different kinds of triangles and three different kinds of quadrilaterals. Pencil drawings are traced in pen, and arChiteCtural details/ patterns are added. Last, students reflect on and Classify 2-dimensional figures seen in their arChiteCtural designs. Learning Targets and Assessment Criteria Target: Classifies 2-dimensional figures. Criteria: Identifies and desCribes polygon figures, and properties of their sides, and angles seen in art. Target: Combines polygons in an arChiteCtural design. Criteria: Designs a structure made of straight sided shapes that include three kinds of triangles and three kinds of quadrilaterals. Target: Refines design. Criteria: TraCes over drawing in pen, adds arChiteCtural details and patterns. Target: Uses Craftsmanship. Criteria: Uses grid, rulers, and templates in drawing design. Vocabulary Materials Learning Standards Arts Infused: Museum Artworks or Performance: WA Arts State Grade Level Expectations GeometriC shape
    [Show full text]
  • GPU Rasterization for Real-Time Spatial Aggregation Over Arbitrary Polygons
    GPU Rasterization for Real-Time Spatial Aggregation over Arbitrary Polygons Eleni Tzirita Zacharatou∗‡, Harish Doraiswamy∗†, Anastasia Ailamakiz, Claudio´ T. Silvay, Juliana Freirey z Ecole´ Polytechnique Fed´ erale´ de Lausanne y New York University feleni.tziritazacharatou, anastasia.ailamakig@epfl.ch fharishd, csilva, [email protected] ABSTRACT Not surprisingly, the problem of providing efficient support for Visual exploration of spatial data relies heavily on spatial aggre- visualization tools and interactive queries over large data has at- gation queries that slice and summarize the data over different re- tracted substantial attention recently, predominantly for relational gions. These queries comprise computationally-intensive point-in- data [1, 6, 27, 30, 31, 33, 35, 56, 66]. While methods have also been polygon tests that associate data points to polygonal regions, chal- proposed for speeding up selection queries over spatio-temporal lenging the responsiveness of visualization tools. This challenge is data [17, 70], these do not support interactive rates for aggregate compounded by the sheer amounts of data, requiring a large num- queries, that slice and summarize the data in different ways, as re- ber of such tests to be performed. Traditional pre-aggregation ap- quired by visual analytics systems [4, 20, 44, 51, 58, 67]. proaches are unsuitable in this setting since they fix the query con- Motivating Application: Visual Exploration of Urban Data Sets. straints and support only rectangular regions. On the other hand, In an effort to enable urban planners and architects to make data- query constraints are defined interactively in visual analytics sys- driven decisions, we developed Urbane, a visualization framework tems, and polygons can be of arbitrary shapes.
    [Show full text]
  • Representing Whole Slide Cancer Image Features with Hilbert Curves Authors
    Representing Whole Slide Cancer Image Features with Hilbert Curves Authors: Erich Bremer, Jonas Almeida, and Joel Saltz Erich Bremer (corresponding author) [email protected] Stony Brook University Biomedical Informatics Jonas Almeida [email protected] National Cancer Institute Division of Cancer Epidemiology & Genetics Joel Saltz [email protected] Stony Brook University Biomedical Informatics Abstract Regions of Interest (ROI) contain morphological features in pathology whole slide images (WSI) are [1] delimited with polygons .​ These polygons are often represented in either a textual notation (with the ​ array of edges) or in a binary mask form. Textual notations have an advantage of human readability and portability, whereas, binary mask representations are more useful as the input and output of feature-extraction pipelines that employ deep learning methodologies. For any given whole slide image, more than a million cellular features can be segmented generating a corresponding number of polygons. The corpus of these segmentations for all processed whole slide images creates various challenges for filtering specific areas of data for use in interactive real-time and multi-scale displays and analysis. Simple range queries of image locations do not scale and, instead, spatial indexing schemes are required. In this paper we propose using Hilbert Curves simultaneously for spatial indexing and as a polygonal ROI [2] representation. This is achieved by using a series of Hilbert Curves ​ creating an efficient and inherently ​ spatially-indexed machine-usable form. The distinctive property of Hilbert curves that enables both mask and polygon delimitation of ROIs is that the elements of the vector extracted ro describe morphological features maintain their relative positions for different scales of the same image.
    [Show full text]
  • Efficient Clipping of Arbitrary Polygons
    Efficient clipping of arbitrary polygons Günther Greiner Kai Hormann · Abstract Citation Info Clipping 2D polygons is one of the basic routines in computer graphics. In rendering Journal complex 3D images it has to be done several thousand times. Efficient algorithms are ACM Transactions on Graphics therefore very important. We present such an efficient algorithm for clipping arbitrary Volume 2D polygons. The algorithm can handle arbitrary closed polygons, specifically where 17(2), April 1998 the clip and subject polygons may self-intersect. The algorithm is simple and faster Pages than Vatti’s algorithm [11], which was designed for the general case as well. Simple 71–83 modifications allow determination of union and set-theoretic difference of two arbitrary polygons. 1 Introduction Clipping 2D polygons is a fundamental operation in image synthesis. For example, it can be used to render 3D images through hidden surface removal [10], or to distribute the objects of a scene to appropriate processors in a multiprocessor ray tracing system. Several very efficient algorithms are available for special cases: Sutherland and Hodgeman’s algorithm [10] is limited to convex clip polygons. That of Liang and Barsky [5] require that the clip polygon be rectangular. More general algorithms were presented in [1, 6, 8, 9, 13]. They allow concave polygons with holes, but they do not permit self-intersections, which may occur, e.g., by projecting warped quadrilaterals into the plane. For the general case of arbitrary polygons (i.e., neither the clip nor the subject polygon is convex, both polygons may have self-intersections), little is known. To our knowledge, only the Weiler algorithm [12] and Vatti’s algorithm [11] can handle the general case in reasonable time.
    [Show full text]
  • Shapely Documentation Release 1.8A3
    Shapely Documentation Release 1.8a3 Sean Gillies Sep 08, 2021 CONTENTS 1 Documentation Contents 1 1.1 Shapely..................................................1 1.2 The Shapely User Manual........................................ 24 1.3 Migrating to Shapely 1.8 / 2.0...................................... 77 2 Indices and tables 85 Index 87 i ii CHAPTER ONE DOCUMENTATION CONTENTS 1.1 Shapely Manipulation and analysis of geometric objects in the Cartesian plane. Shapely is a BSD-licensed Python package for manipulation and analysis of planar geometric objects. It is based on the widely deployed GEOS (the engine of PostGIS) and JTS (from which GEOS is ported) libraries. Shapely is not concerned with data formats or coordinate systems, but can be readily integrated with packages that are. For more details, see: • Shapely GitHub repository • Shapely documentation and manual 1 Shapely Documentation, Release 1.8a3 1.1.1 Usage Here is the canonical example of building an approximately circular patch by buffering a point. >>> from shapely.geometry import Point >>> patch= Point(0.0, 0.0).buffer(10.0) >>> patch <shapely.geometry.polygon.Polygon object at 0x...> >>> patch.area 313.65484905459385 See the manual for more examples and guidance. 1.1.2 Requirements Shapely 1.8 requires • Python >=3.6 • GEOS >=3.3 1.1.3 Installing Shapely Shapely may be installed from a source distribution or one of several kinds of built distribution. Built distributions Built distributions are the only option for users who do not have or do not know how to use their platform’s compiler and Python SDK, and a good option for users who would rather not bother.
    [Show full text]
  • Geometry for Middle School Teachers Companion Problems for the Connected Mathematics Curriculum
    Geometry for Middle School Teachers Companion Problems for the Connected Mathematics Curriculum Carl W. Lee and Jakayla Robbins Department of Mathematics University of Kentucky Draft — May 27, 2004 1 Contents 1 Course Information 4 1.1 NSF Support . 4 1.2Introduction.................................... 4 1.3GeneralCourseComments............................ 5 1.3.1 Overview................................. 5 1.3.2 Objectives................................. 5 1.3.3 DevelopmentofThemes......................... 5 1.3.4 InvestigativeApproach.......................... 6 1.3.5 TakingAdvantageofTechnology.................... 6 1.3.6 References................................. 6 1.4UsefulSoftware.................................. 7 1.4.1 Wingeom................................. 7 1.4.2 POV-Ray................................. 7 2 Shapes and Designs 8 2.1 Tilings . 8 2.2RegularPolygons................................. 8 2.3PlanarClusters.................................. 10 2.4 Regular and Semiregular Tilings . 12 2.5SpaceClustersandExtensionstoPolyhedra.................. 13 2.6Honeycombs.................................... 14 2.7 Spherical Tilings . 15 2.8Triangles...................................... 15 2.9Quadrilaterals................................... 18 2.10Angles....................................... 23 2.11AngleSumsinPolygons............................. 28 2.12 Tilings with Nonregular Polygons . 30 2.13PolygonalandPolyhedralSymmetry...................... 31 2.14TurtleGeometry................................. 36 3 Covering and Surrounding
    [Show full text]
  • An Intuitive Polygon Morphing
    Vis Comput DOI 10.1007/s00371-009-0396-3 ORIGINAL ARTICLE An intuitive polygon morphing Martina Málková · Jindrichˇ Parus · Ivana Kolingerová · Bedrichˇ Beneš © Springer-Verlag 2009 Abstract We present a new algorithm for morphing simple 1 Introduction polygons that is inspired by growing forms in nature. While previous algorithms require user-assisted definition of com- Morphing is a (non-linear) transformation of a shape into plicated correspondences between the morphing objects, our another shape and has practical uses in computer graphics, algorithm defines the correspondence by overlapping the in- animation, modeling and design. This area has been thor- oughly researched and the existing methods can be classified put polygons. Once the morphing of one object into another into two main groups—traditional volume and image mor- is defined, very little or no user interaction is necessary to phing and boundary-based morphing. In this article we focus achieve intuitive results. Our algorithm is suitable namely on boundary-based morphing methods. The algorithms de- for growth-like morphing. We present the basic algorithm signed in this area concentrate on morphing similar shapes, and its three variations. One of them is suitable mainly for where some common features can be identified. However, in convex polygons, the other two are for more complex poly- some cases it is not possible to align all the main features of gons, such as curved or spiral polygonal forms. the input shapes (e.g. a head with and without horns). A nat- ural morph usually means growth of the non-aligned part from its aligned neighbor. In this paper, we propose a novel · · · Keywords Morphing Vector data Polygon intersection approach for morphing with this “growth-like” nature.
    [Show full text]
  • Polygons in Symmetry: Animal Inventions Visual Arts and Math Lesson Artist-Mentor – Meredith Essex Grade Level: Third Grade
    ARTS IMPACT—ARTS-INFUSED INSTITUTE LESSON PLAN (YR2-AEMDD) LESSON TITLE: Polygons in Symmetry: Animal Inventions Visual Arts and Math Lesson Artist-Mentor – Meredith Essex Grade Level: Third Grade Enduring UnderstAnding Use of symmetry with math shapes/figures can create balanced artistic organization and animal representation. Target: MaKes a symmetrical animal form. CriteriA: LinKs and layers polygons for bird, reptile/amphibian/insect with same color, location and size of shapes/figures on either side of a line of symmetry. Target: Uses craftsmanship in collage techniques. CriteriA: Folds evenly, cuts smoothly, and glues securely—smooth and flat to paper. Geometry SeArch JournAl: Target: Identifies and compares 2-D shapes/figures. CriteriA: Describes/labels and draws properties/attributes of diverse polygons in art. TeAching And LeArning StrAtegies Introduction to Arts-Infused Concepts through ClAssroom Activities: Arts-Infused Concepts: Symmetry; Polygons; Congruence; ShApe; BAlAnce · LooK for parallelograms, rectangles: Find and draw objects with lines of symmetry in Geometry Search Journal. · Practice drawing symmetrical animals using only polygons. · Practice folding and cutting paper to create a symmetrical shape—fold is line of symmetry. · Practice cutting corners off of squares and rectangles to create triangles and trapezoids. 1. Introduces Egg And Cross by MichAel Gregory And, Cross RoAd by Victor MAldonAdo. Prompts: This is a lesson that is a visual art lesson and a math lesson at the same time. Balance in art can be created through organization of math shapes/figures in symmetry. In this art, what maKes it balanced? Where can we draw a line of symmetry? Is the art “equal” on both sides of that line: what maKes it equal? Student: Participates in concept discussion.
    [Show full text]
  • Turning Triangles – Solutions and What to Look For
    M1. Turning triangles – solutions and what to look for Solutions Part 1 (a) a = 72°, b = 54° Notes: This question is designed to be straightforward. It gives children the confidence to move on. (b) 36°, 72°, 72° (c) Number of sides 3 4 5 6 9 10 12 15 18 20 30 36 Angle a 120 90 72 60 40 36 30 24 20 18 12 10 Angle b 30 45 54 60 70 72 75 78 80 81 84 86 Part 2 (a) c = 72°, d = 36° Notes: Children may be encouraged to consider why two of the angles in this triangle are the same as the triangle in part 1(b). (b) c = 72°, d = 36° h = 108°, j = 54°, k = 18° Notes: Children may find it useful to refer back to part 1(a). (c) d = 180 - 2c h = 180 – c Page 1 j = (180 – c) k = j – d Notes: Other ways of expressing the relationships are possible. Some children will wish to investigate specific polygons before considering how to be certain that their findings will always work. Other children will be able to use algebra to prove that the relationships must always hold. Reviewing mathematical achievement Level 5 Typically children working at level 5 are able to apply their knowledge of angle properties to identify angles within the triangles. In part 1(c), they work within the given constraints and check their results, considering whether their solutions are sensible. They understand that identifying 12 polygons is insufficient to constitute certainty that no other such polygons exist.
    [Show full text]
  • Efficient Clipping of Arbitrary Polygons
    Efficient Clipping of Arbitrary Polygons G¨unther Greiner∗ Kai Hormann† Computer Graphics Group, University of Erlangen Abstract This paper is organized as follows. In the next section we spec- ify what the interior of an arbitrary polygon is. In Section 3 we Clipping 2D polygons is one of the basic routines in computer outline the basic concept of the algorithm. We then describe the graphics. In rendering complex 3D images it has to be done sev- data structure used to represent polygons in Section 4. In Section 5 eral thousand times. Efficient algorithms are therefore very im- we describe how the intersection points are merged into the data portant. We present such an efficient algorithm for clipping arbi- structure and give details of the implementation. In the final sec- trary 2D polygons. The algorithm can handle arbitrary closed poly- tion, results are discussed and compared to Vatti’s algorithm. gons, specifically where the clip and subject polygons may self- intersect. The algorithm is simple and faster than Vatti’s [11] al- gorithm, which was designed for the general case as well. Simple 2 Basics modifications allow determination of union and set-theoretic differ- ence of two arbitrary polygons. A closed polygon È is described by the ordered set of its vertices P0,P1,P2,...,Pn = P0. It consists of all line segments consec- CR Categories: I.3.3 [Computer Graphics]: Picture/Image Gen- utively connecting the points Pi, i.e. P0P1, P1P2,...,Pn−1Pn = eration—Display Algorithms I.3.5 [Computer Graphics]: Compu- Pn−1P0. tational Geometry and Object Modelling For a convex polygon it is quite simple to specify the interior Keywords: Clipping, Polygon Comparison and the exterior.
    [Show full text]
  • Efficient Parallel and Distributed Algorithms for GIS Polygon Overlay Processing
    Georgia State University ScholarWorks @ Georgia State University Computer Science Dissertations Department of Computer Science 8-11-2015 Efficient Parallel and Distributed Algorithms for GIS Polygon Overlay Processing Satish Puri Georgia State University Follow this and additional works at: https://scholarworks.gsu.edu/cs_diss Recommended Citation Puri, Satish, "Efficientar P allel and Distributed Algorithms for GIS Polygon Overlay Processing." Dissertation, Georgia State University, 2015. https://scholarworks.gsu.edu/cs_diss/98 This Dissertation is brought to you for free and open access by the Department of Computer Science at ScholarWorks @ Georgia State University. It has been accepted for inclusion in Computer Science Dissertations by an authorized administrator of ScholarWorks @ Georgia State University. For more information, please contact [email protected]. TITLE: EFFICIENT PARALLEL AND DISTRIBUTED ALGORITHMS FOR GIS POLYGON OVERLAY PROCESSING by SATISH PURI Under the Direction of Sushil K. Prasad, PhD ABSTRACT Polygon clipping is one of the complex operations in computational geometry. It is used in Geographic Information Systems (GIS), Computer Graphics, and VLSI CAD. For two polygons with n and m vertices, the number of intersections can be O(nm). In this disser- tation, we present the first output-sensitive CREW PRAM algorithm, which can perform polygon clipping in O(logn) time using O(n + k + k0) processors, where n is the number of vertices, k is the number of intersections, and k0 is the additional temporary vertices introduced due to the partitioning of polygons. The current best algorithm by Karinthi, Srinivas, and Almasi does not handle self-intersecting polygons, is not output-sensitive and must employ O(n2) processors to achieve O(logn) time.
    [Show full text]
  • A Software of Visiblitlity Graph with Multiple Reflection and Its Application of Wireless Communication Design
    Please do not remove this page VisPoly; A Software of Visiblitlity Graph with Multiple Reflection and its Application of Wireless Communication Design Fan, Min https://scholarship.libraries.rutgers.edu/discovery/delivery/01RUT_INST:ResearchRepository/12643385930004646?l#13643502780004646 Fan, M. (1998). VisPoly; A Software of Visiblitlity Graph with Multiple Reflection and its Application of Wireless Communication Design. Rutgers University. https://doi.org/10.7282/T3RR22TV This work is protected by copyright. You are free to use this resource, with proper attribution, for research and educational purposes. Other uses, such as reproduction or publication, may require the permission of the copyright holder. Downloaded On 2021/09/26 05:24:14 -0400 VisPoly A Software of Visibility Graph with Multiple Reflection and its Application of Wireless Communication Design Author: Min Fan Advisor: Diane Souvaine April 23, 1998 1 Introduction:............................................................................................................................................2 2 Visibility graph with k reflections...........................................................................................................3 2.1 Definitions.......................................................................................................................................3 2.2 Object library LEDA.......................................................................................................................4 2.3 Description of algorithms................................................................................................................5
    [Show full text]