# Straight Skeleton Implementation

Post on 07-Mar-2015

266 views

Embed Size (px)

TRANSCRIPT

<p>Straight Skeleton Implementation</p>
<p>Introduction Computation Convex polygon Non-convex polygon Polygon with holes</p>
<p>Complexity Reference</p>
<p>2</p>
<p>Introduction</p>
<p>A skeleton of a polygon is a partition of the polygon into regions, creating internal vertices, edges and faces. There are two main types of skeletons: The Medial Axis and the Straight skeleton.</p>
<p>3</p>
<p>Introduction</p>
<p>The Medial axis is the locus of the centers of all circles that are tangent to the polygon at two or more points. The Straight Skeleton is the trace of the polygons vertices, as the edges of the polygon are propagating inwards at equal rate.</p>
<p>4</p>
<p>Introduction</p>
<p>O.K. what is it good for?Roof construction Image processing Offsetting Origami Geographic information systems</p>
<p>5</p>
<p>Computation</p>
<p>Computing the straight skeletonIntuition Roof construction Shrinking process</p>
<p>6</p>
<p>Computation</p>
<p>Shrinkage As the edges of the polygon are moving inwards at equal rate, the vertices move along the bisector of its two adjacent edges. Two possible events may occur :</p>
<p>Edge Event An edge shrinks to zero. Split Event A reflex vertex hits an opposite edge, splitting the polygon into two disconnected parts.</p>
<p>7</p>
<p>Computation</p>
<p>8</p>
<p>Computation</p>
<p>Formal definitionThe straight skeleton, S(P), of polygon P is the union of the pieces of the angular bisectors traced out by the polygon vertices during the shrinking process. Each edge, e, sweeps out a certain area called the face of e. Bisector pieces are called arcs, and their endpoints which are not vertices of P are called nodes of S(P).</p>
<p>9</p>
<p>Computation</p>
<p>Vertex Node</p>
<p>Edge Face</p>
<p>Arc</p>
<p>Straight skeleton s(P) Polygon P</p>
<p>10</p>
<p>Computation Convex polygon</p>
<p>Convex polygonOnly Edge event Algorithm1.</p>
<p>Initialization a) Create a circular double connected list of active vertices (LAV) of the polygon (counter-clockwise). b) For every vertex add pointers to the edges creating it and compute the bisector. c) Compute the nearer intersection point of every set of adjacent bisectors and store them in to a priority queue according to their distance from the edges</p>
<p>11</p>
<p>Computation Convex polygon2.</p>
<p>While the queue is not empty a) Pop the next intersection point I. b) If the vertices/nodes Va, Vb pointed by I are marked, go to 2.a else Edge event. c) If the predecessor of the predecessor of Va is Vb output VaI, VbI, VcI. Vc - predecessor of Va. d) Output VaI, VbI. e) Update the LAV: Mark Va, Vb Create new node VnI Insert V to the LAV</p>
<p>f) Initialize V.</p>
<p>12</p>
<p>Computation Convex polygon</p>
<p>13</p>
<p>Computation Non-convex polygon</p>
<p>Non-convex polygonAn extension of the convex polygon algorithm. Edge event and Spilt event</p>
<p>14</p>
<p>Computation Non-convex polygon</p>
<p>A reflex vertex may lead into a Split even or an Edge event</p>
<p>An edge event (point A) and a split event (point B) due to a reflex vertex</p>
<p>15</p>
<p>Computation Non-convex polygon</p>
<p>Determine the coordinate of point BB is equidistant from the edges adjacent to the reflex vertex, and from the opposite edge. For every reflex vertex, we traverse all the edges in the original polygon and test them whether they can be the opposite edge.</p>
<p>16</p>
<p>Computation Non-convex polygon</p>
<p>A simple intersection test is not enoughThe intersection point between the reflex vertex and the line supporting the opposite edges must be in the area defined between the edge and the bisectors of its two vertices. The intersection point is the meeting point of the three bisectors between all three participating edges (the two defining the reflex vertex and the split edge).</p>
<p>17</p>
<p>Computation Non-convex polygon</p>
<p>Managing of the LAVIn a split event the LAV split into two LAVs. The splitting vertex is replaced with two new vertices, one in each LAV.</p>
<p>New bisectors and edge events are calculated for each of these vertices.18</p>
<p>Computation Non-convex polygon</p>
<p>Multiple split evensAn edge can be split more then once. In a split event we must correctly choose the end point of the edge. It is handled during the LAVs traversal.</p>
<p>19</p>
<p>Computation Non-convex polygon</p>
<p>Algorithm1.</p>
<p>Initialization a) Create a LAV (same as in convex case). b) Compute the bisectors (same as in convex case). c) Compute the bisectors intersections and for reflex vertices compute also intersection with opposite edge. store them in to a priority queue according to their distance from the edges and store the type of intersection.</p>
<p>20</p>
<p>Computation Non-convex polygon2.</p>
<p>While the queue is not empty a) Pop the next intersection point I. if I is an edge event, do steps 2.b to 2.f of the convex case. Else continue. b) If I points to marked vertices, go to 2.a. c) same as in convex case (local roof peaks). d) Output VI, where V is the vetex/node pointed by I. e) Update the LAVs: Mark V Create two new nodes V1nI, V2nI Search the opposite edge in LAVs Insert V1, V2 to the LAVs</p>
<p>f) Initialize V1 and V2.</p>
<p>21</p>
<p>Computation Polygon with holes</p>
<p>Polygon with holesThe algorithm can handle polygons with holes. Every hole represented by a LAV , in clockwise order.</p>
<p>22</p>
<p>Complexity</p>
<p>complexityHandling edge event- O(1) Handling split event- O(nm)n- number of vertices, m- number of reflex vertices</p>
<p>Handling the priority queue- O(nlogn) Total running time: O(nm+nlogn)</p>
<p>23</p>
<p>Reference</p>
<p>ReferencesP. Felkel, S. Obdrzalek, Straight Skeleton Implementation, Spring Conference on Computer Graphics, Budmerice, Slovakia, pages 210-218. Computational Geometry Algorithms Library (CGAL), CGAL User and Reference Manual, Chapter 23- 2D Straight Skeleton and Polygon Offsetting.http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Straight_skelet on_2/Chapter_main.html</p>
<p>David Blanger, Designing Roofs of Buildings.http://www.sable.mcgill.ca/~dbelan2/roofs/roofs.html</p>
<p>24</p>
<p>25</p>
<p>26</p>