IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.
TypeScript
Draw wardrobes and cabinets with sliding doors
Youssefa88109fdb8db
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.tsindex a9c4ec7..aa8ac55 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"]);+const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab"]);function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {const fam = fold(name);diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.tsindex 40aa825..d3ac8da 100644--- a/scripts/ikea/check.ts+++ b/scripts/ikea/check.ts@@ -106,6 +106,9 @@ async function main() {// doors and drawers together, without taking the chests of drawersexpect("hemnes cabinet with drawers", "hemnes-glass-door-cabinet-3-drawers-90-x-197");expect("hemnes chest of drawers", "hemnes-3-drawers");+ // sliding doors only when the query says so+ expect("hauga sliding wardrobe", "hauga-wardrobe-sliding-doors-118-x-55-x-199");+ expect("hauga wardrobe", "hauga-wardrobe-70-x-199");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.tsindex a2541b3..318322d 100644--- a/scripts/ikea/classify.ts+++ b/scripts/ikea/classify.ts@@ -73,7 +73,7 @@ export function measure(s: string): Size | null {return { n: parts.map((p) => Number(p.split("/")[0])), ext: parts.some((p) => p.includes("/")), text: parts.join(" × ") + " cm" };}-const UPRIGHT = new Set<Kind>(["cube", "bookcase", "open", "chest", "nightstand", "wardrobe", "cabinet", "sideboard", "tv", "shoe", "wallcab", "wallshelf", "kitchen", "mixed"]);+const UPRIGHT = new Set<Kind>(["cube", "bookcase", "open", "chest", "nightstand", "wardrobe", "cabinet", "sideboard", "tv", "shoe", "wallcab", "wallshelf", "kitchen", "mixed", "sliding", "slidecab"]);const FLAT = new Set<Kind>(["desk", "coffee", "side", "dining", "bar", "console", "kidstable", "trolley", "bench"]);/** Office chairs IKEA sells with armrests although the type doesn't say so. */@@ -158,6 +158,10 @@ const RULES: Rule[] = [return { kind: "daybed", x: { ...under, mats: Number(m[6] ?? m[5] ?? 0) || undefined } };}],[/day-?bed|divan/, () => "divan, or bedding for a day-bed"],+ // sliding doors on a wardrobe or a cabinet, running in tracks (doors sold alone stay skipped)+ [/^wardrobe with (\d )?sliding doors$/, (m) => (Number(m[1] ?? 2) > 3 ? "more than 3 sliding doors" : { kind: "sliding", x: { slides: Number(m[1] ?? 2) } })],+ [/^cabinet with (2 )?sliding (glass )?doors$/, (_m, c) =>+ c.f.spr ? "cabinet with sliding doors sold as a combination" : c.f.name === "IDÅSEN" ? "steel office cabinet" : { kind: "slidecab", x: { slides: 2 } }],[/sliding/, () => "sliding doors"],[/sink|wash-?basin|wash-?st|hob\b|oven|fridge|freezer|dishwasher|microwave|extractor|appliances|kitchenette|outdoor kitchen/, () => "appliance or sink unit"],[/^(door\/)?drawer front|^drawer (without |with (framed )?(glass )?)front|^(high|medium|low) drawer with front|^fitting for mounting/, () => "door or drawer front sold alone"],@@ -290,8 +294,9 @@ export function classify(f: Fact, hints: Hints): Verdict {else return { skip: "no size given" };if (guessed.d && hint?.kind === kind && Math.abs(hint.w - w) < 60) d = hint.d;// a cabinet with drawers is as deep as the family's cabinet- const cab = kind === "mixed" ? hints(family, "cabinet") : undefined;- if (guessed.d && cab?.kind === "cabinet" && Math.abs(cab.w - w) < 60) d = cab.d;+ const twin = kind === "mixed" || kind === "slidecab" ? "cabinet" : kind === "sliding" ? "wardrobe" : undefined;+ const cab = twin ? hints(family, twin) : undefined;+ if (guessed.d && cab && cab.kind === twin && Math.abs(cab.w - w) < 60) d = cab.d;} 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]);@@ -397,11 +402,11 @@ export function classify(f: Fact, hints: Hints): Verdict {if (shape.cols === 2) x.cols = 2;if (hint?.x.plinth) x.plinth = true;}- if (kind === "wardrobe" && multi && w > 100) return { skip: "several wardrobe frames" };+ if ((kind === "wardrobe" || kind === "sliding") && multi && w > 100) return { skip: "several wardrobe frames" };if (kind === "wardrobe" && x.doors === 0 && hint?.x.shelves) x.shelves = hint.x.shelves;if ((kind === "cabinet" || kind === "bookcase") && multi && w > 100) return { skip: "several units side by side" };// a combination this wide is more than one frame, which one carcass can't show- if (f.spr && w > 125 && ["bookcase", "open", "cabinet", "wardrobe", "shoe", "wallcab", "wallshelf", "kitchen"].includes(kind)) return { skip: "several units side by side" };+ if (f.spr && w > 125 && ["bookcase", "open", "cabinet", "wardrobe", "shoe", "wallcab", "wallshelf", "kitchen", "sliding", "slidecab"].includes(kind)) return { skip: "several units side by side" };if (kind === "tv" && f.spr && w > 200) return { skip: "several units side by side" };if (kind === "tv" && h > 100) return { skip: "TV storage wall" };if (kind === "shoe" && x.c === undefined) x.c = h < 60 ? 1 : h < 115 ? 2 : 3;diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.jsonindex d825185..2ae04e6 100644--- a/scripts/ikea/slugs.json+++ b/scripts/ikea/slugs.json@@ -22,6 +22,7 @@"ÄNGSJÖN|Wall cabinet with door, 40 × 15 × 95 cm": "angsjon-wall-cabinet-door-40-x-15-x-95","ANKARUDDEN|Chest of 4 drawers, 80 × 48 × 107 cm": "ankarudden-chest-4-drawers-80-x-48-x-107","ANKARUDDEN|Chest of 6 drawers, 139 × 48 × 87 cm": "ankarudden-chest-6-drawers-139-x-48-x-87",+ "ANKARUDDEN|Wardrobe with sliding doors, 98 × 60 × 190 cm": "ankarudden-wardrobe-sliding-doors-98-x-60-x-190","ÄPPLARYD|2-seat sofa": "applaryd-2-seat-sofa","ÄPPLARYD|3-seat sofa": "applaryd-3-seat-sofa","ÄPPLARYD|3-seat sofa with chaise longue": "applaryd-3-seat-sofa-chaise-longue",@@ -217,6 +218,7 @@"FRYKSÅS|Desk, 110 × 54 cm": "fryksas-desk-110-x-54","FRYKSÅS|TV bench, 157 × 41 × 49 cm": "fryksas-tv-bench-157-x-41-x-49","GALANT|Cabinet with doors, 80 × 120 cm": "galant-cabinet-doors-80-x-120",+ "GALANT|Cabinet with sliding doors, 160 × 120 cm": "galant-cabinet-sliding-doors-160-x-120","GALANT|Drawer unit on castors, 45 × 55 cm": "galant-drawer-unit-on-castors-45-x-55","GALANT|Drawer unit, 80 × 80 cm": "galant-drawer-unit-80-x-80","GARNANÄS|Coffee table, 65 × 65 cm": "garnanas-coffee-table-65-x-65",@@ -224,6 +226,7 @@"GILLERSBERG|Bedside table, 39 × 39 × 56 cm": "gillersberg-bedside-table-39-x-39-x-56","GLADHÖJDEN|Desk sit/stand, 100 × 60 cm": "gladhojden-desk-sit-stand-100-x-60","GLADSTAD|Upholstered bed frame, Standard King, 150 × 200 cm": "gladstad-upholstered-bed-frame-standard-king-150",+ "GLAMBERGET|Wardrobe with 3 sliding doors, 117 × 63 × 150 cm": "glamberget-wardrobe-3-sliding-doors-117-x-63-x-1","GLENN|Bar stool, 66 cm": "glenn-bar-stool-66","GLOSTAD|3-seat sofa": "glostad-3-seat-sofa","GLOSTAD|3-seat sofa with chaise longue": "glostad-3-seat-sofa-chaise-longue",@@ -282,6 +285,7 @@"HAUGA|Sideboard, 140 × 46 × 84 cm": "hauga-sideboard-140-x-46-x-84","HAUGA|Table, 118 × 74 cm": "hauga-table-118-x-74","HAUGA|TV bench, 206 × 46 × 54 cm": "hauga-tv-bench-206-x-46-x-54",+ "HAUGA|Wardrobe with sliding doors, 118 × 55 × 199 cm": "hauga-wardrobe-sliding-doors-118-x-55-x-199","HAVBÄCK|High cabinet with door, 40 × 35 × 195 cm": "havback-high-cabinet-door-40-x-35-x-195","HAVBÄCK|Wall cabinet with door, 40 × 15 × 95 cm": "havback-wall-cabinet-door-40-x-15-x-95","HAVSTA|Cabinet with plinth, 81 × 37 × 134 cm": "havsta-cabinet-plinth-81-x-37-x-134",@@ -350,6 +354,7 @@"INVALLNING|Trolley, 68 × 39 cm": "invallning-trolley-68-x-39","ISMANTORP|Armchair": "ismantorp-armchair","IVAR|Cabinet with doors, 89 × 30 × 124 cm": "ivar-cabinet-doors-89-x-30-x-124",+ "IVAR|Cabinet with sliding doors, 80 × 30 × 60 cm": "ivar-cabinet-sliding-doors-80-x-30-x-60","IVAR|Shelving unit with doors, 89 × 30 × 124 cm": "ivar-shelving-unit-doors-89-x-30-x-124","IVAR|Shelving unit with doors, 89 × 30 × 179 cm": "ivar-shelving-unit-doors-89-x-30-x-179","IVAR|Shelving unit, 80 × 30 × 166 cm": "ivar-shelving-unit-80-x-30-x-166",@@ -412,6 +417,7 @@"KLACKENÄS|Sideboard, 120 × 97 cm": "klackenas-sideboard-120-x-97","KLEPPSTAD|Bed frame, Standard Double, 135 × 190 cm": "kleppstad-bed-frame-standard-double-135-x-190","KLEPPSTAD|Wardrobe with 3 doors, 117 × 55 × 176 cm": "kleppstad-wardrobe-3-doors-117-x-55-x-176",+ "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|High cabinet with door, 60 × 31 × 153 cm": "knoxhult-high-cabinet-door-60-x-31-x-153",@@ -714,6 +720,7 @@"RÅGRUND|Shelving unit, 37 × 37 × 104 cm": "ragrund-shelving-unit-37-x-37-x-104","RÅGRUND|Trolley, 42 × 33 × 76 cm": "ragrund-trolley-42-x-33-x-76","RAKKESTAD|Wardrobe with 3 doors, 117 × 176 cm": "rakkestad-wardrobe-3-doors-117-x-176",+ "RAKKESTAD|Wardrobe with sliding doors, 117 × 176 cm": "rakkestad-wardrobe-sliding-doors-117-x-176","RAMNEFJÄLL|Upholstered bed frame, Standard Double, 135 × 190 cm": "ramnefjall-upholstered-bed-frame-standard-double","RAMNEFJÄLL|Upholstered bed frame, Standard Single, 90 × 190 cm": "ramnefjall-upholstered-bed-frame-standard-single","RÅSKOG|Trolley, 28 × 38 × 61 cm": "raskog-trolley-28-x-38-x-61",@@ -846,6 +853,7 @@"STOCKHOLM 2025|4-seat sofa": "stockholm-2025-4-seat-sofa","STOCKHOLM 2025|Armchair": "stockholm-2025-armchair","STOCKHOLM 2025|Cabinet with 2 doors, 80 × 40 × 126 cm": "stockholm-2025-cabinet-2-doors-80-x-40-x-126",+ "STOCKHOLM 2025|Cabinet with sliding doors, 125 × 47 × 110 cm": "stockholm-2025-cabinet-sliding-doors-125-x-47-x","STOCKHOLM 2025|Chair": "stockholm-2025-chair","STOCKHOLM 2025|Coffee table, 160 × 45 cm": "stockholm-2025-coffee-table-160-x-45","STOCKHOLM 2025|Easy chair": "stockholm-2025-easy-chair",@@ -919,6 +927,12 @@"TONSTAD|Bookcase, 82 × 37 × 201 cm": "tonstad-bookcase-82-x-37-x-201","TONSTAD|Cabinet with doors, 81 × 47 × 91 cm": "tonstad-cabinet-doors-81-x-47-x-91","TONSTAD|Cabinet with doors, 82 × 47 × 90 cm": "tonstad-cabinet-doors-82-x-47-x-90",+ "TONSTAD|Cabinet with sliding doors, 81 × 37 × 116 cm": "tonstad-cabinet-sliding-doors-81-x-37-x-116",+ "TONSTAD|Cabinet with sliding doors, 82 × 37 × 120 cm": "tonstad-cabinet-sliding-doors-82-x-37-x-120",+ "TONSTAD|Cabinet with sliding glass doors, 120 × 37 × 116 cm": "tonstad-cabinet-sliding-glass-doors-120-x-37-x-1",+ "TONSTAD|Cabinet with sliding glass doors, 121 × 37 × 120 cm": "tonstad-cabinet-sliding-glass-doors-121-x-37-x-1",+ "TONSTAD|Cabinet with sliding glass doors, 81 × 37 × 116 cm": "tonstad-cabinet-sliding-glass-doors-81-x-37-x-11",+ "TONSTAD|Cabinet with sliding glass doors, 82 × 37 × 120 cm": "tonstad-cabinet-sliding-glass-doors-82-x-37-x-12","TONSTAD|Chair": "tonstad-chair","TONSTAD|Chest of 4 drawers, 82 × 47 × 90 cm": "tonstad-chest-4-drawers-82-x-47-x-90","TONSTAD|Chest of 4 drawers, 82 × 47 × 91 cm": "tonstad-chest-4-drawers-82-x-47-x-91",@@ -963,6 +977,9 @@"TROFAST|Frame, 99 × 44 × 56 cm": "trofast-frame-99-x-44-x-56","TROTTEN|Cabinet with doors, 70 × 35 × 110 cm": "trotten-cabinet-doors-70-x-35-x-110","TROTTEN|Cabinet with doors, 70 × 35 × 173 cm": "trotten-cabinet-doors-70-x-35-x-173",+ "TROTTEN|Cabinet with sliding doors, 80 × 55 × 110 cm": "trotten-cabinet-sliding-doors-80-x-55-x-110",+ "TROTTEN|Cabinet with sliding doors, 80 × 55 × 180 cm": "trotten-cabinet-sliding-doors-80-x-55-x-180",+ "TROTTEN|Cabinet with sliding doors, 80 × 55 × 75 cm": "trotten-cabinet-sliding-doors-80-x-55-x-75","TROTTEN|Desk sit/stand, 160 × 80 cm": "trotten-desk-sit-stand-160-x-80","TROTTEN|Desk, 160 × 80 cm": "trotten-desk-160-x-80","TROTTEN|Drawer unit, 34 × 56 cm": "trotten-drawer-unit-34-x-56",@@ -1013,6 +1030,8 @@"VIHALS|Bed frame, Standard Double, 135 × 190 cm": "vihals-bed-frame-standard-double-135-x-190","VIHALS|Bed frame, Standard Single, 90 × 190 cm": "vihals-bed-frame-standard-single-90-x-190","VIHALS|Bedside table, 37 × 37 cm": "vihals-bedside-table-37-x-37",+ "VIHALS|Cabinet with sliding doors, 95 × 47 × 90 cm": "vihals-cabinet-sliding-doors-95-x-47-x-90",+ "VIHALS|Cabinet with sliding glass doors, 95 × 37 × 90 cm": "vihals-cabinet-sliding-glass-doors-95-x-37-x-90","VIHALS|Chair": "vihals-chair","VIHALS|Chest of 4 drawers, 70 × 47 × 90 cm": "vihals-chest-4-drawers-70-x-47-x-90","VIHALS|Chest of 6 drawers, 140 × 47 × 75 cm": "vihals-chest-6-drawers-140-x-47-x-75",diff --git a/src/components/art/Hardware.tsx b/src/components/art/Hardware.tsxindex 24f9771..15cb4b6 100644--- a/src/components/art/Hardware.tsx+++ b/src/components/art/Hardware.tsx@@ -265,6 +265,24 @@ function draw(kind: HwKind, len: number, dia: number): Drawn {</g>),};+ case "roller":+ // a plate with two screw holes, an arm, and the wheel on top+ return {+ w: len,+ h: dia + 26,+ scalable: true,+ node: (+ <g transform={`translate(0 ${(dia + 26) / 2 - 4})`}>+ <rect x={len / 2 - 4} y={-22} width={8} height={20} rx={2} fill={METAL} {...stroke} />+ <circle cx={len / 2} cy={-22 - dia / 2 + 4} r={dia / 2} fill={PLASTIC} {...stroke} />+ <circle cx={len / 2} cy={-22 - dia / 2 + 4} r={3} fill="#fff" {...stroke} />+ <rect x={0} y={-3} width={len} height={7} rx={2} fill={METAL} {...stroke} />+ {[len * 0.18, len * 0.82].map((x) => (+ <circle key={x} cx={x} cy={0.5} r={1.6} fill="#fff" {...stroke} />+ ))}+ </g>+ ),+ };case "connector":// a flat strip with a screw hole at each endreturn {diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.tsindex 81fe386..d39c9dd 100644--- a/src/data/ikea-items.ts+++ b/src/data/ikea-items.ts@@ -24,6 +24,7 @@ angsjon-high-cabinet-door-40-x-35-x-195|80535079 40535081 60535080angsjon-wall-cabinet-door-40-x-15-x-95|20535077 00535078 40535076ankarudden-chest-4-drawers-80-x-48-x-107|80627149ankarudden-chest-6-drawers-139-x-48-x-87|20627147+ankarudden-wardrobe-sliding-doors-98-x-60-x-190|50626250applaryd-2-seat-sofa|00506231 20575073 60506233 60575066applaryd-3-seat-sofa|80506246 10506235 20575087 30575077applaryd-3-seat-sofa-chaise-longue|79418057 89418066 79528174 79528169@@ -241,6 +242,7 @@ fryksas-cabinet-81-x-124|40574096fryksas-desk-110-x-54|60574104fryksas-tv-bench-157-x-41-x-49|80574099galant-cabinet-doors-80-x-120|10365141 50365139+galant-cabinet-sliding-doors-160-x-120|30365135 20365131galant-drawer-unit-80-x-80|90365161 30365159galant-drawer-unit-on-castors-45-x-55|10365155 60365153garnanas-coffee-table-65-x-65|00556508@@ -248,6 +250,7 @@ gavle-easy-chair|80588845 50588842gillersberg-bedside-table-39-x-39-x-56|30608983gladhojden-desk-sit-stand-100-x-60|30493939gladstad-upholstered-bed-frame-standard-king-150|40490469 60490468+glamberget-wardrobe-3-sliding-doors-117-x-63-x-1|20564512glenn-bar-stool-66|60131734glostad-2-seat-sofa|90489010glostad-3-seat-sofa|80595940@@ -310,6 +313,7 @@ hauga-sideboard-140-x-46-x-84|40621489 60621488hauga-table-118-x-74|00576709 50576716hauga-tv-bench-206-x-46-x-54|80593385 50593382hauga-wardrobe-70-x-199|20415046 60415054+hauga-wardrobe-sliding-doors-118-x-55-x-199|60456916 60407271havback-high-cabinet-door-40-x-35-x-195|40535000 20535063 40535062havback-wall-cabinet-door-40-x-15-x-95|60535056 40534996 40535057havsta-cabinet-doors-81-x-123|50529249 30529245 60529263 40529259 00529261@@ -392,6 +396,7 @@ invallning-trolley-68-x-39|10569398ismantorp-armchair|60598218 10598225ivar-cabinet-doors-80-x-83|50531252 00531240 40033763 70033766ivar-cabinet-doors-89-x-30-x-124|69508162 49508158+ivar-cabinet-sliding-doors-80-x-30-x-60|00494394ivar-shelving-unit-80-x-30-x-166|69562823ivar-shelving-unit-80-x-30-x-83|00522330ivar-shelving-unit-89-x-179|49590577 99572571@@ -463,6 +468,7 @@ klackenas-sideboard-120-x-97|90506750kleppstad-bed-frame-standard-double-135-x-190|40492675 20492681kleppstad-wardrobe-2-doors-79-x-176|80437234kleppstad-wardrobe-3-doors-117-x-55-x-176|00441758+kleppstad-wardrobe-sliding-doors-117-x-55-x-176|90437238klippan-2-seat-sofa|49625204 89246862 89561667 90399316klippuggla-bed-frame-storage-90-x-200|19627346 09627827knarrevik-bedside-table-37-x-28-x-45|00576318 20569977@@ -790,6 +796,7 @@ ragrund-shelving-unit-37-x-37-x-104|80549420ragrund-trolley-42-x-33-x-76|20549418rakkestad-wardrobe-2-doors-79-x-176|50453758rakkestad-wardrobe-3-doors-117-x-176|70453762+rakkestad-wardrobe-sliding-doors-117-x-176|60453767ramnefjall-upholstered-bed-frame-standard-double|49560212 79560215 09560266 89627263 69627264 69560268 69627221ramnefjall-upholstered-bed-frame-standard-single|59560216 09560271raskog-trolley-28-x-38-x-61|00586789 50591769 10637203 20629716 80586790 00629717 40629715@@ -928,6 +935,7 @@ stockholm-2025-3-seat-sofa|99574297 29574291 09574305 20586095stockholm-2025-4-seat-sofa|59574322 59574317 09574310stockholm-2025-armchair|10594755 09578266stockholm-2025-cabinet-2-doors-80-x-40-x-126|90586488 10586487 10586492+stockholm-2025-cabinet-sliding-doors-125-x-47-x|70586639stockholm-2025-chair|40593783 80593781 20590139 40590138 90593785stockholm-2025-coffee-table-160-x-45|50594763stockholm-2025-easy-chair|80594785@@ -1004,6 +1012,12 @@ tonstad-bookcase-81-x-37-x-201|10528464tonstad-bookcase-82-x-37-x-201|70528461tonstad-cabinet-doors-81-x-47-x-91|90488713tonstad-cabinet-doors-82-x-47-x-90|00489236+tonstad-cabinet-sliding-doors-81-x-37-x-116|30488886+tonstad-cabinet-sliding-doors-82-x-37-x-120|10489231+tonstad-cabinet-sliding-glass-doors-120-x-37-x-1|20488896+tonstad-cabinet-sliding-glass-doors-121-x-37-x-1|20489278+tonstad-cabinet-sliding-glass-doors-81-x-37-x-11|40488895+tonstad-cabinet-sliding-glass-doors-82-x-37-x-12|00489284tonstad-chair|69599685 59599657 89602173 39599682 29599654 49602170 09599688 79599661 19602176 80594035 10594029 20594038tonstad-chest-4-drawers-82-x-47-x-90|60614614 30614615tonstad-chest-4-drawers-82-x-47-x-91|70614618@@ -1050,6 +1064,9 @@ trofast-storage-frame-99-x-94|10091453 10615395trones-shoe-cabinet-52-x-39|00397307 80397313trotten-cabinet-doors-70-x-35-x-110|80623962trotten-cabinet-doors-70-x-35-x-173|40474836 30474766+trotten-cabinet-sliding-doors-80-x-55-x-110|20474837 60474760+trotten-cabinet-sliding-doors-80-x-55-x-180|80474759 80474839+trotten-cabinet-sliding-doors-80-x-55-x-75|00474838 40474761trotten-desk-120-x-70|49621885 09621873 59621917 19621919trotten-desk-160-x-80|79621921trotten-desk-sit-stand-160-x-80|59621899@@ -1101,6 +1118,8 @@ vihals-bed-frame-4-storage-boxes-standard-double|69582005 49582006vihals-bed-frame-standard-double-135-x-190|39581842 59581841vihals-bed-frame-standard-single-90-x-190|30602429 89581854vihals-bedside-table-37-x-37|80488737+vihals-cabinet-sliding-doors-95-x-47-x-90|20483262+vihals-cabinet-sliding-glass-doors-95-x-37-x-90|80542876vihals-chair|10595123 60595125 50569103vihals-chest-4-drawers-70-x-47-x-90|00483239vihals-chest-6-drawers-140-x-47-x-75|80490113diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.tsindex e4c7684..dfcab81 100644--- a/src/data/ikea-rows.ts+++ b/src/data/ikea-rows.ts@@ -23,6 +23,7 @@ ALEX|open|Storage unit, 36 × 70 cm|36|70|35ÄNGSJÖN|wallcab|Wall cabinet with door, 40 × 15 × 95 cm|40|95|15|doors=1ANKARUDDEN|chest|Chest of 4 drawers, 80 × 48 × 107 cm|80|107|48|rows=4ANKARUDDEN|chest|Chest of 6 drawers, 139 × 48 × 87 cm|139|87|48|rows=3,cols=2+ANKARUDDEN|sliding|Wardrobe with sliding doors, 98 × 60 × 190 cm|98|190|60|slides=2ÄPPLARYD|chaise|3-seat sofa with chaise longue|226|85|160|seats=3,arms=wide,chaise=right,sd=92ÄPPLARYD|chaise|4-seat sofa with chaise longue|290|85|160|seats=4,arms=wide,chaise=right,sd=92ÄPPLARYD|sofa|2-seat sofa|170|85|92|seats=2@@ -220,11 +221,13 @@ FRYKSÅS|tv|TV bench, 157 × 41 × 49 cm|157|49|41GALANT|cabinet|Cabinet with doors, 80 × 120 cm|80|120|40GALANT|chest|Drawer unit on castors, 45 × 55 cm|45|55|48|rows=4GALANT|chest|Drawer unit, 80 × 80 cm|80|80|48|rows=6+GALANT|slidecab|Cabinet with sliding doors, 160 × 120 cm|160|120|45|slides=2GARNANÄS|coffee|Coffee table, 65 × 65 cm|65|45|65GÄVLE|armchair|Easy chair|75|90|80GILLERSBERG|nightstand|Bedside table, 39 × 39 × 56 cm|39|56|39|rows=1GLADHÖJDEN|desk|Desk sit/stand, 100 × 60 cm|100|74|60GLADSTAD|bed|Upholstered bed frame, Standard King, 150 × 200 cm|166|100|209|m=150+GLAMBERGET|sliding|Wardrobe with 3 sliding doors, 117 × 63 × 150 cm|117|150|63|slides=3GLENN|stool|Bar stool, 66 cm|35|66|35GLOSTAD|chaise|3-seat sofa with chaise longue|201|78|150|seats=3,arms=wide,chaise=right,sd=82GLOSTAD|sofa|3-seat sofa|230|85|92|seats=3@@ -282,6 +285,7 @@ HAUGA|dining|Table, 118 × 74 cm|118|74|74HAUGA|dropleaf|Drop-leaf table, 55/82/109 × 74 cm|109|75|74|leaves=2,leaf=27HAUGA|nightstand|Bedside table, 40 × 36 cm|40|55|36|rows=1,knobs=barHAUGA|sideboard|Sideboard, 140 × 46 × 84 cm|140|84|46|knobs=bar+HAUGA|sliding|Wardrobe with sliding doors, 118 × 55 × 199 cm|118|199|55|slides=2HAUGA|tv|TV bench, 206 × 46 × 54 cm|206|54|46|knobs=barHAVBÄCK|cabinet|High cabinet with door, 40 × 35 × 195 cm|40|195|35|doors=1HAVBÄCK|wallcab|Wall cabinet with door, 40 × 15 × 95 cm|40|95|15|doors=1@@ -359,6 +363,7 @@ IVAR|open|Shelving unit, 89 × 30 × 124 cm|89|124|30IVAR|open|Shelving unit, 89 × 50 × 179 cm|89|179|50IVAR|open|Shelving unit, 89 × 30 × 226 cm|89|226|30IVAR|open|Shelving unit, 89 × 50 × 226 cm|89|226|50+IVAR|slidecab|Cabinet with sliding doors, 80 × 30 × 60 cm|80|60|30|slides=2IVÖSJÖN|cabinet|Cabinet with doors, 33 × 34 × 99 cm|33|99|34JAKOBSFORS|coffee|Coffee table, 80 cm|80|45|80|round=1JÄRVFJÄLLET|office|Office chair with armrests|64|105|64|arms=slim@@ -412,6 +417,7 @@ KIVIK|sofa|2-seat sofa|170|85|92|seats=2KIVIK|sofa|4-seat sofa|290|85|92|seats=4KLACKENÄS|sideboard|Sideboard, 120 × 97 cm|120|97|45KLEPPSTAD|bed|Bed frame, Standard Double, 135 × 190 cm|151|96|199|m=135,l=190+KLEPPSTAD|sliding|Wardrobe with sliding doors, 117 × 55 × 176 cm|117|176|55|slides=2KLEPPSTAD|wardrobe|Wardrobe with 3 doors, 117 × 55 × 176 cm|117|176|55|doors=2KLIPPUGGLA|bed|Bed frame with storage, 90 × 200 cm|106|100|209|m=90KNARREVIK|nightstand|Bedside table, 37 × 28 × 45 cm|37|45|28|rows=1@@ -714,6 +720,7 @@ RAGGBERG|bench|Bench with shoe storage, 60 × 35 × 45 cm|60|45|35RÅGRUND|bench|Bench, 78 × 37 cm|78|45|37RÅGRUND|open|Shelving unit, 37 × 37 × 104 cm|37|104|37RÅGRUND|trolley|Trolley, 42 × 33 × 76 cm|42|76|33+RAKKESTAD|sliding|Wardrobe with sliding doors, 117 × 176 cm|117|176|51|slides=2RAKKESTAD|wardrobe|Wardrobe with 3 doors, 117 × 176 cm|117|176|51|doors=2RAMNEFJÄLL|bed|Upholstered bed frame, Standard Single, 90 × 190 cm|106|100|199|m=90,l=190RAMNEFJÄLL|bed|Upholstered bed frame, Standard Double, 135 × 190 cm|151|100|199|m=135,l=190@@ -855,6 +862,7 @@ STOCKHOLM 2025|open|Shelving unit, 120 × 40 × 188 cm|120|188|40STOCKHOLM 2025|side|Side table, 40 cm|40|50|40|round=1STOCKHOLM 2025|side|Side table, 55 cm|55|50|55|round=1STOCKHOLM 2025|sideboard|Sideboard, 161 × 42 × 83 cm|161|83|42+STOCKHOLM 2025|slidecab|Cabinet with sliding doors, 125 × 47 × 110 cm|125|110|47|slides=2STOCKHOLM 2025|sofa|2-seat sofa|170|85|92|seats=2STOCKHOLM 2025|sofa|3-seat sofa|230|85|92|seats=3STOCKHOLM 2025|sofa|4-seat sofa|290|85|92|seats=4@@ -939,6 +947,12 @@ TONSTAD|open|Shelving unit, 121 × 37 × 120 cm|121|120|37TONSTAD|side|Side table, 64 × 40 cm|64|50|40TONSTAD|sideboard|Sideboard, 120 × 47 × 91 cm|120|91|47TONSTAD|sideboard|Sideboard, 121 × 47 × 90 cm|121|90|47+TONSTAD|slidecab|Cabinet with sliding doors, 81 × 37 × 116 cm|81|116|37|slides=2+TONSTAD|slidecab|Cabinet with sliding glass doors, 81 × 37 × 116 cm|81|116|37|slides=2+TONSTAD|slidecab|Cabinet with sliding doors, 82 × 37 × 120 cm|82|120|37|slides=2+TONSTAD|slidecab|Cabinet with sliding glass doors, 82 × 37 × 120 cm|82|120|37|slides=2+TONSTAD|slidecab|Cabinet with sliding glass doors, 120 × 37 × 116 cm|120|116|37|slides=2+TONSTAD|slidecab|Cabinet with sliding glass doors, 121 × 37 × 120 cm|121|120|37|slides=2TONSTAD|tv|TV bench, 177 × 37 × 56 cm|177|56|37TONSTAD|tv|TV bench, 178 × 37 × 55 cm|178|55|37TORALD|desk|Desk, 65 × 40 cm|65|74|40@@ -967,6 +981,9 @@ TROTTEN|cabinet|Cabinet with doors, 70 × 35 × 173 cm|70|173|35TROTTEN|chest|Drawer unit, 34 × 56 cm|34|56|48|rows=4TROTTEN|desk|Desk sit/stand, 160 × 80 cm|160|75|80|legs=square,attach=apronTROTTEN|desk|Desk, 160 × 80 cm|160|75|80|legs=square,attach=apron+TROTTEN|slidecab|Cabinet with sliding doors, 80 × 55 × 75 cm|80|75|55|slides=2+TROTTEN|slidecab|Cabinet with sliding doors, 80 × 55 × 110 cm|80|110|55|slides=2+TROTTEN|slidecab|Cabinet with sliding doors, 80 × 55 × 180 cm|80|180|55|slides=2TUFFING|bunk|Bunk bed frame, 90 × 200 cm|211|160|100|m=90TUFFING|loft|Loft bed frame, 90 × 200 cm|211|195|100|m=90TUFJORD|bed|Upholstered bed frame, Standard King, 150 × 200 cm|166|100|209|m=150@@ -1034,6 +1051,8 @@ VIHALS|open|Shelving unit with 4 shelves, 95 × 37 × 90 cm|95|90|37|shelves=2VIHALS|open|Shelving unit with 10 shelves, 95 × 37 × 200 cm|95|200|37|shelves=6VIHALS|open|Storage unit, 105 × 37 × 140 cm|105|140|37VIHALS|sideboard|Sideboard, 140 × 37 × 75 cm|140|75|37+VIHALS|slidecab|Cabinet with sliding glass doors, 95 × 37 × 90 cm|95|90|37|slides=2+VIHALS|slidecab|Cabinet with sliding doors, 95 × 47 × 90 cm|95|90|47|slides=2VIHALS|tv|TV bench, 146 × 37 × 50 cm|146|50|37VIHALS|tv|TV bench, 176 × 37 × 50 cm|176|50|37VIHALS|wardrobe|Wardrobe with 2 doors, 105 × 57 × 200 cm|105|200|57|doors=2diff --git a/src/engine/drawable.ts b/src/engine/drawable.tsindex 22b88f6..4dde083 100644--- a/src/engine/drawable.ts+++ b/src/engine/drawable.ts@@ -259,6 +259,12 @@ export function hwDrawable(kind: HwKind, len: number, dia: number) {addSolid(d, `ca:wheel:${dia}`, () => new THREE.CylinderGeometry(r, r, dia * 0.26, 24).rotateZ(Math.PI / 2), plastic, { hull: "radial", position: [x * dia * 0.21, len - r, -dia * 0.16] });break;}+ case "roller":+ // a sliding door's roller: a plate screwed to the door's edge, an arm, and a wheel that runs in the track+ addSolid(d, `ro:plate:${len}`, () => new THREE.BoxGeometry(len, 3, 14), metal, { position: [0, 1.5, 0] });+ addSolid(d, "ro:arm", () => new THREE.BoxGeometry(8, len * 0.45, 8), metal, { position: [0, 3 + len * 0.22, 0] });+ addSolid(d, `ro:wheel:${dia}`, () => new THREE.CylinderGeometry(r, r, 7, 22).rotateX(Math.PI / 2), plastic, { hull: "radial", position: [0, 3 + len * 0.45 + r * 0.4, 0] });+ break;case "connector":// a flat strip screwed across the joint between two sofa sectionsaddSolid(d, `cn:${len}:${dia}`, () => new THREE.BoxGeometry(len, 2, dia), metal, { position: [0, 1, 0] });diff --git a/src/lib/ikea.ts b/src/lib/ikea.tsindex f301485..e557608 100644--- a/src/lib/ikea.ts+++ b/src/lib/ikea.ts@@ -23,7 +23,7 @@ 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"] 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"] as const;const FLAGS = new Set<string>(["plinth", "shelf", "round", "open", "drawer", "dtop", "rail"]);const WORDS = new Set<string>(["knobs", "arms", "legs", "attach", "chaise", "corner", "under"]);diff --git a/src/lib/plan/builder.ts b/src/lib/plan/builder.tsindex 5f23881..2a1f276 100644--- a/src/lib/plan/builder.ts+++ b/src/lib/plan/builder.ts@@ -51,6 +51,7 @@ export const HW = {castor: { kind: "castor", len: 58, dia: 50 },gasLift: { kind: "gasLift", len: 200, dia: 50 },connector: { kind: "connector", len: 120, dia: 30 },+ roller: { kind: "roller", len: 44, dia: 26 },} satisfies Record<string, HwDef>;const HW_NAMES: Record<HwKind, string> = {@@ -73,6 +74,7 @@ const HW_NAMES: Record<HwKind, string> = {castor: "Castor",gasLift: "Gas lift",connector: "Connector",+ roller: "Door roller",};export function hwSpecText(kind: HwKind, len: number, dia: number) {diff --git a/src/lib/plan/cabinet.ts b/src/lib/plan/cabinet.tsindex e8e21d2..b27b390 100644--- a/src/lib/plan/cabinet.ts+++ b/src/lib/plan/cabinet.ts@@ -3,6 +3,7 @@ import { HW, PlanBuilder, type FitOpts } from "./builder";import { FrameKit } from "./frame";import { clamp } from "./math";import { buildMixed } from "./mixed";+import { buildSliding } from "./sliding";export function defaultsCabinet(s: ProductSpec): CabinetParams {const p = s.cabinet ?? {};@@ -21,6 +22,7 @@ export function defaultsCabinet(s: ProductSpec): CabinetParams {export function buildCabinet(b: PlanBuilder, s: ProductSpec) {if (s.cabinet?.drawers) return buildMixed(b, s);+ if (s.cabinet?.fronts === "sliding") return buildSliding(b, s);const p = defaultsCabinet(s);if (p.fronts === "tilt") return tiltCabinet(b, s, p);const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;diff --git a/src/lib/plan/sliding.ts b/src/lib/plan/sliding.tsnew file mode 100644index 0000000..42fb489--- /dev/null+++ b/src/lib/plan/sliding.ts@@ -0,0 +1,182 @@+import type { ProductSpec, Vec3 } from "../types";+import { HW, PlanBuilder, type FitOpts } from "./builder";+import { FrameKit } from "./frame";+import { clamp } from "./math";++/**+ * Wardrobes and cabinets with sliding doors: the usual carcass, a track under the top and one on the bottom,+ * and two or three doors on rollers that run in the two lanes of the tracks, so they pass each other.+ * The back door goes in first, lifted into the top track and lowered into the bottom one.+ */+export function buildSliding(b: PlanBuilder, s: ProductSpec) {+ const c = s.cabinet ?? {};+ 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 plinth = c.plinth ?? s.size.h > 120;+ const base = plinth ? 70 : 0;+ const lying = H > 1100;+ const n = clamp(Math.round(c.slides ?? 2), 2, 3);+ const f = new FrameKit(b, { W, H, D, t, base, plinth, fixed: [], back: true, pinRows: false, lying });+ const inner = W - 2 * t;++ /* ---------- tracks and doors ---------- */+ const trackD = 56, trackZ = D / 2 - trackD / 2 - 2;+ const lanes = [D / 2 - 44, D / 2 - 16]; // back lane, front lane: door centres+ const topY = H - t, botY = base + t; // undersides of the top, top of the bottom panel+ const topT = b.part("Top track", [inner, 24, trackD], { material: "metal" });+ const botT = b.part("Bottom track", [inner, 10, trackD], { material: "metal" });+ const topTrack = b.place(topT, [0, topY - 12, trackZ]);+ const botTrack = b.place(botT, [0, botY + 5, trackZ]);+ const ov = 40; // the doors overlap where they meet+ const dW = (inner + (n - 1) * ov) / n, dT = 16;+ const dLo = botY + 10 + 4, dHi = topY - 24 - 4;+ const dH = dHi - dLo;+ const doorT = b.part("Sliding door", [dW, dH, dT]);+ // two doors: the left one at the back; three: the outer two at the back, the middle one in front+ const doors = Array.from({ length: n }, (_, i) => {+ const lane = n === 2 ? i : i === 1 ? 1 : 0;+ return { lane, x: -inner / 2 + dW / 2 + i * (dW - ov), key: b.place(doorT, [-inner / 2 + dW / 2 + i * (dW - ov), dLo + dH / 2, lanes[lane]]) };+ });+ const back = doors.filter((d) => d.lane === 0), front = doors.filter((d) => d.lane === 1);++ /* ---------- steps: the carcass ---------- */+ f.prepSides();+ f.join();+ f.otherSide();+ f.cams();+ f.plinthStep();+ f.backSteps();+ f.standUp();++ // shelves sit behind the tracks, so they're a little shallower than the carcass+ const shD = D - 26 - trackD, shZ = -D / 2 + 13 + shD / 2;+ const rail = !!c.rail;+ const nSh = clamp(Math.round(c.shelves ?? 1), 0, 4);+ const shelfYs: number[] = rail ? [topY - 320] : Array.from({ length: nSh }, (_, i) => Math.round((botY + ((topY - botY) * (i + 1)) / (nSh + 1)) / 32) * 32);+ if (shelfYs.length) {+ const shT = b.part("Shelf", [inner - 3, t, shD]);+ const shelves = shelfYs.map((y) => b.place(shT, [0, y + 3 + t / 2, shZ]));+ const zs = [shZ + shD / 2 - 30, shZ - shD / 2 + 30];+ for (const y0 of shelfYs)+ for (const dy of [-64, 0, 64])+ for (const [i, side] of f.sides.entries()) for (const z of zs) b.hole(side, [i === 0 ? -W / 2 + t : W / 2 - t, y0 + dy, z], [i === 0 ? 1 : -1, 0, 0], 2.5);+ b.step(+ {+ title: shelves.length > 1 ? "Add the shelf pins and shelves" : rail ? "Add the shelf pins and the top shelf" : "Add the shelf pins and the shelf",+ detail: "Pick any height you like. Use the same hole on all four corners.",+ kind: "shelves",+ },+ () => {+ const pins: FitOpts[] = [];+ for (const y of shelfYs)+ for (const [i, sd] of f.sides.entries()) for (const z of zs) pins.push({ on: sd, at: [i === 0 ? -W / 2 + t : W / 2 - t, y, z], dir: [i === 0 ? -1 : 1, 0, 0], hole: false });+ b.fits(HW.pin, pins, 0.05);+ b.then(0.2);+ b.stagger(0.25);+ shelves.forEach((k) => b.add(k, [0, 0, 420]));+ },+ );+ }+ if (rail) {+ const rT = b.part("Clothes rail", [24, inner - 2, 24], { shape: "cyl", material: "metal" });+ const ry = shelfYs[0] - 80;+ const railKey = b.place(rT, [0, ry, shZ], [0, 0, Math.PI / 2]);+ b.step(+ {+ title: "Fit the clothes rail",+ detail: "Clip the holders on first, then drop the rail in.",+ tools: ["screwdriver"],+ kind: "screws",+ },+ () => {+ b.fits(+ HW.screwS,+ f.sides.map((sd, i) => ({ on: sd, at: [(i === 0 ? -1 : 1) * (W / 2 - t), ry, shZ] as Vec3, dir: [i === 0 ? -1 : 1, 0, 0] as Vec3, hole: false })),+ 0.1,+ );+ b.then(0.1);+ b.add(railKey, [0, -180, 260]);+ },+ );+ }++ /* ---------- steps: tracks and doors ---------- */+ b.step(+ {+ title: "Screw the tracks under the top and onto the bottom",+ detail: "Push each one against the front edge, then screw it on.",+ tools: ["screwdriver"],+ kind: "screws",+ },+ () => {+ b.add(topTrack, [0, -220, 0]);+ b.add(botTrack, [0, 220, 0]);+ b.then(0.1);+ const xs = [-inner / 2 + 60, 0, inner / 2 - 60];+ const sc: FitOpts[] = [];+ for (const x of xs) {+ sc.push({ on: topTrack, at: [x, topY - 24, trackZ], dir: [0, 1, 0], hole: false });+ sc.push({ on: botTrack, at: [x, botY + 10, trackZ], dir: [0, -1, 0], hole: false });+ }+ b.fits(HW.screwS, sc, 0.06);+ },+ );++ b.step(+ {+ title: "Screw two rollers onto the top of each door",+ detail: "One near each corner, with the wheels upwards.",+ tools: ["screwdriver"],+ scene: "doors",+ kind: "screws",+ warnings: ["floor"],+ },+ () => {+ b.stagger(0.2);+ doors.forEach((d, i) => b.stage(d.key, [(i - (n - 1) / 2) * (dW + 80), dT / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]));+ b.then(0.1);+ const list: FitOpts[] = doors.flatMap((d) => [-1, 1].map((k) => ({ on: d.key, at: [d.x + k * (dW / 2 - 70), dHi, lanes[d.lane]] as Vec3, dir: [0, -1, 0] as Vec3, travel: 40, hole: false as const })));+ b.fits(HW.roller, list, 0.1);+ },+ );++ const tall = dH > 1500;+ const hang = (list: typeof doors, title: string, detail: string) =>+ b.step(+ { title, detail, kind: "doors", people: tall ? 2 : 1, warnings: tall ? ["two"] : [] },+ () => {+ b.stagger(0.4);+ list.forEach((d) => b.add(d.key, [0, 70, 300]));+ },+ );+ hang(back, back.length > 1 ? "Hang the two back doors" : "Hang the back door", "Lift the rollers up into the back of the top track, then lower the door into the bottom track.");+ hang(front, front.length > 1 ? "Hang the front doors" : "Hang the front door", "Same again in the front lane, so it can slide past the other door.");++ // slide a front door across, then back+ const mover = front[0];+ const along = mover.x > 0 ? -1 : 1;+ b.step(+ {+ title: "Slide the doors to check them",+ detail: "Each one should run the full width without catching.",+ kind: "doors",+ weight: 1,+ },+ () => {+ const at = b.partItem(mover.key).final;+ b.stage(mover.key, [at.pos[0] + along * (dW - ov), at.pos[1], at.pos[2]], at.rot);+ },+ );+ b.step(+ {+ title: "Line up the doors",+ detail: "Turn the screw on each roller until the doors hang straight and meet the sides evenly.",+ tools: ["screwdriver"],+ kind: "doors",+ weight: 1,+ },+ () => b.add(mover.key),+ );++ if (H >= 800) f.anchor();+}diff --git a/src/lib/products.ts b/src/lib/products.tsindex 8ce11ed..cd14436 100644--- a/src/lib/products.ts+++ b/src/lib/products.ts@@ -43,7 +43,9 @@ export type Kind =| "loft"| "dropleaf"| "daybed"- | "mixed";+ | "mixed"+ | "sliding"+ | "slidecab";export type X = {rows?: number;@@ -75,6 +77,7 @@ export type X = {mats?: number;dtop?: boolean;rail?: boolean;+ slides?: number;};export type Row = [name: string, kind: Kind, variant: string, w: number, h: number, d: number, x?: X, keywords?: string];@@ -248,7 +251,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,+ office: 20, chaise: 55, corner: 70, cot: 35, bunk: 90, loft: 75, dropleaf: 40, daybed: 60, mixed: 50, sliding: 110, slidecab: 60,};const CATEGORY: Record<Kind, string> = {@@ -257,7 +260,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",+ 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",};export const KIND_ARCH: Record<Kind, Archetype> = {@@ -265,7 +268,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",+ office: "seat", chaise: "sofa", corner: "sofa", cot: "bed", bunk: "bed", loft: "bed", dropleaf: "table", daybed: "bed", mixed: "cabinet", sliding: "cabinet", slidecab: "cabinet",};const round = (x: X) => (x.round ? { round: true } : {});@@ -368,6 +371,12 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:const at = x.dtop ? { drawerAt: "top" as const } : {};return { ...base, category, minutes: x.min ?? MIN.mixed + 20 * rows + (h > 150 ? 30 : 0), people: h > 150 ? 2 : 1, difficulty: 3, cabinet: { doors: x.doors ?? (w > 50 ? 2 : 1), shelves: x.shelves ?? (h > 150 ? 2 : 1), rail: !!x.rail, plinth: x.plinth ?? (h > 100 || !!x.dtop), handles: x.knobs ?? (x.dtop ? "bar" : "knob"), thickness: 18, drawers: rows, ...at } };}+ case "sliding":+ case "slidecab": {+ // x.slides: how many sliding doors; a wardrobe has a top shelf and a clothes rail+ const robe = kind === "sliding";+ return { ...base, people: robe || h > 150 ? 2 : 1, difficulty: robe ? 3 : 2, cabinet: { fronts: "sliding", slides: x.slides ?? 2, doors: 0, shelves: x.shelves ?? (robe ? 1 : h > 150 ? 3 : h > 100 ? 2 : 1), rail: robe, plinth: x.plinth ?? h > 120, handles: "none", thickness: robe ? 18 : 16 } };+ }}}@@ -398,5 +407,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],+ 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],};diff --git a/src/lib/search.ts b/src/lib/search.tsindex c4ed0f0..47235b3 100644--- a/src/lib/search.ts+++ b/src/lib/search.ts@@ -39,6 +39,8 @@ const CATEGORY_WORDS: [Kind, string[]][] = [["loft", ["loft bed", "high sleeper"]],["daybed", ["daybed", "day bed", "trundle bed"]],["bed", ["bed", "bedframe"]],+ ["slidecab", ["cabinet with sliding doors", "sliding door cabinet", "cupboard with sliding doors", "sliding door cupboard"]],+ ["sliding", ["wardrobe with sliding doors", "sliding wardrobe", "sliding door wardrobe", "sliding door closet", "sliding closet", "sliding doors"]],["wardrobe", ["wardrobe", "closet", "armoire"]],["sideboard", ["sideboard", "buffet"]],["cabinet", ["cabinet", "cupboard", "vitrine", "display"]],diff --git a/src/lib/types.ts b/src/lib/types.tsindex d24bb11..90617f2 100644--- a/src/lib/types.ts+++ b/src/lib/types.ts@@ -50,7 +50,7 @@ export interface BedParams {}export interface CabinetParams {- fronts: "doors" | "tilt";+ fronts: "doors" | "tilt" | "sliding";compartments: number;doors: 0 | 1 | 2;shelves: number;@@ -61,6 +61,7 @@ export interface CabinetParams {wall?: boolean; // hangs on the wall instead of standing on the floordrawers?: number; // drawers as well as doors: full-width drawers, split from the doors by a fixed shelfdrawerAt?: "top" | "bottom"; // where the drawers are; under the doors unless it says top+ slides?: number; // sliding doors: how many, running in two tracks}export interface SeatParams {@@ -202,7 +203,8 @@ export type HwKind =| "plug"| "castor"| "gasLift"- | "connector";+ | "connector"+ | "roller";export interface HwType {id: string;