Suppose I sketch a chair on a whiteboard, select the back, seat, and four legs, and click “Make 3D”. Making the sketch look more realistic would still leave me looking at a front view. To walk around and see the back, the whiteboard needs the chair’s three-dimensional shape and must draw it again from whatever angle I choose. The generator also has to fill in the other side of the chair back, which the sketch never showed.
During the week I was building an AI photo-editing whiteboard, I came across Vibe Draw, a project that put this operation behind a button. You can refine a sketch first, then turn selected shapes into a three-dimensional object. It uses TRELLIS, a model that can generate 3D objects from images. On the evening of April 5 I searched for Trellis, then added ai. Next in the same tab was a TRELLIS community demo for trying image-to-3D generation. But my whiteboard stored individual strokes. What should I give a model like that?12
How does the whiteboard give a handful of strokes to the model?
With nothing selected, the program prompts “First select something to make real.”3 In Vibe Draw, the tldraw editor knows which strokes are selected and can calculate a rectangle enclosing all of them. The program uses the rectangle twice. First it reserves a preview frame to its right, ready to display the result. Then it takes the selected shapes, excludes existing 3D previews, and exports the remaining strokes together as SVG, an image described with lines and shapes. The frontend renders it as a PNG and encodes the image as text that can travel with the request. That preserves the relative positions of the chair back and legs in one image.3
The right column shows the PNG sent to the model, separately from the canvas on the left. The back, seat, and legs are exported together. The potted plant outside the selection stays in place. The animation follows Vibe Draw’s selection export and preview code. The task ID is an example.34
What two results can the same button return?
At the time, the button had a brain icon and a switch beside it, enabled by default for a new model. Following the switch through the code reveals two generation paths. Three.js is a JavaScript library for drawing three-dimensional scenes in the browser. For a chair, a program can create a seat and four legs individually and position them.54
| Switch beside “Make 3D” | What goes to the generator | What the whiteboard receives |
|---|---|---|
| On | The selected image goes to TRELLIS to generate the object’s 3D shape. | A URL for a model file. The preview frame loads the object from that URL. |
| Off | The selected image and any text inside the selection go to Claude with a request for code that constructs the object using Three.js. | JavaScript. The preview frame stores the code and uses it to draw the object. |
Why does submitting an image return a number first?
While tracing the TRELLIS path, I opened line 26 of the backend’s routes.py at 18:12:41. Eighteen seconds later I opened the address on that line directly: https://api.piapi.ai/api/v1/task. PiAPI provides an interface to the generation service. The browser sends the image to Vibe Draw’s backend, which adds the service key and submits an image-to-3D task to PiAPI. The task_id in the initial response identifies this chair’s task.67
With that identifier, the whiteboard knows which result to wait for. It opens a WebSocket connection to its backend so the backend can send back news as it arrives. The backend polls PiAPI with the ID. Once the task finishes, it takes model_file from the result and sends it to the whiteboard. The frontend writes the URL into the reserved preview frame. The original sketch remains on the left and a chair you can view from different angles appears on the right.8
My own whiteboard needed a different operation. I wanted to draw a box around a car in a photograph and extract the enclosed pixels so the model would know which car I meant. Both operations involve drawing a selection, but Vibe Draw can export the individual strokes making up the chair, while my car is just one region of a larger photo. That difference determines what the editor should export. For the coordinate conversion, see Selecting regions and exporting images from a whiteboard.
Footnotes
-
martin226. (2025, March 25). Vibe Draw – Cursor for 3D Modeling. GitHub. Project home, Steps 1–4 of How It Works in the README at the time. I read the code as of commit
c75689df, already on the main branch on April 5. ↩ -
trellis-community. (n.d.). TRELLIS [Interactive demo]. Hugging Face Spaces. Image-to-3D demo. An old tab records searches at 18:09 and 18:11 on April 5. The first click on the demo page was not retained. ↩
-
martin226. (2025, March). vibe3DCode.tsx. GitHub. Creating the preview shape, excluding old previews, and exporting the selection. ↩ ↩2 ↩3
-
martin226. (2025, March). vibe3DCode.tsx and routes.py. GitHub. TRELLIS request and model URL, Image-and-text request and Three.js code, Backend passing the 3D task to Claude. ↩ ↩2
-
martin226. (2025, March). Vibe3DCodeButton.tsx. GitHub. Initial switch value, Passing the current switch value when creating a model. ↩
-
martin226. (2025, March). routes.py. GitHub. Line 26 as opened while browsing, API URL in the historical version, Submitting a task with the key. ↩
-
Google. (2026, October 2). piapi.ai [Search history]. Original query from a later search for the service. This date refers to the search. The URL opened on April 5, 2025, was the task URL in the source code in the preceding note. ↩
-
martin226. (2025, March). routes.py and vibe3DCode.tsx. GitHub. Querying by ID and returning the model file, Frontend handling success or failure messages. ↩