Loads SVG into pyglet Batch objects of OpenGL GL_TRIANGLE primitives.
SvgBatch loads SVG files and tesselates the resulting polygons using GLU functions to create a pyglet Batch object using indexed vertex arrays. The Batch will aggregate all paths from an SVG file into a single OpenGL GL_TRIANGLES primitive for rendering. Each path is also exposed in its untessellated form, indexed by ‘id’ attributes, so the application could use them for collision detection, for example. Currently only a subset of SVG is handled - closed polygons, filled with solid color. These may comprise multiple loops (disjoint areas or holes), but must be made up from straight line edges. Arc polygon edges, gradient fills and other SVG entities (such as rectangles or text) are not currently handled. Requires pyglet.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.