elbowroom
v0.1.0
Published
It fits. But do you still have elbow room? Checks furniture against your room: footprints, door swings, drawers that open and a walkway to every piece. Takes IKEA product links.
Maintainers
Readme
elbowroom
It fits. But do you still have elbow room?
Planners tell you whether a wardrobe fits against a wall. elbowroom checks whether you can still live in the room once it is there. Every piece has to be inside the walls and out of the door's swing. Drawers, wardrobe doors and chairs need space to open. And a person has to be able to walk from the door to every piece, through a gap at least 60 cm wide.
Give it your room and IKEA product links. It answers with a verdict, the narrowest gap and what is on either side of it, and a floor plan.
$ npx elbowroom check bedroom.json --svg plan.svg
bed: STORKLINTA bed frame 1610×2111×1010 mm, use zones {"left":600,"right":600} …
dresser: STORKLINTA 6-drawer dresser 1400×479×749 mm, use zones {"front":900} …
DOES NOT FIT
✗ bed: narrowest point on the way is 43 cm (between bed and dresser), needs 60 cm
narrowest route needed: 43 cm (between bed and dresser, on the way to bed)Move the dresser to the other wall and it passes:
FITS
narrowest route needed: 80 cm (the doorway of door 1, on the way to bed)The room file is in examples/storklinta-bedroom.json.
Quick start
npx elbowroom show https://www.ikea.com/us/en/p/skogsta-table-and-4-chairs-acacia-black-black-s99608773/
npx elbowroom check room.json --svg plan.svg
npx elbowroom fill room.json --product S49647456 --svg plan.svg # how many KALLAX fitNode 20 or later. There is nothing to set up. The first time you name a product, its
page is read from ikea.com (one request a second) and kept in ~/.elbowroom/.
The room file
Sizes are in millimetres. The origin is the room's north-west corner: x grows east, y grows south. Wall 0 runs from corner 0 to corner 1, and so on.
{
"market": "us",
"room": {
"polygon": [
[0, 0],
[3400, 0],
[3400, 3600],
[0, 3600]
],
"doors": [
{
"wall": 2,
"offset": 300,
"width": 800,
"swing": "in",
"hinge": "start"
}
]
},
"items": [
{
"id": "bed",
"product": "S69628112",
"piece": "bed frame",
"x": 895,
"y": 0,
"facing": "S"
},
{
"id": "nightstand",
"product": "S69628112",
"piece": "nightstand",
"x": 495,
"y": 0,
"facing": "S"
},
{
"id": "dresser",
"product": "S69628112",
"piece": "dresser",
"x": 300,
"y": 3121,
"facing": "N"
},
{
"id": "desk",
"item": {
"name": "desk",
"w": 1200,
"d": 600,
"useZones": { "front": 750 }
},
"x": 2800,
"y": 1400,
"facing": "W"
}
]
}productis an IKEA product link or number, in any market.- Sets: a table-and-chairs set places its table, with the chairs tucked in.
Other sets are placed part by part with
piece. - Not from IKEA: describe the piece with
iteminstead.
- Sets: a table-and-chairs set places its table, with the chairs tucked in.
Other sets are placed part by part with
facingis the side the item's front looks toward:S,N,EorW. A bed's front is its foot.useZonesoverrides the free space an item needs, per side:front,back,left,right.ruleschanges the walkway widths. The defaults are{ "minPath": 600, "mainPath": 900 }.
What it checks
| Check | Default | | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | Inside the walls, no overlaps | — | | Clear of a door's swing | quarter circle the width of the door | | Space to use each piece | 60 cm beside a bed, 75 cm for a desk chair or a wardrobe, 90 cm in front of drawers and kitchen units, 35 cm of legroom at a sofa | | A route from a door to every piece | at least 60 cm wide | | A route between doors | 90 cm is comfortable; narrower is a warning |
The defaults come from interior design guides; the sources are listed in data/use-zones.json. Wall cabinets and wall shelves hang above walking height and do not block the floor.
How it works
The room is laid on a 1 cm grid.
- Distance to obstacles: a distance transform gives every free cell its distance to the nearest wall or piece.
- Widest route: a flood from each door finds the widest person who can reach each cell, and the point where that route is narrowest. It runs in a bucket queue, the way a shortest-path search would.
- The verdict: a piece is usable when someone at least 60 cm wide can reach its free space.
A 20-piece room checks in about 20 ms.
fill places items greedily with their backs to a wall, from several seeded starts,
and keeps the best layout. The count it gives is a layout that works, not a proof
that nothing better exists. It also prints an upper bound from floor area.
Commands
elbowroom check room.json [--svg plan.svg] [--json] [--offline]
elbowroom fill room.json (--product ID|URL [--piece P] | --item JSON) [--count N] [--svg plan.svg]
elbowroom show ID|URL [--market gb]
elbowroom search "words" [--market gb] # needs a local catalogue from sync
elbowroom sync --market gb|us|sg # reads a whole market's product pages (hours)check and fill exit with 0 when it fits, 1 when it does not, and 2 for bad input.
Agent skill
skills/elbowroom/SKILL.md teaches a coding agent to turn "will a MALM bed and a PAX
fit in my 3 × 3.5 m room" into a room file, run the check, and suggest moves until it
passes.
Limits
- Pieces are boxes turned in quarter turns. A corner sofa counts as its bounding box.
- US pages round some sizes to whole inches, so allow about 1 cm.
- Sizes are IKEA's published measurements. Nothing from IKEA is shipped in this package. Product pages are read only when you name a product, and the data stays on your machine.
elbowroom is an independent project and is not affiliated with or endorsed by IKEA. IKEA is a trademark of Inter IKEA Systems B.V.
License
MIT
