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 sofa sections sold alone

Youssef2a3ebfa885bb
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index c12b400..b7df22f 100644
--- a/scripts/ikea/build.ts
+++ b/scripts/ikea/build.ts
@@ -59,7 +59,7 @@ function hints(family: string, kind: Kind): Hint | undefined {
/* ---------- matching against hand made entries ---------- */
-const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab", "bookrow", "cabrow"]);
+const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab", "bookrow", "cabrow", "section"]);
function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {
const fam = fold(name);
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index 78417ca..a857979 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -145,6 +145,8 @@ const RULES: Rule[] = [
return { kind: "chaise", x: { seats, chaise: both ? "both" : /\bleft\b/.test(t) ? "left" : "right" } };
}],
[/corner|chaise|u-shaped|crnr/, () => "corner or chaise longue sofa"],
+ // a straight sofa section sold alone: a seat frame with legs, a backrest and cushions, no armrests
+ [/^(\d)-seat section( for modular sofa)?$/, (m) => ({ kind: "section", x: { seats: Number(m[1]) } })],
[/section|add-on|armrest|backrest for|seat sec|modular (easy chair|chaise)/, () => "sofa or storage section"],
// bunk beds on four posts, and loft beds with room underneath (KURA turns over to be either)
[/^(bunk bed frame|loft bed frame|loft bed|reversible bed)$/, (m, c) => {
@@ -363,6 +365,14 @@ export function classify(f: Fact, hints: Hints): Verdict {
if (cw < 50) return { skip: "corner sofa too large" };
[w, d] = [armCm + n1 * cw + sd, sd + n2 * cw + front];
}
+ } else if (kind === "section") {
+ // IKEA gives no size: seat width, depth and height from a straight sofa of the same family, else a typical one
+ if (v.length) return { skip: "sofa section measured in a way we can't place" };
+ const sofa = hints(family, "sofa");
+ const armCm = sofa?.x.arms === "slim" ? 8 : sofa?.x.arms === "none" ? 0 : 17;
+ const per = sofa?.kind === "sofa" && sofa.x.seats ? Math.min(75, Math.max(55, (sofa.w - 2 * Math.min(armCm, sofa.w * 0.12)) / sofa.x.seats)) : 64;
+ w = (x.seats ?? 1) * per;
+ if (sofa?.kind === "sofa") [h, d] = [sofa.h, sofa.d <= 110 ? sofa.d : 92];
} 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]);
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 15e40e2..4b90bff 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -840,7 +840,9 @@
"SMYGA|Desk, 122 × 60 cm": "smyga-desk-122-x-60",
"SNIGLAR|Bed frame with slatted bed base, 70 × 160 cm": "sniglar-bed-frame-slatted-bed-base-70-x-160",
"SNIGLAR|Cot, 60 × 120 cm": "sniglar-cot-60-x-120",
+ "SÖDERHAMN|1-seat section": "soderhamn-1-seat-section",
"SÖDERHAMN|2-seat sofa": "soderhamn-2-seat-sofa",
+ "SÖDERHAMN|3-seat section": "soderhamn-3-seat-section",
"SÖDERHAMN|4-seat sofa with chaise longue": "soderhamn-4-seat-sofa-chaise-longue",
"SÖDERHAMN|4-seat sofa-bed": "soderhamn-4-seat-sofa-bed",
"SÖDERHAMN|Corner sofa-bed, 6-seat": "soderhamn-corner-sofa-bed-6-seat",
@@ -860,6 +862,7 @@
"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|1-seat section": "stockholm-2025-1-seat-section",
"STOCKHOLM 2025|2-seat sofa": "stockholm-2025-2-seat-sofa",
"STOCKHOLM 2025|3-seat sofa": "stockholm-2025-3-seat-sofa",
"STOCKHOLM 2025|4-seat sofa": "stockholm-2025-4-seat-sofa",
@@ -1071,8 +1074,11 @@
"VILHATTEN|Wardrobe with 2 doors and 2 drawers, 98 × 57 × 190 cm": "vilhatten-wardrobe-2-doors-and-2-drawers-98-x-57",
"VILTO|Shelving unit, 46 × 150 cm": "vilto-shelving-unit-46-x-150",
"VILTO|Step stool": "vilto-step-stool",
+ "VIMLE|1-seat section": "vimle-1-seat-section",
+ "VIMLE|2-seat section": "vimle-2-seat-section",
"VIMLE|2-seat sofa": "vimle-2-seat-sofa",
"VIMLE|2-seat sofa-bed": "vimle-2-seat-sofa-bed",
+ "VIMLE|3-seat section": "vimle-3-seat-section",
"VIMLE|3-seat sofa with chaise longue": "vimle-3-seat-sofa-chaise-longue",
"VIMLE|3-seat sofa-bed with chaise longue": "vimle-3-seat-sofa-bed-chaise-longue",
"VIMLE|4-seat sofa": "vimle-4-seat-sofa",
@@ -1091,7 +1097,9 @@
"VITTSJÖ|Coffee table, 75 cm": "vittsjo-coffee-table-75",
"VITTSJÖ|Shelving unit, 100 × 175 cm": "vittsjo-shelving-unit-100-x-175",
"VITTSJÖ|Shelving unit, 100 × 93 cm": "vittsjo-shelving-unit-100-x-93",
+ "VITTSKÄR|1-seat section for modular sofa": "vittskar-1-seat-section-for-modular-sofa",
"VITTSKÄR|2-seat modular sofa": "vittskar-2-seat-modular-sofa",
+ "VITTSKÄR|2-seat section for modular sofa": "vittskar-2-seat-section-for-modular-sofa",
"VITTSKÄR|2-seat sofa": "vittskar-2-seat-sofa",
"VITTSKÄR|3-seat modular corner sofa": "vittskar-3-seat-modular-corner-sofa",
"VITTSKÄR|3-seat modular sofa": "vittskar-3-seat-modular-sofa",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 2515a1b..e0e49a6 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -918,7 +918,9 @@ smyga-bed-frame-storage-90-x-200|59444142
smyga-desk-122-x-60|40480781
sniglar-bed-frame-slatted-bed-base-70-x-160|19185433
sniglar-cot-60-x-120|30248537
+soderhamn-1-seat-section|69305664 39449640 09621590 49621593 79621596 79452051 69621587
soderhamn-2-seat-sofa|29305755
+soderhamn-3-seat-section|29449645 29305618 09621608 09500531 69621605 39621602 19621599
soderhamn-3-seat-sofa|39621635 09621632 69621629 79621638 09305704 29449693 39305694 19449698 59452108 69622110 39622102 29622107 09622113 19618672 49580069 99580062 39621386 79621389 19621392
soderhamn-4-seat-sofa-bed|89616448 69621375 49621381 49616247 39621372 29618676 69618679 69621361 69616270 39621367 09621364 09616428
soderhamn-4-seat-sofa-chaise-longue|69449709 79621676 59621682 19621783 19621679
@@ -942,6 +944,7 @@ 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-1-seat-section|40586136 30586132 10586128
stockholm-2025-2-seat-sofa|60586121 60586116 50586112
stockholm-2025-3-seat-sofa|99574297 29574291 09574305 20586095
stockholm-2025-4-seat-sofa|59574322 59574317 09574310
@@ -1159,8 +1162,11 @@ vikhammer-bedside-table-40-x-39|20388972 00381764
vilhatten-wardrobe-2-doors-and-2-drawers-98-x-57|70530609
vilto-shelving-unit-46-x-150|90344456
vilto-step-stool|60344453
+vimle-1-seat-section|89631528 69631534 29631531 89392392 69392393 59502896 89501598 90466706
+vimle-2-seat-section|69631732 89631726 29631729 79392415 59502900 49392412 89392434 90465349
vimle-2-seat-sofa|09634663 99634692 89631383 19634667 59634689 79398974 09398977 79400547 79400566 59501646 49400544 99501395 89503093 19306294
vimle-2-seat-sofa-bed|39477336 59638654 39638669 09638656 99638671 89638657 29638660 19638665 79638629 39638631 19638613 69638615 29638617 69638620 69537027
+vimle-3-seat-section|79631699 09631693 69631713 39631696 89392453 09501601 69392454 40465356
vimle-3-seat-sofa|89634819 19634813 69634844 49634816 29634841 59399111 99399114 79635112 09635115 69635122 49635415 29635138 59399031 09399043 99635187 69635198 69635184 29635204 39635190 79635211 29635195 49399022 79399025 09503105 99515953 69306263 49306645 49306688 79503102 79401325 19515952 19401328 59306254 89306667 49477369 99545219 19545261 69569396 59547871 59639210 99639208 89639195 79639191 39639193 09639199 99545281
vimle-3-seat-sofa-bed-chaise-longue|19639245 09639241 89639256 89639242 49639239 39639254 29545246 19477356 69638941 99638949 79638945 69638955 29638943 19638953 09638939
vimle-3-seat-sofa-chaise-longue|79635046 79635032 69635061 49635038 29635058 09635035 79401293 69503112 79399105 39424121 09401296 19399108 49401299
@@ -1182,7 +1188,9 @@ vittsjo-coffee-table-75|80213309 30604348
vittsjo-shelving-unit-100-x-175|20213312
vittsjo-shelving-unit-100-x-93|90305803
vittsjo-shelving-unit-51-x-175|50214678
+vittskar-1-seat-section-for-modular-sofa|50575199
vittskar-2-seat-modular-sofa|09618880 29618884 69591123 79591066 89618876 99591065
+vittskar-2-seat-section-for-modular-sofa|80590419
vittskar-2-seat-sofa|39618888 49591077
vittskar-3-seat-modular-corner-sofa|39618831 89591160
vittskar-3-seat-modular-sofa|59591128 59618892 39591148 69618896
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index 063fbdf..f25d265 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -844,6 +844,8 @@ SNIGLAR|cot|Cot, 60 × 120 cm|130|82|68|m=60,l=120
SÖDERHAMN|chaise|4-seat sofa with chaise longue|259|69|167|seats=4,arms=slim,chaise=right,sd=99
SÖDERHAMN|corner|Corner sofa, 4-seat|228|69|168|seats=4,arms=slim,corner=left,sd=99
SÖDERHAMN|corner|Corner sofa-bed, 6-seat|289|69|228|seats=6,arms=slim,corner=left,sd=99
+SÖDERHAMN|section|1-seat section|61|69|99|seats=1
+SÖDERHAMN|section|3-seat section|182|69|99|seats=3
SÖDERHAMN|sofa|2-seat sofa|170|85|92|seats=2,arms=slim
SÖDERHAMN|sofa|4-seat sofa-bed|290|85|92|seats=4,arms=slim
SOLUPPGÅNG|stool|Stool, outdoor, 43 × 40 cm|43|40|43||outdoor garden
@@ -871,6 +873,7 @@ STOCKHOLM 2025|coffee|Coffee table, 160 × 45 cm|160|45|45
STOCKHOLM 2025|dining|Table, 115 cm|115|74|115|round=1
STOCKHOLM 2025|dining|Table, 230 × 90 cm|230|74|90
STOCKHOLM 2025|open|Shelving unit, 120 × 40 × 188 cm|120|188|40
+STOCKHOLM 2025|section|1-seat section|64|83|92|seats=1
STOCKHOLM 2025|side|Side table, 40 cm|40|50|40|round=1
STOCKHOLM 2025|side|Side table, 55 cm|55|50|55|round=1
STOCKHOLM 2025|sideboard|Sideboard, 161 × 42 × 83 cm|161|83|42
@@ -1081,6 +1084,9 @@ VIMLE|corner|Corner sofa, 5-seat|238|83|238|seats=5,arms=wide,corner=left,sd=98
VIMLE|corner|Corner sofa, 4-seat|253|83|184|seats=4,arms=wide,corner=left,sd=98
VIMLE|corner|Corner sofa, 5-seat w chaise longue|253|83|236|seats=5,arms=wide,corner=left,open=1,sd=98
VIMLE|corner|Crnr sofa-bed, 5-seat w chaise lng|253|83|236|seats=5,arms=wide,corner=left,open=1,sd=98
+VIMLE|section|1-seat section|69|83|98|seats=1
+VIMLE|section|2-seat section|138|83|98|seats=2
+VIMLE|section|3-seat section|207|83|98|seats=3
VIMLE|sofa|2-seat sofa|170|85|92|seats=2
VIMLE|sofa|2-seat sofa-bed|170|85|92|seats=2
VIMLE|sofa|4-seat sofa|290|85|92|seats=4
@@ -1098,6 +1104,8 @@ VITTSKÄR|corner|3-seat modular corner sofa|173|85|173|seats=3,arms=wide,corner=
VITTSKÄR|corner|4-seat modular corner sofa|237|85|173|seats=4,arms=wide,corner=left,sd=92|outdoor garden
VITTSKÄR|corner|5-seat modular corner sofa|237|85|237|seats=5,arms=wide,corner=left,sd=92|outdoor garden
VITTSKÄR|dining|Table, 264 × 96 cm|264|74|96||outdoor garden
+VITTSKÄR|section|1-seat section for modular sofa|64|83|92|seats=1|outdoor garden
+VITTSKÄR|section|2-seat section for modular sofa|128|83|92|seats=2|outdoor garden
VITTSKÄR|sofa|2-seat modular sofa|170|85|92|seats=2|outdoor garden
VITTSKÄR|sofa|2-seat sofa|170|85|92|seats=2|outdoor garden
VITTSKÄR|sofa|3-seat modular sofa|230|85|92|seats=3|outdoor garden
diff --git a/src/lib/products.ts b/src/lib/products.ts
index d8d3cd3..31b22ea 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -47,7 +47,8 @@ export type Kind =
| "sliding"
| "slidecab"
| "bookrow"
- | "cabrow";
+ | "cabrow"
+ | "section";
export type X = {
rows?: number;
@@ -255,7 +256,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, chaise: 55, corner: 70, cot: 35, bunk: 90, loft: 75, dropleaf: 40, daybed: 60, mixed: 50, sliding: 110, slidecab: 60, bookrow: 120, cabrow: 120,
+ office: 20, chaise: 55, corner: 70, cot: 35, bunk: 90, loft: 75, dropleaf: 40, daybed: 60, mixed: 50, sliding: 110, slidecab: 60, bookrow: 120, cabrow: 120, section: 25,
};
const CATEGORY: Record<Kind, string> = {
@@ -264,7 +265,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", chaise: "Sofa with chaise longue", corner: "Corner sofa", cot: "Cot", bunk: "Bunk bed", loft: "Loft bed", dropleaf: "Drop-leaf table", daybed: "Day-bed", mixed: "Cabinet with doors and drawers", sliding: "Wardrobe with sliding doors", slidecab: "Cabinet with sliding doors", bookrow: "Bookcase combination", cabrow: "Storage combination",
+ office: "Office chair", chaise: "Sofa with chaise longue", corner: "Corner sofa", cot: "Cot", bunk: "Bunk bed", loft: "Loft bed", dropleaf: "Drop-leaf table", daybed: "Day-bed", mixed: "Cabinet with doors and drawers", sliding: "Wardrobe with sliding doors", slidecab: "Cabinet with sliding doors", bookrow: "Bookcase combination", cabrow: "Storage combination", section: "Sofa section",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -272,7 +273,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", chaise: "sofa", corner: "sofa", cot: "bed", bunk: "bed", loft: "bed", dropleaf: "table", daybed: "bed", mixed: "cabinet", sliding: "cabinet", slidecab: "cabinet", bookrow: "shelf", cabrow: "cabinet",
+ office: "seat", chaise: "sofa", corner: "sofa", cot: "bed", bunk: "bed", loft: "bed", dropleaf: "table", daybed: "bed", mixed: "cabinet", sliding: "cabinet", slidecab: "cabinet", bookrow: "shelf", cabrow: "cabinet", section: "sofa",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -389,6 +390,11 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
const robe = kind === "sliding";
return { ...base, people: robe || h > 150 ? 2 : 1, difficulty: robe ? 3 : 2, cabinet: { fronts: "sliding", slides: x.slides ?? 2, doors: 0, shelves: x.shelves ?? (robe ? 1 : h > 150 ? 3 : h > 100 ? 2 : 1), rail: robe, plinth: x.plinth ?? h > 120, handles: "none", thickness: robe ? 18 : 16 } };
}
+ case "section": {
+ // a straight section of a modular sofa, sold alone: no armrests
+ const seats = x.seats ?? 1;
+ return { ...base, minutes: x.min ?? MIN.section + 10 * seats, people: seats > 1 ? 2 : 1, sofa: { seats, arms: "none", legs: "round" } };
+ }
case "bookrow":
case "cabrow": {
// x.n units of kind x.of side by side, each drawn as its own guide would draw it
@@ -430,5 +436,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], chaise: [226, 85, 160], corner: [233, 85, 171], cot: [130, 84, 68], bunk: [211, 160, 100], loft: [211, 195, 100], dropleaf: [134, 75, 80], daybed: [207, 83, 91], mixed: [80, 120, 40], sliding: [118, 200, 60], slidecab: [80, 110, 45], bookrow: [160, 202, 28], cabrow: [240, 48, 42],
+ office: [64, 105, 64], chaise: [226, 85, 160], corner: [233, 85, 171], cot: [130, 84, 68], bunk: [211, 160, 100], loft: [211, 195, 100], dropleaf: [134, 75, 80], daybed: [207, 83, 91], mixed: [80, 120, 40], sliding: [118, 200, 60], slidecab: [80, 110, 45], bookrow: [160, 202, 28], cabrow: [240, 48, 42], section: [192, 83, 92],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 94a25b3..d69cae2 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -47,6 +47,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["sideboard", ["sideboard", "buffet"]],
["cabinet", ["cabinet", "cupboard", "vitrine", "display"]],
["chaise", ["chaise longue", "chaise lounge", "chaise"]],
+ ["section", ["sofa section", "seat section", "sofa module", "couch section", "sectional piece"]],
["corner", ["corner sofa", "corner couch", "sectional", "l shaped sofa"]],
["sofa", ["sofa", "couch", "loveseat"]],
["armchair", ["armchair", "wing chair", "recliner"]],
@@ -56,6 +57,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["bench", ["bench"]],
];
const KIND_WORDS = new Map(CATEGORY_WORDS);
+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
@@ -153,8 +155,8 @@ export function searchCatalog(q: string, limit = 8): Hit[] {
if (!ns && ((first.length >= 3 && r.words.some((w) => w.startsWith(first))) || (firstIsKind && kwHit))) score += 20;
for (const t of tokens.slice(1)) if (t.length && r.words.some((w) => w.startsWith(t) || (t.length > 2 && w.includes(t)))) score += 12;
if (kw) score += kwHit ? 14 : -30;
- // several units side by side come after the single one, unless the query asks for a combination
- if ((e.kind === "bookrow" || e.kind === "cabrow") && kind !== e.kind) score -= 1;
+ // rows of several units and sofa sections come after the whole product, unless the query asks for them
+ if (e.kind && LESSER.has(e.kind) && kind !== e.kind) score -= 1;
if (e.checked) score += 3;
if (e.featured) score += 2;
if (score > 15) hits.push({ entry: e, score, exact: ns >= 80 });