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 islands with a rack or a back panel

Youssef11ea323233b4
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index 7b9776e..1234957 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -245,6 +245,9 @@ const RULES: Rule[] = [
[/^hi cab f micro w door\/(\d) drawers$/, (m) => ({ kind: "appliance", x: { use: "microwave", z: `r${m[1]}@80+g@40+d1` } })],
[/^hi cab w shlvs\/\d drawers\/dr\/(\d) frnts$/, (m) => ({ kind: "kitchen", x: { z: `r${m[1]}@80+d1s3` } })],
[/^base cabinet$/, () => ({ kind: "kitchen", x: { doors: 0 } })],
+ // a kitchen island with a rack, and an outdoor kitchen unit with a back panel, rising from the back of the top
+ [/^kitchen island with rack$/, (_m, c) => ({ kind: "trolley", x: { up: Math.max(40, (c.sz.n[2] ?? 190) - 90), cat: "Kitchen island" } })],
+ [/^kitchen island w back panel$/, (_m, c) => ({ kind: "kitchen", x: { doors: 0, shelves: 1, up: Math.max(40, (c.sz.n[2] ?? 176) - 90), cat: "Outdoor kitchen unit" } })],
// open units of an outdoor kitchen: a frame with a shelf and no doors
[/^(open kitchen unit|kitchen island shelf unit)$/, () => ({ kind: "kitchen", x: { doors: 0, shelves: 1, cat: "Outdoor kitchen unit" } })],
[/^base cb w shelf$/, () => ({ kind: "kitchen", x: { doors: 0, shelves: 1 } })],
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 1b578fd..f3608f4 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -343,6 +343,7 @@
"GREJSIMOJS|Clothes stand, 125 cm": "grejsimojs-clothes-stand-125",
"GREJSIMOJS|Pouffe with storage": "grejsimojs-pouffe-storage",
"GRILLSKÄR|Kitchen island shelf unit, 86 × 61 cm": "grillskar-kitchen-island-shelf-unit-86-x-61",
+ "GRILLSKÄR|Kitchen island w back panel, 86 × 61 × 176 cm": "grillskar-kitchen-island-w-back-panel-86-x-61-x",
"GRILLSKÄR|Open kitchen unit, 61 × 61 cm": "grillskar-open-kitchen-unit-61-x-61",
"GRILLSKÄR|Side table, outdoor, 30 × 61 cm": "grillskar-side-table-outdoor-30-x-61",
"GRIMSARBO|Side table": "grimsarbo-side-table",
@@ -1538,6 +1539,7 @@
"UTTER|Children's stool": "utter-children-s-stool",
"UTTER|Children's table": "utter-children-s-table",
"VADHOLMA|Drawer unit, 40 × 37 × 40 cm": "vadholma-drawer-unit-40-x-37-x-40",
+ "VADHOLMA|Kitchen island with rack, 126 × 79 × 193 cm": "vadholma-kitchen-island-rack-126-x-79-x-193",
"VADHOLMA|Kitchen island, 126 × 79 × 90 cm": "vadholma-kitchen-island-126-x-79-x-90",
"VADHOLMA|Kitchen island, 79 × 63 × 90 cm": "vadholma-kitchen-island-79-x-63-x-90",
"VADHOLMA|Open storage, 20 × 37 × 60 cm": "vadholma-open-storage-20-x-37-x-60",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 5c77a8e..91df573 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -368,6 +368,7 @@ grejsimojs-children-s-table-84-x-42|70598963
grejsimojs-clothes-stand-125|10602996
grejsimojs-pouffe-storage|60603644
grillskar-kitchen-island-shelf-unit-86-x-61|50471446 29390107
+grillskar-kitchen-island-w-back-panel-86-x-61-x|79495244 79548233
grillskar-open-kitchen-unit-61-x-61|40598790
grillskar-side-table-outdoor-30-x-61|00523179
gronfjall-office-chair-arm-headrest|89513921
@@ -1621,6 +1622,7 @@ utter-children-s-stool|50357785
vadholma-drawer-unit-40-x-37-x-40|50374332
vadholma-kitchen-island-126-x-79-x-90|20359154
vadholma-kitchen-island-79-x-63-x-90|40366115
+vadholma-kitchen-island-rack-126-x-79-x-193|59276228
vadholma-open-storage-20-x-37-x-60|60374341 20374338 60374336
valnas-2-seat-sofa|99615325 69615322 39615328
valnas-3-seat-sofa|49615337 79615331 19615334
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index 83162d1..2272223 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -345,6 +345,7 @@ GREJSIMOJS|lidbox|Pouffe with storage|38|38|38|cat=Pouffe with storage
GREJSIMOJS|stool|Children's stool|35|30|35||kids
GRILLSKÄR|kitchen|Open kitchen unit, 61 × 61 cm|61|90|61|doors=0,shelves=1,cat=Outdoor kitchen unit|outdoor garden
GRILLSKÄR|kitchen|Kitchen island shelf unit, 86 × 61 cm|86|90|61|doors=0,shelves=1,cat=Outdoor kitchen unit|outdoor garden
+GRILLSKÄR|kitchen|Kitchen island w back panel, 86 × 61 × 176 cm|86|176|61|doors=0,shelves=1,cat=Outdoor kitchen unit,up=86|outdoor garden
GRILLSKÄR|side|Side table, outdoor, 30 × 61 cm|30|50|61||outdoor garden
GRÖNFJÄLL|office|Office chair with armrests|64|105|64|arms=slim
GRÖNFJÄLL|office|Office chair with arm/headrest|64|128|64|arms=slim
@@ -1535,6 +1536,7 @@ VADHOLMA|chest|Drawer unit, 40 × 37 × 40 cm|40|40|37|rows=3
VADHOLMA|open|Open storage, 20 × 37 × 60 cm|20|60|37
VADHOLMA|trolley|Kitchen island, 79 × 63 × 90 cm|79|90|63
VADHOLMA|trolley|Kitchen island, 126 × 79 × 90 cm|126|90|79
+VADHOLMA|trolley|Kitchen island with rack, 126 × 79 × 193 cm|126|193|79|cat=Kitchen island,up=103
VALNÄS|coffee|Coffee table, 118 × 72 cm|118|45|72
VALNÄS|sofa|2-seat sofa|170|85|92|seats=2
VALNÄS|sofa|3-seat sofa|230|85|92|seats=3
diff --git a/src/lib/ikea.ts b/src/lib/ikea.ts
index 2b8f689..25412a6 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", "slides", "n", "of", "hinge", "use", "z", "basin", "hung", "uf", "ins", "blind", "inner", "u", "v", "cu", "rock", "cat", "cast", "mods", "dr", "foot", "st", "low", "box", "t", "mirror"] 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", "u", "v", "cu", "rock", "cat", "cast", "mods", "dr", "foot", "st", "low", "box", "t", "mirror", "up"] as const;
const FLAGS = new Set<string>(["plinth", "shelf", "round", "open", "drawer", "dtop", "rail", "hinge", "hung", "rock", "cast", "foot", "mirror"]);
const WORDS = new Set<string>(["knobs", "arms", "legs", "attach", "chaise", "corner", "under", "of", "use", "z", "inner", "u", "v", "cat"]);
diff --git a/src/lib/plan/cabinet.ts b/src/lib/plan/cabinet.ts
index dd71371..71c46e6 100644
--- a/src/lib/plan/cabinet.ts
+++ b/src/lib/plan/cabinet.ts
@@ -36,7 +36,8 @@ export function buildCabinet(b: PlanBuilder, s: ProductSpec) {
if (p.fronts === "tilt") return tiltCabinet(b, s, p);
// on castors: the carcass is built on the floor, then lifted onto them
const ch = s.cabinet?.castors ? CASTOR_H : 0;
- const W = s.size.w * 10, H = s.size.h * 10 - ch, D = s.size.d * 10;
+ const up = (s.cabinet?.upstand ?? 0) * 10;
+ const W = s.size.w * 10, H = s.size.h * 10 - ch - up, D = s.size.d * 10;
const t = p.thickness;
const wall = !!s.cabinet?.wall;
if (wall || ch) p.plinth = false;
@@ -179,10 +180,34 @@ export function buildCabinet(b: PlanBuilder, s: ProductSpec) {
// a cabinet on castors rolls about: nothing to fix to the wall
if (ch) liftOntoCastors(b);
else if (s.cabinet?.onTop) onTopStep(b, s.cabinet.onTop, f.bottom, W, D, t);
+ else if (up) {
+ upstandStep(b, f.top, W, D, H, up);
+ f.anchor();
+ }
else if (wall) f.hang();
else if (H >= 800) f.anchor();
}
+/** A back panel standing up from the back of the top, screwed on from behind. */
+function upstandStep(b: PlanBuilder, top: string, W: number, D: number, H: number, up: number) {
+ const panelT = b.part("Back panel, standing", [W, up, 18]);
+ const panel = b.place(panelT, [0, H + up / 2, -D / 2 + 9]);
+ b.step(
+ {
+ title: "Screw on the back panel",
+ detail: "It stands up along the back of the top. Screw it on through its brackets.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ people: W > 800 ? 2 : 1,
+ },
+ () => {
+ b.add(panel, [0, 300, -100]);
+ b.then(0.1);
+ b.fits(HW.screwM, [-W / 3, 0, W / 3].map((x) => ({ on: panel, at: [x, H + 20, -D / 2 + 18] as Vec3, dir: [0, 0, -1] as Vec3, mate: top })), 0.1);
+ },
+ );
+}
+
/** A height extension unit goes on top of the bookcase or cabinet it extends, screwed down through its bottom. */
function onTopStep(b: PlanBuilder, what: string, bottom: string, W: number, D: number, t: number) {
b.step(
diff --git a/src/lib/plan/table.ts b/src/lib/plan/table.ts
index 0e09fc1..5d80747 100644
--- a/src/lib/plan/table.ts
+++ b/src/lib/plan/table.ts
@@ -30,7 +30,8 @@ export function buildTable(b: PlanBuilder, s: ProductSpec) {
if (s.table?.gate) return buildGateleg(b, s);
if (s.table?.leaves) return buildDropLeaf(b, s);
const p = defaultsTable(s);
- const W = s.size.w * 10, H = s.size.h * 10;
+ const rackH = (s.table?.rack ?? 0) * 10;
+ const W = s.size.w * 10, H = s.size.h * 10 - rackH;
const D = p.round ? W : s.size.d * 10;
const tt = p.topThickness, ls = p.legSize;
const inset = p.round ? (W / 2) * (1 - 0.78 / Math.SQRT2) - ls / 2 : p.attach === "screw" ? 0 : p.attach === "plate" ? 30 : 45;
@@ -233,4 +234,47 @@ export function buildTable(b: PlanBuilder, s: ProductSpec) {
},
() => {},
);
+ if (rackH) rackSteps(b, top, W, D, H, rackH);
+}
+
+/** A rack on a kitchen island: two posts bolted up through the back of the top, a rail across them, hooks under it. */
+function rackSteps(b: PlanBuilder, top: string, W: number, D: number, H: number, R: number) {
+ const ps = 40;
+ const px = W / 2 - ps / 2 - 20, pz = -D / 2 + ps / 2 + 20;
+ const postT = b.part("Rack post", [ps, R - ps, ps], { material: "wood" });
+ const posts = [-1, 1].map((sx) => b.place(postT, [sx * px, H + (R - ps) / 2, pz]));
+ const railT = b.part("Rack rail", [W - 40, ps, ps], { material: "wood" });
+ const rail = b.place(railT, [0, H + R - ps / 2, pz]);
+ b.step(
+ {
+ title: "Bolt the rack posts onto the top",
+ detail: "One at each back corner. The bolts go up through the top into the posts.",
+ tools: ["allen"],
+ kind: "bolts",
+ },
+ () => {
+ b.stagger(0.3);
+ posts.forEach((k) => b.add(k, [0, 300, 0]));
+ b.then(0.1);
+ b.fits(HW.boltL, [-1, 1].map((sx) => ({ on: top, at: [sx * px, H - 30, pz] as Vec3, dir: [0, 1, 0] as Vec3, mate: posts[sx < 0 ? 0 : 1] })), 0.15);
+ },
+ );
+ const nh = Math.max(3, Math.round(W / 250));
+ b.step(
+ {
+ title: "Screw the rail across the posts, then the hooks",
+ detail: "Two people make it easier: one holds the rail level while the other screws.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ people: 2,
+ warnings: ["two"],
+ },
+ () => {
+ b.add(rail, [0, 260, 0]);
+ b.then(0.1);
+ b.fits(HW.screwL, [-1, 1].map((sx) => ({ on: rail, at: [sx * px, H + R, pz] as Vec3, dir: [0, -1, 0] as Vec3, mate: posts[sx < 0 ? 0 : 1] })), 0.15);
+ b.then(0.1);
+ b.fits(HW.hook, Array.from({ length: nh }, (_, i) => ({ on: rail, at: [-W / 2 + 60 + ((W - 120) * (i + 0.5)) / nh, H + R - ps, pz] as Vec3, dir: [0, 1, 0] as Vec3 })), 0.08);
+ },
+ );
}
diff --git a/src/lib/products.ts b/src/lib/products.ts
index 0a72003..138bfcb 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -151,6 +151,8 @@ export type X = {
t?: number;
/** a mirror on top */
mirror?: boolean;
+ /** cm: a rack or a back panel rising from the back of the top (size.h takes it in) */
+ up?: number;
};
export type Row = [name: string, kind: Kind, variant: string, w: number, h: number, d: number, x?: X, keywords?: string];
@@ -569,8 +571,12 @@ function specOf(kind: Kind, name: string, variant: string, w: number, h: number,
case "kitchen":
// x.z: a front of drawers and doors, drawn like the cabinets built around an appliance
if (x.z) return fitted(kind, base, w, h, { use: "storage", ...x });
+ // x.up: a back panel standing up from the back of the top
+ if (x.up) return { ...base, minutes: x.min ?? MIN.kitchen + 10, cabinet: { doors: x.doors ?? (w > 50 ? 2 : 1), shelves: x.shelves ?? 1, rail: false, plinth: true, handles: x.knobs ?? "bar", thickness: 18, upstand: x.up } };
return { ...base, cabinet: { doors: x.doors ?? (w > 50 ? 2 : 1), shelves: x.shelves ?? Math.max(1, Math.round(h / 45) - 1), rail: false, plinth: true, handles: x.knobs ?? "bar", thickness: 18 } };
case "trolley":
+ // x.up: a kitchen island with a rack rising from the back of its top
+ if (x.up) return { ...base, minutes: x.min ?? MIN.trolley + 20, people: 2, difficulty: 2, table: { attach: "plate", legs: "round", legSize: 25, topThickness: 20, shelf: true, rack: x.up } };
return { ...base, difficulty: 1, table: { attach: "plate", legs: "round", legSize: 25, topThickness: 20, shelf: true } };
case "bar":
return { ...base, people: 2, table: { attach: x.attach ?? "apron", legs: x.legs ?? "square", legSize: 50, topThickness: 25, shelf: false, ...round(x) } };
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 2cbf45e..a76a848 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -53,6 +53,7 @@ export interface TableParams {
boxes?: number; // boxes in each of those frames
shelvesIn?: boolean; // shelves in the frames instead of boxes
riser?: boolean; // a laptop or monitor stand: a top on two side panels
+ rack?: number; // cm: a rack rising from the back of the top, two posts and a rail with hooks (size.h takes it in)
seat?: boolean; // a bench or stool built like a table: the top is its seat
inner?: boolean; // the shelf fits between the legs, screwed through them
}
@@ -91,6 +92,7 @@ export interface CabinetParams {
castors?: boolean; // stands on castors (size.h takes them in)
onTop?: "bookcase" | "cabinet"; // a height extension unit: fixed on top of the bookcase or cabinet it extends
low?: number; // cm: a shelving unit with a cabinet this high at the bottom, doors over it and open shelves above
+ upstand?: number; // cm: a back panel standing up from the back of the top (size.h takes it in)
}
/**