---
title: 3D Bot Avatars From One SVG Path
date: '2026-11-10'
description: 'One flat SVG outline and two eye positions become a character that turns, blinks and thinks. How Open Bot Avatar fakes depth, and why a model can draw one.'
author: Pablo Fernandez
tags:
  - Open Source
  - SVG
  - Canvas
  - AI
  - Design
source: 'https://www.pablofr.com/blog/3d-bot-avatars-from-one-svg-path'
---
A few weeks ago I wrote about [Pum](/blog/pixel-art-ai-assistant), the rubber stamp that stands in for the assistant in Sumalos. The point of that post was that a chat with a model has states a spinner draws badly (waiting, streaming, done, failed) and a face draws well, and that the face is cheapest when nothing is drawn by hand: every frame of Pum is computed from distance functions, so a new hat doesn't mean redrawing a thousand frames.

Last week Dominik Scholz published [Open Bot Avatar](https://github.com/DominikScholz/open-bot-avatar), and it starts from the same two ideas, then takes a turn I didn't. Pum is one character, hand-built in code. Open Bot Avatar is a format: an avatar is a single SVG path and the position of two eyes, written as a few lines of JSON, and a renderer turns that into a small 3D object that follows your pointer, blinks, breathes, thinks and smiles. Anyone can make one. So can a language model, from a sentence.

That raises the question this post is about: how do you get a character that turns in three dimensions out of a drawing that's completely flat?

![The Open Bot Avatar editor: a large purple speech bubble with two eyes on the left, with Idle, Thinking and Happy buttons and Export and Copy below it; on the right a gallery of 22 object characters (a ghost, a mug, a book, a cat, a bulb, a sprout, a cloud, a magnifier, a shield, a witch hat, a brain, a bunny and more), a palette of colours, and Bot, Generate and Import tabs](/blog/3d-bot-avatars-from-one-svg-path/editor.webp "The project's own editor, captured from its public site: pick an object, colour it, try the three moods, export it.")

## The whole definition

This is a complete, valid avatar, straight from the project's README:

```json:box.json
{
  "version": 1,
  "id": "box",
  "name": "Box",
  "body": { "path": "M20 20 H80 V80 H20 Z" },
  "eyes": { "x": 50, "y": 46, "spacing": 15, "scale": 1 }
}
```

One path in a fixed 100 by 100 box, and where the pair of eyes sits: their centre, the distance between them, their size. That's all a definition may contain. The [contract](https://github.com/DominikScholz/open-bot-avatar/blob/main/docs/avatar-contract.md) rejects colours, gradients, images, animation and unknown fields; the runtime owns all of those. The colour is an option you pass when you mount it, the depth is a number from 0 (flat) to 14, and the mood is `idle`, `thinking` or `happy`.

Splitting it this way is what makes everything else possible. A definition is small enough to read, safe enough to accept from a stranger (`validateAvatar` checks one before anything renders it), and simple enough that a model can write it.

## Inflating a flat outline

The renderer never asks the definition for depth, because there isn't any. It infers it. The comment at the top of [`volume.ts`](https://github.com/DominikScholz/open-bot-avatar/blob/main/packages/core/src/volume.ts) describes the method in a paragraph, and it's the cleverest part of the project.

Every closed shape in the path becomes a part, and each part gets one of three treatments:

- **Inflate:** a rounded slab, like a cushion. Its height follows a rounded fillet of the distance to the outline, so the sides curve and the face stays flat. Most objects are this.
- **Revolve around the vertical:** a [solid of revolution](https://en.wikipedia.org/wiki/Solid_of_revolution), taken from the exact width of the shape at each height. A mug's body, a pot, a light bulb.
- **Revolve around the horizontal:** the same around an axis the whole body shares, so a barbell's bar becomes a cylinder and its plates become discs.

That gives each part a height field: how far its front surface sits from the middle, at every point. Then comes the trick that makes it cheap to draw. The part is cut, once, into two stacks of flat slices: one stack of planes facing the viewer, taken at different heights, and one stack facing sideways. Painted in a single flat colour, the slices of a stack add up to the silhouette of the solid.

```
  SVG path (flat)
        │
        ▼
  parts: inflate · revolve-y · revolve-x
        │
        ▼
  height field h(x, y) per part
        │  cut once
        ▼
  two stacks of slices: facing front, facing sideways
        │  every frame
        ▼
  pick the stack that faces the viewer more,
  project it, paint back to front ──▶ one canvas
```

*From one flat outline to a turning solid: the depth is inferred once, cut into flat slices, and every frame only projects them.*

The renderer shows whichever stack faces you more, so no slice is ever seen edge on, and turning the avatar never needs a 3D model, a mesh or a shader. The mug below is that: a flat outline of a mug with a handle-shaped hole, turned toward wherever the pointer is.

![Four frames of the white mug avatar on a dark background: looking up and to the left with the top of the mug visible, looking down and to the right with the handle swinging in front, the thinking mood with the eyes glancing aside, and the happy mood with the eyes turned into two upward arcs](/blog/3d-bot-avatars-from-one-svg-path/mug-states.webp "The mug from the gallery, captured from the editor: the same flat path, turned by the pointer, then thinking and happy.")

Pum solves the same problem the other way round. Its renderer walks every pixel of its canvas and undoes the pose to find which model point lands there, which only works because Pum is pixel art: there's no depth to invent, just a 48 by 72 grid to sample. Open Bot Avatar has to look smooth at any size, so it works in vector slices instead of pixels. The idea underneath is the same in both: compute the frame from a description, never store it.

## The face does the talking

Both projects agree on the part that matters most: the eyes carry the state. In Open Bot Avatar they are two dark pills, and the runtime does the rest. Some details from the code:

- **Blinking:** one blink in each slot of about 4.2 seconds, at an offset seeded from the avatar, and sometimes a double blink, so two avatars on a page don't blink in step.
- **Breathing:** the body stretches 1.2% taller and 0.8% narrower on a slow wave.
- **Moods:** switching from idle to thinking or happy takes 420 ms, eased, and a change that starts in the middle of another continues from wherever the pose is, so clicking fast never makes it jump.
- **Bigger eyes where they fit:** the contract says an eye is about 4 by 11 units at scale 1, but the renderer draws them up to 1.45 times larger wherever the body leaves room, always keeping 3 units from the outline.

That last rule says a lot about the project. The eyes are the point, so the renderer spends whatever room the shape gives it on them.

## A model as the designer

In the editor's Generate tab you describe what you want ("a watering can", "something for a chess club") and get a prompt to paste into any chat model; you paste the JSON it returns into Import. The [design prompt](https://github.com/DominikScholz/open-bot-avatar/blob/main/skills/generate-avatar/references/system-prompt.md) is worth reading on its own, because it's a short course in character design written for a model:

> The part that carries the face is the main mass. Exaggerate it beyond the real object's proportions as far as the face needs, and no further.

It goes on like that: judge a part by its outer envelope, not its filled area, because a thin loop reads as big as the space it encloses; the face part should be the first thing you see at 28 pixels; if the finished silhouette reads as a different object, rebalance it even when every rule passes.

And because a model will break rules, there's a validator behind the prompt. The basic check makes sure the definition is safe and the eyes sit on solid fill. A strict mode, which the gallery's CI runs, adds two checks you'd only think of after looking at a lot of bad avatars: the drawn eyes must keep 4.5 units of clearance at rest and at full gaze, and the outline must have no small accidental steps (between 0.3 and 2.5 units) where two parts meet, the kind of seam a model leaves when it glues a handle onto a body. A definition that fails strict mode still renders; the renderer just shrinks the eyes or the gaze to fit.

That's the difference with Pum, put plainly. Pum's characters are code, so making one means writing code. An Open Bot Avatar character is data with a contract, so making one takes a sentence and a validator.

## What it costs to keep it moving

The project's history is mostly about one thing: making many small animated avatars cheap. The first renderer was a CSS 3D scene with one small SVG per slice, which lets the browser's compositor do the projection, but every visible slice costs a compositor layer. Version 0.2 paints live avatars to a single canvas by default instead. The commit message explains a number I didn't know: Chrome's GPU canvas holds about ten times its bitmap in video memory while it animates antialiased paths, so the canvas is now sized to what the frames actually paint, not to the largest extent an avatar could reach. Small avatars drop to 30 frames per second, and avatars that scroll out of view stop animating.

It ships as [`open-bot-avatar`](https://www.npmjs.com/package/open-bot-avatar) on npm with no dependencies, under the MIT licence, with a still SVG renderer that needs no DOM at all and a React component you copy rather than install.

## Why I like it

Pum and Open Bot Avatar are two answers to the same brief: give the assistant a face that shows what the model is doing, and don't draw it by hand. Pum bets on one character with a lot of personality, 23 gestures and a wardrobe. Open Bot Avatar bets on a format small enough that a model can fill it in and strict enough that the result is still good, and gets volume, gaze and moods for free from a single path. If I were starting Sumalos's assistant today, I'd be tempted to give Pum's engine Open Bot Avatar's contract: a character as data, checked, and computed every frame.
