IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.
TypeScript
Draw U-shaped sofas
Youssef2ea232ec837a
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.tsindex bdd8fba..56c0b0d 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", "section", "gateleg", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe"]);+const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab", "bookrow", "cabrow", "section", "gateleg", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa"]);function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {const fam = fold(name);diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.tsindex 8f92848..a607147 100644--- a/scripts/ikea/check.ts+++ b/scripts/ikea/check.ts@@ -48,7 +48,7 @@ async function main() {for (const e of PRODUCTS) {const label = `${e.slug} (${e.name} ${e.variant})`;const { w, h, d } = e.size;- if (!(w >= 15 && w <= 320 && h >= 15 && h <= 260 && d >= 12 && d <= 240)) fail(`${label}: size ${w}x${h}x${d} cm is out of range`);+ if (!(w >= 15 && w <= (e.archetype === "sofa" ? 400 : 320) && h >= 15 && h <= 260 && d >= 12 && d <= 240)) fail(`${label}: size ${w}x${h}x${d} cm is out of range`);try {const plan = buildPlan(toSpec(e));if (!plan.steps.length) fail(`${label}: no steps`);diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.tsindex 9378adf..7a1d921 100644--- a/scripts/ikea/classify.ts+++ b/scripts/ikea/classify.ts@@ -270,6 +270,8 @@ const RULES: Rule[] = [}],// a chaise longue sold alone as a section of a modular sofa: a one-seat section as long as a chaise[/^(chaise longue section|chaise longue module(?:, (?:left|right))?|chaise longue, add-on unit|modular chaise longue)$/, () => ({ kind: "section", x: { seats: 1, chaise: "right" } })],+ // U-shaped sofas: a corner sofa with a chaise longue at the other end of the back+ [/^u-shaped sofa, (\d)(?:[.,](5))?[- ]seat$/, (m) => ({ kind: "usofa", x: { seats: Number(m[1]) + (m[2] ? 1 : 0) } })],// a corner section sold alone as a piece of a modular sofa: a square seat with a backrest along two sides[/^(corner section|corner section with cushion|corner module)$/, () => ({ kind: "section", x: { seats: 1, corner: "left" } })],// corner wardrobes: frames along both walls around an add-on corner unit, with doors when a door's name comes with them@@ -568,7 +570,7 @@ export function classify(f: Fact, hints: Hints): Verdict {[x.m, x.l] = [v[0], v[1]];set(v[1] + 10, undefined, v[0] + 8);h = v[1] >= 140 ? 86 : 82;- } else if (kind === "chaise" || kind === "corner") {+ } else if (kind === "chaise" || kind === "corner" || kind === "usofa") {// IKEA gives no size: seat width, depth and height from a straight sofa of the same family, else a typical oneconst sofa = hints(family, "sofa");const arms = sofa?.x.arms ?? "wide";@@ -582,6 +584,14 @@ export function classify(f: Fact, hints: Hints): Verdict {if (v.length) return { skip: "corner sofa measured in a way we can't place" };if (kind === "chaise") {[w, d] = [n * per + 2 * armCm, Math.min(175, Math.max(140, sd + 68))];+ } else if (kind === "usofa") {+ // the chaise longue and the corner seat count among the seats; the back gets the extra seat, and seats shrink+ // a little if the U would be too big to draw+ const n1 = Math.ceil((n - 2) / 2), n2 = n - 2 - n1;+ const front = n2 ? armCm : 0;+ const cw = Math.min(per, (398 - armCm - sd) / (n1 + 1), n2 ? (238 - sd - front) / n2 : Infinity);+ if (cw < 50) return { skip: "U-shaped sofa too large" };+ [w, d] = [armCm + (n1 + 1) * cw + sd, Math.max(Math.min(175, Math.max(140, sd + 68)), sd + n2 * cw + front)];} else {// the long side gets the extra seat; seats shrink a little if the L would be too big to drawconst n1 = Math.ceil((n - 1) / 2), n2 = n - 1 - n1;@@ -712,7 +722,8 @@ export function classify(f: Fact, hints: Hints): Verdict {function finish(k: Kind): Verdict {const arch = KIND_ARCH[k];- if (w < 20 || w > 320 || h < 15 || h > 260 || d < 12 || d > 240) return { skip: "size out of range" };+ // a long sofa is drawn as sections joined together, so it can be longer than anything else+ if (w < 20 || w > (arch === "sofa" ? 400 : 320) || h < 15 || h > 260 || d < 12 || d > 240) return { skip: "size out of range" };if (arch === "table" && h < 30 && k !== "kidstable") return { skip: "size out of range" };if (arch === "shelf" && h < 25) return { skip: "size out of range" };const kw: string[] = [];diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.jsonindex d3bb75a..ae7970e 100644--- a/scripts/ikea/slugs.json+++ b/scripts/ikea/slugs.json@@ -457,10 +457,12 @@"JÄTTEBO|3-seat modular sofa": "jattebo-3-seat-modular-sofa","JÄTTEBO|3,5-seat mod sofa w chaise longues": "jattebo-3-5-seat-mod-sofa-w-chaise-longues","JÄTTEBO|4-seat mod sofa w chaise longue": "jattebo-4-seat-mod-sofa-w-chaise-longue",+ "JÄTTEBO|4,5-seat mod sofa w chaise longue": "jattebo-4-5-seat-mod-sofa-w-chaise-longue","JÄTTEBO|Chaise longue module, left": "jattebo-chaise-longue-module-left","JÄTTEBO|Chaise longue module, right": "jattebo-chaise-longue-module-right","JÄTTEBO|Mod crnr sofa 2,5-seat w chaise lng": "jattebo-mod-crnr-sofa-2-5-seat-w-chaise-lng","JÄTTEBO|Modular corner sofa, 6 seat": "jattebo-modular-corner-sofa-6-seat",+ "JÄTTEBO|U-shaped sofa, 7-seat": "jattebo-u-shaped-sofa-7-seat","JÄTTESTA|Coffee table, 80 × 80 cm": "jattesta-coffee-table-80-x-80","JÄTTESTA|Side table, 95 × 30 cm": "jattesta-side-table-95-x-30","JÄTTESTA|TV bench, 160 × 40 × 49 cm": "jattesta-tv-bench-160-x-40-x-49",@@ -518,6 +520,8 @@"KIVIK|Corner sofa, 5-seat w chaise longue": "kivik-corner-sofa-5-seat-w-chaise-longue","KIVIK|Corner sofa, 6-seat": "kivik-corner-sofa-6-seat","KIVIK|Corner sofa, 6-seat w chaise longue": "kivik-corner-sofa-6-seat-w-chaise-longue",+ "KIVIK|U-shaped sofa, 6 seat": "kivik-u-shaped-sofa-6-seat",+ "KIVIK|U-shaped sofa, 7-seat": "kivik-u-shaped-sofa-7-seat","KLACKENÄS|Sideboard, 120 × 97 cm": "klackenas-sideboard-120-x-97","KLEPPSTAD|Bed frame, Standard Double, 135 × 190 cm": "kleppstad-bed-frame-standard-double-135-x-190","KLEPPSTAD|Wardrobe with 3 doors, 117 × 55 × 176 cm": "kleppstad-wardrobe-3-doors-117-x-55-x-176",@@ -1337,6 +1341,7 @@"UPPÅKRA|Corner module": "uppakra-corner-module","UPPÅKRA|Modular corner sofa, 3-seat": "uppakra-modular-corner-sofa-3-seat","UPPÅKRA|Modular corner sofa, 6 seat": "uppakra-modular-corner-sofa-6-seat",+ "UPPÅKRA|U-shaped sofa, 4,5-seat": "uppakra-u-shaped-sofa-4-5-seat","URBAN|Junior chair": "urban-junior-chair","UTESPELARE|Gaming desk, 160 × 80 cm": "utespelare-gaming-desk-160-x-80","UTKLASSNING|Gaming chair": "utklassning-gaming-chair",@@ -1422,6 +1427,7 @@"VIMLE|Corner sofa, 5-seat": "vimle-corner-sofa-5-seat","VIMLE|Corner sofa, 5-seat w chaise longue": "vimle-corner-sofa-5-seat-w-chaise-longue","VIMLE|Crnr sofa-bed, 5-seat w chaise lng": "vimle-crnr-sofa-bed-5-seat-w-chaise-lng",+ "VIMLE|U-shaped sofa, 6 seat": "vimle-u-shaped-sofa-6-seat","VINGSÖN|Wing chair, in/outdoor": "vingson-wing-chair-in-outdoor","VISINGSÖ|Chair with armrests": "visingso-chair-armrests","VISINGSÖ|Table, 70 × 70 cm": "visingso-table-70-x-70",diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.tsindex 4a2b080..7de0af6 100644--- a/src/data/ikea-items.ts+++ b/src/data/ikea-items.ts@@ -500,11 +500,13 @@ jattebo-2-5-seat-mod-sofa-w-chaise-longue|89469490 79617599 79618532 19471340 09jattebo-2-seat-modular-sofa|09471411 09617705 29471410 29617634 99617428 09618620 89510404 69617707 59617623 59510410 49621183 49618623jattebo-3-5-seat-mod-sofa-w-chaise-longues|89485112 89617754 69618537 59617637 49617398 79471380 59485118 59469496 49617614 29617752 19617559 09618644jattebo-3-seat-modular-sofa|09485130 79485136 29617629 99617697 79618626 69617571+jattebo-4-5-seat-mod-sofa-w-chaise-longue|59469482 99617843 89617693 19471397 09618540 79617410jattebo-4-seat-mod-sofa-w-chaise-longue|79485202 69617608 59618632 49485208 39617761 19617432 99617744 69617651 59510896 39617407 19618629 19510624jattebo-chaise-longue-module-left|69485269 89617645 99485277 29617568 99617701 89618659 09485286 49618656 99617763 99471497 79617617 59617562 59471507jattebo-chaise-longue-module-right|09494573 99617602 99494578 49617746 19618653 19617413 39485303 39617596 59485302 29618662 89485310 39617756 29617422jattebo-mod-crnr-sofa-2-5-seat-w-chaise-lng|99485178 99617758 69618617 29617605 29485172 59617425jattebo-modular-corner-sofa-6-seat|69485250 39485256 19617620 79617556 59618665 39617695+jattebo-u-shaped-sofa-7-seat|99510615 99617640 09510610 89618635 59617703 09617574jattesta-coffee-table-80-x-80|30538792jattesta-side-table-95-x-30|60538795jattesta-tv-bench-160-x-40-x-49|70508934 50538852@@ -568,6 +570,8 @@ kivik-corner-sofa-5-seat|99440477 69443019 49482865 89500419 29500422 09500418 8kivik-corner-sofa-5-seat-w-chaise-longue|69482874 19440481 89443023 39500426 19500427kivik-corner-sofa-6-seat|29443182kivik-corner-sofa-6-seat-w-chaise-longue|99482882 99443027 79500434 49500435 29440485+kivik-u-shaped-sofa-6-seat|19494394 79527805 79443066 49527656 49440578 39527652 69443199+kivik-u-shaped-sofa-7-seat|99443070 99527705 89527701 39527807 39440574 29494402 89443202klackenas-sideboard-120-x-97|90506750kleppstad-bed-frame-standard-double-135-x-190|40492675 20492681kleppstad-wardrobe-2-doors-79-x-176|80437234@@ -1425,6 +1429,7 @@ uppakra-chaise-longue-module|39620457 89620474 89620469 79620460 69620489 696204uppakra-corner-module|49620796 89620756 79620790 79620771 69620781 69620762 39620787uppakra-modular-corner-sofa-3-seat|99620553 89620558 79620573 69620564 49620579 29621358 29620556uppakra-modular-corner-sofa-6-seat|99620628 79620634 49620616 49620602 39620607 29620622 19620613 99620690 89620704 89620695 59620710 59620687 29620716 29620684 99620647 79620667 69620658 69620644 49620678 49620664 39620650+uppakra-u-shaped-sofa-4-5-seat|19620910 99620925 99620893 99620869 89620902 59620913 09620939 99621005 79621247 69621021 69621002 49620999 39621027 39621008urban-junior-chair|00165213utespelare-gaming-desk-160-x-80|10571532 80507627utklassning-gaming-chair|40629287 60629045@@ -1511,6 +1516,7 @@ vimle-corner-sofa-4-seat|09635342 69635339 09635337 89635362 19635365 29399481 8vimle-corner-sofa-5-seat|79399577 49399668 89399586 59399583 59401802 69401811 29306750 89306766vimle-corner-sofa-5-seat-w-chaise-longue|79501278 69401830 09401833vimle-crnr-sofa-bed-5-seat-w-chaise-lng|89545248 59545202 59501298 19477380 09545228 49545269+vimle-u-shaped-sofa-6-seat|69306786vingson-wing-chair-in-outdoor|70503738visingso-chair-armrests|60575542visingso-table-70-x-70|40569467diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.tsindex 842c4ba..0d7cba7 100644--- a/src/data/ikea-rows.ts+++ b/src/data/ikea-rows.ts@@ -456,12 +456,14 @@ JÄRVFJÄLLET|office|Office chair with armrests|64|105|64|arms=slimJÄTTEBO|chaise|2,5-seat mod sofa w chaise longue|226|85|160|seats=3,arms=wide,chaise=right,sd=92JÄTTEBO|chaise|3,5-seat mod sofa w chaise longues|290|85|160|seats=4,arms=wide,chaise=both,sd=92JÄTTEBO|chaise|4-seat mod sofa w chaise longue|290|85|160|seats=4,arms=wide,chaise=right,sd=92+JÄTTEBO|chaise|4,5-seat mod sofa w chaise longue|354|85|160|seats=5,arms=wide,chaise=right,sd=92JÄTTEBO|corner|Mod crnr sofa 2,5-seat w chaise lng|173|85|156|seats=3,arms=wide,corner=left,open=1,sd=92JÄTTEBO|corner|Modular corner sofa, 6 seat|301|85|237|seats=6,arms=wide,corner=left,sd=92JÄTTEBO|section|Chaise longue module, left|64|83|160|seats=1JÄTTEBO|section|Chaise longue module, right|64|83|160|seats=1JÄTTEBO|sofa|2-seat modular sofa|170|85|92|seats=2JÄTTEBO|sofa|3-seat modular sofa|230|85|92|seats=3+JÄTTEBO|usofa|U-shaped sofa, 7-seat|365|83|237|seats=7,arms=wide,sd=92JÄTTESTA|coffee|Coffee table, 80 × 80 cm|80|45|80JÄTTESTA|side|Side table, 95 × 30 cm|95|50|30JÄTTESTA|tv|TV bench, 160 × 40 × 49 cm|160|49|40@@ -519,6 +521,8 @@ KIVIK|section|Corner section|95|83|95|seats=1,corner=leftKIVIK|sofa|1-seat sofa-bed|110|85|92|seats=1KIVIK|sofa|2-seat sofa|170|85|92|seats=2KIVIK|sofa|4-seat sofa|290|85|92|seats=4+KIVIK|usofa|U-shaped sofa, 6 seat|301|83|238|seats=6,arms=wide,sd=95+KIVIK|usofa|U-shaped sofa, 7-seat|364|83|238|seats=7,arms=wide,sd=95KLACKENÄS|sideboard|Sideboard, 120 × 97 cm|120|97|45KLEPPSTAD|bed|Bed frame, Standard Double, 135 × 190 cm|151|96|199|m=135,l=190KLEPPSTAD|sliding|Wardrobe with sliding doors, 117 × 55 × 176 cm|117|176|55|slides=2@@ -1338,6 +1342,7 @@ UPPÅKRA|corner|Modular corner sofa, 6 seat|301|85|237|seats=6,arms=wide,corner=UPPÅKRA|section|Chaise longue module|64|83|160|seats=1UPPÅKRA|section|Corner module|92|83|92|seats=1,corner=leftUPPÅKRA|sofa|3-seat modular sofa|230|85|92|seats=3+UPPÅKRA|usofa|U-shaped sofa, 4,5-seat|301|83|173|seats=5,arms=wide,sd=92URBAN|junior|Junior chair|43|91|52||kids childrenUTESPELARE|desk|Gaming desk, 160 × 80 cm|160|74|80UTKLASSNING|office|Gaming chair|64|128|64|arms=slim,seatH=50@@ -1423,6 +1428,7 @@ VIMLE|section|3-seat section|207|83|98|seats=3VIMLE|sofa|2-seat sofa|170|85|92|seats=2VIMLE|sofa|2-seat sofa-bed|170|85|92|seats=2VIMLE|sofa|4-seat sofa|290|85|92|seats=4+VIMLE|usofa|U-shaped sofa, 6 seat|300|83|238|seats=6,arms=wide,sd=98VINGSÖN|armchair|Wing chair, in/outdoor|75|104|80||outdoor gardenVISINGSÖ|chair|Chair with armrests|44|88|50|arms=slim|outdoor gardenVISINGSÖ|dining|Table, 70 × 70 cm|70|74|70||outdoor gardendiff --git a/src/lib/plan/corner.ts b/src/lib/plan/corner.tsindex 81adc3a..2970257 100644--- a/src/lib/plan/corner.ts+++ b/src/lib/plan/corner.ts@@ -36,9 +36,11 @@ export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {const armH = Math.min(H - 60, 640);const hb = H - baseTop;const bh = Math.max(240, H - baseTop - seatT - 40);- const N = clamp(Math.round(p.seats ?? 3), 2, 6);- const back = -D / 2;const corner = p.corner !== undefined;+ // a U: a corner sofa with a chaise longue at the far end of the back+ const u = corner && !!p.chaise;+ const N = clamp(Math.round(p.seats ?? 3), 2, u ? 8 : 6);+ const back = -D / 2;// a corner on the left is the right one mirroredconst sx = p.corner === "left" ? -1 : 1;const X = (x: number) => sx * x;@@ -62,12 +64,22 @@ export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {x += nm * cw;if (side !== "left") chaise(1);} else {- const n1 = Math.ceil((N - 1) / 2);- const nRet = N - 1 - n1;+ // the corner seat, and a U's chaise longue, count among the seats+ const k = u ? 2 : 1;+ const n1 = Math.ceil((N - k) / 2);+ const nRet = N - k - n1;// a corner with no seats in front of it is open there: no armrest across the seatfrontArm = !p.open && nRet > 0 && a > 0;const aFront = frontArm ? a : 0;- secs.push({ name: sectionName(n1), x0: -W / 2 + a, x1: W / 2 - sd, z0: back, z1: back + sd, seats: n1, along: "x", slide: [-300, 0, 0], legs: [] });+ let x1 = -W / 2 + a;+ if (u) {+ // as wide as one of the back's seats, and as long as the sofa says+ const cwU = (W - a - sd) / (n1 + 1);+ const reach = clamp((p.reach ?? 160) * 10, sd + 300, D);+ secs.push({ name: "Chaise longue", x0: x1, x1: x1 + cwU, z0: back, z1: back + reach, seats: 1, along: "x", slide: [-600, 0, 0], legs: [] });+ x1 += cwU;+ }+ secs.push({ name: sectionName(n1), x0: x1, x1: W / 2 - sd, z0: back, z1: back + sd, seats: n1, along: "x", slide: [-300, 0, 0], legs: [] });secs.push({ name: "Corner section", x0: W / 2 - sd, x1: W / 2, z0: back, z1: back + sd, seats: 1, along: "x", legs: [] });if (nRet > 0) secs.push({ name: sectionName(nRet), x0: W / 2 - sd, x1: W / 2, z0: back + sd, z1: D / 2 - aFront, seats: nRet, along: "z", slide: [0, 0, 300], legs: [] });}@@ -221,7 +233,7 @@ export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {const sliders = secs.filter((x) => x.slide);b.step({- title: corner ? (sliders.length > 1 ? "Join the sections to the corner" : "Join the section to the corner") : sliders.length > 1 ? "Join the chaise longues to the sofa" : "Join the chaise longue to the sofa",+ title: u ? "Join the sections together" : corner ? (sliders.length > 1 ? "Join the sections to the corner" : "Join the section to the corner") : sliders.length > 1 ? "Join the chaise longues to the sofa" : "Join the chaise longue to the sofa",detail: "Push them together, then screw a connector across each joint.",tools: ["screwdriver"],pose: "-y",@@ -241,7 +253,8 @@ export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {const screws: FitOpts[] = [];const half = HW.connector.len / 4;for (const sec of sliders) {- const fixed = corner ? secs[1] : secs.find((x) => !x.slide);+ // a U's chaise longue joins the back's seats, which join the corner+ const fixed = u ? (sec.name === "Chaise longue" ? secs[1] : secs.find((x) => x.name === "Corner section")) : corner ? secs[1] : secs.find((x) => !x.slide);if (!fixed) continue;for (const f of [0.3, 0.7]) {if (sec.along === "z") {diff --git a/src/lib/products.ts b/src/lib/products.tsindex abde922..4e2593a 100644--- a/src/lib/products.ts+++ b/src/lib/products.ts@@ -63,7 +63,8 @@ export type Kind =| "highchair"// the last hard shapes: corners| "cornercab"- | "cornerrobe";+ | "cornerrobe"+ | "usofa";export type X = {rows?: number;@@ -283,7 +284,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, section: 25, gateleg: 50, washstand: 35, sinkcab: 45, appliance: 50, shoerack: 25, clothesrack: 20, changing: 50, divider: 20, backbench: 35, junior: 25, lounge: 30, highchair: 15, cornercab: 45, cornerrobe: 150,+ 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, gateleg: 50, washstand: 35, sinkcab: 45, appliance: 50, shoerack: 25, clothesrack: 20, changing: 50, divider: 20, backbench: 35, junior: 25, lounge: 30, highchair: 15, cornercab: 45, cornerrobe: 150, usofa: 110,};const CATEGORY: Record<Kind, string> = {@@ -292,7 +293,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", section: "Sofa section", gateleg: "Gateleg table", washstand: "Wash-stand", sinkcab: "Sink cabinet", appliance: "Appliance cabinet", shoerack: "Shoe rack", clothesrack: "Clothes rack", changing: "Changing table", divider: "Room divider", backbench: "Bench with backrest", junior: "Junior chair", lounge: "Lounge chair", highchair: "Highchair", cornercab: "Corner base cabinet", cornerrobe: "Corner wardrobe",+ 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", gateleg: "Gateleg table", washstand: "Wash-stand", sinkcab: "Sink cabinet", appliance: "Appliance cabinet", shoerack: "Shoe rack", clothesrack: "Clothes rack", changing: "Changing table", divider: "Room divider", backbench: "Bench with backrest", junior: "Junior chair", lounge: "Lounge chair", highchair: "Highchair", cornercab: "Corner base cabinet", cornerrobe: "Corner wardrobe", usofa: "U-shaped sofa",};export const KIND_ARCH: Record<Kind, Archetype> = {@@ -300,7 +301,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", section: "sofa", gateleg: "table", washstand: "cabinet", sinkcab: "cabinet", appliance: "cabinet", shoerack: "shelf", clothesrack: "shelf", changing: "drawers", divider: "shelf", backbench: "seat", junior: "seat", lounge: "seat", highchair: "seat", cornercab: "cabinet", cornerrobe: "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", gateleg: "table", washstand: "cabinet", sinkcab: "cabinet", appliance: "cabinet", shoerack: "shelf", clothesrack: "shelf", changing: "drawers", divider: "shelf", backbench: "seat", junior: "seat", lounge: "seat", highchair: "seat", cornercab: "cabinet", cornerrobe: "cabinet", usofa: "sofa",};const round = (x: X) => (x.round ? { round: true } : {});@@ -487,6 +488,11 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:const shape = kind === "corner" ? { corner: x.corner ?? "left", ...(x.open ? { open: true } : {}) } : { chaise: x.chaise ?? "right" };return { ...base, people: 2, sofa: { ...sofa, ...shape } };}+ case "usofa": {+ // a corner with seats running forward on the left, and a chaise longue at the right-hand end of the back+ const sd = x.sd ?? 92;+ return { ...base, people: 2, difficulty: 3, sofa: { seats: x.seats ?? 6, arms: x.arms ?? "wide", legs: "round", depth: sd, corner: "left", chaise: "right", reach: Math.min(175, Math.max(140, sd + 68)) } };+ }case "cot":return { ...base, people: 1, bed: { type: "cot", mattressW: x.m ?? 60, mattressL: x.l ?? 120, headH: h, footH: h, slats: 9, centerBeam: false, ...(x.drawer ? { drawer: true } : {}) } };case "bunk":@@ -622,5 +628,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], section: [192, 83, 92], gateleg: [151, 75, 90], washstand: [60, 83, 47], sinkcab: [60, 80, 60], appliance: [60, 200, 60], shoerack: [80, 40, 32], clothesrack: [100, 160, 46], changing: [80, 100, 55], divider: [150, 170, 25], backbench: [120, 86, 60], junior: [43, 91, 52], lounge: [72, 88, 80], highchair: [58, 90, 62], cornercab: [88, 80, 88], cornerrobe: [161, 201, 111],+ 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], gateleg: [151, 75, 90], washstand: [60, 83, 47], sinkcab: [60, 80, 60], appliance: [60, 200, 60], shoerack: [80, 40, 32], clothesrack: [100, 160, 46], changing: [80, 100, 55], divider: [150, 170, 25], backbench: [120, 86, 60], junior: [43, 91, 52], lounge: [72, 88, 80], highchair: [58, 90, 62], cornercab: [88, 80, 88], cornerrobe: [161, 201, 111], usofa: [306, 83, 241],};diff --git a/src/lib/search.ts b/src/lib/search.tsindex a6c5a38..4e2c2cc 100644--- a/src/lib/search.ts+++ b/src/lib/search.ts@@ -58,6 +58,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [["cabinet", ["cabinet", "cupboard", "vitrine", "display"]],["chaise", ["chaise longue", "chaise lounge", "chaise"]],["section", ["sofa section", "seat section", "sofa module", "couch section", "sectional piece"]],+ ["usofa", ["u shaped sofa", "u shaped couch", "u shaped sectional", "u sofa", "u couch", "horseshoe sofa"]],["corner", ["corner sofa", "corner couch", "sectional", "l shaped sofa"]],["sofa", ["sofa", "couch", "loveseat"]],["lounge", ["lounge chair", "reclining chair", "garden chair", "patio chair", "deck chair", "adirondack chair"]],@@ -72,7 +73,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [];const KIND_WORDS = new Map(CATEGORY_WORDS);// rows, sections, and kinds drawn later than a family's other pieces, which only come first when asked for-const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe"]);+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa"]);export function kindOf(q: string): Kind | null {const f = " " + fold(q) + " ";diff --git a/src/lib/types.ts b/src/lib/types.tsindex 22e8573..0420e68 100644--- a/src/lib/types.ts+++ b/src/lib/types.ts@@ -126,6 +126,7 @@ export interface SofaParams {corner?: "left" | "right"; // an L: the return runs forward on that side; size.d is its lengthopen?: boolean; // corner sofas: no armrest at the front of the returndepth?: number; // cm, depth of the seat sections of a corner or chaise sofa+ reach?: number; // cm, how far a U-shaped sofa's chaise longue reaches forward (with both corner and chaise set)}/** A product read from someone's own manual: parts as boxes in the assembled product, steps that add them. */