Skip to content

armgit / bygga

Public Imported from GitHub
0

IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.

TypeScript

Draw office and swivel chairs

Youssefae8b126e2525
diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.ts
index 80c300f..ee42349 100644
--- a/scripts/ikea/check.ts
+++ b/scripts/ikea/check.ts
@@ -94,8 +94,11 @@ async function main() {
expect("kallax", "kallax-2x2");
expect("MALM 3 drawers", "malm-3-drawers");
expect("billy", "billy-80x202");
- expect("markus", null);
- expect("markus office chair", null);
+ expect("markus", "markus-office-chair");
+ expect("markus office chair", "markus-office-chair");
+ // a real name we don't draw (a conference chair) must not land on a near miss
+ expect("laktare", null);
+ expect("laktare chair", null);
expect("marius", "marius-stool");
if (articleNo("S292.975.72") !== "29297572") fail("article numbers with an S in front don't parse");
for (const [no, slug] of [["60324520", "kallax-2x2"]] as const) {
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index 7f0e156..a62f015 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -76,6 +76,11 @@ export function measure(s: string): Size | null {
const UPRIGHT = new Set<Kind>(["cube", "bookcase", "open", "chest", "nightstand", "wardrobe", "cabinet", "sideboard", "tv", "shoe", "wallcab", "wallshelf", "kitchen"]);
const FLAT = new Set<Kind>(["desk", "coffee", "side", "dining", "bar", "console", "kidstable", "trolley", "bench"]);
+/** Office chairs IKEA sells with armrests although the type doesn't say so. */
+const OFFICE_ARMS = new Set(["MARKUS", "ALEFJÄLL"]);
+/** Office chairs with a tall back and a headrest. */
+const OFFICE_TALL = new Set(["MARKUS"]);
+
type Pick = { kind: Kind; x?: X } | string;
type Rule = [RegExp, (m: RegExpMatchArray, c: Ctx) => Pick];
@@ -105,6 +110,13 @@ const withDoors = (kind: Kind, t: string): Pick => {
const RULES: Rule[] = [
// things that are several products, or only part of one
[/\b(and|set of \d|sets?)\b|\+|combination|\bcomb\b|\bchairs\b|armchairs|benches/, () => "set or combination"],
+ // office and swivel chairs: a star base on castors, a gas lift, the seat on top
+ [/^(office chair( with armrests| with arm\/headrest)?|swivel chair( with armrests)?|gaming chair|children's desk chair)$/, (m, c) => {
+ const family = c.f.name.split(" / ")[0].trim();
+ const arms = /arm/.test(m[0]) || /gaming/.test(m[0]) || OFFICE_ARMS.has(family);
+ const seatH = c.kids ? 42 : /gaming/.test(m[0]) ? 50 : undefined;
+ return { kind: "office", x: { arms: arms ? "slim" : "none", seatH } };
+ }],
[/swivel|office chair|gaming chair|conference|desk chair|highchair|lounge|reclining|lounger|hammock|massage/, () => "office, swivel or lounge chair"],
[/corner|chaise|u-shaped|crnr/, () => "corner or chaise longue sofa"],
[/section|add-on|armrest|backrest for|seat sec|modular (easy chair|chaise)/, () => "sofa or storage section"],
@@ -179,7 +191,7 @@ export function classify(f: Fact, hints: Hints): Verdict {
const outdoor = /(,|\s)\s*(in\/)?outdoor$/.test(t) || f.cats[0] === "od001";
t = t.replace(/,?\s*(in\/)?outdoor$/, "").trim();
const kids = /^(children's|junior) /.test(t) || f.cats[0] === "bc001";
- const sz = measure(f.size);
+ let sz = measure(f.size);
const multi = f.name.includes("/");
let pick: Pick | null = null;
for (const [re, fn] of RULES) {
@@ -191,6 +203,8 @@ export function classify(f: Fact, hints: Hints): Verdict {
}
if (!pick) return { skip: "not something we draw yet" };
if (typeof pick === "string") return { skip: pick };
+ // office chairs come in "Medium" and "Large" rather than centimetres
+ if (!sz && pick.kind === "office" && /^(small|medium|large)$/i.test(f.size.trim())) sz = { n: [], ext: false, text: "" };
if (!sz) return { skip: "size we can't read" };
const kind = pick.kind;
const family = f.name.split(" / ")[0].trim();
@@ -244,6 +258,14 @@ export function classify(f: Fact, hints: Hints): Verdict {
} else if (hint?.kind === kind) set(hint.w, hint.h, hint.d);
else if (kind !== "bench") return { skip: "no size given" };
if (guessed.h && hint?.kind === kind) h = hint.h;
+ } else if (kind === "office") {
+ // IKEA gives no size for office chairs: a typical one, taller with a headrest, smaller for children
+ if (v.length === 3) set(v[0], v[2], v[1]);
+ else if (kids) [w, h, d] = [52, 86, 52];
+ else {
+ if (x.arms === "none") w = 60;
+ if (/headrest|gaming/.test(t) || OFFICE_TALL.has(family)) h = 128;
+ }
} else {
// seats: IKEA mostly gives no size, or the seat height for stools
if (v.length === 3) set(v[0], v[2], v[1]);
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 0518d48..38958f1 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -1,6 +1,7 @@
{
"AGEN|Armchair with cushion": "agen-armchair-cushion",
"AGEN|Chair": "agen-chair",
+ "ALEFJÄLL|Office chair": "alefjall-office-chair",
"ALEX|Desk, 100 × 48 cm": "alex-desk-100-x-48",
"ALEX|Desk, 132 × 58 cm": "alex-desk-132-x-58",
"ALEX|Drawer unit on castors, 36 × 50 cm": "alex-drawer-unit-on-castors-36-x-50",
@@ -33,6 +34,7 @@
"BAGGEBO|Shelving unit, 60 × 30 × 80 cm": "baggebo-shelving-unit-60-x-30-x-80",
"BAGGEBO|Sideboard, 78 × 92 cm": "baggebo-sideboard-78-x-92",
"BÅRSLÖV|3-seat sofa-bed": "barslov-3-seat-sofa-bed",
+ "BÄSTBOLL|Gaming chair": "bastboll-gaming-chair",
"BEKVÄM|Kitchen trolley, 58 × 50 cm": "bekvam-kitchen-trolley-58-x-50",
"BEKVÄM|Step stool, 63 cm": "bekvam-step-stool-63",
"BERGSHYTTAN|Bench, 210 × 38 cm": "bergshyttan-bench-210-x-38",
@@ -79,11 +81,13 @@
"BILLY|Bookcase, 80 × 28 × 237 cm": "billy-bookcase-80-x-28-x-237",
"BILLY|Bookcase, 80 × 39 × 202 cm": "billy-bookcase-80-x-39-x-202",
"BINGSTA|Armchair": "bingsta-armchair",
+ "BJÖRKBERGET|Swivel chair": "bjorkberget-swivel-chair",
"BJÖRKSNÄS|Bed frame, Standard King, 150 × 200 cm": "bjorksnas-bed-frame-standard-king-150-x-200",
"BJÖRKSNÄS|Bedside table, 48 × 38 cm": "bjorksnas-bedside-table-48-x-38",
"BJÖRKSNÄS|Chest of 5 drawers, 90 × 47 × 90 cm": "bjorksnas-chest-5-drawers-90-x-47-x-90",
"BLÅLIDEN|Glass-door cabinet, 35 × 32 × 151 cm": "blaliden-glass-door-cabinet-35-x-32-x-151",
"BLÄSTÅSEN|Bedside table, 50 × 37 × 76 cm": "blastasen-bedside-table-50-x-37-x-76",
+ "BLECKBERGET|Swivel chair": "bleckberget-swivel-chair",
"BOASTAD|High cabinet, 41 × 32 × 185 cm": "boastad-high-cabinet-41-x-32-x-185",
"BOASTAD|Sideboard, 161 × 52 × 75 cm": "boastad-sideboard-161-x-52-x-75",
"BOASTAD|Wall shelf, 181 × 32 × 32 cm": "boastad-wall-shelf-181-x-32-x-32",
@@ -115,6 +119,7 @@
"BRYTNING|Desk, 135 × 53 × 75 cm": "brytning-desk-135-x-53-x-75",
"BRYTNING|Desk, 85 × 53 × 75 cm": "brytning-desk-85-x-53-x-75",
"BRYTNING|Storage unit, 29 × 40 × 47 cm": "brytning-storage-unit-29-x-40-x-47",
+ "BRYTNING|Swivel chair": "brytning-swivel-chair",
"BURVIK|Side table, 38 cm": "burvik-side-table-38",
"BUSKBO|Armchair": "buskbo-armchair",
"BUSLÄTT|Chair": "buslatt-chair",
@@ -139,6 +144,7 @@
"EKHOLMA|3-seat sofa": "ekholma-3-seat-sofa",
"EKTORP|2-seat sofa": "ektorp-2-seat-sofa",
"EKTORP|Armchair": "ektorp-armchair",
+ "ELDBERGET / MALSKÄR|Swivel chair": "eldberget-malskar-swivel-chair",
"ENHET|Base fr w shelves, 40 × 60 × 75 cm": "enhet-base-fr-w-shelves-40-x-60-x-75",
"ENHET|Base fr w shelves, 60 × 40 × 60 cm": "enhet-base-fr-w-shelves-60-x-40-x-60",
"ENHET|High cabinet with door, 30 × 32 × 180 cm": "enhet-high-cabinet-door-30-x-32-x-180",
@@ -171,6 +177,8 @@
"FJÄLLBO|Shelving unit, 51 × 136 cm": "fjallbo-shelving-unit-51-x-136",
"FJÄLLBO|Sideboard, 111 × 47 × 95 cm": "fjallbo-sideboard-111-x-47-x-95",
"FJÄLLBO|TV bench, 150 × 36 × 54 cm": "fjallbo-tv-bench-150-x-36-x-54",
+ "FLINTAN|Office chair": "flintan-office-chair",
+ "FLINTAN|Office chair with armrests": "flintan-office-chair-armrests",
"FLISAT|Children's stool": "flisat-children-s-stool",
"FLISAT|Children's table, 83 × 58 cm": "flisat-children-s-table-83-x-58",
"FLISAT|Open storage, 88 × 38 × 117 cm": "flisat-open-storage-88-x-38-x-117",
@@ -209,6 +217,8 @@
"GREJSIMOJS|Children's stool": "grejsimojs-children-s-stool",
"GREJSIMOJS|Children's table, 84 × 42 cm": "grejsimojs-children-s-table-84-x-42",
"GRILLSKÄR|Side table, outdoor, 30 × 61 cm": "grillskar-side-table-outdoor-30-x-61",
+ "GRÖNFJÄLL|Office chair with arm/headrest": "gronfjall-office-chair-arm-headrest",
+ "GRÖNFJÄLL|Office chair with armrests": "gronfjall-office-chair-armrests",
"GRÖNSTA|Bar stool, 64 cm": "gronsta-bar-stool-64",
"GRÖNSTA|Chair": "gronsta-chair",
"GRÖTÅN|Chair": "grotan-chair",
@@ -244,6 +254,7 @@
"HÄGERNÄS|Stool": "hagernas-stool",
"HÅKANSKÄR|Coffee table, 80 × 64 cm": "hakanskar-coffee-table-80-x-64",
"HAMMARN|Sofa-bed": "hammarn-sofa-bed",
+ "HATTEFJÄLL|Office chair with armrests": "hattefjall-office-chair-armrests",
"HATTHOLMEN|Table, outdoor, 75 × 75 × 74 cm": "hattholmen-table-outdoor-75-x-75-x-74",
"HAUGA|Bedside table, 40 × 36 cm": "hauga-bedside-table-40-x-36",
"HAUGA|Cabinet with 2 doors, 70 × 116 cm": "hauga-cabinet-2-doors-70-x-116",
@@ -273,6 +284,7 @@
"HOLMSTA / FRÖKNABO|Armchair": "holmsta-froknabo-armchair",
"HOLMSTA|Armchair": "holmsta-armchair",
"HORNAVAN|Trolley, 26 × 48 × 77 cm": "hornavan-trolley-26-x-48-x-77",
+ "HUVUDSPELARE|Gaming chair": "huvudspelare-gaming-chair",
"HUVUDSPELARE|Gaming desk, 140 × 80 cm": "huvudspelare-gaming-desk-140-x-80",
"HYLLIS|Shelving unit, 60 × 27 × 74 cm": "hyllis-shelving-unit-60-x-27-x-74",
"HYLTARP|2-seat sofa": "hyltarp-2-seat-sofa",
@@ -323,6 +335,7 @@
"IVAR|Shelving unit, 89 × 50 × 226 cm": "ivar-shelving-unit-89-x-50-x-226",
"IVÖSJÖN|Cabinet with doors, 33 × 34 × 99 cm": "ivosjon-cabinet-doors-33-x-34-x-99",
"JAKOBSFORS|Coffee table, 80 cm": "jakobsfors-coffee-table-80",
+ "JÄRVFJÄLLET|Office chair with armrests": "jarvfjallet-office-chair-armrests",
"JÄTTEBO|2-seat modular sofa": "jattebo-2-seat-modular-sofa",
"JÄTTEBO|3-seat modular sofa": "jattebo-3-seat-modular-sofa",
"JÄTTESTA|Coffee table, 80 × 80 cm": "jattesta-coffee-table-80-x-80",
@@ -385,6 +398,7 @@
"KRONÖREN|Chest of 2 drawers, 76 × 48 × 55 cm": "kronoren-chest-2-drawers-76-x-48-x-55",
"KRONÖREN|Open wardrobe, 90 × 49 × 181 cm": "kronoren-open-wardrobe-90-x-49-x-181",
"KRYLBO|Chair": "krylbo-chair",
+ "KRYLBO|Swivel chair": "krylbo-swivel-chair",
"KUNGSFORS|Kitchen trolley, 60 × 40 cm": "kungsfors-kitchen-trolley-60-x-40",
"LACK|Side table, 35 × 35 cm": "lack-side-table-35-x-35",
"LACK|TV bench, 120 × 35 × 36 cm": "lack-tv-bench-120-x-35-x-36",
@@ -447,10 +461,13 @@
"LISABO|Table, 88 × 78 cm": "lisabo-table-88-x-78",
"LIXHULT|Cabinet, 35 × 60 cm": "lixhult-cabinet-35-x-60",
"LIXHULT|Cabinet, 60 × 35 cm": "lixhult-cabinet-60-x-35",
+ "LOBERGET / MALSKÄR|Swivel chair": "loberget-malskar-swivel-chair",
+ "LOBERGET / SIBBEN|Children's desk chair": "loberget-sibben-children-s-desk-chair",
"LOMMARP|Bookcase, 65 × 199 cm": "lommarp-bookcase-65-x-199",
"LOMMARP|Cabinet with glass doors, 86 × 199 cm": "lommarp-cabinet-glass-doors-86-x-199",
"LOMMARP|Cabinet, 102 × 101 cm": "lommarp-cabinet-102-x-101",
"LOMMARP|TV bench, 159 × 45 × 81 cm": "lommarp-tv-bench-159-x-45-x-81",
+ "LÖPARBANA|Gaming chair": "loparbana-gaming-chair",
"LOSHULT|Trolley, 38 × 38 × 82 cm": "loshult-trolley-38-x-38-x-82",
"LÖVBACKEN|Side table, 77 × 39 cm": "lovbacken-side-table-77-x-39",
"LUSTEBO|Chair": "lustebo-chair",
@@ -475,6 +492,9 @@
"MANNARP|3-seat sofa": "mannarp-3-seat-sofa",
"MARIEDAMM|Table, 105 cm": "mariedamm-table-105",
"MARIEDAMM|Table, 180 × 100 cm": "mariedamm-table-180-x-100",
+ "MARKUS|Office chair": "markus-office-chair",
+ "MARKUS|Office chair with armrests": "markus-office-chair-armrests",
+ "MATCHSPEL|Gaming chair": "matchspel-gaming-chair",
"METOD|Base cabinet with shelves, 60 × 60 cm": "metod-base-cabinet-shelves-60-x-60",
"METOD|Base cabinet with shelves/2 doors, 80 × 60 cm": "metod-base-cabinet-shelves-2-doors-80-x-60",
"METOD|High cabinet with shelves, 40 × 37 × 200 cm": "metod-high-cabinet-shelves-40-x-37-x-200",
@@ -497,6 +517,7 @@
"METOD|Wall cabinet, 60 × 40 cm": "metod-wall-cabinet-60-x-40",
"MICKE|Desk, 142 × 50 cm": "micke-desk-142-x-50",
"MICKE|Desk, 73 × 50 cm": "micke-desk-73-x-50",
+ "MILLBERGET|Swivel chair": "millberget-swivel-chair",
"MILSBO|Glass-door cabinet, 73 × 175 cm": "milsbo-glass-door-cabinet-73-x-175",
"MINNEN|Ext bed frame with slatted bed base, 80 × 200 cm": "minnen-ext-bed-frame-slatted-bed-base-80-x-200",
"MITTPLAN|Desk, 80 × 60 cm": "mittplan-desk-80-x-60",
@@ -513,6 +534,7 @@
"MOSSJÖN|Wall cabinet w shelves/glass door, 36 × 18 × 102 cm": "mossjon-wall-cabinet-w-shelves-glass-door-36-x-1",
"MOSSJÖN|Wall cabinet with glass door, 36 × 18 × 44 cm": "mossjon-wall-cabinet-glass-door-36-x-18-x-44",
"MULLSJÖ|Desk, 135 × 70 cm": "mullsjo-desk-135-x-70",
+ "MULLSJÖ|Swivel chair": "mullsjo-swivel-chair",
"MUSKAN|Bench, 58 × 38 cm": "muskan-bench-58-x-38",
"MUSKAN|Shelving unit, 37 × 140 cm": "muskan-shelving-unit-37-x-140",
"NACKANÄS|Table, 140 × 76 cm": "nackanas-table-140-x-76",
@@ -586,6 +608,8 @@
"OMAR|Shelving unit, 92 × 50 × 94 cm": "omar-shelving-unit-92-x-50-x-94",
"OMMJÄNGE|Chair": "ommjange-chair",
"ÖNNESTAD|Armchair": "onnestad-armchair",
+ "ÖRFJÄLL|Children's desk chair": "orfjall-children-s-desk-chair",
+ "ÖRFJÄLL|Swivel chair": "orfjall-swivel-chair",
"ORRESLÄTT|Armchair": "orreslatt-armchair",
"ÖRTRÄSK|Coffee table, 110 × 68 cm": "ortrask-coffee-table-110-x-68",
"ÖRTRÄSK|Coffee table, 75 × 48 cm": "ortrask-coffee-table-75-x-48",
@@ -645,6 +669,7 @@
"RELATERA|Desk sit/stand, 90 × 60 cm": "relatera-desk-sit-stand-90-x-60",
"RELATERA|Desk, 117 × 60 cm": "relatera-desk-117-x-60",
"RELATERA|Desk, 90 × 60 cm": "relatera-desk-90-x-60",
+ "RENBERGET|Swivel chair": "renberget-swivel-chair",
"RIAN|Side table, 50 × 30 cm": "rian-side-table-50-x-30",
"RIDSPÖ|Desk, 140 × 70 cm": "ridspo-desk-140-x-70",
"RISHOLMEN|Wing chair, in/outdoor": "risholmen-wing-chair-in-outdoor",
@@ -660,6 +685,7 @@
"ROSENTORP|Extendable table, 155/215 × 87 cm": "rosentorp-extendable-table-155-215-x-87",
"ROSENTORP|Extendable table, 160/215 × 110 cm": "rosentorp-extendable-table-160-215-x-110",
"ROSENTORP|Stool": "rosentorp-stool",
+ "ROSENTORP|Swivel chair": "rosentorp-swivel-chair",
"RUDSTA|Glass-door cabinet, 42 × 37 × 155 cm": "rudsta-glass-door-cabinet-42-x-37-x-155",
"RUDSTA|Glass-door cabinet, 80 × 37 × 120 cm": "rudsta-glass-door-cabinet-80-x-37-x-120",
"SAGESUND|Upholstered bed frame, Standard Double, 135 × 190 cm": "sagesund-upholstered-bed-frame-standard-double-1",
@@ -700,6 +726,7 @@
"SKRUVBY|Side table, 40 × 32 cm": "skruvby-side-table-40-x-32",
"SKRUVBY|Sideboard, 120 × 38 × 90 cm": "skruvby-sideboard-120-x-38-x-90",
"SKRUVBY|TV bench, 156 × 38 × 60 cm": "skruvby-tv-bench-156-x-38-x-60",
+ "SKRUVSTA|Swivel chair": "skruvsta-swivel-chair",
"SLÄKT|Bed frame with 3 storage boxes, 90 × 200 cm": "slakt-bed-frame-3-storage-boxes-90-x-200",
"SLÄKT|Bed frame with slatted bed base, 90 × 200 cm": "slakt-bed-frame-slatted-bed-base-90-x-200",
"SLÄKT|Bed frame with storage, 90 × 200 cm": "slakt-bed-frame-storage-90-x-200",
@@ -711,6 +738,7 @@
"SMÅGÖRA|Desk, 93 × 51 cm": "smagora-desk-93-x-51",
"SMÅGÖRA|Shelf unit, 29 × 88 cm": "smagora-shelf-unit-29-x-88",
"SMÅGÖRA|Wardrobe, 80 × 50 × 187 cm": "smagora-wardrobe-80-x-50-x-187",
+ "SMÄLLEN|Swivel chair": "smallen-swivel-chair",
"SMÅSTAD / PLATSA|Bookcase, 60 × 57 × 123 cm": "smastad-platsa-bookcase-60-x-57-x-123",
"SMÅSTAD / PLATSA|Bookcase, 60 × 57 × 181 cm": "smastad-platsa-bookcase-60-x-57-x-181",
"SMÅSTAD / PLATSA|Cabinet, 60 × 57 × 63 cm": "smastad-platsa-cabinet-60-x-57-x-63",
@@ -725,6 +753,7 @@
"SMÅSTAD|Wardrobe, 60 × 42 × 181 cm": "smastad-wardrobe-60-x-42-x-181",
"SMEDSTORP|2-seat sofa": "smedstorp-2-seat-sofa",
"SMEDSTORP|3-seat sofa": "smedstorp-3-seat-sofa",
+ "SMÖRKULL|Office chair with armrests": "smorkull-office-chair-armrests",
"SMYGA|Bed frame with storage, 90 × 200 cm": "smyga-bed-frame-storage-90-x-200",
"SMYGA|Bed frame, 90 × 200 cm": "smyga-bed-frame-90-x-200",
"SMYGA|Desk, 122 × 60 cm": "smyga-desk-122-x-60",
@@ -743,6 +772,7 @@
"STENSELE|Bar table, 70 cm": "stensele-bar-table-70",
"STENSELE|Table, 70 cm": "stensele-table-70",
"STIG|Bar stool with backrest, 63 cm": "stig-bar-stool-backrest-63",
+ "STIGBYGEL|Swivel chair with armrests": "stigbygel-swivel-chair-armrests",
"STJÄRNÖ|Bed frame, Standard Double, 135 × 190 cm": "stjarno-bed-frame-standard-double-135-x-190",
"STJÄRNÖ|Bed frame, Standard Single, 90 × 190 cm": "stjarno-bed-frame-standard-single-90-x-190",
"STOCKHOLM 2025|2-seat sofa": "stockholm-2025-2-seat-sofa",
@@ -776,6 +806,7 @@
"STORKLINTA|Chest of 6 drawers, 140 × 50 × 75 cm": "storklinta-chest-6-drawers-140-x-50-x-75",
"STORKLINTA|Chest of 6 drawers, 70 × 50 × 120 cm": "storklinta-chest-6-drawers-70-x-50-x-120",
"STRANDÖN|Folding stool": "strandon-folding-stool",
+ "STYRSPEL|Gaming chair": "styrspel-gaming-chair",
"SUNDSÖ|Cabinet, 60 × 35 × 86 cm": "sundso-cabinet-60-x-35-x-86",
"SUNDSÖ|Folding chair": "sundso-folding-chair",
"SUNDSÖ|Table, 65 × 65 cm": "sundso-table-65-x-65",
@@ -847,6 +878,7 @@
"TORPARÖ|Table, outdoor, 130 × 74 cm": "torparo-table-outdoor-130-x-74",
"TORSJÖ|Coffee table, 88 cm": "torsjo-coffee-table-88",
"TORSJÖ|Side table, 45 cm": "torsjo-side-table-45",
+ "TOSSBERG / MALSKÄR|Swivel chair": "tossberg-malskar-swivel-chair",
"TOSSBERG|Chair": "tossberg-chair",
"TRANERED|Coffee table, 90 × 90 cm": "tranered-coffee-table-90-x-90",
"TRÄNNÖ|Stool": "tranno-stool",
@@ -875,6 +907,7 @@
"ULRIKSBERG|Armchair": "ulriksberg-armchair",
"UPPÅKRA|3-seat modular sofa": "uppakra-3-seat-modular-sofa",
"UTESPELARE|Gaming desk, 160 × 80 cm": "utespelare-gaming-desk-160-x-80",
+ "UTKLASSNING|Gaming chair": "utklassning-gaming-chair",
"UTMANING|Gaming desk sit/stand, 160 × 80 cm": "utmaning-gaming-desk-sit-stand-160-x-80",
"UTMANING|Gaming desk, 160 × 80 cm": "utmaning-gaming-desk-160-x-80",
"UTTER|Children's stool": "utter-children-s-stool",
diff --git a/src/components/art/Hardware.tsx b/src/components/art/Hardware.tsx
index e677024..111b089 100644
--- a/src/components/art/Hardware.tsx
+++ b/src/components/art/Hardware.tsx
@@ -249,6 +249,38 @@ function draw(kind: HwKind, len: number, dia: number): Drawn {
),
};
}
+ case "castor":
+ // standing up: the pin on top, the wheel underneath
+ return {
+ w: 52,
+ h: 80,
+ scalable: false,
+ node: (
+ <g>
+ <rect x={21.5} y={-40} width={9} height={21} rx={2} fill={METAL} {...stroke} />
+ <rect x={15} y={-20} width={22} height={4} rx={1.5} fill={PLASTIC} {...stroke} />
+ <circle cx={28} cy={14} r={25} fill={PLASTIC} {...stroke} />
+ <circle cx={28} cy={14} r={6} fill="#fff" {...stroke} />
+ <path d="M8 -16 H40 C46 -16 48 -12 48 -6 L46 4 H10 L6 -8 C6 -13 6 -16 8 -16 Z" fill={PLASTIC} {...stroke} />
+ </g>
+ ),
+ };
+ case "gasLift":
+ // lying down: the narrow end that drops into the base on the left, the rod for the seat on the right
+ return {
+ w: 132,
+ h: 26,
+ scalable: false,
+ node: (
+ <g>
+ <rect x={0} y={-7} width={26} height={14} rx={2} fill={METAL} {...stroke} />
+ <rect x={24} y={-13} width={82} height={26} rx={3} fill={METAL} {...stroke} />
+ <path d="M34 -6 H96" {...fine} />
+ <rect x={104} y={-9} width={6} height={18} rx={1.5} fill={PLASTIC} {...stroke} />
+ <rect x={110} y={-5.5} width={22} height={11} rx={2} fill={METAL} {...stroke} />
+ </g>
+ ),
+ };
}
}
@@ -277,5 +309,5 @@ export function HwArt({ kind, len, dia, fit = 72, pxPerMm, className }: { kind:
}
export function canActualSize(kind: HwKind) {
- return kind !== "runner";
+ return kind !== "runner" && kind !== "castor" && kind !== "gasLift";
}
diff --git a/src/data/ikea-guard.ts b/src/data/ikea-guard.ts
index 5268266..3b0d8b1 100644
--- a/src/data/ikea-guard.ts
+++ b/src/data/ikea-guard.ts
@@ -1,3 +1,3 @@
// Generated by scripts/ikea/build.ts from IKEA product data. Do not edit by hand.
// Real IKEA names we can't draw that look like a typo of one we can (folded, no spaces)
-export const IKEA_GUARD = "abrotten alsken alvsta ananas angskorn arsjon asphult aspinge backsjon basingen batskar bengta boholmen bolmso borrby branas brogrund brunsta burfjord byasjon byholma cissan dalskar duvholmen eklatera ekorre fagelon falskar fardal farvik fiskbo florsjon forneby forsa forvaltare fossta frakta fridfull frihult frojda froson frost fyllen gamman gansjon gatebo gillstad godis gresla gronmes grossjon grusnarv grytas gubbarp hackas hallnas hallspar halved hammaron hamnskar hanga hassjon havsdun havsen havskal havsmal hejsta helgeo hilver hogvind holmared holmeja horred hultarp hutten ikeaps2002 ikeaps2014 ikeaps2017 isjakt jagmastare jallby jattestor kalken kallarp kallboda kallror kallsjon kallsup kasker klamtare klipplax knalla knixhult knoppang kolsjon konstruera kroksjon kvalmso kvittera laktare larkar latsas lersta lill lilla lillabo lillhult lindasen lohals lova lyckad macksjon majsjon mala malskar manalg markus martorp mehamn melodi millberget molnas navlinge nereby nissedal nogsta norden opparyd ordning orrsjon orskar pinnarp pipranka plats plockar rahult ramsnas ramsta ranarp ransberg revskar ringsta rissla rockan runnen runskar seglaro sidsjo sindal sindvik sjalso skalryta skarig skedstor skogsa skogskorn skogsnas skogsror smaata smalom smarra smaska smycka sonhult spantad stelna stensta stensund stjarnhov storslinga strala strandad svansele sy tackan tacknan tallsparv tasjon terrsjo tisken tittebo tolken torared torkad tossig trogen tvarfot tysnes uddarp undvika uppfora upplaga upplid uppvind utaker vagdal vagomrade vagsjon vallasan vasskar vathult vedbak veddinge vedhamn viggso vilsta voxtorp vresjon";
+export const IKEA_GUARD = "abrotten afjall alsken alvsta ananas angskorn arsjon asphult aspinge backsjon basingen batskar bengta boholmen bolmso borrby branas brogrund brunsta burfjord byasjon byholma cissan dalskar duvholmen eklatera ekorre fagelon falskar fardal farvik fiskbo florsjon forneby forsa forvaltare fossta frakta fridfull frihult frojda froson frost fyllen gamman gansjon gatebo gillstad godis gresla gronmes grossjon grusnarv grytas gubbarp hackas hallnas hallspar halved hammaron hamnskar hanga hassjon havsdun havsen havskal havsmal hejsta helgeo hilver hogvind holmared holmeja horred hultarp hutten ikeaps2002 ikeaps2014 ikeaps2017 isjakt jagmastare jallby jattestor kalken kallarp kallboda kallror kallsjon kallsup kasker klamtare klipplax knalla knixhult knoppang kolsjon konstruera kroksjon kvalmso kvittera laktare larkar latsas lersta lill lilla lillabo lillhult lindasen lohals lova lyckad macksjon majsjon mala manalg martorp mehamn melodi molnas morkulla navlinge nereby nissedal nogsta norden opparyd ordning orrsjon orskar pinnarp pipranka plats plockar rahult ramsnas ramsta ranarp ransberg revskar ringsta rissla rockan runnen runskar saljen seglaro sidsjo sindal sindvik sjalso skalryta skarig skedstor skogsa skogskorn skogsnas skogsror smaata smalom smarra smaska smycka sonhult spantad stelna stensta stensund stjarnhov storslinga strala strandad svallet svansele sy tackan tacknan tallsparv tasjon terrsjo tisken tittebo tolken torared torkad tossig trogen tvallen tvarfot tysnes uddarp undvika uppfora upplaga upplid uppvind utaker vagdal vagomrade vagsjon vallasan vasskar vathult vedbak veddinge vedhamn viggso vilsta voxtorp vresjon";
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 87da73e..1c04e28 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -2,6 +2,7 @@
// Article numbers per guide: slug|number number
export const IKEA_ITEMS = `agen-armchair-cushion|99390774
agen-chair|50058376
+alefjall-office-chair|90320224 00419984
alex-desk-100-x-48|10473555 50473558 40588885
alex-desk-132-x-58|80483438 60473529 80588888
alex-drawer-unit|00473546 80473547 60588894
@@ -36,6 +37,7 @@ baggebo-shelving-unit-60-x-25-x-116|50481172
baggebo-shelving-unit-60-x-30-x-80|30621480
baggebo-sideboard-78-x-92|40553616
barslov-3-seat-sofa-bed|90541584 40541591
+bastboll-gaming-chair|50586254
bekvam-kitchen-trolley-58-x-50|70240351
bekvam-step-stool|70569545 10225589 40178888 40463852
bekvam-step-stool-63|90190411 90219829
@@ -92,11 +94,13 @@ billy-oxberg-bookcase-panel-glass-doors-80-x-41|69398837
bingsta-armchair|10455655
bissa-shoe-cabinet-2-compartments|70530218 70530256
bissa-shoe-cabinet-3-compartments|10530259 10530221
+bjorkberget-swivel-chair|60487159 20487161
bjorksnas-bed-frame-standard-king-150-x-200|79501725 09501724 69501721 49501722
bjorksnas-bedside-table-48-x-38|70407360
bjorksnas-chest-5-drawers-90-x-47-x-90|70407299
blaliden-glass-door-cabinet-35-x-32-x-151|00501243 00520519
blastasen-bedside-table-50-x-37-x-76|70617570 00595067
+bleckberget-swivel-chair|70564331 40573271
boastad-high-cabinet-41-x-32-x-185|50507006
boastad-sideboard-161-x-52-x-75|30507012
boastad-wall-shelf-181-x-32-x-32|00507018
@@ -135,6 +139,7 @@ brytning-desk-110-x-53-x-75|80609744 50609750
brytning-desk-135-x-53-x-75|50609745 30609751
brytning-desk-85-x-53-x-75|20598531 70609749
brytning-storage-unit-29-x-40-x-47|00598532 10609752
+brytning-swivel-chair|40644061 60611837
burvik-side-table-38|60340389 70340384
buskbo-armchair|49615399 70434311
buslatt-chair|90601139
@@ -162,6 +167,7 @@ ekholma-3-seat-sofa|19537416 89537413 09537412 59537419
ektorp-2-seat-sofa|59620729 49628684 09628681 09509027 99509018 59509015 89628677
ektorp-3-seat-sofa|59619759 29509012 89509009 19509003 79509000 59628706 99628709
ektorp-armchair|79628654 69628635 69628640 79552102 59552103 89552106 29552109
+eldberget-malskar-swivel-chair|59331847
enhet-base-fr-w-shelves-40-x-60-x-75|00448953 20448952 10448976 30448975
enhet-base-fr-w-shelves-60-x-40-x-60|60448974 80448973 40448951 60448950
enhet-high-cabinet-door-30-x-32-x-180|10623036 30632054
@@ -194,6 +200,8 @@ fjallbo-shelving-unit-100-x-95|50339292
fjallbo-shelving-unit-51-x-136|70342199
fjallbo-sideboard-111-x-47-x-95|00502799
fjallbo-tv-bench-150-x-36-x-54|90339290 90501309 40579032
+flintan-office-chair|50489031 30492204
+flintan-office-chair-armrests|49424470 79424464
flisat-children-s-stool|30596536
flisat-children-s-table-83-x-58|50298418
flisat-open-storage-88-x-38-x-117|60620120
@@ -234,6 +242,8 @@ grafjallet-dressing-table-100-x-42|30570225
grejsimojs-children-s-stool|60598973 50598959
grejsimojs-children-s-table-84-x-42|70598963
grillskar-side-table-outdoor-30-x-61|00523179
+gronfjall-office-chair-arm-headrest|89513921
+gronfjall-office-chair-armrests|20503477
gronsta-bar-stool-64|30554635
gronsta-chair|10637241 70637238 70519763 70554577
grotan-chair|70617565
@@ -269,6 +279,7 @@ hagaan-open-cabinet-40-x-48-x-33|40535514 70534909 40535528 60535532
hagernas-stool|80607014
hakanskar-coffee-table-80-x-64|70597162
hammarn-sofa-bed|00361493
+hattefjall-office-chair-armrests|20598159 60598162 40598163 00598160
hattholmen-table-outdoor-75-x-75-x-74|40443048
hauga-bedside-table-40-x-36|00488963
hauga-cabinet-2-doors-70-x-116|00415052 40415050
@@ -310,6 +321,7 @@ holmerud-side-table-80-x-31|40541421 20538721
holmsta-armchair|90508551
holmsta-froknabo-armchair|99428809
hornavan-trolley-26-x-48-x-77|70243873
+huvudspelare-gaming-chair|30507601
huvudspelare-gaming-desk-140-x-80|90539166
hyllis-shelf-unit-60-x-140|00278578
hyllis-shelving-unit-60-x-27-x-74|30428326
@@ -367,6 +379,7 @@ ivar-shelving-unit-doors-89-x-30-x-179|89403461 19403474
ivosjon-cabinet-doors-33-x-34-x-99|30569095 90609871
jakobsfors-coffee-table-80|90500121 50515167
janinge-chair|70246089
+jarvfjallet-office-chair-armrests|20510642 00521854
jattebo-2-seat-modular-sofa|09471411 09617705 29471410 29617634 99617428 09618620 89510404 69617707 59617623 59510410 49621183 49618623
jattebo-3-seat-modular-sofa|09485130 79485136 29617629 99617697 79618626 69617571
jattesta-coffee-table-80-x-80|30538792
@@ -440,6 +453,7 @@ kronoren-bedside-table-39-x-32-x-55|00610807
kronoren-chest-2-drawers-76-x-48-x-55|90610799
kronoren-open-wardrobe-90-x-49-x-181|40610805
krylbo-chair|10628208 40566751 40566746 90620581
+krylbo-swivel-chair|90573589
kullen-chest-2-drawers|80309241
kungsfors-kitchen-trolley-60-x-40|80334924
kyrre-stool|60416925 10608130
@@ -513,10 +527,13 @@ lisabo-table-88-x-78|40563776
listerby-coffee-table-140-x-60|90562246
lixhult-cabinet-35-x-60|20476520
lixhult-cabinet-60-x-35|70328669
+loberget-malskar-swivel-chair|19445469 29488571
+loberget-sibben-children-s-desk-chair|59337670
lommarp-bookcase-65-x-199|40415465
lommarp-cabinet-102-x-101|80415468 10436997
lommarp-cabinet-glass-doors-86-x-199|40383737
lommarp-tv-bench-159-x-45-x-81|30437000
+loparbana-gaming-chair|50586329 70586328
loshult-trolley-38-x-38-x-82|40576279
lovbacken-side-table-77-x-39|80270125
lustebo-chair|00541164
@@ -544,6 +561,9 @@ mannarp-3-seat-sofa|59604041 09619158 49619161 89619164 59604036 09604048
mariedamm-table-105|70492645
mariedamm-table-180-x-100|20576124
marius-stool|90184047 10135659
+markus-office-chair|30261152 50521861
+markus-office-chair-armrests|79628041 59628037
+matchspel-gaming-chair|50571530 20507606
metod-base-cabinet-shelves-2-doors-80-x-60|49507125 89507133 79465812 69507129 09538039 89517491 89458750
metod-base-cabinet-shelves-60-x-60|49589630 79507124 19507122 99487295 89507128 89473369 59466394
metod-high-cabinet-60-x-60-x-200|60212565 90212559 90212564 70212560 10212558 50212561 50591694
@@ -567,6 +587,7 @@ metod-wall-cabinet-w-shelves-glass-door-30-x-80|09589076 09587647 49394977 99490
micke-desk-105-x-50|80213074 10244743 09903014
micke-desk-142-x-50|90214308 60244745
micke-desk-73-x-50|30213076 20244747
+millberget-swivel-chair|20489396 50489390
milsbo-glass-door-cabinet-73-x-175|30396448 00396416
minnen-ext-bed-frame-slatted-bed-base-80-x-200|79418806 29123958 29580126
mittplan-desk-80-x-60|10549428
@@ -583,6 +604,7 @@ mossjon-glass-door-cabinet-2-doors-60-x-34-x-146|30564333
mossjon-wall-cabinet-glass-door-36-x-18-x-44|20621640
mossjon-wall-cabinet-w-shelves-glass-door-36-x-1|60567778
mullsjo-desk-135-x-70|30553240
+mullsjo-swivel-chair|70576584
muskan-bench-58-x-38|50345957
muskan-shelving-unit-37-x-140|50424327
nackanas-table-140-x-76|40511056
@@ -659,6 +681,8 @@ omar-shelving-unit-92-x-36-x-94|10069763
omar-shelving-unit-92-x-50-x-94|70483071
ommjange-chair|50594678
onnestad-armchair|09554473 49554471
+orfjall-children-s-desk-chair|30441771 90541433 60501886
+orfjall-swivel-chair|09416014 99501098
orreslatt-armchair|30555098
ortrask-coffee-table-110-x-68|10635845 30635849
ortrask-coffee-table-75-x-48|70635847
@@ -721,6 +745,7 @@ relatera-desk-117-x-60|29552864
relatera-desk-90-x-60|69552857
relatera-desk-sit-stand-117-x-60|99552865
relatera-desk-sit-stand-90-x-60|49552863
+renberget-swivel-chair|90503285
rian-side-table-50-x-30|80343419
ridspo-desk-140-x-70|00485224
risholmen-wing-chair-in-outdoor|00503794
@@ -736,6 +761,7 @@ rosentorp-extendable-table-110-155|80568239 60568264
rosentorp-extendable-table-155-215-x-87|60589902 80589901
rosentorp-extendable-table-160-215-x-110|20568256 60568240
rosentorp-stool|10618191
+rosentorp-swivel-chair|40576547
rudsta-glass-door-cabinet-42-x-37-x-155|60434825 90601417
rudsta-glass-door-cabinet-80-x-37-x-120|50450137
sagesund-upholstered-bed-frame-standard-double-1|89496484 99496469 49496513 29496514
@@ -778,6 +804,7 @@ skruvby-cabinet-glass-doors-70-x-90|20508842 70520361
skruvby-side-table-40-x-32|80532009 50531983
skruvby-sideboard-120-x-38-x-90|60568725 70568720
skruvby-tv-bench-156-x-38-x-60|10520364 80503549
+skruvsta-swivel-chair|70402999 10397788
slakt-bed-frame-3-storage-boxes-90-x-200|89386070
slakt-bed-frame-90-x-200|99608419 59612041
slakt-bed-frame-slatted-bed-base-90-x-200|79227755
@@ -789,6 +816,7 @@ slattum-upholstered-bed-frame-standard-single-90|90578737
smagora-desk-93-x-51|90489883
smagora-shelf-unit-29-x-88|30465489
smagora-wardrobe-80-x-50-x-187|10460888
+smallen-swivel-chair|00503435
smastad-bench-90-x-50-x-48|80433542
smastad-desk-90-x-79-x-100|29583224 59583227 99583193 69583217
smastad-platsa-bookcase-60-x-57-x-123|49387806 09396346 69544669 29544671
@@ -803,6 +831,7 @@ smastad-wall-cabinet-60-x-32-x-60|39388444
smastad-wardrobe-60-x-42-x-181|49390875
smedstorp-2-seat-sofa|09477229
smedstorp-3-seat-sofa|79477235 29477233
+smorkull-office-chair-armrests|90503450 80503455
smyga-bed-frame-90-x-200|60480780
smyga-bed-frame-storage-90-x-200|59444142
smyga-desk-122-x-60|40480781
@@ -825,6 +854,7 @@ stein-chair|50403669
stensele-bar-table-70|09288224
stensele-table-70|79288230
stig-bar-stool-backrest-63|80652431 30498418
+stigbygel-swivel-chair-armrests|50556431
stjarno-bed-frame-standard-double-135-x-190|89563341 79563365 99563326 19563410 99563411 99563388 59563366
stjarno-bed-frame-standard-single-90-x-190|39563367 99563331 59563390 79563412
stockholm-2025-2-seat-sofa|60586121 60586116 50586112
@@ -859,6 +889,7 @@ storklinta-chest-6-drawers-140-x-50-x-75|70627550 00628223 30627547 80627559
storklinta-chest-6-drawers-70-x-50-x-120|70627545 80628224 00627544 20627557
strandmon-wing-chair|50628942 70359830 80613171 40613168 90613175 60613167 30359846 40494641 30392544
strandon-folding-stool|30591100
+styrspel-gaming-chair|80522034 90613057
sundso-cabinet-60-x-35-x-86|80586243 70584188 10584186
sundso-folding-chair|50575887 40575883 90575890 10575889 30575888 90575885 70575891
sundso-table-65|80575895 40575897
@@ -933,6 +964,7 @@ torparo-table-outdoor-130-x-74|60595724
torsjo-coffee-table-88|50590406
torsjo-side-table-45|60590415
tossberg-chair|80584437 40582647 90551120
+tossberg-malskar-swivel-chair|59508228 69508223 09508235 89508203 69508242 59508209
tranered-coffee-table-90-x-90|10608998
tranno-stool|50546381
travsport-desk-sit-stand-120-x-70|59620951
@@ -963,6 +995,7 @@ ugglerum-side-table-46-x-40|00627983
ulriksberg-armchair|90434310
uppakra-3-seat-modular-sofa|99620341 49620353 79620337 69620347 59620324 39620344 79620318 09620246 49620249 79620064 79620059 69620069 89620252 19620255 19619940 99619955 99619922 59619943 39619958 79619937 69619928 89619913 39619897 89620313 79619904 79619876 69620314 59619882 99619856 99619842 99619837 79619862 69619867 69619853 69619848 89619970 79619961 69619985 49619991 49619967 39619982 19619964
utespelare-gaming-desk-160-x-80|10571532 80507627
+utklassning-gaming-chair|40629287 60629045
utmaning-gaming-desk-160-x-80|89571732
utmaning-gaming-desk-sit-stand-160-x-80|09571689
utter-children-s-stool|50357785
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index 6a85855..e4cc61b 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -2,6 +2,7 @@
// Rows we can draw, one per line: name|kind|variant|w|h|d|params|keywords|slug
export const IKEA_ROWS = `AGEN|armchair|Armchair with cushion|75|90|80
AGEN|chair|Chair|44|88|50
+ALEFJÄLL|office|Office chair|64|105|64|arms=slim
ALEX|chest|Drawer unit on castors, 36 × 50 cm|36|50|58|rows=4,knobs=none
ALEX|chest|Drawer unit on castors, 36 × 76 cm|36|76|58|rows=5,knobs=none
ALEX|chest|Drawer unit on castors, 67 × 66 cm|67|66|58|rows=5,knobs=none
@@ -34,6 +35,7 @@ BAGGEBO|open|Shelving unit, 60 × 30 × 80 cm|60|80|30
BAGGEBO|open|Shelving unit, 60 × 25 × 116 cm|60|116|25
BAGGEBO|sideboard|Sideboard, 78 × 92 cm|78|92|45
BÅRSLÖV|sofa|3-seat sofa-bed|230|85|92|seats=3
+BÄSTBOLL|office|Gaming chair|64|128|64|arms=slim,seatH=50
BEKVÄM|stool|Step stool, 63 cm|35|63|35
BEKVÄM|trolley|Kitchen trolley, 58 × 50 cm|58|80|50
BERGSHYTTAN|bench|Bench, 210 × 38 cm|210|45|38
@@ -80,11 +82,13 @@ BILLY / OXBERG|cabinet|Bookcase with glass-doors, 80 × 41 × 202 cm|80|202|41
BILLY / OXBERG|cabinet|Bookcase with panel/glass doors, 80 × 41 × 202 cm|80|202|41
BILLY / OXBERG|cabinet|Bookcase with glass doors, 80 × 30 × 237 cm|80|237|30
BINGSTA|armchair|Armchair|75|90|80
+BJÖRKBERGET|office|Swivel chair|60|105|64|arms=none
BJÖRKSNÄS|bed|Bed frame, Standard King, 150 × 200 cm|166|100|209|m=150
BJÖRKSNÄS|chest|Chest of 5 drawers, 90 × 47 × 90 cm|90|90|47|rows=5
BJÖRKSNÄS|nightstand|Bedside table, 48 × 38 cm|48|55|38|rows=1
BLÅLIDEN|cabinet|Glass-door cabinet, 35 × 32 × 151 cm|35|151|32
BLÄSTÅSEN|nightstand|Bedside table, 50 × 37 × 76 cm|50|76|37|rows=2
+BLECKBERGET|office|Swivel chair|60|105|64|arms=none
BOASTAD|cabinet|High cabinet, 41 × 32 × 185 cm|41|185|32
BOASTAD|sideboard|Sideboard, 161 × 52 × 75 cm|161|75|52
BOASTAD|wallshelf|Wall shelf, 181 × 32 × 32 cm|181|32|32
@@ -115,6 +119,7 @@ BROR|trolley|Trolley, 85 × 55 cm|85|80|55
BRYTNING|desk|Desk, 85 × 53 × 75 cm|85|75|53
BRYTNING|desk|Desk, 110 × 53 × 75 cm|110|75|53
BRYTNING|desk|Desk, 135 × 53 × 75 cm|135|75|53
+BRYTNING|office|Swivel chair|60|105|64|arms=none
BRYTNING|open|Storage unit, 29 × 40 × 47 cm|29|47|40
BURVIK|side|Side table, 38 cm|38|50|38|round=1
BUSKBO|armchair|Armchair|75|90|80
@@ -140,6 +145,7 @@ EKHOLMA|sofa|2-seat sofa-bed|170|85|92|seats=2
EKHOLMA|sofa|3-seat sofa|230|85|92|seats=3
EKTORP|armchair|Armchair|75|90|80
EKTORP|sofa|2-seat sofa|170|85|92|seats=2
+ELDBERGET / MALSKÄR|office|Swivel chair|60|105|64|arms=none
ENHET|cabinet|High cabinet with door, 30 × 32 × 180 cm|30|180|32|doors=1
ENHET|kitchen|Base fr w shelves, 40 × 60 × 75 cm|40|75|60|doors=0
ENHET|kitchen|Base fr w shelves, 60 × 40 × 60 cm|60|60|40|doors=0
@@ -172,6 +178,8 @@ FJÄLLBO|open|Shelving unit, 100 × 95 cm|100|95|35
FJÄLLBO|open|Shelving unit, 100 × 136 cm|100|136|35
FJÄLLBO|sideboard|Sideboard, 111 × 47 × 95 cm|111|95|47
FJÄLLBO|tv|TV bench, 150 × 36 × 54 cm|150|54|36
+FLINTAN|office|Office chair|60|105|64|arms=none
+FLINTAN|office|Office chair with armrests|64|105|64|arms=slim
FLISAT|kidstable|Children's table, 83 × 58 cm|83|48|58||kids
FLISAT|open|Open storage, 88 × 38 × 117 cm|88|117|38
FLISAT|stool|Children's stool|35|30|35||kids
@@ -210,6 +218,8 @@ GRÅFJÄLLET|nightstand|Bedside table, 45 × 36 × 59 cm|45|59|36|rows=1
GREJSIMOJS|kidstable|Children's table, 84 × 42 cm|84|48|42||kids
GREJSIMOJS|stool|Children's stool|35|30|35||kids
GRILLSKÄR|side|Side table, outdoor, 30 × 61 cm|30|50|61||outdoor garden
+GRÖNFJÄLL|office|Office chair with armrests|64|105|64|arms=slim
+GRÖNFJÄLL|office|Office chair with arm/headrest|64|128|64|arms=slim
GRÖNSTA|chair|Chair|44|88|50
GRÖNSTA|stool|Bar stool, 64 cm|35|64|35
GRÖTÅN|chair|Chair|44|88|50
@@ -245,6 +255,7 @@ HAGAÅN|cabinet|Open cabinet, 40 × 48 × 33 cm|40|33|48|doors=0
HÄGERNÄS|stool|Stool|35|45|35
HÅKANSKÄR|coffee|Coffee table, 80 × 64 cm|80|45|64
HAMMARN|sofa|Sofa-bed|230|85|92|seats=3
+HATTEFJÄLL|office|Office chair with armrests|64|105|64|arms=slim
HATTHOLMEN|dining|Table, outdoor, 75 × 75 × 74 cm|75|74|75||outdoor garden
HAUGA|cabinet|Cabinet with 2 doors, 70 × 116 cm|70|116|40|knobs=bar
HAUGA|cabinet|Glass-door cabinet, 105 × 116 cm|105|116|40|knobs=bar
@@ -275,6 +286,7 @@ HOLMSTA|armchair|Armchair|75|90|80
HOLMSTA / FRÖKNABO|armchair|Armchair|75|90|80
HORNAVAN|trolley|Trolley, 26 × 48 × 77 cm|26|77|48
HUVUDSPELARE|desk|Gaming desk, 140 × 80 cm|140|74|80
+HUVUDSPELARE|office|Gaming chair|64|128|64|arms=slim,seatH=50
HYLLIS|open|Shelving unit, 60 × 27 × 74 cm|60|74|27||outdoor garden
HYLTARP|sofa|2-seat sofa|170|85|92|seats=2
HYLTARP|sofa|2-seat sofa-bed|170|85|92|seats=2
@@ -324,6 +336,7 @@ IVAR|open|Shelving unit, 89 × 30 × 226 cm|89|226|30
IVAR|open|Shelving unit, 89 × 50 × 226 cm|89|226|50
IVÖSJÖN|cabinet|Cabinet with doors, 33 × 34 × 99 cm|33|99|34
JAKOBSFORS|coffee|Coffee table, 80 cm|80|45|80|round=1
+JÄRVFJÄLLET|office|Office chair with armrests|64|105|64|arms=slim
JÄTTEBO|sofa|2-seat modular sofa|170|85|92|seats=2
JÄTTEBO|sofa|3-seat modular sofa|230|85|92|seats=3
JÄTTESTA|coffee|Coffee table, 80 × 80 cm|80|45|80
@@ -386,6 +399,7 @@ KRONÖREN|chest|Chest of 2 drawers, 76 × 48 × 55 cm|76|55|48|rows=2
KRONÖREN|nightstand|Bedside table, 39 × 32 × 55 cm|39|55|32|rows=1
KRONÖREN|wardrobe|Open wardrobe, 90 × 49 × 181 cm|90|181|49|doors=0
KRYLBO|chair|Chair|44|88|50
+KRYLBO|office|Swivel chair|60|105|64|arms=none
KUNGSFORS|trolley|Kitchen trolley, 60 × 40 cm|60|80|40
LACK|side|Side table, 35 × 35 cm|35|45|35|legs=square,attach=screw
LACK|tv|TV bench, 90 × 36 × 45 cm|90|45|36|doors=0
@@ -448,10 +462,13 @@ LISABO|dining|Table, 88 × 78 cm|88|74|78
LISABO|dining|Table, 105 cm|105|74|105|round=1
LIXHULT|cabinet|Cabinet, 35 × 60 cm|35|60|40
LIXHULT|cabinet|Cabinet, 60 × 35 cm|60|35|40
+LOBERGET / MALSKÄR|office|Swivel chair|60|105|64|arms=none
+LOBERGET / SIBBEN|office|Children's desk chair|52|86|52|arms=none,seatH=42|kids
LOMMARP|bookcase|Bookcase, 65 × 199 cm|65|199|30
LOMMARP|cabinet|Cabinet with glass doors, 86 × 199 cm|86|199|40
LOMMARP|cabinet|Cabinet, 102 × 101 cm|102|101|40
LOMMARP|tv|TV bench, 159 × 45 × 81 cm|159|81|45
+LÖPARBANA|office|Gaming chair|64|128|64|arms=slim,seatH=50
LOSHULT|trolley|Trolley, 38 × 38 × 82 cm|38|82|38
LÖVBACKEN|side|Side table, 77 × 39 cm|77|50|39
LUSTEBO|chair|Chair|44|88|50
@@ -476,6 +493,9 @@ MANNARP|sofa|2-seat sofa|170|85|92|seats=2
MANNARP|sofa|3-seat sofa|230|85|92|seats=3
MARIEDAMM|dining|Table, 105 cm|105|74|105|round=1
MARIEDAMM|dining|Table, 180 × 100 cm|180|74|100
+MARKUS|office|Office chair|64|128|64|arms=slim
+MARKUS|office|Office chair with armrests|64|128|64|arms=slim
+MATCHSPEL|office|Gaming chair|64|128|64|arms=slim,seatH=50
METOD|kitchen|High cabinet with shelves, 40 × 37 × 200 cm|40|200|37|doors=0
METOD|kitchen|Base cabinet with shelves, 60 × 60 cm|60|80|60|doors=0
METOD|kitchen|High cabinet with shelves, 60 × 60 × 140 cm|60|140|60|doors=0
@@ -498,6 +518,7 @@ METOD|wallcab|Wall cabinet with 2 glass doors, 80 × 40 cm|80|40|35
METOD|wallcab|Wall cabinet with shelves/2 doors, 80 × 80 cm|80|80|35
MICKE|desk|Desk, 73 × 50 cm|73|75|50|legs=square,attach=apron
MICKE|desk|Desk, 142 × 50 cm|142|75|50|legs=square,attach=apron
+MILLBERGET|office|Swivel chair|60|105|64|arms=none
MILSBO|cabinet|Glass-door cabinet, 73 × 175 cm|73|175|42
MINNEN|bed|Ext bed frame with slatted bed base, 80 × 200 cm|96|100|209|m=80
MITTPLAN|desk|Desk, 80 × 60 cm|80|74|60
@@ -514,6 +535,7 @@ MOSSJÖN|cabinet|Glass-door cabinet with 2 doors, 60 × 34 × 146 cm|60|146|34
MOSSJÖN|wallcab|Wall cabinet with glass door, 36 × 18 × 44 cm|36|44|18|doors=1
MOSSJÖN|wallcab|Wall cabinet w shelves/glass door, 36 × 18 × 102 cm|36|102|18|doors=1
MULLSJÖ|desk|Desk, 135 × 70 cm|135|74|70
+MULLSJÖ|office|Swivel chair|60|105|64|arms=none
MUSKAN|bench|Bench, 58 × 38 cm|58|45|38
MUSKAN|open|Shelving unit, 37 × 140 cm|37|140|35
NACKANÄS|dining|Table, 140 × 76 cm|140|74|76
@@ -587,6 +609,8 @@ OMAR|open|Shelving unit, 92 × 36 × 94 cm|92|94|36
OMAR|open|Shelving unit, 92 × 50 × 94 cm|92|94|50
OMMJÄNGE|chair|Chair|44|88|50
ÖNNESTAD|armchair|Armchair|75|90|80
+ÖRFJÄLL|office|Children's desk chair|52|86|52|arms=none,seatH=42|kids
+ÖRFJÄLL|office|Swivel chair|60|105|64|arms=none
ORRESLÄTT|armchair|Armchair|75|90|80
ÖRTRÄSK|coffee|Coffee table, 75 × 48 cm|75|45|48
ÖRTRÄSK|coffee|Coffee table, 110 × 68 cm|110|45|68
@@ -646,6 +670,7 @@ RELATERA|desk|Desk sit/stand, 90 × 60 cm|90|74|60
RELATERA|desk|Desk, 90 × 60 cm|90|74|60
RELATERA|desk|Desk sit/stand, 117 × 60 cm|117|74|60
RELATERA|desk|Desk, 117 × 60 cm|117|74|60
+RENBERGET|office|Swivel chair|60|105|64|arms=none
RIAN|side|Side table, 50 × 30 cm|50|50|30
RIDSPÖ|desk|Desk, 140 × 70 cm|140|74|70
RISHOLMEN|armchair|Wing chair, in/outdoor|75|104|80||outdoor garden
@@ -660,6 +685,7 @@ ROSENTORP|desk|Desk, 120 × 60 cm|120|74|60
ROSENTORP|dining|Extendable table, 110/155 cm|110|74|110|round=1
ROSENTORP|dining|Extendable table, 155/215 × 87 cm|155|74|87
ROSENTORP|dining|Extendable table, 160/215 × 110 cm|160|74|110
+ROSENTORP|office|Swivel chair|60|105|64|arms=none
ROSENTORP|stool|Stool|35|45|35
RUDSTA|cabinet|Glass-door cabinet, 42 × 37 × 155 cm|42|155|37
RUDSTA|cabinet|Glass-door cabinet, 80 × 37 × 120 cm|80|120|37
@@ -701,6 +727,7 @@ SKRUVBY|cabinet|Cabinet with glass doors, 70 × 90 cm|70|90|40
SKRUVBY|side|Side table, 40 × 32 cm|40|50|32
SKRUVBY|sideboard|Sideboard, 120 × 38 × 90 cm|120|90|38
SKRUVBY|tv|TV bench, 156 × 38 × 60 cm|156|60|38
+SKRUVSTA|office|Swivel chair|60|105|64|arms=none
SLÄKT|bed|Bed frame with 3 storage boxes, 90 × 200 cm|106|100|209|m=90
SLÄKT|bed|Bed frame with slatted bed base, 90 × 200 cm|106|100|209|m=90
SLÄKT|bed|Bed frame with storage, 90 × 200 cm|106|100|209|m=90
@@ -712,6 +739,7 @@ SLATTUM|bed|Upholstered bed frame, Standard Double, 135 × 190 cm|151|85|199|m=1
SMÅGÖRA|desk|Desk, 93 × 51 cm|93|74|51||kids children
SMÅGÖRA|open|Shelf unit, 29 × 88 cm|29|88|35||kids children
SMÅGÖRA|wardrobe|Wardrobe, 80 × 50 × 187 cm|80|187|50
+SMÄLLEN|office|Swivel chair|60|105|64|arms=none
SMÅSTAD|bench|Bench, 90 × 50 × 48 cm|90|48|50||kids children
SMÅSTAD|desk|Desk, 90 × 79 × 100 cm|90|100|79||kids children
SMÅSTAD|wallcab|Wall cabinet, 60 × 32 × 60 cm|60|60|32||kids children
@@ -726,6 +754,7 @@ SMÅSTAD / PLATSA|wardrobe|Wardrobe, 60 × 42 × 181 cm|60|181|42||kids children
SMÅSTAD / PLATSA|wardrobe|Wardrobe, 60 × 57 × 181 cm|60|181|57||kids children
SMEDSTORP|sofa|2-seat sofa|170|85|92|seats=2
SMEDSTORP|sofa|3-seat sofa|230|85|92|seats=3
+SMÖRKULL|office|Office chair with armrests|64|105|64|arms=slim
SMYGA|bed|Bed frame with storage, 90 × 200 cm|106|100|209|m=90
SMYGA|bed|Bed frame, 90 × 200 cm|106|100|209|m=90
SMYGA|desk|Desk, 122 × 60 cm|122|74|60||kids children
@@ -744,6 +773,7 @@ STEIN|chair|Chair|44|88|50
STENSELE|bar|Bar table, 70 cm|70|105|70|round=1
STENSELE|dining|Table, 70 cm|70|74|70|round=1
STIG|chair|Bar stool with backrest, 63 cm|44|95|50|seatH=63
+STIGBYGEL|office|Swivel chair with armrests|64|105|64|arms=slim
STJÄRNÖ|bed|Bed frame, Standard Single, 90 × 190 cm|106|100|199|m=90,l=190
STJÄRNÖ|bed|Bed frame, Standard Double, 135 × 190 cm|151|100|199|m=135,l=190
STOCKHOLM|coffee|Coffee table, 180 × 59 cm|180|45|59
@@ -777,6 +807,7 @@ STORKLINTA|chest|Chest of 6 drawers, 140 × 50 × 75 cm|140|75|50|rows=3,cols=2
STORKLINTA|nightstand|Chest of 2 drawers, 30 × 50 × 53 cm|30|53|50|rows=2
STORKLINTA|nightstand|Chest of 2 drawers, 40 × 50 × 53 cm|40|53|50|rows=2
STRANDÖN|stool|Folding stool|35|45|35||outdoor garden
+STYRSPEL|office|Gaming chair|64|128|64|arms=slim,seatH=50
SUNDSÖ|cabinet|Cabinet, 60 × 35 × 86 cm|60|86|35||outdoor garden
SUNDSÖ|chair|Folding chair|44|88|50||outdoor garden
SUNDSÖ|dining|Table, 65 × 65 cm|65|74|65||outdoor garden
@@ -849,6 +880,7 @@ TORPARÖ|dining|Table, outdoor, 130 × 74 cm|130|74|74||outdoor garden
TORSJÖ|coffee|Coffee table, 88 cm|88|45|88|round=1
TORSJÖ|side|Side table, 45 cm|45|50|45|round=1
TOSSBERG|chair|Chair|44|88|50
+TOSSBERG / MALSKÄR|office|Swivel chair|60|105|64|arms=none
TRANERED|coffee|Coffee table, 90 × 90 cm|90|45|90
TRÄNNÖ|stool|Stool|35|45|35
TRAVSPORT|desk|Desk sit/stand, 120 × 70 cm|120|74|70
@@ -876,6 +908,7 @@ UGGLERUM|side|Side table, 46 × 40 cm|46|50|40
ULRIKSBERG|armchair|Armchair|75|90|80
UPPÅKRA|sofa|3-seat modular sofa|230|85|92|seats=3
UTESPELARE|desk|Gaming desk, 160 × 80 cm|160|74|80
+UTKLASSNING|office|Gaming chair|64|128|64|arms=slim,seatH=50
UTMANING|desk|Gaming desk sit/stand, 160 × 80 cm|160|74|80
UTMANING|desk|Gaming desk, 160 × 80 cm|160|74|80
UTTER|stool|Children's stool|35|30|35||kids
diff --git a/src/engine/drawable.ts b/src/engine/drawable.ts
index d3135f9..cf7198e 100644
--- a/src/engine/drawable.ts
+++ b/src/engine/drawable.ts
@@ -96,7 +96,17 @@ export function partDrawable(p: PartType, holes: Hole[]) {
const d = new Drawable();
const [sx, sy, sz] = p.size;
const color = MAT_COLOR[p.material] ?? FACE.board;
- if (p.shape === "cyl") {
+ if (p.pieces) {
+ for (const q of p.pieces) {
+ const [qx, qy, qz] = q.size;
+ const mat = q.material ?? p.material;
+ const c = MAT_COLOR[mat] ?? FACE.board;
+ const at = { position: q.pos, rotation: q.rot };
+ if (q.shape === "cyl") addSolid(d, `cyl:${qx}:${qy}`, () => new THREE.CylinderGeometry(qx / 2, qx / 2, qy, 32), c, { hull: "cyl", ...at });
+ else if (mat === "soft") addSolid(d, `soft:${qx}:${qy}:${qz}`, () => roundedBox(qx, qy, qz, Math.min(42, qy / 2.4, qx / 3, qz / 3)), c, { hull: "box", half: [qx / 2, qy / 2, qz / 2], edges: false, ...at });
+ else addSolid(d, `box:${qx}:${qy}:${qz}`, () => new THREE.BoxGeometry(qx, qy, qz), c, at);
+ }
+ } else if (p.shape === "cyl") {
addSolid(d, `cyl:${sx}:${sy}`, () => new THREE.CylinderGeometry(sx / 2, sx / 2, sy, 32), color, { hull: "cyl" });
} else if (p.material === "soft") {
addSolid(d, `soft:${sx}:${sy}:${sz}`, () => roundedBox(sx, sy, sz, Math.min(42, sy / 2.4, sx / 3, sz / 3)), color, { hull: "box", half: [sx / 2, sy / 2, sz / 2], edges: false });
@@ -240,6 +250,23 @@ export function hwDrawable(kind: HwKind, len: number, dia: number) {
addSolid(d, `plug:${len}`, cyl(r, len, 12), plastic, { hull: "cyl", position: [0, -len / 2, 0] });
addSolid(d, "plug:lip", cyl(r + 1.5, 1.5, 14), plastic, { hull: "cyl", position: [0, 0.75, 0] });
break;
+ case "castor": {
+ // a pin that pushes into the base, a hood and twin wheels trailing behind the pin
+ addSolid(d, "ca:pin", cyl(5.5, 22, 12), metal, { hull: "cyl", position: [0, -11, 0] });
+ addSolid(d, "ca:collar", cyl(9, 3, 16), plastic, { hull: "cyl", position: [0, 1.5, 0] });
+ addSolid(d, `ca:hood:${dia}`, () => new THREE.BoxGeometry(dia * 0.68, len - r - 2, dia * 0.9), plastic, { position: [0, 3 + (len - r - 2) / 2, -dia * 0.12] });
+ for (const x of [-1, 1])
+ addSolid(d, `ca:wheel:${dia}`, () => new THREE.CylinderGeometry(r, r, dia * 0.26, 24).rotateZ(Math.PI / 2), plastic, { hull: "radial", position: [x * dia * 0.21, len - r, -dia * 0.16] });
+ break;
+ }
+ case "gasLift": {
+ // the narrow end drops into the base; the rod at the top goes up into the seat
+ addSolid(d, "gl:foot", cyl(14, 60, 18), metal, { hull: "cyl", position: [0, -30, 0] });
+ addSolid(d, `gl:body:${len}:${dia}`, cyl(r, len - 40, 24), metal, { hull: "cyl", position: [0, (len - 40) / 2, 0] });
+ addSolid(d, "gl:ring", cyl(18, 6, 20), plastic, { hull: "cyl", position: [0, len - 37, 0] });
+ addSolid(d, "gl:rod", cyl(11, 36, 16), metal, { hull: "cyl", position: [0, len - 18, 0] });
+ break;
+ }
}
return d;
}
diff --git a/src/lib/plan/builder.ts b/src/lib/plan/builder.ts
index 3e13c98..66e5694 100644
--- a/src/lib/plan/builder.ts
+++ b/src/lib/plan/builder.ts
@@ -5,6 +5,7 @@ import type {
Item,
PartItem,
PartMaterial,
+ PartPiece,
PartType,
Plan,
Pose,
@@ -16,7 +17,7 @@ import type {
Vec3,
WarnId,
} from "../types";
-import { toLocal, unrotate } from "./math";
+import { rotate, toLocal, unrotate } from "./math";
const LETTERS = "ABCDEFGHJKLMNPRSTUVWXYZ";
@@ -47,6 +48,8 @@ export const HW = {
glide: { kind: "glide", len: 4, dia: 20 },
wallScrew: { kind: "screw", len: 50, dia: 5, notIncluded: true },
plug: { kind: "plug", len: 35, dia: 8, notIncluded: true },
+ castor: { kind: "castor", len: 58, dia: 50 },
+ gasLift: { kind: "gasLift", len: 200, dia: 50 },
} satisfies Record<string, HwDef>;
const HW_NAMES: Record<HwKind, string> = {
@@ -66,6 +69,8 @@ const HW_NAMES: Record<HwKind, string> = {
hinge: "Hinge",
glide: "Felt pad",
plug: "Wall plug",
+ castor: "Castor",
+ gasLift: "Gas lift",
};
export function hwSpecText(kind: HwKind, len: number, dia: number) {
@@ -152,6 +157,32 @@ export class PlanBuilder {
return id;
}
+ /**
+ * A part made of several boxes and cylinders (a star base, a cot side with its bars). The part is
+ * centred on the bounding box of its pieces: `mid` is that centre in the frame the pieces were given
+ * in, so placing the part at `mid` (unturned) puts every piece where it was drawn.
+ */
+ compound(name: string, pieces: PartPiece[], o: { material?: PartMaterial; extra?: boolean } = {}) {
+ const lo: Vec3 = [Infinity, Infinity, Infinity], hi: Vec3 = [-Infinity, -Infinity, -Infinity];
+ for (const p of pieces) {
+ const [sx, sy, sz] = p.size;
+ for (const a of [-1, 1])
+ for (const b of [-1, 1])
+ for (const c of [-1, 1]) {
+ const v = rotate([(a * sx) / 2, (b * sy) / 2, (c * sz) / 2], p.rot ?? [0, 0, 0]);
+ for (let i = 0; i < 3; i++) {
+ lo[i] = Math.min(lo[i], p.pos[i] + v[i]);
+ hi[i] = Math.max(hi[i], p.pos[i] + v[i]);
+ }
+ }
+ }
+ const r = (n: number) => Math.round(n * 10) / 10;
+ const mid: Vec3 = [r((lo[0] + hi[0]) / 2), r((lo[1] + hi[1]) / 2), r((lo[2] + hi[2]) / 2)];
+ const type = this.part(name, [r(hi[0] - lo[0]), r(hi[1] - lo[1]), r(hi[2] - lo[2])], { material: o.material, extra: o.extra });
+ this.parts[this.parts.length - 1].pieces = pieces.map((p) => ({ ...p, pos: [r(p.pos[0] - mid[0]), r(p.pos[1] - mid[1]), r(p.pos[2] - mid[2])] }));
+ return { type, mid };
+ }
+
place(ref: string, pos: Vec3, rot: Vec3 = [0, 0, 0]) {
const key = "i" + this.n++;
const it: PartItem = { key, kind: "part", ref, final: { pos, rot }, states: [], holes: [] };
diff --git a/src/lib/plan/office.ts b/src/lib/plan/office.ts
new file mode 100644
index 0000000..901eefe
--- /dev/null
+++ b/src/lib/plan/office.ts
@@ -0,0 +1,202 @@
+import type { PartPiece, ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * Office and swivel chairs, in IKEA's order: castors into the star base, the gas lift into the base,
+ * the mechanism under the seat, then the armrests and the backrest, and the seat onto the gas lift last.
+ * The seat is built in scenes of its own (upside down, then lying on its back), so each view stands on the floor.
+ */
+export function buildOffice(b: PlanBuilder, s: ProductSpec) {
+ const p = s.seat ?? {};
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const arms = !!p.arms;
+ const seatTop = clamp((p.seatH ?? 48) * 10, 400, 560);
+ const seatT = 80;
+ const seatBot = seatTop - seatT;
+ const sw = clamp(W - (arms ? 140 : 100), 380, 520);
+ const sd = clamp(D - 130, 360, 500);
+ const zs = 20; // the seat sits a little in front of the gas lift
+
+ /* ---------- star base ---------- */
+ const R = clamp(Math.max(W, D) / 2 - 10, 250, 345);
+ const tilt = 0.09;
+ const armT = 32, armW = 44;
+ const r0 = 20, rt = R - 24; // arms start inside the hub; castors sit just in from the tips
+ const rm = (r0 + R) / 2;
+ const tipY = HW.castor.len;
+ const ym = tipY + (rt - rm) * Math.tan(tilt) + armT / 2 / Math.cos(tilt);
+ const hubD = 72, hubH = 115;
+ const hubBot = ym + (rm - hubD / 2) * Math.tan(tilt) - armT / 2 - 4;
+ const hubTop = hubBot + hubH;
+ const angles = [0, 1, 2, 3, 4].map((i) => -Math.PI / 2 + (i * 2 * Math.PI) / 5); // one arm points forward
+ const basePieces: PartPiece[] = [{ shape: "cyl", size: [hubD, hubH, hubD], pos: [0, hubBot + hubH / 2, 0] }];
+ for (const a of angles) basePieces.push({ shape: "box", size: [(R - r0) / Math.cos(tilt), armT, armW], pos: [rm * Math.cos(a), ym, -rm * Math.sin(a)], rot: [0, a, -tilt] });
+ const baseC = b.compound("Star base", basePieces, { material: "metal" });
+ const base = b.place(baseC.type, baseC.mid);
+
+ /* ---------- seat, mechanism ---------- */
+ const seatPT = b.part("Seat", [sw, seatT, sd], { material: "soft" });
+ const seat = b.place(seatPT, [0, seatTop - seatT / 2, zs]);
+ const mechH = 40;
+ const mechBot = seatBot - mechH;
+ const mechC = b.compound(
+ "Mechanism",
+ [
+ { shape: "box", size: [230, mechH, 240], pos: [0, seatBot - mechH / 2, 0] },
+ // the height lever, on the right
+ { shape: "box", size: [120, 10, 16], pos: [115 + 60, seatBot - 30, 50] },
+ { shape: "box", size: [34, 14, 26], pos: [115 + 120, seatBot - 30, 50] },
+ ],
+ { material: "metal" },
+ );
+ const mech = b.place(mechC.type, mechC.mid);
+
+ /* ---------- armrests ---------- */
+ const armKeys: string[] = [];
+ const postX = sw / 2 + 38;
+ const padY = seatTop + 200;
+ if (arms) {
+ const armC = b.compound(
+ "Armrest",
+ [
+ { shape: "box", size: [158, 12, 70], pos: [-(sw / 2 - 41), seatBot - 6, zs], material: "metal" },
+ { shape: "box", size: [30, padY - 16 - (seatBot - 12), 56], pos: [-postX, (padY - 16 + seatBot - 12) / 2, zs], material: "metal" },
+ { shape: "box", size: [64, 32, 250], pos: [-postX, padY, zs], material: "soft" },
+ ],
+ { material: "metal" },
+ );
+ armKeys.push(b.place(armC.type, armC.mid), b.place(armC.type, [-armC.mid[0], armC.mid[1], armC.mid[2]], [0, Math.PI, 0]));
+ }
+
+ /* ---------- backrest with its bar ---------- */
+ const backBot = seatTop + 60;
+ const bh = Math.max(260, H - backBot);
+ const bw = clamp(sw - 20, 360, 540);
+ const cushT = 70;
+ const zFront = zs - sd / 2 - 10; // front of the backrest
+ const zBar = zFront - cushT - 9;
+ const barTop = backBot + bh * 0.45;
+ const barLow = seatBot - 18;
+ const zMechBack = -120;
+ const backC = b.compound(
+ "Backrest",
+ [
+ { shape: "box", size: [bw, bh, cushT], pos: [0, backBot + bh / 2, zFront - cushT / 2], material: "soft" },
+ { shape: "box", size: [60, barTop - barLow, 18], pos: [0, (barTop + barLow) / 2, zBar] },
+ { shape: "box", size: [60, 18, zMechBack - (zBar - 9)], pos: [0, seatBot - 9, (zMechBack + zBar - 9) / 2] },
+ ],
+ { material: "metal" },
+ );
+ const back = b.place(backC.type, backC.mid);
+ const seatParts = [seat, mech, ...armKeys, back];
+
+ /* ---------- steps ---------- */
+ b.step(
+ {
+ title: "Push a castor into each leg of the base",
+ detail: "Lay the base upside down. Press each castor in until it clicks.",
+ pose: "-y",
+ kind: "general",
+ warnings: ["floor"],
+ },
+ () => {
+ b.add(base, [0, 200, 0]);
+ b.then(0.1);
+ const pts: FitOpts[] = angles.map((a) => ({ on: base, at: [rt * Math.cos(a), tipY, -rt * Math.sin(a)] as Vec3, dir: [0, 1, 0] as Vec3, travel: 70, hole: false }));
+ b.fits(HW.castor, pts, 0.16);
+ },
+ );
+
+ b.step(
+ {
+ title: "Stand the base up and drop in the gas lift",
+ detail: "The narrow end goes into the hole in the middle. No tools needed.",
+ kind: "general",
+ },
+ () => {
+ b.fit({ ...HW.gasLift, len: Math.round(mechBot - hubTop) }, { on: base, at: [0, hubTop, 0], dir: [0, -1, 0], travel: 160, hole: false });
+ },
+ );
+
+ b.step(
+ {
+ title: "Bolt the mechanism under the seat",
+ detail: "Lay the seat upside down. The lever goes on its right-hand side.",
+ tools: ["allen"],
+ scene: "seat",
+ pose: "-y",
+ kind: "bolts",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stage(seat, b.partItem(seat).final.pos, [0, 0, 0], [0, 200, 0]);
+ b.then(0.05);
+ b.stage(mech, b.partItem(mech).final.pos, [0, 0, 0], [0, -220, 0]);
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ for (const x of [-85, 85]) for (const z of [-90, 90]) bolts.push({ on: mech, at: [x, mechBot, z], dir: [0, 1, 0] });
+ b.fits(HW.boltL, bolts, 0.1);
+ },
+ );
+
+ if (arms) {
+ b.step(
+ {
+ title: "Bolt on the armrests",
+ detail: "Still upside down. Two bolts each, into the seat.",
+ tools: ["allen"],
+ scene: "arms",
+ pose: "-y",
+ kind: "bolts",
+ },
+ () => {
+ b.stagger(0);
+ [seat, mech].forEach((k) => b.stage(k, b.partItem(k).final.pos, [0, 0, 0]));
+ b.then(0.1);
+ b.stagger(0.3);
+ armKeys.forEach((k, i) => b.stage(k, b.partItem(k).final.pos, b.partItem(k).final.rot, [(i === 0 ? -1 : 1) * 260, 0, 0]));
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ armKeys.forEach((k, i) => {
+ const sx = i === 0 ? -1 : 1;
+ for (const dz of [-22, 22]) bolts.push({ on: k, at: [sx * (sw / 2 - 85), seatBot - 12, zs + dz], dir: [0, 1, 0] });
+ });
+ b.fits(HW.boltS, bolts, 0.1);
+ },
+ );
+ }
+
+ b.step(
+ {
+ title: "Lay it on its back and bolt on the backrest",
+ detail: "The bar goes under the seat, behind the mechanism. Two bolts hold it.",
+ tools: ["allen"],
+ scene: "back",
+ pose: "+z",
+ kind: "bolts",
+ },
+ () => {
+ b.stagger(0);
+ [seat, mech, ...armKeys].forEach((k) => b.stage(k, b.partItem(k).final.pos, b.partItem(k).final.rot));
+ b.then(0.1);
+ // lying on its back, forward is up: the backrest comes down onto the floor behind the seat
+ b.stage(back, b.partItem(back).final.pos, [0, 0, 0], [0, 0, 320]);
+ b.then(0.1);
+ const zb = (zMechBack + zs - sd / 2) / 2;
+ b.fits(HW.boltS, [-18, 18].map((x) => ({ on: back, at: [x, seatBot - 18, zb] as Vec3, dir: [0, 1, 0] as Vec3 })), 0.12);
+ },
+ );
+
+ b.step(
+ {
+ title: "Lower the seat onto the gas lift",
+ detail: "Then sit down on it once, firmly. Your weight locks it in place.",
+ kind: "join",
+ },
+ () => {
+ b.stagger(0);
+ seatParts.forEach((k) => b.add(k, [0, 320, 0]));
+ },
+ );
+}
diff --git a/src/lib/plan/seat.ts b/src/lib/plan/seat.ts
index 40c045c..ef1aab1 100644
--- a/src/lib/plan/seat.ts
+++ b/src/lib/plan/seat.ts
@@ -1,6 +1,7 @@
import type { ProductSpec, SeatParams, Vec3 } from "../types";
import { HW, PlanBuilder, type FitOpts } from "./builder";
import { clamp, rotate } from "./math";
+import { buildOffice } from "./office";
export function defaultsSeat(s: ProductSpec): SeatParams {
const p = s.seat ?? {};
@@ -16,6 +17,7 @@ export function defaultsSeat(s: ProductSpec): SeatParams {
}
export function buildSeat(b: PlanBuilder, s: ProductSpec) {
+ if (s.seat?.kind === "office") return buildOffice(b, s);
const p = defaultsSeat(s);
if (p.kind === "chair") return chair(b, s, p);
return stool(b, s, p);
diff --git a/src/lib/products.ts b/src/lib/products.ts
index be952a6..9c2315a 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -33,7 +33,9 @@ export type Kind =
| "bar"
| "console"
| "kidstable"
- | "kidschair";
+ | "kidschair"
+ // added later: new shapes of an existing archetype
+ | "office";
export type X = {
rows?: number;
@@ -227,6 +229,7 @@ const MIN: Record<Kind, number> = {
cube: 40, bookcase: 50, open: 40, chest: 90, nightstand: 40, desk: 25, coffee: 20, side: 15, dining: 40,
bed: 100, wardrobe: 120, cabinet: 60, sideboard: 80, tv: 60, shoe: 45, chair: 25, stool: 12, bench: 20, sofa: 40, armchair: 30,
wallshelf: 25, wallcab: 40, kitchen: 50, trolley: 25, bar: 35, console: 30, kidstable: 15, kidschair: 20,
+ office: 20,
};
const CATEGORY: Record<Kind, string> = {
@@ -235,6 +238,7 @@ const CATEGORY: Record<Kind, string> = {
cabinet: "Cabinet", sideboard: "Sideboard", tv: "TV bench", shoe: "Shoe cabinet", chair: "Chair", stool: "Stool",
bench: "Bench", sofa: "Sofa", armchair: "Armchair", wallshelf: "Wall shelf", wallcab: "Wall cabinet", kitchen: "Kitchen cabinet",
trolley: "Trolley", bar: "Bar table", console: "Console table", kidstable: "Children's table", kidschair: "Children's chair",
+ office: "Office chair",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -242,6 +246,7 @@ export const KIND_ARCH: Record<Kind, Archetype> = {
side: "table", dining: "table", bed: "bed", wardrobe: "cabinet", cabinet: "cabinet", sideboard: "cabinet", tv: "cabinet",
shoe: "cabinet", chair: "seat", stool: "seat", bench: "seat", sofa: "sofa", armchair: "sofa", wallshelf: "shelf", wallcab: "cabinet",
kitchen: "cabinet", trolley: "table", bar: "table", console: "table", kidstable: "table", kidschair: "seat",
+ office: "seat",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -314,6 +319,9 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
return { ...base, difficulty: 1, people: 1, table: { attach: x.attach ?? "screw", legs: x.legs ?? "round", legSize: 40, topThickness: 22, shelf: false, ...round(x) } };
case "kidschair":
return { ...base, difficulty: 1, seat: { kind: "chair", seat: "square", seatH: x.seatH ?? 31, backH: h } };
+ case "office":
+ // x.arms: "slim" for armrests, "none" without
+ return { ...base, difficulty: 1, seat: { kind: "office", seat: "square", seatH: x.seatH ?? 48, backH: h, arms: (x.arms ?? "none") !== "none" } };
}
}
@@ -342,4 +350,5 @@ export const KIND_DEFAULT_SIZE: Record<Kind, [number, number, number]> = {
sideboard: [140, 85, 45], tv: [150, 50, 42], shoe: [60, 100, 28], chair: [44, 88, 50], stool: [35, 45, 35], bench: [100, 45, 38],
sofa: [210, 85, 92], armchair: [75, 90, 80], wallshelf: [60, 60, 22], wallcab: [60, 60, 35], kitchen: [60, 80, 60], trolley: [50, 80, 40],
bar: [120, 105, 60], console: [100, 79, 35], kidstable: [77, 48, 55], kidschair: [34, 60, 34],
+ office: [64, 105, 64],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 7a62ee4..21e6d56 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -15,6 +15,7 @@ export function slugify(s: string) {
}
const CATEGORY_WORDS: [Kind, string[]][] = [
+ ["office", ["office chair", "desk chair", "swivel chair", "gaming chair", "computer chair"]],
["shoe", ["shoe", "shoes", "shoe cabinet", "shoe rack"]],
["nightstand", ["nightstand", "bedside", "night stand"]],
["chest", ["drawer", "drawers", "chest", "dresser"]],
diff --git a/src/lib/types.ts b/src/lib/types.ts
index db8aa21..7142478 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -54,12 +54,13 @@ export interface CabinetParams {
}
export interface SeatParams {
- kind: "stool" | "chair" | "bench";
+ kind: "stool" | "chair" | "bench" | "office";
seat: "round" | "square";
seatH: number; // cm
backH: number; // cm (chair total height)
stretchers: boolean;
splay: boolean;
+ arms?: boolean; // office chairs: armrests
}
export interface SofaParams {
@@ -147,15 +148,25 @@ export interface ProductSpec {
export type PartMaterial = "board" | "fiber" | "wood" | "metal" | "soft";
+/** One box or cylinder of a part made of several (a star base, a cot side with bars), in the part's own frame. */
+export interface PartPiece {
+ shape: "box" | "cyl";
+ size: Vec3; // mm, box extents or cylinder [dia, length, dia]
+ pos: Vec3; // mm, from the centre of the part
+ rot?: Vec3;
+ material?: PartMaterial;
+}
+
export interface PartType {
id: string;
label: string; // letter
name: string;
- size: Vec3; // mm, box extents or cylinder [dia, length, dia]
+ size: Vec3; // mm, box extents or cylinder [dia, length, dia]; the bounding box when it has pieces
shape: "box" | "cyl";
material: PartMaterial;
qty: number;
extra?: boolean; // not in the box (e.g. mattress)
+ pieces?: PartPiece[]; // drawn as these boxes and cylinders instead of one
}
export type HwKind =
@@ -174,7 +185,9 @@ export type HwKind =
| "handle"
| "hinge"
| "glide"
- | "plug";
+ | "plug"
+ | "castor"
+ | "gasLift";
export interface HwType {
id: string;