Zpup
A TypeScript library that turns a small 3D scene described as JSON into a flat, script-free SVG picture viewable from any angle.
At a Glance
Zpup core library, released under the MIT License. Free to use, copy, modify, merge, publish, distribute, sublicense and sell.
Engagement
Available On
Alternatives
Listed Nov 2026
About Zpup
Zpup is an open-source library by rxolve for describing a small 3D scene as data and rendering it as a flat SVG from any viewing angle. It is inspired by Zdog, shares no code with it, and is not affiliated with it. The output SVG contains no JavaScript, so it works in an image tag, an email or a README. The README describes the project as early, with the API possibly changing before 1.0.
What It Is
Zpup is a pseudo-3D illustration library for small pieces with volume, such as icons, mascots, props and little buildings. A scene is a plain object tree (or equivalent JSON) built from nodes such as group, path, ellipse, rect and polygon, plus solids like box, pyramid, cylinder, cone and hemisphere. Zpup works out which shapes hide which and how each face is shaded, then writes the SVG. It uses orthographic projection with no perspective, textures or placed lights, and it is not a 3D engine. Shapes that cut deeply into each other are not drawn correctly.
How the Rendering Works
renderSvg returns an SVG string with no DOM, so it can run on a server. Changing rotate on the scene re-renders it from another side. Zpup compares every pair of overlapping shapes to decide which is in front. The README's benchmark reports a lower share of wrongly ordered paint than Zdog. Optional soft shading adds gradients to round surfaces, and the backface option keeps surface details such as eyes from flickering as a model turns. renderSpinSvg produces a SMIL-animated SVG that turns the scene one full rotation about one axis, with no JavaScript.
Validation and AI Use
Invalid scenes throw a ZpupValidationError that lists each problem with its path and a suggested fix. checkScene and checkSceneWarnings return issues without throwing. The @zpup/mcp MCP server lets a model write a scene, receive errors, and view PNGs from several angles in one call. An llms.txt reference is provided for AI coding tools.
Setup Path
Install with npm install @zpup/core. It is ESM-only, has no runtime dependencies, and uses no Node APIs, so it also runs in browsers. A web playground lets you edit scene JSON, drag to turn the picture, and export still or turning SVGs. Not yet built: a canvas renderer, general animation and framework bindings.
Community Discussions
Be the first to start a conversation about Zpup
Share your experience with Zpup, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Zpup core library, released under the MIT License. Free to use, copy, modify, merge, publish, distribute, sublicense and sell.
- MIT License
- npm install @zpup/core
- No runtime dependencies
- MCP server available: npx -y @zpup/mcp
- Free browser playground to edit scenes and export SVG
Capabilities
Key Features
- Describe 3D scenes as plain objects or JSON
- Flat SVG output with no JavaScript
- Render from any view angle by changing rotate
- Pairwise depth sorting of overlapping shapes
- Solids: box, pyramid, cylinder, cone, hemisphere
- Optional soft shading
- Backface control for flat shapes
- Turning SVG animation via SMIL
- Detailed validation errors and warnings
- MCP server for AI models
- Browser playground with SVG export
- Server-side rendering without a DOM
