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 (10.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page