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 swivel and rocking armchairs

Youssef53d5dcdc0f1a
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index 66141fd..4a355d6 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", "usofa", "lounger"]);
+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", "lounger", "swivel"]);
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 9397bc8..ae347d1 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -80,6 +80,8 @@ const FLAT = new Set<Kind>(["desk", "coffee", "side", "dining", "bar", "console"
const OFFICE_ARMS = new Set(["MARKUS", "ALEFJÄLL"]);
/** Office chairs with a tall back and a headrest. */
const OFFICE_TALL = new Set(["MARKUS"]);
+/** Swivel easy chairs that are a shell with no armrests. */
+const SWIVEL_SHELL = new Set(["DYVLINGE", "IKEA PS LÖMSK"]);
/** Gateleg tables with drawers in the middle, which we can't draw, and ones with a storage shelf and loose leaves. */
const GATE_DRAWERS = new Set(["NORDEN"]);
const GATE_STORAGE = new Set(["VIHALS"]);
@@ -254,6 +256,8 @@ const RULES: Rule[] = [
return { kind: "cornercab", x };
}],
// things that are several products, or only part of one
+ // an armchair that rocks as it swivels is one chair, whatever its name says
+ [/^rocking and swivel armchair$/, () => ({ kind: "swivel", x: { rock: true } })],
[/\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) => {
@@ -268,6 +272,8 @@ const RULES: Rule[] = [
[/^highchair with (tray|safety belt)$/, (m) => ({ kind: "highchair", x: m[1] === "tray" ? {} : { shelf: false } })],
// sun loungers with a backrest that adjusts (their cushions, covers and pads sold alone stay skipped)
[/^sun lounger$/, () => ({ kind: "lounger" })],
+ // easy chairs in one piece on a swivel base (a shell without armrests in some families)
+ [/^(children's )?swivel (easy chair|armchair)$/, (m, c) => ({ kind: "swivel", x: { ...(SWIVEL_SHELL.has(c.f.name) ? { arms: "none" } : {}), ...(m[1] ? { seatH: 30 } : {}) } })],
[/swivel|office chair|gaming chair|conference|desk chair|highchair|lounge|reclining|lounger|hammock|massage/, () => "office, swivel or lounge chair"],
// sofas with a chaise longue at one or both ends, and corner sofas (an L of sections)
[/^(?=.*\bsofa)(?=.*\b(corner|crnr|chaise))/, (m) => {
@@ -697,6 +703,7 @@ export function classify(f: Fact, hints: Hints): Verdict {
}
if (kind === "armchair" && /wing|high-back/.test(t) && guessed.h) h = 104;
if (kind === "armchair" && kids && guessed.w) [w, h, d] = [55, 68, 58];
+ if (kind === "swivel" && kids && guessed.w) [w, h, d] = [59, 70, 64];
if (hint && guessed.w && guessed.h && hint.kind === kind && (kind !== "sofa" || hint.x.seats === x.seats)) {
[w, h, d] = [hint.w, hint.h, hint.d];
}
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index f2e006d..624e7dd 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -176,6 +176,7 @@
"DOMSTEN|Stool": "domsten-stool",
"DUVSKÄR|Chair, in/outdoor": "duvskar-chair-in-outdoor",
"DUVSKÄR|Table, outdoor, 76 × 63 cm": "duvskar-table-outdoor-76-x-63",
+ "DYVLINGE|Swivel easy chair": "dyvlinge-swivel-easy-chair",
"EKENABBEN|Cabinet, 70 × 35 × 51 cm": "ekenabben-cabinet-70-x-35-x-51",
"EKENABBEN|Open shelving unit, 70 × 34 × 154 cm": "ekenabben-open-shelving-unit-70-x-34-x-154",
"EKENÄSET|Armchair": "ekenaset-armchair",
@@ -442,6 +443,7 @@
"IKEA PS 2026|Table, 156 × 75 cm": "ikea-ps-2026-table-156-x-75",
"IKEA PS 2026|Table, 96 cm": "ikea-ps-2026-table-96",
"IKEA PS 2026|Trolley, 89 × 48 cm": "ikea-ps-2026-trolley-89-x-48",
+ "IKEA PS LÖMSK|Children's swivel armchair": "ikea-ps-lomsk-children-s-swivel-armchair",
"IKEA PS|Cabinet, 119 × 63 cm": "ikea-ps-cabinet-119-x-63",
"INGOLF|Junior chair": "ingolf-junior-chair",
"INVALLNING|Trolley, 68 × 39 cm": "invallning-trolley-68-x-39",
@@ -633,6 +635,7 @@
"LILLESÄTER|4-seat sofa": "lillesater-4-seat-sofa",
"LILLESÄTER|5-seat sofa": "lillesater-5-seat-sofa",
"LILLESÄTER|6-seat sofa": "lillesater-6-seat-sofa",
+ "LILLESÄTER|Swivel easy chair": "lillesater-swivel-easy-chair",
"LINDÅKRA|2-seat sofa-bed": "lindakra-2-seat-sofa-bed",
"LINNEBÄCK|Easy chair": "linneback-easy-chair",
"LINNMON / ADILS|Table, 100 × 45 cm": "linnmon-adils-table-100-x-45",
@@ -888,6 +891,7 @@
"NISSAFORS|Trolley, 50.5 × 30 × 83 cm": "nissafors-trolley-50-5-x-30-x-83",
"NORDKISA|Bedside table, 40 × 40 cm": "nordkisa-bedside-table-40-x-40",
"NORDKISA|Dressing table, 76 × 47 cm": "nordkisa-dressing-table-76-x-47",
+ "NORDKROKEN|Rocking and swivel armchair": "nordkroken-rocking-and-swivel-armchair",
"NORDLI|Bed frame with storage, 140 × 200 cm": "nordli-bed-frame-storage-140-x-200",
"NORDLI|Chest of 12 drawers, 120 × 145 cm": "nordli-chest-12-drawers-120-x-145",
"NORDLI|Chest of 12 drawers, 160 × 145 cm": "nordli-chest-12-drawers-160-x-145",
@@ -1104,6 +1108,7 @@
"SALTSJÖBADEN|3-seat sofa with chaise longue": "saltsjobaden-3-seat-sofa-chaise-longue",
"SALTSJÖBADEN|Armchair": "saltsjobaden-armchair",
"SALTSJÖBADEN|Corner sofa, 4-seat": "saltsjobaden-corner-sofa-4-seat",
+ "SALTSJÖBADEN|Rocking and swivel armchair": "saltsjobaden-rocking-and-swivel-armchair",
"SANDKATT|Highchair with tray": "sandkatt-highchair-tray",
"SANDSBERG|Chair": "sandsberg-chair",
"SEGERÖN|2-seat sofa, outdoor": "segeron-2-seat-sofa-outdoor",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index cb54a4a..73de346 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -196,6 +196,7 @@ docksta-table-103|19324995
domsten-stool|60554380
duvskar-chair-in-outdoor|70515760
duvskar-table-outdoor-76-x-63|90515759
+dyvlinge-swivel-easy-chair|20623861 60581920 00570830 50570837
ekenabben-cabinet-70-x-35-x-51|40595206
ekenabben-open-shelving-unit-70-x-34-x-154|80487813 10487816 40596395 90596393
ekenaset-armchair|50533492 30533488 00624343 80624339 20624323 40624341 10539014 90624329 70624330
@@ -484,6 +485,7 @@ ikea-ps-2026-table-156-x-75|00617861
ikea-ps-2026-table-96|80617895
ikea-ps-2026-trolley-89-x-48|50621078 40621074
ikea-ps-cabinet-119-x-63|10251451
+ikea-ps-lomsk-children-s-swivel-armchair|30609237
ingolf-junior-chair|60353838
invallning-trolley-68-x-39|10569398
ismantorp-armchair|60598218 10598225
@@ -695,6 +697,7 @@ lillesater-3-seat-sofa|40618496 00619073
lillesater-4-seat-sofa|29614273 89614265
lillesater-5-seat-sofa|59614281 19614297
lillesater-6-seat-sofa|89614289 19614301
+lillesater-swivel-easy-chair|70618490 60618688
lindakra-2-seat-sofa-bed|80582612 80629271
linneback-easy-chair|40487235 20487222 10487227
linnmon-adils-desk|29932181 09932177
@@ -958,6 +961,7 @@ nissafors-trolley-50-5-x-19-x-67|10602982 40602985
nissafors-trolley-50-5-x-30-x-83|20399777 40585801 40465733 10606782
nordkisa-bedside-table-40-x-40|60447677
nordkisa-dressing-table-76-x-47|20439472
+nordkroken-rocking-and-swivel-armchair|79616953 49616940
nordli-bed-frame-storage-140-x-200|40349847 00349849
nordli-chest-12-drawers-120-x-145|99239489
nordli-chest-12-drawers-160-x-145|79239490
@@ -1180,6 +1184,7 @@ saltsjobaden-3-seat-sofa|99627663 09579195 69627508 69627532 29579199 39622767 7
saltsjobaden-3-seat-sofa-chaise-longue|99602144 09627568 59579211 99627564 39579207 19627544 29579203
saltsjobaden-armchair|29627647 79599581 59622733 39627623 19599602 19578572 99627639
saltsjobaden-corner-sofa-4-seat|89627456 69622501 69627650 19578553 99627432 99622482 89578559
+saltsjobaden-rocking-and-swivel-armchair|09602407 99602399 79621431 89602644 89602620 29602411 19602416
sandkatt-highchair-tray|60616646
sandsberg-chair|30605423 10605424 90605260
sandsberg-table-110-x-67|29420393 59420400
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index fb0033a..efc528d 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -177,6 +177,7 @@ DOCKSTA|dining|Table, 103 cm|103|74|103|round=1
DOMSTEN|stool|Stool|35|45|35
DUVSKÄR|chair|Chair, in/outdoor|44|88|50||outdoor garden
DUVSKÄR|dining|Table, outdoor, 76 × 63 cm|76|74|63||outdoor garden
+DYVLINGE|swivel|Swivel easy chair|78|98|80|arms=none
EKENABBEN|cabinet|Cabinet, 70 × 35 × 51 cm|70|51|35
EKENABBEN|open|Open shelving unit, 70 × 34 × 154 cm|70|154|34
EKENÄSET|armchair|Armchair|75|90|80
@@ -444,6 +445,7 @@ IKEA PS 2026|side|Side table, 50 × 40 cm|50|50|40
IKEA PS 2026|sofa|3-seat sofa-bed|230|85|92|seats=3
IKEA PS 2026|stool|Stool|35|45|35
IKEA PS 2026|trolley|Trolley, 89 × 48 cm|89|80|48
+IKEA PS LÖMSK|swivel|Children's swivel armchair|59|70|64|arms=none,seatH=30|kids
INGOLF|junior|Junior chair|43|91|52||kids children
INVALLNING|trolley|Trolley, 68 × 39 cm|68|80|39
ISMANTORP|armchair|Armchair|75|90|80
@@ -634,6 +636,7 @@ LILLESÄTER|sofa|3-seat sofa|230|85|92|seats=3
LILLESÄTER|sofa|4-seat sofa|290|85|92|seats=4
LILLESÄTER|sofa|5-seat sofa|350|85|92|seats=5
LILLESÄTER|sofa|6-seat sofa|398|85|92|seats=6
+LILLESÄTER|swivel|Swivel easy chair|78|98|80
LINDÅKRA|sofa|2-seat sofa-bed|170|85|92|seats=2
LINNEBÄCK|armchair|Easy chair|75|90|80
LINNMON / ADILS|dining|Table, 100 × 45 cm|100|74|45
@@ -889,6 +892,7 @@ NISSAFORS|trolley|Trolley, 50.5 × 19 × 67 cm|51|67|19
NISSAFORS|trolley|Trolley, 50.5 × 30 × 83 cm|51|83|30
NORDKISA|desk|Dressing table, 76 × 47 cm|76|74|47
NORDKISA|nightstand|Bedside table, 40 × 40 cm|40|55|40|rows=1
+NORDKROKEN|swivel|Rocking and swivel armchair|78|98|80|rock=1
NORDLI|bed|Bed frame with storage, 140 × 200 cm|156|64|209|m=140
NORDLI|chest|Modular chest of drawers, 40 × 45 cm|40|45|48|rows=3,knobs=none
NORDLI|chest|Chest of drawers, 40 × 54 cm|40|54|48|rows=4,knobs=none
@@ -1105,6 +1109,7 @@ SALTSJÖBADEN|corner|Corner sofa, 4-seat|237|85|173|seats=4,arms=wide,corner=lef
SALTSJÖBADEN|sofa|2-seat sofa|170|85|92|seats=2
SALTSJÖBADEN|sofa|2-seat sofa-bed|170|85|92|seats=2
SALTSJÖBADEN|sofa|3-seat sofa|230|85|92|seats=3
+SALTSJÖBADEN|swivel|Rocking and swivel armchair|78|98|80|rock=1
SANDKATT|highchair|Highchair with tray|58|90|62
SANDSBERG|chair|Chair|44|88|50
SEGERÖN|chair|Chair with armrests, outdoor|44|88|50|arms=slim|outdoor garden
diff --git a/src/lib/ikea.ts b/src/lib/ikea.ts
index 5749f98..364422d 100644
--- a/src/lib/ikea.ts
+++ b/src/lib/ikea.ts
@@ -23,8 +23,8 @@ export interface IkeaRow {
slug?: string;
}
-const X_KEYS = ["rows", "cols", "knobs", "plinth", "doors", "shelves", "c", "m", "l", "f", "seats", "arms", "legs", "attach", "shelf", "min", "round", "seatH", "chaise", "corner", "open", "sd", "drawer", "leaves", "leaf", "under", "mats", "dtop", "rail", "slides", "n", "of", "hinge", "use", "z", "basin", "hung", "uf", "ins", "blind", "inner", "u", "v", "cu"] as const;
-const FLAGS = new Set<string>(["plinth", "shelf", "round", "open", "drawer", "dtop", "rail", "hinge", "hung"]);
+const X_KEYS = ["rows", "cols", "knobs", "plinth", "doors", "shelves", "c", "m", "l", "f", "seats", "arms", "legs", "attach", "shelf", "min", "round", "seatH", "chaise", "corner", "open", "sd", "drawer", "leaves", "leaf", "under", "mats", "dtop", "rail", "slides", "n", "of", "hinge", "use", "z", "basin", "hung", "uf", "ins", "blind", "inner", "u", "v", "cu", "rock"] as const;
+const FLAGS = new Set<string>(["plinth", "shelf", "round", "open", "drawer", "dtop", "rail", "hinge", "hung", "rock"]);
const WORDS = new Set<string>(["knobs", "arms", "legs", "attach", "chaise", "corner", "under", "of", "use", "z", "inner", "u", "v"]);
export function encodeX(x: X): string {
diff --git a/src/lib/plan/seat.ts b/src/lib/plan/seat.ts
index de79548..5070d6e 100644
--- a/src/lib/plan/seat.ts
+++ b/src/lib/plan/seat.ts
@@ -4,6 +4,7 @@ import { clamp, rotate } from "./math";
import { buildOffice } from "./office";
import { buildHighchair } from "./highchair";
import { buildLounger } from "./lounger";
+import { buildSwivel } from "./swivel";
export function defaultsSeat(s: ProductSpec): SeatParams {
const p = s.seat ?? {};
@@ -23,6 +24,7 @@ export function buildSeat(b: PlanBuilder, s: ProductSpec) {
if (s.seat?.kind === "office") return buildOffice(b, s);
if (s.seat?.kind === "highchair") return buildHighchair(b, s);
if (s.seat?.kind === "lounger") return buildLounger(b, s);
+ if (s.seat?.kind === "swivel") return buildSwivel(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/plan/swivel.ts b/src/lib/plan/swivel.ts
new file mode 100644
index 0000000..24a1ca2
--- /dev/null
+++ b/src/lib/plan/swivel.ts
@@ -0,0 +1,101 @@
+import type { PartPiece, ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * An upholstered easy chair on a swivel base: the chair comes in one piece, with its armrests and backrest. Turned upside
+ * down, it gets the swivel plate bolted under the seat (a rocking one gets the rocking mechanism there instead), then it is
+ * lowered onto the base, and the seat cushion goes in last.
+ */
+export function buildSwivel(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 rock = !!p.rock;
+ const seatTop = clamp((p.seatH ?? 44) * 10, 300, 520);
+ const cushT = 100;
+ // underside of the chair: low enough for its seat, high enough for the base under it
+ const shellBot = Math.max(110, seatTop - cushT - 140);
+ const block = seatTop - cushT - shellBot;
+ const a = arms ? clamp(W * 0.14, 80, 150) : 0;
+ const backT = clamp(D * 0.2, 120, 200);
+ const armTop = Math.min(H - 80, seatTop + 220);
+
+ /* ---------- the chair, in one piece ---------- */
+ const shell: PartPiece[] = [
+ { shape: "box", size: [W - 2 * a, block, D - backT], pos: [0, shellBot + block / 2, backT / 2] },
+ { shape: "box", size: [W, H - shellBot, backT], pos: [0, shellBot + (H - shellBot) / 2, -D / 2 + backT / 2] },
+ ];
+ if (arms) for (const sx of [-1, 1]) shell.push({ shape: "box", size: [a, armTop - shellBot, D - backT], pos: [sx * (W / 2 - a / 2), shellBot + (armTop - shellBot) / 2, backT / 2] });
+ const chairC = b.compound(arms ? "Armchair" : "Easy chair", shell, { material: "soft" });
+ const chair = b.place(chairC.type, chairC.mid);
+ const cushion = b.place(b.part("Seat cushion", [W - 2 * a - 20, cushT, D - backT - 30], { material: "soft" }), [0, seatTop - cushT / 2, backT / 2 + 5]);
+
+ /* ---------- under the seat, and the base ---------- */
+ const plateH = rock ? 70 : 24;
+ const plateC = b.compound(
+ rock ? "Rocking mechanism" : "Swivel plate",
+ rock
+ ? [
+ { shape: "box", size: [300, 20, 300], pos: [0, shellBot - 10, 0] },
+ { shape: "box", size: [220, plateH - 20, 180], pos: [0, shellBot - 20 - (plateH - 20) / 2, 0] },
+ ...[-1, 1].map((sx) => ({ shape: "cyl" as const, size: [40, 40, 40] as Vec3, pos: [sx * 80, shellBot - plateH / 2, 0] as Vec3 })),
+ ]
+ : [
+ { shape: "box", size: [260, plateH, 260], pos: [0, shellBot - plateH / 2, 0] },
+ { shape: "cyl", size: [70, 40, 70], pos: [0, shellBot - plateH - 20, 0] },
+ ],
+ { material: "metal" },
+ );
+ const plate = b.place(plateC.type, plateC.mid);
+ const colTop = shellBot - plateH - (rock ? 0 : 40);
+ const R = clamp(Math.min(W, D) / 2 - 60, 220, 340);
+ const baseC = b.compound(
+ "Swivel base",
+ [
+ { shape: "cyl", size: [2 * R, 14, 2 * R], pos: [0, 7, 0] },
+ { shape: "cyl", size: [56, colTop - 14, 56], pos: [0, 14 + (colTop - 14) / 2, 0] },
+ ],
+ { material: "metal" },
+ );
+ const base = b.place(baseC.type, baseC.mid);
+
+ /* ---------- steps ---------- */
+ b.step(
+ {
+ title: rock ? "Bolt the rocking mechanism under the seat" : "Bolt the swivel plate under the seat",
+ detail: "Turn the chair upside down on a blanket first. Four bolts hold it.",
+ tools: ["allen"],
+ scene: "chair",
+ pose: "-y",
+ kind: "bolts",
+ people: W > 750 ? 2 : 1,
+ warnings: ["floor"],
+ },
+ () => {
+ b.stage(chair, b.partItem(chair).final.pos, [0, 0, 0], [0, 200, 0]);
+ b.then(0.1);
+ b.stage(plate, b.partItem(plate).final.pos, [0, 0, 0], [0, -220, 0]);
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ for (const x of [-100, 100]) for (const z of [-100, 100]) bolts.push({ on: plate, at: [x, shellBot - (rock ? 20 : plateH), z], dir: [0, 1, 0], mate: chair });
+ b.fits(HW.boltL, bolts, 0.1);
+ },
+ );
+ b.step(
+ {
+ title: "Lower the chair onto the base",
+ detail: rock ? "Turn it the right way up and set it on the base. Sit down on it once, firmly." : "Turn it the right way up and drop the plate over the post. Sit down on it once, firmly.",
+ kind: "join",
+ people: W > 750 ? 2 : 1,
+ warnings: W > 750 ? ["two"] : [],
+ },
+ () => {
+ b.add(base, [0, 160, 0]);
+ b.then(0.2);
+ b.stagger(0);
+ for (const k of [chair, plate]) b.add(k, [0, 360, 0]);
+ },
+ );
+ b.step({ title: "Drop in the seat cushion", detail: "The zip faces the back.", kind: "cushions" }, () => b.add(cushion, [0, 300, 0]));
+}
diff --git a/src/lib/products.ts b/src/lib/products.ts
index 9f4de41..9477284 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -66,7 +66,8 @@ export type Kind =
| "cornerrobe"
| "usofa"
// the last chairs
- | "lounger";
+ | "lounger"
+ | "swivel";
export type X = {
rows?: number;
@@ -113,6 +114,7 @@ export type X = {
v?: string;
cu?: number;
inner?: "shelf" | "carousel" | "pullout";
+ rock?: boolean;
};
export type Row = [name: string, kind: Kind, variant: string, w: number, h: number, d: number, x?: X, keywords?: string];
@@ -286,7 +288,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, usofa: 110, lounger: 35,
+ 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, lounger: 35, swivel: 25,
};
const CATEGORY: Record<Kind, string> = {
@@ -295,7 +297,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", usofa: "U-shaped sofa", lounger: "Sun lounger",
+ 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", lounger: "Sun lounger", swivel: "Swivel easy chair",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -303,7 +305,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", usofa: "sofa", lounger: "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", usofa: "sofa", lounger: "seat", swivel: "seat",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -414,6 +416,11 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
case "lounger":
// a sun lounger lies along its depth; size.h is the height with the backrest up
return { ...base, difficulty: 2, people: 1, seat: { kind: "lounger", seat: "square", seatH: x.seatH ?? 33, backH: h } };
+ case "swivel": {
+ // an easy chair in one piece on a swivel base; x.rock: it rocks as well; x.arms "none": a shell with no armrests
+ const rock = x.rock ? { rock: true } : {};
+ return { ...base, category: x.rock ? "Rocking armchair" : CATEGORY.swivel, difficulty: 1, people: 1, seat: { kind: "swivel", seat: "square", seatH: x.seatH ?? 44, backH: h, ...(x.arms !== "none" ? { arms: true } : {}), ...rock } };
+ }
case "lounge":
// a low armchair on a wooden frame, built like a chair with armrests
return { ...base, difficulty: 2, people: 1, seat: { kind: "chair", seat: "square", seatH: x.seatH ?? 38, backH: h, arms: true } };
@@ -640,5 +647,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], usofa: [306, 83, 241], lounger: [66, 87, 195],
+ 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], lounger: [66, 87, 195], swivel: [78, 98, 80],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 47c9a6e..1ad06d2 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -62,6 +62,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["corner", ["corner sofa", "corner couch", "sectional", "l shaped sofa"]],
["sofa", ["sofa", "couch", "loveseat"]],
["lounger", ["sun lounger", "sunlounger", "sun bed", "sunbed", "sun lounger chair", "pool lounger", "beach lounger", "garden lounger", "patio lounger"]],
+ ["swivel", ["swivel armchair", "swivel easy chair", "swivel lounge chair", "swivel accent chair", "swivel rocker", "rocking armchair", "rocker recliner"]],
["lounge", ["lounge chair", "reclining chair", "garden chair", "patio chair", "deck chair", "adirondack chair"]],
["armchair", ["armchair", "wing chair", "recliner"]],
["highchair", ["highchair", "high chair", "baby chair", "feeding chair"]],
@@ -74,7 +75,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", "usofa", "lounger"]);
+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa", "lounger", "swivel"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
diff --git a/src/lib/types.ts b/src/lib/types.ts
index a5e604d..2cf91b2 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -108,7 +108,7 @@ export interface FitParams {
}
export interface SeatParams {
- kind: "stool" | "chair" | "bench" | "office" | "highchair" | "lounger";
+ kind: "stool" | "chair" | "bench" | "office" | "highchair" | "lounger" | "swivel";
seat: "round" | "square";
seatH: number; // cm
backH: number; // cm (chair total height)
@@ -116,6 +116,7 @@ export interface SeatParams {
splay: boolean;
arms?: boolean; // office chairs and chairs: armrests
tray?: boolean; // highchairs: false when it comes without a tray
+ rock?: boolean; // swivel easy chairs: it rocks as well
}
export interface SofaParams {