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.
Supplemental Material
- 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 ScholarDigital Library
- Adobe Systems. 1985. PostScript Language Reference Manual (1st ed.). Addison-Wesley Longman Publishing Co., Inc.Google Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Jack E Bresenham. 1965. Algorithm for computer control of a digital plotter. IBM Systems journal 4, 1 (1965), 25--30.Google ScholarDigital Library
- 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 Scholar
- Marc Corthout and Evert-Jan Pol. 1992. Point Containment and the PHAROS Chip. Ph.D. Dissertation. University of Leiden.Google Scholar
- 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 ScholarCross Ref
- ECMA International. 2009. Standard ECMA-388: Open XML Paper Specification. http://www.ecma-international.org/publications/standards/Ecma-388.htmGoogle Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Michael S. Floater. 2005. Arc length estimation and the convergence of polynomial curve interpolation. BIT Numerical Mathematics 45, 4 (2005), 679--694.Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- Jens Gravesen. 1995. The Length of Bézier Curves. In Graphics Gems V, Alan Paeth (Ed.). Elsevier.Google Scholar
- Aaron Hertzmann. 2003. Tutorial: A Survey of Stroke-Based Rendering. IEEE Comput. Graph. Appl. 23, 4 (July 2003), 70--81. Google ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Mark J. Kilgard. 2020a. Anecdotal Survey of Variations in Path Stroking among Real-world Implementations. Supplemental document to this paper.Google Scholar
- Mark J. Kilgard. 2020b. Experiments Applying Polar Stroking to Topologically Varied and Troublesome Cases. Supplemental document to this paper.Google Scholar
- 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 Scholar
- Mark J. Kilgard and Jeff Bolz. 2012. GPU-accelerated Path Rendering. ACM Trans. Graph. 31, 6, Article 172 (Nov. 2012), 10 pages. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- NVIDIA. 2012. Cg Toolkit 3.1. https://developer.nvidia.com/cg-toolkit-downloadGoogle Scholar
- Les Piegl and Wayne Tiller. 1995. The NURBS Book. Springer-Verlag, Berlin, Heidelberg.Google Scholar
- Michael L.V. Pitteway. 1967. Algorithm for drawing ellipses or hyperbolae with a digital plotter. Comput. J. 10, 3 (1967), 282--289.Google ScholarCross Ref
- Ian R. Porteous. 1994. Geometric differentiation for the intelligence of curves and surfaces.Google Scholar
- Detlef Reimers. 2011. Drawing Circles with Rational Quadratic Bezier Curves. https://ctan.math.illinois.edu/macros/latex/contrib/lapdf/rcircle.pdfGoogle Scholar
- 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 Scholar
- 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 ScholarDigital Library
- Ryan Schmidt. 2013. Stroke parameterization. In Computer Graphics Forum, Vol. 32. Wiley Online Library, 255--263.Google Scholar
- Maxim Shemanarev. 2006. Anti-Grain Geometry Library. https://sourceforge.net/projects/agg/Google Scholar
- Skia development team. 2009. Skia Graphics Library. https://skia.org/Google Scholar
- 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 ScholarDigital Library
- SVG Working Group. 2011. Scalable Vector Graphics (SVG) 1.1 (2nd edition). http://www.w3.org/TR/SVG/Google Scholar
- Wayne Tiller and Eric Hanson. 1984. Offsets of Two-Dimensional Profiles. IEEE Comput. Graph. Appl. 4, 9 (Sept. 1984), 36--46. Google ScholarDigital Library
- Stephen Vincent and David Forsey. 2001. Fast and accurate parametric curve length computation. Journal of graphics tools 6, 4 (2001), 29--39.Google ScholarDigital Library
- 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 ScholarDigital Library
- Whatwg.org. 2011. HTML Living Standard. Chapter The canvas element. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.htmlGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Polar stroking: new theory and methods for stroking paths
Recommendations
Converting stroked primitives to filled primitives
Vector graphics formats offer support for both filled and stroked primitives. Filled primitives paint all points in the region bounded by a set of outlines. Stroked primitives paint all points covered by a line drawn over the outlines. Editors allow ...
Accelerating vector graphics rendering using the graphics hardware pipeline
We describe our successful initiative to accelerate Adobe Illustrator with the graphics hardware pipeline of modern GPUs. Relying on OpenGL 4.4 plus recent OpenGL extensions for advanced blend modes and first-class GPU-accelerated path rendering, we ...
Efficient GPU path rendering using scanline rasterization
We introduce a novel GPU path rendering method based on scan-line rasterization, which is highly work-efficient but traditionally considered as GPU hostile. Our method is parallelized over boundary fragments, i.e., pixels directly intersecting the path ...
Comments