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 desks with drawers and TROFAST's desks between two frames

Youssef5166d2cd75bf
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index 41b4c4b..35b834a 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", "cornerdesk", "conftable", "lidbox", "shelfbench", "workbench", "extension"]);
+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", "conftable", "lidbox", "shelfbench", "workbench", "extension", "deskdraw", "boxdesk"]);
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 baf079d..1e3bdd3 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -442,6 +442,14 @@ const RULES: Rule[] = [
[/^box shelf with divider$/, () => ({ kind: "cube", x: { t: 18, cat: "Box shelf" } })],
// a laptop table is a small desk
[/^laptop table$/, () => ({ kind: "desk" })],
+ // desks and tables with drawers under the top, a dressing table with its mirror
+ [/^desk with (\d) drawers$/, (m) => ({ kind: "deskdraw", x: { rows: Number(m[1]) } })],
+ [/^dressing table with mirror$/, () => ({ kind: "deskdraw", x: { rows: 2, mirror: true, cat: "Dressing table" } })],
+ [/^work bench with drawers$/, () => ({ kind: "deskdraw", x: { rows: 2, knobs: "bar", cat: "Work bench" } })],
+ [/^table with drawer$/, () => ({ kind: "deskdraw", x: { rows: 1, cat: "Table" } })],
+ // TROFAST's low desk: a top between two storage frames, with boxes, trays or shelves in them
+ [/^desk with (?:mesh )?(storage boxes|storage boxes\/trays|shelves)$/, (m, c) =>
+ (c.f.name === "TROFAST" ? { kind: "boxdesk", x: m[1] === "shelves" ? { rows: 2, shelf: true } : { rows: 2 } } : "desk with storage")],
[/^bar stool with backrest, foldable$/, () => ({ kind: "chair", x: { seatH: 63 } })],
[/^three-seat sofa$/, () => ({ kind: "sofa", x: { seats: 3 } })],
[/^(modular )?chest of (\d+) drawers$/, (m) => ({ kind: "chest", x: { rows: Number(m[2]) } })],
@@ -756,6 +764,12 @@ export function classify(f: Fact, hints: Hints): Verdict {
else set(v[0], 80, v[1]);
guessed.h = v.length === 2 && !x.hung && !CORNER_WH[family];
if (hint?.x.knobs) x.knobs = hint.x.knobs;
+ } else if (kind === "deskdraw" || kind === "boxdesk") {
+ // measured from above, or wide by deep by high; a dressing table's height takes in its mirror
+ if (v.length === 3) set(v[0], v[2], v[1]);
+ else if (v.length === 2) set(v[0], undefined, v[1]);
+ if (x.cat === "Work bench" && guessed.h) h = 90;
+ if (x.mirror && guessed.h) h += 85;
} else if (kind === "shelfbench" || kind === "workbench") {
// IKEA gives the width, sometimes the depth and height too; a stool without a size is a typical one
if (x.cat === "Stool with storage") [w, h, d] = [44, 46, 36];
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index be8fb72..3a715e3 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -171,6 +171,7 @@
"BROR|Shelving unit, 85 × 55 × 110 cm": "bror-shelving-unit-85-x-55-x-110",
"BROR|Shelving unit, 85 × 55 × 190 cm": "bror-shelving-unit-85-x-55-x-190",
"BROR|Trolley, 85 × 55 cm": "bror-trolley-85-x-55",
+ "BROR|Work bench with drawers, 85 × 40 × 89 cm": "bror-work-bench-drawers-85-x-40-x-89",
"BROR|Work bench, 110 × 55 cm": "bror-work-bench-110-x-55",
"BRYTNING|Desk, 110 × 53 × 75 cm": "brytning-desk-110-x-53-x-75",
"BRYTNING|Desk, 135 × 53 × 75 cm": "brytning-desk-135-x-53-x-75",
@@ -410,7 +411,9 @@
"HEMNES / VÄSTERSJÖN|Open wsh-stnd w drw/wash-basin/tap, 82 × 48 × 90 cm": "hemnes-vastersjon-open-wsh-stnd-w-drw-wash-basin",
"HEMNES|Day-bed frame with 3 drawers, 80 × 200 cm": "hemnes-day-bed-frame-3-drawers-80-x-200",
"HEMNES|Day-bed w 3 drawers/2 mattresses, 80 × 200 cm": "hemnes-day-bed-w-3-drawers-2-mattresses-80-x-200",
+ "HEMNES|Desk with 2 drawers, 120 × 47 cm": "hemnes-desk-2-drawers-120-x-47",
"HEMNES|Desk, 155 × 65 cm": "hemnes-desk-155-x-65",
+ "HEMNES|Dressing table with mirror, 100 × 50 cm": "hemnes-dressing-table-mirror-100-x-50",
"HEMNES|Glass-door cabinet with 3 drawers, 90 × 197 cm": "hemnes-glass-door-cabinet-3-drawers-90-x-197",
"HEMNES|High cabinet with mirror door, 49 × 31 × 200 cm": "hemnes-high-cabinet-mirror-door-49-x-31-x-200",
"HEMNES|Mirror cabinet with 1 door, 63 × 16 × 98 cm": "hemnes-mirror-cabinet-1-door-63-x-16-x-98",
@@ -462,6 +465,7 @@
"IKEA PS 2026|Shelving unit, 160 × 35 × 161 cm": "ikea-ps-2026-shelving-unit-160-x-35-x-161",
"IKEA PS 2026|Side table, 50 × 40 cm": "ikea-ps-2026-side-table-50-x-40",
"IKEA PS 2026|Stool": "ikea-ps-2026-stool",
+ "IKEA PS 2026|Table with drawer, 70 × 70 cm": "ikea-ps-2026-table-drawer-70-x-70",
"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",
@@ -1412,6 +1416,11 @@
"TRANERED|Coffee table, 90 × 90 cm": "tranered-coffee-table-90-x-90",
"TRÄNNÖ|Stool": "tranno-stool",
"TRAVSPORT|Desk sit/stand, 120 × 70 cm": "travsport-desk-sit-stand-120-x-70",
+ "TROFAST|Desk with mesh storage boxes, 124 × 44 × 52 cm": "trofast-desk-mesh-storage-boxes-124-x-44-x-52",
+ "TROFAST|Desk with mesh storage boxes/trays, 124 × 44 × 52 cm": "trofast-desk-mesh-storage-boxes-trays-124-x-44-x",
+ "TROFAST|Desk with shelves, 124 × 44 × 52 cm": "trofast-desk-shelves-124-x-44-x-52",
+ "TROFAST|Desk with storage boxes, 124 × 44 × 52 cm": "trofast-desk-storage-boxes-124-x-44-x-52",
+ "TROFAST|Desk with storage boxes/trays, 124 × 44 × 52 cm": "trofast-desk-storage-boxes-trays-124-x-44-x-52",
"TROFAST|Frame, 32 × 44 × 52 cm": "trofast-frame-32-x-44-x-52",
"TROFAST|Frame, 34 × 44 × 56 cm": "trofast-frame-34-x-44-x-56",
"TROFAST|Frame, 44 × 91 cm": "trofast-frame-44-x-91",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index c74caf8..c076ad8 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -191,6 +191,7 @@ bror-shelving-unit-cabinet-85-x-40-x-190|89516142
bror-shelving-unit-cabinets-170-x-40-x-190|09516141
bror-trolley-85-x-55|60333850 80547384
bror-work-bench-110-x-55|30333286
+bror-work-bench-drawers-85-x-40-x-89|70494300
brusali-shoe-cabinet-3-compartments|80480393
brytning-desk-110-x-53-x-75|80609744 50609750
brytning-desk-135-x-53-x-75|50609745 30609751
@@ -438,6 +439,8 @@ hemnes-chest-8-drawers|10239280
hemnes-day-bed-frame-3-drawers-80-x-200|90349326 80622892 60372276
hemnes-day-bed-w-3-drawers-2-mattresses-80-x-200|49521503 79610220 59521499 49521485 19428120 19390952 59610235
hemnes-desk-155-x-65|20535044
+hemnes-desk-2-drawers-120-x-47|30534954
+hemnes-dressing-table-mirror-100-x-50|30374413
hemnes-glass-door-cabinet-3-drawers-90-x-197|50452297 00596161 50413507
hemnes-high-cabinet-mirror-door-49-x-31-x-200|70217685
hemnes-mirror-cabinet-1-door-63-x-16-x-98|70217671
@@ -505,6 +508,7 @@ ikea-ps-2026-side-table-50-x-40|80621067
ikea-ps-2026-stool|20617916
ikea-ps-2026-table-156-x-75|00617861
ikea-ps-2026-table-96|80617895
+ikea-ps-2026-table-drawer-70-x-70|40617878
ikea-ps-2026-trolley-89-x-48|50621078 40621074
ikea-ps-cabinet-119-x-63|10251451
ikea-ps-lomsk-children-s-swivel-armchair|30609237
@@ -1497,6 +1501,11 @@ tossberg-malskar-swivel-chair|59508228 69508223 09508235 89508203 69508242 59508
tranered-coffee-table-90-x-90|10608998
tranno-stool|50546381
travsport-desk-sit-stand-120-x-70|59620951
+trofast-desk-mesh-storage-boxes-124-x-44-x-52|69613912 29613933
+trofast-desk-mesh-storage-boxes-trays-124-x-44-x|89613930
+trofast-desk-shelves-124-x-44-x-52|59613936
+trofast-desk-storage-boxes-124-x-44-x-52|89613906 29613909 99613944 29613848 99613897 19613938 09613873 69613870
+trofast-desk-storage-boxes-trays-124-x-44-x-52|59613903 79613921 49613927 39613918 99613915 59613941
trofast-frame-32-x-44-x-52|90516061
trofast-frame-34-x-44-x-56|50516063
trofast-frame-44-x-91|10308693
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index 342a348..f607099 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -167,6 +167,7 @@ BROR|cabinet|Cabinet with 2 doors, 76 × 40 × 66 cm|76|66|40
BROR|cabinet|Shelving unit with cabinet, 85 × 40 × 190 cm|85|190|40|cat=Shelving unit with cabinet,low=72
BROR|cabinet|Cabinet with doors, 85 × 40 × 191 cm|85|191|40
BROR|cabrow|Shelving unit with cabinets, 170 × 40 × 190 cm|170|190|40|of=cabinet,u=85+85,cat=Shelving unit with cabinet,low=72
+BROR|deskdraw|Work bench with drawers, 85 × 40 × 89 cm|85|89|40|rows=2,knobs=bar,cat=Work bench
BROR|open|Shelving unit, 65 × 40 × 190 cm|65|190|40
BROR|open|Shelving unit, 65 × 55 × 190 cm|65|190|55
BROR|open|Shelving unit, 85 × 55 × 110 cm|85|110|55
@@ -407,6 +408,8 @@ HEMNES|cabinet|High cabinet with mirror door, 49 × 31 × 200 cm|49|200|31|doors
HEMNES|daybed|Day-bed frame with 3 drawers, 80 × 200 cm|210|83|91|rows=3,knobs=knob,m=80,under=pullout
HEMNES|daybed|Day-bed w 3 drawers/2 mattresses, 80 × 200 cm|210|83|91|rows=3,knobs=knob,m=80,under=pullout,mats=2
HEMNES|desk|Desk, 155 × 65 cm|155|74|65
+HEMNES|deskdraw|Dressing table with mirror, 100 × 50 cm|100|160|50|rows=2,cat=Dressing table,mirror=1
+HEMNES|deskdraw|Desk with 2 drawers, 120 × 47 cm|120|75|47|rows=2
HEMNES|mixed|Glass-door cabinet with 3 drawers, 90 × 197 cm|90|197|37|rows=3,knobs=knob
HEMNES|wallcab|Mirror cabinet with 1 door, 63 × 16 × 98 cm|63|98|16|knobs=knob,doors=1
HEMNES|wallcab|Mirror cabinet with 2 doors, 83 × 16 × 98 cm|83|98|16|knobs=knob,doors=2
@@ -459,6 +462,7 @@ IKEA PS 2026|cabinet|Glass-door cabinet, 73 × 36 × 160 cm|73|160|36
IKEA PS 2026|cabinet|Cabinet, 80 × 46 × 140 cm|80|140|46
IKEA PS 2026|chair|Chair|44|88|50
IKEA PS 2026|chair|Folding chair|44|88|50
+IKEA PS 2026|deskdraw|Table with drawer, 70 × 70 cm|70|75|70|rows=1,cat=Table
IKEA PS 2026|dining|Table, 96 cm|96|74|96|round=1
IKEA PS 2026|dining|Table, 156 × 75 cm|156|74|75
IKEA PS 2026|nightstand|Bedside table, 30 × 30 × 50 cm|30|50|30|rows=1
@@ -1413,6 +1417,11 @@ TOSSBERG / MALSKÄR|office|Swivel chair|60|105|64|arms=none
TRANERED|coffee|Coffee table, 90 × 90 cm|90|45|90
TRÄNNÖ|stool|Stool|35|45|35
TRAVSPORT|desk|Desk sit/stand, 120 × 70 cm|120|74|70
+TROFAST|boxdesk|Desk with mesh storage boxes, 124 × 44 × 52 cm|124|52|44|rows=2|kids children
+TROFAST|boxdesk|Desk with mesh storage boxes/trays, 124 × 44 × 52 cm|124|52|44|rows=2|kids children
+TROFAST|boxdesk|Desk with shelves, 124 × 44 × 52 cm|124|52|44|rows=2,shelf=1|kids children
+TROFAST|boxdesk|Desk with storage boxes, 124 × 44 × 52 cm|124|52|44|rows=2|kids children
+TROFAST|boxdesk|Desk with storage boxes/trays, 124 × 44 × 52 cm|124|52|44|rows=2|kids children
TROFAST|open|Frame, 32 × 44 × 52 cm|32|52|44||kids children
TROFAST|open|Frame, 34 × 44 × 56 cm|34|56|44||kids children
TROFAST|open|Frame, 44 × 91 cm|44|91|35||kids children
diff --git a/src/lib/plan/boxdesk.ts b/src/lib/plan/boxdesk.ts
new file mode 100644
index 0000000..a30d106
--- /dev/null
+++ b/src/lib/plan/boxdesk.ts
@@ -0,0 +1,108 @@
+import type { ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * A low desk between two storage frames (TROFAST): each frame is two sides with a top and a bottom screwed between
+ * them, the desk top is screwed in between the frames at their height, and the boxes, trays or shelves slide into
+ * the frames' grooves last.
+ */
+export function buildBoxDesk(b: PlanBuilder, s: ProductSpec) {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const tp = s.table ?? {};
+ const fw = clamp((tp.frame ?? 32) * 10, 250, Math.max(250, W / 3)); // each frame's width
+ const per = clamp(Math.round(tp.boxes ?? 2), 1, 4); // boxes in each frame
+ const shelves = !!tp.shelvesIn;
+ const t = 15;
+ const iw = fw - 2 * t;
+ const fx = [-W / 2 + fw / 2, W / 2 - fw / 2]; // the frames' middles
+
+ const sideT = b.part("Frame side", [t, H, D]);
+ const flatT = b.part("Frame top and bottom", [iw, t, D]);
+ const frames = fx.map((x) => ({
+ x,
+ parts: [
+ b.place(sideT, [x - fw / 2 + t / 2, H / 2, 0]),
+ b.place(sideT, [x + fw / 2 - t / 2, H / 2, 0]),
+ b.place(flatT, [x, t / 2, 0]),
+ b.place(flatT, [x, H - t / 2, 0]),
+ ],
+ }));
+ const topW = W - 2 * fw;
+ const deskT = b.part("Desk top", [topW, 22, D]);
+ const desk = b.place(deskT, [0, H - 11, 0]);
+ const slotH = (H - 2 * t) / per;
+ const boxT = shelves ? b.part("Shelf", [iw - 4, 10, D - 30]) : b.part("Storage box", [iw - 6, slotH - 14, D - 30], { material: "fiber" });
+ const boxes = frames.flatMap((f) =>
+ Array.from({ length: shelves ? per - 1 : per }, (_, i) => {
+ const y = shelves ? t + (i + 1) * slotH : t + i * slotH + slotH / 2;
+ return b.place(boxT, [f.x, y, 15]);
+ }),
+ );
+
+ const f0 = frames[0];
+ const at = (k: string) => b.partItem(k).final.pos;
+ const rel = (k: string): Vec3 => [at(k)[0] - f0.x, at(k)[1], at(k)[2]];
+ const corners = (f: (typeof frames)[number]): FitOpts[] =>
+ f.parts.slice(0, 2).flatMap((sd, i) => {
+ const x = at(sd)[0] + (i === 0 ? -t / 2 : t / 2);
+ return [t / 2, H - t / 2].flatMap((y) => [-D / 4, D / 4].map((z) => ({ on: sd, at: [x, y, z] as Vec3, dir: [i === 0 ? 1 : -1, 0, 0] as Vec3 })));
+ });
+
+ b.step(
+ {
+ title: "Put the frames together",
+ detail: "Screw the top and bottom in between the two sides. Grooves face inwards, for the boxes.",
+ tools: ["screwdriver"],
+ scene: "frame",
+ repeat: 2,
+ kind: "screws",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stagger(0.2);
+ f0.parts.forEach((k) => b.stage(k, rel(k), [0, 0, 0], [0, 160, 0]));
+ b.then(0.1);
+ b.fits(HW.screwM, corners(f0), 0.08);
+ },
+ );
+
+ b.step(
+ {
+ title: "Screw the desk top in between the frames",
+ detail: "Stand the frames apart, then screw through their inner sides into the ends of the top.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ for (const [i, f] of frames.entries()) {
+ b.stagger(0);
+ f.parts.forEach((k) => b.add(k, [i === 0 ? -260 : 260, 0, 0]));
+ if (i > 0) for (const o of corners(f)) b.preset(HW.screwM, o);
+ b.wait(0.2);
+ }
+ b.then(0.1);
+ b.add(desk, [0, 260, 0]);
+ b.then(0.1);
+ const list: FitOpts[] = [];
+ for (const [i, f] of frames.entries()) {
+ const x = f.x + (i === 0 ? fw / 2 : -fw / 2);
+ for (const z of [-D / 3, 0, D / 3]) list.push({ on: f.parts[i === 0 ? 1 : 0], at: [x - (i === 0 ? t : -t), H - 11, z], dir: [i === 0 ? 1 : -1, 0, 0], mate: desk });
+ }
+ b.fits(HW.screwM, list, 0.08);
+ },
+ );
+
+ b.step(
+ {
+ title: shelves ? "Slide in the shelves" : "Slide in the boxes",
+ detail: shelves ? "Each one runs along a pair of grooves until it stops." : "Each one runs along a pair of grooves. They pull out from either side.",
+ kind: "general",
+ weight: 0.8 + 0.3 * boxes.length,
+ },
+ () => {
+ b.stagger(0.18);
+ boxes.forEach((k) => b.add(k, [0, 0, 420]));
+ },
+ );
+}
diff --git a/src/lib/plan/deskdraw.ts b/src/lib/plan/deskdraw.ts
new file mode 100644
index 0000000..2b8cbf6
--- /dev/null
+++ b/src/lib/plan/deskdraw.ts
@@ -0,0 +1,251 @@
+import type { PartPiece, ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * A desk or table with drawers under its top (HEMNES, BROR's work bench), and a dressing table with a mirror on it.
+ * Built upside down like a table: rails along the back and sides, guides with runners for the drawers between them,
+ * the legs bolted into the corners; then it's turned over, the mirror goes on, and the drawers slide in last.
+ */
+export function buildDeskDrawers(b: PlanBuilder, s: ProductSpec) {
+ const tp = s.table ?? {};
+ const n = clamp(Math.round(tp.drawers ?? 2), 1, 4);
+ const W = s.size.w * 10, D = s.size.d * 10;
+ const mirrorH = tp.mirror ? clamp(tp.mirror * 10, 300, 1000) : 0;
+ const H = s.size.h * 10 - mirrorH; // the top's height
+ const tt = 25, ls = clamp(tp.legSize ?? 50, 40, 70), inset = 20;
+ const lx = W / 2 - inset - ls / 2, lz = D / 2 - inset - ls / 2;
+ const dh = 150, rt = 20;
+ const yr = H - tt - dh / 2; // middle of the rails and the drawer fronts
+ const big = W > 1000;
+ const knobs = tp.knobs ?? "knob";
+
+ const topT = b.part(/dressing|desk/i.test(s.category) ? "Desk top" : "Table top", [W, tt, D]);
+ const top = b.place(topT, [0, H - tt / 2, 0]);
+ const legT = b.part("Leg", [ls, H - tt, ls], { material: "wood" });
+ const corners: [number, number][] = [
+ [-1, 1],
+ [1, 1],
+ [1, -1],
+ [-1, -1],
+ ];
+ const legs = corners.map(([sx, sz]) => b.place(legT, [sx * lx, (H - tt) / 2, sz * lz]));
+ const backT = b.part("Back rail", [2 * lx - ls, dh, rt], { material: "wood" });
+ const back = b.place(backT, [0, yr, -(lz + ls / 2 - rt / 2)]);
+ const sideT = b.part("Side rail", [rt, dh, 2 * lz - ls], { material: "wood" });
+ const sides = [-1, 1].map((sx) => b.place(sideT, [sx * (lx + ls / 2 - rt / 2), yr, 0]));
+
+ // guides between the legs, one each side of every drawer, runners on their faces
+ const gt = 16;
+ const span = 2 * (lx - ls / 2);
+ const cw = (span - (n + 1) * gt) / n;
+ const gx = (k: number) => -span / 2 + gt / 2 + k * (cw + gt);
+ const cx = (i: number) => gx(i) + gt / 2 + cw / 2;
+ const zFront = lz + ls / 2; // the fronts line up with the front of the legs
+ const zBack = -(lz + ls / 2 - rt);
+ const gd = zFront - 20 - zBack;
+ const guideT = b.part("Drawer guide", [gt, dh - 10, gd]);
+ const guides = Array.from({ length: n + 1 }, (_, k) => b.place(guideT, [gx(k), yr + 5, zBack + gd / 2]));
+ const runLen = Math.max(200, Math.round((gd - 40) / 10) * 10);
+ const runner = { kind: "runner" as const, len: runLen, dia: 20 };
+ const ry = H - tt - dh + 24;
+ const rz = zFront - 20 - runLen / 2 - 10;
+
+ // the drawers
+ const ft = 18;
+ const fw = cw + gt - 4, fh = dh - 6;
+ const bw = cw - 26, sh = dh - 60, dd = runLen;
+ const frT = b.part("Drawer front", [fw, fh, ft]);
+ const dsT = b.part("Drawer side", [12, sh, dd]);
+ const dbT = b.part("Drawer back", [bw - 24, sh - 22, 12]);
+ const dbtT = b.part("Drawer bottom", [bw - 10, 3, dd - 8], { material: "fiber" });
+ const zBox = zFront - ft - dd / 2;
+ const drawers = Array.from({ length: n }, (_, i) => {
+ const x = cx(i), sy = ry - 10 + sh / 2;
+ return {
+ x,
+ front: b.place(frT, [x, yr, zFront - ft / 2]),
+ sides: [b.place(dsT, [x - bw / 2 + 6, sy, zBox]), b.place(dsT, [x + bw / 2 - 6, sy, zBox])] as [string, string],
+ back: b.place(dbT, [x, sy + 11, zBox - dd / 2 + 6]),
+ bottom: b.place(dbtT, [x, ry - 10 + 9, zBox - 2]),
+ };
+ });
+
+ 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",
+ warnings: ["floor"],
+ people: big ? 2 : 1,
+ },
+ () => b.add(top, [0, 200, 0]),
+ );
+
+ b.step(
+ {
+ title: "Screw the rails under the top",
+ detail: "One along the back and one down each side, set in from the edge.",
+ tools: ["screwdriver"],
+ pose: "-y",
+ kind: "screws",
+ },
+ () => {
+ b.stagger(0.2);
+ [back, ...sides].forEach((k) => b.add(k, [0, -260, 0]));
+ b.then(0.1);
+ const sc: FitOpts[] = [];
+ for (const f of [-0.33, 0.33]) sc.push({ on: back, at: [f * (2 * lx - ls), H - tt - dh, -(lz + ls / 2 - rt / 2)], dir: [0, 1, 0], hole: false });
+ for (const [i, k] of sides.entries()) for (const f of [-0.33, 0.33]) sc.push({ on: k, at: [(i === 0 ? -1 : 1) * (lx + ls / 2 - rt / 2), H - tt - dh, f * (2 * lz - ls)], dir: [0, 1, 0], hole: false });
+ b.fits(HW.screwL, sc, 0.06);
+ },
+ );
+
+ b.step(
+ {
+ title: n > 1 ? "Screw the drawer guides under the top" : "Screw both drawer guides under the top",
+ detail: "Runners on them first, open ends to the front. Then screw each guide down between the rails.",
+ tools: ["screwdriver"],
+ pose: "-y",
+ kind: "runners",
+ },
+ () => {
+ b.stagger(0.18);
+ guides.forEach((k) => b.add(k, [0, -240, 0]));
+ b.then(0.1);
+ const runs: FitOpts[] = [];
+ for (let i = 0; i < n; i++)
+ for (const [k, sgn] of [[guides[i], 1], [guides[i + 1], -1]] as const) runs.push({ on: k, at: [gx(i + (sgn > 0 ? 0 : 1)) + (sgn * gt) / 2, ry, rz], dir: [-sgn, 0, 0], hole: false });
+ b.fits(runner, runs, 0.08);
+ b.then(0.1);
+ const sc: FitOpts[] = [];
+ for (let k = 0; k <= n; k++) for (const dz of [-gd / 3, gd / 3]) sc.push({ on: guides[k], at: [gx(k), H - tt - dh + 10, zBack + gd / 2 + dz], dir: [0, 1, 0], hole: false });
+ b.fits(HW.screwM, sc, 0.05);
+ },
+ );
+
+ b.step(
+ {
+ title: "Bolt the legs into the corners",
+ detail: "Hand tight for now. Tighten them all once every leg is on.",
+ tools: ["allen"],
+ pose: "-y",
+ kind: "legs",
+ warnings: ["loose"],
+ },
+ () => {
+ b.stagger(0.3);
+ legs.forEach((l) => b.add(l, [0, -360, 0]));
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ corners.forEach(([sx, sz], i) => {
+ bolts.push({ on: legs[i], at: [sx * (lx + ls / 2), yr, sz * (lz - ls / 4)], dir: [-sx, 0, 0] });
+ if (sz < 0) bolts.push({ on: legs[i], at: [sx * (lx - ls / 4), yr, sz * (lz + ls / 2)], dir: [0, 0, -sz] });
+ });
+ b.fits(HW.boltL, bolts, 0.08);
+ },
+ );
+
+ b.step(
+ {
+ title: big ? "Turn it over together" : "Turn it over",
+ detail: "Lift it by the top, not the legs. Then tighten every bolt.",
+ tools: ["allen"],
+ pose: "+y",
+ kind: "flip",
+ people: big ? 2 : 1,
+ warnings: big ? ["two"] : [],
+ },
+ () => {},
+ );
+
+ if (mirrorH) {
+ const mw = clamp(W * 0.6, 400, 900), post = 40;
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [mw, mirrorH - 60, 6], pos: [0, 60 + (mirrorH - 60) / 2, 0], material: "metal" },
+ { shape: "box", size: [mw + 2 * post, 30, 30], pos: [0, mirrorH - 15, 0], material: "wood" },
+ ];
+ for (const sx of [-1, 1]) pieces.push({ shape: "box", size: [post, mirrorH, 30], pos: [sx * (mw / 2 + post / 2), mirrorH / 2, 0], material: "wood" });
+ const c = b.compound("Mirror", pieces);
+ const zm = -D / 2 + 40;
+ const mirror = b.place(c.type, [c.mid[0], H + c.mid[1], zm + c.mid[2]]);
+ b.step(
+ {
+ title: "Fix the mirror to the back of the top",
+ detail: "Stand it in place, then screw its posts down through the holes in the top.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ people: 2,
+ warnings: ["two"],
+ },
+ () => {
+ b.add(mirror, [0, 300, 0]);
+ b.then(0.15);
+ const sc: FitOpts[] = [-1, 1].map((sx) => ({ on: top, at: [sx * (mw / 2 + post / 2), H - tt, zm] as Vec3, dir: [0, 1, 0] as Vec3, hole: false }));
+ b.fits(HW.screwL, sc, 0.12);
+ },
+ );
+ }
+
+ const d0 = drawers[0];
+ const c0: Vec3 = [d0.x, yr, zBox];
+ const at = (k: string) => b.partItem(k).final.pos;
+ const rel = (k: string): Vec3 => [at(k)[0] - c0[0], at(k)[1] - c0[1], at(k)[2] - c0[2]];
+ const backScrews = (d: (typeof drawers)[number]): FitOpts[] => {
+ const bp = at(d.back);
+ return d.sides.flatMap((sd, i) => [-(sh - 22) / 4, (sh - 22) / 4].map((dy) => ({ on: sd, at: [at(sd)[0] + (i === 0 ? -6 : 6), bp[1] + dy, bp[2]] as Vec3, dir: [i === 0 ? 1 : -1, 0, 0] as Vec3 })));
+ };
+ b.step(
+ {
+ title: n > 1 ? "Put the drawers together" : "Put the drawer together",
+ detail: "Sides onto the front, slide the bottom in along the grooves, then screw on the back.",
+ tools: ["screwdriver"],
+ scene: "drawer",
+ pose: "-z",
+ repeat: n > 1 ? n : undefined,
+ kind: "drawer",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stage(d0.front, rel(d0.front), [0, 0, 0], [0, 0, -160]);
+ b.then(0.1);
+ b.stagger(0.25);
+ for (const sd of d0.sides) b.stage(sd, rel(sd), [0, 0, 0], [0, 0, -300]);
+ b.then(0.1);
+ b.stage(d0.bottom, rel(d0.bottom), [0, 0, 0], [0, 0, -420]);
+ b.then(0.1);
+ b.stage(d0.back, rel(d0.back), [0, 0, 0], [0, 0, -260]);
+ b.then(0.15);
+ b.fits(HW.screwM, backScrews(d0), 0.12);
+ },
+ );
+ b.step(
+ {
+ title: n > 1 ? `Slide in all ${n} drawers` : "Slide in the drawer",
+ detail: "Rest the back on the runners, then push until it clicks closed.",
+ kind: "drawer",
+ weight: 0.8 + 0.5 * n,
+ },
+ () => {
+ for (const [i, d] of drawers.entries()) {
+ b.stagger(0);
+ for (const k of [d.front, d.sides[0], d.sides[1], d.back, d.bottom]) b.add(k, [0, 0, 480]);
+ if (i > 0) for (const o of backScrews(d)) b.preset(HW.screwM, o);
+ b.wait(0.22);
+ }
+ },
+ );
+ if (knobs !== "none") {
+ const def = knobs === "bar" ? HW.handle : HW.knob;
+ b.step(
+ {
+ title: knobs === "bar" ? "Screw on the handles" : "Screw on the knobs",
+ detail: "Screw from inside the drawer. Snug is enough.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => b.fits(def, drawers.map((d) => ({ on: d.front, at: [d.x, yr, zFront] as Vec3, dir: [0, 0, -1] as Vec3, hole: false })), 0.1),
+ );
+ }
+}
diff --git a/src/lib/plan/table.ts b/src/lib/plan/table.ts
index 6dc124d..4b6dec9 100644
--- a/src/lib/plan/table.ts
+++ b/src/lib/plan/table.ts
@@ -4,6 +4,8 @@ import { clamp } from "./math";
import { buildDropLeaf } from "./dropleaf";
import { buildGateleg } from "./gateleg";
import { buildCornerDesk } from "./cornerdesk";
+import { buildDeskDrawers } from "./deskdraw";
+import { buildBoxDesk } from "./boxdesk";
export function defaultsTable(s: ProductSpec): TableParams {
const p = s.table ?? {};
@@ -20,6 +22,8 @@ export function defaultsTable(s: ProductSpec): TableParams {
}
export function buildTable(b: PlanBuilder, s: ProductSpec) {
+ if (s.table?.drawers) return buildDeskDrawers(b, s);
+ if (s.table?.frame) return buildBoxDesk(b, s);
if (s.table?.ell) return buildCornerDesk(b, s);
if (s.table?.gate) return buildGateleg(b, s);
if (s.table?.leaves) return buildDropLeaf(b, s);
diff --git a/src/lib/products.ts b/src/lib/products.ts
index a828142..ba31d24 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -75,7 +75,9 @@ export type Kind =
| "lidbox"
| "shelfbench"
| "workbench"
- | "extension";
+ | "extension"
+ | "deskdraw"
+ | "boxdesk";
export type X = {
rows?: number;
@@ -316,7 +318,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, cornerdesk: 35, conftable: 30, lidbox: 30, shelfbench: 30, workbench: 45, extension: 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, conftable: 30, lidbox: 30, shelfbench: 30, workbench: 45, extension: 20, deskdraw: 40, boxdesk: 35,
};
const CATEGORY: Record<Kind, string> = {
@@ -325,7 +327,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", cornerdesk: "Corner desk", conftable: "Conference table", lidbox: "Storage bench", shelfbench: "Bench with storage", workbench: "Work bench", extension: "Height extension unit",
+ 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", conftable: "Conference table", lidbox: "Storage bench", shelfbench: "Bench with storage", workbench: "Work bench", extension: "Height extension unit", deskdraw: "Desk with drawers", boxdesk: "Desk with storage",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -333,7 +335,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", cornerdesk: "table", conftable: "table", lidbox: "cabinet", shelfbench: "table", workbench: "table", extension: "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", lounger: "seat", swivel: "seat", conference: "seat", cornerdesk: "table", conftable: "table", lidbox: "cabinet", shelfbench: "table", workbench: "table", extension: "cabinet", deskdraw: "table", boxdesk: "table",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -627,6 +629,12 @@ function specOf(kind: Kind, name: string, variant: string, w: number, h: number,
const minutes = x.min ?? MIN.cornercab + (door ? 15 : 0) + (x.inner ? 15 : 0) + (x.rows ? 30 : 0) + 5 * (x.shelves ?? 0);
return { ...base, category: hung ? "Corner wall cabinet" : CATEGORY.cornercab, minutes, people: w > 100 ? 2 : 1, difficulty: x.rows ? 3 : 2, cabinet: { doors: door ? 1 : 0, shelves: x.shelves ?? 0, rail: false, plinth: !hung, handles: x.knobs ?? "bar", thickness: 18, ...(hung ? { wall: true } : {}), corner } };
}
+ case "deskdraw":
+ // x.rows drawers side by side under the top; x.mirror: a dressing table's mirror on the back of the top
+ return { ...base, minutes: x.min ?? MIN.deskdraw + 20 * (x.rows ?? 2) + (x.mirror ? 15 : 0), people: w > 100 || x.mirror ? 2 : 1, difficulty: 2, table: { attach: "apron", legs: "square", legSize: 50, topThickness: 25, shelf: false, drawers: x.rows ?? 2, knobs: x.knobs ?? "knob", ...(x.mirror ? { mirror: 85 } : {}) } };
+ case "boxdesk":
+ // a low desk top between two storage frames, x.rows boxes in each, or shelves when x.shelf
+ return { ...base, minutes: x.min ?? MIN.boxdesk + 5 * (x.rows ?? 2), people: 1, difficulty: 1, table: { attach: "plate", legs: "square", legSize: 40, topThickness: 22, shelf: false, frame: 32, boxes: x.rows ?? 2, ...(x.shelf ? { shelvesIn: true } : {}) } };
case "extension":
// a short box that stands on top of a bookcase or wardrobe: open, or with doors (x.doors)
return { ...base, minutes: x.min ?? MIN.extension + (x.doors ? 15 : 0), people: 1, difficulty: x.doors ? 2 : 1, cabinet: { doors: x.doors ?? 0, shelves: 0, rail: false, plinth: false, handles: x.knobs ?? (x.doors ? "knob" : "none"), thickness: 16, onTop: x.doors ? "cabinet" : "bookcase" } };
@@ -725,5 +733,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], cornerdesk: [140, 74, 130], conftable: [140, 74, 68], lidbox: [100, 48, 42], shelfbench: [110, 46, 38], workbench: [110, 90, 55], extension: [80, 35, 28],
+ 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], conftable: [140, 74, 68], lidbox: [100, 48, 42], shelfbench: [110, 46, 38], workbench: [110, 90, 55], extension: [80, 35, 28], deskdraw: [120, 75, 50], boxdesk: [124, 52, 44],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 7a156cc..cd09a65 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -46,6 +46,8 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["trolley", ["trolley", "cart", "kitchen island"]],
["conftable", ["conference table", "meeting table", "meeting room table", "boardroom table"]],
["cornerdesk", ["corner desk", "l shaped desk", "corner workstation", "corner computer desk", "corner office desk", "l desk"]],
+ ["deskdraw", ["desk with drawers", "desk with drawer", "writing desk with drawers", "table with drawer", "table with drawers", "work bench with drawers", "dressing table with mirror", "makeup table with mirror"]],
+ ["boxdesk", ["desk with storage", "desk with storage boxes", "desk with boxes", "kids desk with storage", "children s desk with storage", "desk with shelves"]],
["desk", ["desk"]],
["gateleg", ["gateleg", "gateleg table", "gate leg", "gate leg table"]],
["dropleaf", ["drop leaf", "drop leaf table"]],
@@ -82,7 +84,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", "cornerdesk", "conftable", "lidbox", "shelfbench", "workbench", "extension"]);
+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", "conftable", "lidbox", "shelfbench", "workbench", "extension", "deskdraw", "boxdesk"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 69f9b95..833eb5a 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -46,6 +46,12 @@ export interface TableParams {
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)
+ drawers?: number; // drawers side by side under the top, in guides between the rails
+ knobs?: "none" | "knob" | "bar"; // on the drawer fronts
+ mirror?: number; // cm: a dressing table's mirror, standing at the back of the top (size.h takes it in)
+ frame?: number; // cm: a low desk whose top sits between two storage frames this wide (TROFAST)
+ boxes?: number; // boxes in each of those frames
+ shelvesIn?: boolean; // shelves in the frames instead of boxes
seat?: boolean; // a bench or stool built like a table: the top is its seat
inner?: boolean; // the shelf fits between the legs, screwed through them
}