Will It Fit? The Geometry of Moving a Sofa
After reading this you will know why a sofa that looks too wide can still go through a door, how a cut through the middle of the item proves that something simply cannot, and how to read the gap numbers so you trust the answer before the van arrives.
What the planner does, and one example
Moving a rigid object through a tight opening is a geometry problem with a clean question: is there any continuous sequence of positions and orientations that takes the object from outside to inside without ever overlapping a wall? If one exists, the object fits. If none exists, it does not, no matter how many people are pushing.
The hook is the default example. A loveseat measures 160 × 90 × 85 cm. The door into the room is 81 cm wide, and it opens off a hallway only 107 cm wide. Carry the sofa upright and it is 90 cm deep, too wide for the 81 cm door. Lay it on its back and it is still 85 cm across. In every obvious orientation it jams.
Yet the planner finds a path. Stand the sofa on one end, feed the top of the backrest through the door first, and swing the base around as the top clears. At the tightest instant the clearance is about 1 cm. That move is hard to picture and easy to miss when you are sweating in a stairwell. The planner pictures it for you.
When to use it, and when not
Reach for this tool when the object is roughly rigid and the geometry is the whole question: a wardrobe past a corridor corner, a fridge into an elevator, a mattress up a stair with a turn at the top. It is at its best in the borderline cases, where a few centimetres and one clever tilt decide the outcome.
Do not use it as a substitute for measuring. The answer is only as good as the numbers you enter, and the common failure is a bad measurement, not a bad plan. Treat soft objects with care. A mattress bends and cushions squash, but the planner treats every item as rigid blocks (a sofa is a base, a back, two arms and four legs), so for soft things its answer errs on the safe side. The one part you can switch off is a sofa's legs.
Measure the narrowest point, not the nominal size. A door is measured between the stops with the door fully open, not across the frame. A hallway is measured at the skirting boards, radiators or a protruding light switch, not at the bare wall.
The idea behind the search
The object has six degrees of freedom: three numbers for position (x, y, z) and three for orientation (roll, pitch, yaw). Every placement is a single point in a six-dimensional space called configuration space. A placement is legal if the object does not overlap any wall. The set of all legal placements is the free space, and the question "will it fit" becomes "are the start point and the goal point in the same connected piece of free space".
You cannot draw six dimensions, so the planner samples. It grows two trees of collision-free placements, one rooted at the start outside the door and one at the goal inside the room, and tries to join them. This is RRT-Connect, the same family of algorithm that steers robot arms. Each candidate placement is checked against every wall with an exact box-on-box collision test, so a reported path is not a guess: every pose on it, spaced less than a centimetre apart, passed the test with your safety gap.
The flat-item corner formula
For one important case there is a formula, no search needed. Take an item whose footprint is a rectangle of width w, carried level (no tilting) round a right-angled corner between two hallways of widths a and b. The longest such item is
Here \theta is the angle the item makes with one wall as it rounds the corner, ranging over 0 \lt \theta \lt 90^\circ. The first term is the length that fits in the first leg of the corridor at angle \theta, the second term is the length in the other leg, and the minimum over \theta picks the worst instant, the tightest moment of the turn. The longest item that survives every angle is the answer. With w = 0 it becomes the classic ladder-round-a-corner result, (a^{2/3} + b^{2/3})^{3/2}, which is 283 cm for two 100 cm hallways; the w terms charge for the item's depth.
For two 100 cm hallways and an item 60 cm deep, the minimum works out to 163 cm. The planner reproduces that number when tilting is forbidden, and beats it whenever the ceiling gives room to lift one end.
Reproducing the 163 cm corner limit
Set a = b = 100 and w = 60, all in centimetres, and sweep the angle.
- At \theta = 45^\circ, \cos\theta = \sin\theta \approx 0.7071. Each term is (100 - 60 \cdot 0.7071)/0.7071 = (100 - 42.43)/0.7071 \approx 81.42.
- Add them: 81.42 + 81.42 \approx 162.8 cm.
- Check a nearby angle, \theta = 40^\circ: terms are (100 - 45.96)/0.6428 \approx 84.07 and (100 - 38.57)/0.7660 \approx 80.20, summing to 164.3 cm.
- The two hallways are equally wide, so the curve is symmetric about \theta = 45^\circ, which gives the minimum: L \approx 163 cm.
Any rectangle longer than 163 cm jams at the 45-degree instant. One shorter than that gets around.
Why tilting changes everything
The corner formula assumes the item stays level. Lift one end by an angle \alpha and two things change. Its footprint becomes L\cos\alpha + h\sin\alpha long, where h is its height, and that footprint must pass the flat limit. Its top rises to L\sin\alpha + h\cos\alpha, which must stay under the ceiling. A small tilt makes the footprint longer, because the item's own height leans into the floor plan; only past the angle 2\arctan(h/L_{flat}) does it start to shrink.
For a 60 cm deep, 45 cm tall item in two 100 cm hallways under a 250 cm ceiling, tilting hurts until about 31°, then the limit climbs from 163 cm to about 260 cm at 62°, where the ceiling takes over. The planner agrees: it carries a 258 cm item round that corner with one end lifted about 62°, and finds no way for a 268 cm one. Standing the default loveseat on end is the same idea taken to 90°.
Reading the results
The planner returns one of three verdicts, and they do not mean the same thing.
- Fits
- A verified path exists. Poses along it, under a centimetre apart, each passed the collision test with your safety gap intact. This is a positive proof, modulo your measurements.
- Won't fit
- A cut-plane argument proved impossibility. At the instant the door frame cuts the item in half, that slice must pass through the opening. If even the smallest possible slice is too big for the opening, however it is turned, no pose and no pivot can help. This is a negative proof.
- No way found
- The search ran out of time without a path and without a proof. In tight cases this is worth a second, longer run before you conclude anything.
Pay attention to the tightest gap along a successful path. A plan with 1 cm to spare, like the default loveseat, is real but unforgiving: a 2 cm measurement error flips it to a jam. A plan with 8 cm to spare is one you can carry out tired.
If the verdict is "fits" but the tightest gap is under 3 cm, re-measure the narrowest point and add your real safety margin. The difference between a clean move and a scraped door frame is often the width of the paint.
Common mistakes
The errors that bite are almost never in the algorithm. They are in the setup.
- Measuring the frame, not the stops. A door is narrower between its stops than across the brick opening. Enter the number the sofa actually touches.
- Forgetting the lift limit. The planner keeps the item's lowest point within the lift height you set so two people can actually carry each pose. Set this too high and it may propose a move no human could hold.
- Reading a mattress verdict as final. The planner treats a mattress as a rigid slab, so its "won't fit" is pessimistic: a real mattress can bend round a turn that a rigid one cannot.
- Ignoring the easy fixes. The planner also tests the usual tricks: feet off, door off its hinges. A
2 cmjam often clears the moment the hinge pins come out.
Related tools
If you like watching a search respect hard physical constraints, several other simulators here do the same in different domains. The Bridge Builder & Truss Simulator loads every member until it buckles. The Topology Optimizer grows the stiffest shape from where you hold and push a part. The Elevator Dispatch Simulator schedules cars under rush-hour load, a different kind of planning problem. For a motion problem in fluid rather than solid geometry, try the Wind Tunnel.
Frequently asked questions
Why does standing the sofa on end help so much?
Because the opening cares about the profile you present to it, not the sofa's overall size. On end, the smallest cross-section (the backrest top) leads through the door, and the rest follows as it clears. Carried upright, its full 90 cm depth meets the 81 cm door at once.
Does "no way found" mean it will not fit?
No. It means the search did not find a path in the time it had, and did not prove impossibility either. Only a cut-plane "won't fit" is a proof of no. Run a longer search before you give up, especially when the gaps are tight.
How accurate is the 1 cm clearance?
The path is sampled finely and every pose is checked with your safety gap. The reported tightest gap is a guaranteed minimum for the shapes you entered (the true gap can be a little larger), so it is only as accurate as your measurements. A 1 cm plan assumes your door width is correct to the millimetre.
Can it handle an L-shaped stair with a turn at the top?
Yes. A stair is just more walls in three dimensions, and the six-degree-of-freedom search treats it the same way it treats a corridor corner. The lift-height limit keeps every pose carryable on the climb.
Do the sofa legs count?
Yes, by default, because they are part of the shape. Tick "Legs taken off" to plan without them. When a sofa does not fit, the planner also tries that fix by itself, along with taking the door off its hinges. A fridge is a plain box with its door shut.