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 corner desks

Youssefcb0cb0f778c1
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index 54f38e3..c61da8d 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", "swivel", "conference"]);
+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", "conference", "cornerdesk"]);
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 751ce43..6c308ca 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"]);
+/** How deep the top of a family's corner desk is along each wall, when it isn't the usual 60 cm. */
+const DESK_DEPTH: Record<string, number> = { MICKE: 50 };
/** 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. */
@@ -301,6 +303,8 @@ const RULES: Rule[] = [
[/^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 desks: an L-shaped top on five legs
+ [/^(corner desk|corner workstation|l-shaped desk)$/, () => ({ kind: "cornerdesk" })],
// corner wardrobes: frames along both walls around an add-on corner unit, with doors when a door's name comes with them
[/^corner wardrobe$/, (_m, c) => ({ kind: "cornerrobe", x: c.multi ? {} : { doors: 0 } })],
// the add-on corner unit sold on its own: a cabinet of shelves
@@ -649,6 +653,12 @@ export function classify(f: Fact, hints: Hints): Verdict {
}
// a corner section is as wide as the family's seats are deep
if (x.corner) w = d;
+ } else if (kind === "cornerdesk") {
+ // IKEA gives the two legs of the L, the longer one along the back
+ if (v.length !== 2) return { skip: "corner desk with a size we can't read" };
+ set(Math.max(v[0], v[1]), hint?.kind === "desk" ? hint.h : 74, Math.min(v[0], v[1]));
+ guessed.h = true;
+ if (DESK_DEPTH[family]) x.sd = DESK_DEPTH[family];
} else if (kind === "cornerrobe") {
// IKEA gives the two legs and the height: "211/161x201 cm"
const legs = f.size.replace(/\s+/g, "").match(/^(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)x(\d+(?:\.\d+)?)cm$/);
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index fd23a64..f7cc1ed 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -540,6 +540,7 @@
"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",
+ "KJELLARNE|Corner desk, 138 × 130 cm": "kjellarne-corner-desk-138-x-130",
"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",
@@ -590,6 +591,8 @@
"LAGKAPTEN / ALEX|Desk, 200 × 60 cm": "lagkapten-alex-desk-200-x-60",
"LAGKAPTEN / KRILLE|Desk, 120 × 60 cm": "lagkapten-krille-desk-120-x-60",
"LAGKAPTEN / KRILLE|Desk, 140 × 60 cm": "lagkapten-krille-desk-140-x-60",
+ "LAGKAPTEN / LINNMON|L-shaped desk, 120 × 160 cm": "lagkapten-linnmon-l-shaped-desk-120-x-160",
+ "LAGKAPTEN / LINNMON|L-shaped desk, 140 × 160 cm": "lagkapten-linnmon-l-shaped-desk-140-x-160",
"LAGKAPTEN / MITTBACK|Desk, 140 × 60 cm": "lagkapten-mittback-desk-140-x-60",
"LAGKAPTEN / OLOV|Desk, 120 × 60 cm": "lagkapten-olov-desk-120-x-60",
"LAGKAPTEN / OLOV|Desk, 140 × 60 cm": "lagkapten-olov-desk-140-x-60",
@@ -834,6 +837,7 @@
"METOD|Wall cb f extr hood w shlf/door, 60 × 80 cm": "metod-wall-cb-f-extr-hood-w-shlf-door-60-x-80",
"METOD|Wall cb f extr hood w shlf/door, 80 × 100 cm": "metod-wall-cb-f-extr-hood-w-shlf-door-80-x-100",
"METOD|Wall cb f extr hood w shlf/door, 80 × 80 cm": "metod-wall-cb-f-extr-hood-w-shlf-door-80-x-80",
+ "MICKE|Corner workstation, 100 × 142 cm": "micke-corner-workstation-100-x-142",
"MICKE|Desk, 142 × 50 cm": "micke-desk-142-x-50",
"MICKE|Desk, 73 × 50 cm": "micke-desk-73-x-50",
"MICKE|Drawer unit with drop-file storage, 35 × 75 cm": "micke-drawer-unit-drop-file-storage-35-x-75",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 0ed0437..b1ef0c7 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -590,6 +590,7 @@ kivik-corner-sofa-6-seat|29443182
kivik-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 89443202
+kjellarne-corner-desk-138-x-130|40613677
klackenas-sideboard-120-x-97|90506750
kleppstad-bed-frame-standard-double-135-x-190|40492675 20492681
kleppstad-wardrobe-2-doors-79-x-176|80437234
@@ -651,6 +652,8 @@ lagkapten-alex-desk-140-x-60|99431982 49432026 19585450 59432040 19432004 494319
lagkapten-alex-desk-200-x-60|59417619 49417653 59607681 19607678 79607680 19521707 89521695 69521700 69607671 09607669 29607668
lagkapten-krille-desk-120-x-60|49416776 19416909
lagkapten-krille-desk-140-x-60|29417263 19417174
+lagkapten-linnmon-l-shaped-desk-120-x-160|39627977 79627980
+lagkapten-linnmon-l-shaped-desk-140-x-160|29627973 69627971
lagkapten-mittback-desk-140-x-60|19417193 49585378
lagkapten-olov-desk-120-x-60|79416770 79416906 79416893 19416773
lagkapten-olov-desk-140-x-60|99417170 49417257 89417260 39417168
@@ -903,6 +906,7 @@ metod-wall-cb-f-extr-hood-w-shlf-door-60-x-60|39505339 79587903 99558650 9951951
metod-wall-cb-f-extr-hood-w-shlf-door-60-x-80|99589883 99504474 99504450 89606289 89589143 89588662 89578842 99517075 89587771 69504545 59504541 99601564 99589369 99588459
metod-wall-cb-f-extr-hood-w-shlf-door-80-x-100|29504302 99589312 99537894 99504290 89604474 89587931 89566373
metod-wall-cb-f-extr-hood-w-shlf-door-80-x-80|99611959 99565778 99538493 99519098 99504426 89587479 89587318
+micke-corner-workstation-100-x-142|50250713 50244741
micke-desk-105-x-50|80213074 10244743 09903014
micke-desk-142-x-50|90214308 60244745
micke-desk-73-x-50|30213076 20244747
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index af0618d..ee76578 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -541,6 +541,7 @@ KIVIK|sofa|2-seat sofa|170|85|92|seats=2
KIVIK|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=95
+KJELLARNE|cornerdesk|Corner desk, 138 × 130 cm|138|74|130
KLACKENÄS|sideboard|Sideboard, 120 × 97 cm|120|97|45
KLEPPSTAD|bed|Bed frame, Standard Double, 135 × 190 cm|151|96|199|m=135,l=190
KLEPPSTAD|sliding|Wardrobe with sliding doors, 117 × 55 × 176 cm|117|176|55|slides=2
@@ -591,6 +592,8 @@ LAGKAPTEN / ALEX|desk|Desk, 140 × 60 cm|140|73|60|legs=round,attach=plate
LAGKAPTEN / ALEX|desk|Desk, 200 × 60 cm|200|73|60|legs=round,attach=plate
LAGKAPTEN / KRILLE|desk|Desk, 120 × 60 cm|120|73|60|legs=round,attach=plate
LAGKAPTEN / KRILLE|desk|Desk, 140 × 60 cm|140|73|60|legs=round,attach=plate
+LAGKAPTEN / LINNMON|cornerdesk|L-shaped desk, 120 × 160 cm|160|74|120
+LAGKAPTEN / LINNMON|cornerdesk|L-shaped desk, 140 × 160 cm|160|74|140
LAGKAPTEN / MITTBACK|desk|Desk, 140 × 60 cm|140|73|60|legs=round,attach=plate
LAGKAPTEN / OLOV|desk|Desk, 120 × 60 cm|120|73|60|legs=round,attach=plate
LAGKAPTEN / OLOV|desk|Desk, 140 × 60 cm|140|73|60|legs=round,attach=plate
@@ -836,6 +839,7 @@ METOD / MAXIMERA|wallcab|Wall cab w 2 glass doors/2 drawers, 60 × 100 cm|60|100
METOD / MAXIMERA|wallcab|Wall cab w 2 glass doors/2 drawers, 80 × 100 cm|80|100|35|z=r2@40+d2s1,hung=1||metod-maximera-wall-cab-w-2-glass-doors-2-drawer-2
METOD / MAXIMERA|wallcab|Wall cabinet w 2 doors/2 drawers, 80 × 100 cm|80|100|35|z=r2@40+d2s1,hung=1
MICKE|chest|Drawer unit with drop-file storage, 35 × 75 cm|35|75|48|rows=2
+MICKE|cornerdesk|Corner workstation, 100 × 142 cm|142|74|100|sd=50
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
diff --git a/src/lib/plan/cornerdesk.ts b/src/lib/plan/cornerdesk.ts
new file mode 100644
index 0000000..84c9f83
--- /dev/null
+++ b/src/lib/plan/cornerdesk.ts
@@ -0,0 +1,87 @@
+import type { ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * A corner desk: an L-shaped top, its corner at the back left, on five legs: one under the corner and two at the end of
+ * each leg of the L. The top lies upside down for the leg plates and the legs, then it's turned over.
+ */
+export function buildCornerDesk(b: PlanBuilder, s: ProductSpec) {
+ const p = s.table ?? {};
+ const W = s.size.w * 10, H = s.size.h * 10, L = s.size.d * 10;
+ const tt = clamp(p.topThickness ?? 28, 15, 50);
+ const ls = clamp(p.legSize ?? 40, 25, 70);
+ const dp = clamp((p.ell ?? 60) * 10, 400, Math.min(W, L) - 200);
+ const x0 = -W / 2, z0 = -L / 2;
+ const Lh = H - tt;
+ const y = H - tt / 2;
+
+ const topC = b.compound("Desk top", [
+ { shape: "box", size: [W, tt, dp], pos: [0, y, z0 + dp / 2] },
+ { shape: "box", size: [dp, tt, L - dp], pos: [x0 + dp / 2, y, z0 + dp + (L - dp) / 2] },
+ ]);
+ const top = b.place(topC.type, topC.mid);
+ const legT = b.part("Leg", [ls, Lh, ls], { shape: p.legs === "square" ? "box" : "cyl", material: p.legs === "square" ? "wood" : "metal" });
+ const inset = 30 + ls / 2;
+ const spots: [number, number][] = [
+ [x0 + inset, z0 + inset],
+ [W / 2 - inset, z0 + inset],
+ [W / 2 - inset, z0 + dp - inset],
+ [x0 + inset, L / 2 - inset],
+ [x0 + dp - inset, L / 2 - inset],
+ ];
+ const legs = spots.map(([x, z]) => b.place(legT, [x, Lh / 2, z]));
+
+ b.step(
+ {
+ title: "Lay the top upside down",
+ detail: "Put the flattened box under it so the surface stays scratch free.",
+ pose: "-y",
+ kind: "general",
+ people: 2,
+ warnings: ["two", "floor"],
+ },
+ () => b.add(top, [0, 200, 0]),
+ );
+ b.step(
+ {
+ title: "Screw on the leg plates",
+ detail: "One under the corner and two at the end of each side. Four screws per plate.",
+ tools: ["screwdriver"],
+ pose: "-y",
+ kind: "screws",
+ },
+ () => {
+ b.fits(HW.plate, spots.map(([x, z]) => ({ on: top, at: [x, H - tt, z] as Vec3, dir: [0, 1, 0] as Vec3, hole: false })), 0.15);
+ b.then(0.1);
+ const sc: FitOpts[] = [];
+ for (const [x, z] of spots)
+ for (const [dx, dz] of [[-28, -28], [28, -28], [28, 28], [-28, 28]]) sc.push({ on: top, at: [x + dx, H - tt - 3, z + dz], dir: [0, 1, 0], hole: false });
+ b.fits(HW.screwM, sc, 0.03);
+ },
+ );
+ b.step(
+ {
+ title: "Screw in the legs",
+ detail: "Turn each one clockwise by hand. Hand tight is enough.",
+ pose: "-y",
+ kind: "legs",
+ warnings: ["hand"],
+ },
+ () => {
+ b.stagger(0.25);
+ legs.forEach((l) => b.add(l, [0, -360, 0], { spin: 2 }));
+ },
+ );
+ b.step(
+ {
+ title: "Turn it over together",
+ detail: "Lift it by the top, not the legs, and stand it in the corner.",
+ pose: "+y",
+ kind: "flip",
+ people: 2,
+ warnings: ["two"],
+ },
+ () => {},
+ );
+}
diff --git a/src/lib/plan/table.ts b/src/lib/plan/table.ts
index 64baa14..ab9680e 100644
--- a/src/lib/plan/table.ts
+++ b/src/lib/plan/table.ts
@@ -3,6 +3,7 @@ import { HW, PlanBuilder, type FitOpts } from "./builder";
import { clamp } from "./math";
import { buildDropLeaf } from "./dropleaf";
import { buildGateleg } from "./gateleg";
+import { buildCornerDesk } from "./cornerdesk";
export function defaultsTable(s: ProductSpec): TableParams {
const p = s.table ?? {};
@@ -19,6 +20,7 @@ export function defaultsTable(s: ProductSpec): TableParams {
}
export function buildTable(b: PlanBuilder, s: ProductSpec) {
+ if (s.table?.ell) return buildCornerDesk(b, s);
if (s.table?.gate) return buildGateleg(b, s);
if (s.table?.leaves) return buildDropLeaf(b, s);
const p = defaultsTable(s);
diff --git a/src/lib/products.ts b/src/lib/products.ts
index b18477d..d10e40a 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -68,7 +68,8 @@ export type Kind =
// the last chairs
| "lounger"
| "swivel"
- | "conference";
+ | "conference"
+ | "cornerdesk";
export type X = {
rows?: number;
@@ -289,7 +290,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, swivel: 25, conference: 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, swivel: 25, conference: 20, cornerdesk: 35,
};
const CATEGORY: Record<Kind, string> = {
@@ -298,7 +299,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", swivel: "Swivel easy chair", conference: "Conference 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", swivel: "Swivel easy chair", conference: "Conference chair", cornerdesk: "Corner desk",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -306,7 +307,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", swivel: "seat", conference: "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", conference: "seat", cornerdesk: "table",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -520,6 +521,9 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
case "bunk":
case "loft":
return { ...base, people: 2, difficulty: 3, bed: { type: kind, mattressW: x.m ?? 90, mattressL: x.l ?? 200, headH: h, footH: h, slats: 14, centerBeam: false } };
+ case "cornerdesk":
+ // an L-shaped top, x.sd deep along each wall, on five legs
+ return { ...base, people: 2, difficulty: 2, table: { attach: "plate", legs: x.legs ?? "round", legSize: 40, topThickness: 28, shelf: false, ell: x.sd ?? 60 } };
case "dropleaf":
return { ...base, people: w > 120 ? 2 : 1, table: { attach: "apron", legs: "square", legSize: 45, topThickness: 25, shelf: false, leaves: x.leaves ?? 2, leaf: x.leaf ?? 30 } };
case "daybed": {
@@ -651,5 +655,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], swivel: [78, 98, 80], conference: [60, 86, 60],
+ 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], conference: [60, 86, 60], cornerdesk: [140, 74, 130],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 978af6c..4c69a2b 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -42,6 +42,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["bar", ["bar table", "high table"]],
["console", ["console", "console table", "hall table"]],
["trolley", ["trolley", "cart", "kitchen island"]],
+ ["cornerdesk", ["corner desk", "l shaped desk", "corner workstation", "corner computer desk", "corner office desk", "l desk"]],
["desk", ["desk"]],
["gateleg", ["gateleg", "gateleg table", "gate leg", "gate leg table"]],
["dropleaf", ["drop leaf", "drop leaf table"]],
@@ -76,7 +77,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", "swivel", "conference"]);
+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa", "lounger", "swivel", "conference", "cornerdesk"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 2cf91b2..c6ad64b 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -39,6 +39,7 @@ export interface TableParams {
leaf?: number; // cm, width of each leaf
gate?: boolean; // a gateleg table: each leaf rests on a gate leg that swings out from the frame
hinges?: boolean; // the leaves come loose and are screwed on with hinges
+ ell?: number; // cm: a corner desk, an L-shaped top this deep along each wall (size.w and size.d are its legs)
}
export interface BedParams {