Skip to main content

Loads SVG into pyglet Batch objects of OpenGL GL_TRIANGLE primitives.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svgbatch-0.1.1.zip (10.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page