IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.
TypeScript
Draw clothes racks
Youssef2ae6e70fa809
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.tsindex 7dd7dfc..b04ba42 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"]);+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"]);function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {const fam = fold(name);diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.tsindex 8bd92d9..c02ae33 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", "sliding", "slidecab", "washstand", "sinkcab", "appliance", "shoerack"]);+const UPRIGHT = new Set<Kind>(["cube", "bookcase", "open", "chest", "nightstand", "wardrobe", "cabinet", "sideboard", "tv", "shoe", "wallcab", "wallshelf", "kitchen", "mixed", "sliding", "slidecab", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack"]);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. */@@ -90,6 +90,8 @@ const PAX_SLIDE_UNITS = [100, 75];/** Wash-stands' own height in cm, to tell how thick a basin from the same box is; and the ones that stand on the floor. */const WASH_H: Record<string, number> = { HAVBÄCK: 63, ÄNGSJÖN: 63, TÄNNFORSEN: 63, HEMNES: 83, ENHET: 60, NYSJÖN: 65 };const WASH_FLOOR = new Set(["HEMNES", "NYSJÖN"]);+/** Clothes racks IKEA lists without a size (w, h, d), from its product pages; RIGGA's height is set at its tallest. */+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] };@@ -274,6 +276,8 @@ const RULES: Rule[] = [[/^(tv bench|tv bench with (\d )?doors|tv unit|tv storage unit)$/, (m, c) =>c.f.name === "KALLAX" ? "cube shelf with door inserts" : { kind: "tv", x: m[0] === "tv bench" && /^(BESTÅ|LACK)$/.test(c.f.name) ? { doors: 0 } : {} }],[/^(shoe rack|open shoe storage unit)$/, () => ({ kind: "shoerack" })],+ // freestanding clothes racks: two uprights on feet, a rail across the top, a shoe shelf or a lower rail+ [/^(clothes rack|clothes rack with shoe storage|coat rack with shoe storage unit)$/, (m) => ({ kind: "clothesrack", x: /shoe/.test(m[1]) ? { shelf: true } : {} })],[/^(shoe cabinet|shoe cabinet\/storage|shoe cabinet with (\d) compartments)$/, (m) => ({ kind: "shoe", x: m[2] ? { c: Number(m[2]) } : {} })],// tables@@ -391,7 +395,9 @@ export function classify(f: Fact, hints: Hints): Verdict {else set(v[0], v[1]);} else if (v.length === 1) return { skip: "upright piece with one size" };else if (hint?.kind === kind) set(hint.w, hint.h, hint.d);+ else if (kind === "clothesrack" && RACK_SIZE[family]) set(...RACK_SIZE[family]);else return { skip: "no size given" };+ if (kind === "clothesrack" && h < 100) return { skip: "clothes rack measured in a way we can't read" };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 cabinetconst twin = kind === "mixed" || kind === "slidecab" ? "cabinet" : kind === "sliding" ? "wardrobe" : undefined;diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.jsonindex a341930..fc67b9d 100644--- a/scripts/ikea/slugs.json+++ b/scripts/ikea/slugs.json@@ -8,6 +8,7 @@"ALEX|Drawer unit on castors, 36 × 76 cm": "alex-drawer-unit-on-castors-36-x-76","ALEX|Drawer unit on castors, 67 × 66 cm": "alex-drawer-unit-on-castors-67-x-66","ALEX|Storage unit, 36 × 70 cm": "alex-storage-unit-36-x-70",+ "ÄLGANÄS|Clothes rack with shoe storage, 46 × 39 × 166 cm": "alganas-clothes-rack-shoe-storage-46-x-39-x-166","ÄLGANÄS|Shoe rack, 76 × 24 × 59 cm": "alganas-shoe-rack-76-x-24-x-59","ÅLHULT|Bench, 103 × 36 cm": "alhult-bench-103-x-36","ÅLHULT|Chair": "alhult-chair",@@ -265,6 +266,7 @@"GODISHUS|Chest of 3 drawers, 60 × 40 × 60 cm": "godishus-chest-3-drawers-60-x-40-x-60","GONATT|Cot with drawer, 70 × 140 cm": "gonatt-cot-drawer-70-x-140","GRÅFJÄLLET|Bedside table, 45 × 36 × 59 cm": "grafjallet-bedside-table-45-x-36-x-59",+ "GRÅFJÄLLET|Clothes rack with shoe storage, 90 × 36 × 175 cm": "grafjallet-clothes-rack-shoe-storage-90-x-36-x-1","GRÅFJÄLLET|Dressing table, 100 × 42 cm": "grafjallet-dressing-table-100-x-42","GREJSIMOJS|Children's stool": "grejsimojs-children-s-stool","GREJSIMOJS|Children's table, 84 × 42 cm": "grejsimojs-children-s-table-84-x-42",@@ -595,6 +597,7 @@"LYCKSELE LÖVÅS|2-seat sofa-bed": "lycksele-lovas-2-seat-sofa-bed","LYCKSELE MURBO|2-seat sofa-bed": "lycksele-murbo-2-seat-sofa-bed","MÅBÄRSSKÄR|Coffee table, 61 × 41 cm": "mabarsskar-coffee-table-61-x-41",+ "MACKAPÄR|Coat rack with shoe storage unit, 78 × 32 × 200 cm": "mackapar-coat-rack-shoe-storage-unit-78-x-32-x-2","MACKAPÄR|Shoe rack, 78 × 32 × 40 cm": "mackapar-shoe-rack-78-x-32-x-40","MALM|Bed frame, high, Standard Double, 135 × 190 cm": "malm-bed-frame-high-standard-double-135-x-190","MALM|Bed frame, high, Standard Single, 90 × 190 cm": "malm-bed-frame-high-standard-single-90-x-190",@@ -753,6 +756,7 @@"MOSSJÖN|Glass-door cabinet with 2 doors, 60 × 34 × 146 cm": "mossjon-glass-door-cabinet-2-doors-60-x-34-x-146","MOSSJÖN|Wall cabinet w shelves/glass door, 36 × 18 × 102 cm": "mossjon-wall-cabinet-w-shelves-glass-door-36-x-1","MOSSJÖN|Wall cabinet with glass door, 36 × 18 × 44 cm": "mossjon-wall-cabinet-glass-door-36-x-18-x-44",+ "MULIG|Clothes rack, 99 × 152 cm": "mulig-clothes-rack-99-x-152","MULLSJÖ|Desk, 135 × 70 cm": "mullsjo-desk-135-x-70","MULLSJÖ|Swivel chair": "mullsjo-swivel-chair","MUSKAN|Bench, 58 × 38 cm": "muskan-bench-58-x-38",@@ -929,6 +933,7 @@"RENBERGET|Swivel chair": "renberget-swivel-chair","RIAN|Side table, 50 × 30 cm": "rian-side-table-50-x-30","RIDSPÖ|Desk, 140 × 70 cm": "ridspo-desk-140-x-70",+ "RIGGA|Clothes rack": "rigga-clothes-rack","RISHOLMEN|Wing chair, in/outdoor": "risholmen-wing-chair-in-outdoor","ROCKSJÖN|2-seat sofa": "rocksjon-2-seat-sofa","ROCKSJÖN|Armchair": "rocksjon-armchair",diff --git a/src/data/ikea-guard.ts b/src/data/ikea-guard.tsindex 5cfd214..529dff6 100644--- a/src/data/ikea-guard.ts+++ b/src/data/ikea-guard.ts@@ -1,3 +1,3 @@// Generated by scripts/ikea/build.ts from IKEA product data. Do not edit by hand.// Real IKEA names we can't draw that look like a typo of one we can (folded, no spaces)-export const IKEA_GUARD = "abrotten afjall alsken alvsta ananas angskorn arsjon asphult aspinge bagganas basingen batskar bengta boholmen bolmso borrby branas brogrund brunsta burfjord byholma cissan dalskar duvholmen eklatera ekorre fagelon falskar fardal farvik fiskbo florsjon forneby forsa forvaltare fossta frakta fridfull frihult frojda froson frost fyllen gamman gansjon gatebo gillstad godis gresla gronmes grossjon grusnarv grytas gubbarp hackas hallnas hallspar halved hammaron hamnskar hanga hassjon havsdun havsen havskal havsmal hejsta helgeo hilver hogvind holmared holmeja horred hultarp hutten ikeaps2002 ikeaps2014 ikeaps2017 isjakt jagmastare jallby jattestor kalken kallarp kallboda kallror kallsjon kallsup kasker klamtare klipplax knalla knixhult knoppang kolsjon konstruera kroksjon kvalmso kvittera laktare larkar latsas lersta lill lilla lillabo lillhult lindasen lohals lova lyckad macksjon majsjon mala maleras manalg martorp melodi molnas morkulla navlinge nereby nissedal nogsta norden nydala opparyd ordning orskar pinnarp pipranka plats plockar rahult ramsnas ramsta ranarp ransberg revskar ringsta rissla rockan runnen runskar saljen seglaro sidsjo sindal sindvik sjalso skalryta skarig skedstor skogsa skogskorn skogsnas skogsror smaata smalom smarra smaska smycka sonhult spantad sparka stelna stensta stensund stjarnhov storslinga strala strandad svalka svallet svansele svartho svartra sy tackan tacknan tallsparv tasjon terrsjo tisken tittebo tolken torared torkad tossig trogen tvarfot tysnes uddarp undvika uppfora upplaga upplid uppvind utaker vagdal vagomrade vagsjon vallasan vasskar vathult vedbak veddinge vedhamn viggso vilsta voxtorp vresjon";+export const IKEA_GUARD = "abrotten afjall alsken alvsta ananas angskorn arsjon asphult aspinge bagganas basingen batskar bengta boholmen bolmso borrby branas brogrund brunsta bullig burfjord byholma cissan dalskar duvholmen eklatera ekorre fagelon falskar fardal farvik fiskbo florsjon forneby forsa forvaltare fossta frakta fridfull frihult frojda froson frost fyllen gamman gansjon gatebo gillstad godis gresla gronmes grossjon grusnarv grytas gubbarp hackas hallnas hallspar halved hammaron hamnskar hanga hassjon havsdun havsen havskal havsmal hejsta helgeo hilver hogvind holmared holmeja horred hultarp hutten ikeaps2002 ikeaps2014 ikeaps2017 isjakt jagmastare jallby jattestor kalken kallarp kallboda kallror kallsjon kallsup kasker klamtare klipplax knalla knixhult knoppang kolsjon konstruera kroksjon kvalmso kvittera laktare larkar latsas lersta lill lilla lillabo lillhult lindasen lohals lova lyckad macksjon majsjon mala maleras manalg martorp melodi molnas morkulla navlinge nereby nissedal nogsta norden nydala opparyd ordning orskar piggal pinnarp pipranka plats plockar rahult ramsnas ramsta ranarp ransberg revskar ringsta rissla rockan runnen runskar saljen seglaro sidsjo sindal sindvik sjalso skalryta skarig skedstor skogsa skogskorn skogsnas skogsror smaata smalom smarra smaska smycka sonhult spantad sparka stelna stensta stensund stjarnhov storslinga strala strandad svalka svallet svansele svartho svartra sy tackan tacknan tallsparv tasjon terrsjo tisken tittebo tolken torared torkad tossig trogen tvarfot tysnes uddarp undvika uppfora upplaga upplid uppvind utaker vagdal vagomrade vagsjon vallasan vasskar vathult vedbak veddinge vedhamn viggso vilsta voxtorp vresjon";diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.tsindex 390f36d..1b4ae9a 100644--- a/src/data/ikea-items.ts+++ b/src/data/ikea-items.ts@@ -10,6 +10,7 @@ alex-drawer-unit-on-castors-36-x-50|09582664 59582671 59582666alex-drawer-unit-on-castors-36-x-76|59422220 69582680 39422221 29628029alex-drawer-unit-on-castors-67-x-66|80485423 50473544 20588891alex-storage-unit-36-x-70|50563752 70588898 50563790+alganas-clothes-rack-shoe-storage-46-x-39-x-166|10585888alganas-shoe-rack-76-x-24-x-59|20585883alhult-bench-103-x-36|60603093 40603094alhult-chair|50600801 40600774@@ -290,6 +291,7 @@ glostad-3-seat-sofa-chaise-longue|89578601godishus-chest-3-drawers-60-x-40-x-60|80598095gonatt-cot-drawer-70-x-140|90467089grafjallet-bedside-table-45-x-36-x-59|20570221+grafjallet-clothes-rack-shoe-storage-90-x-36-x-1|00570222grafjallet-dressing-table-100-x-42|30570225grejsimojs-children-s-stool|60598973 50598959grejsimojs-children-s-table-84-x-42|70598963@@ -661,6 +663,7 @@ lyckan-chair|00569191 00569186lycksele-lovas-2-seat-sofa-bed|19387006 49387038 19387134 89563204 89561709lycksele-murbo-2-seat-sofa-bed|09387021 49387137 49387043 19561717 69563219mabarsskar-coffee-table-61-x-41|30597164+mackapar-coat-rack-shoe-storage-unit-78-x-32-x-2|50530988mackapar-shoe-rack-78-x-32-x-40|50530993malm-2-drawers|50336552 90625319malm-4-drawers|50424054@@ -823,6 +826,7 @@ morbylanga-table-145|60412885mossjon-glass-door-cabinet-2-doors-60-x-34-x-146|30564333mossjon-wall-cabinet-glass-door-36-x-18-x-44|20621640mossjon-wall-cabinet-w-shelves-glass-door-36-x-1|60567778+mulig-clothes-rack-99-x-152|60179434mullsjo-desk-135-x-70|30553240mullsjo-swivel-chair|70576584muskan-bench-58-x-38|50345957@@ -1005,6 +1009,7 @@ relatera-desk-sit-stand-90-x-60|49552863renberget-swivel-chair|90503285rian-side-table-50-x-30|80343419ridspo-desk-140-x-70|00485224+rigga-clothes-rack|50231630risholmen-wing-chair-in-outdoor|00503794rocksjon-2-seat-sofa|19508862 59514696 59508855rocksjon-armchair|89508854 29514693 89508849diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.tsindex 9bcf6ef..9b80c0c 100644--- a/src/data/ikea-rows.ts+++ b/src/data/ikea-rows.ts@@ -9,6 +9,7 @@ ALEX|chest|Drawer unit on castors, 67 × 66 cm|67|66|58|rows=5,knobs=noneALEX|desk|Desk, 100 × 48 cm|100|74|48ALEX|desk|Desk, 132 × 58 cm|132|74|58ALEX|open|Storage unit, 36 × 70 cm|36|70|35+ÄLGANÄS|clothesrack|Clothes rack with shoe storage, 46 × 39 × 166 cm|46|166|39|shelf=1ÄLGANÄS|shoerack|Shoe rack, 76 × 24 × 59 cm|76|59|24ÅLHULT|bench|Bench, 103 × 36 cm|103|45|36ÅLHULT|chair|Chair|44|88|50@@ -265,6 +266,7 @@ GLOSTAD|chaise|3-seat sofa with chaise longue|201|78|150|seats=3,arms=wide,chaisGLOSTAD|sofa|3-seat sofa|230|85|92|seats=3GODISHUS|chest|Chest of 3 drawers, 60 × 40 × 60 cm|60|60|40|rows=3GONATT|cot|Cot with drawer, 70 × 140 cm|150|86|78|m=70,l=140,drawer=1+GRÅFJÄLLET|clothesrack|Clothes rack with shoe storage, 90 × 36 × 175 cm|90|175|36|shelf=1GRÅFJÄLLET|desk|Dressing table, 100 × 42 cm|100|74|42GRÅFJÄLLET|nightstand|Bedside table, 45 × 36 × 59 cm|45|59|36|rows=1GREJSIMOJS|kidstable|Children's table, 84 × 42 cm|84|48|42||kids@@ -596,6 +598,7 @@ LYCKAN|chair|Chair|44|88|50LYCKSELE LÖVÅS|sofa|2-seat sofa-bed|170|85|92|seats=2LYCKSELE MURBO|sofa|2-seat sofa-bed|170|85|92|seats=2MÅBÄRSSKÄR|coffee|Coffee table, 61 × 41 cm|61|45|41||outdoor garden+MACKAPÄR|clothesrack|Coat rack with shoe storage unit, 78 × 32 × 200 cm|78|200|32|shelf=1MACKAPÄR|shoerack|Shoe rack, 78 × 32 × 40 cm|78|40|32MALM|bed|Bed frame, high, Standard Single, 90 × 190 cm|106|100|199|m=90,l=190MALM|bed|Bed frame, high, w 2 storage boxes, Standard Single, 90 × 190 cm|106|100|199|m=90,l=190@@ -754,6 +757,7 @@ MÖRBYLÅNGA|dining|Table, 145 cm|145|74|145|round=1MOSSJÖN|cabinet|Glass-door cabinet with 2 doors, 60 × 34 × 146 cm|60|146|34MOSSJÖN|wallcab|Wall cabinet with glass door, 36 × 18 × 44 cm|36|44|18|doors=1MOSSJÖN|wallcab|Wall cabinet w shelves/glass door, 36 × 18 × 102 cm|36|102|18|doors=1+MULIG|clothesrack|Clothes rack, 99 × 152 cm|99|152|46MULLSJÖ|desk|Desk, 135 × 70 cm|135|74|70MULLSJÖ|office|Swivel chair|60|105|64|arms=noneMUSKAN|bench|Bench, 58 × 38 cm|58|45|38@@ -930,6 +934,7 @@ RELATERA|desk|Desk, 117 × 60 cm|117|74|60RENBERGET|office|Swivel chair|60|105|64|arms=noneRIAN|side|Side table, 50 × 30 cm|50|50|30RIDSPÖ|desk|Desk, 140 × 70 cm|140|74|70+RIGGA|clothesrack|Clothes rack|111|175|51RISHOLMEN|armchair|Wing chair, in/outdoor|75|104|80||outdoor gardenROCKSJÖN|armchair|Armchair|75|90|80ROCKSJÖN|sofa|2-seat sofa|170|85|92|seats=2diff --git a/src/lib/plan/rack.ts b/src/lib/plan/rack.tsnew file mode 100644index 0000000..d87e023--- /dev/null+++ b/src/lib/plan/rack.ts@@ -0,0 +1,99 @@+import type { ProductSpec, Vec3 } from "../types";+import { HW, PlanBuilder, type FitOpts } from "./builder";+import { clamp } from "./math";++/**+ * Freestanding clothes racks (MULIG, RIGGA, GRÅFJÄLLET): a foot at each end, an upright bolted onto each foot,+ * a shoe shelf or a lower rail between the uprights, and the rail across the top. Built standing, from the floor up.+ */+export function buildRack(b: PlanBuilder, s: ProductSpec) {+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;+ const shoes = !!s.shelf?.shoes;+ const tube = 30, footH = 40, footW = 50;+ const ux = W / 2 - footW / 2;+ const railY = H - tube / 2;+ const lowY = clamp(H * 0.12, 140, 260);++ const footT = b.part("Foot", [footW, footH, D], { material: "metal" });+ const feet = [-1, 1].map((sx) => b.place(footT, [sx * ux, footH / 2, 0]));+ const upT = b.part("Upright", [tube, H - footH, tube], { shape: "cyl", material: "metal" });+ const ups = [-1, 1].map((sx) => b.place(upT, [sx * ux, footH + (H - footH) / 2, 0]));+ const span = 2 * ux - tube;+ const railT = b.part("Top rail", [tube - 4, span, tube - 4], { shape: "cyl", material: "metal" });+ const rail = b.place(railT, [0, railY, 0], [0, 0, Math.PI / 2]);+ const shelfD = Math.min(D - 40, 330);+ const lowT = shoes ? b.part("Shoe shelf", [span, 18, shelfD], { material: "wood" }) : b.part("Lower rail", [24, span, 24], { shape: "cyl", material: "metal" });+ const low = shoes ? b.place(lowT, [0, lowY, 0]) : b.place(lowT, [0, lowY, 0], [0, 0, Math.PI / 2]);+ const tall = H > 1500;++ b.step(+ {+ title: "Bolt an upright onto each foot",+ detail: "Stand each upright in the hole in the middle of its foot, then tighten the bolt from underneath.",+ tools: ["allen"],+ kind: "bolts",+ warnings: ["loose"],+ },+ () => {+ b.stagger(0.25);+ feet.forEach((k, i) => b.add(k, [(i === 0 ? -1 : 1) * 180, 0, 0]));+ b.then(0.1);+ ups.forEach((k) => b.add(k, [0, 360, 0]));+ b.then(0.1);+ b.fits(+ HW.boltS,+ feet.map((k, i) => ({ on: k, at: [(i === 0 ? -1 : 1) * ux, 0, 0] as Vec3, dir: [0, 1, 0] as Vec3, mate: ups[i] })),+ 0.15,+ );+ },+ );++ b.step(+ {+ title: shoes ? "Fit the shoe shelf between the uprights" : "Fit the lower rail between the uprights",+ detail: "Low down, at the same height on both sides. Leave the bolts a little loose for now.",+ tools: ["allen"],+ kind: "bolts",+ people: shoes && W > 800 ? 2 : 1,+ warnings: ["loose"],+ },+ () => {+ b.add(low, [0, 0, 300]);+ b.then(0.1);+ const list: FitOpts[] = [];+ for (const [i, sx] of [-1, 1].entries())+ for (const z of shoes ? [-shelfD / 4, shelfD / 4] : [0]) list.push({ on: ups[i], at: [sx * (ux + tube / 2), lowY, z], dir: [-sx, 0, 0], mate: low });+ b.fits(HW.boltS, list, 0.12);+ },+ );++ b.step(+ {+ title: "Put the top rail on",+ detail: "It slots into the top of both uprights. One bolt holds each end.",+ tools: ["allen"],+ kind: "bolts",+ people: tall ? 2 : 1,+ warnings: tall ? ["two"] : [],+ },+ () => {+ b.add(rail, [0, 300, 0]);+ b.then(0.1);+ b.fits(+ HW.boltS,+ [-1, 1].map((sx, i) => ({ on: ups[i], at: [sx * (ux + tube / 2), railY, 0] as Vec3, dir: [-sx, 0, 0] as Vec3, mate: rail })),+ 0.15,+ );+ },+ );++ b.step(+ {+ title: "Tighten every bolt",+ detail: "Check that it stands steady and doesn't lean, then tighten them all firmly.",+ tools: ["allen"],+ kind: "bolts",+ },+ () => {},+ );+}diff --git a/src/lib/plan/shelf.ts b/src/lib/plan/shelf.tsindex 56e61bc..e14b05e 100644--- a/src/lib/plan/shelf.ts+++ b/src/lib/plan/shelf.ts@@ -2,6 +2,7 @@ import type { PartPiece, ProductSpec, ShelfParams, Vec3 } from "../types";import { HW, PlanBuilder, type FitOpts } from "./builder";import { FrameKit, anchorStep } from "./frame";import { clamp } from "./math";+import { buildRack } from "./rack";export function defaultsShelf(s: ProductSpec): ShelfParams {const p = s.shelf ?? {};@@ -20,6 +21,7 @@ export function defaultsShelf(s: ProductSpec): ShelfParams {}export function buildShelf(b: PlanBuilder, s: ProductSpec) {+ if (s.shelf?.style === "rack") return buildRack(b, s);const p = defaultsShelf(s);if (p.style === "grid") return s.shelf?.underframe ? onUnderframe(b, s, p) : s.shelf?.inserts ? withInserts(b, s, p) : grid(b, s, p);return bookcase(b, s, p);diff --git a/src/lib/products.ts b/src/lib/products.tsindex 996dd0c..7b9c28d 100644--- a/src/lib/products.ts+++ b/src/lib/products.ts@@ -53,7 +53,8 @@ export type Kind =| "washstand"| "sinkcab"| "appliance"- | "shoerack";+ | "shoerack"+ | "clothesrack";export type X = {rows?: number;@@ -268,7 +269,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,+ 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,};const CATEGORY: Record<Kind, string> = {@@ -277,7 +278,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",+ 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",};export const KIND_ARCH: Record<Kind, Archetype> = {@@ -285,7 +286,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",+ 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",};const round = (x: X) => (x.round ? { round: true } : {});@@ -381,6 +382,9 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:return { ...base, shelf: { style: "bookcase", shelves: x.shelves ?? Math.max(1, Math.round(h / 45) - 1), fixedShelf: h > 150, back: true, plinth: h > 100, outer: 16 } };case "open":return { ...base, difficulty: 1, shelf: { style: "bookcase", shelves: x.shelves ?? Math.max(1, Math.round(h / 45) - 1), fixedShelf: h > 150, back: false, plinth: false, outer: 18 } };+ case "clothesrack":+ // x.shelf: a shoe shelf low down instead of a lower rail+ return { ...base, difficulty: 1, people: 1, shelf: { style: "rack", ...(x.shelf ? { shoes: true } : {}) } };case "shoerack":// an open rack: a fixed shelf in the middle, and one more on pins when it's tall enough for three rows of shoesreturn { ...base, difficulty: 1, people: 1, shelf: { style: "bookcase", shelves: x.shelves ?? (h >= 55 ? 1 : 0), fixedShelf: true, back: false, plinth: false, outer: 18 } };@@ -527,5 +531,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],+ 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],};diff --git a/src/lib/search.ts b/src/lib/search.tsindex 85f944b..56a5a31 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"]],+ ["clothesrack", ["clothes rack", "clothes rail", "clothing rack", "clothing rail", "garment rack", "garment rail", "coat rack", "coat stand"]],["shoerack", ["shoe rack", "shoe shelf", "shoe stand", "shoe bench", "open shoe storage"]],["shoe", ["shoe", "shoes", "shoe cabinet", "shoe rack"]],["nightstand", ["nightstand", "bedside", "night stand"]],diff --git a/src/lib/types.ts b/src/lib/types.tsindex 1be58f6..af4dcef 100644--- a/src/lib/types.ts+++ b/src/lib/types.ts@@ -3,7 +3,7 @@ export type Vec3 = [number, number, number];export type Archetype = "shelf" | "drawers" | "table" | "bed" | "cabinet" | "seat" | "sofa" | "custom";export interface ShelfParams {- style: "grid" | "bookcase";+ style: "grid" | "bookcase" | "rack"; // a rack: two uprights on feet with a rail across the topcols: number;rows: number;shelves: number; // adjustable shelves (bookcase)@@ -15,6 +15,7 @@ export interface ShelfParams {wall?: boolean; // hangs on the wall instead of standing on the floorunderframe?: number; // cm: a cube grid standing on an underframe this tall (size.h takes it in)inserts?: number; // a cube grid sold with this many inserts with a door, from the bottom row up+ shoes?: boolean; // a rack with a shoe shelf low down instead of a lower rail}export interface DrawersParams {