# Rebuild 3D: Take a Generated Object Apart and Put It Back

> Name a toy-like object and your Agent builds a 3D reassembly puzzle in one offline HTML file. In the main example, a painted toy steam engine sits split into ten parts on a workshop turntable; you orbit the camera, drag each part to its slot, turn it right and drop it in over three rounds, with ghosts, hints and a reveal spin. The object is split with Tripo Segment and generated through SandBase; the turntable, snapping and scoring are code.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.1.0
- Runs online: yes
- Page: https://www.sandbase.ai/skills/games/rebuild-3d

## What you get

Bring an object to disassemble, or a picture of one; the Agent writes the parts, slots, rounds and hints. The Skill returns a downloadable Skill (the game project, a greybox prototype mode, a cost-reserving SandBase model-job helper, an offline build and a scripted play-through) and a playable example with its prepared media.

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/rebuild-3d (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/rebuild-3d make a 3D reassembly puzzle out of <your object>, in a <your mood> mood
```

## How it works

1. **Name an object with real parts** Tell your Agent what to rebuild, for example: a painted toy steam locomotive in ten parts. Pick something whose parts are visibly separate — distinct colours and clear joints — because Tripo Segment splits by geometry and texture, not meaning; vehicles, lamps, windmills and machines work well. On your machine with Node 22.14.0, the Agent runs node scripts/new-project.mjs my-game and npm ci, then writes project.json: the object prompt listing each part, the part cap, music and the seven sound cues.
2. **Generate, split and name the parts** npm run generate prints every SandBase call with its worst-case price against your budget, and --confirm-real submits: image, model, Segment split, music, cues and a vision-model pass to name the parts, all billed to your SandBase account. npm run media then merges fragments, simplifies each part and measures its slot. The Agent reviews the part sheet and fixes wrong names by hand.
3. **Rebuild it once yourself** npm run build inlines every part and the audio into dist/index.html under connect-src none. npm run shoot orbits, zooms, drags a part into its slot and one into a wrong slot, uses a hint, turns a part with R, runs out the clock and plays a full run to the win. Then rebuild it yourself: parts should snap only when near their slot across the view and turned to fit.

## FAQ

### How does Rebuild 3D split an object into parts?

Through SandBase it generates an image and a textured Tripo text-to-3D model, then calls Tripo Segment, which splits the model where its shape and texture change — about ten raw pieces for the locomotive. Local processing merges fragments too small to pick up, simplifies each part, and records its slot, matching quarter turns and identical twins. Segment splits by geometry and texture rather than meaning, so the Agent reviews the rendered part sheet before building and can pick another object when the split reads badly.

### Are the part names reliable?

Not fully. A vision model names the parts from the part sheet for about a tenth of a cent, but five of ten names came back wrong in the official example — a chimney labelled a dome, the tender called a boiler — so the Agent checks every name against the sheet and fixes them by hand.

### What are the three rounds like?

Round one loosens half the parts with a ghost in every slot and nothing turned. Round two turns every part a wrong quarter and shows ghosts only for the held or selected part. Round three keeps every part turned, hides all ghosts, reduces hints and adds a clock of eleven seconds per part plus twelve, with four seconds lost per mistake. Each cleared round plays a reveal spin.

### Does Rebuild 3D call a model while I play?

No. All models and audio are generated once at build time and inlined into a single dist/index.html, which makes no network request at runtime. Generation bills your SandBase account, and a rerun skips finished parts so it never pays twice.

### Is the game in English only?

Yes, the bench UI is in English; this page is in English and Chinese. The build is one offline file of about 3.3 MiB that needs WebGL 2 and makes no network request. Music and effects have separate toggles and start after you press Start.

### Why is the demo sandboxed?

The frame has an opaque origin and no network access, so the scene can’t read anything from this page or reach the internet.

### Can I play Rebuild 3D on a phone?

Yes, one finger orbits on empty space and drags parts, with Rotate and Hint buttons replacing the R and H keys. The headless play-through drives the same touch controls at 390×844; it has been verified under touch emulation, not on real devices.

### Why is there no online generation?

Building a new scene needs a model key inside the sandbox, which the backend doesn’t support yet. Run the Skill with your own agent for now.

## Examples

- Rebuild 3D reassembly puzzle (scene)
- The Little Steam Engine (video)
