IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.
TypeScript
Draw rows of PAX frames and open outdoor kitchen units
Yousseffb869699f015
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.tsindex 435349b..760450d 100644--- a/scripts/ikea/classify.ts+++ b/scripts/ikea/classify.ts@@ -111,6 +111,21 @@ function framesFor(w: number, sizes: number[], post = 0, most = 4): number[] | nreturn best;}+/** Exactly `count` frames of these widths that make up w, give or take 2 cm, the widest first. */+function framesExact(w: number, sizes: number[], count: number): number[] | null {+ let found: number[] | null = null;+ const walk = (left: number[], from: number) => {+ if (found) return;+ if (left.length === count) {+ if (Math.abs(left.reduce((a, v) => a + v, 0) - w) <= 2) found = [...left];+ return;+ }+ for (let i = from; i < sizes.length; i++) walk([...left, sizes[i]], i);+ };+ walk([], 0);+ return found;+}+/** Frames for one leg of a corner wardrobe: the frames that come closest to `len` cm, and how far off they are. */function legFrames(len: number, sizes: number[], least: number): [number[], number] {let best: [number[], number] = [[], Infinity];@@ -228,6 +243,8 @@ const RULES: Rule[] = [[/^hi cab f micro w door\/(\d) drawers$/, (m) => ({ kind: "appliance", x: { use: "microwave", z: `r${m[1]}@80+g@40+d1` } })],[/^hi cab w shlvs\/\d drawers\/dr\/(\d) frnts$/, (m) => ({ kind: "kitchen", x: { z: `r${m[1]}@80+d1s3` } })],[/^base cabinet$/, () => ({ kind: "kitchen", x: { doors: 0 } })],+ // open units of an outdoor kitchen: a frame with a shelf and no doors+ [/^(open kitchen unit|kitchen island shelf unit)$/, () => ({ kind: "kitchen", x: { doors: 0, shelves: 1, cat: "Outdoor kitchen unit" } })],[/^base cb w shelf$/, () => ({ kind: "kitchen", x: { doors: 0, shelves: 1 } })],[/^high fr w shelves$/, () => ({ kind: "kitchen", x: { doors: 0 } })],// cabinets with room for an oven, a fridge or a microwave, and base cabinets under a hob: the appliance is fitted afterwards@@ -467,6 +484,8 @@ const RULES: Rule[] = [// a bedside table with a glass top is put together like any other[/^bedside table with glass top$/, () => ({ kind: "nightstand", x: { rows: 1 } })],[/^(wardrobe frame|open wardrobe|open clothes hanging unit)$/, () => ({ kind: "wardrobe", x: { doors: 0 } })],+ // two or three wardrobe frames sold together: a row of frames without doors+ [/^(\d) wardrobe frames$/, (m) => ({ kind: "wardrobe", x: { doors: 0, n: Number(m[1]), cat: "Wardrobe combination" } })],// PLATSA wardrobes are a row of identical frames: one or two doors on each, as many frames as that takes[/^wardrobe w(?:ith)? (\d+) doors$/, (m, c) => {const doors = Number(m[1]), w = c.sz.n[0] ?? 0;@@ -634,6 +653,8 @@ export function classify(f: Fact, hints: Hints): Verdict {if (v.length === 3) set(v[0], v[2], v[1]);else if (v.length === 2) {if ((kind === "kitchen" || kind === "mixed" || kind === "sinkcab" || kind === "appliance") && /^base/.test(t)) set(v[0], 80, v[1]);+ // an outdoor kitchen unit is measured from above, and stands at worktop height+ else if (kind === "kitchen" && /kitchen unit$|shelf unit$/.test(t)) set(v[0], 90, v[1]);// bedside tables are measured from above, like tableselse if (kind === "nightstand" && /bedside|nightstand/.test(t)) set(v[0], hint?.kind === kind ? hint.h : 55, v[1]);else set(v[0], v[1]);@@ -902,6 +923,15 @@ export function classify(f: Fact, hints: Hints): Verdict {for (const k of Object.keys(x) as (keyof X)[]) if (x[k] === undefined) delete x[k];return finish("cabrow");}+ // a count of frames that can't all be alike (three PAX frames in 200 cm): the family's widths that add up to it+ const sizesOf = FRAME_SIZES[family];+ if (x.n && sizesOf && kind === "wardrobe" && !sizesOf.includes(w / x.n)) {+ const exact = framesExact(w, sizesOf, x.n);+ if (!exact) return { skip: several };+ delete x.n;+ Object.assign(x, { u: exact.join("+"), of: kind });+ return finish("cabrow");+ }// the rule may already know how many frames there are (PLATSA)const unit = x.n ? w / x.n : ROW_UNITS[family];const n = unit ? Math.round(w / unit) : 0;diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.jsonindex d0553a0..47f4786 100644--- a/scripts/ikea/slugs.json+++ b/scripts/ikea/slugs.json@@ -335,6 +335,8 @@"GREJSIMOJS|Children's table, 84 × 42 cm": "grejsimojs-children-s-table-84-x-42","GREJSIMOJS|Clothes stand, 125 cm": "grejsimojs-clothes-stand-125","GREJSIMOJS|Pouffe with storage": "grejsimojs-pouffe-storage",+ "GRILLSKÄR|Kitchen island shelf unit, 86 × 61 cm": "grillskar-kitchen-island-shelf-unit-86-x-61",+ "GRILLSKÄR|Open kitchen unit, 61 × 61 cm": "grillskar-open-kitchen-unit-61-x-61","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",@@ -947,6 +949,7 @@"NÄMMARÖ|Chair, outdoor": "nammaro-chair-outdoor","NÄMMARÖ|Lounge chair, outdoor": "nammaro-lounge-chair-outdoor","NÄMMARÖ|Modular easy chair, 63 cm": "nammaro-modular-easy-chair-63",+ "NÄMMARÖ|Open kitchen unit, 80 × 62 cm": "nammaro-open-kitchen-unit-80-x-62","NÄMMARÖ|Reclining chair, outdoor": "nammaro-reclining-chair-outdoor","NÄMMARÖ|Stool, outdoor, 37 × 45 cm": "nammaro-stool-outdoor-37-x-45","NÄMMARÖ|Sun lounger": "nammaro-sun-lounger",@@ -1096,6 +1099,8 @@"PAX / TONSTAD|Corner wardrobe, 211/161 × 201 cm": "pax-tonstad-corner-wardrobe-211-161-x-201","PAX / TONSTAD|Corner wardrobe, 231/161 × 236 cm": "pax-tonstad-corner-wardrobe-231-161-x-236","PAX / TYSSEDAL|Corner wardrobe, 161/111 × 236 cm": "pax-tyssedal-corner-wardrobe-161-111-x-236",+ "PAX|2 wardrobe frames, 200 × 58 × 201 cm": "pax-2-wardrobe-frames-200-x-58-x-201",+ "PAX|3 wardrobe frames, 200 × 58 × 201 cm": "pax-3-wardrobe-frames-200-x-58-x-201","PAX|Add-on corner unit with 4 shelves, 53 × 35 × 236 cm": "pax-add-on-corner-unit-4-shelves-53-x-35-x-236","PAX|Add-on corner unit with 4 shelves, 53 × 58 × 201 cm": "pax-add-on-corner-unit-4-shelves-53-x-58-x-201","PAX|Corner wardrobe, 161/188 × 201 cm": "pax-corner-wardrobe-161-188-x-201",diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.tsindex 9c054a5..89266f5 100644--- a/src/data/ikea-items.ts+++ b/src/data/ikea-items.ts@@ -360,6 +360,8 @@ grejsimojs-children-s-stool|60598973 50598959grejsimojs-children-s-table-84-x-42|70598963grejsimojs-clothes-stand-125|10602996grejsimojs-pouffe-storage|60603644+grillskar-kitchen-island-shelf-unit-86-x-61|50471446 29390107+grillskar-open-kitchen-unit-61-x-61|40598790grillskar-side-table-outdoor-30-x-61|00523179gronfjall-office-chair-arm-headrest|89513921gronfjall-office-chair-armrests|20503477@@ -1017,6 +1019,7 @@ nammaro-chair-armrests-outdoor|90511105 59610264 69610268nammaro-chair-outdoor|50503353nammaro-lounge-chair-outdoor|40510306nammaro-modular-easy-chair-63|79584363 39529156 49621507 19611166 99575414 79607473+nammaro-open-kitchen-unit-80-x-62|80608810nammaro-reclining-chair-outdoor|50510301nammaro-stool-outdoor-37-x-45|70510300nammaro-sun-lounger|30503354 49534888 69576028@@ -1117,6 +1120,8 @@ ostavall-adjustable-coffee-table-90|40534152 00530066ovning-trolley-54-x-33|00517003pahl-desk-96-x-58|49619340paronholmen-bench-backrest-outdoor|90503799+pax-2-wardrobe-frames-200-x-58-x-201|59494759 39494760 59494820 09494752 79494819 29494812 99494818 89494767 79494763 69494768 59494764 29494765 19494761 09494766+pax-3-wardrobe-frames-200-x-58-x-201|99494795 89494772 79494796 59494815 19494822 19494756 89494814pax-add-on-corner-unit-4-shelves-53-x-35-x-236|00346964 20346958 80346960 60346956pax-add-on-corner-unit-4-shelves-53-x-58-x-201|70346932 50515110 10515112 30346934 60515119 20515121 80346941pax-auli-wardrobe-sliding-doors-150-x-43-x-201|29561335 89561342 59561329 79561333 59561334 09561336diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.tsindex e033c92..ce8e9d5 100644--- a/src/data/ikea-rows.ts+++ b/src/data/ikea-rows.ts@@ -336,6 +336,8 @@ GREJSIMOJS|coatstand|Clothes stand, 125 cm|45|125|45GREJSIMOJS|kidstable|Children's table, 84 × 42 cm|84|48|42||kidsGREJSIMOJS|lidbox|Pouffe with storage|38|38|38|cat=Pouffe with storageGREJSIMOJS|stool|Children's stool|35|30|35||kids+GRILLSKÄR|kitchen|Open kitchen unit, 61 × 61 cm|61|90|61|doors=0,shelves=1,cat=Outdoor kitchen unit|outdoor garden+GRILLSKÄR|kitchen|Kitchen island shelf unit, 86 × 61 cm|86|90|61|doors=0,shelves=1,cat=Outdoor kitchen unit|outdoor gardenGRILLSKÄR|side|Side table, outdoor, 30 × 61 cm|30|50|61||outdoor gardenGRÖNFJÄLL|office|Office chair with armrests|64|105|64|arms=slimGRÖNFJÄLL|office|Office chair with arm/headrest|64|128|64|arms=slim@@ -945,6 +947,7 @@ NÄMMARÖ|chair|Chair, outdoor|44|88|50||outdoor gardenNÄMMARÖ|dining|Table, outdoor, 75 × 63 cm|75|74|63||outdoor gardenNÄMMARÖ|dining|Table, outdoor, 130 cm|130|74|130|round=1|outdoor gardenNÄMMARÖ|dining|Table, outdoor, 140 × 75 cm|140|74|75||outdoor garden+NÄMMARÖ|kitchen|Open kitchen unit, 80 × 62 cm|80|90|62|doors=0,shelves=1,cat=Outdoor kitchen unit|outdoor gardenNÄMMARÖ|lounge|Reclining chair, outdoor|66|102|84||outdoor gardenNÄMMARÖ|lounge|Lounge chair, outdoor|72|88|80||outdoor gardenNÄMMARÖ|lounger|Sun lounger|66|87|195||outdoor garden@@ -1049,6 +1052,8 @@ PAX|cabinet|Add-on corner unit with 4 shelves, 53 × 58 × 201 cm|53|201|58|doorPAX|cabinet|Add-on corner unit with 4 shelves, 53 × 35 × 236 cm|53|236|35|doors=0,shelves=4PAX|cabrow|Wardrobe, 150 × 58 × 201 cm|150|201|58|doors=0,shelves=2,of=wardrobe,u=100+50PAX|cabrow|Wardrobe, 175 × 58 × 201 cm|175|201|58|doors=0,shelves=2,of=wardrobe,u=100+75+PAX|cabrow|2 wardrobe frames, 200 × 58 × 201 cm|200|201|58|doors=0,shelves=2,n=2,of=wardrobe,cat=Wardrobe combination+PAX|cabrow|3 wardrobe frames, 200 × 58 × 201 cm|200|201|58|doors=0,shelves=2,of=wardrobe,u=100+50+50,cat=Wardrobe combinationPAX|cornerrobe|Corner wardrobe, 161/188 × 201 cm|161|201|188|doors=0,shelves=2,u=75+50,v=100PAX|cornerrobe|Corner wardrobe, 210/180 × 236 cm|180|236|210|doors=0,shelves=2,u=75+50,v=100,cu=58PAX|cornerrobe|Corner wardrobe, 211/161 × 201 cm|211|201|161|doors=0,shelves=2,u=100+75,v=75