Topological Modeling for Vector GraphicsbyBoris DalsteinB.Sc., École Normale Supérieure de Lyon, 2010M.Sc., Université Joseph Fourier, Grenoble, 2012A THESIS SUBMITTED IN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFDOCTOR OF PHILOSOPHYinThe Faculty of Graduate and Postdoctoral Studies(Computer Science)THE UNIVERSITY OF BRITISH COLUMBIA(Vancouver)September 2017© Boris Dalstein 2017AbstractIn recent years, with the development of mobile phones, tablets, and web technologies, we haveseen an ever-increasing need to generate vector graphics content, that is, resolution-independentimages that support sharp rendering across all devices, as well as interactivity and animation.However, the tools and standards currently available to artists for authoring and distributing suchvector graphics content have many limitations. Importantly, basic topological modeling, suchas the ability to have several faces share a common edge, is largely absent from current vectorgraphics technologies. In this thesis, we address this issue with three major contributions.First, we develop theoretical foundations of vector graphics topology, grounded in algebraic topol-ogy. More specically, we introduce the concept of Point-Curve-Surface complex (PCS complex) asa formal tool that allows us to interpret vector graphics illustrations as non-manifold, non-planar,non-orientable topological spaces immersed in R2, unlike planar maps which can only representembeddings.Second, based on this theoretical understanding, we introduce the vector graphics complex (VGC)as a simple data structure that supports fundamental topological modeling operations for vectorgraphics illustrations. It allows for the direct representation of incidence relationships betweenobjects, while at the same time keeping the geometric exibility of stacking-based systems, suchas the ability to have edges and faces overlap each others.Third and last, based on the VGC, we introduce the vector animation complex (VAC), a data struc-ture for vector graphics animation, designed to support the modeling of time-continuous topolog-ical events, which are common in 2D hand-drawn animation. This allows features of a connecteddrawing to merge, split, appear, or disappear at desired times via keyframes that introduce thedesired topological change. Because the resulting space-time complex directly captures the time-varying topological structure, features are readily edited in both space and time in a way thatreects the intent of the drawing.iiLay SummaryIn recent years, it has become increasingly important for digital artists to be able to draw images,animations, and interactive graphics that can be displayed equally well on a wide range of screens,from mobile phones to movie theaters. Unfortunately, the tools currently available for this tasksuer from many limitations, such as the inability to easily animate two shapes sharing a commonedge, for example two countries sharing a border.To overcome these limitations, we have developed new mathematical models to represent 2Ddrawings and animations, and have built new digital tools based on these models. They allowartists to draw and animate shapes which are connected to one another, using novel interactivetechniques. Positive initial reception suggests that these new techniques are readily embracedby artists, thus we expect our work to have a large inuence in the future of digital drawingtools.iiiPrefaceA version of Chapter 4 has been published in the following:• ACM Transactions on Graphics, 33(4), 2014 [Dalstein et al. 2014b](Proceedings of SIGGRAPH 2014)The ideas originated in discussions between myself and Michiel van de Panne. It comes from therealization that fundamental research on non-animated vector graphics was needed rst, beforebeing able to properly tackle the problems of animated vector graphics, addressed in Chapter 5(whose ideas originated rst). I conducted the implementation, testing, and contributed to writ-ing the manuscript. Michiel van de Panne and Rémi Ronfard provided guidance, insights, andcontributed to the writing of the manuscript.A version of Chapter 5 has been published in the following:• ACM Transactions on Graphics, 34(4), 2015 [Dalstein et al. 2015](Proceedings of SIGGRAPH 2015)The ideas originated in discussions between myself and Rémi Ronfard, as part of my master’sthesis. I conducted the implementation, testing, and contributed to writing the manuscript. Michielvan de Panne and Rémi Ronfard provided guidance, insights, and contributed to the writing of themanuscript.A version of the content provided as appendices of this dissertation has been informally distributedas the following:• Point-Curve-Surface Complex: A Cell Decomposition for Non-Manifold Two-DimensionalTopological Spaces. University of British Columbia, technical report, 2014 [Dalstein et al.2014a]The ideas originated in discussions between myself and Michiel van de Panne. I conducted mostof the theoretical analysis and derivations, and wrote the manuscript. Michiel van de Panne andRémi Ronfard provided guidance and insights.ivPrefaceWe have not yet submitted Chapter 3 for publication. This chapter builds on the ideas developed in[Dalstein et al. 2014a], providing important improvements and clarications. I conducted most ofthe theoretical analysis and derivations, and wrote the manuscript. Michiel van de Panne providedguidance.vTable of ContentsAbstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiLay Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiiPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ivTable of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viList of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiAcknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Informal Definition of the Vector Graphics Complex . . . . . . . . . . . . . . . 31.3 Outline of Dissertation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Background and Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1 Historical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Related Work in Vector Graphics . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Related Work in Topological Modeling . . . . . . . . . . . . . . . . . . . . . . 162.4 Related Work in Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 The Theoretical Foundations of Vector Graphics Topology . . . . . . . . . . . 373.1 First Concepts of Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.1.1 Topology According to Computer Scientists . . . . . . . . . . . . . . . 393.1.2 Topology According to Mathematicians . . . . . . . . . . . . . . . . . 403.1.3 Topology According to Computational Geometers . . . . . . . . . . . 423.1.4 Topology According to 3D Modeling Artists . . . . . . . . . . . . . . . 433.2 The Non-Planar Nature of Vector Graphics . . . . . . . . . . . . . . . . . . . 473.2.1 Design Decisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.2.2 Non-Planarity and Overlapping . . . . . . . . . . . . . . . . . . . . . 49viTable of Contents3.2.3 Non-Orientability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.2.4 Non-Manifoldness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.2.5 N-Sided Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.2.6 Closed Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.2.7 Faces with Inner Holes . . . . . . . . . . . . . . . . . . . . . . . . . . 523.2.8 Non-Planar Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.2.9 Faces without Boundary . . . . . . . . . . . . . . . . . . . . . . . . . 543.2.10 Cut and Glue Closed Edges . . . . . . . . . . . . . . . . . . . . . . . 553.2.11 Cut Faces at Vertices and along Closed Edges . . . . . . . . . . . . . 563.2.12 Cut Faces with Inner Holes . . . . . . . . . . . . . . . . . . . . . . . . 563.2.13 Cut Non-Planar Faces . . . . . . . . . . . . . . . . . . . . . . . . . . 583.2.14 The Face-Cut Classification . . . . . . . . . . . . . . . . . . . . . . . 603.3 PCS Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623.3.1 Abstract PCS complexes . . . . . . . . . . . . . . . . . . . . . . . . . 633.3.2 PCS complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643.3.3 Examples and Discussions . . . . . . . . . . . . . . . . . . . . . . . . 663.3.4 Vector Graphics Complexes . . . . . . . . . . . . . . . . . . . . . . . 723.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 Vector Graphics Complexes: The Topology of Vector Illustrations . . . . . . . 774.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774.2 Motivation and Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794.3 Vector Graphics Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.3.1 Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.3.2 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854.3.3 Vector Graphics Complexes as Colored Incidence Graphs . . . . . . . . 864.3.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904.4 Topological Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924.4.1 Creation and Deletion Operators . . . . . . . . . . . . . . . . . . . . . 934.4.2 Glue and Unglue Operators . . . . . . . . . . . . . . . . . . . . . . . 944.4.3 Cut and Uncut Operators . . . . . . . . . . . . . . . . . . . . . . . . 954.5 Depth Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 964.6 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 984.7 User Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994.8 Limitations and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 1024.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1035 Vector Animation Complexes: The Topology of Vector Animations . . . . . . 105viiTable of Contents5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055.2 Space-Time Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065.2.1 Animating Vertices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065.2.2 Animating Stroke Graphs . . . . . . . . . . . . . . . . . . . . . . . . . 1075.2.3 Animating Vector Graphics Complexes . . . . . . . . . . . . . . . . . 1095.3 Formal Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1125.3.1 Vector Animation Complex . . . . . . . . . . . . . . . . . . . . . . . . 1125.3.2 Key Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135.3.3 Key Closed Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135.3.4 Key Open Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135.3.5 Key Face . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145.3.6 Inbetween Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145.3.7 Inbetween Closed Edge . . . . . . . . . . . . . . . . . . . . . . . . . . 1145.3.8 Inbetween Open Edge . . . . . . . . . . . . . . . . . . . . . . . . . . 1155.3.9 Inbetween Face . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1155.3.10 Halfedge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1165.3.11 Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1165.3.12 Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175.3.13 Animated Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175.3.14 Animated Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1175.4 Interpolation Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1225.5 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235.6 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1255.7 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143AppendicesA Concepts of Algebraic Topology . . . . . . . . . . . . . . . . . . . . . . . . . . 145A.1 Topological Spaces and Homeomorphisms . . . . . . . . . . . . . . . . . . . . 145A.2 Manifolds with Boundary and Compact Manifolds . . . . . . . . . . . . . . . 146A.3 Points, Curves, and Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 147viiiTable of ContentsA.4 Classification of Compact n-Manifolds for n ≤ 2 . . . . . . . . . . . . . . . . 147A.5 Non-Manifold Topological Spaces . . . . . . . . . . . . . . . . . . . . . . . . 150A.5.1 Abstract Simplicial Complexes . . . . . . . . . . . . . . . . . . . . . . 151A.5.2 CW Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151A.6 Geometric Realizations and Quotient Spaces . . . . . . . . . . . . . . . . . . 152A.7 Immersions vs. Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . 155B Non-Combinatorial Definition of PCS Complexes . . . . . . . . . . . . . . . . 156B.1 Cell Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156B.2 Relation Between ∂c and Bc, Compactness, and Subcomplexes . . . . . . . . 159B.3 Comparison with CW Complexes . . . . . . . . . . . . . . . . . . . . . . . . . 160B.4 PCS Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162C Equivalence between PCS-Decomposable and 2-Triangulable Spaces . . . . . 168D Topological Operators on PCS Complexes . . . . . . . . . . . . . . . . . . . . 171D.1 Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171D.2 Algebraic Operations on Halfedges, Paths and Cycles . . . . . . . . . . . . . . 173D.2.1 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173D.2.2 Flipping Halfedges, Paths and Cycles . . . . . . . . . . . . . . . . . . 174D.2.3 Converting Open Halfedges to Paths and Paths to Cycles . . . . . . . 174D.2.4 Concatenating Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . 175D.2.5 Rotating Non-Simple Cycles . . . . . . . . . . . . . . . . . . . . . . . 175D.2.6 Extracting Subpaths from Paths and Non-Simple Cycles . . . . . . . . 177D.3 Cell Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177D.4 Cell Deletion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181D.5 Glue Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183D.6 UnGlue Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185D.7 Cut Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190D.7.1 Cutting an Open Edge (at a Vertex) . . . . . . . . . . . . . . . . . . 192D.7.2 Cutting a Closed Edge (at a vertex) . . . . . . . . . . . . . . . . . . . 193D.7.3 Cutting a Face at a Vertex . . . . . . . . . . . . . . . . . . . . . . . . 194D.7.4 Cutting a Face at an Edge . . . . . . . . . . . . . . . . . . . . . . . . 194D.7.5 Cutting an Orientable Face at a Closed Edge . . . . . . . . . . . . . . 198D.7.6 Cutting a Non-Orientable Face at a Closed Edge . . . . . . . . . . . . 199D.7.7 Cutting a Face at an Open Edge Starting and Ending at the Same Hole 202D.7.8 Cutting a Face at an Open Edge Starting and Ending at Different Holes 208D.7.9 Flipping Cycles of Non-Orientable Faces . . . . . . . . . . . . . . . . . 208ixTable of ContentsD.8 Uncut Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210E Simplification of PCS Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . 220E.1 Simplification of Cell Complexes . . . . . . . . . . . . . . . . . . . . . . . . . 220E.2 Equivalence of Cell Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . 223E.3 Uniqueness of Minimal PCS Complex . . . . . . . . . . . . . . . . . . . . . . 225xList of Figures1.1 Ivan Sutherland’s Sketchpad Program . . . . . . . . . . . . . . . . . . . . . . 11.2 Vector Graphics Complex: Example C++ Implementation . . . . . . . . . . . . 42.1 Early computers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Vector Displays vs Raster Displays . . . . . . . . . . . . . . . . . . . . . . . . 72.3 PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4 Adobe Illustrator 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.5 Animating a 3-Way Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.6 European Union as SVG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.7 SVG Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.8 Dynamic Planar Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.9 Stroke Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.10 Diffusion Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.11 Comparison with Existing Topological Structures . . . . . . . . . . . . . . . . 172.12 Winged-Edge Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.13 Halfedge Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.14 Quad-Edge Data Structure: Edge Direction and Orientation . . . . . . . . . . 202.15 Quad-Edge Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.16 Radial-Edge Data Structure: Edge-Uses . . . . . . . . . . . . . . . . . . . . . 212.17 Radial-Edge Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.18 Combinatorial Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.19 Generalized Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.20 Self-Sewing Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.21 Two-Dimensional Simplicial Complexes . . . . . . . . . . . . . . . . . . . . . . 272.22 CW Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282.23 Selective Geometric Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . 292.24 Keyframes with Inconsistent Topology . . . . . . . . . . . . . . . . . . . . . . 312.25 Stroke Correspondence using Manifold Learning . . . . . . . . . . . . . . . . . 312.26 Cartoon Retargeting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322.27 Texture Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33xiList of Figures2.28 Shape Morphing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.29 Non-Photorealistic Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.30 Animation as Space-Time Modeling . . . . . . . . . . . . . . . . . . . . . . . 353.1 Non-Planarity of Vector Graphics Topology . . . . . . . . . . . . . . . . . . . 373.2 Effect of Connectedness on the Behavior of Graphical Objects . . . . . . . . . 383.3 Homeomorphic Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.4 Homeomorphism Counter Example . . . . . . . . . . . . . . . . . . . . . . . . 403.5 Homeomorphic Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413.6 Catmull-Clark Subdivision Surfaces . . . . . . . . . . . . . . . . . . . . . . . . 423.7 Head Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.8 Quad Mesh Isomorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.9 Topology vs Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.10 Geometric Realization vs Immersion . . . . . . . . . . . . . . . . . . . . . . . 453.11 Vector Graphics Topological Space and Immersion . . . . . . . . . . . . . . . . 473.12 Proof of Non-Planarity and Non-Orientability . . . . . . . . . . . . . . . . . . 493.13 Proof of Non-Manifoldness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.14 N-Sided Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.15 Closed Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.16 Face with One Inner Hole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.17 Faces with N Inner Holes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.18 Non-Planar Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.19 Faces without Boundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.20 Cut and Glue Closed Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.21 Cut Faces at Vertices and along Closed Edges . . . . . . . . . . . . . . . . . . 563.22 Cut Planar Faces with Inner Holes . . . . . . . . . . . . . . . . . . . . . . . . 573.23 Cut Non-Planar Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583.24 Cut Non-Planar Faces with Closed Edges . . . . . . . . . . . . . . . . . . . . . 593.25 Face-Cut Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613.26 Formal Steps to Define a PCS Complex . . . . . . . . . . . . . . . . . . . . . 623.27 Examples of PCS Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.28 Examples of PCS Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.29 Consistent Parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.30 Homeomorphism and Isomorphism of PCS Complexes . . . . . . . . . . . . . . 703.31 Multiplicative Notation and Cut Operators on Möbius Strips . . . . . . . . . . 723.32 Sequence of VGC Operators on a Möbius strip . . . . . . . . . . . . . . . . . . 733.33 Relations between PCS Complexes and VGCs . . . . . . . . . . . . . . . . . . 74xiiList of Figures3.34 Relevance of the Cut-Face Classification for VGCs . . . . . . . . . . . . . . . . 754.1 Vector Graphics Illustrations and Their Topology . . . . . . . . . . . . . . . . 774.2 SVG Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794.3 Limitations of Existing Representations . . . . . . . . . . . . . . . . . . . . . . 794.4 Vertices, Open Edges, and Closed Edges . . . . . . . . . . . . . . . . . . . . . 804.5 Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814.6 Cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.7 Topology of a Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844.8 Face with Many Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854.9 Incidence Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874.10 Incidence Graph of a Möbius Strip . . . . . . . . . . . . . . . . . . . . . . . . 884.11 Different Renders for Different Cycles . . . . . . . . . . . . . . . . . . . . . . 884.12 Coloring of Incidence Graph for Open Edges . . . . . . . . . . . . . . . . . . . 894.13 Coloring of Incidence Graph for Faces . . . . . . . . . . . . . . . . . . . . . . 894.14 Glue and Unglue Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 944.15 Cut and Uncut Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954.16 Simplify Operator via Global Uncut . . . . . . . . . . . . . . . . . . . . . . . . 964.17 Illustration of the Raise Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 974.18 Partial Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974.19 Examples of Non-Manifold Topologies . . . . . . . . . . . . . . . . . . . . . . 994.20 User Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1004.21 More User Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1004.22 More User Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014.23 Partial Unglue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1034.24 Comparison of Multiway Joins . . . . . . . . . . . . . . . . . . . . . . . . . . 1034.25 Possible Artefacts of Invisible Edges . . . . . . . . . . . . . . . . . . . . . . . 1045.1 Overview of Vector Animation Complexes Cell Types . . . . . . . . . . . . . . 1055.2 Sequential Keyframing vs. Topological Keyframing . . . . . . . . . . . . . . . 1075.3 Stroke Graph Animation With Time-Varying Topology . . . . . . . . . . . . . 1085.4 Topology of Inbetween Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . 1095.5 Intuition behind animated cycles . . . . . . . . . . . . . . . . . . . . . . . . . 1105.6 Example of Valid Animated cycle . . . . . . . . . . . . . . . . . . . . . . . . . 1185.7 Node-Cell Consistency Invariants . . . . . . . . . . . . . . . . . . . . . . . . . 1205.8 Invalid Doubly-Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215.9 Animated Cycle Violating the Cycle Uniqueness Invariant . . . . . . . . . . . . 1225.10 Interpolation Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123xiiiList of Figures5.11 Result: Double Torus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265.12 Result: Animated Ribbon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265.13 Result: Flapping Bird . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1275.14 Result: Head Turning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286.1 Example of Challenging Figure to Author with Current Tools . . . . . . . . . . 133A.1 Example of 2-Manifold without Boundary . . . . . . . . . . . . . . . . . . . . 146A.2 Example of 2-Manifold with Boundary . . . . . . . . . . . . . . . . . . . . . . 146A.3 Classification of n-manifolds for n ≤ 2 . . . . . . . . . . . . . . . . . . . . . . 147A.4 Polygonal Presentation of the Torus . . . . . . . . . . . . . . . . . . . . . . . 148A.5 Polygonal Presentation of the Klein Bottle . . . . . . . . . . . . . . . . . . . . 148A.6 Polygonal Presentation of the Sphere . . . . . . . . . . . . . . . . . . . . . . . 148A.7 Polygonal Presentation of the Projective Plane . . . . . . . . . . . . . . . . . . 148A.8 Example of Non-Manifold Space . . . . . . . . . . . . . . . . . . . . . . . . . 150A.9 Example of Simplicial Complex . . . . . . . . . . . . . . . . . . . . . . . . . . 150A.10 Different Cell Decompositions of the Sphere . . . . . . . . . . . . . . . . . . . 150A.11 Example of Valid Cell Decomposition, but Invalid CW complex . . . . . . . . . 152A.12 Example of Quotient Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153A.13 CW Complex Seen as a Quotient Space . . . . . . . . . . . . . . . . . . . . . 154A.14 Immersion vs. Embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155A.15 Different Immersions of the Klein Bottle . . . . . . . . . . . . . . . . . . . . . 155B.1 Gluing Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158B.2 Example of Valid CW Complex but Invalid PCS Complex . . . . . . . . . . . . 161B.3 Example of Valid CW Complex but Invalid PCS Complex . . . . . . . . . . . . 161B.4 Example of Valid 1-Complex . . . . . . . . . . . . . . . . . . . . . . . . . . . 162B.5 Examples of Invalid 1-Complexes . . . . . . . . . . . . . . . . . . . . . . . . . 163B.6 Cell Decompositions of Face Boundary . . . . . . . . . . . . . . . . . . . . . . 164B.7 Examples of Valid PCS Complexes . . . . . . . . . . . . . . . . . . . . . . . . 165B.8 More Examples of Valid PCS Complexes . . . . . . . . . . . . . . . . . . . . . 166C.1 Illustration of the Proof of Proposition 7 . . . . . . . . . . . . . . . . . . . . . 168D.1 Examples of SmartDelete Operator . . . . . . . . . . . . . . . . . . . . . . . . 181D.2 Cut-Torus and Cut-Möbius . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187D.3 Example of Cut Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190D.4 Face-Cut Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195D.5 Illustration of the 9 Ways to Cut a Face at a Closed Edge . . . . . . . . . . . . 196xivList of FiguresD.6 Illustration of the 10 Ways to Cut a Face At an Open Edge . . . . . . . . . . . 197D.7 Specifying a Cut using Edge-Uses . . . . . . . . . . . . . . . . . . . . . . . . . 204E.1 Reduced Star and Atomic Simplification . . . . . . . . . . . . . . . . . . . . . 220xvAcknowledgmentsFirst and foremost, I would like to thank my supervisor Michiel van de Panne. Michiel has beenan inspiration at every single step of the program. He was an exceptional mentor, a sincere friend,and an unconditional believer in my ideas, no matter how crazy they were. It is often said thatnding the right supervisor is one of the most important steps towards a successful PhD program;I am very glad that I got that step right. Whenever I was not sure which path to take, he wouldask me: "Which do you think would have the most impact?". This question is now shaping almostevery decision I take, thank you for adding this new lens to my set of world views.I would like to thank Rémi Ronfard, Joanna McGrenere, Will Evans, Karon MacLean, Dinesh Pai,Alla Sheer, Hsi-Yung Feng, Daniel Sýkora, and all the anonymous reviewers for their insightfulfeedback and discussions on the content of my research. There is no doubt that it would be of muchlesser quality without you. Feeling part of such a friendly but rigorous academic community was atrue privilege. Part of this work was supported by ERC Advanced Grant “Expressive”, by GRAND,and by NSERC.I would like to thank Estelle Charleroy, Etienne Colas, anonymous artists, and all of the membersof the VPaint forum for their invaluable user feedback. This entire work would be meaninglesswithout you. Hearing your excitement for the technology gave me condence that I was on theright track, more than any mathematical proof could. Special thanks to James Lopez for bothhis feedback and allowing me to use his work from Hullabaloo. Your dedication to hand-drawnanimation is an inspiration, and I too wish that this beautiful art form never dies.I would like to thank all my friends who were a constant reminder that there is more to life thanComputer Science. I will never thank you enough for the friendly breakfasts, lunches, and dinners,the Swing and Salsa dancing, the camping, hiking, kayaking, skiing, and mountaineering, theping-pong playing, the movie nights, and other types of nights I may not remember well. I wouldlike to thank St. John’s College for exposing me to so many diverse cultures and opinions, theVarsity Outdoor Club for converting me to an outdoor enthusiast, and Pixar for realizing one ofmy childhood dreams while taking a useful break from my PhD. Last but not least, I would like tothank my parents, my sister, and all my family for always being supportive despite my tendencyto y very far away from where they live. Most importantly, I would like to thank my partnerElodie, writing this thesis would have been much harder without her love and support.xviChapter 1IntroductionThis gure was removed due to copy-right restrictions. It was a frame from[MIT Lincoln Laboratory 1964] showingIvan Sutherland drawing three line seg-ments incident at a common vertex.This gure was removed due to copy-right restrictions. It was a frame from[MIT Lincoln Laboratory 1964] show-ing Ivan Sutherland editing the commonvertex of three incident line segments.Figure 1.1: Ivan Sutherland’s Sketchpad program in action. Source: [MIT Lincoln Laboratory 1964], Copyright1964 MIT Lincoln Laboratory.Pioneered in 1963 by Ivan Sutherland in his highly inuential PhD thesis introducing the graphicalprogram Sketchpad [Sutherland 1963], vector graphics refers to the use of basic mathematical prim-itives, such as straight lines, ellipses, rectangles, and Bézier curves, to represent two-dimensionalimages, animations, and interactive graphics.One of the core functionality of Sketchpad was to allow users to simultaneously edit three or moreincident lines by simply moving the point where they meet, as demonstrated in Figure 1.1. In theabstract of his PhD dissertation, Sutherland writes:“Sketchpad stores explicit information about the topology of a drawing. If the usermoves one vertex of a polygon, both adjacent sides will be moved. If the user movesa symbol, all lines attached to that symbol will automatically move to stay attachedto it. The topological connections of the drawing are automatically indicated by theuser as he sketches.”Therefore, already back in 1963, Sutherland understood the value of explicitly storing topologicalinformation about a drawing, such as the incidence relationship between lines: it allows users tointeract with the drawing in intuitive ways which would otherwise not be possible. In fact, not11.1. Contributionsonly did Sutherland pioneer vector graphics, but he also pioneered topological modeling.However, something surprising happened. Fast-forward to 2016. The leading commercial vectorgraphics editor in the industry, Adobe Illustrator CC 2016, poorly supports this feature. The leadingopen-source vector graphics editor, Inkscape 0.91, does not support this feature at all. The leadingand widely adopted open le format for vector graphics, W3C SVG 1.1, does not support thisfeature at all. Despite how obviously useful this feature is, despite being described in the abstractof one of the most well-known PhD dissertations in computer graphics history, and despite theapparent simplicity of implementing it, this feature is largely absent in today’s vector graphicslandscape.How can this be possible? What went wrong? One can only speculate. However, it may be a hintthat in fact, there are some non-obvious, intrinsic properties of vector graphics that make imple-menting this feature harder than it looks. Some fundamental problems that 50 years of researchfailed to identify and solve. Somehow, a fascinating subeld of computer graphics, topologicalmodeling for vector graphics, failed to materialize in the 1970s to tackle these problems. This thesisis a long overdue analysis of these problems, and a rst attempt to solve a few of them.1.1 ContributionsThe rst contribution of this thesis, presented in Chapter 3, is the development of theoretical foun-dations of vector graphics topology, grounded in algebraic topology. Importantly, we introducethe concept of Point-Curve-Surface complex (PCS complex) as a formal tool to interpret vectorgraphics illustrations as non-planar topological spaces immersed inR2. This contrasts with planarmaps which interpret vector graphics illustrations as planar topological spaces embedded in R2.Using immersions of non-planar spaces instead of embeddings of planar spaces is a key paradigmshift that allows us to rigorously reconcile overlapping with shared boundary, two useful vectorgraphics features that were mutually exclusive in previous work.Our second contribution, and probably the most impactful in practice, is the introduction in Chap-ter 4 of the vector graphics complex (VGC). The VGC is a data structure that supports topologicalmodeling operations for vector graphics illustrations, based on the theoretical foundations devel-oped in Chapter 3. Unlike stack-based representations, adopted for instance by the W3C SVGstandard and the vast majority of today’s vector graphics systems, the VGC allows for the coordi-nated editing of edges sharing a common vertex, and faces sharing a common edge. Unlike planarmaps, much rarer but implemented for instance in Adobe Flash, and Adobe Illustrator since theintroduction of the LivePaint tool in 2005, the VGC allows edges and faces to overlap, keeping thegeometric exibility of stack-based representations. The VGC is a strict superset of all representa-21.2. Informal Denition of the Vector Graphics Complextions currently in use, adding useful functionalities without sacricing any existing ones. Also, itis reasonably simple to understand and easy to implement (see Section 1.2). Therefore, we believethat it has the potential to become a de facto standard representation for vector graphics in thefuture.The third and last contribution of this thesis is the introduction in Chapter 5 of the vector ani-mation complex (VAC). The VAC is a data structure for vector graphics animation, extending theVGC to the time dimension, and designed to support the modeling of time-continuous topologicalevents. It other words, it allows the representation of drawings animated continuously over time,instead of using discrete frames, including when their topology is non-constant. Examples includetwo lines merging into one, a line growing from a vertex, or one face splitting into two, such ascell mitosis. Such topological events are extremely common in 2D traditional hand-drawn anima-tion (there are typically several of them per second), but until now there was no practical datastructure to model them. Our representation is based on a novel animation paradigm, which wecall topological keyframing, that is designed to overcome the topological limitations of traditionalkeyframing. This paradigm can also be applied outside the scope of vector graphics animation,but is particularly well suited in our application case, since topological events are more commonin 2D animation than 3D animation.The VGC and the VAC have been implemented as an open-source vector graphics editor calledVPaint, which can be freely downloaded at http://www.vpaint.org, with binaries available forWindows, MacOS X, and Linux. Experimenting with the topological tools of VPaint before or whilereading this thesis can be a good way to build some initial intuition before dwelving into technicaldetails. Note that you are free to use, modify, and/or extend VPaint for your own research.1.2 Informal Definition of the Vector Graphics ComplexLet us now provide an informal denition of the VGC, since it is concise enough to t in thisintroduction and is a helpful piece of knowledge to have before reading any other chapter of thisdissertation. To illustrate the denition, we also provide a C++ implementation and rst examplesin Figure 1.2.A VGC is a topological structure made of four types of cells: vertices, open edges, closed edges, andfaces. A vertex is simply dened as a 2D point. An open edge is dened as a 2D directed curvethat starts and ends at some vertices, possibly equal. A closed edge is dened as a 2D directedclosed curve, with no start or end vertex at all. Finally, a face is dened as a 2D closed regiondelimited by vertices and edges, ordered in cycles. A cycle is dened as either: a closed sequenceof consecutive open edges; or a single closed edge; or a single vertex.31.2. Informal Denition of the Vector Graphics Complex1 class Cell {2 std:: unordered_set <Cell*> star;3 };45 class Vertex: public Cell {6 Point p;7 };89 class Edge: public Cell {10 Vertex *start , *end;11 DirectedCurve curve;12 };1314 class Halfedge {15 Edge *edge;16 bool direction;17 };1819 class Cycle {20 Vertex *steiner;21 std::vector <Halfedge > halfedges;22 };2324 class Face: public Cell {25 std::vector <Cycle > cycles;26 };2728 class VGC {29 std:: unordered_set <Cell*> cells;30 };startopen edgevertex(case start != end)endclosed edgeendopen edge(case start == end)starttwo incident facese1e2e3e4e5e6e7e8vf1f2f1->cycles = [ e1e−12 e−13 e4 ]f2->cycles = [ e2e−15 e6e−16 e7; v; e−18 ](start == end == nullptr)Figure 1.2: Example C++ implementation of the VGC. In addition to the minimal information required, thisimplementation also stores the star of each cell c, which is the set of cells c′ whose boundary contains c.Typically, one of the cycles represents the outer boundary of the face, and the other cycles representinner holes, possibly degenerate (missing curves/points). However, because the cycles of a givenface may intersect, the distinction between outer boundary and inner holes is in general ill-dened.For this reason, the VGC does not explicitly store whether a cycle is an outer boundary or an innerhole.Cycles made of consecutive open edges may use the same edge e any number of times, and each ofthese edge-uses independently species whether e is traversed in its intrinsic direction, or in theopposite direction. We use the term halfedge to refer to an edge with such specied direction, andwe respectively denote by e and e−1 the two possible directions. This allows us to denote cyclesusing a convenient multiplicative notation, such as γ = e2e−15 e6e−16 e7. Cycles made of a singleclosed edge e may use it multiple times, but all uses must be with the same direction, i.e., eitherγ = en or γ = e−n. This represents a cycle that circles around the same closed edge multipletimes. Finally, cycles made of a single vertex v are called Steiner cycles and denoted γ = v.41.3. Outline of Dissertation1.3 Outline of DissertationChapter 2. Background and Related Work. In this chapter, we provide a brief history ofvector graphics, computer animation, and topological modeling, as well as an overview of relevantwork and the state of the art in these elds.Chapter 3. The Theoretical Foundations of Vector Graphics Topology. In this chapter,we rst give precise denitions of many concepts used throughout this dissertation, such as thedenition of topology and overlapping. Then, we introduce the concept of PCS complex as a formaltool to interpret vector graphics illustrations as two-dimensional topological spaces immersed inR2. This provides an in-depth understanding of the non-planar, non-orientable nature of vectorgraphics shapes, and shows why topological modeling for vector graphics is in fact much harderthan it seems. This chapter can be read independently of the other chapters.Chapter 4. Vector Graphics Complexes: The Topology of Vector Illustrations. Thischapter provides an analysis of the vector graphic complex, together with many practical consid-erations, results, and informal discussions. This chapter can be read independently of the otherchapters, but reading Chapter 3 beforehand makes it more insightful, as it provides a rationale formost design decisions behind the VGC, and a framework to rigorously infer the set of topologicaloperators acting on VGCs.Chapter 5. Vector Animation Complexes: The Topology of Vector Animations. Thischapter introduces the vector animation complex, a topological data structure to represent vectorgraphics animations whose topology can change over time. Reading Chapter 4 is recommendedbefore reading this chapter. Indeed, each time-slice of a VAC is nothing else but a VGC, thus agood understanding of the VGC is required to understand the VAC.Chapter 6. Conclusion. Finally, we conclude the dissertation with a summary of the contri-butions of this thesis, and discuss its implications and the road that is still ahead of us.5Chapter 2Background and Related WorkVector graphics, computer animation, and topological modeling are some of the core subelds thathave driven research in the early years of computer graphics. In order to better understand wherethis thesis ts in the big picture, let us recall some of the most relevant bits of the fascinating historyof computer graphics. Most of the historical elements presented here come from various sourceswhich include the two textbooks Fundamentals of Computer Graphics [Shirley and Marschner 2009]and Fundamentals of Interactive Computer Graphics [Foley and Van Dam 1982], the books CG 101[Masson 1999] and Creativity, Inc. [Catmull and Wallace 2014], and the online content of a coursefrom Ohio State University [Carlson 2003]. However, please note that our aim here is not to beexhaustive. For conciseness, we omit a lot of key players, and only focus on those that we thinkbetter help understand why and how we arrived where we are today, in the elds most relevant tothis thesis. For a more exhaustive and accurate history, I highly recommend to read the referencesprovided above, especially [Carlson 2003] which is easily accessible and a fascinating read. Then,following Section 2.1, we survey the state of the art in the elds most related to this thesis.2.1 Historical BackgroundComputers are useful to humans only to the extent that we are able to communicate with them,and improving this communication has always been of critical importance to the developmentof computing technology. Computer graphics, and especially the introduction of graphical userinterfaces (GUIs), was one of the key communication medium that has allowed computers to reachthe general public, without which we wouldn’t have computers in our pockets today.From Punched Cards to Graphical Displays In the early age of computing, a standard com-munication medium was the 80-column IBM punched card, introduced by Hollerith in 1928, andused until the 1970s. During this period, there was barely any interactivity: computers were givendata and programs to execute from humans via punched cards (and later tapes or keyboards) andgave an answer to humans also via punched cards, text printed on paper, lights, bells, or switches.For instance, The ENIAC computer (Figure 2.1a), completed in 1946 at the University of Penn-sylvania, used punched cards both as input and output. A few years later, the more advanced62.1. Historical Background(a) The ENIAC computer (b) The UNIVAC I computerFigure 2.1: (a) The ENIAC computer. Source: Wikipedia, Copyright 2005 Paul W Shaer, University ofPennsylvania, licensed under CC BY-SA 3.0. (b) The UNIVAC I computer. Source: Wikipedia, submitted by user‘Daderot’, Public Domain.(a) Vector display (b) Raster displayFigure 2.2: The two types of CRT displays, at the origin of the terminology vector graphics vs raster graphics.Source: inspired from [Carlson 2003].UNIVAC I computer (Figure 2.1b), commercialized in the United States starting 1951, also acceptedpunched cards as input/output. However, it also accepted magnetic tapes, and could be hooked toother output devices such as an electric typewriter, and more importantly in the context of thisdissertation, an early Tektronix oscilloscope.Raster Displays vs Vector Displays Oscilloscopes, and more generally cathode ray tubes(CRTs), are indeed the rst type of graphical display systems that were used with computers.There are two types of CRT displays: vector displays and raster displays, also called random-scandisplays and raster-scan displays [Foley et al. 1990, Chapter 4]. In both cases, a CRT is made of anelectron gun emitting a stream of electrons that eventually hits a phosphor-coated screen, emittinglight. However, in CRT vector displays, the trajectory of the electron gun follows a sequence72.1. Historical Backgroundof user-specied MoveTo(X,Y) and LineTo(X,Y) commands (Figure 2.2a), while in CRT rasterdisplays it follows a xed trajectory covering the whole screen with a predened number of scanlines (Figure 2.2b). Note that vector displays were incapable of drawing many features that arenow common in vector graphics, such as lines of varying width, lled interiors of given contours,and specic join styles between vector lines (e.g., miter joins, as seen in Figure 2.5). All of theseare possible with raster displays via rasterization algorithms. This limitation of vector displays,and thus of Sketchpad, may in fact be an important reason why Sketchpad was able to featuretopological modeling, while current vector graphics applications do not. Vector displays were usedup to the 1970s due to their more aordable price, but are now obsolete in favor of today’s rasterdisplays. The distinction between these two types of displays is at the origin of the terminologyvector graphics versus raster graphics.Sketchpad: Pioneering Interactive Computer Graphics In 1959, the TX-2 computer wasbuilt at the MIT [Reilly 2003, p261], and included a nine-inch CRT vector display as output, as wellas a light pen as input, a technology also developed at the MIT as part of the Whirlwind project afew years earlier. The combination of this graphical input/output enabled Ivan Sutherland to buildSketchpad [Sutherland 1963], the rst ever GUI, which is one of the most signicant milestonesever achieved in computer graphics history, and especially interactive graphics. Notably, the an-cestor of vector graphics was born. As mentioned in the Introduction, it is interesting to note thatthis ancestor of vector graphics featured some aspects of topological modeling, such as the correctrepresentation of 3-way joins (see Figure 1.1), which Adobe Illustrator does not properly supporttoday. However, it is important to recall that due to the limitations of the vector display, Sketch-pad’s topological model did not have to support faces (2D regions lled with a given color), norto support the rendering of various join styles, both of which are important features that AdobeIllustrator had to support early on. These features make topological modeling much harder, as wewill see in Chapter 3.DAC-1: Pioneering Computer-Aided Design In the same period of time, roughly from 1959to 1967, computer-aided design (CAD) also started to emerge, with IBM and General Motors work-ing together on a project called DAC-1 (Design Augmented by Computers). This project aimed atproving the feasibility of using computers to solve problems related to vehicle-body design [Krull1994]. They were using a similar system as Sketchpad, with a CRT display as output and a lightpen as input, but instead were working on three-dimensional mathematical car models. Very early,they also noticed the importance of storing the topology of the model, i.e., not just the shape of thesurfaces, but also the incidence relationship between the dierent surfaces. From this point on, theCAD industry became one of the strongest driving forces of computer graphics, with topologicalmodeling at its core. In contrast, within the eld of vector graphics, topological modeling failedto take root, which motivates this thesis.82.1. Historical BackgroundThis gure was removed due to copyright restrictions. It was a frame from [Capen et al. 2014]showing an excerpt of PostScript syntax and the corresponding illustration.Figure 2.3: The PostScript graphics language for printing. Source: [Capen et al. 2014], Copyright 2014 AdobeSystems Inc.From Sketchpad to Pixar and Adobe In 1968, Ivan Sutherland, the author of Sketchpad,moved to the University of Utah to become a professor, and co-founded Evans and Sutherlandwith his friend and colleague David Evans. With their colleagues, students, and employees, in afew years, they went on to make many early breakthroughs in computer graphics, such as texturemapping, Z-buering, subdivision surfaces, and hidden surface removal. One of their doctoral stu-dents was Edwin Catmull, who started his PhD in 1970. After graduating in 1974, Edwin Catmullled the new and highly inuential Computer Graphics Lab at New York Institute of Technology(NYIT), then moved to California in 1979 to work for George Lucas at LucasFilm, where he led theGraphics Group that eventually became Pixar when spun-o as a separate corporation in 1986,with the nancial support of Steve Jobs. Another employee of Evans and Sutherland was JohnWarnock, whose importance is even greater in the context of this thesis. John Warnock startedworking for Evans and Sutherland in 1976, then moved in 1978 to Palo Alto to join Xerox PARC,also a very inuential research center in computer graphics. John Warnock was interested in de-veloping a graphics language to control printing, and he left Xerox in 1982 to co-found Adobe,where he developed PostScript (released in 1984), then Adobe Illustrator (released in 1987), whichis the rst software product of Adobe [Capen et al. 2014].PostScript and Adobe Illustrator Released in 1984, PostScript (see Figure 2.3) can be seen asthe rst widely adopted vector graphics le format, hence the rst widely adopted vector graphicsrepresentation. However, it was designed as a unifying language that every printer could under-92.1. Historical BackgroundThis gure was removed due to copy-right restrictions. It was a frame from[Capen et al. 2014] showing the splash-screen from Illustrator 1.(a) Splash screen of Adobe Illustrator 1This gure was removed due to copy-right restrictions. It was a frame from[Capen et al. 2014] showing a screenshotfrom Illustrator 1.(b) Screenshot of Adobe Illustrator 1Figure 2.4: Adobe Illustrator 1, released in 1987. Source: [Capen et al. 2014], Copyright 2014 Adobe SystemsInc.stand, and therefore focused on simplicity, not art-directability. In addition, in its early days (beforeIllustrator was released), it had to be written by hand by programmers, which further emphasizesthe focus on simplicity. These practical considerations may be one of the reasons why topologicalinformation, such as incidence relationships between paths, was left out of this standard. In 1987,Adobe released the rst version of Illustrator (see Figure 2.4) as a graphical front-end to createPostScript art, as well as typographic fonts. Illustrator did not support the topological modelingfeatures that were pioneered within Sketchpad, perhaps as a natural consequence of PostScriptnot supporting the encoding of topological information. Therefore, the rst version of Adobe Il-lustrator did not support the coordinated editing of edges sharing a common vertex (supported inSketchpad), or the coordinated editing of faces sharing a common edge (not supported in Sketch-pad either, since Sketchpad did not support lled regions at all). This choice was understandableat the time: as we will see in Chapter 3 and 4, implementing these features is in fact far from trivialwhen color lling and edge styling is also a requirement, and therefore given the many technicalconstraints of writing software back in 1987, the features that did make it to Illustrator 1.0 werealready a big achievement. However, it is surprising that very little progress has been made sincethen to identify and address these issues. Notably, nearly 30 years later, Adobe Illustrator CC 2016still does not properly support these features. Even though the LivePaint tool (Adobe’s implemen-tation of dynamic planar maps [Asente et al. 2007]) provides some aspects of coordinated editing,the objects created with this tool cannot interact with the more traditional paths which are stillwidely used and required as input to most Illustrator’s tools. Converting LivePaint groups to pathscauses the topological information to disappear, and therefore causes edge joins not to be properlyrendered. Finally, the full range of topological operators common in every CAD application, suchas merging or splitting edges, is not supported.102.1. Historical Background(a)(b)(c)(d)(e)(f)(g)desiredthree strokedtwo strokedtwo strokedtwo strokedone lledthree VGC edgesSVG pathsSVG pathsSVG pathsSVG pathsSVG pathwith shared vertex(future work)Figure 2.5: Styling issues when animating—or interacting with—a 3-way ‘miter’ join. (a) Desired style. (b-f) Incorrect styling using SVG in various ways. (g) Example of artefact-free styling that might be achieved usingVGC edges. However, note that in this thesis we only solve how to store the topological information, and the veimages in the last row were manually produced individually. How to computationally produce a good-looking,artefact-free miter join style from the topological information is a hard problem on its own, left for future work.112.1. Historical Background(a) (b)Figure 2.6: In order to represent geographic maps in SVG, such as here the 2016’s European Union, onemust duplicate geometric information at the boundary between countries, because SVG does not allow the rep-resentation of shared edges between faces. (a) SVG content as seen by end users. (b) Underlying topologicalrepresentation. Source: modied from Wikipedia, submitted by user ‘Ssolbergj’, licensed under CC BY-SA 3.0.Adobe’s Heritage Most vector graphics le formats and tools that followed PostScript andAdobe Illustrator used a similar data representation, and the topological modeling features ofSketchpad seem to have been forgotten by the vector graphics community. One can only speculatewhy, but it is probably an unfortunate combination of many factors. Perhaps subsequent tools hadto stay compatible with the industry standard set by Adobe. Perhaps they were simply heavilyinuenced by PostScript and Illustrator. Perhaps the few industrial players who tried to developtopological modeling for vector graphics did not have the mathematical background or time re-quired to tackle the issues that we identify and/or address in this thesis. Perhaps the academicresearchers who could have tackled these issues were not aware of them, because vector graphicstopology appears like a solved topic. Perhaps there is too little research on vector graphics in gen-eral, because most research leans towards 3D graphics which is more appealing to the majority ofscientists. In any case, the consequence of the lack of research in vector graphics is that to thisday, in 2016, the currently leading open standard for vector graphics, W3C SVG 1.1, still does notinclude any topological information [SVG Working Group 2011]. Therefore, something as seem-ingly simple as three edges sharing a vertex cannot be intuitively modeled, stylized, and animatedin your browser (see Figure 2.5). Also, any geographic map must store redundant geometric in-formation at the boundary between countries, because the current standard does not allow facesto share common edges (see Figure 2.6). The latter issue has already been identied by the com-munity, and extensions of SVG have been proposed [Moissinac 2010] to solve it, but they are not122.2. Related Work in Vector Graphics1 <path2 d="M 5,5 L 200,5 L 200 ,200"3 stroke -width="10"4 stroke="darkgreen"5 fill="lightgreen"/>Figure 2.7: The SVG representation, with an example SVG code (left), and the nal output (right). The dattribute species the geometry of the path, which in this case should be read as MoveTo(5,5), then LineTo(200,5),then LineTo(200,200).part of the current SVG 2.0 Candidate Recommendation [SVG Working Group 2016], thus are veryunlikely to be part of the future SVG 2.0 standard. Also, the solution is an ad-hoc primitive tosupport this specic feature, and not the fundamental change that is required to make topologicalinformation a rst-class citizen of the representation, as we propose in this thesis.In the three remaining sections of this chapter, we respectively review the most relevant subset ofthe state of the art in vector graphics, topological modeling, and animation.2.2 Related Work in Vector GraphicsSVG Representation The most common way to represent vector graphics illustrations, both inacademic and commercial systems, consists of using a set of independent paths which are layered,or stacked, on top of one another, such as the SVG representation [SVG Working Group 2011]. Eventhough there exist some nuances between dierent systems (e.g., Adobe Illustrator vs. Inkscape),they are essentially identical from a topological standpoint, therefore, for conciseness, we collec-tively refer to all such stacking-based representations as the SVG representation. Each path is aone-dimensional curve, for example represented via Bézier control points, which can be eitheropen or closed. To specify how each path is to be rendered, style attributes are attached to them.For instance, in SVG, the stroke attribute species the color of the curve, the stroke-widthattribute species the width of the curve, and the fill attribute species the color of the 2D re-gion “inside” the curve (where “inside” is dened by a winding rule, and open paths are implicitlyclosed using a straight line), as illustrated in Figure 2.7. The SVG representation is fundamen-tally limited in its ability to model even basic topological constructs, such as joining an edge (orpath) to the middle of another edge, or sharing an edge between two faces, as we have seen inSection 2.1.Depth Ordering Most stacking-based systems use a back-to-front rendering of paths, groupof paths, and layers to designate the occlusion relationships among objects, which are then com-posed together using alpha-blending [Porter and Du 1984]. However, illustrations with cycles132.2. Related Work in Vector Graphics(a) Paths (b) Colored (c) EditedFigure 2.8: Two examples of dynamic planar maps illustrations. (a) Open and/or closed paths are given asinitial input. (b) These paths dene a partition of the canvas into regions that can be independently colored.(c) Heuristics are used to preserve colored regions while the input paths are edited. Source: [Asente et al. 2007],used with permission.in the occlusion relations require developing work-arounds or alternate solutions. One approachis to develop local orderings [Wiley and Williams 2006, McCann and Pollard 2009] that allow forthe stacking order to be specic to a particular area of the illustration. For cases where the illus-tration arises from known 3D geometry, algorithms exist to identify the cycles and automaticallysplit a face so as to break the occlusion cycle [Eisemann et al. 2009]. Another solution that is par-ticularly well suited to the depiction of knots and folds is to implement deformations to the 3Dgeometry so as to produce a desired local stacking order as specied by a user [Igarashi and Mitani2010]. Other work is aimed at the automatic extraction of 2D contiguous faces from underlying3D geometry [Karsch and Hart 2011].Planar Maps Besides stacking-based systems, it is also common—although less common—torepresent vector graphics illustrations using planar maps [Baudelaire and Gangnet 1989]. A pla-nar map is a topological structure that is able to represent a partition of R2 into regions, delimitedby a set of intersecting 2D paths given as input (see Figure 2.8a), which can then be independentlyassigned style attributes such as color lling (see Figure 2.8b). One advantage of planar maps overstacking-based systems is that they can represent faces sharing common edges, which makes themmore suitable for a wide class of illustrations that cannot be easily decomposed into independentpaths. However, a diculty of this approach is that the planar map needs to be recomputed when-ever the original 2D paths are edited. By default, the need to compute a new planar map resultsin a loss of the attribute information stored with the original faces of the planar map. In prac-tice, it is in fact possible to devise heuristics for establishing correspondences between the newfaces and the original faces, thereby allowing the attribute information to be carried over afteredits [Asente et al. 2007] (see Figure 2.8c). Also, planar maps, as their name suggests, are unfortu-142.2. Related Work in Vector GraphicsThis gure was removed due to copyright restrictions. It was a gure from [Whited et al. 2010]showing two keyframes and the automatically generated inbetweens.Figure 2.9: Example of inbetween frames that can be automatically generated by leveraging the topologicalinformation encoded in stroke graphs. Source: [Whited et al. 2010].nately not able to represent regions that overlap with one another, which is a signicant hindrancefor artistic freedom. Several planar maps can be stacked as layers, but then shapes in dierent lay-ers cannot be topologically connected, unlike with our representation. Closely related to planarmaps, [Takayama et al. 2013] proposes a curve network representation well-suited for free-formsketching of patches decomposing a 3D mesh, useful for user-guided quad remeshing.Stroke Graphs Stroke graphs [Whited et al. 2010] represent the topology of a drawing as agraph, where nodes represent where strokes end or intersect, and edges represent the strokesthemselves. This topological information can be used to establish automatic stroke correspon-dences between two keyframes of a traditional 2D animation, and provide topology-aware in-terpolation of the strokes (see Figure 2.9). Also, it can be used to vectorize pencil line drawingswith accurate topology [Noris et al. 2013, Favreau et al. 2016]. However, stroke graphs do not ad-dress the issue of the representation of faces, and, to the best of our knowledge, no previous workwith stroke graphs discussed overlapping edges (even though the data structure supports them),or the usefulness of this structure as an interactive drawing paradigm. Our work can be seen asan extension of stroke graphs to support closed edges and faces, together with a theoretical anal-ysis of the consequences of allowing overlapping, and its application as an interactive drawingparadigm.Smooth-Shaded Vector Images In order to to represent vector graphics images with smoothshading, the simplest option is to ll each path with a linear or circular color gradient insteadof a solid color. This method is standard and has been widely available across all vector graph-ics systems for decades. A more recent technique is to use a gradient mesh, for instance denedas a Coons surface [Coons 1967]. This technique is implemented for instance in recent versions152.3. Related Work in Topological ModelingFigure 2.10: Example of smooth-shaded vector illustration obtained using diusion curves. Source: [Orzanet al. 2008], used with permission.of Adobe Illustrator and Corel CorelDraw, and has been successfully used to accurately vector-ize photograph images [Sun et al. 2007]. More recently, [Orzan et al. 2008] introduced diusioncurves, where smooth-shaded vector images are represented by two-sided colored paths, possiblyintersecting, whose color aect nearby regions via a diusion equation (see Figure 2.10). However,none of these representations are meant to or are able to represent the topology of line drawings,and therefore are not suitable for topological modeling. Though, they can potentially be used to-gether with our topological representation to provide smooth shading, which we leave for futurework.2.3 Related Work in Topological ModelingIn Section 2.2, we have discussed the limitations of existing vector graphics representations: theSVG representation [SVG Working Group 2011] and diusion curves [Orzan et al. 2008] do notstore any incidence relationships, stroke graphs [Whited et al. 2010] do store incidence rela-tionships between edges but do not represent faces, and planar maps [Baudelaire and Gangnet1989, Asente et al. 2007] do store incidence relationships between both edges and faces but canrepresent neither overlapping edges nor overlapping faces. Therefore, we found that none of theserepresentations were good candidates to support topological modeling for vector graphics. In thissection, we now review representations that have actually been successful to support topologicalmodeling, but outside of the realm of vector graphics. In this thesis, we took inspiration from theseexisting topological structures, and adapted them to the problems at hand.In Figure 2.11, we provide a comparison between these existing structures and the VGC, high-lighting how none of the existing structures satised our requirements. We wanted a topological162.3. Related Work in Topological ModelingWinged-Edge / HalfedgeQuad-EdgeRadial-Edge / Partial EntityCombinatorial MapsCell-Tuples / Generalized MapsChains of MapsSimplicial ComplexesCW ComplexesGeometric Complexes / SGC / STCPCS ComplexesSVG-Like RepresentationsPlanar MapsScales to arbitrary dimensionVector Graphics ComplexesAdmitscombinatorial representationOverlappingSharedboundariesNon-planar topologiesNon-orientabletopologiesNon-manifoldtopologiesN-sidedfacesFaces withinner holesClosededgesNon-planar /non-orientablefacesUnique minimaldecompositionN/AN/AFigure 2.11: Comparison between existing topological structures and ours (in bold). The two question marksmean that we conjecture this property to be true, although we have no formal proof yet. The parenthesesmean that even though vector graphics complexes do not explicitly encode non-planarity or non-orientabilityinformation for individual faces, they do allow for the representation of faces which humans would perceptuallyinterpret as being non-planar or non-orientable. Note that by non-planar faces, we mean non-genus-0 faces,i.e., faces which cannot be embedded in a plane. Most of these data structures do support “curved” faces (suchas a half-sphere), but very few support non-planar faces (such as a torus or a Möbius strip).structure with a representational power similar to the SGC [Rossignac and O’Connor 1989], butwith the geometric exibility of stacking-based systems (the SGC can only represent embeddings,and does not admit a purely combinatorial representation, unlike the SVG representation). Wewere able to achieve this by narrowing our scope to dimension 2, allowing us to make less com-promises on other features. Ultimately, the VGC can be seen as a variant of the radial-edge datastructure [Weiler 1986], extending it to support closed edges and non-planar faces, but with noradial ordering of edge-uses, no face-uses, no shells, and no regions.Array-Based Data Structures One of the simplest and most compact ways to represent atriangle mesh is as an array P = [p1, . . . , pn] of n positions pi ∈ R3, together with an array172.3. Related Work in Topological Modeling1 class Vertex {2 Point p;3 Edge *edge;4 };56 class Edge {7 Vertex *start , *end;8 Face *left , *right;9 Edge *startLeft , *startRight;10 Edge *endLeft , *endRight;11 };1213 class Face {14 Edge *edge;15 };1617 class WingedEdgeDS {18 std::set <Vertex*> vertices;19 std::set <Edge*> edges;20 std::set <Face*> faces;21 };endstartleft rightendRightendLeftstartLeft startRightFigure 2.12: Example implementation of the winged-edge data structure.I = [i1, i2, i3, . . . , i3m−2, i3m−1, i3m] of 3m indices ij ∈ [1..n], where each consecutive tripletof indices represents one triangle. The array I stores the topology of the mesh, while the arrayP , optional for applications that only care about topology, stores the geometry of the mesh. Thesame idea can be easily adapted to store quad meshes, or arbitrary polygonal meshes. In somecases, the size of the array I can be reduced by grouping triangles into “triangle strips”, avoidingto repeat redundant indices. In such cases, the amortized per-triangle storage cost can be as lowas one index i ∈ N. Due to their simplicity and compactness, these types of representations arevery popular as data formats (e.g., OBJ) or APIs (e.g., OpenGL), but they are generally not suitablefor interactive topological modeling sessions or geometry processing, since most topological editsor adjacency queries have a O(n+m) complexity.Winged-Edge Data Structure The winged-edge data structure [Baumgart 1972] is a simpledata structure that supports topological modeling for manifold, orientable polygonal meshes. Mostlocal topological edits and adjacency queries can be achieved in amortizedO(1) orO(ln(n)) time.The idea is to store, for each edge e, its two end vertices vstart and vend (in an arbitrary order),its two incident faces fleft and fright (in an order consistent with vstart and vend), and its four“wing edges”, that is, the four edges which are incident to e and in the boundary of either fleftor fright (see Figure 2.12). Each vertex (resp. face) arbitrarily points to one of its incident (resp.boundary) edges. The other incident (resp. boundary) edges can be discovered by traversing thestructure.182.3. Related Work in Topological Modeling1 class Vertex {2 Point p;3 Halfedge *halfedge;4 };56 class Halfedge {7 Vertex *vertex;8 Face *face;9 Halfedge *previous , *next;10 Halfedge *opposite;11 };1213 class Face {14 Halfedge *halfedge;15 };1617 class HalfedgeDS {18 std::set <Vertex*> vertices;19 std::set <Halfedge*> halfedges;20 std::set <Face*> faces;21 };vertexfaceoppositenextpreviousFigure 2.13: Example implementation of the halfedge data structure.Halfedge Data Structure The halfedge data structure [Weiler 1985, Kettner 1999] is equivalentto the winged-edge data structure, but allows for slightly more ecient traversal by splitting eachedge into two halfedges (see Figure 2.13). For instance, traversing all boundary edges of a givenface can be directly achieved via face->halfedge->next->next->next->..., while with thewinged-edge data structure, it requires some bookkeeping and a conditional statement to decidewhether "next" should be endLeft or startRight. However, this performance gain is in factnegligible, and not the primary reason to prefer this structure. More fundamentally, it is useful tobe able to refer to “a given edge, as seen from the perspective of a given face”, which is one wayto interpret the concept of halfedge. This interpretation turned out to be a key idea that most sub-sequent topological data structures relied upon, equivalent to the concept of edge-use extensivelyanalyzed by Weiler in his PhD dissertation [Weiler 1986]. This concept was later formalized andgeneralized to arbitrary dimension by [Brisson 1989] with the introduction of cell-tuples, whichwe detail later in this section. But for now, let us just observe that in the case of orientable surfaceswithout boundary, each edge is used exactly two times (i.e., each edge has exactly two incidentfaces), which is why we only need two "halfedges" to represent this class of surfaces.Quad-Edge Data Structure The quad-edge data structure [Guibas and Stol 1985] extendsthe ideas of the halfedge data structure in order to represent non-orientable surfaces. Intuitively,the ability to refer to "an edge, as seen from a face" is extended to also specify from which sideof the surface the edge is considered. As suggested by the original authors, imagine a small bug192.3. Related Work in Topological ModelingeOnext(e)(a) (b) (c)e Sym(e) Flip(e) Sym(Flip(e))Figure 2.14: Illustration of the concept of edge direction and edge orientation in the quad-edge data struc-ture. (a) The four dierent ways to walk along an edge, keeping the edge on your right. (b) Onext(e) is theedge obtained by rotating counterclockwise around the origin vertex of e. (c) Sym(e) is the edge obtained byswitching the direction of e, and Flip(e) is the edge obtained by switching the orientation of e.1 class EdgeRef {2 QuadEdge *q;3 int r;4 int f;5 };67 class QuadEdge {8 Data data [4];9 EdgeRef onext [4];10 };1112 class QuadEdgeDS {13 std::set <QuadEdge*>14 quadEdges;15 };dataonexte = (q, 0, 0) Rot(e) = (q, 1, 0)Sym(e) = (q, 2, 0) Flip(e) = (q, 0, 1)Figure 2.15: Example implementation of the quad-edge data structure.walking on the surface, along an edge (see Figure 2.14a). The bug can be on either side of the edge,and on either side of the surface, resulting in four dierent congurations. In the quad-edge datastructure, these four congurations are represented by splitting each edge into four edges, eachwith a given direction (from which vertex to which vertex), and a given orientation (which side ofthe surface)1. In order to traverse the data structure, each directed oriented edge e points to threeother directed oriented edges: Sym(e), Flip(e), and Onext(e) (see Figure 2.14b,c).In addition, the authors make the choice to explicitly represent in their data structure the dualof the mesh. This means that each of the four directed oriented edge e is paired with a dual1Interestingly, while many authors use direction and orientation interchangeably, those who do make a dierence aregenerally consistent with the usage of Guibas and Stol. Fundamentally, direction is a purely one-dimensional concept,while orientation requires the existence of two-dimensional objects (e.g., “edge direction” vs. “surface orientation”). Onecan say that a closed edge is “oriented clockwise”, but note how this only makes sense if the edge is embedded in anorientable surface, and an orientation of this surface is chosen (this choice may be implicit). If the edge is embeddedin a non-orientable surface, one can still choose a local orientation of the surface, which is what the quad-edge datastructure eectively does.202.3. Related Work in Topological Modeling(a) (b) (c)f1f3f2e1fu1fu2mate e1fu3fu4fu5fu6eu1eu2eu3eu4eu5eu6radialmatenextpreviousFigure 2.16: Illustration of the concept of edge-use and face-use in the radial-edge data structure. (a) The sixdierent ways to walk along an edge shared by three faces. (b) The corresponding six edge-uses (red), six face-uses (blue), and the previous and next pointers of one of the six edge-uses. (c) Cross-section of these edge-usesand face-uses, and their corresponding mate and radial pointers. Source: inspired from [Weiler 1986], Figure 17– 6, page 198.edge, eectively splitting in eight the original non-directed non-oriented edges of the mesh (seeFigure 2.15, right). To navigate between primal and dual elements, each of the eight directedoriented edge e points to Rot(e), the dual edge obtained after a “90° counterclockwise rotationaround its midpoint”. While this representation of the dual mesh is quite elegant and allows fora very compact implementation, it is in fact less fundamental than the aforementioned conceptof edge direction vs. orientation. Indeed, as noted by [Brisson 1989], the dual elements are notnecessary for representational power, and a variant of the quad-edge data structure without thesedual elements would still be able to represent non-orientable surfaces.As detailed in [Guibas and Stol 1985], implementations of the quad-edge data structure do notneed to allocate separate objects for each of the eight directed oriented edges. Instead, a singlequad-edge q can be used as reference, and all eight edges e can be referred to as triplets e = (q, r, f),with r ∈ {0, 1, 2, 3} and f ∈ {0, 1}. This way, the functions Rot(e), Flip(e), and Sym(e) areimplicitly given by Rot(q, r, f) = (q, r + 1, f), Flip(q, r, f) = (q, r, f + 1), and Sym(q, r, f) =Rot2(q, r, f) = (q, r + 2, f), thus do not require any additional storage. Only Onext(e) needs tobe explicitly stored, and taking advantage of symmetries, storing four of the eight Onext(e) perquad-edge is actually enough (see Figure 2.15, left).Radial-Edge Data Structure The radial-edge data structure [Weiler 1986] further extends theideas of the halfedge and quad-edge data structures, in order to represent non-manifold surfaces,such as when an edge is shared by three faces (Fig. 2.16a). Intuitively, in this specic case, the edgeis used six times: once for each of the two sides of each of the three incident faces (Fig. 2.16b).212.3. Related Work in Topological Modeling1 class RadialEdgeDS {2 Model *models;3 };45 class Model {6 Model *previous , *next;7 Region *regions;8 };910 class Region {11 Model *owningModel;12 Region *previous , *next;13 Shell *shells;14 };1516 class Shell {17 Region *owningRegion;18 Shell *previous , *next;19 // Mut. excl. alternatives:20 // 1. Non -degenerate21 FaceUse *faceUses;22 // 2. Wireframe23 EdgeUse *edgeUses;24 // 3. Steiner vertex25 VertexUse *vertexUse;26 };2728 class Face {29 FaceUse *faceUses;30 FaceGeometry geometry;31 };3233 class Loop {34 LoopUse *loopUses;35 };3637 class Edge {38 EdgeUse *edgeUses;39 EdgeGeometry geometry;40 };4142 class Vertex {43 VertexUse *vertexUses;44 VertexGeometry geometry;45 };4647 class FaceUse {48 Shell *owningShell;49 FaceUse *previous , *next;50 FaceUse *mate;51 LoopUse *loopUses;52 Face *face;53 bool orientation;54 };5556 class LoopUse {57 FaceUse *owningFaceUse;58 LoopUse *previous , *next;59 LoopUse *mate;60 Loop *loop;61 // Mut. excl. alternatives:62 // 1. Non -degenerate63 EdgeUse *edgeUses;64 // 2. Steiner vertex65 VertexUse *vertexUse;66 };6768 class EdgeUse {69 VertexUse *startVertexUse;70 EdgeUse *mate;71 Edge *edge;72 // Mut. excl. alternatives:73 // 1: Used as wireframe of74 // shell75 Shell *owningShell;76 // 2: Used as edge of77 // loop use78 LoopUse *owningLoopUse;79 EdgeUse *previous , *next;80 EdgeUse *radial;81 bool direction;82 };8384 class VertexUse {85 VertexUse *previous , *next;86 Vertex *vertex;87 // Mut. excl. alternatives:88 // 1. Used as Steiner vertex of89 // shell90 Shell *owningShell;91 // 2. Used as Steiner vertex of92 // loop use93 LoopUse *owningLoopUse;94 // 3. Used as start vertex of95 // edge use96 EdgeUse *owningEdgeUse;97 };Figure 2.17: Example implementation of the radial-edge data structure. “Mut. excl.” is a shorthand for“Mutually exclusive”, which means that only one of the alternatives has non-null pointers.222.3. Related Work in Topological ModelingThe two sides of each face are explicitly represented as two face-uses, all uses of each edge areexplicitly represented as edge-uses, and all uses of each vertex are explicitly represented as vertex-uses. By “explicitly represented”, we mean that objects of type VertexUse, EdgeUse and FaceUseare dynamically allocated (i.e., they have an identity), and they store pointers to neighboring usesin a linked-list fashion (see Figure 2.16b,c and Figure 2.17). This concept of explicit uses also existsin the halfedge data structure (each halfedge can be interpreted as one edge-use), but contrastswith the quad-edge data structure and the VGC, where these uses are implicit2.In addition, unlike the other data structures that we have seen so far in this section (but like theW3C SVG representation, planar maps, and the representations we introduce in this thesis), theradial-edge data structure allows faces to have inner holes. In other words, faces are not necessarilytopological disks. However, they must still be genus-0 (i.e., orientable and without handles), unlikein our PCS complex where we also waive this restriction. Both the outer boundary and innerholes (which, for curved surfaces, are topologically indistinguishable) are represented in the radial-edge data structure using the concept of loop, which is analogous to our concept of cycle3. Eachloop is used exactly twice—once for each side of the face it belongs to—and these two loop-usespoint to one another via their mate pointer. However, one can notice that the edge-uses thatcompose a given loop-use essentially contain the same information as the edge-uses that composeits mate loop-use. There exist many variants of the radial-edge data structures (e.g., [Gursoz et al.1990, Marcheix and Gueorguieva 1995]), and the partial entity structure [Lee and Lee 2001] is onethat factorizes this duplicated information to propose a more compact representation.Finally, the radial-edge data structure also denes the concepts of regions and shells, which arethe three-dimensional counterparts of faces and loops, in order to represent solid objects. Sincethe VGC only aims at representing two-dimensional objects, it has no equivalent of these con-cepts.Nef Polyhedra A Nef polyhedron [Nef 1978] is a point-set ofRn dened via boolean operationsof halfspaces. In other words, in the case of R3, it represents an arrangement of 3D solids, possi-bly non-manifold and with degeneracies (e.g., isolated points), whose boundaries are dened byplanes, i.e., edges are straight lines and faces are non-curved surfaces. [Granados et al. 2003] in-2In the case of the VGC, this is reected by the fact that the classes Vertex, Edge, and Face are used with pointersemantics, but the classes Halfedge and Cycle are used with value semantics, making it impossible to "point" to ahalfedge. However, we acknowledge that this implicit vs. explicit choice is more an implementation detail than a funda-mental property of the model. For instance, instead of being implemented as “std::vector<Halfedge> halfedges”,VGC cycles may be implemented as “EdgeUse *edgeUses”, where edgeUses is the rst node of a doubly linked-list,each node pointing to the “previous” and “next” edge-use, and possibly also pointing to “radial” edge-uses. These choicescorrespond to trade-os between readability, maintainability, storage costs, and performance costs, which we do notanalyze in this thesis.3In the VGC, we favored the terminology cycle instead of loop for consistency with graph theory and algebraictopology: a (directed) path is a sequence of (directed) edges, and a cycle is simply a closed path.232.3. Related Work in Topological Modeling1 template <unsigned int n>2 class Dart {3 Dart* beta[n];4 };56 template <unsigned int n>7 class CombinatorialMap {8 std::vector <Dart <n>*> darts;9 };dβ2(d)β1(d)Figure 2.18: Example implementation of combinatorial maps.troduces a data-structure similar to the radial-edge data structure to represent such non-manifoldspaces. The concept of sphere map, rst introduced in [Dobrindt et al. 1993], is used to providean explicit representation of the possibly non-manifold geometry around each vertex, unlike inthe radial-edge data structure where all vertex-uses of a given vertex are stored in no particularorder, and unlike in the VGC where even incident faces of a given edge are not ordered (since thisinformation is meaningless for vector graphics). However, since Nef polyhedra only representnon-curved surfaces, non-orientable surfaces or edges used three times by the same face are notsupported, unlike in the radial-edge data structure and the VGC.Combinatorial Maps Combinatorial maps [Edmonds 1960, Lienhardt 1989, Lienhardt 1991,Lienhardt 1994, Damiand and Lienhardt 2014], or n-maps, can be seen as an extension of thehalfedge data structure for arbitrary dimension. An n-dimensional combinatorial map is denedas a tuple (D,β1, . . . , βn) where:1. D is a nite set of elements called darts;2. β1 is a permutation on D;3. β2, . . . , βn are involutions on D;4. ∀i ≤ [1..n− 2], ∀j ≤ [i+ 2..n], βi ◦ βj is an involution on D.Let us clarify this denition in the case of the dimension 2. The rst condition states that thestructure is made of objects called darts. Imagine cutting each edge in two pieces at the midpoint,each of the two pieces would be a dart (see Fig. 2.18). You can also interpret each dart as a pair(vertex, edge), i.e., a vertex "as seen from an edge", or a halfedge. The second condition states thateach dart d points to a "next" dart β1(d). This is the equivalent of the "next" pointer in the halfedgedata structure. β1 is a permutation, which simply means that it is invertible. In other words, eachdart also has a "previous" dart β−11 (d). The third condition states that each dart d points to an"opposite" dart β2(d). This dart corresponds to the second piece of the original edge that was cutat the midpoint. β2 is an involution, which simply means that the opposite of the opposite of a242.3. Related Work in Topological Modeling1 template <unsigned int n>2 class Dart {3 Dart* alpha[n+1];4 };56 template <unsigned int n>7 class GeneralizedMap {8 std::vector <Dart <n>*> darts;9 };dα0(d)α2(d)α1(d)d′ = α0 ◦ α2(d)Figure 2.19: Example implementation of generalized maps.dart is the same dart. In other words, β2 groups the darts by pairs, each pair being one edge. Thelast condition ensures that topological constraints are satised, which is always true for n = 2.Please refer to [Lienhardt 1989, Levy and Mallet 1999] for more details on why the condition isrequired for higher dimensions. Note that unlike the VGC, combinatorial maps do not supportnon-orientable or non-manifold surfaces.Generalized Maps Generalized maps [Lienhardt 1989, Lienhardt 1991, Lienhardt 1994, Damiandand Lienhardt 2014], or n-G-maps, are a generalization of combinatorial maps to support non-orientable surfaces. An n-dimensional generalized map is dened as a tuple (D,α0, . . . , αn)where:1. D is a nite set of elements called darts;2. α0, . . . , αn are involutions on D;3. ∀i ≤ [0..n− 2], ∀j ≤ [i+ 2..n], αi ◦ αj is an involution on D.Let us clarify this denition in the case of the dimension 2. Unlike combinatorial maps, eachoriginal edge of the represented surface is not split in two, but in four darts (see Fig. 2.19). Similarlyto the quad-edge data structure, this additional granularity permits the representation of non-orientable surfaces. Each dart can be interpreted as a triplet (vertex, edge, face), i.e., a vertex "asseen from an edge, as seen from a face". For each dart d = (v, e, f), the involution α0 pairs d withthe only dart α0(d) = (v′, e, f) seen from the same edge and the same face, but a dierent vertex.The involution α1 pairs d with the only dart α1(d) = (v, e′, f) seen from the same vertex andthe same face, but a dierent edge. Finally, the involution α2 pairs d with the only dart α2(d) =(v, e, f ′) seen from the same vertex and the same edge, but a dierent face (see Fig. 2.19).The involution α2 can be interpreted as "sewing" together the edges of dierent faces. Using thissewing interpretation, one can observe that α0 and α2 are not independent, since sewing one dartd mandates how α0(d) should be sewed. More precisely, for any given d, once α0(d) and α2(d)are dened (see Fig. 2.19), then it should be clear that d′ = α0 ◦α2(d) is the fourth dart composing252.3. Related Work in Topological Modelingevfd1 d2d1 d2evfFigure 2.20: Two examples of "self-sewing" faces, i.e., faces whose boundary is partly sewed to itself. In otherwords, the same edge is "used" two times by the same face. Unlike n-G-maps, cell-tuples cannot represent suchfaces, because the tuple (v, e, f) corresponds in fact to two darts d1 and d2, instead of a single dart. Formally,this limitation is expressed by the fact that cell-tuples can only represent “regular” cell decompositions of n-manifolds (we give more detail in our following paragraph on regular CW complexes).the edge, and that we also have d = α0 ◦ α2(d′). Therefore, α0 ◦ α2 must be an involution, whichis expressed by the third condition of the denition.Cell-Tuples In the same year that Lienhardt introduced generalized maps4, Brisson introducedthe cell-tuple structure [Brisson 1989]. Apart from not supporting "self-sewing" faces (see Fig-ure 2.20), the cell-tuple structure is equivalent to generalized maps, but with a dierent formalism,centered around this idea of vertex "as seen from an edge, as seen from a face". The connectionbetween cell-tuples and generalized maps is well explained and illustrated in [Levy and Mallet1999]. Given a subdivided5 n-manifold, Brisson rst denes the familiar concept of incidence: acell c is incident to another cell c′ if and only if c is contained in the boundary of c′. In this case,we write c < c′ . If more specically, we have dim(c) = dim(c′) − 1, then we write c ≺ c′.This denes a partial ordering of the cells, which in turns denes the incidence graph of thesubdivided manifold. Finally, a cell-tuple is dened as an n + 1-tuple (c0, c1, . . . , cn) such thatc0 ≺ c1 ≺ · · · ≺ cn (i.e., a path in the incident graph from a leaf to a root [Levy and Mallet 1999]).In the case n = 2, this simply means that a cell-tuple is a triplet (v, e, f) where v is an endpointof e, and e is a boundary edge of f . Brisson then proves that for every ck−1 ≺ ck ≺ ck+1, thereis a unique c′k 6= ck such that ck−1 ≺ c′k ≺ ck+1. For each k in [0..n], this denes a functionswitchk(c0, . . . , ck−1, ck, ck+1, . . . , cn) = (c0, . . . , ck−1, c′k, ck+1, . . . , cn) on cell-tuples. Thesefunctions are equivalent to the involutions αk that dene generalized maps.Chains of Maps Chains of maps [Elter and Lienhardt 1992, Elter and Lienhardt 1993, Elter andLienhardt 1994, Damiand and Lienhardt 2014], or n-chains, are an extension of generalized mapsto support non-manifold spaces. For conciseness, we only provide in this paragraph a simpli-4In fact, at the same conference, Symposium on Computational Geometry ’89.5Formally, a manifold with a nite regular CW decomposition; informally, a manifold subdivided into vertices, edges,faces, etc.262.3. Related Work in Topological Modeling1 class Vertex {2 std::vector <Edge*> incidentEdges;3 };45 class Edge {6 Vertex *startVertex , *endVertex;7 std::vector <Vertex*> incidentFaces;8 };910 class Triangle {11 Edge *e1, *e2 , *e3;12 };1314 class TriangleMesh {15 std::vector <Vertex*> vertices;16 std::vector <Edge*> edges;17 std::vector <Triangle*> triangles;18 };Figure 2.21: Example implementation of two-dimensional simplicial complexes.ed, slightly inaccurate denition of n-chains; please refer to the original papers (e.g., [Elter andLienhardt 1993]) for details. The idea is to iteratively build a non-manifold space by gluing theboundary of cells of higher dimensions to cells of lower dimension, a common technique used inalgebraic topology (see CW complexes). More specically, the i-th step of the process denes allcells of dimensions i via an i-G-map Gi = (Di, αi0, . . . , αii), together with a tuple (σi0, . . . , σii−1),where σij is an application from Di to Dj , gluing the boundary of i-cells to lower-dimensional j-cells. An n-chain is then dened as the structure ((Gi)i=0,...,n, (σij)0≤j<i≤n) composed of all n+1generalized maps and all σij . While chains of maps are indeed able to represent non-manifoldspaces, and provide a useful theoretical insight, they do not seem to have been widely used inpractice. One reason may be that most application cases only focus on the dimension 2 or 3, forwhich more compact (and arguably more intuitive) representations exist.Simplicial Complexes Simplicial complexes are one of simplest and most popular structures torepresent non-manifold topological spaces. They are taught in most introductory class in algebraictopology [Munkres 2000, Hatcher 2001, Lee 2011], and are widely used in practice in the computergraphics industry [De Floriani et al. 2010]. In the two-dimensional case, a simplicial complex issimply a triangle mesh (possibly non-manifold and with isolated vertices and edges). We give anexample and one of many possible implementations in Figure 2.21. Simplicial complexes easilyscale to arbitrary dimension: we give a formal denition in Appendix A, together with some con-text and discussion. The simplicity and representational power of triangle meshes makes themhighly suitable for many applications. However, their obvious disadvantage is that the repre-sented objects must be decomposed into triangles. For some applications, this is neither desired272.3. Related Work in Topological Modelingv1 e1 v2e2fv1e1v2e2f(a) (b)v1v4v2v3e3e4e1e2f(c) (d)vfFigure 2.22: (a) Example of CW complex. (b) Illustration of the glue operations that dene the CW complex.(c,d) Two more examples of valid CW complexes.or practical, since it would result in many triangles, when a more compact subdivision with lesscells could be used. For instance, in the case of vector graphics, shapes are naturally authored bydrawing their boundary (a directed closed curve), and rendered using a winding rule. It would beprohibitive and non-intuitive to ask artists to manually author triangles, and while a triangulationcan be automatically computed, a triangle mesh still would not capture the higher-level semanticsof the drawing (for instance, dening per-triangle style attributes wouldn’t make sense). One ap-proach could be to use a triangle mesh together with a partition of the triangles into “meta-cells”(for instance, nearly manifold cells [De Floriani et al. 2003]), and only attach style attributes tothese meta-cells. Our approach can be seen as directly representing these meta-cells without theunderlying triangulation, which is possible for the dimension 2 thanks to the known classicationof compact 2-manifolds (see Appendix A), but would be impossible for higher dimensions.CW Complexes CW complexes [Munkres 2000, Hatcher 2001, Lee 2011] are one of the most(perhaps the most) used structures in modern algebraic topology to represent non-manifold spaces.Their denition, which we recall in Appendix A, provides a sweet balance between simplicity andgenericity that makes them a powerful tool as a proof mechanism. Unfortunately, not all CWcomplexes can be represented with a computer due to their non-combinatorial nature, thus they are“too generic” for use within computer graphics. Nonetheless, their theoretical importance makesthem highly relevant to the eld of topological modeling, including this thesis, and we informallydescribe them in this paragraph. Like chains of maps, CW complexes are built iteratively by gluingthe boundary of cells of higher dimension to cells of lower dimension (see Figure 2.22a,b). In thecase of two-dimensional CW complexes, a “cell” means a point, an edge, or a topological disk. Notethat such cells are continuous pointsets, that is, geometric objects (unlike in chains of maps, wherecells are represented as darts, that is, combinatorial objects). For each cell c, a “glue” operation isdened as a continuous function Φc from the boundary of the cell c to cells of lower dimension(unlike in chains of maps, where the glue operation is a combinatorial function from darts to darts).The function Φc does not have any other restrictions than to be continuous, in particular, it does282.3. Related Work in Topological Modelingx2 + y2 − z2 = 0(a)z − 1 = 0(b) (c)Figure 2.23: (a) Example of algebraic variety. (b) Decomposition of the variety into extents, with singularitieshighlighted in red. (c) Example selective geometric complex (SGC) whose cells are open subsets of extents.not have to be dierentiable or invertible, which is what makes the class of all CW complexes verygeneric and not representable combinatorially (the set of all continuous functions is not countable).For example, in Figure 2.22c, the function Φf makes a “switch-back” in the interior of e1, andthus is not invertible. There isn’t even a requirement that a vertex exists at the switch-back. InFigure 2.22d, the whole boundary of the disk f is mapped by Φf to a single vertex v, thus creatinga sphere. This last situation is allowed neither by chains of maps nor by the radial-edge structure,but is allowed by our PCS complexes and vector graphics complexes. In fact, notice how in thisexample, there isn’t even a single edge! Therefore, it is obvious that the concept of cell-tuplecannot be used to represent such a subdivision.Regular CW Complexes If for each cell c, the function Φc is in fact invertible and its inverseis continuous (i.e., if Φc is an homeomorphism, more on this later), then the CW complex is calledregular. In other words, regular CW complexes do not allow the boundary of cells to be glued tothemselves, as in Figure 2.22c,d, or in Figure 2.20. With this additional restriction, all (nite) regularCW complexes can in fact be represented be any of the aforementioned non-manifold structures,except simplicial complexes. However, in the context of vector graphics, it is sometimes usefulto represent non-regular CW complexes. In fact, as we detail in Chapter 3, it is even useful torepresent cell decompositions which are not CW complexes at all, for instance decompositionsthat involve disks with inner holes represented as one single face. Such faces are already allowedby SVG, planar maps, the radial-edge data structure, and selective geometric complexes.Selective Geometric Complexes Simplicial complexes and CW complexes share the commonidea to build non-manifold spaces by gluing together simple manifold pieces (respectively, n-simplices and n-disks). Selective geometric complexes (SGCs) [Rossignac and O’Connor 1989]and their extension structured topological complexes (STCs) [Rossignac 1997] take the oppositeapproach by starting with a given non-manifold space, and decomposing it into manifold pieces,dening what they call a geometric complex. More specically, the denition of a SGC starts with292.4. Related Work in Animationthe concept of algebraic variety, that is, a subset of Rn dened as the zero level set of a given niteset of degree-n polynomials (see Figure 2.23a). Such variety generally has singularities (cusps, self-crossing, isolated lower-dimensional pieces, etc.), and these singularities dene a partition of thevariety into extents, where each extent is a connected sub-manifold of the variety (see Figure 2.23b).A cell is then dened as any connected open subset of an extent, and a geometric complex is denedas a nite collection of cells cj , with j ∈ J , such that:1. ∀i 6= j, ci ∩ cj = ∅2. ∀j ∈ J, ∃I ⊂ J, ∂cj = ⋃I ciA selective geometric complex is then dened as a geometric complex where each cell stores anextra attribute called “active”, specifying whether the cell should be included in the pointset denedby the SGC (see Figure 2.23c, where dashed lines represent inactive edges). This allows SGCs torepresent non-closed pointsets.Note how the denition of geometric complexes allows closed edges and disks with inner holes, asillustrated in Figure 2.23c (more generally, it allows cells which are not necessarily homeomorphicto n-disks). This was a deliberate and important design decision taken by the authors, which theymotivate in [Rossignac 1997, Section 3.6]. Our PCS complexes and vector graphics complexes alsoallow such cells, for very similar reasons, which we detail in Chapter 3. This makes SGCs and PCScomplexes very similar in terms of intent and topological expressiveness. In fact, the notion of SGCwas an important source of inspiration for the design of our structures. Unfortunately, due to theirdenitions relying on explicit embeddings inRn, SGCs lack the geometric exibility that we desirefor vector graphics. Notably, like planar maps, SGCs do not support the concept of overlapping.This stems from the lack of a purely combinatorial denition from which to dene an immersion.More precisely, while a combinatorial structure is associated with every SGC (an augmented in-cidence graph), this combinatorial structure alone does not fully specify the non-manifold objectup to homeomorphism. In other words, some topological information is encoded in the polyno-mial coecients of the underlying algebraic variety, such as whether a face is orientable, or howmany times a bounding edge is “used” by the face. Finally, even though STCs cyclically order thefaces around any given edge, neither SGCs nor STCs cyclically order the edges bounding a givenface. For vector graphics applications, we require such cycles for the unambiguous computationof winding numbers, used for rendering.2.4 Related Work in AnimationTopology-unaware inbetweening Cartoon animation [Thomas and Johnston 1987, Blair 1994,Williams 2009] consists in drawing a nite sequence of pictures that gives the illusion of motion.302.4. Related Work in Animation? ?Figure 2.24: Three keyframes with inconsistent topology, making automatic inbetweening challenging. Orig-inal design by James Lopez, used with permission.This gure was removed due to copyright restrictions. It was four images from [Liu et al. 2011]showing the dierent steps involved to apply their technique.Figure 2.25: Illustration of the dierent steps to compute stroke correspondence using shape descriptors andmanifold learning. Source: modied from [Liu et al. 2011].312.4. Related Work in AnimationFigure 2.26: Illustration of an approach that transfer existing cartoon motion to new shapes. Source: [Bregleret al. 2002], used with permission.It was expected that automatic inbetweening of vectorized strokes would make cartoon animationeasier, but this task appeared to be much more complex than expected [Catmull 1978], one reasonbeing inconsistent topology between keyframes (see Figure 2.24). Early stroke-based approaches[Burtnyk and Wein 1971, Reeves 1981, Fekete et al. 1995] are manual (the animator selects pairsof strokes to interpolate) and topology-unaware (strokes are interpolated independently, unawareof their neighbors). More recently, [Liu et al. 2011, Yu et al. 2012] have proposed to use shapedescriptors and machine learning techniques to compute stroke correspondences automatically,however, the shape descriptors are based on stroke sampling and therefore are also topology-unaware (see Figure 2.25). Nonetheless, once the per-sample correspondence is computed, thisinformation is aggregated per-stroke, possibly allowing one stroke to split into several strokes, aswe also allow in our vector animation complex, among many other topological events.Topology-aware inbetweening [Kort 2002] introduces semantic relations between strokes (e.g.,intersecting, or dangling), together with inference rules to nd stroke correspondences automati-cally. To the best of our knowledge, this is the rst work attempting to leverage topology to solvethe correspondence problem. However, this approach could only be applied for cases that canbe resolved via an invariant layering, and it is unclear whether it can scale to complex examples.Later, [Whited et al. 2010] introduced stroke graphs, a concept which we already presented inSection 2.2. Given two stroke graphs and initial stroke correspondences, the two graphs can betraversed in parallel to propagate stroke correspondences, stopping at topological inconsistencies.Unfortunately, unlike the method we introduce in Chapter 5, none of these methods can producespace-time continuous animations with time-varying topology, since it is not allowed by theirrepresentation. Also, none of these methods address coloring.Data-driven inbetweening An alternative approach to generate cartoon animations is to reuseexisting content. [Bregler et al. 2002] extracts animated ane transformations and weight coe-322.4. Related Work in AnimationFigure 2.27: Automatic painting using LazyBrush: (a) original drawing F1 with color scribbles S1, (b) seg-mentation R1 of F1 using scribbles S1, (c) painted drawing (F1 + R1), (d) initial overlap of the source F1with scribbles S1 and the target frame F2, (e) registration of the source frame F1 with the target frame F2, andtransfer of scribbles S1 using as-rigid-as-possible deformation eldW12, (f) painted drawing (F2 +R2) usingtransferred scribblesW12(S1). Source (image + caption): [Sýkora et al. 2011], used with permission.Figure 2.28: Example inbetweens obtained using shape morphing. Source: [Baxter et al. 2009], used withpermission.cients from existing cartoons, which can be transferred to new shapes (see Figure 2.26). [de Juanand Bodenheimer 2006] performs a semi-automatic segmentation of the input video to combineparts of existing content together. New inbetweens can be generated by dening an implicit space-time surface interpolating extracted contours, however, no change in topology is allowed, sinceinterpolated contours are always closed curves. [Zhang et al. 2009] proposes a method to vector-ize input cartoon animations, allowing to edit them. However, their outputs are stacked layers ofpaths, thus cannot represent topological events.Shape morphing Another way to generate inbetweens is shape morphing, where a shape is aclosed curve (its boundary), together with a raster image (its interior). The simplest method tointerpolate two given shapes consists in computing a linear interpolation of the positions of allsamples along the boundary. Unfortunately, this method typically causes "shrinkage", that is, itdoes not preserve the area of the shapes to interpolate. Instead, [Sederberg et al. 1993] proposes tointerpolate the lengths and relative angles of curve segments. Later, [Alexa et al. 2000] proposesto interpolate compatible triangulations of the shapes by minimizing an as-rigid-as-possible en-ergy, and uses texture blending for the interior pixels. This technique was widely successful, andseveral improvements have been developed [Fu et al. 2005, Baxter et al. 2009]. Also, the approachhas been adapted for interactive shape manipulation [Igarashi et al. 2005]. One of the rst stepsin these methods consist in nding an initial arc-length correspondence between the two closedcurves, which can be achieved using curvature-based methods [Sebastian et al. 2003]. An alterna-tive approach to shape morphing is introduced by [Sýkora et al. 2009], where they align the two332.4. Related Work in AnimationFigure 2.29: Example of non-photorealistic rendering obtained using snaxels. Source: [Karsch and Hart 2011],used with permission.shapes using an iterative method, alignment which can be used for temporal noise control [Noriset al. 2011], or texture transfer [Sýkora et al. 2011], as illustrated in Figure 2.27. Unfortunately,none of these methods can produce space-time continuous animations of vectorized curves withchanging topology, since by denition every shape has the topology of a disk, and their interior isnot vectorized, typically leading to blurring artifacts (see Figure 2.28).Stylizing 3D animation A natural approach to handle image-space topological events is toanimate in a dierent space where no topological events occur, e.g., 3D animation [Lasseter 1987],in which case a xed number of degrees of freedom can be keyframed independently. From a 3Dmodel, one can compute vectorized 2D feature lines (e.g., [Bénard et al. 2014]), from which it ispossible to extract cycles for coloring using depth-ordered paths [Eisemann et al. 2009] or planarmaps [Karsch and Hart 2011], which can be further processed in 2D for stylization (see Figure 2.29).However, the 3D-to-2D conversion is typically a per-frame process and therefore does not outputa time-continuous 2D animation. To address this issue, [Karsch and Hart 2011] track snaxels’ 3Dpositions in the original mesh to generate correspondences across 2D frames, [Buchholz et al. 2011]computes a parameterization of the space-time surface swept by the silhouette lines, and [Bénardet al. 2012] uses an image-space relaxation method to deform, split and merge active strokes atframe i to match the feature lines of frame i+ 1. Unfortunately, unlike the method we introducein Chapter 5, all of these methods require to create a 3D animation beforehand. In addition, theiroutput representation either does not support vectorized coloring [Buchholz et al. 2011, Bénardet al. 2012], or breaks the animation into contour sequences that do not change in topology [Karschand Hart 2011]. In Chapter 5, we present a novel representation that we believe could be used asoutput of these existing methods to address their limitations.342.4. Related Work in AnimationFigure 2.30: Representing an animation as a space-time non-manifold object. Source: [Buchholz et al. 2011],used with permission.Using hybrid “2.5D” models To have better image-space control of style, but still animatein a space free from topological events, [Fiore et al. 2001, Rivers et al. 2010] introduce hybridmodels where shapes are dened in 2D, but their interpolation and depth-ordering is guided by3D information. Unfortunately, these approaches tend to reduce the space of possible animations(compared to freeform hand-drawn animation), and only allow the representation of topologicalevents which are solved by depth ordering.Space-time modeling Finally, another approach to generate 2D animations, the one we adoptin Chapter 5 of this thesis, is to consider animated lines as surfaces in space-time [Fausett et al.2000, Kwarta and Rossignac 2002, de Juan and Bodenheimer 2006, Southern 2008, Buchholz et al.2011], and animated faces as volumes in space-time [Fausett et al. 2000, Southern 2008]. There-fore, animating becomes modeling in space-time, which makes possible to represent topologicalevents, unlike when using the model-then-animate paradigm (see Figure 2.30). The time dimen-sion can also be replaced by more abstract parameters [Ngo et al. 2000, Fausett et al. 2000], leadingto 4D or even higher dimensional objects. Recently, space-time meshes have also been used foruid simulation inbetweening [Raveendran et al. 2014]. In theory, any non-manifold topologi-cal representation could be used to apply these concepts, as long as they can represent objectsof suciently high dimension. For instance, simplicial complexes [De Floriani et al. 2010] couldbe a natural choice for their simplicity and scalability in dimension. Other popular non-manifoldrepresentations which we have presented in Section 2.3, such as selective geometric complexes[Rossignac and O’Connor 1989], or the radial-edge data structure [Weiler 1985], could be used aswell. However, none of these representations have been designed to represent space-time objects.Therefore, while they are very appropriate for their intended use (e.g., solid modeling), they areless intuitive to manipulate for space-time modeling. What makes our concept of vector anima-352.4. Related Work in Animationtion complex stands out is that by design, it treats the time dimension separately from the spacedimensions, enabling a keyframing paradigm similar to what animators are already familiar with.For instance, instead of a 1D entity called “edge”, we make the distinction between two types of1D entities: a key edge (1D in space; 0D in time), which represents an edge at a given time, andan inbetween vertex (0D in space; 1D in time), which represents an interpolation between two keyvertices. Even though they are both 1D in space-time, they are created, edited, and visualizeddierently, reecting a cleaner semantics.36Chapter 3The Theoretical Foundations of VectorGraphics TopologyFigure 3.1: Allowing 2D vector graphics shapes to overlap and to share edges enables users to depict non-planar topologies, possibly non-orientable, such as here a Möbius strip.Vector graphics technologies have been around for a long time. In fact, the vector graphics sys-tem Sketchpad [Sutherland 1963] is generally considered to have pioneered interactive computergraphics, which makes vector graphics one of the oldest subelds of computer graphics. However,despite its seniority, the theoretical foundations required to rigorously study topological modelingfor vector graphics are still lacking. In this chapter, we introduce the notion of PCS complex as aformal tool to better understand the mathematical nature of vector graphics topology, and fromwhich modern vector graphics systems can be derived. In particular, vector graphics complexes,which we introduce in Chapter 4, are largely based on PCS complexes. Those readers who preferto get a better understanding of the practical applications before diving into the theory, you maysafely skip this chapter for now and read it last. However, for those who do not mind a little theo-retical detour before getting to the more practical contributions of this thesis, reading this chapterrst is likely to make reading the other chapters much more insightful and enjoyable.In Section 3.1, we shall start by clarifying the meaning of topology, which is either combinatorialor geometric depending on the context. In Section 3.2, we show that in the case of vector graphics,reasonable design decisions result in a topology that includes some of the most generic classes ofcurves and surfaces. Importantly, it includes non-planar surfaces (such as non-orientable surfaces,see Figure 3.1), an unfortunate reality which brings many complications that were largely over-looked by previous work in vector graphics. In particular, the cut topological operators are farmore complicated for non-planar surfaces than for planar ones. As an example, it is not obvious373.1. First Concepts of Topology(a) (b)non-connected ⇒⇒twolinesconnectedtwolines(c)Figure 3.2: Whether or not two lines are connected aects: (a) rendering, such as here the rendering of aMiter join; (b) user interaction, such as here a drag-and-drop action of one of the two lines; and (c) keyframeinterpolation.what happens if you cut a Möbius strip. Once the topological nature of vector graphics objects hasbeen determined, we introduce the notion of PCS complex in Section 3.3. It is a topological struc-ture that satises our design decisions, and that admits a combinatorial representation from whichvector graphics complexes are derived. Finally, we summarize and conclude in Section 3.4.3.1 First Concepts of TopologyTopology is a word whose precise meaning depends on the context it is used. This section is aboutclarifying this terminology: What do we mean by “topology”? What do we mean by: “These twoline drawings have the same topology”? Or: “This surface has the topology of a disk”?At its core, topology is about representing how objects are connected to one another. And this is whytopology obviously matters for interactive graphics: the behavior of graphical objects depends onwhether or not they are connected to one another, and the nature of this connection. For instance,rendering two lines depends on whether or not the two lines are connected (see Figure 3.2a). Theresult of a drag-and-drop user interaction depends on whether or not lines are connected (seeFigure 3.2b). And in the context of computer animation, interpolation between two keyframesdepends on whether or not lines are connected (see Figure 3.2c).383.1. First Concepts of Topology6∼=∼=Figure 3.3: Top: two homeomorphic graphs. Bottom: two non-homeomorphic graphs.3.1.1 Topology According to Computer ScientistsAs computer scientists, we typically work within a discrete world, most often nite. Therefore, weonly manipulate a nite number of objects, and connections between these objects can be easilyexpressed as a graph G = (V,E), where every object is represented as a node ni ∈ V , and wherea “direct connection” between two objects is represented as an edge (ni, nj) ∈ E. It should beclear that this graph represents how objects are connected to one another, which was our informaldenition of topology. This is the reason why, within computer science, the word topology oftenrefers to a graph.For instance, in computer network architecture, the topology of a network refers to a graph whereeach node ni represents a computer (either a server, a router, or an end-user device), and each edge(ni, nj) is a pair that indicates that there is a direct communication link between the two comput-ers. This graph contains all the information about how the computers are connected, such as: Aretwo computers direct neighbors? Are they at all connected to one another, possibly indirectly?If yes, what is the shortest communication path between these two computers? Is the networkrobust to link failure, i.e., are there at least two paths between any pair of computers? Note thatthis representation not only stores whether or not any pair of computers are connected (=connect-edness), but also stores how any pair of computers are connected (=topology). For instance, linearand circular networks (see Figure 3.3, bottom) are both fully connected, but they do not have thesame topology: the rst one becomes disconnected after any given cut, while the second one staysconnected. In fact, we will see throughout this chapter that the concept of cut, and whether or notit disconnects objects, plays a fundamental role in topology. For instance, cutting a Möbius stripalong its centerline does not disconnect it, while cutting a cylinder does.In most academic contexts where the topology of a model (e.g., a computer network) is expressed393.1. First Concepts of Topologydiscontinuity of f−10pi2pi3pi22pi0 2pif : [0, 2pi)→ S1Figure 3.4: The function f(θ) = (cos(θ), sin(θ)) dened from [0, 2pi) to the unit circle S1 is continuousand bijective, but its inverse is not continuous. Therefore, it is not a homeomorphism. In fact, it is possibleto prove that there exist no homeomorphism from [0, 2pi) to S1, and therefore that these two spaces are nothomeomorphic, i.e., they “have a dierent topology”. Source: inspired from [Lee 2011], Figure 2.5.as a graph, it is said that two models “have the same topology” if and only if the two graphs arehomeomorphic (see Figure 3.3). By denition, two graphs are said to be homeomorphic if andonly if they can be obtained from one another with a nite number of edge subdivisions (splittingone edge into two edges), and edge simplications (the inverse operation).However, there are some contexts where “have the same topology” means instead that the twographs are isomorphic, which is much a stronger concept that simply means that the two graphsare identical up to node renaming. We will discuss this in more details in Section 3.1.4.3.1.2 Topology According to MathematiciansOn the other hand, most mathematicians who study topology work with continuous geometricentities, such as curves, surfaces, and manifolds of higher dimensions. These geometric entitiesare made of an uncountable innite number of points, which are “continuously connected” toone another. Because representing this “continuous connectedness” cannot be done using graphs,mathematicians use the concept of open sets instead.More precisely, if X is a set (for instance, X = Rn), a topology on X is dened as a collection Tof subsets of X , satisfying the three following properties:1. X and ∅ are elements of T .2. Any nite intersection of elements of T is also an element of T .3. Any (possibly innite) union of elements of T is also an element of T .An ordered pair (X, T ) consisting of a setX together with a topology T onX is called a topolog-ical space. Elements ofX are usually called points, and elements of T are called the open sets ofX . If the choice of T is clear from the context, we simply say that X is a topological space.403.1. First Concepts of Topology6∼=∼=Figure 3.5: Top: two homeomorphic point-sets of R2. Bottom: two non-homeomorphic point-sets of R2.While this denition may seem very abstract to the reader unfamiliar with point-set topology, itis in fact the building block behind all topological concepts such as neighborhood, boundary, andcontinuous functions. For instance, a function is said to be continuous if and only if the pre-image of any open set by this function is also an open set. Such denition is equivalent to the oneyou may have learned in an analysis class for functions from Rn to Rm (using limits), but has theadvantage that it generalizes well to many other spaces, including non-metric spaces (where theconcept of “distance” does not exist). Readers interested to learn more on this fascinating topicare encouraged to get their hands on any introductory book in general or algebraic topology (e.g.,[Munkres 2000, Hatcher 2001, Lee 2011]). However, our aim in this section is not that the readerfully understands these concepts, but only to give a sense of what topology and topological spacemeans in a continuous world. In one sentence, a topological space (X, T ) is a set X of pointstogether with a collection T of subsets of X called open sets. It is quite dierent from the conceptof a graph (V,E), which is a set V of nodes together with a set E of pairs of nodes called edges.However, notice the similarity: in both cases, it is a set X or V of “objects”, together with theinformation T or E of how they are connected to one another. In Section 3.3, we will see the samesimilarity between PCS complexes and abstract PCS complexes.We can now dene one of the most important concepts of this chapter: a homeomorphism be-tween two topological spaces is a bijective function which is continuous, and whose inverse is alsocontinuous (continuity of the inverse is important, see Figure 3.4 for a classical counter-example).Two spaces are said to be homeomorphic if and only if there exists a homeomorphism betweenthem (see Figure 3.5). Homeomorphisms are extremely important because, as a direct consequenceof their denition, they happen to preserve open sets (i.e., the image or the pre-image of an open setby a homeomorphism is also an open set). Since topology is dened via open sets, this means thatall topological properties are preserved by homeomorphisms. For this reason, it is common to saythat two spaces “have the same topology” if and only if the two spaces are homeomorphic.413.1. First Concepts of TopologyFigure 3.6: Many smooth surfaces made of an uncountable innite number of points can be nitely repre-sented using computers. Here, we illustrate how a smooth surface (i.e., a geometric object) can be dened as thelimit of Catmull-Clark subdivision steps, starting from a polygonal mesh (i.e., a combinatorial object).3.1.3 Topology According to Computational GeometersIn the previous two sections, we have described topology as having either a combinatorial nature(a graph, typically used in computer science), or a geometric nature (a topological space, typicallyused in mathematics). However, there are many elds of research at the boundary between thesetwo interpretations, such as computational geometry.In fact, very fundamentally, the core idea of algebraic topology is to study the combinatorial prop-erties of geometric objects, and an important part of graph theory focuses on embedding graphs ingeometric spaces. For instance, planar graphs are dened as the graphs that can be embedded inR2, that is, whose vertices can be embedded as distinct points, and whose edges can be embeddedas curves connecting these endpoints that are interior disjoint. Within algebraic topology, suchinterpretations of combinatorial objects as topological spaces are usually called geometric real-izations. For instance, every graph can be realized as a specic kind of topological space called a(one-dimensional) simplicial complex. As you can guess by comparing Figure 3.3 with Figure 3.5,the concept of homeomorphism between graphs is equivalent to the concept of homeomorphismbetween topological spaces, once graphs are realized as topological spaces.But let us go back to computational geometry, and more specically to its subeld geometric mod-eling, to which this thesis belongs. Within geometric modeling, a goal is to design computer rep-resentations of various geometric objects, typically curves and surfaces. Given that computershave a nite memory, this means designing nite representations of these geometric objects. Forinstance, a 2D line segment between two points P and Q can be mathematically represented as:{ (1− λ)P + λQ | λ ∈ [0, 1] } (3.1)where P ∈ R2 andQ ∈ R2. Even though this line segment is made of an innite number of points,all we need to represent all of these points is to store P and Q, which only uses a nite amount ofmemory (as long as P and Q can themselves be represented with a nite amount of memory, for423.1. First Concepts of TopologyFigure 3.7: Google image search results for “head topology”. © 2016 Google Inc. Google and the Google logoare registered trademarks of Google Inc., used with permission.instance using oating point arithmetic). In order to represent a piecewise linear curve, one canuse a list of points. In order to represent a smooth curve, one can use a list of points and tangentvectors (e.g., a Hermite or Bézier curve), or simply a list of points (e.g., a Catmull-Rom or Chaikinsubdivision curve). In order to represent a piecewise linear surface, one can use a triangle mesh. Inorder to represent a smooth surface, one can use a NURBS surface, or a Catmull-Clark subdivisionsurface (see Figure 3.6).Since all these combinatorial objects are in fact representing continuous point-sets, it is possibleto apply to them the mathematician’s denition of topology. For instance, to compute a meshparameterization, it is often said that the mesh must be cut until “it has the topology of a disk”. Thismeans that after the cuts, the represented surface must be homeomorphic to the point-set { |x| ≤1 | x ∈ R2 }. Being able to apply the mathematician’s denition of topology to combinatorialobjects is essential to study many of their properties, and is the reason why we will introducethe concept of PCS complexes in Section 3.3. PCS complexes provide a well-dened geometricinterpretation of vector graphics combinatorial objects, and in particular, they allow us to preciselydene what homeomorphism means for these objects.3.1.4 Topology According to 3D Modeling ArtistsHowever, there are many contexts within geometric modeling, and especially among 3D modelingartists, where the word “topology” does not refer to the mathematician’s geometric denition, andwhere “having the same topology” does not mean “being homeomorphic”. For example, if youask a 3D modeling artist whether the two leftmost objects in Figure 3.6 have the same topology,433.1. First Concepts of Topology≡ ≡ ≡6≡ 6≡6≡∼= ∼= ∼=∼= ∼= 6∼=Figure 3.8: Top: Examples of isomorphic quad meshes. Bottom: Examples of non-isomorphic quad meshes.Note that isomorphic (≡) implies homeomorphic (∼=), but the opposite is not true. All these quad meshes arepairwise homeomorphic, apart from the bottom-right example which contains a hole.their answer is likely to be: “no, for instance the rst one has only 6 quads, while the second onehas 24 of them”. But if you ask a mathematician: “yes, they both have the topology of a sphere”.When artists use the word “topology”, they usually refer to how many polygons are used, and howthey are arranged into coherent and esthetically pleasing loops, typically following muscle lines,which produce the best smoothing and deformation results (see Figure 3.7). They would say thatthe rst two head models in the rst row of Figure 3.7 have dierent topologies because the rstmodel has a loop of quads enclosing both eyes (in orange), while the second model has no suchloop. Formally, what they mean is that two meshes have the same topology if and only if they areisomorphic. A precise denition of isomorphism for polygonal meshes (or other combinatorialstructures, such as graphs, multigraphs, triangle meshes, simplicial complexes, etc.) depends onhow exactly the combinatorial structure is dened, but essentially it means that they have the samenumber of vertices, edges, and faces, and that they are arranged in the same way. Equivalently,one can say that isomorphism means that the meshes are equal up to vertex/edge/face renamingand geometric deformation (see Figure 3.8). In section 3.3.2, we precisely dene what isomorphismmeans for PCS complexes, and since most mesh data structures are a subset of PCS complexes, thedenition apply to these other data structures as well.This meaning of topology, which emphasises more on isomorphism than homeomorphism, comesfrom the fact that in most mesh data structures, it is possible to decorrelate the combinatorial infor-mation from the geometric information of the represented surface. Therefore, the data structurecan be implemented as a combinatorial structure called the topology of the mesh, on top of whichcan be added geometric attributes, called the geometry of the mesh (see Figure 3.9). As a conse-quence, any edit to the combinatorial structure (e.g., an edge-collapse) is often called a topologicaloperator and said to “change the topology” of the mesh, even if the new mesh is still homeomor-443.1. First Concepts of Topology(a) Topology (b) Geometryverts =v5, v6, v7, v8 }{ v1, v2, v3, v4,quads =(v3, v4, v6, v5),{ (v1, v2, v4, v3),(v5, v6, v8, v7) }φ(v1)φ(v2)φ(v3)φ(v4)φ(v5)φ(v6)φ(v7) = φ(v8)φFigure 3.9: Most mesh data structures, such as here a simple quad mesh structure, are usually implementedas: (a) a combinatorial structure called “topology”; and (b) geometric attributes called “geometry”. Typically, a3D position φ(vi) is assigned to each vertex vi, which denes an immersion of the topology into R3.(b) geometric realization (X, T )(a) presentation P (c) immersion in R3verts =v5, v6, v7, v8 }{ v1, v2, v3, v4,quads =(v3, v4, v6, v5),{ (v1, v2, v4, v3),(v5, v6, v8, v7) }v1v2v3v4v3v4v5v6v5v6v7v8φ(v1)φ(v2)φ(v3)φ(v4)φ(v5)φ(v6)φ(v7) = φ(v8)φFigure 3.10: (a) In algebraic topology, any combinatorial structure P describing topology is usually calleda presentation. (b) Each presentation P can be interpreted as a continuous topological space (X, T ) calledits geometric realization. (c) Assigning a 3D position φ(vi) ∈ R3 to each vertex vi ∈ P can be interpretedas dening a continuous function φ : X 7→ R3, generally non-injective. We have highlighted in red everypoint x ∈ R3 whose pre-image by φ contains two or more points in the geometric realization. This formalismrigorously captures the intuitive idea that there are several “overlapping points” at such 3D location x.453.1. First Concepts of Topologyphic to the old one. This meaning of topology is the one we use when we say, for instance, “vectorgraphics animation with time-varying topology”. We mean that there exist at least two frames inthe animation whose respective vector graphics complexes are not isomorphic. Whether they arehomeomorphic is irrelevant.While this denition of topology is combinatorial in nature, it is essential to understand that itactually represents a continuous geometric object, even before geometric attributes are specied.More precisely, this combinatorial structure called “topology” is usually called a presentation Pby algebraic topologists (see Figure 3.10a), which can be interpreted as a continuous topologicalspace (X, T ) called its geometric realization (see Figure 3.10b). Generally, this geometric realiza-tion is dened via the formalism of quotient spaces, which consists in abstractly gluing togetherduplicated pieces of Rn (see Section A.6 for details). After this process, the topology T of the geo-metric realization accurately represents the intended semantics of the combinatorial structure, i.e.how the points of the underlying geometric object X are continuously connected to one another.Once a presentation P is interpreted as a continuous topological space (X, T ), then assigning a3D position φ(vi) ∈ R3 to each vertex vi ∈ P can be interpreted as dening an immersion ofthis topological space into R3, i.e. a continuous function φ : X 7→ R3, possibly not injective (seeFigure 3.10c). This means that two dierent points of the geometric realization may be mapped tothe same point in R3, creating what we call overlapping points: two or more points that sharethe same spatial location, but have their own “topological identity”. In the next section, we willsee that understanding this concept is critical for understanding vector graphics topology, sinceoverlapping plays a very important role in vector graphics.463.2. The Non-Planar Nature of Vector Graphics(a) topological space (X, T ) (b) immersion in R2v1v2v3v4v3v4v5v6φ(v4)φ(c) vector graphics outputφ(v2)φ(v1)φ(v6)φ(v5)φ(v3)Figure 3.11: A vector graphics illustration represented as: (a) a continuous topological space (X, T ), such ashere a quotient space, decomposed into vertices, edges, and faces; and (b) a continuous function φ that immersesthe topological space into the canvas R2. We have highlighted in red every point x ∈ R2 whose pre-image byφ contains two or more points in X . (c) The nal vector graphics illustration.3.2 The Non-Planar Nature of Vector GraphicsIn this section, we show that assuming a few reasonable design decisions, any topological structurethat represents vector graphics combinatorial objects must support non-manifold topologies andsurfaces of arbitrary orientability and genus (the denitions of manifoldness, orientability, andgenus are recalled in Appendix A). In particular, this includes non-planar objects, such as non-orientable surfaces (e.g., a Möbius strip), or orientable surfaces of non-zero genus (e.g., a torus).We will also cover a few other topological properties, but we want to emphasize non-planaritybecause it is the least studied by previous research, the one that brings most complications, andalso perhaps the least intuitive.By topological structure, we mean a topological space (X, T ) that is partitioned into subsetscalled cells, such as vertices, edges, and faces. The continuous point-set X might be dened aseither a quotient space (see Figure 3.11a), or a subset of Rn in which the cells do not intersect(this may require n ≥ 4, e.g. for a Klein bottle). It is then immersed into the canvas R2 via acontinuous function φ : X 7→ R2, possibly non-injective, which denes the nal vector graphicsillustration (see Figure 3.11b and 3.11c). We call overlapping any point ofR2 whose pre-image bythe immersion φ contains two or more points of the topological space.We can observe that this concept of topological structure immersed in R2 is more generic than theconcept of planar maps [Baudelaire and Gangnet 1989], which is directly a partition of R2 intovertices, edges, and faces, i.e. a topological structure embedded in R2.473.2. The Non-Planar Nature of Vector Graphics3.2.1 Design DecisionsLet us start with a short list of design decisions, or desiderata, that we believe should ideally besupported by any vector graphics system, thus by our topological structure.A. Basic Primitives At the very least, the following cellsmust be supported: vertices (single points in space); open edges(open curves starting and ending at a vertex); and triangles (sur-faces homeomorphic to disks, bounded by three edges).B. Basic Topological Operators Any two vertices can beglued. Any two edges can be glued using any of the two possi-ble directions. Any edge can be cut by inserting an additionalvertex. Any face can be cut by inserting an additional open edgestarting and ending at existing boundary vertices.C. Operator Invertibility The inverse of any valid operatoris also a valid operator.⇒D. Operator Locality The validity of any topological oper-ator (i.e., whether or not it is allowed to apply it) only dependson local topological properties.⇒These design decisions adhere to two important user interface design principles: learnability(which includes familiarity, predictability, and consistency) and exibility. Basic Primitives (A)are obvious for familiarity: vertices, open edges and triangles are already standard in all exist-ing topological modeling tools. Among Basic Topological Operators (B), gluing two vertices andcutting edges are also standard in most vector graphics tools, except that not “any” two verticescan be glued. Our addition of the word “any” is key for predictably and consistency, and is whatallows to represent three or more edges sharing a common vertex. If instead, users are sometimesallowed to glue two vertices or two edges, but sometimes not (for technical reasons not obvious tothem), then not only does it impede predictability and consistency, but it also decreases exibility.In other words, it limits their artistic freedom, which is likely to frustrate them. Unfortunately,this is the case in most existing vector graphics tools.Gluing two edges or cutting a face is not standard in existing vector graphics tools, since mostof them do not even support shared edges in the rst place. However, not only these are twooperations extremely useful, but they are the direct counterpart of gluing two vertices or cuttingan edge. Therefore, they increase both exibility and consistency, and it makes sense to includethem. Operator Invertibility (C) is very important for familiarity and predictability: if an operation483.2. The Non-Planar Nature of Vector Graphicsand ⇒ and ⇒(a) (b)Figure 3.12: (a) Proof of non-planarity: vector graphics topologies are a superset of graphs, some of whichare not planar. (b) Proof of non-orientability: vector graphics topologies are a superset of triangle meshes, someof which are non-orientable, such as here a Möbius strip. We note that (b)⇒ (a), but proving (a) independentlyshows that even without faces, the topology can be non-planar.can be done, surely it can be undone. This is a basic expectation that users have learned from allother applications, and not just graphics applications. Operator Locality (D) is more subtle butalso very important for predictability, and is correlated with the usage of “any” in our designdecisions. The idea is that global topological properties, such as planarity or orientability, arehard to understand and assess at a glance. Therefore, not allowing a topological operation dueto global topological constraints is likely to be an unexpected behavior for most users. However,local topological properties are more intuitive and directly visible. Therefore, it is acceptable toforbid users from doing some topological operations due to local topological constraints, since theycan intuitively understand why the operation is not possible. For instance, it should be obviousto most users that “uncut” cannot be applied at a vertex with three incident edges, since suchtopology could not have possibly been achieved via “cut”.3.2.2 Non-Planarity and OverlappingLet us now start to analyze the consequences of the design decisions above. The rst and foremostconsequence is that non-planar topologies must be supported, as illustrated in Figure 3.12. Indeed,allowing for the representation of open edges and allowing for any two vertices to be glued meansthat the topological structure at hand is a superset of graphs. Since some graphs are non-planar,such as K5 (see Figure 3.12a), then some vector graphics topologies are non-planar.Since there exists no injective immersion in R2 of such non-planar topologies, this means thatedges and faces must be allowed to overlap. Of course, allowing edges and faces to overlap is anextremely desirable feature in itself. Intuitively, it should be seen as a design decision, but sinceit turns out to be a consequence of other design decisions, then we present it as a consequence,in order to keep the list of design decisions minimal and non-redundant. It should be understoodthat if it was not a consequence, then we would have added it as a design decision.493.2. The Non-Planar Nature of Vector Graphicsand ⇒(a) (b)⇒and(c)⇒and(d)⇒andandFigure 3.13: Examples of non-manifold topologies, together with the corresponding design decisions whichallow these topologies. In fact, gluing objects together, which is formalized via quotient spaces, is one of thefundamental tool used in alebraic topology to represent non-manifold topological spaces.3.2.3 Non-OrientabilitySimilarly, it is straightforward to prove that given the design decisions of Section 3.2.1, then somevector graphics topologies are non-orientable (that is, they contain a non-orientable surface, seeAppendix A.4). Indeed, allowing for triangles to be represented and allowing to glue any two edgesin any of the two possible directions means that the topological structure at hand is a superset of tri-angle meshes. Since some triangle meshes are non-orientable, such as a triangle mesh representinga Möbius strip (see Figure 3.12b), then some vector graphics topologies are non-orientable.3.2.4 Non-ManifoldnessFinally, as a superset of graphs and triangle meshes, an obvious but important consequence isthat some vector graphics topologies are non-manifold (see Figure 3.13). More precisely, vectorgraphics topologies are a superset of two-dimensional simplicial complexes, which have been fordecades the long-established standard representation for non-manifold spaces. Nowadays, manyalgebraic topologists tend to prefer CW complexes for their exibility, but in the eld of computa-tional topology, simplicial complexes are still the de facto representation for non-manifold spaces.The reason is that unfortunately, CW complexes do not admit a purely combinatorial representa-tion, and therefore are not suitable for computation. In a sense, vector graphics topologies can beseen as a balance between simplicial complexes and CW complexes: they are more generic thansimplicial complexes in order to be artist-friendly, but they are less generic than CW complexes inorder to be computer-friendly.503.2. The Non-Planar Nature of Vector Graphicsand ⇒ · · ·Figure 3.14: As a consequence of allowing triangles and allowing any edge to be cut, vector graphics topologiesmust support n-sided faces.glue vertices uncut at vertex∼=Figure 3.15: As a consequence of allowing open edges, of allowing any two vertices to be glued, of allowingedges to be cut, of Operator Invertibility (C), and of Operator Locality (D), vector graphics topologies mustsupport closed edges.3.2.5 N-Sided FacesSo far, we have only analyzed the consequences of using open edges, triangles, and the glue opera-tors. More specically, we have seen that they allow for non-manifold and non-planar topologies,possibly non-orientable. From now on, let us focus on the consequences of the cut operators. Themost obvious consequence of allowing to cut edges is that the topological structure must supportn-sided faces (i.e., faces bounded by n edges, for arbitrary n). Indeed, when iteratively applyinga cut to the boundary of a triangle, then we obtain a quad, then a ve-sided face, and so on, asillustrated in Figure 3.14.3.2.6 Closed EdgesHowever, the most signicant consequences of the cut operators happen when they are combinedwith Operator Invertibility (C) and Operator Locality (D). Indeed, this turns the inverse of the cutoperators into powerful simplication operators, extending signicantly what topologies can be ex-pressed with a single cell. For instance, a closed edge can be created in two simple steps, illustratedin Figure 3.15. First, one can create an edge that start and end with the same vertex, by gluing thetwo end vertices of an open edge. At the remaining vertex, one can observe that the topologi-cal structure is locally homeomorphic to an open edge that has been cut (see Figure 3.15, middle).Therefore, as a consequence of Operator Invertibility (C) and Operator Locality (D), “uncutting”at this vertex must be allowed, which results in a closed edge.Such a closed edge can in fact be seen as a new type (= homeomorphism class) of cell! Indeed,it is not homeomorphic to either a vertex, an open edge, or a face. This makes vector graphics513.2. The Non-Planar Nature of Vector Graphicsglue edges uncut at edge∼=uncut at vertices(optional)Figure 3.16: As a consequence of allowing n-sided faces, of allowing any two edges to be glued, of allowingfaces to be cut, of Operator Invertibility (C), and of Operator Locality (D), vector graphics topologies mustsupport faces with inner holes. Note the similarity between this gure and Figure 3.15.glue edges uncut at edgesFigure 3.17: For any given n ∈ N, it is possible to create a disk with n inner holes from a 4n-sided disk, bygluing every 4i-th edge with the (4i+ 2)-th edge, then uncutting all resulting edges.topologies unique compared to most existing topological structures. For instance, neither simpli-cial complexes or CW complexes allow closed edges! The reason is that in algebraic topology, cellsare designed to be “simple enough” to be a useful tool for mathematical proofs. Indeed, the simplerthe cells, the stronger their topological properties. For instance, in the case of CW complexes, allcells are homeomorphic to the interior of Dn = { x ∈ Rn | ||x|| ≤ 1 }, which is a very usefulproperty that can be used in proofs. But in our case, we are not very concerned about its utilityas a proof mechanism, but rather we are concerned about user experience. We want a denitionof cells that provides the best possible user experience. In a sense, dening what qualies as avalid cell and what does not can be seen as a delicate balance between expressiveness and simplic-ity, and because artists have very dierent needs than mathematicians, our denition of cell leansmore towards expressiveness than simplicity. Unfortunately, this more complex denition resultsin topological operators which are harder to implement, but this is a reasonable price to pay toimprove user experience. In other words, there is no such thing as a free lunch.3.2.7 Faces with Inner HolesFollowing the exact same reasoning, vector graphics topologies must also support faces with innerholes. Indeed, a face with an inner hole can be easily created in two steps: rst gluing the twoopposite edges of a quad, then uncutting the resulting edge (see Figure 3.16). More generally, givenany n ∈ N, it is possible to create a face with n inner holes from a 4n-sided face (see Figure 3.17).Like with closed edges, this in fact creates new types of faces, since a face with i holes is neverhomeomorphic with a face with j holes (for i 6= j). Like closed edges, none of these new typesof cells are valid in simplicial complexes and CW complexes, but it is clear that they must be523.2. The Non-Planar Nature of Vector Graphicsglue uncutglue uncutFigure 3.18: Examples of non-planar faces. Top: A face homeomorphic to a torus with one hole. Bottom: Aface homeomorphic to a Möbius strip. Like a disk, the boundary of both these faces is made of a single curve.supported by vector graphics topologies. Indeed, they are obviously useful for artists, and are infact already supported by both SVG and planar maps.3.2.8 Non-Planar FacesUsing the same two steps (glue + uncut), it is also possible to create non-planar faces, i.e. cellswhich are homeomorphic to non-planar surfaces (see Figure 3.18). Indeed, we had already seenin Section 3.2.2 that due to the glue operators, non-planar topologies must be supported. But infact, by applying the inverse of the cut operators to these topologies, even a single cell could bea non-planar point-set. For instance, a cell can be a point-set homeomorphic to a Möbius strip,or homeomorphic to a torus with a hole, or more generally homeomorphic to any orientable ornon-orientable surface of any genus, with any number of holes. Like closed edges, such facesare usually not allowed in topological structures in order to ensure that cells are as “simple” aspossible, which is very desirable for many use cases, such as mathematical proofs. But in our case,we allow these non-planar faces as a consequence of our design decisions. They provide additionalexibility, consistency, and expressiveness which have practical benets for artists, and which webelieve is worth the extra complexity of supporting them.With all these dierent types of faces, the word “face” is becoming more and more ambiguous. Isit orientable? What is its genus? Does it have holes? How many? The same way that we have adierent name for closed edges and open edges, it would be nice to have a dierent name for eachof these types of faces. Unfortunately, while there exist only two types of edges (open and closed),there exist innitely many types of faces, which makes naming them inconvenient. However, itturns out that the type of a face is fully determined by three attributes: its orientability ∈ {, 6}(= orientable or not), its genus g ∈ N, and its number of holes k ∈ N. This is a consequence533.2. The Non-Planar Nature of Vector Graphicsglue uncut(a) two independent disks (b) two overlapping disks,sharing their boundary(c) one sphereFigure 3.19: A sequence of topological operators may result in a face without boundary, such as here a sphere.Since these topologies cannot be rendered via “winding rule lling”, most implementations may want to detectthem and handle them as a special case.of an important result of algebraic topology called the classication of compact 2-manifolds (seeSection A.4). Therefore, we can refer to each type of face as -g-k-face. For instance, a face isplanar (i.e., can be embedded in R2) if and only if it is an -0-k-face, for some k > 0. In otherwords, planar faces are those homeomorphic to a sphere with k > 0 holes. All other types of facesare non-planar, including the case k = 0 which we discuss in the next section.Note that in Section 3.2.7, we used the phrase “face with n inner holes” to mean “cell homeomor-phic to a disk with n holes”. Indeed, it is the intuitive meaning of “hole” in vector graphics, wherea 2D shape “without hole” intuitively means a topological disk. However, this intuitive meaningof “hole” is dierent from the number k above, which includes not only inner holes but also theouter boundary. The reason is that from a topological perspective, they are no ways to distinguishthe outer boundary from an inner hole: both are one connected component of the face’s boundary.Topologically, a “disk with one hole” is nothing else than a (nite) cylinder, which is nothing elsethan a sphere with 2 holes. To summarize, what we called a “face with n inner holes” was in factan-0-(n+ 1)-face: an orientable, genus-0 surface with k = n+ 1 holes. In this thesis, wheneverwe use the term “hole”, we refer to the number k. If we need to refer to the more intuitive numbern = k − 1, we use the term “inner hole” instead.3.2.9 Faces without BoundaryIn the previous section, we have seen that each face is of type -g-k-face, for some , g, and k. Inparticular, we have seen that the number k represents the number of holes of the face, which meansthe number of connected components of the face’s boundary. The case k = 0 is very special andrepresents surfaces without boundary (e.g., a sphere, a torus, or a Klein bottle), which are neverplanar. Because vector graphics faces are typically rendered using a winding rule to “ll” in R2the immersion of their boundary, faces without boundary cannot be rendered and thus have verylimited use. However, we do allow them for various reasons, including the fact that they are the543.2. The Non-Planar Nature of Vector GraphicsGlue closed edgesCut (×4) Glue Uncut (×2)GlueUncut at vertex∼=⇒(invertibility) Cut closed edgeFigure 3.20: Top: Cutting a closed edge into an open edge can be dened as the inverse of uncutting an openedge starting and ending at the same vertex. Bottom: Gluing together two closed edges can be dened as asequence of existing operators.mathematically correct result of some topological operators which should be valid according toour design decisions (see Figure 3.19). However, in practice, some implementations may want toforbid them, warn the user when they occur, or make it a user preference. However, it is importantto keep in mind that even if they cannot be rendered, they can be extremely useful as temporaryobjects, either in the middle of an algorithm or during the user’s editing process. In addition,some advanced users, for instance math students studying topology, may nd them useful as apedagogical tool or as an abstract representation not meant to be rendered. Also, it is possible toimagine alternative rendering methods not based on winding numbers, which would make themrenderable (for instance, by immersing their geometry using a triangulation). Finally, we note thatthey are necessary for uniqueness of a minimal cell decomposition (see Section E), which may beuseful to determine whether two vector graphics illustrations are homeomorphic.3.2.10 Cut and Glue Closed EdgesNow that we have shown the existence of all these new types of cells (closed edges, faces with innerholes, and non-planar faces), we can dene new topological operators involving these cells. Theycan all be dened using the existing operators, Operator Invertibility (C), and Operator Locality(D). For instance, we illustrate in Figure 3.20 (top) that cutting a closed edge into an open edge canbe dened as the inverse of uncutting an open edge into a closed edge. In Figure 3.20 (bottom),we show that gluing two closed edges together can be dened as a sequence of cutting the closededges into open edges, then gluing the open edges together, and nally uncutting back the openedges into closed edges.553.2. The Non-Planar Nature of Vector GraphicsCut face along closed edgeCut face at vertex (method 1)Cut face along open edge startingCut face at vertex (method 2)and ending at the same vertexFigure 3.21: Using a sequence of existing operators, Operator Invertibility (C), and Operator Locality (D), itis possible to dene cutting a face at a (Steiner) vertex, cutting a face along an open edge that starts and endingat the same vertex, and cutting a face along a closed edge.3.2.11 Cut Faces at Vertices and along Closed EdgesIn the design decisions, we mentioned cutting faces along open edges. In Figure 3.21, we showthat it is also possible to cut them at vertices, and cut them along closed edges. In addition, weshow that they can be cut along open edges starting and ending at the same vertex, a special caseof cutting along an open edge, which was not explicitly mentioned in the design decisions. All ofthese new cut operators can be dened as a sequence of operators already dened.Cutting a face at a vertex results in what we call a Steiner vertex, also called “point-in-face” in somecontexts. It is a point in the interior of a face that has been taken out to become its own separatecell. However, we note that a Steiner vertex is not a new type of vertex, and its surrounding face isnot a new type of face either. Indeed, a Steiner vertex is still homeomorphic to a “normal” vertex,and the surrounding face is still homeomorphic to one of the types of face we have already seen:each Steiner vertex counts as a hole (for instance a disk with a Steiner vertex is a -0-2-face).Therefore, the term “Steiner vertex” does not refer to a new type of vertex, but instead refers tothe specic way in which the topological space X is locally decomposed into existing types ofcells. More specically, any vertex that has one or more incident face(s) but no incident edges iscalled a Steiner vertex.3.2.12 Cut Faces with Inner HolesCutting a planar face without inner holes along open or closed edges is easy and non-ambiguous:it always disconnects the face into two faces (see Figure 3.22a,e). However, if the face has one or563.2. The Non-Planar Nature of Vector GraphicsCut planar facesCut planar faceswithout inner holes with inner holes(a) (b) (c) (d)(e) (f) (g) (h) (i)Figure 3.22: Cutting a planar face along a closed edge always disconnects the face (not true for non-planarfaces). Cutting a planar face along an open edge starting and ending at the same hole always disconnects theface (not true for non-planar faces). Cutting a planar face along an open edge starting and ending at dierentholes never disconnects the face (also true for non-planar faces).more inner holes, things get more complicated. For instance, let us look at the case of a planar facewith k = 3 holes, which we cut along an open edge (Fig. 3.22f–i). If the cut edge starts and endsat the same hole (Fig. 3.22f–h), we can observe that it also disconnects the face into two faces, likewhen cutting a disk into two half-disks. However, depending on which side of the cut each holebelongs to, dierent topologies will be obtained. A similar situation occurs if we cut the face alonga closed edge (Fig. 3.22b–d): it disconnects the face, and the holes get distributed among the tworesulting faces, depending on which side of the cut they belong.But if we cut the face along an open edge that starts and ends at dierent holes (Fig. 3.22i), thenan entirely dierent situation occurs: it does not disconnect the face. Instead, the two holes aresimply merged into one, and the cut is actually non-ambiguous, regardless of the path taken bythe cut edge. In fact, this property turns out to be also true for non-planar faces. In a sense, cuttinga face along an open edge that starts and ends at dierent holes is the simplest way to cut a facealong an edge. It is never ambiguous and can always be computed purely combinatorially, whetherthe face is planar or not.573.2. The Non-Planar Nature of Vector GraphicsCut non-planar facesalong open edgesCut non-planar facesalong closed edgesf2f1ff ′(a) (d)(b) (e)(c) (f)(g) (j)(h) (k)(i) (l)Figure 3.23: Some of the many ways non-planar faces can be cut along open and closed edges. Most of thesecuts are not topologically equivalent: some disconnect the face into two faces, some do not. Some decrease thegenus of the face, some do not. Some transform a non-orientable face into an orientable face, some do not. It isa good exercise to try to determine the values of , g, and k before and after the cut, in each of these examples.For an exhaustive list of the 19 non-equivalent ways to cut faces along edges, see Figure 3.25.3.2.13 Cut Non-Planar FacesIn the previous section, we have discussed cutting planar faces along any type of edge, and cuttingfaces—planar or not—along open edges starting and ending at dierent holes. In this section, wenally discuss the two most complicated categories of cuts: cutting non-planar faces along closededges, or along open edges starting and ending at the same hole.Orientable Faces Let us take the example of a torus with one hole (i.e., an -1-1 face), whichwe cut along a closed edge (see Figure 3.23a–c). One possibility is to cut along a tiny closed edge(Fig. 3.23a), which disconnects the face f into two faces f1 and f2. This is always possible sinceby denition, every surface is locally homeomorphic to R2, thus one can cut out a tiny disk f1anywhere on the surface. The remaining face f2 has the same orientability and genus as theoriginal face f , but with an additional hole. In other words, the-1-1 face is disconnected into an583.2. The Non-Planar Nature of Vector Graphics(a) (b)Figure 3.24: (a) Cutting an orientable face along a closed edge always increases the total number of holes byexactly 2. The two additional holes correspond to the two sides of the closed edge. We highlighted one of thesetwo sides using red stripes. (b) Cutting a non-orientable face along a closed edge increases the total number ofholes by either 1 or 2. As we illustrate in this gure, the former case happens when the closed edge is globallyone-sided, despite being locally two-sided. If you were walking on the face along the hole, you would need towalk twice the length of the closed edge before reaching your start position again.-0-1 face and an -1-2 face. We can observe that the total number of faces increases by 1, thetotal genus has not changed, and the total number of holes increases by 2.However, since f has a non-zero genus, it is also possible to cut it in a way that does not disconnectit (Fig. 3.23b). Indeed, the number of times a surface can be cut without disconnecting it is in factone possible denition of the genus of a surface. The resulting face f ′ is an-0-3 face: a topologicalsphere with three holes. One of the holes is the original boundary, and the two new holes are thetwo sides of the cut edge, sides that just happen to belong to the same face. We can observe thatthe total number of faces has not changed, the total genus decreased by 1, and the total number ofholes increased by 2.Non-Orientable Faces Let us now take the example of a Möbius strip (i.e., a 6-1-1 face), whichwe also cut along a closed edge (Fig. 3.23d–f). Like for the torus, it is possible to cut out a tinydisk out of the Möbius strip (Fig. 3.23d), which disconnect the 6-1-1 face f into an -0-1 face f1and a 6-1-2 face f2. However, it is also possible to cut f in a way that does not disconnect it, suchas cutting along its centerline6 (Fig. 3.23e). The resulting face f ′ is an -0-2 face: a topologicalsphere with two holes, i.e., a topological cylinder. In addition to decreasing the genus (which wasexpected), two remarkable things happened: not only the face became orientable, but its numberof holes increased by only 1, instead of increasing by 2 as expected. The reason is that despitebeing locally two-sided, the cut edge is in fact globally one-sided, and then only generates oneadditional hole, which circles along the closed edge two times (Fig. 3.24b).Finally, we have yet to discuss cutting non-planar faces along open edges starting and ending atthe same hole (see Figure 3.23, right). However, it turns out that this case shares many similaritieswith cutting non-planar faces along closed edges. Therefore, for conciseness, we do not discuss it6If you have never done it before, I highly recommend to take an actual strip of paper (about 2cm × 20cm), tape itstwo ends after a half-twist to create a Möbius strip, then cut along its centerline with scissors to see what happens.593.2. The Non-Planar Nature of Vector Graphicshere and refer to Appendix D for more details. As a quick way to get more insight, we encouragethe reader to try to answer the following four questions (answers given in this footnote7):1. We cut an-1-1 face along an open edge that does not disconnect it (Fig. 3.23h) . How manyholes does it have after the cut?2. Do the two sides of the cut edge belong to the same hole?3. Consider the same two questions as applied to a 6-1-1 face (Fig. 3.23k).4. Compare these results with the analogous case of cutting these same faces along a closededge.3.2.14 The Face-Cut ClassificationAt this point, we hope to have successfully conveyed the idea that vector graphics topology is notas trivial as it may seem. In particular, cutting non-planar faces, and especially non-orientablefaces, is far from obvious. And in fact, we even have omitted the most complicated cases forconciseness. For instance, there are 6 non-equivalent ways to cut a 6-3-1 face along a closed edge.Half of these do not disconnect the face, and respectively transform it into an -1-2 face, a 6-2-2face, and a 6-1-3 face. This is very dierent from the cases we had already seen, where there wasat most one way to cut each face along a closed edge without disconnecting it.One may start to worry that by considering faces of even higher genus, for instance 6-7-1 faces,then there would be even more ways to cut them. Fortunately, this is not the case: there are only 3ways to cut a 6-7-1 face along a closed edge without disconnecting it, which are the same 3 waysthat apply to a 6-3-1 face. In other words, cutting faces gets more complicated up to genus 3, atwhich point all possible cuts have already been discovered. The exhaustive list of the 19 possiblecuts is illustrated in Figure 3.25, and we call this list the face-cut classication. We prove thisclassication in Appendix D, using the formalism of PCS complexes which we dene in the nextsection. Together with the denition of PCS complexes itself, the face-cut classication is perhapsthe most signicant theoretical contribution of this thesis.7(1) 2. (2) No. (3) 1, Yes (4) When cutting with a closed edge, the answers were 3-No-2-Yes, i.e. the same answerswith a one-hole oset.603.2. The Non-Planar Nature of Vector GraphicsIf =f ′f1, f2If = 6f ′f1, f2′ =′ = 6k′ = k + 2k′ = k + 11 =2 = 6′ = g′ = g − 1 k′ = k + 21 =2 =g1 + g2 = g k1 + k2 = k + 2′ = g′ = g−12 k′ = k + 1′ = g′ = g−22 k′ = k + 2′ = 6 g′ = g − 1 k′ = k + 1′ = 6 g′ = g − 2 k′ = k + 21 =2 = 6 2g1 + g2 = g k1 + k2 = k + 21 = 62 =g1 + 2g2 = g k1 + k2 = k + 21 = 62 = 6 g1 + g2 = g k1 + k2 = k + 2If g is odd:If g is even:1 = 62 =1 = 62 = 6If =f ′f1, f2If = 6f ′f1, f2′ =′ = 6k′ = k + 2k′ = k + 11 =2 = 6′ = g′ = g − 1 k′ = k + 11 =2 =g1 + g2 = g k1 + k2 = k + 1′ = g′ = g−12 k′ = k′ = g′ = g−22 k′ = k + 1′ = 6 g′ = g − 1 k′ = k′ = 6 g′ = g − 2 k′ = k + 11 =2 = 6 2g1 + g2 = g k1 + k2 = k + 11 = 62 =g1 + 2g2 = g k1 + k2 = k + 11 = 62 = 6 g1 + g2 = g k1 + k2 = k + 1If g is odd:If g is even:1 = 62 =1 = 62 = 6ecut is aclosed edgeCutFaceAtEdge()ecut is anopen edge startingand ending atthe same holeecut is anopen edge startingand ending atdierent holes ′ = g′ = g k′ = k − 1(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)Figure 3.25: Exhaustive classication of the 19 dierent ways a face can be cut along an edge. The branching“if”s represent known information about the face to be cut (e.g., is it orientable or not?). The branching arrowsrepresent dierent cuts that can be done, each leading to dierent topological properties (e.g., either disconnectsthe face, or not). We illustrate all these 19 types of cuts in Figure D.5 and Figure D.6. Note that planar mapsonly support (b), (k), and (s), and which of the three to apply can be fully determined combinatorially, unlikein the general case.613.3. PCS Complexes(b) Manifolds Mc(a) Abstract PCS complex (C, T ) (c) PCS complex (X, C, T )C = { v1, v2, v3, e1, e2, e3, f }isClosed: e1, e2, e3 7→ ⊥dim:v1, v2, v3 7→ 0e1, e2, e3 7→ 1f 7→ 2 : f 7→g : f 7→ 0k : f 7→ 1∂̂:v1, v2, v3 7→ ∅e1 7→ (v1, v2)e2 7→ (v2, v3)e3 7→ (v2, v3)f 7→ [ [(e2,>), (e3,⊥)] ]Mv1 =Me1 =Mv2 =Mf =Mv3 =01Me2 =0110Me3 =01∼=Figure 3.26: (a) Example of abstract PCS complex P = (C, T ), where T = (dim, isClosed, , g, k, ∂̂),consisting of 7 abstract cells c ∈ C . (b) The characteristic manifold Mc associated with each abstract cell, asspecied by the functions dim, isClosed, , g, and k. (c) The geometric realization |P| = (X, C, T ) of P ,dened by gluing the boundary of each manifoldMc to manifolds of lower dimension, as specied by ∂̂.3.3 PCS ComplexesIn Section 3.2, starting from a short list of design decisions, we informally deduced various topolog-ical objects and operators that vector graphics tools should support, such as non-planar topologies,and even non-planar individual cells. In this section, we introduce the concept of PCS complex,which is a topological structure satisfying these requirements. This particular section is moretechnical in nature and provides insights into the key theoretical contributions of this thesis. Itis optional reading for the reader with more applied interests, who will already have developed auseful intuition of the problems at hand from the rst two sections of this chapter.Very briey, a PCS complex (= Point-Curve-Surface complex) is a topological space—in otherwords, a continuous point-set—which is partitioned into cells that have to satisfy some constraints(see Figure 3.26c). It is similar to the concept of CW complex, but has dierent denitions of cellsand constraints, in order to make it suitable for vector graphics. Importantly, unlike CW com-plexes, PCS complexes can be dened in terms of a combinatorial structure which we call abstractPCS complex (see Figure 3.26a).This section is organized as follows. In Section 3.3.1, we dene the concept of abstract PCS complex.It is a combinatorial structure consisting of symbols c ∈ C and some topological information Tabout them. Then, in Section 3.3.2, we dene the concept of PCS complex, as geometric realizations623.3. PCS Complexesof abstract PCS complexes. In order to clarify these formal denitions, we discuss them and provideexamples in Section 3.3.3. Finally, in Section 3.3.4, we show how the denition of vector graphicscomplexes is derived from the denition of abstract PCS complexes.3.3.1 Abstract PCS complexesAn abstract PCS complex is an ordered pair P = (C, T ), such that:• C is a nite set of symbols called abstract cells• T = (dim, isClosed, , g, k, ∂̂) is a tuple of functions together called abstract topology.They assign topological information to abstract cells, as we detail below.• dim : C → {0, 1, 2} is a function that assigns a dimension to each abstract cell. Thisdenes a partition of C into three sets V , E, and F of elements respectively called abstractvertices, abstract edges, and abstract faces. For conciseness, we now omit the adjectiveabstract when it is clear that we are referring to combinatorial objects.• isClosed : E → {>,⊥} is a function that assigns a closedness to each edge. This denesa partition of E into two sets E◦ and E| of elements respectively called closed edges andopen edges.• : F → {, 6} is a function that assigns an orientability to each face.• g : F → N is a function that assigns a genus to each face. This genus must be non-zero fornon-orientable faces.• k : F → N is a function that assigns a number of holes to each face.• ∂̂ is a function that assigns an ordered boundary to each cell. This ordered boundary, whichwe detail below, is what denes the incidence relationship between cells.• For each v ∈ V , we have ∂̂v = ∅.• For each e ∈ E◦, we have ∂̂e = ∅.• For each e ∈ E|, we have ∂̂e ∈ V × V . We denote by vstart(e) and vend(e) the rst andsecond element of the ordered pair.• For each f ∈ F , we have ∂̂f ∈ Γk(f). In other words, it is an ordered sequence of k(f)cycles γi ∈ Γ, where Γ is the set of all possible cycles on P , which we dene below.• A halfedge h = (e, β) is a pair of an edge e ∈ E and a direction β ∈ {>,⊥}. If e is a closededge, then h is called a closed halfedge, otherwise it is called an open halfedge. For each633.3. PCS Complexesopen halfedge h, we denote by vstart(h) and vend(h) the following vertices:vstart(h) =vstart(e), if β = >vend(e), if β = ⊥ and vend(h) =vend(e), if β = >vstart(e), if β = ⊥ (3.2)• A cycle γ ∈ Γ is either:1. a vertex v ∈ V , or2. a pair (h,N) consisting of a closed halfedge h and an integer N > 0, or3. a non-empty, ordered sequence (hj)j∈[1..N ] of open halfedges such that:∀j ∈ [1..N ], vend(hj) = vstart(h(j+1) mod N ) (3.3)In the rst case, the cycle is called a Steiner cycle; in the second case, it is called a simplecycle; and in the third and last case, it is called a non-simple cycle.3.3.2 PCS complexesIn this section, for each abstract PCS complex P = (C, T ), we dene a structure called the geo-metric realization of P . It is a triplet |P| = (X, C, T ) consisting of a point-set X , a partition Cof X , and a topology T on X . The elements of C are called the (non-abstract) cells of |P|.A PCS complex is then dened as any tripletK = (X, C, T ) such that there exists an abstract PCScomplex P whose geometric realization |P| = (X ′, C′, T ′) is isomorphic to K. By isomorphic,we mean that there exists a homeomorphism φ : X → X ′, continuous with respect to T and T ′,such that each cell c ∈ C is mapped by φ to a cell c′ ∈ C′.Let P = (C, T ) be an abstract PCS complex. We dene |P| = (X, C, T ) as follows, where thetopology T of each topological space is assumed to be the usual topology on compact manifoldsand quotient spaces.Characteristic Manifolds For each abstract cell c ∈ C , we dene a compact manifold Mc,called the characteristic manifold of c, as follows:• The characteristic manifold of each vertex v ∈ V is the single point {0}.• The characteristic manifold of each closed edge e ∈ E◦ is the unit circle S1.• The characteristic manifold of each open edge e ∈ E| is the segment [0, 1].643.3. PCS Complexes• The characteristic manifold of each face f ∈ F is the unit8 compact surface of orientability(f), genus g(f), with k(f) holes.Disjoint Union We dene Y as the disjoint union Y = ∐c∈CMc. This simply means that Yis a topological space composed of allMc together, preventing intersections by attaching a uniqueID to each Mc. A formal denition can be found in [Lee 2011, p64].Quotient Space We deneX as the quotient space obtained from Y by gluing9 the boundary∂Mc of each characteristic manifold to lower-dimensional manifolds, as follows:• For vertices and closed edges, there is nothing to glue since ∂Mc = ∅.• For each open edge e ∈ E|, we respectively glue the start and end point of Me = [0, 1] tothe point Mvstart(e) and the point Mvend(e).• For each face f ∈ F , we glue the points of ∂Mf as follows.First, we recall thatMf is a compact surface with k(f) holes. This means that ∂Mf consistsof k(f) connected components Bi, each homeomorphic to a circle. For clarity, we assumethat all manifoldsM homeomorphic to a circle are consistently parameterized10 by θ ∈ [0, 1),and we use the notation M[θ] to refer to the point of M corresponding to the parameter θ.If θ lies outside the range [0, 1), we implicitly use its fractional part θ − bθc instead.Back to the denition. For each cycle γi of ∂̂f , we glue the following points:1. If γi is a vertex v, we glue the whole circle Bi to the point Mv .2. If γi is a pair (h,N) consisting of a closed halfedge h = (e, β) and an integer N > 0,then we glue each point Bi[θ] to the point Me[θ′], where:θ′ =Nθ, if β = >−Nθ, if β = ⊥ (3.4)3. If γi is a sequence (hj)j∈[1..N ] of open halfedges hj = (ej , βj), then we rst partitionthe hole Bi intoN sub-arcs Bi,j , each dened by θ ∈ [ j−1N , jN ). Then, for convenience,we reparameterize these sub-arcs by u ∈ [0, 1). Finally, for each sub-arc Bi,j , we glue8Here, the term unit refers to any surface of reference which we assume has been arbitrarily xed beforehand, inorder to uniquely dene |P|. The choice of this unit surface inuences the denition of |P|, but only within the sameisomorphism class. Thus, it does not inuence the denition of PCS complexes, which are dened via isomorphisms.9See Appendix A.6 for the precise meaning of quotient space and gluing.10We detail what this means in Section 3.3.3, paragraph Constistent Parameterization. This disambiguates whichdirection is “clockwise”, and which direction is “counter-clockwise”.653.3. PCS Complexese1fve1e2fe1f∂̂f = [γ1, γ2]where:γ1 = ((e1,>), 1)γ2 = vk(f) = 2g(f) = 0(f) =where:∂̂f = [γ1]γ1 = ((e1,>), 1)k(f) = 1g(f) = 1(f) = 6∂̂f = [γ1, γ2]where:γ1 = ((e1,>), 1)γ2 = ((e2,⊥), 2)k(f) = 2g(f) = 0(f) =isClosed(e2) = >isClosed(e1) = > isClosed(e1) = > isClosed(e1) = >(a) (b) (c)∂̂f = [γ1, γ2]where:γ1 = ((e1,>), 1)γ2 = ((e2,⊥), 1)k(f) = 2g(f) = 0(f) =isClosed(e2) = >isClosed(e1) = >fe2e1(d)Figure 3.27: Four examples of PCS complexes K, together with their combinatorial representation P . Forconciseness, we did not mention the set C or the function dim, which can be easily inferred from the gure.Also, we did not mention the value of ∂̂ for vertices and closed edges, which is always equal to the empty set.each point Bi,j [u] to the point Mej [u′], where:u′ =u, if βj = >1− u, if βj = ⊥ (3.5)Cell Decomposition Finally, for each abstract cell c ∈ C , we dene its geometric realization|c| as the subset ofX that corresponds to the interior ofMc. Since the boundary of each character-istic manifold Mc is glued to characteristic manifolds of lower dimension, and since their interioris left untouched, we can deduce that the subsets |c| dene a partition ofX . We dene C to be thispartition, which completes the denition of |P| = (X, C, T ).3.3.3 Examples and DiscussionsIn Figure 3.26, we give a simple but detailed example of abstract PCS complexP = (C, T ), togetherwith its geometric realization |P| = (X, C, T ), and an illustration of how |P| is dened by stitchingtogether the characteristic manifolds Mc. We recommend to spend some time to analyze thisexample while reading the denitions, which by itself should already provide a good understandingof the structure. In this section, we clarify the most important or least obvious points.663.3. PCS ComplexesCell Types An abstract PCS complex is a combinatorial structure made of dierent types ofcells: vertices, closed edges, open edges, and faces of various orientability, genus, and number ofholes. The list of cells is given by the set C , and their topological type is given by the functionsdim, isClosed, , g, and k. This choice of types is not arbitrary but a direct consequence of theclassication of compact n-manifolds for n ≤ 2 (for more details, see Section A.4).Hole Types The incidence relationship between cells is given by the function ∂̂, which speciesthe start and end vertex of open edges, and the bounding vertices and edges of faces. Since theformer is quite straightforward, let us only clarify the latter. As we have seen in Section 3.2, theboundary of every face is composed of a given number of holes (this includes both the outer bound-ary and inner holes, if any). Each of these holes is composed of vertices and/or edges, organizedin a specic order, and with a specic direction. We represent this organization via the concept ofcycle. We can identify three categories of holes, which leads to three categories of cycles:1. There are holes that are composed of a single vertex and no edges, i.e. a point-in-face, orSteiner vertex. These holes are very easy to represent combinatorially: one must just referto this vertex (see Figure 3.27a, γ2).2. There are holes that are composed of a single closed edge, no vertices, no open edges (seeFigure 3.27b–d). One may think that these can also be easily represented combinatorially,by simply referring to the closed edge. This is almost true, but with two subtleties:• First, one must choose a direction for the closed edge. Indeed, if you glue together thetwo holes of a cylinder, you can either get a torus or a Klein bottle, depending on whichdirection is chosen. Therefore, instead of simply specifying the closed edge e, we needto specify a pair h = (e, β) of the closed edge with a direction.• Second, the hole may “circle around” the closed edge several times. This is for instancewhat happens when you cut a Möbius strip in its centerline (see Figure 3.24b). Thenon-orientable face becomes orientable, and it gains one new hole which is composedof a closed edge “used two times”. This latter information is critical: without it, therewould be no way to distinguish this “cut-Möbius” face (Fig. 3.27d) from a disk with oneinner hole (Fig. 3.27b). There would be no way to know that it is possible to uncut atthis closed edge, and that such uncut makes the face non-orientable. Therefore, insteadof specifying a closed halfedge h, we need in fact to specify a pair (h,N), whereN > 0species the number of times the hole circles around the closed edge. Typically,N = 1,but in the case of the cut-Möbius, N = 2, and in fact any value of N > 0 is possible.3. Finally, there are holes that are composed of vertices and open edges (see Figure 3.28). Thisis the most typical case, the most intuitive, but the most complex from a combinatorial673.3. PCS Complexese1e2v2v1f(a)fe2e1v2v1e3∂̂e1 = (v1, v1)where:γ1 = [ (e1,>),k(f) = 1g(f) = 0(f) =∂̂f = [γ1]∂̂e2 = (v1, v2)isClosed(e2) = ⊥isClosed(e1) = ⊥(e2,>),(e2,⊥) ]∂̂e1 = (v1, v1)where:γ1 = [ (e1,>),k(f) = 1g(f) = 0(f) =∂̂f = [γ1]∂̂e2 = (v2, v2)isClosed(e2) = ⊥isClosed(e1) = ⊥(e3,>),isClosed(e3) = ⊥∂̂e3 = (v1, v2)(e2,⊥),(e3,⊥) ]∂̂e1 = (v1, v1)where:γ1 = [ (e1,>),k(f) = 1g(f) = 0(f) =∂̂f = [γ1]∂̂e2 = (v2, v2)isClosed(e2) = ⊥isClosed(e1) = ⊥(e4,>),isClosed(e4) = ⊥∂̂e3 = (v1, v2)(e2,>),isClosed(e3) = ⊥∂̂e4 = (v1, v2)(e4,⊥),(e3,>),(e4,⊥) ]e1fe3v1v2e2∂̂e1 = (v1, v2)where:γ1 = [ (e1,>),k(f) = 1g(f) = 0(f) =∂̂f = [γ1]∂̂e2 = (v2, v1)isClosed(e2) = ⊥isClosed(e1) = ⊥(e3,⊥),isClosed(e3) = ⊥∂̂e3 = (v1, v2)(e2,⊥),(e3,⊥) ]e3e1 e2e4fv2v1(b) (c) (d)Figure 3.28: More examples of PCS complexes K, together with their combinatorial representation P .standpoint. They are combinatorially represented by a cycle: a path of consecutive directedopen edges, which starts and ends at the same vertex. Intuitively, this cycle is obtained bystarting at any arbitrary vertex of the hole, then walking on the surface, alongside the hole,until we are back at the same position on the surface. Note that being back at the start vertexis not enough, since it can appear multiple times in the cycle. Also, edges can appear anynumber of times in the cycle, with any direction. In Figure 3.28, we give many exampleswhere an edge is used two times by the same cycle. In Figure 3.28d, there is even an edgeused three times by the same cycle. Note that if an edge is used three or more times (by thesame cycle or not), then the overall topology is both non-manifold and non-planar.Analogy with Graphs The set of abstract cells C plays the same role as the set of nodes V ina graph G = (V,E) (which is to provide an “identity” to every object in the structure), and the683.3. PCS Complexes(a) (b)∼=Figure 3.29: (a) In order to unambiguously dene the geometric realization of an abstract PCS complex, allholes must be oriented “consistently”. For instance, here, walking along any hole leaves the surface “to the left”.(b) This means that if a face is embedded in R2, then the outer boundary must have the opposite clockwisenessthan the inner holes. Indeed, when stretching this outer boundary oriented like so, we see that it turns into ahole of a sphere, with an orientation consistent with the other holes.tuple of functions T plays the same role asE (which is to represent how these objects are connectedto one another). However, in the case of graphs all nodes have the same “type”, while in the caseof abstract PCS complexes there exist dierent types of cells. Assigning this type is another roleof T , which can be seen as coloring the nodes of a graph. Besides the usual graphs G = (V,E)where edges are unordered pairs of vertices without identity, it is perhaps more interesting tomake an analogy with directed multigraphs, dened as G = (V,E, r), where V and E are twosets of symbols (i.e., edges also have an identity), and r : E → V × V assigns a source vertex anda target vertex to every edge. Such structure could be equivalently dened as G = (C, T ), withT = (dim, r), clearly classifying information as being either “identity” or “topology”, like in ourformalism but without closed edges and faces, and where r plays the role of ∂̂. This shows that PCScomplexes are in fact a superset of directed multigraphs, and among them stroke graphs.Geometric Realization In Section 3.3.2, we dened the geometric realization |P| of each ab-stract PCS complex P , by dening a characteristic manifold Mc to each abstract cell, then gluingthese manifolds together in a way specied by ∂̂. Then, we dened a PCS complex as any topo-logical space, together with a cell decomposition, which is isomorphic to the geometric realizationof an abstract PCS complex. However, it is also possible to dene PCS complexes independentlyfrom abstract PCS complexes, similarly to how CW complexes are usually dened. We providesuch a denition in Appendix B.Consistent Parameterization In the denition of the geometric realization |P| of an abstractPCS complex P , we mentioned that the holes of the characteristic manifold Mf of a given face fare assumed to be consistently parameterized by θ ∈ [0, 1). For conciseness, we did not dene theexact meaning of “consistently”, but it is actually a critical part of the denition, and we clarify it693.3. PCS Complexes6∼=6≡∼=6≡∼=≡Figure 3.30: Examples of PCS complexes which are either homeomorphic, or isomorphic, or both, or neither.Note that if two PCS complexes are isomorphic, then they are also homeomorphic.here. It means that for any given Mf , the chosen orientations for all its holes are consistent withone another. More precisely, this means that if we walk along any hole with the chosen orientation,the surface is always on the same side of the hole, e.g., “to the left” (see Figure 3.29a). As a conse-quence, this means that for planar faces—which are the most typical in vector graphics—the “outerboundary” is oriented with the opposite clockwiseness than the inner holes (see Figure 3.29b). Be-sides, we note that any orientable surface has two sides A and B. When we say “walk along anyhole”, we mean more precisely “walk on side A of the surface, alongside any hole”. If you werewalking on side B, then the surface would be “to the right” instead of “to the left”. For any givenface, which side or which orientation is chosen does not matter, as long as the choice is consistentacross all holes. Finally, we note that this whole concept of consistency only applies to orientablefaces. Non-orientable faces only have one side, like in a Möbius strip, and the orientations of theirholes are irrelevant. They can be chosen arbitrarily and independently; in each case it will denethe same geometric realization |P| up to isomorphism.Homeomorphism and Isomorphism We recall that a PCS complex K is a topological spacetogether with a (valid) cell decomposition. Therefore, we dene a homeomorphism between twoPCS complexesK andK′ to be a homeomorphism between their topological spaces (ignoring theircell decompositions). However, in Section 3.3.2, we also dened in the stronger concept of iso-morphism, which is a homeomorphism between two PCS complexes such that every cell of K ismapped into a cell ofK′. In other words, ifK andK′ are isomorphic, not only they are homeomor-phic, but they also have the “same” cell decomposition. In the algebraic topology literature, thisconcept is sometimes called cellular homeomorphism, or cellular equivalence. We use the notationK ∼= K′ to denote homeomorphic PCS complexes, and the notation K ≡ K′ to denote isomorphicPCS complexes (see Figure 3.30 for examples). These denitions can be extended for abstract PCScomplexes: two abstract PCS complexes P and P ′ are said homeomorphic (resp. isomorphic) ifand only if their geometric realizations |P| and |P ′| are homeomorphic (resp. isomorphic). Ab-stract PCS complex homeomorphism is very similar to graph homeomorphism. However, abstractPCS complex isomorphism is a bit more subtle than graph isomorphism. Indeed, within an iso-morphism class, not only can cells be renamed (as in graph isomorphism), but in addition, cyclescan be re-ordered, rotated (= dierent start vertex), sometimes reversed (e.g., in the case of non-orientable faces), and edge directions can sometimes be ipped. This captures the intuitive concept703.3. PCS Complexesthat for any (non-trivial) PCS complex, there are many abstract PCS complexes that can representit, which are technically dierent, but should really be considered the same. Deciding whether twoabstract PCS complexes are isomorphic is a NP-hard problem11, since it is at least as hard as graphisomorphism, which is NP-complete.Boundary and Incidence Graph From the denition of ordered boundary ∂̂, we can denethe concept of boundary ∂ for abstract PCS complexes. For each abstract cell c, its boundary∂c is dened as the set of cells “involved” in ∂̂c. More precisely, it is dened as follows: ∂c =∅ for vertices and closed edges; ∂̂e = {vstart(e), vend(e)} for open edges; and for faces, ∂f iscomposed of its Steiner vertices, bounding closed edges, bounding open edges, and their start andend vertices. Equivalently, it can also be dened as the set of abstracts cells c′ whose geometricrealization |c′| is contained in the point-set dened by ∂Mc. In any case, this allows us to denethe incidence graph of any abstract PCS complex, as the directed graph G = (C,E) where C isthe set of abstract cells, and (c, c′) ∈ E if and only if c′ ∈ ∂c. One may think that this incidencegraph, or perhaps simply replacing ∂̂ by ∂ in the denition of P , is enough to uniquely dene anabstract PCS complex. Unfortunately, this is not true: there exist many abstract PCS complexeswhich are not isomorphic, but that have the same incidence graph. In order words, the concept ofordered boundary is critical. This order species direction of edges, which can make the dierencebetween a planar or a non-planar topology. This order species which edges are used several timesby the same face, which can make the dierence between a manifold or non-manifold topology.In practice, all of this has an inuence on the behavior of topological operators.Multiplicative Notation for Cycles For convenience, it is useful to denote cycles via a multi-plicative notation, which is a very common practice in algebraic topology (see Figure 3.31). In fact,one may argue that it is what makes algebraic topology, well, algebraic. Using this notation, thesequence of open halfedges [ (e1,>), (e2,⊥), (e3,>) ] can simply be written as e1e−12 e3. A cycleconsisting of a Steiner vertex v is obviously written “v”, and a cycle consisting of a pair ((e, β), N)of a closed halfedge and integer is written as eN , or e−N (or simply e if N = 1 and β = >). If βis an unknown variable, intuitive notations such as eβ , e−β , or eβN can of course be used.Topological Operators Given an abstract PCS complex P , it is possible to transform it to adierent abstract PCS complex P ′, by using a topological operator. Each topological operator isa combinatorial algorithm that implements a behavior described in terms of point-sets, such as glueand cut (see Section 3.2). In fact, being able to do so is one of the most important reason why wedeveloped the formalism of PCS complexes in the rst place. It allows us to have a one-to-one11More precisely, it is very likely a NP-complete problem, but proving that it is actually in NP is not obvious. Webelieve that it can be done by realizing the spaces as triangulations, and using some trick with the genuses to keep thesize of the triangulation polynomial in the size of P , but we leave a formal proof for future work.713.3. PCS Complexese1fe3v1v2e2∂̂e2 = (v2, v1)e1f2e3v1v2e2f1e1fv1v2e2∂̂f = [ e1e2 ]∂̂e1 = (v1, v2)∂̂e2 = (v2, v1)∂̂e1 = (v1, v2)∂̂e3 = (v2, v1)∂̂f = [ e1e3e−12 e3 ]∂̂e2 = (v2, v1)∂̂e1 = (v1, v2)∂̂e3 = (v2, v1)∂̂f1 = [ e1e3 ]∂̂f2 = [ e2e−13 ](a) (b) (c)Figure 3.31: Two examples of cut operators on a Möbius strip. We use here a multiplicative notation forcycles, where emeans the halfedge (e,>), and e−1 means the halfedge (e,⊥). Note that for both cut operators,the cut edge e3 is an open edge starting at v2 and ending at v1, but still the cuts are non-equivalent.mapping (up to isomorphism) between combinatorial structures P and point-set decompositionsK, supporting closed edges and non-planar faces. To the best of our knowledge, this is the rsttime it has ever been achieved, at the very least applied for vector graphics. This makes possibleto rigorously infer any topological operator algorithm from a behavior specied in terms of point-sets, instead of arbitrarily picking an algorithm that seems to implement the desired behavior. Forinstance, cutting a face f along an open edge can be dened as extracting from its geometricrealization |f | any open curve starting and ending at a vertex, then decomposing the remainingpoint-set into connected components. With this denition, we have been able to methodicallydiscover and classify all non-equivalent cuts, where non-equivalent means that the resultingPCS complexes are not isomorphic. In Figure 3.31, we illustrate two of such non-equivalent cuts,and in Appendix D, we detail all topological operators and their corresponding algorithms.3.3.4 Vector Graphics ComplexesA vector graphics complex (VGC) is dened as an abstract PCS complex with “unknown” ori-entability and genus. In other words, a VGC is a pairP = (C, T ) where T = (dim, isClosed, k, ∂̂),and where C , dim, isClosed, k, and ∂̂ have the same denition as for abstract PCS complexes(see Section 3.3.1). Of course, there are many other ways to dene this structure, such as P =(V,E, F, ∂̂), especially since isClosed and k can in fact be deduced from ∂̂. All of these are equiv-alent and simply a matter of taste. In Chapter 4, we discuss vector graphics complexes at length,focusing mostly on practical considerations such as how to immerse them in R2, how to specifya depth ordering for overlapping cells, and how to build an intuitive user interface around thisconcept. In this section, we only discuss how vector graphics complexes relate to PCS complexes,723.3. PCS Complexesglue uncutunglue cut∂̂f = [ e1e2e3e4 ] ∂̂f = [ e1e5e3e5 ] ∂̂f = [ e1e−13 ]e1fe5e3 e1fe3e1fe2e3e4(a) (b) (c)Figure 3.32: Examples of topological operators applied to a VGC. Top: Expected behavior. Bottom: Algebraicoperations to perform on the face’s cycle in order to implement this behavior.and in particular, we discuss why the concept of PCS complex is useful to understand and denevector graphics complexes.Consider the sequence of VGC operations illustrated in Figure 3.32. The initial shape on the left(Fig. 3.32a) can be represented as a single face f , since edges of vector graphics complexes areallowed to overlap. The face is rendered using the even-odd winding rule, which is the moststandard rendering method used in vector graphics systems. Then, a user may decide to glue e2with e4, and nally to uncut at e5, resulting in the shapes depicted in Figure. 3.32b and 3.32c. Whilethis behavior is arguably a design decision, it is fair to assume that it captures what most userswould intuitively expect. For this specic example, based on this expected behavior, it is possibleto infer an implementation of glue, uncut, and their inverse operations, such as cut. Importantly,notice that this cut does not disconnect the face! Also, it even reverses the direction of e3. Thismakes it signicantly dierent from a “usual” cut, which should have disconnected the face intotwo faces (e.g., cutting a disk gives two half-disks). If we assume that f represents some kind ofsurface, with any reasonable denition of surface, then such cut only makes sense if we interpretthis surface to be a Möbius strip. In fact, the cycle γ = e1e5e3e5 from Figure 3.32b stronglysupports this interpretation: it is the textbook example of an algebraic Möbius strip. It may notexactly look like a Möbius strip (due to how vector graphics shapes are rendered), and users maynot think of it as a Möbius strip, but nonetheless it behaves like a Möbius strip, and it has the samealgebraic representation as a Möbius strip. Therefore, it is in our best interest to interpret f as aMöbius strip immersed in R2, rather than a non-manifold surface embedded in R2.The concept of PCS complex allows us to formalize this interpretation (see Figure 3.33). Indeed,by assigning an orientability and genus to every face, any VGC can be interpreted as an abstractPCS complex P = (C, T ), from which can be dened a PCS complex K = |P| = (X, C, T ),which we recall is a (possibly non-planar) point-set X , such as a Möbius strip, decomposed intonon-intersecting subsets c ∈ C called cells. Rendering the VGC, for instance using the even-oddwinding rule, can then be interpreted as dening an immersion φ : X → R2 from this point-733.3. PCS Complexes∂̂f = [ e1e−13 ]Abstract PCS Complex(combinatorial structure)geometricrealizationVector Graphics Complex(combinatorial structure)PCS Complex(non-intersecting union of point-sets,Visualization / Rendering(union of point-sets of R2,immersiondiscarding and gassigning and gwinding rule(or else)presentationschemepossibly non-planar) possibly intersecting)(f) = 6 g(f) = 1∂̂f = [ e1e−13 ]e1e3 e1e3Figure 3.33: Diagram comparing the related concepts of vector graphics complexes and PCS complexes. Inparticular, notice the two-way mapping between PCS complexes and abstract PCS complexes, which allows todene topological operators in terms of point-sets. By contrast, rendering a VGC in R2 using a winding rule (orany other method), is only a one-way mapping.set X into the canvas R2, possibly creating intersections between cells (= “overlapping points”).The strength of this formalism is that while topological operators on VGCs may be seen as designdecisions, topological operators on PCS complexes are perfectly well-dened. Indeed, we have seenthat they can be non-ambiguously dened in terms on point-sets, from which we can infer theiralgebraic counterparts, which is possible due to the one-to-one mapping between PCS complexesand abstract PCS complexes (Fig. 3.33, left). By contrast, due to the existence of overlapping points,rendering a VGC into subsets of R2 can only be a one-way mapping no matter which renderingmethod is used (Fig. 3.33, right), therefore the same approach cannot be used. However, we cannow simply dene VGC operators in terms of abstract PCS complex operators, since they sharethe same underlying algebraic structure.Of course, there is a catch: assigning orientability and genus to VGC faces is ambiguous in thegeneral case, and can only be achieved via imperfect perceptual heuristics, or by asking the user.Therefore, it is still ambiguous which PCS topological operator should be applied on any givenVGC. But at the very least, studying PCS complexes allowed us to rigorously identify an exhaustivelist of topologically meaningful operators to choose from. Also, in practice, the large majority offaces should simply be interpreted as orientable and of genus 0. Among the rare cases which743.3. PCS Complexesv1v2e1e2fv1v2e1e2f1 f2ecutCut (k)Edit geometryv1v2e1 e2fCut (k)v1v2e1 e2f1 f2ecutv1v2e1e2f1 f2ev′1v′2e′GlobalUngluev1v2e1 e2f1 f2v′1v′2e e′GlobalUnglueCut (l)GlobalUngluev1v2e1 e2f ecutv1v2e1 e2fv′1v′2e e′v1v2e1e2fCut (k)Cut (j)Edit geometryGlobalUnglueGlobalUnglue(a)(b)(c)(d)(e)f1f2fff1f2v1e1e2v2ecutv1e1e2v2ecutv1e1e2v2 ev′1v′2 e′v1v2 ev′1v′2 e′e1e2Figure 3.34: Left column: Three dierent immersions of the same VGC. Middle column: the result of applyinga given cut algorithm to the VGC (the letters (k), (l) and (j) refer to Figure 3.25). Right column: the resultof applying unglue to all cells and modifying slightly the geometry, for better visualization of the cut. Thisillustrates that unlike planar maps, cutting a VGC is an ambiguous operation. While there is only one way aplanar map face can be cut (i.e., applying Cut (k), cf. row (a)), there are many non-equivalent ways a VGC facecan be cut. Choosing the "planar map way" may lead to unexpected results (cf. rows (b) and (d)), in which casechoosing an alternative cut algorithm may better capture the user’s intent (cf. rows (c) and (e)).753.4. Conclusionshould be interpreted as something else, such as a Möbius strip, there is also almost always anobvious choice. Besides, PCS complexes provide us with an important theoretical understandingof the underlying topological spaces that vector graphics complexes represent, or more precisely,of the family of topological spaces that they may represent. In other words, it formally clarieswhat we mean by “a VGC can represent any arbitrary non-manifold topology as an immersion inthe plane, unlike planar maps which can only represent embeddings”.An important dierence between planar immersions (= vector graphics complexes) and planarembeddings (= planar maps) is that the latter, by denition, can only represent faces that are planar,that is, orientable and of genus 0. This largely simplies the cut operator. For instance, there isonly one way to cut a genus-0 orientable face along an open edge starting and ending at the samehole. This cut is labeled (k) in the face-cut classication provided in Figure 3.25, and is illustratedin Figure 3.34a. However, mistakenly applying this “planar cut” (k) to a face that “looks like” aMöbius strip (Fig. 3.34b), or “looks like” a genus-1 orientable face (Fig. 3.34d) leads to unexpectedbehaviors. Instead, one should in these cases apply the “non-planar cut” labeled (l) (Fig. 3.34c), orthe “non-planar cut” labeled (j) (Fig. 3.34e). Deciding which cut to apply on any given situation isstill an open problem, but the formalism of PCS complexes allowed us to discover the exhaustivelist of possible cuts to choose from. Note how the three input examples in Figure 3.34 (left column)all have the same topology as vector graphics complexes, but should be interpreted as dierentPCS complexes (that is, assigning dierent genus and/or orientability).3.4 ConclusionIn this chapter, we have introduced important topological concepts to help us understand the math-ematical nature of vector graphics objects, which is not as trivial as it may seem. Importantly, as aconsequence of allowing vector graphics shapes to overlap and to share edges (two very desirablefeatures), vector graphics topologies are possibly non-planar, or even non-orientable. In fact, evenshapes represented as a single vector graphics face may be non planar and/or non-orientable, byallowing users to uncut shapes in predictable ways, where predictable means that the behavioronly depends on local topological properties. This theoretical knowledge was critical to designand implement the concept of vector graphics complexes, which we detail in the next chapter. Itis a combinatorial structure that can be interpreted as a (possibly non-planar) topological spacecalled a PCS complex K, in which cells are disjoint point-sets. Rendering a VGC, using for in-stance winding rules, can then be interpreted as dening an immersion of this underlying spaceK into R2. This interpretation of VGCs as a non-planar point-set immersed in R2 allowed us torigorously dene and classify all topological operators that can be applied to VGCs, instead ofarbitrarily designing such operators based on intuition.76Chapter 4Vector Graphics Complexes:The Topology of Vector IllustrationsFigure 4.1: Vector graphics illustrations and their underlying topology.Basic topological modeling, such as the ability to have several faces share a common edge, hasbeen largely absent from vector graphics. We introduce the vector graphics complex (VGC) as asimple data structure to support fundamental topological modeling operations for vector graphicsillustrations. The VGC can represent any arbitrary non-manifold topology as an immersion in theplane, unlike planar maps which can only represent embeddings. This allows for the direct repre-sentation of incidence relationships between objects and can therefore more faithfully capture theintended semantics of many illustrations, while at the same time keeping the geometric exibilityof stacking-based systems. We describe and implement a set of topological editing operations forthe VGC, including glue, unglue, cut, and uncut. Our system maintains a global stacking order forall faces, edges, and vertices without requiring that components of an object reside together on asingle layer. This allows for the coordinated editing of shared vertices and edges even for objectsthat have components distributed across multiple layers. We introduce VGC-specic methods thatare tailored towards quickly achieving desired stacking orders for faces, edges, and vertices.4.1 IntroductionVector illustrations are widely used to produce high quality 2D drawings and gures. They arecommonly based on objects that are assigned to layers, thereby allowing objects on higher layersto obscure others drawn on lower layers. Objects are typically constructed from collections of openand closed paths which are assigned to a single common layer when they are grouped together.Closed paths can be optionally lled by an opaque or semitransparent color in order to represent774.2. Motivation and Overviewfaces. A rich set of features and editing operations can then be integrated into this framework toyield powerful systems for 2D illustration.Our work begins with the observation that basic topological modeling is largely absent in vectorgraphics systems. While 3D modeling systems readily support the creation of geometry havinga desired topology, in many vector graphics systems it remains dicult to design objects havingedges shared by adjacent faces or vertices shared by sets of incident edges. Our solution is todevelop a novel representation which allows users to directly model the desired topology of theelements in a vector graphics illustration.Another important observation is that vector graphics illustrations often consist of 2D depictionsof 3D objects [Durand 2002, Eisemann et al. 2009], with the important consequence that a repre-sentation of vector graphics objects as strictly two-dimensional entities, such as planar maps, maybe counter-productive. In this context, users may also need to represent aspects of the topologi-cal structure of the 3D objects being depicted when creating and editing the visual representation.The topology of the visual objects may therefore not be in correspondence with their 2D geometry,but rather be in correspondence with the 3D geometry of the depicted objects, which are mentalentities, constructed by perception [Homan 2000]. Such mental visual objects can be representedin an abstract pictorial space [Koenderink and Doorn 2008] which is dierent from both the 2Dimage space and the 3D world space.Finally, a third observation is that artists use a variety of techniques that frequently result in non-manifold representations. For example, a ower or tree can be drawn with a combination of strokesand surfaces. As a result, non-manifold, mixed-dimensional objects are the rule in vector graphics,not the exception.Based on the above observations, we have developed the vector graphics complex (VGC), a novelcell complex that satises the following requirements: (a) be a superset of multi-layer vector graph-ics and planar maps; (b) allow edges to share common vertices and faces to share common edges;(c) allow faces and edges to overlap, including when they share common edges or vertices (d)make it possible to draw projections of 3D objects and their topology without knowing their 3Dgeometry; (e) represent non-orientable and non-manifold surfaces; (f) allow arbitrary deformationof the geometry without invalidating the topology; (g) oer reversible operators for editing thetopology of vector graphics objects; and (h) have the simplicity that would encourage wide-spreadadoption.784.2. Motivation and OverviewFigure 4.2: The “SVG” representation, as used in Illustrator (except for the LivePaint tool) and Inkscape. Left:Open and closed paths, lled or not. Right: Overlapping and self-overlapping paths.≡(a) Shared edge in SVG (b) Shared edge + overlappingFigure 4.3: The limitations of existing representations. SVG cannot represent two faces sharing a commonedge as in (a), therefore must duplicate the shared edge. Planar maps can represent shared edges, but cannotrepresent overlapping faces, thus neither SVG nor planar maps can represent the illustration in (b).4.2 Motivation and OverviewIn this section, we motivate the vector graphics complex (VGC) and provide an intuition about itsstructure. This overview provides many of the insights needed to understand and implement theVGC. It also lays the foundation for understanding a more formal denition that we provide in thefollowing section.Let us rst recall the traditional vector graphics representation, that we will refer to as “SVG”because of the XML Scalable Vector Graphics le specication of the same name. With SVG, adrawing is represented using building blocks called paths. A path is typically a list of Bézier controlpoints, that can be either closed or open. It has drawing attributes that indicate how it must berendered, such as stroke width, stroke color, and ll color, as illustrated Figure 4.2. Paths aredened independently of each other, which means that if one path is dragged and dropped by theartist on top of another one, they freely overlap and do not interact as shown in Figure 4.2.This basic overlapping capability is a very desirable feature, since it allows the artist to freely editthe geometry of the paths and move the objects without any constraints. Nonetheless, there arecases where it would be desirable to model interaction between paths. A canonical example, alsodescribed in [Baudelaire and Gangnet 1989], occurs when the illustration represents two shapesthat share a common partial contour or edge. In SVG, this must be represented as two indepen-dent closed paths, where the common section has exactly the same geometry, as illustrated inFigure 4.3a.794.2. Motivation and Overviewe1v1start endv2e1v1start ende1e2v1startv4v3ende1e6endv2v5startendstartende3e4e5startstartendstartend(a) (b) (c) (d)Figure 4.4: (a) Example of open edge e1, with its two end vertices v1 and v2. (b) Special case of open edgewhere its two end vertices are equal. (c) Example of closed edge, i.e., an edge with no end vertices at all. (d) AVGC composed of vertices and edges only, similarly to a stroke graph. v1, v2 and v4 are each shared by threeedges.While common tools such as Adobe Illustrator [Adobe Systems Inc. 2013] or Inkscape [Inkscape2013] provide convenient tools to build such shapes (such as basic duplication or alignment fea-tures, or the shape builder tool in Illustrator), the topological information between the two shapesis still not explicitly encoded: the semantics of the intended illustration is not correctly repre-sented. In practice, this means that the information about the common portion of the paths isduplicated, and editing its geometry is often tedious. Typically, adding Bézier control points orediting tangents must be performed twice (this limitation is demonstrated in the video accompa-nying [Dalstein et al. 2014b]). Planar maps and their extension, dynamic planar maps (LivePaintin Illustrator), have been introduced as a solution to this problem. This, however, introduces othercompromises, such as the inability to have overlapping faces. While planar maps can faithfullyrepresent the semantics shown in Figure 4.3a, they cannot faithfully represent the semantics of theillustration shown in Figure 4.3b. This second gure shares the same topology and can thereforebe obtained from Figure 4.3a via simple editing of the geometry. This limitation seriously impairsartistic freedom and expressiveness.The vector graphics complex that we present is an alternative solution, much closer to the spirit ofSVG. Notably, it retains the ability to represent overlapping objects, and hence it is able to faithfullycapture the semantics of the illustration shown in Figure 4.3b without duplicating any geometricinformation for the common section.Whereas in SVG the building block is the path, the VGC has building blocks called cells, of whichthere are four types: vertices, open edges, closed edges, and faces. A vertex is simply a 2D pointon the canvas, typically located where strokes meet or end. It can have drawing attributes suchas a color and a radius size, but most often you would prefer not to display it at all (just use it asa building block for edges and faces). An open edge is similar to an SVG open path: it denes a2D directed open curve on the canvas, for instance using Bézier control points. The signicantdierence between an open edge and a SVG open path is that an open edge starts at a start vertex,804.2. Motivation and Overviewe2e1e6e3e4e5f1 f2Figure 4.5: Two faces f1 and f2 each dened by one cycle. The cycle dening f1 is γ1 =[(e1,>); (e2,⊥); (e3,⊥); (e4,>)], while the cycle dening f2 is γ2 = [(e2,>); (e6,>)]. For convenience,we also use the multiplicative notation γ1 = e1e−12 e−13 e4 and γ2 = e2e6.and ends at an end vertex, and these vertices can be shared with other edges. On the contrary, allthe control points of a given SVG path, including the rst and last control points, belong to the pathand cannot be shared with other paths. In practice, the end vertices of open edges are stored aspointers (see Figure 4.4a). As illustrated in Figure 4.4d, two or more open edges can be connectedto each others by sharing a common vertex, and manipulating this vertex would aect all incidentedges. So far, our denition is identical to stroke graphs [Whited et al. 2010], except that we do notorder the incident edges counter-clockwise around a vertex. In addition to the concept of openedge, we dene the concept of closed edge, which is a 2D directed closed curve no end vertices atall, as illustrated in Figure 4.4c. We note that it is allowed for an open edge to have its start vertexbe equal to its end vertex (see Figure 4.4b). On the contrary to some existing representations, weconsider this to be a special case of open edge, i.e., we do not call this a closed edge.Another dierence with SVG paths is that VGC edges do not have a color lling attribute: llingis done via the creation of faces, an entity not supported by stroke graphs. A face is dened byits boundary via what we call cycle. Typically, one of the cycle of the face represents its outerboundary, while the other cycles represent inner holes. Like in SVG, we do not explicitly store inour data structure whether a cycle represents an outer boundary or an inner hole, since users canfreely edit their geometry, which could change these perceptual roles, or make them ill-dened.Typically, a cycle is dened as a sequence of (e, β) pairs that we call halfedges, where e is anopen edge and β is a boolean indicating whether the edge should be considered with its intrinsicdirection (from start to end, β = > = True), or with the opposite direction (from end to start,β = ⊥ = False), as illustrated in Figure 4.5. However, a cycle can also be dened as a uniquedirected closed edge. Finally, a cycle can also be dened as a unique vertex, and we call thesecycles Steiner cycles. A Steiner cycle makes possible to connect the end vertex of an edge to theinterior of a face.An artist creates edges and vertices by drawing strokes. He can choose whether intersections ofstrokes with existing edges must generate a new vertex and split the incident edges; or must simply814.3. Vector Graphics Complexv1f1v2 v3v4e1e2e3e4f3e8v5v6e6f2e7e5Figure 4.6: Two incident squares and a disk represented as a single VGC with 17 cells: six vertices v1 to v6,seven open edges e1 to e7, one closed edge e8, and three faces f1 to f3.ignore the intersection and create overlapping edges, not topologically connected. To create faces,the artist uses a paint bucket tool, which automatically compute cycles dening closed regions ofthe canvas bounded by edges. Then, the artist can freely sculpt the geometry of edges, or dragand drop cells. Also, he can use topological operators, for instance to glue two vertices or edgestogether, or cut a face into two faces by inserting a new edge. We refer the reader to the videoaccompanying [Dalstein et al. 2014b] for a demonstration of this drawing paradigm. The cells areglobally depth-ordered in a doubly-linked list, and we provide intuitive tools to alter this ordering,for instance to decide which face is behind the other in Figure 4.3b.4.3 Vector Graphics ComplexIn this section, we provide a formal denition of the concept of vector graphics complex. Thisdenition is inspired from concepts of algebraic topology (see Chapter 3), but the formalism itselfis more typical of graph theory. In fact, we show in Section 4.3.3 how the denition can be inter-preted as a colored graph. Readers who prefer a more practical denition can also jump directlyto Section 4.3.4 where we give a C++ implementation with invariants.4.3.1 TopologyFirst, let us provide a purely combinatorial denition. In Section 4.3.2, we subsequently assigngeometric attributes to each cell, in order to immerse this combinatorial structure in R2.A vector graphics complex is an ordered pair P = (C, dim, isClosed, k, ∂̂), such that:• C is a nite set of symbols called cells. We illustrate in Figure 4.6 what cells represent.• dim : C → {0, 1, 2} is a function that assigns a dimension to each cell. This denes apartition of C into three sets V , E, and F of elements respectively called vertices, edges,and faces.824.3. Vector Graphics Complex• isClosed : E → {>,⊥} is a function that assigns a closedness to each edge (> and ⊥ arethe two symbols we use to denote the booleans “True” and “False”). This denes a partitionof E into two sets E◦ and E| of elements respectively called closed edges and open edges.• k : F → N is a function that assigns a number of cycles to each face.• ∂̂ is a function that assigns an ordered boundary to each cell. This ordered boundary, whichwe detail below, is what denes the incidence relationship between cells.• For each v ∈ V , we have ∂̂v = ∅.• For each e ∈ E◦, we have ∂̂e = ∅.• For each e ∈ E|, we have ∂̂e ∈ V × V . We dene vstart(e) and vend(e) to be the rst andsecond element of the ordered pair.• For each f ∈ F , we have ∂̂f ∈ Γk(f). In other words, ∂̂f is an ordered sequence of k(f)cycles γi ∈ Γ, where Γ is the set of all possible cycles on P , which we dene below, afterrst dening the concepts of open and closed halfedges.• A closed halfedge h = (e, β) is dened as a pair of a closed edge e ∈ E◦ and a directionβ ∈ {>,⊥}.• An open halfedge h = (e, β) is dened as a pair of an open edge e ∈ E| and a directionβ ∈ {>,⊥}. For each open halfedge h, we dene vstart(h) and vend(h) as follows:vstart(h) =vstart(e), if β = >vend(e), if β = ⊥ and vend(h) =vend(e), if β = >vstart(e), if β = ⊥ (4.1)• Finally, a cycle γ ∈ Γ is dened as either:1. a vertex v ∈ V , or2. a pair (h,N) consisting of a closed halfedge h and an integer N > 0, or3. a non-empty, ordered sequence (hj)j∈[1..N ] of open halfedges such that:∀j ∈ [1..N ], vend(hj) = vstart(h(j+1) mod N ) (4.2)These three types of cycles are respectively called Steiner cycles, simple cycles, and non-simple cycles.We illustrate this denition with a simple example in Figure 4.7. Since the concept of vertices andedges should be fairly self-explanatory, let us simply give more clarications on the concept of834.3. Vector Graphics ComplexC = { v1, v2, v3, v4, e1, e2, e3, e4, f }isClosed: e1, e2, e3, e4 7→ ⊥dim:v1, v2, v3, v4 7→ 0e1, e2, e3, e4 7→ 1f 7→ 2k : f 7→ 1∂̂:e2 7→ (v1, v3)e3 7→ (v3, v4)e4 7→ (v2, v4)f 7→ [ [(e1,⊥), (e2,>), (e3,>), (e4,⊥)] ]e1 7→ (v1, v2)v1, v2, v3, v4 7→ ∅e1v1 v2e2e3e4v3 v4fFigure 4.7: Combinatorial representation of a square as a VGC with 4 vertices, 4 open edges, and 1 face.faces and cycles. As one can notice, the number of cycles k(f) of any given face f can be any inte-ger in N. In particular, the denition allows k(f) = 0, which corresponds to a face without cycles.Such faces are not particularly useful in vector graphics (they cannot be rendered in any meaning-ful way), but they have theoretical relevance (see Chapter 3 for details), and it is sometimes usefulto allow their representation as a transient state occurring in the middle of an operation.Also, note that cycles are allowed to repeat any edge any number of times, including three timesor more. Not only such cycles have theoretical relevance, but they are actually useful in practice(see Figure 4.19, middle and right). This corresponds to the typical “fan edge” non-manifold con-guration, but with the less typical avor that all the “fans” actually belong to the same face andthe same cycle. Perhaps more surprisingly, we also allow simple cycles (i.e., cycles dened via aclosed edge) to repeat their closed edge any number of times (though, the chosen direction must bexed). This number of repetitions is given by the integerN > 0 in the denition. Similarly to faceswithout cycles, simple cycles with repeated closed edge correspond to congurations which aretheoretically meaningful (and may be the results of valid topological operators), but are not veryuseful in practice. Though, one notable example is a Möbius strip whose centerline is representedas a closed edge. Both sides of the centerline belong to the same face and the same cycle, which isa simple cycle repeating the closed edge two times. Another interesting example is to take threelong strips of paper, and glue them all together along one of their long edge (this gives a long openedge shared by three faces). Then, if you glue the two star-shaped ends of this construction afterapplying a third-twist, the three faces become one, and the center open edge becomes closed. Oneof the cycle of the unique face is a simple cycle repeating this closed edge three times.Finally, cycles are not necessarily disjoint, whether they are from the same face or dierent faces.In other words, they can freely share common vertices or edges, with no limitations, as we illustratein Figure 4.8. In other words, the validity of a cycle does not depend on any other cycle. In fact,two dierent faces may even have equal cycles. This represents two faces with exactly the sameshape, stacked on top of one another, with their boundary glued.844.3. Vector Graphics Complexface f cycle 1 cycles 2 to 7 ∂fFigure 4.8: A valid face, with seven cycles. Cycle 1 represents its external boundary (including a “crack”), andthe six other cycles represent holes (one of them being a single missing point in the face, dened by the Steinercycle).4.3.2 GeometryNow that we have dened the combinatorial structure of a VGC, let us dene how we can immerseeach cell c ∈ C as a pointset |c| ⊆ R2, by assigning them geometric attributes.Vertex Each vertex v is assigned a point p(v) ∈ R2. We dene |v| = {p(v)}, that is, the subsetof R2 reduced to the point p(v).Open Edge Each open edge e is assigned a continuous curve Γ(e) : [0, 1] → R2, satisfyingΓ(e)(0) = p(vstart(e)) and Γ(e)(1) = p(vend(e)). We dene |e| = Γ(e)((0, 1)), that is, the imageof the open interval (0, 1) by Γ(e).Closed Edge Each closed edge e is assigned a continuous closed curve Γ(e) : S1 → R2, whereS1 is the unit circle. We dene |e| = Γ(e)(S1).Face Each face f is assigned a winding rule R(f) ⊆ Z. This winding rule allows us to denethe pointset |f | ⊆ R2 as follows. First, for each simple or non-simple cycle γ, we dene the closedcurve Γ(γ) : S1 → R2 by concatenating together the curves Γ(e) for all the edges e involved in thecycle, and we dene |γ| = Γ(γ)(S1). If γ is a Steiner cycle γ = v, we simply dene |γ| = |v|. Thisallows us to dene |∂̂f | = ⋃γ∈∂̂f |γ|, which is the immersion in R2 of the boundary of the face.854.3. Vector Graphics ComplexNext, for each cycle γ, and for each point p ∈ R2\|γ|, we denote by N(γ)(p) ∈ N the windingnumber of Γ(γ) at p (cf. [Edelsbrunner and Harer 2010, p12]). Now that we have dened per-cyclewinding numbers N(γ)(p), we can dene per-face winding numbers N(f)(p) by summing theN(γ)(p) for all cycles γ of the given face f , that is:∀f ∈ F, ∀p ∈ R2\|∂̂f |, N(f)(p) =∑γ∈∂̂fN(γ)(p). (4.3)With all these prerequisites, |f | can nally be dened as:∀f ∈ F, |f | = { p ∈ R2\|∂̂f | s.t. N(f)(p) ∈ R(f) }. (4.4)Currently, our implementation uses the OpenGL GLU polygon tesselator [Shreiner et al. 2004] tocompute and render |f |, using the even-odd winding rule, that is, R(f) = 2Z + 1 for all faces.Other rules could be considered as well, and users could choose dierent rules for dierent faces,as is already common in many vector graphics applications (e.g., Inkscape).4.3.3 Vector Graphics Complexes as Colored Incidence GraphsIn this section, we show how the concept of vector graphics complex, which we have just dened,can be interpreted as a colored graph. More specically, it can be interpreted as a coloration of theincidence graph of the cell complex.Incidence GraphMany readers may already be familiar with the concept of incidence graph. However, let us takethe time to formally dene it in the case of vector graphics complexes. The incidence graph ofa given vector graphics complex P = (C, dim, isClosed, k, ∂̂) is the directed graph G = (C,A)where the nodes are the cells c ∈ C , and where there is a directed arc12 a ∈ A from c to c′ if andonly if c′ is in the boundary of c.Though, we have yet to dene what “c′ is in the boundary of c” actually means. Indeed, all we haveformally dened so far is the concept of ordered boundary ∂̂c, which isn’t a subset of C but somemore complex ordered structure (e.g., an ordered pair of vertices for open edges, or an orderedsequence of cycles for faces). Now, we dene ∂c as the subset of C consisting of “all cells involvedin ∂̂c”, that is, we forget the order. More precisely, we dene ∂v = ∂e = ∅ for vertices and closededges, we dene ∂e = {vstart(e), vend(e)} for open edges (reduced to a unique element when12We use the terminology “arc” instead of the more usual “edge” to avoid confusion with VGC edges, which areactually nodes of the graph.864.3. Vector Graphics Complexe1 e2 e3 e4 e5 e6 e7 e8v1 v2 v3 v4 v5 v6f1 f2 f3Figure 4.9: The incidence graph of the VGC illustrated in Figure 4.6. For clarity, we do not show in this gurethe arcs from faces to vertices, since they can be inferred by transitivity.vstart(e) = vend(e)), and in the case of a face f , we dene ∂f to be the union of all its Steinervertices, all the closed edges of its simple cycles, and all the open edges and their end vertices ofits non-simple cycles. With this denition, we can now safely dene “c′ is in the boundary of c”as meaning c′ ∈ ∂c.It can be easily shown that the relation “c′ ∈ ∂c” is transitive and irreexive, thus denes a strictpartial order, which in turns means that G is a transitive directed acyclic graph. By assigning thedimension of each cell c as a color of each node of the graph, we obtain a graph such as illustratedin Figure 4.9.Non-Sufficiency of the Incidence GraphOne may wonder whether this incidence graph alone encodes all the topological information of thevector graphics complex. The answer is no. Fundamentally, the incidence graph only encodes ∂c,and the conversion from ∂̂c to ∂c causes information loss (i.e., it is not invertible). In more practicalterms, the edges in the boundary of a face need to be organized into cycles if we want to renderthe face using winding numbers, but the automatic computation of cycles from a set of edges isin general ambiguous. We illustrate this ambiguity in Figure 4.10 and 4.11 with the example ofa Möbius strip. In this example, the (non-ordered) boundary of the face f is ∂f = { e1, e2, e3 },and it is impossible to organize these three edges in one cycle without repeating at least one of itsedges. For instance, starting at v1, one can go along e1, then e2, then e3, then e2 again back to v1.Alternatively, still starting at v1, one can go along e1, then e3, then e2, then e3 again back to v1.These two dierent cycles result in dierent winding numbers, thus in dierent nal renders. Theexplicit cycle ordering provided in ∂̂c allows disambiguation (potentially authored by artists), andensures consistent rendering across implementations.874.3. Vector Graphics Complexe1 e2 e3v1 v2fe3e2e1f =?v1v2Figure 4.10: The incidence graph of a Möbius strip. From this incidence graph alone, it is unclear how theface f should be rendered.γ = e1e−12 e3e−12γ = e1e−13 e2e−13Visualization ofcycle123Visualization ofwinding numbers Final render01-1Figure 4.11: Illustration of two possible choices of cycles for the incidence graph of Figure 4.10. We assumethat v1 is the start vertex of all three edges, and that v2 is their end vertex. These two cycles repeat a dierentedge, which results in dierent winding numbers, and therefore dierent nal renders. We use here the even-oddwinding rule, but using the non-zero winding rule would also result in dierent renders.Coloring the Incidence Graph with Topological OrderIn the previous paragraph, we have seen that the incidence graph of a given vector graphics com-plex does not encode all its topological information. We have also seen that the additional infor-mation not encoded in the incidence graph corresponds to an “ordering” of the boundary of facesinto cycles of edges.One can imagine encoding this ordering into the incidence graph by “coloring” (=annotating) its884.3. Vector Graphics Complexev1v2ev1 v2start endFigure 4.12: The ordered boundary ∂̂e = (vstart, vend) of an open edge e can be encoded in the incidencegraph by coloring the arcs of the graph, thus dening a topological direction for the edge.e2e3v1v2fe1 startendstartend1st edge of cycle, from start to end2nd and 4th edge of cycle, from end to start3rd edge of cycle, from start to endstartend∅∅e2e3v1v2fe1 startendstartendstartend∂̂f = [ e1e−13 e2e−13 ]Figure 4.13: Illustration of how the ordered boundary ∂̂f of each face f can be encoded in the arcs of theincidence graph. This example corresponds to coloring the incidence graph from Figure 4.10.arcs with additional information. For instance, the arcs between an open edge and its end verticesmight by annotated “start” or “end” (or “both”), in order to indicate which vertex is the start vertexof the edge, and which is the end vertex (see Figure 4.12). The same idea can be applied to annotatethe boundary of faces. It is a bit less practical, but with some care, it is possible to dene a bijectivefunction to map the information contained in ∂̂f into annotation of the outgoing arcs of f inthe incidence graph (see Figure 4.13). Therefore, one can see that the concept of vector graphicscomplex can be interpreted as an incidence graph augmented with order information, and that thisorder is required to disambiguate winding numbers.More fundamentally, we see in Chapter 3 that the order is critical to determine the homeomor-phism class of the underlying topological space, which is required to know which topologicaloperators can be applied to the complex.894.3. Vector Graphics Complex4.3.4 ImplementationBelow, we give one possible C++ implementation of the VGC data structure:1 class Cell2 {3 std::set <Cell*> star;4 };56 class Vertex: public Cell7 {8 Point p;9 };1011 class Edge: public Cell12 {13 Vertex * start;14 Vertex * end;15 Curve curve;16 };1718 class Halfedge19 {20 Edge * edge;21 bool b;22 };2324 class Cycle25 {26 Vertex * steiner;27 std::vector <Halfedge > halfedges;28 };2930 class Face: public Cell31 {32 std::vector <Cycle > cycles;33 };Of course, the above code is only an implementation of how to store the data, and most of the hardwork is implementing how to edit this data via topological operators (see Section 4.4). However,the code illustrates that the structure itself is quite straightforward and intuitive. Though, let usprovide some details and clarications in the next few paragraphs.As detailed in Section 4.3.1 and 4.3.2, a vertex is simply a 2D position, an edge is a 2D directedcurve pointing to its start and end vertex (if any), and a face is a 2D region of the plane delimitedby cycles (where a cycle is either a sequence of consecutive halfedges, or a single vertex).904.3. Vector Graphics ComplexChecking whether an edge e is closed or open is simply done by checking whether e->start isNULL or not. Indeed, closed edges do not have end vertices, and therefore e->start and e->endare both NULL for closed edges. Conversely, open edges always have a valid start vertex and endvertex, and therefore e->start and e->end are both non-NULL for open edges.Similarly, checking whether a cycle cycle is a Steiner cycle or not is done by checking whethercycle->steiner is NULL or not. Equivalently, one may check whether cycle->halfedges isempty or not, since cycle->halfedges is non-empty if and only if cycle->steiner is NULL.Note how in this implementation, the classes Vertex, Edge, and Face all inherit the class Cell,while Halfedge and Cycle do not. This is because halfedges and cycles are only helper classes todene faces, but are not cells themselves. More specically, halfedges and cycles are just conve-nient container classes (you can see them as ad-hoc std::pair and std::vector) to store theincidence relationships between cells. In particular, note how the classes Cell, Vertex, Edge, andFace are used with pointer semantics, while the classes Halfedge and Cycle are used with valuesemantics. This is because cells have an identity: it is important for a cell to be able to refer toother cells (e.g.: “Who is my start vertex?”). On the other hand, halfedges and cycles do not needto have an identity (though, for various reasons, a particular implementation may choose to givethem an identity, similarly to the concept of uses in the radial-edge data structure).The star of a cell c is dened as star(c) = { c′ | c ∈ ∂c′ }, that is, as the set of cells c′ whoseboundary contains c. Strictly speaking, this is redundant topological information (reason why itis not in the theoretical denition of the VGC), but in practice, we need to store the star of eachcell for obvious performance reasons. Indeed, not doing so would make most adjacency queriesor topological operators have a linear-time complexity instead of constant-time. Storing the starof the cells is the equivalent of storing back-pointers to parent nodes in a tree data structure. Notethat we do not store this star in any particular order, which we emphasized by using a std::set (inpractice, it may be more ecient to use a std::vector). If we ever need to have more informationabout the incident relationship between a cell c and one of its star cell c′ (e.g., is the vertex a Steinervertex?), one can simply traverse the boundary of c′ and inspect how c is used by c′ (e.g., as a Steinercycle, or as the end vertex of an open edge of a non-simple cycle?).We did not describe the Curve class since it is up to each application to decide on a curve rep-resentation adapted to its specic context. For instance, an existing vector graphics system withextensive support of Bézier curves may use Bézier curves. For our prototype, we opted for a sim-pler dense polyline representation. On top of this core structure, more drawing attributes can beadded for ne control on rendering. For instance, in our implementation we added vertex radius,variable edge width, cell color (possibly transparent), and edge junctions style (miter join or beveljoin).914.4. Topological OperatorsTo ensure that the data structure is topologically valid, we ensure that all public methods (e.g.,topological operators, see Section 4.4) preserve the following invariants:• Vertex: no topological invariants.• Edge: the start and end vertices are either both non-NULL valid pointers (open edge), orboth NULL (closed edge).• Halfedge: edge is a non-NULL valid pointer.• Cycle: one of the following is true:– steiner is a valid non-NULL pointer and halfedges is empty.– steiner is NULL, halfedges has a size n > 0, and one of the following is true:∗ halfedges[0] is a valid closed halfedge, and for all i ∈ {1, . . . , n− 1},halfedges[i] == halfedges[0]∗ halfedges only contains valid open halfedges, and for all i ∈ {0, . . . , n− 1},halfedges[i].end() == halfedges[(i+1) % n].start()(where Halfedge::start() returns (b ? edge->start : edge->end), andHalfedge::end() returns (b ? edge->end : edge->start))• Face: Every cycle in cycles is valid.In addition, since our implementation includes the backpointers star, every cell c must sat-isfy:• ∀c′ ∈ ∂c, c ∈ c′.star• ∀c′ ∈ c.star, c ∈ ∂c′A key feature of these invariants is that they can be veried eciently and robustly without geo-metric computations.4.4 Topological OperatorsSince topology lies at the heart of the vector graphics complex, and that we aim at porting topologi-cal modeling into the the realm of 2D vector graphics, it is highly desirable to be able to manipulatein an intuitive fashion this topology, using topological operators. Traditionally, such operatorsare described as Euler operators, since as a safety check one ensures that they are compatible withan Euler formula, linking the number of cells of each type, and topological quantities such as the924.4. Topological Operatorsnumber of connected components and the number of holes. Designing an Euler formula in the caseof our non-manifold, non-orientable, mixed-dimensional objects is likely possible and denitelyinteresting, but it is far from trivial and rather irrelevant as a safety check. Instead, one just has toensure that the invariants which we detailed in the previous section are preserved. In this section,we informally present the reversible operators create/delete, glue/unglue and cut/uncut, which allpreserve these invariants and are analyzed in more details in [Dalstein et al. 2014a].These topological operators can be intuitively combined together by the artist to achieve the in-tended topology. In fact, gluing and cutting are not only useful operations, but have theoreticalroots in algebraic topology. For instance, the proof of the classication of closed two-manifoldsinvolves “cutting” the given manifold until the manifold is represented as a fundamental polygon.By gluing together the edges of this polygon, we re-obtain the original manifold. The VGC isa superset of fundamental polygons and is furthermore closed under gluing, which proves thatthe VGC can represent any closed two-manifold, including non-orientable surfaces such as theKlein bottle in Figure 4.1. In fact, we show in Chapter 3 that the VGC can represent any regularnon-manifold two-dimensional topological space.4.4.1 Creation and Deletion OperatorsCreating a vertex or a closed edge does not require special care. Creating an open edge requiresreferring to existing start and end vertices. These topological operators are automatically invokedwhen the user draws a stroke, as detailed in Section 4.6. Creating a face requires as input itslist of valid cycles, and robustly obtaining these valid cycles from intuitive user input is still anopen problem. Currently, the user can either manually select a set of edges which is automaticallyconverted to cycles, or use a “paint bucket” tool which tries to nd appropriate cycles from sur-rounding edges. Unfortunately, both of these techniques are in general ambiguous due to potentialoverlapping between edges. To achieve faces such as a Möbius strip, one option for the user is toexplicitly draw the repeated edge twice (as in Figure 4.11, left), use the paint bucket, then gluetogether the two repeated edges.To delete a cell, we rst recursively delete its star, otherwise the VGC would become invalid. Werefer to this topological operation as a “hard delete”. However, by default our delete commandenacts a “smart delete”, whose semantics is designed to better reect a user’s intentions. If weconsider the case of a vertex, v, with two incident edges, e1 and e2, and a user that chooses to“delete” v, the intended outcome is more likely to be a single longer edge e3 that is the geometricunion of v, e1 and e2, as opposed to an alternative scenario that deletes each of v, e1, and e2.The intended outcome is given by the topological operation “uncut at v”, as will be detailed later.However, it may not always be possible to uncut at a given vertex v, such as is the case when there934.4. Topological OperatorsUnGlueUnGlueUnGlueUnGlueUnGlueGlueGlueGlueGlueGluealgorithmalgorithmFigure 4.14: Examples of glue and unglue operations on vertices, edges, and a set of cells (bottom-right).are three or more incident edges. The semantics of our “smart delete” are thus dened by “uncutif possible; otherwise, hard delete”.4.4.2 Glue and Unglue OperatorsThe glue operator on vertices and edges, as well as the unglue operator on vertex, edge, or set ofvertices and edges are illustrated in Figure 4.14. Gluing two vertices is the equivalent of the oper-ation join in existing vector graphics software, where two paths are appended by gluing togethertwo selected path end-nodes. However, with such a classical join operation, the selected end-nodesare transformed into a middle Bézier control point that cannot be joined again to create three-wayjunctions. In contrast, the VGC is closed under the glue operation: any two vertices, or two openedges, or two closed edges can always be glued. More specically, there are always two waysto glue two given edges: one has to specify their relative relative direction. Our implementationuses a simple heuristic to predict the most relevant direction for the selected edges and then callsthe unambiguous glue halfedges topological operation. This rst glues their respective start andend vertices together, and only then glues the edges together. The unglue operation is the reverseoperation, where a vertex or an edge is duplicated as many times as necessary. Ungluing a vertexinvolves rst ungluing its incident edges.944.4. Topological OperatorsCutCutCutCutCutCutUnCutUnCutUnCutUnCutUnCutUnCut(failure)(Steiner)Figure 4.15: Examples of cut and uncut operations on vertices and edges. The third operation on the rightcolumn illustrates uncutting a Steiner vertex from a face. It is topology equivalent to the fth operation on thesame column. The fth example on left column is a failure case, when the cut algorithm transfers the “holecycle” to the wrong face (shown in red). This happens because the cut operator is actually ambiguous anddisambiguation require geometric heuristics to capture the user’s intent.4.4.3 Cut and Uncut OperatorsThe results of the cut and uncut operators are illustrated in Figure 4.15. Cutting an edge e is theequivalent of inserting a new control point in a SVG path: given a 2D position p on the geometryof an edge e, it creates a new vertex v at position p, and cuts e into two edges e1 and e2 separatedby v. If e was a closed edge, then it becomes an open edge with its start and end vertices equal tov. Cutting a face f is similar: given a curve Γ starting and ending on ∂f , it cuts the face into twofaces f1 and f2, separated by a new edge e whose geometry is Γ. This may involve cutting rst∂f to create the end vertices of e if they do not already exist. Alternatively, if Γ starts and endsat two dierent cycles of f (cf. Figure 4.15, bottom-left), then instead of cutting f into f1 and f2,it simply merges the two cycles into one by concatenating them with the halfedges (e, true) and(e, false). Finally, a face can also be cut by a closed curve contained in its interior, or by a pointp (via a Steiner cycle). In the general case, cutting a face is ambiguous and is therefore less trivialthan one might think, as we detail in Chapter 3. A simple example is given in Figure 4.15 (failurecase): if f contains holes, then one may decide to transfer these holes either to f1 or f2, whichrequires geometric heuristics. Designing a set of infallible heuristics is unfortunately not possible954.5. Depth OrderingFigure 4.16: The eect of a global “uncut”. Left: Original VGC. Right: VGC resulting from applying “selectall” and then “uncut”.because the boundary of a hole is allowed to overlap the boundary of f , or can even be completelyoutside f .Uncutting is the reverse operation: the user chooses a cell c (a vertex or an edge) where to uncut,and the operator merges this cell with its star to obtain a larger cell. Therefore, it can be seen asa “smart delete” or a “local simplication” operation. In Appendix E, we refer to this operationas atomic simplication and study it in more details. While it is always possible to cut any givencell, i.e., a face or an edge, it is not always possible to uncut at a given cell c. Specically, this isonly possible if c “could have been obtained via a cut”. Equivalently, it is only possible if the unionof c with its direct star (concept that we dene in Appendix E) is a manifold space. For instance,if a vertex v has three incident edges, then the union of v with its direct star (in this case theincident edges) is non-manifold, and hence uncutting at v is not possible. Surprisingly, uncuttingis theoretically simpler than cutting: it is a bit tedious to implement to handle all possible cases,but it is never ambiguous and does not rely on any geometric computation.Once the uncut operator is implemented both for a single vertex and a single edge, it can be triv-ially extended to a set of cells: simply uncut all selected edges, then uncut all selected vertices.This is a powerful topological simplication operator, as illustrated in Figure 4.16: performing thisoperation on the whole VGC is equivalent to the simplication operation described in [Rossignacand O’Connor 1989]. We conjecture in Appendix E that it results in a unique minimal decomposi-tion.4.5 Depth OrderingAn important consideration in vector graphics is the ability to order cells from back to front andpaint them appropriately. In this section, we describe how this operation is supported with theVGC. Each cell in a VGC (e.g., vertices, edges, and faces) is assigned a unique depth order. The964.5. Depth OrderingtopbottomC+∂cc c′∂c′cnextFigure 4.17: Raising a cell.Figure 4.18: An example of the exible occlusion interactions enabled by the VGC.order is maintained via a doubly-linked list containing all the cells, where the ‘top’ cell of the listwill be drawn last and will therefore occlude other parts of the drawing. When a new cell c iscreated, it is by default inserted just below the lowest cell in its boundary ∂c.Further alterations of the depth ordering are supported by allowing the user to raise a selectedcell, c. A trivial implementation of raise would be to simply swap the depth order of c and the cellimmediately above it in the depth order, cnext, as depicted in Figure 4.17. However, this typicallyfails to capture the user’s intention: there may be no visible change as a results of the raise, and, ifa face or edge is selected, the commonly-desired semantics is to have vertices remain on top of theedges and faces that they help dene, and edges to remain on top of the faces that they help dene.These semantics are implemented by the algorithm Raise below, and illustrated in Figure 4.17.The lower operation is the counterpart to raise and is implemented in a largely symmetric fashion,where the directions are reversed and ∂c is replaced by star(c).974.6. User InterfaceRaise (selected cell c)1 search from bottom to nd c2 compute C+ = subset of (c ∪ ∂c) that is above c3 search up from c for the rst cell c′ satisfying:c′ 6∈ ∂c AND geometry of c′ intersects with c4 move C+ above the highest element of (c′ ∪ ∂c′)The ability to manipulate depth orderings for components within objects and between objectsallows for partial orderings such as that shown in Figure 4.18. One arm of the glasses is stacked soas to be behind the face while the other remains in front, along with the rest of the frame. Moreexamples involving depth manipulations are shown in Figure 4.1 and in the video accompanying[Dalstein et al. 2014b].4.6 User InterfaceMany aspects of the user interface can be readily understood from the video accompanying [Dal-stein et al. 2014b]. In what follows we provide a summary of the fundamental concepts and oper-ations.Edge design Hand-drawn strokes are the primary method for creating edges. An open strokedrawn on the canvas creates an edge with start and end vertices. Edges can be drawn in a standardxed-width mode, or their width can vary as a function of stylus pressure. Edges are represented asa densely sampled polyline and can be reshaped using a sculpting tool, either by locally draggingpoints, smoothing, or editing the width of the curve. If new intersections occur when sculptingan edge, they are ignored and never lead to the creation of a new vertex. The user can alwaysmanually insert a vertex at any given intersection.Intersections and snapping behavior If desired, edges can be drawn in a mode analogousto working with planar maps. This automatically cuts intersected edges and faces, and cuts thedrawn edge at self-intersections. This mode can be enabled or disabled in the GUI by toggling analways-visible icon. A snapping behavior can also be toggled: if enabled, end points of strokes snapto existing vertices if within a distance . Self-intersection junctions can also snap to each other,thereby allowing multiple approximately collocated self-intersections to automatically coalesceinto a single junction.984.7. User FeedbackFigure 4.19: Examples of non-manifold topologies where an edge has three “face uses”. These uses may be bythe same face (middle and right), and part of a hole (right)Creating faces and holes Faces and holes can be created in multiple ways, as demonstrated inthe video. The simplest way is to use a “paint bucket” tool that attempts to infer cycles of edgesenclosing the current mouse position. Alternatively, users can create faces by manually selectingthe edges that will serve as a boundary, which is sometimes useful to resolve ambiguities thatmay arise due to overlapping edges. Multiple holes can be added to a face, with the resulting lldetermined by their winding number, as shown in Figure 4.19.Steiner cycles Steiner cycles are created by selecting the face and the vertex to add as Steinercycle. Its primary use is to connect the end vertex of an edge to the interior of a face. Draggingthe face would also drag this end vertex, since it translates the whole face boundary. If desired,Steiner cycles can also be used to topologically connect two faces that do not share a commonedge. By sharing a common Steiner cycle, they can still be dragged independently, but form asingle connected component.Performance The performance of our implementation is currently limited by the naive dynamictessellation that we perform for each render. Edges are rendered according to their width attributethrough generation of quadrilaterals that are centered around the polyline that represents theedge path, and these are not cached between renders. Similarly, all faces are retessellated for eachrender.4.7 User FeedbackOur prototype has been informally tested by ve users ranging from novice to professional artists.Using this feedback, we provide an initial assessment of the usability of the VGC by non-technicalusers.994.7. User FeedbackFigure 4.20: A user experimenting with the possibilities oered by invisibe cuts and depth ordering.Figure 4.21: The VGC can be used for abstract art or stylized gurative art. Examples drawn by EtienneColas.Users consistently report that using the VGC is signicantly dierent from current SVG tools,and that it opens exciting new creative workows. Due to this novelty, the rst impressions aregenerally quite enthusiastic. The topological operations such as glue, unglue, uncut (directly viaa tool “simplify”, or indirectly when “deleting” a cell) are appreciated and readily adopted. In-terestingly, one of the most appreciated features is the ability to sculpt the interior of edges vialocal dragging or smoothing. Our free-form width editing is reported to be especially useful (seeFigure 4.22).Concerns have also been raised. Not surprisingly, one of the most disliked aspects of the prototypewas the necessity to select all the boundary edges to create a face (at the time, our prototype didnot yet have the “paint bucket” feature). Sometimes, due to an unclean topology and tiny edges,this is hard to achieve. Also, rendering artefacts at junctions (see Section 4.8) and the diculty tosculpt incident edges across a vertex, specically to get a smooth transition, have been mentioned.1004.7. User FeedbackFigure 4.22: Three more vector illustrations designed using the VGC. The ellipse surrounding the top illustra-tion is a single edge whose width was sculpted. Examples drawn by Estelle Charleroy.1014.8. Limitations and Future WorkFinally, users currently tend to stay in the (default) “planar map” mode, and hence fail to seethe advantage that overlapping faces oer. One user experimented with invisible cuts and depthordering (Figure 4.20), but reported diculties to master the feature. However, we believe thatfurther interface revisions and video tutorials would ease the learning experience.4.8 Limitations and Future WorkThe decorrelation of geometry and topology is a powerful means of representing the topologyof visual objects as they appear in the mind’s eye. As a result, it is left to the user to maintainany desired consistency between geometry and topology of VGCs. This can be a limitation insome cases. While the input we provide to the tessellator is the same as used for SVG and istherefore known to be well supported, the VGC oers little support for geometric operations suchas boolean operations. The parameterization of VGC faces is left as a separate problem; our currentsystem does not support texture-mapped faces. While a parameterization could be establishedvia triangulation based on a particular geometric conguration, future geometric edits may thenbecome problematic.Another concern is that even though using VGCs appears reasonably intuitive, they are still amore complex structure than SVG, which may cause confusion and frustration for artists used tothe classical representation. For example, a user cannot “uncut” a vertex shared by more thanthree edges or an edge shared by three or more faces. A vertex that is a Steiner cycle of a facecan be moved outside of the face, which can be unintuitive. Constraints could be added to resolvethis, but this then removes the independence of the topology and the geometry. Representing anopaque disc involves only one path with SVG (a path with a ll color), while it involves two cellswith the VGC (a closed edge and a face whose boundary is this edge). However, the applicationcould easily be adapted to provide further abstractions and tools making the VGC more artist-friendly. For instance, the ll-color property can be simulated by automatically creating a face(and a closing edge for open edges) for every edge in the complex. We believe that the benets ofthe VGC largely outweigh the added complexity.Some desired topological operations must currently be performed using multiple steps, such asthe “partial unglue” shown in Figure 4.23. We expect that it is possible to create macros for manysuch operations.One advantage of the VGC over traditional vector graphics is that, as with planar maps, it enablesthe representation of multiway joins (three or more edges sharing a common vertex). As shownin Figure 4.24, being aware of multiway joins (as opposed to emulating them via duplicated edges)makes it possible to inform the rendering for better results. However, we note that this is a double-1024.9. Conclusion?UnGlue UnGlueUnGlueFigure 4.23: A user cannot achieve the “partial unglue” operation (shown in the top left) in one step. It canbe accomplished indirectly via a sequence of unglues and reglues.No join Bevel join Bevel join(Illustrator) (VGC)Miter join Miter join(Illustrator) (VGC)Figure 4.24: Illustrator (except when using LivePaint) cannot represent multiway joins, thus fails to renderthem correctly: incident faces are rendered independently. With the VGC, we are aware of multiway joins andhence can improve the rendering, as illustrated here with the two common styles “bevel” and “miter”.edged sword: in the most general case, the correct rendering of multiway joins is a rather dicultand open problem, especially when the incident edges have dierent and possibly non-uniformwidths and colors. This leads to various visible artefacts in our prototype. In Figure 4.25, weillustrate a typical artefact that occurs due to the overlapping ability of VGC cells and the presenceof zero-width or transparent edges.4.9 ConclusionWe have introduced the concept of vector graphics complex, a novel and powerful data structurefor topology-aware design of 2D illustrations. It is a superset of multi-layer vector graphics, planarmaps and stroke graphs, which signicantly extends the range of objects that can be drawn withvector graphics, including 2D projections of 3D objects with imprecise or incomplete geometry,non-manifold surfaces of arbitrary genus, non-orientable surfaces, and overlapping faces. Vector1034.9. ConclusionFigure 4.25: Left: To obtain a self-overlapping object, one “invisible edge” is necessary, to dene two faceswith dierent depth orders. Right: This ordering implies that the red edge is below the yellow face. Dependingon the geometry of the invisible edge, this situation often leads to artefacts in our implementation.graphics complexes neatly separate the geometry of vector graphics objects from their topology,making it easy to deform objects geometrically in interesting and intuitive ways; and to edit theirtopology with reversible and provably-correct operators. Components of objects can exist on dif-ferent layers, which allows for occlusion behaviors to be dened for individual object componentsrather than objects as a whole. Finally, the explicit representation of multiway joins can be lever-aged to improve rendering.104Chapter 5Vector Animation Complexes:The Topology of Vector AnimationsSpace-time visualization Time-slices visualizationtime space-timevisualizationtime-slicesvisualization 11numberkeyvertexkeyclosed edgekeyopen edgekeyfaceinbetweenvertexinbetweenclosed edgeinbetweenopen edgeinbetweenface3 10 2 10 3 9 1LegendFigure 5.1: A space-time continuous 2D animation depicting a rotating torus, created without 3D tools. First,the animator draws key cells (in blue) using 2D vector graphics tools. Then, he species how to interpolate themusing inbetween cells (in green). Our contribution is a novel data structure, called Vector Animation Complex(VAC), which enables such interaction paradigm.In this chapter, we introduce the Vector Animation Complex (VAC), a novel data structure for vec-tor graphics animation, designed to support the modeling of time-continuous topological events.This allows features of a connected drawing to merge, split, appear, or disappear at desired timesvia keyframes that introduce the desired topological change. Because the resulting space-timecomplex directly captures the time-varying topological structure, features are readily edited inboth space and time in a way that reects the intent of the drawing. A formal description ofthe data structure is provided, along with topological and geometric invariants. We illustrate ourmodeling paradigm with experimental results on various examples.5.1 IntroductionA fundamental dierence between raster graphics and vector graphics is that the former is a dis-crete representation, while the latter is a continuous representation. Instead of storing individualpixels that our eyes readily interpret as curves, vector graphics stores curves that can be ren-1055.2. Space-Time Topologydered at any resolution. As display devices spanning a wide range of resolutions proliferate, suchresolution-independent representations are increasing in importance.Similarly, a fundamental dierence between traditional hand-drawn 2D animation and 3D anima-tion is that the former is discrete in time, while the latter is continuous in time. Instead of storingindividual frames that our eyes interpret as motion, the use of animation curves allows a scene tobe rendered at any frame rate.Space-time continuous representations, i.e., representations that are resolution-independent bothin the spatial domain and the temporal domain, are ubiquitous within computer graphics for theirmany advantages. They are typically based on the “model-then-animate” paradigm: a parameter-ized model is rst developed and then animated over time using animation curves that interpolatekey values of the parameters at key times. A limitation of this paradigm is the underlying assump-tion that the model can be parameterized by a xed set of parameters that captures the desiredintent. This is indeed possible for 3D animation and simple 2D animation, but it quickly becomesimpractical in any 2D animation scenario where the number of strokes or how they intersectchange over time. In other words, the “model-then-animate” paradigm fails when the topologyof the model is time-dependent, which makes it challenging to represent space-time continuousanimated vector graphics illustrations with time-varying topology.In this chapter, we address this problem by introducing the Vector Animation Complex (VAC). Itis a cell complex immersed in space-time, specically tailored to meet the requirements of vec-tor graphics animation with non-xed topology. Any time-slice of the complex is a valid VectorGraphics Complex (VGC) which make its rendering consistent with non-animated VGCs.5.2 Space-Time TopologyIn this section, we provide an initial intuition behind the vector animation complex, which weformally dene in Section 5.3.1.5.2.1 Animating VerticesSuppose an animator wants to create a time-continuous animation of a single vertex v. This meansthat he needs to dene its position p(t) for every time t in the life-span of the vertex. The existingapproach (Fig. 5.2, Left) is to dene a sequence of keys [(t1, p1); (t2, p2); . . . ] which are interpolatedin time. To animate three vertices, the animator would dene three sequences of keys. Let us callthis paradigm sequential keyframing, since the representation is a set of sequences of keys: onesequence per animated vertex, or more generally, one per animated degree of freedom.1065.2. Space-Time TopologySequential keyframing Topological keyframingvaluetimevaluetime[(t1, p1); (t2, p2); (t3, p3); (t4, p4)][(t′1, p′1); (t′2, p′2)][(t′′1 , p′′1); (t′′2 , p′′2); (t′′3 , p′′3)]{v1 = (t1, p1), . . . , v7 = (t7, p7)}{v1 = (v1, v3), . . . ,v6 = (v2, v6)}v1v2v3v4v5v6v7Figure 5.2: Left: The existing keyframing paradigm, dening an animation as ordered sequences of keyvalues. Right: Our more general approach, where key values are unordered but labeled, and inbetween valuesspecify which one to interpolate.But what if the animator wants the number of vertices—or degrees of freedom—to change overtime, by splitting or merging? We can observe (Fig. 5.2, Right) that the space-time topology of suchanimation is not anymore disconnected sequences, but a more general graph. Therefore, sequentialkeyframing fails to represent such animation with time-varying topology, and we need a moregeneral approach to keyframing that we call topological keyframing. The animator rst denesa set of key vertices vi = (ti, pi), as in sequential keyframing except that they are not ordered insequences. Then, he denes a set of inbetween vertex vj = (vbefore, vafter) that reference to twokey vertices to interpolate.In theory, such paradigm can easily be applied to animate any kind of values, say, quaternions.However, in this chapter, we use it to animate the topology of vector graphics illustrations. Thisposes additional challenges due to the fact that such topology is already a graph-like structure inthe space dimension. Therefore, we have to represent incidence relationships both in the temporaldomain and the spatial domain, resulting in a space-time complex.5.2.2 Animating Stroke GraphsSuppose now that we want to animate a stroke graph [Whited et al. 2010], i.e. not only vertices butalso (open) edges, which are 2D curves starting at a start vertex and ending at an end vertex. Aneasy way to achieve this is to dene rst a stroke graph, then use sequential keyframing to animateindependently its degrees of freedom (e.g., position of the vertices and Bézier control points of theedges). Unfortunately, with this approach, it is impossible to represent animated stroke graphs1075.2. Space-Time Topologytimespaceedgegrowingfromvertexkeyframe edgebeingcutpartialkeyframesedgedisappearingedgebeingduplicatedFigure 5.3: Stroke graph animation with time-varying topology. Red dots are key vertices; (non-vertical) redcurves are inbetween vertices; (vertical) blue curves are key edges; and light blue areas are inbetween edges.Each annotation describes either a topological event introduced by key cells, or species that key cells are usedas conventional “keyframes” (trajectory control, no change in topology). Note: key edges are represented asstraight lines (because space is represented as 1D), but are in fact general 2D curves.with time-varying topology.Our solution (Fig. 5.3) is to represent such animation as a space-time complex made of key verticesand inbetween vertices (as dened previously), but also key edges and inbetween edges. A key(open) edge ei is dened by a time ti and a 2D curve φi(s), starting at a key vertex vstart =(ti, p1) and ending at a key vertex vend = (ti, p2). An inbetween (open) edge ej is dened byits temporal boundary and its spatial boundary (detailed in the next paragraph), from whichcan be computed a time-parameterized 2D curve Φ(s, t) (i.e., a surface in space-time) interpolatingthis boundary.vstartvendebeforee afterNaively (Fig. opposite), one might dene the temporal boundary as a pair(ebefore, eafter) that references to two key edges to interpolate, and the spatialboundary as a pair (vstart,vend) that references to two inbetween vertices wherethe time-parameterized curve Φ(s, t) should start and end (for t xed). Unfortu-nately, this naive denition would only enable to represent a very small subset of all possible topo-logical events that can happen to a stroke graph, and therefore we need a more general denition(Fig. 5.4, Left). Indeed, to represent an edge being cut in half by an appearing vertex (Fig. 5.3), or cutin more pieces by several vertices appearing simultaneously, we need the temporal boundary notto be two key edges, but two “sequences of connected key edges”, structure that we call path. Torepresent an edge growing from a vertex, we need to allow paths to be reduced to a key vertex. Fi-nally, to allow partial keyframing (e.g., adding a key to an inbetween edge without adding a keyto every incident edge, and recursively to every connected edge), we need the spatial boundary notto be two inbetween vertices, but two “sequences of connected inbetween vertices”, structure that1085.2. Space-Time Topologybeforestart animated vertexend animated vertexInbetween open edge Inbetween closed edgepathafterpathbeforecycleaftercycleFigure 5.4: Topology of inbetween edges. Note: a path or cycle can also consist of a single key vertex (but ananimated vertex cannot). A cycle can also consist of a single closed edge, possibly repeated.we call animated vertex (it is a chain key—inbetween—key—· · ·—key—inbetween—key, whichcan be interpreted as a vertex animated using conventional keyframing).5.2.3 Animating Vector Graphics ComplexesWe extend these ideas further to represent an animated vector graphics complex (see Chapter 4)with time-varying topology. The same way that the VGC extends stroke graphs with closed edgesand faces, the VAC extends the representation introduced in the previous section with key closededges, inbetween closed edges, key faces, and inbetween faces.A key closed edge ei is dened by a time ti and a 2D closed curve φi(s) (note that is does not havebounding vertices). An inbetween closed edge ej is dened by its temporal boundary, made oftwo cycles (Fig. 5.4, Right), from which can be computed a time-parameterized 2D closed curveΦ(s, t) interpolating this boundary. Note that unlike inbetween open edges, inbetween closededges have an empty spatial boundary, since closed edges do not have bounding vertices. To allowall sorts of topological events, cycles can either be reduced to a single key vertex, or made of asingle (possibly repeated) key closed edge, or made of connected key open edges (equivalently tothe concept of cycle introduced in Chapter 4).A key face fi is dened by a time ti and a sequence of cycles, all sharing the same time ti. Given awinding rule (e.g., even-odd or non-zero), these cycles dene a 2D region of the time-plane t = ti.An inbetween face fj is dened by its temporal boundary and its spatial boundary. Its temporalboundary is dened by two sequences of faces, the before faces and the after faces. Its spatialboundary is dened by a sequence of animated cycles, structure that we introduce informally inthe next three paragraphs.1095.2. Space-Time Topologye1, β1nextpreviousafter beforee2, β2e3, β3 e4, β4e1 e2e3 e4timetcurve parameter scell geometry and animated cycle •γincidence relationshipe1, β1 e2, β2e3, β3 e4, β4(naive data structure)animated cycle •γ(actual data structure)Figure 5.5: Top: Intuitively, an animated cycle •γ is a two-dimensional doubly linked list where every nodeholds a reference to an inbetween edge e and a direction β. The structure is circular in the space dimension, andnon-circular in the time dimension. Unfortunately, this naive structure is not expressive enough to capture allpossible scenarios. Bottom: The actual data structure includes additional nodes to explicitly hold a reference toshared vertices, key edges, and inbetween vertices.1105.2. Space-Time TopologyAnimated cycle We have seen that an animated vertex is a combinatorial structure that storesreferences to existing inbetween vertices, which dene a time-parameterized position p(t). Sim-ilarly, our goal is now to dene a time-parameterized closed curve Φ(s, t), via a combinatorialstructure storing references to existing cells (a “cylinder in space-time”, cf. Fig. 5.5, Top-left).A simple option would be to dene this boundary as a set {c1, . . . , cn} of references to cells.However, for the same reasons that this approach is not sucient to dene the boundary of keyfaces (see paragraph Non-Suciency of the Incidence Graph from Section 4.3.3), it is not sucienteither to dene the boundary of inbetween faces. More specically, because overlapping of cellsis allowed (i.e., the complex is only immersed in space-time, as opposed to embedded), then the setof boundary cells does not contain enough information to unambiguously dene the geometry ofthe face. Instead, it is necessary to organize this set using an ordered structure, possibly referringto the same cell multiple times. This additional information explicitly denes a parameterizationof the boundary. For key faces, this is achieved via the structure called cycle. For inbetween faces,this is achieved via the structure called animated cycle.Intuitively (Fig. 5.5, Top-right), a naive structure to dene such parameterization would be a two-dimensional doubly linked list of directed inbetween edges, where the rst dimension correspondsto the curve parameter s, and the second dimension correspond to the time t. This structureis circular in the s-dimension, but non-circular in the t-dimension. Like a doubly linked list, itis composed of nodes which store: 1) per-node data; and 2) references to adjacent nodes. Butunlike a doubly linked list, each node stores four references instead of two: previous and next tonavigate in the s-dimension; and before and aer to navigate in the t-dimension. The node dataitself is a reference to an inbetween edge e, and a boolean β that orients e with respect to curveparameterization.Unfortunately, this naive structure cannot handle inbetween edges bounded by more than twokey edges, more than two inbetween vertices, or that shrink to a key vertex, and thus cannotrepresent general time-parameterized cycles (e.g., Fig. 5.6, Left). Our solution is to include all thelower dimensional cells shared between inbetween edges as explicit nodes of the structure (Fig. 5.5,Bottom; Fig. 5.6, Right). It introduces a little redundancy to the structure, but makes it signicantlymore expressive.1115.3. Formal Denition5.3 Formal Definition5.3.1 Vector Animation ComplexA vector animation complex K is dened as a tupleK = (C, dimT ,dimS , . . . ) (5.1)where C is a nite set of abstract symbols called cells (think of them as identiers, or addresses),and dimT ,dimS , . . . are functions dened on C or a subset of C , assigning to relevant cells someaributes, that have to satisfy some invariants. These numerous attributes and invariants aredetailed in the remainder of this section. In our C++ implementation, an element c ∈ C is apointer to an object inheriting the class Cell, and an attribute α(c) is typically a data memberc->m_alpha.Cell attributes can be classied in two types: topological aributes, which are combinatorial ob-jects dening incidence relationship between cells; and geometrical aributes, which are con-tinuous objects immersing the cells in space-time. The two most important attributes of any cellc ∈ C are topological:• its temporal dimension dimT (c) ∈ {0, 1}• its spatial dimension dimS(c) ∈ {0, 1, 2}Cells of temporal dimension 0 are called key cells, and cells of temporal dimension 1 are calledinbetween cells. Orthogonally, cells of spatial dimension 0 are called vertices, cells of spatial di-mension 1 are called edges, and cells of spatial dimension 2 are called faces. In addition, each edgee is assigned the topological attribute isClosed(e) ∈ {>,⊥}, where > means true and ⊥ meansfalse. Therefore, all cells can be partitionned into eight nite sets which dene their type:dimT dimS isClosed Type Notation0 0 n/a key vertex v ∈ V0 1 true key closed edge e ∈ E◦0 1 false key open edge e ∈ E|0 2 n/a key face f ∈ F1 0 n/a inbetween vertex v ∈ V1 1 true inbetween closed edge e ∈ E◦1 1 false inbetween open edge e ∈ E|1 2 n/a inbetween face f ∈ F1125.3. Formal DenitionFor convenience, we dene E = E| ∪ E◦ and E = E| ∪ E◦. From Section 5.3.2 to Section 5.3.9,we dene all the remaining attributes and invariants for each type of cells. For clarity, some ofthese attributes are expressed using auxiliary/helper structures (halfedges, paths, cycles, animatedvertices, and animated cycles), which are dened from Section 5.3.10 to Section 5.3.14.5.3.2 Key VertexA key vertex v ∈ V represents a single point in space-time:topological attributes: ∅geometrical attributes: position p(v) ∈ R2time t(v) ∈ Rinvariants: ∅5.3.3 Key Closed EdgeA key closed edge e ∈ E◦ represents a closed curve contained in a time-plane:topological attributes: ∅geometrical attributes: curve φ(e) : s ∈ [0, 1]→ R2time t(e) ∈ Rinvariants: φ(e) continuousφ(e)(0) = φ(e)(1)5.3.4 Key Open EdgeA key open edge e ∈ E| represents an open curve contained in a time-plane, starting and endingat two key vertices (possibly equal):topological attributes: start vertex vstart(e) ∈ Vend vertex vend(e) ∈ Vgeometrical attributes: curve φ(e) : s ∈ [0, 1]→ R2time t(e) ∈ Rinvariants: φ(e) continuousφ(e)(0) = p(vstart(e))φ(e)(1) = p(vend(e))t(vstart(e)) = t(e) = t(vend(e))1135.3. Formal Denition5.3.5 Key FaceA key face f ∈ E represents a region of a time-plane delimited by closed curves (possibly self-intersecting, including going back and forth the same path or being reduced to a single point):topological attributes: cycles ∀i ∈ [1..k(f)], γi(f) ∈ Γwhere k(f) ≥ 0geometrical attributes: winding rule R(f) ⊆ Ntime t(f) ∈ Rinvariants: ∀i ∈ [1..k(f)], t(f) = t(γi(f))5.3.6 Inbetween VertexAn inbetween vertex v ∈ V represents an interpolation in time between two key vertices:topological attributes: before vertex vbefore(v) ∈ Vaer vertex vafter(v) ∈ Vgeometrical attributes: animated position p(v) : t ∈ [t1, t2]→ R2where t1 = t(vbefore(v))t2 = t(vafter(v))invariants: t1 < t2p(v) continuousp(v)(t1) = p(vbefore(v))p(v)(t2) = p(vafter(v))5.3.7 Inbetween Closed EdgeAn inbetween closed edge e ∈ E◦ represents an interpolation in time between two cycles:topological attributes: before cycle γbefore(e) ∈ Γaer cycle γafter(e) ∈ Γgeometrical attributes: animated curve Φ(e) : (s, t) ∈ [0, 1]× [t1, t2]→ R2where t1 = t(γbefore(e))t2 = t(γafter(e))1145.3. Formal Denitioninvariants: t1 < t2Φ(e) continuous∀t ∈ [t1, t2],Φ(e)(0, t) = Φ(e)(1, t)∀s ∈ [0, 1],Φ(e)(s, t1) = φ(γbefore(e))(s)∀s ∈ [0, 1],Φ(e)(s, t2) = φ(γafter(e))(s)5.3.8 Inbetween Open EdgeAn inbetween open edge e ∈ E| represents an interpolation in time between two paths, spatiallybounded by two animated vertices:topological attributes: before path pibefore(e) ∈ Πaer path piafter(e) ∈ Πstart animated vertex •vstart(e) ∈•Vend animated vertex •vend(e) ∈•Vgeometrical attributes: animated curve Φ(e) : (s, t) ∈ [0, 1]× [t1, t2]→ R2where t1 = t(pibefore(e))t2 = t(piafter(e))invariants: vstart(pibefore(e)) = vbefore(•vstart(e))vend(pibefore(e)) = vbefore(•vend(e))vstart(piafter(e)) = vafter(•vstart(e))vend(piafter(e)) = vafter(•vend(e))t1 < t2Φ(e) continuous∀t ∈ [t1, t2],Φ(e)(0, t) = p(•vstart(e))(t)∀t ∈ [t1, t2],Φ(e)(1, t) = p(•vend(e))(t)∀s ∈ [0, 1],Φ(e)(s, t1) = φ(pibefore(e))(s)∀s ∈ [0, 1],Φ(e)(s, t2) = φ(piafter(e))(s)5.3.9 Inbetween FaceAn inbetween face f ∈ F represents an interpolation in time between key faces, spatially boundedby animated cycles:1155.3. Formal Denitiontopological attributes: before time tbefore(f) ∈ Rbefore faces ∀i ∈ [1..kb(f)], fbefore,i(f) ∈ Fwhere kb(f) ≥ 0aer time tafter(f) ∈ Raer faces ∀i ∈ [1..ka(f)], fafter,i(f) ∈ Fwhere ka(f) ≥ 0animated cycles ∀i ∈ [1..k(f)], •γi(f) ∈•Γwhere k(f) ≥ 0geometrical attributes: winding rule R(f) ⊆ Ninvariants: ∀i ∈ [1..kb(f)], tbefore(f) = t(fbefore,i(f))∀i ∈ [1..ka(f)], tafter(f) = t(fafter,i(f))∀i ∈ [1..k(f)], tbefore(f) = tbefore( •γi(f))∀i ∈ [1..k(f)], tafter(f) = tafter( •γi(f))5.3.10 HalfedgeA halfedge is a pair h = (e, β) ∈ E × {>,⊥}. If e is closed then it is a closed halfedge denotedh ∈ H◦, otherwise it is an open halfedge denoted h ∈ H|. If β = >, we dene φ(h)(s) = φ(e)(s),otherwise we dene φ(h)(s) = φ(e)(1− s). If h is open then we dene vstart(h) = vstart(e) andvend(h) = vend(e) (when β = >), or vstart(h) = vend(e) and vend(h) = vstart(e) (when β = ⊥).Finally, we dene t(h) = t(e).5.3.11 PathA path pi is either:1. a key vertex v ∈ V , or2. a list of N > 0 open halfedges h1, .., hN ∈ H| satisfying:∀j ∈ [1..N − 1], vend(hj) = vstart(hj+1) (5.2)In the rst case, we dene vstart(pi) = vend(pi) = v, otherwise we dene vstart(pi) = vstart(h1)and vend(pi) = vend(hN ). Also, we dene the curve φ(pi) : s ∈ [0, 1] → R2 by concatenatingand uniformly reparameterizing the φ(hj). In the special case pi = v, then φ(pi) is the constant1165.3. Formal Denitionfunction Φ(pi)(s) = p(v). Finally, we dene t(pi) = t(v) (Case 1.), or t(pi) = t(h1) (Case 2.). Wedenote by Π the set of all possible paths on K.5.3.12 CycleA cycle γ is either:1. a key vertex v ∈ V , or2. a closed halfedge h ∈ H◦ repeated N > 0 times, or3. a circular list of N > 0 open halfedges hj ∈ H| satisfying:∀j ∈ [1..N ], vend(hj) = vstart(hj+1) (5.3)In addition, a cycle stores a starting point s0 ∈ R. We dene the closed curve φ(γ) : s ∈[0, 1] → R2 by concatenating and uniformly reparameterizing the φ(hj), then osetting by s0.In the special case γ = v, then φ(γ) is the constant function Φ(γ)(s) = p(v). Finally, we denet(γ) = t(v) (Case 1.), or t(γ) = t(h) (Case 2.), or t(γ) = t(h1) (Case 3.). We denote by Γ the setof all possible cycles on K.5.3.13 Animated VertexAn animated vertex •v is a list of N > 0 inbetween vertices v1, ..,vN ∈ V satisfying:∀j ∈ [1..N − 1], vafter(vj) = vbefore(vj+1) (5.4)We dene vbefore(•v) = vbefore(v1) and vafter(•v) = vafter(vN ). Also, we dene the time-parameterizedposition p(•v) : t ∈ [t(vbefore(•v)), t(vafter(•v))] → R2 by concatenating the p(vj). We denote by•V the set of all possible animated vertices on K.5.3.14 Animated CycleAn animated cycle (cf. Fig. 5.6) is a tuple•γ = (N, c, β, nprevious, nnext, nbefore, nafter) (5.5)where N is a non-empty set of symbols called nodes, and:1175.3. Formal Denitiontimev1 v2v3v4 v5 v6v7 v8v9v10v11 v12e1 e2e3e4e5 e6e7e8e9v1v2v3v4 v5 v6v7v8 v9e1e2e3 e4e5e6e7 e8v2v3v3v5v5v8e5,β5e7, β7v9v7v10v8v1v4v4v7e1,β1v6e3,β3 e4,β4e2,β2v6e3, β3 e4, β4e5, β5 e6, β6e6,β6v9e7,β7 e8,β8Figure 5.6: A general example of an animated cycle •γ. Left: Geometry and topology of the cells c ∈ C(K)involved in•γ. It is a sub-complex of the whole VAC. Right: The nodes n ∈ N(•γ) dening •γ. Each node nreferences to a cell c, species a direction β (ignored if c is a vertex), and points to a previous, next, before, andafter node. The shape/color of the node indicates the type of the referenced cell:keyvertexkeyclosed edgekeyopen edgeinbetweenvertexinbetweenclosed edgeinbetweenopen edgeThis example illustrates a variety of topological transformations over time for the cycle, including local keyfram-ing using a key vertex (v3), local keyframing using key edges (e3, e4), keyframing using a closed edge (e7),contraction of an open edge to a vertex (e3 → v8), contraction of a closed edge to a vertex (e7 → v9), cuttingan open edge into two open edges (e2 → e3, e4), among others.1185.3. Formal Denitionc : N → V ∪V ∪ E ∪E assigns a cell to every nodeβ : N → {>,⊥} assigns a direction (ignored if c(n) ∈ V ∪V)nprevious : N → N assigns a previous nodennext : N → N assigns a next nodenbefore : N → N ∪ {null} assigns an optional before nodenafter : N → N ∪ {null} assigns an optional aer nodeIn addition, an animated cycle stores a starting node n0 ∈ N . We dene the timespan of anode n as being the trivial interval T (n) = {t(c(n))} if c(n) is a key cell, or the open intervalT (n) = (tbefore(c(n)), tafter(c(n))) if c(n) is an inbetween cell. Despite having a single nextpointer, one can notice (Fig. 5.6) that when c(n) is an inbetween open edge, then n may haveseveral nodes “next to it”, which are stacked in time. The next (resp. previous) pointer points to the“rst” of these, and the others can be accessed by iterating after (resp. before). To easily traversethe data-structure at t xed, we dene the two functions nnext(n, t) and nprevious(n, t) that returnthe two nodes “spatially adjacent to n at time t”.nprevious (n ∈ N , t ∈ R)Require: t ∈ T (n)1 n′ ← nprevious(n)2 while t 6∈ T (n′) do3 n′ ← nbefore(n′)4 return n′nnext (n ∈ N , t ∈ R)Require: t ∈ T (n)1 n′ ← nnext(n)2 while t 6∈ T (n′) do3 n′ ← nafter(n′)4 return n′We dene the time-parameterized closed curve Φ( •γ)(s, t) by nding a node n such that t ∈ T (n)(iterating before/after from n0), then concatenating the φ(c(n)) while iterating nnext(n, t) (fol-lowed by a normalization into [0, 1]). We denote by•Γ the set of all valid animated cycle on K,which are the ones whose attributes satisfy the following invariants.Connectedness Any node n2 can be reached from any node n1 with a nite sequence of next,previous, after, or before.Node-cell consistency Informally: “adjacency between nodes must be consistent with inci-dence relationship between assigned cells”. For instance, if c(n) is an open key edge and β(n) = >,then we must have:c(nprevious(n)) = vstart(c(n)) and c(nnext(n)) = vend(c(n)) (5.6)1195.3. Formal Denitionvvbefore(v)vafter(v)v v vh = (e, β)•vend (h)piafter(e)pibefore(e)•vstart (h)e, β e, βepibefore(e)reduced to a single vertexeepiafter(e)reduced to a single vertexe ek ≥ 1 nodes ni with c(ni) = c(nj) and β(ni) = β(nj)γafter(e) γafter(e)e, β e, βe, β e, βγbefore(e) γbefore(e)starting point of cycle is inside an open key edgee, β e, βe, β e, βe, β e, βe, β e, βcycle is a repeated closed key edgestarting point of cycle is a key vertexe, β e, βe, β e, βe, β e, βe, β e, βcycle is a unique vertexe, βFigure 5.7: Node-cell consistency invariants expressed as a set of allowed congurations.1205.3. Formal Denition(a) (b)Figure 5.8: Two examples of doubly linked lists which violate the invariantnnext(nprevious(n)) = n, thereforeare invalid.The exhaustive list of all constraints would be very hard to read if expressed algebraically, asabove, despite being intuitive to understand visually. Therefore, for clarity, we express them all inFigure 5.7 as a set of allowed congurations, using diagrams. For instance, the above two constraintscan be expressed as13:hvstart(h) vend(h)In these diagrams, space is represented horizontally and time vertically. Every colored shape rep-resents a node n ∈ N , and its shape and color represents the type of c(n), cf. legend of Figure 5.6.Annotations near or inside the shape indicate the value of c(n) and β(n), sometimes using a“halfedge notation” for conciseness. Left (resp. right, up, and down) arrows indicate the value ofnprevious(n) (resp. nnext(n), nbefore(n), and nafter(n)). An unspecied annotation/arrow in a dia-gram indicates that its value is not constrained by this diagram, but the value must still be allowedby at least one of the other diagrams.Back-pointers consistency For all nodes n ∈ N , there exist k1, k2, k3, k4 ∈ N such that:nk1after( nnext(nprevious(n)) ) = nnk2before( nprevious(nnext(n)) ) = nnk3next( nafter(nbefore(n)) ) = nnk4previous( nbefore(nafter(n)) ) = n(5.7)where exponents represent the k-th iterate of the function. In addition, for all nodes n ∈ N , andfor all t ∈ T (n): {nprevious(nnext(n, t), t) = nnnext(nprevious(n, t), t) = n(5.8)13However, we note that this specic diagram does not appear in Figure 5.7 because it is redundant with otherdiagrams.1215.4. Interpolation SchemetimeFigure 5.9: Example of an invalid animated cycle: it doesn’t satisfy the cycle uniqueness invariant.These invariants play the same role as the simpler invariant nnext(nprevious(n)) = n that must besatised by conventional doubly linked lists. It ensures that back pointers serve there purpose (i.e.point back to the original node), and prevents invalid congurations such as those illustrated inFigure 5.8.Cycle uniqueness For all pairs of nodes n1, n2 ∈ N , if there exists a time t such that t ∈ T (n1)and t ∈ T (n2), then there exists k ∈ N such that:nknext(n1, t) = n2 (5.9)This invariant makes sure that a scenario such as in Figure 5.9 is not allowed, i.e. that any time-sliceof the animated cycle is one and only one cycle.Temporal boundary structure There exist a unique time t1 and a unique time t2, such that foreach node n ∈ N : {nbefore(n) = null ⇒ tbefore(c(n)) = t1nafter(n) = null ⇒ tafter(c(n)) = t2(5.10)We denote these two times tbefore(•γ) and tafter(•γ).5.4 Interpolation SchemeThe geometry of inbetween cells may be provided explicitly (or in non-photorealistic rendering ap-plications, computed from an animated 3D model), but in our case, it is computed by interpolatingthe geometry of key cells, as expected from a keyframing system.First, for each key vertex vi, we dene a tangent q(vi) as the average of the slopes p(vj)−p(vi)t(vj)−t(vi) , forall key vertices vj connected to vi by an inbetween vertex (Fig. 5.10b). Then, we dene the geom-1225.5. User Interface(a) (b) (d) (e)(c)Figure 5.10: Interpolation scheme (time = horizontal axis). (a) Input: geometry of key cells and space-timetopology. (b) Compute tangents at key vertices. (c) Compute geometry of inbetween vertices, satisfying tangents.(d) For each inbetween edge, compute linear interpolation of bounding paths/cycles. (e) Output: warp to satisfyspatial boundary conditions.etry of each inbetween vertex as the unique cubic curve interpolating the positions p(vbefore) andp(vafter) with the desired tangents q(vbefore) and q(vafter) (Fig. 5.10c). All that is left to do is de-ne the geometry of every inbetween open (resp. closed) edge, by interpolating its two boundingpaths (resp. cycles). We recall from Section 5.3.1 that paths/cycles have an explicit parameter-ization [0, 1] → R2, obtained by concatenating and uniformly reparameterizing the key edges’parameterizations (the starting point of cycles is a user-controllable variable). First, we compute alinear interpolation between these two explicit parameterizations (Fig. 5.10d). Finally, in the caseof inbetween open edges, for all t ∈ (t1, t2), we linearly warp this interpolation Φ(s, t) such thatΦ(0, t) and Φ(1, t) coincidate with the start and end animated vertices at t (Fig. 5.10e). There is noneed to dene an interpolation scheme for inbetween faces, since their geometry is entirely spec-ied by the geometry of their boundary. Indeed, for all t ∈ (t1, t2), a closed parameterized curve[0, 1] → R2 can be extracted from each animated cycle, which, together with the user-speciedwinding rule (e.g., even-odd), dene an area of the 2D plane.This interpolation scheme is robust and general but limited as it only guarantees C0 continuity.More aesthetically pleasing interpolation can be achieved using logarithmic spirals [Whited et al.2010] or Coons patches. This is left for future work.5.5 User InterfaceTo create and manipulate VACs, we implemented various visualizations and topological operators,which we present in this section. We refer to the video accompanying [Dalstein et al. 2015] for ademonstration of these tools.2D view We provide a 2D view to render a specic frame of the animation (i.e., a time-slice ofthe VAC), which can be selected using a timeline similar to any animation system. The 2D viewcan be split into multiple 2D views to visualize simultaneously dierent frames of the animation.The user can also toggle “onion skinning” to overlay several frames within a single 2D view, or1235.5. User Interfacerender the animation as an animation strip (Fig.5.1, bottom). The frames can be rendered either in“normal” mode (showing the actual result), or in “topology” mode (using a color code to informwhether a cell is a key cell, or a time-slice of an inbetween cell).3D view We also provide a 3D view to visualize the VAC in space-time. However, we mostlyuse this view as a debugging tool, as it becomes quickly impractical when the number of cellsgrow. All interaction happens in the 2D views, and all examples presented in this chapter havebeen created without using the 3D view at all. At this stage, it is unclear whether it is relevant toexpose such visualization to end users.Creating key cells Key cells are created in the 2D view using standard VGC tools. They areassigned the time ti selected in the timeline.Motion-pasting The easiest way to create inbetween cells is to select key cells at time t1, triggerthe copy action, then move to time t2 and trigger the motion-paste action. It creates a copy ofthe key cells, assigns them the time t2, and creates inbetween cells that connect in time the oldkey cells to the new ones. In other words, it corresponds to sweeping key cells in time. Oncemotion-pasted, the new cells can be edited to create the desired motion. Standard VGC topologicaloperators (extended to support incident inbetween cells) can also be used on the new key cells,which introduce topological events as a result.Inbetweening Another way to create inbetween cells is to select existing key cells at two dif-ferent times t1 and t2 (e.g., using side-by-side 2D views), then trigger the inbetweening action. Itcreates inbetween cells that connect in time the selected key cells. Currently, it works to createan inbetween vertex out of two key vertices; an inbetween edge out of two key edges; an inbe-tween edge out of more than two key edges that can be organized into two paths or two cycles;or an inbetween edge that grows or shrinks to a vertex. This tool does not yet support the cre-ation of inbetween faces (we can still create them using motion-pasting or manually specifyingtheir boundary), neither the simultaneous creation of multiple inbetween edges, which are bothinteresting challenges left as future work.Inserting keys A fundamental topological operator on VACs is to cut an inbetween cell in half,in the time dimension, by inserting a new key cell. It is the equivalent of inserting a keyframe inconventional keyframing animation. Similarly to the “auto-key” feature of most animation sys-tems, we automatically call this operator whenever the user performs an action on (the renderedtime-slice of) an inbetween cell. For instance, attempting to move an inbetween vertex automati-cally inserts a key vertex at the time ti selected in the timeline, and the new key vertex is the cellactually moved. Note that this insert key tool is local in space (in addition to be obviously local in1245.6. Resultstime): it cuts the selected inbetween cell and its spatial boundary, but does not propagate to anyother cell. This allows for local trajectory or topology renement possible, without keyframingthe whole drawing.Drag-and-drop Selected key cells can be drag-and-dropped in space (using the 2D view), butalso in time (using the timeline), within a time interval determined by its incident inbetween cells.This allows to easily rene the timing of a motion.Depth-ordering We store a global ordering for all the cells in a complex using a doubly-linkedlist, and render the cells back-to-front using this ordering. As with VGCs, we provide tools toconveniently alter this ordering.5.6 ResultsWe create several illustrative examples of vector graphics animations that involve topologicalchanges over time. We briey summarize them below, although they are best seen in the videoaccompanying [Dalstein et al. 2015].Torus The torus (Fig. 5.1) is an example use of the VAC to create a clean conceptual animatedvector graphics illustration. It is dened using a total of ve keyframes (frames that contain at leastone key cell). As always required, the clip begins and ends with full keyframes (frames containingkey cells only), which specify the shape of all the drawing elements that exist at those key times.The second keyframe captures the motion of the interior silhouette, marks the initial appearanceof the hole with a single vertex, and also keyframes the shape of the outside silhouette. Thethird keyframe properly introduces the now-visible hole, while the fourth keyframe then endsthe growth of the hole by merging the end vertices of the two lines. As seen in this example,keyframes are used either to introduce a change in shape, to introduce a change in topology,or both. Keyframes are typically local, i.e., key cells are only inserted where needed, withoutkeyframing the entire drawing.Double torus Once we have the VAC for the single torus, the animation of a double torus(Fig. 5.11) is easy to create. Indeed, all that is needed is: 1) deforming the outside silhouette, 2)copy-pasting to a dierent space-time location the sub-complex representing the animation of thehole, and 3) gluing the rst key edge of this sub-complex to the deformed silhouette. We believethat this type of template-based construction provides a practical way of simplifying the creationof VACs. Figure 5.11 shows a vector graphics animation of a simple torus which is morphed toa double torus, with the two halves rotating asynchronously. Creating such animation would be1255.6. ResultsFigure 5.11: Double Torus.A B C D C D C D E F G H G H G H I JFigure 5.12: Animated ribbon decomposed into 6 key faces (A,B,E,F,I,J) and 4 inbetween faces (C,D,G,H), inorder to depict local depth-ordering both in space and time.hard using conventional vector graphics tools, but would be equally hard in 3D, since the genusof the depicted surface changes, requiring a topological event in 3D as well.Animated ribbon In a given VAC, any cell is either completely in front, or completely behind,any other cell. However, any cell can be easily split spatially (cutting) or temporally (keyframing)into dierent cells, and the cells of this new cell-decomposition are assigned their own indepen-dent depth orders. This makes possible to depict local depth-ordering, both in space and time, asillustrated in Figure 5.12. Using motion-pasting and basic editing, the space-time topology andgeometry of this animation can be created within a few seconds. Then, the user alters the depth-ordering to ensure A < B, C < D, G > H , and I > J , using the “raise” and “lower” actions, aswith standard VGCs. Note that this example does not contain topological events: keyframes areonly used to introduce a change in geometry, as well as a change in depth-ordering.Flapping bird We demonstrate Figure 5.13 the use of animated faces with depth layering increating an example of a bird with a apping wing, as inspired by a hand-drawn animation [Blair1994, p. 122]. This example is created using 7 keyframes, all of which are local except the ones atthe start and end. A looping animation is easily created by copy-and-pasting a second copy of the1265.6. ResultsFigure 5.13: Bird animation. Space-time view (top); output animation (middle); VGC lm strip (bottom).1275.7. DiscussionFigure 5.14: Turning head animation. Output animation (top); VGC lm strip (bottom).full VAC so that it sits immediately after the rst copy. The ending elements of the rst animationare then topologically glued to the starting elements of the second animation.Head turning We use a drawn animation sequence by James Lopez (used with permission) asinspiration for a more complex example, shown in Figure 5.14. This involves many drawn elementsand a signicant number of topological changes, particularly involving the ear, goggles, eye, andmouth. Many topological changes need not be modeled in great detail. The eye is a good example:the features of the eye are simply spawned from an initial vertex that is introduced on the silhouetteof the face. For this example, the 3D space-time view is largely unusable because of its complexity,and thus it proved to be a good test case for the capabilities of our user interface.5.7 DiscussionCreation Many aspects of working with the VAC are no dierent than that of creating a con-ventional keyframe animation. Animation workows are often classied as being straight aheador pose-to-pose, and these working styles can each be reproduced using the VAC. A straight aheadworkow is readily reproduced using motion-pasting to create a new keyframe, followed by edit-ing as necessary. A pose-to-pose workow can be modeled by creating independent keyframes,followed by the creation of inbetween cells interpolating the key cells. For other potential appli-cations, such as the vectorization of existing animations or video clips, we expect that the creationof the VAC may be automated.1285.7. DiscussionEditing Creating the space-time topology of a complex animation may take more time than viatraditional animation but once created, the VAC oers signicant benets as it provides a compactrepresentation that is continuous in space and time. The VAC can be easily edited in ways that arenot possible with traditional 2D or 3D animation pipelines. The VAC also provides a compact andconvenient representation for algorithms to operate on. For example, we envision algorithms thatcan produce rich variations of an existing animated drawing by adding stochastic perturbationsin space and time to some of the key elements.Local keyframing Conventional keyframing animation allows for independent keyframing ofthe animation variables, i.e., the keyframe times for an animated knee-joint motion can be dier-ent from the keyframe times for the animated ankle motion within the same animation. Similarly,the VAC allows for the asynchronous specication of keyframes for portions of the vector graph-ics complex. Local keyframes provide better support for the semantics of many vector graph-ics drawings by allowing dierent portions of a drawing to be governed by dierent keyframes.It also allows for many topological changes to be conveniently modeled using instantiated tem-plates.Repurposing of existing 3D complexes It is tempting to believe that modeling an animated2D complex could be achieved using existing approaches for 3D topological modeling, where thez-coordinate simply plays the role of time. Unfortunately, this does not reect the unique seman-tics of the time axis, and this manifests itself in several ways. An “out of plane” rotation of a vectorgraphics animation does not usually produce a valid animation because the space is not Euclidean.For similar reasons, others have proposed representing image spaces as a non-Euclidean, Cayley-Klein geometry with one isotropic dimension [Koenderink and Doorn 2002]. Without a special des-ignation for time, specic strategies would be needed to model the changing depth-orderings thatcan be desired during the course of a vector graphics animation, and which, by contrast, are easilymodeled using the VAC. More importantly, cells would not always admit a time-parameterization.By contrast, all cells in our complex have an explicit time-parameterization, by design. This makesextracting time-slices trivial and also guarantees that all topological events are constrained to oc-cur at key cells. This would not be the case if our cells were allowed to do “switch-backs” in time.In addition, despite being both 1D in space-time, the distinction we make between key edges andinbetween vertices is critical since their intersection with a time-plane is an object of dierentdimension. They must thus be rendered dierently and store dierent attributes. The same istrue for key faces and inbetween edges. Also, we allow zero-length edges but not zero-durationinbetween cells, i.e., we enforce t1 < t2. Similarly, paths are allowed to be reduced to a single keyvertex, while animated vertices are not.Using a simplicial complex representation for vector graphics animation [Southern 2008] would1295.7. Discussionnecessitate the use of many cells, which could then be problematic for creation, editing, and visu-alization, as well as being further removed from the standard keyframing paradigm for animation.Given a simplicial complex that completely reects the geometry of an VAC, the VAC can be seenas inducing a partition of the simplicial complex, resulting in an output semantics similar to [Buch-holz et al. 2011]. In general, geometric complexes allow for models and operations that we wishto forbid in order to reect the unique nature of the time dimension. Implementing the desiredconstraints necessitates additional complexity while the VAC implements the desired constraintsby design, i.e., as part of its desiderata. Also, we note that the intersection of a 3D simplicial com-plex with a time-plane is not necessarily a 2D simplicial complex (as the intersection between atetrahedron and a plane can be a four-sided polygon). By contrast, the intersection of a VAC witha time-plane is guaranteed by design to be a VGC, which is trivial to compute due to the explicittime-parameterization.Limitations While there are many benets to a structure that provides a sound, continuous-time model of the topological events in vector graphics animations, it also comes with additionalcomplexity. In particular, the modeling and editing of animated cycles, as required in order to ani-mate faces in the vector graphics complex, embodies much of the complexity of the data structureand its implementation. The space-time topology is also likely to introduce a steep learning curvefor artists coming from the world of SVG models where changes in topology are approximated byother means. We currently leave the development of an improved user interface as future work,and as such we have not conducted a formal user study with regard to how end users can best workwith the VAC. We believe that the use of topological-event templates may signicantly simplifythe workow for modeling and editing. Finally, our system shares the same fundamental limita-tion of any 2D animation system: the loss of information between the depicted 3D world and the2D depiction [Catmull 1978]. In other words, the semantics of a rotating 3D object will always bebetter captured by 3D representations. We believe that the automatic computation of a VAC froman animated 3D model would alleviate this issue.Future work The VAC opens up a number of exciting avenues for future work. Computing aes-thetically pleasing interpolation between key cells is a rich and interesting problem. In conven-tional animation systems, animation curves are dened for any animation variable by keyframesthat always have well-dened before and after keyframes. This allows for well-dened tangentvectors to be specied or inferred at keyframes (e.g., Catmull-Rom). However, the topologicalevents allowed by the VAC means that a key cell can have multiple before and after key cells, e.g.,two or more vertices that join or split at a given time t, or an entire edge or face that merges orspawns from a given vertex. Developing sound and practical methods for position interpolationor user-based tangency specication is signicantly more complex as a result.1305.8. ConclusionFuture work is needed to provide high-level manipulation of the VAC. For instance, a space-timepaint bucket tool would be useful for creating inbetween faces. The automatic computation ofinbetween cells from a general selection of key cells (i.e., automatic inbetweening) is a largelyopen problem, and extending [Whited et al. 2010] to the VAC is an exciting direction to explore.Also, we have developed a number of visualization tools in support of end user understanding, butmuch more is possible.The topological structures could be further extended to allow the creation of motion graphs (equiv-alently, “move trees”), as is commonly done within game engines for character animation. Thiswould require the ability to follow a given time-indexed “branch” of the VAC, and to rejoin existingbranches. The ability to do this with local parts of a VGC would provide even further exibility,although the resulting complexity might be dicult to develop and debug. One could also imaginecreating additional continuous dimensions, such as that created by an aspect graph, i.e., creatinga model that is parameterized with respect to the viewing direction as well as time.An interesting direction is to develop VACs directly from video or rendering of a 3D model. VACscould be used to achieve continuous space-time tracking, as a logical extension of keyframe track-ing for rotoscoping applications [Agarwala et al. 2004]. Interesting initial steps towards the vec-torization of video have recently been explored [Patterson et al. 2012]. The data structure alsohas potential applications in non-photorealistic rendering, where there is a need for sound time-coherent models of the regions and strokes in an image sequence [Bénard et al. 2014]. Given theseparation of topological and geometrical information in the VGC and the VAC, it should alsobe possible to develop a limited class of 3D animation using the VAC. Both of the above prob-lems point to the need to develop good models for developing or otherwise modeling consistentparameterizations for edges and faces.Some features supported by traditional vector graphics animation tools are not yet implemented,such as grouping, path-following, clipping, and masking. It is not yet clear how orthogonal thisfeature set is to the topological modeling aspects that we have focused on. Finally, there are inter-esting future directions to improve rendering and performance across the wide range of platformsthat are a driving force behind increasing popularity of vector graphics.5.8 ConclusionWe have presented a new data structure for representing vector graphics animation: the vector an-imation complex (VAC). It provides a compact, continuous-time continuous-space representationfor vector graphics that is designed to support topological events. We expect that such continuousrepresentations will become increasingly important as content needs to be developed for an ever-1315.8. Conclusionwider range of display resolutions and frame rates. Compared to conventional representations forvector graphics animation, the VAC captures more faithfully the semantics of many animations,therefore provides better support for manual editing or algorithm processing. Local keyframing issupported, i.e., keyframes need only provide information about the topological or shape changesfor the subset of parts that require a given change. Topological changes can be modeled wherethey are desired and can be avoided where they are more simply modeled using other means, suchas depth layering.We envision that the VAC may be used in a wide range of applications, including the traditionaldomains for vector graphics animations; traditional drawing-based 2D animation, and the image-processing pipelines that are part of video processing and non-photorealistic rendering applica-tions.132Chapter 6ConclusionFigure 6.1: Left: Example of gure that was challenging to author with current tools. Right: Exploded viewof the gure revealing the 9 independent Bézier curves that had to be created in order to achieve the desiredoutcome. Not only determining how to achieve the desired depth-ordering was a puzzle on its own, but even oncesolved, any edit of the gure was made painfully complicated due to all pieces having to be edited independently,and carefully aligned to prevent any visible seam.In this thesis, rst and foremost, we identied important shortcomings of current vector graphicsrepresentations. Indeed, despite vector graphics being a mature eld with a 50-year-old history,none of the leading vector graphics le standards and applications fully support the representa-tion of faces sharing a common edge, or edges sharing a common vertex, as surprising as it mayseem. Artists frequently have to resort to tedious tricks to achieve their desired outcomes, and theresulting illustrations are hard to edit, and even harder to animate. As a matter of fact, the authorof this dissertation experienced a lot of this frustration himself when creating many of the guresit contains, such as the one illustrated in Figure 6.1.After looking back at the history of vector graphics and topological modeling, which we summa-rized in Chapter 2, it appeared to us that a possible cause of these shortcomings was a lack oftheoretical foundations of vector graphics topology, which could have helped the vector graphicscommunity to design representations supporting topological modeling. In order to alleviate thisissue, we developed such theoretical foundations in Chapter 3, the take-home message being thatit is critical to consider vector graphics illustrations as topological spaces immersed in R2 (insteadof simply embedded in R2), which has direct consequences on what data structures can be usedto represent them. In Chapter 4, we introduced such possible data structure which we called thevector graphics complex. We expect that the denition of this data structure will have a positiveinuence on upcoming standards, as we believe that the ability to model incidence relationshipsbetween vector graphics shapes is not only desirable, but in fact paramount for user experience,as already stressed in the abstract of Sutherland’s PhD thesis [1963] who pioneered the eld, andas suggested by the positive feedback we received from the users of our prototype.133Chapter 6. ConclusionOf course, there still remain important open problems to be solved before the technology is readyfor standardization. In particular, there are many open questions related to styling and renderingfor which we do not have a clear answer yet. For example, even though vector graphics complexeshave the ability to model n-way joins between edges, it is still unclear how they should be ren-dered, especially if edges are allowed to have variable width. In fact, it is already a non-trivialquestion for 2-way joins, a case in point being the recent introduction [SVG Working Group 2017]of new join styling attributes in SVG 2.0 to address some of the shortcomings of the prior SVG 1.1specication.Besides the many advantages of topological modeling to author static illustrations, this paradigmparticularly shines when authoring vector graphics animations. Indeed, there is no better way toensure that two objects stay connected throughout an animation than to explicitly encode in therepresentation that they must stay connected, and vector graphics complexes are a perfect repre-sentation to encode such connections. In order to develop these ideas further, we introduced inChapter 5 the concept of vector animation complexes, which not only allow the representation ofanimated vector graphics complexes, but also allow the topology of these complexes to change overtime. With web animation becoming increasingly popular, and the desire of web artists and devel-opers to have better tools to author such animations, we believe that these types of representationshave the potential to be widely adopted by the community.In this thesis, we focused on solving problems related to vector graphics and hand-drawn 2Danimation, but we believe that many of the ideas that have been developed are in fact applicableto a wide range of domains. Among those we can cite non-photorealistic rendering, interactivedata visualization, games, geographic information systems, medical imaging, or representations ofgeological layers, all of which share the need to represent incidence relationships between objects,and possibly represent time-continuous changes of this topology. However, applying the ideas ofthis thesis to these domains may require more work. For instance, for non-photorealistic rendering,one would need to develop a conversion from 3D mesh silhouettes to vector graphics complexes,which is non-trivial. For interactive data visualization or games, one may need to parameterize avector graphics complex according to user actions instead of time as we did in Chapter 5. All ofthese are exciting directions for future work.Finally, we would like to conclude this dissertation with important thoughts on how the proposedtechniques could be evaluated. Indeed, despite an informal positive reception from our users, thegeneral usefulness of the technique remains largely to be proven. A possible approach would be toperform a formal user study where users are asked to perform the same set of tasks using existingtools versus using our tool. However, it is hard if not impossible to objectively design a set oftasks that tells us anything truly conclusive. Using our tool, users would quite obviously performbetter on tasks where our structure excels, that is, editing an illustration or an animation featuring134Chapter 6. Conclusionshared boundaries. On the other hand, users would quite obviously perform worse on tasks whereour current implementation is too limited compared to existing professional tools, for instance,drawing a complex unstructured illustration with subtle brush styles. Therefore, we believe thatthe only objective and reliable way to prove the usefulness of the method is to monitor its adoptionover decades. Early feedback suggests that such adoption is likely to happen, but only time willtell. In order to make the tool more attractive to use for artists, one would need to implementthe large feature set which is commonly found in other professional packages. Some of thesefeatures are orthogonal with our proposed approach and therefore not harder to implement thanin the existing packages (e.g., layers, text, groups, masks, alignment tools, symmetry mode, clonedinstances, sound), while others may require some work to make them compatible with our datastructure (e.g., join styles, Bézier curve tangents, keyframe tangents).135BibliographyAdobe Systems Inc., 2013. Adobe Illustrator: Help and tutorials.Agarwala, A., Hertzmann, A., Salesin, D. H., and Seitz, S. M. 2004. Keyframe-based trackingfor rotoscoping and animation. ACM Trans. Graph. 23, 3, 584–591.Alexa, M., Cohen-Or, D., and Levin, D. 2000. As-rigid-as-possible shape interpolation. InProceedings of SIGGRAPH 2000, 157–164.Asente, P., Schuster, M., and Pettit, T. 2007. Dynamic planar map illustration. ACM Trans.Graph. 26, 3, 30:1–30:10.Baudelaire, P., andGangnet, M. 1989. Planar maps: An interaction paradigm for graphic design.In Proceedings of CHI ’89, 313–318.Baumgart, B. G. 1972. Winged edge polyhedron representation. Tech. rep., DTIC Document.Baxter, W., Barla, P., and Anjyo, K.-I. 2009. Compatible embedding for 2d shape animation.IEEE Trans. on Visualization and Computer Graphics 15, 5, 867–879.Bénard, P., Lu, J., Cole, F., Finkelstein, A., and Thollot, J. 2012. Active strokes: Coherent linestylization for animated 3d models. In Proceedings of NPAR ’12, 37–46.Bénard, P., Hertzmann, A., and Kass, M. 2014. Computing smooth surface contours withaccurate topology. ACM Trans. Graph. 33, 2, 19:1–19:21.Blair, P. 1994. Cartoon animation. How to Draw and Paint Series. W. Foster Pub.Bregler, C., Loeb, L., Chuang, E., and Deshpande, H. 2002. Turning to the masters: Motioncapturing cartoons. ACM Trans. Graph. 21, 3, 399–407.Brisson, E. 1989. Representing geometric structures in d dimensions: Topology and order. InProceedings of the Fifth Annual Symposium on Computational Geometry, ACM, New York, NY,USA, SCG ’89, 218–227.Buchholz, B., Faraj, N., Paris, S., Eisemann, E., and Boubekeur, T. 2011. Spatio-temporalanalysis for parameterizing animated lines. In Proceedings of NPAR ’11, 85–92.Burtnyk, N., and Wein, M. 1971. Computer-generated key-frame animation. Journal of theSociety of Motion Picture & Television Engineers 80, 3, 149–153.Capen, A., Severtson, J., Hemphill, T., and Cowles, D., 2014. The Adobe Illustrator Story.https://vimeo.com/95415863, May. [Online; retrieved 29-July-2016].136BibliographyCarlson, W., 2003. A critical history of computer graphics and animation. https://design.osu.edu/carlson/history/lessons.html. [Online; retrieved 21-July-2016].Catmull, E., and Wallace, A. 2014. Creativity, Inc.: Overcoming the Unseen Forces That Stand inthe Way of True Inspiration. Random House of Canada.Catmull, E. 1978. The problems of computer-assisted animation. SIGGRAPH Comput. Graph. 12,3, 348–353.Coons, S. A. 1967. Surfaces for computer-aided design of space forms. Tech. rep., MassachusettsInstitute of Technology.Dalstein, B., Ronfard, R., and van de Panne, M. 2014. Point-curve-surface complex: A celldecomposition for non-manifold two-dimensional topological spaces. Tech. rep., University ofBritish Columbia.Dalstein, B., Ronfard, R., and van de Panne, M. 2014. Vector graphics complexes. ACM Trans.Graph. 33, 4, 133:1–133:12.Dalstein, B., Ronfard, R., and van de Panne, M. 2015. Vector graphics animation with time-varying topology. ACM Trans. Graph. 34, 4 (July), 145:1–145:12.Damiand, G., and Lienhardt, P. 2014. Combinatorial Maps: Ecient Data Structures for ComputerGraphics and Image Processing. CRC Press.De Floriani, L., Morando, F., and Puppo, E. 2003. Representation of non-manifold objectsthrough decomposition into nearly manifold parts. In Proceedings of the Eighth ACM Symposiumon Solid Modeling and Applications, ACM, New York, NY, USA, SMA ’03, 304–309.De Floriani, L., Hui, A., Panozzo, D., and Canino, D. 2010. A dimension-independent datastructure for simplicial complexes. In Proceedings of the 19th International Meshing Roundtable,403–420.de Juan, C. N., and Bodenheimer, B. 2006. Re-using traditional animation: methods for semi-automatic segmentation and inbetweening. In Proceedings of SCA ’06, 223–232.Dehn, M., and Heegaard, P. 1907. Analysis situs. In Enzyklopädie der Math. Wiss. III.1.1. 153–220.Dobrindt, K., Mehlhorn, K., and Yvinec, M. 1993. A complete and ecient algorithm forthe intersection of a general and a convex polyhedron. In Workshop on Algorithms and DataStructures, Springer, 314–324.Durand, F. 2002. An invitation to discuss computer depiction. In Proceedings of the 2nd Inter-national Symposium on Non-photorealistic Animation and Rendering, ACM, New York, NY, USA,NPAR ’02, 111–124.Edelsbrunner, H., and Harer, J. 2010. Computational Topology: An Introduction. Applied math-ematics. American Mathematical Society.Edmonds, J. 1960. A combinatorial representation for polyhedral surfaces. Notices of the AmericanMathematical Society 7 .137BibliographyEisemann, E., Paris, S., and Durand, F. 2009. A visibility algorithm for converting 3D meshesinto editable 2D vector graphics. ACM Trans. Graph. 28, 3, 83:1–83:8.Elter, H., and Lienhardt, P. 1992. Extension of the notion of map for the representation of thetopology of cellular complexes. In 4th Canadian Conference on Computational Geometry.Elter, H., and Lienhardt, P. 1993. Dierent combinatorial models based on the map concept forthe representation of subsets of cellular complexes. In Modeling in Computer Graphics. 193–212.Elter, H., and Lienhardt, P. 1994. Cellular complexes as structured semi-simplicial sets. Inter-national Journal of Shape Modeling 1, 02, 191–217.Fausett, E., Pasko, A., and Adzhiev, V. 2000. Space-time and higher dimensional modeling foranimation. In Proceedings of Computer Animation 2000, 140–145.Favreau, J.-D., Lafarge, F., and Bousseau, A. 2016. Fidelity vs. simplicity: A global approach toline drawing vectorization. ACM Trans. Graph. 35, 4 (July), 120:1–120:10.Fekete, J.-D., Bizouarn, E., Cournarie, E., Galas, T., and Taillefer, F. 1995. TicTacToon: Apaperless system for professional 2D animation. In Proceedings of SIGGRAPH 95, 79–90.Fiore, F. D., Schaeken, P., Elens, K., and Reeth, F. V. 2001. Automatic in-betweening in com-puter assisted animation by exploiting 2.5D modelling techniques. In Proceedings of ComputerAnimation 2001, 192–200.Foley, J. D., and Van Dam, A. 1982. Fundamentals of Interactive Computer Graphics. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.Foley, J. D., van Dam, A., Feiner, S. K., and Hughes, J. F. 1990. Computer Graphics: Principlesand Practice (2Nd Ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.Fu, H., Tai, C.-l., and Au, O. K.-c. 2005. Morphing with laplacian coordinates and spatial-temporaltexture. In Proceedings of Pacic Graphics 2005, 100–102.Gale, D. 1987. The Classication of 1-Manifolds: A Take-Home Exam. The AmericanMathematicalMonthly 94, 2, 170–175.Granados, M., Hachenberger, P., Hert, S., Kettner, L., Mehlhorn, K., and Seel, M. 2003.Boolean operations on 3D selective Nef complexes: Data structure, algorithms, and implemen-tation. In Algorithms - ESA 2003, vol. 2832 of Lecture Notes in Computer Science. Springer BerlinHeidelberg, 654–666.Guibas, L., and Stolfi, J. 1985. Primitives for the manipulation of general subdivisions and thecomputation of Voronoi. ACM Trans. Graph. 4, 2 (Apr.), 74–123.Gursoz, E. L., Choi, Y., and Pinz, F. B. 1990. Vertex-based representation of non-manifold bound-aries. In Geometric Modeling for Product Engineering, Eselvier, Amsterdam, 107–130.Hatcher, A. 2001. Algebraic Topology.Hoffman, D. D. 2000. Visual Intelligence: How We Create what We See. Norton.138BibliographyIgarashi, T., and Mitani, J. 2010. Apparent layer operations for the manipulation of deformableobjects. ACM Trans. Graph. 29, 4 (July), 110:1–110:7.Igarashi, T., Moscovich, T., and Hughes, J. F. 2005. As-rigid-as-possible shape manipulation.ACM Trans. Graph. 24, 3, 1134–1141.Inkscape, 2013. http://www.inkscape.org/en/. [Online; retrieved 01-July-2017].Karsch, K., and Hart, J. C. 2011. Snaxels on a plane. In Proceedings of NPAR ’11, 35–42.Kettner, L. 1999. Using generic programming for designing a data structure for polyhedralsurfaces. Comput. Geom. Theory Appl 13, 65–90.Koenderink, J. J., and Doorn, A. J. v. 2002. Image processing done right. In Proceedings of the7th European Conference on Computer Vision, 158–172.Koenderink, J., and Doorn, A. 2008. The structure of visual spaces. Journal of MathematicalImaging and Vision 31, 2-3, 171–187.Kort, A. 2002. Computer aided inbetweening. In Proceedings of NPAR ’02, 125–132.Krull, F. N. 1994. The origin of computer graphics within general motors. IEEE Ann. Hist. Comput.16, 3 (Sept.), 40–56.Kwarta, V., and Rossignac, J. 2002. Space-time surface simplication and edgebreaker compres-sion for 2D cel animations. International Journal of Shape Modeling 8, 2, 119–137.Lasseter, J. 1987. Principles of traditional animation applied to 3d computer animation. SIG-GRAPH Comput. Graph. 21, 4, 35–44.Lee, S. H., and Lee, K. 2001. Partial entity structure: A compact non-manifold boundary repre-sentation based on partial topological entities. In Proceedings of the Sixth ACM Symposium onSolid Modeling and Applications, ACM, New York, NY, USA, SMA ’01, 159–170.Lee, J. M. 2011. Introduction to Topological Manifolds. Springer New York.Levy, B., and Mallet, J.-L. 1999. Cellular modelling in arbitrary dimension using generalizedmaps. Tech. rep., Technical report, ISA-GOCAD (Inria-Lorraine/CNRS).Lienhardt, P. 1989. Subdivisions of n-dimensional spaces and n-dimensional generalized maps.In Proceedings of the Fifth Annual Symposium on Computational Geometry, ACM, New York, NY,USA, SCG ’89, 228–236.Lienhardt, P. 1991. Topological models for boundary representation: A comparison with n-dimensional generalized maps. Comput. Aided Des. 23, 1 (Feb.), 59–82.Lienhardt, P. 1994. N-dimensional generalized combinatorial maps and cellular quasi-manifolds.International Journal of Computational Geometry & Applications 04, 03, 275–324.Liu, D., Chen, Q., Yu, J., Gu, H., Tao, D., and Seah, H. S. 2011. Stroke correspondence constructionusing manifold learning. Computer Graphics Forum 30, 8, 2194–2207.139BibliographyMarcheix, D., and Gueorguieva, S. 1995. Topological operators for non-manifold modeling.Proceedings of the Third International Conference in Central Europe on Computer Graphics andVisualisation ’95 1 (Feb.), 173–186.Masson, T. 1999. CG 101: A Computer Graphics Industry Reference. 3D Graphics Other Series. NewRiders.McCann, J., and Pollard, N. 2009. Local layering. ACM Trans. Graph. 28, 3, 84:1–84:7.MIT Lincoln Laboratory, 1964. Ivan Sutherland : Sketchpad demo. https://www.youtube.com/watch?v=USyoT_Ha_bA. [Online; retrieved 05-March-2017].Moissinac, J.-C. 2010. SuperPath (vePath): A necessary primitive for vector graphic formats. InProceedings of the 8th International Conference on Scalable Vector Graphics.Munkres, J. 2000. Topology. Featured Titles for Topology Series. Prentice Hall, Incorporated.Nef,W. 1978. Beiträge zur Theorie der Polyeder: mit Anwendungen in der Computergraphik. Beiträgezur Mathematik, Informatik und Nachrichtentechnik. Lang.Ngo, T., Cutrell, D., Dana, J., Donald, B., Loeb, L., and Zhu, S. 2000. Accessible animation andcustomizable graphics via simplicial conguration modeling. In Proceedings of SIGGRAPH 2000,403–410.Noris, G., Sýkora, D., Coros, S., Whited, B., Simmons, M., Hornung, A., Gross, M., and Sumner,R. W. 2011. Temporal noise control for sketchy animation. In Proceedings of NPAR ’11, 93–98.Noris, G., Hornung, A., Sumner, R. W., Simmons, M., and Gross, M. 2013. Topology-drivenvectorization of clean line drawings. ACM Trans. Graph. 32, 1, 4:1–4:11.Orzan, A., Bousseau, A., Winnemöller, H., Barla, P., Thollot, J., and Salesin, D. 2008. Dif-fusion curves: A vector representation for smooth-shaded images. ACM Trans. Graph. 27, 3,92:1–92:8.Patterson, J. W., Taylor, C. D., and Willis, P. J. 2012. Constructing and rendering vectorisedphotographic images. The Journal of Virtual Reality and Broadcasting 9, 3.Pesco, S., Tavares, G., and Lopes, H. 2004. A stratication approach for modeling two-dimensional cell complexes. Computers & Graphics 28, 2, 235–247.Porter, T., and Duff, T. 1984. Compositing digital images. SIGGRAPH Comput. Graph. 18, 3(Jan.), 253–259.Raveendran, K., Wojtan, C., Thuerey, N., and Turk, G. 2014. Blending liquids. ACM Trans.Graph. 33, 4, 137:1–137:10.Reeves, W. T. 1981. Inbetweening for computer animation utilizing moving point constraints.SIGGRAPH Comput. Graph. 15, 3, 263–269.Reilly, E. 2003. Milestones in Computer Science and Information Technology. Greenwood Press.Rivers, A., Igarashi, T., and Durand, F. 2010. 2.5D cartoon models. ACM Trans. Graph. 29, 4,59:1–59:7.140BibliographyRossignac, J., and O’Connor, M. 1989. SGC: A Dimension-independent Model for Pointsets withInternal Structures and Incomplete Boundaries. Research report. IBM T.J. Watson Research Center.Rossignac, J. 1997. Structured topological complexes: A feature-based API for non-manifoldtopologies. In Proceedings of the Fourth ACM Symposium on Solid Modeling and Applications,ACM, New York, NY, USA, SMA ’97, 1–9.Sebastian, T. B., Klein, P. N., and Kimia, B. B. 2003. On aligning curves. IEEE Trans. on PatternAnalysis and Machine Intelligence 25, 1, 116–125.Sederberg, T. W., Gao, P., Wang, G., and Mu, H. 1993. 2-D shape blending: an intrinsic solutionto the vertex path problem. In Proceedings of SIGGRAPH 93, 15–18.Shirley, P., and Marschner, S. 2009. Fundamentals of Computer Graphics. Taylor & Francis.Shreiner, D., Woo, M., Neider, J., and Davis, T. 2004. Tesselators and quadrics. In The OpenGLProgramming Guide, Fourth Edition. Addison-Wesley, ch. 11, 487–514.Southern, R. 2008. Animation manifolds for representing topological alteration. Tech. Rep.UCAM-CL-TR-723, University of Cambridge, Computer Laboratory.Sun, J., Liang, L., Wen, F., and Shum, H.-Y. 2007. Image vectorization using optimized gradientmeshes. ACM Trans. Graph. 26, 3 (July).Sutherland, I. E. 1963. Sketchpad, a man-machine graphical communication system. PhD thesis,Massachusetts Institute of Technology.SVG Working Group, 2011. Scalable Vector Graphics (SVG) 1.1 (Second Edition). http://www.w3.org/TR/SVG11/. [Online; retrieved 01-July-2017].SVG Working Group, 2016. Scalable Vector Graphics (SVG) 2.0 (W3C Candidate Recommen-dation 15 September 2016). https://www.w3.org/TR/2016/CR-SVG2-20160915/. [Online;retrieved 01-August-2016].SVG Working Group, 2017. Controlling line joins: the ‘stroke-linejoin’ and ‘stroke-miterlimit’properties. https://www.w3.org/TR/SVG2/painting.html#LineJoin. [Online; retrieved27-March-2017].Sýkora, D., Dingliana, J., and Collins, S. 2009. As-rigid-as-possible image registration forhand-drawn cartoon animations. In Proceedings of NPAR ’09, 25–33.Sýkora, D., Ben-Chen, M., Čadík, M., Whited, B., and Simmons, M. 2011. TexToons: practicaltexture mapping for hand-drawn cartoon animations. In Proceedings of NPAR ’11, 75–84.Takayama, K., Panozzo, D., Sorkine-Hornung, A., and Sorkine-Hornung, O. 2013. Sketch-based generation and editing of quad meshes. ACM Trans. Graph. 32, 4 (July), 97:1–97:8.Thomas, F., and Johnston, O. 1987. Disney Animation: The Illusion of Life. Abbeville Press.Weiler, K. 1985. Edge-based data structures for solid modeling in curved-surface environments.IEEE Computer Graphics and Applications 5, 1, 21–40.141BibliographyWeiler, K. 1986. Topological Structures for Geometric Modeling. PhD thesis, Rensselaer PolytechnicInstitute.Whited, B., Noris, G., Simmons, M., Sumner, R., Gross, M., and Rossignac, J. 2010. BetweenIT:An interactive tool for tight inbetweening. Computer Graphics Forum 29, 2, 605–614.Wiley, K., and Williams, L. R. 2006. Representation of interwoven surfaces in 2 1/2 D drawing.In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, ACM, NewYork, NY, USA, CHI ’06, 65–74.Williams, R. 2009. The Animator’s Survival Kit. Faber and Faber.Yu, J., Bian, W., Song, M., Cheng, J., and Tao, D. 2012. Graph based transductive learning forcartoon correspondence construction. Neurocomputing 79, 0, 105–114.Zhang, S.-H., Chen, T., Zhang, Y.-F., Hu, S.-M., and Martin, R. R. 2009. Vectorizing cartoonanimations. IEEE Trans. on Visualization and Computer Graphics 15, 4, 618–629.142Indexabstract cell 63abstract edge 63abstract face 63abstract PCS complex 63abstract topology 63abstract vertex 63after 119after cycle 114after face 116after path 115after time 116after vertex 114animated curve 114, 115animated cycle 109, 116, 117animated position 114animated vertex 109, 117attribute 112before 119before cycle 114before face 116before path 115before time 116before vertex 114boundary 71cell 3, 47, 64, 80, 82, 112, 119cell-tuple 26characteristic manifold 64closed edge 3, 51, 63, 81, 83closed halfedge 63, 83, 116closedness 63, 83combinatorial map 24consistent parameterization 69continuous 41curve 113CW complex 28cycle 3, 64, 81, 83, 109, 114, 117dimension 63, 82direction 119disjoint union 65edge 82, 112end animated vertex 115end vertex 113-g-k-face 54face 3, 81, 82, 112face-cut classication 60generalized map 25genus 63geometric realization 42, 46, 64, 66geometrical attribute 112graph 39halfedge 4, 63, 81, 116halfedge data structure 19homeomorphism (graphs) 40homeomorphism (PCS compl.) 70homeomorphism (topol. spaces) 41immersion 46inbetween cell 112inbetween closed edge 109, 112, 114143inbetween face 109, 112, 115inbetween open edge 108, 112, 115inbetween vertex 107, 112, 114incidence graph 71, 86invariant 112, 119isomorphism (graphs) 40isomorphism (PCS complexes) 64, 70isomorphism (polygonal meshes) 44key cell 112key closed edge 109, 112, 113key face 109, 112, 114key open edge 108, 112, 113key vertex 107, 112, 113next 119node 117non-equivalent cuts 72non-planar face 53non-simple cycle 64, 83number of cycles 83number of holes 63open edge 3, 63, 80, 83open halfedge 63, 83, 116open set 40ordered boundary 63, 83orientability 63overlapping 46, 47partial keyframing 108path 108, 116PCS complex 64planar map 14point 40position 113presentation 46previous 119quad-edge data structure 19quotient space 46radial-edge data structure 21raster graphics 8selective geometric complex 29sequential keyframing 106simple cycle 64, 83simplicial complex 27spatial boundary 108spatial dimension 112star 4, 91start animated vertex 115start vertex 113starting node 119starting point 117Steiner cycle 64, 81, 83Steiner vertex 56stroke graph 15SVG representation 13temporal boundary 108temporal dimension 112time 113, 114timespan 119topological attribute 112topological keyframing 107topological modeling 2, 8, 16topological operator 44, 71, 92topological space 40topological structure 47topology 38, 40type 51, 52, 112vector graphics 1, 8vector graphics complex 72, 82vertex 3, 82, 112winding number 86winding rule 85, 114, 116winged-edge data structure 18144Appendix AConcepts of Algebraic TopologyIn this appendix, we review a few concepts of algebraic topology which are relevant to this disser-tation. These concepts are by no means a prerequisite for understanding most of the dissertation(in fact, the author himself only has a supercial understanding of some of them), but they werean important source of inspiration, and we believe they may provide useful insight to interestedreaders. For readability, we only provide informal denitions of most of these concepts. Formaldenitions can be found in [Lee 2011, Hatcher 2001].A.1 Topological Spaces and HomeomorphismsIn this dissertation, whenever we say topological space, we mean a Hausdor topological space.Intuitively, a (general) topological space is a set, for instance X = {x ∈ R | 0 < x < 5}, togetherwith a denition of open subsets that has to satisfy a few properties that capture the notion of“openness”. These properties are given in Section 3.1.2, but informally, it is simply a generalizationof the intuitive concepts of open intervals and closed intervals. For instance, I = (1, 2) = {x ∈R | 1 < x < 2} is an open subset of X , while J = [1, 2) = {x ∈ R | 1 ≤ x < 2} is notan open subset of X . For any point x ∈ X , a neighborhood of x is dened as any open subsetNx ⊂ X that contains x. Finally, a Hausdor topological space is a topological space that satisesthe additional property that any two points x1 and x2 are separable by open sets, that is, thereexists neighborhoods of x1 and x2 that do not intersect. In practice, most “reasonable” spaces areindeed Hausdor topological spaces. For instance, Rn is a Hausdor topological space, and anysubset of Rn is a Hausdor topological space as well.Two topological spaces X and Y are said to be homeomorphic, denoted X ∼= Y , if and onlyif there exists a homeomorphism between X and Y , that is, an invertible continuous functionφ : X → Y whose inverse φ−1 is also continuous. X ∼= Y captures the intuitive concept of “X andY are essentially the same topological space”, meaning that even though they are not necessarily“equal”, they behave similarly and have a similar “shape”. For instance, the two closed intervalsI1 = [0, 1] and I2 = [1, 2] are not equal but they are homeomorphic. The two open intervalsJ1 = (0, 1) and J2 = (1, 2) are not equal but they are homeomorphic. Also, the two circles145A.2. Manifolds with Boundary and Compact ManifoldsLocallyhomeo-morphictoFigure A.1: The sphere S2 = {x ∈ R3, ||x|| = 1}is a 2-manifold without boundary, since it is every-where locally homeomorphic to R2.At p, locallyhomeomorphic topFigure A.2: The surface [−1, 1] × [−1, 1] is a 2-manifold with boundary, since it is locally homeo-morphic either to R2 or to R× [0,+∞).S1 = {(x, y) ∈ R2 | x2 + y2 = 1} and S1 = {(x, y) ∈ R2 | x2 + y2 = 2} are not equalbut they are homeomorphic. However, none of I1, J1 or S1 are homeomorphic to each other,which is the formal way of saying: “they do not look alike”. This informal statement is so intuitivethat we have dierent names for these objects (closed intervals, open intervals, circles), whilethere is no terminology to dierentiate, say, I1 and I2. Identifying that a topological space X ishomeomorphic to a known topological space Y is of primary importance because it makes possibleto infer properties of X from the known properties of Y .A.2 Manifolds with Boundary and Compact ManifoldsAn n-manifold without boundary M is a topological space that is everywhere locally home-omorphic to Rn. More formally, M is an n-manifold without boundary if and only if for eachp ∈ M, there exists a neighborhood Np homeomorphic to Rn. For instance, the sphere S2 is a2-manifold without boundary because for each point p on the sphere, it “looks locally like” theplane, as illustrated in Figure A.1. However, the square [−1, 1]× [−1, 1] ⊂ R2 is not a 2-manifoldwithout boundary because at p = (1, 0), it is locally homeomorphic to R× [0,+∞), as illustratedin Figure A.2. Since we want this last example to be included in our denition of manifold, we usea more general denition: an n-manifold with boundary is dened as a topological space thatis everywhere locally homeomorphic either to Rn or to Hn = Rn−1 × [0,+∞). In this disserta-tion, whenever we say manifold, we mean manifold with boundary, unless without boundary isexplicitly stated. If M is an n-manifold, then the interior of M, denoted int(M), are the points ofM that have a neighborhood homeomorphic toRn. Conversely, the boundary ofM, denoted ∂M,are the points ofM that have a neighborhood homeomorphic toHn, i.e. ∂M = M\ int(M).A compact manifoldM is a manifold that is compact as a topological space. A general denitioncan be found in [Lee 2011, Chapter 4], but in the specic case where M is a subset of Rn, thenbeing compact is equivalent to being bounded and topologically closed inRn (i.e.,Rn \M is open).For instance, the closed interval [0, 1] is a compact manifold, but the real line R is not a compactmanifold because it is not bounded, and the open interval (0, 1) is not a compact manifold becauseit is not closed in R. If M is a compact n-manifold, then ∂M is a compact (n − 1)-manifold but146A.3. Points, Curves, and SurfacesV = R0 =E| = D1 =E◦ = S1 =kF,0,k = S2#D2# k· · ·#D2 =F,g,k = T2#g· · ·#T2#D2# k· · ·#D2 =F6,g,k = P2#g· · ·#P2#D2# k· · ·#D2 =kgg ∼=kgk kg∼=Figure A.3: The classication of points, curves and surfaces. Any connected compact n-manifold with n ≤ 2is homeomorphic to one and only one of these known compact manifolds. The notations V, E|, E◦, F,g,k , andF6,g,k are non-standard and introduced for conciseness and clarity. They are the characteristic manifolds for,respectively: vertices, open edges, closed edges, orientable faces, and non-orientable faces.int(M) is an n-manifold generally not compact. More specically, int(M) is compact i ∂M = ∅(i.e., i M is a compact n-manifold without boundary).A.3 Points, Curves, and SurfacesCompact manifolds are important because their properties capture the intuitive concepts of points,curves, and surfaces. More specically, a point is dened as a connected compact 0-manifold,a curve is dened as a connected compact 1-manifold, and a surface is dened as a connectedcompact 2-manifold. Being compact ensures that curves (resp. surfaces) have a nite, well-denedlength (resp. area), and avoid having to deal with many pathological cases.A.4 Classification of Compact n-Manifolds for n ≤ 2Compact manifolds of dimension two and lower, that is, points, curves, and surfaces, have beencompletely “classied”. This means that we know a very concise list of compact manifolds, illus-trated in Figure A.3, such as any point, curve, or surface is necessarily homeomorphic to one andonly one of the manifolds in the list. In other words, any surface “looks like” one and only one ofthe surfaces in the list. In this section, we recall this classication. Following common practice,we only consider here connected compact manifolds, but it is trivial to generalize to all compactmanifolds since any compact n-manifold can be decomposed as a nite disjoint union of connectedcompact n-manifolds.Dimension 0 A point is always homeomorphic to R0 = {0}, that is, a set containing a uniqueelement. In practice, we identify the set to the unique element itself.147A.4. Classication of Compact n-Manifolds for n ≤ 2b baaFigure A.4: A polygonal presentation of the torusis the single wordW = aba−1b−1.b baaFigure A.5: A polygonal presentation of the Kleinbottle is the single wordW = abab−1.a babFigure A.6: A polygonal presentation of the sphereis the single wordW = abb−1a−1.b baaFigure A.7: A polygonal presentation of the projec-tive plane is the single wordW = abab.Dimension 1 A curve is homeomorphic either to the unit circle S1 or to the closed intervalD1 = [0, 1]. A proof can be found in [Gale 1987] or in [Lee 2011, Ch. 5, p. 143-147].Dimension 2 A surface without boundary is homeomorphic to either:• The sphere S2, called the surface of genus 0.• The connected sum of g ≥ 1 tori (T2)g = T2# g. . .#T2, called the orientable surface ofgenus g.• The connected sum of g ≥ 1 projective planes (P2)g = P2# g. . .#P2, called the nonori-entable surface of genus g.We clarify here the terminology. The torus T2 is the topological space obtained by “gluing” to-gether (or “sewing”) the opposite boundaries of a cylinder as depicted in Figure A.4. Note thatdirection matters: if you choose to glue using the reverse direction of one of the boundaries, asdepicted in Figure A.5, you get the Klein bole K2 instead, which is not homeomorphic to thetorus but to P2#P2. The projective plane P2 is the topological space obtained by “gluing” theunique boundary of a disk to the unique boundary of a Möbius strip. Alternatively, as illustratedin Figure A.7, it can be obtained by gluing together one half of the boundary of a disk to the otherhalf, using the appropriate direction. The connected sum of two surfaces consists in removingone disk from each surface, and gluing together the two obtained boundaries.The classication of surfaces given above has been rst proven in [Dehn and Heegaard 1907], andis nicely covered and illustrated in [Lee 2011, Ch. 6]. We recall below the high-level steps of thisproof, which involves the concept of polygonal presentations, related to our concept of abstractPCS complexes introduced in Section 3.3.1.• A wordW is dened, given a set S, as a nite sequence of k ≥ 1 symbols, each of the form148A.4. Classication of Compact n-Manifolds for n ≤ 2a or a−1 with a ∈ S. It represents a regular polygon with k edges, where some edges areidentied in pairs with a chosen direction. For instance, the wordW = abab−1 represents asquare, where the rst and third edges are identied with the same direction, and the secondand fourth edges are identied with opposite directions (cf. Figure A.5, left). A polygonalpresentation P is dened as a set of words.• The geometric realization ofP , denoted |P|, is the topological space obtained by gluing to-gether the paired edges of the polygons described by its words. For instance, the geometricrealization of P = {abab} is a torus (cf. Figure A.4). Other examples are given in Fig-ure A.5, A.6, and A.7. Two polygonal presentations are said to be topologically equivalentif and only if their geometric realizations are homeomorphic.• A surface presentation is dened as a polygonal presentationP where each element a ∈ Soccurs exactly twice. In this case, we can prove than |P| is a compact 2-manifold withoutboundary. Conversely, it can be shown that any compact 2-manifold without boundaryadmits a surface presentation P .• Finally, combinatorial operations on surface presentations prove that any surface presenta-tion is topologically equivalent to either:– the canonical surface presentation of the sphere:P = {aa−1} (A.1)– the canonical surface presentation of the connected sum of g ≥ 1 tori:P = {a1b1a−11 b−11 . . . agbga−1g b−1g } (A.2)– the canonical surface presentation of the connected sum of g ≥ 1 projective planes:P = {a1a1 . . . agag} (A.3)The classication above was only for surfaces without boundary. However, it turns out that sur-faces with boundary can always be obtained from surfaces without boundary by removing theinterior of k ≥ 0 disjoint closed disks. We illustrate this complete classication in Figure A.3.Finally, we recall an interesting theorem which is used in the proof of this classication, and isrelevant to analyze our cut and uncut topological operators:149A.5. Non-Manifold Topological Spaces∼= R2∼= H2∼= H ∼= R∼= ?Figure A.8: X = {(x, y) | x2 +y2 ≤ 1} ∪ {(x, 0) | x ∈ [−2,−1]}is a non-manifold space: there ex-ists no n such thatX is everywherelocally homeomorphic to either Rnor Hn.Figure A.9: A two-dimensionalsimplicial complex. The union ofthe simplices is in general a non-manifold space. Though, some con-nected components may be mani-folds.Figure A.10: Left: minimalsimplicial decomposition of S2 (14simplices). Middle: minimal CWdecomposition (2 CW-cells). Right:minimal PCS decomposition (1PCS-cell).Theorem 1. The connected sum of a projective plane and a torus is homeomorphic to the connectedsum of three projective planes, i.e.:P2#T2 ∼= P2#P2#P2 (A.4)A.5 Non-Manifold Topological SpacesCompact manifolds are very convenient to study, but unfortunately not all compact topologicalspaces are compact manifolds, as for instance the one illustrated in Figure A.8. To include thisexample and many others (but not all compact topological spaces, which would be too general), awider class of topological spaces has been dened: those that can be obtained by “gluing together”simple manifold pieces. For instance, the topological space in Figure A.8 can be obtained by gluinga segment with a disk. Topological spaces dened within this general framework are commonlyreferred to as complexes, such as simplicial complexes and CW complexes, which we recall in thissection. As noted in [Edelsbrunner and Harer 2010, Ch. III, p. 51], one of the most importantcharacteristic that makes each kind of complex dierent from one another is how “simple” theglued pieces are. The simpler the pieces, the more pieces you need to decompose a given space (cf.Figure A.10). Therefore, choosing the right formalism to tackle a given topological problem is atrade-o between the complexity of each piece, and the number of pieces you need to decomposea given space. For instance, the pieces of a simplicial complex are called simplices and are n-dimensional triangles, while the pieces of a CW complex are called cells and are homeomorphic toan n-dimensional open disk. Thus, a simplex is a special case of a cell, meaning that the pieces ofCW complexes are “more complex” than the pieces of simplicial complexes. As a consequence, thesphere can be decomposed with only two cells, while it requires 14 simplices. In this dissertation,we introduce the concept of PCS complex, whose pieces, also called cells for lack of a better name,are only required to be homeomorphic to the interior of a compact manifold. Thus, a “CW-cell” isa special case of a “PCS-cell”, meaning that the pieces of PCS complexes are “even more complex”150A.5. Non-Manifold Topological Spacesthan the pieces of CW complexes, and can for instance decompose the sphere as a single PCS-cell.A.5.1 Abstract Simplicial ComplexesAn abstract simplicial complex [Edelsbrunner and Harer 2010, p. 53] is a nite collection of setsA such that:(α ∈ A and β ⊆ α) ⇒ β ∈ A (A.5)The elements α in A are called simplices, and each simplex is given as the set of its vertices. Thedimension of a simplex is dim α = card α−1, and the dimension of the complex is the maximumdimension of any of its simplices. Intuitively, a two-dimensional abstract simplicial complex is atriangle mesh made of vertices, edges and triangles (possibly non-manifold, with dangling edgesor isolated vertices), as illustrated in Figure A.9. The formal denition ensures that if a triangledened by the vertices {0, 1, 2} is part of the complex, then all the vertices {0},{1}, and {2},and all the edges {0, 1},{0, 2}, and {1, 2} are also part of the complex, and they are called theboundary simplices of the triangle.A.5.2 CW ComplexesLet us rst formally dene this concept, then right after provide the intuition behind the formal-ism. First, we dene the n-disk, its interior the open n-disk, and its boundary the (n-1)-sphereas:Dn = {x ∈ Rn | ‖x‖ ≤ 1}, (A.6)◦Dn = int(Dn) = {x ∈ Rn | ‖x‖ < 1}, (A.7)Sn−1 = ∂Dn = {x ∈ Rn | ‖x‖ = 1}. (A.8)An n-cell c is dened as a topological space homeomorphic to int(Dn). A cell decomposition Cof a topological space X is a collection of disjoints cells ci such that X =⋃i ci. The n-skeletonXn of X is the union of k-cells of C such that k ≤ n. Finally, K = (X, C) is called a CW complexif it satises the following three axioms:Axiom 1 (Characteristic maps). For each n-cell c ∈ C, there exists a continuous function Φc :Dn → X such that the restriction of Φc to int(Dn) is a homeomorphism from int(Dn) to c, and suchthat Φc(∂Dn) ⊆ Xn−1.Axiom 2 (Closure finiteness). The closure c intersects only a nite number of other cells.Axiom 3 (Weak topology). A ⊆ X is closed i A ∩ c is closed for each c ∈ C.151A.6. Geometric Realizations and Quotient SpacesDespite the fact that the last two axioms are those responsible for the acronym “CW”, you cansafely ignore them in this report, since they are automatically true if the number of cells is nite,which should always be the case for computer graphics applications. Therefore, let us simplyclarify this obscure CW complex denition by focusing on the preliminary denitions and therst axiom. Since an n-cell is a pointset homeomorphic to int(Dn), this means that a 0-cell (calledvertex) is a single point in space, a 1-cell (called edge) is a pointset homeomorphic to the openinterval (−1, 1), and a 2-cell (called face) is a pointset homeomorphic to the open 2-disk ◦D2. Atwo-dimensional cell decomposition of a topological space X is therefore a partition of X intovertices v ∼= {0}, edges e ∼= (−1, 1) and faces f ∼= ◦D2.invalid CWcomplexvalid CWcomplexFigure A.11: Two valid cell de-compositions of a cross, but only oneis a valid CW complex.However, this allows spaces like X = R to be decomposed as asingle cell e = R, since R ∼= (−1, 1). Also, this allows a cross tobe decomposed as four vertices and three edges (cf. Figure A.11,top). Because we do not want these decompositions to be validCW complexes, Axiom 1 adds some restrictions. In the case ofedges, instead of “simply” requiring e ∼= (−1, 1), we require theexistence of a continuous function Φe : [−1, 1] → X such thatΦe((−1, 1)) = e. This way, even though edges are “open inter-vals”, they are forced to “look like interior of closed intervals”,thus the edge e = R is not allowed as part of a CW complex. Finally, Axiom 1 also requires thatΦe(−1) and Φe(1) be included in the 0-skeleton of C. In other words, it requires that the “edgeboundary” ∂e = e \ e is made of vertices that are part of the decomposition. This additionalrequirement enforces the existence of a vertex at the intersection of the cross (cf. Figure A.11).We note that Φe restricted to (−1, 1) must be a homeomorphism (in particular, must be invert-ible), but it is not required that Φe be invertible on the whole domain of denition [−1, 1]. Thisprevents self-intersections in the interior of the edge, but allows Φe(−1) to be equal to Φe(1). Inother words, it is allowed that the start vertex of the edge is equal to the end vertex. All theseconsiderations scale for faces: the closure of a face must be compact, the boundary of a face mustbe included in a union of vertices and edges, and faces cannot self-intersect in their interior, buttheir boundary can “use” the same vertex or edge several times. For instance, the boundary of aface can be a single vertex (cf. Figure A.10, middle), or even a single point in the interior of anedge (cf. Figure B.2), or can do “switch-backs” in the interior of an edge (cf. Figure B.3).A.6 Geometric Realizations and Quotient SpacesThe reader may have noticed that the denition of CW complexes that we have given diersgreatly from the denitions of polygonal presentations and abstract simplicial complexes because152A.6. Geometric Realizations and Quotient Spacesit relies on the existence of a topological space X , that we decompose into cells. On the contrary,a polygonal presentation or an abstract simplicial complex is not a topological space per se, but acombinatorial description of one. From such combinatorial description, one can build the corre-sponding topological space, called its geometric realization, by “gluing” together known topologicalspaces, which is formally done using the concept of quotient space that we recall in the followingparagraph.X =0 1 2 3 4 5Y = P(0, 1](2, 3](4, 5]Figure A.12: Illustration of X =[0, 1]∪[2, 3]∪[4, 5], and the quotientspace Y = X/ ∼ dened by 0 ∼2 ∼ 4.Let X be a set, and let ∼ be an equivalence relation on X . Forinstance, let us take as a very simple example X = {1, 2, 3} and∼ dened such that 1 ∼ 2, 1 6∼ 2, and 2 6∼ 3. The equiva-lence classes of ∼ are dened as a partition of X into subsetsregrouping elements that are equivalent to each others. In ourexample, there are two equivalence classes: E = {1, 2} (since1 and 2 are equivalent) and F = {3} (since 3 is not equivalentto any other elements). The quotient set of X by ∼, denotedX/ ∼, is dened as the set of equivalence classes of ∼. Therefore, in our example, we haveX/ ∼= {E,F} = {{1, 2}, {3}}. In other words, quotienting a set by an equivalence relation canbe understood as transforming elements that were equivalent into a single element. The conceptof quotient space is very similar, except that it acts on topological spaces instead of sets. Thismeans that in addition to dene Y = X/ ∼ as the set of equivalence classes of∼, it also makes Ya topological space by dening which subsets of Y are “open”. More specically, the open subsetsof Y are dened as the sets of equivalent classes whose unions are open sets in X . This meansthat two equivalent classes E and F are “close-by” in Y if and only if there exist xE ∈ E andxF ∈ F that were originally “close-by” in X . For instance, consider X = [0, 1] ∪ [2, 3] ∪ [4, 5],i.e. X ⊂ R is a disjoint union of three closed intervals (cf. Figure A.12, top). Then let us considerthe equivalence relation ∼, dened by 0 ∼ 2, 0 ∼ 4, 2 ∼ 4, and x1 6∼ x2 for all other pairs in X .This means that the set P = {0, 2, 4} is one equivalence class, and every other element x ∈ Xis its own equivalence class {x}. By using the convenient notation (a, b] = {{x} | x ∈ (a, b]},then we have Y = (0, 1] ∪ (2, 3] ∪ (4, 5] ∪ {P}. Because 0 was in the closure of (0, 1] in X , and0 ∈ P , it can be shown that P is in the closure of (0, 1] in Y . Similarly, it can be shown thatP is in the closure of (2, 3] and (4, 5]. Therefore, the closures of (0, 1], (2, 3], and (4, 5] intersectin Y (at P ), while the closures of (0, 1], (2, 3], and (4, 5] did not intersect originally in X . Thisis why it is said that using this operation, the three closed intervals [0, 1], [2, 3], and [4, 5] havebeen glued, by identifying the three real numbers 0, 2 and 4 as a single element. Quotienting Xby ∼ has transformed a disjoint union of three closed intervals (a 1-manifold with boundary) intoa star-like shape with three branches (a non-manifold space), as illustrated in Figure A.12.With this formalism, the geometric realization of an abstract simplicial complex, called a sim-153A.6. Geometric Realizations and Quotient Spacesplicial complex (i.e., not abstract), can be easily dened as a disjoint union of points, segments,triangles, and n-dimensional triangles that are glued together by identifying their common bound-aries with a well-chosen equivalence relation. The reverse viewpoint can also be taken: given apossibly non-manifold topological spaceX (in a sense, “already glued”), and a decomposition ofXinto subsets homeomorphic to points, interior of segments, interior of triangles, and interior of n-dimensional satisfying a few properties on their boundaries, then it is called a simplicial complex,and its corresponding abstract simplicial complex can be dened.v1 e1 v2e2fFigure A.13: The space Fig-ure A.8 can be seen as a CW com-plex obtained by gluing together twopoints, two closed intervals and onedisk. The double-arrows representthe equivalence relation for the glueoperation.Similarly, CW complexes can be dened either as we did (i.e., “LetX be a topological space. If there exists a cell-decomposition Csuch that there exists functions Φc satisfying [...], then (X, C) iscalled a CW complex”), or by building them, via the explicit de-nition of characteristic maps Φc gluing disjoint n-disks together.For instance, the space in Figure A.8 is homeomorphic to a CWcomplex that can be built explicitly as follows. We rst deneX as the disjoint union of two points v1 and v2 (0-cells), twoclosed intervals e1 and e2 (1-cells, parameterized as [−1, 1]), andone disk f (2-cell, whose boundary is parameterized [0, 2pi)). Wethen dene Φe1(−1) = v1, Φe1(1) = v2, Φe2(−1) = v2, Φe2(1) = v2, Φf (θ = 0) = v2, andΦf (θ ∈ (0, 2pi)) = θpi − 1 ∈ e2. From these characteristic maps, an equivalence relation ∼ canbe dened, identifying each point in the boundary of each n-cell to a point of a k-cell, k < n, asillustrated in Figure A.13. Quotienting X by this equivalence relation gives the nal CW complexY = X/ ∼.The geometric realization of a polygonal presentation, informally described in Section A.4, is alsoformally dened via quotient spaces. Each word of size k denes a regular polygon with k edges,and points in the boundary of each polygon are identied to each other via the symbols in thewords. This denes an equivalence relation, which subsequently denes the geometric realizationas a quotient space.To summarize, a polygonal presentation is a combinatorial structure from which can be dened atopological space using quotient spaces. An abstract simplicial complex is a combinatorial struc-ture from which can be dened a topological space using quotient spaces. Finally, a CW complex isa topological space that can be dened using quotient spaces. However, CW complexes cannot bedescribed combinatorially because the quotient spaces are dened via continuous functions, notusing a combinatorial structure. This makes them very inconvenient to implement on a computer.On the contrary, our concept of PCS complex that does have a combinatorial description (calledabstract PCS complex).154A.7. Immersions vs. Embeddings0 1 2 3 4 5 6 7-0.500.51-1Figure A.14: The continuous mapping Φ :[0, 4pi] → R2 dened as Φ(t) = (sin(t) +0.5t, cos(t)) is an immersion. However, since thecurve is self-intersecting, the mapping is not injectiveand hence Φ is not an embedding.Figure A.15: Two immersions of the Klein bottle inR3. Both immersions intersect themselves in a closedcurve whose preimage consists of two loops. Imageand caption inspired from [Edelsbrunner and Harer2010].A.7 Immersions vs. EmbeddingsIn this dissertation, the term map is used to denote a continuous function Φ : X 7→ Y betweentwo topological spaces X and Y . Alternatively, we also use the term immersion, and we say thatX is immersed in Y by Φ. In addition, if Φ is injective then it is called an embedding, and we saythat X is embedded in Y by Φ. Intuitively, an embedding is an immersion that does not produceself-intersections, as illustrated in Figure A.14.If the space Y is too low dimensional, there may not exist an embedding of X into Y . Classicalexamples are non-orientable surfaces without boundary, such as the Klein bottle, that can be em-bedded in R4 but not in R3. Hence, if S is an abstract simplicial complex representing a Kleinbottle, and X = |S| is a geometric realization of S , then every mapping from X to Y = R3 willproduce self-intersections, as illustrated in Figure A.15.Combinatorial structures have the advantage to enable dening an immersion of their geomet-ric realization (and hence making possible to visualize it and manipulate it in 2D or 3D), withoutactually constructing the geometric realization itself that would require additional dimensions.This is actually very standard in 3D polygon modeling: a Klein bottle can be easily modeled withany triangle mesh structure supporting non-orientable meshes. This will result in intersections ofsome triangles, but these intersections are not tracked and the intersecting triangles just ignoreeach others, which is the behavior that modeling artists expect. We use exactly the same conceptfor our vector graphics complexes: instead of working with an embedding, like planar maps do,we work with an abstract combinatorial structure that is immersed in R2. There is no need toexplicitly construct the geometric realization of a vector graphics complex, which may require 3or 4 dimensions, since the combinatorial structure is enough to characterize this geometric real-ization.155Appendix BNon-Combinatorial Definition ofPCS ComplexesIn Chapter 3, we dened a combinatorial structure called abstract PCS complex, from which wedened the concept of PCS complex as a geometric realization. In this Appendix, we proposean alternative denition of PCS complexes, directly dened as a cell decomposition of an existingtopological space, similarly to how we dened CW complexes in Appendix A. This allows to bettercompare PCS complexes and CW complexes, and also provides some insight on the concept ofabstract PCS complex.This Appendix is organized as follows. First, in Section B.1, we dene a concept of cell complex forarbitrary dimension, dierent from the one used for CW complexes, and in Section B.2 we provea few properties of this complex. In Section B.3, we provide a comparison between our concept ofcell complex and the one used for CW complexes. Finally, in Section B.4, we dene a PCS complexas a cell complex of dimension at most two, and we exhaustively characterize all possible types ofvertices, edges, and faces, and how they are allowed to be glued together. This characterization ismuch less compact than the original denition, but looks more similar to the denition of abstractPCS complexes and therefore provides a link between the two denitions. Finally, in Section C,we show that the class of topological spaces decomposable as a PCS complex is equal to the classof topological spaces decomposable as a two-dimensional simplicial complex.B.1 Cell ComplexThroughout this Appendix, a topological space means a Hausdor topological space, and an n-manifold means a topological n-manifold with boundary.Cell An n-cell c is dened as a topological space homeomorphic to the interior of a connectedcompact n-manifold. The dimension of c is dim c = n. A cell is an n-cell for some n. For n = 0,1, and 2, we call them vertices, edges and faces.156B.1. Cell ComplexCell decomposition Let X be a topological space. A cell decomposition C of X is a nite col-lection of disjoints cells ci such that X =⋃i ci. The n-skeleton Xn of X (resp. the n-skeletonsetCn of C) is the union (resp. the set) of all the k-cells of C such that k ≤ n. The smallest n such thatXn = X is called the dimension of (X, C).Pointsets and set of pointsets We will often refer to objects that are either pointsets or setsof pointsets, and it is important not to confuse them. For instance, X is a pointset, a cell c is asubset of X and hence is also a pointset (a set of points p ∈ X). A union of cells is also a pointset.However, a set of cells, such as C, is not a pointset but a set of pointsets. A subset C′ ⊂ C isalso a set of pointset. If ci are pointsets, and Cj are sets of pointsets, we introduce the notationc′ =< c1, . . . , ck, C1, . . . , Cm > to conveniently dene c′ as the pointset obtained by the union ofthe pointsets ci and of the pointsets in the sets Cj . For instance, < c1, c2 >= c1 ∪ c2, < C >= X ,and < Cn >= Xn.Closure and boundary The closure of a cell c ∈ C, denoted c, is the closure of c in X . Theboundary of a cell c ∈ C, denoted ∂c, is dened as the set dierence c \ c. An edge whoseboundary is empty is called a closed edge, otherwise it is called an open edge.Cell complex Let X be a topological space and C be a cell decomposition of X . The pair K =(X, C) is called a cell complex if and only if, for each n-cell c ∈ C, there exists a connected compactn-manifoldMc and a map Φc : Mc → X satisfying the following cell complex constraints:• The restriction of Φc to int(Mc) is a homeomorphism from int(Mc) to c.• For each connected component Bc,i of ∂Mc, either:1. there exists a cell decompositionDc,i ofBc,i such that for all dc,i,j ∈ Dc,i, the restrictionof Φc to dc,i,j is a homeomorphism from dc,i,j to a cell ec,i,j ∈ C, or2. the image of Bc,i by Φc is a single vertex vc,i ∈ C, or3. the boundary component Bc,i is homeomorphic to S1, it is mapped by Φc to a singleclosed edge ec,i ∈ C, and the restriction of Φc to Bc,i “wraps Nf,i times around ec,i”,for some Nf,i ∈ N+.In other words, Φc must be a “homeomorphism by part” from cells decomposing Mc to cells of C(case 1.), with the rst exception that a connected component of ∂Mc is allowed to shrink to a singlevertex (case 2.), and the second exception that a connected component of ∂Mc homeomorphic toS1 is allowed to be mapped to a closed edge by wrapping around it several times (case 3.). Weillustrate these cases in Figure B.1, and formalize below what we mean by “wrapsNf,i times aroundec,i”.157B.1. Cell ComplexX =Bc,iec,i,j ∈ CX = X =Bc,ivc,i ∈ CBc,iec,i ∈ C1. Homeomorphic by part 2. Shrink to a vertex 3. Wrap around a closed edgeFigure B.1: The three possible “gluing conditions” that each connected component Bc,i of the boundary ofeach cell c must satisfy. We illustrate them for dim c = 2, since it is the dimension for which they have beendesigned. Top: How each connected component of the boundary of the characteristic manifold is glued to cellsof lower dimension. Bottom: The actual, glued topological space X . In terms of abstract PCS complex, thesethree cases correspond to the three types of cycle. From left to right: non-simple cycle, Steiner cycle, and simplecycle.Wrapping circles around circles Let A and B be two spaces homeomorphic to the circle S1.We say that a map Φ : A → B wraps N > 0 times around B if and only if there exist twohomeomorphisms ΦA : A→ S1 and ΦB : B → S1 such that:Φ = Φ−1B ◦WN ◦ ΦA (B.1)where, by using the usual parameterization θ ∈ [0, 2pi) of S1, WN : S1 → S1 is the continuousmap dened by:WN (θ) = Nθ (B.2)Characteristic objects The connected compact n-manifold Mc is called the characteristicmanifold of c, and the map Φc is called the characteristic map of c.Cell neighborhood We dene the boundary cells of c as the set Bc of all ec,i,j , vc,i, and ec,i.The star of a cell c ∈ C is dened as the set of cellsSc = {c′ ∈ C | c ∈ Bc′}. (B.3)Dimension The dimension of a cell complex is dened as the dimension of its cell decomposi-tion. A cell complex of dimension n is also called an n-complex for conciseness.158B.2. Relation Between ∂c and Bc, Compactness, and SubcomplexesB.2 Relation Between ∂c and Bc, Compactness, andSubcomplexesFor the sake of completeness and comparison with CW complexes, we formally prove in this sec-tion a few immediate properties that cell complexes (in a PCS sense) satisfy, for arbitrary dimen-sion. The reader not familiar with CW complexes may safely skip this section. Let (X, C) be a cellcomplex. Then we have:Lemma 1. ∀c ∈ C, Bc ⊆ Cn−1, where n = dim c.Proof. If n = 0, then Mc is a singleton and ∂Mc = ∅ so there are no Bc,i hence no vc,i, ec,i, orec,i,j and Bc = ∅. Let n ≥ 1. Since dim vc,i = 0, then dim vc,i ≤ n− 1 and vc,i ∈ Cn−1. The casewhere Bc contains a cell of type ec,i can only occur when n ≥ 2, so we also have ec,i ∈ Cn−1. Sincedc,i,j is a cell of Bc,i and that Bc,i is a compact (n − 1)-manifold, we have dim dc,i,j ≤ n − 1. Inaddition, dim ec,i,j = dim dc,i,j since Φc restricts to a homeomorphism from dc,i,j to ec,i,j , hencedim ec,i,j ≤ n− 1 and ec,i,j ∈ Cn−1.Lemma 2. ∀c ∈ C, Φc(∂Mc) =< Bc >.Proof. We have ∂Mc =⋃i Bc,i, hence Φc(∂Mc) =⋃i Φc(Bc,i). The image of Bc,i is either a singlevertex vc,i (case 2.), a closed edge ec,i (case 3.), or Bc,i =⋃j dc,i,j (case 1.) in which case Φc(Bc,i) =⋃j Φc(dc,i,j) =⋃j ec,i,j . Hence, Φc(∂Mc) =< . . . , vc,i, . . . , ec,i,j , . . . , ec,i, · · · >=< Bc >.Lemma 3. ∀c ∈ C, c = Φc(Mc).Proof. If Φ : X → Y is a map and X ′ ⊆ X , then Φ(X ′) ⊆ Φ(X ′). Thus in our case:Φc(Mc) = Φc(int(Mc)) ⊆ Φc(int(Mc)) = c.In addition, Φc(Mc) is compact as a continuous image of a compact, thus Φc(Mc) is closed inX since X is Hausdor. Considering that c is dened as the intersection of all closed set in Xcontaining c, that Φc(Mc) contains c, and that Φc(Mc) is closed in X , it proves that c ⊆ Φc(Mc).Hence, we proved that Φc(Mc) ⊆ c ⊆ Φc(Mc) thus c = Φc(Mc).Lemma 4. ∀c ∈ C, c =< c, Bc >.Proof. c = Φc(Mc) = Φc(int(Mc) ∪ ∂Mc) = Φc(int(Mc)) ∪ Φc(∂Mc) = c∪ < Bc >.Proposition 1. ∀c ∈ C, ∂c =< Bc >.Proof. ∂c = c\ c =< c, Bc > \c =< Bc > since Bc ⊆ Cn−1 and dim c = n thus c /∈ Bc.159B.3. Comparison with CW ComplexesProposition 2. X is compact.Proof. ∀c ∈ C, c ⊆ c and c ⊆ X thus X = (⋃c∈C c) ⊆ (⋃c∈C c) ⊆ X . Hence, all inclusions areequalities, and X is compact as a nite union of compacts.Proposition 3. ∀c ∈ C, ∂c is compact and closed in X .Proof. The boundary of a compact manifold is compact, hence ∂Mc is compact, and then Φc(∂Mc) =< Bc >= ∂c is compact. Thus, it is closed in X since X is Hausdor.Proposition 4. ∀c ∈ C, (∂c,Bc) is a cell complex.Proof. ∂c =< Bc > hence Bc is a cell decomposition of ∂c. Let c′ ∈ Bc, and n′ = dim c′. Theexistence of a manifoldMc′ , a map Φc′ : Mc′ → X , decompositionsDc′,i ofMc′ and cells vc′,i ∈ C,ec′,i ∈ C, and ec′,i,j ∈ C comes directly from the fact that (X, C) is a cell complex. We only needto verify that Φc′ : Mc′ → ∂c (instead of X) and that vc′,i ∈ Bc, ec′,i ∈ Bc and ec′,i,j ∈ Bc (insteadof C).We know that c′ ∈ Bc, thus c′ ⊆ ∂c, thus c′ ⊆ ∂c (because ∂c is closed inX), thus Φc′ : Mc′ → ∂c(because Φc′(Mc′) = c′). In addition, the cells vc′,i, ec′,i and ec′,i,j are images of restrictions of Φc′thus are subsets of Φc′(Mc′), thus are subset of ∂c, hence are elements of Bc.Corollary 1. ∀c ∈ C, (c, {c} ∪ Bc) is a cell complex.Proof. We are just adding c to the complex above, and we know that Φc : Mc → c, as well as thecells vc′,i, ec′,i,j and ec′,i are in {c} ∪ Bc since they are by denition in Bc.Proposition 5. ∀c ∈ C, if c′ ∈ Bc then Bc′ ⊆ Bc. In other words, the relation “c′ is in the boundaryof c” is transitive:( c′′ ∈ Bc′ ∧ c′ ∈ Bc ) ⇒ c′′ ∈ BcProof. If c′ ∈ Bc then c′ ⊆ ∂c. Hence, c′ ⊆ ∂c since ∂c is closed, from which it follows that∂c′ ⊆ ∂c since ∂c′ = c′\c′. Thus < Bc′ >⊆< Bc >, thus Bc′ ⊆ Bc.B.3 Comparison with CW ComplexesOur denitions of cell, cell decomposition and cell complex dier from the ones of CW complexes,thus there are a few dierences that are worth noting. In this section, we use the terms PCS-cell,PCS-cell decomposition and PCS-cell complex to refer to our denition (for arbitrary dimension),while we use the terms CW-cell, CW-cell decomposition and CW-cell complex for the classicaldenition.160B.3. Comparison with CW Complexesv1v2efX = S2 ∪ {(1, t, 0) | t ∈ [−1, 1]}valid CW complexinvalid PCS complexv1v2e1fv3e2valid CW complexvalid PCS complexv1 = {(1, 1, 0)}v3 = {(1, 0, 0)}e = {(1, t, 0) | t ∈ (−1, 1)}f = S2 \ {(1, 0, 0)}e1 = {(1, t, 0) | t ∈ (0, 1)}v2 = {(1,−1, 0)}e2 = {(1, t, 0) | t ∈ (−1, 0)}Figure B.2: Left: Counter-example showing thatProposition 1 is not true for CW complexes: ∂f is notequal to any union of other cells, but only “included”in such a union (e.g., ∂f = {(1, 0, 0)} ⊂ e). Right:A valid PCS decomposition of X requires adding theadditional vertex v3 splitting e into e1 and e2.Bf,1Mfvalid CW complexinvalid PCS complexvalid CW complexvalid PCS complexv1v4v2v3e3e4e1e2v1v4v2v3e3e4e1e2v5v6e5e6ffFigure B.3: Top-left: The boundary of a CW faceis allowed to do “switch-backs” within an edge. Top-right and bottom: A valid PCS decomposition of Xrequires the additional vertices v5 and v6 so thatΦf (Bf,1) is homeomorphic by part from vertices andedges decomposing Bf,1 to vertices and edges of C.An n-CW-cell is a specic case of n-PCS-cell, since an n-CW-cell is homeomorphic to int(Dn),and that Dn is a connected compact n-manifold. Likewise, a nite CW-cell decomposition is aspecic case of a PCS-cell decomposition. Note that PCS-cell decompositions are enforced to benite, while CW-cell decompositions can be innite.However, a nite CW-cell complex is not necessarily a PCS-cell complex. Indeed, even though thedenition of PCS-cells is more general than CW-cells, the “gluing conditions” that PCS-cells mustsatisfy to dene a PCS-cell complex are stricter than those for CW-cell complexes. Indeed, wereplaced Φc(∂Mc) ⊆ Xn−1 by a stricter version imposing, for each connected component Bc,i of∂Mc, that Φc(Bc,i) is either homeomorphic by part from PCS-cells decomposing Bc,i to PCS-cellsof C (case 1.), or maps Bc,i to a single vertex (case 2.), or, if Bc,i ∼= S1, wraps it around a closed edge(case 3.). In other words, CW-cells have very little restrictions on how their boundaries are glued tocells of lower dimension, while the boundary of our PCS-cells must be glued to lower dimensionalcells in very specic ways. For instance, the boundary of a PCS-face cannot be mapped into a strictsubset of an edge (cf. Figure B.2), or do “switch-backs” in the interior of an edge (cf. Figure B.3).This imposes a cleaner incidence structure as illustrated by Proposition 1, which is not true for161B.4. PCS ComplexFigure B.4: A valid 1-complex. It can be seen as an extension of multigraph to support closed edges.CW-cell complexes (indeed, there may not exist Bc ⊆ Cn−1 such that ∂c =< Bc >, a counter-example being Figure B.2). This regularity is what makes possible to describe combinatorially aPCS-cell complex. Note that this regularity is still less strict than the notion of regular CW complex[Hatcher 2001, p. 534], which is too strict to provide uniqueness of a minimal complex.B.4 PCS ComplexA PCS complex is dened as a cell complex of dimension at most two. Hence, its cells are eithervertices, edges, or faces. In this section, we analyze in depth what the general denition of cellcomplex means for each type of cells in a PCS complex, which allows us to provide a detailed char-acterization of them. This characterization can be seen as an alternate, less compact denition ofPCS complex, which provides the link between PCS complexes and abstract PCS complexes.Vertices Vertices are 0-cells, i.e. pointsets homeomorphic to the interior of a connected compact0-manifold. Up to homeomorphism, there exists only one connected compact 0-manifold:• V: the singleton R0 = {0} whose interior is R0 and boundary is ∅.Hence, a pointset v is a vertex if and only if it is a singleton, in which case its characteristic manifoldis Mv = V.Since ∂V = ∅, a vertex automatically satises the cell complex constraints. Therefore, cell com-plexes of dimension 0 are nite sets X . They admit a unique cell decomposition C = {{x}, x ∈X}.Edges Edges are 1-cells, i.e. pointsets homeomorphic to the interior of a connected compact1-manifold. Up to homeomorphism, there exist only two connected compact 1-manifolds:• E|: the segment D1 = [0, 1] whose interior is (0, 1) and boundary is {0, 1}.• E◦: the circle S1 whose interior is S1 and boundary is ∅.162B.4. PCS Complexcells must be manifold pointsets cells must be disjointcells must beconnected pointsetsopen edges musthave end verticesvalidinvalidee1e2e3v1e′e′′e4e5 e6v2e7e8v3ee′e1e2e3e4e e′e1e2 e3e4ve e′e′′e1v1v2e2e3e′′v3Figure B.5: Invalid 1-complexes (top), and how to make them valid (bottom).Hence, a pointset e is an edge if and only if it is homeomorphic to (0, 1) or S1. In the rst case, itis called an open edge and its characteristic manifold is Me = E|. In the second case, it is called aclosed edge and its characteristic manifold is Me = E◦.Since ∂E◦ = ∅, a closed edge e automatically satises the cell complex constraints. Let e be anopen edge. Its characteristic manifold E| = [0, 1] has a non-empty boundary ∂E| = {0, 1} madeof two connected components Be,start = {0} and Be,end = {1}. For each Be,i, the two cases 1. and2. of the cell complex constraints are equivalent to:∃ve,i ∈ C, Φe(Be,i) = ve,i. (B.4)The case 3. does not apply since Be,i is not homeomorphic to S1. Therefore, a decomposition ofX into a nite disjoint union of vertices and edges is a cell complex of dimension 1 if and only if:for all open edge e ∈ C,there existΦe : [0, 1]→ X continuousve,start ∈ Cve,end ∈ Csuch thatΦe : (0, 1)→ e homeomorphismΦe(0) = ve,startΦe(1) = ve,end(B.5)This is illustrated in Figure B.4. Invalid cell complexes of dimension 1 are illustrated in Fig-ure B.5.163B.4. PCS Complexvf,i,1Nf,i = 0 Nf,i ≥ 1Nf,i vertices vf,i,j1 closed edge ef,i,1 Nf,i open edges ef,i,jef,i,1 ef,i,Nf,ivf,i,1vf,i,Nf,ivf,i,2vf,i,3vf,i,4ef,i,1ef,i,2ef,i,3Figure B.6: The only possible cell decompositions Df,i of a boundary component Bf,i of F,g,k .Faces Faces are 2-cells, i.e. pointsets homeomorphic to the interior of a connected compact 2-manifold. Up to homeomorphism, there exist only three “kinds” of connected compact 2-manifolds(cf. Section A.4):• F,0,k: the sphere with k holes.• F,g,k: the connected sum of g ≥ 1 tori with k holes.• F6,g,k: the connected sum of g ≥ 1 projective planes with k holes.Hence, a pointset f is a face if and only if it is homeomorphic to the interior of one of the abovemanifolds. More formally, f is a face if and only if there exist ∈ {, 6}, g ∈ N and k ∈ N suchthat f ∼= int(F,g,k), in which case it is called an (, g, k)-face and its characteristic manifold isMf = F,g,k. All these characteristic manifolds are illustrated in Figure A.3 (right).Now, let us characterize how the boundary components Bf,i of a face f are allowed to be gluedto vertices and edges. First, since Mf is a compact 2-manifold, we know that Bf,i is a compact1-manifold without boundary, i.e. Bf,i ∼= S1. This means that the three cases of the gluing con-straints (cf. Figure B.1) have to be considered, and are not equivalent. The cases 2. and 3. do notneed further analysis. However, let us explicit what the case 1. means for faces, i.e. let us expandthe denition in the specic case where Bf,i ∼= S1. Let us start by the following lemma, illustratedin Figure B.6:Lemma 5. Let Df,i be a cell decomposition of Bf,i, and let Nf,i be the number of vertices in Df,i.• If Nf,i = 0, then Df,i = {Bf,i}, i.e. the decomposition is a single closed edge.• If Nf,i ≥ 1, then Df,i is decomposed into Nf,i vertices and Nf,i open edges.Proof. By denition, Df,i is a nite collection of disjoint cells df,i,j such that Bf,i =⋃j df,i,j .Since Bf,i ∼= S1, it can only involve vertices and/or edges. Let N (v)f,i be the number of vertices andN(e)f,i the number of edges.164B.4. PCS ComplexBounded double cone Rectangle glued to sphereve1 e2f1 f2ve1 e2Mf1 = F,0,2 Mf2 = F,0,2f1f2v1v2 v3v4e1e2e3e4Mf2 = F,0,1Mf1 = F,0,1Figure B.7: Two examples of valid PCS complexes. Top: The topological space X and its PCS decomposition.Bottom: Characteristic manifolds of the faces, and how their boundary components are glued to the 1-skeleton.• Let assume N (v)f,i = 0. Hence, Bf,i is a nite disjoint union of edges. Since Bf,i is compact,but open edges are not compacts (thus a nite union of open edges is not compact either),there exists at least an edge e in Df,i that is a closed edge. However, the only closed 1-manifold included in S1 is S1 itself, thus N (e)f,i = 1 and Df,i = {e}.• Let assume N (v)f,i ≥ 1, and let vf,i,j be the N (v)f,i vertices of Df,i. By xing θ ∈ [0, 2pi) aparameterization of Bf,i, each vertex vf,i,j corresponds to a unique θf,i,j , and we assumeθf,i,1 < θf,i,2 < · · · < θf,i,N(v)f,i, without loss of generality. Let ef,i,j be the pointset(θf,i,j , θf,i,j+1) ⊂ Bf,i. Since ef,i,j contains no vertices of Df,i, then ef,i,j is included ina disjoint union of edges in Df,i. None of them can be a closed edge, because it wouldcontradict N (v)f,i ≥ 1 (see bullet above: if Df,i contains a closed edge e then Df,i = {e},thus N (v)f,i = 0). Hence, ef,i,j is included in a disjoint union of m open edges in Df,i. Be-sides, it can be shown that a disjoint union of m ≥ 2 open edges in S1 is a disconnectedset, the connected components being the m open edges. Therefore, since ef,i,j is a con-nected set, ef,i,j is actually included in a single open edge e ∈ Df,i. In addition, we knowthat e contains neither θf,i,j nor θf,i,j+1 (since the cells of Df,i are disjoint). In conclusion,ef,i,j = (θf,i,j , θf,i,j+1) is included in e, e is connected, and e contains neither θf,i,j norθf,i,j+1, therefore e = ef,i,j = (θf,i,j , θf,i,j+1). This proves that the ef,i,j are actually openedges of Df,i. In addition, since the union of the vf,i,j and ef,i,j is equal to Bf,i, it provesthat there are no other cells inDf,i. In conclusion, N (e)f,i = N (v)f,i , andDf,i is a disjoint unionof N (v)f,i vertices and N(v)f,i open edges.165B.4. PCS ComplexFigure B.8: More examples of valid PCS complexes. Is has to be imagined embedded in R4, i.e. with no“self-intersection” of the Klein bottle or the sphere with three holes glued together.Using the above lemma, the cell complex constraints for a face f ∈ C can be rewritten to:• Case 1a (Nf,i = 0): Bf,i is mapped homeomorphically by Φf to a single closed edge ef,i ∈ C,or• Case 1b (Nf,i ≥ 1): Bf,i is decomposed into Nf,i ≥ 1 vertices, each mapped by Φf to avertex vf,i,j ∈ C, and Nf,i open edges, each mapped homeomorphically by Φf to an openedge ef,i,j ∈ C, or• Case 2: Bf,i is mapped by Φf to a single vertex vf,i ∈ C, or• Case 3: Bf,i is mapped by Φf by being wrapped Nf,i times around a closed edge ef,i ∈ C.Finally, we can observe that Case 1a. is already taken into account by Case 3. (wrapping onetime around a closed edge), and therefore can be ignored. These three cases are illustrated inFigure B.1.By combining all the information that we have shown, we are nally able to provide a characteri-zation of PCS complexes: a decomposition of X into a nite disjoint union of vertices, edges andfaces is a PCS complex if and only if (see next page):166B.4. PCS ComplexFor all open edge e ∈ C,there existΦe : [0, 1]→ X continuousve,start ∈ Cve,end ∈ Csuch thatΦe : (0, 1)→ e homeomorphismΦe(0) = ve,startΦe(1) = ve,endAnd for all (, g, k)-face f ∈ C,there existΦf : F,g,k → X continuousa partition of [1..k] into If,1, If,2 and If,3∀i ∈ If,1,Nf,i ∈ N, Nf,i ≥ 1∀j ∈ [1..Nf,i], vf,i,j vertex of C∀j ∈ [1..Nf,i], ef,i,j open edge of C∀i ∈ If,2,{vf,i vertex of C∀i ∈ If,3,{Nf,i ∈ N, Nf,i ≥ 1ef,i closed edge of Csuch thatΦf : int(F,g,k)→ f homeomorphism∀i ∈ If,1, ∀j ∈ [1..Nf,i],{Φf (vf,i,j) = vf,i,jΦf : ef,i,j → ef,i,j homeomorphism∀i ∈ If,2, Φf (Bf,i) = vi,f∀i ∈ If,3, Φf : Bf,i → ef,i wraps Nf,i times around ef,iwhereBf,i is the i-th boundary component of F,g,kand {. . . ,vf,i,j , . . . , ef,i,j , . . . } is adecomposition of Bf,i into Nf,i vertices andNf,i open edges, ordered clockwise or counter-clockwise.(B.6)This is, for the case of the dimension 2, an equivalent formulation of the cell complex constraintsdescribed in Section B.1. It is much less compact and does not scale in dimension, but exhaustivelydescribes the dierent types of cells involved and how they can be glued together. Examples ofvalid PCS complex are given in Figure B.7 and B.8. By comparing this characterization and thedenition of abstract PCS complexes (see Section 3.3.1), one can notice that they are in correspon-dence, and deduce the equivalence between the two denitions.167Appendix CEquivalence between PCS-Decomposable and2-Triangulable Spaces(a) (b) (c) (d) (e)MfBf,iM′fB′f,iCase 1. Case 2. Case 1. Case 2.Figure C.1: Steps in the construction of the mixed triangulation-quadrangulation of Mf , from the proof ofProposition 7.In this section, we show that the class of topological spaces that can be decomposed as a PCScomplex is the same as the class of topological spaces that admits a 2-triangulation. This showsthat PCS complexes are able to represent any “reasonable” two-dimensional object.Proposition 6. A topological space that admits a 2-triangulation can be decomposed as a PCS com-plex.Proof. This proposition comes directly from the observation that a 2-triangulation of a space X isin fact also a valid PCS decomposition. Indeed, a 0-simplex is a PCS vertex, a 1-simplex is a PCSopen edge, and a 2-simplex is a PCS face whose characteristic manifold is F,0,1 (the sphere withone hole), with its unique boundary component Bf,1 decomposed into three vertices and threeopen edges, each mapped homeomorphically to vertices and open edges.Proposition 7. A topological space that can be decomposed as a PCS complex admits a 2-triangulation.Proof. To prove this statement, we provide an explicit construction of the triangulation. Let K =(X, C) be a PCS complex. Without loss of generality, we assume that C does not contain anyclosed edge. Indeed, any valid PCS decomposition (X, C) can be preliminary turned into a validPCS decomposition (X, C′) that does not contain closed edges, by partitioning every closed edgeof C into an open edge and a vertex. Now, let us start the construction of the triangulation:168Appendix C. Equivalence between PCS-Decomposable and 2-Triangulable Spaces• The vertices in C are 0-simplices of the triangulation.• The open edges in C are all split into three 1-simplices and two 0-simplices.These two rst steps have constructed a valid 1-triangulation of the 1-skeleton ofX . Splitting eachedge in three is necessary to ensure that each 1-simplex has a dierent start and end 0-simplex, andthat any given pair of 0-simplices is connected by at most one 1-simplex. Now, let us triangulatethe faces:• Let f be a face in C.• Let Mf be the characteristic manifold of f , Φf be the characteristic map, and Bf,i ∼= S1 bethe boundary components of Mf .• Let M′f be a compact submanifold of Mf obtained by “osetting by a small amount” theholes of Mf (cf. Figure C.1(b)). We call B′f,i the boundary components of M′f .• For each boundary component Bf,i mapped by Φf to vertices and open edges (Case 1., i.e.when i ∈ If,1 from the characterization Eq. B.6), we 1-triangulate Bf,i by using the pre-image by Φf of the previously constructed 1-triangulation of ∂f (cf. Figure C.1(c), left hole).This 1-triangulation has 3Nf,i 0-simplices, and the same number of 1-simplices.• For each boundary component Bf,i mapped by Φf to a single vertex (Case 2.), we arbitrarily1-triangulateBf,i using three 0-simplices, and three 1-simplices (cf. Figure C.1(c), right hole).We note that Case 3. can be ignored since C does not contain any closed edge.• For each boundary component Bf,i in Case 1., we arbitrarily 1-triangulate B′f,i using 3Nf,i0-simplices and 3Nf,i 1-simplices. Then, we 2-triangulate the topological cylinder betweenBf,i and B′f,i using the pattern illustrated in Figure C.1(d), left hole.• For each boundary component Bf,i in Case 2., we arbitrarily 1-triangulate B′f,i using three0-simplices and three 1-simplices. Then, we quadrangulate the topological cylinder betweenBf,i and B′f,i using the pattern illustrated in Figure C.1(d), right hole.• Finally, we 2-triangulateM′f by preserving the existing 1-triangulation of its boundary, thatwe know is possible since M′f is a compact 2-manifold (cf. Figure C.1(e)).• At this stage of the construction, we have obtained a mixed triangulation-quadrangulationT of Mf . To conclude the construction, we dene the triangulation of f to be the image ofT by Φf .The reader can verify that the quads of Mf become triangles of f since in Case 2., Bf,i shrinksto a single vertex. Also, due the homeomorphism properties of Φf , the triangles stay triangles,no 1-simplex of f has its start 0-simplex equal to its end 0-simplex, and no pair of 0-simplices169Appendix C. Equivalence between PCS-Decomposable and 2-Triangulable Spacesare connected by 2 or more 1-simplices (this is guaranteed by the specic triangle pattern chosenaround Bf,i for Case 1.). Therefore, by performing this process for all faces, we obtain a valid2-triangulation of X .170Appendix DTopological Operators on PCS ComplexesIn this appendix, we detail topological operators acting on PCS complexes. More precisely, we pro-vide algorithms on abstract PCS complexes that correspond to well-dened geometric operationson (non-abstract) PCS complexes. For example, the cut operator is geometrically dened as parti-tioning an existing cell into several cells, and we use this denition to classify all the dierent typesof cuts that are possible (for example, cutting a Möbius strip along an edge may either disconnectit or not, depending on the geometry of the edge). The concept of PCS complex was necessary toinfer the combinatorial algorithms from the geometric denitions of operators, but the algorithmsthemselves can be used on both abstract PCS complexes and vector graphics complexes.D.1 NotationsVertices We use the notation v to refer to a vertex, and the notation V to refer to the set of allvertices.Open edges We use the notation e| to refer to an open edge, or simply e when it is clear fromthe context that the edge is open. We denote by E| the set of all open edges. Sometimes we usethe abuse of notation e = (vstart, vend) to dene or refer to an edge e whose ordered boundary is∂̂e = (vstart, vend).Closed edges We use the notation e◦ to refer to a closed edge, or simply e when it is clear fromthe context that the edge is closed. We denote by E◦ the set of all closed edges.Edges We use the notation e to refer to an edge that can be either open or closed, and we denoteby E = E| ∪ E◦ the set of all edges.Halfedges We use the notation h = (e, β), with β ∈ {>,⊥}, to refer to or dene a halfedgethat can be either open or closed. We use the notation h◦ to refer specically to a closed halfedge,and the notation h| to refer specically to an open halfedge. Similarly, we denote by H| the setof all open halfedges, by H◦ the set of all closed halfedges, and by H = H| ∪ H◦ the set of all171D.1. Notationshalfedges. Finally, we use the notation e(h) and β(h) to refer to the rst and second componentsof the pair dening the halfedge.Steiner cycles We use the notation γ• to refer to a Steiner cycle, or simply γ when it is clearfrom the context that we refer to a Steiner cycle. We use the notation Γ• to refer to the set of allpossible Steiner cycles. We use the notation v(γ•) to refer to the vertex that denes a Steiner cycle,and the following notation to refer to or dene a Steiner cycle together with its vertex v:γ• = [v] (D.1)Simple cycles We use the notation γ◦ to refer to a simple cycle, or simply γ when it is clearfrom the context that we refer to a simple cycle. We use the notation Γ◦ to refer to the set of allpossible simple cycles. We use the notations h◦(γ◦) and N(γ◦) to refer to the closed halfedge andinteger that dene a simple cycle. We also use the convenient notations e◦(γ◦) = e(h◦(γ◦)) andβ(γ◦) = β(h◦(γ◦)). Finally, we use the following notation to refer to or dene a simple cycletogether with its dening components:γ◦ = [h◦N ] = [(e◦, β)N ] (D.2)Non-simple cycles We use the notation γ+ to refer to a non-simple cycle, or simply γ whenit is clear from the context that we refer to a non-simple cycle. We use the notation Γ+ to referto the set of all possible non-simple cycles. We use the following notation to refer to or dene anon-simple cycle together with its dening open halfedges:γ+ = [h1, . . . , hN ] = [(e1, β1), . . . , (eN , βN )] (D.3)We conveniently refer to these objects byN(γ), hj(γ), ej(γ) and βj(γ), where j ∈ N is consideredmodulo N (e.g., h0(γ) is well-dened and refers to hN ). We use the notation vi(γ) = vend(hi(γ)).In particular, we have v0(γ) = vN (γ), and to conveniently visualize all the cells involved in anon-simple cycle, we use the notation:γ+ = [ •v0(e1, β1) •v1· · · •vN−1(eN , βN ) •vN] (D.4)Cycles We use the notation γ to refer to a cycle that can be Steiner, simple or non-simple.172D.2. Algebraic Operations on Halfedges, Paths and CyclesFaces We use the notation f to refer to a face. To conveniently refer to or dene a face f togetherwith its ordered boundary ∂̂f , we use the following abuse of notation:f = (, g, [γ1, . . . , γk]) (D.5)or simplyf = [γ1, . . . , γk] (D.6)when and g are irrelevant or clear from context. We conveniently refer to these objects by (f),g(f), k(f), and γi(f). It is possible that f = [ ], in which case f is a face without boundary (wedo not use a special notation for faces without boundary).D.2 Algebraic Operations on Halfedges, Paths and CyclesIn order to describe more conveniently the topological operators on abstract PCS complexes, werst introduce the notion of paths, and a few basic algebraic operations on halfedges, paths andcycles, which are: ipping a halfedge, a path, or a cycle; converting an open halfedge to a pathand a path to a cycle; concatenating paths to create a longer path; rotating a non-simple cycle; andextracting a subpath from a path or a non-simple cycle.D.2.1 PathsGiven an abstract PCS complex P , a path is dened as a triplet pi = (vstart, (hj)j∈[0..N ], vend) ∈Π = V ×H∗| × V satisfying the following constraints:• if N = 0 (i.e., the sequence (hj) is empty), then vstart = vend• if N > 0 (i.e., the sequence (hj) is not empty), then– vstart = vstart(h1)– ∀j ∈ [1..N − 1], vend(hj) = vstart(h(j+1))– vend(hN ) = vendIntuitively, a path starts at a given vertex vstart, then travels along N ≥ 0 edges ei with a givendirection βi, and nally ends its course at a vertex vend. IfN = 0, we conveniently use the notationpi = [v] instead of pi = (v, [ ], v). If N > 0, we conveniently use the notation pi = [h1, . . . , hN ]instead of pi = (vstart, [h1, . . . , hN ], vend), since the start and end vertices can be inferred fromthe halfedges. The integer N ∈ N is called the length of the path. While the notion of pathshares similarities with the notion of cycle (e.g., can be reduced to a single vertex), we note that173D.2. Algebraic Operations on Halfedges, Paths and Cyclesthe concept of “simple path” does not exist: a path necessarily starts and ends at given vertices(possibly equal), therefore it cannot contain closed edges. To better emphasize the dierencesbetween paths and cycles, we use the following terminology: if N = 0, we refer to the path as atrivial path (rather than a “Steiner path”); and if N > 0, we refer to the path as a non-trivialpath (rather than a “non-simple path”).D.2.2 Flipping Halfedges, Paths and CyclesGiven a halfedge h = (e, β), we dene its flipped halfedge as:h = (e, β), where β =⊥ if β = >> if β = ⊥ (D.7)Given a path pi = (vstart, [h1, . . . , hN ], vend), we dene its flipped path as:pi = (vend, [hN , . . . , h1], vstart) (D.8)Given a cycle γ, we dene its flipped cycle as:γ =[v] if γ = [v] is a Steiner cycle[h◦N ] if γ = [h◦N ] is a simple cycle[hN , . . . , h1] if γ = [h1, . . . , hN ] is a non-simple cycle(D.9)D.2.3 Converting Open Halfedges to Paths and Paths to CyclesAn open halfedge h can always be interpreted as a path pi of lengthN(pi) = 1, using the followingconversion:H| → Πh 7→ [h] = (vstart(h), [h], vend(h))(D.10)For conciseness, we will often omit the brackets and simply write h instead of [h] when it is clearfrom the context that we interpret h as a path.Similarly, a path satisfying vstart = vend can always be interpreted as a cycle (more specically, a174D.2. Algebraic Operations on Halfedges, Paths and CyclesSteiner cycle if N = 0 and a non-simple cycle if N > 0), using the following conversion:{pi ∈ Π | vstart = vend} → Γpi 7→ [pi) =[vstart] if N = 0[h1, . . . , hN ] if N > 0(D.11)For conciseness, we will often omit the brackets and parentheses and simply write pi instead of [pi)when it is clear from the context that we interpret pi as a cycle.D.2.4 Concatenating PathsGiven two paths pi = (vstart, [h1, . . . , hN ], vend) and pi′ = (v′start, [h′1, . . . , h′N ′ ], v′end) satisfyingvend = v′start, we dene the concatenation of pi with pi′ by:[pi, pi′] = (vstart, [h1, . . . , hN , h′1, . . . , h′N ′ ], v′end) (D.12)Since this operation is associative (i.e., [[pi, pi′], pi′′] = [pi, [pi′, pi′′]]), we conveniently omit the extrabrackets and simply write [pi1, . . . , pim] when concatenating more than two paths together. Also,since open halfedges can be interpreted as paths of length one, we extend the notation to con-catenate paths and halfedges, leading to expressions such as [pi1, (e,>), pi2, (e,⊥)]. If vstart(pi1) =vstart(e), this expression can subsequently be implicitly interpreted as a cycle, so we would simplywrite γ = [pi1, (e,>), pi2, (e,⊥)] instead of γ = [[[pi1, [(e,>)]], pi2], [(e,⊥)]]].In pseudocode, we will often use the wording “Append h to pi”, which means “pi ← [pi, h]”. Finally,we note that as per the denitions, concatenating with a trivial path is a null operation. Forinstance, if pi2 is trivial, then [pi1, pi2, pi3] = [pi1, pi3]. In other words, all trivial paths are neutralelements for the concatenation operation.D.2.5 Rotating Non-Simple CyclesIntuitively, we want a cycle to represent a “loop” made of consecutive halfedges, but we wouldlike the starting point of this loop to be irrelevant. However, in our denition, we dened a non-simple cycle as a sequence of halfedges [h1, . . . , hN ] which means that a rst halfedge h1 mustbe arbitrarily chosen among h1, . . . , hN . A negative consequence is that if h1 6= h2, then the twocycles γ1 = [h1, h2] and γ2 = [h2, h1] are mathematically dierent even though they intuitivelyrepresent the same cycle. To capture this intuitive notion, we dene the following equivalence175D.2. Algebraic Operations on Halfedges, Paths and Cyclesrelation between non-simple cycles:γ+1 ∼ γ+2 ⇔ ∃d ∈ N, ∀j ∈ [1..N ], hj(γ+1 ) = hj−d(γ+2 ) (D.13)In other words, two non-simple cycles γ+1 and γ+2 are equivalent if and only if γ+2 can be obtainedfrom γ+1 by choosing a dierent “starting point”, formally done via an operation called a rotation,dened by:Rotd : Γ+ → Γ+γ+ = [h1, . . . , hN ] 7→ Rotd(γ+) = [h(1+d) mod N , . . . , h(N+d) mod N ](D.14)Using this operation, the equivalence relation can be rewritten as:γ+1 ∼ γ+2 ⇔ ∃d ∈ N, γ+2 = Rotd(γ+1 ) (D.15)We extend the equivalence relation to all types of cycles by dening:• Two Steiner cycles γ•1 and γ•2 are equivalent i v(γ•1) = v(γ•2).• Two simple cycles γ◦1 and γ◦2 are equivalent i e◦(γ◦1) = e◦(γ◦2), β(γ◦1) = β(γ◦2), andN(γ◦1) = N(γ◦2)• Two cycles γ1 and γ2 of dierent nature (i.e., non-simple, Steiner or simple) are not equiva-lent.We note that while a more carefully crafted denition of cycles would avoid the need for such anequivalence relation, we would lose a lot of clarity and the convenience of referring to a halfedgevia its index. In addition, this simpler denition is closer to our actual implementation and hencehas a practical value. Finally, we also note that using a circular linked list instead of an indexedsequence does not avoid the theoretical and practical need for an equivalence relation, since thecircular linked list must still arbitrarily point to one element of the list, and hence testing for“logical equality” between two circular linked lists also requires to take into account rotations, inthis case simply achieved by pointing to a dierent element in the list.176D.3. Cell CreationD.2.6 Extracting Subpaths from Paths and Non-Simple CyclesGiven a path pi = (vstart, [h1, . . . , hN ], vend) and two indices jstart and jend satisfying 0 ≤ jstart ≤jend ≤ N , we dene the subpath pi′ = pi[jstart; jend] by:pi[jstart; jend] =[vstart] if jstart = jend = 0[vend(hjend)] if jstart = jend 6= 0[hjstart+1, . . . , hjend ] otherwise (i.e., if jstart < jend)(D.16)Given a non-simple cycle γ = [h1, . . . , hN ] and two indices jstart and jend, we dene the subpathpi′ = γ[jstart; jend] by:γ[jstart; jend] =[vend(hjend)] if jstart = jend[hjstart+1, . . . , hjend ] if jstart + 1 ≤ jend[hjstart+1, . . . , hN , h1, . . . , hjend ] if jstart + 1 > jend(D.17)where j = j mod N . The above formal denition can be implemented with the following pseu-docode:SubPath (γ ∈ Γ+, jstart ∈ N, jend ∈ N)1 pi ← [vjstart(γ)]2 j ← jstart3 while j 6≡ jend (mod N(γ)) do4 j ← j + 15 Append hj(γ) to pi6 return piD.3 Cell CreationIn this section and all following sections, we nally dene PCS topological operators, that is, oper-ations that transform a valid abstract PCS complex into another valid abstract PCS complex, givensome relevant input. These PCS topological operators apply to vector graphics complexes as well:just ignore all genuses and orientabilities. This is possible since, except in two exceptional cases,genuses and orientabilities are never used to determine what actions to take: they are only usedto compute other genuses and orientabilities. The two exceptional cases are CutNonOrientable-FaceAtNonDisconnectingOrientingClosedEdge() and CutNonOrientableFaceAtNonDisconnectin-gOrientingOpenEdge(). In these cases, the “if” branching can be seen as two alternatives that are177D.3. Cell Creationboth valid. Since the input always includes a valid abstract PCS complex, and the output is alwaysa valid abstract PCS complex, we do not mention them, and instead we assume that we are workingon a globally accessible abstract PCS complex P = (C, dim, isClosed, , g, k, ∂̂) that is modiedin-place by the topological operator.Our rst and simplest topological operator is cell creation. Creating a cell means adding to C anew symbol c that is not already contained in C , and dening the value of dim(c) and ∂̂c for thisnew symbol. If dim(c) = 1, we also need to dene isClosed(c), and if dim(c) = 2, we also needto dene (c), g(c), and k(c). Below are the topological operators for vertices and edges:CreateVertex ()1 Let v 6∈ C . Memory allocation in real-life code, cf. next paragraph2 dim(v)← 03 ∂̂v ← ∅4 Insert v in C5 return vCreateClosedEdge ()1 Let e◦ 6∈ C2 dim(e◦)← 13 isClosed(e◦)← >4 ∂̂e◦ ← ∅5 Insert e◦ in C6 return e◦CreateOpenEdge (vstart ∈ V , vend ∈ V )1 Let e 6∈ C2 dim(e)← 13 isClosed(e)← ⊥4 ∂̂e← (vstart, vend)5 Insert e in C6 return eIn real-life code, “nding a new symbol not already in C” is typically a memory allocation. Forinstance, in C++, “Let c 6∈ C” might translate to “Cell * c = new Cell;”. Also, dening thevalue dim(c) or isClosed(c) may translate to “do nothing” when implemented with an object-oriented language where the type of c already tells you if it’s a vertex, an edge, or a face, and ifthe closedness of an edge can be inferred from whether some pointers are null pointers or not. Weclarify this with a C++ snippet:178D.3. Cell Creation1 class Cell2 {3 public:4 virtual int dimension () const =0;5 virtual std::set <Cell*> boundary () const =0;6 };78 class Vertex: public Cell9 {10 public:11 // Returns the dimension of this Vertex (= 0)12 int dimension () const { return 0; }1314 // Returns the boundary of this Vertex (= empty set)15 std::set <Cell*> boundary () const { return std::set <Cell*>(); }16 };1718 class Edge: public Cell19 {20 private:21 Vertex * start_;22 Vertex * end_;2324 public:25 // Creates a closed edge26 Edge() : start_(nullptr), end_(nullptr) {}2728 // Creates a open edge29 Edge(Vertex * vs , Vertex * ve) : start_(vs), end_(ve) {}3031 // Returns whether this Edge is a closed edge or an open edge32 bool isClosed () const { return start_ == nullptr; }3334 // Returns the dimension of this Edge (= 1)35 int dimension () const { return 1; }3637 // Returns the boundary of this Edge (= its end vertices , if any)38 std::set <Cell*> boundary () const39 {40 std::set <Cell*> res;41 if(isClosed ()) // Closed edge42 {43 return res;44 }45 else // Open edge46 {179D.3. Cell Creation47 res.insert(start_);48 res.insert(end_);49 return res;50 }51 }52 };And then the method CreateClosedEdge() would simply be1 Edge * createClosedEdge ()2 {3 Edge * e = new Edge();4 C.insert(e);5 return e;6 }Finally, the most atomic way to create a face is in several steps: one step to create a face withoutboundary, and then one step per cycle to add. Cycles can also be removed afterwards. Since thenumber of cycles k(f) can always be inferred from ∂̂f , we omit to specify it.CreateFace (f ∈ {, 6}, gf ∈ N)1 Let f 6∈ C2 dim(f )← 23 ∂̂f ← [ ] . Empty sequence of cycles4 (f)← f5 g(f)← gf6 Insert f in C7 return fAddSteinerCycleToFace (f ∈ F , v ∈ V )1 Append γ• = [v] to ∂̂fAddSimpleCycleToFace (f ∈ F , e◦ ∈ E◦, β ∈ {>,⊥}, N ∈ N)1 Append γ◦ = [(e◦, β)N ] to ∂̂fAddNonSimpleCycleToFace (f ∈ F , γ ∈ Γ+)1 Append γ to ∂̂fAddCycleToFace (f ∈ F , γ ∈ Γ)1 Append γ to ∂̂f180D.4. Cell DeletionNoUnCut?Yes!UnCut?NoUnCut?YesUnCut?NoUnCut?NoUnCut?Yes!UnCut?YesUnCut?YesUnCut?YesUnCut?NoUnCut?No againUnCut?NoUnCut?NoUnCut?NoUnCut?Thus:HardDeleteFigure D.1: Three scenarios using SmartDelete().RemoveCyclesFromFace (f ∈ F , I ⊂ N)1 ∆← [ ]2 for all i ∈ [1..k(f)], i 6∈ I do3 Append γi(f) to ∆4 ∂̂f ← ∆RemoveCycleFromFace (f ∈ F , i ∈ N)1 RemoveCyclesFromFace(f ,{i})D.4 Cell DeletionIn the general case, deleting a cell by simply removing it fromC would result in an invalid abstractPCS complex. For instance, if C = {v1, v2, e} with ∂̂e = (v1, v2), them removing v1 would resultin C = {v2, e} with ∂̂e = (v1, v2), which is clearly an invalid abstract PCS complex since wemust have vstart(e) ∈ V which is not anymore the case. More generally, removing a cell c fromC is valid if and only if we have star(c) = ∅. Hence, one possible way to dene “deletion” is toremove c and star(c) together, an operation that we call “hard delete”, that is safely achieved bythe following recursive method:HardDelete (c ∈ C)1 while ∃c′ ∈ star(c) do2 HardDelete(c′)3 Remove c from C . In real-life code, remove from set, then release memory181D.4. Cell DeletionBut there is a less destructive way to remove c from C : perform an atomic simplication at c, asdened in Appendix E and illustrated in Figure E.1. This operation is equivalent to the UnCut()topological operator dened in Section D.8. However, not all cells are candidate for atomic sim-plication. So we may think of a method “if can be atomically simplied, atomically simplify;otherwise, hard delete”. But this approach is still too destructive: in the rst two scenarios in Fig-ure D.1, it would be equivalent to hard delete, while we can see that a less destructive approachexists. This approach is “if can be simplied, simplify; otherwise, hard delete”, where “simplify cellc” corresponds to “recursively simplify all its star cells rst, then atomically simplify c, if possible”.This “smart delete” operation is implemented by the following topological operators:SmartDelete (c ∈ C)1 if c ∈ V then2 SmartDeleteVertex(c)3 else if c ∈ E then4 SmartDeleteEdge(c)5 else if c ∈ F then6 SmartDeleteFace(c)SmartDeleteFace (f ∈ F )1 HardDelete(f )SmartDeleteEdge (e ∈ E)1 if CanUncutAtEdge(e) then2 UnCutAtEdge(e)3 else4 HardDelete(e)SmartDeleteVertex (v ∈ V )1 if CanUncutAtVertex(v) then2 UnCutAtVertex(v)3 else4 for all Edge e ∈ star(c) do5 if CanUncutAtEdge(e) then UnCutAtEdge(e)6 if CanUncutAtVertex(v) then7 UnCutAtVertex(v)8 else9 HardDelete(v)182D.5. Glue CellsD.5 Glue CellsGluing is a rather simple topological operator, both conceptually and to implement. To glue twocells c1 and c2 of same “type”, the idea is to create a new cell c, then replace every occurrence of c1or c2 (in the ordered boundary of other cells) by c, and nally delete c1 and c2. Note that becausec1 or c2 do not belong anymore to the boundary of any cell, we have star(c1) = star(c2) = ∅,thus deleting them simply means removing them from C . In case some geometry is associatedto the topology, the geometry of c would be the “average” of the geometry of c1 and c2, wherethe exact meaning of “average” depends how the geometry is represented and is a choice of theimplementer.First, let us show what this means for vertices. In order to glue two vertices v1 or v2, you shouldreplace every occurrence of v1 or v2 (as a start vertex, end vertex, or Steiner cycle) by the new“glued” vertex v.GlueVertices (v1 ∈ V , v2 ∈ V )Require: v1 6= v21 v ← CreateVertex()2 for all open edge e ∈ star(v1) ∪ star(v2) do3 if vstart(e) = v1 OR vstart(e) = v2 then4 vstart(e)← v5 if vend(e) = v1 OR vend(e) = v2 then6 vend(e)← v7 for all face f ∈ star(v1) ∪ star(v2) do8 for all Steiner cycle γ•i ∈ ∂̂f do9 if γ•i = [v1] OR γ•i = [v2] then10 γ•i ← [v]11 HardDelete(v1)12 HardDelete(v2)13 return vGluing two edges is ambiguous: one needs to decide on a chosen relative direction rst. If thereis geometry available, simple heuristics should be enough (for instance using the sign of a dotproduct). Once direction is decided, we are left to glue two halfedges (e1, β1) and (e2, β2). Toachieve this, we rst glue their start vertices and end vertices together (if any), then we create anew edge e, and replace every occurrence of (e1,>), (e1,⊥), (e2,>), or (e2,⊥) by either (e,>)or (e,⊥).183D.5. Glue CellsGlueClosedHalfedges ((e◦1, β1) ∈ H◦, (e◦2, β2) ∈ H◦)Require: e◦1 6= e◦21 e◦ ← CreateClosedEdge()2 for all face f ∈ star(e◦1) ∪ star(e◦2) do3 for all simple cycle γ◦i = [(e◦i , βi)Ni ] ∈ ∂̂f do4 if e◦i = e◦1 then5 γ◦i ← [(e◦, (βi ⇔ β1))Ni ] . “β ⇔ β′” returns > if β = β′, ⊥ otherwise6 else if e◦i = e◦2 then7 γ◦i ← [(e◦, (βi ⇔ β2))Ni ]8 HardDelete(e◦1)9 HardDelete(e◦2)10 return e◦GlueOpenHalfedges (h1 = (e1, β1) ∈ H|, h2 = (e2, β2) ∈ H|)Require: e1 6= e21 if vstart(h1) = vstart(h2) then2 vstart ← vstart(h1)3 else4 vstart ← GlueVertices(vstart(h1),vstart(h2))5 if vend(h1) = vend(h2) then6 vend ← vend(h1)7 else8 vend ← GlueVertices(vend(h1),vend(h2))9 e← CreateOpenEdge(vstart,vend)10 for all face f ∈ star(e1) ∪ star(e2) do11 for all non-simple cycle γi = [h1, . . . , hNi ] ∈ ∂̂f do12 for all halfedge hj = (ej , βj) ∈ γi do13 if ej = e1 then14 hj ← (e, (βj ⇔ β1))15 else if ej = e2 then16 hj ← (e, (βj ⇔ β2))17 HardDelete(e1)18 HardDelete(e2)19 return e184D.6. UnGlue CellsD.6 UnGlue CellsInformally, unglue is the “reverse” topological operation of glue. However, this is slightly inaccu-rate. For instance, creating a vertex shared by three edges requires two glue operations, but can bereversed in a single unglue operation. Conversely, gluing two isolated vertices results in a singleisolated vertex, but ungluing at this vertex is a null operation instead of reversing back into twoisolated vertices. We illustrate this with a few examples below:{v1v2}Glue(v1,v2)−−−−−−−→{v} UnGlueAt(v)−−−−−−−−→ { v }v1v2v′1v′2e1 = (v1, v′1)e2 = (v2, v′2)Glue(v1,v2)−−−−−−−→vv′1v′2e1 = (v, v′1)e2 = (v, v′2)UnGlueAt(v)−−−−−−−−→v1v2v′1v′2e1 = (v1, v′1)e2 = (v2, v′2)v1v2v3v′1v′2v′3e1 = (v1, v′1)e2 = (v2, v′2)e3 = (v3, v′3)Glue(v1,v2)−−−−−−−→vv3v′1v′2v′3e1 = (v, v′1)e2 = (v, v′2)e3 = (v3, v′3)Glue(v,v3)−−−−−−→v′v′1v′2v′3e1 = (v′, v′1)e2 = (v′, v′2)e3 = (v′, v′3)UnGlueAt(v′)−−−−−−−−→v1v2v3v′1v′2v′3e1 = (v1, v′1)e2 = (v2, v′2)e3 = (v3, v′3)Fundamentally, UnGlue(c) duplicates c as many times as it is “used” by cells of higher dimension,or do nothing if star(c) = ∅. We formalize now the notion of “use”, which is similar to the vertex-use, edge-use and face-use in the radial-edge data structure [Weiler 1985], but not exactly identical.The fundamental dierence is that while in the radial-edge data structure, these uses are explicitobjects (for instance, vertex-uses are ordered in a cyclic doubly-linked list around the vertex theyrepresent), they are only implicit in abstract PCS complexes. Another less signicant dierenceis that the radial-edge data structure does not support Steiner cycles and closed edges, but webelieve it could be easily extended to support them. Finally, since the radial-edge data structureis designed to represent solid 3D objects, it also denes volumes via shells (shells are for volumeswhat cycles are for surfaces) and hence denes face-uses, while we stop at the dimension 2 andhence do not need them.185D.6. UnGlue CellsVertex-use A vertex v can be used in three dierent ways:• As a start or end vertex of an open edge e that has no incident face (i.e., ∂̂e = ∅). Such ause is called end-vertex-use and denoted©v e,β with β ∈ {start, end}. Note that an openedge e uses twice the same vertex if it has no incident faces and vstart(e) = vend(e). Notealso that if e has incident faces, then it is not considered as using any of its end vertices(otherwise redundant with corner-vertex-uses).• As a Steiner cycle γ•i of a face f . Such a use is called Steiner-vertex-use and denoted©v f,i. Note that the same vertex can beused as Steiner more than once by the same face. For instance,consider the “pinched torus” made of one vertex v and one facef such that ∂̂f = [[v], [v]].• As the vertex vj(γi), junction between the consecutive halfedges hj and hj+1 in a non-simple cycle γi of a face f . Such a use is called corner-vertex-use and denoted©v f,i,jOpen-edge-use An open edge e can only be used in one way: as an open halfedge hj in anon-simple cycle γi of a face f . Such a use is called open-edge-use and denoted©e f,i,j .Closed-edge-use A closed edge e◦ can only be used in one way: as a simple cycle γ◦i of a facef . If Ni (i.e., N(γ◦i )) is greater than one, then the closed edge e◦ is considered to be used as manytimes by the face. Such a use is called closed-edge-use and denoted©e◦ f,i,j , where j allows todistinguish repeated uses in the same simple cycle. An example whereNi = 2 is the “cut-Möbius”illustrated in Figure D.2, bottom-middle.Once this notion of use is dened, the unglue topological operators are conceptually simple: tounglue at a cell c, you create a new cell ck for each use©c k of c, and replace c by ck for this specicuse. After this operation, c is not used anymore and hence we delete it, as shown below:UnGlueAtOpenEdge (e ∈ E|)1 if star(e) = ∅ then2 Do nothing.3 else4 for all face f ∈ star(e) do5 for all non-simple cycle γi ∈ ∂̂f do6 for all halfedge hj ∈ γi do7 if e(hj) = e then . Found open-edge-use©e f,i,j8 e(hj)← CreateOpenEdge(vstart(e), vend(e))9 HardDelete(e)186D.6. UnGlue Cells =g = 1∂̂f = [ ] =g = 0∂̂f =[γ1 = [(e◦,>)]γ2 = [(e◦,>)]] =g = 0∂̂f =[γ1 = [(e◦1,>)]γ2 = [(e◦2,>)]] = 6g = 1∂̂f = [ γ1 = [(e◦1,>)] ] =g = 0∂̂f =[γ1 = [(e◦1,>)]γ2 = [(e◦,>)2]] =g = 0∂̂f =[γ1 = [(e◦1,>)]γ2 = [(e◦2,>)]]e◦1 e◦e◦1 e◦2e◦1Figure D.2: The “cut-torus” (top row, middle column) and “cut-Möbius” (bottom row, middle column) are twoexamples of abstract PCS complexes where a closed edge e◦ is used twice by the same face. In the case of thecut-torus, the two closed-edge-uses of e◦ come from two simple cycles, while in the case of the cut-Möbius, thetwo closed-edge-uses of e◦ come from a single cycle repeating e◦ twice. We show these examples before the cut(left), then after the cut (middle), then after ungluing at the cut edge e◦ (right). Ungluing the cut-torus or thecut-Möbius at e◦ gives the same abstract PCS complex: the cylinder. It has no vertices, two closed edges e◦1 ande◦2, and a face f such that ∂̂f = (, 0, [ [h◦1]; [h◦2] ]). Indeed, the two surfaces depicted in the right column areboth homeomorphic to F,0,2.The case of closed edges is as easy to implement, but conceptually challenging. If Ni = 1 forall simple cycles γ◦i using e◦, then there are no diculties. However, the case Ni > 1 is notas straightforward. To understand what the algorithm should do in this case, let us clarify whata “repeated closed edge” represents. Consider a Möbius strip represented by its minimal PCSdecomposition (Figure D.2, bottom-left):• one closed edge e◦1: its unique boundary edge• one face f = (6, 1, [ [(e◦1,>)] ]): non-orientable, genus-1, one simple cycleThe closed edge e◦1 is only used once by f . Indeed, if we arbitrarily choose a direction for thisclosed curve, we can see that locally, f is only “at the left side” of e◦1, or “at the right side”, but noton both sides. It is well-known that if you take scissors and cut this Möbius strip in half along itslength, you obtain a single orientable surface (Figure D.2, bottom-right). In terms of abstract PCScomplexes, this operation can be decomposed into two atomic topological operators:1. The rst topological operator is CutNonOrientableFaceAtNonDisconnectingOrientingClo-sedEdge(f ) (see Section D.7.6), and corresponds to “tracing” the red closed edge e◦ along187D.6. UnGlue Cellsthe centerline of the Möbius strip (Figure D.2, bottom-middle). In terms of PCS complexes,this corresponds to partition f into two cells: e◦ and f \ e◦. With this new (not minimal)decomposition of the Möbius strip, the cell f is now homeomorphic to int(F,0,2), while itwas homeomorphic to int(F6,1,1) before the cut. However, this does not change the wholetopological space X that the PCS complex represents (i.e., the union of cells), which is stillhomeomorphic to the Möbius strip F 6,1,1 (“Cutting” is simply decomposing the same spaceinto more cells as will be discussed later).After this cut, we can observe that if we arbitrarily choose a di-rection for this closed curve e◦, then f is actually “both at theleft side and the right side” of e◦. This explains why f actuallyuses e◦ twice. But unlike the “cut-torus” (Figure D.2, top-middle),these two uses are from the same cycle. To understand why, picka point on e◦, then pick one side of the face (for instance, the “leftside”). If you move along e◦ while keeping in mind which side off you picked, then after one turn you will realize that you end upat the other side of e◦. Hence, you have to perform two completeturns around e◦ to actually complete the cycle, that continuouslygoes through the two closed-edges-uses.2. The second topological operator is UnglueAtClosedEdge(e◦), that actually changes the topo-logical space X by “disconnecting” the two closed-edges-uses of e◦. Similarly to the cut-torus example (Figure D.2, top), this is achieved by “duplicating the geometry” of e◦. How-ever, unlike the cut-torus example where this duplicated geometry is distributed among twoclosed edges e◦1 and e◦2, the duplicated geometry belongs to the same closed edge e◦2, makingthe closed edge twice as long as it was initially (cf. Figure D.2, bottom-right). Combinato-rially, this duplication of geometry is conceptual, and it simply means that the simple cycleγ◦i that uses multiple times e◦ is transformed into a simple cycle γ◦i that uses only once anew closed edge.Note that it is also possible to have Ni ≥ 3. For instance, take three rectangles glued togetheralong a long edge, then glue their short edges in the same way you would construct a Möbiusstrip, but with a third-twist instead of a half-twist. With this understanding, we can nally denethe topological operator UnglueAtClosedEdge(e◦): for every simple cycle γ◦i = [(e◦i , βi)Ni ] thatuses e◦ (possiblyNi > 1 times), we create a new closed edge e◦i and change γ◦i into [(e◦i , βi)].Finally, to unglue at a vertex, the important dierence is that for this operation to be valid, all cellsin the star of vmust be unglued rst. Then, we handle independently the dierent use cases.188D.6. UnGlue CellsUnGlueAtClosedEdge (e◦ ∈ E◦)1 if star(e◦) = ∅ then2 Do nothing.3 else4 for all face f ∈ star(e◦) do5 for all simple cycle γ◦i ∈ ∂̂f do6 if e◦(γ◦i ) = e◦ then . Found closed-edge-uses©e◦ f,i,1 to©e◦ f,i,N(γ◦i )7 e◦(γ◦i )← CreateClosedEdge()8 N(γ◦i )← 19 HardDelete(e◦)UnGlueAtVertex (v ∈ V )1 if star(v) = ∅ then2 Do nothing.3 else4 for all edge e ∈ star(v) do . Unglue at all (necessarily open) star edges of v5 UnGlueAtOpenEdge(e)6 for all edge e ∈ star(v) do7 if star(e) = ∅ then8 if vstart(e) = v then . End-vertex-use©v e,start9 vstart(e)← CreateVertex()10 if vend(e) = v then . End-vertex-use©v e,end11 vend(e)← CreateVertex()12 for all face f ∈ star(v) do13 for all Steiner cycle γ•i = [vi] ∈ ∂̂f do14 if vi = v then . Steiner-vertex-use©v f,i15 v(γ•i (f))← CreateVertex()16 for all non-simple cycle γi ∈ ∂̂f do17 for all halfedges hj ∈ γi do18 if vend(hj) = v then . Corner-vertex-use©v f,i,j19 vf,i,j ← CreateVertex()20 vend(hj)← vf,i,j21 vstart(hj+1)← vf,i,j22 HardDelete(v)189D.7. Cut Cellsv1v2e1e2fv1v2e1e2ecutf1 f2v1v2e1 = (v1, v2)e2 = (v2, v1)f = ( , 0, [ [ •v1(e1,>) •v2(e2,>) •v1] ] )CutFace[... ]−−−−−−−→v1v2e1 = (v1, v2)e2 = (v2, v1)ecut = (v2, v1)f1 = ( , 0, [ [ •v1(e1,>) •v2(ecut,>) •v1] ] )f2 = ( , 0, [ [ •v2(e2,>) •v1(ecut,⊥) •v2] ] )Figure D.3: An abstract PCS complex is transformed into another abstract PCS complex, as a result of the cuttopological operator CutOrientableFaceAtDisconnectingOpenEdge(f ,1,1,2,0,0,[ ]).D.7 Cut CellsGiven a (non-abstract) PCS complex, a cut is dened as partitioning a cell c into new cells {ccut, c1,c2, . . . }, where ccut is a proper subset of c and where {c1, c2, . . . } are the connected components ofc\ccut. We say that “c is cut at ccut”. A valid cut is a cut such that the resulting cell decompositionis a valid PCS complex. For instance, if a face f is cut at an open edge ecut ⊂ f , then ecut muststart and end at vertices in ∂f . From now on, whenever we say “a cut”, we mean a valid cut. Itcan be shown that a cut necessarily satises dim(ccut) < dim(c). Subsequently, it can be shownthat c \ ccut is either connected or made of two connected components, thus c is partitioned intoeither two components {ccut, c′} or three components {ccut, c1, c2}. This intuitive result shouldbecome clear with the dierent examples illustrated in this section.The cut topological operator on abstract PCS complex that we describe in this section is the combi-natorial counterpart of the pointset denition given above. This means that a given abstract PCScomplex P is transformed into another abstract PCS complex P ′ such that the PCS complex |P ′|could have been obtained by cutting a cell c of |P| at some subcell ccut ⊂ c. Interestingly, thismeans that the abstract cell ccut of P ′ is actually an output of the cut topological operator, as illus-trated in Figure D.3, whereas it is more easily interpreted as an input with the pointset denition(i.e.: “cut here”). Because an abstract PCS complex is a purely combinatorial object, its faces arepurely abstract and not assumed to be realized as pointsets (or even as abstract triangulations), andtherefore it is not possible to say “cut here”, and we should instead say “cut this way”. For instance,in Figure D.3, it would be along the lines of “cut f at an open edge starting at v2 and ending at v1”.However, while this sentence entirely species the cut in the simple example in Figure D.3, thingsare actually much more complicated in the general case because:190D.7. Cut Cells• If f uses v1 or v2 more than once, then the sentence is ambiguous: the actual vertex-usesmust be specied instead of “just” the vertices.• If f contains several cycles, then the sentence is ambiguous: it is necessary to specify whichcycles must be transferred to f1 and which cycles must be transferred to f2.• If the genus of f is non-zero (e.g., a torus with a hole), then the sentence is ambiguous: acut from v2 to v1 may or may not disconnect f , depending on the actual path of ecut in apointset sense, and this information has to be specied combinatorially somehow.• Other ambiguities that are detailed later.To exhaustively cover all the possible cases, and nd out what combinatorial input is necessaryand sucient to fully determine the cut, we have to classify all the dierent ways a cell can becut. Only then we can rigorously dene “cut this way”, and make sure that we are not missingany way to cut a cell. For instance, the cut topological operator performed in Figure D.3 can bemore accurately expressed as “cut the orientable face f at an open edge starting at the vertex-use©v f,1,1, ending at the vertex-use©v f,1,2, disconnecting f into two (necessarily orientable) faces,both of genus zero, and both receiving no cycles from f”. To do this, you would call the methodCutOrientableFaceAtDisconnectingOpenEdge(f ,1,1,2,0,0,[ ]).We provide below an informal overview of the dierent cases to consider. The exhaustive list isprovided by the following sections, and in particular the dierent ways to cut a face at an edge areillustrated in Figure D.5 and D.6.• Cutting an open edge (at a vertex)An open edge e becomes a vertex v and two open edges e1 and e2.• Cutting a closed edge (at a vertex)A closed edge e◦ becomes a vertex v and the open edge e′ = e◦ \ v.• Cutting a face at a vertexA face f becomes a vertex v and the face f ′ = f \ v.• Cutting a face at a closed edge, disconnecting itA face f becomes a closed edge e◦ and two faces f1 and f2. The holes, handles or crosscapsof f are distributed among f1 and f2. The cycle [(e◦,>)] is added to f1 and the cycle [(e◦,⊥)]is added to f2.• Cutting a face at a closed edge, not disconnecting itA face f becomes a closed edge e◦ and the face f ′ = f \ e◦. If f is orientable, its genus isdecreased by one, and the two cycles [(e◦,>)] and [(e◦,⊥)] are added. If f is non-orientable,it may become orientable or not, its genus may be decreased by one or more, and either the191D.7. Cut Cellscycle [(e◦,>)] is added twice, or the single cycle [(e◦,>)2] is added.• Cutting a face at an open edge starting/ending at the same hole, disconnecting itA face f becomes an open edge e and two faces f1 and f2. The handles or crosscaps of fare distributed among f1 and f2. All cycles except one are distributed among f1 and f2. Thelast cycle γi = [pi1, pi2] is split by adding [pi1, (e,>)] to f1 and adding [pi2, (e,⊥)] to f2.• Cutting a face at an open edge starting/ending at the same hole, not disconnectingitA face f becomes an open edge e and the face f ′ = f \ e. If f is orientable, its genus isdecreased by one, and the cycle γi = [pi1, pi2] is split into [pi1, (e,>)] and [pi2, (e,⊥)]. If fis non-orientable, it may become orientable or not, its genus may be decreased by one ormore, and either the two cycles [pi1, (e,>)] and [pi2, (e,>)] are added, or the single cycle[pi1, (e,>), pi2, (e,>)] is added.• Cutting a face at an open edge starting/ending at dierent holesA face f becomes an open edge e and the face f ′ = f \ e. Two cycles γi1 and γi2 are mergedinto the single cycle [γi1 , (e,>), γi2 , (e,⊥)].D.7.1 Cutting an Open Edge (at a Vertex)Cutting an open edge e is a very simple operation that consists in splitting e in half by insertinga vertex in its interior, resulting in two open edges e1 and e2 and one vertex v. One only has totake care of replacing the halfedges using e by two halfedges using respectively e1 and e2 withthe appropriate direction. The reason we put “at a vertex” in parenthesis in the title of this section(and the reason why “AtAVertex” is not part of the topological operator name) is that cutting anopen edge is necessarily done at a vertex due to the requirement dim(ccut) < dim(c).192D.7. Cut CellsCutOpenEdge (e ∈ E|)1 v ← CreateVertex()2 e1 ← CreateOpenEdge(vstart(e), v)3 e2 ← CreateOpenEdge(v, vend(e))4 for all face f ∈ star(e) do5 for all non-simple cycle γi ∈ ∂̂f do6 γ′i ← [ ]7 for all halfedges hj ∈ γi do8 if e(hj) = e then9 if β(hj) = > then10 Append (e1,>) to γ′i11 Append (e2,>) to γ′i12 else13 Append (e2,⊥) to γ′i14 Append (e1,⊥) to γ′i15 else16 Append hj to γ′i17 γi(f)← γ′i18 HardDelete(e)D.7.2 Cutting a Closed Edge (at a vertex)Cutting a closed edge e◦ follows the same idea, resulting in one open edge e and one vertex v.CutClosedEdge (e◦ ∈ E◦)1 v ← CreateVertex()2 e← CreateOpenEdge(v, v)3 for all face f ∈ star(e◦) do4 for all simple cycle γ◦i = [(e◦i , βi)Ni ] ∈ ∂̂f do5 if e◦i = e◦ then6 γi(f)← [ •v(e, βi) •v· · · •v(e, βi) •v] .Replace the simple cycle by a non-simple cy-cle that repeats Ni times the open edge e7 HardDelete(e◦)193D.7. Cut CellsD.7.3 Cutting a Face at a VertexA trivial way to cut a face is via a vertex. This means that we decompose the face f into a newvertex v and the new face f \ v.CutFaceAtVertex (f ∈ F )1 v ← CreateVertex()2 AddSteinerCycleToFace(f ,v)D.7.4 Cutting a Face at an EdgeCutting a face at an open or closed edge is a much harder operation because there are manynon-trivial and non-equivalent ways a face can be cut (cf. Figure D.4): the face may become dis-connected or not, its orientability and genus may change or not, and dierent cycles may be added,split, or merged together. If the abstract PCS complex is realized as a triangulation, and the cutedge is given as a subset of the edges in the triangulation, then it is possible to compute in whichcase we are, and perform the appropriate operation. However, at the combinatorial level of theabstract PCS complex, no such realization as triangulation is assumed, therefore “how” the face iscut has to be specied somehow. For instance, if a face f is a sphere with k holes, and we cut itat a closed edge e◦, then we know for sure that this disconnects f into two faces f1 and and f2.However, without more information, there is no way to know combinatorially which holes of fmust be transferred to f1, and which holes must be transferred to f2. Hence, this information hasto be given as input of the topological operator. In this case, the operator could be:CutSphereAtClosedEdge (f ∈ F , I ⊆ N)Require: (f) = and g(f) = 01 e◦ ← CreateClosedEdge() . Create the cut edge e◦ and the two faces f1 and f22 f1 ← CreateFace(, 0)3 f2 ← CreateFace(, 0)4 for all cycle γi of f do . Distribute the cycles of f among f1 and f25 if i ∈ I then6 AddCycleToFace(f1,γi(f))7 else8 AddCycleToFace(f2,γi(f))9 AddSimpleCycleToFace(f1,e◦,>,1) . Add cycle [(e◦,>)] to f1 and cycle [(e◦,⊥)] to f210 AddSimpleCycleToFace(f2,e◦,⊥,1)11 HardDelete(f ) . Delete f194D.7. Cut CellsIf =f ′f1, f2If = 6f ′f1, f2′ =′ = 6k′ = k + 2k′ = k + 11 =2 = 6′ = g′ = g − 1 k′ = k + 21 =2 =g1 + g2 = g k1 + k2 = k + 2′ = g′ = g−12 k′ = k + 1′ = g′ = g−22 k′ = k + 2′ = 6 g′ = g − 1 k′ = k + 1′ = 6 g′ = g − 2 k′ = k + 21 =2 = 6 2g1 + g2 = g k1 + k2 = k + 21 = 62 =g1 + 2g2 = g k1 + k2 = k + 21 = 62 = 6 g1 + g2 = g k1 + k2 = k + 2If g is odd:If g is even:1 = 62 =1 = 62 = 6If =f ′f1, f2If = 6f ′f1, f2′ =′ = 6k′ = k + 2k′ = k + 11 =2 = 6′ = g′ = g − 1 k′ = k + 11 =2 =g1 + g2 = g k1 + k2 = k + 1′ = g′ = g−12 k′ = k′ = g′ = g−22 k′ = k + 1′ = 6 g′ = g − 1 k′ = k′ = 6 g′ = g − 2 k′ = k + 11 =2 = 6 2g1 + g2 = g k1 + k2 = k + 11 = 62 =g1 + 2g2 = g k1 + k2 = k + 11 = 62 = 6 g1 + g2 = g k1 + k2 = k + 1If g is odd:If g is even:1 = 62 =1 = 62 = 6ecut is aclosed edgeCutFaceAtEdge()ecut is anopen edge startingand ending atthe same holeecut is anopen edge startingand ending atdierent holes ′ = g′ = g k′ = k − 1(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)Figure D.4: Exhaustive classication of the 19 dierent ways a face can be cut at an edge. The branching“if”s represent known information about the abstract PCS complex that is about to be cut. The branching arrowsrepresent information about ecut that cannot be algorithmically determined, and hence that has to be given asinput to the PCS topological operator (either as parameters or by calling dierent methods). We only show herethe unknown information that leads to dierent orientabilities, genus formulas, number of faces, or number ofcycles (e.g.: is ecut closed or not? Does ecut disconnect the face?). Additional parameters to give to the topologicaloperators include: if ecut disconnects f , which cycles to transfer to f1 or f2? What are the new genuses g1 andg2? If ecut is open, at which vertex-uses does it start and end? Should some cycles be ipped?195D.7. Cut Cells(a)∂̂f = [ · · · ] ∂̂f ′ =[· · ·[(e◦,>)][(e◦,⊥)]]g ≥ 1 g′ = g − 1 = ′ =f f ′e◦g = 1 g′ = 0g = 2 g′ = 1g = 2 g′ = 1g = 2 g′ = 1(b)∂̂f1 =[ · · ·1[(e◦,>)]]∂̂f =[ · · ·1· · ·2]∂̂f2 =[ · · ·2[(e◦,⊥)]]g = 2g = 2g1 = 2g2 = 0g1 = 1g2 = 1f f1f2e◦g1 + g2 = gg ≥ 0 = 1 = 2 =g = 1 g1 = 0g2 = 1(c) = 6g ≥ 1′ =g′ = g−12∂̂f ′ =[ · · ·[(e◦,>)2]]∂̂f = [ · · · ]′ =g′ = 0 =6g = 1 =6g = 3′ =g′ = 1(d)∂̂f ′ =[· · ·[(e◦,>)][(e◦,>)]]∂̂f = [ · · · ] =6g ≥ 2′ =g′ = g−22 =6g = 2′ =g′ = 0(e) = 6g ≥ 2′ =6g′ = g − 1∂̂f ′ =[ · · ·[(e◦,>)2]]∂̂f = [ · · · ] =6g = 3′ =6g′ = 2 = 6g = 2′ = 6g′ = 1(f)∂̂f ′ =[· · ·[(e◦,>)][(e◦,>)]]∂̂f = [ · · · ] = 6g ≥ 3′ =6g′ = g − 2 =6g = 3′ =6g′ = 1(g), (h), (i)e◦1 = 6g1 = 1 = 6g = 1 2 =g2 = 0∂̂f1 =[ · · ·1[(e◦,>)]]∂̂f =[ · · ·1· · ·2]∂̂f2 =[ · · ·2[(e◦,⊥)]] =6g = 11 =g1 = 02 =6g2 = 1 =6g = 31 =g1 = 12 =6g2 = 1 =6g = 31 =g1 = 12 =6g2 = 1 =6g = 31 =6g1 = 12 =g2 = 12g1 + g2 = gg ≥ 1 =6 1 = 2 =6g1 + 2g2 = g1 = 6 2 =(g)(h)g ≥ 1 =6g1 + g2 = g1 =6 2 =6(i)g ≥ 2 =6g = 2 = 6g1 = 11 = 6g2 = 12 =6(i)(g) or (h)g = 3 =6g1 = 11 =6g2 = 22 =6Figure D.5: The dierent ways to cut a face at a closed edge. The labelling letters refer to the classicationprovided in Figure D.4.196D.7. Cut Cells(j)∂̂f =[ · · ·[ •v1pi1 •v2pi2 •v1]]∂̂f ′ = · · ·[ •v1 pi1 •v2 (e,>) •v1 ][ •v2pi2 •v1(e,⊥) •v2] =g ≥ 1′ =g′ = g − 1v1pi1v2pi2f f ′e(k)g ≥ 0∂̂f1 =[ · · ·1[ •v1pi1 •v2(e,>) •v1]]∂̂f = · · ·1· · ·2[ •v1pi1 •v2pi2 •v1]∂̂f2 =[ · · ·2[ •v2pi2 •v1(e,⊥) •v2]]v1pi1v2pi2 ef f1 f2 =g1 + g2 = g′ =(m)e =6g = 2′ =g′ = 0v2pi1pi2v1 =6g ≥ 2′ =g′ = g−22∂̂f ′ = · · ·[ •v1 pi1 •v2 (e,>) •v1 ][ •v1pi2 •v2(e,>) •v1]∂̂f =[ · · ·[ •v1pi1 •v2pi2 •v1]](n) =6g ≥ 2′ = 6g′ = g − 1∂̂f =[ · · ·[ •v1pi1 •v2pi2 •v1]]∂̂f ′ = · · ·[ •v1 pi1 •v2 (e,>) •v1pi2 •v2(e,>) •v1] =6g = 3′ = 6g′ = 2 =6g = 2′ =6g′ = 1v1v2pi1pi2ev1v2pi1pi2e(o) =6g ≥ 3′ = 6g′ = g − 2 =6g = 3′ = 6g′ = 1v2pi1pi2v1∂̂f ′ = · · ·[ •v1 pi1 •v2 (e,>) •v1 ][ •v1pi2 •v2(e,>) •v1]∂̂f =[ · · ·[ •v1pi1 •v2pi2 •v1]](p), (q), (r)1 = 6g1 = 1 =6g = 1 2 =g2 = 0v2v1pi2pi1e∂̂f1 =[ · · ·1[ •v1pi1 •v2(e,>) •v1]]∂̂f = · · ·1· · ·2[ •v1pi1 •v2pi2 •v1]∂̂f2 =[ · · ·2[ •v2pi2 •v1(e,⊥) •v2]] =6g = 31 =6g1 = 12 =g2 = 1v1v2 pi2pi1e =6g = 31 =g1 = 12 = 6g2 = 1v2pi2v1pi1eg = 2 =6g1 = 11 = 6g2 = 12 =62g1 + g2 = gg ≥ 1 =6 1 = 2 = 6g1 + 2g2 = g1 = 6 2 =(p)(q)g ≥ 1 =6g1 + g2 = g1 = 6 2 =6(r)g ≥ 2 =6(r)(p) or (q)(l)∂̂f =[ · · ·[ •v1pi1 •v2pi2 •v1]]∂̂f ′ = · · ·[ •v1 pi1 •v2 (e,>) •v1pi2 •v2(e,>) •v1] =6g ≥ 1′ =g′ = g−12e ′ =g′ = 0′ =6g = 1v1 v2pi1pi2 =6g = 3′ =g′ = 1v1v2 pi2pi1e(s)∂̂f = · · ·[ •v1 γ1 •v1 ][ •v2γ2 •v2]∂̂f ′ = · · ·[ •v1 γ1 •v1 (e,>) •v2γ2 •v2(e,⊥) •v2]γ2v1v2γ1e ∈ {, 6} ′ = g ≥ 0 g′ = gFigure D.6: The dierent ways to cut a face at an open edge. The labelling letters refer to the classicationprovided in Figure D.4.197D.7. Cut CellsThe above topological operator is quite simple, but things get much more complicated when f isnot a sphere, and especially when f is non-orientable. In order to cover all the dierent cases witha nite but exhaustive set of topological operators, it is necessary to classify all these dierentcases. We call this the face-cut classication, summarized in Figure D.4, illustrated in Figure D.5and Figure D.6, and detailed in the following subsections.D.7.5 Cutting an Orientable Face at a Closed EdgeThe rst way to cut a face is via a closed edge included in the face. We recall that the geometricrealization of a face is int(F,g,k), and all the possibilities are illustrated in Figure A.3. As can beseen in Figure D.4, there exist many ways to choose a closed edge e◦ inside the interior of a facef . In this section and the following, we classify all of them.First, let us consider the case where f is orientable. Let e◦ be a closed edge included in f . Thus,the pointset f \e◦ is either connected or it is not. If f \e◦ is connected, this completely determinesthe cut, i.e. any choice of e◦ included in an orientable face f such that f \ e◦ is connected leads tothe same PCS complex up to homeomorphism, i.e. they have the same abstract PCS complex. Thisabstract PCS complex is obtained from the abstract PCS complex before the cut by decreasing thegenus of f by one, and adding the two cycles [(e◦,>)] and [(e◦,⊥)] to f . This is performed by thetopological operator below:CutOrientableFaceAtNonDisconnectingClosedEdge (f ∈ F )Require: (f) = and g(f) ≥ 11 g(f)← g(f)− 12 e◦ ← CreateClosedEdge()3 AddSimpleCycleToFace(f ,e◦,>,1)4 AddSimpleCycleToFace(f ,e◦,⊥,1)If, on the contrary, f \ e◦ is not connected, then this means that it has two connected componentsf1 and f2, both orientable and satisfying g(f) = g(f1) + g(f2), where the cycles of f are dis-tributed among f1 and f2, the cycle [(e◦,>)] is added to f1, and the cycle [(e◦,⊥)] is added to f2.However, the actual values of g(f1) and g(f2), as well as which cycles are transferred to f1 andwhich cycles are transferred to f2 cannot be determined combinatorially without an underlyingtriangulation, and must therefore be an input of the following PCS topological operator. We notethat the “CutSphereAtClosedEdge” operator that we have presented as a motivating example isredundant with this operator and therefore is not part of the classication.198D.7. Cut CellsCutOrientableFaceAtDisconnectingClosedEdge (f ∈ F , g1 ∈ N, g2 ∈ N, I ⊆ N)Require: (f) = and g(f) = g1 + g21 e◦ ← CreateClosedEdge() . Create the cut edge e◦ and the two faces f1 and f22 f1 ← CreateFace(, g1)3 f2 ← CreateFace(, g2)4 for all cycle γi of f do . Distribute the cycles of f among f1 and f25 if i ∈ I then6 AddCycleToFace(f1,γi(f))7 else8 AddCycleToFace(f2,γi(f))9 AddSimpleCycleToFace(f1,e◦,>,1) . Add cycle [(e◦,>)] to f1 and cycle [(e◦,⊥)] to f210 AddSimpleCycleToFace(f2,e◦,⊥,1)11 HardDelete(f ) . Delete fD.7.6 Cutting a Non-Orientable Face at a Closed EdgeIn this section, let us consider the case where a non-orientable f is cut at a closed edge e◦. Thepointset f ′ = f \ e◦ is either connected or it is not, and let us rst consider the case where it isconnected. On the contrary to the orientable case presented in the previous section, the informa-tion “f \ e◦ is connected” does not fully determine the cut, unless g(f) = 1. More specically, it isin fact always possible to choose e◦ such that f ′ becomes orientable, but if g(f) ≥ 2 then it is alsopossible to choose e◦ such that f ′ stays non-orientable. Reasoning with the Euler characteristic,it can be shown that if f ′ is orientable, then this information fully determines the cut, which isgiven by the following topological operator:199D.7. Cut CellsCutNonOrientableFaceAtNonDisconnectingOrientingClosedEdge (f ∈ F )Require: (f) =61 if g(f) is odd then2 (f)←3 g(f)← g−124 e◦ ← CreateClosedEdge()5 AddSimpleCycleToFace(f ,e◦,>,2)6 else7 (f)←8 g(f)← g−229 e◦ ← CreateClosedEdge()10 AddSimpleCycleToFace(f ,e◦,>,1)11 AddSimpleCycleToFace(f ,e◦,>,1)However, if f ′ is non-orientable, then there still remains some ambiguity. Specically, wheneverg ≥ 2 it is possible to cut by preserving non-orientability and adding only one boundary (i.e.,adding the cycle [(e◦,>)2]), and whenever g ≥ 3 it is also possible to cut by preserving non-orientability and adding two boundaries (i.e., add the cycle [(e◦,>)] twice). In the rst scenario,it can be shown that the genus is decreased by one, and in the second scenario it can be shownthat the genus is decreased by two. Therefore, this leads to the following two topological opera-tors:CutNonOrientableFaceAtNonDisconnectingNonOrientingOddClosedEdge (f ∈ F )Require: (f) =6 and g ≥ 21 g(f)← g − 12 e◦ ← CreateClosedEdge()3 AddSimpleCycleToFace(f ,e◦,>,2)CutNonOrientableFaceAtNonDisconnectingNonOrientingEvenClosedEdge (f ∈ F )Require: (f) =6 and g ≥ 31 g(f)← g − 22 e◦ ← CreateClosedEdge()3 AddSimpleCycleToFace(f ,e◦,>,1)4 AddSimpleCycleToFace(f ,e◦,>,1)Now that we have nished to consider all the cases where f \ e◦ was connected, we are about toconsider the cases where f \ e◦ is not connected, and therefore has two connected components f1200D.7. Cut Cellsand f2. In this case, as with the orientable case, the cycles of f must be distributed among f1 and f2,the cycle [(e◦,>)] is added to f1, and the cycle [(e◦,⊥)] is added to f2. Since f is non-orientable,it can be shown that f1 and f2 cannot be both orientable, but all three other combinations arepossible: f1 orientable and f2 non-orientable; f1 non-orientable and f2 orientable; or both f1 andf2 non-orientable (however, the latter is only possible if g(f) ≥ 2). Reasoning with the Eulercharacteristic, it can be shown that for each of these three cases, we have the genus relation,respectively: g(f) = 2g(f1) + g(f2); g(f) = g(f1) + 2g(f2); and g(f) = g(f1) + g(f2). However,whether f1 and f2 are orientable and the actual values of g(f1) and g(f2) cannot be determinedalgorithmically without an underlying triangulation. Therefore, they are all input to the followingtopological operator that spans all the three cases:CutNonOrientableFaceAtDisconnectingClosedEdge (f ∈ F , 1, 2 ∈ {, 6}, g1, g2 ∈ N, I ⊆ N)Require: (f) =6Require: 1 =6 or 2 =6Require: (1 = and 2 =6)⇒ (g2 ≥ 1 and g(f) = 2g1 + g2)Require: (1 =6 and 2 =)⇒ (g1 ≥ 1 and g(f) = g1 + 2g2)Require: (1 =6 and 2 =6)⇒ (g1 ≥ 1, g2 ≥ 1, and g(f) = g1 + g2)1 e◦ ← CreateClosedEdge() . Create the cut edge e◦ and the two faces f1 and f22 f1 ← CreateFace(1, g1)3 f2 ← CreateFace(2, g2)4 for all cycle γi of f do . Distribute the cycles of f among f1 and f25 if i ∈ I then6 AddCycleToFace(f1,γi(f))7 else8 AddCycleToFace(f2,γi(f))9 AddSimpleCycleToFace(f1,e◦,>,1) . Add cycle [(e◦,>)] to f1 and [(e◦,⊥)] to f210 AddSimpleCycleToFace(f2,e◦,⊥,1)11 HardDelete(f ) . Delete f201D.7. Cut CellsD.7.7 Cutting a Face at an Open Edge Starting and Ending at the SameHoleAs illustrated in Figure D.4, this case is very similar to cutting at a closed edge, and follows thesame classication. The dierence is that instead of adding the two cycles [(e◦,>)] and [(e◦,⊥)](resp., twice the cycle [(e◦,>)], or the single cycle [(e◦,>)2]), we remove one cycle γi (the cyclecorresponding to the starting/ending hole), split it into two paths pi1 and pi2, then add the twocycles [pi1, (e,>)] and [pi2, (e,⊥)] (resp., the two cycles [pi1, (e,>)] and [pi2, (e,>)], or the singlecycle [pi1, (e,>), pi2, (e,>)]).As illustrated in Figure D.7, one issue is that the same vertex may be used several times by thesame cycle, and hence knowing vstart(e) and vend(e) is in general not enough information tocombinatorially determine at which two indices the cycle γi must be split. Therefore, these indicesmust be explicitly provided as input of the topological operator, in the form of two integers jstartand jend, in addition to the integer i specifying γi. Finally, we note that the same vertex-use©v f,i,jcan be specied as both start and end vertex-use of the cut (cf Figure D.7, bottom-left), in whichcase either pi1 or pi2 is empty, while the other is equal to the whole cycle γi. To disambiguate whichis which, the caller of the operator must indicate either jend = jstart (to get pi1 = γi and pi2 = [ ]),or jend = jstart + N(γi) (to get pi1 = [ ] and pi2 = γi). In the special case where γi is a Steinercycle, then jstart and jend are not necessary and are simply ignored. We note that γi cannot be asimple cycle, since a simple cycle do not have any vertex-use.Combining the above observations with the classication already given for cutting at a closededge, we obtain six topological operators that are reported in this section. But rst, we dene thehelper method SplitCycle() splitting a cycle γ into two paths pi1 and pi2, given two indices jstartand jend indicating where to split γ:202D.7. Cut CellsSplitCycle (γ ∈ Γ, jstart ∈ N, jend ∈ N)Require:γ is a Steiner cycle, orγ is a non-simple cycle, andjstart ∈ [1..N(γ)], andjend = jstart, orjend = jstart +N(γ), orjend ∈ [1..N(γ)] and jstart 6= jend1 if γ is a Steiner cycle then . γ = [v]2 vstart ← v(γ)3 vend ← v(γ)4 pi1 ← [v(γ)]5 pi2 ← [v(γ)]6 else7 if jend = jstart then . γ = [ h1 · · · hjstart •vjstart hjstart+1 · · · hN ]8 vstart ← vjstart(γ)9 vend ← vjstart(γ)10 pi1 ← [ hjstart+1 · · · hN h1 · · · hjstart ]11 pi2 ← [vjstart(γ)]12 else if jend = jstart +N(γ) then13 vstart ← vjstart(γ)14 vend ← vjstart(γ)15 pi1 ← [vjstart(γ)]16 pi2 ← [ hjstart+1 · · · hN h1 · · · hjstart ]17 else if jstart < jend then . γ = [ h1 · · · hjstart •vjstart hjstart+1 · · · hjend •vjend hjend+1 · · · hN ]18 vstart ← vjstart(γ)19 vend ← vjend(γ)20 pi1 ← [ hjend+1 · · · hN h1 · · · hjstart ]21 pi2 ← [ hjstart+1 · · · hjend ]22 else . γ = [ h1 · · · hjend •vjend hjend+1 · · · hjstart •vjstart hjstart+1 · · · hN ]23 vstart ← vjstart(γ)24 vend ← vjend(γ)25 pi1 ← [ hjend+1 · · · hjstart ]26 pi2 ← [ hjstart+1 · · · hN h1 · · · hjend ]27 return (vstart, vend, pi1, pi2)203D.7. Cut Cells∂̂f =[[(e◦4,>)][ •v(e1,>) •v(e2,>) •v(e3,>) •v]]fe1e2e3e◦4v©v f,2,1 ©v f,2,2 ©v f,2,3©v f,2,1©v f,2,2©v f,2,3f1ee2e3e◦4f2e1v∂̂f1 =[[(e◦4,>)][ •v(e1,>) •v(e2,>) •v(e,>) •v]]∂̂f2 =[[ •v(e3,>) •v(e,⊥) •v]]f1ee2e3e◦4f2e1v∂̂f1 =[[(e◦4,>)][ •v(e3,>) •v(e1,>) •v(e,>) •v]]∂̂f2 =[[ •v(e2,>) •v(e,⊥) •v]]f1ee2e3e◦4f2e1v∂̂f1 =[[(e◦4,>)][ •v(e3,>) •v(e1,>) •v(e2,>) •v(e,>) •v]]∂̂f2 =[[ •v(e,⊥) •v]]Figure D.7: Three dierent cuts that start and end at the same vertex, but with dierent vertex-uses.We now report all the six dierent methods that can be used to cut a face at an open edge startingand ending at the same hole. In addition to specic parameters, all these methods have in commonthe parameters f ∈ F , i ∈ N, jstart ∈ N, jend ∈ N with the following requirement that we reporthere for conciseness:i ∈ [1..k(f)], andγi(f) is a Steiner cycle, orγi(f) is a non-simple cycle, andjstart ∈ [1..N(γi(f))], andjend = jstart, orjend = jstart +N(γi(f)), orjend ∈ [1..N(γi(f))] and jstart 6= jend(D.18)204D.7. Cut CellsCutOrientableFaceAtNonDisconnectingOpenEdge (f ∈ F , i ∈ N, jstart ∈ N, jend ∈ N)Require: (f) = and g(f) ≥ 1Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 g(f)← g(f)− 13 e← CreateOpenEdge(vstart, vend)4 AddNonSimpleCycleToFace(f , [pi1, (e,>)])5 AddNonSimpleCycleToFace(f , [pi2, (e,⊥)])6 RemoveCycleFromFace(f ,i)CutOrientableFaceAtDisconnectingOpenEdge (f ∈ F , i ∈ N, jstart, jend ∈ N, g1, g2 ∈ N, I ⊆ N)Require: (f) = and g(f) = g1 + g2Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 e← CreateOpenEdge(vstart, vend) . Create the cut edge e and the two faces f1 and f23 f1 ← CreateFace(, g1)4 f2 ← CreateFace(, g2)5 for all cycle γi′ of f , i′ 6= i do . Distribute the cycles of f , except γi, among f1 and f26 if i′ ∈ I then7 AddCycleToFace(f1,γi′(f))8 else9 AddCycleToFace(f2,γi′(f))10 AddNonSimpleCycleToFace(f1, [pi1, (e,>)]) . Add cycle [pi1, (e,>)] to f1 and [pi2, (e,⊥)] to f211 AddNonSimpleCycleToFace(f2, [pi2, (e,⊥)])12 HardDelete(f ) . Delete f205D.7. Cut CellsCutNonOrientableFaceAtNonDisconnectingOrientingOpenEdge (f ∈ F , i ∈ N, jstart ∈ N, jend ∈ N)Require: (f) =6Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 if g(f) is odd then3 (f)←4 g(f)← g−125 e← CreateOpenEdge(vstart, vend)6 AddNonSimpleCycleToFace(f , [pi1, (e,>), pi2, (e,>)])7 RemoveCycleFromFace(f ,i)8 else9 (f)←10 g(f)← g−2211 e← CreateOpenEdge(vstart, vend)12 AddNonSimpleCycleToFace(f , [pi1, (e,>)])13 AddNonSimpleCycleToFace(f , [pi2, (e,>)])14 RemoveCycleFromFace(f ,i)CutNonOrientableFaceAtNonDisconnectingNonOrientingOddOpenEdge (f ∈ F , i, jstart, jend ∈ N)Require: (f) =6 and g ≥ 2Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 g(f)← g − 13 e← CreateOpenEdge(vstart, vend)4 AddNonSimpleCycleToFace(f , [pi1, (e,>), pi2, (e,>)])5 RemoveCycleFromFace(f ,i)206D.7. Cut CellsCutNonOrientableFaceAtNonDisconnectingNonOrientingEvenOpenEdge (f ∈ F , i, jstart, jend ∈ N)Require: (f) =6 and g ≥ 3Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 g(f)← g − 23 e← CreateOpenEdge(vstart, vend)4 AddNonSimpleCycleToFace(f , [pi1, (e,>)])5 AddNonSimpleCycleToFace(f , [pi2, (e,>)])6 RemoveCycleFromFace(f ,i)CutNonOrientableFaceAtDisconnectingOpenEdge (f ∈ F , i, jstart, jend, 1, 2, g1, g2, I ⊆ N)Require: (f) =6Require: 1 =6 or 2 =6Require: (1 = and 2 =6)⇒ (g2 ≥ 1 and g(f) = 2g1 + g2)Require: (1 =6 and 2 =)⇒ (g1 ≥ 1 and g(f) = g1 + 2g2)Require: (1 =6 and 2 =6)⇒ (g1 ≥ 1, g2 ≥ 1, and g(f) = g1 + g2)Require: Equation D.181 (vstart, vend, pi1, pi2)← SplitCycle(γi(f), jstart, jend)2 e← CreateOpenEdge(vstart, vend) . Create the cut edge e and the two faces f1 and f23 f1 ← CreateFace(1, g1)4 f2 ← CreateFace(2, g2)5 for all cycle γi′ of f , i′ 6= i do . Distribute the cycles of f , except γi, among f1 and f26 if i ∈ I then7 AddCycleToFace(f1,γi′(f))8 else9 AddCycleToFace(f2,γi′(f))10 AddNonSimpleCycleToFace(f1, [pi1, (e,>)]) . Add cycle [pi1, (e,>)] to f1 and [pi2, (e,⊥)] to f211 AddNonSimpleCycleToFace(f2, [pi2, (e,⊥)])12 HardDelete(f ) . Delete f207D.7. Cut CellsD.7.8 Cutting a Face at an Open Edge Starting and Ending at DifferentHolesFinally, the last case to consider is when the cut edge e is an open edge that starts and ends atdierent holes, represented by dierent cycles γi1 and γi2 of f . Fortunately, this case is actuallyvery easy to handle, as it can be shown that it never disconnects f , and preserves its orientabilityand genus. Therefore, its only action is to merge the two cycles γi1 and γi2 into a single cycle, byjoining them with e, as per the algorithm below:RotatedCycle (γ ∈ Γ, j ∈ N)Require: γ is a Steiner cycle, or a non-simple cycle with j ∈ [1..N(γ)]1 if γ is a Steiner cycle then . γ = [v]2 v′ ← v(γ)3 γ′ ← γ4 else . γ = [ h1 · · · hj •vjhj+1 · · · hN ]5 v′ ← vj(γ)6 γ′ ← [ hj+1 · · · hN h1 · · · hj ]7 return (v′, γ′)CutFaceAtOpenEdge (f ∈ F , i1 ∈ N, i2 ∈ N, j1 ∈ N, j2 ∈ N)Require: (i1, i2) ∈ [1..k(f)]2Require: γi1(f) is a Steiner cycle, or a non-simple cycle with j1 ∈ [1..N(γi1(f))]Require: γi2(f) is a Steiner cycle, or a non-simple cycle with j2 ∈ [1..N(γi2(f))]1 (v1, γ1)← RotatedCycle(i1, j1)2 (v2, γ2)← RotatedCycle(i2, j2)3 e← CreateOpenEdge(v1, v2)4 AddNonSimpleCycleToFace(f , [γ1, (e,>), γ2, (e,⊥)])5 RemoveCyclesFromFace(f ,{i1, i2})D.7.9 Flipping Cycles of Non-Orientable FacesWhen cutting a non-orientable face, there is one additional subtlety that has been omitted forclarity. It starts with the observation that directions of cycles matter for orientable faces, but donot matter for non-orientable faces. This means that it is always possible to ip the direction ofany cycle of any non-orientable face, and this will result in a homeomorphic abstract PCS complex(i.e., their geometric realization is homeomorphic). Therefore, the topological operator below is208D.7. Cut Cellsessentially a null operation, and can be performed at any time without changing what PCS complexit represents:FlipCycle (f ∈ F , i ∈ N)Require: (f) =6 and i ∈ [1..k(f)]1 γi(f)← γi(f)However, it cannot be performed for orientable faces since it could lead to non-homeomorphicPCS complexes. For instance, consider two abstract PCS complexes, each of them being made ofone closed cycle e◦ and one face f . In the rst abstract PCS complex, the face isf = (, 0, [ [(e◦,>)], [(e◦,>)] ]), (D.19)while in the second abstract PCS complex, the face isf = (, 0, [ [(e◦,>)], [(e◦,⊥)] ]). (D.20)In both cases, it is possible to uncut at e◦, but the resulting PCS complexes are not homeomorphic:one leads to a Klein bottle while the other leads to a torus, as formalized below:f = (, 0,[[(e◦,>)][(e◦,>)]]) UnCutAt(e◦)−−−−−−−−→ f ′ = (6, 2, [ ]) (D.21)f = (, 0,[[(e◦,>)][(e◦,⊥)]]) UnCutAt(e◦)−−−−−−−−→ f ′ = (, 1, [ ]) (D.22)This has to be compared with the non-orientable case, where indeed direction does not matter, asillustrated by the examples below:f = (6, 1,[[(e◦,>)][(e◦,>)]]) UnCutAt(e◦)−−−−−−−−→ f ′ = (6, 3, [ ]) (D.23)f = (6, 1,[[(e◦,>)][(e◦,⊥)]]) UnCutAt(e◦)−−−−−−−−→ f ′ = (6, 3, [ ]) (D.24)Therefore, when a non-orientable face f generates an orientable face f ′, f1 or f2 under the actionof a cut, in addition to give as input which cycles to transfer to the orientable face, it is alsonecessary to give as input what directions to give to these cycles, directions that could be computed209D.8. Uncut Cellsif ecut was given as edges of an underlying triangulation. Also, in the case where a non-orientableface is cut at an open edge starting and ending at the same hole, there are in fact two possiblenon-homeomorphic outcomes of the cut: either merging γi1 and γi2 into [γi1 , (e,>), γi2 , (e,⊥)],or merging them into [
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Topological modeling for vector graphics
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Topological modeling for vector graphics Dalstein, Boris 2017
pdf
Page Metadata
Item Metadata
Title | Topological modeling for vector graphics |
Creator |
Dalstein, Boris |
Publisher | University of British Columbia |
Date Issued | 2017 |
Description | In recent years, with the development of mobile phones, tablets, and web technologies, we have seen an ever-increasing need to generate vector graphics content, that is, resolution-independent images that support sharp rendering across all devices, as well as interactivity and animation. However, the tools and standards currently available to artists for authoring and distributing such vector graphics content have many limitations. Importantly, basic topological modeling, such as the ability to have several faces share a common edge, is largely absent from current vector graphics technologies. In this thesis, we address this issue with three major contributions. First, we develop theoretical foundations of vector graphics topology, grounded in algebraic topology. More specifically, we introduce the concept of Point-Curve-Surface complex (PCS complex) as a formal tool that allows us to interpret vector graphics illustrations as non-manifold, non-planar, non-orientable topological spaces immersed in R2, unlike planar maps which can only represent embeddings. Second, based on this theoretical understanding, we introduce the vector graphics complex (VGC) as a simple data structure that supports fundamental topological modeling operations for vector graphics illustrations. It allows for the direct representation of incidence relationships between objects, while at the same time keeping the geometric flexibility of stacking-based systems, such as the ability to have edges and faces overlap each others. Third and last, based on the VGC, we introduce the vector animation complex (VAC), a data structure for vector graphics animation, designed to support the modeling of time-continuous topological events, which are common in 2D hand-drawn animation. This allows features of a connected drawing to merge, split, appear, or disappear at desired times via keyframes that introduce the desired topological change. Because the resulting space-time complex directly captures the time-varying topological structure, features are readily edited in both space and time in a way that reflects the intent of the drawing. |
Genre |
Thesis/Dissertation |
Type |
Text |
Language | eng |
Date Available | 2017-09-20 |
Provider | Vancouver : University of British Columbia Library |
Rights | Attribution 4.0 International |
DOI | 10.14288/1.0355734 |
URI | http://hdl.handle.net/2429/63078 |
Degree |
Doctor of Philosophy - PhD |
Program |
Computer Science |
Affiliation |
Science, Faculty of Computer Science, Department of |
Degree Grantor | University of British Columbia |
Graduation Date | 2017-11 |
Campus |
UBCV |
Scholarly Level | Graduate |
Rights URI | http://creativecommons.org/licenses/by/4.0/ |
Aggregated Source Repository | DSpace |
Download
- Media
- 24-ubc_2017_november_dalstein_boris.pdf [ 6.75MB ]
- Metadata
- JSON: 24-1.0355734.json
- JSON-LD: 24-1.0355734-ld.json
- RDF/XML (Pretty): 24-1.0355734-rdf.xml
- RDF/JSON: 24-1.0355734-rdf.json
- Turtle: 24-1.0355734-turtle.txt
- N-Triples: 24-1.0355734-rdf-ntriples.txt
- Original Record: 24-1.0355734-source.json
- Full Text
- 24-1.0355734-fulltext.txt
- Citation
- 24-1.0355734.ris