Skip to main content

Loads SVG files into pyglet Batch objects for OpenGL rendering.

Project description

The polygons from the SVG file are tesselated using GLU functions, and used to create a pyglet Batch object of 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’ attribute, 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 Distributions

svgbatch-0.1.3.zip (10.8 kB view hashes)

Uploaded Source

svgbatch-0.1.3.tar.gz (8.1 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