What is convex decomposition
Convex decomposition splits a model with dents into several convex pieces that together follow its shape. Physics engines collide convex shapes fast and stably, but one hull around a robot or a chair fills in its gaps. Several pieces keep the gaps open, and you trade a tighter fit against more contact tests.

Compiled robot, 2 m tall
64 convex pieces
- 64convex pieces, the most we asked for
- 32corners at most on each piece
- 7.6 mmfarthest the robot's surface sits outside a piece
- 2 mtall, set to real-world size
A generated robot compiled on the hosted API on 3 December 2026.
How convex decomposition works
A shape is convex when a line between any two points inside it stays inside. A robot is not, because the space between an arm and its body is outside the shape while both ends of a line across it are inside.
Decomposition cuts the model into parts that are each close to convex, then wraps each part in a hull. A method stops cutting when the pieces fit within a concavity limit, or when it reaches the piece count you set.
CoACD and V-HACD
V-HACD is the older method. It builds pieces from a voxel grid, which is fast and can fit loosely. CoACD cuts along planes chosen to keep each piece close to its part, which usually fits tighter on the same piece count and takes longer. Both are open source, under BSD and MIT licenses.
How many pieces to ask for
- A box-like prop needs one convex hull, and no decomposition.
- A chair or a cart needs a handful of pieces.
- A robot with arms, legs and a head can use dozens, up to the cap you set.
- Cap the corners on each piece too, since some engines limit them.
Convex pieces with meshfx
meshfx splits your model into convex pieces within the piece and corner counts you set, and lists each piece's corners in meters in a layout file. On a 2 m robot it built 64 pieces with at most 32 corners each, and the surface sat at most 7.6 mm outside them. See the convex collision job for the overlay.
Use with your agent
Paste the prompt into Claude Code, Cursor or Codex. Your agent connects to Spatial Compiler and comes back with a GLB and a report that counts the holes, flipped faces and non-manifold edges, so you know what to fix.
New accounts start with $5 of usage, and you see the price of each job before it runs.
Connect the Spatial Compiler MCP server at https://spatialcompiler.dev/mcp if it isn't connected yet. Use meshfx to check my model for holes, flipped faces and non-manifold edges and give me a GLB with the report. Run a Draft first. Your first 50 mesh Drafts are free with the $5 signup credit. Ask before running a final compile.
Or add the server yourself in Claude Code:
claude mcp add --transport http spatial-compiler https://spatialcompiler.dev/mcp
Convex decomposition questions
What is convex decomposition?
Convex decomposition splits a model with dents into several convex pieces that together cover its shape. Physics engines test contact on those pieces quickly.
What is CoACD?
CoACD is an open-source method that builds convex pieces from a mesh, and it is MIT licensed. meshfx can use it, or V-HACD, to make collision pieces.
What is V-HACD?
V-HACD is an older open-source method that splits a mesh into convex pieces, under a BSD license. It is fast, and the pieces can fit looser than CoACD's.
How many convex pieces should a model have?
Use as few as keep the fit tight enough for your task. A box-like prop needs one, a chair a handful, and a robot with arms and a head can need dozens.