skip to main content
research-article

Polar stroking: new theory and methods for stroking paths

Published:12 August 2020Publication History
Skip Abstract Section

Abstract

Stroking and filling are the two basic rendering operations on paths in vector graphics. The theory of filling a path is well-understood in terms of contour integrals and winding numbers, but when path rendering standards specify stroking, they resort to the analogy of painting pixels with a brush that traces the outline of the path. This means important standards such as PDF, SVG, and PostScript lack a rigorous way to say what samples are inside or outside a stroked path. Our work fills this gap with a principled theory of stroking.

Guided by our theory, we develop a novel polar stroking method to render stroked paths robustly with an intuitive way to bound the tessellation error without needing recursion. Because polar stroking guarantees small uniform steps in tangent angle, it provides an efficient way to accumulate arc length along a path for texturing or dashing. While this paper focuses on developing the theory of our polar stroking method, we have successfully implemented our methods on modern programmable GPUs.

Skip Supplemental Material Section

Supplemental Material

a145-kilgard.mp4

mp4

194.6 MB

3386569.3392458.mp4

Presentation video

mp4

269.7 MB

References

  1. Bryan D. Ackland and Neil H. Weste. 1981. The Edge Flag Algorithm: A Fill Method for Raster Scan Displays. IEEE Trans. Comput. 30, 1 (Jan. 1981), 41--48. http://dl.acm.org/citation.cfm?id=1963620.1963624Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Adobe Systems. 1985. PostScript Language Reference Manual (1st ed.). Addison-Wesley Longman Publishing Co., Inc.Google ScholarGoogle Scholar
  3. Adobe Systems. 2008. Document management-Portable document format-Part 1: PDF 1.7. http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf Also published as ISO 32000.Google ScholarGoogle Scholar
  4. Paul J. Asente. 2010. Folding Avoidance in Skeletal Strokes. In Proceedings of the Seventh Sketch-Based Interfaces and Modeling Symposium (Annecy, France) (SBIM '10). Eurographics Association, Goslar, DEU, 33--40.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Richard Beach and Maureen Stone. 1983. Graphical Style Towards High Quality Illustrations. In Proceedings of the 10th Annual Conference on Computer Graphics and Interactive Techniques (Detroit, Michigan, USA) (SIGGRAPH '83). ACM, New York, NY, USA, 127--135. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jack E Bresenham. 1965. Algorithm for computer control of a digital plotter. IBM Systems journal 4, 1 (1965), 25--30.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Marc Corthout and Evert-Jan Pol. 1991. Supporting Outline Font Rendering in Dedicated Silicon: the PHAROS Chip. In Conference proceedings on Raster imaging and digital typography II. Cambridge University Press, 177--189.Google ScholarGoogle Scholar
  8. Marc Corthout and Evert-Jan Pol. 1992. Point Containment and the PHAROS Chip. Ph.D. Dissertation. University of Leiden.Google ScholarGoogle Scholar
  9. Mark Dokter, Jozef Hladky, Mathias Parger, Dieter Schmalstieg, Hans-Peter Seidel, and Markus Steinberger. 2019. Hierarchical Rasterization of Curved Primitives for Vector Graphics Rendering on the GPU. Computer Graphics Forum 38, 2 (2019), 93--103. Google ScholarGoogle ScholarCross RefCross Ref
  10. ECMA International. 2009. Standard ECMA-388: Open XML Paper Specification. http://www.ecma-international.org/publications/standards/Ecma-388.htmGoogle ScholarGoogle Scholar
  11. Antonio Elias Fabris, Luciano Silva, and A Robin Forrest. 1997. An efficient filling algorithm for non-simple closed curves using the point containment paradigm. In Proceedings X Brazilian Symposium on Computer Graphics and Image Processing. IEEE, 2--9. Google ScholarGoogle ScholarCross RefCross Ref
  12. A. E. Fabris, L. Silva, and A. R. Forrest. 1998. Stroking discrete polynomial Bezier curves via point containment paradigm. In Proceedings SIBGRAPI'98. International Symposium on Computer Graphics, Image Processing, and Vision (Cat. No.98EX237). 94--101. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. T. Farouki and C. A. Neff. 1990a. Algebraic Properties of Plane Offset Curves. Computer Aided Geometric Design 7, 1-4 (June 1990), 101--127. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. T. Farouki and C. A. Neff. 1990b. Analytic Properties of Plane Offset Curves. Computer Aided Geometric Design 7, 1-4 (June 1990), 83--99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Michael S. Floater. 1992. Derivatives of rational Bézier curves. Computer Aided Geometric Design 9, 3 (1992), 161--174. https://www.mn.uio.no/math/english/people/aca/michaelf/papers/bez.pdfGoogle ScholarGoogle ScholarDigital LibraryDigital Library
  16. Michael S. Floater. 2005. Arc length estimation and the convergence of polynomial curve interpolation. BIT Numerical Mathematics 45, 4 (2005), 679--694.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Francisco Ganacim, Rodolfo S. Lima, Luiz Henrique de Figueiredo, and Diego Nehab. 2014. Massively-parallel Vector Graphics. ACM Trans. Graph. 33, 6, Article 229 (Nov. 2014), 14 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. James Gosling, David S. H. Rosenthal, and Michele J. Arden. 1989. The NeWS book: an introduction to the network/extensible window system. Springer-Verlag.Google ScholarGoogle Scholar
  19. Jens Gravesen. 1995. The Length of Bézier Curves. In Graphics Gems V, Alan Paeth (Ed.). Elsevier.Google ScholarGoogle Scholar
  20. Aaron Hertzmann. 2003. Tutorial: A Survey of Stroke-Based Rendering. IEEE Comput. Graph. Appl. 23, 4 (July 2003), 70--81. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Hewlett-Packard. 1992. PCL5 Printer Language Technical Reference Manual. https://developers.hp.com/system/files/PCL_5_Printer_Language_Technical_Reference_Manual.pdf HP Part No. 5961-0509.Google ScholarGoogle Scholar
  22. John D. Hobby. 1985. Digitized Brush Trajectories. Ph.D. Dissertation. Stanford University. https://9p.io/who/hobby/thesis.pdf Also Stanford Report STAN-CS-85-1070.Google ScholarGoogle Scholar
  23. Kai Hormann and Marco Tarini. 2004. A Quadrilateral Rendering Primitive. In Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware (Grenoble, France) (HWWS '04). ACM, New York, NY, USA, 7--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Kiia Kallio. 2007. Scanline Edge-flag Algorithm for Antialiasing. In Theory and Practice of Computer Graphics, Ik Soo Lim and David Duce (Eds.). The Eurographics Association. Google ScholarGoogle ScholarCross RefCross Ref
  25. Mark J. Kilgard. 2020a. Anecdotal Survey of Variations in Path Stroking among Real-world Implementations. Supplemental document to this paper.Google ScholarGoogle Scholar
  26. Mark J. Kilgard. 2020b. Experiments Applying Polar Stroking to Topologically Varied and Troublesome Cases. Supplemental document to this paper.Google ScholarGoogle Scholar
  27. Mark J. Kilgard. 2020c. Ordinary Facet Angles of a Stroked Path Tessellated by Uniform Tangent Angle Steps Is Bounded by Twice the Step Angle. Supplemental document to this paper.Google ScholarGoogle Scholar
  28. Mark J. Kilgard and Jeff Bolz. 2012. GPU-accelerated Path Rendering. ACM Trans. Graph. 31, 6, Article 172 (Nov. 2012), 10 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Jan Eric Kyprianidis, John Collomosse, Tinghuai Wang, and Tobias Isenberg. 2013. State of the "Art": A Taxonomy of Artistic Stylization Techniques for Images and Video. IEEE Transactions on Visualization and Computer Graphics 19, 5 (May 2013), 866--885. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Jeffrey M. Lane, Robert Magedson, and Michael Rarick. 1983. An Algorithm for Filling Regions on Graphics Display Devices. ACM Trans. Graph. 2, 3 (July 1983), 192--196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Eugene T.Y. Lee. 1987. The Rational Bezier Representation for Conics. In Geometric Modeling: Algorithms and New Trends, Gerald E. Farin (Ed.). SIAM, Philadelphia, 3--19.Google ScholarGoogle Scholar
  32. Rui Li, Qiming Hou, and Kun Zhou. 2016. Efficient GPU Path Rendering Using Scanline Rasterization. ACM Trans. Graph. 35, 6, Article 228 (Nov. 2016), 12 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Charles Loop and Jim Blinn. 2005. Resolution independent curve rendering using programmable graphics hardware. In ACM SIGGRAPH 2005 Papers (Los Angeles, California) (SIGGRAPH '05). 1000--1009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Charles Loop and Jim Blinn. 2007. Rendering Vector Art on the GPU. In GPU Gems 3 (first ed.), Hubert Nguyen (Ed.). Addison-Wesley Professional. https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch25.htmlGoogle ScholarGoogle Scholar
  35. NVIDIA. 2012. Cg Toolkit 3.1. https://developer.nvidia.com/cg-toolkit-downloadGoogle ScholarGoogle Scholar
  36. Les Piegl and Wayne Tiller. 1995. The NURBS Book. Springer-Verlag, Berlin, Heidelberg.Google ScholarGoogle Scholar
  37. Michael L.V. Pitteway. 1967. Algorithm for drawing ellipses or hyperbolae with a digital plotter. Comput. J. 10, 3 (1967), 282--289.Google ScholarGoogle ScholarCross RefCross Ref
  38. Ian R. Porteous. 1994. Geometric differentiation for the intelligence of curves and surfaces.Google ScholarGoogle Scholar
  39. Detlef Reimers. 2011. Drawing Circles with Rational Quadratic Bezier Curves. https://ctan.math.illinois.edu/macros/latex/contrib/lapdf/rcircle.pdfGoogle ScholarGoogle Scholar
  40. Nicolas P. Rougier. 2013. Shader-Based Antialiased Dashed Stroked Polylines. Journal of Computer Graphics Techniques 2, 2 (Nov. 2013), 91--107. https://hal.inria.fr/hal-00907326Google ScholarGoogle Scholar
  41. Erik Ruf. 2011. An inexpensive bounding representation for offsets of quadratic curves. In Proceedings of the ACM SIGGRAPH Symposium on High Performance Graphics (Vancouver, British Columbia, Canada) (HPG '11). 143--150. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Ryan Schmidt. 2013. Stroke parameterization. In Computer Graphics Forum, Vol. 32. Wiley Online Library, 255--263.Google ScholarGoogle Scholar
  43. Maxim Shemanarev. 2006. Anti-Grain Geometry Library. https://sourceforge.net/projects/agg/Google ScholarGoogle Scholar
  44. Skia development team. 2009. Skia Graphics Library. https://skia.org/Google ScholarGoogle Scholar
  45. Steve Strassmann. 1986. Hairy Brushes. In Proceedings of the 13th Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH '86). ACM, New York, NY, USA, 225--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. SVG Working Group. 2011. Scalable Vector Graphics (SVG) 1.1 (2nd edition). http://www.w3.org/TR/SVG/Google ScholarGoogle Scholar
  47. Wayne Tiller and Eric Hanson. 1984. Offsets of Two-Dimensional Profiles. IEEE Comput. Graph. Appl. 4, 9 (Sept. 1984), 36--46. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Stephen Vincent and David Forsey. 2001. Fast and accurate parametric curve length computation. Journal of graphics tools 6, 4 (2001), 29--39.Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. John Warnock and Douglas K. Wyatt. 1982. A device independent graphics imaging model for use with raster devices. In Proceedings of the 9th Annual Conference on Computer Graphics and Interactive Techniques (Boston, Massachusetts, United States) (SIGGRAPH '82). ACM, New York, NY, USA, 313--319. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Whatwg.org. 2011. HTML Living Standard. Chapter The canvas element. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.htmlGoogle ScholarGoogle Scholar
  51. Turner Whitted. 1983. Anti-aliased Line Drawing Using Brush Extrusion. In Proceedings of the 10th Annual Conference on Computer Graphics and Interactive Techniques (Detroit, Michigan, USA) (SIGGRAPH '83). ACM, New York, NY, USA, 151--156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Songshan Yue, Jianshun Yang, Min Chen, Guonian Lu, A-xing Zhu, and Yongning Wen. 2016. A function-based linear map symbol building and rendering method using shader language. International Journal of Geographical Information Science 30, 2 (2016), 143--167. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Polar stroking: new theory and methods for stroking paths

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Graphics
      ACM Transactions on Graphics  Volume 39, Issue 4
      August 2020
      1732 pages
      ISSN:0730-0301
      EISSN:1557-7368
      DOI:10.1145/3386569
      Issue’s Table of Contents

      Copyright © 2020 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 12 August 2020
      Published in tog Volume 39, Issue 4

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader