---
id: "coacd-convex-decomposition"
title: "CoACD Approximate Convex Decomposition"
aliases: [CoACD, convex decomposition]
domain: "geometry"
stage: "geometry"
realtime: "offline"
platforms: [cpu, python, blender, unity]
year_introduced: 2022
inputs: [mesh]
outputs: [mesh]
style: "both"
dynamic: "static"
cost: "offline"
authority: "Wei et al., 2022"
url: "https://texelatlas.vercel.app/t/coacd-convex-decomposition/"
sources_verified_at: "2026-11-29"
---
# CoACD Approximate Convex Decomposition (Wei et al., 2022)

> Splits a concave mesh into a small set of convex pieces for physics, choosing cuts by a collision-aware concavity measure and a tree search, so thin or interlocking parts stay faithful.

## Reach for it when

- concave mesh collides badly in physics engine
- need collision shapes for a complex rigid body
- thin or interlocking parts lose shape in collision hulls
- generated assets need physics proxies automatically

## How it works

A concavity score measures how far a piece is from its convex hull, but unlike older volumetric measures it is computed from the boundary samples and checks whether the hull would collide with the other pieces (collision-aware). The mesh is recursively cut by planes: a Monte-Carlo tree search proposes planes among candidates, evaluates the concavity of the two resulting parts and picks the sequence of cuts that minimises a global score. Cuts stop once each part's concavity is below a threshold or a part count limit is reached. After cutting, small pieces can be merged if the merged hull remains within tolerance, and a hull simplification step reduces vertex count. The result is a set of convex hulls with limited overlap suitable for rigid body engines.

## When to use it

Choose it to generate collision proxies for dynamic rigid bodies in physics engines, for robotics grasping and for generated assets. Prefer V-HACD style voxel methods when quick, noisy hulls suffice, a single [three-mesh-bvh](https://texelatlas.vercel.app/t/three-mesh-bvh.md) triangle query for static scene queries, and hand-authored primitives when exactness matters (wheels, boxes).

## Cost

offline — Search over cut planes takes seconds to minutes per mesh depending on quality settings.
Measured GPU Weight: 31.24× baseline (heavy) — 0.9683 ms median / 1.0214 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 28.26× baseline (heavy) — 0.4493 ms median (2.16× faster on L4).
Ampere A100 scaling: 19.2× baseline (moderate) — 0.553 ms median (1.75× faster on A100).

## Failure modes

- Parts count explodes on organic or noisy meshes unless a limit is set
- Convex hulls are fatter than the shape; thin walls and interior cavities are lost
- Non-watertight inputs produce unreliable concavity estimates
- Result depends on random tree search unless seeded

## Dataflow

- Inputs: mesh
- Outputs: mesh
- Platforms: cpu, python, blender, unity

## Presets

### CoACD Convex Decomposition — single outer hull (left) vs collision-aware convex pieces (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_EXPLODE": 0.12,
  "P_HULL_ALPHA": 0.55,
  "P_ROT_SPEED": 0.7,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_EXPLODE = 0.12; // P Piece Explode [0.0, 0.35, 0.01]
const float P_HULL_ALPHA = 0.55; // P Outer Hull Leak [0.1, 0.9, 0.05]
const float P_ROT_SPEED = 0.70; // P Spin Speed [0.0, 2.2, 0.05]
const float P_SPLIT = 0.48; // P Single Hull / CoACD [0.0, 1.0, 0.02]

mat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }

float sdBox(vec3 p, vec3 b) {
  vec3 q = abs(p) - b;
  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}

// Concave mechanical arch/table composed of 6 clean CoACD convex hull components!
vec2 mapCoACD(vec3 p, float explode, float spin) {
  vec3 q = p;
  q.xz = rot2(spin * 0.58) * q.xz;
  q.yz = rot2(0.32) * q.yz;

  vec2 res = vec2(1e5, 0.0);

  // Piece 1: Top arch beam
  float d1 = sdBox(q - vec3(0.0, 0.38 + explode * 1.1, 0.0), vec3(0.68, 0.14, 0.24)) - 0.025;
  if (d1 < res.x) res = vec2(d1, 1.0);

  // Piece 2: Left pillar
  float d2 = sdBox(q - vec3(-0.54 - explode, -0.08, 0.0), vec3(0.14, 0.36, 0.24)) - 0.025;
  if (d2 < res.x) res = vec2(d2, 2.0);

  // Piece 3: Right pillar
  float d3 = sdBox(q - vec3(0.54 + explode, -0.08, 0.0), vec3(0.14, 0.36, 0.24)) - 0.025;
  if (d3 < res.x) res = vec2(d3, 3.0);

  // Piece 4: Left angled brace
  vec3 bL = q - vec3(-0.28 - explode * 0.5, 0.14 + explode * 0.4, 0.0);
  bL.xy = rot2(0.785) * bL.xy;
  float d4 = sdBox(bL, vec3(0.24, 0.08, 0.18)) - 0.02;
  if (d4 < res.x) res = vec2(d4, 4.0);

  // Piece 5: Right angled brace
  vec3 bR = q - vec3(0.28 + explode * 0.5, 0.14 + explode * 0.4, 0.0);
  bR.xy = rot2(-0.785) * bR.xy;
  float d5 = sdBox(bR, vec3(0.24, 0.08, 0.18)) - 0.02;
  if (d5 < res.x) res = vec2(d5, 5.0);

  // Piece 6: Lower base plinths (left & right feet)
  float d6 = sdBox(q - vec3(0.0, -0.48 - explode * 0.9, 0.0), vec3(0.76, 0.10, 0.30)) - 0.02;
  // Cut center gap so base itself is concave -> split into piece 6 (left foot) and piece 7 (right foot)!
  float dFootL = sdBox(q - vec3(-0.52 - explode, -0.48 - explode * 0.7, 0.0), vec3(0.24, 0.09, 0.30)) - 0.02;
  float dFootR = sdBox(q - vec3(0.52 + explode, -0.48 - explode * 0.7, 0.0), vec3(0.24, 0.09, 0.30)) - 0.02;
  if (dFootL < res.x) res = vec2(dFootL, 6.0);
  if (dFootR < res.x) res = vec2(dFootR, 7.0);
  return res;
}

// Single naive outer convex hull wrapping the entire concave arch (blocks the hollow archway!)
float mapOuterHull(vec3 p, float spin) {
  vec3 q = p;
  q.xz = rot2(spin * 0.58) * q.xz;
  q.yz = rot2(0.32) * q.yz;
  return sdBox(q - vec3(0.0, -0.02, 0.0), vec3(0.76, 0.56, 0.30)) - 0.03;
}

vec3 calcNormal(vec3 p, float explode, float spin) {
  vec2 e = vec2(0.0022, 0.0);
  return normalize(vec3(
    mapCoACD(p + e.xyy, explode, spin).x - mapCoACD(p - e.xyy, explode, spin).x,
    mapCoACD(p + e.yxy, explode, spin).x - mapCoACD(p - e.yxy, explode, spin).x,
    mapCoACD(p + e.yyx, explode, spin).x - mapCoACD(p - e.yyx, explode, spin).x
  ));
}

vec3 pieceColor(float id) {
  if (id < 1.5) return vec3(0.18, 0.78, 0.88);
  if (id < 2.5) return vec3(0.96, 0.52, 0.22);
  if (id < 3.5) return vec3(0.24, 0.86, 0.54);
  if (id < 4.5) return vec3(0.96, 0.80, 0.22);
  if (id < 5.5) return vec3(0.72, 0.44, 0.96);
  if (id < 6.5) return vec3(0.94, 0.34, 0.58);
  return vec3(0.34, 0.62, 0.98);
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  bool isCoACD = screenX >= split;
  float explode = isCoACD ? clamp(P_EXPLODE, 0.0, 0.38) : 0.0;
  float hullAlpha = clamp(P_HULL_ALPHA, 0.1, 0.92);
  float spin = iTime * max(P_ROT_SPEED, 0.0);

  vec3 ro = vec3(0.0, 0.08, 2.68);
  vec3 rd = normalize(vec3(uv, -1.55));

  vec3 col = mix(vec3(0.025, 0.035, 0.056), vec3(0.068, 0.088, 0.138), smoothstep(-0.55, 0.55, uv.y));

  // Trace concave mesh / CoACD convex pieces
  float t = 0.0;
  float matId = 0.0;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    vec2 h = mapCoACD(ro + rd * t, explode, spin);
    if (h.x < 0.002) { hit = true; matId = h.y; break; }
    t += h.x;
    if (t > 8.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * t;
    vec3 n = calcNormal(p, explode, spin);
    vec3 l1 = normalize(vec3(0.58, 0.84, 0.52));
    vec3 l2 = normalize(vec3(-0.70, -0.25, 0.50));
    float diff = max(dot(n, l1), 0.0) * 0.85 + max(dot(n, l2), 0.0) * 0.25;
    float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 46.0);
    vec3 alb = isCoACD ? pieceColor(matId) : vec3(0.58, 0.64, 0.74);
    col = alb * (0.28 + 0.82 * diff) + vec3(0.95) * spec * 0.45;
  }

  // On left side: overlay the single coarse convex hull wrapping & blocking the concavity!
  if (!isCoACD) {
    float tH = 0.0;
    bool hitH = false;
    for (int i = 0; i < 56; i++) {
      float dh = mapOuterHull(ro + rd * tH, spin);
      if (dh < 0.0025) { hitH = true; break; }
      tH += dh;
      if (tH > 8.0) break;
    }
    if (hitH) {
      vec3 ph = ro + rd * tH;
      vec2 e = vec2(0.003, 0.0);
      vec3 nh = normalize(vec3(
        mapOuterHull(ph + e.xyy, spin) - mapOuterHull(ph - e.xyy, spin),
        mapOuterHull(ph + e.yxy, spin) - mapOuterHull(ph - e.yxy, spin),
        mapOuterHull(ph + e.yyx, spin) - mapOuterHull(ph - e.yyx, spin)
      ));
      float fres = 0.25 + 0.75 * pow(1.0 - max(dot(nh, -rd), 0.0), 2.5);
      // Concavity error volume (where hull exists in front of empty archway!) glows warning red-orange
      bool isErrorGap = !hit || (tH < t - 0.05);
      vec3 hullCol = isErrorGap ? vec3(0.98, 0.22, 0.24) : vec3(0.95, 0.65, 0.22);
      float hatch = smoothstep(0.35, 0.65, sin((ph.x + ph.y) * 34.0));
      col = mix(col, hullCol * (0.75 + 0.35 * hatch), clamp(hullAlpha * (0.45 + 0.55 * fres), 0.18, 0.85));
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.97, 1.0), sep);

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Combines with

- [Manifold Mesh Booleans](https://texelatlas.vercel.app/t/mesh-boolean-manifold.md): Boolean cuts split the mesh along candidate planes.

## Combination ideas

- [Concavity-aware deformable clusters via CoACD and shape matching](https://texelatlas.vercel.app/ideas/coacd-cluster-shape-matching/)
- [Captured rooms you can bump into](https://texelatlas.vercel.app/ideas/walkable-captured-scenes/)

## Sources

1. [primary] Xinyue Wei, Minghua Liu, Zhan Ling, Hao Su (2022) Approximate convex decomposition for 3D meshes with collision-aware concavity and tree search. ACM Transactions on Graphics. https://doi.org/10.1145/3528223.3530103 (verified via doi.org on 2026-11-29)
2. [implementation] SarahWeiii (2022) SarahWeiii/CoACD. https://github.com/SarahWeiii/CoACD License: MIT. (verified via github on 2026-11-29)

## Cite this entry

Texel. "CoACD Approximate Convex Decomposition." https://texelatlas.vercel.app/t/coacd-convex-decomposition/ (accessed 2026-12-01).
