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 conference tables

Youssef3f171dbc740a
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index c61da8d..4a407fe 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"]);
+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"]);
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 6c308ca..0a5d6aa 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -74,7 +74,7 @@ export function measure(s: string): Size | null {
}
const UPRIGHT = new Set<Kind>(["cube", "bookcase", "open", "chest", "nightstand", "wardrobe", "cabinet", "sideboard", "tv", "shoe", "wallcab", "wallshelf", "kitchen", "mixed", "sliding", "slidecab", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack", "changing", "divider"]);
-const FLAT = new Set<Kind>(["desk", "coffee", "side", "dining", "bar", "console", "kidstable", "trolley", "bench"]);
+const FLAT = new Set<Kind>(["desk", "coffee", "side", "dining", "bar", "console", "kidstable", "trolley", "bench", "conftable"]);
/** Office chairs IKEA sells with armrests although the type doesn't say so. */
const OFFICE_ARMS = new Set(["MARKUS", "ALEFJÄLL"]);
@@ -276,6 +276,8 @@ const RULES: Rule[] = [
[/^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 } : {}) } })],
+ // conference tables, built like the family's desks
+ [/^conference table$/, () => ({ kind: "conftable" })],
// conference chairs, built like office chairs
[/^conference chair$/, () => ({ kind: "conference" })],
[/swivel|office chair|gaming chair|conference|desk chair|highchair|lounge|reclining|lounger|hammock|massage/, () => "office, swivel or lounge chair"],
@@ -565,7 +567,11 @@ export function classify(f: Fact, hints: Hints): Verdict {
if (kind === "appliance" && guessed.d) d = x.hung && x.use !== "fridge" ? 37 : 60;
} else if (FLAT.has(kind)) {
if (v.length === 3) set(v[0], v[2], v[1]);
- else if (v.length === 2) set(v[0], undefined, v[1]);
+ // a conference table with two measures is a round one, across and high
+ else if (v.length === 2 && kind === "conftable") {
+ set(v[0], v[1], v[0]);
+ x.round = true;
+ } else if (v.length === 2) set(v[0], undefined, v[1]);
else if (v.length === 1) {
if (kind === "bench") set(v[0]);
else if (kind === "trolley" || kind === "console") return { skip: "trolley or console with one size" };
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index f7cc1ed..a50524c 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -845,6 +845,11 @@
"MILSBO|Glass-door cabinet, 73 × 175 cm": "milsbo-glass-door-cabinet-73-x-175",
"MINNEN|Ext bed frame with slatted bed base, 80 × 200 cm": "minnen-ext-bed-frame-slatted-bed-base-80-x-200",
"MITTPLAN|Desk, 80 × 60 cm": "mittplan-desk-80-x-60",
+ "MITTZON|Conference table, 120 × 75 cm": "mittzon-conference-table-120-x-75",
+ "MITTZON|Conference table, 140 × 108 × 105 cm": "mittzon-conference-table-140-x-108-x-105",
+ "MITTZON|Conference table, 140 × 108 × 75 cm": "mittzon-conference-table-140-x-108-x-75",
+ "MITTZON|Conference table, 140 × 68 × 105 cm": "mittzon-conference-table-140-x-68-x-105",
+ "MITTZON|Conference table, 140 × 68 × 75 cm": "mittzon-conference-table-140-x-68-x-75",
"MITTZON|Desk sit/stand, 120 × 80 cm": "mittzon-desk-sit-stand-120-x-80",
"MITTZON|Desk sit/stand, 140 × 80 cm": "mittzon-desk-sit-stand-140-x-80",
"MITTZON|Desk sit/stand, 160 × 80 cm": "mittzon-desk-sit-stand-160-x-80",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index b1ef0c7..c7fa860 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -915,6 +915,11 @@ millberget-swivel-chair|20489396 50489390
milsbo-glass-door-cabinet-73-x-175|30396448 00396416
minnen-ext-bed-frame-slatted-bed-base-80-x-200|79418806 29123958 29580126
mittplan-desk-80-x-60|10549428
+mittzon-conference-table-120-x-75|69530441 19530504 09530458 99513930 89530435 59530502 59530446
+mittzon-conference-table-140-x-108-x-105|09533433 69533468 19533461 99533457 89533448 69533473 39533455
+mittzon-conference-table-140-x-108-x-75|39533422 19533381 19533395 79533378 79533420 99533400 59533384
+mittzon-conference-table-140-x-68-x-105|69533053 29514650 09533032 59533039 39533064 99533061 89533066
+mittzon-conference-table-140-x-68-x-75|19533003 29532989 79532920 39532998 39513952 09532985 79533000
mittzon-desk-120-x-80|89526099 09526036 29526097 99526070 99526094 79526033 89526103
mittzon-desk-140-x-60|89528055 89528140 99513954 99528130 39528053 29528044 79528051
mittzon-desk-160-x-80|49513956 39529118 09529087 19529124 69529126 59529122 99529083
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index ee76578..0340a15 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -846,6 +846,11 @@ MILLBERGET|office|Swivel chair|60|105|64|arms=none
MILSBO|cabinet|Glass-door cabinet, 73 × 175 cm|73|175|42
MINNEN|bed|Ext bed frame with slatted bed base, 80 × 200 cm|96|100|209|m=80
MITTPLAN|desk|Desk, 80 × 60 cm|80|74|60
+MITTZON|conftable|Conference table, 120 × 75 cm|120|75|120|round=1
+MITTZON|conftable|Conference table, 140 × 68 × 75 cm|140|75|68
+MITTZON|conftable|Conference table, 140 × 108 × 75 cm|140|75|108
+MITTZON|conftable|Conference table, 140 × 68 × 105 cm|140|105|68
+MITTZON|conftable|Conference table, 140 × 108 × 105 cm|140|105|108
MITTZON|desk|Desk sit/stand, 120 × 80 cm|120|74|80
MITTZON|desk|Desk, 120 × 80 cm|120|74|80
MITTZON|desk|Desk, 140 × 60 cm|140|74|60
diff --git a/src/lib/products.ts b/src/lib/products.ts
index d10e40a..395378a 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -69,7 +69,8 @@ export type Kind =
| "lounger"
| "swivel"
| "conference"
- | "cornerdesk";
+ | "cornerdesk"
+ | "conftable";
export type X = {
rows?: number;
@@ -290,7 +291,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,
+ 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,
};
const CATEGORY: Record<Kind, string> = {
@@ -299,7 +300,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",
+ 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",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -307,7 +308,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",
+ 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",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -521,6 +522,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 "conftable":
+ // built like the family's desks; a standing one is as tall as a bar table
+ return { ...base, people: 2, table: { attach: x.attach ?? "plate", legs: x.legs ?? "round", legSize: 40, topThickness: 28, shelf: false, ...round(x) } };
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 } };
@@ -655,5 +659,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],
+ 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],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 4c69a2b..dcb8fd3 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"]],
+ ["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"]],
["desk", ["desk"]],
["gateleg", ["gateleg", "gateleg table", "gate leg", "gate leg table"]],
@@ -77,7 +78,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"]);
+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"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";