Behind the Scenes of Our Physics Demos
How our physics demos turn a Boolean cut into falling rigid bodies: connected components, convex collision shapes and mass properties.
In our physics demos, every carve is a Boolean difference, after which the mesh is split into its connected components. Components still attached to the ground stay static; every other one becomes a rigid body in Jolt Physics, with convex collision shapes and mass properties computed from the exact mesh. All of it runs once per cut, while the user keeps carving.
We've shown a few demos where we carve away at an object until pieces break off and tumble to the ground. This post is the look behind the scenes: what happens between the cut and the falling piece.
The work is split between two systems. Solidean does the geometry: the cuts, finding the pieces, and turning each piece into something a physics engine can simulate. Jolt Physics does the simulation: gravity, collisions, pieces coming to rest. The interface between the two is small. Jolt gets a triangle mesh for what is still standing, and for every piece that broke off, a set of convex shapes plus its mass, center of mass and inertia tensor.
The loop runs once per cut, and while the user drags the tool, cuts come every few frames. So every step has to finish before the next cut arrives; the geometry side is designed for exactly that kind of real-time use.
Step 1: Cutting the Static Mesh
We keep the static geometry as a single Solidean mesh. Each carve subtracts a noisy sphere from it, a Boolean difference, the same operation constructive solid geometry builds on.
The cut itself knows nothing about pieces. Its result is still one mesh; it may just consist of several disconnected parts now.
What the cut does guarantee is what every later step builds on: the result is a closed, watertight solid again, also after hundreds of cuts in a row. Volume, center of mass and inertia are only well defined for a closed solid, and a convex hull taken over stray slivers or open seams would not describe the piece.
Step 2: Finding the Pieces
After each cut, rigid component extraction splits the mesh into its connected components: the parts that each move as one rigid body.
Which components stay and which fall is the application's decision, not the geometry's. In our demos the rule is simple: components still connected to the ground remain part of the static mesh, which is the input of the next cut. Every other component is removed from it and handed to the physics engine. Another application might anchor pieces to a wall, to a fixture, or keep only the largest component.
Step 3: Creating Collision Shapes
The physics engine needs a collision shape for every body, and static and moving bodies have different needs.
The static mesh never moves, so the engine only ever tests moving shapes against it. For that, Jolt accepts an arbitrary triangle mesh, and we hand it the rendering mesh, rebuilt after every cut. In a production application, a decimated copy would be the better collision mesh: fewer triangles, the same shape for all practical purposes.
Moving bodies are a different matter. Contact between two moving shapes is found by algorithms like GJK, which work on convex shapes: all they ask of a shape is its farthest point in a given direction, a question with a cheap and unique answer only when the shape is convex. That's why physics engines, Jolt included, don't take arbitrary triangle meshes for moving bodies, and each piece needs a convex stand-in.
The simplest stand-in is the convex hull, the smallest convex shape enclosing the piece. It is a single shape and cheap to collide, and for compact pieces it is close to the real thing.
For strongly non-convex pieces, the hull can be far from the real shape, and the video shows how far. The red regions are where a hull overlaps the static mesh: volume the piece never had, which the engine nonetheless treats as solid. The hull fills every concavity, so other objects bounce off empty space inside a bend, and a hooked piece can no longer hook onto anything.
Convex decomposition addresses that by splitting the piece into several convex parts whose union approximates it; Jolt combines them into one compound shape for the body.
Decomposition is a tradeoff, not a fix. More parts follow the shape more closely, but every part costs time in every collision test, and the result is still an approximation of the surface, not the surface.


Step 4: Calculating Mass Properties
Besides its shape, every rigid body needs its mass properties. The mass decides how the body responds to a force. The center of mass is where gravity acts and what a free-flying body rotates about. The inertia tensor is a 3x3 matrix that describes how hard the body is to spin up around each axis; its eigenvectors are the principal axes, which the video draws together with an ellipsoid for the inertia.
Mass alone is not enough. Two pieces of the same mass can tumble very differently, depending on how far their material is spread from the center of mass.
We compute the mass properties from the piece's mesh, not from its collision shape. The convex hull is bigger than the piece: a body built from it would be too heavy, with its center of mass pulled toward the empty space inside the bend. A decomposition is closer, but still an approximation. Since the mesh is a closed solid, its volume, center of mass and inertia tensor can be computed from the surface alone; with a uniform density, they are what Jolt gets for the body.
Seen from the Geometry Side
Looked at this way, our physics demo is mostly geometry. Of everything above, only the simulation itself is Jolt's job; the rest decides whether that simulation has anything sensible to work with. And each step builds on the one before: the components on a closed result, the collision shapes on the components, the mass properties on the exact mesh rather than on its stand-ins.