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 kitchen corner cabinets

Yousseff4e5b2aebbcc
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index fa40ded..84f0a8d 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"]);
+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"]);
function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {
const fam = fold(name);
diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.ts
index e9eac85..3158276 100644
--- a/scripts/ikea/check.ts
+++ b/scripts/ikea/check.ts
@@ -123,6 +123,9 @@ async function main() {
// and for appliance cabinets: a hob unit when asked for, the plain high cabinet otherwise
expect("metod hob unit", "metod-knivshult-base-cab-f-hob-2-fronts-3-drawer");
expect("metod high cabinet", "metod-high-cabinet-shelves-40-x-37-x-200");
+ // a corner cabinet when asked for, without taking the family's wall cabinets
+ expect("metod corner base cabinet", "metod-corner-base-cabinet-carousel-88-x-88");
+ expect("metod wall cabinet", "metod-wall-cabinet-w-shelves-glass-door-30-x-80");
if (articleNo("S292.975.72") !== "29297572") fail("article numbers with an S in front don't parse");
for (const [no, slug] of [["60324520", "kallax-2x2"]] as const) {
if (articleSlug(no) !== slug) fail(`article ${no} gave ${articleSlug(no)}, expected ${slug}`);
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index eb310c3..9bda9ea 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -94,6 +94,10 @@ const WASH_FLOOR = new Set(["HEMNES", "NYSJÖN"]);
const RACK_SIZE: Record<string, [number, number, number]> = { RIGGA: [111, 175, 51] };
/** Day-beds' outer size (w, h, d) from IKEA's product pages: IKEA's measure is only the mattress size. */
const DAYBED_SIZE: Record<string, [number, number, number]> = { HEMNES: [210, 83, 91], BRIMNES: [205, 58, 87], FLEKKE: [207, 86, 91], VIHALS: [206, 75, 86] };
+/** Blind corner base cabinets: how wide the door at the open end is, in cm (IKEA gives only the whole width). */
+const BLIND_DOOR: Record<string, number> = { METOD: 60, KNOXHULT: 50 };
+/** Corner base cabinets IKEA measures wide by high, with the worktop on top, and how deep they are. */
+const CORNER_WH: Record<string, number> = { KNOXHULT: 61 };
type Pick = { kind: Kind; x?: X } | string;
type Rule = [RegExp, (m: RegExpMatchArray, c: Ctx) => Pick];
@@ -181,6 +185,22 @@ const RULES: Rule[] = [
[/^(glass-door cabinet with|high cabinet w gls-drs and) (\d) drawers?$/, (m) => ({ kind: "mixed", x: { rows: Number(m[2]) } })],
[/^wardrobe with (\d) doors and (\d) drawers$/, (m) => (Number(m[1]) > 2 ? "wardrobe with more than 2 doors and drawers" : { kind: "mixed", x: { doors: Number(m[1]) as 1 | 2, rows: Number(m[2]), rail: true } })],
[/^base cabinet with drawer\/(2 )?doors?$/, (m) => ({ kind: "mixed", x: { doors: m[1] ? 2 : 1, rows: 1, dtop: true } })],
+ // kitchen corner cabinets: an L with a door that folds at the inner corner, or a long blind corner with a door at its
+ // open end, a drawer over it in some (the carousels, shelves and fittings sold alone stay skipped)
+ [/^corner (base|wall) cab(?:inet)?(?: (?:with|w) (shelf|shelves|carousel|pull-out fitting|drawer and p-out|drawer and shelf)(?:\/glass dr)?)?$/, (m, c) => {
+ const family = c.f.name.split(" / ")[0].trim();
+ const what = m[2] ?? "";
+ const x: X = {};
+ if (m[1] === "wall") x.hung = true;
+ else if ((c.sz.n[0] ?? 0) >= 100) x.blind = BLIND_DOOR[family] ?? 60;
+ // a METOD frame on its own comes without a door or shelves
+ if (!what && family === "METOD" && !c.f.spr) x.doors = 0;
+ if (/shel/.test(what) || (!what && x.blind && x.doors !== 0)) x.shelves = x.hung ? Math.max(1, Math.round(((c.sz.n[1] ?? 80) - 20) / 30)) : 1;
+ if (what === "carousel") x.inner = "carousel";
+ if (/p(ull)?-out/.test(what)) x.inner = "pullout";
+ if (/drawer/.test(what)) x.rows = 1;
+ return { kind: "cornercab", x };
+ }],
// things that are several products, or only part of one
[/\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
@@ -542,6 +562,19 @@ export function classify(f: Fact, hints: Hints): Verdict {
d = Math.min(175, Math.max(140, d + 68));
delete x.chaise;
}
+ } else if (kind === "cornercab") {
+ // an L is measured leg by leg ("88x88"), or as a frame with its leg's depth ("88x60x80"); a blind corner wide by deep;
+ // a wall cabinet wide by high; some families wide by high with the worktop on top
+ if (sz.ext || v.length < 2) return { skip: "corner cabinet with a size we can't read" };
+ const ell = !x.blind;
+ if (v.length === 3) {
+ set(v[0], v[2], ell ? v[0] : v[1]);
+ if (ell) x.sd = v[1];
+ } else if (x.hung) set(v[0], v[1], v[0]);
+ else if (CORNER_WH[family]) set(v[0], v[1], CORNER_WH[family]);
+ 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 === "office") {
// IKEA gives no size for office chairs: a typical one, taller with a headrest, smaller for children
if (v.length === 3) set(v[0], v[2], v[1]);
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 170bede..bf87d8f 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -522,6 +522,7 @@
"KLEPPSTAD|Wardrobe with sliding doors, 117 × 55 × 176 cm": "kleppstad-wardrobe-sliding-doors-117-x-55-x-176",
"KLIPPUGGLA|Bed frame with storage, 90 × 200 cm": "klippuggla-bed-frame-storage-90-x-200",
"KNARREVIK|Bedside table, 37 × 28 × 45 cm": "knarrevik-bedside-table-37-x-28-x-45",
+ "KNOXHULT|Corner base cabinet, 100 × 91 cm": "knoxhult-corner-base-cabinet-100-x-91",
"KNOXHULT|High cabinet with door, 60 × 31 × 153 cm": "knoxhult-high-cabinet-door-60-x-31-x-153",
"KNOXHULT|High cabinet with doors, 60 × 31 × 228 cm": "knoxhult-high-cabinet-doors-60-x-31-x-228",
"KNOXHULT|Wall cabinet with door, 40 × 75 cm": "knoxhult-wall-cabinet-door-40-x-75",
@@ -677,6 +678,8 @@
"METOD / KNIVSHULT|Base cb 3 frnts/2 low/1 md/1 hi drw, 60 × 60 cm": "metod-knivshult-base-cb-3-frnts-2-low-1-md-1-hi",
"METOD / KNIVSHULT|Base cb 4 frnts/2 low/3 md drwrs, 40 × 60 cm": "metod-knivshult-base-cb-4-frnts-2-low-3-md-drwrs",
"METOD / KNIVSHULT|Base cb f HAVSEN snk/3 frnts/2 drws, 60 × 60 cm": "metod-knivshult-base-cb-f-havsen-snk-3-frnts-2-d",
+ "METOD / KNIVSHULT|Corner base cab w drawer and p-out, 128 × 68 cm": "metod-knivshult-corner-base-cab-w-drawer-and-p-o",
+ "METOD / KNIVSHULT|Corner base cab w drawer and shelf, 128 × 68 cm": "metod-knivshult-corner-base-cab-w-drawer-and-she",
"METOD / KNIVSHULT|Hi cab f micro w door/2 drawers, 60 × 60 × 200 cm": "metod-knivshult-hi-cab-f-micro-w-door-2-drawers",
"METOD / KNIVSHULT|Hi cab f ov w dr/2 frnt/1 m/1 h drw, 60 × 60 × 200 cm": "metod-knivshult-hi-cab-f-ov-w-dr-2-frnt-1-m-1-h",
"METOD / KNIVSHULT|Hi cab f ov w dr/2 frnts/2 hi drwrs, 60 × 60 × 220 cm": "metod-knivshult-hi-cab-f-ov-w-dr-2-frnts-2-hi-dr",
@@ -713,6 +716,8 @@
"METOD / MAXIMERA|Base cb 3 frnts/2 low/1 md/1 hi drw, 80 × 60 cm": "metod-maximera-base-cb-3-frnts-2-low-1-md-1-hi-d",
"METOD / MAXIMERA|Base cb 4 frnts/2 low/3 md drwrs, 60 × 60 cm": "metod-maximera-base-cb-4-frnts-2-low-3-md-drwrs",
"METOD / MAXIMERA|Base cb f HAVSEN snk/3 frnts/2 drws, 60 × 60 cm": "metod-maximera-base-cb-f-havsen-snk-3-frnts-2-dr",
+ "METOD / MAXIMERA|Corner base cab w drawer and p-out, 128 × 68 cm": "metod-maximera-corner-base-cab-w-drawer-and-p-ou",
+ "METOD / MAXIMERA|Corner base cab w drawer and shelf, 128 × 68 cm": "metod-maximera-corner-base-cab-w-drawer-and-shel",
"METOD / MAXIMERA|Hi cab f micro w door/2 drawers, 60 × 60 × 220 cm": "metod-maximera-hi-cab-f-micro-w-door-2-drawers-6",
"METOD / MAXIMERA|Hi cab f ov w dr/2 frnt/1 m/1 h drw, 60 × 60 × 220 cm": "metod-maximera-hi-cab-f-ov-w-dr-2-frnt-1-m-1-h-d",
"METOD / MAXIMERA|Hi cab f ov w dr/2 frnts/2 hi drwrs, 60 × 60 × 220 cm": "metod-maximera-hi-cab-f-ov-w-dr-2-frnts-2-hi-drw",
@@ -744,6 +749,17 @@
"METOD|Base cabinet with shelves/2 doors, 80 × 60 cm": "metod-base-cabinet-shelves-2-doors-80-x-60",
"METOD|Base cabinet, 60 × 60 × 80 cm": "metod-base-cabinet-60-x-60-x-80",
"METOD|Base cb f built-in appliances/sink, 60 × 60 × 80 cm": "metod-base-cb-f-built-in-appliances-sink-60-x-60",
+ "METOD|Corner base cab w pull-out fitting, 128 × 68 cm": "metod-corner-base-cab-w-pull-out-fitting-128-x-6",
+ "METOD|Corner base cabinet with carousel, 88 × 88 cm": "metod-corner-base-cabinet-carousel-88-x-88",
+ "METOD|Corner base cabinet with shelf, 128 × 68 cm": "metod-corner-base-cabinet-shelf-128-x-68",
+ "METOD|Corner base cabinet with shelf, 88 × 88 cm": "metod-corner-base-cabinet-shelf-88-x-88",
+ "METOD|Corner base cabinet, 128 × 60 × 80 cm": "metod-corner-base-cabinet-128-x-60-x-80",
+ "METOD|Corner base cabinet, 88 × 60 × 80 cm": "metod-corner-base-cabinet-88-x-60-x-80",
+ "METOD|Corner wall cab w carousel/glass dr, 68 × 60 cm": "metod-corner-wall-cab-w-carousel-glass-dr-68-x-6",
+ "METOD|Corner wall cab w shelves/glass dr, 68 × 80 cm": "metod-corner-wall-cab-w-shelves-glass-dr-68-x-80",
+ "METOD|Corner wall cabinet with carousel, 68 × 100 cm": "metod-corner-wall-cabinet-carousel-68-x-100",
+ "METOD|Corner wall cabinet with shelves, 68 × 80 cm": "metod-corner-wall-cabinet-shelves-68-x-80",
+ "METOD|Corner wall cabinet, 68 × 37 × 80 cm": "metod-corner-wall-cabinet-68-x-37-x-80",
"METOD|Hi cab f fridge or freezer w 2 drs, 60 × 60 × 200 cm": "metod-hi-cab-f-fridge-or-freezer-w-2-drs-60-x-60",
"METOD|High cab f fridge or freezer w door, 60 × 60 × 200 cm": "metod-high-cab-f-fridge-or-freezer-w-door-60-x-6",
"METOD|High cab f fridge/freezer w 3 doors, 60 × 60 × 220 cm": "metod-high-cab-f-fridge-freezer-w-3-doors-60-x-6",
diff --git a/src/components/guide/CoverPanel.tsx b/src/components/guide/CoverPanel.tsx
index b67a269..c6f4ed0 100644
--- a/src/components/guide/CoverPanel.tsx
+++ b/src/components/guide/CoverPanel.tsx
@@ -266,6 +266,7 @@ const SHORTHAND: [RegExp, string][] = [
[/\b(\d) h\b/g, "$1 high"],
[/\bshlf\b/g, "shelf"],
[/\bshlvs?\b/g, "shelves"],
+ [/\bp-out\b/g, "pull-out"],
];
/** IKEA's shorthand spelled out, first letter up. */
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 49cf225..3eb57f0 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -574,6 +574,7 @@ kleppstad-wardrobe-sliding-doors-117-x-55-x-176|90437238
klippan-2-seat-sofa|49625204 89246862 89561667 90399316
klippuggla-bed-frame-storage-90-x-200|19627346 09627827
knarrevik-bedside-table-37-x-28-x-45|00576318 20569977
+knoxhult-corner-base-cabinet-100-x-91|00486129 70603974 30603985 00588788
knoxhult-high-cabinet-door-60-x-31-x-153|50604352 40604079 90604246 10604354
knoxhult-high-cabinet-doors-60-x-31-x-228|19581409 59581412 99581410 39581408
knoxhult-wall-cabinet-door-40-x-75|50326789 00603982 80588789 40603975
@@ -739,6 +740,17 @@ metod-base-cabinet-for-sink-60-x-60|19507136 59589333 49455131 09486846 89589020
metod-base-cabinet-shelves-2-doors-80-x-60|49507125 89507133 79465812 69507129 09538039 89517491 89458750
metod-base-cabinet-shelves-60-x-60|49589630 79507124 19507122 99487295 89507128 89473369 59466394
metod-base-cb-f-built-in-appliances-sink-60-x-60|70213569 80591678 60591679 50215475
+metod-corner-base-cab-w-pull-out-fitting-128-x-6|99585106 49585123 99585130 89600517 89588346 89586390 89585140
+metod-corner-base-cabinet-128-x-60-x-80|40596753 30591685
+metod-corner-base-cabinet-88-x-60-x-80|40596748 10591686
+metod-corner-base-cabinet-carousel-88-x-88|79584607 79584612 99584606 89584640 39584614 99624508 99587916
+metod-corner-base-cabinet-shelf-128-x-68|79585046 69585023 59585052 49585024 19585054 09588312 99588176
+metod-corner-base-cabinet-shelf-88-x-88|29584756 99584748 19584733 29584737 99584814 89584763 69584815
+metod-corner-wall-cab-w-carousel-glass-dr-68-x-6|99473608 89509330 89274483 79486188 79473609 79409208 79394990
+metod-corner-wall-cab-w-shelves-glass-dr-68-x-80|59487103 89600503 89509325 89473604 89409203 89274435 69601768
+metod-corner-wall-cabinet-68-x-37-x-80|20205661 00212554 70215281 80591683 20591681 00591682
+metod-corner-wall-cabinet-carousel-68-x-100|99604826 99588992 99588850 99587884 99565561 99558462 99409207
+metod-corner-wall-cabinet-shelves-68-x-80|79589775 69586744 49473601 39587434 19918519 19917826 09507288
metod-hi-cab-f-fridge-or-freezer-w-2-drs-60-x-60|79304032 99628304 99588708 99586035 99585936 99509438 99465986 99556608 89518179 69588795 39473526
metod-high-cab-f-fridge-freezer-w-3-doors-60-x-6|49587928 39473531 09463703 09462628 99605388 99604529 99577291
metod-high-cab-f-fridge-freezer-w-3-doors-60-x-6-2|79605110 99585917 99566221 99465062 89558293 89556835 89539290
@@ -776,6 +788,8 @@ metod-knivshult-base-cb-2-fronts-2-high-drawers|79588304 99589048 99586865 99586
metod-knivshult-base-cb-3-frnts-2-low-1-md-1-hi|89588964 39600157 89589826 89589237 89588803 89587813 79589365
metod-knivshult-base-cb-4-frnts-2-low-3-md-drwrs|99588242 99589492 99589345 99588567 99588100 89587554 89587097
metod-knivshult-base-cb-f-havsen-snk-3-frnts-2-d|99586752 89587224 79589539 69587965 69587098
+metod-knivshult-corner-base-cab-w-drawer-and-p-o|99589722 99587619 59589111 39588928 29586977 19588217
+metod-knivshult-corner-base-cab-w-drawer-and-she|99589086 79587050 39588990 39586972 29587825 19587642
metod-knivshult-hi-cab-f-micro-w-door-2-drawers|99589821 99588666 99587582 99587346 89588898 89588756 89587262
metod-knivshult-hi-cab-f-ov-w-dr-2-frnt-1-m-1-h|99588954 79589916 79588808 69589238 59588606 49589828 49589381
metod-knivshult-hi-cab-f-ov-w-dr-2-frnts-2-hi-dr|89588855 89588940 89588313 89587064 79587130 59589347 59588423
@@ -812,6 +826,8 @@ metod-maximera-base-cb-2-fronts-2-high-drawers-6|89504040 99330228 39487359 3948
metod-maximera-base-cb-3-frnts-2-low-1-md-1-hi-d|89504035 79309925 59566218 59486293 59254288 59104086 39557130
metod-maximera-base-cb-4-frnts-2-low-3-md-drwrs|89557024 89506954 79104250 69518279 49130632 29558521 29557574
metod-maximera-base-cb-f-havsen-snk-3-frnts-2-dr|99504092 99624631 99565556 99509259
+metod-maximera-corner-base-cab-w-drawer-and-p-ou|89585772 59585783 99585795 99585781 99585762 89624448 89585791
+metod-maximera-corner-base-cab-w-drawer-and-shel|89585753 99585757 99585743 99585738 99585724 89604997 89585748
metod-maximera-hi-cab-f-micro-w-door-2-drawers-6|99585903 99565349 89586106 89558877 89509556 79605191 79600853
metod-maximera-hi-cab-f-ov-w-dr-2-frnt-1-m-1-h-d|89461639 69463804 69456653
metod-maximera-hi-cab-f-ov-w-dr-2-frnts-2-hi-drw|99586257 99492367 99470092 99468452 99459424 99458274 89606388
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index ce3fbbc..59bfb7c 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -523,6 +523,7 @@ KLEPPSTAD|sliding|Wardrobe with sliding doors, 117 × 55 × 176 cm|117|176|55|sl
KLEPPSTAD|wardrobe|Wardrobe with 3 doors, 117 × 55 × 176 cm|117|176|55|doors=2
KLIPPUGGLA|bed|Bed frame with storage, 90 × 200 cm|106|100|209|m=90
KNARREVIK|nightstand|Bedside table, 37 × 28 × 45 cm|37|45|28|rows=1
+KNOXHULT|cornercab|Corner base cabinet, 100 × 91 cm|100|91|61|shelves=1,blind=50
KNOXHULT|kitchen|High cabinet with door, 60 × 31 × 153 cm|60|153|31|doors=1
KNOXHULT|kitchen|High cabinet with doors, 60 × 31 × 228 cm|60|228|31
KNOXHULT|wallcab|Wall cabinet with door, 40 × 75 cm|40|75|35|doors=1
@@ -680,6 +681,17 @@ METOD|appliance|High cab f fridge/freezer w 3 doors, 60 × 60 × 240 cm|60|240|6
METOD|appliance|High cab for fridge with 3 doors, 60 × 60 × 240 cm|60|240|60|use=fridge,z=d1+d1+d1@60
METOD|appliance|Wall cb f extr hood w shlf/door, 80 × 80 cm|80|80|37|use=hood,z=d1s1,hung=1
METOD|appliance|Wall cb f extr hood w shlf/door, 80 × 100 cm|80|100|37|use=hood,z=d1s1,hung=1
+METOD|cornercab|Corner wall cab w carousel/glass dr, 68 × 60 cm|68|60|68|hung=1,inner=carousel
+METOD|cornercab|Corner wall cab w shelves/glass dr, 68 × 80 cm|68|80|68|shelves=2,hung=1
+METOD|cornercab|Corner wall cabinet with shelves, 68 × 80 cm|68|80|68|shelves=2,hung=1
+METOD|cornercab|Corner wall cabinet, 68 × 37 × 80 cm|68|80|68|doors=0,sd=37,hung=1
+METOD|cornercab|Corner wall cabinet with carousel, 68 × 100 cm|68|100|68|hung=1,inner=carousel
+METOD|cornercab|Corner base cabinet with carousel, 88 × 88 cm|88|80|88|inner=carousel
+METOD|cornercab|Corner base cabinet with shelf, 88 × 88 cm|88|80|88|shelves=1
+METOD|cornercab|Corner base cabinet, 88 × 60 × 80 cm|88|80|88|doors=0,sd=60
+METOD|cornercab|Corner base cabinet, 128 × 60 × 80 cm|128|80|60|doors=0,blind=60
+METOD|cornercab|Corner base cab w pull-out fitting, 128 × 68 cm|128|80|68|blind=60,inner=pullout
+METOD|cornercab|Corner base cabinet with shelf, 128 × 68 cm|128|80|68|shelves=1,blind=60
METOD|kitchen|High cabinet with shelves, 40 × 37 × 200 cm|40|200|37|doors=0
METOD|kitchen|Base cabinet with shelves, 60 × 60 cm|60|80|60|doors=0
METOD|kitchen|Base cabinet, 60 × 60 × 80 cm|60|80|60|doors=0
@@ -726,6 +738,8 @@ METOD / KNIVSHULT|appliance|High cab f oven w door/3 drawers, 60 × 60 × 220 cm
METOD / KNIVSHULT|appliance|High cabinet f built-in appliances, 60 × 60 × 220 cm|60|220|60|use=appliance,z=r2@80+g@60+d1||metod-knivshult-high-cabinet-f-built-in-applianc-3
METOD / KNIVSHULT|appliance|High cabinet f built-in appliances, 60 × 60 × 240 cm|60|240|60|use=appliance,z=r2@80+g@60+d1||metod-knivshult-high-cabinet-f-built-in-applianc-4
METOD / KNIVSHULT|appliance|High cabinet f oven+door/2 drawers, 60 × 60 × 240 cm|60|240|60|use=oven,z=r2@80+g@60+d1
+METOD / KNIVSHULT|cornercab|Corner base cab w drawer and p-out, 128 × 68 cm|128|80|68|rows=1,blind=60,inner=pullout
+METOD / KNIVSHULT|cornercab|Corner base cab w drawer and shelf, 128 × 68 cm|128|80|68|rows=1,shelves=1,blind=60
METOD / KNIVSHULT|kitchen|Base cab 4 frnts/4 drawers, 40 × 37 cm|40|80|37|z=r4
METOD / KNIVSHULT|kitchen|Base cab 4 frnts/4 drawers, 40 × 60 cm|40|80|60|z=r4||metod-knivshult-base-cab-4-frnts-4-drawers-40-x-2
METOD / KNIVSHULT|kitchen|Base cb 2 fronts/2 high drawers, 40 × 60 cm|40|80|60|z=r2
@@ -762,6 +776,8 @@ METOD / MAXIMERA|appliance|High cabinet f built-in appliances, 60 × 60 × 240 c
METOD / MAXIMERA|appliance|High cabinet f oven+door/2 drawers, 60 × 60 × 240 cm|60|240|60|use=oven,z=r2@80+g@60+d1||metod-maximera-high-cabinet-f-oven-door-2-drawer-2
METOD / MAXIMERA|appliance|Base cab f hob/2 fronts/3 drawers, 80 × 60 cm|80|80|60|use=hob,z=r2
METOD / MAXIMERA|appliance|Base cab f hob/3 fronts/3 drawers, 80 × 60 cm|80|80|60|use=hob,z=r3||metod-maximera-base-cab-f-hob-3-fronts-3-drawers-2
+METOD / MAXIMERA|cornercab|Corner base cab w drawer and p-out, 128 × 68 cm|128|80|68|rows=1,blind=60,inner=pullout
+METOD / MAXIMERA|cornercab|Corner base cab w drawer and shelf, 128 × 68 cm|128|80|68|rows=1,shelves=1,blind=60
METOD / MAXIMERA|kitchen|Base cabinet with 2 drawers, 60 × 37 cm|60|80|37|z=r2
METOD / MAXIMERA|kitchen|Base cabinet with 3 drawers, 60 × 60 cm|60|80|60|z=r3
METOD / MAXIMERA|kitchen|Base cb 2 fronts/2 high drawers, 60 × 60 cm|60|80|60|z=r2
diff --git a/src/lib/catalog.ts b/src/lib/catalog.ts
index 8488020..61d7077 100644
--- a/src/lib/catalog.ts
+++ b/src/lib/catalog.ts
@@ -481,6 +481,8 @@ export function catalogSpec(slug: string): ProductSpec | null {
function sizeLabel(x: Entry, same: Entry[]) {
const head = x.variant.split(",")[0];
if (x.shelf?.style === "grid" && x.shelf.cols && x.shelf.rows) return `${head}, ${x.shelf.cols} × ${x.shelf.rows}`;
+ // a corner cabinet goes by IKEA's own measure, leg by leg
+ if (x.cabinet?.corner) return x.variant;
if ((x.archetype === "shelf" || x.archetype === "cabinet") && /\d+ × \d+/.test(x.variant)) {
const twin = same.some((o) => o !== x && o.size.w === x.size.w && o.size.h === x.size.h);
return `${head}, ${x.size.w} × ${x.size.h} cm${twin ? `, ${x.size.d} deep` : ""}`;
diff --git a/src/lib/ikea.ts b/src/lib/ikea.ts
index 9f98007..5b8b073 100644
--- a/src/lib/ikea.ts
+++ b/src/lib/ikea.ts
@@ -23,9 +23,9 @@ 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"] as const;
+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"] as const;
const FLAGS = new Set<string>(["plinth", "shelf", "round", "open", "drawer", "dtop", "rail", "hinge", "hung"]);
-const WORDS = new Set<string>(["knobs", "arms", "legs", "attach", "chaise", "corner", "under", "of", "use", "z"]);
+const WORDS = new Set<string>(["knobs", "arms", "legs", "attach", "chaise", "corner", "under", "of", "use", "z", "inner"]);
export function encodeX(x: X): string {
const out: string[] = [];
diff --git a/src/lib/plan/cabinet.ts b/src/lib/plan/cabinet.ts
index 406f2db..334a784 100644
--- a/src/lib/plan/cabinet.ts
+++ b/src/lib/plan/cabinet.ts
@@ -5,6 +5,7 @@ import { clamp } from "./math";
import { buildFitted } from "./fitted";
import { buildMixed } from "./mixed";
import { buildSliding } from "./sliding";
+import { buildCornerCabinet } from "./cornercab";
export function defaultsCabinet(s: ProductSpec): CabinetParams {
const p = s.cabinet ?? {};
@@ -22,6 +23,7 @@ export function defaultsCabinet(s: ProductSpec): CabinetParams {
}
export function buildCabinet(b: PlanBuilder, s: ProductSpec) {
+ if (s.cabinet?.corner) return buildCornerCabinet(b, s);
if (s.cabinet?.fit) return buildFitted(b, s);
if (s.cabinet?.drawers) return buildMixed(b, s);
if (s.cabinet?.fronts === "sliding") return buildSliding(b, s);
diff --git a/src/lib/plan/cornercab.ts b/src/lib/plan/cornercab.ts
new file mode 100644
index 0000000..c26bf3f
--- /dev/null
+++ b/src/lib/plan/cornercab.ts
@@ -0,0 +1,601 @@
+import type { PartPiece, ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { FrameKit, anchorStep } from "./frame";
+import { clamp } from "./math";
+
+/** Kitchen corner cabinets: an L with a door that folds at the inner corner, or a blind corner with a door at its open end. */
+export function buildCornerCabinet(b: PlanBuilder, s: ProductSpec) {
+ if (s.cabinet?.corner?.shape === "blind") return blind(b, s);
+ return ell(b, s);
+}
+
+const r1 = (n: number) => Math.round(n * 10) / 10;
+
+/**
+ * An L-shaped corner cabinet, its corner at the back left: a back panel along each wall, a side panel at the end of each leg,
+ * and an L-shaped bottom and top. The back panels are screwed together at the corner first, the bottom and top go onto
+ * their dowels, the sides close the ends, and the cam locks hold it all. The door comes in two halves hinged together:
+ * one half hangs on the side panel, the other folds against it at the inner corner.
+ */
+function ell(b: PlanBuilder, s: ProductSpec) {
+ const c = s.cabinet ?? {};
+ const k = c.corner ?? { shape: "l" };
+ const W = s.size.w * 10, L = s.size.d * 10, H = s.size.h * 10;
+ const t = clamp(c.thickness ?? 18, 12, 25);
+ const wall = !!c.wall;
+ const dp = clamp((k.depth ?? (wall ? 37 : 60)) * 10, 250, Math.min(W, L) - 200);
+ const base = wall ? 0 : 70;
+ const x0 = -W / 2, z0 = -L / 2;
+ // the inner corner, where the two halves of the door meet
+ const xi = x0 + dp, zi = z0 + dp;
+ const carousel = k.inner === "carousel";
+ const nShelves = carousel ? 0 : clamp(Math.round(c.shelves ?? 0), 0, 3);
+ const hasDoor = c.doors !== 0;
+ const handles = c.handles ?? "bar";
+
+ /* ---------- carcass ---------- */
+ const backA = b.place(b.part("Back panel", [W, H, t]), [0, H / 2, z0 + t / 2]);
+ const backB = b.place(b.part("Left back panel", [t, H, L - t]), [x0 + t / 2, H / 2, z0 + t + (L - t) / 2]);
+ const sideT = b.part("Side panel", [t, H, dp - t]);
+ const sideR = b.place(sideT, [W / 2 - t / 2, H / 2, z0 + t + (dp - t) / 2]);
+ const sideF = b.place(sideT, [x0 + t + (dp - t) / 2, H / 2, L / 2 - t / 2], [0, Math.PI / 2, 0]);
+
+ /** An L of two boards at height y, inside the backs and the sides: along the back, then down the left leg. */
+ const ellPieces = (y: number, inset = 0): PartPiece[] => [
+ { shape: "box", size: [W - 2 * t - 2 * inset, t, dp - t - inset], pos: [0, y, (z0 + t + zi - inset) / 2] },
+ { shape: "box", size: [dp - t - inset, t, L / 2 - t - zi], pos: [(x0 + t + xi - inset) / 2, y, (zi + L / 2 - t) / 2 - inset] },
+ ];
+ const botC = b.compound("Bottom panel", ellPieces(base + t / 2));
+ const bottom = b.place(botC.type, botC.mid);
+ const topC = b.compound("Top panel", ellPieces(H - t / 2));
+ const top = b.place(topC.type, topC.mid);
+
+ let plinth: string | undefined;
+ if (base) {
+ // a board under each inner face, set back a little; the one down the left leg runs into the corner
+ const zA = zi - 12 - t / 2, xB = xi - 12 - t / 2;
+ const pc = b.compound("Plinth", [
+ { shape: "box", size: [W / 2 - t - (xi - 12), base, t], pos: [(xi - 12 + W / 2 - t) / 2, base / 2, zA] },
+ { shape: "box", size: [t, base, L / 2 - t - (zi - 12 - t)], pos: [xB, base / 2, (zi - 12 - t + L / 2 - t) / 2] },
+ ]);
+ plinth = b.place(pc.type, pc.mid);
+ }
+
+ /* ---------- where the dowels and bolts go ---------- */
+ // along each board that carries the bottom and top: [part, inner face point builder, direction into the bottom/top]
+ const ys = [base + t / 2, H - t / 2];
+ const along = (a: number, z: number, n: number) => Array.from({ length: n }, (_, i) => a + ((z - a) * (i + 0.5)) / n);
+ const joints: { on: string; at: (y: number) => Vec3[]; into: Vec3 }[] = [
+ { on: backA, at: (y) => along(x0 + dp, W / 2 - t, 2).map((x) => [x, y, z0 + t] as Vec3), into: [0, 0, 1] },
+ { on: backB, at: (y) => along(z0 + dp, L / 2 - t, 2).map((z) => [x0 + t, y, z] as Vec3), into: [1, 0, 0] },
+ { on: sideR, at: (y) => [[W / 2 - t, y, z0 + t + (dp - t) * 0.3], [W / 2 - t, y, z0 + t + (dp - t) * 0.75]], into: [-1, 0, 0] },
+ { on: sideF, at: (y) => [[x0 + t + (dp - t) * 0.3, y, L / 2 - t], [x0 + t + (dp - t) * 0.75, y, L / 2 - t]], into: [0, 0, -1] },
+ ];
+
+ /* ---------- shelves, or a carousel ---------- */
+ const shelfYs = Array.from({ length: nShelves }, (_, i) => Math.round((base + t + ((H - base - 2 * t) * (i + 1)) / (nShelves + 1)) / 32) * 32);
+ const shelfKeys: string[] = [];
+ if (nShelves) {
+ const sc = b.compound("Shelf", ellPieces(0, 10));
+ for (const y of shelfYs) shelfKeys.push(b.place(sc.type, [sc.mid[0], y + 3 + t / 2, sc.mid[2]]));
+ }
+ const pinsAt = (y: number): FitOpts[] => [
+ { on: sideR, at: [W / 2 - t, y, z0 + t + 40], dir: [1, 0, 0], hole: false },
+ { on: sideR, at: [W / 2 - t, y, zi - 40], dir: [1, 0, 0], hole: false },
+ { on: sideF, at: [x0 + t + 40, y, L / 2 - t], dir: [0, 0, 1], hole: false },
+ { on: sideF, at: [xi - 40, y, L / 2 - t], dir: [0, 0, 1], hole: false },
+ { on: backA, at: [x0 + dp, y, z0 + t], dir: [0, 0, -1], hole: false },
+ { on: backB, at: [x0 + t, y, z0 + dp], dir: [-1, 0, 0], hole: false },
+ ];
+ for (const y0 of shelfYs)
+ for (const dy of [-64, 0, 64])
+ for (const p of pinsAt(y0 + dy)) b.hole(p.on!, p.at, [-p.dir[0], -p.dir[1], -p.dir[2]], 2.5);
+
+ // a carousel turns on a pole in the back corner, its shelves clear of the door
+ let pole: string | undefined;
+ const discs: string[] = [];
+ const rc = Math.round(Math.min(0.58 * (dp - t) - 10, (W - 2 * t) / 2 - 20, (L - 2 * t) / 2 - 20));
+ const cx = x0 + t + rc + 10, cz = z0 + t + rc + 10;
+ if (carousel) {
+ const ph = H - base - 2 * t;
+ pole = b.place(b.part("Carousel pole", [30, ph, 30], { shape: "cyl", material: "metal" }), [cx, base + t + ph / 2, cz]);
+ const dT = b.part("Carousel shelf", [2 * rc, t, 2 * rc], { shape: "cyl" });
+ const ysd = H > 700 ? [base + t + 80, base + t + Math.round((H - base - 2 * t) * 0.55)] : [base + t + Math.round((H - base - 2 * t) * 0.4)];
+ for (const y of ysd) discs.push(b.place(dT, [cx, y, cz]));
+ }
+
+ /* ---------- the door in two halves ---------- */
+ const dh = r1(H - base - 4);
+ const dw = r1(W / 2 - xi - t - 4);
+ let doorA: string | undefined, doorB: string | undefined;
+ if (hasDoor) {
+ const dT = b.part("Door", [dw, dh, t]);
+ doorA = b.place(dT, [xi + t + 2 + dw / 2, base + 2 + dh / 2, zi + t / 2]);
+ doorB = b.place(dT, [xi + t / 2, base + 2 + dh / 2, L / 2 - 2 - dw / 2], [0, Math.PI / 2, 0]);
+ }
+
+ /* ---------- steps ---------- */
+ b.step(
+ {
+ title: "Fit the dowels and bolts into the back panels and sides",
+ detail: "Tap the dowels in gently. Twist the bolts in by hand until they stop.",
+ tools: ["hammer", "screwdriver"],
+ scene: "prep",
+ kind: "dowels",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stagger(0.16);
+ // laid flat with the inner face up, one after another
+ const flat: [string, Vec3, number][] = [
+ [backA, [-Math.PI / 2, 0, 0], W],
+ [backB, [0, 0, Math.PI / 2], H],
+ [sideR, [0, 0, -Math.PI / 2], H],
+ [sideF, [0, 0, Math.PI / 2], H],
+ ];
+ const total = flat.reduce((a, [, , w]) => a + w, 0) + 120 * (flat.length - 1);
+ let x = -total / 2;
+ for (const [key, rot, w] of flat) {
+ b.stage(key, [x + w / 2, t / 2, 0], rot, [0, 120, 0]);
+ x += w + 120;
+ }
+ b.then(0.2);
+ const dowels: FitOpts[] = [];
+ const bolts: FitOpts[] = [];
+ for (const j of joints)
+ for (const [yi, y] of ys.entries())
+ for (const p of j.at(y)) {
+ const mate = yi === 0 ? bottom : top;
+ const off = 26;
+ const shift = (v: Vec3, d: number): Vec3 =>
+ j.into[0] !== 0 ? [v[0], v[1], v[2] + d] : [v[0] + d, v[1], v[2]];
+ dowels.push({ on: j.on, at: shift(p, -off), dir: [-j.into[0], -j.into[1], -j.into[2]], mate });
+ bolts.push({ on: j.on, at: shift(p, off), dir: [-j.into[0], -j.into[1], -j.into[2]], mate, mateHole: 4 });
+ }
+ if (plinth) {
+ dowels.push({ on: sideR, at: [W / 2 - t, base / 2, zi - 12 - t / 2], dir: [1, 0, 0], mate: plinth });
+ dowels.push({ on: sideF, at: [xi - 12 - t / 2, base / 2, L / 2 - t], dir: [0, 0, 1], mate: plinth });
+ }
+ b.fits(HW.dowel, dowels, 0.05);
+ b.then(0.15);
+ b.fits(HW.camScrew, bolts, 0.05);
+ },
+ );
+ b.step(
+ {
+ title: "Screw the back panels together at the corner",
+ detail: "Stand them up at a right angle, then screw through the long one into the edge of the other.",
+ tools: ["screwdriver"],
+ kind: "join",
+ people: H > 1000 ? 2 : 1,
+ warnings: H > 1000 ? ["two"] : [],
+ },
+ () => {
+ b.add(backA, [0, 0, -300]);
+ b.then(0.05);
+ b.add(backB, [-300, 0, 0]);
+ b.then(0.1);
+ const list: FitOpts[] = [0.15, 0.5, 0.85].map((f) => ({ on: backA, at: [x0 + t / 2, H * f, z0] as Vec3, dir: [0, 0, 1] as Vec3, mate: backB }));
+ b.fits(HW.screwM, list, 0.12);
+ },
+ );
+ b.step(
+ {
+ title: "Add the bottom and the top",
+ detail: "Push each one onto the dowels along both back panels.",
+ kind: "join",
+ warnings: ["face"],
+ },
+ () => {
+ b.stagger(0.3);
+ b.add(bottom, [260, 0, 260]);
+ b.add(top, [260, 0, 260]);
+ },
+ );
+ b.step(
+ {
+ title: "Add the side panels",
+ detail: "One at the end of each leg. Line up the bolts with the holes and press them on evenly.",
+ kind: "join",
+ },
+ () => {
+ b.stagger(0.3);
+ b.add(sideR, [360, 0, 0]);
+ b.add(sideF, [0, 0, 360]);
+ },
+ );
+ b.step(
+ {
+ title: "Lock the cam locks",
+ detail: "Drop each one in with the arrow pointing at the bolt, then turn clockwise until it bites.",
+ tools: ["screwdriver"],
+ kind: "cams",
+ },
+ () => {
+ const list: FitOpts[] = [];
+ for (const j of joints)
+ for (const [yi, y] of ys.entries())
+ for (const p of j.at(y)) {
+ const into = j.into;
+ const cam: Vec3 = [p[0] + into[0] * 24 + (into[0] !== 0 ? 0 : 26), yi === 0 ? base + t : H - t, p[2] + into[2] * 24 + (into[0] !== 0 ? 26 : 0)];
+ list.push({ on: yi === 0 ? bottom : top, at: cam, dir: [0, yi === 0 ? -1 : 1, 0] });
+ }
+ b.fits(HW.cam, list, 0.06);
+ },
+ );
+ if (plinth) {
+ b.step(
+ {
+ title: "Fit the plinth",
+ detail: "Press it onto the dowels under the front, from one side to the other.",
+ kind: "join",
+ },
+ () => b.add(plinth!, [180, 0, 180]),
+ );
+ }
+
+ if (shelfKeys.length) {
+ b.step(
+ {
+ title: shelfKeys.length > 1 ? "Add the shelf pins and shelves" : "Add the shelf pins and the shelf",
+ detail: "Six pins hold each shelf: two in each side, one in each back panel.",
+ kind: "shelves",
+ },
+ () => {
+ b.fits(HW.pin, shelfYs.flatMap(pinsAt), 0.04);
+ b.then(0.2);
+ b.stagger(0.25);
+ shelfKeys.forEach((key) => b.add(key, [260, 0, 260]));
+ },
+ );
+ }
+
+ if (pole) {
+ b.step(
+ {
+ title: discs.length > 1 ? "Slide the shelves onto the carousel pole" : "Slide the shelf onto the carousel pole",
+ detail: "Click each one in at its height, one low down and one higher up.",
+ scene: "carousel",
+ kind: "general",
+ },
+ () => {
+ b.stage(pole!, [0, (H - base - 2 * t) / 2, 0], [0, 0, 0], [0, 200, 0]);
+ b.then(0.1);
+ b.stagger(0.3);
+ for (const d of discs) b.stage(d, [0, b.partItem(d).final.pos[1] - base - t, 0], [0, 0, 0], [0, 300, 0]);
+ },
+ );
+ b.step(
+ {
+ title: "Stand the carousel in the cabinet",
+ detail: "Tip it in through the opening, then screw its top and bottom plates to the cabinet.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ b.stagger(0);
+ for (const key of [pole!, ...discs]) b.add(key, [300, 0, 300]);
+ b.then(0.15);
+ const list: FitOpts[] = [];
+ for (const [y, dir] of [[base + t, -1], [H - t, 1]] as const)
+ for (const dx of [-30, 30]) list.push({ on: y === base + t ? bottom : top, at: [cx + dx, y, cz], dir: [0, dir, 0], hole: false });
+ b.fits(HW.screwS, list, 0.1);
+ },
+ );
+ }
+
+ if (wall) anchorStep(b, { W, D: L, top, y: H, backZ: z0, tools: ["drill", "screwdriver", "pencil", "level"], hang: true });
+
+ if (doorA && doorB) {
+ const hn = dh > 900 ? 3 : 2;
+ const hy = Array.from({ length: hn }, (_, i) => base + 2 + 108 + (i * (dh - 216)) / (hn - 1));
+ b.step(
+ {
+ title: "Press the hinges into the two halves of the door",
+ detail: "The corner hinges join the halves. The others go on the outer edge, to hang it on the side panel.",
+ tools: ["screwdriver"],
+ scene: "doors",
+ kind: "hinges",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stagger(0.2);
+ // face down, side by side as they will fold
+ b.stage(doorB!, [-dw / 2 - 2, t / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.stage(doorA!, [dw / 2 + 2, t / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ const corner: FitOpts[] = hy.map((y) => ({ on: doorA!, at: [xi + t + 24, y, zi] as Vec3, dir: [0, 0, 1] as Vec3 }));
+ const outer: FitOpts[] = hy.map((y) => ({ on: doorA!, at: [W / 2 - 24, y, zi] as Vec3, dir: [0, 0, 1] as Vec3, twist: Math.PI }));
+ b.fits(HW.hinge, [...corner, ...outer], 0.1);
+ b.then(0.05);
+ b.fits(
+ HW.screwS,
+ [...corner, ...outer].flatMap((h) => [-24, 24].map((d) => ({ on: doorA!, at: [h.at[0], h.at[1] + d, zi] as Vec3, dir: [0, 0, 1] as Vec3, hole: false as const }))),
+ 0.03,
+ );
+ },
+ );
+ b.step(
+ {
+ title: "Hang the door",
+ detail: "Clip the outer hinges onto the plates on the side panel, then fold the other half in at the corner.",
+ kind: "doors",
+ },
+ () => {
+ b.add(doorA!, [0, 0, 380]);
+ b.then(0.1);
+ b.add(doorB!, [380, 0, 0]);
+ },
+ );
+ b.step(
+ {
+ title: "Line up the door",
+ detail: "Turn the hinge screws a little until both halves close evenly.",
+ tools: ["screwdriver"],
+ kind: "doors",
+ },
+ () => {},
+ );
+ if (handles !== "none") {
+ const bar = handles === "bar";
+ b.step(
+ {
+ title: bar ? "Screw on the handle" : "Screw on the knob",
+ detail: "It goes on the half that folds, near its free edge. Screw from the inside.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ const y = wall ? base + 2 + 110 : base + 2 + dh - 110;
+ b.fit(bar ? HW.handle : HW.knob, { on: doorB!, at: [xi + t, y, L / 2 - 2 - 40], dir: [-1, 0, 0], hole: false, twist: bar ? Math.PI / 2 : 0 });
+ },
+ );
+ }
+ }
+
+ if (!wall) anchorStep(b, { W, D: L, top, y: H, backZ: z0 });
+}
+
+/**
+ * A blind corner cabinet: a long carcass built like any base cabinet, with a door at its open end. The rest of its front
+ * is hidden behind the cabinet on the other wall. Inside, a shelf, a pull-out fitting behind the door, and a drawer over it.
+ */
+function blind(b: PlanBuilder, s: ProductSpec) {
+ const c = s.cabinet ?? {};
+ const k = c.corner ?? { shape: "blind" };
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const t = clamp(c.thickness ?? 18, 12, 25);
+ const base = 70;
+ const handles = c.handles ?? "bar";
+ const doorW = clamp((k.door ?? 0) * 10, 0, W - 200);
+ const drawer = !!k.drawer && doorW > 0;
+ const pullout = k.inner === "pullout";
+ const nShelves = clamp(Math.round(c.shelves ?? 0), 0, 2);
+ const f = new FrameKit(b, { W, H, D, t, base, plinth: true, fixed: [], back: true, pinRows: nShelves > 0, lying: false });
+
+ // the door's end of the cabinet: from the middle panel (or where the door starts) to the right-hand side
+ const xL = W / 2 - doorW;
+ const bandH = drawer ? 200 : 0;
+ let middle: string | undefined;
+ // it carries the drawer's runner, so it only reaches down as far as the drawer
+ const midH = bandH + 30;
+ if (drawer) middle = b.place(b.part("Middle panel", [t, midH, D - 4]), [xL + t / 2, H - t - midH / 2, -2]);
+
+ // the pull-out: a rail screwed to the bottom, a post, and two wire baskets that swing out through the door
+ let fitting: string | undefined;
+ let fitX = 0;
+ if (pullout) {
+ const bw = Math.max(200, doorW - 2 * t - 60);
+ const bd = D - 140;
+ const xc = W / 2 - t - 30 - bw / 2;
+ fitX = xc;
+ const y0 = base + t;
+ const top = H - t - bandH - (drawer ? t : 0);
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [60, 24, D - 80], pos: [xc, y0 + 12, 0] },
+ { shape: "box", size: [30, top - y0 - 40, 30], pos: [xc - bw / 2 + 15, y0 + (top - y0 - 40) / 2, D / 2 - 70] },
+ { shape: "box", size: [bw, 110, bd], pos: [xc, y0 + 60 + 55, -10] },
+ { shape: "box", size: [bw, 110, bd], pos: [xc, y0 + (top - y0) * 0.58 + 55, -10] },
+ ];
+ const fc = b.compound("Pull-out fitting", pieces, { material: "metal" });
+ fitting = b.place(fc.type, fc.mid);
+ }
+
+ // the drawer over the door, on runners on the right-hand side and the middle panel
+ const runLen = Math.round((D - 60) / 10) * 10;
+ const runner = { kind: "runner" as const, len: runLen, dia: 20 };
+ const fh = bandH - 4;
+ let dr: { front: string; sides: [string, string]; back: string; bottom: string; ys: number; sh: number } | undefined;
+ const inW = doorW - 2 * t;
+ const bxc = W / 2 - t - inW / 2;
+ const dd = D - 50;
+ const zBox = D / 2 - dd / 2;
+ if (drawer) {
+ const ys = H - t - bandH + 4;
+ const sh = 110;
+ const bw = inW - 26;
+ const sy = ys + 24 + sh / 2;
+ const sideT = b.part("Drawer side", [12, sh, dd]);
+ dr = {
+ ys,
+ sh,
+ front: b.place(b.part("Drawer front", [doorW - 4, fh, t]), [W / 2 - doorW / 2, H - 2 - fh / 2, D / 2 + t / 2]),
+ sides: [b.place(sideT, [bxc - bw / 2 + 6, sy, zBox]), b.place(sideT, [bxc + bw / 2 - 6, sy, zBox])],
+ back: b.place(b.part("Drawer back", [bw - 24, sh - 22, 12]), [bxc, ys + 24 + 22 + (sh - 22) / 2, D / 2 - dd + 6]),
+ bottom: b.place(b.part("Drawer bottom", [bw - 10, 3, dd - 8], { material: "fiber" }), [bxc, ys + 24 + 9, zBox - 2]),
+ };
+ }
+
+ const dh = r1(H - base - 4 - bandH);
+ let door: string | undefined;
+ if (doorW > 0) door = b.place(b.part("Door", [doorW - 4, dh, t]), [W / 2 - doorW / 2, base + 2 + dh / 2, D / 2 + t / 2]);
+
+ /* ---------- steps ---------- */
+ f.prepSides();
+ f.join();
+ f.otherSide();
+ f.cams();
+ f.plinthStep();
+ f.backSteps();
+ f.standUp();
+
+ if (middle) {
+ b.step(
+ {
+ title: "Screw in the middle panel",
+ detail: "It hangs under the top, where the door begins. Screw down through the top into it.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ b.add(middle!, [0, 0, 420]);
+ b.then(0.1);
+ const list: FitOpts[] = [];
+ for (const z of [-D / 3, 0, D / 3]) list.push({ on: f.top, at: [xL + t / 2, H, z], dir: [0, -1, 0], mate: middle });
+ b.fits(HW.screwM, list, 0.1);
+ },
+ );
+ }
+ if (nShelves) f.shelves(nShelves);
+ if (fitting) {
+ b.step(
+ {
+ title: "Fit the pull-out fitting",
+ detail: "Screw its rail to the bottom panel behind the door, then hook the baskets on.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ b.add(fitting!, [0, 0, 460]);
+ b.then(0.1);
+ b.fits(HW.screwS, [-D / 3, 0, D / 3].map((z) => ({ on: fitting!, at: [fitX, base + t + 24, z] as Vec3, dir: [0, -1, 0] as Vec3, mate: f.bottom })), 0.1);
+ },
+ );
+ }
+ if (dr) {
+ const d = dr;
+ b.step(
+ {
+ title: "Screw the drawer runners in",
+ detail: "One on the side, one on the middle panel, just under the top. The open ends point to the front.",
+ tools: ["screwdriver"],
+ kind: "runners",
+ },
+ () => {
+ const y = d.ys + 14;
+ const zr = D / 2 - runLen / 2 - 8;
+ b.fits(runner, [
+ { on: f.sides[1], at: [W / 2 - t, y, zr], dir: [1, 0, 0], hole: false },
+ { on: middle!, at: [xL + t, y, zr], dir: [-1, 0, 0], hole: false },
+ ], 0.15);
+ b.then(0.1);
+ const sc: FitOpts[] = [];
+ for (const dz of [-runLen / 2 + 30, runLen / 2 - 30]) {
+ sc.push({ on: f.sides[1], at: [W / 2 - t - 12, y, zr + dz], dir: [1, 0, 0], hole: false });
+ sc.push({ on: middle!, at: [xL + t + 12, y, zr + dz], dir: [-1, 0, 0], hole: false });
+ }
+ b.fits(HW.screwS, sc, 0.05);
+ },
+ );
+ const c0: Vec3 = [bxc, d.ys + bandH / 2, zBox];
+ const rel = (key: string): Vec3 => {
+ const p = b.partItem(key).final.pos;
+ return [p[0] - c0[0], p[1] - c0[1], p[2] - c0[2]];
+ };
+ b.step(
+ {
+ title: "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",
+ kind: "drawer",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stage(d.front, rel(d.front), [0, 0, 0], [0, 0, -160]);
+ b.then(0.1);
+ b.stagger(0.25);
+ for (const sd of d.sides) b.stage(sd, rel(sd), [0, 0, 0], [0, 0, -300]);
+ b.then(0.1);
+ b.stage(d.bottom, rel(d.bottom), [0, 0, 0], [0, 0, -420]);
+ b.then(0.1);
+ b.stage(d.back, rel(d.back), [0, 0, 0], [0, 0, -260]);
+ b.then(0.15);
+ const bp = b.partItem(d.back).final.pos;
+ b.fits(
+ HW.screwM,
+ d.sides.flatMap((sd, i) => {
+ const xo = b.partItem(sd).final.pos[0] + (i === 0 ? -6 : 6);
+ return [-(d.sh - 22) / 4, (d.sh - 22) / 4].map((dy) => ({ on: sd, at: [xo, bp[1] + dy, bp[2]] as Vec3, dir: [i === 0 ? 1 : -1, 0, 0] as Vec3 }));
+ }),
+ 0.12,
+ );
+ },
+ );
+ b.step(
+ {
+ title: "Slide in the drawer",
+ detail: "Rest the back on the runners, then push until it clicks closed.",
+ kind: "drawer",
+ },
+ () => {
+ b.stagger(0);
+ for (const key of [d.front, d.sides[0], d.sides[1], d.back, d.bottom]) b.add(key, [0, 0, 520]);
+ },
+ );
+ }
+
+ if (door) {
+ const hn = dh > 900 ? 3 : 2;
+ const hy = Array.from({ length: hn }, (_, i) => base + 2 + 108 + (i * (dh - 216)) / (hn - 1));
+ const x = W / 2 - 22;
+ b.step(
+ {
+ title: "Press the hinges into the door",
+ detail: "Two small screws hold each one. They go on the edge by the end of the cabinet.",
+ tools: ["screwdriver"],
+ scene: "doors",
+ kind: "hinges",
+ warnings: ["floor"],
+ },
+ () => {
+ b.stage(door!, [0, t / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ b.fits(HW.hinge, hy.map((y) => ({ on: door!, at: [x, y, D / 2] as Vec3, dir: [0, 0, 1] as Vec3, twist: Math.PI })), 0.1);
+ b.then(0.05);
+ b.fits(HW.screwS, hy.flatMap((y) => [-24, 24].map((dy) => ({ on: door!, at: [x + 4, y + dy, D / 2] as Vec3, dir: [0, 0, 1] as Vec3, hole: false as const }))), 0.03);
+ },
+ );
+ b.step({ title: "Hang the door", detail: "Slide each hinge arm onto its plate until it clicks.", kind: "doors" }, () => b.add(door!, [0, 0, 380]));
+ b.step({ title: "Line up the door", detail: "Turn the hinge screws a little until the gaps look even.", tools: ["screwdriver"], kind: "doors" }, () => {});
+ }
+ const faces = [...(door ? [door] : []), ...(dr ? [dr.front] : [])];
+ if (handles !== "none" && faces.length) {
+ const bar = handles === "bar";
+ b.step(
+ {
+ title: bar ? (faces.length > 1 ? "Screw on the handles" : "Screw on the handle") : faces.length > 1 ? "Screw on the knobs" : "Screw on the knob",
+ detail: "Screw from the inside. Snug is enough.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ const list: FitOpts[] = [];
+ if (door) list.push({ on: door, at: [xL + 42, base + 2 + dh - 110, D / 2 + t], dir: [0, 0, -1], hole: false, twist: bar ? Math.PI / 2 : 0 });
+ if (dr) list.push({ on: dr.front, at: [W / 2 - doorW / 2, H - 2 - fh / 2, D / 2 + t], dir: [0, 0, -1], hole: false });
+ b.fits(bar ? HW.handle : HW.knob, list, 0.12);
+ },
+ );
+ }
+ b.step(
+ {
+ title: "Push it into the corner",
+ detail: doorW > 0 ? "The end without a door goes into the corner, behind the cabinet on the other wall." : "One end goes into the corner, behind the cabinet on the other wall.",
+ kind: "general",
+ people: W > 1100 ? 2 : 1,
+ },
+ () => {},
+ );
+ f.anchor();
+}
diff --git a/src/lib/products.ts b/src/lib/products.ts
index 74c2fc0..698e140 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -1,4 +1,4 @@
-import type { Archetype, FitUse, FitZone, ProductSpec } from "./types";
+import type { Archetype, CornerCab, FitUse, FitZone, ProductSpec } from "./types";
/**
* A wide offline index of real IKEA product names. Each row is a kind plus outer size (cm);
@@ -60,7 +60,9 @@ export type Kind =
| "backbench"
| "junior"
| "lounge"
- | "highchair";
+ | "highchair"
+ // the last hard shapes: corners
+ | "cornercab";
export type X = {
rows?: number;
@@ -102,6 +104,8 @@ export type X = {
hung?: boolean;
uf?: number;
ins?: number;
+ blind?: number;
+ inner?: "shelf" | "carousel" | "pullout";
};
export type Row = [name: string, kind: Kind, variant: string, w: number, h: number, d: number, x?: X, keywords?: string];
@@ -275,7 +279,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,
+ 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,
};
const CATEGORY: Record<Kind, string> = {
@@ -284,7 +288,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",
+ 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",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -292,7 +296,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",
+ 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",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -517,6 +521,18 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
case "sinkcab":
case "appliance":
return fitted(kind, base, w, h, x);
+ case "cornercab": {
+ // an L, x.sd deep along each wall; or with x.blind, a long cabinet with a door that wide at its open end.
+ // x.inner: a carousel or a pull-out fitting; x.rows: a drawer over the door; x.doors 0: a frame sold without its door
+ const hung = !!x.hung;
+ const door = x.doors !== 0;
+ const inner = x.inner ? { inner: x.inner } : {};
+ const corner: CornerCab = x.blind
+ ? { shape: "blind", door: door ? x.blind : 0, ...inner, ...(x.rows ? { drawer: true } : {}) }
+ : { shape: "l", depth: x.sd ?? (hung ? 37 : 60), ...inner };
+ 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 "bookrow":
case "cabrow": {
// x.n units of kind x.of side by side, each drawn as its own guide would draw it
@@ -562,5 +578,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],
+ 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],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 052a8b3..601ff27 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -21,6 +21,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["washstand", ["wash stand", "washstand", "vanity", "vanity unit", "bathroom vanity", "basin unit", "basin cabinet", "wash basin cabinet", "washbasin cabinet", "bathroom cabinet", "sink vanity"]],
["sinkcab", ["sink cabinet", "sink base", "sink base cabinet", "sink unit", "kitchen sink cabinet", "under sink cabinet", "cabinet for sink", "sink cupboard"]],
["appliance", ["appliance cabinet", "oven cabinet", "oven housing", "oven unit", "tall oven unit", "wall oven cabinet", "cabinet for oven", "fridge cabinet", "fridge housing", "refrigerator cabinet", "freezer cabinet", "cabinet for fridge", "microwave cabinet", "hob cabinet", "hob unit", "cooktop cabinet", "hood cabinet", "extractor hood cabinet"]],
+ ["cornercab", ["corner cabinet", "corner base cabinet", "corner wall cabinet", "corner cupboard", "corner base unit", "corner wall unit", "corner kitchen cabinet", "corner kitchen unit", "blind corner", "blind corner cabinet", "lazy susan", "lazy susan cabinet", "carousel unit", "carousel cabinet"]],
["divider", ["room divider", "room dividers", "folding screen", "privacy screen", "partition screen", "room screen"]],
["changing", ["changing table", "changing unit", "baby changing table", "changing station", "diaper changing table", "nappy changing table"]],
["clothesrack", ["clothes rack", "clothes rail", "clothing rack", "clothing rail", "garment rack", "garment rail", "coat rack", "coat stand"]],
@@ -70,7 +71,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"]);
+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 63e0994..6811ee2 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -70,6 +70,20 @@ export interface CabinetParams {
drawerAt?: "top" | "bottom"; // where the drawers are; under the doors unless it says top
slides?: number; // sliding doors: how many, running in two tracks
fit?: FitParams; // built around a basin, a sink or an appliance that is fitted afterwards
+ corner?: CornerCab; // a kitchen corner cabinet
+}
+
+/**
+ * A kitchen corner cabinet. An L has a leg along each wall, `depth` deep, and a door in two halves that folds at the
+ * inner corner (size.w and size.d are the legs). A blind corner is one long carcass with a door at its open end;
+ * the rest of its front hides behind the cabinet on the other wall.
+ */
+export interface CornerCab {
+ shape: "l" | "blind";
+ depth?: number; // cm: how deep each leg of an L is
+ door?: number; // cm: how wide a blind corner's door is
+ inner?: "shelf" | "carousel" | "pullout"; // what goes inside, besides the shelves
+ drawer?: boolean; // a blind corner: a drawer over the door
}
/** What a fitted cabinet is built around. The guide builds the cabinet only, and says so at the end. */