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

Fix build accuracy and animations

Youssef0e6cc7ef8267
diff --git a/docs/manual-sweep.md b/docs/manual-sweep.md
index b7d2194..3f6fff1 100644
--- a/docs/manual-sweep.md
+++ b/docs/manual-sweep.md
@@ -1,8 +1,10 @@
-# Manual sweep, 28 October 2026
+# Manual sweep, 28 and 29 October 2026
Every catalog guide is being rebuilt to follow its product's IKEA assembly manual: the same steps in the same order, the same parts, fittings and counts, the build poses the manual shows (lying on its back, upside down) and two people where it shows two. The drawings and words are our own.
-**Status: 1,974 of 2,180 guides (90%) are built from their manuals; every guide builds.**
+**Status: 2,139 of 2,166 guides (99%) are built from their manuals; every guide builds.** The 27 left have no manual anywhere (discontinued products); they keep the old builder.
+
+On 29 October every guide was also checked for impossible moves: a part sliding across dowels or cam bolts instead of along them, and screws or bolts that end in thin air. Those were fixed family by family; what the check still reports (about 190 guides) was looked at and is a false alarm (a frame that moves in one piece, a screw into a handle or the floor).
## How it works
@@ -12,15 +14,8 @@ Every catalog guide is being rebuilt to follow its product's IKEA assembly manua
- New fitting kinds: clip, strap, nut, washer, stud, clamp, angle, foot, cap, spacer; fittings can carry their own name. New part material `glass`, half-disc pieces for split round tops.
- Product data: `src/data/fixes.ts` holds about 90 single-product corrections; `scripts/ikea/classify.ts` now reads corner sofas, bed frames, sofa-beds, office chairs and more from IKEA's measurements.
-## Still on the old builder (about 200 guides)
-
-- No assembly manual on IKEA's site, or sold fully assembled (folding chairs, small outdoor tables, drying racks): about 60. The assembled ones should get an honest "unfold it" guide.
-- Long manuals not finished yet: SEKTION corner cabinets (10); HEMNES desks, dressing tables, day-beds and others (11); IDANÄS desk and 6 beds; MALM ottoman beds and chest of 6; FÅGELFJÄLLET beds (4); NORDLI storage beds and the chests without a manual page; IVAR cabinets and door units; BROR steel cabinets (5); STOCKHOLM 2025 cabinets (3); LOMMARP, STOREMOLLA, BAGGEBO, FJÄLLBO, FRYKSÅS, TORNVIKEN leftovers; ANKARUDDEN, STÄLL, HOLMERUD, VISTHUS; changing tables (SUNDVIK, ÄLSKVÄRD, SMÅGÖRA, SMÅSTAD); MICKE, BRYTNING, BEKANT, FLISAT, KLEPPSTAD sliding wardrobe; PAX add-on corner unit; UTKLASSNING.
-- Sets of frames: PAX joins (the manual uses 2 screws and 2 barrel nuts per joint), PLATSA sets of mixed heights (8), IVAR sections sharing a ladder.
-
## To do next
-- Finish the list above.
- Record voice clips for the new step lines (`npm run voice -- --dry` first for the cost); until then, new lines are spoken live only for visitors with their own key.
- Re-render the share images (`scripts/og/render.mjs`), which still show the old models.
- Page weight: the family files are in the client bundle that every page loads (about 1.5 MB gzipped for that chunk). Load them only on guide pages, or per family.
diff --git a/eslint.config.mjs b/eslint.config.mjs
index c7ff2a1..1af82b4 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -14,6 +14,7 @@ const eslintConfig = defineConfig([
"next-env.d.ts",
// agent worktrees and local tool state
".claude/**",
+ ".sweep/**",
]),
]);
diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.ts
index d765627..d2be2d7 100644
--- a/scripts/ikea/check.ts
+++ b/scripts/ikea/check.ts
@@ -129,7 +129,7 @@ async function main() {
// a wash-stand when asked for, US words too, without taking the family's cabinets
expect("hemnes wash-stand", "hemnes-wash-stand-2-drawers-60-x-47-x-83");
expect("hemnes vanity", "hemnes-wash-stand-2-drawers-60-x-47-x-83");
- expect("hemnes cabinet", "hemnes-glass-door-cabinet-90-x-197");
+ expect("hemnes glass door cabinet", "hemnes-glass-door-cabinet-3-drawers-90-x-197");
// the same for a kitchen's sink cabinet
expect("enhet sink cabinet", "enhet-base-cb-f-sink-60-x-60-x-75");
expect("metod base cabinet", "metod-base-cabinet-shelves-60-x-60");
diff --git a/src/data/fixes.ts b/src/data/fixes.ts
index 0baee70..79fe181 100644
--- a/src/data/fixes.ts
+++ b/src/data/fixes.ts
@@ -112,6 +112,15 @@ export const FIXES: Record<string, Fix> = {
"grillskar-kitchen-island-shelf-unit-86-x-61": { size: [86, 92, 61] },
"kallso-hat-rack-80": { size: [80, 24, 32] },
+ // small pieces measured on their pages
+ "fjaderharv-mini-chest-2-drawers-32-x-25": { size: [32, 16, 25] },
+ "alseda-stool": { size: [60, 18, 60] },
+ "forsiktig-children-s-stool": { size: [37, 13, 24] },
+ "sundvik-changing-table-chest-drawers-78-x-79-x-9": { size: [78, 99, 79] },
+ "bolmen-step-stool": { size: [44, 25, 35] },
+ "sigfinn-monitor-stand-fixed-height": { size: [53, 10, 24] },
+ "smagora-changing-table-bookshelf-60-x-81-x-103": { size: [60, 103, 81] },
+
// beds
"mellgrund-bed-frame-queen-152-x-203": { variant: "Bed frame, Full/Double, 137 × 191 cm", size: [142, 146, 198], x: { m: 137, l: 191, f: 93 } }, // its article is the Full
};
@@ -124,4 +133,18 @@ export const SAME: Record<string, string> = {
"malm-bedside-table-1-drawer": "malm-2-drawers",
"tonstad-sideboard-121-x-81": "tonstad-sideboard-121-x-47-x-90",
"gursken-chest-3-drawers-69-x-67": "gursken-chest-3-drawers",
+ "idanas-sideboard-160-x-87": "idanas-sideboard-124-x-50-x-95",
+ "idanas-bookcase-81-x-225": "idanas-bookcase-81-x-39-x-211",
+ "vihals-chest-6-drawers": "vihals-chest-6-drawers-140-x-47-x-75",
+ "sundso-table-65": "sundso-table-65-x-65",
+ "milsbo-glass-door-cabinet-101-x-186": "milsbo-glass-door-cabinet-101-x-100",
+ "lagkapten-desk-120-x-60": "lagkapten-adils-desk-120-x-60",
+ "rudsta-glass-door-cabinet-80-x-170": "rudsta-glass-door-cabinet-80-x-37-x-120",
+ "hemnes-bench": "hemnes-bench-83",
+ "brimnes-nightstand": "brimnes-bedside-table-39-x-41-x-53",
+ "tarva-chest-6-drawers": "tarva-6-drawer-dresser-151-x-92",
+ "tarva-nightstand": "tarva-nightstand-48-x-39-x-62",
+ "havsta-sideboard-100-x-89": "havsta-sideboard-basic-unit-121-x-47-x-89",
+ "brimnes-cabinet-doors-39-x-95": "brimnes-cabinet-doors-78-x-95",
+ "hemnes-glass-door-cabinet-90-x-197": "hemnes-glass-door-cabinet-3-drawers-90-x-197",
};
diff --git a/src/engine/drawable.ts b/src/engine/drawable.ts
index 2341882..143894e 100644
--- a/src/engine/drawable.ts
+++ b/src/engine/drawable.ts
@@ -103,7 +103,8 @@ export function partDrawable(p: PartType, holes: Hole[]) {
const mat = q.material ?? p.material;
const c = MAT_COLOR[mat] ?? FACE.board;
const at = { position: q.pos, rotation: q.rot };
- if (q.shape === "halfcyl") addSolid(d, `hcyl:${qx}:${qy}`, () => halfDisc(qx, qy), c, { hull: "radial", ...at });
+ if (q.shape === "slab" && q.outline?.length) addSolid(d, `slab:${qy}:${q.round ?? 0}:${q.outline.flat().map(Math.round).join(",")}`, () => slab(q.outline!, qy, q.round ?? 0), c, { hull: "radial", ...at });
+ else if (q.shape === "halfcyl") addSolid(d, `hcyl:${qx}:${qy}`, () => halfDisc(qx, qy), c, { hull: "radial", ...at });
else if (q.shape === "cyl") addSolid(d, `cyl:${qx}:${qy}`, () => new THREE.CylinderGeometry(qx / 2, qx / 2, qy, 32), c, { hull: "cyl", ...at });
else if (mat === "soft") addSolid(d, `soft:${qx}:${qy}:${qz}`, () => roundedBox(qx, qy, qz, Math.min(42, qy / 2.4, qx / 3, qz / 3)), c, { hull: "box", half: [qx / 2, qy / 2, qz / 2], edges: false, ...at });
else addSolid(d, `box:${qx}:${qy}:${qz}`, () => new THREE.BoxGeometry(qx, qy, qz), c, at);
@@ -115,6 +116,9 @@ export function partDrawable(p: PartType, holes: Hole[]) {
} else {
addSolid(d, `box:${sx}:${sy}:${sz}`, () => new THREE.BoxGeometry(sx, sy, sz), color);
}
+ // a hole is drawn only where it sits on the part: one recorded off it would float in the air
+ const near = (h: Hole) => h.p.every((v, i) => Math.abs(v) <= p.size[i] / 2 + 3);
+ holes = holes.filter(near);
if (holes.length) {
const pts: number[] = [];
const seg = 14;
@@ -148,6 +152,29 @@ export function partDrawable(p: PartType, holes: Hole[]) {
return d;
}
+/** A flat board cut to an outline of [x, z] corners, each corner rounded, centred on its thickness. */
+function slab(pts: [number, number][], h: number, r: number) {
+ const s = new THREE.Shape();
+ const n = pts.length;
+ pts.forEach((c, i) => {
+ const prev = pts[(i + n - 1) % n], next = pts[(i + 1) % n];
+ const toward = (o: [number, number], k: number): [number, number] => {
+ const dx = o[0] - c[0], dz = o[1] - c[1], l = Math.hypot(dx, dz) || 1;
+ return [c[0] + (dx / l) * k, c[1] + (dz / l) * k];
+ };
+ const k = Math.min(r, Math.hypot(prev[0] - c[0], prev[1] - c[1]) / 2, Math.hypot(next[0] - c[0], next[1] - c[1]) / 2);
+ const a = toward(prev, k), b = toward(next, k);
+ if (i === 0) s.moveTo(a[0], a[1]);
+ else s.lineTo(a[0], a[1]);
+ s.quadraticCurveTo(c[0], c[1], b[0], b[1]);
+ });
+ s.closePath();
+ const g = new THREE.ExtrudeGeometry(s, { depth: h, bevelEnabled: false, curveSegments: 14 });
+ g.rotateX(Math.PI / 2);
+ g.translate(0, h / 2, 0);
+ return g;
+}
+
/** Half a disc (one half of a round table top): flat edge along x at the back, curve towards the front, centred on its box. */
function halfDisc(dia: number, h: number) {
const s = new THREE.Shape();
diff --git a/src/lib/ikea.ts b/src/lib/ikea.ts
index f371a06..1b6ff35 100644
--- a/src/lib/ikea.ts
+++ b/src/lib/ikea.ts
@@ -116,7 +116,10 @@ let loading: Promise<void> | null = null;
/** "802.758.87", "80275887", "802 758 87" or the "S" combination form, as 8 digits. */
export function articleNo(q: string): string | null {
const m = q.trim().match(/^s?\s*(\d{3})[\s.\-]*(\d{3})[\s.\-]*(\d{2})$/i);
- return m ? m[1] + m[2] + m[3] : null;
+ if (m) return m[1] + m[2] + m[3];
+ // a product link from any IKEA site ends in its article number: .../p/idanaes-sideboard-white-80496025/
+ const link = q.match(/ikea\.[a-z.]+\/.*\/p\/[^?#\s]*?-s?(\d{8})\b/i);
+ return link ? link[1] : null;
}
/** Loads the article number index (a separate chunk, so pages don't pay for it until someone types digits). */
diff --git a/src/lib/plan/builder.ts b/src/lib/plan/builder.ts
index f6e4546..0b0c970 100644
--- a/src/lib/plan/builder.ts
+++ b/src/lib/plan/builder.ts
@@ -103,6 +103,11 @@ const HW_NAMES: Record<HwKind, string> = {
spacer: "Wall spacer",
};
+/** The fitting a placed one was made from, own name included, to fit the same again (rows repeating a frame). */
+export function defOf(ht: HwType): HwDef {
+ return { kind: ht.kind, len: ht.len, dia: ht.dia, notIncluded: ht.notIncluded, ...(ht.name !== HW_NAMES[ht.kind] ? { name: ht.name } : {}) };
+}
+
export function hwSpecText(kind: HwKind, len: number, dia: number) {
switch (kind) {
case "dowel":
@@ -312,6 +317,21 @@ export class PlanBuilder {
}
/** Part is shown somewhere else (laid flat, upside down...) from this step until it is added. */
+ /** Where a fitting going in at `at` along `dir` meets a part: its hole is there, not where the fitting starts. */
+ entry(key: string, at: Vec3, dir: Vec3, len: number): Vec3 {
+ const it = this.partItem(key);
+ const size = this.parts.find((p) => p.id === it.ref)?.size;
+ if (!size) return at;
+ const l = toLocal(at, it.final.pos, it.final.rot);
+ const n = unrotate(dir, it.final.rot);
+ const inside = (q: Vec3) => q.every((v, i) => Math.abs(v) <= size[i] / 2 + 0.5);
+ if (inside(l)) return at;
+ for (let t = 1; t <= len + 2; t++) {
+ if (inside([l[0] + n[0] * t, l[1] + n[1] * t, l[2] + n[2] * t])) return [at[0] + dir[0] * t, at[1] + dir[1] * t, at[2] + dir[2] * t];
+ }
+ return at;
+ }
+
stage(key: string, pos: Vec3, rot: Vec3, from?: Vec3) {
const it = this.partItem(key);
const s = this.step_;
@@ -331,7 +351,7 @@ export class PlanBuilder {
const r = o.hole === false ? 0 : (o.hole ?? holeR(def));
if (r > 0) p.holes.push({ p: pos, n: [-dir[0], -dir[1], -dir[2]], r });
}
- if (o.mate) this.hole(o.mate, o.at, o.dir, o.mateHole ?? Math.max(holeR(def), 3));
+ if (o.mate) this.hole(o.mate, this.entry(o.mate, o.at, o.dir, def.len), o.dir, o.mateHole ?? Math.max(holeR(def), 3));
const travel = o.travel ?? defaultTravel(def);
const extra = def.kind === "cam" ? 0.7 : o.spin ? 0.35 : 0;
const it: HwItem = {
diff --git a/src/lib/plan/custom.ts b/src/lib/plan/custom.ts
index 5252c76..a4f118d 100644
--- a/src/lib/plan/custom.ts
+++ b/src/lib/plan/custom.ts
@@ -299,6 +299,23 @@ export function buildCustom(b: PlanBuilder, s: ProductSpec) {
const addedAfter = (n: Node, si: number) => steps.slice(si + 1).some((x) => x.add?.includes(n.id));
const aside = new Set<Node>();
let pose: Pose = "+y";
+ // dowels and cam bolts so far: a part they join has to arrive along them, not slide across them
+ const pins: { host: Node; mate: string; dir: Vec3 }[] = [];
+ const keep = (groups: Group[]) => {
+ for (const g of groups) if (g.def.kind === "dowel" || g.def.kind === "camScrew") for (const f of g.fits) if (f.mate) pins.push({ host: f.host, mate: f.mate, dir: f.dir });
+ };
+ const arrive = (n: Node, others: Node[], given?: Vec3) => {
+ const off = given ?? approach(n, others, pose);
+ if (given) return off;
+ const keys = new Set(others.map((o) => o.key));
+ // a dowel in this part sticks out towards its mate, so the part moves against its direction; one in a part already there, the other way
+ const ways = pins.flatMap((p) => (p.host === n && keys.has(p.mate) ? [p.dir] : p.mate === n.key && others.includes(p.host) ? [p.dir.map((v) => -v) as Vec3] : []));
+ const axes = new Set(ways.map(major));
+ if (axes.size !== 1) return off;
+ const k = [...axes][0];
+ if (major(off) === k && Math.sign(off[k]) === Math.sign(ways[0][k])) return off;
+ return unit(k, Math.sign(ways[0][k]) * Math.hypot(...off));
+ };
steps.forEach((st, si) => {
const adds = (st.add ?? []).map((id) => nodes.get(id)).filter((n): n is Node => !!n && !isPlaced(n));
@@ -370,6 +387,7 @@ export function buildCustom(b: PlanBuilder, s: ProductSpec) {
const pre = fixes.filter((f) => PRE.includes(f.kind));
const post = fixes.filter((f) => !PRE.includes(f.kind));
const preGroups = pre.flatMap((f) => planFits(f, jointsFor(f), freshFor(f), placed, ctx, nodes));
+ keep(preGroups);
// a part that receives fittings before it is joined shows up now, so you can see where they go
const hosts = adds.length ? [] : [...new Set(preGroups.flatMap((g) => g.fits.map((x) => x.host)))].filter((n) => !isPlaced(n));
@@ -381,7 +399,7 @@ export function buildCustom(b: PlanBuilder, s: ProductSpec) {
const fresh = [...new Set([...hosts, ...toWait])].filter((n) => !aside.has(n));
if (fresh.length) {
for (const n of fresh) {
- const off = st.from?.[n.id] ?? approach(n, [...placed, ...inStep], pose);
+ const off = arrive(n, [...placed, ...inStep], st.from?.[n.id]);
if (toWait.includes(n)) {
const it = b.partItem(n.key);
b.stage(n.key, beside(n, off, ctx), it.final.rot, off);
@@ -403,14 +421,16 @@ export function buildCustom(b: PlanBuilder, s: ProductSpec) {
b.stagger(adds.length > 3 ? 0.18 : 0.26);
for (const n of adds) {
- b.add(n.key, st.from?.[n.id] ?? approach(n, [...placed, ...inStep], pose));
+ b.add(n.key, arrive(n, [...placed, ...inStep], st.from?.[n.id]));
inStep.push(n);
}
if (adds.length) b.then(0.12);
b.stagger(0.05);
for (const f of post) {
- emit(b, planFits(f, jointsFor(f), freshFor(f), [...placed, ...inStep], ctx, nodes), used);
+ const groups = planFits(f, jointsFor(f), freshFor(f), [...placed, ...inStep], ctx, nodes);
+ keep(groups);
+ emit(b, groups, used);
b.then(0.1);
}
stepHosts = hosts.filter((n) => !waiting.includes(n) && !aside.has(n));
@@ -442,6 +462,12 @@ function lookahead(steps: CustomStep[], si: number, nodes: Map<string, Node>, pl
return [];
}
+/** The axis a vector mostly points along. */
+function major(v: Vec3): number {
+ const a = v.map(Math.abs);
+ return a[0] >= a[1] && a[0] >= a[2] ? 0 : a[1] >= a[2] ? 1 : 2;
+}
+
function approach(n: Node, others: Node[], pose: Pose): Vec3 {
let best: Contact | null = null;
let bestLen = 0;
@@ -632,9 +658,10 @@ const STACKS: HwKind[] = ["washer", "nut", "cap", "clamp"];
function emit(b: PlanBuilder, groups: Group[], used: Vec3[]) {
const total = groups.reduce((s, g) => s + g.fits.length, 0);
for (const g of groups) {
- const list: FitOpts[] = g.fits.map(({ host: _host, slide, ...o }) => {
- void _host;
+ const list: FitOpts[] = g.fits.map(({ host, slide, ...o }) => {
const at: Vec3 = [...o.at];
+ // moved along the joint, a fitting has to stay on the part it goes into
+ const onHost = (p: Vec3) => [0, 1, 2].every((k) => o.dir[k] !== 0 || (p[k] >= host.box.min[k] - 1 && p[k] <= host.box.max[k] + 1));
const free = (p: Vec3) => used.every((u) => Math.hypot(u[0] - p[0], u[1] - p[1], u[2] - p[2]) > 22);
// washers, nuts and caps go on the bolt already there, so they share its point
if (!STACKS.includes(g.def.kind) && !free(at)) {
@@ -643,7 +670,7 @@ function emit(b: PlanBuilder, groups: Group[], used: Vec3[]) {
for (const k of axis) {
const p: Vec3 = [...at];
p[k] += step;
- if (free(p)) {
+ if (free(p) && onHost(p)) {
at[0] = p[0];
at[1] = p[1];
at[2] = p[2];
@@ -652,7 +679,8 @@ function emit(b: PlanBuilder, groups: Group[], used: Vec3[]) {
}
}
}
- used.push(at);
+ // a washer, nut or cap shares its bolt's point, so it never pushes the bolt listed after it off that point
+ if (!STACKS.includes(g.def.kind)) used.push(at);
return { ...o, at };
});
b.fits(g.def, list, Math.min(0.07, 2.4 / Math.max(1, total)));
diff --git a/src/lib/plan/families/_hemnes-beds.ts b/src/lib/plan/families/_hemnes-beds.ts
new file mode 100644
index 0000000..2d12a38
--- /dev/null
+++ b/src/lib/plan/families/_hemnes-beds.ts
@@ -0,0 +1,767 @@
+import type { PlanBuilder } from "../builder";
+import { buildCustom } from "../custom";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, PartMaterial, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/*
+ * HEMNES beds and benches, read from IKEA's manuals.
+ *
+ * Bed frame (90 and 160 wide, one manual each, the same steps): the headboard is put together on a rug, front up.
+ * Cam bolts in the left post, the spindle section on dowels and a cam lock, the lower panel slid in on dowels and
+ * cam locks, the right post on the same way, the crown on dowels with four long bolts up through the spindle section.
+ * Two threaded rods go into the posts for the side rails. The footboard comes in one piece and gets its two rods.
+ * The side rails go on with three dowels each end and a slotted plate and nut over each rod, tightened with the
+ * spanner, then the slat supports are screwed inside the rails. The 90 has one cross bar; the 160 a centre beam on
+ * two brackets and two cross bars. Slat stops hold a slatted base (sold separately).
+ *
+ * Daybed with 3 drawers: the pull-out bed is built first on the rug lying on its back (castors and runners on four
+ * beams, the low long board with its slat strip, the beams and ends on dowels and cam bolts, the front panel on
+ * top), stood up and given thirteen slats. The daybed: the back panel with its slat strip, the two ends on dowels,
+ * barrel nuts and long bolts, glides with it upside down, the front rail on two clips, then it is turned over and
+ * gets fourteen slats, two of them on L plates. Two people push the pull-out bed in, the caps go on on push-in
+ * dowels, and the three drawers (cam bolts and cam locks, bottom slid in, runners, knob) slide into the pull-out bed.
+ *
+ * Bench with shoe storage: the seat lies upside down for its two rails, the left side frame goes on with barrel nuts
+ * and long bolts, two shoe rods are bolted to it, then it stands on that side while the other eight rods drop in,
+ * a cardboard guide keeps them in line and the right side frame goes on top.
+ */
+
+const box = (id: string, name: string, lo: Vec3, hi: Vec3, material: PartMaterial = "board", o: Partial<CustomPart> = {}): CustomPart => ({
+ id,
+ name,
+ size: [hi[0] - lo[0], hi[1] - lo[1], hi[2] - lo[2]],
+ pos: [(lo[0] + hi[0]) / 2, (lo[1] + hi[1]) / 2, (lo[2] + hi[2]) / 2],
+ material,
+ ...o,
+});
+/** A piece of a part, from its corners in product mm, relative to the part's centre. */
+const piece = (c: Vec3, lo: Vec3, hi: Vec3, shape: PartPiece["shape"] = "box"): PartPiece => ({
+ shape,
+ size: [hi[0] - lo[0], hi[1] - lo[1], hi[2] - lo[2]],
+ pos: [(lo[0] + hi[0]) / 2 - c[0], (lo[1] + hi[1]) / 2 - c[1], (lo[2] + hi[2]) / 2 - c[2]],
+});
+const fix = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const spread = (a: number, b: number, n: number) => Array.from({ length: n }, (_, i) => (n === 1 ? (a + b) / 2 : a + ((b - a) * i) / (n - 1)));
+const range = (n: number) => Array.from({ length: n }, (_, i) => i);
+const LR = [-1, 1] as const;
+
+/* ---------- bench with shoe storage ---------- */
+
+function shoeBench(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const P = 45, capT = 30, xs = W / 2 - 30; // side frames: posts 45 square under a 60 wide cap
+ const xi = xs - P / 2; // inner face of the side frames
+ const zp = D / 2 - 22 - P / 2; // posts' centres front and back
+ const seatT = 30, seatY = 470, apronH = 60;
+ const ys = { seat: seatY - seatT - apronH, up: 290, low: 120 }; // rail under the seat, the two rod rungs
+ const parts: CustomPart[] = [];
+ for (const g of LR) {
+ const c: Vec3 = [g * xs, H / 2, 0];
+ const lo = (x0: number, y0: number, z0: number): Vec3 => [g * xs + x0, y0, z0];
+ parts.push({
+ ...box(g < 0 ? "SL" : "SR", "Side frame", [g * xs - 30, 0, -D / 2], [g * xs + 30, H, D / 2], "wood"),
+ pieces: [
+ piece(c, lo(-P / 2, 0, zp - P / 2), lo(P / 2, H - capT, zp + P / 2)),
+ piece(c, lo(-P / 2, 0, -zp - P / 2), lo(P / 2, H - capT, -zp + P / 2)),
+ piece(c, lo(-30, H - capT, -D / 2), lo(30, H, D / 2)),
+ piece(c, lo(-12, ys.seat, -zp + P / 2), lo(12, ys.seat + apronH, zp - P / 2)),
+ piece(c, lo(-12, ys.up - 20, -zp + P / 2), lo(12, ys.up + 20, zp - P / 2)),
+ piece(c, lo(-12, ys.low - 20, -zp + P / 2), lo(12, ys.low + 20, zp - P / 2)),
+ ],
+ });
+ }
+ parts.push(box("T", "Seat", [-xi, seatY - seatT, -D / 2 + 10], [xi, seatY, D / 2 - 10], "wood"));
+ for (const g of LR) parts.push(box(g < 0 ? "AB" : "AF", "Seat rail", [-xi, seatY - seatT - apronH, g * zp - 10], [xi, seatY - seatT, g * zp + 10], "wood"));
+ const rodZ = spread(-zp + 40, zp - 40, 5);
+ const rods: string[] = [];
+ for (const [li, y] of [ys.up, ys.low].entries())
+ rodZ.forEach((z, i) => {
+ const id = `R${li}${i}`;
+ rods.push(id);
+ parts.push({ ...box(id, "Shoe rod", [-xs + 12, y - 8, z - 8], [xs - 12, y + 8, z + 8], "metal"), shape: "cyl" });
+ });
+ const bolted = ["R00", "R10"]; // the back rod of each level holds the frame square
+ const loose = rods.filter((r) => !bolted.includes(r));
+ const apronY = seatY - seatT - apronH / 2;
+ const sideBolts = (g: number) => [
+ fix("nut", LR.map((h): Vec3 => [g * (xi - 25), seatY - seatT - apronH, h * zp]), [0, 1, 0], { name: "Barrel nut", len: 14, dia: 10 }),
+ ...LR.map((h) => fix("bolt", [[g * (xs + P / 2), apronY, h * zp]], [-g, 0, 0], { len: 80, dia: 6, mate: h < 0 ? "AB" : "AF" })),
+ ];
+ const rodBolts = (g: number) => fix("bolt", [ys.up, ys.low].map((y): Vec3 => [g * (xs + 12), y, rodZ[0]]), [-g, 0, 0], { len: 40, dia: 6 });
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the seat rails under the seat",
+ detail: "Lay the seat upside down on a rug, set a rail along each long edge and drive two screws through each into the seat.",
+ add: ["T", "AB", "AF"],
+ fix: LR.map((h) => fix("screw", [-xi / 2, xi / 2].map((x): Vec3 => [x, seatY - seatT - apronH, h * zp]), [0, 1, 0], { len: 70, dia: 5, on: h < 0 ? "AB" : "AF", mate: "T" })),
+ tools: ["allen"],
+ pose: "-y",
+ warnings: ["floor"],
+ from: { AB: [0, 200, 0], AF: [0, 200, 0] },
+ },
+ {
+ title: "Bolt on the left side frame",
+ detail: "Push a barrel nut into each rail end, slot turned to the bolt, then two long bolts through the posts. Hand tight for now.",
+ add: ["SL"],
+ fix: sideBolts(-1),
+ tools: ["allen", "flathead"],
+ from: { SL: [-300, 0, 0] },
+ },
+ {
+ title: "Bolt two shoe rods to the side frame",
+ detail: "One rod into each rung, at the back. The bolt goes through the frame into the end of the rod; check the rod end has its thread insert.",
+ add: bolted,
+ fix: [rodBolts(-1)],
+ tools: ["allen"],
+ from: Object.fromEntries(bolted.map((r) => [r, [500, 0, 0] as Vec3])),
+ },
+ {
+ title: "Stand it on the left side and drop in the rods",
+ detail: "Tip it onto the left side frame. The other eight rods go straight down into the holes in the rungs.",
+ add: loose,
+ pose: "+x",
+ from: Object.fromEntries(loose.map((r) => [r, [700, 0, 0] as Vec3])),
+ },
+ {
+ title: "Slide the cardboard guide over the rods",
+ detail: "The sheet from the box with the holes keeps the rod tops in line while you fit the other side.",
+ },
+ {
+ title: "Lower the right side frame on",
+ detail: "Guide every rod into its hole as it goes down.",
+ add: ["SR"],
+ from: { SR: [400, 0, 0] },
+ },
+ {
+ title: "Bolt the right side frame to the seat rails",
+ detail: "Barrel nuts in, then two long bolts. Tighten all four now.",
+ fix: sideBolts(1),
+ tools: ["allen", "flathead"],
+ },
+ { title: "Bolt the two rods to the right side frame", detail: "Through the frame into the same two rods as on the other side.", fix: [rodBolts(1)], tools: ["allen"] },
+ { title: "Pull out the guide and stand it up", detail: "Lift the cardboard off the rods and throw it away, then turn the bench onto its feet.", pose: "+y" },
+ ];
+ return { parts, steps };
+}
+
+/* ---------- bed frame ---------- */
+
+function bedFrame(s: ProductSpec): CustomParams {
+ const wide = /160|140|180/.test(s.slug ?? s.variant);
+ const M = Number(/(\d{2,3})\s*(?:-x-|\s*[x×]\s*)200/.exec(`${s.slug} ${s.variant}`)?.[1] ?? 90) * 10; // mattress width
+ const W = Math.max(s.size.w * 10, M + 120), D = s.size.d * 10, H = s.size.h * 10;
+ const P = (W - M) / 2; // posts
+ const X = M / 2; // inner faces of the posts, the side rails' inner faces
+ const crownT = 30, footH = 660;
+ const zh = -D / 2 + P / 2, zf = D / 2 - P / 2; // headboard and footboard centre planes
+ const zhi = -D / 2 + P, zfi = D / 2 - P; // their inner faces at the posts
+ const railY0 = 150, railY1 = 330, railT = 22;
+ const supY = 260; // top of the slat supports
+ const ladY0 = 720, ladY1 = H - crownT;
+ const spindles = wide ? 12 : 4;
+ const parts: CustomPart[] = [];
+ // headboard: two posts, the spindle section, the lower panel and the crown
+ for (const g of LR) parts.push(box(g < 0 ? "HL" : "HR", "Headboard post", [g < 0 ? -X - P : X, 0, -D / 2], [g < 0 ? -X : X + P, H - crownT, -D / 2 + P], "wood"));
+ const ladC: Vec3 = [0, (ladY0 + ladY1) / 2, zh];
+ parts.push({
+ ...box("HS", "Spindle section", [-X, ladY0, zh - 15], [X, ladY1, zh + 15], "wood"),
+ pieces: [
+ piece(ladC, [-X, ladY1 - 80, zh - 15], [X, ladY1, zh + 15]),
+ piece(ladC, [-X, ladY0, zh - 15], [X, ladY0 + 70, zh + 15]),
+ ...spread(-X + M / (spindles + 1), X - M / (spindles + 1), spindles).map((x) => piece(ladC, [x - 22, ladY0 + 70, zh - 10], [x + 22, ladY1 - 80, zh + 10])),
+ ],
+ });
+ parts.push(box("HP", "Headboard panel", [-X, railY0, zh - 9], [X, ladY0, zh + 9]));
+ parts.push(box("HC", "Crown", [-W / 2 - 10, H - crownT, -D / 2 - 10], [W / 2 + 10, H, -D / 2 + P + 10], "wood"));
+ // footboard: comes in one piece
+ const fc: Vec3 = [0, footH / 2, zf];
+ parts.push({
+ ...box("F", "Footboard", [-W / 2 - 10, 0, D / 2 - P - 10], [W / 2 + 10, footH, D / 2 + 10], "wood"),
+ pieces: [
+ piece(fc, [-X - P, 0, D / 2 - P], [-X, footH - crownT, D / 2]),
+ piece(fc, [X, 0, D / 2 - P], [X + P, footH - crownT, D / 2]),
+ piece(fc, [-W / 2 - 10, footH - crownT, D / 2 - P - 10], [W / 2 + 10, footH, D / 2 + 10]),
+ piece(fc, [-X, footH - crownT - 90, zf - 15], [X, footH - crownT, zf + 15]),
+ piece(fc, [-X, railY0, zf - 9], [X, footH - crownT - 90, zf + 9]),
+ ...(wide ? [piece(fc, [-30, railY0, zf - 15], [30, footH - crownT - 90, zf + 15])] : []),
+ ],
+ });
+ // side rails and slat supports
+ for (const g of LR) {
+ const xr0 = g < 0 ? -X - railT : X, xr1 = g < 0 ? -X : X + railT;
+ parts.push(box(g < 0 ? "RL" : "RR", "Side rail", [xr0, railY0, zhi], [xr1, railY1, zfi]));
+ const xs0 = g < 0 ? -X : X - 25, xs1 = g < 0 ? -X + 25 : X;
+ parts.push(box(g < 0 ? "SL" : "SR", "Slat support", [xs0, supY - 30, zhi + 10], [xs1, supY, zfi - 10], wide ? "metal" : "wood"));
+ }
+ // what holds the slats up in the middle
+ const barY0 = supY - 30, barZ = wide ? [-(D / 2 - P) / 2, (D / 2 - P) / 2] : [0];
+ if (wide) parts.push(box("CB", "Centre beam", [-30, barY0 - 70, zh + 9], [30, barY0, zf - 9], "wood"));
+ barZ.forEach((z, i) => parts.push(box(`X${i}`, "Cross bar", [-X + 25, barY0, z - 15], [X - 25, supY, z + 15], "metal")));
+ parts.push({ ...box("SB", "Your slatted base", [-X + 5, supY, zhi + 15], [X - 5, supY + 20, zfi - 15], "wood"), extra: true });
+
+ const rodY = (railY0 + railY1) / 2;
+ const camYs = [ladY0 + 40, railY0 + 80, (railY0 + ladY0) / 2, ladY0 - 80];
+ const postCams = (g: number) => fix("camScrew", camYs.map((y): Vec3 => [g * X, y, zh]), [g, 0, 0], { len: 34, dia: 6, on: g < 0 ? "HL" : "HR" });
+ const ladDowels = (g: number) => fix("dowel", [ladY0 + 20, ladY1 - 30].map((y): Vec3 => [g * X, y, zh]), [g, 0, 0], { len: 40, dia: 8, on: "HS", mate: g < 0 ? "HL" : "HR" });
+ const panelDowels = (g: number) => fix("dowel", spread(railY0 + 40, ladY0 - 40, 4).map((y): Vec3 => [g * X, y, zh]), [g, 0, 0], { len: 40, dia: 8, on: "HP", mate: g < 0 ? "HL" : "HR" });
+ const ladLock = (g: number) => fix("cam", [[g * (X - 30), ladY0 + 40, zh + 15]], [0, 0, -1], { dia: 15, on: "HS" });
+ const panelLocks = (g: number) => fix("cam", camYs.slice(1).map((y): Vec3 => [g * (X - 30), y, zh + 9]), [0, 0, -1], { dia: 15, on: "HP" });
+ const railEnd = (g: number, head: boolean) => {
+ const z = head ? zhi : zfi;
+ const zd = head ? -1 : 1;
+ const x = g * (X + railT / 2);
+ return [
+ fix("dowel", [railY0 + 30, rodY + 50, railY1 - 30].map((y): Vec3 => [x, y, z]), [0, 0, zd], { len: 40, dia: 10, on: g < 0 ? "RL" : "RR", mate: head ? (g < 0 ? "HL" : "HR") : "F" }),
+ fix("plate", [[x, rodY, z - zd * 3]], [0, 0, zd], { name: "Slotted plate", len: 3, dia: 40 }),
+ fix("nut", [[x, rodY, z - zd * 25]], [0, 0, zd], { len: 10, dia: 13 }),
+ ];
+ };
+ const steps: CustomStep[] = [
+ {
+ title: "Screw cam bolts into the left post",
+ detail: "Lay the headboard parts on a rug, front up. Four cam bolts into the inside of the left post.",
+ add: ["HL"],
+ fix: [postCams(-1)],
+ tools: ["screwdriver"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ { title: "Tap two dowels into the spindle section", detail: "Into its left end.", fix: [ladDowels(-1)], tools: ["hammer"], wait: ["HS"] },
+ {
+ title: "Join the spindle section to the post",
+ detail: "Push it onto the dowels and cam bolt, then turn its cam lock clockwise.",
+ add: ["HS"],
+ fix: [ladLock(-1)],
+ tools: ["screwdriver"],
+ from: { HS: [300, 0, 0] },
+ },
+ { title: "Tap four dowels into the lower panel", detail: "Into its left end.", fix: [panelDowels(-1)], tools: ["hammer"], wait: ["HP"] },
+ {
+ title: "Slide the lower panel in",
+ detail: "Its top edge runs in the groove under the spindle section. Push it all the way to the post.",
+ add: ["HP"],
+ from: { HP: [600, 0, 0] },
+ },
+ { title: "Lock the panel with three cam locks", detail: "Arrows towards the post, then turn them clockwise.", fix: [panelLocks(-1)], tools: ["screwdriver"] },
+ { title: "Screw cam bolts into the right post", detail: "Four, like the left one.", fix: [postCams(1)], tools: ["screwdriver"], wait: ["HR"] },
+ { title: "Tap six dowels into the free ends", detail: "Two in the spindle section and four in the lower panel.", fix: [ladDowels(1), panelDowels(1)], tools: ["hammer"] },
+ {
+ title: "Push the right post on",
+ detail: "Onto the dowels and cam bolts, then lock the spindle section with its cam lock.",
+ add: ["HR"],
+ fix: [ladLock(1)],
+ tools: ["screwdriver"],
+ from: { HR: [300, 0, 0] },
+ },
+ { title: "Lock the panel at the right post", detail: "Three cam locks, clockwise until tight.", fix: [panelLocks(1)], tools: ["screwdriver"] },
+ {
+ title: "Put the crown on",
+ detail: "Six dowels into the top ends of the posts and the spindle section, then press the crown on.",
+ add: ["HC"],
+ fix: [fix("dowel", [...LR.map((g) => g * (X + P / 2)), ...spread(-X + 150, X - 150, 4)].map((x): Vec3 => [x, H - crownT, zh]), [0, 1, 0], { len: 40, dia: 8, mate: "HC" })],
+ tools: ["hammer"],
+ from: { HC: [0, 300, 0] },
+ },
+ {
+ title: "Bolt the crown down",
+ detail: "Four long bolts up through the spindle section into the crown, from between the spindles.",
+ fix: [fix("bolt", spread(-X + M / (spindles + 1) / 2, X - M / (spindles + 1) / 2, 4).map((x): Vec3 => [x, ladY1 - 80, zh]), [0, 1, 0], { len: 100, dia: 6, on: "HS", mate: "HC" })],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw a threaded rod into each post",
+ detail: "Into the inside of the posts, by hand, until half of it is showing. The side rails hang on these.",
+ fix: [fix("stud", LR.map((g): Vec3 => [g * (X + railT / 2), rodY, zhi]), [0, 0, -1], { name: "Threaded rod", len: 70, dia: 10 })],
+ },
+ ...(wide
+ ? []
+ : [{ title: "Tap in two glides", detail: "Hammer one into the bottom of each headboard post.", fix: [fix("glide", LR.map((g): Vec3 => [g * (X + P / 2), 0, zh]), [0, 1, 0], { len: 8, dia: 30 })], tools: ["hammer" as const] }]),
+ {
+ title: "Screw the rods into the footboard",
+ detail: "Lay the footboard on the rug, inside up, and screw a threaded rod into each post the same way.",
+ add: ["F"],
+ fix: [fix("stud", LR.map((g): Vec3 => [g * (X + railT / 2), rodY, zfi]), [0, 0, 1], { name: "Threaded rod", len: 70, dia: 10, on: "F" })],
+ pose: "-z",
+ from: { F: [0, 0, 400] },
+ },
+ ...(wide
+ ? []
+ : [{ title: "Tap two glides into the footboard", detail: "One into the bottom of each post.", fix: [fix("glide", LR.map((g): Vec3 => [g * (X + P / 2), 0, zf]), [0, 1, 0], { len: 8, dia: 30 })], tools: ["hammer" as const] }]),
+ {
+ title: "Hang the first side rail on the footboard",
+ detail: "Stand the footboard up. Three dowels into the rail end, the slotted plate over the rod, push the rail on and tighten the nut with the spanner.",
+ add: ["RL"],
+ fix: railEnd(-1, false),
+ people: 2,
+ pose: "+y",
+ tools: ["wrench", "hammer"],
+ from: { RL: [0, 0, 600] },
+ },
+ { title: "Hang the other rail on the footboard", detail: "The same way, on the other post.", add: ["RR"], fix: railEnd(1, false), people: 2, tools: ["wrench", "hammer"], from: { RR: [0, 0, 600] } },
+ {
+ title: "Join the headboard to the rails",
+ detail: "Three dowels into each free rail end, then one person holds the headboard while the other guides the rails onto the rods. Tighten both nuts.",
+ fix: [...railEnd(-1, true), ...railEnd(1, true)],
+ people: 2,
+ tools: ["wrench", "hammer"],
+ warnings: ["two"],
+ },
+ {
+ title: "Screw the slat supports inside the rails",
+ detail: "At the height that suits your slatted base. Eight screws in each.",
+ add: ["SL", "SR"],
+ fix: LR.map((g) => fix("screw", spread(zhi + 120, zfi - 120, 8).map((z): Vec3 => [g * (X - 25), supY - 15, z]), [g, 0, 0], { len: 30, dia: 4, on: g < 0 ? "SL" : "SR" })),
+ tools: ["screwdriver"],
+ },
+ ];
+ if (wide) {
+ steps.push(
+ {
+ title: "Screw the beam brackets on",
+ detail: "One in the middle of the headboard and one of the footboard, low down inside. Three screws each.",
+ fix: [
+ fix("plate", [[0, barY0 - 35, zh + 9]], [0, 0, -1], { name: "Beam bracket", len: 4, dia: 80, on: "HP" }),
+ fix("plate", [[0, barY0 - 35, zf - 9]], [0, 0, 1], { name: "Beam bracket", len: 4, dia: 80, on: "F" }),
+ fix("screw", [-25, 0, 25].map((x): Vec3 => [x, barY0 - 75, zh + 13]), [0, 0, -1], { len: 16, dia: 4, on: "HP" }),
+ fix("screw", [-25, 0, 25].map((x): Vec3 => [x, barY0 - 75, zf - 13]), [0, 0, 1], { len: 16, dia: 4, on: "F" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lay the centre beam in",
+ detail: "Slide the metal sleeve onto its end first, then drop it into the head bracket and push it into the foot bracket.",
+ add: ["CB"],
+ fix: [fix("connector", [[0, barY0 - 35, zf - 300]], [0, 0, 1], { name: "Beam sleeve", len: 80, dia: 70, on: "CB" })],
+ from: { CB: [0, 300, 0] },
+ },
+ {
+ title: "Lay the two cross bars across",
+ detail: "Pull each one out until it reaches both slat supports, set it over the beam, and screw it to the beam.",
+ add: ["X0", "X1"],
+ fix: [fix("screw", barZ.map((z): Vec3 => [0, supY, z]), [0, -1, 0], { len: 12, dia: 5, mate: "CB" })],
+ tools: ["screwdriver"],
+ from: { X0: [0, 300, 0], X1: [0, 300, 0] },
+ },
+ {
+ title: "Screw the cross bars to the supports",
+ detail: "One screw at the end of each bar, down into the slat support. Check the beam and bars run straight, not crooked.",
+ fix: [fix("screw", barZ.map((z): Vec3 => [X - 40, supY, z]), [0, -1, 0], { len: 12, dia: 5, mate: "SR" })],
+ tools: ["screwdriver"],
+ check: "square",
+ },
+ );
+ } else {
+ steps.push(
+ {
+ title: "Lay the cross bar across the middle",
+ detail: "Pull it out until it reaches both slat supports and screw one end down with two screws.",
+ add: ["X0"],
+ fix: [fix("screw", [[-X + 40, supY, -8], [-X + 40, supY, 8]], [0, -1, 0], { len: 12, dia: 5 })],
+ tools: ["screwdriver"],
+ from: { X0: [0, 300, 0] },
+ },
+ { title: "Screw the other end down", detail: "One screw into the other slat support.", fix: [fix("screw", [[X - 40, supY, 0]], [0, -1, 0], { len: 12, dia: 5 })], tools: ["screwdriver"] },
+ );
+ }
+ const stops = wide ? 8 : 4;
+ steps.push({
+ title: "Bolt on the slat stops",
+ detail: "Only for a slatted base that lies loose: they keep it from sliding. One bolt each, on top of the supports.",
+ fix: LR.flatMap((g) => {
+ const on = g < 0 ? "SL" : "SR";
+ const zs = spread(zhi + 60, zfi - 60, stops / 2);
+ return [
+ fix("clip", zs.map((z): Vec3 => [g * (X - 12), supY, z]), [0, -1, 0], { name: "Slat stop", len: 15, dia: 25, on }),
+ fix("bolt", zs.map((z): Vec3 => [g * (X - 12), supY + 23, z]), [0, -1, 0], { len: 30, dia: 6, mate: on }),
+ ];
+ }),
+ tools: ["allen"],
+ });
+ steps.push({ title: "Lay in your slatted base", detail: "It is sold separately. Lay it on the supports and the cross bars.", add: ["SB"] });
+ return { parts, steps };
+}
+
+/* ---------- daybed with 3 drawers ---------- */
+
+function daybed(s: ProductSpec): CustomParams {
+ const mattresses = /mattress/i.test(`${s.variant} ${s.slug ?? ""}`);
+ const L = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10; // 2090 x 830 x 890
+ const Z = D / 2, et = 45, X = L / 2, xi = X - et; // end panels 45 thick
+ const capT = 25, EH = H - capT;
+ const SY = 400, ST = 18; // the daybed's slats sit on its strip and front rail at 40 cm
+ const zb = -Z + 20; // inside face of the back panel
+ const parts: CustomPart[] = [
+ box("BP", "Back panel", [-xi, 150, -Z], [xi, EH, zb]),
+ box("EL", "End panel", [-X, 0, -Z], [-xi, EH, Z]),
+ box("ER", "End panel", [xi, 0, -Z], [X, EH, Z]),
+ box("BS", "Slat strip", [-xi, SY - 20, zb], [xi, SY, zb + 20], "metal"),
+ box("FR", "Front rail", [-xi, SY - 20, Z - 60], [xi, SY, Z - 30], "metal"),
+ box("BC", "Back cap", [-xi, EH, -Z], [xi, H, -Z + 60], "wood"),
+ box("CL", "End cap", [-X, EH, -Z], [-xi + 15, H, Z], "wood"),
+ box("CR", "End cap", [xi - 15, EH, -Z], [X, H, Z], "wood"),
+ ];
+ const slatX = spread(-xi + 50, xi - 50, 14);
+ slatX.forEach((x, i) => parts.push(box(`S${i}`, i === 0 || i === 13 ? "End slat" : "Slat", [x - 35, SY, zb + 5], [x + 35, SY + ST, Z - 35], "wood")));
+ const ends = [0, 13];
+ const mids = range(12).map((k) => k + 1);
+
+ // the pull-out bed, pushed in under the daybed
+ const PX = xi - 20, pt = 18, px = PX - pt;
+ const PY0 = 50, PY1 = 300; // its boards; slats on top at 30 cm
+ const PZ0 = -355, PZF = Z - 20; // back board's outer face, front panel's inner face
+ const pzb = PZ0 + pt; // back board inner face
+ const FT = 20; // front panel thickness
+ const fc: Vec3 = [0, 225, PZF + FT / 2];
+ const beamX = [-px + 25, -312, 312, px - 25];
+ const bays = [(-px + 50 - 337) / 2, 0, (px - 50 + 337) / 2];
+ const bayHalf = (px - 50 - 337) / 2;
+ const openY0 = 60, openY1 = 290;
+ parts.push(
+ box("PB", "Long board", [-PX, PY0, PZ0], [PX, PY1, pzb]),
+ box("PSB", "Slat strip", [-px, PY1 - 20, pzb], [px, PY1, pzb + 20], "metal"),
+ {
+ ...box("PF", "Front panel", [-PX, 20, PZF], [PX, 430, PZF + FT]),
+ pieces: [
+ piece(fc, [-PX, 20, PZF], [PX, openY0, PZF + FT]),
+ piece(fc, [-PX, openY1, PZF], [PX, 360, PZF + FT]),
+ piece(fc, [-PX, openY0, PZF], [-px + 50, openY1, PZF + FT]),
+ piece(fc, [px - 50, openY0, PZF], [PX, openY1, PZF + FT]),
+ piece(fc, [-337, openY0, PZF], [-287, openY1, PZF + FT]),
+ piece(fc, [287, openY0, PZF], [337, openY1, PZF + FT]),
+ piece(fc, [-PX, 360, PZF], [-PX + 260, 430, PZF + FT]),
+ piece(fc, [PX - 260, 360, PZF], [PX, 430, PZF + FT]),
+ ],
+ },
+ box("PSF", "Slat strip", [-px, PY1 - 20, PZF - 20], [px, PY1, PZF], "metal"),
+ box("PEL", "Pull-out end", [-PX, PY0, pzb], [-px, PY1, PZF]),
+ box("PER", "Pull-out end", [px, PY0, pzb], [PX, PY1, PZF]),
+ );
+ const beams = beamX.map((_, i) => `PD${i}`);
+ beamX.forEach((x, i) => parts.push(box(beams[i], "Castor beam", [x - 25, 60, pzb], [x + 25, 140, PZF], "wood")));
+ const pSlatX = spread(-px + 50, px - 50, 13);
+ pSlatX.forEach((x, i) => parts.push(box(`P${i}`, "Slat", [x - 35, PY1, pzb + 8], [x + 35, PY1 + 16, PZF - 8], "wood")));
+ const screwed = [1, 6, 11];
+ const pinned = range(13).filter((i) => !screwed.includes(i));
+
+ // three drawers: the front is the box front, the sides stand on it, the back goes on last
+ const dy0 = 80, dy1 = 280, dz0 = -300, dw = bayHalf - 13, sT = 15;
+ bays.forEach((cx, i) => {
+ parts.push(
+ box(`DF${i}`, "Drawer front", [cx - bayHalf + 4, openY0 + 4, PZF], [cx + bayHalf - 4, openY1 - 4, PZF + FT]),
+ box(`DS${i}a`, "Drawer side", [cx - dw, dy0, dz0 + sT], [cx - dw + sT, dy1, PZF]),
+ box(`DS${i}b`, "Drawer side", [cx + dw - sT, dy0, dz0 + sT], [cx + dw, dy1, PZF]),
+ box(`DB${i}`, "Drawer bottom", [cx - dw + 8, dy0 + 10, dz0 + sT], [cx + dw - 8, dy0 + 14, PZF], "fiber"),
+ box(`DK${i}`, "Drawer back", [cx - dw, dy0, dz0], [cx + dw, dy1, dz0 + sT]),
+ );
+ });
+ if (mattresses)
+ for (const k of [0, 1]) parts.push({ ...box(`M${k}`, "Mattress", [-1000, SY + ST + k * 120, zb + 5], [1000, SY + ST + (k + 1) * 120, zb + 805], "soft"), extra: true });
+
+ const camScrew = { len: 34, dia: 6 };
+ const bigCam = { dia: 15 };
+ const smallCam = { name: "Cam lock", dia: 12, len: 12 };
+ const stripScrews = (id: string, z: number, y: number, xs: number[]) => fix("screw", xs.map((x): Vec3 => [x, y, z]), [0, 1, 0], { len: 12, dia: 4, on: id });
+ // cam bolts in a long board, pointing into the beams and the ends
+ const boardBolts = (id: string, z: number, dz: number) =>
+ fix("camScrew", [...beamX.map((x): Vec3 => [x, 100, z]), ...LR.flatMap((g) => [100, 250].map((y): Vec3 => [g * (PX - pt / 2), y, z]))], [0, 0, dz], { ...camScrew, on: id });
+ const beamLocks = (z: number) => beams.map((id, i) => fix("cam", [[beamX[i], 140, z]], [0, -1, 0], { ...bigCam, on: id }));
+ const endLocks = (z: number) => LR.map((g) => fix("cam", [100, 250].map((y): Vec3 => [g * px, y, z]), [g, 0, 0], { ...bigCam, on: g < 0 ? "PEL" : "PER" }));
+ const runnerZ = (pzb + PZF) / 2;
+ const sideCams = (z: number) => bays.flatMap((cx, i) => LR.map((g) => fix("cam", [dy0 + 40, dy1 - 40].map((y): Vec3 => [cx + g * (dw - sT), y, z]), [g, 0, 0], { ...smallCam, on: `DS${i}${g < 0 ? "a" : "b"}` })));
+ const steps: CustomStep[] = [
+ // the pull-out bed
+ {
+ title: "Screw the castors under the four beams",
+ detail: "The pull-out bed comes first. Two castors under each beam near the ends, two screws each.",
+ fix: beams.flatMap((id, i) => [
+ fix("castor", [[beamX[i], 60, pzb + 70], [beamX[i], 60, PZF - 70]], [0, 1, 0], { len: 60, dia: 50, on: id }),
+ fix("screw", [pzb + 45, pzb + 95, PZF - 95, PZF - 45].map((z): Vec3 => [beamX[i], 60, z]), [0, 1, 0], { len: 16, dia: 4, on: id }),
+ ]),
+ tools: ["screwdriver"],
+ wait: beams,
+ from: Object.fromEntries(beams.map((id) => [id, [0, 0, 500] as Vec3])),
+ },
+ {
+ title: "Screw the right-hand runners onto the beams",
+ detail: "The runners marked CR go on the right face of the first three beams, three screws each.",
+ fix: beams.slice(0, 3).flatMap((id, i) => [
+ fix("runner", [[beamX[i] + 25, 100, runnerZ]], [-1, 0, 0], { len: 650, dia: 30, on: id }),
+ fix("screw", [-250, 0, 250].map((dz): Vec3 => [beamX[i] + 27, 100, runnerZ + dz]), [-1, 0, 0], { len: 10, dia: 3.5, on: id }),
+ ]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the left-hand runners on",
+ detail: "The CL runners on the left face of the other three beams.",
+ fix: beams.slice(1).flatMap((id, k) => [
+ fix("runner", [[beamX[k + 1] - 25, 100, runnerZ]], [1, 0, 0], { len: 650, dia: 30, on: id }),
+ fix("screw", [-250, 0, 250].map((dz): Vec3 => [beamX[k + 1] - 27, 100, runnerZ + dz]), [1, 0, 0], { len: 10, dia: 3.5, on: id }),
+ ]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap dowels into the beam ends",
+ detail: "Two into each end of every beam.",
+ fix: beams.flatMap((id, i) => [
+ fix("dowel", [75, 125].map((y): Vec3 => [beamX[i], y, pzb]), [0, 0, -1], { len: 30, dia: 8, on: id, mate: "PB" }),
+ fix("dowel", [75, 125].map((y): Vec3 => [beamX[i], y, PZF]), [0, 0, 1], { len: 30, dia: 8, on: id, mate: "PF" }),
+ ]),
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the slat strip onto the long board",
+ detail: "Lay the long board on a rug: the pull-out bed is built lying on its back. Two screws at the ends of the strip.",
+ add: ["PB", "PSB"],
+ fix: [stripScrews("PSB", pzb + 10, PY1 - 20, LR.map((g) => g * (px - 30)))],
+ tools: ["screwdriver"],
+ pose: "+z",
+ warnings: ["floor"],
+ from: { PB: [0, 0, -300], PSB: [0, 0, 300] },
+ },
+ { title: "Screw the strip down along its length", detail: "Six more screws through the round holes.", fix: [stripScrews("PSB", pzb + 10, PY1 - 20, spread(-px + 250, px - 250, 6))], tools: ["screwdriver"] },
+ { title: "Screw eight cam bolts into the long board", detail: "Into the holes in its inside face.", fix: [boardBolts("PB", pzb, 1)], tools: ["screwdriver"] },
+ {
+ title: "Stand the beams on the long board",
+ detail: "Castors towards the bottom edge, pushed onto the dowels and cam bolts.",
+ add: beams,
+ from: Object.fromEntries(beams.map((id) => [id, [0, 0, 400] as Vec3])),
+ },
+ { title: "Lock the beams", detail: "One cam lock in each beam, turned clockwise until tight.", fix: beamLocks(pzb + 30), tools: ["screwdriver"] },
+ {
+ title: "Tap dowels into the two ends",
+ detail: "Three into each long edge of both pull-out ends.",
+ fix: LR.flatMap((g) => {
+ const on = g < 0 ? "PEL" : "PER";
+ return [
+ fix("dowel", [120, 175, 230].map((y): Vec3 => [g * (PX - pt / 2), y, pzb]), [0, 0, -1], { len: 30, dia: 8, on, mate: "PB" }),
+ fix("dowel", [120, 175, 230].map((y): Vec3 => [g * (PX - pt / 2), y, PZF]), [0, 0, 1], { len: 30, dia: 8, on, mate: "PF" }),
+ ];
+ }),
+ tools: ["hammer"],
+ wait: ["PEL", "PER"],
+ },
+ { title: "Stand the ends on", detail: "Onto the dowels and cam bolts at both ends of the long board.", add: ["PEL", "PER"], from: { PEL: [0, 0, 400], PER: [0, 0, 400] } },
+ { title: "Lock the ends", detail: "Two cam locks in each end.", fix: endLocks(pzb + 30), tools: ["screwdriver"] },
+ {
+ title: "Screw the slat strip onto the front panel",
+ detail: "Lay the front panel on the rug, inside up. Two screws at the ends of the strip, then six along it.",
+ fix: [stripScrews("PSF", PZF - 10, PY1 - 20, [...LR.map((g) => g * (px - 30)), ...spread(-px + 250, px - 250, 6)])],
+ wait: ["PF", "PSF"],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw eight cam bolts into the front panel", detail: "Into the holes beside the openings.", fix: [boardBolts("PF", PZF, -1)], tools: ["screwdriver"] },
+ {
+ title: "Lower the front panel on",
+ detail: "Turn it over and lower it onto the beams and ends. A strap round it holds it while you lock it.",
+ add: ["PF", "PSF"],
+ from: { PF: [0, 0, 500], PSF: [0, 0, 500] },
+ people: 2,
+ },
+ { title: "Lock the front panel to the ends", detail: "Four cam locks in the ends.", fix: endLocks(PZF - 30), tools: ["screwdriver"] },
+ { title: "Lock it to the beams", detail: "Four cam locks in the beams, then take the strap off.", fix: beamLocks(PZF - 30), tools: ["screwdriver"] },
+ {
+ title: "Screw three slats across",
+ detail: "Use the thirteen shorter slats here. Three go in now, near each end and in the middle, with a screw up through the strip at each end.",
+ add: screwed.map((i) => `P${i}`),
+ fix: [fix("screw", screwed.flatMap((i) => [pzb + 10, PZF - 10].map((z): Vec3 => [pSlatX[i], PY1 - 20, z])), [0, 1, 0], { len: 12, dia: 4 })],
+ tools: ["screwdriver"],
+ from: Object.fromEntries(screwed.map((i) => [`P${i}`, [0, 0, 500] as Vec3])),
+ },
+ {
+ title: "Push pins into the other ten slats",
+ detail: "One into each end.",
+ fix: pinned.map((i) => fix("pin", [pzb + 10, PZF - 10].map((z): Vec3 => [pSlatX[i], PY1, z]), [0, 1, 0], { name: "Slat pin", len: 12, dia: 8, on: `P${i}` })),
+ wait: pinned.map((i) => `P${i}`),
+ },
+ {
+ title: "Stand it up and lay the slats in",
+ detail: "Turn the pull-out bed onto its castors and set the pins into the holes in both strips.",
+ add: pinned.map((i) => `P${i}`),
+ pose: "+y",
+ },
+ // the daybed
+ {
+ title: "Screw the slat strip onto the back panel",
+ detail: "Now the daybed. Lay the back panel on the rug, inside up. Two screws at the ends of the strip.",
+ add: ["BP", "BS"],
+ fix: [stripScrews("BS", zb + 10, SY - 20, LR.map((g) => g * (xi - 30)))],
+ pose: "+z",
+ tools: ["screwdriver"],
+ from: { BP: [0, 0, -400], BS: [0, 0, 300] },
+ },
+ { title: "Screw the strip down along its length", detail: "Six more screws through the round holes.", fix: [stripScrews("BS", zb + 10, SY - 20, spread(-xi + 250, xi - 250, 6))], tools: ["screwdriver"] },
+ {
+ title: "Tap dowels into the end panels",
+ detail: "Three into the inside of each end panel, along the back edge.",
+ fix: LR.map((g) => fix("dowel", [300, 520, 740].map((y): Vec3 => [g * xi, y, -Z + 10]), [g, 0, 0], { len: 30, dia: 8, on: g < 0 ? "EL" : "ER", mate: "BP" })),
+ tools: ["hammer"],
+ wait: ["EL", "ER"],
+ },
+ {
+ title: "Bolt the end panels to the back panel",
+ detail: "Raise each end panel onto its dowels. A barrel nut into the back panel, then two long bolts through each end panel. Hand tight first.",
+ add: ["EL", "ER"],
+ fix: [
+ fix("nut", LR.flatMap((g) => [250, 650].map((y): Vec3 => [g * (xi - 40), y, zb])), [0, 0, -1], { name: "Barrel nut", len: 14, dia: 10, on: "BP" }),
+ ...LR.map((g) => fix("bolt", [250, 650].map((y): Vec3 => [g * X, y, -Z + 10]), [-g, 0, 0], { len: 110, dia: 6, on: g < 0 ? "EL" : "ER", mate: "BP" })),
+ ],
+ tools: ["allen", "flathead"],
+ people: 2,
+ warnings: ["two"],
+ from: { EL: [0, 0, 400], ER: [0, 0, 400] },
+ },
+ {
+ title: "Tip it upside down and fit the glides",
+ detail: "Press a glide into the bottom of each end panel corner.",
+ fix: [fix("glide", LR.flatMap((g) => [-Z + 30, Z - 30].map((z): Vec3 => [g * (X - et / 2), 0, z])), [0, 1, 0], { len: 8, dia: 25 })],
+ pose: "-y",
+ people: 2,
+ },
+ {
+ title: "Clip the front rail in",
+ detail: "Screw a clip to the inside of each end panel at the front, two screws each, then snap the metal rail into the clips.",
+ add: ["FR"],
+ fix: [
+ ...LR.map((g) => fix("clip", [[g * xi, SY - 10, Z - 45]], [g, 0, 0], { name: "Rail clip", len: 30, dia: 25, on: g < 0 ? "EL" : "ER" })),
+ ...LR.map((g) => fix("screw", [SY - 30, SY + 10].map((y): Vec3 => [g * (xi - 2), y, Z - 45]), [g, 0, 0], { len: 20, dia: 4.2, on: g < 0 ? "EL" : "ER" })),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Turn it the right way up", detail: "Two people, lifting by the end panels.", pose: "+y", people: 2 },
+ {
+ title: "Screw the L plates onto the two end slats",
+ detail: "The two slats with holes. A plate under the front end of each, two screws.",
+ fix: ends.flatMap((i) => [
+ fix("plate", [[slatX[i], SY, Z - 45]], [0, 1, 0], { name: "L plate", len: 3, dia: 50, on: `S${i}` }),
+ fix("screw", [-15, 15].map((dx): Vec3 => [slatX[i] + dx, SY, Z - 80]), [0, 1, 0], { len: 12, dia: 4, on: `S${i}` }),
+ ]),
+ tools: ["screwdriver"],
+ wait: ends.map((i) => `S${i}`),
+ },
+ {
+ title: "Screw the end slats in",
+ detail: "One beside each end panel: a screw into the strip at the back, and one through the L plate into the front rail.",
+ add: ends.map((i) => `S${i}`),
+ fix: [
+ fix("screw", ends.map((i): Vec3 => [slatX[i], SY + ST, zb + 10]), [0, -1, 0], { len: 12, dia: 4, mate: "BS" }),
+ fix("screw", ends.map((i): Vec3 => [slatX[i] + 25, SY - 20, Z - 45]), [0, 1, 0], { len: 12, dia: 4, on: "FR" }),
+ ],
+ tools: ["screwdriver"],
+ from: { S0: [0, 400, 0], S13: [0, 400, 0] },
+ },
+ {
+ title: "Push a pin into twelve slats",
+ detail: "One pin into the back end of each of the other slats.",
+ fix: mids.map((i) => fix("pin", [[slatX[i], SY, zb + 10]], [0, 1, 0], { name: "Slat pin", len: 12, dia: 8, on: `S${i}` })),
+ wait: mids.map((i) => `S${i}`),
+ },
+ {
+ title: "Lay in the twelve slats",
+ detail: "Pin into the strip at the back, a screw up through the front rail at the front. Don't sit on it until every slat is in.",
+ add: mids.map((i) => `S${i}`),
+ fix: [fix("screw", mids.map((i): Vec3 => [slatX[i], SY - 20, Z - 45]), [0, 1, 0], { len: 12, dia: 4, on: "FR" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Push the pull-out bed in",
+ detail: "One person lifts the front of the daybed a little while the other rolls the pull-out bed in under it until it hooks on.",
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Tap in the push-in dowels",
+ detail: "Seventeen along the top edges of the back panel and both end panels.",
+ fix: [
+ fix("dowel", spread(-xi + 100, xi - 100, 9).map((x): Vec3 => [x, EH, -Z + 10]), [0, 1, 0], { name: "Push-in dowel", len: 24, dia: 10, on: "BP", mate: "BC" }),
+ ...LR.map((g) => fix("dowel", spread(-Z + 80, Z - 80, 4).map((z): Vec3 => [g * (X - et / 2), EH, z]), [0, 1, 0], { name: "Push-in dowel", len: 24, dia: 10, on: g < 0 ? "EL" : "ER", mate: g < 0 ? "CL" : "CR" })),
+ ],
+ tools: ["hammer"],
+ warnings: ["hand"],
+ },
+ { title: "Press the back cap on", detail: "Line it up over the dowels and press it down along its length.", add: ["BC"], from: { BC: [0, 300, 0] } },
+ {
+ title: "Press the end caps on",
+ detail: "One person each end. Hook the front of the cap over the end panel, then press it down onto the dowels.",
+ add: ["CL", "CR"],
+ people: 2,
+ from: { CL: [0, 300, 0], CR: [0, 300, 0] },
+ },
+ // the drawers
+ {
+ title: "Screw cam bolts into the drawer fronts and backs",
+ detail: "The drawers are built standing on their fronts on the rug. Four cam bolts in each front and each back.",
+ add: bays.map((_, i) => `DF${i}`),
+ fix: bays.flatMap((cx, i) => [
+ fix("camScrew", LR.flatMap((g) => [dy0 + 40, dy1 - 40].map((y): Vec3 => [cx + g * (dw - sT / 2), y, PZF])), [0, 0, -1], { ...camScrew, on: `DF${i}` }),
+ fix("camScrew", LR.flatMap((g) => [dy0 + 40, dy1 - 40].map((y): Vec3 => [cx + g * (dw - sT / 2), y, dz0 + sT])), [0, 0, 1], { ...camScrew, on: `DK${i}` }),
+ ]),
+ tools: ["screwdriver"],
+ wait: bays.map((_, i) => `DK${i}`),
+ from: Object.fromEntries(bays.map((_, i) => [`DF${i}`, [0, 0, 500] as Vec3])),
+ },
+ {
+ title: "Stand the sides on and lock them",
+ detail: "Both sides onto the cam bolts in the front, then turn two cam locks in each side.",
+ add: bays.flatMap((_, i) => [`DS${i}a`, `DS${i}b`]),
+ fix: sideCams(PZF - 30),
+ tools: ["screwdriver"],
+ from: Object.fromEntries(bays.flatMap((_, i) => [[`DS${i}a`, [0, 0, -500] as Vec3], [`DS${i}b`, [0, 0, -500] as Vec3]])),
+ },
+ {
+ title: "Slide the drawer bottoms in",
+ detail: "Down the grooves in the sides, smooth face up.",
+ add: bays.map((_, i) => `DB${i}`),
+ from: Object.fromEntries(bays.map((_, i) => [`DB${i}`, [0, 0, -700] as Vec3])),
+ },
+ {
+ title: "Put the backs on",
+ detail: "Lower each back onto the sides and turn its four cam locks.",
+ add: bays.map((_, i) => `DK${i}`),
+ fix: sideCams(dz0 + sT + 30),
+ tools: ["screwdriver"],
+ from: Object.fromEntries(bays.map((_, i) => [`DK${i}`, [0, 0, -500] as Vec3])),
+ },
+ {
+ title: "Screw the runners onto the drawers",
+ detail: "DL on the left side and DR on the right, three screws each.",
+ fix: [
+ ...LR.map((g) => fix("runner", bays.map((cx): Vec3 => [cx + g * dw, 100, (dz0 + PZF) / 2]), [g, 0, 0], { len: 650, dia: 30 })),
+ ...LR.map((g) => fix("screw", bays.flatMap((cx) => [-250, 0, 250].map((dz): Vec3 => [cx + g * (dw + 2), 100, (dz0 + PZF) / 2 + dz])), [-g, 0, 0], { len: 10, dia: 3.5 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw a knob onto each drawer",
+ detail: "The bolt goes through the front from the inside.",
+ fix: [
+ ...bays.map((cx, i) => fix("knob", [[cx, (openY0 + openY1) / 2, PZF + FT + 4]], [0, 0, -1], { len: 30, dia: 40, on: `DF${i}` })),
+ // the bolt starts inside the drawer, far enough from the knob's point to keep its own place
+ ...bays.map((cx, i) => fix("bolt", [[cx, (openY0 + openY1) / 2, PZF - 3]], [0, 0, 1], { name: "Knob bolt", len: 35, dia: 4, on: `DF${i}` })),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the drawers into the pull-out bed", detail: "Set the drawer runners onto the ones on the beams and push until they close.", kind: "drawer" },
+ ];
+ if (mattresses) steps.push({ title: "Lay the mattresses on", detail: "Both on the daybed; pull the bed out and lay one on each to sleep two.", add: ["M0", "M1"] });
+ return { parts, steps };
+}
+
+/** HEMNES guides drawn in this file; returns false for any product it doesn't build. Wired in from hemnes.ts. */
+export function hemnesBeds(b: PlanBuilder, s: ProductSpec): boolean {
+ let recipe: CustomParams | null = null;
+ switch (s.slug) {
+ case "hemnes-bench-shoe-storage-85-x-32-x-65":
+ recipe = shoeBench(s);
+ break;
+ case "hemnes-bed-frame-90-x-200":
+ case "hemnes-bed-frame-160-x-200":
+ recipe = bedFrame(s);
+ break;
+ case "hemnes-day-bed-frame-3-drawers-80-x-200":
+ case "hemnes-day-bed-w-3-drawers-2-mattresses-80-x-200":
+ recipe = daybed(s);
+ break;
+ }
+ if (!recipe) return false;
+ buildCustom(b, { ...s, custom: recipe });
+ return true;
+}
diff --git a/src/lib/plan/families/_hemnes-cabinets.ts b/src/lib/plan/families/_hemnes-cabinets.ts
new file mode 100644
index 0000000..1bf8392
--- /dev/null
+++ b/src/lib/plan/families/_hemnes-cabinets.ts
@@ -0,0 +1,1128 @@
+import type { CustomFix, CustomParams, CustomPart, CustomStep, Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
+import { HW, PlanBuilder, type FitOpts, type HwDef } from "../builder";
+import { rotate } from "../math";
+import { buildCustom } from "../custom";
+
+/*
+ * HEMNES cabinets read from IKEA's manuals: the 49 wide bookcase, the 6-drawer chest (sold in the US as a dresser,
+ * 108 x 131) and the glass-door cabinet with 3 drawers. The glass-door cabinet without drawers and the 120 wide
+ * wardrobe aren't sold any more under those names, so they keep their old guides.
+ *
+ * Bookcase 49 x 197: the same build as the 90 wide one. Both ready-made side frames lie on a rug for their cam bolts,
+ * side rails and adjustable feet; the left one stays down while the plinths, top rails and fixed shelf stand in it,
+ * the right one goes on top, then the top is screwed on, two back panels (upper and lower) slide into the grooves and
+ * are clipped, it is fixed to the wall with two L brackets and gets its shelves.
+ *
+ * Chest of 6 drawers: the post-and-panel chest (posts, side panels, spacer boards carrying the runners), with two small
+ * drawers on top either side of a short divider. Two L brackets under the top fix it to the wall.
+ *
+ * Glass-door cabinet with 3 drawers: the drawers are built first, then two side frames take their bottom rails, feet,
+ * runner bars, cam bolts, hinge plates and runners on a rug. The fixed shelf and six rails stand in the left side, the
+ * right side goes on top, the top is screwed on, the two back panels slide in and are clipped, it is fixed to the
+ * wall, and the doors, shelves and drawers go in.
+ */
+
+const range = (n: number) => Array.from({ length: n }, (_, i) => i);
+const spread = (a: number, c: number, n: number) => range(n).map((i) => (n === 1 ? (a + c) / 2 : a + ((c - a) * i) / (n - 1)));
+
+// fittings, sized so different ones stay apart in the list
+const DOWEL: HwDef = { kind: "dowel", len: 40, dia: 8 };
+const SMALL_DOWEL: HwDef = { kind: "dowel", len: 25, dia: 6 };
+const DRAWER_DOWEL: HwDef = { kind: "dowel", len: 30, dia: 8 };
+const CAM_BOLT: HwDef = HW.camScrew;
+const CAM: HwDef = HW.cam;
+const FOOT: HwDef = { kind: "glide", len: 6, dia: 30 };
+const ADJ_FOOT: HwDef = { kind: "foot", len: 30, dia: 32 };
+const RUNNER_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+const DRAWER_RUNNER_SCREW: HwDef = { kind: "screw", len: 10, dia: 4 };
+const TOP_SCREW: HwDef = { kind: "screw", len: 60, dia: 6 };
+const BAR_SCREW: HwDef = { kind: "screw", len: 35, dia: 6 };
+const DIVIDER_SCREW: HwDef = { kind: "screw", len: 70, dia: 6 };
+const NAIL: HwDef = HW.nail;
+const RING_NAIL: HwDef = { kind: "nail", len: 34, dia: 2.5 };
+const SUPPORT_SCREW: HwDef = { kind: "screw", len: 13, dia: 3.5 };
+const SMALL_SCREW: HwDef = { kind: "screw", len: 12, dia: 3.5 };
+const KNOB_SCREW: HwDef = { kind: "screw", len: 32, dia: 4 };
+const KNOB: HwDef = HW.knob;
+const WASHER: HwDef = HW.washer;
+const BRACKET: HwDef = { kind: "angle", len: 80, dia: 40 };
+const runnerDef = (len: number): HwDef => ({ kind: "runner", len: Math.round(len / 10) * 10, dia: 20 });
+
+type StepOpts = {
+ title: string;
+ detail?: string;
+ tools?: ToolId[];
+ pose?: Pose;
+ scene?: string;
+ kind?: StepKind;
+ warnings?: WarnId[];
+ people?: 1 | 2;
+ repeat?: number;
+ check?: "square";
+ wall?: boolean;
+};
+const step = (b: PlanBuilder, o: StepOpts, body: () => void = () => {}) =>
+ b.step({ kind: "general", ...o, warnings: o.warnings ?? (o.people === 2 ? ["two"] : []) }, body);
+
+/** Show parts lying in another scene: turned by `rot` about `pivot`, then moved to `at`. */
+function stageGroup(b: PlanBuilder, keys: string[], pivot: Vec3, rot: Vec3, at: Vec3, from: Vec3 = [0, 160, 0]) {
+ for (const k of keys) {
+ const it = b.partItem(k);
+ const p = rotate([it.final.pos[0] - pivot[0], it.final.pos[1] - pivot[1], it.final.pos[2] - pivot[2]], rot);
+ b.stage(k, [p[0] + at[0], p[1] + at[1], p[2] + at[2]], rot, from);
+ }
+}
+
+/* ---------- drawers, built on their fronts ---------- */
+
+interface DrawerBox {
+ x: number; // centre
+ y0: number; // bottom of the opening
+ w: number; // opening width
+ h: number; // opening height
+ zf: number; // front face of the front
+ zBack: number; // how far back the box may go
+ knobs: 1 | 2;
+ dowels?: 1 | 2; // per side, into the front
+ bolts?: 1 | 2; // cam bolts per side
+ nails?: number; // ring nails per side into the back
+}
+interface Drawer {
+ box: DrawerBox;
+ front: string;
+ sides: [string, string];
+ bottom: string;
+ back: string;
+ support?: string;
+ ys: number;
+ sh: number;
+ xs: number;
+ dd: number;
+}
+
+/**
+ * Each distinct size is shown being built once (with "do this for each"). Returns the step that slides every drawer
+ * in, so a manual that builds the drawers first can slide them in at the end.
+ */
+function drawers(b: PlanBuilder, list: DrawerBox[], o: { support?: boolean } = {}): () => void {
+ if (!list.length) return () => {};
+ const ft = 18, st = 14;
+ const made: Drawer[] = list.map((box) => {
+ const fw = box.w - 4, fh = box.h - 4;
+ const xs = box.w / 2 - 13 - st / 2; // side centres, clear of the runners
+ const sh = Math.max(60, Math.min(fh - 30, 220));
+ const dd = Math.round((box.zf - ft - box.zBack) / 10) * 10;
+ const ys = box.y0 + 14; // underside of the box
+ const zd = box.zf - ft - dd / 2;
+ const frT = b.part("Drawer front", [fw, fh, ft]);
+ const sdT = b.part("Drawer side", [st, sh, dd]);
+ const btT = b.part("Drawer bottom", [2 * xs - 4, 3, dd - 16], { material: "fiber" });
+ const bkT = b.part("Drawer back", [2 * xs - st, sh - 16, st]);
+ const d: Drawer = {
+ box,
+ xs,
+ sh,
+ dd,
+ ys,
+ front: b.place(frT, [box.x, box.y0 + 2 + fh / 2, box.zf - ft / 2]),
+ sides: [b.place(sdT, [box.x - xs, ys + sh / 2, zd]), b.place(sdT, [box.x + xs, ys + sh / 2, zd])],
+ bottom: b.place(btT, [box.x, ys + 10, zd - 6]),
+ back: b.place(bkT, [box.x, ys + 16 + (sh - 16) / 2, box.zf - ft - dd + st / 2]),
+ };
+ if (o.support && box.w > 700) d.support = b.place(b.part("Bottom support rail", [24, 10, dd - 20], { material: "metal" }), [box.x, ys + 3.5, zd]);
+ return d;
+ });
+
+ const fitsOf = (d: Drawer) => {
+ const { box, xs, ys, sh, dd } = d;
+ const zIn = box.zf - ft; // back face of the front
+ const per = <T>(fn: (g: -1 | 1, side: string) => T[]) => [...fn(-1, d.sides[0]), ...fn(1, d.sides[1])];
+ const zBk = zIn - dd + st / 2;
+ const nn = box.nails ?? (box.h > 260 ? 3 : 2);
+ const nails = nn === 3 ? [0.2, 0.5, 0.8] : spread(0.3, 0.7, nn);
+ const dowelYs = box.dowels === 1 ? [ys + sh * 0.5] : [ys + sh * 0.35, ys + sh * 0.65];
+ const boltYs = box.bolts === 1 ? [ys + sh * 0.5 + 18] : [ys + 20, ys + sh - 20];
+ const kx = box.knobs === 2 ? [box.x - box.w * 0.27, box.x + box.w * 0.27] : [box.x];
+ const ky = box.y0 + box.h / 2;
+ const runLen = dd - 20;
+ return {
+ dowels: per((g, sd) => dowelYs.map((y): FitOpts => ({ on: sd, at: [box.x + g * xs, y, zIn], dir: [0, 0, -1], mate: d.front }))),
+ bolts: per((g, sd) => boltYs.map((y): FitOpts => ({ on: d.front, at: [box.x + g * xs, y, zIn], dir: [0, 0, 1], mate: sd, mateHole: 4 }))),
+ cams: per((g, sd) => boltYs.map((y): FitOpts => ({ on: sd, at: [box.x + g * (xs - st / 2), y, zIn - 28], dir: [g, 0, 0] }))),
+ nails: per((g, sd) => nails.map((k): FitOpts => ({ on: sd, at: [box.x + g * (xs + st / 2), ys + 16 + (sh - 16) * k, zBk], dir: [-g, 0, 0], mate: d.back }))),
+ support: d.support
+ ? [zIn - 30, zIn - dd + 30].map((z): FitOpts => ({ on: d.support!, at: [box.x, ys - 1.5, z], dir: [0, 1, 0], mate: d.bottom }))
+ : [],
+ runners: per((g, sd) => [{ on: sd, at: [box.x + g * xs, ys, zIn - 10 - runLen / 2], dir: [0, 1, 0], hole: false } as FitOpts]),
+ runnerScrews: per((g, sd) => [zIn - 40, zIn - runLen + 20].map((z): FitOpts => ({ on: sd, at: [box.x + g * xs, ys - 2, z], dir: [0, 1, 0] }))),
+ knobScrews: kx.map((x): FitOpts => ({ on: d.front, at: [x, ky, zIn - 4], dir: [0, 0, 1], mate: d.front })),
+ knobs: kx.map((x): FitOpts => ({ on: d.front, at: [x, ky, box.zf], dir: [0, 0, -1], hole: false })),
+ runLen,
+ };
+ };
+
+ const kinds = new Map<string, Drawer[]>();
+ for (const d of made) {
+ const k = `${Math.round(d.box.w)}x${Math.round(d.box.h)}`;
+ kinds.set(k, [...(kinds.get(k) ?? []), d]);
+ }
+ const shown = [...kinds.values()].map((g) => g[0]);
+ const n = made.length;
+ const rep = n > 1 ? n : undefined;
+ const c0 = (d: Drawer): Vec3 => [d.box.x, d.ys + d.sh / 2, d.box.zf - ft - d.dd / 2];
+ const keysOf = (d: Drawer) => [d.front, ...d.sides, d.bottom, d.back, ...(d.support ? [d.support] : [])];
+ // the shown drawers lie side by side in the drawer scene
+ const offs = shown.map((_, i) => (i - (shown.length - 1) / 2) * (Math.max(...shown.map((d) => d.box.w)) + 200));
+ const stage = (d: Drawer, i: number, k: string, from?: Vec3, shift: Vec3 = [0, 0, 0]) => {
+ const it = b.partItem(k);
+ const c = c0(d);
+ b.stage(k, [it.final.pos[0] - c[0] + offs[i] + shift[0], it.final.pos[1] - c[1] + shift[1], it.final.pos[2] - c[2] + shift[2]], it.final.rot, from);
+ };
+ const fs = shown.map(fitsOf);
+ const each = (fn: (d: Drawer, i: number) => void) => shown.forEach((d, i) => fn(d, i));
+ const dstep = (title: string, detail: string, body: () => void, x: { tools?: ToolId[]; kind?: StepKind; pose?: Pose } = {}) =>
+ step(b, { title, detail, tools: x.tools, scene: "drawer", pose: x.pose ?? "-z", repeat: rep, kind: x.kind ?? "drawer" }, body);
+ const oneDowel = shown.some((d) => d.box.dowels === 1);
+
+ dstep(
+ "Tap the dowels into the drawer sides",
+ oneDowel ? "Into the front end of each side: one on the small drawers, two on the others. The grooves for the bottom face in and down." : "Two in the front end of each side. The grooves for the bottom face in and down.",
+ () => {
+ b.stagger(0.2);
+ each((d, i) => d.sides.forEach((sd, j) => stage(d, i, sd, [0, 0, -300], [(j ? 1 : -1) * 90, 0, -60])));
+ b.then(0.15);
+ each((_, i) => b.fits(DRAWER_DOWEL, fs[i].dowels, 0.06));
+ },
+ { tools: ["hammer"], kind: "dowels" },
+ );
+ dstep(
+ "Screw the cam bolts into the drawer front",
+ shown.some((d) => d.box.bolts === 1) ? "Lay the front face down on a rug. Two in the small front, four in the others, by hand until they stop." : "Lay the front face down on a rug. Screw the bolts in by hand until they stop.",
+ () => {
+ each((d, i) => stage(d, i, d.front, [0, 0, -160]));
+ b.then(0.15);
+ each((_, i) => b.fits(CAM_BOLT, fs[i].bolts, 0.08));
+ },
+ { tools: ["screwdriver"], kind: "cams" },
+ );
+ dstep("Stand the sides on the front", "Push the dowels and bolts into their holes. Grooves facing each other.", () => {
+ b.stagger(0.2);
+ each((d, i) => d.sides.forEach((sd) => stage(d, i, sd)));
+ });
+ b.steps[b.steps.length - 1].kind = "join";
+ dstep("Lock the cam locks", "Arrow towards the bolt, then turn each one clockwise until it pulls tight.", () => each((_, i) => b.fits(CAM, fs[i].cams, 0.1)), {
+ tools: ["screwdriver"],
+ kind: "cams",
+ });
+ dstep("Slide in the drawer bottom", "Smooth side up. It runs down the grooves until it reaches the front.", () => {
+ each((d, i) => stage(d, i, d.bottom, [0, 0, -420]));
+ });
+ const deep = shown.filter((d) => (d.box.nails ?? (d.box.h > 260 ? 3 : 2)) === 3).length;
+ dstep(
+ "Tap on the drawer back",
+ deep && deep < shown.length ? "It sits on the drawer bottom. Ring nails through each side into it: three each side on the deep drawer, two on the others." : "It sits on the drawer bottom. Tap the ring nails through the sides into it.",
+ () => {
+ each((d, i) => stage(d, i, d.back, [0, 0, -260]));
+ b.then(0.15);
+ each((_, i) => b.fits(RING_NAIL, fs[i].nails, 0.1));
+ },
+ { tools: ["hammer"], kind: "nails" },
+ );
+ if (shown.some((d) => d.support))
+ dstep(
+ "Screw the support rail under the bottom",
+ "It runs from front to back under the middle of the bottom and stops it sagging.",
+ () => {
+ each((d, i) => {
+ if (d.support) stage(d, i, d.support, [0, -160, 0]);
+ });
+ b.then(0.15);
+ each((_, i) => b.fits(SUPPORT_SCREW, fs[i].support, 0.12));
+ },
+ { tools: ["screwdriver"], kind: "screws", pose: "-y" },
+ );
+ dstep(
+ "Fit the runners on the drawer",
+ "Left and right runners are marked. Press each onto the bottom edge of its side, then two screws.",
+ () => {
+ each((_, i) => b.fits(runnerDef(fs[i].runLen), fs[i].runners, 0.25));
+ b.then(0.1);
+ each((_, i) => b.fits(DRAWER_RUNNER_SCREW, fs[i].runnerScrews, 0.08));
+ },
+ { tools: ["screwdriver"], kind: "runners", pose: "-y" },
+ );
+ dstep(
+ shown.every((d) => d.box.knobs === 1) ? "Screw on the knob" : "Screw on the knobs",
+ "The screw goes in from inside the drawer. Snug is enough.",
+ () => {
+ each((_, i) => b.fits(KNOB, fs[i].knobs, 0.2));
+ b.then(0.05);
+ each((_, i) => b.fits(KNOB_SCREW, fs[i].knobScrews, 0.15));
+ },
+ { tools: ["screwdriver"], kind: "screws", pose: "+y" },
+ );
+
+ return () =>
+ step(
+ b,
+ {
+ title: n > 2 ? `Slide in all ${n} drawers` : n === 2 ? "Slide in both drawers" : "Slide in the drawer",
+ detail: "Rest the drawer runners on the ones in the frame and push until it closes. Only open one at a time.",
+ kind: "drawer",
+ warnings: ["tip"],
+ },
+ () => {
+ for (const d of made) {
+ b.stagger(0);
+ for (const k of keysOf(d)) b.add(k, [0, 0, 520]);
+ if (!shown.includes(d)) {
+ const f = fitsOf(d);
+ const all: [HwDef, FitOpts[]][] = [
+ [DRAWER_DOWEL, f.dowels],
+ [CAM_BOLT, f.bolts],
+ [CAM, f.cams],
+ [RING_NAIL, f.nails],
+ [SUPPORT_SCREW, f.support],
+ [runnerDef(f.runLen), f.runners],
+ [DRAWER_RUNNER_SCREW, f.runnerScrews],
+ [KNOB, f.knobs],
+ [KNOB_SCREW, f.knobScrews],
+ ];
+ for (const [def, l] of all) for (const x of l) b.preset(def, x);
+ }
+ b.wait(0.22);
+ }
+ },
+ );
+}
+
+/* ---------- recipes ---------- */
+
+class Recipe {
+ parts: CustomPart[] = [];
+ steps: CustomStep[] = [];
+ part(id: string, name: string, size: Vec3, pos: Vec3, o: Partial<CustomPart> = {}) {
+ this.parts.push({ id, name, size, pos, ...o });
+ return id;
+ }
+ step(st: CustomStep) {
+ this.steps.push(st);
+ }
+ get(): CustomParams {
+ // the custom builder takes ten fittings a step: share the rest over copies of the same step
+ const out: CustomStep[] = [];
+ for (const st0 of this.steps) {
+ const st = (st0.fix?.length ?? 0) > 10 ? { ...st0, fix: merge(st0.fix!) } : st0;
+ const f = st.fix ?? [];
+ if (f.length <= 10) out.push(st);
+ else for (let i = 0; i < f.length; i += 10) out.push({ ...st, fix: f.slice(i, i + 10), add: i ? [] : st.add });
+ }
+ for (const st of out) for (const f of st.fix ?? []) if (f.at) f.count = f.at.length;
+ return { parts: this.parts, steps: out };
+ }
+}
+/** Fittings of the same kind, size and direction in one list; each then goes into the part nearest its point. */
+function merge(fix: CustomFix[]): CustomFix[] {
+ const groups = new Map<string, CustomFix>();
+ for (const f of fix) {
+ if (!f.at) {
+ groups.set(`${groups.size}`, f);
+ continue;
+ }
+ const k = `${f.kind}|${f.len}|${f.dia}|${(f.dir ?? [0, -1, 0]).join(",")}`;
+ const g = groups.get(k);
+ if (!g) groups.set(k, { ...f, at: [...f.at] });
+ else {
+ g.at!.push(...f.at);
+ if (g.on !== f.on) g.on = undefined;
+ if (g.mate !== f.mate) g.mate = undefined;
+ }
+ }
+ return [...groups.values()];
+}
+/** Fittings at exact points: kind, the part they go into, the way they go in, the part their other end meets. */
+const at = (kind: CustomFix["kind"], on: string | undefined, dir: Vec3, pts: Vec3[], mate?: string, o: { len?: number; dia?: number } = {}): CustomFix => ({ kind, count: pts.length, at: pts, dir, on, mate, ...o });
+const sized = (def: HwDef) => ({ len: def.len, dia: def.dia });
+
+/* ---------- bookcase 49 x 197 ---------- */
+
+function bookcase49(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const r = new Recipe();
+ const topT = 22, P = 45, ov = 10;
+ const postH = H - topT;
+ const xo = W / 2 - ov, xp = xo - P / 2, xi = xo - P;
+ const zf = D / 2 - ov, zb = -D / 2 + 3;
+ const zpf = zf - P / 2, zpb = zb + P / 2, zm = (zpf + zpb) / 2;
+ const legH = 70, plinth = 80, topRail = 60, midY = Math.round(H * 0.5), midRail = 60;
+ const sideD = zpf - zpb - P;
+ for (const g of [-1, 1]) {
+ const L = g < 0 ? "L" : "R";
+ r.part(`pf${L}`, "Corner post", [P, postH, P], [g * xp, postH / 2, zpf], { material: "wood" });
+ r.part(`pb${L}`, "Corner post", [P, postH, P], [g * xp, postH / 2, zpb], { material: "wood" });
+ const lowH = midY - midRail / 2 - (legH + plinth);
+ const upH = postH - (midY + midRail / 2);
+ r.part(`lo${L}`, "Lower side panel", [16, lowH, sideD + 16], [g * (xo - 16), legH + plinth + lowH / 2, zm]);
+ r.part(`up${L}`, "Upper side panel", [16, upH, sideD + 16], [g * (xo - 16), midY + midRail / 2 + upH / 2, zm]);
+ r.part(`sr${L}`, "Side rail", [P - 10, midRail, sideD], [g * (xo - P / 2 - 5), midY, zm], { material: "wood" });
+ r.part(`br${L}`, "Side rail", [P - 10, plinth, sideD], [g * (xo - P / 2 - 5), legH + plinth / 2, zm], { material: "wood" });
+ }
+ const zr = zf - 10, zbr = zb + 10;
+ r.part("fp", "Plinth", [2 * xi, plinth, 20], [0, legH + plinth / 2, zr], { material: "wood" });
+ r.part("bp", "Back plinth", [2 * xi, plinth, 20], [0, legH + plinth / 2, zbr], { material: "wood" });
+ r.part("ft", "Top rail", [2 * xi, topRail, 20], [0, postH - topRail / 2, zr], { material: "wood" });
+ r.part("bt", "Top rail", [2 * xi, topRail, 20], [0, postH - topRail / 2, zbr], { material: "wood" });
+ // in front of the back panels, which run behind it from the plinth to the top rail
+ r.part("fx", "Fixed shelf", [2 * xi, 20, zf - zb - 26], [0, midY, (zf + zb + 26) / 2]);
+ r.part("top", "Top", [W, topT, D], [0, H - topT / 2, 0], { material: "wood" });
+ // two back panels, one below the fixed shelf and one above it
+ const bkLo = legH + plinth, bkHi = postH - topRail;
+ r.part("bk1", "Back panel", [2 * xi, bkHi - midY, 4], [0, (midY + bkHi) / 2, zb + 24], { material: "wood" });
+ r.part("bk2", "Back panel", [2 * xi, midY - bkLo, 4], [0, (bkLo + midY) / 2, zb + 24], { material: "wood" });
+ r.part("bs", "Bottom shelf", [2 * xi, 18, zf - zb - 50], [0, legH + plinth + 9, (zf + zb) / 2 + 6]);
+ const lowSpan = midY - 10 - (legH + plinth + 18), upSpan = postH - topRail - (midY + 10);
+ const shelfYs = [legH + plinth + 18 + lowSpan / 3, legH + plinth + 18 + (2 * lowSpan) / 3, midY + 10 + upSpan / 3, midY + 10 + (2 * upSpan) / 3].map(Math.round);
+ shelfYs.forEach((y, i) => r.part(`sh${i}`, "Shelf", [2 * xi - 4, 18, zf - zb - 50], [0, y, (zf + zb) / 2 + 6]));
+
+ const side = (L: string) => [`pf${L}`, `pb${L}`, `lo${L}`, `up${L}`];
+ const g = (L: string) => (L === "L" ? -1 : 1);
+ const postBolts = (L: string) => [
+ at("camScrew", `pf${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2 - 15, zr], [g(L) * xi, postH - topRail / 2 - 12, zr]], undefined, { len: 34 }),
+ at("camScrew", `pb${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2 - 15, zbr], [g(L) * xi, postH - topRail / 2 - 12, zbr]], undefined, { len: 34 }),
+ ];
+ const railDowels = (L: string, ids: string[]) =>
+ ids.map((id) => {
+ const y = id.endsWith("p") ? legH + plinth / 2 + 15 : postH - topRail / 2 + 12;
+ const z = id.startsWith("f") ? zr : zbr;
+ return at("dowel", id, [-g(L), 0, 0], [[g(L) * xi, y, z]], id.startsWith("f") ? `pf${L}` : `pb${L}`, sized(DOWEL));
+ });
+ const railCams = (L: string, ids: string[]) =>
+ ids.map((id) => {
+ const top = !id.endsWith("p");
+ const y = top ? postH - topRail : legH + plinth;
+ return at("cam", id, [0, top ? 1 : -1, 0], [[g(L) * (xi - 26), y, id.startsWith("f") ? zr : zbr]], undefined, { dia: 15 });
+ });
+ const sx = (L: string) => g(L) * (xo - P / 2 - 5);
+ const railEnds = (L: string) => [
+ at("dowel", `sr${L}`, [0, -1, 0], [[sx(L), midY + midRail / 2, zm]], undefined, sized(DOWEL)),
+ at("dowel", `sr${L}`, [0, 0, -1], [[sx(L), midY, zpf - P / 2]], `pf${L}`, sized(DOWEL)),
+ at("dowel", `sr${L}`, [0, 0, 1], [[sx(L), midY, zpb + P / 2]], `pb${L}`, sized(DOWEL)),
+ ];
+ // one long screw holds the middle side rail, two the bottom one
+ const railScrews = (L: string) => [
+ at("screw", `pf${L}`, [0, 0, -1], [[sx(L), midY, zpf + P / 2]], `sr${L}`, sized(TOP_SCREW)),
+ at("screw", `pf${L}`, [0, 0, -1], [[sx(L), legH + plinth / 2, zpf + P / 2]], `br${L}`, sized(TOP_SCREW)),
+ at("screw", `pb${L}`, [0, 0, 1], [[sx(L), legH + plinth / 2, zpb - P / 2]], `br${L}`, sized(TOP_SCREW)),
+ ];
+ const feet = (L: string) => [at("foot", `pf${L}`, [0, 1, 0], [[g(L) * xp, 0, zpf]]), at("foot", `pb${L}`, [0, 1, 0], [[g(L) * xp, 0, zpb]])];
+
+ r.step({
+ title: "Screw the cam bolts into both sides",
+ detail: "Lay both side frames on a rug, inside up. Four bolts in each, by hand until they stop.",
+ add: side("L"),
+ fix: postBolts("L"),
+ repeat: 2,
+ pose: "+x",
+ warnings: ["floor"],
+ tools: ["screwdriver"],
+ });
+ r.step({ title: "Tap dowels into the side rails", detail: "Three in each: one in each end and one in the top edge for the fixed shelf.", repeat: 2, fix: railEnds("L"), tools: ["hammer"], pose: "+x" });
+ r.step({
+ title: "Screw the side rails between the posts",
+ detail: "One in the middle of each side, one at the bottom. One long screw holds the middle rail and two the bottom one, with the Allen key.",
+ add: ["srL", "brL"],
+ repeat: 2,
+ fix: railScrews("L"),
+ tools: ["allen"],
+ pose: "+x",
+ });
+ r.step({ title: "Screw the adjustable feet into the posts", detail: "Into the bottom end of each post, by hand. You level them once it stands.", repeat: 2, fix: feet("L"), pose: "+x" });
+ r.step({
+ title: "Stand the plinths in the left side",
+ detail: "The left side stays on the rug, inside up. A dowel in each end, then push them onto the dowel and bolt.",
+ add: ["fp", "bp"],
+ fix: railDowels("L", ["fp", "bp"]),
+ tools: ["hammer"],
+ pose: "+x",
+ });
+ r.step({ title: "Stand the top rails in", detail: "Front and back, at the far end, on a dowel each.", add: ["ft", "bt"], fix: railDowels("L", ["ft", "bt"]), tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Lock the four rails", detail: "Arrow towards the bolt, then turn each cam lock clockwise.", fix: railCams("L", ["fp", "bp", "ft", "bt"]), tools: ["screwdriver"], pose: "+x" });
+ r.step({
+ title: "Stand the fixed shelf on the side rail",
+ detail: "Screw two cam bolts into the side rails first. The shelf drops onto the dowel and bolts; lock it with two cam locks.",
+ add: ["fx"],
+ fix: [
+ at("camScrew", "srL", [1, 0, 0], [[-xi, midY, zm - 60], [-xi, midY, zm + 60]], undefined, { len: 34 }),
+ at("camScrew", "srR", [-1, 0, 0], [[xi, midY, zm - 60], [xi, midY, zm + 60]], undefined, { len: 34 }),
+ at("cam", "fx", [0, -1, 0], [[-xi + 26, midY + 10, zm - 60], [-xi + 26, midY + 10, zm + 60]], undefined, { dia: 15 }),
+ ],
+ tools: ["screwdriver"],
+ pose: "+x",
+ });
+ r.step({
+ title: "Lower the right side on",
+ detail: "It has its bolts, rails and feet on like the left one. Tap a dowel into each free rail end, then two people press it down evenly.",
+ add: [...side("R"), "srR", "brR"],
+ from: Object.fromEntries([...side("R"), "srR", "brR"].map((k) => [k, [360, 0, 0] as Vec3])),
+ fix: [...postBolts("R"), ...railDowels("R", ["fp", "bp", "ft", "bt"]), ...railEnds("R"), ...railScrews("R"), ...feet("R")],
+ tools: ["hammer"],
+ people: 2,
+ pose: "+x",
+ });
+ r.step({
+ title: "Lock the cam locks on this side",
+ detail: "Four in the rails and two in the fixed shelf.",
+ fix: [...railCams("R", ["fp", "bp", "ft", "bt"]), at("cam", "fx", [0, -1, 0], [[xi - 26, midY + 10, zm - 60], [xi - 26, midY + 10, zm + 60]], undefined, { dia: 15 })],
+ tools: ["screwdriver"],
+ pose: "+x",
+ });
+ r.step({
+ title: "Turn it onto its back and fit the top",
+ detail: "Two people. Tap two dowels into the top rails, push the top on, then five long screws up through the rails.",
+ add: ["top"],
+ fix: [
+ at("dowel", "ft", [0, -1, 0], [[-xi / 2, postH, zr]], "top", sized(DOWEL)),
+ at("dowel", "bt", [0, -1, 0], [[xi / 2, postH, zbr]], "top", sized(DOWEL)),
+ at("screw", "ft", [0, 1, 0], spread(-xi + 50, xi - 50, 3).map((x): Vec3 => [x, postH - topRail, zr]), "top", sized(TOP_SCREW)),
+ at("screw", "bt", [0, 1, 0], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, postH - topRail, zbr]), "top", sized(TOP_SCREW)),
+ ],
+ tools: ["hammer", "allen"],
+ people: 2,
+ pose: "+z",
+ });
+ r.step({
+ title: "Slide in the back panels",
+ detail: "Turn it onto its front. Two people: one panel slides down the grooves into the upper part, the other into the lower part, meeting behind the fixed shelf.",
+ add: ["bk1", "bk2"],
+ people: 2,
+ pose: "-z",
+ from: { bk1: [0, 0, -300], bk2: [0, 0, -300] },
+ });
+ r.step({
+ title: "Clip the back panels in place",
+ detail: "Six clips: two to the fixed shelf, two to the top rail and two to the plinth. A screw in each.",
+ fix: [
+ at("clip", "fx", [0, 1, 0], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, midY - 10, zb + 34]), undefined, { len: 12, dia: 20 }),
+ at("clip", "bt", [0, 0, -1], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, postH - topRail + 12, zb + 20]), undefined, { len: 12, dia: 20 }),
+ at("clip", "bp", [0, 0, -1], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, legH + plinth - 12, zb + 20]), undefined, { len: 12, dia: 20 }),
+ at("screw", "fx", [0, 1, 0], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, midY - 10, zb + 34]), undefined, sized(SMALL_SCREW)),
+ at("screw", "bt", [0, 0, -1], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, postH - topRail + 12, zb + 20]), undefined, sized(SMALL_SCREW)),
+ at("screw", "bp", [0, 0, -1], spread(-xi + 80, xi - 80, 2).map((x): Vec3 => [x, legH + plinth - 12, zb + 20]), undefined, sized(SMALL_SCREW)),
+ ],
+ tools: ["screwdriver"],
+ pose: "-z",
+ });
+ r.step({ title: "Stand it up and level the feet", detail: "Two people. Turn the adjustable feet until it stands steady and leans slightly to the wall.", people: 2, pose: "+y", kind: "standup", warnings: ["two"] });
+ r.step({
+ title: "Fix it to the wall",
+ detail: "Two L brackets on top, one screw each into the top rail. Wall screws aren't included: pick ones made for your wall, with a washer.",
+ fix: [
+ at("angle", "bt", [0, -1, 0], [[-xi / 2, H, zb + 20], [xi / 2, H, zb + 20]], undefined, { len: 80, dia: 40 }),
+ at("screw", "bt", [0, -1, 0], [[-xi / 2, H + 2, zb + 30], [xi / 2, H + 2, zb + 30]], undefined, sized(SMALL_SCREW)),
+ at("washer", "bt", [0, 0, -1], [[-xi / 2, H + 40, zb - 2], [xi / 2, H + 40, zb - 2], [-xi / 2, H + 60, zb - 2], [xi / 2, H + 60, zb - 2]]),
+ ],
+ wall: true,
+ tools: ["screwdriver", "drill"],
+ warnings: ["wall", "tip"],
+ });
+ r.step({
+ title: "Lay in the bottom shelf",
+ detail: "Push four shelf plugs into the posts above the plinths, then drop the shelf onto them.",
+ add: ["bs"],
+ fix: [
+ at("pin", "pfL", [-1, 0, 0], [[-xi, legH + plinth - 4, zpf - 30]], undefined, { len: 10, dia: 8 }),
+ at("pin", "pbL", [-1, 0, 0], [[-xi, legH + plinth - 4, zpb + 30]], undefined, { len: 10, dia: 8 }),
+ at("pin", "pfR", [1, 0, 0], [[xi, legH + plinth - 4, zpf - 30]], undefined, { len: 10, dia: 8 }),
+ at("pin", "pbR", [1, 0, 0], [[xi, legH + plinth - 4, zpb + 30]], undefined, { len: 10, dia: 8 }),
+ ],
+ });
+ r.step({
+ title: "Push in the shelf pins",
+ detail: "For each shelf, plugs in the two front posts and supports in the two back posts, at the heights you want.",
+ fix: [
+ at("pin", "pfL", [-1, 0, 0], shelfYs.map((y): Vec3 => [-xi, y - 13, zpf - 30]), undefined, { len: 10, dia: 8 }),
+ at("pin", "pfR", [1, 0, 0], shelfYs.map((y): Vec3 => [xi, y - 13, zpf - 30]), undefined, { len: 10, dia: 8 }),
+ at("pin", "pbL", [-1, 0, 0], shelfYs.map((y): Vec3 => [-xi, y - 13, zpb + 30]), undefined, { len: 16, dia: 5 }),
+ at("pin", "pbR", [1, 0, 0], shelfYs.map((y): Vec3 => [xi, y - 13, zpb + 30]), undefined, { len: 16, dia: 5 }),
+ ],
+ });
+ r.step({ title: "Lay in the shelves", detail: "Tilt each one in, then lower it onto its four supports.", add: shelfYs.map((_, i) => `sh${i}`) });
+ return r.get();
+}
+
+/** The two L brackets under the top: drilled, plugged and screwed to the wall once it stands. */
+function wallBrackets(b: PlanBuilder, o: { xs: number[]; y: number; z: number }) {
+ step(b, { title: "Mark the wall", detail: "Push it against the wall where it will stand and mark through the slot of each bracket.", tools: ["pencil"], kind: "anchor", wall: true, warnings: ["wall", "tip"] });
+ step(
+ b,
+ { title: "Screw the brackets to the wall", detail: "Move it away, drill and push in the plugs, push it back and screw through each bracket with a washer. The plugs suit solid walls; use fixings made for yours if it's different.", tools: ["drill", "screwdriver"], kind: "anchor", wall: true, warnings: ["wall", "tip"] },
+ () => {
+ b.fits({ kind: "plug", len: 40, dia: 8, notIncluded: false }, o.xs.map((x): FitOpts => ({ at: [x, o.y - 20, o.z - 1], dir: [0, 0, -1] })), 0.12);
+ b.then(0.1);
+ b.fits(WASHER, o.xs.map((x): FitOpts => ({ at: [x, o.y - 20, o.z + 3], dir: [0, 0, -1], hole: false })), 0.1);
+ b.fits({ kind: "screw", len: 50, dia: 5 }, o.xs.map((x): FitOpts => ({ at: [x, o.y - 20, o.z + 4], dir: [0, 0, -1] })), 0.12);
+ },
+ );
+}
+
+/* ---------- chest of 6 drawers ---------- */
+
+/*
+ * The 108 x 131 chest: two small drawers at the top either side of a short divider, a deep drawer below them and
+ * three more. Each side is two posts with a panel between them (dowels, cam bolts, cam locks), a spacer board on the
+ * inside carrying five runners. The left side lies on a rug, the rails stand in it on dowels and cam bolts, the divider
+ * goes in, the right side goes on top. The top takes two L brackets and its cam bolts upside down, goes on with dowels,
+ * screws and cam locks, and the two hardboard backs are riveted together and nailed on with the chest on its front.
+ */
+function chest6(b: PlanBuilder, s: ProductSpec) {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const P = 45, legH = 110, topT = 20, ovS = 22, ovF = 14;
+ const topRail = 40, botRail = 50, midRail = 20, backRail = 80;
+ const avail = H - topT - legH - topRail - botRail - 4 * midRail;
+ const small = 140, deep = 290, mid = Math.round((avail - small - deep) / 3);
+ const openings = [small, deep, mid, mid, avail - small - deep - 2 * mid];
+ const postH = H - topT;
+ const xo = W / 2 - ovS, xi = xo - P, xp = xo - P / 2;
+ const zf = D / 2 - ovF, zb = -D / 2 + 3;
+ const zpf = zf - P / 2, zpb = zb + P / 2;
+ const sg = (i: number) => (i === 0 ? -1 : 1);
+
+ const postT = b.part("Corner post", [P, postH, P], { material: "wood" });
+ const panelT = 16, panelX = xo - 16;
+ const panelH = postH - legH;
+ const panelD = zpf - zpb - P + 20;
+ const sidePanelT = b.part("Side panel", [panelT, panelH, panelD]);
+ const spT = Math.max(2, panelX - panelT / 2 - xi);
+ const spacerT = b.part("Spacer board", [spT, panelH - 20, panelD - 24]);
+ const panelY = legH + panelH / 2;
+ const posts = [0, 1].map((i) => [b.place(postT, [sg(i) * xp, postH / 2, zpf]), b.place(postT, [sg(i) * xp, postH / 2, zpb])]);
+ const panels = [0, 1].map((i) => b.place(sidePanelT, [sg(i) * panelX, panelY, (zpf + zpb) / 2]));
+ const spacers = [0, 1].map((i) => b.place(spacerT, [sg(i) * (xi + spT / 2), panelY, (zpf + zpb) / 2]));
+ const sideKeys = (i: number) => [...posts[i], panels[i], spacers[i]];
+
+ const railD = 40;
+ const zr = zf - railD / 2;
+ const tops = postH;
+ const railYs: { y: number; h: number }[] = [{ y: tops - topRail / 2, h: topRail }];
+ let y = tops - topRail;
+ const ops: { y0: number; h: number }[] = [];
+ openings.forEach((h, i) => {
+ ops.push({ y0: y - h, h });
+ y -= h;
+ const rh = i === openings.length - 1 ? botRail : midRail;
+ railYs.push({ y: y - rh / 2, h: rh });
+ y -= rh;
+ });
+ const rails = railYs.map((r, i) => b.place(b.part(i === 0 ? "Top rail" : i === railYs.length - 1 ? "Bottom rail" : "Front rail", [2 * xi, r.h, railD], { material: "wood" }), [0, r.y, zr]));
+ const backRailY = tops - backRail / 2;
+ const backRailK = b.place(b.part("Back rail", [2 * xi, backRail, 20], { material: "wood" }), [0, backRailY, zb + 10]);
+ const top = b.place(b.part("Top", [W, topT, D]), [0, H - topT / 2, 0]);
+ const sheetW = xo + 6;
+ const backH = postH - legH - 4;
+ const backT = b.part("Back panel", [sheetW, backH, 3], { material: "fiber" });
+ const backs = [b.place(backT, [-xo + sheetW / 2, legH + backH / 2, zb - 1.5]), b.place(backT, [xo - sheetW / 2, legH + backH / 2, zb - 1.5])];
+ // the short divider between the two small drawers; it reaches forward under the top rail, where the long screws hold it
+ const divZ0 = zb + 24, divZ1 = zf - 20;
+ const divider = b.place(b.part("Divider", [18, ops[0].h, divZ1 - divZ0]), [0, ops[0].y0 + ops[0].h / 2, (divZ0 + divZ1) / 2]);
+
+ const runLen = Math.round((zf - zb - 60) / 10) * 10;
+ const runner = runnerDef(runLen);
+ const runners = (i: number): FitOpts[] => ops.map((o) => ({ on: spacers[i], at: [sg(i) * xi, o.y0 + 8, zf - 20 - runLen / 2], dir: [sg(i), 0, 0], hole: false }));
+ const runnerScrews = (i: number): FitOpts[] => ops.flatMap((o) => [zf - 50, zf - runLen + 10].map((z): FitOpts => ({ on: spacers[i], at: [sg(i) * xi, o.y0 + 8, z], dir: [sg(i), 0, 0] })));
+
+ const panelYs = spread(legH + 60, postH - 60, 3);
+ const postBolts = (i: number): FitOpts[] =>
+ posts[i].flatMap((p, j) => panelYs.map((yy): FitOpts => ({ on: p, at: [sg(i) * panelX, yy, j === 0 ? zpf - P / 2 : zpb + P / 2], dir: [0, 0, j === 0 ? 1 : -1], mate: panels[i], mateHole: 4 })));
+ const panelDowels = (i: number): FitOpts[] =>
+ posts[i].flatMap((p, j) => [legH + panelH * 0.3, legH + panelH * 0.7].map((yy): FitOpts => ({ on: p, at: [sg(i) * panelX, yy, j === 0 ? zpf - P / 2 : zpb + P / 2], dir: [0, 0, j === 0 ? 1 : -1], mate: panels[i] })));
+ const panelCams = (i: number): FitOpts[] =>
+ [zpf - P / 2 - 30, zpb + P / 2 + 30].flatMap((z) => panelYs.map((yy): FitOpts => ({ on: panels[i], at: [sg(i) * (panelX - panelT / 2), yy, z], dir: [sg(i), 0, 0] })));
+ const feet = (i: number): FitOpts[] => posts[i].map((p, j) => ({ on: p, at: [sg(i) * xp, 0, j === 0 ? zpf : zpb], dir: [0, 1, 0], hole: false }));
+ const spacerDowels = (i: number): FitOpts[] =>
+ [legH + 150, postH - 150].flatMap((yy) => [zpf - P / 2 - 60, zpb + P / 2 + 60].map((z): FitOpts => ({ on: spacers[i], at: [sg(i) * (panelX - panelT / 2), yy, z], dir: [-sg(i), 0, 0], mate: panels[i] })));
+
+ // rails into the sides: a cam bolt and a dowel in the post at each end, a cam lock in the rail
+ type J = { k: string; yy: number; z: number; dz: number; inFront: boolean; h: number };
+ const joints: J[] = [
+ ...rails.map((k, i): J => ({ k, yy: railYs[i].y, z: zr, dz: 10, inFront: true, h: railYs[i].h })),
+ { k: backRailK, yy: backRailY, z: zb + 10, dz: backRail / 4, inFront: false, h: backRail },
+ ];
+ const railBolts = (i: number): FitOpts[] => joints.map((j) => ({ on: posts[i][j.inFront ? 0 : 1], at: [sg(i) * xi, j.yy - (j.inFront ? 0 : j.dz), j.inFront ? j.z - j.dz : j.z], dir: [sg(i), 0, 0], mate: j.k, mateHole: 4 }));
+ const railDowels = (i: number): FitOpts[] => joints.map((j) => ({ on: j.k, at: [sg(i) * xi, j.yy + (j.inFront ? 0 : j.dz), j.inFront ? j.z + j.dz : j.z], dir: [-sg(i), 0, 0], mate: posts[i][j.inFront ? 0 : 1] }));
+ const railCams = (i: number, js: J[]): FitOpts[] =>
+ js.map((j): FitOpts => (j.inFront ? { on: j.k, at: [sg(i) * (xi - 28), j.yy + j.h / 2, j.z - j.dz], dir: [0, -1, 0] } : { on: j.k, at: [sg(i) * (xi - 28), j.yy - j.dz, j.z + 10], dir: [0, 0, -1] }));
+
+ // the top: four cam bolts a side, three dowels a side and one in the divider, screws up through the top rail and back rail
+ const zm = (zpf + zpb) / 2;
+ const topBoltJ = (i: number) => [
+ { k: posts[i][0], x: xp, z: zpf - 10, xc: xi },
+ { k: panels[i], x: panelX, z: zm - 70, xc: panelX - panelT / 2 },
+ { k: panels[i], x: panelX, z: zm + 70, xc: panelX - panelT / 2 },
+ { k: posts[i][1], x: xp, z: zpb + 10, xc: xi },
+ ];
+ const topDowelJ = (i: number) => [
+ { k: posts[i][0], x: xp, z: zpf + 10 },
+ { k: panels[i], x: panelX, z: zm },
+ { k: posts[i][1], x: xp, z: zpb - 10 },
+ ];
+ const topBolts: FitOpts[] = [0, 1].flatMap((i) => topBoltJ(i).map((j): FitOpts => ({ on: top, at: [sg(i) * j.x, tops, j.z], dir: [0, 1, 0], mate: j.k, mateHole: 4 })));
+ const topDowels: FitOpts[] = [0, 1].flatMap((i) => topDowelJ(i).map((j): FitOpts => ({ on: j.k, at: [sg(i) * j.x, tops, j.z], dir: [0, -1, 0], mate: top })));
+ const topCams: FitOpts[] = [0, 1].flatMap((i) => topBoltJ(i).map((j): FitOpts => ({ on: j.k, at: [sg(i) * j.xc, tops - 26, j.z], dir: [sg(i), 0, 0] })));
+ const topScrews: FitOpts[] = [
+ ...spread(-xi * 0.6, xi * 0.6, 2).map((x): FitOpts => ({ on: rails[0], at: [x, tops - topRail, zr], dir: [0, 1, 0], mate: top })),
+ ...spread(-xi * 0.6, xi * 0.6, 2).map((x): FitOpts => ({ on: backRailK, at: [x, tops - backRail, zb + 10], dir: [0, 1, 0], mate: top })),
+ ];
+
+ /* --- the two sides, on a rug --- */
+ const pivot = (i: number): Vec3 => [sg(i) * xp, postH / 2, 0];
+ const lay = (i: number): Vec3 => [(i === 0 ? -1 : 1) * (D / 2 + 80), P / 2, 0];
+ const layRot = (i: number): Vec3 => [0, Math.PI / 2, i === 0 ? Math.PI / 2 : -Math.PI / 2];
+ const off = (i: number, dz: number): Vec3 => {
+ const r = rotate([0, 0, dz], layRot(i));
+ const l = lay(i);
+ return [l[0] + r[0], l[1] + r[1], l[2] + r[2]];
+ };
+ step(b, { title: "Screw the cam bolts into the four corner posts", detail: "Lay them on a rug, marked ends together. Three in each post, by hand until they stop.", tools: ["screwdriver"], scene: "side", kind: "cams", warnings: ["floor"] }, () => {
+ b.stagger(0.12);
+ for (const i of [0, 1]) {
+ stageGroup(b, [posts[i][0]], pivot(i), layRot(i), lay(i));
+ stageGroup(b, [posts[i][1]], pivot(i), layRot(i), off(i, -400));
+ }
+ b.then(0.15);
+ b.fits(CAM_BOLT, [...postBolts(0), ...postBolts(1)], 0.05);
+ });
+ step(b, { title: "Join each side panel to its two posts", detail: "Tap the dowels into the posts. Push the panel onto the front post, then push the back post onto the panel.", tools: ["hammer"], scene: "side", kind: "dowels" }, () => {
+ b.fits(DOWEL, [...panelDowels(0), ...panelDowels(1)], 0.06);
+ b.then(0.15);
+ for (const i of [0, 1]) stageGroup(b, [panels[i]], pivot(i), layRot(i), lay(i), rotate([0, 0, -200], layRot(i)));
+ b.then(0.1);
+ for (const i of [0, 1]) stageGroup(b, [posts[i][1]], pivot(i), layRot(i), lay(i), [0, 0, 0]);
+ });
+ step(b, { title: "Lock the cam locks in the side panels", detail: "Arrow towards the bolt, then turn clockwise until each one pulls tight.", tools: ["screwdriver"], scene: "side", kind: "cams" }, () =>
+ b.fits(CAM, [...panelCams(0), ...panelCams(1)], 0.06),
+ );
+ step(b, { title: "Press the spacer boards onto the side panels", detail: "Push the long dowels into one face of each board, then press it onto the panel between the posts.", scene: "side", kind: "dowels" }, () => {
+ for (const i of [0, 1]) stageGroup(b, [spacers[i]], pivot(i), layRot(i), lay(i));
+ b.then(0.1);
+ b.fits(SMALL_DOWEL, [...spacerDowels(0), ...spacerDowels(1)], 0.08);
+ });
+ for (const i of [1, 0])
+ step(
+ b,
+ { title: i === 0 ? "Screw the runners onto the left side" : "Screw the runners onto the right side", detail: "Five on each side, marked L and R. Wheel end at the front, two screws in each.", tools: ["screwdriver"], scene: "side", kind: "runners" },
+ () => {
+ b.fits(runner, runners(i), 0.2);
+ b.then(0.1);
+ b.fits(RUNNER_SCREW, runnerScrews(i), 0.06);
+ },
+ );
+ step(b, { title: "Push the feet into the ends of the posts", detail: "Into the bottom end of each post. Press them in until they sit flat.", scene: "side" }, () => b.fits(FOOT, [...feet(0), ...feet(1)], 0.15));
+ step(b, { title: "Screw in the cam bolts for the rails", detail: "Seven into the inside faces of the posts on each side, by hand until they stop.", tools: ["screwdriver"], scene: "side", kind: "cams" }, () =>
+ b.fits(CAM_BOLT, [...railBolts(0), ...railBolts(1)], 0.06),
+ );
+ // every rail takes a dowel in each end, flat on the rug
+ const allRails = [backRailK, ...rails];
+ step(b, { title: "Tap the dowels into the rails", detail: "One in each end of all seven rails.", tools: ["hammer"], scene: "rails", kind: "dowels" }, () => {
+ b.stagger(0.08);
+ allRails.forEach((k, i) => {
+ const it = b.partItem(k);
+ b.stage(k, [0, 40, (i - (allRails.length - 1) / 2) * 90], [-Math.PI / 2, 0, 0], [0, 160, 0]);
+ void it;
+ });
+ b.then(0.15);
+ b.fits(DOWEL, [...railDowels(0), ...railDowels(1)], 0.04);
+ });
+
+ /* --- the frame, lying on its left side --- */
+ const front = joints.filter((j) => j.inFront), backJ = joints.filter((j) => !j.inFront);
+ step(b, { title: "Lay the left side down and stand the back rail in it", detail: "Inside face up. It goes at the top of the back post, on its dowel and bolt.", tools: ["hammer"], pose: "+x", kind: "join", warnings: ["floor"] }, () => {
+ b.stagger(0.12);
+ for (const k of sideKeys(0)) b.add(k, [300, 0, 0]);
+ b.then(0.15);
+ for (const j of backJ) b.add(j.k, [300, 0, 0]);
+ });
+ step(b, { title: "Stand the front rails in", detail: "Top rail at the top, the wide one at the bottom, the four narrow ones between. Push each onto its dowel hole and bolt.", pose: "+x", kind: "join" }, () => {
+ b.stagger(0.15);
+ for (const j of front) b.add(j.k, [300, 0, 0]);
+ });
+ step(b, { title: "Lock the front rails with cam locks", detail: "One in each rail, next to the side.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => b.fits(CAM, railCams(0, front), 0.1));
+ const dz0 = ops[0].y0, dz1 = ops[0].y0 + ops[0].h;
+ step(b, { title: "Stand the divider in", detail: "Between the top rail and the rail below it, runners already on. Tap a dowel into its top edge first, then lock it with one cam lock.", tools: ["hammer", "screwdriver"], pose: "+x", kind: "join" }, () => {
+ b.fit(DOWEL, { on: divider, at: [0, dz1, zb + 120], dir: [0, -1, 0] });
+ b.then(0.1);
+ b.add(divider, [300, 0, 0]);
+ for (const g of [-1, 1]) {
+ b.preset(runner, { on: divider, at: [g * 9, dz0 + 8, zf - 20 - runLen / 2], dir: [-g, 0, 0], hole: false });
+ }
+ b.then(0.1);
+ b.fit(CAM, { on: divider, at: [9, dz0 + 40, zb + 60], dir: [-1, 0, 0] });
+ });
+ step(b, { title: "Lower the right side onto the rails", detail: "Two people make this easier: press it down evenly onto the dowels.", pose: "+x", kind: "join", people: 2 }, () => {
+ b.stagger(0.05);
+ for (const k of sideKeys(1)) b.add(k, [420, 0, 0]);
+ });
+ step(b, { title: "Lock the cam locks on this side", detail: "Seven, one in each rail. Arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => b.fits(CAM, railCams(1, joints), 0.1));
+ step(b, { title: "Stand it up and screw the divider in", detail: "One long screw down through the top rail and one up through the rail below, with the Allen key.", tools: ["allen"], pose: "+y", kind: "screws", people: 2 }, () => {
+ b.fit(DIVIDER_SCREW, { on: rails[0], at: [0, tops, zf - 30], dir: [0, -1, 0], mate: divider });
+ b.fit(TOP_SCREW, { on: rails[1], at: [0, dz0 - midRail, zf - 30], dir: [0, 1, 0], mate: divider });
+ });
+
+ /* --- the top --- */
+ const brX = [-xi * 0.55, xi * 0.55];
+ step(b, { title: "Tap the dowels into the tops of the sides", detail: "Three on each side: in both posts and the panel.", tools: ["hammer"], kind: "dowels" }, () => b.fits(DOWEL, topDowels, 0.08));
+ step(b, { title: "Screw the wall brackets under the top", detail: "Lay the top upside down on a rug. Two brackets at the back edge, a screw and washer in each.", tools: ["screwdriver"], scene: "top", kind: "screws", warnings: ["face"] }, () => {
+ b.stage(top, [0, topT / 2, 0], [0, 0, Math.PI], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(BRACKET, brX.map((x): FitOpts => ({ on: top, at: [x, tops, zb + 2], dir: [0, 1, 0], hole: false })), 0.15);
+ b.then(0.05);
+ b.fits(WASHER, brX.map((x): FitOpts => ({ on: top, at: [x, tops - 4, zb + 25], dir: [0, 1, 0], hole: false })), 0.1);
+ b.fits(SMALL_SCREW, brX.map((x): FitOpts => ({ on: top, at: [x, tops - 5, zb + 25], dir: [0, 1, 0] })), 0.1);
+ });
+ step(b, { title: "Screw the cam bolts into the top", detail: "Eight, by hand until they stop.", tools: ["screwdriver"], scene: "top", kind: "cams" }, () => b.fits(CAM_BOLT, topBolts, 0.06));
+ step(b, { title: "Put the top on", detail: "Lower it onto the dowels and bolts. Two people make this easier.", pose: "+y", kind: "join", people: 2 }, () => b.add(top, [0, 300, 0]));
+ step(b, { title: "Screw the top down through the rails", detail: "Four long screws up through the top rail and the back rail, with the Allen key.", tools: ["allen"], kind: "screws" }, () => b.fits(TOP_SCREW, topScrews, 0.15));
+ step(b, { title: "Lock the top with cam locks", detail: "Four on each side, just under the top.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM, topCams, 0.1));
+
+ /* --- the back --- */
+ const zn = zb - 3;
+ const nailOn = (k: string, x: number, yy: number): FitOpts => ({ on: k, at: [x, yy, zn], dir: [0, 0, 1], hole: false });
+ const corner = (i: number) => nailOn(posts[i][1], sg(i) * xp, postH - 60);
+ const round: FitOpts[] = [
+ ...[0, 1].flatMap((i) => spread(legH + 60, postH - 200, 5).map((yy) => nailOn(posts[i][1], sg(i) * xp, yy))),
+ ...spread(-xi + 60, xi - 60, 6).map((x) => nailOn(backRailK, x, backRailY)),
+ ...spread(-xi + 60, xi - 60, 5).map((x) => nailOn(backs[x < 0 ? 0 : 1], x, legH + 6)),
+ ];
+ step(b, { title: "Lay it on its front", detail: "On the flattened box, so the front edges don't get scratched.", pose: "-z", kind: "flip", people: 2, warnings: ["floor", "two"] });
+ step(b, { title: "Lay the back panels on", detail: "Push the first into one side, then slide the second under its edge so they overlap in the middle.", pose: "-z", kind: "general" }, () => {
+ b.add(backs[0], [0, 0, -340]);
+ b.then(0.15);
+ b.add(backs[1], [300, 0, -60]);
+ });
+ const rivY = spread(legH + 120, postH - 160, 4);
+ step(b, { title: "Rivet the back panels together", detail: "Four plastic rivets through the overlap: push in the sleeve, then press the pin into it.", pose: "-z", kind: "general" }, () => {
+ b.fits({ kind: "clip", len: 8, dia: 12, name: "Rivet sleeve" }, rivY.map((yy): FitOpts => ({ on: backs[0], at: [0, yy, zb - 3], dir: [0, 0, 1], hole: false })), 0.1);
+ b.then(0.1);
+ b.fits({ kind: "clip", len: 10, dia: 10, name: "Rivet pin" }, rivY.map((yy): FitOpts => ({ on: backs[0], at: [0, yy, zb - 4], dir: [0, 0, 1], hole: false })), 0.1);
+ });
+ step(b, { title: "Nail the two top corners", detail: "Line the panels up with the top corners and nail each one there, so the frame is square.", tools: ["hammer"], pose: "-z", kind: "nails", check: "square" }, () => b.fits(NAIL, [corner(0), corner(1)], 0.2));
+ step(b, { title: "Nail the back panels all round", detail: "Into the posts, the back rail and along the bottom, keeping the nails straight.", tools: ["hammer"], pose: "-z", kind: "nails" }, () => b.fits(NAIL, round, 0.05));
+ step(b, { title: "Stand it up", detail: "Turn it upright where it will go, against the wall.", pose: "+y", kind: "standup", people: 2, warnings: ["two"] });
+ wallBrackets(b, { xs: brX, y: H, z: zb - 20 });
+
+ drawers(
+ b,
+ ops.flatMap((o, k) =>
+ k === 0
+ ? [-1, 1].map((g): DrawerBox => ({ x: (g * (2 * xi / 2 + 9)) / 2, y0: o.y0, w: xi - 9, h: o.h, zf, zBack: zb + 24, knobs: 2, dowels: 1 }))
+ : [{ x: 0, y0: o.y0, w: 2 * xi, h: o.h, zf, zBack: zb + 24, knobs: 2 } as DrawerBox],
+ ),
+ { support: true },
+ )();
+}
+
+/* ---------- glass-door cabinet with 3 drawers ---------- */
+
+function glassCabinet(b: PlanBuilder, s: ProductSpec) {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const topT = 22, P = 45, ov = 10;
+ const postH = H - topT;
+ const xo = W / 2 - ov, xp = xo - P / 2, xi = xo - P;
+ const zf = D / 2 - ov, zb = -D / 2 + 3;
+ const zpf = zf - P / 2, zpb = zb + P / 2, zm = (zpf + zpb) / 2;
+ const zr = zf - 10, zbr = zb + 10;
+ const sideD = zpf - zpb - P;
+ const legH = 150, plinth = 110, topRail = 60, frontRail = 20;
+ const pTop = legH + plinth;
+ // the drawers from the bottom up, then the fixed shelf and the doors above it
+ const opsUp = [210, 190, 130];
+ const ops: { y0: number; h: number }[] = [];
+ const fr: number[] = [];
+ let y = pTop;
+ opsUp.forEach((h, i) => {
+ ops.push({ y0: y, h });
+ y += h;
+ if (i < opsUp.length - 1) {
+ fr.push(y + frontRail / 2);
+ y += frontRail;
+ }
+ });
+ const fxY = y + 10; // fixed shelf centre, 20 thick
+ const srH = 60;
+ const doorY0 = fxY + 12, doorY1 = postH - topRail - 2;
+
+ /* drawers first, as the manual does: small at the top, the deepest at the bottom */
+ const zBack = zb + 40;
+ const slideIn = drawers(
+ b,
+ [...ops].reverse().map((o, i): DrawerBox => ({ x: 0, y0: o.y0, w: 2 * xi, h: o.h, zf, zBack, knobs: 2, bolts: i === 0 ? 1 : 2, nails: i === 2 ? 3 : 2 })),
+ );
+
+ /* the frame parts */
+ const sides = [-1, 1].map((g) => {
+ const lo = { y0: pTop, y1: fxY - srH / 2 };
+ const up = { y0: fxY + srH / 2, y1: postH };
+ const { type, mid } = b.compound(
+ "Side frame",
+ [
+ { shape: "box", size: [P, postH, P], pos: [g * xp, postH / 2, zpf], material: "wood" },
+ { shape: "box", size: [P, postH, P], pos: [g * xp, postH / 2, zpb], material: "wood" },
+ { shape: "box", size: [16, lo.y1 - lo.y0, sideD + 16], pos: [g * (xo - 16), (lo.y0 + lo.y1) / 2, zm], material: "board" },
+ { shape: "box", size: [16, up.y1 - up.y0, sideD + 16], pos: [g * (xo - 16), (up.y0 + up.y1) / 2, zm], material: "board" },
+ { shape: "box", size: [P - 10, srH, sideD], pos: [g * (xo - P / 2 - 5), fxY, zm], material: "wood" },
+ ],
+ { material: "wood" },
+ );
+ return b.place(type, mid);
+ });
+ const brT = b.part("Bottom side rail", [P - 10, plinth, sideD], { material: "wood" });
+ const brs = [-1, 1].map((g) => b.place(brT, [g * (xo - P / 2 - 5), legH + plinth / 2, zm]));
+ const barT = b.part("Runner bar", [21, 40, sideD], { material: "wood" });
+ const barY = (o: { y0: number }) => o.y0 + 25;
+ const bars = [-1, 1].map((g) => ops.map((o) => b.place(barT, [g * (xi + 10.5), barY(o), zm])));
+ const railT = b.part("Rail", [2 * xi, plinth, 20], { material: "wood" });
+ const fp = b.place(railT, [0, legH + plinth / 2, zr]);
+ const bp = b.place(railT, [0, legH + plinth / 2, zbr]);
+ const topRailT = b.part("Top rail", [2 * xi, topRail, 20], { material: "wood" });
+ const ft = b.place(topRailT, [0, postH - topRail / 2, zr]);
+ const bt = b.place(topRailT, [0, postH - topRail / 2, zbr]);
+ const frT = b.part("Front rail", [2 * xi, frontRail, 40], { material: "wood" });
+ const frs = fr.map((yy) => b.place(frT, [0, yy, zf - 20]));
+ const fx = b.place(b.part("Fixed shelf", [2 * xi, 20, zf - zb - 26]), [0, fxY, (zf + zb + 26) / 2]);
+ const top = b.place(b.part("Top", [W, topT, D], { material: "wood" }), [0, H - topT / 2, 0]);
+ const bkLoT = b.part("Back panel", [2 * xi, fxY - pTop, 4], { material: "wood" });
+ const bkUpT = b.part("Back panel", [2 * xi, postH - topRail - fxY, 4], { material: "wood" });
+ const bkLo = b.place(bkLoT, [0, (pTop + fxY) / 2, zb + 24]);
+ const bkUp = b.place(bkUpT, [0, (fxY + postH - topRail) / 2, zb + 24]);
+ const shelfYs = spread(doorY0 + 260, doorY1 - 260, 3).map(Math.round);
+ const shelfT = b.part("Shelf", [2 * xi - 4, 18, zf - zb - 50]);
+ const shelves = shelfYs.map((yy) => b.place(shelfT, [0, yy, (zf + zb) / 2 + 6]));
+ const dw = xi - 3, dh = doorY1 - doorY0, dt = 20, st = 60;
+ const door = b.compound(
+ "Glass door",
+ [
+ { shape: "box", size: [st, dh, dt], pos: [-(dw - st) / 2, 0, 0], material: "wood" },
+ { shape: "box", size: [st, dh, dt], pos: [(dw - st) / 2, 0, 0], material: "wood" },
+ { shape: "box", size: [dw - 2 * st, st, dt], pos: [0, (dh - st) / 2, 0], material: "wood" },
+ { shape: "box", size: [dw - 2 * st, st + 20, dt], pos: [0, -(dh - st - 20) / 2, 0], material: "wood" },
+ { shape: "box", size: [dw - 2 * st, dh - 2 * st - 20, 4], pos: [0, 10, -2], material: "glass" },
+ ],
+ { material: "wood" },
+ );
+ const doors = [-1, 1].map((g) => b.place(door.type, [g * (dw / 2 + 1.5), (doorY0 + doorY1) / 2, zf - dt / 2]));
+ const hingeYs = [doorY0 + 140, doorY1 - 140];
+
+ /* fittings */
+ const sx = (g: number) => g * (xo - P / 2 - 5);
+ const brScrews = (i: number): FitOpts[] => {
+ const g = i ? 1 : -1;
+ return [
+ { on: sides[i], at: [sx(g), legH + plinth / 2, zpf + P / 2], dir: [0, 0, -1], mate: brs[i] },
+ { on: sides[i], at: [sx(g), legH + plinth / 2, zpb - P / 2], dir: [0, 0, 1], mate: brs[i] },
+ ];
+ };
+ const feet = (i: number): FitOpts[] => [zpf, zpb].map((z): FitOpts => ({ on: sides[i], at: [(i ? 1 : -1) * xp, 0, z], dir: [0, 1, 0], hole: false }));
+ const barDowels = (i: number): FitOpts[] => ops.map((o, k) => ({ on: bars[i][k], at: [(i ? 1 : -1) * (xo - 24), barY(o), zm + 80], dir: [i ? 1 : -1, 0, 0], mate: sides[i] }));
+ const barScrews = (i: number): FitOpts[] => ops.map((o, k) => ({ on: bars[i][k], at: [(i ? 1 : -1) * xi, barY(o), zm - 60], dir: [i ? 1 : -1, 0, 0], mate: sides[i] }));
+ type J = { k: string; yy: number; z: number; front: boolean; h: number };
+ const railJ: J[] = [
+ ...frs.map((k, i): J => ({ k, yy: fr[i], z: zf - 20, front: true, h: frontRail })),
+ { k: fp, yy: legH + plinth / 2, z: zr, front: true, h: plinth },
+ { k: ft, yy: postH - topRail / 2, z: zr, front: true, h: topRail },
+ { k: bp, yy: legH + plinth / 2, z: zbr, front: false, h: plinth },
+ { k: bt, yy: postH - topRail / 2, z: zbr, front: false, h: topRail },
+ ];
+ const isTopRail = (j: J) => j.k === ft || j.k === bt;
+ const boltY = (j: J) => (j.h > 40 ? j.yy + (isTopRail(j) ? -12 : -15) : j.yy);
+ const dowelY = (j: J) => (j.h > 40 ? j.yy + (isTopRail(j) ? 12 : 15) : j.yy);
+ const dz = (j: J) => (j.h > 40 ? 0 : 10);
+ const railBolts = (i: number): FitOpts[] => {
+ const g = i ? 1 : -1;
+ return [
+ ...railJ.map((j): FitOpts => ({ on: sides[i], at: [g * xi, boltY(j), j.z - dz(j)], dir: [g, 0, 0], mate: j.k, mateHole: 4 })),
+ ...[zm - 60, zm + 60].map((z): FitOpts => ({ on: sides[i], at: [g * xi, fxY, z], dir: [g, 0, 0], mate: fx, mateHole: 4 })),
+ ];
+ };
+ const railDowels = (i: number, js: J[]): FitOpts[] => js.map((j) => ({ on: j.k, at: [(i ? 1 : -1) * xi, dowelY(j), j.z + dz(j)], dir: [i ? -1 : 1, 0, 0], mate: sides[i] }));
+ const railCams = (i: number, js: J[]): FitOpts[] =>
+ js.map((j): FitOpts => {
+ const g = i ? 1 : -1;
+ if (j.h <= 40) return { on: j.k, at: [g * (xi - 26), j.yy - j.h / 2, j.z - dz(j)], dir: [0, 1, 0] };
+ const up = isTopRail(j);
+ return { on: j.k, at: [g * (xi - 26), up ? j.yy - j.h / 2 : j.yy + j.h / 2, j.z], dir: [0, up ? 1 : -1, 0] };
+ });
+ const shelfCams = (i: number): FitOpts[] => [zm - 60, zm + 60].map((z): FitOpts => ({ on: fx, at: [(i ? 1 : -1) * (xi - 26), fxY + 10, z], dir: [0, -1, 0] }));
+ const hingePlate: HwDef = { kind: "plate", len: 40, dia: 20, name: "Hinge plate" };
+ const plates = (i: number): FitOpts[] => hingeYs.map((yy): FitOpts => ({ on: sides[i], at: [(i ? 1 : -1) * xi, yy, zf - 40], dir: [i ? 1 : -1, 0, 0], hole: false }));
+ const runLen = Math.round((zf - zb - 60) / 10) * 10;
+ const runner = runnerDef(runLen);
+ const runners = (i: number): FitOpts[] => ops.map((o, k) => ({ on: bars[i][k], at: [(i ? 1 : -1) * xi, o.y0 + 8, zf - 20 - runLen / 2], dir: [i ? 1 : -1, 0, 0], hole: false }));
+ const runnerScrews = (i: number): FitOpts[] => ops.flatMap((o, k) => [zf - 60, zf - runLen + 20].map((z): FitOpts => ({ on: bars[i][k], at: [(i ? 1 : -1) * xi, o.y0 + 8, z], dir: [i ? 1 : -1, 0, 0] })));
+
+ /* --- the two side frames, on a rug --- */
+ const pivot = (i: number): Vec3 => [(i ? 1 : -1) * xp, postH / 2, 0];
+ const lay = (i: number): Vec3 => [(i ? 1 : -1) * (D / 2 + 80), P / 2, 0];
+ const layRot = (i: number): Vec3 => [0, Math.PI / 2, i === 0 ? Math.PI / 2 : -Math.PI / 2];
+ const sideStep = (o: StepOpts, body: () => void) => step(b, { scene: "side", ...o }, body);
+ sideStep({ title: "Screw the bottom rails onto the side frames", detail: "Lay both side frames on a rug, inside up. Two long screws through the posts into each rail, with the Allen key.", tools: ["allen"], kind: "screws", warnings: ["floor"] }, () => {
+ b.stagger(0.12);
+ for (const i of [0, 1]) stageGroup(b, [sides[i]], pivot(i), layRot(i), lay(i));
+ b.then(0.1);
+ for (const i of [0, 1]) stageGroup(b, [brs[i]], pivot(i), layRot(i), lay(i), rotate([300, 0, 0], layRot(i)));
+ b.then(0.1);
+ b.fits(TOP_SCREW, [...brScrews(0), ...brScrews(1)], 0.1);
+ });
+ sideStep({ title: "Screw the adjustable feet into the posts", detail: "Into the bottom end of each post, by hand. You level them once it stands.", kind: "legs" }, () => b.fits(ADJ_FOOT, [...feet(0), ...feet(1)], 0.12));
+ sideStep({ title: "Tap the dowels into the runner bars", detail: "One in each of the six bars.", tools: ["hammer"], kind: "dowels" }, () => {
+ b.stagger(0.06);
+ // they lie on the rug beside the frames until they're screwed on
+ for (const i of [0, 1]) {
+ const l = lay(i), o = rotate([0, 0, -460], layRot(i));
+ stageGroup(b, bars[i], pivot(i), layRot(i), [l[0] + o[0], l[1] + o[1] - 24, l[2] + o[2]]);
+ }
+ b.then(0.1);
+ b.fits(DOWEL, [...barDowels(0), ...barDowels(1)], 0.06);
+ });
+ sideStep({ title: "Screw the runner bars onto the side frames", detail: "Three on each side, on the lower panel. Push each onto its dowel, then a long screw.", tools: ["allen"], kind: "screws" }, () => {
+ b.stagger(0.12);
+ for (const i of [0, 1]) stageGroup(b, bars[i], pivot(i), layRot(i), lay(i), rotate([(i ? 1 : -1) * 200, 0, 0], layRot(i)));
+ b.then(0.1);
+ b.fits(BAR_SCREW, [...barScrews(0), ...barScrews(1)], 0.08);
+ });
+ sideStep({ title: "Screw in the cam bolts", detail: "Eight in each side frame: six for the rails and two for the fixed shelf. By hand until they stop.", tools: ["screwdriver"], kind: "cams" }, () =>
+ b.fits(CAM_BOLT, [...railBolts(0), ...railBolts(1)], 0.04),
+ );
+ sideStep({ title: "Press in the hinge plates", detail: "Two on each front post, above the fixed shelf. Push them in and turn the screws to spread them.", tools: ["screwdriver"], kind: "hinges" }, () =>
+ b.fits(hingePlate, [...plates(0), ...plates(1)], 0.12),
+ );
+ sideStep({ title: "Screw the frame runners onto the bars", detail: "Three on each side, marked L and R. Wheel end at the front, two screws in each.", tools: ["screwdriver"], kind: "runners" }, () => {
+ b.fits(runner, [...runners(0), ...runners(1)], 0.15);
+ b.then(0.1);
+ b.fits(RUNNER_SCREW, [...runnerScrews(0), ...runnerScrews(1)], 0.05);
+ });
+
+ /* --- the frame, lying on its left side --- */
+ const leftKeys = [sides[0], brs[0], ...bars[0]];
+ step(b, { title: "Lay the left side down and stand the fixed shelf in it", detail: "Inside face up. The shelf drops onto the two bolts in the side rail; lock it with two cam locks.", tools: ["screwdriver"], pose: "+x", kind: "join", warnings: ["floor"] }, () => {
+ b.stagger(0.1);
+ for (const k of leftKeys) b.add(k, [300, 0, 0]);
+ b.then(0.15);
+ b.add(fx, [300, 0, 0]);
+ b.then(0.1);
+ b.fits(CAM, shelfCams(0), 0.12);
+ });
+ const groups: [J[], string, string][] = [
+ [railJ.filter((j) => frs.includes(j.k)), "Stand the two front rails in", "The narrow rails go between the drawers. A dowel in the end of each, then push it onto its hole and bolt, and lock it."],
+ [railJ.filter((j) => j.front && !frs.includes(j.k)), "Stand the front top rail and plinth in", "Top rail at the top end, plinth at the foot end, on a dowel and bolt each. Lock them."],
+ [railJ.filter((j) => !j.front), "Stand the back top rail and plinth in", "The same at the back. Lock them with two more cam locks."],
+ ];
+ for (const [js, title, detail] of groups)
+ step(b, { title, detail, tools: ["hammer", "screwdriver"], pose: "+x", kind: "join" }, () => {
+ b.fits(DOWEL, railDowels(0, js), 0.1);
+ b.then(0.1);
+ b.stagger(0.15);
+ for (const j of js) b.add(j.k, [300, 0, 0]);
+ b.then(0.1);
+ b.fits(CAM, railCams(0, js), 0.12);
+ });
+ step(b, { title: "Tap dowels into the free rail ends", detail: "One in the top end of each of the six rails.", tools: ["hammer"], pose: "+x", kind: "dowels" }, () => b.fits(DOWEL, railDowels(1, railJ), 0.08));
+ step(b, { title: "Lower the right side on", detail: "Two people: it has its rail, feet, bars and runners on like the left one. Press it down evenly onto the dowels and bolts.", pose: "+x", kind: "join", people: 2 }, () => {
+ b.stagger(0.05);
+ for (const k of [sides[1], brs[1], ...bars[1]]) b.add(k, [420, 0, 0]);
+ });
+ step(b, { title: "Lock the cam locks on this side", detail: "Six in the rails and two in the fixed shelf.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => b.fits(CAM, [...railCams(1, railJ), ...shelfCams(1)], 0.08));
+
+ /* --- on its back: door stops, top --- */
+ const stopX = [-60, 60];
+ step(b, { title: "Screw the door stops under the top rail", detail: "Turn it onto its back. One in the middle for each door, two screws each, the rubber pads on their tips.", tools: ["screwdriver"], pose: "+z", kind: "screws", people: 2 }, () => {
+ b.fits({ kind: "clip", len: 30, dia: 20, name: "Door stop" }, stopX.map((x): FitOpts => ({ on: ft, at: [x, postH - topRail, zr - 6], dir: [0, 1, 0], hole: false })), 0.15);
+ b.then(0.05);
+ b.fits(RUNNER_SCREW, stopX.flatMap((x) => [x - 8, x + 8].map((xx): FitOpts => ({ on: ft, at: [xx, postH - topRail - 1, zr - 2], dir: [0, 1, 0] }))), 0.06);
+ });
+ step(b, { title: "Push the top on", detail: "Tap two dowels into the top rails, then push the top onto them.", tools: ["hammer"], pose: "+z", kind: "join" }, () => {
+ b.fits(DOWEL, [
+ { on: ft, at: [-xi / 2, postH, zr], dir: [0, -1, 0], mate: top },
+ { on: bt, at: [xi / 2, postH, zbr], dir: [0, -1, 0], mate: top },
+ ], 0.1);
+ b.then(0.15);
+ b.add(top, [0, 300, 0]);
+ });
+ step(b, { title: "Screw the top on through the rails", detail: "Seven long screws up through the top rails, four at the front and three at the back.", tools: ["allen"], pose: "+z", kind: "screws" }, () =>
+ b.fits(TOP_SCREW, [
+ ...spread(-xi + 60, xi - 60, 4).map((x): FitOpts => ({ on: ft, at: [x, postH - topRail, zr], dir: [0, 1, 0], mate: top })),
+ ...spread(-xi + 100, xi - 100, 3).map((x): FitOpts => ({ on: bt, at: [x, postH - topRail, zbr], dir: [0, 1, 0], mate: top })),
+ ], 0.12),
+ );
+
+ /* --- on its front: the back panels --- */
+ step(b, { title: "Slide in the lower back panel", detail: "Turn it onto its front. Two people: the panel slides down the grooves in the posts and rests against the fixed shelf.", pose: "-z", kind: "general", people: 2 }, () => b.add(bkLo, [0, 0, -300]));
+ step(b, { title: "Slide in the upper back panel", detail: "The same above the fixed shelf, up to the top rail.", pose: "-z", kind: "general", people: 2 }, () => b.add(bkUp, [0, 0, -300]));
+ const clipX = spread(-xi + 100, xi - 100, 3);
+ const clipAt: { on: string; y: number; z: number; dir: Vec3 }[] = [
+ { on: fx, y: fxY - 10, z: zb + 34, dir: [0, 1, 0] },
+ { on: bt, y: postH - topRail + 12, z: zb + 20, dir: [0, 0, -1] },
+ { on: bp, y: pTop - 12, z: zb + 20, dir: [0, 0, -1] },
+ ];
+ step(b, { title: "Clip the back panels in place", detail: "Nine clips: three to the fixed shelf, three to the top rail and three to the plinth. A screw in each.", tools: ["screwdriver"], pose: "-z", kind: "screws" }, () => {
+ b.fits({ kind: "clip", len: 12, dia: 20 }, clipAt.flatMap((c) => clipX.map((x): FitOpts => ({ on: c.on, at: [x, c.y, c.z], dir: c.dir, hole: false }))), 0.06);
+ b.then(0.05);
+ b.fits(SMALL_SCREW, clipAt.flatMap((c) => clipX.map((x): FitOpts => ({ on: c.on, at: [x, c.y, c.z], dir: c.dir }))), 0.05);
+ });
+ step(b, { title: "Stand it up and level the feet", detail: "Two people. Turn the adjustable feet until it stands steady and leans slightly to the wall.", pose: "+y", kind: "standup", people: 2, warnings: ["two"] });
+ const brX = [-xi / 2, xi / 2];
+ step(b, { title: "Fix it to the wall", detail: "Two L brackets on top, a screw and washer each into the top. Wall screws aren't included: pick ones made for your wall, with a washer.", tools: ["screwdriver", "drill"], kind: "anchor", wall: true, warnings: ["wall", "tip"] }, () => {
+ b.fits(BRACKET, brX.map((x): FitOpts => ({ on: top, at: [x, H, zb + 20], dir: [0, -1, 0], hole: false })), 0.15);
+ b.then(0.05);
+ b.fits(WASHER, brX.map((x): FitOpts => ({ on: top, at: [x, H + 3, zb + 30], dir: [0, -1, 0], hole: false })), 0.1);
+ b.fits(SMALL_SCREW, brX.map((x): FitOpts => ({ on: top, at: [x, H + 4, zb + 30], dir: [0, -1, 0] })), 0.1);
+ b.then(0.1);
+ b.fits(WASHER, brX.map((x): FitOpts => ({ at: [x, H + 40, zb - 2], dir: [0, 0, -1], hole: false })), 0.1);
+ });
+ step(b, { title: "Screw in the bottom door stop", detail: "Into the hole in the middle of the fixed shelf, near the front.", tools: ["screwdriver"], kind: "screws" }, () =>
+ b.fit({ kind: "screw", len: 20, dia: 8, name: "Door stop" }, { on: fx, at: [0, fxY + 10 + 16, zf - 30], dir: [0, -1, 0] }),
+ );
+
+ /* --- doors --- */
+ const hingeX = (i: number) => (i ? 1 : -1) * (xi - 25);
+ step(b, { title: "Screw the hinges onto the doors", detail: "Lay the doors face down on a rug. Two hinges on each, at the outer edge, two screws each.", tools: ["screwdriver"], scene: "doors", kind: "hinges", warnings: ["floor"] }, () => {
+ b.stagger(0.2);
+ doors.forEach((d, i) => b.stage(d, [(i - 0.5) * (dw + 80), dt / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]));
+ b.then(0.1);
+ b.fits(HW.hinge, doors.flatMap((d, i) => hingeYs.map((yy): FitOpts => ({ on: d, at: [hingeX(i), yy, zf - dt], dir: [0, 0, 1], twist: i ? Math.PI : 0 }))), 0.12);
+ });
+ step(b, { title: "Click the doors on", detail: "Fold the hinge arms open, hook each onto its plate from the bottom and press until it clicks.", kind: "doors" }, () => {
+ b.stagger(0.3);
+ doors.forEach((d, i) => b.add(d, [(i ? 1 : -1) * 120, 0, 260]));
+ });
+ const knobY = Math.round(doorY0 + dh * 0.45);
+ step(b, { title: "Screw on the door knobs", detail: "One on each door, near the middle edge. The bolt goes in from inside.", tools: ["screwdriver"], kind: "screws" }, () => {
+ b.fits(KNOB, doors.map((d, i): FitOpts => ({ on: d, at: [(i ? 1 : -1) * 40, knobY, zf], dir: [0, 0, -1], hole: false })), 0.2);
+ b.then(0.05);
+ b.fits(KNOB_SCREW, doors.map((d, i): FitOpts => ({ on: d, at: [(i ? 1 : -1) * 40, knobY, zf - dt - 4], dir: [0, 0, 1], mate: d })), 0.15);
+ });
+ step(b, { title: "Push in the shelf pins", detail: "For each shelf, plugs in the two front posts and supports in the two back posts, at the heights you want.", kind: "shelves" }, () => {
+ b.fits({ kind: "pin", len: 10, dia: 8 }, [0, 1].flatMap((i) => shelfYs.map((yy): FitOpts => ({ on: sides[i], at: [(i ? 1 : -1) * xi, yy - 13, zpf - 30], dir: [i ? 1 : -1, 0, 0] }))), 0.06);
+ b.fits({ kind: "pin", len: 16, dia: 5 }, [0, 1].flatMap((i) => shelfYs.map((yy): FitOpts => ({ on: sides[i], at: [(i ? 1 : -1) * xi, yy - 13, zpb + 30], dir: [i ? 1 : -1, 0, 0] }))), 0.06);
+ });
+ step(b, { title: "Lay in the shelves", detail: "Tilt each one in through the open doors, then lower it onto its four supports.", kind: "shelves" }, () => {
+ b.stagger(0.3);
+ for (const k of shelves) b.add(k, [0, 0, 300]);
+ });
+ slideIn();
+}
+
+/** HEMNES guides drawn in this file; returns false for any product it doesn't build. Wired in from hemnes.ts. */
+export function hemnesCabinets(b: PlanBuilder, s: ProductSpec): boolean {
+ switch (s.slug) {
+ case "hemnes-bookcase-49-x-197":
+ buildCustom(b, { ...s, custom: bookcase49(s) });
+ return true;
+ case "hemnes-chest-6-drawers":
+ chest6(b, s);
+ return true;
+ case "hemnes-glass-door-cabinet-3-drawers-90-x-197":
+ glassCabinet(b, s);
+ return true;
+ default:
+ return false;
+ }
+}
diff --git a/src/lib/plan/families/_hemnes-storage.ts b/src/lib/plan/families/_hemnes-storage.ts
new file mode 100644
index 0000000..d2ae94f
--- /dev/null
+++ b/src/lib/plan/families/_hemnes-storage.ts
@@ -0,0 +1,894 @@
+import type { FitOpts, HwDef, PlanBuilder } from "../builder";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, Pose, ProductSpec, StepKind, ToolId, Vec3 } from "../../types";
+import { buildCustom } from "../custom";
+
+/*
+ * HEMNES storage read from IKEA's manuals: the 120 mirror cabinet, the sideboard, the two shoe cabinets and the
+ * 122 bathroom vanity with drawers. Each one is a recipe, with every fitting at the point the manual shows.
+ */
+
+const range = (n: number) => Array.from({ length: n }, (_, i) => i);
+const spread = (a: number, c: number, n: number) => range(n).map((i) => (n === 1 ? (a + c) / 2 : a + ((c - a) * i) / (n - 1)));
+
+class Recipe {
+ parts: CustomPart[] = [];
+ steps: CustomStep[] = [];
+ part(id: string, name: string, size: Vec3, pos: Vec3, o: Partial<CustomPart> = {}) {
+ this.parts.push({ id, name, size, pos, ...o });
+ return id;
+ }
+ step(st: CustomStep) {
+ this.steps.push(st);
+ }
+ get(): CustomParams {
+ // the custom builder takes ten fittings a step: share the rest over copies of the same step
+ const out: CustomStep[] = [];
+ for (const st0 of this.steps) {
+ const st = (st0.fix?.length ?? 0) > 10 ? { ...st0, fix: merge(st0.fix!) } : st0;
+ const f = st.fix ?? [];
+ if (f.length <= 10) out.push(st);
+ else for (let i = 0; i < f.length; i += 10) out.push({ ...st, fix: f.slice(i, i + 10), add: i ? [] : st.add });
+ }
+ for (const st of out) for (const f of st.fix ?? []) if (f.at) f.count = f.at.length;
+ return { parts: this.parts, steps: out };
+ }
+}
+
+/** Fittings of the same kind, size and direction in one list; each then goes into the part nearest its point. */
+function merge(fix: CustomFix[]): CustomFix[] {
+ const groups = new Map<string, CustomFix>();
+ for (const f of fix) {
+ if (!f.at) {
+ groups.set(`${groups.size}`, f);
+ continue;
+ }
+ const k = `${f.kind}|${f.len}|${f.dia}|${f.name}|${(f.dir ?? [0, -1, 0]).join(",")}`;
+ const g = groups.get(k);
+ if (!g) groups.set(k, { ...f, at: [...f.at] });
+ else {
+ g.at!.push(...f.at);
+ if (g.on !== f.on) g.on = undefined;
+ if (g.mate !== f.mate) g.mate = undefined;
+ }
+ }
+ return [...groups.values()];
+}
+
+type Fit = { kind: CustomFix["kind"]; len?: number; dia?: number; name?: string; included?: boolean };
+/** Fittings at exact points: what, the part they go into, the way they go in, the points, the part their other end meets. */
+const at = (f: Fit, on: string | undefined, dir: Vec3, pts: Vec3[], mate?: string): CustomFix => ({ ...f, count: pts.length, at: pts, dir, on, mate });
+
+// fittings, sized so different ones stay apart in the list
+const DOWEL: Fit = { kind: "dowel", len: 40, dia: 8 };
+const LONG_DOWEL: Fit = { kind: "dowel", len: 70, dia: 8 };
+const CAM_BOLT: Fit = { kind: "camScrew", len: 34, dia: 7 };
+const CAM: Fit = { kind: "cam", len: 13, dia: 15 };
+const ALLEN_SCREW: Fit = { kind: "screw", len: 50, dia: 6 };
+const WALL_SCREW: Fit = { kind: "screw", len: 50, dia: 5 };
+const WALL_PLUG: Fit = { kind: "plug", len: 40, dia: 8 };
+
+
+/* ---------- drawers built on their fronts (sideboard, shoe cabinet) ---------- */
+
+interface DrawerBox {
+ x: number; // centre of the opening
+ y0: number; // bottom of the opening
+ w: number;
+ h: number;
+ zf: number; // front face of the front
+ zBack: number; // how far back the box goes
+ knobs: 1 | 2;
+}
+type Made = { box: DrawerBox; front: string; sides: [string, string]; bottom: string; back: string; xs: number; ys: number; sh: number; zF: number; zB: number };
+const ft = 18, st = 15;
+
+/** Places the drawer parts (shown later, in their own scene) and returns them. */
+function makeDrawers(b: PlanBuilder, list: DrawerBox[]): Made[] {
+ return list.map((box) => {
+ const fw = box.w - 4, fh = box.h - 4;
+ const xs = box.w / 2 - 14 - st / 2;
+ const sh = Math.round(Math.min(fh - 30, 160));
+ const ys = box.y0 + 14;
+ const zF = box.zf - ft, zB = box.zBack;
+ const front = b.place(b.part("Drawer front", [fw, fh, ft]), [box.x, box.y0 + 2 + fh / 2, box.zf - ft / 2]);
+ const sdT = b.part("Drawer side", [st, sh, zF - zB]);
+ const sides = [-1, 1].map((g) => b.place(sdT, [box.x + g * xs, ys + sh / 2, (zF + zB) / 2])) as [string, string];
+ const back = b.place(b.part("Drawer back", [2 * xs - st, sh - 14, st]), [box.x, ys + 14 + (sh - 14) / 2, zB + st / 2 + 6]);
+ const bottom = b.place(b.part("Drawer bottom", [2 * xs - st + 8, 4, zF - zB - 8]), [box.x, ys + 10, (zF + zB) / 2 - 2]);
+ return { box, front, sides, back, bottom, xs, ys, sh, zF, zB };
+ });
+}
+
+type DrawerFits = { bolts: FitOpts[]; dowels: FitOpts[]; cams: FitOpts[]; pins: FitOpts[]; knobs: FitOpts[]; knobScrews: FitOpts[]; runnerScrews: FitOpts[] };
+function drawerFits(d: Made, o: { dowels: boolean }): DrawerFits {
+ const { box, xs, ys, sh, zF, zB } = d;
+ const two = [ys + sh * 0.3, ys + sh * 0.72];
+ const per = (fn: (g: number, k: string) => FitOpts[]) => [...fn(-1, d.sides[0]), ...fn(1, d.sides[1])];
+ const kx = box.knobs === 2 ? [box.x - box.w * 0.25, box.x + box.w * 0.25] : [box.x];
+ const ky = box.y0 + box.h / 2;
+ return {
+ bolts: per((g, k) => two.map((y): FitOpts => ({ on: d.front, at: [box.x + g * xs, y, zF], dir: [0, 0, 1], mate: k, mateHole: 4 }))),
+ dowels: o.dowels ? per((g, k) => [ys + sh * 0.12, ys + sh * 0.9].map((y): FitOpts => ({ on: k, at: [box.x + g * xs, y, zF], dir: [0, 0, -1], mate: d.front }))) : [],
+ cams: per((g, k) => two.map((y): FitOpts => ({ on: k, at: [box.x + g * (xs - st / 2), y, zF - 28], dir: [g, 0, 0] }))),
+ pins: per((g, k) => [ys + sh * 0.35, ys + sh * 0.75].map((y): FitOpts => ({ on: k, at: [box.x + g * (xs + st / 2), y, zB + st / 2 + 6], dir: [-g, 0, 0], mate: d.back }))),
+ knobs: kx.map((x): FitOpts => ({ on: d.front, at: [x, ky, box.zf], dir: [0, 0, -1], hole: false })),
+ knobScrews: kx.map((x): FitOpts => ({ on: d.front, at: [x, ky, zF - 2], dir: [0, 0, 1] })),
+ runnerScrews: per((g, k) => [zB + 60, zF - 60].map((z): FitOpts => ({ on: k, at: [box.x + g * (xs + st / 2), ys + 20, z], dir: [-g, 0, 0] }))),
+ };
+}
+const D_DOWEL: HwDef = { kind: "dowel", len: 30, dia: 8 };
+const D_BOLT: HwDef = { kind: "camScrew", len: 34, dia: 7 };
+const D_CAM: HwDef = { kind: "cam", len: 13, dia: 15 };
+const D_PIN: HwDef = { kind: "nail", len: 35, dia: 6, name: "Push-in fitting" };
+const D_KNOB: HwDef = { kind: "knob", len: 25, dia: 30 };
+const D_KNOB_SCREW: HwDef = { kind: "screw", len: 32, dia: 4 };
+const D_RUNNER_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+
+type BStep = { title: string; detail?: string; tools?: ToolId[]; pose?: Pose; kind?: StepKind; repeat?: number; scene?: string };
+const bstep = (b: PlanBuilder, o: BStep, body: () => void) => b.step({ kind: "general", warnings: [], ...o }, body);
+
+/**
+ * Drawers as the HEMNES sideboard and shoe cabinet manuals build them: the front face down on a rug takes cam bolts,
+ * the sides stand on it (on dowels when there are any) and are locked, the bottom slides down the grooves, the back
+ * is tapped on with push-in fittings, then the knob and the drawer half of the runners. The first one is shown and
+ * the rest are the same.
+ */
+function frontDrawers(b: PlanBuilder, made: Made[], o: { dowels: boolean; runnerScrews: boolean }) {
+ const n = made.length;
+ const rep = n > 1 ? n : undefined;
+ const d0 = made[0];
+ const f0 = drawerFits(d0, o);
+ const c0: Vec3 = [d0.box.x, d0.ys + d0.sh / 2, (d0.zF + d0.zB) / 2];
+ const stage = (k: string, from?: Vec3) => {
+ const it = b.partItem(k);
+ b.stage(k, [it.final.pos[0] - c0[0], it.final.pos[1] - c0[1], it.final.pos[2] - c0[2]], it.final.rot, from);
+ };
+ const dstep = (title: string, detail: string, body: () => void, x: { tools?: ToolId[]; kind?: StepKind; pose?: Pose } = {}) =>
+ bstep(b, { title, detail, tools: x.tools, scene: "drawer", pose: x.pose ?? "-z", repeat: rep, kind: x.kind ?? "drawer" }, body);
+ dstep(n > 1 ? "Screw the cam bolts into a drawer front" : "Screw the cam bolts into the drawer front", "Lay it face down on a rug. By hand until they stop.", () => {
+ stage(d0.front, [0, 0, 160]);
+ b.then(0.15);
+ b.fits(D_BOLT, f0.bolts, 0.08);
+ }, { tools: ["screwdriver"], kind: "cams" });
+ dstep("Stand the sides on the front", o.dowels ? "Tap the dowels into the front ends of the sides, then push them onto the dowels and bolts." : "Push them onto the bolts, grooves facing in.", () => {
+ if (o.dowels) b.fits(D_DOWEL, f0.dowels, 0.08);
+ b.then(0.15);
+ for (const k of d0.sides) stage(k, [0, 0, -260]);
+ }, { tools: o.dowels ? ["hammer"] : [], kind: "dowels" });
+ dstep("Lock the cam locks", "Arrow towards the bolt, then turn each one clockwise until it pulls tight.", () => b.fits(D_CAM, f0.cams, 0.1), { tools: ["screwdriver"], kind: "cams" });
+ dstep("Slide in the drawer bottom", "Down the grooves in the sides until it reaches the front.", () => stage(d0.bottom, [0, 0, -380]));
+ dstep("Tap the back on", "Set it on the sides, then knock in the push-in fittings through the sides.", () => {
+ stage(d0.back, [0, 0, -200]);
+ b.then(0.15);
+ b.fits(D_PIN, f0.pins, 0.1);
+ }, { tools: ["hammer"], kind: "join" });
+ dstep(d0.box.knobs === 2 ? "Screw on the knobs" : "Screw on the knob", "The screw goes in from inside the drawer.", () => {
+ b.fits(D_KNOB, f0.knobs, 0.2);
+ b.then(0.05);
+ b.fits(D_KNOB_SCREW, f0.knobScrews, 0.15);
+ }, { tools: ["screwdriver"], kind: "screws", pose: "+y" });
+ dstep("Screw the runners to the drawer", "The drawer half of each runner goes on the bottom edge of the side, wheel at the back.", () => b.fits(D_RUNNER_SCREW, f0.runnerScrews, 0.08), { tools: ["screwdriver"], kind: "runners", pose: "+y" });
+}
+
+/** The last step: every drawer slides in on its runners, the ones not shown being built arriving with their fittings. */
+function drawersIn(b: PlanBuilder, made: Made[], o: { dowels: boolean }, title: string, detail: string) {
+ bstep(b, { title, detail, kind: "drawer" }, () => {
+ for (const [i, d] of made.entries()) {
+ b.stagger(0);
+ for (const k of [d.front, ...d.sides, d.bottom, d.back]) b.add(k, [0, 0, 520]);
+ if (i > 0) {
+ const f = drawerFits(d, o);
+ const all: [HwDef, FitOpts[]][] = [[D_BOLT, f.bolts], [D_DOWEL, f.dowels], [D_CAM, f.cams], [D_PIN, f.pins], [D_KNOB, f.knobs], [D_KNOB_SCREW, f.knobScrews], [D_RUNNER_SCREW, f.runnerScrews]];
+ for (const [def, l] of all) for (const x of l) b.preset(def, x);
+ }
+ b.wait(0.22);
+ }
+ });
+}
+
+/* ---------- mirror cabinet 120 x 98 ---------- */
+
+/*
+ * Mirror cabinet with 2 doors 120 x 98: four uprights (two sides, two dividers) and three fixed shelves, built lying
+ * on its back from the right side over to the left. Each shelf goes on with a dowel and a cam lock at the side, and a
+ * long dowel and a double cam bolt through each divider into the next shelf. A narrow rail joins the tops of the sides
+ * at the front, the bottom goes on with dowels and eight long screws, then it is turned over: the three back panels
+ * slide down their grooves and the top goes on with dowels and eleven screws. Clips hold the backs to the shelves, the
+ * hanging brackets go in, it hangs on four wall plates over four spacers, and the doors click onto their hinges.
+ */
+function mirror120(): CustomParams {
+ const r = new Recipe();
+ const W0 = 1170, bodyH = 950, crownH = 30, t = 18;
+ const zb = -80, zf = 50; // the carcass; doors in front of it, the top over both
+ const xs = W0 / 2 - t / 2, xi = W0 / 2 - t; // side centres, inner faces
+ const xd = 139, xdo = xd + t / 2, xdi = xd - t / 2; // divider centre, its outer and inner faces
+ const railH = 50, railT = 18;
+ const zdf = zf - railT; // dividers and shelves stop behind the top rail
+ const upH = bodyH - t, upY = t + upH / 2;
+ const fixY = t + 180 + t / 2; // the fixed shelves, over the open niche at the bottom
+ const dc = (zb + zdf) / 2;
+ r.part("sL", "Side", [t, upH, zf - zb], [-xs, upY, (zb + zf) / 2]);
+ r.part("sR", "Side", [t, upH, zf - zb], [xs, upY, (zb + zf) / 2]);
+ r.part("dvL", "Divider", [t, upH, zdf - zb], [-xd, upY, dc]);
+ r.part("dvR", "Divider", [t, upH, zdf - zb], [xd, upY, dc]);
+ const doorW = xi - xdo, midW = 2 * xdi;
+ r.part("shL", "Shelf", [doorW, t, zdf - zb], [-(xi + xdo) / 2, fixY, dc]);
+ r.part("shM", "Middle shelf", [midW, t, zdf - zb], [0, fixY, dc]);
+ r.part("shR", "Shelf", [doorW, t, zdf - zb], [(xi + xdo) / 2, fixY, dc]);
+ r.part("rail", "Top rail", [2 * xi, railH, railT], [0, bodyH - railH / 2, zf - railT / 2]);
+ r.part("bot", "Bottom", [W0, t, zf - zb], [0, t / 2, (zb + zf) / 2]);
+ const backY0 = fixY + t / 2, backH = bodyH - backY0;
+ r.part("bkL", "Back panel", [doorW, backH, 4], [-(xi + xdo) / 2, backY0 + backH / 2, zb + 10], { material: "fiber" });
+ r.part("bkM", "Middle back panel", [midW, backH, 4], [0, backY0 + backH / 2, zb + 10], { material: "fiber" });
+ r.part("bkR", "Back panel", [doorW, backH, 4], [(xi + xdo) / 2, backY0 + backH / 2, zb + 10], { material: "fiber" });
+ r.part("top", "Top", [1200, crownH, 160], [0, bodyH + crownH / 2, 0]);
+ // mirror doors: a frame with the mirror set in it, from the outside edge over to the middle of the divider
+ const dW = W0 / 2 - xd - 4, dH = bodyH - 4 - (fixY - t / 2), dY = fixY - t / 2 + dH / 2, dX = xd + 2 + dW / 2;
+ const door = (id: string, g: number) =>
+ r.part(id, "Mirror door", [dW, dH, 20], [g * dX, dY, zf + 10], {
+ pieces: [
+ { shape: "box", size: [dW, dH, 18], pos: [0, 0, -1], material: "board" },
+ { shape: "box", size: [dW - 110, dH - 110, 4], pos: [0, 0, 8], material: "glass" },
+ ],
+ });
+ door("dL", -1);
+ door("dR", 1);
+ const gY = [420, 600, 780], mY = [450, 700];
+ gY.forEach((y, i) => r.part(`gL${i}`, "Glass shelf", [doorW - 4, 6, 100], [-(xi + xdo) / 2, y, dc + 5], { material: "glass" }));
+ gY.forEach((y, i) => r.part(`gR${i}`, "Glass shelf", [doorW - 4, 6, 100], [(xi + xdo) / 2, y, dc + 5], { material: "glass" }));
+ mY.forEach((y, i) => r.part(`m${i}`, "Shelf", [midW - 4, 16, 100], [0, y, dc + 5]));
+
+ const PLATE: Fit = { kind: "hinge", len: 50, dia: 20, name: "Hinge plate" };
+ const HINGE: Fit = { kind: "hinge", len: 100, dia: 35 };
+ const ROD: Fit = { kind: "connector", len: 70, dia: 8, name: "Double cam bolt" };
+ const hingeY = [fixY + 100, bodyH - 110];
+ const zc = -40, zd = 0; // the cam bolts and the dowels along each shelf end
+ const railZ = zf - railT / 2, railY = bodyH - railH / 2;
+
+ r.step({ title: "Screw the hinge plates onto the sides", detail: "Lay the four uprights on a rug. Two plates on each side, at the front edge.", add: ["sR"], wait: ["sL"], fix: [at(PLATE, "sL", [-1, 0, 0], hingeY.map((y): Vec3 => [-xi, y, zf - 30])), at(PLATE, "sR", [1, 0, 0], hingeY.map((y): Vec3 => [xi, y, zf - 30]))], tools: ["screwdriver"], pose: "+z", warnings: ["floor"] });
+ r.step({ title: "Screw the cam bolts into the sides", detail: "One at the shelf and one at the top of each side, by hand until they stop.", fix: [at(CAM_BOLT, "sL", [-1, 0, 0], [[-xi, fixY, zc], [-xi, railY + 12, railZ]]), at(CAM_BOLT, "sR", [1, 0, 0], [[xi, fixY, zc], [xi, railY + 12, railZ]])], tools: ["screwdriver"], pose: "+z" });
+ r.step({ title: "Fit a shelf to the right side", detail: "Stand the right side on its edge. Tap a dowel into the shelf end, push it on and lock the cam.", add: ["shR"], fix: [at(DOWEL, "shR", [-1, 0, 0], [[xi, fixY, zd]], "sR"), at(CAM, "shR", [0, -1, 0], [[xi - 26, fixY + t / 2, zc]])], tools: ["hammer", "screwdriver"], from: { shR: [-300, 0, 0] } });
+ r.step({ title: "Fit a long dowel and a double cam bolt", detail: "Both go into the free end of the shelf; the cam lock holds the bolt. They reach through the divider into the next shelf.", fix: [at(LONG_DOWEL, "shR", [1, 0, 0], [[xdo, fixY, zd]], "shM"), at(ROD, "shR", [-1, 0, 0], [[xd, fixY, zc]]), at(CAM, "shR", [0, -1, 0], [[xdo + 26, fixY + t / 2, zc]])], tools: ["hammer", "screwdriver"] });
+ r.step({ title: "Slide a divider on", detail: "Over the long dowel and the bolt, grooved side to the back.", add: ["dvR"], from: { dvR: [-250, 0, 0] } });
+ r.step({ title: "Push the middle shelf on", detail: "The short shelf. Lock the cam onto the bolt.", add: ["shM"], fix: [at(CAM, "shM", [0, -1, 0], [[xdi - 26, fixY + t / 2, zc]])], tools: ["screwdriver"], from: { shM: [-250, 0, 0] } });
+ r.step({ title: "Fit the second long dowel and double cam bolt", detail: "Into the free end of the middle shelf, the cam lock holds the bolt.", fix: [at(LONG_DOWEL, "shM", [1, 0, 0], [[-xdi, fixY, zd]], "shL"), at(ROD, "shM", [-1, 0, 0], [[-xd, fixY, zc]]), at(CAM, "shM", [0, -1, 0], [[-xdi + 26, fixY + t / 2, zc]])], tools: ["hammer", "screwdriver"] });
+ r.step({ title: "Slide the other divider on", add: ["dvL"], from: { dvL: [-250, 0, 0] } });
+ r.step({ title: "Push the last shelf on", detail: "Lock the cam onto the bolt, then tap a dowel into its free end.", add: ["shL"], fix: [at(CAM, "shL", [0, -1, 0], [[-xdo - 26, fixY + t / 2, zc]]), at(DOWEL, "shL", [1, 0, 0], [[-xi, fixY, zd]], "sL")], tools: ["hammer", "screwdriver"], from: { shL: [-300, 0, 0] } });
+ r.step({ title: "Lay the top rail in", detail: "Tap a dowel into each end and push it onto the right side, across the top ends.", add: ["rail"], fix: [at(DOWEL, "rail", [1, 0, 0], [[-xi, railY - 12, railZ]], "sL"), at(DOWEL, "rail", [-1, 0, 0], [[xi, railY - 12, railZ]], "sR")], tools: ["hammer"], from: { rail: [-200, 0, 0] } });
+ r.step({ title: "Fit the left side", detail: "Push it onto the dowels and bolts and lock the cam in the shelf.", add: ["sL"], fix: [at(CAM, "shL", [0, -1, 0], [[-xi + 26, fixY + t / 2, zc]])], tools: ["screwdriver"] });
+ const ends: [string, number, number[]][] = [["sL", -xs, [-35, 5]], ["dvL", -xd, [-24]], ["dvR", xd, [-24]], ["sR", xs, [-35, 5]]];
+ const screwZ: [number, number[]][] = [[-xs, [-62, 32]], [-xd, [-62, 14]], [xd, [-62, 14]], [xs, [-62, 32]]];
+ r.step({ title: "Tap the dowels into the bottom ends", detail: "Two in each side, one in each divider.", fix: ends.map(([id, x, zs]) => at(DOWEL, id, [0, 1, 0], zs.map((z): Vec3 => [x, t, z]), "bot")), tools: ["hammer"] });
+ r.step({ title: "Screw the bottom on", detail: "Push it onto the dowels, then eight long screws, two into each upright, with the Allen key.", add: ["bot"], fix: [at(ALLEN_SCREW, "bot", [0, 1, 0], screwZ.flatMap(([x, zs]) => zs.map((z): Vec3 => [x, 0, z])))], tools: ["allen"] });
+ r.step({ title: "Turn it over and lock the rail", detail: "Lay it on its front. Lock the cam at each end of the top rail.", fix: [at(CAM, "rail", [0, 0, 1], [[-xi + 26, railY + 12, zf - railT], [xi - 26, railY + 12, zf - railT]])], tools: ["screwdriver"], pose: "-z" });
+ r.step({ title: "Slide in the back panels", detail: "Down the grooves from the top, the two wide ones first, then the narrow one in the middle.", add: ["bkL", "bkR", "bkM"], from: { bkL: [0, 500, 0], bkR: [0, 500, 0], bkM: [0, 500, 0] } });
+ r.step({ title: "Tap the dowels into the top ends", detail: "Two in each side, one in each divider.", fix: ends.map(([id, x, zs]) => at(DOWEL, id, [0, -1, 0], zs.map((z): Vec3 => [x, bodyH, z]), "top")), tools: ["hammer"] });
+ r.step({ title: "Push the top on", detail: "Two people. Its back edge lines up with the back of the cabinet.", add: ["top"], people: 2 });
+ r.step({ title: "Screw the top on", detail: "Eleven long screws: two into each upright and three into the rail.", fix: [at(ALLEN_SCREW, "top", [0, -1, 0], [...screwZ.flatMap(([x, zs]) => zs.map((z): Vec3 => [x, bodyH + crownH, z])), ...[-380, 0, 380].map((x): Vec3 => [x, bodyH + crownH, railZ])])], tools: ["allen"] });
+ r.step({ title: "Clip the backs to the shelves", detail: "Two clips on each shelf, a small screw in each.", fix: [at({ kind: "clip", len: 12, dia: 20 }, undefined, [0, -1, 0], [-1, 0, 1].flatMap((g) => (g ? [-110, 110] : [-60, 60]).map((dx): Vec3 => [g * ((xi + xdo) / 2) + dx, fixY + t / 2, zb + 14]))), at({ kind: "screw", len: 12, dia: 3.5 }, undefined, [0, -1, 0], [-1, 0, 1].flatMap((g) => (g ? [-110, 110] : [-60, 60]).map((dx): Vec3 => [g * ((xi + xdo) / 2) + dx, fixY + t / 2 + 2, zb + 20])))], tools: ["screwdriver"] });
+ const bk: [number, number][] = [[-xi, -1], [-xdo, 1], [xdo, -1], [xi, 1]];
+ const BRACKET: Fit = { kind: "angle", len: 60, dia: 45, name: "Hanging bracket" };
+ const bracketScrews = (g: number) => at({ kind: "screw", len: 11, dia: 5 }, undefined, [g, 0, 0], bk.filter((q) => q[1] === g).flatMap(([x]): Vec3[] => [[x, bodyH - 60, zb + 22], [x, bodyH - 100, zb + 22]]));
+ r.step({ title: "Screw in the hanging brackets", detail: "Stand it up. One at the top of each door opening, two screws each.", fix: [at(BRACKET, undefined, [-1, 0, 0], bk.filter((q) => q[1] < 0).map(([x]): Vec3 => [x, bodyH - 80, zb + 30])), at(BRACKET, undefined, [1, 0, 0], bk.filter((q) => q[1] > 0).map(([x]): Vec3 => [x, bodyH - 80, zb + 30])), bracketScrews(-1), bracketScrews(1)], tools: ["screwdriver"], pose: "+y" });
+ r.step({
+ title: "Fix the wall plates and spacers",
+ detail: "Mark the brackets on the wall and hang the plates level. The four spacers go behind the bottom. Use plugs and screws made for your wall (not included).",
+ fix: [
+ at({ kind: "bracket", len: 40, dia: 30, name: "Wall plate" }, undefined, [0, 0, -1], bk.map(([x]): Vec3 => [x - Math.sign(x) * 15, bodyH - 80, zb - 4])),
+ at({ kind: "glide", len: 20, dia: 30, name: "Spacer" }, undefined, [0, 0, -1], [-xs, -xd, xd, xs].map((x): Vec3 => [x, 90, zb - 2])),
+ at(WALL_PLUG, undefined, [0, 0, -1], [...bk.map(([x]): Vec3 => [x - Math.sign(x) * 15, bodyH - 80, zb - 22]), ...[-xs, -xd, xd, xs].map((x): Vec3 => [x, 90, zb - 22])]),
+ at(WALL_SCREW, undefined, [0, 0, -1], [...bk.map(([x]): Vec3 => [x - Math.sign(x) * 15, bodyH - 80, zb + 2]), ...[-xs, -xd, xd, xs].map((x): Vec3 => [x, 90, zb + 20])]),
+ ],
+ wall: true,
+ tools: ["drill", "level", "pencil", "screwdriver"],
+ });
+ r.step({ title: "Hang it and set it straight", detail: "Lift it onto the wall plates, then turn the screw in each bracket until it hangs level and tight to the wall.", tools: ["screwdriver", "level"], wall: true });
+ r.step({ title: "Stick on the door bumpers", detail: "One under the top rail on each side, where the doors close.", fix: [at({ kind: "glide", len: 3, dia: 10, name: "Bumper" }, "rail", [0, 0, -1], [[-xdo - 40, railY, zf], [xdo + 40, railY, zf]])] });
+ r.step({ title: "Screw the hinges onto the doors", detail: "Lay the doors face down on a rug. Two hinges in the cups of each.", wait: ["dL", "dR"], fix: [at(HINGE, "dL", [0, 0, 1], hingeY.map((y): Vec3 => [-W0 / 2 + 2 + 25, y, zf])), at(HINGE, "dR", [0, 0, 1], hingeY.map((y): Vec3 => [W0 / 2 - 2 - 25, y, zf]))], tools: ["screwdriver"] });
+ r.step({ title: "Click the doors on", detail: "Slide each hinge onto its plate until it clicks.", add: ["dL", "dR"], from: { dL: [0, 0, 250], dR: [0, 0, 250] } });
+ const pins = (x: number, g: number, ys: number[]) => ys.flatMap((y) => [-50, 12].map((z): Vec3 => [x, y - 6, z])).map((p) => ({ p, g }));
+ const pinPts = [...pins(-xi, -1, gY), ...pins(-xdo, 1, gY), ...pins(-xdi, -1, mY.map((y) => y - 5)), ...pins(xdi, 1, mY.map((y) => y - 5)), ...pins(xdo, -1, gY), ...pins(xi, 1, gY)];
+ r.step({ title: "Push in the shelf pins", detail: "Four for each shelf, all at the same height.", fix: [at({ kind: "pin", len: 10, dia: 5 }, undefined, [-1, 0, 0], pinPts.filter((q) => q.g < 0).map((q) => q.p)), at({ kind: "pin", len: 10, dia: 5 }, undefined, [1, 0, 0], pinPts.filter((q) => q.g > 0).map((q) => q.p))] });
+ r.step({ title: "Lay in the middle shelves", add: ["m0", "m1"] });
+ r.step({ title: "Lay in the glass shelves", detail: "Three behind each door. Set the glass down gently.", add: [...gY.map((_, i) => `gL${i}`), ...gY.map((_, i) => `gR${i}`)] });
+ const faces: [number, number][] = [[-xi, -1], [-xdo, 1], [-xdi, -1], [xdi, 1], [xdo, -1], [xi, 1]];
+ const caps = faces.flatMap(([x, g]) => [270, 360, 540, 700, 880].flatMap((y) => [-50, 12].map((z) => ({ p: [x, y, z] as Vec3, g })))).slice(0, 52);
+ r.step({ title: "Cap the empty holes", detail: "Press a cap into every shelf hole you aren't using.", fix: [-1, 1].map((g) => at({ kind: "cap", len: 5, dia: 5, name: "Hole cap" }, undefined, [g, 0, 0], caps.filter((c) => c.g === g).map((c) => c.p))) });
+ r.step({ title: "Snap the covers onto the brackets", fix: [at({ kind: "cap", len: 30, dia: 30, name: "Bracket cover" }, undefined, [0, 0, -1], bk.map(([x, g]): Vec3 => [x + g * 10, bodyH - 80, zb + 50]))] });
+ return r.get();
+}
+
+
+/* ---------- sideboard 157 x 88 ---------- */
+
+/*
+ * Sideboard 157 x 88: the three drawers are built first, on their fronts. The drawer section is two dividers with the
+ * cabinet runners on them, joined at the back by two rails. Each side is a ready-made frame of two legs and a panel;
+ * they take the hinge plates and cam bolts lying down. With it lying on its back: the bottom and its front rail, the
+ * right side, the back rail, the drawer section onto the bottom (four long screws from below), the left side and the
+ * middle foot. Standing, the top goes on dowels and twelve cam locks; on its front the back panel slides in and is
+ * screwed, and the two front feet go under the dividers. Two brackets hold it to the wall, then shelves, doors, knobs
+ * and drawers.
+ */
+function sideboard(b: PlanBuilder): void {
+ const H = 880, topT = 30, bodyH = H - topT; // 850
+ const xF = 740, xFi = 715, xFr = 720; // side frame centre, leg inner face, rail inner face
+ const t = 18, zf = 220, zb = -220;
+ const xd = 209, xdi = xd - t / 2, xdo = xd + t / 2; // dividers
+ const yB = 140, yBt = yB + t; // bottom board, its top face
+ const zBf = 200, zBb = -200; // bottom front and back edges
+ const zDv0 = -194; // the dividers' back edge, in front of the back panel
+ const dc = (zDv0 + zBf) / 2;
+
+ // drawers first: they are built before the cabinet
+ const dh = (bodyH - yBt) / 3;
+ const made = makeDrawers(b, range(3).map((i): DrawerBox => ({ x: 0, y0: yBt + i * dh, w: 2 * xdi, h: dh, zf, zBack: -170, knobs: 1 })));
+ frontDrawers(b, made, { dowels: true, runnerScrews: true });
+
+ const r = new Recipe();
+ const frame = (g: number): CustomPart["pieces"] => [
+ { shape: "box", size: [50, bodyH, 50], pos: [0, bodyH / 2, 195], material: "wood" },
+ { shape: "box", size: [50, bodyH, 50], pos: [0, bodyH / 2, -195], material: "wood" },
+ { shape: "box", size: [40, 60, 340], pos: [g * 5, yB - 10, 0], material: "wood" },
+ { shape: "box", size: [40, 70, 340], pos: [g * 5, bodyH - 35, 0], material: "wood" },
+ { shape: "box", size: [16, bodyH - 70 - (yB + 20), 340], pos: [g * 10, (yB + 20 + bodyH - 70) / 2, 0], material: "board" },
+ ];
+ // side frames: pieces relative to a point on the floor at the frame's centre line
+ r.part("fL", "Side frame", [50, bodyH, 440], [-xF, 0, 0], { pieces: frame(1) });
+ r.part("fR", "Side frame", [50, bodyH, 440], [xF, 0, 0], { pieces: frame(-1) });
+ r.part("bot", "Bottom", [2 * xFi, t, zBf - zBb], [0, yB + t / 2, 0]);
+ r.part("rf", "Front rail", [2 * xFi, 60, 20], [0, yBt - 30, zf - 10], { material: "wood" });
+ r.part("rb", "Back rail", [2 * xFi, 60, 20], [0, yBt - 30, zb + 10], { material: "wood" });
+ r.part("dvL", "Divider", [t, bodyH - yBt, zBf - zDv0], [-xd, (yBt + bodyH) / 2, dc]);
+ r.part("dvR", "Divider", [t, bodyH - yBt, zBf - zDv0], [xd, (yBt + bodyH) / 2, dc]);
+ r.part("drB", "Drawer section rail", [2 * xdi, 60, t], [0, yBt + 30, zDv0 + t / 2], { material: "wood" });
+ r.part("drT", "Drawer section rail", [2 * xdi, 60, t], [0, bodyH - 30, zDv0 + t / 2], { material: "wood" });
+ r.part("ftM", "Middle foot", [50, yB, 50], [0, yB / 2, -175], { material: "wood" });
+ r.part("top", "Top", [1570, topT, 470], [0, bodyH + topT / 2, 0], { material: "wood" });
+ r.part("bk", "Back panel", [2 * xFi, bodyH - yBt, 4], [0, (yBt + bodyH) / 2, -198], { material: "fiber" });
+ r.part("ftL", "Front foot", [45, yB, 45], [-xd, yB / 2, 175], { material: "wood" });
+ r.part("ftR", "Front foot", [45, yB, 45], [xd, yB / 2, 175], { material: "wood" });
+ const dW = xFi - xdo - 4, doorX = (xFi + xdo) / 2, doorH = bodyH - yBt - 4;
+ const door = (id: string, g: number) =>
+ r.part(id, "Door", [dW, doorH, 20], [g * doorX, (yBt + bodyH) / 2, zf - 10], {
+ pieces: [
+ { shape: "box", size: [dW, doorH, 20], pos: [0, 0, 0], material: "board" },
+ { shape: "box", size: [dW - 120, doorH - 120, 4], pos: [0, 0, 9], material: "board" },
+ ],
+ });
+ door("dL", -1);
+ door("dR", 1);
+ r.part("shL", "Shelf", [dW - 4, t, 360], [-doorX, 500, -10]);
+ r.part("shR", "Shelf", [dW - 4, t, 360], [doorX, 500, -10]);
+
+ const L_SCREW: Fit = { kind: "screw", len: 70, dia: 6 };
+ const PLATE: Fit = { kind: "hinge", len: 50, dia: 20, name: "Hinge plate" };
+ const RUN: Fit = { kind: "runner", len: 380, dia: 30 };
+ const PIN: Fit = { kind: "pin", len: 16, dia: 5 };
+ const SCREW_S: Fit = { kind: "screw", len: 14, dia: 3.5 };
+ const yRun = range(3).map((i) => yBt + i * dh + 34);
+ const hingeY = [yBt + 120, bodyH - 120];
+ const zRail = zf - 10, zRailB = zb + 10, yRail = yBt - 30;
+ const away: Vec3 = [900, 0, 0];
+
+ // the drawer section, built beside the cabinet
+ r.step({ title: "Screw the runners onto the dividers", detail: "Lay both dividers on a rug, inside up. Three runners on each, three screws each.", add: ["dvL"], wait: ["dvR"], fix: [at(RUN, "dvL", [-1, 0, 0], yRun.map((y): Vec3 => [-xdi, y, dc])), at(RUN, "dvR", [1, 0, 0], yRun.map((y): Vec3 => [xdi, y, dc])), at(D_RUNNER_SCREW, "dvL", [-1, 0, 0], yRun.flatMap((y) => [dc - 150, dc, dc + 150].map((z): Vec3 => [-xdi, y, z]))), at(D_RUNNER_SCREW, "dvR", [1, 0, 0], yRun.flatMap((y) => [dc - 150, dc, dc + 150].map((z): Vec3 => [xdi, y, z])))], tools: ["screwdriver"], pose: "+x", from: { dvR: away } });
+ r.step({ title: "Screw the cam bolts into the right divider", detail: "Four, by hand, near the back edge.", fix: [at(CAM_BOLT, "dvR", [1, 0, 0], [[xdi, yBt + 18, zDv0 + 9], [xdi, yBt + 42, zDv0 + 9], [xdi, bodyH - 42, zDv0 + 9], [xdi, bodyH - 18, zDv0 + 9]])], tools: ["screwdriver"], pose: "+x" });
+ r.step({ title: "Stand the two rails in the left divider", detail: "Tap two dowels into the end of each rail and push it into the divider.", add: ["drB", "drT"], fix: [at(DOWEL, "drB", [1, 0, 0], [[-xdi, yBt + 30, zDv0 + 9]], "dvL"), at(DOWEL, "drT", [1, 0, 0], [[-xdi, bodyH - 30, zDv0 + 9]], "dvL"), at(DOWEL, "drB", [1, 0, 0], [[-xdi, yBt + 10, zDv0 + 9]], "dvL"), at(DOWEL, "drT", [1, 0, 0], [[-xdi, bodyH - 10, zDv0 + 9]], "dvL")], tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Lock the rails", detail: "One cam lock in each rail, at the left divider.", fix: [at(CAM, "drB", [0, 0, 1], [[-xdi + 26, yBt + 30, zDv0 + t]]), at(CAM, "drT", [0, 0, 1], [[-xdi + 26, bodyH - 30, zDv0 + t]])], tools: ["screwdriver"], pose: "+x" });
+ r.step({ title: "Put the right divider on", detail: "Lower it onto the bolts and lock the other two cams.", add: ["dvR"], fix: [at(CAM, "drB", [0, 0, 1], [[xdi - 26, yBt + 30, zDv0 + t]]), at(CAM, "drT", [0, 0, 1], [[xdi - 26, bodyH - 30, zDv0 + t]])], tools: ["screwdriver"], pose: "+x" });
+
+ // the side frames
+ const fBolts = (g: number, id: string) => at(CAM_BOLT, id, [g, 0, 0], [...[-120, 0, 120].map((z): Vec3 => [g * xFi, yB + t / 2, z]), [g * xFi, yRail + 10, zRail], [g * xFi, yRail + 10, zRailB]]);
+ r.step({ title: "Screw the hinge plates onto the side frames", detail: "Two on the inside of each front leg.", wait: ["fL", "fR"], fix: [at(PLATE, "fL", [-1, 0, 0], hingeY.map((y): Vec3 => [-xFi, y, 190])), at(PLATE, "fR", [1, 0, 0], hingeY.map((y): Vec3 => [xFi, y, 190]))], tools: ["screwdriver"], pose: "+z", from: { fL: [-900, 0, 0], fR: away } });
+ r.step({ title: "Screw the cam bolts into the side frames", detail: "Five in each, by hand until they stop.", fix: [fBolts(-1, "fL"), fBolts(1, "fR")], tools: ["screwdriver"], pose: "+z" });
+
+ // bottom and front rail
+ const bEnds = (g: number): CustomFix[] => [at(DOWEL, "bot", [-g, 0, 0], [-60, 60].map((z): Vec3 => [g * xFi, yB + t / 2, z]), g < 0 ? "fL" : "fR"), at(DOWEL, "rf", [-g, 0, 0], [[g * xFi, yRail - 15, zRail]], g < 0 ? "fL" : "fR")];
+ const railX = [-560, -190, 190, 560];
+ r.step({ title: "Screw the cam bolts into the bottom", detail: "Four along the front edge, by hand.", add: ["bot"], fix: [at(CAM_BOLT, "bot", [0, 0, -1], railX.map((x): Vec3 => [x, yB + t / 2, zBf]), "rf")], tools: ["screwdriver"], pose: "+z" });
+ r.step({ title: "Tap in the dowels", detail: "Ten: four along the front edge of the bottom, two in each end of it and one in each end of the front rail.", fix: [at(DOWEL, "bot", [0, 0, -1], railX.map((x): Vec3 => [x + 40, yB + t / 2, zBf]), "rf"), ...bEnds(-1), ...bEnds(1)], tools: ["hammer"], pose: "+z" });
+ r.step({ title: "Fit the front rail", detail: "Push it onto the front edge of the bottom and lock the four cam locks.", add: ["rf"], fix: [at(CAM, "rf", [0, -1, 0], railX.map((x): Vec3 => [x, yBt, zRail]))], tools: ["screwdriver"], pose: "+z", from: { rf: [0, 0, 250] } });
+ r.step({ title: "Push the right side frame on", detail: "It stands on its back edge. Push the bottom onto its dowels and bolts.", add: ["fR"], pose: "+z" });
+ r.step({ title: "Lock the cams on the right", detail: "Three in the bottom and one in the front rail.", fix: [at(CAM, "bot", [0, -1, 0], [-120, 0, 120].map((z): Vec3 => [xFi - 26, yBt, z])), at(CAM, "rf", [0, 0, -1], [[xFi - 26, yRail + 10, zf]])], tools: ["screwdriver"], pose: "+z" });
+ r.step({ title: "Slide the back rail in", detail: "A dowel in each end, push it into the right side and lock its cam.", add: ["rb"], fix: [at(DOWEL, "rb", [-1, 0, 0], [[xFi, yRail - 15, zRailB]], "fR"), at(DOWEL, "rb", [1, 0, 0], [[-xFi, yRail - 15, zRailB]], "fL"), at(CAM, "rb", [0, 0, 1], [[xFi - 26, yRail + 10, zb]])], tools: ["hammer", "screwdriver"], pose: "+z", from: { rb: [-300, 0, 0] } });
+ const dvBot = (x: number) => [dc - 120, dc + 120].map((z): Vec3 => [x, yBt, z]);
+ r.step({ title: "Set the drawer section on the bottom", detail: "Two dowels in the bottom end of each divider, then lower it onto the bottom, between the rails.", fix: [at(DOWEL, "dvL", [0, 1, 0], dvBot(-xd), "bot"), at(DOWEL, "dvR", [0, 1, 0], dvBot(xd), "bot")], tools: ["hammer"], pose: "+z" });
+ r.step({ title: "Screw the dividers to the bottom", detail: "Four long screws up through the bottom, two into each divider.", fix: [at(L_SCREW, "bot", [0, 1, 0], [-xd, xd].flatMap((x) => [dc - 60, dc + 60].map((z): Vec3 => [x, yB, z])))], tools: ["allen"], pose: "+z" });
+ r.step({ title: "Put the left side frame on", detail: "Onto the dowels and bolts of the bottom and both rails.", add: ["fL"], pose: "+z" });
+ r.step({ title: "Lock the cams on the left", detail: "Five of them, arrow towards the bolt.", fix: [at(CAM, "bot", [0, -1, 0], [-120, 0, 120].map((z): Vec3 => [-xFi + 26, yBt, z])), at(CAM, "rf", [0, 0, -1], [[-xFi + 26, yRail + 10, zf]]), at(CAM, "rb", [0, 0, 1], [[-xFi + 26, yRail + 10, zb]])], tools: ["screwdriver"], pose: "+z" });
+ r.step({ title: "Screw on the middle foot", detail: "One long screw down through the bottom into it, then stand the sideboard up.", add: ["ftM"], fix: [at(L_SCREW, "bot", [0, -1, 0], [[0, yBt, -175]])], tools: ["allen"], pose: "+z", from: { ftM: [0, -250, 0] } });
+
+ // the top
+ const uprights: [string, number][] = [["fL", -xF], ["dvL", -xd], ["dvR", xd], ["fR", xF]];
+ const topDowelZ = (_id: string) => [-150, -10, 130];
+ const topBoltZ = (id: string) => (id[0] === "f" ? [-80, 60, 150] : [-80, 60, 170]);
+ const camFace: Record<string, [number, number]> = { fL: [-xFr, -1], dvL: [-xdo, 1], dvR: [xdo, -1], fR: [xFr, 1] };
+ const topCams = uprights.map(([id]) => at(CAM, id, [camFace[id][1], 0, 0], topBoltZ(id).map((z): Vec3 => [camFace[id][0], bodyH - 26, z])));
+ r.step({ title: "Tap the dowels into the tops", detail: "Three in each side frame and three in each divider.", fix: uprights.map(([id, x]) => at(DOWEL, id, [0, -1, 0], topDowelZ(id).map((z): Vec3 => [x, bodyH, z]), "top")), tools: ["hammer"], pose: "+y" });
+ r.step({ title: "Screw the cam bolts into the top", detail: "Lay it upside down on a rug: twelve, six of each kind where the drawing shows.", wait: ["top"], fix: [at(CAM_BOLT, "top", [0, 1, 0], uprights.flatMap(([id, x]) => topBoltZ(id).map((z): Vec3 => [x, bodyH, z])), undefined)], tools: ["screwdriver"], pose: "+y", from: { top: [0, 500, 0] } });
+ r.step({ title: "Lower the top on", detail: "Two people. Then lock the twelve cams from inside.", add: ["top"], people: 2, fix: topCams, tools: ["screwdriver"], pose: "+y", from: { top: [0, 300, 0] } });
+ r.step({ title: "Screw the drawer section to the top", detail: "Four long screws up through the top rail of the drawer section.", fix: [at(L_SCREW, "drT", [0, 1, 0], [-150, -50, 50, 150].map((x): Vec3 => [x, bodyH - 60, zDv0 + 9]))], tools: ["allen"], pose: "+y" });
+
+ // the back and the front feet, lying on its front
+ r.step({ title: "Slide in the back panel", detail: "Lay it on its front. Mark the middle of each divider on the back first, then slide the panel down the grooves.", add: ["bk"], pose: "-z", from: { bk: [0, 600, 0] } });
+ r.step({ title: "Screw the back on", detail: "Eight screws along your marks, into the dividers and the drawer section rails.", fix: [at(SCREW_S, "bk", [0, 0, 1], [...[-xd, xd].flatMap((x) => [320, 650].map((y): Vec3 => [x, y, -200])), ...[-120, 120].flatMap((x) => [yBt + 30, bodyH - 30].map((y): Vec3 => [x, y, -200]))])], tools: ["screwdriver"], pose: "-z" });
+ r.step({ title: "Fit the two front feet", detail: "Two dowels in the top of each, push them on under the dividers and drive one screw down through the bottom into each. Then stand it up.", add: ["ftL", "ftR"], fix: [at(DOWEL, "ftL", [0, -1, 0], [[-xd, yB, 165], [-xd, yB, 185]].map((p): Vec3 => [p[0] - 10, p[1], p[2]]), "bot"), at(DOWEL, "ftR", [0, -1, 0], [[xd + 10, yB, 165], [xd + 10, yB, 185]], "bot"), at({ kind: "screw", len: 60, dia: 6 }, "bot", [0, -1, 0], [[-xd + 10, yBt, 175], [xd - 10, yBt, 175]])], tools: ["hammer", "allen"], pose: "-z", from: { ftL: [0, -250, 0], ftR: [0, -250, 0] } });
+
+ // wall, shelves, doors
+ const wallX = [-xd - 120, xd + 120];
+ r.step({
+ title: "Fix it to the wall",
+ detail: "Screw the two brackets under the back of the top, with a washer on each screw. Push it to the wall and fix the brackets with screws made for your wall (not included).",
+ fix: [
+ at({ kind: "bracket", len: 60, dia: 40, name: "Wall bracket" }, "top", [0, 1, 0], wallX.map((x): Vec3 => [x, bodyH, -215])),
+ at({ kind: "washer", len: 1.5, dia: 16 }, "top", [0, 1, 0], wallX.flatMap((x): Vec3[] => [[x, bodyH - 2, -205], [x + 12, bodyH - 30, zb - 2]])),
+ at(SCREW_S, "top", [0, 1, 0], wallX.map((x): Vec3 => [x, bodyH - 3, -205])),
+ at(WALL_PLUG, undefined, [0, 0, -1], wallX.map((x): Vec3 => [x + 12, bodyH - 30, zb - 22])),
+ at(WALL_SCREW, undefined, [0, 0, -1], wallX.map((x): Vec3 => [x + 12, bodyH - 30, zb + 6])),
+ ],
+ wall: true,
+ pose: "+y",
+ tools: ["drill", "pencil", "screwdriver"],
+ });
+ r.step({ title: "Push in the shelf pins and lay in the shelves", detail: "Four pins for each shelf, all at the same height.", add: ["shL", "shR"], fix: [at(PIN, undefined, [-1, 0, 0], [-xFi, xdo].flatMap((x) => [-160, 140].map((z): Vec3 => [x, 500 - t / 2 - 3, z]))), at(PIN, undefined, [1, 0, 0], [-xdo, xFi].flatMap((x) => [-160, 140].map((z): Vec3 => [x, 500 - t / 2 - 3, z])))] });
+ r.step({ title: "Screw the hinges onto the doors", detail: "Lay the doors face down. Two hinges in the cups of each, the two kinds as the drawing shows.", wait: ["dL", "dR"], fix: [at({ kind: "hinge", len: 100, dia: 35 }, "dL", [0, 0, 1], hingeY.map((y): Vec3 => [-xFi + 25, y, zf - 20])), at({ kind: "hinge", len: 100, dia: 35 }, "dR", [0, 0, 1], hingeY.map((y): Vec3 => [xFi - 25, y, zf - 20]))], tools: ["screwdriver"], from: { dL: [0, 0, 500], dR: [0, 0, 500] } });
+ r.step({ title: "Click the doors on", detail: "Hook each hinge over its plate and press until it clicks.", add: ["dL", "dR"], from: { dL: [0, 0, 250], dR: [0, 0, 250] } });
+ r.step({ title: "Screw on the door knobs and fit the stops", detail: "One knob on each door, near the drawers. The two stops go in the front edge of the bottom, where the doors close.", fix: [at(D_KNOB, "dL", [0, 0, -1], [[-xdo - 50, 504, zf]]), at(D_KNOB, "dR", [0, 0, -1], [[xdo + 50, 504, zf]]), at(D_KNOB_SCREW, "dL", [0, 0, 1], [[-xdo - 50, 504, zf - 23]]), at(D_KNOB_SCREW, "dR", [0, 0, 1], [[xdo + 50, 504, zf - 23]]), at({ kind: "glide", len: 8, dia: 8, name: "Door stop" }, "bot", [0, -1, 0], [[-doorX, yBt, zBf - 6], [doorX, yBt, zBf - 6]])], tools: ["screwdriver"] });
+ buildCustom(b, { ...spec(b), custom: r.get() });
+
+ drawersIn(b, made, { dowels: true }, "Slide the drawers in", "Set each drawer on its runners and push it in until it stops.");
+}
+
+/* ---------- shoe cabinets ---------- */
+
+/*
+ * Shoe cabinets with 2 and with 4 compartments (IKEA sells them outside Europe and the US; the manuals are read from
+ * IKEA's own). Each side is a ready-built frame of two legs and a panel. With the left side on a rug the front rails
+ * and the two back boards stand in it on dowels and cam bolts (the 4 compartment one has a divider in the middle that
+ * the rails of both columns meet), the right side goes on, then the top on dowels and cam locks, screwed from below.
+ * Two glides under the back legs, two screws into the wall. Each compartment is a front with a plastic shoe rack
+ * clicked together and screwed on; it hangs on two pivots and is held by two stop brackets. The 2 compartment one has
+ * a drawer at the top, built on its front.
+ */
+function shoeCabinet(b: PlanBuilder, s: ProductSpec): void {
+ const four = /4-compartments/.test(s.slug ?? "");
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const topT = 20, bodyH = H - topT, P = 45, legH = four ? 120 : 140;
+ const zf = D / 2 - 10, zb = -D / 2;
+ const xs = W / 2 - 10 - P / 2, xi = xs - P / 2;
+ const cols = four ? [-1, 1] : [0];
+ const xd = 9; // the divider's faces, on the 4 compartment one
+ const cw = four ? xi - xd : 2 * xi;
+ const cx = (c: number) => (c === 0 ? 0 : c * (xd + xi) / 2);
+ const botR = 50, midR = 30, topR = 30;
+ const drawerH = four ? 0 : 150;
+ const y0 = legH + botR, y1 = bodyH - topR - (four ? 0 : drawerH + midR);
+ const rowH = (y1 - y0 - midR) / 2;
+ const rows = [y0, y0 + rowH + midR]; // bottom of each compartment opening
+ const r = new Recipe();
+ const zr = zf - 10, zBk = zb + 8;
+ const sideFrame = (g: number): CustomPart["pieces"] => [
+ { shape: "box", size: [P, bodyH, P], pos: [0, bodyH / 2, zf - P / 2], material: "wood" },
+ { shape: "box", size: [P, bodyH, P], pos: [0, bodyH / 2, zb + P / 2], material: "wood" },
+ { shape: "box", size: [16, bodyH - legH, zf - zb - 2 * P], pos: [g * 4, (legH + bodyH) / 2, (zf + zb) / 2], material: "board" },
+ ];
+ r.part("sL", "Side", [P, bodyH, zf - zb], [-xs, 0, 0], { pieces: sideFrame(1) });
+ r.part("sR", "Side", [P, bodyH, zf - zb], [xs, 0, 0], { pieces: sideFrame(-1) });
+ type Rail = { id: string; c: number; y: number; h: number };
+ const rails: Rail[] = cols.flatMap((c) => {
+ const k = c < 0 ? "L" : c > 0 ? "R" : "";
+ const list: Rail[] = [
+ { id: `rb${k}`, c, y: legH + botR / 2, h: botR },
+ { id: `rm${k}`, c, y: y0 + rowH + midR / 2, h: midR },
+ { id: `rt${k}`, c, y: bodyH - topR / 2, h: topR },
+ ];
+ if (!four) list.push({ id: "rd", c, y: y1 + midR / 2, h: midR });
+ return list;
+ });
+ for (const q of rails) r.part(q.id, "Front rail", [cw, q.h, 20], [cx(q.c), q.y, zr], { material: "wood" });
+ r.part("bkB", "Back board", [2 * xi, 120, 16], [0, legH + 60, zBk]);
+ r.part("bkT", "Back board", [2 * xi, 120, 16], [0, bodyH - 60, zBk]);
+ if (four) r.part("dv", "Divider", [2 * xd, bodyH - legH, zr - 10 - (zBk + 8)], [0, (legH + bodyH) / 2, (zr - 10 + zBk + 8) / 2]);
+ r.part("top", "Top", [W, topT, D], [0, bodyH + topT / 2, 0], { material: "wood" });
+ const comps = cols.flatMap((c) => rows.map((y, i) => ({ c, y, id: `${c < 0 ? "L" : c > 0 ? "R" : "M"}${i}` })));
+ for (const q of comps) {
+ r.part(`cf${q.id}`, "Compartment front", [cw - 4, rowH - 4, 18], [cx(q.c), q.y + rowH / 2, zf - 9], {
+ pieces: [
+ { shape: "box", size: [cw - 4, rowH - 4, 18], pos: [0, 0, 0], material: "board" },
+ { shape: "box", size: [cw - 90, rowH - 90, 3], pos: [0, 0, 8], material: "board" },
+ ],
+ });
+ r.part(`cr${q.id}`, "Shoe rack", [cw - 30, rowH - 50, 130], [cx(q.c), q.y + rowH / 2, zf - 18 - 65], {
+ material: "fiber",
+ pieces: [
+ { shape: "box", size: [cw - 40, rowH - 70, 3], pos: [0, 0, 0], rot: [-0.45, 0, 0], material: "fiber" },
+ { shape: "box", size: [4, rowH - 50, 130], pos: [-(cw - 34) / 2, 0, 0], material: "fiber" },
+ { shape: "box", size: [4, rowH - 50, 130], pos: [(cw - 34) / 2, 0, 0], material: "fiber" },
+ ],
+ });
+ }
+
+ const LONG: Fit = { kind: "screw", len: 60, dia: 6 };
+ const LONG2: Fit = { kind: "screw", len: 80, dia: 6 };
+ const SMALL: Fit = { kind: "screw", len: 12, dia: 4 };
+ const PIVOT: Fit = { kind: "stud", len: 15, dia: 12, name: "Pivot" };
+ const STOP: Fit = { kind: "clip", len: 40, dia: 20, name: "Stop bracket" };
+ const side = (g: number) => (g < 0 ? "sL" : "sR");
+ // the faces each column's compartments hang between: [x, the way into the part, part]
+ const faces = (c: number): [number, number, string][] => (c === 0 ? [[-xi, -1, "sL"], [xi, 1, "sR"]] : c < 0 ? [[-xi, -1, "sL"], [-xd, 1, "dv"]] : [[xd, -1, "dv"], [xi, 1, "sR"]]);
+ const pivots = (pick: (id: string) => boolean): CustomFix[] =>
+ cols.flatMap((c) => faces(c).filter(([, , id]) => pick(id)).flatMap(([x, g, id]) => [
+ at(PIVOT, id, [g, 0, 0], rows.map((y): Vec3 => [x, y + 40, zf - 70])),
+ at(STOP, id, [g, 0, 0], rows.map((y): Vec3 => [x, y + rowH - 60, zf - 110])),
+ at(SMALL, id, [g, 0, 0], rows.flatMap((y): Vec3[] => [[x, y + 70, zf - 70], [x, y + rowH - 60, zf - 140], [x, y + rowH - 60, zf - 80]])),
+ ]));
+
+ // inside each side frame (shown on the frame, it comes as one piece in the drawing)
+ const internal = (g: number): CustomFix[] => {
+ const x = g * xs, id = side(g);
+ const yy = [legH + 80, bodyH - 80];
+ const out = [
+ at(CAM_BOLT, id, [0, 0, 1], yy.map((y): Vec3 => [x, y, zf - P])),
+ at(DOWEL, id, [0, 0, -1], yy.map((y): Vec3 => [x, y, zb + P])),
+ at(CAM, id, [-g, 0, 0], yy.map((y): Vec3 => [x - g * 8, y, zf - P - 26])),
+ ];
+ if (!four) out.push(at(LONG, id, [0, 0, -1], [legH + 200, (legH + bodyH) / 2, bodyH - 200, bodyH - 60].map((y): Vec3 => [x, y, zf])), at(LONG, id, [0, 0, 1], [legH + 200, (legH + bodyH) / 2, bodyH - 200].map((y): Vec3 => [x, y, zb])));
+ return out;
+ };
+ r.step({ title: "Put the side frames together", detail: four ? "Cam bolts, dowels and cam locks join each panel to its legs. Lay the left one on a rug." : "Cam bolts, dowels and cam locks join each panel to its legs, then the long screws through the legs. Lay the left one on a rug.", add: ["sL"], wait: ["sR"], fix: [...internal(-1), ...internal(1)], tools: four ? ["screwdriver", "hammer"] : ["screwdriver", "hammer", "allen"], pose: "+x", warnings: ["floor"], from: { sR: [700, 0, 0] } });
+ r.step({ title: "Fit the pivots and stop brackets", detail: "On the inside of each side: a pivot low at the front of each compartment, tapped in and screwed, and a stop bracket near the top.", fix: pivots((id) => id !== "dv"), tools: ["screwdriver", "hammer"], pose: "+x" });
+ const runY = y1 + midR + 20;
+ if (!four) r.step({ title: "Screw on the drawer runners", detail: "One on each side, at the top, with the small screws from the bag.", fix: [at({ kind: "runner", len: Math.round((zf - zb - 60) / 10) * 10, dia: 30 }, "sL", [-1, 0, 0], [[-xi, runY, (zf + zb) / 2]]), at({ kind: "runner", len: Math.round((zf - zb - 60) / 10) * 10, dia: 30 }, "sR", [1, 0, 0], [[xi, runY, (zf + zb) / 2]]), at(D_RUNNER_SCREW, "sL", [-1, 0, 0], [zb + 70, zf - 70].map((z): Vec3 => [-xi, runY, z])), at(D_RUNNER_SCREW, "sR", [1, 0, 0], [zb + 70, zf - 70].map((z): Vec3 => [xi, runY, z]))], tools: ["screwdriver"], pose: "+x" });
+
+ // joints between the sides (and divider) and the rails and back boards
+ const sideRails = (g: number) => [...rails.filter((q) => q.c === 0 || q.c === g), { id: "bkB", c: 0, y: legH + 60, h: 120 }, { id: "bkT", c: 0, y: bodyH - 60, h: 120 }];
+ const zOf = (id: string) => (id.startsWith("bk") ? zBk : zr);
+ const dowelsAt = (id: string) => (id.startsWith("bk") && !four ? 2 : 1);
+ const sideBolts = (g: number) => at(CAM_BOLT, side(g), [g, 0, 0], sideRails(g).map((q): Vec3 => [g * xi, q.y + (q.h > 60 ? -30 : 0), zOf(q.id)]));
+ const sideDowels = (g: number) => sideRails(g).map((q) => at(DOWEL, q.id, [-g, 0, 0], (dowelsAt(q.id) === 2 ? [q.y + 10, q.y + 40] : [q.y]).map((y): Vec3 => [g * xi, y, zOf(q.id) + (q.id.startsWith("bk") ? 0 : 0)]).map((p): Vec3 => (q.h > 60 ? p : [p[0], p[1], p[2] - 6])), side(g)));
+ const sideCams = (g: number) => sideRails(g).map((q) => at(CAM, q.id, q.id.startsWith("bk") ? [0, 0, 1] : [0, -1, 0], [[g * (xi - 26), q.id.startsWith("bk") ? q.y - 30 : q.y + q.h / 2, q.id.startsWith("bk") ? zBk + 8 : zr]]));
+ r.step({ title: "Screw the cam bolts into the sides", detail: `${sideRails(1).length} in each side, by hand until they stop.`, fix: [sideBolts(-1), sideBolts(1)], tools: ["screwdriver"], pose: "+x" });
+ const leftIds = sideRails(-1).map((q) => q.id);
+ r.step({ title: four ? "Stand the left rails and the back boards in" : "Stand the rails and the back boards in", detail: "Tap the dowels into the rail ends and push them into the left side.", add: leftIds, fix: sideDowels(-1), tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Lock the cam locks", detail: "Arrow towards the bolt, then a clockwise turn.", fix: sideCams(-1), tools: ["screwdriver"], pose: "+x" });
+ if (four) {
+ const mid = (c: number) => rails.filter((q) => q.c === c);
+ r.step({ title: "Fit the pivots and stops on the divider", detail: "Both faces, as on the sides.", wait: ["dv"], fix: pivots((id) => id === "dv"), tools: ["screwdriver", "hammer"], pose: "+x", from: { dv: [0, 0, 700] } });
+ r.step({
+ title: "Put the divider on",
+ detail: "Two cam bolts into it for the middle rails, dowels in the other rail ends, then push it onto the left rails and lock.",
+ add: ["dv"],
+ fix: [
+ at({ kind: "camScrew", len: 30, dia: 7, name: "Cam bolt, short" }, "dv", [-1, 0, 0], [[-xd, mid(-1)[1].y, zr]]),
+ at({ kind: "camScrew", len: 30, dia: 7, name: "Cam bolt, short" }, "dv", [1, 0, 0], [[xd, mid(1)[1].y, zr]]),
+ at(DOWEL, "rtL", [-1, 0, 0], [[-xd, mid(-1)[2].y, zr - 6]], "dv"),
+ at(DOWEL, "rmL", [-1, 0, 0], [[-xd, mid(-1)[1].y - 10, zr - 6]], "dv"),
+ at({ kind: "cam", len: 13, dia: 12, name: "Cam lock, small" }, "rmL", [0, -1, 0], [[-xd - 26, mid(-1)[1].y + midR / 2, zr]]),
+ ],
+ tools: ["hammer", "screwdriver"],
+ pose: "+x",
+ });
+ r.step({
+ title: "Stand the right rails in",
+ detail: "Onto the divider: dowels at the top, the bolt in the middle, then lock it.",
+ add: mid(1).map((q) => q.id),
+ fix: [at(DOWEL, "rtR", [1, 0, 0], [[xd, mid(1)[2].y, zr - 6]], "dv"), at(DOWEL, "rmR", [1, 0, 0], [[xd, mid(1)[1].y - 10, zr - 6]], "dv"), at({ kind: "cam", len: 13, dia: 12, name: "Cam lock, small" }, "rmR", [0, -1, 0], [[xd + 26, mid(1)[1].y + midR / 2, zr]])],
+ tools: ["hammer", "screwdriver"],
+ pose: "+x",
+ });
+ }
+ r.step({ title: "Lower the right side on", detail: "Dowels in the free rail ends, then press it on evenly.", add: ["sR"], fix: sideDowels(1), tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Lock the cam locks on this side", fix: sideCams(1), tools: ["screwdriver"], pose: "+x" });
+ if (four)
+ r.step({ title: "Screw the divider to the back boards", detail: "Long screws through the back boards into the divider, and one through the divider into each bottom rail.", fix: [at(LONG2, "bkT", [0, 0, 1], [[0, bodyH - 60, zb]]), at({ kind: "screw", len: 70, dia: 6 }, "bkB", [0, 0, 1], [[0, legH + 60, zb]]), at(LONG2, "dv", [-1, 0, 0], [[xd, legH + 8, zr]]), at(LONG2, "dv", [1, 0, 0], [[-xd, legH + botR - 8, zr]])], tools: ["allen"], pose: "+x" });
+
+ // the top
+ const topZ = [(zf + zb) / 2 - 40, (zf + zb) / 2 + 40];
+ r.step({ title: "Tap the dowels into the sides", detail: "Two in the top of each side.", fix: [-1, 1].map((g) => at(DOWEL, side(g), [0, -1, 0], topZ.map((z): Vec3 => [g * xs, bodyH, z]), "top")), tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Put the top on", detail: "Two cam bolts into the top by hand, push it onto the dowels and lock the two cams.", add: ["top"], fix: [at(CAM_BOLT, "top", [0, 1, 0], [-1, 1].map((g): Vec3 => [g * xs, bodyH, (zf + zb) / 2])), at(CAM, undefined, [0, 0, 1], [-1, 1].map((g): Vec3 => [g * xs, bodyH - 26, (zf + zb) / 2 - 30]))], tools: ["screwdriver"], pose: "+x" });
+ r.step({ title: "Screw the top down", detail: four ? "Four long screws up through the top rails." : "Two long screws up through the back board.", fix: four ? [at({ kind: "screw", len: 55, dia: 5 }, undefined, [0, 1, 0], cols.flatMap((c) => [-cw / 4, cw / 4].map((dx): Vec3 => [cx(c) + dx, bodyH - topR, zr])))] : [at({ kind: "screw", len: 140, dia: 6 }, "bkT", [0, 1, 0], [-xi / 2, xi / 2].map((x): Vec3 => [x, bodyH - 120, zBk]))], tools: ["allen"], pose: "+x" });
+ r.step({ title: "Tap in the glides", detail: "Under the two back legs.", fix: [at({ kind: "glide", len: 6, dia: 20 }, undefined, [0, 1, 0], [-1, 1].map((g): Vec3 => [g * xs, 0, zb + P / 2]))], tools: ["hammer"], pose: "+x" });
+ r.step({
+ title: "Fix it to the wall",
+ detail: "Stand it up against the wall. Two screws through the top back board, with plugs made for your wall (not included).",
+ fix: [at(WALL_PLUG, undefined, [0, 0, -1], [-1, 1].map((g): Vec3 => [g * (xi - 80), bodyH - 60, zb - 20])), at(WALL_SCREW, undefined, [0, 0, -1], [-1, 1].map((g): Vec3 => [g * (xi - 80), bodyH - 60, zBk + 8]))],
+ wall: true,
+ pose: "+y",
+ tools: ["drill", "pencil", "screwdriver"],
+ });
+ const ids = comps.map((q) => q.id);
+ const rackScrews = four ? 4 : 6;
+ r.step({
+ title: comps.length > 2 ? "Put the compartments together" : "Put the two compartments together",
+ detail: "Click the ends onto the shoe rack, lay it in the front and screw it on. No power drill: the plastic cracks.",
+ wait: [...ids.map((i) => `cf${i}`), ...ids.map((i) => `cr${i}`)],
+ fix: comps.map((q) => at({ kind: "screw", len: 16, dia: 4 }, `cf${q.id}`, [0, 0, 1], spread(-cw / 2 + 40, cw / 2 - 40, rackScrews / 2).flatMap((dx) => [q.y + 50, q.y + rowH - 50].map((y): Vec3 => [cx(q.c) + dx, y, zf - 21])))),
+ tools: ["screwdriver"],
+ from: Object.fromEntries(ids.flatMap((i) => [[`cf${i}`, [0, 0, 600] as Vec3], [`cr${i}`, [0, 0, 600] as Vec3]])),
+ });
+ r.step({ title: "Hang the compartments", detail: "Tilt each one in, hook it over its pivots and swing it up past the stop brackets.", add: ids.flatMap((i) => [`cf${i}`, `cr${i}`]), from: Object.fromEntries(ids.flatMap((i) => [[`cf${i}`, [0, 0, 300] as Vec3], [`cr${i}`, [0, 0, 300] as Vec3]])) });
+ const knobX = four ? [0] : [-cw * 0.25, cw * 0.25];
+ r.step({ title: "Screw on the knobs", detail: four ? "One on each compartment, the screw from behind." : "Two on each compartment, the screws from behind.", fix: comps.flatMap((q) => [at(D_KNOB, `cf${q.id}`, [0, 0, -1], knobX.map((dx): Vec3 => [cx(q.c) + dx, q.y + rowH - 60, zf])), at(D_KNOB_SCREW, `cf${q.id}`, [0, 0, 1], knobX.map((dx): Vec3 => [cx(q.c) + dx, q.y + rowH - 60, zf - 41]))]), tools: ["screwdriver"] });
+ // the drawer of the 2 compartment one comes last
+ const made = four ? [] : makeDrawers(b, [{ x: 0, y0: y1 + midR, w: 2 * xi, h: drawerH, zf, zBack: zBk + 30, knobs: 2 }]);
+ buildCustom(b, { ...s, custom: r.get() });
+ if (made.length) {
+ frontDrawers(b, made, { dowels: false, runnerScrews: true });
+ drawersIn(b, made, { dowels: false }, "Slide the drawer in", "Set it on the runners and push it in until it clicks.");
+ }
+}
+
+/* ---------- bathroom vanity with drawers 122 ---------- */
+
+/*
+ * Bathroom vanity with drawers 122 x 82: three ladders (left, middle, right), each two posts and two side rails on
+ * dowels with long screws, a panel in the grooves, the hanging brackets and the runners screwed on lying down. The
+ * middle one is built the same way with cam locks and sits aside. With the left side on a rug the five rails of the left
+ * column stand in it; the middle ladder goes on over long dowels and double cam bolts, the five rails of the right
+ * column stand on those bolts, then the right side. Three adjustable feet under the front posts, six wall plates (screws
+ * not included), then four drawers built on their backs click onto the runners. The basin is sold on its own.
+ */
+function vanity122(b: PlanBuilder, s: ProductSpec): void {
+ const W = s.size.w * 10, D = s.size.d * 10, H = s.size.h * 10;
+ const r = new Recipe();
+ const P = 45;
+ const xo = W / 2, xp = xo - P / 2, xi = xo - P;
+ const zf = D / 2, zb = -D / 2;
+ const zpf = zf - P / 2, zpb = zb + P / 2, zm = (zpf + zpb) / 2;
+ const legH = 110, botRail = 50, topRail = 70, midRail = 45;
+ const sideD = zpf - zpb - P;
+ const ladders = ["L", "M", "R"];
+ const gx = (L: string) => (L === "L" ? -1 : L === "R" ? 1 : 0);
+ const panelX = (L: string) => (L === "M" ? 0 : gx(L) * (xo - 14));
+ for (const L of ladders) {
+ const x = gx(L) * xp;
+ r.part(`pf${L}`, "Post", [P, H, P], [x, H / 2, zpf], { material: "wood" });
+ r.part(`pb${L}`, "Post", [P, H, P], [x, H / 2, zpb], { material: "wood" });
+ r.part(`st${L}`, "Side rail", [P - 10, 70, sideD], [x + gx(L) * 5, H - 35, zm], { material: "wood" });
+ r.part(`sb${L}`, "Side rail", [P - 10, 70, sideD], [x + gx(L) * 5, legH + 35, zm], { material: "wood" });
+ r.part(`sp${L}`, L === "M" ? "Middle panel" : "Side panel", [L === "M" ? 16 : 12, H - legH - 140, sideD + 16], [panelX(L), legH + 70 + (H - legH - 140) / 2, zm]);
+ }
+ const xmi = P / 2; // the middle posts' faces
+ const cw = xi - xmi, ccx = (xi + xmi) / 2;
+ const avail = H - topRail - midRail - botRail - legH;
+ const h1 = Math.round(avail * 0.42), h2 = avail - h1;
+ const zr = zf - 10;
+ const railDefs = [
+ { k: "rt", name: "Front rail", h: topRail, y: H - topRail / 2, z: zr, t: 20, n: 1, post: "pf", o: 15 },
+ { k: "rm", name: "Front rail", h: midRail, y: H - topRail - h1 - midRail / 2, z: zr, t: 20, n: 1, post: "pf", o: 12 },
+ { k: "rb", name: "Front rail", h: botRail, y: legH + botRail / 2, z: zr, t: 20, n: 1, post: "pf", o: 12 },
+ { k: "bt", name: "Back rail", h: 90, y: H - 45, z: zb + 9, t: 18, n: 1, post: "pb", o: 20 },
+ { k: "bb", name: "Back board", h: 160, y: legH + 80, z: zb + 8, t: 16, n: 2, post: "pb", o: 45 },
+ ];
+ for (const c of [-1, 1]) for (const q of railDefs) r.part(`${q.k}${c < 0 ? "L" : "R"}`, q.name, [cw, q.h, q.t], [c * ccx, q.y, q.z], { material: q.k === "bb" ? "board" : "wood" });
+
+ const ladder = (L: string) => [`pf${L}`, `pb${L}`, `st${L}`, `sb${L}`, `sp${L}`];
+ const sx = (L: string) => gx(L) * xp + gx(L) * 5;
+ const railDowels = (L: string) => [
+ at(D_DOWEL, `st${L}`, [0, 0, -1], [[sx(L), H - 35, zpf - P / 2]], `pf${L}`),
+ at(D_DOWEL, `st${L}`, [0, 0, 1], [[sx(L), H - 35, zpb + P / 2]], `pb${L}`),
+ at(D_DOWEL, `sb${L}`, [0, 0, -1], [[sx(L), legH + 35, zpf - P / 2]], `pf${L}`),
+ at(D_DOWEL, `sb${L}`, [0, 0, 1], [[sx(L), legH + 35, zpb + P / 2]], `pb${L}`),
+ ];
+ const TOP_SCREW: Fit = { kind: "screw", len: 60, dia: 6 };
+ const longScrews = (L: string) => [at(TOP_SCREW, `pf${L}`, [0, 0, -1], [[sx(L), H - 35, zpf + P / 2]], `st${L}`), at(TOP_SCREW, `pf${L}`, [0, 0, -1], [[sx(L), legH + 35, zpf + P / 2]], `sb${L}`)];
+ const yDr = [H - topRail - h1, legH + botRail];
+ const runLen = Math.round((sideD - 20) / 10) * 10;
+ const hangY = [H - 130, legH + 200];
+ const RUN: Fit = { kind: "runner", len: runLen, dia: 30 };
+ // faces each runner and bracket screws onto: [x, the way in]
+ const facesOf = (L: string): [number, number][] => (L === "M" ? [[-8, 1], [8, -1]] : [[gx(L) * (xo - 20), gx(L)]]);
+ const bracketFaces = (L: string): [number, number][] => (L === "M" ? [[-xmi, 1]] : [[gx(L) * xi, gx(L)]]);
+ const hangers = (L: string) => bracketFaces(L).flatMap(([x, g]) => [
+ at({ kind: "angle", len: 70, dia: 50, name: "Hanging bracket" }, `pb${L}`, [g, 0, 0], hangY.map((y): Vec3 => [x, y, zpb])),
+ at(D_RUNNER_SCREW, `pb${L}`, [g, 0, 0], hangY.flatMap((y): Vec3[] => [[x, y - 24, zpb], [x, y + 24, zpb]])),
+ ]);
+ const runners = (L: string) => facesOf(L).flatMap(([x, g]) => [
+ at(RUN, `sp${L}`, [g, 0, 0], yDr.map((y): Vec3 => [x, y + 12, zm])),
+ at(D_RUNNER_SCREW, `sp${L}`, [g, 0, 0], yDr.flatMap((y): Vec3[] => [[x, y + 12, zm + runLen / 2 - 40], [x, y + 12, zm - runLen / 2 + 40]])),
+ ]);
+ const ends = (q: (typeof railDefs)[number]) => (q.n === 2 ? [q.y - q.o, q.y + q.o] : [q.y - q.o]);
+ const camBolts = (L: string) => railDefs.map((q) => at(CAM_BOLT, `${q.post}${L}`, [gx(L), 0, 0], ends(q).map((y): Vec3 => [gx(L) * xi, y, q.z]), `${q.k}${L}`));
+ const dowelsIn = (L: string) => railDefs.map((q) => at(D_DOWEL, `${q.k}${L}`, [-gx(L), 0, 0], [[gx(L) * xi, q.n === 2 ? q.y : q.y + q.o, q.z]], `${q.post}${L}`));
+ // cam locks: at the outside end of a rail (g = -1 left, 1 right) or at its middle end (x = the middle post face)
+ const camsAt = (c: string, xEnd: number, inward: number) =>
+ railDefs.map((q) => at(CAM, `${q.k}${c}`, q.n === 2 || q.k === "bt" ? [0, 0, -1] : [0, -1, 0], ends(q).map((y): Vec3 => [xEnd + inward * 26, q.n === 2 || q.k === "bt" ? y : q.y + q.h / 2, q.n === 2 ? q.z + 8 : q.k === "bt" ? q.z + 9 : q.z])));
+ const ROD: Fit = { kind: "connector", len: 80, dia: 8, name: "Double cam bolt" };
+ const LONG_D: Fit = { kind: "dowel", len: 70, dia: 8 };
+
+ r.step({
+ title: "Join the side rails to the posts",
+ detail: "Do both sides on a rug. Tap the dowels into the rails, push them into the front post, slide the panel into the grooves, then push the back post on and drive the two long screws.",
+ add: ladder("L"),
+ fix: [...railDowels("L"), ...longScrews("L")],
+ from: { pfL: [0, 0, 260], stL: [0, 0, -260], sbL: [0, 0, -260], spL: [0, 0, -320], pbL: [0, 0, -380] },
+ tools: ["hammer", "allen"],
+ pose: "+x",
+ repeat: 2,
+ warnings: ["floor"],
+ });
+ r.step({ title: "Screw the hanging brackets to the back posts", detail: "Two on each side, on the inside.", fix: hangers("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
+ r.step({ title: "Screw the runners onto the sides", detail: "Two on each side, the ones marked for that side, two screws in each.", fix: runners("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
+ r.step({ title: "Screw in the cam bolts", detail: "Six in each side, into the inside faces of the posts, by hand.", fix: camBolts("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
+ // the middle ladder, built beside the left side
+ const midAway: Vec3 = [800, 0, 0];
+ const midBolts = [at(CAM_BOLT, "pfM", [0, 0, 1], [[0, H - 50, zpf - P / 2], [0, legH + 50, zpf - P / 2]], "stM"), at(CAM_BOLT, "pbM", [0, 0, -1], [[0, H - 50, zpb + P / 2], [0, legH + 50, zpb + P / 2]], "stM"), at(CAM_BOLT, "pfM", [0, 0, 1], [[0, (H + legH) / 2, zpf - P / 2]]), at(CAM_BOLT, "pbM", [0, 0, -1], [[0, (H + legH) / 2, zpb + P / 2]])];
+ r.step({ title: "Build the middle ladder", detail: "On the rug beside it: cam bolts into the posts, dowels into the rails, push them together and slide the panel in.", wait: ladder("M"), fix: [...midBolts, ...railDowels("M").map((f) => ({ ...f, at: f.at!.map((p): Vec3 => [0, p[1] + 20, p[2]]) }))], tools: ["screwdriver", "hammer"], pose: "+x", from: Object.fromEntries(ladder("M").map((id) => [id, midAway])) });
+ r.step({ title: "Lock the middle ladder", detail: "Six cam locks, then the runners on both faces, the brackets and the two long screws.", fix: [at(CAM, "stM", [1, 0, 0], [[0, H - 50, zpf - P - 26], [0, H - 50, zpb + P + 26], [0, legH + 50, zpf - P - 26], [0, legH + 50, zpb + P + 26]].map((p): Vec3 => [-((P - 10) / 2), p[1], p[2]])), at(CAM, "spM", [1, 0, 0], [[-8, (H + legH) / 2, zpf - P - 26], [-8, (H + legH) / 2, zpb + P + 26]]), ...runners("M"), ...hangers("M"), ...longScrews("M").map((f) => ({ ...f, at: f.at!.map((p): Vec3 => [0, p[1], p[2]]) }))], tools: ["screwdriver", "allen"], pose: "+x" });
+ r.step({ title: "Stand the left rails in", detail: "It stays on the rug. A dowel in each rail end, then push them into the left side: three at the front, the rail and the board at the back.", add: railDefs.map((q) => `${q.k}L`), fix: dowelsIn("L"), tools: ["hammer"], pose: "+x" });
+ r.step({ title: "Lock the cam locks", detail: "Six of them. Arrow towards the bolt, then a clockwise turn.", fix: camsAt("L", -xi, 1), tools: ["screwdriver"], pose: "+x" });
+ r.step({
+ title: "Lower the middle ladder on",
+ detail: "A long dowel and a double cam bolt in the top end of each rail, lock the bolts, then press the middle ladder down over them.",
+ add: ladder("M"),
+ fix: [
+ ...railDefs.map((q) => at(LONG_D, `${q.k}L`, [-1, 0, 0], [[-xmi, q.n === 2 ? q.y : q.y + q.o, q.z]], `pb${"M"}`.replace("pb", q.post))),
+ at(ROD, undefined, [-1, 0, 0], railDefs.flatMap((q) => ends(q).map((y): Vec3 => [0, y, q.z]))),
+ ...camsAt("L", -xmi, -1),
+ ],
+ tools: ["hammer", "screwdriver"],
+ pose: "+x",
+ });
+ r.step({ title: "Stand the right rails in", detail: "Onto the bolts sticking out of the middle ladder.", add: railDefs.map((q) => `${q.k}R`), fix: camsAt("R", xmi, 1), tools: ["screwdriver"], pose: "+x", from: Object.fromEntries(railDefs.map((q) => [`${q.k}R`, [400, 0, 0] as Vec3])) });
+ r.step({
+ title: "Lower the right side on",
+ detail: "It has its rails, brackets, runners and bolts like the left one. Dowels in the free rail ends, then press it on evenly.",
+ add: ladder("R"),
+ fix: [...railDowels("R"), ...longScrews("R"), ...hangers("R"), ...runners("R"), ...camBolts("R"), ...dowelsIn("R")],
+ tools: ["hammer"],
+ pose: "+x",
+ });
+ r.step({ title: "Lock the cam locks on this side", detail: "Six again, arrow towards the bolt.", fix: camsAt("R", xi, -1), tools: ["screwdriver"], pose: "+x" });
+ r.step({ title: "Screw in the feet", detail: "The three adjustable feet go into the bottom of the front posts.", fix: ladders.map((L) => at({ kind: "foot", len: 30, dia: 30 }, `pf${L}`, [0, 1, 0], [[gx(L) * xp, 0, zpf]])), pose: "+x", kind: "legs" });
+ const plateAt = ladders.flatMap((L) => bracketFaces(L).flatMap(([x, g]) => hangY.map((y): Vec3 => [x - g * 20, y, zb - 2])));
+ r.step({
+ title: "Hang it on the wall",
+ detail: "Two people stand it up. Mark the brackets on the wall, screw the six wall plates on level (screws and plugs for your wall, not included), hang it on and set the feet down to the floor.",
+ fix: [at({ kind: "bracket", len: 40, dia: 30, name: "Wall plate" }, undefined, [0, 0, -1], plateAt), at(WALL_PLUG, undefined, [0, 0, -1], plateAt.map((p): Vec3 => [p[0], p[1], p[2] - 20])), at(WALL_SCREW, undefined, [0, 0, -1], plateAt.map((p): Vec3 => [p[0], p[1] + 10, p[2] + 6]))],
+ wall: true,
+ people: 2,
+ pose: "+y",
+ tools: ["drill", "screwdriver", "level", "pencil"],
+ warnings: ["two", "wall", "tip"],
+ });
+ buildCustom(b, { ...s, custom: r.get() });
+
+ const list: BoardBox[] = [];
+ for (const c of [-1, 1]) list.push({ x: c * ccx, y0: yDr[0], w: cw, h: h1, zf, zBack: zb + 40 });
+ for (const c of [-1, 1]) list.push({ x: c * ccx, y0: yDr[1], w: cw, h: h2, zf, zBack: zb + 30 });
+ boardDrawers(b, list);
+}
+
+/* ---------- drawers built on their backs (vanity), as hemnes.ts builds the wash-stand ones ---------- */
+
+interface BoardBox {
+ x: number;
+ y0: number;
+ w: number;
+ h: number;
+ zf: number;
+ zBack: number;
+}
+const B_SCREW: HwDef = { kind: "screw", len: 13, dia: 3.5 };
+
+/**
+ * The vanity drawers: cam bolts into the back, the sides stand on it on dowels and are locked, the bottom slides in,
+ * the front goes on with dowels and cam locks, two L plates hold the bottom, then the knob. The small ones are shown
+ * once, then the big ones, and all four click onto the runners.
+ */
+function boardDrawers(b: PlanBuilder, list: BoardBox[]) {
+ const bt = 20, bs = 16;
+ const made = list.map((box) => {
+ const fw = box.w - 4, fh = box.h - 4;
+ const dd = Math.round((box.zf - box.zBack) / 10) * 10;
+ const xs = box.w / 2 - 14 - bs / 2;
+ const sh = Math.max(80, fh - 40);
+ const ys = box.y0 + 20;
+ const zc = box.zf - dd / 2;
+ const front = b.place(b.part("Drawer front", [fw, fh, bt]), [box.x, box.y0 + 2 + fh / 2, box.zf - bt / 2]);
+ const sdT = b.part("Drawer side", [bs, sh, dd - bt - bs]);
+ const sides = [-1, 1].map((g) => b.place(sdT, [box.x + g * xs, ys + sh / 2, zc]));
+ const back = b.place(b.part("Drawer back", [2 * xs + bs, sh, bs]), [box.x, ys + sh / 2, box.zf - dd + bs / 2]);
+ const bottom = b.place(b.part("Drawer bottom", [2 * xs - bs, 12, dd - bt - bs]), [box.x, ys + 6, zc]);
+ return { box, front, sides, back, bottom, xs, sh, ys, dd, zc };
+ });
+ type M = (typeof made)[number];
+ const fitsOf = (d: M) => {
+ const { box, xs, sh, ys, dd } = d;
+ const zB = box.zf - dd + bs;
+ const zF = box.zf - bt;
+ const per = (fn: (g: -1 | 1, k: string) => FitOpts[]) => [...fn(-1, d.sides[0]), ...fn(1, d.sides[1])];
+ return {
+ bolts: per((g, k) => [ys + 25, ys + sh - 25].map((y): FitOpts => ({ on: d.back, at: [box.x + g * xs, y, zB], dir: [0, 0, -1], mate: k, mateHole: 4 }))),
+ dowels: per((g, k) => [{ on: k, at: [box.x + g * xs, ys + sh * 0.5, zB], dir: [0, 0, 1], mate: d.back }, { on: k, at: [box.x + g * xs, ys + sh * 0.8, zB], dir: [0, 0, 1], mate: d.back }] as FitOpts[]).concat(
+ per((g, k) => [ys + sh * 0.3, ys + sh * 0.7].map((y): FitOpts => ({ on: k, at: [box.x + g * xs, y, zF], dir: [0, 0, -1], mate: d.front }))),
+ ),
+ cams: per((g, k) => [ys + 25, ys + sh - 25].map((y): FitOpts => ({ on: k, at: [box.x + g * (xs - bs / 2), y, zB + 28], dir: [g, 0, 0] }))),
+ frontBolts: per((g, k) => [{ on: d.front, at: [box.x + g * xs, ys + sh / 2, zF], dir: [0, 0, 1], mate: k, mateHole: 4 }]),
+ frontCams: per((g, k) => [{ on: k, at: [box.x + g * (xs - bs / 2), ys + sh / 2, zF - 28], dir: [g, 0, 0] }]),
+ plates: [{ on: d.bottom, at: [box.x, ys + 12, zB + 10], dir: [0, -1, 0], hole: false }, { on: d.bottom, at: [box.x, ys + 12, zF - 10], dir: [0, -1, 0], hole: false }] as FitOpts[],
+ plateScrews: [{ on: d.bottom, at: [box.x, ys + 12, zB + 18], dir: [0, -1, 0] }, { on: d.back, at: [box.x, ys + 20, zB], dir: [0, 0, -1] }, { on: d.bottom, at: [box.x, ys + 12, zF - 18], dir: [0, -1, 0] }, { on: d.front, at: [box.x, ys + 20, zF], dir: [0, 0, 1] }] as FitOpts[],
+ knobs: [{ on: d.front, at: [box.x, box.y0 + box.h / 2, box.zf], dir: [0, 0, -1], hole: false }] as FitOpts[],
+ knobScrews: [{ on: d.front, at: [box.x, box.y0 + box.h / 2, zF - 2], dir: [0, 0, 1] }] as FitOpts[],
+ };
+ };
+ const PLATE: HwDef = { kind: "angle", len: 30, dia: 20 };
+ const groups = [made.slice(0, 2), made.slice(2)];
+ for (const [gi, group] of groups.entries()) {
+ const d0 = group[0];
+ const f0 = fitsOf(d0);
+ const c0: Vec3 = [d0.box.x, d0.ys + d0.sh / 2, d0.zc];
+ const scene = `drawer${gi}`;
+ const stage = (k: string, from?: Vec3) => {
+ const it = b.partItem(k);
+ b.stage(k, [it.final.pos[0] - c0[0], it.final.pos[1] - c0[1], it.final.pos[2] - c0[2]], it.final.rot, from);
+ };
+ const size = gi ? "big" : "small";
+ const dstep = (title: string, detail: string, body: () => void, x: { tools?: ToolId[]; kind?: StepKind; pose?: Pose } = {}) =>
+ bstep(b, { title, detail, tools: x.tools, scene, pose: x.pose ?? "+z", repeat: group.length, kind: x.kind ?? "drawer" }, body);
+ dstep(`Screw the cam bolts into a ${size} drawer back`, "Lay it flat on a rug, inside face up. By hand until they stop.", () => {
+ stage(d0.back, [0, 0, -160]);
+ b.then(0.15);
+ b.fits(D_BOLT, f0.bolts, 0.08);
+ }, { tools: ["screwdriver"], kind: "cams" });
+ dstep("Stand the sides on the back", "Tap the dowels into the sides first, then push them onto the dowels and bolts.", () => {
+ b.fits(D_DOWEL, f0.dowels.filter((x) => x.mate === d0.back), 0.08);
+ b.then(0.15);
+ for (const k of d0.sides) stage(k, [0, 0, 260]);
+ }, { tools: ["hammer"], kind: "dowels" });
+ dstep("Lock the cam locks", "Arrow towards the bolt, then a clockwise turn.", () => b.fits(D_CAM, f0.cams, 0.1), { tools: ["screwdriver"], kind: "cams" });
+ dstep("Slide in the drawer bottom", "It runs down the grooves in the sides until it meets the back.", () => stage(d0.bottom, [0, 0, 380]));
+ dstep("Put the front on", "Cam bolts into the front and dowels into the sides, then press it on and lock both cam locks.", () => {
+ b.fits(D_BOLT, f0.frontBolts, 0.1);
+ b.fits(D_DOWEL, f0.dowels.filter((x) => x.mate === d0.front), 0.08);
+ b.then(0.15);
+ stage(d0.front, [0, 0, 260]);
+ b.then(0.1);
+ b.fits(D_CAM, f0.frontCams, 0.12);
+ }, { tools: ["hammer", "screwdriver"], kind: "join" });
+ dstep("Screw the L plates under the bottom", "Turn it over. They hold the bottom to the front and the back.", () => {
+ b.fits(PLATE, f0.plates, 0.12);
+ b.then(0.05);
+ b.fits(B_SCREW, f0.plateScrews, 0.1);
+ }, { tools: ["screwdriver"], kind: "screws", pose: "-y" });
+ dstep("Screw on the knob", "The screw goes in from inside the drawer.", () => {
+ b.fits(D_KNOB, f0.knobs, 0.2);
+ b.then(0.05);
+ b.fits(D_KNOB_SCREW, f0.knobScrews, 0.15);
+ }, { tools: ["screwdriver"], kind: "screws", pose: "+y" });
+ }
+ bstep(b, { title: "Click the drawers onto the runners", detail: "Pull the runners out, set each drawer on them and push it back until both clips click.", kind: "drawer" }, () => {
+ for (const [i, d] of made.entries()) {
+ b.stagger(0);
+ for (const k of [d.back, ...d.sides, d.bottom, d.front]) b.add(k, [0, 0, 520]);
+ if (i % 2 === 1) {
+ const f = fitsOf(d);
+ const all: [HwDef, FitOpts[]][] = [[D_BOLT, [...f.bolts, ...f.frontBolts]], [D_DOWEL, f.dowels], [D_CAM, [...f.cams, ...f.frontCams]], [PLATE, f.plates], [B_SCREW, f.plateScrews], [D_KNOB, f.knobs], [D_KNOB_SCREW, f.knobScrews]];
+ for (const [def, l] of all) for (const x of l) b.preset(def, x);
+ }
+ b.wait(0.22);
+ }
+ });
+}
+
+/** HEMNES guides drawn in this file; returns false for any product it doesn't build. Wired in from hemnes.ts. */
+export function hemnesStorage(b: PlanBuilder, s: ProductSpec): boolean {
+ switch (s.slug) {
+ case "hemnes-mirror-cabinet-2-doors-120-x-98":
+ buildCustom(b, { ...s, custom: mirror120() });
+ return true;
+ case "hemnes-sideboard-157-x-88":
+ sideboard(b);
+ return true;
+ case "hemnes-shoe-cabinet-2-compartments":
+ case "hemnes-shoe-cabinet-4-compartments":
+ shoeCabinet(b, s);
+ return true;
+ case "hemnes-bathroom-vanity-drawers-122-x-82":
+ vanity122(b, s);
+ return true;
+ }
+ return false;
+}
+const spec = (b: PlanBuilder) => b.spec;
diff --git a/src/lib/plan/families/_hemnes-tables.ts b/src/lib/plan/families/_hemnes-tables.ts
new file mode 100644
index 0000000..2930029
--- /dev/null
+++ b/src/lib/plan/families/_hemnes-tables.ts
@@ -0,0 +1,1371 @@
+import type { PartMaterial, PartPiece, Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
+import { HW, type FitOpts, type HwDef, type PlanBuilder } from "../builder";
+import { rotate } from "../math";
+
+/*
+ * HEMNES desks and dressing tables, read from IKEA's manuals and drawn straight with PlanBuilder, since the drawers
+ * of these pieces hang on runners under the top and are fixed to it while it lies upside down.
+ */
+
+const range = (n: number) => Array.from({ length: n }, (_, i) => i);
+const spread = (a: number, c: number, n: number) => range(n).map((i) => (n === 1 ? (a + c) / 2 : a + ((c - a) * i) / (n - 1)));
+
+// fittings, sized so different ones stay apart in the list
+const DOWEL: HwDef = { kind: "dowel", len: 30, dia: 8 };
+const BIG_DOWEL: HwDef = { kind: "dowel", len: 40, dia: 10 };
+const CAM_BOLT: HwDef = HW.camScrew;
+const DRAWER_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 6 };
+const CAM: HwDef = HW.cam;
+const DRAWER_CAM: HwDef = { kind: "cam", len: 12, dia: 12 };
+const ROD: HwDef = { kind: "stud", len: 60, dia: 8, name: "Threaded rod" };
+const NUT: HwDef = { kind: "nut", len: 7, dia: 8 };
+const WEDGE: HwDef = { kind: "washer", len: 4, dia: 22, name: "Wedge washer" };
+const LONG_SCREW: HwDef = { kind: "screw", len: 100, dia: 6 };
+const TOP_SCREW: HwDef = { kind: "screw", len: 60, dia: 6 };
+const SMALL_SCREW: HwDef = { kind: "screw", len: 16, dia: 4 };
+const TAB_SCREW: HwDef = { kind: "screw", len: 16, dia: 3.5 };
+const HINGE_SCREW: HwDef = { kind: "screw", len: 14, dia: 4 };
+const KNOB: HwDef = HW.knob;
+const KNOB_BOLT: HwDef = { kind: "screw", len: 32, dia: 4, name: "Knob bolt" };
+const HINGE: HwDef = HW.hinge;
+const HINGE_PLATE: HwDef = { kind: "plate", len: 40, dia: 20, name: "Hinge plate" };
+const GROMMET: HwDef = { kind: "cap", len: 20, dia: 60, name: "Cable grommet" };
+const runnerDef = (len: number): HwDef => ({ kind: "runner", len: Math.round(len / 10) * 10, dia: 20 });
+
+type StepOpts = {
+ title: string;
+ detail?: string;
+ tools?: ToolId[];
+ pose?: Pose;
+ scene?: string;
+ kind?: StepKind;
+ warnings?: WarnId[];
+ people?: 1 | 2;
+ repeat?: number;
+ check?: "square";
+ wall?: boolean;
+};
+
+/** Parts by our own ids, so the steps read like the manual. */
+class Kit {
+ private keys = new Map<string, string>();
+ private types = new Map<string, string>();
+ constructor(readonly b: PlanBuilder) {}
+ part(id: string, name: string, size: Vec3, pos: Vec3, o: { material?: PartMaterial; shape?: "box" | "cyl"; pieces?: PartPiece[]; rot?: Vec3 } = {}) {
+ const tk = `${name}|${size.map(Math.round).join("x")}|${o.shape ?? "box"}|${o.material ?? "board"}|${o.pieces ? JSON.stringify(o.pieces) : ""}`;
+ let ref = this.types.get(tk);
+ if (!ref) {
+ ref = this.b.part(name, size, { shape: o.shape, material: o.material });
+ if (o.pieces) this.b.parts[this.b.parts.length - 1].pieces = o.pieces;
+ this.types.set(tk, ref);
+ }
+ this.keys.set(id, this.b.place(ref, pos, o.rot ?? [0, 0, 0]));
+ return id;
+ }
+ k(id: string) {
+ const k = this.keys.get(id);
+ if (!k) throw new Error("no part " + id);
+ return k;
+ }
+ step(o: StepOpts, body: () => void = () => {}) {
+ return this.b.step({ kind: "general", ...o, warnings: o.warnings ?? (o.people === 2 ? ["two"] : []) }, body);
+ }
+ add(ids: string[], from?: Vec3) {
+ for (const id of ids) this.b.add(this.k(id), from);
+ }
+ /** Fittings at points of the finished product, going in along `dir`, into `on`, their other end into `mate`. */
+ pts(on: string | undefined, dir: Vec3, at: Vec3[], mate?: string, o: Partial<FitOpts> = {}): FitOpts[] {
+ return at.map((p) => ({ at: p, dir, on: on ? this.k(on) : undefined, mate: mate ? this.k(mate) : undefined, ...o }));
+ }
+ fit(def: HwDef, list: FitOpts[], gap = 0.06) {
+ return this.b.fits(def, list, gap);
+ }
+ preset(def: HwDef, list: FitOpts[]) {
+ for (const o of list) this.b.preset(def, o);
+ }
+ /** Parts shown together somewhere else: turned by `rot` about `pivot`, then moved to `at`. */
+ stage(ids: string[], pivot: Vec3, rot: Vec3, at: Vec3, from?: Vec3) {
+ for (const id of ids) {
+ const it = this.b.partItem(this.k(id));
+ const p = rotate([it.final.pos[0] - pivot[0], it.final.pos[1] - pivot[1], it.final.pos[2] - pivot[2]], rot);
+ this.b.stage(this.k(id), [p[0] + at[0], p[1] + at[1], p[2] + at[2]], rot, from);
+ }
+ }
+}
+
+/** A side frame that comes in one piece: two legs and the rails between them. */
+function legFrame(kit: Kit, id: string, o: { x: number; P: number; legH: number; zf: number; zb: number; rails: { y: number; h: number; t: number }[] }) {
+ const zm = (o.zf + o.zb) / 2;
+ const len = o.zf - o.zb - o.P;
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [o.P, o.legH, o.P], pos: [0, 0, o.zf - zm], material: "wood" },
+ { shape: "box", size: [o.P, o.legH, o.P], pos: [0, 0, o.zb - zm], material: "wood" },
+ ...o.rails.map((r): PartPiece => ({ shape: "box", size: [r.t, r.h, len], pos: [Math.sign(o.x) * (o.P / 2 - r.t / 2 - 5), r.y - o.legH / 2, 0], material: "wood" })),
+ ];
+ return kit.part(id, "Leg frame", [o.P, o.legH, o.zf - o.zb + o.P], [o.x, o.legH / 2, zm], { material: "wood", pieces });
+}
+
+/*
+ * Drawers built on their fronts (desk with 2 drawers, dressing table 110): cam bolts in the front, the sides stand
+ * on them and lock, the bottom slides down the grooves, the back sits on it with two screws a side, then the knob and
+ * a runner screwed to each side. One is built on screen; the rest are the same.
+ */
+interface HungBox {
+ id: string;
+ x: number;
+ y0: number; // underside of the front
+ fw: number;
+ fh: number;
+ zf: number; // front face
+ dd: number; // depth, front face to back face
+}
+interface Hung {
+ box: HungBox;
+ parts: string[];
+ fits: Record<"bolts" | "cams" | "back" | "knob" | "knobBolt" | "runner" | "runnerScrews", [HwDef, FitOpts[]]>;
+ xs: number;
+ zc: number;
+ runners: boolean;
+}
+const DRAWER_NAIL: HwDef = { kind: "nail", len: 30, dia: 3 };
+function hungDrawers(kit: Kit, list: HungBox[], o: { runners: boolean }): Hung[] {
+ const ft = 20, st = 14;
+ return list.map((box) => {
+ const id = box.id;
+ const xs = box.fw / 2 - (o.runners ? 35 : 16); // side centres from the middle: room for the runners outside them
+ const sh = box.fh - 22;
+ const ys = box.y0 + 6;
+ const zIn = box.zf - ft;
+ const sl = box.dd - ft;
+ const zc = zIn - sl / 2;
+ kit.part(`${id}f`, "Drawer front", [box.fw, box.fh, ft], [box.x, box.y0 + box.fh / 2, box.zf - ft / 2]);
+ kit.part(`${id}l`, "Drawer side", [st, sh, sl], [box.x - xs, ys + sh / 2, zc]);
+ kit.part(`${id}r`, "Drawer side", [st, sh, sl], [box.x + xs, ys + sh / 2, zc]);
+ const bw = 2 * xs - st;
+ kit.part(`${id}b`, "Drawer bottom", [bw + 8, 4, sl - st - 4], [box.x, ys + 8, zc + st / 2 + 2], { material: "fiber" });
+ kit.part(`${id}k`, "Drawer back", [bw, sh - 14, st], [box.x, ys + 14 + (sh - 14) / 2, zIn - sl + st / 2]);
+ const per = (fn: (g: number, side: string) => FitOpts[]) => [...fn(-1, `${id}l`), ...fn(1, `${id}r`)];
+ const yr = ys + sh - 18;
+ const zBk = zIn - sl + st / 2;
+ const runners = per((g, sd) => kit.pts(sd, [-g, 0, 0], [[box.x + g * (xs + st / 2 + 6), yr, zc]], undefined, { hole: false }));
+ const fits: Hung["fits"] = {
+ bolts: [DRAWER_BOLT, per((g, sd) => [ys + 20, ys + sh - 20].flatMap((y) => kit.pts(`${id}f`, [0, 0, 1], [[box.x + g * xs, y, zIn]], sd, { mateHole: 3 })))],
+ cams: [DRAWER_CAM, per((g, sd) => [ys + 20, ys + sh - 20].flatMap((y) => kit.pts(sd, [g, 0, 0], [[box.x + g * (xs - st / 2), y, zIn - 25]])))],
+ back: [o.runners ? SMALL_SCREW : DRAWER_NAIL, per((g, sd) => [ys + 30, ys + sh - 20].flatMap((y) => kit.pts(sd, [-g, 0, 0], [[box.x + g * (xs + st / 2), y, zBk]], `${id}k`)))],
+ knob: [KNOB, kit.pts(`${id}f`, [0, 0, -1], [[box.x, box.y0 + box.fh / 2, box.zf]], undefined, { hole: false })],
+ knobBolt: [KNOB_BOLT, kit.pts(`${id}f`, [0, 0, 1], [[box.x, box.y0 + box.fh / 2, zIn - 2]])],
+ runner: [runnerDef(sl - 20), o.runners ? runners : []],
+ runnerScrews: [SMALL_SCREW, o.runners ? per((g, sd) => [zIn - 40, zIn - sl + 40].flatMap((z) => kit.pts(sd, [-g, 0, 0], [[box.x + g * (xs + st / 2 + 8), yr, z]]))) : []],
+ };
+ return { box, parts: [`${id}f`, `${id}l`, `${id}r`, `${id}b`, `${id}k`], fits, xs, zc, runners: o.runners };
+ });
+}
+const allFits = (d: Hung) => Object.values(d.fits).filter(([, l]) => l.length);
+
+/** The first drawer built on screen in its own scene, lying on its front; "do this for each". */
+function buildHung(kit: Kit, d: Hung, n: number) {
+ const b = kit.b;
+ const id = d.box.id;
+ const c: Vec3 = [d.box.x, d.box.y0 + d.box.fh / 2, d.zc];
+ const st = (k: string, from?: Vec3) => {
+ const it = b.partItem(kit.k(k));
+ b.stage(kit.k(k), [it.final.pos[0] - c[0], it.final.pos[1] - c[1], it.final.pos[2] - c[2]], it.final.rot, from);
+ };
+ const f = d.fits;
+ const put = (x: [HwDef, FitOpts[]], gap: number) => kit.fit(x[0], x[1], gap);
+ const o = (title: string, detail: string, body: () => void, x: { tools?: ToolId[]; kind?: StepKind; pose?: Pose } = {}) =>
+ kit.step({ title, detail, tools: x.tools, scene: "drawer", pose: x.pose ?? "-z", repeat: n > 1 ? n : undefined, kind: x.kind ?? "drawer" }, body);
+ o("Screw the cam bolts into the drawer front", "Lay it face down on a rug. Four bolts, by hand until they stop.", () => {
+ st(`${id}f`, [0, 0, -160]);
+ b.then(0.15);
+ put(f.bolts, 0.08);
+ }, { tools: ["screwdriver"], kind: "cams" });
+ o("Stand the sides on the front", "Onto the bolts, with the grooves for the bottom facing in and down.", () => {
+ b.stagger(0.2);
+ st(`${id}l`, [0, 0, -260]);
+ st(`${id}r`, [0, 0, -260]);
+ }, { kind: "join" });
+ o("Lock the cam locks", "Arrow towards the bolt, then turn each one clockwise.", () => put(f.cams, 0.1), { tools: ["screwdriver"], kind: "cams" });
+ o("Slide in the drawer bottom", "It runs down the grooves in the sides until it reaches the front.", () => st(`${id}b`, [0, 0, -380]));
+ if (d.runners) {
+ o("Lay the drawer back on", "It sits on the bottom, between the sides.", () => st(`${id}k`, [0, 0, -240]), { kind: "join" });
+ o("Screw the back on", "Two screws through each side into the back.", () => put(f.back, 0.1), { tools: ["screwdriver"], kind: "screws" });
+ } else {
+ o("Put the drawer back on", "It sits on the bottom, between the sides. Tap two fasteners through each side into it.", () => {
+ st(`${id}k`, [0, 0, -240]);
+ b.then(0.15);
+ put(f.back, 0.1);
+ }, { tools: ["hammer"], kind: "nails" });
+ }
+ o("Screw on the knob", "The bolt goes in from inside the drawer.", () => {
+ put(f.knob, 0.2);
+ b.then(0.05);
+ put(f.knobBolt, 0.15);
+ }, { tools: ["screwdriver"], kind: "screws", pose: "+y" });
+ if (!d.runners) return;
+ o("Screw the runners to the sides", "One along the top of each side, two screws each.", () => {
+ put(f.runner, 0.25);
+ b.then(0.1);
+ put(f.runnerScrews, 0.08);
+ }, { tools: ["screwdriver"], kind: "runners", pose: "+y" });
+ o("Check the runners", "Turn the drawer over, slide the outer part of each runner off towards the front, then push it back on from the back and turn the drawer back over.", () => {}, { pose: "-y" });
+}
+
+/* ---------- desk with 2 drawers 120 x 47 ---------- */
+
+/*
+ * Two ready-made leg frames. It is built standing on its left end: the left frame lies on a rug, the drawer shelf,
+ * the front rail, the back board (on threaded rods and nuts) and the low stretcher stand in it on dowels and cam
+ * locks, then the right frame goes on top. The drawers are built on their fronts and screwed by their runners under
+ * the top while it lies upside down, with a block between them; the top goes on with dowels and long screws, and the
+ * cable flap at the back clicks onto two hinges.
+ */
+function desk2(b: PlanBuilder, s: ProductSpec) {
+ const kit = new Kit(b);
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const topT = 28, P = 50, legH = H - topT, ov = 10;
+ const xo = W / 2 - ov, xp = xo - P / 2, xi = xo - P; // leg outer face, leg centre, leg inner face
+ const xr = xo - 15, xri = xr - 10; // side rail centre and inner face
+ const zf = D / 2 - ov, zb = -D / 2 + ov; // front and back faces of the legs
+ const zpf = zf - P / 2, zpb = zb + P / 2;
+ const apron = 140, yA = legH - apron; // underside of the side rails
+ const yL = 180; // low rails
+ const flapD = 140;
+ const zBoard = -D / 2 + flapD + 9; // back board centre, under the back edge of the top
+ for (const L of ["L", "R"]) {
+ const g = L === "L" ? -1 : 1;
+ legFrame(kit, `f${L}`, { x: g * xp, P, legH, zf: zpf, zb: zpb, rails: [{ y: legH - apron / 2, h: apron, t: 20 }, { y: yL, h: 50, t: 20 }] });
+ }
+ kit.part("shelf", "Drawer shelf", [2 * xri, 16, zpf - P / 2 - (zBoard + 9)], [0, yA + 8, (zpf - P / 2 + zBoard + 9) / 2]);
+ kit.part("rail", "Front rail", [2 * xi, 28, 40], [0, yA + 14, zf - 20], { material: "wood" });
+ kit.part("board", "Back board", [2 * xri, apron, 18], [0, legH - apron / 2, zBoard]);
+ kit.part("str", "Stretcher", [2 * xri, 50, 20], [0, yL, 0], { material: "wood" });
+ const zTop = -D / 2 + flapD;
+ kit.part("top", "Top", [W, topT, D / 2 - zTop], [0, legH + topT / 2, (D / 2 + zTop) / 2], { material: "wood" });
+ kit.part("flap", "Cable flap", [W, topT, flapD], [0, legH + topT / 2, (zTop - D / 2) / 2], { material: "wood" });
+ const zBf = zBoard + 9; // front face of the back board
+ kit.part("block", "Middle block", [20, apron - 30, zf - 30 - zBf], [0, legH - (apron - 30) / 2, (zf - 30 + zBf) / 2]);
+ const ow = (2 * xi - 20) / 2; // each drawer opening
+ const drawers = hungDrawers(
+ kit,
+ [-1, 1].map((g, i) => ({ id: `d${i}`, x: g * (10 + ow / 2), y0: yA + 28, fw: ow - 4, fh: apron - 28 - 6, zf, dd: zf - zBf - 10 })),
+ { runners: true },
+ );
+ const ys = (y: number) => [y - 30, y + 30];
+
+ const sideFits = (L: string) => {
+ const g = L === "L" ? -1 : 1;
+ const zs = spread(zBf + 25, zpf - P / 2 - 25, 4);
+ return {
+ rods: kit.pts(`f${L}`, [g, 0, 0], ys(legH - apron / 2).map((y): Vec3 => [g * xri, y, zBoard]), "board", { mateHole: 5 }),
+ bolts: [
+ ...kit.pts(`f${L}`, [g, 0, 0], zs.map((z): Vec3 => [g * xri, yA + 8, z]), "shelf", { mateHole: 4 }),
+ ...kit.pts(`f${L}`, [g, 0, 0], [[g * xi, yA + 14, zf - 20]], "rail", { mateHole: 4 }),
+ ...kit.pts(`f${L}`, [g, 0, 0], [[g * xri, yL, 0]], "str", { mateHole: 4 }),
+ ],
+ shelfDowels: kit.pts("shelf", [-g, 0, 0], [zs[0] + 30, zs[3] - 30].map((z): Vec3 => [g * xri, yA + 8, z]), `f${L}`),
+ shelfCams: kit.pts("shelf", [0, -1, 0], zs.map((z): Vec3 => [g * (xri - 26), yA + 16, z])),
+ railDowel: kit.pts("rail", [-g, 0, 0], [[g * xi, yA + 14, zf - 32]], `f${L}`),
+ railCam: kit.pts("rail", [0, -1, 0], [[g * (xi - 26), yA + 28, zf - 20]]),
+ boardDowels: kit.pts("board", [-g, 0, 0], [yA + 40, legH - 20].map((y): Vec3 => [g * xri, y, zBoard]), `f${L}`),
+ nuts: kit.pts("board", [g, 0, 0], ys(legH - apron / 2).map((y): Vec3 => [g * (xri - 40), y, zBoard])),
+ strDowel: kit.pts("str", [-g, 0, 0], [[g * xri, yL + 12, 0]], `f${L}`),
+ strCam: kit.pts("str", [0, -1, 0], [[g * (xri - 26), yL + 25, 0]]),
+ };
+ };
+ const fl = sideFits("L"), fr = sideFits("R");
+ const pose = "+x" as const;
+
+ kit.step({ title: "Screw the threaded rods into the leg frames", detail: "Both frames on a rug, inside up. Two rods in each, by hand, into the holes near the back legs.", tools: [], pose, kind: "bolts", repeat: 2, warnings: ["floor"] }, () => {
+ kit.add(["fL"], [0, 200, 0]);
+ b.then(0.15);
+ kit.fit(ROD, fl.rods, 0.12);
+ });
+ kit.step({ title: "Screw the cam bolts into the leg frames", detail: "Six in each: four along the top rail, one in the front leg and one in the low rail.", tools: ["screwdriver"], pose, kind: "cams", repeat: 2 }, () => kit.fit(CAM_BOLT, fl.bolts, 0.08));
+ kit.step({ title: "Stand the drawer shelf in", detail: "The left frame stays on the rug. Two dowels in the end of the shelf, then push it onto the bolts, cable hole at the bottom.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, fl.shelfDowels, 0.1);
+ b.then(0.15);
+ kit.add(["shelf"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the shelf", detail: "Four cam locks, arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, fl.shelfCams, 0.1));
+ kit.step({ title: "Stand the front rail in", detail: "One dowel in its end. The flat side faces the front.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, fl.railDowel);
+ b.then(0.15);
+ kit.add(["rail"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the front rail", detail: "One cam lock.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, fl.railCam));
+ const plates = kit.pts("board", [0, 0, 1], [-1, 1].map((g): Vec3 => [g * W * 0.3, legH - 14, zBoard - 9]), undefined, { hole: false });
+ kit.step({ title: "Fit the hinge plates on the back board", detail: "Press each plate into its holes on the back face, then turn its two screws in.", tools: ["screwdriver"], pose, scene: "board", kind: "hinges" }, () => {
+ b.stage(kit.k("board"), [9, 0, 0], [0, -Math.PI / 2, 0], [200, 0, 0]);
+ b.then(0.15);
+ kit.fit(HINGE_PLATE, plates, 0.2);
+ });
+ kit.step({ title: "Stand the back board onto the rods", detail: "Two dowels in its end, then slide its holes over the rods. Hinge plates at the back, at the top.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, fl.boardDowels, 0.1);
+ b.then(0.15);
+ kit.add(["board"], [300, 0, 0]);
+ });
+ kit.step({ title: "Tighten the rods with nuts", detail: "A wedge washer and a nut on each rod, through the holes in the board. Tighten with the spanner.", tools: ["wrench"], pose, kind: "bolts" }, () => {
+ kit.fit(WEDGE, fl.nuts, 0.12);
+ b.then(0.05);
+ kit.fit(NUT, fl.nuts, 0.12);
+ });
+ kit.step({ title: "Stand the stretcher in", detail: "One dowel in its end, at the low rail.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, fl.strDowel);
+ b.then(0.15);
+ kit.add(["str"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the stretcher", detail: "One cam lock.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, fl.strCam));
+ kit.step({ title: "Lower the right frame on", detail: "Tap six dowels into the free ends, then press the frame down onto them, rods and bolts into their holes.", tools: ["hammer"], pose, kind: "join", people: 2 }, () => {
+ kit.fit(DOWEL, [...fr.shelfDowels, ...fr.railDowel, ...fr.boardDowels, ...fr.strDowel], 0.08);
+ b.then(0.15);
+ kit.add(["fR"], [360, 0, 0]);
+ kit.preset(ROD, fr.rods);
+ kit.preset(CAM_BOLT, fr.bolts);
+ });
+ kit.step({ title: "Lock the cam locks on this side", detail: "Six of them, arrow towards the bolt.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, [...fr.shelfCams, ...fr.railCam, ...fr.strCam], 0.1));
+ kit.step({ title: "Tighten the nuts on this side", detail: "A wedge washer and a nut on each rod, with the spanner.", tools: ["wrench"], pose, kind: "bolts" }, () => {
+ kit.fit(WEDGE, fr.nuts, 0.12);
+ b.then(0.05);
+ kit.fit(NUT, fr.nuts, 0.12);
+ });
+ kit.step({ title: "Screw the back board to the shelf", detail: "Three long screws through the board into the edge of the shelf. Then stand the frame up.", tools: ["allen"], pose, kind: "screws" }, () =>
+ kit.fit(TOP_SCREW, kit.pts("board", [0, 0, 1], spread(-xri + 150, xri - 150, 3).map((x): Vec3 => [x, yA + 8, zBoard - 9]), "shelf"), 0.15),
+ );
+
+ buildHung(kit, drawers[0], drawers.length);
+
+ // the top upside down on a rug, the drawers on it
+ const flip: Vec3 = [Math.PI, 0, 0];
+ const pivot: Vec3 = [0, legH + topT / 2, 0];
+ const group = ["top", "block", ...drawers.flatMap((d) => d.parts)];
+ const tabs = drawers.flatMap((d) => [-1, 1].flatMap((g) => kit.pts("top", [0, 1, 0], [d.zc + 100, d.zc - 100].map((z): Vec3 => [d.box.x + g * (d.xs + 7 + 6), legH, z]))));
+ kit.step({ title: "Screw the drawers under the top", detail: "Lay the top upside down on a rug and the drawers upside down on it, fronts flush with its front edge. Two screws through the tabs of each runner.", tools: ["screwdriver"], scene: "top", kind: "drawer", warnings: ["floor"] }, () => {
+ kit.stage(["top"], pivot, flip, [0, topT / 2, 0], [0, 160, 0]);
+ b.then(0.15);
+ b.stagger(0.12);
+ for (const d of drawers) kit.stage(d.parts, pivot, flip, [0, topT / 2, 0], [0, 260, 0]);
+ for (const d of drawers.slice(1)) for (const [def, l] of allFits(d)) kit.preset(def, l);
+ b.then(0.15);
+ kit.fit(TAB_SCREW, tabs, 0.06);
+ });
+ kit.step({ title: "Fit the middle block", detail: "Two dowels into the top between the drawers, then push the block onto them.", tools: ["hammer"], scene: "top", kind: "join" }, () => {
+ kit.fit(DOWEL, kit.pts("top", [0, 1, 0], [-1, 1].map((g): Vec3 => [0, legH, (zf - 30 + zBf) / 2 + g * 70]), "block"), 0.1);
+ b.then(0.15);
+ kit.stage(["block"], pivot, flip, [0, topT / 2, 0], [0, 200, 0]);
+ });
+ kit.step({ title: "Screw the block to the top", detail: "Two long screws through the block into the top.", tools: ["allen"], scene: "top", kind: "screws" }, () =>
+ kit.fit(LONG_SCREW, kit.pts("block", [0, 1, 0], [-1, 1].map((g): Vec3 => [0, legH - 80, (zf - 30 + zBf) / 2 + g * 110]), "top"), 0.15),
+ );
+ kit.step({ title: "Tap two dowels into the top", detail: "Near each end, where it meets the side rails.", tools: ["hammer"], scene: "top", kind: "dowels" }, () =>
+ kit.fit(DOWEL, [-1, 1].flatMap((g) => kit.pts("top", [0, 1, 0], [[g * xr, legH, 40]], g < 0 ? "fL" : "fR")), 0.1),
+ );
+ void group;
+ kit.step({ title: "Tap dowels into the back board", detail: "Two in its top edge.", tools: ["hammer"], kind: "dowels" }, () =>
+ kit.fit(DOWEL, kit.pts("board", [0, -1, 0], [-1, 1].map((g): Vec3 => [g * W * 0.2, legH, zBoard]), "top"), 0.1),
+ );
+ kit.step({ title: "Lower the top on", detail: "Two thick dowels in the tops of the front legs, then two people turn the top over and lower it on, drawers and all.", tools: ["hammer"], kind: "join", people: 2 }, () => {
+ kit.fit(BIG_DOWEL, kit.pts("fL", [0, -1, 0], [[-xp, legH, zpf]], "top").concat(kit.pts("fR", [0, -1, 0], [[xp, legH, zpf]], "top")), 0.1);
+ b.then(0.15);
+ b.stagger(0);
+ kit.add(group, [0, 320, 0]);
+ });
+ kit.step({ title: "Screw the top on through the side rails", detail: "Two long screws up through each side rail, with the Allen key.", tools: ["allen"], kind: "screws" }, () =>
+ kit.fit(LONG_SCREW, [-1, 1].flatMap((g) => kit.pts(g < 0 ? "fL" : "fR", [0, 1, 0], [zpf - P / 2 - 60, zBf + 40].map((z): Vec3 => [g * xr, legH - 75, z]), "top")), 0.15),
+ );
+ kit.step({ title: "Screw the top to the back board", detail: "Four screws up through the board, with the Allen key in the long holder.", tools: ["allen"], kind: "screws" }, () =>
+ kit.fit(TOP_SCREW, kit.pts("board", [0, 1, 0], spread(-xri + 120, xri - 120, 4).map((x): Vec3 => [x, legH - 40, zBoard]), "top"), 0.15),
+ );
+ kit.step({ title: "Screw the back board to the middle block", detail: "One screw from behind, through the board into the block.", tools: ["allen"], kind: "screws" }, () =>
+ kit.fit(TOP_SCREW, kit.pts("board", [0, 0, 1], [[0, legH - 50, zBoard - 9]], "block")),
+ );
+ const zF = (zTop - D / 2) / 2;
+ const hinges = kit.pts("flap", [0, 1, 0], [-1, 1].map((g): Vec3 => [g * W * 0.3, legH, zTop - 10]), undefined, { hole: false });
+ kit.step({ title: "Screw the hinges onto the cable flap", detail: "Flap upside down. Each hinge sits in its round hole, two screws each.", tools: ["screwdriver"], scene: "flap", kind: "hinges" }, () => {
+ kit.stage(["flap"], [0, legH + topT / 2, zF], flip, [0, topT / 2, 0], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(HINGE, hinges, 0.2);
+ b.then(0.05);
+ kit.fit(HINGE_SCREW, kit.pts("flap", [0, 1, 0], [-1, 1].flatMap((g) => [-16, 16].map((dx): Vec3 => [g * W * 0.3 + dx, legH, zTop - 30])), undefined), 0.08);
+ });
+ kit.step({ title: "Click the flap onto the hinge plates", detail: "Hook each hinge onto its plate at the front, then press the back until it clicks.", kind: "hinges" }, () => kit.add(["flap"], [0, 120, -160]));
+ kit.step({ title: "Press in the cable grommet", detail: "Into the round hole in the flap.", kind: "general" }, () =>
+ kit.fit(GROMMET, kit.pts("flap", [0, -1, 0], [[-W * 0.38, H, zF]], undefined, { hole: false })),
+ );
+ return true;
+}
+
+/* ---------- dressing table with mirror 110 x 45 ---------- */
+
+const BIG_CAM_BOLT: HwDef = { kind: "camScrew", len: 40, dia: 8 };
+const BIG_CAM: HwDef = { kind: "cam", len: 16, dia: 25 };
+const TOP_BOLT: HwDef = { kind: "camScrew", len: 28, dia: 6 };
+const RAIL_SCREW: HwDef = { kind: "screw", len: 50, dia: 5 };
+const STOP_SCREW: HwDef = { kind: "screw", len: 12, dia: 3.5 };
+const PAD: HwDef = { kind: "glide", len: 2, dia: 12 };
+const GLASS_CLIP: HwDef = { kind: "clip", len: 40, dia: 20, name: "Glass holder" };
+const MIRROR_KNOB: HwDef = { kind: "knob", len: 30, dia: 40, name: "Mirror knob" };
+const MIRROR_ROD: HwDef = { kind: "stud", len: 80, dia: 6, name: "Threaded rod" };
+const BUSH: HwDef = { kind: "spacer", len: 20, dia: 30, name: "Pivot bush" };
+const MIRROR_BOLT: HwDef = { kind: "bolt", len: 60, dia: 6 };
+const WASHER: HwDef = HW.washer;
+
+/*
+ * The 110 dressing table is built like the desk with 2 drawers: two ready-made leg frames, built standing on the left
+ * end. The drawers come first, built on their fronts. The frames take cam bolts and runners, the drawer shelf, the
+ * back board (big cam locks) and the stretcher stand in the left frame and the right one goes on. Upside down, the
+ * top takes cam bolts and the two dividers with their runners; the round mirror hangs between two posts that bolt
+ * through the top. Two people lower the top on, the drawers slide in, and the glass top lies on felt pads.
+ */
+function dressing110(b: PlanBuilder, s: ProductSpec) {
+ const kit = new Kit(b);
+ const W = s.size.w * 10, D = s.size.d * 10, Htot = s.size.h * 10;
+ const topT = 22, glass = 5, P = 45, ov = 10, legH = 750 - topT - glass - 2;
+ const xo = W / 2 - ov, xp = xo - P / 2, xi = xo - P;
+ const xr = xo - 15, xri = xr - 10;
+ const zf = D / 2 - ov, zb = -D / 2 + ov, zpf = zf - P / 2, zpb = zb + P / 2;
+ const apron = 140, yA = legH - apron, yL = 180;
+ const zBoard = zpb + P / 2 + 9, zBf = zBoard + 9;
+ for (const L of ["L", "R"]) {
+ const g = L === "L" ? -1 : 1;
+ legFrame(kit, `f${L}`, { x: g * xp, P, legH, zf: zpf, zb: zpb, rails: [{ y: legH - apron / 2, h: apron, t: 20 }, { y: yL, h: 50, t: 20 }] });
+ }
+ const zs0 = zBf, zs1 = zf;
+ const zsc = (zs0 + zs1) / 2;
+ const main = zpf - P / 2 - zs0;
+ kit.part("shelf", "Drawer shelf", [2 * xri, 16, zs1 - zs0], [0, yA + 8, zsc], {
+ pieces: [
+ { shape: "box", size: [2 * xri, 16, main], pos: [0, 0, zs0 + main / 2 - zsc] },
+ { shape: "box", size: [2 * xi, 16, P], pos: [0, 0, zpf - zsc] },
+ ],
+ });
+ kit.part("board", "Back board", [2 * xri, apron, 18], [0, legH - apron / 2, zBoard]);
+ kit.part("str", "Stretcher", [2 * xri, 50, 20], [0, yL, 0], { material: "wood" });
+ kit.part("top", "Top", [W, topT, D], [0, legH + topT / 2, 0], { material: "wood" });
+ const niche = Math.round(W * 0.22);
+ const xd = niche / 2 + 8; // divider centres
+ const yd0 = yA + 18;
+ for (const [i, g] of [-1, 1].entries()) kit.part(`dv${i}`, "Divider", [16, legH - yd0, zf - zBf], [g * xd, (legH + yd0) / 2, (zf + zBf) / 2]);
+ kit.part("glass", "Glass top", [W, glass, D - 60], [0, legH + topT + 2 + glass / 2, 30], { material: "glass" });
+ const R = 250, my = Htot - R, mz = zb + 30;
+ const px = R + 40;
+ const postH = my + 30 - (legH + topT);
+ for (const [i, g] of [-1, 1].entries()) kit.part(`po${i}`, "Mirror post", [40, postH, 40], [g * px, legH + topT + postH / 2, mz], { material: "wood" });
+ kit.part("mirror", "Mirror", [2 * R, 2 * R, 26], [0, my, mz], {
+ pieces: [
+ { shape: "cyl", size: [2 * R, 24, 2 * R], pos: [0, 0, 0], rot: [Math.PI / 2, 0, 0], material: "wood" },
+ { shape: "cyl", size: [2 * R - 70, 26, 2 * R - 70], pos: [0, 0, 0], rot: [Math.PI / 2, 0, 0], material: "glass" },
+ ],
+ });
+ const bay = (xri - (xd + 8));
+ const drawers = hungDrawers(
+ kit,
+ [-1, 1].map((g, i) => ({ id: `d${i}`, x: g * (xd + 8 + bay / 2), y0: yd0 + 2, fw: bay - 4, fh: legH - yd0 - 8, zf, dd: zf - zBf - 10 })),
+ { runners: false },
+ );
+ const zc = drawers[0].zc, runLen = Math.round((zf - zBf - 40) / 10) * 10;
+ const yRun = yd0 + 4;
+ const runnersOn = (on: string, x: number, g: number) => ({
+ run: kit.pts(on, [g, 0, 0], [[x, yRun, zc]], undefined, { hole: false }),
+ screws: kit.pts(on, [g, 0, 0], [zc - runLen / 2 + 30, zc + runLen / 2 - 30].map((z): Vec3 => [x - g * 4, yRun, z])),
+ stop: kit.pts(on, [g, 0, 0], [[x - g * 4, yRun, zf - 30]]),
+ });
+ const side = (L: string) => {
+ const g = L === "L" ? -1 : 1;
+ const zsS = spread(zBf + 25, zpf - P / 2 - 25, 4);
+ const yb = [legH - apron / 2 - 35, legH - apron / 2 + 35];
+ return {
+ big: kit.pts(`f${L}`, [g, 0, 0], yb.map((y): Vec3 => [g * xri, y, zBoard]), "board", { mateHole: 5 }),
+ bolts: [...kit.pts(`f${L}`, [g, 0, 0], zsS.map((z): Vec3 => [g * xri, yA + 8, z]), "shelf", { mateHole: 4 }), ...kit.pts(`f${L}`, [g, 0, 0], [[g * xri, yL, 0]], "str", { mateHole: 4 })],
+ run: runnersOn(`f${L}`, g * (xri - 6), g),
+ shelfDowels: kit.pts("shelf", [-g, 0, 0], [zsS[0] + 30, zsS[3] - 30].map((z): Vec3 => [g * xri, yA + 8, z]), `f${L}`),
+ shelfCams: kit.pts("shelf", [0, -1, 0], zsS.map((z): Vec3 => [g * (xri - 26), yA + 16, z])),
+ bigCams: kit.pts("board", [0, 0, -1], yb.map((y): Vec3 => [g * (xri - 30), y, zBf])),
+ boardDowels: kit.pts("board", [-g, 0, 0], [yA + 20, legH - 20].map((y): Vec3 => [g * xri, y, zBoard]), `f${L}`),
+ strDowel: kit.pts("str", [-g, 0, 0], [[g * xri, yL + 12, 0]], `f${L}`),
+ strCam: kit.pts("str", [0, -1, 0], [[g * (xri - 26), yL + 25, 0]]),
+ topCams: kit.pts(`f${L}`, [g, 0, 0], [-100, 0, 100].map((z): Vec3 => [g * xri, legH - 25, z])),
+ };
+ };
+ const fl = side("L"), fr = side("R");
+ const pose = "+x" as const;
+
+ for (const d of drawers.slice(0, 1)) buildHung(kit, d, drawers.length);
+
+ kit.step({ title: "Screw the big cam bolts into the leg frames", detail: "Both frames on a rug, inside up. Two in each top rail, near the back leg, by hand.", tools: ["screwdriver"], pose, kind: "cams", repeat: 2, warnings: ["floor"] }, () => {
+ kit.add(["fL"], [0, 200, 0]);
+ b.then(0.15);
+ kit.fit(BIG_CAM_BOLT, fl.big, 0.1);
+ });
+ kit.step({ title: "Screw in the cam bolts", detail: "Five in each frame: four along the top rail and one in the low rail.", tools: ["screwdriver"], pose, kind: "cams", repeat: 2 }, () => kit.fit(CAM_BOLT, fl.bolts, 0.08));
+ kit.step({ title: "Screw a runner to each frame", detail: "Along the bottom of the top rail, the arrow pointing to the front. Two screws each.", tools: ["screwdriver"], pose, kind: "runners", repeat: 2 }, () => {
+ kit.fit(runnerDef(runLen), fl.run.run, 0.2);
+ b.then(0.1);
+ kit.fit(SMALL_SCREW, fl.run.screws, 0.08);
+ });
+ kit.step({ title: "Stand the drawer shelf in", detail: "Tap two dowels into each end of the shelf, then push it onto the left frame, cable hole at the bottom.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, [...fl.shelfDowels, ...fr.shelfDowels], 0.08);
+ b.then(0.15);
+ kit.add(["shelf"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the shelf", detail: "Four cam locks, arrow towards the bolt.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, fl.shelfCams, 0.1));
+ kit.step({ title: "Press the big cam locks into the back board", detail: "Two at this end, open side towards the end.", pose, scene: "board", kind: "cams" }, () => {
+ b.stage(kit.k("board"), [9, 0, 0], [0, -Math.PI / 2, 0], [200, 0, 0]);
+ b.then(0.15);
+ kit.fit(BIG_CAM, fl.bigCams, 0.15);
+ });
+ kit.step({ title: "Stand the back board in", detail: "Two dowels in each end, then push it onto the big bolts.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, [...fl.boardDowels, ...fr.boardDowels], 0.08);
+ b.then(0.15);
+ kit.add(["board"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the big cam locks", detail: "Turn both clockwise with the Allen key until they pull tight.", tools: ["allen"], pose, kind: "cams" });
+ kit.step({ title: "Stand the stretcher in", detail: "One dowel in each end, at the low rail.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, [...fl.strDowel, ...fr.strDowel], 0.1);
+ b.then(0.15);
+ kit.add(["str"], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the stretcher", detail: "One cam lock.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, fl.strCam));
+ kit.step({ title: "Press in the big cam locks at this end", detail: "Two more in the free end of the back board.", pose, kind: "cams" }, () => kit.fit(BIG_CAM, fr.bigCams, 0.15));
+ kit.step({ title: "Lower the right frame on", detail: "Two people. Press it down onto the dowels and bolts.", pose, kind: "join", people: 2 }, () => {
+ kit.add(["fR"], [360, 0, 0]);
+ for (const [def, l] of [[BIG_CAM_BOLT, fr.big], [CAM_BOLT, fr.bolts], [runnerDef(runLen), fr.run.run], [SMALL_SCREW, fr.run.screws]] as [HwDef, FitOpts[]][]) kit.preset(def, l);
+ });
+ kit.step({ title: "Lock the big cam locks on this side", detail: "With the Allen key, clockwise.", tools: ["allen"], pose, kind: "cams" });
+ kit.step({ title: "Lock the cam locks on this side", detail: "Five of them. Then stand the frame up on its legs.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, [...fr.shelfCams, ...fr.strCam], 0.1));
+ kit.step({ title: "Press in the cable grommet", detail: "Into the round hole in the drawer shelf.", kind: "general" }, () =>
+ kit.fit(GROMMET, kit.pts("shelf", [0, -1, 0], [[0, yA + 16, zBf + 40]], undefined, { hole: false })),
+ );
+ kit.step({ title: "Tap the thick dowels into the front legs", detail: "One in the top of each front leg.", tools: ["hammer"], kind: "dowels" }, () =>
+ kit.fit(BIG_DOWEL, [...kit.pts("fL", [0, -1, 0], [[-xp, legH, zpf]], "top"), ...kit.pts("fR", [0, -1, 0], [[xp, legH, zpf]], "top")], 0.1),
+ );
+ const dv = [0, 1].map((i) => {
+ const g = i ? 1 : -1;
+ const x = g * xd;
+ return {
+ run: runnersOn(`dv${i}`, x + g * 14, -g),
+ dowels: kit.pts("top", [0, 1, 0], [zBf + 60, zf - 60].map((z): Vec3 => [x, legH, z]), `dv${i}`),
+ bolts: kit.pts("top", [0, 1, 0], [zBf + 110, zf - 110].map((z): Vec3 => [x, legH, z]), `dv${i}`, { mateHole: 4 }),
+ cams: kit.pts(`dv${i}`, [g, 0, 0], [zBf + 110, zf - 110].map((z): Vec3 => [x - g * 8, legH - 25, z])),
+ };
+ });
+ kit.step({ title: "Screw a runner to each divider", detail: "On the face away from the middle, arrow to the front. Two screws each.", tools: ["screwdriver"], scene: "dividers", kind: "runners" }, () => {
+ b.stagger(0.2);
+ for (const [i, g] of [-1, 1].entries()) {
+ b.stage(kit.k(`dv${i}`), [g * 160, 8, 0], [0, 0, (g * Math.PI) / 2], [0, 120, 0]);
+ }
+ b.then(0.15);
+ for (const d of dv) kit.fit(runnerDef(runLen), d.run.run, 0.2);
+ b.then(0.1);
+ for (const d of dv) kit.fit(SMALL_SCREW, d.run.screws, 0.08);
+ });
+ const flip: Vec3 = [Math.PI, 0, 0];
+ const pivot: Vec3 = [0, legH + topT / 2, 0];
+ const backBolts = kit.pts("top", [0, 1, 0], [-W * 0.3, 0, W * 0.3].map((x): Vec3 => [x, legH, zBoard]), "board", { mateHole: 4 });
+ const sideBolts = [-1, 1].flatMap((g) => kit.pts("top", [0, 1, 0], [-100, 0, 100].map((z): Vec3 => [g * xr, legH, z]), g < 0 ? "fL" : "fR", { mateHole: 4 }));
+ kit.step({ title: "Screw the long cam bolts into the top", detail: "Lay the top upside down on a rug. Three along the back edge.", tools: ["screwdriver"], scene: "top", kind: "cams", warnings: ["floor", "face"] }, () => {
+ kit.stage(["top"], pivot, flip, [0, topT / 2, 0], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(CAM_BOLT, backBolts, 0.1);
+ });
+ kit.step({ title: "Screw in the other cam bolts", detail: "Ten more: three near each end and two for each divider.", tools: ["screwdriver"], scene: "top", kind: "cams" }, () => kit.fit(TOP_BOLT, [...sideBolts, ...dv.flatMap((d) => d.bolts)], 0.06));
+ kit.step({ title: "Stand the dividers on the top", detail: "Two dowels for each, runners facing out towards the ends.", tools: ["hammer"], scene: "top", kind: "join" }, () => {
+ kit.fit(DOWEL, dv.flatMap((d) => d.dowels), 0.08);
+ b.then(0.15);
+ kit.stage(["dv0", "dv1"], pivot, flip, [0, topT / 2, 0], [0, 220, 0]);
+ });
+ kit.step({ title: "Lock the dividers", detail: "Two cam locks each, from the middle. Then turn the top back over.", tools: ["screwdriver"], scene: "top", kind: "cams" }, () => kit.fit(CAM, dv.flatMap((d) => d.cams), 0.1));
+ const knobs = [0, 1].map((i) => {
+ const g = i ? 1 : -1;
+ return {
+ knob: kit.pts(`po${i}`, [-g, 0, 0], [[g * (px + 20), my, mz]], undefined, { hole: false }),
+ rod: kit.pts(`po${i}`, [-g, 0, 0], [[g * (px + 20), my, mz]], "mirror", { mateHole: 3 }),
+ bush: kit.pts(`po${i}`, [-g, 0, 0], [[g * (R + 10), my, mz]], undefined, { hole: false }),
+ };
+ });
+ const mpivot: Vec3 = [0, my, mz];
+ kit.step({ title: "Put the mirror knobs through the posts", detail: "A washer on each threaded rod, then push it through the hole near the top of each post and screw on the knob.", tools: [], scene: "mirror", kind: "general" }, () => {
+ kit.stage(["po0", "po1"], mpivot, [0, 0, 0], [0, 0, 0], [0, 160, 0]);
+ b.then(0.15);
+ for (const k of knobs) {
+ kit.fit(WASHER, k.knob, 0.1);
+ kit.fit(MIRROR_ROD, k.rod, 0.1);
+ kit.fit(MIRROR_KNOB, k.knob, 0.15);
+ }
+ });
+ kit.step({ title: "Hang the mirror between the posts", detail: "A pivot bush on each rod, then screw the rods into the sides of the mirror frame. Not too tight, so it can tilt.", tools: [], scene: "mirror", kind: "general" }, () => {
+ for (const k of knobs) kit.fit(BUSH, k.bush, 0.12);
+ b.then(0.15);
+ kit.stage(["mirror"], mpivot, [0, 0, 0], [0, 0, 0], [0, 0, 260]);
+ });
+ kit.step({ title: "Tap a dowel into each post", detail: "Into the bottom end.", tools: ["hammer"], scene: "mirror", kind: "dowels" }, () =>
+ kit.fit(DOWEL, [0, 1].flatMap((i) => kit.pts(`po${i}`, [0, 1, 0], [[(i ? 1 : -1) * px, legH + topT, mz + 12]], "top")), 0.1),
+ );
+ const top = ["top", "dv0", "dv1"];
+ const mir = ["po0", "po1", "mirror"];
+ kit.step({ title: "Bolt the mirror onto the top", detail: "Two people. Stand the posts on their dowels at the back of the top, then a washer and a bolt up through the top into each post.", tools: ["allen"], scene: "top", kind: "join", people: 2 }, () => {
+ b.stagger(0);
+ kit.stage(top, [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 80, 0]);
+ b.then(0.2);
+ kit.stage(mir, [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 240, 0]);
+ b.then(0.15);
+ const pts = [0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [[(i ? 1 : -1) * px, legH, mz]], `po${i}`));
+ kit.fit(WASHER, pts.map((p) => ({ ...p, mate: undefined, hole: false })), 0.1);
+ kit.fit(MIRROR_BOLT, pts, 0.12);
+ });
+ const frameCams = [...fl.topCams, ...fr.topCams, ...kit.pts("board", [0, 0, -1], [-W * 0.3, 0, W * 0.3].map((x): Vec3 => [x, legH - 25, zBf]))];
+ kit.step({ title: "Press the cam locks into the frame", detail: "Nine of them: three in each top rail and three in the back board, open side up.", kind: "cams" }, () => kit.fit(CAM, frameCams, 0.06));
+ kit.step({ title: "Lower the top on", detail: "Two people, one at each end. The bolts drop into the cam locks and the thick dowels into the top.", kind: "join", people: 2 }, () => {
+ b.stagger(0);
+ kit.add([...top, ...mir], [0, 300, 0]);
+ });
+ kit.step({ title: "Screw the top on through the side rails", detail: "Two screws up through each top rail.", tools: ["screwdriver"], kind: "screws" }, () =>
+ kit.fit(RAIL_SCREW, [-1, 1].flatMap((g) => kit.pts(g < 0 ? "fL" : "fR", [0, 1, 0], [-60, 60].map((z): Vec3 => [g * xr, legH - 40, z]), "top")), 0.12),
+ );
+ kit.step({ title: "Lock the nine cam locks", detail: "Arrow towards the bolt, then turn each one clockwise.", tools: ["screwdriver"], kind: "cams" });
+ kit.step({ title: "Slide in the drawers", detail: "Rest them on the runners and push them in, then a stop screw into the front of each runner so they can't come right out.", tools: ["screwdriver"], kind: "drawer" }, () => {
+ for (const [i, d] of drawers.entries()) {
+ b.stagger(0);
+ kit.add(d.parts, [0, 0, 460]);
+ if (i > 0) for (const [def, l] of allFits(d)) kit.preset(def, l);
+ b.wait(0.2);
+ }
+ b.then(0.15);
+ kit.fit(STOP_SCREW, [...fl.run.stop, ...fr.run.stop, ...dv.flatMap((d) => d.run.stop)], 0.1);
+ });
+ const padPts = [-1, 1].flatMap((g) => [zf - 30, 30, -130].flatMap((z) => (z === 30 ? [] : [[g * (W / 2 - 40), legH + topT, z] as Vec3]))).concat([-1, 1].flatMap((g) => [[g * (W / 4), legH + topT, zf - 30] as Vec3, [g * (W / 4), legH + topT, -130] as Vec3]));
+ kit.step({ title: "Stick the felt pads on the top", detail: "Eight of them, near the edges where the glass will rest.", kind: "general" }, () => kit.fit(PAD, kit.pts("top", [0, -1, 0], padPts, undefined, { hole: false }), 0.06));
+ kit.step({ title: "Lay the glass top on", detail: "Two people. In front of the mirror posts, onto the pads.", kind: "join", people: 2 }, () => kit.add(["glass"], [0, 200, 0]));
+ kit.step({ title: "Fit the glass holders", detail: "Three of them over the back edge of the top, so the glass can't slide back.", kind: "general" }, () =>
+ kit.fit(GLASS_CLIP, kit.pts("top", [0, 0, 1], [-W * 0.3, 0, W * 0.3].map((x): Vec3 => [x, legH + topT / 2, -D / 2]), undefined, { hole: false }), 0.12),
+ );
+ return true;
+}
+
+/* ---------- dressing table with mirror 100 x 50 ---------- */
+
+const CROSS_DOWEL: HwDef = { kind: "nut", len: 30, dia: 10, name: "Cross dowel" };
+const LEG_ROD: HwDef = { kind: "stud", len: 80, dia: 8, name: "Threaded rod" };
+const LEG_NUT: HwDef = { kind: "nut", len: 7, dia: 10 };
+const LEG_WASHER: HwDef = { kind: "washer", len: 2, dia: 20 };
+const CORNER: HwDef = { kind: "angle", len: 80, dia: 40, name: "Corner bracket" };
+const CORNER_SCREW: HwDef = { kind: "screw", len: 16, dia: 4.5 };
+const RUNNER_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+const SMALL_DOWEL: HwDef = { kind: "dowel", len: 25, dia: 6 };
+const WING_SCREW: HwDef = { kind: "screw", len: 70, dia: 4.5 };
+const BACK_SCREW: HwDef = { kind: "screw", len: 40, dia: 4 };
+const BOX_BOLT: HwDef = { kind: "bolt", len: 50, dia: 6 };
+const BOX_NUT: HwDef = { kind: "nut", len: 5, dia: 6 };
+const BOX_WASHER: HwDef = { kind: "washer", len: 1.5, dia: 16 };
+const BARREL_NUT: HwDef = { kind: "nut", len: 14, dia: 10, name: "Barrel nut" };
+const PIVOT_BOLT: HwDef = { kind: "bolt", len: 80, dia: 6 };
+const PIVOT_WASHER: HwDef = { kind: "washer", len: 2, dia: 18, name: "Plastic washer" };
+const STRAP: HwDef = { kind: "strap", len: 160, dia: 25 };
+const STRAP_SCREW: HwDef = { kind: "screw", len: 13, dia: 4.2 };
+const WALL_SCREW: HwDef = { kind: "screw", len: 50, dia: 5, notIncluded: true };
+const WALL_PLUG: HwDef = HW.plug;
+
+/** A flat shape standing upright, facing the front: outline as [x, y] corners from its centre. */
+function upright(outline: [number, number][], t: number, material: PartMaterial, round = 0): PartPiece {
+ const xs = outline.map((p) => p[0]), ys = outline.map((p) => p[1]);
+ return { shape: "slab", size: [Math.max(...xs) - Math.min(...xs), t, Math.max(...ys) - Math.min(...ys)], pos: [0, 0, 0], rot: [-Math.PI / 2, 0, 0], outline: outline.map(([x, y]) => [x, y]), round, material };
+}
+const ellipse = (rx: number, ry: number, n = 28): [number, number][] => range(n).map((i) => [Math.round(rx * Math.cos((2 * Math.PI * i) / n)), Math.round(ry * Math.sin((2 * Math.PI * i) / n))]);
+
+/*
+ * The 100 dressing table is built upside down: the top lies face down on a rug with its cam bolts, the apron boards
+ * stand on it on dowels and lock, four corner brackets screw into the corners, the two runner boards go in, and each
+ * leg (cross dowel and threaded rod) bolts through a bracket with a washer and nut. Turned over, the glass lies on
+ * the top, two little boxes bolt through it, and the mirror stands between two shaped side pieces joined by the back
+ * board; it pivots on two bolts. A strap holds it to the wall. The big drawer is built on its front, with two
+ * dividers inside, and slides in on its runners; the two little drawers come ready made and only take a knob.
+ */
+function dressing100(b: PlanBuilder, s: ProductSpec) {
+ const kit = new Kit(b);
+ const W = s.size.w * 10, D = s.size.d * 10, H = s.size.h * 10;
+ const topT = 18, glassT = 4, yT = 728, yG = yT + topT; // underside of the top, top of the wooden top
+ const yS = yG + glassT; // the surface
+ const t = 18, ah = 120, yA = yT - ah;
+ const xa = W / 2 - 30, za = D / 2 - 30; // outer faces of the apron
+ const op = Math.round(W * 0.37); // half the drawer opening
+ kit.part("top", "Top", [W, topT, D], [0, yT + topT / 2, 0]);
+ kit.part("glass", "Glass top", [W, glassT, D], [0, yG + glassT / 2, 0], { material: "glass" });
+ const endW = xa - op;
+ kit.part("af", "Front apron", [2 * xa, ah, t], [0, yA + ah / 2, za - t / 2], {
+ pieces: [
+ { shape: "box", size: [endW, ah, t], pos: [-(op + endW / 2), 0, 0] },
+ { shape: "box", size: [endW, ah, t], pos: [op + endW / 2, 0, 0] },
+ { shape: "box", size: [2 * op, 16, t], pos: [0, ah / 2 - 8, 0] },
+ ],
+ });
+ kit.part("ab", "Back apron", [2 * xa, ah, t], [0, yA + ah / 2, -za + t / 2]);
+ for (const [i, g] of [-1, 1].entries()) kit.part(`as${i}`, "Side apron", [t, ah, 2 * (za - t)], [g * (xa - t / 2), yA + ah / 2, 0]);
+ const xb = op + 8;
+ for (const [i, g] of [-1, 1].entries()) kit.part(`rb${i}`, "Runner board", [16, 100, 2 * (za - t)], [g * xb, yT - 50, 0]);
+ // legs: a straight block in the corner, a knee that swells out and a slim lower leg that kicks out to the foot
+ const legTop = yT - 38, P = 50;
+ const lx = xa - t - P / 2, lz = za - t - P / 2;
+ [[-1, -1], [1, -1], [-1, 1], [1, 1]].forEach(([gx, gz], i) => {
+ const c = legTop / 2;
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [P, 160, P], pos: [0, legTop - 80 - c, 0], material: "board" },
+ { shape: "box", size: [44, 250, 44], pos: [gx * 7, legTop - 160 - 115 - c, gz * 7], rot: [-gz * 0.05, 0, gx * 0.05], material: "board" },
+ { shape: "box", size: [36, 300, 36], pos: [gx * 6, 150 - c, gz * 6], rot: [gz * 0.04, 0, -gx * 0.04], material: "board" },
+ ];
+ kit.part(`leg${i}`, "Leg", [P + 20, legTop, P + 20], [gx * lx, c, gz * lz], { pieces });
+ });
+ const legs = range(4).map((i) => `leg${i}`);
+ const corners = [[-1, -1], [1, -1], [-1, 1], [1, 1]];
+ // the mirror stand at the back of the top
+ const mh = Math.round((H - yS) * 0.8), mw = Math.round(mh * 0.62);
+ const my = H - 30 - mh / 2, mz = -D / 2 + 40;
+ const xw = mw / 2 + 15; // inner edge of each side piece
+ const wingW = Math.round(W * 0.19);
+ const wingH = H - yS;
+ for (const [i, g] of [-1, 1].entries()) {
+ const o: [number, number][] = [[0, -wingH / 2], [g * wingW, -wingH / 2], [g * wingW, -wingH / 2 + 60], [g * 50, wingH / 2 - 120], [g * 50, wingH / 2], [0, wingH / 2]];
+ const cx = g * wingW / 2;
+ kit.part(`w${i}`, "Mirror side", [wingW, wingH, 18], [g * xw + cx, yS + wingH / 2, mz], { pieces: [upright(o.map(([x, y]) => [x - cx, y]), 18, "board", 12)] });
+ }
+ kit.part("bb", "Back board", [2 * xw, 120, 18], [0, yS + 60, mz]);
+ kit.part("mirror", "Mirror", [mw, mh, 24], [0, my, mz], { pieces: [upright(ellipse(mw / 2, mh / 2), 22, "board"), { ...upright(ellipse(mw / 2 - 35, mh / 2 - 35), 24, "glass"), pos: [0, 0, 0] }] });
+ const bx = xw + wingW / 2, bw = wingW - 30, bh = 110, bd = 190, bz = mz + 9 + bd / 2;
+ for (const [i, g] of [-1, 1].entries()) {
+ kit.part(`bx${i}`, "Small box", [bw, bh, bd], [g * bx, yS + bh / 2, bz], {
+ pieces: [
+ { shape: "box", size: [bw, 10, bd], pos: [0, -bh / 2 + 5, 0] },
+ { shape: "box", size: [bw, 10, bd], pos: [0, bh / 2 - 5, 0] },
+ { shape: "box", size: [10, bh - 20, bd], pos: [-bw / 2 + 5, 0, 0] },
+ { shape: "box", size: [10, bh - 20, bd], pos: [bw / 2 - 5, 0, 0] },
+ { shape: "box", size: [bw - 20, bh - 20, 8], pos: [0, 0, -bd / 2 + 4] },
+ ],
+ });
+ kit.part(`sd${i}`, "Small drawer", [bw - 24, bh - 24, bd - 12], [g * bx, yS + bh / 2, bz + 6]);
+ }
+ // the big drawer
+ const ft = 18, st = 14, dz = za - ft; // inside face of its front
+ const xs = op - 12 - st / 2, sh = 80, ys = yA + 10, dl = 2 * (za - t) - 20;
+ kit.part("df", "Drawer front", [2 * op - 4, ah - 20, ft], [0, yA + (ah - 20) / 2 + 2, za - ft / 2]);
+ for (const [i, g] of [-1, 1].entries()) kit.part(`ds${i}`, "Drawer side", [st, sh, dl], [g * xs, ys + sh / 2, dz - dl / 2]);
+ kit.part("dbt", "Drawer bottom", [2 * xs, 4, dl - 20], [0, ys + 8, dz - dl / 2 + 6], { material: "fiber" });
+ for (const [i, g] of [-1, 1].entries()) kit.part(`dd${i}`, "Drawer divider", [12, sh - 16, dl - st], [g * xs * 0.34, ys + 16 + (sh - 16) / 2, dz - (dl - st) / 2]);
+ kit.part("dbk", "Drawer back", [2 * xs + st, sh, st], [0, ys + sh / 2, dz - dl - st / 2]);
+ const drawer = ["df", "ds0", "ds1", "dbt", "dd0", "dd1", "dbk"];
+
+ // fittings
+ const apronBolts = [
+ ...kit.pts("top", [0, 1, 0], [-xa + endW / 2, 0, xa - endW / 2].map((x): Vec3 => [x, yT, za - t / 2]), "af", { mateHole: 4 }),
+ ...kit.pts("top", [0, 1, 0], [-xa * 0.6, xa * 0.6].map((x): Vec3 => [x, yT, -za + t / 2]), "ab", { mateHole: 4 }),
+ ...[0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [-za * 0.5, za * 0.5].map((z): Vec3 => [(i ? 1 : -1) * (xa - t / 2), yT, z]), `as${i}`, { mateHole: 4 })),
+ ];
+ const boardBolts = [0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [-za * 0.6, 0, za * 0.6].map((z): Vec3 => [(i ? 1 : -1) * xb, yT, z]), `rb${i}`, { mateHole: 4 }));
+ const apronDowels = [
+ ...kit.pts("top", [0, 1, 0], [-xa + 30, -op - 30, op + 30, xa - 30].map((x): Vec3 => [x, yT, za - t / 2]), "af"),
+ ...kit.pts("top", [0, 1, 0], spread(-xa + 60, xa - 60, 4).map((x): Vec3 => [x, yT, -za + t / 2]), "ab"),
+ ...[0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [-za * 0.75, za * 0.75].map((z): Vec3 => [(i ? 1 : -1) * (xa - t / 2), yT, z]), `as${i}`)),
+ ];
+ const camAt = (on: string, p: Vec3, dir: Vec3) => kit.pts(on, dir, [p]);
+ const apronCams = [
+ ...[-xa + endW / 2, 0, xa - endW / 2].flatMap((x) => camAt("af", [x, yT - 25, za - t], [0, 0, 1])),
+ ...[-xa * 0.6, xa * 0.6].flatMap((x) => camAt("ab", [x, yT - 25, -za + t], [0, 0, -1])),
+ ...[0, 1].flatMap((i) => [-za * 0.5, za * 0.5].flatMap((z) => camAt(`as${i}`, [(i ? 1 : -1) * (xa - t), yT - 25, z], [i ? 1 : -1, 0, 0]))),
+ ];
+ const boardDowels = [0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [-za * 0.8, za * 0.8].map((z): Vec3 => [(i ? 1 : -1) * xb, yT, z]), `rb${i}`));
+ const boardCams = [0, 1].flatMap((i) => [-za * 0.6, 0, za * 0.6].flatMap((z) => camAt(`rb${i}`, [(i ? 1 : -1) * (xb + 8), yT - 25, z], [i ? -1 : 1, 0, 0])));
+ const yC = legTop + 8;
+ const brackets = corners.flatMap(([gx, gz]) => kit.pts(gz > 0 ? "af" : "ab", [0, 1, 0], [[gx * (lx - 10), yC, gz * (lz - 10)]], undefined, { hole: false }));
+ const cornerScrews = corners.flatMap(([gx, gz]) => [
+ ...kit.pts(gz > 0 ? "af" : "ab", [0, 0, gz], [-14, 14].map((dy): Vec3 => [gx * (lx - 40), yC + dy, gz * (za - t)])),
+ ...kit.pts(`as${gx < 0 ? 0 : 1}`, [gx, 0, 0], [-14, 14].map((dy): Vec3 => [gx * (xa - t), yC + dy, gz * (lz - 40)])),
+ ].map((o) => ({ ...o, mate: undefined })));
+ const rods = legs.map((l, i) => kit.pts(l, [0, -1, 0], [[corners[i][0] * lx, legTop, corners[i][1] * lz]])[0]);
+ const cross = legs.map((l, i) => kit.pts(l, [corners[i][0], 0, 0], [[corners[i][0] * (lx - P / 2), legTop - 40, corners[i][1] * lz]])[0]);
+ const nutsAt = legs.map((l, i) => kit.pts(l, [0, -1, 0], [[corners[i][0] * lx, yC + 6, corners[i][1] * lz]], undefined, { hole: false })[0]);
+ const runBoard = [0, 1].map((i) => kit.pts(`rb${i}`, [i ? 1 : -1, 0, 0], [[(i ? 1 : -1) * (xb - 8), ys + 30, -10]], undefined, { hole: false }));
+ const runBoardScrews = [0, 1].flatMap((i) => kit.pts(`rb${i}`, [i ? 1 : -1, 0, 0], [-za * 0.6, za * 0.6].map((z): Vec3 => [(i ? 1 : -1) * (xb - 10), ys + 30, z])));
+ const pose = "-y" as const;
+
+ kit.step({ title: "Screw the cam bolts into the top", detail: "Lay the top upside down on a rug. Fifteen bolts, by hand until they stop.", tools: ["screwdriver"], pose, kind: "cams", warnings: ["floor", "face"] }, () => {
+ kit.add(["top"], [0, -160, 0]);
+ b.then(0.15);
+ kit.fit(CAM_BOLT, [...apronBolts, ...boardBolts], 0.05);
+ });
+ kit.step({ title: "Stand the apron on the top", detail: "Twelve dowels into the top, then the front, back and side boards onto them and the bolts. The drawer opening goes at the front.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, apronDowels, 0.05);
+ b.then(0.15);
+ kit.add(["af", "ab", "as0", "as1"], [0, -220, 0]);
+ });
+ kit.step({ title: "Lock the apron", detail: "Nine cam locks, arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, apronCams, 0.08));
+ kit.step({ title: "Screw the corner brackets in", detail: "One in each corner, four screws each.", tools: ["screwdriver"], pose, kind: "screws" }, () => {
+ kit.fit(CORNER, brackets, 0.15);
+ b.then(0.1);
+ kit.fit(CORNER_SCREW, cornerScrews, 0.04);
+ });
+ kit.step({ title: "Stand the runner boards in", detail: "Two dowels for each, either side of the drawer opening.", tools: ["hammer"], pose, kind: "join" }, () => {
+ kit.fit(DOWEL, boardDowels, 0.08);
+ b.then(0.15);
+ kit.add(["rb0", "rb1"], [0, -200, 0]);
+ });
+ kit.step({ title: "Lock the runner boards", detail: "Six cam locks.", tools: ["screwdriver"], pose, kind: "cams" }, () => kit.fit(CAM, boardCams, 0.08));
+ kit.step({ title: "Screw the runners to the runner boards", detail: "On the faces towards the opening, marked side to the front. Two screws each.", tools: ["screwdriver"], pose, kind: "runners" }, () => {
+ for (const r of runBoard) kit.fit(runnerDef(dl - 40), r, 0.2);
+ b.then(0.1);
+ kit.fit(RUNNER_SCREW, runBoardScrews, 0.08);
+ });
+ kit.step({ title: "Get the legs ready", detail: "A cross dowel into the side hole of each leg, slot lined up, then screw a threaded rod into the top end until it catches.", tools: ["flathead"], scene: "legs", kind: "legs", repeat: 4 }, () => {
+ kit.stage(["leg0"], [-lx, legTop / 2, -lz], [0, 0, 0], [0, legTop / 2, 0], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(CROSS_DOWEL, [cross[0]], 0.1);
+ kit.fit(LEG_ROD, [rods[0]], 0.1);
+ });
+ kit.step({ title: "Bolt the legs to the brackets", detail: "Push each rod through its bracket, then a washer and a nut, tightened with the spanner. The legs curve outwards.", tools: ["wrench"], pose, kind: "legs" }, () => {
+ b.stagger(0.2);
+ for (const [i, l] of legs.entries()) {
+ b.add(kit.k(l), [0, -260, 0]);
+ if (i) {
+ kit.preset(CROSS_DOWEL, [cross[i]]);
+ kit.preset(LEG_ROD, [rods[i]]);
+ }
+ }
+ b.then(0.15);
+ kit.fit(LEG_WASHER, nutsAt, 0.1);
+ kit.fit(LEG_NUT, nutsAt, 0.1);
+ });
+ kit.step({ title: "Turn it over and lay the glass on", detail: "Two people turn it onto its legs. Lower the glass onto the top, edges flush.", pose: "+y", kind: "join", people: 2 }, () => kit.add(["glass"], [0, 160, 0]));
+ const boxBolts = [0, 1].flatMap((i) => kit.pts(`bx${i}`, [0, -1, 0], [[(i ? 1 : -1) * bx, yS + 10, bz]], "top", { mateHole: 4 }));
+ kit.step({ title: "Bolt the little boxes on", detail: "Set the two boxes at the back of the glass and drop a bolt through the bottom of each.", tools: ["allen"], kind: "join" }, () => {
+ kit.add(["bx0", "bx1"], [0, 180, 0]);
+ b.then(0.15);
+ kit.fit(BOX_BOLT, boxBolts, 0.12);
+ });
+ const under = [0, 1].flatMap((i) => kit.pts("top", [0, 1, 0], [[(i ? 1 : -1) * bx, yT, bz]], undefined, { hole: false }));
+ kit.step({ title: "Tighten the bolts from below", detail: "A washer and a nut on each, with the spanner, holding the bolt with the Allen key.", tools: ["wrench", "allen"], kind: "bolts" }, () => {
+ kit.fit(BOX_WASHER, under, 0.12);
+ kit.fit(BOX_NUT, under, 0.12);
+ });
+ const wingBox = (i: number) => kit.pts(`w${i}`, [0, 0, 1], [-40, 40].map((dx): Vec3 => [(i ? 1 : -1) * bx + dx, yS + 5, mz - 9]), `bx${i}`);
+ kit.step({ title: "Screw on the left mirror side", detail: "It stands behind the left box. Two screws through it into the box.", tools: ["screwdriver"], kind: "screws" }, () => {
+ kit.add(["w0"], [0, 0, -260]);
+ b.then(0.15);
+ kit.fit(WING_SCREW, wingBox(0), 0.12);
+ });
+ kit.step({ title: "Fit the back board", detail: "Four dowels in its ends, then push it into the left side, scalloped edge up.", tools: ["hammer"], kind: "join" }, () => {
+ kit.fit(DOWEL, [-1, 1].flatMap((g) => kit.pts("bb", [-g, 0, 0], [yS + 30, yS + 90].map((y): Vec3 => [g * xw, y, mz]), g < 0 ? "w0" : "w1")), 0.08);
+ b.then(0.15);
+ kit.add(["bb"], [260, 0, 0]);
+ });
+ kit.step({ title: "Screw on the right mirror side", detail: "Onto the dowels, then two screws into the box and two through its edge into the back board.", tools: ["screwdriver"], kind: "screws" }, () => {
+ kit.add(["w1"], [260, 0, 0]);
+ b.then(0.15);
+ kit.fit(WING_SCREW, wingBox(1), 0.12);
+ kit.fit(WING_SCREW, kit.pts("w1", [-1, 0, 0], [yS + 40, yS + 90].map((y): Vec3 => [xw + 60, y, mz]), "bb"), 0.12);
+ });
+ void WALL_SCREW;
+ kit.step({ title: "Lower the mirror between the sides", detail: "It rests on the peg in the middle of the back board while you fit the bolts.", kind: "join" }, () => kit.add(["mirror"], [0, 300, 0]));
+ const piv = [0, 1].map((i) => {
+ const g = i ? 1 : -1;
+ return {
+ nut: kit.pts("mirror", [0, 0, 1], [[g * (mw / 2 - 20), my, mz - 12]]),
+ bolt: kit.pts(`w${i}`, [-g, 0, 0], [[g * (xw + 50), my, mz]], "mirror", { mateHole: 3 }),
+ washers: kit.pts(`w${i}`, [-g, 0, 0], [g * (xw + 50), g * (xw - 4), g * (xw - 10)].map((x): Vec3 => [x, my, mz]), undefined, { hole: false }),
+ };
+ });
+ kit.step({ title: "Bolt the mirror in place", detail: "Two people. A barrel nut into each side of the mirror frame, then a bolt through each side piece with three washers: one under the head, two between the side and the mirror.", tools: ["allen", "flathead"], kind: "bolts", people: 2 }, () => {
+ for (const p of piv) kit.fit(BARREL_NUT, p.nut, 0.12);
+ b.then(0.1);
+ for (const p of piv) {
+ kit.fit(PIVOT_WASHER, p.washers, 0.08);
+ kit.fit(PIVOT_BOLT, p.bolt, 0.12);
+ }
+ });
+ kit.step({ title: "Fix it to the wall", detail: "Screw the strap to the back of the back board, mark the wall, drill and screw it on. Wall screws and plugs aren't included: use ones made for your wall.", tools: ["screwdriver", "drill", "pencil"], kind: "anchor", wall: true, warnings: ["wall", "tip"] }, () => {
+ kit.fit(STRAP, kit.pts("bb", [0, 0, 1], [[0, yS + 80, mz - 9]], undefined, { hole: false }));
+ kit.fit(STRAP_SCREW, kit.pts("bb", [0, 0, 1], [[0, yS + 70, mz - 9]]));
+ kit.fit(WALL_PLUG, kit.pts(undefined, [0, 0, 1], [[0, yS + 150, -D / 2 - 40]]));
+ kit.fit(WALL_SCREW, kit.pts(undefined, [0, 0, 1], [[0, yS + 150, -D / 2 - 30]]));
+ });
+ // the big drawer, on its front
+ const c: Vec3 = [0, ys + sh / 2, dz - dl / 2];
+ const ds = (k: string, from?: Vec3) => {
+ const it = b.partItem(kit.k(k));
+ b.stage(kit.k(k), [it.final.pos[0] - c[0], it.final.pos[1] - c[1], it.final.pos[2] - c[2]], it.final.rot, from);
+ };
+ const dstep = (o: StepOpts, body: () => void) => kit.step({ scene: "drawer", pose: "-z", kind: "drawer", ...o }, body);
+ const per = (fn: (g: number, i: number) => FitOpts[]) => [...fn(-1, 0), ...fn(1, 1)];
+ dstep({ title: "Screw the cam bolts into the drawer front", detail: "Face down on a rug, with the lip for your fingers at the bottom. Four bolts.", tools: ["screwdriver"], kind: "cams" }, () => {
+ ds("df", [0, 0, -160]);
+ b.then(0.15);
+ kit.fit(DRAWER_BOLT, per((g, i) => kit.pts("df", [0, 0, 1], [ys + 20, ys + sh - 20].map((y): Vec3 => [g * xs, y, dz]), `ds${i}`, { mateHole: 3 })), 0.08);
+ });
+ dstep({ title: "Stand the sides on the front", detail: "Grooves facing in.", kind: "join" }, () => {
+ ds("ds0", [0, 0, -260]);
+ ds("ds1", [0, 0, -260]);
+ });
+ dstep({ title: "Lock the cam locks", detail: "Four of them.", tools: ["screwdriver"], kind: "cams" }, () => kit.fit(DRAWER_CAM, per((g, i) => kit.pts(`ds${i}`, [g, 0, 0], [ys + 20, ys + sh - 20].map((y): Vec3 => [g * (xs - st / 2), y, dz - 25]))), 0.1));
+ dstep({ title: "Slide in the drawer bottom", detail: "Down the grooves to the front.", kind: "drawer" }, () => ds("dbt", [0, 0, -380]));
+ const ddz = (i: number) => kit.b.partItem(kit.k(`dd${i}`)).final.pos;
+ dstep({ title: "Stand the dividers in", detail: "Two dowels in each end, then push them into the front.", tools: ["hammer"], kind: "join" }, () => {
+ kit.fit(SMALL_DOWEL, [0, 1].flatMap((i) => {
+ const p = ddz(i);
+ return [...kit.pts(`dd${i}`, [0, 0, -1], [[p[0], p[1] - 15, dz], [p[0], p[1] + 15, dz]], "df"), ...kit.pts(`dd${i}`, [0, 0, 1], [[p[0], p[1] - 15, dz - dl + st], [p[0], p[1] + 15, dz - dl + st]], "dbk")];
+ }), 0.06);
+ b.then(0.15);
+ ds("dd0", [0, 0, -260]);
+ ds("dd1", [0, 0, -260]);
+ });
+ dstep({ title: "Lay the drawer back on", detail: "Onto the dividers' dowels, between the sides.", kind: "join" }, () => ds("dbk", [0, 0, -240]));
+ dstep({ title: "Screw the back on", detail: "Two screws through the back into each side.", tools: ["screwdriver"], kind: "screws" }, () =>
+ kit.fit(BACK_SCREW, per((g, i) => kit.pts("dbk", [0, 0, 1], [ys + 25, ys + sh - 25].map((y): Vec3 => [g * xs, y, dz - dl - st]), `ds${i}`)), 0.1),
+ );
+ const runDrawer = per((g, i) => kit.pts(`ds${i}`, [-g, 0, 0], [[g * (xs + st / 2 + 4), ys + 30, dz - dl / 2]], undefined, { hole: false }));
+ dstep({ title: "Screw the runners to the drawer", detail: "One on each side, two screws each.", tools: ["screwdriver"], kind: "runners", pose: "+y" }, () => {
+ kit.fit(runnerDef(dl - 40), runDrawer, 0.2);
+ b.then(0.1);
+ kit.fit(RUNNER_SCREW, per((g, i) => kit.pts(`ds${i}`, [-g, 0, 0], [dz - 40, dz - dl + 40].map((z): Vec3 => [g * (xs + st / 2 + 4), ys + 30, z]))), 0.08);
+ });
+ kit.step({ title: "Slide the drawer in", detail: "Set its runners on the ones under the top and push it in until it closes.", kind: "drawer" }, () => {
+ b.stagger(0);
+ kit.add(drawer, [0, 0, 460]);
+ });
+ kit.step({ title: "Screw the knobs on the little drawers", detail: "They come ready made. The screw goes in from inside.", tools: ["screwdriver"], scene: "small", kind: "screws", repeat: 2 }, () => {
+ kit.stage(["sd0"], [-bx, yS + bh / 2, bz + 6], [0, 0, 0], [0, bh / 2, 0], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(KNOB, kit.pts("sd0", [0, 0, -1], [[-bx, yS + bh / 2, bz + 6 + (bd - 12) / 2]], undefined, { hole: false }), 0.15);
+ kit.fit(KNOB_BOLT, kit.pts("sd0", [0, 0, 1], [[-bx, yS + bh / 2, bz + 6 + (bd - 12) / 2 - 10]]), 0.12);
+ });
+ kit.step({ title: "Slide in the little drawers", detail: "One into each box.", kind: "drawer" }, () => {
+ kit.add(["sd0", "sd1"], [0, 0, 300]);
+ const z = bz + 6 + (bd - 12) / 2;
+ kit.preset(KNOB, kit.pts("sd1", [0, 0, -1], [[bx, yS + bh / 2, z]], undefined, { hole: false }));
+ kit.preset(KNOB_BOLT, kit.pts("sd1", [0, 0, 1], [[bx, yS + bh / 2, z - 10]]));
+ });
+ return true;
+}
+
+/* ---------- desk 155 x 65 ---------- */
+
+const FASTENER: HwDef = { kind: "nail", len: 35, dia: 5, name: "Push-in fastener" };
+const DOWEL_PED: HwDef = { kind: "dowel", len: 40, dia: 8 };
+const DRAWER_DOWEL: HwDef = { kind: "dowel", len: 30, dia: 6 };
+const SCREW_DR: HwDef = { kind: "screw", len: 13, dia: 4 };
+const PED_RUNNER_SCREW: HwDef = { kind: "screw", len: 12, dia: 4.5 };
+const LONG_JOIN_SCREW: HwDef = { kind: "screw", len: 70, dia: 6 };
+const STRIP_SCREW: HwDef = { kind: "screw", len: 50, dia: 4 };
+const UP_SCREW: HwDef = { kind: "screw", len: 60, dia: 5 };
+const TRAY_SCREW: HwDef = { kind: "screw", len: 12, dia: 3.5 };
+const FILE_HOLDER: HwDef = { kind: "clip", len: 30, dia: 16, name: "File rail holder" };
+const FILE_RAIL: HwDef = { kind: "hook", len: 500, dia: 6, name: "File rail" };
+const TRAY_RAIL: HwDef = { kind: "runner", len: 480, dia: 12, name: "Tray rail" };
+const FELT_STRIP: HwDef = { kind: "glide", len: 2, dia: 15, name: "Felt strip" };
+const SHELF_PIN: HwDef = { kind: "pin", len: 16, dia: 5 };
+const DOOR_STOP: HwDef = { kind: "pin", len: 12, dia: 8, name: "Door stop" };
+const CATCH: HwDef = { kind: "plate", len: 40, dia: 20, name: "Door catch" };
+const BUMPER: HwDef = { kind: "glide", len: 3, dia: 10, name: "Bumper" };
+
+/*
+ * Desk 155: two pedestals, each built on its side from two ready-made side frames (legs, rails and a panel): one lies
+ * on a rug, the four cross rails stand in it on dowels and cam locks, the hardboard back slides down the grooves and
+ * the other frame goes on. Between them go the cable shelf with its back board and top strip, and the front rail on
+ * long screws. Runners go in the right pedestal for its two drawers (one with file rails, built on their fronts), the
+ * left one takes a tray on rails, a shelf and a door on two clip hinges. The top goes on with dowels and cam locks.
+ */
+function desk155(b: PlanBuilder, s: ProductSpec) {
+ const kit = new Kit(b);
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const topT = 30, legH = H - topT, P = 45, ov = 10;
+ const zf = D / 2 - ov, zb = -D / 2 + ov; // leg faces
+ const zpf = zf - P / 2, zpb = zb + P / 2;
+ const pw = Math.round(W * 0.26); // pedestal width
+ const xo = W / 2 - ov; // pedestal outer faces
+ const yR0 = 90, yRb = 150, yRt = legH - 80; // bottom rail, top of the bottom rail, underside of the top rail
+ const peds = [-1, 1].map((g) => {
+ const out = g * xo, inn = g * (xo - pw);
+ const lo = Math.min(out, inn), hi = Math.max(out, inn);
+ return { g, lo, hi, cx: (lo + hi) / 2, xa: lo + P / 2, xb: hi - P / 2, ia: lo + P, ib: hi - P };
+ });
+ const frame = (id: string, x: number) => {
+ const len = zpf - zpb - P;
+ kit.part(id, "Side frame", [P, legH, zf - zb], [x, legH / 2, 0], {
+ material: "wood",
+ pieces: [
+ { shape: "box", size: [P, legH, P], pos: [0, 0, zpf], material: "wood" },
+ { shape: "box", size: [P, legH, P], pos: [0, 0, zpb], material: "wood" },
+ { shape: "box", size: [30, 80, len], pos: [0, legH - 40 - legH / 2, 0], material: "wood" },
+ { shape: "box", size: [30, yRb - yR0, len], pos: [0, (yR0 + yRb) / 2 - legH / 2, 0], material: "wood" },
+ { shape: "box", size: [14, yRt - yRb, len], pos: [0, (yRt + yRb) / 2 - legH / 2, 0], material: "board" },
+ ],
+ });
+ };
+ for (const [i, p] of peds.entries()) {
+ frame(`p${i}a`, p.xa);
+ frame(`p${i}b`, p.xb);
+ const rw = p.ib - p.ia;
+ kit.part(`p${i}ft`, "Top rail", [rw, 60, 20], [p.cx, legH - 30, zf - 10], { material: "wood" });
+ kit.part(`p${i}fb`, "Bottom rail", [rw, yRb - yR0, 20], [p.cx, (yR0 + yRb) / 2, zf - 10], { material: "wood" });
+ kit.part(`p${i}bt`, "Top rail", [rw, 60, 20], [p.cx, legH - 30, zb + 10], { material: "wood" });
+ kit.part(`p${i}bb`, "Bottom rail", [rw, yRb - yR0, 20], [p.cx, (yR0 + yRb) / 2, zb + 10], { material: "wood" });
+ kit.part(`p${i}bk`, "Back panel", [rw + 10, legH - 60 - yRb, 4], [p.cx, (legH - 60 + yRb) / 2, zb + 24], { material: "fiber" });
+ }
+ const pedParts = (i: number) => [`p${i}a`, `p${i}ft`, `p${i}fb`, `p${i}bt`, `p${i}bb`, `p${i}bk`, `p${i}b`];
+ // between the pedestals
+ const xm = W / 2 - ov - pw; // inner faces of the pedestals
+ const yShelf = legH - 120;
+ kit.part("cs", "Cable shelf", [2 * xm, 16, 220], [0, yShelf, zb + 110]);
+ kit.part("cb", "Back board", [2 * xm, legH - 20 - yShelf - 8, 18], [0, (yShelf + 8 + legH - 20) / 2, zb + 9]);
+ kit.part("st", "Top strip", [2 * xm, 20, 40], [0, legH - 10, zb + 20], { material: "wood" });
+ kit.part("fr", "Front rail", [2 * xm, 60, 20], [0, legH - 30, zf - 10], { material: "wood" });
+ const middle = ["cs", "cb", "st"];
+ kit.part("top", "Top", [W, topT, D], [0, legH + topT / 2, 0], { material: "wood" });
+ // left: door, shelf and tray; right: two drawers
+ const L = peds[0], R = peds[1];
+ const ow = L.ib - L.ia;
+ kit.part("door", "Door", [ow - 4, yRt - yRb - 4, 20], [L.cx, (yRt + yRb) / 2, zf - 10]);
+ kit.part("shelf", "Shelf", [ow - 4, 18, zf - zb - 90], [L.cx, 330, -10]);
+ const tw = ow - 16, td = zf - zb - 110, tyB = yRt - 70, tz = (zf - 20 - 10 + zb + 40) / 2;
+ kit.part("tf", "Tray front", [tw, 60, 14], [L.cx, tyB + 30, tz + td / 2 - 7]);
+ kit.part("tl", "Tray side", [14, 60, td - 28], [L.cx - tw / 2 + 7, tyB + 30, tz]);
+ kit.part("tr", "Tray side", [14, 60, td - 28], [L.cx + tw / 2 - 7, tyB + 30, tz]);
+ kit.part("tk", "Tray back", [tw, 60, 14], [L.cx, tyB + 30, tz - td / 2 + 7]);
+ kit.part("tb", "Tray bottom", [tw - 20, 4, td - 20], [L.cx, tyB + 8, tz], { material: "fiber" });
+ const tray = ["tf", "tl", "tr", "tk", "tb"];
+ const rw2 = R.ib - R.ia;
+ const dSplit = yRb + Math.round((yRt - yRb) * 0.66);
+ type Dr = { id: string; y0: number; fh: number; file: boolean };
+ const drs: Dr[] = [
+ { id: "e0", y0: dSplit, fh: yRt - dSplit - 2, file: false },
+ { id: "e1", y0: yRb + 2, fh: dSplit - yRb - 4, file: true },
+ ];
+ const ft = 20, st = 14, xs = (rw2 - 4) / 2 - 24, dl = zf - ft - (zb + 40), zIn = zf - ft, zc = zIn - dl / 2;
+ for (const d of drs) {
+ const sh = d.fh - 34, ys = d.y0 + 14;
+ kit.part(`${d.id}f`, "Drawer front", [rw2 - 4, d.fh, ft], [R.cx, d.y0 + d.fh / 2, zf - ft / 2]);
+ kit.part(`${d.id}l`, "Drawer side", [st, sh, dl], [R.cx - xs, ys + sh / 2, zc]);
+ kit.part(`${d.id}r`, "Drawer side", [st, sh, dl], [R.cx + xs, ys + sh / 2, zc]);
+ kit.part(`${d.id}b`, "Drawer bottom", [2 * xs, 4, dl - 20], [R.cx, ys + 8, zc + 6], { material: "fiber" });
+ kit.part(`${d.id}k`, "Drawer back", [2 * xs - st, sh - 14, st], [R.cx, ys + 14 + (sh - 14) / 2, zIn - dl + st / 2]);
+ }
+ const drParts = (d: Dr) => ["f", "l", "r", "b", "k"].map((k) => `${d.id}${k}`);
+
+ /* --- the pedestals --- */
+ const pedFits = (i: number) => {
+ const p = peds[i];
+ const rails: [string, number, number][] = [[`p${i}ft`, legH - 30, zf - 10], [`p${i}fb`, (yR0 + yRb) / 2, zf - 10], [`p${i}bt`, legH - 30, zb + 10], [`p${i}bb`, (yR0 + yRb) / 2, zb + 10]];
+ const one = (fr: string, x: number, g: number) => ({
+ bolts: rails.flatMap(([r, y, z]) => kit.pts(fr, [g, 0, 0], [[x, y - 12, z]], r, { mateHole: 4 })),
+ dowels: rails.flatMap(([r, y, z]) => kit.pts(fr, [g, 0, 0], [[x, y + 14, z]], r)),
+ cams: rails.flatMap(([r, y, z]) => kit.pts(r, [0, y > 300 ? 1 : -1, 0], [[x - g * 26, y > 300 ? legH - 60 : yRb, z]])),
+ });
+ return { a: one(`p${i}a`, p.ia, -1), b: one(`p${i}b`, p.ib, 1) };
+ };
+ const pf = [pedFits(0), pedFits(1)];
+ const pedSteps = (i: number) => {
+ const scene = i ? "ped2" : undefined;
+ const put = (ids: string[], from: Vec3) => {
+ if (!scene) return kit.add(ids, from);
+ for (const id of ids) {
+ const it = b.partItem(kit.k(id));
+ b.stage(kit.k(id), it.final.pos, it.final.rot, from);
+ }
+ };
+ const f = pf[i];
+ const pose = "+x" as const;
+ const which = i ? "the second pedestal" : "the first pedestal";
+ kit.step({ title: `Screw the cam bolts into the side frames`, detail: `For ${which}: both frames on a rug, inside up. Four bolts in each.`, tools: ["screwdriver"], pose, scene, kind: "cams", repeat: 2, warnings: ["floor"] }, () => {
+ put([`p${i}a`], [0, 200, 0]);
+ b.then(0.15);
+ kit.fit(CAM_BOLT, f.a.bolts, 0.08);
+ });
+ kit.step({ title: "Tap the dowels into the side frames", detail: "Four in each, next to the bolts.", tools: ["hammer"], pose, scene, kind: "dowels", repeat: 2 }, () => kit.fit(DOWEL_PED, f.a.dowels, 0.08));
+ kit.step({ title: "Stand the four rails in", detail: "One frame stays on the rug. Top and bottom rails at the front and the back; the holes for the cam locks face in.", pose, scene, kind: "join" }, () => {
+ b.stagger(0.18);
+ put([`p${i}ft`, `p${i}fb`, `p${i}bt`, `p${i}bb`], [300, 0, 0]);
+ });
+ kit.step({ title: "Lock the rails", detail: "Four cam locks, arrow towards the bolt.", tools: ["screwdriver"], pose, scene, kind: "cams" }, () => kit.fit(CAM, f.a.cams, 0.1));
+ kit.step({ title: "Slide in the back panel", detail: "Patterned side in, down the grooves in the back legs.", pose, scene, kind: "join" }, () => put([`p${i}bk`], [300, 0, 0]));
+ kit.step({ title: "Lower the other side frame on", detail: "It has its bolts and dowels in. Press it down evenly.", pose, scene, kind: "join" }, () => {
+ put([`p${i}b`], [320, 0, 0]);
+ kit.preset(CAM_BOLT, f.b.bolts);
+ kit.preset(DOWEL_PED, f.b.dowels);
+ });
+ kit.step({ title: "Stand it up and lock the other side", detail: "Four more cam locks.", tools: ["screwdriver"], scene, kind: "cams" }, () => kit.fit(CAM, f.b.cams, 0.1));
+ };
+ pedSteps(0);
+ pedSteps(1);
+
+ /* --- the middle --- */
+ const mscene = "middle";
+ const mstage = (ids: string[], from: Vec3) => {
+ for (const id of ids) {
+ const it = b.partItem(kit.k(id));
+ b.stage(kit.k(id), it.final.pos, it.final.rot, from);
+ }
+ };
+ const xb2 = [-xm * 0.6, xm * 0.6];
+ kit.step({ title: "Screw two cam bolts into the cable shelf", detail: "Lay it flat, holes up.", tools: ["screwdriver"], scene: mscene, kind: "cams" }, () => {
+ mstage(["cs"], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(CAM_BOLT, kit.pts("cs", [0, -1, 0], xb2.map((x): Vec3 => [x, yShelf + 8, zb + 9]), "cb", { mateHole: 4 }), 0.1);
+ });
+ kit.step({ title: "Stand the back board on the shelf", detail: "Three dowels into the shelf, then the board onto them and the bolts.", tools: ["hammer"], scene: mscene, kind: "join" }, () => {
+ kit.fit(DOWEL_PED, kit.pts("cs", [0, -1, 0], [-xm * 0.85, 0, xm * 0.85].map((x): Vec3 => [x, yShelf + 8, zb + 9]), "cb"), 0.08);
+ b.then(0.15);
+ mstage(["cb"], [0, 200, 0]);
+ });
+ kit.step({ title: "Lock the back board", detail: "Two cam locks.", tools: ["screwdriver"], scene: mscene, kind: "cams" }, () =>
+ kit.fit(CAM, kit.pts("cb", [0, 0, -1], xb2.map((x): Vec3 => [x, yShelf + 30, zb + 18])), 0.1),
+ );
+ kit.step({ title: "Put the top strip on", detail: "Two small dowels in its underside, then onto the top edge of the board.", tools: ["hammer"], scene: mscene, kind: "join" }, () => {
+ kit.fit(SMALL_DOWEL, kit.pts("st", [0, 1, 0], xb2.map((x): Vec3 => [x, legH - 20, zb + 9]), "cb"), 0.1);
+ b.then(0.15);
+ mstage(["st"], [0, 160, 0]);
+ });
+ kit.step({ title: "Screw the strip down", detail: "Two screws through the strip into the board.", tools: ["screwdriver"], scene: mscene, kind: "screws" }, () =>
+ kit.fit(STRIP_SCREW, kit.pts("st", [0, -1, 0], [-xm * 0.3, xm * 0.3].map((x): Vec3 => [x, legH, zb + 9]), "cb"), 0.12),
+ );
+ // the right pedestal waits beside the left one
+ const sideOff: Vec3 = [520, 0, 0];
+ const midJoin = (g: number) => {
+ const fr0 = g < 0 ? "p0b" : "p1a";
+ const x = g * xm;
+ return {
+ bolts: [...kit.pts(fr0, [g, 0, 0], xb2.map((z, k): Vec3 => [x, yShelf, zb + 60 + k * 120]), "cs", { mateHole: 4 }), ...kit.pts(fr0, [g, 0, 0], [[x, yShelf + 40, zb + 9]], "cb", { mateHole: 4 })],
+ dowels: [...kit.pts(fr0, [g, 0, 0], [[x, yShelf, zb + 120]], "cs"), ...kit.pts(fr0, [g, 0, 0], [[x, yShelf + 60, zb + 9]], "cb")],
+ cams: [...kit.pts("cs", [0, -1, 0], [0, 1].map((k): Vec3 => [x - g * 26, yShelf + 8, zb + 60 + k * 120])), ...kit.pts("cb", [0, 0, -1], [[x - g * 26, yShelf + 40, zb + 18]])],
+ railDowel: kit.pts("fr", [-g, 0, 0], [[x, legH - 30, zf - 10]], fr0),
+ railScrews: kit.pts(fr0, [-g, 0, 0], [legH - 45, legH - 15].map((y): Vec3 => [x + g * P, y, zf - 10]), "fr"),
+ };
+ };
+ const mj = [midJoin(-1), midJoin(1)];
+ kit.step({ title: "Screw cam bolts into the left pedestal", detail: "Three into the inner side, for the shelf and the back board. Stand the right pedestal next to it.", tools: ["screwdriver"], kind: "cams" }, () => {
+ for (const id of pedParts(1)) {
+ const it = b.partItem(kit.k(id));
+ b.stage(kit.k(id), [it.final.pos[0] + sideOff[0], it.final.pos[1], it.final.pos[2]], it.final.rot, [0, 0, 300]);
+ }
+ b.then(0.15);
+ kit.fit(CAM_BOLT, [...mj[0].bolts, ...mj[1].bolts], 0.08);
+ });
+ kit.step({ title: "Tap dowels into the right pedestal", detail: "Two into its inner side. Four in all, two on each pedestal.", tools: ["hammer"], kind: "dowels" }, () => kit.fit(DOWEL_PED, [...mj[0].dowels, ...mj[1].dowels], 0.08));
+ kit.step({ title: "Tap a dowel into each end of the front rail", detail: "The small dowels.", tools: ["hammer"], scene: "rail", kind: "dowels" }, () => {
+ mstage(["fr"], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(SMALL_DOWEL, [...mj[0].railDowel, ...mj[1].railDowel], 0.1);
+ });
+ kit.step({ title: "Join the pedestals", detail: "Slide the shelf unit and the front rail between them and push the right pedestal on. Two long screws through each front leg into the rail.", tools: ["allen"], kind: "join", people: 2 }, () => {
+ b.stagger(0.1);
+ kit.add([...middle, "fr"], [300, 0, 0]);
+ b.then(0.15);
+ b.stagger(0);
+ kit.add(pedParts(1), sideOff.map((v) => v * 0.6) as Vec3);
+ b.then(0.2);
+ kit.fit(LONG_JOIN_SCREW, [...mj[0].railScrews, ...mj[1].railScrews], 0.1);
+ });
+ kit.step({ title: "Lock the shelf unit", detail: "Six cam locks, three at each end.", tools: ["screwdriver"], kind: "cams" }, () => kit.fit(CAM, [...mj[0].cams, ...mj[1].cams], 0.1));
+ const runLen = Math.round((dl - 40) / 10) * 10;
+ const pedRun = (fr: string, x: number, g: number) => drs.map((d) => ({
+ run: kit.pts(fr, [g, 0, 0], [[x, d.y0 + 30, zc]], undefined, { hole: false }),
+ screws: kit.pts(fr, [g, 0, 0], [zc - runLen / 2 + 40, zc + runLen / 2 - 40].map((z): Vec3 => [x - g * 4, d.y0 + 30, z])),
+ }));
+ const runR = pedRun("p1b", R.xb - 7, 1), runL = pedRun("p1a", R.xa + 7, -1);
+ kit.step({ title: "Screw the runners into the right side", detail: "The ones marked CR, wheel at the front, two screws each.", tools: ["screwdriver"], kind: "runners" }, () => {
+ for (const r of runR) kit.fit(runnerDef(runLen), r.run, 0.2);
+ b.then(0.1);
+ kit.fit(PED_RUNNER_SCREW, runR.flatMap((r) => r.screws), 0.08);
+ });
+ kit.step({ title: "Screw the runners into the left side", detail: "The ones marked CL, the same way.", tools: ["screwdriver"], kind: "runners" }, () => {
+ for (const r of runL) kit.fit(runnerDef(runLen), r.run, 0.2);
+ b.then(0.1);
+ kit.fit(PED_RUNNER_SCREW, runL.flatMap((r) => r.screws), 0.08);
+ });
+
+ /* --- drawers, built on their fronts --- */
+ const drFits = (d: Dr) => {
+ const sh = d.fh - 34, ys = d.y0 + 14;
+ const per = (fn: (g: number, sd: string) => FitOpts[]) => [...fn(-1, `${d.id}l`), ...fn(1, `${d.id}r`)];
+ const ky = d.y0 + d.fh / 2;
+ return {
+ dowels: per((g, sd) => kit.pts(sd, [0, 0, -1], [[R.cx + g * xs, ys + sh / 2, zIn]], `${d.id}f`)),
+ dowels2: per((g, sd) => kit.pts(sd, [0, 0, -1], [[R.cx + g * xs, ys + sh * 0.25, zIn]], `${d.id}f`)),
+ bolts: per((g, sd) => kit.pts(`${d.id}f`, [0, 0, 1], [ys + 18, ys + sh - 18].map((y): Vec3 => [R.cx + g * xs, y, zIn]), sd, { mateHole: 3 })),
+ cams: per((g, sd) => kit.pts(sd, [g, 0, 0], [ys + 18, ys + sh - 18].map((y): Vec3 => [R.cx + g * (xs - st / 2), y, zIn - 25]))),
+ fast: per((g, sd) => kit.pts(sd, [-g, 0, 0], [ys + 25, ys + sh - 25].map((y): Vec3 => [R.cx + g * (xs + st / 2), y, zIn - dl + st / 2]), `${d.id}k`)),
+ run: per((g, sd) => kit.pts(sd, [-g, 0, 0], [[R.cx + g * (xs + st / 2 + 6), d.y0 + 30, zc]], undefined, { hole: false })),
+ runScrews: per((g, sd) => kit.pts(sd, [-g, 0, 0], [zc - runLen / 2 + 40, zc + runLen / 2 - 40].map((z): Vec3 => [R.cx + g * (xs + st / 2 + 8), d.y0 + 30, z]))),
+ knob: kit.pts(`${d.id}f`, [0, 0, -1], [[R.cx, ky, zf]], undefined, { hole: false }),
+ knobBolt: kit.pts(`${d.id}f`, [0, 0, 1], [[R.cx, ky, zIn - 2]]),
+ holders: per((g, sd) => kit.pts(sd, [0, -1, 0], [zIn - 30, zIn - dl + 30].map((z): Vec3 => [R.cx + g * xs, ys + sh, z]), undefined, { hole: false })),
+ rails: [-1, 1].flatMap((k) => kit.pts(`${d.id}l`, [1, 0, 0], [[R.cx, ys + sh + 4, k > 0 ? zIn - 30 : zIn - dl + 30]], undefined, { hole: false })),
+ };
+ };
+ const df = drs.map(drFits);
+ const drawerSteps = (d: Dr, f: ReturnType<typeof drFits>) => {
+ const c: Vec3 = [R.cx, d.y0 + d.fh / 2, zc];
+ const ds = (k: string, from: Vec3) => {
+ const it = b.partItem(kit.k(k));
+ b.stage(kit.k(k), [it.final.pos[0] - c[0], it.final.pos[1] - c[1], it.final.pos[2] - c[2]], it.final.rot, from);
+ };
+ const o = (x: StepOpts, body: () => void) => kit.step({ scene: d.id, pose: "-z", kind: "drawer", ...x }, body);
+ const name = d.file ? "deep drawer" : "shallow drawer";
+ o({ title: `Tap the dowels into the ${name} sides`, detail: "Two in the front end of each side.", tools: ["hammer"], kind: "dowels" }, () => {
+ ds(`${d.id}l`, [0, 0, -300]);
+ ds(`${d.id}r`, [0, 0, -300]);
+ b.then(0.15);
+ kit.fit(DRAWER_DOWEL, [...f.dowels, ...f.dowels2], 0.08);
+ });
+ o({ title: "Screw the cam bolts into the drawer front", detail: "Front face down on a rug. Four bolts.", tools: ["screwdriver"], kind: "cams", warnings: ["floor"] }, () => {
+ ds(`${d.id}f`, [0, 0, -160]);
+ b.then(0.15);
+ kit.fit(DRAWER_BOLT, f.bolts, 0.08);
+ });
+ o({ title: "Stand the sides on the front", detail: "Onto the dowels and bolts, grooves facing in.", kind: "join" }, () => {
+ ds(`${d.id}l`, [0, 0, -200]);
+ ds(`${d.id}r`, [0, 0, -200]);
+ });
+ o({ title: "Lock the cam locks", detail: "Four of them.", tools: ["screwdriver"], kind: "cams" }, () => kit.fit(CAM, f.cams, 0.1));
+ o({ title: "Slide in the drawer bottom", detail: "Down the grooves until it reaches the front.", kind: "drawer" }, () => ds(`${d.id}b`, [0, 0, -380]));
+ o({ title: "Lay the drawer back on", detail: "It sits on the bottom between the sides.", kind: "join" }, () => ds(`${d.id}k`, [0, 0, -240]));
+ o({ title: "Tap in the fasteners", detail: "Two through each side into the back.", tools: ["hammer"], kind: "nails" }, () => kit.fit(FASTENER, f.fast, 0.1));
+ const runs = () => {
+ kit.fit(runnerDef(runLen), f.run, 0.2);
+ b.then(0.1);
+ kit.fit(SCREW_DR, f.runScrews, 0.08);
+ };
+ const knob = () => {
+ kit.fit(KNOB, f.knob, 0.2);
+ b.then(0.05);
+ kit.fit(KNOB_BOLT, f.knobBolt, 0.15);
+ };
+ if (d.file) {
+ o({ title: "Screw the runners to the drawer", detail: "Turn it upright. DL on the left, DR on the right, two screws each.", tools: ["screwdriver"], kind: "runners", pose: "+y" }, runs);
+ o({ title: "Clip in the file rail holders", detail: "Four, on top of the sides at the holes for the paper size you use: letter, A4 or legal.", kind: "general", pose: "+y" }, () => kit.fit(FILE_HOLDER, f.holders, 0.1));
+ o({ title: "Hook in the file rails", detail: "Two wire rails, from holder to holder.", kind: "general", pose: "+y" }, () => kit.fit(FILE_RAIL, f.rails, 0.2));
+ o({ title: "Screw on the knob", detail: "The bolt goes in from inside the drawer.", tools: ["screwdriver"], kind: "screws", pose: "+y" }, knob);
+ } else {
+ o({ title: "Screw on the knob", detail: "The bolt goes in from inside the drawer.", tools: ["screwdriver"], kind: "screws", pose: "+y" }, knob);
+ o({ title: "Screw the runners to the drawer", detail: "Turn it upright. DL on the left, DR on the right, two screws each.", tools: ["screwdriver"], kind: "runners", pose: "+y" }, runs);
+ }
+ };
+ drawerSteps(drs[1], df[1]);
+ drawerSteps(drs[0], df[0]);
+ // the tray
+ const tc: Vec3 = [L.cx, tyB + 30, tz];
+ const ts = (k: string, from: Vec3) => {
+ const it = b.partItem(kit.k(k));
+ b.stage(kit.k(k), [it.final.pos[0] - tc[0], it.final.pos[1] - tc[1], it.final.pos[2] - tc[2]], it.final.rot, from);
+ };
+ const tFast = (part: string, z: number, sgn: number) => [-1, 1].flatMap((g) => kit.pts(part, [0, 0, sgn], [tyB + 15, tyB + 45].map((y): Vec3 => [L.cx + g * (tw / 2 - 7), y, z]), g < 0 ? "tl" : "tr")).slice(0, 4);
+ kit.step({ title: "Nail the tray sides to its front", detail: "Four fasteners through the front into the sides.", tools: ["hammer"], scene: "tray", kind: "nails" }, () => {
+ ts("tf", [0, 160, 0]);
+ ts("tl", [-160, 0, 0]);
+ ts("tr", [160, 0, 0]);
+ b.then(0.15);
+ kit.fit(FASTENER, tFast("tf", tz + td / 2, -1), 0.1);
+ });
+ kit.step({ title: "Slide in the tray bottom and nail on the back", detail: "The bottom runs in the grooves, then four fasteners through the back.", tools: ["hammer"], scene: "tray", kind: "nails" }, () => {
+ ts("tb", [0, 0, -300]);
+ b.then(0.15);
+ ts("tk", [0, 0, -200]);
+ b.then(0.1);
+ kit.fit(FASTENER, tFast("tk", tz - td / 2, 1), 0.1);
+ });
+ const trayRails = [-1, 1].flatMap((g) => kit.pts(g < 0 ? "tl" : "tr", [-g, 0, 0], [[L.cx + g * (tw / 2 + 4), tyB + 20, tz]], undefined, { hole: false }));
+ kit.step({ title: "Screw the rails to the tray", detail: "One along each side, two screws each.", tools: ["screwdriver"], scene: "tray", kind: "runners" }, () => {
+ kit.fit(TRAY_RAIL, trayRails, 0.2);
+ b.then(0.1);
+ kit.fit(TRAY_SCREW, [-1, 1].flatMap((g) => kit.pts(g < 0 ? "tl" : "tr", [-g, 0, 0], [tz - td / 3, tz + td / 3].map((z): Vec3 => [L.cx + g * (tw / 2 + 6), tyB + 20, z]))), 0.08);
+ });
+ kit.step({ title: "Stick on the felt strips", detail: "Cut the felt strip in two and stick one along each rail, so the tray runs quietly.", tools: ["knife"], scene: "tray", kind: "general" }, () =>
+ kit.fit(FELT_STRIP, [-1, 1].flatMap((g) => kit.pts(g < 0 ? "tl" : "tr", [0, 1, 0], [[L.cx + g * (tw / 2 + 4), tyB + 12, tz]], undefined, { hole: false })), 0.15),
+ );
+ // the door side
+ const hy = [yRb + 70, yRt - 70];
+ const plates = kit.pts("p0b", [1, 0, 0], hy.map((y): Vec3 => [L.ib, y, zf - P + 10]), undefined, { hole: false });
+ kit.step({ title: "Screw the hinge plates into the left pedestal", detail: "Lay the desk on its back. Two plates on the inner side, next to the door opening.", tools: ["screwdriver"], pose: "+z", kind: "hinges", people: 2 }, () => kit.fit(HINGE_PLATE, plates, 0.2));
+ kit.step({ title: "Fit the door catch", detail: "Stand the desk up. Screw the catch to the top rail of the left pedestal and stick the bumper on the door side.", tools: ["screwdriver"], kind: "general", people: 2 }, () => {
+ kit.fit(CATCH, kit.pts("p0ft", [0, 0, -1], [[L.cx - ow / 2 + 40, legH - 60, zf - 20]], undefined, { hole: false }));
+ kit.fit(SCREW_DR, kit.pts("p0ft", [0, 1, 0], [-10, 10].map((dx): Vec3 => [L.cx - ow / 2 + 40 + dx, legH - 60, zf - 10])), 0.1);
+ kit.fit(BUMPER, kit.pts("p0a", [-1, 0, 0], [[L.ia, yRt - 30, zf - 20]], undefined, { hole: false }));
+ });
+ const pinPts = [-1, 1].flatMap((g) => [tyB - 2, 312].flatMap((y) => [zf - 80, zb + 80].map((z): Vec3 => [g < 0 ? L.ia : L.ib, y, z])));
+ kit.step({ title: "Push in the shelf pins", detail: "Eight: four near the top for the tray and four where you want the shelf.", kind: "shelves" }, () =>
+ kit.fit(SHELF_PIN, pinPts.map((p) => kit.pts(p[0] === L.ia ? "p0a" : "p0b", [p[0] === L.ia ? -1 : 1, 0, 0], [p])[0]), 0.06),
+ );
+ kit.step({ title: "Slide in the tray and the shelf", detail: "The tray runs on its rails over the top pins; the shelf rests on the lower ones.", kind: "shelves" }, () => {
+ b.stagger(0);
+ kit.add(tray, [0, 0, 420]);
+ b.then(0.2);
+ kit.add(["shelf"], [0, 0, 420]);
+ });
+ kit.step({ title: "Push in the door stop", detail: "One, into the hole in the bottom rail.", kind: "general" }, () => kit.fit(DOOR_STOP, kit.pts("p0fb", [0, -1, 0], [[L.cx + ow / 2 - 30, yRb, zf - 20]])));
+ const hinges = kit.pts("door", [0, 0, 1], hy.map((y): Vec3 => [L.ib - 40, y, zf - 20]), undefined, { hole: false });
+ kit.step({ title: "Screw the hinges onto the door", detail: "Lay the door face down on a rug. Each hinge sits in its round hole; open it out.", tools: ["screwdriver"], scene: "door", pose: "-z", kind: "hinges", warnings: ["floor"] }, () => {
+ const it = b.partItem(kit.k("door"));
+ b.stage(kit.k("door"), it.final.pos, it.final.rot, [0, 0, -160]);
+ b.then(0.15);
+ kit.fit(HINGE, hinges, 0.2);
+ });
+ kit.step({ title: "Click the door onto the plates", detail: "Hook each hinge onto its plate at the front, then press at the back until it clicks.", kind: "doors" }, () => kit.add(["door"], [0, 0, 260]));
+ kit.step({ title: "Screw on the door knob", detail: "The bolt goes in from the inside.", tools: ["screwdriver"], kind: "screws" }, () => {
+ kit.fit(KNOB, kit.pts("door", [0, 0, -1], [[L.ia + 40, (yRt + yRb) / 2, zf]], undefined, { hole: false }), 0.2);
+ kit.fit(KNOB_BOLT, kit.pts("door", [0, 0, 1], [[L.ia + 40, (yRt + yRb) / 2, zf - 22]]), 0.15);
+ });
+
+ /* --- the top --- */
+ const topBolt = (on: string, x: number, z: number) => kit.pts("top", [0, 1, 0], [[x, legH, z]], on, { mateHole: 4 });
+ const sideTops = peds.flatMap((p, i) => [[`p${i}a`, p.xa], [`p${i}b`, p.xb]] as [string, number][]);
+ const bolts12 = [
+ ...sideTops.flatMap(([id, x]) => [zf - 120, zb + 120].flatMap((z) => topBolt(id, x, z))),
+ ...xb2.flatMap((x) => topBolt("fr", x, zf - 10)),
+ ...xb2.flatMap((x) => topBolt("st", x, zb + 20)),
+ ];
+ const cams12 = [
+ ...sideTops.flatMap(([id, x], k) => {
+ const g = k % 2 ? -1 : 1;
+ return [zf - 120, zb + 120].flatMap((z) => kit.pts(id, [g, 0, 0], [[x + g * (P / 2), legH - 25, z]]));
+ }),
+ ...xb2.flatMap((x) => kit.pts("fr", [0, 0, 1], [[x, legH - 25, zf - 20]])),
+ ...xb2.flatMap((x) => kit.pts("st", [0, 0, -1], [[x, legH - 12, zb + 40]])),
+ ];
+ kit.step({ title: "Screw the cam bolts into the top", detail: "Top face down on a rug. Twelve bolts.", tools: ["screwdriver"], scene: "top", kind: "cams", warnings: ["floor", "face"] }, () => {
+ b.stage(kit.k("top"), [0, topT / 2, 0], [Math.PI, 0, 0], [0, 160, 0]);
+ b.then(0.15);
+ kit.fit(TOP_BOLT, bolts12, 0.05);
+ });
+ const legTops = peds.flatMap((p, i) => [[`p${i}a`, p.xa], [`p${i}b`, p.xb]] as [string, number][]).flatMap(([id, x]) => kit.pts(id, [0, -1, 0], [zpf, zpb].map((z): Vec3 => [x, legH, z]), "top"));
+ kit.step({ title: "Tap dowels into the frame", detail: "One in the top of each leg and one in the middle of the top strip.", tools: ["hammer"], kind: "dowels" }, () =>
+ kit.fit(DOWEL_PED, [...legTops, ...kit.pts("st", [0, -1, 0], [[0, legH, zb + 20]], "top")], 0.06),
+ );
+ kit.step({ title: "Press the cam locks into the frame", detail: "Twelve, open side up towards the top.", kind: "cams" }, () => kit.fit(CAM, cams12, 0.05));
+ kit.step({ title: "Lower the top on", detail: "Two people. Onto the dowels, with the bolts into the cam locks.", kind: "join", people: 2 }, () => kit.add(["top"], [0, 300, 0]));
+ kit.step({ title: "Lock the cam locks", detail: "All twelve, arrow towards the bolt.", tools: ["screwdriver"], kind: "cams" });
+ kit.step({ title: "Screw the top to the top strip", detail: "Three long screws up through the strip.", tools: ["screwdriver"], kind: "screws" }, () =>
+ kit.fit(UP_SCREW, kit.pts("st", [0, 1, 0], [-xm * 0.5, 0, xm * 0.5].map((x): Vec3 => [x, legH - 20, zb + 30]), "top"), 0.12),
+ );
+ kit.step({ title: "Slide in the drawers", detail: "Rest each drawer's runners on the ones in the pedestal and push it in: the deep one at the bottom.", kind: "drawer" }, () => {
+ for (const [k, d] of drs.entries()) {
+ b.stagger(0);
+ kit.add(drParts(d), [0, 0, 480]);
+ void k;
+ b.wait(0.2);
+ }
+ });
+ kit.step({ title: "Press in the cable grommet", detail: "Into the hole at the back of the top, over the cable shelf.", kind: "general" }, () =>
+ kit.fit(GROMMET, kit.pts("top", [0, -1, 0], [[-xm * 0.4, H, zb + 110]], undefined, { hole: false })),
+ );
+ return true;
+}
+
+/** HEMNES guides drawn in this file; returns false for any product it doesn't build. Wired in from hemnes.ts. */
+export function hemnesTables(b: PlanBuilder, s: ProductSpec): boolean {
+ switch (s.slug) {
+ case "hemnes-desk-155-x-65":
+ return desk155(b, s);
+ case "hemnes-desk-2-drawers-120-x-47":
+ return desk2(b, s);
+ case "hemnes-dressing-table-mirror-100-x-50":
+ return dressing100(b, s);
+ case "hemnes-dressing-table-mirror-110-x-45":
+ return dressing110(b, s);
+ default:
+ return false;
+ }
+}
diff --git a/src/lib/plan/families/agam.ts b/src/lib/plan/families/agam.ts
new file mode 100644
index 0000000..2b80ad5
--- /dev/null
+++ b/src/lib/plan/families/agam.ts
@@ -0,0 +1,168 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * AGAM junior chair, read from its manual. The backrest comes in one piece (crest rail, two posts and two spindles):
+ * it is pushed into the seat and pressed right down, then held from below with four screws. The base is screwed
+ * together from its round rods: the two front legs with the footrest between them, the two side rails with the
+ * middle rail between them, then the side rails into the front legs and a back leg onto each. The legs are tapped
+ * into the seat with a hammer and four more screws hold them. Every screw takes the Allen key, and the twelve in the
+ * base are tightened again with the chair standing.
+ */
+
+const fx = (at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind: "screw", count: at.length, at, dir, len: 40, dia: 6, ...o });
+const G = [-1, 1] as const;
+const r = (n: number) => Math.round(n);
+
+const LEG = 32, ROD = 26;
+const ST = 25; // seat thickness
+
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, D = s.size.d * 10, H = s.size.h * 10;
+ const yS = 630, yB = yS - ST; // seat top and underside
+ const SW = 350, SD = 340, zS = 20; // seat
+ // legs: tops under the seat, feet splayed out to the footprint
+ const xt = 120, xf = W / 2 - LEG / 2;
+ const zt = { f: zS + 115, b: zS - 115 }, zf = { f: D / 2 - LEG / 2, b: -D / 2 + LEG / 2 };
+ const legAt = (sx: number, end: "f" | "b", y: number): Vec3 => {
+ const k = y / yB;
+ return [sx * (xf + (xt - xf) * k), y, zf[end] + (zt[end] - zf[end]) * k];
+ };
+ const leg = (id: string, sx: number, end: "f" | "b"): CustomPart => {
+ const top = legAt(sx, end, yB), foot = legAt(sx, end, 0);
+ const d: Vec3 = [top[0] - foot[0], top[1] - foot[1], top[2] - foot[2]];
+ const len = Math.hypot(...d);
+ const rot: Vec3 = [Math.atan2(d[2], d[1]), 0, Math.asin(-d[0] / len)];
+ return { id, name: end === "f" ? "Front leg" : "Back leg", shape: "cyl", size: [LEG, r(len), LEG], pos: [r((top[0] + foot[0]) / 2), r(yB / 2), r((top[2] + foot[2]) / 2)], rot, material: "wood" };
+ };
+
+ // the backrest: two posts and two spindles from the seat up to the crest rail, leaning back a little
+ const zBk = zS - SD / 2 + 30, lean = 30, yC = H - 35;
+ const ang = Math.atan2(lean, yC - yS);
+ const rods = [-150, -50, 50, 150];
+ const upLen = Math.hypot(yC - 35 - yS, lean);
+ const backAbs: PartPiece[] = [
+ ...rods.map((x): PartPiece => ({ shape: "cyl", size: [Math.abs(x) > 100 ? 24 : 18, r(upLen + 20), Math.abs(x) > 100 ? 24 : 18], pos: [x, r((yS + yC - 35) / 2), r(zBk - lean / 2)], rot: [-ang, 0, 0] })),
+ { shape: "box", size: [370, 70, 22], pos: [0, yC, zBk - lean - 6] },
+ ];
+ const bLo: Vec3 = [-185, yS - 10, zBk - lean - 20], bHi: Vec3 = [185, H, zBk + 12];
+ const bc: Vec3 = [(bLo[0] + bHi[0]) / 2, (bLo[1] + bHi[1]) / 2, (bLo[2] + bHi[2]) / 2];
+ const back: CustomPart = {
+ id: "BACK",
+ name: "Backrest",
+ size: [bHi[0] - bLo[0], bHi[1] - bLo[1], bHi[2] - bLo[2]],
+ pos: bc,
+ material: "wood",
+ pieces: backAbs.map((p) => ({ ...p, pos: [p.pos[0] - bc[0], p.pos[1] - bc[1], p.pos[2] - bc[2]] as Vec3 })),
+ };
+
+ // the rods between the legs
+ const yF = 300, yH = 250;
+ const xF = legAt(1, "f", yF)[0], xH = legAt(1, "f", yH)[0];
+ const zHf = legAt(1, "f", yH)[2], zHb = legAt(1, "b", yH)[2];
+ const zMid = (zHf + zHb) / 2;
+ const parts: CustomPart[] = [
+ { id: "SEAT", name: "Seat", size: [SW, ST, SD], pos: [0, yS - ST / 2, zS], material: "wood", pieces: [{ shape: "slab", size: [SW, ST, SD], pos: [0, 0, 0], outline: [[-SW / 2, -SD / 2], [SW / 2, -SD / 2], [SW / 2, SD / 2], [-SW / 2, SD / 2]], round: 50 }] },
+ back,
+ leg("FL1", -1, "f"),
+ leg("FL2", 1, "f"),
+ { id: "FOOT", name: "Footrest", shape: "cyl", size: [r(2 * xF - LEG + 10), ROD, ROD], pos: [0, yF, r(legAt(1, "f", yF)[2])], material: "wood" },
+ ...G.map((sx, i): CustomPart => ({ id: `SR${i + 1}`, name: "Side rail", shape: "cyl", size: [ROD, ROD, r(zHf - zHb - LEG + 10)], pos: [r(sx * xH), yH, r(zMid)], material: "wood" })),
+ { id: "MID", name: "Middle rail", shape: "cyl", size: [r(2 * xH - ROD + 10), ROD, ROD], pos: [0, yH, r(zMid)], material: "wood" },
+ leg("BL1", -1, "b"),
+ leg("BL2", 1, "b"),
+ ];
+
+ const backScrews = fx(rods.map((x): Vec3 => [x, yB, r(zBk)]), [0, 1, 0], { on: "SEAT", mate: "BACK" });
+ const footScrews = G.map((sx, i) => fx([[r(sx * (xF + LEG / 2)), yF, r(legAt(1, "f", yF)[2])]], [-sx, 0, 0], { on: `FL${i + 1}`, mate: "FOOT" }));
+ const midScrews = G.map((sx, i) => fx([[r(sx * (xH + ROD / 2)), yH, r(zMid)]], [-sx, 0, 0], { on: `SR${i + 1}`, mate: "MID" }));
+ const frontScrews = G.map((sx, i) => fx([[r(sx * xH), yH, r(zHf + LEG / 2)]], [0, 0, -1], { on: `FL${i + 1}`, mate: `SR${i + 1}` }));
+ const backLegScrew = (i: number) => fx([[r(G[i] * xH), yH, r(zHb - LEG / 2)]], [0, 0, 1], { on: `BL${i + 1}`, mate: `SR${i + 1}` });
+ // one screw at each leg's top, angled up through the leg into the seat
+ const legScrews = (["f", "b"] as const).flatMap((end) =>
+ G.map((sx) => {
+ const p = legAt(sx, end, yB - 22);
+ const inward = end === "f" ? -1 : 1;
+ const d = [sx * 0.35, 1, -inward * 0.35];
+ const n = Math.hypot(...d);
+ return fx([[r(p[0] - sx * LEG * 0.45), r(p[1]), r(p[2] + inward * LEG * 0.45)]], [d[0] / n, d[1] / n, d[2] / n], { on: `${end === "f" ? "FL" : "BL"}${sx < 0 ? 1 : 2}`, mate: "SEAT" });
+ }),
+ );
+
+ return {
+ parts,
+ steps: [
+ {
+ title: "Push the backrest into the seat",
+ detail: "Seat on a rug, the right way up. Line up the posts and spindles with their holes and push them in.",
+ add: ["SEAT", "BACK"],
+ from: { BACK: [0, 250, 0] },
+ warnings: ["floor"],
+ },
+ {
+ title: "Press the backrest right down",
+ detail: "Push down hard on the crest rail with both hands, until there is no gap left between the posts and the seat.",
+ warnings: ["hand"],
+ },
+ {
+ title: "Turn the seat over and screw the backrest on",
+ detail: "Lay it upside down on the rug. One screw up into each post and spindle.",
+ fix: [backScrews],
+ pose: "-y",
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the footrest between the front legs",
+ detail: "Pick the two shortest legs with one hole each side. One screw through each leg into the footrest.",
+ add: ["FL1", "FL2", "FOOT"],
+ fix: footScrews,
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the middle rail between the side rails",
+ detail: "One screw through each side rail into an end of the middle rail.",
+ add: ["SR1", "SR2", "MID"],
+ fix: midScrews,
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the side rails into the front legs",
+ detail: "One screw through each front leg into the end of a side rail.",
+ fix: frontScrews,
+ tools: ["allen"],
+ },
+ {
+ title: "Add a back leg",
+ detail: "Its top goes into the hole in the seat, then one screw through the leg into the side rail.",
+ add: ["BL1"],
+ fix: [backLegScrew(0)],
+ tools: ["allen"],
+ },
+ {
+ title: "Add the other back leg",
+ detail: "The same way, one screw.",
+ add: ["BL2"],
+ fix: [backLegScrew(1)],
+ tools: ["allen"],
+ },
+ {
+ title: "Tap the legs home and screw them to the seat",
+ detail: "Knock each leg top fully into the seat with the hammer, the notch facing the screw hole. Then one screw into each leg.",
+ fix: legScrews,
+ tools: ["hammer", "allen"],
+ },
+ {
+ title: "Stand it up and tighten every screw again",
+ detail: "Press down on the seat and go round the twelve screws in the base once more with the Allen key.",
+ pose: "+y",
+ tools: ["allen"],
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["AGAM"],
+ recipe: (s) => (/chair/i.test(`${s.variant} ${s.slug ?? ""}`) ? chair(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/agen.ts b/src/lib/plan/families/agen.ts
new file mode 100644
index 0000000..1dc40e1
--- /dev/null
+++ b/src/lib/plan/families/agen.ts
@@ -0,0 +1,50 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * AGEN: a hand-woven rattan chair on bamboo legs. IKEA sells it ready to use and has no assembly manual for it,
+ * so the guide only unpacks it and, for the armchair with cushion, lays the cushion on the seat.
+ */
+
+function chair(s: ProductSpec, cushion: boolean): CustomParams {
+ const W = Math.round(s.size.w * 10) || 580, H = Math.round(s.size.h * 10) || 790, D = Math.round(s.size.d * 10) || 560;
+ const yS = 440; // seat height
+ const legD = 30, ring = 70; // bamboo legs, the woven seat ring
+ const xl = W / 2 - 60, zl = D / 2 - 60;
+ // the legs splay out a little towards the floor
+ const tilt = 0.08;
+ const legs: PartPiece[] = [-1, 1].flatMap((sx) => [-1, 1].map((sz): PartPiece => ({
+ shape: "cyl",
+ size: [legD, yS - ring / 2, legD],
+ pos: [sx * xl, (yS - ring / 2) / 2 - H / 2, sz * zl],
+ rot: [sz * tilt, 0, -sx * tilt],
+ })));
+ // the back and arms: one woven shell curving round the seat, drawn as panels on an arc
+ const R = W / 2 - 20, n = 9, shellH = H - yS + ring / 2;
+ const shell: PartPiece[] = Array.from({ length: n }, (_, i) => {
+ const a = -Math.PI * 0.62 + (Math.PI * 1.24 * i) / (n - 1); // from the left arm round the back to the right arm
+ const h = i === 0 || i === n - 1 ? shellH * 0.55 : i === 1 || i === n - 2 ? shellH * 0.8 : shellH;
+ return { shape: "box", size: [Math.round((2 * Math.PI * R * 0.62) / (n - 1)) + 8, Math.round(h), 24], pos: [Math.round(Math.sin(a) * R), Math.round(yS - ring / 2 + h / 2 - H / 2), Math.round(-Math.cos(a) * R * 0.85)], rot: [0, -a, 0] };
+ });
+ const seat: PartPiece[] = [{ shape: "box", size: [W - 100, ring, D - 110], pos: [0, yS - H / 2, 0] }];
+ const parts: CustomPart[] = [{ id: "chair", name: "Rattan chair", size: [W, H, D], pos: [0, H / 2, 0], material: "wood", pieces: [...legs, ...seat, ...shell] }];
+ const steps: CustomStep[] = [
+ { title: "Lift the chair out of its packaging", detail: "It comes ready to use, with nothing to put together. Pull off the wrapping and any tape on the rattan.", add: ["chair"], from: { chair: [0, 300, 0] } },
+ { title: "Stand it on a flat floor", detail: "Check all four legs touch the floor. Keep it out of the rain and direct sun, which dry out the rattan." },
+ ];
+ if (cushion) {
+ parts.push({ id: "cush", name: "Seat cushion", size: [W - 140, 50, D - 160], pos: [0, yS + ring / 2 + 25, 10], material: "soft" });
+ steps.push({ title: "Lay the cushion on the seat", detail: "Push it back against the shell so it sits flat on the woven seat.", add: ["cush"], from: { cush: [0, 260, 120] } });
+ }
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["AGEN"],
+ recipe(s) {
+ const v = `${s.variant} ${s.slug ?? ""}`.toLowerCase();
+ if (!/chair/.test(v)) return null;
+ return chair(s, /cushion/.test(v));
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/albert.ts b/src/lib/plan/families/albert.ts
new file mode 100644
index 0000000..d556761
--- /dev/null
+++ b/src/lib/plan/families/albert.ts
@@ -0,0 +1,100 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * ALBERT, read from the shelving unit's manual (solid softwood, everything screwed with one kind of wood screw).
+ * Each side is a ladder: two uprights with four shelf supports screwed between them, end on. The unit is built
+ * lying on its back: one side stands on its edge, three slats a shelf go onto the supports' ledges and are screwed
+ * through the support into their ends, the other side goes on the same way, then it's stood up and the front and
+ * back slats are screwed through the uprights too. One angle bracket fixes it to the wall.
+ */
+
+const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const SCREW = { len: 40, dia: 4 };
+const UX = 45, UZ = 22; // uprights: their wide face to the front
+const CX = 22, CY = 45; // shelf supports, between the uprights
+const ST = 18, SN = 3; // slats, three a shelf
+
+function recipe(s: ProductSpec): CustomParams {
+ // IKEA: 64 wide, 28 deep, 159 high
+ const W = Math.round(s.size.w * 10) || 640, D = Math.round(s.size.d * 10) || 280, H = Math.round(s.size.h * 10) || 1590;
+ const xs = [-1, 1];
+ const ux = W / 2 - UX / 2, uz = D / 2 - UZ / 2, cx = W / 2 - CX / 2;
+ const inner = D - 2 * UZ; // between the uprights
+ const sw = (inner - (SN - 1) * 10) / SN; // slat width
+ const sz = Array.from({ length: SN }, (_, i) => -inner / 2 + sw / 2 + i * (sw + 10));
+ const levels = [0, 1, 2, 3].map((i) => 90 + (i * (H - 20 - 90)) / 3); // top of each shelf
+ const side = (g: number) => (g < 0 ? "L" : "R");
+ const parts: CustomPart[] = [];
+ for (const g of xs) {
+ for (const zg of [-1, 1]) parts.push({ id: `${side(g)}U${zg < 0 ? "b" : "f"}`, name: "Upright", size: [UX, H, UZ], pos: [g * ux, H / 2, zg * uz], material: "wood" });
+ levels.forEach((y, i) => parts.push({ id: `${side(g)}C${i}`, name: "Shelf support", size: [CX, CY, inner], pos: [g * cx, y - CY / 2, 0], material: "wood" }));
+ }
+ levels.forEach((y, i) => sz.forEach((z, k) => parts.push({ id: `S${i}${k}`, name: "Slat", size: [W - 2 * CX, ST, sw], pos: [0, y - ST / 2, z], material: "wood" })));
+ const ids = (g: number) => [`${side(g)}Ub`, `${side(g)}Uf`, ...levels.map((_, i) => `${side(g)}C${i}`)];
+ const slats = levels.flatMap((_, i) => sz.map((_, k) => `S${i}${k}`));
+ // a screw through each upright, end on into each support
+ const ladderScrews = (g: number) => [-1, 1].map((zg) => fx("screw", levels.map((y): Vec3 => [g * cx, y - CY / 2, zg * D / 2]), [0, 0, -zg], { ...SCREW, on: `${side(g)}U${zg < 0 ? "b" : "f"}` }));
+ // a screw through the support into the end of each slat
+ const slatScrews = (g: number) => levels.map((y, i) => fx("screw", sz.map((z): Vec3 => [g * W / 2, y - ST / 2, z]), [-g, 0, 0], { ...SCREW, on: `${side(g)}C${i}` }));
+ const xTop = W / 2 - UX + 12;
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the shelf supports between two uprights",
+ detail: "Two uprights on their edges with the four supports between them, ledges all facing the same way. One screw through the upright into each end.",
+ add: ids(-1),
+ fix: ladderScrews(-1),
+ tools: ["screwdriver"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Make the second side the same way",
+ detail: "Its ledges face the other way, so the two sides mirror each other.",
+ fix: ladderScrews(1),
+ tools: ["screwdriver"],
+ wait: ids(1),
+ from: Object.fromEntries(ids(1).map((id) => [id, [250, 0, 0] as Vec3])),
+ },
+ {
+ title: "Screw the slats onto the first side",
+ detail: "Three slats to a shelf, their ends on the ledges of the first side, then a screw through the support into each slat.",
+ add: slats,
+ fix: slatScrews(-1),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Put the second side on and screw it",
+ detail: "Fit the free slat ends onto its ledges and screw through each support into the slats.",
+ add: ids(1),
+ fix: slatScrews(1),
+ tools: ["screwdriver"],
+ from: Object.fromEntries(ids(1).map((id) => [id, [250, 0, 0] as Vec3])),
+ },
+ {
+ title: "Stand it up and screw the front and back slats",
+ detail: "Through each upright into the slat behind it, at every shelf.",
+ fix: xs.flatMap((g) => [-1, 1].map((zg) => fx("screw", levels.map((y): Vec3 => [g * xTop, y - ST / 2, zg * D / 2]), [0, 0, -zg], { ...SCREW, on: `${side(g)}U${zg < 0 ? "b" : "f"}` }))),
+ tools: ["screwdriver"],
+ pose: "+y",
+ },
+ {
+ title: "Fix it to the wall",
+ detail: "Screw the bracket onto the top back slat with the washer, then to the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("angle", [[0, H - 20, -D / 2 + 30]], [0, -1, 0], { name: "Wall bracket", twist: 0 }),
+ fx("washer", [[0, H - 18, -D / 2 + 40]], [0, -1, 0], { len: 1.5, dia: 12 }),
+ fx("screw", [[0, H - 17, -D / 2 + 40]], [0, -1, 0], { len: 16, dia: 4, on: `S${levels.length - 1}0` }),
+ fx("plug", [[0, H - 40, -D / 2 - 40]], [0, 0, -1]),
+ fx("screw", [[0, H - 40, -D / 2 - 4]], [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "pencil", "screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = { names: ["ALBERT"], recipe };
+export default family;
diff --git a/src/lib/plan/families/alefjall.ts b/src/lib/plan/families/alefjall.ts
index 77f868e..35be79f 100644
--- a/src/lib/plan/families/alefjall.ts
+++ b/src/lib/plan/families/alefjall.ts
@@ -57,7 +57,7 @@ function chair(s: ProductSpec): CustomParams {
tube([sx * xa, yLow, zSeat - 60], [sx * 40, yLow, zBr]),
]);
frameAbs.push(
- { shape: "box", size: [80, 12, 140], pos: [0, mechY0 - 6, zBr + 60] },
+ { shape: "box", size: [80, 12, 200], pos: [0, mechY0 - 6, zBr + 100] },
{ shape: "box", size: [70, 300, 26], pos: [0, yLow + 130, zBr] },
);
const parts: CustomPart[] = [
@@ -73,10 +73,10 @@ function chair(s: ProductSpec): CustomParams {
{ id: "BACK", name: "Backrest", size: [480, H - 600, 90], pos: [0, (600 + H) / 2, zBr - 13 - 45], material: "soft" },
];
const tips: Vec3[] = angles.map((a) => [dirOf(a)[0] * R, baseY - 35, dirOf(a)[1] * R]);
- const hub: Vec3[] = angles.map((a) => [dirOf(a)[0] * 45, baseY - 35, dirOf(a)[1] * 45]);
+ const hub: Vec3[] = angles.map((a) => [dirOf(a)[0] * 45, baseY - 20, dirOf(a)[1] * 45]);
const mz0 = zSeat - 10 - 100, mz1 = zSeat - 10 + 100;
const mecBolts: Vec3[] = [-1, 1].flatMap((sx) => [mz0, mz1].map((z): Vec3 => [sx * 80, mechY0, z]));
- const frameBolts: Vec3[] = [-1, 1].flatMap((sx) => [zBr + 20, zBr + 100].map((z): Vec3 => [sx * 25, mechY0 - 12, z]));
+ const frameBolts: Vec3[] = [-1, 1].flatMap((sx) => [zBr + 130, zBr + 180].map((z): Vec3 => [sx * 25, mechY0 - 12, z]));
const padScrews = (sx: number) => fx("screw", [zSeat - 140, zSeat + 40].map((z): Vec3 => [sx * xa, yArm - T / 2, z]), [0, 1, 0], "FRAME", { name: "Allen screw", len: 20, dia: 6, mate: sx < 0 ? "PAD_L" : "PAD_R" });
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/alex.ts b/src/lib/plan/families/alex.ts
index b035a9b..b816f83 100644
--- a/src/lib/plan/families/alex.ts
+++ b/src/lib/plan/families/alex.ts
@@ -576,7 +576,7 @@ function buildDesk(b: PlanBuilder, st: Stepper, W: number, D: number, H: number)
const RUNNER: HwDef = { kind: "runner", len: runLen, dia: 20 };
const runnerFits = (on: string, x: number, into: number) => ({
r: { on, at: [x, ry, rz] as Vec3, dir: [into, 0, 0] as Vec3, hole: false as const },
- s: [rz + runLen / 2 - 30, rz - runLen / 2 + 30].map((z): FitOpts => ({ on, at: [x - into * 12, ry, z], dir: [into, 0, 0] })),
+ s: [rz + runLen / 2 - 30, rz - runLen / 2 + 30].map((z): FitOpts => ({ on, at: [x - into * 5, ry, z], dir: [into, 0, 0] })), // through the runner's thin flange
});
const divRun = sgs.map((g) => runnerFits(divider, g * (T / 2), -g));
const endRun = sgs.map((g, i) => runnerFits(ends[i], g * (W / 2 - T), g));
@@ -607,10 +607,12 @@ function buildDesk(b: PlanBuilder, st: Stepper, W: number, D: number, H: number)
b.then(0.15);
b.fits(FLAP_PLATE, px.map((x): FitOpts => ({ on: backRail, at: [x, yU - 20, -D / 2 + T], dir: [0, 0, -1], hole: false })), 0.2);
});
- st({ title: "Join the end panels to the back rail", detail: "Two dowels in each end of the rail, then push the end panels on.", tools: ["hammer"], kind: "join" }, () => {
+ st({ title: "Tap dowels into the back rail and lay it on the top", detail: "Two dowels in each end of the rail, then set it along the back edge of the top.", tools: ["hammer"], kind: "dowels" }, () => {
b.fits(DOWEL, sgs.flatMap((g) => [yI + ih * 0.3, yI + ih * 0.7].map((y): FitOpts => ({ on: backRail, at: [g * (W / 2 - T), y, -D / 2 + T / 2], dir: [-g, 0, 0], mate: ends[g < 0 ? 0 : 1] }))), 0.1);
b.then(0.15);
b.add(backRail, [0, -250, 0]);
+ });
+ st({ title: "Push the end panels onto the back rail", detail: "Onto its dowels from each side.", kind: "join" }, () => {
b.stagger(0.25);
b.add(ends[0], [-250, -150, 0]);
b.add(ends[1], [250, -150, 0]);
diff --git a/src/lib/plan/families/alganas.ts b/src/lib/plan/families/alganas.ts
index 5e8c15e..6897520 100644
--- a/src/lib/plan/families/alganas.ts
+++ b/src/lib/plan/families/alganas.ts
@@ -104,7 +104,7 @@ function clothesRack(s: ProductSpec): CustomParams {
{ id: "LR", name: "Lower leg", ...lowR, shape: "cyl", material: "metal" },
{ id: "SH", name: "Shoe shelf", size: [sw, 14, sd], pos: [(sx0 + sx1) / 2, yS, zw + 2 + sd / 2], material: "metal", pieces: shelf },
{ id: "CB", name: "Middle bar", size: [cx1 - cx0, 18, 18], pos: [cxm, yC, zA], shape: "cyl", material: "metal" },
- { id: "KT", name: "Key tray", size: [110, 14, 110], pos: [cxm, yC + 30, zA], shape: "cyl", material: "metal" },
+ { id: "KT", name: "Key tray", size: [110, 14, 110], pos: [cxm, yC + 16, zA], shape: "cyl", material: "metal" }, // resting on the bar
];
const wallTop: Vec3 = [xA, H - 15, zw];
const wallLow: Vec3[] = [-1, 1].map((k): Vec3 => [(sx0 + sx1) / 2 + k * (sw / 2 - 60), yS - 7, zw + 2]);
@@ -150,7 +150,7 @@ function clothesRack(s: ProductSpec): CustomParams {
],
tools: ["screwdriver"],
},
- { title: "Screw on the key tray", detail: "On top of the middle bar, one small screw.", add: ["KT"], fix: [{ kind: "screw", count: 1, len: 10, dia: 4, at: [[cxm, yC + 23, zA]], dir: [0, -1, 0], on: "KT" }], tools: ["screwdriver"] },
+ { title: "Screw on the key tray", detail: "On top of the middle bar, one small screw.", add: ["KT"], fix: [{ kind: "screw", count: 1, len: 10, dia: 4, at: [[cxm, yC + 16, zA]], dir: [0, -1, 0], on: "KT" }], tools: ["screwdriver"] },
{ title: "Hang the strap hooks", detail: "Loop the two straps round the middle bar or the legs, wherever you want them.", fix: [{ kind: "hook", count: 2, at: [-40, 40].map((dx): Vec3 => [cxm + dx, yC - 10, zA]), dir: [0, 1, 0], on: "CB" }] },
];
return { parts, steps };
diff --git a/src/lib/plan/families/alhult.ts b/src/lib/plan/families/alhult.ts
index 045479e..45a4097 100644
--- a/src/lib/plan/families/alhult.ts
+++ b/src/lib/plan/families/alhult.ts
@@ -149,7 +149,7 @@ const GAP = 3; // the top halves ride on slide brackets just above the frame
function extendableRecipe(s: ProductSpec): CustomParams {
const f = frameOf(s, GAP);
- const { W, D, H, yTop, zIn, xIn, Lx } = f;
+ const { W, D, H, yTop, zr, zIn, xIn, Lx } = f;
const small = W < 1500; // the 120/170 table, with slide strips in its short rails too and four slide brackets
const zInner = 2 * zIn;
const yLeaf = H - T - GAP - LT / 2;
@@ -172,7 +172,9 @@ function extendableRecipe(s: ProductSpec): CustomParams {
{
title: "Lay the long rails on a rug",
detail: "Inner faces up, as in the drawing. Keep the short rails beside them.",
- add: ["R0", "R1"],
+ // they take their fittings lying apart and tip onto the cross bars later
+ wait: ["R0", "R1"],
+ from: { R0: [0, 0, -300], R1: [0, 0, 300] },
warnings: ["floor"],
},
{
@@ -187,12 +189,6 @@ function extendableRecipe(s: ProductSpec): CustomParams {
fix: [-1, 1].map((sz) => fx("screw", [-1, 1].map((k) => [k * (XC + 90), yTop - 18, sz * zIn] as Vec3), [0, 0, sz], { name: "Stop screw", len: 18, dia: 8, on: sz < 0 ? "R0" : "R1" })),
tools: ["screwdriver"],
},
- {
- title: "Screw the cam bolts into the long rails",
- detail: "Two in each rail, where the cross bars will go. Screw them in until the collar stops at the surface.",
- fix: [-1, 1].map((sz) => fx("camScrew", [-1, 1].map((sx) => [sx * XC, yBar, sz * zIn] as Vec3), [0, 0, sz], { on: sz < 0 ? "R0" : "R1" })),
- tools: ["screwdriver"],
- },
{
title: "Push the slide strips into the long rails",
detail: "Two in each rail, into the grooves along the top edge, all the way in.",
@@ -203,22 +199,35 @@ function extendableRecipe(s: ProductSpec): CustomParams {
{
title: "Push the slide strips into the short rails",
detail: "Lay the short rails beside the frame, inner faces up. Two strips in each, into the grooves.",
- add: ["E0", "E1"],
+ wait: ["E0", "E1"],
+ from: { E0: [-300, 0, 0], E1: [300, 0, 0] },
fix: [-1, 1].map((sx) => fx("clip", [-1, 1].map((k) => [sx * xIn, yTop - 10, k * (zIn / 2)] as Vec3), [sx, 0, 0], { name: "Slide strip", len: 60, dia: 10, on: sx < 0 ? "E0" : "E1" })),
} as CustomStep,
]
: []),
{
- title: "Fit the cross bars between the long rails",
- detail: "Tap a dowel into each end of both bars, then push them onto the cam bolts and dowels, with the big holes facing the ends of the table.",
- add: ["C0", "C1"],
- fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((sz) => fx("dowel", [[sx * XC, yBar + 23, sz * zIn]], [0, 0, -sz], { on: `C${i}` }))),
+ title: "Screw the cam bolts into the cross bars",
+ detail: "One in each end of both bars, until the collar stops at the wood. Tap a dowel in beside each.",
+ fix: [-1, 1].flatMap((sx, i) =>
+ [-1, 1].flatMap((sz) => [
+ fx("camScrew", [[sx * XC, yBar - 10, sz * zIn]], [0, 0, -sz], { on: `C${i}` }),
+ fx("dowel", [[sx * XC, yBar + 18, sz * zIn]], [0, 0, -sz], { on: `C${i}` }),
+ ]),
+ ),
+ wait: ["C0", "C1"],
from: { C0: [0, 260, 0], C1: [0, 260, 0] },
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the cross bars between the long rails",
+ detail: "Lay the bars between the rails, big holes towards the ends of the table, then tip each rail onto their cam bolts and dowels.",
+ add: ["C0", "C1", "R0", "R1"],
+ from: { C0: [0, 260, 0], C1: [0, 260, 0], R0: [0, 0, -300], R1: [0, 0, 300] },
},
{
title: "Lock the cam locks",
- detail: "One in each end of the cross bars, arrow towards the bolt. Turn clockwise until it pulls tight.",
- fix: [-1, 1].map((sx, i) => fx("cam", [-1, 1].map((sz) => [sx * (XC + AT / 2), yBar, sz * (zIn - 24)] as Vec3), [-sx, 0, 0], { on: `C${i}` })),
+ detail: "Two in each long rail, over the cross bars, arrow towards the bolt. Turn clockwise until it pulls tight.",
+ fix: [-1, 1].map((sz) => fx("cam", [-1, 1].map((sx) => [sx * XC, yTop, sz * zr] as Vec3), [0, -1, 0], { on: sz < 0 ? "R0" : "R1" })),
tools: ["screwdriver"],
},
{
@@ -231,12 +240,12 @@ function extendableRecipe(s: ProductSpec): CustomParams {
return fx("dowel", [-1, 1].map((k) => [x, yBar + k * 14, 0] as Vec3), [e < 0 ? sx : -sx, 0, 0], { on: `M${i}` });
}),
),
- from: { M0: [0, 240, 0], M1: [0, 240, 0] },
+ from: { M0: [-240, 0, 0], M1: [240, 0, 0] },
},
{
title: "Fit the short rails and screw them to the brackets",
detail: "Swing each short rail onto the dowels of its centre bar and into the brackets, then two screws at each end.",
- add: small ? [] : ["E0", "E1"],
+ add: ["E0", "E1"],
fix: f.endScrews(),
tools: ["screwdriver"],
check: "square",
@@ -305,13 +314,21 @@ function benchRecipe(s: ProductSpec): CustomParams {
{
title: "Screw a cam bolt into each long rail",
detail: "Lay the long rails on a rug, inner faces up. One bolt in the middle hole of each.",
- add: ["R0", "R1"],
+ // they lie apart for their fittings and are pushed onto the middle bar after
+ wait: ["R0", "R1"],
+ from: { R0: [0, 0, -300], R1: [0, 0, 300] },
fix: [-1, 1].map((sz) => fx("camScrew", [[0, yA, sz * zIn]], [0, 0, sz], { on: sz < 0 ? "R0" : "R1" })),
tools: ["screwdriver"],
warnings: ["floor"],
},
{ title: "Screw a corner bracket to each end", detail: "Two screws hold each bracket to the rail.", fix: [f.brackets(), ...f.longScrews()], tools: ["screwdriver"] },
- { title: "Fit the middle bar between the rails", detail: "Push it onto the two cam bolts, the holes for the cam locks facing up.", add: ["C"], from: { C: [0, 240, 0] } },
+ { title: "Lay the middle bar between the rails", detail: "On the rug between them, the holes for the cam locks facing up.", add: ["C"], from: { C: [0, 240, 0] } },
+ {
+ title: "Push the rails onto the middle bar",
+ detail: "Stand the rails up either side of the bar and push them onto its ends over the cam bolts.",
+ add: ["R0", "R1"],
+ from: { R0: [0, 0, -300], R1: [0, 0, 300] },
+ },
{ title: "Screw on the short rails", detail: "Into the brackets at each end, two screws in each.", add: ["E0", "E1"], fix: f.endScrews(), tools: ["screwdriver"] },
{
title: "Lock the cam locks",
diff --git a/src/lib/plan/families/alseda.ts b/src/lib/plan/families/alseda.ts
new file mode 100644
index 0000000..efe4cc1
--- /dev/null
+++ b/src/lib/plan/families/alseda.ts
@@ -0,0 +1,46 @@
+import type { Family } from "./family";
+import type { CustomParams, ProductSpec } from "../../types";
+
+/**
+ * ALSEDA has no assembly manual: the stool is hand-woven from banana fibre in one piece and comes ready to use.
+ * The guide only unwraps it and sets it down. Its page gives a 60 cm diameter and 18 cm height.
+ */
+
+function stool(s: ProductSpec): CustomParams {
+ const H = s.size.h * 10;
+ const R = 600; // diameter, from the product page
+ return {
+ parts: [
+ {
+ id: "seat",
+ name: "Stool",
+ size: [R, H, R],
+ pos: [0, H / 2, 0],
+ material: "wood",
+ // a woven pad: a fuller middle and softer, rounder top and bottom edges
+ pieces: [
+ { shape: "cyl", size: [R, H - 50, R], pos: [0, 0, 0] },
+ { shape: "cyl", size: [R - 50, H, R - 50], pos: [0, 0, 0] },
+ ],
+ },
+ ],
+ steps: [
+ {
+ title: "Take the stool out of its wrapping",
+ detail: "It comes woven in one piece, so there's nothing to put together. Cut the wrapping away carefully so the knife doesn't catch the fibre.",
+ add: ["seat"],
+ from: { seat: [0, 300, 0] },
+ },
+ { title: "Set it down where you want it", detail: "Keep it away from damp floors and strong sun, which dry out and fade the fibre." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["ALSEDA"],
+ recipe(s) {
+ if (/alseda-stool/.test(s.slug ?? "")) return stool(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/alskvard.ts b/src/lib/plan/families/alskvard.ts
index e039724..1487f80 100644
--- a/src/lib/plan/families/alskvard.ts
+++ b/src/lib/plan/families/alskvard.ts
@@ -8,8 +8,7 @@ import { buildCustom } from "../custom";
* end frames while they lie on a rug, the two bottom rails go between them on dowels and long bolts with barrel nuts,
* four hooks (eye bolts on the crib) hold the slatted base at its top height, then both barred sides drop onto the
* rails and are bolted to the ends. The front side's lower corners get a screw and sleeve each. Lowering the base and
- * taking a side off later follow the manual's own pages. The changing table has its own 40-step manual and keeps its
- * old guide for now.
+ * taking a side off later follow the manual's own pages. The changing table follows its own manual below.
*/
function fx(kind: CustomFix["kind"], at: Vec3[], dir: Vec3, on?: string, o: Partial<CustomFix> = {}): CustomFix {
@@ -74,8 +73,9 @@ function cot(s: ProductSpec): CustomParams {
tools: ["hammer"],
warnings: ["floor"],
},
- { title: "Tap dowels into the bottom rails", detail: "Two in each end of both rails.", fix: railDowels, tools: ["hammer"] },
- { title: "Push the rails into an end frame", detail: "Stand the frame up and press the rails' dowels into its legs.", add: ["E0"] },
+ { title: "Tap dowels into the bottom rails", detail: "Two in each end of both rails.", fix: railDowels, tools: ["hammer"], wait: ["R0", "R1"], from: { R0: [600, 0, 0], R1: [600, 0, 0] } },
+ { title: "Stand one end frame up", detail: "Feet on the floor, the inside facing the middle of the room.", add: ["E0"] },
+ { title: "Push the rails into it", detail: "Press each rail's dowels straight into the holes in the legs.", add: ["R0", "R1"], from: { R0: [400, 0, 0], R1: [400, 0, 0] } },
{
title: "Bolt the rails to it",
detail: "Drop a barrel nut into each rail, slot towards the bolt, then turn the long bolts in through the legs.",
@@ -126,6 +126,193 @@ function cot(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/* ---------- changing table / chest of drawers ---------- */
+
+/**
+ * The changing table's own manual: both birch side frames get their glides and cam bolts, two white panels each are
+ * dowelled, dropped into them, locked with cams and bolted through the posts, and the runners go on. The carcass is
+ * built on the left side lying on the rug: bottom, middle and top panels on cam bolts and cams, the upper back
+ * bolted through the post, then the right side goes on from above. Stood up, the plinth is screwed in, the two
+ * drawers are built on their fronts and slid in, the back is fixed to the wall, and the changing tray (a rim screwed
+ * onto its board) slides on top and is screwed down.
+ */
+function changing(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, Dt = s.size.d * 10; // the tray reaches over the front
+ const D = 580; // the chest itself
+ const P = 40; // frame posts and rails
+ const xf = W / 2 - P / 2; // side frames
+ const xo = W / 2 - P; // their inside face
+ const pt = 16, xp = xo - pt / 2, xi = xo - pt; // side panels, lying on the frames' inside
+ const zp = D / 2 - P / 2;
+ const yB = 160, yM = 600, yT = 862, bt = 18;
+ const iw = 2 * xi;
+ const parts: CustomPart[] = [];
+ const framePieces: PartPiece[] = [
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [P, H, P], pos: [0, 0, sz * zp] })),
+ { shape: "box", size: [P, P, D - 2 * P], pos: [0, H / 2 - P / 2, 0] },
+ { shape: "box", size: [P, P, D - 2 * P], pos: [0, 140 - H / 2, 0] },
+ ];
+ const side = (sx: number) => (sx < 0 ? "L" : "R");
+ for (const sx of [-1, 1]) {
+ parts.push({ id: `S${side(sx)}`, name: "Side frame", size: [P, H, D], pos: [sx * xf, H / 2, 0], pieces: framePieces, material: "wood" });
+ parts.push({ id: `P${side(sx)}0`, name: "Lower side panel", size: [pt, yM - 120, D], pos: [sx * xp, (120 + yM) / 2, 0] });
+ parts.push({ id: `P${side(sx)}1`, name: "Upper side panel", size: [pt, H - 20 - yM, D], pos: [sx * xp, (yM + H - 20) / 2, 0] });
+ }
+ const panel = (id: string, name: string, y: number) => parts.push({ id, name, size: [iw, bt, D - 20], pos: [0, y + bt / 2, -10] });
+ panel("BOT", "Bottom panel", yB);
+ panel("MID", "Middle panel", yM);
+ panel("TOP", "Top panel", yT);
+ parts.push({ id: "UB", name: "Upper back", size: [iw, yT - yM - bt, bt], pos: [0, (yM + bt + yT) / 2, -D / 2 + bt / 2] });
+ parts.push({ id: "PL", name: "Plinth", size: [iw + 2 * pt, yB - 40, bt], pos: [0, (40 + yB) / 2, D / 2 - P + bt / 2] });
+ // the drawers: a front with its box behind, one part each
+ const fw = 2 * (xi - 2), bx = xi - 12 - 6, bl = 480;
+ const drawers = [{ id: "D0", yc: 285 }, { id: "D1", yc: 495 }];
+ for (const d of drawers)
+ parts.push({
+ id: d.id,
+ name: "Drawer",
+ size: [fw, 200, D],
+ pos: [0, d.yc, 0],
+ pieces: [
+ { shape: "box", size: [fw, 200, bt], pos: [0, 0, D / 2 - bt / 2] },
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [12, 150, bl], pos: [sx * (bx - 6), -15, D / 2 - bt - bl / 2] })),
+ { shape: "box", size: [2 * bx - 24, 150, 12], pos: [0, -15, D / 2 - bt - bl + 6] },
+ { shape: "box", size: [2 * bx - 24, 4, bl - 12], pos: [0, -88, D / 2 - bt - bl / 2] },
+ ],
+ });
+ // the changing tray: a board with a rim at the back and sides and a low lip at the front
+ const tz0 = -D / 2, tz1 = -D / 2 + Dt, tzc = (tz0 + tz1) / 2;
+ const tw = iw, ty = yT + bt;
+ // one part: it is put together off to the side and slides on in one piece
+ const rimH = 100, ry = ty + bt + rimH / 2;
+ const tyc = ty + (bt + rimH) / 2;
+ parts.push({
+ id: "TR",
+ name: "Changing tray",
+ size: [tw, bt + rimH, Dt],
+ pos: [0, tyc, tzc],
+ pieces: [
+ { shape: "box", size: [tw, bt, Dt], pos: [0, ty + bt / 2 - tyc, 0] },
+ { shape: "box", size: [tw, rimH, bt], pos: [0, ry - tyc, tz0 + bt / 2 - tzc] },
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [bt, rimH, Dt - bt], pos: [sx * (tw / 2 - bt / 2), ry - tyc, bt / 2] })),
+ { shape: "box", size: [tw - 2 * bt, 40, bt], pos: [0, ty + bt + 20 - tyc, Dt / 2 - bt / 2] },
+ ],
+ });
+
+ const both = (f: (sx: number) => CustomFix[]) => [-1, 1].flatMap(f);
+ const glides = both((sx) => [fx("glide", [-1, 1].map((sz): Vec3 => [sx * xf, 0, sz * zp]), [0, 1, 0], `S${side(sx)}`, { name: "Glide" })]);
+ // cam bolts in each frame's inside face, three each: two on the posts low down, one on the top rail
+ const frameBolts: Vec3[] = [[0, 400, -zp], [0, 400, zp], [0, H - P / 2, 0]];
+ const camBolts = both((sx) => [fx("camScrew", frameBolts.map((p): Vec3 => [sx * xo, p[1], p[2]]), [sx, 0, 0], `S${side(sx)}`)]);
+ const panelDowels = both((sx) => [
+ fx("dowel", [[sx * xo, 140, -120], [sx * xo, 140, 120]], [-sx, 0, 0], `P${side(sx)}0`),
+ fx("dowel", [[sx * xo, H - P / 2, 160]], [-sx, 0, 0], `P${side(sx)}1`),
+ ]);
+ const panelCams = both((sx) => [
+ fx("cam", [[sx * xi, 400, -zp], [sx * xi, 400, zp]], [sx, 0, 0], `P${side(sx)}0`, { len: 13, dia: 15 }),
+ fx("cam", [[sx * xi, H - P / 2, 0]], [sx, 0, 0], `P${side(sx)}1`, { len: 13, dia: 15 }),
+ ]);
+ const postBolts = both((sx) => [
+ fx("bolt", [[sx * (W / 2), 250, -zp], [sx * (W / 2), 250, zp]], [-sx, 0, 0], `S${side(sx)}`, { len: 50, dia: 6, mate: `P${side(sx)}0` }),
+ fx("bolt", [[sx * (W / 2), 800, sx * zp]], [-sx, 0, 0], `S${side(sx)}`, { len: 50, dia: 6, mate: `P${side(sx)}1` }),
+ ]);
+ const railScrews = both((sx) => [
+ fx("screw", [[sx * xi, 140, -150], [sx * xi, 140, 150]], [sx, 0, 0], `P${side(sx)}0`, { len: 30, dia: 4 }),
+ fx("screw", [[sx * xi, H - P / 2, -150]], [sx, 0, 0], `P${side(sx)}1`, { len: 30, dia: 4 }),
+ ]);
+ const runnerX = xi - 6;
+ const runners = both((sx) => [fx("runner", drawers.map((d): Vec3 => [sx * runnerX, d.yc - 80, 20]), [sx, 0, 0], `P${side(sx)}0`, { len: 450, dia: 30 })]);
+ const runnerScrews = both((sx) => [fx("screw", drawers.flatMap((d) => [-180, 0, 180].map((z): Vec3 => [sx * (xi - 8), d.yc - 80, z])), [sx, 0, 0], `P${side(sx)}0`, { len: 12, dia: 4 })]);
+ // the carcass panels' ends: two cam bolts in the side panel and two cams in the panel, at each end
+ const ends = (y: number) => [-150, 150].map((z) => [y + bt / 2, z] as [number, number]);
+ const carcassBolts = both((sx) => [fx("camScrew", [yB, yM, yT].flatMap((y) => ends(y).map(([yy, z]): Vec3 => [sx * xi, yy, z])), [sx, 0, 0], `P${side(sx)}${0}`, {})]).map((f) => ({ ...f, on: undefined, to: undefined }));
+ const camsOf = (id: string, y: number) => fx("cam", [-1, 1].flatMap((sx) => ends(y).map(([yy, z]): Vec3 => [sx * (xi - 34), yy + bt / 2, z])), [0, -1, 0], id, { len: 13, dia: 15 });
+ const ubBolts = (sx: number) => fx("bolt", [690, 800].map((y): Vec3 => [sx * (W / 2), y, -D / 2 + bt / 2]), [-sx, 0, 0], `S${side(sx)}`, { len: 70, dia: 6, mate: "UB" });
+ const drawerFix = (k: "dowel" | "cam" | "screw" | "knob"): CustomFix[] =>
+ drawers.flatMap((d) => {
+ const zf = D / 2 - bt;
+ if (k === "dowel") return [fx("dowel", [-1, 1].flatMap((sx) => [-50, 50].map((dy): Vec3 => [sx * (bx - 6), d.yc - 15 + dy, zf])), [0, 0, -1], d.id)];
+ if (k === "cam") return [fx("cam", [-1, 1].flatMap((sx) => [-25, 25].map((dy): Vec3 => [sx * (bx - 20), d.yc - 15 + dy, zf - 30])), [0, 1, 0], d.id, { len: 13, dia: 15 })];
+ if (k === "screw") return [-1, 1].map((sx) => fx("screw", [-150, 30, 210].map((z): Vec3 => [sx * (bx + 2), d.yc - 50, z]), [-sx, 0, 0], d.id, { len: 12, dia: 4 }));
+ return [fx("knob", [[0, d.yc, D / 2]], [0, 0, -1], d.id, { len: 30, dia: 35 }), fx("screw", [[0, d.yc, D / 2 - bt - 6]], [0, 0, 1], d.id, { len: 30, dia: 4 })];
+ });
+ const wallPts: Vec3[] = [-1, 1].map((sx): Vec3 => [sx * 300, 800, -D / 2 + bt]);
+ const steps: CustomStep[] = [
+ { title: "Tap the glides into the side frames", detail: "Lay both frames on a rug, inside up. One glide under each leg.", fix: glides, tools: ["hammer"], wait: ["SL", "SR"], from: { SL: [-600, 0, 0], SR: [600, 0, 0] }, warnings: ["floor"] },
+ { title: "Screw cam bolts into the frames", detail: "Three into the inside of each frame, by hand until they stop.", fix: camBolts },
+ { title: "Tap dowels into the side panels", detail: "Into the edge holes of all four panels.", fix: panelDowels, tools: ["hammer"], wait: ["PL0", "PL1", "PR0", "PR1"], from: { PL0: [-600, 0, 0], PL1: [-600, 0, 0], PR0: [600, 0, 0], PR1: [600, 0, 0] } },
+ { title: "Lay the panels into the left frame", detail: "Lower each panel onto the cam bolts and dowels, show side down. The right frame gets its two the same way.", add: ["SL", "PL0", "PL1"], from: { PL0: [400, 0, 0], PL1: [400, 0, 0] }, pose: "+x" },
+ { title: "Lock the panels with the cams", detail: "Six cams, arrow towards the cam bolt, turned clockwise.", fix: panelCams, tools: ["screwdriver"] },
+ { title: "Bolt the panels through the posts", detail: "Six long bolts from the outside of the frames. Push the panel tight to the frame before you turn each one in.", fix: postBolts, tools: ["allen"] },
+ { title: "Screw the panels to the rails", detail: "Six screws from the inside, through the panels into the frames' rails.", fix: railScrews, tools: ["screwdriver"] },
+ { title: "Screw on the drawer runners", detail: "Check the marks: each runner has its own side. Three screws in each, twelve in all.", fix: [...runners, ...runnerScrews], tools: ["screwdriver"] },
+ { title: "Screw in the cam bolts for the carcass", detail: "Twelve, six on the inside of each side, where the bottom, middle and top panels meet it.", fix: carcassBolts.map((f, i) => ({ ...f, on: i === 0 ? "PL0" : "PR0" })) },
+ { title: "Tap dowels into the bottom and middle panels", detail: "One in each end.", fix: [fx("dowel", [-1, 1].flatMap((sx) => [yB, yM].map((y): Vec3 => [sx * xi, y + bt / 2, 0])), [1, 0, 0], "BOT", {})], tools: ["hammer"], wait: ["BOT", "MID"] },
+ { title: "Lower the bottom panel onto the left side", detail: "Front edge to the front of the frame. Turn its two cams at this end.", add: ["BOT"], fix: [camsOf("BOT", yB)], tools: ["screwdriver"] },
+ { title: "Lower the middle panel on", detail: "The same way, two cams at this end.", add: ["MID"], fix: [camsOf("MID", yM)], tools: ["screwdriver"] },
+ { title: "Fit the upper back and bolt it", detail: "It stands between the middle and the top panel at the back. Two bolts through the back post.", add: ["UB"], fix: [ubBolts(-1)], tools: ["allen"] },
+ { title: "Lower the top panel on", detail: "Its cams too.", add: ["TOP"], from: { TOP: [500, 0, 0] }, fix: [camsOf("TOP", yT)], tools: ["screwdriver"] },
+ {
+ title: "Lower the right side on from above",
+ detail: "Together. Guide every cam bolt and dowel into its hole, then turn the cams at this end and bolt the upper back through the post.",
+ add: ["SR", "PR0", "PR1"],
+ fix: [ubBolts(1)],
+ people: 2,
+ tools: ["allen", "screwdriver"],
+ warnings: ["two"],
+ from: { SR: [400, 0, 0], PR0: [400, 0, 0], PR1: [400, 0, 0] },
+ },
+ {
+ title: "Stand it up and screw in the plinth",
+ detail: "Two long screws, one through each front post into the plinth's ends.",
+ add: ["PL"],
+ fix: [-1, 1].map((sx) => fx("screw", [[sx * (W / 2), 100, D / 2 - P + bt / 2]], [-sx, 0, 0], `S${side(sx)}`, { len: 70, dia: 5, mate: "PL" })),
+ pose: "+y",
+ people: 2,
+ tools: ["screwdriver"],
+ from: { PL: [0, 0, 400] },
+ },
+ { title: "Tap dowels into the drawer fronts", detail: "Lay both fronts face down on a rug. Four dowels in each, for the sides.", fix: drawerFix("dowel"), tools: ["hammer"], wait: ["D0", "D1"], warnings: ["floor"] },
+ { title: "Fit the sides and back, and lock the cams", detail: "Push the sides onto the dowels, slide the bottom into its grooves and push the back on. Four cams in each drawer.", fix: drawerFix("cam"), tools: ["screwdriver"] },
+ { title: "Screw the runners onto the drawers", detail: "Three screws on each side of each drawer.", fix: drawerFix("screw"), tools: ["screwdriver"] },
+ { title: "Screw on the knobs", detail: "One in the middle of each front, the screw from inside.", fix: drawerFix("knob"), tools: ["screwdriver"] },
+ { title: "Slide the drawers in", detail: "Lift each one onto its runners and push it all the way in.", add: ["D0", "D1"], from: { D0: [0, 0, 500], D1: [0, 0, 500] } },
+ {
+ title: "Fix it to the wall",
+ detail: "Two screws with washers through the upper back, into plugs in the wall. Wall screws and plugs aren't included: pick ones made for your wall. Click the cover caps over the heads.",
+ fix: [
+ fx("plug", wallPts.map((p): Vec3 => [p[0], p[1], -D / 2 - 2]), [0, 0, -1], undefined, {}),
+ fx("washer", wallPts, [0, 0, -1], "UB", {}),
+ fx("screw", wallPts, [0, 0, -1], "UB", { len: 50, dia: 5 }),
+ fx("cap", wallPts, [0, 0, -1], "UB", { name: "Cover cap" }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ {
+ title: "Fit the connectors into the rim",
+ detail: "Four, into the ends of the side pieces where they meet the back.",
+ fix: [fx("connector", [-1, 1].flatMap((sx) => [ry - 25, ry + 25].map((y): Vec3 => [sx * (tw / 2 - bt / 2), y, tz0 + bt])), [0, 0, -1], "TR", { len: 30, dia: 10 })],
+ wait: ["TR"],
+ },
+ { title: "Lock the rim's corners with cams", detail: "Four cams, turned clockwise.", fix: [fx("cam", [-1, 1].flatMap((sx) => [ry - 25, ry + 25].map((y): Vec3 => [sx * (tw / 2 - bt / 2), y, tz0 + 60])), [0, 0, 1], "TR", { len: 13, dia: 15 })], tools: ["screwdriver"] },
+ { title: "Bolt the front lip between the sides", detail: "One bolt through each side.", fix: [-1, 1].map((sx) => fx("bolt", [[sx * (tw / 2), ty + bt + 20, tz1 - bt / 2]], [-sx, 0, 0], "TR", { len: 40, dia: 6 })), tools: ["allen"] },
+ { title: "Screw the board onto the rim", detail: "Turn the rim over onto the board and put in ten screws, up through the board.", fix: [fx("screw", [...[-1, 1].flatMap((sx) => [-1, -0.33, 0.33, 1].map((k): Vec3 => [sx * (tw / 2 - bt / 2), ty, tzc + k * (Dt / 2 - 60)])), ...[-150, 150].map((x): Vec3 => [x, ty, tz0 + bt / 2])], [0, 1, 0], "TR", { len: 30, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Slide the changing tray onto the top", detail: "From the front, until it stops against the frames at the back.", add: ["TR"], from: { TR: [0, 0, 600] } },
+ {
+ title: "Screw the tray down",
+ detail: "Eight screws up through the top panel into the board, three through each side of the rim into the side panels.",
+ fix: [
+ fx("screw", [-300, -100, 100, 300].flatMap((x) => [-150, 150].map((z): Vec3 => [x, yT, z])), [0, 1, 0], "TOP", { len: 30, dia: 4, mate: "TR" }),
+ ...[-1, 1].map((sx) => fx("screw", [-200, 0, 200].map((z): Vec3 => [sx * (tw / 2 - bt), ry, z]), [sx, 0, 0], "TR", { len: 30, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ ];
+ return { parts, steps };
+}
+
/** The end frames lie on the rug while their feet go in, then stand up in their own steps. */
function buildCot(b: PlanBuilder, s: ProductSpec) {
const recipe = cot(s);
@@ -156,6 +343,9 @@ function buildCot(b: PlanBuilder, s: ProductSpec) {
const family: Family = {
names: ["ÄLSKVÄRD", "ALSKVARD"],
+ recipe(s) {
+ return /changing/i.test(`${s.slug ?? ""} ${s.variant}`) ? changing(s) : null;
+ },
build(b, s) {
if (!isCot(s)) return false;
buildCot(b, s);
diff --git a/src/lib/plan/families/ankarudden.ts b/src/lib/plan/families/ankarudden.ts
new file mode 100644
index 0000000..c10e6d1
--- /dev/null
+++ b/src/lib/plan/families/ankarudden.ts
@@ -0,0 +1,612 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomPart, CustomStep, HwKind, ProductSpec, Vec3 } from "../../types";
+import type { FitOpts, HwDef, PlanBuilder } from "../builder";
+import { buildCustom } from "../custom";
+
+/*
+ * ANKARUDDEN, read from IKEA's manuals for the chest of 4 drawers, the chest of 6 drawers with 2 inner drawers and
+ * the wardrobe with sliding doors.
+ *
+ * The carcass is built lying down: the 4-drawer chest on its left side, the 6-drawer chest and the wardrobe on their
+ * backs. Cam bolts and drawer runners go on the sides (and the divider) first, the rails and back boards are pushed
+ * onto dowels in the side on the floor and locked, and the other side closes it. Plastic foot strips press under the
+ * bottom edges, it's stood up, the top goes on dowels and cam bolts with the wall brackets already under it, and it's
+ * fixed to the wall. Every drawer is the same: the sides stand on the back, the bottom slides down the grooves, the
+ * front goes on connecting dowels and cam locks, runners are screwed on, and a grip strip is locked on top of the front.
+ * The wardrobe adds a divider, a fixed shelf over two drawers, a hardboard back, door tracks, two sliding doors, two
+ * clothes rails and three shelves.
+ */
+
+const T = 16;
+const S = [-1, 1];
+const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
+const fx = (kind: HwKind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const DOWEL = { len: 30, dia: 8 };
+const CAM = { name: "Cam lock" };
+const FOOT = { name: "Foot strip", len: 8, dia: 40 };
+
+/* ---------------------------------------------------------------- drawers */
+
+const D_CAM_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 6, name: "Cam bolt (drawer)" };
+const D_CONNECT: HwDef = { kind: "camScrew", len: 30, dia: 8, name: "Connecting dowel" };
+const D_CAM: HwDef = { kind: "cam", len: 10, dia: 12, name: "Cam lock (drawer)" };
+const D_RUNNER: HwDef = { kind: "runner", len: 400, dia: 30, name: "Drawer runner" };
+const D_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+const D_DOWEL: HwDef = { kind: "dowel", len: 30, dia: 8 };
+const D_STRIP_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 6, name: "Cam bolt (grip strip)" };
+const D_WIRE: HwDef = { kind: "clip", len: 10, dia: 60, name: "Wire stiffener" };
+
+export interface AnkDrawer {
+ front: string;
+ strip?: string;
+ sides: string[];
+ back: string;
+ bottom: string;
+ cx: number;
+ y0: number; // underside of the box
+ bh: number; // box height
+ bw: number; // box width over the sides
+ zb: number; // back face of the back
+ zf: number; // back face of the front
+ fy: number; // centre of the front panel
+ fh: number; // height of the front panel (without the strip)
+ fw: number;
+ runY: number;
+ wire: boolean;
+ rs: number; // runner screws on each side
+}
+
+/** One drawer in the opening `ow` wide and `oh` high (bottom at `yb`), its front's face at `zFace`, box `dd` deep. */
+export function ankDrawer(b: PlanBuilder, o: { cx: number; yb: number; ow: number; oh: number; zFace: number; dd: number; boxH?: number; strip?: boolean; wire?: boolean; runnerScrews?: number; types: Map<string, string> }): AnkDrawer {
+ const type = (name: string, size: Vec3, material?: "fiber") => {
+ const k = `${name}|${size.map(Math.round).join("x")}`;
+ let t = o.types.get(k);
+ if (!t) o.types.set(k, (t = b.part(name, size, { material })));
+ return t;
+ };
+ const ft = 16, strip = o.strip ?? true, sh = strip ? 22 : 0;
+ const fw = o.ow - 4, fh = o.oh - 4 - sh;
+ const fy = o.yb + 2 + fh / 2;
+ const zf = o.zFace - ft;
+ const bw = o.ow - 26;
+ const bh = o.boxH ?? Math.min(fh - 40, 200);
+ const y0 = o.yb + 20;
+ const zb = zf - o.dd;
+ const front = b.place(type("Drawer front", [fw, fh, ft]), [o.cx, fy, o.zFace - ft / 2]);
+ const st = strip ? b.place(type("Grip strip", [fw, sh, 30]), [o.cx, fy + fh / 2 + sh / 2, o.zFace - 15]) : undefined;
+ const sides = S.map((g) => b.place(type("Drawer side", [12, bh, o.dd - 12]), [o.cx + g * (bw / 2 - 6), y0 + bh / 2, zb + 12 + (o.dd - 12) / 2]));
+ const back = b.place(type("Drawer back", [bw, bh, 12]), [o.cx, y0 + bh / 2, zb + 6]);
+ const bottom = b.place(type("Drawer bottom", [bw - 16, 4, o.dd - 20], "fiber"), [o.cx, y0 + 10, zb + 12 + (o.dd - 20) / 2]);
+ return { front, strip: st, sides, back, bottom, cx: o.cx, y0, bh, bw, zb, zf, fy, fh, fw, runY: y0 + 30, wire: o.wire ?? false, rs: o.runnerScrews ?? 3 };
+}
+
+function drawerFits(d: AnkDrawer) {
+ const xs = d.bw / 2 - 6;
+ const ys = [d.y0 + 25, d.y0 + d.bh - 25];
+ const side = (g: number) => d.sides[g < 0 ? 0 : 1];
+ const zFront = d.zf + 16;
+ const fTop = d.fy + d.fh / 2;
+ const sx = [-1, 0, 1].map((k) => d.cx + k * (d.fw / 2 - 60));
+ return {
+ backBolts: S.flatMap((g) => ys.map((y): FitOpts => ({ on: d.back, at: [d.cx + g * xs, y, d.zb + 12], dir: [0, 0, -1], mate: side(g) }))),
+ backCams: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * (xs - 6), y, d.zb + 40], dir: [g, 0, 0] }))),
+ wire: d.wire ? [{ on: d.bottom, at: [d.cx, d.y0 + 8, (d.zb + d.zf) / 2], dir: [0, -1, 0], hole: false } as FitOpts] : [],
+ connectors: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * xs, y, d.zf], dir: [0, 0, -1], mate: d.front }))),
+ frontCams: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * (xs - 6), y, d.zf - 30], dir: [g, 0, 0] }))),
+ runners: S.map((g): FitOpts => ({ on: side(g), at: [d.cx + g * (xs + 6), d.runY, (d.zb + d.zf) / 2], dir: [-g, 0, 0], hole: false })),
+ runnerScrews: S.flatMap((g) => (d.rs === 2 ? [d.zb + 50, d.zf - 50] : [d.zb + 50, (d.zb + d.zf) / 2 + 40, d.zf - 50]).map((z): FitOpts => ({ on: side(g), at: [d.cx + g * (xs + 6), d.runY, z], dir: [-g, 0, 0] }))),
+ dowels: d.strip ? [-1, 1].map((k): FitOpts => ({ on: d.front, at: [d.cx + k * (d.fw / 2 - 30), fTop, zFront - 8], dir: [0, -1, 0], mate: d.strip })) : [],
+ stripBolts: d.strip ? sx.map((x): FitOpts => ({ on: d.strip!, at: [x + 20, fTop, zFront - 8], dir: [0, 1, 0], mate: d.front })) : [],
+ stripCams: d.strip ? sx.map((x): FitOpts => ({ on: d.front, at: [x + 20, fTop - 30, zFront - 16], dir: [0, 0, 1] })) : [],
+ };
+}
+
+type Fits = ReturnType<typeof drawerFits>;
+const FIT_DEFS: [keyof Fits, HwDef][] = [
+ ["backBolts", D_CAM_BOLT],
+ ["backCams", D_CAM],
+ ["wire", D_WIRE],
+ ["connectors", D_CONNECT],
+ ["frontCams", D_CAM],
+ ["runners", D_RUNNER],
+ ["runnerScrews", D_SCREW],
+ ["dowels", D_DOWEL],
+ ["stripBolts", D_STRIP_BOLT],
+ ["stripCams", D_CAM],
+];
+
+/** The drawer steps, shown on the first drawer of a group and repeated for the rest. Drawers go in afterwards. */
+export function ankDrawerSteps(b: PlanBuilder, ds: AnkDrawer[], o: { scene: string; label?: string }) {
+ if (!ds.length) return;
+ const d0 = ds[0];
+ const f = drawerFits(d0);
+ const rel = (k: string): Vec3 => {
+ const p = b.partItem(k).final.pos;
+ return [p[0] - d0.cx, p[1] - (d0.fy - d0.fh / 2) + 4, p[2]];
+ };
+ const stage = (k: string, from?: Vec3) => b.stage(k, rel(k), [0, 0, 0], from);
+ const sc = { scene: o.scene };
+ const what = o.label ?? "drawer";
+ b.step({ title: `Screw the cam bolts into the ${what} back`, detail: "Lay it on a rug, inside up. Four cam bolts, two near each end.", kind: "cams", tools: ["screwdriver"], warnings: ["floor"], ...sc }, () => {
+ stage(d0.back, [0, 160, 0]);
+ b.then(0.1);
+ b.fits(D_CAM_BOLT, f.backBolts, 0.08);
+ });
+ b.step({ title: "Stand the sides on the back", detail: "Grooves inside and at the bottom, onto the cam bolts.", kind: "join", ...sc }, () => {
+ for (const k of d0.sides) stage(k, [0, 0, 260]);
+ });
+ b.step({ title: "Lock the sides", detail: "Four cam locks, arrow towards the bolt, then turn clockwise.", kind: "cams", tools: ["screwdriver"], ...sc }, () => b.fits(D_CAM, f.backCams, 0.08));
+ b.step({ title: "Slide in the drawer bottom", detail: d0.wire ? "Down the grooves in the sides, then clip the wire stiffener under it." : "Down the grooves in the sides, all the way to the back.", kind: "join", ...sc }, () => {
+ stage(d0.bottom, [0, 0, 420]);
+ if (f.wire.length) {
+ b.then(0.1);
+ b.fits(D_WIRE, f.wire);
+ }
+ });
+ b.step({ title: "Put on the front", detail: "Push the connecting dowels into the ends of the sides, then lay the front on them.", kind: "join", ...sc }, () => {
+ b.fits(D_CONNECT, f.connectors, 0.08);
+ b.then(0.1);
+ stage(d0.front, [0, 0, 260]);
+ });
+ b.step({ title: "Lock the front", detail: "Four cam locks in the sides, near the front.", kind: "cams", tools: ["screwdriver"], ...sc }, () => b.fits(D_CAM, f.frontCams, 0.08));
+ b.step({ title: "Screw the runners onto the drawer", detail: `Turn the drawer the right way up. The marks show which runner goes on which side; ${d0.rs === 2 ? "two" : "three"} screws each.`, kind: "runners", tools: ["screwdriver"], ...sc }, () => {
+ b.fits(D_RUNNER, f.runners, 0.15);
+ b.then(0.05);
+ b.fits(D_SCREW, f.runnerScrews, 0.05);
+ });
+ if (d0.strip) {
+ b.step({ title: "Tap two dowels into the top of the front", detail: "And screw three cam bolts into the underside of the grip strip.", kind: "dowels", tools: ["hammer", "screwdriver"], ...sc }, () => {
+ b.fits(D_DOWEL, f.dowels, 0.1);
+ b.then(0.05);
+ stage(d0.strip!, [0, 160, 0]);
+ b.then(0.05);
+ b.fits(D_STRIP_BOLT, f.stripBolts, 0.08);
+ });
+ b.step({ title: "Lock the grip strip on", detail: "Press it down onto the front, then three cam locks from the inside.", kind: "cams", tools: ["screwdriver"], ...sc }, () => b.fits(D_CAM, f.stripCams, 0.08));
+ }
+ if (ds.length > 1) {
+ const n = ds.length - 1;
+ b.step({ title: n === 1 ? `Build the other ${what} the same way` : `Build the other ${n} ${what}s the same way`, detail: "Every one goes together like the first.", kind: "drawer", ...sc }, () => {
+ b.stagger(0.12);
+ ds.slice(1).forEach((d, i) => {
+ const dx = (i + 1) * (d0.fw + 120);
+ for (const k of [d.front, ...(d.strip ? [d.strip] : []), ...d.sides, d.back, d.bottom]) {
+ const p = b.partItem(k).final.pos;
+ b.stage(k, [p[0] - d.cx + dx, p[1] - (d0.fy - d0.fh / 2) + 4, p[2]], [0, 0, 0]);
+ }
+ const fd = drawerFits(d);
+ for (const [key, def] of FIT_DEFS) for (const x of fd[key]) b.preset(def, x);
+ });
+ });
+ }
+ return f;
+}
+
+/** Push every drawer in (the first of each group was shown; the rest get their fittings preset). */
+export function ankDrawersIn(b: PlanBuilder, groups: AnkDrawer[][], title: string, detail: string) {
+ b.step({ title, detail, kind: "drawer", warnings: ["tip"] }, () => {
+ for (const g of groups)
+ for (const d of g) {
+ b.stagger(0);
+ for (const k of [d.front, ...(d.strip ? [d.strip] : []), ...d.sides, d.back, d.bottom]) b.add(k, [0, 0, 520]);
+ b.wait(0.15);
+ }
+ });
+}
+
+/* ---------------------------------------------------------------- shared carcass bits */
+
+const runner = (x: number, y: number, d: number, on: string, z = 10): CustomFix[] => [
+ fx("runner", [pt(x, y, z)], [d, 0, 0], { len: 400, dia: 30, name: "Drawer runner", on }),
+ fx("screw", [-150, 10, 170].map((dz) => pt(x, y, z + dz)), [d, 0, 0], { len: 12, dia: 4, on }),
+];
+
+function wallSteps(o: { yTop: number; zBack: number; xs: number[] }): CustomStep[] {
+ const { yTop, zBack, xs } = o;
+ return [
+ { title: "Push it against the wall", detail: "Where it's going to stand. Mark the wall through the slots of the brackets, then pull it away again.", tools: ["pencil"], warnings: ["wall"] },
+ {
+ title: "Drill and plug the holes",
+ detail: "Use the plugs in the box for brick or concrete. For other walls, pick plugs and screws made for them.",
+ fix: [fx("plug", xs.map((x) => pt(x, yTop - 30, zBack - 30)), [0, 0, -1], { included: true })],
+ tools: ["drill"],
+ wall: true,
+ },
+ {
+ title: "Screw the brackets to the wall",
+ detail: "Push it back, then a screw with a washer through each bracket into the wall.",
+ fix: [
+ fx("washer", xs.map((x) => pt(x, yTop - 30, zBack - 2)), [0, 0, -1], { included: true }),
+ fx("screw", xs.map((x) => pt(x, yTop - 30, zBack)), [0, 0, -1], { len: 50, dia: 5, included: true }),
+ ],
+ tools: ["screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+}
+
+/** Two wall brackets screwed under the back of the top, each with a screw and a washer. */
+const topBrackets = (xs: number[], yt: number, zBack: number): CustomFix[] => [
+ fx("angle", xs.map((x) => pt(x, yt, zBack + 20)), [0, 1, 0], { name: "Wall bracket", len: 50, dia: 30, on: "TP", twist: Math.PI }),
+ fx("washer", xs.map((x) => pt(x, yt - 2, zBack + 40)), [0, 1, 0], { on: "TP" }),
+ fx("screw", xs.map((x) => pt(x, yt - 3, zBack + 40)), [0, 1, 0], { len: 12, dia: 4, on: "TP" }),
+];
+
+/* ---------------------------------------------------------------- chest of 4 drawers */
+
+function chest4(b: PlanBuilder, s: ProductSpec) {
+ const W = 800, H = 1070, D = 480, PL = 50, rows = 4;
+ const xo = W / 2 - T / 2, xi = W / 2 - T;
+ const yb = PL + T, yt = H - T;
+ const hb = (yt - PL) / 2;
+ const zF = D / 2 - 26 - T / 2; // rails behind the drawer fronts
+ const zB = -D / 2 + T / 2;
+ const pitch = (yt - yb) / rows;
+ const runY = (r: number) => yb + r * pitch + 50;
+ const parts: CustomPart[] = [
+ { id: "SL", name: "Side", size: [T, yt, D], pos: [-xo, yt / 2, 0] },
+ { id: "SR", name: "Side", size: [T, yt, D], pos: [xo, yt / 2, 0] },
+ { id: "BT", name: "Bottom", size: [W - 2 * T, T, D - T], pos: [0, PL + T / 2, T / 2] },
+ { id: "PF", name: "Plinth rail", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zF] },
+ { id: "PB", name: "Back rail", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zB] },
+ { id: "MR", name: "Back stiffener", size: [W - 2 * T, 30, 10], pos: [0, PL + hb, zB + T / 2 + 5], material: "metal" },
+ { id: "K0", name: "Back board", size: [W - 2 * T, hb, T], pos: [0, PL + hb / 2, zB] },
+ { id: "K1", name: "Back board", size: [W - 2 * T, hb, T], pos: [0, PL + hb * 1.5, zB] },
+ { id: "TR", name: "Top rail", size: [W - 2 * T, 40, T], pos: [0, yt - 20, zF] },
+ { id: "TP", name: "Top", size: [W, T, D], pos: [0, H - T / 2, 0] },
+ ];
+ const sideBolts = (sx: number, on: string) =>
+ fx("camScrew", [pt(sx * xi, PL + T / 2, -140), pt(sx * xi, PL + T / 2, 140), pt(sx * xi, PL / 2, zF), pt(sx * xi, PL / 2, zB), ...[0, 1].flatMap((k) => [-60, 60].map((dy) => pt(sx * xi, PL + hb * (k + 0.5) + dy, zB)))], [sx, 0, 0], { on });
+ const endDowels = (id: string, y: number, z: number[], sides = S) => sides.map((sx) => fx("dowel", z.map((zz) => pt(sx * xi, y, zz)), [-sx, 0, 0], { on: id, ...DOWEL }));
+ const cams = (sx: number, list: [string, Vec3, Vec3][]) => list.map(([on, p, d]) => fx("cam", [p], d, { on, ...CAM }));
+ const sideCams = (sx: number) =>
+ cams(sx, [
+ ["BT", pt(sx * (xi - 34), yb, -100), [0, -1, 0]],
+ ["BT", pt(sx * (xi - 34), yb, 100), [0, -1, 0]],
+ ["PF", pt(sx * (xi - 34), PL / 2, zF - T / 2), [0, 0, 1]],
+ ["PB", pt(sx * (xi - 34), PL / 2, zB + T / 2), [0, 0, -1]],
+ ...[0, 1].flatMap((k) => [-60, 60].map((dy): [string, Vec3, Vec3] => [`K${k}`, pt(sx * (xi - 34), PL + hb * (k + 0.5) + dy, zB + T / 2), [0, 0, -1]])),
+ ]);
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into both sides",
+ detail: "Lay the sides on a rug, inside up. Eight in each, by hand until they stop.",
+ add: ["SL"],
+ fix: [sideBolts(-1, "SL"), sideBolts(1, "SR")],
+ wait: ["SR"],
+ tools: ["screwdriver"],
+ pose: "+x",
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the drawer runners inside the sides",
+ detail: "Four on each side, three screws each. The marks show which runners are for the left side and which for the right.",
+ fix: [0, 1, 2, 3].flatMap((r) => [...runner(-xi, runY(r), -1, "SL"), ...runner(xi, runY(r), 1, "SR")]),
+ tools: ["screwdriver"],
+ },
+ { title: "Tap four dowels into the bottom", detail: "Two in each end.", fix: endDowels("BT", PL + T / 2, [-60, 60]), wait: ["BT"], tools: ["hammer"] },
+ { title: "Stand the bottom in the side", detail: "Onto the dowels and cam bolts of the side on the floor.", add: ["BT"] },
+ { title: "Lock the bottom", detail: "Two cam locks, arrow towards the bolt, then turn clockwise.", fix: cams(-1, [["BT", pt(-(xi - 34), yb, -100), [0, -1, 0]], ["BT", pt(-(xi - 34), yb, 100), [0, -1, 0]]]), tools: ["screwdriver"] },
+ { title: "Tap two dowels into the plinth rail", detail: "One in each end.", fix: endDowels("PF", PL / 2 - 10, [zF]), wait: ["PF"], tools: ["hammer"] },
+ { title: "Fit the plinth rail and lock it", detail: "Into the side at the front, under the bottom. One cam lock.", add: ["PF"], fix: cams(-1, [["PF", pt(-(xi - 34), PL / 2, zF - T / 2), [0, 0, 1]]]), tools: ["screwdriver"] },
+ { title: "Tap two dowels into the back rail", detail: "One in each end.", fix: endDowels("PB", PL / 2 - 10, [zB]), wait: ["PB"], tools: ["hammer"] },
+ { title: "Fit the back rail and lock it", detail: "Into the side at the back, under the bottom. One cam lock.", add: ["PB"], fix: cams(-1, [["PB", pt(-(xi - 34), PL / 2, zB + T / 2), [0, 0, -1]]]), tools: ["screwdriver"] },
+ {
+ title: "Screw the back stiffener to the side",
+ detail: "Halfway up at the back, where the two back boards will meet. One screw through its bracket.",
+ add: ["MR"],
+ fix: [fx("screw", [pt(-xi, PL + hb + 8, zB + T / 2 + 5)], [-1, 0, 0], { len: 12, dia: 4, on: "SL" })],
+ tools: ["screwdriver"],
+ },
+ { title: "Tap the dowels into the back boards", detail: "Two in each end of both boards.", fix: [...endDowels("K0", PL + hb / 2, [zB]), ...endDowels("K1", PL + hb * 1.5, [zB])].flatMap((f) => [{ ...f, at: f.at!.map((p) => pt(p[0], p[1] - 90, p[2])) }, { ...f, at: f.at!.map((p) => pt(p[0], p[1] + 90, p[2])) }]), wait: ["K0", "K1"], tools: ["hammer"] },
+ { title: "Stand the back boards in the side", detail: "One above the other, onto the dowels and cam bolts.", add: ["K0", "K1"] },
+ { title: "Lock the back boards", detail: "Four cam locks.", fix: cams(-1, [0, 1].flatMap((k) => [-60, 60].map((dy): [string, Vec3, Vec3] => [`K${k}`, pt(-(xi - 34), PL + hb * (k + 0.5) + dy, zB + T / 2), [0, 0, -1]]))), tools: ["screwdriver"] },
+ { title: "Lay the other side on", detail: "Together: down onto all the dowels and cam bolts at once.", add: ["SR"], people: 2 },
+ { title: "Lock the other side", detail: "Eight cam locks, the same as on the first side.", fix: sideCams(1), tools: ["screwdriver"] },
+ { title: "Screw the stiffener to this side", detail: "One screw through its other bracket.", fix: [fx("screw", [pt(xi, PL + hb + 8, zB + T / 2 + 5)], [1, 0, 0], { len: 12, dia: 4, on: "SR" })], tools: ["screwdriver"] },
+ {
+ title: "Stand it up and press in the foot strips",
+ detail: "Five, under the bottom edges of the sides and the plinth rail.",
+ fix: [fx("glide", [...S.flatMap((sx) => [-180, 180].map((z) => pt(sx * xo, 0, z))), pt(0, 0, zF)], [0, 1, 0], FOOT)],
+ pose: "+y",
+ people: 2,
+ },
+ { title: "Fit the top rail", detail: "Four dowels in its top edge first, then set it in at the front between the sides.", add: ["TR"], fix: [fx("dowel", [-300, -100, 100, 300].map((x) => pt(x, yt, zF)), [0, -1, 0], { on: "TR", ...DOWEL })], tools: ["hammer"] },
+ { title: "Tap the dowels into the sides", detail: "Two in the top edge of each side.", fix: S.map((sx, i) => fx("dowel", [-160, 120].map((z) => pt(sx * xo, yt, z)), [0, -1, 0], { on: i ? "SR" : "SL", ...DOWEL })), tools: ["hammer"] },
+ { title: "Screw four cam bolts under the top", detail: "Lay the top upside down. Two near each end.", fix: [fx("camScrew", S.flatMap((sx) => [-60, 160].map((z) => pt(sx * xo, yt, z))), [0, 1, 0], { on: "TP" })], wait: ["TP"], tools: ["screwdriver"] },
+ { title: "Screw the wall brackets under the top", detail: "At the back, one near each end, with a screw and a washer.", fix: topBrackets([-260, 260], yt, -D / 2), tools: ["screwdriver"] },
+ { title: "Put the top on", detail: "Onto the dowels and the top rail's dowels.", add: ["TP"] },
+ { title: "Lock the top", detail: "Four cam locks, inside the sides near the top.", fix: S.map((sx, i) => fx("cam", [-60, 160].map((z) => pt(sx * xi, yt - 34, z)), [sx, 0, 0], { on: i ? "SR" : "SL", ...CAM })), tools: ["screwdriver"] },
+ ...wallSteps({ yTop: yt, zBack: -D / 2, xs: [-260, 260] }),
+ ];
+ buildCustom(b, { ...s, custom: { parts, steps } });
+ const types = new Map<string, string>();
+ const ds = [0, 1, 2, 3].map((r) => ankDrawer(b, { cx: 0, yb: yb + r * pitch, ow: W - 2 * T, oh: pitch, zFace: D / 2, dd: D - T - 40, wire: true, types }));
+ ankDrawerSteps(b, ds, { scene: "drawer" });
+ ankDrawersIn(b, [ds], "Push the drawers in", "Line each up with its runners and push it all the way in. Start at the bottom.");
+}
+
+/* ---------------------------------------------------------------- chest of 6 drawers */
+
+function chest6(b: PlanBuilder, s: ProductSpec) {
+ const W = 1390, H = 870, D = 480, PL = 50, rows = 3;
+ const xo = W / 2 - T / 2, xi = W / 2 - T;
+ const yt = H - T;
+ const zF = D / 2 - 26 - T / 2;
+ const zB = -D / 2 + T / 2;
+ const cw = (W - 3 * T) / 2;
+ const hb = (yt - 40 - PL) / 2;
+ const pitch = (yt - PL) / rows;
+ const runY = (r: number) => PL + r * pitch + 50;
+ const parts: CustomPart[] = [
+ { id: "SL", name: "Side", size: [T, yt, D], pos: [-xo, yt / 2, 0] },
+ { id: "SR", name: "Side", size: [T, yt, D], pos: [xo, yt / 2, 0] },
+ { id: "DV", name: "Divider", size: [T, yt, zF - T / 2 - (zB + T / 2)], pos: [0, yt / 2, (zF - T / 2 + zB + T / 2) / 2] },
+ { id: "PF", name: "Plinth rail", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zF] },
+ { id: "TF", name: "Top front rail", size: [W - 2 * T, 40, T], pos: [0, yt - 20, zF] },
+ { id: "PB", name: "Back rail", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zB] },
+ { id: "TB", name: "Top back rail", size: [W - 2 * T, 40, T], pos: [0, yt - 20, zB] },
+ { id: "K0", name: "Back board", size: [W - 2 * T, hb, T], pos: [0, PL + hb / 2, zB] },
+ { id: "K1", name: "Back board", size: [W - 2 * T, hb, T], pos: [0, PL + hb * 1.5, zB] },
+ { id: "TP", name: "Top", size: [W, T, D], pos: [0, H - T / 2, 0] },
+ ];
+ const ys = { PF: PL / 2, TF: yt - 20, PB: PL / 2, TB: yt - 20, K0: PL + hb / 2, K1: PL + hb * 1.5 } as Record<string, number>;
+ const zs = { PF: zF, TF: zF, PB: zB, TB: zB, K0: zB, K1: zB } as Record<string, number>;
+ const ids = ["PF", "TF", "PB", "TB", "K0", "K1"];
+ const sideBolts = (sx: number, on: string) =>
+ fx("camScrew", ids.flatMap((id) => (id[0] === "K" ? [-70, 70].map((dy) => pt(sx * xi, ys[id] + dy, zs[id])) : [pt(sx * xi, ys[id] + 8, zs[id])])), [sx, 0, 0], { on });
+ const dowels = (id: string, dy: number[]) => S.map((sx) => fx("dowel", dy.map((d) => pt(sx * xi, ys[id] + d, zs[id])), [-sx, 0, 0], { on: id, ...DOWEL }));
+ const camsFor = (sx: number, list: string[]) =>
+ list.map((id) => {
+ const inward: Vec3 = zs[id] > 0 ? [0, 0, 1] : [0, 0, -1];
+ const face = zs[id] + (zs[id] > 0 ? -T / 2 : T / 2);
+ const pts = id[0] === "K" ? [-70, 70].map((dy) => pt(sx * (xi - 34), ys[id] + dy, face)) : [pt(sx * (xi - 34), ys[id] + 8, face)];
+ return fx("cam", pts, inward, { on: id, ...CAM });
+ });
+ const longScrews = (id: string) => fx("bolt", [pt(0, ys[id] + (id === "PF" ? 0 : 0), zF + T / 2)], [0, 0, -1], { len: 80, dia: 6, name: "Long connecting screw", on: id });
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into both sides",
+ detail: "Lay them on a rug, inside up. Eight in each, by hand until they stop.",
+ add: ["SL"],
+ fix: [sideBolts(-1, "SL"), sideBolts(1, "SR")],
+ wait: ["SR"],
+ tools: ["screwdriver"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ { title: "Screw the drawer runners inside the sides", detail: "Three on each side, three screws each. Check the marks for left and right.", fix: [0, 1, 2].flatMap((r) => [...runner(-xi, runY(r), -1, "SL"), ...runner(xi, runY(r), 1, "SR")]), tools: ["screwdriver"] },
+ { title: "Screw the drawer runners onto the divider", detail: "Three on each face, three screws each.", fix: [0, 1, 2].flatMap((r) => [...runner(-T / 2, runY(r), 1, "DV", -20), ...runner(T / 2, runY(r), -1, "DV", -20)]), wait: ["DV"], tools: ["screwdriver"] },
+ { title: "Tap the dowels into the front rails", detail: "Two in each end of the plinth rail and the top front rail.", fix: [...dowels("PF", [-12, 12]), ...dowels("TF", [-12, 12])].map((f) => ({ ...f, at: f.at!.map((p) => pt(p[0], p[1] - 4, p[2])) })), wait: ["PF", "TF"], tools: ["hammer"] },
+ {
+ title: "Screw the front rails to the divider and push them onto the side",
+ detail: "One long screw through each rail into the divider's front edge, then push the dowels into the side on the floor.",
+ add: ["PF", "TF", "DV"],
+ fix: [longScrews("PF"), longScrews("TF")],
+ from: { PF: [500, 0, 0], TF: [500, 0, 0], DV: [500, 0, 0] },
+ tools: ["screwdriver"],
+ },
+ { title: "Lock the front rails", detail: "One cam lock in each.", fix: camsFor(-1, ["PF", "TF"]), tools: ["screwdriver"] },
+ { title: "Tap the dowels into the back rails", detail: "Two in each end of both.", fix: [...dowels("PB", [-16, 16]), ...dowels("TB", [-12, 12])].map((f) => ({ ...f, at: f.at!.map((p) => pt(p[0], p[1] - 4, p[2])) })), wait: ["PB", "TB"], tools: ["hammer"] },
+ { title: "Fit the back rails", detail: "Into the side, at the bottom and the top of the back.", add: ["PB", "TB"] },
+ { title: "Lock the back rails", detail: "One cam lock in each.", fix: camsFor(-1, ["PB", "TB"]), tools: ["screwdriver"] },
+ { title: "Tap the dowels into the back boards", detail: "Two in each end of both boards.", fix: [...dowels("K0", [-110, 110]), ...dowels("K1", [-110, 110])], wait: ["K0", "K1"], tools: ["hammer"] },
+ { title: "Slide the back boards in", detail: "From the open end, behind the divider, onto the side's dowels.", add: ["K0", "K1"] },
+ { title: "Lock the back boards", detail: "Four cam locks.", fix: camsFor(-1, ["K0", "K1"]), tools: ["screwdriver"] },
+ { title: "Put on the other side", detail: "Together: push it onto all the dowels and cam bolts.", add: ["SR"], people: 2 },
+ { title: "Lock the other side", detail: "Eight cam locks.", fix: camsFor(1, ids), tools: ["screwdriver"] },
+ {
+ title: "Press in the foot strips",
+ detail: "Six, under the bottom edges of the sides and the divider, front and back.",
+ fix: [fx("glide", [-xo, 0, xo].flatMap((x) => [-150, 150].map((z) => pt(x, 0, z))), [0, 1, 0], FOOT)],
+ },
+ {
+ title: "Stand it up and tap in the dowels for the top",
+ detail: "Four in the top edge of each top rail, two in each side and four in the divider.",
+ fix: [
+ ...["TF", "TB"].map((id) => fx("dowel", [-450, -150, 150, 450].map((x) => pt(x, yt, zs[id])), [0, -1, 0], { on: id, ...DOWEL })),
+ ...S.map((sx, i) => fx("dowel", [-60, 60].map((z) => pt(sx * xo, yt, z)), [0, -1, 0], { on: i ? "SR" : "SL", ...DOWEL })),
+ fx("dowel", [-120, -40, 40, 120].map((z) => pt(0, yt, z - 13)), [0, -1, 0], { on: "DV", ...DOWEL }),
+ ],
+ pose: "+y",
+ people: 2,
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw six cam bolts under the top",
+ detail: "Lay the top upside down: two over each side and two over the divider.",
+ fix: [fx("camScrew", [-xo, 0, xo].flatMap((x) => [-150, 150].map((z) => pt(x, yt, z))), [0, 1, 0], { on: "TP" })],
+ wait: ["TP"],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw the wall brackets under the top", detail: "At the back, one near each end, with a screw and a washer.", fix: topBrackets([-400, 400], yt, -D / 2), tools: ["screwdriver"] },
+ { title: "Put the top on", detail: "Onto all the dowels.", add: ["TP"], people: 2 },
+ {
+ title: "Lock the top",
+ detail: "Six cam locks: inside the sides and both faces of the divider, near the top.",
+ fix: [
+ ...S.map((sx, i) => fx("cam", [-150, 150].map((z) => pt(sx * xi, yt - 34, z)), [sx, 0, 0], { on: i ? "SR" : "SL", ...CAM })),
+ fx("cam", [pt(-T / 2, yt - 34, -150), pt(T / 2, yt - 34, 150)], [1, 0, 0], { on: "DV", ...CAM }),
+ ],
+ tools: ["screwdriver"],
+ },
+ ...wallSteps({ yTop: yt, zBack: -D / 2, xs: [-400, 400] }),
+ ];
+ buildCustom(b, { ...s, custom: { parts, steps } });
+ const types = new Map<string, string>();
+ const cx = (c: number) => (c ? 1 : -1) * (T / 2 + cw / 2);
+ // the top row's boxes are low: an inner drawer runs above each one, behind the tall front
+ const inner = [0, 1].map((c) => ankDrawer(b, { cx: cx(c), yb: yt - 110, ow: cw - 30, oh: 110, zFace: D / 2 - 30, dd: D - T - 80, boxH: 70, strip: false, types }));
+ const top = [0, 1].map((c) => ankDrawer(b, { cx: cx(c), yb: PL + 2 * pitch, ow: cw, oh: pitch, zFace: D / 2, dd: D - T - 40, boxH: 110, wire: true, types }));
+ const low = [0, 1].flatMap((r) => [0, 1].map((c) => ankDrawer(b, { cx: cx(c), yb: PL + r * pitch, ow: cw, oh: pitch, zFace: D / 2, dd: D - T - 40, wire: true, types })));
+ ankDrawerSteps(b, inner, { scene: "inner", label: "inner drawer" });
+ ankDrawerSteps(b, top, { scene: "top-drawer" });
+ ankDrawerSteps(b, low, { scene: "drawer" });
+ b.step({ title: "Slide in the inner drawers", detail: "Into the top of each half, then screw in the four stops so they pull out no more than 18 cm.", kind: "drawer", tools: ["screwdriver"] }, () => {
+ for (const d of inner) for (const k of [d.front, ...d.sides, d.back, d.bottom]) b.add(k, [0, 0, 480]);
+ b.then(0.1);
+ b.fits({ kind: "screw", len: 10, dia: 4, name: "Stop screw" }, inner.flatMap((d) => S.map((g): FitOpts => ({ at: [d.cx + g * (d.bw / 2 - 20), yt, -D / 2 + 60], dir: [0, 1, 0] }))), 0.1);
+ });
+ ankDrawersIn(b, [low, top], "Push the drawers in", "Each onto its runners, all the way in. The low top-row drawers go at the top, under the inner drawers.");
+}
+
+/* ---------------------------------------------------------------- wardrobe with sliding doors */
+
+function wardrobe(b: PlanBuilder, s: ProductSpec) {
+ const W = 980, H = 1900, D = 600, PL = 60;
+ const xo = W / 2 - T / 2, xi = W / 2 - T;
+ const yt = H - T, yb = PL + T;
+ const zDoor = [D / 2 - 14, D / 2 - 40]; // front and back door
+ const zC = D / 2 - 60; // carcass parts stop here, the doors run in front
+ const zB = -D / 2 + 10;
+ const dep = zC - (zB + 2);
+ const zm = (zC + zB + 2) / 2;
+ const yS = 340; // fixed shelf over the drawers
+ const dvx = 40; // the divider sits a little right of the middle
+ const parts: CustomPart[] = [
+ { id: "SL", name: "Side", size: [T, H, D], pos: [-xo, H / 2, 0] },
+ { id: "SR", name: "Side", size: [T, H, D], pos: [xo, H / 2, 0] },
+ { id: "BT", name: "Bottom", size: [W - 2 * T, T, D - 20], pos: [0, PL + T / 2, -10] },
+ { id: "PF", name: "Plinth", size: [W - 2 * T, PL, T], pos: [0, PL / 2, D / 2 - 20 - T / 2] },
+ { id: "FS", name: "Fixed shelf", size: [W - 2 * T, T, D / 2 - (zB + 2)], pos: [0, yS + T / 2, (D / 2 + zB + 2) / 2] },
+ { id: "DD", name: "Drawer divider", size: [T, yS - yb, D / 2 - 20 - (zB + 2)], pos: [0, (yS + yb) / 2, (D / 2 - 20 + zB + 2) / 2] },
+ { id: "DV", name: "Divider", size: [T, yt - yS - T, dep], pos: [dvx, (yt + yS + T) / 2, zm] },
+ { id: "TP", name: "Top", size: [W - 2 * T, T, D - 20], pos: [0, yt + T / 2, -10] },
+ ...S.map((sx, i): CustomPart => ({ id: `B${i}`, name: "Back panel", size: [W / 2 - T + 4, H - PL - 4, 3], pos: [sx * (W / 4 - T / 2 + 1), (H + PL) / 2, zB], material: "fiber" })),
+ { id: "UT", name: "Upper door track", size: [W - 2 * T, 20, 56], pos: [0, yt - 10, D / 2 - 28], material: "metal" },
+ { id: "LT", name: "Lower door track", size: [W - 2 * T, 8, 56], pos: [0, yS + T + 4, D / 2 - 28], material: "metal" },
+ ...[0, 1].map((k): CustomPart => {
+ const x0 = k ? dvx + T / 2 : -xi, x1 = k ? xi : dvx - T / 2;
+ return { id: `R${k}`, name: "Clothes rail", size: [x1 - x0 - 4, 25, 25], pos: [(x0 + x1) / 2, yt - 80, zm], shape: "cyl", material: "metal" };
+ }),
+ ...[0, 1, 2].map((k): CustomPart => ({ id: `L${k}`, name: "Shelf", size: [xi - dvx - T / 2 - 2, T, dep - 20], pos: [(xi + dvx + T / 2) / 2, yS + 340 + k * 330, zm - 10] })),
+ { id: "DB", name: "Sliding door", size: [W / 2 - T + 20, yt - 20 - (yS + T + 8), 18], pos: [-(W / 4 - T / 2 - 10), (yt - 20 + yS + T + 8) / 2, zDoor[1]] },
+ { id: "DF", name: "Sliding door", size: [W / 2 - T + 20, yt - 20 - (yS + T + 8), 18], pos: [W / 4 - T / 2 - 10, (yt - 20 + yS + T + 8) / 2, zDoor[0]] },
+ ];
+ const yOf: Record<string, number> = { BT: PL + T / 2, PF: PL / 2, FS: yS + T / 2, TP: yt + T / 2 };
+ const zOf: Record<string, number[]> = { BT: [-160, 160], PF: [D / 2 - 20 - T / 2], FS: [-160, 160], TP: [-160, 160] };
+ const sideBolts = (sx: number, on: string, ids: string[]) => fx("camScrew", ids.flatMap((id) => zOf[id].map((z) => pt(sx * xi, yOf[id], z + 40))), [sx, 0, 0], { on });
+ const dowels = (id: string) => S.map((sx) => fx("dowel", zOf[id].map((z) => pt(sx * xi, yOf[id], z)), [-sx, 0, 0], { on: id, ...DOWEL }));
+ const cams = (sx: number, ids: string[]) =>
+ ids.map((id) => {
+ const up = id !== "TP";
+ const face = id === "PF" ? D / 2 - 20 - T : 0;
+ if (id === "PF") return fx("cam", [pt(sx * (xi - 34), PL / 2, face)], [0, 0, 1], { on: id, ...CAM });
+ return fx("cam", zOf[id].map((z) => pt(sx * (xi - 34), up ? yOf[id] + T / 2 : yOf[id] - T / 2, z + 40)), [0, up ? -1 : 1, 0], { on: id, ...CAM });
+ });
+ const ids = ["TP", "FS", "BT", "PF"];
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into both sides",
+ detail: "Lay them on a rug, inside up. Seven in each, by hand until they stop.",
+ add: ["SL"],
+ fix: [sideBolts(-1, "SL", ids), sideBolts(1, "SR", ids)],
+ wait: ["SR"],
+ tools: ["screwdriver"],
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the drawer runners in",
+ detail: "One low on each side and one on each face of the drawer divider, three screws each.",
+ fix: [...runner(-xi, yb + 50, -1, "SL", 40), ...runner(xi, yb + 50, 1, "SR", 40), ...runner(-T / 2, yb + 50, 1, "DD", 40), ...runner(T / 2, yb + 50, -1, "DD", 40)],
+ wait: ["DD"],
+ tools: ["screwdriver"],
+ },
+ { title: "Tap the dowels into the panels", detail: "Two in each end of the top, the fixed shelf and the bottom, one in each end of the plinth.", fix: [...dowels("TP"), ...dowels("FS"), ...dowels("BT"), ...dowels("PF")], wait: ["TP", "FS", "BT", "PF"], tools: ["hammer"] },
+ { title: "Push the fixed shelf onto the side", detail: "Onto the side's dowels and cam bolts, then stand the two dividers against it.", add: ["FS", "DD", "DV"], from: { FS: [600, 0, 0], DD: [600, 0, 0], DV: [600, 0, 0] } },
+ {
+ title: "Screw the drawer divider and the divider to the fixed shelf",
+ detail: "Two long screws through the shelf into each: the drawer divider below, the divider above.",
+ fix: [
+ fx("bolt", [-100, 100].map((z) => pt(0, yS + T, zm + z)), [0, -1, 0], { len: 80, dia: 6, name: "Long connecting screw", on: "FS" }),
+ fx("bolt", [-100, 100].map((z) => pt(dvx, yS, zm + z)), [0, 1, 0], { len: 80, dia: 6, name: "Long connecting screw", on: "FS" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Fit the top, the bottom and the plinth", detail: "All onto the dowels and cam bolts of the side.", add: ["TP", "BT", "PF"] },
+ { title: "Lock them to the side", detail: "Seven cam locks, arrow towards the bolt.", fix: cams(-1, ids), tools: ["screwdriver"] },
+ {
+ title: "Screw the dividers to the top and the bottom",
+ detail: "Long screws through the top into the divider and through the bottom into the drawer divider.",
+ fix: [
+ fx("bolt", [-100, 100].map((z) => pt(dvx, yt + T, zm + z)), [0, -1, 0], { len: 80, dia: 6, name: "Long connecting screw", on: "TP" }),
+ fx("bolt", [-100, 100].map((z) => pt(0, PL, zm + z)), [0, 1, 0], { len: 80, dia: 6, name: "Long connecting screw", on: "BT" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Put on the other side", detail: "Together: onto all the dowels and cam bolts.", add: ["SR"], people: 2 },
+ { title: "Lock the other side", detail: "Seven cam locks.", fix: cams(1, ids), tools: ["screwdriver"] },
+ { title: "Slide the back panels in", detail: "Both halves along the grooves, smooth side out.", add: ["B0", "B1"], from: { B0: [0, 1500, 0], B1: [0, 1500, 0] } },
+ {
+ title: "Fix the back with the connectors",
+ detail: "Fourteen along the shelf, the dividers and the edges: push each sleeve in, then its pin.",
+ fix: [
+ fx("clip", [...[-xo, xo].flatMap((x) => [500, 1100, 1700].map((y) => pt(x, y, zB - 2))), ...[-300, 300].map((x) => pt(x, yS + T / 2, zB - 2)), ...[700, 1200, 1700].map((y) => pt(dvx, y, zB - 2)), pt(0, 200, zB - 2), ...[-300, 300].map((x) => pt(x, yt + 8, zB - 2)), pt(0, yt + 8, zB - 2)], [0, 0, 1], { name: "Back connector sleeve", len: 12, dia: 10 }),
+ fx("clip", [...[-xo, xo].flatMap((x) => [500, 1100, 1700].map((y) => pt(x, y, zB - 3))), ...[-300, 300].map((x) => pt(x, yS + T / 2, zB - 3)), ...[700, 1200, 1700].map((y) => pt(dvx, y, zB - 3)), pt(0, 200, zB - 3), ...[-300, 300].map((x) => pt(x, yt + 8, zB - 3)), pt(0, yt + 8, zB - 3)], [0, 0, 1], { name: "Back connector pin", len: 14, dia: 8 }),
+ ],
+ },
+ { title: "Screw the wall brackets on top", detail: "At the back, one near each end, with a screw and a washer.", fix: topBrackets([-300, 300], H, -D / 2 + 10).map((f) => ({ ...f, dir: [0, -1, 0] as Vec3 })), tools: ["screwdriver"] },
+ { title: "Stand it up", detail: "Together, and mind the ceiling: stand it up next to where it goes.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Press in the foot strips",
+ detail: "Tip it back a little at a time: six, under the sides and the plinth.",
+ fix: [fx("glide", [...S.flatMap((sx) => [-200, 200].map((z) => pt(sx * xo, 0, z))), ...[-200, 200].map((x) => pt(x, 0, D / 2 - 20 - T / 2))], [0, 1, 0], FOOT)],
+ people: 2,
+ },
+ ...wallSteps({ yTop: H + 20, zBack: -D / 2, xs: [-300, 300] }),
+ { title: "Press the door tracks in", detail: "The upper track under the top and the lower track along the front of the fixed shelf, along their whole length.", add: ["UT", "LT"] },
+ { title: "Clip in the rail holders", detail: "Two in each compartment, near the top.", fix: [fx("clip", [pt(-xi, yt - 80, zm), pt(dvx - T / 2, yt - 80, zm)], [1, 0, 0], { name: "Rail holder", len: 30, dia: 30 }), fx("clip", [pt(dvx + T / 2, yt - 80, zm), pt(xi, yt - 80, zm)], [-1, 0, 0], { name: "Rail holder", len: 30, dia: 30 })] },
+ { title: "Drop the clothes rails in", detail: "One in each compartment.", add: ["R0", "R1"] },
+ {
+ title: "Push in the shelf pins",
+ detail: "Twelve in the right compartment, four at the height of each shelf.",
+ fix: [0, 1, 2].flatMap((k) => [fx("pin", [-150, 150].map((z) => pt(dvx + T / 2, yS + 340 + k * 330 - T / 2 - 4, zm + z)), [-1, 0, 0]), fx("pin", [-150, 150].map((z) => pt(xi, yS + 340 + k * 330 - T / 2 - 4, zm + z)), [1, 0, 0])]).map((f) => ({ ...f, dir: [f.at![0][0] > dvx + 20 ? 1 : -1, 0, 0] as Vec3 })),
+ },
+ { title: "Lay the shelves on the pins", detail: "Three of them.", add: ["L0", "L1", "L2"] },
+ {
+ title: "Fit the door wheels and guides",
+ detail: "Lay the doors on a rug. Two guides in the top edge and two wheels in the bottom edge of each, pushed in until they click.",
+ fix: [
+ ...[["DB", 1], ["DF", 0]].flatMap(([id, k]) => {
+ const p = parts.find((x) => x.id === id)!;
+ const top = p.pos[1] + p.size[1] / 2, bot = p.pos[1] - p.size[1] / 2;
+ return [
+ fx("clip", [-1, 1].map((g) => pt(p.pos[0] + g * (p.size[0] / 2 - 60), top, zDoor[k as number])), [0, -1, 0], { name: "Top guide", len: 20, dia: 16, on: id as string }),
+ fx("castor", [-1, 1].map((g) => pt(p.pos[0] + g * (p.size[0] / 2 - 60), bot, zDoor[k as number])), [0, 1, 0], { name: "Door wheel", len: 20, dia: 24, on: id as string }),
+ ];
+ }),
+ ],
+ wait: ["DB", "DF"],
+ warnings: ["floor"],
+ },
+ { title: "Hang the back door", detail: "Top into the upper track's back groove, then lift and swing the bottom in until the wheels click onto the lower track.", add: ["DB"], from: { DB: [0, 0, 400] } },
+ { title: "Hang the front door", detail: "The same in the front grooves.", add: ["DF"], from: { DF: [0, 0, 400] } },
+ { title: "Adjust the doors", detail: "Turn the four wheel screws until the doors hang straight and meet the sides evenly.", tools: ["screwdriver"], check: "square" },
+ {
+ title: "Screw the door stops in",
+ detail: "One on each side under the top, two screws each, so the doors stop before they hit the sides.",
+ fix: [...S.map((sx, i) => fx("clip", [pt(sx * xi, yt - 40, D / 2 - 30)], [sx, 0, 0], { name: "Door stop", len: 30, dia: 20, on: i ? "SR" : "SL" })), ...S.map((sx, i) => fx("screw", [-80, -40].map((dz) => pt(sx * xi, yt - 40, D / 2 + dz)), [sx, 0, 0], { len: 12, dia: 4, on: i ? "SR" : "SL" }))],
+ tools: ["screwdriver"],
+ },
+ ];
+ buildCustom(b, { ...s, custom: { parts, steps } });
+ const types = new Map<string, string>();
+ const cw = W / 2 - T - T / 2;
+ const ds = S.map((sx) => ankDrawer(b, { cx: sx * (T / 2 + cw / 2), yb, ow: cw, oh: yS - yb, zFace: D / 2, dd: D / 2 - 16 - zB - 30, types }));
+ ankDrawerSteps(b, ds, { scene: "drawer" });
+ ankDrawersIn(b, [ds], "Push the drawers in", "Onto their runners under the fixed shelf, all the way in.");
+}
+
+const family: Family = {
+ names: ["ANKARUDDEN"],
+ build(b, s) {
+ const slug = s.slug ?? "";
+ if (slug === "ankarudden-chest-4-drawers-80-x-48-x-107") return chest4(b, s), true;
+ if (slug === "ankarudden-chest-6-drawers-139-x-48-x-87") return chest6(b, s), true;
+ if (slug === "ankarudden-wardrobe-sliding-doors-98-x-60-x-190") return wardrobe(b, s), true;
+ return false;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/applaryd.ts b/src/lib/plan/families/applaryd.ts
index ca44a59..579c056 100644
--- a/src/lib/plan/families/applaryd.ts
+++ b/src/lib/plan/families/applaryd.ts
@@ -122,7 +122,8 @@ function sofaBody(p: string, x0: number, seatL: number, side: "both" | "right"):
{
title: side === "both" ? "Hook the armrests on together" : "Hook the armrest onto the other end together",
detail: "Hold it against the end and slide it down so the hook drops into the slot in the frame.",
- ...(side === "right" ? { add: armIds, fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 + seatL), dir: [-1, 0, 0], on: `${p}armR` }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + seatL), dir: [-1, 0, 0], on: `${p}armR` })] } : {}),
+ ...(side === "right" ? { add: armIds, fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 + seatL), dir: [-1, 0, 0], on: `${p}armR` }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + seatL - 3), dir: [1, 0, 0], on: `${p}armR` })] } : {}),
+ ...(side === "both" ? { add: armIds } : {}),
people: 2,
warnings: ["two"],
},
@@ -175,11 +176,11 @@ function chaiseBody(p: string, x0: number, w: number, arm: boolean): CustomStep[
{
title: "Screw the hook plates onto both armrests",
detail: "From the sofa's box: one plate and one screw on each armrest. One goes on the chaise now, the other on the sofa later.",
- add: [`${p}armL`],
- fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0), dir: [1, 0, 0], on: `${p}armL` }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0), dir: [1, 0, 0], on: `${p}armL` })],
+ wait: [`${p}armL`],
+ fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0), dir: [1, 0, 0], on: `${p}armL` }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + 3), dir: [-1, 0, 0], on: `${p}armL` })],
tools: ["screwdriver"],
} as CustomStep,
- { title: "Lower an armrest onto the end of the chaise", detail: "On the end facing up, at the backrest. Slide it so the hook drops into the slot." },
+ { title: "Lower an armrest onto the end of the chaise", detail: "On the end facing up, at the backrest. Slide it so the hook drops into the slot.", add: [`${p}armL`] },
{
title: "Bolt the armrest on by hand",
detail: "Two long bolts from the sofa's box, each with a big washer, through the end of the seat frame.",
@@ -210,8 +211,8 @@ function sofa(s: ProductSpec): CustomParams | null {
{
title: "Screw a hook plate onto each armrest",
detail: "Lay them on the rug, inside face up. One screw through each plate, hook pointing to the back.",
- add: ["armL", "armR"],
- fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 - 1), dir: [1, 0, 0], on: "armL" }), fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 + seatL + 1), dir: [-1, 0, 0], on: "armR" }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 - 1), dir: [1, 0, 0], on: "armL" }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + seatL + 1), dir: [-1, 0, 0], on: "armR" })],
+ wait: ["armL", "armR"],
+ fix: [fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 - 1), dir: [1, 0, 0], on: "armL" }), fx({ kind: "hook", name: "Hook plate", len: 60, dia: 30, at: hookAt(x0 + seatL + 1), dir: [-1, 0, 0], on: "armR" }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + 3), dir: [-1, 0, 0], on: "armL" }), fx({ kind: "screw", len: 16, dia: 4, at: hookAt(x0 + seatL - 3), dir: [1, 0, 0], on: "armR" })],
tools: ["screwdriver"],
pose: "+z",
},
diff --git a/src/lib/plan/families/arsunda.ts b/src/lib/plan/families/arsunda.ts
index 28ed13f..ed52973 100644
--- a/src/lib/plan/families/arsunda.ts
+++ b/src/lib/plan/families/arsunda.ts
@@ -76,7 +76,9 @@ function armchair(s: ProductSpec): CustomParams {
parts.push({ id: "RF", name: "Rail", size: [2 * xi, 50, 30], pos: [0, yRail, zPost], material: "wood" });
parts.push({ id: "RB", name: "Rail", size: [2 * xi, 30, 50], pos: [0, 15, zBack], material: "wood" });
- const ends = (y: number, z: number): Vec3[] => [-1, 1].map((sx) => [sx * xt, y, z] as Vec3);
+ // one fitting at each end, from the outside of the side tube in towards the middle
+ const tubeEnds = (kind: CustomFix["kind"], p: Vec3, mate: string, o: Partial<CustomFix>): CustomFix[] =>
+ ([[-1, "S1"], [1, "S2"]] as const).map(([sx, on]) => at(kind, [[sx * (xt + 10), p[1], p[2]]], [-sx, 0, 0], on, mate, o));
const sideScrews = (id: "L" | "R") => {
const sx = id === "L" ? -1 : 1;
return [
@@ -96,7 +98,7 @@ function armchair(s: ProductSpec): CustomParams {
title: "Bolt the side tubes to the cross tube",
detail: "Lay the two bent tubes on a rug with their curves the same way. Turn the bolts in by hand first, then tighten.",
add: ["S1", "S2", "X"],
- fix: [at("bolt", ends(B[1], B[2]).map((p) => [p[0] + Math.sign(p[0]) * 10, p[1], p[2]] as Vec3), [1, 0, 0], "S1", "X", { len: 30, dia: 6 })],
+ fix: tubeEnds("bolt", B, "X", { len: 30, dia: 6 }),
tools: ["allen"],
warnings: ["floor"],
},
@@ -104,14 +106,14 @@ function armchair(s: ProductSpec): CustomParams {
title: "Screw the top tube between them",
detail: "Push it onto the tops of the side tubes so the holes line up, one screw at each end.",
add: ["TT"],
- fix: [at("screw", ends(T[1], T[2]).map((p) => [p[0] + Math.sign(p[0]) * 10, p[1], p[2]] as Vec3), [1, 0, 0], "S1", "TT", { len: 12, dia: 4 })],
+ fix: tubeEnds("screw", T, "TT", { len: 12, dia: 4 }),
tools: ["screwdriver"],
},
{
title: "Screw the front tube on",
detail: "Same at the front of the seat: one screw at each end.",
add: ["FT"],
- fix: [at("screw", ends(F[1], F[2]).map((p) => [p[0] + Math.sign(p[0]) * 10, p[1], p[2]] as Vec3), [1, 0, 0], "S1", "FT", { len: 12, dia: 4 })],
+ fix: tubeEnds("screw", F, "FT", { len: 12, dia: 4 }),
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/askholmen.ts b/src/lib/plan/families/askholmen.ts
index 870d6ea..d0f016e 100644
--- a/src/lib/plan/families/askholmen.ts
+++ b/src/lib/plan/families/askholmen.ts
@@ -10,7 +10,8 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* Table: built upside down on a rug. The two leg frames are bolted to the top's edge rails (long bolt, washer and
* sleeve nut at each of four joints), two braces run from the top's middle rail to the frames' lower rails, screwed
* at the top and bolted into barrel nuts at the foot, then two people turn it over.
- * The folding chair and folding table come assembled (no manual), so they keep their old guides.
+ * The folding chair and the small folding table are sold assembled and have no manual: their guides only unfold
+ * them (and tie the chair's cushion on).
*/
const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
@@ -112,7 +113,7 @@ function tableRecipe(s: ProductSpec): CustomParams {
const frame: PartPiece[] = [
...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [50, legH, 50], pos: [0, 0, g * LZ] })),
{ shape: "box", size: [45, 70, 2 * LZ - 50], pos: [0, legH / 2 - 35, 0] },
- { shape: "box", size: [40, 50, 2 * LZ - 50], pos: [0, 160 - legH / 2, 0] },
+ { shape: "box", size: [40, 50, 2 * LZ - 50], pos: [0, 180 - legH / 2, 0] },
];
// the braces run from the top's middle rail down to each frame's lower rail
const bx0 = 300, by0 = H - TT - 40, bx1 = LX - 25, by1 = 185;
@@ -153,7 +154,7 @@ function tableRecipe(s: ProductSpec): CustomParams {
detail: "A barrel nut in the foot of each brace, slot facing the bolt, then a bolt through the frame's lower rail into it.",
fix: [
{ kind: "nut", name: "Barrel nut", count: 2, len: 14, dia: 10, at: [-1, 1].map((g) => pt(g * (bx1 - 40), by1 + 20, 0)), dir: [0, 0, -1] },
- ...[-1, 1].map((g): CustomFix => ({ kind: "bolt", count: 1, len: 60, dia: 6, at: [pt(g * (LX + 20), by1 - 15, 0)], dir: [-g, 0, 0] })),
+ ...[-1, 1].map((g): CustomFix => ({ kind: "bolt", count: 1, len: 60, dia: 6, at: [pt(g * (LX + 20), by1 + 10, 0)], dir: [-g, 0, 0] })),
],
tools: ["flathead", "allen"],
},
@@ -162,11 +163,93 @@ function tableRecipe(s: ProductSpec): CustomParams {
return { parts, steps };
}
+
+/* ---------------------------------------------------------------- sold folded: the chair and the 60x62 table */
+
+/** A wooden bar from a to b (mm, relative to the part's middle), leaning front to back or lying along x. */
+function bar(a: Vec3, b: Vec3, t: Vec3 = [40, 40, 22]): PartPiece {
+ const d: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...d);
+ const mid: Vec3 = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
+ if (Math.abs(d[0]) > Math.abs(d[1]) && Math.abs(d[0]) > Math.abs(d[2])) return { shape: "box", size: [len, t[1], t[2]], pos: mid };
+ return { shape: "box", size: [t[0], len, t[2]], pos: mid, rot: [Math.atan2(d[2], d[1]), 0, 0] };
+}
+const shift = (ps: PartPiece[], c: Vec3): PartPiece[] => ps.map((p) => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] as Vec3 }));
+
+/** The folding chair: a long frame from the front feet up into the slatted back, a rear leg frame and the seat. */
+function foldingChair(s: ProductSpec): CustomParams {
+ // IKEA: 36 wide, 49 deep, 87 high
+ const W = Math.round(s.size.w * 10) || 360, H = Math.round(s.size.h * 10) || 870, D = Math.round(s.size.d * 10) || 490;
+ const ys = 450, xo = W / 2 - 20, xi = xo - 40;
+ const zf = D / 2 - 30, zb = -D / 2 + 30;
+ const top: Vec3 = [0, H - 10, -D / 2 + 60];
+ const main: PartPiece[] = [
+ ...[-1, 1].map((g) => bar([g * xo, 0, zf], [g * xo, top[1], top[2]])),
+ bar([-xo, 90, zf - 12], [xo, 90, zf - 12], [40, 50, 20]),
+ ...[0, 1, 2].map((k): PartPiece => {
+ const y = H - 60 - k * 85, z = zf + ((top[2] - zf) * y) / top[1] - 12;
+ return { shape: "box", size: [2 * xo - 40, 60, 16], pos: [0, y, z], rot: [Math.atan2(top[2] - zf, top[1]), 0, 0] };
+ }),
+ ];
+ const rear: PartPiece[] = [...[-1, 1].map((g) => bar([g * xi, ys - 30, zf - 50], [g * xi, 0, zb])), bar([-xi, 110, zb + 30], [xi, 110, zb + 30], [40, 50, 20])];
+ const seat: PartPiece[] = Array.from({ length: 8 }, (_, k): PartPiece => ({ shape: "box", size: [2 * xi + 20, 18, 34], pos: [0, ys - 9, -D / 2 + 90 + k * 42] }));
+ const cF: Vec3 = [0, H / 2, 0], cR: Vec3 = [0, ys / 2, 0], cS: Vec3 = [0, ys - 9, 0];
+ const parts: CustomPart[] = [
+ { id: "F", name: "Front legs with backrest", size: [W, H, D], pos: cF, pieces: shift(main, cF), material: "wood" },
+ { id: "R", name: "Back legs", size: [2 * xi + 40, ys, D], pos: cR, pieces: shift(rear, cR), material: "wood" },
+ { id: "S", name: "Seat", size: [2 * xi + 20, 18, 340], pos: cS, pieces: shift(seat, cS), material: "wood" },
+ { id: "C", name: "Chair cushion", size: [W - 20, 60, 350], pos: [0, ys + 30, 0], material: "soft" },
+ ];
+ const steps: CustomStep[] = [
+ { title: "Stand the folded chair on its front feet", detail: "It comes assembled, with nothing to screw together. Hold it by the top of the back.", add: ["F"] },
+ { title: "Swing the back legs out", detail: "Pull them back until all four feet stand on the floor.", add: ["R"], from: { R: [0, 0, 280] }, warnings: ["hand"] },
+ { title: "Press the seat down", detail: "Push it down flat until it rests on the frame. To fold the chair, lift the front of the seat; keep your fingers clear of the joints.", add: ["S"], from: { S: [0, 300, 120] }, warnings: ["hand"] },
+ { title: "Tie the cushion on", detail: "Lay it on the seat and tie its strings round the back legs so it stays put.", add: ["C"], from: { C: [0, 250, 0] } },
+ ];
+ return { parts, steps };
+}
+
+/** The small folding table: the top with one leg frame fixed under it, and a second frame that swings out across it. */
+function foldingTable(s: ProductSpec): CustomParams {
+ // IKEA: 60 wide, 62 deep, 73 high
+ const W = Math.round(s.size.w * 10) || 600, D = Math.round(s.size.d * 10) || 620, H = Math.round(s.size.h * 10) || 730;
+ const tt = 20, n = 9;
+ const yu = H - tt - 30; // the legs' top ends, on the cleats under the top
+ const xo = W / 2 - 60, xi = xo - 42;
+ const sw = (D - (n - 1) * 8) / n;
+ const top: PartPiece[] = [
+ ...Array.from({ length: n }, (_, i): PartPiece => ({ shape: "box", size: [W, tt, sw], pos: [0, H - tt / 2, -D / 2 + sw / 2 + i * (sw + 8)] })),
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [30, 40, D - 80], pos: [g * (xo + 35), H - tt - 20, 0] })),
+ ];
+ // the fixed frame leans one way, the swinging one the other: they cross in an X seen from the side
+ const frame = (x: number, lean: number): PartPiece[] => {
+ const a: Vec3 = [0, yu, lean * (D / 2 - 60)], f: Vec3 = [0, 0, -lean * (D / 2 - 30)];
+ const at = (k: number): [number, number] => [a[1] + (f[1] - a[1]) * k, a[2] + (f[2] - a[2]) * k];
+ return [
+ ...[-1, 1].map((g) => bar([g * x, a[1], a[2]], [g * x, f[1], f[2]])),
+ bar([-x, at(0.2)[0], at(0.2)[1]], [x, at(0.2)[0], at(0.2)[1]], [40, 60, 20]),
+ bar([-x, at(0.85)[0], at(0.85)[1]], [x, at(0.85)[0], at(0.85)[1]], [40, 60, 20]),
+ ];
+ };
+ const cT: Vec3 = [0, H / 2, 0], cL: Vec3 = [0, yu / 2, 0];
+ const parts: CustomPart[] = [
+ { id: "T", name: "Top with outer legs", size: [W, H, D], pos: cT, pieces: shift([...top, ...frame(xo, 1)], cT), material: "wood" },
+ { id: "L", name: "Inner leg frame", size: [2 * xi + 40, yu, D], pos: cL, pieces: shift(frame(xi, -1), cL), material: "wood" },
+ ];
+ const steps: CustomStep[] = [
+ { title: "Stand the folded table on its outer legs", detail: "It comes assembled, with no fittings: the inner legs lie folded under the top.", add: ["T"] },
+ { title: "Swing the inner legs out", detail: "Pull them away from the outer legs until both pairs stand on the floor.", add: ["L"], from: { L: [0, 150, -300] }, warnings: ["hand"] },
+ { title: "Check the top lies level", detail: "Its ends rest on the inner legs. To fold it, lift the top at that end and keep your fingers clear of the joints." },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["ASKHOLMEN"],
recipe(s) {
const slug = s.slug ?? "";
- if (/fold/i.test(s.variant) || slug === "askholmen-chair-outdoor" || slug === "askholmen-table-outdoor-60-x-62") return null;
+ if (slug === "askholmen-chair-outdoor") return foldingChair(s);
+ if (slug === "askholmen-table-outdoor-60-x-62") return foldingTable(s);
if (s.archetype === "seat" && s.seat?.arms) return chairRecipe();
if (s.archetype === "table" && s.size.w > 100) return tableRecipe(s);
return null;
diff --git a/src/lib/plan/families/asperod.ts b/src/lib/plan/families/asperod.ts
index d48941b..fa5e9fd 100644
--- a/src/lib/plan/families/asperod.ts
+++ b/src/lib/plan/families/asperod.ts
@@ -53,7 +53,10 @@ function table(s: ProductSpec, round: boolean): CustomParams {
return [r * Math.sin(a), 0, r * Math.cos(a)];
})
: [[-1, -1], [1, -1], [-1, 1], [1, 1]].map(([sx, sz]) => [sx * (W / 2 - LEG / 2 - 4), 0, sz * (D / 2 - LEG / 2 - 4)]);
- const parts: CustomPart[] = [round ? ringFrame("A", "Top frame", W, yTop) : rectFrame("A", "Top frame", W, D, yTop, 2)];
+ const top = round ? ringFrame("A", "Top frame", W, yTop) : rectFrame("A", "Top frame", W, D, yTop, 2);
+ // the corner plates the legs screw up into, flush with the frame's underside
+ top.pieces!.push(...legs.map((p): PartPiece => ({ shape: "box", size: [LEG + 6, 4, LEG + 6], pos: [p[0], -BH / 2 + 2, p[2]] })));
+ const parts: CustomPart[] = [top];
legs.forEach((p, i) =>
parts.push({ id: `L${i + 1}`, name: "Leg", shape: "cyl", size: [LEG, legTop - foot, LEG], pos: [p[0], foot + (legTop - foot) / 2, p[2]], material: "metal" }),
);
@@ -68,7 +71,13 @@ function table(s: ProductSpec, round: boolean): CustomParams {
});
const lowW = round ? W - 2 * (LEG + 10) : W - 2 * (LEG + 10);
const lowD = round ? lowW : D - 2 * (LEG + 10);
- parts.push(round ? ringFrame("B", "Shelf frame", lowW, yLow) : rectFrame("B", "Shelf frame", lowW, lowD, yLow, 1));
+ const low = round ? ringFrame("B", "Shelf frame", lowW, yLow) : rectFrame("B", "Shelf frame", lowW, lowD, yLow, 1);
+ // a tab at the bottom of the frame over each bracket, for its two screws
+ low.pieces!.push(...legs.map((p): PartPiece => {
+ const q = inward(p, LEG / 2 + 14);
+ return { shape: "box", size: [26, 4, 26], pos: [q[0], -BH / 2 + 2, q[2]] };
+ }));
+ parts.push(low);
const glass = (id: string, name: string, w: number, d: number, y: number): CustomPart =>
round
? { id, name, shape: "cyl", size: [w, GLASS, w], pos: [0, y, 0], material: "glass" }
@@ -82,7 +91,8 @@ function table(s: ProductSpec, round: boolean): CustomParams {
"bolt",
ids.flatMap((i) => {
const p = legs[i];
- return [[p[0] - 8, legTop + BH, p[2]], [p[0] + 8, legTop + BH, p[2] - 6], [p[0], legTop + BH, p[2] + 8]] as Vec3[];
+ // spread as far as the tube allows, so the engine keeps them apart without moving them
+ return [[p[0] - 12, legTop + 4, p[2] - 12], [p[0] + 12, legTop + 4, p[2] - 12], [p[0], legTop + 4, p[2] + 12]] as Vec3[];
}),
[0, -1, 0],
{ len: 12, dia: 6, on: "A", to: ids.map((i) => `L${i + 1}`) },
@@ -93,7 +103,7 @@ function table(s: ProductSpec, round: boolean): CustomParams {
"screw",
legs.flatMap((p) => {
const q = inward(p, LEG / 2 + 14);
- return [[q[0] - 6, yLow + BH / 2, q[2]], [q[0] + 6, yLow + BH / 2, q[2]]] as Vec3[];
+ return [[q[0] - 12, yLow - BH / 2 + 4, q[2]], [q[0] + 12, yLow - BH / 2 + 4, q[2]]] as Vec3[];
}),
[0, -1, 0],
{ len: 10, dia: 5, on: "B", to: ["K1", "K2", "K3", "K4"] },
diff --git a/src/lib/plan/families/baggboda.ts b/src/lib/plan/families/baggboda.ts
index 0d1cd67..4f37050 100644
--- a/src/lib/plan/families/baggboda.ts
+++ b/src/lib/plan/families/baggboda.ts
@@ -82,8 +82,9 @@ function table(s: ProductSpec): CustomParams {
detail: "Lay the top face down on the rug and set the frame on it upside down. A washer goes under each short bolt.",
add: ["T"],
fix: [
- at("washer", [...under(-xu, yTop - r), ...under(xu, yTop - r)], [0, 1, 0], "U1", undefined, { len: 1.5, dia: 16 }),
+ // bolts listed first: a washer may share its bolt's point, not the other way round
at("bolt", [...under(-xu, yTop - r), ...under(xu, yTop - r)], [0, 1, 0], "U1", "T", { len: 20, dia: 6 }),
+ at("washer", [...under(-xu, yTop - r), ...under(xu, yTop - r)], [0, 1, 0], "U1", undefined, { len: 1.5, dia: 16 }),
],
tools: ["allen"],
pose: "-y",
diff --git a/src/lib/plan/families/baggebo.ts b/src/lib/plan/families/baggebo.ts
index 9cc5c09..a49249b 100644
--- a/src/lib/plan/families/baggebo.ts
+++ b/src/lib/plan/families/baggebo.ts
@@ -15,9 +15,10 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* turn, the back riveted on standing, a wall fitting, then the door on a pivot and two glass shelves.
*/
-const metal = (W: number, D: number, P: number, y: number, id: string): CustomPart => {
+// the shelf runs right into the corners, inside the posts' 2 mm flanges, so each corner screw goes through both
+const metal = (W: number, Dout: number, y: number, id: string): CustomPart => {
const lip = 22, t = 2;
- const w = W - 2 * P;
+ const w = W - 4, D = Dout - 4;
const pieces: PartPiece[] = [
{ shape: "box", size: [w, t, D - 2], pos: [0, lip / 2 - t / 2, 0] },
{ shape: "box", size: [w, lip, t], pos: [0, 0, D / 2 - t / 2] },
@@ -49,17 +50,18 @@ function metalUnit(s: ProductSpec): CustomParams {
});
const parts: CustomPart[] = [post(-1, 1, "pFL"), post(1, 1, "pFR"), post(-1, -1, "pBL"), post(1, -1, "pBR")];
const shelves = Array.from({ length: n }, (_, i) => `S${i}`);
- shelves.forEach((id, i) => parts.push(metal(W, D, P, shelfY(i), id)));
+ shelves.forEach((id, i) => parts.push(metal(W, D, shelfY(i), id)));
// the perforated panel across one compartment at the back: the top one on the low unit, the second from the top on the tall one
const k = tall ? n - 2 : n - 1;
- const y0 = shelfY(k - 1), y1 = shelfY(k) - 22;
+ // it overlaps the back lips of the shelves above and below it, where its screws go
+ const y0 = shelfY(k - 1) - 22, y1 = shelfY(k);
const pw = Math.round(W * (tall ? 0.32 : 0.4)), px = Math.round(W * (tall ? 0.1 : 0.17));
- parts.push({ id: "mesh", name: "Perforated panel", size: [pw, y1 - y0, 3], pos: [px, (y0 + y1) / 2, -D / 2 + 4], material: "metal" });
+ parts.push({ id: "mesh", name: "Perforated panel", size: [pw, y1 - y0, 2], pos: [px, (y0 + y1) / 2, -D / 2 + 1], material: "metal" });
// two screws at each corner of a shelf, through the post's two flanges
const corner = (sx: number, sz: number, y: number): Vec3[] => [
- [sx * W / 2, y - 11, sz * (D / 2 - P / 2 - 2)],
- [sx * (W / 2 - P / 2 - 4), y - 11, sz * D / 2],
+ [sx * W / 2, y - 11, sz * (D / 2 - 16)],
+ [sx * (W / 2 - 16), y - 11, sz * D / 2],
];
const cornerFix = (sx: number, sz: number, ids: number[], on: string): CustomFix[] => {
const pts = ids.map((i) => corner(sx, sz, shelfY(i)));
@@ -74,7 +76,7 @@ function metalUnit(s: ProductSpec): CustomParams {
count: 4,
len: 10,
dia: 6,
- at: [y0 + 12, y1 - 12].flatMap((y) => [-1, 1].map((sx) => [px + sx * (pw / 2 - 25), y, -D / 2 + 2] as Vec3)),
+ at: [y0 + 11, y1 - 11].flatMap((y) => [-1, 1].map((sx) => [px + sx * (pw / 2 - 25), y, -D / 2] as Vec3)),
dir: [0, 0, 1],
on: "mesh",
};
@@ -85,7 +87,7 @@ function metalUnit(s: ProductSpec): CustomParams {
title: "Screw the wall brackets to the top shelf",
detail: "One at each end of the back edge, a washer under the screw. The slotted leg stands up behind the top.",
fix: [
- { kind: "angle", name: "Wall bracket", count: 2, len: 50, dia: 24, at: bracketAt.map((p) => [p[0], p[1] + 20, p[2] - 2] as Vec3), dir: [0, 0, 1], on: "S" + (n - 1) },
+ { kind: "angle", name: "Wall bracket", count: 2, len: 50, dia: 24, at: bracketAt.map((p) => [p[0], p[1] + 26, p[2] - 2] as Vec3), dir: [0, 0, 1], on: "S" + (n - 1) },
{ kind: "washer", count: 2, len: 1.5, dia: 16, at: bracketAt.map((p) => [p[0], p[1], p[2] - 4] as Vec3), dir: [0, 0, 1] },
{ kind: "screw", count: 2, len: 10, dia: 6, at: bracketAt.map((p) => [p[0], p[1], p[2] - 5] as Vec3), dir: [0, 0, 1], on: "S" + (n - 1) },
],
@@ -319,7 +321,7 @@ function pivotSteps(o: { door: string; top: string; bottom: string; x: number; y
{
title: "Screw on the knob",
detail: "The bolt goes in from the inside of the door. Tighten it by hand, then a little more with the screwdriver.",
- fix: [fx("knob", door, [0, 0, -1], [o.knob], { len: 30, dia: 30 }), fx("screw", door, [0, 0, 1], [[o.knob[0], o.knob[1], o.knob[2] - 16]], KNOB_BOLT)],
+ fix: [fx("knob", door, [0, 0, -1], [o.knob], { len: 30, dia: 30 }), fx("screw", door, [0, 0, 1], [[o.knob[0], o.knob[1], o.knob[2] - 24]], KNOB_BOLT)],
tools: ["screwdriver"],
},
];
@@ -531,7 +533,7 @@ function glassCabinet(s: ProductSpec): CustomParams {
{
title: "Screw the knob onto the door",
detail: "Lay the door on the rug. The screw goes through the frame from the inside into the knob.",
- fix: [fx("knob", "DR", [0, 0, -1], [[W / 2 - P - 20, dy, D / 2]], { len: 30, dia: 26 }), fx("screw", "DR", [0, 0, 1], [[W / 2 - P - 20, dy, D / 2 - 18]], { len: 20, dia: 4, name: "Knob screw" })],
+ fix: [fx("knob", "DR", [0, 0, -1], [[W / 2 - P - 20, dy, D / 2]], { len: 30, dia: 26 }), fx("screw", "DR", [0, 0, 1], [[W / 2 - P - 20, dy, D / 2 - 24]], { len: 26, dia: 4, name: "Knob screw" })],
wait: ["DR"],
tools: ["screwdriver"],
},
@@ -602,10 +604,10 @@ function sideboard(s: ProductSpec): CustomParams {
const zz = (k: number) => zc + k * (pd / 2 - 50);
const dw = (on: string, dir: Vec3, pts: Vec3[], mate: string, o: Partial<CustomFix> = DOWEL) => ({ ...fx("dowel", on, dir, pts, o), mate });
const pair = (x: number, y: number, z0 = zc, d = 50): Vec3[] => [-1, 1].map((k) => [x, y, z0 + k * d] as Vec3);
- const screwsThrough = (side: "L" | "R", list: [string, number, number][]) =>
- list.map(([id, y, n]) => {
+ const screwsThrough = (side: "L" | "R", list: [string, number, number, number?][]) =>
+ list.map(([id, y, n, z1]) => {
const sx = side === "L" ? -1 : 1;
- const zs = n === 1 ? [zc] : [zz(-1), zz(1)];
+ const zs = n === 1 ? [z1 ?? zc] : [zz(-1), zz(1)];
return { ...fx("screw", side, [-sx, 0, 0], zs.map((z) => [sx * W / 2, y, z] as Vec3), ALLEN), mate: id };
});
const camsIn = (on: string, at: Vec3[], dir: Vec3) => fx("cam", on, dir, at, CAM);
@@ -663,8 +665,8 @@ function sideboard(s: ProductSpec): CustomParams {
{ title: "Lock the right shelf", detail: "Two cam locks, turned until tight.", fix: [camsIn("SR", pair(xr0 + 30, yS + T / 2, -D / 2 + B + shD / 2, 70), [0, -1, 0])], tools: ["screwdriver"] },
{ title: "Tap dowels into the right bottom", detail: "Two into each end.", fix: [dw("BR", [-1, 0, 0], pair(xr0, yB), "M"), dw("BR", [1, 0, 0], pair(xr1, yB), "R")], wait: ["BR"], tools: ["hammer"] },
{ title: "Slide the right bottom in", detail: "From the end, onto the divider's holes, level with the left bottom.", add: ["BR"], from: { BR: [0, 0, 300] } },
- { title: "Tap dowels into the right ends", detail: "Two into the long panel and two into the right shelf.", fix: [dw("SR", [-1, 0, 0], pair(xr1, yS, -D / 2 + B + shD / 2), "R"), dw("P", [-1, 0, 0], pair(xr1, yP, zc, 90), "R")], tools: ["hammer"] },
- { title: "Fit the right side and screw it on", detail: "Press it onto all the dowels, then five long screws.", add: ["R"], fix: screwsThrough("R", [["P", yP, 2], ["SR", yS, 1], ["BR", yB, 2]]), tools: ["allen"], from: { R: [300, 0, 0] } },
+ { title: "Tap dowels into the right ends", detail: "Two into the long panel and two into the right shelf.", fix: [dw("SR", [-1, 0, 0], pair(xr1, yS, -D / 2 + B + shD / 2), "R"), dw("P", [-1, 0, 0], pair(xr1, yP, zc, 20), "R")], tools: ["hammer"] },
+ { title: "Fit the right side and screw it on", detail: "Press it onto all the dowels, then five long screws.", add: ["R"], fix: screwsThrough("R", [["P", yP, 2], ["SR", yS, 1, -D / 2 + B + shD / 2], ["BR", yB, 2]]), tools: ["allen"], from: { R: [300, 0, 0] } },
{
title: "Stand it up and tap dowels into the tops",
detail: "Two into each side and one into the small divider.",
@@ -741,7 +743,7 @@ function sideboard(s: ProductSpec): CustomParams {
from: { DK: [0, 0, -300] },
tools: ["hammer"],
},
- { title: "Screw the knob onto the drawer", detail: "The bolt goes in from the inside of the front.", fix: [fx("knob", "DF", [0, 0, -1], [[dxc, yP + T / 2 + oh / 2, D / 2]], { len: 30, dia: 30 }), fx("screw", "DF", [0, 0, 1], [[dxc, yP + T / 2 + oh / 2, D / 2 - 16]], KNOB_BOLT)], tools: ["screwdriver"] },
+ { title: "Screw the knob onto the drawer", detail: "The bolt goes in from the inside of the front.", fix: [fx("knob", "DF", [0, 0, -1], [[dxc, yP + T / 2 + oh / 2, D / 2]], { len: 30, dia: 30 }), fx("screw", "DF", [0, 0, 1], [[dxc, yP + T / 2 + oh / 2, D / 2 - 24]], KNOB_BOLT)], tools: ["screwdriver"] },
{ title: "Pull the runners out", detail: "Pull the inner part of both runners forward until they stop.", kind: "drawer" },
{ title: "Slide the drawer onto the runners", detail: "Rest it on them and push it in.", kind: "drawer" },
{ title: "Pull the drawer out to the stop", detail: "Until the screw holes in the runners line up with the holes in the drawer sides.", kind: "drawer" },
diff --git a/src/lib/plan/families/baltsar.ts b/src/lib/plan/families/baltsar.ts
index 815b3a9..6051bce 100644
--- a/src/lib/plan/families/baltsar.ts
+++ b/src/lib/plan/families/baltsar.ts
@@ -4,7 +4,8 @@ import type { CustomParams, CustomPart, CustomStep, ProductSpec } from "../../ty
/**
* BALTSAR, read from the swivel chair's manual. No tools and no screws: the column pushes into the round base
* with a ring, the seat shell presses onto its top with a cup, and the seat pad clips into the shell. Sitting on
- * it presses the shell home. The four-legged chair is sold with no manual to follow, so it keeps its old guide.
+ * it presses the shell home. The four-legged chair has no manual online; IKEA's page says it goes together without
+ * tools or screws: the four beech legs push into the sockets under the same shell, and the pad clips in as above.
*/
function swivel(s: ProductSpec): CustomParams {
@@ -61,11 +62,60 @@ function swivel(s: ProductSpec): CustomParams {
return { parts, steps };
}
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, D = s.size.d * 10;
+ const H = Math.min(s.size.h * 10, 850);
+ const seatY = 460, shellY = seatY - 25, under = shellY - 60;
+ const mid = under + (H - under) / 2;
+ const legLen = under + 30, splay = 0.13;
+ const lx = W / 2 - 110, lz = D / 2 - 120; // where the legs meet the shell
+ const parts: CustomPart[] = [
+ {
+ id: "C",
+ name: "Seat shell",
+ size: [W, H - under, D],
+ pos: [0, mid, 0],
+ material: "board",
+ pieces: [
+ { shape: "box", size: [W - 100, 30, D - 60], pos: [0, shellY - 15 - mid, 30] },
+ { shape: "box", size: [W - 60, H - shellY - (W - 60) / 2, 30], pos: [0, (shellY + H - (W - 60) / 2) / 2 - mid, -D / 2 + 15] },
+ { shape: "halfcyl", size: [W - 60, 30, (W - 60) / 2], pos: [0, H - (W - 60) / 4 - mid, -D / 2 + 15], rot: [-Math.PI / 2, 0, 0] },
+ { shape: "box", size: [30, 120, D - 160], pos: [-W / 2 + 15, shellY + 50 - mid, -40] },
+ { shape: "box", size: [30, 120, D - 160], pos: [W / 2 - 15, shellY + 50 - mid, -40] },
+ // the four leg sockets under the seat
+ ...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => ({ shape: "cyl" as const, size: [50, 60, 50] as [number, number, number], pos: [sx * lx, under + 30 - mid, sz * lz] as [number, number, number], rot: [-sz * splay, 0, sx * splay] as [number, number, number] }))),
+ ],
+ },
+ ...[-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz, j): CustomPart => {
+ const dx = Math.sin(splay) * legLen / 2, dz = Math.sin(splay) * legLen / 2;
+ return { id: `L${sx < 0 ? 0 : 1}${j}`, name: "Leg", shape: "cyl", size: [36, legLen, 36], pos: [sx * (lx + dx), under + 20 - legLen / 2, sz * (lz + dz)], rot: [-sz * splay, 0, sx * splay], material: "wood" };
+ }),
+ ),
+ { id: "D", name: "Seat pad", size: [W - 140, 25, D - 130], pos: [0, seatY - 12, 40], material: "soft" },
+ ];
+ const legs = parts.filter((p) => p.name === "Leg").map((p) => p.id);
+ const steps: CustomStep[] = [
+ { title: "Lay the shell upside down", detail: "On a rug or the flattened box, so the seat doesn't get scratched.", add: ["C"], pose: "-y", warnings: ["floor"] },
+ {
+ title: "Push the legs into the shell",
+ detail: "Each leg straight into its socket, firmly, until it stops. No tools or screws.",
+ add: legs,
+ from: Object.fromEntries(legs.map((id) => [id, [0, -260, 0] as [number, number, number]])),
+ warnings: ["hand"],
+ },
+ { title: "Stand the chair up", detail: "Check all four legs touch the floor.", pose: "+y" },
+ { title: "Clip in the seat pad", detail: "Slide its back edge in under the lip first, then press the front down.", add: ["D"] },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["BALTSAR"],
recipe(s) {
if (/swivel/i.test(s.variant)) return swivel(s);
- return null; // the chair: no manual
+ if (/baltsar-chair/.test(s.slug ?? "")) return chair(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/barslov.ts b/src/lib/plan/families/barslov.ts
index 192bd52..d9f3302 100644
--- a/src/lib/plan/families/barslov.ts
+++ b/src/lib/plan/families/barslov.ts
@@ -70,6 +70,10 @@ function sofaBed(s: ProductSpec): CustomParams {
const ends = [-1, 1];
const xe = fw / 2 - 20;
+ const yr = ft + fh - 40; // middle of the rails
+ // two screws in through each end into the end of the rail, either side of the corner bolt
+ const railScrews = (z: number, rail: string): CustomFix[] =>
+ ends.map((sx) => fx("screw", [[sx * (fw / 2), yr - 28, z], [sx * (fw / 2), yr + 28, z]], [-sx, 0, 0], { len: 50, dia: 6, on: sx < 0 ? "E1" : "E2", mate: rail }));
const steps: CustomStep[] = [
{
title: "Stand the two bed frame ends up",
@@ -79,9 +83,9 @@ function sofaBed(s: ProductSpec): CustomParams {
},
{
title: "Screw the first rail onto them",
- detail: "Two screws at each end. Check the holes face the right way before you start.",
+ detail: "Two screws in through each end. Check the holes face the right way before you start.",
add: ["R1"],
- fix: [fx("screw", ends.flatMap((sx) => [[sx * xe, ft + fh, fz0 + 8], [sx * xe, ft + fh, fz0 + 22]] as Vec3[]), [0, -1, 0], { len: 50, dia: 6, on: "R1", to: ["E1", "E2"] })],
+ fix: railScrews(fz0 + 15, "R1"),
tools: ["allen"],
},
{
@@ -94,10 +98,10 @@ function sofaBed(s: ProductSpec): CustomParams {
{ title: "Turn the frame round together", detail: "Lift it by the two ends so the slats don't bend.", people: 2, warnings: ["two"] },
{
title: "Screw on the second rail",
- detail: "Two screws at each end and two into each slat.",
+ detail: "Two screws through each end and two into each slat.",
add: ["R2"],
fix: [
- fx("screw", ends.flatMap((sx) => [[sx * xe, ft + fh, fz1 - 8], [sx * xe, ft + fh, fz1 - 22]] as Vec3[]), [0, -1, 0], { len: 50, dia: 6, on: "R2", to: ["E1", "E2"] }),
+ ...railScrews(fz1 - 15, "R2"),
fx("screw", slatX.flatMap((x) => [[x - 12, ft + fh, fz1 - 15], [x + 12, ft + fh, fz1 - 15]] as Vec3[]), [0, -1, 0], { len: 30, dia: 6, on: "R2", to: ["S1", "S2", "S3", "S4"] }),
],
tools: ["allen"],
@@ -107,7 +111,7 @@ function sofaBed(s: ProductSpec): CustomParams {
detail: "One plate on top of each end, then two bolts across each corner. Tighten everything now.",
fix: [
fx("plate", ends.map((sx) => [sx * xe, ft + fh, fzc] as Vec3), [0, -1, 0], { len: 4, dia: 80, on: "E1", to: ["E1", "E2"] }),
- fx("bolt", ends.flatMap((sx) => [[sx * (xe + 20), fy, fz0 + 15], [sx * (xe + 20), fy, fz1 - 15]] as Vec3[]), [-1, 0, 0], { len: 60, dia: 6, to: ["E1", "E2"] }),
+ ...ends.map((sx, i) => fx("bolt", [[sx * (xe + 20), yr, fz0 + 15], [sx * (xe + 20), yr, fz1 - 15]], [-sx, 0, 0], { len: 60, dia: 6, on: `E${i + 1}` })),
],
tools: ["allen"],
},
@@ -149,7 +153,8 @@ function sofaBed(s: ProductSpec): CustomParams {
{
title: "Lower the bed frame into the base",
detail: "Together. Tip it in so the hooks on its ends drop into the slots, then screw and bolt it in place.",
- fix: [fx("screw", ends.flatMap((sx) => [[sx * (Wi / 2), fy, fz0 + 100], [sx * (Wi / 2), fy, fz1 - 100]] as Vec3[]), [-1, 0, 0], { len: 20, dia: 6, on: "B", to: ["E1", "E2"] })],
+ // through the base's end and into the bed frame's end just inside it
+ fix: ends.map((sx, i) => fx("screw", [[sx * (Wi / 2), fy, fz0 + 100], [sx * (Wi / 2), fy, fz1 - 100]], [-sx, 0, 0], { len: 50, dia: 6, on: "B", mate: `E${i + 1}` })),
tools: ["allen"],
people: 2,
warnings: ["two"],
diff --git a/src/lib/plan/families/batskar.ts b/src/lib/plan/families/batskar.ts
index 689f571..28def48 100644
--- a/src/lib/plan/families/batskar.ts
+++ b/src/lib/plan/families/batskar.ts
@@ -136,9 +136,12 @@ const sides = [-1, 1];
const T = 40; // the frames' square tube
/** A side frame: front and back legs, a rail along the top and one near the floor. */
-function sideFrame(x: number, H: number, D: number, yRail: number): PartPiece[] {
+function sideFrame(x: number, H: number, D: number, yRail: number, yShelf?: number): PartPiece[] {
const zl = D / 2 - T / 2;
+ // a kitchen unit's frames carry a small bracket inside each leg for the shelf to rest and bolt on
+ const tabs = yShelf === undefined ? [] : sides.map((sz): PartPiece => ({ shape: "box", size: [60, 4, 30], pos: [x - Math.sign(x) * (T / 2 + 30), yShelf - 3.5, sz * (D / 2 - T - 15)] }));
return [
+ ...tabs,
...sides.map((sz): PartPiece => ({ shape: "box", size: [T, H - 20, T], pos: [x, (H + 20) / 2, sz * zl] })),
{ shape: "box", size: [T, T, D - 2 * T], pos: [x, H - T / 2, 0] },
{ shape: "box", size: [T, T, D - 2 * T], pos: [x, yRail, 0] },
@@ -163,7 +166,7 @@ function kitchenUnit(b: PlanBuilder, s: ProductSpec, closed: boolean) {
const xL = W / 2 - T / 2, zL = D / 2 - T / 2;
const k = new Kit(b);
- for (const sx of sides) k.welded(`F${sx}`, sx < 0 ? "Left side frame" : "Right side frame", sideFrame(sx * xL, yT, D, yRail), "metal");
+ for (const sx of sides) k.welded(`F${sx}`, sx < 0 ? "Left side frame" : "Right side frame", sideFrame(sx * xL, yT, D, yRail, yShelf), "metal");
for (const sz of sides) k.box(`R${sz}`, "Foot rail", [W - 2 * T, T, T], [0, yRail, sz * zL], "metal");
k.box("SH", closed ? "Cabinet floor" : "Shelf", [W - 2 * T, 3, D - 2 * T], [0, yShelf, 0], "metal");
k.welded("WT", "Worktop", [
@@ -194,7 +197,7 @@ function kitchenUnit(b: PlanBuilder, s: ProductSpec, closed: boolean) {
},
);
k.step({ title: closed ? "Bolt the cabinet floor to the legs" : "Bolt the shelf to the legs", detail: "Two bolts down through each corner.", tools: ["allen"], kind: "bolts" }, () =>
- k.fit(BOLT, sides.flatMap((sx) => sides.flatMap((sz) => [0, 22].map((d) => [sx * (xL - T / 2 - 12 - d), yShelf + 1.5, sz * (zL - 6)] as Vec3))), DOWN, "SH", { mate: frame }),
+ k.fit(BOLT, sides.flatMap((sx) => sides.flatMap((sz) => [0, 22].map((d) => [sx * (xL - T / 2 - 12 - d), yShelf + 1.5, sz * (D / 2 - T - 15)] as Vec3))), DOWN, "SH", { mate: frame }),
);
k.step({ title: "Turn it upside down and bolt the foot rails", detail: "Two bolts through each end of both rails into the brackets by the feet.", pose: "-y", tools: ["allen"], kind: "bolts" }, () =>
k.fit(BOLT, sides.flatMap((sx) => sides.flatMap((sz) => [0, 24].map((d) => [sx * (xL - T / 2 - 14 - d), yRail - T / 2, sz * zL] as Vec3))), UP, rail, { mate: frame }),
@@ -217,11 +220,15 @@ function kitchenUnit(b: PlanBuilder, s: ProductSpec, closed: boolean) {
], "metal");
for (const sx of sides)
k.welded(`SP${sx}`, "Side panel", [
- { shape: "box", size: [3, yP1 - yF, D - 2 * T - 8], pos: [sx * (W / 2 - T - 1.5), (yP1 + yF) / 2, 0] },
+ { shape: "box", size: [3, yP1 - yF, D - T], pos: [sx * (W / 2 - T - 1.5), (yP1 + yF) / 2, 0] }, // its edges lie on the legs
{ shape: "box", size: [28, 3, D - 2 * T - 40], pos: [sx * (W / 2 - T - 17), yF, 0] },
], "metal");
const xPost = -W / 2 + W / 3;
- k.box("PO", "Door post", [T, yT - yShelf, T], [xPost, (yT + yShelf) / 2, zL], "metal");
+ // up to the worktop's underside, with a tab at its foot that lies on the cabinet floor
+ k.welded("PO", "Door post", [
+ { shape: "box", size: [T, H - 3 - yShelf - 1.5, T], pos: [xPost, (H - 3 + yShelf + 1.5) / 2, zL] },
+ { shape: "box", size: [T, 3, 30], pos: [xPost, yShelf + 3, zL - T / 2 - 15] },
+ ], "metal");
// three doors in front of the frame, each with its two hinges on the back; the handles go on later
const dw = W / 3 - 6, dz = D / 2 + 10;
const hingeX = [-W / 2 + T / 2, xPost, W / 2 - T / 2];
@@ -253,12 +260,12 @@ function kitchenUnit(b: PlanBuilder, s: ProductSpec, closed: boolean) {
k.fit(BOLT, sides.map((sz) => [-W / 2 + T + 18, yF - 1.5, sz * (D / 4)] as Vec3), UP, "SP-1", { mate: "SH" });
});
k.step({ title: "Bolt the side panels to the legs", detail: "Two bolts from inside into each leg, top and bottom.", tools: ["allen"], kind: "bolts" }, () =>
- k.fit(BOLT, sides.flatMap((sx) => sides.flatMap((sz) => [yP0 + 60, yP1 - 60].map((y) => [sx * (W / 2 - T - 3), y, sz * (zL - T / 2 - 14)] as Vec3))), (p) => [Math.sign(p[0]), 0, 0], sidesOf, { mate: frame }),
+ k.fit(BOLT, sides.flatMap((sx) => sides.flatMap((sz) => [yP0 + 60, yP1 - 60].map((y) => [sx * (W / 2 - T - 3), y, sz * (zL - 8)] as Vec3))), (p) => [Math.sign(p[0]), 0, 0], sidesOf, { mate: frame }),
);
k.step({ title: "Fit the post between the doors", detail: "Push it in a third of the way along the front, between the cabinet floor and the top rail. Two bolts at the top, two at the bottom.", tools: ["allen"], kind: "bolts" }, () => {
k.add(["PO"], [0, 0, 300]);
- k.fit(BOLT, sides.map((d) => [xPost + d * 10, yT, zL] as Vec3), UP, "PO", { mate: "WT" });
- k.fit(BOLT, sides.map((d) => [xPost + d * 10, yShelf, zL] as Vec3), DOWN, "PO", { mate: "SH" });
+ k.fit(BOLT, sides.map((d) => [xPost + d * 10, H - 9, zL] as Vec3), UP, "PO", { mate: "WT" });
+ k.fit(BOLT, sides.map((d) => [xPost + d * 10, yShelf + 4.5, zL - T / 2 - 15] as Vec3), DOWN, "PO", { mate: "SH" });
});
k.step({ title: "Screw the doors on", detail: "Two hinges on each door; four screws hold each hinge to its post.", tools: ["screwdriver"], kind: "hinges" }, () => {
k.add(["D0", "D1", "D2"], [0, 0, 300]);
@@ -266,7 +273,7 @@ function kitchenUnit(b: PlanBuilder, s: ProductSpec, closed: boolean) {
const sg = Math.sign(doorX[i] - hingeX[i]);
return hingeY.flatMap((y) => [-12, 12].flatMap((dy) => [-7, 7].map((dz2) => [hingeX[i] + sg * (T / 2), y + dy, zL + dz2] as Vec3)));
});
- k.fit(SCREW, pts, (p) => [Math.abs(p[0] - xPost) < 30 ? -1 : -Math.sign(p[0]), 0, 0], (p) => (Math.abs(p[0] - xPost) < 30 ? "PO" : frame(p)));
+ k.fit(SCREW, pts, (p) => [Math.abs(p[0] - xPost) < 30 ? -1 : Math.sign(p[0]), 0, 0], (p) => (Math.abs(p[0] - xPost) < 30 ? "PO" : frame(p)));
});
const handleX = [doorX[0] + dw / 2 - 40, doorX[1] + dw / 2 - 40, doorX[2] - dw / 2 + 40];
k.step({ title: "Bolt on the handles", detail: "One on each door, at the edge away from its hinges, with a bolt from inside.", tools: ["allen"], kind: "screws" }, () => {
diff --git a/src/lib/plan/families/bekant.ts b/src/lib/plan/families/bekant.ts
index 3385840..8eef95e 100644
--- a/src/lib/plan/families/bekant.ts
+++ b/src/lib/plan/families/bekant.ts
@@ -54,8 +54,8 @@ function storage(s: ProductSpec): CustomParams {
P("DF", "Drawer front", -W / 2 + 6, W / 2 - 6, yB + 4, 410, zf, D / 2),
P("DL", "Drawer side", -xd, -xd + 12, dy0, dy1 - 20, zb, zf),
P("DR", "Drawer side", xd - 12, xd, dy0, dy1 - 20, zb, zf),
- P("DT", "Drawer bottom", -xd + 12, xd - 12, dy0, dy0 + 4, zb, zf, "fiber"),
- P("DB", "Drawer back", -xd + 12, xd - 12, dy0 + 4, dy1 - 20, zb, zb + 12),
+ P("DT", "Drawer bottom", -xd + 12, xd - 12, dy0, dy0 + 16, zb, zf),
+ P("DB", "Drawer back", -xd + 12, xd - 12, dy0 + 16, dy1 - 20, zb, zb + 12),
{ id: "TRAY", name: "Tray", size: [2 * xd - 40, 60, 160], pos: [0, dy1 - 60, zb + 110], material: "soft", pieces: [{ shape: "box", size: [2 * xd - 40, 4, 160], pos: [0, -28, 0] }, { shape: "box", size: [2 * xd - 40, 60, 4], pos: [0, 0, -78] }, { shape: "box", size: [2 * xd - 40, 60, 4], pos: [0, 0, 78] }] },
);
const end = (y: number) => posts.map(([, sx, sz]): Vec3 => [sx * px, y, sz * pz]);
@@ -70,10 +70,11 @@ function storage(s: ProductSpec): CustomParams {
const [, x, z] = posts.find(([p]) => p === id)!;
return at("clip", [[x * px, yT, z * pz]], [0, 1, 0], id, "TOP", { len: 14, dia: 20, name: "Post clip" });
};
- const meshScrews = (y: number): CustomFix[] => [
- at("screw", [[-W / 2, y, -120], [-W / 2, y, 120]], [1, 0, 0], "ML", undefined, SCREW),
- at("screw", [[-100, y, -D / 2], [100, y, -D / 2]], [0, 0, 1], "MB", undefined, SCREW),
- at("screw", [[W / 2, y, -120], [W / 2, y, 120]], [-1, 0, 0], "MR", undefined, SCREW),
+ // through the mesh panel's bent edge into the top (going up) or the bottom board (going down)
+ const meshScrews = (y: number, up: boolean): CustomFix[] => [
+ at("screw", [[-W / 2 + 2, y, -120], [-W / 2 + 2, y, 120]], [0, up ? 1 : -1, 0], "ML", undefined, SCREW),
+ at("screw", [[-100, y, -D / 2 + 2], [100, y, -D / 2 + 2]], [0, up ? 1 : -1, 0], "MB", undefined, SCREW),
+ at("screw", [[W / 2 - 2, y, -120], [W / 2 - 2, y, 120]], [0, up ? 1 : -1, 0], "MR", undefined, SCREW),
];
const castorAt = (sz: number) => [-1, 1].map((x): Vec3 => [x * (px - 10), C, sz * (pz - 10)]);
const runnerX = xd + 6;
@@ -99,7 +100,7 @@ function storage(s: ProductSpec): CustomParams {
{ title: "Slide the last mesh panel in", detail: "Into the third post's free groove, then swing it straight.", add: ["MR"], from: { MR: [0, 0, 300] } },
{ title: "Slide the last post onto it", add: ["PRF"], from: { PRF: [0, 0, 300] } },
{ title: "Click the last post into the top", fix: [click("PRF")] },
- { title: "Screw the mesh panels to the top", detail: "Six screws, two through the top edge of each panel.", fix: meshScrews(yT - 15), tools: ["screwdriver"] },
+ { title: "Screw the mesh panels to the top", detail: "Six screws, two through the top edge of each panel.", fix: meshScrews(yT - 2, true), tools: ["screwdriver"] },
{
title: "Screw the drawer runners onto the bottom board",
detail: "The left and right runners are marked. Two screws in each, along the side edges.",
@@ -114,7 +115,11 @@ function storage(s: ProductSpec): CustomParams {
title: "Bolt the bottom board onto the posts",
detail: "Lower it onto the upside-down frame, cut-out edge at the front. A plate and a bolt into each corner.",
add: ["BOT"],
- fix: [at("plate", end(C), [0, 1, 0], "BOT", undefined, { len: 50, dia: 25, name: "Corner plate" }), at("bolt", end(C), [0, 1, 0], "BOT", undefined, { len: 30, dia: 6 })],
+ fix: [
+ at("plate", posts.map(([, sx, sz]): Vec3 => [sx * (px - 25), C, sz * (pz - 25)]), [0, 1, 0], "BOT", undefined, { len: 50, dia: 25, name: "Corner plate" }),
+ // up through the plate and the board into the corner connector in the post
+ at("bolt", end(C - 5), [0, 1, 0], "BOT", undefined, { len: 30, dia: 6 }),
+ ],
tools: ["allen"],
from: { BOT: [0, -300, 0] },
},
@@ -122,7 +127,7 @@ function storage(s: ProductSpec): CustomParams {
{ title: "Screw in the two other castors", detail: "At the back, the same way.", fix: [at("castor", castorAt(-1), [0, 1, 0], "BOT", undefined, { len: C, dia: 60 })], tools: ["wrench"] },
{ title: "Tighten the four corner bolts", detail: "Go round each one again with the Allen key. The key clips into the cable strip for keeping.", tools: ["allen"] },
{ title: "Click the cable ring into its hole", detail: "Push the two halves together through the hole in the bottom board.", fix: [at("cap", [[0, C, -D / 2 + 90]], [0, 1, 0], "BOT", undefined, { len: 15, dia: 60, name: "Cable ring" })] },
- { title: "Stand it up and screw the mesh to the bottom", detail: "Six more screws, two low down through each panel.", fix: meshScrews(yB + 15), pose: "+y", tools: ["screwdriver"], people: 2, warnings: ["two"] },
+ { title: "Stand it up and screw the mesh to the bottom", detail: "Six more screws, two low down through each panel.", fix: meshScrews(yB + 2, false), pose: "+y", tools: ["screwdriver"], people: 2, warnings: ["two"] },
{ title: "Put in the lower shelf", detail: "Smooth side up, sloping edge at the front.", add: ["SH0"], from: { SH0: [0, 0, 400] } },
{ title: "Press it down onto the posts", detail: "The four clips under it click onto the posts." },
{ title: "Turn the shelf supports round", detail: "The four supports on the posts above, so they point into the unit." },
@@ -137,11 +142,11 @@ function storage(s: ProductSpec): CustomParams {
{ title: "Turn the four cam locks", detail: "Two in each side, clockwise until the front sits tight.", fix: [-1, 1].map((x) => at("cam", [[x * (xd - 12), 160, zf - 34], [x * (xd - 12), 330, zf - 34]], [-x, 0, 0], x < 0 ? "DL" : "DR", undefined, { len: 13, dia: 15 })), tools: ["screwdriver"] },
{ title: "Slide the bottom into the grooves", add: ["DT"], from: { DT: [0, 0, -400] } },
{ title: "Push the back in", detail: "Its four tabs drop into the slots in the sides.", add: ["DB"], from: { DB: [0, 250, 0] } },
- { title: "Turn the drawer over and screw on the guide rail", detail: "Two screws, along the bottom edge of the front.", fix: [at("clip", [[0, dy0, zf - 20]], [0, 1, 0], "DT", undefined, { len: 12, dia: 40, name: "Guide rail" }), at("screw", [[-100, dy0, zf - 20], [100, dy0, zf - 20]], [0, 1, 0], "DT", undefined, CHIP)], pose: "-y", tools: ["screwdriver"] },
+ { title: "Turn the drawer over and screw on the guide rail", detail: "Two screws, along the bottom edge of the front.", fix: [at("clip", [[0, yB + 4, zf + 9]], [0, 1, 0], "DF", undefined, { len: 12, dia: 40, name: "Guide rail" }), at("screw", [[-100, yB + 4, zf + 9], [100, yB + 4, zf + 9]], [0, 1, 0], "DF", undefined, CHIP)], pose: "-y", tools: ["screwdriver"] },
{ title: "Click the small castor into its leg", fix: [at("castor", [[0, 0, zf - 60]], [0, 1, 0], "DT", undefined, { len: 50, dia: 45, name: "Small castor" })] },
{ title: "Screw the leg under the drawer", detail: "Four screws through its plate, near the front.", fix: [at("plate", [[0, dy0, zf - 60]], [0, 1, 0], "DT", undefined, { len: 80, dia: 30, name: "Castor leg" }), at("screw", [-1, 1].flatMap((x) => [-1, 1].map((z): Vec3 => [x * 30, dy0, zf - 60 + z * 15])), [0, 1, 0], "DT", undefined, SCREW)], tools: ["screwdriver"] },
- { title: "Screw on the first runner catch", detail: "Under the drawer side, two screws.", fix: [at("clip", [[-xd + 6, dy0, zf - 50]], [0, 1, 0], "DL", undefined, { len: 60, dia: 20, name: "Runner catch" }), at("screw", [[-xd + 6, dy0, zf - 30], [-xd + 6, dy0, zf - 70]], [0, 1, 0], "DL", undefined, SCREW)], tools: ["screwdriver"] },
- { title: "Screw on the other runner catch", detail: "Under the other side, the same way.", fix: [at("clip", [[xd - 6, dy0, zf - 50]], [0, 1, 0], "DR", undefined, { len: 60, dia: 20, name: "Runner catch" }), at("screw", [[xd - 6, dy0, zf - 30], [xd - 6, dy0, zf - 70]], [0, 1, 0], "DR", undefined, SCREW)], tools: ["screwdriver"] },
+ { title: "Screw on the first runner catch", detail: "Under the drawer side, two screws.", fix: [at("clip", [[-xd + 6, dy0, zf - 50]], [0, 1, 0], "DL", undefined, { len: 60, dia: 20, name: "Runner catch" }), at("screw", [[-xd + 6, dy0, zf - 24], [-xd + 6, dy0, zf - 76]], [0, 1, 0], "DL", undefined, SCREW)], tools: ["screwdriver"] },
+ { title: "Screw on the other runner catch", detail: "Under the other side, the same way.", fix: [at("clip", [[xd - 6, dy0, zf - 50]], [0, 1, 0], "DR", undefined, { len: 60, dia: 20, name: "Runner catch" }), at("screw", [[xd - 6, dy0, zf - 24], [xd - 6, dy0, zf - 76]], [0, 1, 0], "DR", undefined, SCREW)], tools: ["screwdriver"] },
{ title: "Turn it over and screw on the handle bar", detail: "Along the top of the front, three screws from inside.", fix: [at("handle", [[0, 395, D / 2]], [0, 0, -1], "DF", undefined, { len: 300, dia: 20, name: "Handle bar" }), at("screw", [-120, 0, 120].map((x): Vec3 => [x, 395, zf]), [0, 0, 1], "DF", undefined, CHIP)], pose: "+y", tools: ["screwdriver"] },
{ title: "Fold the tray", detail: "Bend both ends up along the creases until they stand square." },
{ title: "Clip the tray's ends", detail: "Hook the folded ends over its sides so it holds its shape." },
diff --git a/src/lib/plan/families/bekvam.ts b/src/lib/plan/families/bekvam.ts
index 17e6fd3..4f79029 100644
--- a/src/lib/plan/families/bekvam.ts
+++ b/src/lib/plan/families/bekvam.ts
@@ -176,21 +176,23 @@ function ladder(s: ProductSpec): CustomParams {
const span = 2 * xi;
const xRise = bk.y1 - 40 - yRail - 40;
const xLen = Math.hypot(span - 40, xRise), xAng = Math.atan2(xRise, span - 40);
+ const bz = -D / 4 + 10; // the frame's middle; its pieces sit relative to it
const backPieces: PartPiece[] = [
- ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [SX, lb.len, 40], pos: [sx * xs, lb.c[1] - yc, lb.c[0]], rot: [lb.a, 0, 0] })),
- { shape: "box", size: [span, 40, 20], pos: [0, bk.y1 - 40 - yc, zb(bk.y1 - 40)] },
- { shape: "box", size: [span, 40, 20], pos: [0, yRail - yc, zb(yRail)] },
- { shape: "box", size: [xLen, 30, 14], pos: [0, (yRail + bk.y1 - 40) / 2 - yc, zMid], rot: [0, 0, xAng] },
- { shape: "box", size: [xLen, 30, 14], pos: [0, (yRail + bk.y1 - 40) / 2 - yc, zMid], rot: [0, 0, -xAng] },
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [SX, lb.len, 40], pos: [sx * xs, lb.c[1] - yc, lb.c[0] - bz], rot: [lb.a, 0, 0] })),
+ { shape: "box", size: [span, 40, 20], pos: [0, bk.y1 - 40 - yc, zb(bk.y1 - 40) - bz] },
+ { shape: "box", size: [span, 40, 20], pos: [0, yRail - yc, zb(yRail) - bz] },
+ { shape: "box", size: [xLen, 30, 14], pos: [0, (yRail + bk.y1 - 40) / 2 - yc, zMid - bz], rot: [0, 0, xAng] },
+ { shape: "box", size: [xLen, 30, 14], pos: [0, (yRail + bk.y1 - 40) / 2 - yc, zMid - bz], rot: [0, 0, -xAng] },
];
- parts.push({ id: "B", name: "Back frame", size: [W, bk.y1, D / 2], pos: [0, yc, -D / 4 + 10], pieces: backPieces, material: "wood" });
+ parts.push({ id: "B", name: "Back frame", size: [W, bk.y1, D / 2], pos: [0, yc, bz], pieces: backPieces, material: "wood" });
// the stays: a flat steel bar on the outside of each side, from stile to back leg
const yStay = Math.round(top * 0.47);
for (const [i, sx] of [-1, 1].entries()) {
const z0 = zb(yStay), z1 = zf(yStay);
parts.push({ id: `R${i}`, name: i ? "Stay, right" : "Stay, left", size: [4, 22, z1 - z0], pos: [sx * (W / 2 + 2), yStay, (z0 + z1) / 2], material: "metal" });
}
- const hingeAt = (sx: number): Vec3 => [sx * xi, top - 30, fr.z1 - 20];
+ const hingeY = top - 40;
+ const hingeAt = (sx: number, dy = 0): Vec3 => [sx * xi, hingeY + dy, zf(hingeY + dy)];
const stile = (sx: number) => (sx < 0 ? "L0" : "L1");
const stepScrews = stepYs.map((y): Vec3 => [0, y, zf(y) + 10]);
const steps: CustomStep[] = [
@@ -208,7 +210,8 @@ function ladder(s: ProductSpec): CustomParams {
detail: "On the inside, two short screws each. The pivot points back.",
fix: [
...[-1, 1].map((sx) => fx("hinge", [hingeAt(sx)], [sx, 0, 0], stile(sx), { name: "Hinge bracket" })),
- ...[-1, 1].map((sx) => fx("screw", [15, -15].map((dz): Vec3 => [sx * xi, top - 30, fr.z1 - 20 + dz]), [sx, 0, 0], stile(sx), { len: 16, dia: 4 })),
+ // one above and one below the pivot, far enough apart to show as two
+ ...[-1, 1].map((sx) => fx("screw", [24, -24].map((dy) => hingeAt(sx, dy)), [sx, 0, 0], stile(sx), { len: 16, dia: 4 })),
],
tools: ["allen"],
},
@@ -402,7 +405,7 @@ function trolley(s: ProductSpec): CustomParams {
detail: "Four screws through each castor plate into the end of the leg. Use the longer screws here.",
fix: [
...castorLegs.map((g) => fx("castor", [[g.sx * lx, CASTOR, g.sz * lz]], [0, 1, 0], g.id)),
- ...castorLegs.map((g) => fx("screw", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [g.sx * lx + a * 14, CASTOR, g.sz * lz + b * 14])), [0, 1, 0], g.id, { len: 30, dia: 4 })),
+ ...castorLegs.map((g) => fx("screw", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [g.sx * lx + a * 16, CASTOR, g.sz * lz + b * 16])), [0, 1, 0], g.id, { len: 30, dia: 4 })),
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/besta.ts b/src/lib/plan/families/besta.ts
index 399ff92..5e12d10 100644
--- a/src/lib/plan/families/besta.ts
+++ b/src/lib/plan/families/besta.ts
@@ -12,7 +12,7 @@ import { buildCustom } from "../custom";
* dividers (the 64 cm ones on the dividers only), cover strips and cable outlets at the back, and hook onto wall screws.
* Then shelves on four pins, doors on two hinges each with two bumpers, drawers on runners, and STUBBARP legs instead
* of the feet. The 240 cm combinations are a TV bench with a 60 cm frame screwed on at each end. BESTÅ BURS is a
- * different build and keeps its old guide.
+ * different build, read from its own manual (`bursRecipe`).
*/
const T = 18; // board
@@ -165,7 +165,8 @@ function uprightSteps(r: Recipe, fs: Frame[], legs: boolean, title = "") {
: i.V.map((id, k) => ({ id, x: divX(f, k + 1) - T / 2, d: 1 }));
return list.flatMap((u) => [
fix("bracket", [[u.x, y, z]], [u.d, 0, 0], { on: u.id, len: 40, dia: 44 }),
- fix("screw", [[u.x, y - 12, z + 10], [u.x, y + 12, z + 10]], [u.d, 0, 0], { on: u.id, len: 14, dia: 4 }),
+ // far enough from the bracket's own point that custom.ts doesn't push them off the side
+ fix("screw", [[u.x, y - 24, z + 8], [u.x, y + 24, z + 8]], [u.d, 0, 0], { on: u.id, len: 14, dia: 4 }),
]);
};
if (!legs)
@@ -808,6 +809,7 @@ function applyMoves(b: PlanBuilder, base: number, r: Recipe) {
const first = it.states[0];
first.pos = m.states[0].pos;
first.rot = m.states[0].rot ?? it.final.rot;
+ if (m.states[0].from) first.from = m.states[0].from;
for (const s of m.states.slice(1)) {
const atFinal = s.pos.every((v, i) => Math.abs(v - p[i]) < 0.5) && !s.rot;
it.states.push({ step: base + s.step, scene: first.scene, pos: atFinal ? it.final.pos : s.pos, rot: s.rot ?? it.final.rot, from: s.from, delay: 0.2 });
@@ -817,17 +819,386 @@ function applyMoves(b: PlanBuilder, base: number, r: Recipe) {
}
function draw(b: PlanBuilder, s: ProductSpec, g: Guide) {
- const r = recipeOf(g);
+ return drawRecipe(b, s, recipeOf(g));
+}
+
+function drawRecipe(b: PlanBuilder, s: ProductSpec, r: Recipe) {
const base = b.steps.length;
buildCustom(b, { ...s, custom: { parts: r.parts, steps: r.steps } });
applyMoves(b, base, r);
return true;
}
+/* ---------- BESTÅ BURS ---------- */
+
+/**
+ * BESTÅ BURS, read from its own manual: the two dividers take the hinge plates and flap stops, stand on dowels in the
+ * bottom (screwed from below), the ends go on with dowels and cam bolts, and the top on twelve dowels and eight cam
+ * bolts. Face down it gets five feet and two hardboard backs, nailed (the middle stays open for cables). Then the wall
+ * bracket, runners, two middle shelves, three flaps on two hinges each, two big drawers built face down on the rug
+ * (each with a castor under its front) and the loose tray that hangs in the left drawer.
+ */
+function bursRecipe(s: ProductSpec): Recipe {
+ const r = new Recipe();
+ const W = Math.round(s.size.w * 10), H = Math.round(s.size.h * 10), D = Math.round(s.size.d * 10);
+ const TT = 30, yb = 60, yt = H - TT; // top thickness, underside of the bottom, underside of the top
+ const zb = -D / 2 + 3, zf = D / 2 - DT - 1; // back edge of the carcass (the backs are on it), its front edge
+ const xs = W / 2 - T; // inside of the end panels
+ const cwid = (2 * xs - 2 * T) / 3; // each of the three compartments
+ const xv = cwid / 2 + T / 2; // divider centres
+ const dz = zf - zb, cz = (zf + zb) / 2;
+ const B = "BT", TP = "TP", SL = "SL", SR = "SR", V1 = "V1", V2 = "V2";
+ const side = (sx: number) => (sx < 0 ? SL : SR);
+ const div = (sx: number) => (sx < 0 ? V1 : V2);
+ r.part(B, "Bottom panel", [2 * xs, T, dz], [0, yb + T / 2, cz]);
+ r.part(TP, "Top panel", [W, TT, D], [0, yt + TT / 2, 0]);
+ for (const sx of [-1, 1]) r.part(side(sx), "End panel", [T, yt - yb, dz], [sx * (xs + T / 2), (yb + yt) / 2, cz]);
+ for (const sx of [-1, 1]) r.part(div(sx), "Divider", [T, yt - yb - T, dz], [sx * xv, (yb + T + yt) / 2, cz]);
+ for (const sx of [-1, 1]) r.part(sx < 0 ? "K1" : "K2", "Back panel", [W / 2 - xv, yt - yb, 3], [sx * (W / 2 + xv) / 2, (yb + yt) / 2, -D / 2 + 1.5], "fiber");
+ const feet: Vec3[] = [...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (W / 2 - 35), 0, sz > 0 ? zf - 35 : zb + 35] as Vec3)), [0, 0, zb + 35]];
+ feet.forEach((f, k) => r.part(`G${k}`, "Foot", [70, yb, 70], [f[0], yb / 2, f[2]]));
+ // the fronts: a drawer at each end, three flaps in the middle, all under the top
+ const fw = W / 3 - GAP, fy0 = 80, fy1 = yt - 5, fz = D / 2 - DT / 2;
+ const fh = (fy1 - fy0 - 2 * GAP) / 3;
+ const flapY = (k: number) => fy0 + k * (fh + GAP) + fh / 2;
+ for (let k = 0; k < 3; k++) {
+ r.part(`FL${k}`, "Flap", [fw, fh, DT], [0, flapY(k), fz]);
+ r.part(`FR${k}`, "Flap rail", [fw - 60, 14, 14], [0, flapY(k) + fh / 2 - 10, zf - 6], "metal");
+ }
+ const shelfY = [flapY(0) + fh / 2 + GAP / 2, flapY(1) + fh / 2 + GAP / 2];
+ shelfY.forEach((y, k) => r.part(`SH${k}`, "Shelf", [2 * (xv - T / 2) - 2, T, 320], [0, y, zb + 160]));
+ // the drawers: a box on runners behind each end front
+ const dw = cwid - 26, dy0 = 100, dy1 = 380, dzb = zb + 30;
+ const dcx = (sx: number) => sx * (xv + T / 2 + cwid / 2);
+ for (const sx of [-1, 1]) {
+ const q = sx < 0 ? "L" : "R", x = dcx(sx);
+ r.part(`D${q}F`, "Drawer front", [fw, fy1 - fy0, DT], [sx * W / 3, (fy0 + fy1) / 2, fz]);
+ for (const t of [-1, 1]) r.part(`D${q}S${t < 0 ? 1 : 2}`, "Drawer side", [T, dy1 - dy0, zf + 1 - dzb], [x + t * (dw / 2 - T / 2), (dy0 + dy1) / 2, (zf + 1 + dzb) / 2]);
+ r.part(`D${q}K`, "Drawer back", [dw - 2 * T, dy1 - dy0, T], [x, (dy0 + dy1) / 2, dzb + T / 2]);
+ r.part(`D${q}B`, "Drawer bottom", [dw - 2 * T + 8, 5, zf - dzb - T - 4], [x, dy0 + 12, (zf + dzb + T) / 2 - 2], "fiber");
+ r.part(`D${q}R`, "Drawer rail", [dw, 20, 20], [x, dy1 + 10, dzb + 10], "metal");
+ }
+ // the tray hangs between the left drawer's sides, at the front
+ const tx = dcx(-1), tin = dw / 2 - T, ty0 = dy1 - 80, tz0 = 20, tz1 = zf - 10;
+ for (const t of [-1, 1]) r.part(`TE${t < 0 ? 1 : 2}`, "Tray end", [3, 80, tz1 - tz0], [tx + t * (tin - 1.5), ty0 + 40, (tz0 + tz1) / 2], "metal");
+ [tz0 + 12, tz1 - 12].forEach((z, k) => r.parts.push({ id: `TR${k}`, name: "Tray rod", size: [2 * tin - 6, 10, 10], pos: [tx, dy1 - 10, z], shape: "cyl", material: "metal" }));
+ r.part("TB", "Tray bottom", [2 * tin - 6, 3, tz1 - tz0], [tx, ty0 + 1.5, (tz0 + tz1) / 2], "metal");
+
+ const zz = [-1, 1].map((t) => cz + t * 100);
+ const z3 = [-1, 0, 1].map((t) => cz + t * 150);
+ const ups = [...[-1, 1].map((sx) => ({ id: side(sx), x: sx * (xs + T / 2) })), ...[-1, 1].map((sx) => ({ id: div(sx), x: sx * xv }))];
+ const mid = (sx: number) => sx * (xv - T / 2); // a divider's face towards the middle
+ const plateAt = (sx: number) => [0, 1, 2].map((k) => [mid(sx), flapY(k), zf - 25] as Vec3);
+ const HINGE_X = fw / 2 - 24;
+
+ r.step({
+ title: "Screw the hinge plates onto the dividers",
+ detail: "Three on each, on the face that will look into the middle, near the front edge. Their screws are already in them.",
+ fix: [-1, 1].map((sx) => fix("plate", plateAt(sx), [-sx, 0, 0], { on: div(sx), len: 40, dia: 30 })).map((f) => ({ ...f, name: "Hinge plate" })),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ });
+ r.step({
+ title: "Screw in the flap stops",
+ detail: "Three in each divider, just below the hinge plates: the stud first, then the sleeve pushed over it.",
+ fix: [-1, 1].map((sx) => ({ ...fix("pin", plateAt(sx).map((p) => [p[0], p[1] - 40, p[2] + 10] as Vec3), [-sx, 0, 0], { on: div(sx), len: 16, dia: 8 }), name: "Flap stop" })),
+ tools: ["screwdriver"],
+ });
+ const sDiv = r.step({
+ title: "Stand the dividers on the bottom",
+ detail: "Lay the bottom on its back edge, tap three dowels in at each divider's place, then push the dividers onto them.",
+ add: [B, V1, V2], // the dividers are already out for their plates; listed so they count as added here
+ fix: [-1, 1].map((sx) => fix("dowel", z3.map((z) => [sx * xv, yb + T, z] as Vec3), [0, -1, 0], { on: B, mate: div(sx), len: 30, dia: 8 })),
+ pose: "+z",
+ warnings: ["floor"],
+ });
+ r.step({
+ title: "Screw the dividers on from below",
+ detail: "Two long screws through the bottom into each divider, with the Allen key.",
+ fix: [-1, 1].map((sx) => ({ ...fix("bolt", zz.map((z) => [sx * xv, yb, z] as Vec3), [0, 1, 0], { on: B, mate: div(sx), len: 50, dia: 7 }), name: "Allen screw" })),
+ });
+ r.step({
+ title: "Screw the cam bolts into the end panels",
+ detail: "Two in each, by hand, in the holes near the bottom edge.",
+ fix: [-1, 1].map((sx) => fix("camScrew", zz.map((z) => [sx * xs, yb + T / 2, z] as Vec3), [sx, 0, 0], { on: side(sx), mate: B, ...BOLT })),
+ wait: [SL, SR],
+ tools: ["screwdriver"],
+ });
+ r.step({
+ title: "Push the end panels onto the bottom",
+ detail: "Three dowels in each end panel first, then push them onto the ends of the bottom, the grooves at the back.",
+ add: [SL, SR],
+ fix: [-1, 1].map((sx) => fix("dowel", z3.map((z) => [sx * xs, yb + T / 2, z] as Vec3), [sx, 0, 0], { on: side(sx), mate: B, len: 30, dia: 8 })),
+ });
+ r.step({
+ title: "Turn the cam locks in the bottom",
+ detail: "Two at each end, arrow towards the bolt, then clockwise until tight.",
+ fix: [-1, 1].map((sx) => fix("cam", zz.map((z) => [sx * (xs - 32), yb + T, z] as Vec3), [0, -1, 0], { on: B, ...CAM })),
+ tools: ["screwdriver"],
+ });
+ const sTop = r.step({
+ title: "Screw the cam bolts into the top",
+ detail: "Eight in the underside, a pair over each end panel and each divider. Lay the top on the rug, glossy side down.",
+ fix: ups.map((u) => fix("camScrew", zz.map((z) => [u.x, yt, z] as Vec3), [0, 1, 0], { on: TP, mate: u.id, ...BOLT })),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ });
+ const sLower = r.step({
+ title: "Stand it up and lower the top on",
+ detail: "Twelve dowels in the top edges of the end panels and dividers, then lower the top so every bolt finds its hole.",
+ add: [TP],
+ fix: ups.map((u) => fix("dowel", z3.map((z) => [u.x, yt, z] as Vec3), [0, -1, 0], { on: u.id, mate: TP, len: 30, dia: 8 })),
+ pose: "+y",
+ people: 2,
+ });
+ // the dividers lie on the rug for their plates, then go onto the bottom's dowels; the top waits beside until it is lowered on
+ for (const sx of [-1, 1]) {
+ const id = div(sx);
+ r.moves.push({ id, states: [{ step: 0, pos: [sx * 320, T / 2, D / 2 + 260], rot: [0, 0, Math.PI / 2] }, { step: sDiv, pos: r.pos(id), from: [0, 0, -260] }] });
+ }
+ r.moves.push({ id: TP, states: [{ step: sTop, pos: [0, yt + TT / 2 + 420, 0] }, { step: sLower, pos: r.pos(TP), from: [0, 300, 0] }] });
+ r.step({
+ title: "Turn the cam locks under the top",
+ detail: "Two in each end panel and each divider, clockwise until the top is pulled down tight.",
+ fix: [
+ ...[-1, 1].map((sx) => fix("cam", zz.map((z) => [sx * xs, yt - 32, z] as Vec3), [sx, 0, 0], { on: side(sx), ...CAM })),
+ ...[-1, 1].map((sx) => fix("cam", zz.map((z) => [mid(sx), yt - 32, z] as Vec3), [sx, 0, 0], { on: div(sx), ...CAM })),
+ ],
+ tools: ["screwdriver"],
+ });
+ r.step({
+ title: "Lay it on its front and screw on the feet",
+ detail: "On the rug, together. Two screws hold each foot: one at each end of the end panels and one in the middle at the back.",
+ add: feet.map((_, k) => `G${k}`),
+ from: Object.fromEntries(feet.map((_, k) => [`G${k}`, [0, -220, 0] as Vec3])),
+ fix: feet.map((f, k) => ({ ...fix("screw", [-1, 1].map((t) => [f[0] + t * 15, 12, f[2] + t * 15] as Vec3), [0, 1, 0], { on: `G${k}`, mate: B, len: 60, dia: 4.5 }), name: "Long screw" })),
+ pose: "-z",
+ people: 2,
+ tools: ["screwdriver"],
+ warnings: ["two", "floor"],
+ });
+ r.step({ title: "Press a felt pad under each foot", detail: "One on the underside of each of the five feet.", fix: [fix("glide", feet, [0, 1, 0], { len: 4, dia: 40 })] });
+ r.step({
+ title: "Mark the dividers on the back edges",
+ detail: "Draw a pencil line across the back edge of the top and bottom at the middle of each divider, so you'll know where to nail.",
+ tools: ["pencil"],
+ });
+ const nailsOf = (sx: number, which: "corner" | "rest") => {
+ const k = sx < 0 ? "K1" : "K2";
+ const xo = sx * (xs + T / 2), xd = sx * xv;
+ const pts: Vec3[] =
+ which === "corner"
+ ? [[xo, yt - 20, -D / 2], [xd, yt - 20, -D / 2]]
+ : [
+ ...[yb + 60, yb + 160, yb + 260, yt - 100].map((y) => [xo, y, -D / 2] as Vec3),
+ ...[yb + 60, yb + 160, yb + 260, yt - 100].map((y) => [xd, y, -D / 2] as Vec3),
+ ...[0.1, 0.3, 0.5, 0.7, 0.9].map((t) => [xd + (xo - xd) * t, yb + T / 2, -D / 2] as Vec3),
+ ];
+ return fix("nail", pts, [0, 0, 1], { on: k, len: 20, dia: 1.6 });
+ };
+ r.step({
+ title: "Lay the two backs on and tack their corners",
+ detail: "Smooth side in. Line each one up with the outer corners and drive one nail at each top corner.",
+ add: ["K1", "K2"],
+ from: { K1: [0, 0, -260], K2: [0, 0, -260] },
+ fix: [nailsOf(-1, "corner"), nailsOf(1, "corner")],
+ tools: ["hammer"],
+ });
+ r.step({ title: "Mark the dividers on the backs", detail: "Join up your pencil marks across each back, so the nails go into the middle of the divider." , tools: ["pencil"] });
+ r.step({
+ title: "Nail the backs on",
+ detail: "Thirteen nails in each, into the end panel, the divider and the bottom. The middle stays open for the cables.",
+ fix: [nailsOf(-1, "rest"), nailsOf(1, "rest")],
+ tools: ["hammer"],
+ });
+ r.step({
+ title: "Stand it up and screw on the wall bracket",
+ detail: "Under the top at the back, in the middle, with one screw and a washer.",
+ fix: [
+ { ...fix("bracket", [[0, yt, -D / 2 + 10]], [0, 1, 0], { on: TP, len: 60, dia: 40 }), name: "Wall bracket" },
+ fix("washer", [[0, yt, -D / 2 + 22]], [0, 1, 0], { on: TP, len: 1.5, dia: 16 }),
+ fix("screw", [[0, yt, -D / 2 + 22]], [0, 1, 0], { on: TP, len: 16, dia: 4 }),
+ ],
+ pose: "+y",
+ people: 2,
+ tools: ["screwdriver"],
+ warnings: ["two"],
+ wall: false,
+ });
+ r.step({
+ title: "Screw the bracket to the wall",
+ detail: "Push the bench against the wall, then one screw with a washer through the bracket. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fix("plug", [[0, yt - 25, -D / 2 - 30]], [0, 0, -1], { len: 35, dia: 8 }),
+ fix("washer", [[0, yt - 25, -D / 2 + 4]], [0, 0, -1], { len: 1.5, dia: 16 }),
+ fix("screw", [[0, yt - 25, -D / 2 + 4]], [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ });
+ const runnerAt: { id: string; x: number; d: number }[] = [
+ { id: SL, x: -xs, d: -1 },
+ { id: V1, x: -(xv + T / 2), d: 1 },
+ { id: V2, x: xv + T / 2, d: -1 },
+ { id: SR, x: xs, d: 1 },
+ ];
+ const rz = (dzb + zf) / 2;
+ r.step({
+ title: "Screw in the drawer runners",
+ detail: "Left and right runners are different: the one with the hook goes at the front. Two screws each, low down in both end compartments.",
+ fix: runnerAt.flatMap((u) => [
+ fix("runner", [[u.x, dy0 + 10, rz]], [u.d, 0, 0], { on: u.id, len: zf - dzb - 10, dia: 30 }),
+ fix("screw", [-1, 1].map((t) => [u.x, dy0 + 10, rz + t * 120] as Vec3), [u.d, 0, 0], { on: u.id, len: 12, dia: 4 }),
+ ]),
+ tools: ["screwdriver"],
+ });
+ r.step({
+ title: "Put in the shelf pins",
+ detail: "Four on each side of the middle compartment, in the holes just above each flap's line.",
+ fix: shelfY.flatMap((y) => [-1, 1].map((sx) => fix("pin", [-1, 1].map((t) => [mid(sx), y - T / 2 - 3, zb + 160 + t * 110] as Vec3), [sx, 0, 0], { on: div(sx), len: 16, dia: 5 }))),
+ });
+ r.step({
+ title: "Slide in the two shelves",
+ detail: "Lay them on the pins, pushed right to the back.",
+ add: ["SH0", "SH1"],
+ from: { SH0: [0, 0, 420], SH1: [0, 0, 420] },
+ });
+ const flaps = [0, 1, 2].map((k) => `FL${k}`);
+ const rails = [0, 1, 2].map((k) => `FR${k}`);
+ const sFlap = r.step({
+ title: "Screw two hinges onto each flap",
+ detail: "Lay the three flaps face down on the rug. One left and one right hinge on each, the cups in the round holes, two screws each.",
+ add: flaps,
+ fix: [0, 1, 2].flatMap((k) => [
+ fix("hinge", [-1, 1].map((t) => [t * HINGE_X, flapY(k), zf + 1] as Vec3), [0, 0, 1], { on: `FL${k}` }),
+ fix("screw", [-1, 1].flatMap((t) => [-1, 1].map((u) => [t * HINGE_X, flapY(k) + u * 22, zf + 1] as Vec3)), [0, 0, 1], { on: `FL${k}`, len: 12, dia: 3.5 }),
+ ]),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ });
+ r.step({
+ title: "Screw a rail along each flap",
+ detail: "Along the top edge on the back, three screws each.",
+ add: rails,
+ fix: [0, 1, 2].map((k) => fix("screw", [-200, 0, 200].map((x) => [x, flapY(k) + fh / 2 - 10, zf - 13] as Vec3), [0, 0, 1], { on: `FR${k}`, mate: `FL${k}`, len: 20, dia: 3.5 })),
+ tools: ["screwdriver"],
+ });
+ const sHang = r.step({
+ title: "Click the flaps onto the hinge plates",
+ detail: "From the bottom flap up: slide each hinge onto its plate until it clicks, then tighten the screw on the plate.",
+ tools: ["screwdriver"],
+ });
+ // flaps and their rails lie face down on the rug in front while the hinges and rails go on
+ const lay = (p: Vec3, c: Vec3, at: Vec3): Vec3 => [at[0] + p[0] - c[0], at[1] - (p[2] - c[2]), at[2] + (p[1] - c[1])];
+ const FACE: Vec3 = [Math.PI / 2, 0, 0];
+ [0, 1, 2].forEach((k) => {
+ const c = r.pos(`FL${k}`);
+ const at: Vec3 = [0, DT / 2, D / 2 + 140 + fh / 2 + k * (fh + 50)];
+ r.moves.push({ id: `FL${k}`, states: [{ step: sFlap, pos: at, rot: FACE }, { step: sHang, pos: c, from: [0, 0, 320] }] });
+ r.moves.push({ id: `FR${k}`, states: [{ step: sFlap + 1, pos: lay(r.pos(`FR${k}`), c, at), rot: FACE, from: [0, 160, 0] }, { step: sHang, pos: r.pos(`FR${k}`), from: [0, 0, 320] }] });
+ });
+
+ // the drawers are built face down on the rug, then hung on the runners
+ const dq = ["L", "R"] as const;
+ const dids = (q: string, what: string) => `D${q}${what}`;
+ const sF = r.step({
+ title: "Screw the cam bolts into both drawer fronts",
+ detail: "Lay each front face down on the rug. Four bolts in each, by hand.",
+ add: dq.map((q) => dids(q, "F")),
+ fix: [-1, 1].map((sx, i) => fix("camScrew", [-1, 1].flatMap((t) => [dy0 + 50, dy1 - 50].map((y) => [dcx(sx) + t * (dw / 2 - T / 2), y, zf + 1] as Vec3)), [0, 0, 1], { on: dids(dq[i], "F"), ...BOLT })),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ });
+ r.step({
+ title: "Screw a castor onto each front",
+ detail: "In the middle of the bottom edge, on the back, two screws each. The wheel hangs below the front.",
+ fix: [-1, 1].flatMap((sx, i) => [
+ fix("castor", [[sx * W / 3, fy0, zf - 12]], [0, 1, 0], { on: dids(dq[i], "F"), len: fy0, dia: 45 }),
+ fix("screw", [-1, 1].map((t) => [sx * W / 3 + t * 30, fy0 + 25, zf + 1] as Vec3), [0, 0, 1], { on: dids(dq[i], "F"), len: 15, dia: 4 }),
+ ]),
+ tools: ["screwdriver"],
+ });
+ const sSide = r.step({
+ title: "Stand the drawer sides on the fronts",
+ detail: "Two small dowels in each side's front end, then push them onto the front over the cam bolts.",
+ add: dq.flatMap((q) => [dids(q, "S1"), dids(q, "S2")]),
+ fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((t) => fix("dowel", [dy0 + 110, dy1 - 110].map((y) => [dcx(sx) + t * (dw / 2 - T / 2), y, zf + 1] as Vec3), [0, 0, 1], { on: dids(dq[i], "F"), mate: dids(dq[i], t < 0 ? "S1" : "S2"), len: 25, dia: 6 }))),
+ });
+ r.step({
+ title: "Turn the cam locks in the drawer sides",
+ detail: "Two in each side, arrow towards the bolt, then clockwise until tight.",
+ fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((t) => fix("cam", [dy0 + 50, dy1 - 50].map((y) => [dcx(sx) + t * (dw / 2 - T), y, zf - 32] as Vec3), [t, 0, 0], { on: dids(dq[i], t < 0 ? "S1" : "S2"), ...CAM }))),
+ tools: ["screwdriver"],
+ });
+ const sBot = r.step({ title: "Slide the drawer bottoms into the grooves", detail: "All the way down to the front.", add: dq.map((q) => dids(q, "B")) });
+ const sBack = r.step({ title: "Lay the drawer backs on", detail: "Between the two sides, flush with their ends.", add: dq.map((q) => dids(q, "K")) });
+ r.step({
+ title: "Knock in the fittings for the backs",
+ detail: "Three through each side into the back, tapped in with a hammer.",
+ fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((t) => ({ ...fix("nail", [dy0 + 50, (dy0 + dy1) / 2, dy1 - 50].map((y) => [dcx(sx) + t * (dw / 2), y, dzb + T / 2] as Vec3), [-t, 0, 0], { on: dids(dq[i], t < 0 ? "S1" : "S2"), mate: dids(dq[i], "K"), len: 30, dia: 8 }), name: "Push fitting" }))),
+ tools: ["hammer"],
+ });
+ r.step({ title: "Pull the runners out", detail: "All four, until they lock open, with their catches at the front." });
+ const sIn = r.step({
+ title: "Put the drawers on the runners",
+ detail: "Rest each drawer on its pulled-out runners, push it in and press until both catches click.",
+ people: 1,
+ });
+ r.step({ title: "Line up the drawer fronts", detail: "Turn the wheel on each catch to raise or lower the front until the gaps are even with the flaps." });
+ r.step({ title: "Wipe off the fingerprints", detail: "A soft damp cloth on the glossy top and fronts, then a dry one." });
+ r.step({
+ title: "Screw a rail onto each drawer",
+ detail: "Along the top at the back, three screws each, into both sides and the back.",
+ add: dq.map((q) => dids(q, "R")),
+ fix: [-1, 1].map((sx, i) => fix("screw", [-1, 0, 1].map((t) => [dcx(sx) + t * (dw / 2 - T / 2), dy1 + 20, dzb + 10] as Vec3), [0, -1, 0], { on: dids(dq[i], "R"), mate: dids(dq[i], "K"), len: 30, dia: 3.5 })),
+ tools: ["screwdriver"],
+ });
+ dq.forEach((q) => {
+ const c = r.pos(dids(q, "F"));
+ const at: Vec3 = [c[0], DT / 2, D / 2 + 140 + (fy1 - fy0) / 2];
+ const ids2 = ["F", "S1", "S2", "B", "K"];
+ const first: Record<string, number> = { F: sF, S1: sSide, S2: sSide, B: sBot, K: sBack };
+ const drop: Record<string, Vec3 | undefined> = { S1: [0, 260, 0], S2: [0, 260, 0], B: [0, 300, 0], K: [0, 220, 0] };
+ for (const w of ids2) {
+ const id = dids(q, w);
+ r.moves.push({ id, states: [{ step: first[w], pos: lay(r.pos(id), c, at), rot: FACE, from: drop[w] }, { step: sIn, pos: r.pos(id), from: [0, 0, 420] }] });
+ }
+ });
+
+ // the tray is built on the floor in front and lifted into the left drawer
+ const trayIds = ["TE1", "TE2", "TR0", "TR1", "TB"];
+ const sTray = r.step({
+ title: "Screw the tray together",
+ detail: "The two rods and the bottom between the two end plates, eight screws in all.",
+ add: trayIds,
+ fix: [-1, 1].flatMap((t) => [
+ fix("screw", [tz0 + 12, tz1 - 12].map((z) => [tx + t * tin, dy1 - 10, z] as Vec3), [-t, 0, 0], { on: t < 0 ? "TE1" : "TE2", len: 10, dia: 4 }),
+ fix("screw", [tz0 + 30, tz1 - 30].map((z) => [tx + t * tin, ty0 + 1.5, z] as Vec3), [-t, 0, 0], { on: t < 0 ? "TE1" : "TE2", len: 10, dia: 4 }),
+ ]),
+ tools: ["screwdriver"],
+ });
+ r.step({
+ title: "Press the rubber strips in",
+ detail: "Turn the tray over, cut the strip in two and press the pieces into the edges of both end plates.",
+ fix: [{ ...fix("clip", [-1, 1].flatMap((t) => [tz0 + 40, tz1 - 40].map((z) => [tx + t * (tin - 1.5), ty0, z] as Vec3)), [0, 1, 0], { len: 4, dia: 10 }), name: "Rubber strip" }],
+ });
+ r.step({
+ title: "Stick on the bumpers",
+ detail: "One on each top corner of the tray, where it rests on the drawer.",
+ fix: [{ ...fix("glide", [-1, 1].flatMap((t) => [tz0 + 10, tz1 - 10].map((z) => [tx + t * (tin - 1.5), dy1, z] as Vec3)), [0, -1, 0], { len: 3, dia: 10 }), name: "Bumper" }],
+ });
+ const sDrop = r.step({ title: "Lift the tray into the left drawer", detail: "Open the drawer and lower the tray in at the front, so it rests on both sides." });
+ const tOff: Vec3 = [0, -ty0, D / 2 + 420];
+ for (const id of trayIds) r.moves.push({ id, states: [{ step: sTray, pos: add3(r.pos(id), tOff) }, { step: sDrop, pos: r.pos(id), from: [0, 260, 0] }] });
+ return r;
+}
+
const family: Family = {
names: ["BESTÅ"],
build(b, s) {
if (s.row) return false;
+ if (/^besta-burs-/.test(s.slug ?? "")) return drawRecipe(b, s, bursRecipe(s));
const g = guideOf(s);
return g ? draw(b, s, g) : false;
},
diff --git a/src/lib/plan/families/billy.ts b/src/lib/plan/families/billy.ts
index a4e0e17..089ff0e 100644
--- a/src/lib/plan/families/billy.ts
+++ b/src/lib/plan/families/billy.ts
@@ -1,6 +1,7 @@
import type { Family } from "./family";
-import type { PartMaterial, PartPiece, Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
+import type { PartMaterial, PartPiece, Pose, ProductSpec, RowUnit, StepKind, ToolId, Vec3, WarnId } from "../../types";
import { HW, type FitOpts, type HwDef, type PlanBuilder } from "../builder";
+import { buildUnits, unitOf as rowUnitOf } from "../units";
/**
* BILLY, read from its manuals. The frame is built lying on one side: dowels go into the ends of the plinth, the bottom,
@@ -610,7 +611,7 @@ function drawerKit(k: Kit, u: Unit, f: Frame) {
function build(b: PlanBuilder, s: ProductSpec): boolean {
const u = unitOf(s);
- if (!u) return false;
+ if (!u) return combo(b, s);
const k = new Kit(b);
if (u.H === 0) {
// the height extension on its own
@@ -641,8 +642,99 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
return true;
}
+/* ---------- sets of bookcases side by side ---------- */
+
+/**
+ * The wide BILLY sets are 40 and 80 cm bookcases standing side by side, read from IKEA's photos: 120 is three
+ * narrow ones, 160 two wide ones, 200 a narrow one between two wide ones, 240 three wide ones. Each is built from
+ * its own manual and none are joined to each other; each one is fixed to the wall on its own.
+ */
+interface Col {
+ w: 40 | 80;
+ name: string;
+ variant: string;
+}
+
+const GLASS = "Bookcase with glass doors";
+const PANEL = "Bookcase with panel/glass doors";
+/** Sets whose page title doesn't say which doors each bookcase has; the photo does. */
+const OWN_DOORS: Record<string, string[]> = {
+ "billy-oxberg-bookcase-120-x-30-x-237": [PANEL],
+ "billy-oxberg-bookcase-doors-200-x-30-x-106": [GLASS],
+ "billy-oxberg-bookcase-panel-glass-doors-160-x-30": [PANEL, GLASS],
+};
+
+function columns(s: ProductSpec): Col[] | null {
+ const W = Math.round(s.size.w * 10);
+ const widths: (40 | 80)[] | null = W === 1200 ? [40, 40, 40] : W === 1600 ? [80, 80] : W === 2000 ? [80, 40, 80] : W === 2400 ? [80, 80, 80] : null;
+ if (!widths) return null;
+ const name = s.name.toUpperCase();
+ const doors = /OXBERG|HÖGADAL|HOGADAL|HÖGBO|HOGBO/.test(name);
+ const own = OWN_DOORS[s.slug ?? ""];
+ let j = 0;
+ return widths.map((w, i) => {
+ // the narrow one in the middle of the 200 cm sets with doors stands open
+ if (!doors || (W === 2000 && i === 1)) return { w, name: "BILLY", variant: "Bookcase" };
+ const variant = own ? own[Math.min(own.length - 1, j++)] : s.variant;
+ return { w, name: s.name, variant };
+ });
+}
+
+const doorsOf = (c: Col) => (c.name === "BILLY" ? "" : /panel\/glass|pnl\/glss/i.test(c.variant) ? "panel" : /glass/i.test(c.variant) ? "glass" : "solid");
+const COUNTS = ["", "", "two", "three"];
+
+function combo(b: PlanBuilder, s: ProductSpec): boolean {
+ const cols = columns(s);
+ if (!cols) return false;
+ const keyOf = (c: Col) => `${c.w}|${c.name}|${c.variant}`;
+ const groupIds = [...new Set(cols.map(keyOf))];
+ const byUnit = new Map<RowUnit, Col>();
+ // a unit's shelf parameters carry its group, so frames with different doors aren't taken as copies of each other
+ const units: RowUnit[] = cols.map((c) => {
+ const u: RowUnit = { w: c.w, shelf: { rows: groupIds.indexOf(keyOf(c)) } };
+ byUnit.set(u, c);
+ return u;
+ });
+ const { cabinet: _c, ...rest } = s;
+ void _c;
+ const set: ProductSpec = { ...rest, archetype: "shelf", row: { n: cols.length, of: "bookcase", join: false, units } };
+ const n0 = b.steps.length;
+ buildUnits(b, set, (bb, spec) => {
+ const c = byUnit.get(rowUnitOf(spec)!)!;
+ build(bb, { ...spec, name: c.name, variant: c.variant });
+ });
+
+ // the row code's titles for the other bookcases, in its order: the commonest (widest) first, then the others
+ const groups = groupIds.map((k) => cols.map((c, i) => (keyOf(c) === k ? i : -1)).filter((i) => i >= 0));
+ const first = [...groups].sort((a, c) => c.length - a.length || cols[c[0]].w - cols[a[0]].w)[0];
+ const order = [first, ...groups.filter((g) => g !== first)];
+ const mixed = new Set(cols.map((c) => c.w)).size > 1;
+ const f = cols[first[0]];
+ const builds = b.steps.slice(n0).filter((st) => /^Build .* the same way$/.test(st.title));
+ order
+ .map((g) => ({ g, k: g === first ? g.length - 1 : g.length }))
+ .filter((x) => x.k > 0)
+ .forEach(({ g, k }, i) => {
+ const st = builds[i];
+ if (!st) return;
+ const c = cols[g[0]];
+ const size = mixed ? (c.w === 40 ? "narrow " : "wide ") : "";
+ const dc = doorsOf(c), df = doorsOf(f);
+ const what = k > 1 ? `${COUNTS[k]} ${g === first ? "more " : ""}${size}bookcases` : `${g === first ? "another" : "the"} ${size}bookcase`;
+ const with_ = dc === df ? "" : dc === "" ? " without doors" : dc === "glass" ? " with glass doors" : dc === "panel" ? " with panel and glass doors" : " with doors";
+ st.title = `Build ${what}${with_} the same way`;
+ const diff = [c.w < f.w ? "just narrower" : c.w > f.w ? "just wider" : "", dc === df ? "" : dc === "" ? "leave its doors off" : "with its own doors"].filter(Boolean);
+ st.detail = `Every step as for the first one${diff.length ? ", " + diff.join(", ") : ""}. Stand ${k > 1 ? "each one" : "it"} in its place in the row.`;
+ });
+ return true;
+}
+
const family: Family = {
names: ["BILLY"],
build,
+ row(b, s) {
+ if (unitOf(s)) return false;
+ return combo(b, s);
+ },
};
export default family;
diff --git a/src/lib/plan/families/bissa.ts b/src/lib/plan/families/bissa.ts
index d7e48fb..708ec46 100644
--- a/src/lib/plan/families/bissa.ts
+++ b/src/lib/plan/families/bissa.ts
@@ -47,8 +47,8 @@ function recipe(s: ProductSpec): CustomParams {
return [
{ id: `F${i}`, name: "Front", size: [2 * xi - 4, hc - 4, T], pos: [0, yb + hc / 2, zf] },
...[-1, 1].map((sx) => ({ id: `K${i}${sx < 0 ? "L" : "R"}`, name: "Bracket", size: [6, bh, bd], pos: [sx * (xi - 8), yb + bh / 2 + 6, bz], pieces: bracket, material: "fiber" as const })),
- { id: `B${i}`, name: "Shoe board", size: [2 * xi - 40, 6, Math.hypot(bd, bh * 0.7) - 20], pos: [0, yb + bh * 0.4, bz], rot: [ang, 0, 0] as Vec3, material: "fiber" as const },
- { id: `L${i}`, name: "Shoe strip", size: [2 * xi - 40, 40, 8], pos: [0, yb + bh * 0.82, bz - bd / 2 + 30] },
+ { id: `B${i}`, name: "Shoe board", size: [2 * xi - 22, 6, Math.hypot(bd, bh * 0.7) - 20], pos: [0, yb + bh * 0.4, bz], rot: [ang, 0, 0] as Vec3, material: "fiber" as const },
+ { id: `L${i}`, name: "Shoe strip", size: [2 * xi - 22, 40, 8], pos: [0, yb + bh * 0.82, bz - bd / 2 + 30] },
] as CustomPart[];
};
const comps = Array.from({ length: n }, (_, i) => comp(i));
@@ -76,8 +76,9 @@ function recipe(s: ProductSpec): CustomParams {
const fz = f.pos[2] - T / 2;
return {
brackets: { kind: "screw" as const, count: 6, ...BIG, at: [kl, kr].flatMap((k) => [0.15, 0.5, 0.85].map((t) => [k.pos[0], f.pos[1] - f.size[1] / 2 + 15 + (f.size[1] - 30) * t * 0.8, fz - 2] as Vec3)), dir: [0, 0, 1] as Vec3, on: `F${i}` },
- board: { kind: "screw" as const, count: 2, ...SMALL, at: [kl, kr].map((k) => [k.pos[0] + Math.sign(k.pos[0]) * 4, bd.pos[1], bd.pos[2]] as Vec3), dir: [-1, 0, 0] as Vec3, on: `B${i}` },
- strip: { kind: "screw" as const, count: 2, ...SMALL, at: [kl, kr].map((k) => [k.pos[0] + Math.sign(k.pos[0]) * 4, st.pos[1], st.pos[2]] as Vec3), dir: [-1, 0, 0] as Vec3, on: `L${i}` },
+ // one screw through each bracket from outside into the board's or strip's end
+ board: [kl, kr].map((k): CustomFix => ({ kind: "screw", count: 1, ...SMALL, at: [[k.pos[0] + Math.sign(k.pos[0]) * 3, bd.pos[1], bd.pos[2]]], dir: [-Math.sign(k.pos[0]), 0, 0], on: k.id, mate: `B${i}` })),
+ strip: [kl, kr].map((k): CustomFix => ({ kind: "screw", count: 1, ...SMALL, at: [[k.pos[0] + Math.sign(k.pos[0]) * 3, st.pos[1], st.pos[2]]], dir: [-Math.sign(k.pos[0]), 0, 0], on: k.id, mate: `L${i}` })),
};
};
const bushings = comps.flatMap((_, i) => [-1, 1].map((sx) => [sx * (xi - 6), y0 + i * hc + 30, D / 2 - 45] as Vec3));
@@ -138,15 +139,15 @@ function recipe(s: ProductSpec): CustomParams {
tools: ["screwdriver"],
from: { F0: [0, 0, 500], K0L: [0, 0, 600], K0R: [0, 0, 600] },
},
- { title: "Slot in the shoe board and screw it", detail: "The wide board, into the slots in both brackets. One screw each side.", add: ["B0"], fix: [compFix(0).board], tools: ["screwdriver"], from: { B0: [0, 0, 500] } },
- { title: "Slot in the shoe strip and screw it", detail: "The narrow strip, at the back of the brackets. One screw each side.", add: ["L0"], fix: [compFix(0).strip], tools: ["screwdriver"], from: { L0: [0, 0, 500] } },
+ { title: "Slot in the shoe board and screw it", detail: "The wide board, into the slots in both brackets. One screw each side.", add: ["B0"], fix: compFix(0).board, tools: ["screwdriver"], from: { B0: [0, 0, 500] } },
+ { title: "Slot in the shoe strip and screw it", detail: "The narrow strip, at the back of the brackets. One screw each side.", add: ["L0"], fix: compFix(0).strip, tools: ["screwdriver"], from: { L0: [0, 0, 500] } },
{
title: n > 2 ? "Build the other compartments the same way" : "Build the other compartment the same way",
detail: "Brackets, shoe board and strip, then check each bracket's slot sits on its pivot.",
add: later.flat().map((p) => p.id),
fix: later.flatMap((_, j) => {
const f = compFix(j + 1);
- return [f.brackets, f.board, f.strip];
+ return [f.brackets, ...f.board, ...f.strip];
}),
tools: ["screwdriver"],
repeat: n - 1,
diff --git a/src/lib/plan/families/bjorkasen.ts b/src/lib/plan/families/bjorkasen.ts
index 5adfafa..ec1f568 100644
--- a/src/lib/plan/families/bjorkasen.ts
+++ b/src/lib/plan/families/bjorkasen.ts
@@ -43,7 +43,7 @@ function stand(): CustomParams {
title: "Bolt the uprights into the base tube",
detail: "Lay the base on its front on a rug. Push each upright into a stub with its holes lined up, then one bolt through the stub with the Allen key.",
add: ["B", "U1", "U2"],
- fix: [-1, 1].map((sx, i) => at("bolt", [[sx * (xu + TUBE / 2 + 2), stub - 40, zu]], [-sx, 0, 0], "B", `U${i + 1}`, { len: 45, dia: 6 })),
+ fix: [-1, 1].map((sx, i) => at("bolt", [[sx * (xu + TUBE / 2 + 2), stub - 10, zu]], [-sx, 0, 0], "B", `U${i + 1}`, { len: 45, dia: 6 })),
tools: ["allen"],
pose: "-z",
warnings: ["floor"],
diff --git a/src/lib/plan/families/bjorksnas.ts b/src/lib/plan/families/bjorksnas.ts
index 83eadae..9025c8d 100644
--- a/src/lib/plan/families/bjorksnas.ts
+++ b/src/lib/plan/families/bjorksnas.ts
@@ -45,7 +45,7 @@ function bedside(s: ProductSpec): CustomParams {
const backYs = [yA - 45, yA + 45];
const runner = (sx: number): CustomFix[] => [
{ kind: "runner", count: 1, len: 300, dia: 35, at: [[sx * xi, yD, 0]], dir: [-sx, 0, 0], on: fid(sx) },
- { kind: "screw", count: 2, len: 12, dia: 5, at: [-100, 100].map((z): Vec3 => [sx * (xi - 12), yD, z]), dir: [sx, 0, 0], on: fid(sx) },
+ { kind: "screw", count: 2, len: 12, dia: 5, at: [-100, 100].map((z): Vec3 => [sx * (xi - 3), yD, z]), dir: [sx, 0, 0], on: fid(sx) },
];
const steps: CustomStep[] = [
{
@@ -133,7 +133,7 @@ function bedside(s: ProductSpec): CustomParams {
title: "Screw on the drawer back",
detail: "Its lower edge over the bottom, two long screws through each side.",
add: ["DK"],
- fix: sides.map((sx): CustomFix => ({ kind: "screw", count: 2, len: 40, dia: 4, at: [yD - 30, yD + 25].map((y): Vec3 => [sx * (dw / 2), y, dz0 + 7]), dir: [-sx, 0, 0], on: `DS${sx}` })),
+ fix: sides.map((sx): CustomFix => ({ kind: "screw", count: 2, len: 40, dia: 4, at: [yD - 30, yD + 5].map((y): Vec3 => [sx * (dw / 2), y, dz0 + 7]), dir: [-sx, 0, 0], on: `DS${sx}` })),
tools: ["screwdriver"],
},
{
@@ -197,10 +197,11 @@ function drawerSteps(ds: Drawer[], h: number, zf: number, zb: number, gap: numbe
{ title: "Slide in the drawer bottoms", detail: "Down the grooves until they meet the front.", add: ds.map((d) => `${d.id}B`), from: Object.fromEntries(ds.map((d) => [`${d.id}B`, [0, 0, -400] as Vec3])) },
{
title: `Fit the ${what} backs`,
- detail: "Four cam bolts in each back, press it onto the sides, then four cam locks.",
+ detail: "Four cam bolts in each back. Angle it in between the sides, one end first, then four cam locks.",
add: ds.map((d) => `${d.id}K`),
+ from: Object.fromEntries(ds.map((d) => [`${d.id}K`, [220, 220, 0] as Vec3])),
fix: [
- ...ds.map((d): CustomFix => ({ kind: "camScrew", count: 4, at: [-1, 1].flatMap((sx) => ys(d).map((y): Vec3 => [sideX(d, sx) - sx * 7, y + 10, zb + 7])), dir: [-1, 0, 0], on: `${d.id}K` })),
+ ...ds.flatMap((d) => [-1, 1].map((sx): CustomFix => ({ kind: "camScrew", count: 2, at: ys(d).map((y): Vec3 => [sideX(d, sx) - sx * 7, y + 10, zb + 7]), dir: [-sx, 0, 0], on: `${d.id}K` }))),
...ds.map((d): CustomFix => ({ kind: "cam", count: 4, at: [-1, 1].flatMap((sx) => ys(d).map((y): Vec3 => [sideX(d, sx) - sx * 7, y + 10, zb + 40])), dir: [1, 0, 0], on: `${d.id}S${-1}` })),
],
tools: ["screwdriver"],
@@ -249,30 +250,31 @@ function chest(s: ProductSpec): CustomParams {
];
const sides = [-1, 1];
const fid = (sx: number) => (sx < 0 ? "FL" : "FR");
- const railYs = [yTop - ri / 2 - 15, yTop - ri / 2 + 15];
- const camBolts = (sx: number): CustomFix => ({ kind: "camScrew", count: 4, at: [zl, -zl].flatMap((z) => railYs.map((y): Vec3 => [sx * xi, y, z])), dir: [-sx, 0, 0], on: fid(sx) });
+ // one cam bolt in the middle of each rail end, a dowel above and below it
+ const railYs = [yTop - ri / 2];
+ const camBolts = (sx: number): CustomFix => ({ kind: "camScrew", count: 2, at: [zl, -zl].flatMap((z) => railYs.map((y): Vec3 => [sx * xi, y, z])), dir: [-sx, 0, 0], on: fid(sx) });
const camLocks = (sx: number): CustomFix[] => [
- { kind: "cam", count: 2, at: railYs.map((y): Vec3 => [sx * (xi - 35), y, zl - 10]), dir: [0, 0, -1], on: "TF" },
- { kind: "cam", count: 2, at: railYs.map((y): Vec3 => [sx * (xi - 35), y, -zl + 10]), dir: [0, 0, 1], on: "TB" },
+ { kind: "cam", count: 1, at: railYs.map((y): Vec3 => [sx * (xi - 35), y, zl - 10]), dir: [0, 0, -1], on: "TF" },
+ { kind: "cam", count: 1, at: railYs.map((y): Vec3 => [sx * (xi - 35), y, -zl + 10]), dir: [0, 0, 1], on: "TB" },
];
const longScrews = (sx: number): CustomFix => ({ kind: "screw", name: "Long screw", count: 3, len: 70, dia: 6, at: [-zl + 60, 0, zl - 60].map((z): Vec3 => [sx * (xl + 9), y0 + 10, z]), dir: [-sx, 0, 0], on: fid(sx), mate: "BO" });
const runnerYs = [0, 1, 2, 3].map((r) => rowY(r) - fh / 2 + 25);
const runners = (sx: number): CustomFix[] => [
{ kind: "runner", count: 4, len: 400, dia: 35, at: runnerYs.map((y): Vec3 => [sx * xi, y, 0]), dir: [-sx, 0, 0], on: fid(sx) },
- { kind: "screw", count: 8, len: 12, dia: 5, at: runnerYs.flatMap((y) => [-150, 150].map((z): Vec3 => [sx * (xi - 12), y, z])), dir: [sx, 0, 0], on: fid(sx) },
+ { kind: "screw", count: 8, len: 12, dia: 5, at: runnerYs.flatMap((y) => [-150, 150].map((z): Vec3 => [sx * (xi - 3), y, z])), dir: [sx, 0, 0], on: fid(sx) },
];
const wallX = [-1, 1].map((sx) => sx * (xi - 120));
const steps: CustomStep[] = [
- { title: "Screw the cam bolts into the side frames", detail: "Lay both frames on a rug, inside up. Four in each, by the top.", fix: [camBolts(-1)], tools: ["screwdriver"], pose: "+x", warnings: ["floor"] },
+ { title: "Screw the cam bolts into the side frames", detail: "Lay both frames on a rug, inside up. Two in each, by the top.", fix: [camBolts(-1)], tools: ["screwdriver"], pose: "+x", warnings: ["floor"] },
{ title: "Screw the runners onto the side frames", detail: "Four on each frame, two screws in each. The left and right runners are different.", fix: runners(-1), tools: ["screwdriver"] },
{
title: "Stand the top rails on one frame",
detail: "Tap two dowels into the ends of each rail and push them onto the frame's dowel holes and cam bolts.",
add: ["FL", "TF", "TB"],
- fix: [{ kind: "dowel", count: 4, at: [zl, -zl].flatMap((z) => [yTop - 10, yTop - ri + 10].map((y): Vec3 => [-xi, y, z])), dir: [-1, 0, 0], on: "FL" }],
+ fix: [{ kind: "dowel", count: 4, at: [zl, -zl].flatMap((z) => [yTop - ri / 2 + 23, yTop - ri / 2 - 23].map((y): Vec3 => [-xi, y, z])), dir: [-1, 0, 0], on: "FL" }],
tools: ["hammer"],
},
- { title: "Lock the rails and slide in the back", detail: "Four cam locks, then slide the back panel down the grooves.", add: ["BK"], fix: camLocks(-1), from: { BK: [400, 0, 0] }, tools: ["screwdriver"] },
+ { title: "Lock the rails and slide in the back", detail: "Two cam locks, then slide the back panel down the grooves.", add: ["BK"], fix: camLocks(-1), from: { BK: [400, 0, 0] }, tools: ["screwdriver"] },
{ title: "Screw in the bottom panel", detail: "Three long screws through the frame into its edge, with the Allen key.", add: ["BO"], fix: [longScrews(-1)], tools: ["allen"] },
{
title: "Lay the other frame on together",
@@ -283,7 +285,7 @@ function chest(s: ProductSpec): CustomParams {
warnings: ["two"],
tools: ["screwdriver"],
},
- { title: "Lock the rails to this frame", detail: "Four more cam locks.", fix: camLocks(1), tools: ["screwdriver"] },
+ { title: "Lock the rails to this frame", detail: "Two more cam locks.", fix: camLocks(1), tools: ["screwdriver"] },
{ title: "Screw the bottom panel to this frame", detail: "Three long screws, as on the other side.", fix: [longScrews(1)], tools: ["allen"] },
{
title: "Screw the feet into the legs",
@@ -306,7 +308,7 @@ function chest(s: ProductSpec): CustomParams {
{ kind: "angle", name: "Wall bracket", count: 2, len: 60, dia: 30, at: wallX.map((x): Vec3 => [x, yTop, -zl - 10]), dir: [0, 1, 0], on: "TOP" },
{ kind: "screw", count: 2, len: 16, dia: 4, at: wallX.map((x): Vec3 => [x, yTop, -zl + 10]), dir: [0, 1, 0], on: "TOP" },
...sides.map((sx): CustomFix => ({ kind: "runner", count: 1, len: 400, dia: 35, at: [[sx * 9, runnerYs[3], 0]], dir: [sx, 0, 0], on: "DV" })),
- ...sides.map((sx): CustomFix => ({ kind: "screw", count: 2, len: 12, dia: 5, at: [-150, 150].map((z): Vec3 => [sx * 21, runnerYs[3], z]), dir: [-sx, 0, 0], on: "DV" })),
+ ...sides.map((sx): CustomFix => ({ kind: "screw", count: 2, len: 12, dia: 5, at: [-150, 150].map((z): Vec3 => [sx * 12, runnerYs[3], z]), dir: [-sx, 0, 0], on: "DV" })),
{ kind: "dowel", count: 2, at: [-80, 80].map((z): Vec3 => [0, yTop, z]), dir: [0, -1, 0], on: "DV", mate: "TOP" },
{ kind: "cam", count: 2, at: [-80, 80].map((z): Vec3 => [9, yTop - 30, z + 30]), dir: [1, 0, 0], on: "DV" },
],
@@ -414,8 +416,8 @@ function bed(s: ProductSpec): CustomParams {
{ kind: "camScrew", name: "Cam stud", count: 2, at: [yr - 40, yr + 40].map((y): Vec3 => [sx * xr, y, zh + LG / 2]), dir: [0, 0, -1], on: sx < 0 ? "HL" : "HR" },
];
const legDowels = (sx: number): CustomFix[] => [
- { kind: "dowel", count: 2, at: [yr - 10, yr + 10].map((y): Vec3 => [sx * xi, y, zh]), dir: [-sx, 0, 0], on: sx < 0 ? "HL" : "HR" },
- { kind: "dowel", count: 2, at: [yr0 + 20, yr1 - 20].map((y): Vec3 => [sx * xr, y, zh + LG / 2]), dir: [0, 0, -1], on: sx < 0 ? "HL" : "HR" },
+ { kind: "dowel", count: 2, at: [yr - 15, yr + 15].map((y): Vec3 => [sx * xi, y, zh]), dir: [-sx, 0, 0], on: sx < 0 ? "HL" : "HR" },
+ { kind: "dowel", count: 2, at: [yr0 + 15, yr1 - 15].map((y): Vec3 => [sx * xr, y, zh + LG / 2]), dir: [0, 0, -1], on: sx < 0 ? "HL" : "HR" },
];
const ladderBolts = (sx: number): CustomFix[] => [
{ kind: "bolt", count: 2, len: 120, dia: 8, at: [HH - 43, HH - 170].map((y): Vec3 => [sx * W / 2, y, zh]), dir: [-sx, 0, 0], on: sx < 0 ? "HL" : "HR", mate: "LAD" },
@@ -453,7 +455,7 @@ function bed(s: ProductSpec): CustomParams {
add: ["FB"],
fix: [-1, 1].flatMap((sx): CustomFix[] => [
{ kind: "camScrew", name: "Cam stud", count: 2, at: [yr - 40, yr + 40].map((y): Vec3 => [sx * xr, y, zf - LG / 2]), dir: [0, 0, 1], on: "FB" },
- { kind: "dowel", count: 2, at: [yr0 + 20, yr1 - 20].map((y): Vec3 => [sx * xr, y, zf - LG / 2]), dir: [0, 0, 1], on: "FB" },
+ { kind: "dowel", count: 2, at: [yr0 + 15, yr1 - 15].map((y): Vec3 => [sx * xr, y, zf - LG / 2]), dir: [0, 0, 1], on: "FB" },
]),
people: 2,
warnings: ["two"],
@@ -464,8 +466,10 @@ function bed(s: ProductSpec): CustomParams {
title: "Screw the beam brackets on",
detail: "One in the middle of the headboard rail and one on the footboard, two screws each.",
fix: [
- { kind: "angle", name: "Beam bracket", count: 2, len: 80, dia: 60, at: [brAt(zs0), brAt(zs1)], dir: [0, -1, 0] },
- { kind: "screw", count: 4, len: 16, dia: 4, at: [zs0, zs1].flatMap((z) => [-25, 25].map((x): Vec3 => [x, ySup - 30, z])), dir: [0, 0, -1] },
+ // on the faces of the headboard rail and the footboard's board
+ { kind: "angle", name: "Beam bracket", count: 2, len: 80, dia: 60, at: [brAt(zh + 11), brAt(zf - 11)], dir: [0, -1, 0] },
+ { kind: "screw", count: 2, len: 16, dia: 4, at: [-25, 25].map((x): Vec3 => [x, ySup - 30, zh + 11]), dir: [0, 0, -1], on: "HB" },
+ { kind: "screw", count: 2, len: 16, dia: 4, at: [-25, 25].map((x): Vec3 => [x, ySup - 30, zf - 11]), dir: [0, 0, 1], on: "FB" },
],
tools: ["screwdriver"],
},
@@ -485,7 +489,7 @@ function bed(s: ProductSpec): CustomParams {
title: "Put the slatted bases together",
detail: "Each base has its own manual: screw its rail halves and cross rails together, then clip every slat into its holders, curved side up.",
add: ["SL-1", "SL1"],
- fix: [-1, 1].map((sx): CustomFix => ({ kind: "screw", count: 6, len: 60, dia: 6, at: [-1, 1].flatMap((k) => [-600, 0, 600].map((z): Vec3 => [sx * (bw / 2 + 30) + k * (bw / 2 - 20), ySup + 20, z])).slice(0, 6), dir: [0, -1, 0], on: `SL${sx}` })),
+ fix: [-1, 1].map((sx): CustomFix => ({ kind: "screw", count: 6, len: 40, dia: 6, at: [-1, 1].flatMap((k) => [-600, 0, 600].map((z): Vec3 => [sx * (bw / 2 + 30) + k * (bw / 2 - 20), ySup + 40, z])).slice(0, 6), dir: [0, -1, 0], on: `SL${sx}` })),
from: { "SL-1": [0, 400, 0], SL1: [0, 400, 0] },
tools: ["screwdriver"],
},
@@ -494,7 +498,8 @@ function bed(s: ProductSpec): CustomParams {
detail: "Eight stops over the edges of the bases, a small bolt through each into the slat support.",
fix: [
{ kind: "clip", name: "Slat stop", count: 8, len: 20, dia: 25, at: stopAt, dir: [0, -1, 0] },
- { kind: "screw", count: 8, len: 10, dia: 6, at: stopAt.map((p): Vec3 => [p[0], p[1] + 10, p[2]]), dir: [0, -1, 0] },
+ // through the stop's end, past the base's edge, into the support's top flange
+ { kind: "screw", count: 8, len: 10, dia: 6, at: stopAt.map((p): Vec3 => [p[0], ySup + 6, p[2] + (p[2] > 0 ? -23 : 23)]), dir: [0, -1, 0] },
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/blaliden.ts b/src/lib/plan/families/blaliden.ts
index f5f05f4..ee5542a 100644
--- a/src/lib/plan/families/blaliden.ts
+++ b/src/lib/plan/families/blaliden.ts
@@ -61,7 +61,7 @@ function recipe(s: ProductSpec): CustomParams | null {
// three glass shelves, at the heights in IKEA's picture
const shelfYs = [470, 810, 1160];
const shelfIds = shelfYs.map((y, i) => {
- parts.push({ id: `G${i + 1}`, name: "Glass shelf", size: [2 * xi - 6, 6, sd - 40], pos: [0, y + 3, zc], material: "glass" });
+ parts.push({ id: `G${i + 1}`, name: "Glass shelf", size: [2 * xi - 6, 6, sd - 20], pos: [0, y + 3, zc + 5], material: "glass" });
return `G${i + 1}`;
});
@@ -70,8 +70,15 @@ function recipe(s: ProductSpec): CustomParams | null {
const topScrews = [-1, 1].map((sx) => at("screw", [[sx * xi, topY, zc - 80], [sx * xi, topY, zc + 80]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", "TF", { len: 12, dia: 6 }));
const feet: Vec3[] = [-1, 1].flatMap((sx) => [zb + 10, zf - 10].map((z) => [sx * (W / 2 - 10), F, z] as Vec3));
const clips: Vec3[] = [-1, 1].map((sx) => [sx * 90, topY - 15, zb + 14] as Vec3);
+ const clipScrews: Vec3[] = clips.map((c) => [c[0], topY + 5, zb - 2] as Vec3);
const strapAt: Vec3 = [0, topY, zb];
- const supports: Vec3[] = shelfYs.flatMap((y) => [-1, 1].flatMap((sx) => [zb + 40, zf - 40].map((z) => [sx * xi, y - 8, z] as Vec3)));
+ // a support's cup sits in each corner post, its screw through the flange below it (kept apart so neither is nudged)
+ const corners = (sx: number, dx: number, dy: number) => shelfYs.flatMap((y) => [zb + 10, zf - 10].map((z) => [sx * (xi - dx), y + dy, z] as Vec3));
+ const supportFix = (sx: number): CustomFix[] => [
+ at("pin", corners(sx, 0, -10), [sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { name: "Shelf support", len: 20, dia: 15 }),
+ at("cap", corners(sx, 15, 0), [0, -1, 0], sx < 0 ? "SL" : "SR", undefined, { name: "Felt pad", len: 2, dia: 12 }),
+ at("screw", corners(sx, 3, -34), [sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, SCREW),
+ ];
const hinges: Vec3[] = [220, 760, 1300].map((y) => [-W / 2 + 10, y, zf] as Vec3);
const steps: CustomStep[] = [
@@ -98,7 +105,7 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Clip the back glass in at the top",
detail: "One of you holds the case still. Hook the two clips over the top frame at the back and screw them on, not tight yet.",
- fix: [at("clip", clips, [0, -1, 0], "TF", "BK", { name: "Back clip", len: 20, dia: 15 }), at("screw", clips, [0, 0, 1], "TF", undefined, SCREW)],
+ fix: [at("clip", clips, [0, -1, 0], "TF", "BK", { name: "Back clip", len: 20, dia: 15 }), at("screw", clipScrews, [0, 0, 1], "TF", undefined, SCREW)],
tools: ["screwdriver"],
people: 2,
},
@@ -129,11 +136,10 @@ function recipe(s: ProductSpec): CustomParams | null {
fix: [at("screw", [strapAt], [0, 0, 1], "TF", undefined, SCREW)],
tools: ["screwdriver"],
},
- { title: "Stick a felt pad on each shelf support", detail: "Press one pad into the cup of each of the twelve supports.", fix: [at("glide", supports, [0, -1, 0], undefined, undefined, { len: 2, dia: 12 })] },
{
- title: "Screw the shelf supports into the sides",
- detail: "Four at each shelf height, one in each corner post. A screw through each one.",
- fix: [at("pin", supports, [1, 0, 0], undefined, undefined, { name: "Shelf support", len: 20, dia: 15 }), at("screw", supports, [1, 0, 0], undefined, undefined, SCREW)],
+ title: "Screw in the shelf supports with their felt pads",
+ detail: "Press a felt pad into the cup of each of the twelve supports, then screw them to the corner posts, four at each shelf height.",
+ fix: [...supportFix(-1), ...supportFix(1)],
tools: ["screwdriver"],
},
{ title: "Drop a ring onto each hinge pin", detail: "The three pins stick up on the front left post.", fix: [at("washer", hinges, [0, -1, 0], "SL", undefined, { len: 3, dia: 10 })] },
@@ -152,7 +158,7 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw on the knob",
detail: "On the right edge of the door, with the screw from the inside.",
- fix: [{ kind: "knob", count: 1, at: [[W / 2 - 12, 760, zf + DT]], dir: [0, 0, -1], on: "DOOR" }, at("screw", [[W / 2 - 12, 760, zf]], [0, 0, 1], "DOOR", undefined, { len: 25, dia: 4 })],
+ fix: [{ kind: "knob", count: 1, at: [[W / 2 - 12, 740, zf + DT]], dir: [0, 0, -1], on: "DOOR" }, at("screw", [[W / 2 - 12, 740, zf - 4]], [0, 0, 1], "DOOR", undefined, { len: 25, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Lay in the glass shelves", detail: "Open the door and set each shelf on its four supports.", add: shelfIds, from: Object.fromEntries(shelfIds.map((id) => [id, [0, 0, 380] as Vec3])) },
diff --git a/src/lib/plan/families/blames.ts b/src/lib/plan/families/blames.ts
index 975382d..5769e2c 100644
--- a/src/lib/plan/families/blames.ts
+++ b/src/lib/plan/families/blames.ts
@@ -108,10 +108,11 @@ function recipe(s: ProductSpec): CustomParams | null {
// each side: a short screw into the footrest rung, long ones into the two seat rails and the top rail
const screwSide = (sx: number, long: boolean) => {
const sid = sx < 0 ? "SL" : "SR";
- const pts: Vec3[] = long ? [[sx * xin, railY, zF], [sx * xin, railY, zB], [sx * trX, H - 40, -100]] : [[sx * fr[0], 290, fr[2]]];
+ // each starts on the outside of the leg and runs through it into the rail
+ const pts: Vec3[] = long ? [[sx * (xin + 22), railY, zF], [sx * (xin + 22), railY, zB], [sx * (trX + 40), H - 40, -100]] : [[sx * fr[0], 290, fr[2]]];
const dir: Vec3 = [-sx, 0, 0];
return [
- at("nut", pts.map((p) => [p[0] - sx * 25, p[1], p[2]] as Vec3), [0, -1, 0], undefined, undefined, BARREL),
+ at("nut", pts.map((p) => [p[0] - sx * ((long ? 70 : 45) - 10), p[1], p[2]] as Vec3), [0, -1, 0], undefined, undefined, BARREL),
at("bolt", pts, dir, sid, undefined, long ? { len: 70, dia: 6 } : { len: 45, dia: 6 }),
];
};
@@ -153,7 +154,7 @@ function recipe(s: ProductSpec): CustomParams | null {
title: "Screw the two tray holders onto the front legs",
detail: "One on the outside of each front leg, at the top.",
fix: [-1, 1].flatMap((sx, i) => [
- at("clip", [holders[i]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { name: "Tray holder", len: 30, dia: 30 }),
+ at("clip", [[holders[i][0] + sx * 30, holders[i][1], holders[i][2]]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { name: "Tray holder", len: 30, dia: 30 }),
at("screw", [holders[i]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 20, dia: 4 }),
]),
tools: ["screwdriver"],
diff --git a/src/lib/plan/families/blankhallan.ts b/src/lib/plan/families/blankhallan.ts
index f580f59..60f6436 100644
--- a/src/lib/plan/families/blankhallan.ts
+++ b/src/lib/plan/families/blankhallan.ts
@@ -68,8 +68,8 @@ function recipe(s: ProductSpec): CustomParams | null {
detail: "The marked runners go left and right. Two screws each, pressing the runner flat against the panel.",
add: ["SL", "SR"],
fix: [-1, 1].flatMap((sx) => [
- at("runner", [[sx * xi, runY, 10]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 240, dia: 20 }),
- at("screw", [-80, 100].map((z) => [sx * xi, runY, z] as Vec3), [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 12, dia: 4 }),
+ at("runner", [[sx * xi, runY, 10]], [sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 240, dia: 20 }),
+ at("screw", [-80, 100].map((z) => [sx * (xi - 2), runY, z] as Vec3), [sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 12, dia: 4 }),
]),
from: { SL: [-400, 0, 0], SR: [400, 0, 0] },
tools: ["screwdriver"],
@@ -108,8 +108,8 @@ function recipe(s: ProductSpec): CustomParams | null {
},
{
title: "Turn it over and screw the box onto the frames",
- detail: "The box rests on the rails under it. Four countersunk bolts up through the rails into the bottom.",
- fix: [at("bolt", [-1, 1].flatMap((sx) => [-100, 100].map((z) => [sx * (X - 6), Y0, z] as Vec3)), [0, 1, 0], undefined, "BB", { len: 20, dia: 6 })],
+ detail: "The box rests on the rails under it. Four countersunk bolts up through the rails into the sides.",
+ fix: [-1, 1].map((sx) => at("bolt", [-100, 100].map((z) => [sx * (X - 6), Y0 - 12, z] as Vec3), [0, 1, 0], sx < 0 ? "FL" : "FR", sx < 0 ? "SL" : "SR", { len: 20, dia: 6 })),
tools: ["allen"],
pose: "+y",
},
@@ -151,8 +151,8 @@ function recipe(s: ProductSpec): CustomParams | null {
title: "Screw the drawer runners onto the drawer",
detail: "Two screws in each, by hand with the screwdriver, not a drill.",
fix: [-1, 1].flatMap((sx) => [
- at("runner", [[sx * dx, runY, 10]], [sx, 0, 0], sx < 0 ? "DL" : "DR", undefined, { len: 240, dia: 14 }),
- at("screw", [-80, 100].map((z) => [sx * dx, runY, z] as Vec3), [sx, 0, 0], sx < 0 ? "DL" : "DR", undefined, { len: 14, dia: 4 }),
+ at("runner", [[sx * dx, runY, 10]], [-sx, 0, 0], sx < 0 ? "DL" : "DR", undefined, { len: 240, dia: 14 }),
+ at("screw", [-80, 100].map((z) => [sx * (dx + 2), runY, z] as Vec3), [-sx, 0, 0], sx < 0 ? "DL" : "DR", undefined, { len: 14, dia: 4 }),
]),
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/blastasen.ts b/src/lib/plan/families/blastasen.ts
index 797f0f8..33abd97 100644
--- a/src/lib/plan/families/blastasen.ts
+++ b/src/lib/plan/families/blastasen.ts
@@ -36,7 +36,7 @@ function recipe(s: ProductSpec): CustomParams | null {
};
};
parts.push(side("FL", -1), side("FR", 1));
- const runY = rail0 + 14, rx = xi - 18;
+ const runY = rail0 + 14, rx = LX - 20; // the runners sit against the inside of the side rails
parts.push({ id: "RL", name: "Drawer runner", size: [20, 22, 2 * LZ - 40], pos: [-rx + 4, runY, 0], material: "wood" });
parts.push({ id: "RR", name: "Drawer runner", size: [20, 22, 2 * LZ - 40], pos: [rx - 4, runY, 0], material: "wood" });
parts.push({ id: "BK", name: "Back panel", size: [2 * xi, top0 - rail0, 18], pos: [0, (top0 + rail0) / 2, -LZ - 5], material: "wood" });
@@ -63,7 +63,7 @@ function recipe(s: ProductSpec): CustomParams | null {
title: "Screw the drawer runners onto both side frames",
detail: "Lay both frames on a rug, rails inside up. Three short screws in each runner.",
add: ["FL", "RL", "FR", "RR"],
- fix: [-1, 1].map((sx) => at("screw", [-90, 0, 90].map((z) => [sx * (rx - 4), runY, z] as Vec3), [-sx, 0, 0], sx < 0 ? "RL" : "RR", sid(sx), { len: 15, dia: 4 })),
+ fix: [-1, 1].map((sx) => at("screw", [-90, 0, 90].map((z) => [sx * (rx - 4), runY, z] as Vec3), [sx, 0, 0], sx < 0 ? "RL" : "RR", sid(sx), { len: 15, dia: 4 })),
tools: ["screwdriver"],
pose: "+x",
warnings: ["floor"],
@@ -81,10 +81,10 @@ function recipe(s: ProductSpec): CustomParams | null {
fix: [at("camScrew", legs.map((p) => [p[0], sh0 + 9, p[2] - Math.sign(p[2]) * (L / 2)] as Vec3), [0, 0, -1], undefined, "SH", { len: 12, dia: 6 })],
tools: ["screwdriver"],
},
- { title: "Tap dowels into the back panel", detail: "One in each end.", fix: [at("dowel", [-1, 1].map((sx) => [sx * xi, (top0 + rail0) / 2, -LZ - 5] as Vec3), [1, 0, 0], "BK")], wait: ["BK"], tools: ["hammer"] },
+ { title: "Tap dowels into the back panel", detail: "One in each end.", fix: [...[-1, 1].map((sx) => at("dowel", [[sx * xi, (top0 + rail0) / 2, -LZ - 5]], [-sx, 0, 0], "BK"))], wait: ["BK"], tools: ["hammer"] },
{ title: "Stand the back panel on the lower frame", detail: "Onto its dowel and cam bolts.", add: ["BK"] },
{ title: "Lock it with two cam locks", detail: "Arrow towards the bolt, then turn clockwise.", fix: [at("cam", lockSide(-1, "back"), [0, 0, -1], "BK", undefined, CAM)], tools: ["screwdriver"] },
- { title: "Tap dowels into the front rail", detail: "One in each end.", fix: [at("dowel", [-1, 1].map((sx) => [sx * xi, rail0 + 14, LZ + 5] as Vec3), [1, 0, 0], "FRL")], wait: ["FRL"], tools: ["hammer"] },
+ { title: "Tap dowels into the front rail", detail: "One in each end.", fix: [...[-1, 1].map((sx) => at("dowel", [[sx * xi, rail0 + 14, LZ + 5]], [-sx, 0, 0], "FRL"))], wait: ["FRL"], tools: ["hammer"] },
{ title: "Stand the front rail on the frame", detail: "The flat side faces the front.", add: ["FRL"] },
{ title: "Lock it with a cam lock", fix: [at("cam", lockSide(-1, "front"), [0, -1, 0], "FRL", undefined, CAM)], tools: ["screwdriver"] },
{
@@ -149,13 +149,13 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw on the knob",
detail: "The screw goes through the front from the inside.",
- fix: [{ kind: "knob", count: 1, at: [[0, (dy0 + dy1) / 2, dz1 + 18]], dir: [0, 0, -1], on: "DF" }, at("screw", [[0, (dy0 + dy1) / 2, dz1]], [0, 0, 1], "DF", undefined, { len: 30, dia: 4 })],
+ fix: [{ kind: "knob", count: 1, at: [[0, (dy0 + dy1) / 2, dz1 + 18]], dir: [0, 0, -1], on: "DF" }, at("screw", [[0, (dy0 + dy1) / 2, dz1 - 5]], [0, 0, 1], "DF", undefined, { len: 30, dia: 4 })],
tools: ["screwdriver"],
},
{
title: "Screw two stop screws into the drawer back",
detail: "Near the top of each end. They catch on the stops so the drawer can't fall out.",
- fix: [at("screw", [-1, 1].map((sx) => [sx * (dx - 30), dy1 - 12, dz0 + 7] as Vec3), [0, 0, 1], "DK", undefined, { len: 12, dia: 6 })],
+ fix: [at("screw", [-1, 1].map((sx) => [sx * (dx - 30), dy1 - 12, dz0] as Vec3), [0, 0, 1], "DK", undefined, { len: 12, dia: 6 })],
tools: ["screwdriver"],
},
{ title: "Slide the drawer in", detail: "Its grooves run on the wooden runners." },
diff --git a/src/lib/plan/families/boastad.ts b/src/lib/plan/families/boastad.ts
index 0e1979f..5ab3616 100644
--- a/src/lib/plan/families/boastad.ts
+++ b/src/lib/plan/families/boastad.ts
@@ -367,7 +367,7 @@ function low(L: Low): CustomParams {
detail: "One on the back edge of each side, near the top, with two screws.",
fix: [
fx("bracket", SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), [0, 0, 1], { len: 40, dia: 30 }),
- fx("screw", pairs(SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), 1, 24), [0, 0, 1], { len: 12, dia: 4 }),
+ fx("screw", pairs(SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), 1, 50), [0, 0, 1], { len: 12, dia: 4 }),
],
tools: ["screwdriver"],
wall: false,
@@ -624,7 +624,7 @@ function high(s: ProductSpec): CustomParams {
detail: "A bracket on the back edge of each side near the top, two screws each, and a spacer screwed into each bracket.",
fix: [
fx("bracket", SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), [0, 0, 1], { len: 40, dia: 30 }),
- fx("screw", pairs(SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), 1, 24), [0, 0, 1], { len: 12, dia: 4 }),
+ fx("screw", pairs(SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2]), 1, 50), [0, 0, 1], { len: 12, dia: 4 }),
fx("spacer", SIDES.map((g): Vec3 => [g * (W / 2 - ST / 2), H - 60, -D / 2 - 6]), [0, 0, 1], { name: "Wall spacer", len: 20, dia: 22 }),
],
tools: ["screwdriver"],
diff --git a/src/lib/plan/families/bollsidan.ts b/src/lib/plan/families/bollsidan.ts
index a6235bc..83ed9ce 100644
--- a/src/lib/plan/families/bollsidan.ts
+++ b/src/lib/plan/families/bollsidan.ts
@@ -18,8 +18,8 @@ function desk(s: ProductSpec): CustomParams {
const xl = W / 2 - 110; // leg centre
const sh = 30, ft = 30; // top supports, feet
const yS = yU - sh; // underside of the supports
- const rh = 50; // cross rail
- const yR = yS - rh / 2;
+ const rh = 50 + sh; // cross rail, its top flush with the supports so it screws to the desk top
+ const yR = yU - rh / 2;
const cw = 70, cd = 90;
const parts: CustomPart[] = [
box("R1", "Cross rail", [2 * xl - cw, rh, 15], [0, yR, -35]),
@@ -38,7 +38,7 @@ function desk(s: ProductSpec): CustomParams {
];
const ends = [-1, 1];
const legBolts = (sx: number) =>
- fx("bolt", [-1, 1].flatMap((k) => [[sx * (xl - cw / 2 - 1), yR, k * 35], [sx * (xl - cw / 2 - 1), yR + 15, k * 35]] as Vec3[]), [sx, 0, 0], {
+ fx("bolt", [-1, 1].flatMap((k) => [[sx * (xl - cw / 2 - 1), yS - 40, k * 35], [sx * (xl - cw / 2 - 1), yS - 20, k * 35]] as Vec3[]), [sx, 0, 0], {
len: 12, dia: 6, on: sx < 0 ? "L1" : "L2", to: ["R1", "R2"],
});
const quad = (x: number, y: number, z: number, dx = 15): Vec3[] => [[x - dx, y, -z], [x + dx, y, -z], [x - dx, y, z], [x + dx, y, z]];
@@ -47,7 +47,7 @@ function desk(s: ProductSpec): CustomParams {
title: "Join the two halves of the cross rail",
detail: "Lay them on a rug the way round shown, with the cut-outs facing the same way. Two small screws hold them together.",
add: ["R1", "R2"],
- fix: [fx("screw", [[0, yS, -35], [0, yS, 35]], [0, 1, 0], { len: 10, dia: 4, on: "R1", to: ["R1", "R2"] })],
+ fix: [fx("screw", [[0, yU - rh, -35], [0, yU - rh, 35]], [0, 1, 0], { len: 10, dia: 4, on: "R1", to: ["R1", "R2"] })],
tools: ["screwdriver"],
pose: "-y",
warnings: ["floor"],
@@ -89,7 +89,7 @@ function desk(s: ProductSpec): CustomParams {
{
title: "Screw the cross rail to the top",
detail: "Four screws through the rail.",
- fix: [fx("screw", [[-xl / 2, yS, -35], [xl / 2, yS, -35], [-xl / 2, yS, 35], [xl / 2, yS, 35]], [0, 1, 0], { len: 16, dia: 4, to: ["R1", "R2"] })],
+ fix: [fx("screw", [[-xl / 2, yU - 6, -35], [xl / 2, yU - 6, -35], [-xl / 2, yU - 6, 35], [xl / 2, yU - 6, 35]], [0, 1, 0], { len: 16, dia: 4, to: ["R1", "R2"], mate: "T" })],
tools: ["screwdriver"],
},
{
@@ -177,7 +177,7 @@ function laptopStand(s: ProductSpec): CustomParams {
title: "Bolt the foot frame onto the column",
detail: "Four bolts through the frame into the end of the column.",
add: ["F"],
- fix: [fx("bolt", [[xc - 20, 0, -20], [xc + 20, 0, -20], [xc - 20, 0, 20], [xc + 20, 0, 20]], [0, 1, 0], { len: 16, dia: 6, on: "F", mate: "C" })],
+ fix: [fx("bolt", [[xc - 20, ft - 6, -20], [xc + 20, ft - 6, -20], [xc - 20, ft - 6, 20], [xc + 20, ft - 6, 20]], [0, 1, 0], { len: 16, dia: 6, on: "F", mate: "C" })],
tools: ["allen"],
},
{ title: "Stand it up", detail: "Lift the lever under the top and push down or let it rise to set the height. Don't sit or lean on it.", pose: "+y" },
diff --git a/src/lib/plan/families/bolmen.ts b/src/lib/plan/families/bolmen.ts
new file mode 100644
index 0000000..3231621
--- /dev/null
+++ b/src/lib/plan/families/bolmen.ts
@@ -0,0 +1,33 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec } from "../../types";
+
+/*
+ * BOLMEN step stool. IKEA sells it moulded in one piece with no assembly manual (the page lists none), so the guide
+ * only unpacks it and stands it up. IKEA's sizes: 44 wide, 35 deep, 25 high to the step.
+ */
+
+function recipe(s: ProductSpec): CustomParams {
+ const W = 440, D = 350, H = 250, T = 20;
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [W, T, D], pos: [0, H - T / 2, 0], material: "board" },
+ // the two splayed sides it stands on, open in the middle
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [T, H - T, D - 30], pos: [g * (W / 2 - 40), (H - T) / 2, 0], material: "board" })),
+ // the grip ribs moulded into the step
+ ...[-2, -1, 0, 1, 2].map((k): PartPiece => ({ shape: "box", size: [W - 80, 2, 14], pos: [0, H + 1, k * 50], material: "soft" })),
+ ];
+ return {
+ parts: [{ id: "S", name: "Step stool", size: [W, H + 2, D], pos: [0, (H + 2) / 2, 0], material: "board", pieces }],
+ steps: [
+ { title: "Take the stool out of its wrapping", detail: "It comes moulded in one piece, so there is nothing to put together. Peel off any labels.", add: ["S"], from: { S: [0, 200, 0] } },
+ { title: "Stand it on a flat, dry floor", detail: "Check it stands steady before you step on it. It takes up to 100 kg." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["BOLMEN"],
+ recipe(s) {
+ return /^bolmen-step-stool/.test(s.slug ?? "") ? recipe(s) : null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/bondholmen.ts b/src/lib/plan/families/bondholmen.ts
index deae37e..4350418 100644
--- a/src/lib/plan/families/bondholmen.ts
+++ b/src/lib/plan/families/bondholmen.ts
@@ -345,7 +345,7 @@ function bench(s: ProductSpec): CustomParams {
const ya = armY - 15;
return [
at("bolt", [[sx * (xi + xo) / 2, armY, (zf0 + zf1) / 2]], [0, -1, 0], a, undefined, { len: 60, dia: 6 }),
- at("bolt", [-10, 10].map((dx) => [sx * (xi + xo) / 2 + dx, ya, zAt(ya) - 22] as Vec3), [0, 0, 1], f, undefined, { len: 60, dia: 6 }),
+ at("bolt", [-12, 12].map((dx) => [sx * (xi + xo) / 2 + dx, ya, zAt(ya) - 22] as Vec3), [0, 0, 1], f, undefined, { len: 60, dia: 6 }),
];
};
const yb1 = lean.p(0, v1 + 22, 0)[1], yb2 = lean.p(0, v2 - 25, 0)[1];
@@ -431,15 +431,16 @@ function roundTable(s: ProductSpec): CustomParams {
};
const parts: CustomPart[] = [...qs.map(leg), half(-1), half(1)];
// all sixteen drawn in the first frame: its inner end meets the opposite frame, its sides the two crossing ones
- const ys = [aTop + 18, yT - 18, 18, fTop - 18];
+ // spaced so no two fittings share a hole: the dowels near the band edges, the cross bolts between them
+ const ys = [aTop + 12, yT - 12, 12, fTop - 12];
const dowels: CustomFix[] = [
- at("dowel", ys.flatMap((y) => [-8, 8].map((z) => [0, y, z] as Vec3)), [-1, 0, 0], "Q1", undefined, DOWEL),
- ...([-1, 1] as const).map((sz) => at("dowel", ys.map((y) => [8, y, sz * t] as Vec3), [0, 0, sz], "Q1", undefined, DOWEL)),
+ at("dowel", ys.flatMap((y) => [-12, 12].map((z) => [0, y, z] as Vec3)), [-1, 0, 0], "Q1", undefined, DOWEL),
+ ...([-1, 1] as const).map((sz) => at("dowel", ys.map((y) => [30, y, sz * t] as Vec3), [0, 0, sz], "Q1", undefined, DOWEL)),
];
const cross = (y: number, ny: number, nut: typeof BARREL, ndir: Vec3) =>
([-1, 1] as const).flatMap((sz) => [
at("nut", [-10, 10].map((x) => [x, ny, sz * 50] as Vec3), ndir, sz > 0 ? "Q2" : "Q4", undefined, nut),
- ...([-1, 1] as const).map((sx) => at("bolt", [[sx * 10, y, -sz * t]], [0, 0, sz], sx > 0 ? "Q1" : "Q3", undefined, BOLT)),
+ ...([-1, 1] as const).map((sx) => at("bolt", [[sx * 12, y, -sz * t]], [0, 0, sz], sx > 0 ? "Q1" : "Q3", undefined, BOLT)),
]);
const steps: CustomStep[] = [
{ title: "Tap the dowels into the leg frames", detail: "Four into the inner end of each of the four frames, sixteen in all.", add: ["Q1"], fix: dowels, tools: ["hammer"], warnings: ["floor"] },
diff --git a/src/lib/plan/families/borgeby.ts b/src/lib/plan/families/borgeby.ts
index 9288080..822a3a1 100644
--- a/src/lib/plan/families/borgeby.ts
+++ b/src/lib/plan/families/borgeby.ts
@@ -5,18 +5,18 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3
* BORGEBY, read from the side table's manual. The round top lies upside down on a rug and the four bent legs are
* screwed to it, two screws each. Laid on its side, the storage bowl slides in between the legs and is screwed
* through the two lower legs, then rolled over for the other two. Every screw is tightened last. The coffee table
- * has no manual to follow here and keeps its old guide.
+ * is sold assembled (its page has care advice but no assembly instructions), so its guide only unpacks it.
*/
const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
-function sideTable(s: ProductSpec): CustomParams {
+/** The top, the four bent legs and the storage bowl between them, as they stand finished. */
+function tableParts(s: ProductSpec, bh: number) {
const W = s.size.w * 10, H = s.size.h * 10;
const tt = 20; // top
- const lw = 60, lt = 16; // leg strip: width, thickness
+ const lw = Math.round(Math.max(80, W * 0.13)), lt = 16; // leg strip: width, thickness (wide bent ply, as photographed)
const ret = 90; // the leg's return under the top
const free = 60; // under the bowl
- const bh = 140; // bowl
const r = W / 2 - 40; // leg centre line from the middle
const yU = H - tt;
const bowlR = r - lt / 2;
@@ -46,6 +46,11 @@ function sideTable(s: ProductSpec): CustomParams {
});
});
parts.push({ id: "B", name: "Storage bowl", shape: "cyl", size: [2 * bowlR, bh, 2 * bowlR], pos: [0, free + bh / 2, 0], material: "wood" });
+ return { parts, axes, r, yU, ret, lt, free, bh };
+}
+
+function sideTable(s: ProductSpec): CustomParams {
+ const { parts, axes, r, yU, ret, lt, free, bh } = tableParts(s, 140);
const topScrews: Vec3[] = axes.flatMap(([ax, , az]) => {
const rr = r - ret / 2 + 10;
@@ -89,11 +94,31 @@ function sideTable(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/** The coffee table: IKEA's page has no assembly instructions, only care advice, so it comes put together. */
+function coffeeTable(s: ProductSpec): CustomParams {
+ const { parts } = tableParts(s, 160);
+ const ids = parts.map((p) => p.id);
+ return {
+ parts,
+ steps: [
+ {
+ title: "Lift the table out of its box",
+ detail: "It comes assembled. Take off all the packaging and lift it by the top, not by the bowl.",
+ add: ids,
+ from: Object.fromEntries(ids.map((id) => [id, [0, 400, 0] as Vec3])),
+ },
+ { title: "Check it over", detail: "Look over the top, the legs and the bowl for any damage from the journey before you use it." },
+ { title: "Set it down where it will stand", detail: "On a flat floor, so all four legs touch. Wipe it with a damp cloth, then a dry one." },
+ ],
+ };
+}
+
const family: Family = {
names: ["BORGEBY"],
recipe(s) {
if (/side table/i.test(s.variant) || /side-table/.test(s.slug ?? "")) return sideTable(s);
- return null; // coffee table: no manual
+ if (/coffee/i.test(s.variant) || /coffee-table/.test(s.slug ?? "")) return coffeeTable(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/brannboll.ts b/src/lib/plan/families/brannboll.ts
index 07c6e60..c1bbc76 100644
--- a/src/lib/plan/families/brannboll.ts
+++ b/src/lib/plan/families/brannboll.ts
@@ -64,7 +64,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Lock the legs with grub screws",
detail: "One in the inside of each leg, just below the rim. Turn them in with the small Allen key until they stop.",
- fix: [-1, 1].map((sz) => fx("screw", [-1, 1].map((sx): Vec3 => [sx * lx, stubLo + 15, sz * (lz - r)]), { name: "Grub screw", dir: [0, 0, -sz], len: 8, dia: 6 })),
+ fix: [-1, 1].map((sz) => fx("screw", [-1, 1].map((sx): Vec3 => [sx * lx, stubLo - 12, sz * (lz - r)]), { name: "Grub screw", dir: [0, 0, sz], len: 8, dia: 6 })),
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/brimnes.ts b/src/lib/plan/families/brimnes.ts
index 08b0177..430e0d8 100644
--- a/src/lib/plan/families/brimnes.ts
+++ b/src/lib/plan/families/brimnes.ts
@@ -538,7 +538,7 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
k.step({
title: "Screw the cam bolts into the left side",
detail: "By hand until they stop: two for the bottom, one for each plinth. The right side takes six.",
- fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.5], 0.3), bolts(L, pb, [0.5], 0.3)],
+ fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.25], 0.3), bolts(L, pb, [0.25], 0.3)],
tools: ["screwdriver"],
});
k.step({ title: "Push the bottom onto the left side", detail: "Lay the side on its back edge on the rug. Dowels in, then press the bottom onto them, cam lock holes up.", add: ["bot"], fix: [dowels(L, bot, [0.12, 0.5, 0.88])], tools: ["hammer"], pose: "+z", warnings: ["floor"] });
@@ -547,10 +547,10 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
k.step({ title: "Fit the cam fittings for the shelf joint", detail: "Press two cam locks into the shelf, screw the two long pins and two cam bolts into the top of the divider.", fix: [cams(div, shelf, [0.2, 0.8], 1), at("camScrew", div, along(div, shelf, [0.2, 0.8]), [0, -1, 0], LONG_PIN), bolts(div, shelf, [0.4, 0.6])], tools: ["screwdriver"] });
k.step({ title: "Join the shelf to the divider", detail: "Push the shelf onto the pins and bolts, then turn all four cam locks until it pulls tight.", add: ["div", "shelf"], fix: [cams(div, shelf, [0.4, 0.6], 1), cams(shelf, div, [0.2, 0.8], 1)], tools: ["screwdriver"] });
k.step({ title: "Screw the divider to the bottom", detail: "Two long connector screws up through the bottom into the divider, with the Allen key.", fix: [screws(bot, div, [0.25, 0.75], LONG_SCREW, 0.5, "screw")], tools: ["allen"] });
- k.step({ title: "Tap the dowels into the plinths and push them on", detail: "One in each end. Both plinths go under the bottom, one at the front and one at the back.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.5], 0.7), dowels(pb, L, [0.5], 0.7), dowels(pf, R, [0.5], 0.7), dowels(pb, R, [0.5], 0.7)], tools: ["hammer"] });
- k.step({ title: "Prepare the right side", detail: "Three hinge plates and six cam bolts, as on the left, plus two for the fixed shelf.", add: ["R"], fix: [...plateFixes([ds[1]]), bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.5], 0.3), bolts(R, pb, [0.5], 0.3), bolts(R, shelf, [0.3, 0.7])], tools: ["screwdriver"] });
+ k.step({ title: "Tap the dowels into the plinths and push them on", detail: "One in each end. Both plinths go under the bottom, one at the front and one at the back.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.8], 0.7), dowels(pb, L, [0.8], 0.7), dowels(pf, R, [0.8], 0.7), dowels(pb, R, [0.8], 0.7)], tools: ["hammer"] });
+ k.step({ title: "Prepare the right side", detail: "Three hinge plates and six cam bolts, as on the left, plus two for the fixed shelf.", add: ["R"], fix: [...plateFixes([ds[1]]), bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.25], 0.3), bolts(R, pb, [0.25], 0.3), bolts(R, shelf, [0.3, 0.7])], tools: ["screwdriver"] });
k.step({ title: "Lay the right side on together", detail: "Tap its dowels into the bottom and the shelf first, then lower it so every bolt finds its hole.", fix: [dowels(bot, R, [0.12, 0.5, 0.88]), dowels(shelf, R, [0.9])], people: 2, tools: ["hammer"] });
- k.step({ title: "Lock the cam locks", detail: "Eight of them: in the bottom, the plinths and the fixed shelf.", fix: [cams(R, bot, [0.25, 0.75], 1), cams(L, pf, [0.5], -1, 0.3), cams(L, pb, [0.5], 1, 0.3), cams(R, pf, [0.5], -1, 0.3), cams(R, pb, [0.5], 1, 0.3), cams(R, shelf, [0.3, 0.7], 1)], tools: ["screwdriver"] });
+ k.step({ title: "Lock the cam locks", detail: "Eight of them: in the bottom, the plinths and the fixed shelf.", fix: [cams(R, bot, [0.25, 0.75], 1), cams(L, pf, [0.25], -1, 0.3), cams(L, pb, [0.25], 1, 0.3), cams(R, pf, [0.25], -1, 0.3), cams(R, pb, [0.25], 1, 0.3), cams(R, shelf, [0.3, 0.7], 1)], tools: ["screwdriver"] });
k.step({ title: "Prepare the top", detail: "Tap the two door stops into its underside at the front, then screw in its four cam bolts.", fix: [at("clip", top, [-W / 4, W / 4].map((x): Vec3 => [x, H - T, D / 2 - 20]), [0, 1, 0], { len: 12, dia: 10 }), bolts(top, L, [0.25, 0.75]), bolts(top, R, [0.25, 0.75])], tools: ["hammer", "screwdriver"] });
k.step({ title: "Push the top on", detail: "Dowels into the sides, then press the top onto them and lock its four cam locks.", add: ["top"], fix: [dowels(L, top, [0.12, 0.5, 0.88]), dowels(R, top, [0.12, 0.5, 0.88]), cams(L, top, [0.25, 0.75], 1, 0.5), cams(R, top, [0.25, 0.75], -1, 0.5)], tools: ["hammer", "screwdriver"] });
k.step({ title: "Turn it over onto its front together", detail: "Check it is square: both diagonals the same.", pose: "-z", people: 2, check: "square" });
@@ -596,15 +596,15 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
title: "Prepare the left side",
detail: "On a rug, inside up: four cam bolts, then three hinge plates with two screws each. The right side gets the same.",
add: ["L"],
- fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.5], 0.3), bolts(L, pb, [0.5], 0.3), ...plateFixes([ds[0]])],
+ fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.25], 0.3), bolts(L, pb, [0.5], 0.3), ...plateFixes([ds[0]])],
tools: ["screwdriver"],
warnings: ["floor"],
});
k.step({ title: "Push the left side onto the bottom", detail: "Lay it on its back edge on the rug, tap the dowels in, and press the bottom and divider onto it.", add: ["L"], fix: [dowels(L, bot, [0.12, 0.5, 0.88]), dowels(R, bot, [0.15, 0.85]), dowels(bot, div, [0.88], 0.5)], tools: ["hammer"], pose: "+z", warnings: ["floor"] });
k.step({ title: "Lock the cam locks", detail: "Arrow towards the bolt, then turn clockwise.", fix: [cams(L, bot, [0.25, 0.75], 1)], tools: ["screwdriver"] });
- k.step({ title: "Tap the dowels into the plinths and push them on", detail: "Three in each: one in each end and one into the bottom.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.5], 0.7), dowels(pb, L, [0.5], 0.7), dowels(pf, R, [0.5], 0.7), dowels(pb, R, [0.5], 0.7), dowels(pf, bot, [0.5]), dowels(pb, bot, [0.5])], tools: ["hammer"] });
- k.step({ title: "Lay the right side on together", detail: "Its four cam bolts and three hinge plates go on first. Lower it so every dowel and bolt finds its hole.", add: ["R"], fix: [bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.5], 0.3), bolts(R, pb, [0.5], 0.3), ...plateFixes([ds[2]])], people: 2, tools: ["screwdriver"] });
- k.step({ title: "Lock the cam locks", detail: "In the bottom and both plinths, on both sides.", fix: [cams(R, bot, [0.25, 0.75], 1), cams(L, pf, [0.5], -1, 0.3), cams(L, pb, [0.5], 1, 0.3), cams(R, pf, [0.5], -1, 0.3), cams(R, pb, [0.5], 1, 0.3)], tools: ["screwdriver"] });
+ k.step({ title: "Tap the dowels into the plinths and push them on", detail: "Six in all: two in each end of the back plinth, one in each end of the front one. Slide them in from the open side.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.8], 0.7), dowels(pb, L, [0.12, 0.88], 0.7), dowels(pf, R, [0.8], 0.7), dowels(pb, R, [0.12, 0.88], 0.7)], tools: ["hammer"] });
+ k.step({ title: "Lay the right side on together", detail: "Its four cam bolts and three hinge plates go on first. Lower it so every dowel and bolt finds its hole.", add: ["R"], fix: [bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.25], 0.3), bolts(R, pb, [0.5], 0.3), ...plateFixes([ds[2]])], people: 2, tools: ["screwdriver"] });
+ k.step({ title: "Lock the cam locks", detail: "In the bottom and both plinths, on both sides.", fix: [cams(R, bot, [0.25, 0.75], 1), cams(L, pf, [0.25], -1, 0.3), cams(L, pb, [0.5], 1, 0.3), cams(R, pf, [0.25], -1, 0.3), cams(R, pb, [0.5], 1, 0.3)], tools: ["screwdriver"] });
k.step({ title: "Screw the angle brackets behind the front plinth", detail: "Three small brackets join it to the bottom, one screw each.", fix: [at("angle", pf, angles.map((x): Vec3 => [x, P - 10, pf.pos[2] - T / 2]), [0, 0, 1], { len: 30, dia: 24 }), at("screw", pf, angles.map((x): Vec3 => [x, P - 20, pf.pos[2] - T / 2 - 2]), [0, 0, 1], HINGE_SCREW)], tools: ["screwdriver"] });
k.step({ title: "Prepare the top", detail: "Four cam bolts in it, then tap the three door stops into its underside at the front.", fix: [bolts(top, L, [0.25, 0.75]), bolts(top, R, [0.25, 0.75]), at("clip", top, [-W / 3, 0, W / 3].map((x): Vec3 => [x, H - T, D / 2 - 20]), [0, 1, 0], { len: 12, dia: 10 })], tools: ["screwdriver", "hammer"] });
k.step({ title: "Push the top on", detail: "Six dowels into the sides and the divider, then press it down.", add: ["top"], fix: [dowels(L, top, [0.15, 0.85]), dowels(R, top, [0.15, 0.85]), dowels(div, top, [0.15, 0.85])], tools: ["hammer"] });
@@ -774,18 +774,18 @@ function tvBench(b: PlanBuilder, s: ProductSpec, n: 2 | 3) {
const ds = range(n).flatMap((i) => stackDrawers({ x0: walls[i].pos[0] + T / 2, x1: walls[i + 1].pos[0] - T / 2, y0: P + 2, y1: yS - 2, n: 1, zf: D / 2, dd, glassTop: true, handle: 200 }));
const runLen = Math.round((dd - 20) / 10) * 10;
const ry = ds[0].y0 + 4;
- const runs = [...cabinetRunners(L, 1, [ry], D / 2, runLen), ...low.flatMap((d) => [...cabinetRunners(d, -1, [ry], D / 2, runLen), ...cabinetRunners(d, 1, [ry], D / 2, runLen)])];
+ const runs = low.flatMap((d) => [...cabinetRunners(d, -1, [ry], D / 2, runLen), ...cabinetRunners(d, 1, [ry], D / 2, runLen)]);
const shelfDw = n === 3 ? [0.15, 0.5, 0.85] : [0.25, 0.75];
const nails = n === 3 ? 36 : 29;
- k.step({ title: "Screw the runners onto the left side and the lower dividers", detail: "Lay them on a rug, inside up. Two screws for each runner, wheel at the front. The dividers take one on each face, the right side one.", add: ["L", ...low.map((p) => p.id)], fix: runs, tools: ["screwdriver"], warnings: ["floor"] });
- k.step({ title: "Screw the cam bolts into the sides", detail: "Four in each: two for the middle shelf and one for each plinth. The right side waits on the rug.", fix: [bolts(L, shelf, [0.25, 0.75]), bolts(L, pf, [0.5], 0.4), bolts(L, pb, [0.5], 0.4)], tools: ["screwdriver"] });
- k.step({ title: n > 2 ? "Screw the upper dividers onto the middle shelf" : "Screw the upper divider onto the middle shelf", detail: "Lay the shelf on the rug. Dowels into the divider, then two long connector screws through the shelf into it, with the Allen key.", add: ["shelf", ...up.map((p) => p.id)], fix: [...up.map((u) => dowels(u, shelf, [0.2, 0.8])), ...up.map((u) => screws(shelf, u, [0.35, 0.65], LONG_SCREW))], tools: ["hammer", "allen"], pose: "-y", warnings: ["floor"] });
+ k.step({ title: n > 2 ? "Screw the runners onto the lower dividers" : "Screw the runners onto the lower divider", detail: "Lay them on a rug. One runner on each face, two screws each, wheel at the front.", add: low.map((p) => p.id), fix: runs, tools: ["screwdriver"], warnings: ["floor"] });
+ k.step({ title: "Prepare the left side", detail: "Inside up on the rug: its runner, then four cam bolts, two for the middle shelf and one for each plinth. The right side waits too.", fix: [bolts(L, shelf, [0.25, 0.75]), bolts(L, pf, [0.25], 0.4), bolts(L, pb, [0.25], 0.4), ...cabinetRunners(L, 1, [ry], D / 2, runLen)], wait: ["L"], tools: ["screwdriver"] });
+ k.step({ title: n > 2 ? "Screw the upper dividers onto the middle shelf" : "Screw the upper divider onto the middle shelf", detail: "Lay the shelf on the rug. Dowels into the divider, then two long connector screws through the shelf into it, with the Allen key.", add: ["shelf", ...up.map((p) => p.id)], fix: [...up.map((u) => dowels(u, shelf, [0.2, 0.8])), ...up.map((u) => screws(shelf, u, [0.35, 0.65], LONG_SCREW))], tools: ["hammer", "allen"], pose: "-y", warnings: ["floor"], from: { shelf: [0, -300, 0] } });
k.step({ title: n > 2 ? "Stand the lower dividers on the shelf" : "Stand the lower divider on the shelf", detail: "Two dowels and two cam bolts in the end of each, then push it onto the shelf and turn the cam locks.", fix: [...low.map((d) => dowels(d, shelf, [0.2, 0.8])), ...low.map((d) => bolts(d, shelf, [0.35, 0.65])), ...low.map((d) => cams(d, shelf, [0.35, 0.65], 1))], tools: ["hammer", "screwdriver"] });
- k.step({ title: "Fit the left side", detail: "Dowels into the shelf end, then push the side on and lock its two cam locks.", fix: [dowels(shelf, L, shelfDw), cams(L, shelf, [0.25, 0.75], 1)], tools: ["hammer", "screwdriver"] });
- k.step({ title: "Push in the plinths", detail: "A dowel in each end. One goes at the front, one at the back, under the dividers.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.5], 0.6), dowels(pb, L, [0.5], 0.6), dowels(pf, R, [0.5], 0.6), dowels(pb, R, [0.5], 0.6)], tools: ["hammer"] });
- k.step({ title: "Lock the plinth cam locks", detail: "One at the left end of each plinth.", fix: [cams(L, pf, [0.5], -1, 0.4), cams(L, pb, [0.5], 1, 0.4)], tools: ["screwdriver"] });
- k.step({ title: "Fit the right side", detail: "Its runner and four cam bolts first, then dowels into the shelf end, push it on and lock four cam locks.", add: ["R"], fix: [...cabinetRunners(R, -1, [ry], D / 2, runLen), bolts(R, shelf, [0.25, 0.75]), bolts(R, pf, [0.5], 0.4), bolts(R, pb, [0.5], 0.4), dowels(shelf, R, shelfDw), cams(R, shelf, [0.25, 0.75], 1), cams(R, pf, [0.5], -1, 0.4), cams(R, pb, [0.5], 1, 0.4)], tools: ["hammer", "screwdriver"] });
+ k.step({ title: "Fit the left side", detail: "Dowels into the shelf end, then push the side on and lock its two cam locks.", add: ["L"], fix: [dowels(shelf, L, shelfDw), cams(L, shelf, [0.25, 0.75], 1)], tools: ["hammer", "screwdriver"] });
+ k.step({ title: "Push in the plinths", detail: "A dowel in each end. One goes at the front, one at the back, under the dividers.", add: ["pf", "pb"], fix: [dowels(pf, L, [0.8], 0.6), dowels(pb, L, [0.8], 0.6), dowels(pf, R, [0.8], 0.6), dowels(pb, R, [0.8], 0.6)], tools: ["hammer"] });
+ k.step({ title: "Lock the plinth cam locks", detail: "One at the left end of each plinth.", fix: [cams(L, pf, [0.25], -1, 0.4), cams(L, pb, [0.25], 1, 0.4)], tools: ["screwdriver"] });
+ k.step({ title: "Fit the right side", detail: "Its runner and four cam bolts first, then dowels into the shelf end, push it on and lock four cam locks.", add: ["R"], fix: [...cabinetRunners(R, -1, [ry], D / 2, runLen), bolts(R, shelf, [0.25, 0.75]), bolts(R, pf, [0.25], 0.4), bolts(R, pb, [0.25], 0.4), dowels(shelf, R, shelfDw), cams(R, shelf, [0.25, 0.75], 1), cams(R, pf, [0.25], -1, 0.4), cams(R, pb, [0.25], 1, 0.4)], tools: ["hammer", "screwdriver"] });
k.step({ title: "Tap in the feet", detail: "Two plastic feet into the bottom edge of each side and each lower divider.", fix: feet([L, R, ...low], 2, D - 60), tools: ["hammer"] });
k.step({ title: "Tap the dowels into the tops of the sides", detail: `Two in each side and each upper divider.`, fix: [dowels(L, top, [0.25, 0.75]), dowels(R, top, [0.25, 0.75]), ...up.map((u) => dowels(u, top, [0.25, 0.75]))], tools: ["hammer"], pose: "+y" });
k.step({ title: "Prepare the top", detail: `Upside down on the rug: ${2 * (n + 1)} cam bolts, then the two wall brackets at the back, one screw and washer each.`, fix: [bolts(top, L, [0.1, 0.9]), bolts(top, R, [0.1, 0.9]), ...up.map((u) => bolts(top, u, [0.1, 0.9])), ...bracketFixes(top, [-W / 2 + 150, W / 2 - 150], -D / 2)], tools: ["screwdriver"] });
@@ -817,12 +817,12 @@ function bookcase(b: PlanBuilder, s: ProductSpec) {
const ds = stackDrawers({ x0: -xi, x1: xi, y0: P + 2, y1: yF - 2, n: 2, zf: D / 2, dd, handle: 200 });
const runLen = 260;
const ry = ds.map((d) => d.y0 + 4);
- k.step({ title: "Screw the cam bolts into the left side", detail: "Lay it on a rug, inside up. Two for the fixed shelf and one for each plinth.", add: ["L"], fix: [bolts(L, fixed, [0.25, 0.75]), bolts(L, pf, [0.5], 0.4), bolts(L, pb, [0.5], 0.4)], tools: ["screwdriver"], pose: "+z", warnings: ["floor"] });
+ k.step({ title: "Screw the cam bolts into the left side", detail: "Lay it on a rug, inside up. Two for the fixed shelf and one for each plinth.", add: ["L"], fix: [bolts(L, fixed, [0.25, 0.75]), bolts(L, pf, [0.25], 0.4), bolts(L, pb, [0.25], 0.4)], tools: ["screwdriver"], pose: "+z", warnings: ["floor"] });
k.step({ title: "Screw the runners onto the left side", detail: "Two runners at the bottom, two screws each, wheel at the front.", fix: cabinetRunners(L, 1, ry, D / 2, runLen), tools: ["screwdriver"] });
- k.step({ title: "Push the fixed shelf and the plinths onto the left side", detail: "Dowels into the side first: two for the shelf and one for each plinth.", add: ["fixed", "pf", "pb"], fix: [dowels(L, fixed, [0.2, 0.8]), dowels(L, pf, [0.5], 0.7), dowels(L, pb, [0.5], 0.7)], tools: ["hammer"] });
- k.step({ title: "Lock the cam locks", detail: "Four of them, arrow towards the bolt.", fix: [cams(L, fixed, [0.25, 0.75], 1), cams(L, pf, [0.5], -1, 0.4), cams(L, pb, [0.5], 1, 0.4)], tools: ["screwdriver"] });
- k.step({ title: "Put the right side on", detail: "Its cam bolts, runners and dowels go in first, like the left. Then press it on.", add: ["R"], fix: [bolts(R, fixed, [0.25, 0.75]), bolts(R, pf, [0.5], 0.4), bolts(R, pb, [0.5], 0.4), ...cabinetRunners(R, -1, ry, D / 2, runLen), dowels(R, fixed, [0.2, 0.8]), dowels(R, pf, [0.5], 0.7), dowels(R, pb, [0.5], 0.7)], tools: ["screwdriver", "hammer"] });
- k.step({ title: "Lock the cam locks", detail: "Four more on the right.", fix: [cams(R, fixed, [0.25, 0.75], 1), cams(R, pf, [0.5], -1, 0.4), cams(R, pb, [0.5], 1, 0.4)], tools: ["screwdriver"] });
+ k.step({ title: "Push the fixed shelf and the plinths onto the left side", detail: "Dowels into the side first: two for the shelf and one for each plinth.", add: ["fixed", "pf", "pb"], fix: [dowels(L, fixed, [0.2, 0.8]), dowels(L, pf, [0.8], 0.7), dowels(L, pb, [0.8], 0.7)], tools: ["hammer"] });
+ k.step({ title: "Lock the cam locks", detail: "Four of them, arrow towards the bolt.", fix: [cams(L, fixed, [0.25, 0.75], 1), cams(L, pf, [0.25], -1, 0.4), cams(L, pb, [0.25], 1, 0.4)], tools: ["screwdriver"] });
+ k.step({ title: "Put the right side on", detail: "Its cam bolts, runners and dowels go in first, like the left. Then press it on.", add: ["R"], fix: [bolts(R, fixed, [0.25, 0.75]), bolts(R, pf, [0.25], 0.4), bolts(R, pb, [0.25], 0.4), ...cabinetRunners(R, -1, ry, D / 2, runLen), dowels(R, fixed, [0.2, 0.8]), dowels(R, pf, [0.8], 0.7), dowels(R, pb, [0.8], 0.7)], tools: ["screwdriver", "hammer"] });
+ k.step({ title: "Lock the cam locks", detail: "Four more on the right.", fix: [cams(R, fixed, [0.25, 0.75], 1), cams(R, pf, [0.25], -1, 0.4), cams(R, pb, [0.25], 1, 0.4)], tools: ["screwdriver"] });
k.step({ title: "Tap in the feet", detail: "Two plastic feet into the bottom edge of each side.", fix: feet([L, R], 2, D), tools: ["hammer"] });
k.step({ title: "Fit the top", detail: "Four dowels into its ends, push it between the sides, then two long connector screws through each side into it.", add: ["top"], fix: [dowels(top, L, [0.2, 0.8]), dowels(top, R, [0.2, 0.8]), screws(L, top, [0.4, 0.6], LONG_SCREW), screws(R, top, [0.4, 0.6], LONG_SCREW)], tools: ["hammer", "allen"] });
k.step({ title: "Turn it over and nail on the back", detail: "Lay it on its front, square it up and nail round the edges and into the fixed shelf.", add: [back[0].id], fix: [{ kind: "nail", count: 31, to: [back[0].id], ...BACK_NAIL }], tools: ["hammer"], pose: "-z", check: "square" });
@@ -860,11 +860,11 @@ function cabinet(b: PlanBuilder, s: ProductSpec) {
at("screw", side, [-1, 1].map((e): Vec3 => [side.pos[0] - g * (T / 2), H - 120 + e * 20, -D / 2 + 30]), [g, 0, 0], { len: 12, dia: 3 }),
];
k.step({ title: "Screw the wall fittings and hinge plates onto the left side", detail: "Lay it on a rug, inside up. The keyhole plate goes at the top of the back edge, the two hinge plates near the front.", add: ["L"], fix: [...hang(L, -1), ...plateFixes([ds[0]])], tools: ["screwdriver"], pose: "+z", warnings: ["floor"] });
- k.step({ title: "Screw the cam bolts into the left side", detail: "Two for the bottom and one for the plinth.", fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.5], 0.4)], tools: ["screwdriver"] });
+ k.step({ title: "Screw the cam bolts into the left side", detail: "Two for the bottom and one for the plinth.", fix: [bolts(L, bot, [0.25, 0.75]), bolts(L, pf, [0.25], 0.4)], tools: ["screwdriver"] });
k.step({ title: "Screw the divider onto the bottom", detail: "Two long connector screws up through the bottom into the divider, with the Allen key.", add: ["bot", "div"], fix: [screws(bot, div, [0.25, 0.75], LONG_SCREW)], tools: ["allen"] });
k.step({ title: "Push the left side on", detail: "Two dowels into the side, then press the bottom onto them and turn its two cam locks.", fix: [dowels(L, bot, [0.15, 0.85]), cams(L, bot, [0.25, 0.75], 1)], tools: ["hammer", "screwdriver"] });
- k.step({ title: "Push the plinth on", detail: "A dowel in each end, then lock its cam lock.", add: ["pf"], fix: [dowels(pf, L, [0.5], 0.7), dowels(pf, R, [0.5], 0.7), cams(L, pf, [0.5], -1, 0.4)], tools: ["hammer", "screwdriver"] });
- k.step({ title: "Put the right side on", detail: "Its wall fitting, hinge plates, cam bolts and dowels go in first. Press it on and lock three cam locks.", add: ["R"], fix: [...hang(R, 1), ...plateFixes([ds[1]]), bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.5], 0.4), dowels(R, bot, [0.15, 0.85]), cams(R, bot, [0.25, 0.75], 1), cams(R, pf, [0.5], -1, 0.4)], tools: ["screwdriver", "hammer"] });
+ k.step({ title: "Push the plinth on", detail: "A dowel in each end, then lock its cam lock.", add: ["pf"], fix: [dowels(pf, L, [0.8], 0.7), dowels(pf, R, [0.8], 0.7), cams(L, pf, [0.25], -1, 0.4)], tools: ["hammer", "screwdriver"] });
+ k.step({ title: "Put the right side on", detail: "Its wall fitting, hinge plates, cam bolts and dowels go in first. Press it on and lock three cam locks.", add: ["R"], fix: [...hang(R, 1), ...plateFixes([ds[1]]), bolts(R, bot, [0.25, 0.75]), bolts(R, pf, [0.25], 0.4), dowels(R, bot, [0.15, 0.85]), cams(R, bot, [0.25, 0.75], 1), cams(R, pf, [0.25], -1, 0.4)], tools: ["screwdriver", "hammer"] });
k.step({ title: "Fit the top", detail: "Six cam bolts into the top, six dowels into the sides and the divider, then press it on and lock it.", add: ["top"], fix: [bolts(top, L, [0.15, 0.85]), bolts(top, R, [0.15, 0.85]), bolts(top, div, [0.3, 0.7]), dowels(L, top, [0.35, 0.65]), dowels(R, top, [0.35, 0.65]), dowels(div, top, [0.15, 0.85]), cams(top, L, [0.15, 0.85], 1), cams(top, R, [0.15, 0.85], -1), cams(top, div, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"] });
k.step({ title: "Turn it over and nail on the back", detail: "Lay it on its front. Two halves, side by side. Square it up, then nail round the edges and into the divider.", add: back.map((p) => p.id), fix: [{ kind: "nail", count: 36, to: back.map((p) => p.id), ...BACK_NAIL }], tools: ["hammer"], pose: "-z", check: "square" });
k.step({ title: "Tap in the feet", detail: "Two plastic feet into the bottom edge of each side.", fix: feet([L, R], 2, D), tools: ["hammer"] });
@@ -920,7 +920,13 @@ function storageBed(b: PlanBuilder, s: ProductSpec) {
const cw = W / 2 - t - t / 2;
const cross = [-1, 1].map((g) => k.part(`c${g}`, "Cross divider", [t, yTop - rh, cw], [0, rh + (yTop - rh) / 2, g * (t / 2 + cw / 2)]));
const ledges = [-1, 1].flatMap((g) => [-1, 1].map((h) => k.part(`l${g}${h}`, "Slat ledge", [Ls / 2 - 2, 30, 30], [h * (Ls / 4), yTop - 15, g * (W / 2 - t - 15)], { material: "metal" })));
- const strips = [-1, 1].flatMap((h) => [-1, 1].map((g) => k.part(`st${h}${g}`, "Support strip", [Ls / 2 - 2, 8, 20], [h * (Ls / 4), yTop + 4, g * (t / 2 + 10)], { material: "metal" })));
+ // each strip is an angle: a web screwed to the face of the middle panel, a flange on top level with the ledges
+ const sh = 30, sw = 20;
+ const stripPieces = (g: number): PartPiece[] => [
+ { shape: "box", size: [Ls / 2 - 2, sh, 2], pos: [0, 0, -g * (sw / 2 - 1)] },
+ { shape: "box", size: [Ls / 2 - 2, 2, sw], pos: [0, sh / 2 - 1, 0] },
+ ];
+ const strips = [-1, 1].flatMap((h) => [-1, 1].map((g) => k.part(`st${h}${g}`, "Support strip", [Ls / 2 - 2, sh, sw], [h * (Ls / 4), yTop + 8 - sh / 2, g * (t / 2 + sw / 2)], { material: "metal", pieces: stripPieces(g) })));
const slats = k.part("slats", "Slatted bed base", [L - 2 * t - 20, 20, W - 2 * t - 20], [0, yTop + 18, 0], { extra: true, material: "wood" });
// drawers: two in each long side, between the head (or foot) panel and the cross dividers
const bay = L / 2 - t - t / 2;
@@ -958,7 +964,7 @@ function storageBed(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Fit the long sides together", detail: "Two dowels in each end, then lift each side into place between the head and foot panels and turn the connectors with the Allen key until they pull tight.", add: ["sf", "sb"], fix: sides.flatMap((sd) => ends.map((e) => dowels(e, sd, [0.25, 0.75], 0.5))), tools: ["hammer", "allen"], people: 2 });
k.step({ title: "Screw the brackets under the floor rails", detail: "A small bracket joins each rail to the head panel, two screws each.", fix: rails.flatMap((r) => [at("angle", r, [[-Ls / 2 + 20, rh, r.pos[2]]], [0, -1, 0], { len: 30, dia: 24 }), at("screw", r, [-1, 1].map((e): Vec3 => [-Ls / 2 + 20 + e * 10, rh, r.pos[2]]), [0, -1, 0], { len: 12, dia: 4 })]), tools: ["screwdriver"] });
k.step({ title: "Screw the slat ledges inside the long sides", detail: "Two metal ledges along each side, four screws each.", add: ledges.map((p) => p.id), fix: ledges.map((l) => at("screw", l, spread(l.pos[0] - l.size[0] / 2 + 60, l.pos[0] + l.size[0] / 2 - 60, 4).map((x): Vec3 => [x, yTop - 15, Math.sign(l.pos[2]) * (W / 2 - t)]), [0, 0, Math.sign(l.pos[2])], { len: 16, dia: 4 })), tools: ["screwdriver"] });
- k.step({ title: "Screw the support strips along the middle panel", detail: "Four strips on top of it, three screws each.", add: strips.map((p) => p.id), fix: strips.map((p) => at("screw", p, spread(p.pos[0] - p.size[0] / 2 + 80, p.pos[0] + p.size[0] / 2 - 80, 3).map((x): Vec3 => [x, yTop + 8, p.pos[2]]), [0, -1, 0], { len: 12, dia: 4 })), tools: ["screwdriver"] });
+ k.step({ title: "Screw the support strips along the middle panel", detail: "Four angle strips, two along each face, top edge level with the ledges. Three screws each.", add: strips.map((p) => p.id), fix: strips.map((p) => at("screw", p, spread(p.pos[0] - p.size[0] / 2 + 80, p.pos[0] + p.size[0] / 2 - 80, 3).map((x): Vec3 => [x, yTop - 12, Math.sign(p.pos[2]) * (t / 2 + 2)]), [0, 0, -Math.sign(p.pos[2])], { len: 12, dia: 4 })), tools: ["screwdriver"] });
k.step({ title: "Fit the fixings for the slatted base", detail: "Eight inserts in the head and foot panels, one screw each. They hold the base from sliding.", fix: ends.flatMap((e) => [at("nut", e, spread(-W / 2 + 150, W / 2 - 150, 4).map((z): Vec3 => [e.pos[0] - Math.sign(e.pos[0]) * (t / 2), yTop + 10, z]), [Math.sign(e.pos[0]), 0, 0], { len: 8, dia: 10 }), at("screw", e, spread(-W / 2 + 150, W / 2 - 150, 4).map((z): Vec3 => [e.pos[0] - Math.sign(e.pos[0]) * (t / 2), yTop + 10, z]), [Math.sign(e.pos[0]), 0, 0], { len: 10, dia: 4 })]), tools: ["screwdriver"] });
k.step({ title: "Screw on the headboard brackets", detail: "Only if you fit a headboard: two brackets on the outside of the head panel, two screws each.", fix: [at("plate", head, [-1, 1].map((g): Vec3 => [-L / 2, H - 120, g * (W / 2 - 200)]), [1, 0, 0], { len: 60, dia: 60 }), at("screw", head, [-1, 1].flatMap((g) => [-20, 20].map((e): Vec3 => [-L / 2, H - 120 + e, g * (W / 2 - 200)])), [1, 0, 0], { len: 16, dia: 5 })], tools: ["screwdriver"] });
k.step({ title: "Roll out the slatted base", detail: "It is sold separately. Lay it on the ledges and the middle strips.", add: ["slats"] });
@@ -1020,19 +1026,21 @@ function dayBed(b: PlanBuilder, s: ProductSpec) {
return rails.map((r, i) => at("clip", r, byRail[i].slice(0, i === 0 ? Math.ceil(n / 2) : Math.floor(n / 2)), [0, -1, 0], { len: 12, dia: 10 }));
};
+ // spots along each beam end, far enough apart that no two fittings share a hole
+ const BEAM_DOWELS = [0.15, 0.35, 0.65, 0.85], OUTER = [0.25, 0.75], MIDDLE = [0.25, 0.5, 0.75];
k.step({ title: "Screw the runners onto the beams", detail: "Lay the three beams on a rug. The middle one takes a runner on each face, the outer two one each, three screws each.", add: beams.map((p) => p.id), fix: [...run(beams[0], 1), ...run(beams[1], -1), ...run(beams[1], 1), ...run(beams[2], -1)], tools: ["screwdriver"], warnings: ["floor"] });
- k.step({ title: "Screw the castors under the beams", detail: "Two castors on each beam, two screws each.", fix: beams.flatMap((bm) => [at("castor", bm, [zpb + 120, zpf - 120].map((z): Vec3 => [bm.pos[0], py0, z]), [0, 1, 0], { len: 45, dia: 40 }), at("screw", bm, [zpb + 120, zpf - 120].flatMap((z) => [-15, 15].map((e): Vec3 => [bm.pos[0], py0, z + e])), [0, 1, 0], { len: 30, dia: 4 })]), tools: ["screwdriver"], pose: "-y" });
- k.step({ title: "Tap the dowels into the beams", detail: "Four into each end of every beam.", fix: beams.flatMap((bm) => [dowels(bm, pb, [0.15, 0.35, 0.65, 0.85]), dowels(bm, pf, [0.15, 0.35, 0.65, 0.85])]), tools: ["hammer"], pose: "+y" });
- k.step({ title: "Screw the cam bolts into the back of the pull-out", detail: "Lay it on the rug, inside up. Seven bolts.", add: ["pb"], fix: [bolts(pb, beams[0], [0.5]), bolts(pb, beams[1], [0.3, 0.5, 0.7]), bolts(pb, beams[2], [0.3, 0.7]), bolts(pb, beams[0], [0.8])], tools: ["screwdriver"], pose: "-z", warnings: ["floor"] });
- k.step({ title: "Stand the beams on the back and lock them", detail: "Push them onto the dowels and bolts, runners towards the middle, and turn the seven cam locks.", fix: [cams(pb, beams[0], [0.5, 0.8], 1), cams(pb, beams[1], [0.3, 0.5, 0.7], 1), cams(pb, beams[2], [0.3, 0.7], -1)], tools: ["screwdriver"] });
- k.step({ title: "Fit the front of the pull-out", detail: "Seven cam bolts in it first, then turn it over onto the beams and lock the seven cam locks.", add: ["pf"], fix: [bolts(pf, beams[0], [0.4, 0.7]), bolts(pf, beams[1], [0.3, 0.5, 0.7]), bolts(pf, beams[2], [0.4, 0.7]), cams(pf, beams[0], [0.4, 0.7], 1), cams(pf, beams[1], [0.3, 0.5, 0.7], 1), cams(pf, beams[2], [0.4, 0.7], -1)], tools: ["screwdriver"] });
- k.step({ title: "Screw the front to the beams", detail: "Six long screws, two into each beam.", fix: beams.map((bm) => screws(pf, bm, [0.2, 0.85], { len: 60, dia: 5 })), tools: ["screwdriver"] });
+ k.step({ title: "Screw the castors under the beams", detail: "Two castors on each beam, two screws each.", fix: beams.flatMap((bm) => [at("castor", bm, [zpb + 120, zpf - 120].map((z): Vec3 => [bm.pos[0], py0, z]), [0, 1, 0], { len: 45, dia: 40 }), at("screw", bm, [zpb + 120, zpf - 120].flatMap((z) => [-25, 25].map((e): Vec3 => [bm.pos[0], py0, z + e])), [0, 1, 0], { len: 30, dia: 4 })]), tools: ["screwdriver"], pose: "-y" });
+ k.step({ title: "Tap the dowels into the beams", detail: "Four into each end of every beam.", fix: beams.flatMap((bm) => [dowels(bm, pb, BEAM_DOWELS), dowels(bm, pf, BEAM_DOWELS)]), tools: ["hammer"], pose: "+y" });
+ k.step({ title: "Screw the cam bolts into the back of the pull-out", detail: "Lay it on the rug, inside up. Seven bolts.", add: ["pb"], fix: [bolts(pb, beams[0], OUTER), bolts(pb, beams[1], MIDDLE), bolts(pb, beams[2], OUTER)], tools: ["screwdriver"], pose: "-z", warnings: ["floor"] });
+ k.step({ title: "Stand the beams on the back and lock them", detail: "Push them onto the dowels and bolts, runners towards the middle, and turn the seven cam locks.", fix: [cams(pb, beams[0], OUTER, 1), cams(pb, beams[1], MIDDLE, 1), cams(pb, beams[2], OUTER, -1)], tools: ["screwdriver"] });
+ k.step({ title: "Fit the front of the pull-out", detail: "Seven cam bolts in it first, then turn it over onto the beams and lock the seven cam locks.", add: ["pf"], fix: [bolts(pf, beams[0], OUTER), bolts(pf, beams[1], MIDDLE), bolts(pf, beams[2], OUTER), cams(pf, beams[0], OUTER, 1), cams(pf, beams[1], MIDDLE, 1), cams(pf, beams[2], OUTER, -1)], tools: ["screwdriver"] });
+ k.step({ title: "Screw the front to the beams", detail: "Six long screws, two into each beam.", fix: beams.map((bm) => screws(pf, bm, [0.05, 0.95], { len: 60, dia: 5 })), tools: ["screwdriver"] });
k.step({ title: "Screw the slat rails inside the pull-out", detail: "One along the front and one along the back, four screws each.", add: prails.map((p) => p.id), fix: prails.map((r) => at("screw", r, spread(-pl / 2 + 150, pl / 2 - 150, 4).map((x): Vec3 => [x, r.pos[1], r.pos[2] + (r.pos[2] > 0 ? 12 : -12)]), [0, 0, r.pos[2] > 0 ? 1 : -1], { len: 16, dia: 4 })), tools: ["screwdriver"], pose: "+y" });
k.step({ title: "Lay the slats on the pull-out", detail: "Thirteen slats across the rails, clipped down at the ends.", add: pslats.map((p) => p.id), fix: slatClips(prails, pslats, 18) });
k.step({ title: "Prepare the end panels", detail: "Two connector pins and two dowels into the back edge of each.", add: ends.map((p) => p.id), fix: ends.flatMap((e) => [at("stud", e, [[e.pos[0], H - 120, -D / 2 + t], [e.pos[0], 120, -D / 2 + t]], [0, 0, 1], { len: 40, dia: 8 }), dowels(e, back, [0.35, 0.65])]), tools: ["screwdriver", "hammer"] });
k.step({ title: "Press the round connectors into the back panel", detail: "Two at each end, arrow pointing at the edge.", add: ["back"], fix: ends.map((e) => at("connector", back, [H - 120, 120].map((y): Vec3 => [Math.sign(e.pos[0]) * (L / 2 - t - 50), y, -D / 2 + t]), [0, 0, -1], { len: 14, dia: 40 })), tools: ["allen"] });
k.step({ title: "Join the ends to the back together", detail: "Push each end onto the back and turn the connectors with the Allen key until they pull tight.", people: 2, tools: ["allen"] });
- k.step({ title: "Fit the front rail", detail: "Two plates join it to the end panels, with two screws at each end.", add: ["front"], fix: [...ends.map((e) => at("plate", front, [[Math.sign(e.pos[0]) * (L / 2 - t - 40), (ry0 + ry1) / 2, D / 2 - t]], [0, 0, 1], { len: 50, dia: 30 })), ...ends.map((e) => at("screw", e, [-15, 15].map((dy): Vec3 => [Math.sign(e.pos[0]) * (L / 2 - t), (ry0 + ry1) / 2 + dy, D / 2 - t - 20]), [-Math.sign(e.pos[0]), 0, 0], { len: 16, dia: 4 }))], tools: ["screwdriver"] });
+ k.step({ title: "Fit the front rail", detail: "Two plates join it to the end panels, with two screws at each end.", add: ["front"], fix: [...ends.map((e) => at("plate", front, [[Math.sign(e.pos[0]) * (L / 2 - t - 40), (ry0 + ry1) / 2, D / 2 - t]], [0, 0, 1], { len: 50, dia: 30 })), ...ends.map((e) => at("screw", e, [-25, 25].map((dy): Vec3 => [Math.sign(e.pos[0]) * (L / 2 - t - 2), (ry0 + ry1) / 2 + dy, D / 2 - t - 20]), [Math.sign(e.pos[0]), 0, 0], { len: 16, dia: 4 }))], tools: ["screwdriver"] });
k.step({ title: "Tap the glides into the end panels", detail: "Two under each end.", fix: ends.map((e) => at("glide", e, [-D / 2 + 60, D / 2 - 60].map((z): Vec3 => [e.pos[0], 0, z]), [0, 1, 0], FOOT)), tools: ["hammer"] });
k.step({ title: "Screw on the slat rails", detail: "One along the back panel and one along the front rail, four screws each.", add: ledges.map((p) => p.id), fix: ledges.map((r) => at("screw", r, spread(-L / 2 + 150, L / 2 - 150, 4).map((x): Vec3 => [x, r.pos[1], r.pos[2] + (r.pos[2] > 0 ? 12 : -12)]), [0, 0, r.pos[2] > 0 ? 1 : -1], { len: 16, dia: 4 })), tools: ["screwdriver"] });
k.step({ title: "Lay the slats on the frame", detail: "Twelve slats, clipped onto the rails at both ends. Don't sit on it before they are all in.", add: mslats.map((p) => p.id), fix: slatClips(ledges, mslats, 12) });
@@ -1078,13 +1086,13 @@ function dressingTable(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Prepare the left side", detail: "Lay it on a rug. Two cam bolts for the back rail, and two plastic feet into the bottom edge.", add: ["L"], fix: [bolts(L, back, [0.3, 0.7]), ...feet([L], 2, D)], tools: ["screwdriver", "hammer"], pose: "+x", warnings: ["floor"] });
k.step({ title: "Stand the back rail in the left side", detail: "Two dowels, then push it on and turn its two cam locks.", add: ["back"], fix: [dowels(L, back, [0.2, 0.8]), cams(L, back, [0.3, 0.7], 1)], tools: ["hammer", "screwdriver"] });
- k.step({ title: "Put the right side on", detail: "Its cam bolts and feet go in first, like the left. Two dowels, then press it on and lock it.", add: ["R"], fix: [bolts(R, back, [0.3, 0.7]), ...feet([R], 2, D), dowels(R, back, [0.2, 0.8]), cams(R, back, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"] });
k.step({ title: "Fit the top over the drawer", detail: "Stand it up. Four cam bolts in the top, dowels in the left side and the back rail, then press it on the left half and lock it.", add: ["top"], fix: [bolts(top, L, [0.2, 0.8]), bolts(top, back, [0.3, 0.7]), dowels(L, top, [0.35, 0.65]), dowels(back, top, [0.4, 0.8]), cams(top, L, [0.2, 0.8], 1), cams(top, back, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"], pose: "+y" });
k.step({ title: "Fit the divider under the top", detail: "Two dowels into its top edge, then one long connector screw down through the top into it.", add: ["div"], fix: [dowels(div, top, [0.25, 0.75]), screws(top, div, [0.5], LONG_SCREW)], tools: ["hammer", "allen"] });
k.step({ title: "Screw the drawer rails on", detail: "A plastic rail on the left side and one on the divider, four screws each.", fix: [slide(L, 1), slideScrews(L, 1), slide(div, -1), slideScrews(div, -1)], tools: ["screwdriver"] });
- k.step({ title: "Fit the bottom of the tray space", detail: "Cam bolts in the divider, the right side and the back rail, two dowels each end, then push the bottom in and lock its six cam locks.", add: ["bot"], fix: [bolts(div, bot, [0.3, 0.7]), bolts(R, bot, [0.3, 0.7]), bolts(back, bot, [0.3, 0.7]), dowels(bot, div, [0.15, 0.85]), dowels(bot, R, [0.15, 0.85]), cams(div, bot, [0.3, 0.7], 1), cams(R, bot, [0.3, 0.7], 1), cams(back, bot, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"] });
+ k.step({ title: "Fit the bottom of the tray space", detail: "Two cam bolts in the divider and two dowels in the end of the bottom, then push it onto the divider and lock the two cam locks.", add: ["bot"], fix: [bolts(div, bot, [0.3, 0.7]), dowels(bot, div, [0.15, 0.85]), cams(div, bot, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"] });
+ k.step({ title: "Put the right side on", detail: "Cam bolts and feet go in first, like the left. Dowels in the back rail and the bottom, then press it on and lock its four cam locks.", add: ["R"], fix: [bolts(R, back, [0.3, 0.7]), bolts(R, bot, [0.3, 0.7]), ...feet([R], 2, D), dowels(R, back, [0.2, 0.8]), dowels(bot, R, [0.15, 0.85]), cams(R, back, [0.3, 0.7], 1), cams(R, bot, [0.3, 0.7], 1)], tools: ["screwdriver", "hammer"] });
k.step({ title: "Fit the front panel", detail: "A cam bolt and a dowel at each end, two long connector screws through it into the bottom, then lock the two cam locks.", add: ["front"], fix: [bolts(R, front, [0.5]), bolts(div, front, [0.5]), dowels(front, R, [0.2]), dowels(front, div, [0.2]), screws(front, bot, [0.3, 0.7], LONG_SCREW), cams(R, front, [0.5], -1), cams(div, front, [0.5], -1)], tools: ["screwdriver", "allen", "hammer"] });
- k.step({ title: "Hinge the mirror lid on", detail: "Two flat hinges along its back edge into the back rail, two screws each. Then the lid stay at the right, so it stays open.", add: ["lid"], fix: [at("flatHinge", lid, [-1, 1].map((g): Vec3 => [W / 4 + g * 100, H - T, -D / 2 + 20]), [0, 1, 0], { len: 60, dia: 34 }), at("screw", back, [-1, 1].flatMap((g) => [-15, 15].map((e): Vec3 => [W / 4 + g * 100 + e, H - T - 4, -D / 2 + T])), [0, 0, -1], { len: 12, dia: 3.5 }), at("gasLift", lid, [[xi - 30, H - T - 60, 0]], [1, 0, 0], { len: 200, dia: 20 }), at("screw", lid, [-1, 1].map((e): Vec3 => [xi - 30, H - T - 20, e * 80]), [0, 1, 0], { len: 12, dia: 3.5 })], tools: ["screwdriver"] });
+ k.step({ title: "Hinge the mirror lid on", detail: "Two flat hinges along its back edge into the back rail, two screws each. Then the lid stay at the right, so it stays open.", add: ["lid"], fix: [at("flatHinge", lid, [-1, 1].map((g): Vec3 => [W / 4 + g * 100, H - T, -D / 2 + 20]), [0, 1, 0], { len: 60, dia: 34 }), at("screw", back, [-1, 1].flatMap((g) => [-25, 25].map((e): Vec3 => [W / 4 + g * 100 + e, H - T - 4, -D / 2 + T])), [0, 0, -1], { len: 12, dia: 3.5 }), at("gasLift", lid, [[xi - 30, H - T - 60, 0]], [1, 0, 0], { len: 200, dia: 20 }), at("screw", lid, [-1, 1].map((e): Vec3 => [xi - 30, H - T - 14, e * 80]), [0, 1, 0], { len: 12, dia: 3.5 })], tools: ["screwdriver"] });
k.step({ title: "Put the tray in", detail: "It sits on the bottom under the lid.", add: ["tray"] });
buildCustom(b, { ...s, custom: k.recipe });
drawers(b, ds, { bumpers: 2, plain: true });
diff --git a/src/lib/plan/families/bror.ts b/src/lib/plan/families/bror.ts
index dbe2dc6..b7743ae 100644
--- a/src/lib/plan/families/bror.ts
+++ b/src/lib/plan/families/bror.ts
@@ -324,7 +324,7 @@ function drawerBench(b: PlanBuilder, s: ProductSpec) {
y,
front: k.part("Drawer front", [Wf, Hf, DF], [0, slot(i) + 4 + Hf / 2, zf], { pieces: frontPieces }),
sides: [-1, 1].map((g) => k.part("Drawer side", [PT, Hs, Ds], [g * xs, y + Hs / 2, zs])),
- bottom: k.part("Drawer bottom", [2 * xs - PT, PT, Ds - PT], [0, y + PT / 2, zs + PT / 2]),
+ bottom: k.part("Drawer bottom", [2 * xs - PT, PT, Ds], [0, y + PT / 2, zs]),
back: k.part("Drawer back", [2 * xs - PT, Hs - PT, PT], [0, y + PT + (Hs - PT) / 2, zb]),
};
});
@@ -332,13 +332,13 @@ function drawerBench(b: PlanBuilder, s: ProductSpec) {
const per = (fn: (g: number, side: string) => FitOpts[]) => [-1, 1].flatMap((g) => fn(g, d.sides[g < 0 ? 0 : 1]));
return {
bottom: [
- { on: d.front, at: [0, d.y + 10, D / 2], dir: [0, 0, -1], mate: d.bottom } as FitOpts,
- ...per((g, sd) => [zs + Ds * 0.3, zs - Ds * 0.3].map((z): FitOpts => ({ on: sd, at: [g * (xs + PT / 2), d.y + 10, z], dir: [-g, 0, 0], mate: d.bottom }))),
+ { on: d.front, at: [0, d.y + PT / 2, D / 2], dir: [0, 0, -1], mate: d.bottom } as FitOpts,
+ ...per((g, sd) => [zs + Ds * 0.3, zs - Ds * 0.3].map((z): FitOpts => ({ on: sd, at: [g * (xs + PT / 2), d.y + PT / 2, z], dir: [-g, 0, 0], mate: d.bottom }))),
],
- back: per((g, sd) => [{ on: sd, at: [g * (xs + PT / 2), d.y + 30, zb + 8], dir: [-g, 0, 0], mate: d.back }]),
- under: [-1, 0, 1].map((g): FitOpts => ({ on: d.bottom, at: [g * (xs - 80), d.y, zb + 10], dir: [0, 1, 0], mate: d.back })),
- top: per((g, sd) => [{ on: sd, at: [g * (xs + PT / 2), d.y + Hs - 16, zb + 12], dir: [-g, 0, 0], mate: d.back }]),
- nuts: per((g, sd) => [{ on: sd, at: [g * (xs - PT / 2), d.y + Hs - 16, zb + 12], dir: [g, 0, 0], hole: false as const }]),
+ back: per((g, sd) => [{ on: sd, at: [g * (xs + PT / 2), d.y + 30, zb], dir: [-g, 0, 0], mate: d.back }]),
+ under: [-1, 0, 1].map((g): FitOpts => ({ on: d.bottom, at: [g * (xs - 80), d.y, zb], dir: [0, 1, 0], mate: d.back })),
+ top: per((g, sd) => [{ on: sd, at: [g * (xs + PT / 2), d.y + Hs - 16, zb], dir: [-g, 0, 0], mate: d.back }]),
+ nuts: per((g, sd) => [{ on: sd, at: [g * (xs - PT / 2), d.y + Hs - 16, zb], dir: [g, 0, 0], hole: false as const }]),
};
};
@@ -945,7 +945,8 @@ const cabFits = {
},
brackets: (c: Cab): FitOpts[] => sx2.map((sx, si): FitOpts => ({ on: c.sides[si], at: [c.xc + sx * (c.W / 2 - ST), c.yt - 40, -c.D / 2 + 40], dir: [sx, 0, 0], hole: false })),
bracketScrews: (c: Cab): FitOpts[] => sx2.flatMap((sx, si) => [-12, 12].map((dy): FitOpts => ({ on: c.sides[si], at: [c.xc + sx * (c.W / 2 - ST - 2), c.yt - 40 + dy, -c.D / 2 + 30], dir: [sx, 0, 0] }))),
- topBolts: (c: Cab): FitOpts[] => sx2.flatMap((sx, si) => sx2.map((sz): FitOpts => ({ on: c.sides[si], at: [c.xc + sx * (c.W / 2 - ST / 2), c.yt, sz * (c.D / 2 - 40)], dir: [0, 1, 0], mate: c.top }))),
+ // from inside the side's fold, up into the top
+ topBolts: (c: Cab): FitOpts[] => sx2.flatMap((sx, si) => sx2.map((sz): FitOpts => ({ on: c.sides[si], at: [c.xc + sx * (c.W / 2 - ST / 2), c.yt - 12, sz * (c.D / 2 - 40)], dir: [0, 1, 0], mate: c.top }))),
};
/** The box, built as its manual does: in the main scene for a cabinet on its own, in a scene of its own when it goes into a shelving unit. */
@@ -1159,7 +1160,7 @@ function cabinetShelving(b: PlanBuilder, s: ProductSpec, widths: number[]) {
}
},
);
- const bottomBolts = cabs.flatMap((c, i) => sx2.map((sx, si): FitOpts => ({ on: rails[i][si], at: [c.xc + sx * (CW / 2 - 12), yc - PT, D / 2 - 60], dir: [0, 1, 0], mate: c.base[si] })));
+ const bottomBolts = cabs.flatMap((c, i) => sx2.map((sx, si): FitOpts => ({ on: rails[i][si], at: [c.xc + sx * (CW / 2 - 12), yc - PT, D / 2 - 12], dir: [0, 1, 0], mate: c.base[si] })));
k.step({ title: n > 1 ? "Bolt the cabinets to the rails" : "Bolt the cabinet to the rails", detail: "One bolt up through each rail into the base frame above it, near the front.", kind: "bolts", tools: ["allen"] }, () => k.fits(BOLT, bottomBolts, 0.12));
const over = cabs.flatMap((c) => sx2.map((sx, si): FitOpts => ({ on: c.top, at: [c.xc + sx * (CW / 2 - 20), c.yt + ST, -D / 2 + 30], dir: [0, -1, 0], hole: false, mate: c.sides[si] })));
k.step({ title: n > 1 ? "Hook a bracket over each cabinet top corner" : "Hook a bracket over the cabinet top", detail: "One at each back corner, its tab hooked into the back post.", kind: "join" }, () => k.fits(CAB_BRACKET, over, 0.12));
diff --git a/src/lib/plan/families/brusali.ts b/src/lib/plan/families/brusali.ts
index 625c510..2d90b49 100644
--- a/src/lib/plan/families/brusali.ts
+++ b/src/lib/plan/families/brusali.ts
@@ -60,8 +60,10 @@ function cabinet(s: ProductSpec): CustomParams {
const camFlat = (sx: number, y: number, up: number) => fx("cam", [-1, 1].map((sz): Vec3 => [sx * (xi - 34), y + (up * T) / 2, sz * 100]), [0, -up, 0], undefined);
const pivots = (i: number) => [-1, 1].map((sx): Vec3 => [sx * xi, fy(i) - fh / 2 + 30, zf - 60]);
const binScrews = (is: number[]) => fx("screw", is.flatMap((i) => [-1, 1].flatMap((sx) => [-60, 0, 60].map((dy): Vec3 => [sx * (xi - 9), fy(i) + dy, zf - T]))), [0, 0, 1], undefined, { len: 12, dia: 4 });
+ // in from the outside of each bracket, so the two sides point opposite ways
+ const sideScrews = (pts: (sx: number) => Vec3[]) => [-1, 1].map((sx) => fx("screw", pts(sx), [-sx, 0, 0], undefined, { len: 16, dia: 3.5 }));
const boardScrews = (is: number[], board: "A" | "B") =>
- fx("screw", is.flatMap((i) => [-1, 1].map((sx): Vec3 => [sx * (xi - 3), board === "A" ? fy(i) - fh / 2 + 32 : fy(i) + 15, board === "A" ? zf - T - 100 : zf - T - 205])), [1, 0, 0], undefined, { len: 16, dia: 3.5 });
+ sideScrews((sx) => is.map((i): Vec3 => [sx * (xi - 3), board === "A" ? fy(i) - fh / 2 + 32 : fy(i) + 15, board === "A" ? zf - T - 100 : zf - T - 205]));
const hang = (is: number[]) => [
fx("cap", is.flatMap(pivots).map((p): Vec3 => [p[0] - Math.sign(p[0]) * 12, p[1], p[2]]), [1, 0, 0], undefined, { name: "Bushing", len: 10, dia: 18 }),
fx("screw", is.flatMap(pivots).map((p): Vec3 => [p[0] - Math.sign(p[0]) * 20, p[1], p[2]]), [1, 0, 0], undefined, { len: 12, dia: 4 }),
@@ -100,16 +102,16 @@ function cabinet(s: ProductSpec): CustomParams {
{ title: "Screw the feet to the bottom", detail: "One screw through each foot.", fix: [fx("screw", [0, 1].map((i): Vec3 => [parts.find((p) => p.id === `FT${i}`)!.pos[0] + 20, 0, zf - 40]), [0, 1, 0], undefined, { len: 12, dia: 4 })], tools: ["screwdriver"] },
{ title: "Screw the brackets onto a bin front", detail: "Lay the front face down on the rug. Three screws through each bracket.", add: ["F0", "K00", "K01"], fix: [binScrews([0])], tools: ["screwdriver"] },
{ title: "Slide in the bin bottom", detail: "Pick the right board, it runs into the slots low in the brackets.", add: ["A0"] },
- { title: "Screw the bottom in place", detail: "One screw through each bracket.", fix: [boardScrews([0], "A")], tools: ["screwdriver"] },
+ { title: "Screw the bottom in place", detail: "One screw through each bracket.", fix: boardScrews([0], "A"), tools: ["screwdriver"] },
{ title: "Click in the bin back", detail: "Tilt it in at the top of the brackets and press it down until it clicks.", add: ["B0"] },
- { title: "Screw the back in place", detail: "One screw through each bracket.", fix: [boardScrews([0], "B")], tools: ["screwdriver"] },
+ { title: "Screw the back in place", detail: "One screw through each bracket.", fix: boardScrews([0], "B"), tools: ["screwdriver"] },
{ title: "Hang the bin on the top pivots", detail: "Its brackets drop over the pivots in the sides.", tools: [] },
{ title: "Fit the bushings over the pivots", detail: "A bushing and a screw on each pivot, by hand, not with a drill.", fix: hang([0]), tools: ["screwdriver"] },
{
title: "Build and hang the other two bins",
detail: "The same way: brackets, bottom and back, then onto the pivots with their bushings.",
add: [1, 2].flatMap((i) => [`F${i}`, `K${i}0`, `K${i}1`, `A${i}`, `B${i}`]),
- fix: [binScrews([1, 2]), boardScrews([1, 2], "A"), boardScrews([1, 2], "B"), ...hang([1, 2])],
+ fix: [binScrews([1, 2]), ...boardScrews([1, 2], "A"), ...boardScrews([1, 2], "B"), ...hang([1, 2])],
from: Object.fromEntries([1, 2].flatMap((i) => [`F${i}`, `K${i}0`, `K${i}1`, `A${i}`, `B${i}`].map((id): [string, Vec3] => [id, [0, 0, 400]]))),
tools: ["screwdriver"],
},
@@ -123,8 +125,8 @@ function cabinet(s: ProductSpec): CustomParams {
tools: ["level", "drill", "screwdriver"],
warnings: ["tip"],
},
- { title: "Fit the middle shelves into the bins", detail: "Open each bin, lay the shelf on its ledges and screw it through both brackets.", add: ["C0", "C1", "C2"], fix: [fx("screw", [0, 1, 2].flatMap((i) => [-1, 1].map((sx): Vec3 => [sx * (xi - 3), fy(i) + 20, zf - T - 80])), [1, 0, 0], undefined, { len: 16, dia: 3.5 })], tools: ["screwdriver"] },
- { title: "Screw on the knobs", detail: "One near the top of each bin front, the screw from inside.", fix: [fx("knob", [0, 1, 2].map((i): Vec3 => [0, fy(i) + fh / 2 - 45, zf]), [0, 0, -1]), fx("screw", [0, 1, 2].map((i): Vec3 => [0, fy(i) + fh / 2 - 45, zf - T]), [0, 0, 1], undefined, { len: 25, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Fit the middle shelves into the bins", detail: "Open each bin, lay the shelf on its ledges and screw it through both brackets.", add: ["C0", "C1", "C2"], fix: sideScrews((sx) => [0, 1, 2].map((i): Vec3 => [sx * (xi - 3), fy(i) + 20, zf - T - 80])), tools: ["screwdriver"] },
+ { title: "Screw on the knobs", detail: "One near the top of each bin front, the screw from inside.", fix: [fx("knob", [0, 1, 2].map((i): Vec3 => [0, fy(i) + fh / 2 - 45, zf + 5]), [0, 0, -1]), fx("screw", [0, 1, 2].map((i): Vec3 => [0, fy(i) + fh / 2 - 45, zf - T]), [0, 0, 1], undefined, { len: 25, dia: 4 })], tools: ["screwdriver"] },
];
return { parts, steps };
}
diff --git a/src/lib/plan/families/brytning.ts b/src/lib/plan/families/brytning.ts
index 2ed5b9b..a8e0006 100644
--- a/src/lib/plan/families/brytning.ts
+++ b/src/lib/plan/families/brytning.ts
@@ -68,10 +68,12 @@ function desk(s: ProductSpec, drawer: boolean): CustomParams {
sides.flatMap((sx) => sides.map((sz) => at(kind, ys.map((y) => [sx * cx, y, sz * fz] as Vec3), [0, 0, sz], leg(sx, sz), sp(sx), o)));
const inner = (sx: number, ys: number[], zs: number[]): Vec3[] => ys.flatMap((y) => zs.map((z) => [sx * xi, y, z] as Vec3));
+ // the legs, the back panel and the back rail all join the side panel near its back edge: their holes are at
+ // different heights (legs 528-650, back panel 575 and 630, back rail 670-718)
const steps: CustomStep[] = [
- { title: "Tap two dowels into each leg", detail: "Lay the legs on a rug. The short dowels go into the two holes high up on the inner face.", fix: perLeg("dowel", [590, 660], DOWEL), tools: ["hammer"], warnings: ["floor"] },
+ { title: "Tap two dowels into each leg", detail: "Lay the legs on a rug. The short dowels go into the two holes high up on the inner face.", fix: perLeg("dowel", [552, 612], DOWEL), tools: ["hammer"], warnings: ["floor"] },
{ title: "Tap a large dowel into each leg", detail: "Into the single hole low down, for the side rail.", fix: perLeg("dowel", [140], BIG_DOWEL), tools: ["hammer"] },
- { title: "Screw three cam bolts into each leg", detail: "Two high up beside the dowels, one low down. By hand or with a screwdriver until they stop.", fix: perLeg("camScrew", [545, 705, 165], CAM_BOLT), tools: ["screwdriver"] },
+ { title: "Screw three cam bolts into each leg", detail: "Two high up beside the dowels, one low down. By hand or with a screwdriver until they stop.", fix: perLeg("camScrew", [528, 650, 165], CAM_BOLT), tools: ["screwdriver"] },
{
title: "Push a floor glide into each leg's foot",
detail: "Tap it in until its rim sits flat.",
@@ -79,15 +81,15 @@ function desk(s: ProductSpec, drawer: boolean): CustomParams {
},
{ title: "Push the side panels and rails onto the legs", detail: "Two legs to each side frame, the grooved face of the panel outwards. Push them together over the dowels and cam bolts.", add: [sp(-1), sr(-1), sp(1), sr(1)] },
{ title: "Turn the large cam locks in the rails", detail: "Arrow towards the bolt, then clockwise until the rail pulls tight against the leg.", fix: sides.map((sx) => at("cam", sides.map((sz) => [sx * (cx - 17.5), 165, sz * (fz - 30)] as Vec3), [sx, 0, 0], sr(sx), undefined, BIG_CAM)), tools: ["screwdriver"] },
- { title: "Turn the cam locks in the side panels", detail: "Four in each panel, the same way.", fix: sides.map((sx) => at("cam", inner(sx, [545, 705], [-(fz - 34), fz - 34]), [sx, 0, 0], sp(sx), undefined, CAM)), tools: ["screwdriver"] },
+ { title: "Turn the cam locks in the side panels", detail: "Four in each panel, the same way.", fix: sides.map((sx) => at("cam", inner(sx, [528, 650], [-(fz - 34), fz - 34]), [sx, 0, 0], sp(sx), undefined, CAM)), tools: ["screwdriver"] },
{ title: "Screw two short cam bolts into each side panel", detail: "Into the holes low down on the inside: the shelf locks onto these.", fix: sides.map((sx) => at("camScrew", inner(sx, [551], [-40, 150]), [sx, 0, 0], sp(sx), undefined, SHORT_BOLT)), tools: ["screwdriver"] },
- { title: "Screw a cam bolt into each side panel for the back rail", detail: "Into the hole high up at the back.", fix: sides.map((sx) => at("camScrew", [[sx * xi, 689, -fz + 9]], [sx, 0, 0], sp(sx), "BR", CAM_BOLT)), tools: ["screwdriver"] },
- { title: "Tap four dowels into the back rail", detail: "Two into each end.", fix: sides.map((sx) => at("dowel", [[sx * xi, 665, -fz + 9], [sx * xi, 713, -fz + 9]], [-sx, 0, 0], "BR", sp(sx), DOWEL)), tools: ["hammer"] },
+ { title: "Screw a cam bolt into each side panel for the back rail", detail: "Into the hole high up at the back.", fix: sides.map((sx) => at("camScrew", [[sx * xi, 718, -fz + 9]], [sx, 0, 0], sp(sx), "BR", CAM_BOLT)), tools: ["screwdriver"] },
+ { title: "Tap four dowels into the back rail", detail: "Two into each end.", fix: sides.map((sx) => at("dowel", [[sx * xi, 670, -fz + 9], [sx * xi, 694, -fz + 9]], [-sx, 0, 0], "BR", sp(sx), DOWEL)), tools: ["hammer"] },
{ title: "Stand the back panel on the shelf support", detail: "The narrow strip goes along the top of the back panel, on its front side. Just lay them together for now.", add: ["SB", "BP", "ST"] },
{
title: "Tap three dowels into each end of it",
detail: "Two into the shelf support, one into the back panel.",
- fix: sides.flatMap((sx) => [at("dowel", [[sx * xi, 551, -160], [sx * xi, 551, -105]], [-sx, 0, 0], "SB", sp(sx), DOWEL), at("dowel", [[sx * xi, 600, -fz + 9]], [-sx, 0, 0], "BP", sp(sx), DOWEL)]),
+ fix: sides.flatMap((sx) => [at("dowel", [[sx * xi, 551, -160], [sx * xi, 551, -105]], [-sx, 0, 0], "SB", sp(sx), DOWEL), at("dowel", [[sx * xi, 575, -fz + 9]], [-sx, 0, 0], "BP", sp(sx), DOWEL)]),
tools: ["hammer"],
},
{ title: "Tap a large dowel into each end of the stretcher", fix: sides.map((sx) => at("dowel", [[sx * (cx - 17.5), 152, -12]], [-sx, 0, 0], "LS", sr(sx), BIG_DOWEL)), tools: ["hammer"] },
@@ -97,7 +99,7 @@ function desk(s: ProductSpec, drawer: boolean): CustomParams {
detail: "Two through each side panel into the shelf support and back panel, one through each rail into the stretcher.",
fix: sides.flatMap((sx) => [
at("screw", [[sx * (cx + 9), 551, -132]], [-sx, 0, 0], sp(sx), "SB", LONG_SCREW),
- at("screw", [[sx * (cx + 9), 620, -fz + 9]], [-sx, 0, 0], sp(sx), "BP", LONG_SCREW),
+ at("screw", [[sx * (cx + 9), 630, -fz + 9]], [-sx, 0, 0], sp(sx), "BP", LONG_SCREW),
at("screw", [[sx * (cx + 17.5), 152, 12]], [-sx, 0, 0], sr(sx), "LS", LONG_SCREW),
]),
tools: ["allen"],
@@ -155,7 +157,7 @@ function desk(s: ProductSpec, drawer: boolean): CustomParams {
title: "Screw the sides to the drawer back",
detail: "Two screws through each side into the back's ends.",
add: ["DB"],
- fix: sides.map((sx) => at("screw", [[sx * rx, 610, zb + 9], [sx * rx, 664, zb + 9]], [-sx, 0, 0], sx > 0 ? "DSR" : "DSL", "DB", { len: 40, dia: 5 })),
+ fix: sides.map((sx) => at("screw", [[sx * rx, 610, zb + 9], [sx * rx, 676, zb + 9]], [-sx, 0, 0], sx > 0 ? "DSR" : "DSL", "DB", { len: 40, dia: 5 })),
tools: ["screwdriver"],
from: { DB: [0, 0, 500] },
},
@@ -216,10 +218,11 @@ function cupboardDesk(s: ProductSpec): CustomParams {
}
for (const sx of sides) {
const x0 = sx * xw, x1 = sx * (xw + 18);
- parts.push(P(wall(sx), "Cupboard wall", Math.min(x0, x1), Math.max(x0, x1), yBot(sx) - 18, yT, zbF, fz));
+ parts.push(P(wall(sx), "Cupboard wall", Math.min(x0, x1), Math.max(x0, x1), yBot(sx), yT, zbF, fz));
}
+ // each bottom runs under its wall: the wall stands on it, joined by dowels and cam bolts in the bottom's top face
for (const sx of sides) {
- const a = sx * (xw + 18), b = sx * (cx - 9);
+ const a = sx * xw, b = sx * (cx - 9);
parts.push(P(bot(sx), "Cupboard bottom", Math.min(a, b), Math.max(a, b), yBot(sx) - 18, yBot(sx), zbF, fz));
}
parts.push(P("ST1", "Top strip", -xw, xw, yT - 80, yT, zbF, zbF + 18));
@@ -275,11 +278,11 @@ function cupboardDesk(s: ProductSpec): CustomParams {
{ title: "Push a floor glide into each leg", detail: "Into the foot, until the rim sits flat.", fix: [at("glide", sides.flatMap((sx) => sides.map((sz) => [sx * cx, 0, sz * cz] as Vec3)), [0, 1, 0], undefined, undefined, GLIDE)] },
{ title: "Stand the two cupboard walls on the back board", detail: "Against the back board, one at each inner end of a cupboard, their cam holes facing the back.", add: [wall(-1), wall(1)] },
{ title: "Lock the walls to the back board", detail: "Two cam locks in each wall, near the back edge.", fix: sides.map((sx) => camsIn(wall(sx), [[wallX(sx), 520, zbF + 34], [wallX(sx), 680, zbF + 34]], [-sx, 0, 0])), tools: ["screwdriver"] },
- { title: "Screw cam bolts into the cupboard bottoms", detail: "Two in each, near the end that meets the wall.", fix: sides.map((sx) => at("camScrew", [[sx * (xw + 18), yBot(sx) - 9, -100], [sx * (xw + 18), yBot(sx) - 9, 100]], [sx, 0, 0], bot(sx), undefined, CAM_BOLT)), tools: ["screwdriver"] },
- { title: "Tap dowels into the cupboard bottoms", detail: "Two in the other end of each.", fix: sides.map((sx) => at("dowel", [[sx * (cx - 9), yBot(sx) - 9, -100], [sx * (cx - 9), yBot(sx) - 9, 100]], [-sx, 0, 0], bot(sx), sp(sx), DOWEL)), tools: ["hammer"] },
- { title: "Fit the bottoms between the side panels and the walls", add: [bot(-1), bot(1)] },
- { title: "Lock the bottoms to the walls", detail: "Two cam locks in each wall, low down.", fix: sides.map((sx) => camsIn(wall(sx), [[wallX(sx), yBot(sx) - 9, -100 + 34], [wallX(sx), yBot(sx) - 9, 100 - 34]], [sx, 0, 0])), tools: ["screwdriver"] },
- { title: "Turn it upside down and screw the bottoms to the sides", detail: "Four medium screws, two through each side panel into the end of a bottom.", fix: sides.map((sx) => at("screw", [[sx * (cx + 9), yBot(sx) - 9, -100], [sx * (cx + 9), yBot(sx) - 9, 100]], [-sx, 0, 0], sp(sx), bot(sx), { len: 50, dia: 6, name: "Medium screw" })), pose: "-y", tools: ["allen"], people: 2, warnings: ["two"] },
+ { title: "Screw cam bolts into the cupboard bottoms", detail: "Two in each, in the top face at the end that goes under the wall.", fix: sides.map((sx) => at("camScrew", [[wallX(sx), yBot(sx), -100], [wallX(sx), yBot(sx), 100]], [0, -1, 0], bot(sx), wall(sx), CAM_BOLT)), tools: ["screwdriver"], wait: [bot(-1), bot(1)] },
+ { title: "Tap dowels into the cupboard bottoms", detail: "Two in each, beside the cam bolts.", fix: sides.map((sx) => at("dowel", [[wallX(sx), yBot(sx), -160], [wallX(sx), yBot(sx), 160]], [0, -1, 0], bot(sx), wall(sx), DOWEL)), tools: ["hammer"] },
+ { title: "Push the bottoms up under the walls", detail: "Between the side panel and the wall, the dowels and bolts into the wall's lower edge.", add: [bot(-1), bot(1)], from: { [bot(-1)]: [0, -250, 0], [bot(1)]: [0, -250, 0] } },
+ { title: "Lock the bottoms to the walls", detail: "Two cam locks in each wall, low down.", fix: sides.map((sx) => camsIn(wall(sx), [[wallX(sx), yBot(sx) + 34, -100], [wallX(sx), yBot(sx) + 34, 100]], [-sx, 0, 0])), tools: ["screwdriver"] },
+ { title: "Turn it upside down and screw the bottoms to the sides", detail: "Four medium screws, two through each side panel into the end of a bottom.", fix: sides.map((sx) => at("screw", [[sx * (cx + 9), yBot(sx) - 9, -110], [sx * (cx + 9), yBot(sx) - 9, 110]], [-sx, 0, 0], sp(sx), bot(sx), { len: 50, dia: 6, name: "Medium screw" })), pose: "-y", tools: ["allen"], people: 2, warnings: ["two"] },
{ title: "Tap dowels into the top strip", detail: "Two in each end.", fix: sides.map((sx) => at("dowel", [[sx * xw, yT - 60, zbF + 9], [sx * xw, yT - 20, zbF + 9]], [-sx, 0, 0], "ST1", wall(sx), DOWEL)), tools: ["hammer"] },
{ title: "Fit the top strip between the walls", detail: "At the back, along the back board.", add: ["ST1"] },
{ title: "Fit the front strip between the walls", detail: "Along their front edges.", add: ["ST2"] },
@@ -312,7 +315,17 @@ function cupboardDesk(s: ProductSpec): CustomParams {
{ title: "Screw it to the walls", detail: "One medium screw through each wall.", fix: sides.map((sx) => at("screw", [[sx * (xw + 18), 569, zbF + 55]], [-sx, 0, 0], wall(sx), "CS", { len: 50, dia: 6, name: "Medium screw" })), tools: ["allen"] },
{ title: "Stand it up and push in the shelf pins", detail: "Four, in the right-hand cupboard.", fix: [at("pin", [[xw + 18, 573, -120], [xw + 18, 573, 120], [cx - 9, 573, -120], [cx - 9, 573, 120]], [1, 0, 0], undefined, undefined, { len: 16, dia: 5 })], pose: "+y", people: 2, warnings: ["two"] },
{ title: "Slide the shelf in", detail: "From the front, onto the pins.", add: ["SH"], from: { SH: [0, 0, 450] } },
- { title: "Screw on the shelf catches", detail: "One under the top, either side of the shelf, so it can't tip.", fix: [at("clip", [[xw + 30, 600, fz - 40], [cx - 21, 600, fz - 40]], [0, 0, -1], "SH", undefined, { len: 30, dia: 16, name: "Shelf catch" }), at("screw", [[xw + 30, 600, fz - 40], [cx - 21, 600, fz - 40]], [0, 0, -1], "SH", undefined, { len: 14, dia: 4 })], tools: ["screwdriver"] },
+ {
+ title: "Screw on the shelf catches",
+ detail: "One on the wall and one on the side panel, just over the shelf, so it can't tip.",
+ fix: [
+ at("clip", [[xw + 18, 602, fz - 40]], [-1, 0, 0], wall(1), undefined, { len: 30, dia: 16, name: "Shelf catch" }),
+ at("clip", [[cx - 9, 602, fz - 40]], [1, 0, 0], sp(1), undefined, { len: 30, dia: 16, name: "Shelf catch" }),
+ at("screw", [[xw + 18, 602, fz - 66]], [-1, 0, 0], wall(1), undefined, { len: 14, dia: 4 }),
+ at("screw", [[cx - 9, 602, fz - 66]], [1, 0, 0], sp(1), undefined, { len: 14, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ },
{
title: "Screw the hinges onto the doors",
detail: "Two on each door, into the round holes. Lay the doors face down.",
@@ -416,7 +429,7 @@ function chair(): CustomParams {
const legScrews: Vec3[] = angles.flatMap((a) => [60, 95].map((r) => [dirOf(a)[0] * r, 100, dirOf(a)[1] * r] as Vec3));
const tips: Vec3[] = angles.map((a) => [dirOf(a)[0] * R, 70, dirOf(a)[1] * R]);
const seatBolts: Vec3[] = [[-70, 390, -90], [70, 390, -90], [-70, 390, 50], [70, 390, 50]];
- const backBolts: Vec3[] = [[-18, 378, -90], [18, 378, -90], [-18, 378, -150], [18, 378, -150]];
+ const backBolts: Vec3[] = [[-18, 378, -60], [18, 378, -60], [-18, 378, -110], [18, 378, -110]];
const steps: CustomStep[] = [
{ title: "Push the five legs into the hub", detail: "On a rug, each leg straight into its socket until it stops.", add: ["HUB", "A0", "A1", "A2", "A3", "A4"], warnings: ["floor"] },
{ title: "Screw the legs to the hub", detail: "Two screws with washers in each leg, with the Allen key.", fix: [at("washer", legScrews, [0, -1, 0], "HUB", undefined, { len: 1.5, dia: 16 }), at("bolt", legScrews, [0, -1, 0], "HUB", undefined, { len: 16, dia: 6, name: "Screw" })], tools: ["allen"] },
diff --git a/src/lib/plan/families/buskbo.ts b/src/lib/plan/families/buskbo.ts
new file mode 100644
index 0000000..fbc8e82
--- /dev/null
+++ b/src/lib/plan/families/buskbo.ts
@@ -0,0 +1,67 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * BUSKBO. The rattan armchair is sold assembled, with no manual: the round back and arms, the seat and the four
+ * legs with their stretchers are bound together in one piece. Its guide only unwraps it and puts the cushion in.
+ */
+
+/** A rattan hoop round the back and sides, open at the front: a U-shaped band seen from above (x, z from its middle). */
+function hoop(a: number, b: number, zFront: number, band: number): [number, number][] {
+ const n = 14;
+ const arc = (ra: number, rb: number) => Array.from({ length: n + 1 }, (_, i): [number, number] => {
+ const t = Math.PI + (i * Math.PI) / n; // from the left round the back to the right
+ return [Math.cos(t) * ra, Math.sin(t) * rb];
+ });
+ const out = arc(a, b), inn = arc(a - band, b - band).reverse();
+ return [[-a, zFront], ...out, [a, zFront], [a - band, zFront], ...inn, [-(a - band), zFront]];
+}
+
+function armchair(s: ProductSpec): CustomParams {
+ // IKEA: 72 wide, 63 deep, 75 high, seat 32 high, 12 free under it
+ const W = Math.round(s.size.w * 10) || 720, D = Math.round(s.size.d * 10) || 630, H = Math.round(s.size.h * 10) || 750;
+ const ySeat = 220, yRim = 300; // the seat frame, and the thick rim round it
+ const a = W / 2 - 15, b = D * 0.6, zc = -D / 2 + b; // the hoops' round back, centred towards the front
+ const c: Vec3 = [0, H / 2, 0];
+ const at = (x: number, y: number, z: number): Vec3 => [x, y - c[1], z];
+ const pieces: PartPiece[] = [
+ // the rim round the seat and the bands of the back and arms above it
+ { shape: "slab", size: [W, 30, D], pos: at(0, yRim, zc), outline: hoop(a, b, D / 2 - zc - 20, 30) },
+ ...[0, 1, 2, 3, 4, 5, 6, 7].map((k): PartPiece => {
+ const y = yRim + 70 + k * 48;
+ const f = Math.max(0, (k - 2) / 5); // the arms curve back towards the top
+ return { shape: "slab", size: [W, 14, D], pos: at(0, y, zc), outline: hoop(a - 10, b - 10, D / 2 - zc - 50 - f * 170, 14) };
+ }),
+ { shape: "slab", size: [W, 30, D], pos: at(0, H - 15, zc), outline: hoop(a, b, D / 2 - zc - 230, 30) },
+ // uprights at the back, binding the bands
+ ...[-0.45, 0, 0.45].map((t): PartPiece => ({ shape: "cyl", size: [32, H - yRim, 32], pos: at(Math.sin(t) * (a - 20), (H + yRim) / 2, zc - Math.cos(t) * (b - 20)) })),
+ // the front of the arms bending down to the rim
+ ...[-1, 1].map((g): PartPiece => ({ shape: "cyl", size: [34, 200, 34], pos: at(g * (a - 15), yRim + 100, D / 2 - 40) })),
+ // the seat frame inside the rim
+ { shape: "box", size: [W - 120, 24, D - 120], pos: at(0, ySeat, 10) },
+ // four splayed legs and the stretchers between them
+ ...[-1, 1].flatMap((gx) => [-1, 1].map((gz): PartPiece => ({ shape: "cyl", size: [34, yRim + 10, 34], pos: at(gx * (W / 2 - 110), (yRim + 10) / 2, gz * (D / 2 - 120)), rot: [gz * 0.14, 0, -gx * 0.12] }))),
+ ...[-1, 1].map((gz): PartPiece => ({ shape: "cyl", size: [24, W - 160, 24], pos: at(0, 90, gz * (D / 2 - 95)), rot: [0, 0, Math.PI / 2] })),
+ ...[-1, 1].map((gx): PartPiece => ({ shape: "cyl", size: [24, D - 200, 24], pos: at(gx * (W / 2 - 85), 90, 0), rot: [Math.PI / 2, 0, 0] })),
+ ];
+ const parts: CustomPart[] = [
+ { id: "A", name: "Armchair", size: [W, H, D], pos: [0, H / 2, 0], pieces, material: "wood" },
+ { id: "C", name: "Seat cushion", size: [W - 170, 110, D - 150], pos: [0, ySeat + 12 + 55, 25], material: "soft" },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Unwrap the armchair and stand it on its feet", detail: "It comes in one piece, with nothing to screw together. Check the four glides are on the feet.", add: ["A"] },
+ { title: "Put the cushion on the seat", detail: "Zip side to the back, pushed in under the arms.", add: ["C"], from: { C: [0, 300, 120] } },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["BUSKBO"],
+ recipe(s) {
+ if (/armchair/i.test(s.variant) || /buskbo-armchair/.test(s.slug ?? "")) return armchair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/busunge.ts b/src/lib/plan/families/busunge.ts
index be0c7e7..d870e03 100644
--- a/src/lib/plan/families/busunge.ts
+++ b/src/lib/plan/families/busunge.ts
@@ -77,6 +77,15 @@ function bed(s: ProductSpec): CustomParams {
return assemble(id, "Slatted base", bits, "wood");
};
parts.push(half("S0", zH, zH + railLen, 0), half("S1", zF, zF - railLen, 65));
+ // the plate joins the two slats, one from each half, that lie side by side nearest the middle
+ const slatsOf = (z0: number, z1: number, off: number) => {
+ const dir = Math.sign(z1 - z0), out: number[] = [];
+ for (let z = z0 + dir * (20 + off); dir > 0 ? z < z1 - 30 : z > z1 + 30; z += dir * 130) out.push(z);
+ return out;
+ };
+ const near = (zs: number[]) => zs.reduce((a, z) => (Math.abs(z) < Math.abs(a) ? z : a));
+ const z1J = near(slatsOf(zF, zF - railLen, 65));
+ const zJ = [near(slatsOf(zH, zH + railLen, 0).filter((z) => Math.abs(z - z1J) > 40)), z1J];
parts.push(box("B", "Centre beam", [-sx, sy - 50, -30], [sx, sy, 30], "wood"));
const lx = sx - 30;
parts.push(...[-1, 1].map((g, i) => box(`G${i}`, "Middle leg", [g * lx - 25, 0, -25], [g * lx + 25, sy - 50, 25], "wood")));
@@ -187,8 +196,8 @@ function bed(s: ProductSpec): CustomParams {
pose: "+y",
people: 2,
fix: [
- fix("plate", [[0, sy + st, 0]], [0, -1, 0], { name: "Joining plate", len: 3, dia: 60, on: "S0" }),
- fix("screw", [[0, sy + st, -50], [0, sy + st, 50]], [0, -1, 0], { len: 40, dia: 4 }),
+ fix("plate", [[0, sy + st, (zJ[0] + zJ[1]) / 2]], [0, -1, 0], { name: "Joining plate", len: 3, dia: 60, on: "S0" }),
+ ...zJ.map((z, i) => fix("screw", [[0, sy + st, z]], [0, -1, 0], { len: 16, dia: 4, on: `S${i}` })),
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/byas.ts b/src/lib/plan/families/byas.ts
index a9f7b58..d59710c 100644
--- a/src/lib/plan/families/byas.ts
+++ b/src/lib/plan/families/byas.ts
@@ -97,7 +97,8 @@ function drawerFits(d: Drawer, g: Geo) {
bolts: per((k, sd) => [{ on: d.front, at: [xs(k), BOX_Y + 85, g.zF], dir: [0, 0, 1], mate: sd, mateHole: 4 }]),
dowels: per((k, sd) => [{ on: d.front, at: [xs(k), BOX_Y + 30, g.zF], dir: [0, 0, 1], mate: sd }]),
cams: per((k, sd) => [{ on: sd, at: [d.cx + k * (d.bw / 2), BOX_Y + 85, g.zF - 28], dir: [-k, 0, 0] }]),
- ribbed: per((k, sd) => [{ on: sd, at: [d.cx + k * (d.bw / 2), BOX_Y + 60, g.zF - BOX_D + 8], dir: [-k, 0, 0], mate: d.back }]),
+ // driven in through the side: drawn from the joint, in the back's end and through the side
+ ribbed: per((k, sd) => [{ on: d.back, at: [d.cx + k * (d.bw / 2 - 16), BOX_Y + 60, g.zF - BOX_D + 8], dir: [-k, 0, 0], mate: sd }]),
runners: per((k, sd) => [{ on: sd, at: [xs(k), BOX_Y, zc], dir: UP, hole: false }]),
runnerScrews: per((k, sd) => [-120, 120].map((dz): FitOpts => ({ on: sd, at: [xs(k), BOX_Y, zc + dz], dir: UP }))),
grip: [{ on: d.front, at: [d.fz, fTop - 8, g.zF], dir: [0, 0, 1], hole: false }] as FitOpts[],
@@ -299,8 +300,9 @@ function benchRecipe(g: Geo): { parts: CustomPart[]; steps: CustomStep[] } {
title: "Screw the cabinet runners in",
detail: "One on each wall of the two outer compartments, marked L and R. Two screws each.",
fix: [
- fx("runner", [-1, 1].flatMap((sx) => [sideIn(sx), sx * (xv + T / 2)].map((x): Vec3 => [x, BOX_Y + 5, zc])), { name: "Cabinet runner", dir: [0, -1, 0], len: 330, dia: 20 }),
- fx("screw", [-1, 1].flatMap((sx) => [sideIn(sx), sx * (xv + T / 2)].flatMap((x) => [-120, 120].map((dz): Vec3 => [x, BOX_Y + 5, zc + dz]))), { dir: [0, -1, 0], len: 16, dia: 4 }),
+ // they lie on the bottom along each wall, screwed down into it
+ fx("runner", [-1, 1].flatMap((sx) => [sideIn(sx) - sx * 10, sx * (xv + T / 2 + 10)].map((x): Vec3 => [x, yB, zc])), { name: "Cabinet runner", dir: [0, -1, 0], len: 330, dia: 20 }),
+ fx("screw", [-1, 1].flatMap((sx) => [sideIn(sx) - sx * 10, sx * (xv + T / 2 + 10)].flatMap((x) => [-120, 120].map((dz): Vec3 => [x, yB + 4, zc + dz]))), { dir: [0, -1, 0], len: 16, dia: 4 }),
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/dalfred.ts b/src/lib/plan/families/dalfred.ts
new file mode 100644
index 0000000..3fb7833
--- /dev/null
+++ b/src/lib/plan/families/dalfred.ts
@@ -0,0 +1,152 @@
+import type { Family } from "./family";
+import type { PartPiece, ProductSpec, Vec3 } from "../../types";
+import type { FitOpts, HwDef, PlanBuilder } from "../builder";
+
+/**
+ * DALFRED bar stool, read from its manual. Four square legs are screwed to a round top hub and a lower hub, two at a
+ * time with two long screws each. Upside down, the footrest ring drops over the legs and four shorter screws go
+ * through it into the legs. The seat gets a steel plate with a socket screwed under it (five small screws), the frame
+ * stood up gets the nut housing on its top hub (four screws), the threaded spindle is tapped into the seat's socket,
+ * an end stop is tapped onto its other end, and the seat is screwed down into the frame. Turning the seat sets the
+ * height, 63 to 74 cm.
+ */
+
+const LONG: HwDef = { kind: "screw", len: 70, dia: 6, name: "Long screw" };
+const RING_SCREW: HwDef = { kind: "screw", len: 40, dia: 6 };
+const PLATE_SCREW: HwDef = { kind: "screw", len: 16, dia: 4 };
+const HOUSING_SCREW: HwDef = { kind: "screw", len: 25, dia: 4 };
+const END_STOP: HwDef = { kind: "cap", len: 20, dia: 30, name: "End stop" };
+
+const r = (n: number) => Math.round(n * 10) / 10;
+
+function stool(b: PlanBuilder, s: ProductSpec) {
+ // IKEA: 50 x 50 footprint, seat 30 across, 63 to 74 high; drawn a little above the lowest height
+ const foot = (s.size.w * 10 || 500) / 2 - 20;
+ const ySeat = 680, seatT = 30, seatD = 300;
+ const L = 38; // leg section
+ const yTopHub = 545, yLowHub = 415, yRing = 250, yLegTop = 580;
+ const rTop = 79; // leg centre at its top, from the middle
+ const lean = Math.atan2(foot - rTop, yLegTop);
+ const legR = (y: number) => rTop + ((yLegTop - y) / yLegTop) * (foot - rTop); // leg centre at a height
+
+ // the legs, in a cross: two along x, two along z
+ const dirs: [number, number][] = [
+ [1, 0],
+ [-1, 0],
+ [0, 1],
+ [0, -1],
+ ];
+ const legLen = Math.hypot(foot - rTop, yLegTop);
+ const legRef = b.part("Leg", [L, r(legLen), L], { material: "wood" });
+ const legs = dirs.map(([dx, dz]) => {
+ const rc = legR(yLegTop / 2);
+ const rot: Vec3 = dx ? [0, 0, dx * lean] : [-dz * lean, 0, 0];
+ return b.place(legRef, [r(dx * rc), yLegTop / 2, r(dz * rc)], rot);
+ });
+ const topHub = b.place(b.part("Top hub", [136, 50, 136], { material: "wood", shape: "cyl" }), [0, yTopHub, 0]);
+ const lowHub = b.place(b.part("Lower hub", [2 * (legR(yLowHub) - L / 2), 30, 2 * (legR(yLowHub) - L / 2)], { material: "wood", shape: "cyl" }), [0, yLowHub, 0]);
+
+ // the footrest ring, touching the inside faces of the legs
+ const tube = 16, R = legR(yRing) - L / 2 - tube / 2;
+ const seg: PartPiece[] = Array.from({ length: 16 }, (_, i) => {
+ const a = (i / 16) * Math.PI * 2;
+ return { shape: "cyl", size: [tube, r((2 * Math.PI * R) / 16 + 2), tube], pos: [r(R * Math.cos(a)), 0, r(R * Math.sin(a))], rot: [0, Math.PI / 2 - a, Math.PI / 2] };
+ });
+ const ringT = b.compound("Footrest ring", seg, { material: "metal" });
+ const ring = b.place(ringT.type, [ringT.mid[0], yRing + ringT.mid[1], ringT.mid[2]]);
+
+ // the seat, its plate and socket, the spindle, and the nut housing on the top hub
+ const seat = b.place(b.part("Seat", [seatD, seatT, seatD], { material: "wood", shape: "cyl" }), [0, ySeat - seatT / 2, 0]);
+ const yPlate = ySeat - seatT; // underside of the seat
+ const plateT = b.compound(
+ "Seat plate",
+ [
+ { shape: "cyl", size: [180, 8, 180], pos: [0, -4, 0] },
+ { shape: "cyl", size: [50, 40, 50], pos: [0, -28, 0] },
+ ],
+ { material: "metal" },
+ );
+ const plate = b.place(plateT.type, [plateT.mid[0], yPlate + plateT.mid[1], plateT.mid[2]]);
+ const ySpin0 = 300, ySpin1 = yPlate - 10;
+ const spindle = b.place(b.part("Threaded spindle", [28, ySpin1 - ySpin0, 28], { material: "metal", shape: "cyl" }), [0, (ySpin0 + ySpin1) / 2, 0]);
+ const yHub1 = yTopHub + 25;
+ const housingT = b.compound(
+ "Nut housing",
+ [
+ { shape: "cyl", size: [90, 5, 90], pos: [0, 2.5, 0] },
+ { shape: "cyl", size: [44, 50, 44], pos: [0, 30, 0] },
+ ],
+ { material: "metal" },
+ );
+ const housing = b.place(housingT.type, [housingT.mid[0], yHub1 + housingT.mid[1], housingT.mid[2]]);
+
+ // two long screws through each leg, from outside, into the top hub and the lower hub
+ const legScrews = (i: number): FitOpts[] => {
+ const [dx, dz] = dirs[i];
+ return [yTopHub, yLowHub].map((y) => {
+ const ro = legR(y) + L / 2 + 1;
+ return { on: legs[i], at: [r(dx * ro), y, r(dz * ro)] as Vec3, dir: [-dx, 0, -dz] as Vec3, mate: y === yTopHub ? topHub : lowHub };
+ });
+ };
+ const ringScrews: FitOpts[] = dirs.map(([dx, dz], i) => ({ on: ring, at: [r(dx * (R - tube / 2)), yRing, r(dz * (R - tube / 2))] as Vec3, dir: [dx, 0, dz] as Vec3, mate: legs[i] }));
+ // the seat and what goes under it are built on their own, upside down (the step's pose turns them over)
+ const here = (k: string): Vec3 => b.partItem(k).final.pos;
+ const around = (n: number, rad: number, y: number, a0 = 0): Vec3[] => Array.from({ length: n }, (_, i) => [r(rad * Math.cos(a0 + (i * 2 * Math.PI) / n)), y, r(rad * Math.sin(a0 + (i * 2 * Math.PI) / n))] as Vec3);
+
+ b.step({ title: "Screw two legs to the hubs", detail: "On a rug, the two hubs between the legs. Two long screws through each leg, one into each hub, with the Allen key.", kind: "screws", tools: ["allen"], pose: "+z", scene: "main", warnings: ["floor"] }, () => {
+ b.stagger(0.25);
+ b.add(topHub, [0, 0, 200]);
+ b.add(lowHub, [0, 0, 200]);
+ b.then(0.1);
+ b.add(legs[0], [200, 0, 0]);
+ b.add(legs[1], [-200, 0, 0]);
+ b.then(0.1);
+ b.fits(LONG, [...legScrews(0), ...legScrews(1)], 0.1);
+ });
+ b.step({ title: "Screw on the other two legs", detail: "The same way, across the first pair: two long screws each.", kind: "screws", tools: ["allen"], pose: "-y", scene: "main" }, () => {
+ b.stagger(0.25);
+ b.add(legs[2], [0, 0, 200]);
+ b.add(legs[3], [0, 0, -200]);
+ b.then(0.1);
+ b.fits(LONG, [...legScrews(2), ...legScrews(3)], 0.1);
+ });
+ b.step({ title: "Drop the footrest ring over the legs", detail: "With the frame upside down it slides down the legs until it sits against them. Four shorter screws through the ring into the legs.", kind: "screws", tools: ["allen"], pose: "-y", scene: "main" }, () => {
+ b.add(ring, [0, -300, 0]);
+ b.then(0.12);
+ b.fits(RING_SCREW, ringScrews, 0.1);
+ });
+ b.step({ title: "Tighten the screws in the lower hub", detail: "Give the four screws through the legs into the lower hub a last firm turn.", kind: "screws", tools: ["allen"], pose: "-y", scene: "main" }, () => {});
+
+ b.step({ title: "Screw the plate under the seat", detail: "Seat face down on a rug, the socket pointing up. Five small screws.", kind: "screws", tools: ["screwdriver"], pose: "-y", scene: "seat", warnings: ["floor"] }, () => {
+ b.stage(seat, here(seat), [0, 0, 0], [0, -160, 0]);
+ b.then(0.1);
+ b.stage(plate, here(plate), [0, 0, 0], [0, -160, 0]);
+ b.then(0.1);
+ b.fits(PLATE_SCREW, around(5, 70, yPlate - 8, Math.PI / 2).map((at): FitOpts => ({ on: plate, at, dir: [0, 1, 0], mate: seat })), 0.08);
+ });
+ b.step({ title: "Stand the frame up and screw on the nut housing", detail: "Over the hole in the top hub. Four screws through its flange.", kind: "screws", tools: ["screwdriver"], pose: "+y", scene: "main" }, () => {
+ b.add(housing, [0, 200, 0]);
+ b.then(0.1);
+ b.fits(HOUSING_SCREW, around(4, 35, yHub1 + 5, Math.PI / 4).map((at): FitOpts => ({ on: housing, at, dir: [0, -1, 0], mate: topHub })), 0.08);
+ });
+ b.step({ title: "Tap the spindle into the seat's socket", detail: "Smooth end first, with a hammer, until it stops.", kind: "general", tools: ["hammer"], pose: "-y", scene: "seat" }, () => {
+ b.stage(spindle, here(spindle), [0, 0, 0], [0, -200, 0]);
+ });
+ b.step({ title: "Tap the end stop onto the spindle", detail: "Onto its free end, with a rubber mallet or a hammer over a piece of wood. It stops the seat coming off.", kind: "general", tools: ["hammer"], pose: "-y", scene: "seat" }, () => {
+ b.fit(END_STOP, { on: spindle, at: [0, ySpin0, 0], dir: [0, 1, 0], hole: false });
+ });
+ b.step({ title: "Screw the seat into the frame", detail: "Spindle down into the nut housing, then turn the seat clockwise. Turn it on or back to set the height you want.", kind: "join", pose: "+y", scene: "main" }, () => {
+ b.stagger(0);
+ for (const k of [seat, plate, spindle]) b.add(k, [0, 300, 0], { spin: Math.PI * 2 });
+ });
+}
+
+const family: Family = {
+ names: ["DALFRED"],
+ build(b, s) {
+ if (!/bar stool/i.test(s.variant) && !/dalfred-bar-stool/.test(s.slug ?? "")) return false;
+ stool(b, s);
+ return true;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/docksta.ts b/src/lib/plan/families/docksta.ts
index c1ae205..c9fb284 100644
--- a/src/lib/plan/families/docksta.ts
+++ b/src/lib/plan/families/docksta.ts
@@ -45,7 +45,8 @@ function recipe(s: ProductSpec): CustomParams {
const yFlare = yPlate - 110;
const parts: CustomPart[] = [
stack("BP", "Base plate", [[BD - 40, 0, PT]], "metal"),
- stack("PO", "Pole", [[36, PT, yPlate + 6]], "metal"),
+ // a welded foot flange at the bottom of the pole takes the four bolts
+ stack("PO", "Pole", [[90, PT, PT + 8], [36, PT + 8, yPlate + 6]], "metal"),
// a low dome rising to a collar round the column
stack("BC", "Base cover", [[BD, 0, 16], ...profile(16, 96, 5, (t) => 50 + (BD / 2 - 50) * (1 - t) ** 2.2)], "board"),
// narrowest a little above the middle, wider at the foot
diff --git a/src/lib/plan/families/dubbla.ts b/src/lib/plan/families/dubbla.ts
new file mode 100644
index 0000000..2b7eaa4
--- /dev/null
+++ b/src/lib/plan/families/dubbla.ts
@@ -0,0 +1,48 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * DUBBLA laptop stand. IKEA sells it ready assembled (its page says so and has no assembly instructions): a white
+ * top with rounded corners on a steel scissor frame with a gas spring, a lever under the right-hand edge and felt
+ * pads under the feet. The guide unpacks it, sets the height and checks the pads; it's drawn at its lowest, 18 cm.
+ */
+
+const TUBE = 20;
+
+function stand(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10 || 600, D = s.size.d * 10 || 400, H = s.size.h * 10 || 180;
+ const TT = 18, yTop = H - TT;
+ const c: Vec3 = [0, yTop / 2, 0];
+ const xs = W / 2 - 110; // the two scissor pairs, in from the ends
+ const run = D - 120; // how far each bar reaches front to back
+ const rise = yTop - 30 - TUBE;
+ const len = Math.hypot(run, rise), a = Math.atan2(rise, run);
+ const frame: PartPiece[] = [
+ // a scissor of two crossed bars on each side
+ ...[-1, 1].flatMap((sx) => [-1, 1].map((k): PartPiece => ({ shape: "box", size: [TUBE, TUBE, len], pos: [sx * (xs + (k < 0 ? 0 : TUBE)), TUBE / 2 + rise / 2 + 6 - yTop / 2, 0], rot: [k * a, 0, 0] }))),
+ // the feet bars and the rails under the top, across the width
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "cyl", size: [TUBE, 2 * xs + 2 * TUBE + 20, TUBE], pos: [0, TUBE / 2 - yTop / 2, sz * (run / 2)], rot: [0, 0, Math.PI / 2] })),
+ { shape: "box", size: [2 * xs + 60, 22, run], pos: [0, yTop / 2 - 11, 0] },
+ // the lever under the right-hand edge
+ { shape: "box", size: [70, 12, 40], pos: [W / 2 - 40, yTop / 2 - 18, D / 2 - 60] },
+ ];
+ const r = 40;
+ const outline: [number, number][] = [[-W / 2, -D / 2], [W / 2, -D / 2], [W / 2, D / 2], [-W / 2, D / 2]];
+ return {
+ parts: [
+ { id: "F", name: "Scissor frame", size: [W, yTop, D], pos: c, pieces: frame, material: "metal" },
+ { id: "T", name: "Top", size: [W, TT, D], pos: [0, H - TT / 2, 0], pieces: [{ shape: "slab", size: [W, TT, D], pos: [0, 0, 0], outline, round: r }], material: "board" },
+ ],
+ steps: [
+ { title: "Unpack the stand", detail: "It comes ready assembled, so there is nothing to put together. Lift it out by the top, folded flat.", add: ["F", "T"], from: { T: [0, 0, 0] } },
+ { title: "Check the felt pads", detail: "One under each end of both foot bars. Press any loose one back on so the stand can't mark the table." },
+ { title: "Set the height", detail: "Hold the top with both hands, squeeze the lever under the right-hand edge and let the gas spring lift it, between 18 and 41 cm. Let go of the lever to lock it.", warnings: ["hand"] },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["DUBBLA"],
+ recipe: (s) => (/^dubbla-laptop-stand/.test(s.slug ?? "") ? stand(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/duvskar.ts b/src/lib/plan/families/duvskar.ts
index 5223b64..11c97c6 100644
--- a/src/lib/plan/families/duvskar.ts
+++ b/src/lib/plan/families/duvskar.ts
@@ -5,7 +5,7 @@ import type { CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3
* DUVSKÄR, read from the table's manual. The table comes folded, with no fittings: both leg frames are hinged to
* the underside of the top. Lying upside down on a rug, one pair of legs swings up and its brace is lifted into
* place, then the other pair swings up and the legs are pulled apart until the brace clicks and locks. The chair
- * is sold ready to use, with no manual, so it keeps its old guide.
+ * is sold welded and ready to use, with no manual: its guide only unpacks it and checks it stands steady.
*/
const TUBE = 22;
@@ -86,11 +86,50 @@ function table(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/** The stacking chair: one welded steel frame with a perforated seat and back. */
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 49 wide, 57 deep, 80 high, seat 46 high, 48 wide and 46 deep
+ const W = s.size.w * 10 || 490, D = s.size.d * 10 || 570, H = s.size.h * 10 || 800;
+ const yS = 460, sw = 480, sd = 440;
+ const xl = W / 2 - TUBE / 2 - 10, zf = D / 2 - TUBE / 2 - 30, zb = -D / 2 + TUBE / 2 + 30;
+ const zs0 = zf - sd + 40; // back edge of the seat
+ const segs: [Vec3, Vec3][] = [
+ // front legs up to the seat, back legs up past it to the back
+ [[-xl, 0, zf], [-xl, yS - 20, zf - 20]],
+ [[xl, 0, zf], [xl, yS - 20, zf - 20]],
+ [[-xl, 0, zb], [-xl, yS - 20, zs0]],
+ [[xl, 0, zb], [xl, yS - 20, zs0]],
+ [[-xl, yS - 20, zs0], [-xl, H - 60, zs0 - 90]],
+ [[xl, yS - 20, zs0], [xl, H - 60, zs0 - 90]],
+ // the rails under the seat
+ [[-xl, yS - 20, zf - 20], [-xl, yS - 20, zs0]],
+ [[xl, yS - 20, zf - 20], [xl, yS - 20, zs0]],
+ ];
+ const f = frame("F", "Chair frame", segs);
+ const c = f.pos;
+ // the back follows the back legs' lean, between them
+ const rise = H - 60 - (yS - 20);
+ const backY = (yS + 60 + H) / 2, backZ = zs0 - (90 * (backY - (yS - 20))) / rise;
+ f.pieces = [
+ ...f.pieces!,
+ { shape: "slab", size: [sw, 8, sd], pos: [0, yS - 4 - c[1], (zf + zs0) / 2 - 10 - c[2]], outline: [[-sw / 2, -sd / 2], [sw / 2, -sd / 2], [sw / 2 - 20, sd / 2], [-sw / 2 + 20, sd / 2]], round: 60, material: "metal" },
+ { shape: "box", size: [sw - 40, H - yS - 100, 8], pos: [0, backY - c[1], backZ - c[2]], rot: [Math.atan2(-90, rise), 0, 0], material: "metal" },
+ ];
+ return {
+ parts: [f],
+ steps: [
+ { title: "Take the chair out of its packaging", detail: "It comes ready to use: the frame, seat and back are welded in one piece. Nothing to screw together.", add: ["F"] },
+ { title: "Check it stands steady", detail: "Stand it on a flat floor and press on the seat. Chairs of the same kind stack on top of each other." },
+ ],
+ };
+}
+
const family: Family = {
names: ["DUVSKÄR", "DUVSKAR"],
recipe(s) {
if (/table/i.test(s.variant)) return table(s);
- return null; // the chair comes ready to use
+ if (/chair/i.test(s.variant)) return chair(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/ekedalen.ts b/src/lib/plan/families/ekedalen.ts
new file mode 100644
index 0000000..3142e7c
--- /dev/null
+++ b/src/lib/plan/families/ekedalen.ts
@@ -0,0 +1,135 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * EKEDALEN, read from IKEA's manuals (the products are no longer sold in the UK or US; their manuals still are).
+ *
+ * Chair: built upside down on a rug. The front rail's corner blocks are bolted up into the two side rails (barrel
+ * nuts), the front legs are pushed onto the blocks' dowel holes and locked with a turn-in connector each. The back
+ * frame lies on its back, the back rail is bolted to its legs, the front half is lowered onto it and its side rails
+ * locked with two more connectors. The upholstered seat takes four clips, is pressed in from below, a stop is
+ * screwed in at the back and the clips are pushed until they click.
+ */
+
+const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const shift = (ps: PartPiece[], c: Vec3): PartPiece[] => ps.map((p) => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] as Vec3 }));
+
+/* ---------------------------------------------------------------- chair */
+
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 45 wide, 51 deep, 95 high, seat 47 high
+ const W = Math.round(s.size.w * 10) || 450, D = Math.round(s.size.d * 10) || 510, H = Math.round(s.size.h * 10) || 950;
+ const L = 40; // legs, square
+ const yR0 = 400, yR1 = 470; // the side rails and the back rail, the seat sits on them
+ const yB0 = 330; // the front corner blocks, under the side rails
+ const xl = W / 2 - L / 2, zf = D / 2 - L / 2, zb = -D / 2 + L / 2;
+ const bz0 = -D / 2 + L, bz1 = bz0 + 45; // the back rail, its ends in front of the back legs
+ const xr = W / 2 - 11; // side rails, 22 thick
+ const g2 = [-1, 1];
+ const side = (g: number) => (g < 0 ? "0" : "1");
+
+ // back frame: two legs up into the backrest, a curved bottom rail, vertical slats and a top rail
+ const cBF: Vec3 = [0, H / 2, zb + 10];
+ const back: PartPiece[] = [
+ ...g2.map((g): PartPiece => ({ shape: "box", size: [L, H, L], pos: [g * xl, H / 2, zb] })),
+ { shape: "box", size: [2 * xl - L, 70, 24], pos: [0, H - 45, zb + 4] },
+ { shape: "box", size: [2 * xl - L, 60, 24], pos: [0, yR1 + 110, zb + 4] },
+ ...[-2, -1, 0, 1, 2].map((k): PartPiece => ({ shape: "box", size: [28, H - 80 - (yR1 + 140), 14], pos: [k * ((2 * xl - L) / 6), (H - 80 + yR1 + 140) / 2, zb + 2] })),
+ ];
+ const cF: Vec3 = [0, (yB0 + yR0) / 2, zf];
+ const front: PartPiece[] = [
+ { shape: "box", size: [2 * xl - L, yR0 - yB0, 22], pos: [0, (yB0 + yR0) / 2, D / 2 - 11] },
+ ...g2.map((g): PartPiece => ({ shape: "box", size: [L, yR0 - yB0, L], pos: [g * xl, (yB0 + yR0) / 2, zf] })),
+ ];
+ const parts: CustomPart[] = [
+ { id: "F", name: "Front rail", size: [W, yR0 - yB0, L], pos: cF, pieces: shift(front, cF), material: "wood" },
+ ...g2.map((g): CustomPart => ({ id: `R${side(g)}`, name: "Side rail", size: [22, yR1 - yR0, D / 2 - bz1], pos: [g * xr, (yR0 + yR1) / 2, (D / 2 + bz1) / 2], material: "wood" })),
+ ...g2.map((g): CustomPart => ({ id: `L${side(g)}`, name: "Front leg", size: [L, yB0, L], pos: [g * xl, yB0 / 2, zf], material: "wood" })),
+ { id: "B", name: "Back frame", size: [W, H, L + 20], pos: cBF, pieces: shift(back, cBF), material: "wood" },
+ { id: "K", name: "Back rail", size: [W, yR1 - yR0, bz1 - bz0], pos: [0, (yR0 + yR1) / 2, (bz0 + bz1) / 2], material: "wood" },
+ { id: "S", name: "Seat", size: [W - 10, 45, D - L - 5], pos: [0, yR1 + 22.5, (L + 5) / 2], material: "soft" },
+ ];
+ const steps: CustomStep[] = [
+ {
+ title: "Bolt the front rail to the side rails",
+ detail: "Lay the parts upside down on a rug. A barrel nut in each side rail, slot towards the hole, then a long bolt through each corner block into it.",
+ add: ["F", "R0", "R1"],
+ fix: [
+ ...g2.map((g) => fx("nut", [[g * (xr + 11), yR0 + 35, zf]], [-g, 0, 0], { name: "Barrel nut", len: 14, dia: 10, on: `R${side(g)}` })),
+ fx("bolt", g2.map((g): Vec3 => [g * xl + g * 4, yB0, zf]), [0, 1, 0], { len: 100, dia: 6, on: "F" }),
+ ],
+ tools: ["flathead", "allen"],
+ pose: "-y",
+ warnings: ["floor"],
+ },
+ {
+ title: "Push the front legs onto the corner blocks",
+ detail: "The thick dowel goes in the big hole, the thin one in the small hole. Push them all the way in.",
+ add: ["L0", "L1"],
+ },
+ {
+ title: "Lock the front legs",
+ detail: "Hook a connector into the slot on the inside of each leg and turn it tight with the Allen key.",
+ fix: g2.map((g) => fx("connector", [[g * (xl - L / 2), yB0 - 40, zf]], [g, 0, 0], { name: "Leg connector", len: 30, dia: 14, on: `L${side(g)}` })),
+ tools: ["allen"],
+ },
+ {
+ title: "Bolt the back rail to the back legs",
+ detail: "Lay the back frame on its back on the rug. A barrel nut in each back leg, then a bolt through each end of the rail into it.",
+ fix: [
+ ...g2.map((g) => fx("nut", [[g * (xl + L / 2), (yR0 + yR1) / 2, zb]], [-g, 0, 0], { name: "Barrel nut", len: 14, dia: 10, on: "B" })),
+ fx("bolt", g2.map((g): Vec3 => [g * (xl + 4), (yR0 + yR1) / 2, bz1]), [0, 0, -1], { len: 70, dia: 6, on: "K" }),
+ ],
+ tools: ["flathead", "allen"],
+ pose: "+z",
+ wait: ["B", "K"],
+ from: { B: [-650, 0, 0], K: [-650, 0, 0] },
+ },
+ {
+ title: "Join the two halves",
+ detail: "Lower the front half onto the back frame so the dowels in the ends of the side rails go into the back rail.",
+ add: ["B", "K"],
+ from: { B: [0, 0, -250], K: [0, 0, -250] },
+ },
+ {
+ title: "Lock the side rails",
+ detail: "One connector on the inside of each rail, hooked in and turned tight like the front ones.",
+ fix: g2.map((g) => fx("connector", [[g * (xr - 11), (yR0 + yR1) / 2, bz1 + 40]], [g, 0, 0], { name: "Leg connector", len: 30, dia: 14, on: `R${side(g)}` })),
+ tools: ["allen"],
+ },
+ {
+ title: "Push the clips into the seat",
+ detail: "Lay the seat face down. One clip in each pair of holes near the corners, its hook towards the edge.",
+ fix: [fx("clip", g2.flatMap((gx) => g2.map((gz): Vec3 => [gx * (xr - 50), yR1, (L + 5) / 2 + gz * ((D - L) / 2 - 80)])), [0, 1, 0], { name: "Seat clip", len: 30, dia: 20, on: "S" })],
+ wait: ["S"],
+ from: { S: [-650, 0, 0] },
+ },
+ {
+ title: "Press the frame down onto the seat",
+ detail: "Hold the chair upside down over the seat and push it down so the clips go in between the rails.",
+ add: ["S"],
+ pose: "-y",
+ from: { S: [0, 220, 0] },
+ },
+ {
+ title: "Screw the seat stop on at the back",
+ detail: "Its flat side against the back rail, one screw.",
+ fix: [
+ fx("clip", [[0, yR1 + 4, bz1 + 12]], [0, -1, 0], { name: "Seat stop", len: 20, dia: 24, on: "K" }),
+ fx("screw", [[0, yR1, bz1 - 22]], [0, -1, 0], { len: 16, dia: 4, on: "K" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the clips shut", detail: "Push each of the four clips over the rail until it clicks. Then turn the chair the right way up.", pose: "+y" },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["EKEDALEN"],
+ recipe(s) {
+ if (s.archetype === "seat" && /chair/i.test(s.variant)) return chair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/ekenabben.ts b/src/lib/plan/families/ekenabben.ts
index 4bdff16..4c35133 100644
--- a/src/lib/plan/families/ekenabben.ts
+++ b/src/lib/plan/families/ekenabben.ts
@@ -48,14 +48,14 @@ function shelving(s: ProductSpec): CustomParams {
const rails = (sx: number) => Array.from({ length: n }, (_, k) => `R${fr(sx)}${k}`);
const posts = (sx: number, sz?: number) => (sz === undefined ? [-1, 1] : [sz]).map((z) => `P${fr(sx)}${z < 0 ? "b" : "f"}`);
const railEnds = (sx: number, sz: number, dy: number) => Array.from({ length: n }, (_, k) => [sx * xp, yTop(k) - RH / 2 + dy, sz * (zp - P / 2)] as Vec3);
- const shelfBolts = (sx: number, sz: number) => Array.from({ length: n }, (_, k) => [sx * (xp + 14), yTop(k) - RH / 2, sz * (Z - 70)] as Vec3);
+ const shelfBolts = (sx: number, sz: number) => Array.from({ length: n }, (_, k) => [sx * (xp + 14), yTop(k) - 9, sz * (Z - 70)] as Vec3);
const steps: CustomStep[] = [
{
title: "Tap dowels into both ends of every rail",
detail: "Two in each end of the ten rails.",
add: [...rails(-1), ...rails(1)],
- fix: sides.flatMap((sx) => [-1, 1].map((sz) => at("dowel", [...railEnds(sx, sz, -9), ...railEnds(sx, sz, 9)], [0, 0, -sz], undefined, undefined, { len: 30, dia: 8 }))),
+ fix: sides.flatMap((sx) => [-1, 1].map((sz) => at("dowel", [...railEnds(sx, sz, -12), ...railEnds(sx, sz, 12)], [0, 0, -sz], undefined, undefined, { len: 30, dia: 8 }))),
tools: ["hammer"],
},
{
@@ -73,15 +73,17 @@ function shelving(s: ProductSpec): CustomParams {
},
{
title: "Bolt the shelves to one ladder",
- detail: "Lay one ladder flat and stand the five shelves on it. One bolt through the rail into each shelf, at the front.",
+ detail: "Slide the five shelves in between the ladders, white side up, ends on the rails. One bolt through the rail into each shelf, at the front.",
add: Array.from({ length: n }, (_, k) => `S${k}`),
+ // in from the front, between the two ladders, so they don't pass through the rails
+ from: Object.fromEntries(Array.from({ length: n }, (_, k) => [`S${k}`, [0, 0, 500] as Vec3])),
fix: [at("bolt", shelfBolts(-1, 1), [1, 0, 0], undefined, undefined, BOLT)],
tools: ["allen"],
},
{ title: "Bolt the back of the shelves", detail: "Five more bolts at the back of the same ladder.", fix: [at("bolt", shelfBolts(-1, -1), [1, 0, 0], undefined, undefined, BOLT)], tools: ["allen"] },
{
- title: "Turn it over and bolt the other ladder on",
- detail: "Lay the second ladder on top, holes over the shelf ends, and ten bolts through it.",
+ title: "Turn it over and bolt the other ladder",
+ detail: "Ten bolts through the second ladder's rails into the shelf ends.",
fix: [at("bolt", [...shelfBolts(1, 1), ...shelfBolts(1, -1)], [-1, 0, 0], undefined, undefined, BOLT)],
pose: "-x",
tools: ["allen"],
@@ -138,7 +140,7 @@ function cabinet(s: ProductSpec): CustomParams {
title: "Tap dowels into the ends of the rails",
detail: "Two in each end of all four rails.",
add: ["RT0", "RL0", "RT1", "RL1"],
- fix: sides.flatMap((sx) => [yb + 20, H - 20].flatMap((y) => [-1, 1].map((sz) => at("dowel", [railEnds(sx, y, -9)[sz < 0 ? 0 : 1], railEnds(sx, y, 9)[sz < 0 ? 0 : 1]], [0, 0, -sz], undefined, undefined, { len: 30, dia: 8 })))),
+ fix: sides.flatMap((sx) => [yb + 20, H - 20].flatMap((y) => [-1, 1].map((sz) => at("dowel", [railEnds(sx, y, -12)[sz < 0 ? 0 : 1], railEnds(sx, y, 12)[sz < 0 ? 0 : 1]], [0, 0, -sz], undefined, undefined, { len: 30, dia: 8 })))),
tools: ["hammer"],
},
{
@@ -152,7 +154,8 @@ function cabinet(s: ProductSpec): CustomParams {
{
title: "Screw each top corner",
detail: "One screw through the top rail into each post. Use the shorter screws with the coarse thread.",
- fix: sides.map((sx) => at("screw", [-1, 1].map((sz) => [sx * xp, H, sz * zp] as Vec3), [0, -1, 0], `RT${fr(sx)}`, undefined, SCREW)),
+ // a little out from the post's middle, clear of the rail's dowels
+ fix: sides.flatMap((sx) => [-1, 1].map((sz) => at("screw", [[sx * xp, H, sz * (zp + 6)]], [0, -1, 0], `P${fr(sx)}${sz < 0 ? "b" : "f"}`, undefined, SCREW))),
tools: ["allen"],
},
{ title: "Screw a foot into each post", detail: "Into the bottom end, by hand.", fix: [at("foot", sides.flatMap((sx) => [-1, 1].map((sz) => [sx * xp, 0, sz * zp] as Vec3)), [0, 1, 0], undefined, undefined, FOOT)] },
@@ -165,6 +168,7 @@ function cabinet(s: ProductSpec): CustomParams {
],
tools: ["screwdriver"],
pose: "+y",
+ wait: ["BT"],
},
{ title: "Click the push openers in", detail: "Push each one into its holder until it clicks, plunger to the front.", fix: [at("clip", [-60, 60].map((x) => [x, yb + 40, Z - 30] as Vec3), [0, 0, -1], "BT", undefined, { name: "Push opener", len: 50, dia: 16 })] },
{
diff --git a/src/lib/plan/families/ekero.ts b/src/lib/plan/families/ekero.ts
new file mode 100644
index 0000000..57d79f8
--- /dev/null
+++ b/src/lib/plan/families/ekero.ts
@@ -0,0 +1,104 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * EKERÖ armchair, read from its manual: three upholstered pieces (two armrests and the seat with its back) joined
+ * on threaded rods. Two rods go into each armrest, the chair is built lying on its side with its underside towards
+ * you (one armrest on the floor, the seat frame lowered onto its rods, a guide pin, the other armrest on top), then
+ * two bolts and four nuts hold it, the front legs are screwed on by their plates and the back legs turned in by
+ * hand. Stood up, the back cushion goes in last.
+ */
+function armchair(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 700, H = Math.round(s.size.h * 10) || 730, D = Math.round(s.size.d * 10) || 730;
+ const leg = 170, armT = 105, armY = 600, seatY = 430;
+ const hx = W / 2, ix = hx - armT; // the armrests' inner faces
+ const zb = -D / 2 + 125; // the front of the back
+ const arm = (id: string, sx: -1 | 1): CustomPart => ({
+ id,
+ name: "Armrest",
+ size: [armT, armY - leg, D],
+ pos: [sx * (hx - armT / 2), (leg + armY) / 2, 0],
+ material: "soft",
+ });
+ // the seat frame is open underneath: two side boards, a front rail and the seat deck, with the back behind
+ const fh = H - 90;
+ const frame: CustomPart = {
+ id: "F",
+ name: "Seat and back",
+ size: [2 * ix, fh - leg, D],
+ pos: [0, (leg + fh) / 2, 0],
+ material: "soft",
+ pieces: [
+ ...[-1, 1].map((sx) => ({ shape: "box" as const, size: [20, seatY - leg, D - 125] as Vec3, pos: [sx * (ix - 10), (seatY + leg) / 2 - (leg + fh) / 2, 62.5] as Vec3 })),
+ { shape: "box", size: [2 * ix - 40, seatY - leg, 25], pos: [0, (seatY + leg) / 2 - (leg + fh) / 2, D / 2 - 12.5] },
+ { shape: "box", size: [2 * ix - 40, 50, D - 150], pos: [0, seatY - 25 - (leg + fh) / 2, 50] },
+ { shape: "box", size: [2 * ix, fh - leg, 125], pos: [0, 0, -D / 2 + 62.5] },
+ ],
+ };
+ const lx = hx - armT / 2, lz = D / 2 - 45;
+ const frontLeg = (id: string, sx: -1 | 1): CustomPart => ({
+ id,
+ name: "Front leg",
+ size: [70, leg, 70],
+ pos: [sx * lx, leg / 2, lz - 10],
+ material: "metal",
+ pieces: [
+ { shape: "cyl", size: [28, leg - 6, 28], pos: [0, -3, 0] },
+ { shape: "box", size: [70, 6, 70], pos: [0, leg / 2 - 3, 0] },
+ ],
+ });
+ const backLeg = (id: string, sx: -1 | 1): CustomPart => ({ id, name: "Back leg", size: [28, leg, 28], pos: [sx * lx, leg / 2, -lz], shape: "cyl", material: "metal" });
+ const cushion: CustomPart = { id: "K", name: "Back cushion", size: [2 * ix - 20, H - seatY - 10, 150], pos: [0, (H + seatY + 10) / 2, zb + 75], material: "soft" };
+ const parts = [arm("AL", -1), arm("AR", 1), frame, frontLeg("L1", -1), frontLeg("L2", 1), backLeg("L3", -1), backLeg("L4", 1), cushion];
+
+ const rodZ = [-60, D / 2 - 140], rodY = 230;
+ const rods = (sx: -1 | 1) => ({ kind: "stud" as const, count: 2, at: rodZ.map((z) => [sx * ix, rodY, z] as Vec3), dir: [-sx, 0, 0] as Vec3, on: sx < 0 ? "AL" : "AR", mate: "F", len: 90, dia: 8, name: "Threaded rod" });
+ const nutDirs = (kind: "washer" | "nut") =>
+ ([-1, 1] as const).map((sx) => ({ kind, count: 2, at: rodZ.map((z) => [sx * (ix - 20), rodY, z] as Vec3), dir: [sx, 0, 0] as Vec3, on: "F", ...(kind === "nut" ? { len: 6, dia: 10 } : { len: 1.5, dia: 16 }) }));
+ const boltAt = ([-1, 1] as const).map((sx) => [sx * (ix - 20), 330, D / 2 - 80] as Vec3);
+ const plate = (sx: -1 | 1) => [-20, 20].map((dz) => [sx * lx + dz, leg - 6, lz - 10 + dz] as Vec3);
+ const steps: CustomStep[] = [
+ {
+ title: "Turn two threaded rods into each armrest",
+ detail: "Lay the armrests on a soft surface, inside face up. Screw the rods in by hand until they stop.",
+ add: ["AL"],
+ wait: ["AR"],
+ fix: [rods(-1), rods(1)],
+ pose: "+x",
+ warnings: ["floor"],
+ },
+ { title: "Lower the seat onto the rods", detail: "One armrest lies on the floor. Lower the seat and back onto its rods, the open underside towards you.", add: ["F"], from: { F: [420, 0, 0] } },
+ { title: "Push the guide pin into the seat", detail: "Into the hole at the front, so the second armrest lines up.", fix: [{ kind: "stud", count: 1, at: [[ix, seatY - 60, D / 2 - 40]], dir: [-1, 0, 0], on: "F", mate: "AR", len: 40, dia: 8, name: "Guide pin" }] },
+ { title: "Lower the other armrest on", detail: "Onto the rods and the pin, until it lies flat against the seat.", add: ["AR"], from: { AR: [420, 0, 0] } },
+ {
+ title: "Bolt the front of the seat to the armrests",
+ detail: "One bolt with a washer on each side, from inside the frame. Tighten them with the spanner.",
+ fix: [
+ ...([-1, 1] as const).map((sx, i) => ({ kind: "washer" as const, count: 1, at: [boltAt[i]], dir: [sx, 0, 0] as Vec3, on: "F", len: 1.5, dia: 16 })),
+ ...([-1, 1] as const).map((sx, i) => ({ kind: "bolt" as const, count: 1, at: [boltAt[i]], dir: [sx, 0, 0] as Vec3, on: "F", mate: sx < 0 ? "AL" : "AR", len: 50, dia: 8, name: "Hex bolt" })),
+ ],
+ tools: ["wrench"],
+ },
+ { title: "Put a washer and a nut on each rod", detail: "Four, inside the frame. Tighten them with the spanner.", fix: [...nutDirs("washer"), ...nutDirs("nut")], tools: ["wrench"] },
+ {
+ title: "Screw the front legs on",
+ detail: "Each leg's plate goes under the front of an armrest, with two bolts through it.",
+ add: ["L1", "L2"],
+ fix: ([-1, 1] as const).map((sx) => ({ kind: "bolt" as const, count: 2, at: plate(sx), dir: [0, 1, 0] as Vec3, on: sx < 0 ? "L1" : "L2", mate: sx < 0 ? "AL" : "AR", len: 30, dia: 6 })),
+ from: { L1: [0, -250, 0], L2: [0, -250, 0] },
+ tools: ["allen"],
+ },
+ { title: "Turn the back legs in", detail: "Screw them into the back corners by hand until they sit tight.", add: ["L3", "L4"], from: { L3: [0, -250, 0], L4: [0, -250, 0] } },
+ { title: "Stand it up and put the back cushion in", detail: "Lift the chair onto its legs, then press the cushion down behind the seat.", add: ["K"], pose: "+y", from: { K: [0, 300, 0] } },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["EKERÖ", "EKERO"],
+ recipe(s) {
+ if (/^ekero-armchair/.test(s.slug ?? "")) return armchair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/eket.ts b/src/lib/plan/families/eket.ts
index f722f07..6c8de40 100644
--- a/src/lib/plan/families/eket.ts
+++ b/src/lib/plan/families/eket.ts
@@ -460,7 +460,7 @@ function mediaFlap(g: G, o: Inner) {
});
const plate = (sx: number): CustomFix[] => [
fx("clip", sx < 0 ? "L" : "R", [[sx * (W / 2 - t - 3), hy, D / 2 - 40]], [sx, 0, 0], { name: sx < 0 ? "Hinge plate, left" : "Hinge plate, right", len: 6, dia: 40 }),
- fx("screw", sx < 0 ? "L" : "R", [-12, 12].map((dz) => [sx * (W / 2 - t - 6), hy, D / 2 - 40 + dz] as Vec3), [sx, 0, 0], { len: 14, dia: 4 }),
+ fx("screw", sx < 0 ? "L" : "R", [-24, 24].map((dy) => [sx * (W / 2 - t - 6), hy + dy, D / 2 - 40] as Vec3), [sx, 0, 0], { len: 14, dia: 4 }),
];
o.steps.push({
title: "Screw the hinge plates inside the sides",
diff --git a/src/lib/plan/families/ekholma.ts b/src/lib/plan/families/ekholma.ts
index 2558844..7e15854 100644
--- a/src/lib/plan/families/ekholma.ts
+++ b/src/lib/plan/families/ekholma.ts
@@ -258,7 +258,8 @@ function sofaBed(s: ProductSpec): CustomParams {
at.map((p): CustomFix => ({ kind: "bolt", count: 1, len, dia: 8, at: [p], dir: dir(p), on: on(p), mate: mate?.(p) })).slice(0, n);
const sideOf = (p: Vec3) => (p[0] < 0 ? "armL" : "armR");
const inward = (p: Vec3): Vec3 => [p[0] < 0 ? 1 : -1, 0, 0];
- const rodBolts = (sx: number) => rz.flatMap((z, i) => [[0, 40], [-35, -20], [35, -20]].map(([dz, dy]) => [inner(sx), 75 + dy, z + dz] as Vec3).map((p) => ({ p, i })));
+ const rodBolts = (sx: number) => rz.flatMap((z, i) => // the plate's three bolts sit above the rod, where the armrest is (its foot ends at the legs)
+ [[0, 45], [-35, 12], [35, 12]].map(([dz, dy]) => [inner(sx), 75 + dy, z + dz] as Vec3).map((p) => ({ p, i })));
return {
parts,
steps: [
diff --git a/src/lib/plan/families/enhet.ts b/src/lib/plan/families/enhet.ts
index 24221b6..4ae6f67 100644
--- a/src/lib/plan/families/enhet.ts
+++ b/src/lib/plan/families/enhet.ts
@@ -439,7 +439,7 @@ function buildCabinet(b: PlanBuilder, s: ProductSpec, o: CabOpts) {
bottom = b.place(b.part("Bottom panel", [iw, PT, inD]), [0, PT / 2, D / 2 - inD / 2]);
} else {
strips.push(b.place(b.part("Front rail", [iw, PT, front]), [0, PT / 2, D / 2 - front / 2]));
- if (o.bottom === "strips") backStrip = b.place(b.part("Back rail", [iw, 90, PT]), [0, 45, D / 2 - inD + PT / 2 + 40]);
+ if (o.bottom === "strips") backStrip = b.place(b.part("Back rail", [iw, 90, PT]), [0, PT + 4 + 45, D / 2 - inD + PT / 2 + 40]); // sits on the rods
}
railTop = b.place(b.part("Top rail", [iw, 30, 20], { material: "metal" }), [0, H - 15, D / 2 - 30]);
} else {
@@ -512,7 +512,7 @@ function buildCabinet(b: PlanBuilder, s: ProductSpec, o: CabOpts) {
const sx = sd === "L" ? -1 : 1, on = sd === "L" ? sideL : sideR;
const zc = D / 2 - inD / 2;
runners.push({ on, at: [sx * xi, runnerY(d), zc], dir: [sx, 0, 0], hole: false });
- for (const z of [-inD / 3, inD / 3]) screws.push({ on, at: [sx * (xi - 12), runnerY(d), zc + z], dir: [sx, 0, 0], hole: false });
+ for (const z of [-inD / 3, inD / 3]) screws.push({ on, at: [sx * (xi - 6), runnerY(d), zc + z], dir: [sx, 0, 0], hole: false });
}
return { runners, screws };
};
@@ -616,11 +616,12 @@ function buildCabinet(b: PlanBuilder, s: ProductSpec, o: CabOpts) {
if (o.bottom === "strips" && backStrip) {
step(b, {
title: "Fit the back rail low at the back",
- detail: "Turn the two connecting screws into the sides and one into the rail, then slide the rail down onto them.",
+ detail: "Turn the two connecting screws into the rods at the bottom of the sides, then slide the rail down onto them.",
tools: ["screwdriver"],
}, () => {
const bs = b.partItem(backStrip!).final.pos;
- b.fits(HW.camScrew, [-1, 1].map((sx): FitOpts => ({ on: sx < 0 ? sideL : sideR, at: [sx * xi, bs[1], bs[2]], dir: [sx, 0, 0] })), 0.12);
+ // they stand up out of the rods in the bottom edges, and the rail drops onto them
+ b.fits(HW.camScrew, [-1, 1].map((sx): FitOpts => ({ on: sx < 0 ? sideL : sideR, at: [sx * (iw / 2 - 30), bs[1] - 45, bs[2]], dir: [0, -1, 0] })), 0.12);
b.then(0.1);
b.add(backStrip!, [0, 260, 0]);
});
@@ -699,7 +700,7 @@ function buildCabinet(b: PlanBuilder, s: ProductSpec, o: CabOpts) {
detail: "Push its dowels into the side, at the back under the top.",
pose: "-z",
kind: "join",
- }, () => b.add(wallRail!, [0, 0, -200]));
+ }, () => b.add(wallRail!, [200, 0, 0]));
step(b, {
title: "Click the bottom onto the side",
detail: "Hook it into the slots and press until it clicks.",
diff --git a/src/lib/plan/families/enkroken.ts b/src/lib/plan/families/enkroken.ts
index 1afdc9a..820e958 100644
--- a/src/lib/plan/families/enkroken.ts
+++ b/src/lib/plan/families/enkroken.ts
@@ -11,6 +11,8 @@ import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3
*/
const TUBE = 25, RAIL = 22, TOP = 18;
+// the back rails are flat oval tubes, deeper than tall, with two bolt holes side by side at each end
+const OVAL = 20, OVAL_D = 34;
/** A round tube from a to b, as a piece of a part centred at c. */
function tube(a: Vec3, b: Vec3, c: Vec3, dia = RAIL): PartPiece {
@@ -47,8 +49,9 @@ function desk(s: ProductSpec): CustomParams {
});
}
const railL = 2 * lx - TUBE;
- const rail = (id: string, y: number): CustomPart => ({ id, name: "Back rail", shape: "cyl", size: [RAIL, railL, RAIL], pos: [0, y, -lz], rot: [0, 0, Math.PI / 2], material: "metal" });
- parts.push(rail("BH", yHi), rail("BL", yLo));
+ const yB = yLeg - OVAL / 2; // the upper back rail sits right under the top
+ const rail = (id: string, y: number): CustomPart => ({ id, name: "Back rail", shape: "cyl", size: [OVAL, railL, OVAL_D], pos: [0, y, -lz], rot: [0, 0, Math.PI / 2], material: "metal" });
+ parts.push(rail("BH", yB), rail("BL", yLo));
parts.push({ id: "T", name: "Desk top", size: [W, TOP, D], pos: [0, H - TOP / 2, 0], material: "board" });
// drawer at the front right, hanging on two runners
@@ -74,13 +77,13 @@ function desk(s: ProductSpec): CustomParams {
// two bolts through each back leg into the end of a back rail
const ends = (sx: number): CustomFix[] =>
(["BH", "BL"] as const).map((r) => {
- const y = r === "BH" ? yHi : yLo;
- return { kind: "bolt", name: "Short bolt", count: 2, len: 25, dia: 6, at: [[sx * (lx + TUBE / 2), y, -lz - 6], [sx * (lx + TUBE / 2), y, -lz + 6]], dir: [-sx, 0, 0], on: sx < 0 ? "L" : "R", mate: r };
+ const y = r === "BH" ? yB : yLo;
+ return { kind: "bolt", name: "Short bolt", count: 2, len: 25, dia: 6, at: [[sx * (lx + TUBE / 2), y, -lz - 12], [sx * (lx + TUBE / 2), y, -lz + 12]], dir: [-sx, 0, 0], on: sx < 0 ? "L" : "R", mate: r };
});
const longAt: Vec3[] = [
[-lx, yHi - RAIL / 2, -lz / 2], [-lx, yHi - RAIL / 2, lz / 2],
[lx, yHi - RAIL / 2, -lz / 2], [lx, yHi - RAIL / 2, lz / 2],
- [-lx / 2, yHi - RAIL / 2, -lz], [0, yHi - RAIL / 2, -lz], [lx / 2, yHi - RAIL / 2, -lz],
+ [-lx / 2, yB - OVAL / 2, -lz], [0, yB - OVAL / 2, -lz], [lx / 2, yB - OVAL / 2, -lz],
];
const runnerAt = (x: number): Vec3[] => [-1, 0, 1].map((k): Vec3 => [x, yLeg, dz + k * (dd / 2 - 40)]);
diff --git a/src/lib/plan/families/esseboda.ts b/src/lib/plan/families/esseboda.ts
index 4a91663..e31fba1 100644
--- a/src/lib/plan/families/esseboda.ts
+++ b/src/lib/plan/families/esseboda.ts
@@ -91,7 +91,8 @@ function sofa(s: ProductSpec): CustomParams {
detail: "Lay the armrests on a rug, inside face up. One screw holds each plate, tightened with the Allen key.",
add: ["L", "R"],
fix: G.map((sx) => fx("hook", hooks(sx), [-sx, 0, 0], { ...HOOK, on: sx < 0 ? "L" : "R", mate: "B" })).concat(
- G.map((sx) => fx("screw", hooks(sx), [-sx, 0, 0], { ...HOOK_SCREW, on: sx < 0 ? "L" : "R" })),
+ // the screw goes through the plate into the armrest
+ G.map((sx) => fx("screw", hooks(sx), [sx, 0, 0], { ...HOOK_SCREW, on: sx < 0 ? "L" : "R" })),
),
tools: ["allen"],
warnings: ["floor"],
@@ -124,8 +125,8 @@ function sofa(s: ProductSpec): CustomParams {
title: "Bolt the seat to the armrests",
detail: "Two bolts with washers through each side rail of the seat into the armrest. Tighten them with the Allen key.",
fix: G.flatMap((sx) => [
- fx("washer", bolts(sx), [sx, 0, 0], { ...WASHER, on: "S" }),
fx("bolt", bolts(sx), [sx, 0, 0], { ...BOLT, on: "S", mate: sx < 0 ? "L" : "R" }),
+ fx("washer", bolts(sx), [sx, 0, 0], { ...WASHER, on: "S" }),
]),
tools: ["allen"],
},
diff --git a/src/lib/plan/families/fabrikor.ts b/src/lib/plan/families/fabrikor.ts
index 98f1e61..2c4905f 100644
--- a/src/lib/plan/families/fabrikor.ts
+++ b/src/lib/plan/families/fabrikor.ts
@@ -7,7 +7,12 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* down through the tray into the legs, three glass panels dropped into the posts and held by tabs you bend over,
* a top tray bolted on from the sides, a wall strap, the floor plate, shelf supports and two glass shelves, and the
* glass door hung on two hinge pins by two people. Twenty Allen bolts in all.
- * The 81x113 cabinet is a different build (two doors) whose manual we haven't found, so it keeps its old guide.
+ *
+ * The 81x113 cabinet has its own manual: four full-height posts with feet, built lying on its front. The base tray
+ * is bolted between the front posts, the back posts go on from above, then it's stood up, the top bolted on and the
+ * middle post fitted between the doors. Two side panes and two back panes drop into the posts' tabs, the catch is
+ * screwed to the right door, both doors hang on hinge pins, and two glass shelves rest on ten supports.
+ * Eighteen Allen bolts in all.
*/
const LEG = 38;
@@ -79,20 +84,22 @@ function recipe(s: ProductSpec): CustomParams {
];
const piecesAt = (ps: PartPiece[], c: Vec3) => ps.map((p) => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] as Vec3 }));
const baseC: Vec3 = [0, legTop + trayH / 2, 0];
- parts.push({ id: "T0", name: "Base tray", size: [BW, trayH, BD], pos: baseC, material: "metal", pieces: piecesAt(tray(legTop, trayH, true), baseC) });
+ parts.push({ id: "T0", name: "Base tray", size: [BW, trayH, BD], pos: baseC, material: "metal", pieces: piecesAt(tray(legTop, trayH, false), baseC) });
const postH = body1 - body0;
- const postAt = (sx: number, sz: number): Vec3 => [sx * (BW / 2 - POST / 2), body0 + postH / 2, sz * (BD / 2 - POST / 2)];
- parts.push({ id: "PFL", name: "Hinge post", size: [POST, postH, POST], pos: postAt(-1, 1), material: "metal" });
- parts.push({ id: "PBL", name: "Back post", size: [POST, postH, POST], pos: postAt(-1, -1), material: "metal" });
- parts.push({ id: "PBR", name: "Back post", size: [POST, postH, POST], pos: postAt(1, -1), material: "metal" });
- parts.push({ id: "PFR", name: "Lock post", size: [POST, postH, POST], pos: postAt(1, 1), shape: "cyl", material: "metal" });
+ // the posts run on up inside the top's rim, where its side bolts go into them
+ const postLen = H - 3 - body0;
+ const postAt = (sx: number, sz: number): Vec3 => [sx * (BW / 2 - POST / 2), body0 + postLen / 2, sz * (BD / 2 - POST / 2)];
+ parts.push({ id: "PFL", name: "Hinge post", size: [POST, postLen, POST], pos: postAt(-1, 1), material: "metal" });
+ parts.push({ id: "PBL", name: "Back post", size: [POST, postLen, POST], pos: postAt(-1, -1), material: "metal" });
+ parts.push({ id: "PBR", name: "Back post", size: [POST, postLen, POST], pos: postAt(1, -1), material: "metal" });
+ parts.push({ id: "PFR", name: "Lock post", size: [POST, postLen, POST], pos: postAt(1, 1), shape: "cyl", material: "metal" });
const gh = postH - 20, gy = body0 + postH / 2;
parts.push({ id: "GL", name: "Side glass", size: [5, gh, BD - 2 * POST], pos: [-BW / 2 + 12, gy, 0], material: "glass" });
parts.push({ id: "GB", name: "Back glass", size: [BW - 2 * POST, gh, 5], pos: [0, gy, -BD / 2 + 12], material: "glass" });
parts.push({ id: "GR", name: "Side glass", size: [5, gh, BD - 2 * POST], pos: [BW / 2 - 12, gy, 0], material: "glass" });
const topC: Vec3 = [0, body1 + topT / 2, 0];
parts.push({ id: "T1", name: "Top", size: [BW, topT, BD], pos: topC, material: "metal", pieces: piecesAt(tray(body1, topT, false), topC) });
- parts.push({ id: "FP", name: "Floor plate", size: [BW - 2 * POST, 4, BD - 2 * POST], pos: [0, body0 - 2, 0], material: "metal" });
+ parts.push({ id: "FP", name: "Floor plate", size: [BW - 2 * POST, 4, BD - 2 * POST], pos: [0, body0 + 2, 0], material: "metal" });
const shelfY = [body0 + postH * 0.34, body0 + postH * 0.67];
shelfY.forEach((y, i) => parts.push({ id: `S${i}`, name: "Glass shelf", size: [BW - 2 * POST - 4, 6, BD - 2 * POST - 4], pos: [0, y, 0], material: "glass" }));
// the door: a steel frame round a pane, between the front posts
@@ -117,15 +124,15 @@ function recipe(s: ProductSpec): CustomParams {
const topBolts: Vec3[] = [];
const topDirs: Vec3[] = [];
for (const [sx, sz] of corners) {
- topBolts.push([sx * (BW / 2), body1 + topT / 2, sz * (BD / 2 - POST / 2)]);
+ topBolts.push([sx * (BW / 2), body1 + 8, sz * (BD / 2 - POST / 2)]);
topDirs.push([-sx, 0, 0]);
// the back-left corner's back hole takes the wall strap later
if (!(sx < 0 && sz < 0)) {
- topBolts.push([sx * (BW / 2 - POST / 2), body1 + topT / 2, sz * (BD / 2)]);
+ topBolts.push([sx * (BW / 2 - POST / 2), body1 + 22, sz * (BD / 2)]);
topDirs.push([0, 0, -sz]);
}
}
- const strapAt: Vec3 = [-(BW / 2 - POST / 2), body1 + topT / 2, -BD / 2];
+ const strapAt: Vec3 = [-(BW / 2 - POST / 2), body1 + 22, -BD / 2];
const supports: Vec3[] = shelfY.flatMap((y) => corners.map(([sx, sz]) => [sx * (BW / 2 - POST), y - 8, sz * (BD / 2 - POST - 10)] as Vec3));
const hinge = (top: boolean): Vec3 => [-(BW / 2 - POST / 2), top ? body1 : body0, BD / 2 - 9];
@@ -218,10 +225,140 @@ function recipe(s: ProductSpec): CustomParams {
return { parts, steps };
}
+
+/* ---------------------------------------------------------------- 81x113, two doors */
+
+function wide(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const P = POST, foot = 25;
+ const yT0 = 150, tH = 40; // the base tray, its flat side up
+ const yB = yT0 + tH; // the bottom of the glass space
+ const yTop = H - 40; // the top rim
+ const xp = W / 2 - P / 2, zp = D / 2 - P / 2;
+ const corners: [number, number][] = [[-1, 1], [1, 1], [-1, -1], [1, -1]];
+ const pid = (sx: number, sz: number) => `P${sz > 0 ? "F" : "B"}${sx < 0 ? "L" : "R"}`;
+ const tray = (y0: number, h: number, w: number, d: number): PartPiece[] => [
+ { shape: "box", size: [w, 3, d], pos: [0, y0 + h - 1.5, 0] },
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [w, h, 3], pos: [0, y0 + h / 2, g * (d / 2 - 1.5)] })),
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [3, h, d - 6], pos: [g * (w / 2 - 1.5), y0 + h / 2, 0] })),
+ ];
+ const piecesAt = (ps: PartPiece[], c: Vec3) => ps.map((p) => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] as Vec3 }));
+ const postLen = H - 3 - foot;
+ const parts: CustomPart[] = corners.map(([sx, sz]): CustomPart => ({
+ id: pid(sx, sz),
+ name: sz > 0 ? "Front post" : "Back post",
+ size: [P, postLen, P],
+ pos: [sx * xp, foot + postLen / 2, sz * zp],
+ material: "metal",
+ }));
+ const c0: Vec3 = [0, yT0 + tH / 2, 0];
+ parts.push({ id: "T0", name: "Base tray", size: [W - 2 * P, tH, D], pos: c0, material: "metal", pieces: piecesAt(tray(yT0, tH, W - 2 * P, D), c0) });
+ const c1: Vec3 = [0, (yTop + H) / 2, 0];
+ parts.push({ id: "T1", name: "Top", size: [W, H - yTop, D], pos: c1, material: "metal", pieces: piecesAt(tray(yTop, H - yTop, W, D), c1) });
+ // the middle post runs from inside the base tray up inside the top's rim, between the doors
+ const mY0 = yT0 + 2, mY1 = H - 3;
+ parts.push({ id: "M", name: "Middle post", size: [P, mY1 - mY0, 20], pos: [0, (mY0 + mY1) / 2, D / 2 - 10], material: "metal" });
+ const gh = yTop - yB - 10, gy = (yTop + yB) / 2;
+ [-1, 1].forEach((g, i) => parts.push({ id: `GS${i}`, name: "Side glass", size: [5, gh, D - 2 * P], pos: [g * xp, gy, 0], material: "glass" }));
+ const bw = (W - 2 * P) / 2 - 2;
+ [-1, 1].forEach((g, i) => parts.push({ id: `GB${i}`, name: "Back glass", size: [bw, gh, 5], pos: [g * (bw / 2 + 1), gy, -zp], material: "glass" }));
+ const shelfY = [yB + (yTop - yB) / 3, yB + (2 * (yTop - yB)) / 3];
+ shelfY.forEach((y, i) => parts.push({ id: `S${i}`, name: "Glass shelf", size: [W - 2 * P - 4, 6, D - 2 * P - 4], pos: [0, y, 0], material: "glass" }));
+ // the doors: a steel frame round a pane, each between a corner post and the middle post
+ const dw = W / 2 - P - P / 2 - 6, dh = yTop - yB - 8, fr = 26, dz = D / 2 - 12;
+ const doorPieces: PartPiece[] = [
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [fr, dh, 18], pos: [g * (dw / 2 - fr / 2), 0, 0], material: "metal" })),
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [dw - 2 * fr, fr, 18], pos: [0, g * (dh / 2 - fr / 2), 0], material: "metal" })),
+ { shape: "box", size: [dw - 2 * fr, dh - 2 * fr, 5], pos: [0, 0, 0], material: "glass" },
+ ];
+ const dx = (W / 2 - P + P / 2) / 2;
+ [-1, 1].forEach((g, i) => parts.push({ id: `D${i}`, name: "Glass door", size: [dw, dh, 18], pos: [g * dx, gy, dz], material: "metal", pieces: doorPieces }));
+
+ const bolt = (on: string, pts: Vec3[], dir: Vec3): CustomFix => ({ kind: "bolt", count: pts.length, ...BOLT, at: pts, dir, on });
+ const feet = (ids: [number, number][]): CustomFix[] => ids.map(([sx, sz]) => ({ kind: "foot", count: 1, len: 20, dia: 30, at: [[sx * xp, 0, sz * zp]], dir: [0, 1, 0], on: pid(sx, sz) }));
+ // two bolts through each post into the end of the base tray
+ const trayBolts = (sz: number): CustomFix[] => [-1, 1].map((sx) => bolt(pid(sx, sz), [156, 184].map((y): Vec3 => [sx * (W / 2), y, sz * zp]), [-sx, 0, 0]));
+ const topBolts: CustomFix[] = corners.flatMap(([sx, sz]) => [bolt("T1", [[sx * (W / 2), H - 30, sz * zp]], [-sx, 0, 0]), bolt("T1", [[sx * xp, H - 14, sz * (D / 2)]], [0, 0, -sz])]);
+ const hinge = (sx: number, top: boolean): Vec3 => [sx * (xp - P / 2 - 4), top ? yTop - 4 : yB + 4, dz];
+ const hang = (i: number): CustomFix[] => {
+ const sx = i ? 1 : -1;
+ return [
+ { kind: "washer", count: 2, len: 1.5, dia: 12, at: [hinge(sx, false), hinge(sx, true)], dir: [0, 1, 0], on: `D${i}` },
+ { kind: "pin", name: "Hinge pin", count: 1, len: 30, dia: 6, at: [hinge(sx, false)], dir: [0, 1, 0], on: `D${i}` },
+ { kind: "pin", name: "Hinge pin", count: 1, len: 30, dia: 6, at: [hinge(sx, true)], dir: [0, -1, 0], on: `D${i}` },
+ ];
+ };
+ const supports: Vec3[] = shelfY.flatMap((y) => [...corners.map(([sx, sz]) => [sx * (xp - P / 2 - 4), y - 8, sz * (zp - P / 2 - 4)] as Vec3), [0, y - 8, D / 2 - 26] as Vec3]);
+ const catchX = 30, catchY = gy + dh / 2;
+ const tabs = (n: number) => `Bend the ${n} tabs on the posts over its edges by hand, so it can't fall out.`;
+ const steps: CustomStep[] = [
+ {
+ title: "Screw a foot into each front post",
+ detail: "Lay the two front posts on a rug, hinge sockets facing each other, and turn a foot into the bottom of each by hand.",
+ add: ["PFL", "PFR"],
+ fix: feet([[-1, 1], [1, 1]]),
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ { title: "Bolt the base tray to the front posts", detail: "Flat side towards the top of the posts. Two bolts through each post; leave them a little loose.", add: ["T0"], fix: trayBolts(1), tools: ["allen"], from: { T0: [0, 0, -250] } },
+ {
+ title: "Screw a foot into each back post",
+ detail: "The back posts are the ones with rows of shelf holes.",
+ fix: feet([[-1, -1], [1, -1]]),
+ wait: ["PBL", "PBR"],
+ from: { PBL: [-450, 0, 0], PBR: [450, 0, 0] },
+ },
+ { title: "Bolt on the back posts", detail: "One of you holds each post on the tray's ends while the other puts in two bolts.", add: ["PBL", "PBR"], fix: trayBolts(-1), tools: ["allen"], people: 2, from: { PBL: [0, 0, -300], PBR: [0, 0, -300] } },
+ { title: "Stand it up and put the top on", detail: "Lift it upright together, then lower the top onto the four posts.", add: ["T1"], pose: "+y", people: 2, from: { T1: [0, 250, 0] } },
+ { title: "Bolt the top to the posts", detail: "Two bolts at each corner, one from the side and one from the front or back.", fix: topBolts, tools: ["allen"] },
+ {
+ title: "Bolt in the middle post",
+ detail: "Between the doors at the front, its slot at the bottom. One bolt into the top and one into the base tray.",
+ add: ["M"],
+ fix: [bolt("T1", [[0, H - 22, D / 2]], [0, 0, -1]), bolt("T0", [[0, yT0 + 20, D / 2]], [0, 0, -1])],
+ tools: ["allen"],
+ from: { M: [0, 0, 300] },
+ },
+ { title: "Fit the two side panes", detail: `Tilt each in from the front and stand it in the slots of its side. ${tabs(14)}`, add: ["GS0", "GS1"], from: { GS0: [150, 0, 450], GS1: [-150, 0, 450] }, warnings: ["hand"] },
+ { title: "Fit the two back panes", detail: `They meet in the middle of the back. ${tabs(16)}`, add: ["GB0", "GB1"], from: { GB0: [-30, 0, 500], GB1: [30, 0, 500] }, warnings: ["hand"] },
+ {
+ title: "Screw the catch onto the right door",
+ detail: "Lay both doors face down. The catch goes on top of the right door's free edge, ball facing up, with two screws.",
+ fix: [
+ { kind: "clip", name: "Door catch", count: 1, len: 40, dia: 14, at: [[catchX + 20, catchY, dz]], dir: [0, -1, 0], on: "D1" },
+ { kind: "screw", count: 2, len: 10, dia: 3.5, at: [[catchX + 4, catchY, dz], [catchX + 36, catchY, dz]], dir: [0, -1, 0], on: "D1" },
+ ],
+ tools: ["screwdriver"],
+ wait: ["D0", "D1"],
+ from: { D0: [0, 0, 400], D1: [0, 0, 400] },
+ },
+ { title: "Hang the left door", detail: "One of you holds the door while the other pushes a pin with its washer up into the bottom socket and down into the top one.", add: ["D0"], fix: hang(0), people: 2 },
+ { title: "Hang the right door", detail: "The same way, on the right front post.", add: ["D1"], fix: hang(1), people: 2 },
+ { title: "Level it with the feet", detail: "Turn the four feet with the Allen key until the doors close evenly.", tools: ["allen"] },
+ { title: "Tighten every bolt", detail: "All eighteen, now that the cabinet stands square.", tools: ["allen"], check: "square" },
+ { title: "Push in the shelf supports", detail: "Five for each shelf: one in each corner post and one in the middle post, at the same height.", fix: [{ kind: "pin", name: "Shelf support", count: supports.length, len: 16, dia: 12, at: supports, dir: [0, -1, 0] }] },
+ { title: "Lay the glass shelves on the supports", detail: "Hold each by its edges and lower it in flat.", add: ["S0", "S1"], warnings: ["hand"] },
+ {
+ title: "Fix it to the wall",
+ detail: "One screw through the hole at the back of the top into the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ { kind: "plug", count: 1, at: [[0, H - 20, -D / 2 - 40]], dir: [0, 0, -1] },
+ { kind: "screw", count: 1, len: 50, dia: 5, at: [[0, H - 20, -D / 2 + 30]], dir: [0, 0, -1] },
+ ],
+ tools: ["drill", "pencil", "screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ { title: "Lock the doors with the key", detail: "Keep the key somewhere safe.", fix: [{ kind: "knob", name: "Key", count: 1, len: 30, dia: 20, at: [[-30, gy, D / 2 - 3]], dir: [0, 0, -1], on: "D0" }] },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["FABRIKÖR", "FABRIKOR"],
recipe(s) {
- // only the 57x150 cabinet's manual: one door, a stand with crossed rails
+ // the 57x150 cabinet stands on splayed legs with one door; the 81x113 has posts to the floor and two doors
+ if (s.size.w > 65 && s.size.h < 130) return wide(s);
if (s.size.w > 65 || s.size.h < 130) return null;
return recipe(s);
},
diff --git a/src/lib/plan/families/fagelfjallet.ts b/src/lib/plan/families/fagelfjallet.ts
index 4c56996..3821cfb 100644
--- a/src/lib/plan/families/fagelfjallet.ts
+++ b/src/lib/plan/families/fagelfjallet.ts
@@ -287,7 +287,7 @@ function drawers(b: PlanBuilder, list: DrawerBox[]) {
backCams: per(m, (g) => [0.35, 0.8].map((f): FitOpts => ({ on: m.back, at: [d.x + g * (xs - st / 2 - 26), d.y0 + 14 + (d.sh - 14) * f, zBack + st / 2], dir: [0, 0, -1] }))),
runScrews: per(m, (g, sd) => [zIn - 40, m.zc, zIn - d.dd + 40].map((z): FitOpts => ({ on: sd, at: [d.x + g * (xs + st / 2 + 2), d.y0 + 6, z], dir: [-g, 0, 0] }))),
handle: [{ on: m.front, at: [d.x, d.fy + d.fh * 0.12, d.zf], dir: [0, 0, -1], hole: false } as FitOpts],
- hScrews: [-1, 1].map((g): FitOpts => ({ on: m.front, at: [d.x + g * 36, d.fy + d.fh * 0.12, zIn], dir: [0, 0, 1] })),
+ hScrews: [-1, 1].map((g): FitOpts => ({ on: m.front, at: [d.x + g * 32, d.fy + d.fh * 0.12, zIn], dir: [0, 0, 1] })),
};
};
const kinds = new Map<string, M[]>();
@@ -460,7 +460,10 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
}
const runY = range(c.levels).map((j) => levelY(j) + 26);
const barY0 = runY[0] - 14, barY1 = yS1 - 50;
- const bar = c.pair ? k.part("bar", "Centre bar", [6, barY1 - barY0, zf - zBackIn], [0, (barY0 + barY1) / 2, (zf + zBackIn) / 2], { material: "metal" }) : null;
+ // the small drawers' divider: a board between the top rails, its top edge on dowels and cam bolts in the top
+ const DV = 16;
+ const bar = c.pair ? k.part("bar", "Divider", [DV, yS1 - barY0, zf - zBackIn - 2 * BZ], [0, (barY0 + yS1) / 2, (zf + zBackIn) / 2]) : null;
+ void barY1;
// the interlock: a box on the right-hand wall of each column, its latches clipped in at every level
const locks = colRails.map(({ col }, i) => {
@@ -473,8 +476,11 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
const allRails = colRails.flatMap((r) => r.list);
const railsOf = (i: number) => colRails[i].list;
const n = allRails.length / c.cols;
- const camFr = [0.5];
- const camLocks = (wall: Part, list: Part[]) => list.map((p) => cams(wall, p, camFr, p.pos[2] > 0 ? -1 : 1, 0.5));
+ // the dowel low in each rail end, the cam bolt high: far enough apart that neither gets pushed off the joint
+ const camFr = [0.75];
+ // on the middle panel the two halves' holes sit back to back: the left half's near the back of the rail end, the right half's near the front
+ const acr = (wall: Part, p: Part) => (wall === M ? (p.pos[0] < 0 ? 0.15 : 0.85) : 0.5);
+ const camLocks = (wall: Part, list: Part[]) => list.map((p) => cams(wall, p, camFr, p.pos[2] > 0 ? -1 : 1, acr(wall, p)));
const runnersOn = (wall: Part, side: 1 | -1) => wallRunners(wall, side, runY, zf, runLen);
const nl = c.levels;
@@ -495,7 +501,7 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
title: "Tap dowels into the rails and stand them in the left side",
detail: "A dowel in each end. Push each rail down onto its dowel and cam bolt, the holes for the cam locks facing up.",
add: railsOf(0).map((p) => p.id),
- fix: railsOf(0).flatMap((p) => [dowels(p, L, [0.3], 0.5), dowels(p, cols[0].r, [0.3], 0.5)]),
+ fix: railsOf(0).flatMap((p) => [dowels(p, L, [0.2], 0.5), dowels(p, cols[0].r, [0.2], acr(cols[0].r, p))]),
tools: ["hammer"],
});
k.step({ title: "Lock the cam locks", detail: "Arrow towards the bolt, then turn each one clockwise until it pulls the rail tight.", fix: camLocks(L, railsOf(0)), tools: ["screwdriver"] });
@@ -504,16 +510,16 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
title: "Lay the middle panel on",
detail: "Its cam bolts for the first rails go in first. Runners down, line it up with the dowels and press it on evenly.",
add: ["M"],
- fix: [...railsOf(0).map((p) => bolts(M!, p, camFr)), ...runnersOn(M!, -1), ...runnersOn(M!, 1)],
+ fix: [...railsOf(0).map((p) => bolts(M!, p, camFr, acr(M!, p))), ...runnersOn(M!, -1), ...runnersOn(M!, 1)],
tools: ["screwdriver"],
});
k.step({ title: "Lock the cam locks", detail: "One in the other end of each rail.", fix: camLocks(M!, railsOf(0)), tools: ["screwdriver"] });
- k.step({ title: "Screw the cam bolts for the right half into the middle panel", detail: `${n} more, into its upper face.`, fix: railsOf(1).map((p) => bolts(M!, p, camFr)), tools: ["screwdriver"] });
+ k.step({ title: "Screw the cam bolts for the right half into the middle panel", detail: `${n} more, into its upper face.`, fix: railsOf(1).map((p) => bolts(M!, p, camFr, acr(M!, p))), tools: ["screwdriver"] });
k.step({
title: "Tap dowels into the other rails and stand them on it",
detail: "The same way: a dowel in each end, onto the bolts.",
add: railsOf(1).map((p) => p.id),
- fix: railsOf(1).flatMap((p) => [dowels(p, M!, [0.3], 0.5), dowels(p, R, [0.3], 0.5)]),
+ fix: railsOf(1).flatMap((p) => [dowels(p, M!, [0.2], acr(M!, p)), dowels(p, R, [0.2], 0.5)]),
tools: ["hammer"],
});
k.step({ title: "Lock the cam locks", fix: camLocks(M!, railsOf(1)), tools: ["screwdriver"] });
@@ -535,11 +541,10 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
tools: ["allen"],
});
- // the 6-drawer's top also takes two cam bolts into the back rail, and two dowels from the front rail
- const tb0 = colRails[0].tb, tf0 = colRails[0].tf;
- const topFix = [bolts(top, L, [0.15, 0.85]), bolts(top, R, [0.15, 0.85]), ...(M ? [bolts(top, M, [0.15, 0.85])] : []), ...(c.pair ? [bolts(top, tb0, [0.3, 0.7])] : []), ...bracketFixes(top, [-xo + 120, xo - 120], zb)];
- const topDowels = [dowels(L, top, [0.3, 0.7]), dowels(R, top, [0.3, 0.7]), ...(M ? [dowels(M, top, [0.3, 0.7])] : []), ...(c.pair ? [dowels(tf0, top, [0.3, 0.7])] : [])];
- const topCams = [cams(top, L, [0.15, 0.85], 1), cams(top, R, [0.15, 0.85], -1), ...(M ? [cams(top, M, [0.15, 0.85], 1)] : []), ...(c.pair ? [cams(top, tb0, [0.3, 0.7], 1)] : [])];
+ // the 6-drawer's top also takes two cam bolts for the divider between the small drawers
+ const topFix = [bolts(top, L, [0.15, 0.85]), bolts(top, R, [0.15, 0.85]), ...(M ? [bolts(top, M, [0.15, 0.85])] : []), ...(bar ? [bolts(top, bar, [0.3, 0.7])] : []), ...bracketFixes(top, [-xo + 120, xo - 120], zb)];
+ const topDowels = [dowels(L, top, [0.3, 0.7]), dowels(R, top, [0.3, 0.7]), ...(M ? [dowels(M, top, [0.3, 0.7])] : [])];
+ const topCams = [cams(top, L, [0.15, 0.85], 1), cams(top, R, [0.15, 0.85], -1), ...(M ? [cams(top, M, [0.15, 0.85], 1)] : [])];
const topSteps = () => {
k.step({ title: "Tap dowels into the tops of the sides", detail: M ? "Two in each panel." : "Two in each side.", fix: topDowels, tools: ["hammer"] });
k.step({
@@ -633,20 +638,34 @@ function chest(b: PlanBuilder, s: ProductSpec, c: ChestCfg) {
}),
});
if (c.halves) k.step({ title: "Tighten the three bolts", detail: "Now that both back panels are in, turn them in until the heads sit flush.", tools: ["allen"] });
- if (bar)
+ if (bar) {
+ const tf0 = colRails[0].tf;
+ const hx = DV / 2;
k.step({
- title: "Screw the centre bar between the top rails",
- detail: "It hangs from the top rails between the two small drawers. Four screws up into the rails, then a runner on each face for the small drawers.",
+ title: "Screw the runners onto the divider and push it up under the top",
+ detail: "One runner on each face, three screws each, the wheels at the front. Two dowels in its top edge, then push it up between the top rails onto the dowels and cam bolts.",
add: [bar.id],
fix: [
- at("screw", bar, [zBackIn + 6, zBackIn + 14, zf - 14, zf - 6].map((z): Vec3 => [0, barY1, z]), [0, 1, 0], { len: 14, dia: 4 }),
+ dowels(bar, top, [0.15, 0.85]),
...[-1, 1].flatMap((g) => [
- at("runner", bar, [[g * 8, runY[0], zf - 10 - runLen / 2]], [-g, 0, 0], { len: runLen, dia: 20 }),
- at("screw", bar, [zf - 40, zf - 10 - runLen / 2, zf - runLen + 20].map((z): Vec3 => [g * 3, runY[0], z]), [-g, 0, 0], RUNNER_SCREW),
+ at("runner", bar, [[g * (hx + 5), runY[0], zf - 10 - runLen / 2]], [-g, 0, 0], { len: runLen, dia: 20 }),
+ at("screw", bar, [zf - 40, zf - 10 - runLen / 2, zf - runLen + 20].map((z): Vec3 => [g * (hx + 10), runY[0], z]), [-g, 0, 0], RUNNER_SCREW),
]),
],
+ tools: ["screwdriver", "hammer"],
+ });
+ k.step({ title: "Lock the cam locks", detail: "Two in the divider, just under the top.", fix: [cams(top, bar, [0.3, 0.7], 1)], tools: ["screwdriver"] });
+ k.step({
+ title: "Screw the bracket to the divider and the front rail",
+ detail: "The metal bracket holds the front of the divider to the top front rail. Two screws.",
+ fix: [
+ at("angle", bar, [[hx + 2, yS1 - 70, zf - BZ - 15]], [-1, 0, 0], { len: 40, dia: 20, name: "Divider bracket" }),
+ at("screw", bar, [[hx + 2, yS1 - 80, zf - BZ - 15]], [-1, 0, 0], { len: 12, dia: 4 }),
+ { ...at("screw", bar, [[hx + 2, yS1 - 25, zf - BZ - 2]], [0, 0, 1], { len: 12, dia: 4 }), mate: tf0.id },
+ ],
tools: ["screwdriver"],
});
+ }
k.step({
title: "Press in the feet",
detail: "L-shaped ones at the back corners, straight ones at the front corners and under the middle. Push their pegs into the bottom edges.",
@@ -701,7 +720,7 @@ function doorSteps(b: PlanBuilder, doors: Hung[], ys: number[], knobY: number, o
if (!o.plated) step(b, { title: n > 1 ? "Screw the mounting plates onto the sides" : "Screw the mounting plates onto the side", detail: `${ys.length} on the hinge side${n > 1 ? " of each door" : ""}, two screws each, in the holes near the front edge.`, tools: ["screwdriver"], kind: "hinges" }, () => {
for (const d of doors) b.fits({ kind: "clip", ...PLATE }, pf(d).map((p): FitOpts => ({ on: d.wall, at: p, dir: [-d.g, 0, 0], hole: false })), 0.12);
b.then(0.1);
- for (const d of doors) b.fits({ kind: "screw", ...PLATE_SCREW }, pf(d).flatMap((p) => [-16, 16].map((dy): FitOpts => ({ on: d.wall, at: [p[0], p[1] + dy, p[2]], dir: [-d.g, 0, 0] }))), 0.06);
+ for (const d of doors) b.fits({ kind: "screw", ...PLATE_SCREW }, pf(d).flatMap((p) => [-24, 24].map((dy): FitOpts => ({ on: d.wall, at: [p[0] - d.g * 3, p[1] + dy, p[2]], dir: [d.g, 0, 0] }))), 0.06);
});
const hx = (d: Hung) => d.door.pos[0] + d.g * (d.door.size[0] / 2 - 22);
const zr = (d: Hung) => d.door.pos[2] - d.door.size[2] / 2;
@@ -883,46 +902,50 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
const hy = [doors[0].pos[1] - doorH / 2 + 110, doors[0].pos[1], doors[0].pos[1] + doorH / 2 - 110];
const plates = (wall: Part, g: 1 | -1): CustomFix[] => [
at("clip", wall, hy.map((y): Vec3 => [g * xi, y, zf - 40]), [-g, 0, 0], PLATE),
- at("screw", wall, hy.flatMap((y) => [-16, 16].map((dy): Vec3 => [g * xi, y + dy, zf - 40])), [-g, 0, 0], PLATE_SCREW),
+ at("screw", wall, hy.flatMap((y) => [-24, 24].map((dy): Vec3 => [g * (xi - 3), y + dy, zf - 40])), [g, 0, 0], PLATE_SCREW),
];
const railY = yS1 - 110;
const holders = (wall: Part, g: 1 | -1): CustomFix[] => [
at("clip", wall, [[g * xi, railY, zc]], [-g, 0, 0], { len: 30, dia: 30, name: "Rail holder" }),
- at("screw", wall, [-12, 12].map((dz): Vec3 => [g * xi, railY + 14, zc + dz]), [-g, 0, 0], { len: 15, dia: 4 }),
+ at("screw", wall, [-14, 14].map((dz): Vec3 => [g * (xi - 3), railY + 20, zc + dz]), [g, 0, 0], { len: 15, dia: 4 }),
];
const fr = [0.2, 0.8];
const LB = { ...LINK_BOLT, len: 60, name: "Long connecting bolt" };
- k.step({ title: "Screw the cam bolts into the left side", detail: "Lay both sides on a rug, inside up. Six bolts in each, by hand until they stop.", add: ["L"], fix: [bolts(L, bottom, fr), bolts(L, shelf, fr), bolts(L, tf, [0.5]), bolts(L, tb, [0.5])], tools: ["screwdriver"], pose: "+x", warnings: ["floor"] });
+ // the low compartment is put together first and the left side goes onto all of it at once, so the side waits until then
+ const rf = [0.75]; // rail ends: the dowel low, the cam bolt high
+ k.step({ title: "Screw the cam bolts into the left side", detail: "Lay both sides on a rug, inside up. Six bolts in each, by hand until they stop.", fix: [bolts(L, bottom, fr), bolts(L, shelf, fr), bolts(L, tf, rf), bolts(L, tb, rf)], wait: ["L"], from: { L: [0, 300, 0] }, tools: ["screwdriver"], pose: "+x", warnings: ["floor"] });
k.step({ title: "Screw the hinge plates onto the left side", detail: "Three, near the front edge, two screws each. The right side takes three the same way.", fix: plates(L, -1), tools: ["screwdriver"] });
k.step({ title: "Screw the rail holder onto the left side", detail: "Near the top, two screws. One on the right side too.", fix: holders(L, -1), tools: ["screwdriver"] });
k.step({
title: "Build the low compartment",
- detail: "Dowels in the ends of the bottom, two cam bolts in it for the divider. Stand the divider on them and turn its cam locks.",
+ detail: "Beside the side, on the rug. Dowels in the ends of the bottom and two cam bolts in it for the divider. A dowel in each end of the divider, push it onto the bolts and turn its two cam locks.",
add: ["bottom", "div"],
- fix: [dowels(bottom, L, [0.3, 0.7]), dowels(bottom, R, [0.3, 0.7]), bolts(bottom, div, [0.25, 0.75]), dowels(div, bottom, [0.5]), dowels(div, shelf, [0.5]), cams(bottom, div, [0.25, 0.75], 1)],
+ from: { bottom: [0, 0, 0] },
+ fix: [dowels(bottom, L, [0.3, 0.7]), dowels(bottom, R, [0.3, 0.7]), bolts(bottom, div, [0.25, 0.75]), dowels(div, bottom, [0.35]), dowels(div, shelf, [0.35]), cams(bottom, div, [0.25, 0.75], 1)],
tools: ["hammer", "screwdriver"],
});
k.step({ title: "Tap in the door buffers", detail: "Two into the front edge of the bottom, one near each end.", fix: [at("clip", bottom, [-1, 1].map((g): Vec3 => [g * (xi - 40), yB + 9, zf]), [0, 0, -1], BUMPER)], tools: ["hammer"] });
k.step({
title: "Bolt the fixed shelf onto the divider",
- detail: "Dowels in both ends of the shelf first. Three long bolts down through the shelf into the divider, with the Allen key.",
+ detail: "Dowels in both ends of the shelf first. Lower it onto the divider's dowels and drive three long bolts down through it, with the Allen key.",
add: ["fixed"],
fix: [dowels(shelf, L, [0.3, 0.7]), dowels(shelf, R, [0.3, 0.7]), screws(shelf, div, [0.2, 0.5, 0.8], LB, 0.5, "bolt")],
tools: ["hammer", "allen"],
});
+ k.step({ title: "Put the compartment and the left side together", detail: "Bring the side and the compartment together so every dowel and cam bolt finds its hole, the bottom at the side's lower end.", add: ["L"], people: 2, warnings: ["two"] });
k.step({ title: "Lock the cam locks", detail: "Four in the bottom and the fixed shelf, at the left side.", fix: [cams(L, bottom, fr, -1), cams(L, shelf, fr, -1)], tools: ["screwdriver"] });
- k.step({ title: "Fit the top rails", detail: "A dowel in each end, slide them in at the top of the back and front edges and turn their cam locks.", add: ["tb", "tf"], fix: [dowels(tb, L, [0.3]), dowels(tb, R, [0.3]), dowels(tf, L, [0.3]), dowels(tf, R, [0.3]), cams(L, tb, [0.5], 1), cams(L, tf, [0.5], -1)], tools: ["hammer", "screwdriver"] });
+ k.step({ title: "Fit the top rails", detail: "A dowel in each end, push them onto the side at the top of the back and front edges and turn their cam locks.", add: ["tb", "tf"], fix: [dowels(tb, L, [0.2]), dowels(tb, R, [0.2]), dowels(tf, L, [0.2]), dowels(tf, R, [0.2]), cams(L, tb, rf, 1), cams(L, tf, rf, -1)], tools: ["hammer", "screwdriver"] });
k.step({
title: "Lay the right side on",
detail: "Its six cam bolts, three hinge plates and rail holder go on first. Line it up with every dowel and bolt and press it down evenly.",
add: ["R"],
- fix: [bolts(R, bottom, fr), bolts(R, shelf, fr), bolts(R, tf, [0.5]), bolts(R, tb, [0.5]), ...plates(R, 1), ...holders(R, 1)],
+ fix: [bolts(R, bottom, fr), bolts(R, shelf, fr), bolts(R, tf, rf), bolts(R, tb, rf), ...plates(R, 1), ...holders(R, 1)],
tools: ["screwdriver"],
people: 2,
warnings: ["two"],
});
- k.step({ title: "Lock the cam locks", detail: "Six of them, at the right side.", fix: [cams(R, bottom, fr, -1), cams(R, shelf, fr, -1), cams(R, tb, [0.5], 1), cams(R, tf, [0.5], -1)], tools: ["screwdriver"] });
+ k.step({ title: "Lock the cam locks", detail: "Six of them, at the right side.", fix: [cams(R, bottom, fr, -1), cams(R, shelf, fr, -1), cams(R, tb, rf, 1), cams(R, tf, rf, -1)], tools: ["screwdriver"] });
k.step({ title: "Screw the brackets onto the plinth", detail: "Three on its back face, one screw each.", fix: [at("angle", plinth, [-1, 0, 1].map((g): Vec3 => [g * (xi - 30), F + P / 2, zf - 20]), [0, 0, 1], { len: 30, dia: 24 }), at("screw", plinth, [-1, 0, 1].map((g): Vec3 => [g * (xi - 30), F + P / 2 - 12, zf - 20]), [0, 0, 1], { len: 13, dia: 4 })], tools: ["screwdriver"] });
k.step({ title: "Fit the plinth under the bottom", detail: "Between the sides at the front. One screw up through each bracket into the bottom.", add: ["plinth"], fix: [at("screw", plinth, [-1, 0, 1].map((g): Vec3 => [g * (xi - 30), yB, zf - 34]), [0, 1, 0], { len: 13, dia: 4 })], tools: ["screwdriver"] });
k.step({ title: "Fit the top", detail: "Six cam bolts in its underside and four dowels in the sides, then push it on and turn the cam locks in the sides.", add: ["top"], fix: [dowels(L, top, [0.3, 0.7]), dowels(R, top, [0.3, 0.7]), bolts(top, L, [0.1, 0.5, 0.9]), bolts(top, R, [0.1, 0.5, 0.9]), cams(top, L, [0.1, 0.5, 0.9], 1), cams(top, R, [0.1, 0.5, 0.9], -1)], tools: ["screwdriver", "hammer"] });
@@ -939,7 +962,7 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
]),
});
k.step({ title: "Screw the wall brackets under the top", detail: "At the back corners, a washer under each screw.", fix: bracketFixes(top, [-xo + 100, xo - 100], zb), tools: ["screwdriver"] });
- k.step({ title: "Screw the back panels to the fixed shelf", detail: "One screw where the two panels meet, in the middle.", fix: [at("screw", backs[1], [[0, yS + 20, zb + 6]], [0, 0, 1], { len: 16, dia: 4 })], tools: ["screwdriver"] });
+ k.step({ title: "Screw the back panels to the fixed shelf", detail: "One screw where the two panels meet, in the middle.", fix: [at("screw", backs[0], [[0, yS + 9, zb + 6]], [0, 0, 1], { len: 16, dia: 4 })], tools: ["screwdriver"] });
k.step({ title: "Stand it up", detail: "Together, and lift it: don't drag it up by one corner. Mind the ceiling as it comes up.", pose: "+y", people: 2, warnings: ["two"] });
buildCustom(b, { ...s, custom: k.recipe });
wallSteps(b, { y: yS1 - 80, xs: [-xo + 100, xo - 100], zb, tall: true });
@@ -1087,10 +1110,12 @@ function bed(b: PlanBuilder, s: ProductSpec) {
const hFront = zH + BT / 2, hPostF = zH + PD / 2, hBack = zH - BT / 2, hPostB = zH - PD / 2, hTopB = zH - 40;
const cF: Vec3 = [0, 0, zF], cH: Vec3 = [0, 0, zH];
- const stageAt = (k: string, c: Vec3, from?: Vec3) => {
+ const stageAt = (k: string, c: Vec3, from?: Vec3, shift: Vec3 = [0, 0, 0]) => {
const it = b.partItem(k);
- b.stage(k, [it.final.pos[0] - c[0], it.final.pos[1] - c[1], it.final.pos[2] - c[2]], it.final.rot, from);
+ b.stage(k, [it.final.pos[0] - c[0] + shift[0], it.final.pos[1] - c[1] + shift[1], it.final.pos[2] - c[2] + shift[2]], it.final.rot, from);
};
+ // a leg or post joined to a rail end comes in along the rail's dowels, from beside it
+ const out = (k: string, d = 260): Vec3 => [sg(b.partItem(k).final.pos[0]) * d, 0, 0];
const foot = (o: StepOpts, body: () => void) => step(b, { scene: "footboard", pose: "-z", ...o }, body);
const head = (o: StepOpts, body: () => void) => step(b, { scene: "headboard", pose: "+z", ...o }, body);
@@ -1099,7 +1124,8 @@ function bed(b: PlanBuilder, s: ProductSpec) {
const all = [...legLow, ...legTop, midLow!, midTop!];
foot({ title: "Fit the double cam bolts and dowels into the legs and the upright", detail: "Lay the parts on a rug. A dowel beside each bolt, then turn a cam lock over each bolt to hold it.", tools: ["hammer", "screwdriver"], kind: "cams", warnings: ["floor"] }, () => {
b.stagger(0.12);
- for (const k of [...legs, fMid]) stageAt(k, cF, [0, 200, 0]);
+ for (const k of legs) stageAt(k, cF, [0, 200, 0], out(k));
+ stageAt(fMid, cF, [0, 200, 0], [0, 220, 0]);
b.then(0.15);
b.fits(HW.dowel, all.map((x) => fo(x, x.dir[1] ? 0 : 25, x.dir[1] ? (x.at[0] ? -sg(x.at[0]) * 15 : 15) : 0)), 0.06);
b.then(0.1);
@@ -1110,6 +1136,8 @@ function bed(b: PlanBuilder, s: ProductSpec) {
foot({ title: "Push the legs and the upright onto the bottom rail", detail: "Bolts and dowels into their holes, then turn the three cam locks in the rail.", tools: ["screwdriver"], kind: "cams" }, () => {
stageAt(fLow, cF, [0, 0, 0]);
b.then(0.1);
+ for (const k of [...legs, fMid]) stageAt(k, cF);
+ b.then(0.1);
b.fits(BED_CAM, [...two.map((g) => cam(fLow, [g * (iw / 2 - 30), fyB - 15, fIn], -1)), cam(fLow, [0, yFB1 - 30, fIn], -1)], 0.1);
});
} else {
@@ -1120,15 +1148,18 @@ function bed(b: PlanBuilder, s: ProductSpec) {
});
foot({ title: "Fit a double cam bolt into each leg", detail: "Push it into the hole on the inside of the leg and turn a cam lock over it.", tools: ["screwdriver"], kind: "cams" }, () => {
b.stagger(0.15);
- for (const k of legs) stageAt(k, cF, [0, 200, 0]);
+ for (const k of legs) stageAt(k, cF, out(k, 200), out(k));
b.then(0.15);
b.fits(D_BOLT, legLow.map((x) => fo(x, -15)), 0.1);
b.then(0.1);
b.fits(BED_CAM, two.map((g, i) => cam(legs[i], [g * (iw / 2 + 30), fyB - 15, fLegIn], -1)), 0.1);
});
- foot({ title: "Push the legs onto the bottom rail and lock them", detail: "Turn the two cam locks in the rail.", tools: ["screwdriver"], kind: "cams" }, () =>
- b.fits(BED_CAM, two.map((g) => cam(fLow, [g * (iw / 2 - 30), fyB - 15, fIn], -1)), 0.1),
- );
+ foot({ title: "Push the legs onto the bottom rail and lock them", detail: "Slide each leg onto the dowel and bolt in the rail end, then turn the two cam locks in the rail.", tools: ["screwdriver"], kind: "cams" }, () => {
+ b.stagger(0.2);
+ for (const k of legs) stageAt(k, cF);
+ b.then(0.15);
+ b.fits(BED_CAM, two.map((g) => cam(fLow, [g * (iw / 2 - 30), fyB - 15, fIn], -1)), 0.1);
+ });
}
foot({ title: wide ? "Slide the panels into the grooves" : "Slide the panel into the grooves", detail: "Smooth side down, all the way to the bottom rail.", kind: "general" }, () => {
b.stagger(0.25);
@@ -1144,7 +1175,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
});
}
foot({ title: "Put the top rail on and lock it", detail: wide ? "Push it onto the bolts and dowels of the legs and the upright, then turn its three cam locks." : "Push it onto the bolts and dowels, then turn its two cam locks.", tools: ["screwdriver"], kind: "cams" }, () => {
- stageAt(fTop, cF, [0, 0, 0]);
+ stageAt(fTop, cF, [0, 200, 0]);
b.then(0.1);
b.fits(BED_CAM, [...two.map((g) => cam(fTop, [g * (xP - 10), yFT + 15, fTopIn], -1)), ...(wide ? [cam(fTop, [0, yFT + 15, fTopIn], -1)] : [])], 0.1);
});
@@ -1196,7 +1227,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
});
head({ title: "Push the posts onto the rail ends and lock them", detail: "Two cam locks in each post.", tools: ["screwdriver"], kind: "cams" }, () => {
b.stagger(0.25);
- for (const k of posts) stageAt(k, cH, [0, 200, 0]);
+ for (const k of posts) stageAt(k, cH, out(k));
b.then(0.15);
b.fits(BED_CAM, lowBolts.map((x) => cam(x.mate, [sg(x.at[0]) * xP, x.at[1], hPostF], 1)), 0.08);
});
@@ -1211,7 +1242,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
const topJ = [...postTop, ...(wide ? [midHTop!] : [])];
head({ title: "Tap dowels into the tops of the posts", detail: "One in each.", tools: ["hammer"], kind: "dowels" }, () => b.fits(HW.dowel, postTop.map((x) => fo(x, 0, -sg(x.at[0]) * 15)), 0.12));
head({ title: wide ? "Push double cam bolts into the posts and the upright" : "Push double cam bolts into the posts", detail: "Into the top ends, beside the dowels.", kind: "cams" }, () => b.fits(D_BOLT, topJ.map((x) => fo(x, 0, x.at[0] ? sg(x.at[0]) * 10 : 0)), 0.12));
- head({ title: "Push the top rail on", detail: "Its groove goes over the panels' top edges, down onto the bolts and dowels.", kind: "join" }, () => stageAt(hTop, cH, [0, 0, 0]));
+ head({ title: "Push the top rail on", detail: "Its groove goes over the panels' top edges, down onto the bolts and dowels.", kind: "join" }, () => stageAt(hTop, cH, [0, 200, 0]));
head({ title: "Turn it over and lock the cam locks", detail: wide ? "Three in the posts and the upright, three in the top rail." : "Two in the posts, two in the top rail.", tools: ["screwdriver"], kind: "cams", pose: "-z" }, () => {
b.fits(BED_CAM, [...topJ.map((x) => cam(x.on, [x.at[0] ? sg(x.at[0]) * (xP + 10) : 0, yHT - 30, x.on === hMid ? hBack : hPostB], -1)), ...topJ.map((x) => cam(hTop, [x.at[0] ? sg(x.at[0]) * (xP - 10) : 0, (yHT + H) / 2, hTopB], -1))], 0.08);
});
@@ -1273,10 +1304,10 @@ function bed(b: PlanBuilder, s: ProductSpec) {
step(b, { title: "Lay the centre beam in its brackets", detail: "Drop each end down into its bracket.", kind: "join" }, () => b.add(beam, [0, 260, 0]));
}
const braceScrews: FitOpts[] = wide
- ? braceEnds.flatMap(([a, c], i) => [{ on: braces[i], at: [a[0], yBr + 1, a[2]] as Vec3, dir: [0, 1, 0] as Vec3, mate: a[2] < 0 ? hLow : support }, { on: braces[i], at: [c[0], yBr + 1, c[2] + (a[2] < 0 ? -12 : 12)] as Vec3, dir: [0, 1, 0] as Vec3, mate: slatRails[c[0] < 0 ? 0 : 1] }])
+ ? braceEnds.flatMap(([a, c], i) => [{ on: braces[i], at: [a[0], yBr - 1, a[2]] as Vec3, dir: [0, 1, 0] as Vec3, mate: a[2] < 0 ? hLow : support }, { on: braces[i], at: [c[0], yBr - 1, c[2] + (a[2] < 0 ? -12 : 12)] as Vec3, dir: [0, 1, 0] as Vec3, mate: slatRails[c[0] < 0 ? 0 : 1] }])
: [
- { on: braces[0], at: [-xs, yBr + 1, 0], dir: [0, 1, 0], mate: slatRails[0] },
- ...braceEnds.map(([, c], i): FitOpts => ({ on: braces[i], at: [c[0], yBr + 1, c[2]], dir: [0, 1, 0], mate: slatRails[1] })),
+ { on: braces[0], at: [-xs, yBr - 1, 0], dir: [0, 1, 0], mate: slatRails[0] },
+ ...braceEnds.map(([, c], i): FitOpts => ({ on: braces[i], at: [c[0], yBr - 1, c[2]], dir: [0, 1, 0], mate: slatRails[1] })),
];
step(b, { title: wide ? "Screw the four braces under the frame" : "Screw the two braces under the frame", detail: wide ? "Pull each one out to length. They run from the beam brackets to the middle of the slat rails, one screw at each end." : "Pull each one out to length. Both start at the middle of one slat rail and run to the other, one screw at each end.", tools: ["screwdriver"], kind: "screws" }, () => {
b.stagger(0.25);
@@ -1285,7 +1316,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
b.fits(BRACE_SCREW, braceScrews, 0.08);
});
step(b, { title: "Square the frame and lock the braces", detail: "Measure both diagonals and push the frame until they match, then put a screw in the middle of each brace.", tools: ["screwdriver", "tape"], kind: "square", check: "square", warnings: ["square"] }, () =>
- b.fits(BRACE_SCREW, braces.map((k): FitOpts => ({ on: k, at: b.partItem(k).final.pos.map((v, i) => (i === 1 ? v + 1 : v)) as Vec3, dir: [0, 1, 0], hole: false })), 0.12),
+ b.fits(BRACE_SCREW, braces.map((k): FitOpts => ({ on: k, at: b.partItem(k).final.pos.map((v, i) => (i === 1 ? v - 1 : v)) as Vec3, dir: [0, 1, 0], hole: false })), 0.12),
);
const zHold = Lin / 2 - 10 - 25;
const holders = two.flatMap((g, i) => two.map((k): FitOpts => ({ on: slatRails[i], at: [g * xSl, ySl, k * zHold], dir: [0, -1, 0] })));
@@ -1352,10 +1383,11 @@ function bedBoxes(b: PlanBuilder, o: { n: number; xo: number; Lin: number }) {
frontCams: ends.flatMap((e, i) => ys.map((y): FitOpts => ({ on: x.sides[i], at: [xF - x.g * 30, y, zIn(e)], dir: [0, 0, e] }))),
pins: ends.flatMap((e, i) => ys.map((y): FitOpts => ({ on: x.back, at: [xBo, Math.max(y, 100), zE(e)], dir: [x.g, 0, 0], mate: x.sides[i] }))),
backCams: ends.flatMap((e, i) => ys.map((y): FitOpts => ({ on: x.sides[i], at: [xB + x.g * 30, Math.max(y, 100), zIn(e)], dir: [0, 0, e] }))),
+ // up through the edge of the bottom, where it lies in the grooves, into the back, the front and the sides
screws: [
- ...spread(x.zc - FL / 2 + 120, x.zc + FL / 2 - 120, 3).map((z): FitOpts => ({ on: x.bottom, at: [xB + x.g * 6, by - 1.5, z], dir: [0, 1, 0], mate: x.back })),
- ...spread(x.zc - FL / 4, x.zc + FL / 4, 2).map((z): FitOpts => ({ on: x.bottom, at: [xF - x.g * 6, by - 1.5, z], dir: [0, 1, 0], mate: x.front })),
- ...ends.flatMap((e, i) => [x.xc - 150, x.xc + 150].map((xx): FitOpts => ({ on: x.bottom, at: [xx, by - 1.5, zIn(e) - e * 4], dir: [0, 1, 0], mate: x.sides[i] }))),
+ ...spread(x.zc - FL / 2 + 120, x.zc + FL / 2 - 120, 3).map((z): FitOpts => ({ on: x.bottom, at: [xB - x.g * 2.5, by - 1.5, z], dir: [0, 1, 0], mate: x.back })),
+ ...spread(x.zc - FL / 4, x.zc + FL / 4, 2).map((z): FitOpts => ({ on: x.bottom, at: [xF + x.g * 2.5, by - 1.5, z], dir: [0, 1, 0], mate: x.front })),
+ ...ends.flatMap((e, i) => [x.xc - 150, x.xc + 150].map((xx): FitOpts => ({ on: x.bottom, at: [xx, by - 1.5, zIn(e) + e * 2.5], dir: [0, 1, 0], mate: x.sides[i] }))),
],
castors: [xF - x.g * 70, xB + x.g * 70].flatMap((cx) => ends.map((e): FitOpts => ({ on: x.bottom, at: [cx, by - 1.5, x.zc + e * (FL / 2 - 70)], dir: [0, 1, 0], hole: false }))),
castorScrews: [xF - x.g * 70, xB + x.g * 70].flatMap((cx) => ends.flatMap((e) => [-16, 16].map((dz): FitOpts => ({ on: x.bottom, at: [cx, by - 1.5, x.zc + e * (FL / 2 - 70) + dz], dir: [0, 1, 0] })))),
diff --git a/src/lib/plan/families/fagerbacken.ts b/src/lib/plan/families/fagerbacken.ts
index 60d17d8..cefb3db 100644
--- a/src/lib/plan/families/fagerbacken.ts
+++ b/src/lib/plan/families/fagerbacken.ts
@@ -91,7 +91,7 @@ function armchair(s: ProductSpec): CustomParams {
{
title: "Start two bolts in the back of the base",
detail: "Turn the base upside down again. A washer on each bolt, turned in by hand a few turns only.",
- fix: [washers(backAt), { ...bolts(backAt), mate: undefined }],
+ fix: [{ ...bolts(backAt), mate: undefined }, washers(backAt)],
pose: "-y",
},
{
@@ -104,7 +104,7 @@ function armchair(s: ProductSpec): CustomParams {
{
title: "Bolt the base to the arms",
detail: "Four more bolts, each with a washer, through the base into the arms.",
- fix: [washers(sideAt), bolts(sideAt)],
+ fix: [bolts(sideAt), washers(sideAt)],
tools: ["allen"],
},
{ title: "Tighten the two back bolts", detail: "Now turn the first two bolts tight with the Allen key.", tools: ["allen"] },
diff --git a/src/lib/plan/families/farjkarl.ts b/src/lib/plan/families/farjkarl.ts
index 2bd7d8c..190826a 100644
--- a/src/lib/plan/families/farjkarl.ts
+++ b/src/lib/plan/families/farjkarl.ts
@@ -96,9 +96,11 @@ function recipe(s: ProductSpec, c: Cfg): CustomParams {
P({ id: "T", name: "Top", size: [r(W), TT, r(D)], pos: [0, r(H - TT / 2), 0], material: "board" });
// plinth frame: front and back rails between two end pieces
const yP = c.legH + PH / 2;
- P({ id: "PF", name: "Plinth rail", size: [r(Wc - 2 * PT), PH, PT], pos: [0, r(yP), r(zf - PT / 2)], material: "board" });
+ // on the cabinets the plinth's front sits back under the front rail, behind the doors
+ const zp = doors ? zr + RT / 2 : zf, zpc = (z0 + zp) / 2;
+ P({ id: "PF", name: "Plinth rail", size: [r(Wc - 2 * PT), PH, PT], pos: [0, r(yP), r(zp - PT / 2)], material: "board" });
P({ id: "PB", name: "Plinth rail", size: [r(Wc - 2 * PT), PH, PT], pos: [0, r(yP), r(z0 + PT / 2)], material: "board" });
- for (const [i, sx] of G.entries()) P({ id: i ? "PR" : "PL", name: "Plinth end", size: [PT, PH, r(Dc)], pos: [r(sx * (Wc / 2 - PT / 2)), r(yP), r(zc)], material: "board" });
+ for (const [i, sx] of G.entries()) P({ id: i ? "PR" : "PL", name: "Plinth end", size: [PT, PH, r(zp - z0)], pos: [r(sx * (Wc / 2 - PT / 2)), r(yP), r(zpc)], material: "board" });
const corners: [number, number][] = [
[-1, -1],
[1, -1],
@@ -106,7 +108,7 @@ function recipe(s: ProductSpec, c: Cfg): CustomParams {
[1, 1],
];
const lx = Wc / 2 - PT - LD / 2 - 6;
- const lz = (sz: number) => (sz < 0 ? z0 + PT + LD / 2 + 6 : zf - PT - LD / 2 - 6);
+ const lz = (sz: number) => (sz < 0 ? z0 + PT + LD / 2 + 6 : zp - PT - LD / 2 - 6);
const legLen = c.legH + PH - 5;
corners.forEach(([sx, sz], i) => P({ id: `G${i + 1}`, name: "Leg", size: [LD, legLen, LD], pos: [r(sx * lx), r(legLen / 2), r(lz(sz))], material: "board", pieces: legPieces(legLen) }));
// shelves, evenly up the inside
@@ -245,13 +247,17 @@ function recipe(s: ProductSpec, c: Cfg): CustomParams {
warnings: c.model === "bookcase" ? ["floor"] : undefined,
});
// plinth frame
+ // built beside the carcass, then laid on it as one frame
+ const frame = ["PF", "PB", "PL", "PR"];
+ const aside = Object.fromEntries(frame.map((id) => [id, [Wc + 300, 0, 0] as Vec3]));
const pr = (id: string, z: number) => G.map((sx) => fx("dowel", [[r(sx * (Wc / 2 - PT)), r(yP), r(z)]], [-sx, 0, 0], { ...DOWEL, on: id }));
- S({ title: "Tap the dowels into the plinth rails", detail: "Build the plinth frame on the floor. One dowel into each end of both long rails.", fix: [...pr("PF", zf - PT / 2), ...pr("PB", z0 + PT / 2)], tools: ["hammer"] });
- const brk = (sx: number, sz: number): Vec3 => [r(sx * (Wc / 2 - PT - 22)), r(yP), r(sz < 0 ? z0 + PT + 22 : zf - PT - 22)];
+ S({ title: "Tap the dowels into the plinth rails", detail: "Build the plinth frame on the floor. One dowel into each end of both long rails.", fix: [...pr("PF", zp - PT / 2), ...pr("PB", z0 + PT / 2)], tools: ["hammer"], wait: frame, from: aside });
+ // set in from the corner far enough that their screws clear the dowels there
+ const brk = (sx: number, sz: number): Vec3 => [r(sx * (Wc / 2 - PT - 30)), r(yP), r(sz < 0 ? z0 + PT + 30 : zp - PT - 30)];
const brkScrews = (sz: number, side: "rail" | "end") =>
fx("screw", G.flatMap((sx) => [-1, 1].map((k): Vec3 => {
const p = brk(sx, sz);
- return side === "rail" ? [p[0] + k * 14, p[1] + 14, sz < 0 ? z0 + PT : zf - PT] : [sx < 0 ? -Wc / 2 + PT : Wc / 2 - PT, p[1] + 14, p[2] + k * 14];
+ return side === "rail" ? [p[0] + k * 12, p[1] + 14, sz < 0 ? z0 + PT : zp - PT] : [sx < 0 ? -Wc / 2 + PT : Wc / 2 - PT, p[1] + 14, p[2] + k * 12];
})), side === "rail" ? [0, 0, sz] : [-1, 0, 0], { ...BSCREW, on: side === "rail" ? (sz < 0 ? "PB" : "PF") : undefined });
S({
title: "Screw a leg bracket to each end of the rails",
@@ -262,19 +268,20 @@ function recipe(s: ProductSpec, c: Cfg): CustomParams {
S({
title: "Fit the plinth ends",
detail: "Push them onto the dowels, then two screws through each bracket into the end.",
- add: ["PL", "PR"],
fix: [
- fx("screw", corners.filter(([sx]) => sx < 0).flatMap(([sx, sz]) => [-1, 1].map((k): Vec3 => [-Wc / 2 + PT, brk(sx, sz)[1] + 14, brk(sx, sz)[2] + k * 14])), [-1, 0, 0], { ...BSCREW, on: "PL" }),
- fx("screw", corners.filter(([sx]) => sx > 0).flatMap(([sx, sz]) => [-1, 1].map((k): Vec3 => [Wc / 2 - PT, brk(sx, sz)[1] + 14, brk(sx, sz)[2] + k * 14])), [1, 0, 0], { ...BSCREW, on: "PR" }),
+ fx("screw", corners.filter(([sx]) => sx < 0).flatMap(([sx, sz]) => [-1, 1].map((k): Vec3 => [-Wc / 2 + PT, brk(sx, sz)[1] + 14, brk(sx, sz)[2] + k * 12])), [-1, 0, 0], { ...BSCREW, on: "PL" }),
+ fx("screw", corners.filter(([sx]) => sx > 0).flatMap(([sx, sz]) => [-1, 1].map((k): Vec3 => [Wc / 2 - PT, brk(sx, sz)[1] + 14, brk(sx, sz)[2] + k * 12])), [1, 0, 0], { ...BSCREW, on: "PR" }),
],
tools: ["screwdriver"],
});
const plinthScrews = c.model === "bookcase" ? 6 : 8;
- const along = [-1, 0, 1].flatMap((t) => [zf - PT / 2, z0 + PT / 2].map((z): Vec3 => [r(t * (Wc / 2 - 120)), c.legH, r(z)]));
- const psAt: Vec3[] = plinthScrews === 6 ? along : [...along, ...G.map((sx): Vec3 => [r(sx * (Wc / 2 - PT / 2)), c.legH, r(zc)])];
+ const along = [-1, 0, 1].flatMap((t) => [zp - PT / 2, z0 + PT / 2].map((z): Vec3 => [r(t * (Wc / 2 - 120)), c.legH, r(z)]));
+ const psAt: Vec3[] = plinthScrews === 6 ? along : [...along, ...G.map((sx): Vec3 => [r(sx * (Wc / 2 - PT / 2)), c.legH, r(zpc)])];
S({
title: "Screw the plinth frame under the bottom",
detail: `Lay it on the bottom end of the carcass, onto the dowels, and drive ${plinthScrews} long screws through it with the Allen key. Use the longest screws here.`,
+ add: frame,
+ from: Object.fromEntries(frame.map((id) => [id, [0, -400, 0] as Vec3])), // onto the dowels in the sides
fix: [fx("screw", psAt, [0, 1, 0], { ...PSCREW, mate: "B" })],
tools: ["allen"],
pose: c.model === "bookcase" ? "-z" : "-y",
@@ -379,7 +386,7 @@ function recipe(s: ProductSpec, c: Cfg): CustomParams {
});
S({ title: "Screw the bottom hinges onto the doors", detail: "The other kind of hinge goes into the bottom holes, two screws each.", fix: [fx("hinge", hingeAt(hy[0]), [0, 0, 1], { len: 50, dia: 35 })], tools: ["screwdriver"] });
S({ title: "Click the doors onto the hinge plates", detail: "Hook each hinge's back end onto its plate, then press the front until it clicks. Adjust the screws on the hinges until the gaps are even.", tools: ["screwdriver"] });
- const pull: Vec3[] = G.map((sx): Vec3 => [sx * 45, r(yD + 40), zf]);
+ const pull: Vec3[] = G.map((sx): Vec3 => [sx * 45, r(yD + 40), zf + 4]); // clear of its screw's head
S({
title: "Screw on the handles",
detail: "One on each door by the meeting edge, a screw through from the inside.",
diff --git a/src/lib/plan/families/fejan.ts b/src/lib/plan/families/fejan.ts
index 5555e60..9100a5b 100644
--- a/src/lib/plan/families/fejan.ts
+++ b/src/lib/plan/families/fejan.ts
@@ -5,7 +5,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* FEJAN, read from the garden table's manual. Each of the four steel legs comes in two tubes: the short one is
* pushed into the long one, and a plastic foot is tapped onto its end with a hammer over a piece of wood. The top
* lies upside down on a rug, a leg stands in each corner bracket, and two Allen bolts with washers go through the
- * bracket into each leg. The folding chair comes assembled (no manual), so it keeps its old guide.
+ * bracket into each leg. The folding chair comes assembled and has no manual: its guide unfolds and locks it.
*/
const at = (kind: CustomFix["kind"], pts: Vec3[], dir: Vec3, on?: string, mate?: string, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: pts.length, at: pts, dir, on, mate, ...o });
@@ -37,7 +37,8 @@ function table(s: ProductSpec): CustomParams {
const boltPts = (d: Vec3) =>
corners
.filter(([sx, sz]) => (d[0] ? sx === d[0] : sz === d[2]))
- .map(([sx, sz]) => (d[0] ? [sx * (xl - L / 2), H - A + 10, sz * zl] : [sx * xl, H - A + 10, sz * (zl - L / 2)]) as Vec3);
+ // the bolts through the two sides of a bracket sit at different heights so they pass each other in the leg
+ .map(([sx, sz]) => (d[0] ? [sx * (xl - L / 2 - 4), H - 28, sz * zl] : [sx * xl, H - 16, sz * (zl - L / 2 - 4)]) as Vec3);
const boltFix = (kind: CustomFix["kind"], o: Partial<CustomFix>) => dirs.map((d) => at(kind, boltPts(d), d, "T", undefined, o));
const steps: CustomStep[] = [
@@ -71,10 +72,40 @@ function table(s: ProductSpec): CustomParams {
return { parts, steps };
}
+
+/** The folding chair: two long tubes from the back feet into the backrest, a front frame under the seat, the seat hinged between. */
+function foldingChair(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 440, H = Math.round(s.size.h * 10) || 890, D = Math.round(s.size.d * 10) || 420;
+ const yS = 450, tube = 20, xs = W / 2 - tube;
+ const tubeBetween = (a: [number, number], c: [number, number], x: number): PartPiece => {
+ const dy = c[0] - a[0], dz = c[1] - a[1];
+ return { shape: "cyl", size: [tube, Math.round(Math.hypot(dy, dz)), tube], pos: [x, (a[0] + c[0]) / 2 - H / 2, (a[1] + c[1]) / 2], rot: [Math.atan2(dz, dy), 0, 0] };
+ };
+ const back: [number, number][] = [[0, -D / 2 + 30], [H - 20, -D / 2 + 80]];
+ const front: [number, number][] = [[0, D / 2 - 20], [yS - 30, -D / 2 + 100]];
+ const pieces: PartPiece[] = [
+ ...[-1, 1].map((sx) => tubeBetween(back[0], back[1], sx * xs)),
+ ...[-1, 1].map((sx) => tubeBetween(front[0], front[1], sx * (xs - tube))),
+ { shape: "cyl", size: [tube, 2 * (xs - tube), tube], pos: [0, 160 - H / 2, D / 2 - 20 - Math.round(((D - 120) * 160) / (yS - 30))], rot: [0, 0, Math.PI / 2] },
+ ];
+ const parts: CustomPart[] = [
+ { id: "frame", name: "Chair frame", size: [W, H, D], pos: [0, H / 2, 0], material: "metal", pieces },
+ { id: "back", name: "Backrest", size: [W - 10, 200, 20], pos: [0, H - 110, -D / 2 + 76], material: "board" },
+ { id: "seat", name: "Seat", size: [W - 30, 20, D - 40], pos: [0, yS, 20], material: "board" },
+ ];
+ const steps: CustomStep[] = [
+ { title: "Take the folded chair out of the box", detail: "It comes assembled, with nothing to screw together. Stand it on its feet, still folded.", add: ["frame", "back"], from: { frame: [0, 300, 0], back: [0, 300, 0] } },
+ { title: "Unfold it and press the seat down", detail: "Pull the back and the front legs apart, then push the seat down until it lies flat and the frame locks.", add: ["seat"], from: { seat: [0, 260, -200] } },
+ { title: "Check it stands steady", detail: "All four feet should touch the floor. To fold it, lift the front edge of the seat. Store it indoors over winter." },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["FEJAN"],
recipe(s) {
if (/fejan-table/.test(s.slug ?? "")) return table(s);
+ if (/folding|fejan-chair/.test(`${s.variant} ${s.slug ?? ""}`.toLowerCase())) return foldingChair(s);
return null;
},
};
diff --git a/src/lib/plan/families/fjaderharv.ts b/src/lib/plan/families/fjaderharv.ts
new file mode 100644
index 0000000..244b49a
--- /dev/null
+++ b/src/lib/plan/families/fjaderharv.ts
@@ -0,0 +1,62 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * FJÄDERHARV has no assembly manual: the paperboard mini chest comes put together, with packing inside the drawers.
+ * The guide unpacks the casing, empties the drawers and slides them back in. The page gives 32 x 16 x 25 cm.
+ */
+
+const t = 3; // paperboard walls
+
+function chest(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, D = s.size.d * 10;
+ const H = 160; // from the product page
+ const shell: PartPiece[] = [
+ { shape: "box", size: [W, t, D], pos: [0, H / 2 - t / 2, 0] },
+ { shape: "box", size: [W, t, D], pos: [0, -H / 2 + t / 2, 0] },
+ { shape: "box", size: [t, H - 2 * t, D], pos: [-W / 2 + t / 2, 0, 0] },
+ { shape: "box", size: [t, H - 2 * t, D], pos: [W / 2 - t / 2, 0, 0] },
+ { shape: "box", size: [W - 2 * t, H - 2 * t, t], pos: [0, 0, -D / 2 + t / 2] },
+ { shape: "box", size: [W - 2 * t, t, D - t], pos: [0, 0, t / 2] },
+ ];
+ const parts: CustomPart[] = [{ id: "case", name: "Casing", size: [W, H, D], pos: [0, H / 2, 0], pieces: shell }];
+ const dw = W - 2 * t - 2, dh = H / 2 - 1.5 * t - 2, dd = D - t - 2;
+ const drawer: PartPiece[] = [
+ // the front, with the handle cut out shown as a dark strip
+ { shape: "box", size: [dw, dh, t], pos: [0, 0, dd / 2 - t / 2] },
+ { shape: "box", size: [dw / 4, dh / 6, 1], pos: [0, dh / 3, dd / 2 + 0.5], material: "metal" },
+ { shape: "box", size: [dw, dh - 10, t], pos: [0, -5, -dd / 2 + t / 2] },
+ { shape: "box", size: [t, dh - 10, dd - 2 * t], pos: [-dw / 2 + t / 2, -5, 0] },
+ { shape: "box", size: [t, dh - 10, dd - 2 * t], pos: [dw / 2 - t / 2, -5, 0] },
+ { shape: "box", size: [dw, t, dd], pos: [0, -dh / 2 + t / 2, 0] },
+ ];
+ [t + 1 + dh / 2, H / 2 + t / 2 + 1 + dh / 2].forEach((y, i) =>
+ parts.push({ id: `D${i}`, name: "Drawer", size: [dw, dh, dd], pos: [0, y, t / 2 + 1], pieces: drawer }),
+ );
+ return {
+ parts,
+ steps: [
+ {
+ title: "Unpack the chest",
+ detail: "It comes put together, so there's nothing to screw. Lift it out of the box and take off the wrapping.",
+ add: ["case"],
+ from: { case: [0, 250, 0] },
+ },
+ {
+ title: "Empty the drawers and slide them back in",
+ detail: "Pull each drawer out, take out the packing inside and push it back in until the front sits flush.",
+ add: ["D0", "D1"],
+ from: { D0: [0, 0, 220], D1: [0, 0, 220] },
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["FJÄDERHARV", "FJADERHARV"],
+ recipe(s) {
+ if (/fjaderharv-mini-chest/.test(s.slug ?? "")) return chest(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/fjalkinge.ts b/src/lib/plan/families/fjalkinge.ts
new file mode 100644
index 0000000..b4bef87
--- /dev/null
+++ b/src/lib/plan/families/fjalkinge.ts
@@ -0,0 +1,146 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * FJÄLKINGE, read from the shelving unit's manual. The steel frame is built lying on its back on a rug: the welded
+ * bottom frame is bolted to the two back uprights, then the front uprights, then the top frame goes on (two bolts in
+ * every joint, sixteen in all). Four adjustable feet screw into the bottom frame and the unit is stood up by two
+ * people. Pads go on the bottom frame's corners for the bottom shelf, which slides in, and on the top frame's for the
+ * top shelf, which is laid in. Two wall brackets screw onto the top frame, the feet level it, the brackets are fixed
+ * to the wall, and sixteen clips hold the four loose shelves.
+ */
+
+type Kind = CustomFix["kind"];
+const fx = (kind: Kind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const S = [-1, 1] as const;
+
+const TUBE = 25; // square steel tube
+const FH = 30; // the end frames' tubes are this tall
+const FOOT = 15; // the feet lift it this much
+const SH = 18; // shelves
+
+const BOLT = { len: 60, dia: 6 };
+const CLIP = { len: 20, dia: 6, name: "Shelf clip" };
+const PAD = { len: 2, dia: 14, name: "Pad" };
+const FOOT_HW = { len: 25, dia: 28, name: "Adjustable foot" };
+const BRACKET = { len: 60, dia: 40 };
+const BRACKET_SCREW = { len: 10, dia: 4 };
+
+/** A welded rectangle of tube that fits between the four uprights of a W x D unit, as pieces about its middle. */
+function rect(W: number, D: number): PartPiece[] {
+ return [
+ ...S.map((sz): PartPiece => ({ shape: "box", size: [W - 2 * TUBE, FH, TUBE], pos: [0, 0, sz * (D / 2 - TUBE / 2)] })),
+ ...S.map((sx): PartPiece => ({ shape: "box", size: [TUBE, FH, D - 2 * TUBE], pos: [sx * (W / 2 - TUBE / 2), 0, 0] })),
+ ];
+}
+
+function unit(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const yB = FOOT + FH / 2, yT = H - FH / 2; // the frames' middles
+ const uy0 = FOOT, uy1 = H; // the uprights run the full height, the frames between them
+ const ux = W / 2 - TUBE / 2, uz = D / 2 - TUBE / 2;
+ const parts: CustomPart[] = [
+ { id: "B", name: "Bottom frame", size: [W, FH, D], pos: [0, yB, 0], material: "metal", pieces: rect(W, D) },
+ { id: "T", name: "Top frame", size: [W, FH, D], pos: [0, yT, 0], material: "metal", pieces: rect(W, D) },
+ { id: "U1", name: "Upright", size: [TUBE, uy1 - uy0, TUBE], pos: [-ux, (uy0 + uy1) / 2, -uz], material: "metal" },
+ { id: "U2", name: "Upright", size: [TUBE, uy1 - uy0, TUBE], pos: [ux, (uy0 + uy1) / 2, -uz], material: "metal" },
+ { id: "U3", name: "Upright", size: [TUBE, uy1 - uy0, TUBE], pos: [-ux, (uy0 + uy1) / 2, uz], material: "metal" },
+ { id: "U4", name: "Upright", size: [TUBE, uy1 - uy0, TUBE], pos: [ux, (uy0 + uy1) / 2, uz], material: "metal" },
+ ];
+ const sw = W - 2 * TUBE - 4, sd = D - 2 * TUBE - 4;
+ // the bottom and top shelves rest on the frames' inner ledges, the loose ones on clips
+ const shelf = (id: string, y: number): CustomPart => ({ id, name: "Shelf", size: [sw, SH, sd], pos: [0, y, 0] });
+ const free = [1, 2, 3, 4].map((k) => Math.round(FOOT + FH + ((H - 2 * FH - FOOT) * k) / 5));
+ parts.push(shelf("S0", FOOT + FH + SH / 2 - 8), shelf("S5", H - SH / 2), ...free.map((y, k) => shelf(`S${k + 1}`, y + SH / 2)));
+ const ups = ["U1", "U2", "U3", "U4"];
+ const xyz = (u: string) => parts.find((p) => p.id === u)!.pos;
+ // two bolts in each corner, from outside through the upright into the frame: one along the side, one along the end
+ const bolts = (u: string, frame: "B" | "T") => {
+ const [x, , z] = xyz(u);
+ const y = frame === "B" ? yB : yT;
+ const sx = Math.sign(x), sz = Math.sign(z);
+ return [
+ fx("bolt", [[sx * (W / 2), y - 7, z]], [-sx, 0, 0], { ...BOLT, on: u, mate: frame }),
+ fx("bolt", [[x, y + 7, sz * (D / 2)]], [0, 0, -sz], { ...BOLT, on: u, mate: frame }),
+ ];
+ };
+ const clips = ups.map((u) => {
+ const [x, , z] = xyz(u);
+ return fx("pin", free.map((y): Vec3 => [x - Math.sign(x) * (TUBE / 2), y, z]), [Math.sign(x), 0, 0], { ...CLIP, on: u });
+ });
+ const pads = (frame: "B" | "T") => {
+ const y = frame === "B" ? FOOT + FH : H - SH;
+ return fx("glide", S.flatMap((sx) => S.map((sz): Vec3 => [sx * (W / 2 - TUBE - 20), y, sz * (D / 2 - TUBE - 20)])), [0, -1, 0], { ...PAD, on: frame });
+ };
+ const feet = ups.map((u) => {
+ const [x, , z] = xyz(u);
+ return fx("foot", [[x, FOOT, z]], [0, 1, 0], { ...FOOT_HW, on: u });
+ });
+ const wallX = [-(W / 2 - 120), W / 2 - 120];
+ const brackets = fx("bracket", wallX.map((x): Vec3 => [x, H - FH, -D / 2 + TUBE / 2]), [0, 1, 0], { ...BRACKET, on: "T" });
+ const bracketScrews = fx("screw", wallX.map((x): Vec3 => [x, H - FH - 2, -D / 2 + TUBE / 2]), [0, 1, 0], { ...BRACKET_SCREW, on: "T" });
+ const wy = H - FH - 40;
+ return {
+ parts,
+ steps: [
+ {
+ title: "Bolt the bottom frame onto a back upright",
+ detail: "Lay the upright on a rug, its row of holes facing in, and stand the frame on its end. Two bolts, with the Allen key.",
+ add: ["U1", "B"],
+ fix: bolts("U1", "B"),
+ tools: ["allen"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Bolt on the other back upright",
+ detail: "One holds the frame while the other fits the upright. Two bolts.",
+ add: ["U2"],
+ fix: bolts("U2", "B"),
+ tools: ["allen"],
+ people: 2,
+ },
+ {
+ title: "Bolt on the front uprights",
+ detail: "Two bolts in each. Keep the rows of holes facing in.",
+ add: ["U3", "U4"],
+ fix: [...bolts("U3", "B"), ...bolts("U4", "B")],
+ tools: ["allen"],
+ },
+ {
+ title: "Bolt the top frame on",
+ detail: "Onto the free ends of all four uprights, two bolts in each corner. Then tighten every bolt.",
+ add: ["T"],
+ fix: ups.flatMap((u) => bolts(u, "T")),
+ tools: ["allen"],
+ },
+ { title: "Screw the feet into the uprights", detail: "One into the bottom of each, turned in by hand.", fix: feet },
+ { title: "Stand it up", detail: "Together, lifting it by the frame.", pose: "+y", people: 2, warnings: ["two"] },
+ { title: "Stick the pads onto the bottom frame", detail: "One on the inner ledge at each corner.", fix: [pads("B")] },
+ { title: "Slide in the bottom shelf", detail: "Tilt it in between the uprights and lay it on the pads.", add: ["S0"], from: { S0: [0, 0, 400] } },
+ { title: "Stick the pads onto the top frame", detail: "One at each corner.", fix: [pads("T")] },
+ { title: "Lay the top shelf in", detail: "From above, onto the pads.", add: ["S5"] },
+ { title: "Screw the wall brackets onto the top frame", detail: "One near each back corner, one screw each. Leave them loose for now.", fix: [brackets, bracketScrews], tools: ["screwdriver"] },
+ { title: "Level it with the feet", detail: "Against the wall where it will stand, turn the feet until the top is level.", tools: ["level"], warnings: ["tip"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Mark through the brackets, drill, plug and screw them to the wall, then tighten the bracket screws. Screws and plugs aren't included: use ones made for your wall.",
+ fix: [fx("plug", wallX.map((x): Vec3 => [x, wy, -D / 2 - 1]), [0, 0, -1]), fx("screw", wallX.map((x): Vec3 => [x, wy, -D / 2 + 4]), [0, 0, -1], { len: 50, dia: 5 })],
+ tools: ["drill", "screwdriver", "pencil"],
+ warnings: ["wall", "tip"],
+ wall: true,
+ },
+ { title: "Clip in the shelf clips", detail: "Four at each shelf height, hooked into the uprights' holes and pushed down.", fix: clips },
+ { title: "Lay the shelves on the clips", detail: "Tilt each one in and lower it onto its four clips. The joining clip in the box links two units side by side.", add: ["S1", "S2", "S3", "S4"] },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["FJÄLKINGE", "FJALKINGE"],
+ recipe(s) {
+ if (/^fjalkinge-shelving-unit/.test(s.slug ?? "")) return unit(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/fjallbo.ts b/src/lib/plan/families/fjallbo.ts
index 8147307..bbea68e 100644
--- a/src/lib/plan/families/fjallbo.ts
+++ b/src/lib/plan/families/fjallbo.ts
@@ -13,7 +13,9 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* TV benches have an open back and are built lying on their back too: a side frame, the back top rail, the bottom
* mesh shelf and the front top rail, the other side frame with two people, the brackets, the middle posts with long
* screws, the board rails, the feet, then it is stood up for the board, the top, and the mesh doors on their hinges.
- * The 100x95 unit with doors, the desk and the sideboard have their own manuals and keep their old guides for now.
+ * The 100x95 unit with doors is built like the benches (see doorUnit); the sideboard has its own order (see sideboard).
+ * The desk builds its storage cabinet on its side first, then the end frame and the back rails, and is turned upside
+ * down onto its top (see desk).
*/
type Kind = CustomFix["kind"];
@@ -28,7 +30,7 @@ const r1 = (n: number) => Math.round(n * 10) / 10;
const M6 = { len: 12, dia: 6 }; // machine screw, the main one
const ARCH_SCREW = { len: 10, dia: 6 }; // flat-headed, through the bracket and the post into the sleeve nut
const SLEEVE = { name: "Sleeve nut", len: 16, dia: 8 };
-const LONG = { len: 70, dia: 5 }; // long screw into a middle post
+const LONG = { len: 40, dia: 5 }; // long countersunk screw, through a shelf or rail into a middle post
const WOOD = { len: 16, dia: 4 }; // wood screw through a tab into a board
const FOOT = { len: 20, dia: 25 };
@@ -85,11 +87,15 @@ function meshShelf(id: string, x0: number, x1: number, z0: number, z1: number, y
);
}
-/** A curved bracket in the front face, from a post (side sx) in under the front edge of a shelf whose top is at y. */
-function arch(b: Body, id: string, sx: number, y: number, name = "Curved bracket", span = 110): CustomPart {
+/**
+ * A curved bracket in the front face, from a post (side sx) in under the front edge of a shelf or rail whose
+ * underside is at yb. Its top edge folds back under that shelf (the flange the two shelf screws go up through) as far
+ * as z = back; without a flange (the braces under the top) the plate alone is screwed on from the front.
+ */
+function arch(b: Body, id: string, sx: number, yb: number, o: { name?: string; span?: number; back?: number } = {}): CustomPart {
+ const span = o.span ?? 110;
const xi = sx * (b.W / 2 - T); // inner face of the post
const z0 = b.D / 2, z1 = z0 + 3;
- const yb = y - 20;
const along = (x: number) => (sx < 0 ? [xi, xi + x] : [xi - x, xi]) as [number, number];
const [ax, bx2] = along(span);
const post = sx < 0 ? [xi - T, xi] : [xi, xi + T];
@@ -99,20 +105,25 @@ function arch(b: Body, id: string, sx: number, y: number, name = "Curved bracket
const a = (t * Math.PI) / 2;
return { shape: "box", size: [R * 0.6, 6, 3], pos: [xi + u * R * (1 - Math.cos(a)), yb - R * (1 - Math.sin(a)), (z0 + z1) / 2], rot: [0, 0, u * (Math.PI / 2 - a)] };
});
- return part(id, name, [bx([post[0], yb - span, z0], [post[1], yb - span + 60, z1]), bx([sx < 0 ? bx2 - 60 : ax, yb - 20, z0], [sx < 0 ? bx2 : ax + 60, yb, z1])], "metal", strips);
+ const foot = bx([post[0], yb - span, z0], [post[1], yb - span + 60, z1]);
+ if (o.back === undefined) return part(id, o.name ?? "Curved bracket", [foot, bx([sx < 0 ? bx2 - 60 : ax, yb - 20, z0], [sx < 0 ? bx2 : ax + 60, yb, z1])], "metal", strips);
+ const outer = sx < 0 ? post[0] : post[1];
+ const top = bx([Math.min(outer, sx < 0 ? bx2 : ax), yb - 14, z0], [Math.max(outer, sx < 0 ? bx2 : ax), yb, z1]);
+ const flange = bx([ax, yb - 3, o.back], [bx2, yb, z0]);
+ return part(id, o.name ?? "Curved bracket", [foot, top, flange], "metal", strips);
}
-/** Two screws through the bracket into the shelf, and two screws and sleeve nuts through the front post. */
-function archFix(b: Body, id: string, sx: number, y: number, post: string, span = 110) {
+/** Two screws up through the bracket's flange into the shelf (or rail) at depth z, two screws and sleeve nuts through the post. */
+function archFix(b: Body, id: string, sx: number, yb: number, z: number, post: string, span = 110) {
const xi = sx * (b.W / 2 - T);
- const yb = y - 20;
const xa = xi - sx * (span - 45);
const xp = xi - sx * (T / 2);
+ const at: Vec3[] = [[xp, yb - 8, b.D / 2 + 3], [xp, yb - span + 15, b.D / 2 + 3]];
return {
- shelf: fx("screw", [[xa - 12, yb - 10, b.D / 2 + 3], [xa + 12, yb - 10, b.D / 2 + 3]], [0, 0, -1], { ...M6, on: id }),
+ shelf: fx("screw", [[xa - 12, yb - 3, z], [xa + 12, yb - 3, z]], [0, 1, 0], { ...M6, on: id }),
post: [
- fx("screw", [[xp, yb - span + 15, b.D / 2 + 3], [xp, yb - span + 45, b.D / 2 + 3]], [0, 0, -1], { ...ARCH_SCREW, on: id, mate: post }),
- fx("nut", [[xp, yb - span + 15, b.D / 2 - T], [xp, yb - span + 45, b.D / 2 - T]], [0, 0, 1], { ...SLEEVE, on: post }),
+ fx("screw", at, [0, 0, -1], { ...ARCH_SCREW, on: id, mate: post }),
+ fx("nut", at.map((p) => [p[0], p[1], b.D / 2 - T] as Vec3), [0, 0, 1], { ...SLEEVE, on: post }),
],
};
}
@@ -140,22 +151,43 @@ function topSteps(b: Body, postXs: number[], frontOnly: number[], nTabs: number)
const steps: CustomStep[] = [
{
title: "Screw the top into the top frame",
- detail: "Lay the top on a rug, show side down, with the frame on it and its lugs pointing up. One screw through each tab.",
- add: ["TP", "TF"],
+ detail: "On a rug beside the frame: the top show side down, the top frame on it with its lugs pointing up. One screw through each tab.",
+ wait: ["TP", "TF"],
fix: [fx("screw", tabs, [0, 1, 0], { ...WOOD, on: "TF", mate: "TP" })],
tools: ["screwdriver"],
},
- { title: "Push the top onto the posts", detail: "Turn it the right way up and lower it so every lug slides over a post end." },
+ {
+ title: "Lower the top onto the posts",
+ detail: "Turn it the right way up and lower it so every lug slides into a post end.",
+ add: ["TP", "TF"],
+ from: { TP: [0, 350, 0], TF: [0, 350, 0] },
+ },
{
title: "Screw the top frame to the posts",
detail: "One screw through each post into its lug.",
- fix: [fx("screw", posts.map(([x, sz]) => [x, yp - 12, sz * (D / 2)] as Vec3), [0, 0, -1], { ...M6, on: "TF" })],
+ fix: [-1, 1].map((sz) => fx("screw", posts.filter((p) => p[1] === sz).map(([x]) => [x, yp - 12, sz * (D / 2)] as Vec3), [0, 0, -sz], { ...M6, on: "TF" })),
tools: ["screwdriver"],
},
];
return { parts: [frame, top], steps };
}
+/** Two curved braces under the front corners of the top frame, three screws each: two into the post, one into the frame. */
+const braces = (b: Body) => [-1, 1].map((sx) => arch(b, `X${sx < 0 ? "l" : "r"}`, sx, b.yp + 20, { name: "Corner brace" }));
+function braceStep(b: Body): CustomStep {
+ const xi = b.W / 2 - T;
+ return {
+ title: "Screw on the two corner braces",
+ detail: "Under the front corners of the top frame, curve down. Two screws into the post, one into the frame.",
+ add: ["Xl", "Xr"],
+ fix: [-1, 1].map((sx) => {
+ const xp = sx * (b.W / 2 - T / 2);
+ return fx("screw", [[xp, b.yp - 70, b.D / 2 + 3], [xp, b.yp - 40, b.D / 2 + 3], [sx * (xi - 80), b.yp + 12, b.D / 2 + 3]], [0, 0, -1], { ...M6, on: `X${sx < 0 ? "l" : "r"}` });
+ }),
+ tools: ["screwdriver"],
+ };
+}
+
function wallStep(b: Body, two: boolean): CustomStep {
const pts: Vec3[] = [-1, 1].map((sx) => [sx * (b.W / 2 - 120), b.yp + T / 2, -b.D / 2] as Vec3);
return {
@@ -208,12 +240,14 @@ function shelving(s: ProductSpec): CustomParams {
}
// what the front brackets hold at each level: the shelf, or the front rail under a board
const frontAt = (i: number) => (wide && i > 0 ? `RF${i}` : `S${i}`);
- const archY = (i: number) => (wide && i > 0 ? levels[i] - PT : levels[i]);
+ // the underside of what each bracket holds, and the depth of the screws up into it
+ const archY = (i: number) => (wide && i > 0 ? levels[i] - PT - T : levels[i] - 20);
+ const archZ = wide ? D / 2 - T - 11 : D / 2 - 10;
const archIds: string[] = [];
levels.forEach((_, i) => {
for (const sx of [-1, 1]) {
const id = `A${i}${sx < 0 ? "l" : "r"}`;
- parts.push(arch(b, id, sx, archY(i)));
+ parts.push(arch(b, id, sx, archY(i), { back: archZ - 12 }));
archIds.push(id);
}
});
@@ -258,15 +292,15 @@ function shelving(s: ProductSpec): CustomParams {
steps.push({
title: "Screw the bottom shelf to the middle post",
detail: "One long screw down through the shelf into the post.",
- fix: [fx("screw", [[0, levels[0] - 10, -D / 2 + T]], [0, 0, -1], { ...LONG, on: "S0", mate: "MB" })],
+ fix: [fx("screw", [[0, levels[0] - 10, -D / 2 + T + 20]], [0, 0, -1], { ...LONG, on: "S0", mate: "MB" })],
tools: ["screwdriver"],
});
steps.push({
title: "Fix the back rails to the middle post",
detail: "An angle bracket on each rail, and a long screw through it into the post.",
fix: [
- fx("angle", railB.map((id) => [T, levels[Number(id.slice(2))] - PT, -D / 2 + 2 * T] as Vec3), [0, 0, -1], { name: "Angle bracket", len: 30, dia: 20, on: railB[0] }),
- fx("screw", railB.map((id) => [T, levels[Number(id.slice(2))] - PT - 10, -D / 2 + 2 * T] as Vec3), [0, 0, -1], { ...LONG, on: "MB" }),
+ fx("angle", railB.map((id) => [-24, levels[Number(id.slice(2))] - PT - T / 2, -D / 2 + 2 * T] as Vec3), [0, 0, -1], { name: "Angle bracket", len: 30, dia: 20, on: railB[0] }),
+ fx("screw", railB.map((id) => [0, levels[Number(id.slice(2))] - PT - T / 2, -D / 2 + 2 * T] as Vec3), [0, 0, -1], { ...LONG, on: "MB" }),
],
tools: ["screwdriver"],
});
@@ -280,10 +314,10 @@ function shelving(s: ProductSpec): CustomParams {
title: wide ? "Screw the curved brackets to the shelf and rails" : "Screw the curved brackets to the shelves",
detail: "One under each front corner, the curve towards the post. Two screws each.",
add: archIds,
- fix: levels.flatMap((_, i) => [-1, 1].map((sx) => archFix(b, `A${i}${sx < 0 ? "l" : "r"}`, sx, archY(i), sx < 0 ? "L" : "R").shelf)),
+ fix: levels.flatMap((_, i) => [-1, 1].map((sx) => archFix(b, `A${i}${sx < 0 ? "l" : "r"}`, sx, archY(i), archZ, sx < 0 ? "L" : "R").shelf)),
tools: ["screwdriver"],
});
- const postFix = levels.flatMap((_, i) => [-1, 1].flatMap((sx) => archFix(b, `A${i}${sx < 0 ? "l" : "r"}`, sx, archY(i), sx < 0 ? "L" : "R").post));
+ const postFix = levels.flatMap((_, i) => [-1, 1].flatMap((sx) => archFix(b, `A${i}${sx < 0 ? "l" : "r"}`, sx, archY(i), archZ, sx < 0 ? "L" : "R").post));
steps.push({
title: "Bolt the brackets through the front posts",
detail: "A screw from the front and a sleeve nut from behind, two in each bracket. Hold the nut with one screwdriver and turn the screw with the other.",
@@ -297,15 +331,15 @@ function shelving(s: ProductSpec): CustomParams {
steps.push({
title: "Screw the bottom shelf to it",
detail: "One long screw up through the shelf into the post.",
- fix: [fx("screw", [[0, levels[0] - 10, D / 2 - T]], [0, 0, 1], { ...LONG, on: "S0", mate: "MF" })],
+ fix: [fx("screw", [[0, levels[0] - 10, D / 2 - T - 20]], [0, 0, 1], { ...LONG, on: "S0", mate: "MF" })],
tools: ["screwdriver"],
});
steps.push({
title: "Fix the front rails to it",
detail: "An angle bracket and a long screw at each rail, as at the back.",
fix: [
- fx("angle", railF.map((id) => [T, levels[Number(id.slice(2))] - PT, D / 2 - 2 * T] as Vec3), [0, 0, 1], { name: "Angle bracket", len: 30, dia: 20, on: railF[0] }),
- fx("screw", railF.map((id) => [T, levels[Number(id.slice(2))] - PT - 10, D / 2 - 2 * T] as Vec3), [0, 0, 1], { ...LONG, on: "MF" }),
+ fx("angle", railF.map((id) => [-24, levels[Number(id.slice(2))] - PT - T / 2, D / 2 - 2 * T] as Vec3), [0, 0, 1], { name: "Angle bracket", len: 30, dia: 20, on: railF[0] }),
+ fx("screw", railF.map((id) => [0, levels[Number(id.slice(2))] - PT - T / 2, D / 2 - 2 * T] as Vec3), [0, 0, 1], { ...LONG, on: "MF" }),
],
tools: ["screwdriver"],
});
@@ -326,68 +360,72 @@ function shelving(s: ProductSpec): CustomParams {
const top = topSteps(b, [-xs, xs, ...(wide ? [0] : [])], [], wide ? 8 : 4);
parts.push(...top.parts);
steps.push(...top.steps);
- // two curved braces under the front corners of the top, three screws each
- for (const sx of [-1, 1]) parts.push(arch(b, `X${sx < 0 ? "l" : "r"}`, sx, b.yp + 20, "Corner brace", 90));
- steps.push({
- title: "Screw on the two corner braces",
- detail: "Under the front corners of the top frame, curve down. Two screws into the post, one into the frame.",
- add: ["Xl", "Xr"],
- fix: [-1, 1].map((sx) => {
- const xp = sx * (W / 2 - T / 2);
- return fx("screw", [[xp, b.yp - 70, D / 2 + 3], [xp, b.yp - 40, D / 2 + 3], [sx * (xi - 30), b.yp + 12, D / 2 + 3]], [0, 0, -1], { ...M6, on: `X${sx < 0 ? "l" : "r"}` });
- }),
- tools: ["screwdriver"],
- });
+ parts.push(...braces(b));
+ steps.push(braceStep(b));
steps.push({ title: "Level it with the feet", detail: "Turn the feet in or out until it stands steady and upright." });
steps.push(wallStep(b, wide));
return { parts, steps };
}
-/* ---------- TV benches, 150 and 198 wide ---------- */
+/* ---------- TV benches (150 and 198 wide) and the 100x95 unit with doors ---------- */
-function bench(s: ProductSpec): CustomParams {
+/**
+ * The benches and the 100x95 unit are built the same way, lying on their back: side frames with mesh in their lower
+ * half, a bottom mesh shelf, a wooden board on two rails, middle posts at the back and the front held with long
+ * screws, mesh doors on hinges. The benches have top rails between the side frames and a door in every bay; the
+ * 100x95 has none, hooks its board rails onto the side frames, gets its board while still on its back, and has two
+ * doors under the board and the corner braces under the top.
+ */
+function doorUnit(s: ProductSpec, cab: boolean): CustomParams {
const b = bodyOf(s);
const { W, D, yp } = b;
- const bays = W > 1700 ? 4 : 3;
+ const bays = cab ? 2 : W > 1700 ? 4 : 3;
const n = bays - 1; // middle posts at the front, and as many at the back
const xi = W / 2 - T;
const xs = W / 2 - T / 2, zs = D / 2 - T / 2;
- const yb = Math.round(b.H * 0.31); // top of the bottom mesh shelf
- const yr = Math.round(b.H * 0.67) - PT; // top of the board rails
+ const yb = cab ? 160 : Math.round(b.H * 0.31); // top of the bottom mesh shelf
+ const yr = (cab ? 520 : Math.round(b.H * 0.67)) - PT; // top of the board rails
const zBack = -D / 2; // the back is open: the back posts and rails are flush with it
+ const yMid = cab ? yp : yp - T; // middle post tops: under the top rails on a bench
const mids = Array.from({ length: n }, (_, i) => -xi + ((2 * xi) * (i + 1)) / bays);
- const parts: CustomPart[] = [sideFrame(b, "L", -1, [yb, yp], [yb, yp - 20]), sideFrame(b, "R", 1, [yb, yp], [yb, yp - 20])];
- parts.push(part("RT", "Top rail", [bx([-xi, yp - T, -D / 2], [xi, yp, -D / 2 + T])], "metal"));
- parts.push(part("RTF", "Top rail", [bx([-xi, yp - T, D / 2 - T], [xi, yp, D / 2])], "metal"));
+ const meshTop = cab ? yr - 20 : yp - 20;
+ const rungs = cab ? [yb, yr] : [yb, yp];
+ const parts: CustomPart[] = [sideFrame(b, "L", -1, rungs, [yb, meshTop]), sideFrame(b, "R", 1, rungs, [yb, meshTop])];
+ if (!cab) {
+ parts.push(part("RT", "Top rail", [bx([-xi, yp - T, -D / 2], [xi, yp, -D / 2 + T])], "metal"));
+ parts.push(part("RTF", "Top rail", [bx([-xi, yp - T, D / 2 - T], [xi, yp, D / 2])], "metal"));
+ }
// the bottom shelf: one long mesh shelf with a cross bar where each pair of middle posts stands
const shelf = meshShelf("M", -xi, xi, zBack + T, D / 2 - T, yb, "Bottom shelf");
for (const x of mids) shelf.pieces!.push({ shape: "box", size: [20, 20, D - 2 * T - 40], pos: [x - shelf.pos[0], yb - 10 - shelf.pos[1], -shelf.pos[2]] });
parts.push(shelf);
mids.forEach((x, i) => {
- parts.push(part(`MF${i}`, "Middle post", [bx([x - T / 2, F, D / 2 - T], [x + T / 2, yp - T, D / 2])], "metal"));
- parts.push(part(`MB${i}`, "Middle post", [bx([x - T / 2, F, zBack], [x + T / 2, yp - T, zBack + T])], "metal"));
+ parts.push(part(`MF${i}`, "Middle post", [bx([x - T / 2, F, D / 2 - T], [x + T / 2, yMid, D / 2])], "metal"));
+ parts.push(part(`MB${i}`, "Middle post", [bx([x - T / 2, F, zBack], [x + T / 2, yMid, zBack + T])], "metal"));
});
parts.push(part("RBk", "Board rail", [bx([-xi, yr - T, zBack + T], [xi, yr, zBack + 2 * T])], "metal"));
parts.push(part("RFr", "Board rail", [bx([-xi, yr - T, D / 2 - 2 * T], [xi, yr, D / 2 - T])], "metal"));
parts.push({ id: "P", name: "Shelf board", size: [2 * xi, PT, D / 2 - T - (zBack + T)], pos: [0, yr + PT / 2, (D / 2 - T + zBack + T) / 2], material: "wood" });
- for (const sx of [-1, 1]) parts.push(arch(b, `A${sx < 0 ? "l" : "r"}`, sx, yb));
- // doors: one in each bay, mesh in a frame
+ const zHold = D / 2 - T - 10; // the bottom shelf's front bar, where the bracket screws go up into it
+ for (const sx of [-1, 1]) parts.push(arch(b, `A${sx < 0 ? "l" : "r"}`, sx, yb - 20, { back: zHold - 12 }));
+ // doors: mesh in a frame, one in each bay
const postX = [-xs, ...mids, xs];
const doorIds: string[] = [];
+ const dy0 = yb - 20, dy1 = cab ? yr - T - 6 : yp - 6;
for (let i = 0; i < bays; i++) {
const x0 = postX[i] + T / 2 + 3, x1 = postX[i + 1] - T / 2 - 3;
- const y0 = yb - 20, y1 = yp - 6, z0 = D / 2, z1 = D / 2 + 18;
+ const z0 = D / 2, z1 = D / 2 + 18;
const f = 18;
parts.push(
part(
`D${i}`,
"Door",
[
- bx([x0, y0, z0], [x1, y0 + f, z1]),
- bx([x0, y1 - f, z0], [x1, y1, z1]),
- bx([x0, y0 + f, z0], [x0 + f, y1 - f, z1]),
- bx([x1 - f, y0 + f, z0], [x1, y1 - f, z1]),
- bx([x0 + f, y0 + f, z0 + 8], [x1 - f, y1 - f, z0 + 10]),
+ bx([x0, dy0, z0], [x1, dy0 + f, z1]),
+ bx([x0, dy1 - f, z0], [x1, dy1, z1]),
+ bx([x0, dy0 + f, z0], [x0 + f, dy1 - f, z1]),
+ bx([x1 - f, dy0 + f, z0], [x1, dy1 - f, z1]),
+ bx([x0 + f, dy0 + f, z0 + 8], [x1 - f, dy1 - f, z0 + 10]),
],
"metal",
),
@@ -395,106 +433,400 @@ function bench(s: ProductSpec): CustomParams {
doorIds.push(`D${i}`);
}
- const sideScrews = (sx: number, which: ("RT" | "RTF" | "M")[]) =>
+ const sideScrews = (sx: number, which: string[]) =>
+ which.map((id) => {
+ const y = id === "M" ? yb - 10 : id.startsWith("RT") ? yp - T / 2 : yr - T / 2;
+ const z = id === "M" ? -D / 2 + 1.5 * T : id === "RT" ? -D / 2 + T / 2 : id === "RTF" ? D / 2 - T / 2 : id === "RBk" ? zBack + 1.5 * T : D / 2 - 1.5 * T;
+ return fx("screw", [[sx * (W / 2), y, z]], [-sx, 0, 0], { ...M6, on: sx < 0 ? "L" : "R", mate: id });
+ });
+ const brackets: CustomStep[] = [
+ {
+ title: "Screw the curved brackets to the shelf",
+ detail: "One at each front corner of the bottom shelf, curve towards the leg. Two screws up through each into the shelf.",
+ add: ["Al", "Ar"],
+ fix: [-1, 1].map((sx) => archFix(b, `A${sx < 0 ? "l" : "r"}`, sx, yb - 20, zHold, sx < 0 ? "L" : "R").shelf),
+ tools: ["screwdriver"],
+ },
+ {
+ title: cab ? "Bolt the brackets through the posts" : "Bolt the brackets through the legs",
+ detail: "A screw from the front and a sleeve nut from behind, two in each bracket. Hold the nut with one screwdriver and turn the screw with the other.",
+ fix: [-1, 1].flatMap((sx) => archFix(b, `A${sx < 0 ? "l" : "r"}`, sx, yb - 20, zHold, sx < 0 ? "L" : "R").post),
+ tools: ["screwdriver"],
+ },
+ ];
+ // long screws: through the shelf's back or front bar, and through a board rail (on an angle bracket in the 100x95)
+ const shelfToMid = (front: boolean) => fx("screw", mids.map((x) => [x, yb - 10, front ? D / 2 - T - 20 : zBack + T + 20] as Vec3), [0, 0, front ? 1 : -1], { ...LONG, on: "M" });
+ const railToMid = (front: boolean) =>
+ fx("screw", mids.map((x) => [x, yr - T / 2, front ? D / 2 - 2 * T : zBack + 2 * T] as Vec3), [0, 0, front ? 1 : -1], { ...LONG, on: front ? "RFr" : "RBk", mate: front ? "MF0" : "MB0" });
+ const angleAt = (front: boolean) => fx("angle", mids.map((x) => [x - 24, yr - T / 2, front ? D / 2 - 2 * T : zBack + 2 * T] as Vec3), [0, 0, front ? 1 : -1], { name: "Angle bracket", len: 30, dia: 20, on: front ? "RFr" : "RBk" });
+ const boardTabs: Vec3[] = [zBack + 1.5 * T, D / 2 - 1.5 * T].flatMap((z) => {
+ const k = cab ? 4 : bays + 1;
+ return Array.from({ length: k }, (_, i) => [-xi + 60 + ((2 * xi - 120) * i) / (k - 1), yr, z] as Vec3);
+ });
+ const boardScrews: CustomStep = {
+ title: "Screw the board to the rails",
+ detail: "One screw through each tab under the rails into the board.",
+ fix: [fx("screw", boardTabs, [0, 1, 0], { ...WOOD, on: "RBk", mate: "P" })],
+ tools: ["screwdriver"],
+ };
+ const cornerFeet: [number, number, string][] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * xs, sz * zs, sx < 0 ? "L" : "R"] as [number, number, string]));
+ const midFeet = mids.flatMap((x, i) => [[x, zs, `MF${i}`], [x, zBack + T / 2, `MB${i}`]] as [number, number, string][]);
+
+ const steps: CustomStep[] = [];
+ if (!cab) {
+ steps.push(
+ {
+ title: "Slide the top rail onto a side frame",
+ detail: "Lying on its back on a rug: the side frame stands on its back edge, the rail lies along the rug against its top lug.",
+ add: ["L", "RT"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ { title: "Screw the rail on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["RT"]), tools: ["screwdriver"] },
+ { title: "Hook on the bottom shelf", detail: "Stand it on its edge on the rug. Its hooks drop onto the side frame's lowest lugs.", add: ["M"] },
+ { title: "Screw the shelf on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["M"]), tools: ["screwdriver"] },
+ { title: "Hook on the front top rail", detail: "Along the top, the lug under its end onto the side frame.", add: ["RTF"] },
+ { title: "Screw it on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["RTF"]), tools: ["screwdriver"] },
+ { title: "Slide on the other side frame together", detail: "One of you steadies the long parts while the other pushes the frame onto their ends.", add: ["R"], people: 2, warnings: ["two"] },
+ { title: "Screw it on", detail: "Three screws: the two top rails and the shelf.", fix: sideScrews(1, ["RT", "M", "RTF"]), tools: ["screwdriver"] },
+ ...brackets,
+ { title: "Screw four feet into the side frames", detail: "Into the post ends pointing up, by hand.", fix: feetAt(cornerFeet) },
+ {
+ title: n > 2 ? `Fit the ${n} front middle posts` : "Fit the two front middle posts",
+ detail: "The posts with hinge holes. Each one sits against the front of the bottom shelf, with a long screw through the shelf into it.",
+ add: mids.map((_, i) => `MF${i}`),
+ fix: [shelfToMid(true)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: n > 2 ? `Fit the ${n} back middle posts` : "Fit the two back middle posts",
+ detail: "The plain posts, along the back. A long screw through the back of the shelf into each.",
+ add: mids.map((_, i) => `MB${i}`),
+ fix: [shelfToMid(false)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw in the two board rails",
+ detail: "Holes for the board facing the bottom shelf. A long screw through each rail into every middle post.",
+ add: ["RBk", "RFr"],
+ fix: [railToMid(false), railToMid(true)],
+ tools: ["screwdriver"],
+ },
+ { title: `Screw ${2 * n} feet into the middle posts`, detail: "By hand, the same as the others.", fix: feetAt(midFeet) },
+ { title: "Stand it up together", detail: "Turn it over onto its feet.", pose: "+y", people: 2, warnings: ["two"] },
+ { title: "Lay the board on its rails", detail: "Show side up. It drops in between the middle posts.", add: ["P"] },
+ { ...boardScrews, detail: "From underneath, one screw through each tab." },
+ );
+ } else {
+ steps.push(
+ {
+ title: "Hook the bottom shelf onto a side frame",
+ detail: "Lying on its back on a rug: the side frame stands on its back edge, and the shelf's hooks drop onto its lowest lugs.",
+ add: ["L", "M"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ { title: "Screw the shelf on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["M"]), tools: ["screwdriver"] },
+ { title: "Hook on the back board rail", detail: "The rail lying along the rug, holes for the board facing up the frame.", add: ["RBk"] },
+ { title: "Screw it on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["RBk"]), tools: ["screwdriver"] },
+ { title: "Slide the back middle post under", detail: "Under the shelf and the rail, its end level with the side frame's posts.", add: ["MB0"] },
+ { title: "Screw the shelf to the middle post", detail: "One long screw down through the shelf into the post.", fix: [shelfToMid(false)], tools: ["screwdriver"] },
+ { title: "Fix the rail to the middle post", detail: "An angle bracket on the rail and a long screw through it into the post.", fix: [angleAt(false), railToMid(false)], tools: ["screwdriver"] },
+ { title: "Hook on the front board rail", detail: "Onto the side frame's upper lugs, the same way round as the back one.", add: ["RFr"] },
+ { title: "Slide the other side frame on together", detail: "One of you holds the shelf and rails while the other pushes the frame onto their ends.", add: ["R"], people: 2, warnings: ["two"] },
+ { title: "Screw it all together", detail: "Four screws: the shelf and both rails on the new side, and the front rail on the first side.", fix: [...sideScrews(1, ["M", "RBk", "RFr"]), ...sideScrews(-1, ["RFr"])], tools: ["screwdriver"] },
+ ...brackets,
+ { title: "Lay the front middle post on", detail: "Across the shelf and the front rail, its end level with the other posts.", add: ["MF0"] },
+ { title: "Screw the shelf to it", detail: "One long screw up through the shelf into the post.", fix: [shelfToMid(true)], tools: ["screwdriver"] },
+ { title: "Fix the front rail to it", detail: "An angle bracket and a long screw, as at the back.", fix: [angleAt(true), railToMid(true)], tools: ["screwdriver"] },
+ { title: "Slide the board in between the rails", detail: "Show side towards the open top. It slides in along the rails from the top end.", add: ["P"], from: { P: [0, 600, 0] } },
+ boardScrews,
+ {
+ title: "Screw on the door stop",
+ detail: "Under the front rail in the middle, where the two doors meet. One screw.",
+ fix: [
+ fx("screw", [[0, yr - T, D / 2 - 1.5 * T]], [0, 1, 0], { ...M6, on: "RFr" }),
+ fx("plate", [[24, yr - T - 2, D / 2 - 1.5 * T]], [0, 1, 0], { name: "Door stop", len: 40, dia: 20, on: "RFr" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw the six feet into the posts", detail: "Turn each one into the bottom end of a post by hand.", fix: feetAt([...cornerFeet, ...midFeet]) },
+ { title: "Stand it up together", detail: "Lift it upright from the top, don't drag it up by one post.", pose: "+y", people: 2, warnings: ["two"] },
+ );
+ }
+
+ const top = topSteps(b, cab ? [-xs, xs, 0] : [-xs, xs], [], cab ? 8 : 2 * (bays + 1));
+ parts.push(...top.parts);
+ if (!cab) {
+ // the top frame screws into the side frames and the back middle posts; the front ones get their own step
+ const corner = (sz: number) => [-1, 1].map((sx) => [sx * xs, yp - 35, sz * (D / 2)] as Vec3);
+ top.steps[2].fix = [
+ fx("screw", [...corner(-1), ...mids.map((x) => [x, yp - 12, -D / 2] as Vec3)], [0, 0, 1], { ...M6, on: "TF" }),
+ fx("screw", corner(1), [0, 0, -1], { ...M6, on: "TF" }),
+ ];
+ top.steps[2].detail = "One screw through each corner post, and one through the back rail at each middle post, into the frame.";
+ }
+ steps.push(...top.steps);
+ if (!cab) {
+ steps.push({
+ title: "Screw the front middle posts to the top rail",
+ detail: "One screw at the top of each, through the rail into the post.",
+ fix: [fx("screw", mids.map((x) => [x, yp - T / 2, D / 2] as Vec3), [0, 0, -1], { ...M6, on: "RTF" })],
+ tools: ["screwdriver"],
+ });
+ } else {
+ parts.push(...braces(b));
+ steps.push(braceStep(b));
+ }
+ steps.push({ title: "Level it with the feet", detail: "Turn the feet in or out until it stands steady." });
+ // doors: hinges on the door, then onto its post; on a bench the last door hangs on the right, on the 100x95 the
+ // two doors meet in the middle
+ const hingeSide = (i: number) => (i === bays - 1 ? 1 : -1);
+ const hingeYs = [dy0 + 40, dy1 - 80];
+ const hingePts = (i: number): Vec3[] => {
+ const x = hingeSide(i) < 0 ? postX[i] + T / 2 : postX[i + 1] - T / 2;
+ return hingeYs.map((y) => [x, y, D / 2] as Vec3);
+ };
+ steps.push({
+ title: "Screw two hinges onto each door",
+ detail: "Lay the doors on the rug, mesh side down. Two screws hold each hinge to the door frame.",
+ add: doorIds,
+ from: Object.fromEntries(doorIds.map((id) => [id, [0, 0, 500] as Vec3])),
+ fix: [
+ ...doorIds.map((id, i) => fx("hinge", hingePts(i), [0, 0, -1], { on: id })),
+ ...doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] - hingeSide(i) * 10, p[1] - 20, D / 2 + 18], [p[0] - hingeSide(i) * 10, p[1] + 20, D / 2 + 18]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
+ ],
+ tools: ["screwdriver"],
+ });
+ steps.push({
+ title: "Hang the doors",
+ detail: "Hold each door in its opening and screw its hinges to the post, two screws each. Adjust the hinges until the gaps are even.",
+ fix: doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] + hingeSide(i) * 12, p[1] - 20, D / 2], [p[0] + hingeSide(i) * 12, p[1] + 20, D / 2]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
+ tools: ["screwdriver"],
+ });
+ // a round magnet inside the top corner of each door, away from its hinges
+ const magnets: Vec3[] = doorIds.map((_, i) => [hingeSide(i) < 0 ? postX[i + 1] - T / 2 - 15 : postX[i] + T / 2 + 15, dy1 - 12, D / 2]);
+ steps.push({
+ title: "Screw a magnet into each door",
+ detail: "Inside the top corner away from the hinges, one screw through the magnet into the door frame.",
+ fix: doorIds.flatMap((id, i) => [fx("washer", [magnets[i]], [0, 0, 1], { name: "Magnet", len: 6, dia: 16, on: id }), fx("screw", [magnets[i]], [0, 0, 1], { len: 10, dia: 4, on: id })]),
+ tools: ["screwdriver"],
+ });
+ steps.push(wallStep(b, true));
+ if (!cab) {
+ // the cable clips from the fittings bag, stuck along the back board rail
+ const k = bays === 4 ? 14 : 10;
+ const clips = Array.from({ length: k }, (_, i) => [-xi + 50 + ((2 * xi - 100) * i) / (k - 1), yr - T, zBack + 1.5 * T] as Vec3);
+ steps.push({
+ title: "Clip the cables to the back rail",
+ detail: "Press the cable clips on where your cables run, and push the cables into them.",
+ fix: [fx("clip", clips, [0, 1, 0], { name: "Cable clip", len: 12, dia: 16, on: "RBk" })],
+ });
+ }
+ return { parts, steps };
+}
+
+/* ---------- the sideboard, 111x47x95 ---------- */
+
+/**
+ * The sideboard's manual stands it on its right side frame on a rug: the four long rails and the bottom mesh shelf
+ * hook onto that frame's lugs, the left side frame goes on from above, and the curved brackets go under the shelf.
+ * Then it lies on its back for the middle posts, the board and its angle brackets, stands up for the drawer rail, the
+ * runners and the top, gets its two back panels, the doors and the wall fixing, and last the two drawers are built
+ * and slid in.
+ */
+function sideboard(s: ProductSpec): CustomParams {
+ const b = bodyOf(s);
+ const { W, D, yp } = b;
+ const xi = W / 2 - T;
+ const xs = W / 2 - T / 2, zs = D / 2 - T / 2;
+ const zBack = -D / 2;
+ const yb = 160; // top of the bottom mesh shelf
+ const yr = 440; // top of the board rails
+ const ydr = yp - 150; // bottom of the drawer fronts
+ const yRun = ydr + 50; // the drawer runners
+ const rungs = [yb, yr, yRun + 10, yp];
+ const parts: CustomPart[] = [sideFrame(b, "L", -1, rungs, [yb, yp - 20]), sideFrame(b, "R", 1, rungs, [yb, yp - 20])];
+ const rail = (id: string, name: string, y: number, front: boolean) =>
+ part(id, name, [bx([-xi, y - T, front ? D / 2 - 2 * T : zBack + T], [xi, y, front ? D / 2 - T : zBack + 2 * T])], "metal");
+ parts.push(rail("TB", "Top rail", yp, false), rail("TFr", "Top rail", yp, true), rail("RBk", "Board rail", yr, false), rail("RFr", "Board rail", yr, true));
+ parts.push(meshShelf("M", -xi, xi, zBack + T, D / 2 - T, yb, "Bottom shelf"));
+ parts.push(part("MB", "Middle post", [bx([-T / 2, F, zBack], [T / 2, yp, zBack + T])], "metal"));
+ parts.push(part("MF", "Middle post", [bx([-T / 2, F, D / 2 - T], [T / 2, yp, D / 2])], "metal"));
+ parts.push({ id: "P", name: "Shelf board", size: [2 * xi, PT, D - 2 * T], pos: [0, yr + PT / 2, 0], material: "wood" });
+ // the rail in the middle the inner drawer runners screw onto, between the two middle posts
+ parts.push(part("MR", "Drawer rail", [bx([-10, yRun - 30, zBack + T], [10, yRun + 30, D / 2 - T])], "metal"));
+ const zHold = D / 2 - T - 10;
+ for (const sx of [-1, 1]) parts.push(arch(b, `A${sx < 0 ? "l" : "r"}`, sx, yb - 20, { back: zHold - 12 }));
+ // two mesh back panels, one over each half
+ for (const sx of [-1, 1]) parts.push(part(sx < 0 ? "BL" : "BR", "Back panel", [bx([sx < 0 ? -W / 2 : 0, yb - 20, zBack - 4], [sx < 0 ? 0 : W / 2, yp, zBack])], "metal"));
+ // doors under the drawers, hinged on the side posts, meeting at the middle post
+ const postX = [-xs, 0, xs];
+ const dy0 = yb - 20, dy1 = ydr - 6;
+ const doorIds = ["D0", "D1"];
+ doorIds.forEach((id, i) => {
+ const x0 = postX[i] + T / 2 + 3, x1 = postX[i + 1] - T / 2 - 3;
+ const z0 = D / 2, z1 = D / 2 + 18, f = 18;
+ parts.push(
+ part(id, "Door", [
+ bx([x0, dy0, z0], [x1, dy0 + f, z1]),
+ bx([x0, dy1 - f, z0], [x1, dy1, z1]),
+ bx([x0, dy0 + f, z0], [x0 + f, dy1 - f, z1]),
+ bx([x1 - f, dy0 + f, z0], [x1, dy1 - f, z1]),
+ bx([x0 + f, dy0 + f, z0 + 8], [x1 - f, dy1 - f, z0 + 10]),
+ ], "metal"),
+ );
+ });
+ // the drawers: a steel box (bottom, sides, back) behind a front, each on two runners
+ const drawerIds = ["DR0", "DR1"];
+ const box = { y0: ydr + 12, y1: yp - T - 8, z0: zBack + T + 20, z1: D / 2 };
+ drawerIds.forEach((id, i) => {
+ const sx = i ? 1 : -1;
+ const bx0 = sx < 0 ? -xi + 14 : 24, bx1 = sx < 0 ? -24 : xi - 14;
+ const fx0 = postX[i] + T / 2 + 3, fx1 = postX[i + 1] - T / 2 - 3;
+ parts.push(
+ part(id, "Drawer", [
+ bx([fx0, ydr, D / 2], [fx1, yp - 4, D / 2 + 18]),
+ bx([bx0, box.y0, box.z0], [bx1, box.y0 + 2, box.z1]),
+ bx([bx0, box.y0, box.z0], [bx0 + 2, box.y1, box.z1]),
+ bx([bx1 - 2, box.y0, box.z0], [bx1, box.y1, box.z1]),
+ bx([bx0, box.y0, box.z0], [bx1, box.y1, box.z0 + 2]),
+ ], "metal"),
+ );
+ });
+
+ const sideScrews = (sx: number, which: string[]) =>
which.map((id) => {
- const y = id === "M" ? yb - 10 : yp - T / 2;
- const z = id === "M" ? -D / 2 + 1.5 * T : id === "RT" ? -D / 2 + T / 2 : D / 2 - T / 2;
+ const y = id === "M" ? yb - 10 : id.startsWith("T") ? yp - T / 2 : yr - T / 2;
+ const z = id === "M" ? zBack + 1.5 * T : ["TB", "RBk"].includes(id) ? zBack + 1.5 * T : D / 2 - 1.5 * T;
return fx("screw", [[sx * (W / 2), y, z]], [-sx, 0, 0], { ...M6, on: sx < 0 ? "L" : "R", mate: id });
});
+ const bracket = (sx: number) => archFix(b, `A${sx < 0 ? "l" : "r"}`, sx, yb - 20, zHold, sx < 0 ? "L" : "R");
+ const long = (pts: Vec3[], front: boolean, on: string) => fx("screw", pts, [0, 0, front ? 1 : -1], { ...LONG, on });
+ const SMALL = { len: 8, dia: 4 }; // the runner screws
+ const runner = (on: string, x: number, dir: number): CustomFix[] => [
+ fx("runner", [[x, yRun, 0]], [dir, 0, 0], { len: D - 2 * T - 40, dia: 30, on }),
+ fx("screw", [-140, 40, 150].map((z) => [x, yRun, z] as Vec3), [dir, 0, 0], { ...SMALL, on }),
+ ];
+ const cornerFeet: [number, number, string][] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * xs, sz * zs, sx < 0 ? "L" : "R"] as [number, number, string]));
+ const boardTab = (x: number, front: boolean): Vec3 => [x, yr, front ? D / 2 - 1.5 * T : zBack + 1.5 * T];
+
const steps: CustomStep[] = [
{
- title: "Slide the top rail onto a side frame",
- detail: "Lying on its back on a rug: the side frame stands on its back edge, the rail lies along the rug against its top lug.",
- add: ["L", "RT"],
- pose: "+z",
+ title: "Screw the six feet into the posts",
+ detail: "Lay both side frames and the two middle posts on a rug and turn a foot into the bottom end of each post.",
+ add: ["R"],
+ wait: ["L", "MB", "MF"],
+ fix: feetAt([...cornerFeet, [0, zBack + T / 2, "MB"], [0, zs, "MF"]]),
+ pose: "-x",
warnings: ["floor"],
},
- { title: "Screw the rail on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["RT"]), tools: ["screwdriver"] },
- { title: "Hook on the bottom shelf", detail: "Stand it on its edge on the rug. Its hooks drop onto the side frame's lowest lugs.", add: ["M"] },
- { title: "Screw the shelf on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["M"]), tools: ["screwdriver"] },
- { title: "Hook on the front top rail", detail: "Along the top, the lug under its end onto the side frame.", add: ["RTF"] },
- { title: "Screw it on", detail: "One screw through the side frame.", fix: sideScrews(-1, ["RTF"]), tools: ["screwdriver"] },
- { title: "Slide on the other side frame together", detail: "One of you steadies the long parts while the other pushes the frame onto their ends.", add: ["R"], people: 2, warnings: ["two"] },
- { title: "Screw it on", detail: "Three screws: the two top rails and the shelf.", fix: sideScrews(1, ["RT", "M", "RTF"]), tools: ["screwdriver"] },
{
- title: "Screw the curved brackets to the shelf",
- detail: "One at each front corner of the bottom shelf, curve towards the leg. Two screws each.",
- add: ["Al", "Ar"],
- fix: [-1, 1].map((sx) => archFix(b, `A${sx < 0 ? "l" : "r"}`, sx, yb, sx < 0 ? "L" : "R").shelf),
+ title: "Screw a drawer runner onto each side frame",
+ detail: "Along the upper rung, wheel at the front. Check the letters on the runners: each goes on its own side. Three small screws each.",
+ fix: [...runner("L", -xi, -1), ...runner("R", xi, 1)],
tools: ["screwdriver"],
},
+ { title: "Hook the two top rails onto the side frame", detail: "With the side frame on the rug, the rails stand up from its top end. Their ends drop onto the lugs.", add: ["TB", "TFr"], from: { TB: [-500, 0, 0], TFr: [-500, 0, 0] } },
+ { title: "Hook on the two board rails", detail: "Onto the lugs half way up the frame, holes for the board towards the top.", add: ["RBk", "RFr"], from: { RBk: [-500, 0, 0], RFr: [-500, 0, 0] } },
+ { title: "Screw the rails to the side frame", detail: "Four screws, one into each rail end.", fix: sideScrews(1, ["TB", "TFr", "RBk", "RFr"]), tools: ["screwdriver"] },
+ { title: "Hook on the bottom shelf", detail: "Slide it down onto the lowest lugs, the hooks the way the drawing shows.", add: ["M"], from: { M: [-500, 0, 0] } },
+ { title: "Screw a curved bracket under the shelf", detail: "At the front corner next to the side frame, curve towards the foot. Two screws up into the shelf.", add: ["Ar"], fix: [bracket(1).shelf], tools: ["screwdriver"] },
+ { title: "Screw the shelf to the side frame", detail: "One screw through the frame.", fix: sideScrews(1, ["M"]), tools: ["screwdriver"] },
+ { title: "Lower the other side frame on", detail: "Feet end down, its lugs into the rail ends and the shelf, in the order the drawing numbers them.", add: ["L"], from: { L: [-500, 0, 0] } },
+ { title: "Screw the other curved bracket under the shelf", detail: "The same way, at this side's front corner.", add: ["Al"], fix: [bracket(-1).shelf], tools: ["screwdriver"] },
+ { title: "Screw it to the side frame", detail: "Five screws: the four rails and the shelf.", fix: sideScrews(-1, ["TB", "TFr", "RBk", "RFr", "M"]), tools: ["screwdriver"] },
{
- title: "Bolt the brackets through the legs",
- detail: "A screw from the front and a sleeve nut from behind, two in each bracket.",
- fix: [-1, 1].flatMap((sx) => archFix(b, `A${sx < 0 ? "l" : "r"}`, sx, yb, sx < 0 ? "L" : "R").post),
+ title: "Bolt both brackets through the front posts",
+ detail: "A screw from the front and a sleeve nut from behind, two in each bracket. Hold the nut with one screwdriver and turn the screw with the other.",
+ fix: [...bracket(1).post, ...bracket(-1).post],
tools: ["screwdriver"],
},
+ { title: "Lay it on its back and slide in the back middle post", detail: "Turn it onto a rug, front up. The post slides under the rails, its foot level with the others.", add: ["MB"], pose: "+z", warnings: ["floor"] },
{
- title: "Screw four feet into the side frames",
- detail: "Into the post ends pointing up, by hand.",
- fix: feetAt([-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * xs, sz * zs, sx < 0 ? "L" : "R"] as [number, number, string]))),
+ title: "Screw the shelf and top rail to the post",
+ detail: "Two long screws, down through the bottom shelf and the back top rail into the post.",
+ fix: [long([[0, yb - 10, zBack + T + 20]], false, "M"), long([[0, yp - T / 2, zBack + 2 * T]], false, "TB")],
+ tools: ["screwdriver"],
},
{
- title: n > 2 ? `Fit the ${n} front middle posts` : "Fit the two front middle posts",
- detail: "The posts with hinge holes. Each one sits against the front of the bottom shelf, with a long screw through the shelf into it.",
- add: mids.map((_, i) => `MF${i}`),
- fix: [fx("screw", mids.map((x) => [x, yb - 10, D / 2 - T] as Vec3), [0, 0, 1], { ...LONG, on: "M" })],
+ title: "Lay in the board and screw it to the rails",
+ detail: "Show side to the top. One wood screw through each of the four tabs under the rails.",
+ add: ["P"],
+ from: { P: [0, 0, 500] },
+ fix: [fx("screw", [-1, 1].flatMap((sx) => [boardTab(sx * (xi - 150), false), boardTab(sx * (xi - 150), true)]), [0, 1, 0], { ...WOOD, on: "RBk", mate: "P" })],
tools: ["screwdriver"],
},
{
- title: n > 2 ? `Fit the ${n} back middle posts` : "Fit the two back middle posts",
- detail: "The plain posts, along the back. A long screw through the back of the shelf into each.",
- add: mids.map((_, i) => `MB${i}`),
- fix: [fx("screw", mids.map((x) => [x, yb - 10, -D / 2 + T] as Vec3), [0, 0, -1], { ...LONG, on: "M" })],
+ title: "Screw the door stops onto the front middle post",
+ detail: "On its back face, near the top and the bottom of the doors, one screw each.",
+ fix: [
+ fx("screw", [[0, dy0 + 60, D / 2 - T], [0, dy1 - 60, D / 2 - T]], [0, 0, 1], { ...M6, on: "MF" }),
+ fx("plate", [[24, dy0 + 60, D / 2 - T - 2], [24, dy1 - 60, D / 2 - T - 2]], [0, 0, 1], { name: "Door stop", len: 40, dia: 20, on: "MF" }),
+ ],
tools: ["screwdriver"],
},
{
- title: "Screw in the two board rails",
- detail: "Holes for the board facing the bottom shelf. A long screw through each rail into every middle post.",
- add: ["RBk", "RFr"],
+ title: "Lay the front middle post on and screw it",
+ detail: "Its foot level with the others. Two long screws up through the bottom shelf and the front top rail into it.",
+ add: ["MF"],
+ from: { MF: [0, 0, 400] },
+ fix: [long([[0, yb - 10, D / 2 - T - 20]], true, "M"), long([[0, yp - T / 2, D / 2 - 2 * T]], true, "TFr")],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fix the board rails to the middle posts",
+ detail: "An angle bracket on each board rail at its post, and a long screw through it into the post.",
fix: [
- fx("screw", mids.map((x) => [x, yr - T / 2, zBack + 2 * T] as Vec3), [0, 0, -1], { ...LONG, on: "RBk", mate: "MB0" }),
- fx("screw", mids.map((x) => [x, yr - T / 2, D / 2 - 2 * T] as Vec3), [0, 0, 1], { ...LONG, on: "RFr", mate: "MF0" }),
+ fx("angle", [[-24, yr - 20, zBack + 2 * T]], [0, 0, -1], { name: "Angle bracket", len: 30, dia: 20, on: "RBk" }),
+ fx("angle", [[-24, yr - 20, D / 2 - 2 * T]], [0, 0, 1], { name: "Angle bracket", len: 30, dia: 20, on: "RFr" }),
+ long([[0, yr - T / 2, zBack + 2 * T]], false, "RBk"),
+ long([[0, yr - T / 2, D / 2 - 2 * T]], true, "RFr"),
],
tools: ["screwdriver"],
},
{
- title: `Screw ${2 * n} feet into the middle posts`,
- detail: "By hand, the same as the others.",
- fix: feetAt(mids.flatMap((x, i) => [[x, zs, `MF${i}`], [x, zBack + T / 2, `MB${i}`]] as [number, number, string][])),
+ title: "Screw the angle brackets to the board",
+ detail: "One wood screw up through each bracket into the board.",
+ fix: [fx("screw", [[-24, yr, zBack + 2 * T + 12], [-24, yr, D / 2 - 2 * T - 12]], [0, 1, 0], { ...WOOD, on: "P" })],
+ tools: ["screwdriver"],
+ },
+ { title: "Stand it up together", detail: "Lift it onto its feet from the top, one of you at each end.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Screw in the drawer rail",
+ detail: "Between the two middle posts, at the height of the runners. Two screws through each post into its ends.",
+ add: ["MR"],
+ fix: [
+ fx("screw", [yRun - 15, yRun + 15].map((y) => [0, y, D / 2] as Vec3), [0, 0, -1], { ...M6, on: "MF", mate: "MR" }),
+ fx("screw", [yRun - 15, yRun + 15].map((y) => [0, y, zBack] as Vec3), [0, 0, 1], { ...M6, on: "MB", mate: "MR" }),
+ ],
+ tools: ["screwdriver"],
},
- { title: "Stand it up together", detail: "Turn it over onto its feet.", pose: "+y", people: 2, warnings: ["two"] },
+ { title: "Screw two runners onto the drawer rail", detail: "One on each face, the letters matching the drawing. Three small screws each.", fix: [...runner("MR", -10, 1), ...runner("MR", 10, -1)], tools: ["screwdriver"] },
];
- const boardTabs: Vec3[] = [zBack + 1.5 * T, D / 2 - 1.5 * T].flatMap((z) => Array.from({ length: bays + 1 }, (_, i) => [-xi + 60 + ((2 * xi - 120) * i) / bays, yr, z] as Vec3));
- steps.push({ title: "Lay the board on its rails", detail: "Show side up. It drops in between the middle posts.", add: ["P"] });
- steps.push({
- title: "Screw the board to the rails",
- detail: "From underneath, one screw through each tab.",
- fix: [fx("screw", boardTabs, [0, 1, 0], { ...WOOD, on: "RBk", mate: "P" })],
- tools: ["screwdriver"],
- });
- const top = topSteps(b, [-xs, xs], [], 2 * (bays + 1));
+ const top = topSteps(b, [-xs, xs, 0], [], 8);
parts.push(...top.parts);
- // the top frame screws into the side frames and the back middle posts; the front ones get their own step
- top.steps[2].fix = [
- fx("screw", [...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * xs, yp - 12, sz * (D / 2)] as Vec3)), ...mids.map((x) => [x, yp - 12, -D / 2] as Vec3)], [0, 0, 1], { ...M6, on: "TF" }),
- ];
- top.steps[2].detail = "One screw through each corner post, and one through the back rail at each middle post, into the frame.";
steps.push(...top.steps);
+ // the back panels: six screws each, into the side post, the middle post and the rails; the top middle ones
+ // stay clear of the drawer rail's screws so neither gets pushed off the post
+ const backPts = (sx: number): Vec3[] => {
+ const o = sx < 0 ? 0 : 40;
+ return [...[yb + 20, yr + 60, yp - 60].map((y) => [sx * xs, y, zBack - 4] as Vec3), ...[yb + 20 + 40 - o, yr + 100 - o, yp - 140 + 2 * o].map((y) => [sx * 6, y, zBack - 4] as Vec3)];
+ };
steps.push({
- title: "Screw the front middle posts to the top rail",
- detail: "One screw at the top of each, through the rail into the post.",
- fix: [fx("screw", mids.map((x) => [x, yp - T / 2, D / 2] as Vec3), [0, 0, -1], { ...M6, on: "RTF" })],
+ title: "Screw on the two back panels together",
+ detail: "Turn it so the back faces you. One of you holds each panel in place while the other fits its six screws.",
+ add: ["BL", "BR"],
+ from: { BL: [0, 0, -400], BR: [0, 0, -400] },
+ fix: [-1, 1].map((sx) => fx("screw", backPts(sx), [0, 0, 1], { len: 10, dia: 6, on: sx < 0 ? "BL" : "BR" })),
tools: ["screwdriver"],
+ people: 2,
+ warnings: ["two"],
});
- steps.push({ title: "Level it with the feet", detail: "Turn the feet in or out until it stands steady." });
- // doors: hinges on the door, then onto its post; the last door hangs on the right
- const hingeSide = (i: number) => (i === bays - 1 ? 1 : -1);
- const hingeYs = [yb + 40, yp - 60];
- const hingePts = (i: number): Vec3[] => {
- const x = hingeSide(i) < 0 ? postX[i] + T / 2 : postX[i + 1] - T / 2;
- return hingeYs.map((y) => [x, y, D / 2] as Vec3);
- };
+ steps.push({ title: "Level it with the feet", detail: "Turn the six feet in or out until it stands steady and square." });
+ const hingeYs = [dy0 + 50, dy1 - 80];
+ const hingePts = (i: number): Vec3[] => hingeYs.map((y) => [i ? xs - T / 2 : -xs + T / 2, y, D / 2] as Vec3);
+ const hs = (i: number) => (i ? 1 : -1);
steps.push({
title: "Screw two hinges onto each door",
detail: "Lay the doors on the rug, mesh side down. Two screws hold each hinge to the door frame.",
@@ -502,33 +834,343 @@ function bench(s: ProductSpec): CustomParams {
from: Object.fromEntries(doorIds.map((id) => [id, [0, 0, 500] as Vec3])),
fix: [
...doorIds.map((id, i) => fx("hinge", hingePts(i), [0, 0, -1], { on: id })),
- ...doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] - hingeSide(i) * 10, p[1] - 15, D / 2 + 18], [p[0] - hingeSide(i) * 10, p[1] + 15, D / 2 + 18]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
+ ...doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] - hs(i) * 10, p[1] - 20, D / 2 + 18], [p[0] - hs(i) * 10, p[1] + 20, D / 2 + 18]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
],
tools: ["screwdriver"],
});
steps.push({
title: "Hang the doors",
- detail: "Hold each door in its bay and screw its hinges to the post, two screws each. Adjust the hinges until the gaps are even.",
- fix: doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] + hingeSide(i) * 8, p[1] - 15, D / 2], [p[0] + hingeSide(i) * 8, p[1] + 15, D / 2]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
+ detail: "Hold each door in its opening and screw its hinges to the side post, two screws each.",
+ fix: doorIds.map((id, i) => fx("screw", hingePts(i).flatMap((p) => [[p[0] + hs(i) * 12, p[1] - 20, D / 2], [p[0] + hs(i) * 12, p[1] + 20, D / 2]] as Vec3[]), [0, 0, -1], { ...M6, on: id })),
tools: ["screwdriver"],
});
+ const magnets = (i: number): Vec3[] => [dy0 + 12, dy1 - 12].map((y) => [i ? T / 2 + 18 : -T / 2 - 18, y, D / 2] as Vec3);
steps.push({
- title: "Fit the magnetic catches",
- detail: "One on each door, on the edge away from the hinges, with a screw.",
- fix: [
- fx(
- "clip",
- doorIds.map((_, i) => {
- const x = hingeSide(i) < 0 ? postX[i + 1] - T / 2 - 20 : postX[i] + T / 2 + 20;
- return [x, (yb + yp) / 2, D / 2 + 18] as Vec3;
- }),
- [0, 0, -1],
- { name: "Magnetic catch", len: 10, dia: 16, on: doorIds[0] },
- ),
- ],
+ title: "Screw two magnets into each door",
+ detail: "Inside the top and bottom corners by the middle post, one screw through each magnet into the door frame.",
+ fix: doorIds.flatMap((id, i) => [fx("washer", magnets(i), [0, 0, 1], { name: "Magnet", len: 6, dia: 16, on: id }), fx("screw", magnets(i), [0, 0, 1], { len: 10, dia: 4, on: id })]),
tools: ["screwdriver"],
});
- steps.push(wallStep(b, true));
+ steps.push({ title: "Line up the doors", detail: "Loosen the hinge screws, slide each door until the gaps are even and the doors are level, then tighten them again.", tools: ["screwdriver"] });
+ steps.push({
+ title: "Screw on the wall spacers",
+ detail: "Into the back of the two side frames at the top. Use the pair that clears your skirting board.",
+ fix: [fx("cap", [-1, 1].map((sx) => [sx * xs, yp - 30, zBack - 4] as Vec3), [0, 0, 1], { name: "Wall spacer", len: 20, dia: 30, on: "BL" })],
+ });
+ const wall = wallStep(b, true);
+ const wallPts: Vec3[] = [-1, 1].map((sx) => [sx * (W / 2 - 120), yp + T / 2, -D / 2]);
+ steps.push({ ...wall, detail: "Two screws with a cup washer each, through the back rail of the top frame into the wall. Screws and plugs aren't included: pick ones made for your wall.", fix: [...wall.fix!, fx("washer", wallPts, [0, 0, -1], { name: "Cup washer", len: 3, dia: 24, on: "TF" })] });
+ // the drawers, built on the rug and then slid in
+ const DSCREW = { len: 10, dia: 5 };
+ const NUT = { len: 5, dia: 8 };
+ const onBoth = (pts: (i: number) => Vec3[], kind: CustomFix["kind"], o: Partial<CustomFix>) => drawerIds.map((id, i) => fx(kind, pts(i), [0, 1, 0], { ...o, on: id }));
+ const dx = (i: number) => (i ? 1 : -1);
+ const frontPts = (i: number): Vec3[] => [-90, 90].map((k) => [dx(i) * (W / 4 + 10) + k, box.y0, D / 2 + 9] as Vec3);
+ const sidePts = (i: number): Vec3[] => {
+ const x0 = i ? 24 : -xi + 14, x1 = i ? xi - 14 : -24;
+ return [[x0 + 1, box.y1 - 15, D / 2 - 6], [x1 - 1, box.y1 - 15, D / 2 - 6]];
+ };
+ const backPtsD = (i: number): Vec3[] => {
+ const x0 = i ? 24 : -xi + 14, x1 = i ? xi - 14 : -24;
+ return [box.y0 + 25, box.y1 - 25].flatMap((y) => [[x0 + 1, y, box.z0 + 10], [x1 - 1, y, box.z0 + 10]] as Vec3[]);
+ };
+ steps.push(
+ {
+ title: "Clip each drawer front onto its bottom",
+ detail: "Build both drawers on the rug. The front's tabs drop into the slots along the bottom's front edge.",
+ wait: drawerIds,
+ },
+ {
+ title: "Bolt the fronts to the bottoms",
+ detail: "Two screws down through each bottom into the front, a nut on each held with the spanner.",
+ fix: [...onBoth(frontPts, "screw", DSCREW), ...onBoth(frontPts, "nut", NUT)],
+ tools: ["screwdriver", "wrench"],
+ },
+ {
+ title: "Hook on the sides and bolt them",
+ detail: "Each side hooks into the bottom and the front. One screw and nut where it meets the front.",
+ fix: drawerIds.flatMap((id, i) => [fx("screw", sidePts(i), [0, 0, 1], { ...DSCREW, on: id }), fx("nut", sidePts(i), [0, 0, 1], { ...NUT, on: id })]),
+ tools: ["screwdriver", "wrench"],
+ },
+ {
+ title: "Hook in the backs and screw them",
+ detail: "The back slides down between the sides. Four screws in each drawer.",
+ fix: drawerIds.map((id, i) => fx("screw", backPtsD(i), [0, 0, 1], { ...DSCREW, on: id })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Slide the drawers in",
+ detail: "Rest each drawer on its runners and push it in until it drops into place.",
+ add: drawerIds,
+ from: Object.fromEntries(drawerIds.map((id) => [id, [0, 0, 450] as Vec3])),
+ },
+ );
+ return { parts, steps };
+}
+
+/* ---------- the desk, 140x70 ---------- */
+
+/** A frame of two posts (front and back) welded to rungs, standing at x0..x0+T. */
+function postFrame(b: Body, id: string, name: string, x0: number, rungs: number[], o: { mesh?: [number, number]; corners?: [number, number] } = {}): CustomPart {
+ const x1 = x0 + T, zb = -b.D / 2, zf = b.D / 2;
+ const boxes: Box[] = [bx([x0, F, zb], [x1, b.yp, zb + T]), bx([x0, F, zf - T], [x1, b.yp, zf])];
+ for (const y of rungs) boxes.push(bx([x0, y - 20, zb + T], [x1, y, zf - T]));
+ if (o.mesh) boxes.push(bx([x0 + T / 2 - MESH / 2, o.mesh[0], zb + T], [x0 + T / 2 + MESH / 2, o.mesh[1], zf - T]));
+ // the curved corners welded inside an open end frame, drawn as short diagonal strips
+ const extra: PartPiece[] = [];
+ if (o.corners) {
+ for (const [y, sy] of [[o.corners[0], 1], [o.corners[1], -1]] as const)
+ for (const sz of [-1, 1]) extra.push({ shape: "box", size: [6, 6, 90], pos: [x0 + T / 2, y + sy * 30, sz * (b.D / 2 - T - 30)], rot: [sy * sz * (Math.PI / 4), 0, 0] });
+ }
+ return part(id, name, boxes, "metal", extra);
+}
+
+/**
+ * The desk's manual builds the storage cabinet first, lying on its outer side on a rug: feet into that side frame,
+ * the rails onto its lugs, the bottom mesh shelf with long screws, the inner side frame on from above. It stands up
+ * for the middle board, is turned upside down for the two back rails and the open end frame, and the wooden top is
+ * screwed into its top frame on the rug. The base goes onto the top upside down, gets long screws and the curved
+ * corner braces, and stands up for the mesh door.
+ */
+function desk(s: ProductSpec): CustomParams {
+ const b = bodyOf(s);
+ const { W, H, D, yp } = b;
+ const CW = Math.round(W * 0.32); // the cabinet, outside
+ const cx0 = W / 2 - CW; // its inner side frame's outer face
+ const ci0 = cx0 + T, ci1 = W / 2 - T; // between the cabinet's side frames
+ const yb = 150; // top of the bottom mesh shelf
+ const ym = 400; // top of the board rails
+ const ylo = 150; // the end frame's bottom rung, and the back bottom rail
+ const zB = -D / 2, zF = D / 2;
+ const parts: CustomPart[] = [
+ postFrame(b, "RS", "Side frame", W / 2 - T, [yb, ym, yp], { mesh: [yb, yp - 20] }),
+ postFrame(b, "LS", "Side frame", cx0, [yb, ym, yp], { mesh: [yb, yp - 20] }),
+ ];
+ const rail = (id: string, name: string, x0: number, x1: number, y: number, front: boolean) =>
+ part(id, name, [bx([x0, y - T, front ? zF - T : zB], [x1, y, front ? zF : zB + T])], "metal");
+ parts.push(rail("RMb", "Board rail", ci0, ci1, ym, false), rail("RTb", "Top rail", ci0, ci1, yp, false), rail("RMf", "Board rail", ci0, ci1, ym, true), rail("RTf", "Top rail", ci0, ci1, yp, true));
+ parts.push(meshShelf("M", ci0, ci1, zB + T, zF - T, yb, "Bottom shelf"));
+ parts.push({ id: "P", name: "Shelf board", size: [ci1 - ci0, PT, D - 10], pos: [(ci0 + ci1) / 2, ym + PT / 2, 0], material: "wood" });
+ parts.push(postFrame(b, "E", "End frame", -W / 2, [ylo, yp], { corners: [ylo, yp - 20] }));
+ parts.push(rail("TR", "Long rail", -W / 2 + T, cx0, yp, false), rail("BR", "Long rail", -W / 2 + T, cx0, ylo, false));
+ // a curved bracket under the top rail at each end, on its front face
+ const railBracket = (id: string, xPost: number, sx: number): CustomPart => {
+ const xa = sx < 0 ? xPost - 90 : xPost, xb = sx < 0 ? xPost + T : xPost + T + 90;
+ return part(id, "Curved bracket", [bx([xa, yp - T - 90, zB + T], [xb, yp - T, zB + T + 3])], "metal", [
+ { shape: "box", size: [110, 6, 3], pos: [(xa + xb) / 2, yp - T - 60, zB + T + 1.5], rot: [0, 0, sx * (Math.PI / 4)] },
+ ]);
+ };
+ parts.push(railBracket("Bc", cx0, -1), railBracket("Be", -W / 2, 1));
+ // the top frame: a ring with cross bars, one over the cabinet's inner side frame
+ const TF = part(
+ "TF",
+ "Top frame",
+ [
+ bx([-W / 2, yp, zB], [W / 2, yp + T, zB + T]),
+ bx([-W / 2, yp, zF - T], [W / 2, yp + T, zF]),
+ bx([-W / 2, yp, zB + T], [-W / 2 + T, yp + T, zF - T]),
+ bx([W / 2 - T, yp, zB + T], [W / 2, yp + T, zF - T]),
+ bx([cx0, yp, zB + T], [cx0 + T, yp + T, zF - T]),
+ ...[-0.35, 0.05].map((t) => bx([t * W, yp, zB + T], [t * W + 20, yp + 20, zF - T])),
+ ],
+ "metal",
+ );
+ const TP: CustomPart = { id: "TP", name: "Desk top", size: [W, PT, D], pos: [0, H - PT / 2, 0], material: "wood" };
+ parts.push(TF, TP);
+ // curved corner braces under the top frame, on the outside of the posts: end frame front and back, the cabinet's
+ // inner side front and back, and the cabinet's outer back corner
+ const braceAt: [string, number, number, number][] = [
+ ["Xef", -W / 2 + T, 1, 1],
+ ["Xeb", -W / 2 + T, 1, -1],
+ ["Xcf", cx0, -1, 1],
+ ["Xcb", cx0, -1, -1],
+ ["Xrb", W / 2 - T, -1, -1],
+ ];
+ const zFace = (sz: number) => (sz > 0 ? [zF, zF + 3] : [zB - 3, zB]);
+ for (const [id, xe, sx, sz] of braceAt) {
+ const [z0, z1] = zFace(sz);
+ const xa = sx > 0 ? xe - T : xe - 90, xb = sx > 0 ? xe + 90 : xe + T;
+ parts.push(
+ part(id, "Corner brace", [bx([sx > 0 ? xa : xb - T, yp - 90, z0], [sx > 0 ? xa + T : xb, yp, z1]), bx([xa, yp, z0], [xb, yp + 20, z1])], "metal", [
+ { shape: "box", size: [100, 6, 3], pos: [xe + sx * 35, yp - 30, (z0 + z1) / 2], rot: [0, 0, sx * (Math.PI / 4)] },
+ ]),
+ );
+ }
+ // the mesh door over the cabinet's front, hinged on the outer front post
+ const dx0 = cx0 + 12, dx1 = W / 2 - 12, dy0 = yb - 40, dy1 = yp - 8, f = 18;
+ parts.push(
+ part("DR", "Door", [
+ bx([dx0, dy0, zF + 2], [dx1, dy0 + f, zF + 20]),
+ bx([dx0, dy1 - f, zF + 2], [dx1, dy1, zF + 20]),
+ bx([dx0, dy0 + f, zF + 2], [dx0 + f, dy1 - f, zF + 20]),
+ bx([dx1 - f, dy0 + f, zF + 2], [dx1, dy1 - f, zF + 20]),
+ bx([dx0 + f, dy0 + f, zF + 10], [dx1 - f, dy1 - f, zF + 12]),
+ ], "metal"),
+ );
+
+ // fittings
+ const lugs = (side: "RS" | "LS", ids: string[]) => {
+ const x = side === "RS" ? W / 2 : cx0;
+ const dir: Vec3 = [side === "RS" ? -1 : 1, 0, 0];
+ return ids.map((id) => {
+ const y = (id.startsWith("RM") ? ym : yp) - T / 2;
+ const z = id.endsWith("f") ? zF - T / 2 : zB + T / 2;
+ return fx("screw", [[x, y, z - 6], [x, y, z + 6]], dir, { ...M6, on: side, mate: id });
+ });
+ };
+ const shelfLong = (side: "RS" | "LS", zs: number[]) =>
+ fx("screw", zs.map((z) => [side === "RS" ? W / 2 : cx0, yb - 10, z] as Vec3), [side === "RS" ? -1 : 1, 0, 0], { ...LONG, on: side, mate: "M" });
+ const bracketFix = (id: string, xPost: number, xRail: number): CustomFix =>
+ fx("screw", [[xPost + T / 2, yp - T - 70, zB + T + 3], [xPost + T / 2, yp - T - 30, zB + T + 3], [xRail, yp - T / 2, zB + T + 3]], [0, 0, -1], { ...M6, on: id });
+ const boardTabs: Vec3[] = [zB + T / 2, zF - T / 2].flatMap((z) => [0.1, 0.3, 0.5, 0.7, 0.9].map((t) => [ci0 + (ci1 - ci0) * t, ym, z] as Vec3));
+ const topTabs: Vec3[] = [
+ ...[-0.45, -0.25, -0.05, 0.15, 0.35].flatMap((t) => [zB + T / 2, zF - T / 2].map((z) => [t * W, yp + T, z] as Vec3)),
+ ...[-0.2, 0, 0.2].map((t) => [-W / 2 + T / 2, yp + T, t * D] as Vec3),
+ ...[-0.2, 0, 0.2].map((t) => [W / 2 - T / 2, yp + T, t * D] as Vec3),
+ ...[-0.2, 0, 0.2].map((t) => [cx0 + T / 2, yp + T, t * D] as Vec3),
+ ];
+ const postTops: [number, number][] = [-W / 2 + T / 2, cx0 + T / 2, W / 2 - T / 2].flatMap((x) => [-1, 1].map((sz) => [x, sz] as [number, number]));
+ const hingeYs = [dy0 + 60, dy1 - 80];
+ const hx = W / 2 - T / 2;
+
+ const steps: CustomStep[] = [
+ {
+ title: "Screw two feet into a side frame",
+ detail: "Lay the cabinet's outer side frame on a rug, lugs facing up. Turn a foot into each post end by hand.",
+ add: ["RS"],
+ pose: "-x",
+ fix: feetAt([[W / 2 - T / 2, zB + T / 2, "RS"], [W / 2 - T / 2, zF - T / 2, "RS"]]),
+ warnings: ["floor"],
+ },
+ { title: "Fit the back board rail", detail: "It stands up from the middle rung at the back, holes towards the inside. Two screws through the side frame.", add: ["RMb"], fix: lugs("RS", ["RMb"]), tools: ["screwdriver"] },
+ { title: "Fit the back top rail", detail: "At the top end of the back post, the same way.", add: ["RTb"], fix: lugs("RS", ["RTb"]), tools: ["screwdriver"] },
+ {
+ title: "Lower the bottom shelf in and screw it",
+ detail: "Its edge sits on the bottom rung. Five long screws up through the rung into the shelf.",
+ add: ["M"],
+ fix: [shelfLong("RS", [-0.3, -0.15, 0, 0.15, 0.3].map((t) => t * D))],
+ tools: ["screwdriver"],
+ },
+ { title: "Fit the front board rail", detail: "Check the holes in the rail face the way the drawing shows. Two screws.", add: ["RMf"], fix: lugs("RS", ["RMf"]), tools: ["screwdriver"] },
+ { title: "Screw the shelf corners", detail: "Two more long screws through the rung, near the front and back posts.", fix: [shelfLong("RS", [zB + T + 20, zF - T - 20])], tools: ["screwdriver"] },
+ { title: "Fit the front top rail", detail: "Onto the lug at the top of the front post. Two screws.", add: ["RTf"], fix: lugs("RS", ["RTf"]), tools: ["screwdriver"] },
+ {
+ title: "Lower the other side frame on",
+ detail: "Its lugs go into the four rail ends. Two screws at each rail.",
+ add: ["LS"],
+ fix: lugs("LS", ["RMb", "RTb", "RMf", "RTf"]),
+ tools: ["screwdriver"],
+ },
+ { title: "Screw it to the bottom shelf", detail: "Three long screws through its bottom rung into the shelf.", fix: [shelfLong("LS", [-0.25, 0, 0.25].map((t) => t * D))], tools: ["screwdriver"] },
+ { title: "Screw two feet into it", detail: "Into its post ends, by hand.", fix: feetAt([[cx0 + T / 2, zB + T / 2, "LS"], [cx0 + T / 2, zF - T / 2, "LS"]]) },
+ { title: "Stand it up and slide in the board", detail: "Turn the cabinet onto its feet. The board slides in from the front onto the middle rails.", pose: "+y", add: ["P"], from: { P: [0, 0, 600] } },
+ { title: "Screw the board to the rails", detail: "One wood screw up through each of the ten tabs.", fix: [fx("screw", boardTabs, [0, 1, 0], { ...WOOD, on: "RMb", mate: "P" })], tools: ["screwdriver"] },
+ {
+ title: "Turn it upside down and slide in a long rail",
+ detail: "On the rug, feet up. The long rail slides into the socket at the top of the back post, the hole the way the drawing shows.",
+ pose: "-y",
+ add: ["TR"],
+ from: { TR: [-500, 0, 0] },
+ warnings: ["floor"],
+ },
+ { title: "Screw a curved bracket onto it", detail: "Where the rail meets the post, curve away from the post. Two screws into the post, one into the rail.", add: ["Bc"], fix: [bracketFix("Bc", cx0, cx0 - 60)], tools: ["screwdriver"] },
+ { title: "Slide the end frame onto the rail", detail: "Feet end up, like the cabinet. Its socket goes over the other end of the rail.", add: ["E"], from: { E: [-400, 0, 0] } },
+ { title: "Screw a curved bracket at this end", detail: "The same way, two screws into the post and one into the rail.", add: ["Be"], fix: [bracketFix("Be", -W / 2, -W / 2 + T + 60)], tools: ["screwdriver"] },
+ { title: "Screw two feet into the end frame", detail: "By hand, into the post ends pointing up.", fix: feetAt([[-W / 2 + T / 2, zB + T / 2, "E"], [-W / 2 + T / 2, zF - T / 2, "E"]]) },
+ {
+ title: "Screw in the other long rail together",
+ detail: "One of you holds the end frame up while the other lines up the rail between the back posts. Two screws at each end.",
+ add: ["BR"],
+ fix: [
+ fx("screw", [[-W / 2, ylo - T / 2, zB + T / 2 - 6], [-W / 2, ylo - T / 2, zB + T / 2 + 6]], [1, 0, 0], { ...M6, on: "E", mate: "BR" }),
+ fx("screw", [[cx0 + T, ylo - T / 2, zB + T / 2 - 6], [cx0 + T, ylo - T / 2, zB + T / 2 + 6]], [-1, 0, 0], { ...M6, on: "LS", mate: "BR" }),
+ ],
+ tools: ["screwdriver"],
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Screw the top into the top frame",
+ detail: "On the rug beside the base: the top show side down, the top frame on it with its lugs up. One wood screw through each of the 19 tabs.",
+ wait: ["TP", "TF"],
+ fix: [fx("screw", topTabs, [0, 1, 0], { ...WOOD, on: "TF", mate: "TP" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lower the base onto the top together",
+ detail: "Lift the upside down base and lower it so every post end slides over a lug of the top frame.",
+ add: ["TP", "TF"],
+ from: { TP: [0, 300, 0], TF: [0, 300, 0] },
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Screw the cabinet to the top frame",
+ detail: "Nine long screws: three through each top rail and three through the inner side frame's top rung.",
+ fix: [
+ fx("screw", [0.2, 0.5, 0.8].map((t) => [ci0 + (ci1 - ci0) * t, yp - T, zB + T / 2] as Vec3), [0, 1, 0], { ...LONG, on: "RTb", mate: "TF" }),
+ fx("screw", [0.2, 0.5, 0.8].map((t) => [ci0 + (ci1 - ci0) * t, yp - T, zF - T / 2] as Vec3), [0, 1, 0], { ...LONG, on: "RTf", mate: "TF" }),
+ fx("screw", [-0.25, 0, 0.25].map((t) => [cx0 + T / 2, yp - 20, t * D] as Vec3), [0, 1, 0], { ...LONG, on: "LS", mate: "TF" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the top frame to the posts",
+ detail: "Two screws through the side of each of the six posts into its lug.",
+ // through the posts' sides, clear of the brace screws in their front and back faces
+ fix: postTops.map(([x, sz]) => {
+ // the end frame from its outer face; the cabinet's posts from inside the cabinet
+ const [xs, dx] = x < cx0 ? [-W / 2, 1] : x > cx0 + T ? [W / 2, -1] : [cx0 + T, -1];
+ return fx("screw", [yp - 12, yp - 50].map((y) => [xs, y, sz * (D / 2 - T / 2)] as Vec3), [dx, 0, 0], { ...M6, on: "TF" });
+ }),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw on the five corner braces",
+ detail: "Where the posts meet the top frame, curve towards the post. Two screws into the post and one into the frame. Check each brace sits flat against the post.",
+ add: braceAt.map(([id]) => id),
+ fix: braceAt.map(([id, xe, sx, sz]) => {
+ const z = sz > 0 ? zF + 3 : zB - 3;
+ const xp = xe - sx * (T / 2);
+ return fx("screw", [[xp, yp - 70, z], [xp, yp - 30, z], [xe + sx * 60, yp + 12, z]], [0, 0, -sz], { ...M6, on: id });
+ }),
+ tools: ["screwdriver"],
+ },
+ { title: "Turn it onto its feet together", detail: "Lift it from the top, one of you at each end, and stand it on its six feet.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Screw the magnet into the door",
+ detail: "Lay the door on the rug, mesh side down. The magnet goes inside the corner away from the hinges, one screw.",
+ wait: ["DR"],
+ fix: [fx("washer", [[dx0 + 12, (dy0 + dy1) / 2, zF + 2]], [0, 0, 1], { name: "Magnet", len: 6, dia: 16, on: "DR" }), fx("screw", [[dx0 + 12, (dy0 + dy1) / 2, zF + 2]], [0, 0, 1], { len: 10, dia: 4, on: "DR" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw two hinges onto the door",
+ detail: "On the edge that goes against the outer front post. Two screws hold each hinge to the door frame.",
+ fix: [
+ fx("hinge", hingeYs.map((y) => [hx, y, zF] as Vec3), [0, 0, -1], { on: "DR" }),
+ fx("screw", hingeYs.flatMap((y) => [[hx - 10, y - 20, zF + 20], [hx - 10, y + 20, zF + 20]] as Vec3[]), [0, 0, -1], { ...M6, on: "DR" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Level the desk", detail: "Turn the six feet in or out until it stands steady and the top is level." },
+ {
+ title: "Hang the door",
+ detail: "Hold it over the cabinet's front and screw its hinges to the outer front post, two screws each. Adjust it up or down until it closes evenly.",
+ add: ["DR"],
+ from: { DR: [0, 0, 400] },
+ fix: [
+ fx("screw", hingeYs.flatMap((y) => [[hx + 6, y - 20, zF], [hx + 6, y + 20, zF]] as Vec3[]), [0, 0, -1], { ...M6, on: "RS" }),
+ fx("cap", [[cx0 + T / 2, dy0 + 60, zF], [cx0 + T / 2, dy1 - 60, zF]], [0, 0, -1], { name: "Door buffer", len: 6, dia: 12, on: "LS" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Clip your cables to the rail",
+ detail: "Press the five cable clips onto the back bottom rail where your cables run.",
+ fix: [fx("clip", [0.15, 0.3, 0.45, 0.6, 0.75].map((t) => [-W / 2 + T + (cx0 - (-W / 2 + T)) * t, ylo, zB + T / 2] as Vec3), [0, -1, 0], { name: "Cable clip", len: 12, dia: 16, on: "BR" })],
+ },
+ ];
return { parts, steps };
}
@@ -537,7 +1179,10 @@ const family: Family = {
recipe(s) {
const slug = s.slug ?? "";
if (/shelving-unit-(51-x-136|100-x-136)/.test(slug)) return shelving(s);
- if (/tv-(bench|unit)/.test(slug)) return bench(s);
+ if (/tv-(bench|unit)/.test(slug)) return doorUnit(s, false);
+ if (/shelving-unit-100-x-95/.test(slug)) return doorUnit(s, true);
+ if (/sideboard/.test(slug)) return sideboard(s);
+ if (/desk-140-x-70/.test(slug)) return desk(s);
return null;
},
};
diff --git a/src/lib/plan/families/flekke.ts b/src/lib/plan/families/flekke.ts
index e7ec6c5..8afaa0f 100644
--- a/src/lib/plan/families/flekke.ts
+++ b/src/lib/plan/families/flekke.ts
@@ -48,8 +48,9 @@ function daybed(s: ProductSpec): CustomParams {
],
},
box("RB", "Slat rail", [-xi, SY - 30, zb], [xi, SY, zb + 30], "metal"),
- box("C0", "Centre support", [-360, 0, zb + 30], [-320, SY - 30, zb + 70], "wood"),
- box("C1", "Centre support", [320, 0, zb + 30], [360, SY - 30, zb + 70], "wood"),
+ // against the back panel, under the slat rail
+ box("C0", "Centre support", [-360, 0, zb], [-320, SY - 30, zb + 40], "wood"),
+ box("C1", "Centre support", [320, 0, zb], [360, SY - 30, zb + 40], "wood"),
];
const slatX = spread(-xi + 90, xi - 90, 12);
slatX.forEach((x, i) => parts.push(box(`S${i}`, "Slat", [x - 35, SY, zb + 10], [x + 35, SY + ST, Z - 10], "wood")));
@@ -80,7 +81,7 @@ function daybed(s: ProductSpec): CustomParams {
box(`DF${i}`, "Drawer front", [cx - 470, PY0 + 6, PZ1 - T], [cx + 470, PY1 - 66, PZ1]),
box(`DS${i}a`, "Drawer side", [cx - dw, dy0, dz0], [cx - dw + 16, dy1, dz1]),
box(`DS${i}b`, "Drawer side", [cx + dw - 16, dy0, dz0], [cx + dw, dy1, dz1]),
- box(`DR${i}`, "Support rod", [cx - 6, dy0, dz0 + 16], [cx + 6, dy0 + 6, dz1], "metal"),
+ box(`DR${i}`, "Support rod", [cx - 6, dy0, dz0], [cx + 6, dy0 + 6, dz1], "metal"),
box(`DB${i}`, "Drawer bottom", [cx - dw + 8, dy0 + 6, dz0 + 8], [cx + dw - 8, dy0 + 10, dz1], "fiber"),
box(`DK${i}`, "Drawer back", [cx - dw + 16, dy0 + 10, dz0], [cx + dw - 16, dy1, dz0 + 16]),
);
@@ -120,7 +121,9 @@ function daybed(s: ProductSpec): CustomParams {
add: ["FR"],
fix: [
...[-1, 1].map((g) => fix("angle", [[g * xi, SY - 40, Z - 20]], [-g, 0, 0], { name: "Rail bracket", len: 40, dia: 30, on: g < 0 ? "EL" : "ER" })),
- fix("screw", [-1, 1].flatMap((g) => [[g * xi, SY - 50, Z - 30], [g * (xi - 20), SY - 30, Z - 15]] as Vec3[]), [0, -1, 0], { len: 14, dia: 4 }),
+ // one through each bracket into the end panel, one down through the rail into the bracket
+ ...[-1, 1].map((g) => fix("screw", [[g * (xi - 2), SY - 65, Z - 20]], [g, 0, 0], { len: 14, dia: 4, on: g < 0 ? "EL" : "ER" })),
+ fix("screw", [-1, 1].map((g): Vec3 => [g * (xi - 20), SY, Z - 15]), [0, -1, 0], { len: 14, dia: 4, on: "FR" }),
],
tools: ["screwdriver"],
},
@@ -176,12 +179,12 @@ function daybed(s: ProductSpec): CustomParams {
},
{
title: "Fit the two centre supports",
- detail: "Pick the two short slats. Screw an L plate to the foot of each, then screw each one to the back panel and the slat rail.",
+ detail: "Pick the two short slats. Stand each one against the back panel under the slat rail, then screw its L plate to the back panel and to the slat.",
add: ["C0", "C1"],
fix: [
- fix("plate", [-340, 340].map((x): Vec3 => [x, 0, zb + 50]), [0, 1, 0], { name: "L plate", len: 3, dia: 60 }),
- fix("screw", [-340, 340].flatMap((x): Vec3[] => [[x - 12, 20, zb], [x + 12, 20, zb]]), [0, 0, 1], { len: 16, dia: 4 }),
- fix("screw", [-340, 340].flatMap((x): Vec3[] => [[x, SY - 50, zb], [x, 120, zb]]), [0, 0, 1], { len: 14, dia: 4 }),
+ fix("plate", [-340, 340].map((x): Vec3 => [x, 0, zb + 20]), [0, 1, 0], { name: "L plate", len: 3, dia: 60 }),
+ fix("screw", [-340, 340].flatMap((x): Vec3[] => [[x - 12, 20, zb + 2], [x + 12, 20, zb + 2]]), [0, 0, -1], { len: 16, dia: 4, on: "B" }),
+ ...[-340, 340].map((x, i) => fix("screw", [30, 70].map((y): Vec3 => [x - 22, y, zb + 20]), [1, 0, 0], { len: 14, dia: 4, on: `C${i}` })),
],
tools: ["screwdriver"],
},
@@ -229,11 +232,13 @@ function daybed(s: ProductSpec): CustomParams {
add: beamX.map((_, i) => `PD${i}`),
fix: [
fix("castor", beamX.flatMap((x): Vec3[] => [[x + T / 2, PY0, PZ0 + 100], [x + T / 2, PY0, PZ1 - 100]]), [0, 1, 0], { len: 60, dia: 50 }),
- fix("screw", beamX.flatMap((x): Vec3[] => [[x + T / 2, PY0, PZ0 + 80], [x + T / 2, PY0, PZ0 + 120], [x + T / 2, PY0, PZ1 - 80], [x + T / 2, PY0, PZ1 - 120]]), [0, 1, 0], { len: 16, dia: 4 }),
+ fix("screw", beamX.flatMap((x): Vec3[] => [[x + T / 2, PY0, PZ0 + 75], [x + T / 2, PY0, PZ0 + 125], [x + T / 2, PY0, PZ1 - 75], [x + T / 2, PY0, PZ1 - 125]]), [0, 1, 0], { len: 16, dia: 4 }),
fix("dowel", beamX.flatMap((x) => [PY0 + 50, PY0 + 110, PY1 - 110, PY1 - 60].map((y): Vec3 => [x + T / 2, y, PZ0 + T])), [0, 0, -1]),
fix("cam", beamX.map((x): Vec3 => [x + T / 2, PY1 - 50, PZ0 + 50]), [1, 0, 0], { dia: 15 }),
],
tools: ["screwdriver"],
+ // the beams go in along their dowels, from the front
+ from: Object.fromEntries(beamX.map((_, i) => [`PD${i}`, [0, 0, 400] as Vec3])),
},
{
title: "Fit the other long panel",
@@ -252,14 +257,14 @@ function daybed(s: ProductSpec): CustomParams {
detail: "Stand the pull-out bed on its castors. One runner on each side of both drawer spaces, three screws each.",
fix: [
...beamX.map((x, i) => fix("runner", [[i % 2 ? x : x + T, (dy0 + dy1) / 2, (dz0 + dz1) / 2]], [i % 2 ? 1 : -1, 0, 0], { len: 650, dia: 30, on: `PD${i}` })),
- fix("screw", beamX.flatMap((x, i) => [-250, 0, 250].map((dz): Vec3 => [i % 2 ? x : x + T, (dy0 + dy1) / 2, (dz0 + dz1) / 2 + dz])), [1, 0, 0], { len: 12, dia: 4 }),
+ ...beamX.map((x, i) => fix("screw", [-250, 40, 250].map((dz): Vec3 => [i % 2 ? x - 2 : x + T + 2, (dy0 + dy1) / 2, (dz0 + dz1) / 2 + dz]), [i % 2 ? 1 : -1, 0, 0], { len: 12, dia: 4, on: `PD${i}` })),
],
tools: ["screwdriver"],
},
{
title: "Screw the beams to the slat rails",
detail: "Four screws at each long panel, through the rails into the top of the beams.",
- fix: [fix("screw", beamX.flatMap((x): Vec3[] => [[x + T / 2, PY1 - 30, PZ0 + T + 15], [x + T / 2, PY1 - 30, PZ1 - T - 15]]), [0, -1, 0], { len: 14, dia: 4 })],
+ fix: [fix("screw", beamX.flatMap((x): Vec3[] => [[x + T / 2, PY1 - 30, PZ0 + T + 15], [x + T / 2 + 8, PY1 - 30, PZ1 - 39]]), [0, -1, 0], { len: 14, dia: 4 })], // the front ones clear of the cam bolts
tools: ["screwdriver"],
},
{
@@ -309,7 +314,7 @@ function daybed(s: ProductSpec): CustomParams {
add: ["DK0", "DK1"],
fix: [
fix("bolt", bays.flatMap((cx) => [-1, 1].flatMap((g) => [dy0 + 40, dy1 - 40].map((y): Vec3 => [cx + g * (dw - 8), y, dz0]))), [0, 0, 1], { name: "Knock-in bolt", len: 34, dia: 8 }),
- fix("screw", bays.map((cx): Vec3 => [cx, dy0 + 3, dz0]), [0, 0, 1], { len: 12, dia: 4 }),
+ fix("screw", bays.map((cx): Vec3 => [cx, dy0, dz0 + 8]), [0, 1, 0], { len: 12, dia: 4 }), // up through the rod into the back
fix("glide", bays.map((cx): Vec3 => [cx, dy1, dz0 + 8]), [0, -1, 0], { name: "Stop pad", len: 3, dia: 20 }),
],
tools: ["hammer", "screwdriver"],
@@ -319,7 +324,7 @@ function daybed(s: ProductSpec): CustomParams {
detail: "One on each side, three screws each, wheel at the back. Then push in two corner brackets at the front.",
fix: [
...[-1, 1].map((g) => fix("runner", bays.map((cx): Vec3 => [cx + g * dw, (dy0 + dy1) / 2, (dz0 + dz1) / 2]), [g, 0, 0], { len: 650, dia: 30 })),
- fix("screw", bays.flatMap((cx) => [-1, 1].flatMap((g) => [-250, 0, 250].map((dz): Vec3 => [cx + g * dw, (dy0 + dy1) / 2, (dz0 + dz1) / 2 + dz]))), [-1, 0, 0], { len: 12, dia: 4 }),
+ ...[-1, 1].map((g) => fix("screw", bays.flatMap((cx) => [-220, 80, 220].map((dz): Vec3 => [cx + g * dw, (dy0 + dy1) / 2, (dz0 + dz1) / 2 + dz])), [-g, 0, 0], { len: 12, dia: 4 })),
fix("angle", bays.flatMap((cx) => [-1, 1].map((g): Vec3 => [cx + g * (dw - 30), dy0 + 20, dz1 - 20])), [0, -1, 0], { name: "Corner bracket", len: 30, dia: 25 }),
],
tools: ["screwdriver"],
diff --git a/src/lib/plan/families/flintan.ts b/src/lib/plan/families/flintan.ts
index b2fac38..ccb96c4 100644
--- a/src/lib/plan/families/flintan.ts
+++ b/src/lib/plan/families/flintan.ts
@@ -103,7 +103,8 @@ function chair(s: ProductSpec): CustomParams {
title: "Bolt the bracket to the backrest",
detail: "Four bolts through the bracket into the bottom of the backrest frame.",
add: ["B", "K"],
- fix: [fix("bolt", [-1, 1].flatMap((g) => [520, 550].map((y): Vec3 => [g * 22, y, -290])), [0, 0, -1], { len: 16, dia: 8, on: "K" })],
+ // from the bracket's face, back into the foot of the leaning backrest
+ fix: [fix("bolt", [-1, 1].flatMap((g) => [520, 550].map((y): Vec3 => [g * 24, y, -262])), [0, 0, -1], { len: 16, dia: 8, on: "K" })],
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/flisat.ts b/src/lib/plan/families/flisat.ts
index 661d5de..92740ef 100644
--- a/src/lib/plan/families/flisat.ts
+++ b/src/lib/plan/families/flisat.ts
@@ -100,12 +100,241 @@ function stool(s: ProductSpec): CustomParams {
};
}
+/**
+ * The open storage: two side ladders (their white side panels already in), a top between them on six small
+ * dowels, then rails and a back panel screwed in with the unit on its back. Standing up, two middle bars take
+ * long dowels for the back middle post (fitted face down) and the front middle post screws onto the front rails.
+ * Last come the clothes rail on two bolts, four shelves on angle brackets and the wall fixing.
+ */
+function storage(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const P = 36, RT = 22, RH = 44; // posts, rungs and rails
+ const xi = W / 2 - P, zp = D / 2 - P; // inside faces of the side posts, front of the back posts
+ const yT = H - 25; // underside of the top
+ const ys = [300, 520, 780] as const; // rung centres: bottom shelf, band bottom, band top
+ const yR = yT - RH / 2; // top rail and bar centre
+ const zF = D / 2 - 22 - RT / 2; // front rails sit behind the middle post
+ const zB = -D / 2 + 22 + RT / 2; // back rails sit in front of the back middle post
+ const band = { lo: ys[1] - 10, hi: ys[2] + 10 };
+ const ladder = (sx: -1 | 1, id: string): CustomPart => {
+ const cy = H / 2, ix = -sx * (P - RT) / 2;
+ const rung = (y0: number, h: number): PartPiece => ({ shape: "box", size: [RT, h, 2 * zp], pos: [ix, y0 + h / 2 - cy, 0] });
+ return {
+ id,
+ name: "Side frame",
+ size: [P, H, D],
+ pos: [sx * (W / 2 - P / 2), cy, 0],
+ material: "wood",
+ pieces: [
+ { shape: "box", size: [P, H - 25, P], pos: [0, 12.5, zp + P / 2] },
+ { shape: "box", size: [P, H, P], pos: [0, 0, -zp - P / 2] },
+ rung(0, RH),
+ ...ys.map((y) => rung(y - RH / 2, RH)),
+ rung(yT, 25),
+ { shape: "box", size: [8, ys[2] - ys[1] - RH, 2 * zp], pos: [ix, (ys[1] + ys[2]) / 2 - cy, 0], material: "board" },
+ ],
+ };
+ };
+ const m = 18, n = 22; // middle posts: half their width, their depth
+ const topLine: [number, number][] = [
+ [-xi, -D / 2], [-m, -D / 2], [-m, -D / 2 + n], [m, -D / 2 + n], [m, -D / 2], [xi, -D / 2],
+ [xi, D / 2], [m, D / 2], [m, D / 2 - n], [-m, D / 2 - n], [-m, D / 2], [-xi, D / 2],
+ ];
+ const midH = H - (ys[0] - RH / 2);
+ const shelf = (id: string, sx: -1 | 1, inner: number, y: number, z0: number, z1: number): CustomPart => ({
+ id,
+ name: "Shelf",
+ size: [xi - inner, 18, z1 - z0],
+ pos: [sx * (xi + inner) / 2, y + 9, (z0 + z1) / 2],
+ material: "board",
+ });
+ const fz = 166; // shelves stop short of the front middle post
+ const parts: CustomPart[] = [
+ ladder(-1, "L"),
+ ladder(1, "R"),
+ ...[-1, 1].map((sx, i) => ({ id: i ? "FR" : "FL", name: "Foot", size: [P, 25, 110] as Vec3, pos: [sx * (W / 2 - P / 2), 12.5, D / 2 + 5] as Vec3, material: "wood" as const })),
+ { id: "T", name: "Top", size: [2 * xi, 25, D], pos: [0, yT + 12.5, 0], material: "board", pieces: [{ shape: "slab", outline: topLine, size: [2 * xi, 25, D], pos: [0, 0, 0] }] },
+ ...[1, 2].map((k, i) => ({ id: `B${i}`, name: "Back rail", size: [2 * xi, RH, RT] as Vec3, pos: [0, ys[k], zB] as Vec3, material: "wood" as const })),
+ { id: "K", name: "Back panel", size: [2 * xi, band.hi - band.lo, 10], pos: [0, (band.lo + band.hi) / 2, zB - 4], material: "board" },
+ ...[ys[0], yR].map((y, i) => ({ id: `F${i}`, name: "Front rail", size: [2 * xi, RH, RT] as Vec3, pos: [0, y, zF] as Vec3, material: "wood" as const })),
+ ...[ys[0], yR].map((y, i) => ({ id: `C${i}`, name: "Middle bar", size: [2 * m, RH, zF - RT / 2 + D / 2 - n] as Vec3, pos: [0, y, (zF - RT / 2 - D / 2 + n) / 2] as Vec3, material: "wood" as const })),
+ { id: "V", name: "Middle panel", size: [14, ys[2] + RH / 2 - ys[1], D / 2 - n - (zB + 1)], pos: [0, (ys[1] + ys[2] + RH / 2) / 2, (zB + 1 + D / 2 - n) / 2], material: "board" },
+ { id: "MB", name: "Middle post", size: [2 * m, midH, n], pos: [0, H - midH / 2, -D / 2 + n / 2], material: "wood" },
+ { id: "MF", name: "Middle post", size: [2 * m, midH, n], pos: [0, H - midH / 2, D / 2 - n / 2], material: "wood" },
+ { id: "RD", name: "Clothes rail", size: [W / 2 - P - m - 40, 30, 30], pos: [(m + xi) / 2, yT - 65, 0], shape: "cyl", material: "wood" },
+ shelf("S0", -1, m, ys[0] + RH / 2, -D / 2 + 4, fz),
+ shelf("S1", 1, m, ys[0] + RH / 2, -D / 2 + 4, fz),
+ shelf("S2", -1, 7, ys[1] + RH / 2, zB + 1, fz),
+ shelf("S3", -1, 7, ys[2] + RH / 2, zB - RT / 2, fz),
+ ];
+ const lid = (sx: -1 | 1) => (sx < 0 ? "L" : "R");
+ const sides = (sx: -1 | 1, y: number, z: number, mate: string) => fx("bolt", lid(sx), [-sx, 0, 0], [[sx * (W / 2), y, z]], { mate, len: 45, dia: 6, name: "Allen screw" });
+ const both = (y: number, z: number, mate: string) => [sides(-1, y, z, mate), sides(1, y, z, mate)];
+ const topDowel = (sx: -1 | 1) => fx("dowel", "T", [-sx, 0, 0], [-100, 0, 100].map((z) => [sx * xi, yT + 12.5, z] as Vec3), { mate: lid(sx), len: 30, dia: 6 });
+ const glide = (sx: -1 | 1) => fx("glide", lid(sx), [0, 1, 0], [[sx * (W / 2 - P / 2), 0, -zp - P / 2]]);
+ const yFront = (k: number) => (k ? yR : ys[0]);
+ // the shelves' brackets: one under each end, screwed up into the shelf and sideways into what holds it
+ const holds: { s: string; x: number; y: number; into: string; dir: -1 | 1 }[] = [
+ { s: "S0", x: -xi, y: ys[0] + RH / 2, into: "L", dir: -1 },
+ { s: "S0", x: -m, y: ys[0] + RH / 2, into: "C0", dir: 1 },
+ { s: "S1", x: m, y: ys[0] + RH / 2, into: "C0", dir: -1 },
+ { s: "S1", x: xi, y: ys[0] + RH / 2, into: "R", dir: 1 },
+ { s: "S2", x: -xi, y: ys[1] + RH / 2, into: "L", dir: -1 },
+ { s: "S2", x: -7, y: ys[1] + RH / 2, into: "V", dir: 1 },
+ { s: "S3", x: -xi, y: ys[2] + RH / 2, into: "L", dir: -1 },
+ { s: "S3", x: -7, y: ys[2] + RH / 2, into: "V", dir: 1 },
+ ];
+ const shelfIds = ["S0", "S1", "S2", "S3"];
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the small dowels into the top",
+ detail: "Three in each end. Lay the top on a rug so it doesn't get scratched.",
+ fix: [topDowel(-1), topDowel(1)],
+ wait: ["T"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Press a foot onto each side frame",
+ detail: "Its two pins go into the bottom of the front post. Do the same on the other side frame.",
+ add: ["L", "FL"],
+ from: { FL: [0, -160, 0] },
+ pose: "+z",
+ repeat: 2,
+ },
+ {
+ title: "Push a glide into each back post",
+ detail: "Into the bottom of the back post, on both side frames.",
+ fix: [glide(-1)],
+ repeat: 2,
+ },
+ {
+ title: "Join the side frames to the top",
+ detail: "With both frames on their back edges, push them onto the top's dowels. Check the white side panels sit fully in their grooves.",
+ add: ["T", "R", "FR"],
+ from: { R: [520, 0, 0], FR: [520, 0, 0] },
+ fix: [glide(1)],
+ },
+ {
+ title: "Screw in the two back rails",
+ detail: "Lower them in between the frames, the holes facing in. Turn the screws by hand with the Allen key, never with a drill.",
+ add: ["B0", "B1"],
+ from: { B0: [0, 0, 420], B1: [0, 0, 420] },
+ fix: [...both(ys[1], zB, "B0"), ...both(ys[2], zB, "B1")],
+ },
+ {
+ title: "Slide in the back panel",
+ detail: "Tilt it into the grooves of both back rails, white side towards the front.",
+ add: ["K"],
+ from: { K: [0, 0, 420] },
+ },
+ {
+ title: "Screw the back panel to the side frames",
+ detail: "Two screws through each back post into the ends of the panel.",
+ fix: [...both(ys[1] + 70, zB - 4, "K"), ...both(ys[2] - 70, zB - 4, "K")],
+ },
+ {
+ title: "Screw in the two front rails",
+ detail: "The bottom one level with the lowest shelf rungs, the top one just under the top.",
+ add: ["F0", "F1"],
+ from: { F0: [0, 0, 300], F1: [0, 0, 300] },
+ fix: [0, 1].flatMap((k) => both(yFront(k), zF, `F${k}`)),
+ },
+ { title: "Tighten all the screws", detail: "Go round every screw once more with the Allen key until the frame feels firm." },
+ {
+ title: "Stand it up and fit the bottom middle bar",
+ detail: "Two long dowels in its back end, then lay it from the middle of the front rail to the back.",
+ fix: [fx("dowel", "C0", [0, 0, 1], [-9, 9].map((x) => [x, ys[0], -D / 2 + n] as Vec3), { mate: "MB", len: 40, dia: 8 })],
+ add: ["C0"],
+ from: { C0: [0, 0, -420] },
+ pose: "+y",
+ },
+ {
+ title: "Fit the top bar and the middle panel",
+ detail: "The top bar goes in the same way, just under the top. Slide the white middle panel in from the front, against the back panel.",
+ fix: [fx("dowel", "C1", [0, 0, 1], [-9, 9].map((x) => [x, yR, -D / 2 + n] as Vec3), { mate: "MB", len: 40, dia: 8 })],
+ add: ["C1", "V"],
+ from: { C1: [0, 0, -420], V: [0, 0, 460] },
+ },
+ {
+ title: "Lay it on its front and fit the back post",
+ detail: "Press the rounded post down onto the four dowels in the bars, into the notch in the top.",
+ add: ["MB"],
+ pose: "-z",
+ },
+ {
+ title: "Screw the back post to the bars",
+ detail: "One long screw into each bar. Turn them by hand.",
+ fix: [0, 1].map((k) => fx("bolt", "MB", [0, 0, 1], [[0, yFront(k), -D / 2]], { mate: `C${k}`, len: 60, dia: 6, name: "Long Allen screw" })),
+ },
+ {
+ title: "Stand it up and tap in the front dowels",
+ detail: "One long dowel in the middle of each front rail.",
+ fix: [0, 1].map((k) => fx("dowel", `F${k}`, [0, 0, -1], [[0, yFront(k), D / 2 - n]], { mate: "MF", len: 40, dia: 8 })),
+ pose: "+y",
+ },
+ { title: "Push on the front post", detail: "Line it up with the notch in the top and press it onto both dowels.", add: ["MF"] },
+ {
+ title: "Screw the front post to the rails",
+ detail: "Two long screws into each rail, either side of the dowel.",
+ fix: [0, 1].map((k) => fx("bolt", "MF", [0, 0, -1], [-12, 12].map((d) => [0, yFront(k) + d, D / 2] as Vec3), { mate: `F${k}`, len: 40, dia: 6, name: "Long Allen screw" })),
+ },
+ {
+ title: "Hang the clothes rail",
+ detail: "Two bolts up through the rail and the top, with a nut on each. Hold the nut while you turn the bolt.",
+ add: ["RD"],
+ from: { RD: [0, -260, 0] },
+ fix: [
+ fx("bolt", "RD", [0, 1, 0], [m + 60, xi - 60].map((x) => [x, yT - 80, 0] as Vec3), { mate: "T", len: 110, dia: 6 }),
+ fx("nut", "T", [0, -1, 0], [m + 60, xi - 60].map((x) => [x, H, 0] as Vec3)),
+ ],
+ },
+ {
+ title: "Screw the brackets under the shelves",
+ detail: "One bracket under each end of every shelf, one screw each.",
+ fix: [
+ ...holds.map((h) => fx("angle", h.s, [0, 1, 0], [[h.x - h.dir * 8, h.y - 10, 0]], { name: "Shelf bracket" })),
+ ...holds.map((h) => fx("screw", h.s, [0, 1, 0], [[h.x - h.dir * 14, h.y - 2, 0]], { len: 12, dia: 4 })),
+ ],
+ wait: shelfIds,
+ },
+ {
+ title: "Put the shelves in",
+ detail: "Two at the bottom and two in the left half of the white box, brackets underneath.",
+ add: shelfIds,
+ from: Object.fromEntries(shelfIds.map((id) => [id, [0, 0, 460] as Vec3])),
+ },
+ {
+ title: "Screw the brackets to the frame",
+ detail: "One screw through each bracket into the rung, bar or panel under the shelf.",
+ fix: holds.map((h) => fx("screw", h.s, [h.dir, 0, 0], [[h.x - h.dir * 6, h.y - 12, 0]], { mate: h.into, len: 16, dia: 4 })),
+ },
+ {
+ title: "Press the wall spacers onto the back",
+ detail: "One on the back of each back post, near the top. Trim them first if your skirting board needs more room.",
+ fix: [fx("connector", "L", [0, 0, -1], [-1, 1].map((sx) => [sx * (W / 2 - P / 2), H - 80, -D / 2] as Vec3), { name: "Wall spacer" })],
+ },
+ {
+ title: "Fix it to the wall",
+ detail: "One screw through each back post into the wall. Plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", "L", [0, 0, -1], [-1, 1].map((sx) => [sx * (W / 2 - P / 2), H - 80, -D / 2 - 30] as Vec3)),
+ fx("screw", "L", [0, 0, -1], [-1, 1].map((sx) => [sx * (W / 2 - P / 2), H - 80, -D / 2 + 16] as Vec3), { len: 50, dia: 5, included: true }),
+ ].map((f) => ({ ...f, on: undefined })),
+ tools: ["screwdriver", "drill", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["FLISAT"],
recipe(s) {
const slug = s.slug ?? "";
if (/children-s-table/.test(slug)) return table(s);
if (/children-s-stool/.test(slug)) return stool(s);
+ if (/open-storage/.test(slug)) return storage(s);
return null;
},
};
diff --git a/src/lib/plan/families/forhoja.ts b/src/lib/plan/families/forhoja.ts
index 57fb362..7873688 100644
--- a/src/lib/plan/families/forhoja.ts
+++ b/src/lib/plan/families/forhoja.ts
@@ -12,6 +12,7 @@ import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3
*/
const LEG = 45;
+const r = (n: number) => Math.round(n);
function trolley(s: ProductSpec): CustomParams {
const W = Math.round(s.size.w * 10) || 1000, D = Math.round(s.size.d * 10) || 430, H = Math.round(s.size.h * 10) || 900;
@@ -58,13 +59,14 @@ function trolley(s: ProductSpec): CustomParams {
pieces: [
{ shape: "box", size: [W, T, D], pos: [0, 12.5, 0] },
// two battens across the underside, just inside the end rails
- { shape: "box", size: [40, 25, D - 60], pos: [-inX + 20, -T / 2, 0] },
- { shape: "box", size: [40, 25, D - 60], pos: [inX - 20, -T / 2, 0] },
+ { shape: "box", size: [40, 25, 2 * rz - 20], pos: [-inX + 20, -T / 2, 0] },
+ { shape: "box", size: [40, 25, 2 * rz - 20], pos: [inX - 20, -T / 2, 0] },
],
});
- const dw = inX - 30, dh = 75;
+ // on the runners, under the top's battens, from the back rail's face to just past the front rail
+ const dw = inX - 30, dh = 55;
for (const [id, sx] of [["DR1", -1], ["DR2", 1]] as const)
- parts.push({ id, name: "Drawer", size: [dw, dh, 2 * rz + 10], pos: [(sx * (inX + 10)) / 2, yD + 30 + dh / 2, 0], material: "wood" });
+ parts.push({ id, name: "Drawer", size: [dw, dh, 2 * rz], pos: [(sx * (inX + 10)) / 2, yD + 30 + dh / 2, 10], material: "wood" });
const shelfIds = (k: number) => [`R${k}b`, ...Array.from({ length: 10 }, (_, i) => `S${k}_${i}`)];
const rails = shelfY.flatMap((_, k) => [`R${k}b`, `R${k}f`]);
@@ -77,7 +79,7 @@ function trolley(s: ProductSpec): CustomParams {
});
const frameDowels = (sx: number): CustomFix[] => [
{ kind: "dowel", count: 2, at: endPts(sx, [yT - 70, yT - 25], [-rz]), dir: [sx, 0, 0], on: "DB", mate: sx < 0 ? "EL" : "ER" },
- { kind: "dowel", count: 2, at: [[sx * inX, yD + 15, rz - 5], [sx * inX, yD + 15, rz + 5]], dir: [sx, 0, 0], on: "DF", mate: sx < 0 ? "EL" : "ER" },
+ { kind: "dowel", count: 2, at: [[sx * inX, yD + 3.5, rz], [sx * inX, yD + 26.5, rz]], dir: [sx, 0, 0], on: "DF", mate: sx < 0 ? "EL" : "ER" },
];
const longScrews = (sx: number): CustomFix => ({
kind: "bolt",
@@ -108,7 +110,7 @@ function trolley(s: ProductSpec): CustomParams {
{
title: "Screw the rails to the middle slat",
detail: "Lay each shelf flat. One small screw through each rail into the middle slat.",
- fix: shelfY.flatMap((y, k) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 35, dia: 4, at: [[0, y + 5, sz * (rz + 11)]], dir: [0, 0, -sz], on: `R${k}${sz < 0 ? "b" : "f"}`, mate: `S${k}_5` }))),
+ fix: shelfY.flatMap((y, k) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 35, dia: 4, at: [[r(-railL / 2 + railL * 0.55), y + 5, sz * (rz + 11)]], dir: [0, 0, -sz], on: `R${k}${sz < 0 ? "b" : "f"}`, mate: `S${k}_5` }))),
tools: ["screwdriver"],
pose: "+y",
},
diff --git a/src/lib/plan/families/forsaljare.ts b/src/lib/plan/families/forsaljare.ts
index f7d8ef6..274482e 100644
--- a/src/lib/plan/families/forsaljare.ts
+++ b/src/lib/plan/families/forsaljare.ts
@@ -90,7 +90,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Screw the brackets to the rails",
detail: "Four screws in each bracket, two into each rail.",
- fix: [fx("screw", { ...at(corner.flatMap((p) => [-1, 1].flatMap((a) => [[p[0] + Math.sign(p[0]) * 28, p[1], p[2] + a * 8] as Vec3, [p[0] + a * 8, p[1], p[2] + Math.sign(p[2]) * 28] as Vec3])), [0, 1, 0]), len: 16, dia: 4 })],
+ fix: [fx("screw", { ...at(corner.flatMap((p) => [-1, 1].flatMap((a) => [[p[0] + Math.sign(p[0]) * 28, p[1], p[2] + a * 12] as Vec3, [p[0] + a * 12, p[1], p[2] + Math.sign(p[2]) * 28] as Vec3])), [0, 1, 0]), len: 16, dia: 4 })],
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/forsiktig.ts b/src/lib/plan/families/forsiktig.ts
new file mode 100644
index 0000000..d9103ee
--- /dev/null
+++ b/src/lib/plan/families/forsiktig.ts
@@ -0,0 +1,45 @@
+import type { Family } from "./family";
+import type { CustomParams, ProductSpec } from "../../types";
+
+/**
+ * FÖRSIKTIG children's stool: one moulded plastic step with an anti-slip top and rubber edging underneath. It comes
+ * ready to use (IKEA lists no manual), so the guide only unpacks it and checks it stands firm. Drawn to IKEA's
+ * measurements, 37 x 24 cm and 13 cm high.
+ */
+
+function recipe(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10), D = Math.round(s.size.d * 10);
+ const H = 130, t = 14;
+ const top = { shape: "slab" as const, size: [W - 20, t, D - 20] as [number, number, number], pos: [0, H / 2 - t / 2, 0] as [number, number, number], outline: [[-(W - 20) / 2, -(D - 20) / 2], [(W - 20) / 2, -(D - 20) / 2], [(W - 20) / 2, (D - 20) / 2], [-(W - 20) / 2, (D - 20) / 2]] as [number, number][], round: 40 };
+ return {
+ parts: [
+ {
+ id: "S",
+ name: "Stool",
+ size: [W, H, D],
+ pos: [0, H / 2, 0],
+ material: "board",
+ pieces: [
+ top,
+ // the two ends flare out to the floor, each with a finger hole
+ ...[-1, 1].map((g) => ({ shape: "box" as const, size: [16, H - t, D - 10] as [number, number, number], pos: [g * (W / 2 - 14), -t / 2, 0] as [number, number, number], rot: [0, 0, g * 0.12] as [number, number, number] })),
+ ...[-1, 1].map((g) => ({ shape: "box" as const, size: [W - 60, H - t - 10, 8] as [number, number, number], pos: [0, -t / 2 + 5, g * (D / 2 - 10)] as [number, number, number] })),
+ ],
+ },
+ { id: "P", name: "Anti-slip top", size: [W - 60, 2, D - 60], pos: [0, H + 1, 0], material: "soft", extra: true },
+ ],
+ steps: [
+ { title: "Take the stool out of its packing", detail: "It comes in one piece, ready to use.", add: ["S", "P"] },
+ { title: "Check it stands firm", detail: "Stand it on a dry, flat floor so the rubber edge underneath grips. Keep the top clean so it stays non-slip." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["FÖRSIKTIG", "FORSIKTIG"],
+ recipe(s) {
+ if (!/stool/i.test(s.variant)) return null;
+ return recipe(s);
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/friheten.ts b/src/lib/plan/families/friheten.ts
index 7e30b65..c43aadd 100644
--- a/src/lib/plan/families/friheten.ts
+++ b/src/lib/plan/families/friheten.ts
@@ -126,11 +126,11 @@ function corner(s: ProductSpec, sgn: 1 | -1, pad: boolean): CustomParams {
{ title: "Turn the cover's corners under the lid", detail: "Tuck all four corner flaps round the lid's frame and press them on." },
{ title: "Close the lid and tuck in the last flap", detail: "Lower the lid onto the box, then fold the flap at the front corner round the frame." },
{
- title: "Join the two backrest pieces on pins",
- detail: "Push the two pins into the end of the short backrest, then push the long one onto them.",
- add: ["BS", "BL"],
+ title: "Push two pins into the short backrest",
+ detail: "Into the holes in its end that faces the sofa, collar against the wood.",
fix: [pinsBack],
},
+ { title: "Push the long backrest onto the pins", detail: "Straight on, until the two ends meet.", add: ["BL"] },
{ title: "Push the chaise longue against the backrest", detail: "Slide it along until its back sits right behind the short backrest piece." },
{ title: "Screw four rods into sleeve nuts", detail: "By hand, a sleeve nut on the end of each rod. Click the 5 mm Allen key into the long handle: it's your extension." },
{
@@ -279,7 +279,7 @@ function threeSeat(): CustomParams {
tools: ["allen"],
},
{ title: "Screw the uprights to the bottom rail", detail: "Two screws, through the rail into the outer uprights.", fix: [fx("screw", [-0.25, 0.25].map((t) => pt(t * iw, yb0, zb + 30)), [0, 1, 0], "R", undefined, SCR)], pose: "-y", tools: ["allen"] },
- { title: "Bolt the four armrest connectors to the ends", detail: "Two on the outside of each end, slots pointing up. One bolt each.", fix: [fx("connector", conn, [0, 0, 1], "E1", undefined, { len: 120, dia: 30, name: "Armrest connector" }), fx("bolt", conn, [conn[0][0] < 0 ? 1 : 1, 0, 0], "E1", undefined, B45)], pose: "-y", tools: ["allen"] },
+ { title: "Bolt the four armrest connectors to the ends", detail: "Two on the outside of each end, slots pointing up. One bolt each.", fix: [fx("connector", conn, [0, 0, 1], "E1", undefined, { len: 120, dia: 30, name: "Armrest connector" }), ...[1, -1].map((sx) => fx("bolt", conn.filter((p) => Math.sign(p[0]) === -sx), [sx, 0, 0], sx > 0 ? "E1" : "E2", undefined, B45))], pose: "-y", tools: ["allen"] },
{ title: "Stand the frame up and bolt the rails tight", detail: "Two bolts through the top of each end into the rails.", pose: "+y", fix: [fx("bolt", ends.flatMap((x) => [BH, yb0 + 60].map((y) => pt(x, y, zm + 50))), [0, 0, -1], "E1", undefined, B30)], tools: ["allen"] },
{ title: "Screw four bolts into the bottom rail", detail: "Into the holes along its lower edge, part way only: the seat box hangs on these.", fix: [fx("bolt", [-0.375, -0.125, 0.125, 0.375].map((t) => pt(t * iw, yb0, zm)), [0, 1, 0], "R", undefined, B45)], tools: ["allen"] },
{ title: "Cut the ties on the seat box", detail: "Lay the box on the rug and throw the ties away." },
@@ -288,7 +288,7 @@ function threeSeat(): CustomParams {
{
title: "Push three long bolts through the back of the seat box",
detail: "From inside the box, with the long Allen key, part way out of the back rail.",
- fix: [fx("bolt", [-0.33, 0, 0.33].map((t) => pt(t * iw, 200, zb + 40)), [0, 0, -1], "S", "R", B150)],
+ fix: [fx("bolt", [-0.33, 0, 0.33].map((t) => pt(t * iw, yR, zs + 40)), [0, 0, -1], "S", "R", B150)],
tools: ["allen"],
wait: ["S"],
},
diff --git a/src/lib/plan/families/froskelas.ts b/src/lib/plan/families/froskelas.ts
index 2c28c55..760f828 100644
--- a/src/lib/plan/families/froskelas.ts
+++ b/src/lib/plan/families/froskelas.ts
@@ -32,7 +32,7 @@ function storage(s: ProductSpec): CustomParams {
// IKEA: 63 wide, 35 deep, 141 high; shelves 56 wide
const W = Math.round(s.size.w * 10) || 630, D = Math.round(s.size.d * 10) || 350, H = Math.round(s.size.h * 10) || 1410;
const xp = W / 2 - 13, zp = D / 2 - 13;
- const sw = 560, sd = D - 20;
+ const sw = 2 * (xp - 12.5), sd = D - 20; // the shelf's end flanges meet the posts
const ys = [90, 470, 840, H - 30]; // shelf tops, bottom first
const parts: CustomPart[] = [];
const postId = (sx: number, sz: number) => `P${sx < 0 ? "l" : "r"}${sz < 0 ? "b" : "f"}`;
@@ -58,7 +58,8 @@ function storage(s: ProductSpec): CustomParams {
});
parts.push(brace("X0", 1), brace("X1", -1));
- const shelfScrews = (k: number) => sides.flatMap((sx) => sides.map((sz) => [sx * (sw / 2), ys[k] - 10, sz * (zp - 20)] as Vec3));
+ // through the post into the shelf's end flange
+ const shelfScrews = (k: number) => sides.flatMap((sx) => sides.map((sz) => [sx * (xp + 12.5), ys[k] - 10, sz * zp] as Vec3));
const screwFix = (ks: number[]) => sides.map((sx) => at("screw", ks.flatMap((k) => shelfScrews(k).filter((p) => Math.sign(p[0]) === sx)), [-sx, 0, 0], undefined, undefined, SCREW));
const steps: CustomStep[] = [
{
@@ -92,9 +93,10 @@ function storage(s: ProductSpec): CustomParams {
title: "Screw the wall strips to the back posts",
detail: "One strip on each back post near the top, with a screw and washer.",
fix: [
- at("strap", sides.map((sx) => [sx * xp, H - 120, -zp - 12] as Vec3), [0, 0, 1], undefined, undefined, { name: "Wall strip", len: 200, dia: 20 }),
- at("washer", sides.map((sx) => [sx * xp, H - 120, -zp - 14] as Vec3), [0, 0, 1], undefined, undefined, { len: 1.5, dia: 14 }),
+ at("strap", sides.map((sx) => [sx * xp, H - 80, -zp - 12] as Vec3), [0, 0, 1], undefined, undefined, { name: "Wall strip", len: 200, dia: 20 }),
+ // the screw first so the washer stacks on it rather than pushing it off the post
at("screw", sides.map((sx) => [sx * xp, H - 120, -zp - 14] as Vec3), [0, 0, 1], undefined, undefined, { len: 10, dia: 5, included: true }),
+ at("washer", sides.map((sx) => [sx * xp, H - 120, -zp - 14] as Vec3), [0, 0, 1], undefined, undefined, { len: 1.5, dia: 14 }),
],
tools: ["screwdriver"],
wall: false,
@@ -166,10 +168,10 @@ function desk(s: ProductSpec): CustomParams {
},
{
title: "Lower the tray bottom in",
- detail: "Stand the frame up. Lower the tray bottom in together, then two bolts through the frames into it and two dowels where it meets the tray.",
+ detail: "Stand the frame up. Lower the tray bottom in together, then two bolts through the back legs into the tray and two dowels where it meets the tray.",
add: ["CB"],
pose: "+y",
- fix: [...sides.map((sx) => at("bolt", [[sx * (xf + 15), yTop - 160, zb + 80]], [-sx, 0, 0], `F${sx < 0 ? 0 : 1}`, "CB", BOLT)), at("dowel", [-200, 200].map((x) => [x, yTop - 150, zb + 8] as Vec3), [0, 0, -1], "CB", "CT", { len: 30, dia: 8 })],
+ fix: [...sides.map((sx) => at("bolt", [[sx * (xf + 15), yTop - 120, zb]], [-sx, 0, 0], `F${sx < 0 ? 0 : 1}`, "CT", BOLT)), at("dowel", [-200, 200].map((x) => [x, yTop - 150, zb + 8] as Vec3), [0, 0, -1], "CB", "CT", { len: 30, dia: 8 })],
people: 2,
warnings: ["two"],
tools: ["allen", "hammer"],
@@ -192,7 +194,8 @@ function desk(s: ProductSpec): CustomParams {
fix: [
at("cam", [-300, -100, 100, 300].map((x) => [x, yTop - 30, zb + 8] as Vec3), [0, 0, -1], "CT", undefined, { dia: 15 }),
at("bolt", sides.map((sx) => [sx * xf, yTop - 15, (zf + zb) / 2] as Vec3), [0, 1, 0], undefined, "DT", BOLT),
- at("screw", [-500, -300, -100, 100, 300, 500].map((x) => [x, yTop - 10, zb + 4] as Vec3), [0, 1, 0], "CT", "DT", { len: 16, dia: 4 }),
+ // clear of the cable opening in the desktop and of the cam pins
+ at("screw", [-560, -450, -360, 360, 450, 560].map((x) => [x, yTop - 10, zb + 4] as Vec3), [0, 1, 0], "CT", "DT", { len: 16, dia: 4 }),
],
tools: ["allen", "screwdriver"],
},
diff --git a/src/lib/plan/families/frost.ts b/src/lib/plan/families/frost.ts
new file mode 100644
index 0000000..9a3432d
--- /dev/null
+++ b/src/lib/plan/families/frost.ts
@@ -0,0 +1,82 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, Vec3 } from "../../types";
+
+/**
+ * FROST drying rack, in/outdoor. It comes in one piece, folded flat, and IKEA has no assembly manual for it: the two
+ * wire leg frames open out into an X and the two wings fold out at the top. The guide shows only that, nothing to
+ * screw.
+ */
+
+const R = 8; // wire, as drawn
+
+/** A straight rod from a to b, as a cylinder turned to lie along it, relative to c. */
+function rod(a: Vec3, b: Vec3, c: Vec3, dia = R): PartPiece {
+ const d: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...d);
+ const rz = -Math.atan2(d[0], Math.hypot(d[1], d[2]));
+ const rx = Math.atan2(d[2], d[1]);
+ return { shape: "cyl", size: [dia, len, dia], pos: [(a[0] + b[0]) / 2 - c[0], (a[1] + b[1]) / 2 - c[1], (a[2] + b[2]) / 2 - c[2]], rot: [rx, 0, rz], material: "metal" };
+}
+
+function wire(id: string, name: string, rods: [Vec3, Vec3][]): CustomPart {
+ const all = rods.flat();
+ const lo = [0, 1, 2].map((k) => Math.min(...all.map((p) => p[k])) - R / 2);
+ const hi = [0, 1, 2].map((k) => Math.max(...all.map((p) => p[k])) + R / 2);
+ const c = lo.map((v, k) => (v + hi[k]) / 2) as Vec3;
+ return { id, name, size: lo.map((v, k) => hi[k] - v) as Vec3, pos: c, pieces: rods.map(([a, b]) => rod(a, b, c)), material: "metal" };
+}
+
+function rack(): CustomParams {
+ const L = 1340, H = 930, D = 590;
+ const zs = D / 2 - 10;
+ const foot = 400, top = 260, yTop = H - 40;
+ // a ladder of wire leaning from its feet on one side to its top on the other, with bars across it
+ const leg = (id: string, sx: number): CustomPart => {
+ const at = (f: number, z: number): Vec3 => [sx * (-foot + (foot + top) * f), yTop * f, z];
+ const rods: [Vec3, Vec3][] = [
+ [at(0, -zs), at(1, -zs)],
+ [at(0, zs), at(1, zs)],
+ ...[0.04, 0.2, 0.36, 0.52, 0.68, 0.84, 1].map((f): [Vec3, Vec3] => [at(f, -zs), at(f, zs)]),
+ ];
+ return wire(id, "Leg frame", rods);
+ };
+ // a flat grid of wires along the length, hinged at the top of a leg frame
+ const wing = (id: string, sx: number): CustomPart => {
+ const x0 = sx * 10, x1 = (sx * L) / 2;
+ const y = H - 10;
+ const rods: [Vec3, Vec3][] = [
+ [[x0, y, -zs], [x1, y, -zs]],
+ [[x0, y, zs], [x1, y, zs]],
+ [[x1, y, -zs], [x1, y, zs]],
+ ...Array.from({ length: 9 }, (_, i): [Vec3, Vec3] => {
+ const z = -zs + ((i + 1) * 2 * zs) / 10;
+ return [[x0, y, z], [x1, y, z]];
+ }),
+ ];
+ return wire(id, "Wing", rods);
+ };
+ const parts = [leg("LA", -1), leg("LB", 1), wing("WA", -1), wing("WB", 1)];
+ return {
+ parts,
+ steps: [
+ {
+ title: "Stand it up and open the legs",
+ detail: "It comes folded flat. Pull the two leg frames apart until they cross in an X and all four feet stand on the floor.",
+ add: ["LA", "LB"],
+ from: { LA: [-200, 0, 0], LB: [200, 0, 0] },
+ },
+ {
+ title: "Fold the wings out",
+ detail: "Lift each wing over and let it rest level on top of its leg frame. Fold them back down again to store it.",
+ add: ["WA", "WB"],
+ from: { WA: [0, 300, 0], WB: [0, 300, 0] },
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["FROST"],
+ recipe: (s) => (/drying rack/i.test(s.variant) ? rack() : null),
+};
+export default family;
diff --git a/src/lib/plan/families/frosvi.ts b/src/lib/plan/families/frosvi.ts
new file mode 100644
index 0000000..498fb0b
--- /dev/null
+++ b/src/lib/plan/families/frosvi.ts
@@ -0,0 +1,69 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * FRÖSVI comes assembled: IKEA's page says it's ready to use and there is no assembly manual. The guide only opens
+ * it: lift the seat's front until the frame stands, push the seat down until it rests on its stops, and fold it the
+ * other way to store it (the hole in the backrest hangs it on a hook).
+ */
+
+/** A square stick from a to b in the y-z plane, as a piece of the part centred at c. */
+function stick(a: Vec3, b: Vec3, c: Vec3, w = 28, d = 22): PartPiece {
+ const dy = b[1] - a[1], dz = b[2] - a[2];
+ return { shape: "box", size: [w, Math.hypot(dy, dz), d], pos: [(a[0] + b[0]) / 2 - c[0], (a[1] + b[1]) / 2 - c[1], (a[2] + b[2]) / 2 - c[2]], rot: [Math.atan2(dz, dy), 0, 0] };
+}
+
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 44 wide, 51 deep, 77 high, seat 38 x 33 at 46
+ const W = Math.round(s.size.w * 10) || 440, D = Math.round(s.size.d * 10) || 510, H = Math.round(s.size.h * 10) || 770;
+ const ys = 460, sw = 380, sd = 330;
+ const c: Vec3 = [0, H / 2, 0];
+ const xo = W / 2 - 14, xi = sw / 2 + 14;
+ const zb0 = -D / 2 + 70, zbT = -D / 2 + 14; // back legs, floor to top, leaning back
+ const zf0 = D / 2 - 14; // front legs' feet
+ const zSeatBack = zb0 + 40, zSeatFront = zSeatBack + sd;
+ const pieces: PartPiece[] = [
+ ...[-1, 1].flatMap((sx) => [
+ stick([sx * xo, 0, zb0], [sx * xo, H, zbT], c),
+ stick([sx * xi, 0, zf0], [sx * xi, ys + 40, zSeatBack - 10], c),
+ ]),
+ // the backrest, a stretcher low between the front legs and one under the seat
+ { shape: "box", size: [2 * xo, 110, 18], pos: [0, H - 70 - c[1], zbT + 8 - c[2]], rot: [-0.07, 0, 0] },
+ { shape: "box", size: [2 * xi, 22, 22], pos: [0, 140 - c[1], zf0 - 120 - c[2]] },
+ { shape: "box", size: [2 * xo, 22, 22], pos: [0, 240 - c[1], zb0 - 18 - c[2]] },
+ // the seat: slats between two side rails
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [20, 40, sd], pos: [sx * (sw / 2 - 10), ys - 20 - c[1], (zSeatBack + zSeatFront) / 2 - c[2]] })),
+ ...Array.from({ length: 7 }, (_, k): PartPiece => ({ shape: "box", size: [sw, 16, 34], pos: [0, ys - 8 - c[1], zSeatBack + 22 + (k * (sd - 44)) / 6 - c[2]] })),
+ ];
+ const parts: CustomPart[] = [{ id: "C", name: "Folding chair", size: [W, H, D], pos: c, pieces, material: "wood" }];
+ return {
+ parts,
+ steps: [
+ {
+ title: "Unfold the chair",
+ detail: "It comes assembled. Hold the backrest and lift the front of the seat: the legs swing apart.",
+ add: ["C"],
+ from: { C: [0, 200, 0] },
+ warnings: ["hand"],
+ },
+ {
+ title: "Push the seat down onto its stops",
+ detail: "Press the back of the seat down until it rests on the frame. Keep your fingers out of the joints.",
+ warnings: ["hand"],
+ },
+ {
+ title: "Fold it up to store it",
+ detail: "Lift the front of the seat towards the backrest. The hole in the backrest hangs it on a hook.",
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["FRÖSVI", "FROSVI"],
+ recipe(s) {
+ if (/^frosvi-folding-chair/.test(s.slug ?? "")) return chair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/frotorp.ts b/src/lib/plan/families/frotorp.ts
index e70fda1..7e02f22 100644
--- a/src/lib/plan/families/frotorp.ts
+++ b/src/lib/plan/families/frotorp.ts
@@ -71,7 +71,7 @@ function table(s: ProductSpec): CustomParams {
const pair = (r: number, y: number, i: number): Vec3[] => {
const a = ang(i), t: Vec3 = [-Math.sin(a), 0, Math.cos(a)];
const p = polar(r, y, i);
- return [-1, 1].map((k) => [Math.round(p[0] + k * 9 * t[0]), y, Math.round(p[2] + k * 9 * t[2])] as Vec3);
+ return [-1, 1].map((k) => [Math.round(p[0] + k * 12 * t[0]), y, Math.round(p[2] + k * 12 * t[2])] as Vec3);
};
const lowScrews = legs.map((id, i) => at("screw", pair(rLow - wall / 2, yLow + lowH, i), [0, -1, 0], "B", id, { len: 16, dia: 6 }));
const topScrews = legs.map((id, i) => at("screw", pair(rLeg - 10, yTopRing + 10, i), [0, -1, 0], "T", id, { len: 12, dia: 6 }));
diff --git a/src/lib/plan/families/fryksas.ts b/src/lib/plan/families/fryksas.ts
index 50c12a3..07bb71e 100644
--- a/src/lib/plan/families/fryksas.ts
+++ b/src/lib/plan/families/fryksas.ts
@@ -9,7 +9,9 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* on, the woven basket slid in, and the castors pushed in two at a time with it upside down.
* The desk is built on its side too: the two halves of the back screen joined, stood on one side frame with the
* desk top, the other side frame laid on, bolted, then stood up and the top bolted to both sides.
- * The cabinet and the TV bench are chipboard builds with their own long manuals and keep their old guides.
+ * The cabinet is built lying on one woven side frame: shelves, back panels and back rails stood on it, the other
+ * side laid on, then the bottom with its plinth slid onto the end and the top lowered on once it stands. The TV bench
+ * is built upright from the plinth: bottom, dividers, woven end frames, shelves, back and top, then the doors.
*/
type Kind = CustomFix["kind"];
@@ -260,7 +262,9 @@ function desk(s: ProductSpec): CustomParams {
const xm = (x0 + x1) / 2, len = Math.abs(x1 - x0);
const z = -zs;
const xe = sx * (T / 2);
- const p: PartPiece[] = [tubeX(T, len, [xm, yHi, z]), tubeX(T - 5, len, [xm, yBack, z]), tubeY(T, yHi - yBack, [xe, (yHi + yBack) / 2, z])];
+ // a post at each end: the one by the join, and the one the side frame is bolted into
+ const xo = sx * (W / 2 - 1.5 * T);
+ const p: PartPiece[] = [tubeX(T, len, [xm, yHi, z]), tubeX(T - 5, len, [xm, yBack, z]), tubeY(T, yHi - yBack, [xe, (yHi + yBack) / 2, z]), tubeY(T, yHi - yBack, [xo, (yHi + yBack) / 2, z])];
for (let i = 1; i <= 9; i++) p.push(tubeY(8, yHi - yBack, [x0 + ((x1 - x0) * i) / 10, (yHi + yBack) / 2, z]));
for (const y of [yBack + 150, yHi - 160]) p.push(tubeX(8, len, [xm, y, z]));
return built(id, sx < 0 ? "Back screen, left" : "Back screen, right", p, "wood", [Math.min(0, x1), yBack - T / 2, -D / 2], [Math.max(0, x1), H, -D / 2 + T]);
@@ -342,6 +346,338 @@ function desk(s: ProductSpec): CustomParams {
return { parts, steps };
}
+
+/* ---------- cabinet and TV bench: chipboard boxes with woven rattan ends and doors ---------- */
+
+const CAM_A = { name: "Cam lock", dia: 15, len: 12 }; // the low one
+const CAM_B = { name: "Cam lock, tall", dia: 15, len: 16 };
+const box = (lo: Vec3, hi: Vec3): { size: Vec3; pos: Vec3 } => ({ size: lo.map((v, i) => r1(hi[i] - v)) as Vec3, pos: lo.map((v, i) => r1((v + hi[i]) / 2)) as Vec3 });
+const board = (id: string, name: string, lo: Vec3, hi: Vec3, material: CustomPart["material"] = "board"): CustomPart => ({ id, name, ...box(lo, hi), material });
+
+/** A woven panel in a wooden frame (an end or a door): four bars round a thinner sheet of rattan. n is the axis it faces. */
+function woven(id: string, name: string, lo: Vec3, hi: Vec3, n: 0 | 2): CustomPart {
+ const { size, pos } = box(lo, hi);
+ const u = n === 0 ? 2 : 0; // across
+ const bar = 36;
+ const pc = (sz: Vec3, at: Vec3): PartPiece => ({ shape: "box", size: sz, pos: at });
+ const S = (a: number, b: number, c: number): Vec3 => (n === 0 ? [c, b, a] : [a, b, c]); // (across, up, thickness)
+ const P = (a: number, b: number, c: number): Vec3 => (n === 0 ? [c, b, a] : [a, b, c]);
+ const wU = size[u], h = size[1], t = size[n];
+ const pieces: PartPiece[] = [
+ pc(S(bar, h, t), P(-wU / 2 + bar / 2, 0, 0)),
+ pc(S(bar, h, t), P(wU / 2 - bar / 2, 0, 0)),
+ pc(S(wU - 2 * bar, bar, t), P(0, h / 2 - bar / 2, 0)),
+ pc(S(wU - 2 * bar, bar, t), P(0, -h / 2 + bar / 2, 0)),
+ pc(S(wU - 2 * bar, h - 2 * bar, t * 0.4), P(0, 0, 0)),
+ ];
+ return { id, name, size, pos, material: "wood", pieces };
+}
+
+const pts = (xs: number[], ys: number[], zs: number[]): Vec3[] => xs.flatMap((x) => ys.flatMap((y) => zs.map((z) => [x, y, z] as Vec3)));
+const on = (kind: Kind, host: string, mate: string | undefined, dir: Vec3, at: Vec3[], o: Partial<CustomFix> = {}): CustomFix => fx(kind, at, dir, { on: host, ...(mate ? { mate } : {}), ...o });
+
+function cabinet(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const T = 40, tb = 25, yP = 90; // end frames, top and bottom, plinth height
+ const yB = yP + tb, yT = H - tb;
+ const zB = -D / 2, zF = D / 2 - 20; // the carcass, doors in front of it
+ const xi = W / 2 - T;
+ const ts = 18;
+ const room = (yT - yB - 2 * ts) / 3;
+ const yS = [yB + room + ts / 2, yB + 2 * room + 1.5 * ts].map(Math.round);
+ const zr = zB + 18, zp = zr + 3; // back rails, back panels in front of them
+ const parts: CustomPart[] = [
+ woven("L", "Side frame", [-W / 2, yB, zB], [-xi, yT, zF], 0),
+ woven("R", "Side frame", [xi, yB, zB], [W / 2, yT, zF], 0),
+ board("S1", "Shelf", [-xi, yS[0] - ts / 2, zp], [xi, yS[0] + ts / 2, zF]),
+ board("S2", "Shelf", [-xi, yS[1] - ts / 2, zp], [xi, yS[1] + ts / 2, zF]),
+ board("P2", "Back panel", [-xi, yS[0] + ts / 2, zr], [xi, yS[1] - ts / 2, zp], "fiber"),
+ board("RB", "Back rail", [-xi, yB, zB], [xi, yB + 60, zr]),
+ board("RT", "Back rail", [-xi, yT - 60, zB], [xi, yT, zr]),
+ board("P1", "Back panel", [-xi, yB + 60, zr], [xi, yS[0] - ts / 2, zp], "fiber"),
+ board("K1", "Leg block", [-W / 2 + 50, 10, -D / 2 + 30], [-W / 2 + 100, yP, D / 2 - 30], "wood"),
+ board("K2", "Leg block", [W / 2 - 100, 10, -D / 2 + 30], [W / 2 - 50, yP, D / 2 - 30], "wood"),
+ board("KR", "Plinth rail", [-W / 2 + 100, 30, -9], [W / 2 - 100, yP, 9], "wood"),
+ board("B", "Bottom", [-W / 2, yP, -D / 2], [W / 2, yB, D / 2]),
+ board("P3", "Back panel", [-xi, yS[1] + ts / 2, zr], [xi, yT - 60, zp], "fiber"),
+ board("T", "Top", [-W / 2, yT, -D / 2], [W / 2, H, D / 2]),
+ woven("G1", "Door", [-W / 2, yB + 2, zF], [-1.5, yT - 2, D / 2], 2),
+ woven("G2", "Door", [1.5, yB + 2, zF], [W / 2, yT - 2, D / 2], 2),
+ ];
+ const zc = [zp + 70, zF - 60]; // two fittings across a joint, back and front
+ const sides: [string, number][] = [["L", -1], ["R", 1]];
+ // the shelves and rails meet the end frames: dowels in their ends, a cam bolt in the frame, a cam lock in the board
+ const shelfDowels = sides.flatMap(([, sx]) => [0, 1].map((i) => on("dowel", `S${i + 1}`, undefined, [-sx, 0, 0], pts([sx * xi], [yS[i]], [zp + 40, zF - 30]))));
+ const railDowels = sides.flatMap(([, sx]) => [["RB", yB + 30], ["RT", yT - 30]].map(([id, y]) => on("dowel", id as string, undefined, [-sx, 0, 0], pts([sx * xi], [(y as number) - 15, (y as number) + 15], [zB + 9]))));
+ const frameBolts = (side: string, sx: number) => [
+ ...[0, 1].map((i) => on("camScrew", side, `S${i + 1}`, [sx, 0, 0], pts([sx * xi], [yS[i]], zc), { len: 34 })),
+ ...[["RB", yB + 30], ["RT", yT - 30]].map(([id, y]) => on("camScrew", side, id as string, [sx, 0, 0], [[sx * xi, y as number, zB + 9]], { len: 34 })),
+ ];
+ const endDowels = sides.flatMap(([id, sx]) => [on("dowel", id, undefined, [0, 1, 0], pts([sx * (W / 2 - T / 2)], [yB], [zB + 60, zF - 60])), on("dowel", id, undefined, [0, -1, 0], pts([sx * (W / 2 - T / 2)], [yT], [zB + 60, zF - 60]))]);
+ const shelfCams = [0, 1].map((i) => on("cam", `S${i + 1}`, undefined, [0, -1, 0], pts([-xi + 30, xi - 30], [yS[i] + ts / 2], zc), CAM_B));
+ const railCams = ["RB", "RT"].map((id) => on("cam", id, undefined, [0, 0, 1], pts([-xi + 30, xi - 30], [id === "RB" ? yB + 30 : yT - 30], [zB]), CAM_A));
+ // the plinth: feet, then the rail between the leg blocks, then all of it under the bottom
+ const xk = W / 2 - 75;
+ const feet = [on("foot", "K1", undefined, [0, 1, 0], pts([-xk], [10], [-D / 2 + 60, D / 2 - 60]), { name: "Adjustable foot" }), on("foot", "K2", undefined, [0, 1, 0], pts([xk], [10], [-D / 2 + 60, D / 2 - 60]), { name: "Adjustable foot" })];
+ const kBolts = [on("camScrew", "K1", "KR", [-1, 0, 0], [[-W / 2 + 100, 60, 0]], { len: 34 }), on("camScrew", "K2", "KR", [1, 0, 0], [[W / 2 - 100, 60, 0]], { len: 34 })];
+ const kDowels = [on("dowel", "K1", undefined, [-1, 0, 0], [[-W / 2 + 100, 60, 0]].map(([x, y, z]) => [x, y - 25, z] as Vec3)), on("dowel", "K2", undefined, [1, 0, 0], [[W / 2 - 100, 35, 0]])];
+ const kCams = on("cam", "KR", undefined, [0, 1, 0], [[-W / 2 + 130, yP, 0], [W / 2 - 130, yP, 0]], CAM_B);
+ const bBolts = on("camScrew", "B", undefined, [0, 1, 0], [...pts([-xk, xk], [yP], [-D / 2 + 70, D / 2 - 70]), [0, yP, 0]], { len: 34 });
+ const bDowels = on("dowel", "B", undefined, [0, 1, 0], pts([-xk, xk], [yP], [-D / 2 + 130, D / 2 - 130]));
+ const plinthCams = [on("cam", "K1", undefined, [1, 0, 0], pts([-W / 2 + 50], [yP - 30], [-D / 2 + 70, D / 2 - 70]), CAM_B), on("cam", "K2", undefined, [-1, 0, 0], pts([W / 2 - 50], [yP - 30], [-D / 2 + 70, D / 2 - 70]), CAM_B), on("cam", "KR", undefined, [0, 0, -1], [[0, yP - 30, 9]], CAM_B)];
+ // the bottom and the top take cam bolts that go into the end frames and the back rails
+ const capBolts = (id: string, y: number, dir: number) => on("camScrew", id, undefined, [0, dir, 0], [...pts([-W / 2 + T / 2, W / 2 - T / 2], [y], [zB + 120, zF - 120]), [0, y, zB + 9]], { len: 34 });
+ const capCams = (y: number) => sides.map(([id, sx]) => on("cam", id, undefined, [sx, 0, 0], pts([sx * xi], [y], [zB + 120, zF - 120]), CAM_A));
+ const capRailCam = (id: string, y: number) => on("cam", id, undefined, [0, 0, 1], [[0, y, zB]], CAM_A);
+ const hingeAt = (sx: number) => pts([sx * (W / 2 - T / 2)], [yB + 120, (yB + yT) / 2, yT - 120], [zF]);
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into both side frames",
+ detail: "Lay both frames flat on a rug, inner side up. Six in each, by hand or with a screwdriver until they stop.",
+ fix: [...frameBolts("L", -1), ...frameBolts("R", 1)],
+ wait: ["R"],
+ pose: "+x",
+ warnings: ["floor"],
+ },
+ { title: "Tap dowels into the ends of the side frames", detail: "Two in each end. Not in the holes by the cam bolts.", fix: endDowels, tools: ["hammer"] },
+ { title: "Tap dowels into the shelves", detail: "Two in each end of both shelves. The edge with the groove goes to the back.", fix: shelfDowels, wait: ["S1", "S2"], tools: ["hammer"] },
+ { title: "Stand the shelves on a side frame", detail: "The side frame lies on the rug. Each shelf goes onto two dowels and two cam bolts, grooves to the back.", add: ["S1", "S2"] },
+ { title: "Slide a back panel in between the shelves", detail: "Smooth side in. Push it down the grooves until it meets the side frame.", add: ["P2"] },
+ { title: "Tap dowels into the back rails", detail: "Two in each end of both rails.", fix: railDowels, wait: ["RB", "RT"], tools: ["hammer"] },
+ { title: "Stand a back rail at each end", detail: "Onto the dowels and the cam bolt at each end of the side frame, the groove facing in.", add: ["RB", "RT"] },
+ { title: "Lay the other side frame on", detail: "Lower it so every dowel and cam bolt finds its hole.", add: ["R"] },
+ { title: "Lock the shelves with cam locks", detail: "Eight tall cam locks, two in each shelf end. Turn each one clockwise until it pulls tight.", fix: shelfCams, tools: ["screwdriver"] },
+ { title: "Lock the back rails with cam locks", detail: "Four low cam locks, one in each rail end.", fix: railCams, tools: ["screwdriver"] },
+ { title: "Slide in a back panel at one end", detail: "Smooth side in, along the grooves until it stops against the shelf.", add: ["P1"] },
+ { title: "Screw the feet into the leg blocks", detail: "Two in each, from underneath. Turn them all the way in for now.", fix: feet, wait: ["K1", "K2", "KR", "B"], from: { K1: [0, 0, 500], K2: [0, 0, 500], KR: [0, 0, 500], B: [0, 0, 500] } },
+ { title: "Screw cam bolts into the leg blocks", detail: "One in the inner face of each.", fix: kBolts },
+ { title: "Tap a dowel into each leg block", detail: "Next to the cam bolt.", fix: kDowels, tools: ["hammer"] },
+ { title: "Push the plinth rail between the leg blocks", detail: "Its cam lock holes face up. Press it onto the dowel and cam bolt at each end." },
+ { title: "Lock the plinth rail", detail: "Two tall cam locks, one at each end of the rail.", fix: [kCams], tools: ["screwdriver"] },
+ { title: "Screw cam bolts into the underside of the bottom", detail: "Lay the bottom with the right side down. Five bolts.", fix: [bBolts] },
+ { title: "Tap dowels into the underside of the bottom", detail: "Four, beside the cam bolts.", fix: [bDowels], tools: ["hammer"] },
+ { title: "Lower the plinth onto the bottom", detail: "Upside down, onto the five cam bolts and four dowels." },
+ { title: "Lock the plinth to the bottom", detail: "Five tall cam locks: two in each leg block and one in the rail.", fix: plinthCams, tools: ["screwdriver"] },
+ { title: "Turn the bottom over and screw in its cam bolts", detail: "Five in the top face, along the edges and at the back.", fix: [capBolts("B", yB, 1)] },
+ {
+ title: "Slide the bottom onto the end of the frame",
+ detail: "The plinth faces out. Push it straight onto the dowels in the side frames and the cam bolts into their holes.",
+ add: ["K1", "K2", "KR", "B"],
+ from: { K1: [0, -500, 0], K2: [0, -500, 0], KR: [0, -500, 0], B: [0, -500, 0] },
+ },
+ { title: "Lock the bottom to the side frames", detail: "Four low cam locks, two in each side frame.", fix: capCams(yB + 30), tools: ["screwdriver"] },
+ { title: "Lock the bottom to the back rail", detail: "Turn the frame so the back faces you. One more low cam lock in the rail.", fix: [capRailCam("RB", yB + 30)], tools: ["screwdriver"] },
+ { title: "Slide in the last back panel", detail: "At the open end, smooth side in, down to the shelf.", add: ["P3"] },
+ { title: "Stand the cabinet up", detail: "Two of you, lifting it onto its feet. Don't rest it on the plinth's corners.", pose: "+y", people: 2 },
+ { title: "Screw cam bolts into the underside of the top", detail: "Lay the top right side down on a rug. Five bolts.", fix: [capBolts("T", yT, -1)], wait: ["T"] },
+ {
+ title: "Screw the push opener holders under the top",
+ detail: "Two holders, 22 mm in from the front edge, two short screws each.",
+ fix: [on("screw", "T", undefined, [0, 1, 0], pts([-60, -30, 30, 60], [yT], [zF - 22]), { len: 12, dia: 3.5 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the push openers into the holders", detail: "Push each one in until it clicks. Don't press on the plunger.", fix: [on("connector", "T", undefined, [0, 1, 0], pts([-45, 45], [yT], [zF - 22]), { name: "Push opener", len: 60, dia: 16 })] },
+ { title: "Lower the top on", detail: "Onto the dowels and cam bolts in the side frames.", add: ["T"] },
+ { title: "Lock the top to the side frames", detail: "Four low cam locks.", fix: capCams(yT - 30), tools: ["screwdriver"] },
+ { title: "Lock the top to the back rail", detail: "Turn the cabinet round. One low cam lock in the top rail.", fix: [capRailCam("RT", yT - 30)], tools: ["screwdriver"] },
+ {
+ title: "Clip the back panels to the side frames",
+ detail: "Eight clips round the edges of the back. Push the base in, then click the clip into it.",
+ fix: [on("clip", "L", undefined, [1, 0, 0], pts([-xi], [yB + 200, yS[0] + 150, yS[1] + 150, yT - 200], [zp]), { name: "Back panel clip" }), on("clip", "R", undefined, [-1, 0, 0], pts([xi], [yB + 200, yS[0] + 150, yS[1] + 150, yT - 200], [zp]), { name: "Back panel clip" })],
+ },
+ {
+ title: "Hang the doors",
+ detail: "The hinges are on the doors. Push each one onto its plate in the side frame until it clicks.",
+ add: ["G1", "G2"],
+ fix: [on("hinge", "G1", "L", [0, 0, -1], hingeAt(-1)), on("hinge", "G2", "R", [0, 0, -1], hingeAt(1))],
+ },
+ {
+ title: "Screw the hinges to the side frames",
+ detail: "Open the doors. Two screws through each hinge plate into the inside of the frame.",
+ fix: sides.map(([id, sx]) => on("screw", id, undefined, [sx, 0, 0], hingeAt(sx).flatMap(([, y]) => [[sx * xi, y - 16, zF - 40], [sx * xi, y + 16, zF - 40]] as Vec3[]), { len: 16, dia: 3.5 })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the door stop screws",
+ detail: "A screw with a washer into the front edge of each side frame, near the top, for the push openers to meet the doors evenly.",
+ fix: [on("washer", "L", undefined, [0, 0, -1], [[-W / 2 + T / 2, yT - 40, zF]]), on("washer", "R", undefined, [0, 0, -1], [[W / 2 - T / 2, yT - 40, zF]]), ...sides.map(([id, sx]) => on("screw", id, undefined, [0, 0, -1], [[sx * (W / 2 - T / 2), yT - 40, zF]], { len: 12, dia: 3.5 }))],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fix the wall brackets to the top rail",
+ detail: "Two, at the back, then level the cabinet with the feet.",
+ fix: [on("bracket", "RT", undefined, [0, 0, 1], pts([-W / 4, W / 4], [yT - 30], [zB]), { name: "Wall fitting", included: true })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw it to the wall",
+ detail: "Use the plugs and screws that suit your wall. Turn the knobs to pull the cabinet snug to the wall.",
+ fix: [
+ on("plug", "RT", undefined, [0, 0, 1], pts([-W / 4, W / 4], [yT - 30], [zB - 40]), { included: true }),
+ on("screw", "RT", undefined, [0, 0, -1], pts([-W / 4, W / 4], [yT - 30], [zB]), { len: 70, dia: 5, included: true }),
+ on("knob", "RT", undefined, [0, 0, -1], pts([-W / 4, W / 4], [yT - 30], [zB + 10]), { name: "Adjuster knob" }),
+ ],
+ wall: true,
+ tools: ["drill"],
+ },
+ { title: "Press the covers on", detail: "One over each wall fitting.", fix: [on("cap", "RT", undefined, [0, 0, -1], pts([-W / 4, W / 4], [yT - 30], [zB + 20]), { len: 8, dia: 40 })] },
+ ];
+ return { parts, steps };
+}
+
+
+function tvBench(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const T = 40, tb = 25, yP = 70;
+ const yB = yP + tb, yT = H - tb;
+ const xi = W / 2 - T;
+ const tv = 18;
+ const zk = -D / 2 + 5; // the back panel sits in grooves at the very back
+ const zF = D / 2 - 20; // the doors are set in front of the dividers
+ const room = 520; // the two closed ends; the open middle takes what is left
+ const xv = xi - room - tv / 2;
+ const ySh = Math.round((yB + yT) / 2);
+ const parts: CustomPart[] = [
+ board("KR", "Plinth rail", [-W / 2 + 105, 10, 40], [W / 2 - 105, yP, 58], "wood"),
+ board("K1", "Leg block", [-W / 2 + 55, 10, -D / 2 + 30], [-W / 2 + 105, yP, D / 2 - 30], "wood"),
+ board("K2", "Leg block", [W / 2 - 105, 10, -D / 2 + 30], [W / 2 - 55, yP, D / 2 - 30], "wood"),
+ board("B", "Bottom", [-W / 2, yP, -D / 2], [W / 2, yB, D / 2]),
+ board("V1", "Divider", [-xv - tv / 2, yB, zk], [-xv + tv / 2, yT, zF]),
+ board("V2", "Divider", [xv - tv / 2, yB, zk], [xv + tv / 2, yT, zF]),
+ woven("L", "End frame", [-W / 2, yB, -D / 2], [-xi, yT, D / 2], 0),
+ woven("R", "End frame", [xi, yB, -D / 2], [W / 2, yT, D / 2], 0),
+ board("S1", "Shelf", [-xi, ySh - tv / 2, zk], [-xv - tv / 2, ySh + tv / 2, zF - 20]),
+ board("S2", "Shelf", [-xv + tv / 2, ySh - tv / 2, zk], [xv - tv / 2, ySh + tv / 2, zF - 20]),
+ board("S3", "Shelf", [xv + tv / 2, ySh - tv / 2, zk], [xi, ySh + tv / 2, zF - 20]),
+ board("P", "Back panel", [-xi, yB, -D / 2], [xi, yT, zk], "fiber"),
+ board("T", "Top", [-W / 2, yT, -D / 2], [W / 2, H, D / 2]),
+ woven("G1", "Door", [-xi, yB + 2, zF], [-xv - tv / 2 - 2, yT - 2, D / 2], 2),
+ woven("G2", "Door", [xv + tv / 2 + 2, yB + 2, zF], [xi, yT - 2, D / 2], 2),
+ ];
+ const xk = W / 2 - 80;
+ const zz = [-D / 2 + 70, D / 2 - 70];
+ const ym = (yB + yT) / 2;
+ const sideX = (sx: number) => sx * (W / 2 - T / 2);
+ // the top and bottom meet the end frames and the dividers at these points
+ const xsEnds = [-1, 1].map(sideX);
+ const hingeAt = (sx: number) => pts([sx * xi], [yB + 60, ym, yT - 60], [zF - 30]);
+ const steps: CustomStep[] = [
+ { title: "Screw a foot into the plinth rail", detail: "In the middle, from underneath. All the way in for now.", add: ["KR"], fix: [on("foot", "KR", undefined, [0, 1, 0], [[0, 10, 49]], { name: "Adjustable foot" })], pose: "-y", warnings: ["floor"] },
+ { title: "Screw two feet into each leg block", detail: "From underneath, all the way in.", fix: ["K1", "K2"].map((id, i) => on("foot", id, undefined, [0, 1, 0], pts([(i ? 1 : -1) * xk], [10], zz), { name: "Adjustable foot" })), wait: ["K1", "K2"] },
+ { title: "Screw a cam bolt into each leg block", detail: "In the inner face, where the rail goes.", fix: [on("camScrew", "K1", "KR", [-1, 0, 0], [[-W / 2 + 105, 50, 49]], { len: 34 }), on("camScrew", "K2", "KR", [1, 0, 0], [[W / 2 - 105, 50, 49]], { len: 34 })] },
+ { title: "Tap a dowel into each leg block", detail: "Next to the cam bolt.", fix: [on("dowel", "K1", undefined, [-1, 0, 0], [[-W / 2 + 105, 25, 49]]), on("dowel", "K2", undefined, [1, 0, 0], [[W / 2 - 105, 25, 49]])], tools: ["hammer"] },
+ { title: "Push the rail between the leg blocks", detail: "Feet up. Onto the dowel and cam bolt at each end, the cam lock holes facing you.", add: ["K1", "K2"], from: { K1: [-300, 0, 0], K2: [300, 0, 0] } },
+ { title: "Lock the rail to the leg blocks", detail: "Two tall cam locks, one at each end.", fix: [on("cam", "KR", undefined, [0, 1, 0], [[-W / 2 + 135, yP, 49], [W / 2 - 135, yP, 49]], CAM_B)], tools: ["screwdriver"] },
+ { title: "Screw cam bolts into the underside of the bottom", detail: "Lay the bottom right side down on a rug. Six bolts.", fix: [on("camScrew", "B", undefined, [0, 1, 0], [...pts([-xk, xk], [yP], zz), [-W / 4, yP, 49], [W / 4, yP, 49]], { len: 34 })], wait: ["B"] },
+ { title: "Tap dowels into the underside of the bottom", detail: "Four, two at each end.", fix: [on("dowel", "B", undefined, [0, 1, 0], pts([-xk, xk], [yP], [-D / 2 + 130, D / 2 - 130]))], tools: ["hammer"] },
+ { title: "Put the plinth on the bottom", detail: "Both upside down: the plinth goes onto the six cam bolts and four dowels.", add: ["B"], from: { B: [0, -400, 0] } },
+ {
+ title: "Lock the plinth to the bottom",
+ detail: "Six tall cam locks: two in each leg block and two in the rail.",
+ fix: [on("cam", "K1", undefined, [1, 0, 0], pts([-W / 2 + 55], [yP - 25], zz), CAM_B), on("cam", "K2", undefined, [-1, 0, 0], pts([W / 2 - 55], [yP - 25], zz), CAM_B), on("cam", "KR", undefined, [0, 0, -1], [[-W / 4, yP - 25, 58], [W / 4, yP - 25, 58]], CAM_B)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap dowels into both dividers",
+ detail: "Two in the bottom edge and two in the top edge of each.",
+ fix: ["V1", "V2"].flatMap((id, i) => [on("dowel", id, undefined, [0, 1, 0], pts([(i ? 1 : -1) * xv], [yB], [zk + 60, zF - 60])), on("dowel", id, undefined, [0, -1, 0], pts([(i ? 1 : -1) * xv], [yT], [zk + 60, zF - 60]))]),
+ wait: ["V1", "V2"],
+ tools: ["hammer"],
+ },
+ { title: "Turn it over and stand the dividers on the bottom", detail: "The plinth goes down onto its feet. Each divider onto its two dowels, front edges forward.", add: ["V1", "V2"], pose: "+y" },
+ {
+ title: "Lay it on its back and screw the dividers on",
+ detail: "Four screws through the bottom, two into each divider, with the Allen key.",
+ fix: ["V1", "V2"].map((id, i) => on("bolt", "B", id, [0, 1, 0], pts([(i ? 1 : -1) * xv], [yP], [-60, 60]), { name: "Connector screw", len: 50, dia: 7 })),
+ pose: "+z",
+ tools: ["allen"],
+ },
+ { title: "Stand it up and screw cam bolts into the bottom", detail: "Four, at the ends, for the end frames.", fix: [on("camScrew", "B", undefined, [0, 1, 0], pts(xsEnds, [yB], [-D / 2 + 70, D / 2 - 70]), { len: 34 })], pose: "+y" },
+ { title: "Tap dowels into the ends of the bottom", detail: "Two at each end, next to the cam bolts.", fix: [on("dowel", "B", undefined, [0, 1, 0], pts(xsEnds, [yB], [-D / 2 + 140, D / 2 - 140]))], tools: ["hammer"] },
+ { title: "Lower the end frames on", detail: "Each one onto two dowels and two cam bolts, the grooves facing in.", add: ["L", "R"] },
+ { title: "Lock the end frames", detail: "Four low cam locks, two in each frame.", fix: [-1, 1].map((sx) => on("cam", sx < 0 ? "L" : "R", undefined, [sx, 0, 0], pts([sx * xi], [yB + 30], [-D / 2 + 70, D / 2 - 70]), CAM_A)), tools: ["screwdriver"] },
+ {
+ title: "Screw in the shelf supports",
+ detail: "Twelve, four for each shelf, at the same height in every space.",
+ fix: [
+ on("pin", "L", undefined, [-1, 0, 0], pts([-xi], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ on("pin", "V1", undefined, [1, 0, 0], pts([-xv - tv / 2], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ on("pin", "V1", undefined, [-1, 0, 0], pts([-xv + tv / 2], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ on("pin", "V2", undefined, [1, 0, 0], pts([xv - tv / 2], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ on("pin", "V2", undefined, [-1, 0, 0], pts([xv + tv / 2], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ on("pin", "R", undefined, [1, 0, 0], pts([xi], [ySh - tv / 2], [zk + 50, zF - 70]), { name: "Shelf support" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Lay the shelves on the supports", detail: "One in each space, the notches under them over the supports.", add: ["S1", "S2", "S3"], from: { S1: [0, 0, 400], S2: [0, 0, 400], S3: [0, 0, 400] } },
+ { title: "Slide the back panel down the grooves", detail: "Smooth side in, cable holes at the top. Down until it meets the bottom.", add: ["P"], from: { P: [0, 500, 0] } },
+ {
+ title: "Fix the back panel to the dividers",
+ detail: "Two fittings into each divider: push the sleeve through the back, then the pin into it.",
+ fix: [-1, 1].flatMap((sx) => [on("clip", sx < 0 ? "V1" : "V2", undefined, [0, 0, 1], pts([sx * xv], [yB + 90, yT - 90], [-D / 2]), { name: "Back fitting sleeve" }), on("clip", sx < 0 ? "V1" : "V2", undefined, [0, 0, 1], pts([sx * xv], [yB + 90, yT - 90], [-D / 2 - 2]), { name: "Back fitting pin" })]),
+ },
+ { title: "Tap dowels into the tops of the end frames", detail: "Two in each.", fix: [-1, 1].map((sx) => on("dowel", sx < 0 ? "L" : "R", undefined, [0, -1, 0], pts([sideX(sx)], [yT], [-D / 2 + 140, D / 2 - 140]))), tools: ["hammer"] },
+ {
+ title: "Screw cam bolts into the underside of the top",
+ detail: "Lay the top right side down on a rug. Eight bolts.",
+ fix: [on("camScrew", "T", undefined, [0, -1, 0], [...pts(xsEnds, [yT], [-D / 2 + 70, D / 2 - 70]), ...pts([-xv, xv], [yT], [zk + 120, zF - 120])], { len: 34 })],
+ wait: ["T"],
+ },
+ {
+ title: "Screw the push opener holders under the top",
+ detail: "One over each door, 22 mm in from the front edge, two short screws each.",
+ fix: [on("screw", "T", undefined, [0, 1, 0], pts([-(xi + xv) / 2 - 15, -(xi + xv) / 2 + 15, (xi + xv) / 2 - 15, (xi + xv) / 2 + 15], [yT], [zF - 22]), { len: 12, dia: 3.5 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the push openers into the holders", detail: "Push each one in until it clicks. Don't press on the plunger.", fix: [on("connector", "T", undefined, [0, 1, 0], pts([-(xi + xv) / 2, (xi + xv) / 2], [yT], [zF - 22]), { name: "Push opener", len: 60, dia: 16 })] },
+ { title: "Lower the top on together", detail: "Two of you, straight down onto the eight dowels. Mind your fingers.", add: ["T"], people: 2 },
+ {
+ title: "Lock the top",
+ detail: "Eight low cam locks: two in each end frame and two in each divider.",
+ fix: [
+ ...[-1, 1].map((sx) => on("cam", sx < 0 ? "L" : "R", undefined, [sx, 0, 0], pts([sx * xi], [yT - 30], [-D / 2 + 70, D / 2 - 70]), CAM_A)),
+ ...[-1, 1].map((sx) => on("cam", sx < 0 ? "V1" : "V2", undefined, [1, 0, 0], pts([sx * xv - tv / 2], [yT - 30], [zk + 120, zF - 120]), CAM_A)),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Lock the shelves on their supports", detail: "Turn each of the twelve supports a quarter turn so it grips the shelf.", tools: ["screwdriver"] },
+ { title: "Hang the doors", detail: "The hinges are on the doors. Push each one onto its plate in the end frame until it clicks.", add: ["G1", "G2"], fix: [on("hinge", "G1", "L", [0, 0, -1], pts([-xi + 30], [yB + 60, ym, yT - 60], [zF])), on("hinge", "G2", "R", [0, 0, -1], pts([xi - 30], [yB + 60, ym, yT - 60], [zF]))] },
+ {
+ title: "Screw the hinges to the end frames",
+ detail: "Open the doors. Two screws through each hinge plate.",
+ fix: [-1, 1].map((sx) => on("screw", sx < 0 ? "L" : "R", undefined, [sx, 0, 0], hingeAt(sx).flatMap(([x, y, z]) => [[x, y - 16, z], [x, y + 16, z]] as Vec3[]), { len: 16, dia: 3.5 })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the door stop screws",
+ detail: "A screw with a washer into the front edge of each divider, for the doors to rest on.",
+ fix: [on("washer", "V1", undefined, [0, 0, -1], [[-xv, yT - 40, zF]]), on("washer", "V2", undefined, [0, 0, -1], [[xv, yT - 40, zF]]), on("screw", "V1", undefined, [0, 0, -1], [[-xv, yT - 40, zF]], { len: 12, dia: 3.5 }), on("screw", "V2", undefined, [0, 0, -1], [[xv, yT - 40, zF]], { len: 12, dia: 3.5 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Level it with the feet", detail: "Turn the five feet until the doors line up and the bench stands firm.", tools: [] },
+ {
+ title: "Fix the wall fittings to the back",
+ detail: "Two, on the end frames near the top.",
+ fix: [-1, 1].map((sx) => on("bracket", sx < 0 ? "L" : "R", undefined, [0, 0, 1], [[sx * (xi + T / 2), yT - 60, -D / 2]], { name: "Wall fitting", included: true })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw it to the wall",
+ detail: "Use the plugs and screws that suit your wall, then turn the knobs to pull it snug.",
+ fix: [
+ on("plug", "L", undefined, [0, 0, 1], [[-(xi + T / 2), yT - 60, -D / 2 - 40], [xi + T / 2, yT - 60, -D / 2 - 40]], { included: true }),
+ on("screw", "L", undefined, [0, 0, -1], [[-(xi + T / 2), yT - 60, -D / 2]], { len: 70, dia: 5, included: true }),
+ on("screw", "R", undefined, [0, 0, -1], [[xi + T / 2, yT - 60, -D / 2]], { len: 70, dia: 5, included: true }),
+ on("knob", "L", undefined, [0, 0, -1], [[-(xi + T / 2), yT - 60, -D / 2 + 10], [xi + T / 2, yT - 60, -D / 2 + 10]], { name: "Adjuster knob" }),
+ ],
+ wall: true,
+ tools: ["drill"],
+ },
+ { title: "Press the covers on", detail: "One over each wall fitting.", fix: [on("cap", "L", undefined, [0, 0, -1], [[-(xi + T / 2), yT - 60, -D / 2 + 20], [xi + T / 2, yT - 60, -D / 2 + 20]], { len: 8, dia: 40 })] },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["FRYKSÅS", "FRYKSAS"],
recipe(s) {
@@ -349,6 +685,8 @@ const family: Family = {
if (/armchair|footstool/.test(slug)) return armchair(s);
if (/storage-unit-on-castors/.test(slug)) return storage(s);
if (/desk/.test(slug)) return desk(s);
+ if (/cabinet/.test(slug)) return cabinet(s);
+ if (/tv-bench/.test(slug)) return tvBench(s);
return null;
},
};
diff --git a/src/lib/plan/families/fyresdal.ts b/src/lib/plan/families/fyresdal.ts
index dbd681f..f7ccfb7 100644
--- a/src/lib/plan/families/fyresdal.ts
+++ b/src/lib/plan/families/fyresdal.ts
@@ -60,13 +60,18 @@ function recipe(s: ProductSpec): CustomParams {
tubePart("EL2", "Leg tube", [xe, 0, zf], [xe, yLow, zf], 30);
// the bed frame: long rails at the back, middle and front, three middle legs along the back, cross tubes
- const yR = 400, xr = xe - 30;
- const zR = { b: zb + 40, m: 0, f: zf - 40 };
+ // the back rail sits against the back frame's lower rail, so the short bolt goes through one into the other
+ const yR = 415, xr = xe - 30;
+ const zR = { b: zb + 28, m: 0, f: zf - 40 };
tubePart("RB", "Long rail", [-xr, yR, zR.b], [xr, yR, zR.b], 30);
tubePart("RF", "Long rail", [-xr, yR, zR.f], [xr, yR, zR.f], 30);
tubePart("RM", "Long rail", [-xr, yR, zR.m], [xr, yR, zR.m], 30);
const legX = [-640, 0, 640];
- legX.forEach((x, i) => tubePart(`ML${i + 1}`, "Middle leg", [x, 0, zR.b - 30], [x, yR - 15, zR.b - 30], 30));
+ // each middle leg has a plate on top that screws up into the back rail
+ legX.forEach((x, i) => {
+ const c: Vec3 = [x, (yR - 15) / 2, zR.b];
+ part(`ML${i + 1}`, "Middle leg", [rod([x, 0, zR.b], [x, yR - 19, zR.b], c, 30), { shape: "box", size: [80, 4, 30], pos: [0, (yR - 17) - c[1], 0] }], c, [80, yR - 15, 30]);
+ });
legX.forEach((x, i) => tubePart(`C${i + 1}`, "Cross tube", [x, yR - 30, zR.b + 15], [x, yR - 30, zR.f - 15], 22));
// the pull-out frame under it, and its cross tubes
const yP = 200, zP = 440, xP = xr - 60;
@@ -104,12 +109,12 @@ function recipe(s: ProductSpec): CustomParams {
},
{ title: "Screw the tubes to the back", detail: "One screw in each, through the hole on top.", fix: [screw(undefined, [-1, 1].map((sx): Vec3 => [sx * xe, yLow - 30, zb + 15]), [0, 0, -1])], tools: ["allen"] },
{ title: "Push the leg tubes into the end frames", detail: "One into the front post of each frame, holes lined up.", wait: ["E1", "E2", "EL1", "EL2"] },
- { title: "Screw them to the end frames", detail: "One screw in each.", fix: [screw(undefined, [-1, 1].map((sx): Vec3 => [sx * xe, yLow - 30, zf + 15]), [0, 0, -1])], wait: ["E1", "E2", "EL1", "EL2"], tools: ["allen"] },
+ { title: "Screw them to the end frames", detail: "One screw in each.", fix: [...[-1, 1].map((sx) => screw(sx < 0 ? "EL1" : "EL2", [[sx * xe, yLow - 30, zf + 15]], [0, 0, -1]))], wait: ["E1", "E2", "EL1", "EL2"], tools: ["allen"] },
{
title: "Bolt the end frames to the back",
detail: "Stand the back up. Two long bolts join each end frame to a back post; the holes with flat sides face in.",
add: ["E1", "E2", "EL1", "EL2"],
- fix: [-1, 1].map((sx) => longBolts([yLow + 40, yArm - 40].map((y): Vec3 => [sx * (xe - 2), y, zb + TUBE]), [0, 0, -1], sx < 0 ? "E1" : "E2", "BK")),
+ fix: [-1, 1].map((sx) => longBolts([yLow, yArm].map((y): Vec3 => [sx * (xe - 2), y, zb + TUBE + 30]), [0, 0, -1], sx < 0 ? "E1" : "E2", "BK")),
pose: "+y",
people: 2,
},
@@ -122,8 +127,8 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Plate flat on the back rail, two screws each, then turn a glide into the foot of the outer two.",
add: ["ML1", "ML2", "ML3"],
fix: [
- { kind: "screw", count: 6, len: 12, dia: 6, at: legX.flatMap((x) => [-1, 1].map((e): Vec3 => [x + e * 25, yR - 15, zR.b - 30])), dir: [0, 1, 0], mate: "RB" },
- { kind: "foot", count: 2, len: 15, dia: 30, name: "Glide", at: [legX[0], legX[2]].map((x): Vec3 => [x, 0, zR.b - 30]), dir: [0, 1, 0] },
+ { kind: "screw", count: 6, len: 12, dia: 6, at: legX.flatMap((x) => [-1, 1].map((e): Vec3 => [x + e * 28, yR - 19, zR.b])), dir: [0, 1, 0], mate: "RB" },
+ { kind: "foot", count: 2, len: 15, dia: 30, name: "Glide", at: [legX[0], legX[2]].map((x): Vec3 => [x, 0, zR.b]), dir: [0, 1, 0] },
],
tools: ["allen"],
},
@@ -147,9 +152,9 @@ function recipe(s: ProductSpec): CustomParams {
title: "Bolt the frame to the back and ends",
detail: "One short bolt and one screw at the middle, then two long bolts through each end frame into the rails.",
fix: [
- { kind: "bolt", count: 1, len: 20, dia: 8, name: "Short bolt", at: [[0, yR, zb]], dir: [0, 0, 1], on: "BK", mate: "RB" },
+ { kind: "bolt", count: 1, len: 20, dia: 8, name: "Short bolt", at: [[0, yLow - 6, zb - 2]], dir: [0, 0, 1], on: "BK", mate: "RB" },
screw("RM", [[0, yR + 15, 0]]),
- ...[-1, 1].flatMap((sx) => (["RB", "RF"] as const).map((r) => longBolts([[sx * xe, yR, r === "RB" ? zR.b : zR.f]], [-sx, 0, 0], sx < 0 ? "E1" : "E2", r))),
+ ...[-1, 1].flatMap((sx) => (["RB", "RF"] as const).map((r) => longBolts([[sx * xe, yR + 3, r === "RB" ? zR.b : zR.f]], [-sx, 0, 0], sx < 0 ? "E1" : "E2", r))),
],
tools: ["allen"],
},
@@ -158,7 +163,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Snap one onto each end of the middle rail until it clicks, then a screw in each. Two countersunk screws fix the front rail's ends.",
fix: [
{ kind: "clip", count: 2, len: 40, dia: 30, name: "Slat bracket", at: [-1, 1].map((sx): Vec3 => [sx * (xr - 40), yR + 15, 0]), dir: [0, -1, 0], on: "RM" },
- { kind: "screw", count: 2, len: 12, dia: 6, at: [-1, 1].map((sx): Vec3 => [sx * (xr - 40), yR + 15, 0]), dir: [0, -1, 0], on: "RM" },
+ { kind: "screw", count: 2, len: 12, dia: 6, at: [-1, 1].map((sx): Vec3 => [sx * (xr - 66), yR + 15, 0]), dir: [0, -1, 0], on: "RM" },
{ kind: "screw", count: 2, len: 20, dia: 5, name: "Countersunk screw", at: [-1, 1].map((sx): Vec3 => [sx * (xr - 10), yR + 15, zR.f]), dir: [0, -1, 0], on: "RF" },
],
tools: ["allen"],
diff --git a/src/lib/plan/families/galant.ts b/src/lib/plan/families/galant.ts
index 6c34b16..b301138 100644
--- a/src/lib/plan/families/galant.ts
+++ b/src/lib/plan/families/galant.ts
@@ -153,7 +153,7 @@ function traySteps(b: Box, y0: number, fh: number): CustomStep[] {
},
{ title: "Fix the back between the sides", detail: "A dowel in each end of the back, then turn the two small cam locks.", add: ["tk"], fix: [fx({ ...SMALL_DOWEL, at: SX.map((sx) => [sx * (xs - th), ym + 15, zk] as Vec3), dir: [0, 0, 0], on: "tk" }), fx({ ...SMALL_CAM, at: SX.map((sx) => [sx * (xs - th - 25), ym, zk] as Vec3), dir: [0, 0, 1], on: "tk" })].map((f, i) => (i === 0 ? { ...f, dir: undefined } : f)), tools: ["screwdriver"] },
{ title: "Slide in the tray bottom", detail: "Along the grooves, from the open front.", add: ["tb"] },
- { title: "Fit the tray front", detail: "Two dowels into it, push it onto the sides and turn its two small cam locks.", add: ["tf"], fix: [fx({ ...SMALL_DOWEL, at: SX.map((sx) => [sx * (xs - th / 2), ym + 15, z0] as Vec3), dir: [0, 0, -1], on: "tf" }), fx({ ...SMALL_CAM, at: SX.map((sx) => [sx * (xs - th / 2 - 30), ym, z0 - 1] as Vec3), dir: [0, 0, -1], on: "tf" })], tools: ["screwdriver"] },
+ { title: "Fit the tray front", detail: "Two dowels into it, push it onto the sides and turn its two small cam locks.", add: ["tf"], from: { tf: [0, 0, 300] }, fix: [fx({ ...SMALL_DOWEL, at: SX.map((sx) => [sx * (xs - th / 2), ym + 15, z0] as Vec3), dir: [0, 0, -1], on: "tf" }), fx({ ...SMALL_CAM, at: SX.map((sx) => [sx * (xs - th / 2 - 30), ym, z0 - 1] as Vec3), dir: [0, 0, -1], on: "tf" })], tools: ["screwdriver"] },
{ title: "Screw the stop brackets under the sides", detail: "One at the back of each side, one screw each.", fix: [fx({ kind: "angle", name: "Stop bracket", len: 30, dia: 24, at: SX.map((sx) => [sx * (xs - th / 2), y0 + 15, zk + 40] as Vec3), dir: [0, 1, 0] }), fx({ ...SCREW, at: SX.map((sx) => [sx * (xs - th / 2), y0 + 15, zk + 40] as Vec3), dir: [0, 1, 0] })], tools: ["screwdriver"] },
{ title: "Screw on the tray handle", detail: "Two screws from behind.", fix: [fx({ kind: "handle", len: 200, dia: 20, at: [[0, y0 + fh / 2, b.zF]], dir: [0, 0, -1], on: "tf" }), fx({ ...HSCREW, at: [-90, 90].map((x) => [x, y0 + fh / 2, z0] as Vec3), dir: [0, 0, 1], on: "tf" })], tools: ["screwdriver"] },
{
@@ -280,7 +280,7 @@ function plinthSteps(b: Box, p: { parts: CustomPart[]; nodes: Vec3[] }, pose: "+
{
title: "Bolt the frame under the bottom",
detail: "Through each corner piece into the bottom, by hand, then push a pin into each corner.",
- fix: [fx({ kind: "bolt", len: 30, dia: 8, at: p.nodes.map((n) => [n[0], top, n[2]] as Vec3), dir: [0, 1, 0] }), fx({ kind: "pin", name: "Locking pin", len: 50, dia: 6, at: p.nodes.map((n) => [n[0] + 15, top - 10, n[2]] as Vec3), dir: [0, 1, 0] })],
+ fix: [fx({ kind: "bolt", len: 30, dia: 8, at: p.nodes.map((n) => [n[0], top - 12, n[2]] as Vec3), dir: [0, 1, 0] }), fx({ kind: "pin", name: "Locking pin", len: 50, dia: 6, at: p.nodes.map((n) => [n[0] + 15, top - 10, n[2]] as Vec3), dir: [0, 1, 0] })],
tools: ["allen"],
},
{ title: "Screw in the feet", detail: "One into the underside of each corner piece, by hand.", fix: [fx({ kind: "foot", len: 20, dia: 40, at: p.nodes.map((n) => [n[0], 0, n[2]] as Vec3), dir: [0, 1, 0] })], warnings: ["hand"] },
@@ -344,23 +344,29 @@ function cabinet(s: ProductSpec): CustomParams {
{ title: "Click the cord outlet into the back", detail: "The two rings from both sides of the hole, until they click.", add: ["back"], fix: [fx({ kind: "cap", name: "Cord outlet", len: 10, dia: 60, at: [[xi - 120, yb + T + 120, zB + 1]], dir: [0, 0, 1], on: "back" })] },
{ title: "Slide the back into the grooves", detail: "Two small dowels go into its edge first. Finished side down, towards the floor.", fix: [fx({ ...SMALL_DOWEL, at: [[-xi + 2, yb + T + 150, zB + 10], [-xi + 2, top - 150, zB + 10]], dir: [1, 0, 0], on: "back" })], tools: ["hammer"] },
{ title: "Lock the back with two small cam locks", detail: "The small ones from the bag.", fix: [fx({ ...SMALL_CAM, at: [[-xi + 40, yb + T + 150, zB + 20], [-xi + 40, top - 150, zB + 20]], dir: [0, 0, -1], on: "back" })], tools: ["screwdriver"] },
- { title: "Screw the cam bolts into the top", detail: "Four, into the holes on its underside.", fix: [fx({ ...BOLT, at: SX.flatMap((sx) => topJoint(b, sx, 2)), dir: [0, 1, 0], on: "top" })], tools: ["screwdriver"] },
- { title: "Push the top onto the side and lock it", detail: "Dowels into the side's end, push the top on, two cam locks and two small cam locks into the back.", add: ["top"], fix: [fx({ ...DOWEL, at: [zB + 30, zF - 30].map((z) => [-(W / 2 - T / 2), top, z] as Vec3), dir: [0, -1, 0] }), fx({ ...CAM, at: topJoint(b, -1, 2).map((q) => [-xi, q[1] - 30, q[2]] as Vec3), dir: [-1, 0, 0] })], tools: ["screwdriver"] },
{
title: "Push on the other side",
- detail: "Screw its four cam bolts in, dowels into the bottom and top, then push it on and turn four cam locks.",
+ detail: "Screw its four cam bolts in, dowels into the bottom, then push it on and turn the two cam locks in the bottom.",
add: ["R"],
fix: [
fx({ ...BOLT, at: [...bottomJoint(b, 1, 2), ...topJoint(b, 1, 2)].map((q) => [W / 2 - T / 2, q[1], q[2]] as Vec3), dir: [-1, 0, 0], on: "R" }),
fx({ ...DOWEL, at: [zB + 40, zF - 40].map((z) => [xi, yb + T / 2, z] as Vec3), dir: [-1, 0, 0], on: "bottom" }),
- fx({ ...DOWEL, at: [zB + 30, zF - 30].map((z) => [W / 2 - T / 2, top, z] as Vec3), dir: [0, -1, 0], on: "R" }),
fx({ ...CAM, at: camIn(bottomJoint(b, 1, 2), 1), dir: [0, 1, 0], on: "bottom" }),
- fx({ ...CAM, at: topJoint(b, 1, 2).map((q) => [xi, q[1] - 30, q[2]] as Vec3), dir: [1, 0, 0] }),
],
people: 2,
warnings: ["two"],
tools: ["screwdriver"],
},
+ // the top goes on last, down onto the ends of both sides, as the manual shows
+ { title: "Screw the cam bolts into the top", detail: "Four, into the holes on its underside.", fix: [fx({ ...BOLT, at: SX.flatMap((sx) => topJoint(b, sx, 2)), dir: [0, 1, 0], on: "top" })], tools: ["screwdriver"], wait: ["top"] },
+ {
+ title: "Push the top on and lock it",
+ detail: "Dowels into the ends of both sides, push the top on, then turn the four cam locks.",
+ add: ["top"],
+ from: { top: [0, 350, 0] },
+ fix: [fx({ ...DOWEL, at: SX.flatMap((sx) => [zB + 30, zF - 30].map((z) => [sx * (W / 2 - T / 2), top, z] as Vec3)), dir: [0, -1, 0] }), ...SX.map((sx) => fx({ ...CAM, at: topJoint(b, sx, 2).map((q) => [sx * xi, q[1] - 30, q[2]] as Vec3), dir: [sx, 0, 0] }))],
+ tools: ["screwdriver", "hammer"],
+ },
...plinthSteps(b, p, "+z"),
{ title: "Stand it up together", detail: "Onto its feet. Turn the feet to level it.", pose: "+y", people: 2, warnings: ["two"] },
{ title: "Fix the bag hook", detail: "Two plastic discs and the hook under the top at the side, one screw each.", fix: [fx({ kind: "hook", name: "Bag hook", len: 40, dia: 30, at: [[W / 2 - 60, top, zF - 80]], dir: [0, 1, 0], on: "top" }), fx({ kind: "screw", len: 16, dia: 4, at: [[W / 2 - 60, top, zF - 80], [-W / 2 + 60, top, zF - 80]], dir: [0, 1, 0], on: "top" })], tools: ["allen"] },
@@ -413,8 +419,8 @@ function sliding(s: ProductSpec): CustomParams {
fix: [fx({ ...SCREW, at: [-0.4, -0.25, -0.1, 0.1, 0.25, 0.4].map((t) => [t * 2 * xi, yb + T + 6, zIn + 21] as Vec3), dir: [0, -1, 0], on: "trackB", mate: "bottom" })],
tools: ["screwdriver"],
},
- { title: "Bolt the frame under the bottom", detail: "Six bolts up through the frame pieces, then a pin into each.", fix: [fx({ kind: "bolt", len: 30, dia: 8, at: p.nodes.map((n) => [n[0], yb, n[2]] as Vec3), dir: [0, 1, 0] }), fx({ kind: "pin", name: "Locking pin", len: 50, dia: 6, at: p.nodes.map((n) => [n[0] + 15, yb - 10, n[2]] as Vec3), dir: [0, 1, 0] })], tools: ["allen"] },
- { title: "Stand the divider on the bottom", detail: "Two dowels and two stud bolts into its lower end, then onto the middle of the bottom and turn two cam locks.", add: ["div"], fix: [fx({ ...DOWEL, at: [[0, yb + T, -150], [0, yb + T, 100]], dir: [0, -1, 0], on: "div" }), fx({ kind: "camScrew", name: "Stud bolt", len: 40, at: [[0, yb + T, -50], [0, yb + T, 180]], dir: [0, -1, 0], on: "div" }), fx({ ...CAM, at: [[30, yb + T / 2, -50], [30, yb + T / 2, 180]], dir: [0, 1, 0], on: "bottom" })], tools: ["screwdriver"] },
+ { title: "Bolt the frame under the bottom", detail: "Six bolts up through the frame pieces, then a pin into each.", fix: [fx({ kind: "bolt", len: 30, dia: 8, at: p.nodes.map((n) => [n[0], yb - 12, n[2]] as Vec3), dir: [0, 1, 0] }), fx({ kind: "pin", name: "Locking pin", len: 50, dia: 6, at: p.nodes.map((n) => [n[0] + 15, yb - 10, n[2]] as Vec3), dir: [0, 1, 0] })], tools: ["allen"] },
+ { title: "Stand the divider on the bottom", detail: "Two dowels and two stud bolts into its lower end, then onto the middle of the bottom and turn two cam locks.", add: ["div"], fix: [fx({ ...DOWEL, at: [[0, yb + T, -150], [0, yb + T, 100]], dir: [0, -1, 0], on: "div" }), fx({ kind: "camScrew", name: "Stud bolt", len: 40, at: [[0, yb + T, -50], [0, yb + T, 140]], dir: [0, -1, 0], on: "div" }), fx({ ...CAM, at: [[30, yb + T / 2, -50], [30, yb + T / 2, 140]], dir: [0, 1, 0], on: "bottom" })], tools: ["screwdriver"] },
{ title: "Click the cord outlets into the backs", detail: "Two rings in each hole, from both sides.", add: ["back0", "back1"], fix: [fx({ kind: "cap", name: "Cord outlet", len: 10, dia: 60, at: SX.map((sx) => [sx * (xi / 2), yb + T + 120, zB + 1] as Vec3), dir: [0, 0, 1] })] },
{ title: "Fix the backs to the divider", detail: "A dowel into the divider's back edge for each, push the backs on and turn four small cam locks.", fix: [fx({ kind: "dowel", name: "Long dowel", len: 80, dia: 8, at: [[0, yb + T + hs / 2, zB + 10]], dir: [0, 0, 1], on: "div" }), fx({ ...SMALL_CAM, at: SX.flatMap((sx) => [yb + T + 150, top - 150].map((y) => [sx * 40, y, zB + 20] as Vec3)), dir: [0, 0, -1] })], tools: ["screwdriver"] },
{
diff --git a/src/lib/plan/families/gavle.ts b/src/lib/plan/families/gavle.ts
index c976939..2855fd4 100644
--- a/src/lib/plan/families/gavle.ts
+++ b/src/lib/plan/families/gavle.ts
@@ -62,7 +62,7 @@ function chair(s: ProductSpec): CustomParams {
const parts: CustomPart[] = [
{ id: "BF", name: "Back frame", size: [W, H, D / 2], pos: bc, pieces: backPieces, material: "metal" },
{ id: "LF", name: "Leg frame", size: [2 * xF + TUBE, yRail, zFoot - zJoint], pos: fc, pieces: legPieces, material: "metal" },
- { id: "BK", name: "Back", size: [W - 60, 45, 290], pieces: oval(W - 60, 45, 290), pos: [0, yBack, zPost + TUBE / 2 + 25], rot: [Math.PI / 2 - lean, 0, 0], material: "soft" },
+ { id: "BK", name: "Back", size: [W - 20, 45, 290], pieces: oval(W - 20, 45, 290), pos: [0, yBack, zPost + TUBE / 2 + 25], rot: [Math.PI / 2 - lean, 0, 0], material: "soft" },
{ id: "ST", name: "Seat", size: [W, 75, 420], pieces: oval(W, 75, 420), pos: [0, yRail + TUBE / 2 + 37, 40], material: "soft" },
];
@@ -84,7 +84,7 @@ function chair(s: ProductSpec): CustomParams {
title: "Bolt the leg frame to it",
detail: "The side rails go inside the back frame. One short bolt each side, only loosely for now.",
add: ["LF"],
- fix: [{ kind: "bolt", count: 2, len: 12, dia: 6, on: "BF", mate: "LF", at: [-1, 1].map((sx): Vec3 => [sx * (xB + TUBE / 2), yRail, zJoint]), dir: [1, 0, 0] }],
+ fix: [-1, 1].map((sx) => ({ kind: "bolt" as const, count: 1, len: 12, dia: 6, on: "BF", mate: "LF", at: [[sx * (xB + TUBE / 2), yRail, zJoint] as Vec3], dir: [-sx, 0, 0] as Vec3 })),
tools: ["allen"],
pose: "-y",
},
@@ -92,7 +92,7 @@ function chair(s: ProductSpec): CustomParams {
title: "Turn it over and bolt on the back",
detail: "Curved side to the front. Four long bolts from behind through the posts.",
add: ["BK"],
- fix: [{ kind: "bolt", count: 4, len: 35, dia: 6, on: "BF", mate: "BK", at: [-1, 1].flatMap((sx) => [470, 640].map((y) => post(sx, y))), dir: [0, 0, 1] }],
+ fix: [{ kind: "bolt", count: 4, len: 35, dia: 6, on: "BF", mate: "BK", at: [-1, 1].flatMap((sx) => [500, 620].map((y) => post(sx, y))), dir: [0, 0, 1] }],
tools: ["allen"],
pose: "+y",
},
diff --git a/src/lib/plan/families/gersby.ts b/src/lib/plan/families/gersby.ts
new file mode 100644
index 0000000..3d70eb8
--- /dev/null
+++ b/src/lib/plan/families/gersby.ts
@@ -0,0 +1,121 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * GERSBY, read from its manual. Built lying on its front: dowels go into both ends of the top, the fixed shelf and
+ * the bottom, they stand in one side and are fixed with two long screws each through it, the plinth goes on with
+ * dowels at the bottom front, then the other side goes on with the same screws. The fixed shelf is marked on the
+ * back edges, the folding back panel is nailed on, it stands up and two brackets hold the top to the wall. Shelf pins
+ * and three loose shelves go in last.
+ */
+
+const T = 15; // panels
+const B = 3; // the back lies on the back edges
+const PL = 50; // plinth
+
+type Kind = CustomFix["kind"];
+const fx = (kind: Kind, dir: Vec3, at: Vec3[], o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, dir, at, ...o });
+
+function bookcase(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const Wi = W - 2 * T;
+ const dz = B / 2; // everything but the back sits this far forward
+ const Dp = D - B;
+ const yTop = H - T / 2, yBot = PL + T / 2, yFix = Math.round(H * 0.48);
+ const zPl = D / 2 - T / 2 - 8;
+ const parts: CustomPart[] = [
+ { id: "L", name: "Side panel", size: [T, H, Dp], pos: [-W / 2 + T / 2, H / 2, dz] },
+ { id: "R", name: "Side panel", size: [T, H, Dp], pos: [W / 2 - T / 2, H / 2, dz] },
+ { id: "top", name: "Top panel", size: [Wi, T, Dp], pos: [0, yTop, dz] },
+ { id: "fix", name: "Fixed shelf", size: [Wi, T, Dp], pos: [0, yFix, dz] },
+ { id: "bot", name: "Bottom panel", size: [Wi, T, Dp], pos: [0, yBot, dz] },
+ { id: "pl", name: "Plinth", size: [Wi, PL, T], pos: [0, PL / 2, zPl] },
+ { id: "back", name: "Back panel", size: [W, H, B], pos: [0, H / 2, -D / 2 + B / 2], material: "fiber" },
+ ];
+ // three loose shelves: two above the fixed shelf, one below
+ const sd = Dp - 10;
+ const shelfYs = [Math.round((yBot + yFix) / 2), Math.round(yFix + (yTop - yFix) / 3), Math.round(yFix + (2 * (yTop - yFix)) / 3)];
+ shelfYs.forEach((y, i) => parts.push({ id: `S${i}`, name: "Shelf", size: [Wi - 2, T, sd], pos: [0, y, D / 2 - sd / 2 - 4] }));
+
+ const zs = Dp / 2 - 40;
+ const boards: [string, number][] = [["top", yTop], ["fix", yFix], ["bot", yBot]];
+ const dowels = (sx: number, list: [string, number][]): CustomFix[] =>
+ list.map(([id, y]) => fx("dowel", [sx, 0, 0], [-zs, zs].map((z) => [sx * (Wi / 2), y, dz + z] as Vec3), { on: id, len: 30, dia: 8 }));
+ const plinthDowels = (sx: number) => fx("dowel", [sx, 0, 0], [PL / 2 - 12, PL / 2 + 12].map((y) => [sx * (Wi / 2), y, zPl] as Vec3), { on: "pl", len: 30, dia: 8 });
+ const screws = (sx: number): CustomFix =>
+ fx("screw", [-sx, 0, 0], boards.flatMap(([, y]) => [-zs + 30, zs - 30].map((z) => [sx * (W / 2), y, dz + z] as Vec3)), { on: sx < 0 ? "L" : "R", len: 50, dia: 7, name: "Long screw" });
+ const pins = (sx: number): CustomFix =>
+ fx("pin", [sx, 0, 0], shelfYs.flatMap((y) => [-1, 1].map((sz) => [sx * (Wi / 2), y - T / 2 - 3, D / 2 - sd / 2 - 4 + sz * (sd / 2 - 40)] as Vec3)), { on: sx < 0 ? "L" : "R", dia: 5, len: 16 });
+ const bx = [-1, 1].map((sx) => sx * (Wi / 2 - 60));
+ const zb = -D / 2 + 30;
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the dowels into the top, fixed shelf and bottom",
+ detail: "Two in each end of every panel. Then stand the side on its long edge on a rug and push the three panels onto it, the unfinished edges facing down.",
+ add: ["L", "top", "fix", "bot"],
+ fix: [...dowels(-1, boards), ...dowels(1, boards)],
+ tools: ["hammer"],
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ { title: "Screw the side to the panels", detail: "Two long screws through the side into each panel, with the Allen key. Turn them until they're snug.", fix: [screws(-1)], tools: ["allen"] },
+ {
+ title: "Fit the plinth",
+ detail: "Two dowels in each end, then push it into the side at the bottom, under the bottom panel at the front.",
+ add: ["pl"],
+ fix: [plinthDowels(-1), plinthDowels(1)],
+ tools: ["hammer"],
+ },
+ { title: "Put the other side on and screw it", detail: "Line it up on all the dowels, press it home, then the same six long screws.", add: ["R"], fix: [screws(1)], tools: ["allen"] },
+ {
+ title: "Mark the fixed shelf on the back edges",
+ detail: "A pencil mark on the back edge of each side at the middle of the fixed shelf, so you know where to nail across it.",
+ tools: ["pencil"],
+ },
+ {
+ title: "Nail the back panel on",
+ detail: "Unfold it over the back, smooth side in, flush with the outer edges. Nail the corners first, check it's square, then along the edges and across the fixed shelf.",
+ add: ["back"],
+ fix: [{ kind: "nail", count: 32, len: 20, dia: 1.6, to: ["back"] }],
+ from: { back: [0, 0, -300] },
+ tools: ["hammer", "pencil"],
+ check: "square",
+ },
+ {
+ title: "Stand it up and screw the wall brackets on top",
+ detail: "Lift it upright together. One bracket at each end of the top, at the back, a washer under the screw.",
+ pose: "+y",
+ people: 2,
+ warnings: ["two"],
+ fix: [
+ fx("angle", [0, -1, 0], bx.map((x) => [x, H + 30, -D / 2 + 2] as Vec3), { on: "top", name: "Wall bracket", len: 60, dia: 30 }),
+ fx("washer", [0, -1, 0], bx.map((x) => [x, H + 2, zb] as Vec3), { len: 1.5, dia: 16 }),
+ fx("screw", [0, -1, 0], bx.map((x) => [x, H + 3, zb] as Vec3), { on: "top", len: 12, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw it to the wall",
+ detail: "Through the slot in each bracket, a washer under each screw. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", [0, 0, -1], bx.map((x) => [x, H + 40, -D / 2 - 40] as Vec3), { len: 35, dia: 8 }),
+ fx("washer", [0, 0, -1], bx.map((x) => [x, H + 40, -D / 2] as Vec3), { len: 1.5, dia: 16 }),
+ fx("screw", [0, 0, -1], bx.map((x) => [x, H + 40, -D / 2 - 4] as Vec3), { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ { title: "Put the shelf pins and shelves in", detail: "Four pins at the same height for each shelf, then lay the shelf on them.", add: shelfYs.map((_, i) => `S${i}`), fix: [pins(-1), pins(1)] },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["GERSBY"],
+ recipe(s) {
+ if (/gersby-bookcase/.test(s.slug ?? "")) return bookcase(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/gladhojden.ts b/src/lib/plan/families/gladhojden.ts
index f242e3a..51a562e 100644
--- a/src/lib/plan/families/gladhojden.ts
+++ b/src/lib/plan/families/gladhojden.ts
@@ -1,5 +1,5 @@
import type { Family } from "./family";
-import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
/**
* GLADHÖJDEN sit/stand desk, read from its manual. The base is built upside down: the lift beam (it carries the gas
@@ -86,7 +86,7 @@ function desk(s: ProductSpec): CustomParams {
{
title: "Bolt the stretcher on",
detail: "One long bolt through each frame's bar into the end of the stretcher.",
- fix: [{ kind: "bolt", count: 2, len: 90, dia: 6, on: "S", at: [-1, 1].map((sx): Vec3 => [sx * (xF + TUBE / 2), yBar, zMid]), dir: [1, 0, 0] }],
+ fix: [-1, 1].map((sx): CustomFix => ({ kind: "bolt", count: 1, len: 90, dia: 6, on: "S", at: [[sx * (xF + TUBE / 2), yBar, zMid]], dir: [-sx, 0, 0] })),
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/gladstad.ts b/src/lib/plan/families/gladstad.ts
index 2d692fa..23e2874 100644
--- a/src/lib/plan/families/gladstad.ts
+++ b/src/lib/plan/families/gladstad.ts
@@ -54,6 +54,21 @@ function turn(v: Vec3, r: Rot): Vec3 {
return [x * c - y * s, x * s + y * c, z];
}
+type M3 = number[][];
+const mul = (a: M3, b: M3): M3 => a.map((r) => [0, 1, 2].map((j) => r[0] * b[0][j] + r[1] * b[1][j] + r[2] * b[2][j]));
+/** The matrix of a three.js "XYZ" Euler turn. */
+function matOf([x, y, z]: Vec3): M3 {
+ const [a, b, c] = [x, y, z].map(Math.cos), [d, e, f] = [x, y, z].map(Math.sin);
+ const rx = [[1, 0, 0], [0, a, -d], [0, d, a]], ry = [[b, 0, e], [0, 1, 0], [-e, 0, b]], rz = [[c, -f, 0], [f, c, 0], [0, 0, 1]];
+ return mul(mul(rx, ry), rz);
+}
+/** Back to an "XYZ" Euler turn, as three.js reads one from a matrix. */
+function eulerOf(m: M3): Vec3 {
+ const y = Math.asin(Math.max(-1, Math.min(1, m[0][2])));
+ if (Math.abs(m[0][2]) < 0.9999999) return [Math.atan2(-m[1][2], m[2][2]), y, Math.atan2(-m[0][1], m[0][0])];
+ return [Math.atan2(m[2][1], m[1][1]), y, 0];
+}
+
/** Parts placed where they end up; steps bring them in, in the main scene or laid out on their own in another. */
class Kit {
private keys = new Map<string, string>();
@@ -106,8 +121,10 @@ class Kit {
for (const id of ids) {
const p = this.boxes.get(id)!;
const d = turn([p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]], r);
- const rot: Vec3 = [0, 0, 0];
- rot[r.axis] = r.a;
+ const turnBy: Vec3 = [0, 0, 0];
+ turnBy[r.axis] = r.a;
+ // a part already turned in the bed (the left slat rail) keeps that turn inside the group's
+ const rot = p.rot.some((a) => a) ? eulerOf(mul(matOf(turnBy), matOf(p.rot))) : turnBy;
this.b.stage(this.key(id), [to[0] + d[0], to[1] + d[1], to[2] + d[2]], rot, from);
}
this.b.then(0.12);
diff --git a/src/lib/plan/families/glamberget.ts b/src/lib/plan/families/glamberget.ts
index 0a7efbf..e9a85e8 100644
--- a/src/lib/plan/families/glamberget.ts
+++ b/src/lib/plan/families/glamberget.ts
@@ -86,7 +86,7 @@ function divider(s: ProductSpec): CustomParams {
return [
at("washer", [[x, yUpBar, 0]], [0, -1, 0], `FU${i}`, `FL${i}`, { len: 3, dia: 30 }),
at("stud", [[x, yArmLo + 30, 0]], [0, -1, 0], i === 0 ? "AB0" : "AB2", `FU${i}`, ROD_L),
- at("bolt", [[x, 0, 0]], [0, 1, 0], `FL${i}`, `FU${i}`, { name: "Connector bolt", len: 20, dia: 8 }),
+ at("bolt", [[x, yLowBar, 0]], [0, 1, 0], `FL${i}`, `FU${i}`, { name: "Connector bolt", len: 20, dia: 8 }),
];
};
const joint = (k: number, y: number, rod: typeof ROD_L, on: string, mate: string) => at("stud", [[xs[k], y, 0]], [0, -1, 0], on, mate, rod);
@@ -102,7 +102,7 @@ function divider(s: ProductSpec): CustomParams {
title: "Press two glides into each lower foot bar",
detail: "One at each end, on the side without the sunk hole.",
add: ["FL0", "FL1"],
- fix: [at("glide", feet.flatMap((x) => [[x, 0, -barL + 50], [x, 0, 10]] as Vec3[]), [0, 1, 0], undefined, undefined, GLIDE)],
+ fix: [at("glide", feet.flatMap((x) => [[x, 0, -barL + 50], [x, 0, -40]] as Vec3[]), [0, 1, 0], undefined, undefined, GLIDE)],
},
{
title: "Bolt each foot together with a bottom arm",
@@ -214,6 +214,7 @@ function wardrobe(s: ProductSpec): CustomParams {
// a cylinder lies along x by turning it, so give its size as it stands
parts[parts.length - 1].size = [25, xIn - T / 2, 25];
+ const onDoor = (pts: Vec3[], d: (typeof doors)[number]) => pts.filter((p) => Math.abs(p[0] - d.x) < doorW / 2 && p[2] === d.z);
const inset = (d: (typeof doors)[number], y: number, k: number): Vec3 => [Math.round(d.x + k * (doorW / 2 - 60)), y, d.z];
const tops = doors.flatMap((d) => [-1, 1].map((k) => inset(d, yDoor + doorH / 2, k)));
const bottoms = doors.flatMap((d) => [-1, 1].map((k) => inset(d, yDoor - doorH / 2, k)));
@@ -224,8 +225,8 @@ function wardrobe(s: ProductSpec): CustomParams {
const hangDoor = (d: (typeof doors)[number], back: boolean): CustomStep => ({
title: back ? "Hang the back door" : d.id === "DA" ? "Hang the first front door on the inner track" : "Hang the last door on the outer track",
detail: "Tilt the top in first: push the guides up into the top track and lock their tabs, then lower the rollers into the bottom track and press until they click.",
- add: [d.id, `E${d.id}`],
- from: { [d.id]: [0, 0, back ? -300 : 300], [`E${d.id}`]: [0, 0, back ? -300 : 300] },
+ add: [d.id],
+ from: { [d.id]: [0, 0, back ? -300 : 300] },
people: 2,
warnings: ["two"],
});
@@ -245,15 +246,16 @@ function wardrobe(s: ProductSpec): CustomParams {
fix: [at("dowel", [-1, 1].map((sx) => [sx * (footX - 15), 90, 0] as Vec3), [-1, 0, 0], "RL", undefined, { len: 40, dia: 10 })],
tools: ["hammer"],
},
- { title: "Press a glide under each foot", detail: "Two under each foot, into the holes in the bottom edge.", add: ["FT0", "FT1"], fix: [at("glide", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * footX, 0, sz * (D / 2 - 120)] as Vec3)), [0, 1, 0], undefined, undefined, { name: "Glide", len: 6, dia: 40 })] },
+ { title: "Press a glide under each foot", detail: "Two under each foot, into the holes in the bottom edge.", add: ["FT0", "FT1"], from: { FT0: [-300, 0, 0], FT1: [300, 0, 0] }, fix: [at("glide", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * footX, 0, sz * (D / 2 - 120)] as Vec3)), [0, 1, 0], undefined, undefined, { name: "Glide", len: 6, dia: 40 })] },
{
title: "Screw the rail between the feet",
detail: "Its dowels go into the feet, then one Allen screw through each foot into the rail.",
- fix: [at("screw", [-1, 1].map((sx) => [sx * (footX + 15), 90, 0] as Vec3), [-1, 0, 0], "FT1", "RL", { len: 70, dia: 6 })],
+ fix: [-1, 1].map((sx, i) => at("screw", [[sx * (footX + 15), 90, 0]], [-sx, 0, 0], `FT${i}`, "RL", { len: 70, dia: 6 })),
tools: ["allen"],
warnings: ["floor"],
},
- { title: "Tap dowels into the tops of the feet", detail: "Three large dowels in each foot.", fix: [{ kind: "dowel", count: 6, len: 40, dia: 10, to: ["FT0", "FT1"] }], tools: ["hammer"] },
+ // the dowels sit between the screw holes along the top of each foot
+ { title: "Tap dowels into the tops of the feet", detail: "Three large dowels in each foot.", fix: [-1, 1].map((sx, i) => at("dowel", [-100, 60, 120].map((z) => [sx * footX, yB, z] as Vec3), [0, -1, 0], `FT${i}`, "BT", { len: 40, dia: 10 })), tools: ["hammer"] },
{
title: "Screw the bottom onto the feet",
detail: "Cam bolts facing up. Six Allen screws from above through the bottom into the feet.",
@@ -267,10 +269,11 @@ function wardrobe(s: ProductSpec): CustomParams {
{ title: "Lock the bottom with nine cam locks", detail: "Push them into the holes in the sides and divider, arrows to the edge, and turn clockwise.", fix: [{ kind: "cam", count: 9, to: ["BT"] }], tools: ["screwdriver"] },
{
title: "Slide the back panel in",
- detail: "Two dowels in its ends, then push it in between the side and the divider so the cam bolts go into its holes.",
+ detail: "Two dowels in the end by the divider. Angle it in past the side, then push it across so the dowels and the cam bolts go into the divider.",
add: ["BK"],
- fix: [{ kind: "dowel", count: 2, len: 30, dia: 8, to: ["BK"] }],
- from: { BK: [0, 0, -300] },
+ // dowels in the end that meets the divider: it slides along them onto the divider's cam bolts
+ fix: [at("dowel", [0.3, 0.7].map((f) => [-T / 2, Math.round(yIn0 + hIn * f), zBackPanel] as Vec3), [-1, 0, 0], "BK", "DV", { len: 30, dia: 8 })],
+ from: { BK: [-300, 0, 0] },
tools: ["hammer"],
},
{
@@ -307,34 +310,37 @@ function wardrobe(s: ProductSpec): CustomParams {
{
title: "Screw the top plates onto the doors",
detail: "Lay the three doors flat. Two plates on the top edge of each.",
- fix: [at("plate", tops, [0, -1, 0], undefined, undefined, { name: "Top guide plate", len: 6, dia: 40 }), at("screw", tops.map((p) => [p[0], p[1], p[2]] as Vec3), [0, -1, 0], undefined, undefined, { len: 12, dia: 4 })],
+ wait: doors.map((d) => d.id),
+ fix: doors.flatMap((d) => [at("plate", onDoor(tops, d), [0, -1, 0], d.id, undefined, { name: "Top guide plate", len: 6, dia: 40 }), at("screw", onDoor(tops, d).map((p) => [p[0] + 25, p[1], p[2]] as Vec3), [0, -1, 0], d.id, undefined, { len: 12, dia: 4 })]),
tools: ["screwdriver"],
},
{
title: "Screw the rollers under the doors",
detail: "Two rollers on the bottom edge of each door, two screws each.",
- fix: [at("roller", bottoms, [0, 1, 0], undefined, undefined, { name: "Bottom roller" }), at("screw", bottoms.flatMap((p) => [-12, 12].map((dx) => [p[0] + dx, p[1], p[2]] as Vec3)), [0, 1, 0], undefined, undefined, { len: 12, dia: 4 })],
+ fix: doors.flatMap((d) => [at("roller", onDoor(bottoms, d), [0, 1, 0], d.id, undefined, { name: "Bottom roller" }), at("screw", onDoor(bottoms, d).flatMap((p) => [-25, 25].map((dx) => [p[0] + dx, p[1], p[2]] as Vec3)), [0, 1, 0], d.id, undefined, { len: 12, dia: 4 })]),
tools: ["screwdriver"],
},
{
title: "Fit the top guides on the front doors",
detail: "A guide and a pad on each top plate of the two front doors, two pins each.",
- fix: [
- at("clip", tops.slice(0, 4), [0, -1, 0], undefined, undefined, { name: "Top guide", len: 20, dia: 30 }),
- at("spacer", tops.slice(0, 4), [0, -1, 0], undefined, undefined, { name: "Pad", len: 3, dia: 30 }),
- at("pin", tops.slice(0, 4).flatMap((p) => [-10, 10].map((dx) => [p[0] + dx, p[1], p[2]] as Vec3)), [0, -1, 0], undefined, undefined, { name: "Pin", len: 12, dia: 5 }),
- ],
+ fix: doors.slice(0, 2).flatMap((d) => [
+ at("clip", onDoor(tops, d), [0, -1, 0], d.id, undefined, { name: "Top guide", len: 20, dia: 30 }),
+ at("spacer", onDoor(tops, d), [0, -1, 0], d.id, undefined, { name: "Pad", len: 3, dia: 30 }),
+ at("pin", onDoor(tops, d).flatMap((p) => [-25, 25].map((dx) => [p[0] + dx, p[1], p[2]] as Vec3)), [0, -1, 0], d.id, undefined, { name: "Pin", len: 12, dia: 5 }),
+ ]),
},
- { title: "Tap dowels into the edge strips", detail: "Four small dowels in each of the three pine strips.", fix: doors.map((d) => at("dowel", stripPts(d), [d.edge, 0, 0], `E${d.id}`, d.id, { len: 25, dia: 6 })), tools: ["hammer"] },
+ { title: "Tap dowels into the edge strips", detail: "Four small dowels in each of the three pine strips.", wait: doors.map((d) => `E${d.id}`), fix: doors.map((d) => at("dowel", stripPts(d), [d.edge, 0, 0], `E${d.id}`, d.id, { len: 25, dia: 6 })), tools: ["hammer"] },
+ hangDoor(doors[2], true),
+ hangDoor(doors[0], false),
+ { ...hangDoor(doors[1], false), detail: "The same way, on the outermost track. Turn the roller screws if a door needs raising or lowering so the gaps are even." },
{
title: "Screw the edge strips onto the doors",
- detail: "Push each strip onto its door's edge, then four screws through the door into it.",
+ detail: "Push each strip onto its door's free edge, over the dowels, then four screws through the door into it.",
+ add: doors.map((d) => `E${d.id}`),
+ from: Object.fromEntries(doors.map((d) => [`E${d.id}`, [d.edge * 250, 0, 0] as Vec3])),
fix: doors.map((d) => at("screw", stripPts(d).map((p) => [p[0], p[1] + 40, p[2]] as Vec3), [d.edge, 0, 0], d.id, `E${d.id}`, { len: 30, dia: 4 })),
tools: ["screwdriver"],
},
- hangDoor(doors[2], true),
- hangDoor(doors[0], false),
- { ...hangDoor(doors[1], false), detail: "The same way, on the outermost track. Turn the roller screws if a door needs raising or lowering so the gaps are even." },
{
title: "Push in the shelf supports and lay in a shelf",
detail: "Six supports at the height you want, then lay the shelf on them.",
diff --git a/src/lib/plan/families/godishus.ts b/src/lib/plan/families/godishus.ts
index dbdf034..9cafcce 100644
--- a/src/lib/plan/families/godishus.ts
+++ b/src/lib/plan/families/godishus.ts
@@ -41,10 +41,11 @@ function chest(s: ProductSpec): CustomParams {
const yb = 30, hs = H - T; // bottom panel, sides under the top
const xi = X - T;
const parts: CustomPart[] = [
- box("SL", "Side", [-X, 0, -Z], [-xi, hs, Z]),
- box("SR", "Side", [xi, 0, -Z], [X, hs, Z]),
+ // the back is a full-width board on the sides' back edges, dowelled and screwed into them
+ box("SL", "Side", [-X, 0, -Z + T], [-xi, hs, Z]),
+ box("SR", "Side", [xi, 0, -Z + T], [X, hs, Z]),
box("BT", "Bottom", [-xi, yb, -Z + T], [xi, yb + T, Z]),
- box("BK", "Back panel", [-xi, yb, -Z], [xi, hs, -Z + T]),
+ box("BK", "Back panel", [-X, 0, -Z], [X, hs, -Z + T]),
box("TP", "Top", [-X, hs, -Z], [X, H, Z + 5]),
];
const y0 = yb + T, gap = (hs - y0) / 3;
@@ -73,7 +74,7 @@ function chest(s: ProductSpec): CustomParams {
add: ["SL", "SR"],
fix: [-1, 1].flatMap((sx) => [
at("runner", runnerPts(sx), [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { name: "Drawer runner", len: 340, dia: 20 }),
- at("screw", runnerPts(sx).flatMap((p) => [[p[0], p[1], -100], [p[0], p[1], 100]] as Vec3[]), [-sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 14, dia: 4 }),
+ at("screw", runnerPts(sx).flatMap((p) => [[p[0] - sx * 3, p[1], -100], [p[0] - sx * 3, p[1], 100]] as Vec3[]), [sx, 0, 0], sx < 0 ? "SL" : "SR", undefined, { len: 14, dia: 4 }),
]),
warnings: ["floor"],
tools: ["screwdriver"],
@@ -84,12 +85,12 @@ function chest(s: ProductSpec): CustomParams {
{ title: "Lock it with two cam locks", detail: "Arrow towards the cam bolt, then turn clockwise.", fix: [{ kind: "cam", count: 2, to: ["BT", "SL"] }], tools: ["screwdriver"] },
{ title: "Push the other side on", detail: "Onto the other end of the bottom, dowels and cam bolts into its holes." },
{ title: "Lock it with two cam locks", detail: "The same as the first side.", fix: [{ kind: "cam", count: 2, to: ["BT", "SR"] }], tools: ["screwdriver"] },
- { title: "Tap dowels into the back edges of the sides", detail: "Two in each side, for the back panel.", fix: [-1, 1].map((sx) => at("dowel", [yb + 120, hs - 120].map((y) => [sx * xi, y, -Z + T / 2] as Vec3), [sx, 0, 0], sx < 0 ? "SL" : "SR", "BK", { len: 30, dia: 8 })), tools: ["hammer"] },
+ { title: "Tap dowels into the back edges of the sides", detail: "Two in each side, for the back panel. Turn the frame so its back faces you.", fix: [-1, 1].map((sx) => at("dowel", [yb + 120, hs - 120].map((y) => [sx * (X - T / 2), y, -Z + T] as Vec3), [0, 0, 1], sx < 0 ? "SL" : "SR", "BK", { len: 30, dia: 8 })), tools: ["hammer"] },
{
- title: "Slide the back panel in and screw it",
- detail: "Label side in. Push it down between the sides at the back, then four Allen screws through the sides into it.",
+ title: "Put the back panel on and screw it",
+ detail: "Label side in. Push it onto the dowels in the sides' back edges, then four Allen screws through it into the sides.",
add: ["BK"],
- fix: [-1, 1].map((sx) => at("screw", [yb + 120, hs - 120].map((y) => [sx * X, y, -Z + T / 2] as Vec3), [-sx, 0, 0], sx < 0 ? "SL" : "SR", "BK", { len: 50, dia: 6 })),
+ fix: [-1, 1].map((sx) => at("screw", [yb + 70, hs - 70].map((y) => [sx * (X - T / 2), y, -Z] as Vec3), [0, 0, 1], "BK", sx < 0 ? "SL" : "SR", { len: 50, dia: 6 })),
from: { BK: [0, 0, -300] },
tools: ["allen"],
},
@@ -136,7 +137,7 @@ function chest(s: ProductSpec): CustomParams {
{
title: "Screw a knob onto each drawer",
detail: "One screw from inside the front. Stick on the labels from the sheet if you like.",
- fix: [at("knob", drawers.map((d) => [0, d.ym, Z] as Vec3), [0, 0, -1], undefined, undefined, { len: 30, dia: 50 }), at("screw", drawers.map((d) => [0, d.ym, d.zf] as Vec3), [0, 0, 1], undefined, undefined, { len: 30, dia: 4 })],
+ fix: [at("knob", drawers.map((d) => [0, d.ym, Z] as Vec3), [0, 0, -1], undefined, undefined, { len: 30, dia: 50 }), at("screw", drawers.map((d) => [0, d.ym, d.zf - 5] as Vec3), [0, 0, 1], undefined, undefined, { len: 30, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Slide the drawers in", detail: "Lift each drawer onto its runners and push it all the way in.", kind: "drawer" },
@@ -187,7 +188,7 @@ function wardrobe(s: ProductSpec): CustomParams {
{
title: "Screw the bottom to the side",
detail: "Dowels into the holes, then two Allen screws through the side into the bottom.",
- fix: [at("screw", [zk + 60, Z - 60].map((z) => [-X, yb + T / 2, z] as Vec3), [1, 0, 0], "SL", "BT", { len: 50, dia: 6 })],
+ fix: [at("screw", [zk + 30, Z - 30].map((z) => [-X, yb + T / 2, z] as Vec3), [1, 0, 0], "SL", "BT", { len: 50, dia: 6 })],
tools: ["allen"],
},
{
@@ -197,9 +198,9 @@ function wardrobe(s: ProductSpec): CustomParams {
fix: [-1, 1].map((sx) => at("dowel", [zk + 60, Z - 60].map((z) => [sx * xi, H - T / 2, z] as Vec3), [-sx, 0, 0], "TP", sx < 0 ? "SL" : "SR", { len: 30, dia: 8 })),
tools: ["hammer"],
},
- { title: "Screw the top to the side", detail: "Two more Allen screws through the side.", fix: [at("screw", [zk + 60, Z - 60].map((z) => [-X, H - T / 2, z] as Vec3), [1, 0, 0], "SL", "TP", { len: 50, dia: 6 })], tools: ["allen"] },
+ { title: "Screw the top to the side", detail: "Two more Allen screws through the side.", fix: [at("screw", [zk + 30, Z - 30].map((z) => [-X, H - T / 2, z] as Vec3), [1, 0, 0], "SL", "TP", { len: 50, dia: 6 })], tools: ["allen"] },
{ title: "Lay the other side on", detail: "Turn the frame so it lies on its back, and push the second side onto the dowels.", add: ["SR"] },
- { title: "Screw the second side on", detail: "Four Allen screws, two into the top and two into the bottom.", fix: [at("screw", [yb + T / 2, H - T / 2].flatMap((y) => [zk + 60, Z - 60].map((z) => [X, y, z] as Vec3)), [-1, 0, 0], "SR", undefined, { len: 50, dia: 6 })], tools: ["allen"] },
+ { title: "Screw the second side on", detail: "Four Allen screws, two into the top and two into the bottom.", fix: [at("screw", [yb + T / 2, H - T / 2].flatMap((y) => [zk + 30, Z - 30].map((z) => [X, y, z] as Vec3)), [-1, 0, 0], "SR", undefined, { len: 50, dia: 6 })], tools: ["allen"] },
{
title: "Tap in the plinth clips and click the plinth on",
detail: "Four clips into the holes at the front of the sides, low down, then press the plinth onto them.",
diff --git a/src/lib/plan/families/gonatt.ts b/src/lib/plan/families/gonatt.ts
index 3a17f13..454bb4d 100644
--- a/src/lib/plan/families/gonatt.ts
+++ b/src/lib/plan/families/gonatt.ts
@@ -108,11 +108,11 @@ function cot(s: ProductSpec): CustomParams {
{
title: "Tap the dowels into the slatted base",
detail: "Lay both slat sections and the three bars on a rug. Use the longer dowels here.",
- add: ["B"],
- fix: [-1, 1].map((g) => fix("dowel", [-zi + 20, zi - 20].flatMap((z): Vec3[] => [[g * (xi - 5), BY - 28, z - 8], [g * (xi - 5), BY - 28, z + 8]]), [g, 0, 0], { on: "B" })),
+ // the base waits on the rug until it is dropped into the end panel
+ wait: ["B"],
+ fix: [-1, 1].map((g) => fix("dowel", [-zi + 20, zi - 20].flatMap((z): Vec3[] => [[g * (xi - 5), BY - 28, z - 8], [g * (xi - 5), BY - 28, z + 8]]), [-g, 0, 0], { on: "B" })),
tools: ["hammer"],
warnings: ["floor"],
- from: { B: [0, -300, 0] },
},
{
title: "Bolt the sides and front rail to one end",
@@ -136,6 +136,8 @@ function cot(s: ProductSpec): CustomParams {
title: "Stand it on its end and drop the base in",
detail: "Rest the end panel on the rug. The supports go into the upper holes for a newborn, the lower ones once your baby can sit up.",
pose: "+x",
+ add: ["B"],
+ from: { B: [400, 0, 0] },
people: 2,
warnings: ["two", "floor"],
},
@@ -157,8 +159,9 @@ function cot(s: ProductSpec): CustomParams {
title: "Screw in the drawer stops",
detail: "One on the inside of each end panel, low down at the front.",
fix: [
- ...[-1, 1].map((g) => fix("clip", [DY0 + 60, DY1 - 60].map((y): Vec3 => [g * xi, y, Z - 60]), [-g, 0, 0], { name: "Drawer stop", len: 20, dia: 20, on: g < 0 ? "E0" : "E1" })),
- ...[-1, 1].map((g) => fix("screw", [DY0 + 60, DY1 - 60].map((y): Vec3 => [g * xi, y, Z - 60]), [-g, 0, 0], { len: 16, dia: 4, on: g < 0 ? "E0" : "E1" })),
+ ...[-1, 1].map((g) => fix("clip", [DY0 + 60, DY1 - 60].map((y): Vec3 => [g * xi, y, Z - 50]), [-g, 0, 0], { name: "Drawer stop", len: 20, dia: 20, on: g < 0 ? "E0" : "E1" })),
+ // through the stop's back end into the end panel
+ ...[-1, 1].map((g) => fix("screw", [DY0 + 60, DY1 - 60].map((y): Vec3 => [g * xi, y, Z - 74]), [g, 0, 0], { len: 16, dia: 4, on: g < 0 ? "E0" : "E1" })),
],
tools: ["screwdriver"],
},
@@ -216,7 +219,7 @@ function cot(s: ProductSpec): CustomParams {
{
title: "Screw on the knobs and push the drawer in",
detail: "A screw through the front into each of the three knobs. The drawer stops keep it from coming all the way out.",
- fix: [fix("knob", knobX.map((x): Vec3 => [x, (DY0 + DY1) / 2, Z]), [0, 0, -1], { len: 30, dia: 50, on: "DF" }), fix("screw", knobX.map((x): Vec3 => [x, (DY0 + DY1) / 2, dz1]), [0, 0, 1], { len: 30, dia: 4 })],
+ fix: [fix("knob", knobX.map((x): Vec3 => [x, (DY0 + DY1) / 2, Z]), [0, 0, -1], { len: 30, dia: 50, on: "DF" }), fix("screw", knobX.map((x): Vec3 => [x, (DY0 + DY1) / 2, Z - 23]), [0, 0, 1], { len: 30, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Lay the mattress in", detail: "It should fit snugly, with no gap wider than two fingers at the sides.", add: ["M"] },
diff --git a/src/lib/plan/families/grafjallet.ts b/src/lib/plan/families/grafjallet.ts
index 9f900a9..f48d1e0 100644
--- a/src/lib/plan/families/grafjallet.ts
+++ b/src/lib/plan/families/grafjallet.ts
@@ -177,7 +177,7 @@ function clothesRack(s: ProductSpec): CustomParams {
title: "Screw the wall bracket under the shoe shelf",
detail: "Two screws through its slots, at the back. Slide it out until its end touches the wall.",
add: ["WB"],
- fix: [{ kind: "screw", count: 2, len: 10, dia: 6, at: [[0, yShoe - 12, -zs], [0, yShoe - 12, -zs + 50]], dir: [0, 1, 0], on: "WB" }],
+ fix: [{ kind: "screw", count: 2, len: 10, dia: 6, at: [-1, 1].map((sx): Vec3 => [sx * 12, yShoe - 12, -zs]), dir: [0, 1, 0], on: "WB" }],
tools: ["allen"],
from: { WB: [0, -200, 0] },
},
@@ -215,27 +215,29 @@ function dressingTable(s: ProductSpec): CustomParams {
...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [12, bh - 24, D - 40], pos: [sx * (W / 2 - 26), yB + (bh - 24) / 2, 0] })),
...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [(W - 40 - dw) / 2, bh - 24, 12], pos: [sx * (dw / 2 + (W - 40 - dw) / 4), yB + (bh - 24) / 2, D / 2 - 26] })),
{ shape: "box", size: [W - 40, 4, D - 40], pos: [0, yB + 2, 0] },
+ // the corner sockets the legs push into, screwed through from outside
+ ...[-1, 1].flatMap((sx) => [-1, 1].map((sz): PartPiece => ({ shape: "box", size: [34, 40, 6], pos: [sx * xl, yB + 20, sz * (zl + LT / 2 + 3)] }))),
]),
);
// the sockets stand up out of the top at the back
parts.push(welded("SK", "Mirror sockets", [-xa - 13, yT, za - 13], [xa + 13, yT + 30, za + 13], [-1, 1].map((sx) => tubeY(sx * xa, za, yT, yT + 30, 26))));
parts.push({ id: "DR", name: "Drawer", size: [dw, dh, 18], pos: [0, yB + 12 + dh / 2, D / 2 - 26], material: "metal" });
// the curved foot rail: along both sides and round the back
- const yr = 200, rc = 80;
+ const yr = 200, rc = 40, xr = xl - LT / 2 - 8;
const rail: PartPiece[] = [
- tubeZ(-xl, yr, -zl + rc, zl, 16),
- tubeZ(xl, yr, -zl + rc, zl, 16),
- tubeX(-xl + rc, xl - rc, yr, -zl, 16),
+ tubeZ(-xr, yr, -zl, zl + 8, 16),
+ tubeZ(xr, yr, -zl, zl + 8, 16),
+ tubeX(-xr + rc, xr - rc, yr, -zl - rc, 16),
];
// the rounded back corners, drawn flat in the x-z plane at the rail's height
for (const sx of [-1, 1]) {
- const pts = arc(sx * (xl - rc), -zl + rc, rc, sx < 0 ? Math.PI : 0, sx < 0 ? 1.5 * Math.PI : -0.5 * Math.PI, 4);
+ const pts = arc(sx * (xr - rc), -zl, rc, sx < 0 ? Math.PI : 0, sx < 0 ? 1.5 * Math.PI : -0.5 * Math.PI, 4);
for (let i = 1; i < pts.length; i++) {
const [x0, z0] = pts[i - 1], [x1, z1] = pts[i];
rail.push({ shape: "box", size: [Math.hypot(x1 - x0, z1 - z0) + 2, 16, 16], pos: [(x0 + x1) / 2, yr, (z0 + z1) / 2], rot: [0, -Math.atan2(z1 - z0, x1 - x0), 0] });
}
}
- parts.push(welded("FR", "Foot rail", [-xl - 8, yr - 8, -zl - 8], [xl + 8, yr + 8, zl], rail));
+ parts.push(welded("FR", "Foot rail", [-xr - 8, yr - 8, -zl - rc - 8], [xr + 8, yr + 8, zl + 8], rail));
// the mirror: an oval on a bar, between two arch halves
const yM = H - 225, mw = 330, mh = 450, zm = za + 22;
const strips = 17;
@@ -252,7 +254,7 @@ function dressingTable(s: ProductSpec): CustomParams {
parts.push({ id: "BAR", name: "Mirror bar", size: [mw - 40, 16, 16], pos: [0, yM, za], material: "metal" });
const legScrews = (sz: number): CustomFix[] =>
- [-1, 1].map((sx) => ({ kind: "screw", count: 2, len: 12, dia: 6, at: [-1, 1].map((d): Vec3 => [sx * xl + d * 20, yB + 20, sz * (zl + LT / 2)]), dir: [0, 0, -sz] as Vec3, on: `L${sx}${sz}` }));
+ [-1, 1].map((sx) => ({ kind: "screw", count: 2, len: 12, dia: 6, at: [yB + 7, yB + 33].map((y): Vec3 => [sx * xl, y, sz * (zl + LT / 2 + 6)]), dir: [0, 0, -sz] as Vec3, on: `L${sx}${sz}` }));
const steps: CustomStep[] = [
{
title: "Screw a foot into each leg",
@@ -275,7 +277,7 @@ function dressingTable(s: ProductSpec): CustomParams {
title: "Bolt the foot rail between the legs",
detail: "Its curve goes round the back. One bolt through each leg into the rail.",
add: ["FR"],
- fix: [-1, 1].flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "bolt", count: 1, len: 30, dia: 6, at: [[sx * (xl + LT / 2), yr, sz > 0 ? zl - 20 : -zl + 20]], dir: [-sx, 0, 0], on: `L${sx}${sz}`, mate: "FR" }))),
+ fix: [-1, 1].flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "bolt", count: 1, len: 30, dia: 6, at: [[sx * (xl + LT / 2), yr, sz * zl]], dir: [-sx, 0, 0], on: `L${sx}${sz}`, mate: "FR" }))),
tools: ["allen"],
from: { FR: [0, -300, 0] },
},
@@ -518,8 +520,9 @@ function wallTable(s: ProductSpec): CustomParams {
detail: "Lay the flap face down. A screw through each rubber ring, near the top corners.",
add: ["FL"],
fix: [
- { kind: "washer", name: "Rubber buffer", count: 2, len: 6, dia: 16, at: [-1, 1].map((sx): Vec3 => [sx * (iw / 2 - 20), yU - 30, zf]), dir: [0, 0, 1], on: "FL" },
+ // the screw first, so the buffer stacks on it rather than pushing it off the flap
{ kind: "screw", count: 2, len: 16, dia: 4, at: [-1, 1].map((sx): Vec3 => [sx * (iw / 2 - 20), yU - 30, zf]), dir: [0, 0, 1], on: "FL" },
+ { kind: "washer", name: "Rubber buffer", count: 2, len: 6, dia: 16, at: [-1, 1].map((sx): Vec3 => [sx * (iw / 2 - 20), yU - 30, zf]), dir: [0, 0, 1], on: "FL" },
],
tools: ["screwdriver"],
from: { FL: [0, 0, 300] },
diff --git a/src/lib/plan/families/greaker.ts b/src/lib/plan/families/greaker.ts
index 167e7ec..71bd736 100644
--- a/src/lib/plan/families/greaker.ts
+++ b/src/lib/plan/families/greaker.ts
@@ -110,10 +110,10 @@ function cabinet(s: ProductSpec): CustomParams {
const yH = [yS0 + 160, yS1 - 160];
const hinges = SX.map((sx, i) => fx({ kind: "hinge", at: yH.map((y): Vec3 => [sx * xO, y, zHinge + 15]), dir: [sx, 0, 0], on: `D${i}` }));
const hingeDoorScrews = SX.map((sx, i) => fx({ kind: "screw", len: 16, dia: 4, at: yH.flatMap((y) => [-35, 0, 35].map((dy): Vec3 => [sx * xO, y + dy, zHinge + 25])), dir: [sx, 0, 0], on: `D${i}` }));
- const hingeSideScrews = SX.map((sx, i) => fx({ kind: "screw", len: 16, dia: 4, at: yH.flatMap((y) => [-35, 0, 35].map((dy): Vec3 => [sx * xS, y + dy, zF])), dir: [0, 0, -1], on: side(sx), mate: `D${i}` }));
+ const hingeSideScrews = SX.map((sx, i) => fx({ kind: "screw", len: 16, dia: 4, at: yH.flatMap((y) => [-50, -25, 50].map((dy): Vec3 => [sx * xS, y + dy, zF])), dir: [0, 0, -1], on: side(sx), mate: `D${i}` }));
const zFree = zHinge + dW - 40;
- const plates = SX.map((sx, i) => fx({ kind: "plate", name: "Strike plate", len: 2, dia: 30, at: [[sx * (xO + DT / 2), yDoor + dH / 2, zFree]], dir: [0, -1, 0], on: `D${i}` }));
- const plateScrews = SX.map((sx, i) => fx({ kind: "screw", len: 10, dia: 3, at: [[sx * (xO + DT / 2), yDoor + dH / 2, zFree]], dir: [0, -1, 0], on: `D${i}` }));
+ const plates = SX.map((sx, i) => fx({ kind: "plate", name: "Strike plate", len: 2, dia: 40, at: [[sx * (xO + DT / 2), yDoor + dH / 2, zFree - 11]], dir: [0, -1, 0], on: `D${i}` }));
+ const plateScrews = SX.map((sx, i) => fx({ kind: "screw", len: 10, dia: 3, at: [[sx * (xO + DT / 2), yDoor + dH / 2, zFree + 12]], dir: [0, -1, 0], on: `D${i}` }));
const yHandle = yS0 + dH * 0.6;
const handles = SX.map((sx, i) => fx({ kind: "handle", len: 128, dia: 12, at: [[sx * (xO + DT), yHandle, zFree]], dir: [-sx, 0, 0], on: `D${i}`, twist: Math.PI / 2 }));
const handleScrews = SX.map((sx, i) => fx({ kind: "screw", len: 40, dia: 4, at: [-64, 64].map((dy): Vec3 => [sx * xO, yHandle + dy, zFree]), dir: [sx, 0, 0], on: `D${i}` }));
@@ -225,16 +225,9 @@ function cabinet(s: ProductSpec): CustomParams {
fix: SX.map((sx, i) => fx({ kind: "glide", name: "Bumper", len: 3, dia: 12, at: [[sx * xO, yS0 + 60, zFree]], dir: [sx, 0, 0], on: `D${i}` })),
},
];
- // the other two drawers: every fitting counted, merged into as few groups as the builder takes
+ // the other two drawers: every fitting counted, each kept on its own drawer's parts (24 groups, as many as a step takes)
const more = [1, 2].map(drawerFix).flatMap((r) => [r.bolts, ...r.dowels, ...r.cams, r.pushBolts, ...r.backCams, ...r.runners, ...r.runScrews]);
- const merged = new Map<string, CustomFix>();
- for (const f of more) {
- const key = `${f.kind}|${f.name ?? ""}|${f.dir?.join(",")}`;
- const m = merged.get(key);
- if (m) merged.set(key, { ...m, at: [...m.at!, ...f.at!], count: m.count + f.count, on: undefined, mate: undefined });
- else merged.set(key, { ...f, on: undefined, mate: undefined });
- }
- steps.find((st) => st.title === "Build the other two drawers")!.fix = [...merged.values()];
+ steps.find((st) => st.title === "Build the other two drawers")!.fix = more;
return { parts, steps };
}
diff --git a/src/lib/plan/families/grillskar.ts b/src/lib/plan/families/grillskar.ts
index 3370d0e..c5edba5 100644
--- a/src/lib/plan/families/grillskar.ts
+++ b/src/lib/plan/families/grillskar.ts
@@ -14,6 +14,7 @@ const LONG = { kind: "bolt" as const, len: 20, dia: 6, name: "Long Allen bolt" }
const LT = 3; // leg wall
const LS = 40; // leg flange
const FOOT = 25;
+const G2 = [-1, 1] as const;
function unit(s: ProductSpec, backPanel: boolean): CustomParams {
const W = s.size.w * 10, D = 610, H = 920;
@@ -62,7 +63,12 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
const legAt = (p: Vec3) => `L${p[2] < 0 ? "B" : "F"}${p[0] < 0 ? "L" : "R"}`;
const inX = (p: Vec3): Vec3 => [p[0] < 0 ? 1 : -1, 0, 0];
const inZ = (p: Vec3): Vec3 => [0, 0, p[2] < 0 ? 1 : -1];
- const merge = (list: CustomFix[]): CustomFix => ({ ...list[0], count: list.length, at: list.flatMap((f) => f.at!), on: undefined, mate: undefined });
+ // one fix per direction, so each bolt keeps pointing in through its own leg
+ const merge = (list: CustomFix[]): CustomFix[] => {
+ const by = new Map<string, CustomFix[]>();
+ for (const f of list) by.set(String(f.dir), [...(by.get(String(f.dir)) ?? []), f]);
+ return [...by.values()].map((g) => ({ ...g[0], count: g.length, at: g.flatMap((f) => f.at!), on: undefined, mate: undefined }));
+ };
const steps: CustomStep[] = [
{
@@ -77,7 +83,7 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
title: "Bolt the back legs to the worktop",
detail: "The unit is built lying on its back. One of you holds the worktop on its back edge while the other slides the two back legs onto it.",
add: ["T"],
- fix: [merge(bolts([side(-1, -1, yT), side(1, -1, yT)], inX, "T"))],
+ fix: [...merge(bolts([side(-1, -1, yT), side(1, -1, yT)], inX, "T"))],
tools: ["allen"],
people: 2,
pose: "+z",
@@ -87,7 +93,7 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
title: "Bolt the bottom shelf to the back legs",
detail: "Lower it onto the legs next to the feet, top side towards the worktop.",
add: ["B"],
- fix: [merge(bolts([side(-1, -1, yB), side(1, -1, yB)], inX, "B"))],
+ fix: [...merge(bolts([side(-1, -1, yB), side(1, -1, yB)], inX, "B"))],
tools: ["allen"],
pose: "+z",
},
@@ -95,8 +101,8 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
title: "Lay the front legs on and bolt them",
detail: "Feet at the bottom shelf end. Two bolts at each corner: one through the front, one through the side.",
fix: [
- merge(bolts([face(-1, 1, yT), face(1, 1, yT), face(-1, 1, yB), face(1, 1, yB)], inZ, "T")),
- merge(bolts([side(-1, 1, yT), side(1, 1, yT), side(-1, 1, yB), side(1, 1, yB)], inX, "T")),
+ ...merge(bolts([face(-1, 1, yT), face(1, 1, yT), face(-1, 1, yB), face(1, 1, yB)], inZ, "T")),
+ ...merge(bolts([side(-1, 1, yT), side(1, 1, yT), side(-1, 1, yB), side(1, 1, yB)], inX, "T")),
],
tools: ["allen"],
pose: "+z",
@@ -104,7 +110,7 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
{
title: "Stand it up and bolt the back",
detail: "Turn it onto its feet, then put the last bolts through the back of the back legs.",
- fix: [merge(bolts([face(-1, -1, yT), face(1, -1, yT), face(-1, -1, yB), face(1, -1, yB)], inZ, "T"))],
+ fix: [...merge(bolts([face(-1, -1, yT), face(1, -1, yT), face(-1, -1, yB), face(1, -1, yB)], inZ, "T"))],
tools: ["allen"],
pose: "+y",
},
@@ -122,8 +128,9 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
at: legs.map(([, sx, sz]) => [sx * (X - LT - 10), railY, sz * (Z - LS)] as Vec3),
dir: [0, -1, 0],
},
- { ...BOLT, count: 4, at: legs.map(([, sx, sz]) => [sx * (X - LT), railY, sz * (Z - LS / 2)] as Vec3), dir: [1, 0, 0] },
- { ...BOLT, count: 4, at: legs.map(([, sx, sz]) => [sx * (X - LS / 2), railY, sz * (Z - LT)] as Vec3), dir: [0, 0, 1] },
+ // from outside, through each flange of the leg into the bracket
+ ...G2.map((sx): CustomFix => ({ ...BOLT, count: 2, at: [-1, 1].map((sz) => [sx * X, railY, sz * (Z - LS / 2)] as Vec3), dir: [-sx, 0, 0] })),
+ ...G2.map((sz): CustomFix => ({ ...BOLT, count: 2, at: [-1, 1].map((sx) => [sx * (X - LS / 2), railY, sz * Z] as Vec3), dir: [0, 0, -sz] })),
],
tools: ["allen"],
check: "square",
@@ -161,14 +168,16 @@ function unit(s: ProductSpec, backPanel: boolean): CustomParams {
title: "Bolt a bracket to each back leg",
detail: "Take out the bolt at the top of the leg first; the long bolt goes back in its place, through the bracket.",
add: ["PB", "PB2"],
- fix: [{ ...LONG, count: 4, at: [-1, 1].flatMap((sx) => [yT, yT - 40].map((y) => [sx * (X - LS / 2), y, -Z - 5] as Vec3)), dir: [0, 0, 1] }],
+ from: { PB: [0, 0, -200], PB2: [0, 0, -200] },
+ // through the bracket and the leg into the worktop's back edge
+ fix: G2.map((sx): CustomFix => ({ ...LONG, count: 2, at: [-12, 12].map((dx) => [sx * (X - LS / 2) + dx, yT + 20, -Z - 5] as Vec3), dir: [0, 0, 1], on: sx < 0 ? "PB" : "PB2", mate: "T" })),
tools: ["allen"],
repeat: 2,
},
{
title: "Drop the back panel into the brackets",
detail: "One of you holds it level while the other lowers the tubes into both brackets, then bolt it twice on each side.",
- fix: [{ ...BOLT, count: 4, at: [-1, 1].flatMap((sx) => [880, 950].map((y) => [sx * (X - 10), y, -Z - 5] as Vec3)), dir: [0, 0, -1] }],
+ fix: [{ ...BOLT, count: 4, at: [-1, 1].flatMap((sx) => [940, 975].map((y) => [sx * (X - 10), y, -Z - 5] as Vec3)), dir: [0, 0, -1] }],
tools: ["allen"],
people: 2,
warnings: ["two"],
diff --git a/src/lib/plan/families/gullaberg.ts b/src/lib/plan/families/gullaberg.ts
index e3ac34a..c8f9feb 100644
--- a/src/lib/plan/families/gullaberg.ts
+++ b/src/lib/plan/families/gullaberg.ts
@@ -126,15 +126,19 @@ function buildBed(b: PlanBuilder, s: ProductSpec) {
// braces under the ledges: one corner to corner on the single, a diamond off the beam brackets on the double
const yb = LY - 17;
const zEnd = L / 2 - P - 40, xL = xi - 15;
- const braceT = (len: number) => b.part("Cross brace", [20, 3, len], { material: "metal" });
- const segs: { a: [number, number]; c: [number, number]; key: string }[] = [];
+ // each brace telescopes: two halves overlapping in the middle, the one from c just under the one from a
+ const braceT = (len: number) => b.part("Cross brace", [20, 3, Math.round(len / 2 + 100)], { material: "metal" });
+ const segs: { a: [number, number]; c: [number, number]; key: string; key2: string }[] = [];
const segOf = (a: [number, number], c: [number, number], t: string) => {
- const dx = c[0] - a[0], dz = c[1] - a[1];
- segs.push({ a, c, key: b.place(t, [(a[0] + c[0]) / 2, yb, (a[1] + c[1]) / 2], [0, Math.atan2(dx, dz), 0]) });
+ const dx = c[0] - a[0], dz = c[1] - a[1], len = Math.hypot(dx, dz), h = len / 2 + 100;
+ const ux = dx / len, uz = dz / len, r: Vec3 = [0, Math.atan2(dx, dz), 0];
+ const key = b.place(t, [a[0] + (ux * h) / 2, yb, a[1] + (uz * h) / 2], r);
+ const key2 = b.place(t, [c[0] - (ux * h) / 2, yb - 3, c[1] - (uz * h) / 2], r);
+ segs.push({ a, c, key, key2 });
};
if (wide) {
const len = Math.hypot(xL, zEnd);
- const t = braceT(Math.round(len));
+ const t = braceT(len);
for (const [a, c] of [
[[0, -zEnd], [-xL, 0]],
[[-xL, 0], [0, zEnd]],
@@ -143,7 +147,7 @@ function buildBed(b: PlanBuilder, s: ProductSpec) {
] as [[number, number], [number, number]][])
segOf(a, c, t);
} else {
- const t = braceT(Math.round(Math.hypot(2 * xL, 2 * zEnd)));
+ const t = braceT(Math.hypot(2 * xL, 2 * zEnd));
segOf([-xL, -zEnd], [xL, zEnd], t);
}
@@ -230,8 +234,9 @@ function buildBed(b: PlanBuilder, s: ProductSpec) {
];
step(b, { title: "Screw the cam bolts into the posts", detail: "Four in each post: two facing the end board, two facing the side rail. Turn them in by hand until the collar touches.", scene: "ends", pose: "+z", kind: "cams" }, () => {
b.stagger(0.15);
- for (const i of [0, 1]) lay(b, [hp[i]], cH, [sg(i) * 250, 0, 0]);
- for (const i of [0, 1]) lay(b, [fp[i]], cF, [-sg(i) * 250 + footAt[0], footAt[1], 0], FLIP);
+ // they appear where they lie (dropping them in would cross the dowels already in the boards)
+ for (const i of [0, 1]) lay(b, [hp[i]], cH, [sg(i) * 250, 0, 0], [0, 0, 0], [0, 0, 0]);
+ for (const i of [0, 1]) lay(b, [fp[i]], cF, [-sg(i) * 250 + footAt[0], footAt[1], 0], FLIP, [0, 0, 0]);
b.then(0.15);
b.fits(POST_BOLT, [0, 1].flatMap((i) => [...postBolts(hp[i], sg(i), zH, 1, hr, sides[i]), ...postBolts(fp[i], sg(i), zF, -1, fb, sides[i])]), 0.05);
});
@@ -261,7 +266,7 @@ function buildBed(b: PlanBuilder, s: ProductSpec) {
const railC = (i: number): Vec3 => [sg(i) * xr, (RB + RT) / 2, 0];
step(b, { title: "Tap the dowels into the side rails", detail: "Lay both rails flat, inside face up. Two thick dowels in each end.", tools: ["hammer"], scene: "rails", kind: "dowels", warnings: ["floor"] }, () => {
b.stagger(0.2);
- for (const i of [0, 1]) lay(b, [sides[i]], railC(i), [sg(i) * 160, T / 2, 0], railRot(i));
+ for (const i of [0, 1]) lay(b, [sides[i]], railC(i), [sg(i) * 160, T / 2, 0], railRot(i), [0, 0, 0]);
b.then(0.15);
b.fits(RAIL_DOWEL, [0, 1].flatMap((i) => [-1, 1].flatMap((g) => pts(sides[i], dowelY.map((y): Vec3 => [sg(i) * xr, y, g * (L / 2 - P)]), [0, 0, -g], g < 0 ? hp[i] : fp[i]))), 0.05);
});
@@ -292,33 +297,33 @@ function buildBed(b: PlanBuilder, s: ProductSpec) {
step(b, { title: "Drop the centre beam into the brackets", detail: "Holes facing up.", kind: "join" }, () => b.add(beam, [0, 300, 0]));
step(b, { title: "Screw on the cross braces", detail: "Pull each one out to length. They run from the beam brackets to the middle of the ledges in a diamond: one screw at each bracket, two where they meet a ledge.", tools: ["screwdriver"], kind: "screws" }, () => {
b.stagger(0.2);
- for (const sgm of segs) b.add(sgm.key, [0, -160, 0]);
+ for (const sgm of segs) for (const k of [sgm.key, sgm.key2]) b.add(k, [0, -160, 0]);
b.then(0.15);
const list: FitOpts[] = [];
for (const sgm of segs) {
const [a, c] = braceEnds(sgm);
const atBracket = a[0] === 0 ? a : c, atLedge = a[0] === 0 ? c : a;
- list.push({ on: sgm.key, at: [atBracket[0], yb, atBracket[1] + (atBracket[1] < 0 ? 20 : -20)], dir: [0, 1, 0] });
+ list.push({ on: atBracket === a ? sgm.key : sgm.key2, at: [atBracket[0], yb, atBracket[1] + (atBracket[1] < 0 ? 20 : -20)], dir: [0, 1, 0] });
list.push({ on: ledges[atLedge[0] < 0 ? 0 : 1], at: [atLedge[0], yb + 2, atLedge[1] + (a[0] === 0 ? -14 : 14)], dir: [0, 1, 0] });
}
b.fits(BRACE_SCREW, list, 0.08);
});
step(b, { title: "Square the frame and lock the braces", detail: "Measure both diagonals. When they match, put one screw in the slot of each brace.", tools: ["screwdriver", "tape"], kind: "square", check: "square", warnings: ["square"] }, () =>
- b.fits(BRACE_SCREW, segs.map((sgm) => ({ on: sgm.key, at: [(sgm.a[0] + sgm.c[0]) / 2, yb + 2, (sgm.a[1] + sgm.c[1]) / 2] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })), 0.1),
+ b.fits(BRACE_SCREW, segs.map((sgm) => ({ on: sgm.key2, at: [(sgm.a[0] + sgm.c[0]) / 2, yb - 4.5, (sgm.a[1] + sgm.c[1]) / 2] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })), 0.1),
);
} else {
const sgm = segs[0];
step(b, { title: "Screw on the cross brace", detail: "Pull it out to length and run it corner to corner under the ledges. A screw at each end and one where the halves overlap.", tools: ["screwdriver"], kind: "screws" }, () => {
- b.add(sgm.key, [0, -160, 0]);
+ for (const k of [sgm.key, sgm.key2]) b.add(k, [0, -160, 0]);
b.then(0.15);
b.fits(BRACE_SCREW, [
{ on: ledges[0], at: [sgm.a[0], yb + 2, sgm.a[1]], dir: [0, 1, 0] },
- { on: sgm.key, at: [-40 * Math.sin(Math.atan2(2 * xL, 2 * zEnd)), yb + 2, -40 * Math.cos(Math.atan2(2 * xL, 2 * zEnd))], dir: [0, 1, 0], hole: false },
+ { on: sgm.key2, at: [-40 * Math.sin(Math.atan2(2 * xL, 2 * zEnd)), yb - 4.5, -40 * Math.cos(Math.atan2(2 * xL, 2 * zEnd))], dir: [0, 1, 0], hole: false },
{ on: ledges[1], at: [sgm.c[0], yb + 2, sgm.c[1]], dir: [0, 1, 0] },
], 0.12);
});
step(b, { title: "Square the frame and lock the brace", detail: "Measure both diagonals. When they match, put two screws in the slot.", tools: ["screwdriver", "tape"], kind: "square", check: "square", warnings: ["square"] }, () =>
- b.fits(BRACE_SCREW, [30, 70].map((d) => ({ on: sgm.key, at: [d * Math.sin(Math.atan2(2 * xL, 2 * zEnd)), yb + 2, d * Math.cos(Math.atan2(2 * xL, 2 * zEnd))] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })), 0.12),
+ b.fits(BRACE_SCREW, [30, 70].map((d) => ({ on: sgm.key2, at: [d * Math.sin(Math.atan2(2 * xL, 2 * zEnd)), yb - 4.5, d * Math.cos(Math.atan2(2 * xL, 2 * zEnd))] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })), 0.12),
);
}
const clipPts: FitOpts[] = [-1, 1].flatMap((g) => [0, 1].map((i): FitOpts => ({ on: ledges[i], at: [sg(i) * (xi - 15), top, g * (L / 2 - P - 30)], dir: [0, -1, 0], hole: false })));
@@ -588,7 +593,8 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cfg: ChestCfg) {
{ shape: "box", size: [16, yTU - legH, zIn1 - zIn0], pos: [xc, (legH + yTU) / 2, (zIn0 + zIn1) / 2], material: "board" },
{ shape: "box", size: [14.5, 60, zIn1 - zIn0], pos: [xb, yTU - 30, (zIn0 + zIn1) / 2], material: "wood" },
{ shape: "box", size: [14.5, 60, zIn1 - zIn0], pos: [xb, legH + 30, (zIn0 + zIn1) / 2], material: "wood" },
- ...rows.filter((r, i) => i > 0).map((r): PartPiece => ({ shape: "box", size: [14.5, 36, zIn1 - zIn0], pos: [xb, runY(r) + 4, (zIn0 + zIn1) / 2], material: "wood" })),
+ // a batten behind every runner (the top row's sits under the top one)
+ ...rows.map((r): PartPiece => ({ shape: "box", size: [14.5, 36, zIn1 - zIn0], pos: [xb, runY(r) + 4, (zIn0 + zIn1) / 2], material: "wood" })),
];
const { type, mid } = b.compound("Side frame", pieces, { material: "wood" });
return b.place(type, mid);
@@ -635,6 +641,8 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cfg: ChestCfg) {
const { type, mid } = b.compound("Middle frame", [
{ shape: "box", size: [20, yTU - 80 - legH, depthIn - 40], pos: [0, (legH + yTU - 80) / 2, zMidIn - 20], material: "board" },
{ shape: "box", size: [PT, yTU, 40], pos: [0, yTU / 2, zFace - 20], material: "wood" },
+ // the block at the top back that takes the bolt through the back rail
+ { shape: "box", size: [20, 80, 60], pos: [0, yTU - 40, zb + 75], material: "wood" },
...rows.filter((_, i) => i > 0).flatMap((r): PartPiece[] => [-1, 1].map((g) => ({ shape: "box", size: [10, 36, depthIn - 60], pos: [g * 15, runY(r) + 4, zMidIn - 20], material: "wood" }))),
], { material: "wood" });
part = b.place(type, mid);
@@ -784,7 +792,7 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cfg: ChestCfg) {
if (!two)
step(b, { title: "Screw the bottom panels to the rail", detail: "Two screws through each into the bottom rail, with the Allen key.", tools: ["allen"], pose: "-y", kind: "screws" }, () => {
const it = b.partItem(midRail).final.pos;
- b.fits(BIG_SCREW, [-1, 1].flatMap((g) => [-0.3, 0.3].map((t): FitOpts => ({ on: bottoms[g < 0 ? 0 : 1], at: [g * 30, botTop, it[2] + t * depthIn], dir: [0, -1, 0], mate: midRail }))), 0.1);
+ b.fits(BIG_SCREW, [-1, 1].flatMap((g) => [-0.3, 0.3].map((t): FitOpts => ({ on: bottoms[g < 0 ? 0 : 1], at: [g * 12, botTop, it[2] + t * depthIn], dir: [0, -1, 0], mate: midRail }))), 0.1);
});
step(b, { title: "Push in the plastic plugs", detail: "Through the holes in the bottom panels into the front rail, then press each pin into its plug.", pose: "-y", kind: "general" }, () => {
const per = cfg.plugs / bottoms.length;
@@ -1260,11 +1268,18 @@ function boxDrawer(b: PlanBuilder, op: Opening, o: { zFace: number; zBack: numbe
}, { tools: ["screwdriver"], kind: "cams" });
dstep(withDowels ? "Tap the dowels into the drawer sides" : "Stand the drawer sides ready", withDowels ? (per === 1 ? "One in the front end of each side." : "Two in the front end of each side.") : "Grooves facing in and down.", () => {
b.stagger(0.2);
- sides.forEach((k, j) => st0(k, [(j ? 1 : -1) * 200, 0, -100]));
+ // they wait beside the front, standing on end, until they go onto its bolts
+ const sh0 = o.shift ?? [0, 0, 0];
+ sides.forEach((k, j) => lay(b, [k], c0, [sh0[0] + (j ? 1 : -1) * 90, sh0[1], sh0[2] - 150], [0, 0, 0], [0, 0, -200]));
b.then(0.15);
if (withDowels) fit("dowels", 0.1);
}, { tools: withDowels ? ["hammer"] : undefined, kind: withDowels ? "dowels" : "join" });
- dstep("Stand the sides on the front and lock them", "Grooves facing in. Turn each cam lock clockwise until it pulls tight.", () => fit("cams", 0.1), { tools: ["screwdriver"], kind: "cams" });
+ dstep("Stand the sides on the front and lock them", "Grooves facing in. Turn each cam lock clockwise until it pulls tight.", () => {
+ b.stagger(0.2);
+ sides.forEach((k) => st0(k, [0, 0, 0]));
+ b.then(0.15);
+ fit("cams", 0.1);
+ }, { tools: ["screwdriver"], kind: "cams" });
dstep("Slide in the bottom and drop the back on", "The bottom runs down the grooves; the back sits on top of it between the sides.", () => {
st0(bottom, [0, 0, -420]);
b.then(0.2);
@@ -1427,7 +1442,7 @@ function buildDesk(b: PlanBuilder, s: ProductSpec) {
b.fits(HW.camScrew, railBolts, 0.1);
b.then(0.05);
b.stagger(0.15);
- for (const k of [backRail, frontRail]) b.stage(k, [b.partItem(k).final.pos[0], b.partItem(k).final.pos[1] - 300, b.partItem(k).final.pos[2]], [0, 0, 0], [0, -100, 0]);
+ for (const k of [backRail, frontRail]) b.stage(k, [b.partItem(k).final.pos[0], b.partItem(k).final.pos[1] - 300, b.partItem(k).final.pos[2]], [0, 0, 0]);
b.then(0.1);
b.fits(HW.dowel, railDowels, 0.06);
});
@@ -1448,7 +1463,10 @@ function buildDesk(b: PlanBuilder, s: ProductSpec) {
b.fits(HW.dowel, unitDowels, 0.06);
b.then(0.1);
b.stagger(0.25);
- for (const k of [...backPanels, ...bottoms]) b.add(k, [0, -300, 0]);
+ // each slides sideways onto the leg frame's holes, the panel side still open
+ peds.forEach((g, i) => {
+ for (const k of [backPanels[i], bottoms[i]]) b.add(k, [-g * 250, 0, 0]);
+ });
});
step(b, { title: peds.length > 1 ? "Put the drawer panels in and lock them" : "Put the drawer panel in and lock it", detail: "Onto the dowels and into the top, then turn its cam locks.", tools: ["screwdriver"], pose: "-y", kind: "cams" }, () => {
b.stagger(0.25);
@@ -1510,12 +1528,22 @@ function buildShoe(b: PlanBuilder, s: ProductSpec) {
const { type, mid } = b.compound("Side frame", [
{ shape: "box", size: [P, yTU, P], pos: [xc, yTU / 2, zf - P / 2], material: "wood" },
{ shape: "box", size: [P, yTU, P], pos: [xc, yTU / 2, zb + P / 2], material: "wood" },
- { shape: "box", size: [16, yTU - legH, zIn1 - zIn0], pos: [xc, (legH + yTU) / 2, (zIn0 + zIn1) / 2], material: "board" },
+ // the panel's inside face is flush with the legs', so the runners and the bar screw into it
+ { shape: "box", size: [16, yTU - legH, zIn1 - zIn0], pos: [g * (xi + 8), (legH + yTU) / 2, (zIn0 + zIn1) / 2], material: "board" },
], { material: "wood" });
return b.place(type, mid);
};
const sides = [sideFrame(-1), sideFrame(1)];
const topP = b.place(b.part("Top", [W, TT, D]), [0, H - TT / 2, 0]);
+ // a divider reaches up behind the top rail, which is screwed into it from the front
+ const tongueD = zFace - 22 - (zb + P + 30);
+ const divPart = (name: string, h: number, y: number) => {
+ const { type, mid } = b.compound(name, [
+ { shape: "box", size: [18, h, shelfD], pos: [0, y, shelfZ], material: "board" },
+ ...(y + h / 2 >= yTU - railH - 1 ? [{ shape: "box", size: [18, railH, tongueD], pos: [0, yTU - railH / 2, zFace - 22 - tongueD / 2], material: "board" } as PartPiece] : []),
+ ]);
+ return b.place(type, mid);
+ };
const back: Board = { key: b.place(b.part("Back panel", [2 * xi, yTU - legH, 10]), [0, (legH + yTU) / 2, zb + P / 2]), y: (legH + yTU) / 2, z: zb + P / 2, h: yTU - legH, d: 10, flat: false };
const shelfD = zFace - (zb + P / 2 + 5);
const shelfZ = (zFace + zb + P / 2 + 5) / 2;
@@ -1533,10 +1561,7 @@ function buildShoe(b: PlanBuilder, s: ProductSpec) {
const drawerRail = four ? null : railAt(yTU - railH - dh - railH / 2);
const boards: Board[] = [botShelf, midShelf, topRail, ...(drawerRail ? [drawerRail] : [])];
// the 4 compartment cabinet has a divider above and below the middle shelf
- const divT = four ? b.part("Middle divider", [18, yTU - railH - (midShelf.y + 9), shelfD]) : "";
- const divider = four
- ? b.place(divT, [0, (midShelf.y + 9 + yTU - railH) / 2, shelfZ])
- : b.place(b.part("Drawer divider", [18, dh, shelfD]), [0, yTU - railH - dh / 2, shelfZ]);
+ const divider = four ? divPart("Middle divider", yTU - railH - (midShelf.y + 9), (midShelf.y + 9 + yTU - railH) / 2) : divPart("Drawer divider", dh, yTU - railH - dh / 2);
const divider2 = four ? b.place(b.part("Middle divider", [18, midShelf.y - 9 - (legH + 18), shelfD]), [0, (midShelf.y - 9 + legH + 18) / 2, shelfZ]) : "";
const divAt = (y: number) => (four && y < midShelf.y ? divider2 : divider);
const bar = b.place(b.part("Back bar", [2 * xi, 30, 20], { material: "metal" }), [0, yTU - 40, zb + P + 12]);
@@ -1584,6 +1609,14 @@ function buildShoe(b: PlanBuilder, s: ProductSpec) {
b.then(0.15);
b.fits(TABLE_BOLT, joints.flatMap((j) => j.bolts), 0.05);
});
+ // the sides take their drawer runners while they lie on the rug, the divider once it stands in the cabinet
+ const onSide = (o: FitOpts) => o.on !== divider;
+ if (!four)
+ step(b, { title: "Screw the drawer runners to the sides", detail: "Near the top front of each side. Left and right are marked; two screws each.", tools: ["screwdriver"], scene: "prep", kind: "runners" }, () => {
+ b.fits(runnerDef(runLen), frameRun.filter(onSide), 0.15);
+ b.then(0.1);
+ b.fits(RUNNER_SCREW, frameRunSc.filter(onSide), 0.05);
+ });
const shown = [back, ...boards];
step(b, { title: "Tap the dowels into the back, shelves and rails", detail: "Two in each end of the back and the shelves, one in each end of the rails.", tools: ["hammer"], scene: "boards", kind: "dowels" }, () => {
b.stagger(0.12);
@@ -1602,13 +1635,13 @@ function buildShoe(b: PlanBuilder, s: ProductSpec) {
b.stagger(0.2);
for (const k of [divider, ...(divider2 ? [divider2] : [])]) b.add(k, [200, 0, 0]);
b.then(0.15);
- b.fit(HW.screwM, { on: topRail.key, at: [0, yTU - railH / 2, zFace - 20], dir: [0, 0, -1], mate: divider });
+ b.fit(HW.screwM, { on: topRail.key, at: [0, yTU - railH / 2, zFace], dir: [0, 0, -1], mate: divider });
});
if (!four)
- step(b, { title: "Screw the drawer runners in", detail: "One on each side and two on the divider. Left and right are marked; two screws each.", tools: ["screwdriver"], pose: "+x", kind: "runners" }, () => {
- b.fits(runnerDef(runLen), frameRun, 0.15);
+ step(b, { title: "Screw the drawer runners to the divider", detail: "One on each face. Left and right are marked; two screws each.", tools: ["screwdriver"], pose: "+x", kind: "runners" }, () => {
+ b.fits(runnerDef(runLen), frameRun.filter((o) => !onSide(o)), 0.15);
b.then(0.1);
- b.fits(RUNNER_SCREW, frameRunSc, 0.05);
+ b.fits(RUNNER_SCREW, frameRunSc.filter((o) => !onSide(o)), 0.05);
});
step(b, { title: "Put the other side on", detail: "Lower it onto all the dowels and bolts, then lock its cam locks.", tools: ["screwdriver"], pose: "+x", people: 2, kind: "cams" }, () => {
b.add(sides[1], [300, 0, 0]);
@@ -1653,7 +1686,8 @@ function buildShoe(b: PlanBuilder, s: ProductSpec) {
return {
clips: [-1, 1].flatMap((g) => [0.2, 0.5, 0.8].concat(four ? [] : [0.65]).slice(0, 4).map((t): FitOpts => ({ on: d.key, at: [d.x + g * (d.w / 2 - 20), d.y0 + 30 + d.h * 0.6 * t, zr - 4], dir: [0, 0, 1], hole: false }))),
pins: [-1, 1].map((g): FitOpts => ({ on: d.key, at: [d.x + g * (d.w / 2 - 6), d.y0 + 25, zr - 20], dir: [-g, 0, 0] })),
- screws: [-1, 1].flatMap((g) => (four ? [0.3, 0.7] : [0.25, 0.5, 0.75]).slice(0, four ? 2 : 3).map((t): FitOpts => ({ on: d.key, at: [d.x + g * (d.w / 2 - 25), d.y0 + 30, zr - (shelfD - 60) * t], dir: [0, -1, 0] }))),
+ // through the rack's front lip into the back of the front
+ screws: spread(d.x - d.w / 2 + 30, d.x + d.w / 2 - 30, four ? 4 : 6).map((x): FitOpts => ({ on: d.key, at: [x, d.y0 + 30, zr - 8], dir: [0, 0, 1] })),
knobs: kx.map((x): FitOpts => ({ on: d.key, at: [x, ky, zFace], dir: [0, 0, -1], hole: false })),
knobScrews: kx.map((x): FitOpts => ({ on: d.key, at: [x, ky, zr - 4], dir: [0, 0, 1] })),
};
@@ -1807,24 +1841,33 @@ function buildWardrobe(b: PlanBuilder, s: ProductSpec) {
const boards = [ceiling, bottom, dShelf];
step(b, { title: "Tap the dowels into the boards", detail: "Two in each end of the inner top, the bottom and the drawer shelf, and screw the divider's cam bolt into the inner top.", tools: ["hammer"], scene: "boards", kind: "dowels" }, () => {
b.stagger(0.15);
- boards.forEach((bd, i) => lay(b, [bd.key], b.partItem(bd.key).final.pos, [0, 20, (i - 1) * (inD + 120)]));
+ // The inner top lies underside up, so the divider's bolt goes in from above.
+ boards.forEach((bd, i) => lay(b, [bd.key], b.partItem(bd.key).final.pos, [0, 20, (i - 1) * (inD + 120)], bd === ceiling ? [0, 0, Math.PI] : [0, 0, 0]));
b.then(0.15);
b.fits(HW.dowel, joints.flatMap((j) => j.dw), 0.05);
b.fit(TABLE_BOLT, divBolt);
});
- step(b, { title: "Lay the left side down and stand the boards in it", detail: "The wardrobe is built lying on its back. Push the boards onto their dowels and bolts and lock the cams.", tools: ["screwdriver"], pose: "+z", kind: "cams", people: 2, warnings: ["two", "floor"] }, () => {
+ step(b, { title: "Stand the tall divider on the inner top", detail: "Lower it straight onto the bolt and turn its cam to lock it. Keep the two together from now on.", tools: ["screwdriver"], scene: "boards", kind: "cams" }, () => {
+ lay(b, [divider], b.partItem(ceiling.key).final.pos, [0, 20, -(inD + 120)], [0, 0, Math.PI], [0, 400, 0]);
+ b.then(0.15);
+ b.fit(TABLE_CAM, { on: divider, at: [xDiv + 9, yTU - 18 - 30, inZ], dir: [-1, 0, 0] });
+ });
+ step(b, { title: "Lay the left side down and stand the boards in it", detail: "The wardrobe is built lying on its back. Push the boards onto their dowels and bolts, the divider with the inner top, and lock the cams.", tools: ["screwdriver"], pose: "+z", kind: "cams", people: 2, warnings: ["two", "floor"] }, () => {
b.add(sides[0], [-300, 0, 0]);
b.then(0.1);
- b.stagger(0.2);
- for (const bd of boards) b.add(bd.key, [300, 0, 0]);
+ for (const bd of boards) {
+ b.stagger(bd === ceiling ? 0 : 0.2);
+ b.add(bd.key, [300, 0, 0]);
+ if (bd === ceiling) {
+ b.stagger(0.2);
+ b.add(divider, [300, 0, 0]);
+ }
+ }
b.then(0.15);
b.fits(TABLE_CAM, joints.flatMap((j) => half(j.cams, -1)), 0.08);
});
- step(b, { title: "Put the dividers in", detail: "The drawer divider between the bottom and the drawer shelf, its leg at the front; the tall divider onto its bolt under the inner top, locked with a cam.", tools: ["screwdriver"], pose: "+z", kind: "cams" }, () => {
- b.stagger(0.25);
- for (const k of [drawDiv, divider]) b.add(k, [0, 0, 400]);
- b.then(0.15);
- b.fit(TABLE_CAM, { on: divider, at: [xDiv, yTU - 18 - 30, inZ + 9 + 20], dir: [0, 0, -1] });
+ step(b, { title: "Put the drawer divider in", detail: "Between the bottom and the drawer shelf, its leg at the front.", pose: "+z", kind: "join" }, () => {
+ b.add(drawDiv, [0, 0, 400]);
});
step(b, { title: "Put the right side on", detail: "Lower it onto the boards together and lock its cams.", tools: ["screwdriver"], pose: "+z", people: 2, kind: "cams" }, () => {
b.add(sides[1], [300, 0, 0]);
diff --git a/src/lib/plan/families/gulliver.ts b/src/lib/plan/families/gulliver.ts
index a9093f9..f904daf 100644
--- a/src/lib/plan/families/gulliver.ts
+++ b/src/lib/plan/families/gulliver.ts
@@ -118,13 +118,14 @@ function cot(s: ProductSpec): CustomParams {
{
title: "Screw the four hooks into the bed base",
detail: crib ? "One in each corner: the bolt goes down through the base into the hook under it." : "One in each corner: the hook goes in from below, the nut from above.",
- add: ["B"],
fix: hooks,
+ wait: ["B"],
tools: ["allen"],
},
{
title: "Stand it on its end and hook the base in",
detail: "The high level for a newborn, the low one once your baby can sit up. Each hook goes into its hole in the side panel.",
+ add: ["B"],
pose: "+x",
},
{ title: "Tap dowels into the other ends", detail: "Two in the top end of each side panel.", fix: sideDowels(1), tools: ["hammer"] },
@@ -188,11 +189,12 @@ function changing(s: ProductSpec): CustomParams {
const frameDowels = (k: string, f: { y: number; zb: number; zf: number; t: number }, rail: "F" | "B") => {
const z = rail === "F" ? f.zf - 20 : f.zb + 20;
return [-1, 1].map((sx) =>
- at("dowel", [[sx * (xi - 10), f.y - 12, z], [sx * (xi - 10), f.y - 28, z]], [0, 0, rail === "F" ? -1 : 1], `${k}${rail}`, `${k}${sx < 0 ? "L" : "R"}`, { len: 30, dia: 6, name: "Plain dowel" }),
+ at("dowel", [[sx * (xi - 10), f.y - 8, z], [sx * (xi - 10), f.y - 32, z]], [0, 0, rail === "F" ? -1 : 1], `${k}${rail}`, `${k}${sx < 0 ? "L" : "R"}`, { len: 30, dia: 6, name: "Plain dowel" }),
);
};
- const endDowel = (k: string, f: { y: number; zb: number; zf: number }, sx: number): CustomFix =>
- at("dowel", [[sx * xi, f.y - 20, f.zf - 10], [sx * xi, f.y - 20, f.zb + 10]], [sx, 0, 0], `${k}F`, sx < 0 ? "A" : "Z", { len: 30, dia: 8, name: "Fluted dowel" });
+ // one in the end of the front rail, one in the end of the back rail, each on its own rail so its hole is drilled there
+ const endDowel = (k: string, f: { y: number; zb: number; zf: number }, sx: number): CustomFix[] =>
+ (["F", "B"] as const).map((r) => at("dowel", [[sx * xi, f.y - 20, r === "F" ? f.zf - 10 : f.zb + 10]], [sx, 0, 0], `${k}${r}`, sx < 0 ? "A" : "Z", { len: 30, dia: 8, name: "Fluted dowel" }));
// the top's ends already carry two dowels; the ladder takes two more into its side pieces
const topMid = (sx: number): CustomFix =>
at("dowel", [[sx * xi, ft.y - 20, -60], [sx * xi, ft.y - 20, 60]], [sx, 0, 0], `T${sx < 0 ? "L" : "R"}`, sx < 0 ? "A" : "Z", { len: 30, dia: 8, name: "Fluted dowel" });
@@ -212,7 +214,7 @@ function changing(s: ProductSpec): CustomParams {
fix: frameDowels("T", ft, "B"),
tools: ["hammer"],
},
- { title: "Tap ribbed dowels into the top's ends", detail: "Two at each end, into the rails.", fix: [endDowel("T", ft, -1), endDowel("T", ft, 1)], tools: ["hammer"] },
+ { title: "Tap ribbed dowels into the top's ends", detail: "Two at each end, into the rails.", fix: [...endDowel("T", ft, -1), ...endDowel("T", ft, 1)], tools: ["hammer"] },
{
title: "Build the two shelves the same way",
detail: "Back rail, plain dowels, side pieces on the front rail, panel in, back rail on. The panel's smooth side faces up.",
@@ -224,7 +226,7 @@ function changing(s: ProductSpec): CustomParams {
title: "Push the top and shelves onto one end ladder",
detail: "Lay the table on its front on a rug. Ribbed dowels into the ladder's holes, then push all three frames on.",
add: ["A"],
- fix: [endDowel("M", f1, -1), endDowel("L", f2, -1), topMid(-1)],
+ fix: [...endDowel("M", f1, -1), ...endDowel("L", f2, -1), topMid(-1)],
pose: "-z",
tools: ["hammer"],
warnings: ["floor"],
@@ -233,12 +235,13 @@ function changing(s: ProductSpec): CustomParams {
{
title: "Tap dowels into the two back rails",
detail: "One ribbed dowel in each end.",
- fix: [-1, 1].map((sx) => at("dowel", [[sx * xi, 720, -D / 2 + 10], [sx * xi, 400, -D / 2 + 10]], [sx, 0, 0], undefined, undefined, { len: 30, dia: 8, name: "Fluted dowel" })),
+ fix: [-1, 1].flatMap((sx) => [720, 400].map((y, i) => at("dowel", [[sx * xi, y, -D / 2 + 10]], [sx, 0, 0], `RB${i}`, sx < 0 ? "A" : "Z", { len: 30, dia: 8, name: "Fluted dowel" }))),
+ wait: ["RB0", "RB1"],
tools: ["hammer"],
},
{ title: "Slide the back rails in", detail: "Into the ladder's holes, across the back.", add: ["RB0", "RB1"] },
{ title: "Screw the back rails to the ladder", detail: "One long screw through the post into each rail.", fix: [at("screw", [720, 400].map((y) => [-W / 2, y, -D / 2 + 10] as Vec3), [1, 0, 0], "A", undefined, { len: 70, dia: 5 })], tools: ["allen"] },
- { title: "Push the other end ladder on", detail: "Six ribbed dowels into its holes first, then press it onto all the frames and rails.", add: ["Z"], fix: [topMid(1), endDowel("M", f1, 1), endDowel("L", f2, 1)], tools: ["hammer"] },
+ { title: "Push the other end ladder on", detail: "Six ribbed dowels into its holes first, then press it onto all the frames and rails.", add: ["Z"], fix: [topMid(1), ...endDowel("M", f1, 1), ...endDowel("L", f2, 1)], tools: ["hammer"] },
{ title: "Screw the second ladder on", detail: "Eight long screws: two into each frame and one into each back rail.", fix: [at("screw", ladderScrews(1, true), [-1, 0, 0], "Z", undefined, { len: 70, dia: 5 })], tools: ["allen"], check: "square" },
{ title: "Stand it up", detail: "Check it stands steady before you use it.", pose: "+y", people: 2, warnings: ["two"] },
];
diff --git a/src/lib/plan/families/gunde.ts b/src/lib/plan/families/gunde.ts
index 12ffe6c..83ec493 100644
--- a/src/lib/plan/families/gunde.ts
+++ b/src/lib/plan/families/gunde.ts
@@ -4,7 +4,7 @@ import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../
/**
* GUNDE, read from the folding stool's manual. The stool comes assembled: the manual only shows opening it, legs
* apart, then pressing the seat down at both ends until its two catches click, with fingers kept clear of the
- * hinges. The folding chair has no manual (it is assembled too), so it keeps its old guide.
+ * hinges. The folding chair has no manual: it is sold assembled, so its guide only unfolds it.
*/
const TUBE = 18;
@@ -51,10 +51,48 @@ function stool(s: ProductSpec): CustomParams {
};
}
+
+/**
+ * The folding chair: a long frame from a loop on the floor at the front up into the backrest, a shorter frame from
+ * a loop at the back up under the front of the seat, crossing it at the pivots, and the seat hinged between them.
+ */
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 41 wide, 45 deep, 78 high, seat 45 high
+ const W = Math.round(s.size.w * 10) || 410, D = Math.round(s.size.d * 10) || 450, H = Math.round(s.size.h * 10) || 780;
+ const ys = 450, st = 30;
+ const xo = W / 2 - TUBE / 2 - 20, xi = xo - TUBE - 4;
+ const zf = D / 2 - TUBE / 2, zb = -D / 2 + TUBE / 2;
+ const cB: Vec3 = [0, H / 2, 0], cI: Vec3 = [0, (ys - 20) / 2, 0];
+ const main: PartPiece[] = [
+ // each side: up from the front loop to the back of the seat, then straight up into the backrest
+ ...[-1, 1].flatMap((g) => [tubeYZ([g * xo, TUBE / 2, zf], [g * xo, ys - 10, zb + 30], cB), tubeYZ([g * xo, ys - 10, zb + 30], [g * xo, H - 40, zb + 20], cB)]),
+ { shape: "cyl", size: [TUBE, 2 * xo, TUBE], pos: [0, TUBE / 2 - cB[1], zf], rot: [0, 0, Math.PI / 2] },
+ ];
+ const inner: PartPiece[] = [
+ ...[-1, 1].map((g) => tubeYZ([g * xi, TUBE / 2, zb], [g * xi, ys - 30, zf - 40], cI)),
+ { shape: "cyl", size: [TUBE, 2 * xi, TUBE], pos: [0, TUBE / 2 - cI[1], zb], rot: [0, 0, Math.PI / 2] },
+ ];
+ const parts: CustomPart[] = [
+ { id: "F", name: "Chair frame", size: [W - 40, H, D], pos: cB, pieces: main, material: "metal" },
+ { id: "B", name: "Backrest", size: [W, 190, 24], pos: [0, H - 95, zb + 26], material: "board" },
+ { id: "I", name: "Front leg frame", size: [2 * xi + TUBE, ys - 20, D], pos: cI, pieces: inner, material: "metal" },
+ { id: "S", name: "Seat", size: [W - 40, st, D - 90], pos: [0, ys - st / 2, 10], material: "board" },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Take the folded chair out of the box", detail: "It comes assembled, with nothing to screw together. Stand it on the front loop of its frame.", add: ["F", "B"] },
+ { title: "Swing the other legs out", detail: "Pull the bottom of the inner frame towards the back until both loops stand on the floor.", add: ["I"], from: { I: [0, 60, 300] }, warnings: ["hand"] },
+ { title: "Press the seat down", detail: "Push it down flat until it rests on the frame. To fold the chair, lift the front edge of the seat; keep your fingers clear of the joints.", add: ["S"], from: { S: [0, 300, -150] }, warnings: ["hand"] },
+ ],
+ };
+}
+
const family: Family = {
names: ["GUNDE"],
recipe(s) {
if (/gunde-folding-stool/.test(s.slug ?? "")) return stool(s);
+ if (/gunde-folding-chair/.test(s.slug ?? "")) return chair(s);
return null;
},
};
diff --git a/src/lib/plan/families/gunrik.ts b/src/lib/plan/families/gunrik.ts
index ecc7d57..f5e000e 100644
--- a/src/lib/plan/families/gunrik.ts
+++ b/src/lib/plan/families/gunrik.ts
@@ -90,7 +90,7 @@ function chair(s: ProductSpec): CustomParams {
const tips = angles.map((a): Vec3 => [Math.sin(a) * (R - 20), 60, zc + Math.cos(a) * (R - 20)]);
const foot: Vec3[] = [-15, 15].map((x): Vec3 => [x, 60, zc]);
- const armBolts = (g: number, on: string) => fix("bolt", [160, 185, 210].map((z, k): Vec3 => [g * (k === 1 ? 200 : 150), SY - 90, zc + z]), [0, 1, 0], { len: 30, dia: 6, on, mate: "S" });
+ const armBolts = (g: number, on: string) => fix("bolt", [160, 185, 210].map((z, k): Vec3 => [g * (k === 1 ? 180 : 140), SY - 110, zc + z]), [0, 1, 0], { len: 30, dia: 6, on, mate: "S" });
return {
parts,
steps: [
@@ -119,6 +119,8 @@ function chair(s: ProductSpec): CustomParams {
detail: "Lay the seat upside down on a table. Three of the long bolts through each armrest into the seat.",
fix: [armBolts(-1, "A0"), armBolts(1, "A1")],
wait: ["S", "A0", "A1"],
+ // all three wait together, the armrests against the seat they bolt into
+ from: { S: [800, 0, 0], A0: [800, 0, 0], A1: [800, 0, 0] },
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/gursken.ts b/src/lib/plan/families/gursken.ts
index cdd9d01..e381089 100644
--- a/src/lib/plan/families/gursken.ts
+++ b/src/lib/plan/families/gursken.ts
@@ -96,8 +96,8 @@ function chest(s: ProductSpec): CustomParams {
dowels: SX.map((sx) => fx({ kind: "dowel", at: [[sx * dxS, ym, zF - T]], dir: [0, 0, -1], on: sx < 0 ? k.l : k.r })),
cams: SX.map((sx) => fx({ kind: "cam", dia: 15, at: [-45, 45].map((dy) => [sx * (dxS - 6), ym + dy, zF - T - 30] as Vec3), dir: [sx, 0, 0], on: sx < 0 ? k.l : k.r })),
pins: SX.map((sx) => fx({ kind: "clip", name: "Plastic pin", len: 30, dia: 8, at: [-30, 30].map((dy) => [sx * (dxS + 6), y + 115 + dy, zDb] as Vec3), dir: [-sx, 0, 0], on: sx < 0 ? k.l : k.r, mate: k.b })),
- knob: fx({ kind: "knob", dia: 32, at: [[0, y + slot / 2, zF]], dir: [0, 0, -1], on: k.f }),
- knobScrew: fx({ kind: "screw", len: 25, dia: 4, at: [[0, y + slot / 2, zF - T]], dir: [0, 0, 1], on: k.f }),
+ knob: fx({ kind: "knob", dia: 32, at: [[0, y + slot / 2, zF + 4]], dir: [0, 0, -1], on: k.f }),
+ knobScrew: fx({ kind: "screw", len: 25, dia: 4, at: [[0, y + slot / 2, zF - T - 4]], dir: [0, 0, 1], on: k.f }),
stops: SX.map((sx) => fx({ kind: "stud", name: "Drawer stop", len: 10, dia: 12, at: [[sx * (dxS + 6), yRun(i), zDb + 15]], dir: [-sx, 0, 0], on: sx < 0 ? k.l : k.r })),
};
};
@@ -200,7 +200,7 @@ function chest(s: ProductSpec): CustomParams {
tools: ["screwdriver"],
from: {},
},
- { title: "Tap a dowel into each drawer side", detail: "Into the front end, the one nearest the groove.", add: [dr(0).l, dr(0).r], fix: d0.dowels, tools: ["hammer"] },
+ { title: "Tap a dowel into each drawer side", detail: "Into the front end, the one nearest the groove.", add: [dr(0).l, dr(0).r], fix: d0.dowels, tools: ["hammer"], from: { [dr(0).l]: [0, 0, -300], [dr(0).r]: [0, 0, -300] } },
{ title: "Fix the sides to the front", detail: "Onto the bolts and the dowels, grooves facing in, then turn the four cam locks clockwise.", fix: d0.cams, tools: ["screwdriver"] },
{ title: "Slide in the drawer bottom", detail: "From the back, along the grooves until it stops in the front.", add: [dr(0).bt] },
{ title: "Put the drawer back in", detail: "Between the sides at the back, resting on top of the bottom.", add: [dr(0).b] },
@@ -211,6 +211,8 @@ function chest(s: ProductSpec): CustomParams {
title: "Build the other two drawers",
detail: "The same way, step by step.",
add: [1, 2].flatMap((i) => [dr(i).f, dr(i).l, dr(i).r, dr(i).bt, dr(i).b]),
+ // each arrives built, in one piece, and slides in from the front
+ from: Object.fromEntries([1, 2].flatMap((i) => [dr(i).f, dr(i).l, dr(i).r, dr(i).bt, dr(i).b]).map((k) => [k, [0, 0, 400] as Vec3])),
repeat: 2,
},
{ title: "Slide the drawers in", detail: "Each one onto its rails, all the way in.", kind: "drawer" },
@@ -309,8 +311,8 @@ function wardrobe(s: ProductSpec): CustomParams {
tools: ["hammer"],
},
{ title: "Screw the shelf to the side", detail: "Near the top end, holes facing the top. Two screws.", fix: [screw2(-1, yShelf, "shelf")], tools: ["allen"] },
- { title: "Tap dowels into the plinth", detail: "Two into each end.", add: ["plinth"], fix: ends({ kind: "dowel", at: SX.flatMap((sx) => [-15, 15].map((dy) => [sx * xIn, P / 2 + dy, zPl] as Vec3)), on: "plinth" }), tools: ["hammer"] },
- { title: "Slide the plinth in under the bottom", detail: "Along the floor, onto the side's holes at the front.", from: {} },
+ { title: "Tap dowels into the plinth", detail: "Two into each end.", wait: ["plinth"], fix: ends({ kind: "dowel", at: SX.flatMap((sx) => [-15, 15].map((dy) => [sx * xIn, P / 2 + dy, zPl] as Vec3)), on: "plinth" }), tools: ["hammer"] },
+ { title: "Slide the plinth in under the bottom", detail: "Along the floor, onto the side's holes at the front.", add: ["plinth"], from: { plinth: [350, 0, 0] } },
{ title: "Fit the other side together", detail: "One of you holds the frame while the other pushes the side onto all the dowels.", add: ["R"], people: 2, warnings: ["two"] },
{ title: "Screw the side to the bottom", detail: "Two screws at the bottom end.", fix: [screw2(1, yBot, "bottom")], tools: ["allen"] },
{ title: "Screw it to the top and the shelf", detail: "Four screws at the top end.", fix: [screw2(1, yTop, "top"), screw2(1, yShelf, "shelf")], tools: ["allen"] },
@@ -389,7 +391,7 @@ function wardrobe(s: ProductSpec): CustomParams {
fix: [...hinges, ...hingeScrews],
tools: ["screwdriver"],
},
- ...(two ? [] : [{ title: "Screw on the knob", detail: "On the edge away from the hinges, the screw from behind.", fix: [fx({ kind: "knob", dia: 32, at: knobXs.map((x) => [x, yKnob, zF] as Vec3), dir: [0, 0, -1], on: "door0" }), fx({ kind: "screw", len: 25, dia: 4, at: knobXs.map((x) => [x, yKnob, zF - DT] as Vec3), dir: [0, 0, 1], on: "door0" })], tools: ["screwdriver"] } as CustomStep]),
+ ...(two ? [] : [{ title: "Screw on the knob", detail: "On the edge away from the hinges, the screw from behind.", fix: [fx({ kind: "knob", dia: 32, at: knobXs.map((x) => [x, yKnob, zF + 4] as Vec3), dir: [0, 0, -1], on: "door0" }), fx({ kind: "screw", len: 25, dia: 4, at: knobXs.map((x) => [x, yKnob, zF - DT - 4] as Vec3), dir: [0, 0, 1], on: "door0" })], tools: ["screwdriver"] } as CustomStep]),
{
title: two ? "Clip the doors on" : "Clip the door on",
detail: "Hook each hinge arm onto its plate and press until it clicks, then tighten the screw on each arm.",
@@ -397,7 +399,7 @@ function wardrobe(s: ProductSpec): CustomParams {
tools: ["screwdriver"],
},
...(two
- ? [{ title: "Screw on the knobs", detail: "Near the middle edges, the screw from behind.", fix: [fx({ kind: "knob", dia: 32, at: knobXs.map((x) => [x, yKnob, zF] as Vec3), dir: [0, 0, -1] }), fx({ kind: "screw", len: 25, dia: 4, at: knobXs.map((x) => [x, yKnob, zF - DT] as Vec3), dir: [0, 0, 1] })], tools: ["screwdriver"] } as CustomStep]
+ ? [{ title: "Screw on the knobs", detail: "Near the middle edges, the screw from behind.", fix: [fx({ kind: "knob", dia: 32, at: knobXs.map((x) => [x, yKnob, zF + 4] as Vec3), dir: [0, 0, -1] }), fx({ kind: "screw", len: 25, dia: 4, at: knobXs.map((x) => [x, yKnob, zF - DT - 4] as Vec3), dir: [0, 0, 1] })], tools: ["screwdriver"] } as CustomStep]
: []),
{ title: two ? "Line up the doors" : "Line up the door", detail: "Turn the hinge screws: one moves it up and down, one in and out, one sideways, until the gaps are even.", tools: ["screwdriver"] },
];
diff --git a/src/lib/plan/families/guttane.ts b/src/lib/plan/families/guttane.ts
index c280244..a6bda1e 100644
--- a/src/lib/plan/families/guttane.ts
+++ b/src/lib/plan/families/guttane.ts
@@ -50,7 +50,7 @@ function recipe(s: ProductSpec): CustomParams | null {
const ends = [-1, 1];
const railEnd = (sx: number): Vec3 => [sx * railLen / 2, railY, 0];
const nuts = ends.map((sx): Vec3 => [sx * (railLen / 2 - 35), railY - railH / 2, 0]);
- const bolts = ends.map((sx): Vec3 => [sx * (xl + railT / 2), railY, 0]);
+ const bolts = ends.map((sx): Vec3 => [sx * (xl + railT / 2), railY - 18, 0]); // below the dowel, level with the barrel nut
const screwsAt = (sx: number): Vec3[] => [-zl, -zl / 2, zl / 2, zl].map((z) => [sx * xl, topY0 - 25, z]);
const feet = ends.flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xl, 0, sz * zl]));
diff --git a/src/lib/plan/families/hagaan.ts b/src/lib/plan/families/hagaan.ts
index d1cce88..ebde09a 100644
--- a/src/lib/plan/families/hagaan.ts
+++ b/src/lib/plan/families/hagaan.ts
@@ -140,7 +140,7 @@ function recipe(g: Box) {
steps.push({
title: "Screw the fittings tight",
detail: "One screw in each. Turn it in by hand and stop when it's snug, or it strips the board.",
- fix: [-1, 1].map((sx) => fx("screw", sx < 0 ? "L" : "R", [sx, 0, 0], [[inner(sx), railY + 46, zf + 2]], { len: 25, dia: 4 })),
+ fix: [-1, 1].map((sx) => fx("screw", sx < 0 ? "L" : "R", [sx, 0, 0], [[inner(sx) - sx * 12, railY + 46, zf + 2]], { len: 25, dia: 4 })),
tools: ["screwdriver"],
warnings: ["hand"],
});
diff --git a/src/lib/plan/families/hakanskar.ts b/src/lib/plan/families/hakanskar.ts
index 35ca2fe..f840e24 100644
--- a/src/lib/plan/families/hakanskar.ts
+++ b/src/lib/plan/families/hakanskar.ts
@@ -42,7 +42,7 @@ function recipe(s: ProductSpec): CustomParams {
const zIn = ze - t / 2, yIn = ye - t / 2; // the rails' inner faces
parts.push(
rail("R1", t / 2, ze, xs.map((x): [Vec3, Vec3] => [[40, 30, 3], [x, t + 10, zIn - 22]])),
- rail("R2", ye, ze, [...xs.map((x): [Vec3, Vec3] => [[40, 30, 3], [x, yIn - 15, zIn - 22]]), ...xs.map((x): [Vec3, Vec3] => [[40, 3, 30], [x, yIn - 22, zIn - 15]])]),
+ rail("R2", ye, ze, [...xs.map((x): [Vec3, Vec3] => [[40, 50, 3], [x, yIn - 25, zIn - 22]]), ...xs.map((x): [Vec3, Vec3] => [[40, 3, 30], [x, yIn - 22, zIn - 15]])]),
rail("R3", ye, -ze, xs.map((x): [Vec3, Vec3] => [[40, 3, 30], [x, yIn - 22, -zIn + 15]])),
);
// slatted panels: seven slats down the front, eight across the top
@@ -103,7 +103,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Lower it into the bottom of the frame onto the six tabs, then a bolt through each tab.",
add: ["P1"],
from: { P1: [0, 0, 300] },
- fix: [fix("bolt", [t + 10, yIn - 15].flatMap((y) => xs.map((x): Vec3 => [x, y, zIn - 22])), [0, 0, 1], { ...bolt, mate: "P1" })],
+ fix: [fix("bolt", [t + 10, yIn - 38].flatMap((y) => xs.map((x): Vec3 => [x, y, zIn - 22])), [0, 0, 1], { ...bolt, mate: "P1" })],
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/hammarn.ts b/src/lib/plan/families/hammarn.ts
index 9591b4c..9ab9311 100644
--- a/src/lib/plan/families/hammarn.ts
+++ b/src/lib/plan/families/hammarn.ts
@@ -218,12 +218,13 @@ function sofa(): CustomParams {
},
{
title: "Bolt the tubes together all round",
- detail: "Twelve of the longer countersunk bolts, at every hole along the edge tubes. Tighten them all.",
+ detail: "Twelve of the longer countersunk bolts, from the outside in through the holes along the edge tubes, a washer on each. Tighten them all.",
+ // each bolt goes in flat, in the plane of the fabric, through the tube and into the hem inside it
fix: [
- fix("bolt", [-1, 1].flatMap((sx) => [hinge[2] + 200, zf - 60].map((z): Vec3 => [sx * xb, yS - D / 2, z])), [0, 1, 0], { len: 45, dia: 6 }),
- fix("bolt", [-1, 1].flatMap((sx) => [0.3, 0.9].map((t) => along(t, sx * xb, -D / 2))), [0, 0, 1], { len: 45, dia: 6 }),
- fix("bolt", [-1, 1].map((sx): Vec3 => [sx * (xb - 60), yS - D / 2, zf]), [0, 1, 0], { len: 45, dia: 6 }),
- fix("bolt", [-1, 1].map((sx) => along(1, sx * (xb - 60), -D / 2)), [0, 0, 1], { len: 45, dia: 6 }),
+ ...[-1, 1].map((sx) => fix("bolt", [hinge[2] + 200, zf - 60].map((z): Vec3 => [sx * (xb + D / 2), yS, z]), [-sx, 0, 0], { len: 45, dia: 6 })),
+ ...[-1, 1].map((sx) => fix("bolt", [0.3, 0.9].map((t) => along(t, sx * (xb + D / 2))), [-sx, 0, 0], { len: 45, dia: 6 })),
+ fix("bolt", [-1, 1].map((sx): Vec3 => [sx * (xb - 60), yS, zf + D / 2]), [0, 0, -1], { len: 45, dia: 6 }),
+ fix("bolt", [-1, 1].map((sx) => along(1 + D / 2 / backLen, sx * (xb - 60))), [0, -(top[1] - hinge[1]) / backLen, -(top[2] - hinge[2]) / backLen], { len: 45, dia: 6 }),
],
tools: ["allen"],
},
diff --git a/src/lib/plan/families/hauga.ts b/src/lib/plan/families/hauga.ts
index bbbe4ae..894d4e7 100644
--- a/src/lib/plan/families/hauga.ts
+++ b/src/lib/plan/families/hauga.ts
@@ -817,7 +817,7 @@ function caseRunners(k: ReturnType<typeof kit>, ds: Drawer[], sideOf: (d: Drawer
on.push(sid);
dirs.push([sg, 0, 0]);
for (const f of nScrews === 2 ? [-0.4, 0.4] : [-0.4, 0, 0.4]) {
- screws.push([x - sg * 11, y, z + len * f]);
+ screws.push([x - sg * 2, y, z + len * f]); // through the runner's flange into the side
son.push(sid);
sdirs.push([sg, 0, 0]);
}
@@ -1021,9 +1021,9 @@ function chest3(b: PlanBuilder, s: ProductSpec) {
},
{
title: "Push the plinth rail in",
- detail: "Two dowels in its ends first, no hammer. It goes in under the bottom, set back from the front.",
+ detail: "Two dowels in its top edge first, no hammer. It pushes onto the bottom, set back from the front.",
pose: "-z",
- ops: [{ fit: FF(T_DOWEL, [["PL", "-x", 1], ["PL", "+x", 1]]) }, { add: ["PL"], from: [0, -300, 0] }],
+ ops: [{ fit: F(T_DOWEL, "PL", "+y", 2, { a: 0.1, b: 0.9, mate: "BOT" }) }, { add: ["PL"], from: [0, -300, 0] }],
},
{
title: "Click in the plinth brackets",
@@ -1369,9 +1369,9 @@ function caseBuild(b: PlanBuilder, s: ProductSpec, c: Cfg) {
}
steps.push({
title: "Push the plinth rail in",
- detail: `${ph.dowels} dowels in its ends first, no hammer. It goes in under the bottom, set back from the front.`,
+ detail: `${ph.dowels} dowels in its top edge first, no hammer. It pushes onto the bottom, set back from the front.`,
pose: ps,
- ops: [{ fit: FF(T_DOWEL, [["PL", "-x", ph.dowels / 2], ["PL", "+x", ph.dowels / 2]]) }, { add: ["PL"], from: [0, -300, 0] }],
+ ops: [{ fit: F(T_DOWEL, "PL", "+y", ph.dowels, { a: 0.1, b: 0.9, mate: "BOT" }) }, { add: ["PL"], from: [0, -300, 0] }],
});
break;
case "feet":
diff --git a/src/lib/plan/families/havback.ts b/src/lib/plan/families/havback.ts
index 4bd4174..991c371 100644
--- a/src/lib/plan/families/havback.ts
+++ b/src/lib/plan/families/havback.ts
@@ -37,7 +37,7 @@ const STOP: HwDef = { kind: "clip", len: 20, dia: 14 }; // the plastic door stop
const WIRE: HwDef = { kind: "clip", len: 40, dia: 8 }; // the bent wire clips in a drawer
const DOWEL: HwDef = { kind: "dowel", len: 30, dia: 8 }; // plastic, with a cam over its head
const CAM: HwDef = { kind: "cam", len: 10, dia: 15 };
-const SUPPORT: HwDef = { kind: "angle", len: 380, dia: 30 }; // the metal support under a wide drawer's bottom
+const SUPPORT: HwDef = { kind: "strap", len: 150, dia: 30, name: "Drawer support" }; // a steel stay up the inside of a wide drawer's back
const JOIN_PLATE: HwDef = { kind: "connector", len: 50, dia: 30 }; // a flat joining plate
const SHELF_SUPPORT: HwDef = { kind: "pin", len: 16, dia: 5 }; // with a screw-in peg, it locks the shelf
const SHELF_PIN: HwDef = { kind: "pin", len: 12, dia: 5 }; // the plain clip-in kind
@@ -251,7 +251,11 @@ class Havback {
const out: [HwDef, FitOpts][] = [];
for (const f of this.suspensions(u)) {
out.push([SUSPENSION, { ...f.at, hole: false }]);
- if (u.kind === "high" || u.kind === "wall") out.push([FIT_SCREW, this.inner(u, f.sx, u.yr - 26, -u.D / 2 + 30)]);
+ if (u.kind === "high" || u.kind === "wall") {
+ // through the fitting's body into the side
+ const o = this.inner(u, f.sx, u.yr - 26, -u.D / 2 + 30);
+ out.push([FIT_SCREW, { ...o, at: [o.at[0] - f.sx * 12, o.at[1], o.at[2]] }]);
+ }
else for (const [dy, dz] of [[26, 8], [-26, 8], [0, 34]]) out.push([SCREW, this.inner(u, f.sx, u.yr + dy, -u.D / 2 + 16 + dz)]);
}
return out;
@@ -526,7 +530,7 @@ class Havback {
const x = a.x0 + a.W / 2;
this.step(
{ title: "Screw the two units together", detail: "Two screws through the side into its neighbour, 40 mm in from the front edge: one high, one low.", kind: "join", tools: ["drill", "screwdriver"], scene: "main" },
- () => this.b.fits(JOIN, [a.H * 0.8, a.H * 0.25].map((y) => ({ on: a.sideR, at: [r(x), r(y), r(a.D / 2 - 40)] as Vec3, dir: [1, 0, 0] as Vec3, mate: c.sideL })), 0.15),
+ () => this.b.fits(JOIN, [a.H * 0.8, a.H * 0.25].map((y) => ({ on: a.sideR, at: [r(x - a.T), r(y), r(a.D / 2 - 40)] as Vec3, dir: [1, 0, 0] as Vec3, mate: c.sideL })), 0.15),
);
}
@@ -590,7 +594,14 @@ class Havback {
const supportFits = (d: Drawer): [HwDef, FitOpts][] => {
if (!wide) return [];
const z = this.pos(d.bottom)[2];
- return [[SUPPORT, { on: d.bottom, at: [d.u.x0, d.yb + 8, r(z)], dir: [0, 1, 0], hole: false }], ...[-1, 0, 1].map((k): [HwDef, FitOpts] => [SCREW, { on: d.bottom, at: [d.u.x0, d.yb + 8, r(z + k * 120)], dir: [0, 1, 0] }])];
+ // up the inside of the back: hooked over its top edge with one screw down into it, its foot screwed to the bottom
+ const zb = this.pos(d.back)[2] + 8;
+ const top = d.yb + d.sh, floor = d.yb + 16;
+ return [
+ [{ ...SUPPORT, len: Math.round(d.sh - 16) }, { on: d.back, at: [d.u.x0, r((top + floor) / 2), r(zb)], dir: [0, 0, 1], hole: false }],
+ [SCREW, { on: d.back, at: [d.u.x0, r(top), r(zb - 8)], dir: [0, -1, 0] }],
+ ...[-1, 1].map((sx): [HwDef, FitOpts] => [SCREW, { on: d.bottom, at: [d.u.x0 + sx * 18, r(floor + 4), r(zb + 12)], dir: [0, -1, 0] }]),
+ ];
};
this.step(
@@ -619,7 +630,7 @@ class Havback {
this.step({ title: "Press the box front on", detail: "Its slots go over the ends of the sides. Press it down evenly.", kind: "drawer", scene: "drawer", repeat: rep }, () => b.stage(d0.boxFront, rel(d0.boxFront), [0, 0, 0], [0, 0, 260]));
this.step({ title: "Lock the corners", detail: "A plastic dowel through each side into the front and back, then turn the cap over each one until it locks.", kind: "drawer", tools: ["screwdriver"], scene: "drawer", repeat: rep }, () => this.fitAll(lockFits(d0), 0.08));
if (wide)
- this.step({ title: "Screw the support under the bottom", detail: "Across the middle of the bottom, three screws.", kind: "drawer", tools: ["screwdriver"], scene: "drawer", repeat: rep }, () => this.fitAll(supportFits(d0), 0.1));
+ this.step({ title: "Screw the support inside the back", detail: "Hook it over the middle of the back's top edge: one screw down into the edge and two through its foot into the bottom.", kind: "drawer", tools: ["screwdriver"], scene: "drawer", repeat: rep }, () => this.fitAll(supportFits(d0), 0.1));
const div = list.filter((d) => d.divider);
if (div.length) {
const dv = div[0];
diff --git a/src/lib/plan/families/havsta.ts b/src/lib/plan/families/havsta.ts
index 4c32700..9c55bce 100644
--- a/src/lib/plan/families/havsta.ts
+++ b/src/lib/plan/families/havsta.ts
@@ -830,7 +830,7 @@ function buildSideboard(k: Kit, gd: Guide) {
const x = t.x + g * (t.w / 2), on = Math.abs(x) > xIn(f) - 1 ? (x < 0 ? "L" : "R") : x < 0 ? "HB0" : "HB1";
const z = t.z1 - 10 - len / 2;
k.fit(runnerDef(len), [[x - g * 6, t.y + 20, z]], [g, 0, 0], { on, hole: false, gap: 0.15 });
- k.fit(RUNNER_SCREW, [z - len / 3, z + len / 3].map((zz): Vec3 => [x - g * 12, t.y + 20, zz]), [g, 0, 0], { on, gap: 0.05 });
+ k.fit(RUNNER_SCREW, [z - len / 3, z + len / 3].map((zz): Vec3 => [x - g * 3, t.y + 20, zz]), [g, 0, 0], { on, gap: 0.05 });
}
}
});
@@ -1100,8 +1100,9 @@ function buildChest(k: Kit, gd: Guide) {
);
k.step({ title: "Press the top board on", detail: "Line it up all round and press it down onto the fittings.", kind: "join" }, () => k.add(["TOP"], [0, 260, 0]));
}
- k.step({ title: "Fit the back rail under the top", detail: `Tap ${cols === 2 ? 4 : 3} dowels into its top edge, push it in at the back and turn two cam locks.`, tools: ["hammer", "screwdriver"], kind: "cams" }, () => {
- k.add(["TR"], [0, 0, -260]);
+ k.step({ title: "Fit the back rail under the top", detail: `Tap ${cols === 2 ? 4 : 3} dowels into its top edge, lift it up onto them and the cam bolts at the back, then turn two cam locks.`, tools: ["hammer", "screwdriver"], kind: "cams" }, () => {
+ // from below: its dowels and the top's cam bolts both point up and down
+ k.add(["TR"], [0, -220, 0]);
k.fit(DOWEL, spread(-W / 2 + 120, W / 2 - 120, cols === 2 ? 4 : 3).map((x): Vec3 => [x, ySideTop, zb + 12 + T / 2]), [0, 1, 0], { on: "TR", mate: "TOPF" });
k.fit(CAM, [-1, 1].map((g): Vec3 => [g * (W / 4), ySideTop - 30, zb + 12 + T]), [0, 0, -1], { on: "TR" });
});
@@ -1271,17 +1272,17 @@ function buildConsole(k: Kit, gd: Guide) {
k.part(`BL${g}`, "Lower rail, long", [lr, th, rt], [0, ty, g * zr], wood);
k.part(`BS${g}`, "Lower rail, short", [rt, th, sr], [g * xr, ty, 0], wood);
}
- k.part("SH", "Shelf", [lr - 4, 12, sr + 2 * rt - 2 * rt - 4], [0, 80 + 24, 0], wood);
- const apron = ["AL-1", "AL1", "AS-1", "AS1"], tray = ["BL-1", "BL1", "BS-1", "BS1"];
- k.step({ title: "Screw the two rail frames together", detail: "Lay the rails out on a rug. One screw through each corner joint, four in each frame.", tools: ["screwdriver"], scene: "frames", warnings: ["floor"], kind: "screws" }, () => {
+ // a ledge strip along the inside of each lower long rail carries the shelf
+ const lt = 16, lh = 20, ly = 80 + 24 - 6 - lh / 2, lz = zr - rt / 2 - lt / 2;
+ for (const g of [-1, 1]) k.part(`LD${g}`, "Ledge strip", [lr - 40, lh, lt], [0, ly, g * lz], wood);
+ k.part("SH", "Shelf", [lr - 4, 12, 2 * (zr - rt / 2) - 4], [0, 80 + 24, 0], wood);
+ const apron = ["AL-1", "AL1", "AS-1", "AS1"], tray = ["BL-1", "BL1", "BS-1", "BS1"], ledges = ["LD-1", "LD1"];
+ k.step({ title: "Screw the ledge strips onto the lower rails", detail: "Lay the frames out on a rug. One strip along the inside of each long rail, four screws each.", tools: ["screwdriver"], scene: "frames", warnings: ["floor"], kind: "screws" }, () => {
k.stage(apron, [0, -ay + ah / 2, -D * 0.7], [0, 160, 0]);
k.stage(tray, [0, -ty + th / 2, D * 0.7], [0, 160, 0]);
- for (const g of [-1, 1]) {
- for (const h of [-1, 1]) {
- k.fit(RAIL_SCREW, [[g * xr, ay, h * (zr + rt / 2)]], [0, 0, -h], { on: `AL${h}`, mate: `AS${g}`, gap: 0.08 });
- k.fit(RAIL_SCREW, [[g * xr, ty, h * (zr + rt / 2)]], [0, 0, -h], { on: `BL${h}`, mate: `BS${g}`, gap: 0.08 });
- }
- }
+ k.stage(ledges, [0, -ty + th / 2, D * 0.7], [0, 200, 0]);
+ for (const g of [-1, 1])
+ k.fit(RAIL_SCREW, spread(-lr / 2 + 80, lr / 2 - 80, 4).map((x): Vec3 => [x, ly, g * (lz - lt / 2)]), [0, 0, g], { on: `LD${g}`, mate: `BL${g}`, gap: 0.08 });
});
k.step({ title: "Screw the cam bolts into the lower frame", detail: "One at each corner, by hand until it stops.", tools: ["screwdriver"], scene: "frames", kind: "cams" }, () =>
k.fit(C_BOLT, legs.map((l): Vec3 => [l.gx * (xr), ty, l.gz * (zl - 5)]), [-1, 0, 0], { on: "BS-1" }),
@@ -1306,7 +1307,7 @@ function buildConsole(k: Kit, gd: Guide) {
k.step({ title: "Push the cam locks into the first two legs", detail: "Arrow towards where the bolt will come.", tools: ["screwdriver"], pose: "-y", kind: "cams" }, () =>
k.fit(CAM, legs.filter((l) => l.gx < 0).map((l): Vec3 => [l.x, ty, l.z]), [0, 0, 1], { on: legs[0].id }),
);
- k.step({ title: "Lower the lower frame onto the legs", detail: "Its cam bolts go into the legs.", pose: "-y", kind: "join" }, () => k.add(tray, [0, -260, 0]));
+ k.step({ title: "Lower the lower frame onto the legs", detail: "Its cam bolts go into the legs.", pose: "-y", kind: "join" }, () => k.add([...tray, ...ledges], [0, -260, 0]));
k.step({ title: "Fix the other two brackets", detail: "Over the rods, nuts tightened with the spanner.", tools: ["wrench"], pose: "-y", kind: "bolts" }, () => {
k.fit(CORNER, brPts(1), [0, 1, 0], { on: "AL1", hole: false });
k.fit(NUT, brPts(1), [0, 1, 0], { on: "AL1", hole: false });
diff --git a/src/lib/plan/families/hejne.ts b/src/lib/plan/families/hejne.ts
index 5e3ced5..4158b73 100644
--- a/src/lib/plan/families/hejne.ts
+++ b/src/lib/plan/families/hejne.ts
@@ -31,7 +31,7 @@ function recipe(s: ProductSpec): CustomParams {
const upright = (id: string, sx: number, sz: number): CustomPart => ({ id, name: "Upright", size: [uw, H, ut], pos: [sx * xu, H / 2, sz * zu], material: "wood" });
parts.push(upright("B0", -1, -1), upright("B1", 1, -1), upright("F0", -1, 1), upright("F1", 1, 1));
// the crossed brace on the back, between the middle shelves
- const y0 = tops[1] + 60, y1 = tops[2] - bh - st - 60, x0 = xu - uw / 2 - 10;
+ const y0 = tops[1] + 60, y1 = tops[2] - bh - st - 60, x0 = xu - 5; // its ends lie on the back uprights
const zb = -zu + ut / 2 + 2;
const len = Math.hypot(2 * x0, y1 - y0), ang = Math.atan2(2 * x0, y1 - y0);
const yc = (y0 + y1) / 2;
@@ -73,7 +73,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Lift it upright together. Hook the brace across the back between the middle shelves, one screw at each of its four ends.",
add: ["X"],
from: { X: [0, 0, -300] },
- fix: [fix("screw", [[-x0, y0, zb], [x0, y0, zb], [-x0, y1, zb], [x0, y1, zb]], [0, 0, 1], { len: 16, dia: 4 })],
+ fix: [fix("screw", [[-x0, y0, zb], [x0, y0, zb], [-x0, y1, zb], [x0, y1, zb]], [0, 0, -1], { len: 16, dia: 4 })],
tools: ["screwdriver"],
pose: "+y",
people: 2,
diff --git a/src/lib/plan/families/hemlingby.ts b/src/lib/plan/families/hemlingby.ts
new file mode 100644
index 0000000..57cf162
--- /dev/null
+++ b/src/lib/plan/families/hemlingby.ts
@@ -0,0 +1,80 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, Vec3 } from "../../types";
+
+/**
+ * HEMLINGBY 2-seat sofa, read from its manual (still sold in Australia). The back gets three studs screwed into its
+ * underside and is lowered onto the seat; the sofa is laid on its back and the studs nutted from underneath with the
+ * box spanner. Each armrest gets three studs in its inner side, is pushed onto the seat and nutted from inside the
+ * frame, then the four legs screw in and it is stood up. Nine studs, washers and nuts in all.
+ */
+
+// IKEA's measures: 145 wide, 71.5 deep, 71.5 high, seat 42 high and 137 wide, arms 61 high, 14.5 under
+const W = 1450, D = 715, H = 715, SEAT = 420, ARM = 610, UNDER = 145, SW = 1370;
+const AW = (W - SW) / 2, BT = 190; // arm width, back thickness
+
+type Kind = CustomFix["kind"];
+const fx = (kind: Kind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const STUD = { len: 70, dia: 8, name: "Threaded stud" };
+const WASHER = { len: 2, dia: 20 };
+const NUT = { len: 7, dia: 8 };
+
+function sofa(): CustomParams {
+ const xs = SW / 2;
+ const zb = -D / 2 + BT / 2;
+ const parts: CustomPart[] = [
+ { id: "S", name: "Seat", size: [SW, SEAT - UNDER, D], pos: [0, (SEAT + UNDER) / 2, 0], material: "soft" },
+ { id: "B", name: "Back", size: [SW, H - SEAT, BT], pos: [0, (H + SEAT) / 2, zb], material: "soft" },
+ { id: "AL", name: "Armrest", size: [AW, ARM - UNDER, D], pos: [-xs - AW / 2, (ARM + UNDER) / 2, 0], material: "soft" },
+ { id: "AR", name: "Armrest", size: [AW, ARM - UNDER, D], pos: [xs + AW / 2, (ARM + UNDER) / 2, 0], material: "soft" },
+ ...[-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz, j): CustomPart => ({ id: `L${sx < 0 ? 0 : 1}${j}`, name: "Leg", shape: "cyl", size: [50, UNDER, 50], pos: [sx * (xs - 70), UNDER / 2, sz * (D / 2 - 70)], material: "wood" })),
+ ),
+ ];
+ const backStuds: Vec3[] = [-450, 0, 450].map((x) => [x, SEAT, zb]);
+ const backNuts: Vec3[] = backStuds.map((p) => [p[0], SEAT - 60, p[2]]);
+ const armStuds = (sx: number): Vec3[] => [[sx * xs, 300, -200], [sx * xs, 300, 200], [sx * xs, 200, 0]];
+ const armNuts = (sx: number): Vec3[] => armStuds(sx).map((p) => [p[0] - sx * 60, p[1], p[2]]);
+ const legs = parts.filter((p) => p.name === "Leg").map((p) => p.id);
+ const steps: CustomStep[] = [
+ {
+ title: "Screw three studs into the bottom of the back",
+ detail: "By hand, until they stop.",
+ fix: [fx("stud", backStuds, [0, -1, 0], { ...STUD, on: "B", mate: "S" })],
+ add: ["S"],
+ wait: ["B"],
+ },
+ { title: "Lower the back onto the seat", detail: "The studs go down through the holes at the back of the seat.", add: ["B"], from: { B: [0, 400, 0] } },
+ { title: "Lay the sofa on its back", detail: "On a rug, so you can reach under the seat. Push the back hard against the seat so they line up.", pose: "+z", warnings: ["floor"] },
+ {
+ title: "Nut the back on from underneath",
+ detail: "A washer and a nut on each stud, tightened with the box spanner. The back's lower edge sits flush with the seat's.",
+ fix: [fx("washer", backNuts, [0, 1, 0], { ...WASHER, on: "S" }), fx("nut", backNuts, [0, 1, 0], { ...NUT, on: "S", mate: "B" })],
+ tools: ["wrench"],
+ },
+ {
+ title: "Screw three studs into each armrest",
+ detail: "Into the inner side, by hand.",
+ fix: [-1, 1].map((sx) => fx("stud", armStuds(sx), [sx, 0, 0], { ...STUD, on: sx < 0 ? "AL" : "AR", mate: "S" })),
+ wait: ["AL", "AR"],
+ },
+ {
+ title: "Bolt the armrests on",
+ detail: "Push each one onto the side of the seat, studs through the frame, then a washer and a nut on each from inside with the box spanner.",
+ add: ["AL", "AR"],
+ from: { AL: [-350, 0, 0], AR: [350, 0, 0] },
+ fix: [-1, 1].flatMap((sx) => [fx("washer", armNuts(sx), [-sx, 0, 0], { ...WASHER, on: "S" }), fx("nut", armNuts(sx), [-sx, 0, 0], { ...NUT, on: "S", mate: sx < 0 ? "AL" : "AR" })]),
+ tools: ["wrench"],
+ },
+ { title: "Screw in the legs", detail: "Four, clockwise by hand until each one is snug.", add: legs },
+ { title: "Stand the sofa up", detail: "Lift it by the frame, never by the legs.", pose: "+y" },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["HEMLINGBY"],
+ recipe(s) {
+ return /hemlingby-2-seat-sofa/.test(s.slug ?? "") ? sofa() : null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/hemnes.ts b/src/lib/plan/families/hemnes.ts
index 154a0ae..67d52a5 100644
--- a/src/lib/plan/families/hemnes.ts
+++ b/src/lib/plan/families/hemnes.ts
@@ -3,6 +3,10 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, Pose, ProductSpec
import { HW, PlanBuilder, type FitOpts, type HwDef } from "../builder";
import { rotate } from "../math";
import { buildCustom } from "../custom";
+import { hemnesBeds } from "./_hemnes-beds";
+import { hemnesTables } from "./_hemnes-tables";
+import { hemnesCabinets } from "./_hemnes-cabinets";
+import { hemnesStorage } from "./_hemnes-storage";
/*
* HEMNES, read from IKEA's manuals.
@@ -125,7 +129,7 @@ function drawers(b: PlanBuilder, list: DrawerBox[], o: { support?: boolean; name
const lT = b.part("Liner board", [8, sh - 60, dd - 40]);
d.liners = [b.place(lT, [box.x - xs + st / 2 + 4, ys + 16 + (sh - 60) / 2, zd]), b.place(lT, [box.x + xs - st / 2 - 4, ys + 16 + (sh - 60) / 2, zd])];
}
- if (o.support && box.w > 700) d.support = b.place(b.part("Bottom support rail", [24, 10, dd - 20], { material: "metal" }), [box.x, ys - 5, zd]);
+ if (o.support && box.w > 700) d.support = b.place(b.part("Bottom support rail", [24, 10, dd - 20], { material: "metal" }), [box.x, ys + 3.5, zd]);
return d;
});
@@ -144,7 +148,7 @@ function drawers(b: PlanBuilder, list: DrawerBox[], o: { support?: boolean; name
cams: per((g, sd) => [ys + 20, ys + sh - 20].map((y): FitOpts => ({ on: sd, at: [box.x + g * (xs - st / 2), y, zIn - 28], dir: [g, 0, 0] }))),
nails: per((g, sd) => nails.map((k): FitOpts => ({ on: sd, at: [box.x + g * (xs + st / 2), ys + 16 + (sh - 16) * k, zBk], dir: [-g, 0, 0], mate: d.back }))),
support: d.support
- ? [zIn - 30, zIn - dd + 30].map((z): FitOpts => ({ on: d.support!, at: [box.x, ys - 10, z], dir: [0, 1, 0], mate: d.bottom }))
+ ? [zIn - 30, zIn - dd + 30].map((z): FitOpts => ({ on: d.support!, at: [box.x, ys - 1.5, z], dir: [0, 1, 0], mate: d.bottom }))
: [],
runners: per((g, sd) => [{ on: sd, at: [box.x + g * xs, ys, zIn - 10 - runLen / 2], dir: [0, 1, 0], hole: false } as FitOpts]),
runnerScrews: per((g, sd) => [zIn - 40, zIn - runLen + 20].map((z): FitOpts => ({ on: sd, at: [box.x + g * xs, ys - 2, z], dir: [0, 1, 0] }))),
@@ -394,7 +398,7 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
const panelD = zpf - zpb - P + 20;
const sidePanelT = b.part("Side panel", [panelT, panelH, panelD]);
// never a zero-thickness board where the panel already meets the runner line
- const spT = Math.max(2, xi - (panelX - panelT / 2) < 0 ? 0 : panelX - panelT / 2 - xi);
+ const spT = Math.max(2, panelX - panelT / 2 - xi);
const spacerT = f.spacer ? b.part("Spacer board", [spT, panelH - 20, panelD - 24]) : "";
const panelY = legH + panelH / 2;
const posts = [0, 1].map((i) => [b.place(postT, [sg(i) * xp, postH / 2, zpf]), b.place(postT, [sg(i) * xp, postH / 2, zpb])]);
@@ -444,8 +448,9 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
const runLen = Math.round((zf - zb - 60) / 10) * 10;
const runner = runnerDef(runLen);
const runnerOn = (i: number) => (f.spacer ? spacers[i] : panels[i]);
- const runners = (i: number): FitOpts[] => ops.map((o) => ({ on: runnerOn(i), at: [sg(i) * xi, o.y0 + 8, zf - 20 - runLen / 2], dir: [sg(i), 0, 0], hole: false }));
- const runnerScrews = (i: number): FitOpts[] => ops.flatMap((o) => [zf - 50, zf - runLen + 10].map((z): FitOpts => ({ on: runnerOn(i), at: [sg(i) * xi, o.y0 + 8, z], dir: [sg(i), 0, 0] })));
+ const xRun = f.spacer ? xi : panelX - panelT / 2; // the face the runners screw onto
+ const runners = (i: number): FitOpts[] => ops.map((o) => ({ on: runnerOn(i), at: [sg(i) * xRun, o.y0 + 8, zf - 20 - runLen / 2], dir: [sg(i), 0, 0], hole: false }));
+ const runnerScrews = (i: number): FitOpts[] => ops.flatMap((o) => [zf - 50, zf - runLen + 10].map((z): FitOpts => ({ on: runnerOn(i), at: [sg(i) * xRun, o.y0 + 8, z], dir: [sg(i), 0, 0] })));
// the middle frame of a two-column chest: front and back stiles with a bar under each opening carrying runners
const stileB = railYs[railYs.length - 1].y + f.botRail / 2, stileT = tops - f.topRail;
@@ -461,7 +466,8 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
// small dividers between the two little drawers at the top of each column
const colW = two ? halfW : 2 * xi;
const colX = (c: number) => (two ? (c ? 1 : -1) * (MS / 2 + halfW / 2) : 0);
- const smalls = f.topSplit ? [0, 1].map((c) => b.place(b.part("Small divider", [18, ops[0].h, zr - railD / 2 - (zb + 24)], { material: "board" }), [colX(c), ops[0].y0 + ops[0].h / 2, (zr - railD / 2 + zb + 24) / 2])) : [];
+ // they reach forward under the rails (just behind the drawer fronts), where the long screws hold them
+ const smalls = f.topSplit ? [0, 1].map((c) => b.place(b.part("Small divider", [18, ops[0].h, zf - 20 - (zb + 24)], { material: "board" }), [colX(c), ops[0].y0 + ops[0].h / 2, (zf - 20 + zb + 24) / 2])) : [];
// where the side joins: posts and panel
const panelYs = spread(legH + 60, postH - 60, f.postBolts);
@@ -510,23 +516,34 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
const pivot = (i: number): Vec3 => [sg(i) * xp, postH / 2, 0];
const lay = (i: number): Vec3 => [(i === 0 ? -1 : 1) * (D / 2 + 80), P / 2, 0];
const layRot = (i: number): Vec3 => [0, Math.PI / 2, i === 0 ? Math.PI / 2 : -Math.PI / 2];
+ const off = (i: number, dz: number): Vec3 => {
+ const r = rotate([0, 0, dz], layRot(i));
+ const l = lay(i);
+ return [l[0] + r[0], l[1] + r[1], l[2] + r[2]];
+ };
step(
b,
{ title: "Screw the cam bolts into the four corner posts", detail: "Lay them on a rug, marked ends together. Screw each bolt in by hand until it stops.", tools: ["screwdriver"], scene: "side", kind: "cams", warnings: ["floor"] },
() => {
b.stagger(0.12);
- for (const i of [0, 1]) stageGroup(b, posts[i], pivot(i), layRot(i), lay(i));
+ // the back post lies a little apart until the panel is on the front one
+ for (const i of [0, 1]) {
+ stageGroup(b, [posts[i][0]], pivot(i), layRot(i), lay(i));
+ stageGroup(b, [posts[i][1]], pivot(i), layRot(i), off(i, -400));
+ }
b.then(0.15);
b.fits(CAM_BOLT, [...postBolts(0), ...postBolts(1)], 0.05);
},
);
step(
b,
- { title: "Join each side panel to its two posts", detail: "Tap the dowels into the posts, then push the panel between them onto the dowels and bolts.", tools: ["hammer"], scene: "side", kind: "dowels" },
+ { title: "Join each side panel to its two posts", detail: "Tap the dowels into the posts. Push the panel onto the front post, then push the back post onto the panel.", tools: ["hammer"], scene: "side", kind: "dowels" },
() => {
b.fits(DOWEL, [...panelDowels(0), ...panelDowels(1)], 0.06);
b.then(0.15);
- for (const i of [0, 1]) stageGroup(b, [panels[i]], pivot(i), layRot(i), lay(i));
+ for (const i of [0, 1]) stageGroup(b, [panels[i]], pivot(i), layRot(i), lay(i), rotate([0, 0, -200], layRot(i)));
+ b.then(0.1);
+ for (const i of [0, 1]) stageGroup(b, [posts[i][1]], pivot(i), layRot(i), lay(i), [0, 0, 0]);
},
);
step(b, { title: "Lock the cam locks in the side panels", detail: "Arrow towards the bolt, then turn clockwise until each one pulls tight.", tools: ["screwdriver"], scene: "side", kind: "cams" }, () =>
@@ -596,11 +613,21 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
]);
const midBolts: FitOpts[] = mid.bars.map((k, i) => ({ on: mid.front, at: [0, ops[i].y0 - 2, zr - railD / 2], dir: [0, 0, 1], mate: k, mateHole: 4 }));
step(b, { title: "Put the middle frame together", detail: "On a rug: the runner bars go between the two stiles on dowels and cam bolts.", tools: ["hammer", "screwdriver"], scene: "mid", kind: "join" }, () => {
+ // flat on the rug: the bars push onto the front stile along their dowels, then the back stile goes on
+ const mp: Vec3 = [0, (tops + legH) / 2, 0], mr: Vec3 = [0, Math.PI / 2, Math.PI / 2];
+ const along = (dz: number): Vec3 => rotate([0, 0, dz], mr);
+ const at0 = (dz: number): Vec3 => { const a = along(dz); return [a[0], MS / 2 + a[1], a[2]]; };
b.stagger(0.12);
- stageGroup(b, midKeys, [0, (tops + legH) / 2, 0], [0, Math.PI / 2, Math.PI / 2], [0, MS / 2, 0]);
+ stageGroup(b, [mid.front], mp, mr, at0(0), along(200));
+ stageGroup(b, mid.bars, mp, mr, at0(-260));
+ stageGroup(b, [mid.back], mp, mr, at0(-520));
b.then(0.15);
- b.fits(DOWEL, midDowels, 0.06);
b.fits(CAM_BOLT, midBolts, 0.06);
+ b.fits(DOWEL, midDowels, 0.06);
+ b.then(0.15);
+ stageGroup(b, mid.bars, mp, mr, at0(0), [0, 0, 0]);
+ b.then(0.1);
+ stageGroup(b, [mid.back], mp, mr, at0(0), [0, 0, 0]);
});
step(b, { title: "Screw the runners onto the middle frame", detail: "A runner on each face of every bar, two screws each.", tools: ["screwdriver"], scene: "mid", kind: "runners" }, () => {
b.fits(runner, midRunners, 0.15);
@@ -650,8 +677,8 @@ function postChest(b: PlanBuilder, s: ProductSpec, f: PostFrame) {
rn.push({ on: k, at: [colX(c) + g * 9, y0 + 8, zf - 20 - runLen / 2], dir: [-g, 0, 0], hole: false });
for (const z of [zf - 50, zf - runLen + 10]) rs.push({ on: k, at: [colX(c) + g * 9, y0 + 8, z], dir: [-g, 0, 0] });
}
- ls.push({ on: rails[0], at: [colX(c), tops - f.topRail, zr], dir: [0, -1, 0], mate: k });
- ls.push({ on: rails[1] === railsR[1] ? rails[1] : c ? railsR[1] : rails[1], at: [colX(c), y0, zr], dir: [0, 1, 0], mate: k });
+ ls.push({ on: rails[0], at: [colX(c), tops, zf - 30], dir: [0, -1, 0], mate: k });
+ ls.push({ on: c ? railsR[1] : rails[1], at: [colX(c), y0 - f.midRail, zf - 30], dir: [0, 1, 0], mate: k });
});
b.fits(runner, rn, 0.12);
b.fits(RUNNER_SCREW, rs, 0.05);
@@ -906,7 +933,7 @@ function boardDrawers(b: PlanBuilder, list: BoardBox[], o: { insert?: boolean; l
stage(a, [0, 200, 0]);
stage(c, [0, 200, 0]);
b.then(0.15);
- b.fits({ kind: "screw", len: 30, dia: 4 }, [{ on: a, at: [d.box.x - 0, d.ys + 30, z + 6], dir: [0, 0, -1], mate: c }, { on: a, at: [d.box.x, d.ys + 55, z + 6], dir: [0, 0, -1], mate: c }, { on: d.bottom, at: [d.box.x - L / 3, d.ys + 12, z], dir: [0, -1, 0], mate: a }, { on: d.bottom, at: [d.box.x + L / 3, d.ys + 12, z], dir: [0, -1, 0], mate: a }], 0.12);
+ b.fits({ kind: "screw", len: 30, dia: 4 }, [{ on: a, at: [d.box.x - 0, d.ys + 30, z + 6], dir: [0, 0, -1], mate: c }, { on: a, at: [d.box.x, d.ys + 55, z + 6], dir: [0, 0, -1], mate: c }, { on: d.bottom, at: [d.box.x - L / 3, d.ys, z], dir: [0, 1, 0], mate: a }, { on: d.bottom, at: [d.box.x + L / 3, d.ys, z], dir: [0, 1, 0], mate: a }], 0.12);
});
}
step(b, { title: n > 1 ? "Click the drawers onto the runners" : "Click the drawer onto the runners", detail: "Pull the runners out, set the drawer on them and push it back until both clips click.", kind: "drawer" }, () => {
@@ -949,7 +976,7 @@ function washStand(b: PlanBuilder, s: ProductSpec) {
const xo = W / 2 - (basin ? 10 : 0), xp = xo - P / 2, xi = xo - P;
const zf = D / 2 - (basin ? 20 : 0), zb = -D / 2 + (basin ? 10 : 0);
const zpf = zf - P / 2, zpb = zb + P / 2, zm = (zpf + zpb) / 2;
- const legH = 110, botRail = 50, topRail = 70, midRail = 25;
+ const legH = 110, botRail = 50, topRail = 70, midRail = 45;
const sideD = zpf - zpb - P;
const g = (L: string) => (L === "L" ? -1 : 1);
for (const L of ["L", "R"]) {
@@ -981,27 +1008,41 @@ function washStand(b: PlanBuilder, s: ProductSpec) {
];
const yDr = [H - topRail - h1, legH + botRail];
const runLen = Math.round((sideD - 20) / 10) * 10;
+ const xr = xo - 20; // inside face of the side panel, where the runners screw on
+ // the brackets sit on the back posts between the back rail and the back board, clear of their bolts
+ const hangY = [H - 130, legH + 200];
const hangers = (L: string) => [
- at("angle", `pb${L}`, [g(L), 0, 0], [[g(L) * xi, H - 60, zpb], [g(L) * xi, legH + 60, zpb]], undefined, { len: 70, dia: 50 }),
- at("screw", `pb${L}`, [g(L), 0, 0], [H - 85, H - 35, legH + 35, legH + 85].map((y): Vec3 => [g(L) * xi, y, zpb]), undefined, sized(RUNNER_SCREW)),
+ at("angle", `pb${L}`, [g(L), 0, 0], hangY.map((y): Vec3 => [g(L) * xi, y, zpb]), undefined, { len: 70, dia: 50 }),
+ at("screw", `pb${L}`, [g(L), 0, 0], hangY.flatMap((y): Vec3[] => [[g(L) * xi, y - 24, zpb], [g(L) * xi, y + 24, zpb]]), undefined, sized(RUNNER_SCREW)),
];
const runners = (L: string) => [
- at("runner", `sp${L}`, [g(L), 0, 0], yDr.map((y): Vec3 => [g(L) * xi, y + 12, zm]), undefined, { len: runLen, dia: 30 }),
- at("screw", `sp${L}`, [g(L), 0, 0], yDr.flatMap((y): Vec3[] => [[g(L) * xi, y + 12, zm + runLen / 2 - 40], [g(L) * xi, y + 12, zm - runLen / 2 + 40]]), undefined, sized(RUNNER_SCREW)),
+ at("runner", `sp${L}`, [g(L), 0, 0], yDr.map((y): Vec3 => [g(L) * xr, y + 12, zm]), undefined, { len: runLen, dia: 30 }),
+ at("screw", `sp${L}`, [g(L), 0, 0], yDr.flatMap((y): Vec3[] => [[g(L) * xr, y + 12, zm + runLen / 2 - 40], [g(L) * xr, y + 12, zm - runLen / 2 + 40]]), undefined, sized(RUNNER_SCREW)),
];
+ // each rail end: a cam bolt below and a dowel above, far enough apart not to share a hole
const rails = [
- { id: "rt", y: H - topRail / 2, z: zr, n: 1, post: "pf" },
- { id: "rm", y: H - topRail - h1 - midRail / 2, z: zr, n: 1, post: "pf" },
- { id: "rb", y: legH + botRail / 2, z: zr, n: 1, post: "pf" },
- { id: "bt", y: H - 45, z: zb + 9, n: 1, post: "pb" },
- { id: "bb", y: legH + 80, z: zb + 8, n: 2, post: "pb" },
+ { id: "rt", y: H - topRail / 2, h: topRail, z: zr, n: 1, post: "pf", o: 15 },
+ { id: "rm", y: H - topRail - h1 - midRail / 2, h: midRail, z: zr, n: 1, post: "pf", o: 12 },
+ { id: "rb", y: legH + botRail / 2, h: botRail, z: zr, n: 1, post: "pf", o: 12 },
+ { id: "bt", y: H - 45, h: 90, z: zb + 9, n: 1, post: "pb", o: 20 },
+ { id: "bb", y: legH + 80, h: 160, z: zb + 8, n: 2, post: "pb", o: 45 },
];
- const camBolts = (L: string) => rails.map((q) => at("camScrew", `${q.post}${L}`, [g(L), 0, 0], q.n === 2 ? [[g(L) * xi, q.y - 45, q.z], [g(L) * xi, q.y + 45, q.z]] : [[g(L) * xi, q.y, q.z]], q.id, { len: 34 }));
- const dowelsIn = (L: string, ids: string[]) => rails.filter((q) => ids.includes(q.id)).map((q) => at("dowel", q.id, [-g(L), 0, 0], [[g(L) * xi, q.y + (q.n === 2 ? 0 : 8), q.z + (q.n === 2 ? 0 : 0)]], `${q.post}${L}`, sized(DRAWER_DOWEL)));
+ const camBolts = (L: string) => rails.map((q) => at("camScrew", `${q.post}${L}`, [g(L), 0, 0], q.n === 2 ? [[g(L) * xi, q.y - q.o, q.z], [g(L) * xi, q.y + q.o, q.z]] : [[g(L) * xi, q.y - q.o, q.z]], q.id, { len: 34 }));
+ const dowelsIn = (L: string, ids: string[]) => rails.filter((q) => ids.includes(q.id)).map((q) => at("dowel", q.id, [-g(L), 0, 0], [[g(L) * xi, q.n === 2 ? q.y : q.y + q.o, q.z]], `${q.post}${L}`, sized(DRAWER_DOWEL)));
const cams = (L: string) =>
- rails.map((q) => at("cam", q.id, q.n === 2 ? [0, 0, -1] : [0, -1, 0], q.n === 2 ? [[g(L) * (xi - 26), q.y - 45, q.z + 8], [g(L) * (xi - 26), q.y + 45, q.z + 8]] : [[g(L) * (xi - 26), q.y + (q.id === "rm" ? 12 : q.id === "bt" ? 45 : q.id === "rt" ? 35 : 25), q.z]], undefined, { dia: 15 }));
+ rails.map((q) => at("cam", q.id, q.n === 2 || q.id === "bt" ? [0, 0, -1] : [0, -1, 0], q.n === 2 ? [[g(L) * (xi - 26), q.y - q.o, q.z + 8], [g(L) * (xi - 26), q.y + q.o, q.z + 8]] : q.id === "bt" ? [[g(L) * (xi - 26), q.y - q.o, q.z + 9]] : [[g(L) * (xi - 26), q.y + q.h / 2, q.z]], undefined, { dia: 15 }));
- r.step({ title: "Join the side rails to the posts", detail: "Do both sides on a rug. Tap the dowels into the rails, slide the panel into the grooves, then two long screws with the Allen key.", add: side("L"), fix: [...railDowels("L"), ...longScrews("L")], tools: ["hammer", "allen"], pose: "+x", repeat: 2, warnings: ["floor"] });
+ r.step({
+ title: "Join the side rails to the posts",
+ detail: "Do both sides on a rug. Tap the dowels into the rails, push them into the front post, slide the panel into the grooves, then push the back post on and drive the two long screws.",
+ add: side("L"),
+ fix: [...railDowels("L"), ...longScrews("L")],
+ from: { pfL: [0, 0, 260], stL: [0, 0, -260], sbL: [0, 0, -260], spL: [0, 0, -320], pbL: [0, 0, -380] },
+ tools: ["hammer", "allen"],
+ pose: "+x",
+ repeat: 2,
+ warnings: ["floor"],
+ });
r.step({ title: "Screw the hanging brackets to the back posts", detail: "Two on each side, on the inside. They hold it to the wall later.", fix: hangers("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
r.step({ title: "Screw the runners onto the sides", detail: "Two on each side, the ones marked for that side, two screws in each.", fix: runners("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
r.step({ title: "Screw in the cam bolts", detail: "Six in each side, into the inside faces of the posts, by hand.", fix: camBolts("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
@@ -1012,7 +1053,7 @@ function washStand(b: PlanBuilder, s: ProductSpec) {
title: "Lower the right side on",
detail: "It has its rails, brackets, runners and bolts like the left one. Dowels in the free rail ends, then press it on evenly.",
add: side("R"),
- fix: [...dowelsIn("R", rails.map((q) => q.id)), ...railDowels("R"), ...longScrews("R"), ...hangers("R"), ...runners("R"), ...camBolts("R")],
+ fix: [...railDowels("R"), ...longScrews("R"), ...hangers("R"), ...runners("R"), ...camBolts("R"), ...dowelsIn("R", rails.map((q) => q.id))],
tools: ["hammer"],
pose: "+x",
});
@@ -1021,7 +1062,7 @@ function washStand(b: PlanBuilder, s: ProductSpec) {
r.step({
title: "Hang it on the wall",
detail: "Screw the four wall plates on at the height in the drawing (screws not included: pick ones for your wall), hang the brackets on them and turn the feet down to the floor.",
- fix: [at("bracket", "pbL", [0, 0, -1], [[-xi + 20, H - 60, zb - 2], [-xi + 20, legH + 60, zb - 2]], undefined, { len: 40, dia: 30 }), at("bracket", "pbR", [0, 0, -1], [[xi - 20, H - 60, zb - 2], [xi - 20, legH + 60, zb - 2]], undefined, { len: 40, dia: 30 })],
+ fix: [at("bracket", "pbL", [0, 0, -1], hangY.map((y): Vec3 => [-xi + 20, y, zb - 2]), undefined, { len: 40, dia: 30 }), at("bracket", "pbR", [0, 0, -1], hangY.map((y): Vec3 => [xi - 20, y, zb - 2]), undefined, { len: 40, dia: 30 })],
wall: true,
tools: ["drill", "screwdriver", "level", "pencil"],
warnings: ["wall", "tip"],
@@ -1067,10 +1108,13 @@ function openStand(b: PlanBuilder, s: ProductSpec) {
const g = (L: string) => (L === "L" ? -1 : 1);
const shelfY = 140, railH = 40, topRail = topPanel ? 0 : 60;
const drH = topPanel ? 190 : Math.round((postH * 0.55 - topRail - railH * rows) / rows);
+ // the top side rail is a wide board as deep as the drawers: their runners screw onto it
+ const stH = topPanel ? drH : postH - (postH - topRail - rows * (drH + railH)) - railH;
+ const stY = postH - stH / 2;
for (const L of ["L", "R"]) {
r.part(`pf${L}`, "Post", [P, postH, P], [g(L) * xp, postH / 2, zpf], { material: "wood" });
r.part(`pb${L}`, "Post", [P, postH, P], [g(L) * xp, postH / 2, zpb], { material: "wood" });
- r.part(`st${L}`, "Side rail", [P - 10, 70, sideD], [g(L) * xp, postH - 35, zm], { material: "wood" });
+ r.part(`st${L}`, "Side rail", [P - 10, stH, sideD], [g(L) * xp, stY, zm], { material: "wood" });
r.part(`sb${L}`, "Side rail", [P - 10, 50, sideD], [g(L) * xp, shelfY - 25, zm], { material: "wood" });
}
const zr = zf - 10;
@@ -1100,8 +1144,8 @@ function openStand(b: PlanBuilder, s: ProductSpec) {
if (topPanel) r.part("top", "Top", [W, topT, D], [0, H - topT / 2, 0]);
const side = (L: string) => [`pf${L}`, `pb${L}`, `st${L}`, `sb${L}`];
const ladder = (L: string) => [
- at("dowel", `st${L}`, [0, 0, -1], [[g(L) * xp, postH - 35, zpf - P / 2]], `pf${L}`, sized(DRAWER_DOWEL)),
- at("dowel", `st${L}`, [0, 0, 1], [[g(L) * xp, postH - 35, zpb + P / 2]], `pb${L}`, sized(DRAWER_DOWEL)),
+ at("dowel", `st${L}`, [0, 0, -1], [[g(L) * xp, stY, zpf - P / 2]], `pf${L}`, sized(DRAWER_DOWEL)),
+ at("dowel", `st${L}`, [0, 0, 1], [[g(L) * xp, stY, zpb + P / 2]], `pb${L}`, sized(DRAWER_DOWEL)),
at("dowel", `sb${L}`, [0, 0, -1], [[g(L) * xp, shelfY - 25, zpf - P / 2]], `pf${L}`, sized(DRAWER_DOWEL)),
];
const bolts = (L: string) => [
@@ -1116,10 +1160,20 @@ function openStand(b: PlanBuilder, s: ProductSpec) {
];
const runLen = Math.round((sideD - 10) / 10) * 10;
const runners = (L: string) => [
- at("runner", `st${L}`, [g(L), 0, 0], ops.map((yy): Vec3 => [g(L) * xi, yy + 15, zm]), undefined, { len: runLen, dia: 30 }),
- at("screw", `st${L}`, [g(L), 0, 0], ops.flatMap((yy): Vec3[] => [[g(L) * xi, yy + 15, zm - runLen / 2 + 40], [g(L) * xi, yy + 15, zm + runLen / 2 - 40]]), undefined, sized(RUNNER_SCREW)),
+ at("runner", `st${L}`, [g(L), 0, 0], ops.map((yy): Vec3 => [g(L) * (xi + 5), yy + 15, zm]), undefined, { len: runLen, dia: 30 }),
+ at("screw", `st${L}`, [g(L), 0, 0], ops.flatMap((yy): Vec3[] => [[g(L) * (xi + 5), yy + 15, zm - runLen / 2 + 40], [g(L) * (xi + 5), yy + 15, zm + runLen / 2 - 40]]), undefined, sized(RUNNER_SCREW)),
];
- r.step({ title: "Put the two side ladders together", detail: "Do both on a rug: tap the dowels into the rails and press the posts on.", add: side("L"), fix: ladder("L"), tools: ["hammer"], pose: "+x", repeat: 2, warnings: ["floor"] });
+ r.step({
+ title: "Put the two side ladders together",
+ detail: "Do both on a rug: tap the dowels into the rails, push them into the front post, then press the back post on.",
+ add: side("L"),
+ fix: ladder("L"),
+ from: { pfL: [0, 0, 260], stL: [0, 0, -260], sbL: [0, 0, -260], pbL: [0, 0, -380] },
+ tools: ["hammer"],
+ pose: "+x",
+ repeat: 2,
+ warnings: ["floor"],
+ });
r.step({ title: "Screw in the cam bolts", detail: "Into the inside faces of the posts and the bottom rails, by hand.", fix: bolts("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
r.step({
title: "Tap the dowels into the slatted shelf",
@@ -1131,7 +1185,7 @@ function openStand(b: PlanBuilder, s: ProductSpec) {
r.step({ title: "Stand the rails in the left side", detail: "It stays on the rug. Push each rail onto its bolts.", add: [...fr.map((q) => q.id), "bt"], pose: "+x" });
r.step({ title: "Stand the slatted shelf in", detail: "Its ends go onto the bolts in the bottom rail.", add: ["sh"], pose: "+x" });
r.step({ title: "Lock the cam locks", detail: "Arrow towards the bolt, then a clockwise turn.", fix: cams("L"), tools: ["screwdriver"], pose: "+x" });
- r.step({ title: "Lower the right side on", detail: "It has its dowels and bolts in like the left one. Press it down evenly.", add: side("R"), fix: [...ladder("R"), ...bolts("R")], pose: "+x" });
+ r.step({ title: "Lower the right side on", detail: "It has its dowels and bolts in like the left one. Press it down evenly.", add: side("R"), fix: [...ladder("R"), ...bolts("R")], from: { pfR: [300, 0, 0], pbR: [300, 0, 0], stR: [300, 0, 0], sbR: [300, 0, 0] }, pose: "+x" });
r.step({ title: "Lock the cam locks on this side", detail: "Arrow towards the bolt, then a clockwise turn.", fix: cams("R"), tools: ["screwdriver"], pose: "+x" });
if (cols === 2) r.step({ title: "Fit the middle post", detail: "Between the front rails, on its dowels, with a screw at each end.", add: ["mid"], fix: [at("screw", "fr" + (rows - 1), [0, 1, 0], [[0, y, zr]], "mid", sized(TOP_SCREW))], tools: ["allen"] });
r.step({ title: "Screw in the adjustable feet", detail: "One under each post, by hand.", fix: ["L", "R"].flatMap((L) => [at("foot", `pf${L}`, [0, 1, 0], [[g(L) * xp, 0, zpf]]), at("foot", `pb${L}`, [0, 1, 0], [[g(L) * xp, 0, zpb]])]), pose: "+y", kind: "legs" });
@@ -1329,7 +1383,8 @@ function bookcase(s: ProductSpec): CustomParams | null {
r.part("bp", "Back plinth", [2 * xi, plinth, 20], [0, legH + plinth / 2, zbr], { material: "wood" });
r.part("ft", "Top rail", [2 * xi, topRail, 20], [0, postH - topRail / 2, zr], { material: "wood" });
r.part("bt", "Top rail", [2 * xi, topRail, 20], [0, postH - topRail / 2, zbr], { material: "wood" });
- r.part("fx", "Fixed shelf", [2 * xi, 20, zf - zb - 26], [0, midY, (zf + zb) / 2 + 2]);
+ // in front of the back panels, which run behind it from the plinth to the top rail
+ r.part("fx", "Fixed shelf", [2 * xi, 20, zf - zb - 26], [0, midY, (zf + zb + 26) / 2]);
r.part("top", "Top", [W, topT, D], [0, H - topT / 2, 0], { material: "wood" });
const bkW = xi, bkH = postH - topRail - (legH + plinth);
r.part("bk1", "Back panel", [bkW, bkH, 4], [-xi / 2, legH + plinth + bkH / 2, zb + 24], { material: "wood" });
@@ -1343,12 +1398,12 @@ function bookcase(s: ProductSpec): CustomParams | null {
const g = (L: string) => (L === "L" ? -1 : 1);
// cam bolts in the posts for the plinths and top rails, and in the side rails for the fixed shelf
const postBolts = (L: string) => [
- at("camScrew", `pf${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2, zr], [g(L) * xi, postH - topRail / 2, zr]], undefined, { len: 34 }),
- at("camScrew", `pb${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2, zbr], [g(L) * xi, postH - topRail / 2, zbr]], undefined, { len: 34 }),
+ at("camScrew", `pf${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2 - 15, zr], [g(L) * xi, postH - topRail / 2 - 12, zr]], undefined, { len: 34 }),
+ at("camScrew", `pb${L}`, [g(L), 0, 0], [[g(L) * xi, legH + plinth / 2 - 15, zbr], [g(L) * xi, postH - topRail / 2 - 12, zbr]], undefined, { len: 34 }),
];
const railDowels = (L: string, ids: string[]) =>
ids.map((id) => {
- const y = id.endsWith("p") ? legH + plinth / 2 + 20 : postH - topRail / 2 + 15;
+ const y = id.endsWith("p") ? legH + plinth / 2 + 15 : postH - topRail / 2 + 12;
const z = id.startsWith("f") ? zr : zbr;
return at("dowel", id, [-g(L), 0, 0], [[g(L) * xi, y, z]], id.startsWith("f") ? `pf${L}` : `pb${L}`, sized(DOWEL));
});
@@ -1429,9 +1484,10 @@ function bookcase(s: ProductSpec): CustomParams | null {
title: "Lower the right side on",
detail: "It has its bolts, rails and feet on like the left one. Tap a dowel into each free rail end, then two people press it down evenly.",
add: [...side("R"), "srR", "brR"],
+ from: Object.fromEntries([...side("R"), "srR", "brR"].map((k) => [k, [360, 0, 0] as Vec3])),
fix: [
- ...railDowels("R", ["fp", "bp", "ft", "bt"]),
...postBolts("R"),
+ ...railDowels("R", ["fp", "bp", "ft", "bt"]),
...railEnds("R"),
at("screw", "pfR", [0, 0, -1], [[xo - P / 2 - 5, midY, zpf + P / 2], [xo - P / 2 - 5, legH + plinth / 2, zpf + P / 2]], undefined, sized(TOP_SCREW)),
at("screw", "pbR", [0, 0, 1], [[xo - P / 2 - 5, midY, zpb - P / 2]], "srR", sized(TOP_SCREW)),
@@ -1475,12 +1531,13 @@ function bookcase(s: ProductSpec): CustomParams | null {
title: "Clip the back panels in place",
detail: "Nine clips: three to the fixed shelf, the rest to the top rail and the plinth. A screw in each.",
fix: [
- at("clip", "fx", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, midY, zb + 22]), undefined, { len: 12, dia: 20 }),
- at("clip", "bt", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, postH - topRail - 4, zb + 22]), undefined, { len: 12, dia: 20 }),
- at("clip", "bp", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, legH + plinth + 4, zb + 22]), undefined, { len: 12, dia: 20 }),
- at("screw", "fx", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, midY, zb + 21]), undefined, { len: 12, dia: 3.5 }),
- at("screw", "bt", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, postH - topRail - 4, zb + 21]), undefined, { len: 12, dia: 3.5 }),
- at("screw", "bp", [0, 0, 1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, legH + plinth + 4, zb + 21]), undefined, { len: 12, dia: 3.5 }),
+ // each clip screws onto the rail or the shelf and its lip holds the panel edge
+ at("clip", "fx", [0, 1, 0], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, midY - 10, zb + 34]), undefined, { len: 12, dia: 20 }),
+ at("clip", "bt", [0, 0, -1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, postH - topRail + 12, zb + 20]), undefined, { len: 12, dia: 20 }),
+ at("clip", "bp", [0, 0, -1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, legH + plinth - 12, zb + 20]), undefined, { len: 12, dia: 20 }),
+ at("screw", "fx", [0, 1, 0], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, midY - 10, zb + 34]), undefined, { len: 12, dia: 3.5 }),
+ at("screw", "bt", [0, 0, -1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, postH - topRail + 12, zb + 20]), undefined, { len: 12, dia: 3.5 }),
+ at("screw", "bp", [0, 0, -1], spread(-xi + 100, xi - 100, 3).map((x): Vec3 => [x, legH + plinth - 12, zb + 20]), undefined, { len: 12, dia: 3.5 }),
],
tools: ["screwdriver"],
pose: "-z",
@@ -1559,6 +1616,13 @@ function ladders(o: { W: number; D: number; postH: number; P: number; ov: number
return { r, xp, xi, zpf, zpb, zm, P, postH, g, side, prep, locks };
}
+/** On the rug: the side rails push into the front post along their dowels, then the back post goes on. */
+function ladderFrom(l: Ladder): Record<string, Vec3> {
+ const o: Record<string, Vec3> = { pfL: [0, 0, 260], pbL: [0, 0, -420] };
+ for (const k of l.side("L")) if (!k.startsWith("p")) o[k] = [0, 0, -260];
+ return o;
+}
+
/** Something joined between the two sides: cam bolts in the posts (or side rails), a dowel and a cam lock at each end. */
function between(l: Ladder, L: string, id: string, pts: Vec3[], camUp = true): CustomFix[] {
const g = l.g(L);
@@ -1601,13 +1665,14 @@ function bench(s: ProductSpec): CustomParams | null {
r.part("top", "Top", [W, topT, D], [0, H - topT / 2, 0], { material: "wood" });
const railPts: Vec3[] = [[0, postH - 35, zpf + P / 2 - 11], [0, postH - 35, zpb - P / 2 + 11]];
const shPts: Vec3[] = [[0, 196, zm]];
- r.step({ title: "Put the two side ladders together", detail: "Do both on a rug: cam bolts in the posts, dowels in the side rails, press them together and lock the cam locks.", add: l.side("L"), fix: [...l.prep("L"), ...l.locks("L")], tools: ["screwdriver", "hammer"], pose: "+x", repeat: 2, warnings: ["floor"] });
+ r.step({ title: "Put the two side ladders together", detail: "Do both on a rug: cam bolts in the posts, dowels in the side rails, press them together and lock the cam locks.", add: l.side("L"), fix: [...l.prep("L"), ...l.locks("L")], from: ladderFrom(l), tools: ["screwdriver", "hammer"], pose: "+x", repeat: 2, warnings: ["floor"] });
r.step({ title: "Stand the top rails in the left side", detail: "Cam bolts in the posts, a dowel in each rail end, then push them on and lock.", add: ["rf", "rb"], fix: [betweenBolts(l, "L", railPts), ...between(l, "L", "rf", [railPts[0]]), ...between(l, "L", "rb", [railPts[1]]), betweenCams(l, "L", railPts, [0, 0, 1], 0)], tools: ["screwdriver", "hammer"], pose: "+x" });
r.step({ title: "Stand the slatted shelf in", detail: "On its dowels and cam bolts, then lock both cam locks.", add: ["sh"], fix: [betweenBolts(l, "L", [[0, 160, zm - 60], [0, 160, zm + 60]]), ...between(l, "L", "sh", [[0, 170, zm - 60], [0, 170, zm + 60]]), betweenCams(l, "L", [[0, 160, zm - 60], [0, 160, zm + 60]], [0, -1, 0], 40)], tools: ["screwdriver", "hammer"], pose: "+x" });
r.step({
title: "Lower the right side on",
detail: "Put together like the left one. Dowels in the free ends, press it on and lock the four cam locks.",
add: l.side("R"),
+ from: Object.fromEntries(l.side("R").map((k) => [k, [300, 0, 0] as Vec3])),
fix: [...l.prep("R"), ...l.locks("R"), betweenBolts(l, "R", [...railPts, [0, 160, zm - 60], [0, 160, zm + 60]]), ...between(l, "R", "rf", [railPts[0]]), ...between(l, "R", "rb", [railPts[1]]), ...between(l, "R", "sh", [[0, 170, zm - 60], [0, 170, zm + 60]]), betweenCams(l, "R", [...railPts, [0, 160, zm - 60], [0, 160, zm + 60]], [0, -1, 0], 20)],
tools: ["screwdriver", "hammer"],
pose: "+x",
@@ -1650,7 +1715,7 @@ function shelfUnit(s: ProductSpec): CustomParams | null {
const shelfYs = [Math.round(fixY + (postH - 60 - fixY) / 3), Math.round(fixY + (2 * (postH - 60 - fixY)) / 3)];
shelfYs.forEach((y, i) => r.part(`sh${i}`, "Shelf", [2 * xi - 4, 18, zpf - zpb - P], [0, y, zm]));
const ends = (y: number): Vec3[] => [[0, y, zm - 50], [0, y, zm + 50]];
- r.step({ title: "Put the two side ladders together", detail: "Do both on a rug: cam bolts in the posts, dowels in the rails, press them together and lock the cam locks.", add: l.side("L"), fix: [...l.prep("L"), ...l.locks("L")], tools: ["screwdriver", "hammer"], pose: "+x", repeat: 2, warnings: ["floor"] });
+ r.step({ title: "Put the two side ladders together", detail: "Do both on a rug: cam bolts in the posts, dowels in the rails, press them together and lock the cam locks.", add: l.side("L"), fix: [...l.prep("L"), ...l.locks("L")], from: ladderFrom(l), tools: ["screwdriver", "hammer"], pose: "+x", repeat: 2, warnings: ["floor"] });
r.step({ title: "Stand the top rails in the left side", detail: "On their dowels and cam bolts, then lock.", add: ["rf", "rb"], fix: [betweenBolts(l, "L", [[0, postH - 30, zpf + P / 2 - 10], [0, postH - 30, zpb - P / 2 + 10]]), ...between(l, "L", "rf", [[0, postH - 30, zpf + P / 2 - 10]]), ...between(l, "L", "rb", [[0, postH - 30, zpb - P / 2 + 10]]), betweenCams(l, "L", [[0, postH - 30, zpf + P / 2 - 10], [0, postH - 30, zpb - P / 2 + 10]], [0, 0, 1], 0)], tools: ["screwdriver", "hammer"], pose: "+x" });
r.step({ title: "Tap the slats into the slatted shelves", detail: "Small dowels into both ends of every slat, then press the slats into the frames.", fix: [at("dowel", "sb", [0, 0, 1], range(20).map((i): Vec3 => [-xi + 20 + ((i % 10) * (2 * xi - 40)) / 9, 176, i < 10 ? zm - 120 : zm + 120]), undefined, { len: 20, dia: 5 }), at("dowel", "sm", [0, 0, 1], range(20).map((i): Vec3 => [-xi + 20 + ((i % 10) * (2 * xi - 40)) / 9, fixY + 11, i < 10 ? zm - 120 : zm + 120]), undefined, { len: 20, dia: 5 })], tools: ["hammer"], pose: "+x" });
r.step({ title: "Stand the slatted shelves in", detail: "Two dowels and two cam bolts each, then lock them.", add: ["sb", "sm"], fix: [betweenBolts(l, "L", [...ends(165), ...ends(fixY)]), ...between(l, "L", "sb", ends(165)), ...between(l, "L", "sm", ends(fixY)), betweenCams(l, "L", [...ends(165), ...ends(fixY)], [0, -1, 0], 30)], tools: ["screwdriver", "hammer"], pose: "+x" });
@@ -1658,6 +1723,7 @@ function shelfUnit(s: ProductSpec): CustomParams | null {
title: "Lower the right side on",
detail: "Put together like the left one. Six dowels in the free ends, press it on, then lock the six cam locks.",
add: l.side("R"),
+ from: Object.fromEntries(l.side("R").map((k) => [k, [300, 0, 0] as Vec3])),
fix: [...l.prep("R"), ...l.locks("R"), betweenBolts(l, "R", [[0, postH - 30, zpf + P / 2 - 10], [0, postH - 30, zpb - P / 2 + 10], ...ends(165), ...ends(fixY)]), ...between(l, "R", "rf", [[0, postH - 30, zpf + P / 2 - 10]]), ...between(l, "R", "rb", [[0, postH - 30, zpb - P / 2 + 10]]), ...between(l, "R", "sb", ends(165)), ...between(l, "R", "sm", ends(fixY)), betweenCams(l, "R", [[0, postH - 30, zpf + P / 2 - 10], [0, postH - 30, zpb - P / 2 + 10], ...ends(165), ...ends(fixY)], [0, -1, 0], 25)],
tools: ["screwdriver", "hammer"],
pose: "+x",
@@ -1702,7 +1768,7 @@ function hatRack(s: ProductSpec): CustomParams | null {
{ shape: "box", size: [W, ft, 40], pos: [0, 0, -D / 2 + 20] },
{ shape: "box", size: [40, ft, D - 80], pos: [-W / 2 + 20, 0, 0] },
{ shape: "box", size: [40, ft, D - 80], pos: [W / 2 - 20, 0, 0] },
- { shape: "box", size: [W - 80, 10, D - 80], pos: [0, 8, 0] },
+ { shape: "box", size: [W - 80, 14, D - 80], pos: [0, -8, 0] },
],
});
for (const g of [-1, 1]) {
@@ -1721,7 +1787,7 @@ function hatRack(s: ProductSpec): CustomParams | null {
const rodY = H - ft - 130, rodZ = zb + 150;
r.part("rod", "Rail", [2 * cx + 60, 20, 20], [0, rodY, rodZ], { shape: "cyl", material: "metal" });
r.step({ title: "Screw two screws half into the shelf frame", detail: "Lay it upside down on a table, on something soft. Leave 6 mm sticking out: the consoles hook over them.", add: ["fr"], fix: [at("screw", "fr", [0, 1, 0], [[-cx, H - ft, zb + 150], [cx, H - ft, zb + 150]], undefined, { len: 16, dia: 4 })], tools: ["screwdriver"], pose: "-y", warnings: ["face"] });
- r.step({ title: "Hook the consoles on and screw them tight", detail: "Slide each one along until it locks, then two screws each.", add: ["cL", "cR"], fix: [at("screw", undefined, [0, 1, 0], [[-cx, H - ft, zb + 60], [-cx, H - ft, zb + 90], [cx, H - ft, zb + 60], [cx, H - ft, zb + 90]], undefined, { len: 14, dia: 4 })], tools: ["screwdriver"], pose: "-y" });
+ r.step({ title: "Hook the consoles on and screw them tight", detail: "Slide each one along until it locks, then two screws each.", add: ["cL", "cR"], fix: [at("screw", undefined, [0, 1, 0], [[-cx, H - ft - 3, zb + 60], [-cx, H - ft - 3, zb + 90], [cx, H - ft - 3, zb + 60], [cx, H - ft - 3, zb + 90]], undefined, { len: 14, dia: 4 })], tools: ["screwdriver"], pose: "-y" });
r.step({ title: "Stand the uprights on the frame", detail: "Two dowels, then a long screw through the frame into each upright.", add: ["uL", "uR"], fix: [at("dowel", undefined, [0, -1, 0], [[-ux, H - ft, zb + 6], [ux, H - ft, zb + 6]], "fr", sized(DOWEL)), at("screw", "fr", [0, -1, 0], [[-ux, H, zb + 14], [ux, H, zb + 14]], undefined, { len: 70, dia: 6 })], tools: ["hammer", "allen"], pose: "-y" });
r.step({ title: "Screw the eye bolts into the consoles", detail: "With the barrel nuts. The rail runs through the two eyes.", fix: [at("clip", undefined, [0, 1, 0], [[-cx, rodY - 15, rodZ], [cx, rodY - 15, rodZ]], undefined, { len: 40, dia: 22 })], tools: ["allen"], pose: "-y" });
r.step({ title: "Slide in the peg board", detail: "Two dowels into each end, then push it between the uprights at the bottom.", add: ["pb"], fix: [at("dowel", "pb", [1, 0, 0], [[-ux + 20, pbH * 0.3, zb + 11], [-ux + 20, pbH * 0.7, zb + 11]], undefined, sized(DRAWER_DOWEL)), at("dowel", "pb", [-1, 0, 0], [[ux - 20, pbH * 0.3, zb + 11], [ux - 20, pbH * 0.7, zb + 11]], undefined, sized(DRAWER_DOWEL))], tools: ["hammer"], pose: "-y" });
@@ -1773,14 +1839,15 @@ function mirrorCabinet(s: ProductSpec): CustomParams | null {
const shelfYs = spread(nicheH + 200, bodyH - 200, 3).map(Math.round);
shelfYs.forEach((y, i) => r.part(`g${i}`, "Glass shelf", [2 * xi - 6, 6, sideD - 30], [0, y, zc + 5], { material: "metal" }));
const zj = [zc - sideD / 4, zc + sideD / 4];
+ const zt = [zc - 45, zc + 45]; // the top's dowels, clear of its two screws
const hingeYs = [nicheH + 90, bodyH - 90];
const hingeSides = doors === 2 ? [-1, 1] : [1];
const plates = at("hinge", undefined, [0, 0, -1], hingeSides.flatMap((g) => hingeYs.map((y): Vec3 => [g * (xi - 18), y, zf - 30])), undefined, { len: 50, dia: 35 });
r.step({ title: "Screw the cam bolts into the left side", detail: "Lay it on a rug, inside up. Four bolts, by hand until they stop.", add: ["sL"], fix: [at("camScrew", "sL", [-1, 0, 0], [...zj.map((z): Vec3 => [-xi, t / 2, z]), ...zj.map((z): Vec3 => [-xi, nicheH, z])], undefined, { len: 34 })], tools: ["screwdriver"], pose: "+z", warnings: ["floor"] });
r.step({ title: doors === 2 ? "Screw on the hinge plates" : "Screw the hinge plates onto the right side", detail: "Two on each side the doors hang from, at the front edge.", fix: [plates], tools: ["screwdriver"], pose: "+z" });
r.step({ title: "Fit the bottom and the fixed shelf", detail: "Tap the dowels in, push them onto the left side and lock the four cam locks.", add: ["bot", "fx"], fix: [at("dowel", undefined, [1, 0, 0], [[-xi, t / 2, zc - 30], [-xi, t / 2, zc + 30], [-xi, nicheH, zc - 30], [-xi, nicheH, zc + 30]], undefined, sized(DOWEL)), at("cam", undefined, [0, 1, 0], [...zj.map((z): Vec3 => [-xi + 26, t, z]), ...zj.map((z): Vec3 => [-xi + 26, nicheH + t / 2, z])], undefined, { dia: 15 })], tools: ["hammer", "screwdriver"], pose: "+z" });
- r.step({ title: "Push the top on", detail: "Six dowels: two into each end of the top and one into the free end of the bottom and the shelf.", add: ["top"], fix: [at("dowel", undefined, [1, 0, 0], [[-xi, bodyH - t / 2, zj[0]], [-xi, bodyH - t / 2, zj[1]]], undefined, sized(DOWEL)), at("dowel", undefined, [-1, 0, 0], [[xi, bodyH - t / 2, zj[0]], [xi, bodyH - t / 2, zj[1]], [xi, t / 2, zc], [xi, nicheH, zc]], undefined, sized(DOWEL))], tools: ["hammer"], pose: "+z" });
- r.step({ title: "Screw the right side on", detail: "Four long screws through the side into the bottom, the shelf and the top, with the Allen key.", add: ["sR"], fix: [at("screw", "sR", [-1, 0, 0], [[W0 / 2, t / 2, zc], [W0 / 2, nicheH, zc], [W0 / 2, bodyH - t / 2, zj[0]], [W0 / 2, bodyH - t / 2, zj[1]]], undefined, sized(TOP_SCREW))], tools: ["allen"], pose: "+z" });
+ r.step({ title: "Push the top on", detail: "Six dowels: two into each end of the top and one into the free end of the bottom and the shelf.", add: ["top"], fix: [at("dowel", undefined, [1, 0, 0], [[-xi, bodyH - t / 2, zt[0]], [-xi, bodyH - t / 2, zt[1]]], undefined, sized(DOWEL)), at("dowel", undefined, [-1, 0, 0], [[xi, bodyH - t / 2, zt[0]], [xi, bodyH - t / 2, zt[1]], [xi, t / 2, zc - 40], [xi, nicheH, zc - 40]], undefined, sized(DOWEL))], tools: ["hammer"], pose: "+z" });
+ r.step({ title: "Screw the right side on", detail: "Four long screws through the side into the bottom, the shelf and the top, with the Allen key.", add: ["sR"], fix: [at("screw", "sR", [-1, 0, 0], [[W0 / 2, t / 2, zc + 10], [W0 / 2, nicheH, zc + 10], [W0 / 2, bodyH - t / 2, zc - 12], [W0 / 2, bodyH - t / 2, zc + 12]], undefined, sized(TOP_SCREW))], tools: ["allen"], pose: "+z" });
r.step({ title: doors === 2 ? "Slide in the two back panels" : "Slide in the back panel", detail: "Into the grooves from the top, smooth side in.", add: backs, pose: "+z", from: Object.fromEntries(backs.map((id) => [id, [0, 400, 0] as Vec3])) });
r.step({ title: "Screw the crown on top", detail: "Five long screws up through the top.", add: ["cr"], fix: [at("screw", "top", [0, 1, 0], spread(-xi + 50, xi - 50, 5).map((x): Vec3 => [x, bodyH - t, zc]), "cr", sized(TOP_SCREW))], tools: ["allen"], pose: "+z" });
r.step({ title: "Clip the back in place", detail: "Turn it onto its front. Four clips hold the back to the fixed shelf.", fix: [at("clip", "fx", [0, 0, 1], spread(-xi + 60, xi - 60, 4).map((x): Vec3 => [x, nicheH + t / 2, zb + 10]), undefined, { len: 12, dia: 20 })], pose: "-z" });
@@ -1902,7 +1969,8 @@ function tvBench(b: PlanBuilder, s: ProductSpec) {
r.part("bt", "Back rail", [2 * xi, 80, 20], [0, postH - 40, zb + 10], { material: "wood" });
r.part("bb", "Back rail", [2 * xi, 60, 20], [0, legH + 30, zb + 10], { material: "wood" });
dx.forEach((x, i) => r.part(`dv${i}`, "Divider", [18, postH - botY - botT, zr - 10 - (zb + 20)], [x, botY + botT + (postH - botY - botT) / 2, (zr - 10 + zb + 20) / 2]));
- r.part("bot", "Bottom", [2 * xi, botT, zr - 10 - (zb + 20)], [0, botY + botT / 2, (zr - 10 + zb + 20) / 2]);
+ // the bottom rests on the two bottom rails, front and back
+ r.part("bot", "Bottom", [2 * xi, botT, zr + 5 - (zb + 5)], [0, botY + botT / 2, (zr + 5 + zb + 5) / 2]);
r.part("top", "Top", [W, topT, D], [0, H - topT / 2, 0], { material: "wood" });
const bays = [[-xi, dx[0] - 9], [dx[0] + 9, dx[1] - 9], [dx[1] + 9, xi]];
const shY = Math.round(midY + midH + (postH - 40 - midY - midH) / 2);
@@ -1910,15 +1978,16 @@ function tvBench(b: PlanBuilder, s: ProductSpec) {
const side = (L: string) => [`pf${L}`, `pb${L}`, `sp${L}`];
const runLen = Math.round((zr - zb - 60) / 10) * 10;
const ry = botY + botT + 8;
- const sideRunner = (L: string) => [at("runner", `sp${L}`, [g(L), 0, 0], [[g(L) * xi, ry, zm]], undefined, { len: runLen, dia: 20 }), at("screw", `sp${L}`, [g(L), 0, 0], [[g(L) * xi, ry, zm - runLen / 2 + 40], [g(L) * xi, ry, zm + runLen / 2 - 40]], undefined, sized(RUNNER_SCREW))];
+ const xr = xo - 24; // inside face of the side panel
+ const sideRunner = (L: string) => [at("runner", `sp${L}`, [g(L), 0, 0], [[g(L) * xr, ry, zm]], undefined, { len: runLen, dia: 20 }), at("screw", `sp${L}`, [g(L), 0, 0], [[g(L) * xr, ry, zm - runLen / 2 + 40], [g(L) * xr, ry, zm + runLen / 2 - 40]], undefined, sized(RUNNER_SCREW))];
const rails = [
{ id: "fb", y: legH + 30, z: zr, post: "pf" },
{ id: "fm", y: midY + midH / 2, z: zr, post: "pf" },
{ id: "ft", y: postH - 20, z: zr, post: "pf" },
{ id: "bt", y: postH - 40, z: zb + 10, post: "pb" },
];
- const bolts = (L: string) => rails.map((q) => at("camScrew", `${q.post}${L}`, [g(L), 0, 0], [[g(L) * xi, q.y - 8, q.z]], q.id, { len: 34 }));
- const dowels = (L: string) => [at("dowel", undefined, [-g(L), 0, 0], [...rails.map((q): Vec3 => [g(L) * xi, q.y + 8, q.z]), [g(L) * xi, legH + 30, zb + 10]], undefined, sized(DOWEL))];
+ const bolts = (L: string) => rails.map((q) => at("camScrew", `${q.post}${L}`, [g(L), 0, 0], [[g(L) * xi, q.y - 12, q.z]], q.id, { len: 34 }));
+ const dowels = (L: string) => [at("dowel", undefined, [-g(L), 0, 0], [...rails.map((q): Vec3 => [g(L) * xi, q.y + 12, q.z]), [g(L) * xi, legH + 30, zb + 10]], undefined, sized(DOWEL))];
const cams = (L: string) => [at("cam", undefined, [0, -1, 0], rails.map((q): Vec3 => [g(L) * (xi - 26), q.y + (q.id === "bt" ? 40 : q.id === "fm" ? 15 : q.id === "ft" ? 20 : 30), q.z]), undefined, { dia: 15 })];
r.step({ title: "Screw the runners onto the sides", detail: "Both sides on a rug, inside up. One runner each, wheel at the front, two screws.", add: side("L"), fix: sideRunner("L"), tools: ["screwdriver"], pose: "+x", repeat: 2, warnings: ["floor"] });
r.step({ title: "Screw in the cam bolts", detail: "Four in each side, into the inside faces of the posts.", fix: bolts("L"), tools: ["screwdriver"], pose: "+x", repeat: 2 });
@@ -1944,9 +2013,13 @@ function tvBench(b: PlanBuilder, s: ProductSpec) {
detail: "Screw six cam bolts into the bottom on a rug, lay it in, lock the six cam locks and drive four long screws through the bottom rails.",
add: ["bot"],
fix: [
- at("camScrew", "bot", [0, -1, 0], [...[-1, 1].flatMap((gg): Vec3[] => [[gg * (xi - 30), botY, zm - 80], [gg * (xi - 30), botY, zm + 80]]), [dx[0], botY, zm], [dx[1], botY, zm]], undefined, { len: 24, dia: 6 }),
- at("cam", undefined, [0, 0, -1], [...[-1, 1].flatMap((gg): Vec3[] => [[gg * (xi - 30), botY - 20, zr - 10], [gg * (xi - 30), botY - 20, zb + 20]]), [dx[0], botY - 20, zr - 10], [dx[1], botY - 20, zr - 10]], undefined, { dia: 15 }),
- at("screw", undefined, [0, 0, 1], [[-xi / 2, botY - 30, zb], [xi / 2, botY - 30, zb], [-xi / 2, botY - 30, zr + 10], [xi / 2, botY - 30, zr + 10]].map((p): Vec3 => [p[0], p[1], p[2]]), undefined, sized(TOP_SCREW)),
+ // cam bolts down into the bottom rails, locked from inside; long screws up through the rails into the bottom
+ at("camScrew", "bot", [0, 1, 0], [-1, 1].flatMap((gg): Vec3[] => [[gg * (xi - 60), botY, zr], [gg * (xi - 60), botY, zb + 10]]), undefined, { len: 24, dia: 6 }),
+ at("camScrew", "bot", [0, -1, 0], [[dx[0], botY + botT, zm], [dx[1], botY + botT, zm]], undefined, { len: 24, dia: 6 }),
+ at("cam", undefined, [0, 0, 1], [-1, 1].map((gg): Vec3 => [gg * (xi - 60), botY - 22, zr - 10]), undefined, { dia: 15 }),
+ at("cam", undefined, [0, 0, -1], [-1, 1].map((gg): Vec3 => [gg * (xi - 60), botY - 22, zb + 20]), undefined, { dia: 15 }),
+ at("cam", undefined, [0, 0, 1], dx.map((x): Vec3 => [x, botY + botT + 25, zr - 30]), undefined, { dia: 15 }),
+ at("screw", undefined, [0, 1, 0], [[-xi / 2, legH, zb + 10], [xi / 2, legH, zb + 10], [-xi / 2, legH, zr], [xi / 2, legH, zr]], "bot", { len: 80, dia: 6 }),
],
tools: ["screwdriver", "allen"],
pose: "-y",
@@ -2024,14 +2097,14 @@ function highCabinet(s: ProductSpec): CustomParams | null {
});
r.step({ title: "Screw the cam bolts into the left side", detail: "Six bolts, by hand until they stop.", fix: [at("camScrew", "sL", [-1, 0, 0], [[-xi, plinthY + plinthH / 2, zf - 9], [-xi, plinthY + plinthH / 2, zb + 20], ...pts(botY + t / 2, -xi), ...pts(fixY, -xi)], undefined, { len: 34 })], tools: ["screwdriver"], pose: "+x" });
r.step({ title: "Stand the two plinths in", detail: "A dowel in the end of each, then push them onto the bolts and lock the cam locks.", add: ["pf", "pb"], fix: [at("dowel", undefined, [1, 0, 0], [[-xi, plinthY + plinthH / 2 + 20, zf - 9], [-xi, plinthY + plinthH / 2 + 20, zb + 20]], undefined, sized(DOWEL)), at("cam", undefined, [0, -1, 0], [[-xi + 26, plinthY + plinthH, zf - 9], [-xi + 26, plinthY + plinthH, zb + 20]], undefined, { dia: 15 })], tools: ["hammer", "screwdriver"], pose: "+x" });
- r.step({ title: "Stand the bottom and the fixed shelf in", detail: "Two dowels in each end of both, push them on and lock the four cam locks.", add: ["bot", "fx"], fix: [at("dowel", undefined, [1, 0, 0], [[-xi, botY + t / 2, zc + 5], [-xi, botY + t / 2, zc + 65], [-xi, fixY, zc + 5], [-xi, fixY, zc + 65]], undefined, sized(DOWEL)), at("cam", undefined, [0, 1, 0], [...pts(botY + t, -xi + 26), ...pts(fixY + t / 2, -xi + 26)], undefined, { dia: 15 })], tools: ["hammer", "screwdriver"], pose: "+x" });
+ r.step({ title: "Stand the bottom and the fixed shelf in", detail: "Two dowels in each end of both, push them on and lock the four cam locks.", add: ["bot", "fx"], from: { bot: [300, 0, 0], fx: [300, 0, 0] }, fix: [at("dowel", undefined, [1, 0, 0], [[-xi, botY + t / 2, zc - 20], [-xi, botY + t / 2, zc + 30], [-xi, fixY, zc - 20], [-xi, fixY, zc + 30]], undefined, sized(DOWEL)), at("cam", undefined, [0, 1, 0], [...pts(botY + t, -xi + 26), ...pts(fixY + t / 2, -xi + 26)], undefined, { dia: 15 })], tools: ["hammer", "screwdriver"], pose: "+x" });
r.step({
title: "Put the top in and lower the right side on",
detail: "The right side has its bracket, foot and six bolts like the left one. Dowels in all the free ends, press it down, then lock the six cam locks.",
add: ["top", "sR"],
fix: [
at("camScrew", "sR", [1, 0, 0], [[xi, plinthY + plinthH / 2, zf - 9], [xi, plinthY + plinthH / 2, zb + 20], ...pts(botY + t / 2, xi), ...pts(fixY, xi)], undefined, { len: 34 }),
- at("dowel", undefined, [-1, 0, 0], [[xi, plinthY + plinthH / 2 + 20, zf - 9], [xi, plinthY + plinthH / 2 + 20, zb + 20], [xi, botY + t / 2, zc + 5], [xi, botY + t / 2, zc + 65], [xi, fixY, zc + 5], [xi, fixY, zc + 65]], undefined, sized(DOWEL)),
+ at("dowel", undefined, [-1, 0, 0], [[xi, plinthY + plinthH / 2 + 20, zf - 9], [xi, plinthY + plinthH / 2 + 20, zb + 20], [xi, botY + t / 2, zc - 20], [xi, botY + t / 2, zc + 30], [xi, fixY, zc - 20], [xi, fixY, zc + 30]], undefined, sized(DOWEL)),
at("cam", undefined, [0, -1, 0], [[xi - 26, plinthY + plinthH, zf - 9], [xi - 26, plinthY + plinthH, zb + 20], ...pts(botY + t, xi - 26), ...pts(fixY + t / 2, xi - 26)], undefined, { dia: 15 }),
at("angle", "sR", [1, 0, 0], [[xi, bodyH - 80, zb + 30], [xi, botY + 80, zb + 30]], undefined, { len: 70, dia: 50 }),
at("screw", "sR", [1, 0, 0], [[xi, bodyH - 100, zb + 30], [xi, bodyH - 60, zb + 30], [xi, botY + 60, zb + 30], [xi, botY + 100, zb + 30]], undefined, sized(RUNNER_SCREW)),
@@ -2063,6 +2136,8 @@ function highCabinet(s: ProductSpec): CustomParams | null {
const family: Family = {
names: ["HEMNES"],
build(b, s) {
+ // guides drawn in the helper files next to this one (beds and benches, desks and tables, cabinets, storage)
+ for (const f of [hemnesBeds, hemnesTables, hemnesCabinets, hemnesStorage]) if (f(b, s)) return true;
if (s.archetype === "drawers" && /chest/i.test(s.variant + s.slug)) return chest(b, s);
const v = s.variant.toLowerCase();
if (/wash-?st(an)?d w(ith)? 2 drawers|wash-stnd w drawers/.test(v)) return washStand(b, s);
diff --git a/src/lib/plan/families/huvudspelare.ts b/src/lib/plan/families/huvudspelare.ts
index d0cfab5..1d408fb 100644
--- a/src/lib/plan/families/huvudspelare.ts
+++ b/src/lib/plan/families/huvudspelare.ts
@@ -119,13 +119,15 @@ function desk(s: ProductSpec): CustomParams {
{
title: "Click the spacers into the frame",
detail: "One in each of the twelve holes along the rails and the tops of the loops, until it clicks.",
- fix: [at("cap", topBolts, [0, 1, 0], undefined, undefined, { len: 8, dia: 20, name: "Plastic spacer" })],
+ // the spacers sit in the holes' top ends, between the frame and the top
+ fix: [at("cap", topBolts.map(([x, , z]): Vec3 => [x, topY0 - 4, z]), [0, 1, 0], undefined, undefined, { len: 8, dia: 20, name: "Plastic spacer" })],
},
{
title: "Lower the frame onto the top and bolt it on",
detail: "Lay the top face down on the rug. Set the frame on it with the holes lined up, then twelve bolts with their washers.",
add: ["TOP"],
- fix: [at("bolt", topBolts.map(([x, y, z]): Vec3 => [x, y - 4, z]), [0, 1, 0], undefined, "TOP", { len: 35, dia: 6 })],
+ // up through the hollow rails and tubes, their tips in the top
+ fix: [at("bolt", [...railPts.map(([x, , z]): Vec3 => [x, topY0 - 26, z]), ...loopPts.map(([x, , z]): Vec3 => [x, topY0 - tube, z])], [0, 1, 0], undefined, "TOP", { len: 35, dia: 6 })],
tools: ["allen"],
from: { TOP: [0, -420, 0] },
},
@@ -213,6 +215,8 @@ function chair(s: ProductSpec): CustomParams {
{ shape: "cyl", size: [26, armY - seatTop + 40, 26], pos: [0, 0, armZf - (armZf + armZb) / 2] },
{ shape: "cyl", size: [26, armLen - 20, 26], pos: [0, armY - cy, 0], rot: [Math.PI / 2, 0, 0] },
{ shape: "box", size: [60, 14, 40], pos: [-sx * 30, seatTop - 40 - cy + 7, armZf - (armZf + armZb) / 2] },
+ // the plate at the back end that bolts against the backrest's side bracket
+ { shape: "box", size: [14, armY - seatTop - 20, 40], pos: [-sx * 7, (seatTop + 20 + armY) / 2 - cy, armZb - (armZf + armZb) / 2] },
],
material: "metal",
});
@@ -226,15 +230,18 @@ function chair(s: ProductSpec): CustomParams {
const padScrews = (sx: number): Vec3[] => [-60, 60].map((dz): Vec3 => [sx * armX, armY + 13, (armZf + armZb) / 2 + 20 + dz]);
const armBolts = (sx: number): CustomFix[] => [
at("bolt", [[sx * (armX - 30), seatTop - 40, armZf]], [0, 1, 0], sx < 0 ? "AL" : "AR", "SEAT", { len: 60, dia: 6 }),
- at("bolt", [seatTop + 60, seatTop + 140].map((y): Vec3 => [sx * (armX + 15), y, backZ + 20]), [-sx, 0, 0], sx < 0 ? "AL" : "AR", "BACK", { len: 16, dia: 6 }),
+ at("bolt", [seatTop + 60, seatTop + 140].map((y): Vec3 => [sx * armX, y, armZb]), [-sx, 0, 0], sx < 0 ? "AL" : "AR", "BACK", { len: 16, dia: 6 }),
];
+ // the seat, its back and arms are put together beside the base, then lowered onto the gas lift
+ const arms = ["AL", "PL", "AR", "PR"], top = ["SEAT", "MECH", "BACK", ...arms];
+ const aside = (ids: string[]) => Object.fromEntries(ids.map((id) => [id, [800, 0, 0] as Vec3]));
const steps: CustomStep[] = [
{ title: "Push the five legs into the hub", detail: "On a rug, each leg straight into its socket until it stops.", add: ["HUB", ...legs], warnings: ["floor"] },
{
title: "Screw the legs to the hub",
detail: "Two screws in each leg, each with a washer. Tighten them with the Allen key.",
- fix: [at("washer", legScrews, [0, -1, 0], "HUB", undefined, { len: 2, dia: 12, name: "Spring washer" }), at("screw", legScrews, [0, -1, 0], "HUB", undefined, { len: 12, dia: 6 })],
+ fix: [at("screw", legScrews, [0, -1, 0], "HUB", undefined, { len: 12, dia: 6 }), at("washer", legScrews, [0, -1, 0], "HUB", undefined, { len: 2, dia: 12, name: "Spring washer" })],
tools: ["allen"],
},
{ title: "Push a castor into each leg", detail: "Press each pin in hard until the castor clicks home.", fix: [at("castor", tips, [0, 1, 0], undefined, undefined, { len: 58, dia: 50 })] },
@@ -243,25 +250,26 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Bolt the mechanism under the seat",
detail: "Do this with the seat upside down on the rug, the lever on the right. Four bolts, tight.",
- add: ["SEAT", "MECH"],
+ wait: ["SEAT", "MECH"],
fix: [at("bolt", mechBolts, [0, 1, 0], "MECH", "SEAT", { len: 20, dia: 6 })],
tools: ["allen"],
- from: { SEAT: [0, 500, 0], MECH: [0, 650, 0] },
+ from: aside(["SEAT", "MECH"]),
},
{
title: "Bolt the backrest's bar to the mechanism",
detail: "Rest the back on a table edge and lay its bar over the back of the mechanism. Four bolts, tight.",
- add: ["BACK"],
+ wait: ["BACK"],
+ from: aside(["BACK"]),
fix: [at("bolt", backBolts, [0, 1, 0], "BACK", "MECH", { len: 20, dia: 6 })],
tools: ["allen"],
},
{
title: "Screw a pad onto each arm",
detail: "Two small screws up through each arm into its pad.",
- add: ["AL", "PL", "AR", "PR"],
- fix: [at("screw", [...padScrews(-1), ...padScrews(1)], [0, 1, 0], undefined, undefined, { len: 16, dia: 4 })],
+ wait: arms,
+ fix: [-1, 1].map((sx) => at("screw", padScrews(sx), [0, 1, 0], sx < 0 ? "AL" : "AR", sx < 0 ? "PL" : "PR", { len: 16, dia: 4 })),
tools: ["screwdriver"],
- from: { AL: [-400, 0, 0], AR: [400, 0, 0], PL: [-400, 200, 0], PR: [400, 200, 0] },
+ from: aside(arms),
},
{
title: "Bolt the left arm on",
@@ -276,7 +284,7 @@ function chair(s: ProductSpec): CustomParams {
tools: ["allen"],
},
{ title: "Tighten the four bolts on the back bracket", detail: "Turn each one with the Allen key until it is tight.", tools: ["allen"], kind: "bolts" },
- { title: "Lower the seat onto the gas lift", detail: "Stand it up and press it straight down over the lift. Sit on it once to lock the taper." },
+ { title: "Lower the seat onto the gas lift", detail: "Stand it up and press it straight down over the lift. Sit on it once to lock the taper.", add: top, from: Object.fromEntries(top.map((id) => [id, [0, 350, 0] as Vec3])) },
];
return { parts, steps };
}
diff --git a/src/lib/plan/families/hyltarp.ts b/src/lib/plan/families/hyltarp.ts
index 5e068fa..dde6249 100644
--- a/src/lib/plan/families/hyltarp.ts
+++ b/src/lib/plan/families/hyltarp.ts
@@ -114,7 +114,8 @@ function sofaBed(b: PlanBuilder, s: ProductSpec): boolean {
step({ title: "Cut the two ties that hold the bed folded", detail: "Stand the frame on the floor with the folded bed inside it, and throw the ties away." }, () => b.add(fr, [0, 200, 0]));
step({ title: "Hang the front panel on its two brackets", detail: "One of you at each end. Lower it straight down until both ends sit on the brackets.", kind: "join", people: 2 }, () => b.add(front, [0, 260, 160]));
step({ title: "Lock the front panel with the wing screw", detail: "One of you lifts the front of the bed a little; the other turns the wing screw in through the middle bracket by hand.", kind: "screws", people: 2, warnings: ["two", "hand"] }, () => {
- fit(WSCREW, [{ on: front, mate: fr, at: [0, feet + 50, fz - 20], dir: [0, 0, 1], travel: 70, spin: 3 }]);
+ // from behind, through the middle bracket (not drawn) into the back of the front panel
+ fit(WSCREW, [{ on: front, mate: fr, at: [0, feet + 50, fz - 2], dir: [0, 0, 1], travel: 70, spin: 3 }]);
});
step({ title: "Unfold the bed", detail: "Together: lift the seat part up and out, then swing the leg frame over and down onto the floor.", people: 2 });
step({ title: "Lower the backrest onto the side plates", detail: "Fit the holes at the bottom of the backrest over the pins on both side plates and press it down.", kind: "join", people: 2 }, () => b.add(back, [0, 380, 0]));
diff --git a/src/lib/plan/families/ibbarbo.ts b/src/lib/plan/families/ibbarbo.ts
new file mode 100644
index 0000000..28795bf
--- /dev/null
+++ b/src/lib/plan/families/ibbarbo.ts
@@ -0,0 +1,38 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * IBBARBO stool. IKEA sells it moulded in one piece with no assembly (there is no manual), so its guide only unpacks
+ * it: a round seat on three wide legs.
+ */
+
+function stool(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10;
+ const SD = W - 40, ST = 40; // seat
+ const legW = 120, legT = 14, R = SD / 2 - legT / 2;
+ const pieces: PartPiece[] = [{ shape: "cyl", size: [SD, ST, SD], pos: [0, H / 2 - ST / 2, 0] }];
+ for (const a of [0, (2 * Math.PI) / 3, (4 * Math.PI) / 3]) {
+ // one leg at the front, two at the back, each a curved blade drawn flat, its face turned to the middle
+ pieces.push({ shape: "box", size: [legW, H - ST + 10, legT], pos: [Math.sin(a) * R, -ST / 2 + 5, Math.cos(a) * R], rot: [0, a, 0] });
+ }
+ return {
+ parts: [{ id: "S", name: "Stool", size: [W, H, W], pos: [0, H / 2, 0], material: "board", pieces }],
+ steps: [
+ {
+ title: "Take the stool out of its wrapping",
+ detail: "It comes moulded in one piece, with nothing to put together. Stand it on its three feet.",
+ add: ["S"],
+ },
+ {
+ title: "Stack the spares",
+ detail: "Set one stool straight down on another, the legs in line, to keep extra ones out of the way.",
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["IBBARBO"],
+ recipe: (s) => (/stool/i.test(`${s.variant} ${s.slug ?? ""}`) ? stool(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/idanas.ts b/src/lib/plan/families/idanas.ts
index da4fb70..419161c 100644
--- a/src/lib/plan/families/idanas.ts
+++ b/src/lib/plan/families/idanas.ts
@@ -87,6 +87,24 @@ function step(b: PlanBuilder, title: string, detail: string, kind: StepKind, o:
b.step({ title, detail, kind, ...o, warnings: o.warnings ?? (o.people === 2 ? ["two"] : []) }, body);
}
+/**
+ * A rail with dowels in both ends goes in between two sides that are already standing: as the manual shows, the
+ * sides are eased apart a little (they only hang on their connectors), the rail goes in, and the sides are pushed
+ * back onto its dowels.
+ */
+function between(b: PlanBuilder, sides: string[], body: () => void, gap = 30) {
+ b.stagger(0);
+ sides.forEach((key, i) => {
+ const f = b.partItem(key).final;
+ b.stage(key, [f.pos[0] + (i ? gap : -gap), f.pos[1], f.pos[2]], f.rot);
+ });
+ b.then(0.1);
+ body();
+ b.then(0.15);
+ b.stagger(0);
+ sides.forEach((key, i) => b.add(key, [i ? gap : -gap, 0, 0]));
+}
+
/* ---------- drawers ---------- */
interface Drawer {
@@ -433,11 +451,12 @@ function buildChest(b: PlanBuilder, s: ProductSpec, rows: Row[], o: { mid?: bool
b.then(0.15);
b.fits(LONG_SCREW, [{ on: backRail, at: [0, yb + BR / 2, zb + 14], dir: [0, 0, 1], mate: mid }], 0.15);
});
- step(b, `Tap the dowels into the ${shortJs.length} short rails and fit them`, "Two in each, one at each end. Push them onto the middle panel between the drawers and lock them with cam locks.", "cams", { pose: "+z", tools: ["hammer", "screwdriver"] }, () => {
+ step(b, `Tap the dowels into the ${shortJs.length} short rails and fit them`, "Two in each, one at each end. Push them sideways onto the middle panel between the drawers and lock them with cam locks.", "cams", { pose: "+z", tools: ["hammer", "screwdriver"] }, () => {
b.fits(DOWEL, jointsOf(shortJs).map((j) => j.dowel), 0.04);
b.then(0.1);
b.stagger(0.15);
- for (const r of shortJs) b.add(r.key, [0, 0, 260]);
+ // along their dowels, in from the open sides towards the middle panel
+ for (const r of shortJs) b.add(r.key, [Math.sign(k.pos(r.key)[0]) * 260, 0, 0]);
b.then(0.15);
b.fits(CAM, jointsOf(shortJs, mid).map((j) => j.cam), 0.1);
});
@@ -707,15 +726,17 @@ interface Member {
pts: [number, number][]; // y, z of each joint at one end
camDir: Vec3; // the way the cam locks go into the member
dowels: "frame" | "member";
+ doff?: Vec3; // where the dowel sits from the cam bolt (default 24 mm higher, which suits rails 60 mm or more tall)
}
function memberFits(f: Frames, m: Member, i: number) {
const g = i ? 1 : -1;
const x = g * f.xin;
+ const [ox, oy, oz] = m.doff ?? [0, 24, 0];
return {
bolts: m.pts.map(([y, z]): FitOpts => ({ on: f.frames[i], at: [x, y, z], dir: [g, 0, 0], mate: m.key, mateHole: 4 })),
dowels: m.pts.map(([y, z]): FitOpts =>
- m.dowels === "frame" ? { on: f.frames[i], at: [x, y + 24, z], dir: [g, 0, 0], mate: m.key } : { on: m.key, at: [x, y + 24, z], dir: [-g, 0, 0], mate: f.frames[i] },
+ m.dowels === "frame" ? { on: f.frames[i], at: [x + ox, y + oy, z + oz], dir: [g, 0, 0], mate: m.key } : { on: m.key, at: [x + ox, y + oy, z + oz], dir: [-g, 0, 0], mate: f.frames[i] },
),
cams: m.pts.map(([y, z]): FitOpts => ({ on: m.key, at: [g * (f.xin - 30), y, z - m.camDir[2] * 10 - m.camDir[1] * 0], dir: m.camDir })),
};
@@ -769,9 +790,9 @@ function buildSideTable(b: PlanBuilder, s: ProductSpec) {
const rail = (name: string, h: number, y: number, e: number) => k.part(name, [2 * xin, h, 20], [0, y, e * (zin - 10)]);
const upper = [-1, 1].map((e) => rail("Top rail", 70, yt - 35, e));
const lower = [-1, 1].map((e) => rail("Bottom rail", 40, low, e));
- const ms = (key: string, y: number, e: number): Member => ({ key, pts: [[y, e * (zin - 10)]], camDir: [0, 0, e], dowels: "member" });
+ const ms = (key: string, y: number, e: number, doff?: Vec3): Member => ({ key, pts: [[y, e * (zin - 10)]], camDir: [0, 0, e], dowels: "member", doff });
const mU = upper.map((key, i) => ms(key, yt - 35, i ? 1 : -1));
- const mL = lower.map((key, i) => ms(key, low, i ? 1 : -1));
+ const mL = lower.map((key, i) => ms(key, low, i ? 1 : -1, [0, 12, 0]));
const shelfLow = k.part("Bottom shelf", [2 * xin - 4, 16, 2 * zin - 44], [0, low + 30, 0]);
const midY = Math.round((low + yt) / 2);
const shelfMid = k.part("Middle shelf", [2 * xin - 4, 16, 2 * zin - 4], [0, midY, 0]);
@@ -839,7 +860,7 @@ function buildConsole(b: PlanBuilder, s: ProductSpec) {
const shelfLow = k.part("Bottom shelf", [2 * xin - 4, 16, 2 * zin - 44], [0, low + 28, 0]);
const mBack: Member = { key: back, pts: [[yt - 50, -zin + 9], [yt - bh + 50, -zin + 9]], camDir: [0, 0, -1], dowels: "frame" };
const mFront: Member = { key: front, pts: [[yt - 30, zin - 9]], camDir: [0, 0, 1], dowels: "frame" };
- const mLow = lower.map((key, i): Member => ({ key, pts: [[low, (i ? 1 : -1) * (zin - 10)]], camDir: [0, 0, i ? 1 : -1], dowels: "frame" }));
+ const mLow = lower.map((key, i): Member => ({ key, pts: [[low, (i ? 1 : -1) * (zin - 10)]], camDir: [0, 0, i ? 1 : -1], dowels: "frame", doff: [0, 12, 0] }));
const all = [mBack, mFront, ...mLow];
const fits = (ms: Member[], i: number) => ms.map((m) => memberFits(f, m, i));
// the back board takes one dowel at each end, not two
@@ -935,12 +956,14 @@ function buildCoffee(b: PlanBuilder, s: ProductSpec) {
const cellsX = long ? [-1, 1].map((g) => ({ x: (g * (xin + 9)) / 2, ow: xin - 9 })) : [{ x: 0, ow: 2 * xin }];
const drawers = cellsX.map((c) => makeDrawer(k, { x: c.x, yb: ydb, ow: c.ow, oh: drawerH, zf: long ? zf : zf, dd: long ? dd : 2 * zin - 18 - 4, knobs: 1, stiff: 2, through: !long }));
const g = (i: number) => (i ? 1 : -1);
- const m = (key: string, pts: [number, number][], camDir: Vec3, dowels: "frame" | "member" = "member"): Member => ({ key, pts, camDir, dowels });
+ const m = (key: string, pts: [number, number][], camDir: Vec3, doff?: Vec3): Member => ({ key, pts, camDir, dowels: "member", doff });
const mTop = topRails.map((key, i) => m(key, [[yt - 30, g(i) * (zin - RT / 2)]], [0, 0, g(i)]));
- const mShelf = m(shelf, [[y7, -zin / 2], [y7, zin / 2]], [0, 1, 0]);
- const mUpper = upper ? m(upper, [[yt0 - 9, -zin / 2], [yt0 - 9, zin / 2]], [0, -1, 0]) : null;
- const mBottom = bottom ? m(bottom, [[ydb - 9, -zin / 2], [ydb - 9, zin / 2]], [0, 1, 0]) : null;
- const mRail = m(bottomRail, [[k.pos(bottomRail)[1], k.pos(bottomRail)[2]]], [0, 0, 1]);
+ // boards lying flat take the dowel beside the cam bolt, inside their thickness
+ const flat: Vec3 = [0, 0, 40];
+ const mShelf = m(shelf, [[y7, -zin / 2], [y7, zin / 2]], [0, 1, 0], flat);
+ const mUpper = upper ? m(upper, [[yt0 - 9, -zin / 2], [yt0 - 9, zin / 2]], [0, -1, 0], flat) : null;
+ const mBottom = bottom ? m(bottom, [[ydb - 9, -zin / 2], [ydb - 9, zin / 2]], [0, 1, 0], flat) : null;
+ const mRail = m(bottomRail, [[k.pos(bottomRail)[1], k.pos(bottomRail)[2]]], [0, 0, 1], [0, 12, 0]);
const F = (ms: Member, i: number) => memberFits(f, ms, i);
// which joints get cam locks (the rest are dowels only), as the manual counts them
const camsAt = (i: number): FitOpts[] => {
@@ -1008,7 +1031,8 @@ function buildCoffee(b: PlanBuilder, s: ProductSpec) {
b.fits(CAM_BOLT, [dv[2] - 60, dv[2] + 60].map((z): FitOpts => ({ on: shelf, at: [0, ys, z], dir: [0, 1, 0], mate: divider, mateHole: 4 })), 0.1);
b.fit(DOWEL, { on: divider, at: [0, ys, dv[2]], dir: [0, 1, 0], mate: shelf });
b.then(0.1);
- b.stage(divider, [0, 18 + drawerH / 2, dv[2]], [0, 0, 0], [0, 200, 0]);
+ b.stage(divider, [0, 18 + drawerH / 2 + 220, dv[2]], [0, 0, 0]);
+ b.stage(divider, [0, 18 + drawerH / 2, dv[2]], [0, 0, 0]);
b.then(0.15);
b.fits(CAM, [dv[2] - 60, dv[2] + 60].map((z): FitOpts => ({ on: divider, at: [9, ys - 30, z], dir: [-1, 0, 0] })), 0.1);
});
@@ -1131,10 +1155,10 @@ function buildBookcase(b: PlanBuilder, s: ProductSpec, cab = false) {
b.then(0.1);
b.add(sides[1], [360, 0, 0]);
});
- step(b, "Fit the plinth rail", "Tap two dowels into each end and push it in under the front of the bottom.", "dowels", { pose: "+z", tools: ["hammer"] }, () => {
+ step(b, "Fit the plinth rail", "Tap two dowels into each end. Ease the sides apart a little, lower the rail in under the front of the bottom and push the sides back onto its dowels.", "dowels", { pose: "+z", tools: ["hammer"] }, () => {
b.fits(DOWEL, [0, 1].flatMap((i) => [-15, 15].map((dy): FitOpts => ({ on: plinth, at: [sg(i) * xi, yb + PH / 2 + dy, zf - 10 - t / 2], dir: [-sg(i), 0, 0], mate: sides[i] }))), 0.1);
b.then(0.1);
- b.add(plinth, [0, 0, 260]);
+ between(b, sides, () => b.add(plinth, [0, 0, 260]));
});
step(b, "Hook the top on together", "Four connectors into its underside, then slide it onto the ends of the sides until it clicks.", "join", { pose: "+z", people: 2 }, () => {
b.fits(TOP_CLIP, [0, 1].flatMap((i) => [zb + 60, zf - 60].map((z): FitOpts => ({ on: top, at: [sg(i) * (xo - t / 2), yt, z], dir: [0, 1, 0], mate: sides[i] }))), 0.08);
@@ -1189,7 +1213,7 @@ function buildTvBench(b: PlanBuilder, s: ProductSpec) {
const lowDiv = k.part("Lower divider", [t, dh, depth], [0, yb + 18 + dh / 2, zs]);
const RT = 20;
const rail = k.part("Front rail", [2 * xi, 60, RT], [0, yt - 30, zf - RT / 2]);
- const upDiv = k.part("Upper divider", [t, yt - 60 - (yShelf + 9), depth - RT], [0, (yt - 60 + yShelf + 9) / 2, zs - RT / 2]);
+ const upDiv = k.part("Upper divider", [t, yt - (yShelf + 9), depth - RT], [0, (yt + yShelf + 9) / 2, zs - RT / 2]);
const back = k.part("Back panel", [2 * xi + 12, hc - 6, 3], [0, yb + 3 + (hc - 6) / 2, zb + 8], { material: "fiber" });
const cleg = k.part("Centre leg", [44, c.U, 44], [0, c.U / 2, zs]);
const dd = Math.round((zf - 18 - (zb + 40)) / 10) * 10;
@@ -1233,11 +1257,22 @@ function buildTvBench(b: PlanBuilder, s: ProductSpec) {
b.stagger(0.3);
for (const [i, key] of sides.entries()) b.add(key, [sg(i) * 300, 0, 0]);
});
- step(b, "Fit the front rail and the upper divider", "Tap a dowel into each end of the rail and push it in between the sides at the top. Stand the divider on the shelf under it and screw through the rail into it.", "screws", { tools: ["hammer", "allen"] }, () => {
+ const gap = 30;
+ step(b, "Lay the front rail in at the top", "Tap a dowel into each end. Ease the sides apart a little and lay the rail between them at the top front.", "dowels", { tools: ["hammer"] }, () => {
b.fits(DOWEL, [0, 1].map((i): FitOpts => ({ on: rail, at: [sg(i) * xi, yt - 30, zf - RT / 2], dir: [-sg(i), 0, 0], mate: sides[i] })), 0.1);
b.then(0.1);
- b.add(rail, [0, 0, 260]);
+ b.stagger(0);
+ sides.forEach((key, i) => {
+ const f = b.partItem(key).final;
+ b.stage(key, [f.pos[0] + sg(i) * gap, f.pos[1], f.pos[2]], f.rot);
+ });
b.then(0.1);
+ b.add(rail, [0, 0, 260]);
+ });
+ step(b, "Push the sides in and screw the upper divider", "Press both sides onto the rail's dowels. Stand the divider on the shelf under the rail and screw through the rail into it.", "screws", { tools: ["allen"] }, () => {
+ b.stagger(0);
+ sides.forEach((key, i) => b.add(key, [sg(i) * gap, 0, 0]));
+ b.then(0.15);
b.add(upDiv, [0, 0, -300]);
b.then(0.15);
b.fit(LONG, { on: rail, at: [0, yt - 30, zf], dir: [0, 0, -1], mate: upDiv });
@@ -1356,7 +1391,8 @@ function buildSideboard(b: PlanBuilder, s: ProductSpec) {
const yShelf = yt - RT - dh - 9;
const dshelf = k.part("Drawer shelf", [2 * xi, 18, depth], [0, yShelf, zs]);
const mid = k.part("Middle divider", [t, yShelf - 9 - (yb + 18), depth], [0, (yShelf - 9 + yb + 18) / 2, zs]);
- const ddiv = k.part("Drawer divider", [t, dh + RT, depth - 30], [0, yShelf + 9 + (dh + RT) / 2, zs - 15]);
+ const ddivB = zs - depth / 2 + 15, ddivF = zf - 18;
+ const ddiv = k.part("Drawer divider", [t, dh, ddivF - ddivB], [0, yShelf + 9 + dh / 2, (ddivB + ddivF) / 2]);
const rail = k.part("Top rail", [2 * xi, RT, 50], [0, yt - RT / 2, zf - 25]);
const back = k.part("Back panel", [2 * xi + 12, hc - 6, 3], [0, yb + 3 + (hc - 6) / 2, zb + 8], { material: "fiber" });
const cleg = k.part("Centre leg", [44, c.U, 44], [0, c.U / 2, zs]);
@@ -1406,10 +1442,10 @@ function buildSideboard(b: PlanBuilder, s: ProductSpec) {
b.stagger(0.3);
for (const [i, key] of sides.entries()) b.add(key, [sg(i) * 300, 0, 0]);
});
- step(b, "Fit the top rail", "Tap two dowels into each end and push it in at the top front. One long screw down into the drawer divider.", "dowels", { tools: ["hammer", "allen"] }, () => {
+ step(b, "Fit the top rail", "Tap two dowels into each end. Ease the sides apart, swing the rail in at the top front and push the sides back onto it. One long screw down into the drawer divider.", "dowels", { tools: ["hammer", "allen"] }, () => {
b.fits(DOWEL, [0, 1].flatMap((i) => [-12, 12].map((dz): FitOpts => ({ on: rail, at: [sg(i) * xi, yt - RT / 2, zf - 25 + dz], dir: [-sg(i), 0, 0], mate: sides[i] }))), 0.08);
b.then(0.1);
- b.add(rail, [0, 0, 260]);
+ between(b, sides, () => b.add(rail, [0, 0, 260]));
b.then(0.15);
b.fit(LONG, { on: rail, at: [0, yt, zf - 25], dir: [0, -1, 0], mate: ddiv });
});
@@ -1600,10 +1636,10 @@ function buildWardrobe(b: PlanBuilder, s: ProductSpec) {
b.then(0.1);
b.add(sides[1], [500, 0, 0]);
});
- step(b, "Fit the plinth rail", "Tap two dowels into each end and push it in under the front of the bottom.", "dowels", { pose: "+z", tools: ["hammer"] }, () => {
+ step(b, "Fit the plinth rail", "Tap two dowels into each end. Ease the sides apart a little, lower the rail in under the front of the bottom and push the sides back onto its dowels.", "dowels", { pose: "+z", tools: ["hammer"] }, () => {
b.fits(DOWEL, [0, 1].flatMap((i) => [-15, 15].map((dy): FitOpts => ({ on: plinth, at: [sg(i) * xi, yb + PH / 2 + dy, zf - 10 - t / 2], dir: [-sg(i), 0, 0], mate: sides[i] }))), 0.1);
b.then(0.1);
- b.add(plinth, [0, 0, 260]);
+ between(b, sides, () => b.add(plinth, [0, 0, 260]));
});
step(b, "Hook the top on together", "Six connectors into its underside, three at each end, then slide it onto the sides until it clicks.", "join", { pose: "+z", people: 2 }, () => {
b.fits(TOP_CLIP, [0, 1].flatMap((i) => zc.map((z): FitOpts => ({ on: top, at: [sg(i) * (xo - t / 2), yt, z], dir: [0, 1, 0], mate: sides[i] }))), 0.08);
@@ -2073,9 +2109,9 @@ function mattressOf(s: ProductSpec): [number, number] {
}
/** A rolled slatted base as one part: slats across the bed on two straps. */
-function slatBase(b: PlanBuilder, w: number, len: number, y: number, z: number, extra: boolean) {
+function slatBase(b: PlanBuilder, w: number, len: number, y: number, z: number, extra: boolean, x = 0) {
const n = Math.round(len / 110);
- const pieces: PartPiece[] = range(n).map((i) => ({ shape: "box", size: [w, 8, 60], pos: [0, y, z - len / 2 + 30 + (i * (len - 60)) / (n - 1)], material: "wood" }));
+ const pieces: PartPiece[] = range(n).map((i) => ({ shape: "box", size: [w, 8, 60], pos: [x, y, z - len / 2 + 30 + (i * (len - 60)) / (n - 1)], material: "wood" }));
const c = b.compound("Slatted base", pieces, { material: "wood", extra });
return b.place(c.type, c.mid);
}
@@ -2271,6 +2307,7 @@ const BEAM_BRACKET: HwDef = { kind: "bracket", len: 80, dia: 50, name: "Beam bra
const BEAM_SLEEVE: HwDef = { kind: "connector", len: 120, dia: 60, name: "Beam sleeve" };
const SMALL_CAM: HwDef = { kind: "cam", len: 12, dia: 13 };
const SMALL_DOWEL: HwDef = { kind: "dowel", len: 25, dia: 6 };
+const BLOCK_SCREW: HwDef = { kind: "screw", len: 50, dia: 6 };
/**
* The wooden bed with spindles: the headboard is built lying on one of its posts (spindle panel and the board under
@@ -2278,7 +2315,7 @@ const SMALL_DOWEL: HwDef = { kind: "dowel", len: 25, dia: 6 };
* onto them with big cam locks, two people at a time. Metal slat rails screw along the side rails, the two-part
* centre beam sits in brackets, and the LURÖY slats roll out under eight holders.
*/
-function buildWoodBed(b: PlanBuilder, s: ProductSpec) {
+function buildWoodBed(b: PlanBuilder, s: ProductSpec, o: { storage?: boolean } = {}) {
const k = new Kit(b);
const W = s.size.w * 10, L = s.size.d * 10, H = s.size.h * 10;
const P = 60, FH = 480, t = 22;
@@ -2308,6 +2345,11 @@ function buildWoodBed(b: PlanBuilder, s: ProductSpec) {
const beams = [-1, 1].map((e) => k.part("Centre beam half", [40, 40, halfL - 10], [0, slatY, (e * halfL) / 2], { material: "metal" }));
const slats = slatBase(b, 2 * (xr - t / 2) - 20, L - 2 * P - 40, slatY + 16.5, 0, false);
const g2 = (i: number) => (i ? 1 : -1);
+ // the storage version: blocks inside the head and foot boards carry the end runners, drawers hang under the frame
+ const yb = RY - RH / 2, xi = xr - t / 2;
+ const ryS = yb + 15, bw = inW / 2 - 20;
+ const blocks = o.storage ? [zh + t / 2 + 20, zf - t / 2 - 20].map((z) => [-1, 1].map((g) => k.part("Support block", [bw, 60, 40], [g * (inW / 4), ryS, z], { material: "wood" }))) : [];
+ const st = o.storage ? bedStorage(k, { xi, xo: xr + t / 2, zH: zh + t / 2 + 40, zF: zf - t / 2 - 40, zX: 0, yb, ch: slatY - 20 - yb, head: (g) => blocks[0][g < 0 ? 0 : 1], foot: (g) => blocks[1][g < 0 ? 0 : 1] }) : null;
// the headboard lies on its left post: turned a quarter about the depth axis
const lie = (keys: string[], from?: Vec3) => turnStage(b, keys, [0, 0, Math.PI / 2], [-W / 2, 0, zh], [0, 0, 0], from);
step(b, "Screw the cam bolts into the head posts", "Lay both posts on a rug, inside faces up: four bolts in each.", "cams", { scene: "head", tools: ["allen"], warnings: ["floor"] }, () => {
@@ -2351,6 +2393,19 @@ function buildWoodBed(b: PlanBuilder, s: ProductSpec) {
step(b, "Tap the glides into the posts", "One under each of the four posts.", "general", { scene: "ends", tools: ["hammer"] }, () =>
b.fits(GLIDE, [0, 1].flatMap((i) => [{ on: posts[i], z: zh }, { on: footboard, z: zf }].map((p): FitOpts => ({ on: p.on, at: [g2(i) * xp, 0, p.z], dir: [0, 1, 0], hole: false }))), 0.1),
);
+ if (o.storage)
+ for (const [j, end] of [board, footboard].entries()) {
+ const zb = j ? zf - t / 2 : zh + t / 2, n = j ? 1 : -1;
+ step(b, j ? "Tap the dowels into the foot blocks" : "Tap the dowels into the head blocks", "Two into the back of each block.", "dowels", { scene: "ends", tools: ["hammer"] }, () =>
+ b.fits(BED_DOWEL, blocks[j].flatMap((key, i) => [-1, 1].map((e): FitOpts => ({ on: key, at: [g2(i) * (inW / 4) + e * (bw / 2 - 80), ryS, zb], dir: [0, 0, n], mate: end }))), 0.1),
+ );
+ step(b, j ? "Screw the blocks to the footboard" : "Screw the blocks to the headboard", "Push them onto their dowels, low down on the inside, then three long screws through the board into each.", "screws", { scene: "ends", tools: ["allen"] }, () => {
+ b.stagger(0.2);
+ for (const key of blocks[j]) b.stage(key, k.pos(key), [0, 0, 0], [0, 0, -n * 200]);
+ b.then(0.15);
+ b.fits(BLOCK_SCREW, blocks[j].flatMap((key, i) => [-1, 0, 1].map((e): FitOpts => ({ on: end, at: [g2(i) * (inW / 4) + e * (bw / 2 - 60), ryS, j ? zf + t / 2 : zh - t / 2], dir: [0, 0, -n], mate: key }))), 0.08);
+ });
+ }
step(b, "Tap the dowels into the side rails", "Three into each end of both rails.", "dowels", { scene: "rails", tools: ["hammer"], warnings: ["floor"] }, () => {
b.stagger(0.2);
rails.forEach((key, i) => b.stage(key, [g2(i) * 200, t / 2, 0], [0, 0, (-g2(i) * Math.PI) / 2], [0, 160, 0]));
@@ -2363,12 +2418,17 @@ function buildWoodBed(b: PlanBuilder, s: ProductSpec) {
step(b, i ? "Fit the other side rail" : "Join a side rail to the head and foot", i ? "The same way on the other side. Then tighten all eight cam locks." : "One holds the headboard and footboard upright while the other pushes the rail onto the hanger bolts at both ends and turns its cam locks.", "cams", { people: 2, tools: ["screwdriver"] }, () => {
if (!i) {
b.stagger(0);
- for (const key of [...posts, board, spin]) b.add(key, [0, 0, -300]);
- b.add(footboard, [0, 0, 300]);
+ for (const key of [...posts, board, spin, ...(blocks[0] ?? [])]) b.add(key, [0, 0, -300]);
+ for (const key of [footboard, ...(blocks[1] ?? [])]) b.add(key, [0, 0, 300]);
b.then(0.15);
}
b.add(rails[i], [g2(i) * 300, 0, 0]);
});
+ if (st) {
+ storageFrameSteps(b, st, rails, xi, 0);
+ braceStep(b, rails, (g, h) => blocks[h ? 0 : 1][g < 0 ? 0 : 1], xi, ryS, zh + t / 2 + 40, zf - t / 2 - 40);
+ lockRunnersStep(b, st);
+ }
step(b, "Screw on the slat rails", "Along the inside of each side rail, eight screws each.", "screws", { tools: ["screwdriver"] }, () => {
b.stagger(0.2);
for (const [i, key] of slatRails.entries()) b.add(key, [g2(i) * -200, 100, 0]);
@@ -2398,6 +2458,7 @@ function buildWoodBed(b: PlanBuilder, s: ProductSpec) {
b.then(0.1);
b.fits(HOLDER_SCREW, ha.map(([x, z]): FitOpts => ({ on: Math.abs(x) > 200 ? slatRails[x < 0 ? 0 : 1] : beams[z < 0 ? 0 : 1], at: [x, slatY + 30, z], dir: [0, -1, 0] })), 0.06);
});
+ if (st) bedDrawerSteps(b, st);
return true;
}
@@ -2742,6 +2803,350 @@ function buildOttomanBed(b: PlanBuilder, s: ProductSpec) {
return true;
}
+/* ---------- the storage beds: drawers under the frame ---------- */
+
+const RAIL_BRACKET: HwDef = { kind: "bracket", len: 160, dia: 60, name: "Cross rail bracket" };
+const ST_SCREW: HwDef = { kind: "screw", len: 16, dia: 5 };
+const LOCK_SCREW: HwDef = { kind: "screw", len: 10, dia: 4 };
+const BRACE: HwDef = { kind: "bracket", len: 300, dia: 30, name: "Corner brace" };
+const DR_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 6, name: "Long cam bolt" };
+const DR_CONN: HwDef = { kind: "clip", len: 20, dia: 16, name: "Plastic connector" };
+
+interface BedDrawer {
+ g: number; // -1 left, 1 right: the side it pulls out
+ zc: number;
+ front: string;
+ bottom: string;
+ sides: string[];
+ back: string;
+ xin: number; // inner end of the box
+ xout: number; // outer end of the box, against the front
+ wz: number;
+ bh: number;
+}
+interface BedStore {
+ cross: string;
+ ry: number;
+ rx: number; // middle of a runner, from the centre line
+ runners: (FitOpts & { def: HwDef })[][]; // left half, right half
+ drawers: BedDrawer[];
+}
+
+/**
+ * Four drawers hang on runners under the frame, two pulling out at each side: a cross rail across the middle of the
+ * bed, and the runners on the head end, both faces of the cross rail and the foot end. `xi` the inner faces of the
+ * side rails, `xo` their outer faces, `zH`/`zF` the faces the end runners screw to, `yb` the underside of the frame.
+ */
+function bedStorage(k: Kit, o: { xi: number; xo: number; zH: number; zF: number; zX: number; yb: number; ch: number; head: (g: number) => string; foot: (g: number) => string }): BedStore {
+ const cross = k.part("Cross rail", [2 * o.xi, o.ch, 20], [0, o.yb + o.ch / 2, o.zX]);
+ const ry = o.yb + 15;
+ const x0 = 100, x1 = o.xo - 20;
+ const dd = x1 - x0;
+ const rx = x0 + dd / 2;
+ const cells: [number, number][] = [[o.zH, o.zX - 10], [o.zX + 10, o.zF]];
+ const wz = Math.min(...cells.map(([a, c]) => c - a)) - 60;
+ const RUN: HwDef = { kind: "runner", len: Math.round((dd - 40) / 50) * 50, dia: 40 };
+ const run = (g: number, z: number, on: string, n: number): FitOpts & { def: HwDef } => ({ def: RUN, on, at: [g * rx, ry, z], dir: [0, 0, n], hole: false, twist: Math.PI / 2 });
+ const runners = [-1, 1].map((g) => [run(g, o.zH, o.head(g), -1), run(g, o.zX - 10, cross, 1), run(g, o.zX + 10, cross, -1), run(g, o.zF, o.foot(g), 1)]);
+ const bh = o.yb - 36 - 40;
+ const drawers = [-1, 1].flatMap((g) =>
+ cells.map(([a, c]): BedDrawer => {
+ const zc = (a + c) / 2;
+ const front = k.part("Drawer front", [18, o.yb - 30, wz + 20], [g * (o.xo - 11), 15 + (o.yb - 30) / 2, zc]);
+ const bottom = k.part("Drawer bottom", [dd, 16, wz], [g * (x0 + dd / 2), 28, zc]);
+ const sides = [-1, 1].map((e) => k.part("Drawer side", [dd, bh, 16], [g * (x0 + dd / 2), 36 + bh / 2, zc + e * (wz / 2 - 8)]));
+ const back = k.part("Drawer back", [16, bh, wz - 32], [g * (x0 + 8), 36 + bh / 2, zc]);
+ return { g, zc, front, bottom, sides, back, xin: x0, xout: x1, wz, bh };
+ }),
+ );
+ return { cross, ry, rx, runners, drawers };
+}
+
+/** The cross rail on its brackets and the eight runners, as both storage manuals show them. */
+function storageFrameSteps(b: PlanBuilder, st: BedStore, rails: string[], xi: number, zX: number) {
+ const y = b.partItem(st.cross).final.pos[1];
+ const g2 = (i: number) => (i ? 1 : -1);
+ step(b, "Screw the cross rail brackets to the side rails", "One halfway along the inside of each side rail, two screws each.", "screws", { tools: ["screwdriver"] }, () => {
+ b.fits(RAIL_BRACKET, [0, 1].map((i): FitOpts => ({ on: rails[i], at: [g2(i) * xi, y, zX], dir: [g2(i), 0, 0], hole: false })), 0.2);
+ b.then(0.1);
+ b.fits(ST_SCREW, [0, 1].flatMap((i) => [-20, 20].map((dy): FitOpts => ({ on: rails[i], at: [g2(i) * (xi - 2), y + dy, zX + 25], dir: [g2(i), 0, 0] }))), 0.1);
+ });
+ step(b, "Lay the cross rail in and screw it on", "Down into the two brackets, then two screws through each bracket into the rail.", "screws", { tools: ["screwdriver"] }, () => {
+ b.add(st.cross, [0, 300, 0]);
+ b.then(0.15);
+ b.fits(ST_SCREW, [0, 1].flatMap((i) => [-20, 20].map((dy): FitOpts => ({ on: st.cross, at: [g2(i) * (xi - 30), y + dy, zX - 13], dir: [0, 0, 1] }))), 0.1);
+ });
+ for (const i of [0, 1])
+ step(b, i ? "Screw on the runners for the right drawers" : "Screw on the runners for the left drawers", "Four runners, catch towards the side of the bed: on the head end, both faces of the cross rail and the foot end. Two screws each.", "runners", { tools: ["screwdriver"] }, () => {
+ const list = st.runners[i];
+ b.stagger(0.15);
+ for (const r of list) b.fit(r.def, r);
+ b.then(0.1);
+ b.fits(RUNNER_SCREW, list.flatMap((r) => [-1, 1].map((e): FitOpts => ({ on: r.on, at: [r.at[0] + e * (st.rx - 140), r.at[1], r.at[2] - r.dir[2] * 2], dir: r.dir }))), 0.06);
+ });
+}
+
+function lockRunnersStep(b: PlanBuilder, st: BedStore) {
+ step(b, "Lock the runners", "Sixteen small screws, one through the slot at each end of every runner. Check that each runner is level first.", "screws", { tools: ["screwdriver"] }, () => {
+ b.fits(LOCK_SCREW, st.runners.flat().flatMap((r) => [-1, 1].map((e): FitOpts => ({ on: r.on, at: [r.at[0] + e * (st.rx - 160), r.at[1] - 8, r.at[2] - r.dir[2] * 2], dir: r.dir }))), 0.03);
+ });
+}
+
+/** Four diagonal braces across the corners, which also square the frame. */
+function braceStep(b: PlanBuilder, rails: string[], ends: (g: number, head: boolean) => string, xi: number, y: number, zH: number, zF: number) {
+ step(b, "Screw in the corner braces", "One across each corner, a screw into the side rail and one into the end. Measure both diagonals: they must be the same.", "screws", { tools: ["screwdriver"], check: "square" }, () => {
+ const corners = [-1, 1].flatMap((g, i) => [true, false].map((h) => ({ g, rail: rails[i], end: ends(g, h), z: h ? zH : zF, e: h ? 1 : -1 })));
+ b.fits(BRACE, corners.map((c): FitOpts => ({ on: c.rail, at: [c.g * (xi - 100), y, c.z + c.e * 100], dir: [0, 1, 0], hole: false })), 0.15);
+ b.then(0.1);
+ b.fits(ST_SCREW, corners.flatMap((c): FitOpts[] => [
+ { on: c.rail, at: [c.g * (xi - 2), y, c.z + c.e * 200], dir: [c.g, 0, 0] },
+ { on: c.end, at: [c.g * (xi - 200), y, c.z + c.e * 2], dir: [0, 0, -c.e] },
+ ]), 0.06);
+ });
+}
+
+/** The drawers, built on the floor as the manuals draw them: one shown, the other three built the same way. */
+function bedDrawerSteps(b: PlanBuilder, st: BedStore) {
+ const ds = st.drawers, d0 = ds[0];
+ const rel = (key: string, d: BedDrawer = d0, j = 0): Vec3 => {
+ const p = b.partItem(key).final.pos;
+ const c = b.partItem(d.bottom).final.pos;
+ return [p[0] - c[0] + j * (d0.xout - d0.xin + 260), p[1], p[2] - c[2]];
+ };
+ const put = (key: string, from?: Vec3, d?: Vec3) => {
+ const r = rel(key);
+ b.stage(key, d ? [r[0] + d[0], r[1] + d[1], r[2] + d[2]] : r, b.partItem(key).final.rot, from);
+ };
+ const g = d0.g;
+ const fits = (d: BedDrawer) => {
+ const xc = b.partItem(d.bottom).final.pos[0];
+ const ze = (e: number) => d.zc + e * (d.wz / 2 - 8);
+ return {
+ bolts: [-1, 1].flatMap((e, i) => [-1, 1].map((f): FitOpts & { def: HwDef } => ({ def: HW.camScrew, on: d.bottom, at: [xc + f * 200, 36, ze(e)], dir: [0, 1, 0], mate: d.sides[i], mateHole: 4 }))),
+ conns: [-1, 1].map((e): FitOpts & { def: HwDef } => ({ def: DR_CONN, on: d.bottom, at: [d.g * d.xout, 28, d.zc + e * (d.wz / 2 - 120)], dir: [d.g, 0, 0], hole: false })),
+ dowels: [-1, 1].map((e, i): FitOpts & { def: HwDef } => ({ def: HW.dowel, on: d.sides[i], at: [xc + d.g * 100, 36, ze(e)], dir: [0, -1, 0], mate: d.bottom })),
+ cams: [-1, 1].flatMap((e, i) => [-1, 1].map((f): FitOpts & { def: HwDef } => ({ def: HW.cam, on: d.sides[i], at: [xc + f * 200, 66, ze(e) - e * 8], dir: [0, 0, e] }))),
+ backBolts: [-1, 1].flatMap((e) => [-1, 1].map((f): FitOpts & { def: HwDef } => ({ def: DR_BOLT, on: d.back, at: [d.g * (d.xin + 8), 36, d.zc + e * (d.wz / 2 - 60) + f * 30], dir: [0, -1, 0], mate: d.bottom }))),
+ backCams: [-1, 1].flatMap((e) => [-1, 1].map((f): FitOpts & { def: HwDef } => ({ def: HW.cam, on: d.back, at: [d.g * (d.xin + 16), 66, d.zc + e * (d.wz / 2 - 60) + f * 30], dir: [-d.g, 0, 0] }))),
+ };
+ };
+ const f0 = fits(d0);
+ const fitAll = (list: (FitOpts & { def: HwDef })[], gap = 0.08) => list.forEach((x, i) => { if (i) b.wait(gap); b.fit(x.def, x); });
+ const sc = { scene: "drawer", repeat: ds.length };
+ step(b, "Screw the cam bolts into the drawer bottom", "Lay the bottom on a rug, four bolts near the short edges.", "cams", { ...sc, tools: ["allen"], warnings: ["floor"] }, () => {
+ put(d0.bottom, [0, 120, 0]);
+ b.then(0.15);
+ fitAll(f0.bolts);
+ });
+ step(b, "Press the connectors into the front edge", "Two into the holes along the edge where the front goes.", "general", sc, () => fitAll(f0.conns, 0.15));
+ step(b, "Tap a dowel into each side", "Into the hole in the bottom edge, near the front end.", "dowels", { ...sc, tools: ["hammer"] }, () => {
+ b.stagger(0.2);
+ d0.sides.forEach((key, i) => put(key, [0, 120, 0], [0, 0, (i ? 1 : -1) * 260]));
+ b.then(0.15);
+ fitAll(f0.dowels, 0.15);
+ });
+ step(b, "Push the front onto the connectors", "Stand it on the rug against the edge of the bottom and press until it clicks.", "join", sc, () => put(d0.front, [g * 260, 0, 0]));
+ step(b, "Stand the sides on the bottom", "Onto the cam bolts and dowels, ends against the front.", "join", sc, () => {
+ b.stagger(0.2);
+ d0.sides.forEach((key, i) => put(key, undefined, [0, 200, (i ? 1 : -1) * 120]));
+ b.then(0.05);
+ for (const key of d0.sides) put(key);
+ });
+ step(b, "Lock the sides", "Four cam locks, arrow towards the bolt, then a clockwise turn.", "cams", { ...sc, tools: ["screwdriver"] }, () => fitAll(f0.cams, 0.1));
+ step(b, "Screw the cam bolts into the back", "Four along its bottom edge.", "cams", { ...sc, tools: ["allen"] }, () => {
+ put(d0.back, [0, 120, 0], [-g * 260, 0, 0]);
+ b.then(0.15);
+ fitAll(f0.backBolts, 0.1);
+ });
+ step(b, "Stand the back on the bottom", "Between the sides at the open end, onto its bolts.", "join", sc, () => {
+ put(d0.back, undefined, [0, 200, 0]);
+ b.then(0.05);
+ put(d0.back);
+ });
+ step(b, "Lock the back", `Four cam locks. Build the other ${ds.length - 1} drawers the same way.`, "cams", { ...sc, tools: ["screwdriver"] }, () => {
+ fitAll(f0.backCams, 0.1);
+ b.then(0.3);
+ ds.slice(1).forEach((d, j) => {
+ for (const key of [d.bottom, d.front, ...d.sides, d.back]) {
+ b.stage(key, rel(key, d, j + 1), b.partItem(key).final.rot);
+ }
+ const f = fits(d);
+ for (const x of [...f.bolts, ...f.conns, ...f.dowels, ...f.cams, ...f.backBolts, ...f.backCams]) b.preset(x.def, x);
+ });
+ });
+ step(b, "Pull the runners out", "All eight, as far as they go.", "drawer", {}, () => {});
+ step(b, "Hang the drawers on the runners", "Lay each drawer on its pair of runners and press down at the front until both catches click. Then push it in.", "drawer", {}, () => {
+ for (const d of ds) {
+ b.stagger(0);
+ for (const key of [d.bottom, d.front, ...d.sides, d.back]) b.add(key, [d.g * 500, 0, 0]);
+ b.wait(0.25);
+ }
+ });
+}
+
+const KEY_BOLT: HwDef = { kind: "bolt", len: 16, dia: 8, name: "Keyhole bolt" };
+const BRACKET_SCREW: HwDef = { kind: "screw", len: 16, dia: 6 };
+const CORNER_SCREW: HwDef = { kind: "screw", len: 30, dia: 5 };
+const CORNER_A: HwDef = { kind: "angle", len: 280, dia: 60, name: "Corner bracket" };
+const GRIP: HwDef = { kind: "clip", len: 20, dia: 25, name: "Slat stop" };
+const HANG_BOLT: HwDef = { kind: "bolt", len: 20, dia: 6 };
+
+/**
+ * The upholstered storage bed, from its manual: corner brackets and a leg go on each side rail, keyhole bolts and
+ * two legs on the head box, two people hang the side rails and the foot board on the bolts, braces square the
+ * corners. The headboard is lowered over the head box and bolted on, its cover pulled down over it. Under the frame a
+ * cross rail and eight runners carry four drawers; the centre beam drops into its hangers and the slats lie on top.
+ */
+function buildUphStorageBed(b: PlanBuilder, s: ProductSpec) {
+ const k = new Kit(b);
+ const [MW, ML] = mattressOf(s);
+ const W = s.size.w * 10, L = s.size.d * 10, HB = s.size.h * 10;
+ const FH = 490, LH = 190, RT = 50, ET = 35;
+ const yb = LH, RH = FH - LH, ry = yb + RH / 2;
+ const xs = MW / 2 + RT / 2, xi = MW / 2, xo = MW / 2 + RT;
+ const HD = Math.max(150, L - ML - ET);
+ const z0 = -L / 2, zH = z0 + HD, zF = L / 2 - ET;
+ const head = b.compound("Headboard", [
+ { shape: "box", size: [W, HB - FH, HD], pos: [0, FH + (HB - FH) / 2, z0 + HD / 2] },
+ { shape: "box", size: [W, FH - 30, 40], pos: [0, 30 + (FH - 30) / 2, z0 + 20] },
+ ...[-1, 1].map((g) => ({ shape: "box" as const, size: [(W - MW) / 2, FH - 30, HD - 40] as Vec3, pos: [g * (W / 2 - (W - MW) / 4), 30 + (FH - 30) / 2, z0 + 40 + (HD - 40) / 2] as Vec3 })),
+ ], { material: "soft" });
+ const headboard = b.place(head.type, head.mid);
+ const box = k.part("Head box", [MW, RH, HD - 40], [0, ry, z0 + 40 + (HD - 40) / 2]);
+ const ledgeY = FH - 90;
+ const zr = (zH + L / 2) / 2;
+ // each side rail comes with its slat ledge fixed along the inside
+ const rails = [-1, 1].map((g) => {
+ const c = b.compound(g < 0 ? "Left side rail" : "Right side rail", [
+ { shape: "box", size: [RT, RH, L / 2 - zH], pos: [g * xs, ry, zr], material: "soft" },
+ { shape: "box", size: [30, 22, ML - 20], pos: [g * (xi - 15), ledgeY, (zH + zF) / 2], material: "wood" },
+ ], { material: "soft" });
+ return b.place(c.type, c.mid);
+ });
+ const foot = k.part("Foot board", [MW, RH, ET], [0, ry, zF + ET / 2], { material: "soft" });
+ const legAt: Vec3[] = [...[-1, 1].map((g): Vec3 => [g * (xi - 40), LH / 2, z0 + 40 + (HD - 40) / 2]), ...[-1, 1].map((g): Vec3 => [g * xs, LH / 2, L / 2 - 40])];
+ const legs = legAt.map((p) => k.part("Leg", [50, LH, 50], p, { shape: "cyl", material: "wood" }));
+ const zX = (zH + zF) / 2;
+ const st = bedStorage(k, { xi, xo, zH, zF, zX, yb, ch: 80, head: () => box, foot: () => foot });
+ const halfL = ML / 2;
+ const by = ledgeY - 19;
+ const beams = [-1, 1].map((e) => k.part("Centre beam half", [50, 60, halfL - 10], [0, by, zX + (e * halfL) / 2], { material: "metal" }));
+ const strips = [
+ ...[-1, 1].flatMap((g) => [-1, 0, 1].map((e) => k.part("Grip strip", [30, 2, ML / 3 - 20], [g * (xi - 15), ledgeY + 12, zX + (e * ML) / 3], { material: "fiber" }))),
+ ...[-1, 0, 1].map((e) => k.part("Beam grip strip", [40, 2, ML / 3 - 20], [0, by + 31, zX + (e * ML) / 3], { material: "fiber" })),
+ ];
+ const slats = [-1, 1].map((g) => slatBase(b, MW / 2 - 20, ML - 20, ledgeY + 17, zX, true, g * (MW / 4 + 2)));
+ const g2 = (i: number) => (i ? 1 : -1);
+ const lay = (key: string, i: number) => b.stage(key, [g2(i) * 200, (RT + 30) / 2, 0], [0, 0, (-g2(i) * Math.PI) / 2], [0, 160, 0]);
+ // corner brackets: A at the head end of each rail, B at the foot end
+ const corners = [0, 1].flatMap((i) => [zH, zF].map((z) => ({ i, z, e: z === zH ? 1 : -1 })));
+ step(b, "Screw the corner brackets to the side rails", "Lay both rails on a rug, inside up. The brackets marked A go at the head end, B at the foot end: two screws each.", "screws", { scene: "prep", tools: ["allen"], warnings: ["floor"] }, () => {
+ b.stagger(0.2);
+ rails.forEach((key, i) => lay(key, i));
+ b.then(0.15);
+ b.fits(CORNER_A, corners.map((c): FitOpts => ({ on: rails[c.i], at: [g2(c.i) * xi, ry, c.z + c.e * 20], dir: [g2(c.i), 0, 0], hole: false })), 0.12);
+ b.then(0.1);
+ b.fits(BRACKET_SCREW, corners.flatMap((c) => [-60, 60].map((dy): FitOpts => ({ on: rails[c.i], at: [g2(c.i) * (xi - 2), ry + dy, c.z + c.e * 20], dir: [g2(c.i), 0, 0] }))), 0.06);
+ });
+ step(b, "Stick the felt pads under the legs", "Peel four off the sheet, one under each leg.", "general", { scene: "legs" }, () => {
+ b.stagger(0.1);
+ legs.forEach((key, i) => b.stage(key, [(i - 1.5) * 120, LH / 2, 0], [0, 0, 0], [0, 120, 0]));
+ b.then(0.15);
+ b.fits(BED_PAD, legAt.map((p, i): FitOpts => ({ on: legs[i], at: [p[0], 0, p[2]], dir: [0, 1, 0], hole: false })), 0.1);
+ });
+ step(b, "Screw a leg into each side rail", "Into the foot bracket, by hand until it stops.", "legs", { scene: "prep" }, () => {
+ b.stagger(0.2);
+ [2, 3].forEach((j, i) => b.stage(legs[j], [g2(i) * 200 - g2(i) * (RH / 2 + LH / 2), RT / 2, L / 2 - 40 - zr], [0, 0, (-g2(i) * Math.PI) / 2], [-g2(i) * 200, 0, 0]));
+ });
+ const keyAt = (on: string, z: number, n: number) => [-1, 1].flatMap((g) => [ry - 70, ry + 70].map((y): FitOpts => ({ on, at: [g * (xi - 25), y, z], dir: [0, 0, n] })));
+ step(b, "Screw the keyhole bolts into the head box and the foot board", "Four in each, near the ends. Screw them in until they stop: the heads must stand out a little.", "screws", { scene: "ends", tools: ["allen"] }, () => {
+ b.stagger(0.2);
+ b.stage(box, [0, ry, -500], [0, 0, 0], [0, 160, 0]);
+ b.stage(foot, [0, ry, 500], [0, 0, 0], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(KEY_BOLT, [...keyAt(box, zH + 4, -1), ...keyAt(foot, zF - 4, 1)], 0.06);
+ });
+ step(b, "Screw two legs under the head box", "One under each end, by hand.", "legs", { scene: "ends" }, () => {
+ b.stagger(0.2);
+ [0, 1].forEach((j) => b.stage(legs[j], [legAt[j][0], legAt[j][1], legAt[j][2] - k.pos(box)[2] - 500], [0, 0, 0], [0, -200, 0]));
+ });
+ for (const i of [0, 1])
+ step(b, i ? "Hang the other side rail on" : "Hang a side rail on the head box", "One holds the box while the other hooks the bracket over the keyhole bolts and pushes it down. Then two bolts through the bracket.", "join", { people: 2, tools: ["allen"] }, () => {
+ if (!i) {
+ b.stagger(0);
+ b.add(box, [0, 0, 0]);
+ b.add(legs[0], [0, 0, 0]);
+ b.add(legs[1], [0, 0, 0]);
+ b.then(0.15);
+ }
+ b.stagger(0);
+ b.add(rails[i], [0, 60, 0]);
+ b.add(legs[2 + i], [0, 60, 0]);
+ b.then(0.15);
+ b.fits(KEY_BOLT, [ry - 30, ry + 30].map((y): FitOpts => ({ on: rails[i], at: [g2(i) * (xi - 30), y, zH + 4], dir: [0, 0, -1], mate: box })), 0.1);
+ });
+ step(b, "Hang the foot board on", "Between the rails, so its keyhole bolts drop into the B brackets. Push it down.", "join", { people: 2 }, () => b.add(foot, [0, 60, 0]));
+ step(b, "Bolt the foot corners", "Two bolts through each B bracket into the foot board.", "screws", { tools: ["allen"] }, () =>
+ b.fits(KEY_BOLT, [0, 1].flatMap((i) => [ry - 30, ry + 30].map((y): FitOpts => ({ on: rails[i], at: [g2(i) * (xi - 20), y, zF - 4], dir: [0, 0, 1], mate: foot }))), 0.1),
+ );
+ braceStep(b, rails, (_, h) => (h ? box : foot), xi, yb + 30, zH, zF);
+ step(b, "Tighten the corner brackets", "Sixteen screws, four in each bracket.", "screws", { tools: ["screwdriver"] }, () =>
+ b.fits(CORNER_SCREW, corners.flatMap((c) => [-110, -40, 40, 110].map((dy): FitOpts => ({ on: rails[c.i], at: [g2(c.i) * (xi - 2), ry + dy * 0.9, c.z + c.e * 45], dir: [g2(c.i), 0, 0] }))), 0.04),
+ );
+ step(b, "Tap the dowels into the headboard", "Lay it face down on a rug: four into the underside of the cushion.", "dowels", { scene: "head", tools: ["hammer"], warnings: ["face", "floor"] }, () => {
+ b.stage(headboard, [0, HD / 2, HB / 2 - 200], [-Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(BED_DOWEL, spread(-MW / 2 + 150, MW / 2 - 150, 4).map((x): FitOpts => ({ on: headboard, at: [x, FH, zH - 60], dir: [0, -1, 0], mate: box })), 0.1);
+ });
+ step(b, "Lower the headboard onto the head box", "Together: hold it upright over the box and let it down so the dowels find their holes.", "join", { people: 2 }, () => b.add(headboard, [0, 500, 0]));
+ const studs = [-1, 0, 1].flatMap((e) => [ry - 60, ry + 60].map((y): FitOpts => ({ on: box, at: [e * (MW / 2 - 200), y, zH], dir: [0, 0, -1] })));
+ step(b, "Bolt the headboard to the box", "Six studs through the box into the headboard, then a washer and a nut on each. Tighten with the spanner.", "screws", { tools: ["wrench"] }, () => {
+ b.fits(OT_STUD, studs, 0.08);
+ b.then(0.1);
+ b.fits(OT_WASHER, studs.map((x) => ({ ...x, at: [x.at[0], x.at[1], zH + 2] as Vec3, hole: false as const })), 0.06);
+ b.fits(OT_NUT, studs.map((x) => ({ ...x, at: [x.at[0], x.at[1], zH + 4] as Vec3, hole: false as const })), 0.06);
+ });
+ step(b, "Pull the headboard cover down", "Over the box at both sides and close the touch fastening underneath.", "general", {}, () => {});
+ step(b, "Tuck the cover round the legs", "Fold the corners neatly round each head leg.", "general", {}, () => {});
+ storageFrameSteps(b, st, rails, xi, zX);
+ step(b, "Join the centre beam halves", "Push the two halves into the sleeve so their ends meet in the middle.", "general", { scene: "beam" }, () => {
+ b.stagger(0.3);
+ beams.forEach((key, i) => b.stage(key, [0, 30, (g2(i) * halfL) / 2], [0, 0, 0], [0, 0, g2(i) * 300]));
+ b.then(0.1);
+ b.fit(BEAM_SLEEVE, { on: beams[0], at: [0, by, zX - 5], dir: [0, 0, 1], hole: false });
+ });
+ lockRunnersStep(b, st);
+ const hang = [{ on: box, z: zH, n: -1 }, { on: foot, z: zF, n: 1 }];
+ step(b, "Bolt the beam hangers on", "One in the middle of the head box and one in the middle of the foot board, two bolts each.", "screws", { tools: ["allen"] }, () => {
+ b.fits(BEAM_BRACKET, hang.map((h): FitOpts => ({ on: h.on, at: [0, by, h.z], dir: [0, 0, h.n], hole: false })), 0.2);
+ b.then(0.1);
+ b.fits(HANG_BOLT, hang.flatMap((h) => [-25, 25].map((dx): FitOpts => ({ on: h.on, at: [dx, by - 40, h.z + -h.n * 2], dir: [0, 0, h.n] }))), 0.1);
+ });
+ step(b, "Lay the centre beam in", "Head end first, into its hanger.", "join", {}, () => {
+ b.stagger(0.1);
+ for (const key of beams) b.add(key, [0, 300, 0]);
+ });
+ step(b, "Press the foot end down", "Into the hanger at the foot board until it sits flat.", "general", {}, () => {});
+ step(b, "Lay the grip strips on the ledges", "Three along each slat ledge, end to end, with a stop over each.", "general", {}, () => {
+ b.stagger(0.1);
+ for (const key of strips.slice(0, 6)) b.add(key, [0, 150, 0]);
+ b.then(0.1);
+ b.fits(GRIP, strips.slice(0, 6).map((key): FitOpts => ({ on: key, at: [k.pos(key)[0], ledgeY + 13, k.pos(key)[2]], dir: [0, -1, 0], hole: false })), 0.06);
+ });
+ step(b, "Lay the grip strips on the beam", "Three along the centre beam, end to end, a stop at each end.", "general", {}, () => {
+ b.stagger(0.1);
+ for (const key of strips.slice(6)) b.add(key, [0, 150, 0]);
+ b.then(0.1);
+ b.fits(GRIP, [zH + 30, zF - 30].map((z): FitOpts => ({ on: beams[z < zX ? 0 : 1], at: [0, by + 32, z], dir: [0, -1, 0], hole: false })), 0.1);
+ });
+ step(b, "Roll out the slats", "The slatted bases are sold separately. One each side of the beam, starting at the head end.", "slats", {}, () => {
+ b.stagger(0.3);
+ for (const key of slats) b.add(key, [0, 200, -400]);
+ });
+ bedDrawerSteps(b, st);
+ return true;
+}
+
/* ---------- the family ---------- */
const family: Family = {
@@ -2763,8 +3168,10 @@ const family: Family = {
if (/idanas-console-table/.test(slug)) return buildConsole(b, s);
if (/idanas-desk/.test(slug)) return buildDesk(b, s);
if (/idanas-upholstered-bed-frame/.test(slug)) return buildUpholsteredBed(b, s);
- if (/idanas-bed-frame-standard-double/.test(slug)) return buildWoodBed(b, s);
+ if (/idanas-bed-frame-standard-double|idanas-bed-frame-160-x-200/.test(slug)) return buildWoodBed(b, s);
+ if (/idanas-bed-frame-storage/.test(slug)) return buildWoodBed(b, s, { storage: true });
if (/idanas-upholstered-ottoman/.test(slug)) return buildOttomanBed(b, s);
+ if (/idanas-upholstered-storage-bed/.test(slug)) return buildUphStorageBed(b, s);
return false;
},
};
diff --git a/src/lib/plan/families/idasen.ts b/src/lib/plan/families/idasen.ts
index a94eb65..06a6da0 100644
--- a/src/lib/plan/families/idasen.ts
+++ b/src/lib/plan/families/idasen.ts
@@ -71,7 +71,8 @@ function desk(s: ProductSpec): CustomParams {
});
const joints = [-1, 1].flatMap((j) => [j * (xj - 40), j * (xj + 40)].flatMap((x) => [yB - 10, yB + 10].map((y): Vec3 => [x, y, BEAM_D / 2])));
- const colScrews = (sx: number, i: number) => fx("screw", [-1, 1].flatMap((sz) => [yB - 10, yB + 10].map((y): Vec3 => [sx * xc, y, sz * (BEAM_D / 2 - 3)])), [0, 0, 1], i ? "BEAM_R" : "BEAM_L", { len: 12, dia: 6, mate: cols[i] });
+ // two through each side wall of the beam end, going in towards the column
+ const colScrews = (sx: number, i: number) => [-1, 1].map((sz) => fx("screw", [yB - 12, yB + 12].map((y): Vec3 => [sx * xc, y, sz * (BEAM_D / 2 - 3)]), [0, 0, -sz], i ? "BEAM_R" : "BEAM_L", { len: 12, dia: 6, mate: cols[i] }));
const brScrews = (sx: number, i: number) => fx("screw", [-14, 14].map((z): Vec3 => [sx * (xe + 30), yB, z]), [-sx, 0, 0], brackets[i], { len: 12, dia: 6, mate: i ? "BEAM_R" : "BEAM_L" });
const topBolts = (sx: number, i: number) => fx("bolt", [-1, 1].flatMap((sz) => [brD / 2 - 30, brD / 2 - 90].map((z): Vec3 => [sx * (xe + 15), yB - BEAM_H / 2, sz * z])), [0, 1, 0], brackets[i], { len: 20, dia: 6, mate: "TOP" });
const feet = [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xc, 0, sz * zFoot]));
@@ -93,7 +94,7 @@ function desk(s: ProductSpec): CustomParams {
tools: ["allen"],
},
{ title: "Turn the beam over and fit the columns", detail: "Push one column into the bracket at each end, the flat side to the end.", add: cols },
- { title: "Screw the columns to the beam", detail: "Four screws for each, two through each side of the beam end.", fix: [colScrews(-1, 0), colScrews(1, 1)], tools: ["allen"] },
+ { title: "Screw the columns to the beam", detail: "Four screws for each, two through each side of the beam end.", fix: [...colScrews(-1, 0), ...colScrews(1, 1)], tools: ["allen"] },
{ title: "Screw on the end brackets", detail: "One across each end of the beam, two screws each. Their curved edges face out.", add: brackets, fix: [brScrews(-1, 0), brScrews(1, 1)], tools: ["allen"] },
{
title: "Lay the frame on the top and bolt it on",
@@ -217,8 +218,9 @@ function unitDrawer(b: PlanBuilder, s: ProductSpec, d: ReturnType<typeof unitDim
b.step({ title, detail, tools: o.tools, scene, pose: o.pose ?? "+z", kind: "drawer" }, body);
const tabs = file ? 6 : 4;
const boxScrews: FitOpts[] = [-1, 1].flatMap((g) => Array.from({ length: tabs / 2 }, (_, k) => ({ on: sides[g < 0 ? 0 : 1], at: [g * (dw / 2 - 10), yb + ((k + 1) * d.bh) / (tabs / 2 + 1), zb] as Vec3, dir: [0, 0, 1] as Vec3, mate: front })));
- const couplings: FitOpts[] = [-1, 1].map((g) => ({ on: bottom, at: [g * (dw / 2 - 30), yb, zb - 40], dir: [0, 1, 0], hole: false }));
- const couplingScrews: FitOpts[] = [-1, 1].flatMap((g) => [-62, -18].map((dz): FitOpts => ({ on: bottom, at: [g * (dw / 2 - 30), yb, zb - 40 + dz], dir: [0, 1, 0] })));
+ // each coupling is held by two short screws from below, through its plate into the drawer bottom
+ const couplings: FitOpts[] = [-1, 1].map((g) => ({ on: bottom, at: [g * (dw / 2 - 30), yb, zb - 80], dir: [0, 1, 0], hole: false }));
+ const couplingScrews: FitOpts[] = [-1, 1].flatMap((g) => [-24, 24].map((dz): FitOpts => ({ on: bottom, at: [g * (dw / 2 - 30), yb - 10, zb - 80 + dz], dir: [0, 1, 0] })));
const name = file ? "the file drawer" : "the small drawer";
st(`Hook a side onto the back of ${name}`, "Slide the hooks on the side's edge into the slots in the back and push it down.", () => {
@@ -246,7 +248,7 @@ function unitDrawer(b: PlanBuilder, s: ProductSpec, d: ReturnType<typeof unitDim
st("Screw the support wheel under the back", "Turn the drawer over again. Two screws through its plate into the bottom.", () => {
stage(wheel, [0, -160, 0]);
b.then(0.1);
- b.fits(PAN_SCREW, [-12, 12].map((x): FitOpts => ({ on: wheel, at: [x, yb, zb - dd + 40], dir: [0, 1, 0], mate: bottom })), 0.1);
+ b.fits(PAN_SCREW, [-12, 12].map((x): FitOpts => ({ on: wheel, at: [x, yb - 6, zb - dd + 40], dir: [0, 1, 0], mate: bottom })), 0.1);
}, { tools: ["screwdriver"], pose: "-y" });
void D;
return all;
diff --git a/src/lib/plan/families/ikea.ts b/src/lib/plan/families/ikea.ts
index 6a2aa91..e4dfd52 100644
--- a/src/lib/plan/families/ikea.ts
+++ b/src/lib/plan/families/ikea.ts
@@ -5,7 +5,7 @@ import { buildCustom } from "../custom";
/**
* Products whose name starts with "IKEA" (IKEA PS, IKEA PS 2026, IKEA PS LÖMSK): unrelated designs that share only
* the brand word, so each one is its own recipe, read from its own manual and picked by its slug. Products with no
- * manual (the folding chair, the side table, the rattan footstool) keep their old guides.
+ * manual (the folding chair, the side table, the rattan footstool) come assembled: their guides only unpack them.
*/
/** Parts built on their own (a drawer, a seat, a side laid out on the rug): shown moved by `off` until recipe step `until`, where they move into place from `from`. */
@@ -424,8 +424,10 @@ function bedside(s: ProductSpec): R {
detail: "Into its back edge.",
fix: [fix("dowel", [-1, 1].map((sx) => [sx * (iw / 4), yb + t / 2, -D / 2 + t] as Vec3), [0, 0, -1], "F", "B", 30, 8)],
tools: ["hammer"],
+ wait: ["F"],
},
- { title: "Fit the shelf and lock it", detail: "Onto the cam pins and the dowels in the back, then turn its two cam locks.", add: ["F"], fix: [shelfCams(-1)], tools: ["screwdriver"] },
+ // it goes in at a slant: down onto the cam pins and back onto the dowels at once
+ { title: "Fit the shelf and lock it", detail: "Onto the cam pins and the dowels in the back, then turn its two cam locks.", add: ["F"], fix: [shelfCams(-1)], tools: ["screwdriver"], from: { F: [220, 0, 220] } },
{
title: "Push a pin and washer in for the door",
detail: "Into the hole at the front of the side, just above the shelf.",
@@ -530,15 +532,15 @@ function shelving(s: ProductSpec): R {
title: "Bolt one rail to a ladder",
detail: "Stand the ladder on its edge. One bolt through the back upright into the end of the rail.",
add: ["L0", "R0"],
- fix: [fix("bolt", [[-xl - uw / 2, yr[0], -zu]], [1, 0, 0], "L0", "R0", 90, 6)],
+ fix: [fix("bolt", [[-xl - uw / 2, yr[0] - 12, -zu]], [1, 0, 0], "L0", "R0", 90, 6)],
tools: ["allen"],
},
- { title: "Bolt on the second rail", detail: "At the other end of the same ladder.", add: ["R1"], fix: [fix("bolt", [[-xl - uw / 2, yr[1], -zu]], [1, 0, 0], "L0", "R1", 90, 6)], tools: ["allen"] },
+ { title: "Bolt on the second rail", detail: "At the other end of the same ladder.", add: ["R1"], fix: [fix("bolt", [[-xl - uw / 2, yr[1] - 12, -zu]], [1, 0, 0], "L0", "R1", 90, 6)], tools: ["allen"] },
{
title: "Bolt the second ladder onto the rails",
detail: "Holes facing the first ladder. One bolt into each rail.",
add: ["L1"],
- fix: [fix("bolt", [0, 1].map((ri) => [xl + uw / 2, yr[ri], -zu] as Vec3), [-1, 0, 0], "L1", undefined, 90, 6)],
+ fix: [fix("bolt", [0, 1].map((ri) => [xl + uw / 2, yr[ri] - 12, -zu] as Vec3), [-1, 0, 0], "L1", undefined, 90, 6)],
tools: ["allen"],
},
{
@@ -558,7 +560,7 @@ function shelving(s: ProductSpec): R {
detail: "Through the back uprights: one screw into each shelf and one more into each rail end.",
fix: [
...[-1, 1].map((sx, i) => fix("screw", tops.map((y) => [sx * (xl + uw / 2), y - st / 2, -zu] as Vec3), [-sx, 0, 0], `L${i}`, undefined, 60, 5)),
- ...[-1, 1].map((sx, i) => fix("screw", [0, 1].map((ri) => [sx * (xl + uw / 2), yr[ri] + 14, -zu] as Vec3), [-sx, 0, 0], `L${i}`, undefined, 60, 5)),
+ ...[-1, 1].map((sx, i) => fix("screw", [0, 1].map((ri) => [sx * (xl + uw / 2), yr[ri] + 12, -zu] as Vec3), [-sx, 0, 0], `L${i}`, undefined, 60, 5)),
],
tools: ["allen"],
},
@@ -609,11 +611,12 @@ function stool(s: ProductSpec): R {
const parts: CustomPart[] = [
disc("S", "Seat", Dd, st, [0, ys + st / 2, 0], "wood"),
part("U", "Seat post", [pw, 250, pd], [-pw / 2, ys - 125, 0], "wood"),
- part("C", "Clamp strap", [2 * pw + 16, 60, pd + 12], [0, 250, 0], "soft", {
+ // the strap wraps both posts, its two ends running on past them to hold the lever's pivot bolt
+ part("C", "Clamp strap", [2 * pw + 56, 60, pd + 12], [20, 250, 0], "soft", {
pieces: [
- { shape: "box", size: [2 * pw + 16, 60, 5], pos: [0, 0, pd / 2 + 3] },
- { shape: "box", size: [2 * pw + 16, 60, 5], pos: [0, 0, -pd / 2 - 3] },
- { shape: "box", size: [5, 60, pd + 12], pos: [pw + 5, 0, 0] },
+ { shape: "box", size: [2 * pw + 56, 60, 5], pos: [0, 0, pd / 2 + 3] },
+ { shape: "box", size: [2 * pw + 56, 60, 5], pos: [0, 0, -pd / 2 - 3] },
+ { shape: "box", size: [5, 60, pd + 12], pos: [pw - 15, 0, 0] },
],
}),
part("V", "Lever", [26, 110, 34], [pw + 22, 240, 12], "wood"),
@@ -659,7 +662,7 @@ function stool(s: ProductSpec): R {
title: "Fix the base plate to the base post",
detail: "One bolt and two screws through the plate into the end of the post. Use a hand screwdriver, not a drill.",
add: ["L", "P"],
- fix: [fix("bolt", [[pw / 2, bt, 0]], UP, "P", "L", 50, 8), fix("screw", [-1, 1].map((sz) => [pw / 2, bt, sz * 22] as Vec3), UP, "P", "L", 30, 4)],
+ fix: [fix("bolt", [[pw / 2, bt, 0]], UP, "P", "L", 50, 8), fix("screw", [-1, 1].map((sz) => [pw / 2, bt, sz * 26] as Vec3), UP, "P", "L", 30, 4)],
tools: ["allen", "screwdriver"],
pose: "+y",
},
@@ -955,20 +958,20 @@ function sofaBed(s: ProductSpec): R {
const xi = xe - bw / 2;
const railL = 2 * xi;
const zr = ze - 20;
- const slatZ = [-0.37, -0.12, 0.12, 0.37].map((f) => Math.round(f * 2 * ze));
+ const slatZ = [-0.33, -0.11, 0.11, 0.33].map((f) => Math.round(f * 2 * ze));
const parts: CustomPart[] = [
end(-1, 0),
end(1, 1),
...[-1, 1].map((sz, i) => part(`R${i}`, "Long rail", [railL, bh, 40], [0, yBeam, sz * zr], "wood")),
part("M", "Middle rail", [bw, bh, 2 * zr - 40], [0, yBeam, 0], "wood"),
- ...slatZ.map((z, i) => part(`S${i}`, "Slat", [W - 2 * ld, slatT, 180], [0, yS + slatT / 2, z], "wood")),
+ ...slatZ.map((z, i) => part(`S${i}`, "Slat", [2 * xe + 30, slatT, 180], [0, yS + slatT / 2, z], "wood")),
part("K", "Backrest", [W - 40, 170, 25], [0, 640, -ze - 52], "wood"),
part("T", "Mattress", [W - 2 * ld - 20, seatTop - yS - slatT, 2 * ze + ld - 20], [0, (seatTop + yS + slatT) / 2, 0], "soft"),
...[-1, 1].map((sx, i) => part(`C${i}`, "Back cushion", [W / 2 - ld - 40, 260, 200], [sx * (W / 4 - ld / 2 + 10), seatTop + 130, -ze + 80], "soft", { shape: "cyl" })),
];
const corners = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx, sz] as const));
const slatScrews = (ids: number[]) =>
- ids.map((i) => fix("screw", [-1, 1].flatMap((sx) => [-50, 50].map((dz) => [sx * (xi - 20), yS + slatT, slatZ[i] + dz] as Vec3)), DOWN, `S${i}`, undefined, 40, 5));
+ ids.map((i) => fix("screw", [-1, 1].flatMap((sx) => [-50, 50].map((dz) => [sx * xe, yS + slatT, slatZ[i] + dz] as Vec3)), DOWN, `S${i}`, undefined, 40, 5));
const steps: CustomStep[] = [
{
title: "Tap the dowels into the end frames",
@@ -1484,7 +1487,83 @@ function glassCabinet(s: ProductSpec): R {
return { parts, steps, aside: [{ ids: ["S1"], until: 3, off: [-2 * xs, 0, D + 150], rot: [0, Math.PI, 0], from: [300, 0, 0] }] };
}
+/* ---------- sold assembled (no manual): the folding chair, the rattan footstool and the side table ---------- */
+
+/** A round rod from a to b (mm, relative to its part's centre), drawn as one cylinder. */
+function rod(a: Vec3, b: Vec3, d: number): PartPiece {
+ const v: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...v);
+ return { shape: "cyl", size: [d, len, d], pos: [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2], rot: [Math.atan2(v[2], v[1]), 0, Math.asin(-v[0] / len)] };
+}
+
+/** The folding chair: birch back legs with the backrest across their tops, black front legs, the seat hinged between. */
+function psFoldingChair(s: ProductSpec): R {
+ const W = mm(s.size.w), H = mm(s.size.h), D = mm(s.size.d);
+ const yS = mm(s.seat?.seatH ?? 46), xb = W / 2 - 15, xf = xb - 30;
+ const back = (sx: number): PartPiece => ({ shape: "box", size: [28, Math.hypot(H, 70), 36], pos: [sx * xb, 0, -D / 2 + 70], rot: [-Math.atan2(70, H), 0, 0] });
+ const front = (sx: number): PartPiece => {
+ const a: Vec3 = [sx * xf, -H / 2, D / 2 - 40], b: Vec3 = [sx * xf, yS - 30 - H / 2, -D / 2 + 110];
+ return { shape: "box", size: [24, Math.hypot(b[1] - a[1], b[2] - a[2]), 30], pos: [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2], rot: [Math.atan2(b[2] - a[2], b[1] - a[1]), 0, 0] };
+ };
+ const parts: CustomPart[] = [
+ part("F", "Back frame", [W, H, D], [0, H / 2, 0], "wood", { pieces: [back(-1), back(1), { shape: "box", size: [2 * xb - 28, 40, 24], pos: [0, 140 - H / 2, -D / 2 + 100] }] }),
+ part("K", "Backrest", [2 * xb + 28, 120, 22], [0, H - 70, -D / 2 + 50], "board"),
+ part("L", "Front legs", [2 * xf + 24, yS, D], [0, yS / 2, 0], "metal", { pieces: ([front(-1), front(1), { shape: "box", size: [2 * xf - 24, 24, 24], pos: [0, 140 - H / 2, D / 2 - 40 - ((D - 150) * 140) / (yS - 30)] }] as PartPiece[]).map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] + H / 2 - yS / 2, p.pos[2]] as Vec3 })) }),
+ part("S", "Seat", [2 * xf - 30, 20, D - 150], [0, yS - 10, 10], "board"),
+ ];
+ const steps: CustomStep[] = [
+ { title: "Take the folded chair out of the box", detail: "It comes assembled, with nothing to screw together. Stand it on its feet, still folded.", add: ["F", "K", "L"], from: { F: [0, 300, 0], K: [0, 300, 0], L: [0, 300, 0] } },
+ { title: "Unfold it and press the seat down", detail: "Pull the front legs away from the back, then push the seat down until it lies flat and the frame locks.", add: ["S"], from: { S: [0, 260, -200] } },
+ { title: "Check it stands steady", detail: "All four feet should touch the floor. To fold it, lift the front edge of the seat." },
+ ];
+ return { parts, steps };
+}
+
+/** The rattan footstool comes made: a woven drum and its domed lid, with room to store things inside. */
+function psOttoman(s: ProductSpec): R {
+ const Dd = mm(s.size.w), H = mm(s.size.h);
+ const hb = Math.round(H * 0.45);
+ const parts: CustomPart[] = [
+ part("B", "Woven base", [Dd - 60, hb, Dd - 60], [0, hb / 2, 0], "wood", { pieces: [{ shape: "cyl", size: [Dd - 110, 30, Dd - 110], pos: [0, 15 - hb / 2, 0] }, { shape: "cyl", size: [Dd - 60, hb - 30, Dd - 60], pos: [0, 15, 0] }] }),
+ part("T", "Lid", [Dd, H - hb, Dd], [0, (H + hb) / 2, 0], "wood", { pieces: [{ shape: "cyl", size: [Dd, (H - hb) * 0.6, Dd], pos: [0, -(H - hb) * 0.2, 0] }, { shape: "cyl", size: [Dd - 120, (H - hb) * 0.4, Dd - 120], pos: [0, (H - hb) * 0.3, 0] }] }),
+ ];
+ const steps: CustomStep[] = [
+ { title: "Unpack the footstool", detail: "It comes ready made, so there is nothing to put together. Take the lid off and remove the packing from inside.", add: ["B"] },
+ { title: "Put the lid back on", detail: "Lower it straight down so it sits evenly on the woven rim.", add: ["T"], from: { T: [0, 300, 0] } },
+ ];
+ return { parts, steps };
+}
+
+/** The side table folds flat: a split top with a carrying handle, on two tube leg frames that swing out. */
+function psSideTable(s: ProductSpec): R {
+ const W = mm(s.size.w), D = mm(s.size.d), H = mm(s.size.h);
+ const t = 4, yT = H - t, hh = 200, tube = 14;
+ const frame = (id: string, sx: number) =>
+ part(id, "Leg frame", [W, yT, D], [0, yT / 2, 0], "metal", {
+ pieces: [
+ ...[-1, 1].map((sz) => rod([sx * 40, yT / 2, sz * (D / 2 - 40)], [sx * (W / 2 - 10), -yT / 2 + tube / 2, sz * (D / 2 - 20)], tube)),
+ rod([sx * (W / 2 - 10), -yT / 2 + tube / 2, -(D / 2 - 20)], [sx * (W / 2 - 10), -yT / 2 + tube / 2, D / 2 - 20], tube),
+ rod([sx * 40, yT / 2 - 8, -(D / 2 - 40)], [sx * 40, yT / 2 - 8, D / 2 - 40], tube),
+ ],
+ });
+ const parts: CustomPart[] = [
+ frame("A", -1),
+ frame("B", 1),
+ part("T", "Top", [W, t, D], [0, H - t / 2, 0], "metal", { pieces: [-1, 1].map((sx) => ({ shape: "box", size: [W / 2 - 3, t, D], pos: [sx * (W / 4 + 1.5), 0, 0] })) }),
+ part("G", "Handle", [160, hh, tube], [0, H + hh / 2, 0], "metal", { pieces: [rod([-70, -hh / 2, 0], [-30, hh / 2 - tube / 2, 0], tube), rod([70, -hh / 2, 0], [30, hh / 2 - tube / 2, 0], tube), rod([-30, hh / 2 - tube / 2, 0], [30, hh / 2 - tube / 2, 0], tube)] }),
+ ];
+ const steps: CustomStep[] = [
+ { title: "Take the folded table out of the box", detail: "It comes assembled. Hold it by the handle, the legs folded together under the top.", add: ["T", "G", "A"], from: { T: [0, 300, 0], G: [0, 300, 0], A: [0, 300, 0] } },
+ { title: "Swing the legs apart", detail: "Pull the two leg frames away from each other until the top halves lie flat and level.", add: ["B"], from: { B: [-180, 0, 0] } },
+ { title: "Check it stands steady", detail: "Both feet rest flat on the floor. To carry it, lift it by the handle and the legs fold together." },
+ ];
+ return { parts, steps };
+}
+
const BY_SLUG: Record<string, (s: ProductSpec) => R | null> = {
+ "ikea-ps-2026-folding-chair": psFoldingChair,
+ "ikea-ps-2026-ottoman-storage": psOttoman,
+ "ikea-ps-2026-side-table-50-x-40": psSideTable,
"ikea-ps-2026-chair": chair,
"ikea-ps-2026-table-96": roundTable,
"ikea-ps-2026-table-156-x-75": foldingTable,
diff --git a/src/lib/plan/families/index.ts b/src/lib/plan/families/index.ts
index d8756e0..ee064b5 100644
--- a/src/lib/plan/families/index.ts
+++ b/src/lib/plan/families/index.ts
@@ -1,15 +1,20 @@
// Written by scripts/families.mjs from the files in this folder; don't edit by hand.
import type { Family } from "./family";
+import f_agam from "./agam";
+import f_agen from "./agen";
+import f_albert from "./albert";
import f_alefjall from "./alefjall";
import f_alex from "./alex";
import f_alganas from "./alganas";
import f_alhult from "./alhult";
+import f_alseda from "./alseda";
import f_alskvard from "./alskvard";
import f_alvdalen from "./alvdalen";
import f_alvsta from "./alvsta";
import f_ammaryd from "./ammaryd";
import f_anfallare from "./anfallare";
import f_angsjon from "./angsjon";
+import f_ankarudden from "./ankarudden";
import f_antilop from "./antilop";
import f_applaryd from "./applaryd";
import f_arsunda from "./arsunda";
@@ -45,6 +50,7 @@ import f_boastad from "./boastad";
import f_boaxel from "./boaxel";
import f_bollpojke from "./bollpojke";
import f_bollsidan from "./bollsidan";
+import f_bolmen from "./bolmen";
import f_bondholmen from "./bondholmen";
import f_bondskaret from "./bondskaret";
import f_borgeby from "./borgeby";
@@ -54,19 +60,24 @@ import f_bror from "./bror";
import f_brusali from "./brusali";
import f_brytning from "./brytning";
import f_burvik from "./burvik";
+import f_buskbo from "./buskbo";
import f_buslatt from "./buslatt";
import f_busunge from "./busunge";
import f_byas from "./byas";
import f_byasjon from "./byasjon";
import f_centerhalv from "./centerhalv";
import f_dagnar from "./dagnar";
+import f_dalfred from "./dalfred";
import f_danderyd from "./danderyd";
import f_docksta from "./docksta";
import f_domsten from "./domsten";
+import f_dubbla from "./dubbla";
import f_duvskar from "./duvskar";
import f_dyvlinge from "./dyvlinge";
+import f_ekedalen from "./ekedalen";
import f_ekenabben from "./ekenabben";
import f_ekenaset from "./ekenaset";
+import f_ekero from "./ekero";
import f_eket from "./eket";
import f_ekholma from "./ekholma";
import f_ekolsund from "./ekolsund";
@@ -85,6 +96,8 @@ import f_fargsattare from "./fargsattare";
import f_farjkarl from "./farjkarl";
import f_fejan from "./fejan";
import f_finnala from "./finnala";
+import f_fjaderharv from "./fjaderharv";
+import f_fjalkinge from "./fjalkinge";
import f_fjallberget from "./fjallberget";
import f_fjallbo from "./fjallbo";
import f_flekke from "./flekke";
@@ -94,6 +107,7 @@ import f_flisat from "./flisat";
import f_forhoja from "./forhoja";
import f_forlunda from "./forlunda";
import f_forsaljare from "./forsaljare";
+import f_forsiktig from "./forsiktig";
import f_franklin from "./franklin";
import f_fridhult from "./fridhult";
import f_friheten from "./friheten";
@@ -101,6 +115,8 @@ import f_friidrott from "./friidrott";
import f_froset from "./froset";
import f_frosjon from "./frosjon";
import f_froskelas from "./froskelas";
+import f_frost from "./frost";
+import f_frosvi from "./frosvi";
import f_frotorp from "./frotorp";
import f_fryksas from "./fryksas";
import f_fyresdal from "./fyresdal";
@@ -108,6 +124,7 @@ import f_galant from "./galant";
import f_gamlehult from "./gamlehult";
import f_garnanas from "./garnanas";
import f_gavle from "./gavle";
+import f_gersby from "./gersby";
import f_gillersberg from "./gillersberg";
import f_gladhojden from "./gladhojden";
import f_gladstad from "./gladstad";
@@ -148,6 +165,7 @@ import f_havsta from "./havsta";
import f_havsten from "./havsten";
import f_hejne from "./hejne";
import f_helmer from "./helmer";
+import f_hemlingby from "./hemlingby";
import f_hemnes from "./hemnes";
import f_herrakra from "./herrakra";
import f_hogved from "./hogved";
@@ -159,9 +177,11 @@ import f_hornavan from "./hornavan";
import f_huvudspelare from "./huvudspelare";
import f_hyllis from "./hyllis";
import f_hyltarp from "./hyltarp";
+import f_ibbarbo from "./ibbarbo";
import f_idanas from "./idanas";
import f_idasen from "./idasen";
import f_ikea from "./ikea";
+import f_ingo from "./ingo";
import f_ingolf from "./ingolf";
import f_inndyr from "./inndyr";
import f_invallning from "./invallning";
@@ -169,6 +189,7 @@ import f_ismantorp from "./ismantorp";
import f_ivar from "./ivar";
import f_ivosjon from "./ivosjon";
import f_jakobsfors from "./jakobsfors";
+import f_jall from "./jall";
import f_janinge from "./janinge";
import f_jarrestad from "./jarrestad";
import f_jarvfjallet from "./jarvfjallet";
@@ -176,6 +197,7 @@ import f_jattebo from "./jattebo";
import f_jattesta from "./jattesta";
import f_jolpen from "./jolpen";
import f_jonaxel from "./jonaxel";
+import f_juteboda from "./juteboda";
import f_jutholmen from "./jutholmen";
import f_juttersbo from "./juttersbo";
import f_kallax from "./kallax";
@@ -195,19 +217,23 @@ import f_klippuggla from "./klippuggla";
import f_knarrevik from "./knarrevik";
import f_knoxhult from "./knoxhult";
import f_kolbjorn from "./kolbjorn";
+import f_kompishang from "./kompishang";
import f_konstrunda from "./konstrunda";
+import f_koppang from "./koppang";
import f_kragsta from "./kragsta";
import f_kritter from "./kritter";
import f_krokholmen from "./krokholmen";
import f_kronikor from "./kronikor";
import f_kronoren from "./kronoren";
import f_krylbo from "./krylbo";
+import f_kullen from "./kullen";
import f_kungsfors from "./kungsfors";
import f_kura from "./kura";
import f_kyrre from "./kyrre";
import f_lack from "./lack";
import f_lacko from "./lacko";
import f_lagkapten from "./lagkapten";
+import f_laiva from "./laiva";
import f_laktare from "./laktare";
import f_landskrona from "./landskrona";
import f_lanespelare from "./lanespelare";
@@ -258,6 +284,8 @@ import f_milsbo from "./milsbo";
import f_minnen from "./minnen";
import f_mittplan from "./mittplan";
import f_mittzon from "./mittzon";
+import f_mofalla from "./mofalla";
+import f_moppe from "./moppe";
import f_morabo from "./morabo";
import f_morbylanga from "./morbylanga";
import f_mortfors from "./mortfors";
@@ -279,6 +307,7 @@ import f_nordkroken from "./nordkroken";
import f_nordli from "./nordli";
import f_nordmansskar from "./nordmansskar";
import f_nordviken from "./nordviken";
+import f_norraker from "./norraker";
import f_norrmanso from "./norrmanso";
import f_norrmjole from "./norrmjole";
import f_nyhamn from "./nyhamn";
@@ -322,6 +351,7 @@ import f_ridspo from "./ridspo";
import f_rigga from "./rigga";
import f_rimforsa from "./rimforsa";
import f_risholmen from "./risholmen";
+import f_risor from "./risor";
import f_rocksjon from "./rocksjon";
import f_ronninge from "./ronninge";
import f_rosentorp from "./rosentorp";
@@ -337,11 +367,13 @@ import f_segeron from "./segeron";
import f_segrare from "./segrare";
import f_sektion from "./sektion";
import f_sidsjo from "./sidsjo";
+import f_sigfinn from "./sigfinn";
import f_sjalso from "./sjalso";
import f_skalboda from "./skalboda";
import f_skalsta from "./skalsta";
import f_skansnas from "./skansnas";
import f_skapafors from "./skapafors";
+import f_skarpo from "./skarpo";
import f_skogson from "./skogson";
import f_skogsta from "./skogsta";
import f_skonaback from "./skonaback";
@@ -358,6 +390,7 @@ import f_smorkull from "./smorkull";
import f_smyga from "./smyga";
import f_sniglar from "./sniglar";
import f_soderhamn from "./soderhamn";
+import f_soluppgang from "./soluppgang";
import f_songesand from "./songesand";
import f_sotenas from "./sotenas";
import f_spiksmed from "./spiksmed";
@@ -365,6 +398,7 @@ import f_stackholmen from "./stackholmen";
import f_stall from "./stall";
import f_stefan from "./stefan";
import f_stegesund from "./stegesund";
+import f_stein from "./stein";
import f_stensele from "./stensele";
import f_stig from "./stig";
import f_stigbygel from "./stigbygel";
@@ -375,6 +409,7 @@ import f_storedamm from "./storedamm";
import f_storemolla from "./storemolla";
import f_storklinta from "./storklinta";
import f_strandmon from "./strandmon";
+import f_strandon from "./strandon";
import f_styrspel from "./styrspel";
import f_sundbron from "./sundbron";
import f_sundso from "./sundso";
@@ -394,6 +429,7 @@ import f_tarva from "./tarva";
import f_taxasklint from "./taxasklint";
import f_tegelon from "./tegelon";
import f_teodores from "./teodores";
+import f_terje from "./terje";
import f_tingby from "./tingby";
import f_tjarkil from "./tjarkil";
import f_tjusig from "./tjusig";
@@ -407,6 +443,7 @@ import f_torparo from "./torparo";
import f_torsjo from "./torsjo";
import f_tossberg from "./tossberg";
import f_tranered from "./tranered";
+import f_tranno from "./tranno";
import f_travsport from "./travsport";
import f_treasjon from "./treasjon";
import f_trofast from "./trofast";
@@ -424,6 +461,7 @@ import f_ulvevar from "./ulvevar";
import f_uppakra from "./uppakra";
import f_uppfora from "./uppfora";
import f_uppland from "./uppland";
+import f_urban from "./urban";
import f_utaker from "./utaker";
import f_utespelare from "./utespelare";
import f_utklassning from "./utklassning";
@@ -432,6 +470,7 @@ import f_utter from "./utter";
import f_vadholma from "./vadholma";
import f_valnas from "./valnas";
import f_valtorp from "./valtorp";
+import f_vangsta from "./vangsta";
import f_varmanso from "./varmanso";
import f_vasman from "./vasman";
import f_vassholmen from "./vassholmen";
@@ -453,6 +492,7 @@ import f_vingson from "./vingson";
import f_vinliden from "./vinliden";
import f_visingso from "./visingso";
import f_viskafors from "./viskafors";
+import f_visthus from "./visthus";
import f_vitteryd from "./vitteryd";
import f_vittsjo from "./vittsjo";
import f_vittskar from "./vittskar";
@@ -461,5 +501,6 @@ import f_voxlov from "./voxlov";
import f_vretstorp from "./vretstorp";
import f_vuku from "./vuku";
import f_yngvar from "./yngvar";
+import f_yxstaby from "./yxstaby";
-export const FAMILIES: Family[] = [f_alefjall, f_alex, f_alganas, f_alhult, f_alskvard, f_alvdalen, f_alvsta, f_ammaryd, f_anfallare, f_angsjon, f_antilop, f_applaryd, f_arsunda, f_askholmen, f_asperod, f_aterloga, f_baggboda, f_baggebo, f_balkarp, f_baltsar, f_barslov, f_bastboll, f_batskar, f_bekant, f_bekvam, f_bergmund, f_bergshyttan, f_besta, f_beteshast, f_billy, f_bingsta, f_bissa, f_bjorkasen, f_bjorkberget, f_bjorksnas, f_bladdra, f_blaliden, f_blames, f_blankhallan, f_blastasen, f_bleckberget, f_boastad, f_boaxel, f_bollpojke, f_bollsidan, f_bondholmen, f_bondskaret, f_borgeby, f_brannboll, f_brimnes, f_bror, f_brusali, f_brytning, f_burvik, f_buslatt, f_busunge, f_byas, f_byasjon, f_centerhalv, f_dagnar, f_danderyd, f_docksta, f_domsten, f_duvskar, f_dyvlinge, f_ekenabben, f_ekenaset, f_eket, f_ekholma, f_ekolsund, f_ekrar, f_ektorp, f_eldberget, f_emmislov, f_enhet, f_enkroken, f_ensholm, f_esseboda, f_fabrikor, f_fagelfjallet, f_fagerbacken, f_fargsattare, f_farjkarl, f_fejan, f_finnala, f_fjallberget, f_fjallbo, f_flekke, f_flinshult, f_flintan, f_flisat, f_forhoja, f_forlunda, f_forsaljare, f_franklin, f_fridhult, f_friheten, f_friidrott, f_froset, f_frosjon, f_froskelas, f_frotorp, f_fryksas, f_fyresdal, f_galant, f_gamlehult, f_garnanas, f_gavle, f_gillersberg, f_gladhojden, f_gladstad, f_glamberget, f_glenn, f_glostad, f_godishus, f_gonatt, f_grafjallet, f_greaker, f_grejsimojs, f_grillskar, f_groeryd, f_gronfjall, f_gronsta, f_grotan, f_grunnarp, f_grysna, f_gullaberg, f_gulliver, f_gullvalla, f_gultarp, f_gunde, f_gunrik, f_gursken, f_guttane, f_haddarp, f_hagaan, f_hagernas, f_hakanskar, f_hammarn, f_hattefjall, f_hattholmen, f_hauga, f_havback, f_havberg, f_havsta, f_havsten, f_hejne, f_helmer, f_hemnes, f_herrakra, f_hogved, f_hol, f_holmerud, f_holmsta, f_holmsund, f_hornavan, f_huvudspelare, f_hyllis, f_hyltarp, f_idanas, f_idasen, f_ikea, f_ingolf, f_inndyr, f_invallning, f_ismantorp, f_ivar, f_ivosjon, f_jakobsfors, f_janinge, f_jarrestad, f_jarvfjallet, f_jattebo, f_jattesta, f_jolpen, f_jonaxel, f_jutholmen, f_juttersbo, f_kallax, f_kallso, f_karskar, f_kattil, f_kattunge, f_kesnacken, f_kilberget, f_kivik, f_kjellarne, f_kjuge, f_klackenas, f_kleppstad, f_klippan, f_klippuggla, f_knarrevik, f_knoxhult, f_kolbjorn, f_konstrunda, f_kragsta, f_kritter, f_krokholmen, f_kronikor, f_kronoren, f_krylbo, f_kungsfors, f_kura, f_kyrre, f_lack, f_lacko, f_lagkapten, f_laktare, f_landskrona, f_lanespelare, f_lanesund, f_langaryd, f_langfjall, f_lastare, f_ledamot, f_lennart, f_lillanas, f_lillberget, f_lillehem, f_lillesater, f_lindakra, f_linneback, f_linnmon, f_lisabo, f_listerby, f_lixhult, f_loberget, f_lommarp, f_loparbana, f_loshult, f_lote, f_lovbacken, f_lubban, f_lustebo, f_lyckan, f_lycksele, f_mabarsskar, f_mackapar, f_malm, f_malmkoping, f_malomrade, f_mammut, f_mandal, f_mannarp, f_marenas, f_mariedamm, f_marius, f_markus, f_matchspel, f_mellgrund, f_metod, f_micke, f_millberget, f_milsbo, f_minnen, f_mittplan, f_mittzon, f_morabo, f_morbylanga, f_mortfors, f_mossjon, f_mulig, f_mullsjo, f_muskan, f_mydal, f_myllra, f_nackanas, f_nalmakare, f_nammaro, f_nasinge, f_neiden, f_nipasen, f_nissafors, f_nordkisa, f_nordkroken, f_nordli, f_nordmansskar, f_nordviken, f_norrmanso, f_norrmjole, f_nyhamn, f_nysjon, f_odger, f_olserod, f_omar, f_ommjange, f_onnestad, f_orfjall, f_orreslatt, f_ortrask, f_oskarshamn, f_ostavall, f_ovning, f_pahl, f_panget, f_paronholmen, f_pax, f_perjohan, f_persbol, f_pinntorp, f_piplarka, f_platsa, f_plojker, f_poang, f_racknas, f_radmanso, f_raggberg, f_ragrund, f_rakkestad, f_ramnefjall, f_ramsnas, f_raskog, f_rast, f_ravsten, f_relatera, f_renberget, f_rian, f_ridspo, f_rigga, f_rimforsa, f_risholmen, f_rocksjon, f_ronninge, f_rosentorp, f_rudsta, f_sagesund, f_sagmastare, f_salno, f_saltmyran, f_saltsjobaden, f_sandkatt, f_sandsberg, f_segeron, f_segrare, f_sektion, f_sidsjo, f_sjalso, f_skalboda, f_skalsta, f_skansnas, f_skapafors, f_skogson, f_skogsta, f_skonaback, f_skruvby, f_skruvsta, f_slakt, f_slatorp, f_slattum, f_smagora, f_smallen, f_smastad, f_smedstorp, f_smorkull, f_smyga, f_sniglar, f_soderhamn, f_songesand, f_sotenas, f_spiksmed, f_stackholmen, f_stall, f_stefan, f_stegesund, f_stensele, f_stig, f_stigbygel, f_stjarno, f_stockholm, f_stora, f_storedamm, f_storemolla, f_storklinta, f_strandmon, f_styrspel, f_sundbron, f_sundso, f_sundvik, f_sunnersta, f_svarta, f_syntorp, f_syvde, f_tallasen, f_tallskar, f_tanebro, f_tannforsen, f_tarnkullen, f_tarno, f_tarsele, f_tarva, f_taxasklint, f_tegelon, f_teodores, f_tingby, f_tjarkil, f_tjusig, f_tobias, f_tolkning, f_tonstad, f_torald, f_tornsborg, f_tornviken, f_torparo, f_torsjo, f_tossberg, f_tranered, f_travsport, f_treasjon, f_trofast, f_trones, f_trotten, f_tuffing, f_tufjord, f_tullsta, f_tunsta, f_tvaro, f_tyssedal, f_ugglerum, f_ulriksberg, f_ulvevar, f_uppakra, f_uppfora, f_uppland, f_utaker, f_utespelare, f_utklassning, f_utmaning, f_utter, f_vadholma, f_valnas, f_valtorp, f_varmanso, f_vasman, f_vassholmen, f_vattenkar, f_vedbo, f_veinge, f_venngarn, f_vesken, f_vevelstad, f_viggso, f_vihals, f_vikhammer, f_vildgas, f_vilhatten, f_vilto, f_vimle, f_vimund, f_vingson, f_vinliden, f_visingso, f_viskafors, f_vitteryd, f_vittsjo, f_vittskar, f_vitval, f_voxlov, f_vretstorp, f_vuku, f_yngvar];
+export const FAMILIES: Family[] = [f_agam, f_agen, f_albert, f_alefjall, f_alex, f_alganas, f_alhult, f_alseda, f_alskvard, f_alvdalen, f_alvsta, f_ammaryd, f_anfallare, f_angsjon, f_ankarudden, f_antilop, f_applaryd, f_arsunda, f_askholmen, f_asperod, f_aterloga, f_baggboda, f_baggebo, f_balkarp, f_baltsar, f_barslov, f_bastboll, f_batskar, f_bekant, f_bekvam, f_bergmund, f_bergshyttan, f_besta, f_beteshast, f_billy, f_bingsta, f_bissa, f_bjorkasen, f_bjorkberget, f_bjorksnas, f_bladdra, f_blaliden, f_blames, f_blankhallan, f_blastasen, f_bleckberget, f_boastad, f_boaxel, f_bollpojke, f_bollsidan, f_bolmen, f_bondholmen, f_bondskaret, f_borgeby, f_brannboll, f_brimnes, f_bror, f_brusali, f_brytning, f_burvik, f_buskbo, f_buslatt, f_busunge, f_byas, f_byasjon, f_centerhalv, f_dagnar, f_dalfred, f_danderyd, f_docksta, f_domsten, f_dubbla, f_duvskar, f_dyvlinge, f_ekedalen, f_ekenabben, f_ekenaset, f_ekero, f_eket, f_ekholma, f_ekolsund, f_ekrar, f_ektorp, f_eldberget, f_emmislov, f_enhet, f_enkroken, f_ensholm, f_esseboda, f_fabrikor, f_fagelfjallet, f_fagerbacken, f_fargsattare, f_farjkarl, f_fejan, f_finnala, f_fjaderharv, f_fjalkinge, f_fjallberget, f_fjallbo, f_flekke, f_flinshult, f_flintan, f_flisat, f_forhoja, f_forlunda, f_forsaljare, f_forsiktig, f_franklin, f_fridhult, f_friheten, f_friidrott, f_froset, f_frosjon, f_froskelas, f_frost, f_frosvi, f_frotorp, f_fryksas, f_fyresdal, f_galant, f_gamlehult, f_garnanas, f_gavle, f_gersby, f_gillersberg, f_gladhojden, f_gladstad, f_glamberget, f_glenn, f_glostad, f_godishus, f_gonatt, f_grafjallet, f_greaker, f_grejsimojs, f_grillskar, f_groeryd, f_gronfjall, f_gronsta, f_grotan, f_grunnarp, f_grysna, f_gullaberg, f_gulliver, f_gullvalla, f_gultarp, f_gunde, f_gunrik, f_gursken, f_guttane, f_haddarp, f_hagaan, f_hagernas, f_hakanskar, f_hammarn, f_hattefjall, f_hattholmen, f_hauga, f_havback, f_havberg, f_havsta, f_havsten, f_hejne, f_helmer, f_hemlingby, f_hemnes, f_herrakra, f_hogved, f_hol, f_holmerud, f_holmsta, f_holmsund, f_hornavan, f_huvudspelare, f_hyllis, f_hyltarp, f_ibbarbo, f_idanas, f_idasen, f_ikea, f_ingo, f_ingolf, f_inndyr, f_invallning, f_ismantorp, f_ivar, f_ivosjon, f_jakobsfors, f_jall, f_janinge, f_jarrestad, f_jarvfjallet, f_jattebo, f_jattesta, f_jolpen, f_jonaxel, f_juteboda, f_jutholmen, f_juttersbo, f_kallax, f_kallso, f_karskar, f_kattil, f_kattunge, f_kesnacken, f_kilberget, f_kivik, f_kjellarne, f_kjuge, f_klackenas, f_kleppstad, f_klippan, f_klippuggla, f_knarrevik, f_knoxhult, f_kolbjorn, f_kompishang, f_konstrunda, f_koppang, f_kragsta, f_kritter, f_krokholmen, f_kronikor, f_kronoren, f_krylbo, f_kullen, f_kungsfors, f_kura, f_kyrre, f_lack, f_lacko, f_lagkapten, f_laiva, f_laktare, f_landskrona, f_lanespelare, f_lanesund, f_langaryd, f_langfjall, f_lastare, f_ledamot, f_lennart, f_lillanas, f_lillberget, f_lillehem, f_lillesater, f_lindakra, f_linneback, f_linnmon, f_lisabo, f_listerby, f_lixhult, f_loberget, f_lommarp, f_loparbana, f_loshult, f_lote, f_lovbacken, f_lubban, f_lustebo, f_lyckan, f_lycksele, f_mabarsskar, f_mackapar, f_malm, f_malmkoping, f_malomrade, f_mammut, f_mandal, f_mannarp, f_marenas, f_mariedamm, f_marius, f_markus, f_matchspel, f_mellgrund, f_metod, f_micke, f_millberget, f_milsbo, f_minnen, f_mittplan, f_mittzon, f_mofalla, f_moppe, f_morabo, f_morbylanga, f_mortfors, f_mossjon, f_mulig, f_mullsjo, f_muskan, f_mydal, f_myllra, f_nackanas, f_nalmakare, f_nammaro, f_nasinge, f_neiden, f_nipasen, f_nissafors, f_nordkisa, f_nordkroken, f_nordli, f_nordmansskar, f_nordviken, f_norraker, f_norrmanso, f_norrmjole, f_nyhamn, f_nysjon, f_odger, f_olserod, f_omar, f_ommjange, f_onnestad, f_orfjall, f_orreslatt, f_ortrask, f_oskarshamn, f_ostavall, f_ovning, f_pahl, f_panget, f_paronholmen, f_pax, f_perjohan, f_persbol, f_pinntorp, f_piplarka, f_platsa, f_plojker, f_poang, f_racknas, f_radmanso, f_raggberg, f_ragrund, f_rakkestad, f_ramnefjall, f_ramsnas, f_raskog, f_rast, f_ravsten, f_relatera, f_renberget, f_rian, f_ridspo, f_rigga, f_rimforsa, f_risholmen, f_risor, f_rocksjon, f_ronninge, f_rosentorp, f_rudsta, f_sagesund, f_sagmastare, f_salno, f_saltmyran, f_saltsjobaden, f_sandkatt, f_sandsberg, f_segeron, f_segrare, f_sektion, f_sidsjo, f_sigfinn, f_sjalso, f_skalboda, f_skalsta, f_skansnas, f_skapafors, f_skarpo, f_skogson, f_skogsta, f_skonaback, f_skruvby, f_skruvsta, f_slakt, f_slatorp, f_slattum, f_smagora, f_smallen, f_smastad, f_smedstorp, f_smorkull, f_smyga, f_sniglar, f_soderhamn, f_soluppgang, f_songesand, f_sotenas, f_spiksmed, f_stackholmen, f_stall, f_stefan, f_stegesund, f_stein, f_stensele, f_stig, f_stigbygel, f_stjarno, f_stockholm, f_stora, f_storedamm, f_storemolla, f_storklinta, f_strandmon, f_strandon, f_styrspel, f_sundbron, f_sundso, f_sundvik, f_sunnersta, f_svarta, f_syntorp, f_syvde, f_tallasen, f_tallskar, f_tanebro, f_tannforsen, f_tarnkullen, f_tarno, f_tarsele, f_tarva, f_taxasklint, f_tegelon, f_teodores, f_terje, f_tingby, f_tjarkil, f_tjusig, f_tobias, f_tolkning, f_tonstad, f_torald, f_tornsborg, f_tornviken, f_torparo, f_torsjo, f_tossberg, f_tranered, f_tranno, f_travsport, f_treasjon, f_trofast, f_trones, f_trotten, f_tuffing, f_tufjord, f_tullsta, f_tunsta, f_tvaro, f_tyssedal, f_ugglerum, f_ulriksberg, f_ulvevar, f_uppakra, f_uppfora, f_uppland, f_urban, f_utaker, f_utespelare, f_utklassning, f_utmaning, f_utter, f_vadholma, f_valnas, f_valtorp, f_vangsta, f_varmanso, f_vasman, f_vassholmen, f_vattenkar, f_vedbo, f_veinge, f_venngarn, f_vesken, f_vevelstad, f_viggso, f_vihals, f_vikhammer, f_vildgas, f_vilhatten, f_vilto, f_vimle, f_vimund, f_vingson, f_vinliden, f_visingso, f_viskafors, f_visthus, f_vitteryd, f_vittsjo, f_vittskar, f_vitval, f_voxlov, f_vretstorp, f_vuku, f_yngvar, f_yxstaby];
diff --git a/src/lib/plan/families/ingo.ts b/src/lib/plan/families/ingo.ts
new file mode 100644
index 0000000..331dcff
--- /dev/null
+++ b/src/lib/plan/families/ingo.ts
@@ -0,0 +1,139 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * INGO, read from the table's manual. Everything happens upside down on a rug. A corner bracket is screwed onto
+ * each end of both short rails, with a dowel in the middle of each; the long rails are screwed onto the brackets.
+ * The frame goes onto the top, on the two dowels, and twelve screws with washers fix it. Each leg takes a barrel
+ * nut in its top and two hanger bolts, is set into a corner and held with a spring washer and a nut on each bolt,
+ * tightened with the box spanner. Then the table is turned over.
+ */
+
+type Kind = CustomFix["kind"];
+const fx = (kind: Kind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const S = [-1, 1] as const;
+const CORNERS: [number, number][] = [
+ [-1, -1],
+ [1, -1],
+ [-1, 1],
+ [1, 1],
+];
+
+const TT = 28; // top
+const RH = 80, RT = 20; // rails
+const LEG = 55;
+const IN = 25; // the frame stands in from the top's edges
+
+const BRACKET = { len: 90, dia: 40, name: "Corner bracket" };
+const SMALL = { len: 16, dia: 4 };
+const TOP_SCREW = { len: 50, dia: 5 };
+const HANGER = { len: 70, dia: 8, name: "Hanger bolt" };
+const BARREL = { len: 40, dia: 10, name: "Barrel nut" };
+const SPRING = { len: 2, dia: 14, name: "Spring washer" };
+const WASHER = { len: 2, dia: 14 };
+
+function table(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, D = s.size.d * 10, H = s.size.h * 10;
+ const yU = H - TT; // underside of the top
+ const yR = yU - RH / 2;
+ const xo = W / 2 - IN, zo = D / 2 - IN; // the frame's outside
+ const xs = xo - RT / 2, zs = zo - RT / 2; // rail middles
+ const xl = xo - RT - LEG / 2, zl = zo - RT - LEG / 2; // legs sit in the frame's inside corners
+ const parts: CustomPart[] = [
+ { id: "T", name: "Table top", size: [W, TT, D], pos: [0, H - TT / 2, 0], material: "wood" },
+ ...S.map((sx, i): CustomPart => ({ id: `Z${i + 1}`, name: "Short rail", size: [RT, RH, 2 * zo - 2 * RT], pos: [sx * xs, yR, 0], material: "wood" })),
+ ...S.map((sz, i): CustomPart => ({ id: `X${i + 1}`, name: "Long rail", size: [2 * xo, RH, RT], pos: [0, yR, sz * zs], material: "wood" })),
+ ...CORNERS.map(([sx, sz], i): CustomPart => ({ id: `G${i + 1}`, name: "Leg", size: [LEG, yU, LEG], pos: [sx * xl, yU / 2, sz * zl], material: "wood" })),
+ ];
+ const zr = (sx: number) => `Z${sx < 0 ? 1 : 2}`;
+ const xr = (sz: number) => `X${sz < 0 ? 1 : 2}`;
+ // each bracket sits across an inside corner, 40 mm along each rail
+ const bk = (sx: number, sz: number): Vec3 => [sx * (xo - RT - 22), yR, sz * (zo - RT - 22)];
+ const brackets = CORNERS.map(([sx, sz]) => fx("angle", [bk(sx, sz)], [sx * 0.71, 0, sz * 0.71], { ...BRACKET, on: zr(sx), mate: xr(sz) }));
+ const intoShort = CORNERS.map(([sx, sz]) => fx("screw", [-18, 18].map((dy): Vec3 => [sx * (xo - RT - 2), yR + dy, sz * (zo - RT - 40)]), [sx, 0, 0], { ...SMALL, on: zr(sx) }));
+ const intoLong = CORNERS.map(([sx, sz]) => fx("screw", [-18, 18].map((dy): Vec3 => [sx * (xo - RT - 40), yR + dy, sz * (zo - RT - 2)]), [0, 0, sz], { ...SMALL, on: xr(sz) }));
+ const dowels = S.map((sx) => fx("dowel", [[sx * xs, yU, 0]], [0, -1, 0], { len: 30, dia: 8, on: zr(sx), mate: "T" }));
+ // twelve screws up through the rails into the top: four in each long rail, two in each short one
+ const longX = [-0.36, -0.12, 0.12, 0.36].map((f) => f * 2 * xo);
+ const shortZ = [-0.25, 0.25].map((f) => f * 2 * zo);
+ const yS = yU - 30; // counterbored from below
+ const topPts: { at: Vec3; on: string }[] = [
+ ...S.flatMap((sz) => longX.map((x) => ({ at: [x, yS, sz * zs] as Vec3, on: xr(sz) }))),
+ ...S.flatMap((sx) => shortZ.map((z) => ({ at: [sx * xs, yS, z] as Vec3, on: zr(sx) }))),
+ ];
+ const topWashers = [fx("washer", topPts.map((p) => p.at), [0, 1, 0], { ...WASHER })];
+ const topScrews = topPts.map((p) => fx("screw", [p.at], [0, 1, 0], { ...TOP_SCREW, on: p.on, mate: "T" }));
+ // each leg: a barrel nut down into its top, two hanger bolts through its inside corner into the nut
+ const inner = (i: number, dy = 0): Vec3 => {
+ const [sx, sz] = CORNERS[i];
+ return [sx * (xl - LEG / 2 + 6), yR + dy, sz * (zl - LEG / 2 + 6)];
+ };
+ const out = (i: number): Vec3 => [CORNERS[i][0] * 0.71, 0, CORNERS[i][1] * 0.71];
+ const barrels = CORNERS.map(([sx, sz], i) => fx("connector", [[sx * xl, yU, sz * zl]], [0, -1, 0], { ...BARREL, on: `G${i + 1}` }));
+ const hangers = CORNERS.map((_, i) => fx("stud", [inner(i, -18), inner(i, 18)], out(i), { ...HANGER, on: `G${i + 1}` }));
+ const legNuts = CORNERS.flatMap((_, i) => {
+ const [sx, sz] = CORNERS[i];
+ const p = (dy: number): Vec3 => [sx * (xl - LEG / 2 - 14), yR + dy, sz * (zl - LEG / 2 - 14)];
+ return [fx("washer", [p(-18), p(18)], out(i), { ...SPRING }), fx("nut", [p(-18), p(18)], out(i), { len: 6, dia: 8 })];
+ });
+ return {
+ parts,
+ steps: [
+ {
+ title: "Fit the short rails with brackets and dowels",
+ detail: "Lay the rails on a rug. A dowel into the hole in the middle of each top edge, then a corner bracket at each end with two screws.",
+ add: ["Z1", "Z2"],
+ fix: [...dowels, ...brackets, ...intoShort],
+ tools: ["hammer", "screwdriver"],
+ pose: "-y",
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the long rails onto the brackets",
+ detail: "Two screws through each bracket. The dowels point the same way as the big holes in the long rails' edges.",
+ add: ["X1", "X2"],
+ fix: intoLong,
+ tools: ["screwdriver"],
+ from: { X1: [0, 0, -220], X2: [0, 0, 220] },
+ },
+ {
+ title: "Set the frame on the top",
+ detail: "Lay the top face down on the rug and put the frame onto it, the dowels into the top's holes.",
+ add: ["T"],
+ from: { T: [0, 220, 0] },
+ warnings: ["face"],
+ },
+ {
+ title: "Screw the frame to the top",
+ detail: "Twelve screws, each with a washer, down through the rails into the top.",
+ fix: [...topWashers, ...topScrews],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the barrel nuts and hanger bolts into the legs",
+ detail: "A barrel nut into the hole in the top of each leg, slot lined up, then two hanger bolts through the corner into it.",
+ fix: [...barrels, ...hangers],
+ wait: ["G1", "G2", "G3", "G4"],
+ tools: ["flathead"],
+ },
+ {
+ title: "Bolt the legs into the corners",
+ detail: "Push each leg into a corner, its bolts through the bracket. A spring washer and a nut on each, tightened with the box spanner.",
+ add: ["G1", "G2", "G3", "G4"],
+ fix: legNuts,
+ tools: ["wrench"],
+ from: { G1: [0, -260, 0], G2: [0, -260, 0], G3: [0, -260, 0], G4: [0, -260, 0] },
+ },
+ { title: "Turn the table over", detail: "Together, lifting it by the top, not the legs.", pose: "+y", people: 2, warnings: ["two"] },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["INGO"],
+ recipe(s) {
+ if (/^ingo-table/.test(s.slug ?? "")) return table(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/ingolf.ts b/src/lib/plan/families/ingolf.ts
index 26cc360..4a4ec0f 100644
--- a/src/lib/plan/families/ingolf.ts
+++ b/src/lib/plan/families/ingolf.ts
@@ -149,7 +149,7 @@ const family: Family = {
const it = b.items.find((x): x is PartItem => x.kind === "part" && x.final.pos.every((v, k) => Math.abs(v - p.pos[k]) < 0.5));
const st = it?.states.find((x) => x.step === first);
if (!it || !st) return;
- it.states.splice(it.states.indexOf(st), 1, { ...st, pos: [xo, 280 + i * 110, s.size.d * 5 + 160], rot: [0, Math.PI / 2, 0], from: [0, 200, 0] }, { ...st, step: stand, from: [200, 0, 0] });
+ it.states.splice(it.states.indexOf(st), 1, { ...st, pos: [xo, 280 + i * 110, s.size.d * 5 + 160], rot: [0, Math.PI / 2, 0], from: [0, 0, 250] }, { ...st, step: stand, from: [200, 0, 0] });
it.states.sort((a, c) => a.step - c.step);
});
return true;
diff --git a/src/lib/plan/families/inndyr.ts b/src/lib/plan/families/inndyr.ts
index 32c3195..7f6adfa 100644
--- a/src/lib/plan/families/inndyr.ts
+++ b/src/lib/plan/families/inndyr.ts
@@ -51,7 +51,8 @@ function bench(): CustomParams {
});
parts.push({ id: "LID", name: "Padded lid", size: [W, hLid, D], pos: [0, yBox1 + hLid / 2, 0], material: "soft" });
- const batEnds = (x: number): Vec3[] => [-1, 1].map((sz) => [x, yBat, sz * zIn] as Vec3);
+ // the dowel sits beside the long screw in each batten end
+ const batEnds = (x: number): Vec3[] => [-1, 1].map((sz) => [x + 20, yBat, sz * zIn] as Vec3);
const panelEnds = (z: number, sx: number): Vec3[] => [yLeg + 60, yBox1 - 60].map((y) => [sx * xIn, y, z] as Vec3);
const endScrews = (sx: number): Vec3[] => [-1, 1].flatMap((sz) => [yLeg + 100, yBox1 - 100].map((y) => [sx * Wb / 2, y, sz * zLong] as Vec3));
const SCREW = { len: 50, dia: 6, name: "Long screw" };
@@ -66,20 +67,22 @@ function bench(): CustomParams {
fix: batX.flatMap((x, i) => batEnds(x).map((p) => at("dowel", [p], [0, 0, -Math.sign(p[2])], `T${i + 1}`, p[2] < 0 ? "B" : "F"))),
tools: ["hammer"],
wait: ["T1", "T2", "T3"],
+ from: { T1: [0, 0, 300], T2: [0, 0, 300], T3: [0, 0, 300] },
},
{
title: "Screw the battens to the back panel",
detail: "Stand the back panel on its long edge, holes at the bottom. One long screw through it into each batten.",
add: ["B", "T1", "T2", "T3"],
- fix: [at("bolt", batX.map((x) => [x, yBat, -Db / 2] as Vec3), [0, 0, 1], "B", undefined, SCREW)],
+ fix: [at("bolt", batX.map((x) => [x - 15, yBat, -Db / 2] as Vec3), [0, 0, 1], "B", undefined, SCREW)],
tools: ["allen"],
warnings: ["floor"],
+ from: { B: [0, 0, -300] },
},
{
title: "Screw on the front panel",
detail: "Push it onto the dowels at the other ends of the battens, then three more long screws.",
add: ["F"],
- fix: [at("bolt", batX.map((x) => [x, yBat, Db / 2] as Vec3), [0, 0, -1], "F", undefined, SCREW)],
+ fix: [at("bolt", batX.map((x) => [x - 15, yBat, Db / 2] as Vec3), [0, 0, -1], "F", undefined, SCREW)],
tools: ["allen"],
},
{
@@ -120,7 +123,7 @@ function bench(): CustomParams {
detail: "At the back, tight under the top edge. Two screws each with the small Allen key.",
fix: [-1, 1].flatMap((sx) => [
at("plate", [hingeAt(sx)], [-sx, 0, 0], sx < 0 ? "E1" : "E2", undefined, { name: "Lid hinge", len: 6, dia: 40 }),
- at("bolt", [-25, 25].map((dy) => [sx * xIn, hingeAt(sx)[1] + dy - 20, hingeAt(sx)[2]] as Vec3), [-sx, 0, 0], sx < 0 ? "E1" : "E2", undefined, { len: 12, dia: 6, name: "Screw" }),
+ at("bolt", [-15, 15].map((dz) => [sx * xIn, hingeAt(sx)[1] - 25, hingeAt(sx)[2] + dz] as Vec3), [sx, 0, 0], sx < 0 ? "E1" : "E2", undefined, { len: 12, dia: 6, name: "Screw" }),
]),
tools: ["allen"],
pose: "+y",
diff --git a/src/lib/plan/families/ismantorp.ts b/src/lib/plan/families/ismantorp.ts
index fda3515..ad632e3 100644
--- a/src/lib/plan/families/ismantorp.ts
+++ b/src/lib/plan/families/ismantorp.ts
@@ -89,7 +89,9 @@ function armchair(): CustomParams {
const railBolts = (sx: number): CustomFix[] =>
(["RF", "RB"] as const).map((r) => at("bolt", [[sx * (xs + TUBE / 2), yRail, r === "RF" ? zFront : zBack]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", r, LONG));
const hoopPts = (sx: number): Vec3[] => [yh0 + 15, yh1 - 15].map((y) => [sx * (xs + TUBE / 2), y, zAt(y, side[6], side[5])] as Vec3);
- const padScrews: Vec3[] = [-1, 1].flatMap((sx) => [500, 640].map((y) => [sx * (xh - 70), y - 25, zh - 110 * ((y - yh1) / (H - yh1)) - 30] as Vec3));
+ // through the hoop's plates on the back of the pad, into the pad's frame
+ const padZ = (y: number) => zh - (110 * (y - yh1)) / (H - TUBE / 2 - yh1);
+ const padScrews: Vec3[] = [-1, 1].flatMap((sx) => [475, 615].map((y) => [sx * (xh - 100), y, padZ(y) - 26] as Vec3));
const ringScrews: Vec3[] = [-1, 1].flatMap((sx) => [zFront, zBack].map((z) => [sx * (rw / 2 - 60), yRing + tRing, z] as Vec3));
const OFF: Vec3 = [0, 0, -700];
diff --git a/src/lib/plan/families/ivar.ts b/src/lib/plan/families/ivar.ts
index 4fa7004..e962a5a 100644
--- a/src/lib/plan/families/ivar.ts
+++ b/src/lib/plan/families/ivar.ts
@@ -1,26 +1,34 @@
import type { Family } from "./family";
-import type { CustomFix, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3 } from "../../types";
+import type { CustomFix, CustomPart, CustomStep, HwKind, PartPiece, ProductSpec, Vec3 } from "../../types";
import { HW, type HwDef, type PlanBuilder } from "../builder";
import { buildCustom } from "../custom";
/**
- * IVAR, read from the side unit's manual. Each side is a ladder of solid pine: rungs knocked into two uprights
- * and locked with wooden pegs through the uprights (6, 8 or 10 by height). Two people stand the ladders up and
- * the shelves drop onto metal pins, four each, with a click. A steel cross brace is screwed across the back, and
- * each ladder is strapped to the wall at the top. Cabinets, doors, box shelves and the pine cube unit have their
- * own manuals and keep their old guides for now.
+ * IVAR, read from its manuals.
+ * Side unit: each side is a ladder of solid pine, rungs knocked into two uprights and locked with wooden pegs
+ * (6, 8 or 10 by height). Two people stand the ladders up, the shelves drop onto metal pins, a steel cross brace is
+ * screwed across the back and each ladder is strapped to the wall.
+ * The rest are their own kits: a pair of framed doors hung on the side unit's front uprights, a steel cabinet with
+ * mesh doors (on the floor or hung in a side unit), the pine cabinet with doors, the pine 2x2 shelving unit (alone
+ * or stacked on the cabinet), the cabinet with sliding doors, the box shelf with divider and the storage box on wheels.
*/
const PEG: HwDef = { kind: "dowel", len: 40, dia: 6 };
const UX = 30; // upright, across the unit
const UZ = 44; // upright, front to back
const RUNG = 20;
+const ST = 20; // side unit shelf
+const T = 18; // pine panels of the cabinets and the 2x2 unit
-// the pine cube unit (80x30) is a different build, with its own manual
-const CUBE_UNIT = /ivar-shelving-unit-80-x-30/;
+type Recipe = { parts: CustomPart[]; steps: CustomStep[] };
+
+const fx = (kind: HwKind, at: Vec3[], dir: Vec3, on: string, more: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, on, ...more });
+const box = (id: string, name: string, size: Vec3, pos: Vec3, more: Partial<CustomPart> = {}): CustomPart => ({ id, name, size, pos, ...more });
+const ids = (pre: string, n: number) => Array.from({ length: n }, (_, i) => `${pre}${i}`);
function shelvesOf(s: ProductSpec) {
- const p = s.shelf!;
+ const p = s.shelf;
+ if (!p) return 4;
return Math.max(2, (p.shelves ?? 3) + (p.fixedShelf ? 1 : 0) + 1);
}
@@ -31,58 +39,46 @@ function rungYs(H: number) {
return Array.from({ length: n }, (_, i) => lo + ((hi - lo) * i) / (n - 1));
}
-function recipe(s: ProductSpec) {
+interface SideOpts {
+ ys?: number[]; // shelf centres, bottom up
+ brace?: [number, number]; // the heights the cross brace spans
+}
+
+/* ---------------- side unit ---------------- */
+
+function sideUnit(s: ProductSpec, o: SideOpts = {}) {
const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
- const n = shelvesOf(s);
const ys = rungYs(H);
const xSide = (sx: number) => sx * (W / 2 - UX / 2);
const zUp = (sz: number) => sz * (D / 2 - UZ / 2);
const parts: CustomPart[] = [];
for (const [si, sx] of [-1, 1].entries()) {
- for (const [ui, sz] of [-1, 1].entries()) parts.push({ id: `U${si}${ui}`, name: "Upright", size: [UX, H, UZ], pos: [xSide(sx), H / 2, zUp(sz)], material: "wood" });
- ys.forEach((y, k) => parts.push({ id: `R${si}${k}`, name: "Rung", size: [RUNG, 45, D - 2 * UZ], pos: [xSide(sx), y, 0], material: "wood" }));
+ for (const [ui, sz] of [-1, 1].entries()) parts.push(box(`U${si}${ui}`, "Upright", [UX, H, UZ], [xSide(sx), H / 2, zUp(sz)], { material: "wood" }));
+ ys.forEach((y, k) => parts.push(box(`R${si}${k}`, "Rung", [RUNG, 45, D - 2 * UZ], [xSide(sx), y, 0], { material: "wood" })));
}
// shelves between the ladders, from the bottom one just above the lowest rung to the top one under the top rung
- const st = 20;
+ const n = o.ys?.length ?? shelvesOf(s);
const y0 = 110, y1 = H - 70;
- const shelfY = (i: number) => y0 + ((y1 - y0) * i) / (n - 1);
- for (let i = 0; i < n; i++) parts.push({ id: `S${i}`, name: "Shelf", size: [W - 2 * UX, st, D], pos: [0, shelfY(i), 0], material: "wood" });
- // the cross brace across the back, over the middle gap
+ const sy = o.ys ?? Array.from({ length: n }, (_, i) => y0 + ((y1 - y0) * i) / (n - 1));
+ sy.forEach((y, i) => parts.push(box(`S${i}`, "Shelf", [W - 2 * UX, ST, D], [0, y, 0], { material: "wood" })));
+ // the cross brace across the back, corner to corner over the back uprights
const mid = Math.floor((n - 1) / 2);
- const ya = shelfY(mid) + 40, yb = shelfY(Math.min(n - 1, mid + 1)) - 40;
- const span = W - 2 * UX - 40, rise = yb - ya;
+ const [ya, yb] = o.brace ?? [sy[mid] + 40, sy[Math.min(n - 1, mid + 1)] - 40];
+ const span = W - UX, rise = yb - ya;
const len = Math.hypot(span, rise), ang = Math.atan2(rise, span);
const rods: PartPiece[] = [
{ shape: "box", size: [len, 4, 4], pos: [0, 0, 0], rot: [0, 0, ang] },
{ shape: "box", size: [len, 4, 4], pos: [0, 0, 0], rot: [0, 0, -ang] },
];
- const zBrace = -D / 2 - 3;
- parts.push({ id: "X", name: "Cross brace", size: [span, rise, 4], pos: [0, (ya + yb) / 2, zBrace], pieces: rods, material: "metal" });
+ parts.push(box("X", "Cross brace", [span, rise, 4], [0, (ya + yb) / 2, -D / 2 - 2], { pieces: rods, material: "metal" }));
// pegs go through the upright's outer face into the rung's tongue
- const pegs = (si: number, ui: number): CustomFix => {
- const sx = si ? 1 : -1, sz = ui ? 1 : -1;
- return {
- kind: "dowel",
- count: ys.length,
- at: ys.map((y) => [sx * (W / 2), y, zUp(sz)] as Vec3),
- dir: [-sx, 0, 0],
- on: `U${si}${ui}`,
- len: PEG.len,
- dia: PEG.dia,
- };
- };
+ const pegs = (si: number, ui: number) =>
+ fx("dowel", ys.map((y) => [(si ? 1 : -1) * (W / 2), y, zUp(ui ? 1 : -1)] as Vec3), [si ? -1 : 1, 0, 0], `U${si}${ui}`, { len: PEG.len, dia: PEG.dia });
const rungs = (si: number) => ys.map((_, k) => `R${si}${k}`);
- const pins = (si: number, ui: number): CustomFix => {
- const sx = si ? 1 : -1, sz = ui ? 1 : -1;
- return {
- kind: "pin",
- count: n,
- at: Array.from({ length: n }, (_, i) => [sx * (W / 2 - UX), shelfY(i) - st / 2 - 3, zUp(sz)] as Vec3),
- dir: [sx, 0, 0],
- on: `U${si}${ui}`,
- dia: 6,
- };
+ const pins = (si: number, ui: number) => {
+ const sx = si ? 1 : -1;
+ return fx("pin", sy.map((y) => [sx * (W / 2 - UX), y - ST / 2 - 3, zUp(ui ? 1 : -1)] as Vec3), [sx, 0, 0], `U${si}${ui}`, { dia: 6 });
};
const steps: CustomStep[] = [
{
@@ -107,7 +103,7 @@ function recipe(s: ProductSpec) {
{
title: "Stand the sides up and put the shelves in",
detail: "One of you holds the sides upright. Push four pins in level for each shelf, then press the shelf down onto them until it clicks.",
- add: Array.from({ length: n }, (_, i) => `S${i}`),
+ add: sy.map((_, i) => `S${i}`),
fix: [pins(0, 0), pins(0, 1), pins(1, 0), pins(1, 1)],
people: 2,
pose: "+y",
@@ -117,13 +113,13 @@ function recipe(s: ProductSpec) {
title: "Screw on the cross brace",
detail: "Across the back, one screw into each back upright at its four ends. It keeps the shelving from leaning.",
add: ["X"],
- fix: [{ kind: "screw", count: 4, len: 16, dia: 4, dir: [0, 0, 1], at: [-1, 1].flatMap((sx) => [ya, yb].map((y) => [sx * (W / 2 - UX - 20), y, -D / 2] as Vec3)) }],
+ fix: [fx("screw", [-1, 1].flatMap((sx) => [ya, yb].map((y) => [xSide(sx), y, -D / 2 - 3] as Vec3)), [0, 0, 1], "X", { len: 16, dia: 4 })],
tools: ["screwdriver"],
people: 2,
check: "square",
},
];
- return { parts, steps, top: (si: number) => parts.find((p) => p.id === `U${si}0`)!.pos };
+ return { parts, steps, W, H, D, sy, zUp, back: [parts.find((p) => p.id === "U00")!.pos, parts.find((p) => p.id === "U10")!.pos] };
}
/** A strap on top of each back upright, screwed down with a washer, its other end on a screw in the wall. */
@@ -156,15 +152,861 @@ function strapStep(b: PlanBuilder, s: ProductSpec, backs: Vec3[]) {
);
}
+/* ---------------- IVAR door pair on the side unit ---------------- */
+
+/** A framed door: pine stiles and rails round a woven panel, with a rail across the middle. */
+function frameDoor(w: number, h: number, t: number): PartPiece[] {
+ const f = 45;
+ return [
+ { shape: "box", size: [f, h, t], pos: [-w / 2 + f / 2, 0, 0], material: "wood" },
+ { shape: "box", size: [f, h, t], pos: [w / 2 - f / 2, 0, 0], material: "wood" },
+ { shape: "box", size: [w - 2 * f, f, t], pos: [0, h / 2 - f / 2, 0], material: "wood" },
+ { shape: "box", size: [w - 2 * f, f, t], pos: [0, -h / 2 + f / 2, 0], material: "wood" },
+ { shape: "box", size: [w - 2 * f, 35, t], pos: [0, 0, 0], material: "wood" },
+ { shape: "box", size: [w - 2 * f, h - 2 * f, 4], pos: [0, 0, -2], material: "fiber" },
+ ];
+}
+
+function doorUnit(s: ProductSpec): Recipe & { back: Vec3[] } {
+ const H = s.size.h * 10;
+ // the doors close over the top 83 cm of a 124 cm unit; taller units carry more open shelves above them
+ const yT = Math.min(H, 1240) - 70;
+ const doorH = 830;
+ const yL = yT + ST / 2 - doorH + ST / 2;
+ const ys = [110, yL, (yL + yT) / 2, yT];
+ if (H > 1600) ys.push(...(H > 2000 ? [1700, H - 70] : [H - 70]));
+ const u = sideUnit(s, { ys, brace: [150, yL - 40] });
+ const { W, D, parts, steps } = u;
+ const nd = W < 600 ? 1 : 2;
+ const dw = (W - UX) / nd - 3;
+ const dy = (yL - ST / 2 + yT + ST / 2) / 2;
+ const doors = ids("G", nd);
+ const dx = (i: number) => (nd === 1 ? 0 : (i ? 1 : -1) * (W - UX) / 4);
+ doors.forEach((id, i) => parts.push(box(id, "Door", [dw, doorH, 20], [dx(i), dy, D / 2 + 11], { pieces: frameDoor(dw, doorH, 20), material: "wood" })));
+ // the hinges sit on the outer edge of each door, on the inner face of the front upright beside it
+ const hy = [dy + doorH / 2 - 110, dy - doorH / 2 + 110];
+ const sides = nd === 1 ? [-1] : [-1, 1];
+ const plates = sides.flatMap((sx) => hy.map((y) => [sx * (W / 2 - UX), y, u.zUp(1)] as Vec3));
+ const up = (sx: number) => (sx < 0 ? "U01" : "U11");
+ const hinge = (sx: number) => (W - UX) / 2 * sx - sx * 32;
+ steps.push(
+ {
+ title: "Screw the hinge plates to the front uprights",
+ detail: "On the inside face of each front upright, one near the top of the doors and one near the bottom. One screw holds each plate.",
+ fix: [
+ ...sides.map((sx) => fx("plate", plates.filter((p) => Math.sign(p[0]) === sx), [sx, 0, 0], up(sx), { name: "Hinge plate", len: 40, dia: 20 })),
+ ...sides.map((sx) => fx("screw", hy.map((y) => [sx * (W / 2 - UX), y + 28, u.zUp(1)] as Vec3), [sx, 0, 0], up(sx), { len: 16, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the hinges onto the doors",
+ detail: "Lay the doors face down. Press each hinge cup into its hole and fix it with two screws.",
+ wait: doors,
+ fix: doors.flatMap((id, i) => {
+ const sx = nd === 1 ? -1 : i ? 1 : -1;
+ const x = hinge(sx);
+ return [
+ fx("hinge", hy.map((y) => [x, y, D / 2 + 1] as Vec3), [0, 0, 1], id),
+ fx("screw", hy.flatMap((y) => [y + 30, y - 30].map((yy) => [x, yy, D / 2 + 1] as Vec3)), [0, 0, 1], id, { len: 12, dia: 4 }),
+ ];
+ }),
+ tools: ["screwdriver"],
+ },
+ {
+ title: nd === 1 ? "Click the door onto its plates" : "Click the doors onto their plates",
+ detail: "Hook each hinge arm over its plate and press until it clicks.",
+ add: doors,
+ from: Object.fromEntries(doors.map((id) => [id, [0, 0, 300] as Vec3])),
+ },
+ {
+ title: "Line the doors up",
+ detail: "Turn the hinge screws to move each door up, down or sideways until the gaps are even.",
+ tools: ["screwdriver"],
+ },
+ );
+ return { parts, steps, back: u.back };
+}
+
+/* ---------------- steel cabinet with mesh doors ---------------- */
+
+const SH = 12; // folded steel sides, as drawn
+
+function meshCabinet(W: number, H: number, D: number, y0: number, x0 = 0) {
+ const P = 25; // back corner posts
+ const inner = W - 2 * SH;
+ const yb = y0 + 70; // top of the bottom tray
+ const yt = y0 + H - 15; // underside of the top
+ const back = (yt - yb) / 2;
+ const parts: CustomPart[] = [
+ box("CB", "Bottom", [inner, 20, D - 12], [x0, yb - 10, -6], { material: "metal" }),
+ box("CP0", "Back post", [P, yt - yb, P], [x0 - inner / 2 + P / 2, (yb + yt) / 2, -D / 2 + P / 2], { material: "metal" }),
+ box("CP1", "Back post", [P, yt - yb, P], [x0 + inner / 2 - P / 2, (yb + yt) / 2, -D / 2 + P / 2], { material: "metal" }),
+ box("CS0", "Side panel", [SH, H - 15, D], [x0 - W / 2 + SH / 2, y0 + (H - 15) / 2, 0], { material: "metal" }),
+ box("CS1", "Side panel", [SH, H - 15, D], [x0 + W / 2 - SH / 2, y0 + (H - 15) / 2, 0], { material: "metal" }),
+ box("CK0", "Lower back panel", [inner - 2 * P, back, 6], [x0, yb + back / 2, -D / 2 + P / 2], { material: "metal" }),
+ box("CK1", "Upper back panel", [inner - 2 * P, back, 6], [x0, yb + back * 1.5, -D / 2 + P / 2], { material: "metal" }),
+ box("CT", "Top", [W, 15, D], [x0, y0 + H - 7.5, 0], { material: "metal" }),
+ box("CL", "Plinth", [inner, 70, 12], [x0, y0 + 35, D / 2 - 6], { material: "metal" }),
+ box("CF", "Shelf", [inner, 15, D - 50], [x0, (yb + yt) / 2, 0], { material: "metal" }),
+ ];
+ const dw = inner / 2 - 3, dh = yt - yb - 6;
+ const mesh = (w: number): PartPiece[] => [
+ { shape: "box", size: [30, dh, 18], pos: [-w / 2 + 15, 0, 0] },
+ { shape: "box", size: [30, dh, 18], pos: [w / 2 - 15, 0, 0] },
+ { shape: "box", size: [w - 60, 30, 18], pos: [0, dh / 2 - 15, 0] },
+ { shape: "box", size: [w - 60, 30, 18], pos: [0, -dh / 2 + 15, 0] },
+ { shape: "box", size: [w - 60, 24, 18], pos: [0, 0, 0] },
+ { shape: "box", size: [w - 60, dh - 60, 2], pos: [0, 0, 0], material: "fiber" },
+ ];
+ for (const i of [0, 1]) parts.push(box(`CD${i}`, "Mesh door", [dw, dh, 18], [x0 + (i ? 1 : -1) * (inner / 4), (yb + yt) / 2, D / 2 - 9], { pieces: mesh(dw), material: "metal" }));
+ const sx = (i: number) => x0 + (i ? 1 : -1) * (W / 2);
+ const steps: CustomStep[] = [
+ {
+ title: "Click the back posts onto the bottom",
+ detail: "Lay the bottom on a rug and push a post into each back corner until it clicks.",
+ add: ["CB", "CP0", "CP1"],
+ from: { CP0: [0, 350, 0], CP1: [0, 350, 0] },
+ warnings: ["floor"],
+ },
+ {
+ title: "Lower the side panels onto the bottom",
+ detail: "Stand it up. Each side's lugs drop into the slots at the bottom's corners.",
+ add: ["CS0", "CS1"],
+ from: { CS0: [0, 400, 0], CS1: [0, 400, 0] },
+ },
+ {
+ title: "Slide the lower back panel down between the posts",
+ detail: "Its folded edge faces in. Push it down until it sits on the bottom.",
+ add: ["CK0"],
+ from: { CK0: [0, 500, 0] },
+ },
+ {
+ title: "Bend the tabs and screw the posts to the sides",
+ detail: "Twist the four tabs at the back and the two at the bottom with a flat screwdriver, then one screw through each side into each post, low down.",
+ fix: [0, 1].map((i) => fx("screw", [yb + 60, yb + back - 60].map((y) => [sx(i), y, -D / 2 + 12] as Vec3), [i ? -1 : 1, 0, 0], `CS${i}`, { len: 16, dia: 5 })),
+ tools: ["flathead", "screwdriver"],
+ },
+ {
+ title: "Slide the upper back panel down on top",
+ detail: "Then twist its four side tabs and the two along the bottom edge, like the first one.",
+ add: ["CK1"],
+ from: { CK1: [0, 500, 0] },
+ tools: ["flathead"],
+ },
+ {
+ title: "Screw the two wall brackets to the back posts",
+ detail: "At the top of each post, two screws each.",
+ fix: [
+ ...[0, 1].map((i) => fx("angle", [[x0 + (i ? 1 : -1) * (inner / 2 - P / 2), yt - 60, -D / 2 - 1]], [0, 0, 1], `CP${i}`, { name: "Wall bracket", len: 40, dia: 30 })),
+ ...[0, 1].map((i) => fx("screw", [yt - 25, yt - 95].map((y) => [x0 + (i ? 1 : -1) * (inner / 2 - P / 2), y, -D / 2 - 2] as Vec3), [0, 0, 1], `CP${i}`, { len: 10, dia: 5 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lay the top on and slide it forward",
+ detail: "Its hooks drop into the slots along the sides, then it slides forward to lock. Twist the two tabs at the back and the three along the front.",
+ add: ["CT"],
+ from: { CT: [0, 250, -40] },
+ tools: ["flathead"],
+ },
+ ];
+ return { parts, steps, yb, yt, inner, dw, dh, P };
+}
+
+function meshFinish(c: ReturnType<typeof meshCabinet>, W: number, D: number, x0: number, floor: boolean): CustomStep[] {
+ const { yb, yt, inner } = c;
+ const yf = (yb + yt) / 2;
+ const sup = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [x0 + sx * (inner / 2), yf - 12, sz * (D / 2 - 40)] as Vec3));
+ return [
+ ...(floor
+ ? [
+ {
+ title: "Tilt the plinth in at the bottom front",
+ detail: "Hook its top edge under the bottom, swing it down and twist the tab to hold it.",
+ add: ["CL"],
+ from: { CL: [0, 0, 250] as Vec3 },
+ tools: ["flathead" as const],
+ },
+ ]
+ : []),
+ {
+ title: "Hook in the shelf supports",
+ detail: "Four supports in the slots of the sides, all at the same height.",
+ fix: [0, 1].map((i) => fx("clip", sup.filter((p) => (p[0] > x0) === !!i), [i ? 1 : -1, 0, 0], `CS${i}`, { name: "Shelf support" })),
+ },
+ {
+ title: "Put the shelf in and lock it",
+ detail: "Tilt it in and lay it on the supports, then push a lock clip down over each support.",
+ add: ["CF"],
+ fix: [fx("clip", sup.map((p) => [p[0] - Math.sign(p[0] - x0) * 20, yf + 7.5, p[2]] as Vec3), [0, -1, 0], "CF", { name: "Shelf lock" })],
+ },
+ {
+ title: "Push the door pins into the bottom",
+ detail: "One in each front corner of the bottom, pressed in by hand only.",
+ fix: [fx("pin", [-1, 1].map((sx) => [x0 + sx * (inner / 2 - 15), yb, D / 2 - 15] as Vec3), [0, -1, 0], "CB", { name: "Door pin", len: 14, dia: 8 })],
+ },
+ {
+ title: "Stand the doors on the pins and click them in at the top",
+ detail: "Set each door on its pin, then push the hinge catch at its top corner up into the top until it clicks.",
+ add: ["CD0", "CD1"],
+ from: { CD0: [0, 0, 300], CD1: [0, 0, 300] },
+ fix: [0, 1].map((i) => fx("hinge", [[x0 + (i ? 1 : -1) * (inner / 2 - 15), yt - 30, D / 2 - 9]], [0, 1, 0], `CD${i}`, { name: "Hinge catch", len: 40, dia: 16 })),
+ },
+ {
+ title: "Press the door stops in",
+ detail: "Four rubber stops into the slots along the front edges of the top and the bottom, two for each door.",
+ fix: [
+ fx("clip", [-1, 1].map((sx) => [x0 + sx * (inner / 4), yt + 7.5, D / 2] as Vec3), [0, 0, -1], "CT", { name: "Door stop" }),
+ fx("clip", [-1, 1].map((sx) => [x0 + sx * (inner / 4), yb - 10, D / 2 - 12] as Vec3), [0, 0, -1], "CB", { name: "Door stop" }),
+ ],
+ },
+ ];
+}
+
+function meshStandalone(s: ProductSpec): Recipe {
+ const W = 800, H = s.size.h * 10, D = s.size.d * 10;
+ const c = meshCabinet(W, H, D, 0);
+ const steps = [...c.steps];
+ steps.push(...meshFinish(c, W, D, 0, true).slice(0, 1));
+ steps.push({
+ title: "Fix it to the wall",
+ detail: "Hang a keyhole plate on each bracket and screw it to the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("bracket", [-1, 1].map((sx) => [sx * (c.inner / 2 - c.P / 2), c.yt - 60, -D / 2 - 6] as Vec3), [0, 0, 1], "CP0", { name: "Keyhole plate", len: 30, dia: 20 }),
+ fx("plug", [-1, 1].map((sx) => [sx * (c.inner / 2 - c.P / 2), c.yt - 60, -D / 2 - 40] as Vec3), [0, 0, -1], "CP0"),
+ fx("screw", [-1, 1].map((sx) => [sx * (c.inner / 2 - c.P / 2), c.yt - 60, -D / 2 + 15] as Vec3), [0, 0, -1], "CP0", { len: 50, dia: 5 }),
+ ].map((f) => ({ ...f, on: undefined })),
+ tools: ["screwdriver", "drill", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ });
+ steps.push(...meshFinish(c, W, D, 0, true).slice(1));
+ return { parts: c.parts, steps };
+}
+
+/** The mesh cabinet hung in a side unit, on four hangers screwed to the uprights, under the top shelf. */
+function meshInUnit(s: ProductSpec): Recipe & { back: Vec3[] } {
+ const H = s.size.h * 10, D = s.size.d * 10;
+ const cw = 800, ch = 830;
+ const cy0 = H - 70 - ST / 2 - 5 - ch;
+ const u = sideUnit(s, { ys: [110, H - 70], brace: [150, cy0 - 30] });
+ const c = meshCabinet(cw, ch, D, cy0);
+ const parts = [...u.parts, ...c.parts.filter((p) => p.id !== "CL")];
+ const W = u.W;
+ const hy = cy0 + 40;
+ const hangers = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (W / 2 - UX), hy, u.zUp(sz)] as Vec3));
+ const upOf = (p: Vec3) => `U${p[0] > 0 ? 1 : 0}${p[2] > 0 ? 1 : 0}`;
+ const steps: CustomStep[] = [
+ ...u.steps,
+ {
+ title: "Screw the cabinet hangers to the uprights",
+ detail: "One on the inside face of each upright, at the height of the cabinet's bottom, one screw each.",
+ fix: [
+ ...hangers.map((p) => fx("bracket", [p], [Math.sign(p[0]), 0, 0], upOf(p), { name: "Cabinet hanger", len: 40, dia: 20 })),
+ ...hangers.map((p) => fx("screw", [[p[0], p[1] + 30, p[2]]], [Math.sign(p[0]), 0, 0], upOf(p), { len: 20, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ { ...c.steps[0], title: "Build the cabinet: click the back posts onto the bottom", detail: "Build the frame on a rug in front of the shelving, then set it on the hangers." },
+ ...c.steps.slice(1),
+ {
+ title: "Screw the cabinet to the hangers",
+ detail: "One screw through each hanger into the cabinet's side.",
+ fix: hangers.map((p) => fx("screw", [[p[0] - Math.sign(p[0]) * 1, p[1] + 60, p[2] * 0.8]], [-Math.sign(p[0]), 0, 0], p[0] > 0 ? "CS1" : "CS0", { len: 20, dia: 4 })),
+ tools: ["screwdriver"],
+ },
+ ...meshFinish(c, cw, D, 0, false),
+ ];
+ return { parts, steps, back: u.back };
+}
+
+/* ---------------- pine cabinet with doors ---------------- */
+
+/** The pine carcass: top and bottom on dowels, a side with connector screws, the back slid into its grooves, the other side. */
+function pineCarcass(W: number, H: number, D: number, y0: number, pre: string) {
+ const id = (k: string) => pre + k;
+ const parts: CustomPart[] = [
+ box(id("T"), "Top", [W - 2 * T, T, D], [0, y0 + H - T / 2, 0], { material: "wood" }),
+ box(id("B"), "Bottom", [W - 2 * T, T, D], [0, y0 + T / 2, 0], { material: "wood" }),
+ box(id("S0"), "Side", [T, H, D], [-W / 2 + T / 2, y0 + H / 2, 0], { material: "wood" }),
+ box(id("K"), "Back panel", [W - 2 * T, H - 2 * T, 6], [0, y0 + H / 2, -D / 2 + 15], { material: "fiber" }),
+ box(id("S1"), "Side", [T, H, D], [W / 2 - T / 2, y0 + H / 2, 0], { material: "wood" }),
+ ];
+ const ends = [y0 + H - T / 2, y0 + T / 2];
+ const dowels = [-1, 1].flatMap((sx) => ends.flatMap((y) => [-1, 1].map((sz) => [sx * (W / 2 - T), y, sz * (D / 2 - 60)] as Vec3)));
+ const screws = (sx: number) => ends.flatMap((y) => [-1, 1].map((sz) => [sx * (W / 2), y, sz * (D / 2 - 120)] as Vec3));
+ const CONN = { name: "Connector screw", len: 50, dia: 6 };
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the dowels into the top and the bottom",
+ detail: "Two into each end, on a rug.",
+ add: [id("T"), id("B")],
+ fix: [id("T"), id("B")].flatMap((p, i) => [-1, 1].map((sx) => fx("dowel", dowels.filter((d) => d[1] === ends[i] && Math.sign(d[0]) === sx), [-sx, 0, 0], p))),
+ tools: ["hammer"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Fit a side onto the dowels",
+ detail: "Then two connector screws into each end with the Allen key.",
+ add: [id("S0")],
+ fix: [fx("bolt", screws(-1), [1, 0, 0], id("S0"), CONN)],
+ tools: ["allen"],
+ },
+ {
+ title: "Slide the back panel into its grooves",
+ detail: "From the open side, painted face in, all the way to the side.",
+ add: [id("K")],
+ from: { [id("K")]: [W, 0, 0] },
+ },
+ {
+ title: "Fit the other side",
+ detail: "Onto the dowels, then two connector screws into each end. Stand the cabinet up.",
+ add: [id("S1")],
+ fix: [fx("bolt", screws(1), [-1, 0, 0], id("S1"), CONN)],
+ tools: ["allen"],
+ },
+ ];
+ return { parts, steps };
+}
+
+function pineCabinet(s: ProductSpec, y0: number, wall: boolean, pre = ""): Recipe {
+ const W = 800, H = 830, D = s.size.d * 10;
+ const c = pineCarcass(W, H, D, y0, pre);
+ const id = (k: string) => pre + k;
+ const parts = [...c.parts];
+ const inner = W - 2 * T;
+ for (const [i, y] of [y0 + H / 3, y0 + (2 * H) / 3].entries()) parts.push(box(id(`F${i}`), "Shelf", [inner - 2, T, D - 20], [0, y, 8], { material: "wood" }));
+ for (const i of [0, 1]) parts.push(box(id(`D${i}`), "Door", [W / 2 - 2, H - 4, T], [(i ? 1 : -1) * (W / 4), y0 + H / 2, D / 2 + T / 2], { material: "wood" }));
+ const hy = [y0 + 110, y0 + H - 110];
+ const plates = (sx: number) => hy.map((y) => [sx * (W / 2 - T), y, D / 2 - 40] as Vec3);
+ const steps = [...c.steps];
+ steps.push({
+ title: "Screw the hinge plates to the sides",
+ detail: "Two on the inside of each side at the front, two screws each.",
+ fix: [-1, 1].flatMap((sx) => [
+ fx("plate", plates(sx), [sx, 0, 0], id(sx < 0 ? "S0" : "S1"), { name: "Hinge plate", len: 40, dia: 20 }),
+ fx("screw", plates(sx).flatMap((p) => [p[1] + 28, p[1] - 28].map((y) => [p[0], y, p[2]] as Vec3)), [sx, 0, 0], id(sx < 0 ? "S0" : "S1"), { len: 14, dia: 4 }),
+ ]),
+ tools: ["screwdriver"],
+ pose: "+y",
+ });
+ if (wall)
+ steps.push({
+ title: "Hang it on the wall",
+ detail: "Two screws through the top of the back into the wall, with one of you holding it level. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", [-1, 1].map((sx) => [sx * (W / 2 - 90), y0 + H - 45, -D / 2 - 30] as Vec3), [0, 0, -1], id("K")),
+ fx("screw", [-1, 1].map((sx) => [sx * (W / 2 - 90), y0 + H - 45, -D / 2 + 12] as Vec3), [0, 0, -1], id("K"), { len: 50, dia: 5 }),
+ ],
+ tools: ["screwdriver", "drill", "level", "pencil"],
+ people: 2,
+ wall: true,
+ warnings: ["wall", "two"],
+ });
+ const doors = [id("D0"), id("D1")];
+ const hx = (sx: number) => sx * (W / 2 - 40);
+ steps.push(
+ {
+ title: "Screw the hinges onto the doors",
+ detail: "Doors face down on a rug. Press each hinge cup in and fix it with two screws.",
+ wait: doors,
+ fix: doors.flatMap((d, i) => {
+ const sx = i ? 1 : -1;
+ return [
+ fx("hinge", hy.map((y) => [hx(sx), y, D / 2] as Vec3), [0, 0, 1], d),
+ fx("screw", hy.flatMap((y) => [y + 30, y - 30].map((yy) => [hx(sx), yy, D / 2] as Vec3)), [0, 0, 1], d, { len: 12, dia: 4 }),
+ ];
+ }),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Click the doors onto the hinge plates",
+ detail: "Hook each hinge over its plate and press until it clicks.",
+ add: doors,
+ from: Object.fromEntries(doors.map((d) => [d, [0, 0, 300] as Vec3])),
+ },
+ {
+ title: "Put the shelves in on their pins",
+ detail: "Four pins for each shelf, at the same height on both sides.",
+ add: [id("F0"), id("F1")],
+ fix: [0, 1].flatMap((i) =>
+ [-1, 1].map((sx) => fx("pin", [-1, 1].map((sz) => [sx * (W / 2 - T), y0 + (H * (i + 1)) / 3 - T / 2 - 3, sz * (D / 2 - 60)] as Vec3), [sx, 0, 0], id(sx < 0 ? "S0" : "S1"), { len: 16, dia: 5 })),
+ ),
+ },
+ { title: "Line the doors up", detail: "Turn the hinge screws until the gaps between the doors are even.", tools: ["screwdriver"] },
+ );
+ return { parts, steps };
+}
+
+/* ---------------- pine 2x2 shelving unit ---------------- */
+
+function cubeUnit(s: ProductSpec, y0: number, pre = "", lying = true) {
+ const W = 800, H = 830, D = s.size.d * 10;
+ const id = (k: string) => pre + k;
+ const yM = y0 + H / 2;
+ const vh = H / 2 - 1.5 * T;
+ const parts: CustomPart[] = [
+ box(id("M"), "Middle shelf", [W - 2 * T, T, D], [0, yM, 0], { material: "wood" }),
+ box(id("V0"), "Divider", [T, vh, D], [0, y0 + T + vh / 2, 0], { material: "wood" }),
+ box(id("V1"), "Divider", [T, vh, D], [0, yM + T / 2 + vh / 2, 0], { material: "wood" }),
+ box(id("S0"), "Side", [T, H - 2 * T, D], [-W / 2 + T / 2, yM, 0], { material: "wood" }),
+ box(id("S1"), "Side", [T, H - 2 * T, D], [W / 2 - T / 2, yM, 0], { material: "wood" }),
+ box(id("T"), "Top", [W, T, D], [0, y0 + H - T / 2, 0], { material: "wood" }),
+ box(id("B"), "Bottom", [W, T, D], [0, y0 + T / 2, 0], { material: "wood" }),
+ ];
+ const CONN = { name: "Connector screw", len: 50, dia: 6 };
+ // dowels and connector screws apart, and clear of the cabinet's own screws when it stands on one
+ const zs = [-1, 1].map((sz) => sz * (D / 2 - 60));
+ const zc = [-1, 1].map((sz) => sz * (D / 2 - 90));
+ const edgeX = [-W / 2 + T / 2, 0, W / 2 - T / 2];
+ const edgeOf = (x: number, top: boolean) => (x === 0 ? id(top ? "V1" : "V0") : id(x < 0 ? "S0" : "S1"));
+ const steps: CustomStep[] = [
+ {
+ title: "Fit the dowels and the connector rod in the middle shelf",
+ detail: "A long dowel into the top face and one into the bottom, then screw the rod into the hole between them.",
+ add: [id("M")],
+ fix: [
+ fx("dowel", [[0, yM + T / 2, -60]], [0, -1, 0], id("M"), { len: 40, dia: 8 }),
+ fx("dowel", [[0, yM - T / 2, -60]], [0, 1, 0], id("M"), { len: 40, dia: 8 }),
+ fx("connector", [[0, yM + T / 2, 60]], [0, -1, 0], id("M"), { name: "Connector rod", len: 110, dia: 6 }),
+ ],
+ tools: ["screwdriver"],
+ ...(lying ? { pose: "+z" as const, warnings: ["floor" as const] } : {}),
+ },
+ {
+ title: "Push a divider onto each face of the middle shelf",
+ detail: "One above and one below, over the dowel and the rod.",
+ add: [id("V0"), id("V1")],
+ },
+ {
+ title: "Tighten the connector nuts",
+ detail: "One in each divider, turned onto the rod with a screwdriver until the cross is tight.",
+ fix: [fx("nut", [[-T / 2, yM + T / 2 + 40, 60], [-T / 2, yM - T / 2 - 40, 60]], [1, 0, 0], id("V1"), { name: "Connector nut", len: 12, dia: 12 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the sides to the middle shelf",
+ detail: "Two dowels into each end of the shelf, then each side on, with two connector screws.",
+ fix: [-1, 1].map((sx) => fx("dowel", zs.map((z) => [sx * (W / 2 - T), yM, z] as Vec3), [-sx, 0, 0], id("M"))),
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the sides on",
+ detail: "Two connector screws through each side into the shelf's end.",
+ add: [id("S0"), id("S1")],
+ fix: [-1, 1].map((sx) => fx("bolt", zc.map((z) => [sx * (W / 2), yM, z] as Vec3), [-sx, 0, 0], id(sx < 0 ? "S0" : "S1"), CONN)),
+ tools: ["allen"],
+ },
+ {
+ title: "Tap twelve dowels into the edges",
+ detail: "Two into each end of the sides and the dividers.",
+ fix: [true, false].flatMap((top) => edgeX.map((x) => fx("dowel", zs.map((z) => [x, top ? y0 + H - T : y0 + T, z] as Vec3), [0, top ? -1 : 1, 0], edgeOf(x, top)))),
+ tools: ["hammer"],
+ },
+ {
+ title: "Fit the top and the bottom",
+ detail: "Onto the dowels, then six connector screws through each into the sides and dividers.",
+ add: [id("T"), id("B")],
+ fix: [true, false].map((top) => fx("bolt", edgeX.flatMap((x) => zc.map((z) => [x, top ? y0 + H : y0, z] as Vec3)), [0, top ? -1 : 1, 0], id(top ? "T" : "B"), CONN)),
+ tools: ["allen"],
+ },
+ ];
+ return { parts, steps, W, H, D };
+}
+
+/** The 2x2 unit on the wall: two brackets under the top at the back, keyhole plates, screws into the wall, covers. */
+function cubeWall(y0: number, W: number, H: number, D: number, pre: string): CustomStep[] {
+ const id = (k: string) => pre + k;
+ const xs = [-1, 1].map((sx) => sx * (W / 2 - T - 50));
+ const y = y0 + H - T;
+ return [
+ {
+ title: "Screw the wall brackets under the top",
+ detail: "In the top two corners at the back, two screws each.",
+ fix: [
+ fx("angle", xs.map((x) => [x, y, -D / 2 + 25] as Vec3), [0, 1, 0], id("T"), { name: "Wall bracket", len: 40, dia: 30 }),
+ fx("screw", xs.flatMap((x) => [x - 25, x + 25].map((xx) => [xx, y, -D / 2 + 45] as Vec3)), [0, 1, 0], id("T"), { len: 14, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ pose: "+y",
+ },
+ {
+ title: "Hang it on the wall",
+ detail: "Screw the keyhole plates to the wall where the brackets meet it, hang the unit on them and snap the covers on. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("bracket", xs.map((x) => [x, y - 30, -D / 2 - 4] as Vec3), [0, 0, 1], id("T"), { name: "Keyhole plate", len: 30, dia: 20 }),
+ fx("plug", xs.map((x) => [x, y - 30, -D / 2 - 40] as Vec3), [0, 0, -1], id("T")),
+ fx("screw", xs.map((x) => [x, y - 30, -D / 2 - 6] as Vec3), [0, 0, -1], id("T"), { len: 50, dia: 5 }),
+ fx("cap", xs.map((x) => [x, y - 15, -D / 2 + 30] as Vec3), [0, 0, -1], id("T"), { name: "Cover" }),
+ ],
+ tools: ["screwdriver", "drill", "pencil", "level"],
+ people: 2,
+ wall: true,
+ warnings: ["wall", "two"],
+ },
+ ];
+}
+
+function cubeAlone(s: ProductSpec): Recipe {
+ const c = cubeUnit(s, 0);
+ return { parts: c.parts, steps: [...c.steps, ...cubeWall(0, c.W, c.H, c.D, "")] };
+}
+
+/** 80x166: the pine cabinet on the floor and the 2x2 unit on top, pinned and plated together at the back. */
+function cubeOnCabinet(s: ProductSpec): Recipe {
+ const cab = pineCabinet(s, 0, false, "c");
+ const cube = cubeUnit(s, 830, "", false);
+ const D = s.size.d * 10, W = 800;
+ const join = [-1, 1].map((sx) => sx * (W / 2 - T / 2));
+ const steps: CustomStep[] = [
+ ...cab.steps,
+ {
+ title: "Push two pins into the top of the cabinet",
+ detail: "They keep the shelving unit in line on top.",
+ fix: [fx("pin", join.map((x) => [x * 0.9, 830, 0] as Vec3), [0, -1, 0], "cT", { name: "Guide pin", len: 16, dia: 6 })],
+ },
+ ...cube.steps.map((st, i) => (i === 0 ? { ...st, detail: "Build the shelving unit on a rug next to the cabinet. " + st.detail } : st)),
+ {
+ title: "Join the two at the back",
+ detail: "Lift the shelving unit onto the pins together, then a joining plate across each back corner, two screws each.",
+ fix: [
+ ...join.map((x) => fx("plate", [[x, 830, -D / 2]], [0, 0, 1], x < 0 ? "cS0" : "cS1", { name: "Joining plate", len: 70, dia: 30 })),
+ ...join.map((x) => fx("screw", [[x, 800, -D / 2 - 1], [x, 870, -D / 2 - 1]], [0, 0, 1], x < 0 ? "cS0" : "cS1", { len: 14, dia: 4 })),
+ ],
+ people: 2,
+ tools: ["screwdriver"],
+ warnings: ["two"],
+ },
+ ...cubeWall(830, W, 830, D, ""),
+ ];
+ return { parts: [...cab.parts, ...cube.parts], steps };
+}
+
+/* ---------------- cabinet with sliding doors ---------------- */
+
+function slidingCabinet(s: ProductSpec): Recipe {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const c = pineCarcass(W, H, D, 0, "");
+ const parts = [...c.parts];
+ const inner = W - 2 * T;
+ const fy = [H / 3, (2 * H) / 3];
+ fy.forEach((y, i) => parts.push(box(`F${i}`, "Shelf", [inner - 2, T, D - 60], [0, y, -12], { material: "wood" })));
+ const dw = inner / 2 + 15, dh = H - 2 * T - 8;
+ const dz = [D / 2 - 34, D / 2 - 14];
+ const dx = [-inner / 2 + dw / 2, inner / 2 - dw / 2];
+ for (const i of [0, 1]) parts.push(box(`G${i}`, "Sliding door", [dw, dh, 12], [dx[i], H / 2, dz[i]], { material: "wood" }));
+ const ends = (i: number) => [-1, 1].map((k) => dx[i] + k * (dw / 2 - 70));
+ const topY = H / 2 + dh / 2, botY = H / 2 - dh / 2;
+ const fits = (kind: HwKind, name: string, y: number, dir: Vec3) =>
+ [0, 1].flatMap((i) => [
+ fx(kind, ends(i).map((x) => [x, y, dz[i]] as Vec3), dir, `G${i}`, { name, len: 12, dia: 24 }),
+ fx("screw", ends(i).flatMap((x) => [x - 26, x + 26].map((xx) => [xx, y, dz[i] - 3] as Vec3)), dir, `G${i}`, { len: 12, dia: 4 }),
+ ]);
+ const steps: CustomStep[] = [
+ ...c.steps,
+ {
+ title: "Put the shelves in on their pins",
+ detail: "Four pins for each shelf, level on both sides.",
+ add: ["F0", "F1"],
+ fix: fy.flatMap((y) => [-1, 1].map((sx) => fx("pin", [-1, 1].map((sz) => [sx * (W / 2 - T), y - T / 2 - 3, -12 + sz * (D / 2 - 70)] as Vec3), [sx, 0, 0], sx < 0 ? "S0" : "S1", { len: 16, dia: 5 }))),
+ pose: "+y",
+ },
+ {
+ title: "Screw the rollers onto the top of the doors",
+ detail: "Two on each door's top edge, two screws each.",
+ wait: ["G0", "G1"],
+ fix: fits("roller", "Door roller", topY, [0, -1, 0]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the guides onto the bottom of the doors",
+ detail: "Two on each door's bottom edge, two screws each.",
+ fix: fits("clip", "Door guide", botY, [0, 1, 0]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Hang the back door, then the front door",
+ detail: "Tilt each door in, lift its rollers into the top track and set its guides into the bottom one, then push the lock on each roller until it clicks.",
+ add: ["G0", "G1"],
+ from: { G0: [0, 0, 300], G1: [0, 0, 300] },
+ },
+ { title: "Level the doors", detail: "Turn the roller adjusters until both doors hang straight and the gap is even.", tools: ["screwdriver"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Two screws through the top of the back into the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", [-1, 1].map((sx) => [sx * (W / 2 - 90), H - 45, -D / 2 - 30] as Vec3), [0, 0, -1], "K"),
+ fx("screw", [-1, 1].map((sx) => [sx * (W / 2 - 90), H - 45, -D / 2 + 12] as Vec3), [0, 0, -1], "K", { len: 50, dia: 5 }),
+ ],
+ tools: ["screwdriver", "drill", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+ return { parts, steps };
+}
+
+/* ---------------- box shelf with divider ---------------- */
+
+function boxShelf(s: ProductSpec): Recipe {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const lip = 70, t = 16;
+ const inner = W - 2 * t;
+ // a side: tall at the back, sloping down to the low front board it butts against; a flat board stood on edge
+ const pc = t + (H - t) / 2;
+ const zs = -t / 2; // the sides stop at the front board's back face
+ const topAt = (z: number) => H - ((H - lip) * (z + D / 2)) / (D - t);
+ const upright = (outline: [number, number][]): PartPiece => ({ shape: "slab", size: [H - t, t, D - t], pos: [0, 0, 0], outline, rot: [0, 0, Math.PI / 2] });
+ const half = (D - t) / 2;
+ const side = (sx: number): CustomPart =>
+ box(`S${sx < 0 ? 0 : 1}`, "Side", [t, H - t, D - t], [sx * (W / 2 - t / 2), pc, zs], {
+ pieces: [upright([[t - pc, -half], [H - pc, -half], [lip - pc, half], [t - pc, half]])],
+ material: "wood",
+ });
+ const zb = -D / 2 + t, zf = D / 2 - t;
+ const parts: CustomPart[] = [
+ box("L", "Front", [W, lip - t, t], [0, t + (lip - t) / 2, D / 2 - t / 2], { material: "wood" }),
+ side(-1),
+ side(1),
+ box("K", "Back", [inner, H - t, t], [0, pc, -D / 2 + t / 2], { material: "wood" }),
+ box("B", "Bottom", [W, t, D], [0, t / 2, 0], { material: "wood" }),
+ box("V", "Divider", [t, H - t, zf - zb], [0, pc, (zb + zf) / 2], {
+ pieces: [{ ...upright([[t - pc, -(zf - zb) / 2], [topAt(zb) - 20 - pc, -(zf - zb) / 2], [topAt(zf) - 10 - pc, (zf - zb) / 2], [t - pc, (zf - zb) / 2]]), size: [H - t, t, zf - zb] }],
+ material: "wood",
+ }),
+ ];
+ const CONN = { name: "Connector screw", len: 50, dia: 6 };
+ const xs = (sx: number) => sx * (W / 2 - t / 2);
+ const steps: CustomStep[] = [
+ {
+ title: "Screw two cam bolts into the front",
+ detail: "Lay the low front board face down on a rug and screw a bolt into the hole near each end.",
+ add: ["L"],
+ fix: [fx("camScrew", [-1, 1].map((sx) => [xs(sx), t + 15, D / 2 - t] as Vec3), [0, 0, 1], "L")],
+ tools: ["screwdriver"],
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap a dowel into each side",
+ detail: "Into the hole in its low front edge.",
+ wait: ["S0", "S1"],
+ fix: [-1, 1].map((sx) => fx("dowel", [[xs(sx), lip - 14, D / 2 - t]], [0, 0, -1], sx < 0 ? "S0" : "S1")),
+ tools: ["hammer"],
+ },
+ {
+ title: "Push the sides onto the front and lock the cams",
+ detail: "Each side goes over its bolt and dowel. Turn the cam lock until it grips the bolt.",
+ add: ["S0", "S1"],
+ fix: [-1, 1].map((sx) => fx("cam", [[sx * (W / 2 - t), t + 15, D / 2 - t - 25]], [sx, 0, 0], sx < 0 ? "S0" : "S1")),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the back on",
+ detail: "Between the tall ends of the sides, two connector screws through each side into it.",
+ add: ["K"],
+ fix: [-1, 1].map((sx) => fx("bolt", [H * 0.35, H * 0.8].map((y) => [sx * (W / 2), y, -D / 2 + t / 2] as Vec3), [-sx, 0, 0], sx < 0 ? "S0" : "S1", CONN)),
+ tools: ["allen"],
+ },
+ {
+ title: "Turn it over and screw the bottom on",
+ detail: "Upside down on the rug, the bottom over it, then five connector screws up into the sides, the back and the front.",
+ add: ["B"],
+ fix: [
+ fx(
+ "bolt",
+ [
+ [xs(-1), 0, -30],
+ [xs(1), 0, -30],
+ [-inner / 4, 0, -D / 2 + t / 2],
+ [inner / 4, 0, -D / 2 + t / 2],
+ [0, 0, D / 2 - t / 2],
+ ],
+ [0, 1, 0],
+ "B",
+ CONN,
+ ),
+ ],
+ tools: ["allen"],
+ pose: "-y",
+ },
+ {
+ title: "Clip the divider holders on and slide the divider in",
+ detail: "Turn it the right way up. Two wire holders in the middle of the back and the front, then the divider slides down into them.",
+ fix: [
+ fx("clip", [[0, H * 0.55, -D / 2 + t]], [0, 0, -1], "K", { name: "Divider holder" }),
+ fx("clip", [[0, t + 30, D / 2 - t]], [0, 0, 1], "L", { name: "Divider holder" }),
+ ],
+ add: ["V"],
+ from: { V: [0, 300, 0] },
+ pose: "+y",
+ },
+ {
+ title: "Set it on a shelf of the shelving unit",
+ detail: "It sits on four shelf pins in the uprights, like a shelf.",
+ },
+ ];
+ return { parts, steps };
+}
+
+/* ---------------- storage box on wheels, in a side unit ---------------- */
+
+function storageBox(W: number, D: number): Recipe {
+ const L = W - 2 * UX - 60; // clear of the uprights
+ const BD = D - 30;
+ const et = 18, wh = 50, bh = 200;
+ const y0 = wh;
+ const inn = L - 2 * et;
+ const rail = 40, slat = 30, gap = 10;
+ const parts: CustomPart[] = [
+ box("XB", "Box bottom", [inn, 15, BD - 2 * et], [0, y0 + 7.5, 0], { material: "wood" }),
+ box("XR0", "Rail", [inn, rail, et], [0, y0 + rail / 2, -BD / 2 + et / 2], { material: "wood" }),
+ box("XR1", "Rail", [inn, rail, et], [0, y0 + rail / 2, BD / 2 - et / 2], { material: "wood" }),
+ box("XE0", "End panel", [et, bh, BD], [-L / 2 + et / 2, y0 + bh / 2, 0], { material: "wood" }),
+ ];
+ const slats: string[] = [];
+ const sy = (k: number) => y0 + rail + gap + slat / 2 + k * (slat + gap);
+ for (const [face, n] of [[1, 4], [-1, 3]] as const)
+ for (let k = 0; k < n; k++) {
+ const id = `XL${slats.length}`;
+ slats.push(id);
+ parts.push(box(id, "Slat", [inn, slat, et], [0, face > 0 ? sy(k) : sy(k) + (k ? 10 * k : 0) + 5, face * (BD / 2 - et / 2)], { material: "wood" }));
+ }
+ parts.push(box("XE1", "End panel", [et, bh, BD], [L / 2 - et / 2, y0 + bh / 2, 0], { material: "wood" }));
+ const pos = (id: string) => parts.find((p) => p.id === id)!.pos;
+ const SCREW = { name: "Long screw", len: 60, dia: 4 };
+ // the screw heads sit just proud of the end panel, so they never share a point with the dowels behind them
+ const sxo = (sx: number) => sx * (L / 2 + 5);
+ const scr = (sx: number): Vec3[] => [
+ [sxo(sx), y0 + 7.5, 60],
+ [sxo(sx), y0 + rail / 2, -BD / 2 + et / 2],
+ [sxo(sx), y0 + rail / 2, BD / 2 - et / 2],
+ [sxo(sx), pos("XL3")[1], BD / 2 - et / 2],
+ [sxo(sx), pos("XL6")[1], -BD / 2 + et / 2],
+ ];
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the dowels into the box bottom",
+ detail: "Four along each long edge and one in each end.",
+ add: ["XB"],
+ fix: [
+ ...[-1, 1].map((sz) => fx("dowel", [-0.375, -0.125, 0.125, 0.375].map((k) => [k * inn, y0 + 7.5, sz * (BD / 2 - et)] as Vec3), [0, 0, -sz], "XB")),
+ ...[-1, 1].map((sx) => fx("dowel", [[sx * (inn / 2), y0 + 7.5, 0]], [-sx, 0, 0], "XB")),
+ ],
+ tools: ["hammer"],
+ pose: "+y",
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap the dowels into the ends of the rails",
+ detail: "Two in each end.",
+ wait: ["XR0", "XR1"],
+ fix: ["XR0", "XR1"].flatMap((id) => [-1, 1].map((sx) => fx("dowel", [-15, 15].map((dy) => [sx * (inn / 2), pos(id)[1] + dy, pos(id)[2]] as Vec3), [-sx, 0, 0], id))),
+ tools: ["hammer"],
+ },
+ {
+ title: "Push the rails onto the long edges of the bottom",
+ add: ["XR0", "XR1"],
+ },
+ {
+ title: "Stand it on an end panel",
+ detail: "Lay one end panel on the rug, holes up, and push the bottom and rails down into it.",
+ add: ["XE0"],
+ pose: "+x",
+ },
+ {
+ title: "Tap the dowels into the slats",
+ detail: "Two in each end of every slat.",
+ wait: slats,
+ fix: slats.flatMap((id) => [-1, 1].map((sx) => fx("dowel", [-8, 8].map((dy) => [sx * (inn / 2), pos(id)[1] + dy, pos(id)[2]] as Vec3), [-sx, 0, 0], id))),
+ tools: ["hammer"],
+ },
+ {
+ title: "Push the slats into the end panel",
+ detail: "Four at the front and three at the back, smooth face out.",
+ add: slats,
+ },
+ {
+ title: "Put the other end panel on and screw it",
+ detail: "Over all the dowels, then five long screws into the bottom, the rails and two slats.",
+ add: ["XE1"],
+ fix: [fx("screw", scr(1), [-1, 0, 0], "XE1", SCREW)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Turn it over and screw the first end",
+ detail: "The same five long screws.",
+ fix: [fx("screw", scr(-1), [1, 0, 0], "XE0", SCREW)],
+ tools: ["screwdriver"],
+ pose: "-x",
+ },
+ {
+ title: "Screw the castors on",
+ detail: "Upside down, one under each corner of the end panels, two screws each.",
+ fix: [
+ ...[-1, 1].map((sx) => fx("castor", [-1, 1].map((sz) => [sx * (L / 2 - et / 2), y0, sz * (BD / 2 - 60)] as Vec3), [0, 1, 0], sx < 0 ? "XE0" : "XE1")),
+ ...[-1, 1].map((sx) => fx("screw", [-1, 1].flatMap((sz) => [-1, 1].map((k) => [sx * (L / 2 - et / 2), y0, sz * (BD / 2 - 60) + k * 24] as Vec3)), [0, 1, 0], sx < 0 ? "XE0" : "XE1", { len: 16, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ pose: "-y",
+ },
+ ];
+ return { parts, steps };
+}
+
+function boxUnit(s: ProductSpec): Recipe & { back: Vec3[] } {
+ const H = s.size.h * 10;
+ const lo = 320, hi = H - 70, n = H < 1500 ? 3 : 4;
+ const ys = Array.from({ length: n }, (_, i) => lo + ((hi - lo) * i) / (n - 1));
+ const u = sideUnit(s, { ys, brace: [ys[0] + 40, ys[1] - 40] });
+ const bx = storageBox(u.W, u.D);
+ return {
+ parts: [...bx.parts, ...u.parts],
+ steps: [
+ ...bx.steps,
+ ...u.steps.map((st, i) => (i === 0 ? { ...st, detail: "Push the box aside first. " + st.detail } : st)),
+ { title: "Roll the box in under the bottom shelf", detail: "It runs on its castors between the side units." },
+ ],
+ back: u.back,
+ };
+}
+
+/* ---------------- which guide is which ---------------- */
+
+const MESH = /ivar-cabinet-doors-(80-x-83|160-x-30-x-83)/;
+const MESH_IN_UNIT = /ivar-cabinet-doors-89-x-30-x-124/;
+const DOORS = /ivar-shelving-unit-doors-/;
+const WALL_CAB = /ivar-wall-cabinet-doors-/;
+const CUBE = /ivar-shelving-unit-80-x-30-x-83/;
+const CUBE_ON_CAB = /ivar-shelving-unit-80-x-30-x-166/;
+const SLIDING = /ivar-cabinet-sliding-doors-/;
+const BOX_SHELF = /ivar-box-shelf-divider-/;
+const BOX_UNIT = /ivar-shelving-unit-storage-box-/;
+
+function run(b: PlanBuilder, s: ProductSpec, r: Recipe & { back?: Vec3[] }) {
+ buildCustom(b, { ...s, custom: { parts: r.parts, steps: r.steps } });
+ if (r.back) strapStep(b, s, r.back);
+ return true;
+}
+
const family: Family = {
names: ["IVAR"],
build(b, s) {
- if (s.archetype !== "shelf" || s.shelf?.style !== "bookcase" || s.shelf.boxUnder) return false;
- if (CUBE_UNIT.test(s.slug ?? "")) return false;
- const r = recipe(s);
- buildCustom(b, { ...s, custom: { parts: r.parts, steps: r.steps } });
- strapStep(b, s, [r.top(0), r.top(1)]);
- return true;
+ const slug = s.slug ?? "";
+ if (MESH.test(slug)) return run(b, s, meshStandalone(s));
+ if (MESH_IN_UNIT.test(slug)) return run(b, s, meshInUnit(s));
+ if (DOORS.test(slug)) return run(b, s, doorUnit(s));
+ if (WALL_CAB.test(slug)) return run(b, s, pineCabinet(s, 0, true));
+ if (CUBE.test(slug)) return run(b, s, cubeAlone(s));
+ if (CUBE_ON_CAB.test(slug)) return run(b, s, cubeOnCabinet(s));
+ if (SLIDING.test(slug)) return run(b, s, slidingCabinet(s));
+ if (BOX_SHELF.test(slug)) return run(b, s, boxShelf(s));
+ if (BOX_UNIT.test(slug)) return run(b, s, boxUnit(s));
+ if (s.archetype !== "shelf" || s.shelf?.style !== "bookcase") return false;
+ const u = sideUnit(s);
+ return run(b, s, { parts: u.parts, steps: u.steps, back: u.back });
},
};
export default family;
diff --git a/src/lib/plan/families/jall.ts b/src/lib/plan/families/jall.ts
new file mode 100644
index 0000000..c0327c4
--- /dev/null
+++ b/src/lib/plan/families/jall.ts
@@ -0,0 +1,42 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * JÄLL drying rack: a folding steel rack that IKEA sells ready to use, with no assembly manual. Its guide only
+ * opens it: the crossed legs swing apart until the top with its drying lines lies flat and locks.
+ */
+
+function rack(s: ProductSpec): CustomParams {
+ const L = Math.round(s.size.w * 10) || 790, D = Math.round(s.size.d * 10) || 400, H = Math.round(s.size.h * 10) || 820;
+ const tube = 16, zs = D / 2 - 20, spread = L / 2 - 120;
+ const yTop = H - 10;
+ // each side is an X of two tubes in the length, from a foot at one end up to the top rail at the other
+ const ang = Math.atan2(2 * spread, yTop);
+ const len = Math.hypot(2 * spread, yTop);
+ const legs: PartPiece[] = [-1, 1].flatMap((sz) => [-1, 1].map((k): PartPiece => ({ shape: "cyl", size: [tube, Math.round(len), tube], pos: [0, yTop / 2 - H / 2, sz * zs], rot: [0, 0, k * ang] })));
+ // the bars that keep the two X's apart, one high and one low
+ const bars: PartPiece[] = [160, 420].map((y, i): PartPiece => ({ shape: "cyl", size: [tube, 2 * zs, tube], pos: [(i ? 1 : -1) * spread * (1 - (2 * y) / yTop) * 0.98, y - H / 2, 0], rot: [Math.PI / 2, 0, 0] }));
+ const lines = 7;
+ const top: PartPiece[] = [
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "cyl", size: [tube, L, tube], pos: [0, 0, sz * (D / 2 - tube / 2)], rot: [0, 0, Math.PI / 2] })),
+ ...Array.from({ length: lines }, (_, i): PartPiece => ({ shape: "cyl", size: [4, L - 40, 4], pos: [0, 0, -D / 2 + tube + ((D - 2 * tube) * (i + 0.5)) / lines], rot: [0, 0, Math.PI / 2] })),
+ ];
+ const parts: CustomPart[] = [
+ { id: "legs", name: "Leg frame", size: [2 * spread + tube, H, D], pos: [0, H / 2, 0], material: "metal", pieces: [...legs, ...bars] },
+ { id: "top", name: "Top with drying lines", size: [L, tube, D], pos: [0, yTop, 0], material: "metal", pieces: top },
+ ];
+ const steps: CustomStep[] = [
+ { title: "Take the folded rack out of the box", detail: "It comes ready to use, with nothing to put together. Stand it on its feet, still folded.", add: ["legs"], from: { legs: [0, 300, 0] } },
+ { title: "Pull the legs apart and lower the top", detail: "Open the crossed legs until the top lies flat and the bars lock it open.", add: ["top"], from: { top: [0, 250, 0] } },
+ { title: "Check it stands steady", detail: "All four feet on a flat floor. Hang the washing evenly on both sides; to fold it, lift the top at one end." },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["JÄLL", "JALL"],
+ recipe(s) {
+ return /drying rack|jall-drying/i.test(`${s.variant} ${s.slug ?? ""}`) ? rack(s) : null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/janinge.ts b/src/lib/plan/families/janinge.ts
index c40bea5..89e5af5 100644
--- a/src/lib/plan/families/janinge.ts
+++ b/src/lib/plan/families/janinge.ts
@@ -84,7 +84,7 @@ function stool(s: ProductSpec): CustomParams {
{
title: "Tighten the footrest's grub screws",
detail: "Two of them, at the back of the clamp, with the small Allen key.",
- fix: [fx("bolt", [-14, 14].map((x): Vec3 => [x, yFoot, -92]), [0, 0, 1], "FR", { len: 10, dia: 8, name: "Grub screw" })],
+ fix: [fx("bolt", [-14, 14].map((x): Vec3 => [x, yFoot, -33]), [0, 0, 1], "FR", { len: 10, dia: 8, name: "Grub screw" })],
tools: ["allen"],
},
{ title: "Drop the seat into the column", detail: "Lower the gas column straight into the top of the lower column. Your weight pushes it home the first time you sit." },
diff --git a/src/lib/plan/families/jarvfjallet.ts b/src/lib/plan/families/jarvfjallet.ts
index 295a42c..ac9e60a 100644
--- a/src/lib/plan/families/jarvfjallet.ts
+++ b/src/lib/plan/families/jarvfjallet.ts
@@ -50,7 +50,7 @@ function chair(s: ProductSpec): CustomParams {
{ id: "G", name: "Gas lift", shape: "cyl", material: "metal", size: [50, MY - 110, 50], pos: [0, (MY + 110) / 2, 0] },
// spine of the backrest: a bar under the seat, up behind the cushion, with a bracket for the cushion top and bottom
boxes("B", "Backrest frame", [
- [[-20, SY0 - 30, -300], [20, SY0, -150]],
+ [[-50, SY0 - 30, -300], [50, SY0, -150]], // a flat plate that takes the three bolts
[[-20, SY0 - 30, -310], [20, 1370, -300]],
[[-60, 600, -300], [60, 630, -270]],
[[-40, 1230, -300], [40, 1250, -270]],
diff --git a/src/lib/plan/families/jolpen.ts b/src/lib/plan/families/jolpen.ts
index d3683ca..f6fc560 100644
--- a/src/lib/plan/families/jolpen.ts
+++ b/src/lib/plan/families/jolpen.ts
@@ -74,7 +74,8 @@ function sofa(s: ProductSpec): CustomParams {
const sides = [-1, 1] as const;
const backPts = (x: number) => [0.2, 0.75].map((u): Vec3 => { const [z, y] = onBack(u); return [x, Math.round(y), Math.round(z)]; });
const seatPts = (x: number) => [-60, 140].map((z): Vec3 => [x, SY - 15, z]);
- const cornerPts = (x: number) => [zb + t / 2, zf - t / 2].map((z): Vec3 => [x, SY - 15, z]);
+ // into the seat frame's back and front rails
+ const cornerPts = (x: number) => [zb + t + 12, zf - 12].map((z): Vec3 => [x, SY - 15, z]);
const bolt = { len: 20, dia: 6 };
const NUT = { name: "Barrel nut", len: 15, dia: 10 };
return {
diff --git a/src/lib/plan/families/juteboda.ts b/src/lib/plan/families/juteboda.ts
new file mode 100644
index 0000000..75db9e8
--- /dev/null
+++ b/src/lib/plan/families/juteboda.ts
@@ -0,0 +1,34 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * JUTEBODA stool: a woven seat on three white steel legs. IKEA sells it ready made (its page has no assembly
+ * instructions), so its guide only unpacks it.
+ */
+function stool(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 410, H = Math.round(s.size.h * 10) || 450, D = Math.round(s.size.d * 10) || 370;
+ const st = 50, yS = H - st;
+ // a rounded triangle, its point at the front
+ const tri: [number, number][] = [[-W / 2, -D / 2], [W / 2, -D / 2], [0, D / 2]];
+ const legAt = tri.map(([x, z]) => [x * 0.8, z * 0.8 - (z > 0 ? 10 : -10)] as [number, number]);
+ const pieces: PartPiece[] = [
+ { shape: "slab", size: [W, st, D], pos: [0, H / 2 - st / 2, 0], outline: tri, round: 70 },
+ ...legAt.map(([x, z]): PartPiece => ({ shape: "cyl", size: [22, yS, 22], pos: [x, yS / 2 - H / 2, z] })),
+ ];
+ return {
+ parts: [{ id: "S", name: "Stool", size: [W, H, D], pos: [0, H / 2, 0], material: "wood", pieces }],
+ steps: [
+ { title: "Unpack the stool", detail: "It comes ready made, so there is nothing to put together. Take off all the packaging.", add: ["S"], from: { S: [0, 300, 0] } },
+ { title: "Check it stands steady", detail: "All three feet should touch the floor. Keep the woven seat dry and away from direct sun." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["JUTEBODA"],
+ recipe(s) {
+ if (/^juteboda-stool/.test(s.slug ?? "")) return stool(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/jutholmen.ts b/src/lib/plan/families/jutholmen.ts
index 89da3b8..a1770e8 100644
--- a/src/lib/plan/families/jutholmen.ts
+++ b/src/lib/plan/families/jutholmen.ts
@@ -64,12 +64,12 @@ function tube(p: Vec3, q: Vec3, dia: number, c: Vec3): PartPiece {
}
/** Two bent tubes that cross under the seat: each has a leg at two opposite corners, joined by a rising arch. */
-function underframe(m: Mod, cx: number, cz: number): { part: Omit<CustomPart, "id">; tabs: Vec3[]; mid: Vec3; yA: number } {
+function underframe(m: Mod, cx: number, cz: number): { parts: Omit<CustomPart, "id">[]; tabs: Vec3[]; mid: Vec3; yA: number } {
const a = m.w / 2 - 35, b = m.d / 2 - 35;
const c: Vec3 = [cx, Y0 / 2, cz];
const yA = 196, yB = 168, dia = 22;
- const pieces: PartPiece[] = [];
const hoop = (sx: number, yc: number) => {
+ const pieces: PartPiece[] = [];
for (const s of [-1, 1]) {
const foot: Vec3 = [cx + s * sx * a, 0, cz + s * b];
const top: Vec3 = [foot[0], Y0, foot[2]];
@@ -80,11 +80,12 @@ function underframe(m: Mod, cx: number, cz: number): { part: Omit<CustomPart, "i
for (let k = 0; k < fs.length - 1; k++) pieces.push(tube(at(fs[k]), at(fs[k + 1]), dia, c));
pieces.push({ shape: "box", size: [44, 4, 44], pos: [top[0] - c[0], Y0 - 2 - c[1], top[2] - c[2]], material: "metal" });
}
+ return pieces;
};
- hoop(1, yA);
- hoop(-1, yB);
+ // two separate leg frames, the high arch crossing over the low one
+ const frames = [hoop(1, yA), hoop(-1, yB)].map((pieces) => ({ name: "Leg frame", size: [m.w - 48, Y0, m.d - 48] as Vec3, pos: c, material: "metal" as const, pieces }));
const tabs: Vec3[] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [cx + sx * a, Y0, cz + sz * b] as Vec3));
- return { part: { name: "Underframe", size: [m.w - 48, Y0, m.d - 48], pos: c, material: "metal", pieces }, tabs, mid: [cx, yA + dia / 2, cz], yA };
+ return { parts: frames, tabs, mid: [cx, yA + dia / 2, cz], yA };
}
function recipeOf(s: ProductSpec): CustomParams | null {
@@ -101,8 +102,10 @@ function recipeOf(s: ProductSpec): CustomParams | null {
const x0 = m.x0 - X / 2, z0 = m.z0 - Z / 2, x1 = x0 + m.w, z1 = z0 + m.d;
const cx = (x0 + x1) / 2, cz = (z0 + z1) / 2;
const u = underframe(m, cx, cz);
- parts.push({ id: `U${i}`, ...u.part });
- ids.frames.push(`U${i}`);
+ u.parts.forEach((pt, k) => {
+ parts.push({ id: `U${i}${k}`, ...pt });
+ ids.frames.push(`U${i}${k}`);
+ });
fix.mid.push(u.mid);
fix.tabs.push(...u.tabs);
parts.push({ id: `S${i}`, name: m.kind === "corner" ? "Corner seat" : "Seat", size: [m.w, Y1 - Y0, m.d], pos: [cx, (Y0 + Y1) / 2, cz], material: "board" });
@@ -172,7 +175,7 @@ function recipeOf(s: ProductSpec): CustomParams | null {
title: "Bolt the leg frames together in the middle",
detail: "Push the spacer sleeve in between the tubes where they cross, then the long bolt from above with the spring washer and a washer under its head. Tighten it fully.",
fix: [
- pts("spacer", fix.mid.map((p) => [p[0], p[1] - 22, p[2]] as Vec3), [0, -1, 0], { name: "Spacer sleeve", len: 16, dia: 20 }),
+ pts("washer", fix.mid.map((p) => [p[0], p[1] - 22, p[2]] as Vec3), [0, -1, 0], { name: "Spacer sleeve", len: 16, dia: 20 }),
pts("washer", fix.mid, [0, -1, 0], { name: "Spring washer", len: 2, dia: 12 }),
pts("washer", fix.mid, [0, -1, 0], { len: 1.5, dia: 16 }),
pts("bolt", fix.mid, [0, -1, 0], BOLT_MID),
diff --git a/src/lib/plan/families/kallax.ts b/src/lib/plan/families/kallax.ts
index 425f307..1a48611 100644
--- a/src/lib/plan/families/kallax.ts
+++ b/src/lib/plan/families/kallax.ts
@@ -40,8 +40,6 @@ function gridOf(s: ProductSpec): Grid | null {
const p = s.shelf;
if (s.archetype !== "shelf" || p?.style !== "grid" || !p.cols || !p.rows) return null;
const cols = p.cols, rows = p.rows;
- // no manual for the 3x3
- if (cols === 3 && rows === 3) return null;
const U = p.underframe ? Math.round(p.underframe * 10) : 0;
const W = s.size.w * 10, H = s.size.h * 10 - U, D = s.size.d * 10;
const T = p.outer ?? 40, ti = p.inner ?? 16;
@@ -98,18 +96,22 @@ function frameRecipe(s: ProductSpec, g: Grid): { recipe: CustomParams; topId: st
...o,
});
const pair = (x: number, y: number): Vec3[] => [[x, y, -zs], [x, y, zs]];
+ // the 3x3's manual puts two dowels side by side at the front and the back of each joint
+ const dpair = (x: number, y: number): Vec3[] => (g.cols === 3 && g.rows === 3 ? [-zs, -zs + 32, zs - 32, zs].map((z) => [x, y, z] as Vec3) : pair(x, y));
const boltsTop = (side: "B" | "C") => fix("bolt", "A", side, [0, -1, 0], pair(side === "B" ? xB : xC, Ht), { len: BOLT.len, dia: BOLT.dia });
const boltsBottom = (side: "B" | "C") => fix("bolt", "D", side, [0, 1, 0], pair(side === "B" ? xB : xC, 0), { len: BOLT.len, dia: BOLT.dia });
const vIds = (j: number) => Array.from({ length: ct - 1 }, (_, i) => `V${j}_${i + 1}`);
const above = (j: number) => (j === 1 ? "A" : `S${j - 1}`);
const below = (j: number) => (j === rt ? "D" : `S${j}`);
- const vTops = (j: number) => vIds(j).map((id, i) => fix("dowel", id, above(j), [0, -1, 0], pair(divX(i + 1), rowTop(j))));
- const vBottoms = (j: number) => vIds(j).map((id, i) => fix("dowel", id, below(j), [0, 1, 0], pair(divX(i + 1), rowTop(j) - cellH)));
- const shelfFace = (k: number) => fix("dowel", `S${k}`, undefined, [0, 1, 0], vIds(k + 1).flatMap((_, i) => pair(divX(i + 1), shelfY(k) - ti / 2)));
+ const vTops = (j: number) => vIds(j).map((id, i) => fix("dowel", id, above(j), [0, -1, 0], dpair(divX(i + 1), rowTop(j))));
+ const vBottoms = (j: number) => vIds(j).map((id, i) => fix("dowel", id, below(j), [0, 1, 0], dpair(divX(i + 1), rowTop(j) - cellH)));
+ const shelfFace = (k: number) => fix("dowel", `S${k}`, undefined, [0, 1, 0], vIds(k + 1).flatMap((_, i) => dpair(divX(i + 1), shelfY(k) - ti / 2)));
const shelfEnd = (k: number, side: "B" | "C") =>
- fix("dowel", `S${k}`, side, [side === "B" ? 1 : -1, 0, 0], pair(side === "B" ? -Wt / 2 + T : Wt / 2 - T, shelfY(k)));
+ fix("dowel", `S${k}`, side, [side === "B" ? 1 : -1, 0, 0], dpair(side === "B" ? -Wt / 2 + T : Wt / 2 - T, shelfY(k)));
const steps: CustomStep[] = [];
+ const two = g.cols === 3 && g.rows === 3 ? "four" : "two";
+ const Two = two[0].toUpperCase() + two.slice(1);
const many = (n: number, one: string, more: string) => (n === 1 ? one : more);
steps.push({
title: `Bolt ${w.A} to ${w.B}`,
@@ -144,7 +146,7 @@ function frameRecipe(s: ProductSpec, g: Grid): { recipe: CustomParams; topId: st
} else {
steps.push({
title: many(ct - 1, `Tap dowels into a ${w.V} and push it onto ${w.A}`, `Tap dowels into ${ct - 1} ${w.Vs} and push them onto ${w.A}`),
- detail: "Two dowels go into one end of each, and that end goes into the panel. The other end stays plain.",
+ detail: `${Two} dowels go into one end of each, and that end goes into the panel. The other end stays plain.`,
add: vIds(1),
fix: vTops(1),
tools: ["hammer"],
@@ -154,20 +156,20 @@ function frameRecipe(s: ProductSpec, g: Grid): { recipe: CustomParams; topId: st
steps.push({
title: `Slide in ${k === 1 ? "a" : "the next"} ${w.S}`,
detail: both
- ? "Tap two dowels into each end first. It goes in along the row, its end into the side."
- : "Tap two dowels into the end that goes into the side, then push it against the row.",
+ ? `Tap ${two} dowels into each end first. It goes in along the row, its end into the side.`
+ : `Tap ${two} dowels into the end that goes into the side, then push it against the row.`,
add: [`S${k}`],
fix: both ? [shelfEnd(k, "B"), shelfEnd(k, "C")] : [shelfEnd(k, "B")],
tools: ["hammer"],
});
if (ct > 1) {
- steps.push({ title: `Tap dowels into the ${w.S} for the next row`, detail: "Into the holes on its open face, two for each piece.", fix: [shelfFace(k)], tools: ["hammer"] });
+ steps.push({ title: `Tap dowels into the ${w.S} for the next row`, detail: `Into the holes on its open face, ${two} for each piece.`, fix: [shelfFace(k)], tools: ["hammer"] });
steps.push({ title: many(ct - 1, `Push in the next ${w.V}`, `Push in the next row of ${w.Vs}`), detail: "Plain end first against the row before, onto the dowels.", add: vIds(k + 1) });
}
}
if (g.pattern === "big") {
steps.push({ title: `Fit ${w.C}`, detail: rt > 1 ? `Turn it up onto the ends of the ${w.Ss}, then bolt it to the first panel.` : "Stand it on its edge against the first panel and bolt it on.", add: ["C"], fix: [boltsTop("C")], tools: ["allen"] });
- if (ct > 1) steps.push({ title: many(ct - 1, `Tap dowels into the free end of the ${w.V}`, `Tap dowels into the last row of ${w.Vs}`), detail: "Into the open ends, two in each.", fix: vBottoms(rt), tools: ["hammer"] });
+ if (ct > 1) steps.push({ title: many(ct - 1, `Tap dowels into the free end of the ${w.V}`, `Tap dowels into the last row of ${w.Vs}`), detail: `Into the open ends, ${two} in each.`, fix: vBottoms(rt), tools: ["hammer"] });
steps.push({
title: `Bolt on ${w.Dd}`,
detail: "Turn it up onto the dowels, then two bolts at each end. Tighten all the bolts now.",
@@ -179,7 +181,7 @@ function frameRecipe(s: ProductSpec, g: Grid): { recipe: CustomParams; topId: st
} else {
steps.push({
title: "Tap dowels into the open ends",
- detail: `Two into each ${w.S} end and two into each piece in the last row.`,
+ detail: `${Two} into each ${w.S} end and ${two} into each piece in the last row.`,
fix: [...Array.from({ length: rt - 1 }, (_, i) => shelfEnd(i + 1, "C")), ...vBottoms(rt)],
tools: ["hammer"],
});
@@ -202,7 +204,7 @@ function frameRecipe(s: ProductSpec, g: Grid): { recipe: CustomParams; topId: st
const zp = D / 2 - 40;
const xs = lying
? [0, 1, 2, 3].map((i) => -g.W / 2 + 40 + ((g.W - 80) * i) / 3)
- : g.ct >= 4
+ : g.ct >= 4 || (g.ct === 3 && g.rt === 3) // the 3x3's manual has a pad under each upright too
? [-g.W / 2 + T / 2, ...Array.from({ length: g.ct - 1 }, (_, i) => divX(i + 1)), g.W / 2 - T / 2]
: [-g.W / 2 + 40, g.W / 2 - 40];
for (const z of [-zp, zp]) for (const x of xs) pads.push([x, 0, z]);
diff --git a/src/lib/plan/families/kallso.ts b/src/lib/plan/families/kallso.ts
index 6a4c515..eacdf68 100644
--- a/src/lib/plan/families/kallso.ts
+++ b/src/lib/plan/families/kallso.ts
@@ -428,13 +428,15 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
const zfB = D / 2 - 20; // back face of the drawer front
const yd = 435, dl = D - 60, zd = zfB - dl / 2;
const bw = 2 * (xd - 8);
- const zDB = zd - dl / 2 + 8;
+ // the back lies over the ends of the sides, like the front: everything joins along the depth, from above
+ const zdE = zd - dl / 2;
+ const zDB = zdE - 8;
const dParts: SubPart[] = [
{ id: "DF", name: "Drawer front", size: [2 * xi - 4, 150, T], pos: [0, 455, D / 2 - 11] },
{ id: "DSL", name: "Drawer side", size: [16, 90, dl], pos: [-xd, yd, zd] },
{ id: "DSR", name: "Drawer side", size: [16, 90, dl], pos: [xd, yd, zd] },
- { id: "DB", name: "Drawer back", size: [bw, 90, 16], pos: [0, yd, zDB] },
- { id: "DD", name: "Drawer bottom", size: [bw, 3, zfB - (zDB + 8)], pos: [0, yd - 40, (zfB + zDB + 8) / 2], material: "fiber" },
+ { id: "DB", name: "Drawer back", size: [2 * xd + 16, 90, 16], pos: [0, yd, zDB] },
+ { id: "DD", name: "Drawer bottom", size: [bw, 3, zfB - zdE], pos: [0, yd - 40, (zfB + zdE) / 2], material: "fiber" },
];
const dk = placeAll(b, dParts);
const sds = [-1, 1] as const;
@@ -448,7 +450,7 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
stage: { DF: [[0, 0, 0], [0, 0, -160]], DB: [[0, -320, 0], [0, 0, -160]] },
fix: [
...sds.map((sx) => ({ def: CAM_BOLT, on: "DF", at: [[sx * xd, yd, zfB]] as Vec3[], dir: [0, 0, 1] as Vec3, mate: dside(sx) })),
- ...sds.map((sx) => ({ def: CAM_BOLT, on: "DB", at: [[sx * (bw / 2), yd, zDB]] as Vec3[], dir: [-sx, 0, 0] as Vec3, mate: dside(sx) })),
+ ...sds.map((sx) => ({ def: CAM_BOLT, on: "DB", at: [[sx * xd, yd, zdE]] as Vec3[], dir: [0, 0, -1] as Vec3, mate: dside(sx) })),
],
},
{ title: "Tap the stop wire into the back", detail: "Into the two holes in the middle of its top edge, until it sits flat.", kind: "general", tools: ["hammer"], fix: [{ def: STOP, on: "DB", at: [[0, yd + 45, zDB]], dir: [0, -1, 0], hole: false }] },
@@ -457,17 +459,17 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
detail: "Two at each end of both sides, grooves facing in.",
kind: "dowels",
tools: ["hammer"],
- stage: { DSL: [[-260, 0, 0], [0, 160, 0]], DSR: [[260, 0, 0], [0, 160, 0]] },
+ stage: { DSL: [[-260, 0, 0], [0, 0, -160]], DSR: [[260, 0, 0], [0, 0, -160]] },
fix: sds.flatMap((sx) => [
- { def: DOWEL, on: dside(sx), at: [yd - 25, yd + 25].map((y) => [sx * xd, y, zfB] as Vec3), dir: [0, 0, 1] as Vec3, mate: "DF" },
- { def: DOWEL, on: dside(sx), at: [yd - 25, yd + 25].map((y) => [sx * (xd - 8), y, zDB] as Vec3), dir: [-sx, 0, 0] as Vec3, mate: "DB" },
+ { def: DOWEL, on: dside(sx), at: [yd - 25, yd + 25].map((y) => [sx * xd, y, zfB] as Vec3), dir: [0, 0, -1] as Vec3, mate: "DF" },
+ { def: DOWEL, on: dside(sx), at: [yd - 25, yd + 25].map((y) => [sx * xd, y, zdE] as Vec3), dir: [0, 0, 1] as Vec3, mate: "DB" },
]),
},
- { title: "Push the sides onto the front", detail: "Onto its dowels and bolts, grooves facing in and down.", kind: "join", stage: { DSL: [[0, 0, 0], [-200, 0, 0]], DSR: [[0, 0, 0], [200, 0, 0]] } },
+ { title: "Push the sides onto the front", detail: "Stand them down onto its dowels and bolts, grooves facing in.", kind: "join", stage: { DSL: [[0, 0, 0], [0, 0, -200]], DSR: [[0, 0, 0], [0, 0, -200]] } },
{ title: "Lock the front with two cam locks", detail: "One in each side, near the front.", kind: "cams", tools: ["screwdriver"], fix: [{ def: CAM, on: "DSL", at: [[-xd - 8, yd, zfB - 25]], dir: [1, 0, 0] }, { def: CAM, on: "DSR", at: [[xd + 8, yd, zfB - 25]], dir: [-1, 0, 0] }] },
{ title: "Slide the bottom into the grooves", detail: "Smooth side up, all the way to the front.", kind: "drawer", stage: { DD: [[0, 0, 0], [0, 0, -420]] } },
- { title: "Fit the back", detail: "Down between the sides onto its dowels, over the end of the bottom.", kind: "join", stage: { DB: [[0, 0, 0], [0, 0, -300]] } },
- { title: "Lock the back with two cam locks", detail: "One in each side, at the back.", kind: "cams", tools: ["screwdriver"], fix: [{ def: CAM, on: "DSL", at: [[-xd - 8, yd, zDB]], dir: [1, 0, 0] }, { def: CAM, on: "DSR", at: [[xd + 8, yd, zDB]], dir: [-1, 0, 0] }] },
+ { title: "Fit the back", detail: "Lower it onto the ends of the sides, over the end of the bottom, onto its dowels.", kind: "join", stage: { DB: [[0, 0, 0], [0, 0, -300]] } },
+ { title: "Lock the back with two cam locks", detail: "One in each side, at the back.", kind: "cams", tools: ["screwdriver"], fix: [{ def: CAM, on: "DSL", at: [[-xd - 8, yd, zdE + 25]], dir: [1, 0, 0] }, { def: CAM, on: "DSR", at: [[xd + 8, yd, zdE + 25]], dir: [-1, 0, 0] }] },
{
title: "Screw the runner parts onto the drawer",
detail: "One along the bottom of each side, two screws each.",
@@ -483,17 +485,19 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
const zbF = D / 2 - 20;
const bl = D - 90;
const zb = zbF - bl / 2;
- const zXB = zb - bl / 2 + 9;
+ // the back lies over the ends of the sides, joined along the depth like the front
+ const zE = zb - bl / 2;
+ const zXB = zE - T / 2;
const iw = 2 * (xb - 9);
- const zc = [zbF - 20, zXB + 9 + 20];
+ const zc = [zbF - 20, zE + 38];
const bParts: SubPart[] = [
{ id: "XF", name: "Box front", size: [2 * xi - 4, 335, T], pos: [0, 197.5, D / 2 - 11] },
{ id: "XSL", name: "Box side", size: [T, 330, bl], pos: [-xb, 185, zb] },
{ id: "XSR", name: "Box side", size: [T, 330, bl], pos: [xb, 185, zb] },
- { id: "XD", name: "Box bottom", size: [iw, 3, zbF - zXB - 9], pos: [0, 52, (zbF + zXB + 9) / 2], material: "fiber" },
+ { id: "XD", name: "Box bottom", size: [iw, 3, zbF - zE], pos: [0, 52, (zbF + zE) / 2], material: "fiber" },
{ id: "XC0", name: "Castor batten", size: [iw, 30, 40], pos: [0, 35, zc[0]] },
{ id: "XC1", name: "Castor batten", size: [iw, 30, 40], pos: [0, 35, zc[1]] },
- { id: "XB", name: "Box back", size: [iw, 300, T], pos: [0, 200, zXB] },
+ { id: "XB", name: "Box back", size: [2 * xb + T, 300, T], pos: [0, 200, zXB] },
];
const bk = placeAll(b, bParts);
const bside = (sx: number) => (sx < 0 ? "XSL" : "XSR");
@@ -512,13 +516,13 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
detail: "Two at each end of both sides.",
kind: "dowels",
tools: ["hammer"],
- stage: { XSL: [[-260, 0, 0], [0, 160, 0]], XSR: [[260, 0, 0], [0, 160, 0]] },
+ stage: { XSL: [[-260, 0, 0], [0, 0, -160]], XSR: [[260, 0, 0], [0, 0, -160]] },
fix: sds.flatMap((sx) => [
- { def: DOWEL, on: bside(sx), at: [70, 320].map((y) => [sx * xb, y, zbF] as Vec3), dir: [0, 0, 1] as Vec3, mate: "XF" },
- { def: DOWEL, on: bside(sx), at: [160, 240].map((y) => [sx * (xb - 9), y, zXB] as Vec3), dir: [-sx, 0, 0] as Vec3, mate: "XB" },
+ { def: DOWEL, on: bside(sx), at: [70, 320].map((y) => [sx * xb, y, zbF] as Vec3), dir: [0, 0, -1] as Vec3, mate: "XF" },
+ { def: DOWEL, on: bside(sx), at: [160, 240].map((y) => [sx * xb, y, zE] as Vec3), dir: [0, 0, 1] as Vec3, mate: "XB" },
]),
},
- { title: "Push the sides onto the front", detail: "Grooves facing in, onto the dowels and bolts.", kind: "join", stage: { XSL: [[0, 0, 0], [-200, 0, 0]], XSR: [[0, 0, 0], [200, 0, 0]] } },
+ { title: "Push the sides onto the front", detail: "Stand them down onto the dowels and bolts, grooves facing in.", kind: "join", stage: { XSL: [[0, 0, 0], [0, 0, -200]], XSR: [[0, 0, 0], [0, 0, -200]] } },
{ title: "Lock them with four cam locks", detail: "Two in each side, near the front.", kind: "cams", tools: ["screwdriver"], fix: sds.map((sx) => ({ def: CAM, on: bside(sx), at: [120, 280].map((y) => [sx * (xb + 9), y, zbF - 25] as Vec3), dir: [-sx, 0, 0] as Vec3 })) },
{ title: "Slide the bottom into the grooves", detail: "Smooth side in, down to the front.", kind: "drawer", stage: { XD: [[0, 0, 0], [0, 0, -420]] } },
{
@@ -547,13 +551,13 @@ function storageBench(b: PlanBuilder, s: ProductSpec) {
detail: "Two in each end, by hand.",
kind: "cams",
stage: { XB: [[0, -420, 0], [0, 0, -160]] },
- fix: sds.map((sx) => ({ def: CAM_BOLT, on: "XB", at: [100, 300].map((y) => [sx * (iw / 2), y, zXB] as Vec3), dir: [-sx, 0, 0] as Vec3 })),
+ fix: sds.map((sx) => ({ def: CAM_BOLT, on: "XB", at: [100, 300].map((y) => [sx * xb, y, zE] as Vec3), dir: [0, 0, -1] as Vec3 })),
},
{ title: "Tap the stop wire into the back", detail: "Into the holes in the middle of its top edge.", kind: "general", tools: ["hammer"], fix: [{ def: STOP, on: "XB", at: [[0, 350, zXB]], dir: [0, -1, 0], hole: false }] },
- { title: "Press the back on", detail: "Between the sides, onto the dowels, its edge over the bottom.", kind: "join", stage: { XB: [[0, 0, 0], [0, 0, -300]] } },
- { title: "Lock the back with four cam locks", detail: "Two in each side, at the back.", kind: "cams", tools: ["screwdriver"], fix: sds.map((sx) => ({ def: CAM, on: bside(sx), at: [100, 300].map((y) => [sx * (xb + 9), y, zXB] as Vec3), dir: [-sx, 0, 0] as Vec3 })) },
+ { title: "Press the back on", detail: "Lower it onto the ends of the sides, onto the dowels, its edge over the bottom.", kind: "join", stage: { XB: [[0, 0, 0], [0, 0, -300]] } },
+ { title: "Lock the back with four cam locks", detail: "Two in each side, at the back.", kind: "cams", tools: ["screwdriver"], fix: sds.map((sx) => ({ def: CAM, on: bside(sx), at: [100, 300].map((y) => [sx * (xb + 9), y, zE + 25] as Vec3), dir: [-sx, 0, 0] as Vec3 })) },
{ title: "Press the bumpers into the top edges", detail: "Two along the top of each side.", kind: "general", fix: sds.map((sx) => ({ def: { kind: "glide", len: 6, dia: 12, name: "Bumper" } as HwDef, on: bside(sx), at: [-60, 120].map((z) => [sx * xb, 350, z] as Vec3), dir: [0, -1, 0] as Vec3, hole: false })) },
- { title: "Fit the pivots", detail: "One low on the outside of each side, at the back. They let the box tip out.", kind: "hinges", tools: ["screwdriver"], fix: sds.map((sx) => ({ def: { kind: "hinge", len: 30, dia: 24, name: "Pivot" } as HwDef, on: bside(sx), at: [[sx * (xb + 9), 70, zXB + 30]], dir: [-sx, 0, 0] as Vec3 })) },
+ { title: "Fit the pivots", detail: "One low on the outside of each side, at the back. They let the box tip out.", kind: "hinges", tools: ["screwdriver"], fix: sds.map((sx) => ({ def: { kind: "hinge", len: 30, dia: 24, name: "Pivot" } as HwDef, on: bside(sx), at: [[sx * (xb + 9), 70, zE + 30]], dir: [-sx, 0, 0] as Vec3 })) },
]);
pushIn(b, bk, "Roll the box in", "Tip it slightly so the pivots find their place, then roll it in under the drawer.");
return true;
diff --git a/src/lib/plan/families/karskar.ts b/src/lib/plan/families/karskar.ts
index a2426b2..6e89a36 100644
--- a/src/lib/plan/families/karskar.ts
+++ b/src/lib/plan/families/karskar.ts
@@ -206,10 +206,13 @@ function table(s: ProductSpec) {
{
title: "Tap the small dowels into the frame rails",
detail: "Two in each end of the long rails, one in each end of the cross rails. Use the small ones here.",
- add: [...longRails, ...cross],
+ add: ["AS0"],
fix: [...longRails.map(endDowels), ...cross.map(crossDowels)],
pose: "-y",
warnings: ["floor"],
+ // the cross rails and the other long rail take their fittings beside the build and come in along them
+ wait: ["AS1", ...cross],
+ from: { AS0: [0, 0, -300], AS1: [0, 0, 400], X0: [0, 0, 300], X1: [0, 0, 300] },
},
{ title: "Screw the cam bolts into the long rails", detail: "Two in the inside face of each long rail, where the cross rails meet it.", fix: longRails.map(camBolts) },
{
@@ -217,7 +220,7 @@ function table(s: ProductSpec) {
detail: "Two on each rail, one small screw each.",
fix: [
...longRails.map((id, i): CustomFix => ({ kind: "clip", name: "Slide guide", count: 2, at: guideAt(i), dir: [0, -1, 0], on: id })),
- { kind: "screw", count: 4, len: 12, dia: 3.5, at: [0, 1].flatMap((i) => guideAt(i).map((p) => [p[0], p[1] + 3, p[2]] as Vec3)), dir: [0, -1, 0] },
+ ...longRails.map((id, i): CustomFix => ({ kind: "screw", count: 2, len: 12, dia: 3.5, at: guideAt(i).map((p) => [p[0], p[1] + 3, p[2]] as Vec3), dir: [0, -1, 0], on: id })),
],
tools: ["screwdriver"],
},
@@ -226,17 +229,22 @@ function table(s: ProductSpec) {
detail: "One at each end, two screws each into the long rail.",
fix: [
...[-1, 1].map((sz): CustomFix => ({ kind: "angle", name: "Corner bracket", count: 2, at: bracketAt.filter((p) => Math.sign(p[2]) === sz), dir: [0, 0, sz], on: side(sz) })),
- { kind: "screw", count: 8, len: 16, dia: 4, at: bracketAt.flatMap((p) => [-1, 1].map((d) => [p[0] - Math.sign(p[0]) * 20, p[1] + d * 18, Math.sign(p[2]) * zIn] as Vec3)), dir: [0, 0, 1] },
+ ...[-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 4, len: 16, dia: 4, at: bracketAt.filter((p) => Math.sign(p[2]) === sz).flatMap((p) => [-1, 1].map((d) => [p[0] - Math.sign(p[0]) * 20, p[1] + d * 18, sz * zIn] as Vec3)), dir: [0, 0, sz], on: side(sz) })),
],
tools: ["screwdriver"],
},
- { title: "Push the cross rails between the long rails", detail: "Onto the dowels and cam bolts, from both sides at once." },
+ {
+ title: "Push the cross rails between the long rails",
+ detail: "Onto the dowels and cam bolts of one long rail, then press the other long rail onto their free ends.",
+ add: [...cross, "AS1"],
+ from: { AS1: [0, 0, 400], X0: [0, 0, 300], X1: [0, 0, 300] },
+ },
{ title: "Lock the cams", detail: "Four cams in the cross rails, turned clockwise until they grip the bolts.", fix: [{ kind: "cam", count: 4, to: cross }], tools: ["screwdriver"] },
{ title: "Push the end rails on", detail: "Onto the dowels at both ends of the frame.", add: ends },
{
title: "Screw the end rails to the corner brackets",
detail: "Two screws through each bracket into the end rail.",
- fix: [{ kind: "screw", count: 8, len: 16, dia: 4, at: bracketAt.flatMap((p) => [-1, 1].map((d) => [Math.sign(p[0]) * (xf - AT), p[1] + d * 18, p[2] - Math.sign(p[2]) * 20] as Vec3)), dir: [1, 0, 0] }],
+ fix: [-1, 1].map((sx): CustomFix => ({ kind: "screw", count: 4, len: 16, dia: 4, at: bracketAt.filter((p) => Math.sign(p[0]) === sx).flatMap((p) => [-1, 1].map((d) => [sx * (xf - AT), p[1] + d * 18, p[2] - Math.sign(p[2]) * 20] as Vec3)), dir: [sx, 0, 0] })),
tools: ["screwdriver"],
},
{ title: "Lay the top halves face down and lock them", detail: "On a rug, the two halves edge to edge. Press both latches underneath closed.", add: ["T0", "T1", "LF"], warnings: ["floor"] },
@@ -291,6 +299,8 @@ function table(s: ProductSpec) {
add: ["E1"],
fix: [{ kind: "dowel", count: 2, len: 40, dia: 10, to: ["E1"] }, { kind: "camScrew", count: 2, to: ["E1"] }],
people: 2,
+ // it meets the leg along its length and the long stretcher across it, so it goes on at an angle onto both
+ from: { E1: [250, 0, 250] },
},
{ title: "Bolt on the last leg", detail: "Press it onto the stretcher, then the rods through the bracket, washers and nuts.", add: ["L11"], fix: [{ kind: "dowel", count: 1, len: 40, dia: 10, to: ["L11"] }, { kind: "camScrew", count: 1, to: ["L11"] }, ...legFix(3)], tools: ["wrench"], people: 2 },
{ title: "Lock the stretcher cams", detail: "Six cams, turned clockwise until they grip.", fix: [{ kind: "cam", count: 6, to: ["E0", "E1", "M"] }], tools: ["screwdriver"] },
diff --git a/src/lib/plan/families/kattunge.ts b/src/lib/plan/families/kattunge.ts
index 5d1da3d..9e522b1 100644
--- a/src/lib/plan/families/kattunge.ts
+++ b/src/lib/plan/families/kattunge.ts
@@ -60,7 +60,9 @@ function cot(s: ProductSpec): CustomParams {
];
const ends = [-1, 1] as const;
const studs = ends.flatMap((g) => [-1, 1].flatMap((h) => [yLow, yTop].map((y): Vec3 => [g * (L / 2), y, h * ze])));
- const brackets = ends.flatMap((g) => [-1, 1].map((h): Vec3 => [g * xi, yBase - 30, h * 250]));
+ // on the second and eighth bars, which run up to the top rail
+ const brackets = ends.flatMap((g) => [-1, 1].map((h): Vec3 => [g * xi, yBase - 20, h * 212]));
+ const bracketBolts = brackets.map(([x, y, z]): Vec3 => [Math.sign(x) * (xe - 14), y - 26, z]);
return {
parts,
steps: [
@@ -76,7 +78,7 @@ function cot(s: ProductSpec): CustomParams {
detail: "Use the top holes for a newborn. The two kinds of bracket each go where the manual's numbers show, with one bolt each.",
fix: ends.flatMap((g) => [
fix("angle", brackets.filter((p) => Math.sign(p[0]) === g), [-g, 0, 0], { name: "Base bracket", len: 40, dia: 30, on: g < 0 ? "E0" : "E1" }),
- fix("bolt", brackets.filter((p) => Math.sign(p[0]) === g), [-g, 0, 0], { len: 12, dia: 6, on: g < 0 ? "E0" : "E1" }),
+ fix("bolt", bracketBolts.filter((p) => Math.sign(p[0]) === g), [g, 0, 0], { len: 12, dia: 6, on: g < 0 ? "E0" : "E1" }),
]),
tools: ["allen"],
},
diff --git a/src/lib/plan/families/kilberget.ts b/src/lib/plan/families/kilberget.ts
index a0ea243..fe47569 100644
--- a/src/lib/plan/families/kilberget.ts
+++ b/src/lib/plan/families/kilberget.ts
@@ -134,16 +134,17 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
const fr = Math.ceil(per.dowel / 2), bk = per.dowel - fr;
const dowels = [...spread(Y0 + 60, yT - 60, fr).map((y): Vec3 => [sx * xL, y, zL - LEG / 2]), ...spread(Y0 + 100, yT - 100, bk).map((y): Vec3 => [sx * xL, y, -(zL - LEG / 2)])];
const nb = per.bolt;
- const boltYs = nb === 1 ? [yT - 40] : spread(Y0 + 40, yT - 40, nb);
+ const boltYs = nb === 1 ? [yT - 90] : spread(Y0 + 40, yT - 90, nb); // clear of the dowels and the top rail's cam bolt
const bolts = boltYs.map((y, k): Vec3 => [sx * xL, y, (k % 2 ? -1 : 1) * (zL - LEG / 2)]);
const cams = bolts.map((p): Vec3 => [sx * xi, p[1], p[2] - Math.sign(p[2]) * 30]);
const screws = range(per.screw).map((k): Vec3 => [sx * xL, k === 2 ? (Y0 + yT) / 2 : k % 2 ? Y0 + 40 : yT - 60, (k % 2 ? -1 : 1) * (zL + LEG / 2)]);
return { dowels, bolts, cams, screws };
};
const runnerRows = rows.map((r) => r.y0 + 40);
- const runnerFits = (x: number, inward: number) => ({
+ const runnerFits = (x: number, inward: number, ts = [-0.4, 0.1, 0.4]) => ({
runners: runnerRows.map((y): Vec3 => [x, y, zb1 - (ddp - 20) / 2]),
- screws: runnerRows.flatMap((y) => [-0.4, 0, 0.4].map((t): Vec3 => [x, y, zb1 - (ddp - 20) / 2 + t * (ddp - 20)])),
+ // through the runner into the panel, beside the runner's middle
+ screws: runnerRows.flatMap((y) => ts.map((t): Vec3 => [x + inward * 2, y, zb1 - (ddp - 20) / 2 + t * (ddp - 20)])),
dir: [inward, 0, 0] as Vec3,
});
const runnerLen = Math.round((ddp - 20) / 10) * 10;
@@ -174,7 +175,9 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
plugs: sideX.flatMap((x) => ys.map((y): Vec3 => [x + Math.sign(x - bxc) * 6, y, zb1 - ddp + 6])),
camsB: sideX.flatMap((x) => ys.map((y): Vec3 => [x - Math.sign(x - bxc) * 6, y, zb1 - ddp + 40])),
wire: [[bxc, yb + 10, zb1 - ddp + 14]] as Vec3[],
- runner: sideX.flatMap((x) => [-0.35, 0, 0.35].map((t): Vec3 => [x + Math.sign(x - bxc) * 6, yb + 22, zb1 - ddp / 2 + t * ddp])),
+ // low on the outside of each side, going in
+ runnerL: [-0.35, 0, 0.35].map((t): Vec3 => [sideX[0] - 6, yb + 8, zb1 - ddp / 2 + t * ddp]),
+ runnerR: [-0.35, 0, 0.35].map((t): Vec3 => [sideX[1] + 6, yb + 8, zb1 - ddp / 2 + t * ddp]),
knobs: knobPts(d),
};
};
@@ -185,7 +188,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
const R0 = runnerFits(-xi, 1), R1 = runnerFits(xi, -1);
const runner = (r: ReturnType<typeof runnerFits>): CustomFix[] => [
fx("runner", r.runners, r.dir, { len: runnerLen, dia: 20 }),
- fx("screw", r.screws, r.dir, { len: 12, dia: 4 }),
+ fx("screw", r.screws, [-r.dir[0], 0, 0], { len: 12, dia: 4 }),
];
const glides = (ids: string[]) => ids.map((id) => {
const p = parts.find((q) => q.id === id)!.pos;
@@ -208,7 +211,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
tools: ["screwdriver"],
},
{ title: `Push the legs onto ${sideTitle}`, detail: "A front and a back leg on each panel, the holes lined up. Mind which way round the legs go.", add: [...legsOf(0), "S0", ...legsOf(1), "S1"] },
- { title: "Lock the legs with cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", fix: [fx("cam", S0.cams, [1, 0, 0], { on: "S0" }), fx("cam", S1.cams, [-1, 0, 0], { on: "S1" }), ...(six ? [fx("cam", [-1, 1].flatMap((sx) => [yT - 25, Y0 + 20, yT - 25].map((y, k): Vec3 => [sx * xL, y, k === 2 ? -zL : zL])), [0, 0, 1])] : [])], tools: ["screwdriver"] },
+ { title: "Lock the legs with cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", fix: [fx("cam", S0.cams, [1, 0, 0], { on: "S0" }), fx("cam", S1.cams, [-1, 0, 0], { on: "S1" }), ...(six ? [fx("cam", [-1, 1].flatMap((sx) => byId(["TF", "BF", "TK"]).map((p): Vec3 => [sx * (Wc / 2 + 24), p.y - p.h / 2 + 6, p.z])), [0, 0, 1])] : [])], tools: ["screwdriver"] },
);
if (per.screw)
steps.push({
@@ -224,7 +227,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
tools: ["screwdriver"],
});
if (six)
- steps.push({ title: "Screw the cam bolts into the rails", detail: "Into the ends of the long rails that meet the legs.", fix: [fx("camScrew", [-1, 1].flatMap((sx) => byId(["TF", "BF", "TK"]).map((p): Vec3 => [sx * (Wc / 2), p.y, p.z])).slice(0, 6), [1, 0, 0], { to: ["TF", "BF", "TK", "BK"] })], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the cam bolts into the rails", detail: "Into the ends of the long rails that meet the legs.", fix: [-1, 1].flatMap((sx) => byId(["TF", "BF", "TK"]).map((p) => fx("camScrew", [[sx * (Wc / 2), p.y - p.h / 2 + 6, p.z]], [-sx, 0, 0], { on: p.id }))), tools: ["screwdriver"] });
const crossBolts = six ? 2 : pieces.length;
steps.push(
{
@@ -292,7 +295,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
},
);
} else {
- const mpR0 = runnerFits(-PT / 2, -1), mpR1 = runnerFits(PT / 2, 1);
+ const mpR0 = runnerFits(-PT / 2, -1), mpR1 = runnerFits(PT / 2, 1, [-0.3, 0.2, 0.3]); // clear of the screws on the other face
steps.push(
{ title: "Tap the dowels into the middle panel", detail: "Two in each end, for the rails.", fix: [fx("dowel", [-1, 1].flatMap((sz) => [Y0 + 70, yT - 70].map((y): Vec3 => [0, y, sz * (zL - LEG / 2)])), [0, 0, 1], { on: "MP" })], tools: ["hammer"] },
{ title: "Screw the runners onto the middle panel", detail: "Both faces, one for each drawer, three screws each.", fix: [...runner(mpR0), ...runner(mpR1)], tools: ["screwdriver"] },
@@ -300,7 +303,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
title: "Push the middle panel onto the front rails",
detail: "Lay the two front rails on the rug, dowels in their ends, and push the middle panel onto them. The chest is built lying on its front.",
add: ["TF", "BF", "MP"],
- fix: [fx("dowel", [-1, 1].flatMap((sx) => byId(["TF", "BF"]).map((p): Vec3 => [sx * (Wc / 2), p.y, p.z])), [1, 0, 0], { len: 30, dia: 8 })],
+ fix: [-1, 1].flatMap((sx) => byId(["TF", "BF"]).map((p) => fx("dowel", [[sx * (Wc / 2), p.y + p.h / 2 - 6, p.z]], [-sx, 0, 0], { on: p.id, len: 30, dia: 8 }))),
pose: "-z",
warnings: ["floor"],
},
@@ -308,7 +311,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
title: "Push the back rails onto the middle panel",
detail: "Dowels in their ends too.",
add: ["TK", "BK"],
- fix: [fx("dowel", [-1, 1].flatMap((sx) => byId(["TK", "BK"]).map((p): Vec3 => [sx * (Wc / 2), p.y, p.z])), [1, 0, 0], { len: 30, dia: 8 })],
+ fix: [-1, 1].flatMap((sx) => byId(["TK", "BK"]).map((p) => fx("dowel", [[sx * (Wc / 2), p.y + p.h / 2 - 6, p.z]], [-sx, 0, 0], { on: p.id, len: 30, dia: 8 }))),
},
{
title: "Screw the middle legs in",
@@ -382,7 +385,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
steps.push(
{ title: "Screw the cam bolts into a drawer front", detail: "Lay it face down on the rug. Into the holes along its ends.", fix: [fx("camScrew", f0.bolts, [0, 0, 1], { on: `DF${d0.k}` })], tools: ["screwdriver"] },
{ title: "Tap two dowels in", detail: "One near the bottom of each end.", fix: [fx("dowel", f0.dowels, [0, 0, 1], { on: `DF${d0.k}`, len: 30, dia: 8 })], tools: ["hammer"] },
- { title: "Push the sides onto the front", detail: "Grooves facing in and down.", add: [`DF${d0.k}`, `DS${d0.k}0`, `DS${d0.k}1`] },
+ { title: "Push the sides onto the front", detail: "Grooves facing in and down.", add: [`DF${d0.k}`, `DS${d0.k}0`, `DS${d0.k}1`], from: { [`DS${d0.k}0`]: [0, 0, -260], [`DS${d0.k}1`]: [0, 0, -260] } },
{ title: "Lock the sides with cam locks", fix: [fx("cam", f0.camsF, [0, 1, 0])], tools: ["screwdriver"] },
{ title: "Slide the bottom in", detail: "Along the grooves, smooth side up.", add: [`DT${d0.k}`] },
{ title: "Knock the stiffening wire in", detail: "Into the slot in the bottom edge of the back, hooked end first. Tap it with the hammer until it sits flush.", fix: [fx("nail", f0.wire, [0, 1, 0], { name: "Stiffening wire", len: 40, dia: 3, on: `DB${d0.k}` })], tools: ["hammer"] },
@@ -393,26 +396,29 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
fix: [fx("pin", f0.plugs, [1, 0, 0], { name: "Plastic dowel", len: 30, dia: 8 }), fx("cam", f0.camsB, [0, 1, 0])],
tools: ["screwdriver"],
},
- { title: "Screw the runners onto the drawer", detail: "Three screws each side, the wheel end at the back.", fix: [fx("screw", f0.runner, [1, 0, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Screw the runners onto the drawer", detail: "Three screws each side, the wheel end at the back.", fix: [fx("screw", f0.runnerL, [1, 0, 0], { len: 12, dia: 4 }), fx("screw", f0.runnerR, [-1, 0, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] },
{
title: knobsPer === 1 ? "Screw the knob on" : "Screw the knobs on",
detail: "The screw goes through the front from inside. Snug is enough.",
- fix: [fx("knob", f0.knobs, [0, 0, -1], { on: `DF${d0.k}` }), fx("screw", f0.knobs.map((p): Vec3 => [p[0], p[1], zb1]), [0, 0, 1], { len: 30, dia: 4 })],
+ fix: [fx("knob", f0.knobs, [0, 0, -1], { on: `DF${d0.k}` }), fx("screw", f0.knobs.map((p): Vec3 => [p[0], p[1], zb1 - 5]), [0, 0, 1], { len: 30, dia: 4 })],
tools: ["screwdriver"],
},
{
title: `Build the other ${rest.length} drawers the same way`,
detail: "Bolts and dowels in the front, sides and cams, the bottom, the wire, the back, runners and knobs.",
add: rest.flatMap(drawerParts),
+ // each front and its sides meet along the bolts and dowels, front to back
+ from: Object.fromEntries(rest.flatMap((d) => [[`DF${d.k}`, [0, 0, 300] as Vec3], [`DS${d.k}0`, [0, 0, -300] as Vec3], [`DS${d.k}1`, [0, 0, -300] as Vec3]])),
fix: [
fx("camScrew", cat("bolts"), [0, 0, 1]),
fx("dowel", cat("dowels"), [0, 0, 1], { len: 30, dia: 8 }),
fx("cam", [...cat("camsF"), ...cat("camsB")], [0, 1, 0]),
fx("nail", cat("wire"), [0, 1, 0], { name: "Stiffening wire", len: 40, dia: 3 }),
fx("pin", cat("plugs"), [1, 0, 0], { name: "Plastic dowel", len: 30, dia: 8 }),
- fx("screw", cat("runner"), [1, 0, 0], { len: 12, dia: 4 }),
+ fx("screw", cat("runnerL"), [1, 0, 0], { len: 12, dia: 4 }),
+ fx("screw", cat("runnerR"), [-1, 0, 0], { len: 12, dia: 4 }),
fx("knob", cat("knobs"), [0, 0, -1]),
- fx("screw", cat("knobs").map((p): Vec3 => [p[0], p[1], zb1]), [0, 0, 1], { len: 30, dia: 4 }),
+ fx("screw", cat("knobs").map((p): Vec3 => [p[0], p[1], zb1 - 5]), [0, 0, 1], { len: 30, dia: 4 }),
],
tools: ["screwdriver", "hammer"],
},
diff --git a/src/lib/plan/families/kjellarne.ts b/src/lib/plan/families/kjellarne.ts
index f5a110f..32690c5 100644
--- a/src/lib/plan/families/kjellarne.ts
+++ b/src/lib/plan/families/kjellarne.ts
@@ -153,7 +153,7 @@ function desk(s: ProductSpec): CustomParams {
feet("CL", [cx0 + 60, cx1 - 60].map((x): Vec3 => [x, 0, cz0 + t / 2])),
feet("CR", [cx0 + 60, cx1 - 60].map((x): Vec3 => [x, 0, cz1 - t / 2])),
...[-1, 1].map((g) => F("runner", [[cMid - 10, 640, cFace(g)]], [0, 0, g], { on: cSide(g), len: 440, dia: 20, twist: Math.PI / 2, name: "Cabinet runner" })),
- ...[-1, 1].map((g) => F("screw", [cMid - 190, cMid + 170].map((x): Vec3 => [x, 640, cFace(g)]), [0, 0, -g], { on: cSide(g), ...SCREW })),
+ ...[-1, 1].map((g) => F("screw", [cMid - 190, cMid + 170].map((x): Vec3 => [x, 640, cFace(g) - g * 2]), [0, 0, g], { on: cSide(g), ...SCREW })), // through the runner into the side
...[-1, 1].map((g) => F("camScrew", cCamBolts(g), [0, 0, -g], { on: cSide(g), len: 11 })),
],
pose: "+y",
@@ -210,7 +210,6 @@ function desk(s: ProductSpec): CustomParams {
F("camScrew", [[cx0 + 116, 665, g < 0 ? cz0 + 36 : cz1 - 36]], [0, 0, -g], { on: "DK", mate: g < 0 ? "DS0" : "DS1", len: 11 }),
F("dowel", [[cx0 + 116, 615, g < 0 ? cz0 + 36 : cz1 - 36]], [0, 0, -g], { on: "DK", mate: g < 0 ? "DS0" : "DS1" }),
]),
- wait: ["DK"],
},
{
title: "Join the drawer sides to the back",
diff --git a/src/lib/plan/families/klackenas.ts b/src/lib/plan/families/klackenas.ts
index c445416..1ccf37d 100644
--- a/src/lib/plan/families/klackenas.ts
+++ b/src/lib/plan/families/klackenas.ts
@@ -64,10 +64,12 @@ function recipe(s: ProductSpec): CustomParams {
const divLocks = (top: boolean) =>
fx("cam", zz.map((z, i): Vec3 => [i ? t / 2 : -t / 2, top ? yT - t / 2 - 34 : yB + t / 2 + 34, z]), [1, 0, 0], "DV", { dia: 15, name: "Spring cam lock" });
// plinth: angle brackets on the inside of the rails and ends, under the cabinet's bottom
- const brackets: Vec3[] = [
- ...[-400, 0, 400].map((x): Vec3 => [x, ph - 10, pz0 - t - 12]),
- ...[-400, 0, 400].map((x): Vec3 => [x, ph - 10, pz1 + t + 12]),
- ...[-1, 1].map((sx): Vec3 => [sx * (px - t / 2 - 12), ph - 10, (pz0 + pz1) / 2]),
+ // each against a piece's inside face: its points, the way its screws go in, and the piece
+ const brackets: { at: Vec3[]; dir: Vec3; on: string }[] = [
+ { at: [-400, 0, 400].map((x): Vec3 => [x, ph - 10, pz0 - t - 3]), dir: [0, 0, 1], on: "PF" },
+ { at: [-400, 0, 400].map((x): Vec3 => [x, ph - 10, pz1 + t + 3]), dir: [0, 0, -1], on: "PB" },
+ { at: [[-(px - t / 2 - 3), ph - 10, (pz0 + pz1) / 2]], dir: [-1, 0, 0], on: "PE1" },
+ { at: [[px - t / 2 - 3, ph - 10, (pz0 + pz1) / 2]], dir: [1, 0, 0], on: "PE2" },
];
const plinth = ["PF", "PB", "PE1", "PE2"];
const backClips: Vec3[] = [
@@ -125,7 +127,10 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Screw the angle brackets into the plinth",
detail: "Eight brackets on the inside, flush with the top edge.",
- fix: [fx("angle", brackets, [0, 0, 1], "PF", { len: 30, dia: 20 }), fx("screw", brackets.map((p): Vec3 => [p[0], p[1] - 15, p[2]]), [0, 0, 1], "PF", { len: 15, dia: 4 })],
+ fix: [
+ ...brackets.map((g) => fx("angle", g.at, g.dir, g.on, { len: 30, dia: 20 })),
+ ...brackets.map((g) => fx("screw", g.at.map((p): Vec3 => [p[0], p[1] - 25, p[2]]), g.dir, g.on, { len: 15, dia: 4 })),
+ ],
},
{
title: "Tap four dowels into the plinth's top edge",
@@ -140,7 +145,7 @@ function recipe(s: ProductSpec): CustomParams {
from: Object.fromEntries(plinth.map((id) => [id, [0, -300, 0]])) as Record<string, Vec3>,
pose: "-y",
},
- { title: "Screw the brackets to the bottom", detail: "Eight screws, one through each bracket.", fix: [fx("screw", brackets, [0, 1, 0], "BT", { len: 15, dia: 4 })] },
+ { title: "Screw the brackets to the bottom", detail: "Eight screws, one through each bracket.", fix: [fx("screw", brackets.flatMap((g) => g.at.map((p): Vec3 => [p[0] - g.dir[0] * 12, ph - 3, p[2] - g.dir[2] * 12])), [0, 1, 0], "BT", { len: 15, dia: 4 })] },
{
title: "Press the wall spacers onto the back",
detail: "Six of them, on the back edges of the sides and the divider, so the back stays clear of the wall.",
diff --git a/src/lib/plan/families/kleppstad.ts b/src/lib/plan/families/kleppstad.ts
index 5c1e003..b4a6d77 100644
--- a/src/lib/plan/families/kleppstad.ts
+++ b/src/lib/plan/families/kleppstad.ts
@@ -14,7 +14,10 @@ import { buildCustom } from "../custom";
* take dowels and door stops, and long Allen screws pull the sides onto them. Two plinth rails slide in at the foot,
* the hardboard back is nailed on, glides go under the sides, and it's stood up and fixed to the wall before the rail
* and the doors go on. The 3-door wardrobe has a divider: two doors over the hanging side, one over three shelves.
- * The wardrobe with sliding doors has its own, quite different manual and keeps its old guide for now.
+ * The wardrobe with sliding doors is built lying on its back: the divider stands on the bottom, a low shelf goes
+ * each side of it, the top and the sides are pulled on with long screws, the plinth and back rail are screwed in, the
+ * back is nailed on with it lying on its front, and once it's up and fixed to the wall the rails and the two sliding
+ * doors (guides on top, wheels underneath) go in.
*/
const put = (b: PlanBuilder, def: HwDef, pts: Vec3[], dir: Vec3, on?: string, gap = 0.08) => b.fits(def, pts.map((at) => ({ at, dir, on, hole: false })), gap);
@@ -48,6 +51,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
{ id: "SL", name: "Slatted bed base (sold separately)", size: [mW, 20, mL], pos: [0, 260, 0], material: "wood", extra: true },
];
const yTop = railY + railH / 2;
+ const sx0 = (sx: number) => (sx < 0 ? "HP-1" : "HP1");
const steps: CustomStep[] = [
{
title: "Unroll the headboard fabric",
@@ -78,30 +82,30 @@ function bed(b: PlanBuilder, s: ProductSpec) {
{
title: "Screw a bolt into each post for the side rails",
detail: "Prop the headboard up on a stack of books first so you can reach under it. The rails hang on these.",
- fix: [at("bolt", [-1, 1].map((sx) => [sx * xS, railY, zH + P / 2] as Vec3), [0, 0, -1], STUD)],
+ fix: [-1, 1].map((sx) => at("bolt", [[sx * xS, railY, zH + P / 2 + 12]], [0, 0, -1], { ...STUD, on: sx0(sx) })),
tools: ["allen"],
pose: "+z",
},
- { title: "Bolt a leg to the footboard bar", detail: "Lay the bar on a rug. A long bolt through the end of the bar into the top of the leg.", add: ["FB", "FL-1"], fix: [at("bolt", [[-xS, 270 - P, zF]], [0, 1, 0], { ...STUD, on: "FL-1" })], tools: ["allen"], pose: "+y" },
- { title: "Bolt on the other footboard leg", detail: "The same on the other end.", add: ["FL1"], fix: [at("bolt", [[xS, 270 - P, zF]], [0, 1, 0], { ...STUD, on: "FL1" })], tools: ["allen"] },
+ { title: "Bolt a leg to the footboard bar", detail: "Lay the bar on a rug. A long bolt through the end of the bar into the top of the leg.", add: ["FB", "FL-1"], fix: [at("bolt", [[-xS, 270, zF]], [0, -1, 0], { ...STUD, on: "FB" })], tools: ["allen"], pose: "+y" },
+ { title: "Bolt on the other footboard leg", detail: "The same on the other end.", add: ["FL1"], fix: [at("bolt", [[xS, 270, zF]], [0, -1, 0], { ...STUD, on: "FB" })], tools: ["allen"] },
{
title: "Bolt a side rail to the footboard",
detail: "Stand the footboard up. Two bolts through the leg into the end of the rail.",
add: ["SR-1"],
- fix: [at("bolt", [railY - 15, railY + 15].map((y) => [-xS, y, zF - P / 2] as Vec3), [0, 0, 1], STUD)],
+ fix: [at("bolt", [railY - 15, railY + 15].map((y) => [-xS, y, zF + P / 2] as Vec3), [0, 0, -1], { ...STUD, on: "FL-1" })],
tools: ["allen"],
},
{
title: "Bolt the other side rail to the footboard",
detail: "The same on the other leg.",
add: ["SR1"],
- fix: [at("bolt", [railY - 15, railY + 15].map((y) => [xS, y, zF - P / 2] as Vec3), [0, 0, 1], STUD)],
+ fix: [at("bolt", [railY - 15, railY + 15].map((y) => [xS, y, zF + P / 2] as Vec3), [0, 0, -1], { ...STUD, on: "FL1" })],
tools: ["allen"],
},
{
title: "Bolt the rails to the headboard",
detail: "One of you holds the headboard up while the other hooks the rails onto the bolts in the posts, then adds two more bolts on each side.",
- fix: [at("bolt", [-1, 1].flatMap((sx) => [railY - 26, railY + 26].map((y) => [sx * xS, y, zH + P / 2] as Vec3)), [0, 0, 1], STUD)],
+ fix: [-1, 1].map((sx) => at("bolt", [railY - 15, railY + 15].map((y) => [sx * xS, y, zH - P / 2] as Vec3), [0, 0, 1], { ...STUD, on: sx0(sx) })),
tools: ["allen"],
people: 2,
warnings: ["two"],
@@ -119,7 +123,7 @@ function bed(b: PlanBuilder, s: ProductSpec) {
{
title: "Screw the centre beam into the frame",
detail: "Its ends sit on the brackets at the head and the foot. Two screws at each end.",
- fix: [-1, 1].map((sz) => at("screw", [-12, 12].map((x) => [x, 220, sz * (L / 2 - P)] as Vec3), [0, 0, sz], { len: 12, dia: 6 })),
+ fix: [-1, 1].map((sz) => at("screw", [-12, 12].map((x) => [x, 220, sz * (L / 2 - P)] as Vec3), [0, 0, -sz], { len: 12, dia: 6, on: "CB" })),
tools: ["allen"],
},
{ title: "Tighten all the bolts", detail: "Go round the four corners with the Allen key now that the frame stands square.", tools: ["allen"], check: "square" },
@@ -259,7 +263,7 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
pose: "-z",
},
{ title: "Tap the dowels into the shelves", detail: "Three in each end of all three shelves, then push them onto the divider.", fix: shelfIds.flatMap((id) => shelfDowels(id, 3)), add: shelfIds, tools: ["hammer"], pose: "-z" },
- { title: "Screw the top onto the divider", detail: "Two Allen screws down through the top into the divider's end.", add: ["TP"], fix: [at("bolt", [-1, 1].map((t) => [divX, H, ZC + t * 150] as Vec3), [0, -1, 0], ALLEN)], tools: ["allen"], pose: "-z" },
+ { title: "Screw the top onto the divider", detail: "Two Allen screws down through the top into the divider's end.", add: ["TP"], fix: [at("bolt", [-1, 1].map((t) => [divX, H, ZC + t * 60] as Vec3), [0, -1, 0], ALLEN)], tools: ["allen"], pose: "-z" },
);
}
steps.push(
@@ -279,7 +283,7 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
);
if (three) {
steps.push(
- { title: "Screw the bottom onto the divider", detail: "Two Allen screws up through the bottom into the divider's end.", add: ["BT"], fix: [at("bolt", [-1, 1].map((t) => [divX, bot, ZC + t * 150] as Vec3), [0, 1, 0], ALLEN)], tools: ["allen"], pose: "-z" },
+ { title: "Screw the bottom onto the divider", detail: "Two Allen screws up through the bottom into the divider's end.", add: ["BT"], fix: [at("bolt", [-1, 1].map((t) => [divX, bot, ZC + t * 60] as Vec3), [0, 1, 0], ALLEN)], tools: ["allen"], pose: "-z" },
{ title: "Screw the right side to the top", detail: "Two Allen screws through the side into the top's end.", fix: [sideScrews(1, yT, zPair)], tools: ["allen"], pose: "-z" },
{ title: "Screw the right side to the bottom", detail: "Two more into the bottom.", fix: [sideScrews(1, yB, zPair)], tools: ["allen"], pose: "-z" },
{ title: "Screw on the left side", detail: "Four Allen screws, two into the top and two into the bottom.", fix: [sideScrews(-1, yT, zPair), sideScrews(-1, yB, zPair)], tools: ["allen"], pose: "-z" },
@@ -446,6 +450,167 @@ function wardrobe(b: PlanBuilder, s: ProductSpec, three: boolean) {
);
}
+
+/* ---------- the wardrobe with sliding doors ---------- */
+
+function sliding(b: PlanBuilder, s: ProductSpec) {
+ const W = 1170, H = 1760, D = 550, PL = 70;
+ const xo = W / 2 - T / 2, xi = W / 2 - T;
+ const yb = PL + T, yt = H - T;
+ const zDoor = [D / 2 - 15, D / 2 - 45]; // front and back door
+ const dd = D - 70; // the divider and shelves stop short of the doors
+ const zc = -D / 2 + dd / 2;
+ const zPF = D / 2 - 30 - T / 2, zPB = -D / 2 + 10 + T / 2;
+ const ys = 420;
+ const hw = (W - 3 * T) / 2;
+ const hx = T / 2 + hw / 2;
+ const dw = (W - 2 * T) / 2 + 20, dh = yt - 20 - (yb + 8);
+ const parts: CustomPart[] = [
+ { id: "BT", name: "Bottom", size: [W - 2 * T, T, D], pos: [0, PL + T / 2, 0] },
+ { id: "DV", name: "Divider", size: [T, yt - yb, dd], pos: [0, (yt + yb) / 2, zc] },
+ { id: "LS", name: "Shelf", size: [hw, T, dd], pos: [-hx, ys + T / 2, zc] },
+ { id: "RS", name: "Shelf", size: [hw, T, dd], pos: [hx, ys + T / 2, zc] },
+ { id: "LT", name: "Lower door track", size: [W - 2 * T, 8, 60], pos: [0, yb + 4, D / 2 - 32], material: "metal" },
+ { id: "TP", name: "Top", size: [W - 2 * T, T, D], pos: [0, H - T / 2, 0] },
+ { id: "UT", name: "Upper door track", size: [W - 2 * T, 20, 60], pos: [0, yt - 10, D / 2 - 32], material: "metal" },
+ { id: "SL", name: "Side", size: [T, H, D], pos: [-xo, H / 2, 0] },
+ { id: "SR", name: "Side", size: [T, H, D], pos: [xo, H / 2, 0] },
+ { id: "PF", name: "Plinth", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zPF] },
+ { id: "PB", name: "Back rail", size: [W - 2 * T, PL, T], pos: [0, PL / 2, zPB] },
+ ...S2.map((sx, i): CustomPart => ({ id: `B${i}`, name: "Back panel", size: [W / 2 - 1, H - PL, 3], pos: [sx * (W / 4), (H + PL) / 2, -D / 2 - 1.5], material: "fiber" })),
+ ...S2.map((sx, i): CustomPart => ({ id: `R${i}`, name: "Clothes rail", size: [hw - 6, 25, 25], pos: [sx * hx, yt - 80, zc], shape: "cyl", material: "metal" })),
+ { id: "DB", name: "Sliding door", size: [dw, dh, T], pos: [-(W / 4 - T / 2 - 10), yb + 8 + dh / 2, zDoor[1]] },
+ { id: "DF", name: "Sliding door", size: [dw, dh, T], pos: [W / 4 - T / 2 - 10, yb + 8 + dh / 2, zDoor[0]] },
+ ];
+ const SCREW = { len: 110, dia: 6, name: "Connecting screw" };
+ const through = (sx: number, list: [number, number][]) => at("bolt", list.map(([y, z]) => [sx * (W / 2), y, z] as Vec3), [-sx, 0, 0], SCREW);
+ const ends = (y: number) => [-150, 150].map((z): [number, number] => [y, z]);
+ const doorPt = (id: string, top: boolean) => {
+ const p = parts.find((x) => x.id === id)!;
+ return [-1, 1].map((g) => [p.pos[0] + g * (dw / 2 - 70), p.pos[1] + ((top ? 1 : -1) * dh) / 2, p.pos[2]] as Vec3);
+ };
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the dowels into the bottom and the shelves",
+ detail: "Lay the panels on a rug. Two in each end and two in the middle of the bottom, three in each shelf.",
+ add: ["BT"],
+ fix: [
+ ...S2.map((sx) => at("dowel", [-180, 180].map((z) => [sx * xi, PL + T / 2, z] as Vec3), [-sx, 0, 0], { ...DOWEL, on: "BT" })),
+ at("dowel", [-150, 100].map((z) => [0, yb, zc + z] as Vec3), [0, -1, 0], { ...DOWEL, on: "BT" }),
+ ...S2.map((sx, i) => at("dowel", [[sx * xi, ys + T / 2, zc - 150], [sx * xi, ys + T / 2, zc + 150]], [-sx, 0, 0], { ...DOWEL, on: i ? "RS" : "LS" })),
+ ...S2.map((sx, i) => at("dowel", [[sx * (T / 2), ys + T / 2, zc]], [sx, 0, 0], { ...DOWEL, on: i ? "RS" : "LS" })),
+ ],
+ wait: ["LS", "RS"],
+ tools: ["hammer"],
+ pose: "+z",
+ warnings: ["floor"],
+ },
+ { title: "Screw two cam bolts into the divider", detail: "In its bottom end.", fix: [at("camScrew", [-60, 190].map((z) => [0, yb, zc + z] as Vec3), [0, 1, 0], { on: "DV" })], wait: ["DV"], tools: ["screwdriver"] },
+ { title: "Stand the divider on the bottom", detail: "Onto the dowels in the middle.", add: ["DV"] },
+ { title: "Lock the divider", detail: "Two cam locks in the bottom.", fix: [at("cam", [-60, 190].map((z) => [34, yb, zc + z] as Vec3), [0, -1, 0], { on: "BT" })], tools: ["screwdriver"] },
+ { title: "Push a shelf onto each side of the divider", detail: "Low down, onto the dowel in the divider.", add: ["LS", "RS"] },
+ { title: "Lock the shelves", detail: "One cam lock in each, next to the divider.", fix: S2.map((sx, i) => at("cam", [[sx * (T / 2 + 34), ys + T, zc - 60]], [0, -1, 0], { on: i ? "RS" : "LS" })), tools: ["screwdriver"] },
+ { title: "Press the lower door track into the bottom", detail: "Along the front, both grooves facing out, all the way along.", add: ["LT"] },
+ { title: "Tap four dowels into the top", detail: "In the middle of its underside, for the divider. Press the upper track into its front edge.", fix: [at("dowel", [-150, -50, 50, 150].map((z) => [0, yt, zc + z] as Vec3), [0, 1, 0], { ...DOWEL, on: "TP" })], wait: ["TP"], tools: ["hammer"] },
+ { title: "Put on the top", detail: "Onto the divider's dowels, track at the front.", add: ["TP", "UT"] },
+ {
+ title: "Screw on the left side",
+ detail: "Onto the dowels of the bottom and the shelf, then four long screws: two into the bottom, two into the top. The handle tool makes it quicker.",
+ add: ["SL"],
+ fix: [through(-1, [...ends(PL + T / 2), ...ends(H - T / 2)])],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw on the right side",
+ detail: "Together. Five long screws: two into the bottom, two into the top and one into the shelf.",
+ add: ["SR"],
+ fix: [through(1, [...ends(PL + T / 2), ...ends(H - T / 2), [ys + T / 2, zc + 60]])],
+ tools: ["screwdriver"],
+ people: 2,
+ },
+ { title: "Tap the dowels into the plinth and the back rail", detail: "Two in the top edge of each.", fix: [at("dowel", [-300, 300].map((x) => [x, PL, zPF] as Vec3), [0, -1, 0], { ...DOWEL, on: "PF" }), at("dowel", [-300, 300].map((x) => [x, PL, zPB] as Vec3), [0, -1, 0], { ...DOWEL, on: "PB" })], wait: ["PF", "PB"], tools: ["hammer"] },
+ { title: "Fit the plinth", detail: "Under the bottom at the front, onto its dowels. Three long screws: one through each side and one down through the bottom.", add: ["PF"], fix: [through(-1, [[PL / 2, zPF]]), through(1, [[PL / 2, zPF]]), at("bolt", [[0, PL + T, zPF]], [0, -1, 0], SCREW)], tools: ["screwdriver"] },
+ { title: "Fit the back rail", detail: "The same at the back: three long screws.", add: ["PB"], fix: [through(-1, [[PL / 2, zPB]]), through(1, [[PL / 2, zPB]]), at("bolt", [[0, PL + T, zPB]], [0, -1, 0], SCREW)], tools: ["screwdriver"] },
+ {
+ title: "Screw the corner brackets in",
+ detail: "One inside each front corner of the plinth, one screw into the side and one into the plinth.",
+ fix: [at("angle", S2.map((sx) => [sx * (xi - 12), PL / 2, zPF - T / 2] as Vec3), [0, 0, 1], { len: 30, dia: 24, on: "PF" }), at("screw", S2.map((sx) => [sx * (xi - 20), PL / 2, zPF - T / 2] as Vec3), [0, 0, 1], { len: 12, dia: 4, on: "PF" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Turn it over and lay the back panels on",
+ detail: "Lying on its front now. Measure both diagonals: when they're equal it's square. The panels meet over the divider.",
+ add: ["B0", "B1"],
+ pose: "-z",
+ check: "square",
+ },
+ {
+ title: "Nail the back on",
+ detail: "Two nails at the top corners first, then along the divider and the shelves, then all round about every 10 cm.",
+ fix: [
+ at("nail", [[-W / 2 + 20, H - 8, -D / 2 - 3], [W / 2 - 20, H - 8, -D / 2 - 3]], [0, 0, 1], NAIL),
+ at("nail", [...Array.from({ length: 8 }, (_, k) => [0, yb + 100 + k * 200, -D / 2 - 3] as Vec3), ...S2.flatMap((sx) => [-1, 1].map((g) => [sx * hx + g * 150, ys + T / 2, -D / 2 - 3] as Vec3))], [0, 0, 1], NAIL),
+ at("nail", [...S2.flatMap((sx) => Array.from({ length: 15 }, (_, k) => [sx * xo, PL + 60 + k * 110, -D / 2 - 3] as Vec3)), ...Array.from({ length: 7 }, (_, k) => [-W / 2 + 100 + k * 160, H - 8, -D / 2 - 3] as Vec3), ...Array.from({ length: 7 }, (_, k) => [-W / 2 + 100 + k * 160, PL + T / 2, -D / 2 - 3] as Vec3)], [0, 0, 1], NAIL),
+ ],
+ tools: ["hammer"],
+ },
+ {
+ title: "Push in the foot strips",
+ detail: "Six, under the bottom edges of the sides, the plinth and the back rail.",
+ fix: [at("glide", [...S2.flatMap((sx) => [-200, 200].map((z) => [sx * xo, 0, z] as Vec3)), [0, 0, zPF], [0, 0, zPB]], [0, 1, 0], { len: 8, dia: 40, name: "Foot strip" })],
+ },
+ { title: "Stand it up", detail: "Together, lifting from the top end so it doesn't bend.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Screw the two angle brackets to the top at the back, mark and drill the wall, then screw them to the wall. Pick plugs and screws made for your wall.",
+ fix: [
+ at("angle", [-350, 350].map((x) => [x, H, -D / 2 + 10] as Vec3), [0, -1, 0], { len: 80, dia: 30, name: "Wall bracket", on: "TP" }),
+ at("screw", [-350, 350].map((x) => [x, H, -D / 2 + 40] as Vec3), [0, -1, 0], { len: 12, dia: 4, on: "TP" }),
+ at("plug", [-350, 350].map((x) => [x, H + 20, -D / 2 - 30] as Vec3), [0, 0, -1]),
+ at("washer", [-350, 350].map((x) => [x, H + 20, -D / 2 + 2] as Vec3), [0, 0, -1], { included: true }),
+ at("screw", [-350, 350].map((x) => [x, H + 20, -D / 2 + 4] as Vec3), [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ {
+ title: "Screw in the rail holders",
+ detail: "Four, near the top: one on each side and one on each face of the divider.",
+ fix: [...S2.map((sx, i) => at("clip", [[sx * xi, yt - 80, zc]], [sx, 0, 0], { len: 30, dia: 30, name: "Rail holder", on: i ? "SR" : "SL" })), ...S2.map((sx) => at("clip", [[sx * (T / 2), yt - 80, zc]], [-sx, 0, 0], { len: 30, dia: 30, name: "Rail holder", on: "DV" })), ...S2.map((sx, i) => at("screw", [[sx * xi, yt - 60, zc]], [sx, 0, 0], { len: 12, dia: 4, on: i ? "SR" : "SL" })), ...S2.map((sx) => at("screw", [[sx * (T / 2), yt - 60, zc]], [-sx, 0, 0], { len: 12, dia: 4, on: "DV" }))],
+ tools: ["screwdriver"],
+ },
+ { title: "Drop the clothes rails in", detail: "One in each half.", add: ["R0", "R1"] },
+ {
+ title: "Screw the runners onto the doors",
+ detail: "Lay the doors on a rug, face down. Two guides on the top edge and two wheels on the bottom edge of each, two screws each.",
+ fix: [
+ ...["DB", "DF"].map((id) => at("clip", doorPt(id, true), [0, -1, 0], { len: 20, dia: 40, name: "Top guide", on: id })),
+ ...["DB", "DF"].map((id) => at("castor", doorPt(id, false), [0, 1, 0], { len: 20, dia: 40, name: "Door wheel", on: id })),
+ ...["DB", "DF"].flatMap((id) => [true, false].map((top) => at("screw", doorPt(id, top).flatMap((p) => [-28, 28].map((d) => [p[0] + d, p[1], p[2]] as Vec3)), [0, top ? -1 : 1, 0], { len: 13, dia: 4, on: id }))),
+ ],
+ wait: ["DB", "DF"],
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ { title: "Hang the back door", detail: "Top into the back groove of the upper track, then swing the bottom in and press it down into the lower track until it clicks.", add: ["DB"], from: { DB: [0, 0, 400] } },
+ { title: "Hang the front door", detail: "The same in the front grooves.", add: ["DF"], from: { DF: [0, 0, 400] } },
+ { title: "Line up the doors", detail: "Turn the screws in the wheels until both doors hang straight and close evenly against the sides.", tools: ["screwdriver"], check: "square" },
+ {
+ title: "Screw on the knobs",
+ detail: "One on each door, near the edge that meets the side, with a screw from the back.",
+ fix: [
+ ...[["DB", -1], ["DF", 1]].map(([id, sx]) => at("knob", [[(sx as number) * (W / 2 - T - 60), 1000, zDoor[id === "DF" ? 0 : 1] + T / 2 + 8]], [0, 0, -1], { len: 25, dia: 28, on: id as string })),
+ ...[["DB", -1], ["DF", 1]].map(([id, sx]) => at("screw", [[(sx as number) * (W / 2 - T - 60), 1000, zDoor[id === "DF" ? 0 : 1] - T / 2]], [0, 0, 1], { len: 30, dia: 4, on: id as string })),
+ ],
+ tools: ["screwdriver"],
+ },
+ ];
+ custom(b, s, parts, steps);
+}
+
+const S2 = [-1, 1];
+
const family: Family = {
names: ["KLEPPSTAD"],
build(b, s) {
@@ -454,7 +619,10 @@ const family: Family = {
bed(b, s);
return true;
}
- if (/sliding/.test(text)) return false;
+ if (/sliding/.test(text)) {
+ sliding(b, s);
+ return true;
+ }
if (/wardrobe/.test(text) && /3 doors|3-doors/.test(text)) {
wardrobe(b, s, true);
return true;
diff --git a/src/lib/plan/families/klippuggla.ts b/src/lib/plan/families/klippuggla.ts
index 36d231f..710f8a5 100644
--- a/src/lib/plan/families/klippuggla.ts
+++ b/src/lib/plan/families/klippuggla.ts
@@ -135,7 +135,7 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw the bracket under the compartment",
detail: "The small angle bracket joins the divider to the compartment bottom: two small screws.",
- fix: [at("angle", [[xC + t / 2, yb, 0]], [1, 0, 0], "D2", "CB", { len: 40, dia: 30 }), at("screw", [[xC + t / 2, yb + 20, 0], [xC + 30, yb, 0]], [1, 0, 0], "D2", "CB", { len: 12, dia: 3.5 })],
+ fix: [at("angle", [[xC + t / 2, yb, 0]], [1, 0, 0], "D2", "CB", { len: 40, dia: 30 }), at("screw", [[xC + t / 2 + 2, yb + 20, 0]], [-1, 0, 0], "D2", undefined, { len: 12, dia: 3.5 }), at("screw", [[xC + 30, yb + 2, 0]], [0, -1, 0], "CB", undefined, { len: 12, dia: 3.5 })],
tools: ["screwdriver"],
},
{
@@ -162,7 +162,8 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw the beam onto the dividers",
detail: "Three screws down through the beam: one into each divider and one into the compartment end.",
- fix: [at("screw", [[x1, H, 0], [xC, H, 0], [xR - 30, H, 0]], [0, -1, 0], "BM", undefined, { len: 70, dia: 6 })],
+ // behind the beam's seam screws, so they don't meet them
+ fix: [at("screw", [[x1, H, -22], [xC, H, -22], [xR - 30, H, -22]], [0, -1, 0], "BM", undefined, { len: 70, dia: 6 })],
tools: ["screwdriver"],
},
{
@@ -189,8 +190,8 @@ function recipe(s: ProductSpec): CustomParams | null {
add: ["ER"],
fix: [
endPegs(1),
- at("nut", [[xR - 40, feet + t / 2, zF], [xR - 40, feet + t / 2, zK], [xR - 40, H - 30, W / 2 - 15], [xR - 40, H - 30, -W / 2 + t + 15]], [0, -1, 0], undefined, undefined, { len: 12, dia: 10, name: "Barrel nut" }),
- at("bolt", [[L / 2, feet + t / 2, zF], [L / 2, feet + t / 2, zK], [L / 2, H - 30, W / 2 - 15], [L / 2, H - 30, -W / 2 + t + 15]], [-1, 0, 0], "ER", undefined, { len: 90, dia: 6 }),
+ at("nut", [[xR - 40, feet + t / 2, zF + 40], [xR - 40, feet + t / 2, zK], [xR - 40, H - 30, W / 2 - 15], [xR - 40, H - 30, -W / 2 + t + 15]], [0, -1, 0], undefined, undefined, { len: 12, dia: 10, name: "Barrel nut" }),
+ at("bolt", [[L / 2, feet + t / 2, zF + 40], [L / 2, feet + t / 2, zK], [L / 2, H - 30, W / 2 - 15], [L / 2, H - 30, -W / 2 + t + 15]], [-1, 0, 0], "ER", undefined, { len: 90, dia: 6 }),
at("cam", [[xR - 40, H - 30, 0]], [0, -1, 0], "BM", undefined, CAM),
],
tools: ["allen", "screwdriver"],
@@ -207,8 +208,8 @@ function recipe(s: ProductSpec): CustomParams | null {
add: ["EL"],
fix: [
endPegs(-1),
- at("nut", [[xL + 40, feet + t / 2, zF], [xL + 40, feet + t / 2, zK], [xL + 40, H - 30, W / 2 - 15], [xL + 40, H - 30, -W / 2 + t + 15]], [0, -1, 0], undefined, undefined, { len: 12, dia: 10, name: "Barrel nut" }),
- at("bolt", [[-L / 2, feet + t / 2, zF], [-L / 2, feet + t / 2, zK], [-L / 2, H - 30, W / 2 - 15], [-L / 2, H - 30, -W / 2 + t + 15]], [1, 0, 0], "EL", undefined, { len: 90, dia: 6 }),
+ at("nut", [[xL + 40, feet + t / 2, zF + 40], [xL + 40, feet + t / 2, zK], [xL + 40, H - 30, W / 2 - 15], [xL + 40, H - 30, -W / 2 + t + 15]], [0, -1, 0], undefined, undefined, { len: 12, dia: 10, name: "Barrel nut" }),
+ at("bolt", [[-L / 2, feet + t / 2, zF + 40], [-L / 2, feet + t / 2, zK], [-L / 2, H - 30, W / 2 - 15], [-L / 2, H - 30, -W / 2 + t + 15]], [1, 0, 0], "EL", undefined, { len: 90, dia: 6 }),
at("cam", [[xL + 40, H - 30, 0]], [0, -1, 0], "BM", undefined, CAM),
],
tools: ["allen", "screwdriver"],
diff --git a/src/lib/plan/families/knarrevik.ts b/src/lib/plan/families/knarrevik.ts
index 790706e..82ed5f2 100644
--- a/src/lib/plan/families/knarrevik.ts
+++ b/src/lib/plan/families/knarrevik.ts
@@ -39,7 +39,8 @@ function recipe(s: ProductSpec): CustomParams {
// one bolt through each flange into the top and the shelf: "z" is the flange facing front or back, "x" the side one
const flange = (i: number, f: "x" | "z"): CustomFix => {
const { id, sx, sz } = legs[i];
- const at: Vec3[] = [yTop, yShelf].map((y) => (f === "z" ? [sx * (W / 2 - a / 2 - 2), y, sz * (D / 2)] : [sx * (W / 2), y, sz * (D / 2 - a / 2 - 2)]));
+ // the two bolts at one corner sit a little apart in height, so neither gets pushed off the panel's edge
+ const at: Vec3[] = [yTop, yShelf].map((y0) => y0 + (f === "z" ? 6 : -6)).map((y) => (f === "z" ? [sx * (W / 2 - a / 2 - 2), y, sz * (D / 2)] : [sx * (W / 2), y, sz * (D / 2 - a / 2 - 2)]));
return { ...BOLT, count: 2, at, dir: f === "z" ? [0, 0, -sz] : [-sx, 0, 0], on: id };
};
const steps: CustomStep[] = [
diff --git a/src/lib/plan/families/knoxhult.ts b/src/lib/plan/families/knoxhult.ts
index b9d372f..419b527 100644
--- a/src/lib/plan/families/knoxhult.ts
+++ b/src/lib/plan/families/knoxhult.ts
@@ -200,7 +200,8 @@ class Knox {
}
this.prep(
{ title: "Screw the cam bolts into the sides", detail: "Eight in all, into the holes nearest the ends, by hand until they stop.", kind: "cams", tools: ["screwdriver"] },
- wall ? sideLay() : [],
+ // the top and bottom are laid out here too, so they lie still while their dowels go in
+ [...(wall ? sideLay() : []), ...tbLay()],
() => b.fits(BOLT, ends.flatMap((e) => [...this.joint(u, -1, e).bolts, ...this.joint(u, 1, e).bolts]), 0.06),
);
this.prep(
@@ -230,7 +231,7 @@ class Knox {
: [];
this.prep(
{ title: u.divider ? "Tap the dowels into the top, bottom and divider" : "Tap the dowels into the top and bottom", detail: "Two into each end, half their length. A light tap with the hammer.", kind: "dowels", tools: ["hammer"] },
- tbLay(),
+ [],
() => b.fits(DOWEL, [...ends.flatMap((e) => [...this.joint(u, -1, e).dowels, ...this.joint(u, 1, e).dowels]), ...divDowels()], 0.06),
);
@@ -594,12 +595,12 @@ function cornerBase(k: Knox) {
b.fits(BOLT, [-1, 1].flatMap((sx) => k.joint(u, sx as -1 | 1, false).bolts), 0.08);
});
const sideFeet = [sideL, sideR].flatMap((key, i) => [-1, 1].map((sz): FitOpts => ({ on: key, at: [(i ? 1 : -1) * (W / 2 - T / 2), y0, r(zc + sz * (Dc / 2 - 50))], dir: [0, 1, 0] })));
- k.prep({ title: "Fit the feet into the sides", detail: "Tap a socket into each hole in the bottom ends, then screw a foot into each.", kind: "legs", tools: ["hammer"] }, [], () => {
+ k.prep({ title: "Fit the feet into the sides", detail: "Tap a socket into each hole in the bottom ends, then screw a foot into each.", kind: "legs", tools: ["hammer"] }, [[bottom, [0, T / 2, -(1.5 * Dc + 80)], [0, 0, 0]]], () => {
b.fits(SOCKET, sideFeet, 0.08);
b.then(0.1);
b.fits(FOOT, sideFeet.map((p) => ({ ...p, hole: false })), 0.08);
});
- k.prep({ title: "Tap the dowels into the bottom", detail: "Two into each end, half their length.", kind: "dowels", tools: ["hammer"] }, [[bottom, [0, T / 2, -(1.5 * Dc + 80)], [0, 0, 0]]], () => {
+ k.prep({ title: "Tap the dowels into the bottom", detail: "Two into each end, half their length.", kind: "dowels", tools: ["hammer"] }, [], () => {
b.fits(DOWEL, [-1, 1].flatMap((sx) => k.joint(u, sx as -1 | 1, false).dowels), 0.06);
});
k.step({ title: "Join the bottom to the left side", detail: "Lay it on its front on the rug. The bottom slides in with the groove for the back at the back.", kind: "join", pose: "-z", warnings: ["floor"] }, () => {
@@ -612,7 +613,8 @@ function cornerBase(k: Knox) {
});
const plinthFoot: FitOpts = { on: plinth, at: [0, y0, pz], dir: [0, 1, 0] };
- k.prep({ title: "Fit the foot into the plinth", detail: "A socket in the middle hole of its bottom edge, then the foot.", kind: "legs", tools: ["hammer"] }, [[plinth, [0, T / 2, 1.5 * Dc + 80], [-Math.PI / 2, 0, 0]]], () => {
+ const railLay = rails.map((rk, i): [string, Vec3, Vec3] => [rk, [0, T / 2, (i ? 1 : -1) * (Dc + 120)], [0, 0, 0]]);
+ k.prep({ title: "Fit the foot into the plinth", detail: "A socket in the middle hole of its bottom edge, then the foot.", kind: "legs", tools: ["hammer"] }, [[plinth, [0, T / 2, 1.5 * Dc + 80], [-Math.PI / 2, 0, 0]], ...railLay], () => {
b.fit(SOCKET, plinthFoot);
b.then(0.1);
b.fit(FOOT, { ...plinthFoot, hole: false });
@@ -627,7 +629,7 @@ function cornerBase(k: Knox) {
b.then(0.05);
b.fit(BRACKET_SCREW, { on: plinth, at: [angleAt[0], angleAt[1] - 20, angleAt[2] - 2], dir: [0, 0, 1] });
});
- k.prep({ title: "Tap the dowels into the two rails", detail: "One into each end. Check the holes face the way the drawing shows.", kind: "dowels", tools: ["hammer"] }, rails.map((rk, i): [string, Vec3, Vec3] => [rk, [0, T / 2, (i ? 1 : -1) * (Dc + 120)], [0, 0, 0]]), () => {
+ k.prep({ title: "Tap the dowels into the two rails", detail: "One into each end. Check the holes face the way the drawing shows.", kind: "dowels", tools: ["hammer"] }, [], () => {
b.fits(DOWEL, rails.flatMap((rk) => [-1, 1].map((sx): FitOpts => ({ on: rk, at: [sx * (W / 2 - T), top - T / 2, k.pos(rk)[2]], dir: [-sx, 0, 0], mate: sx < 0 ? sideL : sideR }))), 0.08);
});
const railScrews = (sx: -1 | 1) => rails.map((rk): FitOpts => ({ on: sx < 0 ? sideL : sideR, at: [sx * (W / 2), top - T / 2, k.pos(rk)[2]], dir: [-sx, 0, 0], mate: rk }));
@@ -757,9 +759,10 @@ function cornerBase(k: Knox) {
});
k.step({ title: "Screw the worktop down at the front", detail: "Three long frame screws up through the top of the cover panel, the filler strip and the front rail. Use the Allen key.", kind: "screws", tools: ["allen"] }, () => {
b.fits(LONG_SCREW, [
- { on: cover, at: [-W / 2 + 60, fy1, fz], dir: [0, 1, 0], mate: worktop },
- { on: filler, at: [xs, fy1, fz], dir: [0, 1, 0], mate: worktop },
- { on: rails[0], at: [W / 4, top - T, railZ[0] + 30], dir: [0, 1, 0], mate: worktop },
+ // 50 mm: 20 of it in the panel or rail, the rest in the 30 mm worktop
+ { on: cover, at: [-W / 2 + 60, top - 22, fz], dir: [0, 1, 0], mate: worktop },
+ { on: filler, at: [xs, top - 22, fz], dir: [0, 1, 0], mate: worktop },
+ { on: rails[0], at: [W / 4, top - T - 3, railZ[0] + 30], dir: [0, 1, 0], mate: worktop },
], 0.12);
});
k.step({ title: "Tilt the shelf in and lay it on the pins", detail: "In at an angle through the door opening, then lower it flat.", kind: "shelves" }, () => k.put(shelf, [200, 120, 360]));
diff --git a/src/lib/plan/families/kolbjorn.ts b/src/lib/plan/families/kolbjorn.ts
index d31b7cd..1c8f8ea 100644
--- a/src/lib/plan/families/kolbjorn.ts
+++ b/src/lib/plan/families/kolbjorn.ts
@@ -441,7 +441,7 @@ function build90(b: PlanBuilder, s: ProductSpec, W: number, H: number) {
const backW = (2 * inner) / 3;
const panelH = panelY1 - panelY0, panelC = (panelY0 + panelY1) / 2;
const railYs = [H - 220, H - 760];
- const railX0 = divX + 22, railX1 = inner;
+ const railX0 = divX + 22, railX1 = W / 2 - 3; // out to the right side panel, where its end is screwed
const railZ = -40;
const shelfYs = [0.3, 0.52, 0.74].map((t) => Math.round(panelY0 + t * panelH));
const leftW = divX - 2 + inner;
@@ -538,7 +538,7 @@ function build90(b: PlanBuilder, s: ProductSpec, W: number, H: number) {
detail: "One end on its bracket, the other to the right side. Two screws at each end.",
fix: [
{ ...RAIL_SCREW, count: 2, at: railYs.map((y) => [railX0 + 10, y + 12, railZ] as Vec3), dir: [0, -1, 0] },
- { ...RAIL_SCREW, count: 2, at: railYs.map((y) => [inner, y, railZ] as Vec3), dir: [1, 0, 0] },
+ { ...RAIL_SCREW, count: 2, at: railYs.map((y) => [railX1 - 6, y, railZ] as Vec3), dir: [1, 0, 0] },
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/kompishang.ts b/src/lib/plan/families/kompishang.ts
new file mode 100644
index 0000000..b275273
--- /dev/null
+++ b/src/lib/plan/families/kompishang.ts
@@ -0,0 +1,94 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * KOMPISHÄNG desk and side table: solid pine tops on folding powder-coated steel frames. IKEA sells both ready
+ * assembled (their pages have no assembly instructions), so the guides only unfold them: the desk's legs fold out
+ * from under the top and lock with their braces, the side table's top tips up level on its frame.
+ */
+
+/** A round rod from a to b (mm, relative to its part's centre). */
+function rod(a: Vec3, b: Vec3, d: number): PartPiece {
+ const v: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...v);
+ return { shape: "cyl", size: [d, len, d], pos: [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2], rot: [Math.atan2(v[2], v[1]), 0, Math.asin(-v[0] / len)] };
+}
+
+function desk(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const tt = 25, yT = H - tt, tube = 25, lx = W / 2 - 60, lz = D / 2 - 50;
+ // each end frame: two legs joined by a rail under the top and a folding brace up to the apron
+ const frame = (id: string, sx: -1 | 1): CustomPart => ({
+ id,
+ name: "Leg frame",
+ size: [80, yT, D - 60],
+ pos: [sx * lx, yT / 2, 0],
+ material: "metal",
+ pieces: [
+ ...[-1, 1].map((sz) => rod([0, -yT / 2, sz * lz], [0, yT / 2 - tube / 2, sz * lz], tube)),
+ rod([0, yT / 2 - tube / 2, -lz], [0, yT / 2 - tube / 2, lz], tube),
+ rod([0, yT / 2 - 230, lz], [-sx * 70, yT / 2 - 12, lz - 40], 12),
+ ],
+ });
+ const top: CustomPart = {
+ id: "T",
+ name: "Desk top",
+ size: [W, tt + 60, D],
+ pos: [0, H - (tt + 60) / 2, 0],
+ material: "wood",
+ pieces: [
+ { shape: "box", size: [W, tt, D], pos: [0, 30, 0] },
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [W - 220, 60, 20], pos: [0, -tt / 2, sz * (D / 2 - 40)], material: "metal" })),
+ ],
+ };
+ return {
+ parts: [top, frame("A", -1), frame("B", 1)],
+ steps: [
+ { title: "Lay the folded desk upside down", detail: "It comes assembled. Lay it top down on a rug, the legs folded flat against the underside.", add: ["T"], pose: "-y", warnings: ["floor"] },
+ { title: "Fold out the legs at one end", detail: "Swing the leg frame up until it stands straight, then push its brace until it clicks into place.", add: ["A"], from: { A: [0, 0, -300] } },
+ { title: "Fold out the other end", detail: "The same way. Check both braces have clicked.", add: ["B"], from: { B: [0, 0, -300] } },
+ { title: "Turn the desk over together", detail: "Stand it on its feet. To fold it, press the braces open and fold the legs in.", pose: "+y", people: 2, warnings: ["two"] },
+ ],
+ };
+}
+
+function sideTable(s: ProductSpec): CustomParams {
+ const Dd = s.size.w * 10, H = s.size.h * 10;
+ const tt = 22, yT = H - tt, tube = 20, R = Dd / 2 - 40;
+ const ring: PartPiece[] = Array.from({ length: 16 }, (_, i) => {
+ const a = (i / 16) * 2 * Math.PI, c = ((i + 1) / 16) * 2 * Math.PI;
+ return rod([R * Math.cos(a), -yT / 2 + 10, R * Math.sin(a)], [R * Math.cos(c), -yT / 2 + 10, R * Math.sin(c)], tube);
+ });
+ const frame: CustomPart = {
+ id: "F",
+ name: "Frame",
+ size: [2 * R + tube, yT, 2 * R + tube],
+ pos: [0, yT / 2, 0],
+ material: "metal",
+ pieces: [
+ ...ring,
+ ...[-1, 1].map((sz) => rod([R * 0.8, -yT / 2 + 10, sz * R * 0.6], [R * 0.8, yT / 2 - 20, sz * R * 0.3], tube)),
+ rod([R * 0.8, yT / 2 - 20, -R * 0.3], [R * 0.8, yT / 2 - 20, R * 0.3], tube),
+ rod([R * 0.8, yT / 2 - 20, 0], [-R * 0.3, yT / 2 - 10, 0], 14),
+ ],
+ };
+ const top: CustomPart = { id: "T", name: "Table top", size: [Dd, tt, Dd], pos: [0, H - tt / 2, 0], material: "wood", pieces: [{ shape: "cyl", size: [Dd, tt, Dd], pos: [0, 0, 0] }] };
+ return {
+ parts: [frame, top],
+ steps: [
+ { title: "Stand the folded table up", detail: "It comes assembled, with the top folded down beside the frame. Stand it on its ring.", add: ["F"] },
+ { title: "Tip the top up level", detail: "Lift it until it lies flat and the bracket underneath locks. To fold it, release the bracket and let the top down.", add: ["T"], from: { T: [-220, -200, 0] } },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["KOMPISHÄNG", "KOMPISHANG"],
+ recipe(s) {
+ const slug = s.slug ?? "";
+ if (/^kompishang-desk/.test(slug)) return desk(s);
+ if (/^kompishang-side-table/.test(slug)) return sideTable(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/konstrunda.ts b/src/lib/plan/families/konstrunda.ts
index d024d84..b5d735a 100644
--- a/src/lib/plan/families/konstrunda.ts
+++ b/src/lib/plan/families/konstrunda.ts
@@ -46,7 +46,7 @@ function boxStool(s: ProductSpec) {
fix: [{ kind: "dowel", count: 6, len: 30, dia: 8, to: ["K0", "K1", "K2"] }],
warnings: ["floor"],
},
- { title: "Push the small dowels into two rails", detail: "Two in each, in the holes on the long face.", fix: [{ kind: "dowel", count: 4, len: 16, dia: 6, to: ["K0", "K1", "A"] }] },
+ { title: "Push the small dowels into two rails", detail: "Two in each, in the holes on the long face.", fix: [-1, 1].map((sx): CustomFix => ({ kind: "dowel", count: 2, len: 16, dia: 6, at: [hs * 0.45, hs * 0.55].map((y) => [rx(sx), y, -zi] as Vec3), dir: [0, 0, 1], on: sx < 0 ? "K0" : "K1" })) },
{
title: "Screw two rails onto a side panel",
detail: "Along both side edges on the inside, cam holes facing outwards. Two screws each.",
@@ -54,23 +54,23 @@ function boxStool(s: ProductSpec) {
fix: [{ kind: "screw", count: 4, len: 30, dia: 4, at: [-1, 1].flatMap((sx) => [hs * 0.3, hs * 0.7].map((y) => [rx(sx), y, -(D / 2)] as Vec3)), dir: [0, 0, 1] }],
pose: "+z",
},
- { title: "Screw cam bolts into the next panel", detail: "Five, by hand, until they stop.", fix: [bolts("B", bPts.map((p) => [-(W / 2 - T), p[1], p[2]] as Vec3), [-1, 0, 0])] },
- { title: "Stand the first panel on it with a rail", detail: "Lay the panel flat, then press the rails onto its bolts and push the loose rail onto the front ones.", add: ["B", "K2"], pose: "+x" },
+ { title: "Screw cam bolts into the next panel", detail: "Five, by hand, until they stop.", fix: [bolts("B", bPts.map((p) => [-(W / 2 - T), p[1], p[2]] as Vec3), [-1, 0, 0])], wait: ["B"] },
+ { title: "Stand the first panel on it with a rail", detail: "Lay the panel flat, then press the rails onto its bolts and push the loose rail onto the front ones.", add: ["B", "K2"], from: { B: [-240, 0, 0] }, pose: "+x" },
{ title: "Lock the cams", detail: "Five cams in the rails, arrow towards the bolt, turned clockwise.", fix: [cams("K0", bPts.map((p) => [rx(-1) + R / 2, p[1], p[2]] as Vec3), [-1, 0, 0])], tools: ["screwdriver"] },
- { title: "Screw cam bolts into the third panel", detail: "Five again.", fix: [bolts("C", cPts.map((p) => [W / 2 - T, p[1], p[2]] as Vec3), [1, 0, 0])] },
+ { title: "Screw cam bolts into the third panel", detail: "Five again.", fix: [bolts("C", cPts.map((p) => [W / 2 - T, p[1], p[2]] as Vec3), [1, 0, 0])], wait: ["C"] },
{ title: "Tap two dowels into the last rail", detail: "One in each end.", fix: [{ kind: "dowel", count: 2, len: 30, dia: 8, at: [[rx(1), 10, rz(1)], [rx(1), hs - 10, rz(1)]], dir: [0, 1, 0], on: "K3" }] },
- { title: "Fit the rail to the third panel", detail: "Onto the front bolts.", add: ["C", "K3"], pose: "-x" },
+ { title: "Fit the rail to the third panel", detail: "Onto the front bolts.", add: ["C", "K3"], from: { C: [240, 0, 0] }, pose: "-x" },
{ title: "Lock its cams", detail: "Three cams, turned clockwise.", fix: [cams("K3", cPts.slice(3).map((p) => [rx(1) - R / 2, p[1], p[2]] as Vec3).concat([[rx(1) - R / 2, hs / 2, rz(1)]]), [1, 0, 0])], tools: ["screwdriver"] },
{ title: "Join the third panel to the others", detail: "Push it onto the back rail's dowels and bolts.", pose: "+y" },
{ title: "Lock the last two cams", detail: "In the back rail, turned clockwise.", fix: [cams("K1", cPts.slice(0, 2).map((p) => [rx(1) - R / 2, p[1], p[2]] as Vec3), [1, 0, 0])], tools: ["screwdriver"] },
- { title: "Tap dowels into the top of the rails", detail: "One in each rail end at the top.", fix: [{ kind: "dowel", count: 4, len: 30, dia: 8, at: [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [rx(sx), hs, rz(sz)] as Vec3)), dir: [0, -1, 0], on: "K0" }] },
+ { title: "Tap dowels into the top of the rails", detail: "One in each rail end at the top.", fix: [-1, 1].flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "dowel", count: 1, len: 30, dia: 8, at: [[rx(sx), hs - 10, rz(sz)]], dir: [0, -1, 0], on: `K${(sz < 0 ? 0 : 2) + (sx < 0 ? 0 : 1)}` }))) },
{
title: "Screw cam bolts into the seat and the last panel",
detail: "Five in each.",
fix: [bolts("S", sPts, [0, 1, 0]), bolts("F", fPts, [0, 0, 1])],
},
{ title: "Press the seat on", detail: "Onto the dowels and bolts at the top.", add: ["S"] },
- { title: "Turn it on its back and tap in four dowels", detail: "Into the front edges of the side panels and rails.", fix: [{ kind: "dowel", count: 4, len: 30, dia: 8, at: [-1, 1].flatMap((sx) => [hs * 0.25, hs * 0.75].map((y) => [rx(sx), y, zi] as Vec3)), dir: [0, 0, -1], on: "K2" }], pose: "+z" },
+ { title: "Turn it on its back and tap in four dowels", detail: "Into the front edges of the side panels and rails.", fix: [-1, 1].map((sx): CustomFix => ({ kind: "dowel", count: 2, len: 30, dia: 8, at: [hs * 0.25, hs * 0.75].map((y) => [rx(sx), y, zi] as Vec3), dir: [0, 0, -1], on: sx < 0 ? "K2" : "K3" })), pose: "+z" },
{ title: "Press the last panel on", detail: "Onto the dowels and bolts.", add: ["F"] },
{ title: "Lock the ten cams", detail: "Turned clockwise until the panels pull tight.", fix: [cams("K0", [...sPts.map((p) => [p[0], p[1] - 20, p[2]] as Vec3), ...fPts.map((p) => [p[0], p[1], p[2] - 20] as Vec3)], [0, 0, 1])], tools: ["screwdriver"] },
{
diff --git a/src/lib/plan/families/koppang.ts b/src/lib/plan/families/koppang.ts
new file mode 100644
index 0000000..d0d30b9
--- /dev/null
+++ b/src/lib/plan/families/koppang.ts
@@ -0,0 +1,229 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomPart, CustomStep, HwKind, ProductSpec, Vec3 } from "../../types";
+import type { FitOpts, PlanBuilder } from "../builder";
+import { buildCustom } from "../custom";
+import { ankDrawer, ankDrawerSteps, ankDrawersIn } from "./ankarudden";
+
+/*
+ * KOPPANG, read from IKEA's manual for the chest of 3 drawers (the line is no longer sold; the chest of 6 drawers
+ * is drawn the same way with a middle frame, as two chests of 3 side by side).
+ *
+ * Each side is a frame: an upper and a lower rail and a panel, with a post pushed onto each end on dowels and cam
+ * bolts. Lying on its left side, the front rails and the two back panels stand in the side frame on the floor and
+ * are locked, and the other frame is laid on top. Glides go under the posts, it's stood up, the top goes on dowels
+ * and cam bolts with the wall brackets under it, three long screws pull the top rail up into it, and it's fixed to
+ * the wall. The drawers stand their sides on the back, take a bottom and a wire stiffener, get the front on
+ * connecting dowels, runners and two knobs.
+ */
+
+const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
+const fx = (kind: HwKind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const S = [-1, 1];
+const DOWEL = { len: 30, dia: 8 };
+const CAM = { name: "Cam lock" };
+const PT = 40; // posts
+const TT = 18; // top
+
+function chest(b: PlanBuilder, s: ProductSpec, cols: 1 | 2) {
+ const W = cols === 2 ? 1720 : 900, H = 830, D = 550, rows = 3;
+ const ph = H - TT;
+ const zP = D / 2 - PT / 2; // post centres, front (+z) and back (-z)
+ const lz = D - 2 * PT;
+ const yLo = 120, yUp = ph - 35; // centres of the side rails
+ const frames = cols === 2 ? [-1, 0, 1] : [-1, 1];
+ const fxOf = (f: number) => f * (W / 2 - PT / 2);
+ const fid = (f: number) => (f < 0 ? "L" : f > 0 ? "R" : "M");
+ const bayW = (W - frames.length * PT) / cols; // between the posts of one bay
+ const bayX = (c: number) => (cols === 2 ? (c ? 1 : -1) * (PT / 2 + bayW / 2) : 0);
+ const railY = [yLo, ...Array.from({ length: rows - 1 }, (_, k) => yLo + ((ph - 15 - yLo) * (k + 1)) / rows), ph - 15];
+ const bpY0 = yLo - 35, bpH = (ph - bpY0) / 2;
+ const bpC = (k: number) => bpY0 + bpH * (k + 0.5);
+ const parts: CustomPart[] = [];
+ for (const f of frames) {
+ const x = fxOf(f), k = fid(f);
+ parts.push(
+ { id: `${k}RU`, name: "Upper side rail", size: [24, 70, lz], pos: [x, yUp, 0], material: "wood" },
+ { id: `${k}RL`, name: "Lower side rail", size: [24, 70, lz], pos: [x, yLo, 0], material: "wood" },
+ { id: `${k}SP`, name: "Side panel", size: [12, yUp - yLo - 70, lz], pos: [x, (yUp + yLo) / 2, 0] },
+ { id: `${k}PF`, name: "Post", size: [PT, ph, PT], pos: [x, ph / 2, zP], material: "wood" },
+ { id: `${k}PB`, name: "Post", size: [PT, ph, PT], pos: [x, ph / 2, -zP], material: "wood" },
+ );
+ }
+ for (let c = 0; c < cols; c++) {
+ railY.forEach((y, r) => parts.push({ id: `F${c}${r}`, name: r === rows ? "Top front rail" : "Front rail", size: [bayW, 30, 20], pos: [bayX(c), y, zP], material: "wood" }));
+ [0, 1].forEach((k) => parts.push({ id: `K${c}${k}`, name: "Back panel", size: [bayW, bpH, 12], pos: [bayX(c), bpC(k), -zP] }));
+ }
+ parts.push({ id: "TP", name: "Top", size: [W, TT, D + 10], pos: [0, H - TT / 2, 0] });
+ const frameIds = (f: number) => ["RU", "RL", "SP", "PF", "PB"].map((p) => fid(f) + p);
+ const postId = (f: number, sz: number) => `${fid(f)}P${sz > 0 ? "F" : "B"}`;
+
+ // each post: two cam bolts into the side rails' ends and two dowels into the panel's end
+ const postBolts = (f: number) => S.map((sz) => fx("camScrew", [yUp, yLo].map((y) => pt(fxOf(f), y, sz * (D / 2 - PT))), [0, 0, sz], { on: postId(f, sz) }));
+ const postDowels = (f: number) => S.map((sz) => fx("dowel", [320, 560].map((y) => pt(fxOf(f), y, sz * (D / 2 - PT))), [0, 0, sz], { on: postId(f, sz), ...DOWEL }));
+ const railCams = (f: number) => [
+ fx("cam", S.map((sz) => pt(fxOf(f), yUp - 35, sz * (D / 2 - PT - 30))), [0, 1, 0], { on: `${fid(f)}RU`, ...CAM }),
+ fx("cam", S.map((sz) => pt(fxOf(f), yLo - 35, sz * (D / 2 - PT - 30))), [0, 1, 0], { on: `${fid(f)}RL`, ...CAM }),
+ ];
+ // a bay's front rails and back panels: a cam bolt in each end of the lower rails and the lower back panel,
+ // dowels in every end; the top rail and the upper back panel take a cam bolt from the post instead
+ const ends = (c: number) => S.map((g) => ({ g, x: bayX(c) + (g * bayW) / 2 }));
+ const bayBolts = (c: number) => [
+ ...railY.slice(0, rows).map((y, r) => ends(c).map(({ g, x }) => fx("camScrew", [pt(x, y, zP)], [-g, 0, 0], { on: `F${c}${r}` }))).flat(),
+ ...ends(c).map(({ g, x }) => fx("camScrew", [pt(x, bpC(0), -zP)], [-g, 0, 0], { on: `K${c}0` })),
+ ];
+ const bayDowels = (c: number) => [
+ ...railY.map((y, r) => ends(c).map(({ g, x }) => fx("dowel", r === 0 ? [pt(x, y - 10, zP - 5), pt(x, y + 10, zP - 5)] : [pt(x, y, zP - 6)], [-g, 0, 0], { on: `F${c}${r}`, ...DOWEL }))).flat(),
+ ...[0, 1].flatMap((k) => ends(c).map(({ g, x }) => fx("dowel", [-120, 120].map((dy) => pt(x, bpC(k) + dy, -zP)), [-g, 0, 0], { on: `K${c}${k}`, ...DOWEL }))),
+ ];
+ // the post's own cam bolts for the top rail and the upper back panel, and the locks for all of them
+ const postSideBolts = (c: number, g: number) => {
+ const f = cols === 2 ? (c === 0 ? (g < 0 ? -1 : 0) : g < 0 ? 0 : 1) : g;
+ const x = bayX(c) + (g * bayW) / 2;
+ return [fx("camScrew", [pt(x, ph - 15, zP)], [g, 0, 0], { on: postId(f, 1) }), fx("camScrew", [pt(x, bpC(1), -zP)], [g, 0, 0], { on: postId(f, -1) })];
+ };
+ const bayCams = (c: number, g: number) => {
+ const f = cols === 2 ? (c === 0 ? (g < 0 ? -1 : 0) : g < 0 ? 0 : 1) : g;
+ const x = fxOf(f) - g * 6;
+ const xi = bayX(c) + (g * bayW) / 2 - g * 34;
+ return [
+ fx("cam", railY.slice(0, rows).map((y) => pt(x, y, zP - PT / 2)), [0, 0, 1], { on: postId(f, 1), ...CAM }),
+ fx("cam", [pt(x, bpC(0), -zP + PT / 2)], [0, 0, -1], { on: postId(f, -1), ...CAM }),
+ fx("cam", [pt(xi, ph, zP)], [0, -1, 0], { on: `F${c}${rows}`, ...CAM }),
+ fx("cam", [pt(xi, bpC(1) + bpH / 2, -zP)], [0, -1, 0], { on: `K${c}1`, ...CAM }),
+ ];
+ };
+ const runnerY = (r: number) => railY[r] + 65;
+ const runners = (f: number, side: number): CustomFix[] =>
+ Array.from({ length: rows }, (_, r) => [
+ fx("runner", [pt(fxOf(f) + side * 6, runnerY(r), 0)], [-side, 0, 0], { len: 400, dia: 30, name: "Drawer runner", on: `${fid(f)}SP` }),
+ fx("screw", [-150, 150].map((z) => pt(fxOf(f) + side * 6, runnerY(r), z)), [-side, 0, 0], { len: 12, dia: 4, on: `${fid(f)}SP` }),
+ ]).flat();
+
+ const left = frames[0], right = frames[frames.length - 1];
+ const steps: CustomStep[] = [
+ {
+ title: "Lay out the posts and the side parts",
+ detail: cols === 2 ? "On a rug: six posts, three sets of side rails and panels." : "On a rug: four posts, the side rails and the side panels.",
+ add: frameIds(left).slice(0, 3),
+ pose: "+x",
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the cam bolts into the posts",
+ detail: "Two in each post, at the rail holes, and one more at the top front and the back of each post that faces a bay.",
+ fix: [...frames.flatMap(postBolts), ...Array.from({ length: cols }, (_, c) => S.flatMap((g) => postSideBolts(c, g))).flat()],
+ wait: frames.flatMap((f) => [postId(f, 1), postId(f, -1)]),
+ tools: ["screwdriver"],
+ },
+ { title: "Tap the dowels into the posts", detail: "Two in each post, for the side panel.", fix: frames.flatMap(postDowels), tools: ["hammer"] },
+ {
+ title: "Push the posts onto the side",
+ detail: "One onto each end of the rails and the panel. Make the other side frame" + (cols === 2 ? "s" : "") + " the same way.",
+ add: [postId(left, 1), postId(left, -1)],
+ wait: frames.slice(1).flatMap(frameIds),
+ },
+ { title: "Lock the posts", detail: "Four cam locks in the rails, arrow towards the bolt.", fix: railCams(left), tools: ["screwdriver"] },
+ {
+ title: "Screw the drawer runners onto the side panels",
+ detail: "Three on each panel, two screws each, on the inside. The marks show which side they're for.",
+ fix: frames.flatMap((f) => (f === -1 ? runners(f, 1) : f === 1 ? runners(f, -1) : [...runners(f, 1), ...runners(f, -1)])),
+ tools: ["screwdriver"],
+ },
+ ];
+ for (let c = 0; c < cols; c++) {
+ const next = cols === 2 && c === 0 ? 0 : right;
+ const rails = railY.map((_, r) => `F${c}${r}`);
+ steps.push(
+ { title: "Screw the cam bolts into the rails and back panels", detail: "One in each end of the lower front rails and the lower back panel.", fix: bayBolts(c), wait: [...rails, `K${c}0`, `K${c}1`], tools: ["screwdriver"] },
+ { title: "Tap the dowels into the rails and back panels", detail: "In every end: two in the bottom rail, one in each of the others, two in each back panel end.", fix: bayDowels(c), tools: ["hammer"] },
+ { title: "Stand the front rails in the side", detail: "Bottom rail first, the top rail last, onto the dowels and cam bolts.", add: rails },
+ { title: "Stand the back panels in", detail: "Onto their dowels, one above the other.", add: [`K${c}0`, `K${c}1`] },
+ { title: "Lock the rails and the back panels", detail: "Cam locks in the posts and in the top rail and the upper back panel.", fix: bayCams(c, -1), tools: ["screwdriver"] },
+ {
+ title: next === right ? "Lay the other side on" : "Lay the middle frame on",
+ detail: "Together: down onto all the dowels and cam bolts at once.",
+ add: frameIds(next),
+ fix: railCams(next),
+ people: 2,
+ },
+ { title: "Lock it", detail: "Cam locks in the posts and in the top rail and the upper back panel.", fix: bayCams(c, 1), tools: ["screwdriver"] },
+ );
+ }
+ steps.push(
+ { title: "Press the glides under the posts", detail: "One under each post.", fix: [fx("glide", frames.flatMap((f) => S.map((sz) => pt(fxOf(f), 0, sz * zP))), [0, 1, 0], { len: 6, dia: 30, name: "Glide" })], tools: ["hammer"] },
+ {
+ title: "Stand it up and tap in the dowels for the top",
+ detail: "In the tops of the posts.",
+ fix: frames.flatMap((f) => S.map((sz) => fx("dowel", [pt(fxOf(f) + (f ? -f * 8 : 0), ph, sz * (zP - 10))], [0, -1, 0], { on: postId(f, sz), ...DOWEL }))),
+ pose: "+y",
+ people: 2,
+ tools: ["hammer"],
+ },
+ { title: "Screw the cam bolts under the top", detail: "Lay the top upside down. One over each corner post.", fix: [fx("camScrew", S.flatMap((g) => S.map((sz) => pt(g * (W / 2 - PT / 2), ph, sz * (zP - 8)))), [0, 1, 0], { on: "TP" })], wait: ["TP"], tools: ["screwdriver"] },
+ {
+ title: "Screw the wall brackets under the top",
+ detail: "At the back, one near each end, two screws each.",
+ fix: [
+ fx("angle", [-1, 1].map((g) => pt(g * (W / 2 - 200), ph, -D / 2 + 25)), [0, 1, 0], { name: "Wall bracket", len: 50, dia: 30, on: "TP", twist: Math.PI }),
+ fx("screw", [-1, 1].flatMap((g) => [-15, 15].map((d) => pt(g * (W / 2 - 200) + d, ph, -D / 2 + 45))), [0, 1, 0], { len: 12, dia: 4, on: "TP" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Put the top on", detail: "Onto the dowels and cam bolts in the posts.", add: ["TP"], people: cols === 2 ? 2 : 1 },
+ { title: "Lock the top", detail: "Four cam locks in the corner posts.", fix: S.flatMap((g) => S.map((sz) => fx("cam", [pt(g * (W / 2 - PT), ph - 34, sz * zP)], [g, 0, 0], { on: postId(g, sz), ...CAM }))), tools: ["screwdriver"] },
+ {
+ title: "Screw the top rail up into the top",
+ detail: "Long screws up through the top front rail. Stop when the heads are flush.",
+ fix: [fx("screw", Array.from({ length: cols }, (_, c) => [-1, 0, 1].map((k) => pt(bayX(c) + (k * bayW) / 3, ph - 30, zP))).flat(), [0, 1, 0], { len: 50, dia: 5, name: "Long screw" })],
+ tools: ["allen"],
+ },
+ {
+ title: "Fit the drawer interlock",
+ detail: "Screw the catch arm inside the right side so only one drawer can open at a time.",
+ fix: [fx("clip", [pt(fxOf(right) - 6, ph - 120, 0)], [1, 0, 0], { name: "Interlock arm", len: 40, dia: 30, on: `${fid(right)}SP` }), fx("screw", [-20, 20].map((z) => pt(fxOf(right) - 6, ph - 120, z)), [1, 0, 0], { len: 12, dia: 4, on: `${fid(right)}SP` })],
+ tools: ["screwdriver"],
+ },
+ { title: "Push it against the wall", detail: "Mark through the brackets, pull it away and drill.", tools: ["pencil", "drill"], warnings: ["wall"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Plugs into the wall, then a screw with a washer through each bracket. The plugs suit solid walls; use fixings made for your wall.",
+ fix: [
+ fx("plug", [-1, 1].map((g) => pt(g * (W / 2 - 200), ph - 25, -D / 2 - 35)), [0, 0, -1], { included: true }),
+ fx("washer", [-1, 1].map((g) => pt(g * (W / 2 - 200), ph - 25, -D / 2 - 7)), [0, 0, -1], { included: true }),
+ fx("screw", [-1, 1].map((g) => pt(g * (W / 2 - 200), ph - 25, -D / 2 - 5)), [0, 0, -1], { len: 50, dia: 5, included: true }),
+ ],
+ tools: ["screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ );
+ buildCustom(b, { ...s, custom: { parts, steps } });
+
+ const types = new Map<string, string>();
+ const groups = Array.from({ length: cols }, (_, c) =>
+ Array.from({ length: rows }, (_, r) => ankDrawer(b, { cx: bayX(c), yb: railY[r] + 15, ow: bayW, oh: railY[r + 1] - railY[r] - 30, zFace: D / 2, dd: D - 2 * PT - 30, strip: false, wire: true, runnerScrews: 2, types })),
+ );
+ const all = groups.flat();
+ ankDrawerSteps(b, all, { scene: "drawer" });
+ const KNOB = { kind: "knob" as const, len: 30, dia: 34 };
+ const KNOB_SCREW = { kind: "screw" as const, len: 25, dia: 4 };
+ const knobs = (d: (typeof all)[number]) => [-1, 1].map((g): FitOpts => ({ on: d.front, at: [d.cx + g * d.fw * 0.25, d.fy, D / 2 + 8], dir: [0, 0, -1], hole: false }));
+ const knobScrews = (d: (typeof all)[number]) => [-1, 1].map((g): FitOpts => ({ on: d.front, at: [d.cx + g * d.fw * 0.25, d.fy, D / 2 - 16], dir: [0, 0, 1] }));
+ b.step({ title: "Screw on the knobs", detail: "Two on every drawer front, the screws from inside.", kind: "screws", tools: ["screwdriver"], scene: "drawer" }, () => {
+ b.fits(KNOB, all.flatMap(knobs), 0.06);
+ b.then(0.05);
+ b.fits(KNOB_SCREW, all.flatMap(knobScrews), 0.05);
+ });
+ ankDrawersIn(b, groups, "Push the drawers in", "Onto their runners, all the way in, one at a time.");
+}
+
+const family: Family = {
+ names: ["KOPPANG"],
+ build(b, s) {
+ const slug = s.slug ?? "";
+ if (slug === "koppang-chest-3-drawers") return chest(b, s, 1), true;
+ if (slug === "koppang-chest-6-drawers") return chest(b, s, 2), true;
+ return false;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/kragsta.ts b/src/lib/plan/families/kragsta.ts
index e7bf81b..571d8fe 100644
--- a/src/lib/plan/families/kragsta.ts
+++ b/src/lib/plan/families/kragsta.ts
@@ -59,16 +59,16 @@ function recipe(s: ProductSpec): CustomParams {
const legBolt = (leg: string, lr: string, ax: Ax, sg: number) => fx("bolt", [P(ax, sg, rL(yLR) + q / 2, yLR)], inw(ax, sg), leg, { ...BOLT, mate: lr });
const camLocks = (ur: string, ax: Ax) => fx("cam", [-1, 1].map((sg) => P(ax, sg, inUR - 25, yUR + hUR / 2)), [0, -1, 0], ur, { dia: 15 });
const smallDowels = (ur: string, ax: Ax) => fx("dowel", [-1, 1].map((sg) => P(ax, sg, 150, yU)), [0, -1, 0], ur, { len: 30, dia: 8 });
- const topBolts = (ur: string, ax: Ax) => fx("bolt", [-1, 1].map((sg) => P(ax, sg, 220, yUR - hUR / 2)), [0, 1, 0], ur, BOLT);
- // frames wait beside the build until they go onto the top: the first in front, the second behind
+ const topBolts = (ur: string, ax: Ax) => fx("bolt", [-1, 1].map((sg) => P(ax, sg, 220, yUR - hUR / 2)), [0, 1, 0], ur, { ...BOLT, len: 80 });
+ // the first frame is built where it ends up and the top goes on under it; the second waits behind the build until it crosses the first
const f1 = ["L1", "L2", "UR1", "LR1"], f2 = ["L3", "L4", "UR2", "LR2"];
- const from = Object.fromEntries([...f1.map((id) => [id, [0, 0, 800]]), ...f2.map((id) => [id, [0, 0, -800]])]) as Record<string, Vec3>;
+ const from = Object.fromEntries([["L2", [800, 0, 0]], ...f2.map((id) => [id, [0, 0, -800]])]) as Record<string, Vec3>;
const steps: CustomStep[] = [
{
title: "Screw a cam pin into each leg",
detail: "Lay the four legs on a rug and screw the pins into the holes on their inner faces, by hand.",
fix: eachLeg(({ id, ax, sg }) => fx("camScrew", [P(ax, sg, rL(yUR) - q / 2, yUR)], out(ax, sg), id, { len: 24 })),
- wait: [...f1.slice(0, 2), ...f2.slice(0, 2)],
+ wait: ["L2", ...f2.slice(0, 2)],
from,
warnings: ["floor"],
},
@@ -79,11 +79,11 @@ function recipe(s: ProductSpec): CustomParams {
fix: eachLeg(({ id, ax, sg }) => fx("dowel", [P(ax, sg, r1, yU)], [0, -1, 0], id, { len: 40, dia: 10 })),
tools: ["hammer"],
},
- { title: "Push a cross dowel into a lower rail", detail: "Slot up, into the hole near one end. Its notch faces up.", fix: [crossDowel("LR1", "x", -1)], wait: ["LR1"], from },
+ { title: "Push a cross dowel into a lower rail", detail: "Slot up, into the hole near one end. Its notch faces up.", add: ["LR1"], fix: [crossDowel("LR1", "x", -1)], from: { LR1: [300, 0, 0] } },
{ title: "Bolt a leg to the lower rail", detail: "Through the leg into the rail's end, so it catches the cross dowel. Not fully tight yet.", fix: [legBolt("L1", "LR1", "x", -1)], tools: ["allen"] },
- { title: "Press two cam locks into an upper rail", detail: "One near each end, arrows towards the ends.", fix: [camLocks("UR1", "x")], wait: ["UR1"], from },
+ { title: "Press two cam locks into an upper rail", detail: "One near each end, arrows towards the ends.", fix: [camLocks("UR1", "x")], add: ["UR1"], from: { UR1: [300, 0, 0] } },
{ title: "Fit the upper rail onto the leg", detail: "Its end goes over the leg's cam pin. Turn the cam lock clockwise to pull it tight." },
- { title: "Fit the second leg on the other ends", detail: "Onto both rails' ends, then turn the cam lock." },
+ { title: "Fit the second leg on the other ends", detail: "Onto both rails' ends, then turn the cam lock.", add: ["L2"] },
{
title: "Bolt the second leg to the lower rail",
detail: "Cross dowel first, then the long bolt. Tighten both leg bolts now.",
@@ -94,11 +94,11 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Bolt the first frame to the top",
detail: "Lay the top upside down on a rug, stand the frame on it with the dowels in the holes, and screw the two long bolts through the rail into the top.",
- add: ["T", ...f1],
+ add: ["T"],
fix: [topBolts("UR1", "x")],
pose: "-y",
warnings: ["floor"],
- from: Object.fromEntries(f1.map((id) => [id, [0, -300, 0]])) as Record<string, Vec3>,
+ from: { T: [0, 300, 0] },
},
{ title: "Tap two dowels into the other upper rail", detail: "Along its top edge, as before.", fix: [smallDowels("UR2", "z")], wait: ["UR2"], from, tools: ["hammer"] },
{
diff --git a/src/lib/plan/families/kritter.ts b/src/lib/plan/families/kritter.ts
index d628564..209b8db 100644
--- a/src/lib/plan/families/kritter.ts
+++ b/src/lib/plan/families/kritter.ts
@@ -58,7 +58,7 @@ function chair(): CustomParams {
pose: "+x",
warnings: ["floor"],
},
- { title: "Set it onto a side frame", detail: "Lay one side frame flat, holes up, and lower the seat and top rail into its holes.", add: ["L"], from: { L: [0, 0, 300] } },
+ { title: "Set it onto a side frame", detail: "Lay one side frame flat, holes up, and lower the seat and top rail into its holes.", add: ["L"], from: { L: [-260, 0, 0] } },
{ title: "Lay the other side frame on top", detail: "Line up every hole and dowel before you press it down.", add: ["R"] },
{ title: "Screw this side on", detail: "Three screws through the frame: the top rail, the back and the front of the seat.", fix: [screws(1)], tools: ["allen"] },
{ title: "Turn it over and screw the other side", detail: "Three more screws, the same way.", fix: [screws(-1)], tools: ["allen"], pose: "-x" },
@@ -93,8 +93,8 @@ function table(s: ProductSpec): CustomParams {
const other = ["AR", "AB", "AL", "AF"];
const bx = ix - 14, bz = iz - 14;
const brackets: Vec3[] = corners.map(([sx, sz]) => [sx * bx, ya, sz * bz]);
- const longFace = iz + LT / 2 - AT; // inner face of a long rail
- const shortFace = ix + LT / 2 - AT;
+ const longFace = lz + LT / 2 - AT; // inner face of a long rail
+ const shortFace = lx + LT / 2 - AT;
const screwInto = (id: string, sx: number, sz: number): Vec3 => (id === "AF" || id === "AB" ? [sx * (ix - 28), ya, sz * longFace] : [sx * shortFace, ya, sz * (iz - 28)]);
const dirInto = (id: string, sx: number, sz: number): Vec3 => (id === "AF" || id === "AB" ? [0, 0, sz] : [sx, 0, 0]);
const SHORT = { kind: "screw" as const, len: 12, dia: 4 };
@@ -130,8 +130,9 @@ function table(s: ProductSpec): CustomParams {
len: 30,
dia: 4,
at: [
- ...[-1, 1].flatMap((sz) => [-1, 1].map((d): Vec3 => [d * ix * 0.5, H - TT - AH, sz * (iz + LT / 2 - AT / 2)])),
- ...[-1, 1].flatMap((sx) => [-1, 1].map((d): Vec3 => [sx * (ix + LT / 2 - AT / 2), H - TT - AH, d * iz * 0.5])),
+ // from the bottom of a deep counterbore, so the tip bites into the top
+ ...[-1, 1].flatMap((sz) => [-1, 1].map((d): Vec3 => [d * ix * 0.5, H - TT - 26, sz * (lz + LT / 2 - AT / 2)])),
+ ...[-1, 1].flatMap((sx) => [-1, 1].map((d): Vec3 => [sx * (lx + LT / 2 - AT / 2), H - TT - 26, d * iz * 0.5])),
],
dir: [0, 1, 0],
},
@@ -146,6 +147,7 @@ function table(s: ProductSpec): CustomParams {
...corners.map(([sx, sz]): CustomFix => ({ kind: "nut", name: "Cross dowel", count: 1, len: 20, dia: 10, at: [[sx * lx, H - TT - 30, sz * lz]], dir: [0, -1, 0], on: legId(sx, sz) })),
],
tools: ["flathead"],
+ wait: corners.map(([sx, sz]) => legId(sx, sz)),
},
{
title: "Push a wedge into each bracket",
diff --git a/src/lib/plan/families/krokholmen.ts b/src/lib/plan/families/krokholmen.ts
index 354d540..648feb6 100644
--- a/src/lib/plan/families/krokholmen.ts
+++ b/src/lib/plan/families/krokholmen.ts
@@ -25,6 +25,8 @@ function recipe(s: ProductSpec): CustomParams {
const L = Math.hypot(rf, yX + dy - yF), a = -Math.atan2(rf, yX + dy - yF);
pieces.push({ shape: "cyl", size: [tube, L, tube], pos: [(rf / 2) * c, (yF + yX + dy) / 2 - yc, (rf / 2) * sn], rot: [0, sx > 0 ? -phi : Math.PI - phi, a] });
}
+ // the flattened middle where the two tubes cross and are screwed together
+ pieces.push({ shape: "cyl", size: [tube + 8, tube, tube + 8], pos: [0, yX + dy - yc, 0] });
const ex = 2 * rf * Math.abs(Math.cos(phi)) + tube, ez = 2 * rf * Math.abs(Math.sin(phi)) + tube;
return { id, name: "Base tube", size: [ex, yT, ez], pos: [0, yc, 0], material: "metal", pieces };
};
diff --git a/src/lib/plan/families/kronoren.ts b/src/lib/plan/families/kronoren.ts
index a7bb560..cd8474a 100644
--- a/src/lib/plan/families/kronoren.ts
+++ b/src/lib/plan/families/kronoren.ts
@@ -140,9 +140,9 @@ function bedside(b: PlanBuilder, s: ProductSpec) {
const legs = [-1, 1].map((sz) => legId(sx, sz));
return {
feet: legs.map((id, i) => fx("glide", id, [0, 1, 0], [[sx * xl, 0, (i ? 1 : -1) * zl]], FOOT)),
- legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], [-8, 8].map((dz) => [sx * (xl - L / 2), yD, (i ? 1 : -1) * zl + dz] as Vec3), { mate: rd.id })),
+ legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], [-12, 12].map((dz) => [sx * (xl - L / 2), yD, (i ? 1 : -1) * zl + dz] as Vec3), { mate: rd.id })),
railDowels: [fx("dowel", rd.id, [-sx, 0, 0], [[sx * (xn - 10), yD, -40]]), fx("dowel", rs.id, [0, -1, 0], [[sx * xo, yS + 20, 0]], { mate: "S" })],
- drawerScrews: fx("screw", rd.id, [sx, 0, 0], [-1, 1].map((sz) => [sx * (xn - 10), yD, sz * zl] as Vec3), SCREW),
+ drawerScrews: fx("screw", rd.id, [sx, 0, 0], [-1, 1].map((sz) => [sx * (xn - 10), yD + 10, sz * zl] as Vec3), SCREW),
topScrews: fx("screw", rt.id, [-sx, 0, 0], [-1, 1].map((sz) => [sx * (xo + 10), yT, sz * zl] as Vec3), SCREW),
shelfScrews: fx("screw", rs.id, [-sx, 0, 0], [-1, 1].map((sz) => [sx * (xo + 10), yS, sz * zl] as Vec3), SCREW),
long: fx("screw", legId(sx, -1), [-sx, 0, 0], [[sx * (xl + L / 2), yB, -zl]], { ...LONG, mate: "BB" }),
@@ -307,7 +307,7 @@ function chest(b: PlanBuilder, s: ProductSpec) {
return {
legs,
feet: legs.map((id, i) => fx("glide", id, [0, 1, 0], [[sx * xl, 0, z(i)]], FOOT)),
- legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], [-10, 10].map((dz) => [sx * (xl - L / 2), yLo, z(i) + dz] as Vec3), { mate: ro.id })),
+ legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], [-12, 12].map((dz) => [sx * (xl - L / 2), yLo, z(i) + dz] as Vec3), { mate: ro.id })),
angles: legs.map((id, i) => fx("angle", id, [sx, 0, 0], [[sx * (xl - L / 2), yU - 20, z(i) - (i ? 30 : -30)]], ANGLE)),
angleScrews: legs.map((id, i) => fx("screw", id, [sx, 0, 0], [[sx * (xl - L / 2), yU - 30, z(i) - (i ? 30 : -30)]], SMALL)),
railDowels: [fx("dowel", rm.id, [0, -1, 0], [-1, 1].map((sz) => [sx * xn, yMid - 20, sz * (zl - 60)] as Vec3)), fx("dowel", ro.id, [0, -1, 0], [-1, 1].map((sz) => [sx * xn, yLo - 20, sz * (zl - 60)] as Vec3))],
@@ -337,7 +337,7 @@ function chest(b: PlanBuilder, s: ProductSpec) {
title: "Screw the back rail to one frame",
detail: "Stand the frame up and push the rail onto its back leg. Two long screws through the leg into it.",
add: ["BB"],
- fix: [fx("screw", legId(-1, -1), [1, 0, 0], [-10, 10].map((dy) => [-(xl + L / 2), yMid + dy, -zl] as Vec3), { ...LONG, mate: "BB" })],
+ fix: [fx("screw", legId(-1, -1), [1, 0, 0], [-12, 12].map((dy) => [-(xl + L / 2), yMid + dy, -zl] as Vec3), { ...LONG, mate: "BB" })],
tools: ["allen"],
},
{
@@ -472,9 +472,10 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
feet: legs.map((id, i) => fx("glide", id, [0, 1, 0], [[sx * xl, 0, ld(i ? 1 : -1)]], FOOT)),
bandDowels: [-1, 1].map((sz) => fx("dowel", band, [0, 0, sz], [-30, 30].map((dy) => [sx * xl, yBand + dy, sz * (zl - L / 2)] as Vec3), { len: 40, dia: 8, mate: legId(sx, sz) })),
bandScrews: [-1, 1].map((sz) => fx("screw", legId(sx, sz), [0, 0, -sz], (sz > 0 ? [-30, 30] : [0]).map((dy) => [sx * xl, yBand + dy, sz * (zl + L / 2)] as Vec3), { ...LONG, mate: band })),
- legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], yRail.map((y) => [sx * xi, y, ld(i ? 1 : -1)] as Vec3), { len: 30, dia: 6, mate: rails[0] })),
+ // a leg's dowel and the screw beside it sit apart across the leg, so neither lands on the other
+ legDowels: legs.map((id, i) => fx("dowel", id, [sx, 0, 0], yRail.map((y) => [sx * xi, y, ld(i ? 1 : -1) - (i ? 9 : -9)] as Vec3), { len: 30, dia: 6, mate: rails[0] })),
railDowels: rails.map((id, i) => fx("dowel", id, [0, -1, 0], [-1, 1].map((sz) => [sx * xn, yRail[i] - 15, sz * (zl - 70)] as Vec3), { len: 30, dia: 6 })),
- railScrews: rails.map((id, i) => fx("screw", id, [sx, 0, 0], [-1, 1].map((sz) => [sx * (xn - 10), yRail[i], ld(sz)] as Vec3), SCREW)),
+ railScrews: rails.map((id, i) => fx("screw", id, [sx, 0, 0], [-1, 1].map((sz) => [sx * (xn - 10), yRail[i], ld(sz) + sz * 9] as Vec3), SCREW)),
topScrews: (["TF", "TB"] as const).map((id) => fx("screw", legId(sx, id === "TF" ? 1 : -1), [-sx, 0, 0], [-20, 20].map((dz) => [sx * (xl + L / 2), H - 9, (id === "TF" ? 1 : -1) * (zl - 50 + L / 2) + dz] as Vec3), { ...LONG, mate: id })),
};
};
@@ -526,14 +527,14 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
title: "Screw on the upper shelf",
detail: "Rest it on the middle rails. Four screws up through each rail into it.",
add: ["S0"],
- fix: [-1, 1].map((sx) => fx("screw", `${side(sx)}R1`, [0, 1, 0], [-0.75, -0.25, 0.25, 0.75].map((f) => [sx * xn, yRail[1] - 15, f * (D - 60)] as Vec3), { ...SCREW, mate: "S0" })),
+ fix: [-1, 1].map((sx) => fx("screw", `${side(sx)}R1`, [0, 1, 0], [-0.75, -0.25, 0.25, 0.75].map((f) => [sx * xn, yRail[1] - 15, (f * (D - 60)) / 2] as Vec3), { ...SCREW, mate: "S0" })),
tools: ["allen"],
},
{
title: "Screw on the lower shelf",
detail: "The same way, on the bottom rails.",
add: ["S1"],
- fix: [-1, 1].map((sx) => fx("screw", `${side(sx)}R2`, [0, 1, 0], [-0.75, -0.25, 0.25, 0.75].map((f) => [sx * xn, yRail[2] - 15, f * (D - 60)] as Vec3), { ...SCREW, mate: "S1" })),
+ fix: [-1, 1].map((sx) => fx("screw", `${side(sx)}R2`, [0, 1, 0], [-0.75, -0.25, 0.25, 0.75].map((f) => [sx * xn, yRail[2] - 15, (f * (D - 60)) / 2] as Vec3), { ...SCREW, mate: "S1" })),
tools: ["allen"],
},
];
diff --git a/src/lib/plan/families/kullen.ts b/src/lib/plan/families/kullen.ts
new file mode 100644
index 0000000..d723ff7
--- /dev/null
+++ b/src/lib/plan/families/kullen.ts
@@ -0,0 +1,576 @@
+import type { Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
+import { HW, PlanBuilder, type FitOpts, type HwDef } from "../builder";
+import type { Family } from "./family";
+
+/*
+ * KULLEN chests, read from IKEA's manuals (2, 5 and 6 drawers).
+ *
+ * The carcass has no bottom: two sides (and the 6-drawer's divider) carry plastic runners, held apart by a plinth,
+ * a rail over each drawer (its recessed top edge is the grip) and, on the hardboard-backed chests, a rail across the
+ * back under the top. The runners go on first. The 2-drawer chest is built on a side lying flat, the 6-drawer on its
+ * front round the divider, the 5-drawer on a side with a back of three boards in grooves. The top takes cam bolts,
+ * goes on with dowels and cam locks, the hardboard back is nailed on with the chest on its front, and glides are
+ * tapped into the feet. The 5 and 6 drawer chests have an interlock (one drawer opens at a time) and a wall fixing.
+ * Each drawer is built on its front: dowels and cam bolts, the sides, cam locks, the bottom slid in, the back held
+ * with ribbed pins. Pushed in, each drawer gets two stop screws so it can't be pulled right out.
+ */
+
+const t = 16; // boards
+const P = 60; // plinth
+const G = 30; // the rail over each drawer
+const HB = 3; // hardboard back
+const range = (n: number) => Array.from({ length: n }, (_, i) => i);
+const LR = [-1, 1] as const;
+
+const RUNNER_SCREW: HwDef = { kind: "screw", len: 12, dia: 3.5 };
+const CONFIRMAT: HwDef = { kind: "screw", len: 50, dia: 7, name: "Connector screw" };
+const ROD_SCREW: HwDef = { kind: "screw", len: 13, dia: 4.2 };
+const BAR_SCREW: HwDef = { kind: "screw", len: 11, dia: 3.5 };
+const STOP: HwDef = { kind: "screw", len: 8, dia: 10, name: "Drawer stop" };
+const PIN: HwDef = { kind: "nail", len: 40, dia: 6, name: "Ribbed pin" };
+const GLIDE: HwDef = { kind: "glide", len: 6, dia: 40, name: "Glide" };
+const BAR: HwDef = { kind: "clip", len: 70, dia: 14, name: "Interlock bar" };
+const CAM_TOP: HwDef = { ...HW.cam, dia: 15 };
+const CAM_DRAWER: HwDef = { kind: "cam", len: 12, dia: 12 };
+const BRACKET_SCREW: HwDef = { kind: "screw", len: 16, dia: 4 };
+const WALL_SCREW: HwDef = { kind: "screw", len: 60, dia: 5 };
+const WALL_PLUG: HwDef = { kind: "plug", len: 35, dia: 8 };
+
+interface Cfg {
+ W: number;
+ H: number;
+ D: number;
+ cols: 1 | 2;
+ levels: number[]; // drawer heights from the bottom, the grip rail included
+ manual: 2 | 5 | 6;
+}
+
+function cfgOf(s: ProductSpec): Cfg | null {
+ const slug = s.slug ?? "";
+ // sizes from the manuals and IKEA's pages (the 5-drawer chest is 70 x 112)
+ if (slug === "kullen-chest-2-drawers") return { W: 350, H: 490, D: 400, cols: 1, levels: [236, 178], manual: 2 };
+ if (slug === "kullen-chest-5-drawers") return { W: 700, H: 1120, D: 400, cols: 1, levels: [228, 228, 228, 180, 180], manual: 5 };
+ if (slug === "kullen-chest-6-drawers") return { W: 1400, H: 720, D: 400, cols: 2, levels: [232, 232, 180], manual: 6 };
+ return null;
+}
+
+interface Drawer {
+ i: number; // level
+ c: number; // column centre
+ small: boolean;
+ y0: number; // bottom of the box sides
+ sh: number;
+ front: string;
+ sides: string[];
+ bottom: string;
+ back: string;
+ xo: number;
+ zBk: number;
+}
+
+function build(b: PlanBuilder, s: ProductSpec): boolean {
+ const c = cfgOf(s);
+ if (!c) return false;
+ const { W, H, D, cols, manual } = c;
+ const boards = manual === 5; // a back of boards in grooves instead of nailed hardboard
+ const zf = D / 2;
+ const xs = W / 2 - t / 2, xi = W / 2 - t; // side centres and inner faces
+ const Wb = cols === 1 ? W - 2 * t : (W - 3 * t) / 2;
+ const bays = cols === 1 ? [0] : [-(t / 2 + Wb / 2), t / 2 + Wb / 2];
+ const yT = H - t;
+ const backFront = boards ? -D / 2 + 18 : -D / 2 + HB + t; // the back's (or back rail's) front face
+ const rodZ = backFront + 6;
+ const backLimit = backFront + 14; // where the drawers stop
+ let pose: Pose = "+y";
+ const st = (o: { title: string; detail?: string; tools?: ToolId[]; pose?: Pose; scene?: string; kind?: StepKind; people?: 1 | 2; warnings?: WarnId[]; repeat?: number; wall?: boolean }, body: () => void) => {
+ const side = !!o.scene && o.scene !== "main";
+ if (o.pose && !side) pose = o.pose;
+ return b.step({ title: o.title, detail: o.detail, tools: o.tools ?? [], people: o.people ?? 1, pose: side ? (o.pose ?? "+y") : pose, warnings: o.warnings ?? [], kind: o.kind ?? "general", scene: o.scene, repeat: o.repeat, wall: o.wall }, body);
+ };
+
+ // ---------- parts ----------
+ const types = new Map<string, string>();
+ const part = (name: string, size: Vec3, o: { shape?: "box" | "cyl"; material?: "board" | "fiber" | "metal" } = {}) => {
+ const k = [name, ...size.map(Math.round), o.shape ?? "", o.material ?? ""].join("|");
+ if (!types.has(k)) types.set(k, b.part(name, size, o));
+ return types.get(k)!;
+ };
+ const Ds = boards ? D : D - HB;
+ const zs = boards ? 0 : HB / 2;
+ const sideT = part("Side panel", [t, yT, Ds]);
+ const sides = LR.map((g) => b.place(sideT, [g * xs, yT / 2, zs]));
+ const top = b.place(part("Top panel", [W, t, D]), [0, H - t / 2, 0]);
+ const zp = zf - 10 - t / 2;
+ const plinth = b.place(part("Plinth", [W - 2 * t, P, t]), [0, P / 2, zp]);
+ // level bottoms and tops
+ const lv: { y0: number; y1: number }[] = [];
+ let y = P;
+ for (const h of c.levels) {
+ lv.push({ y0: y, y1: y + h });
+ y += h;
+ }
+ const zg = zf - 22 - t / 2; // grip rails stand back from the fronts
+ const gripT = part("Front rail", [Wb, G, t]);
+ const grips = bays.map((cx) => lv.map((l) => b.place(gripT, [cx, l.y1 - G / 2, zg])));
+ const zbr = -D / 2 + HB + t / 2;
+ const backRail = boards ? "" : b.place(part("Back rail", [W - 2 * t, 80, t]), [0, yT - 40, zbr]);
+ let divider = "";
+ if (cols === 2) {
+ const zBackEdge = backFront, zFrontUp = zf - 2, zFrontLow = zp - t / 2;
+ const cp = b.compound("Divider", [
+ { shape: "box", size: [t, yT - P, zFrontUp - zBackEdge], pos: [0, P + (yT - P) / 2, (zFrontUp + zBackEdge) / 2] },
+ { shape: "box", size: [t, P, zFrontLow - zBackEdge], pos: [0, P / 2, (zFrontLow + zBackEdge) / 2] },
+ ]);
+ divider = b.place(cp.type, cp.mid);
+ }
+ // the back
+ const backParts: string[] = [];
+ let strip = "";
+ if (boards) {
+ const sH = 80, bh = (yT - sH) / 3, zb = -D / 2 + 14;
+ const boardT = part("Back board", [W - 2 * t + 16, bh, 8]);
+ for (const k of range(3)) backParts.push(b.place(boardT, [0, bh * k + bh / 2, zb]));
+ strip = b.place(part("Back strip", [W - 2 * t + 16, sH, 8]), [0, yT - sH / 2, zb]);
+ } else {
+ backParts.push(b.place(part("Back panel", [W - 2, yT - 2, HB], { material: "fiber" }), [0, yT / 2, -D / 2 + HB / 2]));
+ }
+ const rods = manual === 2 ? [] : bays.map((cx) => b.place(part("Interlock rod", [8, yT - P - 40, 8], { shape: "cyl", material: "metal" }), [cx - Wb / 2 + 8, P + (yT - P) / 2, rodZ]));
+
+ // drawers
+ const smallH = Math.min(...c.levels);
+ const drawers: Drawer[] = [];
+ for (const cx of bays) {
+ for (const [i, l] of lv.entries()) {
+ const fh = l.y1 - l.y0 - G - 4;
+ const sh = fh - 50;
+ const yb = l.y0 + 22;
+ const xo = Wb / 2 - 14;
+ const dd = zf - 16 - backLimit;
+ const small = c.levels[i] === smallH && c.levels.some((h) => h !== smallH);
+ const tag = small ? "Small" : c.levels.some((h) => h !== smallH) ? "Large" : "";
+ const name = (n: string) => (tag ? `${n} (${tag.toLowerCase()})` : n);
+ const zBk = zf - 16 - dd + 6;
+ drawers.push({
+ i,
+ c: cx,
+ small,
+ y0: yb,
+ sh,
+ xo,
+ zBk,
+ front: b.place(part(name("Drawer front"), [Wb - 4, fh, 16]), [cx, l.y1 - G - 2 - fh / 2, zf - 8]),
+ sides: LR.map((g) => b.place(part(name("Drawer side"), [12, sh, dd]), [cx + g * xo, yb + sh / 2, zf - 16 - dd / 2])),
+ bottom: b.place(part(name("Drawer bottom"), [2 * xo, 3, dd - 4], { material: "fiber" }), [cx, yb + 12, zf - 16 - dd / 2 - 2]),
+ back: b.place(part(name("Drawer back"), [2 * xo - 12, sh - 16, 12]), [cx, yb + 16 + (sh - 16) / 2, zBk]),
+ });
+ }
+ }
+
+ // ---------- fittings ----------
+ const dz = (len: number) => [-len / 2 + 30, len / 2 - 30];
+ const runLen = Math.round((zf - 16 - backLimit - 40) / 10) * 10;
+ const RUNNER: HwDef = { kind: "runner", len: runLen, dia: 20 };
+ const zRun = zf - 30 - runLen / 2;
+ /** Runners on a panel face at x, facing the bay on side -g of the face (g points into the panel). */
+ const runnersOn = (panel: string, x: number, g: number) => {
+ b.fits(RUNNER, lv.map((l): FitOpts => ({ on: panel, at: [x, l.y0 + 22 + 30, zRun], dir: [g, 0, 0], hole: false })), 0.12);
+ b.fits(RUNNER_SCREW, lv.flatMap((l) => dz(runLen).map((d): FitOpts => ({ on: panel, at: [x - g * 2, l.y0 + 52, zRun + d], dir: [g, 0, 0] }))), 0.03);
+ };
+ const sideScene = (title: string, detail: string) =>
+ st({ title, detail, tools: ["screwdriver"], scene: "prep", kind: "runners", warnings: ["floor"], pose: "+y" }, () => {
+ b.stagger(0.2);
+ b.stage(sides[0], [0, t / 2, -(D / 2 + 60)], [0, 0, Math.PI / 2], [0, 160, 0]);
+ b.stage(sides[1], [0, t / 2, D / 2 + 60], [0, 0, -Math.PI / 2], [0, 160, 0]);
+ b.then(0.2);
+ runnersOn(sides[0], -xi, -1);
+ runnersOn(sides[1], xi, 1);
+ });
+ /** Rails laid out flat in their own scene. */
+ const railScene = (title: string, detail: string, rails: string[], dowels: FitOpts[]) =>
+ st({ title, detail, tools: ["hammer"], scene: "rails", kind: "dowels", pose: "+y" }, () => {
+ b.stagger(0.12);
+ rails.forEach((k, n) => {
+ const it = b.partItem(k);
+ const h = it.final.pos;
+ b.stage(k, [h[0], t / 2, (n - (rails.length - 1) / 2) * 140], [Math.PI / 2, 0, 0], [0, 140, 0]);
+ });
+ b.then(0.15);
+ b.fits(HW.dowel, dowels, 0.04);
+ });
+ /** Dowels in the ends of a rail at its middle height: n per end, into the sides (or the divider). */
+ const railDowels = (rail: string, n: number, ends: { x: number; g: number }[], mate: (g: number) => string): FitOpts[] => {
+ const it = b.partItem(rail);
+ const [, ry, rz] = it.final.pos;
+ const h = b.parts.find((p) => p.id === it.ref)!.size[1];
+ const ys = n === 1 ? [ry] : n === 2 ? [ry - h / 4, ry + h / 4] : [ry - h / 3, ry, ry + h / 3];
+ return ends.flatMap(({ x, g }) => ys.map((yy): FitOpts => ({ on: rail, at: [x, yy, rz], dir: [-g, 0, 0], mate: mate(g) })));
+ };
+ const toSides = (g: number) => sides[g < 0 ? 0 : 1];
+ const sideEnds = LR.map((g) => ({ x: g * xi, g }));
+ const confirmats = (rails: string[], which: number[] = [0, 1]) =>
+ rails.flatMap((r) => which.map((i): FitOpts => {
+ const p = b.partItem(r).final.pos;
+ const g = LR[i];
+ return { on: sides[i], at: [g * W / 2, p[1], p[2]], dir: [-g, 0, 0], mate: r };
+ }));
+ const allGrips = grips.flat();
+
+ // the top: cam bolts underneath, dowels in the sides' (and divider's) top edges, cam locks
+ const panelsUp = cols === 2 ? [{ k: sides[0], x: -xs, g: -1 }, { k: divider, x: 0, g: 1 }, { k: sides[1], x: xs, g: 1 }] : [{ k: sides[0], x: -xs, g: -1 }, { k: sides[1], x: xs, g: 1 }];
+ const nTop = manual === 2 ? 1 : 2;
+ const camZ = nTop === 1 ? [-D / 2 + 70] : [-D / 2 + 70, zf - 70];
+ const dowelZ = nTop === 1 ? [zf - 60] : [-D / 6, D / 6];
+ const topBolts = panelsUp.flatMap((p) => camZ.map((z): FitOpts => ({ on: top, at: [p.x, yT, z], dir: [0, 1, 0], mate: p.k, mateHole: 4 })));
+ const topDowels = panelsUp.flatMap((p) => dowelZ.map((z): FitOpts => ({ on: p.k, at: [p.x, yT, z], dir: [0, -1, 0], mate: top })));
+ const topCams = panelsUp.flatMap((p) => camZ.map((z): FitOpts => ({ on: p.k, at: [p.x - p.g * (t / 2), yT - 25, z], dir: [p.g, 0, 0] })));
+ const wallX = [-(xi - 60), xi - 60];
+ const topScene = (body: () => void, title = "Screw the cam bolts into the top", detail = "Lay the top upside down on something soft.") =>
+ st({ title, detail, tools: ["screwdriver"], scene: "top", kind: "cams", warnings: ["face"], pose: "+y" }, () => {
+ b.stage(top, [0, t / 2, 0], [0, 0, Math.PI], [0, 160, 0]);
+ b.then(0.15);
+ body();
+ });
+ const topSteps = (pos: Pose, from: Vec3) => {
+ topScene(() => b.fits(HW.camScrew, topBolts, 0.1));
+ if (manual !== 2)
+ topScene(
+ () => {
+ b.fits(HW.bracket, wallX.map((x): FitOpts => ({ on: top, at: [x, yT, -D / 2 + 30], dir: [0, 1, 0], hole: false })), 0.2);
+ b.fits(HW.washer, wallX.map((x): FitOpts => ({ on: top, at: [x, yT - 3, -D / 2 + 30], dir: [0, 1, 0], hole: false })), 0.15);
+ b.fits(BRACKET_SCREW, wallX.map((x): FitOpts => ({ on: top, at: [x, yT - 4, -D / 2 + 30], dir: [0, 1, 0] })), 0.15);
+ },
+ "Screw the wall brackets under the top",
+ "One at each back corner, with a washer under the screw. Leave them a little loose.",
+ );
+ st({ title: manual === 2 ? "Tap a dowel into each side's top edge" : "Tap the dowels into the top edges", detail: cols === 2 ? "Two in each side and two in the divider." : manual === 2 ? "Near the front corner." : "Two in each side.", tools: ["hammer"], kind: "dowels", pose: pos }, () =>
+ b.fits(HW.dowel, topDowels, 0.1),
+ );
+ st({ title: "Put the top on", detail: "Push it onto the dowels and cam bolts.", kind: "join", people: W > 1000 ? 2 : 1 }, () => b.add(top, from));
+ st({ title: "Lock the top with cam locks", detail: "Arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM_TOP, topCams, 0.1));
+ };
+
+ const nailBack = () => {
+ const back = backParts[0];
+ const xN = W / 2 - t / 2, yN = yT - 40;
+ const corners: Vec3[] = [
+ [-xN, 20, -D / 2],
+ [xN, yN, -D / 2],
+ [-xN, yN, -D / 2],
+ [xN, 20, -D / 2],
+ ];
+ const on = (p: Vec3): FitOpts => ({ on: back, at: p, dir: [0, 0, 1] });
+ st({ title: "Lay the back panel on", detail: "Smooth side out, lined up with the sides along one edge.", kind: "join", pose: "-z" }, () => b.add(back, [0, 0, -300]));
+ st({ title: "Nail one corner", detail: "Line the panel up with the corner marks first. Hold the nail with the nail holder.", tools: ["hammer"], kind: "nails" }, () => b.fits(HW.nail, [on(corners[0])], 0.2));
+ st({ title: manual === 6 ? "Square it up and nail the other corners" : "Square it up and nail two more corners", detail: "Push the carcass until the panel lines up with every edge.", tools: ["hammer"], kind: "nails", warnings: ["square"] }, () =>
+ b.fits(HW.nail, corners.slice(1, manual === 6 ? 4 : 3).map(on), 0.2),
+ );
+ // the rest round the edges (and down the divider)
+ const pts: Vec3[] = [];
+ const edge = (n: number, x0: number, x1: number, y0: number, y1: number) => range(n).forEach((k) => pts.push([x0 + ((x1 - x0) * (k + 1)) / (n + 1), y0 + ((y1 - y0) * (k + 1)) / (n + 1), -D / 2]));
+ const rest = manual === 6 ? 50 : 25;
+ const mid = manual === 6 ? 12 : 0;
+ const left = rest - mid;
+ const ySide = Math.round(left * 0.3), xEdge = Math.round((left - 2 * ySide) / 2);
+ edge(ySide, -xN, -xN, 20, yN);
+ edge(ySide, xN, xN, 20, yN);
+ edge(xEdge, -xN, xN, yN, yN);
+ edge(left - 2 * ySide - xEdge, -xN, xN, P / 2, P / 2);
+ if (mid) edge(mid, 0, 0, 20, yN);
+ st({ title: "Nail the rest of the back", detail: mid ? "Every 10 cm or so round the edges, and a row down the divider." : "Every 10 cm or so round the edges and along the plinth.", tools: ["hammer"], kind: "nails" }, () => b.fits(HW.nail, pts.map(on), 0.02));
+ };
+ const panelsAll = cols === 2 ? [{ k: sides[0], x: -xs }, { k: divider, x: 0 }, { k: sides[1], x: xs }] : [{ k: sides[0], x: -xs }, { k: sides[1], x: xs }];
+ const glides = (pos: Pose) =>
+ st({ title: "Tap the glides into the feet", detail: cols === 2 ? "Two under each side and two under the divider." : "Two under each side, front and back.", tools: ["hammer"], kind: "general", pose: pos }, () =>
+ b.fits(GLIDE, panelsAll.flatMap((p) => [-D / 2 + 50, zf - 50].map((z): FitOpts => ({ on: p.k, at: [p.x, 0, z], dir: [0, 1, 0] }))), 0.1),
+ );
+ const rodSteps = () =>
+ st({ title: cols === 2 ? "Fit the interlock rods" : "Fit the interlock rod", detail: "It runs up the back of the drawer space. Two screws through each end into the side.", tools: ["screwdriver"], kind: "screws" }, () => {
+ for (const [k, cx] of bays.entries()) {
+ b.add(rods[k], [0, 0, -260]);
+ b.then(0.1);
+ const x = cx - Wb / 2;
+ const yr = b.partItem(rods[k]).final.pos[1], hr = yT - P - 40;
+ b.fits(ROD_SCREW, [yr - hr / 2 + 10, yr - hr / 2 + 30, yr + hr / 2 - 30, yr + hr / 2 - 10].map((yy): FitOpts => ({ on: sides[k], at: [x + 2, yy, rodZ], dir: [-1, 0, 0] })), 0.08);
+ }
+ });
+ const wallSteps = () => {
+ const wy = yT - 50;
+ st({ title: "Stand it up against the wall and mark through the brackets", detail: "Loosen the bracket screws, slide the brackets out against the wall and mark through the slots.", tools: ["screwdriver", "pencil"], pose: "+y", kind: "anchor", wall: true, warnings: ["wall", "tip"], people: 2 }, () => {});
+ st({ title: "Drill the holes and push in the plugs", detail: "Move the chest away first. Use fixings made for your wall if it isn't solid.", tools: ["drill", "hammer"], kind: "anchor", wall: true, warnings: ["wall"] }, () =>
+ b.fits(WALL_PLUG, wallX.map((x) => ({ at: [x, wy, -D / 2 - 1] as Vec3, dir: [0, 0, -1] as Vec3 })), 0.2),
+ );
+ st({ title: "Screw it to the wall", detail: "A washer on each screw, through the bracket slot. Then tighten the bracket screws.", tools: ["screwdriver"], kind: "anchor", wall: true, warnings: ["tip"] }, () => {
+ b.fits(HW.washer, wallX.map((x) => ({ at: [x, wy, -D / 2 + 6] as Vec3, dir: [0, 0, -1] as Vec3 })), 0.15);
+ b.fits(WALL_SCREW, wallX.map((x) => ({ at: [x, wy, -D / 2 + 8] as Vec3, dir: [0, 0, -1] as Vec3 })), 0.2);
+ });
+ };
+
+ // ---------- the carcass, as each manual does it ----------
+ const gripsOf = (bay: number) => grips[bay];
+ if (manual === 2) {
+ sideScene("Screw the runners onto both sides", "Lay the sides on something soft, inside up. Two screws in each runner, its pegs in the holes.");
+ const [low, high] = gripsOf(0);
+ railScene("Tap the dowels into the rails", "Two in each end of the plinth and the top front rail, one in each end of the others.", [plinth, high, backRail, low], [
+ ...railDowels(plinth, 2, sideEnds, toSides),
+ ...railDowels(high, 2, sideEnds, toSides),
+ ...railDowels(backRail, 1, sideEnds, toSides),
+ ...railDowels(low, 1, sideEnds, toSides),
+ ]);
+ st({ title: "Lay a side down and stand two rails in it", detail: "The plinth and the back rail, raw edges hidden inside.", pose: "+x", kind: "join", warnings: ["floor"] }, () => {
+ b.add(sides[0], [-200, 0, 0]);
+ b.then(0.15);
+ b.add(plinth, [300, 0, 0]);
+ b.add(backRail, [300, 0, 0]);
+ });
+ st({ title: "Stand the front rails in it", detail: "The finished edge of each faces the front.", kind: "join" }, () => {
+ b.add(low, [300, 0, 0]);
+ b.add(high, [300, 0, 0]);
+ });
+ st({ title: "Put the other side on", detail: "Press it down onto all the dowels.", kind: "join" }, () => b.add(sides[1], [300, 0, 0]));
+ st({ title: "Turn it onto its front and screw the sides on", detail: "One connector screw through each side into the plinth and one into the back rail, with the Allen key.", pose: "-z", tools: ["allen"], kind: "screws", warnings: ["floor"] }, () =>
+ b.fits(CONFIRMAT, confirmats([plinth, backRail]), 0.12),
+ );
+ st({ title: "Screw the cam bolts into the top", detail: "Lay the top upside down on something soft. One at each back corner.", tools: ["screwdriver"], scene: "top", kind: "cams", warnings: ["face"] }, () => {
+ b.stage(top, [0, t / 2, 0], [0, 0, Math.PI], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(HW.camScrew, topBolts, 0.1);
+ });
+ st({ title: "Tap a dowel into each side's top edge", detail: "Near the front corner.", tools: ["hammer"], kind: "dowels" }, () => b.fits(HW.dowel, topDowels, 0.1));
+ st({ title: "Put the top on", detail: "Push it onto the dowels and cam bolts.", kind: "join" }, () => b.add(top, [0, 300, 0]));
+ st({ title: "Lock the top with cam locks", detail: "Arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM_TOP, topCams, 0.1));
+ nailBack();
+ glides("-z");
+ } else if (manual === 6) {
+ const divX = (g: number) => g * (t / 2);
+ const plinthStud: FitOpts = { on: divider, at: [0, P / 2, zp - t / 2], dir: [0, 0, 1], mate: plinth, mateHole: 4 };
+ const railStud: FitOpts = { on: divider, at: [0, yT - 40, zbr + t / 2], dir: [0, 0, 1], mate: backRail, mateHole: 4 };
+ st({ title: "Screw two cam bolts into the divider", detail: "Lay it flat. One at the bottom front corner, one at the top back corner.", tools: ["screwdriver"], scene: "divider", kind: "cams", warnings: ["floor"] }, () => {
+ b.stage(divider, [0, t / 2, 0], [0, 0, Math.PI / 2], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(HW.camScrew, [plinthStud, { ...railStud, dir: [0, 0, -1] }], 0.12);
+ });
+ st({ title: "Screw the runners onto the divider", detail: "Three runners, two screws in each, pegs in the holes.", tools: ["screwdriver"], scene: "divider", kind: "runners" }, () => runnersOn(divider, t / 2, -1));
+ st({ title: "Turn it over and do the other face", detail: "Three more runners.", tools: ["screwdriver"], scene: "divider", kind: "runners" }, () => {
+ b.stage(divider, [0, t / 2, 0], [0, 0, -Math.PI / 2], [0, 200, 0]);
+ b.then(0.15);
+ runnersOn(divider, -t / 2, 1);
+ });
+ st({ title: "Stand the divider on the plinth", detail: "Lay the plinth flat on the floor, front down, and push the divider's bolt into its hole.", pose: "-z", kind: "join", warnings: ["floor"] }, () => {
+ b.add(plinth, [0, 0, 200]);
+ b.then(0.15);
+ b.add(divider, [0, 0, -300]);
+ });
+ st({ title: "Lock it with a cam lock", detail: "In the plinth's top edge, arrow towards the bolt, then turn.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM_TOP, [{ on: plinth, at: [0, P, zp], dir: [0, -1, 0] }], 0.1));
+ railScene("Tap the dowels into the front rails", "Two in each end of all six.", allGrips, allGrips.flatMap((r) => {
+ const cx = b.partItem(r).final.pos[0];
+ const gs = Math.sign(cx);
+ return railDowels(r, 2, [{ x: gs * xi, g: gs }, { x: divX(gs), g: -gs }], (g) => (g === gs ? toSides(gs) : divider));
+ }));
+ st({ title: "Push three rails onto the divider", detail: "On the left, finished edges towards the floor.", kind: "join" }, () => {
+ b.stagger(0.18);
+ for (const r of gripsOf(0)) b.add(r, [-300, 0, 0]);
+ });
+ st({ title: "Put the back rail on the divider", detail: "Across the top of the divider, over its cam bolt.", kind: "join" }, () => b.add(backRail, [0, 0, -300]));
+ st({ title: "Lock it with a cam lock", detail: "In the rail's top edge.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM_TOP, [{ on: backRail, at: [0, yT, zbr], dir: [0, -1, 0] }], 0.1));
+ st({ title: "Push on the other three rails and tap in the long rails' dowels", detail: "One dowel in each end of the plinth and the back rail.", tools: ["hammer"], kind: "dowels" }, () => {
+ b.stagger(0.18);
+ for (const r of gripsOf(1)) b.add(r, [300, 0, 0]);
+ b.then(0.15);
+ b.fits(HW.dowel, [...railDowels(plinth, 1, sideEnds, toSides), ...railDowels(backRail, 1, sideEnds, toSides)], 0.08);
+ });
+ sideScene("Screw the runners onto the sides", "Lay both sides inside up. Three runners on each, two screws in each runner.");
+ st({ title: "Put the left side on", detail: "Push it onto the dowels of all the rails.", kind: "join" }, () => b.add(sides[0], [-300, 0, 0]));
+ st({ title: "Screw it to the plinth and the back rail", detail: "Two connector screws, with the Allen key.", tools: ["allen"], kind: "screws" }, () => b.fits(CONFIRMAT, confirmats([plinth, backRail], [0]), 0.12));
+ st({ title: "Put the right side on", detail: "The same way.", kind: "join" }, () => b.add(sides[1], [300, 0, 0]));
+ st({ title: "Screw it on too", detail: "Two more connector screws.", tools: ["allen"], kind: "screws" }, () => b.fits(CONFIRMAT, confirmats([plinth, backRail], [1]), 0.12));
+ rodSteps();
+ topSteps("-z", [0, 300, 0]);
+ nailBack();
+ glides("-z");
+ wallSteps();
+ } else {
+ // the 5-drawer chest
+ const [g0, g1, g2, g3, g4] = gripsOf(0);
+ sideScene("Screw the runners onto both sides", "Lay the sides on something soft, inside up. Five runners on each, two screws in each.");
+ const camRails = [plinth, g4, g2, strip];
+ const sideBolts = camRails.flatMap((r) => LR.map((g, i): FitOpts => {
+ const p = b.partItem(r).final.pos;
+ return { on: sides[i], at: [g * xi, p[1], p[2]], dir: [g, 0, 0], mate: r, mateHole: 4 };
+ }));
+ st({ title: "Screw the cam bolts into the sides", detail: "Four in each side, in the holes along the front and the back.", tools: ["screwdriver"], scene: "prep", kind: "cams" }, () => b.fits(HW.camScrew, sideBolts, 0.08));
+ const rails = [plinth, g0, g1, g2, g3, g4];
+ railScene("Tap the dowels into the rails", "Two in each end of the plinth and the two top rails, one in each end of the others.", rails, [
+ ...railDowels(plinth, 2, sideEnds, toSides),
+ ...railDowels(g4, 2, sideEnds, toSides),
+ ...railDowels(g3, 2, sideEnds, toSides),
+ ...[g0, g1, g2].flatMap((r) => railDowels(r, 1, sideEnds, toSides)),
+ ]);
+ st({ title: "Lay a side down and stand the top rail in it", detail: "On something soft. Finished edge to the front.", pose: "+x", kind: "join", warnings: ["floor"] }, () => {
+ b.add(sides[0], [-200, 0, 0]);
+ b.then(0.15);
+ b.add(g4, [300, 0, 0]);
+ });
+ st({ title: "Stand the other rails in it", detail: "The plinth at the bottom, the rails between.", kind: "join" }, () => {
+ b.stagger(0.15);
+ for (const r of [g3, g2, g1, g0, plinth]) b.add(r, [300, 0, 0]);
+ });
+ const backDowels = [...backParts, strip].flatMap((k, n) => railDowels(k, n < 3 ? 2 : 1, LR.map((g) => ({ x: g * (xi + 4), g })), toSides));
+ st({ title: "Tap the dowels into the back boards", detail: "Two in each end of the three boards, one in each end of the strip.", tools: ["hammer"], scene: "back", kind: "dowels" }, () => {
+ b.stagger(0.12);
+ [...backParts, strip].forEach((k, n) => b.stage(k, [0, 4, (n - 1.5) * 300], [Math.PI / 2, 0, 0], [0, 140, 0]));
+ b.then(0.15);
+ b.fits(HW.dowel, backDowels, 0.04);
+ });
+ st({ title: "Slide the back boards into the groove", detail: "Bottom board first, then the others and the strip at the top.", kind: "join" }, () => {
+ b.stagger(0.2);
+ for (const k of [...backParts, strip]) b.add(k, [300, 0, 0]);
+ });
+ st({ title: "Put the other side on", detail: "Together: one on each end, pressing it down onto every dowel and bolt.", people: 2, kind: "join" }, () => b.add(sides[1], [300, 0, 0]));
+ const railCams = camRails.flatMap((r) => LR.map((g): FitOpts => {
+ const p = b.partItem(r).final.pos;
+ const back = r === strip ? 4 : t / 2;
+ return { on: r, at: [g * (xi - 30), p[1], p[2] - back], dir: [0, 0, 1] };
+ }));
+ st({ title: "Lock the cam locks", detail: "Eight in all, on the inside of the rails. Arrow towards the bolt, then turn.", tools: ["screwdriver"], kind: "cams" }, () => b.fits(CAM_TOP, railCams, 0.06));
+ st({ title: "Lay it on its back and screw in the bottom rail", detail: "One connector screw through each side into the lowest front rail.", pose: "+z", tools: ["allen"], kind: "screws", warnings: ["floor"] }, () => b.fits(CONFIRMAT, confirmats([g0]), 0.12));
+ glides("+z");
+ st({ title: "Stand it up", detail: "Lift it onto its feet.", pose: "+y", kind: "standup" }, () => {});
+ rodSteps();
+ topSteps("+y", [0, 300, 0]);
+ wallSteps();
+ }
+
+ // ---------- drawers ----------
+ const c0 = (d: Drawer): Vec3 => [d.c, d.y0 + d.sh / 2, zf - 16 - (zf - 16 - backLimit) / 2];
+ const fitsOf = (d: Drawer) => {
+ const nd = d.small ? 1 : 2;
+ const per = (fn: (g: number, sd: string) => FitOpts[]) => LR.flatMap((g, i) => fn(g, d.sides[i]));
+ const ys = nd === 1 ? [d.y0 + d.sh / 2] : [d.y0 + d.sh * 0.35, d.y0 + d.sh * 0.65];
+ return {
+ dowels: per((g, sd) => ys.map((yy): FitOpts => ({ on: sd, at: [d.c + g * d.xo, yy, zf - 16], dir: [0, 0, -1], mate: d.front }))),
+ bolts: per((g, sd) => [{ on: d.front, at: [d.c + g * d.xo, d.y0 + (nd === 1 ? 25 : d.sh / 2), zf - 16], dir: [0, 0, 1], mate: sd, mateHole: 4 }]),
+ cams: per((g) => [{ on: d.sides[g < 0 ? 0 : 1], at: [d.c + g * (d.xo - 6), d.y0 + (nd === 1 ? 25 : d.sh / 2), zf - 46], dir: [g, 0, 0] }]),
+ pins: per((g, sd) => [0.25, 0.75].map((k): FitOpts => ({ on: sd, at: [d.c + g * (d.xo + 6), d.y0 + 16 + (d.sh - 16) * k, d.zBk], dir: [-g, 0, 0], mate: d.back, mateHole: 3 }))),
+ bar: [{ on: d.sides[0], at: [d.c - d.xo, d.y0, d.zBk + 30], dir: [0, 1, 0], hole: false }] as FitOpts[],
+ barScrews: [-6, 66].map((dz2): FitOpts => ({ on: d.sides[0], at: [d.c - d.xo, d.y0 + 1, d.zBk + dz2], dir: [0, 1, 0] })),
+ stops: per((g, sd) => [{ on: sd, at: [d.c + g * d.xo, d.y0 + d.sh, d.zBk + 40], dir: [0, -1, 0] }]),
+ };
+ };
+ const groups: Drawer[][] = [];
+ for (const d of drawers) {
+ const gIdx = groups.findIndex((g) => g[0].small === d.small);
+ if (gIdx < 0) groups.push([d]);
+ else groups[gIdx].push(d);
+ }
+ // the 2-drawer manual builds its two drawers side by side, the 5-drawer both kinds side by side, the 6-drawer
+ // the small ones first and then the large ones
+ groups.sort((a, b2) => (a[0].small === b2[0].small ? 0 : a[0].small ? -1 : 1));
+ const batches: Drawer[][][] = manual === 6 ? groups.map((g) => [g]) : [groups];
+ const firsts = new Set<Drawer>();
+ for (const [bi, batch] of batches.entries()) {
+ const scene = `drawers${bi}`;
+ const shown = batch.map((g) => g[0]);
+ shown.forEach((d) => firsts.add(d));
+ const ox = (n: number) => (n - (shown.length - 1) / 2) * (Wb + 160);
+ const stage = (d: Drawer, n: number, k: string, from?: Vec3, away = 0) => {
+ const it = b.partItem(k);
+ const m = c0(d);
+ b.stage(k, [it.final.pos[0] - m[0] + ox(n), it.final.pos[1] - m[1], it.final.pos[2] - m[2] - away], it.final.rot, from);
+ };
+ const counts = batch.map((g) => g.length);
+ const total = counts.reduce((a, n) => a + n, 0);
+ const what =
+ batch.length === 1
+ ? total > 1
+ ? `Build all ${total} ${batch[0][0].small ? "small" : "large"} drawers this way.`
+ : ""
+ : batch.map((g) => `${g.length} ${g[0].small ? "small" : "large"}`).join(" and ");
+ const say = (s1: string) => (batch.length > 1 && total > 2 ? `${s1} Build ${what} drawers the same way.` : batch.length === 1 && what ? `${s1} ${what}` : s1);
+ const rep = batch.length === 1 && total > 1 ? total : undefined;
+ const dst = (title: string, detail: string, body: () => void, o: { tools?: ToolId[]; kind?: StepKind; pose?: Pose } = {}) =>
+ st({ title, detail: say(detail), tools: o.tools, scene, pose: o.pose ?? "-z", repeat: rep, kind: o.kind ?? "drawer" }, body);
+ const fx = shown.map(fitsOf);
+ dst(
+ "Tap the dowels into the drawer sides",
+ shown.length > 1 ? "Into the front end of each side: one each for the small drawer, two for the large one." : shown[0].small ? "One in the front end of each side." : "Two in the front end of each side.",
+ () => {
+ b.stagger(0.15);
+ shown.forEach((d, n) => d.sides.forEach((k) => stage(d, n, k, [0, 160, 0], 320)));
+ b.then(0.15);
+ for (const f of fx) b.fits(HW.dowel, f.dowels, 0.08);
+ },
+ { tools: ["hammer"], kind: "dowels", pose: "+y" },
+ );
+ dst(
+ "Screw the cam bolts into the drawer front",
+ "Lay the front face down on something soft. One near each end.",
+ () => {
+ shown.forEach((d, n) => stage(d, n, d.front, [0, 0, -160]));
+ b.then(0.15);
+ for (const f of fx) b.fits(HW.camScrew, f.bolts, 0.1);
+ },
+ { tools: ["screwdriver"], kind: "cams" },
+ );
+ dst("Stand the sides on the front", "Grooves facing out, onto the dowels and bolts.", () => {
+ b.stagger(0.15);
+ shown.forEach((d, n) => d.sides.forEach((k) => stage(d, n, k)));
+ }, { kind: "join" });
+ dst("Lock the sides with cam locks", "One in each side, arrow towards the bolt, then turn.", () => {
+ for (const f of fx) b.fits(CAM_DRAWER, f.cams, 0.12);
+ }, { tools: ["screwdriver"], kind: "cams" });
+ dst("Slide in the drawer bottom", "Smooth side up, down the grooves until it reaches the front.", () => shown.forEach((d, n) => stage(d, n, d.bottom, [0, 0, -420])));
+ dst("Put the drawer back on", "Its lower edge goes over the bottom.", () => shown.forEach((d, n) => stage(d, n, d.back, [0, 0, -260])), { kind: "join" });
+ dst("Tap in the ribbed pins", "Two through each side into the back.", () => {
+ for (const f of fx) b.fits(PIN, f.pins, 0.1);
+ }, { tools: ["hammer"], kind: "nails" });
+ if (manual !== 2)
+ dst("Turn it over and fit the interlock bar", "Under the back of the drawer on the left: one screw, clip the bar on, turn it, then the screw in its bracket.", () => {
+ for (const f of fx) {
+ b.fits(BAR, f.bar, 0.2);
+ b.then(0.1);
+ b.fits(BAR_SCREW, f.barScrews, 0.15);
+ }
+ }, { tools: ["screwdriver"], kind: "screws", pose: "-y" });
+ }
+ const presetFits = (d: Drawer) => {
+ const f = fitsOf(d);
+ const list: [HwDef, FitOpts[]][] = [
+ [HW.dowel, f.dowels],
+ [HW.camScrew, f.bolts],
+ [CAM_DRAWER, f.cams],
+ [PIN, f.pins],
+ ];
+ if (manual !== 2) list.push([BAR, f.bar], [BAR_SCREW, f.barScrews]);
+ for (const [def, l] of list) for (const op of l) b.preset(def, op);
+ };
+ const slide = (d: Drawer) => {
+ b.stagger(0);
+ for (const k of [d.front, ...d.sides, d.bottom, d.back]) b.add(k, [0, -40, 520]);
+ if (!firsts.has(d)) presetFits(d);
+ b.wait(0.25);
+ };
+ // the drawers go in from the bottom up
+ const order = [...drawers].sort((a, b2) => a.i - b2.i || a.c - b2.c);
+ if (manual === 2) {
+ for (const d of order) {
+ st({ title: d.i === 0 ? "Stand it up and push in the large drawer" : "Push in the small drawer", detail: "Tilt it, set the back onto the runners and push it in.", pose: "+y", kind: "drawer" }, () => slide(d));
+ st({ title: "Screw in the drawer stops", detail: "Pull the drawer half out. One in the top edge of each side at the back, screwed right down.", tools: ["screwdriver"], kind: "screws" }, () => b.fits(STOP, fitsOf(d).stops, 0.15));
+ }
+ } else {
+ st({ title: "Push in the drawers", detail: "Small ones at the top. Tilt each, set it onto its runners and push it in. Open one at a time.", pose: "+y", kind: "drawer", warnings: ["tip"] }, () => {
+ for (const d of order) slide(d);
+ });
+ b.steps[b.steps.length - 1].quiet = true;
+ st({ title: "Screw in the drawer stops", detail: "Pull each drawer half out: one in the top edge of each side at the back, screwed right down.", tools: ["screwdriver"], kind: "screws" }, () => {
+ for (const d of order) b.fits(STOP, fitsOf(d).stops, 0.05);
+ });
+ }
+ return true;
+}
+
+const family: Family = {
+ names: ["KULLEN"],
+ build,
+};
+
+export default family;
diff --git a/src/lib/plan/families/kungsfors.ts b/src/lib/plan/families/kungsfors.ts
index 474e451..331362c 100644
--- a/src/lib/plan/families/kungsfors.ts
+++ b/src/lib/plan/families/kungsfors.ts
@@ -25,6 +25,18 @@ function recipe(s: ProductSpec): CustomParams {
{ shape: "cyl", size: [10, W - 2 * p, 10], pos: [0, up - dy, -zi], rot: [0, 0, Math.PI / 2] },
...[-1, 1].map((sx): PartPiece => ({ shape: "cyl", size: [10, D - 2 * p, 10], pos: [sx * xi, up - dy, 0], rot: [Math.PI / 2, 0, 0] })),
]);
+ // a steel tray: a thin bottom with a low rim all round, open on top
+ const tray = (h: number): { size: Vec3; pieces: PartPiece[] } => {
+ const tw = W - 2 * p - 4, td = D - 2 * p - 4, t = 2;
+ return {
+ size: [tw, h, td],
+ pieces: [
+ { shape: "box", size: [tw, t, td], pos: [0, -h / 2 + t / 2, 0] },
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [tw, h, t], pos: [0, 0, sz * (td / 2 - t / 2)] })),
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [t, h, td - 2 * t], pos: [sx * (tw / 2 - t / 2), 0, 0] })),
+ ],
+ };
+ };
const post = (id: string, name: string, x: number, z: number, y0 = yC, y1 = H - 20): CustomPart => ({ id, name, size: [p, y1 - y0, p], pos: [x, (y0 + y1) / 2, z], material: "metal" });
const corners = [[-1, 1], [1, 1], [-1, -1], [1, -1]] as const;
const mids: [number, number][] = [[-W / 6, -zi], [W / 6, -zi], [-xi, 0], [xi, 0]];
@@ -33,9 +45,9 @@ function recipe(s: ProductSpec): CustomParams {
...corners.map(([sx, sz], i) => post(`L${i + 1}`, "Leg", sx * xi, sz * zi, yC, H - 20)),
...mids.map(([x, z], i) => post(`M${i + 1}`, "Post", x, z, yLow + p / 2, yUp - p / 2)),
{ id: "B", name: "Lower frame", size: [W, p, D], pos: [0, yLow, 0], material: "metal", pieces: [...ring(0), { shape: "box", size: [p, p, D - 2 * p], pos: [0, 0, 0] }] },
- { id: "T1", name: "Tray", size: [W - 2 * p - 4, 40, D - 2 * p - 4], pos: [0, 430, 0], material: "metal" },
- { id: "T2", name: "Tray", size: [W - 2 * p - 4, 40, D - 2 * p - 4], pos: [0, yLow + p / 2 + 20, 0], material: "metal" },
- { id: "T3", name: "Top tray", size: [W - 2 * p - 4, 70, D - 2 * p - 4], pos: [0, H - 35, 0], material: "metal" },
+ { id: "T1", name: "Tray", ...tray(40), pos: [0, 430, 0], material: "metal" },
+ { id: "T2", name: "Tray", ...tray(40), pos: [0, yLow + p / 2 + 20, 0], material: "metal" },
+ { id: "T3", name: "Top tray", ...tray(70), pos: [0, H - 35, 0], material: "metal" },
];
const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, on: string, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, on, ...o });
const SCREW = { len: 12, dia: 5 };
@@ -62,7 +74,8 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Two bolts at each corner: one through the side of the leg, one down through the plate.",
fix: [
...corners.map(([sx, sz]) => fx("bolt", [[sx * (W / 2), yLow + 40, sz * zi]], [-sx, 0, 0], "B", { len: 12, dia: 6 })),
- fx("bolt", corners.map(([sx, sz]): Vec3 => [sx * xi, yLow - p / 2, sz * zi]), [0, 1, 0], "B", { len: 12, dia: 6 }),
+ // the plate's bolt goes into the frame's long tube just in from the leg, clear of the leg screw
+ fx("bolt", corners.map(([sx, sz]): Vec3 => [sx * (xi - 26), yLow - p / 2, sz * zi]), [0, 1, 0], "B", { len: 12, dia: 6 }),
],
},
{
diff --git a/src/lib/plan/families/kyrre.ts b/src/lib/plan/families/kyrre.ts
index 5cd0189..1575e2f 100644
--- a/src/lib/plan/families/kyrre.ts
+++ b/src/lib/plan/families/kyrre.ts
@@ -2,7 +2,7 @@ import type { Family } from "./family";
import type { CustomFix, CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
/**
- * KYRRE, read from the stool's manual. The seat is a rounded triangle of birch plywood; each of the three bent legs
+ * KYRRE, read from the stool's manual. The seat is one rounded triangle of birch plywood; each of the three bent legs
* runs up from the floor and turns in under the seat as a short flat arm. With the seat upside down on a rug, each
* arm takes two Allen screws, sunk flush, then a glide is pressed into each foot.
*/
@@ -36,15 +36,9 @@ function stool(s: ProductSpec): CustomParams {
const xb = SW / 2 - R, zf = 125, zb = zf - (SD - 2 * R);
const corners: [number, number][] = [[0, zf], [-xb, zb], [xb, zb]];
- // the seat: a disc at each corner, a strip along each edge and a disc in the middle
- const seatAbs: PartPiece[] = corners.map(([x, z]) => ({ shape: "cyl", size: [2 * R, SEAT_T, 2 * R], pos: [x, bot + SEAT_T / 2, z] }));
- corners.forEach(([x0, z0], i) => {
- const [x1, z1] = corners[(i + 1) % 3];
- const dx = x1 - x0, dz = z1 - z0;
- seatAbs.push({ shape: "box", size: [Math.hypot(dx, dz), SEAT_T, 2 * R], pos: [(x0 + x1) / 2, bot + SEAT_T / 2, (z0 + z1) / 2], rot: [0, Math.atan2(-dz, dx), 0] });
- });
+ // the seat: one rounded triangle of plywood
+ const seatAbs: PartPiece[] = [{ shape: "slab", size: [SW, SEAT_T, SD], pos: [0, bot + SEAT_T / 2, 0], outline: [[0, zf + R], [-SW / 2, zb - R], [SW / 2, zb - R]], round: 95 }];
const zIn = zb + 85;
- seatAbs.push({ shape: "cyl", size: [170, SEAT_T, 170], pos: [0, bot + SEAT_T / 2, zIn] });
const parts: CustomPart[] = [part("SEAT", "Seat", seatAbs, [-SW / 2, bot, zb - R], [SW / 2, top, zf + R], "wood")];
// legs: where each meets the seat and where it stands, splayed out to IKEA's footprint
diff --git a/src/lib/plan/families/lack.ts b/src/lib/plan/families/lack.ts
index 4b9e099..a152b56 100644
--- a/src/lib/plan/families/lack.ts
+++ b/src/lib/plan/families/lack.ts
@@ -73,11 +73,12 @@ function tableRecipe(s: ProductSpec, kind: "side" | "coffee" | "tv"): CustomPara
const ls = legs.filter((l) => l.sx === sx);
const face = sx * (W / 2 - L);
const dir: Vec3 = [sx, 0, 0];
- const at = ls.map((l) => [face, SHELF_Y - 12, l.z - 11] as Vec3);
+ // mirrored front to back, so each bracket's tab reaches in under the shelf
+ const at = ls.map((l) => [face, SHELF_Y - 12, l.z - l.sz * 11] as Vec3);
return {
brackets: fx("angle", at, dir, { len: 44, dia: 24 }),
- screws: fx("screw", ls.map((l) => [face, SHELF_Y - 22, l.z + 9] as Vec3), dir, { len: 16, dia: 4 }),
- up: ls.map((l) => [face - sx * 20, SHELF_Y, l.z - 32] as Vec3),
+ screws: fx("screw", ls.map((l) => [face, SHELF_Y - 22, l.z + l.sz * 9] as Vec3), dir, { len: 16, dia: 4 }),
+ up: ls.map((l) => [face - sx * 20, SHELF_Y, l.z - l.sz * 32] as Vec3),
legs: ls.map((l) => `L${legs.indexOf(l)}`),
};
};
diff --git a/src/lib/plan/families/lacko.ts b/src/lib/plan/families/lacko.ts
index 5316d43..7698393 100644
--- a/src/lib/plan/families/lacko.ts
+++ b/src/lib/plan/families/lacko.ts
@@ -13,7 +13,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartMaterial, Par
* 2-seat sofa: the seat lies upside down on a table; a side frame is bolted on each end (one bolt through the front
* leg, two through the seat rail), the stretcher with its end inserts drops between them and is bolted, then it
* stands up and the backrest hooks onto the back posts with two short bolts. Every bolt is tightened at the end.
- * The chair comes fully welded with no manual, so it keeps its old guide.
+ * The chair comes fully welded with no manual, so its guide only unpacks it.
*/
const range = (n: number) => Array.from({ length: n }, (_, i) => i);
@@ -261,8 +261,43 @@ function sofa(): CustomParams {
return { parts, steps };
}
+/** A round rod from a to b (mm, relative to its part's centre). */
+function rod(a: Vec3, b: Vec3, d: number): PartPiece {
+ const v: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...v);
+ return { shape: "cyl", size: [d, len, d], pos: [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2], rot: [Math.atan2(v[2], v[1]), 0, Math.asin(-v[0] / len)] };
+}
+
+/** The chair comes welded in one piece (its page has no manual), so its guide only unpacks it. */
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const yS = (s.seat?.seatH ?? 45) * 10, t = 12, r = W / 2 - 20;
+ const zb = -D / 2 + 50; // the back legs' tops, under the back of the seat
+ const pieces: PartPiece[] = [
+ // four legs splaying out a little towards the floor
+ ...[-1, 1].flatMap((sx) => [rod([sx * (W / 2 - 15), -yS / 2, D / 2 - 30], [sx * (r - 30), yS / 2 - 15, D / 2 - 90], t), rod([sx * (W / 2 - 15), -yS / 2, -D / 2 + 10], [sx * (r - 30), yS / 2 - 15, zb], t)]),
+ // the back uprights, rising from the back legs, and the round top rail with its bars
+ ...[-1, 1].map((sx) => rod([sx * (r - 30), yS / 2 - 15, zb], [sx * (r - 20), H - yS / 2 - 80, zb - 40], t)),
+ rod([-(r - 20), H - yS / 2 - 80, zb - 40], [0, H - yS / 2 - 6, zb - 40], t),
+ rod([0, H - yS / 2 - 6, zb - 40], [r - 20, H - yS / 2 - 80, zb - 40], t),
+ ...[-0.5, -0.17, 0.17, 0.5].map((f) => rod([f * (r - 40), yS / 2 + 20, zb - 10], [f * (r - 40), H - yS / 2 - 70 + (1 - Math.abs(f)) * 60, zb - 40], 7)),
+ // the ring under the seat that ties the legs together
+ rod([-(W / 2 - 30), -yS / 2 + 160, -D / 2 + 30], [-(W / 2 - 30), -yS / 2 + 160, D / 2 - 50], 10),
+ rod([W / 2 - 30, -yS / 2 + 160, -D / 2 + 30], [W / 2 - 30, -yS / 2 + 160, D / 2 - 50], 10),
+ ];
+ // the seat is welded on too
+ const seat: PartPiece = { shape: "slab", size: [2 * r - 20, 8, D - 120], pos: [0, yS - 4 - H / 2, 20], outline: [[-(r - 10), -(D - 120) / 2], [r - 10, -(D - 120) / 2], [r - 30, (D - 120) / 2], [-(r - 30), (D - 120) / 2]], round: 60 };
+ const parts: CustomPart[] = [{ id: "F", name: "Chair", size: [W, H, D], pos: [0, H / 2, 0], material: "metal", pieces: [...pieces.map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] + yS / 2 - H / 2, p.pos[2]] as Vec3 })), seat] }];
+ const steps: CustomStep[] = [
+ { title: "Unpack the chair", detail: "It comes welded in one piece, so there is nothing to put together. Take off all the packaging and the protective film.", add: ["F"], from: { F: [0, 300, 0] } },
+ { title: "Check it stands steady", detail: "All four feet should touch the ground. The chairs stack, so store them stacked under cover in winter." },
+ ];
+ return { parts, steps };
+}
+
function recipe(s: ProductSpec): CustomParams | null {
const slug = s.slug ?? "";
+ if (/^lacko-chair/.test(slug)) return chair(s);
if (/lacko-shelving-unit/.test(slug)) return shelving(s);
if (/lacko-table-outdoor/.test(slug)) return table();
if (/lacko-2-seat-sofa/.test(slug)) return sofa();
diff --git a/src/lib/plan/families/lagkapten.ts b/src/lib/plan/families/lagkapten.ts
index cc63fa1..b5e6b8a 100644
--- a/src/lib/plan/families/lagkapten.ts
+++ b/src/lib/plan/families/lagkapten.ts
@@ -345,11 +345,12 @@ function trestle(k: Kit, p: string, x: number, D: number, H: number) {
for (const t of [-1, 1]) for (const s of [-1, 1]) k.part(`${p}G${t}${s}`, "Leg", [40, len, 24], [x + s * (40 + reach) / 2, (top + foot) / 2, t * zl], { mat: "wood", rot: [0, 0, s * ang] });
const ys = 200;
const sw = 2 * (40 + ((reach - 40) * (top - ys)) / (top - foot)) - 40;
- k.part(`${p}S`, "Shelf", [sw, 20, 2 * zl - 40], [x, ys, 0], {
+ // its two battens reach front to back, their ends against the legs' inner edges
+ k.part(`${p}S`, "Shelf", [sw, 20, 2 * zl], [x, ys, 0], {
mat: "wood",
pieces: [
- { shape: "box", size: [20, 20, 2 * zl - 40], pos: [-sw / 2 + 10, 0, 0] },
- { shape: "box", size: [20, 20, 2 * zl - 40], pos: [sw / 2 - 10, 0, 0] },
+ { shape: "box", size: [20, 20, 2 * zl], pos: [-sw / 2 + 10, 0, 0] },
+ { shape: "box", size: [20, 20, 2 * zl], pos: [sw / 2 - 10, 0, 0] },
...range(5).map((i) => ({ shape: "box" as const, size: [sw - 40, 14, 50] as Vec3, pos: [0, 3, -(2 * zl - 120) / 2 + ((2 * zl - 120) * i) / 4] as Vec3 })),
],
});
@@ -377,7 +378,7 @@ function trestleSteps(k: Kit, ts: { p: string; x: number }[], D: number, H: numb
k.step({ title: "Screw the legs to the shelf", detail: "One Allen screw through each leg into the shelf end.", tools: ["allen"], kind: "bolts" }, () => {
for (const t of ts) {
const sw = k.hi(`${t.p}S`, 0) - k.lo(`${t.p}S`, 0);
- for (const z of [-zl + 20, zl - 20]) for (const s of [-1, 1]) k.fit(ALLEN, [[t.x + (s * sw) / 2 + s * 10, 200, z]], [-s, 0, 0], `${t.p}G${z < 0 ? -1 : 1}${s}`, { mate: `${t.p}S` });
+ for (const z of [-zl + 6, zl - 6]) for (const s of [-1, 1]) k.fit(ALLEN, [[t.x + (s * sw) / 2 + s * 10, 200, z]], [-s, 0, 0], `${t.p}G${z < 0 ? -1 : 1}${s}`, { mate: `${t.p}S` });
}
});
k.step({ title: "Tap the caps onto the feet", detail: "One on the end of each leg, with a hammer.", tools: ["hammer"], kind: "legs" }, () => {
diff --git a/src/lib/plan/families/laiva.ts b/src/lib/plan/families/laiva.ts
new file mode 100644
index 0000000..96aca1f
--- /dev/null
+++ b/src/lib/plan/families/laiva.ts
@@ -0,0 +1,118 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
+
+/*
+ * LAIVA bookcase, read from its manual. Each of the four uprights comes in two halves, joined end to end with a cam
+ * bolt, two dowels and a cam lock. Two end blocks on dowels join a front and a back upright into a side frame. The
+ * bookcase is built lying on its front: the five boards go in between the side frames, two screws at each end,
+ * the two hardboard backs slide into the grooves and are nailed to the boards, and two brackets fix it to the wall.
+ * IKEA's sizes: 62 wide, 24 deep, 165 high.
+ */
+
+const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+
+function recipe(s: ProductSpec): CustomParams {
+ const W = 620, H = 1650, D = 240;
+ const TF = 15, UD = 40; // side frames' thickness, the uprights' depth
+ const xf = W / 2 - TF / 2, xi = W / 2 - TF, zu = D / 2 - UD / 2;
+ const mid = H / 2; // where each upright's halves meet
+ const parts: CustomPart[] = [];
+ const up = (id: string, g: number, gz: number) => parts.push({ id, name: "Upright", size: [TF, H, UD], pos: [g * xf, H / 2, gz * zu], material: "wood" });
+ const block = (id: string, g: number, y: number) => parts.push({ id, name: "End block", size: [TF, 40, D - 2 * UD], pos: [g * xf, y, 0], material: "wood" });
+ up("UL0", -1, -1), up("UL1", -1, 1), up("UR0", 1, -1), up("UR1", 1, 1);
+ block("BL0", -1, 20), block("BL1", -1, H - 20), block("BR0", 1, 20), block("BR1", 1, H - 20);
+ const boardY = [90, 440, 790, 1140, H - 90];
+ const bz0 = -D / 2 + 8, bz1 = D / 2 - 12; // boards stop at the back panels' grooves
+ boardY.forEach((y, i) => parts.push({ id: `S${i}`, name: i === 0 || i === 4 ? "End board" : "Shelf", size: [2 * xi, 18, bz1 - bz0], pos: [0, y, (bz0 + bz1) / 2], material: "wood" }));
+ const zb = -D / 2 + 6; // the back panels, in grooves in the back uprights
+ parts.push(
+ { id: "K0", name: "Back panel", size: [2 * xi + 8, mid - 40, 3], pos: [0, (40 + mid) / 2, zb], material: "fiber" },
+ { id: "K1", name: "Back panel", size: [2 * xi + 8, H - 40 - mid, 3], pos: [0, (mid + H - 40) / 2, zb], material: "fiber" },
+ );
+ const ups = ["UL0", "UL1", "UR0", "UR1"];
+ const upX = (id: string) => (id[1] === "L" ? -xf : xf), upZ = (id: string) => (id[2] === "0" ? -zu : zu);
+ const joint = (dy: number, o: Partial<CustomFix>, dir: Vec3, dz = 0) => ups.map((id) => fx(o.kind!, [[upX(id), mid + dy, upZ(id) + dz]], dir, { ...o, on: id }));
+ const blockDowels = (g: number) =>
+ [`B${g < 0 ? "L" : "R"}0`, `B${g < 0 ? "L" : "R"}1`].flatMap((id, k) =>
+ [-1, 1].map((gz) => fx("dowel", [-8, 8].map((dy): Vec3 => [g * xf, (k ? H - 20 : 20) + dy, gz * (D / 2 - UD)]), [0, 0, -gz], { on: id, len: 30, dia: 8 })),
+ );
+ const boardScrews = (g: number, ys: number[]) => fx("screw", ys.flatMap((y) => [-1, 1].map((gz): Vec3 => [g * (W / 2), y, gz * (zu - 4)])), [-g, 0, 0], { len: 50, dia: 5, name: "Connector screw" });
+ const nails = (y: number, n: number, panel: string) => fx("nail", Array.from({ length: n }, (_, k): Vec3 => [-xi + 30 + (k * (2 * xi - 60)) / Math.max(1, n - 1), y, zb - 1.5]), [0, 0, 1], { len: 20, dia: 2, on: panel });
+ const wx = [-160, 160];
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into the upright halves",
+ detail: "Each upright comes in two halves. Lay them on a rug and turn a cam bolt into the end of one half of each, by hand.",
+ add: ups,
+ fix: joint(0, { kind: "camScrew", len: 34, dia: 7 }, [0, -1, 0]),
+ pose: "-z",
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ { title: "Tap two dowels in beside each bolt", detail: "Eight dowels in all, into the same ends.", fix: ups.flatMap((id) => [fx("dowel", [-12, 12].map((dz): Vec3 => [upX(id), mid, upZ(id) + dz]), [0, -1, 0], { on: id, len: 30, dia: 8 })]), tools: ["hammer"] },
+ {
+ title: "Join the halves and lock the cams",
+ detail: "Push each pair together end to end on the floor, so it doesn't bend, then turn the cam lock clockwise until the joint pulls tight.",
+ fix: joint(40, { kind: "cam", len: 13, dia: 15 }, [0, 0, 1], -UD / 2 + 2).map((f) => ({ ...f, at: f.at!.map((p): Vec3 => [p[0], p[1], p[2] < 0 ? -D / 2 : D / 2 - UD]) })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Join the uprights with the end blocks",
+ detail: "Two dowels in each end of the four blocks, then press a front and a back upright onto each pair of blocks to make the two side frames.",
+ add: ["BL0", "BL1", "BR0", "BR1"],
+ fix: [...blockDowels(-1), ...blockDowels(1)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the top board to one side frame",
+ detail: "Its edge with the groove goes to the back. Two screws through the side frame into its end, turned with the Allen key.",
+ add: ["S4"],
+ fix: [boardScrews(-1, [H - 90])],
+ from: { S4: [0, 0, -300] },
+ tools: ["allen"],
+ },
+ {
+ title: "Put the other boards in",
+ detail: "The bottom board and the three shelves, grooves to the back. Two screws into each.",
+ add: ["S0", "S1", "S2", "S3"],
+ fix: [boardScrews(-1, boardY.slice(0, 4))],
+ from: Object.fromEntries(["S0", "S1", "S2", "S3"].map((id) => [id, [0, 0, -300] as Vec3])),
+ tools: ["allen"],
+ },
+ { title: "Screw the other side frame on", detail: "Ten screws, two into each board.", fix: [boardScrews(1, boardY)], tools: ["allen"] },
+ { title: "Slide the back panels into the grooves", detail: "Smooth side out, the two halves meeting at the middle shelf.", add: ["K0", "K1"], from: { K0: [0, -900, 0], K1: [0, 900, 0] } },
+ {
+ title: "Nail the backs to the top and bottom",
+ detail: "Check the bookcase is square first: both diagonals the same. Four nails into each end board.",
+ fix: [nails(boardY[0], 4, "K0"), nails(boardY[4], 4, "K1")],
+ tools: ["hammer", "tape"],
+ check: "square",
+ },
+ { title: "Nail the backs to the shelves", detail: "Eleven nails along each of the two shelves shown.", fix: [nails(boardY[1], 11, "K0"), nails(boardY[3], 11, "K1")], tools: ["hammer"] },
+ {
+ title: "Stand it up and fix it to the wall",
+ detail: "Screw the two brackets under the top board at the back, with a washer under each screw, then into the wall through the other washers. Wall screws and plugs aren't included: pick ones made for your wall.",
+ pose: "+y",
+ fix: [
+ fx("angle", wx.map((x): Vec3 => [x, H - 99, -D / 2 + 8]), [0, 1, 0], { name: "Wall bracket", len: 60, dia: 30, on: "S4" }),
+ fx("washer", wx.map((x): Vec3 => [x, H - 99, -D / 2 + 40]), [0, 1, 0], { on: "S4", len: 2, dia: 18 }),
+ fx("screw", wx.map((x): Vec3 => [x, H - 100, -D / 2 + 40]), [0, 1, 0], { len: 16, dia: 4, on: "S4" }),
+ fx("plug", wx.map((x): Vec3 => [x, H - 120, -D / 2 - 30]), [0, 0, -1], { len: 35, dia: 8 }),
+ fx("washer", wx.map((x): Vec3 => [x, H - 120, -D / 2 + 1]), [0, 0, -1], { len: 2, dia: 18 }),
+ fx("screw", wx.map((x): Vec3 => [x, H - 120, -D / 2 + 2]), [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["screwdriver", "drill", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["LAIVA"],
+ recipe(s) {
+ return /^laiva-bookcase/.test(s.slug ?? "") ? recipe(s) : null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/lanesund.ts b/src/lib/plan/families/lanesund.ts
index 5c5b549..c7e6352 100644
--- a/src/lib/plan/families/lanesund.ts
+++ b/src/lib/plan/families/lanesund.ts
@@ -320,7 +320,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
}
if (tv) {
const stops = doors.map((d): Vec3 => [d.hs < 0 ? d.x1 - 30 : d.x0 + 30, y1 - 10, zf - DOOR - 12]);
- push({ title: "Screw in the door stops", detail: "One under the top behind the free edge of each door opening.", fix: [fix("angle", stops, [0, 1, 0], { name: "Door stop", len: 30, dia: 20 }), fix("screw", stops.map((p) => [p[0], p[1] - 3, p[2] - 8] as Vec3), [0, 1, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] });
+ push({ title: "Screw in the door stops", detail: "One under the top behind the free edge of each door opening.", fix: [fix("angle", stops, [0, 1, 0], { name: "Door stop", len: 30, dia: 20 }), fix("screw", stops.map((p) => [p[0], y1 - 2, p[2] - 24] as Vec3), [0, 1, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] });
}
// shelves
@@ -346,7 +346,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
title: "Screw on the drawer backs",
detail: "Lay each back over its bottom, then two long screws through each side into it.",
add: both((c) => [`dk${c}`]),
- fix: both((c, x) => [-1, 1].map((sx) => fix("screw", [-20, 20].map((dy) => [x + sx * (dw / 2), dyB + dh / 2 + dy, dzB + 7] as Vec3), [-sx, 0, 0], { on: sideOf(c, sx), mate: `dk${c}`, len: 40, dia: 4 }))),
+ fix: both((c, x) => [-1, 1].map((sx) => fix("screw", [-30, 0].map((dy) => [x + sx * (dw / 2), dyB + dh / 2 + dy, dzB + 7] as Vec3), [-sx, 0, 0], { on: sideOf(c, sx), mate: `dk${c}`, len: 40, dia: 4 }))),
tools: ["screwdriver"],
});
push({ title: "Screw in the drawer stops", detail: "One screw near the back of each side. Leave its head standing out: it stops the drawer.", fix: both((c, x) => [-1, 1].map((sx) => fix("screw", [[x + sx * (dw / 2), dyB + dh - 15, dzB + 30]], [-sx, 0, 0], { name: "Stop screw", len: 12, dia: 5, on: sideOf(c, sx) }))), tools: ["screwdriver"] });
@@ -395,8 +395,8 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
fix: [
fix("angle", tops, [0, 1, 0], { name: "Door stop", len: 30, dia: 20 }),
fix("angle", bots, [0, -1, 0], { name: "Door stop", len: 30, dia: 20 }),
- fix("screw", tops.map((p) => [p[0], p[1] - 3, p[2] - 8] as Vec3), [0, 1, 0], { len: 12, dia: 4 }),
- fix("screw", bots.map((p) => [p[0], p[1] + 3, p[2] - 8] as Vec3), [0, -1, 0], { len: 12, dia: 4 }),
+ fix("screw", tops.map((p) => [p[0], y1 - 2, p[2] - 24] as Vec3), [0, 1, 0], { len: 12, dia: 4 }),
+ fix("screw", bots.map((p) => [p[0], y0 + 2, p[2] - 24] as Vec3), [0, -1, 0], { len: 12, dia: 4 }),
],
tools: ["screwdriver"],
});
@@ -408,7 +408,7 @@ function recipe(s: ProductSpec, kind: Kind): CustomParams {
fix: [fix("washer", bump, [0, 0, 1], { name: "Bumper", len: 6, dia: 12 }), fix("screw", bump.map((p) => [p[0], p[1], p[2] - 1] as Vec3), [0, 0, 1], { len: 16, dia: 4 })],
tools: ["screwdriver"],
});
- const hx = (d: Door) => (d.hs < 0 ? d.x1 - 45 : d.x0 + 45);
+ const hx = (d: Door) => (d.hs < 0 ? d.x1 - 17 : d.x0 + 17); // on the frame stile, not the glass
const hdY = dy0 + (dy1 - dy0) * (tall ? 0.48 : 0.5);
push({
title: nD > 1 ? "Screw on the handles" : "Screw on the handle",
diff --git a/src/lib/plan/families/langfjall.ts b/src/lib/plan/families/langfjall.ts
index d079bdd..8e903cd 100644
--- a/src/lib/plan/families/langfjall.ts
+++ b/src/lib/plan/families/langfjall.ts
@@ -51,7 +51,8 @@ function recipe(s: ProductSpec): CustomParams {
abs("BA", "Star base", basePieces, "metal"),
];
const yB = seatBot - mechH - plateT;
- const corner = (sx: number, sz: number): Vec3 => [sx * 70, yB, zs + sz * 85];
+ // the bolts go up through the plate into the mechanism's corners, inside its footprint
+ const corner = (sx: number, sz: number): Vec3 => [sx * 45, yB, zs + sz * 60];
const castors = angles.map((a): Vec3 => [(R - 20) * Math.cos(a), tipY, -(R - 20) * Math.sin(a)]);
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/lillberget.ts b/src/lib/plan/families/lillberget.ts
index 98a0618..200c310 100644
--- a/src/lib/plan/families/lillberget.ts
+++ b/src/lib/plan/families/lillberget.ts
@@ -621,7 +621,7 @@ function chest(b: PlanBuilder, s: ProductSpec, n: number, cols: 1 | 2) {
);
b.step(
{ title: "Put in the two long back screws", detail: "Through the bottom board at each corner, a few turns only for now.", tools: ["allen"], pose: lieOn, kind: "screws" },
- () => b.fits(BACK_SCREW, [-1, 1].map((g): FitOpts => ({ on: backs[backs.length - 1], at: [g * (xi - 2), 40, zBk - 4], dir: [0, 0, 1], mate: sides[g < 0 ? 0 : 1] })), 0.2),
+ () => b.fits(BACK_SCREW, [-1, 1].map((g): FitOpts => ({ on: backs[backs.length - 1], at: [g * (xi + 9), 40, zBk - 4], dir: [0, 0, 1], mate: sides[g < 0 ? 0 : 1] })), 0.2),
);
} else {
b.step(
diff --git a/src/lib/plan/families/lillehem.ts b/src/lib/plan/families/lillehem.ts
index f9e5b94..ad8a4e3 100644
--- a/src/lib/plan/families/lillehem.ts
+++ b/src/lib/plan/families/lillehem.ts
@@ -379,7 +379,7 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
for (const t of tables)
for (const k of ["blockL", "blockR"]) {
const r = tr(t, k);
- stage(T, t, [r], [0, 0, 500], [0, 0, 500]);
+ stage(T, t, [r], [0, -200, 0], [0, 0, 500]);
b.then(0.05);
fit(HW.dowel, [-20, 20].map((dx) => at(tm(t), [r.lp[0] + dx, 352, 0], [0, -1, 0], r.key, { mate: tr(t, "top").key })), 0.08);
fit(HW.dowel, [at(tm(t), [r.lp[0], 242, 0], [0, 1, 0], r.key, { mate: tr(t, "bottom").key })]);
diff --git a/src/lib/plan/families/lillesater.ts b/src/lib/plan/families/lillesater.ts
index 1692aec..a55f219 100644
--- a/src/lib/plan/families/lillesater.ts
+++ b/src/lib/plan/families/lillesater.ts
@@ -9,7 +9,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* The 4, 5 and 6-seat sofas are the 3-seat sofa with one, two or three 1-seat sections in the middle, and the 1-seat
* section's manual builds them differently: every section gets its own back nutted on first, then the sections lie
* upside down in a row and are joined with two studs and one guide pin at each join.
- * The swivel easy chair has no manual we could read and keeps its old guide.
+ * The swivel easy chair comes ready assembled (IKEA has only a care sheet for it), so its guide unpacks it.
*/
type Kind = CustomFix["kind"];
@@ -210,16 +210,16 @@ function sofa(s: ProductSpec): CustomParams | null {
title: `Screw ${backStuds.length} studs into the bottoms of the backs`,
detail: "Two in each back, by hand until they stop.",
pose: "+y",
- add: secs.map((c) => c.back),
- from: Object.fromEntries(secs.map((c) => [c.back, [0, 450, 0] as Vec3])),
+ wait: secs.map((c) => c.back),
fix: secs.map((c) => fx("stud", backStudsOf(c), [0, 1, 0], { ...STUD, on: c.back, mate: c.base })),
},
{
- title: "Lower each back onto its seat base, then turn each section upside down",
- detail: "The studs go down through the holes at the back of the base. Each section on its own for now.",
- pose: "-y",
- warnings: ["floor"],
+ title: "Lower each back onto its seat base",
+ detail: "The studs go down through the holes at the back of the base.",
+ add: secs.map((c) => c.back),
+ from: Object.fromEntries(secs.map((c) => [c.back, [0, 450, 0] as Vec3])),
},
+ { title: "Turn each section upside down", detail: "Each section on its own for now, onto the rug.", pose: "-y", warnings: ["floor"] },
{
title: "Nut each back on from underneath",
detail: `A washer and a nut on all ${backStuds.length} studs, tightened with the box spanner.`,
@@ -253,12 +253,40 @@ function sofa(s: ProductSpec): CustomParams | null {
return { parts, steps };
}
+/** An oval ring's back part, as [x, z] corners: the outer edge one way, the inner edge back. */
+function crescent(rx: number, rz: number, t: number, a0: number, a1: number, n = 16): [number, number][] {
+ const pt = (a: number, d: number): [number, number] => [Math.round((rx - d) * Math.cos(a)), Math.round((rz - d) * Math.sin(a))];
+ const as = Array.from({ length: n + 1 }, (_, i) => a0 + ((a1 - a0) * i) / n);
+ return [...as.map((a) => pt(a, 0)), ...as.reverse().map((a) => pt(a, t))];
+}
+
+function swivel(s: ProductSpec): CustomParams {
+ // IKEA: 70 wide, 71 high, 79 deep; a round padded body on a low black swivel disc
+ const W = s.size.w * 10, H = s.size.h * 10, Dp = s.size.d * 10;
+ const disc = 30, seat = 420;
+ const c: Vec3 = [0, H / 2, 0];
+ const at = (p: PartPiece): PartPiece => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] });
+ const raw: PartPiece[] = [
+ { shape: "cyl", size: [W - 140, disc, W - 140], pos: [0, disc / 2, 20], material: "metal" },
+ { shape: "slab", size: [W, seat - disc, Dp], pos: [0, disc + (seat - disc) / 2, 0], outline: [[-W / 2, -Dp / 2], [W / 2, -Dp / 2], [W / 2, Dp / 2], [-W / 2, Dp / 2]], round: W * 0.42 },
+ { shape: "slab", size: [W, H - seat, Dp / 2], pos: [0, seat + (H - seat) / 2, 0], outline: crescent(W / 2 - 10, Dp / 2 - 10, 200, Math.PI + 0.25, 2 * Math.PI - 0.25), round: 20 },
+ ];
+ const pieces = raw.map(at);
+ return {
+ parts: [{ id: "CH", name: "Swivel easy chair", size: [W, H, Dp], pos: c, pieces, material: "soft" }],
+ steps: [
+ { title: "Unpack the chair", detail: "It comes ready assembled, so there is nothing to put together. Cut the wrapping open carefully so the knife can't catch the fabric.", add: ["CH"] },
+ { title: "Set it on a flat floor", detail: "Turn the seat once all the way round to check it swivels freely." },
+ ],
+ };
+}
const family: Family = {
names: ["LILLESÄTER", "LILLESATER"],
recipe(s) {
if (/seat-sofa/.test(s.slug ?? "")) return sofa(s);
- return null; // the swivel easy chair: no manual
+ if (/swivel/.test(s.slug ?? "")) return swivel(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/lindakra.ts b/src/lib/plan/families/lindakra.ts
index dec9eb5..9890448 100644
--- a/src/lib/plan/families/lindakra.ts
+++ b/src/lib/plan/families/lindakra.ts
@@ -66,10 +66,11 @@ function recipe(s: ProductSpec): CustomParams | null {
];
const foot = (pts: Vec3[], on: string) => at("foot", pts, [0, 1, 0], on, undefined, { len: legH, dia: 40, name: "Leg" });
const pads = (pts: Vec3[], on: string) => at("glide", pts.map((p) => [p[0], 0, p[2]] as Vec3), [0, 1, 0], on, undefined, { len: 3, dia: 34, name: "Felt pad" });
- const backPts = (xs: number[], y: number) => xs.map((x) => [x, y, zb] as Vec3);
+ // from inside the base, through its back frame into the backrest
+ const backPts = (xs: number[], y: number) => xs.map((x) => [x, y, zb + 30] as Vec3);
const screwPts = backPts([xa + 250, xb - 250], legH + 120);
const boltPts = backPts([xa + 250, xb - 250], seatH - lidT - 60);
- const armPts: Vec3[] = [zb + 120, z1 - 120].flatMap((z) => [legH + 80, seatH - lidT - 60].map((y) => [xa, y, z] as Vec3));
+ const armPts: Vec3[] = [zb + 120, z1 - 120].flatMap((z) => [legH + 80, seatH - lidT - 60].map((y) => [xa + 20, y, z] as Vec3));
const washer = (pts: Vec3[], dir: Vec3, on: string) => at("washer", pts, dir, on, undefined, { len: 1.5, dia: 20 });
const steps: CustomStep[] = [
@@ -84,13 +85,13 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw the base to the backrest",
detail: "Lift the lid and put the two long pointed screws, each with a washer, through the lower holes in the back of the base.",
- fix: [washer(screwPts, [0, 0, -1], "BED"), at("screw", screwPts, [0, 0, -1], "BED", "BK", { len: 90, dia: 6, name: "Long screw" })],
+ fix: [at("screw", screwPts, [0, 0, -1], "BED", "BK", { len: 90, dia: 6, name: "Long screw" }), washer(screwPts, [0, 0, -1], "BED")],
tools: ["allen"],
},
{
title: "Bolt it at the top",
detail: "Two bolts with washers through the upper holes. These are the blunt ones, not the pointed screws.",
- fix: [washer(boltPts, [0, 0, -1], "BED"), at("bolt", boltPts, [0, 0, -1], "BED", "BK", { len: 70, dia: 6 })],
+ fix: [at("bolt", boltPts, [0, 0, -1], "BED", "BK", { len: 70, dia: 6 }), washer(boltPts, [0, 0, -1], "BED")],
tools: ["allen"],
},
{
@@ -108,7 +109,7 @@ function recipe(s: ProductSpec): CustomParams | null {
title: "Bolt the armrest to the end",
detail: "Stand the base up and lift the lid. Four bolts with washers from inside the storage space into the armrest.",
add: ["ARM"],
- fix: [washer(armPts, [-1, 0, 0], "BED"), at("bolt", armPts, [-1, 0, 0], "BED", "ARM", { len: 70, dia: 6 })],
+ fix: [at("bolt", armPts, [-1, 0, 0], "BED", "ARM", { len: 70, dia: 6 }), washer(armPts, [-1, 0, 0], "BED")],
pose: "+y",
tools: ["allen"],
},
diff --git a/src/lib/plan/families/linneback.ts b/src/lib/plan/families/linneback.ts
index 7cd7693..957c218 100644
--- a/src/lib/plan/families/linneback.ts
+++ b/src/lib/plan/families/linneback.ts
@@ -79,7 +79,8 @@ function recipe(s: ProductSpec): CustomParams {
{ id: "SC", name: "Seat cushion", size: [seatW, cushT, 500], pos: [0, seatTop - cushT / 2, zs + 15], material: "soft" },
{ id: "BC", name: "Back cushion", size: [W - 60, 260, 40], pos: [0, yTop - 30 - 130, zb - 40], rot: [-0.08, 0, 0], material: "soft" },
];
- const sideBolts = [-1, 1].map((sx) => fx("bolt", [[sx * (W / 2), yRail, zb + 30], [sx * (W / 2), y0 + 20, zb + 30]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", { name: "Allen bolt", len: 16, dia: 6, mate: "BF" }));
+ // where the side frame tubes end against the back frame uprights
+ const sideBolts = [-1, 1].map((sx) => fx("bolt", [[sx * (W / 2), yRail, zb - 10], [sx * (W / 2), y0, zb - 10]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", { name: "Allen bolt", len: 16, dia: 6, mate: "BF" }));
const barBolts = [-1, 1].map((sx) => fx("bolt", [[sx * (W / 2), ySling, zf - 15]], [-sx, 0, 0], sx < 0 ? "SL" : "SR", { name: "Allen bolt", len: 30, dia: 8, mate: "SS" }));
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/lisabo.ts b/src/lib/plan/families/lisabo.ts
index c7d8a90..86e1f8b 100644
--- a/src/lib/plan/families/lisabo.ts
+++ b/src/lib/plan/families/lisabo.ts
@@ -181,7 +181,7 @@ function desk(s: ProductSpec): CustomParams {
const yU = H - t.T; // underside of the top
const y0 = yU - 2 - dh; // drawer bottom edge
const zF = D / 2 - t.inset; // front face of the frame
- const zBack = zF - ft - dd; // drawer back face
+ const zBack = zF - dd; // drawer back face: the front, the sides and the back make up the depth
const yc = y0 + dh / 2;
const sideL = dd - ft - bt;
const sideZ = zF - ft - sideL / 2;
@@ -334,8 +334,8 @@ function chair(s: ProductSpec): CustomParams {
[xIn - 8, rY - 30, zB + 40],
[-xIn + 8, rY - 30, zF - 70],
[xIn - 8, rY - 30, zF - 70],
- [-70, rY - 30, 40],
- [70, rY - 30, 40],
+ // the middle two go up through the cross rails, 7 cm either side of where they cross
+ ...[-70, 70].map((x): Vec3 => [x, rY - 30, (zF + zB) / 2 + 70 * ((zF - zB - 60) / (2 * xIn))]),
];
return {
parts,
diff --git a/src/lib/plan/families/listerby.ts b/src/lib/plan/families/listerby.ts
index 0712f53..b1b8bf2 100644
--- a/src/lib/plan/families/listerby.ts
+++ b/src/lib/plan/families/listerby.ts
@@ -16,21 +16,14 @@ function fx(kind: CustomFix["kind"], at: Vec3[], dir: Vec3, on?: string, o: Part
return { kind, count: at.length, at, dir, on, ...o };
}
-/** A board with rounded corners. The corner discs are a hair thinner, so their circles hide inside the board. */
+/** A board with rounded corners, drawn as one flat slab. */
function rounded(w: number, t: number, d: number, r: number): PartPiece[] {
- return [
- { shape: "box", size: [w - 2 * r, t, d], pos: [0, 0, 0] },
- ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [r, t, d - 2 * r], pos: [sx * (w / 2 - r / 2), 0, 0] })),
- ...[-1, 1].flatMap((sx) => [-1, 1].map((sz): PartPiece => ({ shape: "cyl", size: [2 * r, t - 3, 2 * r], pos: [sx * (w / 2 - r), 0, sz * (d / 2 - r)] }))),
- ];
+ return [{ shape: "slab", size: [w, t, d], pos: [0, 0, 0], outline: [[-w / 2, -d / 2], [w / 2, -d / 2], [w / 2, d / 2], [-w / 2, d / 2]], round: r }];
}
-/** A board with round ends: a box and a half disc at each end. */
+/** A board with round ends: a slab whose corner radius is half its depth. */
function stadium(w: number, t: number, d: number): PartPiece[] {
- return [
- { shape: "box", size: [w - d, t, d], pos: [0, 0, 0] },
- ...[-1, 1].map((sx): PartPiece => ({ shape: "halfcyl", size: [d, t, d / 2], pos: [sx * (w / 2 - d / 4), 0, 0], rot: [0, (sx * Math.PI) / 2, 0] })),
- ];
+ return rounded(w, t, d, d / 2 - 1);
}
interface Stage {
@@ -144,7 +137,8 @@ function coffee(s: ProductSpec): { recipe: CustomParams; stages: Stage[] } {
title: "Turn the frame over onto the top",
detail: "Lay the top face down on a rug and lower the frame onto it, so every dowel finds its hole.",
add: ["T"],
- from: { T: [0, 0, 700] },
+ // the top lies still on the rug and the frame, turned over, comes down onto it along the dowels
+ from: { T: [0, 0, 0] },
pose: "-y",
warnings: ["floor"],
},
diff --git a/src/lib/plan/families/lommarp.ts b/src/lib/plan/families/lommarp.ts
index c74ba9f..f288f0d 100644
--- a/src/lib/plan/families/lommarp.ts
+++ b/src/lib/plan/families/lommarp.ts
@@ -1,16 +1,12 @@
import type { Family } from "./family";
-import type { CustomFix, CustomPart, CustomStep, HwKind, PartMaterial, PartPiece, Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
+import type { PartMaterial, PartPiece, Pose, ProductSpec, StepKind, ToolId, Vec3, WarnId } from "../../types";
import type { FitOpts, HwDef, PlanBuilder } from "../builder";
import { rotate } from "../math";
/**
- * LOMMARP, read from its manuals. So far the bookcase: the carcass is built lying on its back. Cam bolts go into
- * the sides and the fixed shelf (on dowels) goes between them with cam locks, the bottom and top are dowelled and
- * screwed through the sides with long Allen screws, and the tongue-and-groove back slides down the grooves and is
- * riveted to the fixed shelf. A crown (a front rail and two side pieces, cam-locked into a U) sits on top on dowels
- * and is screwed up from inside; the shaped base (a front apron, two side legs and a back rail on angle brackets) is
- * dowelled and cam-locked under the bottom. Back clips, the wall brackets and three loose shelves on pins finish it.
- * The cabinets and the TV bench are drawn step by step further down (see `cabinets`).
+ * LOMMARP, read from its manuals, every product drawn step by step with PlanBuilder. The bookcase is built lying on
+ * its back, its crown and base each made as a U on the rug and pushed onto the ends (see `bookcase`); the cabinets
+ * and the TV bench share a shaped base and are described further down.
*/
const T = 18;
@@ -19,251 +15,6 @@ const CH = 45; // the crown
const O = 15; // how far the crown and base stand out past the carcass
const r = (n: number) => Math.round(n * 10) / 10;
-const DOWEL = { len: 30, dia: 8 };
-const CAM_BOLT = { len: 24, dia: 7, name: "Cam bolt" }; // the expanding kind, pushed in and screwed
-const CAM_PIN = { len: 30, dia: 7, name: "Cam pin" }; // screwed in by its thread
-const ALLEN_SCREW = { len: 50, dia: 7, name: "Allen screw" };
-const SMALL = { len: 13, dia: 4 };
-
-const fx = (kind: HwKind, on: string, dir: Vec3, at: Vec3[], o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, on, dir, at: at.map((p) => p.map(r) as Vec3), ...o });
-
-function bookcase(s: ProductSpec) {
- const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
- const xo = W / 2 - O; // outside of the carcass sides
- const xi = xo - T; // inside
- const zb = -D / 2 + 5; // back panel, in the grooves
- const zf = D / 2 - O; // front of the carcass
- const pz0 = zb + 5, pd = zf - pz0, pzc = pz0 + pd / 2; // the panels between the sides
- const y0 = BH, y1 = H - CH; // the carcass
- const yB = y0 + T / 2, yP = y1 - T / 2, yF = r((yB + yP) / 2);
- const parts: CustomPart[] = [];
- const box = (id: string, name: string, size: Vec3, pos: Vec3, o: Partial<CustomPart> = {}) => parts.push({ id, name, size: size.map(r) as Vec3, pos: pos.map(r) as Vec3, material: "board", ...o });
- box("L", "Side panel", [T, y1 - y0, D - O], [-xo + T / 2, (y0 + y1) / 2, -O / 2]);
- box("R", "Side panel", [T, y1 - y0, D - O], [xo - T / 2, (y0 + y1) / 2, -O / 2]);
- box("B", "Bottom panel", [2 * xi, T, pd], [0, yB, pzc]);
- box("F", "Fixed shelf", [2 * xi, T, pd], [0, yF, pzc]);
- box("P", "Top panel", [2 * xi, T, pd], [0, yP, pzc]);
- box("K", "Back panel", [2 * xi, y1 - y0, 10], [0, (y0 + y1) / 2, zb], { material: "fiber" });
- // the crown: a front rail across the whole width and two side pieces behind its ends
- box("CF", "Crown front", [W, CH, 20], [0, H - CH / 2, D / 2 - 10]);
- for (const sx of [-1, 1]) box(sx < 0 ? "CL" : "CR", "Crown side", [20, CH, D - 20], [sx * (W / 2 - 10), H - CH / 2, -10]);
- // the base: a shaped apron with two feet, two side legs with a foot at each end, a back rail
- const apron: PartPiece[] = [
- { shape: "box", size: [W, 40, T], pos: [0, BH / 2 - 20, 0] },
- ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [70, BH - 40, T], pos: [sx * (W / 2 - 35), -20, 0] })),
- ];
- box("BF", "Base front", [W, BH, T], [0, BH / 2, D / 2 - T / 2], { pieces: apron });
- const sd = D - T;
- const legP: PartPiece[] = [
- { shape: "box", size: [T, 40, sd], pos: [0, BH / 2 - 20, 0] },
- ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [T, BH - 40, 60], pos: [0, -20, sz * (sd / 2 - 30)] })),
- ];
- for (const sx of [-1, 1]) box(sx < 0 ? "BL" : "BR", "Base side", [T, BH, sd], [sx * (W / 2 - T / 2), BH / 2, -T / 2], { pieces: legP });
- box("BK", "Base back rail", [W - 2 * T, 40, T], [0, BH - 20, -D / 2 + T / 2]);
- // three loose shelves
- const shelfYs = [y0 + (yF - y0) * 0.5, yF + (yP - yF) * 0.36, yF + (yP - yF) * 0.68];
- const sDepth = Math.min(280, pd - 10);
- shelfYs.forEach((y, i) => box(`S${i}`, "Shelf", [2 * xi - 2, T, sDepth], [0, y, zf - 10 - sDepth / 2]));
-
- const sides = (f: (sx: number, id: string) => CustomFix[]) => [-1, 1].flatMap((sx) => f(sx, sx < 0 ? "L" : "R"));
- const zs3 = [-pd / 2 + 50, 0, pd / 2 - 50].map((z) => pzc + z);
- const steps: CustomStep[] = [];
- steps.push({
- title: "Screw cam bolts into both sides",
- detail: "Lay the sides on a rug, inside up. Two in each, at the fixed shelf's holes in the middle, pushed in and screwed until they stop.",
- add: ["L", "R"],
- fix: sides((sx, id) => [{ ...fx("camScrew", id, [sx, 0, 0], [-90, 90].map((z) => [sx * xi, yF, pzc + z]), CAM_BOLT), mate: "F" }]),
- from: { L: [-300, 0, 0], R: [300, 0, 0] },
- tools: ["screwdriver"],
- pose: "+z",
- warnings: ["floor"],
- });
- steps.push({
- title: "Tap dowels into the fixed shelf and fit it between the sides",
- detail: "Two in each end. Press it onto one side, then fold the other side up onto it.",
- add: ["F"],
- fix: [-1, 1].map((sx) => ({ ...fx("dowel", "F", [sx, 0, 0], [-30, 30].map((z) => [sx * xi, yF, pzc + z]), DOWEL), mate: sx < 0 ? "L" : "R" })),
- from: { F: [0, 0, 300] },
- tools: ["hammer"],
- });
- steps.push({
- title: "Turn the cam locks in the fixed shelf",
- detail: "Four of them, open side towards the bolt. Turn each clockwise until it pulls the joint tight.",
- fix: [fx("cam", "F", [0, -1, 0], [-1, 1].flatMap((sx) => [-90, 90].map((z) => [sx * (xi - 32), yF + T / 2, pzc + z] as Vec3)), { dia: 15 })],
- tools: ["screwdriver"],
- });
- const endPanel = (id: string, y: number, top: boolean): CustomStep[] => [
- {
- title: top ? "Tap dowels into the top panel and fit it" : "Tap dowels into the bottom panel and fit it",
- detail: top ? "Two in each end. Turn it onto the ends of the sides, its edge flush with them." : "Two in each end. Turn it up between the sides at the base end, edge flush with them.",
- add: [id],
- fix: [-1, 1].map((sx) => ({ ...fx("dowel", id, [sx, 0, 0], [-60, 60].map((z) => [sx * xi, y, pzc + z]), DOWEL), mate: sx < 0 ? "L" : "R" })),
- from: { [id]: [0, top ? 300 : -300, 0] },
- tools: ["hammer"],
- },
- {
- title: top ? "Screw the sides to the top" : "Screw the sides to the bottom",
- detail: "Three long screws through each side with the Allen key. Stop as soon as the head sits flush.",
- fix: sides((sx, side) => [{ ...fx("screw", side, [-sx, 0, 0], zs3.map((z) => [sx * xo, y, z]), ALLEN_SCREW), mate: id }]),
- tools: ["allen"],
- warnings: ["hand"],
- },
- ];
- steps.push(...endPanel("B", yB, false));
- steps.push({
- title: "Slide the back panel into the grooves",
- detail: "From the top end, all the way down, the grooved boards facing the front.",
- add: ["K"],
- from: { K: [0, 1400, 0] },
- });
- steps.push({ title: "Stand it up and check the back", detail: "The back must sit down in the groove of the bottom panel all the way along.", pose: "+y", people: 2, warnings: ["two"] });
- steps.push({
- title: "Rivet the back to the fixed shelf",
- detail: "From behind: push each sleeve through the back into the shelf's edge, then press its pin in.",
- fix: [{ ...fx("clip", "K", [0, 0, 1], [-210, -70, 70, 210].map((x) => [x, yF, zb - 5]), { len: 12, dia: 8, name: "Plastic rivet" }), mate: "F" }],
- });
- steps.push(...endPanel("P", yP, true).map((st, i) => (i ? st : { ...st, pose: "+z" as const })));
- steps.push({
- title: "Tap dowels into the tops of the sides",
- detail: "Two in each end, for the crown.",
- fix: sides((sx, id) => [{ ...fx("dowel", id, [0, -1, 0], [-60, 60].map((z) => [sx * (xo - T / 2), y1, pzc + z]), DOWEL), mate: sx < 0 ? "CL" : "CR" }]),
- tools: ["hammer"],
- });
- // the crown
- steps.push({
- title: "Screw two cam bolts into the crown front",
- detail: "Into its back, one near each end, by hand until they stop. Then lay it at the top end.",
- add: ["CF"],
- from: { CF: [0, 300, 0] },
- fix: [-1, 1].map((sx) => ({ ...fx("camScrew", "CF", [0, 0, 1], [[sx * (W / 2 - 10), H - CH / 2 - 8, D / 2 - 20]], CAM_BOLT), mate: sx < 0 ? "CL" : "CR" })),
- tools: ["screwdriver"],
- });
- steps.push({
- title: "Push the crown sides onto the front",
- detail: "Two dowels into the front end of each first. Then cam-lock each one tight.",
- add: ["CL", "CR"],
- fix: [
- ...[-1, 1].map((sx) => ({ ...fx("dowel", sx < 0 ? "CL" : "CR", [0, 0, -1], [H - CH + 8, H - 8].map((y) => [sx * (W / 2 - 10), y, D / 2 - 20]), DOWEL), mate: "CF" })),
- ...[-1, 1].map((sx) => fx("cam", sx < 0 ? "CL" : "CR", [0, 1, 0], [[sx * (W / 2 - 10), H - CH, D / 2 - 60]], { dia: 15 })),
- ],
- from: { CL: [-300, 0, 0], CR: [300, 0, 0] },
- tools: ["screwdriver", "hammer"],
- });
- steps.push({
- title: "Screw the crown on from inside",
- detail: "Six dowels hold it on the top. Then four screws with washers up through the top panel into the crown.",
- fix: [
- { ...fx("dowel", "P", [0, -1, 0], [-120, 120].map((x) => [x, y1, zf - 6]), DOWEL), mate: "CF" },
- ...[-1, 1].map((sx) => ({ ...fx("dowel", sx < 0 ? "L" : "R", [0, -1, 0], [-130, 0].map((z) => [sx * (xo - 6), y1, z]), DOWEL), mate: sx < 0 ? "CL" : "CR" })),
- { ...fx("screw", "P", [0, 1, 0], [[-200, y1 - T, zf - 30], [200, y1 - T, zf - 30], [-xi + 30, y1 - T, -60], [xi - 30, y1 - T, -60]], { len: 30, dia: 4 }), mate: "CF" },
- fx("washer", "P", [0, 1, 0], [[-200, y1 - T, zf - 30], [200, y1 - T, zf - 30], [-xi + 30, y1 - T, -60], [xi - 30, y1 - T, -60]], { len: 1.5, dia: 14 }),
- ],
- tools: ["screwdriver"],
- });
- // the base
- const xb = W / 2 - T / 2;
- steps.push({
- title: "Screw ten cam pins into the bottom end",
- detail: "Two into the end of each side, three along the front and three along the back of the bottom panel, by hand until they stop.",
- fix: [
- ...sides((sx, id) => [{ ...fx("camScrew", id, [0, 1, 0], [-100, 80].map((z) => [sx * (xo - T / 2), y0, z]), CAM_PIN), mate: sx < 0 ? "BL" : "BR" }]),
- { ...fx("camScrew", "B", [0, 1, 0], [-180, 0, 180].map((x) => [x, y0, zf - 30]), CAM_PIN), mate: "BF" },
- { ...fx("camScrew", "B", [0, 1, 0], [-180, 0, 180].map((x) => [x, y0, pz0 + 25]), CAM_PIN), mate: "BK" },
- ],
- tools: ["screwdriver"],
- });
- steps.push({
- title: "Fit the base front",
- detail: "Two dowels into each end first. Push it onto the pins at the front of the bottom.",
- add: ["BF"],
- fix: [-1, 1].map((sx) => ({ ...fx("dowel", "BF", [0, 0, 1], [BH - 12, BH - 36].map((y) => [sx * xb, y, D / 2 - T]), DOWEL), mate: sx < 0 ? "BL" : "BR" })),
- from: { BF: [0, -300, 0] },
- tools: ["hammer"],
- });
- steps.push({
- title: "Fit the base sides",
- detail: "Two cam pins into the front end of each. Push them onto the front and the pins under the sides, then cam-lock them to the front.",
- add: ["BL", "BR"],
- fix: [
- ...[-1, 1].map((sx) => ({ ...fx("camScrew", sx < 0 ? "BL" : "BR", [0, 0, -1], [40, 80].map((y) => [sx * xb, y, D / 2 - T]), CAM_PIN), mate: "BF" })),
- fx("cam", "BF", [0, 0, 1], [-1, 1].flatMap((sx) => [40, 80].map((y) => [sx * (xb - 36), y, D / 2 - T] as Vec3)), { dia: 15 }),
- ],
- from: { BL: [-300, 0, 0], BR: [300, 0, 0] },
- tools: ["screwdriver"],
- });
- const brk: Vec3[] = [-230, -80, 80, 230].map((x) => [x, BH - 20, -D / 2 + T]);
- steps.push({
- title: "Fit the back rail on its brackets",
- detail: "A dowel into each end and four angle brackets screwed along its top. Push it in between the base sides.",
- add: ["BK"],
- fix: [
- ...[-1, 1].map((sx) => ({ ...fx("dowel", "BK", [sx, 0, 0], [[sx * (W / 2 - T), BH - 20, -D / 2 + T / 2]], DOWEL), mate: sx < 0 ? "BL" : "BR" })),
- fx("angle", "BK", [0, 0, -1], brk, { len: 30, dia: 24, name: "Angle bracket" }),
- fx("screw", "BK", [0, 0, -1], brk.map((p) => [p[0], p[1] - 8, p[2]]), SMALL),
- ],
- from: { BK: [0, 0, -300] },
- tools: ["screwdriver"],
- });
- steps.push({
- title: "Click the corner blocks in and screw the brackets up",
- detail: "A plastic block in each inside corner of the base, A and B as marked. Then a screw up through each bracket into the bottom.",
- fix: [
- fx("connector", "BF", [0, 0, 1], [-1, 1].map((sx) => [sx * (W / 2 - T - 25), 50, D / 2 - T]), { len: 50, dia: 30, name: "Corner block" }),
- fx("connector", "BK", [0, 0, -1], [-1, 1].map((sx) => [sx * (W / 2 - T - 25), 50, -D / 2 + T]), { len: 50, dia: 30, name: "Corner block" }),
- { ...fx("screw", "BK", [0, 1, 0], brk.map((p) => [p[0], BH, p[2] + 12]), SMALL), mate: "B" },
- ],
- tools: ["screwdriver"],
- });
- steps.push({
- title: "Turn the cam locks in the base",
- detail: "Two in each side and three in the back rail, each turned clockwise until it's tight.",
- fix: [
- ...[-1, 1].map((sx) => fx("cam", sx < 0 ? "BL" : "BR", [sx, 0, 0], [-100, 80].map((z) => [sx * (W / 2 - T), BH - 20, z]), { dia: 15 })),
- fx("cam", "BK", [0, 0, -1], [-180, 0, 180].map((x) => [x, BH - 16, -D / 2 + T]), { dia: 15 }),
- ],
- tools: ["screwdriver"],
- });
- steps.push({
- title: "Stand it up and lock the base front",
- detail: "Two of you lift it upright. Then three cam locks in the back of the base front, under the bottom shelf.",
- pose: "+y",
- people: 2,
- fix: [fx("cam", "BF", [0, 0, 1], [-180, 0, 180].map((x) => [x, BH - 16, D / 2 - T]), { dia: 15 })],
- tools: ["screwdriver"],
- warnings: ["two"],
- });
- steps.push({
- title: "Press the clips onto the back",
- detail: "Eight of them, four down each side. Each clip goes on in two halves, pressed together by hand.",
- fix: [fx("clip", "K", [0, 0, 1], [-1, 1].flatMap((sx) => [0.15, 0.4, 0.65, 0.9].map((f) => [sx * (xi - 12), y0 + (y1 - y0) * f, zb - 5] as Vec3)), { len: 16, dia: 12, name: "Back clip" })],
- });
- const wallPts: Vec3[] = [-1, 1].map((sx) => [sx * (xi - 90), y1, zb + 30]);
- steps.push({
- title: "Fix it to the wall",
- detail: "Screw the two brackets onto the top with a washer each, then screw them to the wall through the other washers. Screws and plugs for your wall aren't included.",
- fix: [
- fx("bracket", "P", [0, -1, 0], wallPts, { len: 60, dia: 40 }),
- fx("washer", "P", [0, -1, 0], wallPts.map((p) => [p[0], p[1], p[2] + 25]), { len: 1.5, dia: 16 }),
- fx("screw", "P", [0, -1, 0], wallPts.map((p) => [p[0], p[1], p[2] + 25]), { len: 13, dia: 4 }),
- fx("plug", "P", [0, 0, -1], wallPts.map((p) => [p[0], p[1] + 25, -D / 2 - 30])),
- fx("washer", "P", [0, 0, -1], wallPts.map((p) => [p[0], p[1] + 25, -D / 2]), { len: 1.5, dia: 16 }),
- fx("screw", "P", [0, 0, -1], wallPts.map((p) => [p[0], p[1] + 25, -D / 2]), { len: 50, dia: 5 }),
- ],
- tools: ["drill", "pencil", "screwdriver"],
- wall: true,
- warnings: ["wall", "tip"],
- });
- const ids = shelfYs.map((_, i) => `S${i}`);
- steps.push({
- title: "Put the shelves in",
- detail: "Push four pins in level for each shelf, then lay the shelf on them.",
- add: ids,
- fix: sides((sx, id) => [fx("pin", id, [sx, 0, 0], shelfYs.flatMap((y) => [zf - 40, zf - sDepth + 20].map((z) => [sx * xi, y - T / 2 - 3, z] as Vec3)), { len: 12, dia: 5 })]),
- from: Object.fromEntries(ids.map((id) => [id, [0, 0, 300] as Vec3])),
- });
- return { parts, steps };
-}
-
/* ---------- the cabinets and the TV bench, drawn step by step ---------- */
/*
@@ -619,8 +370,8 @@ function drawerSteps(sh: Shop, dr: ReturnType<typeof drawerParts>, o: { knobs: n
const bar: HwDef = { kind: "connector", len: Math.round(dw - 30), dia: 15, name: "Stabiliser bar" };
sh.step({ title: "Fit the stabiliser bar", detail: "Turn the drawer over. Lay the bar across the back and fix it with three small screws.", tools: ["screwdriver"], scene, kind: "screws" }, () => {
sh.lay(d.keys, [0, 0, 0], [0, -y0, 0]);
- sh.fits(bar, [on(d.back, [xc, y0 + 22, dz0], [0, 0, 1], { hole: false, twist: 0 })]);
- sh.fits(H_BAR_SCREW, sp(3, xc - dw / 2 + 60, xc + dw / 2 - 60).map((x) => on(d.back, [x, y0 + 22, dz0], [0, 0, 1])));
+ sh.fits(bar, [on(d.back, [xc, y0 + 52, dz0], [0, 0, 1], { hole: false, twist: 0 })]);
+ sh.fits(H_BAR_SCREW, sp(3, xc - dw / 2 + 60, xc + dw / 2 - 60).map((x) => on(d.back, [x, y0 + 52, dz0], [0, 0, 1])));
});
const kx = o.knobs === 1 ? [xc] : [xc - dw / 3, xc + dw / 3];
const ky = y0 + (h + 46) / 2;
@@ -1063,6 +814,202 @@ function tvBench(b: PlanBuilder, s: ProductSpec) {
return true;
}
+/* ---------- the bookcase ---------- */
+
+const B_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 7, name: "Cam bolt" }; // the expanding kind, pushed in and screwed
+const B_ALLEN: HwDef = { kind: "screw", len: 50, dia: 7, name: "Allen screw" };
+const B_SCREW: HwDef = { kind: "screw", len: 30, dia: 4 };
+const B_WASHER: HwDef = { kind: "washer", len: 1.5, dia: 14 };
+const B_BRACKET: HwDef = { kind: "bracket", len: 60, dia: 40 };
+const B_PIN: HwDef = { kind: "pin", len: 12, dia: 5 };
+
+/*
+ * The carcass is built lying on its back: the fixed shelf goes onto the cam bolts in one side and the other side
+ * comes down onto it, the bottom and top panels are turned in between the sides on their dowels and screwed through
+ * the sides. The crown and the base are each built on the rug as a U (a front and two sides on dowels and cam locks)
+ * and pushed onto the ends of the carcass along their dowels and pins; the base's back rail goes on after them.
+ */
+function bookcase(b: PlanBuilder, s: ProductSpec) {
+ const sh = new Shop(b);
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const xo = W / 2 - O; // outside of the carcass sides
+ const xi = xo - T; // inside
+ const zb = -D / 2 + 5; // back panel, in the grooves
+ const zf = D / 2 - O; // front of the carcass
+ const pz0 = zb + 5, pd = zf - pz0, pzc = pz0 + pd / 2; // the panels between the sides
+ const y0 = BH, y1 = H - CH; // the carcass
+ const yB = y0 + T / 2, yP = y1 - T / 2, yF = r((yB + yP) / 2);
+ const xj = W / 2 - O - 2.5; // where the crown and base sides overlap the carcass sides
+ const zj = D / 2 - T + 1.5; // where the base front overlaps the bottom panel
+ const zc = D / 2 - 20 + 3; // where the crown front overlaps the top panel
+
+ const [L, R] = [-1, 1].map((sx) => sh.part("Side panel", [T, y1 - y0, D - O], [sx * (xo - T / 2), (y0 + y1) / 2, -O / 2]));
+ const F = sh.part("Fixed shelf", [2 * xi, T, pd], [0, yF, pzc]);
+ const B = sh.part("Bottom panel", [2 * xi, T, pd], [0, yB, pzc]);
+ const K = sh.part("Back panel", [2 * xi, y1 - y0, 10], [0, (y0 + y1) / 2, zb], { material: "fiber" });
+ const P = sh.part("Top panel", [2 * xi, T, pd], [0, yP, pzc]);
+ // the crown: a front rail across the whole width and two side pieces behind its ends
+ const CF = sh.part("Crown front", [W, CH, 20], [0, H - CH / 2, D / 2 - 10]);
+ const [CL, CR] = [-1, 1].map((sx) => sh.part("Crown side", [20, CH, D - 20], [sx * (W / 2 - 10), H - CH / 2, -10]));
+ // the base: a shaped apron with two feet, two side legs with a foot at each end, a back rail
+ const apron: PartPiece[] = [box([W, 40, T], [0, BH / 2 - 20, 0]), ...[-1, 1].map((sx) => box([70, BH - 40, T], [sx * (W / 2 - 35), -20, 0]))];
+ const BF = sh.part("Base front", [W, BH, T], [0, BH / 2, D / 2 - T / 2], { pieces: apron });
+ const sd = D - T;
+ const legP: PartPiece[] = [box([T, 40, sd], [0, BH / 2 - 20, 0]), ...[-1, 1].map((sz) => box([T, BH - 40, 60], [0, -20, sz * (sd / 2 - 30)]))];
+ const [BL, BR] = [-1, 1].map((sx) => sh.part("Base side", [T, BH, sd], [sx * (W / 2 - T / 2), BH / 2, -T / 2], { pieces: legP }));
+ const BK = sh.part("Base back rail", [W - 2 * T, 40, T], [0, BH - 20, -D / 2 + T / 2]);
+ const shelfYs = [y0 + (yF - y0) * 0.5, yF + (yP - yF) * 0.36, yF + (yP - yF) * 0.68];
+ const sDepth = Math.min(280, pd - 10);
+ const shelves = shelfYs.map((y) => sh.part("Shelf", [2 * xi - 2, T, sDepth], [0, y, zf - 10 - sDepth / 2]));
+
+ const sides = [L, R];
+ const both = <X>(f: (sx: number, k: string, i: number) => X[]) => sides.flatMap((k, i) => f(sgn(i), k, i));
+ const zs3 = [-pd / 2 + 50, 0, pd / 2 - 50].map((z) => pzc + z);
+ const lying = { pose: "+z" as const };
+ const fin = (k: string) => b.partItem(k).final;
+
+ sh.step({ title: "Screw cam bolts into both sides", detail: "Lay the sides on a rug, inside up. Two in each, at the fixed shelf's holes in the middle, pushed in and screwed until they stop.", tools: ["screwdriver"], kind: "cams", warnings: ["floor"], ...lying }, () => {
+ sh.add([L], [-300, 0, 0]);
+ const p = fin(R).pos;
+ b.stage(R, [p[0] + 450, p[1], p[2]], fin(R).rot, [0, 0, 250]);
+ b.then(0.15);
+ sh.fits(B_BOLT, both((sx, k) => [-90, 90].map((z) => on(k, [sx * xi, yF, pzc + z], [-sx, 0, 0], { mate: F }))));
+ });
+ sh.step({ title: "Fit the fixed shelf between the sides", detail: "Push it onto the bolts in one side, then bring the other side onto it.", kind: "join", ...lying }, () => {
+ sh.add([F], [350, 0, 0]);
+ sh.add([R], [450, 0, 0]);
+ });
+ sh.step({ title: "Turn the cam locks in the fixed shelf", detail: "Four of them, open side towards the bolt. Turn each clockwise until it pulls the joint tight.", tools: ["screwdriver"], kind: "cams", ...lying }, () =>
+ sh.fits(H_CAM, [-1, 1].flatMap((sx) => [-90, 90].map((z) => on(F, [sx * (xi - 32), yF + T / 2, pzc + z], [0, -1, 0])))),
+ );
+ // the bottom and the top panels: dowels in while held out past the end, then turned in between the sides
+ const endPanel = (k: string, y: number, top: boolean) => {
+ const out = top ? 160 : -160;
+ sh.step({ title: top ? "Tap dowels into the top panel" : "Tap dowels into the bottom panel", detail: "Two in each end, tapped in until they stop.", tools: ["hammer"], kind: "dowels", ...lying }, () => {
+ b.stage(k, [0, y + out, pzc], [top ? 0.6 : -0.6, 0, 0], [0, out, 0]);
+ b.then(0.15);
+ sh.fits(H_DOWEL, [-1, 1].flatMap((sx) => [-60, 60].map((z) => on(k, [sx * xi, y, pzc + z], [-sx, 0, 0], { mate: sx < 0 ? L : R }))));
+ });
+ sh.step({ title: top ? "Turn the top panel in between the sides" : "Turn the bottom panel in between the sides", detail: "Tip it in at the end, dowels into the holes, its edge flush with the ends of the sides.", kind: "join", ...lying }, () => sh.add([k], [0, out, 0]));
+ sh.step({ title: top ? "Screw the sides to the top" : "Screw the sides to the bottom", detail: "Three long screws through each side with the Allen key. Stop as soon as the head sits flush.", tools: ["allen"], kind: "screws", warnings: ["hand"], ...lying }, () =>
+ sh.fits(B_ALLEN, both((sx, k2) => zs3.map((z) => on(k2, [sx * xo, y, z], [-sx, 0, 0], { mate: k })))),
+ );
+ };
+ endPanel(B, yB, false);
+ sh.step({ title: "Slide the back panel into the grooves", detail: "From the top end, all the way down, the grooved boards facing the front.", kind: "join", ...lying }, () => sh.add([K], [0, 1400, 0]));
+ sh.step({ title: "Stand it up and check the back", detail: "The back must sit down in the groove of the bottom panel all the way along.", kind: "standup", people: 2 });
+ sh.step({ title: "Rivet the back to the fixed shelf", detail: "From behind: push each sleeve through the back into the shelf's edge, then press its pin in.", kind: "general" }, () =>
+ sh.fits(H_RIVET, [-210, -70, 70, 210].map((x) => on(K, [x, yF, zb - 5], [0, 0, 1], { mate: F }))),
+ );
+ endPanel(P, yP, true);
+ sh.step({ title: "Tap dowels into the tops of the sides", detail: "Two in each end, for the crown.", tools: ["hammer"], kind: "dowels", ...lying }, () =>
+ sh.fits(H_DOWEL, both((sx, k) => [-60, 60].map((z) => on(k, [sx * xj, y1, pzc + z], [0, -1, 0], { mate: sx < 0 ? CL : CR })))),
+ );
+
+ // the crown, upside down on the rug
+ const cPiv: Vec3 = [0, H - CH / 2, 0], cAt: Vec3 = [0, CH / 2, 0], upd: Vec3 = [PI, 0, 0];
+ const cs = [CL, CR];
+ sh.step({ title: "Screw two cam bolts into the crown front", detail: "Lay it upside down on the rug. One into its back near each end, until it stops.", tools: ["screwdriver"], scene: "crown", kind: "cams", warnings: ["floor"] }, () => {
+ sh.lay([CF], cPiv, cAt, upd);
+ sh.fits(B_BOLT, [-1, 1].map((sx) => on(CF, [sx * (W / 2 - 10), H - CH / 2 + 8, D / 2 - 20], [0, 0, 1], { mate: sx < 0 ? CL : CR })));
+ });
+ sh.step({ title: "Tap a dowel into each crown side", detail: "In its front end, where it meets the crown front.", tools: ["hammer"], scene: "crown", kind: "dowels" }, () => {
+ sh.lay(cs, cPiv, [0, CH / 2, 250], upd, [0, 0, 200]);
+ sh.fits(H_DOWEL, cs.map((k, i) => on(k, [sgn(i) * (W / 2 - 10), H - CH / 2 - 10, D / 2 - 20], [0, 0, -1], { mate: CF })));
+ });
+ sh.step({ title: "Join the crown into a U", detail: "Push the sides onto the front, then turn a cam lock in each until it's tight.", tools: ["screwdriver"], scene: "crown", kind: "cams" }, () => {
+ sh.lay(cs, cPiv, cAt, upd);
+ sh.fits(H_CAM, cs.map((k, i) => on(k, [sgn(i) * (W / 2 - 10), H - CH, D / 2 - 60], [0, 1, 0])));
+ });
+ sh.step({ title: "Tap dowels into the crown", detail: "Six along the edge that sits on the top: two in the front, two in each side.", tools: ["hammer"], scene: "crown", kind: "dowels" }, () =>
+ sh.fits(H_DOWEL, [
+ ...[-150, 150].map((x) => on(CF, [x, H - CH, zc], [0, 1, 0], { mate: P })),
+ ...cs.flatMap((k, i) => [-130, 0].map((z) => on(k, [sgn(i) * xj, H - CH, z], [0, 1, 0], { mate: sides[i] }))),
+ ]),
+ );
+ sh.step({ title: "Push the crown onto the top end", detail: "Lay the bookcase on its back again. Push the crown straight on, dowels into the holes, front flush with the front.", kind: "join", ...lying }, () => sh.add([CF, ...cs], [0, 300, 0], 0.02));
+ const crownScrews = [-200, -70, 70, 200].map((x) => on(P, [x, y1 - T, zc], [0, 1, 0], { mate: CF }));
+ sh.step({ title: "Screw the crown on from inside", detail: "Four screws, each with a washer, up through the top panel into the crown.", tools: ["screwdriver"], kind: "screws", ...lying }, () => {
+ sh.fits(B_WASHER, crownScrews.map((f) => ({ ...f, hole: false as const })));
+ sh.fits(B_SCREW, crownScrews);
+ });
+
+ // the base
+ const zp = [-100, 80];
+ const zBk = -D / 2 + T + 2; // where the back rail overlaps the bottom panel
+ sh.step({ title: "Screw ten cam pins into the bottom end", detail: "Two into the end of each side, three along the front and three along the back of the bottom panel, by hand until they stop.", tools: ["screwdriver"], kind: "cams", ...lying }, () =>
+ sh.fits(H_PIN, [
+ ...both((sx, k, i) => zp.map((z) => on(k, [sx * xj, y0, z], [0, 1, 0], { mate: i ? BR : BL }))),
+ ...[-180, 0, 180].map((x) => on(B, [x, y0, zj], [0, 1, 0], { mate: BF })),
+ ...[-180, 0, 180].map((x) => on(B, [x, y0, zBk], [0, 1, 0], { mate: BK })),
+ ]),
+ );
+ const o3: Vec3 = [0, 0, 0];
+ const xb = W / 2 - T / 2;
+ const bs = [BL, BR];
+ sh.step({ title: "Tap dowels into the base front", detail: "Stand it on the rug. Two in each end of its inside face.", tools: ["hammer"], scene: "base", kind: "dowels", warnings: ["floor"] }, () => {
+ sh.lay([BF], o3, o3);
+ sh.fits(H_DOWEL, [-1, 1].flatMap((sx) => [BH - 12, BH - 36].map((y) => on(BF, [sx * xb, y, D / 2 - T], [0, 0, 1], { mate: sx < 0 ? BL : BR }))));
+ });
+ const baseCams = [-1, 1].flatMap((sx) => [25, 50].map((y): Vec3 => [sx * xb, y, D / 2 - T]));
+ sh.step({ title: "Screw cam pins into the base sides", detail: "Two in the front end of each, turned in until the collar meets the wood.", tools: ["screwdriver"], scene: "base", kind: "cams" }, () => {
+ sh.lay(bs, o3, [0, 0, -250], o3, [0, 0, -200]);
+ sh.fits(H_PIN, baseCams.map((p) => on(p[0] < 0 ? BL : BR, p, [0, 0, -1], { mate: BF })));
+ });
+ sh.step({ title: "Join the sides to the base front", detail: "Push each side onto the dowels, pins into the holes. Turn the four cam locks clockwise until they're tight.", tools: ["screwdriver"], scene: "base", kind: "cams" }, () => {
+ sh.lay(bs, o3, o3);
+ sh.fits(H_CAM, baseCams.map((p) => on(BF, [p[0] - Math.sign(p[0]) * 36, p[1], p[2]], [0, 0, 1])));
+ });
+ sh.step({ title: "Tap dowels into the top of the base", detail: "Six along its top edge: two in the front, two in each side.", tools: ["hammer"], scene: "base", kind: "dowels" }, () =>
+ sh.fits(H_DOWEL, [
+ ...[-150, 150].map((x) => on(BF, [x, BH, zj], [0, -1, 0], { mate: B })),
+ ...bs.flatMap((k, i) => [-130, 30].map((z) => on(k, [sgn(i) * xj, BH, z], [0, -1, 0], { mate: sides[i] }))),
+ ]),
+ );
+ sh.step({ title: "Push the base onto the bottom end", detail: "Straight on, dowels and pins into their holes, front flush with the front.", kind: "join", ...lying }, () => sh.add([BF, ...bs], [0, -300, 0], 0.02));
+ const brk: Vec3[] = [-230, -80, 80, 230].map((x) => [x, BH - 20, -D / 2 + T]);
+ sh.step({ title: "Fit dowels and brackets on the back rail", detail: "A dowel into each end and four angle brackets along its inside face, flush with the top, one screw each.", tools: ["hammer", "screwdriver"], scene: "rail", kind: "screws", warnings: ["floor"] }, () => {
+ sh.lay([BK], fin(BK).pos, [0, 20, 0]);
+ sh.fits(H_DOWEL, [-1, 1].map((sx) => on(BK, [sx * (W / 2 - T), BH - 20, -D / 2 + T / 2], [-sx, 0, 0], { mate: sx < 0 ? BL : BR })));
+ sh.fits(H_ANGLE, brk.map((p) => on(BK, p, [0, 0, -1], { hole: false })));
+ sh.fits(H_SMALL, brk.map((p) => on(BK, [p[0], p[1] - 8, p[2]], [0, 0, -1])));
+ });
+ sh.step({ title: "Fit the back rail", detail: "Spring the base sides out a little and push it in between them, onto the pins and dowels.", kind: "join", ...lying }, () => sh.add([BK], [0, -250, 0]));
+ sh.step({ title: "Click the corner blocks in and screw the brackets up", detail: "A plastic block in each inside corner of the base, A and B as marked. Then a screw up through each bracket into the bottom.", tools: ["screwdriver"], kind: "screws", ...lying }, () => {
+ sh.fits(H_BLOCK, [
+ ...[-1, 1].map((sx) => on(BF, [sx * (W / 2 - T - 25), 50, D / 2 - T], [0, 0, 1], { hole: false })),
+ ...[-1, 1].map((sx) => on(BK, [sx * (W / 2 - T - 25), 50, -D / 2 + T], [0, 0, -1], { hole: false })),
+ ]);
+ sh.fits(H_SMALL, brk.map((p) => on(BK, [p[0], BH, p[2] + 12], [0, 1, 0], { mate: B })));
+ });
+ sh.step({ title: "Turn the cam locks in the base", detail: "Two in each side and three in the back rail, each turned clockwise until it's tight.", tools: ["screwdriver"], kind: "cams", ...lying }, () =>
+ sh.fits(H_CAM, [
+ ...bs.flatMap((k, i) => zp.map((z) => on(k, [sgn(i) * (W / 2 - T), BH - 20, z], [sgn(i), 0, 0]))),
+ ...[-180, 0, 180].map((x) => on(BK, [x, BH - 16, -D / 2 + T], [0, 0, -1])),
+ ]),
+ );
+ sh.step({ title: "Stand it up and lock the base front", detail: "Two of you lift it upright. Then three cam locks in the back of the base front, under the bottom shelf.", tools: ["screwdriver"], kind: "cams", people: 2 }, () =>
+ sh.fits(H_CAM, [-180, 0, 180].map((x) => on(BF, [x, BH - 16, D / 2 - T], [0, 0, 1]))),
+ );
+ sh.step({ title: "Press the clips onto the back", detail: "Eight of them, four down each side. Each clip goes on in two halves, pressed together by hand.", kind: "general" }, () =>
+ sh.fits(H_CLIP, [-1, 1].flatMap((sx) => [0.15, 0.4, 0.65, 0.9].map((f) => on(K, [sx * (xi - 12), y0 + (y1 - y0) * f, zb - 5], [0, 0, 1], { hole: false })))),
+ );
+ const wallPts: Vec3[] = [-1, 1].map((sx) => [sx * (xi - 90), y1, zb + 30]);
+ sh.step({ title: "Fix it to the wall", detail: "Screw the two brackets onto the top with a washer each, then screw them to the wall through the other washers. Screws and plugs for your wall aren't included.", tools: ["drill", "pencil", "screwdriver"], kind: "anchor", wall: true, warnings: ["wall", "tip"] }, () => {
+ sh.fits(B_BRACKET, wallPts.map((p) => on(P, p, [0, -1, 0], { hole: false })));
+ sh.fits(H_WASHER, wallPts.map((p) => on(P, [p[0], p[1], p[2] + 25], [0, -1, 0], { hole: false })));
+ sh.fits(H_SMALL, wallPts.map((p) => on(P, [p[0], p[1], p[2] + 25], [0, -1, 0])));
+ sh.fits(H_PLUG, wallPts.map((p) => ({ at: [p[0], p[1] + 25, -D / 2 - 30] as Vec3, dir: [0, 0, -1] as Vec3 })));
+ sh.fits(H_WASHER, wallPts.map((p) => on(P, [p[0], p[1] + 25, -D / 2], [0, 0, -1], { hole: false })));
+ sh.fits(H_WALL_SCREW, wallPts.map((p) => on(P, [p[0], p[1] + 25, -D / 2], [0, 0, -1])));
+ });
+ sh.step({ title: "Put the shelves in", detail: "Push four pins in level for each shelf, then lay the shelf on them.", kind: "shelves" }, () => {
+ sh.fits(B_PIN, both((sx, k) => shelfYs.flatMap((y) => [zf - 40, zf - sDepth + 20].map((z) => on(k, [sx * xi, y - T / 2 - 3, z], [sx, 0, 0])))), 0.03);
+ sh.add(shelves, [0, 0, 300]);
+ });
+ return true;
+}
+
const family: Family = {
names: ["LOMMARP"],
build(b, s) {
@@ -1070,11 +1017,8 @@ const family: Family = {
if (/^lommarp-cabinet-glass-doors/.test(slug)) return glassCabinet(b, s);
if (/^lommarp-cabinet-102/.test(slug)) return cabinet102(b, s);
if (/^lommarp-tv-bench/.test(slug)) return tvBench(b, s);
+ if (/^lommarp-bookcase/.test(slug)) return bookcase(b, s);
return false;
},
- recipe(s) {
- if (/^lommarp-bookcase/.test(s.slug ?? "")) return bookcase(s);
- return null;
- },
};
export default family;
diff --git a/src/lib/plan/families/loparbana.ts b/src/lib/plan/families/loparbana.ts
index ee5c5cb..ff65f35 100644
--- a/src/lib/plan/families/loparbana.ts
+++ b/src/lib/plan/families/loparbana.ts
@@ -98,7 +98,7 @@ function recipe(s: ProductSpec): CustomParams {
});
const castors = angles.map((a, i) => fx("castor", [[dirOf(a)[0] * (R - 15), castor, dirOf(a)[1] * (R - 15)]], [0, 1, 0], `A${i + 1}`, { len: castor, dia: 50 }));
const mechBolts = [-1, 1].flatMap((sx) => [zs - 90, zs + 70].map((z): Vec3 => [sx * 75, yMech0 + 50, z]));
- const bracket: Vec3[] = [-1, 1].flatMap((sx) => [zs - 170, zs - 120].map((z): Vec3 => [sx * 25, yMech0, z]));
+ const bracket: Vec3[] = [-1, 1].flatMap((sx) => [zs - 120, zs - 75].map((z): Vec3 => [sx * 25, yMech0, z]));
const BIG = { name: "Allen bolt", len: 20, dia: 8 };
const steps: CustomStep[] = [
{
@@ -129,7 +129,8 @@ function recipe(s: ProductSpec): CustomParams {
title: "Bolt the back frame to the mechanism",
detail: "Slide the frame's bracket into the back of the mechanism. Four bolts, each with a lock washer under its head.",
add: ["FRAME"],
- fix: [fx("washer", bracket, [0, 1, 0], "FRAME", { len: 2, dia: 14 }), fx("bolt", bracket, [0, 1, 0], "FRAME", { ...BIG, mate: "MECH" })],
+ // the lock washers stack on the bolts, so the bolts are listed first
+ fix: [fx("bolt", bracket, [0, 1, 0], "FRAME", { ...BIG, mate: "MECH" }), fx("washer", bracket, [0, 1, 0], "FRAME", { len: 2, dia: 14 })],
tools: ["allen"],
from: { FRAME: [0, 0, -360] },
},
diff --git a/src/lib/plan/families/lycksele.ts b/src/lib/plan/families/lycksele.ts
index 32434d8..e8e3400 100644
--- a/src/lib/plan/families/lycksele.ts
+++ b/src/lib/plan/families/lycksele.ts
@@ -163,7 +163,9 @@ function recipe(s: ProductSpec): CustomParams | null {
const both = (f: (sx: -1 | 1) => Vec3[]) => [...f(-1), ...f(1)];
const railPts = both((sx) => [[sx * ax, 250, -192], [sx * ax, 250, -168]] as Vec3[]);
const railNuts = railPts.map((p) => [p[0], 200, p[2]] as Vec3);
- const rollPts = both((sx) => [[sx * (hx + 9), 280, -150]] as Vec3[]);
+ // across, from inside the frame's side tube near its bottom end, out through the roller arm
+ const rollAt = (sx: number) => lb.p(sx * (hx - 25), 5, -12);
+ const rollPts = both((sx) => [rollAt(sx)] as Vec3[]);
const leverPts = both((sx) => [[sx * (hx + 10), 285, -385]] as Vec3[]);
const legPts = both((sx) => [[sx * lx, 287, zs1 - 18]] as Vec3[]);
const pivots = both((sx) => [[sx * (hx + 10), 280, -337]] as Vec3[]);
@@ -184,9 +186,13 @@ function recipe(s: ProductSpec): CustomParams | null {
},
{
title: "Bolt the roller arms to the backrest section",
- detail: "Stand the section on its long edge, one of you holding it. The rollers face out, as in the drawing. One bolt with a plain shank down through each bracket, washer and nut under it.",
+ detail: "Stand the section on its long edge, one of you holding it. The rollers face out, as in the drawing. One bolt with a plain shank through the side of the frame and each arm, washer and nut on the outside.",
add: ["B", "WL", "WR"],
- fix: [at("bolt", rollPts, [0, -1, 0], undefined, "B", SHANK), at("washer", rollPts.map((p) => [p[0], 262, p[2]] as Vec3), [0, 1, 0], undefined, undefined, WASHER), at("nut", rollPts.map((p) => [p[0], 258, p[2]] as Vec3), [0, 1, 0], undefined, undefined, NUT)],
+ fix: [
+ ...[-1, 1].map((sx) => at("bolt", [rollAt(sx)], [sx, 0, 0], "B", sx < 0 ? "WL" : "WR", SHANK)),
+ ...[-1, 1].map((sx) => at("washer", [[sx * (hx + 17), rollAt(sx)[1], rollAt(sx)[2]]], [-sx, 0, 0], undefined, undefined, WASHER)),
+ ...[-1, 1].map((sx) => at("nut", [[sx * (hx + 19), rollAt(sx)[1], rollAt(sx)[2]]], [-sx, 0, 0], undefined, undefined, NUT)),
+ ],
tools: ["allen", "wrench"],
people: 2,
warnings: ["two"],
diff --git a/src/lib/plan/families/mabarsskar.ts b/src/lib/plan/families/mabarsskar.ts
index 5190e7a..c66031e 100644
--- a/src/lib/plan/families/mabarsskar.ts
+++ b/src/lib/plan/families/mabarsskar.ts
@@ -85,10 +85,10 @@ function table(s: ProductSpec): CustomParams {
title: "Fit the second loop",
detail: "Push it through from the other side so its arch crosses the first one. One pan-head screw in each bracket.",
add: ["LB"],
- fix: [screws(-1, -6, { name: "Pan-head screw" })],
+ fix: [screws(-1, -11.5, { name: "Pan-head screw" })],
tools: ["screwdriver"],
},
- { title: "Add the last two countersunk screws", detail: "Into the second hole of each of its brackets, not tight yet.", fix: [screws(-1, 6, { name: "Countersunk screw" })], tools: ["screwdriver"] },
+ { title: "Add the last two countersunk screws", detail: "Into the second hole of each of its brackets, not tight yet.", fix: [screws(-1, 11.5, { name: "Countersunk screw" })], tools: ["screwdriver"] },
{ title: "Stand the table up and press the tray down", detail: "Turn it onto its floor bars and press the tray down so it sits level on all four brackets.", pose: "+y" },
{ title: "Tighten all six screws", detail: "Keep pressing on the tray while you do. The countersunk heads end up flush with the rim.", tools: ["screwdriver"] },
],
diff --git a/src/lib/plan/families/mackapar.ts b/src/lib/plan/families/mackapar.ts
index d3f84b3..0757c61 100644
--- a/src/lib/plan/families/mackapar.ts
+++ b/src/lib/plan/families/mackapar.ts
@@ -126,7 +126,7 @@ function coatRack(s: ProductSpec): CustomParams {
warnings: ["floor"],
},
{ title: "Turn the short tubes onto the top studs", detail: "The shortest four tubes, one on each tube end at the top of the frames.", add: ids("U") },
- { title: "Bolt on the top shelf", detail: "A flat bolt through each corner into the short tubes, tightened with a flat screwdriver.", add: ["T"], fix: [{ ...FLAT, count: 4, at: at4(xt, zt, H), dir: [0, -1, 0], on: "T" }], tools: ["flathead"] },
+ { title: "Bolt on the top shelf", detail: "A flat bolt through each corner into the short tubes, tightened with a flat screwdriver.", add: ["T"], fix: [{ ...FLAT, count: 4, at: at4(xt, zt, H - TR + 8), dir: [0, -1, 0], on: "T" }], tools: ["flathead"] }, // down through the tray's corner plate into the tube
{
title: "Screw the long tubes onto the frames",
detail: "Turn a stud into one end of each long tube first. The plain end goes onto the frame's stud.",
@@ -237,7 +237,7 @@ function shoeCabinet(s: ProductSpec): CustomParams {
detail: "On a rug. Three plates along the front of the bottom, four screws in each.",
fix: [
{ kind: "plate", count: 3, len: 50, dia: 50, at: legAt, dir: [0, 1, 0], on: "BOT" },
- { ...SCREW, count: 12, at: legAt.flatMap((p) => [[-14, -14], [14, -14], [14, 14], [-14, 14]].map(([dx, dz]): Vec3 => [p[0] + dx, y0 - 2, p[2] + dz])), dir: [0, 1, 0], on: "BOT" },
+ { ...SCREW, count: 12, at: legAt.flatMap((p) => [[-17, -17], [17, -17], [17, 17], [-17, 17]].map(([dx, dz]): Vec3 => [p[0] + dx, y0 - 2, p[2] + dz])), dir: [0, 1, 0], on: "BOT" },
],
tools: ["screwdriver"],
pose: "-y",
@@ -279,7 +279,7 @@ function shoeCabinet(s: ProductSpec): CustomParams {
add: ["BT0", "BT1"],
from: { BT0: [0, 0, 300], BT1: [0, 0, 300] },
},
- { title: "Screw in the door stops", detail: "One block inside each side, at the top by the front, two screws each.", fix: [...sides.map((sx): CustomFix => ({ kind: "spacer", name: "Door stop", count: 1, len: 20, dia: 30, at: [[sx * xi, yt - 40, zD2]], dir: [sx, 0, 0], on: sideId(sx) })), ...sides.map((sx): CustomFix => ({ ...SCREW, count: 2, at: [-10, 10].map((dy): Vec3 => [sx * xi, yt - 40 + dy, zD2]), dir: [sx, 0, 0], on: sideId(sx) }))], tools: ["screwdriver"] },
+ { title: "Screw in the door stops", detail: "One block inside each side, at the top by the front, two screws each.", fix: [...sides.map((sx): CustomFix => ({ kind: "spacer", name: "Door stop", count: 1, len: 20, dia: 30, at: [[sx * xi, yt - 40, zD2]], dir: [sx, 0, 0], on: sideId(sx) })), ...sides.map((sx): CustomFix => ({ ...SCREW, count: 2, at: [-24, 24].map((dy): Vec3 => [sx * xi, yt - 40 + dy, zD2]), dir: [sx, 0, 0], on: sideId(sx) }))], tools: ["screwdriver"] },
{
title: "Fit the runners and hang the back door",
detail: "Two runners at the top and two at the bottom of each door, two pins pressed into each. Tilt the door into the back track at the top, lower it onto the bottom track and click the locks shut.",
diff --git a/src/lib/plan/families/malm.ts b/src/lib/plan/families/malm.ts
index 9be03f8..7028a2d 100644
--- a/src/lib/plan/families/malm.ts
+++ b/src/lib/plan/families/malm.ts
@@ -33,7 +33,7 @@ const spread = (a: number, c: number, n: number) =>
function chestCount(s: ProductSpec) {
const m = /chest of (\d+) drawers/i.exec(s.variant);
const n = m ? Number(m[1]) : 0;
- // the chest of 6 drawers is two columns with a middle panel: not checked against its manual
+ // the wide chest of 6 drawers is two columns with a middle panel: buildChest6
if (n < 2 || n > 4 || s.size.w > 100) return 0;
return n;
}
@@ -675,15 +675,54 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
);
}
- /* ---------- the drawers ---------- */
+ chestDrawers(b, {
+ rows: n,
+ cols: [0],
+ hw: xi,
+ xs,
+ fh,
+ sh,
+ dd,
+ zf,
+ zd,
+ zBack,
+ runLen,
+ slotB,
+ ybox,
+ rod: wide,
+ });
+ return true;
+}
+
+interface DrawerGrid {
+ rows: number;
+ cols: number[]; // centre of each column of drawers
+ hw: number; // half the opening width of a column
+ xs: number; // drawer side centres, from the column centre
+ fh: number;
+ sh: number;
+ dd: number;
+ zf: number;
+ zd: number;
+ zBack: number;
+ runLen: number;
+ slotB: (i: number) => number;
+ ybox: (i: number) => number;
+ rod: boolean;
+}
+
+/** The MALM drawers: one is built on its front step by step, the rest the same, then they all slide in. */
+function chestDrawers(b: PlanBuilder, g: DrawerGrid) {
+ const { xs, fh, sh, dd, zf, zd, zBack, runLen, slotB, ybox } = g;
+ const RUNNER: HwDef = { kind: "runner", len: runLen, dia: 20 };
- const frT = b.part("Drawer front", [2 * xi - 4, fh, t]);
+ const frT = b.part("Drawer front", [2 * g.hw - 4, fh, t]);
const dsT = b.part("Drawer side", [12, sh, dd]);
const dbtT = b.part("Drawer bottom", [2 * xs, 3, dd - 12], {
material: "fiber",
});
const dbT = b.part("Drawer back", [2 * xs - 12, sh - 14, 12]);
- const rodT = wide
+ const rodT = g.rod
? b.part("Tilt stop rod", [8, 2 * xs + 10, 8], {
shape: "cyl",
material: "metal",
@@ -696,28 +735,33 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
back: string;
rod?: string;
y: number;
+ cx: number;
}
- const drawers: Drawer[] = range(n).map((i) => {
- const y = ybox(i);
- return {
- y,
- front: b.place(frT, [0, slotB(i) + 3 + fh / 2, zf - t / 2]),
- sides: [-1, 1].map((g) => b.place(dsT, [g * xs, y + sh / 2, zd])),
- bottom: b.place(dbtT, [0, y + 10, zf - t - (dd - 12) / 2]),
- back: b.place(dbT, [0, y + 14 + (sh - 14) / 2, zBack + 6]),
- rod: wide
- ? b.place(rodT, [0, y - 6, zBack + 30], [0, 0, Math.PI / 2])
- : undefined,
- };
- });
+ const drawers: Drawer[] = range(g.rows).flatMap((i) =>
+ g.cols.map((cx) => {
+ const y = ybox(i);
+ return {
+ y,
+ cx,
+ front: b.place(frT, [cx, slotB(i) + 3 + fh / 2, zf - t / 2]),
+ sides: [-1, 1].map((k) => b.place(dsT, [cx + k * xs, y + sh / 2, zd])),
+ bottom: b.place(dbtT, [cx, y + 10, zf - t - (dd - 12) / 2]),
+ back: b.place(dbT, [cx, y + 14 + (sh - 14) / 2, zBack + 6]),
+ rod: g.rod
+ ? b.place(rodT, [cx, y - 6, zBack + 30], [0, 0, Math.PI / 2])
+ : undefined,
+ };
+ }),
+ );
+ const n = drawers.length;
const fitsOf = (d: Drawer) => {
const per = (fn: (g: number, side: string) => FitOpts[]) =>
- [-1, 1].flatMap((g) => fn(g, d.sides[g < 0 ? 0 : 1]));
+ [-1, 1].flatMap((k) => fn(k, d.sides[k < 0 ? 0 : 1]));
return {
bolts: per((g, sd) =>
[d.y + 25, d.y + sh - 25].map((y): FitOpts => ({
on: d.front,
- at: [g * xs, y, zf - t],
+ at: [d.cx + g * xs, y, zf - t],
dir: [0, 0, 1],
mate: sd,
mateHole: 4,
@@ -726,7 +770,7 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
dowels: per((g, sd) =>
[d.y + sh * 0.4, d.y + sh * 0.62].map((y): FitOpts => ({
on: d.front,
- at: [g * xs, y, zf - t],
+ at: [d.cx + g * xs, y, zf - t],
dir: [0, 0, 1],
mate: sd,
})),
@@ -734,42 +778,42 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
cams: per((g, sd) =>
[d.y + 25, d.y + sh - 25].map((y): FitOpts => ({
on: sd,
- at: [g * (xs - 6), y, zf - t - 30],
+ at: [d.cx + g * (xs - 6), y, zf - t - 30],
dir: [g, 0, 0],
})),
),
backScrews: per((g, sd) =>
[0.3, 0.75].map((k): FitOpts => ({
on: sd,
- at: [g * (xs + 6), d.y + 14 + (sh - 14) * k, zBack + 6],
+ at: [d.cx + g * (xs + 6), d.y + 14 + (sh - 14) * k, zBack + 6],
dir: [-g, 0, 0],
mate: d.back,
})),
),
bottomScrews: [-1, 1].map((g): FitOpts => ({
on: d.bottom,
- at: [g * (xs - 40), d.y + 8.5, zBack + 6],
+ at: [d.cx + g * (xs - 40), d.y + 8.5, zBack + 6],
dir: [0, 1, 0],
mate: d.back,
})),
runners: per((g, sd) => [
{
on: sd,
- at: [g * xs, d.y, zf - t - 10 - runLen / 2],
+ at: [d.cx + g * xs, d.y, zf - t - 10 - runLen / 2],
dir: [0, 1, 0],
hole: false,
},
]),
runnerScrews: per((g, sd) => [
- { on: sd, at: [g * xs, d.y - 2, zf - t - 40], dir: [0, 1, 0] },
- { on: sd, at: [g * xs, d.y - 2, zf - t - runLen + 20], dir: [0, 1, 0] },
- { on: sd, at: [g * (xs + 6), d.y + 8, zf - t - 70], dir: [-g, 0, 0] },
+ { on: sd, at: [d.cx + g * xs, d.y - 2, zf - t - 40], dir: [0, 1, 0] },
+ { on: sd, at: [d.cx + g * xs, d.y - 2, zf - t - runLen + 20], dir: [0, 1, 0] },
+ { on: sd, at: [d.cx + g * (xs + 6), d.y + 8, zf - t - 70], dir: [-g, 0, 0] },
]),
rodScrews: d.rod
? per((g, sd) => [
{
on: sd,
- at: [g * (xs + 6), d.y + 6, zBack + 30],
+ at: [d.cx + g * (xs + 6), d.y + 6, zBack + 30],
dir: [-g, 0, 0],
},
])
@@ -777,7 +821,7 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
};
};
const d0 = drawers[0];
- const c0: Vec3 = [0, d0.y + sh / 2, zd];
+ const c0: Vec3 = [d0.cx, d0.y + sh / 2, zd];
const rel = (k: string): Vec3 => {
const it = b.partItem(k);
return [
@@ -928,6 +972,311 @@ function buildChest(b: PlanBuilder, s: ProductSpec, n: number) {
return true;
}
+/* ---------- the chest of 6 drawers ---------- */
+
+/*
+ * The wide chest of 6 drawers (its own manual): two columns of three with a middle panel. The left half is built on
+ * the left side lying on the floor: runners and cam bolts in the side, the plinth rail on two L plates, the rails and
+ * back rail stood in on dowels, then the middle panel on top. The right half is built the same way on the right side,
+ * and the left half is lifted onto it. Standing, the top goes on dowels and cam bolts; upside down it gets six glides,
+ * and on its front two hardboard backs are nailed on. The drawers are the same as the other chests'.
+ */
+const MID_CAM: HwDef = { kind: "cam", len: 15, dia: 20, name: "Double cam lock" };
+const BIG_TOP_DOWEL: HwDef = { kind: "dowel", len: 40, dia: 10 };
+const CAB_RUNNER = (len: number): HwDef => ({ kind: "runner", len, dia: 20, name: "Cabinet runner" });
+const CAB_RUNNER_SCREW: HwDef = { kind: "screw", len: 11, dia: 4 };
+
+function buildChest6(b: PlanBuilder, s: ProductSpec) {
+ const W = s.size.w * 10,
+ H = s.size.h * 10,
+ D = s.size.d * 10;
+ const n = 3;
+ const topY = H - t;
+ const sx = W / 2 - 3 - t / 2;
+ const xi = W / 2 - 3 - t;
+ const mx = t / 2; // faces of the middle panel
+ const zb = -D / 2 + 2,
+ zf = D / 2 - 10;
+ const sideD = zf - zb,
+ sideZ = (zf + zb) / 2;
+ const P = 40;
+ const pitch = (topY - P) / n;
+ const slotB = (i: number) => P + i * pitch;
+ const fh = pitch - t - 6;
+ const ybox = (i: number) => slotB(i) + 13;
+ const hw = (xi - mx) / 2; // half a column's opening
+ const cols = [-1, 1].map((g) => g * (mx + hw));
+ const xs = hw - 19;
+ const dd = zf - t - (zb + t + 25);
+ const zd = zf - t - dd / 2;
+ const zBack = zf - t - dd;
+ const sh = Math.min(fh - 40, 160);
+ const runLen = Math.round((dd - 20) / 10) * 10;
+ const runZ = zf - 30 - runLen / 2;
+
+ // panels with runners on them from the factory: the right side and the middle panel's left face
+ const withRunners = (name: string, x: number, face: number) => {
+ const pieces: PartPiece[] = [{ shape: "box", size: [t, topY, sideD], pos: [0, topY / 2, sideZ] }];
+ for (const i of range(n))
+ pieces.push({ shape: "box", size: [10, 18, runLen], pos: [face * (t / 2 + 5), ybox(i) - 10, runZ], material: "metal" });
+ const { type, mid } = b.compound(name, pieces);
+ return b.place(type, [x + mid[0], mid[1], mid[2]]);
+ };
+ const left = b.place(b.part("Left side", [t, topY, sideD]), [-sx, topY / 2, sideZ]);
+ const middle = withRunners("Middle panel", 0, -1);
+ const right = withRunners("Right side", sx, -1);
+ const top = b.place(b.part("Top panel", [W, t, D]), [0, H - t / 2, 0]);
+
+ const zr = zf - 20 - 25;
+ const zp = zf - 20 - t / 2;
+ const BR = 160;
+ const yBR = 10 + BR / 2,
+ zBR = zb + t / 2;
+ const railT = b.part("Rail", [2 * hw, t, 50]);
+ const plinthT = b.part("Plinth rail", [2 * hw, P, t]);
+ const backRailT = b.part("Back rail", [2 * hw, BR, t]);
+ const railY = range(n).map((i) => slotB(i + 1) - t / 2);
+ const column = cols.map((cx) => ({
+ cx,
+ rails: railY.map((y) => b.place(railT, [cx, y, zr])),
+ plinth: b.place(plinthT, [cx, P / 2, zp]),
+ backRail: b.place(backRailT, [cx, yBR, zBR]),
+ }));
+ const backT = b.part("Back panel", [W / 2 - 4, H - 12, 3], { material: "fiber" });
+ const backs = [-1, 1].map((g) => b.place(backT, [g * (W / 4 - 1), 10 + (H - 12) / 2, zb - 1.5]));
+
+ interface End {
+ x: number; // the panel face this end meets
+ s: number; // outwards, from the rail to the panel
+ panel: string;
+ }
+ interface Joint {
+ key: string;
+ dowel: [number, number];
+ bolt: [number, number];
+ camY: number;
+ camZ: number;
+ camDir: Vec3;
+ }
+ const ends = (c: number): End[] =>
+ c === 0
+ ? [
+ { x: -xi, s: -1, panel: left },
+ { x: -mx, s: 1, panel: middle },
+ ]
+ : [
+ { x: mx, s: -1, panel: middle },
+ { x: xi, s: 1, panel: right },
+ ];
+ const joints = (c: number): Joint[] => [
+ ...column[c].rails.map((k, i) => ({ key: k, dowel: [railY[i], zr + 12] as [number, number], bolt: [railY[i], zr - 12] as [number, number], camY: railY[i] + t / 2, camZ: zr - 12, camDir: [0, -1, 0] as Vec3 })),
+ { key: column[c].backRail, dowel: [yBR + BR * 0.25, zBR], bolt: [yBR - BR * 0.2, zBR], camY: yBR - BR * 0.2, camZ: zBR + t / 2, camDir: [0, 0, -1] },
+ ];
+ const bolts = (e: End, js: Joint[]): FitOpts[] => js.map((j) => ({ on: e.panel, at: [e.x, j.bolt[0], j.bolt[1]], dir: [e.s, 0, 0], mate: j.key, mateHole: 4 }));
+ const dowels = (c: number): FitOpts[] =>
+ joints(c).flatMap((j) => ends(c).map((e): FitOpts => ({ on: j.key, at: [e.x, j.dowel[0], j.dowel[1]], dir: [e.s, 0, 0], mate: e.panel })));
+ const cams = (e: End, js: Joint[]): FitOpts[] => js.map((j) => ({ on: j.key, at: [e.x - e.s * 25, j.camY, j.camZ], dir: j.camDir }));
+ const plates = (c: number): FitOpts[] => ends(c).map((e) => ({ on: column[c].plinth, at: [e.x - e.s * 14, P / 2, zp - t / 2], dir: [0, 0, 1], hole: false, twist: e.s < 0 ? Math.PI : 0 }));
+ const plateScrews = (c: number): FitOpts[] => ends(c).flatMap((e) => [-9, 9].map((dy): FitOpts => ({ on: column[c].plinth, at: [e.x - e.s * 24, P / 2 + dy, zp - t / 2], dir: [0, 0, 1] })));
+ const plateToPanel = (e: End): FitOpts[] => [{ on: e.panel, at: [e.x, P / 2, zp - t / 2 - 14], dir: [e.s, 0, 0] }];
+ const plinthGlides = (c: number): FitOpts[] => [-1, 1].map((g) => ({ on: column[c].plinth, at: [column[c].cx + g * (hw - 60), 0, zp], dir: [0, 1, 0], hole: false }));
+ const runners = (on: string, x: number, d: number) => ({
+ runners: range(n).map((i): FitOpts => ({ on, at: [x, ybox(i) - 10, runZ], dir: [d, 0, 0], hole: false })),
+ screws: range(n).flatMap((i) => [zf - 50, zf - 10 - runLen].map((z): FitOpts => ({ on, at: [x, ybox(i) - 10, z], dir: [d, 0, 0] }))),
+ });
+ const RUN = CAB_RUNNER(runLen);
+ const [eL, eML] = ends(0);
+ const [eMR, eR] = ends(1);
+ const people = 2 as const;
+
+ /* ---------- the left half, on the left side ---------- */
+ b.step(
+ { title: "Screw the runners onto the left side", detail: "Lay it on a rug, inside up. Three runners, wheel at the front, two screws each.", tools: ["screwdriver"], pose: "+x", kind: "runners", warnings: ["floor"] },
+ () => {
+ b.add(left, [260, 0, 0]);
+ b.then(0.15);
+ const r = runners(left, -xi, -1);
+ b.fits(RUN, r.runners, 0.15);
+ b.then(0.05);
+ b.fits(CAB_RUNNER_SCREW, r.screws, 0.05);
+ },
+ );
+ b.step({ title: "Screw the cam bolts into the left side", detail: "Four, into the holes along the front and the bottom of the back.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () =>
+ b.fits(HW.camScrew, bolts(eL, joints(0)), 0.08),
+ );
+ const plinthPrep = (c: number, scene: string) => {
+ b.step({ title: "Screw the L plates onto a plinth rail", detail: "One at each end, on the back face, bent edge flush with the end. Two screws each.", tools: ["screwdriver"], scene, kind: "screws" }, () => {
+ b.stage(column[c].plinth, [0, t / 2, 0], [Math.PI / 2, 0, 0], [0, 140, 0]);
+ b.then(0.15);
+ b.fits(HW.angle, plates(c), 0.15);
+ b.then(0.1);
+ b.fits(ANGLE_SCREW, plateScrews(c), 0.1);
+ });
+ b.step({ title: "Push two glides into the plinth rail", detail: "Into its bottom edge, near the ends.", scene, kind: "general" }, () => b.fits(HW.glide, plinthGlides(c), 0.15));
+ };
+ plinthPrep(0, "plinth");
+ b.step({ title: "Screw the plinth rail to the side", detail: "Bottom front, the L plate against the inside of the side. One screw.", tools: ["screwdriver"], pose: "+x", kind: "screws" }, () => {
+ b.add(column[0].plinth, [320, 0, 0]);
+ b.then(0.1);
+ b.fits(ANGLE_SCREW, plateToPanel(eL), 0.12);
+ });
+ const railPrep = (c: number, scene: string) =>
+ b.step({ title: "Tap the dowels into the rails", detail: "One into each end of the three rails and the back rail. Use the small dowels.", tools: ["hammer"], scene, kind: "dowels" }, () => {
+ b.stagger(0.12);
+ joints(c).forEach((j, i) => {
+ const it = b.partItem(j.key);
+ const sz = b.parts.find((p) => p.id === it.ref)!.size;
+ const flat = sz[1] > sz[2] ? [Math.PI / 2, 0, 0] : [0, 0, 0];
+ b.stage(j.key, [0, Math.min(sz[1], sz[2]) / 2, (i - 1.5) * 140], flat as Vec3, [0, 120, 0]);
+ });
+ b.then(0.15);
+ b.fits(HW.dowel, dowels(c), 0.05);
+ });
+ railPrep(0, "rails");
+ b.step({ title: "Stand the rails in the side and lock them", detail: "Push each onto its dowel and cam bolt, then turn the four cam locks clockwise.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => {
+ b.stagger(0.2);
+ for (const j of joints(0)) b.add(j.key, [300, 0, 0]);
+ b.then(0.15);
+ b.fits(HW.cam, cams(eL, joints(0)), 0.12);
+ });
+ b.step({ title: "Screw the cam bolts into the middle panel", detail: "Four, on the face with the runners already on it.", tools: ["screwdriver"], scene: "middle", kind: "cams" }, () => {
+ b.stage(middle, [0, 14, 0], [0, 0, -Math.PI / 2], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(HW.camScrew, bolts(eML, joints(0)), 0.08);
+ });
+ b.step({ title: "Lower the middle panel onto the rails", detail: "Runners facing down, onto the dowels at the ends of the rails.", pose: "+x", kind: "join" }, () => b.add(middle, [420, 0, 0]));
+ b.step({ title: "Lock it and screw on the L plate", detail: "Four cam locks, then one screw through the L plate into the middle panel.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => {
+ b.fits(HW.cam, cams(eML, joints(0)), 0.12);
+ b.then(0.1);
+ b.fits(ANGLE_SCREW, plateToPanel(eML), 0.12);
+ });
+ b.step({ title: "Stand it up and screw the runners onto the middle panel", detail: "On its free face: three runners, two screws each.", tools: ["screwdriver"], pose: "+y", kind: "runners" }, () => {
+ const r = runners(middle, mx, -1);
+ b.fits(RUN, r.runners, 0.15);
+ b.then(0.05);
+ b.fits(CAB_RUNNER_SCREW, r.screws, 0.05);
+ });
+ b.step({ title: "Screw four cam bolts into the middle panel", detail: "On the same face, for the rails of the right half.", tools: ["screwdriver"], pose: "+y", kind: "cams" }, () =>
+ b.fits(HW.camScrew, bolts(eMR, joints(1)), 0.08),
+ );
+
+ /* ---------- the right half, on the right side ---------- */
+ const R = "right";
+ const here = (k: string) => {
+ const it = b.partItem(k);
+ b.stage(k, it.final.pos, it.final.rot);
+ };
+ b.step({ title: "Screw the cam bolts into the right side", detail: "Lay it on the rug, inside up. Four cam bolts.", tools: ["screwdriver"], scene: R, pose: "-x", kind: "cams", warnings: ["floor"] }, () => {
+ here(right);
+ b.then(0.15);
+ b.fits(HW.camScrew, bolts(eR, joints(1)), 0.08);
+ });
+ plinthPrep(1, "plinth2");
+ b.step({ title: "Screw the other plinth rail to the right side", detail: "One screw through the L plate, bottom front.", tools: ["screwdriver"], scene: R, pose: "-x", kind: "screws" }, () => {
+ here(column[1].plinth);
+ b.then(0.1);
+ b.fits(ANGLE_SCREW, plateToPanel(eR), 0.12);
+ });
+ railPrep(1, "rails2");
+ b.step({ title: "Stand the rails in the right side and lock them", detail: "Onto the dowels and cam bolts, then four cam locks.", tools: ["screwdriver"], scene: R, pose: "-x", kind: "cams" }, () => {
+ b.stagger(0.2);
+ for (const j of joints(1)) here(j.key);
+ b.then(0.15);
+ b.fits(HW.cam, cams(eR, joints(1)), 0.12);
+ });
+ const halfL = [left, middle, top, ...column[0].rails, column[0].plinth, column[0].backRail].filter((k) => k !== top);
+ const halfR = [right, ...column[1].rails, column[1].plinth, column[1].backRail];
+ b.step({ title: "Lift the left half onto the right half", detail: "Together: middle panel down, onto the dowels of the right half's rails.", pose: "-x", people, kind: "join", warnings: ["two"] }, () => {
+ b.stagger(0);
+ for (const k of halfR) b.add(k);
+ b.then(0.1);
+ for (const k of halfL) b.add(k, [-420, 0, 0]);
+ });
+ b.step({ title: "Lock the rails to the middle panel", detail: "Three cam locks, then one screw through the L plate.", tools: ["screwdriver"], pose: "-x", kind: "cams" }, () => {
+ b.fits(HW.cam, cams(eMR, joints(1)).slice(0, n), 0.12);
+ b.then(0.1);
+ b.fits(ANGLE_SCREW, plateToPanel(eMR), 0.12);
+ });
+
+ /* ---------- the top ---------- */
+ const topZ = [zf - 50, zb + 50];
+ const topDowelZ = [sideZ + 70, sideZ - 70];
+ const topX = [-sx, 0, sx];
+ const bx = [-W / 4, W / 4];
+ b.step({ title: "Screw the cam bolts into the top", detail: "Lay it upside down on something soft. Six: over each side and over the middle panel.", tools: ["screwdriver"], scene: "top", kind: "cams", warnings: ["face"] }, () => {
+ b.stage(top, [0, t / 2, 0], [0, 0, Math.PI], [0, 160, 0]);
+ b.then(0.15);
+ b.fits(
+ HW.camScrew,
+ topX.flatMap((x, i) => (i === 1 ? [topZ[0], topZ[1]] : topZ).map((z): FitOpts => ({ on: top, at: [x, topY, z], dir: [0, 1, 0], mate: i === 0 ? left : i === 1 ? middle : right, mateHole: 4 }))),
+ 0.1,
+ );
+ });
+ b.step({ title: "Screw the wall brackets under the top", detail: "Near the back edge, a screw and a washer in each. Leave them a little loose.", tools: ["screwdriver"], scene: "top", kind: "screws" }, () => {
+ b.fits(HW.bracket, bx.map((x) => ({ on: top, at: [x, topY, zb + 22], dir: [0, 1, 0], hole: false })), 0.2);
+ b.then(0.1);
+ b.fits(HW.washer, bx.map((x) => ({ on: top, at: [x, topY - 3, zb + 44], dir: [0, 1, 0], hole: false })), 0.15);
+ b.then(0.05);
+ b.fits(BRACKET_SCREW, bx.map((x) => ({ on: top, at: [x, topY - 3, zb + 44], dir: [0, 1, 0] })), 0.15);
+ });
+ b.step({ title: "Stand it up and tap in the dowels for the top", detail: "Together. Two big dowels into the middle panel, two small ones into the top of each side.", tools: ["hammer"], pose: "+y", people, kind: "dowels", warnings: ["two"] }, () => {
+ b.fits(BIG_TOP_DOWEL, topDowelZ.map((z) => ({ on: middle, at: [0, topY, z], dir: [0, -1, 0], mate: top })), 0.1);
+ b.then(0.05);
+ b.fits(HW.dowel, [-sx, sx].flatMap((x, i) => topDowelZ.map((z): FitOpts => ({ on: i ? right : left, at: [x, topY, z], dir: [0, -1, 0], mate: top }))), 0.08);
+ });
+ b.step({ title: "Put the top on", detail: "Lower it onto the dowels, cam bolts into the holes.", pose: "+y", kind: "join" }, () => b.add(top, [0, 300, 0]));
+ b.step({ title: "Lock the top", detail: "Four cam locks in the sides, then the two double cam locks in the middle panel.", tools: ["screwdriver"], kind: "cams" }, () => {
+ b.fits(HW.cam, [-1, 1].flatMap((g, i) => topZ.map((z): FitOpts => ({ on: i ? right : left, at: [g * xi, topY - 25, z], dir: [g, 0, 0] }))), 0.12);
+ b.then(0.1);
+ b.fits(MID_CAM, topZ.map((z) => ({ on: middle, at: [-mx, topY - 25, z], dir: [1, 0, 0] })), 0.15);
+ });
+ b.step({ title: "Turn it upside down", detail: "Lock the last cam lock, on the back rail at the middle panel.", tools: ["screwdriver"], pose: "-y", people, kind: "cams", warnings: ["two", "floor"] }, () =>
+ b.fits(HW.cam, cams(eMR, joints(1)).slice(n), 0.12),
+ );
+ b.step({ title: "Push in the glides", detail: "Two under each side and two under the middle panel, front and back.", pose: "-y", kind: "general" }, () =>
+ b.fits(HW.glide, topX.flatMap((x, i) => [zf - 40, zb + 40].map((z): FitOpts => ({ on: [left, middle, right][i], at: [x, 0, z], dir: [0, 1, 0], hole: false }))), 0.1),
+ );
+
+ /* ---------- the backs ---------- */
+ const zn = zb - 3;
+ const nail = (k: string, x: number, y: number): FitOpts => ({ on: k, at: [x, y, zn], dir: [0, 0, 1], hole: false });
+ b.step({ title: "Lay it on its front and put the backs on", detail: "Push each hardboard back into its corner and nail its corners first: the outer top, the middle top, then the back rail. That squares it.", tools: ["hammer"], pose: "-z", people, kind: "nails", check: "square" }, () => {
+ b.stagger(0.25);
+ for (const k of backs) b.add(k, [0, 0, -340]);
+ b.then(0.2);
+ b.fits(
+ HW.nail,
+ [-1, 1].flatMap((g, c) => [nail(c ? right : left, g * sx, H - 40), nail(middle, g * 4, H - 40), nail(column[c].backRail, column[c].cx, yBR)]),
+ 0.25,
+ );
+ });
+ b.step({ title: "Nail the backs all round", detail: "54 nails along the sides, the middle panel, the top and the back rails, keeping them straight.", tools: ["hammer"], pose: "-z", kind: "nails" }, () => {
+ const list: FitOpts[] = [];
+ for (const c of [0, 1]) {
+ const g = c ? 1 : -1;
+ for (const y of spread(80, H - 110, 7)) list.push(nail(c ? right : left, g * sx, y), nail(middle, g * 4, y));
+ for (const x of spread(column[c].cx - hw + 30, column[c].cx + hw - 30, 7)) list.push(nail(top, x, H - t / 2));
+ for (const x of spread(column[c].cx - hw + 50, column[c].cx + hw - 50, 7).filter((_, i) => i !== 3)) list.push(nail(column[c].backRail, x, yBR));
+ }
+ b.fits(HW.nail, list, 0.03);
+ });
+
+ /* ---------- the wall ---------- */
+ const wy = topY - 26;
+ b.step({ title: "Stand it against the wall and mark the brackets", detail: "Together. Mark through the slot in each bracket, then move it away.", tools: ["pencil"], pose: "+y", people, kind: "anchor", wall: true, warnings: ["wall", "tip"] }, () => {});
+ b.step({ title: "Drill the holes and push in the plugs", detail: "Plugs suit solid walls; use fixings made for your wall if it's different.", tools: ["drill", "hammer"], kind: "anchor", wall: true, warnings: ["wall"] }, () =>
+ b.fits(WALL_PLUG, bx.map((x) => ({ at: [x, wy, -D / 2 - 1], dir: [0, 0, -1] as Vec3 })), 0.2),
+ );
+ b.step({ title: "Screw it to the wall", detail: "Push it back, a washer on each screw, through the brackets. Then tighten the bracket screws under the top.", tools: ["screwdriver"], kind: "anchor", wall: true, warnings: ["tip"] }, () => {
+ b.fits(HW.washer, bx.map((x) => ({ at: [x, wy, zb + 6], dir: [0, 0, -1] as Vec3 })), 0.15);
+ b.then(0.05);
+ b.fits(WALL_SCREW, bx.map((x) => ({ at: [x, wy, zb + 8], dir: [0, 0, -1] as Vec3 })), 0.2);
+ });
+
+ chestDrawers(b, { rows: n, cols, hw, xs, fh, sh, dd, zf, zd, zBack, runLen, slotB, ybox, rod: true });
+ return true;
+}
+
/* ---------- beds ---------- */
/*
@@ -1565,7 +1914,7 @@ function storageBoxes(
...spread(x.zc - lb / 2 + 60, x.zc + lb / 2 - 60, 4).map(
(z): FitOpts => ({
on: x.bottom,
- at: [xF(x) - x.g * 6, 45.5, z],
+ at: [xF(x) + x.g * 1, 45.5, z],
dir: [0, 1, 0],
mate: x.front,
}),
@@ -1573,7 +1922,7 @@ function storageBoxes(
...spread(x.zc - lb / 2 + 80, x.zc + lb / 2 - 80, 3).map(
(z): FitOpts => ({
on: x.bottom,
- at: [xB(x) + x.g * 6, 45.5, z],
+ at: [xB(x) - x.g * 1.5, 45.5, z],
dir: [0, 1, 0],
mate: x.back,
}),
@@ -3390,7 +3739,7 @@ function buildDressing(b: PlanBuilder, s: ProductSpec) {
);
dstep(
"Screw on the drawer front",
- "Four long screws, two through each side.",
+ "Four long screws, two through the front end of each side into the front.",
"screws",
() => {
stage(front, [0, 0, 260]);
@@ -3400,8 +3749,9 @@ function buildDressing(b: PlanBuilder, s: ProductSpec) {
for (const y of [yb + sh * 0.3, yb + sh * 0.75])
list.push({
on: dsides[g < 0 ? 0 : 1],
- at: [g * (xs + 6), y, fz - 18],
- dir: [-g, 0, 0],
+ // from the hole near the front end of the side, along it into the back of the front
+ at: [g * xs, y, fz - 9 - 32],
+ dir: [0, 0, 1],
mate: front,
});
b.fits(BACK_SCREW, list, 0.12);
@@ -3458,6 +3808,7 @@ const family: Family = {
build(b, s) {
const n = chestCount(s);
if (n) return buildChest(b, s, n);
+ if (/chest of 6 drawers/i.test(s.variant) && s.size.w >= 150) return buildChest6(b, s);
// the high bed frame (and the bed frames sold without "high" in their name, which are the same frame)
if (s.archetype === "bed" && /^bed frame/i.test(s.variant))
return buildBed(b, s);
diff --git a/src/lib/plan/families/malomrade.ts b/src/lib/plan/families/malomrade.ts
index 1c5fc4c..6d669a5 100644
--- a/src/lib/plan/families/malomrade.ts
+++ b/src/lib/plan/families/malomrade.ts
@@ -84,10 +84,11 @@ function desk(s: ProductSpec): CustomParams {
);
// where the fittings go
- const legTop = (sx: number, dy: number): Vec3[] => [-1, 1].flatMap((sz) => [[sx * (xL - 40), yBox0 + 20, sz * zR], [sx * (xL - 40), yBox0 + 20 + dy, sz * zR]] as Vec3[]);
- const railBolts = [-1, 1].map((sx) => fx("bolt", legTop(sx, 15), [sx, 0, 0], `LEG_${sx < 0 ? "L" : "R"}`, { name: "Allen bolt", len: 40, dia: 8, mate: sx < 0 ? "RAIL_B" : "RAIL_F" }));
+ // two bolts through each rail end into the motor box, far enough apart that neither gets nudged
+ const legTop = (sx: number, dy: number): Vec3[] => [-1, 1].flatMap((sz) => [[sx * (xL - 65), yBox0 + 14, sz * zR], [sx * (xL - 65), yBox0 + 14 + dy, sz * zR]] as Vec3[]);
+ const railBolts = [-1, 1].map((sx) => fx("bolt", legTop(sx, 23), [sx, 0, 0], `LEG_${sx < 0 ? "L" : "R"}`, { name: "Allen bolt", len: 40, dia: 8, mate: sx < 0 ? "RAIL_B" : "RAIL_F" }));
const plateScrews = fx("bolt", [-1, 0, 1].flatMap((i) => [-1, 1].map((sz): Vec3 => [i * 110, yBox0 + 4, sz * zR])), [0, 1, 0], "PLATE", { name: "Flat Allen screw", len: 10, dia: 6 });
- const endScrews = (dy: number) => [-1, 1].map((sx) => fx("screw", [-1, 1].map((sz): Vec3 => [sx * (xL + 55 + 30), yBox0 + 10 + dy, sz * 35]), [0, 1, 0], `END_${sx < 0 ? "L" : "R"}`, SCREW));
+ const endScrews = (z: number) => [-1, 1].map((sx) => fx("screw", [-1, 1].map((sz): Vec3 => [sx * (xL + 55 + 30), yBox0 + 10, sz * z]), [0, 1, 0], `END_${sx < 0 ? "L" : "R"}`, SCREW));
const footBolts = [-1, 1].map((sx) => fx("bolt", [-1, 1].flatMap((ax) => [-1, 1].map((az): Vec3 => [sx * xL + ax * 22, yF0, az * 45])), [0, 1, 0], `FOOT_${sx < 0 ? "L" : "R"}`, { ...SOCKET, mate: `LEG_${sx < 0 ? "L" : "R"}` }));
const glides = fx("foot", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xL, yF0, sz * (D / 2 - 90)])), [0, 1, 0], "FOOT_L", { name: "Adjustable glide", len: 15, dia: 50 });
glides.on = undefined;
@@ -105,7 +106,7 @@ function desk(s: ProductSpec): CustomParams {
const clampsAt = (y: number) => fx("clip", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xP, y, zP + sz * 20])), [0, 0, 1], "POST_L", { name: "Clamp half", len: 40, dia: 40 });
const clampsLow = { ...clampsAt(yBar), on: undefined };
const clampsHigh = { ...clampsAt(yPg0 + 40), on: undefined };
- const clampScrews = fx("screw", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xP, yBar + sz * 18, zP - 20])), [0, 0, 1], "POST_L", SCREW);
+ const clampScrews = fx("screw", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xP, yBar + sz * 30, zP - 20])), [0, 0, 1], "POST_L", SCREW);
clampScrews.on = undefined;
const barBolts = [-1, 1].map((sx) => fx("bolt", [-12, 12].map((dy): Vec3 => [sx * (xP - 18), yBar + dy, zP - 20]), [0, 0, 1], "BAR", { ...SOCKET, mate: `POST_${sx < 0 ? "L" : "R"}` }));
const loops = fx("clip", [-250, 250, 700].map((x): Vec3 => [x, yBar - 20, zP]), [0, 1, 0], "BAR", { name: "Cable loop", len: 40, dia: 30 });
@@ -115,8 +116,7 @@ function desk(s: ProductSpec): CustomParams {
covers.on = undefined;
const postCaps = fx("cap", [-1, 1].map((sx): Vec3 => [sx * xP, yPost1, zP]), [0, -1, 0], "POST_L", { name: "Post cap", len: 15, dia: 38 });
postCaps.on = undefined;
- const postCapScrews = fx("screw", [-1, 1].map((sx): Vec3 => [sx * (xP + 18), yPost1 - 30, zP]), [-1, 0, 0], "POST_L", SCREW);
- postCapScrews.on = undefined;
+ const postCapScrews = [-1, 1].map((sx) => fx("screw", [[sx * (xP + 18), yPost1 - 30, zP]], [-sx, 0, 0], `POST_${sx < 0 ? "L" : "R"}`, SCREW));
const pegBrackets = fx("screw", [-1, 1].flatMap((sx) => [-1, 1].map((dy): Vec3 => [sx * (xP - 60), (yPg0 + yPg1) / 2 + dy * 60, zP - 6])), [0, 0, 1], "PEG", SCREW);
const pegRivets = fx("clip", [-1, 1].map((sx): Vec3 => [sx * (xP - 30), yPg0 + 40, zP + 6]), [0, 0, -1], "PEG", RIVET);
const pegScrews = fx("screw", [-1, 1].map((sx): Vec3 => [sx * (xP - 30), yPg1 - 40, zP + 6]), [0, 0, -1], "PEG", SCREW);
@@ -137,8 +137,8 @@ function desk(s: ProductSpec): CustomParams {
warnings: ["floor"],
},
{ title: "Screw the plate across the middle", detail: "Six flat Allen screws through the plate into both rails.", add: ["PLATE"], fix: [plateScrews], tools: ["allen"] },
- { title: "Screw on the end brackets", detail: "One on the outside of each motor box, two screws each.", add: ["END_L", "END_R"], fix: endScrews(0), tools: ["screwdriver"] },
- { title: "Add the second screws to the brackets", detail: "Two more in each bracket, into the motor box.", fix: endScrews(20), tools: ["screwdriver"] },
+ { title: "Screw on the end brackets", detail: "One on the outside of each motor box, two screws each.", add: ["END_L", "END_R"], fix: endScrews(40), tools: ["screwdriver"] },
+ { title: "Add the second screws to the brackets", detail: "Two more in each bracket, between the first two.", fix: endScrews(12), tools: ["screwdriver"] },
{
title: "Bolt on the feet",
detail: "One of you holds the frame steady while the other bolts each foot across the end of a leg, four bolts each.",
@@ -181,7 +181,7 @@ function desk(s: ProductSpec): CustomParams {
{ title: "Fit the crossbar's end pieces and cable loops", detail: "Three loops slide on underneath, then an end piece on each end, arrows up.", fix: [loops, ends], wait: ["BAR"] },
{ title: "Bolt the crossbar to the posts", detail: "Lift it onto the clamps and fit two bolts at each end.", add: ["BAR"], fix: barBolts, tools: ["allen"] },
{ title: "Screw the end pieces tight and click on the covers", detail: "Two screws in each end piece, then the covers click over them.", fix: [endPieceScrews, covers], tools: ["screwdriver"] },
- { title: "Fit the upper clamps and the post caps", detail: "Two more clamp halves on each post for the pegboard, and a cap screwed onto the top of each post.", fix: [clampsHigh, postCaps, postCapScrews], tools: ["screwdriver"] },
+ { title: "Fit the upper clamps and the post caps", detail: "Two more clamp halves on each post for the pegboard, and a cap screwed onto the top of each post.", fix: [clampsHigh, postCaps, ...postCapScrews], tools: ["screwdriver"] },
{ title: "Screw the brackets onto the pegboard", detail: "One at each end on the back, two screws each.", fix: [pegBrackets], wait: ["PEG"], tools: ["screwdriver"] },
{ title: "Fix the pegboard to the posts", detail: "Hook its brackets onto the upper clamps, then a push rivet low and a screw high at each end.", add: ["PEG"], fix: [pegRivets, pegScrews], tools: ["screwdriver"] },
{ title: "Hang the cable tray under the back", detail: "Hook it onto the hangers under the top and fix it with six push rivets.", add: ["TRAY"], fix: [trayRivets([-400, 400]), trayRivets([-560, -200, 200, 560])] },
diff --git a/src/lib/plan/families/mandal.ts b/src/lib/plan/families/mandal.ts
index 9a71cd2..d634812 100644
--- a/src/lib/plan/families/mandal.ts
+++ b/src/lib/plan/families/mandal.ts
@@ -104,10 +104,10 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
const plinthPins = [-1, 1].flatMap((sx) => [-1, 1].flatMap((sz) => [-15, 15].map((dx): Vec3 => [sx * xb + dx, PH, sz * (L / 2 - 30)])));
const barDowels = us ? 2 : 4;
const barScrews = us ? 2 : 4;
- const perBar = (k: number) => [-1, 1].flatMap((sz) => (k === 2 ? [0] : [-15, 15]).map((dx): Vec3 => [dx, 40, sz * (L / 4)]));
+ const perBar = (k: number) => [-1, 1].flatMap((sz) => (k === 2 ? [-20] : [-25, 25]).map((dx): Vec3 => [dx, 40, sz * (L / 4)]));
const runnerPts = drawers.map(({ hz, sx }): Vec3 => [sx * (W / 2 - T - dd / 2), yb + hb / 2, hz * (L / 2 - T)]);
const runnerScrews = (side: number) =>
- drawers.filter((d) => d.sx === side).flatMap(({ sx, hz }) => [-0.35, 0, 0.35].flatMap((t) => [-20, 20].map((dy): Vec3 => [sx * (W / 2 - T - dd / 2) + t * dd, yb + hb / 2 + dy, hz * (L / 2 - T)])));
+ drawers.filter((d) => d.sx === side).map(({ sx, hz }) => fx("screw", [-0.35, 0, 0.35].flatMap((t) => [-20, 20].map((dy): Vec3 => [sx * (W / 2 - T - dd / 2) + t * dd, yb + hb / 2 + dy, hz * (L / 2 - T)])), [0, 0, hz], { len: 14, dia: 4 }));
const runners = (side: number) =>
drawers.filter((d) => d.sx === side).map((d) => fx("runner", [runnerPts[d.k]], [0, 0, d.hz], { len: Math.round((dd - 40) / 10) * 10, dia: 20, twist: Math.PI / 2 }));
const felt: Vec3[] = [
@@ -116,27 +116,17 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
];
const ds = (k: number) => [`DS${k}0`, `DS${k}1`];
const d0 = drawers[0];
- const z0 = d0.hz * (T / 2 + 6 + fw / 2);
- const frontBolts = (d: (typeof drawers)[number]): Vec3[] => {
- const zc = d.hz * (T / 2 + 6 + fw / 2);
- return [-1, 1].flatMap((e) => [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (W / 2 - T), y, zc + e * (bw / 2 - 7.5)]));
- };
- const sideCams = (d: (typeof drawers)[number]): Vec3[] => {
- const zc = d.hz * (T / 2 + 6 + fw / 2);
- return [-1, 1].flatMap((e) => [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (W / 2 - T - 30), y, zc + e * (bw / 2)]));
- };
- const backBolts = (d: (typeof drawers)[number]): Vec3[] => {
- const zc = d.hz * (T / 2 + 6 + fw / 2);
- return [-1, 1].flatMap((e) => [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (xin + 7.5), y, zc + e * bw / 2]));
- };
- const stopScrews = (d: (typeof drawers)[number]): Vec3[] => {
- const zc = d.hz * (T / 2 + 6 + fw / 2);
- return [-60, 60].map((dz): Vec3 => [d.sx * (xin + 15), yb + 6, zc + dz]);
- };
- const drawerRunner = (d: (typeof drawers)[number]): Vec3[] => {
- const zc = d.hz * (T / 2 + 6 + fw / 2);
- const ze = zc + d.hz * (bw / 2);
- return [-0.35, 0, 0.35].flatMap((t) => [-20, 20].map((dy): Vec3 => [d.sx * (xin + dd / 2) + t * dd, yb + hb / 2 + dy, ze]));
+ type D = (typeof drawers)[number];
+ const zOf = (d: D) => d.hz * (T / 2 + 6 + fw / 2);
+ const frontBolts = (d: D) =>
+ fx("camScrew", [-1, 1].flatMap((e) => [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (W / 2 - T), y, zOf(d) + e * (bw / 2 - 7.5)])), [-d.sx, 0, 0], { on: `DF${d.k}` });
+ const sideCams = (d: D) => [-1, 1].map((e, j) => fx("cam", [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (W / 2 - T - 30), y, zOf(d) + e * (bw / 2)]), [0, 0, -e], { on: `DS${d.k}${j}` }));
+ const backBolts = (d: D) =>
+ [-1, 1].map((e, j) => fx("bolt", [yb + 30, yb + hb - 30].map((y): Vec3 => [d.sx * (xin + 7.5), y, zOf(d) + e * bw / 2]), [0, 0, -e], { len: 50, dia: 7, name: "Connector bolt", on: `DS${d.k}${j}`, mate: `DB${d.k}` }));
+ const stopScrews = (d: D) => fx("screw", [-60, 60].map((dz): Vec3 => [d.sx * (xin + 15), yb + 6, zOf(d) + dz]), [0, 1, 0], { len: 16, dia: 3.5, on: `DT${d.k}` });
+ const drawerRunner = (d: D) => {
+ const ze = zOf(d) + d.hz * (bw / 2);
+ return fx("screw", [-0.35, 0, 0.35].flatMap((t) => [-20, 20].map((dy): Vec3 => [d.sx * (xin + dd / 2) + t * dd, yb + hb / 2 + dy, ze])), [0, 0, -d.hz], { len: 14, dia: 4, on: `DS${d.k}${d.hz > 0 ? 1 : 0}` });
};
const rest = drawers.slice(1);
@@ -175,8 +165,8 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
},
{
title: "Screw the end panels to the top frame",
- detail: "Four screws, one near each corner.",
- fix: [fx("screw", [-1, 1].flatMap((sz) => [-1, 1].map((sx): Vec3 => [sx * (W / 2 - 40), yr, sz * (L / 2 - T / 2)])), [0, 1, 0], { len: 30, dia: 4 })],
+ detail: "Four screws, one in each corner of the top frame, where the boards overlap.",
+ fix: [fx("screw", [-1, 1].flatMap((sz) => [-1, 1].map((sx): Vec3 => [sx * (W / 2 - 20), yr, sz * (L / 2 - 20)])), [0, 1, 0], { len: 20, dia: 4 })],
tools: ["screwdriver"],
},
{
@@ -196,7 +186,7 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
{
title: "Tap the dowels into the plinth bars",
detail: "Two in each bar, for the plinth boards.",
- fix: [-1, 1].map((sx, i) => fx("dowel", [-0.4, 0.4].map((t): Vec3 => [sx * (xb + 20), PH - 20, t * L]), [-sx, 0, 0], { on: `PB${i}`, len: 30, dia: 8 })),
+ fix: [-1, 1].map((sx, i) => fx("dowel", [-0.2, 0.2].map((t): Vec3 => [sx * (xb + 20), PH - 20, t * L]), [-sx, 0, 0], { on: `PB${i}`, len: 30, dia: 8 })),
tools: ["hammer"],
},
{
@@ -222,7 +212,7 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
title: "Put the blocks on the cross bars",
detail: `${barDowels} dowels, then ${barScrews} long screws up through each bar into its block.`,
add: ["CB0", "CB1", "BB0", "BB1"],
- fix: [fx("dowel", perBar(barDowels).map((p): Vec3 => [p[0], 40, p[2] + 15]), [0, 1, 0], { len: 30, dia: 8 }), fx("screw", perBar(barScrews), [0, 1, 0], { len: 90, dia: 5 })],
+ fix: [fx("dowel", perBar(barDowels).map((p): Vec3 => [p[0], 40, p[2] + 15]), [0, 1, 0], { len: 30, dia: 8 }), fx("screw", perBar(barScrews).map((p): Vec3 => [p[0], 0, p[2]]), [0, 1, 0], { len: 90, dia: 5 })],
tools: ["screwdriver"],
},
{
@@ -237,7 +227,7 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
{
title: "Bolt the blocks to the divider",
detail: "One long connector bolt down through each cross bar and block.",
- fix: [fx("bolt", [-1, 1].map((sz): Vec3 => [0, 0, sz * (L / 4)]), [0, 1, 0], { len: 50, dia: 7, name: "Connector bolt" })],
+ fix: [fx("bolt", [-1, 1].map((sz): Vec3 => [barScrews === 2 ? 20 : 0, 0, sz * (L / 4)]), [0, 1, 0], { len: 50, dia: 7, name: "Connector bolt" })],
tools: ["allen"],
},
{ title: "Stick the felt pads on", detail: "Ten, under the plinth rails and the cross bars, so it won't scratch the floor.", fix: [fx("glide", felt, [0, 1, 0], { name: "Felt pad" })] },
@@ -245,13 +235,13 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
{
title: "Screw the runners in on this side",
detail: "One for each drawer, six screws each, on the end panel and the cross divider.",
- fix: [...runners(1), fx("screw", runnerScrews(1), [0, 0, 1], { len: 14, dia: 4 })],
+ fix: [...runners(1), ...runnerScrews(1)],
tools: ["screwdriver"],
},
{
title: "Screw the runners in on the other side",
detail: "The same: two runners, six screws each.",
- fix: [...runners(-1), fx("screw", runnerScrews(-1), [0, 0, 1], { len: 14, dia: 4 })],
+ fix: [...runners(-1), ...runnerScrews(-1)],
tools: ["screwdriver"],
},
{ title: "Lay the slatted base in", detail: "Unroll it into the top frame, the straps facing down, until it rests on the frame all round.", add: ["SL"] },
@@ -263,37 +253,31 @@ function recipe(s: ProductSpec, bed: Bed): CustomParams {
{
title: "Screw the cam bolts into a drawer front",
detail: "Lay the front face down on the rug. Four bolts in its back.",
- fix: [fx("camScrew", frontBolts(d0), [-d0.sx, 0, 0], { on: `DF${d0.k}` })],
+ fix: [frontBolts(d0)],
pose: "+y",
tools: ["screwdriver"],
},
{ title: "Push the drawer sides onto them", detail: "One at each end, the grooves facing in and down.", add: [`DF${d0.k}`, ...ds(0)] },
- { title: "Lock the sides with four cam locks", fix: [fx("cam", sideCams(d0), [0, 0, -d0.hz])], tools: ["screwdriver"] },
+ { title: "Lock the sides with four cam locks", fix: sideCams(d0), tools: ["screwdriver"] },
{
title: "Bolt on the drawer back",
detail: "Four long connector bolts through the sides into its ends.",
add: [`DB${d0.k}`],
- fix: [fx("bolt", backBolts(d0), [0, 0, -1], { len: 50, dia: 7, name: "Connector bolt" })],
+ fix: backBolts(d0),
tools: ["allen"],
},
- { title: "Slide the bottom in", detail: "Along the grooves, smooth side up, then screw the stop into the back to hold it.", add: [`DT${d0.k}`], fix: [fx("screw", stopScrews(d0), [0, 1, 0], { len: 16, dia: 3.5 })], tools: ["screwdriver"] },
- { title: "Screw the runner onto the drawer", detail: "Six small screws along the side.", fix: [fx("screw", drawerRunner(d0), [0, 0, -d0.hz], { len: 14, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Slide the bottom in", detail: "Along the grooves, smooth side up, then screw the stop into the back to hold it.", add: [`DT${d0.k}`], fix: [stopScrews(d0)], tools: ["screwdriver"] },
+ { title: "Screw the runner onto the drawer", detail: "Six small screws along the side.", fix: [drawerRunner(d0)], tools: ["screwdriver"] },
{
title: "Build the other three drawers the same way",
detail: "Bolts in the front, sides and cams, the back, the bottom and its stop, then the runner.",
add: rest.flatMap((d) => [`DF${d.k}`, ...ds(d.k), `DB${d.k}`, `DT${d.k}`]),
- fix: [
- fx("camScrew", rest.flatMap(frontBolts), [-1, 0, 0]),
- fx("cam", rest.flatMap(sideCams), [0, 0, -1]),
- fx("bolt", rest.flatMap(backBolts), [0, 0, -1], { len: 50, dia: 7, name: "Connector bolt" }),
- fx("screw", rest.flatMap(stopScrews), [0, 1, 0], { len: 16, dia: 3.5 }),
- fx("screw", rest.flatMap(drawerRunner), [0, 0, -1], { len: 14, dia: 4 }),
- ],
+ from: Object.fromEntries(rest.map((d) => [`DF${d.k}`, [d.sx * 300, 0, 0] as Vec3])),
+ fix: rest.flatMap((d) => [frontBolts(d), ...sideCams(d), ...backBolts(d), stopScrews(d), drawerRunner(d)]),
tools: ["screwdriver", "allen"],
},
{ title: "Slide the drawers in", detail: "Rest the runners on the ones in the bed and push each drawer in until it closes. Two on each long side.", check: "square" },
];
- void z0;
return { parts, steps };
}
diff --git a/src/lib/plan/families/mannarp.ts b/src/lib/plan/families/mannarp.ts
index 0445f4f..1f2c748 100644
--- a/src/lib/plan/families/mannarp.ts
+++ b/src/lib/plan/families/mannarp.ts
@@ -48,6 +48,22 @@ const leaning = (id: string, name: string, x0: number, x1: number, y0: number, h
};
/** Mirrors a recipe left to right. */
+/** The back bar: an upright behind the chaise longue with a foot that lies on the chaise frame's top, bolted down through it. */
+function backBar(id: string, x: number, FB: number, SEAT: number, zb: number): CustomPart {
+ const yc = FB + 260, zc = zb + 125;
+ return {
+ id,
+ name: "Back bar",
+ size: [40, 520, 250],
+ pos: [x, yc, zc],
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [40, 520, 8], pos: [0, 0, -121] },
+ { shape: "box", size: [40, 8, 250], pos: [0, SEAT + 4 - yc, 0] },
+ ],
+ };
+}
+
function mirror(p: CustomParams): CustomParams {
const fx = (v: Vec3): Vec3 => [-v[0], v[1], v[2]];
return {
@@ -98,7 +114,7 @@ function twoChaises(s: ProductSpec): CustomParams {
parts.push(box(q.c, "Chaise longue frame", q.xa, q.xb, LEG, SEAT, zSeat0, zb + Dc));
const l = legsOf(q.lg, [q.xa + 60, q.xb - 60], [zSeat0 + 70, zb + Dc - 60]);
parts.push(leaning(q.bc, "Chaise backrest frame", q.xa, q.xb, FB, backH - FB, zb, bt, tilt));
- parts.push({ id: q.bar, name: "Back bar", size: [40, 520, 8], pos: [q.xa + 40, FB + 260, zb + 4], material: "metal" });
+ parts.push(backBar(q.bar, q.xa + 40, FB, SEAT, zb));
return l;
});
const cushions: string[] = [];
@@ -143,16 +159,16 @@ function twoChaises(s: ProductSpec): CustomParams {
if (i) steps.push({ title: "Screw two rods into the left armrest and push the chaise onto them", detail: "This armrest goes on the outer chaise. Rods into the holes low down on its inside, then a washer and a wing knob on each, from inside the chaise.", fix: [rods(xc2, -1, lowPts, "AR", q.c), ...knobs(xc2, -1, lowPts, q.c)], warnings: ["hand"] });
steps.push({
title: `Bolt the back bar to ${which}`,
- detail: "At the back corner on the sofa side, foot down. The carriage bolt goes through its foot, with a washer and a wing knob underneath.",
+ detail: "At the back corner on the sofa side, foot down. Its foot lies on the chaise frame; the carriage bolt goes down through it, with a washer and a wing knob under the frame top.",
add: [q.bar],
- fix: [at("bolt", [[q.xa + 40, SEAT, zb + 40]], [0, -1, 0], q.c, undefined, CARRIAGE), at("washer", [[q.xa + 40, FB + 2, zb + 40], [q.xa + 40, FB, zb + 40]], [0, 1, 0], q.c, undefined, WASHER), at("nut", [[q.xa + 40, FB - 4, zb + 40]], [0, 1, 0], q.c, undefined, KNOB)],
+ fix: [at("bolt", [[q.xa + 40, SEAT + 8, zb + 100]], [0, -1, 0], q.c, undefined, CARRIAGE), at("washer", [[q.xa + 40, SEAT - 50, zb + 100], [q.xa + 40, SEAT - 52, zb + 100]], [0, 1, 0], q.c, undefined, WASHER), at("nut", [[q.xa + 40, SEAT - 56, zb + 100]], [0, 1, 0], q.c, undefined, KNOB)],
warnings: ["hand"],
});
const barPts: [number, number][] = [[q.xa + 40, zb + 120], [q.xa + 40, zb + 220]];
steps.push({
title: "Push the two rods with collars down through the bar",
detail: "Through the bar's holes into the chaise frame, a washer and a wing knob on each from underneath.",
- fix: [at("stud", barPts.map(([x, z]) => [x, SEAT - 5, z] as Vec3), [0, -1, 0], q.c, q.bar, COLLAR_ROD), at("washer", barPts.map(([x, z]) => [x, FB, z] as Vec3), [0, 1, 0], q.c, undefined, WASHER), at("nut", barPts.map(([x, z]) => [x, FB - 4, z] as Vec3), [0, 1, 0], q.c, undefined, KNOB)],
+ fix: [at("stud", barPts.map(([x, z]) => [x, SEAT + 8, z] as Vec3), [0, -1, 0], q.c, q.bar, COLLAR_ROD), at("washer", barPts.map(([x, z]) => [x, FB, z] as Vec3), [0, 1, 0], q.c, undefined, WASHER), at("nut", barPts.map(([x, z]) => [x, FB - 4, z] as Vec3), [0, 1, 0], q.c, undefined, KNOB)],
warnings: ["hand"],
});
});
@@ -224,7 +240,7 @@ function recipe(s: ProductSpec): CustomParams | null {
parts.push(box("C", "Chaise longue frame", xs1, xc1, LEG, SEAT, zSeat0, zb + Dc));
chaiseLegs = legsOf("LC", [xs1 + 60, xc1 - 60], [zSeat0 + 70, zb + Dc - 60]);
parts.push(leaning("BC", "Chaise backrest frame", xs1, xc1, FB, backH - FB, zb, bt, tilt));
- parts.push({ id: "BAR", name: "Back bar", size: [40, 520, 8], pos: [xs1 + 40, FB + 260, zb + 4], material: "metal" });
+ parts.push(backBar("BAR", xs1 + 40, FB, SEAT, zb));
}
// back cushions: two on either sofa section, one on the chaise longue
const cushions: string[] = [];
@@ -303,16 +319,16 @@ function recipe(s: ProductSpec): CustomParams | null {
steps.push({ title: "Screw two rods into the right armrest and push the chaise onto them", detail: "Rods into the holes low down on its inside. Then a washer and a wing knob on each, from inside the chaise.", fix: [rods(xc1, -1, [[yLow, zA], [yLow, zB]], "AR", "C"), ...knobs(xc1, -1, [[yLow, zA], [yLow, zB]], "C")], warnings: ["hand"] });
steps.push({
title: "Bolt the back bar to the chaise longue",
- detail: "At the back corner on the sofa side, foot down. The carriage bolt goes through its foot, with a washer and a wing knob underneath.",
+ detail: "At the back corner on the sofa side, foot down. Its foot lies on the chaise frame; the carriage bolt goes down through it, with a washer and a wing knob under the frame top.",
add: ["BAR"],
- fix: [at("bolt", [[xs1 + 40, SEAT, zb + 40]], [0, -1, 0], "C", undefined, CARRIAGE), at("washer", [[xs1 + 40, FB + 2, zb + 40], [xs1 + 40, FB, zb + 40]], [0, 1, 0], "C", undefined, WASHER), at("nut", [[xs1 + 40, FB - 4, zb + 40]], [0, 1, 0], "C", undefined, KNOB)],
+ fix: [at("bolt", [[xs1 + 40, SEAT + 8, zb + 100]], [0, -1, 0], "C", undefined, CARRIAGE), at("washer", [[xs1 + 40, SEAT - 50, zb + 100], [xs1 + 40, SEAT - 52, zb + 100]], [0, 1, 0], "C", undefined, WASHER), at("nut", [[xs1 + 40, SEAT - 56, zb + 100]], [0, 1, 0], "C", undefined, KNOB)],
warnings: ["hand"],
});
const barPts: [number, number][] = [[xs1 + 40, zb + 120], [xs1 + 40, zb + 220]];
steps.push({
title: "Push the two rods with collars down through the bar",
detail: "Through the bar's holes into the chaise frame, a washer and a wing knob on each from underneath.",
- fix: [at("stud", barPts.map(([x, z]) => [x, SEAT - 5, z] as Vec3), [0, -1, 0], "C", "BAR", COLLAR_ROD), at("washer", barPts.map(([x, z]) => [x, FB, z] as Vec3), [0, 1, 0], "C", undefined, WASHER), at("nut", barPts.map(([x, z]) => [x, FB - 4, z] as Vec3), [0, 1, 0], "C", undefined, KNOB)],
+ fix: [at("stud", barPts.map(([x, z]) => [x, SEAT + 8, z] as Vec3), [0, -1, 0], "C", "BAR", COLLAR_ROD), at("washer", barPts.map(([x, z]) => [x, FB, z] as Vec3), [0, 1, 0], "C", undefined, WASHER), at("nut", barPts.map(([x, z]) => [x, FB - 4, z] as Vec3), [0, 1, 0], "C", undefined, KNOB)],
warnings: ["hand"],
});
const joinPts: [number, number][] = [[yLow, zA], [yLow, zf - 140]];
diff --git a/src/lib/plan/families/mariedamm.ts b/src/lib/plan/families/mariedamm.ts
index 21d66bb..2e41939 100644
--- a/src/lib/plan/families/mariedamm.ts
+++ b/src/lib/plan/families/mariedamm.ts
@@ -107,9 +107,11 @@ function recipe(s: ProductSpec): (CustomParams & { legs: CustomPart[]; first: nu
// fittings
const mount = (l: Leg) => {
- // four screws through the bent end into the top, two each side of the middle line
+ // four screws through the bent end into the top, two each side of the middle line; the round table's short
+ // screws start from inside the tube (through the access holes underneath), the oval's long ones from below it
+ const y0 = round ? yTop - 20 : yTop - lh;
const pts: Vec3[] = [];
- for (const t of [l.r1 - 35, l.r1 - l.flange + 40]) for (const sd of [-1, 1]) pts.push(add(add(scale(l.u, t), scale(l.n, l.off + (sd * lw) / 4)), [0, yTop - lh, 0]));
+ for (const t of [l.r1 - 35, l.r1 - l.flange + 40]) for (const sd of [-1, 1]) pts.push(add(add(scale(l.u, t), scale(l.n, l.off + sd * 12)), [0, y0, 0]));
return pts;
};
const sideOf = (l: Leg, k: number[]): Vec3[] => k.map((dy) => add(scale(l.n, l.off - lw / 2), [0, yc + dy, 0]));
diff --git a/src/lib/plan/families/markus.ts b/src/lib/plan/families/markus.ts
index 1c7cfd8..0afe882 100644
--- a/src/lib/plan/families/markus.ts
+++ b/src/lib/plan/families/markus.ts
@@ -44,9 +44,16 @@ function recipe(s: ProductSpec): CustomParams | null {
{ shape: "box", size: [440, 110, 50], pos: [0, -backH / 2 + 230, 16], material: "soft" },
];
const brkPieces: PartPiece[] = [
- { shape: "box", size: [70, 16, 200], pos: [0, -120, 50] },
+ { shape: "box", size: [70, 40, 200], pos: [0, -120, 50] }, // the sleeve that slides over the mechanism's arm
{ shape: "box", size: [70, 260, 16], pos: [0, 0, -50] },
];
+ // the mechanism, with its arm reaching back into the back bracket's sleeve
+ const armZ = backZ + 12, mz1Body = zSeat - 20 + 130, mz0Body = zSeat - 20 - 130;
+ const mecZ = (armZ + mz1Body) / 2;
+ const mecPieces: PartPiece[] = [
+ { shape: "box", size: [220, 50, 260], pos: [0, 0, zSeat - 20 - mecZ] },
+ { shape: "box", size: [50, 20, mz0Body - armZ], pos: [0, -23, (mz0Body + armZ) / 2 - mecZ] },
+ ];
const armY = 690;
const armPieces = (sx: number): PartPiece[] => [
{ shape: "box", size: [40, 30, 300], pos: [0, 115, 0] },
@@ -58,7 +65,7 @@ function recipe(s: ProductSpec): CustomParams | null {
const parts: CustomPart[] = [
{ id: "BASE", name: "Star base", size: [2 * R, 70, 2 * R], pos: [0, baseY, 0], pieces: basePieces, material: "metal" },
{ id: "GAS", name: "Gas lift", size: [50, mechY0 - 90 + 20, 50], pos: [0, (mechY0 + 20 + 90) / 2, 0], shape: "cyl", material: "metal" },
- { id: "MEC", name: "Tilt mechanism", size: [220, 50, 260], pos: [0, mechY0 + 25, zSeat - 20], material: "metal" },
+ { id: "MEC", name: "Tilt mechanism", size: [220, 50, mz1Body - armZ], pos: [0, mechY0 + 25, mecZ], pieces: mecPieces, material: "metal" },
{ id: "SEAT", name: "Seat", size: [seatW, seatT, seatD], pos: [0, seatY0 + seatT / 2, zSeat], material: "soft" },
{ id: "BRK", name: "Back bracket", size: [70, 260, 116], pos: [0, mechY0 + 130 - 8, backZ + 58], pieces: brkPieces, material: "metal" },
{ id: "BACK", name: "Backrest", size: [500, backH, 60], pos: [0, backY0 + backH / 2, backZ - 30], pieces: backPieces, material: "soft" },
@@ -71,7 +78,7 @@ function recipe(s: ProductSpec): CustomParams | null {
const mz0 = zSeat - 20 - 100, mz1 = zSeat - 20 + 100;
const backBolts: Vec3[] = [[-80, mechY0, mz0], [80, mechY0, mz0]];
const frontBolts: Vec3[] = [[-80, mechY0, mz1], [80, mechY0, mz1]];
- const brkBolts: Vec3[] = [-40, 0, 40].map((dz, i) => [35, mechY0 + 20 + i * 18, backZ + 60 + dz] as Vec3);
+ const brkBolts: Vec3[] = [-40, 0, 40].map((dz) => [35, mechY0 + 2, backZ + 60 + dz] as Vec3);
const armBolts = (sx: number): Vec3[] => [-60, 60].map((dz) => [sx * (armX - 30 - 30), seatY0 + 30, zSeat + dz] as Vec3);
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/matchspel.ts b/src/lib/plan/families/matchspel.ts
index 0b3e185..7b924e2 100644
--- a/src/lib/plan/families/matchspel.ts
+++ b/src/lib/plan/families/matchspel.ts
@@ -57,7 +57,8 @@ function chair(s: ProductSpec): CustomParams {
const parts: CustomPart[] = [
{ id: "BASE", name: "Star base", size: [2 * R, 70, 2 * R], pos: [0, baseY, 0], pieces: [{ shape: "cyl", size: [70, 70, 70], pos: [0, 0, 0] }, ...angles.map(arm)], material: "board" },
{ id: "GAS", name: "Gas lift", shape: "cyl", size: [50, mech0 - baseY - 35 + 20, 50], pos: [0, (mech0 + 20 + baseY + 35) / 2, 0], material: "metal" },
- part("HBAR", "Headrest bar", [{ shape: "box", size: [50, 220, 16], pos: [0, hy0 + 40, hz - 30], rot: [0.15, 0, 0] }], [-25, hy0 - 70, hz - 50], [25, hy0 + 150, hz - 10], "metal"),
+ // the bar lies flat against the back of the backrest where its two bolts go in
+ part("HBAR", "Headrest bar", [{ shape: "box", size: [50, 220, 16], pos: [0, hy0 + 40, hz + 15], rot: [0.15, 0, 0] }], [-25, hy0 - 70, hz - 10], [25, hy0 + 150, hz + 40], "metal"),
{ id: "HPAD", name: "Headrest", size: [290, 120, 70], pos: [0, H - 60, hz - 5], material: "soft" },
part("BACK", "Backrest", backAbs, [-245, mech0 + 10, zTop - 25], [245, yB1, zSeat - 90], "soft"),
{ id: "SEAT", name: "Seat", size: [seatW, seatT, seatD], pos: [0, yS + seatT / 2, zSeat], material: "soft" },
@@ -94,7 +95,7 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Bolt the headrest on",
detail: "Hook its bar over the two bolts, then fit two button bolts through the bar.",
- fix: [fx("bolt", [[-15, hy0 - 20, hz - 38], [15, hy0 - 20, hz - 38]], [0, 0, 1], "HBAR", { ...SHORT, mate: "BACK" })],
+ fix: [fx("bolt", [[-15, hy0 - 20, hz - 2], [15, hy0 - 20, hz - 2]], [0, 0, 1], "HBAR", { ...SHORT, mate: "BACK" })],
tools: ["allen"],
},
{ title: "Tighten the first two bolts", detail: "Now turn them in fully with the Allen key.", tools: ["allen"] },
diff --git a/src/lib/plan/families/mellgrund.ts b/src/lib/plan/families/mellgrund.ts
index 6f90354..8a67bc2 100644
--- a/src/lib/plan/families/mellgrund.ts
+++ b/src/lib/plan/families/mellgrund.ts
@@ -148,12 +148,12 @@ function recipe(s: ProductSpec) {
const braceY = RY0 + 10;
for (const b of braces) {
const ax = b.sx * (xr - 3), az = b.sz < 0 ? z0 + reach : z1 - reach; // on the rail
- const bx = b.sx * (xr - reach), bz = b.sz < 0 ? z0 : z1; // on the end
+ const bx = b.sx * (xr - reach), bz = b.sz < 0 ? zh : zf; // on the end, under its bottom bar
const len = Math.hypot(ax - bx, az - bz);
- parts.push({ id: b.id, name: "Corner brace", size: [len, 4, 30], pos: [(ax + bx) / 2, braceY, (az + bz) / 2], material: "metal", rot: [0, b.sx * b.sz > 0 ? Math.PI / 4 : -Math.PI / 4, 0] });
+ parts.push({ id: b.id, name: "Corner brace", size: [len, 4, 30], pos: [(ax + bx) / 2, braceY, (az + bz) / 2], material: "metal", rot: [0, Math.atan2(-(az - bz), ax - bx), 0] });
}
const braceEnds = (onRail: boolean) =>
- braces.map((b): Vec3 => (onRail ? [b.sx * (xr - 20), braceY, b.sz < 0 ? z0 + reach - 12 : z1 - reach + 12] : [b.sx * (xr - reach + 12), braceY, b.sz < 0 ? z0 + 20 : z1 - 20]));
+ braces.map((b): Vec3 => (onRail ? [b.sx * (xr - 20), braceY, b.sz < 0 ? z0 + reach - 12 : z1 - reach + 12] : [b.sx * (xr - reach + 12), braceY - 2, b.sz < 0 ? zh + 5 : zf - 5]));
// felt strips along the lips, and the beam's
const yLip = RY0 + LIP;
@@ -230,7 +230,7 @@ function recipe(s: ProductSpec) {
{
title: "Square the frame and screw the braces to the ends",
detail: "Push the frame until both diagonals match, then screw the other end of each brace on and tighten all eight.",
- fix: [{ ...SCREW, count: 4, at: braceEnds(false), dir: [0, -1, 0] }],
+ fix: [{ ...SCREW, count: 4, at: braceEnds(false), dir: [0, 1, 0] }], // up through the brace into the end's bottom bar
tools: ["allen"],
check: "square",
},
diff --git a/src/lib/plan/families/metod.ts b/src/lib/plan/families/metod.ts
index 0ee28c2..0cecb5f 100644
--- a/src/lib/plan/families/metod.ts
+++ b/src/lib/plan/families/metod.ts
@@ -687,8 +687,9 @@ class Metod {
const yb = lo + 18;
const front = this.part("Drawer front", [bay?.fw ?? W - GAP, r(h - GAP), T], [bay?.fx ?? 0, r((lo + hi) / 2), this.fz]);
const sides = [-1, 1].map((sx) => this.part("Drawer side", [16, sh, dd], [xc + sx * (bw / 2 - 8), yb + sh / 2, zc], { material: "metal" })) as [string, string];
- const back = this.part("Drawer back", [bw - 32, sh - 20, 16], [xc, yb + 16 + (sh - 20) / 2, zc - dd / 2 + 10]);
- const bottom = this.part("Drawer bottom", [bw - 32, 16, dd - 20], [xc, yb + 8, zc + 8]);
+ // the bottom runs under the back, so its screw goes up through the bottom into the back's lower edge
+ const back = this.part("Drawer back", [bw - 32, sh - 16, 16], [xc, yb + 12 + (sh - 16) / 2, zc - dd / 2 + 10]);
+ const bottom = this.part("Drawer bottom", [bw - 32, 12, dd - 4], [xc, yb + 6, zc]);
const extras =
size === "medium"
? [-1, 1].map((sx) => this.part("Gallery rail", [12, 12, dd - 20], [xc + sx * (bw / 2 - 8), yb + sh + 40, zc + 8], { material: "metal" }))
@@ -1286,9 +1287,6 @@ function hoodCabinet(m: Metod) {
});
if (hood) {
- m.step({ title: "Screw in the cam bolts for the hood board", detail: "Two into each side, low down. The row depends on your hood: its own manual says which.", kind: "cams", tools: ["screwdriver"] }, () => {
- b.fits(BOLT, hoodJ.flatMap((j) => j.bolts), 0.08);
- });
m.step(
{
title: "Drill the hood board for your hood",
@@ -1303,6 +1301,9 @@ function hoodCabinet(m: Metod) {
b.stage(hood, [0, T / 2, p[2]], [0, 0, 0], [0, 160, 0]);
},
);
+ m.step({ title: "Screw in the cam bolts for the hood board", detail: "Two into each side, low down. The row depends on your hood: its own manual says which.", kind: "cams", tools: ["screwdriver"], scene: "main" }, () => {
+ b.fits(BOLT, hoodJ.flatMap((j) => j.bolts), 0.08);
+ });
m.step({ title: "Tap the dowels into the hood board", detail: "Two into each end.", kind: "dowels", tools: ["hammer"], scene: "hood" }, () => {
b.fits(DOWEL, hoodJ.flatMap((j) => j.dowels), 0.06);
});
@@ -1632,7 +1633,8 @@ function cornerBase128(m: Metod) {
b.fits(CONFIRMAT, [0.2, 0.5, 0.8].map((f) => ({ on: post, at: [xp - 25, r(y0 + H * f), D / 2 + 60] as Vec3, dir: [0, 0, -1] as Vec3, mate: front })), 0.12);
});
- const hangAt: Vec3 = [bx, top - 16, -D / 2 + 60];
+ // the bracket hangs from the back rail beside the middle panel (its bolt goes across) or over the brace (its bolt goes down)
+ const hangAt: Vec3 = middle ? [xp - T - 4, top - 16, -D / 2 + 60] : [bx, top - 16, -D / 2 + 60];
m.step({ title: "Hook the hanging bracket onto the back rail", detail: drawer ? "Behind the post, where the middle panel will hang." : "Behind the post, where the top brace will go.", kind: "general" }, () => {
b.fit(HANGER, { on: backRail, at: hangAt, dir: [0, -1, 0], hole: false });
});
@@ -1641,9 +1643,9 @@ function cornerBase128(m: Metod) {
m.put(brace, [0, 120, 300]);
});
m.step({ title: "Bolt the brace to the bracket", detail: "The bolt goes up through the brace and the bracket. Hold the nut with a spanner and tighten.", kind: "screws", tools: ["screwdriver", "wrench"] }, () => {
- b.fit(M6_BOLT, { on: brace, at: [bx, top - 2 * T, -D / 2 + 70], dir: [0, 1, 0] });
+ b.fit(M6_BOLT, { on: brace, at: [bx, top - 14, -D / 2 + 70], dir: [0, -1, 0] });
b.then(0.05);
- b.fit(M6_NUT, { on: brace, at: [bx, top - T, -D / 2 + 70], dir: [0, -1, 0], hole: false });
+ b.fit(M6_NUT, { on: brace, at: [bx, top - 2 * T - 2, -D / 2 + 70], dir: [0, 1, 0], hole: false });
});
m.step({ title: "Screw the brace onto the support block", detail: "Two screws up through the block into the front of the brace.", kind: "screws", tools: ["screwdriver"] }, () => {
b.fits(JOIN_SCREW, [-12, 12].map((d) => ({ on: brace, at: [bx + d, top - 2 * T, D / 2 - T - 15] as Vec3, dir: [0, 1, 0] as Vec3 })), 0.1);
@@ -1659,9 +1661,9 @@ function cornerBase128(m: Metod) {
m.put(middle, [0, -200, 0]);
});
m.step({ title: "Bolt the panel to the bracket", detail: "The bolt goes through the bracket and the panel. Hold the nut with a spanner and tighten.", kind: "screws", tools: ["screwdriver", "wrench"] }, () => {
- b.fit(M6_BOLT, { on: middle, at: [xp - T, top - T - 30, -D / 2 + 70], dir: [1, 0, 0], hole: false });
+ b.fit(M6_BOLT, { on: middle, at: [xp - T - 4, top - T - 30, -D / 2 + 70], dir: [1, 0, 0], hole: false });
b.then(0.05);
- b.fit(M6_NUT, { on: middle, at: [xp, top - T - 30, -D / 2 + 70], dir: [-1, 0, 0], hole: false });
+ b.fit(M6_NUT, { on: middle, at: [xp + 2, top - T - 30, -D / 2 + 70], dir: [-1, 0, 0], hole: false });
});
m.step({ title: "Screw the panel to the front", detail: "One long screw through the post and the front panel into the middle panel's front edge.", kind: "screws", tools: ["screwdriver"] }, () => {
b.fit(LONG_SCREW, { on: post, at: [xp - T / 2, top - T - 150, D / 2 + 60], dir: [0, 0, -1], mate: middle });
@@ -1946,8 +1948,8 @@ function cornerBase88(m: Metod) {
[
{ on: tRail, at: [xf - 30, top, z0 + T / 2], dir: [0, -1, 0], mate: s1a },
{ on: tRail, at: [xf - 30, top, W / 2 - T / 2], dir: [0, -1, 0], mate: s1b },
- { on: tRail, at: [W / 2 - T / 2, top, zf - 30], dir: [0, -1, 0], mate: side2 },
- { on: tRail, at: [xf - 30, top, zf - 30], dir: [0, -1, 0] },
+ { on: tRail, at: [W / 2 - T / 2, top, zf - 45], dir: [0, -1, 0], mate: side2 },
+ { on: tRail, at: [W / 2 - T / 2, top, zf - 15], dir: [0, -1, 0], mate: side2 },
],
0.12,
);
@@ -2095,7 +2097,7 @@ function corner88Carousel(m: Metod, c: { x0: number; z0: number; xf: number; top
m.step({ title: "Fit the beam across the long box", detail: "A bracket screwed into each side, the beam bolted to both brackets with two bolts and nuts each, and the top bearing under it with three screws.", kind: "screws", tools: ["screwdriver", "allen", "wrench"] }, () => {
const ends = [c.z0 + T, -c.z0 - T];
b.fits(BEAM_BRACKET, ends.map((z, i) => ({ on: i ? c.s1b : c.s1a, at: [cx, c.top - 90, z] as Vec3, dir: [0, 0, i ? 1 : -1] as Vec3, hole: false as const })), 0.12);
- b.fits(JOIN_SCREW, ends.map((z, i) => ({ on: i ? c.s1b : c.s1a, at: [cx, c.top - 70, z] as Vec3, dir: [0, 0, i ? 1 : -1] as Vec3 })), 0.1);
+ b.fits(PLATE_SCREW, ends.map((z, i) => ({ on: i ? c.s1b : c.s1a, at: [cx, c.top - 70, z] as Vec3, dir: [0, 0, i ? 1 : -1] as Vec3 })), 0.1);
b.then(0.1);
m.put(beam, [0, 200, 0]);
b.then(0.1);
diff --git a/src/lib/plan/families/micke.ts b/src/lib/plan/families/micke.ts
index 3b21bed..c5d763a 100644
--- a/src/lib/plan/families/micke.ts
+++ b/src/lib/plan/families/micke.ts
@@ -9,6 +9,8 @@ import type { CustomFix, CustomPart, CustomParams, CustomStep, PartMaterial, Pro
* drawer walls get cam bolts and runners and are locked on, the leg frame is screwed to the back with a steel strip,
* and the whole frame is turned upside down onto the top and cam-locked. The drawer unit with drop-file storage has
* its own manual: a carcass with no bottom on five castors, three small drawers and a file drawer with hanging frames.
+ * The 105 desk (a cupboard with a small drawer, a wide drawer and the leg frame) and the corner workstation (a corner
+ * desk and its add-on unit) each have their own manual too.
*/
type Kind = CustomFix["kind"];
@@ -236,6 +238,624 @@ function desk(s: ProductSpec): CustomParams {
return finish({ parts, steps });
}
+/* ---------- the 105 desk: a cupboard with a small drawer at one end, a wide drawer and the leg frame ---------- */
+
+/** One drawer of a MICKE desk in the bay between a and b: a front set in, two sides, a back and a bottom in grooves. */
+function deskDrawer(parts: CustomPart[], k: string, a: number, b: number, yS: number, yT: number, zb: number, zf: number) {
+ const dy0 = yS + 30, dy1 = yT - 25, dz0 = zb + 30, dz1 = zf - 38;
+ const s0 = a + 13, s1 = b - 13;
+ parts.push(P(`DF${k}`, "Drawer front", a + 2, b - 2, yS + 22, yT - 4, dz1, dz1 + 18));
+ parts.push(P(`DL${k}`, "Drawer side", s0, s0 + 12, dy0, dy1, dz0, dz1));
+ parts.push(P(`DR${k}`, "Drawer side", s1 - 12, s1, dy0, dy1, dz0, dz1));
+ parts.push(P(`DB${k}`, "Drawer back", s0 + 12, s1 - 12, dy0 + 10, dy1, dz0, dz0 + 12));
+ parts.push(P(`DT${k}`, "Drawer bottom", s0 + 12, s1 - 12, dy0 + 4, dy0 + 7, dz0 + 12, dz1, "fiber"));
+ return { k, a, b, s0, s1, dy0, dy1, dz0, dz1, yM: (dy0 + dy1) / 2 };
+}
+
+const GLIDE2 = { len: 12, dia: 24, name: "Glide" };
+const HEX = { len: 3, dia: 30, name: "Hexagonal pad" };
+
+/**
+ * IKEA's manual for the 105 desk: both drawers first, then the drawer shelf, back panel and top strip doweled into
+ * one rail, the drawer wall and the cupboard's inner side locked onto its ends, the cupboard's back, bottom and outer
+ * side added, the leg frame screwed up under the drawer wall, and the frame turned onto the top. Then the door,
+ * two shelves and the pads.
+ */
+function desk105(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = 750, T = 25, D = 500;
+ const yT = H - T, zb = -D / 2, zf = D / 2;
+ const xo = -W / 2 + 18; // the outer side's inner face
+ const xi0 = -W / 2 + 332, xi1 = xi0 + 18; // the cupboard's inner side
+ const xw = W / 2 - 18; // the drawer wall's inner face, at the end of the desk
+ const yS = 572; // the drawer shelf
+ const yB = 50; // the cupboard bottom
+ const yC = 520; // top of the cupboard's back panel and door, under the small drawer's opening
+ const parts: CustomPart[] = [
+ P("SH", "Drawer shelf", xi1, xw, yS, yS + 18, zb + 18, zf - 20),
+ P("BP", "Back panel", xi1, xw, yS + 18, yT - 18, zb, zb + 18),
+ P("TS", "Top strip", xi1, xw, yT - 18, yT, zb, zb + 80),
+ P("DW", "Drawer wall", xw, W / 2, yS, yT, zb, zf),
+ P("IS", "Inner side", xi0, xi1, 0, yT, zb, zf),
+ P("CB", "Cupboard back", xo, xi0, yB, yC, zb, zb + 18),
+ P("CF", "Cupboard bottom", xo, xi0, yB, yB + 18, zb + 18, zf - 18),
+ P("OS", "Outer side", -W / 2, xo, 0, yT, zb, zf),
+ P("TOP", "Desk top", -W / 2, W / 2, yT, H, zb, zf),
+ P("DR", "Door", xo + 2, xi0 - 2, yB + 20, yC + 5, zf - 18, zf),
+ P("SH1", "Shelf", xo, xi0, 200, 218, zb + 18, zf - 22),
+ P("SH2", "Shelf", xo, xi0, 360, 378, zb + 18, zf - 22),
+ ];
+ const lx = W / 2 - 12.5, lz = D - 50, lh = yS;
+ parts.push({
+ id: "LF",
+ name: "Leg frame",
+ size: [25, lh, lz],
+ pos: [lx, lh / 2, 0],
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [25, lh, 25], pos: [0, 0, -lz / 2 + 12.5] },
+ { shape: "box", size: [25, lh, 25], pos: [0, 0, lz / 2 - 12.5] },
+ { shape: "box", size: [25, 25, lz], pos: [0, -lh / 2 + 12.5, 0] },
+ { shape: "box", size: [25, 25, lz], pos: [0, lh / 2 - 12.5, 0] },
+ ],
+ });
+ const dr = [deskDrawer(parts, "0", xi1, xw, yS, yT, zb, zf), deskDrawer(parts, "1", xo, xi0, yS, yT, zb, zf)];
+ const each = (f: (d: (typeof dr)[number]) => CustomFix[]) => dr.flatMap(f);
+ const yRail = dr[0].dy0 + 10;
+
+ const steps: CustomStep[] = [
+ {
+ title: "Screw two cam bolts into each drawer front",
+ detail: "One wide drawer and one small one. Lay the fronts face down on a rug and turn the bolts in by hand.",
+ fix: each((d) => [at("camScrew", [[d.s0 + 6, d.yM, d.dz1], [d.s1 - 6, d.yM, d.dz1]], [0, 0, 1], `DF${d.k}`, undefined, CAM_BOLT)]),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap a dowel into each drawer side and stand it on the front",
+ detail: "The dowel goes into the front end of each side. Holes for the cam locks face in.",
+ fix: each((d) => [at("dowel", [[d.s0 + 6, d.dy1 - 25, d.dz1]], [0, 0, -1], `DL${d.k}`, `DF${d.k}`, DOWEL), at("dowel", [[d.s1 - 6, d.dy1 - 25, d.dz1]], [0, 0, -1], `DR${d.k}`, `DF${d.k}`, DOWEL)]),
+ tools: ["hammer"],
+ },
+ {
+ title: "Turn the cam locks in the drawer sides",
+ detail: "Arrow towards the bolt, then clockwise until the side pulls tight against the front.",
+ fix: each((d) => [at("cam", [[d.s0 + 12, d.yM, d.dz1 - 34]], [-1, 0, 0], `DL${d.k}`, undefined, { len: 11, dia: 12 }), at("cam", [[d.s1 - 12, d.yM, d.dz1 - 34]], [1, 0, 0], `DR${d.k}`, undefined, { len: 11, dia: 12 })]),
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the bottoms into the grooves", detail: "Turn each drawer over. Smooth side up, all the way to the front.", add: ["DT0", "DT1"] },
+ { title: "Fit the backs onto the drawers", detail: "Each back sits between the sides, over the end of the bottom.", add: ["DB0", "DB1"] },
+ {
+ title: "Screw the backs to the sides",
+ detail: "One screw through each side into the end of the back.",
+ fix: each((d) => [at("screw", [[d.s0, d.yM, d.dz0 + 6]], [1, 0, 0], `DL${d.k}`, `DB${d.k}`, { len: 25, dia: 4 }), at("screw", [[d.s1, d.yM, d.dz0 + 6]], [-1, 0, 0], `DR${d.k}`, `DB${d.k}`, { len: 25, dia: 4 })]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Clip the inner runners onto the drawers",
+ detail: "One along the bottom edge of each side, the wheel at the back.",
+ fix: each((d) => [at("runner", [[d.s0, yRail, (d.dz0 + d.dz1) / 2]], [1, 0, 0], `DL${d.k}`, undefined, RUNNER), at("runner", [[d.s1, yRail, (d.dz0 + d.dz1) / 2]], [-1, 0, 0], `DR${d.k}`, undefined, RUNNER)]),
+ },
+ {
+ title: "Screw the runners to the drawer sides",
+ detail: "Two small screws in each.",
+ fix: each((d) => [at("screw", [[d.s0, yRail, d.dz0 + 80], [d.s0, yRail, d.dz1 - 80]], [1, 0, 0], `DL${d.k}`, undefined, SMALL), at("screw", [[d.s1, yRail, d.dz0 + 80], [d.s1, yRail, d.dz1 - 80]], [-1, 0, 0], `DR${d.k}`, undefined, SMALL)]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap two dowels into the drawer shelf and stand the back panel on it",
+ detail: "Lay the shelf on a rug. The back panel stands on the dowels along its back edge.",
+ add: ["SH", "BP"],
+ fix: [at("dowel", [[xi1 + 150, yS + 18, zb + 9], [xw - 150, yS + 18, zb + 9]], [0, -1, 0], "SH", "BP", DOWEL)],
+ tools: ["hammer"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap two dowels into the back panel and press the top strip on",
+ detail: "Its wide side goes to the front.",
+ add: ["TS"],
+ fix: [at("dowel", [[xi1 + 150, yT - 18, zb + 9], [xw - 150, yT - 18, zb + 9]], [0, -1, 0], "BP", "TS", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw cam bolts into the drawer wall and the cupboard's inner side",
+ detail: "Four in each, into the holes facing the drawer.",
+ fix: [
+ at("camScrew", [[xw, yS + 9, -150], [xw, yS + 9, 100], [xw, 650, zb + 9], [xw, yT - 9, zb + 40]], [1, 0, 0], "DW", undefined, CAM_BOLT),
+ at("camScrew", [[xi1, yS + 9, -150], [xi1, yS + 9, 100], [xi1, 650, zb + 9], [xi1, yT - 9, zb + 40]], [-1, 0, 0], "IS", undefined, CAM_BOLT),
+ ],
+ tools: ["screwdriver"],
+ wait: ["DW", "IS"],
+ },
+ {
+ title: "Screw the outer runners for the wide drawer to them",
+ detail: "One on each, wheel at the front, two small screws in each.",
+ fix: [
+ at("runner", [[xw, yRail, 0]], [1, 0, 0], "DW", undefined, RUNNER),
+ at("runner", [[xi1, yRail, 0]], [-1, 0, 0], "IS", undefined, RUNNER),
+ at("screw", [[xw, yRail, zb + 90], [xw, yRail, zf - 90]], [1, 0, 0], "DW", undefined, SMALL),
+ at("screw", [[xi1, yRail, zb + 90], [xi1, yRail, zf - 90]], [-1, 0, 0], "IS", undefined, SMALL),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Push the drawer wall and the inner side onto the rail",
+ detail: "A dowel in each end of the shelf. The bolts go into the holes in the ends of the shelf, back panel and strip.",
+ add: ["DW", "IS"],
+ fix: [at("dowel", [[xw, yS + 9, -40]], [-1, 0, 0], "SH", "DW", DOWEL), at("dowel", [[xi1, yS + 9, -40]], [1, 0, 0], "SH", "IS", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Turn the eight cam locks",
+ detail: "In the shelf, the back panel and the top strip, each clockwise until the joint pulls tight.",
+ fix: [xw - 34, xi1 + 34].flatMap((x) => [
+ at("cam", [[x, yS + 18, -150], [x, yS + 18, 100]], [0, -1, 0], "SH", undefined, CAM),
+ at("cam", [[x, 650, zb + 18]], [0, 0, -1], "BP", undefined, CAM),
+ at("cam", [[x, yT, zb + 40]], [0, -1, 0], "TS", undefined, CAM),
+ ]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the outer runners for the small drawer on",
+ detail: "One on the other face of the inner side, one inside the outer side. Two small screws in each.",
+ fix: [
+ at("runner", [[xi0, yRail, 0]], [1, 0, 0], "IS", undefined, RUNNER),
+ at("runner", [[xo, yRail, 0]], [-1, 0, 0], "OS", undefined, RUNNER),
+ at("screw", [[xi0, yRail, zb + 90], [xi0, yRail, zf - 90]], [1, 0, 0], "IS", undefined, SMALL),
+ at("screw", [[xo, yRail, zb + 90], [xo, yRail, zf - 90]], [-1, 0, 0], "OS", undefined, SMALL),
+ ],
+ tools: ["screwdriver"],
+ wait: ["OS"],
+ },
+ {
+ title: "Screw the two hinge plates inside the outer side",
+ detail: "Near its front edge, the marked side up. Two screws in each.",
+ fix: [
+ at("plate", [[xo, 120, zf - 40], [xo, 460, zf - 40]], [-1, 0, 0], "OS", undefined, { len: 12, dia: 36, name: "Mounting plate" }),
+ at("screw", [[xo, 104, zf - 40], [xo, 136, zf - 40], [xo, 444, zf - 40], [xo, 476, zf - 40]], [-1, 0, 0], "OS", undefined, { len: 14, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw cam bolts in for the cupboard back",
+ detail: "Two into the inner side and two into the outer side, near their back edges.",
+ fix: [
+ at("camScrew", [[xi0, 150, zb + 9], [xi0, 440, zb + 9]], [1, 0, 0], "IS", undefined, CAM_BOLT),
+ at("camScrew", [[xo, 150, zb + 9], [xo, 440, zb + 9]], [-1, 0, 0], "OS", undefined, CAM_BOLT),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Push the cupboard back onto the inner side", detail: "Raw edge down. The bolts go into the holes in its end.", add: ["CB"] },
+ {
+ title: "Turn its two cam locks",
+ fix: [at("cam", [[xi0 - 34, 150, zb + 18], [xi0 - 34, 440, zb + 18]], [0, 0, -1], "CB", undefined, CAM)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap four dowels into the cupboard bottom and fit it",
+ detail: "Two in each end, raw edge to the back. Push one end onto the inner side.",
+ add: ["CF"],
+ fix: [at("dowel", [[xi0, yB + 9, -120], [xi0, yB + 9, 120]], [-1, 0, 0], "CF", "IS", DOWEL), at("dowel", [[xo, yB + 9, -120], [xo, yB + 9, 120]], [1, 0, 0], "CF", "OS", DOWEL)],
+ tools: ["hammer"],
+ },
+ { title: "Fit the outer side", detail: "Onto the dowels of the bottom and the bolts of the back.", add: ["OS"] },
+ {
+ title: "Turn the two cam locks at the outer side",
+ fix: [at("cam", [[xo + 34, 150, zb + 18], [xo + 34, 440, zb + 18]], [0, 0, -1], "CB", undefined, CAM)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap six dowels into the top edges",
+ detail: "Two in each side and two in the drawer wall.",
+ fix: [-W / 2 + 9, xi0 + 9, W / 2 - 9].map((x) => at("dowel", [[x, yT, -150], [x, yT, 150]], [0, -1, 0], undefined, "TOP", DOWEL)),
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the leg frame under the drawer wall",
+ detail: "Three long screws up through the frame's top bar into the wall. Fit the steel strip onto the Allen key for more grip.",
+ add: ["LF"],
+ from: { LF: [0, -250, 0] },
+ fix: [at("screw", [[lx, lh - 25, -150], [lx, lh - 25, 0], [lx, lh - 25, 150]], [0, 1, 0], "LF", "DW", LONG)],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw six cam bolts into the underside of the top",
+ detail: "Lay the top face down on a rug, then screw the bolts into the marked holes.",
+ add: ["TOP"],
+ fix: [at("camScrew", [-W / 2 + 9, xi0 + 9, W / 2 - 9].flatMap((x) => [[x, yT, -60], [x, yT, 60]] as Vec3[]), [0, 1, 0], "TOP", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ pose: "-y",
+ warnings: ["floor"],
+ from: { TOP: [0, -400, 0] },
+ },
+ { title: "Turn the frame upside down onto the top", detail: "Lower it so every dowel and bolt finds its hole, the drawer wall at the end with the cable hole.", people: 2, warnings: ["two"] },
+ {
+ title: "Lock the top on with six cam locks",
+ detail: "Two in each side and two in the drawer wall, near the top edge.",
+ fix: [
+ at("cam", [[xo, yT - 34, -60], [xo, yT - 34, 60]], [-1, 0, 0], "OS", undefined, CAM),
+ at("cam", [[xi0, yT - 34, -60], [xi0, yT - 34, 60]], [1, 0, 0], "IS", undefined, CAM),
+ at("cam", [[xw, yT - 34, -60], [xw, yT - 34, 60]], [1, 0, 0], "DW", undefined, CAM),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Push the four glides into the cupboard sides",
+ detail: "Into the pairs of holes in the bottom edges, front and back.",
+ fix: [at("glide", [-W / 2 + 9, xi0 + 9].flatMap((x) => [[x, 0, -200], [x, 0, 200]] as Vec3[]), [0, 1, 0], undefined, undefined, GLIDE2)],
+ },
+ {
+ title: "Stick the two pads under the leg frame",
+ detail: "Use the hexagonal pads, not the round ones.",
+ fix: [at("glide", [[lx, 0, -lz / 2 + 12.5], [lx, 0, lz / 2 - 12.5]], [0, 1, 0], "LF", undefined, HEX)],
+ },
+ { title: "Stand the desk up and slide the drawers in", detail: "Rest each drawer's runners on the outer ones, tilted down at the front, and push it in until it drops into place.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Screw the two hinges onto the door",
+ detail: "Lay it face down. Two small screws in each hinge.",
+ wait: ["DR"],
+ fix: [
+ at("hinge", [[xo + 25, 120, zf - 18], [xo + 25, 460, zf - 18]], [0, 0, 1], "DR", undefined, { len: 50, dia: 35 }),
+ at("screw", [[xo + 25, 98, zf - 18], [xo + 25, 142, zf - 18], [xo + 25, 438, zf - 18], [xo + 25, 482, zf - 18]], [0, 0, 1], "DR", undefined, SMALL),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Hang the door", detail: "Slide each hinge onto its plate until it clicks, then tighten the screw. The hinge screws line the door up.", add: ["DR"], from: { DR: [0, 0, 350] }, tools: ["screwdriver"] },
+ {
+ title: "Push in eight shelf pins and lay the two shelves on them",
+ detail: "At the heights you want, level on both sides.",
+ add: ["SH1", "SH2"],
+ fix: [200, 360].flatMap((y) => [at("pin", [[xo, y - 4, zb + 60], [xo, y - 4, zf - 70]], [-1, 0, 0], "OS", undefined), at("pin", [[xi0, y - 4, zb + 60], [xi0, y - 4, zf - 70]], [1, 0, 0], "IS", undefined)]),
+ },
+ {
+ title: "Stick the two door bumpers on",
+ detail: "On the front edge of the inner side, where the door closes.",
+ fix: [at("glide", [[xi0 + 9, 120, zf], [xi0 + 9, 460, zf]], [0, 0, -1], "IS", undefined, { len: 2, dia: 10, name: "Bumper" })],
+ },
+ {
+ title: "Push in the cable outlet and stick on the felt pads",
+ detail: "The outlet goes in the hole at the back of the top. The pads go on the back of the drawer fronts, so they close softly.",
+ fix: [
+ at("cap", [[W / 2 - 250, H, zb + 90]], [0, -1, 0], "TOP", undefined, { len: 15, dia: 60, name: "Cable outlet" }),
+ at("glide", dr.flatMap((d) => [[d.a + 20, yS + 40, d.dz1], [d.b - 20, yS + 40, d.dz1]] as Vec3[]), [0, 0, 1], undefined, undefined, { len: 2, dia: 10, name: "Felt pad" }),
+ ],
+ },
+ ];
+ return finish({ parts, steps });
+}
+
+/* ---------- corner workstation: a corner desk built on its top, then the add-on unit on it ---------- */
+
+/**
+ * IKEA's manual for the corner workstation, in two packages. The desk: a rail (bottom board, middle board and top
+ * strip doweled together) locked to the side panel, a long board locked to the end panel, both laid on the face-down
+ * top and cam-locked, the corner leg and the leg frame screwed on, glides and pads, stood up. The add-on unit: a
+ * corner post, a top of three pieces on two inner uprights, a column at each end with its own top and outer upright,
+ * a flap compartment and shelves on the left, shelves on the right, and two back panels screwed on from behind.
+ */
+function cornerWorkstation(): CustomParams {
+ const yT = 725, H = 750, top = 1420;
+ const t = 18;
+ // the desk: the corner at the back left, one wing along the back wall to the side panel, one along the left wall
+ // to the end panel over the leg frame
+ const arc: [number, number][] = Array.from({ length: 13 }, (_, i) => {
+ const a = -Math.PI / 2 - (i / 12) * (Math.PI / 2);
+ return [350 + 350 * Math.cos(a), 350 + 350 * Math.sin(a)];
+ });
+ const lh = 585, lw = 450;
+ const parts: CustomPart[] = [
+ P("BS", "Rail bottom board", -51, 482, lh, lh + t, -110, -10),
+ P("BW", "Rail middle board", -51, 482, lh + t, yT - t, -69, -51),
+ P("BT", "Rail top strip", -51, 482, yT - t, yT, -110, -10),
+ P("SP", "Side panel", 482, 500, 0, yT, -500, 0),
+ P("EP", "End panel", -500, 0, lh, yT, 482, 500),
+ P("LB", "Long board", -69, -51, lh, yT, -110, 482),
+ {
+ id: "TOP",
+ name: "Desk top",
+ size: [1000, 25, 1000],
+ pos: [0, yT + 12.5, 0],
+ pieces: [{ shape: "slab", size: [1000, 25, 1000], pos: [0, 0, 0], outline: [[-500, -500], [500, -500], [500, 0], ...arc, [0, 500], [-500, 500]] }],
+ },
+ P("PO", "Corner leg", -51, -1, 0, yT, -10, 40),
+ {
+ id: "LF",
+ name: "Leg frame",
+ size: [lw, lh, 25],
+ pos: [-250, lh / 2, 487.5],
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [25, lh, 25], pos: [-lw / 2 + 12.5, 0, 0] },
+ { shape: "box", size: [25, lh, 25], pos: [lw / 2 - 12.5, 0, 0] },
+ { shape: "box", size: [lw, 25, 25], pos: [0, -lh / 2 + 12.5, 0] },
+ { shape: "box", size: [lw, 25, 25], pos: [0, lh / 2 - 12.5, 0] },
+ ],
+ },
+ ];
+ // the add-on unit, 200 deep along both walls: middle top over the corner, a column at each end
+ const yU = 1402, yC = 1384; // under the middle top; under the column tops
+ parts.push(
+ P("HP", "Post", -260, -210, H, yU, -260, -210),
+ {
+ id: "TC",
+ name: "Corner top",
+ size: [400, t, 400],
+ pos: [-300, yU + t / 2, -300],
+ pieces: [{ shape: "slab", size: [400, t, 400], pos: [0, 0, 0], outline: [[-200, -200], [200, -200], [200, 0], [0, 200], [-200, 200]] }],
+ },
+ P("TB", "Top piece", -100, 232, yU, top, -500, -300),
+ P("TA", "Top piece", -500, -300, yU, top, -100, 232),
+ P("RI", "Inner upright", 214, 232, H, yU, -500, -300),
+ P("LI", "Inner upright", -500, -300, H, yU, 214, 232),
+ P("CTL", "Column top", -500, -300, yC, yU, 232, 500),
+ P("TR", "Tray", -500, -450, H, H + 50, 232, 482),
+ P("LO", "Outer upright", -500, -300, H, yC, 482, 500),
+ P("CTR", "Column top", 232, 500, yC, yU, -500, -300),
+ P("RO", "Outer upright", 482, 500, H, yC, -500, -300),
+ P("RS1", "Shelf", 232, 482, 960, 978, -500, -303),
+ P("RS2", "Shelf", 232, 482, 1160, 1178, -500, -303),
+ P("FB", "Flap bottom", -440, -302, 760, 778, 234, 480),
+ P("FF", "Flap front", -320, -302, 778, 960, 234, 480),
+ P("LS1", "Shelf", -500, -303, 1010, 1028, 232, 482),
+ P("LS2", "Shelf", -500, -303, 1190, 1208, 232, 482),
+ P("BKL", "Back panel", -503, -500, yT, top, -503, 500, "fiber"),
+ P("BKB", "Back panel", -500, 500, yT, top, -503, -500, "fiber"),
+ );
+
+ const LONG7 = { len: 60, dia: 6, name: "Long screw" };
+ const HW105 = { len: 12, dia: 4 }; // the hutch's small screws
+ const TINY = { len: 16, dia: 3.5 }; // back panel screws
+ const steps: CustomStep[] = [
+ {
+ title: "Tap three dowels into the rail bottom board and stand the middle board on it",
+ detail: "Start with the first package. Lay the boards on a rug; the middle board stands on the dowels along the centre line.",
+ add: ["BS", "BW"],
+ fix: [at("dowel", [40, 215, 390].map((x): Vec3 => [x, lh + t, -60]), [0, -1, 0], "BS", "BW", DOWEL)],
+ tools: ["hammer"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap three dowels into the middle board and press the top strip on",
+ add: ["BT"],
+ fix: [at("dowel", [40, 215, 390].map((x): Vec3 => [x, yT - t, -60]), [0, -1, 0], "BW", "BT", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw four cam bolts into the side panel",
+ detail: "Into the holes near its top edge, on the inside.",
+ fix: [at("camScrew", [[482, lh + 9, -90], [482, 630, -60], [482, 680, -60], [482, yT - 9, -90]], [1, 0, 0], "SP", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ wait: ["SP"],
+ },
+ { title: "Slide the rail onto the side panel", detail: "The bolts go into the holes in the rail's end.", add: ["SP"] },
+ {
+ title: "Turn the four cam locks in the rail",
+ fix: [
+ at("cam", [[448, lh + t, -90]], [0, -1, 0], "BS", undefined, CAM),
+ at("cam", [[448, 630, -51], [448, 680, -51]], [0, 0, -1], "BW", undefined, CAM),
+ at("cam", [[448, yT - t, -90]], [0, 1, 0], "BT", undefined, CAM),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw three cam bolts into the end panel",
+ detail: "On its inside face, in the row of holes near one end.",
+ add: ["EP"],
+ fix: [at("camScrew", [610, 655, 700].map((y): Vec3 => [-60, y, 482]), [0, 0, 1], "EP", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ },
+ { title: "Push the long board onto the end panel", detail: "The bolts go into the holes in the board's end.", add: ["LB"] },
+ {
+ title: "Turn the three cam locks in the long board",
+ fix: [at("cam", [610, 655, 700].map((y): Vec3 => [-51, y, 448]), [-1, 0, 0], "LB", undefined, CAM)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap four dowels into the top edges",
+ detail: "Two in the end panel, two in the side panel.",
+ fix: [at("dowel", [[-400, yT, 491], [-150, yT, 491]], [0, -1, 0], "EP", "TOP", DOWEL), at("dowel", [[491, yT, -400], [491, yT, -150]], [0, -1, 0], "SP", "TOP", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw six cam bolts into the underside of the top",
+ detail: "Lay the top face down on a rug.",
+ add: ["TOP"],
+ fix: [at("camScrew", [[491, yT, -300], [491, yT, -60], [-450, yT, 491], [-250, yT, 491], [-60, yT, 100], [-60, yT, 350]], [0, 1, 0], "TOP", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ pose: "-y",
+ warnings: ["floor"],
+ from: { TOP: [0, -400, 0] },
+ },
+ { title: "Turn the end panel and long board over onto the top", detail: "Lower them so the dowels and bolts find their holes, the end panel at the end of the left wing." },
+ {
+ title: "Screw a cam bolt into the long board",
+ detail: "Into the hole in its side where the rail meets it.",
+ fix: [at("camScrew", [[-51, 655, -60]], [-1, 0, 0], "LB", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ },
+ { title: "Turn the side panel and rail over onto the top", detail: "The rail's end goes onto the bolt in the long board, the side panel onto its dowels and bolts." },
+ {
+ title: "Lock the side panel and end panel with four cam locks",
+ fix: [at("cam", [[482, yT - 34, -300], [482, yT - 34, -60]], [1, 0, 0], "SP", undefined, CAM), at("cam", [[-450, yT - 34, 482], [-250, yT - 34, 482]], [0, 0, 1], "EP", undefined, CAM)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Turn the three cam locks in the long board and the rail",
+ fix: [at("cam", [[-51, yT - 34, 100], [-51, yT - 34, 350]], [-1, 0, 0], "LB", undefined, CAM), at("cam", [[-17, 655, -51]], [0, 0, -1], "BW", undefined, CAM)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap two dowels into the corner leg and stand it on the top",
+ detail: "In the corner between the long board and the rail.",
+ add: ["PO"],
+ fix: [at("dowel", [[-36, yT, 15], [-16, yT, 15]], [0, -1, 0], "PO", "TOP", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the long board to the leg and the rail",
+ detail: "Four long screws through the long board. Fit the steel strip onto the Allen key for more grip.",
+ fix: [at("screw", [[-69, 620, 15], [-69, 690, 15], [-69, lh + 9, -90], [-69, yT - 9, -90]], [1, 0, 0], "LB", undefined, LONG7)],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the leg frame onto the end panel",
+ detail: "Three long screws through the frame's top bar into the edge of the end panel.",
+ add: ["LF"],
+ fix: [at("screw", [-400, -250, -100].map((x): Vec3 => [x, lh - 25, 487.5]), [0, 1, 0], "LF", "EP", LONG7)],
+ tools: ["allen"],
+ },
+ {
+ title: "Push the three glides in",
+ detail: "Two into the bottom edge of the side panel, one into the end of the leg.",
+ fix: [at("glide", [[491, 0, -450], [491, 0, -50], [-26, 0, 15]], [0, 1, 0], undefined, undefined, GLIDE2)],
+ },
+ { title: "Stick the two pads under the leg frame", detail: "Use the hexagonal pads, not the round ones.", fix: [at("glide", [[-475 + 12.5, 0, 487.5], [-25 - 12.5, 0, 487.5]], [0, 1, 0], "LF", undefined, HEX)] },
+ {
+ title: "Cover the spare holes in the side panel",
+ detail: "Six round stickers over the holes that are left on its inside.",
+ fix: [at("cap", [-400, -250, -100].flatMap((z): Vec3[] => [[482, 300, z], [482, 340, z]]), [1, 0, 0], "SP", undefined, { len: 1, dia: 14, name: "Cover sticker" })],
+ },
+ {
+ title: "Stand the desk up and push in the cable outlet",
+ fix: [at("cap", [[-150, H, -150]], [0, -1, 0], "TOP", undefined, { len: 15, dia: 60, name: "Cable outlet" })],
+ pose: "+y",
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Stand the post in the corner of the desk",
+ detail: "Now the second package. Two dowels into the desk top, two into the top of the post.",
+ add: ["HP"],
+ fix: [at("dowel", [[-245, H, -235], [-225, H, -235]], [0, -1, 0], "TOP", "HP", DOWEL), at("dowel", [[-245, yU, -235], [-225, yU, -235]], [0, -1, 0], "HP", "TC", DOWEL)],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw four cam bolts into the desk top",
+ detail: "Where the four uprights will stand.",
+ fix: [at("camScrew", [[-400, H, 491], [-400, H, 223], [223, H, -400], [491, H, -400]], [0, -1, 0], "TOP", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw a cam bolt into each straight top piece",
+ detail: "Underneath, near the end away from the corner.",
+ fix: [at("camScrew", [[-400, yU, 223]], [0, 1, 0], "TA", undefined, CAM_BOLT), at("camScrew", [[223, yU, -400]], [0, 1, 0], "TB", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ wait: ["TA", "TB"],
+ },
+ {
+ title: "Join the three top pieces",
+ detail: "Two dowels in each end of the corner piece, then press the straight pieces on.",
+ fix: [at("dowel", [[-100, yU + 9, -460], [-100, yU + 9, -340]], [-1, 0, 0], "TC", "TB", DOWEL), at("dowel", [[-460, yU + 9, -100], [-340, yU + 9, -100]], [0, 0, -1], "TC", "TA", DOWEL)],
+ tools: ["hammer"],
+ wait: ["TC"],
+ },
+ {
+ title: "Lock the right inner upright under the top",
+ detail: "Its top edge onto the bolt under the straight piece, then turn the cam lock.",
+ fix: [at("cam", [[214, yU - 34, -400]], [1, 0, 0], "RI", undefined, CAM)],
+ tools: ["screwdriver"],
+ wait: ["RI"],
+ },
+ {
+ title: "Lower the top onto the post",
+ detail: "The upright goes onto its bolt in the desk top at the same time.",
+ add: ["TC", "TA", "TB", "RI"],
+ from: { TC: [0, 300, 0], TA: [0, 300, 0], TB: [0, 300, 0], RI: [0, 300, 0] },
+ people: 2,
+ warnings: ["two"],
+ },
+ { title: "Turn the cam lock at the foot of the upright", fix: [at("cam", [[214, H + 34, -400]], [1, 0, 0], "RI", undefined, CAM)], tools: ["screwdriver"] },
+ {
+ title: "Fit the left inner upright",
+ detail: "Tilt it in: its top under the end of the left top piece, then swing the foot onto its bolt.",
+ add: ["LI"],
+ from: { LI: [0, 0, 250] },
+ },
+ { title: "Turn the two cam locks in the upright", detail: "One at the top, one at the foot.", fix: [at("cam", [[-400, yU - 34, 214], [-400, H + 34, 214]], [0, 0, 1], "LI", undefined, CAM)], tools: ["screwdriver"] },
+ {
+ title: "Screw two cam bolts in for the left column top",
+ detail: "One into the upright's outer face near the top, one under the column top near its outer end.",
+ fix: [at("camScrew", [[-400, yC + 9, 232]], [0, 0, -1], "LI", undefined, CAM_BOLT), at("camScrew", [[-400, yC, 491]], [0, 1, 0], "CTL", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ wait: ["CTL"],
+ },
+ { title: "Tap three dowels into the end of the column top", fix: [at("dowel", [-470, -440, -330].map((x): Vec3 => [x, yC + 9, 232]), [0, 0, 1], "CTL", "LI", DOWEL)], tools: ["hammer"] },
+ { title: "Slide the column top and the tray in", detail: "The column top onto the upright's dowels and bolt, the tray along the back on the desk top.", add: ["CTL", "TR"] },
+ { title: "Turn the cam lock in the column top", fix: [at("cam", [[-400, yU, 266]], [0, -1, 0], "CTL", undefined, CAM)], tools: ["screwdriver"] },
+ { title: "Fit the left outer upright", detail: "Tilt its top under the column top's bolt, then swing the foot onto its bolt and the tray's end.", add: ["LO"], from: { LO: [0, 0, 250] } },
+ { title: "Turn its two cam locks", fix: [at("cam", [[-400, yC - 34, 482], [-400, H + 34, 482]], [0, 0, 1], "LO", undefined, CAM)], tools: ["screwdriver"] },
+ {
+ title: "Screw two cam bolts in for the right column top",
+ detail: "The same way: one into the upright, one under the column top.",
+ fix: [at("camScrew", [[232, yC + 9, -400]], [-1, 0, 0], "RI", undefined, CAM_BOLT), at("camScrew", [[491, yC, -400]], [0, 1, 0], "CTR", undefined, CAM_BOLT)],
+ tools: ["screwdriver"],
+ wait: ["CTR"],
+ },
+ { title: "Tap three dowels into its end", fix: [at("dowel", [-470, -440, -330].map((z): Vec3 => [232, yC + 9, z]), [1, 0, 0], "CTR", "RI", DOWEL)], tools: ["hammer"] },
+ { title: "Slide the right column top in", add: ["CTR"] },
+ { title: "Turn the cam lock in the column top", fix: [at("cam", [[266, yU, -400]], [0, -1, 0], "CTR", undefined, CAM)], tools: ["screwdriver"] },
+ { title: "Fit the right outer upright", detail: "Tilt it in under the column top, then onto the bolt in the desk top.", add: ["RO"], from: { RO: [250, 0, 0] } },
+ { title: "Turn its two cam locks", fix: [at("cam", [[482, yC - 34, -400], [482, H + 34, -400]], [1, 0, 0], "RO", undefined, CAM)], tools: ["screwdriver"] },
+ {
+ title: "Push in eight shelf pins and lay the right shelves on them",
+ add: ["RS1", "RS2"],
+ fix: [960, 1160].flatMap((y) => [at("pin", [[232, y - 4, -460], [232, y - 4, -340]], [-1, 0, 0], "RI", undefined), at("pin", [[482, y - 4, -460], [482, y - 4, -340]], [1, 0, 0], "RO", undefined)]),
+ },
+ {
+ title: "Screw a flap fitting onto the flap bottom",
+ detail: "Three small screws through its foot.",
+ wait: ["FB", "FF"],
+ fix: [at("hinge", [[-380, 769, 234]], [0, 0, 1], "FB", undefined, { len: 160, dia: 40, name: "Flap fitting" }), at("screw", [-420, -380, -340].map((x): Vec3 => [x, 778, 250]), [0, -1, 0], "FB", undefined, HW105)],
+ tools: ["screwdriver"],
+ },
+ { title: "Slide on the flap front and the second fitting", fix: [at("hinge", [[-380, 769, 480]], [0, 0, -1], "FB", undefined, { len: 160, dia: 40, name: "Flap fitting" })] },
+ { title: "Screw the second fitting on", detail: "Three small screws again.", fix: [at("screw", [-420, -380, -340].map((x): Vec3 => [x, 778, 464]), [0, -1, 0], "FB", undefined, HW105)], tools: ["screwdriver"] },
+ { title: "Screw the fittings to the flap front", detail: "One screw through each fitting into the end of the front.", fix: [at("screw", [[-311, 900, 234]], [0, 0, 1], "FF", undefined, TINY), at("screw", [[-311, 900, 480]], [0, 0, -1], "FF", undefined, TINY)], tools: ["screwdriver"] },
+ {
+ title: "Screw the pivot bushings into the left column",
+ detail: "One on each upright, low down near the front.",
+ fix: [
+ at("spacer", [[-330, 900, 232]], [0, 0, -1], "LI", undefined, { len: 6, dia: 14, name: "Bushing" }),
+ at("spacer", [[-330, 900, 482]], [0, 0, 1], "LO", undefined, { len: 6, dia: 14, name: "Bushing" }),
+ at("screw", [[-330, 900, 232]], [0, 0, -1], "LI", undefined, HW105),
+ at("screw", [[-330, 900, 482]], [0, 0, 1], "LO", undefined, HW105),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the flap compartment into the column", detail: "Open the fittings outwards so they pass the bushings, then push it back to the tray.", add: ["FB", "FF"], from: { FB: [300, 0, 0], FF: [300, 0, 0] } },
+ {
+ title: "Screw the fittings to the uprights",
+ detail: "One screw at the back of each fitting.",
+ fix: [at("screw", [[-420, 790, 232]], [0, 0, -1], "LI", undefined, TINY), at("screw", [[-420, 790, 482]], [0, 0, 1], "LO", undefined, TINY)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the two stop screws and close the flap",
+ fix: [at("stud", [[-330, 960, 232]], [0, 0, -1], "LI", undefined, { len: 14, dia: 8, name: "Stop screw" }), at("stud", [[-330, 960, 482]], [0, 0, 1], "LO", undefined, { len: 14, dia: 8, name: "Stop screw" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Push in eight shelf pins and lay the left shelves on them",
+ add: ["LS1", "LS2"],
+ fix: [1010, 1190].flatMap((y) => [at("pin", [[-460, y - 4, 232], [-340, y - 4, 232]], [0, 0, -1], "LI", undefined), at("pin", [[-460, y - 4, 482], [-340, y - 4, 482]], [0, 0, 1], "LO", undefined)]),
+ },
+ { title: "Fit the left back panel", detail: "Magnetic side to the front, behind the left column and the corner.", add: ["BKL"], from: { BKL: [-300, 0, 0] } },
+ {
+ title: "Screw it on from behind",
+ detail: "Eleven screws, into the desk top, the uprights, the tops and the post side of the corner.",
+ fix: [at("screw", ([[737, 400], [737, 100], [737, -300], [900, 491], [1250, 491], [900, 223], [1250, 223], [yC + 9, 360], [yU + 9, 100], [yU + 9, -150], [yU + 9, -400]] as [number, number][]).map(([y, z]): Vec3 => [-503, y, z]), [1, 0, 0], "BKL", undefined, TINY)],
+ tools: ["screwdriver"],
+ },
+ { title: "Fit the right back panel", detail: "Magnetic side to the front, behind the right column and the corner.", add: ["BKB"], from: { BKB: [0, 0, -300] } },
+ {
+ title: "Screw it on from behind",
+ detail: "Eleven screws again.",
+ fix: [at("screw", ([[737, 400], [737, 100], [737, -300], [900, 491], [1250, 491], [900, 223], [1250, 223], [yC + 9, 360], [yU + 9, 100], [yU + 9, -150], [yU + 9, -400]] as [number, number][]).map(([y, x]): Vec3 => [x, y, -503]), [0, 0, 1], "BKB", undefined, TINY)],
+ tools: ["screwdriver"],
+ },
+ ];
+ return finish({ parts, steps });
+}
+
/* ---------- drawer unit with drop-file storage ---------- */
const RAIL_SCREW = { len: 10, dia: 4, name: "Runner screw" };
@@ -288,7 +908,8 @@ function drawerUnit(s: ProductSpec): CustomParams {
detail: "The outer parts, low down on each side. Three small screws in each, sliding the runner to reach them.",
fix: [
...[-1, 1].map((sx) => at("runner", [[inner(sx), fileRail, 0]], [-sx, 0, 0], sideOf(sx), undefined, { len: 420, dia: 30, name: "Drop-file runner" })),
- ...[-1, 1].map((sx) => at("screw", [-150, 0, 150].map((z): Vec3 => [inner(sx), fileRail, z]), [-sx, 0, 0], sideOf(sx), undefined, { len: 12, dia: 4 })),
+ // the screws go out through the runner into the side
+ ...[-1, 1].map((sx) => at("screw", [-150, 40, 150].map((z): Vec3 => [inner(sx), fileRail, z]), [sx, 0, 0], sideOf(sx), undefined, { len: 12, dia: 4 })),
],
tools: ["screwdriver"],
},
@@ -297,7 +918,7 @@ function drawerUnit(s: ProductSpec): CustomParams {
detail: "Three on each side, wheel at the front. Two runner screws in each.",
fix: [
...[-1, 1].map((sx) => at("runner", small.map((i): Vec3 => [inner(sx), box[i].rail, 0]), [-sx, 0, 0], sideOf(sx), undefined, RUNNER)),
- ...[-1, 1].map((sx) => at("screw", small.flatMap((i): Vec3[] => [[inner(sx), box[i].rail, -150], [inner(sx), box[i].rail, 170]]), [-sx, 0, 0], sideOf(sx), undefined, RAIL_SCREW)),
+ ...[-1, 1].map((sx) => at("screw", small.flatMap((i): Vec3[] => [[inner(sx), box[i].rail, -150], [inner(sx), box[i].rail, 170]]), [sx, 0, 0], sideOf(sx), undefined, RAIL_SCREW)),
],
tools: ["screwdriver"],
},
@@ -394,7 +1015,7 @@ function drawerUnit(s: ProductSpec): CustomParams {
tools: ["hammer"],
},
{ title: "Clip the inner runners onto the drawers", detail: "One along the bottom edge of each side, wheel at the back.", fix: each(small, (i) => [-1, 1].map((sx) => at("runner", [[sx < 0 ? s0 : s1, box[i].rail, 0]], [sx, 0, 0], sx < 0 ? `DL${i}` : `DR${i}`, undefined, RUNNER))) },
- { title: "Screw the runners to the drawer sides", detail: "Two runner screws in each.", fix: each(small, (i) => [-1, 1].map((sx) => at("screw", [[sx < 0 ? s0 : s1, box[i].rail, -120], [sx < 0 ? s0 : s1, box[i].rail, 150]], [sx, 0, 0], sx < 0 ? `DL${i}` : `DR${i}`, undefined, RAIL_SCREW))), tools: ["screwdriver"] },
+ { title: "Screw the runners to the drawer sides", detail: "Two runner screws in each.", fix: each(small, (i) => [-1, 1].map((sx) => at("screw", [[sx < 0 ? s0 : s1, box[i].rail, -120], [sx < 0 ? s0 : s1, box[i].rail, 150]], [-sx, 0, 0], sx < 0 ? `DL${i}` : `DR${i}`, undefined, RAIL_SCREW))), tools: ["screwdriver"] },
{ title: "Slide the three drawers in", detail: "Set the drawer's runners on the ones in the unit, tilt the front down a little and push it in until it drops into place." },
{
title: "Screw four cam bolts into the file drawer front",
@@ -424,7 +1045,7 @@ function drawerUnit(s: ProductSpec): CustomParams {
fix: [
at("plate", [[0, 62, zf - 30]], [0, 1, 0], "DF3", undefined, { len: 50, dia: 30, name: "Castor bracket" }),
at("screw", [[-25, 62, zf - 9], [25, 62, zf - 9]], [0, 1, 0], "DF3", undefined, { len: 14, dia: 5 }),
- at("screw", [[0, 76, zf - 45]], [0, 1, 0], "DT3", undefined, { len: 16, dia: 4 }),
+ at("screw", [[0, 62, zf - 4]], [0, 1, 0], "DF3", undefined, { len: 16, dia: 4 }),
],
pose: "-y",
tools: ["screwdriver"],
@@ -435,7 +1056,7 @@ function drawerUnit(s: ProductSpec): CustomParams {
detail: "Stand it up. The inner parts along the top of the sides, three small screws in each.",
fix: [
...[-1, 1].map((sx) => at("runner", [[sx < 0 ? s0 : s1, fileRail, 0]], [sx, 0, 0], sx < 0 ? "DL3" : "DR3", undefined, { len: 420, dia: 30, name: "Drop-file runner" })),
- ...[-1, 1].map((sx) => at("screw", [-150, 0, 150].map((z): Vec3 => [sx < 0 ? s0 : s1, fileRail, z]), [sx, 0, 0], sx < 0 ? "DL3" : "DR3", undefined, { len: 12, dia: 4 })),
+ ...[-1, 1].map((sx) => at("screw", [-115, 75, 185].map((z): Vec3 => [sx < 0 ? s0 : s1, fileRail, z]), [-sx, 0, 0], sx < 0 ? "DL3" : "DR3", undefined, { len: 12, dia: 4 })),
],
pose: "+y",
tools: ["screwdriver"],
@@ -459,6 +1080,8 @@ function finish(c: CustomParams): CustomParams {
function recipe(s: ProductSpec): CustomParams | null {
const v = s.variant.toLowerCase();
if (/^desk/.test(v) && (s.size.w < 80 || s.size.w > 130)) return desk(s);
+ if (/^desk/.test(v)) return desk105(s);
+ if (/corner workstation/.test(v)) return cornerWorkstation();
if (/drawer unit with drop-file/.test(v)) return drawerUnit(s);
return null;
}
diff --git a/src/lib/plan/families/milsbo.ts b/src/lib/plan/families/milsbo.ts
index 0ce8375..c59477c 100644
--- a/src/lib/plan/families/milsbo.ts
+++ b/src/lib/plan/families/milsbo.ts
@@ -2,14 +2,18 @@ import type { Family } from "./family";
import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3 } from "../../types";
/**
- * MILSBO, read from its two manuals (73x175 and 101x100). A steel frame on four cast legs: levelling feet into the
- * legs, rails bolted between them into a base, the bottom plate laid in, then the corner posts bolted on (the wide
- * one adds a middle post at the back) and the top frame bolted over them. Two people lower each glass pane into the
- * frame and it is held with plastic clips; the top goes on, the doors drop onto hinge pins, the handles and lock are
- * screwed on and two brackets hold it to the wall. Glass shelves rest on clip-on supports.
+ * MILSBO, read from its two manuals (73x175 and 101x100). A steel cabinet on four cast legs: levelling feet into the
+ * legs, rails pushed into them and bolted, a base frame on top, then four corner posts bolted down through their feet
+ * and a middle post at the back. The tall one gets its top before the glass: two people push each pane up into the
+ * top channel and drop it into the bottom one. The low one has its panes lowered in from above and the top laid on
+ * after. Plastic glass clips screwed to the posts hold the panes and carry the glass shelves. The doors drop onto
+ * bushings in the base and are held by pins through the top; handles, then a wall bracket or strap.
+ * The 101x186 size doesn't exist: it is redirected to 101x100.
*/
const P = 24; // posts
+const FR = 20; // base frame height
+const TOP = 24; // top thickness
function doorPart(id: string, w: number, h: number, pos: Vec3): CustomPart {
const f = 26;
@@ -27,117 +31,199 @@ function recipe(s: ProductSpec): CustomParams {
const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
const tall = H > 1400;
const legH = tall ? 150 : 220;
- const railH = 40;
- const yB = legH; // top of the base
- const yTop = H - 22; // underside of the top
+ const railH = 40, yR = legH - railH / 2;
+ const yB = legH + FR; // top of the base frame
+ const postH = H - TOP - yB;
const xs = W / 2 - P / 2, zs = D / 2 - P / 2;
+ const gy = yB + postH / 2, gh = postH;
const parts: CustomPart[] = [];
const metal = (id: string, name: string, size: Vec3, pos: Vec3, o: Partial<CustomPart> = {}) => parts.push({ id, name, size, pos, material: "metal", ...o });
const corners: [number, number][] = [[-1, -1], [1, -1], [-1, 1], [1, 1]];
corners.forEach(([sx, sz], i) => metal(`L${i}`, "Leg", [36, legH, 36], [sx * (W / 2 - 18), legH / 2, sz * (D / 2 - 18)]));
- metal("rF", "Long rail", [W - 72, railH, 16], [0, yB - railH / 2, D / 2 - 12]);
- metal("rB", "Long rail", [W - 72, railH, 16], [0, yB - railH / 2, -D / 2 + 12]);
- metal("rL", "Short rail", [16, railH, D - 72], [-W / 2 + 12, yB - railH / 2, 0]);
- metal("rR", "Short rail", [16, railH, D - 72], [W / 2 - 12, yB - railH / 2, 0]);
- metal("bot", "Bottom plate", [W - 20, 4, D - 20], [0, yB + 2, 0]);
- const postH = yTop - yB - 4 - P;
- corners.forEach(([sx, sz], i) => metal(`P${i}`, "Post", [P, postH, P], [sx * xs, yB + 4 + postH / 2, sz * zs]));
- const mid = !tall; // the wide cabinet has a middle post at the back, between the two back panes
- if (mid) metal("Pm", "Middle post", [P, postH, P], [0, yB + 4 + postH / 2, -zs]);
- const tf: PartPiece[] = [
- { shape: "box", size: [W, P, P], pos: [0, 0, zs] },
- { shape: "box", size: [W, P, P], pos: [0, 0, -zs] },
- { shape: "box", size: [P, P, D - 2 * P], pos: [-xs, 0, 0] },
- { shape: "box", size: [P, P, D - 2 * P], pos: [xs, 0, 0] },
+ metal("rF", "Long rail", [W - 72, railH, 16], [0, yR, D / 2 - 18]);
+ metal("rB", "Long rail", [W - 72, railH, 16], [0, yR, -D / 2 + 18]);
+ metal("rL", "Short rail", [16, railH, D - 72], [-W / 2 + 18, yR, 0]);
+ metal("rR", "Short rail", [16, railH, D - 72], [W / 2 - 18, yR, 0]);
+ const frame: PartPiece[] = [
+ { shape: "box", size: [W, FR, P], pos: [0, 0, zs] },
+ { shape: "box", size: [W, FR, P], pos: [0, 0, -zs] },
+ { shape: "box", size: [P, FR, D - 2 * P], pos: [-xs, 0, 0] },
+ { shape: "box", size: [P, FR, D - 2 * P], pos: [xs, 0, 0] },
];
- metal("tf", "Top frame", [W, P, D], [0, yTop - P / 2, 0], { pieces: tf });
- metal("top", "Top", [W + 10, 22, D + 10], [0, H - 11, 0]);
- const gy = yB + 4 + postH / 2, gh = postH;
- for (const [id, sx] of [["gL", -1], ["gR", 1]] as const) parts.push({ id, name: "Glass side", size: [5, gh, D - 2 * P], pos: [sx * xs, gy, 0], material: "glass" });
- const backs = mid ? ["gB0", "gB1"] : ["gB0"];
- const bw = mid ? W / 2 - P - P / 2 : W - 2 * P;
- backs.forEach((id, i) => parts.push({ id, name: "Glass back", size: [bw, gh, 5], pos: [mid ? (i ? 1 : -1) * (P / 4 + W / 4) : 0, gy, -zs], material: "glass" }));
- const dw = W / 2 - P / 2 - 2;
- parts.push(doorPart("dL", dw, gh, [-W / 4 + P / 4, gy, D / 2 + 10]));
- parts.push(doorPart("dR", dw, gh, [W / 4 - P / 4, gy, D / 2 + 10]));
- const nShelf = tall ? 3 : 2;
- const shelfY = Array.from({ length: nShelf }, (_, i) => yB + 4 + (gh * (i + 1)) / (nShelf + 1));
- shelfY.forEach((y, i) => parts.push({ id: `sh${i}`, name: "Glass shelf", size: [W - 2 * P - 10, 6, D - 2 * P - 20], pos: [0, y, 0], material: "glass" }));
+ metal("fr", "Base frame", [W, FR, D], [0, legH + FR / 2, 0], { pieces: frame });
+ metal("bot", "Bottom plate", [W - 2 * P, 4, D - 2 * P], [0, yB - 2, 0]);
+ corners.forEach(([sx, sz], i) => metal(`P${i}`, "Post", [P, postH, P], [sx * xs, yB + postH / 2, sz * zs]));
+ // the tall one's middle post stands just inside its one back pane; the low one's sits between its two back panes
+ const mz = tall ? -zs + 11.5 : -zs;
+ const md = tall ? 16 : P;
+ metal("Pm", "Middle post", [P, postH, md], [0, yB + postH / 2, mz]);
+ metal("top", "Top", [W, TOP, D], [0, H - TOP / 2, 0]);
+ const glass = (id: string, name: string, size: Vec3, pos: Vec3) => parts.push({ id, name, size, pos, material: "glass" });
+ glass("gL", "Glass side", [5, gh, D - 2 * P], [-xs, gy, 0]);
+ glass("gR", "Glass side", [5, gh, D - 2 * P], [xs, gy, 0]);
+ if (tall) glass("gB", "Glass back", [W - 2 * P, gh, 5], [0, gy, -zs]);
+ else [-1, 1].forEach((k, i) => glass(`gB${i}`, "Glass back", [W / 2 - P - P / 2, gh, 5], [k * (P / 4 + W / 4), gy, -zs]));
+ const dw = W / 2 - 2;
+ parts.push(doorPart("dL", dw, gh, [-W / 4, gy, D / 2 + 10]));
+ parts.push(doorPart("dR", dw, gh, [W / 4, gy, D / 2 + 10]));
+ // the glass shelves rest on the glass clips
+ const clipY = tall ? [1, 2, 3].map((i) => yB + (gh * i) / 4) : [yB + gh * 0.3, yB + gh * 0.58];
+ const shelfAt = tall ? clipY : [clipY[1]];
+ shelfAt.forEach((y, i) => glass(`sh${i}`, "Glass shelf", [W - 2 * P - 10, 6, D - 2 * P - 10], [0, y + 11, 0]));
const fix = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
- const bolt = { kind: "bolt" as const, len: 12, dia: 6 };
- const legPts = corners.map(([sx, sz]) => [sx * (W / 2 - 18), 0, sz * (D / 2 - 18)] as Vec3);
- // two bolts at each leg, one into each rail end
- const railBolts: Vec3[] = corners.flatMap(([sx, sz]) => [[sx * (W / 2 - 36), yB - railH / 2, sz * (D / 2 - 12)], [sx * (W / 2 - 12), yB - railH / 2, sz * (D / 2 - 36)]] as Vec3[]);
- const postBolt = (i: number): Vec3 => [corners[i][0] * xs, yB, corners[i][1] * zs];
- const clips = (pts: Vec3[], dir: Vec3, name: string): CustomFix[] => [fix("clip", pts, dir, { name, len: 20, dia: 16 }), fix("screw", pts.map((p) => [p[0] - dir[0] * 2, p[1], p[2] - dir[2] * 2] as Vec3), dir, { len: 10, dia: 4 })];
- const sideClips = (sx: number): Vec3[] => [yB + 40, yTop - P - 40].flatMap((y) => [-1, 1].map((sz) => [sx * (xs - P / 2), y, sz * (zs - 60)] as Vec3));
- const nB = tall ? 4 : 2;
- const backB: Vec3[] = !tall ? [] : backs.flatMap((_, i) => {
- const x = mid ? (i ? 1 : -1) * (P / 4 + W / 4) : 0;
- return [yB + 40, yTop - P - 40].slice(0, nB / backs.length > 1 ? 2 : 1).flatMap((y) => (tall ? [-1, 1].map((k) => [x + k * bw * 0.3, y, -zs + P / 2] as Vec3) : [[x, y, -zs + P / 2] as Vec3]));
- });
- const backA: Vec3[] = tall ? [-1, 0, 1].map((k) => [k * bw * 0.35, yB + 4 + gh / 2, -zs + P / 2] as Vec3) : [-1, 1].map((k) => [k * 6, yB + 4 + gh / 2, -zs + P / 2] as Vec3);
- const hingeX = (sx: number) => sx * (xs - 10);
- const supports: Vec3[] = shelfY.flatMap((y) => [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (xs - P / 2), y - 5, sz * (zs - 60)] as Vec3)));
- const steps: CustomStep[] = [
- { title: "Screw the feet into the legs", detail: "Lay the four legs on a rug and turn a levelling foot into the bottom of each, by hand.", add: ["L0", "L1", "L2", "L3"], fix: [fix("foot", legPts, [0, 1, 0], { name: "Levelling foot", len: 25, dia: 22 })], warnings: ["floor"] },
- { title: "Push the rails into the legs", detail: "Two long and two short rails, each end into the slot at the top of a leg.", add: ["rF", "rB", "rL", "rR"] },
- { title: "Bolt the base together", detail: "Eight bolts with the Allen key, two at each leg.", fix: [fix("bolt", railBolts.filter((p) => Math.abs(p[2]) > D / 2 - 20), [0, 0, 0], { ...bolt }), fix("bolt", railBolts.filter((p) => Math.abs(p[2]) <= D / 2 - 20), [0, 0, 0], { ...bolt })].map((f) => ({ ...f, dir: [f.at![0][0] > 0 ? -1 : 1, 0, 0] as Vec3 })), tools: ["allen"], check: "square" },
- { title: "Lay the bottom plate in", detail: "Its corner cut-outs fit round the tops of the legs.", add: ["bot"] },
- { title: "Bolt on the back posts", detail: "Stand each post on its back corner and bolt it from underneath, two long bolts each.", add: ["P0", "P1"], fix: [fix("bolt", [0, 1].flatMap((i) => [-8, 8].map((dx) => { const p = postBolt(i); return [p[0] + dx, yB - railH, p[2]] as Vec3; })), [0, 1, 0], { len: 50, dia: 6 })], tools: ["allen"] },
- { title: "Bolt on the front posts", detail: "The same way at the front, two bolts each.", add: ["P2", "P3"], fix: [fix("bolt", [2, 3].flatMap((i) => [-8, 8].map((dx) => { const p = postBolt(i); return [p[0] + dx, yB - railH, p[2]] as Vec3; })), [0, 1, 0], tall ? { ...bolt } : { name: "Post screw", len: 16, dia: 5 })].map((f) => (tall ? f : { ...f, kind: "screw" as const })), tools: ["allen"] },
- ...(mid ? [{ title: "Fit the middle post at the back", detail: "Clip it into the bottom plate and fix it with one screw.", add: ["Pm"], fix: [fix("screw", [[0, yB, -zs]], [0, 1, 0], { len: 10, dia: 4 })], tools: ["screwdriver"] as CustomStep["tools"] }] : []),
- { title: "Bolt the top frame on together", detail: "One of you holds the posts upright while the other lowers the frame onto them. One bolt into each post.", add: ["tf"], fix: [fix("bolt", corners.map(([sx, sz]) => [sx * xs, yTop, sz * zs] as Vec3), [0, -1, 0], { ...bolt })], tools: ["allen"], people: 2, warnings: ["two"] },
- { title: "Lower a glass side in together", detail: "Tilt it in from the front and set it down into the channel in the bottom. Never stand glass on a hard floor.", add: ["gL"], people: 2, warnings: ["two", "hand"], from: { gL: [0, 0, 420] } },
- { title: "Clip the glass side in", detail: "Four clips, each screwed to the frame.", fix: clips(sideClips(-1), [-1, 0, 0], "Glass clip"), tools: ["screwdriver"] },
- { title: "Lower in the other glass side together", add: ["gR"], people: 2, warnings: ["two", "hand"], from: { gR: [0, 0, 420] } },
- { title: "Clip it in", detail: "Four more clips.", fix: clips(sideClips(1), [1, 0, 0], "Glass clip"), tools: ["screwdriver"] },
- { title: mid ? "Lower the back panes in together" : "Lower the back pane in together", detail: "From the front, into the back channel.", add: backs, people: 2, warnings: ["two", "hand"], from: Object.fromEntries(backs.map((id) => [id, [0, 0, 420] as Vec3])) },
- { title: mid ? "Clip the back panes in" : "Clip the back pane in", detail: "The wide clips at the top and bottom, the narrow ones up the middle.", fix: [...(backB.length ? clips(backB, [0, 0, -1], "Glass clip") : []), ...clips(backA, [0, 0, -1], "Narrow glass clip")], tools: ["screwdriver"] },
- { title: "Screw the top on", detail: "Lay it on the top frame and screw it from underneath.", add: ["top"], fix: [fix("screw", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (xs - 40), yTop - P, sz * (zs - 40)] as Vec3)), [0, 1, 0], { len: 10, dia: 4, on: "tf" })], tools: ["screwdriver"] },
- {
- title: "Fit the hinge pins",
- detail: "A bushing into the bottom plate and a pin through the top frame at each front corner.",
- fix: [fix("clip", [-1, 1].map((sx) => [hingeX(sx), yB + 4, D / 2 - 6] as Vec3), [0, -1, 0], { name: "Hinge bushing", len: 10, dia: 12 }), fix("pin", [-1, 1].map((sx) => [hingeX(sx), yTop - P, D / 2 - 6] as Vec3), [0, -1, 0], { name: "Hinge pin", len: 40, dia: 8 })],
- },
- { title: "Hang the doors together", detail: "Lift each door onto its bottom bushing and swing the top under the pin, then push the pin down into it.", add: ["dL", "dR"], people: 2, warnings: ["two", "hand"], from: { dL: [0, 0, 400], dR: [0, 0, 400] } },
- {
- title: "Screw on the handles and the lock",
- detail: "Two screws from inside each door into its handle, then the lock and its catch with two screws each. The keys come in the bag.",
- fix: [
- fix("handle", [[-30, gy, D / 2 + 20], [30, gy, D / 2 + 20]], [0, 0, -1], { len: 120, dia: 14, twist: Math.PI / 2 }),
- fix("screw", [-1, 1].flatMap((k) => [-45, 45].map((dy) => [k * 30, gy + dy, D / 2] as Vec3)), [0, 0, 1], { len: 16, dia: 4, name: "Handle screw" }),
- fix("clip", [[30, gy - 140, D / 2 + 20]], [0, 0, -1], { name: "Lock", len: 30, dia: 20 }),
- fix("screw", [[30, gy - 160, D / 2], [30, gy - 120, D / 2]], [0, 0, 1], { len: 10, dia: 4 }),
- ...(tall ? [fix("bolt", [[-10, gy - 140, D / 2], [-10, gy - 170, D / 2]], [1, 0, 0], { name: "Lock catch", len: 12, dia: 6 })] : []),
- ],
- tools: ["screwdriver", "allen"],
- },
- { title: "Level it", detail: "Turn the feet until the doors meet evenly at the top and bottom." },
+ const DOWN: Vec3 = [0, -1, 0];
+ const short = { len: 12, dia: 6 };
+ const screw = { len: 10, dia: 4 };
+ // each rail end bolted from the outside of its leg
+ const railBolts = corners.flatMap(([sx, sz]) => [
+ fix("bolt", [[sx * (W / 2), yR, sz * (D / 2 - 18)]], [-sx, 0, 0], short),
+ fix("bolt", [[sx * (W / 2 - 18), yR, sz * (D / 2)]], [0, 0, -sz], short),
+ ]);
+ const frameBolts = (cs: number[], two: boolean): Vec3[] =>
+ cs.flatMap((i) => {
+ const [sx, sz] = corners[i];
+ const a: Vec3 = [sx * (W / 2 - 12), yB, sz * (D / 2 - 34)];
+ return two ? [a, [sx * (W / 2 - 34), yB, sz * (D / 2 - 12)] as Vec3] : [a];
+ });
+ const postBolts = fix("bolt", corners.map(([sx, sz]) => [sx * xs, yB + 32, sz * zs] as Vec3), DOWN, { len: 50, dia: 6 });
+ const midFace = mz + md / 2 + 4; // just in front of the middle post
+ const midScrew = (y: number) => fix("screw", [[0, y, midFace]], [0, 0, -1], { ...screw, on: "Pm" });
+ // a glass clip on a post's inner face, screwed in: the screws go first so each clip sits on its own screw
+ const sideClips = (pts: Vec3[]): CustomFix[] => {
+ const l = pts.filter((p) => p[0] < 0), r = pts.filter((p) => p[0] > 0);
+ return [
+ ...(l.length ? [fix("screw", l, [-1, 0, 0], screw)] : []),
+ ...(r.length ? [fix("screw", r, [1, 0, 0], screw)] : []),
+ fix("clamp", pts, [0, 1, 0], { name: "Glass clip", len: 30, dia: 16 }),
+ ];
+ };
+ const clipAt = (y: number, sxs: number[]): Vec3[] => sxs.flatMap((sx) => [-1, 1].map((sz) => [sx * (xs - P / 2 - 4), y, sz * (zs - 4)] as Vec3));
+ const narrow = (ys: number[]): CustomFix[] => [
+ fix("screw", ys.map((y) => [0, y, midFace] as Vec3), [0, 0, -1], { ...screw, on: "Pm" }),
+ fix("clamp", ys.map((y) => [0, y, midFace] as Vec3), [0, 1, 0], { name: "Narrow glass clip", len: 20, dia: 12, on: "Pm" }),
+ ];
+ const doorTop = gy + gh / 2;
+ const hingeX = (sx: number) => sx * (W / 2 - 40);
+ const plates = (sxs: number[]): CustomFix[] => [
+ fix("screw", sxs.flatMap((sx) => [hingeX(sx) - 25, hingeX(sx) + 25].map((x) => [x, doorTop, D / 2 + 10] as Vec3)), DOWN, { len: 14, dia: 4 }),
+ fix("hinge", sxs.map((sx) => [hingeX(sx), doorTop, D / 2 + 10] as Vec3), DOWN, { name: "Hinge plate", len: 40, dia: 20 }),
+ ];
+ const bushings = fix("clip", [-1, 1].map((sx) => [hingeX(sx), yB, D / 2 - 8] as Vec3), DOWN, { name: "Hinge bushing", len: 10, dia: 12 });
+ const pins = fix("pin", [-1, 1].map((sx) => [hingeX(sx), H, D / 2 + 10] as Vec3), DOWN, { name: "Hinge pin", len: 40, dia: 8 });
+ const handles: CustomFix[] = [
+ fix("screw", [-1, 1].flatMap((k) => [-40, 40].map((dy) => [k * 14, gy + dy, D / 2] as Vec3)), [0, 0, 1], screw),
+ fix("handle", [[-14, gy, D / 2 + 30], [14, gy, D / 2 + 30]], [0, 0, -1], { len: 120, dia: 14, twist: Math.PI / 2 }),
+ ];
+ const feet = fix("foot", corners.map(([sx, sz]) => [sx * (W / 2 - 18), 0, sz * (D / 2 - 18)] as Vec3), [0, 1, 0], { name: "Levelling foot", len: 25, dia: 22 });
+ const two = { people: 2 as const, warnings: ["two" as const, "hand" as const] };
+ const paneDetail = "Push it up into the channel under the top, then swing the bottom in and let it drop into the base. Never stand glass on a hard floor.";
+
+ const start: CustomStep[] = [
+ { title: "Screw the feet into the legs", detail: "Lay the four legs on a rug and turn a levelling foot into the bottom of each by hand.", add: ["L0", "L1", "L2", "L3"], fix: [feet], warnings: ["floor"] },
+ ...(tall
+ ? [
+ { title: "Push the long rails into the legs", detail: "One at the front and one at the back, each end into the slot at the top of a leg.", add: ["rF", "rB"] },
+ { title: "Push in the short rails", detail: "They close the two ends.", add: ["rL", "rR"] },
+ ]
+ : [{ title: "Push the rails into the legs", detail: "Two long and two short rails, each end into the slot at the top of a leg.", add: ["rF", "rB", "rL", "rR"] }]),
+ { title: "Bolt the rails to the legs", detail: "Eight short bolts with the Allen key, two at each leg.", fix: railBolts, tools: ["allen"], check: "square" },
+ ];
+ const tallSteps: CustomStep[] = [
+ ...start,
+ { title: "Bolt the base frame on", detail: "Lay it on the legs with the corner plates over them. Two bolts at two opposite corners.", add: ["fr"], fix: [fix("bolt", frameBolts([0, 3], true), DOWN, short)], tools: ["allen"] },
+ { title: "Bolt the other two corners", detail: "One bolt at each.", fix: [fix("bolt", frameBolts([1, 2], false), DOWN, short)], tools: ["allen"] },
+ { title: "Bolt on the four posts", detail: "Stand each post on its corner and bolt it down through its foot with a long bolt.", add: ["P0", "P1", "P2", "P3"], fix: [postBolts], tools: ["allen"] },
+ { title: "Lay the bottom plate in", detail: "Its notches fit round the posts.", add: ["bot"] },
+ { title: "Fit the middle post at the back", detail: "Hook its foot onto the tab in the back of the frame and fix it with one screw.", add: ["Pm"], fix: [midScrew(yB + 30)], tools: ["screwdriver"] },
+ { title: "Put the top on", detail: "Lower it onto the five posts so each one goes into its hole.", add: ["top"] },
+ { title: "Bolt the top to the corner posts", detail: "Four short bolts, only loosely for now.", fix: [fix("bolt", corners.map(([sx, sz]) => [sx * xs, H, sz * zs] as Vec3), DOWN, short)], tools: ["allen"] },
+ { title: "Screw the middle post to the top", detail: "One screw at the back.", fix: [midScrew(H - TOP - 30)], tools: ["screwdriver"] },
+ { title: "Fit the back pane together", detail: `Turn the cabinet so its back faces you. ${paneDetail}`, add: ["gB"], ...two, from: { gB: [0, 0, 420] } },
+ { title: "Clip it to the middle post", detail: "Three narrow clips, one screw each.", fix: narrow(clipY), tools: ["screwdriver"] },
+ { title: "Fit a glass side", detail: paneDetail, add: ["gL"], warnings: ["hand"], from: { gL: [240, 0, 380] } },
+ { title: "Clip the side in", detail: "Four glass clips, two on each post, one screw each.", fix: sideClips(clipAt(clipY[0], [-1]).concat(clipAt(clipY[1], [-1]))), tools: ["screwdriver"], people: 2 },
+ { title: "Fit the other glass side", detail: paneDetail, add: ["gR"], warnings: ["hand"], from: { gR: [-240, 0, 380] } },
+ { title: "Clip that side in", detail: "Four more clips at the same heights.", fix: sideClips(clipAt(clipY[0], [1]).concat(clipAt(clipY[1], [1]))), tools: ["screwdriver"], people: 2 },
+ { title: "Fit the top row of clips", detail: "Four clips, one on each corner post. The shelves rest on the clips, so keep each row level.", fix: sideClips(clipAt(clipY[2], [-1, 1])), tools: ["screwdriver"] },
+ { title: "Tighten the top bolts", detail: "Check every pane sits in its top channel, then tighten the four bolts.", tools: ["allen"] },
+ { title: "Tighten the middle post screw", tools: ["screwdriver"] },
+ { title: "Screw the hinge plates onto the doors", detail: "Lay the doors on a rug. One plate on the top corner of each door, two screws each.", fix: plates([-1, 1]), wait: ["dL", "dR"], tools: ["screwdriver"], warnings: ["floor"] },
+ { title: "Push the bushings into the base", detail: "One at each front corner.", fix: [bushings] },
+ { title: "Set the doors on the bushings", detail: "Lower each door onto its bushing and tip the top in under the top.", add: ["dL", "dR"], warnings: ["hand"], from: { dL: [0, 0, 380], dR: [0, 0, 380] } },
+ { title: "Push the hinge pins in", detail: "Down through the top into each hinge plate.", fix: [pins] },
+ { title: "Screw on the handles", detail: "Two screws from inside each door.", fix: handles, tools: ["screwdriver"] },
+ { title: "Try the lock", detail: "The lock is already in the door. Both keys are in the bag." },
+ ];
+ const lowSteps: CustomStep[] = [
+ ...start,
+ { title: "Lay the base frame on", detail: "Its corner plates sit on the tops of the legs.", add: ["fr"] },
+ { title: "Bolt on the four posts", detail: "Stand each post on its corner and bolt it down through its foot with a long bolt.", add: ["P0", "P1", "P2", "P3"], fix: [postBolts], tools: ["allen"] },
+ { title: "Tighten the post bolts", detail: "Check each post stands straight, then tighten all four.", tools: ["allen"] },
+ { title: "Lay the bottom plate in", detail: "Its notches fit round the posts.", add: ["bot"] },
+ { title: "Screw two narrow clips onto the middle post", detail: "Lay it on the floor, one screw each.", fix: narrow(clipY), wait: ["Pm"], tools: ["screwdriver"], warnings: ["floor"] },
+ { title: "Fit the middle post at the back", detail: "Hook its foot onto the tab in the back of the frame and fix it with one screw.", add: ["Pm"], fix: [midScrew(yB + 30)], tools: ["screwdriver"] },
+ { title: "Lower a back pane in together", detail: "From above, into the channels of the corner post and the middle post. Never stand glass on a hard floor.", add: ["gB0"], ...two, from: { gB0: [0, 600, 0] } },
+ { title: "Lower in the other back pane", add: ["gB1"], ...two, from: { gB1: [0, 600, 0] } },
+ { title: "Lower in the two glass sides", add: ["gL", "gR"], ...two, from: { gL: [0, 600, 0], gR: [0, 600, 0] } },
+ { title: "Lay the top on together", detail: "Guide the tops of the posts into its corners.", add: ["top"], people: 2, warnings: ["two"] },
+ { title: "Screw in the glass clips", detail: "Eight clips, one on each corner post at two heights. The shelf rests on the top row.", fix: sideClips(clipY.flatMap((y) => clipAt(y, [-1, 1]))), tools: ["screwdriver"] },
+ { title: "Bolt the top to the corner posts", detail: "Four short bolts.", fix: [fix("bolt", corners.map(([sx, sz]) => [sx * xs, H, sz * zs] as Vec3), DOWN, short)], tools: ["allen"] },
+ { title: "Screw the middle post to the top", detail: "One screw at the back.", fix: [midScrew(H - TOP - 30)], tools: ["screwdriver"] },
{
- title: "Fix it to the wall",
- detail: "Screw the two brackets under the top frame at the back, then into the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ title: "Screw the buffers onto the doors",
+ detail: "Lay the doors on a rug, inside up. One buffer at the top and bottom of each door's inner edge.",
fix: [
- fix("angle", [-1, 1].map((sx) => [sx * (xs - 60), yTop - P, -D / 2] as Vec3), [0, 1, 0], { name: "Wall bracket", len: 80, dia: 30 }),
- fix("screw", [-1, 1].map((sx) => [sx * (xs - 60), yTop - P - 2, -D / 2 + 12] as Vec3), [0, 1, 0], { len: 10, dia: 4, on: "tf" }),
- fix("plug", [-1, 1].map((sx) => [sx * (xs - 60), yTop - 60, -D / 2 - 50] as Vec3), [0, 0, -1], { len: 35, dia: 8 }),
- fix("screw", [-1, 1].map((sx) => [sx * (xs - 60), yTop - 60, -D / 2 - 6] as Vec3), [0, 0, -1], { len: 50, dia: 5 }),
+ fix("screw", [-1, 1].flatMap((sx) => [gy - gh / 2 + 40, gy + gh / 2 - 40].map((y) => [sx * 14, y, D / 2] as Vec3)), [0, 0, 1], { len: 12, dia: 3.5 }),
+ fix("washer", [-1, 1].flatMap((sx) => [gy - gh / 2 + 40, gy + gh / 2 - 40].map((y) => [sx * 14, y, D / 2] as Vec3)), [0, 0, 1], { name: "Door buffer", len: 4, dia: 14 }),
],
- tools: ["drill", "screwdriver", "pencil"],
- wall: true,
- warnings: ["wall", "tip"],
+ wait: ["dL", "dR"],
+ tools: ["screwdriver"],
+ warnings: ["floor"],
},
- { title: "Clip on the shelf supports", detail: `${supports.length} supports, four for each shelf, at the same height.`, fix: [fix("pin", supports.filter((p) => p[0] < 0), [-1, 0, 0], { name: "Shelf support", len: 14, dia: 16 }), fix("pin", supports.filter((p) => p[0] > 0), [1, 0, 0], { name: "Shelf support", len: 14, dia: 16 })] },
- { title: "Lay the glass shelves on", detail: "Tilt each one in through the door and lower it onto its supports.", add: shelfY.map((_, i) => `sh${i}`), warnings: ["hand"] },
+ { title: "Screw the hinge plate onto a door", detail: "On the top corner, two screws.", fix: plates([1]), tools: ["screwdriver"] },
+ { title: "Push the bushings into the base", detail: "One at each front corner.", fix: [bushings] },
+ { title: "Set the doors on the bushings", detail: "Lower each door onto its bushing and tip the top in under the top.", add: ["dL", "dR"], warnings: ["hand"], from: { dL: [0, 0, 380], dR: [0, 0, 380] } },
+ { title: "Push the hinge pins in", detail: "Down through the top into each door.", fix: [pins] },
+ { title: "Screw on the handles", detail: "Two screws from inside each door.", fix: handles, tools: ["screwdriver"] },
+ { title: "Try the lock", detail: "The lock is already in the door. Both keys are in the bag." },
];
- return { parts, steps };
+ const level: CustomStep = { title: "Level it", detail: "Turn the four feet until the doors meet evenly at the top and bottom.", tools: ["wrench"] };
+ const wallPt = (x: number): Vec3 => [x, H + 30, -D / 2];
+ const wall: CustomStep = tall
+ ? {
+ title: "Fix it to the wall",
+ detail: "Screw the two brackets onto the top at the back, then into the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fix("screw", [-1, 1].map((sx) => [sx * (W / 2 - 80), H, -D / 2 + 34] as Vec3), DOWN, screw),
+ fix("angle", [-1, 1].map((sx) => [sx * (W / 2 - 80), H, -D / 2 + 8] as Vec3), DOWN, { name: "Wall bracket", len: 80, dia: 30 }),
+ fix("plug", [-1, 1].map((sx) => { const p = wallPt(sx * (W / 2 - 80)); return [p[0], p[1], p[2] - 40] as Vec3; }), [0, 0, -1], { len: 35, dia: 8 }),
+ fix("screw", [-1, 1].map((sx) => wallPt(sx * (W / 2 - 80))), [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ }
+ : {
+ title: "Strap it to the wall",
+ detail: "Mark the wall at the top of the cabinet, screw the strap to the wall and then onto the top at the back. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [
+ fix("screw", [[0, H, -D / 2 + 45]], DOWN, { len: 8, dia: 4 }),
+ fix("strap", [[0, H, -D / 2 + 20]], DOWN, { len: 120, dia: 20 }),
+ fix("plug", [[0, H + 40, -D / 2 - 40]], [0, 0, -1], { len: 35, dia: 8 }),
+ fix("screw", [[0, H + 40, -D / 2]], [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ };
+ const shelves: CustomStep = { title: shelfAt.length > 1 ? "Lay the glass shelves in" : "Lay the glass shelf in", detail: "Tilt it in through the door and lower it onto a row of clips.", add: shelfAt.map((_, i) => `sh${i}`), warnings: ["hand"] };
+ return { parts, steps: [...(tall ? tallSteps : lowSteps), level, wall, shelves] };
}
const family: Family = {
names: ["MILSBO"],
recipe(s) {
- // 101x186 has no manual found; the 101 one in the box is 100 high
if (/milsbo-glass-door-cabinet-(73-x-175|101-x-100)/.test(s.slug ?? "")) return recipe(s);
return null;
},
diff --git a/src/lib/plan/families/minnen.ts b/src/lib/plan/families/minnen.ts
index 864debd..a55535d 100644
--- a/src/lib/plan/families/minnen.ts
+++ b/src/lib/plan/families/minnen.ts
@@ -161,7 +161,7 @@ function recipe(s: ProductSpec) {
title: "Bolt the rail halves to the ends",
detail: "Screw each threaded pin into a long sleeve, then through the post into the rail. Two at each post, not tight yet.",
add: ["HB", "RH-1", "RH1", "FB", "RF-1", "RF1"],
- fix: [...postFix(-1, [RY0 + 10, RY0 + RH - 10], true), ...postFix(1, [RY0 + 10, RY0 + RH - 10], true)],
+ fix: [...postFix(-1, [RY0 + RH / 2 - 12, RY0 + RH / 2 + 12], true), ...postFix(1, [RY0 + RH / 2 - 12, RY0 + RH / 2 + 12], true)],
tools: ["allen"],
from: { "RH-1": [0, 0, 400], RH1: [0, 0, 400], "RF-1": [0, 0, -400], RF1: [0, 0, -400] },
},
diff --git a/src/lib/plan/families/mittzon.ts b/src/lib/plan/families/mittzon.ts
index 1d056a8..d5eab9c 100644
--- a/src/lib/plan/families/mittzon.ts
+++ b/src/lib/plan/families/mittzon.ts
@@ -225,7 +225,8 @@ function desk(b: PlanBuilder, s: ProductSpec, electric: boolean) {
});
step({ title: "Fix the top with seven more screws", detail: "Up through the brackets along the arms and the beam.", kind: "screws", tools: ["screwdriver"] }, () => {
arms.forEach((a, i) => fit(SCREW, [-D / 2 + 70, D / 2 - 60, D / 8].slice(0, i ? 4 : 3).map((z) => pt(a, [(i ? 1 : -1) * xl, yArm, z], [0, 1, 0])), 0.06));
- fit(SCREW, [pt(inner, [L / 4, yb + 25, 0], [0, 1, 0])]);
+ // the beam's bracket reaches up to the top: the screw goes through its flange
+ fit(SCREW, [pt(inner, [L / 4, H - TT - 6, 0], [0, 1, 0])]);
});
strapStep("+y", back);
step({ title: "Click the cable tray together and hang it in the holders", detail: "The two halves click into one tray.", kind: "join" }, () => b.add(tray, [0, -200, 0]));
@@ -295,11 +296,13 @@ function conference(s: ProductSpec): CustomParams | null {
const cornerOf = (p: Vec3) => `L${p[0] > 0 ? 1 : 0}${p[2] > 0 ? 1 : 0}`;
const railScrews = (n: number): CustomFix => {
const pts: Vec3[] = [];
- for (const sz of [-1, 1]) for (let i = 0; i < n / 2; i++) pts.push([-fw / 2 + 150 + ((fw - 300) * i) / Math.max(1, n / 2 - 1), H - TT - RH, sz * (fd / 2 - RT / 2)]);
- return { kind: "bolt", count: n, len: 40, dia: 6, at: pts, dir: [0, 1, 0] };
+ // through the rail's flange under the top and into the top
+ for (const sz of [-1, 1]) for (let i = 0; i < n / 2; i++) pts.push([-fw / 2 + 150 + ((fw - 300) * i) / Math.max(1, n / 2 - 1), H - TT - 12, sz * (fd / 2 - RT / 2)]);
+ return { kind: "bolt", count: n, len: 30, dia: 6, at: pts, dir: [0, 1, 0] };
};
- const plates: CustomFix = { kind: "plate", count: 4, at: corners.map((p) => [p[0], p[1], p[2]] as Vec3), dir: [0, 1, 0] };
- const plateScrews: CustomFix = { kind: "bolt", count: 4, len: 40, dia: 6, at: corners.map((p) => [p[0] * 0.97, p[1], p[2] * 0.95] as Vec3), dir: [0, 1, 0] };
+ // the plate lies flat against the top in the frame's corner, its screw up through it into the top
+ const plates: CustomFix = { kind: "plate", count: 4, at: corners.map((p) => [p[0], H - TT, p[2]] as Vec3), dir: [0, 1, 0], on: top };
+ const plateScrews: CustomFix = { kind: "bolt", count: 4, len: 20, dia: 6, at: corners.map((p) => [p[0] - Math.sign(p[0]) * 30, H - TT - 4, p[2] - Math.sign(p[2]) * 30] as Vec3), dir: [0, 1, 0], on: top };
const blockPts: Vec3[] = corners.map((p) => [p[0] - Math.sign(p[0]) * 30, H - TT - RH / 2, p[2] - Math.sign(p[2]) * 30]);
const blocks: CustomFix = { kind: "clamp", count: 4, at: blockPts, dir: [0, 1, 0], name: "Corner block" } as CustomFix;
// a washer and a cap bolt through each block into its own leg
@@ -315,7 +318,7 @@ function conference(s: ProductSpec): CustomParams | null {
} else {
steps.push({ title: "Lay the top face down and set the rails on it", detail: "On a rug or the box. The long rails along the long edges, the short ones across the ends.", add: [top, "RL0", "RL1", "RS0", "RS1"], pose: P, warnings: ["floor"] });
if (deep) {
- steps.push({ title: "Lay the centre beam along the middle", detail: "Between the long rails, over the cable slot. One screw at each end.", add: ["B"], pose: P, fix: [{ kind: "screw", count: 2, len: 12, dia: 6, at: [-1, 1].map((sx) => [sx * (fw / 2 - RT - 60), H - TT - 40, 0] as Vec3), dir: [0, 1, 0], on: "B" }] });
+ steps.push({ title: "Lay the centre beam along the middle", detail: "Between the long rails, over the cable slot. One screw at each end.", add: ["B"], pose: P, fix: [{ kind: "screw", count: 2, len: 50, dia: 6, at: [-1, 1].map((sx) => [sx * (fw / 2 - RT - 60), H - TT - 40, 0] as Vec3), dir: [0, 1, 0], on: "B" }] });
steps.push({ title: "Screw the long rails to the top", detail: "Ten countersunk screws, with the Allen key.", fix: [railScrews(10)], pose: P, tools: ["allen"] });
} else steps.push({ title: "Screw the long rails to the top", detail: "Four countersunk screws, with the Allen key.", fix: [railScrews(4)], pose: P, tools: ["allen"] });
steps.push({ title: "Screw a corner plate into each corner", detail: "Flat side down, the hole over the hole in the top. One screw each.", fix: [plates, plateScrews], pose: P, tools: ["allen"] });
diff --git a/src/lib/plan/families/mofalla.ts b/src/lib/plan/families/mofalla.ts
new file mode 100644
index 0000000..1dc9dda
--- /dev/null
+++ b/src/lib/plan/families/mofalla.ts
@@ -0,0 +1,100 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * MOFALLA folding easy chair. IKEA sells it ready to use, with no assembly manual: two chrome tube frames hinged where
+ * they cross, a canvas seat and back. So the guide only unfolds it: lift it out folded, swing the seat frame open until
+ * the seat lies taut, and stand it up.
+ */
+
+const TUBE = 20;
+
+/** A tube from a to b in the y-z plane, centred relative to c. */
+function tube(a: Vec3, b: Vec3, c: Vec3): PartPiece {
+ const d: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...d);
+ const rot: Vec3 = Math.abs(d[0]) > Math.abs(d[1]) && Math.abs(d[0]) > Math.abs(d[2]) ? [0, 0, Math.PI / 2] : [Math.atan2(d[2], d[1]), 0, 0];
+ return { shape: "cyl", size: [TUBE, Math.round(len + TUBE), TUBE], pos: [(a[0] + b[0]) / 2 - c[0], (a[1] + b[1]) / 2 - c[1], (a[2] + b[2]) / 2 - c[2]], rot };
+}
+
+/** A frame of tubes, placed where they sit in the unfolded chair. */
+function frame(id: string, name: string, segs: [Vec3, Vec3][]): CustomPart {
+ const pts = segs.flat();
+ const lo = [0, 1, 2].map((i) => Math.min(...pts.map((p) => p[i])) - TUBE / 2);
+ const hi = [0, 1, 2].map((i) => Math.max(...pts.map((p) => p[i])) + TUBE / 2);
+ const c = lo.map((v, i) => (v + hi[i]) / 2) as Vec3;
+ return { id, name, size: hi.map((v, i) => v - lo[i]) as Vec3, pos: c, material: "metal", pieces: segs.map(([a, b]) => tube(a, b, c)) };
+}
+
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 58 wide, 57 deep, 74 high, seat 42 high
+ const W = s.size.w * 10 || 580, D = s.size.d * 10 || 570, H = s.size.h * 10 || 740;
+ const ySeat = 420, y0 = TUBE / 2;
+ const xa = W / 2 - TUBE / 2, xb = xa - TUBE - 4; // the back frame outside, the seat frame inside it
+ const zF = D / 2 - TUBE / 2, zB = -D / 2 + TUBE / 2;
+ // back frame: from the floor at the front, up and back to the top of the backrest, a bar along the floor in front
+ const topZ = zB + 50;
+ const back = frame("A", "Back frame", [
+ [[-xa, y0, zF], [-xa, H - y0, topZ]],
+ [[xa, y0, zF], [xa, H - y0, topZ]],
+ [[-xa, y0, zF], [xa, y0, zF]],
+ [[-xa, H - y0, topZ], [xa, H - y0, topZ]],
+ ]);
+ // seat frame: from the floor at the back, up and forward to the front edge of the seat
+ const seatZ = zF - 60;
+ const seatFrame = frame("B", "Seat frame", [
+ [[-xb, y0, zB], [-xb, ySeat, seatZ]],
+ [[xb, y0, zB], [xb, ySeat, seatZ]],
+ [[-xb, y0, zB], [xb, y0, zB]],
+ [[-xb, ySeat, seatZ], [xb, ySeat, seatZ]],
+ ]);
+ // the canvas: the seat from the front bar back to the back frame, the back between its uprights
+ const seatBack = zB + 170, seatDrop = 30;
+ const seatLen = Math.hypot(seatZ - seatBack, seatDrop);
+ const seat: CustomPart = {
+ id: "S",
+ name: "Seat",
+ size: [2 * xb - TUBE, 3, Math.round(seatLen)],
+ pos: [0, ySeat - seatDrop / 2, (seatZ + seatBack) / 2],
+ rot: [-Math.atan2(seatDrop, seatZ - seatBack), 0, 0],
+ material: "soft",
+ };
+ const bTop = H - 40, bBot = H - 300;
+ const zAt = (y: number) => zF + ((topZ - zF) * (y - y0)) / (H - 2 * y0);
+ const backLen = Math.hypot(bTop - bBot, zAt(bTop) - zAt(bBot));
+ const backrest: CustomPart = {
+ id: "K",
+ name: "Back",
+ size: [2 * xa - TUBE, Math.round(backLen), 3],
+ pos: [0, (bTop + bBot) / 2, (zAt(bTop) + zAt(bBot)) / 2 - TUBE / 2],
+ rot: [Math.atan2(zAt(bTop) - zAt(bBot), bTop - bBot), 0, 0],
+ material: "soft",
+ };
+ return {
+ parts: [back, backrest, seatFrame, seat],
+ steps: [
+ {
+ title: "Lift the chair out of the box",
+ detail: "It comes folded and ready to use: nothing to screw together. Stand it on its back frame.",
+ add: ["A", "K"],
+ },
+ {
+ title: "Swing the seat frame open",
+ detail: "Pull the seat frame away from the back frame until both stand on the floor and the canvas seat is taut. Keep your fingers clear of the hinges.",
+ add: ["B", "S"],
+ from: { B: [0, 260, 260], S: [0, 260, 260] },
+ warnings: ["hand"],
+ },
+ { title: "Check it stands steady", detail: "Press down on the seat: all four floor bars should touch the floor. To fold it, lift the front of the seat." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["MOFALLA"],
+ recipe(s) {
+ if (/chair/i.test(s.variant) || /mofalla/.test(s.slug ?? "")) return chair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/moppe.ts b/src/lib/plan/families/moppe.ts
new file mode 100644
index 0000000..0ef02e4
--- /dev/null
+++ b/src/lib/plan/families/moppe.ts
@@ -0,0 +1,75 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * MOPPE mini chest of drawers. IKEA sells it ready assembled (its page has no assembly instructions), so the guide
+ * only unpacks it: the birch plywood case, then the drawers, which travel taped in place. The 31 cm chest has two
+ * columns of three drawers; the 42 cm one has three small drawers on top, two below and one wide one at the bottom.
+ */
+
+const T = 9; // plywood
+const FT = 6; // drawer fronts and sides
+
+function chest(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const c: Vec3 = [0, H / 2, 0];
+ const rel = (p: Vec3): Vec3 => [p[0] - c[0], p[1] - c[1], p[2] - c[2]];
+ const box = (size: Vec3, at: Vec3): PartPiece => ({ shape: "box", size, pos: rel(at) });
+ const iw = W - 2 * T, ih = H - 2 * T;
+ // rows from the top: how many drawers side by side in each
+ const rows = W > 360 ? [3, 2, 1] : [2, 2, 2];
+ const rh = (ih - 2 * 4) / 3; // two shelves of 4 mm between the rows
+ const shell: PartPiece[] = [
+ box([W, T, D], [0, H - T / 2, 0]),
+ box([W, T, D], [0, T / 2, 0]),
+ box([T, ih, D], [-W / 2 + T / 2, H / 2, 0]),
+ box([T, ih, D], [W / 2 - T / 2, H / 2, 0]),
+ box([iw, ih, 3], [0, H / 2, -D / 2 + 1.5]),
+ ...[1, 2].map((k) => box([iw, 4, D - 3], [0, H - T - k * rh - (k - 0.5) * 4, 1.5])),
+ ];
+ const parts: CustomPart[] = [{ id: "C", name: "Chest", size: [W, H, D], pos: c, pieces: shell, material: "wood" }];
+ const dd = D - 3 - 4;
+ const ids: string[] = [];
+ rows.forEach((n, r) => {
+ const top = H - T - r * (rh + 4);
+ const w = (iw - (n - 1) * 2) / n;
+ for (let i = 0; i < n; i++) {
+ const x = -iw / 2 + w / 2 + i * (w + 2);
+ const y = top - rh / 2;
+ const id = `D${r}${i}`;
+ const h = rh - 2, dw = w - 1;
+ const dc: Vec3 = [x, y, D / 2 - dd / 2];
+ const pc = (size: Vec3, at: Vec3): PartPiece => ({ shape: "box", size, pos: [at[0] - dc[0], at[1] - dc[1], at[2] - dc[2]] });
+ parts.push({
+ id,
+ name: n === 1 ? "Wide drawer" : n === 2 ? "Drawer" : "Small drawer",
+ size: [dw, h, dd],
+ pos: dc,
+ material: "wood",
+ pieces: [
+ pc([dw, h, FT], [x, y, D / 2 - FT / 2]),
+ pc([dw, h - 20, FT], [x, y - 10, D / 2 - dd + FT / 2]),
+ pc([FT, h - 20, dd - 2 * FT], [x - dw / 2 + FT / 2, y - 10, D / 2 - dd / 2]),
+ pc([FT, h - 20, dd - 2 * FT], [x + dw / 2 - FT / 2, y - 10, D / 2 - dd / 2]),
+ pc([dw - 2 * FT, 3, dd - 2 * FT], [x, y - h / 2 + 1.5, D / 2 - dd / 2]),
+ ],
+ });
+ ids.push(id);
+ }
+ });
+ const from = Object.fromEntries(ids.map((id) => [id, [0, 0, 220] as Vec3]));
+ return {
+ parts,
+ steps: [
+ { title: "Unpack the chest", detail: "It comes ready assembled, so there is nothing to put together. Cut the wrapping carefully so the knife can't mark the wood.", add: ["C"] },
+ { title: "Take the drawers out and remove the packing", detail: `Pull out all ${ids.length} drawers and take out the tape and card that hold them still in the box.`, kind: "drawer" },
+ { title: "Slide the drawers back in", detail: "Each one into its own opening, the finger notch at the top. They should run freely without forcing.", add: ids, from, kind: "drawer" },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["MOPPE"],
+ recipe: (s) => (/^moppe-mini-chest/.test(s.slug ?? "") ? chest(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/morabo.ts b/src/lib/plan/families/morabo.ts
index 0737628..cca4976 100644
--- a/src/lib/plan/families/morabo.ts
+++ b/src/lib/plan/families/morabo.ts
@@ -89,7 +89,7 @@ function sleeper(b: PlanBuilder, s: ProductSpec): boolean {
const armT = part("Armrest", [aw, BH, D]);
const arms = [-1, 1].map((e) => b.place(armT, [e * ax, BY, 0]));
const railT = part("Rail", [iw, 40, 40], { material: "metal" });
- const rails = [Z0 + BT + 20, front - 20].map((z) => b.place(railT, [0, deck - 20, z]));
+ const rails = [Z0 + BT + 20, front - 40].map((z) => b.place(railT, [0, deck - 20, z]));
const slats = b.place(part("Slatted seat", [iw, 30, D - BT - 80], { material: "wood" }), [0, deck + 15, Z0 + BT + (D - BT) / 2]);
const seatC = b.place(part("Seat cushion", [iw - 6, SEAT - deck - 30, D - BT]), [0, (deck + 30 + SEAT) / 2, Z0 + BT + (D - BT) / 2]);
const legT = part("Leg", [50, LEG, 50], { shape: "cyl", material: "wood" }), slvT = part("Leg sleeve", [56, SLV, 56], { shape: "cyl" });
@@ -149,7 +149,7 @@ function sleeper(b: PlanBuilder, s: ProductSpec): boolean {
b.then(0.1);
fit(WSCREW, wp.flatMap((q) => [-15, 15].map((dz) => ({ on: arms[q[0] > 0 ? 1 : 0], at: [q[0] - sg(q) * 10, q[1] - 15, q[2] + dz] as Vec3, dir: [sg(q), 0, 0] as Vec3 }))), 0.06);
});
- const fb: Vec3[] = [-1, 1].flatMap((e) => [-30, 30].map((dz) => [e * (iw / 2 - 10), deck - 20, front - 20 + dz] as Vec3));
+ const fb: Vec3[] = [-1, 1].flatMap((e) => [-12, 12].map((dz) => [e * (iw / 2 - 10), deck - 20, front - 40 + dz] as Vec3));
step({ title: "Hang the front rail on the armrests", detail: "Screw the four bolts part way into the armrests first. Together, hook the rail's slots over them, then tighten them with the Allen key.", pose: "+z", kind: "bolts", people: 2, tools: ["allen"] }, () => {
fit(RBOLT, fb.map((q) => ({ on: arms[q[0] > 0 ? 1 : 0], mate: rails[1], at: q, dir: [sg(q), 0, 0] as Vec3 })), 0.08);
b.then(0.15);
diff --git a/src/lib/plan/families/mossjon.ts b/src/lib/plan/families/mossjon.ts
index e0e1fbc..d54aa8a 100644
--- a/src/lib/plan/families/mossjon.ts
+++ b/src/lib/plan/families/mossjon.ts
@@ -138,7 +138,7 @@ function wallCabinet(s: ProductSpec) {
detail: "Choose which side the door opens first: the stop goes on the side away from the pivots.",
fix: [
{ kind: "clip", name: "Door stop", count: plates.length, at: plates.map((y) => [W / 2 - F, y, zp] as Vec3), dir: [-1, 0, 0], on: "P3" },
- { kind: "screw", count: plates.length, len: 10, dia: 4, at: plates.map((y) => [W / 2 - F - 2, y, zp] as Vec3), dir: [-1, 0, 0] },
+ { kind: "screw", count: plates.length, len: 10, dia: 4, at: plates.map((y) => [W / 2 - F - 4, y + 25, zp] as Vec3), dir: [1, 0, 0] },
],
tools: ["screwdriver"],
},
@@ -263,7 +263,7 @@ function doorCabinet(s: ProductSpec) {
},
{ title: "Push the pivot pins into the floor", detail: "With a washer each, in both front corners.", fix: [{ kind: "pin", name: "Pivot pin", count: 2, at: [0, 1].map((i) => [xh(i), boxLo - 4, zh] as Vec3), dir: [0, -1, 0], on: "FL" }, { kind: "washer", count: 2, at: [0, 1].map((i) => [xh(i), boxLo - 2, zh] as Vec3), dir: [0, -1, 0], on: "FL" }] },
{ title: "Set the doors on their pins", detail: "Tilt each door in at the top and lower it onto its pin." },
- { title: "Bolt the top pivots", detail: "One pivot bolt down through the top frame into each door, with the long Allen key.", fix: [{ kind: "bolt", name: "Pivot bolt", count: 2, len: 30, dia: 6, at: [0, 1].map((i) => [xh(i), levels[3] + F / 2, zh] as Vec3), dir: [0, -1, 0] }], tools: ["allen"] },
+ { title: "Bolt the top pivots", detail: "One pivot bolt down through the top frame into each door, with the long Allen key.", fix: [{ kind: "bolt", name: "Pivot bolt", count: 2, len: 30, dia: 6, at: [0, 1].map((i) => [xh(i), levels[3] + F / 2 + 3, zh] as Vec3), dir: [0, -1, 0] }], tools: ["allen"] },
{ title: "Lay the top on", detail: "Hook it over the front edge, then press the back down.", add: ["TP"] },
{ title: "Screw the top on", detail: "Two screws at the back and two at the sides.", fix: [{ kind: "screw", count: 4, len: 10, dia: 4, at: [[-(W / 2 - 40), H - TT / 2, -D / 2], [W / 2 - 40, H - TT / 2, -D / 2], [-W / 2, H - TT / 2, 0], [W / 2, H - TT / 2, 0]], dir: [0, 0, 1] }], tools: ["screwdriver"] },
{ title: "Slide the back panel on", detail: "Down behind the posts.", add: ["BK"], from: { BK: [0, 0, -300] } },
diff --git a/src/lib/plan/families/mulig.ts b/src/lib/plan/families/mulig.ts
index 6fa9341..00416c3 100644
--- a/src/lib/plan/families/mulig.ts
+++ b/src/lib/plan/families/mulig.ts
@@ -5,7 +5,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* MULIG clothes rack, read from its manual. Everything is put together lying on the floor: the two uprights are
* pushed into the bent top rail until their spring buttons click and each is held with a small screw, a bent foot
* clicks onto the bottom of each upright, and the lower rail is bolted between the feet with two Allen bolts.
- * Then the rack is stood up. The drying rack comes assembled (no manual), so it keeps its old guide.
+ * Then the rack is stood up. The drying rack comes assembled (no manual): its guide only unfolds it.
*/
const at = (kind: CustomFix["kind"], pts: Vec3[], dir: Vec3, on?: string, mate?: string, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: pts.length, at: pts, dir, on, mate, ...o });
@@ -75,10 +75,51 @@ function clothesRack(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/** The drying rack comes assembled and has no manual: open the legs, then fold out the two wings. */
+function dryingRack(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const t = 14, yr = H - 240, mw = Math.round(W * 0.52), yc = yr / 2;
+ // the middle: a frame of rails with wires across, on two pairs of legs crossed in an X seen from the end
+ const legs: PartPiece[] = [-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz): PartPiece => {
+ const len = Math.hypot(yr, D - 60);
+ return { shape: "cyl", size: [t, len, t], pos: [sx * (mw / 2 - 80), 0, 0], rot: [sz * Math.atan2(D - 60, yr), 0, 0] };
+ }),
+ );
+ const feet: PartPiece[] = [-1, 1].map((sz): PartPiece => ({ shape: "cyl", size: [t, mw - 160, t], pos: [0, -yc + 8, sz * (D / 2 - 30)], rot: [0, 0, Math.PI / 2] }));
+ const wires = (w: number, n: number, y: number, x0: number): PartPiece[] => [
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "cyl", size: [t, w, t], pos: [x0, y, sz * (D / 2 - 40)], rot: [0, 0, Math.PI / 2] })),
+ ...Array.from({ length: n }, (_, k): PartPiece => ({ shape: "cyl", size: [5, w, 5], pos: [x0, y, -D / 2 + 40 + ((D - 80) * (k + 1)) / (n + 1)], rot: [0, 0, Math.PI / 2] })),
+ ];
+ const ww = (W - mw) / 2, lift = 0.45, wy = yr + Math.sin(lift) * (ww / 2);
+ const wing = (sx: number): CustomPart => ({
+ id: sx < 0 ? "WL" : "WR",
+ name: "Wing",
+ size: [ww, 20, D - 60],
+ pos: [sx * (mw / 2 + (Math.cos(lift) * ww) / 2), wy, 0],
+ rot: [0, 0, sx * lift],
+ material: "metal",
+ pieces: wires(ww, 5, 0, 0),
+ });
+ return {
+ parts: [
+ { id: "M", name: "Rack with legs", size: [mw, yr + t, D], pos: [0, yc, 0], material: "metal", pieces: [...legs, ...feet, ...wires(mw, 9, yr - yc, 0)] },
+ wing(-1),
+ wing(1),
+ ],
+ steps: [
+ { title: "Open the legs", detail: "It comes ready made, folded flat. Stand it up and pull the legs apart until the middle lies level and the stays lock.", add: ["M"] },
+ { title: "Fold out the wings", detail: "Lift each end wing up and out until it rests on its stop.", add: ["WL", "WR"], from: { WL: [200, -250, 0], WR: [-200, -250, 0] }, warnings: ["hand"] },
+ { title: "To fold it away", detail: "Lower the wings first, then press the stays and close the legs. Keep your fingers clear of the joints." },
+ ],
+ };
+}
+
const family: Family = {
names: ["MULIG"],
recipe(s) {
if (/clothes-rack/.test(s.slug ?? "")) return clothesRack(s);
+ if (/drying-rack/.test(s.slug ?? "")) return dryingRack(s);
return null;
},
};
diff --git a/src/lib/plan/families/mullsjo.ts b/src/lib/plan/families/mullsjo.ts
index ffb232b..b94f33a 100644
--- a/src/lib/plan/families/mullsjo.ts
+++ b/src/lib/plan/families/mullsjo.ts
@@ -195,7 +195,7 @@ function desk(): CustomParams {
{
title: "Screw the trays to the legs",
detail: "One screw through the bracket at each corner where a tray meets a leg.",
- fix: yTray.flatMap((y, i) => SIDES.map((sz) => at("screw", [[xu - L / 2, y + 20, sz * (zu - 20)]], [1, 0, 0], i ? "P2" : "P1", sz < 0 ? "LB" : "LF", { len: 12, dia: 5 }))),
+ fix: yTray.flatMap((y, i) => SIDES.map((sz) => at("screw", [[xu - L / 2 - 2, y + 20, sz * (zu - 8)]], [1, 0, 0], i ? "P2" : "P1", sz < 0 ? "LB" : "LF", { len: 12, dia: 5 }))),
tools: ["screwdriver"],
},
{
@@ -275,7 +275,8 @@ function swivelChair(): CustomParams {
tb([sx * xa, ya, 220], [sx * xa, ya, -170], T),
tb([sx * xa, ya, -170], [sx * xa, yRail + 40, -200], T),
tb([sx * xa, yRail + 40, -200], [sx * xr, yRail, -200], T),
- tb([sx * xb, yRail, zb], [sx * xb, 760, zb], T),
+ // the back posts run up behind the whole back shell
+ tb([sx * xb, yRail, zb], [sx * xb, 870, zb], T),
]),
tb([-xr, yRail, -200], [xr, yRail, -200], T),
tb([-xb, yRail, zb], [xb, yRail, zb], T),
diff --git a/src/lib/plan/families/mydal.ts b/src/lib/plan/families/mydal.ts
index b7c50b9..cfcbcd5 100644
--- a/src/lib/plan/families/mydal.ts
+++ b/src/lib/plan/families/mydal.ts
@@ -173,14 +173,21 @@ function recipe(s: ProductSpec) {
{ title: "Tap dowels into the free ends", detail: "Six dowels: two in each guard board, one in each lower board.", fix: endDowels(-1, 1, ["B2", "B3", "B5", "B4"], false), tools: ["hammer"] },
{ title: "Bolt on the second post", detail: "Barrel nuts in all five boards, then six long bolts through the post.", add: ["P-11"], fix: endBolts(-1, 1, ["T", ...lower]), tools: ["wrench", "flathead"] },
{
- title: "Build the second end frame the same way",
- detail: "Top board to one post, then the other boards on dowels, each with one bolt.",
- add: ["P1-1", "T1", ...ids(1, lower)],
- fix: [...endBolts(1, -1, ["T", ...lower]), ...endDowels(1, -1, ["B2", "B3"], true), ...endDowels(1, -1, ["B5", "B4"], false)],
- tools: ["wrench", "hammer"],
+ title: "Start the second end frame the same way",
+ detail: "Lay its post flat on the rug and bolt the top board to it with two barrel nuts and long bolts.",
+ add: ["P1-1", "T1"],
+ fix: endBolts(1, -1, ["T"]),
+ tools: ["wrench", "flathead"],
pose: "-x",
warnings: ["floor"],
},
+ {
+ title: "Fit and bolt its other boards",
+ detail: "Dowels in the post and the lower boards, push the four boards on, then one barrel nut and bolt each.",
+ add: ids(1, lower),
+ fix: [...endDowels(1, -1, ["B2", "B3"], true), ...endDowels(1, -1, ["B5", "B4"], false), ...endBolts(1, -1, lower)],
+ tools: ["wrench", "hammer"],
+ },
{
title: "Bolt on its second post",
detail: "Dowels in the free ends, barrel nuts in the boards, six long bolts. Then stand both frames up.",
diff --git a/src/lib/plan/families/myllra.ts b/src/lib/plan/families/myllra.ts
index d78e419..723a4ff 100644
--- a/src/lib/plan/families/myllra.ts
+++ b/src/lib/plan/families/myllra.ts
@@ -191,7 +191,8 @@ function cot(s: ProductSpec): CustomParams {
add: ["C0", "E0"],
fix: endFix(-1),
tools: ["hammer"],
- from: { C0: [-300, 0, 0], E0: [-300, 0, 0] },
+ // the built end comes in on a slant, along its own dowels and onto the box's pins at once
+ from: { C0: [-300, 300, 0], E0: [-300, 300, 0] },
},
{
title: "Stand the box on its end on the end panel",
@@ -206,7 +207,7 @@ function cot(s: ProductSpec): CustomParams {
detail: "Pins, dowels and shell as before. Lay it on top so every pin and dowel finds its hole.",
add: ["C1", "E1"],
fix: endFix(1),
- from: { C1: [300, 0, 0], E1: [300, 0, 0] },
+ from: { C1: [300, 300, 0], E1: [300, 300, 0] },
},
{ title: "Lock this end", detail: "Four cam locks: two in the top boards and two in the bottom end board.", fix: endLock(1) },
{ title: "Screw in the legs", detail: "Four legs into the bottom end boards by hand, with a glide pushed into each foot.", add: ["LG0", "LG1", "LG2", "LG3"], fix: legFix },
@@ -217,6 +218,8 @@ function cot(s: ProductSpec): CustomParams {
detail: "Lay the drawer front face down on a rug. Four cam pins into it, a dowel in the front end of each side, then stand the sides on it.",
add: ["DF", "DS0", "DS1"],
fix: [...dfPins, ...dsDowels],
+ // the front first, then the sides pushed straight onto its pins
+ from: { DF: [0, 0, -250], DS0: [0, 0, -350], DS1: [0, 0, -350] },
warnings: ["floor"],
},
{ title: "Lock the sides to the front", detail: "Four small cam locks.", fix: frontCams },
@@ -315,8 +318,8 @@ function changingTable(): CustomParams {
});
const drawerIds = (k: string) => [0, 1].map((i) => `${k}${i}`);
const sides = ["DS00", "DS01", "DS10", "DS11"];
- // dowels and cam pins in the inside faces of the side panels, where the box's boards meet them
- const dowelSpots: [number, number][] = [[349, zb + 40], [349, zb + 110], [349, zf - 110], [349, zf - 40], [591, -200], [591, 100], [815, zb + 9]];
+ // dowels and cam pins in the inside faces of the side panels, where the box's boards meet them (none at the shelf: it slides in)
+ const dowelSpots: [number, number][] = [[349, zb + 40], [349, zb + 110], [349, zf - 110], [349, zf - 40], [349, -150], [349, 60], [815, zb + 9]];
const pinSpots: [number, number][] = [[840, zb + 9], [349, zb + 75], [349, zf - 75]];
const sidePts = (kind: CustomFix["kind"], spots: [number, number][], o: Partial<CustomFix>): CustomFix[] =>
[-1, 1].flatMap((g) => fx(kind, spots.map(([y, z]): [Vec3, Vec3] => [[g < 0 ? xl + T : xr - T, y, z], [g, 0, 0]]), { ...o, on: g < 0 ? "SL" : "SR" }));
@@ -347,7 +350,11 @@ function changingTable(): CustomParams {
{ title: "Lay the other side panel on top", detail: "Together, so every pin and dowel finds its hole." },
{ title: "Lock this side", detail: "Six double cam locks.", fix: [n("cam", 6, ["SR"], { ...CAM, name: "Double cam lock" })] },
{ title: "Turn it over and lock the first side", detail: "Together. Four cam locks.", fix: [n("cam", 4, ["SL"], CAM)], pose: "-x", people: 2, warnings: ["two"] },
- { title: "Stand it up and fit the shelf", detail: "Three dowels in its back edge, four shelf supports in the side panels, then slide it in from the front.", add: ["SH"], fix: [n("dowel", 3, ["SH"], D), n("pin", 4, ["SH"], { name: "Shelf support", len: 20, dia: 10 })], pose: "+y", from: { SH: [0, 0, 400] } },
+ { title: "Stand it up and fit the shelf", detail: "Three dowels in its back edge, four shelf supports in the side panels, then slide it in from the front.", add: ["SH"], fix: [
+ // the dowels stand out of its back edge, so it slides in along them; the supports go in the side panels under it
+ ...fx("dowel", [-250, 0, 250].map((x): [Vec3, Vec3] => [[40 + x, 591, zb + T], [0, 0, 1]]), { ...D, on: "SH" }),
+ ...[-1, 1].flatMap((g) => fx("pin", [zb + 80, zf - 80].map((z): [Vec3, Vec3] => [[g < 0 ? xl + T : xr - T, 578, z], [g, 0, 0]]), { name: "Shelf support", len: 20, dia: 10, on: g < 0 ? "SL" : "SR" })),
+ ], pose: "+y", from: { SH: [0, 0, 400] } },
{ title: "Dowel the changing top", detail: "Seven dowels and four cam pins in its edges.", fix: [n("dowel", 7, ["TP"], D), n("camScrew", 4, ["TP"], PIN)] },
{ title: "Lower the changing top on", detail: "Onto the left side panel and against the right one, overhanging on the left.", add: ["TP"], from: { TP: [0, 300, 0] } },
{ title: "Fix the top from underneath", detail: "Six screws up through the brackets inside the top of the carcass.", fix: [n("screw", 6, ["TP"], { len: 16, dia: 6 })], tools: ["screwdriver"] },
@@ -365,11 +372,33 @@ function changingTable(): CustomParams {
wall: true,
warnings: ["wall", "tip"],
},
- { title: "Dowel the frame of the pull-out board", detail: "Eight dowels join the four strips round the board.", add: ["PO"], fix: [n("dowel", 8, ["PO"], D)], from: { PO: [0, 0, 500] } },
+ {
+ title: "Dowel the frame of the pull-out board",
+ detail: "Eight dowels join the four strips round the board.",
+ add: ["PO"],
+ // two in each end of the side strips, into the front and back strips
+ fix: [px0 + 15, px1 - 15].flatMap((x) => fx("dowel", [609, 621].flatMap((y): [Vec3, Vec3][] => [[[x, y, pz0 + 30], [0, 0, 1]], [[x, y, zf + T - 30], [0, 0, -1]]]), { ...D, on: "PO" })),
+ from: { PO: [0, 0, 500] },
+ },
{ title: "Screw in its cam pins and lock it", detail: "Nine cam pins and nine small cam locks.", fix: [n("camScrew", 9, ["PO"], PIN), n("cam", 9, ["PO"], { dia: 12, name: "Small cam lock" })] },
{ title: "Screw the slides under the pull-out board", detail: "Three screws each side, then push it in on its runners.", fix: fx("screw", [-1, 1].flatMap((g) => [0.2, 0.5, 0.8].map((t): [Vec3, Vec3] => [[g < 0 ? px0 + 10 : px1 - 10, 603, pz0 + t * (zf - pz0)], [0, 1, 0]])), SCR), tools: ["screwdriver"] },
- { title: "Fit cam pins into the drawer fronts", detail: "Build both drawers the same way. Lay each front face down, four cam pins in it.", add: drawerIds("DF"), fix: [n("camScrew", 8, drawerIds("DF").concat(sides), PIN)], repeat: 2, warnings: ["floor"] },
- { title: "Tap dowels into the drawer sides and stand them on", detail: "Three dowels into the front end of each side, then press the sides onto the front.", add: sides, fix: [n("dowel", 12, sides, D)], repeat: 2 },
+ {
+ title: "Fit cam pins into the drawer fronts",
+ detail: "Build both drawers the same way. Lay each front face down, four cam pins in it.",
+ add: drawerIds("DF"),
+ fix: dr.flatMap((d, i) => fx("camScrew", [d.bx0 + 8, d.bx1 - 8].flatMap((x) => [d.by0 + 70, d.by1 - 70].map((y): [Vec3, Vec3] => [[x, y, zf], [0, 0, 1]])), { ...PIN, on: `DF${i}` })),
+ from: { DF0: [0, 0, 300], DF1: [0, 0, 300] },
+ repeat: 2,
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap dowels into the drawer sides and stand them on",
+ detail: "Three dowels into the front end of each side, then press the sides onto the front.",
+ add: sides,
+ fix: dr.flatMap((d, i) => [d.bx0 + 8, d.bx1 - 8].flatMap((x, j) => fx("dowel", [d.by0 + 30, (d.by0 + d.by1) / 2, d.by1 - 30].map((y): [Vec3, Vec3] => [[x, y, zf], [0, 0, -1]]), { ...D, on: `DS${i}${j}` }))),
+ from: Object.fromEntries(sides.map((id) => [id, [0, 0, -300] as Vec3])),
+ repeat: 2,
+ },
{ title: "Lock the sides to the fronts", detail: "Four small cam locks in each drawer.", fix: [n("cam", 8, sides, { dia: 12, name: "Small cam lock" })], repeat: 2 },
{ title: "Slide the bottoms in", detail: "Into the grooves, smooth side up.", add: drawerIds("DB"), repeat: 2 },
{ title: "Fit the backs with their connectors", detail: "Press each back on, then push four connectors through the sides into it and lock it with four small cam locks.", add: drawerIds("DK"), fix: [n("dowel", 8, drawerIds("DK"), { name: "Back connector", len: 40, dia: 8 }), n("cam", 8, drawerIds("DK"), { dia: 12, name: "Small cam lock" })], repeat: 2 },
@@ -378,8 +407,17 @@ function changingTable(): CustomParams {
{ title: "Screw on the knobs", detail: "One screw from the back of each front.", fix: fx("knob", dr.map((d): [Vec3, Vec3] => [[40, (d.y0 + d.y1) / 2, zf + T], [0, 0, -1]]), { dia: 45 }), tools: ["screwdriver"] },
{ title: "Screw the drawer stops to the backs", detail: "Two small screws in each drawer back.", fix: [n("screw", 4, drawerIds("DK"), { len: 12, dia: 4 })], tools: ["screwdriver"] },
{ title: "Hang the drawers on their runners", detail: "Pull the runners out, set each drawer on, push it home. Use the adjusters to even the gaps." },
- { title: "Screw cam pins into the guards", detail: "Six cam pins along the back guard and the end guard.", fix: [n("camScrew", 6, ["RB", "RL"], PIN)] },
- { title: "Fit the guards round the changing top", detail: "Back guard first, then the end guard and the front guard slid on from the side.", add: ["RB", "RL", "RF"] },
+ {
+ title: "Screw cam pins into the guards",
+ detail: "Six cam pins along the bottom edges of the back guard and the end guard.",
+ // the guards wait beside the cot until they go on
+ wait: ["RB", "RL"],
+ fix: [
+ ...fx("camScrew", spread(xt + 100, xr - T - 100, 4).map((x): [Vec3, Vec3] => [[x, rimY, zb + T / 2], [0, 1, 0]]), { ...PIN, on: "RB" }),
+ ...fx("camScrew", spread(zb + T + 100, zt - T - 100, 2).map((z): [Vec3, Vec3] => [[xt + T / 2, rimY, z], [0, 1, 0]]), { ...PIN, on: "RL" }),
+ ],
+ },
+ { title: "Fit the guards round the changing top", detail: "Back guard first, then the end guard and the front guard slid on from the side.", add: ["RB", "RL", "RF"], from: { RB: [0, 300, 0], RL: [0, 300, 0], RF: [-300, 0, 0] } },
{ title: "Lock the guards", detail: "Two cam locks and four double cam locks from inside.", fix: [n("cam", 2, ["RF"], CAM), n("cam", 4, ["RB", "RL"], { ...CAM, name: "Double cam lock" })] },
{
title: "Screw the connecting plates on",
diff --git a/src/lib/plan/families/nackanas.ts b/src/lib/plan/families/nackanas.ts
index 6be36b1..b63e50d 100644
--- a/src/lib/plan/families/nackanas.ts
+++ b/src/lib/plan/families/nackanas.ts
@@ -94,6 +94,8 @@ function recipe(s: ProductSpec): CustomParams {
title: "Bolt the aprons to the top",
detail: "Turn the base upside down onto the top. Four bolts with washers through each apron.",
add: ["TA", "TB"],
+ // joined, the two halves move as one
+ from: { TA: [0, 520, 0], TB: [0, 520, 0] },
fix: [-zA, zA].flatMap((z) => {
const pts = xs4.map((x): Vec3 => [x, yA - hA / 2, z]);
const on = z < 0 ? "A1" : "A2", mate = z < 0 ? "TB" : "TA";
diff --git a/src/lib/plan/families/nalmakare.ts b/src/lib/plan/families/nalmakare.ts
index 5f36c97..e0c489f 100644
--- a/src/lib/plan/families/nalmakare.ts
+++ b/src/lib/plan/families/nalmakare.ts
@@ -56,8 +56,9 @@ function recipe(s: ProductSpec): CustomParams {
const BOLT = { len: 12, dia: 6 };
const shelfBolts = (sx: number, ys: number[]): CustomFix[] =>
ys.map((y, i) => fx("bolt", [-1, 1].map((sz): Vec3 => [sx * (W / 2), y - TT / 2, sz * (zP - 40)]), [-sx, 0, 0], sx < 0 ? "F1" : "F2", { mate: `S${shelves.indexOf(y) + 1 || i + 1}`, ...BOLT }));
- const panelScrews = (id: string, y0: number, y1: number): CustomFix =>
- fx("screw", [y0, y1].flatMap((y) => [-1, 1].map((sx): Vec3 => [sx * (sw / 2 - 30), y, -D / 2 + 10])), [0, 0, 1], id, { len: 10, dia: 4 });
+ // the two panels share the middle shelf: the upper one's screws sit further in, clear of the lower one's
+ const panelScrews = (id: string, y0: number, y1: number, inset = 30): CustomFix =>
+ fx("screw", [y0, y1].flatMap((y) => [-1, 1].map((sx): Vec3 => [sx * (sw / 2 - inset), y, -D / 2 + 10])), [0, 0, 1], id, { len: 10, dia: 4 });
const steps: CustomStep[] = [
{
title: "Screw the castors into the side frames",
@@ -89,7 +90,7 @@ function recipe(s: ProductSpec): CustomParams {
add: ["B1"],
fix: [panelScrews("B1", shelves[0] - TT / 2, shelves[1] - TT / 2)],
},
- { title: "Screw on the upper back panel", detail: "Between the middle and top shelves, four screws.", add: ["B2"], fix: [panelScrews("B2", shelves[1] - TT / 2, shelves[2] - TT / 2)] },
+ { title: "Screw on the upper back panel", detail: "Between the middle and top shelves, four screws.", add: ["B2"], fix: [panelScrews("B2", shelves[1] - TT / 2, shelves[2] - TT / 2, 70)] },
{ title: "Stand it up", detail: "Tip it up onto its castors and lock two of them.", pose: "+y" },
{ title: "Hang the back door", detail: "Lift it into the inner groove under the middle shelf, then lower it into the track on the bottom shelf.", add: ["D2"], from: { D2: [0, 40, 260] } },
{ title: "Hang the front door", detail: "The same way, in the outer groove. Check both slide freely.", add: ["D1"], from: { D1: [0, 40, 260] } },
diff --git a/src/lib/plan/families/nammaro.ts b/src/lib/plan/families/nammaro.ts
index 09deb29..d112476 100644
--- a/src/lib/plan/families/nammaro.ts
+++ b/src/lib/plan/families/nammaro.ts
@@ -10,7 +10,7 @@ import { rotate } from "../math";
* on the long and round tables), rails or leg frames bolted on with barrel nuts, braces last, then turned over.
* Chairs, benches and the modular sofa start from their side frames. The reclining chair is built folded flat, lying
* on its back, then stood up and opened out. The folding chairs and the folding stool come ready assembled and have
- * no manual, so they keep their old guide.
+ * no manual: their guides only unfold them.
*/
type Kind = CustomFix["kind"];
@@ -352,7 +352,7 @@ function bench(s: ProductSpec): CustomParams {
{ title: "Lay the rails onto the dowels", detail: "One along each long edge, the marked side the same way.", add: ["C1", "C2"] },
{ title: "Screw the rails to the seat", detail: "Four screws through each rail.", fix: railScrews, tools: ["allen"] },
{ title: "Tap the long dowels into the rail ends", detail: "Two into each end.", fix: endDowels, tools: ["hammer"] },
- { title: "Push the leg frames onto the rail ends", detail: "One at each end, feet pointing up.", add: ["L1", "L2"] },
+ { title: "Push the leg frames onto the rail ends", detail: "One at each end, feet pointing up.", add: ["L1", "L2"], from: { L1: [-300, 0, 0], L2: [300, 0, 0] } },
{
title: "Bolt the two braces to the middle block",
detail: "The long bolt goes through one brace, the block and the other brace, then a washer and the nut. Leave it a little loose.",
@@ -402,7 +402,7 @@ function barStool(s: ProductSpec): CustomParams {
{ title: "Lay the two rails onto the dowels", detail: "Marked side the same way on both.", add: ["C1", "C2"] },
{ title: "Screw the rails to the seat", detail: "Two screws through each rail.", fix: [at("screw", zs.flatMap((sz) => [-60, 60].map((x) => [x, yS - rh, sz * lz] as Vec3)), [0, 1, 0], undefined, "S", SCREW)], tools: ["allen"] },
{ title: "Tap the long dowels into the rail ends", detail: "Two into one end of each rail.", fix: zs.map((sz) => at("dowel", [yS - 15, yS - 45].map((y) => [-(lx - lw / 2), y, sz * lz] as Vec3), [1, 0, 0], sz < 0 ? "C1" : "C2", undefined, { len: 40, dia: 8 })), tools: ["hammer"] },
- { title: "Push a leg frame onto the rail ends", detail: "Feet pointing up.", add: ["L1"] },
+ { title: "Push a leg frame onto the rail ends", detail: "Feet pointing up.", add: ["L1"], from: { L1: [-300, 0, 0] } },
{ title: "Bolt the leg frame to the rails", detail: "A barrel nut into each rail, then a bolt in through the leg.", fix: [nut(zs.map((sz) => [-(lx - 60), yS - rh, sz * lz] as Vec3)), bolt(-1, top(-1).map((p) => [p[0] - lw / 2, p[1], p[2]] as Vec3))], tools: ["allen", "flathead"] },
{ title: "Push the footrest into the leg frame", detail: "Its end hooks into the slot in the front leg.", add: ["F"] },
{ title: "Bolt the footrest on", detail: "One barrel nut and one bolt.", fix: [nut([[-(lx - 60), 244, lz]]), bolt(-1, [[-W / 2, 255, lz]])], tools: ["allen", "flathead"] },
@@ -790,6 +790,10 @@ function shelving(s: ProductSpec): CustomParams {
door("D1", -1),
door("D2", 1),
];
+ // screws into a slatted shelf go into a slat, not the gap beside it
+ const slatMids = (z0: number, z1: number) => slats(0, 1, z0, z1, 0, 1, Math.round((z1 - z0) / 58), "x", 10).map((p) => p.pos[2]);
+ const slatsB = slatMids(-iz, iz), slatsM = slatMids(-iz, iz - 30);
+ const snap = (z: number, mids: number[]) => mids.reduce((a, m) => (Math.abs(m - z) < Math.abs(a - z) ? m : a), mids[0]);
const angles = (y: number) => ([-1, 1] as const).flatMap((sx) => [-iz / 2, iz / 2].map((z) => [sx * ix, y, z] as Vec3));
const ends = ([-1, 1] as const).map((sx) => at("dowel", [-iz / 2, iz / 2].map((z) => [sx * ix, yb - 10, z] as Vec3), [-sx, 0, 0], "BS", sx < 0 ? "SL" : "SR", { len: 40, dia: 8 }));
const steps: CustomStep[] = [
@@ -804,13 +808,29 @@ function shelving(s: ProductSpec): CustomParams {
title: "Slide in the front rail with the catches",
detail: "Screw the two magnetic catches under it first, two screws each, then push it in along the front.",
add: ["FR"],
- fix: [at("clip", [-ix / 2, ix / 2].map((x) => [x, yc - 60, iz - 15] as Vec3), [0, 1, 0], "FR", undefined, { len: 30, dia: 15 }), at("screw", [-ix / 2 - 10, -ix / 2 + 10, ix / 2 - 10, ix / 2 + 10].map((x) => [x, yc - 62, iz - 15] as Vec3), [0, 1, 0], "FR", undefined, { len: 12, dia: 3.5 })],
+ fix: [at("clip", [-ix / 2, ix / 2].map((x) => [x, yc - 60, iz - 15] as Vec3), [0, 1, 0], "FR", undefined, { len: 30, dia: 15 }), at("screw", [-ix / 2 - 25, -ix / 2 + 25, ix / 2 - 25, ix / 2 + 25].map((x) => [x, yc - 62, iz - 15] as Vec3), [0, 1, 0], "FR", undefined, { len: 12, dia: 3.5 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the brackets to the shelves",
+ detail: "One screw through each of the eight brackets.",
+ fix: [
+ at("screw", angles(yb - 20).map((p) => [p[0] - Math.sign(p[0]) * 30, p[1], snap(p[2], slatsB)] as Vec3), [0, 1, 0], "BS", undefined, { len: 12, dia: 4 }),
+ at("screw", angles(yc - 20).map((p) => [p[0] - Math.sign(p[0]) * 30, p[1], snap(p[2], slatsM)] as Vec3), [0, 1, 0], "MS", undefined, { len: 12, dia: 4 }),
+ ],
tools: ["screwdriver"],
},
- { title: "Screw the brackets to the shelves", detail: "One screw through each of the eight brackets.", fix: [at("screw", [...angles(yb - 20), ...angles(yc - 20)].map((p) => [p[0] - Math.sign(p[0]) * 20, p[1], p[2]] as Vec3), [0, 1, 0], undefined, undefined, { len: 12, dia: 4 })], tools: ["screwdriver"] },
{ title: "Tighten the back panel bolts", detail: "All four, now that the shelves hold it square.", tools: ["allen"], check: "square" },
{ title: "Fit the small brackets at the back", detail: "One in each corner where the back panel meets a shelf, screwed to the back panel.", fix: [at("angle", [-1, 1].flatMap((sx) => [yb + 20, yc - 60].map((y) => [sx * (ix - 60), y, -D / 2 + 24] as Vec3)), [0, 0, -1], "BP", undefined, { len: 24, dia: 20 }), at("screw", [-1, 1].flatMap((sx) => [yb + 30, yc - 70].map((y) => [sx * (ix - 60), y, -D / 2 + 26] as Vec3)), [0, 0, -1], "BP", undefined, { len: 12, dia: 4 })], tools: ["screwdriver"] },
- { title: "Screw the small brackets to the shelves", detail: "One more screw in each.", fix: [at("screw", [-1, 1].flatMap((sx) => [yb, yc - 20].map((y) => [sx * (ix - 60), y, -D / 2 + 40] as Vec3)), [0, 1, 0], undefined, undefined, { len: 12, dia: 4 })], tools: ["screwdriver"] },
+ {
+ title: "Screw the small brackets to the shelves",
+ detail: "One more screw in each.",
+ fix: [
+ at("screw", [-1, 1].map((sx) => [sx * (ix - 60), yb, snap(-D / 2 + 40, slatsB)] as Vec3), [0, -1, 0], "BS", undefined, { len: 12, dia: 4 }),
+ at("screw", [-1, 1].map((sx) => [sx * (ix - 60), yc - 20, snap(-D / 2 + 40, slatsM)] as Vec3), [0, 1, 0], "MS", undefined, { len: 12, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ },
{
title: "Turn it over and bolt the top shelf on",
detail: "Stand it on its feet. Dowels into the top rails' ends, a barrel nut into each rail, then a long bolt in through each post.",
@@ -877,7 +897,7 @@ function backSlatsAt(y0: number, y1: number, n: number, gap = 22): [number, numb
}
/** One seat section, upside down on a rug as its manual builds it, then any more the same way. */
-function section(id: string, ox: number, Ws: number, D: number, deep: boolean, first: boolean) {
+function section(id: string, ox: number, Ws: number, D: number, deep: boolean, first: boolean, sx0: -1 | 1 = 1, k = 0) {
const zf0 = -D / 2 + LW, zf1 = D / 2, zm = (zf0 + zf1) / 2;
const hw = Ws / 2;
const X = (x: number) => ox + x;
@@ -915,12 +935,14 @@ function section(id: string, ox: number, Ws: number, D: number, deep: boolean, f
const railScrews = at("screw", rz.flatMap((z, i) => (i === 1 && deep ? [-0.6, -0.2, 0.2, 0.6] : [-0.6, 0, 0.6]).map((t) => [X(t * hw), RT, z] as Vec3)), [0, 1, 0], undefined, undefined, SCREW);
const ends = (sx: -1 | 1) => rz.flatMap((z, i) => [RT + 18, YS - 45].map((y) => [X(sx * (hw - (deep && i === 1 ? 28 : LW))), y, z] as Vec3));
const longDowels = ([-1, 1] as const).map((sx) => at("dowel", ends(sx), [-sx, 0, 0], undefined, undefined, { len: 40, dia: 8 }));
- const sideScrews = (sx: -1 | 1) => at("screw", (deep ? [-0.6, -0.2, 0.2, 0.6] : [-0.5, 0, 0.5]).map((t) => [X(sx * (hw - 14)), RT, zm + (t * (zf1 - zf0 - 2 * LW))] as Vec3), [0, 1, 0], sx < 0 ? `${id}L` : `${id}R`, undefined, SCREW);
+ const sideScrews = (sx: -1 | 1) => at("screw", (deep ? [-0.6, -0.2, 0.2, 0.6] : [-0.5, 0, 0.5]).map((t) => [X(sx * (hw - 14)), RT, zm + (t * (zf1 - zf0 - 2 * LW)) / 2] as Vec3), [0, 1, 0], sx < 0 ? `${id}L` : `${id}R`, undefined, SCREW);
const nutsAt = (sx: -1 | 1, zs: number[], y: number) => at("nut", zs.map((z) => [X(sx * (hw - 85)), y, z] as Vec3), [0, 1, 0], undefined, undefined, BARREL);
const boltsAt = (sx: -1 | 1, zs: number[], y: number) => at("bolt", zs.map((z) => [X(sx * hw), y, z] as Vec3), [-sx, 0, 0], sx < 0 ? `${id}L` : `${id}R`, undefined, BOLT);
const lowZ = [zf1 - 22, zf0 + 22];
- const tops = (sx: -1 | 1): CustomFix[] => [nutsAt(sx, rz, RT), boltsAt(sx, rz, (RT + YS - 25) / 2)];
- const lows = (sx: -1 | 1): CustomFix[] => [nutsAt(sx, lowZ, 60), boltsAt(sx, lowZ, 85)];
+ // every other section's bolts sit a little higher, so their heads don't land on its neighbour's at the join
+ const topY = (RT + YS - 25) / 2 + (k % 2) * 23, lowY = 78 + (k % 2) * 23;
+ const tops = (sx: -1 | 1): CustomFix[] => [nutsAt(sx, rz, RT), boltsAt(sx, rz, topY)];
+ const lows = (sx: -1 | 1): CustomFix[] => [nutsAt(sx, lowZ, 60), boltsAt(sx, lowZ, lowY)];
const nb = deep ? 10 : 8;
const steps: CustomStep[] = first
@@ -934,12 +956,12 @@ function section(id: string, ox: number, Ws: number, D: number, deep: boolean, f
{ title: deep ? "Lay the three rails onto the dowels" : "Lay the two rails onto the dowels", detail: "The marked side of each rail faces the same way.", add: [`${id}F`, `${id}B`, ...(deep ? [`${id}M`] : [])] },
{ title: "Screw the rails to the seat", detail: `${deep ? "Ten" : "Six"} screws, turned in with the Allen key.`, fix: [railScrews], tools: ["allen"] },
{ title: "Tap the long dowels into the rail ends", detail: "Two into each end.", fix: longDowels, tools: ["hammer"] },
- { title: "Push a side frame onto the rail ends", detail: "Legs pointing up, onto the dowels.", add: [`${id}L`] },
+ { title: "Push a side frame onto the rail ends", detail: "Legs pointing up, onto the dowels.", add: [`${id}L`], from: { [`${id}L`]: [-300, 0, 0] } },
{ title: "Screw the side frame to the seat", detail: `${deep ? "Four" : "Three"} screws up through its top rail.`, fix: [sideScrews(-1)], tools: ["allen"] },
{ title: "Bolt the side frame to the rails", detail: "A barrel nut into each rail, slot towards the leg, then a bolt in through the frame. Not fully tight yet.", fix: tops(-1), tools: ["allen", "flathead"] },
{ title: "Push the two stretchers into the side frame", detail: "Low down, between the legs at the front and the back.", add: [`${id}X1`, `${id}X2`] },
{ title: "Bolt the stretchers on", detail: "A barrel nut into each, then a bolt through the leg.", fix: lows(-1), tools: ["allen", "flathead"] },
- { title: "Push the other side frame on", detail: "Onto the rail and stretcher ends.", add: [`${id}R`] },
+ { title: "Push the other side frame on", detail: "Onto the rail and stretcher ends.", add: [`${id}R`], from: { [`${id}R`]: [300, 0, 0] } },
{ title: "Screw it to the seat", detail: "Up through its top rail, the same as the first.", fix: [sideScrews(1)], tools: ["allen"] },
{ title: "Bolt it to the rails and stretchers", detail: "Barrel nuts first, then the bolts.", fix: [...tops(1), ...lows(1)], tools: ["allen", "flathead"] },
{ title: "Turn the section over and tighten the bolts", detail: `Stand it on its legs, then tighten all ${nb} bolts.`, pose: "+y", tools: ["allen"], check: "square" },
@@ -949,8 +971,10 @@ function section(id: string, ox: number, Ws: number, D: number, deep: boolean, f
title: "Build the next seat section the same way",
detail: "Face down on the rug: dowels, rails and screws, the side frames and stretchers bolted on, then turned over and tightened.",
add: [...seatIds, `${id}F`, `${id}B`, ...(deep ? [`${id}M`] : []), `${id}L`, `${id}X1`, `${id}X2`, `${id}R`],
- fix: [...pins, shortDowels, { ...railScrews, at: [...railScrews.at!, ...sideScrews(-1).at!, ...sideScrews(1).at!], count: 0 }, ...longDowels, { ...nutsAt(-1, rz, RT), at: [...([-1, 1] as const).flatMap((sx) => [...nutsAt(sx, rz, RT).at!, ...nutsAt(sx, lowZ, 60).at!])] }, ...([-1, 1] as const).map((sx) => ({ ...boltsAt(sx, rz, 0), at: [...boltsAt(sx, rz, (RT + YS - 25) / 2).at!, ...boltsAt(sx, lowZ, 85).at!], on: undefined }))],
+ fix: [...pins, shortDowels, { ...railScrews, at: [...railScrews.at!, ...sideScrews(-1).at!, ...sideScrews(1).at!], count: 0 }, ...longDowels, { ...nutsAt(-1, rz, RT), at: [...([-1, 1] as const).flatMap((sx) => [...nutsAt(sx, rz, RT).at!, ...nutsAt(sx, lowZ, 60).at!])] }, ...([-1, 1] as const).map((sx) => ({ ...boltsAt(sx, rz, 0), at: [...boltsAt(sx, rz, topY).at!, ...boltsAt(sx, lowZ, lowY).at!] }))],
tools: ["allen", "hammer", "flathead"],
+ // it arrives built, in one piece, beside the section before it
+ from: Object.fromEntries([...seatIds, `${id}F`, `${id}B`, ...(deep ? [`${id}M`] : []), `${id}L`, `${id}X1`, `${id}X2`, `${id}R`].map((k) => [k, [sx0 * Math.max(350, Ws * 0.7), 0, 0] as Vec3])),
},
];
for (const st of steps) for (const f of st.fix ?? []) f.count = f.at!.length;
@@ -999,7 +1023,8 @@ function armrest(id: string, x: number, sx: -1 | 1, zf0: number, zf1: number, Hb
detail: "Built like the backs, then hooked onto the side of the seat with its posts beside the legs, and screwed on.",
add: [panel.id, posts[0].id, posts[1].id],
fix: [
- ...[0, 1].map((i) => at("bolt", [YS + 80, Hb - 80].map((y) => [xo + LW / 2, y, i ? zf1 : zf0] as Vec3), [0, 0, i ? -1 : 1], `${id}${i ? "Z" : "A"}`, `${id}P`, { len: 50, dia: 6 })),
+ // into the ends of the lowest and the highest slat
+ ...[0, 1].map((i) => at("bolt", [backSlats(n, Hb)[0], backSlats(n, Hb)[n - 1]].map(([y0, y1]) => [slatX0 + 10, (y0 + y1) / 2, i ? zf1 : zf0] as Vec3), [0, 0, i ? -1 : 1], `${id}${i ? "Z" : "A"}`, `${id}P`, { len: 50, dia: 6 })),
at("hook", [-0.5, 0.5].map((t) => [x, YS, (zf0 + zf1) / 2 + t * (zf1 - zf0) * 0.5] as Vec3), [0, -1, 0], undefined, undefined, { len: 40, dia: 30 }),
at("screw", [zf0 + LW / 2, zf1 - LW / 2].map((z) => [sx > 0 ? xo + LW : xo, 160, z] as Vec3), [-sx, 0, 0], undefined, undefined, { len: 70, dia: 5 }),
at("screw", [-0.5, 0.5].map((t) => [x - sx * 18, YS + 2, (zf0 + zf1) / 2 + t * (zf1 - zf0) * 0.5] as Vec3), [0, -1, 0], undefined, undefined, { len: 16, dia: 4 }),
@@ -1024,7 +1049,7 @@ function sofa(s: ProductSpec, o: Sofa): CustomParams {
const order = [...mods.filter((m) => m.back), ...mods.filter((m) => !m.back)];
let zf0 = 0, zf1 = 0;
order.forEach((m, i) => {
- const r = section(m.id, m.ox, Ws, D, o.deep, i === 0);
+ const r = section(m.id, m.ox, Ws, D, o.deep, i === 0, m.ox >= order[0].ox ? 1 : -1, i);
parts.push(...r.parts);
steps.push(...r.steps);
zf0 = r.zf0;
@@ -1271,6 +1296,50 @@ function recliner(b: PlanBuilder, s: ProductSpec) {
});
}
+/* ---------- the folding chair and stool, sold assembled ---------- */
+
+/** The folding chair comes assembled (its page has no manual): unfold it, press the seat down, and the cushion goes on. */
+function foldingChair(s: ProductSpec, cushion: boolean): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const yS = 450, xb = W / 2 - 20, xf = xb - 30;
+ const frame = group("F", "Chair frame", [
+ ...[-1, 1].map((sx) => ({ ...strut([sx * xb, 0, -D / 2 + 60], [sx * xb, H, -D / 2 + 20], 40, 22, "x"), size: [40, 22, Math.hypot(H, 40)] as Vec3 })),
+ ...[-1, 1].map((sx) => strut([sx * xf, 0, D / 2 - 30], [sx * xf, yS - 20, -D / 2 + 90], 22, 40, "x")),
+ box(-xb + 20, xb - 20, H - 150, H - 70, -D / 2 + 22, -D / 2 + 42),
+ box(-xb + 20, xb - 20, H - 260, H - 190, -D / 2 + 26, -D / 2 + 46),
+ box(-xf + 11, xf - 11, 90, 130, D / 2 - 60, D / 2 - 40),
+ box(-xb + 20, xb - 20, 90, 130, -D / 2 + 50, -D / 2 + 70),
+ ]);
+ const seat = group("S", "Seat", slats(-xf + 11, xf - 11, -D / 2 + 70, D / 2 - 20, yS - 22, yS, 7, "x", 8));
+ const parts: CustomPart[] = [frame, seat];
+ if (cushion) parts.push({ id: "C", name: "Seat cushion", size: [W - 80, 40, D - 100], pos: [0, yS + 20, 15], material: "soft" });
+ const steps: CustomStep[] = [
+ { title: "Take the folded chair out of the box", detail: "It comes assembled, with nothing to screw together. Stand it on its feet, still folded.", add: ["F"], from: { F: [0, 300, 0] } },
+ { title: "Unfold it and press the seat down", detail: "Pull the back and the front legs apart, then push the seat down until it lies flat on its rails.", add: ["S"], from: { S: [0, 260, -200] } },
+ ...(cushion ? [{ title: "Tie the cushion on", detail: "Lay it on the seat and tie its straps round the back legs.", add: ["C"] }] : []),
+ { title: "Check it stands steady", detail: "All four feet should touch the floor. To fold it, lift the front edge of the seat. Keep it dry and indoors over winter." },
+ ];
+ return { parts, steps };
+}
+
+/** The folding stool comes assembled too: two leg frames crossed on a pin, the slatted seat hinged on top. */
+function foldingStool(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const yS = H - 22, x0 = W / 2 - 22, x1 = x0 - 26;
+ const legs = (id: string, x: number, flip: -1 | 1) =>
+ group(id, "Leg frame", [
+ ...[-1, 1].map((sx) => strut([sx * x, 0, flip * (D / 2 - 30)], [sx * x, yS - 10, -flip * (D / 2 - 40)], 40, 24, "x")),
+ box(-x + 12, x - 12, 30, 70, flip * (D / 2 - 40) - 12, flip * (D / 2 - 40) + 12),
+ ]);
+ const seat = group("S", "Seat", [box(-W / 2, -W / 2 + 22, yS - 40, yS, -D / 2, D / 2), box(W / 2 - 22, W / 2, yS - 40, yS, -D / 2, D / 2), ...slats(-W / 2 + 22, W / 2 - 22, -D / 2, D / 2, yS, H, 6, "z", 8)]);
+ const parts: CustomPart[] = [legs("A", x0, 1), legs("B", x1, -1), seat];
+ const steps: CustomStep[] = [
+ { title: "Take the folded stool out of the box", detail: "It comes assembled, with nothing to screw together. Hold it by the seat, legs down.", add: ["A", "B", "S"], from: { A: [0, 300, 0], B: [0, 300, 0], S: [0, 300, 0] } },
+ { title: "Open the legs", detail: "Let the two leg frames swing apart until the seat lies flat and they stand on the floor. To fold it, lift the seat by one edge." },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["NÄMMARÖ"],
build(b, s) {
@@ -1280,6 +1349,9 @@ const family: Family = {
},
recipe(s) {
const slug = s.slug ?? "";
+ if (/^nammaro-chair-outdoor$/.test(slug)) return foldingChair(s, false);
+ if (/^nammaro-chair$/.test(slug)) return foldingChair(s, true);
+ if (/^nammaro-stool-outdoor/.test(slug)) return foldingStool(s);
if (/^nammaro-table-outdoor-(140|200)/.test(slug)) return longTable(s);
if (/^nammaro-table-outdoor-75/.test(slug)) return smallTable(s);
if (/^nammaro-table-outdoor-130/.test(slug)) return roundTable(s);
diff --git a/src/lib/plan/families/nasinge.ts b/src/lib/plan/families/nasinge.ts
index 54823fb..b7fa7c3 100644
--- a/src/lib/plan/families/nasinge.ts
+++ b/src/lib/plan/families/nasinge.ts
@@ -164,6 +164,7 @@ function table(o: TableOpts): CustomParams {
title: "Lay the two top halves face down and push them together",
detail: "On a rug. Six dowels in the edge of one half, into the holes in the other, until the join closes.",
add: ["TB", "TF"],
+ from: { TB: [0, 300, 0], TF: [0, 300, 0] },
pose: "-y",
warnings: ["floor"],
fix: [fx("dowel", [-400, -240, -80, 80, 240, 400].map((x) => [x, H - TOPT / 2, 0] as Vec3), [0, 0, -1], { on: "TB", mate: "TF" })],
@@ -259,7 +260,7 @@ function chair(s: ProductSpec): CustomParams {
const rail = (sx: number) => (sx < 0 ? "RL" : "RR");
// the long bolts sit in a window near each end of the side rail and go out through its end into the leg
const boltsAt = (z: number): Vec3[] => G.map((sx) => [sx * xr, yb, z]);
- const backWin = zb + L / 2 + 40, frontWin = zf - L / 2 - 40;
+ const backWin = zb + BOLT.len - 5, frontWin = zf - BOLT.len + 5; // windows where the bolt tips reach the barrel nuts
const barrels = (z: number): Vec3[] => G.map((sx) => [sx * (xl - L / 2), yb, z]);
const brackets = (z: number, dz: number): Vec3[] => G.map((sx) => [sx * 90, yRail - 25, z + dz]);
const backBr = brackets(zb + L / 2, 6), frontBr = brackets(zf - L / 2, -6);
@@ -296,8 +297,7 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Fit the front frame's brackets, barrel nuts and bolts",
detail: "Two seat brackets screwed inside its rail, a barrel nut in each front leg and a long bolt turned into each, as on the back.",
- add: ["FF"],
- from: { FF: [0, 0, 320] },
+ wait: ["FF"],
fix: [
fx("angle", frontBr, [0, 0, 1], { ...SEATB, on: "FF" }),
fx("screw", frontBr, [0, 0, 1], { ...WOOD, on: "FF" }),
@@ -306,7 +306,7 @@ function chair(s: ProductSpec): CustomParams {
],
tools: ["screwdriver", "flathead"],
},
- { title: "Press the front frame down onto the side rails", detail: "Its bolt heads drop into the windows at the front ends of the rails." },
+ { title: "Press the front frame down onto the side rails", detail: "Its bolt heads drop into the windows at the front ends of the rails.", add: ["FF"], from: { FF: [0, 0, 320] } },
{
title: "Turn the chair upside down and tighten the front bolts",
detail: "Rest the seat on a table edge. A curved washer under each bolt head, then tighten with the Allen key.",
@@ -389,10 +389,11 @@ function extendable(): CustomParams {
{
title: "Screw a corner bracket onto each end of the long rails",
detail: "Lay the two long rails on a rug, inside face up. Two screws through each bracket.",
- add: ["LB", "LF"],
+ // the long rails take their fittings lying beside the build and are folded onto the inner frame later
+ wait: ["LB", "LF"],
pose: "-y",
warnings: ["floor"],
- fix: [...G.flatMap((sx) => G.map((sz) => fx("angle", [corner(sx, sz)], diag(sx, sz), { ...CORNER }))), ...G.map((sz) => fx("screw", onLong(sz).filter((_, i) => i % 2 === 0).flatMap((p) => [p, [p[0], p[1] + 40, p[2]] as Vec3]), [0, 0, sz], { ...BSCREW, on: long(sz) }))],
+ fix: [...G.flatMap((sx) => G.map((sz) => fx("angle", [corner(sx, sz)], diag(sx, sz), { ...CORNER, on: long(sz) }))), ...G.map((sz) => fx("screw", onLong(sz).filter((_, i) => i % 2 === 0).flatMap((p) => [[p[0], p[1], sz * (zr - RT / 2 - 3)], [p[0], p[1] + 40, sz * (zr - RT / 2 - 3)]] as Vec3[]), [0, 0, sz], { ...BSCREW, on: long(sz) }))],
tools: ["screwdriver"],
},
{
@@ -414,17 +415,17 @@ function extendable(): CustomParams {
tools: ["screwdriver"],
},
{
- title: "Join the inner frame with eight dowels",
- detail: "Two dowels in each end of the two inner rails, pushed into the two cross rails.",
- add: ["CL", "CR", "IB", "IF"],
+ title: "Tap eight dowels into the inner rails",
+ detail: "Two in each end of the two short inner rails, by hand.",
fix: G.flatMap((sx) => G.map((sz) => fx("dowel", [-12, 12].map((dy) => [sx * (xc - RT / 2), yH + dy, sz * zi] as Vec3), [-sx, 0, 0], { on: sz < 0 ? "IB" : "IF", mate: sx < 0 ? "CL" : "CR" }))),
},
+ { title: "Push the cross rails onto the dowels", detail: "One at each end of the inner rails, pressed on until the joints close.", add: ["CL", "CR"] },
{
title: "Tap a dowel into each end of the cross rails",
detail: "Four dowels, one in each end.",
fix: G.flatMap((sx) => G.map((sz) => fx("dowel", [[sx * xc, yH + 15, sz * (zr - RT / 2)]], [0, 0, -sz], { on: sx < 0 ? "CL" : "CR", mate: long(sz) }))),
},
- { title: "Fold the long rails up onto the inner frame", detail: "The dowels and connector bolts go into the holes in the cross rail ends. The holes for the runners face away from the brackets." },
+ { title: "Fold the long rails up onto the inner frame", detail: "The dowels and connector bolts go into the holes in the cross rail ends. The holes for the runners face away from the brackets.", add: ["LB", "LF"] },
{
title: "Lock the cross rails with four cam locks",
detail: "One near each end of the cross rails, arrow towards the bolt, turned clockwise until it grips.",
@@ -442,7 +443,7 @@ function extendable(): CustomParams {
title: "Screw the end rails onto the corner brackets",
detail: "Two screws through each bracket into the end rail, then turn the frame over.",
add: ["SR"],
- fix: G.map((sx) => fx("screw", onEnd(sx), [sx, 0, 0], { ...BSCREW, on: sx < 0 ? "SL" : "SR" })),
+ fix: G.map((sx) => fx("screw", onEnd(sx).map((p) => [sx * (xr - RT / 2 - 3), p[1], p[2]] as Vec3), [sx, 0, 0], { ...BSCREW, on: sx < 0 ? "SL" : "SR" })),
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/neiden.ts b/src/lib/plan/families/neiden.ts
index 3a41aae..a3fa01b 100644
--- a/src/lib/plan/families/neiden.ts
+++ b/src/lib/plan/families/neiden.ts
@@ -94,7 +94,7 @@ function recipe(s: ProductSpec) {
const legDowels: CustomFix[] = sides.flatMap((sx) =>
[-1, 1].map((sz): CustomFix => ({ ...DOWEL_S, count: 2, at: [235, 285].map((y): Vec3 => [sx * xl, y, sz < 0 ? zh + LZ / 2 : zf - LZ / 2]), dir: [0, 0, -sz] as Vec3, on: sz < 0 ? `HL${sx}` : `FL${sx}` })),
);
- const blockScrews: CustomFix[] = sides.flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 30, dia: 7, at: [[sx * xl, 260, sz < 0 ? zh + LZ / 2 + 30 : zf - LZ / 2 - 30]], dir: [0, 0, -sz] as Vec3, on: `BK${sx}${sz}` })));
+ const blockScrews: CustomFix[] = sides.flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 30, dia: 7, at: [[sx * xl, 260, bz(sz) - sz * 15]], dir: [0, 0, sz] as Vec3, on: `BK${sx}${sz}` })));
const legScrews: CustomFix[] = sides.flatMap((sx) =>
[
{ on: `HL${sx}`, ys: [H - 65, H - 25], z: zh },
diff --git a/src/lib/plan/families/nordkisa.ts b/src/lib/plan/families/nordkisa.ts
index efa4733..097aa2f 100644
--- a/src/lib/plan/families/nordkisa.ts
+++ b/src/lib/plan/families/nordkisa.ts
@@ -44,7 +44,7 @@ function drawer(W: number, H: number, D: number, x0: number, y0: number): { part
{ id: "DB", name: "Drawer bottom", size: [W - 2 * t, 5, D - 2 * t], pos: [x0, y0 + 12, 0], material: "fiber" },
];
const screws = (side: number, end: number) =>
- at("screw", [y0 + 30, y0 + H - 30].map((y): Vec3 => [x0 + side * (W / 2), y, end * ze]), [-side, 0, 0], side < 0 ? "DS1" : "DS2", end < 0 ? "DE1" : "DE2", { len: 16, dia: 4 });
+ at("screw", [y0 + 30, y0 + H - 45].map((y): Vec3 => [x0 + side * (W / 2), y, end * ze]), [-side, 0, 0], side < 0 ? "DS1" : "DS2", end < 0 ? "DE1" : "DE2", { len: 16, dia: 4 });
const steps: CustomStep[] = [
{
title: "Screw a drawer side to one end",
@@ -175,7 +175,7 @@ function dressingTable(): CustomParams {
{
title: "Screw the shelf to the back and divider",
detail: "Four long screws through the shelf, two into each board.",
- fix: [at("bolt", [-200, -100].map((x): Vec3 => [x, yS0, zB]), [0, 1, 0], "S", "B", BOLT), at("bolt", [-120, 120].map((z): Vec3 => [xd, yS0, z]), [0, 1, 0], "S", "V", BOLT)],
+ fix: [at("bolt", [-200, -100].map((x): Vec3 => [x, yS0, zB]), [0, 1, 0], "S", "B", BOLT), at("bolt", [-50, 50].map((z): Vec3 => [xd, yS0, z]), [0, 1, 0], "S", "V", BOLT)],
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/nordli.ts b/src/lib/plan/families/nordli.ts
index 0d2195e..191f624 100644
--- a/src/lib/plan/families/nordli.ts
+++ b/src/lib/plan/families/nordli.ts
@@ -352,16 +352,16 @@ function build(b: PlanBuilder, s: ProductSpec, L: Layout) {
title: "Push the cam locks into both sides",
detail: "Lay the sides on a rug, inside faces up. Two cams go into each, near the bottom end, arrows pointing at the edge." + kindWords,
kind: "cams",
+ pose: "+x",
warnings: ["floor"],
},
() => {
b.stagger(0.2);
- shown.forEach((m, i) =>
- G.forEach((g) => {
- const k = sideOf(m, g);
- b.stage(k, [g * (m.spec.h / 2 + 40), T / 2, (ZF + ZB) / 2 + zOff(i)], [0, 0, -g * (Math.PI / 2)], [0, 160, 0]);
- }),
- );
+ // the left side lies where the frame is built, the right one beside it, both inside face up (the frame lies on its left side)
+ shown.forEach((m, i) => {
+ b.stage(m.sides[0], rel(m, i, m.sides[0]), [0, 0, 0], [160, 0, 0]);
+ b.stage(m.sides[1], [T / 2, m.spec.h / 2, (ZF + ZB) / 2 + zOff(i) + 640], [0, 0, Math.PI], [160, 0, 0]);
+ });
b.then(0.15);
ff.forEach((f) => b.fits(CAM, f.lowCams, 0.08));
},
@@ -372,6 +372,8 @@ function build(b: PlanBuilder, s: ProductSpec, L: Layout) {
detail: "Runners marked L go on the left side and R on the right, the wheel end to the front. Two screws hold each one.",
tools: ["screwdriver"],
kind: "runners",
+
+ pose: "+x",
},
() => {
ff.forEach((f) => b.fits(RUNNER, f.runners, 0.15));
@@ -385,6 +387,8 @@ function build(b: PlanBuilder, s: ProductSpec, L: Layout) {
detail: "Two in each side, in the holes along the back edge. Turn them in by hand until they stop.",
tools: ["screwdriver"],
kind: "cams",
+
+ pose: "+x",
},
() => ff.forEach((f) => b.fits(BOLT, f.backBolts, 0.08)),
);
@@ -398,12 +402,6 @@ function build(b: PlanBuilder, s: ProductSpec, L: Layout) {
},
() => {
b.stagger(0.2);
- shown.forEach((m, i) => {
- b.stage(m.sides[0], rel(m, i, m.sides[0]), [0, 0, 0]);
- // the other side waits on the floor beside it, inside face up
- b.stage(m.sides[1], [T / 2, m.spec.h / 2, (ZF + ZB) / 2 + zOff(i) + 640], [0, 0, Math.PI]);
- });
- b.then(0.15);
shown.forEach((m, i) => m.backs.forEach((k) => b.stage(k, rel(m, i, k), [0, 0, 0], [300, 0, 0])));
b.then(0.15);
ff.forEach((f) => b.fits(DOWEL, f.dowels, 0.06));
@@ -942,7 +940,8 @@ function buildBed(b: PlanBuilder, W: number) {
const xc = bb.g * (W / 2 - 20 - B_RUNNER.len / 2);
return {
runner: { on: k, at: [xc, BY1 + 22, z], dir: [0, 0, sgn], twist: Math.PI / 2, hole: false } as FitOpts,
- screws: [-180, 180].map((dx): FitOpts => ({ on: k, at: [xc + dx, BY1 + 22, z + -sgn * 11], dir: [0, 0, sgn] })),
+ // both screws go where the short dividers are, near the front edge
+ screws: [W / 2 - 60, W / 2 - 260].map((x): FitOpts => ({ on: k, at: [bb.g * x, BY1 + 22, z - sgn * 4], dir: [0, 0, sgn] })),
};
};
const topDowels = each((g, e) => topDowelX(g).map((x): FitOpts => ({ on: ends[endOf(e)], at: [x, topY, zEndMid(e)], dir: [0, -1, 0], mate: tops[sideOf(g)] })));
@@ -983,14 +982,13 @@ function buildBed(b: PlanBuilder, W: number) {
b.then(0.15);
b.fits(B_FOOT, feet, 0.05);
});
- bstep({ title: "Tap the dowels into the crosspieces", detail: "Turn the long boards over onto their feet. Two dowels go into each end of both crosspieces: use the thick short dowels.", tools: ["hammer"], kind: "dowels" }, () => {
+ bstep({ title: "Turn the long boards over and lay the crosspieces between them", detail: "The boards stand on their feet now. Leave a gap so the crosspieces can take their dowels.", kind: "general" }, () => {
b.stagger(0.2);
G.forEach((g) => b.stage(bases[sideOf(g)], [g * (W / 2 - BASE_W / 2 + 200), BFOOT + BT / 2, 0], [0, 0, 0]));
b.then(0.1);
G.forEach((e) => b.add(cross[endOf(e)], [0, 160, 0]));
- b.then(0.15);
- b.fits(B_DOWEL, jointDowels, 0.06);
});
+ bstep({ title: "Tap the dowels into the crosspieces", detail: "Two dowels go into each end of both crosspieces: use the thick short dowels.", tools: ["hammer"], kind: "dowels" }, () => b.fits(B_DOWEL, jointDowels, 0.06));
bstep({ title: "Push the connecting bolts into the crosspieces", detail: "Two in each end, beside the dowels. Push them in until the collar sits on the edge.", kind: "cams" }, () => b.fits(B_CONNECT, jointBolts, 0.06));
bstep({ title: "Push the long boards onto the crosspieces", detail: "Slide each long board onto the dowels and bolts until the joints close.", kind: "join" }, () => {
b.stagger(0.2);
@@ -1002,7 +1000,7 @@ function buildBed(b: PlanBuilder, W: number) {
b.stagger(0.15);
each((g, e) => [divs[sideOf(g)][endOf(e)]]).forEach((k, i) => {
const g = i < 2 ? -1 : 1, e = i % 2 ? 1 : -1;
- b.stage(k, [g * (W / 2 + 260), DIV_T / 2, e * zDiv * 1.4], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.stage(k, [g * (W / 2 + 260), DIV_T / 2, e * zDiv * 1.4], [Math.PI / 2, 0, 0]);
});
b.then(0.15);
b.fits(B_DOWEL, divDowels, 0.05);
diff --git a/src/lib/plan/families/nordviken.ts b/src/lib/plan/families/nordviken.ts
index 491c17e..4690a8a 100644
--- a/src/lib/plan/families/nordviken.ts
+++ b/src/lib/plan/families/nordviken.ts
@@ -167,20 +167,24 @@ function cornerBrackets(f: LegFrame, gx: number, screws: number): CustomFix[] {
}
/** A barrel nut in the top of each leg, two threaded rods through its inside corner, then a washer and a nut on each. */
-function legFix(f: LegFrame, gx: number): CustomFix[] {
+function legFix(f: LegFrame, gx: number, gzs: readonly number[] = SIDES, part: "all" | "rods" | "nuts" = "all"): CustomFix[] {
const ys = [f.H - f.T - f.A / 2 + 18, f.H - f.T - f.A / 2 - 18];
const out: CustomFix[] = [];
- for (const gz of SIDES) {
+ for (const gz of gzs) {
const id = legId(gx, gz);
const x = gx * legX(f), z = gz * legZ(f);
const corner = (d: number) => ys.map((y): Vec3 => [x - gx * (f.L / 2 + d * R2), y, z - gz * (f.L / 2 + d * R2)]);
const dir: Vec3 = [gx * R2, 0, gz * R2];
- out.push(
- fx("connector", [[x, f.H - f.T, z]], [0, -1, 0], { on: id, name: "Barrel nut", len: 34, dia: 10 }),
- fx("stud", corner(-4), dir, { on: id, name: "Threaded rod", len: 80, dia: 8 }),
- fx("washer", corner(24), dir, { on: id, len: 2, dia: 16 }),
- fx("nut", corner(26), dir, { on: id, len: 6, dia: 8 }),
- );
+ if (part !== "nuts")
+ out.push(
+ fx("connector", [[x, f.H - f.T, z]], [0, -1, 0], { on: id, name: "Barrel nut", len: 34, dia: 10 }),
+ fx("stud", corner(-4), dir, { on: id, name: "Threaded rod", len: 80, dia: 8 }),
+ );
+ if (part !== "rods")
+ out.push(
+ fx("washer", corner(24), dir, { on: id, len: 2, dia: 16 }),
+ fx("nut", corner(26), dir, { on: id, len: 6, dia: 8 }),
+ );
}
return out;
}
@@ -199,12 +203,14 @@ function lowerParts(f: LegFrame, lo: Lower): CustomPart[] {
}
/** The lower rail between two legs: a short rod and a dowel in each leg, big cam locks in the rail's ends. */
-function lowerFix(f: LegFrame, lo: Lower, gx: number): CustomFix[] {
+function lowerFix(f: LegFrame, lo: Lower, gx: number, gzs: readonly number[] = SIDES, part: "all" | "rods" | "cams" = "all"): CustomFix[] {
const xl = gx * legX(f), zl = legZ(f);
return [
- ...SIDES.map((gz) => fx("stud", [[xl, lo.y + 14, gz * (zl - f.L / 2)]], [0, 0, gz], { on: legId(gx, gz), name: "Short threaded rod", len: 40, dia: 8 })),
- ...SIDES.map((gz) => fx("dowel", [[xl, lo.y - 16, gz * (zl - f.L / 2)]], [0, 0, gz], { on: legId(gx, gz), len: 40, dia: 8 })),
- fx("cam", SIDES.map((gz): Vec3 => [xl, lo.y - lo.h / 2, gz * (zl - f.L / 2 - 24)]), [0, 1, 0], { on: `LR${gx}`, name: "Big cam lock", len: 20, dia: 25 }),
+ ...(part === "cams" ? [] : gzs.flatMap((gz) => [
+ fx("stud", [[xl, lo.y + 14, gz * (zl - f.L / 2)]], [0, 0, gz], { on: legId(gx, gz), name: "Short threaded rod", len: 40, dia: 8 }),
+ fx("dowel", [[xl, lo.y - 16, gz * (zl - f.L / 2)]], [0, 0, gz], { on: legId(gx, gz), len: 40, dia: 8 }),
+ ])),
+ ...(part === "rods" ? [] : [fx("cam", gzs.map((gz): Vec3 => [xl, lo.y - lo.h / 2, gz * (zl - f.L / 2 - 24)]), [0, 1, 0], { on: `LR${gx}`, name: "Big cam lock", len: 20, dia: 25 })]),
];
}
@@ -222,19 +228,50 @@ function legSteps(f: LegFrame, lo: Lower | null, two: boolean): CustomStep[] {
repeat: lo ? undefined : 2,
from: Object.fromEntries(legs(gx).map((id) => [id, [0, -320, 0] as Vec3])),
});
- const railStep = (gx: number): CustomStep => ({
- title: "Fit the lower rail between them",
- detail: "A short rod and a dowel in each leg, a big cam lock in each end of the rail. Push the rail on and turn both locks with the Allen key.",
- add: [`LR${gx}`],
- fix: lowerFix(f, lo!, gx),
- tools: ["allen"],
- from: { [`LR${gx}`]: [0, -260, 0] },
- });
- const out: CustomStep[] = [legStep(-1, true)];
- if (lo) out.push(railStep(-1));
- out.push(legStep(1, false));
+ const out: CustomStep[] = [];
+ if (!lo) out.push(legStep(-1, true), legStep(1, false));
+ else {
+ // as the manual does it: every leg gets its rods and dowels first, one leg at each end goes in, the lower rails
+ // push onto those along their dowels, then the other two legs push onto the rails' far ends
+ const all = SIDES.flatMap((gx) => SIDES.map((gz) => legId(gx, gz)));
+ const near = SIDES.map((gx) => legId(gx, -1)), far = SIDES.map((gx) => legId(gx, 1));
+ out.push(
+ {
+ title: "Fit the rods and dowels into the legs",
+ detail: "A barrel nut in the top of each leg and two long rods through its corner, then a short rod and a dowel in the side that faces the lower rail.",
+ fix: SIDES.flatMap((gx) => [...legFix(f, gx, SIDES, "rods"), ...lowerFix(f, lo, gx, SIDES, "rods")]),
+ wait: all,
+ from: Object.fromEntries(all.map((id) => [id, [0, -320, 0] as Vec3])),
+ tools: ["flathead"],
+ },
+ {
+ title: "Bolt the first two legs into the brackets",
+ detail: "One at each end, on the same side. A washer and a nut on each rod, tightened with the box spanner.",
+ add: near,
+ fix: SIDES.flatMap((gx) => legFix(f, gx, [-1], "nuts")),
+ tools: ["wrench"],
+ from: Object.fromEntries(near.map((id) => [id, [0, -320, 0] as Vec3])),
+ },
+ {
+ title: "Push the lower rails onto them",
+ detail: "Over the short rod and the dowel in each leg, then turn the big cam lock at that end with the Allen key.",
+ add: SIDES.map((gx) => `LR${gx}`),
+ fix: SIDES.flatMap((gx) => lowerFix(f, lo, gx, [-1], "cams")),
+ tools: ["allen"],
+ from: Object.fromEntries(SIDES.map((gx) => [`LR${gx}`, [0, 0, 260] as Vec3])),
+ },
+ {
+ title: "Push the other two legs on and bolt them",
+ detail: "Onto the far ends of the rails and into the brackets. Washers and nuts on the rods, then turn the other two cam locks.",
+ add: far,
+ fix: SIDES.flatMap((gx) => [...legFix(f, gx, [1], "nuts"), ...lowerFix(f, lo, gx, [1], "cams")]),
+ tools: ["wrench", "allen"],
+ from: Object.fromEntries(far.map((id) => [id, [0, 0, 260] as Vec3])),
+ },
+ );
+ }
if (lo)
- out.push(railStep(1), {
+ out.push({
title: "Bolt the stretcher across",
detail: "Lay it over the two lower rails and fix it with the two long bolts, one into each rail.",
add: ["ST"],
@@ -347,10 +384,12 @@ function extendable(s: ProductSpec): CustomParams {
tools: ["screwdriver"],
},
{
- title: "Hang both frames on the centre rails",
- detail: "The two rails go side by side, a dowel in each end. Drop them into the notches in the cross rails.",
+ title: "Press the centre rails into the frames",
+ detail: "Tap a dowel into each end of both rails. Lay them side by side and press them down into the slots in the cross rails.",
add: SIDES.map((sz) => `C${sz}`),
- fix: [auto("dowel", 4, { len: 30, dia: 8, to: crosses })],
+ // a dowel in each rail end (kept 24 mm apart where the rails meet), pressed down into open slots in the cross rails
+ fix: SIDES.flatMap((sz) => SIDES.map((g) => fx("dowel", [[g * xi, yU - 60, sz * 12]], [-g, 0, 0], { on: `C${sz}`, len: 30, dia: 8 }))),
+ from: { "C-1": [0, 260, 0], C1: [0, 260, 0] },
},
{
title: "Screw the leaf supports onto the cross rails",
@@ -482,12 +521,16 @@ function barTable(s: ProductSpec): CustomParams {
...SIDES.flatMap((g) => [-Fd / 4, Fd / 4].map((z): Vec3 => [g * xe, yB, z])),
...SIDES.map((g): Vec3 => [g * xr, yB, 0]),
];
- const knobs = SIDES.flatMap((g) => [-Fd / 4, Fd / 4].map((z): Vec3 => [g * (xe + 10), yA, z]));
+ // a little out from the apron face, so the engine keeps the knob and its bolt apart
+ const knobs = SIDES.flatMap((g) => [-Fd / 4, Fd / 4].map((z): Vec3 => [g * (xe + 13), yA, z]));
const steps: CustomStep[] = [
{
title: "Screw the cam bolts into the back apron and front blocks",
detail: "Lay the parts out on a rug. Two cam bolts in the back apron, one in each front block.",
- add: ["BA", ...blocks],
+ add: blocks,
+ // the back apron goes on after the runners, along its cam bolts
+ wait: ["BA"],
+ from: { BA: [0, 0, -300] },
fix: [
fx("camScrew", SIDES.map((g): Vec3 => [g * xr, yA, -(zF - 20)]), [0, 0, -1], { on: "BA" }),
...SIDES.map((g) => fx("camScrew", [[g * (xr + 15), yA, zF - 10]], [g, 0, 0], { on: `FB${g}` })),
@@ -506,6 +549,8 @@ function barTable(s: ProductSpec): CustomParams {
{
title: "Lock the runners to the back apron",
detail: "Turn the back apron so its cam bolts face the runners, push it on and turn the two cam locks.",
+ add: ["BA"],
+ from: { BA: [0, 0, -260] },
fix: [auto("cam", 2, { to: ["BA"] })],
tools: ["screwdriver"],
},
@@ -522,7 +567,7 @@ function barTable(s: ProductSpec): CustomParams {
detail: "Two on the outside of each end apron, each held by a bolt from the inside.",
fix: [
...SIDES.map((g) => fx("knob", knobs.filter((p) => Math.sign(p[0]) === g), [-g, 0, 0], { on: `E${g}`, len: 25, dia: 30 })),
- ...SIDES.map((g) => fx("bolt", near(knobs.filter((p) => Math.sign(p[0]) === g), [-g * 20, 0, 0]), [g, 0, 0], { on: `E${g}`, len: 30, dia: 4, name: "Knob bolt" })),
+ ...SIDES.map((g) => fx("bolt", near(knobs.filter((p) => Math.sign(p[0]) === g), [-g * 23, 0, 0]), [g, 0, 0], { on: `E${g}`, len: 30, dia: 4, name: "Knob bolt" })),
],
tools: ["screwdriver"],
},
@@ -559,7 +604,12 @@ function barTable(s: ProductSpec): CustomParams {
title: "Join the drawer sides to the front",
detail: "Two dowels and two cam bolts in the front's back face. Push the sides on and turn their cam locks.",
add: ["DF", "DS-1", "DS1"],
- fix: [auto("dowel", 2, { to: ["DF"], len: 30, dia: 8 }), auto("camScrew", 2, { to: ["DF"] }), auto("cam", 2, { to: ["DF"] })],
+ // into the front's back face, where each side meets it (not its ends, which only sit near the runners)
+ fix: [
+ fx("dowel", SIDES.map((g): Vec3 => [g * (dx - 8), yA - 30, zF - 20]), [0, 0, 1], { on: "DF", len: 30, dia: 8 }),
+ fx("camScrew", SIDES.map((g): Vec3 => [g * (dx - 8), yA + 10, zF - 20]), [0, 0, 1], { on: "DF" }),
+ ...SIDES.map((g) => fx("cam", [[g * (dx - 16), yA + 10, zF - 44]], [g, 0, 0], { on: `DS${g}` })),
+ ],
tools: ["screwdriver"],
from: { DF: [0, 0, 700], "DS-1": [-120, 0, 700], DS1: [120, 0, 700] },
},
@@ -574,7 +624,7 @@ function barTable(s: ProductSpec): CustomParams {
{
title: "Screw on the handle",
detail: "Two bolts from inside the drawer front.",
- fix: [fx("handle", [[0, yA, zF]], [0, 0, -1], { on: "DF", name: "Cup handle", len: 96, dia: 30 }), fx("bolt", [[-40, yA, zF - 20], [40, yA, zF - 20]], [0, 0, 1], { on: "DF", len: 30, dia: 4, name: "Handle bolt" })],
+ fix: [fx("handle", [[0, yA, zF + 4]], [0, 0, -1], { on: "DF", name: "Cup handle", len: 96, dia: 30 }), fx("bolt", [[-28, yA, zF - 20], [28, yA, zF - 20]], [0, 0, 1], { on: "DF", len: 30, dia: 4, name: "Handle bolt" })],
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/norraker.ts b/src/lib/plan/families/norraker.ts
new file mode 100644
index 0000000..8d58a2b
--- /dev/null
+++ b/src/lib/plan/families/norraker.ts
@@ -0,0 +1,153 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * NORRÅKER, read from the table's manual. The frame is made on a rug: a corner bracket screwed inside each end of the
+ * two short rails, then the long rails screwed onto the brackets' other flanges. The frame is laid on the upside-down
+ * top and held with two long screws, then ten more. Each leg takes a cross dowel in its top end and two threaded
+ * studs, the studs go through the bracket and a spring washer and a nut hold them, tightened with the box spanner.
+ * Four glides are tapped into the feet. The chair has no manual we could find, so it keeps its old guide.
+ */
+
+type Kind = CustomFix["kind"];
+const fx = (kind: Kind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const G = [-1, 1] as const;
+const CORNERS: [number, number][] = [
+ [-1, -1],
+ [1, -1],
+ [-1, 1],
+ [1, 1],
+];
+const r = (n: number) => Math.round(n);
+const UP: Vec3 = [0, 1, 0];
+
+const TT = 28; // top
+const RH = 75, RT = 20; // rails
+const IN = 40; // rails in from the top's edges
+const LEG = 50;
+
+const LONG_SCREW = { len: 90, dia: 5, name: "Long screw" };
+const SMALL = { len: 14, dia: 4 };
+const BRACKET = { len: 90, dia: 40, name: "Corner bracket" };
+const STUD = { len: 60, dia: 8, name: "Threaded stud" };
+const CROSS = { len: 40, dia: 10, name: "Cross dowel" };
+const NUT = { len: 7, dia: 13 };
+const WASHER = { len: 2, dia: 14, name: "Spring washer" };
+const GLIDE = { len: 12, dia: 24, name: "Glide" };
+
+function table(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, D = s.size.d * 10, H = s.size.h * 10;
+ const yTop = H - TT; // underside of the top
+ const yR = yTop - RH / 2;
+ const yLow = yTop - RH; // the rails' lower edge, facing up while you work
+ const xo = W / 2 - IN - RT / 2, zo = D / 2 - IN - RT / 2; // rail centres
+ const xi = W / 2 - IN - RT, zi = D / 2 - IN - RT; // inside faces of the rails
+ const xl = xi - LEG / 2, zl = zi - LEG / 2; // leg centres, tucked into the corners
+ const lenX = W - 2 * IN, lenZ = D - 2 * IN - 2 * RT;
+
+ const parts: CustomPart[] = [
+ ...G.map((sx, i): CustomPart => ({ id: `Z${i + 1}`, name: "Short rail", size: [RT, RH, r(lenZ)], pos: [r(sx * xo), yR, 0], material: "wood" })),
+ ...G.map((sz, i): CustomPart => ({ id: `X${i + 1}`, name: "Long rail", size: [r(lenX), RH, RT], pos: [0, yR, r(sz * zo)], material: "wood" })),
+ { id: "T", name: "Table top", size: [W, TT, D], pos: [0, H - TT / 2, 0], material: "wood" },
+ ...CORNERS.map(([sx, sz], i): CustomPart => ({ id: `L${i + 1}`, name: "Leg", size: [LEG, yTop, LEG], pos: [r(sx * xl), yTop / 2, r(sz * zl)], material: "wood" })),
+ ];
+ const xRail = (sz: number) => (sz < 0 ? "X1" : "X2");
+
+ // a bracket's flanges sit on the rails just past the leg, its web across the corner with two holes for the studs
+ const reach = LEG + 40;
+ const flangeZ = CORNERS.map(([sx, sz]) => G.map((dy): Vec3 => [r(sx * xi), r(yR + dy * 18), r(sz * (zi - reach))]));
+ const flangeX = CORNERS.map(([sx, sz]) => G.map((dy): Vec3 => [r(sx * (xi - reach)), r(yR + dy * 18), r(sz * zi)]));
+ const diag = (sx: number, sz: number): Vec3 => [-sx * 0.71, 0, -sz * 0.71]; // from the corner towards the middle
+ const brackets = CORNERS.map(([sx, sz]) =>
+ fx("angle", [[r(sx * (xi - reach / 2 - 10)), r(yR), r(sz * (zi - reach / 2 - 10))]], [sx * 0.71, 0, sz * 0.71], { ...BRACKET, on: sx < 0 ? "Z1" : "Z2", mate: xRail(sz) }),
+ );
+ const bracketScrewsZ = CORNERS.map(([sx], i) => fx("screw", flangeZ[i], [sx, 0, 0], { ...SMALL, on: sx < 0 ? "Z1" : "Z2" }));
+ const bracketScrewsX = CORNERS.map(([, sz], i) => fx("screw", flangeX[i], [0, 0, sz], { ...SMALL, on: xRail(sz) }));
+
+ // long screws down through the rails into the top
+ const along = (n: number, len: number) => Array.from({ length: n }, (_, k) => -len / 2 + 120 + ((len - 240) * k) / Math.max(1, n - 1));
+ const shortScrew = (sx: number, z: number) => fx("screw", [[r(sx * xo), r(yLow), r(z)]], UP, { ...LONG_SCREW, on: sx < 0 ? "Z1" : "Z2", mate: "T" });
+ const first = G.map((sx) => shortScrew(sx, -lenZ / 4));
+ const rest = [
+ ...G.map((sx) => shortScrew(sx, lenZ / 4)),
+ ...G.map((sz) => fx("screw", along(4, lenX).map((x): Vec3 => [r(x), r(yLow), r(sz * zo)]), UP, { ...LONG_SCREW, on: xRail(sz), mate: "T" })),
+ ];
+
+ // leg fittings: a cross dowel down into the top end, two studs out of the inside corner through the bracket
+ const edge = (sx: number, sz: number, k: number): Vec3 => {
+ const d = diag(sx, sz);
+ return [r(sx * xl + d[0] * k), 0, r(sz * zl + d[2] * k)];
+ };
+ const studY = [yR - 16, yR + 16];
+ const crosses = CORNERS.map(([sx, sz], i) => fx("nut", [[r(sx * xl), r(yTop - 45), r(sz * zl)]], [0, -1, 0], { ...CROSS, on: `L${i + 1}` }));
+ const studs = CORNERS.map(([sx, sz], i) => fx("stud", studY.map((y): Vec3 => { const p = edge(sx, sz, LEG * 0.6); return [p[0], r(y), p[2]]; }), diag(sx, sz), { ...STUD, on: `L${i + 1}` }));
+ const nuts = (k: "washer" | "nut") =>
+ CORNERS.map(([sx, sz], i) =>
+ fx(k, studY.map((y): Vec3 => { const p = edge(sx, sz, LEG * 0.6 + 32); return [p[0], r(y), p[2]]; }), diag(sx, sz), { ...(k === "nut" ? NUT : WASHER), on: `L${i + 1}` }),
+ );
+ const glides = fx("glide", CORNERS.map(([sx, sz]): Vec3 => [r(sx * xl), 0, r(sz * zl)]), UP, { ...GLIDE });
+
+ return {
+ parts,
+ steps: [
+ {
+ title: "Screw a corner bracket into each end of the short rails",
+ detail: "Lay the rails on a rug. Each bracket sits on the inside of a rail end and takes two small screws.",
+ add: ["Z1", "Z2"],
+ fix: [...brackets, ...bracketScrewsZ],
+ pose: "-y",
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the long rails onto the brackets",
+ detail: "Two small screws through each bracket's free flange. Check the screw holes in the rails face up, to the top.",
+ add: ["X1", "X2"],
+ fix: bracketScrewsX,
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lay the frame on the top and fix it with two screws",
+ detail: "Lay the top face down on the rug and set the frame on it, the same gap all round. One long screw in each short rail holds it while you do the rest.",
+ add: ["T"],
+ fix: first,
+ from: { T: [0, 400, 0] },
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Drive in the other ten long screws",
+ detail: "Four along each long rail and one more in each short rail, firmly but without stripping the wood.",
+ fix: rest,
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit a cross dowel and two studs to each leg",
+ detail: "The cross dowel drops into the top end of the leg with its slot lined up with the holes. Screw both studs in by hand until they stop in it.",
+ fix: [...crosses, ...studs],
+ wait: ["L1", "L2", "L3", "L4"],
+ tools: ["flathead"],
+ },
+ {
+ title: "Bolt each leg into its corner",
+ detail: "Push the studs through the holes in the bracket, then a spring washer and a nut on each. Tighten with the box spanner until the leg sits firm against both rails.",
+ add: ["L1", "L2", "L3", "L4"],
+ fix: [...nuts("washer"), ...nuts("nut")],
+ from: Object.fromEntries(CORNERS.map(([sx, sz], i) => [`L${i + 1}`, [-sx * 40, -260, -sz * 40] as Vec3])),
+ tools: ["wrench"],
+ },
+ {
+ title: "Tap a glide into each foot",
+ detail: "One gentle tap with the hammer each, until the glide sits flat.",
+ fix: [glides],
+ tools: ["hammer"],
+ },
+ { title: "Turn the table over", detail: "Together, lifting it by the top, never by the legs.", pose: "+y", people: 2, warnings: ["two"] },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["NORRÅKER", "NORRAKER"],
+ recipe: (s) => (/table/i.test(s.variant) && !/bar|bench/i.test(s.variant) ? table(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/norrmanso.ts b/src/lib/plan/families/norrmanso.ts
index 59d9d85..888cbbb 100644
--- a/src/lib/plan/families/norrmanso.ts
+++ b/src/lib/plan/families/norrmanso.ts
@@ -114,9 +114,10 @@ function trestle(b: PlanBuilder, s: ProductSpec, g: Trestle): boolean {
const centre: HwDef = isTable ? legScrew : { kind: "screw", len: 70, dia: 6, name: "Wood screw" };
const centreFits = (): FitOpts[] =>
braces.flatMap((br) =>
- (g.centre > 1 ? [50, 120] : [60]).map((d) => {
- const q = along(br, d);
- return { on: br.key, at: [q[0], q[1] - bw / 2, 0] as Vec3, dir: [0, 1, 0] as Vec3, mate: top };
+ // two go side by side near the top end (further down the slope they would stop short of the top)
+ (g.centre > 1 ? [-15, 15] : [0]).map((z) => {
+ const q = along(br, g.centre > 1 ? 55 : 60);
+ return { on: br.key, at: [q[0], q[1] - bw / 2, z] as Vec3, dir: [0, 1, 0] as Vec3, mate: g.halves ? (z < 0 ? tops[0] : tops[1]) : top };
}),
);
diff --git a/src/lib/plan/families/nyhamn.ts b/src/lib/plan/families/nyhamn.ts
index 7231577..544dc72 100644
--- a/src/lib/plan/families/nyhamn.ts
+++ b/src/lib/plan/families/nyhamn.ts
@@ -135,7 +135,8 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Screw the catches down",
detail: "One short bolt in each, with the Allen key.",
- fix: [fx("bolt", sides.map((sx): Vec3 => [sx * (xS - 35), yT + t / 2, 0]), [0, -1, 0], "S1", SHORT)],
+ // each catch sits on top of its side frame tube, the bolt goes down into the tube
+ fix: [fx("bolt", sides.map((sx): Vec3 => [sx * xS, yT + t / 2, 0]), [0, -1, 0], "S1", SHORT)],
tools: ["allen"],
},
{ title: "Click the back hinges up", detail: "Lift each hinge upright at the back until it clicks." },
diff --git a/src/lib/plan/families/ommjange.ts b/src/lib/plan/families/ommjange.ts
index 5983903..6958967 100644
--- a/src/lib/plan/families/ommjange.ts
+++ b/src/lib/plan/families/ommjange.ts
@@ -42,7 +42,7 @@ function chair(s: ProductSpec): CustomParams {
SX.map((sx) => at("dowel", [[sx * (xi - t / 2), y, z - 12], [sx * (xi - t / 2), y, z + 12]], [sx, 0, 0], cross, L(sx, l, r), { len: 30, dia: 8 }));
const frameBolts = (y: number, z: number, cross: string, l: string, r: string) => [
at("bolt", [[-(xi + t / 2), y, z]], [1, 0, 0], l, cross, { len: 60, dia: 6 }),
- at("bolt", [[xi + t / 2, y, z - 10], [xi + t / 2, y, z + 10]], [-1, 0, 0], r, cross, { len: 60, dia: 6 }),
+ at("bolt", [[xi + t / 2, y, z - 12], [xi + t / 2, y, z + 12]], [-1, 0, 0], r, cross, { len: 60, dia: 6 }),
];
const legDowels = SX.flatMap((sx) => [
at("dowel", [[sx * xi, runH, zFront - 10], [sx * xi, runH, zFront + 10]], [0, -1, 0], L(sx, "FL", "FRL"), L(sx, "RL", "RR"), { len: 40, dia: 8 }),
diff --git a/src/lib/plan/families/orfjall.ts b/src/lib/plan/families/orfjall.ts
index 194d8d5..3653613 100644
--- a/src/lib/plan/families/orfjall.ts
+++ b/src/lib/plan/families/orfjall.ts
@@ -92,8 +92,9 @@ function recipe(s: ProductSpec) {
const legFix: CustomFix[] = kid
? [{ kind: "screw", count: 5, len: 16, dia: 6, at: legScrews, dir: [0, 1, 0], on: "HUB" }]
: [
- { kind: "washer", count: 10, len: 1.5, dia: 16, at: legScrews, dir: [0, 1, 0], on: "HUB" },
+ // the washers stack on the screws, so the screws are listed first
{ kind: "screw", count: 10, len: 16, dia: 6, at: legScrews, dir: [0, 1, 0], on: "HUB" },
+ { kind: "washer", count: 10, len: 1.5, dia: 16, at: legScrews, dir: [0, 1, 0], on: "HUB" },
];
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/orreslatt.ts b/src/lib/plan/families/orreslatt.ts
index 0ca894e..d0765ad 100644
--- a/src/lib/plan/families/orreslatt.ts
+++ b/src/lib/plan/families/orreslatt.ts
@@ -60,7 +60,7 @@ function armchair(s: ProductSpec): CustomParams {
title: "Bolt the leg frame to the seat",
detail: "Set the frame's four plates over the holes. Start each bolt by hand with its square washer sitting flat in the recess, then tighten with the Allen key.",
add: ["LEGS"],
- fix: [{ kind: "bolt", count: 4, len: 16, dia: 6, at: tops.map((t): Vec3 => [t[0], t[1] - TUBE / 2, t[2]]), dir: [0, 1, 0], on: "LEGS", mate: "SEAT" }],
+ fix: [{ kind: "bolt", count: 4, len: 16, dia: 6, at: tops.map((t): Vec3 => [t[0], under(t[2]) - 4, t[2]]), dir: [0, 1, 0], on: "LEGS", mate: "SEAT" }],
},
{ title: "Stand the chair up", detail: "Lift it by the frame and set it on its feet.", pose: "+y" },
],
diff --git a/src/lib/plan/families/ostavall.ts b/src/lib/plan/families/ostavall.ts
index 211bfd3..90fe217 100644
--- a/src/lib/plan/families/ostavall.ts
+++ b/src/lib/plan/families/ostavall.ts
@@ -30,7 +30,8 @@ function table(s: ProductSpec): CustomParams {
{ id: "SR", name: "Side panel", size: [t, yBox, D], pos: [xs, yBox / 2, 0], material: "board" },
...SX.map((sx, i): CustomPart => ({ id: `AF${i}`, name: "Front lift arm", size: [10, yBox - 300, 30], pos: [sx * (xIn - 5), (300 + yBox) / 2, zFa], material: "metal" })),
...SX.map((sx, i): CustomPart => ({ id: `AR${i}`, name: "Rear lift arm", size: [10, yBox - 290, 60], pos: [sx * (xIn - 5), (290 + yBox) / 2, zRa], material: "metal" })),
- { id: "BAR", name: "Cross bar", size: [Wi - 20, 25, 25], pos: [0, 330, zRa], material: "metal" },
+ // a flat bar, its two bolts per end side by side, above the pivot pins
+ { id: "BAR", name: "Cross bar", size: [Wi - 20, 25, 50], pos: [0, 400, zRa], material: "metal" },
...SX.map((sx, i): CustomPart => ({ id: `GS${i}`, name: "Gas spring", shape: "cyl", size: [30, 30, 260], pos: [sx * (xIn - 40), 310, 20], material: "metal" })),
{ id: "TOP", name: "Table top", size: [W, t, D], pos: [0, H - t / 2, 0], material: "board" },
];
@@ -114,8 +115,9 @@ function table(s: ProductSpec): CustomParams {
detail: "Put a washer on each bolt and turn it in by hand through the arm into the bar. Don't tighten yet.",
add: ["BAR"],
fix: SX.flatMap((sx, i) => {
- const pts: Vec3[] = [[sx * xIn, 330, zRa - 8], [sx * xIn, 330, zRa + 8]];
- return [at("washer", pts, [-sx, 0, 0], `AR${i}`, undefined, { len: 2, dia: 16 }), at("bolt", pts, [-sx, 0, 0], `AR${i}`, "BAR", { len: 16, dia: 6 })];
+ const pts: Vec3[] = [[sx * xIn, 400, zRa - 12], [sx * xIn, 400, zRa + 12]];
+ // the engine keeps a washer on the bolt already at its point, so the bolt is listed first
+ return [at("bolt", pts, [-sx, 0, 0], `AR${i}`, "BAR", { len: 16, dia: 6 }), at("washer", pts, [-sx, 0, 0], `AR${i}`, undefined, { len: 2, dia: 16 })];
}),
},
{ title: "Fold the arms down and tighten the bolts", detail: "Push the bar down until the arms lie flat, then tighten all four bolts with the Allen key.", tools: ["allen"] },
diff --git a/src/lib/plan/families/ovning.ts b/src/lib/plan/families/ovning.ts
index f47359e..c884a2a 100644
--- a/src/lib/plan/families/ovning.ts
+++ b/src/lib/plan/families/ovning.ts
@@ -28,6 +28,14 @@ function trolley(s: ProductSpec): CustomParams {
material,
});
const ySh1 = 280, ySh2 = 390;
+ // a tray end, its two edges bent round as tabs that sit inside the long sides and take the corner screws
+ const trayEnd = (id: string, sx: number): CustomPart => ({
+ ...box(id, "Tray end", sx < 0 ? -xO : xO - 14, sx < 0 ? -xO + 14 : xO, yTop, H, -D / 2 + 2, D / 2 - 2, "metal"),
+ pieces: [
+ { shape: "box", size: [2, H - yTop, D - 4], pos: [sx * 6, 0, 0] },
+ ...[-1, 1].map((sz) => ({ shape: "box" as const, size: [12, H - yTop, 2] as Vec3, pos: [-sx, 0, sz * (D / 2 - 3)] as Vec3 })),
+ ],
+ });
const parts: CustomPart[] = [
box("C1B", "Bottom", xL, xD - t / 2, yFloor, yFloor + t),
box("C1S", "Side panel", -xO, xL, yFloor, yLow + t),
@@ -37,13 +45,17 @@ function trolley(s: ProductSpec): CustomParams {
box("C2S", "Side panel", xR, xO, yFloor, yTop - t),
box("C2T", "Top", -xO, xO, yTop - t, yTop),
box("BASE", "Base", -xO, xO, yBase, yFloor),
- box("MF", "Perforated panel", xL, xD - t / 2, yLow + t, yTop - t, D / 2 - 2, D / 2, "metal"),
+ // the front panel's bottom edge is folded in, a lip that lies on the low box and takes two screws
+ { ...box("MF", "Perforated panel", xL, xD - t / 2, yLow + t, yTop - t, D / 2 - 20, D / 2, "metal"), pieces: [
+ { shape: "box", size: [xD - t / 2 - xL, yTop - yLow - 2 * t, 2], pos: [0, 0, 9] },
+ { shape: "box", size: [xD - t / 2 - xL, 2, 20], pos: [0, -(yTop - yLow - 2 * t) / 2 + 1, 0] },
+ ] },
box("MS", "Perforated panel", -xO, -xO + 2, yLow + t, yTop - t, -D / 2, D / 2, "metal"),
box("TRP", "Tray bottom", -xO, xO, yTop, yTop + 2, -D / 2, D / 2, "metal"),
box("TRF", "Tray side", -xO, xO, yTop, H, D / 2 - 2, D / 2, "metal"),
box("TRK", "Tray side", -xO, xO, yTop, H, -D / 2, -D / 2 + 2, "metal"),
- box("TRL", "Tray end", -xO, -xO + 2, yTop, H, -D / 2 + 2, D / 2 - 2, "metal"),
- box("TRR", "Tray end", xO - 2, xO, yTop, H, -D / 2 + 2, D / 2 - 2, "metal"),
+ trayEnd("TRL", -1),
+ trayEnd("TRR", 1),
box("SH1", "Shelf", xL, xD - t / 2, ySh1, ySh1 + t, -D / 2 + 10, D / 2 - 10),
box("SH2", "Shelf", xD + t / 2, xR, ySh2, ySh2 + t, -D / 2 + 10, D / 2 - 10),
];
@@ -99,7 +111,7 @@ function trolley(s: ProductSpec): CustomParams {
{
title: "Join the two boxes",
detail: "Turn the two connecting screws in through the divider with the Allen key.",
- fix: [at("bolt", [[xD + t / 2, cy("C1T"), 0]], [-1, 0, 0], "DIV", "C1T", CONN), at("bolt", [[xD + t / 2, cy("C1B"), 0]], [-1, 0, 0], "DIV", "C1B", CONN)],
+ fix: [at("bolt", [[xD + t / 2, cy("C1T"), 60]], [-1, 0, 0], "DIV", "C1T", CONN), at("bolt", [[xD + t / 2, cy("C1B"), 60]], [-1, 0, 0], "DIV", "C1B", CONN)],
},
{
title: "Screw the castors to the base",
@@ -119,7 +131,7 @@ function trolley(s: ProductSpec): CustomParams {
fix: [at("bolt", [xO - t / 2, xD, -xO + t / 2].flatMap((x) => [[x, yBase, -D / 2 + 60], [x, yBase, D / 2 - 60]] as Vec3[]), [0, 1, 0], "BASE", undefined, CONN)],
},
{ title: "Slide in the perforated panels", detail: "Stand the trolley up. Hook both panels into the slots above the low box, one at the front and one at the side.", add: ["MF", "MS"], pose: "+y", from: { MF: [0, 0, 300], MS: [-300, 0, 0] } },
- { title: "Screw the front panel down", detail: "Two connecting screws through its bottom edge into the low box.", fix: [at("bolt", [[xL + 30, yLow + t, D / 2 - 10], [xD - t / 2 - 30, yLow + t, D / 2 - 10]], [0, -1, 0], "MF", "C1T", CONN)] },
+ { title: "Screw the front panel down", detail: "Two connecting screws through its bottom edge into the low box.", fix: [at("bolt", [[xL + 30, yLow + t + 2, D / 2 - 10], [xD - t / 2 - 30, yLow + t + 2, D / 2 - 10]], [0, -1, 0], "MF", "C1T", CONN)] },
{
title: "Put the tray together",
detail: "Hook the two ends onto the long sides, then lay the bottom sheet in so its tabs sit in the slots.",
@@ -129,7 +141,7 @@ function trolley(s: ProductSpec): CustomParams {
{
title: "Screw the tray's corners",
detail: "One screw in each corner. Use the short screws here, not the countersunk ones.",
- fix: [-1, 1].map((sx) => at("screw", [[sx * xO, yTop + 60, -D / 2 + 6], [sx * xO, yTop + 60, D / 2 - 6]], [-sx, 0, 0], sx < 0 ? "TRL" : "TRR", undefined, { len: 10, dia: 4 })),
+ fix: [-1, 1].map((sz) => at("screw", [-1, 1].map((sx): Vec3 => [sx * (xO - 7), yTop + 60, sz * D / 2]), [0, 0, -sz], sz < 0 ? "TRK" : "TRF", undefined, { len: 10, dia: 4, to: ["TRL", "TRR"] })),
},
{ title: "Set the tray on top", detail: "Push its four tabs into the slots in the top and slide it back until it stops.", add: tray, from: Object.fromEntries(tray.map((id) => [id, [0, 250, 0] as Vec3])) },
{ title: "Screw the tray to the top", detail: "Four connecting screws through the tray's bottom.", fix: [at("bolt", [-1, 1].flatMap((sx) => [[sx * 150, yTop + 2, -80], [sx * 150, yTop + 2, 80]] as Vec3[]), [0, -1, 0], "TRP", "C2T", CONN)] },
@@ -139,8 +151,8 @@ function trolley(s: ProductSpec): CustomParams {
title: "Screw on the shelf stops",
detail: "Two at the back of each shelf. Screw them by hand, not with a drill.",
fix: [
- at("clip", [[-200, ySh1 + t, -D / 2 + 30], [-90, ySh1 + t, -D / 2 + 30], [40, ySh2 + t, -D / 2 + 30], [180, ySh2 + t, -D / 2 + 30]], [0, -1, 0], "SH1", undefined, { name: "Shelf stop", len: 30, dia: 20, to: ["SH1", "SH2"] }),
- at("screw", [[-200, ySh1 + t + 10, -D / 2 + 22], [-90, ySh1 + t + 10, -D / 2 + 22], [40, ySh2 + t + 10, -D / 2 + 22], [180, ySh2 + t + 10, -D / 2 + 22]], [0, 0, -1], "SH1", undefined, { len: 12, dia: 3.5, to: ["SH1", "SH2"] }),
+ at("clip", [[-200, ySh1 + t + 32, -D / 2 + 30], [-90, ySh1 + t + 32, -D / 2 + 30], [40, ySh2 + t + 32, -D / 2 + 30], [180, ySh2 + t + 32, -D / 2 + 30]], [0, -1, 0], "SH1", undefined, { name: "Shelf stop", len: 30, dia: 20, to: ["SH1", "SH2"] }),
+ at("screw", [[-200, ySh1 + t + 8, -D / 2 + 30], [-90, ySh1 + t + 8, -D / 2 + 30], [40, ySh2 + t + 8, -D / 2 + 30], [180, ySh2 + t + 8, -D / 2 + 30]], [0, -1, 0], "SH1", undefined, { len: 12, dia: 3.5, to: ["SH1", "SH2"] }),
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/pahl.ts b/src/lib/plan/families/pahl.ts
index dbc940f..ea625f5 100644
--- a/src/lib/plan/families/pahl.ts
+++ b/src/lib/plan/families/pahl.ts
@@ -37,7 +37,8 @@ function desk(s: ProductSpec): CustomParams {
title: "Turn the four screws into the top",
detail: "Lay the top face down on a rug. Hold the plastic gauge under each screw head and screw down onto it, then slide the gauge out.",
add: ["TOP"],
- fix: [at("screw", corners.map(([sx, sz]): Vec3 => [sx * (lx - 10), yU, sz * (lz - 8)]), [0, 1, 0], "TOP", undefined, { len: 30, dia: 4 })],
+ // the heads stand off the top by the gauge's thickness, for the legs' keyholes to hook onto
+ fix: [at("screw", corners.map(([sx, sz]): Vec3 => [sx * (lx - 10), yU - 14, sz * (lz - 8)]), [0, 1, 0], "TOP", undefined, { len: 30, dia: 4 })],
pose: "-y",
warnings: ["floor"],
},
diff --git a/src/lib/plan/families/panget.ts b/src/lib/plan/families/panget.ts
index 967dc18..16ae3b4 100644
--- a/src/lib/plan/families/panget.ts
+++ b/src/lib/plan/families/panget.ts
@@ -91,7 +91,7 @@ function rack(s: ProductSpec): CustomParams {
detail: "One at the back of each frame's top rail, two screws each.",
fix: [
...SX.map((sx) => at("angle", [[sx * xi, H - 30, -D / 2 + 60]], [sx, 0, 0], sid(sx), undefined, { name: "Wall bracket", len: 50, dia: 40 })),
- ...SX.map((sx) => at("screw", [[sx * xi, H - 15, -D / 2 + 60], [sx * xi, H - 45, -D / 2 + 60]], [sx, 0, 0], sid(sx), undefined, { len: 16, dia: 4 })),
+ ...SX.map((sx) => at("screw", [[sx * xi, H - 30, -D / 2 + 35], [sx * xi, H - 30, -D / 2 + 85]], [sx, 0, 0], sid(sx), undefined, { len: 16, dia: 4 })),
],
},
{
@@ -99,7 +99,6 @@ function rack(s: ProductSpec): CustomParams {
detail: "Two in each end of the bottom shelf, the bench and the top shelf.",
fix: panels.flatMap(([id, y]) => SX.map((sx) => at("dowel", [[sx * xi, y, -160], [sx * xi, y, 160]], [sx, 0, 0], id, sid(sx), DOW))),
wait: ["BOT", "SEAT", "TOP"],
- from: { BOT: [0, 0, 700], SEAT: [0, 0, 700], TOP: [0, 0, 700] },
tools: ["hammer"],
},
{
@@ -119,7 +118,7 @@ function rack(s: ProductSpec): CustomParams {
at("dowel", [[-150, yTop - 10, zStrip], [150, yTop - 10, zStrip]], [0, 1, 0], "TF", "TOP", DOW),
],
wait: ["PF", "PB", "SA", "TF"],
- from: { PF: [0, 0, 700], PB: [0, 0, 700], SA: [0, 0, 700], TF: [0, 0, 700] },
+ from: { SA: [0, 0, 0], TF: [0, 0, 0] }, // joined on two axes: they just wait beside the build
tools: ["hammer"],
},
{
@@ -134,7 +133,7 @@ function rack(s: ProductSpec): CustomParams {
fix: panelCams(-1),
},
{ title: "Fit the front plinth", detail: "Push it on and lock the cams in it and the top apron.", add: ["PF"], fix: [stripCam(-1, "PF", 50, zStrip), stripCam(-1, "TF", yTop - 40, zStrip)] },
- { title: "Tap the dowels into the hook rail", detail: "One in each end.", fix: SX.map((sx) => at("dowel", [[sx * xi, yHook + 25, -D / 2 + 30]], [sx, 0, 0], "HOOK", sid(sx), DOW)), wait: ["HOOK"], from: { HOOK: [0, 0, -700] }, tools: ["hammer"] },
+ { title: "Tap the dowels into the hook rail", detail: "One in each end.", fix: SX.map((sx) => at("dowel", [[sx * xi, yHook + 25, -D / 2 + 30]], [sx, 0, 0], "HOOK", sid(sx), DOW)), wait: ["HOOK"], tools: ["hammer"] },
{ title: "Fit the hook rail", detail: "At the back, between the bench and the top. Lock its cam.", add: ["HOOK"], fix: [stripCam(-1, "HOOK", yHook, -D / 2 + 30)] },
{ title: "Put the clothes rail in its cup", detail: "Push a cup on each end and set one end in the hole in the frame.", add: ["ROD"], fix: SX.map((sx) => at("cap", [[sx * (xi - 4), yRod, 0]], [sx, 0, 0], "ROD", sid(sx), { name: "Rail cup", len: 12, dia: 40 })) },
{
@@ -157,7 +156,7 @@ function rack(s: ProductSpec): CustomParams {
detail: "A screw through the back of the rail into each knob.",
fix: [
at("knob", [-180, -60, 60, 180].map((x): Vec3 => [x, yHook, -D / 2 + 40]), [0, 0, -1], "HOOK", undefined, { len: 40, dia: 35 }),
- at("screw", [-180, -60, 60, 180].map((x): Vec3 => [x, yHook, -D / 2 + 20]), [0, 0, 1], "HOOK", undefined, { len: 40, dia: 4 }),
+ at("screw", [-180, -60, 60, 180].map((x): Vec3 => [x, yHook, -D / 2 + 10]), [0, 0, 1], "HOOK", undefined, { len: 40, dia: 4 }),
],
},
{ title: "Push in the shelf pins", detail: "Four, by hand, at the same height in both frames.", fix: SX.map((sx) => at("pin", [[sx * xi, yShoe - 9, -150], [sx * xi, yShoe - 9, 150]], [sx, 0, 0], sid(sx), undefined, { len: 16, dia: 5 })) },
diff --git a/src/lib/plan/families/pax.ts b/src/lib/plan/families/pax.ts
index af67f2a..ae973e4 100644
--- a/src/lib/plan/families/pax.ts
+++ b/src/lib/plan/families/pax.ts
@@ -1,6 +1,6 @@
-import type { ProductSpec, Vec3 } from "../../types";
+import type { CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
import { HW, type FitOpts, type HwDef, type PlanBuilder } from "../builder";
-import { buildCabinet } from "../cabinet";
+import { buildCustom } from "../custom";
import { buildRow, type RowJoint } from "../row";
import { buildUnits, unitOf } from "../units";
import type { Family } from "./family";
@@ -22,7 +22,13 @@ import type { Family } from "./family";
* Wardrobes add the KOMPLEMENT clothes rail (two holders, four screws) and shelves on four pins each, and hinged
* doors go on with KOMPLEMENT soft-closing hinges (three a door on 201 cm frames, four on 236 cm): screwed into
* the door lying flat, then to the side, and two bumpers each. Sliding doors are drawn across a whole row by the
- * row builder. The add-on corner unit has its own manual and keeps its old guide.
+ * row builder.
+ *
+ * The add-on corner unit has its own manual and is the older flat pack: the sides take cam bolts, the top, bottom
+ * and plinth dowels; one side is laid down, the others stood onto it, the cams turned, the second side put on from
+ * above and four long bolts go through the sides into the bottom. Turned over, the back is nailed on, a joining
+ * bracket is screwed across the top and the bottom, it is stood up and fixed to the wall, then the corner
+ * fittings, bumpers and four shelves on pins go in.
*/
const t = 19; // sides, top and bottom
@@ -499,16 +505,150 @@ const JOINT: RowJoint = {
tools: ["drill", "screwdriver"],
};
-/** A frame of a row: drawn here when it's a PAX frame, otherwise (the add-on corner unit) by the cabinet builder. */
+/** The add-on corner unit, from its own manual. In a corner wardrobe its wall fixing waits until last. */
+function cornerUnit(s: ProductSpec, inSet: boolean): CustomParams {
+ const W = s.size.w * 10, H = Math.round(s.size.h * 10), D = s.size.d * 10;
+ const ct = 18, PH = 80;
+ const xs = W / 2 - ct / 2, xi = W / 2 - ct;
+ const zf = D / 2;
+ const n = 4;
+ const y0 = PH + ct, y1 = H - ct;
+ const shelfY = (i: number) => Math.round(y0 + ((y1 - y0) * (i + 1)) / (n + 1));
+ const parts: CustomPart[] = [
+ { id: "SL", name: "Side panel", size: [ct, H, D], pos: [-xs, H / 2, 0] },
+ { id: "SR", name: "Side panel", size: [ct, H, D], pos: [xs, H / 2, 0] },
+ { id: "T", name: "Top panel", size: [W - 2 * ct, ct, D], pos: [0, H - ct / 2, 0] },
+ { id: "B", name: "Bottom panel", size: [W - 2 * ct, ct, D], pos: [0, PH + ct / 2, 0] },
+ { id: "P", name: "Plinth", size: [W - 2 * ct, PH, ct], pos: [0, PH / 2, zf - 30 - ct / 2] },
+ { id: "K", name: "Back panel", size: [W, H, 3], pos: [0, H / 2, -D / 2 - 1.5], material: "fiber" },
+ { id: "J1", name: "Joining bracket", size: [W - 2 * ct - 20, 2, 40], pos: [0, H + 1, zf - 30], material: "metal" },
+ { id: "J2", name: "Joining bracket", size: [W - 2 * ct - 20, 2, 40], pos: [0, y0 + 1, zf - 30], material: "metal" },
+ ];
+ for (let i = 0; i < n; i++) parts.push({ id: `S${i}`, name: "Shelf", size: [W - 2 * ct - 4, ct, D - 20], pos: [0, shelfY(i), 10] });
+ const sg = [-1, 1];
+ const boltZ = [-D / 4, D / 4];
+ const wallX = [-(xi - 60), xi - 60];
+ const wallStep: CustomStep = {
+ title: "Fix it to the wall",
+ detail: "Screw the two wall brackets under the top at the back, then screw them to the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ kind: "anchor",
+ wall: true,
+ fix: [
+ { kind: "bracket", count: 2, at: wallX.map((x): Vec3 => [x, H - ct, -D / 2 + 20]), dir: [0, 1, 0], on: "T" },
+ { kind: "plug", count: 2, len: 35, dia: 8, at: wallX.map((x): Vec3 => [x, H - 60, -D / 2 - 40]), dir: [0, 0, -1] },
+ { kind: "screw", count: 2, len: 50, dia: 5, at: wallX.map((x): Vec3 => [x, H - 60, -D / 2 - 3]), dir: [0, 0, -1] },
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ warnings: ["wall", "tip"],
+ };
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the two feet under the bottom panel",
+ detail: "Tap the two T-nuts into the holes near the front edge first, then screw the feet in.",
+ fix: [{ kind: "foot", count: 2, len: 50, dia: 30, at: sg.map((x): Vec3 => [x * (xi - 60), PH, zf - 90]), dir: [0, 1, 0], on: "B" }],
+ wait: ["B"],
+ from: { B: [500, 0, 0] },
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the cam bolts into the sides",
+ detail: "Into the holes at the top and the bottom, by hand until they stop.",
+ fix: [{ kind: "camScrew", count: 8, to: ["SL", "SR"] }],
+ wait: ["SL", "SR"],
+ // they wait out to the sides, so they only ever move along their bolts and dowels
+ from: { SL: [-500, 0, 0], SR: [900, 0, 0] },
+ },
+ {
+ title: "Tap the dowels into the top, bottom and plinth",
+ detail: "Into the holes in their ends, all the way in.",
+ fix: [
+ { id: "T", y: H - ct / 2, zs: [-D / 2 + 40, zf - 40] },
+ { id: "B", y: PH + ct / 2, zs: [-D / 2 + 35, 0, zf - 35] },
+ { id: "P", y: 0, zs: [] },
+ ].flatMap(({ id, y, zs }) =>
+ sg.map((x) => {
+ const at: Vec3[] = id === "P" ? [20, PH - 20].map((py): Vec3 => [x * xi, py, zf - 30 - ct / 2]) : zs.map((z): Vec3 => [x * xi, y, z]);
+ return { kind: "dowel" as const, count: at.length, len: 30, dia: 8, at, dir: [-x, 0, 0] as Vec3, on: id };
+ }),
+ ),
+ wait: ["T", "B", "P"],
+ from: { T: [500, 0, 0], B: [500, 0, 0], P: [500, 0, 0] },
+ tools: ["hammer"],
+ },
+ {
+ title: "Lay a side down and stand the panels on it",
+ detail: "On a rug, holes up. Stand the top, the bottom and the plinth on its dowels.",
+ add: ["SL", "T", "B", "P"],
+ pose: "+x",
+ warnings: ["floor"],
+ },
+ { title: "Turn the cams to lock them", detail: "Drop each cam in with the arrow towards the bolt and turn it clockwise.", fix: [{ kind: "cam", count: 8, to: ["T", "B", "P"] }] },
+ {
+ title: "Put the other side on",
+ detail: "Lower it onto the dowels from above, then lock its cams the same way.",
+ add: ["SR"],
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Bolt the sides to the bottom",
+ detail: "Two long bolts through each side into the ends of the bottom panel.",
+ fix: sg.map((x) => ({ kind: "bolt", count: 2, len: 50, dia: 7, at: boltZ.map((z): Vec3 => [x * (W / 2), PH + ct / 2, z]), dir: [-x, 0, 0] as Vec3, on: x < 0 ? "SL" : "SR" })),
+ tools: ["allen"],
+ },
+ {
+ title: "Turn it over and nail the back on",
+ detail: "Lay it on its front, check it's square and nail the back to all the edges.",
+ add: ["K"],
+ fix: [{ kind: "nail", count: 47, to: ["K"] }],
+ pose: "-z",
+ check: "square",
+ },
+ {
+ title: "Screw a joining bracket across the top and the bottom",
+ detail: "Along the front edge, three screws each. They join it to the wardrobe beside it later.",
+ add: ["J1", "J2"],
+ fix: [{ kind: "screw", count: 6, len: 12, dia: 4, at: [H + 2, y0 + 2].flatMap((y) => [-150, 0, 150].map((x): Vec3 => [x, y, zf - 30])), dir: [0, -1, 0] }],
+ },
+ { title: "Stand it up together", detail: "Lift it from the top end and walk it up, with a cloth under the bottom edge.", pose: "+y", people: 2, kind: "standup", warnings: ["two", "floor"] },
+ ];
+ if (!inSet) steps.push(wallStep, { title: "Screw it to the wardrobe beside it", detail: "Push it against the side of the next frame, fronts in line, and screw the joining brackets into it.", tools: ["screwdriver"] });
+ steps.push(
+ {
+ title: "Click in the four corner fittings",
+ detail: "Two on the inside of each side at the front, near the top and near the bottom. They hold the corner doors.",
+ fix: sg.map((x) => ({ kind: "clip", name: "Corner fitting", count: 2, len: 20, dia: 30, at: [y0 + 200, H - 200].map((y): Vec3 => [x * xi, y, zf - 20]), dir: [x, 0, 0] as Vec3, on: x < 0 ? "SL" : "SR" })),
+ },
+ {
+ title: "Press on the four bumpers",
+ detail: "On the front edges of the sides, near the top and near the bottom.",
+ fix: [{ kind: "glide", count: 4, len: 3, dia: 12, at: sg.flatMap((x) => [y0 + 100, H - 100].map((y): Vec3 => [x * xs, y, zf])), dir: [0, 0, -1] }],
+ },
+ {
+ title: "Push in the pins and lay the shelves on",
+ detail: "Four pins a shelf, at the same height on both sides.",
+ add: parts.filter((p) => p.name === "Shelf").map((p) => p.id),
+ fix: [{ kind: "pin", count: 16, to: ["SL", "SR"] }],
+ },
+ );
+ if (inSet) steps.push(wallStep);
+ return { parts, steps };
+}
+
+/** A frame of a row: a PAX frame, or the add-on corner unit from its own manual. */
function frame(b: PlanBuilder, s: ProductSpec) {
- if (!build(b, s)) buildCabinet(b, s);
+ if (unitOf(s)?.corner || /corner unit/i.test(s.variant)) buildCustom(b, { ...s, custom: cornerUnit(s, !!unitOf(s)) });
+ else build(b, s);
}
const family: Family = {
names: ["PAX"],
build(b, s) {
- // the add-on corner unit of a corner wardrobe has its own manual
- if (unitOf(s)?.corner) return false;
+ // the add-on corner unit has its own manual
+ if (unitOf(s)?.corner || /corner unit/i.test(s.variant)) {
+ buildCustom(b, { ...s, custom: cornerUnit(s, !!unitOf(s)) });
+ return true;
+ }
return build(b, s);
},
row(b, s) {
diff --git a/src/lib/plan/families/perjohan.ts b/src/lib/plan/families/perjohan.ts
index c615db8..32d308b 100644
--- a/src/lib/plan/families/perjohan.ts
+++ b/src/lib/plan/families/perjohan.ts
@@ -131,7 +131,7 @@ function recipe(s: ProductSpec) {
{
title: "Screw the seat down",
detail: "One screw down through each plank into each end panel.",
- fix: [{ ...SCREW, count: 4, dir: [0, -1, 0], at: ends.flatMap((e) => [-1, 1].map((z) => [e * sx, H, z * (D / 4)] as Vec3)) }],
+ fix: [{ ...SCREW, count: 4, dir: [0, -1, 0], at: ends.flatMap((e) => [-1, 1].map((z) => [e * sx, H, z * (sideD / 2 - 30)] as Vec3)) }], // outside the dowels
},
);
if (bench) {
diff --git a/src/lib/plan/families/piplarka.ts b/src/lib/plan/families/piplarka.ts
index ad35564..13caa5d 100644
--- a/src/lib/plan/families/piplarka.ts
+++ b/src/lib/plan/families/piplarka.ts
@@ -66,7 +66,7 @@ function desk(): CustomParams {
...[ZF - 15, zMid, -ZF + 15].map((z) => box([-XF + 15, yF0, z - 15], [XF - 15, yF1, z + 15])),
...[-1, 1].map((sx) => box([sx * (XF + 15), yF0 - 40, -60], [sx * (XF + 25), yF0, -40])),
], "metal"),
- ...[-1, 1].map((sx): CustomPart => ({ ...panel(sx < 0 ? "HGL" : "HGR", "Hinge", [sx * 300 - 40, yF1, zMid - 30], [sx * 300 + 40, yT0, zMid + 30]), material: "metal" })),
+ ...[-1, 1].map((sx): CustomPart => ({ ...panel(sx < 0 ? "HGL" : "HGR", "Hinge", [sx * 300 - 40, yF1, zMid - 20], [sx * 300 + 40, yT0, zMid + 60]), material: "metal" })),
panel("TOP", "Desk top", [-400, yT0, -105], [400, yT1, ZF]),
// the shelf unit at the back
panel("HB", "Shelf bottom", [-400, yH0, zH0], [400, yH1, zH1]),
@@ -82,7 +82,8 @@ function desk(): CustomParams {
const legId = (sx: number, sz: number) => `LL${sx < 0 ? 0 : 1}${sz < 0 ? 0 : 1}`;
const legScrews = (sx: number) => [-1, 1].flatMap((sz) => [230, 265].map((y) => fx("screw", [[sx * (xL + 18), y, sz * zAt(y)]], [-sx, 0, 0], sx < 0 ? "LFL" : "LFR", { ...SHORT, mate: legId(sx, sz) })));
const plateScrews = (sx: number) => fx("screw", [-1, 1].flatMap((sz) => [-25, 25].map((dz): Vec3 => [sx * xL, yF0 - 6, sz * zTop + dz])), [0, 1, 0], sx < 0 ? "LFL" : "LFR", { ...SHORT, mate: "FR" });
- const hingeTop = (sx: number) => fx("screw", [-30, 0, 30].map((dx): Vec3 => [sx * 300 + dx, yT0, zMid]), [0, 1, 0], sx < 0 ? "HGL" : "HGR", { ...SHORT, mate: "TOP" });
+ // the hinge reaches forward from the cross tube to under the top's back edge
+ const hingeTop = (sx: number) => fx("screw", [-30, 0, 30].map((dx): Vec3 => [sx * 300 + dx, yT0, zMid + 45]), [0, 1, 0], sx < 0 ? "HGL" : "HGR", { ...SHORT, mate: "TOP" });
const spacers: Vec3[] = [[-300, yF1, -ZF + 15], [0, yF1, -ZF + 15], [300, yF1, -ZF + 15], [-200, yF1, zMid], [200, yF1, zMid]];
const yM = (yH0 + yH1) / 2;
const steps: CustomStep[] = [
@@ -119,7 +120,7 @@ function desk(): CustomParams {
title: "Turn it over and fit the hinges",
detail: "Stand the desk on its feet. One screw holds each hinge on the cross tube.",
add: ["HGL", "HGR"],
- fix: [-1, 1].map((sx) => fx("screw", [[sx * 300, yT0, zMid + 22]], [0, -1, 0], sx < 0 ? "HGL" : "HGR", { ...SHORT, mate: "FR" })),
+ fix: [-1, 1].map((sx) => fx("screw", [[sx * 300, yT0, zMid]], [0, -1, 0], sx < 0 ? "HGL" : "HGR", { ...SHORT, mate: "FR" })),
tools: ["allen"],
pose: "+y",
},
diff --git a/src/lib/plan/families/platsa.ts b/src/lib/plan/families/platsa.ts
index 9759c24..811593a 100644
--- a/src/lib/plan/families/platsa.ts
+++ b/src/lib/plan/families/platsa.ts
@@ -12,8 +12,9 @@ import { buildCustom } from "../custom";
* stacks on a bigger one on four sleeves and screws. LÄTTHET legs, SPILDRA tops, HJÄLPA shelves, rails, baskets,
* drawers and soft-closing hinges follow their own manuals. The open units are a different system: four welded
* steel frames bolted into a tube while it lies on its side.
- * Combinations of frames of different heights (most of the "wardrobe with 3/4/6 doors" sets) aren't covered: the
- * row code would repeat one frame, so those keep the old guide.
+ * The "wardrobe with 3/4/6 doors" sets are rows of frames of different heights, read from their parts lists and
+ * photos: each column built the same way, joined with plates, small frames stacked on tall ones, a SPILDRA top on
+ * each low column, and on the 300 cm set frames hung on LÄTTHET suspension rails beside the stack.
*/
const t = 16; // panel thickness
@@ -72,14 +73,90 @@ interface Layout {
legs: boolean;
top: boolean; // a SPILDRA top
wallLast: boolean; // a frame in a row: its wall fixing waits until they all stand together
+ leg?: number; // leg height, mm (LÄTTHET 11 cm unless said)
+ feet?: boolean; // LÄTTHET adjustable feet instead of legs: 1 cm
+ colTops?: string[]; // a SPILDRA top on each of these frames instead of one across the whole width
}
-const COMBOS_OLD = /^platsa-wardrobe-(3-doors|4-doors|w-6-doors-240|w-6-doors-300)/;
+const FEET = 10;
+const legH = (L: Layout) => (L.legs ? (L.leg ?? LEG) : L.feet ? FEET : 0);
+
+/** The wardrobe sets of different heights, column by column from the left: frame heights from the bottom up. */
+function comboOf(slug: string, W: number, H: number, D: number): Layout | null {
+ type Col = { hs: number[]; o: Partial<Frame>[] };
+ const sh = (...ys: number[]): Inside[] => ys.map((y) => ({ kind: "shelf", y }));
+ const leg = 110;
+ let cols: Col[], feet = false, tops: [number, number][] = []; // [column, frame index] with a SPILDRA top
+ if (slug === "platsa-wardrobe-3-doors-180-x-57-x-133") {
+ cols = [{ hs: [400], o: [{ door: "L", inside: sh(200) }] }, { hs: [600], o: [{ door: "L", inside: sh(300) }] }, { hs: [1200], o: [{ door: "L", inside: sh(600) }] }];
+ tops = [[0, 0], [1, 0], [2, 0]];
+ } else if (slug === "platsa-wardrobe-3-doors-180-x-57-x-181") {
+ cols = [
+ { hs: [1800], o: [{ door: "L", inside: [{ kind: "shelf", y: 400 }, { kind: "rail", y: 1700 }] }] },
+ { hs: [1200], o: [{ door: "L", inside: sh(300, 600, 900) }] },
+ { hs: [600], o: [{ door: "L", inside: [{ kind: "basket", y: 60 }, { kind: "basket", y: 300 }] }] },
+ ];
+ feet = true;
+ tops = [[1, 0], [2, 0]];
+ } else if (slug === "platsa-wardrobe-3-doors-180-x-42-x-191") {
+ cols = [
+ { hs: [1800], o: [{ door: "L", inside: [{ kind: "shelf", y: 300 }, { kind: "shelf", y: 600 }, { kind: "rail", y: 1700 }] }] },
+ { hs: [400], o: [{ door: "L", inside: [{ kind: "shoe", y: 60 }] }] },
+ { hs: [400], o: [{ door: "R", inside: [{ kind: "shoe", y: 60 }] }] },
+ ];
+ tops = [[1, 0], [2, 0]];
+ } else if (slug === "platsa-wardrobe-3-doors-180-x-57-x-191") {
+ cols = [{ hs: [1800], o: [{ door: "L", inside: [{ kind: "shelf", y: 300 }, { kind: "shelf", y: 700 }, { kind: "rail", y: 1700 }] }] }, { hs: [400], o: [{ door: "L", inside: sh(200) }] }, { hs: [400], o: [{ door: "R", inside: sh(200) }] }];
+ tops = [[1, 0], [2, 0]];
+ } else if (slug === "platsa-wardrobe-4-doors-240-x-57-x-191") {
+ cols = [0, 1, 2].map((): Col => ({ hs: [400], o: [{ door: "L", inside: sh(200) }] }));
+ cols.push({ hs: [1800], o: [{ door: "L", inside: sh(300, 600, 900, 1200, 1500) }] });
+ tops = [[0, 0], [1, 0], [2, 0]];
+ } else if (slug === "platsa-wardrobe-w-6-doors-240-x-57-x-221" || slug === "platsa-wardrobe-w-6-doors-240-x-57-x-231") {
+ cols = [
+ { hs: [600], o: [{ door: "L", inside: sh(300) }] },
+ { hs: [600, 400], o: [{ door: "L", inside: [{ kind: "basket", y: 60 }, { kind: "basket", y: 300 }] }, { door: "L" }] },
+ { hs: [1800], o: [{ door: "L", inside: [{ kind: "rail", y: 900 }, { kind: "rail", y: 1700 }] }] },
+ { hs: [1800, 400], o: [{ door: "R", inside: [{ kind: "rail", y: 1700 }] }, { door: "R" }] },
+ ];
+ feet = slug.endsWith("221");
+ tops = [[0, 0], [1, 1]];
+ } else if (slug === "platsa-wardrobe-w-6-doors-300-x-42-x-241") {
+ // the 180 frame in the middle with a 60 frame on it, two more 60 frames hung on the wall each side
+ const col = (x: number, i: number): Frame => ({ id: "", x, y: FEET + 1800, w: 600, h: 600, door: i % 2 ? "R" : "L", inside: sh(300) });
+ const fs: Frame[] = [
+ { id: "", x: 0, y: FEET, w: 600, h: 1800, door: "L", inside: [{ kind: "shelf", y: 300 }, { kind: "shelf", y: 600 }, { kind: "rail", y: 1700 }] },
+ col(0, 0),
+ ...[-1200, -600, 600, 1200].map((x, i) => col(x, i + 1)),
+ ];
+ return { W, H, D, df: D - DOOR, frames: fs.map((f, i) => ({ ...f, id: `F${i}` })), legs: false, feet: true, top: false, wallLast: true };
+ } else return null;
+ const y0 = feet ? FEET : leg;
+ const x0 = -W / 2 + 300;
+ const frames: Frame[] = [];
+ const topIds: string[] = [];
+ // bottom frames first, left to right, then the stacked ones
+ const all = cols.flatMap((c, ci) => {
+ let y = y0;
+ return c.hs.map((h, k) => {
+ const f: Frame = { id: "", x: x0 + ci * 600, y, w: 600, h, inside: [], ...c.o[k] };
+ y += h;
+ return { f, ci, k };
+ });
+ });
+ for (const e of [...all.filter((e) => e.k === 0), ...all.filter((e) => e.k > 0)]) {
+ e.f.id = `F${frames.length}`;
+ frames.push(e.f);
+ if (tops.some(([c, k]) => c === e.ci && k === e.k)) topIds.push(e.f.id);
+ }
+ return { W, H, D, df: D - DOOR, frames, legs: !feet, feet, leg, top: false, colTops: topIds, wallLast: true };
+}
function layoutOf(s: ProductSpec): Layout | null {
const slug = s.slug ?? "";
const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
- if (COMBOS_OLD.test(slug)) return null;
+ const combo = comboOf(slug, W, H, D);
+ if (combo) return combo;
const col = (x: number, w: number, hs: number[], o: (i: number) => Partial<Frame> = () => ({}), y0 = 0): Frame[] => {
let y = y0;
return hs.map((h, i) => {
@@ -168,9 +245,9 @@ const spacerXs = (f: Frame) => [f.x - f.w / 2 + 120, f.x + f.w / 2 - 120];
const spacers = (f: Frame, g: FrameGeo) => fixAt(SPACER, spacerXs(f).map((x): Vec3 => [x, f.y + f.h - t / 2, g.z0]), [0, 0, 1], `${f.id}T`);
const caps = (f: Frame, g: FrameGeo) => fixAt(SPACER_CAP, spacerXs(f).map((x): Vec3 => [x, f.y + f.h - t / 2, g.z0 - 24]), [0, 0, 1], `${f.id}T`);
-function legParts(f: Frame, g: FrameGeo): CustomPart[] {
+function legParts(f: Frame, g: FrameGeo, h = LEG): CustomPart[] {
return [-1, 1].flatMap((sx) =>
- [g.z0 + 45, g.zf - 45].map((z, k): CustomPart => ({ id: `${f.id}G${sx < 0 ? "L" : "R"}${k}`, name: "Leg", size: [45, LEG, 45], pos: [f.x + sx * (f.w / 2 - 40), LEG / 2, z], material: "wood" })),
+ [g.z0 + 45, g.zf - 45].map((z, k): CustomPart => ({ id: `${f.id}G${sx < 0 ? "L" : "R"}${k}`, name: "Leg", size: [45, h, 45], pos: [f.x + sx * (f.w / 2 - 40), h / 2, z], material: "wood" })),
);
}
const legPts = (f: Frame, g: FrameGeo, y: number): Vec3[] => [-1, 1].flatMap((sx) => [g.z0 + 45, g.zf - 45].map((z): Vec3 => [f.x + sx * (f.w / 2 - 40), y, z]));
@@ -178,7 +255,8 @@ const legPts = (f: Frame, g: FrameGeo, y: number): Vec3[] => [-1, 1].flatMap((sx
/** Join plates round the front edges of two frames side by side, two screws in each. */
function joinFixes(a: Frame, b: Frame, g: FrameGeo): CustomFix[] {
const xj = a.x + a.w / 2;
- const ys = a.h >= 1200 ? [a.y + a.h - 400, a.y + a.h - 1100] : [a.y + a.h / 2];
+ const h = Math.min(a.h, b.h), y0 = Math.max(a.y, b.y); // frames of different heights: only where both sides are
+ const ys = h >= 1200 ? [y0 + h - 400, y0 + h - 1100] : [y0 + h / 2];
return [
fixAt(JOIN_PLATE, ys.map((y): Vec3 => [xj, y, g.zf - 30]), [0, 0, -1], `${a.id}R`, `${b.id}L`),
fixAt(SMALL_SCREW, ys.flatMap((y): Vec3[] => [[xj - t, y + 30, g.zf - 20], [xj - t, y - 30, g.zf - 20]]), [1, 0, 0], `${a.id}R`),
@@ -195,12 +273,15 @@ function stackFixes(lo: Frame, up: Frame, g: FrameGeo): CustomFix[] {
function framesRecipe(L: Layout, g: FrameGeo): { recipe: CustomParams; tops: Frame[] } {
const parts: CustomPart[] = [];
const steps: CustomStep[] = [];
- const bottoms = L.frames.filter((f) => f.y <= (L.legs ? LEG : 0) + 1);
- const stacked = L.frames.filter((f) => !bottoms.includes(f));
+ const base = legH(L), LH = L.leg ?? LEG;
+ const bottoms = L.frames.filter((f) => f.y <= base + 1);
+ const below = (up: Frame) => L.frames.find((o) => Math.abs(o.x - up.x) < 1 && Math.abs(o.y + o.h - up.y) < 1);
+ const stacked = L.frames.filter((f) => !bottoms.includes(f) && below(f));
+ const hung = L.frames.filter((f) => !bottoms.includes(f) && !below(f));
const isTop = (f: Frame) => !L.frames.some((o) => o !== f && Math.abs(o.x - f.x) < 1 && o.y > f.y);
const tops = L.frames.filter(isTop);
for (const f of L.frames) parts.push(...framePanels(f, g, L.df));
- if (L.legs) for (const f of bottoms) parts.push(...legParts(f, g));
+ if (L.legs) for (const f of bottoms) parts.push(...legParts(f, g, LH));
const first = bottoms[0];
const tall = first.h >= 1200;
@@ -230,20 +311,22 @@ function framesRecipe(L: Layout, g: FrameGeo): { recipe: CustomParams; tops: Fra
steps.push({
title: "Screw the legs on",
detail: "Screw a rod and sleeve into each leg with the spanner, then turn the legs into the bottom by hand.",
- add: legParts(first, g).map((p) => p.id),
- fix: [fixAt(LEG_SLEEVE, legPts(first, g, LEG), [0, 1, 0]), fixAt(ROD, legPts(first, g, LEG - 25), [0, 1, 0])],
+ add: legParts(first, g, LH).map((p) => p.id),
+ fix: [fixAt(LEG_SLEEVE, legPts(first, g, LH), [0, 1, 0]), fixAt(ROD, legPts(first, g, LH - 25), [0, 1, 0])],
tools: ["wrench"],
});
steps.push({ title: "Screw the feet into the legs", detail: "All the way in for now. They level it later.", fix: [fixAt(LEG_FOOT, legPts(first, g, 0), [0, 1, 0])] });
}
+ if (L.feet) steps.push({ title: "Screw in the adjustable feet", detail: "Four into the holes under the bottom, all the way in for now. They level it later.", fix: [fixAt(LEG_FOOT, legPts(first, g, FEET), [0, 1, 0], `${first.id}B`)] });
// the other columns, built the same way and stood next to it
const others = bottoms.slice(1);
if (others.length) {
const fix: CustomFix[] = others.flatMap((f) => rivets(f, g));
if (others.some(isTop)) fix.push(...others.filter(isTop).map((f) => spacers(f, g)));
- const add = others.flatMap((f) => [...panels(f), ...(L.legs ? legParts(f, g).map((p) => p.id) : [])]);
- if (L.legs) for (const f of others) fix.push(fixAt(LEG_SLEEVE, legPts(f, g, LEG), [0, 1, 0]), fixAt(ROD, legPts(f, g, LEG - 25), [0, 1, 0]), fixAt(LEG_FOOT, legPts(f, g, 0), [0, 1, 0]));
+ const add = others.flatMap((f) => [...panels(f), ...(L.legs ? legParts(f, g, LH).map((p) => p.id) : [])]);
+ if (L.legs) for (const f of others) fix.push(fixAt(LEG_SLEEVE, legPts(f, g, LH), [0, 1, 0]), fixAt(ROD, legPts(f, g, LH - 25), [0, 1, 0]), fixAt(LEG_FOOT, legPts(f, g, 0), [0, 1, 0]));
+ if (L.feet) for (const f of others) fix.push(fixAt(LEG_FOOT, legPts(f, g, FEET), [0, 1, 0], `${f.id}B`));
steps.push({
title: others.length > 1 ? "Build the other frames the same way" : "Build the second frame the same way",
detail: "Every step as for the first one, lying on its front.",
@@ -268,7 +351,7 @@ function framesRecipe(L: Layout, g: FrameGeo): { recipe: CustomParams; tops: Fra
tools: ["screwdriver"],
});
for (const up of stacked) {
- const lo = L.frames.find((o) => Math.abs(o.x - up.x) < 1 && Math.abs(o.y + o.h - up.y) < 1)!;
+ const lo = below(up)!;
steps.push({
title: "Build the small frame the same way",
detail: "Lying on its front, then stand it up.",
@@ -285,6 +368,49 @@ function framesRecipe(L: Layout, g: FrameGeo): { recipe: CustomParams; tops: Fra
warnings: ["two"],
});
}
+ if (hung.length) {
+ // frames on the wall beside the stack: a suspension rail for each, then the frame hooked on and joined to its neighbour
+ for (const f of hung) parts.push({ id: `${f.id}S`, name: "Suspension rail", size: [f.w - 40, 40, 6], pos: [f.x, f.y + f.h - 70, g.z0 - 3], material: "metal" });
+ const railPts = hung.flatMap((f) => [-1, 1].map((sx): Vec3 => [f.x + sx * (f.w / 2 - 80), f.y + f.h - 70, g.z0 - 6]));
+ steps.push({
+ title: "Screw the suspension rails to the wall",
+ detail: "Level with the top of the frame on the stack, one rail for each frame. Wall screws and plugs aren't included: pick ones made for your wall.",
+ add: hung.map((f) => `${f.id}S`),
+ fix: [
+ { kind: "plug", count: railPts.length, at: railPts.map((p): Vec3 => [p[0], p[1], p[2] - 30]), dir: [0, 0, -1] },
+ { kind: "screw", count: railPts.length, len: 50, dia: 5, at: railPts, dir: [0, 0, -1] },
+ ],
+ tools: ["drill", "level", "screwdriver"],
+ wall: true,
+ warnings: ["wall"],
+ });
+ const hp = (f: Frame, sx: number) => f.x + sx * (f.w / 2 - t);
+ steps.push({
+ title: hung.length > 1 ? "Build the wall frames the same way" : "Build the wall frame the same way",
+ detail: "Lying on its front. Then screw a suspension fitting into each top back corner, inside, two screws each.",
+ add: hung.flatMap(panels),
+ fix: [
+ ...hung.flatMap((f) => rivets(f, g)),
+ ...hung.map((f) => spacers(f, g)),
+ ...hung.map((f) => fixAt({ kind: "hook", len: 40, dia: 30 }, [-1, 1].map((sx): Vec3 => [hp(f, sx), f.y + f.h - 70, g.z0 + 25]), [0, 0, 1], `${f.id}T`)),
+ ...hung.flatMap((f) => [-1, 1].map((sx) => fixAt(SMALL_SCREW, [-26, 26].map((dy): Vec3 => [hp(f, sx) - sx * 4, f.y + f.h - 70 + dy, g.z0 + 25]), [sx, 0, 0], `${f.id}${sx < 0 ? "L" : "R"}`))),
+ ].slice(0, 24),
+ from: Object.fromEntries(hung.flatMap(panels).map((id) => [id, [0, 0, -500] as Vec3])),
+ wait: hung.flatMap(panels),
+ });
+ steps.push({
+ title: hung.length > 1 ? "Hang the frames on the rails" : "Hang the frame on the rail",
+ detail: "Together: lift each one so its fittings hook over the rail, then slide it against the frame beside it.",
+ add: hung.flatMap(panels),
+ from: Object.fromEntries(hung.flatMap(panels).map((id) => [id, [0, 120, 260] as Vec3])),
+ people: 2,
+ warnings: ["two"],
+ });
+ const row = L.frames.filter((f) => hung.some((h) => Math.abs(h.y - f.y) < 1)).sort((a, b) => a.x - b.x);
+ const pairs = row.slice(1).map((f, i) => [row[i], f] as const).filter(([a, b]) => Math.abs(a.x + a.w / 2 - (b.x - b.w / 2)) < 1);
+ if (pairs.length)
+ steps.push({ title: "Join the wall frames to their neighbours", detail: "A plate round the front edges between each pair, two screws on each side.", fix: pairs.flatMap(([a, b]) => joinFixes(a, b, g)).slice(0, 24), tools: ["screwdriver"] });
+ }
steps.push({ title: "Screw the caps onto the spacers", detail: "Turn them on by hand at the back of the top.", fix: tops.map((f) => caps(f, g)) });
steps.push({
title: "Push it against the wall",
@@ -292,6 +418,16 @@ function framesRecipe(L: Layout, g: FrameGeo): { recipe: CustomParams; tops: Fra
warnings: ["tip"],
});
if (L.legs) steps.push({ title: "Level it on the feet", detail: "Turn the feet with the spanner until it stands level and steady.", tools: ["wrench", "level"] });
+ if (L.feet) steps.push({ title: "Level it on the feet", detail: "Turn the adjustable feet until it stands level and steady.", tools: ["level"] });
+ if (L.colTops?.length) {
+ const tf = L.frames.filter((f) => L.colTops!.includes(f.id));
+ const pts = (f: Frame, y: number) => [-1, 1].flatMap((sx) => [g.z0 + 80, g.zf - 80].map((z): Vec3 => [f.x + sx * (f.w / 2 - t - 60), y, z]));
+ const top = (f: Frame) => `${f.id}TOP`;
+ for (const f of tf) parts.push({ id: top(f), name: "Top", size: [f.w, 20, L.D], pos: [f.x, f.y + f.h + 10, 0], material: "board" });
+ steps.push({ title: tf.length > 1 ? "Press the sleeves into the low frames' tops" : "Press the sleeves into the low frame's top", detail: "Four in the holes near the corners of each.", fix: tf.map((f) => fixAt(SLEEVE, pts(f, f.y + f.h), [0, -1, 0], `${f.id}T`)) });
+ steps.push({ title: tf.length > 1 ? "Lay the tops on" : "Lay the top on", detail: "Lower each straight onto its sleeves, flush at the back.", add: tf.map(top), from: Object.fromEntries(tf.map((f) => [top(f), [0, 260, 0] as Vec3])) });
+ steps.push({ title: "Screw them on from inside", detail: "Four screws up through each frame's top into the sleeves.", fix: tf.map((f) => fixAt(STACK_SCREW, pts(f, f.y + f.h - t - 20), [0, 1, 0], `${f.id}T`, top(f))), tools: ["screwdriver"] });
+ }
if (L.top) {
const tf = tops;
const pts = (f: Frame, y: number) => [-1, 1].flatMap((sx) => [g.z0 + 80, g.zf - 80].map((z): Vec3 => [f.x + sx * (f.w / 2 - t - 60), y, z]));
@@ -578,7 +714,11 @@ function openRecipe(o: Open): { frame: CustomParams; inside: CustomParams | null
});
const parts = [side(-1), end(false), end(true), side(1)];
const corners = (sx: number): Vec3[] => [H - b / 2, b / 2].flatMap((y) => [-D / 2 + b / 2, D / 2 - b / 2].map((z): Vec3 => [sx * (W / 2), y, z]));
- const small = (sx: number, n: number): Vec3[] => [H - b - 2, b + 2].flatMap((y) => [-D / 2 + b / 2].map((z): Vec3 => [sx * (W / 2 - b - 10), y, z])).concat(n > 2 ? [H - b - 2, b + 2].map((y): Vec3 => [sx * (W / 2 - b - 10), y, D / 2 - b / 2]) : []);
+ // from inside the corner: up into the top frame, down into the bottom one
+ const small = (sx: number, n: number, side: string): CustomFix[] =>
+ ([[H - b - 2, 1, "ET"], [b + 2, -1, "EB"]] as const).map(([y, d, on]) =>
+ fixAt(SMALL_SCREW, [-D / 2 + b / 2, ...(n > 2 ? [D / 2 - b / 2] : [])].map((z): Vec3 => [sx * (W / 2 - b - 10), y, z]), [0, d, 0], on, side),
+ );
const half = o.screws / 2;
const tall = H >= 1200;
const steps: CustomStep[] = [
@@ -592,13 +732,13 @@ function openRecipe(o: Open): { frame: CustomParams; inside: CustomParams | null
warnings: ["floor"],
people: tall ? 2 : 1,
},
- { title: "Screw the corners together", detail: "The small screws go in from inside, where the frames meet.", fix: [fixAt(SMALL_SCREW, small(-1, half), [0, 1, 0], "EB", "SL")], tools: ["screwdriver"] },
+ { title: "Screw the corners together", detail: "The small screws go in from inside, where the frames meet.", fix: small(-1, half, "SL"), tools: ["screwdriver"] },
{ title: "Lay the other side frame on", detail: "Line its holes up with the ends of both frames.", add: ["SR"] },
{ title: "Bolt it on", detail: "Two bolts at each end. Now tighten all eight.", fix: [fixAt(FRAME_BOLT, corners(1), [-1, 0, 0], "SR", "ET")], tools: ["allen"], check: "square" },
{
title: tall ? "Stand it up together and screw the last corners" : "Stand it up and screw the last corners",
detail: "The rest of the small screws, from inside where the side meets the frames.",
- fix: [fixAt(SMALL_SCREW, small(1, half), [0, 1, 0], "EB", "SR")],
+ fix: small(1, half, "SR"),
tools: ["screwdriver"],
pose: "+y",
people: tall ? 2 : 1,
@@ -677,5 +817,12 @@ const family: Family = {
buildFrames(b, s, L);
return true;
},
+ // the wardrobe sets are rows of frames of different heights: drawn whole, not as one frame repeated
+ row(b, s) {
+ const L = comboOf(s.slug ?? "", s.size.w * 10, s.size.h * 10, s.size.d * 10);
+ if (!L) return false;
+ buildFrames(b, s, L);
+ return true;
+ },
};
export default family;
diff --git a/src/lib/plan/families/poang.ts b/src/lib/plan/families/poang.ts
index a76a2b6..6d4217d 100644
--- a/src/lib/plan/families/poang.ts
+++ b/src/lib/plan/families/poang.ts
@@ -83,12 +83,13 @@ function chair(o: Chair) {
railZ.forEach((z, i) => parts.push({ id: `R${i}`, name: "Cross rail", size: [2 * FX - 30, 40, 30], pos: [0, railY[i] - 30, z], material: "wood" }));
// side frames
- const arm: P2[] = s([[-240, 615], [120, 620], [270, 605], [320, 560]]);
+ // the arm runs back to the back rail, where it is bolted on from the outside
+ const arm: P2[] = s([[-290, 615], [-240, 615], [120, 620], [270, 605], [320, 560]]);
const sideFrame = (sx: number): PartPiece[] => {
const x = sx * FX;
if (rocker) {
const leg: P2[] = s([[320, 560], [300, 420], [270, 250], [250, 30]]);
- const rock: P2[] = s([[450, 55], [300, 12], [100, 0], [-150, 5], [-350, 35], [-470, 100], [-470, 190], [-390, 270], [-230, 330]]);
+ const rock: P2[] = s([[450, 55], [300, 12], [100, 0], [-150, 5], [-350, 35], [-470, 100], [-470, 190], [-390, 270], [-230, 330], [-150, 345]]);
return [...path(arm, x, 30, 60), ...path(leg, x, 30, 56), ...path(rock, x, 30, 50)];
}
const leg: P2[] = s([[320, 560], [335, 420], [335, 90], [310, 25], [250, 15]]);
@@ -122,11 +123,12 @@ function chair(o: Chair) {
const [za, ya] = arm[0];
const armJoin = (sx: number): CustomFix[] => {
const id = sx < 0 ? "FL" : "FR";
- const at: Vec3 = [sx * FX, ya + 30, za + 40];
+ // through the arm's back end into the side of the back rail, the dowel just below it
+ const at: Vec3 = [sx * (FX + 15), ya, za + 12];
return [
- { kind: "dowel", count: 1, len: 40, dia: 8, at: [[sx * FX, ya - 30, za + 110]], dir: [0, -1, 0], on: id },
- ...(rocker ? [] : [{ kind: "washer" as const, name: "Rubber washer", count: 1, len: 4, dia: 20, at: [at], dir: [0, -1, 0] as Vec3, on: id }]),
- { kind: "bolt", count: 1, ...MID, at: [at], dir: [0, -1, 0], on: id, mate: `BR${sx < 0 ? 0 : 1}` },
+ { kind: "dowel", count: 1, len: 40, dia: 8, at: [[sx * (FX - 15), ya - 40, za + 22]], dir: [sx, 0, 0], on: id },
+ ...(rocker ? [] : [{ kind: "washer" as const, name: "Rubber washer", count: 1, len: 4, dia: 20, at: [[sx * (FX - 15), ya, za + 12] as Vec3], dir: [-sx, 0, 0] as Vec3, on: id }]),
+ { kind: "bolt", count: 1, ...MID, at: [at], dir: [-sx, 0, 0], on: id, mate: `BR${sx < 0 ? 0 : 1}` },
];
};
// low bolts through the frame into barrel nuts in the cross rails (one on the rocking chair, which takes a second bolt at the back)
@@ -135,7 +137,8 @@ function chair(o: Chair) {
const pts: Vec3[] = (rocker ? [railZ[0]] : railZ).map((z, i) => [sx * (FX + 15), railY[i] - 30, z] as Vec3);
const nuts: CustomFix[] = pts.map((p, i) => ({ kind: "nut", name: "Barrel nut", count: 1, len: 14, dia: 10, at: [[sx * (FX - 150), p[1], p[2]]], dir: [0, 0, -1], on: `R${i}` }));
const out: CustomFix[] = [...nuts, { kind: "bolt", count: pts.length, ...LONG, at: pts, dir: [-sx, 0, 0], on: id }];
- if (rocker) out.push({ kind: "bolt", count: 1, ...MID, at: [[sx * (FX + 15), 300, z0 - 250]], dir: [-sx, 0, 0], on: id, mate: "S" });
+ // the rocker's back end meets the seat bar where the seat joins the back
+ if (rocker) out.push({ kind: "bolt", count: 1, ...MID, at: [[sx * (FX + 15), 345, z0 - 150]], dir: [-sx, 0, 0], on: id, mate: "S" });
return out;
};
diff --git a/src/lib/plan/families/racknas.ts b/src/lib/plan/families/racknas.ts
index b5097f7..c1d9ca8 100644
--- a/src/lib/plan/families/racknas.ts
+++ b/src/lib/plan/families/racknas.ts
@@ -41,11 +41,11 @@ const side = (sx: number) => (sx < 0 ? "SL" : "SR");
function drawerParts(i: number): CustomPart[] {
const f0 = FRONTS[i], b0 = f0 + 15, b1 = f0 + 165, xo = 315, t = 12, zb = -175, zf = ZF - T;
return [
- panel(`F${i}`, "Drawer front", [-XI + 2, f0, zf], [XI - 2, f0 + FH, ZF]),
- panel(`L${i}`, "Drawer side", [-xo, b0, zb], [-xo + t, b1, zf]),
- panel(`R${i}`, "Drawer side", [xo - t, b0, zb], [xo, b1, zf]),
- panel(`B${i}`, "Drawer bottom", [-xo + 6, b0 + 10, zb + 15], [xo - 6, b0 + 13, zf], "fiber"),
- panel(`K${i}`, "Drawer back", [-xo + t, b0, zb], [xo - t, b1, zb + 15]),
+ panel(`DF${i}`, "Drawer front", [-XI + 2, f0, zf], [XI - 2, f0 + FH, ZF]),
+ panel(`DL${i}`, "Drawer side", [-xo, b0, zb], [-xo + t, b1, zf]),
+ panel(`DR${i}`, "Drawer side", [xo - t, b0, zb], [xo, b1, zf]),
+ panel(`DB${i}`, "Drawer bottom", [-xo + 6, b0 + 10, zb + 15], [xo - 6, b0 + 13, zf], "fiber"),
+ panel(`DK${i}`, "Drawer back", [-xo + t, b0, zb], [xo - t, b1, zb + 15]),
];
}
@@ -74,7 +74,7 @@ function chest(): CustomParams {
fx("screw", [0, 1, 2].flatMap((i) => [-120, 120].map((z): Vec3 => [sx * XI, runY(i), z])), [sx, 0, 0], side(sx), { len: 12, dia: 4 }),
];
const conn = (sx: number, pts: [string, number, number][]) => pts.map(([id, y, z]) => fx("screw", [[sx * (W / 2), y, z]], [-sx, 0, 0], side(sx), { ...CONN, mate: id }));
- const topPts = (): [string, number, number][] => [["TOP", yTop + 9, -60], ["TOP", yTop + 9, 120]];
+ const topPts = (): [string, number, number][] => [["TOP", yTop + 9, -60], ["TOP", yTop + 9, 60]];
const railPts = (): [string, number, number][] => [["R2", 121, 160], ["R3", 440, ZB + 9]];
const dowelEnds = (id: string, yz: [number, number][]) => [-1, 1].map((sx) => fx("dowel", yz.map(([y, z]): Vec3 => [sx * XI, y, z]), [sx, 0, 0], id, { len: 30, dia: 8, mate: side(sx) }));
const camR1 = (sx: number) => fx("cam", [[sx * (XI - 30), 170, ZB + T]], [0, 0, -1], "R1");
@@ -84,44 +84,44 @@ function chest(): CustomParams {
{
title: "Screw the cam bolts into the drawer fronts",
detail: "Lay each front face down on a rug, four bolts into the holes on the back. Build all three drawers the same way.",
- fix: [0, 1, 2].map((i) => fx("camScrew", [-1, 1].flatMap((sx) => [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 309, y, ZF - T])), [0, 0, 1], `F${i}`)),
- add: ids("F"),
+ fix: [0, 1, 2].map((i) => fx("camScrew", [-1, 1].flatMap((sx) => [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 309, y, ZF - T])), [0, 0, 1], `DF${i}`)),
+ add: ids("DF"),
tools: ["screwdriver"],
pose: "-z",
warnings: ["floor"],
},
- { title: "Slide the sides onto the fronts", detail: "Grooves facing in, onto the bolts.", add: [...ids("L"), ...ids("R")] },
+ { title: "Slide the sides onto the fronts", detail: "Grooves facing in, onto the bolts.", add: [...ids("DL"), ...ids("DR")] },
{
title: "Lock the sides with cams",
detail: "Four per drawer, arrow towards the bolt, turned clockwise.",
- fix: [0, 1, 2].flatMap((i) => [-1, 1].map((sx) => fx("cam", [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 303, y, ZF - T - 30]), [sx, 0, 0], sx < 0 ? `L${i}` : `R${i}`))),
+ fix: [0, 1, 2].flatMap((i) => [-1, 1].map((sx) => fx("cam", [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 303, y, ZF - T - 30]), [sx, 0, 0], sx < 0 ? `DL${i}` : `DR${i}`))),
tools: ["screwdriver"],
},
- { title: "Slide the bottoms down the grooves", detail: "Smooth side in, all the way to the front.", add: ids("B") },
+ { title: "Slide the bottoms down the grooves", detail: "Smooth side in, all the way to the front.", add: ids("DB") },
{
title: "Knock the stiffeners into the back boards",
detail: "The wire goes into the holes along the back board's bottom edge, hooks down. Tap it in with a hammer.",
- fix: [0, 1, 2].map((i) => fx("clip", [[0, FRONTS[i] + 15, -168]], [0, 1, 0], `K${i}`, { name: "Bottom stiffener", len: 300, dia: 4 })),
+ fix: [0, 1, 2].map((i) => fx("clip", [[0, FRONTS[i] + 15, -168]], [0, 1, 0], `DK${i}`, { name: "Bottom stiffener", len: 300, dia: 4 })),
tools: ["hammer"],
- wait: ids("K"),
- from: Object.fromEntries(ids("K").map((k) => [k, [0, 0, -420] as Vec3])),
+ wait: ids("DK"),
+ from: Object.fromEntries(ids("DK").map((k) => [k, [0, 0, -420] as Vec3])),
},
- { title: "Put the back boards on", detail: "Over the ends of the sides, with the bottom's edge in the groove.", add: ids("K") },
+ { title: "Put the back boards on", detail: "Over the ends of the sides, with the bottom's edge in the groove.", add: ids("DK") },
{
title: "Push in the plastic plugs",
detail: "Four per drawer, through the sides into the back board.",
- fix: [0, 1, 2].flatMap((i) => [-1, 1].map((sx) => fx("dowel", [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 315, y, -167]), [-sx, 0, 0], sx < 0 ? `L${i}` : `R${i}`, { name: "Plastic plug", len: 30, dia: 8, mate: `K${i}` }))),
+ fix: [0, 1, 2].flatMap((i) => [-1, 1].map((sx) => fx("dowel", [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 315, y, -167]), [-sx, 0, 0], sx < 0 ? `DL${i}` : `DR${i}`, { name: "Plastic plug", len: 30, dia: 8, mate: `DK${i}` }))),
},
{
title: "Lock the back boards",
detail: "Four cams per drawer into the back board, turned until they grip.",
- fix: [0, 1, 2].map((i) => fx("cam", [-1, 1].flatMap((sx) => [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 280, y, -175])), [0, 0, 1], `K${i}`)),
+ fix: [0, 1, 2].map((i) => fx("cam", [-1, 1].flatMap((sx) => [FRONTS[i] + 50, FRONTS[i] + 130].map((y): Vec3 => [sx * 280, y, -175])), [0, 0, 1], `DK${i}`)),
tools: ["screwdriver"],
},
{
title: "Fit the pull rings",
detail: "Push the two halves of a ring into each front's hole from both sides and twist them together.",
- fix: [0, 1, 2].map((i) => fx("knob", [[0, FRONTS[i] + FH / 2, ZF]], [0, 0, -1], `F${i}`, { name: "Pull ring", len: 18, dia: 40 })),
+ fix: [0, 1, 2].map((i) => fx("knob", [[0, FRONTS[i] + FH / 2, ZF]], [0, 0, -1], `DF${i}`, { name: "Pull ring", len: 18, dia: 40 })),
pose: "+y",
},
];
@@ -130,7 +130,7 @@ function chest(): CustomParams {
{
title: "Screw in its two stop screws",
detail: "Into the holes at the back of the drawer sides, so it can't be pulled all the way out.",
- fix: [-1, 1].map((sx) => fx("screw", [[sx * 309, FRONTS[i] + 165, -150]], [0, -1, 0], sx < 0 ? `L${i}` : `R${i}`, { name: "Stop screw", len: 12, dia: 8 })),
+ fix: [-1, 1].map((sx) => fx("screw", [[sx * 309, FRONTS[i] + 165, -150]], [0, -1, 0], sx < 0 ? `DL${i}` : `DR${i}`, { name: "Stop screw", len: 12, dia: 8 })),
tools: ["screwdriver"],
},
];
@@ -242,7 +242,7 @@ const family: Family = {
const until = r.steps.findIndex((x) => /top drawer in/.test(x.title));
["top", "middle", "bottom"].forEach((name, i) => {
const join = r.steps.findIndex((x) => x.title === `Slide the ${name} drawer in`);
- apart(b, r, ["F", "L", "R", "B", "K"].map((k) => `${k}${i}`), "drawers", from, until, join, [0, 0, 420]);
+ apart(b, r, ["F", "L", "R", "B", "K"].map((k) => `D${k}${i}`), "drawers", from, until, join, [0, 0, 420]);
});
return true;
},
diff --git a/src/lib/plan/families/radmanso.ts b/src/lib/plan/families/radmanso.ts
index aaea648..b8d5d4e 100644
--- a/src/lib/plan/families/radmanso.ts
+++ b/src/lib/plan/families/radmanso.ts
@@ -214,7 +214,7 @@ function legSteps(k: Kit, f: LegFrame, bottom: Part, o: { pose: Pose; detail?: s
k.step({
title: "Bolt the leg frame to the bottom",
detail: o.detail ?? "Line the frame up with the holes in the bottom panel. Four long Allen bolts down through the leg ends.",
- fix: [L, R].map((p) => at("bolt", p, [-1, 1].map((g): Vec3 => [p.pos[0], f.y - 30, g * (f.zl - 50)]), [0, 1, 0], LEG_BOLT, bottom)),
+ fix: [L, R].map((p) => at("bolt", p, [-1, 1].map((g): Vec3 => [p.pos[0], f.y - 30, g * (f.zl - 90)]), [0, 1, 0], LEG_BOLT, bottom)),
tools: ["allen"],
pose: o.pose,
});
@@ -425,7 +425,15 @@ function chest(b: PlanBuilder, s: ProductSpec, kind: "c3" | "c5") {
if (!tall) {
top = k.part("top", "Top panel", [W, T, D], [0, H - T / 2, 0]);
yTop = H - T;
- rail = k.part("rail", "Front rail", [2 * xi, 20, 20], [0, yTop - 10, D / 2 - 28], { material: "metal" });
+ // a steel bar with a flange at each end, screwed to the inside of the sides
+ rail = k.part("rail", "Front rail", [2 * xi, 40, 40], [0, yTop - 20, D / 2 - 38], {
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [2 * xi - 4, 20, 20], pos: [0, 10, 10] },
+ { shape: "box", size: [2, 40, 40], pos: [-xi + 1, 0, 0] },
+ { shape: "box", size: [2, 40, 40], pos: [xi - 1, 0, 0] },
+ ],
+ });
} else {
// an open shelf at the top: a fixed shelf with a cable hole, an upper back, and a loose top on four connectors
const yTray = H - 20;
@@ -451,7 +459,7 @@ function chest(b: PlanBuilder, s: ProductSpec, kind: "c3" | "c5") {
k.step({ title: "Screw a wall bracket onto each side", detail: "Lay the sides on a rug, inside up. The bracket goes at the top of the back edge, two screws each.", add: ["L", "R"], fix: bracketFixes([L, R], yWall, zWall), tools: ["screwdriver"], pose: "-z", warnings: ["floor"] });
k.step({ title: "Screw the runners onto the sides", detail: "The one marked CR on the right side, CL on the left. Three screws each, the wheel at the front.", fix: [...runners(L, 1, runY, D / 2, runLen), ...runners(R, -1, runY, D / 2, runLen)], tools: ["screwdriver"] });
k.step({ title: "Click the sides onto the top", detail: "Lay the top on its front edge. Push the pins in a side into the slots in the top, then press the side down until it clicks.", add: ["top"], tools: [], from: { top: [0, 300, 0] } });
- k.step({ title: "Screw in the front rail", detail: "The metal rail goes across the front, just under the top. Two screws at each end.", add: ["rail"], fix: [screws(rail!, L, [0.5], RAIL_SCREW, 0.3), screws(rail!, L, [0.5], RAIL_SCREW, 0.7), screws(rail!, R, [0.5], RAIL_SCREW, 0.3), screws(rail!, R, [0.5], RAIL_SCREW, 0.7)], tools: ["screwdriver"] });
+ k.step({ title: "Screw in the front rail", detail: "The metal rail goes across the front, just under the top. Two screws at each end.", add: ["rail"], fix: [L, R].map((p) => at("screw", rail!, [-12, 12].map((dz): Vec3 => [Math.sign(p.pos[0]) * (xi - 2), yTop - 28, D / 2 - 38 + dz]), [Math.sign(p.pos[0]), 0, 0], RAIL_SCREW, p)), tools: ["screwdriver"] });
k.step({ title: "Tap the dowels into the back panels", detail: "Two in the long edge of each panel: they go into the top, and into the panel before.", fix: [dowels(backs[0], top, [0.25, 0.75]), dowels(backs[1], backs[0], [0.25, 0.75])], tools: ["hammer"] });
k.step({ title: "Slide in the first back panel", detail: "Dowels first, down the grooves in the sides from the open end until it meets the top.", add: ["b0"], from: { b0: [0, -620, 0] } });
k.step({ title: "Slide in the second back panel", detail: "Down the same grooves until its dowels go into the first panel.", add: ["b1"], from: { b1: [0, -420, 0] } });
@@ -466,7 +474,7 @@ function chest(b: PlanBuilder, s: ProductSpec, kind: "c3" | "c5") {
k.step({ title: "Click the left side on", detail: "Lower it onto the shelf's pins and press down until it clicks." });
k.step({ title: "Tap the dowels into a back panel", detail: "Two long dowels in one long edge: they join the two lower back panels.", fix: [dowels(backs[1], backs[0], [0.25, 0.75], { len: 60, dia: 8 })], tools: ["hammer"] });
k.step({ title: "Slide in the lower back panels", detail: "Down the grooves from the open end, the plain one first, until they meet the shelf.", add: ["b0", "b1"], from: { b0: [0, -900, 0], b1: [0, -600, 0] } });
- k.step({ title: "Click on the bottom and screw it tight", detail: "Prop the open end up on a book. Press the bottom onto the pins and dowels until it clicks, then four connector screws into the sides.", add: ["bot"], fix: [screws(bottom, L, [0.25, 0.75], CONNECTOR), screws(bottom, R, [0.25, 0.75], CONNECTOR)], tools: ["allen"], from: { bot: [0, -300, 0] } });
+ k.step({ title: "Click on the bottom and screw it tight", detail: "Prop the open end up on a book. Press the bottom onto the pins and dowels until it clicks, then four connector screws into the sides.", add: ["bot"], fix: [screws(bottom, L, [0.1, 0.9], CONNECTOR), screws(bottom, R, [0.1, 0.9], CONNECTOR)], tools: ["allen"], from: { bot: [0, -300, 0] } });
k.step({ title: "Tap the dowels into the upper back panel", detail: "Two long dowels in its bottom edge.", fix: [dowels(upper!, shelf!, [0.25, 0.75], { len: 60, dia: 8 })], tools: ["hammer"] });
k.step({ title: "Slide in the upper back panel", detail: "From the top end, down the grooves until it meets the shelf and the wire clips catch it.", add: ["ub"], from: { ub: [0, 400, 0] } });
k.step({ title: "Screw the back panels tight", detail: "Two connector screws through the shelf into the upper back, two through the bottom into the lower back.", fix: [screws(shelf!, upper!, [0.25, 0.75], CONNECTOR), screws(bottom, backs[1], [0.25, 0.75], CONNECTOR)], tools: ["allen"] });
@@ -668,7 +676,7 @@ function cabinet(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Put in the fixed shelves and lock them", detail: "Four cam locks in each shelf first. Slide each shelf in onto its bolts, then turn the eight cam locks.", add: ["shL", "shR"], fix: [cams(L, shL, [0.15, 0.85], 1), cams(div, shL, [0.15, 0.85], 1), cams(div, shR, [0.15, 0.85], 1), cams(R, shR, [0.15, 0.85], 1)], tools: ["screwdriver"] });
k.step({ title: "Slide in the back panels", detail: "Blue side in, one each side of the divider, down the grooves from the open end. The one with the cable hole on the right.", add: backs.map((p) => p.id), from: Object.fromEntries(backs.map((p) => [p.id, [0, -800, 0] as Vec3])) });
k.step({ title: "Tap the dowels into the sides", detail: "Two in the bottom edge of each side.", fix: [dowels(L, bottom, [0.25, 0.75]), dowels(R, bottom, [0.25, 0.75])], tools: ["hammer"] });
- k.step({ title: "Put the bottom on and screw it tight", detail: "Onto the dowels and pins, then six connector screws up into the sides and the divider.", add: ["bot"], fix: [screws(bottom, L, [0.25, 0.75], CONNECTOR), screws(bottom, div, [0.25, 0.75], CONNECTOR), screws(bottom, R, [0.25, 0.75], CONNECTOR)], tools: ["allen"], from: { bot: [0, -300, 0] } });
+ k.step({ title: "Put the bottom on and screw it tight", detail: "Onto the dowels and pins, then six connector screws up into the sides and the divider.", add: ["bot"], fix: [screws(bottom, L, [0.1, 0.9], CONNECTOR), screws(bottom, div, [0.1, 0.9], CONNECTOR), screws(bottom, R, [0.1, 0.9], CONNECTOR)], tools: ["allen"], from: { bot: [0, -300, 0] } });
k.step({ title: "Clip the backs to the frame", detail: "Twenty back clips through the holes round the back panels, each pair pressed together until it holds.", fix: backs.map((p) => at("clip", p, [...spread(p.pos[0] - p.size[0] / 2 + 60, p.pos[0] + p.size[0] / 2 - 60, 3).flatMap((x) => [[x, yTop - 20, zBack - BT / 2], [x, yb0 + 20, zBack - BT / 2]] as Vec3[]), ...[ySh - 100, ySh + 200].flatMap((y) => [[p.pos[0] - p.size[0] / 2 + 20, y, zBack - BT / 2], [p.pos[0] + p.size[0] / 2 - 20, y, zBack - BT / 2]] as Vec3[])], [0, 0, 1], { len: 12, dia: 14, name: "Back clip" })) });
legSteps(k, legs, bottom, { pose: "-y" });
k.step({ title: "Stand it up", detail: "With a helper, onto its feet.", pose: "+y", people: 2 });
@@ -720,7 +728,7 @@ function tvBench(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Click a divider onto the top", detail: "The top lies on its front edge. Check which way up the divider goes, then push it on until it clicks.", add: ["top"], from: { top: [0, 300, 0] } });
k.step({ title: "Click the other divider on", detail: "Runners facing the first one." });
k.step({ title: "Click the bottom on", detail: "Onto the other ends of the dividers, until both click.", add: ["bot"], from: { bot: [0, -300, 0] } });
- k.step({ title: "Tap the dowels into the back rails", detail: "Two in each rail, where it meets the dividers.", fix: rails.map((r) => at("dowel", r, divs.map((d): Vec3 => [d.pos[0], r.pos[1], zr]), [0, 0, -1], { len: 30, dia: 8 })), tools: ["hammer"] });
+ k.step({ title: "Tap the dowels into the back rails", detail: "Two in each rail, where it meets the dividers.", fix: rails.map((r) => at("dowel", r, divs.map((d): Vec3 => [d.pos[0], r.pos[1], zr]), [0, 0, -1], { len: 30, dia: 8 })), tools: ["hammer"], wait: ["rt", "rb"], from: { rt: [0, 0, -300], rb: [0, 0, -300] } });
k.step({ title: "Lay the back rails on", detail: "Across the back edges of the dividers, one at the top and one at the bottom, onto the dowels.", add: ["rt", "rb"], from: { rt: [0, 0, -300], rb: [0, 0, -300] } });
k.step({ title: "Screw the rails to the dividers", detail: "Eight connector screws with the Allen key, two at each crossing.", fix: rails.flatMap((r) => divs.map((d) => at("screw", r, [-20, 20].map((dy): Vec3 => [d.pos[0], r.pos[1] + dy, -D / 2]), [0, 0, 1], { len: 45, dia: 6, name: "Connector screw" }, d))), tools: ["allen"] });
k.step({ title: "Tap the dowels into the ends", detail: "Two in each end of the top, the bottom and both rails.", fix: panels.flatMap((p) => [dowels(p, L, [0.5]), dowels(p, R, [0.5])]), tools: ["hammer"] });
@@ -785,16 +793,16 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Tap the dowels into the sides and the divider", detail: "Lay them on a rug. Two in each end of all three.", add: ["L", "div", "R"], fix: uprights.flatMap((p) => [dowels(p, bottom, [0.25, 0.75]), dowels(p, top, [0.25, 0.75])]), tools: ["hammer"], pose: "+z", warnings: ["floor"] });
k.step({ title: "Screw the runners onto the right side", detail: "Four marked CR, three screws each, the wheel at the front.", fix: runners(R, -1, runY, zf, 500), tools: ["screwdriver"] });
k.step({ title: "Screw the runners onto the divider", detail: "Four marked CL on its right face, the same way.", fix: runners(div, 1, runY, zf, 500), tools: ["screwdriver"] });
- k.step({ title: "Lay the bottom panel on the rug", detail: "Face down, its leg holes up.", add: ["bot"], from: { bot: [600, 0, 0] } });
- legSteps(k, legs, bottom, { pose: "+z", detail: "Lay the frame on the bottom panel. Four long Allen bolts through the leg ends." });
- k.step({ title: "Screw the bottom to the sides and divider", detail: "Stand the bottom on its edge against them, onto the dowels, then six connector screws with the Allen key.", fix: uprights.map((p) => screws(bottom, p, [0.25, 0.75], CONNECTOR)), tools: ["allen"], people: 2 });
+ k.step({ title: "Push the bottom panel onto the dowels", detail: "Its leg holes facing out. Press it onto the dowels at the bottom ends of the sides and the divider.", add: ["bot"], from: { bot: [0, -500, 0] } });
+ legSteps(k, legs, bottom, { pose: "+z", detail: "Lay the frame on the bottom panel, lined up with its holes. Four long Allen bolts through the leg ends." });
+ k.step({ title: "Screw the bottom to the sides and divider", detail: "Six connector screws through the bottom into the sides and the divider, with the Allen key.", fix: uprights.map((p) => screws(bottom, p, [0.1, 0.9], CONNECTOR)), tools: ["allen"], people: 2 });
k.step({ title: "Screw in the cam bolts for the rails", detail: "Two in the divider and two in the right side, just above the drawers.", fix: [div, R].flatMap((p) => rails.map((r) => bolts(p, r, [0.5]))), tools: ["screwdriver"] });
k.step({ title: "Fit the two rails", detail: "Cam locks in their ends, then push them onto the bolts between the divider and the right side, front and back.", add: ["rf", "rb"] });
k.step({ title: "Lock the cam locks", detail: "Four, one at each end of the rails.", fix: rails.flatMap((r) => [cams(div, r, [0.5], 1), cams(R, r, [0.5], 1)]), tools: ["screwdriver"] });
k.step({ title: "Slide in the right back panel", detail: "Blue side in, the cable hole at the top, along the grooves from the open end.", add: ["bR"], from: { bR: [0, 1400, 0] } });
k.step({ title: "Slide in the left back panel", detail: "The same way, on the other side of the divider.", add: ["bL"], from: { bL: [0, 1400, 0] } });
k.step({ title: "Push the wire clips into the sides", detail: "Two at the open end, so the back panels can't slide out.", fix: [L, R].map((p) => at("clip", p, [[p.pos[0] - Math.sign(p.pos[0]) * (T / 2), yTop - 20, zBack + 12]], [Math.sign(p.pos[0]), 0, 0], { len: 30, dia: 8, name: "Spring wire" })) });
- k.step({ title: "Put the top on and screw it tight", detail: "Onto the dowels and pins, then six connector screws into the sides and the divider.", add: ["top"], fix: uprights.map((p) => screws(top, p, [0.25, 0.75], CONNECTOR)), tools: ["allen"], from: { top: [0, 300, 0] } });
+ k.step({ title: "Put the top on and screw it tight", detail: "Onto the dowels and pins, then six connector screws into the sides and the divider.", add: ["top"], fix: uprights.map((p) => screws(top, p, [0.1, 0.9], CONNECTOR)), tools: ["allen"], from: { top: [0, 300, 0] } });
k.step({ title: "Stand it up", detail: "Two people: lift it by the top while the other steadies the legs. Don't drag it.", pose: "+y", people: 2, warnings: ["two"] });
k.step({ title: "Clip the backs to the frame", detail: "Twenty back clips from behind, each pair pressed together until it holds.", fix: backs.map((p) => at("clip", p, [...spread(p.pos[0] - p.size[0] / 2 + 60, p.pos[0] + p.size[0] / 2 - 60, 2).flatMap((x) => [[x, yTop - 20, zBack - BT / 2], [x, yb0 + 20, zBack - BT / 2]] as Vec3[]), ...spread(yb0 + 300, yTop - 300, 3).flatMap((y) => [[p.pos[0] - p.size[0] / 2 + 20, y, zBack - BT / 2], [p.pos[0] + p.size[0] / 2 - 20, y, zBack - BT / 2]] as Vec3[])], [0, 0, 1], { len: 12, dia: 14, name: "Back clip" })) });
k.step({ title: "Push in the wall fittings", detail: "One into the back edge of each side, near the top.", fix: wallFittings([L, R], yTop - 60) });
@@ -816,7 +824,7 @@ function wardrobe(b: PlanBuilder, s: ProductSpec) {
k2.step({ title: "Hang the clothes rail", detail: "Screw a holder to the left side and one to the divider, one screw each, then drop the rail into them.", add: ["rod"], fix: [...[L, div].map((p) => at("hook", p, [[p.pos[0] + (p === L ? T / 2 : -T / 2), rod.pos[1] + 10, rod.pos[2]]], [p === L ? -1 : 1, 0, 0], { len: 40, dia: 22, name: "Rail holder" })), ...[L, div].map((p) => at("screw", p, [[p.pos[0] + (p === L ? T / 2 + 2 : -T / 2 - 2), rod.pos[1] + 24, rod.pos[2]]], [p === L ? -1 : 1, 0, 0], RUN_SCREW))], tools: ["screwdriver"] });
k2.step({ title: "Screw in the cam bolts for the shelves", detail: "Eighteen, three at each end of each shelf, at the heights you want them.", fix: sh.flatMap((p) => walls(p).map((w) => bolts(w, p, [0.15, 0.5, 0.85]))), tools: ["screwdriver"] });
k2.step({ title: "Push the cam locks into the shelves", detail: "Six in each shelf, the arrow pointing at the edge.", fix: sh.flatMap((p) => walls(p).map((w) => cams(w, p, [0.15, 0.5, 0.85], 1))), tools: ["screwdriver"] });
- k2.step({ title: "Put the shelves in and lock them", detail: "Two over the drawers, one low on the left. Turn each cam lock clockwise.", add: sh.map((p) => p.id), from: Object.fromEntries(sh.map((p) => [p.id, [0, 0, 500] as Vec3])) });
+ k2.step({ title: "Put the shelves in and lock them", detail: "Two over the drawers, one low on the left. Turn each cam lock clockwise.", add: sh.map((p) => p.id) });
k2.step({ title: "Fit the cable grommet", detail: "In the hole in the right back panel.", fix: [at("cap", backs[1], [[xi / 2, yTop - 120, zb]], [0, 0, -1], { len: 12, dia: 50, name: "Cable grommet" })] });
buildCustom(b, { ...s, custom: k2.recipe });
drawers(b, ds, { knobs: false });
@@ -888,10 +896,10 @@ function bed(b: PlanBuilder, s: ProductSpec, king: boolean) {
k.step({ title: "Screw a foot into each headboard post", detail: "Lay the posts on a rug. A foot cup on the end of each, then turn the foot in.", add: ["pL", "pR"], fix: FEET(posts.map((p) => ({ p, at: [p.pos[0], 0, zp] }))), from: { pL: [0, 0, -400], pR: [0, 0, -400] } });
k.step({ title: "Hang the head rail on the posts", detail: "Stand the posts up and drop the head rail onto the hooks, holes lined up.", add: ["head"], people: 2, from: { head: [0, 300, 0] } });
k.step({ title: "Bolt the head rail to the posts", detail: "Two bolts through each post, a cap nut on the other side. Hold the nut with one Allen key, turn the bolt with the other.", fix: [...posts.map((p) => at("bolt", p, [0.3, 0.7].map((f): Vec3 => [p.pos[0], yR + rh * f, zp - 16]), [0, 0, 1], BOLT, head)), ...posts.map((p) => at("nut", head, [0.3, 0.7].map((f): Vec3 => [p.pos[0], yR + rh * f, zHi]), [0, 0, -1], CAP_NUT))], tools: ["allen"] });
- k.step({ title: "Fit the connectors into the head rail", detail: "A barrel nut in each end hole, then screw a connector bolt into each one. Four in all.", fix: sides.flatMap((r) => [at("nut", head, joint(r, head, 0).map((v): Vec3 => [r.pos[0], v[1], zHi - 10]), [0, 0, 1], BARREL), at("camScrew", head, joint(r, head, 0).map((v): Vec3 => [r.pos[0], v[1], zHi]), [0, 0, 1], CONN, r)]), tools: ["allen"] });
+ k.step({ title: "Fit the connectors into the head rail", detail: "A barrel nut in each end hole, then screw a connector bolt into each one. Four in all.", fix: sides.flatMap((r) => [at("camScrew", head, joint(r, head, 0).map((v): Vec3 => [r.pos[0], v[1], zHi]), [0, 0, -1], CONN, r), at("nut", head, joint(r, head, 0).map((v): Vec3 => [r.pos[0], v[1], zHi - 10]), [0, 0, 1], BARREL)]), tools: ["allen"] });
const railFix = (r: Part): CustomFix[] => [
- dowels(r, head, [0.2, 0.5, 0.8]),
- dowels(r, foot, [0.2, 0.5, 0.8]),
+ dowels(r, head, [0.1, 0.5, 0.9]),
+ dowels(r, foot, [0.1, 0.5, 0.9]),
...[head, foot].map((e) => at("cam", r, joint(r, e, 0).map((v): Vec3 => [r.pos[0] - Math.sign(r.pos[0]) * (rt / 2), v[1], e === head ? zHi + 40 : zFi - 40]), [Math.sign(r.pos[0]), 0, 0], BIG_CAM)),
];
k.step({ title: "Join the first side rail to the head rail", detail: "Three dowels in each end of the rail and a cam lock near each bolt hole first. One holds the headboard, the other pushes the rail onto the bolts. Turn the two cam locks with the big Allen key.", add: ["sR"], fix: railFix(sides[1]), people: 2, tools: ["hammer", "allen"], from: { sR: [0, 0, 500] } });
@@ -912,14 +920,14 @@ function bed(b: PlanBuilder, s: ProductSpec, king: boolean) {
k.step({ title: "Screw on the slat rails", detail: "One along the inside of each side rail, eight screws each.", add: ["rL", "rR"], fix: rails.map((r) => at("screw", r, spread(zHi + 80, zFi - 80, 8).map((z): Vec3 => [r.pos[0] + Math.sign(r.pos[0]) * 15, ySr - 20, z]), [Math.sign(r.pos[0]), 0, 0], WOOD)), tools: ["screwdriver"] });
if (king) {
k.step({ title: "Screw the beam brackets to the head and foot rails", detail: "One in the middle of each, two screws each.", fix: [head, foot].flatMap((e) => [at("bracket", e, [[0, ySr - 20, e === head ? zHi : zFi]], [0, 0, e === head ? -1 : 1], { len: 60, dia: 50, name: "Beam bracket" }), at("screw", e, [-30, 30].map((x): Vec3 => [x, ySr - 50, e === head ? zHi : zFi]), [0, 0, e === head ? -1 : 1], WOOD)]), tools: ["screwdriver"] });
- k.step({ title: "Lay in the centre beam and stand the middle leg under it", detail: "Hook each half into its bracket, slide them together over the middle leg's hanger, and bolt the hanger.", add: ["cb0", "cb1", "ml"], fix: [at("bolt", mid!, [[-25, ySr - 20, zMid], [25, ySr - 20, zMid]], [1, 0, 0], { len: 30, dia: 6 })], tools: ["allen"] });
+ k.step({ title: "Lay in the centre beam and stand the middle leg under it", detail: "Hook each half into its bracket, slide them together over the middle leg's hanger, and bolt the hanger.", add: ["cb0", "cb1", "ml"], fix: [at("bolt", mid!, [[-30, ySr - 20, zMid - 40], [-30, ySr - 20, zMid + 40]], [1, 0, 0], { len: 30, dia: 6 })], tools: ["allen"] });
k.step({ title: "Screw the beam halves in place", detail: "Two screws at each end.", fix: beams.map((p, i) => at("screw", p, [-1, 1].map((g): Vec3 => [g * 12, ySr, i ? zFi - 30 : zHi + 30]), [0, -1, 0], { len: 12, dia: 4 })), tools: ["screwdriver"] });
} else {
k.step({ title: "Lay in the centre beam", detail: "Pull it out to length and hook its ends over the head and foot rails, then one screw at each end.", add: ["cb0"], fix: [at("screw", beams[0], [[0, ySr, zHi + 20], [0, ySr, zFi - 20]], [0, -1, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] });
k.step({ title: "Screw the middle of the beam", detail: "One screw through the joint so it can't slide.", fix: [at("screw", beams[0], [[0, ySr, zMid]], [0, -1, 0], { len: 12, dia: 4 })], tools: ["screwdriver"] });
}
const holders = rails.flatMap((r) => (king ? [zHi + 40, zHi + Lin / 3, zFi - Lin / 3, zFi - 40] : [zHi + 40, zFi - 40]).map((z): Vec3 => [r.pos[0], ySr, z]));
- k.step({ title: "Screw on the slat holders", detail: "They clip over the slat rails and stop the slats sliding. One small screw each.", fix: [at("clip", rails[0], holders, [0, -1, 0], { len: 20, dia: 16, name: "Slat holder" }), at("screw", rails[0], holders.map((v): Vec3 => [v[0], v[1] + 2, v[2]]), [0, -1, 0], { len: 8, dia: 4 })], tools: ["screwdriver"] });
+ k.step({ title: "Screw on the slat holders", detail: "They clip over the slat rails and stop the slats sliding. One small screw each.", fix: [at("clip", rails[0], holders, [0, -1, 0], { len: 20, dia: 16, name: "Slat holder" }), at("screw", rails[0], holders.map((v): Vec3 => [v[0], v[1] + 2, v[2] + (v[2] < zMid ? 24 : -24)]), [0, -1, 0], { len: 8, dia: 4 })], tools: ["screwdriver"] });
k.step({ title: "Lay the strips on the rails", detail: `Peel off the backing and press them along the slat rails${king ? " and the centre beam" : ""}, cutting the tape between them with scissors.`, add: strips.map((p) => p.id) });
k.step({ title: "Roll out the slatted base", detail: "Sold separately. Roll it out from the head end and hook its ends under the holders.", add: ["slats"], from: { slats: [0, 300, 0] } });
buildCustom(b, { ...s, custom: k.recipe });
diff --git a/src/lib/plan/families/ragrund.ts b/src/lib/plan/families/ragrund.ts
index 69c3af5..cf47660 100644
--- a/src/lib/plan/families/ragrund.ts
+++ b/src/lib/plan/families/ragrund.ts
@@ -191,8 +191,9 @@ function trolley(s: ProductSpec): CustomParams {
title: "Screw on the castors",
detail: "One under each post, four screws each, in the order shown on the plate.",
fix: [
- { kind: "castor", count: 4, len: CH, dia: 50, at: corners.map(([x, z]) => pt(x, CH, z)), dir: [0, 1, 0] },
- { kind: "screw", count: 16, len: 16, dia: 4, at: corners.flatMap(([x, z]) => [-1, 1].flatMap((a) => [-1, 1].map((b) => pt(x + a * 11, CH - 2, z + b * 11)))), dir: [0, 1, 0] },
+ // its pin sits up in the post end, which keeps it clear of the four plate screws
+ { kind: "castor", count: 4, len: CH + 14, dia: 50, at: corners.map(([x, z]) => pt(x, CH + 14, z)), dir: [0, 1, 0] },
+ { kind: "screw", count: 16, len: 16, dia: 4, at: corners.flatMap(([x, z]) => [-1, 1].flatMap((a) => [-1, 1].map((b) => pt(x + a * 11.5, CH - 2, z + b * 11.5)))), dir: [0, 1, 0] },
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/rakkestad.ts b/src/lib/plan/families/rakkestad.ts
index 9f8e3f9..2ae4e06 100644
--- a/src/lib/plan/families/rakkestad.ts
+++ b/src/lib/plan/families/rakkestad.ts
@@ -183,7 +183,7 @@ function hinged(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
const hys = [dy0 + 110, (dy0 + dy1) / 2, dy1 - 110];
const plate = (i: number) => hys.map((y): Vec3 => [hingeX(i), y, z1 - 37]);
const plates = doorIds.map((_, i) => fx("angle", plate(i), [hingeSide(i) < 0 ? -1 : 1, 0, 0], hingeHost(i), { name: "Mounting plate" }));
- const plateScrews = doorIds.map((_, i) => fx("screw", plate(i).flatMap((p): Vec3[] => [[p[0], p[1] - 16, p[2]], [p[0], p[1] + 16, p[2]]]), [hingeSide(i), 0, 0], hingeHost(i), { len: 14, dia: 4 }));
+ const plateScrews = doorIds.map((_, i) => fx("screw", plate(i).flatMap((p): Vec3[] => [[p[0], p[1] - 24, p[2]], [p[0], p[1] + 24, p[2]]]), [hingeSide(i), 0, 0], hingeHost(i), { len: 14, dia: 4 }));
// the doors meet in the middle of the pair: a door stop there in the top and the bottom
const xm = three ? doorX(0) + dw / 2 + 1.5 : 0;
const stops = [fx("clip", [-15, 15].map((dx): Vec3 => [xm + dx, H - T, z1 - 15]), [0, 1, 0], "TOP", { name: "Door stop" }), fx("clip", [-15, 15].map((dx): Vec3 => [xm + dx, PL + T, z1 - 15]), [0, -1, 0], "BOT", { name: "Door stop" })];
@@ -214,22 +214,23 @@ function hinged(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
},
{ title: "Knock the door stops into the top and the bottom", detail: "Two in each, in the small holes near the front edge, where the doors will meet.", fix: stops, tools: ["hammer"] },
];
+ const divDowels: CustomFix[] = [fx("dowel", [z0 + 110, z1 - 110].map((z): Vec3 => [xd, PL + T, z]), [0, 1, 0], "DIV"), fx("dowel", [z0 + 110, z1 - 110].map((z): Vec3 => [xd, H - T, z]), [0, -1, 0], "DIV")];
if (three) {
- steps.push({ title: "Tap dowels into the ends of the divider", detail: "Two in each end.", fix: [fx("dowel", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, PL + T, z]), [0, 1, 0], "DIV"), fx("dowel", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, H - T, z]), [0, -1, 0], "DIV")], tools: ["hammer"] });
- steps.push({ title: "Tap dowels into the three shelves", detail: "Three in each end of every shelf.", fix: shelfIds.flatMap((id) => endsOfShelf(parts, id, [z0 + 50, cz, z1 - 50])), tools: ["hammer"] });
+ steps.push({ title: "Tap dowels into the three shelves", detail: "Three in each end of every shelf.", fix: shelfIds.flatMap((id) => endsOfShelf(parts, id, [z0 + 100, cz, z1 - 100])), wait: shelfIds, from: Object.fromEntries(shelfIds.map((id) => [id, [300, 0, 0] as Vec3])), tools: ["hammer"] });
steps.push({
title: "Screw the middle shelf to the divider",
detail: "Stand the divider on its front edge. Two connector screws through it into the shelf: leave them a turn loose for now.",
add: ["DIV", "SH1"],
+ from: { DIV: [-300, 0, 0] },
fix: [fx("bolt", [z0 + 60, z1 - 60].map((z): Vec3 => [xd - T / 2, parts.find((p) => p.id === "SH1")!.pos[1], z]), [1, 0, 0], "DIV", CONN)],
tools: ["allen"],
});
}
- steps.push({ title: "Tap dowels into the top and the bottom", detail: "Two in each end of both panels.", fix: [...endDowels(b, "TOP", H - T / 2, [z0 + 60, z1 - 60]), ...endDowels(b, "BOT", PL + T / 2, [z0 + 60, z1 - 60])], tools: ["hammer"] });
+ steps.push({ title: "Tap dowels into the top and the bottom", detail: "Two in each end of both panels.", fix: [...endDowels(b, "TOP", H - T / 2, [z0 + 100, z1 - 100]), ...endDowels(b, "BOT", PL + T / 2, [z0 + 100, z1 - 100])], tools: ["hammer"] });
steps.push({ title: "Screw the angle bracket under the bottom", detail: "In the middle of the front edge, on the underside, with one short screw.", fix: [fx("angle", [angleAt], [0, 1, 0], "BOT"), fx("screw", [[angleAt[0] - 8, PL, angleAt[2] - 8]], [0, 1, 0], "BOT", { len: 14, dia: 4 })], tools: ["screwdriver"] });
if (three) {
- steps.push({ title: "Screw the bottom to the divider", detail: "Two connector screws up through the bottom into the end of the divider.", add: ["BOT"], fix: [fx("bolt", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, PL, z]), [0, 1, 0], "BOT", CONN)], tools: ["allen"] });
- steps.push({ title: "Screw the top to the divider", detail: "The same at the other end.", add: ["TOP"], fix: [fx("bolt", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, H, z]), [0, -1, 0], "TOP", CONN)], tools: ["allen"] });
+ steps.push({ title: "Screw the bottom to the divider", detail: "Two dowels into the end of the divider, then push the bottom on and drive two connector screws up through it into the divider.", add: ["BOT"], fix: [divDowels[0], fx("bolt", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, PL, z]), [0, 1, 0], "BOT", CONN)], tools: ["allen"] });
+ steps.push({ title: "Screw the top to the divider", detail: "The same at the other end: two dowels, then two connector screws.", add: ["TOP"], fix: [divDowels[1], fx("bolt", [z0 + 60, z1 - 60].map((z): Vec3 => [xd, H, z]), [0, -1, 0], "TOP", CONN)], tools: ["allen"] });
steps.push({ title: "Slide in the other two shelves", detail: "Push them onto the divider's holes, dowels first.", add: ["SH0", "SH2"] });
steps.push({ title: "Fit the right side", detail: "Line it up with all the dowels and press it on. Two connector screws into the top and bottom near the front.", add: ["SR"], fix: [sideScrews(b, 1, [H - T / 2, PL + T / 2], 1, [z1 - 50])], tools: ["allen"] });
steps.push({ title: "Screw the right side on", detail: "Four more: the back of the top and the bottom, and both ends of the middle shelf.", fix: [sideScrews(b, 1, [H - T / 2, PL + T / 2], 1, [z0 + 50]), sideScrews(b, 1, [parts.find((p) => p.id === "SH1")!.pos[1]])], tools: ["allen"] });
@@ -238,12 +239,12 @@ function hinged(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
steps.push({ title: "Screw the top to a side", detail: "Stand the side on its front edge. Push the top onto the dowels, then two connector screws through the side.", add: ["SL", "TOP"], fix: [sideScrews(b, -1, [H - T / 2])], tools: ["allen"] });
steps.push({ title: "Screw on the bottom", detail: "At the other end, the same way.", add: ["BOT"], fix: [sideScrews(b, -1, [PL + T / 2])], tools: ["allen"] });
const y = parts.find((p) => p.id === "SH0")!.pos[1];
- steps.push({ title: "Tap dowels into the fixed shelf", detail: "Three in each end.", fix: endsOfShelf(parts, "SH0", [z0 + 50, cz, z1 - 50]), tools: ["hammer"] });
+ steps.push({ title: "Tap dowels into the fixed shelf", detail: "Three in each end.", fix: endsOfShelf(parts, "SH0", [z0 + 100, cz, z1 - 100]), tools: ["hammer"] });
steps.push({ title: "Screw in the fixed shelf", detail: "Low down, in the holes near the bottom. Two connector screws through the side.", add: ["SH0"], fix: [sideScrews(b, -1, [y])], tools: ["allen"] });
}
const pf = parts.find((p) => p.id === "PF")!, pb = parts.find((p) => p.id === "PB")!;
steps.push({ title: "Press feet onto the plinths", detail: three ? "Two under each plinth." : "One in the middle of each plinth's bottom edge.", fix: [fx("glide", ft.rails, [0, 1, 0], undefined, { name: "Foot" })] });
- steps.push({ title: "Tap dowels into the plinths", detail: "One in each end.", fix: [...endDowels(b, "PF", PL / 2, [pf.pos[2]]), ...endDowels(b, "PB", PL / 2, [pb.pos[2]])], tools: ["hammer"] });
+ steps.push({ title: "Tap dowels into the plinths", detail: "One in each end.", fix: [...endDowels(b, "PF", PL / 2 - 15, [pf.pos[2]]), ...endDowels(b, "PB", PL / 2 - 15, [pb.pos[2]])], tools: ["hammer"] });
if (three) {
steps.push({ title: "Push the plinths in", detail: "Under the bottom, onto the right side's dowels. The front one goes back from the edge.", add: ["PF", "PB"] });
steps.push({ title: "Fit the left side", detail: "One of you holds the carcass steady while the other lines the side up with every dowel. Four connector screws: the top and the bottom.", add: ["SL"], fix: [sideScrews(b, -1, [H - T / 2, PL + T / 2])], tools: ["allen"], people: 2 });
@@ -276,7 +277,7 @@ function hinged(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
title: "Screw in the clothes rail holders and drop the rail in",
detail: three ? "In the wide part, one screw each, then the rail clicks down into them." : "One screw each, then the rail clicks down into them.",
add: ["RAIL"],
- fix: [-1, 1].map((sx) => fx("hook", [[sx < 0 ? railX0 : railX1, railY + 10, cz]], [sx, 0, 0], sx < 0 ? "SL" : three ? "DIV" : "SR", { name: "Rail holder" })).concat([fx("screw", [[railX0, railY + 30, cz], [railX1, railY + 30, cz]], [0, 0, 0], undefined, { len: 14, dia: 4 })]),
+ fix: [-1, 1].map((sx) => fx("hook", [[sx < 0 ? railX0 : railX1, railY + 10, cz]], [sx, 0, 0], sx < 0 ? "SL" : three ? "DIV" : "SR", { name: "Rail holder" })).concat([-1, 1].map((sx) => fx("screw", [[sx < 0 ? railX0 + 3 : railX1 - 3, railY + 34, cz]], [sx, 0, 0], sx < 0 ? "SL" : three ? "DIV" : "SR", { len: 14, dia: 4 }))),
tools: ["screwdriver"],
});
steps.push({
@@ -286,14 +287,14 @@ function hinged(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
tools: ["screwdriver"],
});
steps.push({ title: "Hang the doors", detail: "Hook each hinge onto its plate and press until it clicks, then tighten the screw on each hinge arm.", add: doorIds, tools: ["screwdriver"] });
- steps.push({ title: `Screw on the ${n} knobs`, detail: "One long screw from inside each door.", fix: [fx("knob", kn, [0, 0, -1]), fx("screw", kn.map((p): Vec3 => [p[0], p[1], z1 + 2]), [0, 0, 1], undefined, { len: 30, dia: 4 })], tools: ["screwdriver"] });
+ steps.push({ title: `Screw on the ${n} knobs`, detail: "One long screw from inside each door.", fix: [fx("knob", kn, [0, 0, -1]), fx("screw", kn.map((p): Vec3 => [p[0], p[1], z1 - 3]), [0, 0, 1], undefined, { len: 30, dia: 4 })], tools: ["screwdriver"] });
if (three) {
const d = doorX(2) - dw / 2 + 25;
steps.push({ title: "Stick on the door bumpers", detail: "Inside the right-hand door, near its free edge, one high and one low.", fix: [fx("glide", [[d, dy1 - 150, z1 + 2], [d, dy0 + 150, z1 + 2]], [0, 0, 1], "DR2", { name: "Door bumper" })] });
}
steps.push({ title: "Line up the doors", detail: "The hinge screws move each door up and down, in and out, and sideways, until the gaps are even.", tools: ["screwdriver"] });
const flat = (ids: string[]) => lay(b, parts, ids, "-z");
- return { recipe: { parts, steps }, stages: { 0: flat(three ? ["SL", "DIV", "SR", "TOP", "BOT"] : ["SL", "SR", "TOP", "BOT"]), [steps.findIndex((x) => /feet onto the plinths/.test(x.title))]: flat(["PF", "PB"]), [steps.findIndex((x) => /hinges into/.test(x.title))]: lay(b, parts, doorIds, "+y") } };
+ return { recipe: { parts, steps }, stages: { 0: flat(["SL", "SR", "TOP", "BOT"]), [steps.findIndex((x) => /feet onto the plinths/.test(x.title))]: flat(["PF", "PB"]), [steps.findIndex((x) => /hinges into/.test(x.title))]: lay(b, parts, doorIds, "+y") } };
}
/** Dowels in both ends of a shelf: into the sides, or the 3-door's divider and right side. */
@@ -344,7 +345,7 @@ function sliding(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
for (const d of doors) parts.push({ id: d.id, name: "Sliding door", size: [dw, dy1 - dy0, TD], pos: [d.x, (dy0 + dy1) / 2, d.z] });
const ft = feet(b, 2);
- const shelfEnds = endDowels(b, "SH", ys, [z0 + 50, sz, sz + sd / 2 - 50]);
+ const shelfEnds = endDowels(b, "SH", ys, [z0 + 100, sz, sz + sd / 2 - 100]);
const divDowels = [fx("dowel", [z0 + 60, sz + sd / 2 - 60].map((z): Vec3 => [0, ys - T / 2, z]), [0, 1, 0], "DL"), fx("dowel", [z0 + 60, sz + sd / 2 - 60].map((z): Vec3 => [0, ys + T / 2, z]), [0, -1, 0], "DU")];
const camZ = [z0 + 100, sz + sd / 2 - 100];
const pf = parts.find((p) => p.id === "PF")!, pb = parts.find((p) => p.id === "PB")!;
@@ -376,18 +377,18 @@ function sliding(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
tools: ["hammer"],
},
{ title: "Lock it with two cam locks", detail: "The same way.", fix: [fx("cam", camZ.map((z): Vec3 => [30, ys, z]), [-1, 0, 0], "SH")], tools: ["screwdriver"] },
- { title: "Tap dowels into the top and the bottom", detail: "Two in each end of both panels.", fix: [...endDowels(b, "TOP", H - T / 2, [z0 + 60, z1 - 60]), ...endDowels(b, "BOT", PL + T / 2, [z0 + 60, z1 - 60])], tools: ["hammer"] },
+ { title: "Tap dowels into the top and the bottom", detail: "Two in each end of both panels.", fix: [...endDowels(b, "TOP", H - T / 2, [z0 + 100, z1 - 100]), ...endDowels(b, "BOT", PL + T / 2, [z0 + 100, z1 - 100])], tools: ["hammer"] },
{ title: "Press the door tracks into the top and the bottom", detail: "Two in each panel, in the grooves along the front edge. Push them right in along their length.", add: ["TOP", "BOT", "TT0", "TT1", "TB0", "TB1"] },
{ title: "Screw the top and bottom to a side", detail: "Stand the left side on its front edge. Two connector screws into each.", add: ["SL"], fix: [sideScrews(b, -1, [H - T / 2, PL + T / 2])], tools: ["allen"] },
{ title: "Screw the shelf and dividers in", detail: "Slide the shelf unit in so the dividers meet the middle of the top and bottom. Two connector screws through the side into the shelf, two down through the top and one up through the bottom into the dividers.", fix: [sideScrews(b, -1, [ys], 2, [z0 + 50, sz + sd / 2 - 50]), fx("bolt", [z0 + 60, sz + sd / 2 - 60].map((z): Vec3 => [0, H, z]), [0, -1, 0], "TOP", CONN), fx("bolt", [[0, PL, sz]], [0, 1, 0], "BOT", CONN)], tools: ["allen"] },
- { title: "Tap dowels into the plinths", detail: "One in each end.", fix: [...endDowels(b, "PF", PL / 2, [pf.pos[2]]), ...endDowels(b, "PB", PL / 2, [pb.pos[2]])], tools: ["hammer"] },
- { title: "Push the plinths in and screw them to the side", detail: "Under the bottom. One connector screw into each plinth, and one more into the bottom of the short divider.", add: ["PF", "PB"], fix: [sideScrews(b, -1, [PL / 2], 1, [pf.pos[2]]), sideScrews(b, -1, [PL / 2], 1, [pb.pos[2]]), fx("bolt", [[0, PL, z0 + 60]], [0, 1, 0], "BOT", CONN)], tools: ["allen"] },
+ { title: "Tap dowels into the plinths", detail: "One in each end.", fix: [...endDowels(b, "PF", PL / 2 - 15, [pf.pos[2]]), ...endDowels(b, "PB", PL / 2 - 15, [pb.pos[2]])], tools: ["hammer"] },
+ { title: "Push the plinths in and screw them to the side", detail: "Under the bottom. One connector screw into each plinth, and one more into the bottom of the short divider.", add: ["PF", "PB"], fix: [sideScrews(b, -1, [PL / 2 + 15], 1, [pf.pos[2]]), sideScrews(b, -1, [PL / 2 + 15], 1, [pb.pos[2]]), fx("bolt", [[0, PL, z0 + 60]], [0, 1, 0], "BOT", CONN)], tools: ["allen"] },
+ { title: "Tap dowels into the back rails", detail: "One in each end.", fix: [...endDowels(b, "RB", rb.pos[1], [rb.pos[2]]), ...endDowels(b, "RM", rm.pos[1], [rm.pos[2]])], wait: ["RB", "RM"], from: { RB: [300, 0, 0], RM: [300, 0, 0] }, tools: ["hammer"] },
+ { title: "Push the back rails onto the side", detail: "One under the top and one just above the shelf, at the back, onto the dowels.", add: ["RB", "RM"] },
{ title: "Fit the other side", detail: "Line it up with every dowel and press it on evenly.", add: ["SR"] },
- { title: "Screw the other side to the top and the shelf", detail: "Three connector screws.", fix: [sideScrews(b, 1, [H - T / 2]), sideScrews(b, 1, [ys], 1, [sz])], tools: ["allen"] },
- { title: "Tap dowels into the back rails", detail: "One in each end.", fix: [...endDowels(b, "RB", rb.pos[1], [rb.pos[2]]), ...endDowels(b, "RM", rm.pos[1], [rm.pos[2]])], tools: ["hammer"] },
- { title: "Drop the back rails in", detail: "One under the top and one just above the shelf, at the back.", add: ["RB", "RM"] },
+ { title: "Screw the other side to the top and the shelf", detail: "Three connector screws.", fix: [sideScrews(b, 1, [H - T / 2]), sideScrews(b, 1, [ys], 1, [sz + 40])], tools: ["allen"] },
{ title: "Screw the other side to the bottom", detail: "Three connector screws: two into the bottom, one into the shelf's back end.", fix: [sideScrews(b, 1, [PL + T / 2]), sideScrews(b, 1, [ys], 1, [z0 + 50])], tools: ["allen"] },
- { title: "Screw the plinths to the other side", detail: "One connector screw into each.", fix: [sideScrews(b, 1, [PL / 2], 1, [pf.pos[2]]), sideScrews(b, 1, [PL / 2], 1, [pb.pos[2]])], tools: ["allen"] },
+ { title: "Screw the plinths to the other side", detail: "One connector screw into each.", fix: [sideScrews(b, 1, [PL / 2 + 15], 1, [pf.pos[2]]), sideScrews(b, 1, [PL / 2 + 15], 1, [pb.pos[2]])], tools: ["allen"] },
{
title: "Lay the back panel on",
detail: "Unfold it over the back, edges in the rebates, and push it square.",
@@ -422,14 +423,14 @@ function sliding(s: ProductSpec): { recipe: CustomParams; stages: Stages } {
fix: [
...doors.map((d) => fx("roller", roll(d, dy0), [0, 1, 0], d.id)),
...doors.map((d) => fx("clip", roll(d, dy1), [0, -1, 0], d.id, { name: "Top guide" })),
- ...doors.map((d) => fx("screw", [...roll(d, dy0), ...roll(d, dy1)].flatMap((p): Vec3[] => [[p[0] - 14, p[1], p[2]], [p[0] + 14, p[1], p[2]]]), [0, 0, 0], d.id, { len: 14, dia: 4 })),
+ ...doors.map((d) => fx("screw", [...roll(d, dy0), ...roll(d, dy1)].flatMap((p): Vec3[] => [[p[0] - 25, p[1], p[2]], [p[0] + 25, p[1], p[2]]]), [0, 0, 0], d.id, { len: 14, dia: 4 })),
],
tools: ["screwdriver"],
},
{ title: "Hang the back door", detail: "Top first into the inner track, then lift it and set the rollers down into the bottom track.", add: ["DR0"], people: 1 },
{ title: "Hang the front door", detail: "The same in the outer tracks. Slide both doors to check they run freely.", add: ["DR1"] },
{ title: "Level the doors", detail: "Turn the screw on each bottom roller until the doors hang straight and meet the sides evenly.", tools: ["screwdriver"] },
- { title: "Screw on the knobs", detail: "One on each door, near its outer edge, a long screw from inside.", fix: [fx("knob", kn, [0, 0, -1]), fx("screw", kn.map((p): Vec3 => [p[0], p[1], p[2] - TD]), [0, 0, 1], undefined, { len: 30, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Screw on the knobs", detail: "One on each door, near its outer edge, a long screw from inside.", fix: [fx("knob", kn, [0, 0, -1]), fx("screw", kn.map((p): Vec3 => [p[0], p[1], p[2] - TD - 5]), [0, 0, 1], undefined, { len: 30, dia: 4 })], tools: ["screwdriver"] },
];
// the rail holders and the screws through the door fittings go sideways or into the door
const rh = steps.find((x) => /clothes rails/.test(x.title))!;
diff --git a/src/lib/plan/families/ramnefjall.ts b/src/lib/plan/families/ramnefjall.ts
index 24c660f..94d1f1e 100644
--- a/src/lib/plan/families/ramnefjall.ts
+++ b/src/lib/plan/families/ramnefjall.ts
@@ -60,7 +60,8 @@ function recipe(s: ProductSpec) {
});
parts.push({ id: "HA", name: "Headboard top", size: [2 * xp + P, H - 15 - yArch + 25, 50], pos: [0, (yArch + H - 15) / 2, zF], material: wood, pieces: arch });
for (const sx of [-1, 1]) parts.push({ id: `HP${sx}`, name: "Headboard post", size: [P, yArch - yFoot, 50], pos: [sx * xp, (yArch + yFoot) / 2, zF], material: wood });
- parts.push({ id: "HS", name: "Centre stile", size: [40, yArch - 260, 40], pos: [0, (yArch + 260) / 2, zF], material: wood });
+ const yStile = archY(0) - 50; // up to the underside of the curve
+ parts.push({ id: "HS", name: "Centre stile", size: [40, yStile - 260, 40], pos: [0, (yStile + 260) / 2, zF], material: wood });
parts.push({ id: "HR", name: "Headboard bottom rail", size: [2 * xp - P, 60, 50], pos: [0, 230, zF], material: wood });
for (const sx of [-1, 1]) parts.push({ id: `HF${sx}`, name: "Headboard foot", size: [P + 10, yFoot, 60], pos: [sx * xp, yFoot / 2, zF], material: wood });
parts.push({ id: "HBD", name: "Headboard board", size: [2 * xp + P, yArch - 200, 6], pos: [0, (yArch + 200) / 2, zF + 28], material: "board" });
@@ -105,7 +106,21 @@ function recipe(s: ProductSpec) {
}
const xin = xr - 25; // inside of the slat rails
parts.push({ id: "CB", name: "Cross bar", size: [2 * xin, 40, 60], pos: [0, ySl - 20, 0], material: wood });
- if (wide) parts.push({ id: "CM", name: "Centre beam", size: [60, 40, Lr], pos: [0, ySl - 20, (zi0 + zi1) / 2], material: wood });
+ if (wide) {
+ // the beam, with its leg down towards the floor where the foot bolt goes in
+ const zc = (zi0 + zi1) / 2, legZ = -L / 4 - zc, legLo = 20;
+ parts.push({
+ id: "CM",
+ name: "Centre beam",
+ size: [60, ySl - legLo, Lr],
+ pos: [0, (ySl + legLo) / 2, zc],
+ material: wood,
+ pieces: [
+ { shape: "box", size: [60, 40, Lr], pos: [0, (ySl - legLo) / 2 - 20, 0] },
+ { shape: "box", size: [50, ySl - 40 - legLo, 50], pos: [0, -20, legZ] },
+ ],
+ });
+ }
const rolls = wide ? [-1, 1].map((sx) => ({ id: `SL${sx}`, x: (sx * (xin + 30)) / 2, w: xin - 40 })) : [{ id: "SL", x: 0, w: 2 * xin - 10 }];
for (const r of rolls) parts.push({ id: r.id, name: "Slatted bed base", size: [r.w, 14, Lr - 20], pos: [r.x, ySl + 7, (zi0 + zi1) / 2], material: wood, pieces: slatRoll(r.w, Lr - 20) });
@@ -117,13 +132,14 @@ function recipe(s: ProductSpec) {
title: "Bolt the posts to the headboard top",
detail: "Lay the parts face up on a rug. Two bolts through each post into the curved top, turned with the key in its handle.",
add: ["HA", "HP-1", "HP1"],
- fix: sides.map((sx): CustomFix => ({ ...BOLT, count: 2, at: [-1, 1].map((d): Vec3 => [sx * xp + d * 12, yArch, zF]), dir: [0, 1, 0], on: `HP${sx}`, mate: "HA" })),
+ // down through the ends of the curve into the tops of the posts
+ fix: sides.map((sx): CustomFix => ({ ...BOLT, count: 2, at: [-1, 1].map((d): Vec3 => [sx * xp, archY(xp), zF + d * 12]), dir: [0, -1, 0], on: "HA", mate: `HP${sx}` })),
pose: "+z",
tools: ["allen"],
warnings: ["floor"],
from: { "HP-1": [0, -300, 0], HP1: [0, -300, 0] },
},
- { title: "Bolt in the centre stile", detail: "Up into the middle of the curved top, two bolts.", add: ["HS"], fix: [{ ...BOLT, count: 2, at: [-1, 1].map((d): Vec3 => [d * 10, archY(0) - 50, zF]), dir: [0, -1, 0], on: "HA", mate: "HS" }], tools: ["allen"], from: { HS: [0, -300, 0] } },
+ { title: "Bolt in the centre stile", detail: "Up into the middle of the curved top, two bolts.", add: ["HS"], fix: [{ ...BOLT, count: 2, at: [-1, 1].map((d): Vec3 => [0, archY(0), zF + d * 12]), dir: [0, -1, 0], on: "HA", mate: "HS" }], tools: ["allen"], from: { HS: [0, -300, 0] } },
{
title: "Bolt on the bottom rail",
detail: "Its strip of grip tape faces out. One bolt through each post and one into the stile.",
@@ -168,9 +184,13 @@ function recipe(s: ProductSpec) {
title: "Turn in the screws for the rails",
detail: wide ? "Four into the headboard and four into the footboard where the rails go, and one more in each for the centre beam. Leave the heads standing out." : "Four into the headboard and four into the footboard where the rails go. Leave the heads standing out.",
fix: [
- ...keyScrews(zi0 + 5, -1, (sx) => `HP${sx}`),
- ...keyScrews(zi1, 1, () => "FB"),
- ...(wide ? [{ ...SCREW, count: 2, at: [[0, ySl - 20, zi0], [0, ySl - 20, zi1]] as Vec3[], dir: [0, 0, -1] as Vec3 }] : []),
+ // into the frame faces inside the covers
+ ...keyScrews(zF + 31, -1, (sx) => `HP${sx}`),
+ ...keyScrews(zf - 15, 1, () => "FB"),
+ ...(wide ? [
+ { ...SCREW, count: 1, at: [[0, ySl - 20, zF + 31]] as Vec3[], dir: [0, 0, -1] as Vec3, on: "HBD", mate: "HS" },
+ { ...SCREW, count: 1, at: [[0, ySl - 20, zf - 15]] as Vec3[], dir: [0, 0, 1] as Vec3, on: "FB" },
+ ] : []),
],
tools: ["allen"],
},
diff --git a/src/lib/plan/families/ramsnas.ts b/src/lib/plan/families/ramsnas.ts
index c100610..63d6b41 100644
--- a/src/lib/plan/families/ramsnas.ts
+++ b/src/lib/plan/families/ramsnas.ts
@@ -37,8 +37,11 @@ function chair(): CustomParams {
// IKEA: 48 wide, 52 deep, 83 high; the seat 43 wide and 40 deep, 49 high on the cushion
const yA0 = 390, yA1 = 455, X = 215, Z0 = -200, Z1 = 200;
const legs: PartPiece[] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => rod([sx * (X - 15), yA0, sz * (sz > 0 ? Z1 - 15 : -Z0 - 15)], [sx * (X + 15), 0, sz * (sz > 0 ? Z1 + 30 : -Z0 + 5)], 30, "box")));
- const xP = X + 10;
- const post = (sx: number): PartPiece => rod([sx * xP, 0, Z0 - 38], [sx * (xP - 12), 800, Z0 - 70], 18);
+ // each back tube runs from the floor up through the bracket at the back corner of the seat (centre yB, zB)
+ const yB = 422, zB = Z0 - 20, dx = 12 / 800, dz = 32 / 800;
+ const tubeAt = (y: number): [number, number] => [X - dx * (y - yB), zB - dz * (y - yB)];
+ const [xT, zT] = tubeAt(800);
+ const post = (sx: number): PartPiece => rod([sx * tubeAt(0)[0], 0, tubeAt(0)[1]], [sx * xT, 800, zT], 18);
const parts: CustomPart[] = [
part("SEAT", "Seat with legs", [
box([-X, yA0, Z0], [X, yA1, Z1], "metal"),
@@ -49,12 +52,14 @@ function chair(): CustomParams {
part("BACK", "Back frame", [
post(-1),
post(1),
- rod([-(xP - 12), 805, Z0 - 70], [xP - 12, 805, Z0 - 70], 18),
- ...[650, 730].map((y) => box([-(xP - 15), y - 22, Z0 - 64], [xP - 15, y + 22, Z0 - 58])),
+ rod([-xT, 805, zT], [xT, 805, zT], 18),
+ ...[650, 730].map((y) => box([-(xT - 3), y - 22, tubeAt(y)[1] + 6], [xT - 3, y + 22, tubeAt(y)[1] + 12])),
], "metal"),
];
- const bolts = (sx: number) => fx("bolt", [410, 435].map((y): Vec3 => [sx * (X - 12), y, Z0 - 25]), [sx, 0, 0], "SEAT", { ...BOLT, mate: "BACK" });
- const washers = (sx: number) => fx("washer", [410, 435].map((y): Vec3 => [sx * (X - 12), y, Z0 - 25]), [sx, 0, 0], "SEAT");
+ // from outside, through the bracket into the tube; the washers sit under the heads
+ const holes = (sx: number) => [410, 435].map((y): Vec3 => [sx * (X + 12), y, zB]);
+ const bolts = (sx: number) => fx("bolt", holes(sx), [-sx, 0, 0], "SEAT", { ...BOLT, mate: "BACK" });
+ const washers = (sx: number) => fx("washer", holes(sx), [-sx, 0, 0], "SEAT");
const steps: CustomStep[] = [
{
title: "Slide the back frame into the seat",
@@ -66,13 +71,13 @@ function chair(): CustomParams {
{
title: "Bolt the left bracket by hand",
detail: "Two bolts with washers through the bracket into the tube. Hold the back frame steady with your other hand.",
- fix: [washers(-1), bolts(-1)],
+ fix: [bolts(-1), washers(-1)],
warnings: ["loose"],
},
{
title: "Bolt the right bracket and tighten",
detail: "Two more bolts on the other side, then tighten all four with the Allen key.",
- fix: [washers(1), bolts(1)],
+ fix: [bolts(1), washers(1)],
tools: ["allen"],
},
{ title: "Stand the chair up", detail: "Turn it over onto its feet. The cushion's cover can be taken off for washing later.", pose: "+y" },
diff --git a/src/lib/plan/families/rast.ts b/src/lib/plan/families/rast.ts
index dc406a5..67243f8 100644
--- a/src/lib/plan/families/rast.ts
+++ b/src/lib/plan/families/rast.ts
@@ -8,7 +8,8 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3
* go under the sides, two brackets on the top hold it to the wall with the screws and plugs in the box. Each drawer
* is a front with four cam bolts, two sides locked with cams, a bottom slid in, a back knocked on with ribbed pins
* and a knob; turn stops in the carcass keep the drawers in. The 6-drawer dresser has a middle divider joined to
- * the rails and the top with cam locks. The old 62x70 chest is a different product and keeps its old guide.
+ * the rails and the top with cam locks. The 3-drawer dresser 62x70 (rast-3-drawers, US manual) is built like one
+ * column of the 6-drawer dresser: one screw per rail end and a nailed back.
*/
const T = 18;
@@ -18,6 +19,8 @@ function recipe(s: ProductSpec): CustomParams {
const cols = W > 900 ? 2 : 1;
const rows = 3;
const six = cols === 2;
+ const old = /^rast-3-drawers$/.test(s.slug ?? "");
+ const nailed = six || old;
const zb = -D / 2 + 8; // the back lies behind the boards
const zf = D / 2;
const inW = W - 2 * T - (cols - 1) * T;
@@ -40,7 +43,7 @@ function recipe(s: ProductSpec): CustomParams {
wood(`rB${c}`, "Back rail", [w, railH, T], [x, 20 + railH / 2, zb + T / 2]);
rails.push(`rF${c}`, `rB${c}`);
}
- parts.push({ id: "back", name: "Back panel", size: [six ? W : W - 2 * T + 16, H - 20, 3], pos: [0, 20 + (H - 20) / 2, six ? -D / 2 - 1.5 : -D / 2 + 5], material: "fiber" });
+ parts.push({ id: "back", name: "Back panel", size: [nailed ? W : W - 2 * T + 16, H - 20, 3], pos: [0, 20 + (H - 20) / 2, nailed ? -D / 2 - 1.5 : -D / 2 + 5], material: "fiber" });
// drawers
const dw = colW - 6, dd = D - 50, st = 12;
@@ -71,9 +74,10 @@ function recipe(s: ProductSpec): CustomParams {
const isSide = (x: number) => Math.abs(Math.abs(x) - (W / 2 - T)) < 1;
const sideScrews = (sx: number): CustomFix => {
const pts: Vec3[] = [
- ...[-1, 1].map((k) => [sx * (W / 2), H - T / 2, k * (D / 2 - 60)] as Vec3),
+ // beside the top's dowels, not on them
+ ...[-1, 1].map((k) => [sx * (W / 2), H - T / 2, k * (D / 2 - 100)] as Vec3),
// the chest takes two screws into each rail end, the dresser one
- ...[zf - T / 2, zb + T / 2].flatMap((z) => (six ? [0] : [-14, 14]).map((dy) => [sx * (W / 2), 20 + railH / 2 + dy, z] as Vec3)),
+ ...[zf - T / 2, zb + T / 2].flatMap((z) => (nailed ? [14] : [-14, 14]).map((dy) => [sx * (W / 2), 20 + railH / 2 + dy, z] as Vec3)),
];
return fix("screw", pts, [-sx, 0, 0], { name: "Connector screw", len: 50, dia: 7, on: sx < 0 ? "sL" : "sR" });
};
@@ -116,8 +120,8 @@ function recipe(s: ProductSpec): CustomParams {
...[-1, 1].map((sx) => fix("dowel", [-1, 1].map((k) => [sx * (W / 2 - T), H - T / 2, k * (D / 2 - 60)] as Vec3), [sx, 0, 0], { len: 30, dia: 8, on: "top" })),
fix("camScrew", [[0, H - T, 0], [0, H - T, -60]], [0, 1, 0], { len: 34 }),
fix("angle", brackets, [0, 0, 1], { name: "Wall bracket", len: 80, dia: 30 }),
- fix("washer", brackets.map((p) => [p[0], p[1] - 1, p[2] + 20] as Vec3), [0, -1, 0]),
- fix("screw", brackets.map((p) => [p[0], p[1] - 2, p[2] + 20] as Vec3), [0, -1, 0], { len: 16, dia: 4, on: "top" }),
+ fix("washer", brackets.map((p) => [p[0], p[1] - 1, p[2] + 25] as Vec3), [0, -1, 0]),
+ fix("screw", brackets.map((p) => [p[0], p[1] - 2, p[2] + 25] as Vec3), [0, -1, 0], { len: 16, dia: 4, on: "top" }),
],
tools: ["screwdriver"],
});
@@ -133,19 +137,23 @@ function recipe(s: ProductSpec): CustomParams {
push({
title: "Screw the wall brackets onto the top",
detail: "At the back corners, one screw and washer each. Use the short screws, not the wall screws.",
- fix: [fix("angle", brackets, [0, 0, 1], { name: "Wall bracket", len: 80, dia: 30, on: "top" }), fix("washer", brackets.map((p) => [p[0], p[1] - 1, p[2] + 20] as Vec3), [0, -1, 0]), fix("screw", brackets.map((p) => [p[0], p[1] - 2, p[2] + 20] as Vec3), [0, -1, 0], { len: 16, dia: 4, on: "top" })],
+ fix: [fix("angle", brackets, [0, 0, 1], { name: "Wall bracket", len: 80, dia: 30, on: "top" }), fix("washer", brackets.map((p) => [p[0], p[1] - 1, p[2] + 25] as Vec3), [0, -1, 0]), fix("screw", brackets.map((p) => [p[0], p[1] - 2, p[2] + 25] as Vec3), [0, -1, 0], { len: 16, dia: 4, on: "top" })],
tools: ["screwdriver"],
});
push({ title: "Screw the top to one side", detail: "Two long screws through the side with the box spanner and Allen key.", fix: [{ ...sideScrews(-1), at: sideScrews(-1).at!.slice(0, 2), count: 2 }], tools: ["allen"], pose: "-z" });
- push({ title: "Tap dowels into the bottom rails", detail: "Two into each end of both rails.", fix: rails.flatMap((id) => [-1, 1].map((sx) => fix("dowel", [[sx * (W / 2 - T), 20 + railH / 2, id.startsWith("rF") ? zf - T / 2 : zb + T / 2]], [sx, 0, 0], { len: 30, dia: 8, on: id }))), tools: ["hammer"] });
- push({
- title: "Fit the rails and the other side",
- detail: "Push the rails into the first side, lay the second side on, then six long screws through it: two into the top and two into each rail.",
- add: rails,
- fix: [sideScrews(1)],
- tools: ["allen"],
- check: "square",
- });
+ push({ title: "Tap dowels into the bottom rails", detail: old ? "One into each end of both rails." : "Two into each end of both rails.", fix: rails.flatMap((id) => [-1, 1].map((sx) => fix("dowel", [[sx * (W / 2 - T), 20 + railH / 2, id.startsWith("rF") ? zf - T / 2 : zb + T / 2]], [sx, 0, 0], { len: 30, dia: 8, on: id }))), tools: ["hammer"] });
+ if (old) {
+ push({ title: "Push the rails into the side", detail: "Front and back, then one long screw through the side into each.", add: rails, fix: [{ ...sideScrews(-1), at: sideScrews(-1).at!.slice(2), count: 2 }], tools: ["allen"] });
+ push({ title: "Screw the other side on", detail: "Onto the dowels, then four long screws through it: two into the top and one into each rail.", fix: [sideScrews(1)], tools: ["allen"], check: "square" });
+ } else
+ push({
+ title: "Fit the rails and the other side",
+ detail: "Push the rails into the first side, lay the second side on, then six long screws through it: two into the top and two into each rail.",
+ add: rails,
+ fix: [sideScrews(1)],
+ tools: ["allen"],
+ check: "square",
+ });
} else {
push({
title: "Screw the sides on",
@@ -156,18 +164,20 @@ function recipe(s: ProductSpec): CustomParams {
check: "square",
});
}
- if (!six) {
+ if (!nailed) {
push({ title: "Slide the back panel in", detail: "Into the grooves in the sides from the bottom, smooth side in.", add: ["back"], from: { back: [0, -400, 0] } });
const pts: Vec3[] = [[-W / 4, H - T / 2, -D / 2 + 3], [W / 4, H - T / 2, -D / 2 + 3], [-W / 4, 20 + railH / 2, -D / 2 + 3], [W / 4, 20 + railH / 2, -D / 2 + 3]];
push({ title: "Push the sleeves into the back", detail: "Four plastic sleeves into the holes, two into the top and two into the back rail.", fix: [fix("plug", pts, [0, 0, 1], { name: "Plastic sleeve", included: true, len: 12, dia: 8 })] });
push({ title: "Press a pin into each sleeve", detail: "It spreads the sleeve and holds the back tight.", fix: [fix("cap", pts, [0, 0, 1], { name: "Push pin", len: 12, dia: 12 })] });
push({ title: "Press the glides under the sides", detail: "Two under each side, pegs into the holes.", fix: [fix("glide", glides, [0, 1, 0], { name: "Glide", len: 6, dia: 20 })] });
} else {
- push({ title: "Press the glides in", detail: "Two under each side and two under the divider.", fix: [fix("glide", glides, [0, 1, 0], { name: "Glide", len: 6, dia: 20 })], pose: "-z" });
+ push({ title: "Press the glides in", detail: six ? "Two under each side and two under the divider." : "Two under each side.", fix: [fix("glide", glides, [0, 1, 0], { name: "Glide", len: 6, dia: 20 })], pose: "-z" });
push({ title: "Lay the back panel on", detail: "Smooth side in. Line it up with the corners so the frame sits square.", add: ["back"], from: { back: [0, 0, -300] }, check: "square" });
const nails: Vec3[] = [];
- for (let i = 0; i < 10; i++) for (const y of [30, (H - T) * 0.5, H - 10]) nails.push([-W / 2 + 10 + ((W - 20) * i) / 9, y, -D / 2 - 3]);
- chunk({ title: "Nail the back on", detail: "30 nails along the edges and across the middle, with the nail holder. A corner first, then check it's square.", tools: ["hammer"] }, [fix("nail", nails, [0, 0, 1], { len: 20, dia: 1.6 })]);
+ const row = (n: number, y: number) => { for (let i = 0; i < n; i++) nails.push([-W / 2 + 10 + ((W - 20) * i) / (n - 1), y, -D / 2 - 3]); };
+ if (six) for (const y of [30, (H - T) * 0.5, H - 10]) row(10, y);
+ else { row(6, 30); row(6, H - 10); for (const y of [H * 0.3, H * 0.6]) for (const sx of [-1, 1]) nails.push([sx * (W / 2 - 9), y, -D / 2 - 3]); }
+ chunk({ title: "Nail the back on", detail: `${nails.length} nails along the edges${six ? " and across the middle" : ""}, with the nail holder. A corner first, then check it's square.`, tools: ["hammer"] }, [fix("nail", nails, [0, 0, 1], { len: 20, dia: 1.6 })]);
}
push({ title: six ? "Stand it up together" : "Stand it up", detail: "Lift it upright, don't drag it by one corner.", pose: "+y", people: six ? 2 : 1, warnings: six ? ["two"] : [] });
const wall: Vec3[] = brackets.map((p) => [p[0], p[1] - 30, -D / 2 - 2]);
@@ -205,7 +215,7 @@ function recipe(s: ProductSpec): CustomParams {
);
chunk(
{ title: "Screw on the knobs", detail: "One screw from the inside of each front into its knob.", tools: ["screwdriver"] },
- drawers.flatMap((d, i) => [fix("knob", [[d.x, d.y0 + d.h / 2, zf]], [0, 0, -1], { on: `df${i}`, len: 25, dia: 34 }), fix("screw", [[d.x, d.y0 + d.h / 2, zf - T]], [0, 0, 1], { len: 30, dia: 4 })]),
+ drawers.flatMap((d, i) => [fix("knob", [[d.x, d.y0 + d.h / 2, zf + 3]], [0, 0, -1], { on: `df${i}`, len: 25, dia: 34 }), fix("screw", [[d.x, d.y0 + d.h / 2, zf - T - 2]], [0, 0, 1], { len: 30, dia: 4 })]),
);
push({ title: "Slide the drawers in", detail: "Onto the runners, all the way in." });
const stopL: Vec3[] = drawers.map((d) => [walls(d.c)[0], d.y0 + d.h + 1, zf - 40]);
@@ -223,8 +233,7 @@ const family: Family = {
names: ["RAST"],
recipe(s) {
const slug = s.slug ?? "";
- // the 62x70 chest (rast-3-drawers) is the old RAST with its own manual
- if (/rast-chest-3-drawers-60|rast-6-drawer-dresser/.test(slug)) return recipe(s);
+ if (/rast-chest-3-drawers-60|rast-6-drawer-dresser|^rast-3-drawers$/.test(slug)) return recipe(s);
return null;
},
};
diff --git a/src/lib/plan/families/ravsten.ts b/src/lib/plan/families/ravsten.ts
index 17a46e9..8f1b52c 100644
--- a/src/lib/plan/families/ravsten.ts
+++ b/src/lib/plan/families/ravsten.ts
@@ -86,7 +86,8 @@ function joints(f: Frame, g: number, L: number) {
at: [-1, 1].flatMap((z) => [pt(ax, f.apronY - 12, z * za), pt(rx, f.railFootY, z * zr)]),
dir: [-g, 0, 0],
};
- const bolts: CustomFix = { kind: "bolt", name: "Long bolt", count: 2, len: 80, dia: 8, on, at: [-1, 1].map((z) => pt(ax, f.apronY + 10, z * za)), dir: [-g, 0, 0] };
+ // in from the outside of the frame's top rail, sticking out inside until the long rail goes on
+ const bolts: CustomFix = { kind: "bolt", name: "Long bolt", count: 2, len: 80, dia: 8, on, at: [-1, 1].map((z) => pt(g * (f.legX(f.apronY) + 10), f.apronY + 10, z * za)), dir: [-g, 0, 0] };
const clamps: CustomFix[] = [-1, 1].map((z, i): CustomFix => ({
kind: "nut",
name: "Bolt clamp",
diff --git a/src/lib/plan/families/relatera.ts b/src/lib/plan/families/relatera.ts
index a74ad81..dab074e 100644
--- a/src/lib/plan/families/relatera.ts
+++ b/src/lib/plan/families/relatera.ts
@@ -33,30 +33,36 @@ function recipe(s: ProductSpec) {
const zl = -60;
const footY = 12, footH = 26;
const legY0 = footY + footH, legY1 = yU - 30;
- const xb = xl - LW / 2; // beam ends
+ const xb = xl; // beam ends: they slide into the heads on top of the legs
const parts: CustomPart[] = [];
parts.push({ id: "TOP", name: "Table top", size: [TW, T, TD], pos: [0, H - T / 2, 0] });
// the beam: two steel channels, open at the top, the second sliding inside the first
const half = xb + 120;
- const channel = (len: number, d: number, h: number): PartPiece[] => [
+ // each half has a tab across its top, halfway along, for a screw up into the top
+ const channel = (len: number, d: number, h: number, tab: number): PartPiece[] => [
{ shape: "box", size: [len, 3, d], pos: [0, -h / 2 + 1.5, 0] },
...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [len, h, 3], pos: [0, 0, sz * (d / 2 - 1.5)] })),
+ { shape: "box", size: [30, 3, d], pos: [tab, h / 2 - 1.5, 0] },
];
- parts.push({ id: "BA", name: "Beam half", size: [half, 50, 60], pos: [-xb + half / 2, yU - 25, zl], material: "metal", pieces: channel(half, 60, 50) });
- parts.push({ id: "BB", name: "Beam half, inner", size: [half, 46, 53], pos: [xb - half / 2, yU - 27, zl], material: "metal", pieces: channel(half, 53, 46) });
+ parts.push({ id: "BA", name: "Beam half", size: [half, 50, 60], pos: [-xb + half / 2, yU - 25, zl], material: "metal", pieces: channel(half, 60, 50, -xb * 0.5 - (-xb + half / 2)) });
+ parts.push({ id: "BB", name: "Beam half, inner", size: [half, 46, 53], pos: [xb - half / 2, yU - 27, zl], material: "metal", pieces: channel(half, 53, 46, xb * 0.5 - (xb - half / 2)) });
- const legPieces = (len: number): PartPiece[] =>
- sit
+ // the head on top of each leg takes the beam's end (on the sit/stand legs it holds the gearbox)
+ const headY = yU - 45, headH = 30; // the head's middle, relative to the floor
+ const legPieces = (len: number): PartPiece[] => {
+ const head: PartPiece = { shape: "box", size: [LW + 16, headH, 70], pos: [0, headY - (legY0 + legY1) / 2, 0] };
+ return sit
? [
{ shape: "box", size: [LW + 10, len * 0.5, LD + 10], pos: [0, -len * 0.25, 0] },
{ shape: "box", size: [LW, len * 0.5, LD], pos: [0, len * 0.25, 0] },
- { shape: "box", size: [LW + 16, 70, LD + 30], pos: [0, len / 2 - 35, 0] },
+ head,
]
- : [{ shape: "box", size: [LW, len, LD], pos: [0, 0, 0] }];
+ : [{ shape: "box", size: [LW, len, LD], pos: [0, 0, 0] }, head];
+ };
const legLen = legY1 - legY0;
for (const sx of [-1, 1]) {
- parts.push({ id: `L${sx}`, name: "Leg", size: [sit ? LW + 16 : LW, legLen, sit ? LD + 30 : LD], pos: [sx * xl, (legY0 + legY1) / 2, zl], material: "metal", pieces: legPieces(legLen) });
+ parts.push({ id: `L${sx}`, name: "Leg", size: [LW + 16, legLen, 70], pos: [sx * xl, (legY0 + legY1) / 2, zl], material: "metal", pieces: legPieces(legLen) });
parts.push({ id: `S${sx}`, name: "Top support", size: [50, 30, TD - 120], pos: [sx * xl, yU - 15, 0], material: "metal" });
parts.push({ id: `F${sx}`, name: "Foot bar", size: [70, footH, TD - 40], pos: [sx * xl, footY + footH / 2, 0], material: "metal" });
}
@@ -64,12 +70,14 @@ function recipe(s: ProductSpec) {
parts.push({ id: "SH", name: "Drive shaft", size: [2 * xl - 40, 14, 14], pos: [0, yU - 30, zl], shape: "cyl", material: "metal" });
// the crank folds against the right end, its handle out past the top
const reach = Math.max(80, W - TW);
- const x0 = xl + 40, x1 = TW / 2 + reach - 20;
+ // its bracket plate sits on the outer face of the right leg's head
+ const x0 = xl + (LW + 16) / 2, x1 = TW / 2 + reach - 20;
const crank: PartPiece[] = [
- { shape: "box", size: [x1 - x0, 20, 30], pos: [0, 0, 0] },
- { shape: "cyl", size: [22, 90, 22], pos: [(x1 - x0) / 2, -45, 0] },
+ { shape: "box", size: [6, 30, 50], pos: [-(x1 - x0) / 2 + 3, 0, 0] },
+ { shape: "box", size: [x1 - x0 - 6, 20, 30], pos: [3, -20, 0] },
+ { shape: "cyl", size: [22, 90, 22], pos: [(x1 - x0) / 2, -65, 0] },
];
- parts.push({ id: "CR", name: "Crank", size: [x1 - x0, 110, 30], pos: [(x0 + x1) / 2, yU - 90, zl + 50], material: "metal", pieces: crank });
+ parts.push({ id: "CR", name: "Crank", size: [x1 - x0, 130, 50], pos: [(x0 + x1) / 2, headY, zl + 20], material: "metal", pieces: crank });
}
// the cable tray hangs from the back of the beam
const trW = Math.round(TW * 0.45), trH = 90, trD = 90;
@@ -95,9 +103,10 @@ function recipe(s: ProductSpec) {
const beamNuts: CustomFix = { kind: "nut", count: 4, len: 6, dia: 6, at: sides.flatMap((sz) => [-40, 40].map((x): Vec3 => [x, yU - 25, zl - sz * 27])), dir: [0, 0, 1], on: "BB" };
const SHOULDER = { kind: "bolt" as const, name: "Shoulder bolt", len: 20, dia: 8 };
const legBolts: CustomFix[] = [
- { ...SHOULDER, count: 2, at: sides.map((sx): Vec3 => [sx * (xb - 25), yU - 50, zl]), dir: [0, 1, 0] },
+ // down through the beam's floor into the head, and two through each face of the head into the beam's sides
+ { ...SHOULDER, count: 2, at: sides.map((sx): Vec3 => [sx * xb, yU - 47, zl]), dir: [0, -1, 0] },
...sides.flatMap((sx) =>
- sides.map((sz): CustomFix => ({ ...SHOULDER, count: 2, at: [yU - 40, yU - 14].map((y): Vec3 => [sx * (xb - 25), y, zl + sz * 30]), dir: [0, 0, -sz] as Vec3, on: `L${sx}` })),
+ sides.map((sz): CustomFix => ({ ...SHOULDER, count: 2, at: [-15, 15].map((dx): Vec3 => [sx * xb + dx, headY, zl + sz * 35]), dir: [0, 0, -sz] as Vec3, on: `L${sx}` })),
),
];
const supportBolts: CustomFix[] = sides.map((sx) => ({ kind: "bolt", count: 2, len: 12, dia: 8, at: [-40, 40].map((dz): Vec3 => [sx * (xl - 25), yU - 15, zl + dz]), dir: [sx, 0, 0] as Vec3, on: `S${sx}`, mate: `L${sx}` }));
@@ -118,8 +127,8 @@ function recipe(s: ProductSpec) {
{ kind: "hook", count: 1, at: [hookAt], dir: [0, 0, -1], on: `S${hookSide}` },
{ kind: "screw", count: 2, len: 10, dia: 5, at: [-1, 1].map((d): Vec3 => [hookAt[0], hookAt[1] + 2, hookAt[2] + d * 24]), dir: [0, 1, 0], on: `S${hookSide}` },
];
- const topScrews: CustomFix = { kind: "screw", count: 4, len: 16, dia: 6, at: sides.flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xl, yU - 30, sz * (TD / 2 - 100)])), dir: [0, 1, 0], mate: "TOP" };
- const beamScrews: CustomFix = { kind: "screw", count: 2, len: 12, dia: 4, at: [-1, 1].map((sx): Vec3 => [sx * xb * 0.5, yU - 50, zl]), dir: [0, 1, 0], mate: "TOP" };
+ const topScrews: CustomFix = { kind: "screw", count: 4, len: 16, dia: 6, at: sides.flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * xl, yU - 30, sz * (TD / 2 - 150)])), dir: [0, 1, 0], mate: "TOP" };
+ const beamScrews: CustomFix = { kind: "screw", count: 2, len: 12, dia: 4, at: [-1, 1].map((sx): Vec3 => [sx * xb * 0.5, yU - 3, zl]), dir: [0, 1, 0], mate: "TOP" };
const pads: CustomFix = { kind: "glide", name: "Adhesive pad", count: 2, len: 2, dia: 30, at: [-1, 1].map((sx): Vec3 => [(sx * trW) / 3, yU - 40, zTray + trD / 2]), dir: [0, 0, -1], on: "TR" };
const nPlugs = TW >= 1100 ? 4 : 3;
const plugs: CustomFix = {
@@ -171,7 +180,7 @@ function recipe(s: ProductSpec) {
title: "Screw the crank onto one gearbox",
detail: "Choose the side you want it on. Four screws hold its bracket on the gearbox.",
add: ["CR"],
- fix: [{ kind: "screw", count: 4, len: 12, dia: 5, at: [-1, 1].flatMap((dy) => [-1, 1].map((dz): Vec3 => [xl + 40, yU - 60 + dy * 14, zl + 50 + dz * 10])), dir: [-1, 0, 0], on: "CR", mate: "L1" }],
+ fix: [{ kind: "screw", count: 4, len: 12, dia: 5, at: [-1, 1].flatMap((dy) => [-1, 1].map((dz): Vec3 => [xl + (LW + 16) / 2 + 6, headY + dy * 12, zl + 20 + dz * 12])), dir: [-1, 0, 0], on: "CR", mate: "L1" }],
tools: ["screwdriver"],
from: { CR: [250, 0, 0] },
},
diff --git a/src/lib/plan/families/renberget.ts b/src/lib/plan/families/renberget.ts
index aa7bf87..80e9af4 100644
--- a/src/lib/plan/families/renberget.ts
+++ b/src/lib/plan/families/renberget.ts
@@ -61,7 +61,8 @@ function chair(): CustomParams {
{ id: "BACK", name: "Backrest", size: [2 * xA - T, 1050 - seatTop, 90], pos: [0, (1050 + seatTop) / 2, zBack - 45 + T / 2], material: "soft" },
];
const tips: Vec3[] = angles.map((a) => [dirOf(a)[0] * R, baseY - 35, dirOf(a)[1] * R]);
- const hub: Vec3[] = angles.map((a) => [dirOf(a)[0] * 45, baseY + 35, dirOf(a)[1] * 45]);
+ // the screws go down through the top of the loose arm, in a row out from the hub, into the hub's tongue inside it
+ const hub: Vec3[] = [40, 65, 90, 115, 140].map((r): Vec3 => [dirOf(angles[0])[0] * r, baseY + 10, dirOf(angles[0])[1] * r]);
const mz = [zSeat - 120, zSeat + 80];
const mecBolts: Vec3[] = [-1, 1].flatMap((sx) => mz.map((z): Vec3 => [sx * 85, mechY0, z]));
const side = (sx: number) => (sx < 0 ? "ARML" : "ARMR");
@@ -70,8 +71,8 @@ function chair(): CustomParams {
{ title: "Slide the loose arm into the base", detail: "Lay the base on a rug and push the fifth arm into its slot in the hub.", add: ["BASE", "ARM5"], warnings: ["floor"] },
{
title: "Screw the arm in place",
- detail: "Five short screws into the hub with the Allen key. Use the short flat-headed ones.",
- fix: [fx("screw", hub, [0, -1, 0], "BASE", { name: "Allen screw", len: 12, dia: 6, mate: "ARM5" })],
+ detail: "Five short screws down through the top of the loose arm, next to the hub. Use the short flat-headed ones.",
+ fix: [fx("screw", hub, [0, -1, 0], "ARM5", { name: "Allen screw", len: 12, dia: 6, mate: "BASE" })],
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/ridspo.ts b/src/lib/plan/families/ridspo.ts
index d52fa83..1f7b5d7 100644
--- a/src/lib/plan/families/ridspo.ts
+++ b/src/lib/plan/families/ridspo.ts
@@ -36,7 +36,9 @@ function recipe(s: ProductSpec): CustomParams {
box("BA", "Back rail", [2 * (xs - L / 2), aH, t], [0, ay, -zl]);
SIDES.forEach((sx, i) => box(`SA${i + 1}`, "Side rail", [t, aH, 2 * (zl - L / 2)], [sx * xs, ay, 0]));
- box("DV", "Divider", [t, aH, zl - t / 2 + rz1], [0, ay, (-zl + t / 2 + rz1) / 2]);
+ // the divider runs from the back rail to just behind the front edge, over the front rail
+ const dvz1 = zl - 2;
+ box("DV", "Divider", [t, aH, dvz1 + zl - t / 2], [0, ay, (-zl + t / 2 + dvz1) / 2]);
leg("L3", -xs, -zl);
leg("L4", xs, -zl);
leg("L1", -xs, zl);
@@ -161,14 +163,14 @@ function recipe(s: ProductSpec): CustomParams {
title: "Bolt the side footrests between the legs",
detail: "The holes in the footrest face in. Two long bolts each, one through each leg.",
add: ["SS1", "SS2"],
- fix: SIDES.map((sx, i) => at("bolt", SIDES.map((sz) => [sx * xs, 230, sz * (zl + L / 2)] as Vec3), [0, 0, 1], undefined, `SS${i + 1}`, { len: 40, dia: 6 })),
+ fix: SIDES.flatMap((sx, i) => SIDES.map((sz) => at("bolt", [[sx * xs, 230, sz * (zl + L / 2)]], [0, 0, -sz], undefined, `SS${i + 1}`, { len: 40, dia: 6 }))),
tools: ["allen"],
},
{
title: "Bolt the back footrest between the back legs",
detail: "Use the two round-headed bolts.",
add: ["BS"],
- fix: [at("bolt", SIDES.map((sx) => [sx * (xs + L / 2), 280, -zl] as Vec3), [-1, 0, 0], undefined, "BS", { len: 30, dia: 6 })],
+ fix: SIDES.map((sx) => at("bolt", [[sx * (xs + L / 2), 280, -zl]], [-sx, 0, 0], undefined, "BS", { len: 30, dia: 6 })),
tools: ["allen"],
},
{ title: "Tighten the back leg nuts again", detail: "Check all four nuts on the brackets are tight, with the spring washers flat.", tools: ["wrench"] },
@@ -208,8 +210,9 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Each side of each opening, front ends to the front. Three screws in each, through the holes the drawing marks.",
add: ["RI1", "RO1", "RI2", "RO2"],
fix: SIDES.flatMap((sx, i) => [
- at("screw", [-100, 60, 200].map((z) => [sx * open0, 670, z] as Vec3), [-sx, 0, 0], `RI${i + 1}`, "DV", { len: 12, dia: 4 }),
- at("screw", [-100, 60, 200].map((z) => [sx * open1, 670, z] as Vec3), [sx, 0, 0], `RO${i + 1}`, `PK${i + 1}`, { len: 12, dia: 4 }),
+ // clear of the packer's own screws
+ at("screw", [-120, 30, 240].map((z) => [sx * open0, 670, z] as Vec3), [-sx, 0, 0], `RI${i + 1}`, "DV", { len: 12, dia: 4 }),
+ at("screw", [-120, 30, 240].map((z) => [sx * open1, 670, z] as Vec3), [sx, 0, 0], `RO${i + 1}`, `PK${i + 1}`, { len: 12, dia: 4 }),
]),
tools: ["screwdriver"],
},
@@ -251,7 +254,12 @@ function recipe(s: ProductSpec): CustomParams {
fix: drawers((cx, n) => [at("camScrew", SIDES.flatMap((ex) => [670, 710].map((y) => [cx + ex * (dx - open0 - 12 - sideT / 2), y, fz - t / 2] as Vec3)), [0, 0, 1], `DF${n}`, undefined, { len: 34 })]),
warnings: ["floor"],
},
- { title: "Push the drawer sides onto the cam bolts", detail: "Holes for the cam locks face in.", add: ["DS10", "DS11", "DS20", "DS21"] },
+ {
+ title: "Push the drawer sides onto the cam bolts",
+ detail: "Holes for the cam locks face in.",
+ add: ["DS10", "DS11", "DS20", "DS21"],
+ from: { DS10: [0, 0, -250], DS11: [0, 0, -250], DS20: [0, 0, -250], DS21: [0, 0, -250] },
+ },
{
title: "Lock the sides with cam locks",
detail: "Two in each side. Turn them clockwise until the side pulls tight to the front.",
@@ -262,7 +270,8 @@ function recipe(s: ProductSpec): CustomParams {
title: "Screw the bottom stay to the drawer front",
detail: "One screw through its bent foot, in the middle of the front. Leave it hanging down for now.",
add: ["ST1", "ST2"],
- fix: drawers((cx, n) => [at("screw", [[cx, dy0 - 6, fz - t / 2 - 10]], [0, 1, 0], `ST${n}`, `DF${n}`, { len: 14, dia: 4 })]),
+ // through the stay's bent-up foot into the back of the front
+ fix: drawers((cx, n) => [at("screw", [[cx, dy0 - 3, fz - t / 2 - 4]], [0, 0, 1], `ST${n}`, `DF${n}`, { len: 14, dia: 4 })]),
tools: ["screwdriver"],
},
{ title: "Slide in the drawer bottoms", detail: "Down the grooves in the sides, into the groove of the front.", add: ["DB1", "DB2"], from: { DB1: [0, 300, 0], DB2: [0, 300, 0] } },
diff --git a/src/lib/plan/families/rimforsa.ts b/src/lib/plan/families/rimforsa.ts
index 2fd1721..b2c7ab1 100644
--- a/src/lib/plan/families/rimforsa.ts
+++ b/src/lib/plan/families/rimforsa.ts
@@ -186,7 +186,8 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Screw the clips to the floor",
detail: "Move the bench aside first. Floor screws aren't included: pick ones made for your floor, and check for pipes and underfloor heating.",
- fix: [at("plug", legs.map((p) => [p[0], -30, p[2]] as Vec3), [0, -1, 0], undefined, undefined, { name: "Floor plug" }), at("screw", legs.map((p) => [p[0], 4, p[2]] as Vec3), [0, -1, 0], undefined, undefined, { len: 40, dia: 5 })],
+ // through the hole near the clip's edge (one in its middle would sit on the clip's own point and be moved off it)
+ fix: [at("plug", legs.map((p) => [p[0], -30, p[2] - 23] as Vec3), [0, -1, 0], undefined, undefined, { name: "Floor plug" }), at("screw", legs.map((p) => [p[0], 4, p[2] - 23] as Vec3), [0, -1, 0], undefined, undefined, { len: 40, dia: 5 })],
tools: ["drill", "screwdriver"],
},
{ title: "Slide the bench onto the clips", detail: "Each foot goes into its clip from the side.", warnings: ["two"], people: 2 },
diff --git a/src/lib/plan/families/risor.ts b/src/lib/plan/families/risor.ts
new file mode 100644
index 0000000..90803b1
--- /dev/null
+++ b/src/lib/plan/families/risor.ts
@@ -0,0 +1,80 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec } from "../../types";
+
+/**
+ * RISÖR has no assembly manual: the room divider comes put together, three solid wood frames with white panels,
+ * already joined by hinges. The guide unpacks it, stands it up and folds the outer panels forward so it stands.
+ */
+
+const F = 30; // frame section
+const LEG = 70; // the stiles stand this far below the bottom rail
+
+/** One panel: the frame, the white infill, and a few cross and upright bars at the heights given (fractions). */
+function panel(w: number, h: number, rails: number[], bars: [number, number, number][]): PartPiece[] {
+ const yb = -h / 2 + LEG + F / 2, yt = h / 2 - F / 2;
+ const span = yt - yb;
+ const p: PartPiece[] = [
+ { shape: "box", size: [F, h, F], pos: [-w / 2 + F / 2, 0, 0] },
+ { shape: "box", size: [F, h, F], pos: [w / 2 - F / 2, 0, 0] },
+ { shape: "box", size: [w - 2 * F, F, F], pos: [0, yt, 0] },
+ { shape: "box", size: [w - 2 * F, F, F], pos: [0, yb, 0] },
+ { shape: "box", size: [w - 2 * F, span - F, 4], pos: [0, (yt + yb) / 2, 0], material: "board" },
+ ];
+ for (const r of rails) p.push({ shape: "box", size: [w - 2 * F, 20, 20], pos: [0, yb + span * r, 0] });
+ // an upright bar between two rails, at a fraction of the width
+ for (const [x, a, b] of bars) {
+ const y0 = yb + span * a, y1 = yb + span * b;
+ p.push({ shape: "box", size: [20, y1 - y0, 20], pos: [-w / 2 + F + (w - 2 * F) * x, (y0 + y1) / 2, 0] });
+ }
+ return p;
+}
+
+function divider(s: ProductSpec): CustomParams {
+ const H = s.size.h * 10, D = s.size.d * 10;
+ const w = Math.round((s.size.w * 10) / 3);
+ const a = Math.asin(Math.min(0.9, (D - F) / w)); // the outer panels fold forward this far
+ const z0 = -D / 2 + F / 2;
+ const sides: PartPiece[] = panel(w, H, [0.22, 0.5, 0.8], [[0.4, 0, 0.22], [0.6, 0.22, 0.5], [0.3, 0.5, 0.8], [0.25, 0.8, 1]]);
+ const mid: PartPiece[] = panel(w, H, [0.2, 0.55, 0.85], [[0.6, 0, 0.2], [0.5, 0.2, 0.55], [0.3, 0.55, 0.85], [0.7, 0.85, 1]]);
+ // the hinges sit on the middle panel's edges, three on each side
+ for (const sx of [-1, 1]) for (const f of [0.25, 0.6, 0.9]) mid.push({ shape: "box", size: [8, 50, 34], pos: [sx * (w / 2 + 2), -H / 2 + H * f, 0], material: "metal" });
+ const parts: CustomPart[] = [
+ { id: "M", name: "Middle panel", size: [w, H, F], pos: [0, H / 2, z0], material: "wood", pieces: mid },
+ ...[-1, 1].map((sx): CustomPart => ({
+ id: sx < 0 ? "L" : "R",
+ name: "Side panel",
+ size: [w, H, F],
+ pos: [sx * (w / 2 + (w / 2) * Math.cos(a)), H / 2, z0 + (w / 2) * Math.sin(a)],
+ rot: [0, sx * -a, 0],
+ material: "wood",
+ pieces: sides,
+ })),
+ ];
+ return {
+ parts,
+ steps: [
+ {
+ title: "Unpack it and stand it up together",
+ detail: "It comes put together, the panels already hinged and folded flat. Lift it out of the box, take off the wrapping and stand it on its feet.",
+ add: ["M", "L", "R"],
+ from: { M: [0, 300, 0], L: [w / 2, 300, F + 10], R: [-w / 2, 300, 2 * F + 20] },
+ people: 2,
+ warnings: ["two"],
+ },
+ {
+ title: "Fold the outer panels forward",
+ detail: "Open each side panel on its hinges until the divider stands steady on its own. Don't open them flat, or it can tip over.",
+ warnings: ["tip"],
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["RISÖR", "RISOR"],
+ recipe(s) {
+ if (/risor-room-divider/.test(s.slug ?? "")) return divider(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/rocksjon.ts b/src/lib/plan/families/rocksjon.ts
index eb8ee0f..4851654 100644
--- a/src/lib/plan/families/rocksjon.ts
+++ b/src/lib/plan/families/rocksjon.ts
@@ -103,7 +103,10 @@ function footstool(p = "", ox = 0, oz = 0): { parts: CustomPart[]; steps: Custom
size: [fw, FH, fd],
pos: [ox, fy, oz],
material: "wood",
- pieces: [box([fw, FH, FT], [0, 0, -fd / 2 + FT / 2]), box([fw, FH, FT], [0, 0, fd / 2 - FT / 2]), box([FT, FH, fd - 2 * FT], [-fw / 2 + FT / 2, 0, 0]), box([FT, FH, fd - 2 * FT], [fw / 2 - FT / 2, 0, 0]), box([fw - 2 * FT, 6, fd - 2 * FT], [0, FH / 2 - 3, 0], "fiber")],
+ pieces: [box([fw, FH, FT], [0, 0, -fd / 2 + FT / 2]), box([fw, FH, FT], [0, 0, fd / 2 - FT / 2]), box([FT, FH, fd - 2 * FT], [-fw / 2 + FT / 2, 0, 0]), box([FT, FH, fd - 2 * FT], [fw / 2 - FT / 2, 0, 0]), box([fw - 2 * FT, 6, fd - 2 * FT], [0, FH / 2 - 3, 0], "fiber"),
+ // a block in each corner takes the leg's screws
+ ...[-1, 1].flatMap((g) => [-1, 1].map((gz) => box([60, FH, 60], [g * (W / 2 - 50), 0, gz * (D / 2 - 50)]))),
+ ],
};
const lg = legs(p, ox, oz, W / 2 - 50, D / 2 - 50);
const top = LEG + FH, cy = (LEG + H) / 2;
diff --git a/src/lib/plan/families/ronninge.ts b/src/lib/plan/families/ronninge.ts
index 0a8dc6e..df0fc41 100644
--- a/src/lib/plan/families/ronninge.ts
+++ b/src/lib/plan/families/ronninge.ts
@@ -154,7 +154,7 @@ function chairRecipe(): CustomParams {
{
title: "Screw the brackets to the seat",
detail: "One screw up through the foot of each bracket. Then turn the chair over.",
- fix: [fx("screw", S.flatMap((g) => zBr.map((z) => pt(g * (xBr - 2), YS, z))), [0, 1, 0], { len: 16, dia: 4 })],
+ fix: [fx("screw", S.flatMap((g) => zBr.map((z) => pt(g * (xBr - 24), YS, z))), [0, 1, 0], { len: 16, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Turn the chair over", detail: "Check the bolts again after a couple of weeks.", pose: "+y" },
@@ -455,7 +455,7 @@ function trolleyRecipe(): CustomParams {
{
title: "Tap small dowels into the drawer sides",
detail: "Two in the front end of each side.",
- fix: S.map((sx, i) => fx("dowel", [dy0 + 18, dy1 - 26].map((y) => pt(sx * dsx, y, DZ1 - 18)), [0, 0, -1], { on: `DS${i}`, len: 25, dia: 6 })),
+ fix: S.map((sx, i) => fx("dowel", [dy0 + 10, dy1 - 10].map((y) => pt(sx * dsx, y, DZ1 - 18)), [0, 0, -1], { on: `DS${i}`, len: 25, dia: 6 })),
tools: ["hammer"],
},
{
diff --git a/src/lib/plan/families/rosentorp.ts b/src/lib/plan/families/rosentorp.ts
index 51e5e52..ed6c97b 100644
--- a/src/lib/plan/families/rosentorp.ts
+++ b/src/lib/plan/families/rosentorp.ts
@@ -381,11 +381,12 @@ function pedestal(b: PlanBuilder, oval: boolean) {
const base = [...colIds, ...rings, ...lids, ...(oval ? ["beam"] : [])];
const leafSide = ["frame", "s0", "s1", "h0", "h1"];
const halves = ["t0", "t1"];
- // the legs lie side by side on the rug before they go on; their fittings follow them
- const laid = (i: number): Xf => (p) => [[0, p[1], -240 + 160 * i], [0, 0, 0]];
+ // the legs wait on the rug around the column, each in line with its place, so they go on along their dowels
+ const laid = (i: number): Xf => (p, r) => [add3(p, [Math.cos(legs[i].a) * 320, 0, Math.sin(legs[i].a) * 320]), r];
// the legs and their rods
k.step({ title: "Lay out the legs and fit the barrel nuts and rods", detail: "On a rug. Push a barrel nut into the hole in the top of each leg and screw a long threaded rod into its end, the right way round.", kind: "bolts", warnings: ["floor"] }, () => {
+ k.show(colIds, [0, 300, 0]);
lids.forEach((id, i) => k.put([id], laid(i)));
k.fit(BARREL, legs.map((l) => at(l, 110, 268)), [0, -1, 0], (i) => lids[i], { hole: false });
k.fit(ROD, legs.map((l) => at(l, 70, 235)), (i) => out(legs[i]), (i) => lids[i], { travel: 60 });
@@ -394,7 +395,6 @@ function pedestal(b: PlanBuilder, oval: boolean) {
k.fit(DOWEL, legs.flatMap((l) => [at(l, 70, 235, -22), at(l, 70, 235, 22)]), (i) => out(legs[i >> 1]), (i) => lids[i >> 1]),
);
k.step({ title: oval ? "Bolt two legs onto each column" : "Bolt the legs onto the column", detail: "Drop the steel ring over the top of the column first. Push each leg's rod through, then a washer and a coupling nut inside, tightened with the spanner.", kind: "bolts", tools: ["wrench"] }, () => {
- k.show(colIds, [0, -200, 0]);
k.show(rings, [0, 260, 0]);
k.show(lids, undefined, 0.15);
k.fit(WASHER, legs.map((l) => at(l, 40, 235)), (i) => out(legs[i]), (i) => lids[i], { hole: false });
@@ -461,7 +461,7 @@ function pedestal(b: PlanBuilder, oval: boolean) {
k.fit(MSCREW, sp, (i) => [-Math.cos(((i >> 1) * PI) / 2), 0, -Math.sin(((i >> 1) * PI) / 2)], "c0");
});
k.step({ title: "Screw the brackets to the frame", detail: "Two screws through each bracket into the frame's base.", scene: "top", kind: "screws", tools: ["screwdriver"] }, () =>
- k.fit(WSCREW, brPts.flatMap((p) => [[p[0] * 1.5 - p[2] * 0.3, TY - FH, p[2] * 1.5 + p[0] * 0.3], [p[0] * 1.5 + p[2] * 0.3, TY - FH, p[2] * 1.5 - p[0] * 0.3]] as Vec3[]), [0, 1, 0], "frame"),
+ k.fit(WSCREW, brPts.flatMap((p) => [[p[0] * 1.5 - p[2] * 0.3, TY - 46, p[2] * 1.5 + p[0] * 0.3], [p[0] * 1.5 + p[2] * 0.3, TY - 46, p[2] * 1.5 - p[0] * 0.3]] as Vec3[]), [0, 1, 0], "frame"), // into the underside of its base
);
k.step({ title: "Turn the table over together", detail: "Lift it by the top, never by the legs.", kind: "standup", people: 2 }, () => {
k.show([...base, ...leafSide, ...halves], undefined, 0);
@@ -475,7 +475,7 @@ function pedestal(b: PlanBuilder, oval: boolean) {
k.fit(LOCKW, sp, [0, 1, 0], "frame", { hole: false });
k.fit(MSCREW, sp, [0, 1, 0], "frame");
});
- k.step({ title: "Lower the frame onto the columns", detail: "The short rods go up through the brackets.", kind: "join" }, () => k.show(leafSide, [0, 300, 0], 0));
+ k.step({ title: "Lower the frame onto the columns", detail: "The short rods go up through the brackets.", kind: "join" }, () => k.show(["frame", "h0", "h1"], [0, 300, 0], 0)); // the slides go on with the top
k.step({ title: "Tighten four cap nuts onto the rods", detail: "With the crank key, through the holes in the frame.", kind: "bolts", tools: ["allen"] }, () =>
k.fit({ kind: "nut", len: 12, dia: 10, name: "Cap nut" }, tops.map((p) => [p[0], TY - FH + 6, p[2]] as Vec3), [0, -1, 0], (i) => colIds[i >> 1], { hole: false }),
);
@@ -489,7 +489,7 @@ function pedestal(b: PlanBuilder, oval: boolean) {
k.step({ title: "Screw the slides to the top", detail: "Sixteen screws, eight along each slide. Don't overtighten.", scene: "top", kind: "screws", tools: ["screwdriver"] }, () =>
k.fit(WSCREW, slidePts(8, SL - 120), [0, 1, 0], (i) => `s${i >= 8 ? 1 : 0}`, { mate: (i) => `t${(i % 8) < 4 ? 0 : 1}` }),
);
- k.step({ title: "Lift the top onto the frame together", detail: "Turn it the right way up and lower it so the slides sit on the frame.", kind: "join", people: 2 }, () => k.show([...halves], [0, 300, 0], 0));
+ k.step({ title: "Lift the top onto the frame together", detail: "Turn it the right way up and lower it so the slides sit on the frame.", kind: "join", people: 2 }, () => k.show([...halves, "s0", "s1"], [0, 300, 0], 0));
k.step({ title: "Screw the slides to the frame from below", detail: "Eight screws, four along each side.", kind: "screws", tools: ["screwdriver"] }, () =>
k.fit(WSCREW, slidePts(4, FL - 120).map((p) => [p[0], TY - 30, p[2]] as Vec3), [0, 1, 0], (i) => `s${i >> 2}`, { mate: () => "frame" }),
);
diff --git a/src/lib/plan/families/rudsta.ts b/src/lib/plan/families/rudsta.ts
index 297abb3..9397d63 100644
--- a/src/lib/plan/families/rudsta.ts
+++ b/src/lib/plan/families/rudsta.ts
@@ -55,7 +55,9 @@ function recipe(s: ProductSpec): CustomParams {
for (const [id, sx] of [["gL", -1], ["gR", 1]] as const) parts.push({ id, name: "Glass side", size: [5, gh, D - 2 * TUBE - 10], pos: [sx * (W / 2 - TUBE / 2), gy, 0], material: "glass" });
const backs = narrow ? ["bk0"] : ["bk0", "bk1"];
const bw = (W - 2 * TUBE) / backs.length;
- backs.forEach((id, i) => parts.push({ id, name: "Back panel", size: [bw, gh, 2], pos: [-W / 2 + TUBE + bw / 2 + i * bw, gy, -D / 2 + TUBE + 1], material: "metal" }));
+ // the back reaches over the bottom and top rails, which it is screwed to
+ const by0 = yC - TUBE / 2, by1 = yT;
+ backs.forEach((id, i) => parts.push({ id, name: "Back panel", size: [bw, by1 - by0, 2], pos: [-W / 2 + TUBE + bw / 2 + i * bw, (by0 + by1) / 2, -D / 2 + TUBE + 1], material: "metal" }));
const nDoor = narrow ? 1 : 2;
const dw = (W - 2 * TUBE) / nDoor - 3;
const doors = Array.from({ length: nDoor }, (_, i) => `d${i}`);
@@ -72,11 +74,11 @@ function recipe(s: ProductSpec): CustomParams {
...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (W / 2 - TUBE / 2), yC + TUBE / 2 + 3, sz * (D / 2 - 60)] as Vec3)),
...doors.map((_, i): Vec3 => [i ? W / 2 - TUBE - 15 : -W / 2 + TUBE + 15, yC + TUBE / 2 + 3, D / 2 - 10]),
];
- const bushTop: Vec3[] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (W / 2 - TUBE - 10), yT - TUBE, sz * zs] as Vec3));
+ const bushTop: Vec3[] = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (W / 2 - TUBE - 40), yT - TUBE, sz * zs] as Vec3));
const backScrews: Vec3[] = backs.flatMap((_, i) => {
const x0 = -W / 2 + TUBE + i * bw;
const n = narrow ? 4 : 6;
- return [yC + TUBE, yT - TUBE].flatMap((y) => Array.from({ length: n / 2 }, (_, k) => [x0 + (bw * (k + 1)) / (n / 2 + 1), y, -D / 2 + TUBE] as Vec3));
+ return [yC, yT - TUBE / 2].flatMap((y) => Array.from({ length: n / 2 }, (_, k) => [x0 + (bw * (k + 1)) / (n / 2 + 1), y, -D / 2 + TUBE + 2] as Vec3));
});
const supports: Vec3[] = shelfY.flatMap((y) => [-1, 1].flatMap((sx) => (narrow ? [-1, 1] : [1]).map((sz) => [sx * (W / 2 - TUBE - 4), y - 6, sz * (D / 2 - 60)] as Vec3)));
const steps: CustomStep[] = [
@@ -98,7 +100,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Fit the lock plate",
detail: "Under the front edge of the cabinet bottom, one screw. A small padlock can go through it later.",
- fix: [fix("clip", [[0, yC + TUBE / 2, D / 2 - 20]], [0, 1, 0], { name: "Lock plate", len: 30, dia: 24, on: "bot" }), fix("screw", [[0, yC + TUBE / 2 + 4, D / 2 - 30]], [0, -1, 0], { ...screw, on: "bot" })],
+ fix: [fix("clip", [[0, yC + TUBE / 2, D / 2 - 20]], [0, 1, 0], { name: "Lock plate", len: 30, dia: 24, on: "bot" }), fix("screw", [[0, yC + TUBE / 2 + 3, D / 2 - 45]], [0, -1, 0], { ...screw, on: "bot" })],
tools: ["allen"],
}
] : []) as CustomStep[]),
@@ -109,7 +111,7 @@ function recipe(s: ProductSpec): CustomParams {
{ title: "Screw the top rails to that side", detail: "Two countersunk screws, one into each rail end.", fix: [fix("screw", railEnds(-1, yT - TUBE / 2), [1, 0, 0], { name: "Countersunk screw", len: 10, dia: 6, on: "fL" })], tools: ["allen"] },
{ title: "Stand in the other glass side together", detail: "The same way, into the bushings at the other side.", add: ["gR"], people: 2, warnings: ["two", "hand"], from: { gR: [0, 360, 0] } },
{ title: "Screw the top rails to the other side", detail: "Two more countersunk screws.", fix: [fix("screw", railEnds(1, yT - TUBE / 2), [-1, 0, 0], { name: "Countersunk screw", len: 10, dia: 6, on: "fR" })], tools: ["allen"] },
- { title: narrow ? "Screw on the back panel" : "Screw on the back panels", detail: "Into the frame at the back, top and bottom.", add: backs, fix: [fix("screw", backScrews, [0, 0, 1], { ...screw })], tools: ["allen"], from: Object.fromEntries(backs.map((id) => [id, [0, 0, -300] as Vec3])) },
+ { title: narrow ? "Screw on the back panel" : "Screw on the back panels", detail: "Into the frame at the back, top and bottom.", add: backs, fix: [fix("screw", backScrews, [0, 0, -1], { ...screw })], tools: ["allen"], from: Object.fromEntries(backs.map((id) => [id, [0, 0, -300] as Vec3])) },
{
title: narrow ? "Hang the door" : "Hang the doors",
detail: "Set the door's bottom pivot into its bushing, swing the top in and push the pin up through the rail into it.",
@@ -118,7 +120,7 @@ function recipe(s: ProductSpec): CustomParams {
from: Object.fromEntries(doors.map((id) => [id, [0, 0, 300] as Vec3])),
},
{ title: "Slide the top plate on", detail: "From the back, until it clicks over the frame.", add: ["top"], from: { top: [0, 0, -400] } },
- { title: "Screw the top plate down", detail: "Two screws at the back.", fix: [fix("screw", [-1, 1].map((sx) => [sx * (W / 2 - TUBE), H, -zs] as Vec3), [0, -1, 0], { ...screw, on: "top" })], tools: ["allen"] },
+ { title: "Screw the top plate down", detail: "Two screws at the back.", fix: [fix("screw", [-1, 1].map((sx) => [sx * (W / 2 - TUBE - 40), H, -zs] as Vec3), [0, -1, 0], { ...screw, on: "top" })], tools: ["allen"] },
{ title: "Level it", detail: "Turn the feet until the door closes evenly." },
{
title: "Fix it to the wall",
diff --git a/src/lib/plan/families/sagesund.ts b/src/lib/plan/families/sagesund.ts
index a167e38..05004a6 100644
--- a/src/lib/plan/families/sagesund.ts
+++ b/src/lib/plan/families/sagesund.ts
@@ -125,26 +125,35 @@ function recipe(s: ProductSpec) {
return [p[0], Y0 - 4, p[2]] as Vec3;
};
const legTop = (c: [number, number, string]): Vec3 => [c[0] * legX, Y0 - 4, legZ(c[1])];
+ // the side rails wait beyond the foot end and the foot rail (with its bracket and legs) further out, so each
+ // slides in along its dowels when it is joined; a waiting part stands 1.6 times its offset away
+ const SIDE_OFF: Vec3 = [0, 0, 700], FOOT_OFF: Vec3 = [0, 0, 900];
+ const SIDE_IN: Vec3 = [0, 0, 1120], FOOT_IN: Vec3 = [0, 0, 1440];
const socketPts: Vec3[] = parts.filter((p) => p.id.startsWith("HT")).map((p) => [p.pos[0], Y1, zH]);
const steps: CustomStep[] = [
{
title: "Hang the slat rails on the side rails",
detail: "Their keyhole slots go over the screws inside each rail. For a mattress thicker than 24 cm, move the screws to the lower holes first.",
- add: ["S0", "S1", "R0", "R1"],
+ wait: ["S0", "S1", "R0", "R1"],
+ from: { S0: SIDE_OFF, S1: SIDE_OFF, R0: SIDE_OFF, R1: SIDE_OFF },
warnings: ["floor"],
},
{
title: "Lock the slat rails with inserts and pins",
detail: "Push an insert into each hole, then press its pin in until it's flush.",
- fix: [named("cap", "Insert", railPts(3, yRail - 14, 15), [0, 1, 0]), named("pin", "Locking pin", railPts(3, yRail - 12, 15), [0, 1, 0])],
+ fix: sides.flatMap((sx, i) => {
+ const pts = (y: number) => railPts(3, y, 15).filter((p) => Math.sign(p[0]) === sx);
+ return [named("cap", "Insert", pts(yRail - 14), [0, 1, 0], { on: `R${i}` }), named("pin", "Locking pin", pts(yRail - 12), [0, 1, 0], { on: `R${i}` })];
+ }),
warnings: ["hand"],
},
{
title: "Tighten the screws along the slat rails",
detail: "Eight in each rail. Snug them up so the rail sits tight against the fabric.",
- fix: [named("screw", "Rail screw", railPts(8, yRail + 8, 30), [sides[0], 0, 0], { len: 16, dia: 5, included: true })].flatMap((f) =>
- sides.map((sx) => ({ ...f, count: 8, at: f.at!.filter((p) => Math.sign(p[0]) === sx), dir: [sx, 0, 0] as Vec3 })),
+ // through the slat rail's upright web into the side rail behind it
+ fix: [named("screw", "Rail screw", railPts(8, yRail + 8, 3), [sides[0], 0, 0], { len: 16, dia: 5, included: true })].flatMap((f) =>
+ sides.map((sx, i) => ({ ...f, count: 8, at: f.at!.filter((p) => Math.sign(p[0]) === sx), dir: [sx, 0, 0] as Vec3, on: `R${i}`, mate: `S${i}` })),
),
tools: ["screwdriver"],
},
@@ -156,21 +165,27 @@ function recipe(s: ProductSpec) {
{
title: "Set a beam bracket in the middle of each end rail",
detail: "Its pegs drop into the holes on the inside of the rail.",
- add: ["EH", "EF", "U0", "U1"],
+ add: ["EH", "U0"],
+ wait: ["EF", "U1"],
+ from: { EH: [0, 0, -400], U0: [0, 0, -400], EF: FOOT_OFF, U1: FOOT_OFF },
},
{
title: "Fix the brackets with inserts and pins",
detail: "Two in each bracket: insert, pin, then a quarter turn with the screwdriver.",
fix: [
- named("cap", "Insert", [-1, 1].flatMap((ex) => [zi0 + 20, zi1 - 20].map((z) => [ex * 25, 260, z] as Vec3)), [0, 1, 0]),
- named("pin", "Locking pin", [-1, 1].flatMap((ex) => [zi0 + 20, zi1 - 20].map((z) => [ex * 25, 262, z] as Vec3)), [0, 1, 0]),
+ ...[zi0 + 20, zi1 - 20].flatMap((z, i) => [
+ named("cap", "Insert", [-1, 1].map((ex) => [ex * 25, 260, z] as Vec3), [0, 1, 0], { on: `U${i}` }),
+ named("pin", "Locking pin", [-1, 1].map((ex) => [ex * 25, 262, z] as Vec3), [0, 1, 0], { on: `U${i}` }),
+ ]),
],
tools: ["screwdriver"],
},
{
title: "Press a glide onto the end of each leg",
detail: "Push it on firmly, all four legs.",
- add: corners.map((c) => `L${c[2]}`),
+ add: head.map((c) => `L${c[2]}`),
+ wait: foot.map((c) => `L${c[2]}`),
+ from: Object.fromEntries(foot.map((c) => [`L${c[2]}`, FOOT_OFF])),
fix: corners.map((c) => named("glide", "Glide", [[c[0] * legX, 0, legZ(c[1])]], [0, 1, 0], { on: `L${c[2]}` })),
warnings: ["hand"],
},
@@ -183,22 +198,25 @@ function recipe(s: ProductSpec) {
{
title: "Push a side rail onto the head rail and bolt the corner",
detail: "One of you holds the rails while the other sets the corner post in and bolts it up through the plate, with the small washer.",
- add: ["PH0", "CH0"],
- fix: [named("washer", "Washer", [postBolt(head[0])], [0, 1, 0], { dia: 16, len: 2 }), named("bolt", "Bolt", [postBolt(head[0])], [0, 1, 0], { len: 20, dia: 8 })],
+ add: ["S0", "R0", "PH0", "CH0"],
+ from: { S0: SIDE_IN, R0: SIDE_IN },
+ fix: [named("bolt", "Bolt", [postBolt(head[0])], [0, 1, 0], { len: 20, dia: 8 }), named("washer", "Washer", [postBolt(head[0])], [0, 1, 0], { dia: 16, len: 2 })],
people: 2,
tools: ["allen"],
},
{
title: "Do the same with the other side rail",
- add: ["PH1", "CH1"],
- fix: [named("washer", "Washer", [postBolt(head[1])], [0, 1, 0], { dia: 16, len: 2 }), named("bolt", "Bolt", [postBolt(head[1])], [0, 1, 0], { len: 20, dia: 8 })],
+ add: ["S1", "R1", "PH1", "CH1"],
+ from: { S1: SIDE_IN, R1: SIDE_IN },
+ fix: [named("bolt", "Bolt", [postBolt(head[1])], [0, 1, 0], { len: 20, dia: 8 }), named("washer", "Washer", [postBolt(head[1])], [0, 1, 0], { dia: 16, len: 2 })],
people: 2,
tools: ["allen"],
},
{
title: "Fit the foot rail and screw in the last two legs",
detail: "Corner posts in, plates under, then each leg goes up through its plate with a big washer.",
- add: ["PF0", "PF1", "CF0", "CF1"],
+ add: ["EF", "U1", ...foot.map((c) => `L${c[2]}`), "PF0", "PF1", "CF0", "CF1"],
+ from: Object.fromEntries(["EF", "U1", ...foot.map((c) => `L${c[2]}`)].map((id) => [id, FOOT_IN])),
fix: [named("washer", "Big washer", foot.map(legTop), [0, 1, 0], { dia: 40, len: 6 })],
people: 2,
check: "square",
diff --git a/src/lib/plan/families/sagmastare.ts b/src/lib/plan/families/sagmastare.ts
index 179c18b..6dd94c5 100644
--- a/src/lib/plan/families/sagmastare.ts
+++ b/src/lib/plan/families/sagmastare.ts
@@ -55,6 +55,14 @@ const postStep = (level: string, yTop: number, word: string): CustomStep => ({
wait: ids(level),
fix: [at("stud", CORNERS.map((c) => cornerAt(c, yTop)), [0, 1, 0], undefined, undefined, { len: 30, dia: 8 })],
});
+/** The cabinet's posts take their studs in the bottom end and screw down into the cabinet top; the top shelf is screwed to their tops. */
+const postStepDown = (level: string, yBot: number, word: string): CustomStep => ({
+ title: `Screw a stud into the end of the ${word} posts`,
+ detail: "Into one end of each post, by hand until it stops. That end goes down.",
+ add: ids(level),
+ wait: ids(level),
+ fix: [at("stud", CORNERS.map((c) => cornerAt(c, yBot)), [0, 1, 0], undefined, undefined, { len: 30, dia: 8 })],
+});
const screwPosts = (level: string, title: string): CustomStep => ({
title,
detail: "Turn each post onto a stud through the shelf until it's tight against it.",
@@ -207,7 +215,7 @@ function cabinet(): CustomParams {
pose: "+y",
},
{ title: "Press the cabinet top on", detail: "Stand the cabinet up. The brackets go behind the back panels and the corner holes over the posts.", add: ["C", "RT"] },
- postStep("P", H - PT, "four"),
+ postStepDown("P", yC, "four"),
screwPosts("P", "Screw the posts on through the cabinet top"),
...topSteps("T"),
{ title: "Lay the shelf in", detail: "Press it down onto the four supports inside the sides until it clicks.", add: ["M"], from: { M: [0, 0, 300] } },
@@ -222,7 +230,8 @@ function cabinet(): CustomParams {
{
title: "Screw a pivot into each outer leaf",
detail: "One screw with a washer into the bottom corner of each outer leaf, on the hinged side.",
- fix: [at("washer", [[xLeaf(0) - leafW / 2 + 20, yB + 7, zDoor]], [0, 1, 0], "D0", undefined, { len: 2, dia: 14 }), at("washer", [[xLeaf(3) + leafW / 2 - 20, yB + 7, zDoor]], [0, 1, 0], "D3", undefined, { len: 2, dia: 14 }), at("screw", [[xLeaf(0) - leafW / 2 + 20, yB + 6, zDoor], [xLeaf(3) + leafW / 2 - 20, yB + 6, zDoor]], [0, 1, 0], undefined, undefined, { len: 16, dia: 4 })],
+ // the screw first: the engine stacks a washer onto the screw already at its point
+ fix: [at("screw", [[xLeaf(0) - leafW / 2 + 20, yB + 6, zDoor]], [0, 1, 0], "D0", undefined, { len: 16, dia: 4 }), at("screw", [[xLeaf(3) + leafW / 2 - 20, yB + 6, zDoor]], [0, 1, 0], "D3", undefined, { len: 16, dia: 4 }), at("washer", [[xLeaf(0) - leafW / 2 + 20, yB + 7, zDoor]], [0, 1, 0], "D0", undefined, { len: 2, dia: 14 }), at("washer", [[xLeaf(3) + leafW / 2 - 20, yB + 7, zDoor]], [0, 1, 0], "D3", undefined, { len: 2, dia: 14 })],
tools: ["screwdriver"],
},
{
@@ -240,7 +249,7 @@ function cabinet(): CustomParams {
{
title: "Screw on the knobs",
detail: "One knob on each inner leaf, near the top, screwed on from behind.",
- fix: [at("knob", [[xLeaf(1) + leafW / 2 - 25, yIn - 50, zDoor + 9]], [0, 0, -1], "D1"), at("knob", [[xLeaf(2) - leafW / 2 + 25, yIn - 50, zDoor + 9]], [0, 0, -1], "D2"), at("screw", [[xLeaf(1) + leafW / 2 - 25, yIn - 50, zDoor - 9], [xLeaf(2) - leafW / 2 + 25, yIn - 50, zDoor - 9]], [0, 0, 1], undefined, undefined, { len: 12, dia: 4 })],
+ fix: [at("knob", [[xLeaf(1) + leafW / 2 - 25, yIn - 50, zDoor + 9]], [0, 0, -1], "D1"), at("knob", [[xLeaf(2) - leafW / 2 + 25, yIn - 50, zDoor + 9]], [0, 0, -1], "D2"), at("screw", [[xLeaf(1) + leafW / 2 - 25, yIn - 50, zDoor - 14]], [0, 0, 1], "D1", undefined, { len: 12, dia: 4 }), at("screw", [[xLeaf(2) - leafW / 2 + 25, yIn - 50, zDoor - 14]], [0, 0, 1], "D2", undefined, { len: 12, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Check the door folds", detail: "Open it: the two leaves fold together and turn out of the way. Close it again before the next one." },
diff --git a/src/lib/plan/families/salno.ts b/src/lib/plan/families/salno.ts
index 55a0bd2..7cae789 100644
--- a/src/lib/plan/families/salno.ts
+++ b/src/lib/plan/families/salno.ts
@@ -111,7 +111,8 @@ function chair(b: PlanBuilder, s: ProductSpec, g: Dims, cushions: boolean): bool
const back = backrest(b, g, inner - 10, g.SH - 60, zB0);
const sideScrews = (f: (typeof frames)[number]): FitOpts[] => [zs0 + 90, zs1 - 90].map((z) => ({ on: f.key, at: [f.sx * (g.W / 2), g.SH - 25, z] as Vec3, dir: [-f.sx, 0, 0] as Vec3, mate: sk }));
const cups = (list: FitOpts[]) => list.map((o) => ({ ...o, mate: undefined, hole: false as const }));
- const shortPts: FitOpts[] = frames.map((f) => ({ on: f.key, at: [f.x, g.SH - 60, f.backZ(g.SH - 60) - R / 2] as Vec3, dir: [0, 0, 1] as Vec3, mate: back }));
+ // sideways through the back leg; its tip stands out inside, where the backrest's side slots drop over it later
+ const shortPts: FitOpts[] = frames.map((f) => ({ on: f.key, at: [f.sx * (g.W / 2), g.SH - 40, (f.backZ(g.SH - 40) + backZ(g, g.SH - 60, zB0, g.SH - 40)) / 2] as Vec3, dir: [-f.sx, 0, 0] as Vec3, mate: back }));
const lowPts: FitOpts[] = frames.map((f) => ({ on: f.key, at: [f.sx * (g.W / 2), 130, zc] as Vec3, dir: [-f.sx, 0, 0] as Vec3, mate: sk }));
const yArm = g.armH - 40;
const armPts: FitOpts[] = frames.map((f) => ({ on: f.key, at: [f.sx * (g.W / 2), yArm, backZ(g, g.SH - 60, zB0, yArm) + 10] as Vec3, dir: [-f.sx, 0, 0] as Vec3, mate: back }));
@@ -130,7 +131,7 @@ function chair(b: PlanBuilder, s: ProductSpec, g: Dims, cushions: boolean): bool
);
st({ title: "Screw the frame to the seat", detail: "Two long screws, each through a cup washer. The cup's round side goes into the hole.", tools: ["allen"], kind: "screws" }, () => both(sideScrews(Rt)));
st({ title: "Set it down onto the other side frame", detail: "Lay that frame on the rug and lower the seat onto its pegs.", kind: "join" }, () => b.add(L.key, [-300, 0, 0]));
- st({ title: "Screw the back legs to the seat", detail: "One short screw through each back leg, no cup washer.", tools: ["allen"], kind: "screws" }, () => b.fits(SHORT, shortPts, 0.2));
+ st({ title: "Turn a short screw into each back leg", detail: "From the outside, no cup washer. Its point stands out on the inside, ready for the backrest.", tools: ["allen"], kind: "screws" }, () => b.fits(SHORT, shortPts, 0.2));
st({ title: "Turn it over and screw the second frame", detail: "Two more long screws with cup washers.", tools: ["allen"], kind: "screws", pose: "-x" }, () => both(sideScrews(L)));
st({ title: "Stand it up and screw the low stretcher", detail: "One long screw with a cup washer through each side into the ends of the stretcher.", tools: ["allen"], kind: "screws", pose: "+y" }, () => both(lowPts));
st({ title: "Loosen the two short screws a little", detail: "Back each one out about 2 cm, so the backrest can slide down behind them.", tools: ["allen"], kind: "general" });
@@ -186,11 +187,11 @@ function bench(b: PlanBuilder, s: ProductSpec): boolean {
{ material: "wood" },
);
const sk = b.place(seat.type, seat.mid);
- // the middle leg: two legs under the middle of the seat, joined by a bar under it
+ // the middle leg: two legs under the middle of the seat, joined by a bar under it and a low bar that rests on the stretcher
const mz = [g.zf - 20, g.zb + 30];
const midC = b.compound(
"Middle leg",
- [tube([0, 0, mz[0]], [0, g.SH - 45, mz[0]]), tube([0, 0, mz[1]], [0, g.SH - 45, mz[1]]), tube([0, g.SH - 45, mz[0] + 15], [0, g.SH - 45, mz[1] - 15])],
+ [tube([0, 0, mz[0]], [0, g.SH - 45, mz[0]]), tube([0, 0, mz[1]], [0, g.SH - 45, mz[1]]), tube([0, g.SH - 45, mz[0] + 15], [0, g.SH - 45, mz[1] - 15]), tube([0, 130 + R, mz[0] + 15], [0, 130 + R, mz[1] - 15])],
{ material: "wood" },
);
const mid = b.place(midC.type, midC.mid);
diff --git a/src/lib/plan/families/sandsberg.ts b/src/lib/plan/families/sandsberg.ts
index 0ed635b..21d9e4f 100644
--- a/src/lib/plan/families/sandsberg.ts
+++ b/src/lib/plan/families/sandsberg.ts
@@ -117,14 +117,15 @@ function chair(s: ProductSpec): CustomParams {
// cross tubes between the sides, at the front and the back of the seat
const zc = [zF1 - 30, zK + 30];
const cross = ["CROSS_F", "CROSS_B"];
- cross.forEach((id, i) => parts.push({ id, name: "Cross tube", size: [2 * (xs - TUBE / 2), TUBE, TUBE], pos: [0, yR - TUBE, zc[i]], shape: "cyl", material: "metal" }));
+ cross.forEach((id, i) => parts.push({ id, name: "Cross tube", size: [2 * xs + TUBE, TUBE, TUBE], pos: [0, yR - TUBE, zc[i]], shape: "cyl", material: "metal" }));
// the backrest sits on the tops of the uprights, the seat on the rails
parts.push({ id: "BACK", name: "Backrest", size: [W - 10, 150, 22], pos: [0, H - 75, zT - 4], rot: [-0.12, 0, 0], material: "board" });
const seatZ0 = zK + 15, seatZ1 = D / 2 - 40;
parts.push({ id: "SEAT", name: "Seat", size: [W - 10, 30, seatZ1 - seatZ0], pos: [0, yR + TUBE / 2 + 15, (seatZ0 + seatZ1) / 2], material: "board" });
- const bolts = (sx: number, i: number) => zc.map((z, k) => fx("bolt", [[sx * (xs - TUBE / 2 - 4), yR - TUBE, z]], [sx, 0, 0], cross[k], { name: "Hex bolt", len: 35, dia: 6, mate: sides[i] }));
- const nuts = [-1, 1].map((sx, i) => fx("nut", zc.map((z): Vec3 => [sx * (xs + TUBE / 2), yR - TUBE, z]), [-sx, 0, 0], sides[i], { dia: 10 }));
+ // the tube ends lie under the seat rails: each bolt goes down through the rail's bracket and the tube, the nut under it
+ const bolts = (sx: number, i: number) => zc.map((z) => fx("bolt", [[sx * xs, yR + TUBE / 2, z]], [0, -1, 0], sides[i], { name: "Hex bolt", len: 35, dia: 6 }));
+ const nuts = [-1, 1].map((sx, i) => fx("nut", zc.map((z): Vec3 => [sx * xs, yR - 1.5 * TUBE, z]), [0, 1, 0], sides[i], { dia: 10 }));
const steps: CustomStep[] = [
{
title: "Lay a side frame on the rug and stand a cross tube in it",
@@ -134,7 +135,7 @@ function chair(s: ProductSpec): CustomParams {
warnings: ["floor"],
},
{ title: "Stand the second cross tube in it", detail: "Into the bracket at the back of the seat rail.", add: ["CROSS_B"] },
- { title: "Bolt the tubes to the side", detail: "One bolt through each tube end into the side frame, by hand for now.", fix: bolts(-1, 0), tools: ["wrench"] },
+ { title: "Bolt the tubes to the side", detail: "One bolt down through the side frame into each tube end, by hand for now.", fix: bolts(-1, 0), tools: ["wrench"] },
{ title: "Turn the other side over and lower it on", detail: "Its brackets go over the free ends of the cross tubes.", add: ["SIDE_R"], from: { SIDE_R: [300, 0, 0] } },
{ title: "Bolt the tubes to it", detail: "Two more bolts, the same way.", fix: bolts(1, 1) },
{ title: "Screw a nut onto each bolt", detail: "All four, turned on by hand.", fix: nuts },
diff --git a/src/lib/plan/families/sektion.ts b/src/lib/plan/families/sektion.ts
index 880e110..0cc24a5 100644
--- a/src/lib/plan/families/sektion.ts
+++ b/src/lib/plan/families/sektion.ts
@@ -57,7 +57,7 @@ const named = (b: PlanBuilder, def: HwDef, name: string) => {
class Kit {
private types = new Map<string, string>();
constructor(public b: PlanBuilder) {}
- part(name: string, size: Vec3, pos: Vec3, o: { material?: PartMaterial; pieces?: PartPiece[]; extra?: boolean; shape?: "box" | "cyl" } = {}) {
+ part(name: string, size: Vec3, pos: Vec3, o: { material?: PartMaterial; pieces?: PartPiece[]; extra?: boolean; shape?: "box" | "cyl"; rot?: Vec3 } = {}) {
const k = `${name}|${size.map(Math.round).join("x")}|${o.pieces ? JSON.stringify(o.pieces) : ""}`;
let ref = this.types.get(k);
if (!ref) {
@@ -65,7 +65,7 @@ class Kit {
if (o.pieces) this.b.parts[this.b.parts.length - 1].pieces = o.pieces;
this.types.set(k, ref);
}
- return this.b.place(ref, pos);
+ return this.b.place(ref, pos, o.rot);
}
step(
o: { title: string; detail: string; kind: StepKind; tools?: ToolId[]; pose?: Pose; people?: 1 | 2; scene?: string; warnings?: WarnId[]; wall?: boolean; check?: "square"; repeat?: number },
@@ -116,13 +116,14 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
const sus = [-1, 1].map((sx) => ({ on: sx < 0 ? sideL : sideR, at: [(sx * Wi) / 2, ySus, zSus] as Vec3, dir: [sx, 0, 0] as Vec3 }));
const SUS = () => named(b, { kind: "bracket", len: 50, dia: 45 }, "Suspension fitting");
- k.step({ title: "Screw the cam bolts into both sides", detail: "Lay the sides flat with the holes up and turn the bolts in until they stop.", kind: "cams", tools: ["screwdriver"], scene: "sides", warnings: ["floor"] }, () => {
+ // laid flat inside up (pose "-x"): the side that joins last keeps its own turn, so its bolts point the way it travels
+ k.step({ title: "Screw the cam bolts into both sides", detail: "Lay the sides flat with the holes up and turn the bolts in until they stop.", kind: "cams", tools: ["screwdriver"], scene: "sides", pose: "-x", warnings: ["floor"] }, () => {
b.stagger(0.15);
- [sideL, sideR].forEach((key, i) => b.stage(key, [0, T / 2, (i - 0.5) * (D + 120)], [0, 0, Math.PI / 2]));
+ [sideL, sideR].forEach((key, i) => b.stage(key, [0, H / 2, (i - 0.5) * (D + 120)], key === sideL ? [0, Math.PI, 0] : [0, 0, 0]));
b.then(0.15);
k.fits(HW.camScrew, [...bolts(-1), ...bolts(1)]);
});
- k.step({ title: "Screw the suspension fittings into the sides", detail: "One in the top back corner of each side, three screws in each.", kind: "screws", tools: ["screwdriver"], scene: "sides" }, () => {
+ k.step({ title: "Screw the suspension fittings into the sides", detail: "One in the top back corner of each side, three screws in each.", kind: "screws", tools: ["screwdriver"], scene: "sides", pose: "-x" }, () => {
k.fits(SUS(), sus);
k.fits({ kind: "screw", len: 12, dia: 4 }, sus.flatMap((p) => [-14, 0, 14].map((dz) => ({ ...p, at: [p.at[0], p.at[1] - (dz ? 22 : -22), p.at[2] + dz] as Vec3 }))));
});
@@ -133,7 +134,7 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
b.add(sideL, [0, 0, 0]);
b.then(0.15);
k.fits(HW.dowel, dowels(-1));
- for (const p of pieces) b.add(p, [0, 0, -360]);
+ for (const p of pieces) b.add(p, [360, 0, 0]);
},
);
k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", kind: "cams", tools: ["screwdriver"], pose }, () => k.fits(HW.cam, cams(-1)));
@@ -144,7 +145,7 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
});
k.step({ title: "Turn the other cam locks", detail: "The same way as on the first side.", kind: "cams", tools: ["screwdriver"], pose }, () => k.fits(HW.cam, cams(1)));
if (base)
- k.step({ title: "Screw in the top rails", detail: "One at the front and one at the back, with a screw through each side into each end. Click the clips onto the front rail first.", kind: "screws", tools: ["screwdriver"], pose }, () => {
+ k.step({ title: "Screw in the top rails", detail: "One at the front and one at the back, a screw down through each end into the top of the side. Click the clips onto the front rail first.", kind: "screws", tools: ["screwdriver"], pose }, () => {
b.stagger(0.25);
b.add(railF, [0, 0, -300]);
b.add(railB, [0, 0, -300]);
@@ -152,7 +153,7 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
k.fits(named(b, { kind: "clip", len: 14, dia: 22 }, "Rail clip"), (W > 700 ? [-0.3, 0, 0.3] : [-0.25, 0.25]).map((t) => ({ on: railF, at: [t * Wi, H - T, zb + D - RW / 2] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })));
k.fits(
{ kind: "screw", len: 40, dia: 5 },
- [railF, railB].flatMap((r) => [-1, 1].map((sx) => ({ on: sx < 0 ? sideL : sideR, at: [(sx * W) / 2, H - T / 2, r === railF ? zb + D - RW / 2 : zb + G + RW / 2] as Vec3, dir: [-sx, 0, 0] as Vec3, mate: r }))),
+ [railF, railB].flatMap((r) => [-1, 1].map((sx) => ({ on: sx < 0 ? sideL : sideR, at: [(sx * (Wi + T)) / 2, H, r === railF ? zb + D - RW / 2 : zb + G + RW / 2] as Vec3, dir: [0, -1, 0] as Vec3, mate: r }))),
);
});
// square it, a nail in three corners, then nails along the bottom and the top
@@ -261,7 +262,6 @@ interface Layout {
use?: "sink" | "apron" | "hob" | "fridge" | "appliance";
nails?: number; // along the back, after the corners and brackets
grille?: "shelf" | "bottom"; // a ventilation grille at the back of the fixed shelf, or under the front of a top cabinet
- upright?: boolean; // built standing on its bottom, the top lowered on last
}
const drawers = (...inch: number[]): Row[] => inch.map((i) => ({ kind: "drawer", inch: i }));
@@ -276,7 +276,7 @@ function layoutOf(s: ProductSpec): Layout | null {
const two = /2-doors|2-glass/.test(slug);
const sinkRails = /sink/.test(slug);
const base = (rows: Row[], use?: Layout["use"]): Layout => ({ kind: "base", W, H, D, rows, fixed: [], sink: sinkRails, use });
- if (/^sektion-top-cabinet/.test(slug)) return { kind: "wall", W, H, D, rows: [{ kind: "lift", inch: 15 }], fixed: [], sink: false, nails: 10, grille: "bottom", upright: true, use: "fridge" };
+ if (/^sektion-top-cabinet/.test(slug)) return { kind: "wall", W, H, D, rows: [{ kind: "lift", inch: 15 }], fixed: [], sink: false, nails: 10, grille: "bottom", use: "fridge" };
if (/^sektion-high-cabinet/.test(slug)) {
if (/fridge|freezer|built-in/.test(slug)) {
const door = (inch: number): Row => ({ kind: "doors", inch, n: 1 });
@@ -425,35 +425,17 @@ class Sek {
const base = L.kind === "base";
const early = !base || D < 500; // a 60 cm deep base cabinet gets its suspension fittings last, standing up
const nb = this.bolts(-1).length * 2;
- k.step({ title: "Screw the cam bolts into both sides", detail: `${nb} in all. Lay the sides flat with the holes up and turn the bolts in until they stop.`, kind: "cams", tools: ["screwdriver"], scene: "sides", warnings: ["floor"] }, () => {
+ // laid flat inside up (pose "+x"): the side that joins last keeps its own turn, so its bolts point the way it travels
+ k.step({ title: "Screw the cam bolts into both sides", detail: `${nb} in all. Lay the sides flat with the holes up and turn the bolts in until they stop.`, kind: "cams", tools: ["screwdriver"], scene: "sides", pose: "+x", warnings: ["floor"] }, () => {
b.stagger(0.15);
- [this.sideL, this.sideR].forEach((key, i) => b.stage(key, [0, T / 2, (i - 0.5) * (D + 120)], [0, 0, Math.PI / 2]));
+ [this.sideL, this.sideR].forEach((key, i) => b.stage(key, [0, H / 2, (i - 0.5) * (D + 120)], key === this.sideR ? [0, Math.PI, 0] : [0, 0, 0]));
b.then(0.15);
k.fits(HW.camScrew, [...this.bolts(-1), ...this.bolts(1)]);
});
if (early)
- k.step({ title: "Screw a suspension fitting into each side", detail: "In the top back corner, three screws each. The hook faces the back.", kind: "screws", tools: ["screwdriver"], scene: "sides" }, () => this.fitSuspension());
+ k.step({ title: "Screw a suspension fitting into each side", detail: "In the top back corner, three screws each. The hook faces the back.", kind: "screws", tools: ["screwdriver"], scene: "sides", pose: "+x" }, () => this.fitSuspension());
const first: Pose = base ? "-z" : "-x";
- if (L.upright && this.top) {
- // a top cabinet stands on its bottom: both sides onto it, the back down its grooves, the top lowered on last
- const top = this.top;
- k.step({ title: "Tap dowels into the bottom and stand both sides on it", detail: "Bottom flat on a rug. Dowels into both ends, then push the sides down onto them.", kind: "dowels", tools: ["hammer"], warnings: ["floor"] }, () => {
- b.add(this.bottom, [0, 0, 0]);
- b.then(0.15);
- k.fits(HW.dowel, [...this.dowels(1, this.bottom), ...this.dowels(-1, this.bottom)]);
- b.stagger(0.25);
- b.add(this.sideL, [0, 300, 0]);
- b.add(this.sideR, [0, 300, 0]);
- });
- k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", kind: "cams", tools: ["screwdriver"] }, () => k.fits(HW.cam, [...this.cams(1, this.bottom), ...this.cams(-1, this.bottom)]));
- k.step({ title: "Slide the back panel down the grooves", detail: "Smooth side to the inside, from the open top.", kind: "join" }, () => b.add(this.back, [0, Math.min(900, H + 300), 0]));
- k.step({ title: "Tap dowels into the top and lower it on", detail: "Line every dowel and bolt up with its hole and press the top down evenly.", kind: "dowels", tools: ["hammer"] }, () => {
- k.fits(HW.dowel, [...this.dowels(1, top), ...this.dowels(-1, top)]);
- b.add(top, [0, 300, 0]);
- });
- k.step({ title: "Turn the other cam locks", detail: "The same way as on the bottom.", kind: "cams", tools: ["screwdriver"] }, () => k.fits(HW.cam, [...this.cams(1, top), ...this.cams(-1, top)]));
- } else {
k.step(
{
title: base ? "Tap dowels into the bottom and join it to one side" : "Tap dowels into the top and bottom and stand them on one side",
@@ -468,7 +450,7 @@ class Sek {
b.then(0.15);
k.fits(HW.dowel, this.dowels(1));
b.stagger(0.25);
- for (const p of this.panels()) b.add(p, base ? [0, 0, -360] : [-360, 0, 0]);
+ for (const p of this.panels()) b.add(p, [-360, 0, 0]);
},
);
k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", kind: "cams", tools: ["screwdriver"], pose: first }, () => k.fits(HW.cam, this.cams(1)));
@@ -481,17 +463,15 @@ class Sek {
},
);
k.step({ title: "Turn the other cam locks", detail: "The same way as on the first side.", kind: "cams", tools: ["screwdriver"], pose: first }, () => k.fits(HW.cam, this.cams(-1)));
- }
const pose: Pose = "-z";
const [railF, railB] = this.rails;
const railScrews = (r: string): FitOpts[] => {
const z = this.b.partItem(r).final.pos[2];
- const y = this.b.partItem(r).final.pos[1];
- return [-1, 1].map((sx) => ({ on: r, at: [(sx * this.Wi) / 2 - sx * 10, y + 5, z] as Vec3, dir: [0, -1, 0] as Vec3, mate: this.side(sx) }));
+ return [-1, 1].map((sx) => ({ on: this.side(sx), at: [(sx * (this.Wi + T)) / 2, H, z] as Vec3, dir: [0, -1, 0] as Vec3, mate: r }));
};
if (base && !L.sink)
- k.step({ title: "Click the clips onto the front rail and screw it on", detail: "Across the top at the front. One screw through each end of the rail into the side.", kind: "screws", tools: ["screwdriver"], pose }, () => {
+ k.step({ title: "Click the clips onto the front rail and screw it on", detail: "Across the top at the front. One screw down through each end into the top of the side.", kind: "screws", tools: ["screwdriver"], pose }, () => {
b.add(railF, [0, 300, 0]);
b.then(0.15);
k.fits(RAIL_CLIP, (W > 700 ? [-0.3, 0, 0.3] : W > 450 ? [-0.25, 0.25] : [0]).map((t) => ({ on: railF, at: [t * this.Wi, H, D / 2 - 40] as Vec3, dir: [0, 1, 0] as Vec3, hole: false as const })));
@@ -696,8 +676,8 @@ class Sek {
const box = (size: DSize, inner: boolean, lo: number, hi: number, yb: number, front: string): Drawer => {
const sh = size === "low" ? 70 : 120;
const sides = [-1, 1].map((sx) => k.part("Drawer side", [16, sh, dd], [sx * (bw / 2 - 8), yb + sh / 2, zc], { material: "metal" })) as [string, string];
- const back = k.part("Drawer back", [bw - 32, sh - 20, 16], [0, yb + 16 + (sh - 20) / 2, zc - dd / 2 + 10]);
- const bottom = k.part("Drawer bottom", [bw - 32, 16, dd - 20], [0, yb + 8, zc + 8]);
+ const back = k.part("Drawer back", [bw - 32, sh - 20, 16], [0, yb + 10 + (sh - 20) / 2, zc - dd / 2 + 10]);
+ const bottom = k.part("Drawer bottom", [bw - 32, 10, dd - 4], [0, yb + 5, zc]);
const rails =
size === "low"
? []
@@ -885,9 +865,877 @@ class Sek {
}
}
+
+/* ---------- the corner wall cabinet ---------- */
+
+const FRAME_SCREW: HwDef = { kind: "screw", len: 50, dia: 7, name: "Frame screw" };
+const LOCK_CLIP: HwDef = { kind: "clip", len: 20, dia: 25, name: "Locking clip" };
+const BUMPER: HwDef = { kind: "glide", len: 3, dia: 10, name: "Bumper" };
+const JOIN_SCREW: HwDef = { kind: "screw", len: 30, dia: 4 };
+const Q = Math.PI / 4;
+const S2 = Math.SQRT2;
+const r1 = (n: number) => Math.round(n * 10) / 10;
+
+const dims = (s: ProductSpec) => {
+ const m = /([\d.]+) × ([\d.]+) × ([\d.]+) cm/.exec(s.variant);
+ return m ? m.slice(1, 4).map((v) => Math.round(parseFloat(v) * 10)) : null;
+};
+
+/**
+ * SEKTION corner wall cabinet: its back corner goes into the corner of the room, an arm 38 cm deep along each wall ending
+ * in a side panel, and one door across the diagonal front. The top and bottom are screwed to a narrow post that closes the
+ * back corner, the sides go on with dowels and cams, the two backs slide into their grooves and are nailed, and it hangs
+ * on a suspension rail on each wall. The corner is at the back left.
+ */
+function cornerWall(b: PlanBuilder, s: ProductSpec): boolean {
+ const d = dims(s);
+ if (!d) return false;
+ const slug = s.slug ?? "";
+ const k = new Kit(b);
+ const [W, A, H] = d;
+ const D = W;
+ const x0 = -W / 2, z0 = -D / 2;
+ const P1: Vec3 = [W / 2 - T, 0, z0 + A]; // front end of the right side's inner face
+ const P2: Vec3 = [x0 + A, 0, D / 2 - T]; // front end of the front side's inner face
+ const L = P1[0] - P2[0];
+ const n: Vec3 = [1 / S2, 0, 1 / S2]; // out through the front
+ const u: Vec3 = [1 / S2, 0, -1 / S2]; // along the front, towards the right side
+ const M: Vec3 = [(P1[0] + P2[0]) / 2, 0, (P1[2] + P2[2]) / 2];
+
+ /** The top, the bottom or a shelf: an arm along each wall and the triangle up to the diagonal front. */
+ const slab = (i: number, th: number): PartPiece[] => {
+ const xa = x0 + i, xb = W / 2 - T - i, za = z0 + i, zb = D / 2 - T - i;
+ const c: Vec3 = [(xa + xb) / 2, 0, (za + zb) / 2];
+ const pts: [number, number][] = [[xa, za], [xb, za], [xb, z0 + A - i], [x0 + A - i, zb], [xa, zb]];
+ return [{ shape: "slab", size: [xb - xa, th, zb - za], pos: c, outline: pts.map(([x, z]) => [r1(x - c[0]), r1(z - c[2])] as [number, number]) }];
+ };
+ const slabs = new Map<string, { type: string; mid: Vec3 }>();
+ const slabPart = (name: string, i: number, th: number, y: number, material?: PartMaterial) => {
+ const key = `${name}|${i}|${th}`;
+ let c = slabs.get(key);
+ if (!c) {
+ c = b.compound(name, slab(i, th), { material });
+ slabs.set(key, c);
+ }
+ return b.place(c.type, [c.mid[0], y, c.mid[2]]);
+ };
+
+ const sideR = k.part("Side panel", [T, H, A], [W / 2 - T / 2, H / 2, z0 + A / 2]);
+ const sideF = k.part("Side panel", [T, H, A], [x0 + A / 2, H / 2, D / 2 - T / 2], { rot: [0, Math.PI / 2, 0] });
+ const bottom = slabPart("Top and bottom panel", 0, T, T / 2);
+ const top = slabPart("Top and bottom panel", 0, T, H - T / 2);
+ const pc: Vec3 = [x0 + 52, H / 2, z0 + 52];
+ const post = k.part("Corner post", [130, H - 2 * T, T], pc, { rot: [0, Q, 0] });
+ const backB = k.part("Back panel", [W, H, 3], [0, H / 2, z0 - 1.5], { material: "fiber" });
+ const backL = k.part("Back panel", [W, H, 3], [x0 - 1.5, H / 2, 0], { material: "fiber", rot: [0, Math.PI / 2, 0] });
+
+ // where the sides meet the top and bottom: two bolts and two dowels at each end of each side
+ const joints = (side: string, yTop: boolean) => {
+ const y = yTop ? H - T / 2 : T / 2;
+ const right = side === sideR;
+ const at = (f: number): Vec3 => (right ? [W / 2 - T, y, r1(z0 + A * f)] : [r1(x0 + A * f), y, D / 2 - T]);
+ const out: Vec3 = right ? [1, 0, 0] : [0, 0, 1];
+ const panel = yTop ? top : bottom;
+ const cam = (p: Vec3): Vec3 => [p[0] - out[0] * 34, yTop ? H - T : T, p[2] - out[2] * 34];
+ return {
+ bolts: [0.3, 0.75].map((f): FitOpts => ({ on: side, at: at(f), dir: out, mate: panel })),
+ cams: [0.3, 0.75].map((f): FitOpts => ({ on: panel, at: cam(at(f)), dir: [0, yTop ? 1 : -1, 0] })),
+ dowels: [0.15, 0.9].map((f): FitOpts => ({ on: panel, at: at(f), dir: [-out[0], 0, -out[2]], mate: side })),
+ };
+ };
+ const sus = [
+ { side: sideR, at: [W / 2 - T, H - T - 45, z0 + 28] as Vec3, out: [1, 0, 0] as Vec3, along: [0, 0, 1] as Vec3 },
+ { side: sideF, at: [x0 + 28, H - T - 45, D / 2 - T] as Vec3, out: [0, 0, 1] as Vec3, along: [1, 0, 0] as Vec3 },
+ ];
+
+ k.step({ title: "Screw the top and bottom to the corner post", detail: "Stand them on their back edges with the post between them, two frame screws through each into its ends. Use the Allen key.", kind: "screws", tools: ["allen"], pose: "+z", warnings: ["floor"] }, () => {
+ b.add(post, [0, 0, 0]);
+ b.then(0.1);
+ b.stagger(0.3);
+ b.add(bottom, [0, -200, 0]);
+ b.add(top, [0, 200, 0]);
+ b.then(0.1);
+ const ends = [-30, 30].map((dd): Vec3 => [r1(pc[0] + dd * u[0]), 0, r1(pc[2] + dd * u[2])]);
+ k.fits(FRAME_SCREW, [...ends.map((p): FitOpts => ({ on: top, at: [p[0], H, p[2]], dir: [0, -1, 0], mate: post })), ...ends.map((p): FitOpts => ({ on: bottom, at: [p[0], 0, p[2]], dir: [0, 1, 0], mate: post }))]);
+ });
+ k.step({ title: "Screw the cam bolts into both sides", detail: "Eight in all, four near the ends of each side's inner face. Turn them in until they stop.", kind: "cams", tools: ["screwdriver"], scene: "prep", warnings: ["floor"] }, () => {
+ b.stagger(0.25);
+ b.stage(sideR, [0, T / 2, -(A / 2 + 40)], [0, 0, -Math.PI / 2], [0, 160, 0]);
+ b.stage(sideF, [0, T / 2, A / 2 + 40], [0, 0, Math.PI / 2], [0, 160, 0]);
+ b.then(0.15);
+ k.fits(HW.camScrew, [sideR, sideF].flatMap((sd) => [false, true].flatMap((e) => joints(sd, e).bolts)));
+ });
+ k.step({ title: "Screw a suspension fitting onto each side", detail: "In the top back corner of each side, two screws each. The hook faces the back.", kind: "screws", tools: ["screwdriver"], scene: "prep" }, () => {
+ k.fits(SUS, sus.map((f) => ({ on: f.side, at: f.at, dir: f.out, hole: false as const })));
+ k.fits(EURO, sus.flatMap((f) => [-22, 22].map((dy) => ({ on: f.side, at: [f.at[0] - f.along[0] * 14, f.at[1] + dy, f.at[2] - f.along[2] * 14] as Vec3, dir: f.out }))));
+ });
+ for (const [i, side] of [sideR, sideF].entries()) {
+ const j = [joints(side, false), joints(side, true)];
+ const away: Vec3 = side === sideR ? [300, 0, 0] : [0, 0, 300];
+ k.step({ title: i === 0 ? "Tap in the dowels and press one side on" : "Tap in the dowels and press the other side on", detail: "Two dowels into the top and two into the bottom at that end, then push the side onto them, bolts into the holes.", kind: "dowels", tools: ["hammer"], pose: "+z" }, () => {
+ k.fits(HW.dowel, j.flatMap((x) => x.dowels));
+ b.add(side, away);
+ });
+ k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn each one clockwise until it pulls the side tight.", kind: "cams", tools: ["screwdriver"], pose: "+z" }, () => k.fits(HW.cam, j.flatMap((x) => x.cams)));
+ }
+ k.step({ title: "Turn it over and slide the backs in", detail: "Back up now. Each back runs in the grooves of the top and bottom, from its side panel to the post.", kind: "flip", pose: "-z", warnings: ["floor"] }, () => {
+ b.stagger(0.35);
+ b.add(backB, [0, 0, -260]);
+ b.add(backL, [-260, 0, 0]);
+ });
+ const nailB = (x: number, y: number, on: string): FitOpts => ({ on: backB, at: [r1(x), r1(y), z0 - 3], dir: [0, 0, 1], mate: on, hole: false });
+ const nailL = (z: number, y: number, on: string): FitOpts => ({ on: backL, at: [x0 - 3, r1(y), r1(z)], dir: [1, 0, 0], mate: on, hole: false });
+ k.step({ title: "Square it up and nail one corner", detail: "Both diagonals the same length. One nail through the back into the bottom corner by the side.", kind: "nails", tools: ["hammer", "tape"], pose: "-z", check: "square", warnings: ["square"] }, () => k.fits(HW.nail, [nailB(W / 2 - T / 2, T / 2, sideR)]));
+ k.step({ title: "Nail the other back at its bottom corner", detail: "Keep it square while you do.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => k.fits(HW.nail, [nailL(D / 2 - T / 2, T / 2, sideF)]));
+ k.step({ title: "Nail a top corner", detail: "Check it is still square first.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => k.fits(HW.nail, [nailB(W / 2 - T / 2, H - T / 2, sideR)]));
+ k.step({ title: "Nail on the four plastic brackets", detail: "One in each top and bottom corner by the post, one nail each. They hold the backs tight against the post.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ const pts: FitOpts[] = [nailB(x0 + 130, 40, sideR), nailB(x0 + 130, H - 40, sideR), nailL(z0 + 130, 40, sideF), nailL(z0 + 130, H - 40, sideF)].map((p) => ({ ...p, mate: undefined }));
+ k.fits(BACK_CLIP, pts);
+ k.fits(HW.nail, pts.map((p, i) => ({ ...p, mate: i % 2 ? top : bottom, at: [p.at[0], i % 2 ? H - T / 2 : T / 2, p.at[2]] as Vec3 })));
+ });
+ k.step({ title: "Nail the backs to the post", detail: "Two nails through each back into the edge of the post, one high and one low.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ k.fits(HW.nail, [H * 0.3, H * 0.7].flatMap((y) => [nailB(x0 + 92, y, post), nailL(z0 + 92, y, post)]));
+ });
+
+ // a suspension rail on each wall, the fittings hook over them
+ const yr = H - T - 45;
+ const railB = k.part("Suspension rail (not included)", [W, 40, 8], [0, yr, z0 - 3 - 4], { material: "metal", extra: true });
+ const railL = k.part("Suspension rail (not included)", [W, 40, 8], [x0 - 3 - 4, yr, 0], { material: "metal", extra: true, rot: [0, Math.PI / 2, 0] });
+ k.step(
+ { title: "Screw a suspension rail to each wall and hang the cabinet on them", detail: "Level the rails at the same height into the corner, then lift the cabinet so both fittings hook over. Rails, wall screws and plugs aren't included.", kind: "anchor", tools: ["drill", "level", "pencil", "screwdriver"], pose: "+y", wall: true, people: H > 900 ? 2 : 1, warnings: H > 900 ? ["two", "wall"] : ["wall"] },
+ () => {
+ b.stagger(0.3);
+ b.add(railB, [0, 0, -120]);
+ b.add(railL, [-120, 0, 0]);
+ b.then(0.1);
+ const ends = [W / 2 - 60, 0];
+ k.fits(HW.plug, [...ends.map((x) => ({ at: [x, yr, z0 - 11] as Vec3, dir: [0, 0, -1] as Vec3, hole: false as const })), ...ends.map((z) => ({ at: [x0 - 11, yr, -z] as Vec3, dir: [-1, 0, 0] as Vec3, hole: false as const }))]);
+ k.fits(HW.wallScrew, [...ends.map((x) => ({ on: railB, at: [x, yr, z0 - 3] as Vec3, dir: [0, 0, -1] as Vec3, hole: false as const })), ...ends.map((z) => ({ on: railL, at: [x0 - 3, yr, -z] as Vec3, dir: [-1, 0, 0] as Vec3, hole: false as const }))]);
+ },
+ );
+ k.step({ title: "Adjust the fittings and lock them", detail: "Turn the screws in both fittings to set the height and pull it tight to the walls, then push a locking clip into each.", kind: "screws", tools: ["screwdriver", "level"] }, () => {
+ k.fits(LOCK_CLIP, sus.map((f) => ({ on: f.side, at: [f.at[0] - f.out[0] * 10, f.at[1] - 20, f.at[2] - f.out[2] * 10] as Vec3, dir: f.out, hole: false as const })));
+ });
+
+ // inside: UTRUSTA corner shelves on six pins each, or the carousel
+ if (s.cabinet?.corner?.inner === "carousel") cornerCarousel(b, k, { cx: x0 + 270, cz: z0 + 270, H, top, bottom });
+ else if (s.cabinet?.shelves) {
+ const n2 = s.cabinet.shelves;
+ const glass = /glass/.test(slug);
+ const ys = Array.from({ length: n2 }, (_, i) => Math.round((T + ((H - 2 * T) * (i + 1)) / (n2 + 1)) / 32) * 32);
+ const th = glass ? 6 : T;
+ const keys = ys.map((y) => slabPart(glass ? "Glass shelf" : "Shelf", 12, th, y + th / 2, glass ? "glass" : undefined));
+ k.step({ title: many(ys.length, "Push in the shelf pins and lay the shelf on", "Push in the shelf pins and lay the shelves on"), detail: "Six pins for each shelf, all at one height: two in each side and two in the post.", kind: "shelves" }, () => {
+ const pins: FitOpts[] = [];
+ for (const y of ys)
+ pins.push(
+ { on: sideR, at: [W / 2 - T, y, z0 + 70], dir: [1, 0, 0], hole: false },
+ { on: sideR, at: [W / 2 - T, y, z0 + A - 50], dir: [1, 0, 0], hole: false },
+ { on: sideF, at: [x0 + 70, y, D / 2 - T], dir: [0, 0, 1], hole: false },
+ { on: sideF, at: [x0 + A - 50, y, D / 2 - T], dir: [0, 0, 1], hole: false },
+ ...[-40, 40].map((dd): FitOpts => ({ on: post, at: [r1(pc[0] + dd * u[0] + 9 * n[0]), y, r1(pc[2] + dd * u[2] + 9 * n[2])], dir: [-n[0], 0, -n[2]], hole: false })),
+ );
+ k.fits(HW.pin, pins);
+ b.stagger(0.3);
+ for (const key of keys) b.add(key, [260, 0, 260]);
+ });
+ }
+
+ // the door across the diagonal, hung on the right-hand side; the frame alone has none
+ if (!/cabinet-66-x-37-5/.test(slug) && s.cabinet?.doors !== 0) {
+ const dw = Math.floor((L * S2 - 10) / 10) * 10;
+ const dh = H - DGAP;
+ const fz = T / 2 + 2;
+ const dc: Vec3 = [r1(M[0] + n[0] * fz), r1(dh / 2 + 1.5), r1(M[2] + n[2] * fz)];
+ const glass = /glass/.test(slug);
+ const fw = 60;
+ const pieces: PartPiece[] | undefined = glass
+ ? [
+ { shape: "box", size: [fw, dh, DT], pos: [-dw / 2 + fw / 2, 0, 0] },
+ { shape: "box", size: [fw, dh, DT], pos: [dw / 2 - fw / 2, 0, 0] },
+ { shape: "box", size: [dw - 2 * fw, fw, DT], pos: [0, dh / 2 - fw / 2, 0] },
+ { shape: "box", size: [dw - 2 * fw, fw, DT], pos: [0, -dh / 2 + fw / 2, 0] },
+ { shape: "box", size: [dw - 2 * fw, dh - 2 * fw, 4], pos: [0, 0, 0], material: "glass" },
+ ]
+ : undefined;
+ const door = k.part(glass ? "Glass door" : "Door", [dw, dh, DT], dc, { rot: [0, Q, 0], pieces });
+ const hn = dh > 900 ? 3 : 2;
+ const hys = Array.from({ length: hn }, (_, i) => r1(100 + ((dh - 200) * i) / (hn - 1)));
+ const back = (kk: number, y: number): Vec3 => [r1(dc[0] + u[0] * kk - n[0] * DT / 2), y, r1(dc[2] + u[2] * kk - n[2] * DT / 2)];
+ k.step({ title: "Press the hinges into the door", detail: `Lay it face down on a rug. ${hn} hinges along the edge that goes on the right-hand side; each clicks into its round hole.`, kind: "hinges", scene: "doors", warnings: ["floor", "face"] }, () => {
+ b.stage(door, [0, DT / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ k.fits(HW.hinge, hys.map((y) => ({ on: door, at: back(dw / 2 - 22, y), dir: [-n[0], 0, -n[2]] as Vec3, twist: Math.PI })));
+ });
+ k.step({ title: "Screw the mounting plates to the right-hand side", detail: "One for each hinge, in the holes by the front edge. The door can hang on the other side instead: then the plates go there.", kind: "hinges", tools: ["screwdriver"] }, () => {
+ const plates = hys.map((y) => ({ on: sideR, at: [W / 2 - T, y, z0 + A - 37] as Vec3, dir: [1, 0, 0] as Vec3, hole: false as const }));
+ k.fits(PLATE, plates);
+ k.fits(EURO, plates.map((p) => ({ ...p, at: [p.at[0], p.at[1] + 16, p.at[2]] as Vec3, hole: undefined })).slice(0, 2));
+ });
+ k.step({ title: "Clip the door onto the plates", detail: "Hook each hinge over its plate and press until it clicks. Turn the hinge screws until the gaps are even.", kind: "doors", tools: ["screwdriver"] }, () => b.add(door, [n[0] * 380, 0, n[2] * 380]));
+ k.step({ title: "Stick on the bumpers", detail: "On the front edges of the top and bottom, by the left-hand side, where the door closes.", kind: "doors" }, () => {
+ const e: Vec3 = [P2[0] + u[0] * 30, 0, P2[2] + u[2] * 30];
+ k.fits(BUMPER, [
+ { on: bottom, at: [r1(e[0]), T / 2, r1(e[2])], dir: [-n[0], 0, -n[2]], hole: false },
+ { on: top, at: [r1(e[0]), H - T / 2, r1(e[2])], dir: [-n[0], 0, -n[2]], hole: false },
+ ]);
+ });
+ }
+ k.step({ title: "Screw it to the cabinet beside it", detail: "Once the next cabinet hangs level with it, four screws through the side near the hinge holes.", kind: "screws", tools: ["screwdriver"] }, () => {
+ k.fits(JOIN_SCREW, [0.25, 0.75].flatMap((f) => [60, A - 60].map((z) => ({ on: sideR, at: [W / 2 - T, r1(H * f), r1(z0 + z)] as Vec3, dir: [1, 0, 0] as Vec3 }))));
+ });
+ return true;
+}
+
+/** UTRUSTA carousel: two shelves on a pole that turns in a bearing at the top and the bottom. */
+function cornerCarousel(b: PlanBuilder, k: Kit, c: { cx: number; cz: number; H: number; top: string; bottom: string; rad?: number; y0?: number }) {
+ const { cx, cz, H } = c;
+ const y0 = c.y0 ?? 0;
+ const rad = c.rad ?? 250;
+ const ph = H - 2 * T - 10;
+ const pole = k.part("Carousel pole", [25, ph, 25], [cx, y0 + T + 5 + ph / 2, cz], { material: "metal", shape: "cyl" });
+ const ys = [y0 + T + 60, r1(y0 + T + (H - 2 * T) * 0.52)];
+ const shelves = ys.map((y) => k.part("Carousel shelf", [2 * rad, 30, 2 * rad], [cx, y, cz], { shape: "cyl" }));
+ const BEARING: HwDef = { kind: "connector", len: 20, dia: 60, name: "Bearing" };
+ const RIM: HwDef = { kind: "clip", len: 30, dia: 10, name: "Rim clip" };
+ const LOCK: HwDef = { kind: "pin", len: 20, dia: 6, name: "Locking pin" };
+ const yb = y0 + T, yt = y0 + H - T;
+ k.step({ title: "Screw the bearings to the bottom and the top", detail: "The cup with the peg goes in the middle of the bottom, the open one under the top, right above it. Two screws each.", kind: "screws", tools: ["screwdriver"] }, () => {
+ k.fits(BEARING, [{ on: c.bottom, at: [cx, yb, cz], dir: [0, -1, 0], hole: false }, { on: c.top, at: [cx, yt, cz], dir: [0, 1, 0], hole: false }]);
+ k.fits(SMALL, [-1, 1].flatMap((q) => [{ on: c.bottom, at: [cx + q * 22, yb, cz] as Vec3, dir: [0, -1, 0] as Vec3 }, { on: c.top, at: [cx + q * 22, yt, cz] as Vec3, dir: [0, 1, 0] as Vec3 }]));
+ });
+ k.step({ title: "Click the rim clips onto both carousel shelves", detail: "Nine around the edge of each shelf, then press the hub into its middle.", kind: "general", scene: "carousel", warnings: ["floor"] }, () => {
+ b.stagger(0.3);
+ shelves.forEach((key, i) => b.stage(key, [i * (2 * rad + 80) - rad - 40, 15, 0], [0, 0, 0], [0, 160, 0]));
+ b.then(0.1);
+ const clips: FitOpts[] = [];
+ for (const [i, key] of shelves.entries())
+ for (let j = 0; j < 9; j++) {
+ const a = (j / 9) * Math.PI * 2;
+ clips.push({ on: key, at: [r1(cx + Math.cos(a) * (rad - 6)), ys[i] + 15, r1(cz + Math.sin(a) * (rad - 6))], dir: [0, -1, 0], hole: false });
+ }
+ k.fits(RIM, clips);
+ });
+ k.step({ title: "Slide the shelves onto the pole and pin them", detail: "Join the two halves of the pole first. One pin under each shelf at the height you want.", kind: "general", scene: "carousel" }, () => {
+ b.stage(pole, [0, ph / 2, 0], [0, 0, 0], [0, 200, 0]);
+ b.then(0.1);
+ b.stagger(0.3);
+ shelves.forEach((key, i) => b.stage(key, [0, ys[i] - y0 - T - 5, 0], [0, 0, 0], [0, 300, 0]));
+ b.then(0.1);
+ k.fits(LOCK, ys.map((y) => ({ on: pole, at: [cx + 12, y - 25, cz] as Vec3, dir: [-1, 0, 0] as Vec3, hole: false as const })));
+ });
+ k.step({ title: "Tip the carousel in and lock the pole", detail: "Stand the pole in the bottom bearing, push its top up into the top bearing, and screw it so it can't drop out.", kind: "screws", tools: ["screwdriver"] }, () => {
+ b.stagger(0);
+ for (const key of [pole, ...shelves]) b.add(key, [260, 0, 260]);
+ b.then(0.15);
+ b.fit(SMALL, { on: pole, at: [cx + 12, yt - 30, cz], dir: [-1, 0, 0], hole: false });
+ });
+}
+
+
+/* ---------- the corner base cabinet 96.5 x 96.5 ---------- */
+
+const CORNER_HINGE: HwDef = { kind: "hinge", len: 70, dia: 30, name: "Corner hinge" };
+const HINGE_PLATE: HwDef = { kind: "plate", len: 50, dia: 20, name: "Hinge plate" };
+const ROLLER: HwDef = { ...HW.roller, name: "Door roller" };
+
+interface Fit3 {
+ side: string;
+ at: Vec3; // on the side's inner face
+ out: Vec3; // into the side
+ along: Vec3; // towards the wall
+}
+
+/** A suspension fitting in a side's top back corner, with its three screws. */
+function suspFit(k: Kit, f: Fit3) {
+ k.fits(SUS, [{ on: f.side, at: f.at, dir: f.out, hole: false }]);
+ const p = (dy: number, dk: number): Vec3 => [r1(f.at[0] + f.along[0] * dk), r1(f.at[1] + dy), r1(f.at[2] + f.along[2] * dk)];
+ k.fits(SUS_SCREW, [p(22, 14), p(-22, 14), p(0, -16)].map((at) => ({ on: f.side, at, dir: f.out })));
+}
+
+/** The rails on the walls, the cabinet hooked on, the fittings locked and capped, and the cabinet beside it screwed on. */
+function cornerHang(b: PlanBuilder, k: Kit, o: { rails: { key: string; ends: Vec3[]; out: Vec3 }[]; susp: Fit3[]; join?: { side: string; at: Vec3[]; out: Vec3 } }) {
+ k.step(
+ {
+ title: o.rails.length > 1 ? "Screw a suspension rail to each wall and hang the cabinet on them" : "Screw the suspension rail to the wall and hang the cabinet on it",
+ detail: (o.rails.length > 1 ? "Level the rails at the same height into the corner" : "Level the rail on the wall") + `, then lift the cabinet so the fittings hook over. Rails, wall screws and plugs aren't included. Click its legs on first if you use them.`,
+ kind: "anchor",
+ tools: ["drill", "level", "pencil", "screwdriver"],
+ people: 2,
+ pose: "+y",
+ wall: true,
+ warnings: ["two", "wall"],
+ },
+ () => {
+ b.stagger(0.3);
+ for (const rl of o.rails) b.add(rl.key, [rl.out[0] * 120, 0, rl.out[2] * 120]);
+ b.then(0.1);
+ const ends = o.rails.flatMap((rl) => rl.ends.map((p) => ({ rl, p })));
+ k.fits(HW.plug, ends.map(({ rl, p }) => ({ at: [p[0] + rl.out[0] * 8, p[1], p[2] + rl.out[2] * 8] as Vec3, dir: rl.out, hole: false as const })));
+ k.fits(HW.wallScrew, ends.map(({ rl, p }) => ({ on: rl.key, at: p, dir: rl.out, hole: false as const })));
+ },
+ );
+ k.step({ title: "Adjust the fittings and lock them", detail: "Turn the screws in each fitting to set the height and pull it tight to the walls, then push a locking clip into each.", kind: "screws", tools: ["screwdriver", "level"] }, () => {
+ k.fits(LOCK_CLIP, o.susp.map((f) => ({ on: f.side, at: [f.at[0] - f.out[0] * 10, f.at[1] - 20, f.at[2] - f.out[2] * 10] as Vec3, dir: f.out, hole: false as const })));
+ });
+ k.step({ title: "Click on the covers", detail: "One over each suspension fitting.", kind: "general" }, () => {
+ k.fits(named(b, { kind: "cap", len: 6, dia: 40 }, "Fitting cover"), o.susp.map((f) => ({ on: f.side, at: [f.at[0] - f.out[0] * 8, f.at[1], f.at[2] - f.out[2] * 8] as Vec3, dir: [-f.out[0], 0, -f.out[2]] as Vec3, hole: false as const })));
+ });
+ const j = o.join;
+ if (j)
+ k.step({ title: "Screw it to the cabinet beside it", detail: "Once the next cabinet hangs level with it, four screws through the side near the hinge holes.", kind: "screws", tools: ["screwdriver"] }, () => {
+ k.fits(JOIN_SCREW, j.at.map((at) => ({ on: j.side, at, dir: j.out })));
+ });
+}
+
+/**
+ * SEKTION corner base cabinet 96.5 x 96.5: an L of two boxes. A full box along the left wall, built like any base
+ * cabinet, and a short box along the back wall whose bottom joins the long one's on cam bolts, closed by an end panel.
+ * Each box has its own back, a corner rail ties the tops together, it hangs on a rail on each wall, and the door is two
+ * leaves joined by corner hinges. The corner of the room is at the back left.
+ */
+function cornerBaseL(b: PlanBuilder, s: ProductSpec): boolean {
+ const k = new Kit(b);
+ const W = Math.round(s.size.w * 10), A = 610, H = 760;
+ const x0 = -W / 2, z0 = -W / 2;
+ const xf = x0 + A; // the long box's front, and where the short box starts
+ const zf = z0 + A; // the short box's front
+ const RY = Math.PI / 2;
+ const RT = 12; // rail thickness
+
+ // the long box: its sides at the back and the front end, open towards +x
+ const s1a = k.part("Side panel", [T, H, A], [x0 + A / 2, H / 2, z0 + T / 2], { rot: [0, RY, 0] });
+ const s1b = k.part("Side panel", [T, H, A], [x0 + A / 2, H / 2, W / 2 - T / 2], { rot: [0, RY, 0] });
+ const bottom1 = k.part("Bottom panel", [W - 2 * T, T, A - G], [x0 + G + (A - G) / 2, T / 2, 0], { rot: [0, RY, 0] });
+ const back1 = k.part("Back panel", [W - 2 * T + 12, H - 4, 3], [x0 + G - 1.5, H / 2, 0], { material: "fiber", rot: [0, RY, 0] });
+ const rail1 = k.part("Back rail", [W - 2 * T, RT, 60], [x0 + G + 30, H - RT / 2, 0], { material: "metal", rot: [0, RY, 0] });
+ // the short box: its bottom carries on from the long one's, an end panel, a back on the back wall
+ const bw2 = W / 2 - T - xf;
+ const bottom2 = k.part("Short bottom", [bw2, T, A - G], [xf + bw2 / 2, T / 2, z0 + G + (A - G) / 2]);
+ const side2 = k.part("End panel", [T, H, A], [W / 2 - T / 2, H / 2, z0 + A / 2]);
+ const back2 = k.part("Short back", [W / 2 - T - xf + 6, H - 4, 3], [(xf + W / 2 - T) / 2 + 3, H / 2, z0 + G - 1.5], { material: "fiber" });
+ const tr = b.compound(
+ "Corner rail",
+ [
+ { shape: "box", size: [60, RT, W - 2 * T], pos: [xf - 30, H - RT / 2, 0] },
+ { shape: "box", size: [W / 2 - T - xf, RT, 60], pos: [(xf + W / 2 - T) / 2, H - RT / 2, zf - 30] },
+ ],
+ { material: "metal" },
+ );
+ const tRail = b.place(tr.type, tr.mid);
+
+ const xs3 = [0.2, 0.5, 0.82].map((f) => r1(x0 + G + (A - G) * f));
+ const xd3 = [0.12, 0.62, 0.92].map((f) => r1(x0 + G + (A - G) * f));
+ // a joint between one of the long box's sides and its bottom
+ const j1 = (sz: -1 | 1) => {
+ const side = sz < 0 ? s1a : s1b;
+ const z = sz < 0 ? z0 + T : W / 2 - T;
+ return {
+ bolts: xs3.map((x): FitOpts => ({ on: side, at: [x, T / 2, z], dir: [0, 0, sz], mate: bottom1 })),
+ cams: xs3.map((x): FitOpts => ({ on: bottom1, at: [x, T, z - sz * 24], dir: [0, -1, 0] })),
+ dowels: xd3.map((x): FitOpts => ({ on: bottom1, at: [x, T / 2, z], dir: [0, 0, -sz], mate: side })),
+ };
+ };
+ const zj = xs3.map((x) => r1(x - x0 + z0));
+ const zd = xd3.map((x) => r1(x - x0 + z0));
+ const joinBolts = zj.map((z): FitOpts => ({ on: bottom1, at: [xf, T / 2, z], dir: [-1, 0, 0], mate: bottom2 }));
+ const joinCams = zj.map((z): FitOpts => ({ on: bottom2, at: [xf + 24, T, z], dir: [0, -1, 0] }));
+ const joinDowels = zd.map((z): FitOpts => ({ on: bottom2, at: [xf, T / 2, z], dir: [1, 0, 0], mate: bottom1 }));
+ const endBolts = zj.map((z): FitOpts => ({ on: side2, at: [W / 2 - T, T / 2, z], dir: [1, 0, 0], mate: bottom2 }));
+ const endCams = zj.map((z): FitOpts => ({ on: bottom2, at: [W / 2 - T - 24, T, z], dir: [0, -1, 0] }));
+ const endDowels = zd.map((z): FitOpts => ({ on: bottom2, at: [W / 2 - T, T / 2, z], dir: [-1, 0, 0], mate: side2 }));
+ const susp: Fit3[] = [
+ { side: s1a, at: [x0 + G + 25, H - 50, z0 + T], out: [0, 0, -1], along: [-1, 0, 0] },
+ { side: s1b, at: [x0 + G + 25, H - 50, W / 2 - T], out: [0, 0, 1], along: [-1, 0, 0] },
+ { side: side2, at: [W / 2 - T, H - 50, z0 + G + 25], out: [1, 0, 0], along: [0, 0, -1] },
+ ];
+
+ k.step({ title: "Screw the cam bolts into the long box's sides", detail: "Three into each side, in the holes nearest the bottom. Turn them in until they stop.", kind: "cams", tools: ["screwdriver"], scene: "prep", warnings: ["floor"] }, () => {
+ b.stagger(0.25);
+ b.stage(s1a, [0, T / 2, -(A / 2 + 40)], [0, 0, Math.PI / 2], [0, 160, 0]);
+ b.stage(s1b, [0, T / 2, A / 2 + 40], [0, 0, -Math.PI / 2], [0, 160, 0]);
+ b.then(0.15);
+ k.fits(HW.camScrew, [...j1(-1).bolts, ...j1(1).bolts]);
+ });
+ k.step({ title: "Screw a suspension fitting onto each side", detail: "In the top back corner, three screws each. The hook faces the back.", kind: "screws", tools: ["screwdriver"], scene: "prep" }, () => {
+ for (const f of susp.slice(0, 2)) suspFit(k, f);
+ });
+ k.step({ title: "Tap the dowels into the ends of the bottom", detail: "Three into each end.", kind: "dowels", tools: ["hammer"], pose: "+y", warnings: ["floor"] }, () => {
+ b.add(bottom1, [0, 200, 0]);
+ b.then(0.1);
+ k.fits(HW.dowel, [...j1(-1).dowels, ...j1(1).dowels]);
+ });
+ k.step({ title: "Press both sides onto the bottom", detail: "Bolts and dowels into their holes, inside faces towards each other.", kind: "dowels", people: 2, pose: "+y" }, () => {
+ b.stagger(0.3);
+ b.add(s1a, [0, 0, -260]);
+ b.add(s1b, [0, 0, 260]);
+ });
+ k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn each one clockwise until it bites.", kind: "cams", tools: ["screwdriver"], pose: "+y" }, () => k.fits(HW.cam, [...j1(-1).cams, ...j1(1).cams]));
+ k.step({ title: "Stand it up and slide the back down its grooves", detail: "Smooth side to the inside, from the top until it sits on the bottom.", kind: "join", pose: "+y" }, () => b.add(back1, [0, 500, 0]));
+ k.step({ title: "Screw the back rail across the top", detail: "Flush with the back edges of the sides, one screw down into each.", kind: "screws", tools: ["screwdriver"] }, () => {
+ b.add(rail1, [0, 220, 0]);
+ b.then(0.1);
+ k.fits(RAIL_SCREW, [z0 + T / 2, W / 2 - T / 2].map((z) => ({ on: z < 0 ? s1a : s1b, at: [x0 + G + 30, H, z] as Vec3, dir: [0, -1, 0] as Vec3, mate: rail1 })));
+ });
+ const xb = x0 + G - 3;
+ const nailL = (z: number, y: number, on: string): FitOpts => ({ on: back1, at: [xb, r1(y), r1(z)], dir: [1, 0, 0], mate: on, hole: false });
+ k.step({ title: "Turn it onto its front, square it up and nail one corner", detail: "Both diagonals the same length. One nail through the back into a bottom corner.", kind: "nails", tools: ["hammer", "tape"], pose: "-x", check: "square", warnings: ["square", "floor"] }, () => k.fits(HW.nail, [nailL(z0 + 30, T / 2, bottom1)]));
+ k.step({ title: "Nail the other bottom corner", detail: "Keep the back pushed tight to the edge.", kind: "nails", tools: ["hammer"], pose: "-x" }, () => k.fits(HW.nail, [nailL(W / 2 - 30, T / 2, bottom1)]));
+ k.step({ title: "Nail a top corner", detail: "Check it is still square first.", kind: "nails", tools: ["hammer"], pose: "-x" }, () => k.fits(HW.nail, [nailL(W / 2 - T / 2 - 4, H - 60, s1b)]));
+ k.step({ title: "Nail on the two plastic brackets at the top", detail: "One in each top corner of the back, one nail each.", kind: "nails", tools: ["hammer"], pose: "-x" }, () => {
+ const pts = [nailL(z0 + T + 30, H - 20, s1a), nailL(W / 2 - T - 30, H - 20, s1b)];
+ k.fits(BACK_CLIP, pts.map((p) => ({ ...p, mate: undefined })));
+ k.fits(HW.nail, pts.map((p, i) => ({ ...p, at: [p.at[0], p.at[1], i ? W / 2 - T / 2 : z0 + T / 2] as Vec3 })));
+ });
+ k.step({ title: "Nail the rest of the back", detail: "Ten nails along the edges, into the sides and the bottom.", kind: "nails", tools: ["hammer"], pose: "-x" }, () => {
+ const list: FitOpts[] = [];
+ for (const f of [0.35, 0.65]) list.push(nailL(z0 + T / 2 + 4, H * f, s1a), nailL(W / 2 - T / 2 - 4, H * f, s1b));
+ for (const f of [0.15, 0.3, 0.45, 0.6, 0.75, 0.88]) list.push(nailL(z0 + W * f, T / 2, bottom1));
+ k.fits(HW.nail, list);
+ });
+ k.step({ title: "Lay it on its side and screw three cam bolts into the bottom", detail: "Into the front edge of the bottom, by the back end. The short box joins on there.", kind: "cams", tools: ["screwdriver"], pose: "+z", warnings: ["floor"] }, () => k.fits(HW.camScrew, joinBolts));
+ k.step({ title: "Tap the dowels into the short bottom and push it on", detail: "Six dowels, three into each end. Then push it onto the bolts.", kind: "dowels", tools: ["hammer"], pose: "+z" }, () => {
+ k.fits(HW.dowel, [...joinDowels, ...endDowels]);
+ b.add(bottom2, [300, 0, 0]);
+ });
+ k.step({ title: "Turn the cam locks", detail: "Three, in the short bottom. Turn each one clockwise until it pulls the bottoms tight.", kind: "cams", tools: ["screwdriver"], pose: "+z" }, () => k.fits(HW.cam, joinCams));
+ k.step({ title: "Screw the cam bolts and a suspension fitting into the end panel", detail: "Three bolts near its bottom, and the fitting in its top back corner with three screws.", kind: "cams", tools: ["screwdriver"], scene: "end", warnings: ["floor"] }, () => {
+ b.stage(side2, [0, T / 2, 0], [0, 0, Math.PI / 2]);
+ b.then(0.15);
+ k.fits(HW.camScrew, endBolts);
+ suspFit(k, susp[2]);
+ });
+ k.step({ title: "Push the end panel onto the short bottom", detail: "Bolts and dowels into their holes.", kind: "dowels", pose: "+z" }, () => b.add(side2, [300, 0, 0]));
+ k.step({ title: "Turn the cam locks", detail: "Three, in the short bottom by the end panel.", kind: "cams", tools: ["screwdriver"], pose: "+z" }, () => k.fits(HW.cam, endCams));
+ k.step({ title: "Stand it up and slide the short back down into its grooves", detail: "From the top, along the back of the short box, until it sits on the bottom.", kind: "join", pose: "+y" }, () => b.add(back2, [0, 500, 0]));
+ k.step({ title: "Screw the corner rail across the top front", detail: "Its long arm runs along the front of the long box, the short arm over the front of the short box. Four screws, down into the sides.", kind: "screws", tools: ["screwdriver"] }, () => {
+ b.add(tRail, [0, 220, 0]);
+ b.then(0.1);
+ k.fits(RAIL_SCREW, [
+ { on: s1a, at: [xf - 30, H, z0 + T / 2], dir: [0, -1, 0], mate: tRail },
+ { on: s1b, at: [xf - 30, H, W / 2 - T / 2], dir: [0, -1, 0], mate: tRail },
+ { on: side2, at: [W / 2 - T / 2, H, zf - 45], dir: [0, -1, 0], mate: tRail },
+ { on: side2, at: [W / 2 - T / 2, H, zf - 15], dir: [0, -1, 0], mate: tRail },
+ ]);
+ });
+ const zb2 = z0 + G - 3;
+ const nailB = (x: number, y: number, on: string): FitOpts => ({ on: back2, at: [r1(x), r1(y), zb2], dir: [0, 0, 1], mate: on, hole: false });
+ k.step({ title: "Turn it onto its front, square it and nail the short back at the bottom", detail: "One nail by the end panel.", kind: "nails", tools: ["hammer", "tape"], pose: "-z", check: "square", warnings: ["square", "floor"] }, () => k.fits(HW.nail, [nailB(W / 2 - T - 30, T / 2, bottom2)]));
+ k.step({ title: "Nail its top corner", detail: "Into the end panel, by the top.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => k.fits(HW.nail, [nailB(W / 2 - T / 2 - 4, H - 60, side2)]));
+ k.step({ title: "Nail on the two plastic brackets", detail: "In the top corners of the short back, one nail each.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ const pts = [nailB(xf + 30, H - 20, back2), nailB(W / 2 - T - 30, H - 20, back2)];
+ k.fits(BACK_CLIP, pts.map((p) => ({ ...p, mate: undefined })));
+ k.fits(HW.nail, pts.map((p, i) => ({ ...p, mate: i ? side2 : s1a, at: [i ? W / 2 - T / 2 - 4 : xf - 20, p.at[1], p.at[2]] as Vec3 })));
+ });
+ k.step({ title: "Nail the rest of the short back", detail: "Five nails along the end panel and the bottom.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ k.fits(HW.nail, [nailB(W / 2 - T / 2 - 4, H * 0.35, side2), nailB(W / 2 - T / 2 - 4, H * 0.65, side2), ...[0.25, 0.5, 0.75].map((f) => nailB(xf + (W / 2 - T - xf) * f, T / 2, bottom2))]);
+ });
+
+ const yr = H - 50 + 10;
+ const railL = k.part("Suspension rail (not included)", [W, 40, 8], [x0 - 4, yr, 0], { material: "metal", extra: true, rot: [0, RY, 0] });
+ const railB = k.part("Suspension rail (not included)", [W, 40, 8], [0, yr, z0 - 4], { material: "metal", extra: true });
+ cornerHang(b, k, {
+ rails: [
+ { key: railL, ends: [z0 + 60, W / 2 - 60].map((z): Vec3 => [x0 - 8, yr, z]), out: [-1, 0, 0] },
+ { key: railB, ends: [xf + 40, W / 2 - 60].map((x): Vec3 => [x, yr, z0 - 8]), out: [0, 0, -1] },
+ ],
+ susp,
+ });
+
+ if (s.cabinet?.shelves) {
+ const y = Math.round(H / 2 / 32) * 32;
+ const st = b.compound("Corner shelf", [
+ { shape: "box", size: [A - G - 30, T, W - 2 * T - 2], pos: [x0 + G + (A - G - 30) / 2, y + T / 2, 0] },
+ { shape: "box", size: [W / 2 - T - xf - 1, T, A - G - 30], pos: [(xf + W / 2 - T - 1) / 2, y + T / 2, z0 + G + (A - G - 30) / 2] },
+ ]);
+ const key = b.place(st.type, st.mid);
+ k.step({ title: "Push in the shelf pins and lay the shelf on", detail: "Six pins at one height: two in each side of the long box and two in the end panel.", kind: "shelves" }, () => {
+ const pins: FitOpts[] = [];
+ for (const x of [x0 + G + 50, xf - 80]) pins.push({ on: s1a, at: [x, y, z0 + T], dir: [0, 0, -1], hole: false }, { on: s1b, at: [x, y, W / 2 - T], dir: [0, 0, 1], hole: false });
+ for (const z of [z0 + G + 50, zf - 80]) pins.push({ on: side2, at: [W / 2 - T, y, z], dir: [1, 0, 0], hole: false });
+ k.fits(HW.pin, pins);
+ b.add(key, [300, 100, 300]);
+ });
+ }
+ if (s.cabinet?.corner?.inner === "carousel") lCarousel(b, k, { cx: x0 + G + 300, cz: z0 + G + 300, H, bottom1, s1a, s1b, z0 });
+
+ // two leaves at the inside corner: one across the short box's front, one across the long box's front
+ const lw = Math.round(W / 2 - xf - 15), dh = H - DGAP;
+ const ye = r1(H / 2);
+ const lf = zf + 1 + DT / 2, xl2 = xf + 1 + DT / 2;
+ const leafA = k.part("Door", [lw, dh, DT], [W / 2 - 1.5 - lw / 2, ye, lf]);
+ const leafB = k.part("Door", [lw, dh, DT], [xl2, ye, W / 2 - 1.5 - lw / 2], { rot: [0, RY, 0] });
+ const hy = [120, H - 120];
+ const ja = W / 2 - 1.5 - lw + 15; // leaf A's edge at the inside corner
+ k.step({ title: "Screw the hinge plates onto one leaf", detail: "On the back of the leaf that goes across the long box, along its edge at the inside corner. Two screws each.", kind: "hinges", tools: ["screwdriver"], scene: "doors", warnings: ["floor", "face"] }, () => {
+ b.stage(leafB, [0, DT / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ k.fits(HINGE_PLATE, hy.map((y) => ({ on: leafB, at: [xl2 - DT / 2, y, W / 2 - 1.5 - lw + 15] as Vec3, dir: [1, 0, 0] as Vec3, hole: false as const })));
+ k.fits(SMALL, hy.flatMap((y) => [-12, 12].map((dd) => ({ on: leafB, at: [xl2 - DT / 2, y + dd, W / 2 - 1.5 - lw + 15] as Vec3, dir: [1, 0, 0] as Vec3 }))));
+ });
+ k.step({ title: "Screw the corner hinges onto the other leaf", detail: "On the back of the second leaf, along the same edge. Two screws each.", kind: "hinges", tools: ["screwdriver"], scene: "doors" }, () => {
+ b.stage(leafA, [lw + 80, DT / 2, 0], [Math.PI / 2, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ k.fits(CORNER_HINGE, hy.map((y) => ({ on: leafA, at: [ja, y, lf - DT / 2] as Vec3, dir: [0, 0, 1] as Vec3, hole: false as const })));
+ k.fits(SMALL, hy.flatMap((y) => [-12, 12].map((dd) => ({ on: leafA, at: [ja + 8, y + dd, lf - DT / 2] as Vec3, dir: [0, 0, 1] as Vec3 }))));
+ });
+ k.step({ title: "Clip the leaves together and screw on the roller", detail: "Each corner hinge clips onto its plate. The roller goes at the top of the free leaf, near its edge, with one screw.", kind: "hinges", tools: ["screwdriver"], scene: "doors" }, () => {
+ k.fits(ROLLER, [{ on: leafB, at: [xl2 - DT / 2, H - 40, W / 2 - 1.5 - 25], dir: [1, 0, 0], hole: false }]);
+ k.fits(SMALL, [{ on: leafB, at: [xl2 - DT / 2, H - 40, W / 2 - 1.5 - 40], dir: [1, 0, 0] }]);
+ });
+ k.step({ title: "Press the hinges into the door and screw their plates onto the end panel", detail: "Two hinges along the outer edge of the leaf across the short box; the plates go in the holes at the front of the end panel.", kind: "hinges", tools: ["screwdriver"] }, () => {
+ k.fits(HW.hinge, hy.map((y) => ({ on: leafA, at: [W / 2 - 1.5 - 22, y, lf - DT / 2] as Vec3, dir: [0, 0, 1] as Vec3, twist: Math.PI })));
+ k.fits(PLATE, hy.map((y) => ({ on: side2, at: [W / 2 - T, y, zf - 37] as Vec3, dir: [1, 0, 0] as Vec3, hole: false as const })));
+ });
+ k.step({ title: "Click the door onto the plates", detail: "Hold both leaves folded flat, hook the hinge arms over the plates and press until they click.", kind: "doors", people: 2 }, () => {
+ b.stagger(0);
+ b.add(leafA, [0, 0, 380]);
+ b.add(leafB, [380, 0, 0]);
+ });
+ k.step({ title: "Line up the door and stick on the bumpers", detail: "Turn the hinge screws until both leaves close evenly. The two bumpers go on the front edge of the bottom, where the folding leaf closes.", kind: "doors", tools: ["screwdriver"] }, () => {
+ k.fits(BUMPER, [W / 2 - 120, W / 2 - 40].map((z) => ({ on: bottom1, at: [xf, T / 2, z] as Vec3, dir: [-1, 0, 0] as Vec3, hole: false as const })));
+ });
+ return true;
+}
+
+/** UTRUSTA carousel for the L corner: two kidney trays turning on a bearing on the bottom and one under a beam across the long box. */
+function lCarousel(b: PlanBuilder, k: Kit, c: { cx: number; cz: number; H: number; bottom1: string; s1a: string; s1b: string; z0: number }) {
+ const BEARING: HwDef = { kind: "connector", len: 20, dia: 70, name: "Bearing" };
+ const BEAM_BRACKET: HwDef = { kind: "angle", len: 60, dia: 40, name: "Beam bracket" };
+ const { cx, cz, H } = c;
+ const dia = 560;
+ const y0 = T;
+ const ys = [y0 + 40, r1(y0 + (H - y0) * 0.5)];
+ const trays = ys.map((y) => {
+ const t = b.compound("Carousel tray", [
+ { shape: "cyl", size: [dia, 12, dia], pos: [0, 6, 0] },
+ { shape: "cyl", size: [dia, 6, dia], pos: [0, 70, 0], material: "metal" },
+ ], { material: "metal" });
+ return b.place(t.type, [cx + t.mid[0], y + t.mid[1], cz + t.mid[2]]);
+ });
+ const beam = k.part("Carousel beam", [40, 30, -2 * c.z0 - 2 * T], [cx, H - 90, 0], { material: "metal" });
+ k.step({ title: "Screw the bottom bearing onto the bottom", detail: "Where the marks show, at the middle of the corner. Four screws.", kind: "screws", tools: ["screwdriver"] }, () => {
+ k.fits(BEARING, [{ on: c.bottom1, at: [cx, y0, cz], dir: [0, -1, 0], hole: false }]);
+ k.fits(SMALL, [0, 1, 2, 3].map((q) => ({ on: c.bottom1, at: [r1(cx + Math.cos((q * Math.PI) / 2) * 25), y0, r1(cz + Math.sin((q * Math.PI) / 2) * 25)] as Vec3, dir: [0, -1, 0] as Vec3 })));
+ });
+ k.step({ title: "Put the trays together", detail: "Press each rim onto its tray until it clicks all round.", kind: "general", scene: "carousel", warnings: ["floor"] }, () => {
+ b.stagger(0.3);
+ trays.forEach((key, i) => b.stage(key, [(i - 0.5) * (dia + 80), 40, 0], [0, 0, 0], [0, 160, 0]));
+ });
+ k.step({ title: "Set the lower tray on the bottom bearing", detail: "Its hub drops over the bearing's peg. Turn it to check it runs freely.", kind: "general" }, () => b.add(trays[0], [200, 200, 200]));
+ k.step({ title: "Fit the beam across the long box", detail: "A bracket screwed into each side, the beam screwed to both, and the top bearing under it.", kind: "screws", tools: ["screwdriver"] }, () => {
+ const ends = [c.z0 + T, -c.z0 - T];
+ k.fits(BEAM_BRACKET, ends.map((z, i) => ({ on: i ? c.s1b : c.s1a, at: [cx, H - 90, z] as Vec3, dir: [0, 0, i ? 1 : -1] as Vec3, hole: false as const })));
+ b.add(beam, [0, 200, 0]);
+ b.then(0.1);
+ k.fits(BEARING, [{ on: beam, at: [cx, H - 105, cz], dir: [0, 1, 0], hole: false }]);
+ k.fits(SMALL, [0, 1, 2].map((q) => ({ on: beam, at: [cx, H - 105, r1(cz + (q - 1) * 14)] as Vec3, dir: [0, 1, 0] as Vec3 })));
+ });
+ k.step({ title: "Hang the upper tray and lock it", detail: "Tip it in, push its hub up onto the top bearing and turn the screw in the hub so it can't drop.", kind: "general" }, () => b.add(trays[1], [200, 0, 200]));
+}
+
+
+/* ---------- the blind corner base cabinet 127 ---------- */
+
+/**
+ * SEKTION corner base cabinet 127 x 61 (the frame): one long box whose left part hides behind the cabinet on the other
+ * wall. Built like a base cabinet, plus a fixed front panel stood on the bottom over the blind part, held by frame screws,
+ * and a post at its edge where the door opening starts. Two rails across the top, the back nailed on lying on its front,
+ * and it hangs on the suspension rail.
+ */
+interface Blind {
+ k: Kit;
+ W: number;
+ H: number;
+ D: number;
+ Wi: number;
+ xp: number; // the post's left face; the door opening runs from xp + T to the right side
+ sideL: string;
+ sideR: string;
+ front: string;
+ post: string;
+}
+
+function cornerBlind(b: PlanBuilder, s: ProductSpec, inside?: (c: Blind) => void): boolean {
+ const k = new Kit(b);
+ const W = Math.round(s.size.w * 10), D = 610, H = 760;
+ const Wi = W - 2 * T, dd = D - G, zp = G / 2;
+ const xp = W / 2 - T - 600; // the door opening starts here
+ const RT = 12;
+ const sideL = k.part("Side", [T, H, D], [-W / 2 + T / 2, H / 2, 0]);
+ const sideR = k.part("Side", [T, H, D], [W / 2 - T / 2, H / 2, 0]);
+ const bottom = k.part("Bottom", [Wi, T, dd], [0, T / 2, zp]);
+ const fw = xp + W / 2 - T;
+ const front = k.part("Front panel", [fw, H - T, T], [-W / 2 + T + fw / 2, T + (H - T) / 2, D / 2 - T / 2]);
+ const post = k.part("Post", [T, H - T, 80], [xp + T / 2, T + (H - T) / 2, D / 2 - 40]);
+ const back = k.part("Back panel", [Wi + 12, H - 4, 3], [0, H / 2, -D / 2 + G - 1.5], { material: "fiber" });
+ const railB = k.part("Rail", [Wi, RT, 80], [0, H - RT / 2, -D / 2 + G + 40], { material: "metal" });
+ const railF = k.part("Rail", [W / 2 - T - xp - T, RT, 80], [(xp + T + W / 2 - T) / 2, H - RT / 2, D / 2 - 40 - T], { material: "metal" });
+
+ const zs = [zp - dd / 2 + 60, zp, zp + dd / 2 - 60];
+ const bolts = (sx: number): FitOpts[] => zs.map((z) => ({ on: sx < 0 ? sideL : sideR, at: [(sx * Wi) / 2, T / 2, z + 20], dir: [sx, 0, 0], mate: bottom }));
+ const dowels = (sx: number): FitOpts[] => zs.map((z) => ({ on: bottom, at: [(sx * Wi) / 2, T / 2, z - 20], dir: [-sx, 0, 0] }));
+ const cams = (sx: number): FitOpts[] => zs.map((z) => ({ on: bottom, at: [sx * (Wi / 2 - 24), T, z + 20], dir: [0, -1, 0] }));
+ const sus: Fit3[] = [-1, 1].map((sx) => ({ side: sx < 0 ? sideL : sideR, at: [(sx * Wi) / 2, H - 50, -D / 2 + G + 25] as Vec3, out: [sx, 0, 0] as Vec3, along: [0, 0, -1] as Vec3 }));
+
+ k.step({ title: "Screw a suspension fitting onto each side", detail: "Lay the sides flat, inside up. One fitting in each top back corner, three screws each.", kind: "screws", tools: ["screwdriver"], scene: "sides", pose: "+x", warnings: ["floor"] }, () => {
+ b.stagger(0.15);
+ [sideL, sideR].forEach((key, i) => b.stage(key, [0, H / 2, (i - 0.5) * (D + 120)], key === sideR ? [0, Math.PI, 0] : [0, 0, 0]));
+ b.then(0.15);
+ for (const f of sus) suspFit(k, f);
+ });
+ k.step({ title: "Screw the cam bolts into both sides", detail: "Three into each side, in the holes nearest the bottom.", kind: "cams", tools: ["screwdriver"], scene: "sides", pose: "+x" }, () => k.fits(HW.camScrew, [...bolts(-1), ...bolts(1)]));
+ k.step({ title: "Tap dowels into the bottom and push it onto one side", detail: "Three dowels into each end. Stand the right side up on a rug, then push the bottom onto its bolts.", kind: "dowels", tools: ["hammer"], pose: "+y", warnings: ["floor"] }, () => {
+ b.add(sideR, [0, 0, 0]);
+ b.then(0.15);
+ k.fits(HW.dowel, [...dowels(1), ...dowels(-1)]);
+ b.add(bottom, [-360, 0, 0]);
+ });
+ k.step({ title: "Turn the cam locks", detail: "Arrow towards the bolt, then turn clockwise until it pulls tight.", kind: "cams", tools: ["screwdriver"] }, () => k.fits(HW.cam, cams(1)));
+ k.step({ title: "Stand the front panel on the bottom and screw it on", detail: "Over the blind part, flush with the front edge. Three frame screws up through the bottom into its edge. Use the Allen key.", kind: "screws", tools: ["allen"] }, () => {
+ b.add(front, [0, 300, 0]);
+ b.then(0.1);
+ k.fits(FRAME_SCREW, [0.2, 0.5, 0.8].map((f) => ({ on: bottom, at: [r1(-W / 2 + T + fw * f), 0, D / 2 - T / 2] as Vec3, dir: [0, 1, 0] as Vec3, mate: front })));
+ });
+ k.step({ title: "Fit the other side", detail: "Line every dowel and bolt up with its hole and press the side on evenly.", kind: "dowels", people: 2 }, () => b.add(sideL, [-420, 0, 0]));
+ k.step({ title: "Turn the other cam locks", detail: "The same way as on the first side.", kind: "cams", tools: ["screwdriver"] }, () => k.fits(HW.cam, cams(-1)));
+ k.step({ title: "Screw the post to the edge of the front panel", detail: "Where the door opening starts. Three frame screws through the post into the panel's edge.", kind: "screws", tools: ["allen"] }, () => {
+ b.add(post, [300, 0, 0]);
+ b.then(0.1);
+ k.fits(FRAME_SCREW, [0.2, 0.5, 0.8].map((f) => ({ on: post, at: [xp + T, r1(T + (H - T) * f), D / 2 - T / 2] as Vec3, dir: [-1, 0, 0] as Vec3, mate: front })));
+ });
+ k.step({ title: "Slide the back down its grooves", detail: "Smooth side to the inside, from the top until it sits on the bottom.", kind: "join" }, () => b.add(back, [0, 600, 0]));
+ k.step({ title: "Screw the rails across the top", detail: "The long one at the back, the short one over the door opening. One screw down through each end into the side or the post.", kind: "screws", tools: ["screwdriver"] }, () => {
+ b.stagger(0.25);
+ b.add(railB, [0, 260, 0]);
+ b.add(railF, [0, 260, 0]);
+ b.then(0.15);
+ k.fits(RAIL_SCREW, [
+ { on: sideL, at: [-(Wi + T) / 2, H, -D / 2 + G + 40], dir: [0, -1, 0], mate: railB },
+ { on: sideR, at: [(Wi + T) / 2, H, -D / 2 + G + 40], dir: [0, -1, 0], mate: railB },
+ { on: post, at: [xp + T / 2, H, D / 2 - 40 - T], dir: [0, -1, 0], mate: railF },
+ { on: sideR, at: [(Wi + T) / 2, H, D / 2 - 40 - T], dir: [0, -1, 0], mate: railF },
+ ]);
+ });
+ const zn = -D / 2 + G - 3;
+ const nail = (at: Vec3, mate: string): FitOpts => ({ on: back, at, dir: [0, 0, 1], mate, hole: false });
+ k.step({ title: "Turn it onto its front, square it up and nail one corner", detail: "Both diagonals the same length. One nail in a bottom corner.", kind: "nails", tools: ["hammer", "tape"], pose: "-z", check: "square", warnings: ["square", "floor"] }, () => k.fits(HW.nail, [nail([-Wi / 2 + 20, T / 2, zn], bottom)]));
+ k.step({ title: "Nail the other bottom corner", detail: "Keep the back pushed tight to the edge.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => k.fits(HW.nail, [nail([Wi / 2 - 20, T / 2, zn], bottom)]));
+ k.step({ title: "Nail a top corner", detail: "Check it is still square first.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => k.fits(HW.nail, [nail([(Wi + 8) / 2, H - 60, zn], sideR)]));
+ const clips: Vec3[] = [-1, 1].map((sx) => [sx * (Wi / 2 - 40), H - 20, zn]);
+ k.step({ title: "Nail on the two plastic brackets at the top", detail: "One in each top corner of the back, a nail through each.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ k.fits(BACK_CLIP, clips.map((p) => ({ on: back, at: p, dir: [0, 0, 1] as Vec3, hole: false as const })));
+ k.fits(HW.nail, clips.map((p) => nail([Math.sign(p[0]) * (Wi + 8) / 2, p[1], zn], p[0] < 0 ? sideL : sideR)));
+ });
+ k.step({ title: "Nail the back all along", detail: "Twelve more nails, into the bottom and the sides.", kind: "nails", tools: ["hammer"], pose: "-z" }, () => {
+ const list: FitOpts[] = [];
+ for (let i = 0; i < 8; i++) list.push(nail([r1(-Wi / 2 + 80 + ((Wi - 160) * i) / 7), T / 2, zn], bottom));
+ for (const sx of [-1, 1]) for (const f of [0.35, 0.65]) list.push(nail([(sx * (Wi + 8)) / 2, r1(H * f), zn], sx < 0 ? sideL : sideR));
+ k.fits(HW.nail, list);
+ });
+ const yr = H - 40;
+ const rail = k.part("Suspension rail (not included)", [W + 60, 40, 8], [0, yr, -D / 2 - 4], { material: "metal", extra: true });
+ cornerHang(b, k, { rails: [{ key: rail, ends: [-W / 3, 0, W / 3].map((x): Vec3 => [x, yr, -D / 2 - 8]), out: [0, 0, -1] }], susp: sus });
+ inside?.({ k, W, H, D, Wi, xp, sideL, sideR, front, post });
+ return true;
+}
+
+/* ---------- what goes in the blind corner 127: the UTRUSTA shelf, a MAXIMERA drawer, the pull-out trays, the door ---------- */
+
+/** The front over the door opening: it covers the post and the opening, 3 mm short of the outside edge. */
+const blindFront = (c: Blind) => ({ x: (c.xp + c.W / 2) / 2, w: c.W / 2 - c.xp - DGAP, z: c.D / 2 + 1 + DT / 2 });
+
+/** UTRUSTA shelf for the corner base cabinet: one board right across, on eight pins, lowered in from the top. */
+function blindShelf(b: PlanBuilder, c: Blind, y: number) {
+ const { k, D, Wi, xp } = c;
+ const z0 = -D / 2 + G + 2, z1 = D / 2 - 82; // its front edge stops behind the post
+ const shelf = k.part("Shelf", [Wi - 2, T, z1 - z0], [0, y, (z0 + z1) / 2]);
+ const yp = y - T / 2;
+ const pins: FitOpts[] = [];
+ for (const sx of [-1, 1]) for (const z of [z0 + 40, (z0 + z1) / 2, z1 - 40]) pins.push({ on: sx < 0 ? c.sideL : c.sideR, at: [(sx * Wi) / 2, yp, r1(z)], dir: [sx, 0, 0], hole: false });
+ for (const x of [xp + 4, xp + T - 4]) pins.push({ on: c.post, at: [x, yp - 4, D / 2 - 80], dir: [0, 0, 1], hole: false });
+ k.step({ title: "Push in the shelf pins", detail: "Eight at the same height: three in each side and two in the back of the post.", kind: "shelves" }, () => k.fits(HW.pin, pins));
+ k.step({ title: "Lower the shelf onto the pins", detail: "From the top, right across the cabinet behind the blind front, until it rests on all eight.", kind: "shelves" }, () => b.add(shelf, [0, 520, 0]));
+}
+
+/** A MAXIMERA drawer over the door: its runners go on the post and the right side, the box is built on the floor. */
+function blindDrawer(b: PlanBuilder, c: Blind, lo: number, hi: number) {
+ const { k, D, xp } = c;
+ const ox0 = xp + T, ox1 = c.W / 2 - T;
+ const f = blindFront(c);
+ const bw = ox1 - ox0 - 26;
+ const cx = (ox0 + ox1) / 2;
+ const dd = Math.floor((D - 60) / 50) * 50;
+ const zc = D / 2 - 2 - dd / 2;
+ const yb = lo + 18, sh = 120;
+ const sides = [-1, 1].map((sx) => k.part("Drawer side", [16, sh, dd], [cx + sx * (bw / 2 - 8), yb + sh / 2, zc], { material: "metal" }));
+ const back = k.part("Drawer back", [bw - 32, sh - 20, 16], [cx, yb + 10 + (sh - 20) / 2, zc - dd / 2 + 10]);
+ const bottom = k.part("Drawer bottom", [bw - 32, 10, dd - 4], [cx, yb + 5, zc]);
+ const rails = [-1, 1].map((sx) => k.part("Gallery rail", [12, 12, dd - 20], [cx + sx * (bw / 2 - 8), yb + sh + 60, zc + 8], { material: "metal" }));
+ const front = k.part("Drawer front", [f.w, hi - lo - DGAP, DT], [f.x, (lo + hi) / 2, f.z]);
+ const c0: Vec3 = [cx, yb + 80, zc];
+ 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]];
+ };
+ const scene = "drawer";
+ k.step({ title: "Click the back onto the drawer sides", detail: "Each end of the back hooks into a side with a click.", kind: "drawer", scene, warnings: ["floor"] }, () => {
+ b.stagger(0.25);
+ for (const key of [...sides, back]) b.stage(key, rel(key), [0, 0, 0], [0, 0, -260]);
+ });
+ k.step({ title: "Slide the bottom in and screw it to the back", detail: "It runs in the grooves of the sides. One screw up through the bottom into the back.", kind: "drawer", tools: ["screwdriver"], scene }, () => {
+ b.stage(bottom, rel(bottom), [0, 0, 0], [0, 0, 420]);
+ b.then(0.1);
+ b.fit(SMALL, { on: bottom, at: [cx, yb, zc - dd / 2 + 10], dir: [0, 1, 0], mate: back });
+ });
+ const ff = [-1, 1].map((sx): Vec3 => [cx + sx * (bw / 2 - 8), yb + sh / 2, f.z - DT / 2]);
+ k.step({ title: "Screw the front fittings on and click the front onto the drawer", detail: "One fitting at each end of the back of the front, two screws each. Then push the drawer onto them until both click.", kind: "drawer", tools: ["screwdriver"], scene }, () => {
+ b.stage(front, rel(front), [0, 0, 0], [0, 0, 300]);
+ b.then(0.1);
+ k.fits(FRONT_FIT, ff.map((p) => ({ on: front, at: p, dir: [0, 0, 1] as Vec3, hole: false as const })));
+ k.fits(EURO, ff.flatMap((p) => [-1, 1].map((q) => ({ on: front, at: [p[0] + q * 12, p[1], p[2]] as Vec3, dir: [0, 0, 1] as Vec3 }))));
+ });
+ k.step({ title: "Click the gallery rails on", detail: "Left and right are marked. Each one clicks into the front and the back.", kind: "drawer", scene }, () => {
+ b.stagger(0.25);
+ for (const key of rails) b.stage(key, rel(key), [0, 0, 0], [0, 200, 0]);
+ });
+ const runner: HwDef = { kind: "runner", len: dd, dia: 20 };
+ const yr = yb + 4;
+ k.step({ title: "Screw the runner onto the post", detail: "Along the left of the opening, front end flush with the post, in the holes marked 3. One screw at each end.", kind: "runners", tools: ["screwdriver"] }, () => {
+ k.fits(runner, [{ on: c.post, at: [ox0, yr, zc], dir: [-1, 0, 0], hole: false }]);
+ k.fits(EURO, [D / 2 - 64, D / 2 - 20].map((z) => ({ on: c.post, at: [ox0 + 10, yr, z] as Vec3, dir: [-1, 0, 0] as Vec3 })));
+ });
+ k.step({ title: "Screw the other runner into the right side", detail: "At the same height, in the holes marked 3. One screw at the front and one at the back.", kind: "runners", tools: ["screwdriver"] }, () => {
+ k.fits(runner, [{ on: c.sideR, at: [ox1, yr, zc], dir: [1, 0, 0], hole: false }]);
+ k.fits(EURO, [zc - dd / 2 + 40, zc + dd / 2 - 30].map((z) => ({ on: c.sideR, at: [ox1 - 10, yr, z] as Vec3, dir: [1, 0, 0] as Vec3 })));
+ });
+ k.step({ title: "Put the drawer on the runners", detail: "Pull the runners out, rest the drawer on them and push it in until it clicks.", kind: "drawer" }, () => {
+ b.stagger(0);
+ for (const key of [front, ...sides, back, bottom, ...rails]) b.add(key, [0, 0, 520]);
+ });
+}
+
+/** UTRUSTA pull-out fitting: four pivot blocks on the right side, four arms, and two kidney trays that swing out with the door. */
+function blindPullOut(b: PlanBuilder, c: Blind) {
+ const { k, D } = c;
+ const ox1 = c.W / 2 - T;
+ const BLOCK: HwDef = { kind: "bracket", len: 60, dia: 40, name: "Pivot block" };
+ const POST: HwDef = { kind: "clip", len: 80, dia: 10, name: "Rim post" };
+ const JOIN: HwDef = { kind: "connector", len: 30, dia: 12, name: "Rim connector" };
+ const levels = [110, 430]; // the trays' undersides
+ const za = [D / 2 - 120, -60]; // the two arms of each tray
+ const L = 840, Wt = 400, TH = 10, RH = 80;
+ const cx = ox1 - 30 - L / 2;
+ // a kidney: rounded at both ends, pinched in at the front
+ const outline: [number, number][] = [[-L / 2, -Wt / 2], [L / 2, -Wt / 2], [L / 2, Wt / 2], [110, Wt / 2], [0, Wt / 2 - 70], [-110, Wt / 2], [-L / 2, Wt / 2]];
+ const segs = outline.map((p, i) => [p, outline[(i + 1) % outline.length]] as const);
+ const per = segs.map(([p, q]) => Math.hypot(q[0] - p[0], q[1] - p[1]));
+ const total = per.reduce((a, v) => a + v, 0);
+ const along = (t: number): [number, number] => {
+ let d = t * total;
+ for (let i = 0; i < segs.length; i++) {
+ if (d <= per[i]) {
+ const [p, q] = segs[i];
+ return [p[0] + ((q[0] - p[0]) * d) / per[i], p[1] + ((q[1] - p[1]) * d) / per[i]];
+ }
+ d -= per[i];
+ }
+ return outline[0];
+ };
+ const postsXZ = Array.from({ length: 12 }, (_, i) => along((i + 0.5) / 12)).map(([x, z]): [number, number] => [r1(x * 0.985), r1(z * 0.97)]);
+ const trays = levels.map((y) => {
+ const t = b.compound("Tray", [{ shape: "slab", size: [L, TH, Wt], pos: [cx, y + TH / 2, 0], outline, round: 90 }]);
+ const rimPieces: PartPiece[] = segs.map(([p, q], i) => ({
+ shape: "box",
+ size: [r1(per[i] + 4), RH, 4],
+ pos: [r1(cx + ((p[0] + q[0]) / 2) * 0.985), y + TH + RH / 2, r1(((p[1] + q[1]) / 2) * 0.97)],
+ rot: [0, -Math.atan2(q[1] - p[1], q[0] - p[0]), 0],
+ }));
+ const rm = b.compound("Tray rim", rimPieces);
+ return { y, tray: b.place(t.type, t.mid), rim: b.place(rm.type, rm.mid), mid: t.mid };
+ });
+ const arms = levels.flatMap((y) => za.map((z) => k.part("Swing arm", [300, 16, 16], [ox1 - 150, y - 12, z], { material: "metal" })));
+
+ k.step({ title: "Screw the four pivot blocks into the right side", detail: "Two at each tray height, in the holes the chart shows. Two screws each.", kind: "screws", tools: ["screwdriver"] }, () => {
+ const blocks = levels.flatMap((y) => za.map((z) => ({ on: c.sideR, at: [ox1, y - 12, z] as Vec3, dir: [1, 0, 0] as Vec3, hole: false as const })));
+ k.fits(BLOCK, blocks);
+ k.fits(EURO, blocks.flatMap((p) => [-20, 20].map((dz) => ({ on: c.sideR, at: [ox1 - 10, p.at[1], p.at[2] + dz] as Vec3, dir: [1, 0, 0] as Vec3 }))));
+ });
+ k.step({ title: "Hook the four arms into the blocks", detail: "Tilt each arm, hook its end into the block and swing it down level.", kind: "general" }, () => {
+ b.stagger(0.2);
+ for (const a of arms) b.add(a, [0, 180, 0]);
+ });
+ // both trays are built on the floor, side by side
+ const at = (i: number, key: string, lift = 0): Vec3 => {
+ const p = b.partItem(key).final.pos;
+ const m = trays[i];
+ return [p[0] - cx + (i - 0.5) * (L + 120), p[1] - m.y + lift, p[2]];
+ };
+ const scene = "trays";
+ k.step({ title: "Click twelve posts into each rim", detail: "Lay the rim strip out on the floor and push the posts into its slots, all the same way up.", kind: "general", scene, warnings: ["floor"] }, () => {
+ b.stagger(0.2);
+ trays.forEach((t, i) => b.stage(t.rim, at(i, t.rim, 200), [0, 0, 0], [0, 120, 0]));
+ b.then(0.1);
+ k.fits(POST, trays.flatMap((t) => postsXZ.map(([x, z]) => ({ on: t.rim, at: [cx + x, t.y + TH + RH, z] as Vec3, dir: [0, -1, 0] as Vec3, hole: false as const }))));
+ });
+ k.step({ title: "Join the ends of each rim", detail: "A connector over each joint, two for each rim, until the ends meet.", kind: "general", scene }, () => {
+ k.fits(JOIN, trays.flatMap((t) => [0.25, 0.75].map((q) => along(q)).map(([x, z]) => ({ on: t.rim, at: [r1(cx + x * 0.985), t.y + TH + RH / 2, r1(z * 0.97)] as Vec3, dir: [0, -1, 0] as Vec3, hole: false as const }))));
+ });
+ k.step({ title: "Press each rim onto its tray", detail: "All twelve posts into the holes round the edge of the tray.", kind: "general", scene }, () => {
+ b.stagger(0.2);
+ trays.forEach((t, i) => b.stage(t.tray, at(i, t.tray), [0, 0, 0], [0, 0, 260]));
+ b.then(0.1);
+ trays.forEach((t, i) => b.stage(t.rim, at(i, t.rim), [0, 0, 0]));
+ });
+ k.step({ title: "Screw the posts to the trays", detail: "Tip each tray up and drive a screw up through the tray into every post, twelve each.", kind: "screws", tools: ["screwdriver"], scene }, () => {
+ k.fits(SMALL, trays.flatMap((t) => postsXZ.map(([x, z]) => ({ on: t.tray, at: [cx + x, t.y, z] as Vec3, dir: [0, 1, 0] as Vec3, mate: t.rim }))));
+ });
+ k.step({ title: "Lower the trays onto the arms", detail: "Each tray's two sockets drop over the pins at the ends of its arms. The lower tray first. Swing them in and out to check.", kind: "general" }, () => {
+ b.stagger(0.4);
+ for (const t of trays) {
+ b.add(t.tray, [0, 260, 0]);
+ b.add(t.rim, [0, 260, 0]);
+ }
+ });
+}
+
+/** The door over the opening, on two UTRUSTA corner cabinet hinges whose plates go on the post. */
+function blindDoor(b: PlanBuilder, c: Blind, hi: number) {
+ const { k, xp } = c;
+ const f = blindFront(c);
+ const h = hi - DGAP;
+ const door = k.part("Door", [f.w, h, DT], [f.x, DGAP / 2 + h / 2, f.z]);
+ const ys = [100, h - 100].map((y) => Math.round(y + DGAP / 2));
+ const hx = f.x - f.w / 2 + 22;
+ k.step({ title: "Press the hinges into the door", detail: "Lay it face down on a rug, hinge holes towards the post side. Press each cup in and push the lever down to lock it.", kind: "hinges", scene: "doors", warnings: ["floor", "face"] }, () => {
+ b.stage(door, [0, DT / 2, 0], [Math.PI / 2, 0, 0]);
+ b.then(0.15);
+ k.fits(HW.hinge, ys.map((y) => ({ on: door, at: [hx, y, f.z - DT / 2] as Vec3, dir: [0, 0, 1] as Vec3 })));
+ });
+ k.step({ title: "Screw the mounting plates to the post", detail: "Into the holes on the opening side of the post, level with the hinges. Their screws come fitted.", kind: "hinges", tools: ["screwdriver"] }, () =>
+ k.fits(PLATE, ys.map((y) => ({ on: c.post, at: [xp + T, y, c.D / 2 - 37] as Vec3, dir: [-1, 0, 0] as Vec3 }))),
+ );
+ k.step({ title: "Clip the door onto the plates", detail: "Hook each hinge over its plate and press until it clicks. Turn the hinge screws until the gaps are even.", kind: "doors", tools: ["screwdriver"] }, () => b.add(door, [0, 0, 360]));
+}
+
const family: Family = {
names: ["SEKTION"],
build(b, s) {
+ if (/^sektion-corner-wall/.test(s.slug ?? "")) return cornerWall(b, s);
+ if (/^sektion-corner-base/.test(s.slug ?? "") && s.cabinet?.corner?.shape === "l") return cornerBaseL(b, s);
+ if (s.slug === "sektion-corner-base-cabinet-127-x-61-x-76") return cornerBlind(b, s);
+ if (s.slug === "sektion-corner-base-cab-w-drawer-and-shelf-127-x")
+ return cornerBlind(b, s, (c) => {
+ const split = Math.round((c.H * 2) / 3); // a 20" door under a 10" drawer front
+ blindShelf(b, c, Math.round(split / 2 / 32) * 32);
+ blindDrawer(b, c, split, c.H);
+ blindDoor(b, c, split);
+ });
+ if (s.slug === "sektion-corner-base-cab-w-pull-out-fitting-127-x")
+ return cornerBlind(b, s, (c) => {
+ blindPullOut(b, c);
+ blindDoor(b, c, c.H);
+ });
if (build(b, s)) return true;
const L = layoutOf(s);
if (!L) return false;
diff --git a/src/lib/plan/families/sigfinn.ts b/src/lib/plan/families/sigfinn.ts
new file mode 100644
index 0000000..aaf734a
--- /dev/null
+++ b/src/lib/plan/families/sigfinn.ts
@@ -0,0 +1,30 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec } from "../../types";
+
+/*
+ * SIGFINN monitor stand, fixed height. It is one bent bamboo-veneer board, sold ready to use with no assembly manual
+ * (the page lists none), so the guide only unpacks it and sets it on the desk. IKEA's sizes: 53 long, 24 deep, 10 high.
+ */
+
+function recipe(s: ProductSpec): CustomParams {
+ const L = 530, D = 240, H = 100, T = 12;
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [L - 2 * T, T, D], pos: [0, H - T / 2, 0], material: "wood" },
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [T, H, D], pos: [g * (L / 2 - T / 2), H / 2, 0], material: "wood" })),
+ ];
+ return {
+ parts: [{ id: "S", name: "Monitor stand", size: [L, H, D], pos: [0, H / 2, 0], material: "wood", pieces }],
+ steps: [
+ { title: "Take the stand out of its wrapping", detail: "It comes in one piece, ready to use: there is nothing to put together.", add: ["S"], from: { S: [0, 200, 0] } },
+ { title: "Set it on your desk", detail: "Centre it under the monitor. Keep its feet on a flat surface." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["SIGFINN"],
+ recipe(s) {
+ return /^sigfinn-monitor-stand-fixed-height/.test(s.slug ?? "") ? recipe(s) : null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/skalsta.ts b/src/lib/plan/families/skalsta.ts
index ecb887a..a63e871 100644
--- a/src/lib/plan/families/skalsta.ts
+++ b/src/lib/plan/families/skalsta.ts
@@ -147,7 +147,7 @@ function table(s: ProductSpec): CustomParams {
title: "Slot the leg bars together into two Xs",
detail: "Lay them flat. Push the notches into each other, then turn one bolt into each crossing with the Allen key.",
add: ["A0", "B0", "A1", "B1"],
- fix: ends.map((ex, i) => fx("bolt", [[ex * xl - bt / 2, crossY, 0]], { len: 40, dia: 6, dir: [ex, 0, 0], on: `A${i}`, mate: `B${i}` })),
+ fix: ends.map((ex, i) => fx("bolt", [[ex * (xl - bt / 2), crossY, 0]], { len: 40, dia: 6, dir: [ex, 0, 0], on: `A${i}`, mate: `B${i}` })),
tools: ["allen"],
pose: "+x",
},
diff --git a/src/lib/plan/families/skansnas.ts b/src/lib/plan/families/skansnas.ts
index 564ed1a..ded2eea 100644
--- a/src/lib/plan/families/skansnas.ts
+++ b/src/lib/plan/families/skansnas.ts
@@ -79,7 +79,11 @@ function table(s: ProductSpec): CustomParams {
];
const slideScrews = [-1, 1].flatMap((gz) => [-1, 1].flatMap((g) => [0.2, 0.5, 0.8].map((t): Vec3 => [g * t * (lx - LG / 2 - 20), U - 4, gz * sz])));
const plateAt = pairs((g, gz): Vec3 => [g * (fx - 40), U - 5 - FH, gz * (fz - 40)]);
- const plateScrews = plateAt.flatMap(([x, y, z]): Vec3[] => [[x - Math.sign(x) * 25, y, z], [x, y, z - Math.sign(z) * 25], [x + Math.sign(x) * 10, y, z + Math.sign(z) * 10]]);
+ // the plate spans the inside corner: one screw up into the side, one into the end, one where they meet
+ const plateScrews = plateAt.flatMap(([x, y, z]): Vec3[] => {
+ const g = Math.sign(x), gz = Math.sign(z);
+ return [[g * (fx - 50), y, gz * fz], [g * (fx - 9), y, gz * (fz - 50)], [g * (fx - 9), y, gz * (fz - 9)]];
+ });
const frameScrews = [-1, 1].flatMap((gz) => [-200, -120, 120, 200].map((x): Vec3 => [x, fy, gz * (fz + 9)]));
const pinAt: Vec3[] = [-1, 1].flatMap((g) => [-1, 1].map((gz): Vec3 => [g * 50, U, gz * W * 0.22]));
const pinScrews = pinAt.flatMap(([x, y, z]): Vec3[] => [[x + Math.sign(x) * 25, y, z], [x + Math.sign(x) * 45, y, z]]);
@@ -97,10 +101,10 @@ function table(s: ProductSpec): CustomParams {
title: "Screw a corner bracket to each side apron",
detail: "At the end of the apron that meets a leg. Use the round-headed screws, not the short flat ones.",
add: ["S00", "S01", "S10", "S11"],
- fix: [at("angle", bracketAt, [0, 1, 0], { name: "Corner bracket", len: 60, dia: 40 }), at("screw", sideBracketScrews, [0, 0, 1], { len: 16, dia: 5 })],
+ fix: [at("angle", bracketAt, [0, 1, 0], { name: "Corner bracket", len: 60, dia: 40 }), ...[-1, 1].map((gz) => at("screw", sideBracketScrews.filter((p) => Math.sign(p[2]) === gz), [0, 0, gz], { len: 16, dia: 5 }))],
tools: ["screwdriver"],
},
- { title: "Screw the end aprons to the brackets", detail: "One at the round end of each half, two screws into each bracket.", add: ["E0", "E1"], fix: [at("screw", endBracketScrews, [1, 0, 0], { len: 16, dia: 5 })], tools: ["screwdriver"] },
+ { title: "Screw the end aprons to the brackets", detail: "One at the round end of each half, two screws into each bracket.", add: ["E0", "E1"], fix: [-1, 1].map((g) => at("screw", endBracketScrews.filter((p) => Math.sign(p[0]) === g), [g, 0, 0], { len: 16, dia: 5 })), tools: ["screwdriver"] },
{ title: "Fix the aprons to the top", detail: "One long screw through each apron into the top, three on each half. Stop when the head sits flush.", fix: [at("screw", apronScrews(1), [0, 1, 0], { len: 95, dia: 5 })], tools: ["screwdriver"] },
{ title: "Drive in the other long screws", detail: "Two more in every apron, twelve in all. Then tighten all eighteen, without sinking the heads.", fix: [at("screw", apronScrews(2), [0, 1, 0], { len: 95, dia: 5 })], tools: ["screwdriver"] },
{
@@ -215,7 +219,8 @@ function chair(): CustomParams {
];
const nut = (g: number, z: number, on: string) => at("nut", [nutAt(g, z)], [-g, 0, 0], { name: "Connector nut", len: 20, dia: 20, on });
const pads: Vec3[] = [-1, 1].flatMap((g) => [610, 720].map((y): Vec3 => [g * x, y, zbAt(y) + LS / 2]));
- const bracketAt: Vec3[] = [[0, R1, railZ1 - RT - 4], [-(inner - RT - 4), R1, 20], [inner - RT - 4, R1, 20]];
+ // each bracket stands against the inside of a rail: the front one on the front frame's rail, the others on the side rails
+ const bracketAt: Vec3[] = [[0, R1, zf - RT / 2 - 3], [-(x - RT / 2 - 3), R1, 20], [x - RT / 2 - 3, R1, 20]];
const steps: CustomStep[] = [
{ title: "Stick the felt pads on the back legs", detail: "Two on the front of each back leg, between the pins, where the backrest will rest.", add: ["BF"], fix: [at("glide", pads, [0, 0, -1], { name: "Felt pad", len: 2, dia: 16 })], warnings: ["floor"] },
{
@@ -239,7 +244,8 @@ function chair(): CustomParams {
{
title: "Drive the two long screws in at the back",
detail: "Turn the chair upside down on a covered table. One screw through each end of the back rail into the leg.",
- fix: [at("screw", [-1, 1].map((g): Vec3 => [g * (inner - 30), ry, zbAt(ry) + RT / 2]), [0, 0, -1], { len: 50, dia: 5 })],
+ // in at an angle from the inside of the back rail, through its end into the leg
+ fix: [-1, 1].map((g) => at("screw", [[g * (inner - 30), ry, zbAt(ry)]], [g, 0, 0], { len: 50, dia: 5 })),
tools: ["screwdriver"],
pose: "-y",
},
@@ -247,13 +253,13 @@ function chair(): CustomParams {
title: "Screw the three brackets onto the seat",
detail: "Lay the seat face down beside the chair. One bracket at the front and one on each side, one screw each.",
add: ["ST"],
- fix: [at("angle", bracketAt, [0, 1, 0], { name: "Seat bracket", len: 40, dia: 20 }), at("screw", bracketAt.map(([a, , c]): Vec3 => [a, R1, c]), [0, 1, 0], { len: 12, dia: 4 })],
+ fix: [at("angle", bracketAt, [0, 1, 0], { name: "Seat bracket", len: 40, dia: 20 }), at("screw", bracketAt.map(([a, , c]): Vec3 => (a === 0 ? [24, R1, c] : [a, R1, c + 24])), [0, 1, 0], { len: 12, dia: 4 })],
tools: ["screwdriver"],
from: { ST: [0, -260, 0] },
},
{ title: "Lower the chair onto the seat", detail: "Line it up so each bracket sits against the inside of a rail." },
- { title: "Screw the side brackets to the rails", detail: "One screw through each side bracket into the rail.", fix: [-1, 1].map((g) => at("screw", [[g * (inner - RT), R1 - 18, 20]], [g, 0, 0], { len: 14, dia: 4 })), tools: ["screwdriver"] },
- { title: "Screw the front bracket to the front rail", detail: "The last screw. Then turn the chair over and stand it up.", fix: [at("screw", [[0, R1 - 18, railZ1 - RT]], [0, 0, 1], { len: 14, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Screw the side brackets to the rails", detail: "One screw through each side bracket into the rail.", fix: [-1, 1].map((g) => at("screw", [[g * (x - RT / 2 - 3), R1 - 26, 20]], [g, 0, 0], { len: 14, dia: 4 })), tools: ["screwdriver"] },
+ { title: "Screw the front bracket to the front rail", detail: "The last screw. Then turn the chair over and stand it up.", fix: [at("screw", [[0, R1 - 26, zf - RT / 2 - 3]], [0, 0, 1], { len: 14, dia: 4 })], tools: ["screwdriver"] },
{ title: "Stand the chair up", detail: "Check it stands steady on all four legs.", pose: "+y" },
];
return { parts, steps };
diff --git a/src/lib/plan/families/skarpo.ts b/src/lib/plan/families/skarpo.ts
new file mode 100644
index 0000000..2a411a2
--- /dev/null
+++ b/src/lib/plan/families/skarpo.ts
@@ -0,0 +1,64 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * SKARPÖ is moulded in one piece of plastic and has no assembly manual: there is nothing to put together. The guide
+ * only sets it down, and shows that they stack.
+ */
+
+function armchair(s: ProductSpec): CustomParams {
+ // IKEA: 81 wide, 79 deep, 71 high, seat 53 x 49 at 37
+ const W = Math.round(s.size.w * 10) || 810, D = Math.round(s.size.d * 10) || 790, H = Math.round(s.size.h * 10) || 710;
+ const ys = 370, sw = 530, sd = 490, th = 40;
+ const c: Vec3 = [0, H / 2, 0];
+ const p = (size: Vec3, at: Vec3, rot?: Vec3): PartPiece => ({ shape: "box", size, pos: [at[0] - c[0], at[1] - c[1], at[2] - c[2]], ...(rot ? { rot } : {}) });
+ const zs = D / 2 - sd / 2 - 20; // the seat sits to the front
+ // the tub: a back wall curving round from arm to arm, the seat shell inside it, rounded arm tops, four legs
+ const R = W / 2 - th / 2; // the tub's radius in plan
+ const zc = D / 2 - R - 10; // its centre, behind the seat's front
+ const arc = Array.from({ length: 9 }, (_, k) => {
+ const a = Math.PI * (k / 8); // from the left arm round the back to the right arm
+ const x = -Math.cos(a) * R, z = zc - Math.sin(a) * R * 0.9;
+ const seg = (Math.PI * R * 0.95) / 8 + 30;
+ const yTop = ys + 190 + (H - ys - 190) * Math.sin(a);
+ return p([seg, yTop - ys + 60, th], [x, (yTop + ys - 60) / 2, z], [0, Math.PI / 2 - a, 0]);
+ });
+ const pieces: PartPiece[] = [
+ p([sw, th, sd], [0, ys - th / 2, zs]),
+ ...arc,
+ // the arms run forward from the tub's ends, rounded on top
+ ...[-1, 1].flatMap((sx): PartPiece[] => [
+ p([th, 250, D / 2 - zc + 10], [sx * R, ys + 65, (zc + D / 2) / 2]),
+ { ...p([th + 30, D / 2 - zc + 10, th + 30], [sx * R, ys + 190, (zc + D / 2) / 2], [Math.PI / 2, 0, 0]), shape: "cyl" },
+ ]),
+ // four short splayed legs under the corners
+ ...[-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz) => p([80, ys - 40, 80], [sx * (W / 2 - 110), (ys - 40) / 2, sz * (D / 2 - 120)], [sz * -0.12, 0, sx * 0.12])),
+ ),
+ ];
+ const parts: CustomPart[] = [{ id: "A", name: "Armchair", size: [W, H, D], pos: c, pieces, material: "board" }];
+ return {
+ parts,
+ steps: [
+ {
+ title: "Lift the armchair out and set it down",
+ detail: "It's moulded in one piece, so there is nothing to put together. Stand it on level ground; the hole in the seat lets rain drain away.",
+ add: ["A"],
+ from: { A: [0, 200, 0] },
+ },
+ {
+ title: "Stack them when you don't need them",
+ detail: "Lift one chair straight down onto another, seat on seat.",
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["SKARPÖ", "SKARPO"],
+ recipe(s) {
+ if (/^skarpo-armchair/.test(s.slug ?? "")) return armchair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/slakt.ts b/src/lib/plan/families/slakt.ts
index 0e69ab3..53a09ba 100644
--- a/src/lib/plan/families/slakt.ts
+++ b/src/lib/plan/families/slakt.ts
@@ -67,7 +67,7 @@ function bedFrame(head = 780, foot = 570): Bed {
box("RR", "Side rail", [W / 2 - t, W / 2, ry0, ry1, -zi, zi]),
box("SL", "Slat rail", [-W / 2 + t, -W / 2 + t + 25, sy0, sy1, -zi + 15, zi - 15], "metal"),
box("SR", "Slat rail", [W / 2 - t - 25, W / 2 - t, sy0, sy1, -zi + 15, zi - 15], "metal"),
- ...[-330, 330].map((z, i) => box(`ST${i}`, "Centre strap", [-W / 2 + t + 25, W / 2 - t - 25, sy1, sy1 + 4, z - 20, z + 20], "metal")),
+ ...[-330, 330].map((z, i) => box(`ST${i}`, "Centre strap", [-W / 2 + t + 25, W / 2 - t - 25, sy1 - 10, sy1 + 4, z - 20, z + 20], "metal")),
compound("SB", "Slatted bed base", spread(-zi + 40, zi - 40, 17).map((z) => pc([-W / 2 + t + 6, W / 2 - t - 6, sy1 + 4, sy1 + 19, z - 30, z + 30])), "wood"),
];
const ends: [string, number][] = [["H", -1], ["F", 1]];
@@ -244,9 +244,10 @@ function storageBox(i: number, zc: number, x0: number): { parts: CustomPart[]; g
title: "Fit the stabiliser bar and the castor bracket",
detail: "The bar goes across the back between the runners, two screws; the bracket under the middle of the front, two screws and one small one.",
fix: [
- fx("stud", [[x0 + 50, cz + 45, z0 + 45]], [0, 0, -1], { len: D - 90, dia: 10, name: "Stabiliser bar", on: id("DB") }),
+ // the bar runs across under the drawer; a screw at each end goes up into a drawer side
+ fx("stud", [[x0 + 50, cz + 34, z0 + 37]], [0, 0, 1], { len: D - 74, dia: 12, name: "Stabiliser bar", on: id("DB") }),
fx("plate", [[x1 - 40, cz + 40, zc]], UP, { len: 60, dia: 40, name: "Castor bracket", on: id("DB") }),
- fx("screw", [[x0 + 50, cz + 40, z0 + 60], [x0 + 50, cz + 40, z1 - 60], [x1 - 40, cz + 40, zc - 25], [x1 - 40, cz + 40, zc + 25]], UP, { len: 10, dia: 5, on: id("DB") }),
+ fx("screw", [[x0 + 74, cz + 36, z0 + 37], [x0 + 74, cz + 36, z1 - 37], [x1 - 40, cz + 40, zc - 25], [x1 - 40, cz + 40, zc + 25]], UP, { len: 10, dia: 5, on: id("DB") }),
fx("screw", [[x1 - 10, cz + 40, zc]], UP, { len: 16, dia: 3.5, on: id("DB") }),
],
kind: "screws",
@@ -260,9 +261,9 @@ function storageBox(i: number, zc: number, x0: number): { parts: CustomPart[]; g
}
/** One step for a whole group of steps: the parts and fittings of a box built the same way as the first. */
-function merged(title: string, detail: string, list: CustomStep[]): CustomStep {
+function merged(title: string, detail: string, list: CustomStep[], from?: CustomStep["from"]): CustomStep {
const tools = [...new Set(list.flatMap((s) => s.tools ?? []))];
- return { title, detail, add: list.flatMap((s) => s.add ?? []), fix: list.flatMap((s) => s.fix ?? []), kind: "join", tools };
+ return { title, detail, add: list.flatMap((s) => s.add ?? []), fix: list.flatMap((s) => s.fix ?? []), kind: "join", tools, ...(from ? { from } : {}) };
}
function withBoxes(): CustomParams {
@@ -284,7 +285,8 @@ function withBoxes(): CustomParams {
merged(`Get the ${o} box's bottom ready the same way`, "Four castor sockets and twelve dowels.", b.groups[0]),
merged(`Stand its sides on and slide in the back`, "Cam bolts, dowels and a runner on each side first, then the four cam locks.", b.groups[1]),
merged(`Fit its top and castors`, "The top on its cam bolts, then turn the box over and click in the four castors.", b.groups[2]),
- merged(`Build the ${o} box's drawer`, "The sides, back and bottom, then the front on its cam bolts.", b.groups[3]),
+ // the sides come in from the back, along the dowels that join them to the front
+ merged(`Build the ${o} box's drawer`, "The sides, back and bottom, then the front on its cam bolts.", b.groups[3], { [`X${i}DS1`]: [-300, 0, 0], [`X${i}DS2`]: [-300, 0, 0] }),
merged(`Fit its runners, bar and castor, and slide it in`, "The same way as the first drawer.", b.groups[4]),
);
}
@@ -339,9 +341,9 @@ function storageBed(twin: boolean, padTop: number): CustomParams {
const parts: CustomPart[] = [
box("SBt", "Shelf unit bottom", [dx0, xf, 25, 43, -zi, zs]),
box("SBk", "Shelf unit back", [dx0 - t, dx0, 25, uy - 25, -zi, zs]),
- box("D0", "Divider", [dx0 - t, xf, 25, uy - 25, zs, zs + t]),
+ box("D0", "Divider", [dx0 - t, W / 2, 25, ry0, zs, zs + t]), // the front side rail sits on the dividers
box("U1", "Bottom rail", [xf - 80, xf, 0, 25, -zi, zi]),
- box("D1", "Divider", [dx0 - t, xf, 25, uy - 25, zm - t / 2, zm + t / 2]),
+ box("D1", "Divider", [dx0 - t, W / 2, 25, ry0, zm - t / 2, zm + t / 2]),
box("U4", "Middle rail", [dx0 - t - 60, dx0 - t, uy - 80, uy - 50, zs + t, zi]),
box("U2", "Bottom rail", [xb, xb + 80, 0, 25, -zi, zi]),
box("U3", "Top rail", [xb, xb + 80, uy - 25, uy, -zi, zi]),
@@ -379,6 +381,9 @@ function storageBed(twin: boolean, padTop: number): CustomParams {
const dpts = (zc: number) => [dx0 + 80, xf - 80].map((x): Vec3 => [x, 25, zc]); // where a divider meets a rail below it
const endPts = (z: number, ys = [80, 220]) => ys.map((y): Vec3 => [mid(dx0, xf), y, z]);
const runnersAt = cols.flatMap(([z0, z1]) => rows.flatMap(([y0]) => [z0, z1].map((z): Vec3 => [mid(dx0, xf), y0 + 30, z])));
+ // three screws through each runner into the wall of the bay it lines: a divider, or the footboard at the far end
+ const bayScrews = cols.flatMap(([z0, z1]) => ([[z0, -1], [z1, 1]] as const).map(([z, g]) =>
+ fx("screw", rows.flatMap(([y0]) => [-200, 30, 200].map((dxs): Vec3 => [mid(dx0, xf) + dxs, y0 + 30, z - g * 2])), [0, 0, g], { len: 12, dia: 4, on: z === zi ? "F" : Math.abs(z - zm) < t ? "D1" : "D0" })));
const sideBolts = (end: string, e: number): CustomFix[] => [
...(["RB", "RF"] as const).map((id, i) => fx(BARREL.kind, [375, 405].map((y): Vec3 => [i ? xf : xb, y, e * (zi - 50)]), [i ? 1 : -1, 0, 0], { ...BARREL, on: id })),
...(["RB", "RF"] as const).map((id, i) => fx(BOLT.kind, [375, 405].map((y): Vec3 => [i ? xf + t / 2 : xb - t / 2, y, e * (L / 2)]), [0, 0, -e], { ...BOLT, on: end, mate: id })),
@@ -413,14 +418,14 @@ function storageBed(twin: boolean, padTop: number): CustomParams {
},
{ title: "Screw the connecting pins into the top rail", detail: "Four pins along the back top rail, and four cam locks in the back side rail above them.", fix: [fx("stud", spread(-zi + 300, zi - 300, 4).map((z): Vec3 => [xb + 40, uy, z]), DOWN, { len: 60, dia: 8, name: "Connecting pin", on: "U3", mate: "RB" }), fx(CAM.kind, spread(-zi + 300, zi - 300, 4).map((z): Vec3 => [xb, uy + 30, z]), [1, 0, 0], { ...CAM, on: "RB" })], kind: "cams", tools: ["screwdriver"] },
{ title: "Lock the back side rail onto the pins", detail: "Lower it on, then turn the four cam locks. Four more cam locks go in the front side rail.", fix: [fx(CAM.kind, spread(-zi + 300, zi - 300, 4).map((z): Vec3 => [xf, uy + 30, z]), [-1, 0, 0], { ...CAM, on: "RF" })], kind: "cams", tools: ["screwdriver"] },
- { title: "Tap dowels into the front side rail", detail: "Four along its bottom edge, where it sits on the dividers.", fix: [fx(DOWEL.kind, [[xf + 9, ry0, zs + 9], [xf + 9, ry0, zm], [xf + 9, ry0, -zi + 100], [xf + 9, ry0, zi - 100]], UP, { ...DOWEL, on: "RF", mate: "D0" })], kind: "dowels", tools: [] },
+ { title: "Tap dowels into the front side rail", detail: "Into its bottom edge, where it sits on the dividers.", fix: [fx(DOWEL.kind, [[xf + 9, ry0, zs + 9]], UP, { ...DOWEL, on: "RF", mate: "D0" }), fx(DOWEL.kind, [[xf + 9, ry0, zm]], UP, { ...DOWEL, on: "RF", mate: "D1" })], kind: "dowels", tools: [] },
{ title: "Fit the front side rail", detail: "Lay it on the dividers' dowels, turn one cam lock and tap in two more dowels.", fix: [fx(CAM.kind, [[xf - 40, uy - 40, zs - 30]], [1, 0, 0], { ...CAM, on: "D0" }), fx(DOWEL.kind, [[xf + 9, ry1, -zi + 60], [xf + 9, ry1, zi - 60]], DOWN, { ...DOWEL, on: "RF" })], kind: "dowels", tools: ["screwdriver"] },
{ title: "Bolt the side rails to the headboard", detail: "A barrel nut in each hole inside the rails, slot facing the bolt, then the long bolts through the headboard with the hex key.", fix: sideBolts("H", -1), kind: "bolts", tools: ["allen", "flathead"] },
{ title: "Turn the last cam locks along the rails", detail: "Two at the middle divider, then two dowels into the rails' foot ends.", fix: [fx(CAM.kind, [[xf - 40, 25, zm - 60], [xb + 40, uy - 25, zm + 60]], [0, 0, 0], { ...CAM, on: "D1" }), fx(DOWEL.kind, [[xf - 40, 12, zi], [xb + 40, 12, zi]], [0, 0, -1], { ...DOWEL, on: "U1", mate: "F" })], kind: "cams", tools: ["screwdriver"] },
{ title: "Stand the footboard against the foot end", detail: "Three cam bolts into its inner face and two caps under it first, on a rug. Two glides go under the rails' foot ends.", add: ["F"], fix: [fx(CAMBOLT.kind, [[xf - 40, 12, zi], [xb + 40, 12, zi], [xb + 40, uy - 12, zi]], [0, 0, 1], { ...CAMBOLT, on: "F", mate: "U1" }), fx(CAP.kind, both.map((s): Vec3 => [s * (W / 2 - 80), 0, L / 2 - t / 2]), UP, { ...CAP, on: "F" }), fx(GLIDE.kind, [[xf - 40, 0, 0], [xb + 40, 0, 0]], UP, { ...GLIDE })], kind: "join", tools: ["hammer"] },
{ title: "Turn the three cam locks at the footboard", fix: [fx(CAM.kind, [[xf - 40, 25, zi - 40], [xb + 40, 25, zi - 40], [xb + 40, uy - 25, zi - 40]], [0, 0, 0], { ...CAM, on: "U1" })], kind: "cams", tools: ["screwdriver"] },
{ title: "Bolt the side rails to the footboard", detail: "Barrel nuts in the rails, long bolts through the footboard.", fix: sideBolts("F", 1), kind: "bolts", tools: ["allen", "flathead"] },
- { title: "Screw the drawer runners into the bays", detail: "Eight runners, one each side of every drawer, three screws each. Left and right ones are marked.", fix: [fx("runner", runnersAt, [0, 0, 1], { len: 520, dia: 30, name: "Drawer runner", on: "D1", twist: Math.PI / 2 }), fx("screw", runnersAt.flatMap((p) => [-1, 0, 1].map((k): Vec3 => [p[0] + k * 180, p[1], p[2]])), [0, 0, 1], { len: 12, dia: 4, on: "D1" })], kind: "runners", tools: ["screwdriver"] },
+ { title: "Screw the drawer runners into the bays", detail: "Eight runners, one each side of every drawer, three screws each. Left and right ones are marked.", fix: [fx("runner", runnersAt, [0, 0, 1], { len: 520, dia: 30, name: "Drawer runner", on: "D1", twist: Math.PI / 2 }), ...bayScrews], kind: "runners", tools: ["screwdriver"] },
{
title: "Build the four drawers and slide them in",
detail: "Each one: dowels and ribbed pins join the sides and back, the bottom slides in, the front goes on four cam bolts with four cam locks, then its runners (six screws) and the stabiliser bar (two screws). Push it in on the runners.",
@@ -430,9 +435,10 @@ function storageBed(twin: boolean, padTop: number): CustomParams {
fx("nail", drawerPts((zc, y0, y1, z0, z1) => [z0 + 22, z1 - 22].flatMap((z) => [y0 + 60, y1 - 50].map((y): Vec3 => [dx0 + 30, y, z]))), [0, 0, 1], { len: 30, dia: 4, name: "Ribbed pin" }),
fx(CAMBOLT.kind, drawerPts((zc, y0, y1, z0, z1) => [z0 + 22, z1 - 22].flatMap((z) => [y0 + 40, y1 - 40].map((y): Vec3 => [xf, y, z]))), [1, 0, 0], { ...CAMBOLT }),
fx(CAM.kind, drawerPts((zc, y0, y1, z0, z1) => [z0 + 22, z1 - 22].flatMap((z) => [y0 + 40, y1 - 40].map((y): Vec3 => [xf - 40, y, z]))), [0, 0, 1], { kind: "cam", len: 13, dia: 15 }),
- fx("screw", drawerPts((zc, y0, y1, z0, z1) => [z0 + 22, z1 - 22].flatMap((z) => [-1, 0, 1].map((k): Vec3 => [mid(dx0, xf) + k * 180, y0 + 30, z]))), [0, 0, 1], { len: 12, dia: 4 }),
- fx("stud", drawerPts((zc, y0, y1, z0) => [[dx0 + 40, y0 + 26, z0 + 30]]), [0, 0, -1], { len: cols[0][1] - cols[0][0] - 60, dia: 10, name: "Stabiliser bar" }),
- fx("screw", drawerPts((zc, y0, y1, z0, z1) => [[dx0 + 40, y0 + 22, z0 + 50], [dx0 + 40, y0 + 22, z1 - 50]]), UP, { len: 10, dia: 5 }),
+ // the drawer's runners and its stabiliser bar screw up into the bottom edges of its sides
+ fx("screw", drawerPts((zc, y0, y1, z0, z1) => [z0 + 22, z1 - 22].flatMap((z) => [-1, 0, 1].map((k): Vec3 => [mid(dx0, xf) + k * 180, y0 + 16, z]))), UP, { len: 12, dia: 4 }),
+ fx("stud", drawerPts((zc, y0, y1, z0) => [[dx0 + 40, y0 + 14, z0 + 22]]), [0, 0, 1], { len: cols[0][1] - cols[0][0] - 50, dia: 12, name: "Stabiliser bar" }),
+ fx("screw", drawerPts((zc, y0, y1, z0, z1) => [[dx0 + 64, y0 + 16, z0 + 22], [dx0 + 64, y0 + 16, z1 - 22]]), UP, { len: 10, dia: 5 }),
],
from: Object.fromEntries(drawers.map((d) => [d, [700, 0, 0] as Vec3])),
kind: "drawer",
diff --git a/src/lib/plan/families/slattum.ts b/src/lib/plan/families/slattum.ts
index b8c1733..5858921 100644
--- a/src/lib/plan/families/slattum.ts
+++ b/src/lib/plan/families/slattum.ts
@@ -21,7 +21,7 @@ const BOLT: HwDef = { kind: "bolt", len: 50, dia: 6 };
const BOLT_M: HwDef = { kind: "bolt", len: 35, dia: 6 };
const BOLT_S: HwDef = { kind: "bolt", len: 15, dia: 6 };
const HOLDER: HwDef = { kind: "cap", len: 18, dia: 22, name: "Slat holder" };
-const SPACER: HwDef = { kind: "spacer", len: 50, dia: 25, name: "Spacer tube" };
+const SPACER: HwDef = { kind: "spacer", len: 25, dia: 25, name: "Spacer tube" };
interface StepIn {
title: string;
@@ -124,7 +124,7 @@ function build(b: PlanBuilder, s: ProductSpec) {
const xr = W / 2 - 55; // rails and legs
const yr = 300; // rail centre
const S = 30; // rail tube
- const yMid = 220; // the crossbar's lowered middle
+ const yMid = yr - S - SPACER.len; // the crossbar's lowered middle, a spacer's length under the centre beam
k.part("HB", "Headboard", [W, 850 - yb, T], [0, (850 + yb) / 2, -L / 2 + T / 2], { mat: "soft" });
k.part("FB", "Footboard", [W, 400 - yb, T], [0, (400 + yb) / 2, L / 2 - T / 2], { mat: "soft" });
diff --git a/src/lib/plan/families/smagora.ts b/src/lib/plan/families/smagora.ts
index 34d7ce1..ffa7a83 100644
--- a/src/lib/plan/families/smagora.ts
+++ b/src/lib/plan/families/smagora.ts
@@ -297,7 +297,7 @@ function wardrobe(s: ProductSpec): CustomParams {
title: "Fit the knobs and the door buffers",
detail: "A knob on each door near the middle, screwed from inside. Then press the four buffers in where the doors close.",
fix: [
- ...sx2.map((k) => fx({ kind: "knob", at: [[k * 60, dy + 60, zF]], dir: [0, 0, -1], on: k < 0 ? "DL" : "DR" })),
+ ...sx2.map((k) => fx({ kind: "knob", at: [[k * 60, dy + 60, zF + 6]], dir: [0, 0, -1], on: k < 0 ? "DL" : "DR" })),
fx({ kind: "screw", len: 30, dia: 4, at: sx2.map((k) => [k * 60, dy + 60, zF - T] as Vec3), dir: [0, 0, 1] }),
fx({ kind: "glide", name: "Door buffer", len: 3, dia: 10, at: [yBot + T / 2, yTop - T / 2].flatMap((y) => sx2.map((k) => [k * (iw / 2 - 40), y, zF - T - 4] as Vec3)), dir: [0, 0, -1] }),
],
@@ -413,8 +413,9 @@ function cot(c: Cot): CustomParams {
title: "Screw on the side locks",
detail: "One at each end of the bottom rails, through the lock into the post.",
fix: sx2.flatMap((k) => [
- fx({ kind: "clip", name: "Side lock", len: 20, dia: 16, at: sx2.map((e) => [e * (Lin / 2 - 30), yR0 + 30, k * (zr + 12)] as Vec3), dir: [0, 0, -k], on: k < 0 ? "S1" : "S2" }),
- fx({ kind: "screw", len: 16, dia: 4, at: sx2.map((e) => [e * (Lin / 2 - 30), yR0 + 30, k * (zr + 14)] as Vec3), dir: [0, 0, -k], on: k < 0 ? "S1" : "S2" }),
+ // on the outside of the bottom rail: the lock, and its screw beside it into the rail
+ fx({ kind: "clip", name: "Side lock", len: 20, dia: 16, at: sx2.map((e) => [e * (Lin / 2 - 42), yR0 - 8, k * (zr + 12)] as Vec3), dir: [0, 0, -k], on: k < 0 ? "S1" : "S2" }),
+ fx({ kind: "screw", len: 16, dia: 4, at: sx2.map((e) => [e * (Lin / 2 - 20), yR0 + 8, k * (zr + 14)] as Vec3), dir: [0, 0, -k], on: k < 0 ? "S1" : "S2" }),
]),
tools: ["screwdriver"],
},
@@ -517,7 +518,7 @@ function deskTop(b: PlanBuilder, s: ProductSpec) {
b.step({ title: "Fit the end pieces", detail: "Two dowels into each end of the upstand, then push an end piece onto each.", scene: "top", kind: "dowels", tools: ["hammer"] }, () => {
b.fits(HW.dowel, sx2.flatMap((k) => [yU - 40, yU + 30].map((y): FitOpts => ({ on: board, at: [k * (W / 2 - T), y, -D / 2 + T / 2], dir: [-k, 0, 0], mate: ends[k < 0 ? 0 : 1] }))), 0.08);
b.then(0.15);
- for (const e of ends) stage(e, [0, 0, 200]);
+ ends.forEach((e, i) => stage(e, [sx2[i] * 200, 0, 0])); // along the dowels
});
b.step({ title: "Lock the end pieces", detail: "One cam lock in each, arrow towards the bolt, then clockwise.", scene: "top", kind: "cams", tools: ["screwdriver"] }, () => {
b.fits(HW.cam, sx2.map((k): FitOpts => ({ on: ends[k < 0 ? 0 : 1], at: [k * (W / 2 - T), yU, -D / 2 + T + 30], dir: [k, 0, 0] })), 0.1);
@@ -567,12 +568,13 @@ function deskTop(b: PlanBuilder, s: ProductSpec) {
/** The changing table: a bookshelf built lying on a side, then a tray with rims screwed together and bolted on top. */
function changingTable(s: ProductSpec): CustomParams {
// IKEA: 60 wide, 81 deep and 103 high with the tray; the bookshelf alone is 40 deep and 90 high
- const W = s.size.w * 10 || 600, T = 16, G = 3;
+ const W = Math.min(s.size.w, s.size.d) * 10 || 600, T = 16, G = 3; // the catalog has 81 as the width; it is the depth
const Hb = 900, z0 = -405, z1 = z0 + 400; // the bookshelf stands against the wall, the tray reaches forward
const xs = W / 2 - T / 2, xi = W / 2 - T;
const yBot = 80, ySh = 480, yTop = Hb - T;
- const yF = 960, yR = 1030; // tray floor and rim tops
+ const yF = Hb + T, yR = 1030; // the tray's floor boards lie on the bookshelf, the rims stand on them
const zT1 = -z0; // the tray's front edge
+ const zM = z0 + 400, zA = zT1 - 100; // floor, middle board and front board, back to front
const B = (id: string, name: string, x0: number, x1: number, y0: number, y1: number, za: number, zb: number, material?: CustomPart["material"]): CustomPart => ({
id,
name,
@@ -581,28 +583,28 @@ function changingTable(s: ProductSpec): CustomParams {
...(material ? { material } : {}),
});
const rimPieces = (): PartPiece[] => {
- const L = zT1 - z0;
+ const L = zT1 - z0, yc = (yF + yR) / 2, y1 = yF + 60;
return [
- { shape: "box", size: [T, yF - Hb, L], pos: [0, (Hb + yF) / 2 - (Hb + yR) / 2, 0] },
- { shape: "box", size: [T, yR - yF, L * 0.55], pos: [0, (yF + yR) / 2 - (Hb + yR) / 2, -L / 2 + L * 0.275] },
- { shape: "box", size: [T, (yR - yF) * 0.5, L * 0.45], pos: [0, yF + (yR - yF) * 0.25 - (Hb + yR) / 2, L / 2 - L * 0.225] },
+ { shape: "box", size: [T, y1 - yF, L], pos: [0, (yF + y1) / 2 - yc, 0] },
+ { shape: "box", size: [T, yR - y1, L * 0.55], pos: [0, (y1 + yR) / 2 - yc, -L / 2 + L * 0.275] },
+ { shape: "box", size: [T, (yR - y1) * 0.5, L * 0.45], pos: [0, y1 + (yR - y1) * 0.25 - yc, L / 2 - L * 0.225] },
];
};
const parts: CustomPart[] = [
B("L", "Side panel", -W / 2, -xi, G, yTop, z0, z1),
B("R", "Side panel", xi, W / 2, G, yTop, z0, z1),
- B("PL", "Plinth", -xi, xi, G + 10, yBot, z1 - T, z1),
- B("BOT", "Bottom", -xi, xi, yBot - T / 2, yBot + T / 2, z0 + 8, z1),
+ B("PL", "Plinth", -xi, xi, G + 10, yBot + T / 2, z1 - T, z1), // in front of the bottom's edge
+ B("BOT", "Bottom", -xi, xi, yBot - T / 2, yBot + T / 2, z0 + 8, z1 - T),
B("FOOT", "Back support", -T / 2, T / 2, G, yBot - T / 2, z0 + 8, z0 + 200),
B("SH", "Shelf", -xi, xi, ySh, ySh + T, z0 + 8, z1),
B("BK", "Back panel", -xi, xi, yBot - T / 2, yTop, z0 + 5, z0 + 8, "fiber"),
B("TOP", "Top", -W / 2, W / 2, yTop, Hb, z0, z1),
- B("TB", "Tray back rim", -xi, xi, Hb, yR, z0, z0 + T),
- { id: "TL", name: "Tray side rim", size: [T, yR - Hb, zT1 - z0], pos: [-xs, (Hb + yR) / 2, 0], pieces: rimPieces() },
- { id: "TR", name: "Tray side rim", size: [T, yR - Hb, zT1 - z0], pos: [xs, (Hb + yR) / 2, 0], pieces: rimPieces() },
- B("TF", "Tray floor", -xi, xi, yF - T, yF, z0 + T, 0),
- B("TA", "Tray front rail", -xi, xi, Hb + 10, yF - T, zT1 - T, zT1),
- B("TG", "Tray front floor", -xi, xi, yF - T, yF, 0, zT1 - T),
+ B("TB", "Tray back rim", -xi, xi, yF, yR - 30, z0, z0 + T),
+ { id: "TL", name: "Tray side rim", size: [T, yR - yF, zT1 - z0], pos: [-xs, (yF + yR) / 2, (z0 + zT1) / 2], pieces: rimPieces() },
+ { id: "TR", name: "Tray side rim", size: [T, yR - yF, zT1 - z0], pos: [xs, (yF + yR) / 2, (z0 + zT1) / 2], pieces: rimPieces() },
+ B("TF", "Tray floor", -W / 2, W / 2, Hb, yF, z0, zM),
+ B("TA", "Tray front board", -W / 2, W / 2, Hb, yF, zA, zT1),
+ B("TG", "Tray middle board", -xi, xi, Hb, yF, zM, zA),
];
const side = (sx: number) => (sx < 0 ? "L" : "R");
const tray = ["TB", "TL", "TR", "TF", "TA", "TG"];
@@ -616,26 +618,26 @@ function changingTable(s: ProductSpec): CustomParams {
{
title: "Screw ten cam bolts into the side panels",
detail: "Lay both sides on a rug, inside up. Five in each, by hand until they stop.",
- add: ["L", "R"],
+ wait: ["L", "R"],
fix: sx2.map((sx) => fx({ kind: "camScrew", on: side(sx), dir: [-sx, 0, 0], at: [...bolts(sx, yBot, 2), ...bolts(sx, ySh + T / 2, 2), [sx * xi, yBot - 30, z1 - 8]], len: 34, dia: 7 })),
tools: ["screwdriver"],
warnings: ["floor"],
},
{ title: "Push the glides into the bottom of the sides", detail: "Two in each side's bottom edge.", fix: sx2.map((sx) => fx({ kind: "glide", on: side(sx), dir: [0, 1, 0], at: [[sx * xs, G, z0 + 50], [sx * xs, G, z1 - 50]], len: 3, dia: 20, name: "Glide" })) },
- { title: "Tap six dowels into the bottom", detail: "Two along the front edge for the plinth, two in each end.", add: ["BOT"], fix: [fx({ kind: "dowel", on: "BOT", mate: "PL", dir: [0, 0, 1], at: [[-150, yBot - 4, z1 - T], [150, yBot - 4, z1 - T]], ...DOW }), ...sx2.map((sx) => fx({ kind: "dowel", on: "BOT", mate: side(sx), dir: [sx, 0, 0], at: [[sx * xi, yBot, z0 + 80], [sx * xi, yBot, z1 - 80]], ...DOW }))], tools: ["hammer"] },
- { title: "Screw four cam bolts in", detail: "Two into the plinth's top edge, two into the bottom's underside.", fix: [fx({ kind: "camScrew", on: "PL", dir: [0, -1, 0], at: [[-200, yBot - T / 2, z1 - 8], [200, yBot - T / 2, z1 - 8]], len: 34, dia: 7 }), fx({ kind: "camScrew", on: "BOT", dir: [0, 1, 0], at: [[0, yBot - T / 2, z0 + 60], [0, yBot - T / 2, z0 + 160]], len: 34, dia: 7 })], tools: ["screwdriver"] },
+ { title: "Tap six dowels into the bottom", detail: "Two along the front edge for the plinth, two in each end.", add: ["BOT"], fix: [fx({ kind: "dowel", on: "BOT", mate: "PL", dir: [0, 0, 1], at: [[-150, yBot, z1 - T], [150, yBot, z1 - T]], ...DOW }), ...sx2.map((sx) => fx({ kind: "dowel", on: "BOT", mate: side(sx), dir: [sx, 0, 0], at: [[sx * xi, yBot, z0 + 80], [sx * xi, yBot, z1 - 80]], ...DOW }))], tools: ["hammer"] },
+ { title: "Screw four cam bolts in", detail: "Two into the back of the plinth, two into the bottom's underside.", fix: [fx({ kind: "camScrew", on: "PL", mate: "BOT", dir: [0, 0, 1], at: [[-200, yBot, z1 - T], [200, yBot, z1 - T]], len: 34, dia: 7 }), fx({ kind: "camScrew", on: "BOT", dir: [0, 1, 0], at: [[0, yBot - T / 2, z0 + 60], [0, yBot - T / 2, z0 + 160]], len: 34, dia: 7 })], tools: ["screwdriver"] , wait: ["PL"] },
{ title: "Push the plinth onto the bottom", detail: "Along the front edge, curved edge down.", add: ["PL"] },
- { title: "Lock it with two cam locks", detail: "In the bottom, clockwise until tight.", fix: [fx({ kind: "cam", on: "BOT", dir: [0, -1, 0], at: [[-200, yBot + T / 2, z1 - 40], [200, yBot + T / 2, z1 - 40]] })], tools: ["screwdriver"] },
+ { title: "Lock it with two cam locks", detail: "In the bottom, clockwise until tight.", fix: [fx({ kind: "cam", on: "BOT", dir: [0, -1, 0], at: [[-200, yBot + T / 2, z1 - T - 34], [200, yBot + T / 2, z1 - T - 34]] })], tools: ["screwdriver"] },
{ title: "Tap a dowel into the back support", detail: "Into its top edge.", fix: [fx({ kind: "dowel", on: "FOOT", mate: "BOT", dir: [0, -1, 0], at: [[0, yBot - T / 2, z0 + 110]], ...DOW })], tools: ["hammer"], wait: ["FOOT"] },
{ title: "Push a glide into its bottom", fix: [fx({ kind: "glide", on: "FOOT", dir: [0, 1, 0], at: [[0, G, z0 + 110]], len: 3, dia: 20, name: "Glide" })] },
{ title: "Stand the back support under the bottom", detail: "At the middle of the back edge, onto the bolts.", add: ["FOOT"], from: { FOOT: [0, -250, 0] } },
{ title: "Lock it with two cam locks", detail: "In the back support, one each side of the bolts.", fix: [fx({ kind: "cam", on: "FOOT", dir: [1, 0, 0], at: [[-T / 2, yBot - 40, z0 + 60], [-T / 2, yBot - 40, z0 + 160]] })], tools: ["screwdriver"] },
- { title: "Stand the bottom on one side panel", detail: "Lay the left side flat and push the bottom onto its dowels and bolts.", pose: "+x" },
+ { title: "Stand the bottom on one side panel", detail: "Lay the left side flat and push the bottom onto its dowels and bolts.", pose: "+x", add: ["L"] },
{ title: "Turn three cam locks", detail: "Two in the bottom, one in the plinth.", fix: [fx({ kind: "cam", on: "BOT", dir: [0, -1, 0], at: bolts(-1, yBot + T / 2, 2).map((p): Vec3 => [-(xi - 34), p[1], p[2]]) }), fx({ kind: "cam", on: "PL", dir: [0, 0, 1], at: [[-(xi - 34), yBot - 30, z1 - T]] })], tools: ["screwdriver"] },
{ title: "Tap four dowels into the shelf", detail: "Two in each end.", fix: sx2.map((sx) => fx({ kind: "dowel", on: "SH", mate: side(sx), dir: [sx, 0, 0], at: [[sx * xi, ySh + T / 2, z0 + 80], [sx * xi, ySh + T / 2, z1 - 80]], ...DOW })), tools: ["hammer"], wait: ["SH"] },
{ title: "Push the shelf into the side panel", add: ["SH"] },
{ title: "Lock it with two cam locks", fix: camAt(ySh, bolts(-1, 0, 2).map((p) => p[2]), false, "SH").slice(0, 1), tools: ["screwdriver"] },
- { title: "Put the other side panel on", detail: "Line it up over all the dowels and bolts and press it down.", people: 2, warnings: ["two"] },
+ { title: "Put the other side panel on", detail: "Line it up over all the dowels and bolts and press it down.", add: ["R"], people: 2, warnings: ["two"] },
{ title: "Turn five cam locks", detail: "Two in the bottom, one in the plinth, two in the shelf.", fix: [fx({ kind: "cam", on: "BOT", dir: [0, -1, 0], at: bolts(1, yBot + T / 2, 2).map((p): Vec3 => [xi - 34, p[1], p[2]]) }), fx({ kind: "cam", on: "PL", dir: [0, 0, 1], at: [[xi - 34, yBot - 30, z1 - T]] }), ...camAt(ySh, bolts(1, 0, 2).map((p) => p[2]), false, "SH").slice(1)], tools: ["screwdriver"] },
{ title: "Stand it up and slide the back in", detail: "Down the grooves at the back, cut-outs at the top.", add: ["BK"], pose: "+y", from: { BK: [0, 700, 0] } },
{ title: "Screw the back on", detail: "Six screws: two into the bottom, two into the shelf, two into the back support.", fix: [fx({ kind: "screw", on: "BK", dir: [0, 0, 1], at: [[-150, yBot, z0 + 5], [150, yBot, z0 + 5], [-150, ySh + 8, z0 + 5], [150, ySh + 8, z0 + 5], [0, 40, z0 + 5], [0, 65, z0 + 5]], len: 16, dia: 4 })], tools: ["screwdriver"] },
@@ -643,16 +645,16 @@ function changingTable(s: ProductSpec): CustomParams {
{ title: "Screw four cam bolts into the top", detail: "Lay it face down; two near each end.", fix: [fx({ kind: "camScrew", on: "TOP", dir: [0, 1, 0], at: sx2.flatMap((sx) => [[sx * xs, yTop, z0 + 120], [sx * xs, yTop, z1 - 120]] as Vec3[]), len: 34, dia: 7 })], tools: ["screwdriver"], wait: ["TOP"] },
{ title: "Put the top on", add: ["TOP"], from: { TOP: [0, 300, 0] } },
{ title: "Lock the top with four cam locks", detail: "In the sides, just under the top.", fix: sx2.map((sx) => fx({ kind: "cam", on: side(sx), dir: [-sx, 0, 0], at: [[sx * xi, yTop - 34, z0 + 120], [sx * xi, yTop - 34, z1 - 120]] })), tools: ["screwdriver"] },
- { title: "Tap dowels into the tray's back rim", detail: "Now the tray. Two in each end of the back rim.", fix: sx2.map((sx) => fx({ kind: "dowel", on: "TB", mate: sx < 0 ? "TL" : "TR", dir: [sx, 0, 0], at: [[sx * xi, Hb + 40, z0 + 8], [sx * xi, yR - 40, z0 + 8]], ...DOW })), wait: tray, from: aside, tools: ["hammer"] },
- { title: "Screw the side rims to the back rim", detail: "One long screw through each side rim, with the Allen key.", fix: sx2.map((sx) => fx({ kind: "bolt", on: sx < 0 ? "TL" : "TR", mate: "TB", dir: [-sx, 0, 0], at: [[sx * (W / 2), (Hb + yR) / 2, z0 + 8]], ...LONG })), tools: ["allen"] },
- { title: "Tap nine dowels into the rims", detail: "Along the lower edges, for the tray floor.", fix: [fx({ kind: "dowel", on: "TB", dir: [0, 1, 0], at: [[-150, yF - T, z0 + 8], [150, yF - T, z0 + 8], [0, yF - T, z0 + 8]], ...DOW }), ...sx2.map((sx) => fx({ kind: "dowel", on: sx < 0 ? "TL" : "TR", dir: [0, 1, 0], at: [[sx * (xi + 2), yF - T, -300], [sx * (xi + 2), yF - T, -150], [sx * (xi + 2), yF - T, 200]], ...DOW }))], tools: ["hammer"] },
- { title: "Screw the tray floor on", detail: "Lay it on the dowels and drive six long screws down into the rims.", fix: [fx({ kind: "bolt", on: "TF", dir: [0, -1, 0], at: [[-xi + 8, yF, -300], [-xi + 8, yF, -100], [xi - 8, yF, -300], [xi - 8, yF, -100], [-150, yF, z0 + 24], [150, yF, z0 + 24]], ...LONG })], tools: ["allen"] },
- { title: "Screw the front rail between the rims", detail: "One long screw through each rim into its ends.", fix: sx2.map((sx) => fx({ kind: "bolt", on: sx < 0 ? "TL" : "TR", mate: "TA", dir: [-sx, 0, 0], at: [[sx * (W / 2), (Hb + yF) / 2, zT1 - 8]], ...LONG })), tools: ["allen"] },
- { title: "Slide the front floor in", detail: "Two dowels in its back edge go into the floor.", fix: [fx({ kind: "dowel", on: "TG", mate: "TF", dir: [0, 0, -1], at: [[-150, yF - 8, 0], [150, yF - 8, 0]], ...DOW })], tools: ["hammer"] },
+ { title: "Tap dowels into the tray's back rim", detail: "Now the tray. Two in each end of the back rim.", fix: sx2.map((sx) => fx({ kind: "dowel", on: "TB", mate: sx < 0 ? "TL" : "TR", dir: [sx, 0, 0], at: [[sx * xi, yF + 25, z0 + 8], [sx * xi, yR - 60, z0 + 8]], ...DOW })), wait: tray, from: aside, tools: ["hammer"] },
+ { title: "Screw the side rims to the back rim", detail: "One long screw through each side rim, with the Allen key.", fix: sx2.map((sx) => fx({ kind: "bolt", on: sx < 0 ? "TL" : "TR", mate: "TB", dir: [-sx, 0, 0], at: [[sx * (W / 2), (yF + yR - 30) / 2, z0 + 8]], ...LONG })), tools: ["allen"] },
+ { title: "Tap nine dowels into the rims", detail: "Turn the frame upside down, shaped edges on the floor. Three dowels in the edge of each rim.", fix: [fx({ kind: "dowel", on: "TB", mate: "TF", dir: [0, 1, 0], at: [[-150, yF, z0 + 8], [150, yF, z0 + 8], [0, yF, z0 + 8]], ...DOW }), ...sx2.flatMap((sx) => [fx({ kind: "dowel", on: sx < 0 ? "TL" : "TR", mate: "TF", dir: [0, 1, 0], at: [[sx * xs, yF, -300], [sx * xs, yF, -150]], ...DOW }), fx({ kind: "dowel", on: sx < 0 ? "TL" : "TR", mate: "TA", dir: [0, 1, 0], at: [[sx * xs, yF, zT1 - 50]], ...DOW })])], tools: ["hammer"] },
+ { title: "Screw the tray floor on", detail: "Lay it over the rims' edges, onto the dowels, and drive six long screws through it into the rims.", fix: [fx({ kind: "bolt", on: "TF", dir: [0, 1, 0], at: [[-xs, Hb, -320], [-xs, Hb, -100], [xs, Hb, -320], [xs, Hb, -100], [-240, Hb, z0 + 8], [240, Hb, z0 + 8]], ...LONG })], tools: ["allen"] },
+ { title: "Screw the front board on", detail: "Across the front ends of the rims, two long screws through it.", fix: [fx({ kind: "bolt", on: "TA", dir: [0, 1, 0], at: sx2.map((sx): Vec3 => [sx * xs, Hb, zT1 - 30]), ...LONG })], tools: ["allen"] },
+ { title: "Fit the middle board", detail: "Two dowels into the floor's front edge, then press the middle board onto them.", fix: [fx({ kind: "dowel", on: "TF", mate: "TG", dir: [0, 0, -1], at: [[-150, Hb + T / 2, zM], [150, Hb + T / 2, zM]], ...DOW })], tools: ["hammer"] },
{
title: "Screw the two wall brackets under the tray",
detail: "Turn the tray over. A washer and a screw for each bracket, its upright against the back rim.",
- fix: [fx({ kind: "angle", on: "TF", dir: [0, 1, 0], at: [[-150, yF - T, z0 + 30], [150, yF - T, z0 + 30]], len: 80, dia: 30, name: "Wall bracket", included: true }), fx({ kind: "washer", on: "TF", dir: [0, 1, 0], at: [[-150, yF - T - 2, z0 + 60], [150, yF - T - 2, z0 + 60]] }), fx({ kind: "screw", on: "TF", dir: [0, 1, 0], at: [[-150, yF - T - 2, z0 + 60], [150, yF - T - 2, z0 + 60]], len: 16, dia: 4 })],
+ fix: [fx({ kind: "angle", on: "TF", dir: [0, 1, 0], at: [[-150, Hb, z0 + 30], [150, Hb, z0 + 30]], len: 80, dia: 30, name: "Wall bracket", included: true }), fx({ kind: "washer", on: "TF", dir: [0, 1, 0], at: [[-150, Hb - 2, z0 + 60], [150, Hb - 2, z0 + 60]] }), fx({ kind: "screw", on: "TF", dir: [0, 1, 0], at: [[-150, Hb - 2, z0 + 60], [150, Hb - 2, z0 + 60]], len: 16, dia: 4 })],
tools: ["screwdriver"],
},
{ title: "Lay the tray on the bookshelf", detail: "Turn it right way up and set it on, flush with the back.", add: tray, from: Object.fromEntries(tray.map((id) => [id, [0, 400, 0] as Vec3])) },
diff --git a/src/lib/plan/families/smastad.ts b/src/lib/plan/families/smastad.ts
index 8e7a288..82e4d54 100644
--- a/src/lib/plan/families/smastad.ts
+++ b/src/lib/plan/families/smastad.ts
@@ -651,7 +651,8 @@ function benchRecipe(s: ProductSpec): CustomParams {
detail: "Lay the seat face down on the rug. Six bolts, by hand: two at each end and two for the rail.",
fix: [fixAt(HW.camScrew, topPins, [0, 1, 0], "TP")],
pose: "-y",
- from: { TP: [0, 0, 600] },
+ from: { TP: [0, 500, 0] }, // it waits beside the sides, bolts up
+ wait: ["TP"],
warnings: ["floor"],
},
{ title: "Lower the sides onto the seat", detail: "Turn the sides and rail upside down and set them on the bolts. Then lock the two cam locks in the rail.", add: ["TP"], fix: [fixAt(HW.cam, [[-W / 4, H - t - 28, zr + t / 2], [W / 4, H - t - 28, zr + t / 2]], [0, 0, -1], "RL")] },
@@ -659,7 +660,7 @@ function benchRecipe(s: ProductSpec): CustomParams {
{
title: "Screw the foot brackets onto the sides",
detail: "One at each end of both sides, one screw into the end of the side.",
- fix: [-1, 1].flatMap((sx) => [fixAt({ kind: "angle", len: 40, dia: 30 }, bz.map((z) => bracket(sx, z)), [0, 1, 0], sx < 0 ? "SL" : "SR"), fixAt(HW.screwS, bz.map((z): Vec3 => [sx * xs, FT - 2, z]), [0, 1, 0], sx < 0 ? "SL" : "SR")]),
+ fix: [-1, 1].flatMap((sx) => [fixAt({ kind: "angle", len: 40, dia: 30 }, bz.map((z) => bracket(sx, z)), [0, 1, 0], sx < 0 ? "SL" : "SR"), fixAt(HW.screwS, bz.map((z): Vec3 => [sx * xs, FT - 2, z - Math.sign(z) * 24]), [0, 1, 0], sx < 0 ? "SL" : "SR")]), // beside the bracket's corner
tools: ["screwdriver"],
},
{
@@ -850,7 +851,8 @@ function changingRecipe(s: ProductSpec, desk: boolean): CustomParams {
{
title: "Screw six shelf holders into the right compartment",
detail: "Three on each side of it, at the height you want the shelf.",
- fix: [{ ...fixAt({ kind: "clip", len: 20, dia: 14 }, [[xd + T, 300, -250], [xd + T, 300, -50], [xd + T, 300, 120], [xi, 300, -250], [xi, 300, -50], [xi, 300, 120]], [0, 0, 1]), name: "Shelf holder" }, fixAt({ kind: "screw", len: 12, dia: 3.5 }, [[xd + T, 296, -250], [xd + T, 296, -50], [xd + T, 296, 120], [xi, 296, -250], [xi, 296, -50], [xi, 296, 120]], [0, 0, 1])],
+ // each holder sits just under the shelf, its screw below it into the panel
+ fix: [[xd + T, 1, "DIV"], [xi, -1, "SR"]].flatMap(([x, k, on]) => [{ ...fixAt({ kind: "clip", len: 20, dia: 14 }, [-250, -50, 120].map((z): Vec3 => [+x, 293, z]), [-k, 0, 0], `${on}`), name: "Shelf holder" }, fixAt({ kind: "screw", len: 12, dia: 3.5 }, [-250, -50, 120].map((z): Vec3 => [+x, 269, z]), [-k, 0, 0], `${on}`)]),
tools: ["screwdriver"],
},
{ title: "Lay the shelf on the holders", detail: "Press it down until each holder clicks over its edge.", add: ["CS"], from: { CS: [0, 0, 400] } },
@@ -899,14 +901,15 @@ function changingRecipe(s: ProductSpec, desk: boolean): CustomParams {
const dH = (i: number) => parts.find((p) => p.id === `DL${i}`)!.size[1];
const sxs = (i: number, sx: number) => (sx < 0 ? `DL${i}` : `DR${i}`);
const rz = [dz0 + 40, (dz0 + dz1) / 2, dz1 - 40];
+ const rm = (dz0 + dz1) / 2 + 25; // a runner's middle, clear of its middle screw
const drawerSteps: CustomStep[] = [
- { title: "Screw the drawer rails into the left compartment", detail: "One on each side for both drawers, three screws in each, in the holes the drawer leaflet numbers.", fix: dd.flatMap((i) => [fixAt({ kind: "runner", len: 400, dia: 20 }, [[x0, dY(i) - 2, (dz0 + dz1) / 2]], [-1, 0, 0], "SL"), fixAt({ kind: "runner", len: 400, dia: 20 }, [[x1, dY(i) - 2, (dz0 + dz1) / 2]], [1, 0, 0], "DIV"), fixAt({ kind: "screw", len: 12, dia: 4 }, rz.map((z): Vec3 => [x0, dY(i) - 2, z]), [-1, 0, 0], "SL"), fixAt({ kind: "screw", len: 12, dia: 4 }, rz.map((z): Vec3 => [x1, dY(i) - 2, z]), [1, 0, 0], "DIV")]), tools: ["screwdriver"] },
+ { title: "Screw the drawer rails into the left compartment", detail: "One on each side for both drawers, three screws in each, in the holes the drawer leaflet numbers.", fix: dd.flatMap((i) => [fixAt({ kind: "runner", len: 400, dia: 20 }, [[x0, dY(i) - 2, rm]], [-1, 0, 0], "SL"), fixAt({ kind: "runner", len: 400, dia: 20 }, [[x1, dY(i) - 2, rm]], [1, 0, 0], "DIV"), fixAt({ kind: "screw", len: 12, dia: 4 }, rz.map((z): Vec3 => [x0, dY(i) - 2, z]), [-1, 0, 0], "SL"), fixAt({ kind: "screw", len: 12, dia: 4 }, rz.map((z): Vec3 => [x1, dY(i) - 2, z]), [1, 0, 0], "DIV")]), tools: ["screwdriver"] },
{ title: "Press the stops into the drawer front panels", detail: "Lay them on a rug, inside face up. Push each stop in and slide it along until it locks.", fix: dd.map((i) => fixAt({ kind: "clip", len: 10, dia: 16 }, [-1, 1].map((sx): Vec3 => [cx + sx * (bw / 2 - 60), dY(i) + 6, dz1 - 16]), [0, 0, 1], `DP${i}`)), wait: dd.flatMap((i) => [`DP${i}`, `DL${i}`, `DR${i}`, `DT${i}`, `DB${i}`]), from: Object.fromEntries(dd.flatMap((i) => [`DP${i}`, `DL${i}`, `DR${i}`, `DT${i}`, `DB${i}`].map((id) => [id, [0, 0, 600] as Vec3]))), warnings: ["floor"] },
{ title: "Push the sides onto the front panels", detail: "Grooves facing in and down, until they click." },
{ title: "Slide in the drawer bottoms", detail: "Along the grooves, down to the front panel." },
{ title: "Lay the backs on and lock them", detail: "Two pins through each side into the back, then turn the cam locks in the back.", fix: dd.flatMap((i) => [fixAt({ kind: "camScrew", len: 30, dia: 6 }, [-1, 1].flatMap((sx) => [0.3, 0.75].map((k): Vec3 => [cx + sx * (bw / 2 - 12), dY(i) + dH(i) * k, dz0 + 8])), [1, 0, 0], `DB${i}`), fixAt({ kind: "cam", len: 12, dia: 15 }, [-1, 1].flatMap((sx) => [0.3, 0.75].map((k): Vec3 => [cx + sx * (bw / 2 - 40), dY(i) + dH(i) * k, dz0])), [0, 0, 1], `DB${i}`)]), tools: ["screwdriver"] },
{ title: "Screw the bottoms to the backs", detail: "Two small screws in each.", fix: dd.map((i) => fixAt({ kind: "screw", len: 8, dia: 3.5 }, [-1, 1].map((sx): Vec3 => [cx + sx * bw / 4, dY(i) + 8, dz0 + 8]), [0, 1, 0], `DT${i}`)), tools: ["screwdriver"] },
- { title: "Screw the runners onto the drawers", detail: "Upside down: each runner clicks onto its side, then three screws.", fix: dd.flatMap((i) => [-1, 1].flatMap((sx) => [fixAt({ kind: "runner", len: 380, dia: 16 }, [[cx + sx * (bw / 2 - 6), dY(i), (dz0 + dz1) / 2]], [0, 1, 0], sxs(i, sx)), fixAt({ kind: "screw", len: 12, dia: 4 }, rz.map((z): Vec3 => [cx + sx * (bw / 2 - 6), dY(i) - 4, z]), [0, 1, 0], sxs(i, sx))])), tools: ["screwdriver"] },
+ { title: "Screw the runners onto the drawers", detail: "Upside down: each runner clicks onto its side, then three screws.", fix: dd.flatMap((i) => [-1, 1].flatMap((sx) => [fixAt({ kind: "runner", len: 380, dia: 16 }, [[cx + sx * (bw / 2 - 6), dY(i), rm]], [0, 1, 0], sxs(i, sx)), fixAt({ kind: "screw", len: 12, dia: 4 }, [dz0 + 70, rm - 55, dz1 - 70].map((z): Vec3 => [cx + sx * (bw / 2 - 6), dY(i) - 4, z]), [0, 1, 0], sxs(i, sx))])), tools: ["screwdriver"] },
{ title: "Slide both drawers in", detail: "Rest the runners on the rails and push until they close softly.", add: dd.flatMap((i) => [`DP${i}`, `DL${i}`, `DR${i}`, `DT${i}`, `DB${i}`]) },
{ title: "Click on the drawer fronts", detail: "Press each front on until it clicks, then line up the gaps.", add: ["DF0", "DF1"], from: { DF0: [0, 0, 300], DF1: [0, 0, 300] } },
];
diff --git a/src/lib/plan/families/smedstorp.ts b/src/lib/plan/families/smedstorp.ts
index 799b089..09fa73d 100644
--- a/src/lib/plan/families/smedstorp.ts
+++ b/src/lib/plan/families/smedstorp.ts
@@ -91,7 +91,8 @@ function frameSteps(f: ReturnType<typeof frameParts>, arms: { id: string; x: num
add: [back.id],
fix: [
...hookOn.map((x) => fx("hook", [f.hookAt(x)], [x < back.pos[0] ? 1 : -1, 0, 0], { ...HOOK, on: back.id })),
- fx("screw", hookOn.map((x) => f.hookAt(x)), [0, 0, -1], { ...HOOK_SCREW, on: back.id }),
+ // each screw goes through its plate into the end of the backrest
+ ...hookOn.map((x) => fx("screw", [f.hookAt(x)], [x < back.pos[0] ? 1 : -1, 0, 0], { ...HOOK_SCREW, on: back.id })),
],
tools: ["allen"],
pose: "+z",
@@ -130,8 +131,8 @@ function frameSteps(f: ReturnType<typeof frameParts>, arms: { id: string; x: num
title: "Bolt the seat to the armrest" + (two ? "s" : ""),
detail: "A washer on each bolt, through the side rail of the seat into the armrest. Tighten them with the Allen key.",
fix: arms.flatMap((a) => [
- fx("washer", f.bolts(a.x - a.sx * AW / 2), [a.sx, 0, 0], { ...WASHER, on: seat.id }),
fx("bolt", f.bolts(a.x - a.sx * AW / 2), [a.sx, 0, 0], { ...BOLT, on: seat.id, mate: a.id }),
+ fx("washer", f.bolts(a.x - a.sx * AW / 2), [a.sx, 0, 0], { ...WASHER, on: seat.id }),
]),
tools: ["allen"],
},
@@ -212,7 +213,7 @@ function sectional(s: ProductSpec): CustomParams {
title: "Bolt the backrest to the chaise seat",
detail: "Stand the long seat on its inner side on a rug, the backrest against its end. Two bolts with washers; use the shorter bolts here.",
add: ["cS", "cB"],
- fix: [fx("washer", [cBoltAt(0.3), cBoltAt(0.7)], [0, 0, -1], { ...WASHER, on: "cS" }), fx("bolt", [cBoltAt(0.3), cBoltAt(0.7)], [0, 0, -1], { ...BOLT, on: "cS", mate: "cB" })],
+ fix: [fx("bolt", [cBoltAt(0.3), cBoltAt(0.7)], [0, 0, -1], { ...BOLT, on: "cS", mate: "cB" }), fx("washer", [cBoltAt(0.3), cBoltAt(0.7)], [0, 0, -1], { ...WASHER, on: "cS" })],
tools: ["allen"],
pose: "+x",
warnings: ["floor"],
@@ -250,7 +251,7 @@ function sectional(s: ProductSpec): CustomParams {
{
title: "Bolt the armrest to the chaise",
detail: "Two long bolts with washers through the side of the seat frame into the armrest.",
- fix: [fx("washer", armBolts, [1, 0, 0], { ...WASHER, on: "cS" }), fx("bolt", armBolts, [1, 0, 0], { ...LONG_BOLT, on: "cS", mate: "cA" })],
+ fix: [fx("bolt", armBolts, [1, 0, 0], { ...LONG_BOLT, on: "cS", mate: "cA" }), fx("washer", armBolts, [1, 0, 0], { ...WASHER, on: "cS" })],
tools: ["allen"],
},
{
diff --git a/src/lib/plan/families/smyga.ts b/src/lib/plan/families/smyga.ts
index 4a278d8..d0010c8 100644
--- a/src/lib/plan/families/smyga.ts
+++ b/src/lib/plan/families/smyga.ts
@@ -209,13 +209,13 @@ function boxSteps(b: PlanBuilder, s: ProductSpec) {
}));
// upside down, side by side on the floor in their own scene
const flip: Vec3 = [Math.PI, 0, 0];
- const show = (keys: string[], i: number) => {
+ const show = (keys: string[], i: number, from: Vec3 = [0, 200, 0]) => {
const pivot: Vec3 = [x0, 125, boxes[i].z0];
const at: Vec3 = [(i - 0.5) * (BX + 250), 125, 0];
for (const k of keys) {
const it = b.partItem(k);
const p = rotate([it.final.pos[0] - pivot[0], it.final.pos[1] - pivot[1], it.final.pos[2] - pivot[2]], flip);
- b.stage(k, [p[0] + at[0], p[1] + at[1], p[2] + at[2]], flip, [0, 200, 0]);
+ b.stage(k, [p[0] + at[0], p[1] + at[1], p[2] + at[2]], flip, from);
}
};
const scene = "boxes";
@@ -233,7 +233,8 @@ function boxSteps(b: PlanBuilder, s: ProductSpec) {
});
b.step({ title: "Tap the dowels into the box sides", detail: "Two in one end of each side panel, the end that meets the panel with the cam bolts.", tools: ["hammer"], scene, kind: "dowels" }, () => {
b.stagger(0.2);
- boxes.forEach((bxx, i) => show(bxx.sides, i));
+ // they slide onto the end along its cam bolts
+ boxes.forEach((bxx, i) => show(bxx.sides, i, [-250, 0, 0]));
b.then(0.15);
b.fits(DOWEL, both((bxx) => [-1, 1].flatMap((g) => [yA + 30, yB - 30].map((y): FitOpts => ({ on: bxx.sides[g < 0 ? 0 : 1], at: [fx, y, zSide(bxx, g)], dir: [1, 0, 0], mate: bxx.front })))), 0.05);
});
@@ -259,11 +260,9 @@ function boxSteps(b: PlanBuilder, s: ProductSpec) {
b.stagger(0.25);
boxes.forEach((bxx, i) => show([bxx.bottoms[1]], i));
});
- b.step({ title: "Screw the bottom to the frame", detail: "Ten screws through the bottom into the edges of the sides and the end panels.", tools: ["allen"], scene, kind: "screws" }, () => {
- const pts = (bxx: (typeof boxes)[number]): FitOpts[] => [
- ...[-1, 1].flatMap((g) => [-0.3, 0, 0.3].map((f): FitOpts => ({ on: bxx.bottoms[g < 0 ? 0 : 1], at: [x0 + f * BX, 40, zSide(bxx, g)], dir: [0, 1, 0], mate: bxx.sides[g < 0 ? 0 : 1] }))),
- ...[bx - BT / 2 + 20, fx + BT / 2 - 20].flatMap((x) => [-1, 1].map((g): FitOpts => ({ on: bxx.bottoms[g < 0 ? 0 : 1], at: [x, 40, bxx.z0 + g * BZ * 0.25], dir: [0, 1, 0] }))),
- ];
+ b.step({ title: "Screw the bottom to the frame", detail: "Ten screws through the bottom into the edges of the two sides, five along each.", tools: ["allen"], scene, kind: "screws" }, () => {
+ const pts = (bxx: (typeof boxes)[number]): FitOpts[] =>
+ [-1, 1].flatMap((g) => [-0.4, -0.2, 0, 0.2, 0.4].map((f): FitOpts => ({ on: bxx.bottoms[g < 0 ? 0 : 1], at: [x0 + f * BX, 40, zSide(bxx, g)], dir: [0, 1, 0], mate: bxx.sides[g < 0 ? 0 : 1] })));
b.fits(BOX_SCREW, both(pts), 0.04);
});
const castorAt = (bxx: (typeof boxes)[number]): Vec3[] => [
@@ -283,7 +282,7 @@ function boxSteps(b: PlanBuilder, s: ProductSpec) {
/* ---------------------------------------------------------------- desk */
-function deskRecipe(s: ProductSpec): CustomParams {
+function deskRecipe(s: ProductSpec): CustomParams & { drawerParts: CustomPart[]; drawer: DeskDrawer } {
void s;
const TW = 1220, TD = 600, TT = 22, TY = 740; // top surface 74 cm up
const GH = 90, GT = 18; // gallery
@@ -317,12 +316,12 @@ function deskRecipe(s: ProductSpec): CustomParams {
const dLen = dz1 - dz0;
const DS = OX - 13; // outside of the drawer sides, a runner's width in from the guides
const dy0 = AY0 + 6, dh = 66;
- parts.push(
+ const drawerParts: CustomPart[] = [
{ id: "DF", name: "Drawer front", size: [2 * OX - 4, AH - 4, AT], pos: [0, ay, FZ - AT / 2] },
...[-1, 1].map((g, i): CustomPart => ({ id: `DS${i}`, name: "Drawer side", size: [14, dh, dLen], pos: [g * (DS - 7), dy0 + dh / 2, (dz0 + dz1) / 2] })),
{ id: "DB", name: "Drawer bottom", size: [2 * DS - 28, 4, dLen - 14], pos: [0, dy0 + 10, (dz0 + dz1) / 2 + 3], material: "fiber" },
{ id: "DK", name: "Drawer back", size: [2 * DS - 28, dh - 14, 14], pos: [0, dy0 + 14 + (dh - 14) / 2, dz0 + 7] },
- );
+ ];
const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
const legs = [0, 1].flatMap((i) => [0, 1].map((j) => ({ id: `L${i}${j}`, sx: sg(i), sz: sg(j) })));
@@ -375,18 +374,23 @@ function deskRecipe(s: ProductSpec): CustomParams {
...[0, 1].map((i): CustomFix => ({ kind: "camScrew", count: 1, on: `FR${i}`, at: [pt(sg(i) * GX + sg(i) * 4, ay, FZ - AT)], dir: [0, 0, 1] })),
],
tools: ["screwdriver"],
+ wait: ["BA", "FR0", "FR1"],
+ from: { BA: [0, 0, -300], FR0: [0, 0, 300], FR1: [0, 0, 300] },
},
{
title: "Tap the big dowels into the drawer guides",
detail: "One in each end of both guides.",
- fix: [0, 1].map((i): CustomFix => ({ kind: "dowel", count: 2, len: 40, dia: 10, on: `DG${i}`, at: [-1, 1].map((g) => pt(sg(i) * GX, ay + 18, g * (FZ - AT))), dir: [0, 0, 1] })),
+ // each goes into its end of the guide, the back one forwards and the front one backwards
+ fix: [0, 1].flatMap((i) => [-1, 1].map((g): CustomFix => ({ kind: "dowel", count: 1, len: 40, dia: 10, on: `DG${i}`, at: [pt(sg(i) * GX, ay + 25, g * (FZ - AT))], dir: [0, 0, -g] }))),
tools: ["hammer"],
+ wait: ["DG0", "DG1"],
+ from: { DG0: [0, 0, 300], DG1: [0, 0, 300] },
},
{
title: "Fit the drawer guides between the back rail and the front pieces",
detail: "The cam bolts go into the holes in the guides' faces.",
add: ["BA", "DG0", "DG1", "FR0", "FR1"],
- from: { BA: [0, -260, 0], DG0: [0, -260, 0], DG1: [0, -260, 0], FR0: [0, -260, 0], FR1: [0, -260, 0] },
+ from: { BA: [0, 0, -300], DG0: [0, 0, 300], DG1: [0, 0, 300], FR0: [0, 0, 300], FR1: [0, 0, 300] },
},
{
title: "Lock the guides with the cam locks",
@@ -415,7 +419,7 @@ function deskRecipe(s: ProductSpec): CustomParams {
detail: "Three knobs on the outside, each held by a screw from the inside. You can hang small things on them later.",
fix: [
{ kind: "knob", count: 3, on: "SA1", at: [-120, 0, 120].map((z) => pt(FX, ay, z)), dir: [-1, 0, 0] },
- { kind: "screw", name: "Knob screw", count: 3, len: 35, dia: 4, on: "SA1", at: [-120, 0, 120].map((z) => pt(FX - AT, ay, z)), dir: [1, 0, 0] },
+ { kind: "screw", name: "Knob screw", count: 3, len: 35, dia: 4, on: "SA1", at: [-120, 0, 120].map((z) => pt(FX - AT - 5, ay, z)), dir: [1, 0, 0] },
],
tools: ["screwdriver"],
},
@@ -484,59 +488,69 @@ function deskRecipe(s: ProductSpec): CustomParams {
tools: ["screwdriver"],
},
{ title: "Stand the desk on its legs", detail: "Two of you lift it over, so the legs don't take the weight on one corner.", pose: "+y", people: 2, kind: "standup" },
- {
- title: "Screw the cam bolts into the drawer front",
- detail: "Two in the inside face, one near each end.",
- add: ["DF"],
- fix: [{ kind: "camScrew", count: 2, on: "DF", at: [-1, 1].map((g) => pt(g * (DS - 7), ay, FZ - AT)), dir: [0, 0, 1] }],
- tools: ["screwdriver"],
- from: { DF: [0, 0, 400] },
- },
- {
- title: "Tap the small dowels into the drawer sides",
- detail: "One in the front end of each side.",
- fix: [0, 1].map((i): CustomFix => ({ kind: "dowel", count: 1, len: 25, dia: 6, on: `DS${i}`, at: [pt(sg(i) * (DS - 7), dy0 + 20, dz1)], dir: [0, 0, 1] })),
- tools: ["hammer"],
- },
- { title: "Fit the drawer sides to the front", detail: "Groove facing in and down, for the bottom.", add: ["DS0", "DS1"], from: { DS0: [0, 0, 400], DS1: [0, 0, 400] } },
- {
- title: "Lock the sides with the cam locks",
- detail: "One in each side near the front, turned clockwise.",
- fix: [0, 1].map((i): CustomFix => ({ kind: "cam", count: 1, on: `DS${i}`, at: [pt(sg(i) * (DS - 14), ay, dz1 - 30)], dir: [sg(i), 0, 0] })),
- tools: ["flathead"],
- },
- { title: "Slide in the drawer bottom", detail: "Smooth side up, along the grooves until it meets the front.", add: ["DB"], from: { DB: [0, 0, 500] } },
- {
- title: "Hammer on the drawer back",
- detail: "Lay it over the end of the bottom and knock the two expanding dowels through the sides into it.",
- add: ["DK"],
- fix: [{ kind: "dowel", name: "Expanding dowel", count: 2, len: 35, dia: 8, at: [-1, 1].map((g) => pt(g * DS, dy0 + 40, dz0 + 7)), dir: [-1, 0, 0] }],
- tools: ["hammer"],
- from: { DK: [0, 0, 500] },
- },
- {
- title: "Screw the runner parts onto the drawer",
- detail: "Click each one onto the bottom edge of a side, then two screws at the back.",
- fix: [0, 1].map((i): CustomFix => ({ kind: "screw", count: 2, len: 12, dia: 4, on: `DS${i}`, at: [dz0 + 20, dz0 + 80].map((z) => pt(sg(i) * DS, dy0 + 10, z)), dir: [-sg(i), 0, 0] })),
- tools: ["screwdriver"],
- },
- {
- title: "Screw the knob onto the drawer front",
- detail: "The screw goes in from the inside.",
- fix: [
- { kind: "knob", count: 1, on: "DF", at: [pt(0, ay, FZ)], dir: [0, 0, -1] },
- { kind: "screw", name: "Knob screw", count: 1, len: 25, dia: 4, on: "DF", at: [pt(0, ay, FZ - AT)], dir: [0, 0, 1] },
- ],
- tools: ["screwdriver"],
- },
- { title: "Push the drawer onto the runners", detail: "Tilt it in at the front, lower it onto the runners and push until it closes softly.", kind: "drawer" },
- {
- title: "Press in the cable covers",
- detail: "One in each hole at the back corners of the top.",
- fix: [{ kind: "cap", name: "Cable cover", count: 2, len: 12, dia: 60, at: [-1, 1].map((g) => pt(g * (TW / 2 - 110), TY, -TD / 2 + 90)), dir: [0, -1, 0] }],
- },
];
- return { parts, steps };
+ return { parts, steps, drawerParts, drawer: { ay, FZ, AT, DS, dy0, dz0, dz1, TW, TD, TY } };
+}
+
+type DeskDrawer = { ay: number; FZ: number; AT: number; DS: number; dy0: number; dz0: number; dz1: number; TW: number; TD: number; TY: number };
+
+/** The drawer, built face down on the floor as the manual does it, then pushed onto the runners; the cable covers last. */
+function deskDrawerSteps(b: PlanBuilder, parts: CustomPart[], d: DeskDrawer) {
+ const { ay, FZ, AT, DS, dy0, dz0, dz1, TW, TD, TY } = d;
+ const key = (id: string) => {
+ const p = parts.find((x) => x.id === id)!;
+ return b.place(b.part(p.name, p.size, { material: p.material ?? "board" }), p.pos);
+ };
+ const DF = key("DF"), DSs = [key("DS0"), key("DS1")], DB = key("DB"), DK = key("DK");
+ const scene = "drawer";
+ // face down: the front lies on the floor and the drawer is built upwards from it, its back at the top
+ const face: Vec3 = [Math.PI / 2, 0, 0];
+ const pivot: Vec3 = [0, ay, FZ];
+ const lay = (keys: string[], up = 0, from: Vec3 | undefined = [0, 250, 0]) => {
+ for (const k of keys) {
+ const it = b.partItem(k);
+ const q = rotate([it.final.pos[0] - pivot[0], it.final.pos[1] - pivot[1], it.final.pos[2] - pivot[2]], face);
+ b.stage(k, [q[0], q[1] + up, q[2]], face, from);
+ }
+ };
+ const step = (title: string, detail: string, body: () => void, o: { tools?: ("hammer" | "flathead" | "screwdriver")[]; kind?: "cams" | "dowels" | "join" | "screws" | "drawer" | "general"; main?: boolean } = {}) =>
+ b.step({ title, detail, kind: o.kind ?? "general", tools: o.tools, scene: o.main ? undefined : scene, pose: o.main ? "+y" : undefined }, body);
+ const sides = (f: (k: string, g: number) => FitOpts[]) => DSs.flatMap((k, i) => f(k, sg(i)));
+
+ step("Screw the cam bolts into the drawer front", "Lay the front face down on a rug: two cam bolts in the inside face, one near each end.", () => {
+ lay([DF]);
+ b.then(0.15);
+ b.fits(CAM_BOLT, [-1, 1].map((g): FitOpts => ({ on: DF, at: [g * (DS - 7), ay, FZ - AT], dir: [0, 0, 1] })), 0.1);
+ }, { tools: ["screwdriver"], kind: "cams" });
+ step("Tap the small dowels into the drawer sides", "One in the front end of each side.", () => {
+ lay(DSs, 260);
+ b.then(0.15);
+ b.fits({ kind: "dowel", len: 25, dia: 6 }, sides((k, g) => [{ on: k, at: [g * (DS - 7), dy0 + 20, dz1], dir: [0, 0, -1], mate: DF }]), 0.1);
+ }, { tools: ["hammer"], kind: "dowels" });
+ step("Stand the sides on the front", "Grooves facing in and toward the bottom edge, dowels and cam bolts in their holes.", () => lay(DSs, 0, undefined), { kind: "join" });
+ step("Lock the sides with the cam locks", "One in each side near the front, turned clockwise.", () =>
+ b.fits(CAM, sides((k, g) => [{ on: k, at: [g * (DS - 14), ay, dz1 - 30], dir: [g, 0, 0] }]), 0.1),
+ { tools: ["flathead"], kind: "cams" });
+ step("Slide in the drawer bottom", "Smooth side up, down the grooves until it meets the front.", () => lay([DB], 0, [0, 400, 0]), { kind: "join" });
+ step("Lower the back onto the bottom", "Tilt it in over the end of the bottom, between the sides.", () => lay([DK], 0, [0, 250, 0]), { kind: "join" });
+ step("Hammer the expanding dowels in", "One through each side into the back.", () =>
+ b.fits({ kind: "dowel", len: 35, dia: 8, name: "Expanding dowel" }, sides((k, g) => [{ on: k, at: [g * DS, dy0 + 40, dz0 + 7], dir: [-g, 0, 0], mate: DK }]), 0.15),
+ { tools: ["hammer"], kind: "dowels" });
+ step("Screw the runner parts onto the drawer", "Click each one onto the bottom edge of a side, then two screws at the back.", () =>
+ b.fits({ kind: "screw", len: 12, dia: 4 }, sides((k, g) => [dz0 + 20, dz0 + 80].map((z): FitOpts => ({ on: k, at: [g * DS, dy0 + 10, z], dir: [-g, 0, 0] }))), 0.08),
+ { tools: ["screwdriver"], kind: "screws" });
+ step("Screw the knob onto the drawer front", "The screw goes in from the inside.", () => {
+ b.fit({ kind: "knob", len: 25, dia: 30 }, { on: DF, at: [0, ay, FZ], dir: [0, 0, -1], hole: false });
+ b.fit({ kind: "screw", len: 25, dia: 4, name: "Knob screw" }, { on: DF, at: [0, ay, FZ - AT], dir: [0, 0, 1] });
+ }, { tools: ["screwdriver"], kind: "screws" });
+ step("Push the drawer onto the runners", "Tilt it in at the front, lower it onto the runners and push until it closes softly.", () => {
+ b.stagger(0.05);
+ for (const k of [DF, ...DSs, DB, DK]) b.add(k, [0, 0, 450]);
+ }, { kind: "drawer", main: true });
+ const top = b.items.find((i) => i.kind === "part" && b.parts.find((t) => t.id === i.ref)?.name === "Desk top")?.key;
+ step("Press in the cable covers", "One in each hole at the back corners of the top.", () =>
+ b.fits({ kind: "cap", len: 12, dia: 60, name: "Cable cover" }, [-1, 1].map((g): FitOpts => ({ on: top, at: [g * (TW / 2 - 110), TY, -TD / 2 + 90], dir: [0, -1, 0], hole: false })), 0.15),
+ { main: true });
}
/* ---------------------------------------------------------------- family */
@@ -548,11 +562,16 @@ const withStorage = (s: ProductSpec) => /storage/i.test(s.variant) || /storage/.
const family: Family = {
names: ["SMYGA"],
recipe(s) {
- if (isDesk(s)) return deskRecipe(s);
if (isBed(s) && !withStorage(s)) return bedRecipe(s);
return null;
},
build(b, s) {
+ if (isDesk(s)) {
+ const { drawerParts, drawer, ...custom } = deskRecipe(s);
+ buildCustom(b, { ...s, custom });
+ deskDrawerSteps(b, drawerParts, drawer);
+ return true;
+ }
if (!isBed(s) || !withStorage(s)) return false;
buildCustom(b, { ...s, custom: bedRecipe(s) });
boxSteps(b, s);
diff --git a/src/lib/plan/families/soluppgang.ts b/src/lib/plan/families/soluppgang.ts
new file mode 100644
index 0000000..9eec57f
--- /dev/null
+++ b/src/lib/plan/families/soluppgang.ts
@@ -0,0 +1,52 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * SOLUPPGÅNG. The outdoor stool is sold assembled, with no manual: two eucalyptus leg frames pivot on bolts and
+ * cross in an X, and the canvas seat hangs between their top bars. Its guide only opens it out.
+ */
+
+/** A leg running from a to b in the x-y plane (mm, relative to the part's middle). */
+function legXY(a: Vec3, b: Vec3, t = 32): PartPiece {
+ const dx = b[0] - a[0], dy = b[1] - a[1];
+ return { shape: "box", size: [t, Math.hypot(dx, dy), t], pos: [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, a[2]], rot: [0, 0, -Math.atan2(dx, dy)] };
+}
+
+function stool(s: ProductSpec): CustomParams {
+ // IKEA: 43 long, 38 wide, 40 high, seat 32 x 32.5
+ const W = Math.round(s.size.w * 10) || 430, H = Math.round(s.size.h * 10) || 400, D = Math.round(s.size.d * 10) || 380;
+ const bar = 36; // the top bars the canvas is wrapped round
+ const yb = H - bar / 2;
+ const xt = W / 2 - bar / 2, xf = W / 2 - 20; // top bars, feet
+ const zo = D / 2 - 16, zi = zo - 34; // outer frame's legs, inner frame's legs
+ // one frame: two legs from its top bar on one side down to the floor on the other, a rail low down between them
+ const frame = (sx: number, z: number): PartPiece[] => [
+ ...[-1, 1].map((g) => legXY([sx * xt, yb, g * z], [-sx * xf, 0, g * z])),
+ { shape: "box", size: [bar, bar, 2 * zo + 32], pos: [sx * xt, yb, 0] },
+ { shape: "box", size: [28, 44, 2 * z - 32], pos: [-sx * (xf - 60), 70, 0] },
+ ];
+ const c: Vec3 = [0, H / 2, 0];
+ const rel = (ps: PartPiece[]) => ps.map((p): PartPiece => ({ ...p, pos: [p.pos[0], p.pos[1] - c[1], p.pos[2]] }));
+ const parts: CustomPart[] = [
+ { id: "O", name: "Outer leg frame", size: [W, H, D], pos: c, pieces: rel(frame(-1, zo)), material: "wood" },
+ { id: "I", name: "Inner leg frame", size: [W, H, 2 * zi + 32], pos: c, pieces: rel(frame(1, zi)), material: "wood" },
+ { id: "S", name: "Canvas seat", size: [2 * xt - bar, 4, 325], pos: [0, H - 6, 0], material: "soft" },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Stand the folded stool on its feet", detail: "It comes assembled, with nothing to screw together: the two leg frames lie together and the canvas hangs loose.", add: ["O"] },
+ { title: "Pull the top bars apart", detail: "Hold a top bar in each hand and open the legs until the canvas is pulled tight. Keep your fingers clear of the pivots.", add: ["I", "S"], from: { I: [-200, 0, 0], S: [-100, -120, 0] }, warnings: ["hand"] },
+ { title: "Check it stands steady", detail: "All four feet on the floor and the seat taut. To fold it, push the top bars together." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["SOLUPPGÅNG", "SOLUPPGANG"],
+ recipe(s) {
+ if (/stool/i.test(s.variant) || /soluppgang-stool/.test(s.slug ?? "")) return stool(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/songesand.ts b/src/lib/plan/families/songesand.ts
index 6dded47..c854bb5 100644
--- a/src/lib/plan/families/songesand.ts
+++ b/src/lib/plan/families/songesand.ts
@@ -10,7 +10,8 @@ import { buildCustom } from "../custom";
* four pins in the open space at the top. The beds are built from their manuals too: the queen and 160 from the
* queen's, the twin with storage boxes from its own (a one-panel headboard on double cam bolts, side rails on round
* connectors, a ready-made footboard, a top cap, a centre bar) and the box set's (two boxes built on their fronts).
- * The chests and the wardrobe have no manual we could find and keep their old guides.
+ * The chests of 4 and 6 drawers follow the US 4- and 6-drawer dressers' manuals. The wardrobe has no manual we
+ * could find and keeps its old guide.
*/
type Fx = Omit<CustomFix, "count" | "at"> & { at: Vec3[] };
@@ -322,7 +323,8 @@ function bed(s: ProductSpec): CustomParams {
...conn(L / 2 - PS - 40),
],
people: 2,
- from: { sideL: [-400, 0, 0], sideR: [400, 0, 0] },
+ // they go on along their dowels, from the foot end towards the posts
+ from: { sideL: [0, 0, 400], sideR: [0, 0, 400] },
},
{
title: "Bolt the side rails to the headboard",
@@ -390,7 +392,7 @@ function bed(s: ProductSpec): CustomParams {
title: "Roll out the slats",
detail: "Across the supports and the beam, then fix the end slats with a screw at each end so they can't move.",
add: slats,
- fix: [fx({ kind: "screw", len: 16, dia: 4, at: [slatZ(0), slatZ(1), slatZ(nSlats - 2), slatZ(nSlats - 1)].flatMap((z) => sx2.map((sx) => [sx * (slatL / 2 - 20), ySl + 10, z] as Vec3)), dir: [0, -1, 0] })],
+ fix: [fx({ kind: "screw", len: 16, dia: 4, at: [slatZ(0), slatZ(1), slatZ(nSlats - 2), slatZ(nSlats - 1)].flatMap((z) => sx2.map((sx) => [sx * (xRail - 11 - 12.5), ySl + 10, z] as Vec3)), dir: [0, -1, 0] })],
tools: ["screwdriver"],
people: 2,
},
@@ -719,9 +721,297 @@ function twinBoxes(b: PlanBuilder) {
});
}
+/** The chests' sizes, shared by the carcass recipe and the drawers. */
+function chestGeo(s: ProductSpec) {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const cols = W > 1200 ? 2 : 1;
+ const n = cols === 2 ? 3 : 4; // drawers in a column
+ const T = 16, TT = 20, P = 70, RT = 60, RM = cols === 2 ? 64 : 40; // panels, top, plinth, top rail, rails between drawers
+ const hs = H - TT;
+ const Dc = D - 20, zc = -10; // the carcass under the top's overhang at the front
+ const zF = zc + Dc / 2, zB = zc - Dc / 2;
+ const colW = (W - 2 * T - (cols - 1) * T) / cols;
+ const cx = (c: number) => -W / 2 + T + colW / 2 + c * (colW + T);
+ const oh = (hs - RT - P - (n - 1) * RM) / n; // drawer opening
+ const yOpen = (r: number) => P + r * (oh + RM); // bottom of opening r, from the floor up
+ return { W, H, D, cols, n, T, TT, P, RT, RM, hs, Dc, zc, zF, zB, colW, cx, oh, yOpen };
+}
+
+/**
+ * The chests' drawers, built on the floor beside it: a front lying face down takes four cam bolts, the sides stand
+ * on it and lock with cams, the bottom slides down the grooves, the back swings in onto dowels and is held with
+ * cam bolts and cams, then the runners and the handle. One is shown; the rest are built the same way.
+ */
+function chestDrawers(b: PlanBuilder, s: ProductSpec) {
+ const { cols, n, colW, cx, oh, yOpen, zF, Dc } = chestGeo(s);
+ const dd = Dc - 70, st = 12, sh = Math.round(oh - 50);
+ const zs = zF - 18 - dd / 2, zBk = zF - 18 - dd + 6, bw = colW - 26 - 2 * st;
+ const frontT = b.part("Drawer front", [colW - 4, oh - 4, 18]);
+ const sideT = b.part("Drawer side", [st, sh, dd]);
+ const bottomT = b.part("Drawer bottom", [bw + 10, 3, dd - 20], { material: "fiber" });
+ const backT = b.part("Drawer back", [bw, sh - 22, st]);
+ const drs: { x: number; yb: number }[] = [];
+ for (let c = 0; c < cols; c++) for (let r = 0; r < n; r++) drs.push({ x: cx(c), yb: yOpen(r) });
+ const sideX = (x: number, g: number) => x + g * (colW / 2 - 13 - st / 2);
+ const all = drs.map((d) => ({
+ d,
+ front: b.place(frontT, [d.x, d.yb + oh / 2, zF - 9]),
+ sides: [-1, 1].map((g) => b.place(sideT, [sideX(d.x, g), d.yb + 10 + sh / 2, zs])),
+ bottom: b.place(bottomT, [d.x, d.yb + 20, zs + 2]),
+ back: b.place(backT, [d.x, d.yb + 32 + (sh - 22) / 2, zBk]),
+ }));
+ type One = (typeof all)[number];
+ const yLo = (d: One["d"]) => d.yb + 35, yHi = (d: One["d"]) => d.yb + 10 + sh - 25;
+ const yB1 = (d: One["d"]) => d.yb + 47, yB2 = (d: One["d"]) => d.yb + 32 + sh - 22 - 30; // back dowels
+ const yC1 = (d: One["d"]) => d.yb + 74, yC2 = (d: One["d"]) => d.yb + 32 + sh - 22 - 5; // back cam bolts
+ const runY = (d: One["d"]) => d.yb + 22;
+ const CB: HwDef = { kind: "camScrew", len: 34, dia: 7 };
+ const CAM: HwDef = { kind: "cam", len: 12, dia: 15 };
+ const DW: HwDef = { kind: "dowel", len: 30, dia: 8 };
+ const RUN: HwDef = { kind: "runner", len: dd - 20, dia: 20, name: "Drawer runner" };
+ const SCR: HwDef = { kind: "screw", len: 12, dia: 4 };
+ const HSCR: HwDef = { kind: "screw", len: 25, dia: 4 };
+ const HANDLE: HwDef = { kind: "handle", len: 128, dia: 12 };
+ const fits = (x: One) => ({
+ frontBolts: [-1, 1].flatMap((g) => [yLo(x.d), yHi(x.d)].map((y): FitOpts => ({ on: x.front, at: [sideX(x.d.x, g), y, zF - 18], dir: [0, 0, 1], mate: x.sides[g < 0 ? 0 : 1] }))),
+ frontCams: [-1, 1].flatMap((g) => [yLo(x.d), yHi(x.d)].map((y): FitOpts => ({ on: x.sides[g < 0 ? 0 : 1], at: [sideX(x.d.x, g) - (g * st) / 2, y, zF - 48], dir: [g, 0, 0] }))),
+ dowels: [-1, 1].flatMap((g) => [yB1(x.d), yB2(x.d)].map((y): FitOpts => ({ on: x.sides[g < 0 ? 0 : 1], at: [sideX(x.d.x, g) - (g * st) / 2, y, zBk], dir: [g, 0, 0], mate: x.back }))),
+ backBolts: [-1, 1].flatMap((g) => [yC1(x.d), yC2(x.d)].map((y): FitOpts => ({ on: x.sides[g < 0 ? 0 : 1], at: [sideX(x.d.x, g) - (g * st) / 2, y, zBk], dir: [g, 0, 0], mate: x.back }))),
+ backCams: [-1, 1].flatMap((g) => [yC1(x.d), yC2(x.d)].map((y): FitOpts => ({ on: x.back, at: [x.d.x + g * (bw / 2 - 30), y, zBk + st / 2], dir: [0, 0, -1] }))),
+ runners: [-1, 1].map((g): FitOpts => ({ on: x.sides[g < 0 ? 0 : 1], at: [sideX(x.d.x, g) + g * 7, runY(x.d), zs], dir: [-g, 0, 0], hole: false })),
+ runnerScrews: [-1, 1].flatMap((g) => [-1, 1].map((e): FitOpts => ({ on: x.sides[g < 0 ? 0 : 1], at: [sideX(x.d.x, g) + g * 10, runY(x.d), zs + e * (dd / 2 - 80)], dir: [-g, 0, 0] }))),
+ handle: [{ on: x.front, at: [x.d.x, x.d.yb + oh / 2, zF], dir: [0, 0, -1], hole: false } as FitOpts],
+ handleScrews: [-64, 64].map((dx): FitOpts => ({ on: x.front, at: [x.d.x + dx, x.d.yb + oh / 2, zF - 18], dir: [0, 0, 1] })),
+ });
+ const x0 = all[0], f0 = fits(x0);
+ const c0: Vec3 = [x0.d.x, x0.d.yb + oh / 2, zs];
+ const stage = (k: string, from: Vec3) => {
+ const it = b.partItem(k);
+ b.stage(k, [it.final.pos[0] - c0[0], it.final.pos[1] - c0[1], it.final.pos[2] - c0[2]], it.final.rot, from);
+ };
+ const N = all.length;
+ const st2 = (title: string, detail: string, kind: "cams" | "dowels" | "drawer" | "screws" | "join", body: () => void, tools?: ("screwdriver" | "hammer")[]) =>
+ b.step({ title, detail, kind, tools, scene: "drawer", pose: "-z" }, body);
+ st2("Screw the cam bolts into a drawer front", "Lay it face down on a rug. Four bolts into its back, by hand.", "cams", () => {
+ stage(x0.front, [0, 0, 200]);
+ b.then(0.15);
+ b.fits(CB, f0.frontBolts, 0.08);
+ }, ["screwdriver"]);
+ st2("Stand the sides on and lock them", "Grooves facing in, onto the bolts. Turn two cam locks in each side.", "cams", () => {
+ b.stagger(0.2);
+ for (const k of x0.sides) stage(k, [0, 0, -260]);
+ b.then(0.15);
+ b.fits(CAM, f0.frontCams, 0.08);
+ }, ["screwdriver"]);
+ st2("Slide the bottom in", "Down the grooves in the sides until it reaches the front.", "drawer", () => stage(x0.bottom, [0, 0, -420]));
+ st2("Tap dowels into the sides", "Two into the inside of each side at the open end.", "dowels", () => b.fits(DW, f0.dowels, 0.08), ["hammer"]);
+ st2("Swing the back in", "Hook one end onto its dowels, swing the other in, then push two cam bolts through each side into it.", "join", () => {
+ stage(x0.back, [220, 0, -220]);
+ b.then(0.15);
+ b.fits(CB, f0.backBolts, 0.08);
+ }, ["screwdriver"]);
+ st2("Lock the back", "Four cam locks in it, turned clockwise.", "cams", () => b.fits(CAM, f0.backCams, 0.08), ["screwdriver"]);
+ st2("Screw the runners on", "One along the bottom of each side, two screws each, wheel at the back.", "screws", () => {
+ b.fits(RUN, f0.runners, 0.15);
+ b.then(0.1);
+ b.fits(SCR, f0.runnerScrews, 0.06);
+ }, ["screwdriver"]);
+ b.step({ title: "Screw on the handle", detail: "Stand the drawer on its bottom. Two screws from the inside of the front.", kind: "screws", tools: ["screwdriver"], scene: "drawer", pose: "+y" }, () => {
+ b.fits(HANDLE, f0.handle, 0.15);
+ b.then(0.1);
+ b.fits(HSCR, f0.handleScrews, 0.08);
+ });
+ // the rest, finished beside the first one
+ b.step({ title: `Build the other ${N - 1} drawers the same way`, detail: "Front, sides, bottom, back, runners and handle, in the same order.", kind: "drawer", scene: "drawer", pose: "+y" }, () => {
+ all.slice(1).forEach((x, j) => {
+ const i = j + 1;
+ const off: Vec3 = [(i % 2) * (colW + 80), Math.floor(i / 2) * (oh + 40), 0];
+ b.stagger(0);
+ for (const k of [x.front, ...x.sides, x.bottom, x.back]) {
+ const it = b.partItem(k);
+ b.stage(k, [it.final.pos[0] - x.d.x + off[0], it.final.pos[1] - x.d.yb - oh / 2 + off[1], it.final.pos[2] - zs + off[2]], it.final.rot);
+ }
+ const f = fits(x);
+ const list: [HwDef, FitOpts[]][] = [[CB, [...f.frontBolts, ...f.backBolts]], [CAM, [...f.frontCams, ...f.backCams]], [DW, f.dowels], [RUN, f.runners], [SCR, f.runnerScrews], [HANDLE, f.handle], [HSCR, f.handleScrews]];
+ for (const [def, l] of list) for (const op of l) b.preset(def, op);
+ b.wait(0.15);
+ });
+ });
+ b.step({ title: "Slide the drawers in", detail: "Onto the runners, all the way in until they click. Fill the bottom drawers first.", kind: "drawer" }, () => {
+ for (const x of all) {
+ b.stagger(0);
+ for (const k of [x.front, ...x.sides, x.bottom, x.back]) b.add(k, [0, 0, 600]);
+ b.wait(0.2);
+ }
+ });
+}
+
+/**
+ * The chests of 4 and 6 drawers (US manuals of the 4- and 6-drawer dressers): built lying on the left side. Runners
+ * and cam bolts go into the sides (and the 6's middle divider) first, the rails stand on the lying side on a dowel
+ * and a cam lock at each end, the back panels (the 4's) drop in between, the other side goes on top, then it is
+ * stood up, the top goes on dowels and cam locks with the wall brackets under it. Each drawer is a front with cam
+ * bolts, two sides on cams, a bottom slid in, a back on dowels and cams, runners and a handle.
+ */
+function chest(s: ProductSpec): CustomParams {
+ const { W, H, D, cols, n, T, TT, P, RT, RM, hs, Dc, zc, zF, zB, colW, cx, oh, yOpen } = chestGeo(s);
+ const walls = cols === 2 ? ["L", "V", "R"] : ["L", "R"];
+ const wallX = (i: number) => (i === 0 ? -W / 2 + T / 2 : i === walls.length - 1 ? W / 2 - T / 2 : 0);
+ const zBR = zB + 10 + T / 2; // back rails stand in front of the back
+ const parts: CustomPart[] = [];
+ const add = (id: string, name: string, size: Vec3, pos: Vec3, o: Partial<CustomPart> = {}) => parts.push({ id, name, size, pos, ...o });
+ add("L", "Side panel", [T, hs, Dc], [wallX(0), hs / 2, zc]);
+ add("R", "Side panel", [T, hs, Dc], [wallX(walls.length - 1), hs / 2, zc]);
+ if (cols === 2) add("V", "Divider", [T, hs, Dc - 10], [0, hs / 2, zc + 5]);
+ add("top", "Top", [W, TT, D], [0, H - TT / 2, 0]);
+ // rails: for each column, a top rail, rails between the drawers and a plinth at the front, a top and a bottom rail at the back
+ type Rail = { id: string; c: number; y: number; h: number; z: number; front: boolean; under?: boolean };
+ const rails: Rail[] = [];
+ for (let c = 0; c < cols; c++) {
+ rails.push({ id: `ft${c}`, c, y: hs - RT / 2, h: RT, z: zF - T / 2, front: true });
+ for (let r = 1; r < n; r++) rails.push({ id: `fm${c}${r}`, c, y: yOpen(r) - RM / 2, h: RM, z: zF - T / 2, front: true, under: true });
+ rails.push({ id: `fp${c}`, c, y: P / 2, h: P, z: zF - T / 2, front: true, under: true });
+ rails.push({ id: `bt${c}`, c, y: hs - RT / 2, h: RT, z: zBR, front: false });
+ rails.push({ id: `bb${c}`, c, y: P / 2, h: P, z: zBR, front: false });
+ }
+ for (const r of rails) add(r.id, r.front ? (r.id.startsWith("fp") ? "Plinth" : "Front rail") : "Back rail", [colW, r.h, T], [cx(r.c), r.y, r.z]);
+ // the 4's back is four panels on dowels between the sides, the 6's one hardboard slid down grooves
+ const nb = cols === 1 ? 4 : 0;
+ const bh = (hs - RT - P) / Math.max(1, nb);
+ for (let i = 0; i < nb; i++) add(`bk${i}`, "Back panel", [colW, bh - 2, 10], [cx(0), P + bh * (i + 0.5), zB + 5]);
+ if (cols === 2) add("back", "Back panel", [W - 2 * T + 16, hs - 10, 3], [0, (hs - 10) / 2 + 5, zB + 6], { material: "fiber" });
+
+ // drawers (built in their own scene, see chestDrawers)
+ const dd = Dc - 70;
+ type Dr = { i: number; c: number; r: number; x: number; yb: number };
+ const drs: Dr[] = [];
+ for (let c = 0; c < cols; c++) for (let r = 0; r < n; r++) drs.push({ i: drs.length, c, r, x: cx(c), yb: yOpen(r) });
+
+ // ---------- fittings ----------
+ const wallOf = (c: number, g: number) => walls[g < 0 ? c : c + 1];
+ const faceX = (c: number, g: number) => cx(c) + g * (colW / 2); // the inner face of a column's wall
+ // a rail end: a dowel above the middle, the cam bolt below it in the wall, the cam lock in the rail beside it
+ // the dowel above the middle of a rail end, the cam bolt below; the right column's sit further out where both
+ // columns meet the divider, so the two faces' fittings don't share a spot
+ const off = (r: Rail, g: number) => (cols === 2 && r.c === 1 && g < 0 ? 27.5 : 11.5);
+ const railDowels = (list: Rail[]): CustomFix[] => list.flatMap((r) => [-1, 1].map((g) => fx({ kind: "dowel", at: [[faceX(r.c, g), r.y + off(r, g), r.z]], dir: [-g, 0, 0], on: r.id, mate: wallOf(r.c, g) })));
+ const railBolts = (wall: string, list: Rail[]): CustomFix => {
+ const at: Vec3[] = [];
+ for (const r of list) for (const g of [-1, 1]) if (wallOf(r.c, g) === wall) at.push([faceX(r.c, g), r.y - off(r, g), r.z]);
+ const x = at[0][0], g = x < wallX(walls.indexOf(wall)) ? 1 : -1;
+ return fx({ kind: "camScrew", at, dir: [g, 0, 0], on: wall });
+ };
+ const railCams = (wall: string, list: Rail[]): CustomFix[] =>
+ list.flatMap((r) => [-1, 1].filter((g) => wallOf(r.c, g) === wall).map((g) => fx({ kind: "cam", dia: 15, at: [[faceX(r.c, g) - g * 30, r.y - off(r, g), r.front ? r.z - T / 2 : r.z + T / 2]], dir: [0, 0, r.front ? 1 : -1], on: r.id })));
+ const panelDowels = (): CustomFix[] => range(nb).flatMap((i) => [-1, 1].map((g) => fx({ kind: "dowel", at: [[faceX(0, g), P + bh * (i + 0.5), zB + 5]], dir: [-g, 0, 0], on: `bk${i}`, mate: g < 0 ? "L" : "R" })));
+ const runnerY = (d: Dr) => d.yb + 22;
+ const zRun = zF - Dc / 2 - 15, runLen = Dc - 60;
+ const carcassRunners = (wall: string, only?: number): CustomFix[] => {
+ const pts: { x: number; g: number; y: number }[] = [];
+ for (const d of drs) for (const g of [-1, 1]) if (wallOf(d.c, g) === wall && (only === undefined || g === only)) pts.push({ x: faceX(d.c, g), g, y: runnerY(d) });
+ return [
+ fx({ kind: "runner", name: "Drawer runner", len: runLen, dia: 20, at: pts.map((p) => [p.x - p.g * 5, p.y, zRun] as Vec3), dir: [pts[0].g, 0, 0], on: wall }),
+ fx({ kind: "screw", len: 12, dia: 4, at: pts.flatMap((p) => [-1, 0, 1].map((e) => [p.x - p.g * 8, p.y, zRun + e * (runLen / 2 - 40)] as Vec3)), dir: [pts[0].g, 0, 0], on: wall }),
+ ];
+ };
+ const wallRails = (wall: string) => rails.filter((r) => wallOf(r.c, -1) === wall || wallOf(r.c, 1) === wall);
+ const front = rails.filter((r) => r.front), back = rails.filter((r) => !r.front);
+ const stops = rails.filter((r) => r.under || r.id.startsWith("bb")).map((r) => [cx(r.c), r.y + r.h / 2, r.front ? r.z - 20 : r.z] as Vec3);
+ const xT = (W / 2 - T / 2);
+ const topXs = cols === 2 ? [-xT, 0, xT] : [-xT, xT];
+ const topDowels = fx({ kind: "dowel", at: [...topXs.flatMap((x) => [-1, 1].map((k) => [x, hs, zc + k * (Dc / 2 - 50)] as Vec3)), ...(cols === 1 ? [-1, 1].map((k) => [k * colW / 4, hs, zBR] as Vec3) : [])], dir: [0, -1, 0] });
+ const topBolts = fx({ kind: "camScrew", at: topXs.flatMap((x) => [-1, 1].map((k) => [x, hs, zc + k * (Dc / 2 - 110)] as Vec3)), dir: [0, 1, 0], on: "top" });
+ const topCams = topXs.flatMap((x, i) =>
+ (x === 0 ? [-1] : [Math.sign(x)]).map((g) => fx({ kind: "cam", dia: 15, at: [-1, 1].map((k) => [x - g * T / 2, hs - 30, zc + k * (Dc / 2 - 110)] as Vec3), dir: [g, 0, 0], on: walls[i] })),
+ );
+ const bx = [-1, 1].map((g) => g * (W / 2 - 120));
+ const brackets: Vec3[] = bx.map((x) => [x, H - TT, -D / 2 + 6]);
+ const sides2 = ["L", "R"];
+ const steps: CustomStep[] = [];
+ const push = (st: CustomStep) => steps.push(st);
+ const inner = cols === 2;
+
+ push({
+ title: "Screw the runners onto a side",
+ detail: `Lay the left side on a rug, inside up. ${n} runners, three screws each. They are marked CL and CR: keep them to the side shown.`,
+ add: ["L"],
+ fix: carcassRunners("L"),
+ tools: ["screwdriver"],
+ pose: "+x",
+ warnings: ["floor"],
+ });
+ push({
+ title: "Screw the cam bolts into the sides",
+ detail: inner ? "By hand until they stop, into both sides and both faces of the divider. Screw the runners onto the right side and both faces of the divider the same way." : `${front.length + back.length} in each side, by hand until they stop. Screw the runners onto the right side the same way.`,
+ fix: [railBolts("L", rails), railBolts("R", rails), ...(inner ? [railBolts("V", rails.filter((r) => r.c === 0)), railBolts("V", rails.filter((r) => r.c === 1))] : []), ...carcassRunners("R"), ...(inner ? [...carcassRunners("V", 1), ...carcassRunners("V", -1)] : [])],
+ wait: inner ? ["R", "V"] : ["R"],
+ tools: ["screwdriver"],
+ });
+ const col0 = rails.filter((r) => r.c === 0), col1 = rails.filter((r) => r.c === 1);
+ push({
+ title: "Tap dowels into the rails" + (nb ? " and back panels" : ""),
+ detail: `One into each end${nb ? " of every rail and back panel" : ""}.`,
+ fix: [...railDowels(rails), ...panelDowels()],
+ wait: [...rails.map((r) => r.id), ...range(nb).map((i) => `bk${i}`)],
+ tools: ["hammer"],
+ });
+ push({ title: inner ? "Stand the left column's rails on the side" : "Stand the front rails on the side", detail: "Dowel ends down into the holes, the plinth at the bottom.", add: (inner ? col0 : front).filter((r) => r.front).map((r) => r.id) });
+ push({ title: "Stand the back rails on", detail: "One at the top and one at the bottom, behind the front ones.", add: (inner ? col0 : back).filter((r) => !r.front).map((r) => r.id) });
+ push({ title: "Lock the rails to the side", detail: "One cam lock in the end of each rail, arrow towards the bolt, turned clockwise.", fix: railCams("L", rails), tools: ["screwdriver"] });
+ if (nb) push({ title: "Drop the back panels in", detail: "Four of them, between the back rails, onto the dowel holes.", add: range(nb).map((i) => `bk${i}`) });
+ if (inner) {
+ push({ title: "Lay the divider on", detail: "Runners facing up, onto the rails' dowels. Then turn its cam locks.", add: ["V"], fix: railCams("V", col0), tools: ["screwdriver"] });
+ push({ title: "Stand the right column's rails on the divider", detail: "The same way as the first column.", add: col1.map((r) => r.id) });
+ }
+ push({ title: "Lay the other side on top", detail: "Runners facing down, onto all the dowels. Then lock every rail with its cam lock.", add: ["R"], fix: railCams("R", rails), tools: ["screwdriver"], people: 2, warnings: ["two"] });
+ if (inner) push({ title: "Lock the right column's rails to the divider", detail: "Its cam locks, turned clockwise.", fix: railCams("V", col1), tools: ["screwdriver"] });
+ const corner = range(cols).flatMap((c) => [-1, 1].map((g) => ({ x: faceX(c, g) - g * 20, g, c })));
+ push({
+ title: "Screw the corner brackets on",
+ detail: "Inside, where the bottom back rail meets each wall: one screw into the rail and one into the wall.",
+ fix: [
+ fx({ kind: "angle", name: "Corner bracket", len: 30, dia: 24, at: corner.map((p) => [p.x, P, zBR] as Vec3), dir: [0, -1, 0] }),
+ fx({ kind: "screw", len: 12, dia: 4, at: corner.map((p) => [p.x - p.g * 25, P + 2, zBR] as Vec3), dir: [0, -1, 0] }),
+ ...corner.map((p) => fx({ kind: "screw", len: 12, dia: 4, at: [[faceX(p.c, p.g) - p.g * 2, P + 25, zBR]], dir: [p.g, 0, 0], on: wallOf(p.c, p.g) })),
+ ],
+ tools: ["screwdriver"],
+ });
+ push({ title: "Stand it up together", detail: "Lift it onto its plinth, don't drag it by one corner.", pose: "+y", people: 2, warnings: ["two"] });
+ push({ title: "Push in the drawer stops", detail: "One on the rail under each drawer and one on each bottom back rail, pegs into the holes.", fix: [fx({ kind: "clip", name: "Drawer stop", len: 20, dia: 12, at: stops, dir: [0, -1, 0] })] });
+ if (inner) {
+ push({ title: "Slide the back down into the grooves", detail: "From the top, smooth side facing in, all the way down.", add: ["back"], from: { back: [0, 500, 0] } });
+ push({ title: "Clip the back on", detail: "Clips through the back into the rails and the divider, then press a wedge into each.", fix: [fx({ kind: "clip", name: "Back clip", len: 14, dia: 12, at: [...range(cols).flatMap((c) => [cx(c) - colW / 4, cx(c) + colW / 4].flatMap((x) => [P / 2, hs - RT / 2].map((y) => [x, y, zB + 7] as Vec3))), ...[-1, 1].flatMap((g) => [0.3, 0.6].map((f) => [g * 2, hs * f, zB + 7] as Vec3))], dir: [0, 0, 1] })] });
+ }
+ push({
+ title: "Prepare the top",
+ detail: `Upside down on the rug: the two wall brackets at the back, one screw each, then ${topBolts.at!.length} cam bolts.`,
+ fix: [fx({ kind: "angle", name: "Wall bracket", len: 80, dia: 30, at: brackets, dir: [0, 1, 0], on: "top" }), fx({ kind: "screw", len: 12, dia: 4, at: brackets.map((p) => [p[0], p[1], p[2] + 25] as Vec3), dir: [0, 1, 0], on: "top" }), topBolts],
+ wait: ["top"],
+ tools: ["screwdriver"],
+ });
+ push({ title: "Tap dowels into the top edges", detail: `${topDowels.at!.length} of them, into the tops of the sides${inner ? " and the divider" : " and the back rail"}.`, fix: [topDowels], tools: ["hammer"] });
+ push({ title: "Put the top on and lock it", detail: "Down onto the dowels and bolts, then turn the cam locks inside.", add: ["top"], fix: topCams, tools: ["screwdriver"] });
+ const wall: Vec3[] = bx.map((x) => [x, H - TT - 30, -D / 2 - 2]);
+ push({
+ title: "Screw it to the wall",
+ detail: "Push it against the wall, mark through the brackets, drill and fix them. Screws and plugs for your wall aren't included.",
+ fix: [fx({ kind: "plug", len: 35, dia: 8, at: wall.map((p) => [p[0], p[1], p[2] - 40] as Vec3), dir: [0, 0, -1] }), fx({ kind: "screw", len: 50, dia: 5, at: wall, dir: [0, 0, -1] })],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ });
+
+ return { parts, steps: splitSides(steps) };
+}
+
const family: Family = {
names: ["SONGESAND"],
build(b, s) {
+ if (/songesand-chest-[46]-drawers/.test(s.slug ?? "")) {
+ buildCustom(b, { ...s, custom: chest(s) });
+ chestDrawers(b, s);
+ return true;
+ }
if (!/songesand-bed-frame-2-storage-boxes-twin/.test(s.slug ?? "")) return false;
buildCustom(b, { ...s, custom: twinBed(s) });
twinBoxes(b);
diff --git a/src/lib/plan/families/sotenas.ts b/src/lib/plan/families/sotenas.ts
index 0ad2109..b8d26e6 100644
--- a/src/lib/plan/families/sotenas.ts
+++ b/src/lib/plan/families/sotenas.ts
@@ -35,7 +35,7 @@ function armchair(): CustomParams {
const y0 = TUBE / 2, yT = 230 - TUBE / 2; // floor tubes, hoops' top bars under the seat
const HX = 260, ZF = 200, ZB = -120, ZJ = -200; // hoops, their front and back, where they meet the floor bar
const hoop = (id: string, g: number) =>
- tube(id, "Side hoop", [[g * HX, y0, ZJ], [g * HX, y0, ZF], [g * HX, yT, ZF], [g * HX, yT, ZB], [g * HX, y0, ZB]]);
+ tube(id, "Side hoop", [[g * HX, y0, ZJ - 40], [g * HX, y0, ZF], [g * HX, yT, ZF], [g * HX, yT, ZB], [g * HX, y0, ZB]]);
const sc: Vec3 = [0, 455, -5];
const seat: CustomPart = {
id: "S",
@@ -49,7 +49,7 @@ function armchair(): CustomParams {
{ shape: "box", size: [800, 420, 130], pos: [0, 470 - sc[1], -290 - sc[2]], rot: [-0.35, 0, 0] },
],
};
- const joint = (g: number): Vec3 => [g * HX, y0, ZJ - 30];
+ const joint = (g: number): Vec3 => [g * HX, y0 + TUBE / 2, ZJ - 20]; // down through the bar into the hoop's end inside it
const top = (g: number): Vec3[] => [ZF - 60, ZB + 60].map((z): Vec3 => [g * HX, yT - TUBE / 2, z]);
return {
parts: [
diff --git a/src/lib/plan/families/spiksmed.ts b/src/lib/plan/families/spiksmed.ts
index 5f0f63e..bc8888a 100644
--- a/src/lib/plan/families/spiksmed.ts
+++ b/src/lib/plan/families/spiksmed.ts
@@ -1,5 +1,7 @@
import type { Family } from "./family";
-import type { CustomFix, CustomParams, CustomPart, CustomStep, HwKind, PartPiece, Vec3 } from "../../types";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, HwKind, PartPiece, ProductSpec, Vec3 } from "../../types";
+import type { FitOpts, HwDef, PlanBuilder } from "../builder";
+import { buildCustom } from "../custom";
/**
* SPIKSMED, read from IKEA's manuals for the 59.5x96 cabinet and the 117x32 media shelf.
@@ -11,7 +13,12 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, HwKind, PartPiece
* held by rivets and clips, nail-on glides go under the sides, then the shelf pins, the shelf and the wall screws.
* Media shelf: tracks into the top and bottom, wall hangers and cam bolts on the panels, built upside down on the
* top panel (an end, the divider, the bottom, the door with its guide, the other end), then hung on four screws,
- * the hangers adjusted and covered. The sideboard (drawers, a divider, 52 steps) keeps its old guide for now.
+ * the hangers adjusted and covered.
+ * Sideboard: runners and cam bolts go on the sides and the divider first; standing on the bottom, the left side,
+ * the left shelf (with its door tracks), the divider, the right shelf and the right side are locked on in turn, the
+ * back halves slide down their grooves, the doors (a guide on each) go into the tracks and the top closes it. Lying
+ * on its front it takes its glides and the back connectors, then it's stood up, fixed to the wall, the loose shelves
+ * go on pins and the two drawers are built (front, sides, bottom, back) and slid onto their runners.
*/
const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
@@ -111,10 +118,13 @@ function cabinetRecipe(): CustomParams {
title: "Screw a guide onto the top of each door",
detail: "Two screws each, on the top edge, so the door runs in the upper track.",
fix: [
- fx("clip", [pt(-xi + dw / 2, dy1, zDoor[1]), pt(xi - dw / 2, dy1, zDoor[0])], [0, -1, 0], { name: "Door guide", len: 20, dia: 14, on: "DB" }),
- fx("screw", [-12, 12].flatMap((d) => [pt(-xi + dw / 2 + d, dy1, zDoor[1]), pt(xi - dw / 2 + d, dy1, zDoor[0])]), [0, -1, 0], { len: 12, dia: 3.5 }),
+ fx("clip", [pt(-xi + dw / 2, dy1, zDoor[1])], [0, -1, 0], { name: "Door guide", len: 20, dia: 14, on: "DB" }),
+ fx("clip", [pt(xi - dw / 2, dy1, zDoor[0])], [0, -1, 0], { name: "Door guide", len: 20, dia: 14, on: "DF" }),
+ fx("screw", [-12, 12].map((d) => pt(-xi + dw / 2 + d, dy1, zDoor[1])), [0, -1, 0], { len: 12, dia: 3.5, on: "DB" }),
+ fx("screw", [-12, 12].map((d) => pt(xi - dw / 2 + d, dy1, zDoor[0])), [0, -1, 0], { len: 12, dia: 3.5, on: "DF" }),
],
tools: ["screwdriver"],
+ wait: ["DB", "DF"],
},
{
title: "Slide the doors into the tracks",
@@ -219,7 +229,8 @@ function mediaRecipe(): CustomParams {
{
title: "Press the door tracks into the top and bottom",
detail: "Lay both long panels on a rug, grooves up, and press a track into each groove along its whole length.",
- add: ["TP", "TB", "BT", "TT"],
+ add: ["TP", "TT"],
+ wait: ["BT"],
pose: "-y",
warnings: ["floor"],
},
@@ -254,7 +265,7 @@ function mediaRecipe(): CustomParams {
{
title: "Screw a wall hanger to each end panel",
detail: "On the inside face near the back, two screws each, and a keyhole plate clipped in.",
- add: ["E0", "E1"],
+ wait: ["E0", "E1"],
fix: [
...S.map((sx, i) => fx("angle", [endH[i]], [sx, 0, 0], { name: "Wall hanger", len: 50, dia: 50, on: `E${i}`, twist: Math.PI / 2 })),
...S.map((sx, i) => fx("screw", [-14, 14].map((d) => pt(sx * xi, endH[i][1] + d, zh + 18)), [sx, 0, 0], { len: 12, dia: 4, on: `E${i}` })),
@@ -271,6 +282,7 @@ function mediaRecipe(): CustomParams {
{
title: "Push an end panel onto the top",
detail: "The top lies upside down on the rug, tracks up. Press the end panel onto its dowels.",
+ add: ["E0"],
},
{
title: "Lock the end panel to the top",
@@ -297,6 +309,8 @@ function mediaRecipe(): CustomParams {
{
title: "Lower the bottom onto it",
detail: "Its dowels and cam bolts into the end panel and the divider.",
+ add: ["BT", "TB"],
+ from: { BT: [300, -300, 0], TB: [300, -300, 0] },
},
{
title: "Lock the bottom",
@@ -311,11 +325,13 @@ function mediaRecipe(): CustomParams {
title: "Fit the guide on the door",
detail: "Hook it over the top edge of the door, in the middle.",
fix: [fx("clip", [pt(-xi + dW / 2, dy1, dz)], [0, -1, 0], { name: "Door guide", len: 20, dia: 14, on: "DR" })],
+ wait: ["DR"],
},
{
title: "Screw the guide down",
detail: "Two short screws.",
- fix: [fx("screw", [-12, 12].map((d) => pt(-xi + dW / 2 + d, dy1, dz)), [0, -1, 0], { len: 10, dia: 3.5 })],
+ fix: [fx("screw", [-12, 12].map((d) => pt(-xi + dW / 2 + d, dy1, dz)), [0, -1, 0], { len: 10, dia: 3.5, on: "DR" })],
+ wait: ["DR"],
tools: ["screwdriver"],
},
{
@@ -327,6 +343,7 @@ function mediaRecipe(): CustomParams {
{
title: "Push on the other end panel",
detail: "Onto the dowels in the top and the bottom.",
+ add: ["E1"],
},
{
title: "Lock it and turn the shelf over",
@@ -377,6 +394,395 @@ function mediaRecipe(): CustomParams {
return { parts, steps };
}
+
+/* ---------------------------------------------------------------- sideboard */
+
+const SB = { W: 970, H: 795, D: 400 };
+const SB_Y0 = 6; // glides under the bottom
+const SB_YS = 480; // underside of the fixed shelves over the doors
+const SB_CW = SB.W / 2 - T - T / 2; // inside width of each half
+const SB_ZB = -SB.D / 2 + 12; // the back halves sit in grooves this far in
+const SB_DRAWER_Y = 700; // runner height
+
+function sideboardParts(): CustomPart[] {
+ const { W, H, D } = SB;
+ const yb = SB_Y0 + T, yt = H - T; // top of the bottom, underside of the top
+ const uh = yt - yb;
+ const zf = D / 2;
+ const dvD = zf - 50 - (SB_ZB + 2);
+ const shD = zf - (SB_ZB + 2);
+ const half = (sx: number) => sx * (T / 2 + SB_CW / 2);
+ const dH = SB_YS - 6 - (yb + 6);
+ const zDoor = [zf - 10, zf - 28]; // front and back door
+ return [
+ { id: "BT", name: "Bottom", size: [W, T, D], pos: [0, SB_Y0 + T / 2, 0] },
+ { id: "TB0", name: "Door track", size: [W - 2 * T, 6, 10], pos: [0, yb + 3, zDoor[0]], material: "metal" },
+ { id: "TB1", name: "Door track", size: [W - 2 * T, 6, 10], pos: [0, yb + 3, zDoor[1]], material: "metal" },
+ { id: "SL", name: "Side", size: [T, uh, D], pos: [-(W / 2 - T / 2), yb + uh / 2, 0] },
+ { id: "SR", name: "Side", size: [T, uh, D], pos: [W / 2 - T / 2, yb + uh / 2, 0] },
+ { id: "LS", name: "Shelf", size: [SB_CW, T, shD], pos: [half(-1), SB_YS + T / 2, (SB_ZB + 2 + zf) / 2] },
+ { id: "RS", name: "Shelf", size: [SB_CW, T, shD], pos: [half(1), SB_YS + T / 2, (SB_ZB + 2 + zf) / 2] },
+ ...S.flatMap((sx, i) => zDoor.map((z, k): CustomPart => ({ id: `T${i}${k}`, name: "Upper door track", size: [SB_CW, 6, 10], pos: [half(sx), SB_YS - 3, z], material: "metal" }))),
+ { id: "DV", name: "Divider", size: [T, uh, dvD], pos: [0, yb + uh / 2, SB_ZB + 2 + dvD / 2] },
+ ...S.map((sx, i): CustomPart => ({ id: `B${i}`, name: "Back half", size: [SB_CW + T, uh, 3], pos: [sx * (SB_CW / 2 + T / 2), yb + uh / 2, SB_ZB], material: "fiber" })),
+ { id: "DB", name: "Sliding door", size: [480, dH, T], pos: [-(SB.W / 2 - T) + 240, yb + 6 + dH / 2, zDoor[1]] },
+ { id: "DF", name: "Sliding door", size: [480, dH, T], pos: [SB.W / 2 - T - 240, yb + 6 + dH / 2, zDoor[0]] },
+ { id: "TP", name: "Top", size: [W, T, D], pos: [0, H - T / 2, 0] },
+ ...S.map((sx, i): CustomPart => ({ id: `L${i}`, name: "Loose shelf", size: [SB_CW - 2, T, 300], pos: [half(sx), 250, SB_ZB + 2 + 150] })),
+ ];
+}
+
+function sideboardRecipe(): CustomParams {
+ const { W, H, D } = SB;
+ const yb = SB_Y0 + T, yt = H - T;
+ const xo = W / 2 - T / 2, xi = W / 2 - T;
+ const parts = sideboardParts();
+ const dz = [-110, 90]; // the two fittings along each joint, front to back
+ const ux = [-xo, 0, xo];
+ const uid = ["SL", "DV", "SR"];
+ const zOf = (i: number) => (i === 1 ? [-120, 60] : dz);
+ // the bottom's dowels stick up into the uprights, the top's down into them; cam bolts in the uprights' ends
+ const botDowels = ux.map((x, i) => fx("dowel", zOf(i).map((z) => pt(x, yb, z)), [0, -1, 0], { on: "BT", len: 30, dia: 8 }));
+ const topDowels = ux.map((x, i) => fx("dowel", zOf(i).map((z) => pt(x, yt, z)), [0, 1, 0], { on: "TP", len: 30, dia: 8 }));
+ const camB = (i: number) => [
+ fx("camScrew", zOf(i).map((z) => pt(ux[i], yb, z + 40)), [0, 1, 0], { on: uid[i] }),
+ fx("camScrew", zOf(i).map((z) => pt(ux[i], yt, z + 40)), [0, -1, 0], { on: uid[i] }),
+ ];
+ const camL = (y: number, up: boolean, on: string, i: number) =>
+ fx("cam", zOf(i).map((z) => pt(ux[i] + (i === 0 ? 34 : i === 2 ? -34 : 34), up ? y + T : y, z + 40)), [0, up ? -1 : 1, 0], { on, ...CAM_A });
+ const ys = SB_YS + T / 2;
+ const runnerAt = (x: number, d: number, on: string) => fx("runner", [pt(x, SB_DRAWER_Y, 10)], [d, 0, 0], { len: 340, dia: 30, name: "Drawer runner", on });
+ const runnerScrews = (x: number, d: number, on: string) => fx("screw", [-120, 140].map((z) => pt(x, SB_DRAWER_Y, z)), [d, 0, 0], { len: 12, dia: 4, on });
+ const guideY = SB_YS - 6;
+ const steps: CustomStep[] = [
+ {
+ title: "Press the door tracks into the bottom",
+ detail: "Lay the bottom on a rug, grooves up, and push both tracks into their grooves along their whole length.",
+ add: ["BT", "TB0", "TB1"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw a drawer runner inside each side",
+ detail: "Near the top, the wheel end at the front. Two screws each.",
+ fix: [runnerAt(-xi, -1, "SL"), runnerScrews(-xi, -1, "SL"), runnerAt(xi, 1, "SR"), runnerScrews(xi, 1, "SR")],
+ wait: ["SL", "SR"],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the drawer runners onto the divider",
+ detail: "One on each face, both wheel ends at the front. Two screws each.",
+ fix: [runnerAt(-T / 2, 1, "DV"), runnerScrews(-T / 2, 1, "DV"), runnerAt(T / 2, -1, "DV"), runnerScrews(T / 2, -1, "DV")],
+ wait: ["DV"],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the cam bolts into the sides and the divider",
+ detail: "Two in the top end and two in the bottom end of each, twelve in all, by hand until they stop.",
+ fix: [0, 1, 2].flatMap(camB),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw in the cam bolts for the shelves",
+ detail: "One in the inside face of each side and one in each face of the divider, at the shelf holes.",
+ fix: [
+ fx("camScrew", [pt(-xi, ys, 20)], [-1, 0, 0], { on: "SL" }),
+ fx("camScrew", [pt(xi, ys, 20)], [1, 0, 0], { on: "SR" }),
+ fx("camScrew", [pt(-T / 2, ys, 20)], [1, 0, 0], { on: "DV" }),
+ fx("camScrew", [pt(T / 2, ys, 20)], [-1, 0, 0], { on: "DV" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap the dowels into the bottom",
+ detail: "Two where each side stands and two in the middle for the divider.",
+ fix: botDowels,
+ tools: ["hammer"],
+ },
+ {
+ title: "Stand the left side on the bottom",
+ detail: "Down onto its dowels and cam bolts, runner inside.",
+ add: ["SL"],
+ },
+ {
+ title: "Lock the left side",
+ detail: "Two cam locks in the bottom, arrow towards the bolt, then turn clockwise.",
+ fix: [camL(SB_Y0, true, "BT", 0)],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap two dowels into the left shelf",
+ detail: "In the end that meets the side.",
+ fix: [fx("dowel", [-100, 120].map((z) => pt(-xi, ys, z)), [1, 0, 0], { on: "LS", len: 30, dia: 8 })],
+ wait: ["LS"],
+ tools: ["hammer"],
+ },
+ {
+ title: "Push the left shelf into the side",
+ detail: "Door tracks underneath, at the front. Its dowels go into the side.",
+ add: ["LS", "T00", "T01"],
+ },
+ {
+ title: "Lock the shelf to the side",
+ detail: "One cam lock in the top of the shelf.",
+ fix: [fx("cam", [pt(-xi + 34, SB_YS + T, 20)], [0, -1, 0], { on: "LS", name: "Cam lock (small)", len: 11, dia: 12 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Stand the divider in the middle",
+ detail: "Tilt it in so its cam bolt goes into the shelf's end, then lower it onto the dowels in the bottom.",
+ add: ["DV"],
+ from: { DV: [260, 320, 0] },
+ },
+ {
+ title: "Lock the divider",
+ detail: "Two cam locks in the bottom and a small one in the shelf.",
+ fix: [camL(SB_Y0, true, "BT", 1), fx("cam", [pt(-T / 2 - 34, SB_YS + T, 20)], [0, -1, 0], { on: "LS", name: "Cam lock (small)", len: 11, dia: 12 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Tap the long dowels into the divider",
+ detail: "Two in its right face, at the shelf holes.",
+ fix: [fx("dowel", [-100, 120].map((z) => pt(T / 2, ys, z)), [-1, 0, 0], { on: "DV", len: 40, dia: 8 })],
+ tools: ["hammer"],
+ },
+ {
+ title: "Tap two dowels into the right shelf",
+ detail: "In the end that meets the right side.",
+ fix: [fx("dowel", [-100, 120].map((z) => pt(xi, ys, z)), [-1, 0, 0], { on: "RS", len: 30, dia: 8 })],
+ wait: ["RS"],
+ tools: ["hammer"],
+ },
+ {
+ title: "Push the right shelf onto the divider",
+ detail: "Tracks underneath at the front, onto the long dowels and the cam bolt.",
+ add: ["RS", "T10", "T11"],
+ },
+ {
+ title: "Put on the right side",
+ detail: "Together: tilt it onto the shelf's dowels, then lower it onto the bottom.",
+ add: ["SR"],
+ from: { SR: [300, 320, 0] },
+ people: 2,
+ },
+ {
+ title: "Lock the right side and the shelf",
+ detail: "Two cam locks in the bottom and two small ones in the shelf.",
+ fix: [camL(SB_Y0, true, "BT", 2), fx("cam", [pt(xi - 34, SB_YS + T, 20), pt(T / 2 + 34, SB_YS + T, 20)], [0, -1, 0], { on: "RS", name: "Cam lock (small)", len: 11, dia: 12 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Slide the back halves down the grooves",
+ detail: "One each side of the divider, smooth side out, all the way down to the bottom.",
+ add: ["B0", "B1"],
+ from: { B0: [0, 820, 0], B1: [0, 820, 0] },
+ },
+ {
+ title: "Screw a guide onto the top of each door",
+ detail: "Two screws each, at the top edge, near the end that will stay out of sight.",
+ fix: [
+ fx("clip", [pt(-xi + 240, guideY, SB.D / 2 - 28)], [0, -1, 0], { name: "Door guide", len: 24, dia: 14, on: "DB" }),
+ fx("clip", [pt(xi - 240, guideY, SB.D / 2 - 10)], [0, -1, 0], { name: "Door guide", len: 24, dia: 14, on: "DF" }),
+ fx("screw", [-26, 26].map((d) => pt(-xi + 240 + d, guideY, SB.D / 2 - 28)), [0, -1, 0], { len: 12, dia: 4, on: "DB" }),
+ fx("screw", [-26, 26].map((d) => pt(xi - 240 + d, guideY, SB.D / 2 - 10)), [0, -1, 0], { len: 12, dia: 4, on: "DF" }),
+ ],
+ wait: ["DB", "DF"],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Put the doors into the tracks",
+ detail: "Guide up into the track under the shelf, then down into the bottom track: the left door at the back, the right door at the front.",
+ add: ["DB", "DF"],
+ from: { DB: [0, 0, 300], DF: [0, 0, 300] },
+ },
+ {
+ title: "Tap the dowels into the top",
+ detail: "Two over each side and two over the divider, on the underside.",
+ fix: topDowels,
+ wait: ["TP"],
+ tools: ["hammer"],
+ },
+ { title: "Lower the top on", detail: "Onto the dowels and cam bolts of both sides and the divider.", add: ["TP"], people: 2 },
+ { title: "Lock the top", detail: "Six cam locks, two over each upright.", fix: ux.map((_, i) => camL(yt, false, "TP", i)), tools: ["screwdriver"] },
+ {
+ title: "Lay it on its front and knock in the glides",
+ detail: "On a rug. One glide under each corner of the bottom.",
+ fix: [fx("glide", S.flatMap((sx) => [-160, 160].map((z) => pt(sx * (xo - 20), 0, z))), [0, 1, 0], { name: "Nail-on glide", len: 6, dia: 16 })],
+ pose: "-z",
+ tools: ["hammer"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Press the cable ring into the back",
+ detail: "Into the round hole in the right back half.",
+ fix: [fx("cap", [pt(xo - 180, 640, SB_ZB - 2)], [0, 0, 1], { name: "Cable grommet", len: 6, dia: 40 })],
+ pose: "-z",
+ },
+ {
+ title: "Fix the back halves with the connectors",
+ detail: "Twelve along the sides, the divider, the top and the bottom: push each sleeve in, then its pin.",
+ fix: [
+ fx("clip", [...[-xo, 0, xo].flatMap((x) => [200, 560].map((y) => pt(x, y, SB_ZB - 2))), ...S.flatMap((sx) => [yb - 8, yt + 8].map((y) => pt(sx * 240, y, SB_ZB - 2))), pt(-240, 480, SB_ZB - 2), pt(240, 480, SB_ZB - 2)], [0, 0, 1], { name: "Back connector sleeve", len: 12, dia: 10 }),
+ fx("clip", [...[-xo, 0, xo].flatMap((x) => [200, 560].map((y) => pt(x, y, SB_ZB - 3))), ...S.flatMap((sx) => [yb - 8, yt + 8].map((y) => pt(sx * 240, y, SB_ZB - 3))), pt(-240, 480, SB_ZB - 3), pt(240, 480, SB_ZB - 3)], [0, 0, 1], { name: "Back connector pin", len: 14, dia: 8 }),
+ ],
+ pose: "-z",
+ },
+ {
+ title: "Stand it up and clip in the wall fittings",
+ detail: "One inside each side, just under the shelves at the back.",
+ fix: S.map((sx) => fx("bracket", [pt(sx * xi, SB_YS - 40, SB_ZB + 24)], [-sx, 0, 0], { name: "Wall fitting", len: 30, dia: 30, on: sx < 0 ? "SL" : "SR" })),
+ pose: "+y",
+ people: 2,
+ },
+ {
+ title: "Screw a knob onto each wall fitting",
+ detail: "Turn it on by hand. It sets the gap to the wall.",
+ fix: [fx("knob", S.map((sx) => pt(sx * (xi - 20), SB_YS - 40, SB_ZB + 24)), [0, 0, 1], { name: "Adjuster knob", len: 20, dia: 26 })],
+ },
+ {
+ title: "Push it to the wall and set the knobs",
+ detail: "Turn the knobs until the sideboard stands straight and its back is clear of the skirting.",
+ check: "square",
+ tools: ["level"],
+ },
+ {
+ title: "Fix it to the wall",
+ detail: "Mark through the fittings, drill, then screw in through each fitting with a washer. Wall plugs and screws aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", S.map((sx) => pt(sx * (xi - 20), SB_YS - 40, -D / 2 - 30)), [0, 0, -1]),
+ fx("washer", S.map((sx) => pt(sx * (xi - 20), SB_YS - 40, SB_ZB + 10)), [0, 0, -1], { included: true }),
+ fx("screw", S.map((sx) => pt(sx * (xi - 20), SB_YS - 40, SB_ZB + 12)), [0, 0, -1], { len: 50, dia: 5 }),
+ ],
+ tools: ["drill", "screwdriver", "pencil"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ {
+ title: "Press on the cover caps",
+ detail: "One over each wall fitting.",
+ fix: [fx("cap", S.map((sx) => pt(sx * (xi - 20), SB_YS - 40, SB_ZB + 30)), [0, 0, -1], { name: "Cover cap", len: 4, dia: 30 })],
+ },
+ {
+ title: "Push in the shelf pins on the right",
+ detail: "Slide the right door across. Four pins, at the same height in the side and the divider.",
+ fix: [fx("pin", [-110, 80].map((z) => pt(xi, 250 - T / 2 - 4, z)), [1, 0, 0]), fx("pin", [-110, 80].map((z) => pt(T / 2, 250 - T / 2 - 4, z)), [-1, 0, 0])],
+ },
+ { title: "Lay the right shelf on the pins", detail: "Tilt it in behind the door and let it down.", add: ["L1"] },
+ {
+ title: "Push in the shelf pins on the left",
+ detail: "Slide the doors the other way. Four more pins.",
+ fix: [fx("pin", [-110, 80].map((z) => pt(-xi, 250 - T / 2 - 4, z)), [-1, 0, 0]), fx("pin", [-110, 80].map((z) => pt(-T / 2, 250 - T / 2 - 4, z)), [1, 0, 0])],
+ },
+ { title: "Lay the left shelf on the pins", detail: "The same on the left.", add: ["L0"] },
+ ];
+ return { parts, steps };
+}
+
+const SB_CAM_BOLT: HwDef = { kind: "camScrew", len: 24, dia: 6, name: "Cam bolt (drawer)" };
+const SB_CAM: HwDef = { kind: "cam", len: 10, dia: 12, name: "Cam lock (drawer)" };
+const SB_CONNECT: HwDef = { kind: "bolt", len: 30, dia: 6, name: "Connecting bolt" };
+const SB_RUNNER: HwDef = { kind: "runner", len: 340, dia: 30, name: "Drawer runner" };
+const SB_RUNNER_SCREW: HwDef = { kind: "screw", len: 10, dia: 4 };
+const SB_PULL: HwDef = { kind: "handle", len: 60, dia: 14, name: "Pull" };
+const SB_PULL_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+const SB_STOP: HwDef = { kind: "screw", len: 8, dia: 6, name: "Stop screw" };
+
+interface SbDrawer {
+ front: string;
+ sides: string[];
+ back: string;
+ bottom: string;
+ cx: number;
+}
+
+function sideboard(b: PlanBuilder, s: ProductSpec) {
+ buildCustom(b, { ...s, custom: sideboardRecipe() });
+ const zf = SB.D / 2;
+ const fw = SB_CW - 4, fh = 110, ft = 16;
+ const fy = SB.H - T - 4 - fh / 2;
+ const sh = 90, dd = 340, bw = SB_CW - 26;
+ const y0 = 672;
+ const zFront = zf - ft; // back face of the front
+ const zb = zFront - dd;
+ const xs = bw / 2 - 6;
+ const types = {
+ front: b.part("Drawer front", [fw, fh, ft]),
+ side: b.part("Drawer side", [12, sh, dd]),
+ back: b.part("Drawer back", [bw - 24, sh, 12]),
+ bottom: b.part("Drawer bottom", [bw - 16, 4, dd - 10], { material: "fiber" }),
+ };
+ const ds: SbDrawer[] = S.map((sx) => {
+ const cx = sx * (T / 2 + SB_CW / 2);
+ return {
+ cx,
+ front: b.place(types.front, [cx, fy, zf - ft / 2]),
+ sides: S.map((g) => b.place(types.side, [cx + g * xs, y0 + sh / 2, zb + dd / 2])),
+ back: b.place(types.back, [cx, y0 + sh / 2, zb + 6]),
+ bottom: b.place(types.bottom, [cx, y0 + 10, zb + 5 + (dd - 10) / 2]),
+ };
+ });
+ const fits = (d: SbDrawer) => {
+ const ys = [y0 + 22, y0 + sh - 22];
+ const side = (g: number) => d.sides[g < 0 ? 0 : 1];
+ return {
+ frontBolts: S.flatMap((g) => ys.map((y): FitOpts => ({ on: d.front, at: [d.cx + g * xs, y, zFront], dir: [0, 0, 1], mate: side(g) }))),
+ frontCams: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * (xs - 6), y, zFront - 30], dir: [g, 0, 0] }))),
+ backBolts: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * (xs + 6), y, zb + 6], dir: [-g, 0, 0] }))),
+ backCams: S.flatMap((g) => [zb + 6].map((z): FitOpts => ({ on: d.back, at: [d.cx + g * (xs - 30), y0 + sh, z], dir: [0, -1, 0] }))).flatMap((o) => [o, { ...o, at: [o.at[0] - Math.sign(o.at[0] - d.cx) * 30, o.at[1], o.at[2]] as Vec3 }]),
+ runners: S.map((g): FitOpts => ({ on: side(g), at: [d.cx + g * (xs + 6), SB_DRAWER_Y, zb + dd / 2], dir: [-g, 0, 0], hole: false })),
+ runnerScrews: S.flatMap((g) => [zb + 60, zFront - 60].map((z): FitOpts => ({ on: side(g), at: [d.cx + g * (xs + 6), SB_DRAWER_Y, z], dir: [-g, 0, 0] }))),
+ pull: [{ on: d.front, at: [d.cx, fy + fh / 2, zf - 20], dir: [0, -1, 0], hole: false } as FitOpts],
+ pullScrews: [-12, 12].map((dx): FitOpts => ({ on: d.front, at: [d.cx + dx, fy + fh / 2, zf - 20], dir: [0, -1, 0] })),
+ stops: S.map((g): FitOpts => ({ on: side(g), at: [d.cx + g * xs, y0 + sh, zb + 30], dir: [0, -1, 0] })),
+ };
+ };
+ const d0 = ds[0];
+ const f0 = fits(d0);
+ // the drawer is built on the floor beside the sideboard, the right way up
+ const rel = (k: string): Vec3 => {
+ const p = b.partItem(k).final.pos;
+ return [p[0] - d0.cx, p[1] - (fy - fh / 2), p[2]];
+ };
+ const stage = (k: string, from?: Vec3) => b.stage(k, rel(k), [0, 0, 0], from);
+ const sc = { scene: "drawer", repeat: 2 };
+ b.step({ title: "Screw the cam bolts into the drawer front", detail: "Lay the front face down. Four cam bolts in its inside face, two at each end.", kind: "cams", tools: ["screwdriver"], warnings: ["floor"], ...sc }, () => {
+ stage(d0.front, [0, 120, 0]);
+ b.then(0.1);
+ b.fits(SB_CAM_BOLT, f0.frontBolts, 0.08);
+ });
+ b.step({ title: "Push the sides onto the front", detail: "Grooves inside and at the bottom, onto the cam bolts.", kind: "join", ...sc }, () => {
+ for (const k of d0.sides) stage(k, [0, 0, -220]);
+ });
+ b.step({ title: "Lock the sides", detail: "Four cam locks, two in each side, arrow towards the bolt.", kind: "cams", tools: ["screwdriver"], ...sc }, () => b.fits(SB_CAM, f0.frontCams, 0.08));
+ b.step({ title: "Slide in the drawer bottom", detail: "Into the grooves in the sides and the front, all the way.", kind: "join", ...sc }, () => stage(d0.bottom, [0, 0, -380]));
+ b.step({ title: "Fit the back", detail: "Between the sides at the open end, over the bottom.", kind: "join", ...sc }, () => stage(d0.back, [0, 0, -200]));
+ b.step({ title: "Screw the connecting bolts into the back", detail: "Through the sides into the back's ends, two each side.", kind: "bolts", tools: ["screwdriver"], ...sc }, () => b.fits(SB_CONNECT, f0.backBolts, 0.08));
+ b.step({ title: "Lock the back", detail: "Four cam locks in the top edge of the back, then turn the drawer the right way up.", kind: "cams", tools: ["screwdriver"], ...sc }, () => b.fits(SB_CAM, f0.backCams, 0.08));
+ b.step({ title: "Screw the runners onto the drawer", detail: "One on each side, wheel end at the back. Two screws each.", kind: "runners", tools: ["screwdriver"], ...sc }, () => {
+ b.fits(SB_RUNNER, f0.runners, 0.15);
+ b.then(0.05);
+ b.fits(SB_RUNNER_SCREW, f0.runnerScrews, 0.06);
+ });
+ b.step({ title: "Screw the pull onto the front", detail: "Over the middle of the top edge, two screws from above.", kind: "screws", tools: ["screwdriver"], ...sc }, () => {
+ b.fits(SB_PULL, f0.pull);
+ b.then(0.05);
+ b.fits(SB_PULL_SCREW, f0.pullScrews, 0.08);
+ });
+ b.step({ title: "Screw in the stop screws", detail: "One in the top edge of each side, near the back, so the drawer can't be pulled right out.", kind: "screws", tools: ["screwdriver"], ...sc }, () => b.fits(SB_STOP, f0.stops, 0.1));
+ b.step({ title: "Push the drawers in", detail: "Line the runners up with the ones in the sideboard and push until they click.", kind: "drawer", warnings: ["tip"] }, () => {
+ for (const [i, d] of ds.entries()) {
+ b.stagger(0);
+ for (const k of [d.front, ...d.sides, d.back, d.bottom]) b.add(k, [0, 0, 480]);
+ if (i > 0) {
+ const f = fits(d);
+ for (const [def, list] of [[SB_CAM_BOLT, f.frontBolts], [SB_CAM, f.frontCams], [SB_CONNECT, f.backBolts], [SB_CAM, f.backCams], [SB_RUNNER, f.runners], [SB_RUNNER_SCREW, f.runnerScrews], [SB_PULL, f.pull], [SB_PULL_SCREW, f.pullScrews], [SB_STOP, f.stops]] as [HwDef, FitOpts[]][])
+ for (const x of list) b.preset(def, x);
+ }
+ b.wait(0.2);
+ }
+ });
+ b.step({ title: "Line up the drawer fronts", detail: "Turn the adjusting screws at the front of the runners until both fronts sit level and even.", kind: "general", tools: ["screwdriver"], check: "square" }, () => {});
+}
+
const family: Family = {
names: ["SPIKSMED"],
recipe(s) {
@@ -385,5 +791,10 @@ const family: Family = {
if (slug === "spiksmed-media-shelf-117-x-32") return mediaRecipe();
return null;
},
+ build(b, s) {
+ if (s.slug !== "spiksmed-sideboard-97-x-40-x-79-5") return false;
+ sideboard(b, s);
+ return true;
+ },
};
export default family;
diff --git a/src/lib/plan/families/stall.ts b/src/lib/plan/families/stall.ts
index ba64de1..87424f3 100644
--- a/src/lib/plan/families/stall.ts
+++ b/src/lib/plan/families/stall.ts
@@ -263,8 +263,9 @@ function four(): CustomParams {
boxes.forEach((b, k) => parts.push(...compartment(k, b, D, -D / 2 + T, false)));
const ends = boxes.flatMap((b) => [
- { x: b.x0, dir: b.x0 < 0 && b.x0 < -100 ? -1 : 1, on: b.x0 < -100 ? "LS" : "DV", y0: b.y0, h: hRow },
- { x: b.x1, dir: b.x1 > 100 ? 1 : -1, on: b.x1 > 100 ? "RS" : "DV", y0: b.y0, h: hRow },
+ // the left end screws into the panel on its left (a side or the divider), the right end into the one on its right
+ { x: b.x0, dir: -1, on: b.x0 < -100 ? "LS" : "DV", y0: b.y0, h: hRow },
+ { x: b.x1, dir: 1, on: b.x1 > 100 ? "RS" : "DV", y0: b.y0, h: hRow },
]);
const gp = guidesAndPivots(ends, D);
const zc = 25, zw = 55; // cam bolts and dowels this far either side of the middle of an edge
@@ -279,6 +280,7 @@ function four(): CustomParams {
tools: ["hammer"],
pose: "-z",
warnings: ["floor"],
+ from: { BT: [0, -250, 0] },
},
{
title: "Screw the bottom to the divider",
@@ -287,11 +289,11 @@ function four(): CustomParams {
tools: ["allen"],
},
{
- title: "Screw twelve cam bolts into the top and the sides",
- detail: "Six along the inside of the top, three in each side: two at the bottom end and one for the back rail.",
- fix: [fx("camScrew", [-xi - T / 2, 0, xi + T / 2].flatMap((x) => S.map((k) => pt(x, yT, (x ? 0 : zd) + k * zc))), [0, 1, 0], { on: "TP" }), sideCams(-1), sideCams(1)],
+ title: "Screw six cam bolts into the sides",
+ detail: "Three in each side: two at the bottom end and one for the back rail.",
+ fix: [sideCams(-1), sideCams(1)],
tools: ["screwdriver"],
- wait: ["TP", "LS", "RS"],
+ wait: ["LS", "RS"],
},
{
title: "Screw on the eight rack guides",
@@ -345,10 +347,10 @@ function four(): CustomParams {
tools: ["allen"],
},
{
- title: "Tap five dowels into the top and fit it",
- detail: "Two over each side and one over the divider, then press it onto the frame.",
+ title: "Fit the top",
+ detail: "Six cam bolts along its inside and five dowels (two over each side, one over the divider), then press it onto the frame.",
add: ["TP"],
- fix: [fx("dowel", [...S.flatMap((sx) => S.map((k) => pt(sx * (W / 2 - T / 2), yT, k * zw))), pt(0, yT, zd)], [0, 1, 0], { on: "TP" })],
+ fix: [fx("camScrew", [-xi - T / 2, 0, xi + T / 2].flatMap((x) => S.map((k) => pt(x, yT, (x ? 0 : zd) + k * zc))), [0, 1, 0], { on: "TP" }), fx("dowel", [...S.flatMap((sx) => S.map((k) => pt(sx * (W / 2 - T / 2), yT, k * zw))), pt(0, yT, zd)], [0, 1, 0], { on: "TP" })],
tools: ["hammer"],
},
{
@@ -478,20 +480,13 @@ function three(): CustomParams {
fix: [topLocks(1), ...railLocks(1)],
tools: ["screwdriver"],
},
+ { title: "Lay it on its front", detail: "Turn it over onto the rug so the bottom ends of the sides face you.", pose: "-z", warnings: ["floor"] },
{
- title: "Screw four cam bolts into the bottom",
- detail: "Two near each end, on the inside face.",
- fix: [fx("camScrew", S.flatMap((sx) => S.map((k) => pt(sx * (W / 2 - T / 2), ySide, k * zc))), [0, -1, 0], { on: "BT" })],
- tools: ["screwdriver"],
- wait: ["BT"],
- },
- {
- title: "Lay it on its front and fit the bottom",
- detail: "Six dowels in the bottom, three at each end, then press it onto the ends of the sides.",
+ title: "Fit the bottom",
+ detail: "Four cam bolts near its ends and six dowels, three at each end, then press it onto the ends of the sides.",
add: ["BT"],
- fix: [fx("dowel", S.flatMap((sx) => [-1, 0, 1].map((k) => pt(sx * (W / 2 - T / 2), ySide, k * zw))), [0, -1, 0], { on: "BT" })],
- tools: ["hammer"],
- pose: "-z",
+ fix: [fx("camScrew", S.flatMap((sx) => S.map((k) => pt(sx * (W / 2 - T / 2), ySide, k * zc))), [0, -1, 0], { on: "BT" }), fx("dowel", S.flatMap((sx) => [-1, 0, 1].map((k) => pt(sx * (W / 2 - T / 2), ySide, k * zw))), [0, -1, 0], { on: "BT" })],
+ tools: ["screwdriver", "hammer"],
},
{
title: "Lock the bottom",
diff --git a/src/lib/plan/families/stegesund.ts b/src/lib/plan/families/stegesund.ts
index 961aa20..4bf53c4 100644
--- a/src/lib/plan/families/stegesund.ts
+++ b/src/lib/plan/families/stegesund.ts
@@ -81,6 +81,8 @@ function shelfRecipe(s: ProductSpec): CustomParams {
// a rail under each shelf, and one at the foot of the upper unit's ladder that stands on the lower unit
const ys = u.levels.map((l) => l.y - 20 - 15);
if (k === 1) ys.push(u.y0 + 15);
+ // the lower unit of the tall one has a rung at the very top too: the joining bolts go up through it
+ if (k === 0 && tall) ys.push(u.y0 + u.h - 15);
for (const y of ys) pieces.push(box([18, 30, D - 2 * P], [x, y, 0]));
const part = compound(`L${k}${i}`, "Ladder", pieces);
parts.push(part);
@@ -133,18 +135,16 @@ function shelfRecipe(s: ProductSpec): CustomParams {
if (tall) {
steps.push({
title: "Bolt the two units together",
- detail: "End to end on the rug. Two bolts up through the top of the lower unit into the foot rails of the upper one.",
- fix: [
- {
- kind: "bolt",
- count: 2,
- ...SHORT,
- at: [-1, 1].map((sx) => [sx * (W / 2 - P / 2), 870, 0] as Vec3),
- dir: [0, 1, 0],
- on: ids[1].sides[0],
- mate: ids[0].shelves[0],
- },
- ],
+ detail: "End to end on the rug. Two bolts from inside the lower unit, through its top rungs into the foot rails of the upper one.",
+ fix: [0, 1].map((i): CustomFix => ({
+ kind: "bolt",
+ count: 1,
+ ...SHORT,
+ at: [[(i ? 1 : -1) * (W / 2 - P / 2), 840, 0]],
+ dir: [0, 1, 0],
+ on: ids[0].sides[i],
+ mate: ids[1].sides[i],
+ })),
tools: ["allen"],
});
}
@@ -216,7 +216,7 @@ function benchRecipe(): CustomParams {
parts.push(slatted("S", iw, D - 2 * L, shelfY, 40, 0, zl));
for (const [i, sz] of [-1, 1].entries()) parts.push({ id: `R${i}`, name: "Long rail", size: [iw, rh, 20], pos: [0, ry, sz * zl], material: "wood" });
parts.push({ id: "T", name: "Seat", size: [iw, bt, D], pos: [0, top - bt / 2, 0], material: "wood" });
- const railY = shelfY + 40 - 20;
+ const railY = shelfY - 20; // middle of the shelf's rails
const long = (side: number, mate: string, y: number) => bolts(side, ends[side < 0 ? 0 : 1], mate, W / 2, [-1, 1].map((sz) => [y, sz * zl] as [number, number]), LONG);
const steps: CustomStep[] = [
{
diff --git a/src/lib/plan/families/stein.ts b/src/lib/plan/families/stein.ts
new file mode 100644
index 0000000..05ba6c3
--- /dev/null
+++ b/src/lib/plan/families/stein.ts
@@ -0,0 +1,44 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * STEIN chair: one moulded piece of clear plastic that comes ready to use (IKEA lists no assembly and no manual),
+ * so the guide only unpacks it and shows how the chairs stack.
+ */
+
+function recipe(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10), H = Math.round(s.size.h * 10), D = Math.round(s.size.d * 10);
+ const SH = 450, ST = 14; // seat height and thickness
+ const seatD = 420;
+ const zs = 20; // seat centre, a little forward
+ const leg = 26;
+ const legY = SH - ST;
+ const fx = 125, fz = zs + 140; // front legs under the rim of the round seat
+ const bx = 150, bz = -D / 2 + leg / 2 + 10; // back legs splay back and rise into the back posts
+ const backH = H - SH;
+ const pieces: PartPiece[] = [
+ { shape: "cyl", size: [seatD, ST, seatD], pos: [0, SH - ST / 2, zs] },
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [leg, legY, leg], pos: [g * fx, legY / 2, fz] })),
+ // the back legs run on up into the back posts, leaning back
+ ...[-1, 1].map((g): PartPiece => ({ shape: "box", size: [leg, H - 30, leg], pos: [g * bx, (H - 30) / 2, (bz + zs - seatD / 2 + 30) / 2], rot: [Math.atan2(zs - seatD / 2 + 30 - bz, H - 30), 0, 0] })),
+ // the curved back band
+ { shape: "box", size: [2 * bx + leg + 40, Math.min(170, backH * 0.5), 12], pos: [0, H - Math.min(170, backH * 0.5) / 2, zs - seatD / 2 + 20] },
+ ];
+ const chair: CustomPart = { id: "C", name: "Chair", size: [W, H, D], pos: [0, H / 2, 0], material: "glass", pieces: pieces.map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] - H / 2, p.pos[2]] as Vec3 })) };
+ return {
+ parts: [chair],
+ steps: [
+ { title: "Take the chair out of its packing", detail: "It comes in one piece, ready to use. Peel off any protective film.", add: ["C"] },
+ { title: "Stand it on a flat floor", detail: "Check all four feet touch the floor. To store several, stack them straight on top of each other." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["STEIN"],
+ recipe(s) {
+ if (!/chair/i.test(s.variant)) return null;
+ return recipe(s);
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/stig.ts b/src/lib/plan/families/stig.ts
index 847c00b..480871b 100644
--- a/src/lib/plan/families/stig.ts
+++ b/src/lib/plan/families/stig.ts
@@ -56,7 +56,8 @@ function backrest(s: ProductSpec): CustomParams {
[[sx * xt, yR, zbt], [sx * 152, H - 10, zbt - 45]],
]),
);
- parts.push({ id: "BR", name: "Back rail", size: [2 * xt - T, 30, 6], pos: [0, yR, zbt - T / 2 - 3], material: "metal" });
+ // its ends sit against the back legs' tubes
+ parts.push({ id: "BR", name: "Back rail", size: [2 * xt, 30, 6], pos: [0, yR, zbt - T / 2 - 3], material: "metal" });
const xx = xb - ((xb - xt) * yX) / yR, zx = zb + ((zbt - zb) * yX) / yR;
parts.push({ id: "X", name: "Cross tube", size: [2 * xx - T, T, T], pos: [0, yX, zx], shape: "cyl", material: "metal" });
parts.push({ id: "BS", name: "Backrest", size: [330, 210, 14], pos: [0, H - 120, zbt - 45 + 4], rot: [-0.1, 0, 0], material: "board" });
@@ -73,39 +74,39 @@ function backrest(s: ProductSpec): CustomParams {
const A = { len: 40, dia: 6 };
const railBolt = (i: number, z: number, on: string) => {
const sx = i ? 1 : -1;
- return fx("bolt", [[sx * (xt + T / 2), yR, z]], [-sx, 0, 0], on, A);
+ return fx("bolt", [[sx * (xt + T / 2), yR - 8, z]], [-sx, 0, 0], on, A);
};
const steps: CustomStep[] = [
{
title: "Bolt a seat rail to the front legs",
detail: "Use the straight rail, holes towards the back. One bolt through the leg's top corner, turned in by hand for now.",
add: ["FF", "R0"],
- fix: [railBolt(0, zt - 15, "FF")],
+ fix: [railBolt(0, zt - 4, "FF")],
tools: ["allen"],
},
- { title: "Bolt on the other seat rail", detail: "The same on the right, one bolt, loose for now.", add: ["R1"], fix: [railBolt(1, zt - 15, "FF")], tools: ["allen"] },
+ { title: "Bolt on the other seat rail", detail: "The same on the right, one bolt, loose for now.", add: ["R1"], fix: [railBolt(1, zt - 4, "FF")], tools: ["allen"] },
{
title: "Fit a back leg to the left rail",
detail: "One of the longer bolts through the leg into the rail's end.",
add: ["B0"],
- fix: [fx("bolt", [[-(xt + T / 2), yR, zbt + 10]], [1, 0, 0], "B0", { len: 55, dia: 6, name: "Long bolt" })],
+ fix: [fx("bolt", [[-(xt + T / 2), yR - 8, zbt + 4]], [1, 0, 0], "B0", { len: 55, dia: 6, name: "Long bolt" })],
tools: ["allen"],
},
{
title: "Bolt on the curved back rail",
detail: "Curve towards the back. One bolt through the left back leg.",
add: ["BR"],
- fix: [fx("bolt", [[-xt, yR, zbt - T / 2]], [0, 0, 1], "B0", A)],
+ fix: [fx("bolt", [[-xt, yR, zbt - T / 2 - 6]], [0, 0, 1], "B0", A)],
tools: ["allen"],
},
{
title: "Push the other back leg on",
detail: "Slide it onto the free ends of the back rail and the right seat rail, then a bolt through the back rail.",
add: ["B1"],
- fix: [fx("bolt", [[xt, yR, zbt - T / 2]], [0, 0, 1], "B1", A)],
+ fix: [fx("bolt", [[xt, yR, zbt - T / 2 - 6]], [0, 0, 1], "B1", A)],
tools: ["allen"],
},
- { title: "Bolt it to the seat rail", detail: "One of the longer bolts.", fix: [fx("bolt", [[xt + T / 2, yR, zbt + 10]], [-1, 0, 0], "B1", { len: 55, dia: 6, name: "Long bolt" })], tools: ["allen"] },
+ { title: "Bolt it to the seat rail", detail: "One of the longer bolts.", fix: [fx("bolt", [[xt + T / 2, yR - 8, zbt + 4]], [-1, 0, 0], "B1", { len: 55, dia: 6, name: "Long bolt" })], tools: ["allen"] },
{
title: "Bolt the cross tube between the back legs",
detail: "One bolt through each back leg into the tube's ends.",
@@ -136,7 +137,7 @@ function backrest(s: ProductSpec): CustomParams {
{
title: "Put the nuts on the long bolts",
detail: "Hold each nut with the spanner inside the rail while you turn the bolt with the Allen key.",
- fix: [fx("nut", [-1, 1].map((sx): Vec3 => [sx * (xt - T / 2 - 6), yR, zbt + 10]), [0, 0, 1], undefined, { dia: 6 })],
+ fix: [fx("nut", [-1, 1].map((sx): Vec3 => [sx * (xt - T / 2 - 6), yR - 8, zbt + 4]), [0, 0, 1], undefined, { dia: 6 })],
tools: ["allen", "wrench"],
},
{ title: "Tighten all six frame bolts", detail: "Stand the frame on a flat floor so all four feet touch, then tighten each bolt firmly.", tools: ["allen"], check: "square" },
diff --git a/src/lib/plan/families/stigbygel.ts b/src/lib/plan/families/stigbygel.ts
index 711d23b..b029ded 100644
--- a/src/lib/plan/families/stigbygel.ts
+++ b/src/lib/plan/families/stigbygel.ts
@@ -58,7 +58,7 @@ function recipe(s: ProductSpec): CustomParams {
],
},
...[-1, 1].map((sx, i) =>
- tubes(`A${i + 1}`, "Armrest", [[[sx * 240, 660, -190], [sx * xa, 680, -170], [sx * xa, 680, 140], [sx * xa, yS - 10, 160], [sx * 160, yM - 5, 160]]], "wood", 28),
+ tubes(`A${i + 1}`, "Armrest", [[[sx * 240, 660, -190], [sx * xa, 680, -170], [sx * xa, 680, 140], [sx * xa, yS - 10, 160], [sx * 160, yS - 36, 160]]], "wood", 28),
),
];
const base = ["HB", "L1", "L2", "L3", "L4", "RG"];
@@ -103,7 +103,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Bolt its front end under the seat",
detail: "Two bolts through the flat end into the seat.",
- fix: [{ kind: "bolt", count: 2, len: 16, dia: 6, at: [120, 70].map((z): Vec3 => [sx * 175, yM - 10, z + 60]), dir: up, on: id, mate: "S" } as CustomFix],
+ fix: [{ kind: "bolt", count: 2, len: 16, dia: 6, at: [175, 220].map((x): Vec3 => [sx * x, yS - 30, 160]), dir: up, on: id, mate: "S" } as CustomFix],
tools: ["allen"],
},
];
diff --git a/src/lib/plan/families/stockholm.ts b/src/lib/plan/families/stockholm.ts
index 0fa22e4..39ee224 100644
--- a/src/lib/plan/families/stockholm.ts
+++ b/src/lib/plan/families/stockholm.ts
@@ -18,7 +18,8 @@ import { rotate } from "../math";
* spacers and the doors on clip hinges; the glass-door one is a box of framed glass panels bolted together lying on its
* back, on a base of two leg frames, with sliding glass doors; the rattan one with sliding doors is built lying on its
* back on cam bolts and dowels, stood up for the middle post, the top and the doors, then strapped to the wall.
- * The sideboard has no manual here and stays on the cabinet builder.
+ * - Sideboard: the top upside down with its rails and push openers, the sides hung on it, backs, bottom and a base
+ * built beside it, then upright for clips, wall fixing, shelves, drawers and four doors.
*/
const range = (n: number) => Array.from({ length: n }, (_, i) => i);
@@ -489,7 +490,7 @@ function chair2025(s: ProductSpec): CustomParams {
},
{ title: "Push the two leg frames together", detail: "The rails cross in the middle: slot one down over the other until both sit flush." },
{ title: "Hook the backrest onto the legs", detail: "Its fittings drop over the heads on the three tall legs. Push it down until it sits level.", add: ["back"], from: { back: [0, 260, 0] } },
- { title: "Bolt the backrest to the side legs", detail: "One bolt through each end of the backrest. Not fully tight yet.", fix: [fx("bolt", [-1, 1].map((sx) => [sx * (rb + 10), H - 70, 0] as Vec3), { dir: [-1, 0, 0], on: "back", len: 30, dia: 6 })], tools: ["allen"] },
+ { title: "Bolt the backrest to the side legs", detail: "One bolt through each end of the backrest. Not fully tight yet.", fix: [-1, 1].map((sx) => fx("bolt", [[sx * (rb + 10), H - 70, 0]], { dir: [-sx, 0, 0], on: "back", mate: sx < 0 ? "LL" : "LR", len: 30, dia: 6 })), tools: ["allen"] },
{ title: "Screw the rails together where they cross", detail: "Two screws from underneath with the bit.", fix: [fx("screw", [[0, yr - rh / 2, -14], [0, yr - rh / 2, 14]], { dir: UP, on: "RX", mate: "RZ", len: 30, dia: 5 })], tools: ["screwdriver"] },
{
title: "Turn it upside down onto the seat and bolt it on",
@@ -517,9 +518,17 @@ function armChair(s: ProductSpec): CustomParams {
const armY = 640;
const legF = (sx: number) => stick(sx < 0 ? "FL" : "FR", "Front leg", [sx * (fx0 + 40), 0, fz0 + 40], [sx * fx0, armY, fz0 - 10], lt);
const legB = (sx: number) => stick(sx < 0 ? "BL" : "BR", "Back leg", [sx * (fx0 + 40), 0, -fz0 - 70], [sx * fx0, H - 40, -fz0 + 10], lt);
+ // where each leg crosses the frame's height (they lean), so the side rails reach them and the bolts join the two
+ const legAt = (sz: number) => {
+ const [a, b] = sz > 0 ? [[fx0 + 40, fz0 + 40, armY], [fx0, fz0 - 10]] as const : [[fx0 + 40, -fz0 - 70, H - 40], [fx0, -fz0 + 10]] as const;
+ const k = yf / a[2];
+ return { x: a[0] + (b[0] - a[0]) * k, z: a[1] + (b[1] - a[1]) * k };
+ };
+ const lf = legAt(1), lb = legAt(-1);
+ const rx = fx0 - 15.5; // side rails, against the legs
const frame = compound("frame", "Seat frame", [
- ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [25, fh, 2 * fz0 - lt], pos: [sx * (fx0 - lt / 2 - 12.5), yf, 0] })),
- ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [2 * fx0 - lt - 50, fh, 25], pos: [0, yf, sz * (fz0 - lt / 2 - 12.5)] })),
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [25, fh, lf.z - lb.z], pos: [sx * rx, yf, (lf.z + lb.z) / 2] })),
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [2 * rx - 25, fh, 25], pos: [0, yf, sz * (fz0 - lt / 2 - 12.5)] })),
], "wood");
const len = 2 * fz0;
const drop = H - 40 - armY;
@@ -528,14 +537,15 @@ function armChair(s: ProductSpec): CustomParams {
...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [45, 30, Math.hypot(len, drop) + 40], pos: [sx * fx0, (armY + H - 40) / 2 + 15, 0], rot: [tilt, 0, 0] })),
{ shape: "box", size: [2 * fx0 - 45, 90, 30], pos: [0, H - 45, -fz0 + 10] },
], "wood");
+ const plF = fz0 - 10, plB = -fz0 + 10; // leg tops, under the armrest piece
const parts: CustomPart[] = [frame, legF(-1), legF(1), legB(-1), legB(1), part("seat", "Seat", [2 * fx0 - 30, 60, 2 * fz0 - 20], [0, seatY - 20, 0], { material: "soft" }), top];
- const boltAt = (sx: number, sz: number): Vec3 => [sx * (fx0 - lt / 2), yf, sz > 0 ? fz0 - 20 : -fz0 + 20];
+ const boltAt = (sx: number, sz: number): Vec3 => [sx * ((sz > 0 ? lf : lb).x + lt / 2), yf, (sz > 0 ? lf : lb).z];
const steps: CustomStep[] = [
{
title: "Fit the barrel nuts and bolts into the frame",
detail: "Lay the seat frame upside down on a rug. A barrel nut in each corner, then a bolt turned in until about 5 cm sticks out.",
add: ["frame"],
- fix: [fx("nut", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * (fx0 - lt / 2 - 12.5), yf - fh / 2, sz > 0 ? fz0 - 40 : -fz0 + 40] as Vec3)), { dir: UP, len: 14, dia: 10 }), fx("bolt", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => boltAt(sx, sz))), { dir: [-1, 0, 0], on: "frame", len: 60, dia: 6 })],
+ fix: [fx("nut", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * rx, yf - fh / 2, (sz > 0 ? lf : lb).z] as Vec3)), { dir: UP, len: 14, dia: 10 }), ...[-1, 1].map((sx) => fx("bolt", [-1, 1].map((sz) => boltAt(sx, sz)), { dir: [-sx, 0, 0], on: "frame", len: 60, dia: 6 }))],
pose: "-y",
tools: ["allen"],
warnings: ["floor"],
@@ -547,17 +557,17 @@ function armChair(s: ProductSpec): CustomParams {
{ title: "Bend the seat into shape", detail: "Flex it gently along its edges so it sits round in the frame." },
{ title: "Turn it over and drop the seat in", add: ["seat"], pose: "+y" },
{ title: "Bolt the seat to the frame", detail: "Two long bolts up from underneath through the front and back rails.", fix: [fx("bolt", [-1, 1].map((sz) => [0, yf - fh / 2, sz * (fz0 - lt / 2 - 12.5)] as Vec3), { dir: UP, on: "frame", mate: "seat", len: 80, dia: 6 })], tools: ["allen"] },
- { title: "Screw a plate onto each front leg", detail: "Plate flat on the top end, one countersunk screw.", fix: [-1, 1].flatMap((sx) => [fx("plate", [[sx * fx0, armY, fz0 - 10]], { dir: DOWN, on: sx < 0 ? "FL" : "FR" }), fx("screw", [[sx * fx0, armY, fz0 - 10]], { dir: DOWN, on: sx < 0 ? "FL" : "FR", len: 20, dia: 4 })]), tools: ["screwdriver"] },
- { title: "Screw a plate onto each back leg", fix: [-1, 1].flatMap((sx) => [fx("plate", [[sx * fx0, H - 40, -fz0 + 10]], { dir: DOWN, on: sx < 0 ? "BL" : "BR" }), fx("screw", [[sx * fx0, H - 40, -fz0 + 10]], { dir: DOWN, on: sx < 0 ? "BL" : "BR", len: 20, dia: 4 })]), tools: ["screwdriver"] },
+ { title: "Screw a plate onto each front leg", detail: "Plate flat on the top end, one countersunk screw through the hole over the leg.", fix: [-1, 1].flatMap((sx) => [fx("plate", [[sx * fx0, armY, plF - 24]], { dir: DOWN, on: sx < 0 ? "FL" : "FR" }), fx("screw", [[sx * fx0, armY, plF]], { dir: DOWN, on: sx < 0 ? "FL" : "FR", len: 20, dia: 4 })]), tools: ["screwdriver"] },
+ { title: "Screw a plate onto each back leg", detail: "The free hole of each plate points to the front.", fix: [-1, 1].flatMap((sx) => [fx("plate", [[sx * fx0, H - 40, plB + 24]], { dir: DOWN, on: sx < 0 ? "BL" : "BR" }), fx("screw", [[sx * fx0, H - 40, plB]], { dir: DOWN, on: sx < 0 ? "BL" : "BR", len: 20, dia: 4 })]), tools: ["screwdriver"] },
{
title: "Turn it upside down onto the armrests",
detail: "Lay the armrest piece upside down on the rug and lower the chair onto it. Two screws through the front plates.",
add: ["top"],
- fix: [fx("screw", [-1, 1].map((sx) => [sx * fx0, armY, fz0 + 10] as Vec3), { dir: UP, on: "top", len: 16, dia: 5 })],
+ fix: [fx("screw", [-1, 1].map((sx) => [sx * fx0, armY, plF - 48] as Vec3), { dir: UP, on: "top", len: 16, dia: 5 })],
pose: "-y",
tools: ["screwdriver"],
},
- { title: "Screw the back plates on", detail: "Two more screws, then turn the chair over.", fix: [fx("screw", [-1, 1].map((sx) => [sx * fx0, H - 40, -fz0 - 10] as Vec3), { dir: UP, on: "top", len: 16, dia: 5 })], tools: ["screwdriver"] },
+ { title: "Screw the back plates on", detail: "Two more screws, then turn the chair over.", fix: [fx("screw", [-1, 1].map((sx) => [sx * fx0, H - 40, plB + 48] as Vec3), { dir: UP, on: "top", len: 16, dia: 5 })], tools: ["screwdriver"] },
{ title: "Stand it up", pose: "+y" },
];
return { parts, steps };
@@ -592,25 +602,33 @@ function easyChair(s: ProductSpec): CustomParams {
part("CF", "Rail", [inner, t, t], [0, t / 2, zf - 60], { material: "wood" }),
L.run, L.post, L.arm, R.run, R.post, R.arm, seat,
];
- const sideDowels = (sx: number): CustomFix[] => [
- fx("dowel", [[sx * xs, t, zb - 10], [sx * xs, t, zb + 10]], { dir: UP, on: sx < 0 ? "PL" : "PR", mate: sx < 0 ? "RL" : "RR", len: 30, dia: 8 }),
- fx("dowel", [[sx * xs, armY + 10, zb + t / 2], [sx * xs, armY + 30, zb + t / 2]], { dir: [0, 0, -1], on: sx < 0 ? "PL" : "PR", mate: sx < 0 ? "AL" : "AR", len: 30, dia: 8 }),
- ];
+ // the rails take two dowels in each end, into the runners; the posts come with their dowels in
+ const railDowels: CustomFix[] = ["CB", "CF"].flatMap((id, i) =>
+ [-1, 1].map((sx) => fx("dowel", [-12, 12].map((dz) => [sx * (inner / 2), t / 2, (i ? zf - 60 : zb) + dz] as Vec3), { dir: [-sx, 0, 0], on: id, mate: sx < 0 ? "RL" : "RR", len: 30, dia: 8 })),
+ );
+ const railZ = [zb, zf - 60];
const steps: CustomStep[] = [
- { title: "Tap the dowels into the back posts", detail: "Four into each post, on a rug: two in the bottom end and two in the front face for the armrest.", fix: [...sideDowels(-1), ...sideDowels(1)], tools: ["hammer"], warnings: ["floor"] },
- { title: "Push a back post into a runner", detail: "Stand it in the holes near the back of the curved runner.", add: ["RL", "PL"] },
- { title: "Push the armrest onto the post and runner", detail: "It goes onto the dowels in the front of the post, and its front leg into the end of the runner. Build the other side the same way.", add: ["AL", "RR", "PR", "AR"] },
+ { title: "Tap the dowels into the rails", detail: "Two in each end of both rails, on a rug.", fix: railDowels, wait: ["CB", "CF"], tools: ["hammer"], warnings: ["floor"] },
+ { title: "Push the back post into a runner", detail: "Stand it in the holes near the back of the curved runner.", add: ["RL", "PL"] },
+ { title: "Push the armrest onto the post and runner", detail: "Its back end goes onto the top of the post and its front leg into the end of the runner.", add: ["AL"] },
+ {
+ title: "Lay the side down and stand the rails in it",
+ detail: "Build the other side the same way. Lay this one on its outer face and push both rails onto its dowels.",
+ add: ["CB", "CF"],
+ pose: "+x",
+ },
+ { title: "Put the other side on top", detail: "Lower it onto the dowels in the rails.", add: ["RR", "PR", "AR"] },
{
- title: "Drop four barrel nuts into the runners",
- detail: "Lay both sides on their outer faces. The slot in each nut faces the hole for the bolt.",
- fix: [fx("nut", [-1, 1].flatMap((sx) => [zb, zf - 60].map((z) => [sx * xs, t, z + 25] as Vec3)), { dir: DOWN, len: 20, dia: 10 })],
+ title: "Drop four barrel nuts into the rails",
+ detail: "Turn it upside down. The slot in each nut faces the hole for the bolt.",
+ fix: [fx("nut", [-1, 1].flatMap((sx) => railZ.map((z) => [sx * (inner / 2 - 45), 0, z] as Vec3)), { dir: UP, len: 20, dia: 10 })],
+ pose: "-y",
tools: ["flathead"],
},
{
- title: "Bolt the rails between the sides",
- detail: "Four long bolts through the runners into the rails. Turn it the right way up when they're tight.",
- add: ["CB", "CF"],
- fix: [-1, 1].map((sx) => fx("bolt", [zb, zf - 60].map((z) => [sx * (W / 2), t / 2, z] as Vec3), { dir: [-sx, 0, 0], on: sx < 0 ? "RL" : "RR", len: 100, dia: 6 })),
+ title: "Bolt the runners to the rails",
+ detail: "Four long bolts through the runners into the barrel nuts. Turn it the right way up when they're tight.",
+ fix: [-1, 1].map((sx) => fx("bolt", railZ.map((z) => [sx * (W / 2), t / 2, z] as Vec3), { dir: [-sx, 0, 0], on: sx < 0 ? "RL" : "RR", len: 100, dia: 6 })),
tools: ["allen"],
},
{
@@ -618,6 +636,7 @@ function easyChair(s: ProductSpec): CustomParams {
detail: "Hold the seat rail against the posts and turn a bolt through each post into it.",
add: ["seat"],
fix: [-1, 1].map((sx) => fx("bolt", [[sx * (W / 2), sTop[1], sTop[2]]], { dir: [-sx, 0, 0], on: sx < 0 ? "PL" : "PR", mate: "seat", len: 60, dia: 6 })),
+ pose: "+y",
tools: ["allen"],
},
{
@@ -626,7 +645,8 @@ function easyChair(s: ProductSpec): CustomParams {
fix: [-1, 1].map((sx) => fx("bolt", [[sx * (W / 2), sLow[1], sLow[2]]], { dir: [-sx, 0, 0], on: sx < 0 ? "AL" : "AR", mate: "seat", len: 60, dia: 6 })),
tools: ["allen"],
},
- { title: "Stick the felt pads under the runners and stand it up", detail: "Two under each runner, at the front and the back.", fix: [-1, 1].map((sx) => fx("glide", [[sx * xs, 0, -D / 2 + 40], [sx * xs, 0, D / 2 - 40]], { dir: UP, on: sx < 0 ? "RL" : "RR" })), pose: "+y" },
+ { title: "Stick the felt pads under the runners", detail: "Two under each runner, at the front and the back.", fix: [-1, 1].map((sx) => fx("glide", [[sx * xs, 0, -D / 2 + 40], [sx * xs, 0, D / 2 - 40]], { dir: UP, on: sx < 0 ? "RL" : "RR" })), pose: "-y" },
+ { title: "Turn it the right way up", pose: "+y" },
];
return { parts, steps };
}
@@ -812,6 +832,8 @@ function cabinet2(s: ProductSpec): CustomParams {
...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [P, yTop, P], pos: [sx * xp, yTop / 2, sz * zp], material: "wood" })),
{ shape: "box", size: [16, yTop - yB, D - 2 * P], pos: [sx * (xi + 8), (yB + yTop) / 2, 0], material: "board" },
{ shape: "box", size: [24, 30, D - 2 * P], pos: [sx * xp, yRail, 0], material: "wood" },
+ // the rail the bottom rests on
+ { shape: "box", size: [36, 30, D - 2 * P], pos: [sx * (xi - 2), yB - 15, 0], material: "wood" },
], "wood"),
),
);
@@ -846,7 +868,7 @@ function cabinet2(s: ProductSpec): CustomParams {
{
title: "Screw the hinge plates onto the side frames",
detail: "Lay both frames on a rug, inside up. Two plates near the front edge of each, two screws in each plate.",
- fix: [...SIDES.map((sx) => named("plate", "Mounting plate", plates.filter((p) => Math.sign(p[0]) === sx), { dir: [sx, 0, 0], on: sideId(sx), len: 12, dia: 40 })), fx("screw", plates.flatMap((p) => [[p[0], p[1] + 15, p[2]], [p[0], p[1] - 15, p[2]]] as Vec3[]), { len: 13, dia: 4 })],
+ fix: [...SIDES.map((sx) => named("plate", "Mounting plate", plates.filter((p) => Math.sign(p[0]) === sx), { dir: [sx, 0, 0], on: sideId(sx), len: 12, dia: 40 })), ...SIDES.map((sx) => fx("screw", plates.filter((p) => Math.sign(p[0]) === sx).flatMap((p) => [[p[0], p[1] + 25, p[2]], [p[0], p[1] - 25, p[2]]] as Vec3[]), { dir: [sx, 0, 0], on: sideId(sx), len: 13, dia: 4 }))],
wait: ["L", "R"],
pose: "+x",
tools: ["screwdriver"],
@@ -891,8 +913,8 @@ function cabinet2(s: ProductSpec): CustomParams {
{ title: "Lay the bottom in", detail: "Between the side frames, against the back, holes facing the legs.", add: ["BT"] },
{
title: "Screw the bottom in place",
- detail: "One long screw at each corner, beside a leg, turned in with the Allen key.",
- fix: [named("bolt", "Connector screw", SIDES.flatMap((sx) => [-1, 1].map((sz) => [sx * (xi - 18), yB, sz * (D / 2 - P - 30)] as Vec3)), { dir: [0, 1, 0], on: "BT", len: 50, dia: 7 })],
+ detail: "One long screw at each corner, through the rail of the side frame into the bottom, turned in with the Allen key.",
+ fix: SIDES.map((sx) => named("bolt", "Connector screw", [-1, 1].map((sz) => [sx * (xi - 10), yB - 30, sz * (D / 2 - P - 30)] as Vec3), { dir: [0, 1, 0], on: sideId(sx), mate: "BT", len: 50, dia: 7 })),
tools: ["allen"],
},
{
@@ -904,7 +926,7 @@ function cabinet2(s: ProductSpec): CustomParams {
{
title: "Screw the strike plate under the top",
detail: "Lay the top upside down on the rug. The plate goes near the front edge, a little left of the middle, with two screws.",
- fix: [named("clip", "Strike plate", [lockAt], { dir: [0, 1, 0], on: "TOP", len: 6, dia: 30 }), fx("screw", [[lockAt[0] - 15, yTop, lockAt[2]], [lockAt[0] + 15, yTop, lockAt[2]]], { dir: [0, 1, 0], on: "TOP", len: 13, dia: 4 })],
+ fix: [named("clip", "Strike plate", [lockAt], { dir: [0, 1, 0], on: "TOP", len: 6, dia: 30 }), fx("screw", [[lockAt[0] - 25, yTop, lockAt[2]], [lockAt[0] + 25, yTop, lockAt[2]]], { dir: [0, 1, 0], on: "TOP", len: 13, dia: 4 })],
wait: ["TOP"],
tools: ["screwdriver"],
},
@@ -951,20 +973,20 @@ function cabinet2(s: ProductSpec): CustomParams {
{
title: "Screw the bolt onto the left door",
detail: "Lay both doors face down. The sliding bolt goes at the top of the left door's inner edge, two screws.",
- fix: [named("clip", "Door bolt", [meet(-1, yTop - 60)], { dir: [0, 0, 1], on: "D0", len: 10, dia: 30 }), fx("screw", [meet(-1, yTop - 45), meet(-1, yTop - 85)], { dir: [0, 0, 1], on: "D0", len: 13, dia: 4 })],
+ fix: [named("clip", "Door bolt", [meet(-1, yTop - 60)], { dir: [0, 0, 1], on: "D0", len: 10, dia: 30 }), fx("screw", [meet(-1, yTop - 35), meet(-1, yTop - 85)], { dir: [0, 0, 1], on: "D0", len: 13, dia: 4 })],
wait: ["D0", "D1"],
tools: ["screwdriver"],
},
{
title: "Screw the catch plate onto the left door",
detail: "Halfway up its inner edge, two screws. The lock's latch catches behind it.",
- fix: [named("clip", "Catch plate", [meet(-1, yLock)], { dir: [0, 0, 1], on: "D0", len: 4, dia: 30 }), fx("screw", [meet(-1, yLock + 15), meet(-1, yLock - 15)], { dir: [0, 0, 1], on: "D0", len: 10, dia: 4 })],
+ fix: [named("clip", "Catch plate", [meet(-1, yLock)], { dir: [0, 0, 1], on: "D0", len: 4, dia: 30 }), fx("screw", [meet(-1, yLock + 25), meet(-1, yLock - 25)], { dir: [0, 0, 1], on: "D0", len: 10, dia: 4 })],
tools: ["screwdriver"],
},
{
title: "Screw the lock onto the right door",
detail: "Its keyhole lines up with the hole in the door, two screws.",
- fix: [named("clip", "Lock", [meet(1, yLock)], { dir: [0, 0, 1], on: "D1", len: 18, dia: 40 }), fx("screw", [meet(1, yLock + 22), meet(1, yLock - 22)], { dir: [0, 0, 1], on: "D1", len: 13, dia: 4 })],
+ fix: [named("clip", "Lock", [meet(1, yLock)], { dir: [0, 0, 1], on: "D1", len: 18, dia: 40 }), fx("screw", [meet(1, yLock + 26), meet(1, yLock - 26)], { dir: [0, 0, 1], on: "D1", len: 13, dia: 4 })],
tools: ["screwdriver"],
},
{
@@ -1048,7 +1070,7 @@ function glassCabinet(s: ProductSpec): CustomParams {
detail: "Two on each side frame, one near each long edge, a screw through each. Stick a felt dot on top of every support.",
fix: [
...SIDES.map((sx, i) => named("pin", "Shelf support", [sup(sx, -1), sup(sx, 1)], { dir: [sx, 0, 0], on: i ? "SR" : "SL", len: 20, dia: 20 })),
- fx("screw", SIDES.flatMap((sx) => [sup(sx, -1), sup(sx, 1)]).map((p) => [p[0], p[1] - 6, p[2]] as Vec3), { dir: [0, 1, 0], len: 12, dia: 4 }),
+ ...SIDES.map((sx, i) => fx("screw", [sup(sx, -1), sup(sx, 1)].map((p) => [p[0], p[1] - 25, p[2]] as Vec3), { dir: [sx, 0, 0], on: i ? "SR" : "SL", len: 12, dia: 4 })),
named("glide", "Felt dot", SIDES.flatMap((sx) => [sup(sx, -1), sup(sx, 1)]).map((p) => [p[0] - Math.sign(p[0]) * 8, ySh - 6, p[2]] as Vec3), { dir: [0, -1, 0], len: 2, dia: 10 }),
],
wait: ["SL", "SR"],
@@ -1059,7 +1081,7 @@ function glassCabinet(s: ProductSpec): CustomParams {
title: "Stand the other side frame on and screw the supports to the back",
detail: "One screw through each support at the back edge into the back frame.",
add: ["SR"],
- fix: [fx("screw", SIDES.map((sx) => [sx * (W / 2 - F - 8), ySh - 12, -D / 2 + F] as Vec3), { dir: [0, 0, -1], on: "BK", len: 12, dia: 4 })],
+ fix: [fx("screw", SIDES.map((sx) => [sx * (W / 2 - F - 20), ySh - 12, -D / 2 + F] as Vec3), { dir: [0, 0, -1], on: "BK", len: 12, dia: 4 })],
tools: ["screwdriver"],
},
{
@@ -1099,7 +1121,7 @@ function glassCabinet(s: ProductSpec): CustomParams {
add: ["FR", "D0"],
from: { FR: [0, 0, 300], D0: [0, 0, 300] },
},
- { title: "Screw a support to the front", detail: "Through the support on one side frame into the front frame.", fix: [fx("screw", [[-(W / 2 - F - 8), ySh - 12, zi]], { dir: [0, 0, 1], on: "FR", len: 12, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Screw a support to the front", detail: "Through the support on one side frame into the front frame.", fix: [fx("screw", [[-(W / 2 - F - 25), ySh - 12, zi]], { dir: [0, 0, 1], on: "FR", len: 12, dia: 4 })], tools: ["screwdriver"] },
{
title: "Bolt the front to the top and bottom",
detail: "Five bolts: three into the bottom, two into the top. One hole is under a brace for now.",
@@ -1147,7 +1169,7 @@ function slidingCabinet(s: ProductSpec): CustomParams {
parts.push(panel(`BK${i}`, "Back half", size, [(sx * xi) / 2, yB + bh / 2, zBk], framed(size, 2, 40, "fiber", "wood", 1)));
});
parts.push(part("BT", "Bottom", [2 * xi, Bt, D - P], [0, yB + Bt / 2, P / 2], { material: "wood" }));
- parts.push(part("SH", "Shelf", [2 * xi, 20, D - P - 70], [0, ySh, -35], { material: "wood" }));
+ parts.push(part("SH", "Shelf", [2 * xi, 20, D - P - 50], [0, ySh, -25], { material: "wood" }));
parts.push(part("MP", "Middle post", [40, yTop - yIn, 30], [0, (yIn + yTop) / 2, zMp], { material: "wood" }));
{
const size: Vec3 = [W, Tt, D];
@@ -1263,7 +1285,7 @@ function slidingCabinet(s: ProductSpec): CustomParams {
detail: "One on the top edge of each door, at the inner end, two screws each.",
fix: [
...SIDES.map((sx, i) => named("clip", "Top guide", [[sx * (xi - dw + 60), yTop - 1, D / 2 - (i ? 10 : 30)]], { dir: [0, -1, 0], on: `D${i}`, len: 30, dia: 25 })),
- fx("screw", SIDES.flatMap((sx, i) => [-10, 10].map((dx) => [sx * (xi - dw + 60) + dx, yTop - 1, D / 2 - (i ? 10 : 30)] as Vec3)), { dir: [0, -1, 0], len: 12, dia: 4 }),
+ ...SIDES.map((sx, i) => fx("screw", [-25, 25].map((dx) => [sx * (xi - dw + 60) + dx, yTop - 1, D / 2 - (i ? 10 : 30)] as Vec3), { dir: [0, -1, 0], on: `D${i}`, len: 12, dia: 4 })),
],
tools: ["screwdriver"],
},
@@ -1306,6 +1328,238 @@ function slidingCabinet(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/**
+ * Sideboard: the top lies upside down and gets three rails and the push openers, the sides and the divider hang on the
+ * rails with the top on its back edge, then upside down the backs slide in, the bottom goes on and the base (two legs,
+ * two rails) is built beside it and screwed on. Upright: back clips, wall spacers and fixing, shelves, two drawers that
+ * ride on the shelves, and four doors on clip hinges.
+ */
+function sideboard(s: ProductSpec): CustomParams {
+ const { W, H, D } = dims(s);
+ const ov = 8, t = 18, hb = 150, Bt = 18, Tt = 20;
+ const xo = W / 2 - ov; // outer faces of the sides
+ const yB1 = hb + Bt, yT0 = H - Tt, hs = yT0 - yB1;
+ const z0 = -D / 2 + 4, z1 = D / 2 - 26, zm = (z0 + z1) / 2, Ds = z1 - z0; // sides, front to back
+ const cw = xo - t - 9; // inside width of one compartment
+ const cx = (sx: number) => sx * (9 + cw / 2);
+ const parts: CustomPart[] = [];
+ parts.push(part("TP", "Top", [W, Tt, D], [0, H - Tt / 2, 0], { material: "wood" }));
+ const rail = (x: number): PartPiece => ({ shape: "box", size: [20, 30, Ds - 40], pos: [x, yT0 - 15, zm] });
+ parts.push(part("C0", "Rail", [20, 30, Ds - 40], [-(xo - t - 10), yT0 - 15, zm], { material: "wood" }));
+ parts.push(compound("CM", "Middle rail", [rail(-19), rail(19)], "wood"));
+ parts.push(part("C1", "Rail", [20, 30, Ds - 40], [xo - t - 10, yT0 - 15, zm], { material: "wood" }));
+ parts.push(part("SL", "Side", [t, hs, Ds], [-xo + t / 2, yB1 + hs / 2, zm], { material: "wood" }));
+ parts.push(part("MD", "Divider", [t, hs, Ds], [0, yB1 + hs / 2, zm], { material: "wood" }));
+ parts.push(part("SR", "Side", [t, hs, Ds], [xo - t / 2, yB1 + hs / 2, zm], { material: "wood" }));
+ SIDES.forEach((sx, i) => parts.push(part(`BK${i}`, "Back", [cw + 12, hs + 12, 4], [cx(sx), yB1 + hs / 2, z0 + 12], { material: "fiber" })));
+ parts.push(part("BT", "Bottom", [W, Bt, D], [0, hb + Bt / 2, 0], { material: "wood" }));
+ // the base: two upright legs and two rails between them
+ const xl = W / 2 - 300, Dl = D - 80, zc = -10, rh = 70;
+ const zr = (sz: number) => zc + sz * (Dl / 2 - 60);
+ SIDES.forEach((sx, i) => parts.push(part(`LG${i}`, "Leg", [30, hb, Dl], [sx * xl, hb / 2, zc], { material: "wood" })));
+ SIDES.forEach((sz, i) => parts.push(part(`RL${i}`, "Base rail", [2 * xl - 30, rh, 22], [0, hb - rh / 2, zr(sz)], { material: "wood" })));
+ // drawers ride on the shelves, just under the top
+ const dh = 110, dd = 360, dwd = cw - 30, zf = z1 - 3;
+ const ySh = yT0 - 40 - dh - 9;
+ SIDES.forEach((sx, i) => parts.push(part(`SH${i}`, "Shelf", [cw - 4, 18, Ds - 30], [cx(sx), ySh, zm - 5], { material: "wood" })));
+ const yd = ySh + 9 + dh / 2;
+ SIDES.forEach((sx, i) => {
+ const c = cx(sx);
+ parts.push(
+ compound(`DR${i}`, "Drawer", [
+ { shape: "box", size: [dwd, dh, 18], pos: [c, yd, zf - 9] },
+ ...[-1, 1].map((k): PartPiece => ({ shape: "box", size: [14, dh - 10, dd - 18], pos: [c + k * (dwd / 2 - 7), yd - 5, zf - 18 - (dd - 18) / 2] })),
+ { shape: "box", size: [dwd - 28, dh - 20, 14], pos: [c, yd - 10, zf - dd + 7] },
+ { shape: "box", size: [dwd - 28, 4, dd - 32], pos: [c, yd - dh / 2 + 8, zf - dd / 2], material: "fiber" },
+ ], "board"),
+ );
+ });
+ // four doors over the front, two in each half
+ const dwide = xo / 2 - 3, dhh = hs - 4, dz = z1 + 9;
+ const dcx = (i: number) => -xo + (i + 0.5) * (xo / 2);
+ range(4).forEach((i) => parts.push(part(`D${i}`, "Door", [dwide, dhh, 18], [dcx(i), yB1 + 2 + dhh / 2, dz], { material: "wood" })));
+
+ const panels: [string, number][] = [["SL", -xo + t / 2], ["MD", 0], ["SR", xo - t / 2]];
+ const hingeYs = [yB1 + 100, yT0 - 100];
+ // each door's hinge side: the panel face its plates go on, and where its hinges sit on the door
+ const hingeOf = [
+ { on: "SL", x: -xo + t, dir: [-1, 0, 0] as Vec3, hx: -xo + 30 },
+ { on: "MD", x: -9, dir: [1, 0, 0] as Vec3, hx: -30 },
+ { on: "MD", x: 9, dir: [-1, 0, 0] as Vec3, hx: 30 },
+ { on: "SR", x: xo - t, dir: [1, 0, 0] as Vec3, hx: xo - 30 },
+ ];
+ const hingePlates = (i: number) => named("plate", "Mounting plate", hingeYs.map((y) => [hingeOf[i].x, y, z1 - 37] as Vec3), { dir: hingeOf[i].dir, on: hingeOf[i].on, len: 12, dia: 40 });
+ const openX = [-xo / 2 - 40, -xo / 2 + 40, xo / 2 - 40, xo / 2 + 40];
+ const zo = z1 - 60;
+ const cleatScrews = [-(xo - t - 10), -19, 19, xo - t - 10].flatMap((x) => [zm - (Ds / 2 - 60), zm, zm + (Ds / 2 - 60)].map((z) => [x, yT0 - 30, z] as Vec3));
+ const shelfSup = SIDES.flatMap((sx) => [sx < 0 ? hingeOf[0] : hingeOf[3], sx < 0 ? hingeOf[1] : hingeOf[2]]).map((h) => named("pin", "Shelf support", [z0 + 60, z1 - 60].map((z) => [h.x, ySh - 9, z] as Vec3), { dir: h.dir, on: h.on, len: 16, dia: 12 }));
+ const midYs = range(8).map((k) => yB1 + 50 + (k * (hs - 100)) / 7);
+ const clips = [
+ ...[-1, 1].map((sx) => named("clip", "Back clip", [yB1 + 50, yB1 + 200, yT0 - 200, yT0 - 50].map((y) => [sx * (xo - t / 2), y, z0] as Vec3), { dir: [0, 0, 1], on: sx < 0 ? "SL" : "SR", len: 10, dia: 14 })),
+ named("clip", "Back clip", midYs.map((y) => [0, y, z0] as Vec3), { dir: [0, 0, 1], on: "MD", len: 10, dia: 14 }),
+ ];
+ const spacerAt: Vec3[] = SIDES.map((sx) => [sx * (xo - t / 2), yT0 - 60, z0]);
+ const wallAt: Vec3[] = SIDES.map((sx) => [sx * (xo - t - 60), yT0 - 50, z0 + 10]);
+ const aside: Vec3 = [0, 0, D + 500];
+ const base = { LG0: aside, LG1: aside, RL0: aside, RL1: aside };
+ const legCams = SIDES.map((sx, i) => fx("camScrew", SIDES.flatMap((sz) => [hb - 12, hb - 58].map((y) => [sx * (xl - 15), y, zr(sz)] as Vec3)), { dir: [sx, 0, 0], on: `LG${i}` }));
+ const drawer = (f: (sx: number, i: number, c: number) => CustomFix[]) => SIDES.flatMap((sx, i) => f(sx, i, cx(sx)));
+
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the rails under the top",
+ detail: "Lay the top upside down on a rug. A rail at each end and the double rail in the middle, three screws in each strip.",
+ add: ["TP", "C0", "CM", "C1"],
+ fix: [fx("screw", cleatScrews, { dir: UP, len: 40, dia: 4 })],
+ pose: "-y",
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the opener plates on",
+ detail: "Four plates near the front edge, two in each half, four small screws in each.",
+ fix: [
+ named("plate", "Opener plate", openX.map((x) => [x, yT0, zo] as Vec3), { dir: UP, on: "TP", len: 6, dia: 40 }),
+ fx("screw", openX.flatMap((x) => [-24, 24].flatMap((dx) => [-14, 14].map((dzz) => [x + dx, yT0, zo + dzz] as Vec3))), { dir: UP, on: "TP", len: 12, dia: 4 }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the push openers onto the plates", detail: "Slide each opener in from the back until it clicks.", fix: [named("clip", "Push opener", openX.map((x) => [x, yT0, zo + 32] as Vec3), { dir: UP, on: "TP", len: 20, dia: 30 })] },
+ {
+ title: "Screw hinge plates onto the sides",
+ detail: "Lay the two sides and the divider on the rug. Two plates near the front edge of each side, on the inside.",
+ fix: [hingePlates(0), hingePlates(3)],
+ wait: ["SL", "SR", "MD"],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw two hinge plates onto the divider", fix: [hingePlates(1)], tools: ["screwdriver"] },
+ { title: "Turn the divider over and screw on two more", detail: "At the same heights as on the other face.", fix: [hingePlates(2)], tools: ["screwdriver"] },
+ {
+ title: "Stand the top on its back edge and hang a side on it",
+ detail: "Hold the top upright between you. The three fittings on the side hook over the end rail: push it on, then slide it down until it locks.",
+ add: ["SL"],
+ from: { SL: [0, -250, 40] },
+ pose: "+z",
+ people: 2,
+ warnings: ["two"],
+ },
+ { title: "Hang the divider on the middle rail", detail: "Hinge plates to the front, the same way as the side.", add: ["MD"], from: { MD: [0, -250, 40] } },
+ { title: "Hang the other side on", add: ["SR"], from: { SR: [0, -250, 40] } },
+ {
+ title: "Turn it upside down and slide in the backs",
+ detail: "Lay it on the top. Slide each back down into the grooves of the side and the divider.",
+ add: ["BK0", "BK1"],
+ from: { BK0: [0, -500, 0], BK1: [0, -500, 0] },
+ pose: "-y",
+ people: 2,
+ },
+ {
+ title: "Push dowels into the sides and the divider",
+ detail: "Two in the edge of each.",
+ fix: panels.map(([id, x]) => fx("dowel", [z0 + 60, z1 - 60].map((z) => [x, yB1, z] as Vec3), { dir: UP, on: id, mate: "BT", len: 30, dia: 8 })),
+ },
+ { title: "Lay the bottom on", detail: "Onto the dowels, its edges over the backs.", add: ["BT"], from: { BT: [0, -300, 0] } },
+ {
+ title: "Screw the bottom on",
+ detail: "Two connector screws into each side and the divider, with the Allen key.",
+ fix: panels.map(([id, x]) => named("bolt", "Connector screw", [z0 + 110, z1 - 110].map((z) => [x, hb, z] as Vec3), { dir: UP, on: "BT", mate: id, len: 50, dia: 7 })),
+ tools: ["allen"],
+ },
+ { title: "Screw cam bolts into the legs", detail: "Build the base beside the cabinet. Four in the inside face of each leg.", fix: legCams, wait: ["LG0", "LG1"], from: base, tools: ["screwdriver"] },
+ {
+ title: "Push dowels into the base rails",
+ detail: "One in each end.",
+ fix: SIDES.flatMap((sz, i) => SIDES.map((sx, j) => fx("dowel", [[sx * (xl - 15), hb - 35, zr(sz)]], { dir: [-sx, 0, 0], on: `RL${i}`, mate: `LG${j}`, len: 30, dia: 8 }))),
+ wait: ["RL0", "RL1"],
+ from: base,
+ },
+ { title: "Push the legs onto the rails", detail: "One leg at a time, onto the dowels and cam bolts in the rail ends." },
+ {
+ title: "Lock the rails",
+ detail: "Two cam locks in each end of both rails, arrows towards the leg, turned clockwise until tight.",
+ fix: SIDES.map((sz, i) => fx("cam", SIDES.flatMap((sx) => [hb - 12, hb - 58].map((y) => [sx * (xl - 50), y, zr(sz) - sz * 11] as Vec3)), { dir: [0, 0, sz], on: `RL${i}` })),
+ tools: ["screwdriver"],
+ },
+ { title: "Turn the base over and push dowels into the legs", detail: "Two in the top of each leg.", fix: SIDES.map((sx, i) => fx("dowel", [-1, 1].map((sz) => [sx * xl, hb, zc + sz * (Dl / 2 - 50)] as Vec3), { dir: DOWN, on: `LG${i}`, mate: "BT", len: 30, dia: 8 })) },
+ { title: "Screw a foot into each leg", detail: "Turn it over again. Two in the bottom of each leg, by hand.", fix: SIDES.map((sx, i) => fx("foot", [-1, 1].map((sz) => [sx * xl, 0, zc + sz * (Dl / 2 - 30)] as Vec3), { dir: UP, on: `LG${i}`, len: 20, dia: 26 })), warnings: ["hand"] },
+ { title: "Lower the base onto the bottom", detail: "Feet up, the dowels into the holes in the bottom.", add: ["LG0", "LG1", "RL0", "RL1"], from: { LG0: [0, -300, 0], LG1: [0, -300, 0], RL0: [0, -300, 0], RL1: [0, -300, 0] } },
+ {
+ title: "Screw the base rails to the bottom",
+ detail: "Two long screws through each rail, with the Allen key.",
+ fix: SIDES.map((sz, i) => fx("screw", [-xl / 2, xl / 2].map((x) => [x, hb - rh, zr(sz)] as Vec3), { dir: UP, on: `RL${i}`, mate: "BT", len: 80, dia: 5 })),
+ tools: ["allen"],
+ },
+ { title: "Turn it the right way up", detail: "Lift it together onto its feet.", pose: "+y", people: 2, warnings: ["two"] },
+ { title: "Clip the backs in", detail: "Sixteen clips round the edges of the two backs. Push the first part into its hole, then the second into it.", fix: clips },
+ { title: "Fit the wall spacers", detail: "One at the top of each side, at the back, its two pins in the holes.", fix: [fx("spacer", spacerAt, { dir: [0, 0, 1], len: 25, dia: 30 })] },
+ { title: "Screw the knobs onto the spacers", fix: [named("cap", "Spacer knob", spacerAt, { dir: [0, 0, 1], len: 20, dia: 30 })] },
+ { title: "Push it to the wall and set the spacers", detail: "Turn each knob out until it touches the wall and the sideboard stands straight.", warnings: ["wall"] },
+ { title: "Level it with the feet", detail: "Turn the feet with the spanner until the top is level.", tools: ["wrench", "level"] },
+ { title: "Mark and drill the wall", detail: "Through the two holes near the top of the back, then pull it forward and drill.", tools: ["pencil", "drill"], warnings: ["wall"] },
+ {
+ title: "Screw it to the wall",
+ detail: "Push it back, a washer on each screw, then click the caps on. Wall screws aren't included: pick ones made for your wall.",
+ fix: [
+ fx("plug", wallAt.map((p) => [p[0], p[1], -D / 2 - 30] as Vec3), { dir: [0, 0, -1] }),
+ fx("washer", wallAt, { dir: [0, 0, -1], dia: 24 }),
+ fx("screw", wallAt, { dir: [0, 0, -1], len: 50, dia: 5 }),
+ fx("cap", wallAt.map((p) => [p[0], p[1], p[2] + 3] as Vec3), { dir: [0, 0, -1], dia: 24 }),
+ ],
+ tools: ["screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ { title: "Screw in the shelf supports", detail: "Four for each shelf, high up in each half.", fix: shelfSup, tools: ["screwdriver"] },
+ { title: "Lay the shelves on the supports", detail: "Press each one down until it clips onto the supports.", add: ["SH0", "SH1"], from: { SH0: [0, 0, 400], SH1: [0, 0, 400] } },
+ {
+ title: "Screw cam bolts into the drawer fronts",
+ detail: "Lay each front face down on the rug. Two at each end.",
+ fix: drawer((sx, i, c) => [fx("camScrew", [-1, 1].flatMap((k) => [yd - 25, yd + 25].map((y) => [c + k * (dwd / 2 - 7), y, zf - 18] as Vec3)), { dir: [0, 0, 1], on: `DR${i}` })]),
+ wait: ["DR0", "DR1"],
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ { title: "Push the drawer sides onto the bolts", detail: "Holes for the cam locks facing in." },
+ {
+ title: "Lock the drawer sides",
+ detail: "Two cam locks in each side, turned clockwise until tight.",
+ fix: drawer((sx, i, c) => [fx("cam", [-1, 1].flatMap((k) => [yd - 25, yd + 20].map((y) => [c + k * (dwd / 2 - 14), y, zf - 48] as Vec3)), { dir: [0, 0, -1], on: `DR${i}` })]),
+ tools: ["screwdriver"],
+ },
+ { title: "Slide in the drawer bottoms", detail: "Into the grooves in the sides and the front, smooth side up." },
+ { title: "Put on the drawer backs", detail: "Over the end of the bottom, between the sides." },
+ {
+ title: "Screw the backs on",
+ detail: "Two screws through each side into the back.",
+ fix: drawer((sx, i, c) => [-1, 1].map((k) => fx("screw", [yd - 35, yd + 15].map((y) => [c + k * (dwd / 2), y, zf - dd + 7] as Vec3), { dir: [-k, 0, 0], on: `DR${i}`, len: 35, dia: 4 }))),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Turn in the stop screws",
+ detail: "One inside each side near the back. Only part way: they stop the drawer.",
+ fix: drawer((sx, i, c) => [-1, 1].map((k) => fx("screw", [[c + k * (dwd / 2 - 14), yd + 20, zf - dd + 60]], { dir: [k, 0, 0], on: `DR${i}`, len: 10, dia: 4 }))),
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the drawers in", detail: "On the shelves, until they reach the stops.", add: ["DR0", "DR1"], from: { DR0: [0, 0, 450], DR1: [0, 0, 450] } },
+ { title: "Set the stops", detail: "Turn the stop screws until each drawer front sits just inside the cabinet's front edge.", tools: ["screwdriver"] },
+ { title: "Push the drawers fully in", detail: "Both should stop at the same depth." },
+ {
+ title: "Press the hinges into the doors",
+ detail: "Lay the doors face down. Two in each door, the cup in its hole, then fold the lever down until it locks.",
+ fix: range(4).map((i) => fx("hinge", hingeYs.map((y) => [hingeOf[i].hx, y, dz - 9] as Vec3), { dir: [0, 0, 1], on: `D${i}` })),
+ wait: ["D0", "D1", "D2", "D3"],
+ },
+ {
+ title: "Clip the doors onto the plates",
+ detail: "Hold each door open at a right angle and push its hinges onto the plates until they click.",
+ add: ["D0", "D1", "D2", "D3"],
+ from: { D0: [0, 0, 320], D1: [0, 0, 320], D2: [0, 0, 320], D3: [0, 0, 320] },
+ },
+ { title: "Adjust the doors", detail: "Turn the screws on the hinges until the gaps are even, then press each door to check the push opener." },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["STOCKHOLM"],
recipe(s) {
@@ -1324,6 +1578,7 @@ const family: Family = {
if (/cabinet with 2 doors/.test(v)) return cabinet2(s);
if (/glass-door cabinet/.test(v)) return glassCabinet(s);
if (/cabinet with sliding doors/.test(v)) return slidingCabinet(s);
+ if (/^sideboard/.test(v) && /2025/.test(slug)) return sideboard(s);
if (/seat sofa|seat section/.test(v)) return /2025/.test(slug) ? modular(s) : leatherSofa(s);
return null;
},
diff --git a/src/lib/plan/families/stora.ts b/src/lib/plan/families/stora.ts
index 64e9a87..781dfb2 100644
--- a/src/lib/plan/families/stora.ts
+++ b/src/lib/plan/families/stora.ts
@@ -198,7 +198,7 @@ function recipe(s: ProductSpec): CustomParams {
title: "Hang the ladder and bolt it on",
detail: "Hook it over the front bed rail in the opening, then one bolt and cap nut through each hook into the rail.",
add: ladderParts,
- fix: ladder.map((id, i): CustomFix => ({ kind: "bolt", name: "Bolt with cap nut", len: 60, dia: 6, count: 1, at: [[lx + (i ? 1 : -1) * (lw / 2 - 40), yc("bed"), zp + RT / 2]], dir: [0, 0, -1], on: id, mate: "FB" })),
+ fix: ladder.map((id, i): CustomFix => ({ kind: "bolt", name: "Bolt with cap nut", len: 60, dia: 6, count: 1, at: [[lx + (i ? 1 : -1) * (lw / 2), yc("bed"), zL0 - 10]], dir: [0, 0, -1], on: id, mate: "FB" })), // through the hook into the rail
tools: ["allen"],
},
{ title: "Click in the slat ledges", detail: "Three along the inside of each bed rail, hooked into the holes.", add: parts.filter((p) => p.name === "Slat ledge").map((p) => p.id) },
diff --git a/src/lib/plan/families/storemolla.ts b/src/lib/plan/families/storemolla.ts
index 26984da..dc080ff 100644
--- a/src/lib/plan/families/storemolla.ts
+++ b/src/lib/plan/families/storemolla.ts
@@ -72,6 +72,9 @@ function chest(b: PlanBuilder, s: ProductSpec, n: number) {
const lx = CW / 2 - L / 2;
const zF = zc + CD / 2 - L / 2, zB = zc - CD / 2 + L / 2;
const IW = CW - 2 * L; // between the frames
+ const zone0 = FREE + RT, zone1 = legH - RT;
+ const open = (zone1 - zone0 - (n - 1) * RT) / n;
+ const chestRunY = (i: number) => zone0 + i * (open + RT) + 20;
const xi = CW / 2 - L; // inside face of a side frame
// side frames, with the legs, rails and panel all in one piece
@@ -82,14 +85,14 @@ function chest(b: PlanBuilder, s: ProductSpec, n: number) {
{ shape: "box", size: [L, 60, sideLen], pos: [0, legH / 2 - 30, 0] },
{ shape: "box", size: [L, 60, sideLen], pos: [0, FREE + 30 - legH / 2, 0] },
{ shape: "box", size: [16, legH - FREE - 120, sideLen], pos: [0, (FREE + 60 + legH - 60) / 2 - legH / 2, 0] },
+ // a rung behind each runner, flush with the inside face, that the runner screws go into
+ ...range(n).map((i): PartPiece => ({ shape: "box", size: [L, 40, sideLen], pos: [0, chestRunY(i) - legH / 2, 0] })),
];
const sideT = b.part("Side frame", [L, legH, CD], { material: "wood" });
b.parts[b.parts.length - 1].pieces = sidePieces;
const sides = [-1, 1].map((g) => b.place(sideT, [g * lx, sideMid[1], sideMid[2]]));
// front rails: the bottom one and one between each pair of drawers, then the top one
- const zone0 = FREE + RT, zone1 = legH - RT;
- const open = (zone1 - zone0 - (n - 1) * RT) / n;
const railYs = [FREE + RT / 2, ...range(n - 1).map((k) => zone0 + (k + 1) * open + k * RT + RT / 2)];
const railT = b.part("Front rail", [IW, RT, RT], { material: "wood" });
const rails = railYs.map((y) => b.place(railT, [0, y, zF]));
@@ -303,7 +306,7 @@ const HINGE: HwDef = { kind: "hinge", len: 50, dia: 35 };
const HINGE_SCREW: HwDef = { kind: "screw", len: 13, dia: 4 };
/** A made-up side frame: two legs, a rail at the top and one at `low`, and the panel between them. */
-function sideFrame(b: PlanBuilder, legH: number, CD: number, zc: number, low: number) {
+function sideFrame(b: PlanBuilder, legH: number, CD: number, zc: number, low: number, rungs: number[]) {
const zF = zc + CD / 2 - L / 2, zB = zc - CD / 2 + L / 2;
const len = CD - 2 * L;
const t = b.part("Side frame", [L, legH, CD], { material: "wood" });
@@ -312,6 +315,8 @@ function sideFrame(b: PlanBuilder, legH: number, CD: number, zc: number, low: nu
{ shape: "box", size: [L, 60, len], pos: [0, legH / 2 - 30, 0] },
{ shape: "box", size: [L, 60, len], pos: [0, low + 30 - legH / 2, 0] },
{ shape: "box", size: [16, legH - low - 120, len], pos: [0, (low + 60 + legH - 60) / 2 - legH / 2, 0] },
+ // a rung behind each runner, flush with the inside face, that the runner screws go into
+ ...rungs.map((y): PartPiece => ({ shape: "box", size: [L, 40, len], pos: [0, y - legH / 2, 0] })),
];
return t;
}
@@ -435,12 +440,12 @@ function dresser8(b: PlanBuilder, s: ProductSpec) {
const zFace = zF + RT / 2;
const low = FREE + BT; // the frames stand on the bottom panel's level
- const sideT = sideFrame(b, legH, CD, zc, low);
- const sides = [-1, 1].map((g) => b.place(sideT, [g * lx, legH / 2, zc]));
- const top = b.place(b.part("Top", [W, TT, D], { material: "wood" }), [0, H - TT / 2, 0]);
// rows: the bottom front rail, then a rail between each row of drawers
const open = (legH - (FREE + RT) - 2 * RT) / 3;
const rowY0 = [0, 1, 2].map((k) => FREE + RT + k * (open + RT)); // bottom row first
+ const sideT = sideFrame(b, legH, CD, zc, low, rowY0.map((y) => y + 20));
+ const sides = [-1, 1].map((g) => b.place(sideT, [g * lx, legH / 2, zc]));
+ const top = b.place(b.part("Top", [W, TT, D], { material: "wood" }), [0, H - TT / 2, 0]);
const railYs = [FREE + RT / 2, rowY0[1] - RT / 2, rowY0[2] - RT / 2];
const railT = b.part("Front rail", [IW, RT, RT], { material: "wood" });
const rails = railYs.map((y) => b.place(railT, [0, y, zF]));
@@ -636,7 +641,7 @@ function nightstand(b: PlanBuilder, s: ProductSpec) {
const shelfTop = legH - 142;
const railY = shelfTop - RH / 2;
- const sideT = sideFrame(b, legH, CD, zc, NFREE);
+ const sideT = sideFrame(b, legH, CD, zc, NFREE, [shelfTop + 20]);
const sides = [-1, 1].map((g) => b.place(sideT, [g * lx, legH / 2, zc]));
const rail = b.place(b.part("Front rail", [IW, RH, RH], { material: "wood" }), [0, railY, zFace - RH / 2]);
const backZ0 = zB + 7;
diff --git a/src/lib/plan/families/storklinta.ts b/src/lib/plan/families/storklinta.ts
index 44c6cae..b25ed57 100644
--- a/src/lib/plan/families/storklinta.ts
+++ b/src/lib/plan/families/storklinta.ts
@@ -158,7 +158,7 @@ function buildClick(b: PlanBuilder, s: ProductSpec, c: Cfg) {
const y = yBox(cl.level) - 6;
return {
runner: { on: f.key, at: [x, y, zRun] as Vec3, dir: [-f.dir, 0, 0] as Vec3, hole: false as const },
- screws: [-runLen / 2 + 30, 0, runLen / 2 - 30].map((dz): FitOpts => ({ on: f.key, at: [x + f.dir * 2, y, zRun + dz], dir: [-f.dir, 0, 0] })),
+ screws: [-runLen / 2 + 30, 0, runLen / 2 - 30].map((dz): FitOpts => ({ on: f.key, at: [x - f.dir * 2, y, zRun + dz], dir: [f.dir, 0, 0] })),
key: f.key,
};
};
@@ -1397,10 +1397,11 @@ function storageBoxes(b: PlanBuilder, o: { W: number; L: number; T: number; n: n
const { W, L, T, n, wide } = o;
const lb = (L - 2 * T - 60) / 2, BD = 560;
const xo = W / 2;
+ const YB = 38.5; // the bottom, just under the sides and the back
const frT = b.part("Box front", [18, 160, lb]);
const sdT = b.part("Box side", [BD - 34, 130, 16]);
const bkT = b.part("Box back", [16, 130, lb]);
- const btT = b.part("Box bottom", [BD - 30, 3, lb - 20], { material: "fiber" });
+ const btT = b.part("Box bottom", [BD - 10, 3, lb - 4], { material: "fiber" });
interface Box {
g: number;
zc: number;
@@ -1418,7 +1419,8 @@ function storageBoxes(b: PlanBuilder, o: { W: number; L: number; T: number; n: n
front: b.place(frT, [g * (xo - 9), 105, zc]),
sides: [-1, 1].map((e) => b.place(sdT, [g * (xo - 18 - (BD - 34) / 2), 105, zc + e * (lb / 2 - 8)])),
back: b.place(bkT, [g * (xo - BD + 8), 105, zc]),
- bottom: b.place(btT, [g * (xo - 18 - (BD - 34) / 2), 47, zc]),
+ // under the sides and the back, its front edge in a groove in the front
+ bottom: b.place(btT, [g * (xo - (BD + 10) / 2), YB, zc]),
};
});
const xF = (x: Box) => x.g * (xo - 18), xB = (x: Box) => x.g * (xo - BD + 16);
@@ -1437,12 +1439,12 @@ function storageBoxes(b: PlanBuilder, o: { W: number; L: number; T: number; n: n
backPins: ends.flatMap((e, i) => [70, 140].map((y): FitOpts => ({ on: x.back, at: [xB(x), y, zs(e)], dir: [-x.g, 0, 0], mate: x.sides[i], mateHole: 4 }))),
backCams: ends.flatMap((e) => [70, 140].map((y): FitOpts => ({ on: x.sides[e < 0 ? 0 : 1], at: [xB(x) + x.g * 30, y, zIn(e)], dir: [0, 0, e] }))),
screws: [
- ...spread(x.zc - lb / 2 + 60, x.zc + lb / 2 - 60, nf).map((z): FitOpts => ({ on: x.bottom, at: [xF(x) - x.g * 6, 45.5, z], dir: [0, 1, 0], mate: x.front })),
- ...spread(x.zc - lb / 2 + 80, x.zc + lb / 2 - 80, nb).map((z): FitOpts => ({ on: x.bottom, at: [xB(x) + x.g * 6, 45.5, z], dir: [0, 1, 0], mate: x.back })),
- ...ends.map((e, i): FitOpts => ({ on: x.bottom, at: [x.g * (xo - BD / 2), 45.5, zs(e)], dir: [0, 1, 0], mate: x.sides[i] })),
+ ...spread(x.zc - lb / 2 + 60, x.zc + lb / 2 - 60, nf).map((z): FitOpts => ({ on: x.bottom, at: [x.g * (xo - 13), YB - 1.5, z], dir: [0, 1, 0], mate: x.front })),
+ ...spread(x.zc - lb / 2 + 80, x.zc + lb / 2 - 80, nb).map((z): FitOpts => ({ on: x.bottom, at: [x.g * (xo - BD + 8), YB - 1.5, z], dir: [0, 1, 0], mate: x.back })),
+ ...ends.map((e, i): FitOpts => ({ on: x.bottom, at: [x.g * (xo - BD / 2), YB - 1.5, zs(e)], dir: [0, 1, 0], mate: x.sides[i] })),
],
- castors: [xF(x) - x.g * 50, xB(x) + x.g * 50].flatMap((cx) => ends.map((e): FitOpts => ({ on: x.bottom, at: [cx, 44, x.zc + e * (lb / 2 - 60)], dir: [0, 1, 0], hole: false }))),
- castorScrews: [xF(x) - x.g * 50, xB(x) + x.g * 50].flatMap((cx) => ends.flatMap((e) => [-16, 16].map((dz): FitOpts => ({ on: x.bottom, at: [cx, 44, x.zc + e * (lb / 2 - 60) + dz], dir: [0, 1, 0] })))),
+ castors: [xF(x) - x.g * 50, xB(x) + x.g * 50].flatMap((cx) => ends.map((e): FitOpts => ({ on: x.bottom, at: [cx, YB - 1.5, x.zc + e * (lb / 2 - 60)], dir: [0, 1, 0], hole: false }))),
+ castorScrews: [xF(x) - x.g * 50, xB(x) + x.g * 50].flatMap((cx) => ends.flatMap((e) => [-16, 16].map((dz): FitOpts => ({ on: x.bottom, at: [cx, YB - 1.5, x.zc + e * (lb / 2 - 60) + dz], dir: [0, 1, 0] })))),
};
};
const x0 = all[0];
diff --git a/src/lib/plan/families/strandon.ts b/src/lib/plan/families/strandon.ts
new file mode 100644
index 0000000..de42729
--- /dev/null
+++ b/src/lib/plan/families/strandon.ts
@@ -0,0 +1,79 @@
+import type { Family } from "./family";
+import type { CustomParams, CustomPart, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * STRANDÖN beach furniture comes ready to use: IKEA lists no assembly manual for the sun lounger or the folding
+ * stool. Their guides only unfold them: the lounger is a fabric seat and backrest with a steel stand that swings out
+ * behind the back, the stool two steel U frames crossed under a fabric seat.
+ */
+
+const tube = (from: Vec3, to: Vec3, dia: number): PartPiece => {
+ const d = [to[0] - from[0], to[1] - from[1], to[2] - from[2]];
+ const len = Math.hypot(d[0], d[1], d[2]);
+ // a cylinder stands along y; lean it over in its own plane
+ const rot: Vec3 = Math.abs(d[2]) > Math.abs(d[0]) ? [Math.atan2(d[2], d[1]), 0, 0] : [0, 0, -Math.atan2(d[0], d[1])];
+ return { shape: "cyl", size: [dia, len, dia], pos: [(from[0] + to[0]) / 2, (from[1] + to[1]) / 2, (from[2] + to[2]) / 2], rot };
+};
+/** A part from pieces given in product mm: its box round them, the pieces made relative to its centre. */
+function partOf(id: string, name: string, material: CustomPart["material"], pieces: PartPiece[], box: [Vec3, Vec3]): CustomPart {
+ const c: Vec3 = [0, 1, 2].map((k) => (box[0][k] + box[1][k]) / 2) as Vec3;
+ return { id, name, material, size: [0, 1, 2].map((k) => box[1][k] - box[0][k]) as Vec3, pos: c, pieces: pieces.map((p) => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] as Vec3 })) };
+}
+
+function lounger(s: ProductSpec): CustomParams {
+ const L = Math.round(s.size.w * 10), H = Math.round(s.size.h * 10), Wd = Math.round(s.size.d * 10);
+ const t = 14;
+ const x0 = -L / 2, xk = x0 + 560; // seat from the foot end to the fold
+ const topX = xk + 190; // the backrest leans back
+ const back = Math.hypot(topX - xk, H);
+ const lean = Math.atan2(topX - xk, H);
+ const parts: CustomPart[] = [
+ { id: "S", name: "Seat", size: [xk - x0, t, Wd], pos: [(x0 + xk) / 2, t / 2, 0], material: "soft" },
+ { id: "B", name: "Backrest", size: [topX - xk + t, H, Wd], pos: [(xk + topX) / 2, H / 2, 0], material: "soft", pieces: [{ shape: "box", size: [t, back, Wd], pos: [0, 0, 0], rot: [0, 0, -lean] }] },
+ partOf("F", "Stand", "metal", [
+ ...[-1, 1].map((g) => tube([topX - 20, H - 40, g * (Wd / 2 - 20)], [L / 2 - 10, 6, g * (Wd / 2 - 20)], 12)),
+ { shape: "cyl", size: [12, Wd - 40, 12], pos: [L / 2 - 10, 6, 0], rot: [Math.PI / 2, 0, 0] },
+ ], [[topX - 30, 0, -Wd / 2 + 10], [L / 2, H - 30, Wd / 2 - 10]]),
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Unfold the lounger on the ground", detail: "It comes folded flat and ready to use. Lay the seat out flat and lift the backrest.", add: ["S", "B"] },
+ { title: "Swing out the stand", detail: "Fold the steel stand out from behind the backrest until its bar rests on the ground. It holds the back up.", add: ["F"], from: { F: [-300, 0, 0] } },
+ { title: "Tuck your towel under the bands", detail: "The two elastic bands on the backrest hold a towel or sunglasses in the wind." },
+ ],
+ };
+}
+
+function stool(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10), H = Math.round(s.size.h * 10), D = Math.round(s.size.d * 10);
+ const tz = 145, fz = D / 2 - 10; // top rails and feet, front to back
+ const yr = H - 10;
+ const frame = (id: string, x: number, sign: 1 | -1) => partOf(id, "Frame", "metal", [
+ ...[-1, 1].map((g) => tube([g * x, yr, sign * tz], [g * x, 8, -sign * fz], 16)),
+ // one frame carries the front rail, the other the back one
+ { shape: "cyl", size: [16, 2 * x + 16, 16], pos: [0, yr, sign * tz], rot: [0, 0, Math.PI / 2] },
+ ], [[-x - 8, 0, -fz - 8], [x + 8, yr + 8, fz + 8]]);
+ const parts: CustomPart[] = [
+ frame("A", W / 2 - 8, 1),
+ frame("B", W / 2 - 26, -1),
+ { id: "S", name: "Seat", size: [2 * (W / 2 - 26) - 40, 3, 2 * tz], pos: [0, yr + 8, 0], material: "soft" },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Open the stool", detail: "It comes folded and ready to use. Pull the two frames apart until the seat fabric is tight.", add: ["A", "B", "S"] },
+ { title: "Check it stands firm", detail: "All four feet with their caps on the ground, on a flat spot." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["STRANDÖN", "STRANDON"],
+ recipe(s) {
+ if (/lounger/i.test(s.variant)) return lounger(s);
+ if (/stool/i.test(s.variant)) return stool(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/styrspel.ts b/src/lib/plan/families/styrspel.ts
index 88692ab..bfbaa7f 100644
--- a/src/lib/plan/families/styrspel.ts
+++ b/src/lib/plan/families/styrspel.ts
@@ -48,7 +48,7 @@ function recipe(s: ProductSpec): CustomParams {
[[-225, by1 - 30, bz - 15], [225, by1, bz + 15]],
[[-200, by0 + 80, bz - 4], [200, by1 - 30, bz + 4], "fiber"],
// the bracket: from under the mechanism back, then up behind the seat
- [[-40, MY - 25, -300], [40, MY - 5, -120], "metal"],
+ [[-40, MY - 25, -300], [40, MY - 5, -95], "metal"],
[[-40, MY - 25, bz - 20], [40, by0 + 80, bz], "metal"],
], "board");
const parts: CustomPart[] = [
@@ -59,8 +59,9 @@ function recipe(s: ProductSpec): CustomParams {
back,
...[-1, 1].map((g, i) =>
boxes(`A${i + 1}`, "Armrest", [
- [[Math.min(g * 90, g * 270), MY - 25, -60], [Math.max(g * 90, g * 270), MY - 5, 20]],
- [[Math.min(g * 260, g * 285), MY - 5, -40], [Math.max(g * 260, g * 285), 630, 0]],
+ // the bar slides into a slot in the side of the mechanism
+ [[Math.min(g * 60, g * 285), MY + 12, -60], [Math.max(g * 60, g * 285), MY + 32, 20]],
+ [[Math.min(g * 260, g * 285), MY + 32, -40], [Math.max(g * 260, g * 285), 630, 0]],
[[Math.min(g * 240, g * 300), 630, -130], [Math.max(g * 240, g * 300), 655, 110]],
], "board"),
),
@@ -100,14 +101,14 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Bolt the backrest on",
detail: "Three long bolts through the bracket. Then turn the seat over onto its back on the table.",
- fix: [fix("bolt", [-25, 0, 25].map((x): Vec3 => [x, MY - 25, -160]), [0, 1, 0], { len: 30, dia: 8, on: "K", mate: "M" })],
+ fix: [fix("bolt", [-25, 0, 25].map((x): Vec3 => [x, MY - 25, -112]), [0, 1, 0], { len: 30, dia: 8, on: "K", mate: "M" })],
tools: ["allen"],
},
{ title: "Slide in the armrests", detail: "One from each side, into the slots under the seat.", add: ["A1", "A2"], from: { A1: [-300, 0, 0], A2: [300, 0, 0] } },
{
title: "Bolt the armrests on",
detail: "Two short bolts in each, round heads, turned in by hand first.",
- fix: [-1, 1].map((g, i) => fix("bolt", [-40, 0].map((z): Vec3 => [g * 140, MY - 25, z]), [0, 1, 0], { len: 16, dia: 8, on: `A${i + 1}`, mate: "M" })),
+ fix: [-1, 1].map((g, i) => fix("bolt", [-40, 0].map((z): Vec3 => [g * 80, MY, z]), [0, 1, 0], { len: 16, dia: 8, on: "M", mate: `A${i + 1}` })),
tools: ["allen"],
},
{ title: "Tighten the armrest bolts", detail: "All four, firmly, so the heads sit flat.", tools: ["allen"] },
@@ -122,7 +123,8 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Bolt the headrest",
detail: "One bolt from behind, with the Allen key.",
- fix: [fix("bolt", [[0, by1 - 40, bz - 25]], [0, 0, 1], { len: 16, dia: 6, on: "HR", mate: "K" })],
+ // through one of the headrest's prongs into the backrest's top bar
+ fix: [fix("bolt", [[10, by1 - 15, bz - 28]], [0, 0, 1], { len: 16, dia: 6, on: "HR", mate: "K" })],
tools: ["allen"],
},
],
diff --git a/src/lib/plan/families/sundso.ts b/src/lib/plan/families/sundso.ts
index 52c6841..db4340a 100644
--- a/src/lib/plan/families/sundso.ts
+++ b/src/lib/plan/families/sundso.ts
@@ -1,5 +1,5 @@
import type { Family } from "./family";
-import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Vec3 } from "../../types";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3 } from "../../types";
/**
* SUNDSÖ, read from the cabinet's manual. The steel cabinet slots together: both sides drop onto the base frame's
@@ -7,7 +7,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Vec3 }
* it. Lying on its back it gets two screws at the bottom and four feet tapped into the base; stood up, the bottom
* panel drops in and is screwed to the sides, the shelves rest on clips, and the door turns on a pin at the bottom
* and a sprung pin at the top. Two screws through the back hold it to the wall. The table and the folding chair are
- * sold ready to use, with no assembly manual, so they keep their old guides.
+ * sold ready to use, with no assembly manual: their guides only unfold them.
*/
const W = 600, H = 860, D = 350;
@@ -168,8 +168,9 @@ function cabinet(): CustomParams {
title: "Screw the bumpers inside the door",
detail: "One near the top and one near the bottom, on the edge that closes. They stop the door banging on the sides.",
fix: [
- { kind: "washer", name: "Door bumper", count: 2, len: 6, dia: 14, at: [YT - 60, Y0 + 60].map((y) => [-dw / 2 + 30, y, D / 2 - DOOR] as Vec3), dir: [0, 0, 1], on: "D" },
- { kind: "screw", count: 2, len: 12, dia: 3.5, at: [YT - 60, Y0 + 60].map((y) => [-dw / 2 + 30, y, D / 2 - DOOR - 6] as Vec3), dir: [0, 0, 1], on: "D" },
+ // through the bumper into the back of the door's face
+ { kind: "screw", count: 2, len: 12, dia: 3.5, at: [YT - 60, Y0 + 60].map((y) => [-dw / 2 + 30, y, D / 2 - 10] as Vec3), dir: [0, 0, 1], on: "D" },
+ { kind: "washer", name: "Door bumper", count: 2, len: 6, dia: 14, at: [YT - 60, Y0 + 60].map((y) => [-dw / 2 + 30, y, D / 2 - 10] as Vec3), dir: [0, 0, 1], on: "D" },
],
tools: ["screwdriver"],
},
@@ -200,11 +201,96 @@ function cabinet(): CustomParams {
return { parts, steps };
}
+/* ---------- sold folded: the table and the folding chair ---------- */
+
+/** A round or square bar from a to b (mm, relative to the part's middle), as a piece. */
+function bar(a: Vec3, b: Vec3, t = 16): PartPiece {
+ const d: Vec3 = [b[0] - a[0], b[1] - a[1], b[2] - a[2]];
+ const len = Math.hypot(...d);
+ const mid: Vec3 = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
+ // a bar along y turned about x (leaning front to back), or one lying along x
+ if (Math.abs(d[0]) > Math.abs(d[1]) && Math.abs(d[0]) > Math.abs(d[2])) return { shape: "box", size: [len, t, t], pos: mid };
+ if (Math.abs(d[2]) > Math.abs(d[1])) return { shape: "box", size: [t, t, len], pos: mid, rot: [Math.atan2(-d[1], d[2]), 0, 0] };
+ return { shape: "box", size: [t, len, t], pos: mid, rot: [Math.atan2(d[2], d[1]), 0, 0] };
+}
+
+/**
+ * The SUNDSÖ table has no manual: it comes folded, its two leg frames crossing under the top. Unfold it and lock
+ * the brace, that's all.
+ */
+function table(s: ProductSpec): CustomParams {
+ const round = !/-x-/.test(s.slug ?? ""); // "65 cm" is the round one, "65 x 65" the square
+ const Wt = s.size.w * 10, Dt = s.size.d * 10, Ht = s.size.h * 10;
+ const tt = 16, yc = Ht / 2;
+ const xl = Wt / 2 - 70;
+ // legs cross in an X seen from the side: one frame leans forward, the other back
+ const frameOf = (lean: number): PartPiece[] => {
+ const top: Vec3 = [0, Ht - tt - 20 - yc, -lean * 200];
+ const foot: Vec3 = [0, -yc, lean * 260];
+ const at = (k: number): Vec3 => [0, top[1] + (foot[1] - top[1]) * k, top[2] + (foot[2] - top[2]) * k];
+ return [
+ ...[-1, 1].map((sx) => bar([sx * xl, top[1], top[2]], [sx * xl, foot[1], foot[2]])),
+ bar([-xl, at(0.9)[1], at(0.9)[2]], [xl, at(0.9)[1], at(0.9)[2]]),
+ bar([-xl, at(0.08)[1], at(0.08)[2]], [xl, at(0.08)[1], at(0.08)[2]]),
+ ];
+ };
+ const parts: CustomPart[] = [
+ {
+ id: "T",
+ name: "Top with front legs",
+ size: [Wt, Ht, Dt],
+ pos: [0, yc, 0],
+ material: "metal",
+ pieces: [round ? { shape: "cyl", size: [Wt, tt, Dt], pos: [0, Ht - tt / 2 - yc, 0] } : { shape: "box", size: [Wt, tt, Dt], pos: [0, Ht - tt / 2 - yc, 0] }, ...frameOf(1)],
+ },
+ { id: "L", name: "Back leg frame", size: [Wt - 100, Ht - tt - 20, 500], pos: [0, (Ht - tt - 20) / 2, 0], material: "metal", pieces: frameOf(-1).map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] + yc - (Ht - tt - 20) / 2, p.pos[2]] as Vec3 })) },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Stand the folded table on its front legs", detail: "It comes ready made, with no fittings: the legs fold flat under the top.", add: ["T"] },
+ { title: "Swing the back legs out", detail: "Pull them away from the front legs until they stand on the floor and the top lies level.", add: ["L"], from: { L: [0, 120, 360] }, warnings: ["hand"] },
+ { title: "Lock it open", detail: "Push the brace under the top down until it clicks over the rail. To fold it, lift the brace first and keep your fingers clear of the hinges." },
+ ],
+ };
+}
+
+/** The folding chair has no manual either: unfold it, press the seat down and it's ready. */
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const ys = 450, xl = W / 2 - 25;
+ const back: PartPiece[] = [
+ ...[-1, 1].map((sx) => bar([sx * xl, 0, -D / 2 + 120], [sx * xl, H, -D / 2 + 20])),
+ ...[0, 1, 2].map((k): PartPiece => ({ shape: "box", size: [W - 40, 60, 10], pos: [0, H - 50 - k * 80, -D / 2 + 25 + k * 10], rot: [-0.12, 0, 0] })),
+ bar([-xl, 120, -D / 2 + 110], [xl, 120, -D / 2 + 110]),
+ ];
+ const seat: PartPiece[] = Array.from({ length: 6 }, (_, k): PartPiece => ({ shape: "box", size: [W - 40, 12, 52], pos: [0, ys, -D / 2 + 90 + k * 58] }));
+ const front: PartPiece[] = [
+ ...[-1, 1].map((sx) => bar([(sx * xl) - sx * 20, ys - 10, -D / 2 + 110], [sx * xl - sx * 20, 0, D / 2 - 20])),
+ bar([-xl + 20, 100, D / 2 - 40], [xl - 20, 100, D / 2 - 40]),
+ ];
+ const parts: CustomPart[] = [
+ { id: "B", name: "Back frame", size: [W, H, D], pos: [0, H / 2, 0], material: "metal", pieces: back.map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] - H / 2, p.pos[2]] as Vec3 })) },
+ { id: "F", name: "Front legs", size: [W, ys, D], pos: [0, ys / 2, 0], material: "metal", pieces: front.map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] - ys / 2, p.pos[2]] as Vec3 })) },
+ { id: "S", name: "Seat", size: [W - 40, 12, D - 100], pos: [0, ys, 0], material: "metal", pieces: seat.map((p) => ({ ...p, pos: [p.pos[0], p.pos[1] - ys, p.pos[2]] as Vec3 })) },
+ ];
+ return {
+ parts,
+ steps: [
+ { title: "Stand the folded chair on its back legs", detail: "It comes ready made, with no fittings to add.", add: ["B"] },
+ { title: "Swing the front legs out", detail: "Pull the bottom of the front legs forward until both pairs stand on the floor.", add: ["F"], from: { F: [0, 0, -260] }, warnings: ["hand"] },
+ { title: "Press the seat down", detail: "Push it down flat until it rests on the front rail. To fold the chair, lift the front of the seat; keep your fingers clear of the joints.", add: ["S"], from: { S: [0, 300, -150] } },
+ ],
+ };
+}
+
const family: Family = {
names: ["SUNDSÖ", "SUNDSO"],
recipe(s) {
if (/^cabinet/i.test(s.variant)) return cabinet();
- return null; // the table and the folding chair come ready to use
+ if (/table/i.test(s.variant)) return table(s);
+ if (/folding chair/i.test(s.variant)) return chair(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/sundvik.ts b/src/lib/plan/families/sundvik.ts
index 1e28a0b..f8e0f51 100644
--- a/src/lib/plan/families/sundvik.ts
+++ b/src/lib/plan/families/sundvik.ts
@@ -118,15 +118,16 @@ function chair(s: ProductSpec): CustomParams {
});
const crossW = W - 2 * L;
const backY = SH + (H - SH) * 0.62;
+ const zc0 = -D / 2 + L + 11; // the back cross rail, just in front of the back legs and under the seat
const parts: CustomPart[] = [
side(-1),
side(1),
{ id: "B", name: "Backrest", size: [crossW, (H - SH) * 0.55, 18], pos: [0, backY, -lz], material: "wood" },
- { id: "C0", name: "Cross rail", size: [crossW, 50, 22], pos: [0, railY, -lz], material: "wood" },
+ { id: "C0", name: "Cross rail", size: [crossW, 50, 22], pos: [0, railY, zc0], material: "wood" },
{ id: "C1", name: "Cross rail", size: [crossW, 50, 22], pos: [0, railY, lz], material: "wood" },
{ id: "S", name: "Seat", size: [W, ST, D - L], pos: [0, SH - ST / 2, L / 2], material: "wood" },
];
- const sideScrews = (g: number): CustomFix => ({ kind: "screw", count: 3, len: 70, dia: 6, at: [[g * W / 2, backY, -lz], [g * W / 2, railY, -lz], [g * W / 2, railY, lz]], dir: [-g, 0, 0] });
+ const sideScrews = (g: number): CustomFix => ({ kind: "screw", count: 3, len: 70, dia: 6, at: [[g * W / 2, backY, -lz], [g * W / 2, railY, zc0], [g * W / 2, railY, lz]], dir: [-g, 0, 0] });
const steps: CustomStep[] = [
{
title: "Push the backrest into one side frame",
@@ -145,7 +146,7 @@ function chair(s: ProductSpec): CustomParams {
title: "Screw the seat on from underneath",
detail: "Lay the seat face down and stand the chair upside down on it. Four screws up through the cross rails into the seat.",
add: ["S"],
- fix: [{ kind: "screw", count: 4, len: 60, dia: 5, at: [-1, 1].flatMap((gz) => [-1, 1].map((gx): Vec3 => [gx * crossW * 0.3, railY - 25, gz * lz])), dir: [0, 1, 0] }],
+ fix: [{ kind: "screw", count: 4, len: 60, dia: 5, at: [-1, 1].flatMap((gz) => [-1, 1].map((gx): Vec3 => [gx * crossW * 0.3, railY - 25, gz < 0 ? zc0 : lz])), dir: [0, 1, 0] }],
pose: "-y",
tools: ["screwdriver"],
from: { S: [0, -250, 0] },
@@ -272,7 +273,8 @@ function cot(s: ProductSpec, crib: boolean): CustomParams {
{ kind: "nut", name: "Barrel nut", count: 4, len: 14, dia: 10, at: [-1, 1].flatMap((gz) => [topY, botY].map((y): Vec3 => [g * (sideLen / 2 - 40), y - 20, gz * pz])), dir: [0, 1, 0] },
];
const supportsFix: CustomFix[] = [-1, 1].map((g) => ({ kind: "pin", name: "Base support", count: 2, len: 40, dia: 8, at: [-1, 1].map((gz): Vec3 => [g * (L / 2 - P), baseY - 25, gz * (W / 2 - P - 80)]), dir: [g, 0, 0] }));
- const baseBolts: CustomFix = { kind: "bolt", count: 4, len: 30, dia: 6, at: [-1, 1].flatMap((g) => [-1, 1].map((gz): Vec3 => [g * (sideLen / 2 - 25), baseY + 20, gz * (W / 2 - P - 80)])), dir: [0, -1, 0] };
+ // down through the corners of the base's two long rails
+ const baseBolts: CustomFix = { kind: "bolt", count: 4, len: 30, dia: 6, at: [-1, 1].flatMap((g) => [-1, 1].map((gz): Vec3 => [g * (sideLen / 2 - 25), baseY + 20, gz * ((W - 2 * P - 40) / 2)])), dir: [0, -1, 0], on: "B" };
const stopAt = (gz: number, d: number) => [-1, 1].map((g): Vec3 => [g * (sideLen / 2 - 30), botY - 40, gz * (pz + d)]);
const stops: CustomFix[] = [-1, 1].flatMap((gz): CustomFix[] => [
{ kind: "clip", name: "Side stop", count: 2, len: 30, dia: 25, at: stopAt(gz, 15), dir: [0, 0, -gz] },
@@ -286,7 +288,7 @@ function cot(s: ProductSpec, crib: boolean): CustomParams {
const otherEnd: CustomStep = { title: "Stand it on that end and bolt on the other one", detail: "Lay the second end panel on top, push it onto the dowels, then barrel nuts and four bolts as before.", add: ["E1"], fix: endBolts(1), tools: ["allen"], pose: "+x", from: { E1: [300, 0, 0] } };
if (crib) {
steps.push(
- { title: "Screw the base supports into the base", detail: "One near each corner of the frame under the base.", fix: [baseBolts], tools: ["allen"] },
+ { title: "Screw the base supports into the base", detail: "One near each corner of the frame under the base.", fix: [baseBolts], tools: ["allen"], wait: ["B"] },
{ title: "Stand it on its end and slide the base in", detail: "Hook the base onto the supports at the height for your baby's age: the upper one for a newborn, the lower one once your child can sit or pull up.", add: ["B"], fix: supportsFix, pose: "+x", from: { B: [300, 0, 0] } },
otherEnd,
);
@@ -377,8 +379,8 @@ function bed(s: ProductSpec): CustomParams {
{ title: "Push the side boards onto the headboard", detail: "Stand the headboard up and press both boards onto its dowels, curved ends at the top.", add: ["E"], from: { E: [0, 0, -300] }, people: 2, warnings: ["two"] },
{ title: "Bolt the side boards to the headboard", detail: "Barrel nuts into the boards from the inside, then two long bolts through each post.", fix: [...fx("nut", sides((g) => [[g * (xS - T / 2), 240, -L / 2 + P + 40], [g * (xS - T / 2), 300, -L / 2 + P + 40]]), sx, NUT), ...fx("bolt", sides((g) => [[g * (W / 2 - P / 2), 240, -L / 2], [g * (W / 2 - P / 2), 300, -L / 2]]), () => [0, 0, 1], BOLT)], tools: ["allen"] },
{ title: "Tap the dowels into the slat ledges", detail: "Long dowels in one end of both ledges.", add: ["R0", "R1"], fix: fx("dowel", sides((g) => [[g * xL - 6, 262, -L / 2 + P], [g * xL + 6, 262, -L / 2 + P]]), () => [0, 0, -1], LONG), tools: ["hammer"] },
- { title: "Bolt the cross board to the other end of the ledges", detail: "Short dowels in the board first, then a barrel nut in each ledge and a long bolt through the board.", add: ["C"], fix: [...fx("dowel", sides((g) => [[g * (xM - P / 2), 230, zM - P / 2], [g * (xM - P / 2), 270, zM - P / 2]]), sx, SHORT), ...fx("nut", sides((g) => [[g * xL, 279, zM - P - 40]]), () => [0, -1, 0], NUT), ...fx("bolt", sides((g) => [[g * xL, 262, zM - P / 2 + T / 2]]), () => [0, 0, -1], BOLT)], tools: ["allen", "hammer"] },
- { title: "Turn the head end over and fit the ledges in", detail: "Upside down on the rug. The cross board goes between the middle legs on two long dowels.", fix: fx("dowel", sides((g) => [[g * (xM - P / 2), 250, zM - P / 2]]), sx, LONG, () => "C"), pose: "-y", warnings: ["floor"] },
+ { title: "Bolt the cross board to the other end of the ledges", detail: "Short dowels in the board first, then a barrel nut in each ledge and a long bolt through the board.", add: ["C"], fix: [...fx("dowel", sides((g) => [[g * (xM - P / 2), 205, zM - P / 2], [g * (xM - P / 2), 290, zM - P / 2]]), sx, SHORT), ...fx("nut", sides((g) => [[g * xL, 279, zM - P - 40]]), () => [0, -1, 0], NUT), ...fx("bolt", sides((g) => [[g * xL, 262, zM - P / 2 + T / 2]]), () => [0, 0, -1], BOLT)], tools: ["allen", "hammer"] },
+ { title: "Turn the head end over and fit the ledges in", detail: "Upside down on the rug. The cross board goes between the middle legs on two long dowels.", fix: fx("dowel", sides((g) => [[g * (xM - P / 2), 240, zM - P / 2]]), sx, LONG, () => "C"), pose: "-y", warnings: ["floor"] },
{ title: "Bolt the middle legs to the cross board", detail: "Use the two silver barrel nuts here, one in each end of the cross board.", fix: [...fx("nut", sides((g) => [[g * (xM - P / 2 - 30), 300, zM - P / 2]]), () => [0, -1, 0], { ...NUT, dia: 12 }), ...fx("bolt", sides((g) => [[g * (xM + P / 2), 250, zM - P / 2]]), nx, BOLT)], tools: ["allen"] },
{ title: "Stand it up and bolt the ledges to the headboard", detail: "A barrel nut in each ledge, then a long bolt through the headboard's bottom rail.", fix: [...fx("nut", sides((g) => [[g * xL, 279, -L / 2 + P + 40]]), () => [0, -1, 0], NUT), ...fx("bolt", sides((g) => [[g * xL, 262, -L / 2]]), () => [0, 0, 1], BOLT)], pose: "+y", tools: ["allen"] },
{ title: "Slide the foot side boards in", detail: "Inside the head side boards. Pull them out to the length you want and lock each with two short bolts.", add: ["F0", "F1"], fix: fx("bolt", sides((g) => [[g * W / 2, 265, zM - 100], [g * W / 2, 265, zM - 240]]), nx, { len: 30, dia: 6 }), tools: ["allen"], from: { F0: [0, 0, 400], F1: [0, 0, 400] } },
@@ -392,8 +394,539 @@ function bed(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/* ---------- wardrobe ---------- */
+
+/**
+ * The wardrobe, from its manual: two side frames lie on a rug and take their cam bolts, dowels, runner fittings and
+ * feet; on its side, the four rails and two shelves stand in the left frame, the bottom slides in and the right frame
+ * goes on top. The clothes rail and the back go in, then it stands up for the crown (three mouldings round the top
+ * panel, with the wall brackets), the hinge plates, the wall fixing, the two doors, the drawer and the knobs.
+ */
+function wardrobe(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const P = 45, cr = 60, Hc = H - cr; // posts, crown height, top of the carcass
+ const xP = W / 2 - P / 2, zP = D / 2 - P / 2, xi = W / 2 - P, iw = 2 * xi;
+ const yBot = 160, yTop = Hc - 80; // the bottom rails' top, the top rails' underside
+ const yS2 = 440, yS1 = Hc - 330, yRod = yS1 - 60; // lower shelf, upper shelf, clothes rail
+ const zF = D / 2 - 12.5, zB = -zF; // the front and back rails
+ const side = (id: string, sx: number): CustomPart => ({
+ id,
+ name: "Side frame",
+ size: [P, Hc, D],
+ pos: [sx * xP, Hc / 2, 0],
+ material: "board",
+ pieces: [
+ box([P, Hc, P], [0, 0, zP]),
+ box([P, Hc, P], [0, 0, -zP]),
+ box([22, 70, D - 2 * P], [0, Hc / 2 - 35, 0]),
+ box([22, 80, D - 2 * P], [0, 120 - Hc / 2, 0]),
+ { shape: "box", size: [12, Hc - 70 - yBot, D - 2 * P], pos: [0, (yBot + Hc - 70) / 2 - Hc / 2, 0], material: "fiber" },
+ ],
+ });
+ const rail = (id: string, name: string, y: number, z: number): CustomPart => ({ id, name, size: [iw, 80, 25], pos: [0, y, z], material: "board" });
+ const dW = xi - 4, dY0 = yS2 + 12, dY1 = yTop - 3;
+ const door = (id: string, sx: number): CustomPart => ({ id, name: "Door", size: [dW, dY1 - dY0, 20], pos: [sx * (dW / 2 + 2), (dY0 + dY1) / 2, D / 2 - 10], material: "board" });
+ // the drawer fills the gap between the bottom rail and the lower shelf
+ const dfH = yS2 - 9 - yBot - 6, dfY = yBot + 3 + dfH / 2, dbD = D - 80, dsX = xi - 28, dsY = yBot + 20 + 90, dzB = D / 2 - 20 - dbD;
+ const parts: CustomPart[] = [
+ side("SL", -1),
+ side("SR", 1),
+ rail("FT", "Top rail", Hc - 40, zF),
+ rail("BT", "Top rail", Hc - 40, zB),
+ rail("FB", "Bottom rail", 120, zF),
+ rail("BB", "Bottom rail", 120, zB),
+ { id: "S1", name: "Shelf", size: [iw, 18, D - 60], pos: [0, yS1 + 9, 5], material: "board" },
+ { id: "S2", name: "Shelf", size: [iw, 18, D - 60], pos: [0, yS2 + 9, 5], material: "board" },
+ { id: "BP", name: "Bottom", size: [iw, 18, D - 50], pos: [0, yBot - 9, 0], material: "board" },
+ { id: "R", name: "Clothes rail", size: [iw, 25, 25], pos: [0, yRod, 0], shape: "cyl", material: "metal" },
+ { id: "K", name: "Back panel", size: [iw + 10, yTop - yBot, 4], pos: [0, (yTop + yBot) / 2, -D / 2 + 30], material: "fiber" },
+ { id: "T", name: "Top panel", size: [W, 18, D], pos: [0, Hc + 9, 0], material: "board" },
+ { id: "MF", name: "Front moulding", size: [W + 40, cr, 30], pos: [0, Hc + cr / 2, D / 2 + 5], material: "board" },
+ ...[-1, 1].map((sx): CustomPart => ({ id: sx < 0 ? "ML" : "MR", name: "Side moulding", size: [30, cr, D - 10], pos: [sx * (W / 2 + 5), Hc + cr / 2, -15], material: "board" })),
+ door("D1", -1),
+ door("D2", 1),
+ { id: "DF", name: "Drawer front", size: [iw - 6, dfH, 20], pos: [0, dfY, D / 2 - 10], material: "board" },
+ ...[-1, 1].map((sx): CustomPart => ({ id: sx < 0 ? "DL" : "DR", name: "Drawer side", size: [15, 180, dbD], pos: [sx * dsX, dsY, D / 2 - 20 - dbD / 2], material: "board" })),
+ { id: "DB", name: "Drawer bottom", size: [2 * dsX - 15, 4, dbD - 15], pos: [0, dsY - 80, D / 2 - 20 - dbD / 2], material: "fiber" },
+ { id: "DK", name: "Drawer back", size: [2 * dsX - 15, 160, 15], pos: [0, dsY + 10, dzB + 7.5], material: "board" },
+ ];
+ const SX = [-1, 1] as const;
+ const sid = (sx: number) => (sx < 0 ? "SL" : "SR");
+ const fit = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+ const CAMBOLT = { len: 34, dia: 7 }, CAM = { len: 13, dia: 15 }, DOWEL = { len: 30, dia: 8 };
+ // the side frames' joints: the four rails (cam bolt above, dowel below) and the shelves
+ const railJoints = (sx: number) => [[Hc - 40, zF], [Hc - 40, zB], [120, zF], [120, zB]].map(([y, z]) => [sx * xi, y, z] as Vec3);
+ const shelfZ = [-(D / 2 - 110), D / 2 - 110];
+ const sideBolts = (sx: number, shelves: number[]) => fit("camScrew", [...railJoints(sx).map((p) => [p[0], p[1] + 20, p[2]] as Vec3), ...shelves.flatMap((y) => shelfZ.map((z) => [sx * xi, y + 9, z] as Vec3))], [sx, 0, 0], { on: sid(sx), ...CAMBOLT });
+ const sideDowels = (sx: number) => fit("dowel", [...railJoints(sx).map((p) => [p[0], p[1] - 20, p[2]] as Vec3), [sx * xi, yBot - 9, 0]], [sx, 0, 0], { on: sid(sx), ...DOWEL });
+ const railCams = (sx: number, ids: string[]) =>
+ ids.map((id) => {
+ const z = id.startsWith("F") ? zF : zB, y = id.endsWith("T") ? Hc - 40 : 120;
+ return fit("cam", [[sx * (xi - 30), y + 20, z - Math.sign(z) * 12.5]], [0, 0, Math.sign(z)], { on: id, ...CAM });
+ });
+ const shelfCams = (sx: number, ids: string[]) => ids.map((id) => fit("cam", shelfZ.map((z) => [sx * (xi - 30), (id === "S1" ? yS1 : yS2) + 18, z] as Vec3), [0, -1, 0], { on: id, ...CAM }));
+ const hy = [dY0 + 100, dY0 + 400, dY1 - 400, dY1 - 100];
+ const topBolts = [-xi + 100, 0, xi - 100].flatMap((x) => [zF, zB].map((z) => [x, Hc, z] as Vec3));
+ const knobs: Vec3[] = [[-30, (dY0 + dY1) / 2, 0], [30, (dY0 + dY1) / 2, 0], [0, dfY, 0]];
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the cam bolts into the left side frame",
+ detail: "Lay both side frames on a rug, inside up. Eight bolts in the left one, by hand until they stop.",
+ add: ["SL"],
+ wait: ["SR"],
+ fix: [sideBolts(-1, [yS1, yS2])],
+ pose: "+x",
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ { title: "Screw the cam bolts into the right side frame", detail: "Six in the right one: the rails and the lower shelf.", fix: [sideBolts(1, [yS2])], tools: ["screwdriver"] },
+ { title: "Tap the dowels into both frames", detail: "Ten in all, five in each frame: below each rail's cam bolt and one for the bottom.", fix: [sideDowels(-1), sideDowels(1)], tools: ["hammer"] },
+ {
+ title: "Screw on the runner brackets",
+ detail: "Four, two inside each frame at the drawer's height, front and back.",
+ fix: SX.map((sx) => fit("clip", [D / 2 - 80, -D / 2 + 80].map((z) => [sx * xi, yBot + 60, z] as Vec3), [sx, 0, 0], { on: sid(sx), name: "Runner bracket", len: 30, dia: 30 })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the runner wheels on",
+ detail: "The one marked L on the left frame, R on the right, at the front. Two screws each.",
+ fix: [
+ ...SX.map((sx) => fit("roller", [[sx * xi, yBot + 30, D / 2 - 60]], [sx, 0, 0], { on: sid(sx), name: "Runner wheel", len: 20, dia: 30 })),
+ ...SX.map((sx) => fit("screw", [-15, 15].map((dz) => [sx * xi, yBot + 50, D / 2 - 60 + dz] as Vec3), [sx, 0, 0], { on: sid(sx), len: 12, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw in the feet", detail: "One into the bottom of each front post, by hand.", fix: SX.map((sx) => fit("foot", [[sx * xP, 0, zP]], [0, 1, 0], { on: sid(sx), len: 25, dia: 30 })) },
+ { title: "Stand the four rails in the left frame", detail: "Onto the dowels and the cam bolts, two at the top and two at the bottom.", add: ["FT", "BT", "FB", "BB"], from: { FT: [300, 0, 0], BT: [300, 0, 0], FB: [300, 0, 0], BB: [300, 0, 0] } },
+ { title: "Lock three of them", detail: "Turn the cam locks clockwise until they're tight.", fix: railCams(-1, ["FT", "BT", "FB"]), tools: ["screwdriver"] },
+ { title: "Stand the two shelves in and lock them", detail: "The upper one near the top, the lower one above the drawer. Two cam locks each.", add: ["S1", "S2"], fix: shelfCams(-1, ["S1", "S2"]), from: { S1: [300, 0, 0], S2: [300, 0, 0] }, tools: ["screwdriver"] },
+ { title: "Slide the bottom in", detail: "Into the groove along the bottom rails, onto its dowel.", add: ["BP"], from: { BP: [300, 0, 0] } },
+ { title: "Lower the right frame on top", detail: "Onto all the dowels and cam bolts at once. One of you guides each end.", add: ["SR"], from: { SR: [350, 0, 0] }, people: 2, warnings: ["two"] },
+ { title: "Lock the rails on this side", detail: "Three cam locks, clockwise.", fix: railCams(1, ["FT", "BT", "FB"]), tools: ["screwdriver"] },
+ { title: "Lock the last rail and the shelf", detail: "Four more cam locks: the back bottom rail at both ends and the lower shelf.", fix: [...railCams(-1, ["BB"]), ...railCams(1, ["BB"]), ...shelfCams(1, ["S2"])], tools: ["screwdriver"] },
+ {
+ title: "Screw the holders onto the clothes rail",
+ detail: "One into each end of the rail.",
+ fix: SX.map((sx) => fit("hook", [[sx * xi, yRod, 0]], [-sx, 0, 0], { on: "R", name: "Rail holder", len: 30, dia: 25 })),
+ wait: ["R"],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Fit the clothes rail",
+ detail: "Under the upper shelf. A bolt with a washer through each side frame into its holder.",
+ add: ["R"],
+ from: { R: [0, -300, 0] },
+ fix: [...SX.map((sx) => fit("washer", [[sx * (W / 2 - 11), yRod, 0]], [-sx, 0, 0], { len: 1.5, dia: 16 })), ...SX.map((sx) => fit("bolt", [[sx * (W / 2 - 11), yRod, 0]], [-sx, 0, 0], { on: sid(sx), len: 40, dia: 6 }))],
+ tools: ["allen"],
+ },
+ { title: "Slide the back panel in", detail: "From the top end, along the grooves, finished side facing in.", add: ["K"], from: { K: [0, 600, 0] } },
+ { title: "Stand the wardrobe up", detail: "Lift it onto its feet together.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Screw the cam bolts into the side mouldings",
+ detail: "Lay the three crown mouldings on the rug. One bolt into the front end of each side moulding.",
+ fix: SX.map((sx) => fit("camScrew", [[sx * (W / 2 + 5), Hc + 30, D / 2 - 20]], [0, 0, -1], { on: sx < 0 ? "ML" : "MR", ...CAMBOLT })),
+ wait: ["MF", "ML", "MR", "T"],
+ // the crown is put together beside the wardrobe, all its pieces moved aside together
+ from: { MF: [W + 300, 0, 0], ML: [W + 300, 0, 0], MR: [W + 300, 0, 0], T: [W + 300, 0, 0] },
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Tap the dowels into the mouldings",
+ detail: "Six: two at each corner joint and two along the front.",
+ fix: [...SX.map((sx) => fit("dowel", [Hc + 12, Hc + 48].map((y) => [sx * (W / 2 + 5), y, D / 2 - 20] as Vec3), [0, 0, -1], { on: sx < 0 ? "ML" : "MR", ...DOWEL })), fit("dowel", [-W / 4, W / 4].map((x) => [x, Hc + 30, D / 2 - 10] as Vec3), [0, 0, 1], { on: "MF", ...DOWEL })],
+ tools: ["hammer"],
+ },
+ { title: "Join the mouldings into a crown", detail: "Push the front moulding onto both side pieces and turn its two cam locks.", fix: [fit("cam", SX.map((sx) => [sx * (W / 2 - 25), Hc + 30, D / 2 - 10] as Vec3), [0, 0, 1], { on: "MF", ...CAM })], tools: ["screwdriver"] },
+ {
+ title: "Screw the top panel into the crown",
+ detail: "Turn the crown over and lay the top panel inside it. Four long screws through the panel's edges.",
+ fix: [fit("screw", [[-W / 4, Hc + 18, D / 2 - 5], [W / 4, Hc + 18, D / 2 - 5], [-(W / 2 - 5), Hc + 18, 0], [W / 2 - 5, Hc + 18, 0]], [0, -1, 0], { on: "T", len: 40, dia: 5 })],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw on the wall brackets",
+ detail: "Two, on top of the panel at the back, each with a screw and a washer. Leave them loose in their slots.",
+ fix: [fit("angle", SX.map((sx) => [sx * (xi - 80), Hc + 18, -D / 2 + 20] as Vec3), [0, -1, 0], { on: "T", name: "Wall bracket", len: 50, dia: 30 }), fit("washer", SX.map((sx) => [sx * (xi - 80), Hc + 22, -D / 2 + 50] as Vec3), [0, -1, 0], { on: "T", len: 1.5, dia: 12 }), fit("screw", SX.map((sx) => [sx * (xi - 80), Hc + 22, -D / 2 + 50] as Vec3), [0, -1, 0], { on: "T", len: 16, dia: 4 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw the cam bolts under the top", detail: "Six, three along the front edge and three along the back.", fix: [fit("camScrew", topBolts, [0, 1, 0], { on: "T", ...CAMBOLT })], tools: ["screwdriver"] },
+ { title: "Lower the top onto the wardrobe", detail: "Its cam bolts go into the top rails. Two of you, one at each end.", add: ["T", "MF", "ML", "MR"], from: { T: [0, 400, 0], MF: [0, 400, 0], ML: [0, 400, 0], MR: [0, 400, 0] }, people: 2, warnings: ["two"] },
+ {
+ title: "Lock the top on",
+ detail: "Six cam locks inside the top rails.",
+ fix: [fit("cam", [-xi + 100, 0, xi - 100].map((x) => [x + 30, Hc - 20, zF - 12.5] as Vec3), [0, 0, 1], { on: "FT", ...CAM }), fit("cam", [-xi + 100, 0, xi - 100].map((x) => [x + 30, Hc - 20, zB + 12.5] as Vec3), [0, 0, -1], { on: "BT", ...CAM })],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw the top down at the back", detail: "Two long screws through the top into the back posts.", fix: [fit("screw", SX.map((sx) => [sx * xP, Hc + 18, -zP] as Vec3), [0, -1, 0], { on: "T", len: 60, dia: 5 })], tools: ["allen"] },
+ { title: "Screw on the drawer stops", detail: "Two small screws into the top of the front bottom rail.", fix: [fit("screw", SX.map((sx) => [sx * (xi - 60), yBot, zF] as Vec3), [0, -1, 0], { on: "FB", name: "Drawer stop", len: 16, dia: 4 })], tools: ["screwdriver"] },
+ { title: "Push in the plastic pins", detail: "Two under the upper shelf and two under the lower one, at the front, so the shelves can't tip.", fix: SX.map((sx) => fit("pin", [yS1, yS2].map((y) => [sx * xi, y - 4, D / 2 - 80] as Vec3), [sx, 0, 0], { on: sid(sx) })) },
+ {
+ title: "Click the hinge plates into the front posts",
+ detail: "Sixteen, eight up each post, in pairs where the hinges go. Press until they click.",
+ fix: SX.map((sx) => fit("plate", hy.flatMap((y) => [y - 16, y + 16].map((yy) => [sx * xi, yy, D / 2 - 25] as Vec3)), [sx, 0, 0], { on: sid(sx), name: "Hinge plate", len: 10, dia: 20 })),
+ },
+ { title: "Level it with the feet", detail: "Turn the two front feet until it stands level and doesn't rock.", tools: ["level"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Mark through the brackets, drill, plug and screw them to the wall. Wall screws and plugs aren't included: pick ones made for your wall.",
+ fix: [fit("plug", SX.map((sx) => [sx * (xi - 80), Hc + 40, -D / 2 - 4] as Vec3), [0, 0, -1]), fit("screw", SX.map((sx) => [sx * (xi - 80), Hc + 40, -D / 2 + 2] as Vec3), [0, 0, -1], { len: 50, dia: 5 })],
+ wall: true,
+ tools: ["drill", "screwdriver", "pencil"],
+ warnings: ["wall", "tip"],
+ },
+ { title: "Screw the hinges onto the left door", detail: "Lay it face down. Four hinges along its outer edge.", fix: [fit("hinge", hy.map((y) => [-(xi - 20), y, D / 2 - 20] as Vec3), [0, 0, 1], { on: "D1" })], tools: ["screwdriver"], wait: ["D1", "D2"] },
+ { title: "Screw the hinges onto the right door", detail: "The same way, along its outer edge.", fix: [fit("hinge", hy.map((y) => [xi - 20, y, D / 2 - 20] as Vec3), [0, 0, 1], { on: "D2", twist: Math.PI })], tools: ["screwdriver"] },
+ { title: "Clip the doors on", detail: "Hook each hinge onto its plate and press until it clicks. Turn the hinge screws to even out the gaps.", add: ["D1", "D2"], from: { D1: [0, 0, 300], D2: [0, 0, 300] }, kind: "hinges", tools: ["screwdriver"] },
+ { title: "Screw the cam bolts into the drawer front", detail: "Lay it face down. Four bolts, two near each end.", fix: [fit("camScrew", SX.flatMap((sx) => [dsY - 40, dsY + 40].map((y) => [sx * dsX, y, D / 2 - 20] as Vec3)), [0, 0, 1], { on: "DF", ...CAMBOLT })], wait: ["DF"], from: { DF: [0, 0, 400] }, tools: ["screwdriver"] },
+ {
+ title: "Push the drawer sides onto the front",
+ detail: "Grooves facing in, then turn the four cam locks in the sides.",
+ add: ["DF", "DL", "DR"],
+ from: { DF: [0, 0, 400], DL: [0, 0, 400], DR: [0, 0, 400] },
+ fix: SX.map((sx) => fit("cam", [dsY - 40, dsY + 40].map((y) => [sx * (dsX - 7.5), y, D / 2 - 50] as Vec3), [sx, 0, 0], { on: sx < 0 ? "DL" : "DR", ...CAM })),
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the bottom in", detail: "Along the grooves until it reaches the front.", add: ["DB"], from: { DB: [0, 0, -300] } },
+ {
+ title: "Screw the back on",
+ detail: "Between the sides, over the bottom. Two screws through each side.",
+ add: ["DK"],
+ from: { DK: [0, 0, -300] },
+ fix: SX.map((sx) => fit("screw", [dsY - 30, dsY + 50].map((y) => [sx * (dsX + 7.5), y, dzB + 7.5] as Vec3), [-sx, 0, 0], { on: sx < 0 ? "DL" : "DR", len: 30, dia: 4 })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the runners onto the drawer sides",
+ detail: "One on each side, three screws each.",
+ fix: SX.map((sx) => fit("screw", [-0.3, 0, 0.3].map((f) => [sx * (dsX + 7.5), dsY - 70, D / 2 - 20 - dbD / 2 + f * dbD] as Vec3), [-sx, 0, 0], { on: sx < 0 ? "DL" : "DR", len: 12, dia: 4 })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw on the knobs",
+ detail: "One on each door near the middle and one on the drawer, each screw from behind.",
+ fix: [fit("knob", knobs.map((p) => [p[0], p[1], D / 2 + 4] as Vec3), [0, 0, -1], { dia: 30 }), fit("screw", knobs.map((p) => [p[0], p[1], D / 2 - 24] as Vec3), [0, 0, 1], { len: 30, dia: 4 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Slide the drawer in", detail: "Onto the runner wheels, all the way in. Check the doors close evenly.", kind: "drawer" },
+ ];
+ return { parts, steps };
+}
+
+/* ---------- changing table / chest of drawers ---------- */
+
+/**
+ * The changing table, from its manual. Both side frames lie on a rug for their glides, bolts, dowels and runners.
+ * On its left side, the two bottom rails stand in, the shelf hooks onto its bolts, the two back boards and the bottom
+ * go in and the right frame goes on top; screws join the back to the shelf. The changing top is put together
+ * upside down beside it: the leaf with its short rails on long bolts, the back rail and two side rails on cam bolts,
+ * the base board screwed under them, the folding hinges, cam bolts and wall brackets. It goes on the chest, is fixed
+ * to the wall and locked open, then the two drawers are built on their fronts and slide in on metal runners.
+ * IKEA's sizes are 78 wide, 79 deep (54 with the leaf folded in) and 99 high.
+ */
+function changing(): CustomParams {
+ const Wc = 760, P = 45, Dc = 520, Hc = 870; // the chest
+ const xP = Wc / 2 - P / 2, xi = Wc / 2 - P, iw = 2 * xi, zP = Dc / 2 - P / 2;
+ const RT = 30, rx = xi + RT / 2; // the frames' rails, flush with the inside of the posts
+ const yB = 250, yS = 660, T = 18; // top of the bottom, underside of the shelf
+ const side = (id: string, g: number): CustomPart => ({
+ id,
+ name: "Side frame",
+ size: [P, Hc, Dc],
+ pos: [g * xP, Hc / 2, 0],
+ material: "wood",
+ pieces: [
+ box([P, Hc, P], [0, 0, zP]),
+ box([P, Hc, P], [0, 0, -zP]),
+ box([RT, 70, Dc - 2 * P], [g * (rx - xP), Hc / 2 - 35, 0]),
+ box([RT, 80, Dc - 2 * P], [g * (rx - xP), 210 - Hc / 2, 0]),
+ { shape: "box", size: [12, Hc - 70 - yB, Dc - 2 * P], pos: [0, (yB + Hc - 70) / 2 - Hc / 2, 0], material: "board" },
+ ],
+ });
+ const yR = 202; // the bottom rails' centre
+ const kH = (Hc - 10 - yB) / 2, kT = 15, zK = -zP; // two back boards, one above the other, in the posts' grooves
+ const zSB = zK + kT / 2; // the shelf stops at the back boards
+ // the changing top: base board over the chest, the leaf in front of it, rails round three sides
+ const TW = 780, RW = 18, RH = 100, zSplit = 270, zFront = 520, zBack = -270;
+ const yT = Hc + T, xr = TW / 2 - RW / 2, xl = TW / 2 - RW;
+ const parts: CustomPart[] = [
+ side("SL", -1),
+ side("SR", 1),
+ { id: "RF", name: "Bottom rail", size: [iw, 60, 22], pos: [0, yR, zP], material: "wood" },
+ { id: "RB", name: "Bottom rail", size: [iw, 60, 22], pos: [0, yR, -zP], material: "wood" },
+ { id: "SH", name: "Shelf", size: [iw, T, Dc / 2 - 5 - zSB], pos: [0, yS + T / 2, (Dc / 2 - 5 + zSB) / 2], material: "board" },
+ { id: "K1", name: "Back board", size: [iw, kH, kT], pos: [0, yB + kH / 2, zK], material: "wood" },
+ { id: "K2", name: "Back board", size: [iw, kH, kT], pos: [0, yB + kH * 1.5, zK], material: "wood" },
+ { id: "BT", name: "Bottom", size: [iw, T, Dc - 10], pos: [0, yB - T / 2, 0], material: "board" },
+ { id: "LB", name: "Leaf", size: [2 * xl, T, zFront - zSplit], pos: [0, Hc + T / 2, (zSplit + zFront) / 2], material: "board" },
+ ...[-1, 1].map((g): CustomPart => ({ id: g < 0 ? "LL" : "LR", name: "Leaf side rail", size: [RW, RH + T, zFront - zSplit], pos: [g * xr, Hc + (RH + T) / 2, (zSplit + zFront) / 2], material: "wood" })),
+ { id: "TB", name: "Back rail", size: [TW, RH, RW], pos: [0, yT + RH / 2, zBack + RW / 2], material: "wood" },
+ ...[-1, 1].map((g): CustomPart => ({ id: g < 0 ? "TL" : "TR", name: "Side rail", size: [RW, RH, zSplit - zBack - RW], pos: [g * xr, yT + RH / 2, (zSplit + zBack + RW) / 2], material: "wood" })),
+ { id: "BB", name: "Base board", size: [TW, T, zSplit - zBack], pos: [0, Hc + T / 2, (zSplit + zBack) / 2], material: "board" },
+ ];
+ // the drawers: two openings between the bottom and the shelf, fronts flush with the front posts
+ const dh = (yS - yB) / 2, sT = 15, xs = xi - 13 - sT / 2, sH = 150, dD = 450, zF = Dc / 2 - 20, zDB = zF - dD;
+ const dz = (zF + zDB) / 2;
+ const drawers = [0, 1].map((i) => {
+ const y0 = yB + i * dh, ys = y0 + 20 + sH / 2;
+ const k = (n: string) => `${n}${i}`;
+ parts.push(
+ { id: k("DF"), name: "Drawer front", size: [iw - 4, dh - 4, 20], pos: [0, y0 + dh / 2, Dc / 2 - 10], material: "wood" },
+ ...[-1, 1].map((g): CustomPart => ({ id: k(g < 0 ? "DL" : "DR"), name: "Drawer side", size: [sT, sH, dD], pos: [g * xs, ys, dz], material: "board" })),
+ { id: k("DB"), name: "Drawer bottom", size: [2 * xs - sT, 4, dD - 10], pos: [0, y0 + 30, dz], material: "fiber" },
+ { id: k("DK"), name: "Drawer back", size: [2 * xs - sT, sH - 20, sT], pos: [0, ys + 10, zDB + sT / 2], material: "board" },
+ );
+ return { y0, ys, run: y0 + 40, front: k("DF"), sides: [k("DL"), k("DR")] as [string, string], bottom: k("DB"), back: k("DK") };
+ });
+ const G = [-1, 1] as const;
+ const sid = (g: number) => (g < 0 ? "SL" : "SR");
+ const fit = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+ const CB = { len: 34, dia: 7 }, LCB = { len: 44, dia: 7, name: "Long cam bolt" }, CAM = { len: 13, dia: 15 }, DOW = { len: 30, dia: 8 };
+ const inner = (g: number, y: number, z: number): Vec3 => [g * xi, y, z];
+ // the frames' joints: a cam bolt and a dowel at each rail end, each back board and the bottom
+ const boltsShort = (g: number) => fit("camScrew", [inner(g, yR + 15, zP), inner(g, yR + 15, -zP)], [g, 0, 0], { on: sid(g), ...CB });
+ const boltsLong = (g: number) => fit("camScrew", [inner(g, yB + kH - 60, zK), inner(g, Hc - 70, zK), inner(g, yB - T / 2, -150), inner(g, yB - T / 2, 150)], [g, 0, 0], { on: sid(g), ...LCB });
+ const frameDowels = (g: number) =>
+ fit("dowel", [inner(g, yR - 15, zP), inner(g, yR - 15, -zP), inner(g, yB + 60, zK), inner(g, yB + 180, zK), inner(g, yB + kH + 90, zK), ...[-220, 0, 220].map((z) => inner(g, yB - T / 2, z))], [g, 0, 0], { on: sid(g), ...DOW });
+ const hookAt = (g: number) => [-180, 180].map((z) => inner(g, yS + T / 2, z));
+ const railCams = (g: number) => [fit("cam", [[g * (xi - 30), yR + 15, zP - 11]], [0, 0, 1], { on: "RF", ...CAM }), fit("cam", [[g * (xi - 30), yR + 15, -zP + 11]], [0, 0, -1], { on: "RB", ...CAM })];
+ const backCams = (g: number) => [fit("cam", [[g * (xi - 30), yB + kH - 60, zK + kT / 2]], [0, 0, -1], { on: "K1", ...CAM }), fit("cam", [[g * (xi - 30), Hc - 70, zK + kT / 2]], [0, 0, -1], { on: "K2", ...CAM })];
+ const bottomCams = (g: number) => fit("cam", [-150, 150].map((z): Vec3 => [g * (xi - 30), yB, z]), [0, -1, 0], { on: "BT", ...CAM });
+ const runY = drawers.map((d) => d.run);
+ // the changing top's fittings
+ const leafZ = [zSplit + 50, zFront - 50], leafDowelZ = [zSplit + 110, zFront - 100];
+ const topBoltZ = [-170, 0, 170];
+ const tl = (g: number) => (g < 0 ? "TL" : "TR"), ll = (g: number) => (g < 0 ? "LL" : "LR");
+ const wallAt = (y: number, z: number) => G.map((g): Vec3 => [g * 250, y, z]);
+ const D = drawers;
+ const dAll = <T,>(f: (d: (typeof D)[number]) => T[]) => D.flatMap(f);
+ const wait = (ids: string[]) => Object.fromEntries(ids.map((k) => [k, [0, 0, 650] as Vec3]));
+ const aside = (ids: string[]) => Object.fromEntries(ids.map((k) => [k, [TW + 250, 0, 0] as Vec3]));
+ const steps: CustomStep[] = [
+ {
+ title: "Tap the glides into the legs",
+ detail: "Lay both side frames on a rug, inside up. One glide into the foot of each leg.",
+ add: ["SL"],
+ wait: ["SR"],
+ from: { SR: [-450, 0, 700] },
+ fix: G.map((g) => fit("glide", [[g * xP, 0, zP], [g * xP, 0, -zP]], [0, 1, 0], { on: sid(g), len: 8, dia: 22 })),
+ pose: "+x",
+ tools: ["hammer"],
+ warnings: ["floor"],
+ },
+ { title: "Screw in the short cam bolts", detail: "Two in each frame, at the bottom rail holes. By hand until they stop.", fix: G.map(boltsShort), tools: ["screwdriver"] },
+ { title: "Screw in the hook bolts for the shelf", detail: "Two in each frame, leaving the heads out so the shelf's hooks can slip over them.", fix: G.map((g) => fit("stud", hookAt(g), [g, 0, 0], { on: sid(g), name: "Hook bolt", len: 20, dia: 10 })), tools: ["screwdriver"] },
+ { title: "Screw in the long cam bolts", detail: "Four in each frame: two for the back boards and two for the bottom.", fix: G.map(boltsLong), tools: ["screwdriver"] },
+ { title: "Tap in the dowels", detail: "Eight in each frame. Tap gently so they don't split the wood.", fix: G.map(frameDowels), tools: ["hammer"] },
+ {
+ title: "Screw the runners into the frames",
+ detail: "Two in each frame, the one marked R on the right frame and L on the left, wheel at the front. Two screws each.",
+ fix: [
+ ...G.map((g) => fit("runner", runY.map((y) => inner(g, y, dz)), [g, 0, 0], { on: sid(g), name: "Cabinet runner", len: 460, dia: 30 })),
+ ...G.map((g) => fit("screw", runY.flatMap((y) => [-1, 1].map((sz) => inner(g, y, sz * (zP - 12)))), [g, 0, 0], { on: sid(g), len: 12, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Stand the two bottom rails in the left frame", detail: "Onto their dowels and cam bolts, one at the front and one at the back.", add: ["RF", "RB"], from: { RF: [400, 0, 0], RB: [400, 0, 0] } },
+ { title: "Lock the rails", detail: "Turn the two cam locks clockwise until they pull tight.", fix: railCams(-1), tools: ["screwdriver"] },
+ { title: "Hook the shelf on", detail: "Slide it in from the top end of the frame until its two hooks drop over the hook bolts.", add: ["SH"], from: { SH: [0, 500, 0] } },
+ { title: "Tighten the hook bolts", detail: "Turn the two bolts through the hooks so the shelf is pulled tight against the frame.", tools: ["screwdriver"] },
+ {
+ title: "Join the two back boards",
+ detail: "Two dowels in the edge of one board, then press the other one onto them.",
+ fix: [fit("dowel", [-200, 200].map((x): Vec3 => [x, yB + kH, zK]), [0, -1, 0], { on: "K1", mate: "K2", ...DOW })],
+ wait: ["K1", "K2"],
+ from: { K1: [0, 0, -500], K2: [0, 0, -500] },
+ tools: ["hammer"],
+ },
+ { title: "Push the back into the left frame", detail: "Along the grooves in the back post, onto the dowels and bolts.", add: ["K1", "K2"], from: { K1: [400, 0, 0], K2: [400, 0, 0] } },
+ { title: "Lock the back", detail: "Two cam locks, one in each board.", fix: backCams(-1), tools: ["screwdriver"] },
+ {
+ title: "Put the bottom in",
+ detail: "Two dowels in its free end first, then push it onto the frame over the bottom rails.",
+ fix: [fit("dowel", [-100, 100].map((z): Vec3 => [xi, yB - T / 2, z]), [-1, 0, 0], { on: "BT", ...DOW })],
+ add: ["BT"],
+ from: { BT: [400, 0, 0] },
+ tools: ["hammer"],
+ },
+ { title: "Lock the bottom", detail: "Two cam locks, clockwise.", fix: [bottomCams(-1)], tools: ["screwdriver"] },
+ { title: "Lower the right frame on top", detail: "Onto all the dowels and bolts at once, the shelf's hooks over its hook bolts.", add: ["SR"], from: { SR: [400, 0, 0] }, people: 2, warnings: ["two"] },
+ { title: "Tighten the hook bolts on this side", detail: "The two bolts through the shelf's hooks, as before.", tools: ["screwdriver"] },
+ { title: "Lock the right frame", detail: "Six cam locks: the rails, the back boards and the bottom.", fix: [...railCams(1), ...backCams(1), bottomCams(1)], tools: ["screwdriver"] },
+ {
+ title: "Screw the back to the shelf",
+ detail: "Four screws through the back board into the shelf's back edge.",
+ fix: [fit("screw", [-240, -80, 80, 240].map((x): Vec3 => [x, yS + T / 2, zK - kT / 2]), [0, 0, 1], { on: "K2", mate: "SH", len: 40, dia: 4 })],
+ tools: ["screwdriver"],
+ },
+ { title: "Stand the chest up", detail: "Lift it onto its legs together.", pose: "+y", people: 2, warnings: ["two"] },
+ {
+ title: "Push the leaf's side rails on",
+ detail: "Lay the leaf on the rug and tap two dowels into each end, then press the short side rails on, angled ends at the back.",
+ fix: G.map((g) => fit("dowel", leafDowelZ.map((z): Vec3 => [g * xl, Hc + T / 2, z]), [-g, 0, 0], { on: "LB", mate: ll(g), ...DOW })),
+ wait: ["LB", "LL", "LR"],
+ from: aside(["LB", "LL", "LR"]),
+ tools: ["hammer"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Bolt the side rails to the leaf",
+ detail: "Barrel nuts into the leaf from below, slot toward the bolt, then a long bolt through each rail into it. Two each side.",
+ fix: [
+ ...G.map((g) => fit("nut", leafZ.map((z): Vec3 => [g * (xl - 40), Hc, z]), [0, 1, 0], { on: "LB", name: "Barrel nut", len: 14, dia: 10 })),
+ ...G.map((g) => fit("bolt", leafZ.map((z): Vec3 => [g * TW / 2, Hc + T / 2, z]), [-g, 0, 0], { on: ll(g), mate: "LB", len: 80, dia: 6 })),
+ ],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the cam bolts into the back rail",
+ detail: "One near each end, on the side with the warning label. By hand until they stop.",
+ fix: [fit("camScrew", G.map((g): Vec3 => [g * xr, yT + RH / 2 + 15, zBack + RW]), [0, 0, -1], { on: "TB", ...LCB })],
+ wait: ["TB", "TL", "TR"],
+ from: aside(["TB", "TL", "TR"]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Push the side rails onto the back rail",
+ detail: "Two dowels in each end of the back rail first, then press the side rails on, angled ends at the front.",
+ fix: G.map((g) => fit("dowel", [yT + 25, yT + RH - 20].map((y): Vec3 => [g * xr, y, zBack + RW]), [0, 0, -1], { on: "TB", mate: tl(g), ...DOW })),
+ tools: ["hammer"],
+ },
+ { title: "Lock the corners", detail: "One cam lock inside each side rail, clockwise.", fix: G.map((g) => fit("cam", [[g * xl, yT + RH / 2 + 15, zBack + RW + 30]], [g, 0, 0], { on: tl(g), ...CAM })), tools: ["screwdriver"] },
+ {
+ title: "Tap the long dowels into the rails",
+ detail: "Turn the rails over so their bottom edges face up. Three long dowels in the back rail and two in each side rail.",
+ fix: [
+ fit("dowel", [-250, 0, 250].map((x): Vec3 => [x, yT, zBack + RW / 2]), [0, 1, 0], { on: "TB", mate: "BB", len: 50, dia: 10 }),
+ ...G.map((g) => fit("dowel", [-120, 160].map((z): Vec3 => [g * xr, yT, z]), [0, 1, 0], { on: tl(g), mate: "BB", len: 50, dia: 10 })),
+ ],
+ tools: ["hammer"],
+ },
+ {
+ title: "Screw the base board onto the rails",
+ detail: "Lay it on the dowels and drive six long screws through it into the rails with the Allen key, then turn the top over.",
+ fix: [
+ fit("screw", [-200, 200].map((x): Vec3 => [x, Hc, zBack + RW / 2]), [0, 1, 0], { on: "BB", mate: "TB", len: 70, dia: 5 }),
+ ...G.map((g) => fit("screw", [-160, 200].map((z): Vec3 => [g * xr, Hc, z]), [0, 1, 0], { on: "BB", mate: tl(g), len: 70, dia: 5 })),
+ ],
+ wait: ["BB"],
+ from: aside(["BB"]),
+ tools: ["allen"],
+ },
+ { title: "Fit the folding hinges", detail: "Line the leaf up in front of the base board and set a hinge over each joint between the rails.", fix: G.map((g) => fit("hinge", [[g * xr, yT + RH, zSplit]], [0, -1, 0], { on: tl(g), mate: ll(g), name: "Folding hinge", len: 90, dia: 30 })) },
+ {
+ title: "Screw the hinges on",
+ detail: "A sleeve nut from the inside and a screw from the outside, two per hinge. Check the leaf folds in and out freely.",
+ fix: [
+ ...G.map((g) => fit("nut", [[g * xl, yT + 50, zSplit - 40], [g * xl, yT + 50, zSplit + 40]], [g, 0, 0], { on: tl(g), name: "Sleeve nut", len: 15, dia: 8 })),
+ ...G.map((g) => fit("screw", [[g * TW / 2, yT + 50, zSplit - 40], [g * TW / 2, yT + 50, zSplit + 40]], [-g, 0, 0], { on: tl(g), len: 16, dia: 6 })),
+ ],
+ tools: ["allen"],
+ },
+ { title: "Screw the cam bolts under the base board", detail: "Turn the top upside down again. Three along each side, by hand.", fix: [fit("camScrew", G.flatMap((g) => topBoltZ.map((z): Vec3 => [g * rx, Hc, z])), [0, 1, 0], { on: "BB", ...CB })], tools: ["screwdriver"] },
+ {
+ title: "Screw on the wall brackets",
+ detail: "Two, under the base board at the back, each with a screw and a washer. Leave them loose in their slots.",
+ fix: [fit("angle", wallAt(Hc, zBack + 15), [0, 1, 0], { on: "BB", name: "Wall bracket", len: 60, dia: 30, included: true }), fit("washer", wallAt(Hc - 2, zBack + 40), [0, 1, 0], { on: "BB", len: 1.5, dia: 12 }), fit("screw", wallAt(Hc - 2, zBack + 40), [0, 1, 0], { on: "BB", len: 16, dia: 4 })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lower the top onto the chest",
+ detail: "The right way up, its cam bolts into the holes in the side frames. One of you at each end.",
+ add: ["BB", "TB", "TL", "TR", "LB", "LL", "LR"],
+ from: Object.fromEntries(["BB", "TB", "TL", "TR", "LB", "LL", "LR"].map((k) => [k, [0, 400, 0] as Vec3])),
+ people: 2,
+ warnings: ["two"],
+ },
+ { title: "Lock the top on", detail: "Six cam locks inside the top rails of the side frames.", fix: G.map((g) => fit("cam", topBoltZ.map((z): Vec3 => [g * xi, Hc - 25, z]), [g, 0, 0], { on: sid(g), ...CAM })), tools: ["screwdriver"] },
+ {
+ title: "Fix it to the wall",
+ detail: "Push the chest against the wall, mark through the brackets, drill, then plug and screw them on with the washers. Pick plugs made for your wall if the ones in the box don't suit it.",
+ fix: [fit("plug", wallAt(yT + 40, zBack - 6), [0, 0, -1], { len: 35, dia: 8, included: true }), fit("washer", wallAt(yT + 40, zBack + 2), [0, 0, -1], { len: 1.5, dia: 16 }), fit("screw", wallAt(yT + 40, zBack + 2), [0, 0, -1], { len: 50, dia: 5, included: true })],
+ wall: true,
+ tools: ["drill", "screwdriver", "pencil"],
+ warnings: ["wall", "tip"],
+ },
+ {
+ title: "Lock the leaf open",
+ detail: "Screw a locking plate over each hinge from the inside. To use it as a chest later, fold the leaf in and lock it the same way.",
+ fix: [...G.map((g) => fit("plate", [[g * xl, yT + 60, zSplit]], [g, 0, 0], { on: tl(g), name: "Locking plate", len: 60, dia: 20 })), ...G.map((g) => fit("screw", [[g * xl, yT + 60, zSplit - 20]], [g, 0, 0], { on: tl(g), len: 10, dia: 6 }))],
+ tools: ["allen"],
+ },
+ {
+ title: "Screw the cam bolts into the drawer fronts",
+ detail: "Lay both fronts face down on the rug. Four bolts in each, by hand.",
+ fix: dAll((d) => G.map((g, j) => fit("camScrew", [d.ys - 40, d.ys + 40].map((y): Vec3 => [g * xs, y, zF]), [0, 0, 1], { on: d.front, mate: d.sides[j], len: 30, dia: 7, name: "Drawer cam bolt" }))),
+ wait: D.map((d) => d.front),
+ from: wait(D.map((d) => d.front)),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Stand the sides on the fronts",
+ detail: "Two dowels in the front end of each side, then press the sides onto the dowels and bolts, grooves facing in.",
+ fix: dAll((d) => G.map((g, j) => fit("dowel", [d.ys - 60, d.ys + 60].map((y): Vec3 => [g * xs, y, zF]), [0, 0, -1], { on: d.sides[j], mate: d.front, len: 25, dia: 8 }))),
+ wait: dAll((d) => d.sides),
+ from: wait(dAll((d) => d.sides)),
+ tools: ["hammer"],
+ },
+ {
+ title: "Lock the sides",
+ detail: "Two cam locks in each side, clockwise.",
+ fix: dAll((d) => G.map((g, j) => fit("cam", [d.ys - 40, d.ys + 40].map((y): Vec3 => [g * (xs - sT / 2), y, zF - 28]), [g, 0, 0], { on: d.sides[j], len: 12, dia: 15, name: "Drawer cam lock" }))),
+ tools: ["screwdriver"],
+ },
+ { title: "Slide in the drawer bottoms", detail: "Down the grooves in the sides until each one reaches its front.", wait: D.map((d) => d.bottom), from: wait(D.map((d) => d.bottom)) },
+ { title: "Set the backs on", detail: "Lay each back across the ends of its sides, over the bottom.", wait: D.map((d) => d.back), from: wait(D.map((d) => d.back)) },
+ {
+ title: "Push in the back fittings",
+ detail: "Four in each drawer, through the sides into the back.",
+ fix: dAll((d) => G.map((g, j) => fit("nail", [d.ys - 30, d.ys + 50].map((y): Vec3 => [g * (xs + sT / 2), y, zDB + sT / 2]), [-g, 0, 0], { on: d.sides[j], mate: d.back, name: "Push-in fitting", len: 35, dia: 6 }))),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Lock the backs",
+ detail: "Press a small cam into each hole in the back and turn it until it grips the fitting.",
+ fix: D.map((d) => fit("cam", G.flatMap((g) => [d.ys - 30, d.ys + 50].map((y): Vec3 => [g * (xs - sT / 2 - 25), y, zDB])), [0, 0, 1], { on: d.back, len: 10, dia: 12, name: "Small cam lock" })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the runners onto the drawers",
+ detail: "One on each side, three screws each, wheel at the back.",
+ fix: [
+ ...dAll((d) => G.map((g, j) => fit("runner", [[g * (xs + sT / 2), d.run, dz]], [-g, 0, 0], { on: d.sides[j], name: "Drawer runner", len: 440, dia: 30 }))),
+ ...dAll((d) => G.map((g, j) => fit("screw", [-150, 15, 180].map((z): Vec3 => [g * (xs + sT / 2), d.run, z]), [-g, 0, 0], { on: d.sides[j], len: 12, dia: 4 }))),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Screw on the drawer stops", detail: "One in the middle of each back's top edge. It stops the drawer coming all the way out.", fix: D.map((d) => fit("clip", [[0, d.ys + 10 + (sH - 20) / 2, zDB + sT / 2]], [0, -1, 0], { on: d.back, name: "Drawer stop", len: 25, dia: 20 })), tools: ["screwdriver"] },
+ {
+ title: "Screw on the knobs",
+ detail: "One on each front, the screw and washer from inside the drawer.",
+ fix: [
+ ...D.map((d) => fit("knob", [[0, d.y0 + dh / 2, Dc / 2]], [0, 0, -1], { on: d.front, len: 25, dia: 30 })),
+ ...D.map((d) => fit("washer", [[0, d.y0 + dh / 2, zF - 2]], [0, 0, 1], { on: d.front, len: 1.5, dia: 12 })),
+ // the knob isn't a part, so the screw is drawn ending inside the front
+ ...D.map((d) => fit("screw", [[0, d.y0 + dh / 2, zF - 8]], [0, 0, 1], { on: d.front, len: 26, dia: 4 })),
+ ],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Slide the drawers in",
+ detail: "Onto the runners until they click past the stops. Keep them shut while children are around, and never let them climb on it.",
+ add: dAll((d) => [d.front, ...d.sides, d.bottom, d.back]),
+ from: Object.fromEntries(dAll((d) => [d.front, ...d.sides, d.bottom, d.back]).map((k) => [k, [0, 0, 500] as Vec3])),
+ kind: "drawer",
+ warnings: ["tip"],
+ },
+ ];
+ return { parts, steps };
+}
+
function recipe(s: ProductSpec): CustomParams | null {
const slug = s.slug ?? "";
+ if (/changing-table/.test(slug)) return changing();
+ if (/sundvik-wardrobe/.test(slug)) return wardrobe(s);
if (/children-s-table/.test(slug)) return table(s);
if (/children-s-chair/.test(slug)) return chair(s);
if (/rocking-chair/.test(slug)) return rocker(s);
diff --git a/src/lib/plan/families/sunnersta.ts b/src/lib/plan/families/sunnersta.ts
index f0a9f88..3439eac 100644
--- a/src/lib/plan/families/sunnersta.ts
+++ b/src/lib/plan/families/sunnersta.ts
@@ -69,7 +69,8 @@ function recipe(s: ProductSpec): CustomParams {
count: 2,
len: 30,
dia: 6,
- at: [-1, 1].map((sz): Vec3 => [sx * (W / 2), y - st / 2, sz * (zs - 30)]),
+ // through each leg tube into the shelf's turned-down edge, front and back
+ at: [-1, 1].map((sz): Vec3 => [sx * (W / 2), y - st / 2, (sz * (D - TUBE - 2)) / 2]),
dir: [-sx, 0, 0],
on: y > yJ ? `U${i + 1}` : `B${i + 1}`,
mate: id,
diff --git a/src/lib/plan/families/svarta.ts b/src/lib/plan/families/svarta.ts
index 5030cef..6ab57d9 100644
--- a/src/lib/plan/families/svarta.ts
+++ b/src/lib/plan/families/svarta.ts
@@ -100,7 +100,8 @@ function bed(s: ProductSpec, loft: boolean): CustomParams {
];
parts.push(compound("LD", "Ladder", ladderPieces));
- const supports = bases.map((y, i) => compound(`S${i}`, "Centre support", [{ shape: "box", size: [40, 25, 2 * zp - RT], pos: [0, y - RH - 12, 0] }]));
+ // between the two long rails, at their height, so the bolts go through each rail into its ends
+ const supports = bases.map((y, i) => compound(`S${i}`, "Centre support", [{ shape: "box", size: [60, 25, 2 * zp - RT], pos: [0, y - RH / 2, 0] }]));
parts.push(...supports);
const meshes = bases.flatMap((y, i) =>
[-1, 1].map((sx): CustomPart => ({ id: `M${i}${sx < 0 ? "a" : "b"}`, name: "Mesh base", size: [xr - 10, 20, 2 * zp - RT], pos: [sx * (xr / 2 + 2), y + 10, 0], material: "metal" })),
@@ -109,10 +110,11 @@ function bed(s: ProductSpec, loft: boolean): CustomParams {
// two connector bolts through the end frame into each end of a rail
const conn = (y: number, z: number, ids: [string, string]): CustomFix[] =>
- [-1, 1].map((sx, i) => fx("bolt", [-18, 18].map((dy): Vec3 => [sx * (L / 2), y + dy, z]), { name: "Connector bolt", len: 70, dia: 6, dir: [-sx, 0, 0], on: i ? "E2" : "E1", mate: ids[1] }));
+ [-1, 1].map((sx, i) => fx("bolt", [-12, 12].map((dy): Vec3 => [sx * (L / 2), y + dy, z]), { name: "Connector bolt", len: 70, dia: 6, dir: [-sx, 0, 0], on: i ? "E2" : "E1", mate: ids[1] }));
const tops: Vec3[] = [[-L / 2, H - 20, -zp], [L / 2, H - 20, -zp], [L / 2, H - 20, zp]];
const topFix: CustomFix[] = [
- fx("bolt", tops, { name: "Connector bolt", len: 70, dia: 6, dir: [1, 0, 0] }),
+ // each one in through the post, towards the middle of the bed
+ ...tops.map((p) => fx("bolt", [p], { name: "Connector bolt", len: 70, dia: 6, dir: [-Math.sign(p[0]), 0, 0] })),
fx("screw", [[xo, H - 20, zp]], { len: 20, dia: 6, dir: [0, 0, -1], on: "GF" }),
];
const meshScrews = (y: number): Vec3[] => [-1, 1].flatMap((sx) => [-1, 1].flatMap((sz) => [0.15, 0.85].map((f): Vec3 => [sx * xr * f, y + 20, sz * (zp - 10)])));
@@ -185,9 +187,9 @@ function bed(s: ProductSpec, loft: boolean): CustomParams {
detail: "Across the middle, from the front rail to the back. A bolt, a spacer and a cap nut at each end, plus a wood screw.",
add: supports.map((p) => p.id),
fix: bases.flatMap((y, i) => [
- fx("bolt", supportBolts(y), { len: 20, dia: 6, dir: [0, 0, 1], on: `S${i}` }),
- fx("nut", supportBolts(y).map((p): Vec3 => [p[0], p[1], p[2] - Math.sign(p[2]) * RT]), { name: "Cap nut", len: 10, dia: 16, dir: [0, 0, 1] }),
- fx("screw", supportBolts(y).map((p): Vec3 => [p[0] + 15, p[1] - 10, p[2]]), { name: "Wood screw", len: 16, dia: 4, dir: [0, 0, 1], on: `S${i}` }),
+ ...supportBolts(y).map((p) => fx("bolt", [p], { len: 20, dia: 6, dir: [0, 0, -Math.sign(p[2])], on: `S${i}` })),
+ ...supportBolts(y).map((p) => fx("nut", [[p[0], p[1], p[2] - Math.sign(p[2]) * RT]], { name: "Cap nut", len: 10, dia: 16, dir: [0, 0, -Math.sign(p[2])] })),
+ ...supportBolts(y).map((p) => fx("screw", [[p[0] + 24, p[1] - 6, p[2]]], { name: "Wood screw", len: 16, dia: 4, dir: [0, 0, -Math.sign(p[2])], on: `S${i}` })),
]),
tools: ["allen", "screwdriver"],
});
diff --git a/src/lib/plan/families/syntorp.ts b/src/lib/plan/families/syntorp.ts
index a9c4278..64a4e26 100644
--- a/src/lib/plan/families/syntorp.ts
+++ b/src/lib/plan/families/syntorp.ts
@@ -75,7 +75,9 @@ function recipe(s: ProductSpec): CustomParams {
};
const cross = (id: string, sz: number): CustomPart => ({ id, name: "Cross tube", shape: "cyl", size: [2 * (xt - 40), TUBE, TUBE], pos: [0, yR, sz * 90], material: "metal" });
const [xr, zr] = legAt(yF);
- const rx = xr - TUBE, rz = zr - TUBE;
+ // the ring's cut corners pass just inside the legs, touching them, so each corner screws into its leg
+ const k = (40 - TUBE * Math.SQRT2) / 2;
+ const rx = xr + k, rz = zr + k;
const ring: CustomPart = {
id: "R",
name: "Footrest ring",
@@ -129,7 +131,7 @@ function recipe(s: ProductSpec): CustomParams {
title: "Screw on the footrest ring",
detail: "Lower it over the legs, flat side down, and fit a screw into each leg.",
add: ["R"],
- fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 20, dia: 6, at: [[sx * (rx + TUBE / 2), yF, sz * (rz - 20)]], dir: [sx, 0, 0], on: "R", mate: `L${i + 1}` }))),
+ fix: [-1, 1].flatMap((sx, i) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 20, dia: 6, at: [[sx * (rx - 20 + TUBE / 2 / Math.SQRT2), yF, sz * (rz - 20 + TUBE / 2 / Math.SQRT2)]], dir: [sx * Math.SQRT1_2, 0, sz * Math.SQRT1_2], on: "R", mate: `L${i + 1}` }))),
tools: ["allen"],
},
{ title: "Tighten the four bolts", detail: "Give each one a last firm turn with the larger Allen key.", tools: ["allen"] },
diff --git a/src/lib/plan/families/syvde.ts b/src/lib/plan/families/syvde.ts
index 589c83d..9a0dd5f 100644
--- a/src/lib/plan/families/syvde.ts
+++ b/src/lib/plan/families/syvde.ts
@@ -77,7 +77,8 @@ function recipe(s: ProductSpec): CustomParams {
const y = d.id === "DS" ? d.pos[1] : d.pos[1] + d.size[1] / 2 - 50;
return [
fx({ kind: "knob", at: [[d.pos[0], y, zF]], dir: [0, 0, -1], on: d.id, dia: 24 }),
- fx({ kind: "screw", len: 30, dia: 4, at: [[d.pos[0], y, zF - t]], dir: [0, 0, 1], on: d.id }),
+ // just off the inside face: closer and the builder would nudge it away from the knob
+ fx({ kind: "screw", len: 30, dia: 4, at: [[d.pos[0], y, zF - t - 5]], dir: [0, 0, 1], on: d.id }),
];
};
diff --git a/src/lib/plan/families/tallasen.ts b/src/lib/plan/families/tallasen.ts
index 2b10a5d..7f91a39 100644
--- a/src/lib/plan/families/tallasen.ts
+++ b/src/lib/plan/families/tallasen.ts
@@ -313,7 +313,8 @@ function build(b: PlanBuilder, s: ProductSpec) {
k.step({ title: "Screw a keyhole bracket onto each rail end", detail: "Two countersunk bolts in each, keyholes pointing down.", pose: "+x", scene: "rails", tools: ["allen"], kind: "bolts" }, () => {
k.stage(["K-1H", "K-1F"]);
k.stage(["K1H", "K1F"], undefined, beside);
- const ends = sides.flatMap((sx) => [zr0, zr1].flatMap((z) => plateY.map((y) => [sx * (xL - 50), y, z] as Vec3)));
+ // where the bracket covers the rail end, so the bolts go into the rail
+ const ends = sides.flatMap((sx) => [zr0, zr1].flatMap((z) => plateY.map((y) => [sx * (xL - 15), y, z] as Vec3)));
k.fit(CSK, ends, (p) => [0, 0, p[2] < 0 ? 1 : -1], (p) => `K${p[0] < 0 ? -1 : 1}${p[2] < 0 ? "H" : "F"}`, { mate: rail });
});
diff --git a/src/lib/plan/families/tannforsen.ts b/src/lib/plan/families/tannforsen.ts
index 56619e5..1c25951 100644
--- a/src/lib/plan/families/tannforsen.ts
+++ b/src/lib/plan/families/tannforsen.ts
@@ -555,7 +555,7 @@ class WashStand extends Tf {
() => {
for (let i = 0; i < us.length - 1; i++) {
const a = us[i], c = us[i + 1];
- b.fits(JOIN_SCREW, [a.y0 + a.H - 80, a.y0 + 80].map((y) => ({ on: a.sideR, at: [a.x + a.W / 2 - T, y, a.D / 2 - 40] as Vec3, dir: [-1, 0, 0] as Vec3, mate: c.sideL })), 0.12);
+ b.fits(JOIN_SCREW, [a.y0 + a.H - 80, a.y0 + 80].map((y) => ({ on: a.sideR, at: [a.x + a.W / 2 - T, y, a.D / 2 - 40] as Vec3, dir: [1, 0, 0] as Vec3, mate: c.sideL })), 0.12);
}
},
);
@@ -632,7 +632,7 @@ class WashStand extends Tf {
wires: (d.wires === 1 ? [0] : [-1, 1]).map((g): FitOpts => ({ on: d.front, at: [d.x + g * (d.fw / 4), d.ys + 14, d.zF], dir: [0, 0, -1] })),
dowels: [-1, 1].flatMap((g) => [d.ys + d.sh * 0.3, d.ys + d.sh * 0.7].map((y): FitOpts => ({ on: d.sides[g < 0 ? 0 : 1], at: [d.x + g * (d.xs + 6), y, d.zB + 6], dir: [-g, 0, 0], mate: d.back }))),
locks: [-1, 1].flatMap((g) => [d.ys + 30, d.ys + d.sh - 30].map((y): FitOpts => ({ on: d.back, at: [d.x + g * (xIn - 22), y, d.zB], dir: [0, 0, 1] }))),
- support: d.support ? [d.zF - 20, d.zB + 50, d.zB + 20].map((z, i): FitOpts => ({ on: d.support!, at: [d.x + (i === 0 ? 0 : i === 1 ? -4 : 4), d.ys - 12, z], dir: [0, 1, 0], mate: d.bottom })) : [],
+ support: d.support ? [d.zF - 45, d.zB + 65, d.zB + 40].map((z, i): FitOpts => ({ on: d.support!, at: [d.x + (i === 0 ? 0 : i === 1 ? -4 : 4), d.ys - 12, z], dir: [0, 1, 0], mate: d.bottom })) : [],
divWires: d.dividers.flatMap((k) => {
const p = this.pos(k);
return [p[2] - (d.zF - d.zB) / 2 + 60, p[2] + (d.zF - d.zB) / 2 - 60].map((z): FitOpts => ({ on: d.bottom, at: [p[0], d.ys + 8, z], dir: [0, -1, 0] }));
diff --git a/src/lib/plan/families/tarno.ts b/src/lib/plan/families/tarno.ts
index 8684bae..a33c816 100644
--- a/src/lib/plan/families/tarno.ts
+++ b/src/lib/plan/families/tarno.ts
@@ -6,8 +6,8 @@ import type { CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3
* each other at the pivots and one frame hinged to the slatted top. You lay the top upside down, open the frames
* into an X and push the pegs at the top of the legs out into the keyhole slots of the top's two steel bars, then
* slide them along to lock. The table has a V brace that swings up and is held under the top with one knob bolt.
- * The stool sold with a cushion gets its cushion last. The folding chair is sold ready to use and has no manual,
- * so it keeps its old guide.
+ * The stool sold with a cushion gets its cushion last. The folding chair is sold ready to use and has no manual:
+ * its guide only unfolds it and checks it stands firm.
*/
const TUBE = 16;
@@ -157,13 +157,61 @@ function table(): CustomParams {
return { parts, steps };
}
+/** The folding chair: one steel frame (back legs, back slats, the crossed front legs) and the slatted seat hinged in it. */
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const xl = W / 2 - TUBE, yS = 450, foot = 12;
+ const zBf = -D / 2 + 15, zBt = -D / 2 + 40; // back legs: foot and top
+ const zBack = (y: number) => zBf + ((zBt - zBf) * y) / H;
+ const pieces: PartPiece[] = [];
+ for (const sx of [-1, 1]) {
+ const x = sx * xl;
+ pieces.push(tube([x, foot, zBf], [x, H, zBt]));
+ // the front leg runs from the front foot up to the back leg under the seat; the strut from the seat front to the back
+ pieces.push(tube([x - sx * TUBE, foot, D / 2 - 15], [x - sx * TUBE, yS - 30, zBack(yS - 30) + TUBE]));
+ pieces.push(tube([x - sx * 2 * TUBE, yS - 20, D / 2 - 70], [x - sx * 2 * TUBE, foot + 60, zBack(foot + 60) + 2 * TUBE]));
+ for (const z of [zBf, D / 2 - 15]) pieces.push({ shape: "box", size: [22, foot, 30], pos: [x, foot / 2, z], material: "metal" });
+ }
+ for (const y of [H - 60, H - 170]) pieces.push({ shape: "box", size: [2 * xl + TUBE, 15, 55], pos: [0, y, zBack(y) + TUBE / 2 + 8], rot: [Math.atan2(zBt - zBf, H), 0, 0], material: "wood" });
+ pieces.push(tube([-xl, 120, D / 2 - 50], [xl, 120, D / 2 - 50], 10));
+ const frame = compound("F", "Chair frame", pieces, "metal");
+ const SD = 280, slats = 5, gap = 8, sw = (SD - gap * (slats - 1)) / slats;
+ const z0 = zBack(yS) + TUBE + 10;
+ const seatPieces: PartPiece[] = [];
+ for (let i = 0; i < slats; i++) seatPieces.push({ shape: "box", size: [2 * xl - 2 * TUBE, 15, sw], pos: [0, yS - 7.5, z0 + sw / 2 + i * (sw + gap)], material: "wood" });
+ for (const sx of [-1, 1]) seatPieces.push({ shape: "box", size: [8, 20, SD], pos: [sx * (xl - TUBE - 8), yS - 25, z0 + SD / 2], material: "metal" });
+ const seat = compound("S", "Seat", seatPieces, "wood");
+ return {
+ parts: [frame, seat],
+ steps: [
+ {
+ title: "Stand the chair up and open the legs",
+ detail: "It comes ready to use, with nothing to screw. Stand it on its feet and pull the front legs forward, away from the back.",
+ add: ["F"],
+ },
+ {
+ title: "Fold the seat down",
+ detail: "Push the front of the seat down and the front legs swing out with it, until the seat rests level on the frame.",
+ add: ["S"],
+ from: { S: [0, 220, -170] },
+ warnings: ["hand"],
+ },
+ {
+ title: "Check it stands firm",
+ detail: "All four feet flat on the floor and the seat level. To fold it, lift the front edge of the seat up to the back.",
+ },
+ ],
+ };
+}
+
const family: Family = {
names: ["TÄRNÖ", "TARNO"],
recipe(s) {
const v = s.variant.toLowerCase();
if (/^stool/.test(v)) return stool(s);
if (/^table/.test(v)) return table();
- return null; // the chair comes ready to use
+ if (/chair/.test(v)) return chair(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/tarva.ts b/src/lib/plan/families/tarva.ts
index 2896f7e..3812778 100644
--- a/src/lib/plan/families/tarva.ts
+++ b/src/lib/plan/families/tarva.ts
@@ -510,7 +510,7 @@ function buildBed(b: PlanBuilder, s: ProductSpec, dbl: boolean) {
/*
* Dressers (3 and 6 drawers): the cabinet runners screw onto the sides lying on a rug, then cam bolts. One side lies
* on the floor and the back boards (two, one above the other) stand in it on dowels and cam locks; the 3-drawer adds
- * two dividers on dowels, the 6-drawer a middle frame (two posts and three bars carrying runners on both faces) that
+ * two dividers on dowels (the 5-drawer three back boards and two dividers, the dividers first), the 6-drawer a middle frame (two posts and three bars carrying runners on both faces) that
* the two halves lock onto. Upside down, the bottom goes on with dowels and cam locks (the 6-drawer first bolts a
* middle leg under it), a frame of four rails on corner brackets is screwed under it and the legs are bolted into
* the brackets with threaded rods, washers and nuts. Standing again, the top with its wall brackets goes on, the
@@ -555,6 +555,8 @@ interface Box {
fy: number;
zf: number;
knobs: number;
+ row?: number;
+ small?: boolean; // a shallow drawer: one cam bolt, dowel and cam lock in each side, not two
}
interface Drawer extends Box {
front: string;
@@ -566,12 +568,24 @@ interface Drawer extends Box {
const FT = 18, DS = 12; // drawer front and side thickness
function makeDrawers(b: PlanBuilder, boxes: Box[]): Drawer[] {
- const frT = b.part("Drawer front", [boxes[0].fw, boxes[0].fh, FT], { material: "wood" });
- const b0 = boxes[0];
- const sdT = b.part("Drawer side", [DS, b0.sh, b0.dd - DS], { material: "wood" });
- const btT = b.part("Drawer bottom", [b0.bw - DS, 3, b0.dd - DS - 10], { material: "fiber" });
- const bkT = b.part("Drawer back", [b0.bw, b0.sh - 14, DS], { material: "wood" });
+ // one set of part types per drawer size
+ const types = new Map<string, { frT: string; sdT: string; btT: string; bkT: string }>();
+ const typesOf = (b0: Box) => {
+ const key = [b0.fw, b0.fh, b0.sh, b0.bw, b0.dd].map(Math.round).join("x");
+ let t = types.get(key);
+ if (!t) {
+ t = {
+ frT: b.part("Drawer front", [b0.fw, b0.fh, FT], { material: "wood" }),
+ sdT: b.part("Drawer side", [DS, b0.sh, b0.dd - DS], { material: "wood" }),
+ btT: b.part("Drawer bottom", [b0.bw - DS, 3, b0.dd - DS - 10], { material: "fiber" }),
+ bkT: b.part("Drawer back", [b0.bw, b0.sh - 14, DS], { material: "wood" }),
+ };
+ types.set(key, t);
+ }
+ return t;
+ };
return boxes.map((x) => {
+ const { frT, sdT, btT, bkT } = typesOf(x);
const z0 = x.zf - FT; // inside face of the front
return {
...x,
@@ -589,9 +603,9 @@ function drawerFits(d: Drawer, runLen: number) {
const per = (fn: (g: number, side: string) => FitOpts[]) => [-1, 1].flatMap((g, i) => fn(g, d.sides[i]));
const kx = d.knobs === 1 ? [d.cx] : [d.cx - d.fw / 4, d.cx + d.fw / 4];
return {
- bolts: per((g, sd) => [d.y + 25, d.y + d.sh - 25].map((y): FitOpts => ({ on: d.front, at: [sx(g), y, z0], dir: [0, 0, 1], mate: sd, mateHole: 4 }))),
- dowels: per((g, sd) => [d.y + d.sh * 0.4, d.y + d.sh * 0.62].map((y): FitOpts => ({ on: sd, at: [sx(g), y, z0], dir: [0, 0, -1], mate: d.front }))),
- cams: per((g, sd) => [d.y + 25, d.y + d.sh - 25].map((y): FitOpts => ({ on: sd, at: [sx(g) - g * (DS / 2), y, z0 - 28], dir: [g, 0, 0] }))),
+ bolts: per((g, sd) => (d.small ? [d.y + d.sh * 0.3] : [d.y + 25, d.y + d.sh - 25]).map((y): FitOpts => ({ on: d.front, at: [sx(g), y, z0], dir: [0, 0, 1], mate: sd, mateHole: 4 }))),
+ dowels: per((g, sd) => (d.small ? [d.y + d.sh * 0.7] : [d.y + d.sh * 0.4, d.y + d.sh * 0.62]).map((y): FitOpts => ({ on: sd, at: [sx(g), y, z0], dir: [0, 0, -1], mate: d.front }))),
+ cams: per((g, sd) => (d.small ? [d.y + d.sh * 0.3] : [d.y + 25, d.y + d.sh - 25]).map((y): FitOpts => ({ on: sd, at: [sx(g) - g * (DS / 2), y, z0 - 28], dir: [g, 0, 0] }))),
pins: per((g, sd) => [0.3, 0.75].map((k): FitOpts => ({ on: d.back, at: [sx(g), d.y + 14 + (d.sh - 14) * k, zBack], dir: [0, 0, 1], mate: sd }))),
runners: per((g, sd) => [{ on: sd, at: [sx(g), d.y, z0 - 10 - runLen / 2], dir: [0, 1, 0], hole: false }]),
runnerScrews: per((g, sd) => [z0 - 40, z0 - runLen + 20].map((z): FitOpts => ({ on: sd, at: [sx(g) + g * (DS / 2), d.y + 8, z], dir: [-g, 0, 0] }))),
@@ -603,7 +617,9 @@ function drawerFits(d: Drawer, runLen: number) {
/** The drawers, each built on its front in its own scene, then all slid in. */
function drawerSteps(b: PlanBuilder, ds: Drawer[], runLen: number) {
const runner = runnerDef(runLen);
- const d0 = ds[0];
+ // the one built on screen is a full-size drawer; a shallow one gets the same steps with fewer fittings
+ const d0 = ds.find((d) => !d.small) ?? ds[0];
+ const small = ds.some((d) => d.small) ? " The shallow drawer takes one in each side." : "";
const c0: Vec3 = [d0.cx, d0.y + d0.sh / 2, d0.zf - d0.dd / 2];
const stage = (k: string, from: Vec3) => {
const it = b.partItem(k);
@@ -616,7 +632,7 @@ function drawerSteps(b: PlanBuilder, ds: Drawer[], runLen: number) {
b.step({ title, detail, tools: o.tools, scene: "drawer", pose: o.pose ?? "-z", repeat: rep, kind: o.kind ?? "drawer" }, body);
dstep(
"Screw the cam bolts into a drawer front",
- "Lay the front face down on a rug.",
+ "Lay the front face down on a rug." + small,
() => {
stage(d0.front, [0, 0, -160]);
b.then(0.15);
@@ -670,7 +686,7 @@ function drawerSteps(b: PlanBuilder, ds: Drawer[], runLen: number) {
for (const [i, d] of ds.entries()) {
b.stagger(0);
for (const k of [d.front, ...d.sides, d.bottom, d.back]) b.add(k, [0, 0, 520]);
- if (i > 0) {
+ if (d !== d0) {
const f = drawerFits(d, runLen);
const all: [HwDef, FitOpts[]][] = [
[HW.camScrew, f.bolts],
@@ -707,18 +723,20 @@ interface Frame {
corners: { x: number; z: number; gx: number; gz: number }[]; // inside corners of the frame
}
-function makeFrame(b: PlanBuilder, o: { Wc: number; zb: number; zf: number; yb: number; e: number }): Frame {
+// e: how far the frame sits in from the carcass edges; ex and eb override it at the sides and the back
+function makeFrame(b: PlanBuilder, o: { Wc: number; zb: number; zf: number; yb: number; e: number; ex?: number; eb?: number }): Frame {
const { Wc, zb, zf, yb, e } = o;
+ const ex = o.ex ?? e, eb = o.eb ?? e;
const RH = 60, RT = 20, LG = 45;
const zm = (zb + zf) / 2;
- const longT = b.part("Long frame rail", [Wc - 2 * e, RH, RT], { material: "wood" });
- const shortT = b.part("Short frame rail", [RT, RH, zf - zb - 2 * e - 2 * RT], { material: "wood" });
+ const longT = b.part("Long frame rail", [Wc - 2 * ex, RH, RT], { material: "wood" });
+ const shortT = b.part("Short frame rail", [RT, RH, zf - zb - e - eb - 2 * RT], { material: "wood" });
const yr = yb - RH / 2;
const front = b.place(longT, [0, yr, zf - e - RT / 2]);
- const back = b.place(longT, [0, yr, zb + e + RT / 2]);
- const sides = SIDES.map((i) => b.place(shortT, [sg(i) * (Wc / 2 - e - RT / 2), yr, zm]));
+ const back = b.place(longT, [0, yr, zb + eb + RT / 2]);
+ const sides = SIDES.map((i) => b.place(shortT, [sg(i) * (Wc / 2 - ex - RT / 2), yr, (zf - e + zb + eb) / 2]));
const legT = b.part("Leg", [LG, yb, LG], { material: "wood" });
- const xi = Wc / 2 - e - RT, zfi = zf - e - RT, zbi = zb + e + RT;
+ const xi = Wc / 2 - ex - RT, zfi = zf - e - RT, zbi = zb + eb + RT;
const corners = [
{ x: -xi, z: zfi, gx: -1, gz: 1 },
{ x: xi, z: zfi, gx: 1, gz: 1 },
@@ -895,25 +913,33 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cols: 1 | 2) {
const Wc = W - 2 * oh, xs = Wc / 2 - T / 2, xi = Wc / 2 - T;
const zb = -D / 2, zf = D / 2 - 12, Dc = zf - zb, zm = (zb + zf) / 2;
const yb = 160, y0 = yb + BB, y1 = H - TT, Hs = y1 - y0;
- const rows = 3, rh = Hs / rows;
- const PW = 44, PD = 44; // posts of the 6-drawer's middle frame
const two = cols === 2;
+ // the 5-drawer has three back boards and two dividers in the middle; the 3-drawer two of each
+ const five = !two && s.drawers?.rows === 5;
+ const rows = five ? 5 : 3;
+ // the 5-drawer's top drawer is a shallow one
+ const wts = range(rows).map((r) => (five && r === rows - 1 ? 0.62 : 1));
+ const unit = Hs / wts.reduce((a, c) => a + c, 0);
+ const rowAt = (r: number) => y0 + unit * wts.slice(0, r).reduce((a, c) => a + c, 0);
+ const nb = five ? 3 : 2;
+ const divK = two ? [] : five ? [2, 3] : [1, 2];
+ const PW = 44, PD = 44; // posts of the 6-drawer's middle frame
const sideT = b.part("Side panel", [T, Hs, Dc], { material: "wood" });
const sides = SIDES.map((i) => b.place(sideT, [sg(i) * xs, y0 + Hs / 2, zm]));
const top = b.place(b.part("Top", [W, TT, D], { material: "wood" }), [0, H - TT / 2, 0]);
const bottom = b.place(b.part("Bottom", [Wc, BB, Dc], { material: "wood" }), [0, yb + BB / 2, zm]);
- const backY = [y0 + Hs / 4, y0 + (3 * Hs) / 4];
+ const backY = range(nb).map((j) => y0 + (Hs * (2 * j + 1)) / (2 * nb));
const halfW = xi - PW / 2;
- const backT = b.part("Back board", [two ? halfW : 2 * xi, Hs / 2, BK], { material: "wood" });
+ const backT = b.part("Back board", [two ? halfW : 2 * xi, Hs / nb, BK], { material: "wood" });
// backs[h][k]: half h (only one on the 3-drawer), board k from the bottom
const backs = (two ? SIDES : [0]).map((h) => backY.map((y) => b.place(backT, [two ? sg(h) * (PW / 2 + halfW / 2) : 0, y, zb + BK / 2])));
const dvZ = (zb + BK + zf - FT) / 2;
- const divs = two ? [] : [1, 2].map((k) => b.place(b.part("Divider", [2 * xi, DV, zf - FT - zb - BK], { material: "wood" }), [0, y0 + k * rh, dvZ]));
+ const divs = divK.map((k) => b.place(b.part("Divider", [2 * xi, DV, zf - FT - zb - BK], { material: "wood" }), [0, rowAt(k), dvZ]));
const postT = two ? b.part("Middle post", [PW, Hs, PD], { material: "wood" }) : "";
const posts = two ? [b.place(postT, [0, y0 + Hs / 2, zb + PD / 2]), b.place(postT, [0, y0 + Hs / 2, zf - PD / 2])] : [];
const barT = two ? b.part("Runner bar", [PW, 40, Dc - 2 * PD], { material: "wood" }) : "";
- const bars = two ? range(rows).map((r) => b.place(barT, [0, y0 + r * rh + 20, zm])) : [];
+ const bars = two ? range(rows).map((r) => b.place(barT, [0, rowAt(r) + 20, zm])) : [];
const ladder = [...posts, ...bars];
const mid = two ? b.place(b.part("Middle leg", [45, yb, 45], { material: "wood" }), [0, yb / 2, zm]) : "";
const frame = makeFrame(b, { Wc, zb, zf, yb, e: 20 });
@@ -921,14 +947,15 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cols: 1 | 2) {
// drawers: inset between the sides (and the middle post), one row each
const opens: [number, number][] = two ? [[-xi, -PW / 2], [PW / 2, xi]] : [[-xi, xi]];
const boxes: Box[] = [];
- for (const r of [2, 1, 0])
+ for (const r of range(rows).reverse())
for (const [a, c] of opens) {
- const lo = y0 + r * rh + (two || r === 0 ? 0 : DV / 2), hi = y0 + (r + 1) * rh - (two || r === 2 ? 0 : DV / 2);
- boxes.push({ cx: (a + c) / 2, y: lo + 16, bw: c - a - 26, sh: hi - lo - 50, dd: Dc - BK - FT - 30, fw: c - a - 4, fh: rh - 4, fy: y0 + r * rh + rh / 2, zf, knobs: 2 });
+ const lo = rowAt(r) + (divK.includes(r) ? DV / 2 : 0), hi = rowAt(r + 1) - (divK.includes(r + 1) ? DV / 2 : 0);
+ const rh = rowAt(r + 1) - rowAt(r);
+ boxes.push({ cx: (a + c) / 2, y: lo + 16, bw: c - a - 26, sh: hi - lo - 50, dd: Dc - BK - FT - 30, fw: c - a - 4, fh: rh - 4, fy: rowAt(r) + rh / 2, zf, knobs: 2, row: r, small: wts[r] < 1 });
}
const ds = makeDrawers(b, boxes);
const runLen = Math.round((boxes[0].dd - 30) / 10) * 10;
- const rowOf = (d: Drawer) => Math.round((d.fy - y0 - rh / 2) / rh);
+ const rowOf = (d: Drawer) => d.row ?? 0;
// cabinet runners beside every drawer: on the sides, and on both faces of the middle bars
const runnersFor = (pred: (d: Drawer) => boolean, onSides: boolean, onBars: boolean) =>
ds.filter(pred).flatMap((d) => {
@@ -966,12 +993,21 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cols: 1 | 2) {
);
// cam bolts in the sides for the back boards, cam locks in the boards
const outerBacks = two ? [backs[0], backs[1]] : [backs[0], backs[0]];
- const sideBolts = (i: number): FitOpts[] => outerBacks[i].map((k, j) => ({ on: sides[i], at: [sg(i) * xi, backY[j], zb + BK / 2], dir: [sg(i), 0, 0], mate: k, mateHole: 4 }));
+ const sideBolts = (i: number): FitOpts[] => [
+ ...outerBacks[i].map((k, j): FitOpts => ({ on: sides[i], at: [sg(i) * xi, backY[j], zb + BK / 2], dir: [sg(i), 0, 0], mate: k, mateHole: 4 })),
+ ...(five ? [divBolt(i)] : []),
+ ];
const sideCams = (i: number): FitOpts[] => outerBacks[i].map((k, j) => ({ on: k, at: [sg(i) * (xi - 30), backY[j], zb + BK], dir: [0, 0, -1] }));
+ // the 5-drawer's upper divider is also held by a cam bolt in each side
+ const yDiv = rowAt(divK[divK.length - 1] ?? 0);
+ function divBolt(i: number): FitOpts {
+ return { on: sides[i], at: [sg(i) * xi, yDiv, dvZ + 60], dir: [sg(i), 0, 0], mate: divs[divs.length - 1], mateHole: 4 };
+ }
+ const divCam = (i: number): FitOpts => ({ on: divs[divs.length - 1], at: [sg(i) * (xi - 30), yDiv + DV / 2, dvZ + 60], dir: [0, -1, 0] });
b.step(
{
title: "Screw the cam bolts into the sides",
- detail: "Two in each side, in the holes by the back edge. By hand until they stop.",
+ detail: five ? "Four in each side: three by the back edge and one for the upper divider. By hand until they stop." : "Two in each side, in the holes by the back edge. By hand until they stop.",
tools: ["screwdriver"],
scene: "sides",
kind: "cams",
@@ -1034,47 +1070,94 @@ function buildChest(b: PlanBuilder, s: ProductSpec, cols: 1 | 2) {
);
}
+ const divDowels = divs.flatMap((k, j) => SIDES.flatMap((i) => [-70, 70].map((dz): FitOpts => ({ on: k, at: [sg(i) * xi, rowAt(divK[j]), dvZ + dz], dir: [-sg(i), 0, 0], mate: sides[i] }))));
+ if (five) {
+ // the manual puts the dividers in first, then the three back boards behind them
+ b.step(
+ { title: "Tap dowels into the back boards and dividers", detail: "Two in each end of all five boards.", tools: ["hammer"], scene: "boards", kind: "dowels" },
+ () => {
+ layBoards([...backs[0], ...divs]);
+ b.then(0.15);
+ b.fits(HW.dowel, [...backDowels(0), ...divDowels], 0.04);
+ },
+ );
+ b.step(
+ {
+ title: "Lay one side down and stand the dividers in it",
+ detail: "Inside face up, runners at the top. Push both dividers down onto their dowels, the one with the cam lock hole nearer the top.",
+ pose: "+x",
+ kind: "join",
+ warnings: ["floor"],
+ },
+ () => {
+ b.add(sides[0], [-260, 0, 0]);
+ b.then(0.15);
+ b.stagger(0.3);
+ for (const k of divs) b.add(k, [300, 0, 0]);
+ },
+ );
+ b.step({ title: "Lock the upper divider with a cam lock", detail: "Arrow towards the bolt, then a clockwise turn.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => b.fit(HW.cam, divCam(0)));
+ b.step(
+ { title: "Stand the three back boards in it", detail: "One at a time along the back edge, pushed down onto the dowels and cam bolts.", pose: "+x", kind: "join" },
+ () => {
+ b.stagger(0.3);
+ for (const k of backs[0]) b.add(k, [300, 0, 0]);
+ },
+ );
+ b.step({ title: "Lock the back boards with cam locks", detail: "Three, turned clockwise.", tools: ["screwdriver"], pose: "+x", kind: "cams" }, () => b.fits(HW.cam, sideCams(0), 0.15));
+ b.step(
+ { title: "Lower the other side on top", detail: "Runners facing in. Guide every dowel and cam bolt into its hole, then press it down evenly.", pose: "+x", kind: "join", people: 2 },
+ () => b.add(sides[1], [420, 0, 0]),
+ );
+ b.step(
+ { title: "Lock this side with cam locks", detail: "Three in the back boards and one in the divider.", tools: ["screwdriver"], pose: "+x", kind: "cams" },
+ () => b.fits(HW.cam, [...sideCams(1), divCam(1)], 0.15),
+ );
+ } else {
b.step(
- {
- title: two ? "Tap dowels into the back boards for the left half" : "Tap dowels into the back boards",
- detail: "Two in each end of both boards.",
- tools: ["hammer"],
- scene: "boards",
- kind: "dowels",
- },
- () => {
- layBoards(backs[0]);
- b.then(0.15);
- b.fits(HW.dowel, backDowels(0), 0.05);
- },
- );
- b.step(
- {
- title: two ? "Lay the left side down and stand its back boards in it" : "Lay one side down and stand the back boards in it",
- detail: "Inside face up, runners at the top. One board at a time along the back edge, pushed down onto the dowels and cam bolts.",
- pose: "+x",
- kind: "join",
- warnings: ["floor"],
- },
- () => {
- b.add(sides[0], [-260, 0, 0]);
- b.then(0.15);
- b.stagger(0.3);
- for (const k of backs[0]) b.add(k, [300, 0, 0]);
- },
- );
- b.step(
- { title: "Lock the back boards with cam locks", detail: "Arrow towards the bolt, then turn each one clockwise.", tools: ["screwdriver"], pose: "+x", kind: "cams" },
- () => b.fits(HW.cam, sideCams(0), 0.15),
- );
+ {
+ title: two ? "Tap dowels into the back boards for the left half" : "Tap dowels into the back boards",
+ detail: "Two in each end of both boards.",
+ tools: ["hammer"],
+ scene: "boards",
+ kind: "dowels",
+ },
+ () => {
+ layBoards(backs[0]);
+ b.then(0.15);
+ b.fits(HW.dowel, backDowels(0), 0.05);
+ },
+ );
+ b.step(
+ {
+ title: two ? "Lay the left side down and stand its back boards in it" : "Lay one side down and stand the back boards in it",
+ detail: "Inside face up, runners at the top. One board at a time along the back edge, pushed down onto the dowels and cam bolts.",
+ pose: "+x",
+ kind: "join",
+ warnings: ["floor"],
+ },
+ () => {
+ b.add(sides[0], [-260, 0, 0]);
+ b.then(0.15);
+ b.stagger(0.3);
+ for (const k of backs[0]) b.add(k, [300, 0, 0]);
+ },
+ );
+ b.step(
+ { title: "Lock the back boards with cam locks", detail: "Arrow towards the bolt, then turn each one clockwise.", tools: ["screwdriver"], pose: "+x", kind: "cams" },
+ () => b.fits(HW.cam, sideCams(0), 0.15),
+ );
+ }
- if (!two) {
+ if (five) {
+ // done above
+ } else if (!two) {
b.step(
{ title: "Tap dowels into the dividers", detail: "Two in each end of both.", tools: ["hammer"], scene: "boards", kind: "dowels" },
() => {
layBoards(divs);
b.then(0.15);
- b.fits(HW.dowel, divs.flatMap((k, j) => SIDES.flatMap((i) => [-70, 70].map((dz): FitOpts => ({ on: k, at: [sg(i) * xi, y0 + (j + 1) * rh, dvZ + dz], dir: [-sg(i), 0, 0], mate: sides[i] })))), 0.05);
+ b.fits(HW.dowel, divDowels, 0.05);
},
);
b.step(
@@ -1310,7 +1393,8 @@ function buildNightstand(b: PlanBuilder, s: ProductSpec) {
const zRf = zf - FT - T / 2, zRb = zb + T / 2;
const rails = [b.place(railT, [0, yb + RAIL / 2, zRf]), b.place(railT, [0, yb + RAIL / 2, zRb])];
const panel = b.place(b.part("Bottom panel", [2 * xi, 3, zRf - zRb - T], { material: "fiber" }), [0, yb + 1.5, (zRf + zRb) / 2]);
- const frame = makeFrame(b, { Wc, zb, zf, yb, e: 15 });
+ // the short rails stand on the sides' bottom edges and the back rail under the back bottom rail
+ const frame = makeFrame(b, { Wc, zb, zf, yb, e: 15, ex: 0, eb: 0 });
const lo = yb + RAIL, hi = ySh - SHF / 2;
const ds = makeDrawers(b, [{ cx: 0, y: lo + 16, bw: 2 * xi - 26, sh: hi - lo - 50, dd: Dc - FT - 40, fw: 2 * xi - 4, fh: hi - yb - 4, fy: (yb + hi) / 2, zf, knobs: 1 }]);
const runLen = Math.round((ds[0].dd - 30) / 10) * 10;
@@ -1438,14 +1522,15 @@ function buildNightstand(b: PlanBuilder, s: ProductSpec) {
},
);
b.step(
- { title: "Fit the short rails between them", detail: "Tap a dowel into each end and push them in between the long rails.", tools: ["hammer"], pose: "-y", kind: "dowels" },
+ { title: "Fit the short rails between them", detail: "Two dowels in each, then press them onto the bottom edges of the sides, between the long rails.", tools: ["hammer"], pose: "-y", kind: "dowels" },
() => {
const list: FitOpts[] = [];
- for (const i of SIDES) for (const c of corners.filter((c) => c.gx === sg(i))) list.push({ on: fr.sides[i], at: [c.x + c.gx * 10, yb - 30, c.z], dir: [0, 0, -c.gz], mate: c.gz > 0 ? fr.front : fr.back });
+ const sz = b.partItem(fr.sides[0]).final.pos[2], half = (corners[0].z - corners[2].z) / 2;
+ for (const i of SIDES) for (const g of [-1, 1]) list.push({ on: fr.sides[i], at: [sg(i) * (Wc / 2 - T / 2), yb, sz + g * (half - 50)], dir: [0, -1, 0], mate: sides[i] });
b.fits(HW.dowel, list, 0.1);
b.then(0.15);
b.stagger(0.3);
- for (const i of SIDES) b.add(fr.sides[i], [sg(i) * 240, 0, 0]);
+ for (const i of SIDES) b.add(fr.sides[i], [0, -240, 0]);
},
);
const D45 = Math.SQRT1_2;
@@ -1536,13 +1621,14 @@ function buildNightstand(b: PlanBuilder, s: ProductSpec) {
/* ---------------- the family ---------------- */
-type Kind = "single" | "double" | "chest3" | "chest6" | "night";
+type Kind = "single" | "double" | "chest3" | "chest5" | "chest6" | "night";
-// the old chests of 5 and 6 drawers and the old nightstand have no manual here: they keep their old guides
+// the old chest of 6 drawers and the old nightstand have no manual here: they keep their old guides
function kindOf(s: ProductSpec): Kind | null {
const v = s.variant.toLowerCase();
if (s.archetype === "bed" && /^bed frame/.test(v)) return (s.bed?.mattressW ?? s.size.w - 16) >= 120 ? "double" : "single";
if (/^3-drawer dresser/.test(v)) return "chest3";
+ if (/^(5-drawer dresser|chest of 5 drawers)/.test(v)) return "chest5";
if (/^6-drawer dresser/.test(v)) return "chest6";
if (/^nightstand,/.test(v) && s.size.w >= 45) return "night";
return null;
@@ -1554,6 +1640,7 @@ const family: Family = {
const k = kindOf(s);
if (k === "single" || k === "double") return buildBed(b, s, k === "double");
if (k === "chest3" || k === "chest6") return buildChest(b, s, k === "chest3" ? 1 : 2);
+ if (k === "chest5") return buildChest(b, { ...s, drawers: { ...s.drawers!, rows: 5, cols: 1 } }, 1);
if (k === "night") return buildNightstand(b, s);
return false;
},
diff --git a/src/lib/plan/families/taxasklint.ts b/src/lib/plan/families/taxasklint.ts
index dca9caa..728ccd5 100644
--- a/src/lib/plan/families/taxasklint.ts
+++ b/src/lib/plan/families/taxasklint.ts
@@ -27,6 +27,11 @@ function recipe(s: ProductSpec): CustomParams {
...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [post, Hf, post], pos: [sx * xP, 0, 0] })),
{ shape: "box", size: [2 * (xP - post / 2), railH, t], pos: [0, yR - Hf / 2, 0] },
];
+ // a side rail with the ledge along its inside that the slats and the straps sit on
+ const railPieces = (sx: number): PartPiece[] => [
+ { shape: "box", size: [t, railH, Lb / 2 - zHin], pos: [0, 0, 0] },
+ { shape: "box", size: [30, 25, Lb / 2 - zHin], pos: [-sx * (t / 2 + 15), ySlat - 12.5 - yR, 0] },
+ ];
const strapEnd = (sx: number, sz: number): Vec3 => [sx * 15, ySlat - 2, sz * 700];
const strap = (id: string, sx: number, sz: number): CustomPart => {
const a: Vec3 = [sx * xIn, ySlat - 2, 0], b = strapEnd(sx, sz);
@@ -47,10 +52,10 @@ function recipe(s: ProductSpec): CustomParams {
{ id: "P1", name: "Headboard post", size: [post, Hh, post], pos: [-xP, Hh / 2, zHP], material: "wood" },
{ id: "P2", name: "Headboard post", size: [post, Hh, post], pos: [xP, Hh / 2, zHP], material: "wood" },
{ id: "FB", name: "Footboard", size: [W, Hf, post], pos: [0, Hf / 2, zFP], pieces: footboard, material: "wood" },
- { id: "S1", name: "Side rail", size: [t, railH, Lb / 2 - zHin], pos: [-xR, yR, (zHin + Lb / 2) / 2], material: "wood" },
+ { id: "S1", name: "Side rail", size: [t, railH, Lb / 2 - zHin], pos: [-xR, yR, (zHin + Lb / 2) / 2], material: "wood", pieces: railPieces(-1) },
strap("T1", -1, -1),
strap("T2", -1, 1),
- { id: "S2", name: "Side rail", size: [t, railH, Lb / 2 - zHin], pos: [xR, yR, (zHin + Lb / 2) / 2], material: "wood" },
+ { id: "S2", name: "Side rail", size: [t, railH, Lb / 2 - zHin], pos: [xR, yR, (zHin + Lb / 2) / 2], material: "wood", pieces: railPieces(1) },
strap("T3", 1, -1),
strap("T4", 1, 1),
{ id: "CB", name: "Centre beam", size: [50, beamH, beamL], pos: [0, yBeam, zBeam], material: "wood" },
@@ -111,7 +116,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Screw the steel straps to the side rails",
detail: "Two straps on each rail, one screw at the middle of the rail's inside ledge. Let their other ends hang loose.",
- fix: [-1, 1].flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 16, dia: 4, at: [[sx * (xIn - 8), ySlat, sz * 20]], dir: [0, -1, 0], on: side(sx) }))),
+ fix: [-1, 1].flatMap((sx) => [-1, 1].map((sz): CustomFix => ({ kind: "screw", count: 1, len: 16, dia: 4, at: [[sx * (xIn - 15), ySlat, sz * 20]], dir: [0, -1, 0], on: side(sx) }))),
wait: ["T1", "T2", "T3", "T4"],
from: { T1: [-500, 0, 0], T2: [-500, 0, 0], T3: [500, 0, 0], T4: [500, 0, 0] },
},
diff --git a/src/lib/plan/families/tegelon.ts b/src/lib/plan/families/tegelon.ts
index ce2e8d8..24cfc50 100644
--- a/src/lib/plan/families/tegelon.ts
+++ b/src/lib/plan/families/tegelon.ts
@@ -64,7 +64,8 @@ function chair(s: ProductSpec): CustomParams {
...SIDES.map((k) => tube([k * xs, postTop - 100, zb - 10], [k * xs, b0[1] + 30, b0[2]], T + 8)),
], "metal");
const seat = compound("S", "Woven seat", [{ shape: "box", size: [W - 60, 40, D - 130], pos: [0, ys + T / 2 + 20, 25] }], "soft");
- const sideBolts = (y: number): Vec3[] => SIDES.map((k): Vec3 => [k * (xs + T / 2 + 4), y, zb - 10]);
+ // one bolt from the outside of each post, going in towards the middle
+ const sideBolts = (y: number): CustomFix[] => SIDES.map((k) => fx("bolt", [[k * (xs + T / 2 + 4), y, zb - 10]], { len: 16, dia: 6, dir: [-k, 0, 0], mate: "F" }));
const seatBolts: Vec3[] = SIDES.flatMap((k) => [zs - 40, zb + 40].map((z): Vec3 => [k * xs, ys - T / 2, z]));
return {
parts: [frame, back, seat],
@@ -74,7 +75,7 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Bolt the back to the posts",
detail: "One bolt through each side. Tighten them with the Allen key.",
- fix: [fx("bolt", sideBolts(postTop - 30), { len: 16, dia: 6, dir: [-1, 0, 0], mate: "F" })],
+ fix: sideBolts(postTop - 30),
tools: ["allen"],
},
{
@@ -88,7 +89,7 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Tighten the seat bolts and lock the back",
detail: "Tighten all four seat bolts, then put one more bolt through each back post below the first ones.",
- fix: [fx("bolt", sideBolts(postTop - 80), { len: 16, dia: 6, dir: [-1, 0, 0], mate: "F" })],
+ fix: sideBolts(postTop - 80),
tools: ["allen"],
},
{ title: "Stand the chair up", pose: "+y" },
diff --git a/src/lib/plan/families/teodores.ts b/src/lib/plan/families/teodores.ts
index eb554cd..c62e1f6 100644
--- a/src/lib/plan/families/teodores.ts
+++ b/src/lib/plan/families/teodores.ts
@@ -107,7 +107,7 @@ function chair(s: ProductSpec): CustomParams {
{
title: "Screw the backrest to the uprights",
detail: "One small screw through the back of each upright into the backrest, with a screwdriver, not a drill.",
- fix: [-1, 1].map((sx) => fx("screw", [[sx * xs, yB0 + 30, zUp(yB0 + 30) - T / 2]], [0, 0, 1], sx < 0 ? "SIDE_L" : "SIDE_R", { len: 16, dia: 3.5, mate: "BACK" })),
+ fix: [-1, 1].map((sx) => fx("screw", [[sx * xs, 720, zUp(720) - T / 2]], [0, 0, 1], sx < 0 ? "SIDE_L" : "SIDE_R", { len: 16, dia: 3.5, mate: "BACK" })),
tools: ["screwdriver"],
},
{
@@ -127,8 +127,9 @@ function chair(s: ProductSpec): CustomParams {
title: "Screw the seat on from underneath",
detail: "Lay the chair upside down on a table, the backrest over the edge. A plastic bush, then a screw, at each of the four holes in the side rails. Use a screwdriver, not a drill.",
fix: [-1, 1].flatMap((sx) => [
- fx("washer", bySide(seatPts, sx), [0, 1, 0], sx < 0 ? "SIDE_L" : "SIDE_R", { name: "Plastic bush", len: 6, dia: 14 }),
+ // the screw first: the bush then shares its point instead of pushing it aside
fx("screw", bySide(seatPts, sx), [0, 1, 0], sx < 0 ? "SIDE_L" : "SIDE_R", { len: 20, dia: 4, mate: "SEAT" }),
+ fx("washer", bySide(seatPts, sx), [0, 1, 0], sx < 0 ? "SIDE_L" : "SIDE_R", { name: "Plastic bush", len: 6, dia: 14 }),
]),
pose: "-y",
tools: ["screwdriver"],
diff --git a/src/lib/plan/families/terje.ts b/src/lib/plan/families/terje.ts
new file mode 100644
index 0000000..094b9d1
--- /dev/null
+++ b/src/lib/plan/families/terje.ts
@@ -0,0 +1,48 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * TERJE folding chair. It comes fully assembled in solid beech and there is nothing to put together: the guide only
+ * unfolds it and sets the seat down until it locks. Folded, it hangs on a hook through the hole in its back.
+ */
+
+function chair(s: ProductSpec): CustomParams {
+ const W = (s.size.w || 44) * 10, H = (s.size.h || 79) * 10, D = (s.size.d || 50) * 10;
+ const SY = 450, LT = 30;
+ const xs = W / 2 - LT / 2;
+ const box = (size: Vec3, pos: Vec3, rot?: Vec3): PartPiece => ({ shape: "box", size, pos: [pos[0], pos[1] - H / 2, pos[2]], ...(rot ? { rot } : {}), material: "wood" });
+ // back legs run from the floor at the back up into the backrest; the front legs cross them under the seat
+ const zb0 = -D / 2 + 30, zb1 = -D / 2 + 70;
+ const backTilt = Math.atan2(zb1 - zb0, H);
+ const zf0 = D / 2 - 20, zf1 = -D / 2 + 140;
+ const frontLen = Math.hypot(zf1 - zf0, SY);
+ const frontTilt = Math.atan2(zf1 - zf0, SY);
+ const pieces: PartPiece[] = [
+ ...[-1, 1].map((sx) => box([LT, H, LT], [sx * xs, H / 2, (zb0 + zb1) / 2], [backTilt, 0, 0])),
+ ...[-1, 1].map((sx) => box([LT - 6, frontLen, LT - 6], [sx * (xs - LT), SY / 2, (zf0 + zf1) / 2], [frontTilt, 0, 0])),
+ box([W - 2 * LT, 20, D - 110], [0, SY, 20]),
+ box([W - 2 * LT, 120, 18], [0, H - 90, zb1 - 6]),
+ ...[-1, 1].map((sx) => box([W - 2 * LT - 40, 22, 22], [0, 120, sx * 120])),
+ ];
+ return {
+ parts: [{ id: "C", name: "Chair", size: [W, H, D], pos: [0, H / 2, 0], pieces, material: "wood" }],
+ steps: [
+ {
+ title: "Unfold the chair",
+ detail: "It comes fully assembled. Hold the backrest and pull the front legs forward until the chair stands on all four feet.",
+ add: ["C"],
+ from: { C: [0, 150, 0] },
+ },
+ {
+ title: "Press the seat down until it sits flat",
+ detail: "It rests on the rail between the legs. To fold it, lift the front of the seat; it hangs on a hook through the hole in the back.",
+ },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["TERJE"],
+ recipe: (s) => (/folding chair/i.test(s.variant) ? chair(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/tjusig.ts b/src/lib/plan/families/tjusig.ts
index 29b9c23..dcca089 100644
--- a/src/lib/plan/families/tjusig.ts
+++ b/src/lib/plan/families/tjusig.ts
@@ -52,7 +52,9 @@ function hatRack(): CustomParams {
title: "Dowel an arm onto its upright",
detail: "Two dowels in the top of the upright, the arm pressed down on them. Check the marked ends match.",
add: ["A0", "U0"],
- fix: [fx("dowel", [-10, 10].map((d) => pt(-ex, yT - 20, zU + d)), [0, -1, 0], { on: "U0", ...DOWEL })],
+ fix: [fx("dowel", [-10, 10].map((d) => pt(-ex, yT - 20, zU + d)), [0, -1, 0], { on: "U0", mate: "A0", ...DOWEL })],
+ // the upright slides in along the floor, then the arm goes onto its dowels
+ from: { U0: [0, -250, 0], A0: [0, 250, 0] },
pose: "+x",
tools: ["hammer"],
},
@@ -74,12 +76,18 @@ function hatRack(): CustomParams {
{ title: "Push in the other three tubes", detail: "All the way into their holes.", add: ["T2", "T1", "T0"] },
{ title: "Slide the cardboard spacer over the tube ends", detail: "It holds them in line while the other arm goes on." },
{
- title: "Put the other arm and upright on",
- detail: "Dowel the arm to its upright first, then press it down over the rail, the tubes and the hook rail.",
- add: ["A1", "U1"],
- fix: [fx("dowel", [pt(ex, yT - 20, zU)], [0, -1, 0], { on: "U1", ...DOWEL })],
+ title: "Dowel the other arm onto its upright",
+ detail: "Beside the rack, the same way as the first: the dowel in the top of the upright, the arm pressed onto it.",
+ wait: ["U1", "A1"],
+ fix: [fx("dowel", [pt(ex, yT - 20, zU)], [0, -1, 0], { on: "U1", mate: "A1", ...DOWEL })],
+ from: { U1: [0, -250, 0], A1: [0, 250, 0] },
tools: ["hammer"],
},
+ {
+ title: "Press them down over the rail and the tubes",
+ detail: "Both together, over the front rail, the four tubes and the hook rail, until they sit on the spacer.",
+ add: ["A1", "U1"],
+ },
{
title: "Drop in the second barrel nut",
detail: "Into the other end of the front rail, slot along the rail.",
@@ -165,7 +173,7 @@ function bench(): CustomParams {
title: "Stand it on the end frame and fit the back rail",
detail: "Two dowels in the end of the back rail, then push it into the frame's top back corner. Hold it upright.",
add: ["UB"],
- fix: [fx("dowel", [-8, 8].map((dz) => pt(-ix, FH - 20, -LZ + dz)), [1, 0, 0], { on: "UB", ...DOWEL })],
+ fix: [fx("dowel", [-12, 12].map((dz) => pt(-ix, FH - 20, -LZ + dz)), [1, 0, 0], { on: "UB", ...DOWEL })],
pose: "+x",
tools: ["hammer"],
},
@@ -179,7 +187,7 @@ function bench(): CustomParams {
add: ["E1"],
fix: [
fx("dowel", railEnd(1).map((p) => pt(p[0], p[1] + 10, p[2])), [-1, 0, 0], DOWEL),
- fx("dowel", [-8, 8].map((dz) => pt(ix, FH - 20, -LZ + dz)), [-1, 0, 0], { on: "UB", ...DOWEL }),
+ fx("dowel", [-12, 12].map((dz) => pt(ix, FH - 20, -LZ + dz)), [-1, 0, 0], { on: "UB", ...DOWEL }),
],
tools: ["hammer"],
},
@@ -264,7 +272,8 @@ function shoeRack(): CustomParams {
{
title: "Screw the uprights onto the crossbars",
detail: "Press them onto the ends of the left crossbars, one screw at an angle through each upright.",
- fix: S.map((sz) => fx("screw", [pt(-UX + 20, 60, sz * (UZ - 20))], [0, Math.SQRT1_2, -sz * Math.SQRT1_2], { len: 50, dia: 4 })),
+ // up at an angle from the upright's inside face into the underside of the crossbar's end
+ fix: S.map((sz) => fx("screw", [pt(-UX, levels[0] - 30, sz * (UZ - 15))], [0, Math.SQRT1_2, -sz * Math.SQRT1_2], { len: 50, dia: 4 })),
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/tolkning.ts b/src/lib/plan/families/tolkning.ts
index 7854382..555d291 100644
--- a/src/lib/plan/families/tolkning.ts
+++ b/src/lib/plan/families/tolkning.ts
@@ -7,7 +7,7 @@ import { rotate } from "../math";
* The pouffe is a round basket: drop the loose bottom board in, then lay the lid on. No fittings.
* The bench is built upside down: the woven box lies on its top on a rug, the two bent leg frames sit on its
* bottom and are screwed on with twelve Allen screws and washers, then it is turned over and the lid laid on.
- * The room divider has no manual (it comes folded, ready to use) and keeps its old guide.
+ * The room divider has no manual: it comes folded and ready to use, so its guide only unfolds it.
*/
const r1 = (n: number) => Math.round(n * 10) / 10;
@@ -160,12 +160,38 @@ function bench(s: ProductSpec): CustomParams {
return { parts, steps };
}
+
+/** The room divider: three rattan frames hinged together, stood in a zigzag. */
+function divider(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 1500, H = Math.round(s.size.h * 10) || 1700;
+ const pw = Math.round(W / 3) - 10, cane = 22, foot = 30;
+ const a = 0.45; // how far the outer panels turn from the middle one
+ const frame = (): PartPiece[] => [
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "cyl", size: [cane, H, cane], pos: [sx * (pw / 2 - cane / 2), 0, 0] })),
+ ...[-1, 1].map((sy): PartPiece => ({ shape: "box", size: [pw - 2 * cane, cane, cane], pos: [0, sy * (H / 2 - foot - cane / 2), 0] })),
+ { shape: "box", size: [pw - 2 * cane, H - 2 * foot - 2 * cane, 4], pos: [0, 0, 0] },
+ ];
+ // an outer panel hinges on an edge of the middle one and turns back from it
+ const outer = (sx: number): Vec3 => [sx * (pw / 2 + (pw / 2) * Math.cos(a)), H / 2, -(pw / 2) * Math.sin(a)];
+ const parts: CustomPart[] = [
+ { id: "M", name: "Middle panel", size: [pw, H, cane], pos: [0, H / 2, 0], material: "wood", pieces: frame() },
+ ...[-1, 1].map((sx, i): CustomPart => ({ id: `O${i}`, name: "Side panel", size: [pw, H, cane], pos: outer(sx), rot: [0, sx * a, 0], material: "wood", pieces: frame() })),
+ ];
+ const steps: CustomStep[] = [
+ { title: "Lift the folded divider out of its packaging", detail: "It comes ready to use, the three panels already hinged together. Stand it on its feet.", add: ["M"], from: { M: [0, 300, 0] } },
+ { title: "Open out the side panels", detail: "Swing each one away from the middle panel on its hinges.", add: ["O0", "O1"], from: { O0: [pw * 0.6, 0, 250], O1: [-pw * 0.6, 0, 250] } },
+ { title: "Stand it in a zigzag", detail: "Keep the panels at an angle to each other so it stands steady on all six feet. It is for indoor use only." },
+ ];
+ return { parts, steps };
+}
+
const family: Family = {
names: ["TOLKNING"],
recipe(s) {
const slug = s.slug ?? "";
if (/pouf/.test(slug) || /pouf/i.test(s.variant)) return pouffe();
if (/bench/.test(slug)) return bench(s);
+ if (/room-divider/.test(slug) || /room divider/i.test(s.variant)) return divider(s);
return null;
},
};
diff --git a/src/lib/plan/families/tonstad.ts b/src/lib/plan/families/tonstad.ts
index 7944ef5..922ef8a 100644
--- a/src/lib/plan/families/tonstad.ts
+++ b/src/lib/plan/families/tonstad.ts
@@ -286,7 +286,7 @@ function drawersOf(g: Geo): Dw[] {
const fy = all ? g.ySide + 3 + (dr.rows - 1 - r) * (fh + 3) : g.yTopU - fh - 2;
const fx = all ? -c.W / 2 + 3 + fw / 2 + ci * (fw + 3) : g.colX(ci);
const sideH = Math.max(60, Math.min(fh - 50, 150));
- out.push({ i: i++, col: ci, fx, fy, fw, fh, bx: g.colX(ci), bw: g.cw - 30, by: fy + (all ? 25 : 15), sideH });
+ out.push({ i: i++, col: ci, fx, fy, fw, fh, bx: g.colX(ci), bw: g.cw - 30, by: all ? Math.max(fy + 25, g.yBotU + 6) : fy + 15, sideH }); // a box never sinks into the bottom panel
}
return out;
}
@@ -361,11 +361,14 @@ function caseBuild(b: PlanBuilder, c: CaseCfg) {
stage: hosts.map((id, k) => ({ id, pos: [(k - (hosts.length - 1) / 2) * (H - ySide + 80), 0, 0], rot: [0, 0, (id === "SR" ? -1 : 1) * (Math.PI / 2)] })),
fit: hosts.flatMap((id) => {
const mine = pts.filter((p) => hostAt(p.x) === id);
- const sides = id === "SL" || id === "SR" ? mine : mine;
+ // each screw starts inside the drawer's opening and goes out into the panel the runner sits on
return [
- fit(runner, sides.map((p) => [p.x - p.sx * 0, p.y, zr] as Vec3), [0, 1, 0], { on: id, hole: false }),
- fit(RUNNER_SCREW, sides.flatMap((p) => [zr - Dc / 3, zr + Dc / 3].map((z) => [p.x - p.sx * 6, p.y + 10, z] as Vec3)), [0, 0, 1], { on: id }),
- ].map((f, k) => (k ? { ...f, dir: [Math.sign(id === "SL" ? -1 : 1), 0, 0] as Vec3 } : f));
+ fit(runner, mine.map((p) => [p.x, p.y, zr] as Vec3), [0, 1, 0], { on: id, hole: false }),
+ ...[-1, 1].flatMap((sx) => {
+ const pp = mine.filter((p) => p.sx === sx);
+ return pp.length ? [fit(RUNNER_SCREW, pp.flatMap((p) => [zr - Dc / 3, zr + Dc / 3].map((z) => [p.x - sx * 6, p.y + 10, z] as Vec3)), [sx, 0, 0], { on: id })] : [];
+ }),
+ ];
}),
tools: ["screwdriver"],
warnings: ["floor"],
@@ -1241,7 +1244,7 @@ function deskDrawer(b: PlanBuilder, g: { W: number; D: number; dw: number; yU: n
kind: "runners",
scene: "main",
pose: "-y",
- fit: [fit(runner, [-1, 1].map((sx) => [sx * (dw / 2), y0 + 4, zm] as Vec3), [0, 1, 0], { hole: false }), fit(RUNNER_SCREW, [-1, 1].flatMap((sx) => [zm - dd / 3, zm + dd / 3].map((z) => [sx * (dw / 2), y0 + 14, z] as Vec3)), [1, 0, 0])],
+ fit: [fit(runner, [-1, 1].map((sx) => [sx * (dw / 2), y0 + 4, zm] as Vec3), [0, 1, 0], { hole: false }), ...[-1, 1].map((sx) => fit(RUNNER_SCREW, [zm - dd / 3, Math.min(zm + dd / 3, zr - 75)].map((z) => [sx * (dw / 2 - 4), y0 + 14, z] as Vec3), [sx, 0, 0]))],
tools: ["screwdriver"],
},
{
@@ -1255,7 +1258,7 @@ function deskDrawer(b: PlanBuilder, g: { W: number; D: number; dw: number; yU: n
tools: ["screwdriver"],
warnings: ["floor", "face"],
},
- { title: "Slide in the bottom and fit the back", detail: "Bottom down the grooves, back over it, then two screws through each side.", kind: "drawer", scene: "drawer", stage: [{ id: "B", pos: rel("B"), from: [0, 0, -300] }, { id: "K", pos: rel("K"), from: [0, 0, -200] }], fit: [fit(RUNNER_SCREW, [-1, 1].map((sx) => [sx * (bw / 2), y0 + 8 + sh / 2, zb + 6] as Vec3), [-1, 0, 0], { on: "K" })].map((f) => ({ ...f, dir: [1, 0, 0] as Vec3 })), tools: ["screwdriver"] },
+ { title: "Slide in the bottom and fit the back", detail: "Bottom down the grooves, back over it, then two screws through each side.", kind: "drawer", scene: "drawer", stage: [{ id: "B", pos: rel("B"), from: [0, 0, -300] }, { id: "K", pos: rel("K"), from: [0, 0, -200] }], fit: [-1, 1].map((sx) => fit(RUNNER_SCREW, [[sx * (bw / 2), y0 + 8 + sh / 2, zb + 6]], [-sx, 0, 0], { on: "K" })), tools: ["screwdriver"] },
{ title: "Turn the desk over and slide the drawer in", detail: "Set it on the runners and push until it clicks.", kind: "drawer", scene: "main", pose: "+y", add: ["F", "L", "R", "B", "K"], from: [0, 0, 420] },
];
run(b, parts, steps);
@@ -1460,6 +1463,7 @@ interface BedCfg {
slats: boolean; // a slatted base comes with it
storage: boolean;
beamLegs: number; // legs under the centre beam
+ drawers4?: boolean; // the king: four drawers, two each side, on runners on the head and foot rails and two hung bars
}
function bedBuild(b: PlanBuilder, c: BedCfg) {
@@ -1477,10 +1481,13 @@ function bedBuild(b: PlanBuilder, c: BedCfg) {
];
for (const p of posts) parts.push({ id: p.id, name: p.h > ft ? "Head post" : "Foot post", size: [pd, p.h, pd], pos: [p.x, p.h / 2, p.z], cyl: true, mat: "wood" });
parts.push(box("HB", "Headboard", [inW, H - 120 - (y0 + rh + 40), rt], [0, (H - 120 + y0 + rh + 40) / 2, -pz]));
- parts.push(box("HR", "Head rail", [inW, rh, rt], [0, ry, -pz]));
- parts.push(box("FB", "Footboard", [inW, rh, rt], [0, ry, pz]));
+ // with four drawers the head rail and footboard reach down so the end runners have something to screw into
+ const eh = c.drawers4 ? rh + y0 - 40 : rh, ey = c.drawers4 ? 40 + eh / 2 : ry;
+ parts.push(box("HR", "Head rail", [inW, eh, rt], [0, ey, -pz]));
+ parts.push(box("FB", "Footboard", [inW, eh, rt], [0, ey, pz]));
for (const sx of [-1, 1]) parts.push(box(`SR${sx}`, "Side rail", [rt, rh, inD], [sx * px, ry, 0]));
- for (const sx of [-1, 1]) parts.push(box(`ST${sx}`, "Slat strip", [20, 30, inD - 20], [sx * (px - rt / 2 - 10), y0 + 25, 0], "wood"));
+ const stx = c.drawers4 ? 6 : 0; // room for the hanging brackets between the rail and the strip
+ for (const sx of [-1, 1]) parts.push(box(`ST${sx}`, "Slat strip", [20, 30, inD - 20], [sx * (px - rt / 2 - 10 - stx), y0 + 25, 0], "wood"));
parts.push(box("BM", "Centre beam", [40, 40, inD - 10], [0, y0 + 20, 0], "metal"));
const legIds = range(c.beamLegs).map((i) => {
const z = -inD / 2 + (inD * (i + 1)) / (c.beamLegs + 1);
@@ -1500,7 +1507,10 @@ function bedBuild(b: PlanBuilder, c: BedCfg) {
});
const steps: St[] = [];
- const pc = (id: string) => parts.find((p) => p.id === id)!.pos;
+ const pc = (id: string): Vec3 => {
+ const p = parts.find((q) => q.id === id)!.pos;
+ return id === "HR" || id === "FB" ? [p[0], ry, p[2]] : p; // fittings stay at the rail height
+ };
const lay = (ids: string[]) => ids.map((id, k) => ({ id, pos: [(k - (ids.length - 1) / 2) * 140, 0, 0] as Vec3, rot: [Math.PI / 2, 0, 0] as Vec3 }));
steps.push({
title: "Tap the glides into the posts",
@@ -1621,6 +1631,7 @@ function bedBuild(b: PlanBuilder, c: BedCfg) {
tools: ["screwdriver"],
check: "square",
});
+ if (c.drawers4) steps.push(...kingSupports(parts, { px, pz, rt }));
steps.push({
title: "Screw the slat strips inside the side rails",
detail: "Along the bottom inside edge of each rail, eight screws each.",
@@ -1654,19 +1665,194 @@ function bedBuild(b: PlanBuilder, c: BedCfg) {
from: [0, 0, -500],
};
run(b, c.storage ? parts.filter((p) => p.id !== "SB") : parts, c.storage ? steps : [...steps, slatStep]);
- if (c.storage) bedDrawers(b, { px, pz, inD, y0, rt, pd });
+ if (c.storage && c.drawers4) kingDrawers(b, { px, pz, inW, y0, rt });
+ else if (c.storage) bedDrawers(b, { px, pz, inD, y0, rt, pd });
if (c.storage) run(b, [{ ...parts.find((p) => p.id === "SB")!, id: "SB2" }], [{ ...slatStep, add: ["SB2"] }]);
}
+/*
+ * The king storage bed: four drawers, two under each side rail, staggered so they never meet. Each drawer runs on two
+ * metal runners: the head drawer on the left between the head rail and the first bar, the foot drawer on the right
+ * between the second bar and the footboard, the middle ones between the bars. The two bars hang from the side rails
+ * on a bracket at each end.
+ */
+const KING_RUNNER_Y = 100;
+const ARM_SCREW: HwDef = { kind: "screw", len: 16, dia: 5 };
+const HANG_STUD: HwDef = { kind: "stud", len: 12, dia: 10, name: "Hanging stud" };
+const RUNNER_CLIP: HwDef = { kind: "clip", len: 30, dia: 20, name: "Runner lock" };
+const DRAWER_PIN: HwDef = { kind: "camScrew", len: 30, dia: 8 };
+
+function kingLayout(g: { px: number; pz: number; rt: number }) {
+ const zH = -g.pz + g.rt / 2, zF = g.pz - g.rt / 2; // inner faces of the head rail and footboard
+ const span = (zF - zH - 40) / 3;
+ const z1 = zH + span + 10, z2 = z1 + 20 + span;
+ // each drawer: its side, and the two support faces it runs between (support id, face z, which way the drawer is)
+ type Face = { on: string; z: number; g: 1 | -1 };
+ const dws: { i: number; sx: number; a: Face; c: Face }[] = [
+ { i: 0, sx: -1, a: { on: "HR", z: zH, g: 1 }, c: { on: "BAR0", z: z1 - 10, g: -1 } },
+ { i: 1, sx: -1, a: { on: "BAR0", z: z1 + 10, g: 1 }, c: { on: "BAR1", z: z2 - 10, g: -1 } },
+ { i: 2, sx: 1, a: { on: "BAR0", z: z1 + 10, g: 1 }, c: { on: "BAR1", z: z2 - 10, g: -1 } },
+ { i: 3, sx: 1, a: { on: "BAR1", z: z2 + 10, g: 1 }, c: { on: "FB", z: zF, g: -1 } },
+ ];
+ return { z1, z2, dws };
+}
+
+function kingRunners(g: { px: number; pz: number; rt: number; inW: number }) {
+ const xo = g.px + g.rt / 2;
+ const bd = Math.min(600, g.inW / 2 - 60);
+ const runLen = Math.round((bd - 40) / 10) * 10;
+ const { dws } = kingLayout(g);
+ const runner: HwDef = { kind: "runner", len: runLen, dia: 40 };
+ const list = dws.flatMap((d) => [d.a, d.c].map((f) => {
+ const xc = d.sx * (xo - 18 - bd / 2);
+ const n = f.on === "HR" || f.on === "FB" ? 3 : 5;
+ return {
+ on: f.on,
+ runner: fit(runner, [[xc, KING_RUNNER_Y, f.z + f.g * 7]], [0, 1, 0], { on: f.on, hole: false, twist: Math.PI / 2 }),
+ screws: fit(RUNNER_SCREW, range(n).map((k) => [xc + (k - (n - 1) / 2) * (runLen / n), KING_RUNNER_Y, f.z + f.g * 2] as Vec3), [0, 0, -f.g], { on: f.on }),
+ };
+ }));
+ return { xo, bd, list };
+}
+
+/** The steps that fit the runners and hang the bars, between joining the frame and the slat strips. Adds the bars and brackets to `parts`. */
+function kingSupports(parts: Part[], g: { px: number; pz: number; rt: number }): St[] {
+ const inW = 2 * g.px - 60;
+ const { z1, z2 } = kingLayout(g);
+ const { list } = kingRunners({ ...g, inW });
+ const xa = g.px - g.rt / 2 - 3; // bracket centre, against the rail's inner face
+ const barW = 2 * (xa - 3);
+ const armH = 230, armY = KING_RUNNER_Y - 20 + armH / 2;
+ const zs = [z1, z2];
+ zs.forEach((z, i) => {
+ parts.push(box(`BAR${i}`, "Drawer bar", [barW, 40, 20], [0, KING_RUNNER_Y, z], "metal"));
+ for (const sx of [-1, 1]) parts.push(box(`ARM${i}${sx}`, "Hanging bracket", [6, armH, 50], [sx * xa, armY, z], "metal"));
+ });
+ const barIds = [0, 1].flatMap((i) => [`BAR${i}`, `ARM${i}-1`, `ARM${i}1`]);
+ const scene = (id: string): Vec3 => {
+ const p = parts.find((q) => q.id === id)!.pos;
+ const i = Number(id.replace(/\D/g, "").slice(0, 1));
+ return [p[0], p[1], (i - 0.5) * 320];
+ };
+ const ends = list.filter((r) => r.on === "HR" || r.on === "FB");
+ const onBars = list.filter((r) => r.on.startsWith("BAR"));
+ const hangY = 280, screwY = 240;
+ return [
+ {
+ title: "Screw a runner inside the head rail",
+ detail: "On the left, low down, its front end at the side rail. Three screws.",
+ kind: "runners",
+ fit: [ends[0].runner, ends[0].screws],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw a runner inside the footboard",
+ detail: "The same way, on the right.",
+ kind: "runners",
+ fit: [ends[1].runner, ends[1].screws],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the hanging brackets onto the bars",
+ detail: "Lay both bars on the rug. One bracket on each end, two screws each.",
+ kind: "screws",
+ scene: "bars",
+ stage: barIds.map((id) => ({ id, pos: scene(id) })),
+ fit: zs.flatMap((z, i) => [-1, 1].map((sx) => fit(ARM_SCREW, [-8, 8].map((dy) => [sx * (xa + 3), KING_RUNNER_Y + dy, z] as Vec3), [-sx, 0, 0], { on: `ARM${i}${sx}`, mate: `BAR${i}` }))),
+ tools: ["screwdriver"],
+ warnings: ["floor"],
+ },
+ {
+ title: "Screw the runners onto the bars",
+ detail: "Six runners: the first bar takes three, the second bar three, each facing the drawer it carries.",
+ kind: "runners",
+ scene: "bars",
+ fit: onBars.flatMap((r) => [r.runner, r.screws]),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Hang the bars inside the side rails",
+ detail: "Screw the hanging studs into the rails, hook each bracket over its stud, then fix it with a screw.",
+ kind: "screws",
+ pre: [-1, 1].map((sx) => fit(HANG_STUD, zs.map((z) => [sx * (g.px - g.rt / 2), hangY, z] as Vec3), [sx, 0, 0], { on: `SR${sx}` })),
+ add: barIds,
+ from: [0, 260, 0],
+ fit: [-1, 1].flatMap((sx) => zs.map((z, i) => fit(ARM_SCREW, [[sx * (xa - 3), screwY, z]], [sx, 0, 0], { on: `ARM${i}${sx}`, mate: `SR${sx}` }))),
+ tools: ["screwdriver"],
+ },
+ ];
+}
+
+/** The king's four drawers: built on their fronts, then pushed onto the runners from the sides of the bed. */
+function kingDrawers(b: PlanBuilder, g: { px: number; pz: number; inW: number; y0: number; rt: number }) {
+ const { dws } = kingLayout(g);
+ const { xo, bd } = kingRunners(g);
+ const dh = g.y0 - 30, sh = dh - 40;
+ const lim = g.pz - 34; // the fronts stay clear of the posts
+ const parts: Part[] = [];
+ const geo = dws.map((d) => {
+ const z0 = d.a.z + 14, z1 = d.c.z - 14, bw = z1 - z0, zc = (z0 + z1) / 2;
+ const f0 = Math.max(d.a.z - 6, -lim), f1 = Math.min(d.c.z + 6, lim);
+ const xin = (o: number) => d.sx * (xo - o); // o mm in from the bed's side
+ parts.push(box(`F${d.i}`, "Drawer front", [18, dh - 6, f1 - f0], [xin(9), 30 + dh / 2, (f0 + f1) / 2]));
+ parts.push(box(`L${d.i}`, "Drawer side", [bd, sh, 12], [xin(18 + bd / 2), 40 + sh / 2, z0 + 6]));
+ parts.push(box(`R${d.i}`, "Drawer side", [bd, sh, 12], [xin(18 + bd / 2), 40 + sh / 2, z1 - 6]));
+ parts.push(box(`B${d.i}`, "Drawer bottom", [bd - 12, 3, bw - 12], [xin(18 + bd / 2), 44, zc], "fiber"));
+ parts.push(box(`K${d.i}`, "Drawer back", [12, sh - 12, bw - 24], [xin(18 + bd - 6), 46 + (sh - 12) / 2, zc]));
+ return { ...d, z0, z1, xin };
+ });
+ const ys = [40 + sh / 2 - 30, 40 + sh / 2 + 30];
+ const joins = (d: (typeof geo)[number]): Fit[] => [
+ fit(DRAWER_PIN, [d.z0 + 6, d.z1 - 6].flatMap((z) => ys.map((y) => [d.xin(18), y, z] as Vec3)), [d.sx, 0, 0], { on: `F${d.i}` }),
+ fit(HW.cam, [d.z0 + 6, d.z1 - 6].flatMap((z) => ys.map((y) => [d.xin(48), y, z] as Vec3)), [0, 1, 0], { on: `L${d.i}` }),
+ ];
+ const c0 = parts.find((p) => p.id === "F0")!.pos;
+ const rel = (id: string): Vec3 => {
+ const p = parts.find((q) => q.id === id)!.pos;
+ return [p[0] - c0[0], p[1] - c0[1], p[2] - c0[2]];
+ };
+ const ids = (i: number) => [`F${i}`, `L${i}`, `R${i}`, `B${i}`, `K${i}`];
+ const from: Record<string, Vec3> = {};
+ for (const d of geo) for (const id of ids(d.i)) from[id] = [d.sx * 520, 0, 0];
+ const steps: St[] = [
+ {
+ title: "Build the drawers on their fronts",
+ detail: "Pins into the front, sides onto them, bottom down the grooves, back across the ends. Turn the four cam locks.",
+ kind: "cams",
+ scene: "drawer",
+ pose: "+y",
+ stage: ids(0).map((id) => ({ id, pos: rel(id) })),
+ fit: joins(geo[0]),
+ tools: ["screwdriver"],
+ repeat: 4,
+ warnings: ["floor"],
+ },
+ {
+ title: "Put in all four drawers",
+ detail: "From the sides of the bed: pull the runners out, set each drawer on them and push it in until the locks click.",
+ kind: "drawer",
+ scene: "main",
+ pose: "+y",
+ add: geo.flatMap((d) => ids(d.i)),
+ from,
+ preset: geo.slice(1).flatMap((d) => joins(d).map((f) => ({ ...f, hole: false as const }))),
+ fit: geo.map((d) => fit(RUNNER_CLIP, [d.z0 + 6, d.z1 - 6].map((z) => [d.xin(40), 40, z] as Vec3), [0, 1, 0], { on: `B${d.i}`, hole: false })),
+ },
+ ];
+ run(b, parts, steps);
+}
+
/** Two drawers under one side rail, at the foot end, on runners screwed to three supports. */
function bedDrawers(b: PlanBuilder, g: { px: number; pz: number; inD: number; y0: number; rt: number; pd: number }) {
const { px, inD, y0, rt } = g;
const depth = 560, dh = y0 - 30;
const xo = px + rt / 2; // outer face of the right rail
const len = inD / 2 - 60; // two drawers along the foot half
- const z0 = 40;
+ const z0 = inD / 2 - 60 - len; // the last support stays clear of the footboard and under the beam
const zs = [z0, z0 + len / 2 + 9, z0 + len + 18];
- const parts: Part[] = zs.map((z, i) => box(`SP${i}`, "Drawer support", [depth, dh, 18], [xo - rt - depth / 2, 30 + dh / 2, z]));
+ // each support runs from the side rail to under the centre beam, so both ends have something to screw into
+ const sl = Math.max(depth, xo - rt + 20);
+ const parts: Part[] = zs.map((z, i) => box(`SP${i}`, "Drawer support", [sl, dh, 18], [xo - rt - sl / 2, 30 + dh / 2, z]));
const dws = [0, 1].map((i) => ({ i, z: (zs[i] + zs[i + 1]) / 2, w: zs[i + 1] - zs[i] - 18 - 20 }));
for (const d of dws) {
const sh = dh - 40, bw = d.w, bd = depth - 40;
@@ -1708,7 +1894,7 @@ function bedDrawers(b: PlanBuilder, g: { px: number; pz: number; inD: number; y0
pose: "+y",
add: zs.map((_, i) => `SP${i}`),
from: [0, -200, 0],
- fit: [fit(STRIP_SCREW, zs.flatMap((z) => [[xo - rt - 10, 30 + dh, z], [xo - rt - depth + 10, 30 + dh, z]] as Vec3[]), [0, 1, 0])],
+ fit: [fit(STRIP_SCREW, zs.flatMap((z) => [[xo - rt - 10, 30 + dh - 12, z], [0, 30 + dh - 12, z]] as Vec3[]), [0, 1, 0])],
tools: ["screwdriver"],
},
{
@@ -1956,7 +2142,7 @@ function bedCfg(s: ProductSpec): BedCfg | null {
case "tonstad-bed-frame-standard-double-135-x-190":
return { W, D, H, slats: true, storage: false, beamLegs: 1 };
case "tonstad-bed-frame-storage-standard-king-150-x-20":
- return { W, D, H, slats: true, storage: true, beamLegs: 1 };
+ return { W, D, H, slats: true, storage: true, beamLegs: 1, drawers4: true };
}
return null;
}
diff --git a/src/lib/plan/families/tornsborg.ts b/src/lib/plan/families/tornsborg.ts
index 1b1715f..049e8f8 100644
--- a/src/lib/plan/families/tornsborg.ts
+++ b/src/lib/plan/families/tornsborg.ts
@@ -31,7 +31,7 @@ function recipe(s: ProductSpec): CustomParams | null {
const xin = xb - 10; // inner face of the side boards
const yRail = 400, yBar = 200;
const zBars = [zb + 150, zf - 140];
- const bw = 2 * xin - 20; // the bed unit
+ const bw = 2 * (xin - 40) - 6; // the bed unit, between the blocks
const zBed0 = zb + 40, zBed1 = D / 2 - 30;
const parts: CustomPart[] = [];
@@ -59,8 +59,9 @@ function recipe(s: ProductSpec): CustomParams | null {
const legsOf = (sx: number) => SIDES.map((sz) => leg(sx, sz));
const tops = legs((sx, z) => [sx * xs, legH, z]);
const plates = legs((sx, z) => [sx * (xs - 25), legH - 30, z]);
+ const plateScrews = plates.map((p): Vec3 => [p[0], p[1] - 25, p[2]]); // through the plate's lower hole
const boardBolts = SIDES.flatMap((sx) => [zf, zb].flatMap((z) => [110, 230].map((y): Vec3 => [sx * (xin), y, z])));
- const blockBolts = SIDES.flatMap((sx) => [-25, 25].map((dz): Vec3 => [sx * (xin - 40), 280, zBlock + dz]));
+ const blockBolts = (sx: number) => [-25, 25].map((dz): Vec3 => [sx * (xin - 40), 250, zBlock + dz]);
const camPins = (sx: number): Vec3[] => [yRail - 35, yRail + 35].map((y): Vec3 => [sx * (xs - 25), y, zb]);
const camLocks = (sx: number): Vec3[] => [yRail - 35, yRail + 35].map((y): Vec3 => [sx * (xs - 55), y, zb - 10]);
const barBolts = SIDES.flatMap((sx) => zBars.flatMap((z) => [-18, 18].map((dz): Vec3 => [sx * xin, yBar, z + dz])));
@@ -83,7 +84,7 @@ function recipe(s: ProductSpec): CustomParams | null {
detail: "Flat side against the leg, next to the dowel. One screw in each.",
fix: SIDES.flatMap((sx) => {
const pts = plates.filter((p) => Math.sign(p[0]) === sx);
- return [fx("plate", pts, { name: "Joining plate", len: 3, dia: 40, dir: [sx, 0, 0] }), fx("screw", pts, { len: 40, dia: 5, dir: [sx, 0, 0] })];
+ return [fx("plate", pts, { name: "Joining plate", len: 3, dia: 40, dir: [sx, 0, 0] }), fx("screw", plateScrews.filter((p) => Math.sign(p[0]) === sx), { len: 40, dia: 5, dir: [sx, 0, 0] })];
}),
tools: ["allen"],
},
@@ -91,9 +92,9 @@ function recipe(s: ProductSpec): CustomParams | null {
title: "Fix a block onto each side board",
detail: "A short dowel goes under each block. The two boards are mirror images, so check which side the block goes.",
add: ["Bl", "Kl", "Br", "Kr"],
- fix: SIDES.map((sx) => fx("dowel", [[sx * (xin - 40), 250, zBlock]], { len: 30, dia: 8, dir: [sx, 0, 0], on: `K${side(sx)}`, mate: `B${side(sx)}` })),
+ fix: SIDES.map((sx) => fx("dowel", [[sx * xin, 250, zBlock]], { len: 30, dia: 8, dir: [-sx, 0, 0], on: `K${side(sx)}`, mate: `B${side(sx)}` })),
},
- { title: "Bolt the blocks down", detail: "Two long bolts through each block, with the small Allen key.", fix: [fx("bolt", blockBolts, { len: 70, dia: 6, dir: [1, 0, 0] })], tools: ["allen"] },
+ { title: "Bolt the blocks down", detail: "Two long bolts through each block, with the small Allen key.", fix: SIDES.map((sx) => fx("bolt", blockBolts(sx), { len: 70, dia: 6, dir: [sx, 0, 0], on: `K${side(sx)}`, mate: `B${side(sx)}` })), tools: ["allen"] },
{
title: "Bolt the side boards across the legs",
detail: "Two bolts at each leg. Tighten them with the T-handle until the head sits flat, not sunk in.",
@@ -135,11 +136,12 @@ function recipe(s: ProductSpec): CustomParams | null {
{
title: "Screw the two hooks under the bed unit",
detail: "Lay the bed unit upside down on the rug first. One screw through each hook, with the T-handle.",
- add: ["BED"],
+ wait: ["BED"],
+ from: { BED: [0, 150, 600] },
fix: [fx("hook", hooks, { name: "Hook bracket", len: 40, dia: 30, dir: UP, on: "BED" }), fx("screw", hooks, { len: 40, dia: 6, dir: UP, on: "BED" })],
tools: ["allen"],
},
- { title: "Hang the bed unit on the back crossbar", detail: "Lower it into the frame so both hooks drop over the bar.", people: 2, warnings: ["two"] },
+ { title: "Hang the bed unit on the back crossbar", detail: "Turn it the right way up and lower it into the frame so both hooks drop over the bar.", add: ["BED"], from: { BED: [0, 150, 600] }, people: 2, warnings: ["two"] },
{ title: "Lock the hooks with clips", detail: "Push a clip up under each hook until it clicks.", fix: [fx("clip", hooks, { name: "Locking clip", len: 30, dia: 30, dir: UP })] },
{ title: "Stick felt pads on the fold-out legs", detail: "Use the round pads on the tops where the legs fold against the frame.", fix: [fx("glide", feet.map((p): Vec3 => [p[0], p[1] + 40, p[2]]), { name: "Felt pad", dir: UP })] },
{
diff --git a/src/lib/plan/families/tornviken.ts b/src/lib/plan/families/tornviken.ts
index 5a456cd..00ad91f 100644
--- a/src/lib/plan/families/tornviken.ts
+++ b/src/lib/plan/families/tornviken.ts
@@ -323,7 +323,8 @@ function island(s: ProductSpec): CustomParams {
detail,
add: [`F${i}`],
fix: endDowels(`F${i}`, [[yF[i], zF]]),
- from: { [`F${i}`]: [0, 0, 320] },
+ // slid in from the open end, along its dowels and onto the frame's cam bolt
+ from: { [`F${i}`]: [-320, 0, 0] },
tools: ["hammer"],
});
const brackets: Vec3[] = yS.flatMap((y) => [-300, 300].map((x) => [x, y - 9 - 15, zF - 10 - 12] as Vec3));
@@ -428,7 +429,7 @@ function island(s: ProductSpec): CustomParams {
fx("dowel", [-300, 300].map((x) => [x, yBB, zK - KT / 2] as Vec3), [0, 0, -1], { len: 20, dia: 8, name: "Short dowel", on: "BB", mate: "K" }),
fx("screw", [-400, 0, 400].map((x) => [x, yBB, zBB - 10] as Vec3), [0, 0, 1], { len: 30, dia: 5, on: "BB", mate: "K" }),
],
- from: { BB: [-300, 0, 0] },
+ from: { BB: [0, 0, -300] },
tools: ["hammer", "screwdriver"],
},
front(2, "Push in the top front rail", "Turn it round so the shelves face you. A dowel in each end of the rail, then push it in level with the top."),
diff --git a/src/lib/plan/families/torparo.ts b/src/lib/plan/families/torparo.ts
index 188af68..e9c6a40 100644
--- a/src/lib/plan/families/torparo.ts
+++ b/src/lib/plan/families/torparo.ts
@@ -71,7 +71,7 @@ function chair(s: ProductSpec): CustomParams {
kind: "bolt",
count: 2,
...BOLT,
- at: [sx * (xi - 12), sx * (xi - 32)].map((x): Vec3 => [x, yRail + (dir[1] < 0 ? 10 : -10), z]),
+ at: [sx * (xi - 10), sx * (xi - 34)].map((x): Vec3 => [x, yRail + (dir[1] < 0 ? 10 : -10), z]),
dir,
on: rail,
mate: side,
diff --git a/src/lib/plan/families/tossberg.ts b/src/lib/plan/families/tossberg.ts
index e7d9098..5245b3d 100644
--- a/src/lib/plan/families/tossberg.ts
+++ b/src/lib/plan/families/tossberg.ts
@@ -256,7 +256,7 @@ function swivel(b: PlanBuilder, s: ProductSpec, malskar: boolean) {
b.then(0.1);
b.stage(under[1], b.partItem(under[1]).final.pos, [0, 0, 0], [0, -200, 0]);
b.then(0.1);
- b.fits(BOLT, [-1, 1].map((sx) => ({ on: under[1], at: [sx * 75, shellBot - 57, zs + sx * 70] as Vec3, dir: [0, 1, 0] as Vec3, mate: under[0] })), 0.1);
+ b.fits(BOLT, [-1, 1].map((sx) => ({ on: under[1], at: [sx * 50, shellBot - 57, zs + sx * 60] as Vec3, dir: [0, 1, 0] as Vec3, mate: under[0] })), 0.1);
}, "plate");
b.step({ title: "Tighten all four bolts", detail: "Now that everything sits square, tighten them firmly until the heads are flat.", tools: ["allen"], scene: "plate", pose: "-y", kind: "bolts" }, () => {
b.stagger(0);
diff --git a/src/lib/plan/families/tranno.ts b/src/lib/plan/families/tranno.ts
new file mode 100644
index 0000000..cef313d
--- /dev/null
+++ b/src/lib/plan/families/tranno.ts
@@ -0,0 +1,44 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * TRÄNNÖ stool. IKEA sells it ready assembled (its page says so and has no assembly instructions): a white steel
+ * frame of four splayed legs and an apron, with a solid pine seat that has a handle cut through it. The guide
+ * only unpacks it and shows how it stacks.
+ */
+
+function stool(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10 || 330, H = s.size.h * 10 || 450;
+ const ST = 20, top = H - ST;
+ const seat = W - 30, L = 34, apron = 70;
+ const c: Vec3 = [0, top / 2, 0];
+ const legs: PartPiece[] = [-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz): PartPiece => {
+ // each leg leans out a little towards its corner
+ const xt = sx * (seat / 2 - L / 2), zt = sz * (seat / 2 - L / 2);
+ const xb = sx * (W / 2 - L / 2), zb = sz * (W / 2 - L / 2);
+ const len = Math.hypot(top, xb - xt, zb - zt);
+ return { shape: "box", size: [L, len, L], pos: [(xt + xb) / 2, 0, (zt + zb) / 2], rot: [Math.atan2(zt - zb, top), 0, Math.atan2(xb - xt, top)] };
+ }),
+ );
+ const aprons: PartPiece[] = [
+ ...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [seat - 2 * L, apron, 2], pos: [0, top / 2 - apron / 2, sz * (seat / 2 - 1)] })),
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [2, apron, seat - 2 * L], pos: [sx * (seat / 2 - 1), top / 2 - apron / 2, 0] })),
+ ];
+ return {
+ parts: [
+ { id: "F", name: "Frame", size: [W, top, W], pos: c, pieces: [...legs, ...aprons], material: "metal" },
+ { id: "S", name: "Seat", size: [seat, ST, seat], pos: [0, H - ST / 2, 0], pieces: [{ shape: "slab", size: [seat, ST, seat], pos: [0, 0, 0], outline: [[-seat / 2, -seat / 2], [seat / 2, -seat / 2], [seat / 2, seat / 2], [-seat / 2, seat / 2]], round: 30 }], material: "wood" },
+ ],
+ steps: [
+ { title: "Unpack the stool", detail: "It comes ready assembled, so there is nothing to put together. Cut the wrapping carefully so the knife can't mark the seat.", add: ["F", "S"], from: { S: [0, 0, 0] } },
+ { title: "Stack them if you need to", detail: "Up to four stools, each lowered straight onto the seat of the one below. It's for indoor use only." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["TRÄNNÖ", "TRANNO"],
+ recipe: (s) => (/^tranno-stool/.test(s.slug ?? "") ? stool(s) : null),
+};
+export default family;
diff --git a/src/lib/plan/families/travsport.ts b/src/lib/plan/families/travsport.ts
index 70bd32d..ced6066 100644
--- a/src/lib/plan/families/travsport.ts
+++ b/src/lib/plan/families/travsport.ts
@@ -89,7 +89,8 @@ function recipe(s: ProductSpec): CustomParams {
count: 5,
len: 60,
dia: 6,
- at: [...pairs(blocksX[0], under, zSh, 40), [blocksX[1], under, zSh], ...pairs(blocksX[2], under, zSh, 40)],
+ // the middle one beside the block's dowel, not under it
+ at: [...pairs(blocksX[0], under, zSh, 40), [blocksX[1], under, zSh + 40], ...pairs(blocksX[2], under, zSh, 40)],
dir: [0, 1, 0],
on: "TP",
mate: "K1",
@@ -109,7 +110,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "The brackets are marked L and R. Two flat screws in each, turned in with the Allen key, then four bolts screwed into them by hand.",
fix: [
...[-1, 1].map((sx): CustomFix => ({ kind: "bolt", name: "Flat screw", count: 2, len: 16, dia: 6, at: pairs(sx * xC, yFoot + footH / 2, 0, 20), dir: [0, -1, 0], on: sx < 0 ? "F1" : "F2" })),
- { kind: "bolt", count: 4, len: 16, dia: 8, at: [-1, 1].flatMap((sx) => pairs(sx * xC, yFoot + footH / 2, 0, 30)), dir: [0, -1, 0] },
+ { kind: "bolt", count: 4, len: 16, dia: 8, at: [-1, 1].flatMap((sx) => pairs(sx * xC, yFoot + footH / 2, 0, 60)), dir: [0, -1, 0] },
],
},
{ title: "Bolt the columns onto the brackets", detail: "Six bolts in each column, then tighten the four bracket bolts too.", add: ["C1", "C2"], fix: [colBolts(-1), colBolts(1)] },
diff --git a/src/lib/plan/families/treasjon.ts b/src/lib/plan/families/treasjon.ts
index fe5c918..2daf4ee 100644
--- a/src/lib/plan/families/treasjon.ts
+++ b/src/lib/plan/families/treasjon.ts
@@ -49,7 +49,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Lay the top and bottom on a rug. A hanger goes in each back corner of the top, two screws each. Stick the two bumper pads on the back edge of the bottom.",
fix: [
{ kind: "angle", name: "Wall hanger", count: 2, at: hangers, dir: [0, 1, 0], on: "T" },
- { kind: "screw", count: 4, len: 12, dia: 4, at: hangers.flatMap((p) => [-12, 12].map((dx): Vec3 => [p[0] + dx, yHi, p[2]])), dir: [0, 1, 0], on: "T" },
+ { kind: "screw", count: 4, len: 12, dia: 4, at: hangers.flatMap((p) => [-24, 24].map((dx): Vec3 => [p[0] + dx, yHi, p[2]])), dir: [0, 1, 0], on: "T" },
{ kind: "glide", name: "Bumper pad", count: 2, at: [-1, 1].map((sx): Vec3 => [sx * (W / 2 - 60), t / 2, zB]), dir: [0, 0, 1], on: "B" },
],
wait: ["T", "B"],
diff --git a/src/lib/plan/families/trofast.ts b/src/lib/plan/families/trofast.ts
index 23f8985..f038737 100644
--- a/src/lib/plan/families/trofast.ts
+++ b/src/lib/plan/families/trofast.ts
@@ -358,7 +358,7 @@ function pineTriple(k: Kit, W: number, H: number, D: number, roomDivider: boolea
tools: ["hammer", "allen"],
pose: "+z",
});
- k.steps.push({ title: "Slide on the top panel", detail: "Four dowels in each end, then push it down onto the dividers' dowels.", add: ["TP"], fix: [k.endDowels("TP", -1, 4, "L"), k.endDowels("TP", 1, 4, "R")], tools: ["hammer"] });
+ k.steps.push({ title: "Slide on the top panel", detail: "Four dowels in each end. Angle it into the side first, then lower it onto the dividers' dowels.", add: ["TP"], from: { TP: [220, 220, 0] }, fix: [k.endDowels("TP", -1, 4, "L"), k.endDowels("TP", 1, 4, "R")], tools: ["hammer"] });
k.steps.push({ title: "Fit the top rails", detail: "One dowel in each end, then slide them onto the top panel's edges.", add: ["TF", "TK"], fix: ["TF", "TK"].flatMap((r) => [k.endDowels(r, -1, 1, "L"), k.endDowels(r, 1, 1, "R")]), tools: ["hammer"] });
k.steps.push({ title: "Screw the top to the side", detail: "Three screws through the side into the top panel and its rails.", fix: [k.through("L", "TP", 1), k.through("L", "TF", 1), k.through("L", "TK", 1)], tools: ["allen"] });
k.steps.push({
@@ -493,7 +493,8 @@ function whiteTriple(k: Kit, W: number, H: number, D: number) {
k.steps.push({
title: "Join the dividers with the two middle rails",
detail: "Upside down on a rug. Two big dowels in each rail end, then push the dividers on.",
- add: ["V1", "V2", ...midRails],
+ add: [...midRails, "V1", "V2"],
+ from: { A1F: [0, 0, 0], A1K: [0, 0, 0] },
fix: midRails.flatMap((r) => [{ ...k.endDowels(r, -1, 2, "V1"), ...BIG }, { ...k.endDowels(r, 1, 2, "V2"), ...BIG }]),
tools: ["hammer"],
pose: "-y",
@@ -559,6 +560,7 @@ function whiteStepped(k: Kit, W: number, H: number, D: number) {
detail: "Lay the side on its back edge on a rug. Tap four dowels into each end of the top, push it on and turn one screw through the side.",
add: ["L", "T0P"],
fix: [...topDowels(0), k.through("L", "T0P", 1)],
+ from: { L: [0, 0, 0], T0P: [300, 0, 0] },
tools: ["hammer", "allen"],
pose: "+z",
warnings: ["floor"],
@@ -571,9 +573,9 @@ function whiteStepped(k: Kit, W: number, H: number, D: number) {
k.steps.push({ title: "Screw the low top to the divider", detail: "Four dowels in each end, then one screw.", add: ["T2P"], fix: [...topDowels(2), k.through("V2", "T2P", 1)], tools: ["hammer", "allen"] });
k.steps.push({ title: "Fit its rails", detail: "A dowel in each end, then one screw through the divider into each.", add: ["T2F", "T2K"], fix: [...railDowels(2), k.through("V2", "T2F", 1), k.through("V2", "T2K", 1)], tools: ["hammer", "allen"] });
k.steps.push({ title: "Tap dowels into the bottom of the dividers", detail: "Two in each.", fix: [k.uprightDowels("V1", -1, 2, "BP"), k.uprightDowels("V2", -1, 2, "BP")], tools: ["hammer"] });
- k.steps.push({ title: "Lay the bottom on", detail: "Tap two dowels into each end, then swing it onto the dividers' dowels.", add: ["BP"], fix: [k.endDowels("BP", -1, 2, "L"), k.endDowels("BP", 1, 2, "R")], tools: ["hammer"] });
+ k.steps.push({ title: "Lay the bottom on", detail: "Tap two dowels into each end, then swing it onto the dividers' dowels.", add: ["BP"], from: { BP: [220, 220, 0] }, fix: [k.endDowels("BP", -1, 2, "L"), k.endDowels("BP", 1, 2, "R")], tools: ["hammer"] });
k.steps.push({ title: "Screw the bottom to the dividers", detail: "Two screws into each.", fix: [k.throughPanel("BP", "V1", 2), k.throughPanel("BP", "V2", 2)], tools: ["allen"] });
- k.steps.push({ title: "Swing the long rails on", detail: "Four dowels in each first: one in each end and two along the top edge. They go front and back, under the bottom.", add: ["BF", "BK"], fix: ["BF", "BK"].flatMap((r) => [k.endDowels(r, -1, 1, "L"), k.endDowels(r, 1, 1, "R"), k.fx("dowel", r, [c.xs[1], c.xs[2]].map((x) => [x, RH, k.mid(r, 2)] as Vec3), [0, -1, 0], "BP")]), tools: ["hammer"] });
+ k.steps.push({ title: "Swing the long rails on", detail: "Four dowels in each first: one in each end and two along the top edge. They go front and back, under the bottom.", add: ["BF", "BK"], from: { BF: [220, -220, 0], BK: [220, -220, 0] }, fix: ["BF", "BK"].flatMap((r) => [k.endDowels(r, -1, 1, "L"), k.endDowels(r, 1, 1, "R"), k.fx("dowel", r, [c.xs[1], c.xs[2]].map((x) => [x, RH, k.mid(r, 2)] as Vec3), [0, -1, 0], "BP")]), tools: ["hammer"] });
k.steps.push({
title: "Screw on the low side",
detail: "Nine screws through it into the low top, its rails, the bottom and the long rails.",
@@ -640,7 +642,7 @@ function wallStorage(k: Kit, W: number, H: number, D: number, white: boolean) {
});
k.steps.push({ title: "Screw the bottom to the dividers", detail: "Two screws into each, from underneath.", fix: [k.throughPanel("BP", "V1", 2), k.throughPanel("BP", "V2", 2)], tools: ["allen"] });
k.steps.push({ title: "Fit the top", detail: "Two dowels in the top end of each divider, then press the top on.", add: ["TP"], fix: [k.uprightDowels("V1", 1, 2, "TP"), k.uprightDowels("V2", 1, 2, "TP")], tools: ["hammer"] });
- k.steps.push({ title: "Screw the top to the dividers", detail: white ? "Two screws into each." : "One screw into each.", fix: [k.throughPanel("TP", "V1", white ? 2 : 1), k.throughPanel("TP", "V2", white ? 2 : 1)], tools: ["allen"] });
+ k.steps.push({ title: "Screw the top to the dividers", detail: white ? "Two screws into each." : "One screw into each.", fix: white ? [k.throughPanel("TP", "V1", 2), k.throughPanel("TP", "V2", 2)] : ["V1", "V2"].map((v) => k.fx("bolt", "TP", [[k.mid(v, 0), H, 0]], [0, -1, 0], v, BOLT)), tools: ["allen"] });
const ends = ["TP", "BP"];
if (!white) k.steps.push(fittings);
k.steps.push({
@@ -687,74 +689,70 @@ function deskRecipe(k: Kit, s: ProductSpec) {
const a = pineSingle(k, fw, H, D, { ox: -ox, p: "a", block: true, steps: false });
const b = pineSingle(k, fw, H, D, { ox, p: "b", block: true, steps: false });
const gap = W - 2 * fw;
- // the middle top: a panel in two grooved rails, as the frames' own tops
- k.part("MP", "Desk top panel", [gap, PT, D - 2 * RT], [0, H - PT / 2, 0]);
- k.part("MF", "Desk top rail", [gap, RH, RT], [0, H - RH / 2, D / 2 - RT / 2]);
- k.part("MK", "Desk top rail", [gap, RH, RT], [0, H - RH / 2, -D / 2 + RT / 2]);
- // two flat metal rails under it, their ends turned down against the frames' inner sides
- const zr = [D / 2 - RT - 60, -D / 2 + RT + 60];
+ // the middle top: one board between the frames' tops
+ k.part("MP", "Desk top", [gap, PT, D], [0, H - PT / 2, 0]);
+ // two flat metal rails under its front and back edges, their ends turned down against the frames' inner sides,
+ // held by the inner sides' top screws that go back in through them
+ const zr = [D / 2 - 15, -D / 2 + 15], zt = [D / 2 - RT / 2, -D / 2 + RT / 2];
zr.forEach((z, i) => k.part(`M${i}`, "Metal rail", [gap, 4, 30], [0, H - PT - 2, z], { mat: "metal", pieces: [
{ shape: "box", size: [gap, 4, 30], pos: [0, 0, 0] },
{ shape: "box", size: [3, 40, 30], pos: [-gap / 2 + 1.5, -20, 0] },
{ shape: "box", size: [3, 40, 30], pos: [gap / 2 - 1.5, -20, 0] },
] }));
// the low stretcher at the back on two corner brackets
- const ys = 150, zs = -D / 2 + 40;
+ const ys = 60, zs = -D / 2 + 40;
k.part("ST", "Stretcher", [gap, 50, 18], [0, ys, zs]);
const aIn = "aR", bIn = "bL"; // the inner sides
const xa = k.bx(aIn).max[0], xb = k.bx(bIn).min[0];
- const frameSteps = () => {
- k.steps.push({ title: "Screw a runner block onto each frame side", detail: "Two frames make the desk; build the first one now. Lay both its sides on a rug, runners up, and screw a block along each top end.", add: ["aL", "aKL"], fix: [a.blockScrews("L")], tools: ["screwdriver"], pose: "+x", warnings: ["floor"], repeat: 2 });
- k.steps.push({ title: "Tap dowels into both ends of the rails", detail: "Two in each end, sixteen in all.", add: ["aTF", "aTK", "aBF", "aBK"], fix: a.dowelsAll(2), tools: ["hammer"] });
- k.steps.push({ title: "Slide the panels into the rails and stand them on a side", detail: "The groove in each rail takes the panel's edge, rails facing out.", add: ["aTP", "aBP"] });
- k.steps.push({ title: "Lay the other side on top", detail: "Runners and block facing down, onto all the dowels.", add: ["aR", "aKR"], fix: [a.blockScrews("R")], tools: ["screwdriver"] });
- k.steps.push({ title: "Screw the side on", detail: "Six screws through it with the Allen key.", fix: a.sideScrews("R"), tools: ["allen"] });
- k.steps.push({ title: "Turn it over and screw the other side", detail: "Six more screws the same way.", fix: a.sideScrews("L"), tools: ["allen"], pose: "-x" });
- k.steps.push({
- title: "Build the second frame the same way",
- detail: "Blocks, dowels, panels, sides and twelve screws.",
- add: ["bL", "bKL", "bR", "bKR", "bTP", "bBP", "bTF", "bTK", "bBF", "bBK"],
- fix: merged([b.blockScrews("L"), b.blockScrews("R"), ...b.dowelsAll(2), ...b.sideScrews("R"), ...b.sideScrews("L")]),
- tools: ["screwdriver", "hammer", "allen"],
- pose: "+y",
- });
+ // the inner sides' screws into the top rails and the back bottom rail come out again for the desk: leave them for later
+ const kept = (f: CustomFix[], p: string) => f.filter((x) => ![`${p}TF`, `${p}TK`, `${p}BK`].includes(x.mate ?? ""));
+ const frame = (f: typeof a, p: "a" | "b", inner: "L" | "R") => {
+ const outer = inner === "L" ? "R" : "L";
+ const first = p === "a";
+ const id = (x: string) => p + x;
+ k.steps.push({ title: first ? "Screw a runner block onto each frame side" : "Start the second frame the same way", detail: first ? "Two frames make the desk; build the first one now. Lay both its sides on a rug, runners up, and screw a block along each top end." : "A runner block on each of its sides, three screws each.", add: [id("L"), id("KL")], fix: [f.blockScrews("L")], tools: ["screwdriver"], pose: "+x", warnings: ["floor"], repeat: 2 });
+ k.steps.push({ title: "Tap dowels into both ends of the rails", detail: "Two in each end, sixteen in all.", add: [id("TF"), id("TK"), id("BF"), id("BK")], fix: f.dowelsAll(2), tools: ["hammer"] });
+ k.steps.push({ title: "Slide the panels into the rails and stand them on a side", detail: "The groove in each rail takes the panel's edge, rails facing out.", add: [id("TP"), id("BP")] });
+ k.steps.push({ title: "Lay the other side on top", detail: "Runners and block facing down, onto all the dowels.", add: [id("R"), id("KR")], fix: [f.blockScrews("R")], tools: ["screwdriver"] });
+ const screwsR = f.sideScrews("R"), screwsL = f.sideScrews("L");
+ k.steps.push({ title: "Screw the side on", detail: inner === "R" ? "Three screws through it with the Allen key. Leave out the two top corners and the back bottom corner: those screws hold the desk parts later." : "Six screws through it with the Allen key.", fix: inner === "R" ? kept(screwsR, p) : screwsR, tools: ["allen"] });
+ k.steps.push({ title: "Turn it over and screw the other side", detail: inner === "L" ? "Three screws this time. Leave out the two top corners and the back bottom corner: those screws hold the desk parts later." : "Six more screws the same way.", fix: inner === "L" ? kept(screwsL, p) : screwsL, tools: ["allen"], pose: "-x" });
+ void outer;
};
- frameSteps();
- const railEnd = (i: number, side: -1 | 1) => k.fx("bolt", `M${i}`, [[side < 0 ? xa : xb, H - PT - 40, zr[i]]], [side < 0 ? 1 : -1, 0, 0], side < 0 ? aIn : bIn, BOLT);
+ frame(a, "a", "R");
+ frame(b, "b", "L");
+ const railEnd = (i: number, side: -1 | 1) => k.fx("bolt", `M${i}`, [[side < 0 ? xa + 3 : xb - 3, H - 25, zt[i]]], [side < 0 ? -1 : 1, 0, 0], `${side < 0 ? "a" : "b"}T${i ? "K" : "F"}`, BOLT);
const yb = ys;
k.steps.push({
- title: "Take out the inner screws and fit the metal rails",
- detail: "Upside down on the rug, the frames a desk top's width apart. Undo the top screws on the two inner sides and put them back through the rails' turned-down ends.",
+ title: "Fit the metal rails to the first frame",
+ detail: "Stand both frames on the rug, inner sides facing, a desk top's width apart. The saved screws go through the rails' turned-down ends into the top corners.",
add: ["M0", "M1"],
fix: [railEnd(0, -1), railEnd(1, -1)],
tools: ["allen"],
- pose: "-y",
+ pose: "+y",
warnings: ["floor"],
});
- k.steps.push({ title: "Screw the rails to the other frame", detail: "Four screws, two through each rail end. Turn them by hand, not with a drill.", fix: [railEnd(0, 1), railEnd(1, 1), k.fx("bolt", "M0", [[xb, H - PT - 12, zr[0]]], [-1, 0, 0], bIn, BOLT), k.fx("bolt", "M1", [[xb, H - PT - 12, zr[1]]], [-1, 0, 0], bIn, BOLT)], tools: ["allen"] });
+ k.steps.push({ title: "Screw the rails to the other frame", detail: "One screw through each rail end into its top corners. Turn them by hand, not with a drill.", fix: [railEnd(0, 1), railEnd(1, 1)], tools: ["allen"] });
k.steps.push({
title: "Screw on the corner brackets",
- detail: "One low down at the back of each inner side, a long screw each.",
- fix: [k.fx("angle", aIn, [[xa, yb, zs + 20]], [-1, 0, 0]), k.fx("angle", bIn, [[xb, yb, zs + 20]], [1, 0, 0]), k.fx("bolt", aIn, [[xa, yb + 25, zs + 20]], [-1, 0, 0], undefined, BOLT), k.fx("bolt", bIn, [[xb, yb + 25, zs + 20]], [1, 0, 0], undefined, BOLT)],
+ detail: "One low down at the back of each inner side, on the last saved screw, into the back bottom rail.",
+ fix: [k.fx("angle", aIn, [[xa, 40, -D / 2 + 30]], [-1, 0, 0]), k.fx("angle", bIn, [[xb, 40, -D / 2 + 30]], [1, 0, 0]), k.fx("bolt", aIn, [[xa + 3, RH / 2, -D / 2 + RT / 2]], [-1, 0, 0], "aBK", BOLT), k.fx("bolt", bIn, [[xb - 3, RH / 2, -D / 2 + RT / 2]], [1, 0, 0], "bBK", BOLT)],
tools: ["allen"],
});
k.steps.push({
title: "Lay the desk top on the rails",
- detail: "Turn the frames onto their sides, slip the top in between, face down, and screw through the rails into it.",
- add: ["MP", "MF", "MK"],
+ detail: "Lay it on the rails between the frame tops and screw up through the front rail into it.",
+ add: ["MP"],
fix: [k.fx("screw", "M0", [[-gap / 4, H - PT - 4, zr[0]], [gap / 4, H - PT - 4, zr[0]]], [0, 1, 0], "MP", { len: 14, dia: 6 })],
tools: ["screwdriver"],
});
k.steps.push({ title: "Screw the top to the rails", detail: "Four more screws, by hand.", fix: [k.fx("screw", "M1", [-gap / 3, -gap / 9, gap / 9, gap / 3].map((x) => [x, H - PT - 4, zr[1]] as Vec3), [0, 1, 0], "MP", { len: 14, dia: 6 })], tools: ["screwdriver"] });
k.steps.push({
- title: "Stand it up and screw in the stretcher",
- detail: "Turn the desk over onto its feet. The stretcher sits on the two brackets, two screws at each end.",
+ title: "Screw in the stretcher",
+ detail: "The stretcher sits on the two brackets at the back, two screws at each end.",
add: ["ST"],
fix: [k.fx("screw", "ST", [[-gap / 2 + 12, yb + 25, zs], [-gap / 2 + 40, yb + 25, zs], [gap / 2 - 12, yb + 25, zs], [gap / 2 - 40, yb + 25, zs]], [0, -1, 0], undefined, { len: 14, dia: 6 })],
tools: ["screwdriver"],
- pose: "+y",
- people: 2,
- warnings: ["two"],
});
const v = s.variant.toLowerCase();
if (/box|tray/.test(v)) boxesStep(k, [-ox, ox], fw, H, D, /tray/.test(v), /mesh/.test(v));
diff --git a/src/lib/plan/families/trotten.ts b/src/lib/plan/families/trotten.ts
index bc86b77..ff50de2 100644
--- a/src/lib/plan/families/trotten.ts
+++ b/src/lib/plan/families/trotten.ts
@@ -268,7 +268,8 @@ function sitStand(b: PlanBuilder, s: ProductSpec) {
kit.part({ id: "B0", name: "Beam, left half", size: [hl, 50, 70], pos: [-(xl + 30) + hl / 2, yU - 55, 0] });
kit.part({ id: "B1", name: "Beam, right half", size: [hl, 42, 60], pos: [xl + 30 - hl / 2, yU - 55, 0] });
kit.part({ id: "M", name: "Motor", size: [140, 60, 70], pos: [0, yU - 110, 0] });
- if (long) kit.part({ id: "P", name: "Joining plate", size: [200, 4, 70], pos: [0, yU - 28, 0] });
+ // the joining plate is a bent bracket: its foot screwed to the beam halves, its upper face under the top
+ if (long) kit.part({ id: "P", name: "Joining plate", size: [200, 30, 70], pos: [0, yU - 15, 0] });
kit.part({ id: "X", name: "Control box", size: [100, 40, 45], pos: [xl, yU - 50, D / 2 - 90] });
kit.part({ id: "T", name: "Tabletop", size: [W, TT, D], pos: [0, H - TT / 2, 0], material: "board" });
const tw = 2 * xl - 300, zt = -D / 2 + 120;
@@ -311,10 +312,10 @@ function sitStand(b: PlanBuilder, s: ProductSpec) {
kit.step({ title: "Unplug it again", detail: "Keep it unplugged until the top is on." });
kit.step({ title: "Press four rubber pads onto the beam", detail: "They sit between the beam and the top.", fix: [{ def: PAD, at: [-(xl - 120), -xl / 3, xl / 3, xl - 120].map((x) => [x, yU - 30, 0] as Vec3), dir: [0, -1, 0], on: (p) => half(p[0]), flat: true }] });
kit.step({ title: "Lay the top on together", detail: "Face up. The pins under it drop into the holes in the arms.", people: 2, add: [["T", [0, 500, 0]]] });
- kit.step({ title: "Screw the top on from below", detail: `${long ? "Nine" : "Six"} washer screws up through the arms${long ? " and the joining plate" : ""}.`, tools: ["allen"], fix: [{ def: WS, at: [...armPts, ...(long ? [[0, yU - 26, 25] as Vec3] : [])], dir: [0, 1, 0], on: (p) => (Math.abs(p[0]) < 50 ? "P" : `A${idx(p[0])}`), mate: "T" }] });
+ kit.step({ title: "Screw the top on from below", detail: `${long ? "Nine" : "Six"} washer screws up through the arms${long ? " and the joining plate" : ""}.`, tools: ["allen"], fix: [{ def: WS, at: [...armPts, ...(long ? [[0, yU - 4, 25] as Vec3] : [])], dir: [0, 1, 0], on: (p) => (Math.abs(p[0]) < 50 ? "P" : `A${idx(p[0])}`), mate: "T" }] });
kit.step({ title: "Hook the cable tray on and screw one edge", detail: "Four washer screws along its front edge.", tools: ["allen"], add: [["R", [0, -250, 150]]], fix: [{ def: WS, at: trayPts(zt + 60), dir: [0, 1, 0], on: "R", mate: "T" }] });
kit.step({ title: "Swing the tray up and screw the other edge", detail: "Four more washer screws along the back.", tools: ["allen"], fix: [{ def: WS, at: trayPts(zt - 60), dir: [0, 1, 0], on: "R", mate: "T" }] });
- kit.step({ title: "Screw in the four long bolts", detail: "Up through the beam into the top, with the medium Allen key.", kind: "bolts", tools: ["allen"], fix: [{ def: LBOLT, at: sides.flatMap((sx) => sides.map((sz) => [sx * xl * 0.55, yU - 80, sz * 20] as Vec3)), dir: [0, 1, 0], on: (p) => half(p[0]), mate: "T" }] });
+ kit.step({ title: "Screw in the four long bolts", detail: "Up through the beam into the top, with the medium Allen key.", kind: "bolts", tools: ["allen"], fix: [{ def: LBOLT, at: sides.flatMap((sx) => sides.map((sz) => [sx * xl * 0.55, yU - 45, sz * 20] as Vec3)), dir: [0, 1, 0], on: (p) => half(p[0]), mate: "T" }] });
kit.step({ title: "Press the two cable clips in under the top", detail: "Into the slots at the back, for the power cable.", fix: [{ def: CLIP, at: sides.map((sx) => [sx * (xl - 250), yU, -D / 2 + 60] as Vec3), dir: [0, 1, 0], on: "T", flat: true }] });
for (const sx of [-1, 1])
kit.step({
@@ -489,7 +490,7 @@ function doorCab(b: PlanBuilder, s: ProductSpec) {
const c: Vec3 = [0, (yT + H) / 2, 0];
const rel = (id: string) => kit.pos(id).map((v, i) => v - c[i]) as Vec3;
kit.step({ title: "Click the side frames onto the top", detail: "Lay the top face down on a rug. Each frame's corners hook into the slots at its ends.", scene: "top", pose: "-y", warnings: ["floor"], stage: ["TP", "UF0", "UF1"].map((id) => ({ id, at: rel(id) })) });
- kit.step({ title: "Bolt the frames to the top", detail: "Four bolts, one in each corner, with the Allen key.", scene: "top", pose: "-y", kind: "bolts", tools: ["allen"], fix: [{ def: ALLEN, at: sides.flatMap((sx) => sides.map((sz) => [sx * (W / 2), H - TT - 35, sz * (D / 2 - 40)] as Vec3)), dir: (p) => [-Math.sign(p[0]), 0, 0], on: (p) => `UF${idx(p[0])}`, mate: "TP" }] });
+ kit.step({ title: "Bolt the frames to the top", detail: "Four bolts, one in each corner, with the Allen key.", scene: "top", pose: "-y", kind: "bolts", tools: ["allen"], fix: [{ def: ALLEN, at: sides.flatMap((sx) => sides.map((sz) => [sx * (W / 2), H - TT - 12.5, sz * (D / 2 - 40)] as Vec3)), dir: (p) => [-Math.sign(p[0]), 0, 0], on: (p) => `UF${idx(p[0])}`, mate: "TP" }] }); // through the top's folded end into the frame's top rail
kit.step({ title: "Lift the top section onto the cabinet", detail: "Its posts drop into the tops of the side panels. Press until they sit flush.", add: ["TP", "UF0", "UF1"] });
} else {
const c: Vec3 = [0, yO - 10, 0];
diff --git a/src/lib/plan/families/tuffing.ts b/src/lib/plan/families/tuffing.ts
index 74b0d27..6f84562 100644
--- a/src/lib/plan/families/tuffing.ts
+++ b/src/lib/plan/families/tuffing.ts
@@ -176,8 +176,9 @@ function recipe(s: ProductSpec, g: Geo) {
const caps = (x: -1 | 1): CustomFix => ({ kind: "cap", count: 2, name: "Foot plug", len: 20, dia: D, at: sx.map((z) => [x * X, 0, z * Z] as Vec3), dir: [0, 1, 0], on: post(x, -1) });
// the top rails: one rod along the rail and one across, through each post top
const postTop = (x: -1 | 1, z: -1 | 1, mate: string): CustomFix[] => [
- ...pairs([{ at: [x * (L / 2), yTop, z * Z], dir: [-x, 0, 0], on: post(x, z), mate: z < 0 ? "TB" : `T${x < 0 ? "h" : "f"}` }]),
- ...pairs([{ at: [x * X, yTop, z * (W / 2)], dir: [0, 0, -z], on: post(x, z), mate }]),
+ // the two rods cross in the post, one a little above the other
+ ...pairs([{ at: [x * (L / 2), yTop + 11.5, z * Z], dir: [-x, 0, 0], on: post(x, z), mate: z < 0 ? "TB" : `T${x < 0 ? "h" : "f"}` }]),
+ ...pairs([{ at: [x * X, yTop - 11.5, z * (W / 2)], dir: [0, 0, -z], on: post(x, z), mate }]),
];
const cs = (at: Vec3[], on: string, mate: string): CustomFix => ({ kind: "bolt", count: at.length, len: 50, dia: 6, name: "Countersunk bolt", at, dir: [0, 1, 0], on, mate });
const xLeg = (side: -1 | 1) => side * (OPEN / 2 + TD / 2);
@@ -303,7 +304,7 @@ function recipe(s: ProductSpec, g: Geo) {
steps.push({
title: "Bolt the back rails to the back posts",
detail: "Two rods at each end of the top rail and two at each end of the back rail. Hand tight.",
- fix: [...sx.flatMap((x) => railEnd(x, -1, yUc, "U4")), ...sx.flatMap((x) => pairs([-1, 1].map((d) => ({ at: [x * (L / 2), yTop + d * 6, -Z] as Vec3, dir: [-x, 0, 0] as Vec3, on: post(x, -1), mate: "TB" }))))],
+ fix: [...sx.flatMap((x) => railEnd(x, -1, yUc, "U4")), ...sx.flatMap((x) => pairs([-1, 1].map((d) => ({ at: [x * (L / 2), yTop + d * 11.5, -Z] as Vec3, dir: [-x, 0, 0] as Vec3, on: post(x, -1), mate: "TB" }))))],
tools: ["allen"],
});
for (const x of [1, -1] as const) {
diff --git a/src/lib/plan/families/tufjord.ts b/src/lib/plan/families/tufjord.ts
index a067cb9..0f148c2 100644
--- a/src/lib/plan/families/tufjord.ts
+++ b/src/lib/plan/families/tufjord.ts
@@ -32,11 +32,12 @@ function recipe(s: ProductSpec): CustomParams {
const base = (sx: number): CustomPart => {
const bw = half - 6, n = 26;
const pieces: PartPiece[] = [
- ...[-1, 1].map((k) => ({ shape: "box" as const, size: [30, 30, ML - 20] as Vec3, pos: [k * (bw / 2 - 60), 0, 0] as Vec3 })),
- ...[-1, 0, 1].map((k) => ({ shape: "box" as const, size: [bw - 20, 20, 50] as Vec3, pos: [0, -5, k * (ML / 2 - 60)] as Vec3 })),
- ...Array.from({ length: n }, (_, i) => ({ shape: "box" as const, size: [bw, 8, 55] as Vec3, pos: [0, 19, -ML / 2 + 40 + ((ML - 80) * i) / (n - 1)] as Vec3 })),
+ // the strips lie on the cross rails, the slats on the strips
+ ...[-1, 1].map((k) => ({ shape: "box" as const, size: [30, 30, ML - 20] as Vec3, pos: [k * (bw / 2 - 60), 4, 0] as Vec3 })),
+ ...[-1, 0, 1].map((k) => ({ shape: "box" as const, size: [bw - 20, 20, 50] as Vec3, pos: [0, -21, k * (ML / 2 - 60)] as Vec3 })),
+ ...Array.from({ length: n }, (_, i) => ({ shape: "box" as const, size: [bw, 8, 55] as Vec3, pos: [0, 23, -ML / 2 + 40 + ((ML - 80) * i) / (n - 1)] as Vec3 })),
];
- return { id: sx < 0 ? "LB0" : "LB1", name: "Slatted base", size: [bw, 46, ML - 20], pos: [sx * (half / 2), yBase + 15, (zIn0 + zIn1) / 2], material: "wood", pieces };
+ return { id: sx < 0 ? "LB0" : "LB1", name: "Slatted base", size: [bw, 62, ML - 20], pos: [sx * (half / 2), yBase + 31, (zIn0 + zIn1) / 2], material: "wood", pieces };
};
const parts: CustomPart[] = [
...[-1, 1].map((sx): CustomPart => ({ id: sx < 0 ? "SRL" : "SRR", name: "Side rail", size: [rw, y1 - y0, zEnd - zHB], pos: [sx * xr, yM, (zHB + zEnd) / 2], material: "soft" })),
@@ -60,11 +61,11 @@ function recipe(s: ProductSpec): CustomParams {
...[0, 1].map((i): CustomPart => ({ id: `CB${i}`, name: "Centre beam half", size: [40, 30, ML / 2 - 6], pos: [0, ySS, i ? zIn0 + (3 * ML) / 4 : zIn0 + ML / 4], material: "metal" })),
base(-1),
base(1),
- { id: "MAT", name: "Your mattress", size: [MW, 200, ML], pos: [0, yBase + 38 + 100, (zIn0 + zIn1) / 2], material: "soft", extra: true },
+ { id: "MAT", name: "Your mattress", size: [MW, 200, ML], pos: [0, yBase + 58 + 100, (zIn0 + zIn1) / 2], material: "soft", extra: true },
];
const yB = yM; // bracket bolts sit halfway up the rails
const side = (sx: number) => (sx < 0 ? "SRL" : "SRR");
- const railBolts = (z: number, mate: string) => [-1, 1].map((sx) => fx("bolt", [-40, 40].map((y): Vec3 => [sx * half, yB + y, z + (z < 0 ? 1 : -1) * 2]), [-sx, 0, 0], side(sx), mate, { name: "Countersunk bolt", len: 20, dia: 6 }));
+ const railBolts = (z: number, mate: string) => [-1, 1].map((sx) => fx("bolt", [-25, 25].map((y): Vec3 => [sx * half, yB + y, z + (z < 0 ? 1 : -1) * 2]), [-sx, 0, 0], side(sx), mate, { name: "Countersunk bolt", len: 20, dia: 6 }));
const zMid = (zIn0 + zIn1) / 2;
const steps: CustomStep[] = [
{
@@ -89,7 +90,7 @@ function recipe(s: ProductSpec): CustomParams {
{
title: "Tap dowels into the head rail",
detail: "Turn the side rails onto their legs. Two dowels in each end of the head rail.",
- fix: [-1, 1].map((sx) => fx("dowel", [-40, 40].map((y): Vec3 => [sx * half, yM + y, zHB + hrT / 2]), [sx, 0, 0], "HR", undefined, { len: 30, dia: 8 })),
+ fix: [-1, 1].map((sx) => fx("dowel", [-65, 65].map((y): Vec3 => [sx * half, yM + y, zHB + hrT / 2]), [sx, 0, 0], "HR", undefined, { len: 30, dia: 8 })),
wait: ["HR"],
pose: "+y",
},
@@ -110,10 +111,11 @@ function recipe(s: ProductSpec): CustomParams {
fix: [
...[-1, 1].flatMap((sx) => {
const at = [500, 700, 900].map((y): Vec3 => [sx * (half + 20), y, zBack]);
- return [fx("hook", at, [0, 0, 1], sx < 0 ? "WL" : "WR", undefined, { name: "Hook plate" }), fx("screw", at, [0, 0, 1], sx < 0 ? "WL" : "WR", undefined, { len: 16, dia: 4 })];
+ const sc = at.map((p): Vec3 => [p[0], p[1] + 25, p[2]]);
+ return [fx("hook", at, [0, 0, 1], sx < 0 ? "WL" : "WR", undefined, { name: "Hook plate" }), fx("screw", sc, [0, 0, 1], sx < 0 ? "WL" : "WR", undefined, { len: 16, dia: 4 })];
}),
fx("hook", [450, 850].map((y): Vec3 => [-20, y, zBack]), [0, 0, 1], "HL", undefined, { name: "Hook plate" }),
- fx("screw", [450, 850].map((y): Vec3 => [-20, y, zBack]), [0, 0, 1], "HL", undefined, { len: 16, dia: 4 }),
+ fx("screw", [475, 875].map((y): Vec3 => [-20, y, zBack]), [0, 0, 1], "HL", undefined, { len: 16, dia: 4 }),
],
wait: ["HL", "HRR", "WL", "WR"],
tools: ["screwdriver"],
@@ -156,7 +158,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Four on each rail, one small screw each.",
fix: [-1, 1].flatMap((sx) => {
const at = [zIn0 + 30, zMid - 40, zMid + 40, zIn1 - 30].map((z): Vec3 => [sx * (half - 15), ySS + 15, z]);
- return [fx("clip", at, [0, -1, 0], sx < 0 ? "SSL" : "SSR", undefined, { name: "Stop" }), fx("screw", at, [0, -1, 0], sx < 0 ? "SSL" : "SSR", undefined, { len: 10, dia: 5 })];
+ return [fx("clip", at, [0, -1, 0], sx < 0 ? "SSL" : "SSR", undefined, { name: "Stop" }), fx("screw", at.map((p): Vec3 => [p[0], p[1], p[2] + 25]), [0, -1, 0], sx < 0 ? "SSL" : "SSR", undefined, { len: 10, dia: 5 })];
}),
wait: ["SSL", "SSR"],
from: { SSL: [-900, 0, 0], SSR: [900, 0, 0] },
@@ -190,7 +192,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "For each half, screw the three cross rails between two slat strips, six screws on each strip.",
fix: [-1, 1].map((sx) => {
const bw = half - 6;
- return fx("screw", [-1, 1].flatMap((k) => [-1, 0, 1].flatMap((c) => [-10, 10].map((d): Vec3 => [sx * (half / 2) + k * (bw / 2 - 60), yBase + 30, (zIn0 + zIn1) / 2 + c * (ML / 2 - 60) + d]))), [0, -1, 0], sx < 0 ? "LB0" : "LB1", undefined, { len: 50, dia: 5 });
+ return fx("screw", [-1, 1].flatMap((k) => [-1, 0, 1].flatMap((c) => [-12, 12].map((d): Vec3 => [sx * (half / 2) + k * (bw / 2 - 60), yBase + 50, (zIn0 + zIn1) / 2 + c * (ML / 2 - 60) + d]))), [0, -1, 0], sx < 0 ? "LB0" : "LB1", undefined, { len: 50, dia: 5 });
}),
wait: ["LB0", "LB1"],
from: { LB0: [-1400, 0, 0], LB1: [1400, 0, 0] },
@@ -202,7 +204,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Each one rests on a slat rail and the centre beam, held at the ends by the stops. Two screws with washers fix each one.",
add: ["LB0", "LB1"],
fix: [-1, 1].flatMap((sx) => {
- const at = [zIn0 + 60, zIn1 - 60].map((z): Vec3 => [sx * 30, yBase + 30, z]);
+ const at = [zIn0 + 60, zIn1 - 60].map((z): Vec3 => [sx * 30, yBase + 20, z]);
const on = sx < 0 ? "LB0" : "LB1";
return [fx("screw", at, [0, -1, 0], on, undefined, { len: 16, dia: 4 }), fx("washer", at, [0, -1, 0], on, undefined, { dia: 4 })];
}),
diff --git a/src/lib/plan/families/tyssedal.ts b/src/lib/plan/families/tyssedal.ts
index df3e34d..d435e2a 100644
--- a/src/lib/plan/families/tyssedal.ts
+++ b/src/lib/plan/families/tyssedal.ts
@@ -102,7 +102,7 @@ function recipe(s: ProductSpec): CustomParams {
},
{ title: "Lock them with two cam locks", detail: "Arrow towards the bolt, then turn clockwise.", fix: camLocks(-1, ["BA", "BR"]), tools: ["screwdriver"] },
{ title: "Slide the shelf into the rail's groove", detail: "Smooth side up, all the way to the back rail.", add: ["SH"], from: { SH: [0, 0, 400] } },
- { title: "Fit the front rail", detail: "One dowel in each end, then press it onto the frame and over the shelf's edge.", add: ["FR"], fix: dowels("FR", [yR], zR) },
+ { title: "Fit the front rail", detail: "One dowel in each end, then press it onto the frame and over the shelf's edge.", add: ["FR"], fix: dowels("FR", [yR], zR), from: { FR: [300, 0, 0] } },
{ title: "Lock the front rail", detail: "One cam lock.", fix: camLocks(-1, ["FR"]), tools: ["screwdriver"] },
{ title: "Lower the right frame on top", detail: "Its bolts go into the holes in the apron and rails, the runner on the inside.", add: ["SR"] },
{ title: "Lock the right frame", detail: "Three cam locks.", fix: camLocks(1, ["BA", "BR", "FR"]), tools: ["screwdriver"] },
diff --git a/src/lib/plan/families/ugglerum.ts b/src/lib/plan/families/ugglerum.ts
index 814060c..034962e 100644
--- a/src/lib/plan/families/ugglerum.ts
+++ b/src/lib/plan/families/ugglerum.ts
@@ -36,31 +36,36 @@ function coffee(s: ProductSpec): CustomParams {
{ id: "RA", name: "Long rail", size: [2 * xi, rh, rt], pos: [0, yT - rh / 2, -zr], material: "wood" },
{ id: "RB", name: "Long rail", size: [2 * xi, rh, rt], pos: [0, yT - rh / 2, zr], material: "wood" },
];
- const yJ = yT - rh / 2;
+ // the rail ends meet the cross bars where both overlap: the bolt low, the dowel high
+ const yJ = Math.max(yB, yT - rh) / 2 + yT / 2, yBolt = yJ - 12, yDow = yJ + 12;
+ const railAt = (z: number) => (z < 0 ? "RA" : "RB");
const fx = (kind: CustomFix["kind"], pts: Vec3[], dir: Vec3, on: string, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: pts.length, at: pts, dir, ...(on ? { on } : {}), ...o });
- const bolts = (sx: number) => fx("bolt", [-zr, zr].map((z): Vec3 => [sx * xi, yJ - 12, z]), [sx, 0, 0], sx < 0 ? "L" : "R", { name: "Connector bolt", len: 40, dia: 6 });
- const ends = (sx: number): Vec3[] => [-zr, zr].map((z): Vec3 => [sx * xi, yJ + 12, z]);
- const xd = (sx: number) => [-zr, zr].map((z): Vec3 => [sx * (xi - 40), yT - rh, z]);
- const lock = (sx: number): CustomFix[] => [fx("nut", xd(sx), [0, 1, 0], "", { name: "Cross dowel", len: 14, dia: 10 })];
- const tighten = (sx: number) => fx("screw", xd(sx), [0, 1, 0], "", { name: "Locking screw", len: 12, dia: 6 });
+ const bolts = (sx: number) => fx("bolt", [-zr, zr].map((z): Vec3 => [sx * xi, yBolt, z]), [sx, 0, 0], sx < 0 ? "L" : "R", { name: "Connector bolt", len: 40, dia: 6 });
+ const dowels = (sx: number) => [-zr, zr].map((z) => fx("dowel", [[sx * xi, yDow, z]], [-sx, 0, 0], railAt(z), { mate: sx < 0 ? "L" : "R" }));
+ // the cross dowel sits in its hole level with the bolt; the locking screw goes in after it from the rail's edge
+ const lock = (sx: number): CustomFix[] => [-zr, zr].map((z) => fx("nut", [[sx * (xi - 40), yBolt, z]], [0, 1, 0], railAt(z), { name: "Cross dowel", len: 14, dia: 10 }));
+ const tighten = (sx: number) => [-zr, zr].map((z) => fx("screw", [[sx * (xi - 40), yT - rh, z]], [0, 1, 0], railAt(z), { name: "Locking screw", len: 12, dia: 6 }));
const steps: CustomStep[] = [
{ title: "Lay the top upside down on a rug", detail: "It's your work surface while you build the base on it.", add: ["T"], pose: "-y", warnings: ["floor"] },
{
title: "Screw the connector bolts into the leg frames",
detail: "Two into the inside of each cross bar, by hand, until only the plain end sticks out.",
- add: ["L", "R"],
+ add: ["L"],
fix: [bolts(-1), bolts(1)],
+ wait: ["R"],
+ // the second frame waits in front, out of the rails' way
+ from: { R: [0, 0, 600] },
},
- { title: "Push a dowel into each end of the long rails", detail: "One dowel in each end, four in all.", fix: [fx("dowel", ends(-1), [1, 0, 0], ""), fx("dowel", ends(1), [-1, 0, 0], "")] },
+ { title: "Push a dowel into each end of the long rails", detail: "One dowel in each end, four in all.", fix: [...dowels(-1), ...dowels(1)], wait: ["RA", "RB"], from: { RA: [700, 0, 0], RB: [700, 0, 0] } },
{
title: "Push the rails onto one leg frame",
detail: "Each rail end goes over a bolt and its dowel. Drop a cross dowel into the hole in each rail, slot facing the bolt.",
add: ["RA", "RB"],
fix: lock(-1),
},
- { title: "Tighten the locking screws", detail: "Turn them in with the Allen key until the rail pulls tight against the frame.", fix: [tighten(-1)], tools: ["allen"] },
- { title: "Fit the other leg frame", detail: "Onto the free ends of the rails, then drop in the two cross dowels.", fix: lock(1) },
- { title: "Tighten the locking screws", detail: "Pull the frame tight, the same as the first one.", fix: [tighten(1)], tools: ["allen"] },
+ { title: "Tighten the locking screws", detail: "Turn them in with the Allen key until the rail pulls tight against the frame.", fix: tighten(-1), tools: ["allen"] },
+ { title: "Fit the other leg frame", detail: "Onto the free ends of the rails, then drop in the two cross dowels.", add: ["R"], fix: lock(1) },
+ { title: "Tighten the locking screws", detail: "Pull the frame tight, the same as the first one.", fix: tighten(1), tools: ["allen"] },
{
title: "Tap the glides into the legs",
detail: "One into the end of each leg.",
diff --git a/src/lib/plan/families/ulriksberg.ts b/src/lib/plan/families/ulriksberg.ts
index cb1a101..a675c41 100644
--- a/src/lib/plan/families/ulriksberg.ts
+++ b/src/lib/plan/families/ulriksberg.ts
@@ -60,7 +60,8 @@ function recipe(s: ProductSpec): CustomParams {
pos: [0, ySeat - 20, zSeat],
material: "wood",
pieces: [
- { shape: "box", size: [seatW, 30, seatD], pos: [0, 5, 0] },
+ // the seat sits right on the side frames' seat rails, so the bolts up through them bite into it
+ { shape: "box", size: [seatW, 40, seatD], pos: [0, 0, 0] },
{ shape: "cyl", size: [T, seatW - 60, T], pos: [0, -8, -seatD / 2 + 20], rot: [0, 0, Math.PI / 2], material: "metal" },
],
},
diff --git a/src/lib/plan/families/uppfora.ts b/src/lib/plan/families/uppfora.ts
index 0b8beaf..33ec9f1 100644
--- a/src/lib/plan/families/uppfora.ts
+++ b/src/lib/plan/families/uppfora.ts
@@ -116,8 +116,9 @@ function frame(s: ProductSpec) {
title: "Screw the low spacers onto the sides",
detail: "One on the back edge of each side, just above the plinth. They keep the bottom clear of the skirting board.",
fix: [
- fixAt(LOW_SPACER, [-1, 1].map((sx): Vec3 => [sx * (W / 2 - t / 2), lowY, z0]), [0, 0, 1]),
- fixAt(SMALL_SCREW, [-1, 1].map((sx): Vec3 => [sx * (W / 2 - t / 2), lowY, z0 - 4]), [0, 0, 1]),
+ // the spacer sits on the back edge; its screw goes through it, the head down in its hole
+ fixAt(LOW_SPACER, [-1, 1].map((sx): Vec3 => [sx * (W / 2 - t / 2), lowY, z0 - 22]), [0, 0, 1]),
+ fixAt(SMALL_SCREW, [-1, 1].map((sx): Vec3 => [sx * (W / 2 - t / 2), lowY, z0 + 1]), [0, 0, 1]),
],
tools: ["screwdriver"],
},
diff --git a/src/lib/plan/families/urban.ts b/src/lib/plan/families/urban.ts
new file mode 100644
index 0000000..3b41782
--- /dev/null
+++ b/src/lib/plan/families/urban.ts
@@ -0,0 +1,44 @@
+import type { Family } from "./family";
+import type { CustomParams, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * URBAN junior chair: one moulded plastic piece, seat, back, legs and footrest together. IKEA sells it ready made
+ * (its page has no assembly instructions), so its guide only unpacks it and shows where the footrest is.
+ */
+function chair(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 450, H = Math.round(s.size.h * 10) || 790, D = Math.round(s.size.d * 10) || 480;
+ const yS = (s.seat?.seatH ?? 53) * 10, st = 30, lw = 40, Hb = H - yS;
+ const y = (v: number) => v - H / 2; // pieces are placed about the chair's own centre
+ const legs: PartPiece[] = [-1, 1].flatMap((sx) =>
+ [-1, 1].map((sz): PartPiece => {
+ const top: Vec3 = [sx * (W / 2 - 60), y(yS - st), sz * (D / 2 - 80)], foot: Vec3 = [sx * (W / 2 - lw / 2), y(0), sz * (D / 2 - lw / 2)];
+ const v = [foot[0] - top[0], foot[1] - top[1], foot[2] - top[2]], len = Math.hypot(v[0], v[1], v[2]);
+ return { shape: "box", size: [lw, len, lw], pos: [(top[0] + foot[0]) / 2, (top[1] + foot[1]) / 2, (top[2] + foot[2]) / 2], rot: [Math.atan2(v[2], -v[1]) * -1, 0, Math.asin(v[0] / len)] };
+ }),
+ );
+ const pieces: PartPiece[] = [
+ { shape: "slab", size: [W - 100, st, D - 120], pos: [0, y(yS - st / 2), 20], outline: [[-(W - 100) / 2, -(D - 120) / 2], [(W - 100) / 2, -(D - 120) / 2], [(W - 100) / 2, (D - 120) / 2], [-(W - 100) / 2, (D - 120) / 2]], round: 60 },
+ // the back stands up from the seat: a slab drawn flat, then turned upright and tipped back a little
+ { shape: "slab", size: [W - 140, 26, Hb], pos: [0, y(yS + Hb / 2 - 10), -D / 2 + 75], outline: [[-(W - 140) / 2, -Hb / 2], [(W - 140) / 2, -Hb / 2], [(W - 120) / 2, Hb / 2], [-(W - 120) / 2, Hb / 2]], round: 70, rot: [-Math.PI / 2 + 0.1, 0, 0] },
+ ...legs,
+ // the footrest across the front legs, and the rail at the back
+ { shape: "box", size: [W - 60, 30, 40], pos: [0, y(230), D / 2 - 70] },
+ { shape: "box", size: [W - 60, 30, 30], pos: [0, y(230), -D / 2 + 70] },
+ ];
+ return {
+ parts: [{ id: "C", name: "Junior chair", size: [W, H, D], pos: [0, H / 2, 0], material: "board", pieces }],
+ steps: [
+ { title: "Unpack the chair", detail: "It comes in one moulded piece, so there is nothing to put together. Take off all the packaging.", add: ["C"], from: { C: [0, 300, 0] } },
+ { title: "Push it up to the table", detail: "Your child climbs on with a foot on the footrest at the front. Check it stands steady on all four feet." },
+ ],
+ };
+}
+
+const family: Family = {
+ names: ["URBAN"],
+ recipe(s) {
+ if (/^urban-junior-chair/.test(s.slug ?? "")) return chair(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/utaker.ts b/src/lib/plan/families/utaker.ts
index fadc842..dffb555 100644
--- a/src/lib/plan/families/utaker.ts
+++ b/src/lib/plan/families/utaker.ts
@@ -39,8 +39,10 @@ function recipe(s: ProductSpec) {
const parts: CustomPart[] = legs.map(([id, sx, sz]) => ({ id, label: id, name: "Corner leg", size: [LEG, H, LEG], pos: [sx * lx, H / 2, sz * lz], shape: "cyl", material: "wood" }));
const ex = lx - LEG / 2; // end rails reach to the legs
const sz0 = lz - LEG / 2;
- parts.push({ id: "EH", name: "End rail", size: [2 * ex, rh, RT], pos: [0, ry, -lz], material: "wood" });
- parts.push({ id: "EF", name: "End rail", size: [2 * ex, rh, RT], pos: [0, ry, lz], material: "wood" });
+ // the end rails sit lower by a slat's depth: the slatted base's end slats lie on them and are screwed down
+ const SLAT = 16;
+ parts.push({ id: "EH", name: "End rail", size: [2 * ex, rh - SLAT, RT], pos: [0, ry - SLAT / 2, -lz], material: "wood" });
+ parts.push({ id: "EF", name: "End rail", size: [2 * ex, rh - SLAT, RT], pos: [0, ry - SLAT / 2, lz], material: "wood" });
parts.push({ id: "S0", name: "Side rail", size: [RT, rh, 2 * sz0], pos: [-lx, ry, 0], material: "wood" });
parts.push({ id: "S1", name: "Side rail", size: [RT, rh, 2 * sz0], pos: [lx, ry, 0], material: "wood" });
// the crossed wires, corner to corner under the slats
@@ -54,7 +56,7 @@ function recipe(s: ProductSpec) {
// the joining strap, hanging on the outside of the right-hand side rail
parts.push({ id: "J", name: "Joining strap", size: [3, 90, 300], pos: [lx + RT / 2 + 1.5, ry, 0], material: "fiber" });
// the slatted base, a roll of slats on two tapes, between the rails
- const bw = 2 * (lx - RT / 2), bl = 2 * (lz - RT / 2);
+ const bw = 2 * ex, bl = 2 * lz; // between the legs, end slats over the end rails
const n = Math.round(bl / 110);
const pitch = (bl - 60) / (n - 1);
const roll: PartPiece[] = [
@@ -181,13 +183,13 @@ function recipe(s: ProductSpec) {
title: "Lay the slatted base in and screw down one end",
detail: "Unroll it from end to end. Four screws through the end slat.",
add: ["SB"],
- fix: [{ kind: "screw", count: 4, len: 30, dia: 4, dir: [0, -1, 0], at: [-0.36, -0.12, 0.12, 0.36].map((t) => [t * bw, ry1, -lz + 40] as Vec3) }],
+ fix: [{ kind: "screw", count: 4, len: 30, dia: 4, dir: [0, -1, 0], at: [-0.36, -0.12, 0.12, 0.36].map((t) => [t * bw, ry1, -lz + 6] as Vec3) }],
tools: ["screwdriver"],
},
{
title: "Screw down the other end",
detail: "Pull the slats straight first, then four more screws.",
- fix: [{ kind: "screw", count: 4, len: 30, dia: 4, dir: [0, -1, 0], at: [-0.36, -0.12, 0.12, 0.36].map((t) => [t * bw, ry1, lz - 40] as Vec3) }],
+ fix: [{ kind: "screw", count: 4, len: 30, dia: 4, dir: [0, -1, 0], at: [-0.36, -0.12, 0.12, 0.36].map((t) => [t * bw, ry1, lz - 6] as Vec3) }],
tools: ["screwdriver"],
},
{ title: "Lay your mattress on", detail: "No more than 13 cm thick, so a second bed can stack on top.", add: ["M"] },
diff --git a/src/lib/plan/families/utespelare.ts b/src/lib/plan/families/utespelare.ts
index 1b63df9..239293e 100644
--- a/src/lib/plan/families/utespelare.ts
+++ b/src/lib/plan/families/utespelare.ts
@@ -28,16 +28,22 @@ function recipe(s: ProductSpec): CustomParams {
return { shape: "box", size: [t, len, t], pos: [0, (y0 + y1) / 2 - c[1], sz * zAt((y0 + y1) / 2) - c[2]], rot: [-sz * lean, 0, 0] };
};
const frame = (sx: number): CustomPart => {
- const c: Vec3 = [sx * afx, (yUp0 + cbY + 15) / 2, 0];
+ const c: Vec3 = [sx * afx, (yUp0 + yTop + 10) / 2, 0];
const yS = 300;
return {
id: sx < 0 ? "AL" : "AR",
name: "A-frame",
- size: [40, cbY + 15 - yUp0, 2 * zAt(yUp0) + 40],
+ size: [40, yTop + 10 - yUp0, Math.max(2 * zAt(yUp0) + 40, D - 100)],
pos: c,
material: "metal",
pieces: [
- { shape: "box", size: [40, 30, 2 * zAt(cbY) + 120], pos: [0, cbY - c[1], 0] },
+ { shape: "box", size: [40, 30, D - 100], pos: [0, cbY - c[1], 0] },
+ // raised brackets on the crossbar, up to the top's underside, where it bolts to the top and the mesh strip
+ // (the mesh strip sits 10 higher than the top's underside)
+ ...[
+ [D / 2 - 250, rH],
+ [-D / 2 + 75, rH + 10],
+ ].map(([z, h]): PartPiece => ({ shape: "box", size: [40, h, 40], pos: [0, cbY + 15 + h / 2 - c[1], z] })),
...[-1, 1].map((sz) => leg(yUp0, cbY - 15, sz, c, 40)),
{ shape: "box", size: [30, 30, 2 * zAt(yS)], pos: [0, yS - c[1], 0] },
],
@@ -115,7 +121,7 @@ function recipe(s: ProductSpec): CustomParams {
detail: "Five bolts through each rail and two through each crossbar, the back ones into the mesh strip.",
fix: [
...[-1, 1].map((sz) => fx("bolt", [-700, -350, 0, 350, 700].map((x): Vec3 => [x, yTop - rH, sz * zTR]), [0, 1, 0], sz < 0 ? "TRB" : "TRF", "TOP", { len: 30, dia: 6 })),
- ...[-1, 1].map((sx) => fx("bolt", [D / 2 - 250, zMesh].map((z): Vec3 => [sx * afx, cbY - 15, z]), [0, 1, 0], sx < 0 ? "AL" : "AR", undefined, { len: 40, dia: 6 })),
+ ...[-1, 1].map((sx) => fx("bolt", [[sx * afx, cbY + 13, D / 2 - 250], [sx * afx, cbY + 22, zMesh]], [0, 1, 0], sx < 0 ? "AL" : "AR", undefined, { len: 40, dia: 6 })),
],
tools: ["allen"],
},
diff --git a/src/lib/plan/families/utklassning.ts b/src/lib/plan/families/utklassning.ts
index fc7c006..21089fb 100644
--- a/src/lib/plan/families/utklassning.ts
+++ b/src/lib/plan/families/utklassning.ts
@@ -71,8 +71,9 @@ function chair(s: ProductSpec): CustomParams {
"SPINE",
"Back spine",
[
- { shape: "box", size: [70, 14, 190], pos: [0, yMech0 + 7, -195] },
- tube([0, yMech0 + 7, -290], [0, yBack0 - 20, zSpine], 30),
+ // the flat bracket reaches into the slot at the back of the mechanism
+ { shape: "box", size: [70, 14, 200], pos: [0, yMech0 + 7, -130] },
+ tube([0, yMech0 + 7, -225], [0, yBack0 - 20, zSpine], 30),
{ shape: "box", size: [60, yBack1 - yBack0 + 40, 24], pos: [0, (yBack0 + yBack1) / 2, zSpine] },
{ shape: "box", size: [70, 60, 40], pos: [0, yBack0 + 20, zSpine + 8] },
],
@@ -133,7 +134,7 @@ function chair(s: ProductSpec): CustomParams {
const asideOf = (ids: string[], off: Vec3) => Object.fromEntries(ids.map((id) => [id, off]));
const armBolts = [-1, 1].map((sx, i) => fx("bolt", [[sx * 140, zs - 80], [sx * 220, zs - 80], [sx * 180, zs + 10]].map(([x, z]): Vec3 => [x, ySeat0 - 12, z]), [0, 1, 0], `ARM${i}`, { ...LONG_BOLT, mate: "SEAT" }));
const mechBolts = [-1, 1].flatMap((sx) => [zs - 100, zs + 80].map((z): Vec3 => [sx * 80, yMech0 + 50, z]));
- const backBolts: Vec3[] = [[-20, yMech0, -150], [20, yMech0, -150], [0, yMech0, -230]];
+ const backBolts: Vec3[] = [[-20, yMech0, -45], [20, yMech0, -45], [0, yMech0, -85]];
const top = 1060;
const steps: CustomStep[] = [
diff --git a/src/lib/plan/families/vadholma.ts b/src/lib/plan/families/vadholma.ts
index 669e11c..1864fba 100644
--- a/src/lib/plan/families/vadholma.ts
+++ b/src/lib/plan/families/vadholma.ts
@@ -115,7 +115,9 @@ function carcass(s: ProductSpec, what: "open" | "drawers"): CustomParams {
{
title: i ? "Build the second drawer the same way" : "Fit cam bolts and dowels in the drawer front",
detail: i ? "Front face down, sides on, cams, bottom, back." : "Lay the front face down on a rug. Two cam bolts and four dowels along its inside, then push the sides onto them.",
- add: [id("F"), id("DL"), id("DR")],
+ // all along the cam bolts: the sides come in through the opening, then the front closes onto them
+ add: [id("DL"), id("DR"), id("F")],
+ from: { [id("DL")]: [0, 0, 350], [id("DR")]: [0, 0, 350], [id("F")]: [0, 0, 350] },
fix: [
camBolts([-1, 1].map((k) => [k * sx, fy, fz] as Vec3), [0, 0, 1], id("F")),
dowel([-1, 1].flatMap((k) => [-1, 1].map((j) => [k * sx, fy + j * (dh / 2 - 25), fz] as Vec3)), [0, 0, 1], id("F")),
@@ -124,7 +126,7 @@ function carcass(s: ProductSpec, what: "open" | "drawers"): CustomParams {
],
tools: ["screwdriver", "hammer"],
},
- { title: i ? "Slide in its bottom and screw on the back" : "Slide in the bottom and screw on the back", detail: "Bottom into the grooves of the sides and front, then the back over it with two long screws on each side, using the Allen key.", add: [id("DF"), id("DB")], fix: [{ kind: "bolt", count: 4, len: 40, dia: 5, at: [-1, 1].flatMap((k) => [-1, 1].map((j) => [k * (sx + 7), fy + j * (dh / 2 - 20), D / 2 - T - bd + 7] as Vec3)), dir: [0, 0, 1] }] },
+ { title: i ? "Slide in its bottom and screw on the back" : "Slide in the bottom and screw on the back", detail: "Bottom into the grooves of the sides and front, then the back over it with two long screws on each side, using the Allen key.", add: [id("DF"), id("DB")], fix: [-1, 1].map((k): CustomFix => ({ kind: "bolt", count: 2, len: 40, dia: 5, at: [-1, 1].map((j) => [k * (sx + 7), fy + j * (dh / 2 - 20), D / 2 - T - bd + 7] as Vec3), dir: [-k, 0, 0], on: id(k < 0 ? "DL" : "DR"), mate: id("DB") })) },
{ title: i ? "Clip its runner locks on and push it in" : "Clip the runner locks under the front and push the drawer in", detail: "One lock under each front corner, screwed in. Pull the runners out, set the drawer on them and push it home until it clicks.", fix: [{ kind: "clip", name: "Runner lock", count: 2, at: [-1, 1].map((k) => [k * (sx - 20), T + gap + i * (fh + gap) + 10, D / 2 - T - 40] as Vec3), dir: [0, 1, 0] }] },
];
};
@@ -162,7 +164,8 @@ function island(s: ProductSpec, rack: boolean): CustomParams {
material: "wood",
pieces: [
...[-1, 1].map((k): PartPiece => ({ shape: "box", size: [2 * ix, 50, 30], pos: [0, 0, k * (sd / 2 - 15)] })),
- ...Array.from({ length: slats }, (_, i): PartPiece => ({ shape: "box", size: [48, 16, sd - 60], pos: [-ix + 40 + ((2 * ix - 80) * i) / (slats - 1), 17, 0] })),
+ ...[-1, 1].map((k): PartPiece => ({ shape: "box", size: [30, 50, sd - 60], pos: [k * (ix - 15), 0, 0] })),
+ ...Array.from({ length: slats }, (_, i): PartPiece => ({ shape: "box", size: [48, 16, sd - 60], pos: [-ix + 60 + ((2 * ix - 120) * i) / (slats - 1), 17, 0] })),
],
});
const rz = FZ - LW / 2 - 8;
@@ -326,8 +329,8 @@ function island79(): CustomParams {
const BOLT = { len: 100, dia: 6 };
// the back rail and each shelf rail meet a leg: dowels in the end, a bolt through the leg into a barrel nut
const brDowels = (sx: number) => dowel([yTR - 30, yTR + 30].map((y) => [sx * ix, y, -lz] as Vec3), [-sx, 0, 0], "BR", ef(sx));
- const brNuts = (sx: number): CustomFix => ({ kind: "nut", count: 2, at: [yTR - 10, yTR + 10].map((y) => [sx * (ix - 40), y, -lz + 10] as Vec3), dir: [0, 0, -1], on: "BR", ...NUT });
- const brBolts = (sx: number): CustomFix => ({ kind: "bolt", count: 2, at: [yTR - 10, yTR + 10].map((y) => [sx * (lx + LW / 2), y, -lz] as Vec3), dir: [-sx, 0, 0], on: ef(sx), mate: "BR", ...BOLT });
+ const brNuts = (sx: number): CustomFix => ({ kind: "nut", count: 2, at: [yTR - 14, yTR + 14].map((y) => [sx * (ix - 40), y, -lz + 10] as Vec3), dir: [0, 0, -1], on: "BR", ...NUT });
+ const brBolts = (sx: number): CustomFix => ({ kind: "bolt", count: 2, at: [yTR - 14, yTR + 14].map((y) => [sx * (lx + LW / 2), y, -lz] as Vec3), dir: [-sx, 0, 0], on: ef(sx), mate: "BR", ...BOLT });
const shDowels = (id: string, top: number): CustomFix[] =>
S.map((sx) => dowel(S.flatMap((sz) => [-24, 8, 24].map((dy2) => [sx * ix, top - 30 + dy2, sz * lz] as Vec3)), [-sx, 0, 0], id, ef(sx)));
const shNuts = (sx: number): CustomFix => ({ kind: "nut", count: 4, at: shelfTop.flatMap((t) => S.map((sz) => [sx * (ix - 40), t - 38, sz * (lz - 10)] as Vec3)), dir: [0, 1, 0], ...NUT });
diff --git a/src/lib/plan/families/valnas.ts b/src/lib/plan/families/valnas.ts
index 3b29107..2402598 100644
--- a/src/lib/plan/families/valnas.ts
+++ b/src/lib/plan/families/valnas.ts
@@ -84,8 +84,8 @@ function legFits(b: Base): CustomFix[] {
for (const l of b.legs)
for (const r of railsOf(l.id)) {
const p = b.joint(l.id, r);
- dowel.push(add(p, across(l.n), 8));
- pin.push(add(p, across(l.n), -8));
+ dowel.push(add(p, across(l.n), 12));
+ pin.push(add(p, across(l.n), -12));
dirs.push(l.n);
}
// each fix holds one direction, so one fix per leg
@@ -125,16 +125,17 @@ function coffee(): CustomParams {
const parts: P[] = [...b.parts, { id: "TOP", name: "Table top", size: [W, T, Dd], pos: [0, H - T / 2, 0], material: "wood", pieces: oval(W, T, Dd) }];
const xL = W / 2 - 90, zL = Dd / 2 - 70;
const steps: CustomStep[] = [
- { title: "Tap the dowels into the legs", detail: "Lay the four legs on a rug. Two dowels in each, in the small side holes.", add: ["La", "Lb", "Lc", "Ld"], fix: legFits(b).filter((f) => f.kind === "dowel"), tools: ["hammer"], warnings: ["floor"] },
+ { title: "Tap the dowels into the legs", detail: "Lay the four legs on a rug. Two dowels in each, in the small side holes.", wait: ["La", "Lb", "Lc", "Ld"], fix: legFits(b).filter((f) => f.kind === "dowel"), tools: ["hammer"], warnings: ["floor"] },
{
title: "Screw the connector pins into the legs",
detail: "By hand with the Allen key, not a drill, until the shoulder meets the wood.",
fix: legFits(b).filter((f) => f.kind === "camScrew"),
tools: ["allen"],
},
- { title: "Push the cross nuts into the rails", detail: "Into the holes on top, near each end, slot turned towards the end.", add: ["RLu", "RLl", "RSu", "RSl"], fix: nuts(b, ends(["RLu", "RLl", "RSu", "RSl"], [-1, 1])), from: { RLu: [0, 300, 0], RLl: [0, 300, 0], RSu: [0, 300, 0], RSl: [0, 300, 0] } },
+ { title: "Push the cross nuts into the rails", detail: "Into the holes on top, near each end, slot turned towards the end.", add: ["RLu", "RLl"], wait: ["RSu", "RSl"], fix: nuts(b, ends(["RLu", "RLl", "RSu", "RSl"], [-1, 1])), from: { RLu: [0, 300, 0], RLl: [0, 300, 0] } },
{
title: "Join the long rails to two legs and lock them",
+ add: ["La", "Lb"],
detail: "Push the pins and dowels of the two end legs into the long rails, notches facing up on the lower rail. A set screw into each cross nut pulls the joint tight.",
fix: [setScrews(b, ends(["RLu", "RLl"], [-1, 1]))],
tools: ["allen"],
@@ -142,6 +143,8 @@ function coffee(): CustomParams {
{
title: "Drop the short rails over the long ones",
detail: "Their notches slot down over the long rails where they cross. Then push on the other two legs and lock them the same way.",
+ add: ["RSu", "RSl", "Lc", "Ld"],
+ from: { RSu: [0, 300, 0], RSl: [0, 300, 0] },
fix: [setScrews(b, ends(["RSu", "RSl"], [-1, 1]))],
tools: ["allen"],
},
@@ -217,7 +220,7 @@ function trolley(): CustomParams {
{
title: "Tap the dowels into the legs",
detail: "Lay the four legs on a rug, castors up. Two dowels in each, in the small side holes.",
- add: ["La", "Lb", "Lc", "Ld"],
+ wait: ["La", "Lb", "Lc", "Ld"],
fix: legFits(b).filter((f) => f.kind === "dowel"),
tools: ["hammer"],
pose: "-y",
@@ -225,7 +228,7 @@ function trolley(): CustomParams {
},
{ title: "Screw the connector pins into the legs", detail: "By hand with the Allen key, not a drill.", fix: legFits(b).filter((f) => f.kind === "camScrew"), tools: ["allen"] },
{ title: "Push the cross nuts into the long rails", detail: "Into the holes near each end, slot towards the end.", add: ["RLu", "RLl"], fix: nuts(b, ends(["RLu", "RLl"], [-1, 1])), from: { RLu: [0, -300, 0], RLl: [0, -300, 0] } },
- { title: "Join the long rails to two legs", detail: "Pins and dowels into the rail ends, castors still up.", fix: [setScrews(b, ends(["RLu", "RLl"], [-1, 1]))], tools: ["allen"] },
+ { title: "Join the long rails to two legs", detail: "Pins and dowels into the rail ends, castors still up.", add: ["La", "Lb"], fix: [setScrews(b, ends(["RLu", "RLl"], [-1, 1]))], tools: ["allen"] },
{
title: "Drop the short rails over the long ones",
detail: "Notches slot together where they cross.",
@@ -233,7 +236,7 @@ function trolley(): CustomParams {
from: { RSu: [0, -300, 0], RSl: [0, -300, 0] },
},
{ title: "Push cross nuts into the short rails", detail: "One in each, at the end nearest you.", fix: nuts(b, [["RSu", -1], ["RSl", -1]]) },
- { title: "Push a third leg on and lock it", detail: "Two set screws into the cross nuts.", fix: [setScrews(b, [["RSu", -1], ["RSl", -1]])], tools: ["allen"] },
+ { title: "Push a third leg on and lock it", detail: "Two set screws into the cross nuts.", add: ["Lc"], fix: [setScrews(b, [["RSu", -1], ["RSl", -1]])], tools: ["allen"] },
{ title: "Bolt the upper rails together", detail: "The short bolt, through the middle where they cross.", fix: [{ kind: "bolt", count: 1, len: 50, dia: 6, name: "Short bolt", at: [[0, upper[0], 0]], dir: [0, 1, 0], on: "RSu", mate: "RLu" }], tools: ["allen"] },
{
title: "Tap two dowels into the lower rails",
@@ -250,7 +253,7 @@ function trolley(): CustomParams {
tools: ["allen"],
},
{ title: "Push cross nuts into the free rail ends", detail: "The last two, in the short rails.", fix: nuts(b, [["RSu", 1], ["RSl", 1]]) },
- { title: "Push the last leg on and lock it", detail: "Two set screws into the cross nuts.", fix: [setScrews(b, [["RSu", 1], ["RSl", 1]])], tools: ["allen"] },
+ { title: "Push the last leg on and lock it", detail: "Two set screws into the cross nuts.", add: ["Ld"], fix: [setScrews(b, [["RSu", 1], ["RSl", 1]])], tools: ["allen"] },
{
title: "Press the pads under the top tray",
detail: "Lay it upside down: eight pads, each pushed into its two holes. They protect the table you set it on.",
diff --git a/src/lib/plan/families/vangsta.ts b/src/lib/plan/families/vangsta.ts
new file mode 100644
index 0000000..d9fd446
--- /dev/null
+++ b/src/lib/plan/families/vangsta.ts
@@ -0,0 +1,109 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * VÄNGSTA, read from the 120/180 extendable table's manual (it is no longer sold in the UK or US). Built upside down
+ * on its top: slide blocks go into the two side rails, the rails are bolted to the top, an end rail clips on and two
+ * legs are bolted into its corner plates and tightened with the spanner. A brace drops in, two pairs of rails slide
+ * into the side rails and are screwed at the end, the second end rail clips onto them and takes the other two legs.
+ * Two people turn it over; the loose leaf gets its peg and socket plates. To extend it, pull the far end out and lay
+ * the leaf in on the rails.
+ */
+
+const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+const UP: Vec3 = [0, 1, 0], DOWN: Vec3 = [0, -1, 0];
+
+function table(s: ProductSpec): CustomParams {
+ // IKEA: 120 (180 open) long, 75 wide, 73 high
+ const W = Math.round(s.size.w * 10) || 1200, H = Math.round(s.size.h * 10) || 730, D = Math.round(s.size.d * 10) || 750;
+ const TT = 20, yt = H - TT; // the top, and its underside
+ const RH = 60, ry = yt - RH; // side rails and end rails under the top
+ const L = 45, ly = ry - 10; // legs, square steel, up to the end rails' corner plates
+ const xl = W / 2 - 30, zl = D / 2 - 30;
+ const zr = D / 2 - 45; // side rails, 30 thick
+ const zi = zr - 26, za = zi - 24; // the inner rails and the leaf supports beside them
+ const xe = W / 2 - 65; // end rails
+ const inX0 = -(W / 2 - 180), inX1 = W / 2 - 75; // the rails that slide out
+ const g2 = [-1, 1];
+ const endRail = (g: number): CustomPart => {
+ const c: Vec3 = [g * (W / 2 - 40), ry + RH / 2 - 5, 0];
+ const pieces: PartPiece[] = [
+ { shape: "box", size: [30, RH, 2 * zr - 30], pos: [g * (xe - (W / 2 - 40)), 5, 0] },
+ // the corner plates the legs bolt into
+ ...g2.map((gz): PartPiece => ({ shape: "box", size: [50, 6, 50], pos: [g * (xl - (W / 2 - 40)), ly + 3 - c[1], gz * zl] })),
+ ];
+ return { id: g < 0 ? "EA" : "EB", name: "End rail", size: [80, RH + 10, D - 20], pos: c, pieces, material: "metal" };
+ };
+ const parts: CustomPart[] = [
+ { id: "TP", name: "Table top", size: [W, TT, D], pos: [0, yt + TT / 2, 0], material: "board" },
+ ...g2.map((g, i): CustomPart => ({ id: `OR${i}`, name: "Side rail", size: [W - 100, RH, 30], pos: [0, ry + RH / 2, g * zr], material: "metal" })),
+ endRail(-1),
+ ...g2.map((g, i): CustomPart => ({ id: `LA${i}`, name: "Leg", size: [L, ly, L], pos: [-xl, ly / 2, g * zl], material: "metal" })),
+ { id: "BR", name: "Brace", size: [30, 30, 2 * zi - 30], pos: [-(W / 2 - 150), ry + 15, 0], material: "metal" },
+ ...g2.map((g, i): CustomPart => ({ id: `IR${i}`, name: "Sliding rail", size: [inX1 - inX0, 30, 22], pos: [(inX0 + inX1) / 2, yt - 15, g * zi], material: "metal" })),
+ ...g2.map((g, i): CustomPart => ({ id: `AR${i}`, name: "Leaf support", size: [inX1 - inX0, 30, 22], pos: [(inX0 + inX1) / 2, yt - 15, g * za], material: "metal" })),
+ endRail(1),
+ ...g2.map((g, i): CustomPart => ({ id: `LB${i}`, name: "Leg", size: [L, ly, L], pos: [xl, ly / 2, g * zl], material: "metal" })),
+ // the leaf is stored apart: here it lies on the top until it's needed
+ { id: "LF", name: "Leaf", size: [W / 2, TT, D], pos: [0, H + 10 + TT / 2, 0], material: "board" },
+ ];
+ const sideBolts = g2.map((g, i) => fx("bolt", [-450, -150, 150, 450].map((x): Vec3 => [x * (W / 1200), ry, g * zr]), UP, { len: 70, dia: 6, on: `OR${i}` }));
+ const legBolts = (sx: number, ids: string[]): CustomFix[] => [
+ ...g2.map((g, i) => fx("washer", [[sx * xl, ly + 6, g * zl]], DOWN, { name: "Lock washer", len: 2, dia: 14, on: ids[i] })),
+ ...g2.map((g, i) => fx("bolt", [[sx * xl, ly + 7, g * zl]], DOWN, { name: "Hex bolt", len: 30, dia: 8, on: ids[i] })),
+ ];
+ const clips = (g: number) => [fx("clip", g2.map((gz): Vec3 => [g * xe, ry + RH / 2, gz * (zr - 25)]), [g, 0, 0], { name: "Rail clip", len: 30, dia: 20, on: g < 0 ? "EA" : "EB" })];
+ const endScrews = (z: number, ids: string[]) => g2.map((g, i) => fx("screw", [[inX0 + 15, yt - 30, g * z]], UP, { len: 10, dia: 6, on: ids[i] }));
+ const lx0 = 0, lw = W / 2; // the leaf, as it lies on the top
+ const plates = (edge: number, name: string): CustomFix[] => [
+ fx("connector", g2.map((gz): Vec3 => [lx0 + edge * (lw / 2 - 30), H + 10, gz * (D / 2 - 120)]), DOWN, { name, len: 40, dia: 30, on: "LF" }),
+ fx("screw", g2.flatMap((gz) => [-15, 15].map((dz): Vec3 => [lx0 + edge * (lw / 2 - 30), H + 4, gz * (D / 2 - 120) + dz])), UP, { len: 12, dia: 4, on: "LF" }),
+ ];
+ const steps: CustomStep[] = [
+ {
+ title: "Push the slide blocks into the side rails",
+ detail: "Two in each rail, into the square holes, then turn them until they lock.",
+ fix: g2.map((g, i) => fx("connector", [100, W / 2 - 80].map((x): Vec3 => [x, ry + 30, g * zr]), DOWN, { name: "Slide block", len: 40, dia: 24, on: `OR${i}` })),
+ pose: "-y",
+ wait: ["OR0", "OR1"],
+ from: { OR0: [0, 0, -400], OR1: [0, 0, 400] },
+ },
+ {
+ title: "Lay the side rails on the top",
+ detail: "Lay the top face down on a rug and put a rail along each long edge, over the holes.",
+ add: ["TP", "OR0", "OR1"],
+ from: { OR0: [0, -150, 0], OR1: [0, -150, 0] },
+ warnings: ["floor"],
+ },
+ { title: "Bolt the side rails to the top", detail: "Four long bolts through each rail into the top. Tighten them with the Allen key.", fix: sideBolts, tools: ["allen"] },
+ { title: "Clip the end rail", detail: "Push a clip into each end of one end rail.", fix: clips(-1), wait: ["EA"], from: { EA: [-400, 0, 0] } },
+ { title: "Click the end rail onto the side rails", detail: "At the end with the slide blocks furthest in, until it clicks.", add: ["EA"], from: { EA: [0, -120, 0] } },
+ { title: "Bolt two legs into the corner plates", detail: "A lock washer on each bolt, then turn it into the leg by hand.", add: ["LA0", "LA1"], fix: legBolts(-1, ["LA0", "LA1"]), from: { LA0: [0, -300, 0], LA1: [0, -300, 0] } },
+ { title: "Tighten the leg bolts with the spanner", detail: "Check each leg stands straight up, not tilted, then tighten.", tools: ["wrench"] },
+ { title: "Drop the brace in", detail: "Across the frame next to the end rail, its flat side against the top.", add: ["BR"], from: { BR: [0, -150, 0] } },
+ { title: "Slide in the two sliding rails", detail: "From the open end, into the slide blocks, all the way to the end rail.", add: ["IR0", "IR1"], from: { IR0: [800, 0, 0], IR1: [800, 0, 0] } },
+ { title: "Screw the sliding rails at the end", detail: "One screw through the end of each rail.", fix: endScrews(zi, ["IR0", "IR1"]), tools: ["allen"] },
+ { title: "Slide in the leaf supports", detail: "The angled rails go in beside the sliding rails, hooks towards the open end.", add: ["AR0", "AR1"], from: { AR0: [800, 0, 0], AR1: [800, 0, 0] } },
+ { title: "Screw the leaf supports at the end", detail: "One screw through the end of each.", fix: endScrews(za, ["AR0", "AR1"]), tools: ["allen"] },
+ { title: "Clip the second end rail", detail: "Two clips again, one in each end.", fix: clips(1), wait: ["EB"], from: { EB: [400, 0, 0] } },
+ { title: "Click it onto the sliding rails", detail: "At the open end, until it clicks.", add: ["EB"], from: { EB: [0, -120, 0] } },
+ { title: "Bolt on the last two legs", detail: "A lock washer on each bolt, turned in by hand.", add: ["LB0", "LB1"], fix: legBolts(1, ["LB0", "LB1"]), from: { LB0: [0, -300, 0], LB1: [0, -300, 0] } },
+ { title: "Tighten them with the spanner", detail: "Again with the legs standing straight.", tools: ["wrench"] },
+ { title: "Turn the table over", detail: "Lift it together by the frame and stand it on its legs.", pose: "+y", people: 2, kind: "standup" },
+ { title: "Screw the peg plates onto the leaf", detail: "Lay the leaf face down. Two plates along one edge, two screws each.", fix: plates(-1, "Leaf peg plate"), tools: ["allen"], wait: ["LF"], from: { LF: [0, -500, 900] } },
+ { title: "Screw the socket plates on the other edge", detail: "The other two plates, two screws each.", fix: plates(1, "Leaf socket plate"), tools: ["allen"] },
+ { title: "Lay the leaf on the table", detail: "Keep it flat until you need it, so it doesn't warp.", add: ["LF"], from: { LF: [0, 0, 300] } },
+ { title: "To make it longer, pull the end out", detail: "Hold the end with the loose legs and pull until the rails stop." },
+ { title: "Lay the leaf in and push it closed", detail: "Plates down, pegs towards the top, on the leaf supports. Push the end back until the plates lock." },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["VÄNGSTA", "VANGSTA"],
+ recipe(s) {
+ if (/extendable table/i.test(s.variant)) return table(s);
+ return null;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/vasman.ts b/src/lib/plan/families/vasman.ts
index 7a49d17..4f4807d 100644
--- a/src/lib/plan/families/vasman.ts
+++ b/src/lib/plan/families/vasman.ts
@@ -6,7 +6,8 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* the two side rails, the rails are bolted under the fixed top, one leg frame is screwed onto their ends, then
* the pull-out runners and the leaf rails slide in through the blocks and are stopped and bolted, and the other
* leg frame goes on the runners' ends. The leaf and the sliding end top get their guide plates, and the table is
- * turned over with the leaf stored under the end top. The garden armchair has no manual: it keeps its old guide.
+ * turned over with the leaf stored under the end top. The garden armchair comes assembled (IKEA has only a care sheet
+ * for it, which says to tighten its screws again each season), so its guide unpacks it and checks the screws.
*/
const TUBE = 25;
@@ -47,6 +48,7 @@ function table(s: ProductSpec): CustomParams {
return { id, name: "Leg frame", size: [TUBE, top, 2 * zp + TUBE], pos, pieces: segs.map(([a, b]) => tube(rel(a), rel(b))), material: "metal" };
};
const yLr = yR - 5;
+ const leafLo = yLr - 51 - 11; // underside of the stored leaf
const parts: CustomPart[] = [
{ id: "RA", name: "Side rail", size: [xR + xs - 40, rh, rw], pos: [(-xR + xs - 40) / 2, yR, -zr], material: "metal" },
{ id: "RB", name: "Side rail", size: [xR + xs - 40, rh, rw], pos: [(-xR + xs - 40) / 2, yR, zr], material: "metal" },
@@ -106,8 +108,9 @@ function table(s: ProductSpec): CustomParams {
title: "Bolt the leaf rails to the runners",
detail: "A bolt through each with a spacer tube between rail and runner. The spacer sits square, not tilted.",
fix: [
- fx("spacer", [-1, 1].map((sz): Vec3 => [xR - 40, yLr - 30, sz * (zr - 60)]), [0, 0, 1], { name: "Spacer tube", len: 50, dia: 14 }),
- fx("bolt", [-1, 1].map((sz): Vec3 => [xR - 40, yLr - 30, sz * (zr - 80)]), [0, 0, 1], { len: 70, dia: 6 }),
+ // from the outside of the rail, through the spacer, into the leaf rail
+ ...[-1, 1].map((sz) => fx("bolt", [[xR - 40, yLr - 30, sz * (zr - 10)]], [0, 0, -sz], { len: 70, dia: 6 })),
+ ...[-1, 1].map((sz) => fx("spacer", [[xR - 40, yLr - 30, sz * (zr - 36)]], [0, 0, -sz], { name: "Spacer tube", len: 50, dia: 14 })),
],
tools: ["allen"],
},
@@ -128,41 +131,82 @@ function table(s: ProductSpec): CustomParams {
{ title: "Tighten every bolt", detail: "Go round all eight bolts under the top and tighten them now.", tools: ["allen"], check: "square" },
{
title: "Screw the guide plates under the leaf",
- detail: "Leaf face down. One plate at each end of a batten, two screws in each.",
- add: ["F"],
+ detail: "Lay the leaf face down on the rug. One plate at each end of a batten, two screws in each.",
+ wait: ["F"],
fix: [
- fx("plate", [-1, 1].map((sz): Vec3 => [xs + 40, yLr - 40, sz * (zr - 70)]), [0, 1, 0], { name: "Leaf guide plate", len: 8, dia: 40 }),
- fx("screw", [-1, 1].flatMap((sz) => [-14, 14].map((dx): Vec3 => [xs + 40 + dx, yLr - 40, sz * (zr - 70)])), [0, 1, 0], { len: 14, dia: 4 }),
+ // screws first, so each plate sits between its own two
+ fx("screw", [-1, 1].flatMap((sz) => [-24, 24].map((dx): Vec3 => [xs + 45 + dx, leafLo - 8, sz * (zr - 70)])), [0, 1, 0], { len: 14, dia: 4, on: "F" }),
+ fx("plate", [-1, 1].map((sz): Vec3 => [xs + 45, leafLo - 4, sz * (zr - 70)]), [0, 1, 0], { name: "Leaf guide plate", len: 8, dia: 40, on: "F" }),
],
tools: ["allen"],
},
{
title: "Screw the guide plates under the end top",
- detail: "The other plates, the ones with a raised block. Two screws in each.",
- add: ["E"],
+ detail: "The end top face down too, and the other plates, the ones with a raised block. Two screws in each.",
+ wait: ["E"],
fix: [
- fx("plate", [-1, 1].map((sz): Vec3 => [xs + 60, H - tt - 14, sz * (zr - 40)]), [0, 1, 0], { name: "End guide plate", len: 14, dia: 40 }),
- fx("screw", [-1, 1].flatMap((sz) => [-14, 14].map((dx): Vec3 => [xs + 60 + dx, H - tt - 14, sz * (zr - 40)])), [0, 1, 0], { len: 14, dia: 4 }),
+ fx("screw", [-1, 1].flatMap((sz) => [-24, 24].map((dx): Vec3 => [xs + 60 + dx, H - tt - 8, sz * (zr - 40)])), [0, 1, 0], { len: 14, dia: 4, on: "E" }),
+ fx("plate", [-1, 1].map((sz): Vec3 => [xs + 60, H - tt - 7, sz * (zr - 40)]), [0, 1, 0], { name: "End guide plate", len: 14, dia: 40, on: "E" }),
],
tools: ["allen"],
},
{
title: "Turn the table over together",
- detail: "The end top rides on the runners, the leaf stays stored under it. To extend, pull the end out, lift the leaf in and push it closed.",
+ detail: "Lift it by the fixed top, not by the runners.",
pose: "+y",
people: 2,
warnings: ["two"],
},
+ {
+ title: "Put the leaf and the end top on",
+ detail: "The leaf rests on the leaf rails, stored under the end top, and the end top rides on the runners. To extend, pull the end out, lift the leaf in and push it closed.",
+ add: ["F", "E"],
+ from: { F: [0, 400, 0], E: [0, 500, 0] },
+ },
];
return { parts, steps };
}
+function armchair(s: ProductSpec): CustomParams {
+ // IKEA: 54 wide, 92 high, 59 deep, seat 45 high; one cantilever frame with cord woven over the seat and back
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const X = W / 2 - 40, zf = D / 2 - 30, zb = D / 2 - 30, seatY = 450, armY = 650;
+ const c: Vec3 = [0, H / 2, 0];
+ const rel = (p: PartPiece): PartPiece => ({ ...p, pos: [p.pos[0] - c[0], p.pos[1] - c[1], p.pos[2] - c[2]] });
+ const backLo: Vec3 = [0, seatY - 20, -zb + 40], backHi: Vec3 = [0, H - 10, -zb - 15];
+ const side = (x: number): PartPiece[] => [
+ tube([x, TUBE / 2, -zb], [x, TUBE / 2, zf]),
+ tube([x, TUBE / 2, zf], [x, seatY, zf - 40]),
+ tube([x, seatY, zf - 40], [x, backLo[1], backLo[2]]),
+ tube([x, backLo[1], backLo[2]], [x, backHi[1], backHi[2]]),
+ tube([x, armY, -zb + 20], [x, armY, zf - 70]),
+ tube([x, armY, zf - 70], [x, seatY, zf - 70]),
+ ];
+ const lean = Math.atan2(backHi[2] - backLo[2], backHi[1] - backLo[1]);
+ const raw: PartPiece[] = [
+ ...side(-X),
+ ...side(X),
+ tube([-X, TUBE / 2, -zb], [X, TUBE / 2, -zb]),
+ { shape: "box", size: [2 * X - 10, 8, zf - 40 - backLo[2]], pos: [0, seatY - 12, (zf - 40 + backLo[2]) / 2], rot: [-0.04, 0, 0], material: "fiber" },
+ { shape: "box", size: [2 * X - 10, backHi[1] - backLo[1] - 30, 8], pos: [0, (backLo[1] + backHi[1]) / 2 + 10, (backLo[2] + backHi[2]) / 2], rot: [lean, 0, 0], material: "fiber" },
+ ];
+ const pieces = raw.map(rel);
+ return {
+ parts: [{ id: "CH", name: "Armchair", size: [2 * X + TUBE, H, D], pos: c, pieces, material: "metal" }],
+ steps: [
+ { title: "Unpack the chair", detail: "It comes ready assembled, so there is nothing to put together. Cut the wrapping open carefully so the knife can't catch the cord.", add: ["CH"] },
+ { title: "Check the screws are tight", detail: "Do it again at least once a season: it keeps the chair steady." },
+ ],
+ };
+}
+
const family: Family = {
names: ["VÄSMAN", "VASMAN"],
recipe(s) {
const t = `${s.slug ?? ""} ${s.variant}`.toLowerCase();
if (/table/.test(t)) return table(s);
- return null; // the armchair: no manual
+ if (/chair/.test(t)) return armchair(s);
+ return null;
},
};
export default family;
diff --git a/src/lib/plan/families/vassholmen.ts b/src/lib/plan/families/vassholmen.ts
index 759c2f0..a5ff1de 100644
--- a/src/lib/plan/families/vassholmen.ts
+++ b/src/lib/plan/families/vassholmen.ts
@@ -94,14 +94,15 @@ function chair(): CustomParams {
{
title: "Bolt the top of each leg to the seat frame",
detail: "A spring washer, then a flat washer, on each short bolt. Turn them in with the Allen key, but don't tighten yet.",
- fix: [...legBolt("washer", { len: 1.5, dia: 14 }), ...legBolt("washer", { name: "Spring washer", len: 2, dia: 10 }), ...legBolt("bolt", { len: 20, dia: 6 })],
+ // bolts first: the engine stacks each washer onto the bolt already at its point
+ fix: [...legBolt("bolt", { len: 20, dia: 6 }), ...legBolt("washer", { name: "Spring washer", len: 2, dia: 10 }), ...legBolt("washer", { len: 1.5, dia: 14 })],
tools: ["allen"],
},
- { title: "Slide the cross stretcher between the leg frames", detail: "Its holes face out, lined up with the holes in the side stretchers.", add: ["X"], from: { X: [-300, 0, 0] } },
+ { title: "Slide the cross stretcher between the leg frames", detail: "Lower it in between them from above, holes facing out and lined up with the holes in the side stretchers.", add: ["X"], from: { X: [0, -300, 0] } },
{
title: "Bolt the cross stretcher from each side",
detail: "A washer on each long bolt, one through each side stretcher. Tighten them.",
- fix: [...sideBolt("washer", { len: 1.5, dia: 14 }), ...sideBolt("bolt", { len: 45, dia: 6 })],
+ fix: [...sideBolt("bolt", { len: 45, dia: 6 }), ...sideBolt("washer", { len: 1.5, dia: 14 })],
tools: ["allen"],
},
{ title: "Tighten the four leg bolts", detail: "Now that the stretcher holds the legs square, tighten each one firmly.", tools: ["allen"], check: "square" },
diff --git a/src/lib/plan/families/vattenkar.ts b/src/lib/plan/families/vattenkar.ts
index afe9cdd..b0bb3b9 100644
--- a/src/lib/plan/families/vattenkar.ts
+++ b/src/lib/plan/families/vattenkar.ts
@@ -40,7 +40,7 @@ function deskShelf(s: ProductSpec): CustomParams {
parts.push({ id: "T0", name: "Tray", size: [tw, th, td], pos: [0, yLow, 0], pieces: tray, material: "metal" });
parts.push({ id: "T1", name: "Tray", size: [tw, th, td], pos: [0, yTop, 0], pieces: tray, material: "metal" });
const sides = [-1, 1];
- const trayScrews = (y: number): Vec3[] => sides.flatMap((sx) => [pz - 5, pz + 5].map((z) => [sx * (tw / 2 - t), y, z] as Vec3));
+ const trayScrews = (y: number): Vec3[] => sides.flatMap((sx) => [y - 12, y + 12].map((yy) => [sx * (tw / 2 - t), yy, pz] as Vec3));
return {
parts,
steps: [
diff --git a/src/lib/plan/families/vedbo.ts b/src/lib/plan/families/vedbo.ts
index c3eb3c5..a4d29eb 100644
--- a/src/lib/plan/families/vedbo.ts
+++ b/src/lib/plan/families/vedbo.ts
@@ -116,15 +116,16 @@ function recipe(s: ProductSpec): CustomParams {
pose: "-y",
warnings: ["floor"],
},
- { title: "Tap two dowels into each end of the rail", detail: "Push them in by hand, as far as they go.", fix: [fx("dowel", dowels(-1), [1, 0, 0], "RAIL"), fx("dowel", dowels(1), [-1, 0, 0], "RAIL")] },
+ { title: "Tap two dowels into each end of the rail", detail: "Push them in by hand, as far as they go.", fix: [fx("dowel", dowels(-1), [1, 0, 0], "RAIL", { mate: sideIds[0] }), fx("dowel", dowels(1), [-1, 0, 0], "RAIL", { mate: sideIds[1] })] },
{
title: "Push on a side frame and bolt it to the rail",
detail: `The longer legs go at the front, under the arms. Drop a barrel nut into the rail's end, slot facing the bolt, and turn the bolt in by hand.`,
add: [sideIds[0]],
+ from: { [sideIds[0]]: [-300, 0, 0] }, // along the rail's dowels
fix: [barrel(-1), sideBolt(-1, sideIds[0])],
tools: ["allen", "screwdriver"],
},
- { title: "Fit the other side frame the same way", detail: "Onto the dowels, a barrel nut in the rail, then the bolt. Leave it loose for now.", add: [sideIds[1]], fix: [barrel(1), sideBolt(1, sideIds[1])], tools: ["allen", "screwdriver"] },
+ { title: "Fit the other side frame the same way", detail: "Onto the dowels, a barrel nut in the rail, then the bolt. Leave it loose for now.", add: [sideIds[1]], from: { [sideIds[1]]: [300, 0, 0] }, fix: [barrel(1), sideBolt(1, sideIds[1])], tools: ["allen", "screwdriver"] },
{
title: "Bolt the legs to the shell",
detail: "One bolt through the top of each leg into the side of the shell. Turn them in by hand until the heads touch.",
diff --git a/src/lib/plan/families/vihals.ts b/src/lib/plan/families/vihals.ts
index 28f80af..80666e4 100644
--- a/src/lib/plan/families/vihals.ts
+++ b/src/lib/plan/families/vihals.ts
@@ -16,22 +16,6 @@ import { buildCustom } from "../custom";
type Fix = CustomFix;
const pt = (x: number, y: number, z: number): Vec3 => [Math.round(x), Math.round(y), Math.round(z)];
const at = (kind: HwKind, pts: Vec3[], dir: Vec3, o: { on?: string; mate?: string; len?: number; dia?: number } = {}): Fix => ({ kind, count: pts.length, at: pts, dir, ...o });
-// fittings the recipe builder has no kind for go in as screws of a size no real screw has, and are renamed after
-const CASTOR = { len: 58, dia: 50 };
-const RETYPE: Record<string, { kind: HwKind; name: string }> = { "screw-58-50": { kind: "castor", name: "Castor" }, "screw-44-26": { kind: "roller", name: "Door roller" } };
-function retype(b: PlanBuilder) {
- for (const [id, to] of Object.entries(RETYPE)) {
- const h = b.hw.get(id);
- if (!h) continue;
- h.kind = to.kind;
- h.name = to.name;
- h.spec = "";
- for (const it of b.items) if (it.kind === "hw" && it.ref === id) {
- it.spin = 0;
- it.travel = 50;
- }
- }
-}
const spread = (a: number, c: number, n: number) => Array.from({ length: n }, (_, i) => (n === 1 ? (a + c) / 2 : a + ((c - a) * i) / (n - 1)));
/* ---------------- tables ---------------- */
@@ -150,7 +134,7 @@ function tableRecipe(s: ProductSpec, kind: TableKind): CustomParams {
steps.push({
title: "Bolt the long bar to the end bars",
detail: "One short bolt through each end bar.",
- fix: [at("bolt", [pt(-ex - fb / 2, yf, 0), pt(ex + fb / 2, yf, 0)], [1, 0, 0], { mate: "F2", len: 30, dia: 6 })],
+ fix: [at("bolt", [pt(-ex - fb / 2, yf, 0)], [1, 0, 0], { on: "F0", mate: "F2", len: 40, dia: 6 }), at("bolt", [pt(ex + fb / 2, yf, 0)], [-1, 0, 0], { on: "F1", mate: "F2", len: 40, dia: 6 })],
});
}
steps.push({
@@ -213,7 +197,7 @@ function extendableRecipe(s: ProductSpec): CustomParams {
{ title: "Clip the sliders into the long rails", detail: "Two in each rail. Push each one in and turn it until it locks.", add: ["L0", "L1"], fix: [at("clip", [-FW / 2 + 150, -100].flatMap((x) => [pt(x, yr, -(FD / 2 - rt)), pt(x, yr, FD / 2 - rt)]), [0, 0, 1], { dia: 20, len: 30 })], pose: "-y" },
{ title: "Lay the rails on one half of the top", detail: "Both halves lie upside down on a rug. The rails go on the half with the holes for them.", add: ["topA", "topB"], warnings: ["floor"] },
{ title: "Screw the long rails to the top", detail: "Turn the screws in with the Allen key through the holes in the rails.", fix: [railScrews("L0", -(FD / 2 - rt / 2)), railScrews("L1", FD / 2 - rt / 2)] },
- { title: "Screw in the end stop", detail: "One screw near the middle, so the rails can't slide off.", fix: [at("bolt", [pt(-40, H - tt - rh, 0)], [0, 1, 0], { len: 60, dia: 6 })] },
+ { title: "Screw in the end stop", detail: "One screw near the middle, so the rails can't slide off.", fix: [at("bolt", [pt(-40, H - tt - 10, 0)], [0, 1, 0], { on: "topA", len: 20, dia: 6 })] },
{ title: "Click the corner brackets into the rail ends", detail: "Two at this end.", fix: [at("clamp", [brk[0], brk[1]], [0, -1, 0], { len: 50, dia: 40 })], add: ["SA"] },
{ title: "Bolt on the first two legs", detail: "Washer, then spring washer, on each bolt. Hand tight for now.", add: ["G0", "G1"], fix: legEnd(0, 1), tools: ["wrench"] },
{ title: "Tighten them with the spanner", detail: "Check the spring washers are pressed flat.", tools: ["wrench"], kind: "bolts" },
@@ -230,7 +214,7 @@ function extendableRecipe(s: ProductSpec): CustomParams {
{
title: "Screw the locating plates onto the leaf",
detail: "Two on each long edge, on the underside. Two screws each.",
- fix: [at("plate", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * (leafW / 2 - 30), H - tt - rh + 4, sz * (D / 2 - 120)))), [0, 1, 0], { len: 40, dia: 30 }), at("screw", [-1, 1].flatMap((sx) => [-1, 1].flatMap((sz) => [-12, 12].map((d) => pt(sx * (leafW / 2 - 30) + d, H - tt - rh + 4, sz * (D / 2 - 120))))), [0, 1, 0], { len: 14, dia: 4 })],
+ fix: [at("plate", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * (leafW / 2 - 60), H - tt - rh + 4, sz * (D / 2 - 120)))), [0, 1, 0], { on: "leaf", len: 40, dia: 30 }), at("screw", [-1, 1].flatMap((sx) => [-1, 1].flatMap((sz) => [-25, 25].map((d) => pt(sx * (leafW / 2 - 60) + d, H - tt - rh + 4, sz * (D / 2 - 120))))), [0, 1, 0], { on: "leaf", len: 14, dia: 4 })],
add: ["leaf"],
},
{ title: "Pull the ends apart and lay the leaf in", detail: "Unfold it onto the rails, push the halves together until the plates lock. Store it under the top when you close the table." },
@@ -267,8 +251,9 @@ function gatelegRecipe(s: ProductSpec): CustomParams {
});
parts.push(endFrame(-1, 0), endFrame(1, 1));
for (const [i, sz] of [-1, 1].entries()) parts.push({ id: `R${i}`, name: "Long rail", size: [2 * fx - lg, 40, lg], pos: [0, hL - 20, sz * fz], material: "metal" });
- const shY = [120, 360, 600];
- shY.forEach((y, i) => parts.push({ id: `S${i}`, name: "Shelf", size: [2 * fx - lg, 18, 2 * fz - lg], pos: [0, y, 0], material: "board" }));
+ // the shelves reach the middle of the legs, so their bolts go through the legs into the shelf edges
+ const shY = [150, Math.round(hL / 2), hL - 200];
+ shY.forEach((y, i) => parts.push({ id: `S${i}`, name: "Shelf", size: [2 * fx, 18, 2 * fz - lg], pos: [0, y, 0], material: "board" }));
const gx = mid / 2 + leaf * 0.55;
const gate = (sx: number, i: number): CustomPart => {
const len = gx - fx - lg / 2;
@@ -276,29 +261,39 @@ function gatelegRecipe(s: ProductSpec): CustomParams {
id: `Gt${i}`,
name: "Gate",
size: [len + lg, hL, lg],
- pos: [sx * (fx + lg / 2 + len / 2), hL / 2, fz - lg],
+ pos: [sx * (fx + lg / 2 + len / 2), hL / 2, fz],
material: "metal",
pieces: [
{ shape: "box", size: [lg, hL, lg], pos: [sx * (len / 2), 0, 0] },
{ shape: "box", size: [len, 30, lg], pos: [0, hL / 2 - 60, 0] },
- { shape: "box", size: [len, 30, lg], pos: [0, -hL / 2 + 140, 0] },
+ { shape: "box", size: [len, 30, lg], pos: [0, -hL / 2 + 260, 0] },
],
};
};
parts.push(gate(-1, 0), gate(1, 1));
const hingesTop = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * mid / 2, H - tt, sz * (D / 2 - 150))));
- const hingesGate = [-1, 1].flatMap((sx) => [hL - 100, 200].map((y) => pt(sx * (fx + lg / 2), y, fz - lg)));
+ // a gate's two rails sit level with these heights; a hinge on each rail end, swinging on the end frame's leg
+ const gateY = [hL - 60, 260];
+ const hingesGate = [-1, 1].flatMap((sx) => gateY.map((y) => pt(sx * (fx + lg / 2), y, fz + lg / 2)));
const steps: CustomStep[] = [
{ title: "Screw the guide bolts into the middle top", detail: "Lay the three top pieces upside down on a rug. A washer goes under each bolt.", add: ["topM", "leafL", "leafR"], fix: [at("bolt", [pt(-mid / 2 + 60, H - tt, fz), pt(mid / 2 - 60, H - tt, fz)], [0, 1, 0], { len: 20, dia: 8 }), at("washer", [pt(-mid / 2 + 60, H - tt - 3, fz), pt(mid / 2 - 60, H - tt - 3, fz)], [0, 1, 0], { dia: 16 })], pose: "-y", warnings: ["floor"] },
{ title: "Screw the bumpers onto the leaves", detail: "Two on each leaf, near the outer edge.", fix: [at("glide", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * (W / 2 - 150), H - tt, sz * (D / 2 - 120)))), [0, 1, 0], { dia: 20, len: 12 }), at("screw", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * (W / 2 - 150), H - tt - 6, sz * (D / 2 - 120)))), [0, 1, 0], { len: 16, dia: 4 })] },
{ title: "Hinge the leaves to the middle top", detail: "Two hinges on each joint, eight screws each. Line the pieces up edge to edge first.", fix: [at("hinge", hingesTop, [0, 1, 0], { len: 60, dia: 40 }), at("screw", hingesTop.flatMap((h) => [-24, -8, 8, 24].flatMap((dz) => [-14, 14].map((dx) => pt(h[0] + dx, h[1], h[2] + dz)))), [0, 1, 0], { len: 14, dia: 4 })] },
- { title: "Bolt the end frames to the long rails", detail: "Two bolts at each joint, with the Allen key.", add: ["E0", "E1", "R0", "R1"], fix: [at("bolt", [-1, 1].flatMap((sz) => [-1, 1].map((sx) => pt(sx * (fx - lg / 2), hL - 20, sz * fz))), [-1, 0, 0], { len: 50, dia: 6 })] },
+ { title: "Bolt the end frames to the long rails", detail: "Two bolts at each joint, with the Allen key.", add: ["E0", "E1", "R0", "R1"], fix: [-1, 1].map((sx) => at("bolt", [-1, 1].map((sz) => pt(sx * (fx + lg / 2), hL - 20, sz * fz)), [-sx, 0, 0], { on: `E${sx < 0 ? 0 : 1}`, len: 50, dia: 6 })) },
{ title: "Lay the frame on the middle top", detail: "Centred on it, the open side of the rails up." },
- { title: "Bolt the frame to the top", detail: "Ten long bolts through the rails into the top.", fix: [at("bolt", [...[-1, 1].flatMap((sz) => spread(-fx + 40, fx - 40, 3).map((x) => pt(x, hL - 40, sz * fz))), ...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * fx, hL - 40, sz * (fz - 150))))], [0, 1, 0], { len: 80, dia: 6 })] },
- { title: "Bolt in the shelves", detail: "Four bolts through the end frames into each shelf.", add: ["S0", "S1", "S2"], fix: [at("bolt", shY.flatMap((y) => [-1, 1].map((sz) => pt(-fx - lg / 2, y, sz * (fz - 100)))), [1, 0, 0], { len: 30, dia: 6 }), at("bolt", shY.flatMap((y) => [-1, 1].map((sz) => pt(fx + lg / 2, y, sz * (fz - 100)))), [-1, 0, 0], { len: 30, dia: 6 })] },
- { title: "Bolt each gate together", detail: "The two rails onto the gate leg, one bolt each, and a hinge plate on the free ends.", add: ["Gt0", "Gt1"], fix: [at("bolt", [-1, 1].flatMap((sx) => [hL - 60, 140].map((y) => pt(sx * gx, y, fz - lg))), [0, 0, -1], { len: 40, dia: 6 })] },
- { title: "Hinge the gates to the frame", detail: "Two hinges for each gate, on the leg of the end frame. Six screws each.", fix: [at("hinge", hingesGate, [0, 0, -1], { len: 50, dia: 35 }), at("screw", hingesGate.flatMap((h) => [-20, 0, 20].flatMap((dy) => [-10, 10].map((dx) => pt(h[0] + dx, h[1] + dy, h[2] + lg / 2)))), [0, 0, -1], { len: 12, dia: 4 })] },
- { title: "Stick the felt pads under the feet", detail: "One under every leg, the gates' too.", fix: [at("glide", [...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * fx, 0, sz * fz))), ...[-1, 1].map((sx) => pt(sx * gx, 0, fz - lg))].slice(0, 4), [0, 1, 0], { dia: 24, len: 3 })] },
+ { title: "Bolt the frame to the top", detail: "Ten long bolts through the rails into the top.", fix: [at("bolt", [...[-1, 1].flatMap((sz) => spread(-fx + 40, fx - 40, 3).map((x) => pt(x, hL - 40, sz * fz))), ...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * fx, hL - 40, sz * (fz - 150))))], [0, 1, 0], { len: 55, dia: 6 })] },
+ { title: "Bolt in the shelves", detail: "Four bolts through the legs into each shelf, one at each corner.", add: ["S0", "S1", "S2"], fix: [-1, 1].map((sz) => at("bolt", shY.flatMap((y) => [-1, 1].map((sx) => pt(sx * (fx - 8), y, sz * (fz + lg / 2)))), [0, 0, -sz], { len: 40, dia: 6 })) },
+ { title: "Bolt each gate together", detail: "The two rails onto the gate leg, one bolt each, and a hinge plate on the free ends.", add: ["Gt0", "Gt1"], fix: [-1, 1].map((sx, i) => at("bolt", gateY.map((y) => pt(sx * (gx + lg / 2), y, fz)), [-sx, 0, 0], { on: `Gt${i}`, len: 40, dia: 6 })) },
+ {
+ title: "Hinge the gates to the frame",
+ detail: "Two hinges for each gate: two screws into the rail end, four into the leg of the end frame.",
+ fix: [
+ at("hinge", hingesGate, [0, 0, -1], { len: 50, dia: 35 }),
+ at("screw", hingesGate.flatMap((h) => [25, 50].map((dx) => pt(h[0] + Math.sign(h[0]) * dx, h[1] + 15, fz))), [0, -1, 0], { len: 12, dia: 4 }),
+ at("screw", hingesGate.flatMap((h) => [-48, -24, 24, 48].map((dy) => pt(h[0] - Math.sign(h[0]) * 20, h[1] + dy, h[2]))), [0, 0, -1], { len: 12, dia: 4 }),
+ ],
+ },
+ { title: "Stick the felt pads under the feet", detail: "One under every leg, the gates' too.", fix: [at("glide", [...[-1, 1].flatMap((sx) => [-1, 1].map((sz) => pt(sx * fx, 0, sz * fz))), ...[-1, 1].map((sx) => pt(sx * gx, 0, fz))].slice(0, 4), [0, 1, 0], { dia: 24, len: 3 })] },
{ title: "Fold the gates in and turn it over together", detail: "Lift it by the frame with a helper.", pose: "+y", people: 2 },
{ title: "Swing a gate out and lift a leaf onto it", detail: "Do the same on the other side to open the table fully.", repeat: 2 },
];
@@ -582,7 +577,9 @@ function cabRecipe(s: ProductSpec, cfg: CabCfg): CustomParams {
fix: [
at("runner", left, [-1, 0, 0], { len: rl, dia: 20 }),
at("runner", right, [1, 0, 0], { len: rl, dia: 20 }),
- at("screw", [...left, ...right].flatMap((p) => [-1, 0, 1].map((k) => pt(p[0], p[1], p[2] + k * (rl / 2 - 40)))), [0, 0, 1], { len: 13, dia: 4 }),
+ // through the runner into the panel behind it
+ at("screw", left.flatMap((p) => [-1, 0.5, 1].map((k) => pt(p[0] + 2, p[1], p[2] + k * (rl / 2 - 40)))), [-1, 0, 0], { len: 13, dia: 4 }),
+ at("screw", right.flatMap((p) => [-1, 0.5, 1].map((k) => pt(p[0] - 2, p[1], p[2] + k * (rl / 2 - 40)))), [1, 0, 0], { len: 13, dia: 4 }),
],
warnings: ["floor"],
});
@@ -664,7 +661,7 @@ function cabRecipe(s: ProductSpec, cfg: CabCfg): CustomParams {
}
if (cfg.rail) {
const c = xs[0];
- steps.push({ title: "Screw up the clothes rail", detail: "Clip the rail into its holders and screw a holder to each side.", add: ["rail"], fix: [at("clip", [pt(c[0], cfg.rail, -40)], [-1, 0, 0], { dia: 30, len: 20 }), at("clip", [pt(c[1], cfg.rail, -40)], [1, 0, 0], { dia: 30, len: 20 }), at("screw", [pt(c[0], cfg.rail + 12, -52), pt(c[0], cfg.rail - 12, -28), pt(c[1], cfg.rail + 12, -52), pt(c[1], cfg.rail - 12, -28)], [0, 0, 1], { len: 12, dia: 4 })] });
+ steps.push({ title: "Screw up the clothes rail", detail: "Clip the rail into its holders and screw a holder to each side.", add: ["rail"], fix: [at("clip", [pt(c[0], cfg.rail, -40)], [-1, 0, 0], { dia: 30, len: 20 }), at("clip", [pt(c[1], cfg.rail, -40)], [1, 0, 0], { dia: 30, len: 20 }), at("screw", [-1, 1].map((k) => pt(c[0] + 2, cfg.rail!, -40 + k * 25)), [-1, 0, 0], { len: 12, dia: 4 }), at("screw", [-1, 1].map((k) => pt(c[1] - 2, cfg.rail!, -40 + k * 25)), [1, 0, 0], { len: 12, dia: 4 })] });
}
// sliding doors run in tracks pressed into the top and bottom
@@ -686,7 +683,18 @@ function cabRecipe(s: ProductSpec, cfg: CabCfg): CustomParams {
const guides = rollers.map((r) => pt(r[0], yT - 8, r[2]));
steps.push({ title: "Press in the bottom track", detail: "Start at one end and press it into the groove, a section at a time.", add: ["trB"] });
steps.push({ title: "Press in the top track", detail: "The same way, into the groove under the top.", add: ["trT"] });
- steps.push({ title: "Screw the rollers and guides onto the doors", detail: "Lay the doors on a rug. Rollers at the bottom edge, guides at the top.", fix: [at("screw", rollers, [0, 1, 0], { len: ROLLER.len, dia: ROLLER.dia }), at("clip", guides, [0, -1, 0], { dia: 26, len: 18 }), at("screw", [...rollers, ...guides].flatMap((r) => [pt(r[0] - 12, r[1], r[2]), pt(r[0] + 12, r[1], r[2])]), [0, 1, 0], { len: 12, dia: 4 })] });
+ const onDoor = (i: number, pts: Vec3[]) => pts.filter((p) => (p[0] < 0) === (i === 0));
+ steps.push({
+ title: "Screw the rollers and guides onto the doors",
+ detail: "Lay the doors on a rug. Rollers at the bottom edge, guides at the top.",
+ wait: ["sd0", "sd1"],
+ fix: [0, 1].flatMap((i) => [
+ at("roller", onDoor(i, rollers), [0, 1, 0], { on: `sd${i}` }),
+ at("clip", onDoor(i, guides), [0, -1, 0], { on: `sd${i}`, dia: 26, len: 18 }),
+ at("screw", onDoor(i, rollers).flatMap((r) => [pt(r[0] - 25, r[1], r[2]), pt(r[0] + 25, r[1], r[2])]), [0, 1, 0], { on: `sd${i}`, len: 12, dia: 4 }),
+ at("screw", onDoor(i, guides).flatMap((r) => [pt(r[0] - 25, r[1], r[2]), pt(r[0] + 25, r[1], r[2])]), [0, -1, 0], { on: `sd${i}`, len: 12, dia: 4 }),
+ ]),
+ });
steps.push({ title: "Hang the back door, then the front one", detail: "Tilt the top into the top track, then lower the rollers into the bottom track until they lock.", add: ["sd0", "sd1"], from: { sd0: [0, 0, 400], sd1: [0, 0, 400] } });
steps.push({ title: "Clip on the door stops and bumpers", detail: "They stop the doors at each end and keep them quiet.", fix: [at("clip", [pt(-W / 2 + t, H / 2, D / 2 - 30), pt(W / 2 - t, H / 2, D / 2 - 30)], [0, 0, -1], { dia: 18, len: 12 })] });
}
@@ -757,7 +765,7 @@ function cabRecipe(s: ProductSpec, cfg: CabCfg): CustomParams {
steps.push({
title: "Screw the drawer runners on",
detail: "Turn each drawer upside down. The runner marked for each side goes under its bottom edge, two screws each.",
- fix: [at("runner", runL, [1, 0, 0], { len: Math.round((dP - FR - 60) / 10) * 10, dia: 18 }), at("runner", runR, [-1, 0, 0], { len: Math.round((dP - FR - 60) / 10) * 10, dia: 18 }), at("screw", [...runL, ...runR].flatMap((q) => [pt(q[0], q[1] - 12, q[2] - 120), pt(q[0], q[1] - 12, q[2] + 120)]), [0, 1, 0], { len: 10, dia: 4 })],
+ fix: [at("runner", runL, [1, 0, 0], { len: Math.round((dP - FR - 60) / 10) * 10, dia: 18 }), at("runner", runR, [-1, 0, 0], { len: Math.round((dP - FR - 60) / 10) * 10, dia: 18 }), at("screw", [...runL.map((q) => pt(q[0] + 6, q[1] - 10, q[2])), ...runR.map((q) => pt(q[0] - 6, q[1] - 10, q[2]))].flatMap((q) => [pt(q[0], q[1], q[2] - 60), pt(q[0], q[1], q[2] + 60)]), [0, 1, 0], { len: 10, dia: 4 })],
});
steps.push({ title: many ? "Screw a grip under each front" : "Screw the grip under the front", detail: "The metal grip goes under the top edge of the front.", fix: [at("handle", dIds.map((d) => pt(d.xc, d.d.y1 - 2, D / 2 - FR / 2)), [0, -1, 0], { len: 128, dia: 12 })] });
steps.push({ title: many ? "Slide the drawers in" : "Slide the drawer in", detail: "Lift the front a little and push until the runners click together." });
@@ -765,8 +773,6 @@ function cabRecipe(s: ProductSpec, cfg: CabCfg): CustomParams {
return { parts, steps };
}
-const ROLLER = { len: 44, dia: 26 };
-
/** Where each VIHALS cabinet's columns, shelves and fronts go, from the photo and its manual. */
function cabinetCfg(s: ProductSpec): CabCfg | null {
const W = s.size.w * 10, H = s.size.h * 10;
@@ -870,7 +876,7 @@ function bedsideRecipe(s: ProductSpec): CustomParams {
{
title: "Screw on the castors",
detail: "Turn it upside down. Four screws hold each castor plate to the bottom.",
- fix: [at("screw", wheels, [0, 1, 0], { on: "bot", len: CASTOR.len, dia: CASTOR.dia }), at("screw", wheels.flatMap((w) => [-1, 1].flatMap((a) => [-1, 1].map((b) => pt(w[0] + a * 18, cH, w[2] + b * 18)))), [0, 1, 0], { on: "bot", len: 16, dia: 4 })],
+ fix: [at("castor", wheels, [0, 1, 0], { on: "bot" }), at("screw", wheels.flatMap((w) => [-1, 1].flatMap((a) => [-1, 1].map((b) => pt(w[0] + a * 18, cH, w[2] + b * 18)))), [0, 1, 0], { on: "bot", len: 16, dia: 4 })],
pose: "-y",
},
{ title: "Push in the shelf supports", detail: "Turn it back over. Two in each side, at the same height.", fix: supports([{ x0: -W / 2 + t, x1: W / 2 - t, y: ys }], D), pose: "+y" },
@@ -943,6 +949,40 @@ function chairRecipe(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/* ---------------- folding chair ---------------- */
+
+/*
+ * The folding chair comes assembled and has no manual: it is unfolded and locked, nothing more. Its frame is two
+ * long tubes from the back feet up into the backrest, a front frame from the front feet up under the seat, and the
+ * seat hinged between them.
+ */
+function foldingChairRecipe(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10) || 430, H = Math.round(s.size.h * 10) || 800, D = Math.round(s.size.d * 10) || 470;
+ const yS = 450, tube = 20, xs = W / 2 - tube;
+ const tubeBetween = (a: [number, number], c: [number, number], x: number): PartPiece => {
+ const dy = c[0] - a[0], dz = c[1] - a[1];
+ return { shape: "cyl", size: [tube, Math.round(Math.hypot(dy, dz)), tube], pos: [x, (a[0] + c[0]) / 2 - H / 2, (a[1] + c[1]) / 2], rot: [Math.atan2(dz, dy), 0, 0] };
+ };
+ const back: [number, number][] = [[0, -D / 2 + 30], [H - 20, -D / 2 + 90]];
+ const front: [number, number][] = [[0, D / 2 - 20], [yS - 30, -D / 2 + 110]];
+ const pieces: PartPiece[] = [
+ ...[-1, 1].map((sx) => tubeBetween(back[0], back[1], sx * xs)),
+ ...[-1, 1].map((sx) => tubeBetween(front[0], front[1], sx * (xs - tube))),
+ { shape: "cyl", size: [tube, 2 * (xs - tube), tube], pos: [0, 20 - H / 2, D / 2 - 30], rot: [0, 0, Math.PI / 2] },
+ ];
+ const parts: CustomPart[] = [
+ { id: "frame", name: "Chair frame", size: [W, H, D], pos: [0, H / 2, 0], material: "metal", pieces },
+ { id: "back", name: "Backrest", size: [W - 10, 150, 22], pos: [0, H - 90, -D / 2 + 84], material: "board" },
+ { id: "seat", name: "Seat", size: [W - 40, 22, D - 80], pos: [0, yS, 30], material: "board" },
+ ];
+ const steps: CustomStep[] = [
+ { title: "Take the folded chair out of the box", detail: "It comes assembled, with nothing to screw together. Stand it on its feet, still folded.", add: ["frame", "back"], from: { frame: [0, 300, 0], back: [0, 300, 0] } },
+ { title: "Unfold it and press the seat down", detail: "Pull the back and the front legs apart, then push the seat down until it lies flat and the frame locks.", add: ["seat"], from: { seat: [0, 260, -200] } },
+ { title: "Check it stands steady", detail: "All four feet should touch the floor. To fold it, lift the front edge of the seat." },
+ ];
+ return { parts, steps };
+}
+
/* ---------------- bed frames ---------------- */
/*
@@ -970,10 +1010,11 @@ function bedRecipe(s: ProductSpec): CustomParams {
{ id: "srR", name: "Slat rail", size: [srS, srS, railL], pos: [xs, ySr, 0], material: "metal" },
];
// two cross straps from corner to corner under the slat rails
- const dx = 2 * (xs - 20), dz = railL - 80, len = Math.hypot(dx, dz), ang = Math.atan2(dx, dz);
+ const dx = 2 * xs, dz = railL - 80, len = Math.hypot(dx, dz), ang = Math.atan2(dx, dz);
parts.push({ id: "strap0", name: "Cross strap", size: [24, 3, len], pos: [0, ySr - srS / 2 - 2, 0], material: "metal", rot: [0, ang, 0] });
parts.push({ id: "strap1", name: "Cross strap", size: [24, 3, len], pos: [0, ySr - srS / 2 - 5, 0], material: "metal", rot: [0, -ang, 0] });
- if (dbl) parts.push({ id: "beam", name: "Centre beam", size: [40, 40, railL], pos: [0, ySr - 5, 0], material: "metal" });
+ // the centre beam sits between the straps and the slats
+ if (dbl) parts.push({ id: "beam", name: "Centre beam", size: [40, 30, railL], pos: [0, ySr, 0], material: "metal" });
const yS = ySr + srS / 2 + 8;
parts.push({ id: "slats", name: "Slatted bed base", size: [2 * (xs + srS / 2) - 10, 16, railL - 20], pos: [0, yS, 0], material: "wood" });
@@ -985,7 +1026,8 @@ function bedRecipe(s: ProductSpec): CustomParams {
const cams = (a: number) => [pt(a * (xr - t / 2), yHi, -L / 2 + t + 34), pt(a * (xr - t / 2), yHi, L / 2 - t - 34)];
const nuts = (a: number) => [pt(a * (xr - t / 2), yLo, -L / 2 + t + 50), pt(a * (xr - t / 2), yLo, L / 2 - t - 50)];
const srScrews = (a: number) => spread(-railL / 2 + 80, railL / 2 - 80, 8).map((z) => pt(a * (xs - srS / 2), ySr, z));
- const strapEnds = [pt(-xs, ySr - srS / 2, -dz / 2), pt(xs, ySr - srS / 2, dz / 2), pt(xs, ySr - srS / 2, -dz / 2), pt(-xs, ySr - srS / 2, dz / 2)];
+ // each strap end is screwed up through the strap into its slat rail; strap0 runs from back left to front right
+ const yS0 = ySr - srS / 2 - 3.5, yS1 = ySr - srS / 2 - 6.5;
const steps: CustomStep[] = [
{ title: "Push the glides into the head and foot boards", detail: "Lay both boards flat on a rug. The glides go into the holes in their bottom edges.", add: ["head", "foot"], fix: [at("glide", glides, [0, 1, 0], { dia: 30, len: 10 })], warnings: ["floor"] },
@@ -1011,20 +1053,23 @@ function bedRecipe(s: ProductSpec): CustomParams {
];
if (dbl) {
const brk = [pt(0, ySr - 30, -L / 2 + t), pt(0, ySr - 30, L / 2 - t)];
- steps.push({ title: "Screw a beam bracket to each board", detail: "In the middle of the headboard and the footboard, open side up.", fix: [at("angle", [brk[0]], [0, 0, -1], { on: "head", len: 60, dia: 50 }), at("angle", [brk[1]], [0, 0, 1], { on: "foot", len: 60, dia: 50 }), at("screw", brk.flatMap((b) => [pt(-20, b[1], b[2]), pt(20, b[1], b[2])]), [0, 0, 1], { len: 15, dia: 5 })] });
+ steps.push({ title: "Screw a beam bracket to each board", detail: "In the middle of the headboard and the footboard, open side up.", fix: [at("angle", [brk[0]], [0, 0, -1], { on: "head", len: 60, dia: 50 }), at("angle", [brk[1]], [0, 0, 1], { on: "foot", len: 60, dia: 50 }), at("screw", [pt(-25, brk[0][1], brk[0][2] + 1), pt(25, brk[0][1], brk[0][2] + 1)], [0, 0, -1], { on: "head", len: 15, dia: 5 }), at("screw", [pt(-25, brk[1][1], brk[1][2] - 1), pt(25, brk[1][1], brk[1][2] - 1)], [0, 0, 1], { on: "foot", len: 15, dia: 5 })] });
}
steps.push({
title: "Screw the cross straps under the slat rails",
detail: "From corner to corner, so they cross in the middle. They keep the frame square.",
add: ["strap0", "strap1"],
- fix: [at("screw", [...strapEnds, pt(0, ySr - srS / 2 - 6, 0), pt(-30, ySr - srS / 2 - 6, 0), pt(30, ySr - srS / 2 - 6, 0)], [0, 1, 0], { len: 10, dia: 4 })],
+ fix: [
+ at("screw", [pt(-xs, yS0, -dz / 2), pt(xs, yS0, dz / 2)], [0, 1, 0], { on: "strap0", len: 10, dia: 4 }),
+ at("screw", [pt(xs, yS1, -dz / 2), pt(-xs, yS1, dz / 2), pt(0, yS1, 0)], [0, 1, 0], { on: "strap1", len: 10, dia: 4 }),
+ ],
check: "square",
});
if (dbl) steps.push({ title: "Lay the centre beam on the brackets", detail: "Join its two halves first, then drop the ends into the brackets.", add: ["beam"] });
steps.push({
title: "Screw on the slat stops",
detail: "One at each end of both slat rails.",
- fix: [at("clip", sx.flatMap((a) => [pt(a * xs, ySr + srS / 2, -railL / 2 + 30), pt(a * xs, ySr + srS / 2, railL / 2 - 30)]), [0, -1, 0], { dia: 24, len: 20 }), at("screw", sx.flatMap((a) => [pt(a * (xs + 6), ySr + srS / 2, -railL / 2 + 40), pt(a * (xs + 6), ySr + srS / 2, railL / 2 - 40)]), [0, -1, 0], { len: 10, dia: 6 })],
+ fix: [at("clip", sx.flatMap((a) => [pt(a * xs, ySr + srS / 2, -railL / 2 + 30), pt(a * xs, ySr + srS / 2, railL / 2 - 30)]), [0, -1, 0], { dia: 24, len: 20 }), at("screw", sx.flatMap((a) => [pt(a * xs, ySr + srS / 2, -railL / 2 + 55), pt(a * xs, ySr + srS / 2, railL / 2 - 55)]), [0, -1, 0], { len: 10, dia: 6 })],
});
steps.push({ title: "Roll out the slats", detail: "Curved side up. Push each end slat under its stop.", add: ["slats"] });
return { parts, steps };
@@ -1076,9 +1121,9 @@ function boxParts(sets: { x: number; side: 1 | -1 }[], z0: number, z1: number, b
{ kind: "camScrew", count: 11, len: 44, to: [bottoms[1]] },
],
},
- { title: "Stand the front, back, ends and divider on the bottoms", detail: "Each one pushes down over its dowels and cam bolts.", add: uprights, from },
+ { title: "Stand the front, back, ends and divider on the bottoms", detail: "Each one pushes down over its dowels and cam bolts.", add: uprights, from: Object.fromEntries(uprights.map((id) => [id, [0, 250, 0] as Vec3])) },
{ title: "Turn the cam locks to pull the boxes tight", detail: "One for every cam bolt.", fix: [{ kind: "cam", count: 22 }], tools: ["screwdriver"] },
- { title: "Screw on the castors", detail: "Turn each box over. Two screws hold each castor.", fix: [at("screw", castors, [0, 1, 0], { len: CASTOR.len, dia: CASTOR.dia }), at("screw", castors.flatMap((c) => [pt(c[0] - 15, cH, c[2]), pt(c[0] + 15, cH, c[2])]), [0, 1, 0], { len: 14, dia: 4 })] },
+ { title: "Screw on the castors", detail: "Turn each box over. Two screws hold each castor.", fix: [at("castor", castors, [0, 1, 0]), at("screw", castors.flatMap((c) => [pt(c[0] - 25, cH, c[2]), pt(c[0] + 25, cH, c[2])]), [0, 1, 0], { len: 14, dia: 4 })] },
);
if (two) steps.push({ title: "Build the second set the same way", detail: "Then push all the boxes under the bed, fronts out." });
else steps.push({ title: "Push the boxes in under the frame", detail: "Fronts out. They roll in on their castors." });
@@ -1146,7 +1191,7 @@ function dayBedRecipe(s: ProductSpec): CustomParams {
{ id: "srB", name: "Slat rail", size: [inW, srS, srS], pos: [0, ySr, -zs], material: "metal" },
{ id: "srF", name: "Slat rail", size: [inW, srS, srS], pos: [0, ySr, zs], material: "metal" },
];
- const dx = inW - 80, dz = 2 * (zs - 20), len = Math.hypot(dx, dz), ang = Math.atan2(dz, dx);
+ const dx = inW - 80, dz = 2 * zs, len = Math.hypot(dx, dz), ang = Math.atan2(dz, dx);
parts.push({ id: "strap0", name: "Cross strap", size: [len, 3, 24], pos: [0, ySr - srS / 2 - 2, 0], material: "metal", rot: [0, ang, 0] });
parts.push({ id: "strap1", name: "Cross strap", size: [len, 3, 24], pos: [0, ySr - srS / 2 - 5, 0], material: "metal", rot: [0, -ang, 0] });
const yS = ySr + srS / 2 + 8;
@@ -1162,7 +1207,8 @@ function dayBedRecipe(s: ProductSpec): CustomParams {
const cams = (id: "back" | "front", a: number) => jointY(id).map((y) => pt(a * (W / 2 - t - 34), y - 30, jointZ(id) + (id === "front" ? -t / 2 : t / 2)));
const feet = xa.flatMap((a) => [pt(a * xe, 0, -D / 2 + 60), pt(a * xe, 0, D / 2 - 60)]);
const srScrews = (z: number, dir: number) => spread(-inW / 2 + 80, inW / 2 - 80, 8).map((x) => pt(x, ySr, z + dir * (srS / 2)));
- const strapEnds = [pt(-dx / 2, ySr - srS / 2, -dz / 2), pt(dx / 2, ySr - srS / 2, dz / 2), pt(dx / 2, ySr - srS / 2, -dz / 2)];
+ // up through each strap end into its slat rail: strap0 runs from front left to back right, strap1 the other way
+ const yS0 = ySr - srS / 2 - 3.5, yS1 = ySr - srS / 2 - 6.5;
const steps: CustomStep[] = [
{
@@ -1192,11 +1238,11 @@ function dayBedRecipe(s: ProductSpec): CustomParams {
detail: "One at each end of both slat rails.",
fix: [
at("clip", [-1, 1].flatMap((sz) => [pt(-inW / 2 + 30, ySr + srS / 2, sz * zs), pt(inW / 2 - 30, ySr + srS / 2, sz * zs)]), [0, -1, 0], { dia: 24, len: 20 }),
- at("screw", [-1, 1].flatMap((sz) => [pt(-inW / 2 + 40, ySr + srS / 2, sz * (zs + 6)), pt(inW / 2 - 40, ySr + srS / 2, sz * (zs + 6))]), [0, -1, 0], { len: 10, dia: 6 }),
+ at("screw", [-1, 1].flatMap((sz) => [pt(-inW / 2 + 55, ySr + srS / 2, sz * zs), pt(inW / 2 - 55, ySr + srS / 2, sz * zs)]), [0, -1, 0], { len: 10, dia: 6 }),
],
},
- { title: "Screw the cross straps under the slat rails", detail: "From corner to corner, so they cross in the middle.", add: ["strap0", "strap1"], fix: [at("screw", strapEnds, [0, 1, 0], { len: 10, dia: 4 })], check: "square" },
- { title: "Screw the last ends of the straps", detail: "Check the frame is square first: the diagonals should match.", fix: [at("screw", [pt(-dx / 2, ySr - srS / 2, dz / 2), pt(0, ySr - srS / 2 - 6, 0)], [0, 1, 0], { len: 10, dia: 4 })] },
+ { title: "Screw the cross straps under the slat rails", detail: "From corner to corner, so they cross in the middle.", add: ["strap0", "strap1"], fix: [at("screw", [pt(-dx / 2, yS1, -dz / 2), pt(dx / 2, yS1, dz / 2)], [0, 1, 0], { on: "strap1", len: 10, dia: 4 }), at("screw", [pt(dx / 2, yS0, -dz / 2)], [0, 1, 0], { on: "strap0", len: 10, dia: 4 })], check: "square" },
+ { title: "Screw the last ends of the straps", detail: "Check the frame is square first: the diagonals should match.", fix: [at("screw", [pt(-dx / 2, yS0, dz / 2)], [0, 1, 0], { on: "strap0", len: 10, dia: 4 }), at("screw", [pt(0, yS1, 0)], [0, 1, 0], { on: "strap1", len: 10, dia: 4 })] },
{ title: "Roll out the slats", detail: "Curved side up. Push each end slat under its stop.", add: ["slats"] },
];
@@ -1238,17 +1284,21 @@ function trundle(W: number, D: number): { parts: CustomPart[]; steps: CustomStep
const castors = xb.flatMap((x) => [pt(x, cH, z0 - Wd / 2 + 120), pt(x, cH, z0 + Wd / 2 - 120)]);
const railScrews = (z: number, d: number) => spread(-L / 2 + 120, L / 2 - 120, 8).map((x) => pt(x, ySr, z + d * (srS / 2)));
const ends = (z: number) => xb.map((x) => pt(x, cH + 30, z));
+ // at each bar end a dowel high, a cam bolt low and the long bolt beside them, far enough apart to show
+ const dw = (p: Vec3) => pt(p[0] - 12, p[1] + 20, p[2]);
+ const cb = (p: Vec3) => pt(p[0] - 12, p[1] - 20, p[2]);
+ const lb = (p: Vec3) => pt(p[0] + 12, p[1], p[2]);
const steps: CustomStep[] = [
- { title: "Tap the dowels into the cross bars", detail: "The trundle is built upside down on a rug. Lay out the four bars; one dowel goes into each end.", add: xb.map((_, i) => `tX${i}`), fix: [at("dowel", ends(zk + t / 2), [0, 0, 1], { mate: "tK" }), at("dowel", ends(zf - t / 2), [0, 0, -1], { mate: "tF" })], warnings: ["floor"] },
- { title: "Screw two castors onto each cross bar", detail: "The castors with brakes go on the two outer bars.", fix: [at("screw", castors, [0, 1, 0], { len: CASTOR.len, dia: CASTOR.dia }), at("screw", castors.flatMap((c) => [pt(c[0], cH, c[2] - 15), pt(c[0], cH, c[2] + 15)]), [0, 1, 0], { len: 16, dia: 4 })] },
+ { title: "Tap the dowels into the cross bars", detail: "The trundle is built upside down on a rug. Lay out the four bars; one dowel goes into each end.", add: xb.map((_, i) => `tX${i}`), fix: [at("dowel", ends(zk + t / 2).map(dw), [0, 0, 1], { mate: "tK" }), at("dowel", ends(zf - t / 2).map(dw), [0, 0, -1], { mate: "tF" })], warnings: ["floor"] },
+ { title: "Screw two castors onto each cross bar", detail: "The castors with brakes go on the two outer bars.", fix: [at("castor", castors, [0, 1, 0]), at("screw", castors.flatMap((c) => [pt(c[0], cH, c[2] - 25), pt(c[0], cH, c[2] + 25)]), [0, 1, 0], { len: 16, dia: 4 })] },
{ title: "Screw a slat rail to the trundle back", detail: "Eight screws, flat edge toward the top of the bed.", add: ["tK", "tSk"], fix: [at("screw", railScrews(zk + t / 2 + srS / 2, 1), [0, 0, -1], { len: 15, dia: 5 })] },
- { title: "Stand the cross bars in the back", detail: "Push them onto the cam bolts and turn the cam locks.", fix: [at("camScrew", ends(zk + t / 2).map((p) => pt(p[0], p[1] - 15, p[2])), [0, 0, -1], { on: "tK" }), { kind: "cam", count: 4, to: ["tK"] }], tools: ["screwdriver"] },
+ { title: "Stand the cross bars in the back", detail: "Push them onto the cam bolts and turn the cam locks.", fix: [at("camScrew", ends(zk + t / 2).map(cb), [0, 0, -1], { on: "tK" }), { kind: "cam", count: 4, to: ["tK"] }], tools: ["screwdriver"] },
{ title: "Screw the other slat rail to the trundle front", detail: "Eight screws, the same way as the first.", add: ["tSf"], fix: [at("screw", railScrews(zf - t / 2 - srS / 2, -1), [0, 0, 1], { len: 15, dia: 5 })] },
- { title: "Lower the front onto the cross bars", detail: "Over the dowels and cam bolts, then turn its cam locks.", add: ["tF"], fix: [at("camScrew", ends(zf - t / 2).map((p) => pt(p[0], p[1] - 15, p[2])), [0, 0, 1], { on: "tF" }), { kind: "cam", count: 4, to: ["tF"] }], tools: ["screwdriver"] },
+ { title: "Lower the front onto the cross bars", detail: "Over the dowels and cam bolts, then turn its cam locks.", add: ["tF"], fix: [at("camScrew", ends(zf - t / 2).map(cb), [0, 0, 1], { on: "tF" }), { kind: "cam", count: 4, to: ["tF"] }], tools: ["screwdriver"] },
{
- title: "Bolt the long panels to the cross bars",
- detail: "Barrel nuts into the bars, long bolts through the panels into them.",
- fix: [at("nut", xb.flatMap((x) => [pt(x - 20, cH + 60, zk + 80), pt(x - 20, cH + 60, zf - 80)]), [0, -1, 0], { dia: 10 }), at("bolt", ends(zk - t / 2), [0, 0, 1], { len: 80, dia: 7 }), at("bolt", ends(zf + t / 2), [0, 0, -1], { len: 80, dia: 7 })],
+ title: "Bolt the front to the cross bars",
+ detail: "A barrel nut into each bar, then a long bolt through the front into it.",
+ fix: [at("nut", xb.map((x) => pt(x + 12, cH + 60, zf - t / 2 - 70)), [0, -1, 0], { dia: 10 }), at("bolt", ends(zf + t / 2).map(lb), [0, 0, -1], { on: "tF", len: 80, dia: 7 })],
},
{ title: "Turn the trundle over and roll out its slats", detail: "Curved side up, the end slats under the stops.", add: ["tSl"] },
{ title: "Screw the pull handles onto the front", detail: "One near each end, two screws each.", fix: [at("handle", [pt(-L / 2 + 250, 140, zf + t / 2), pt(L / 2 - 250, 140, zf + t / 2)], [0, 0, -1], { len: 80, dia: 30 })] },
@@ -1268,6 +1318,7 @@ function recipe(s: ProductSpec): CustomParams | null {
if (s.archetype === "bed" && /^bed frame/i.test(s.variant)) return bedWithBoxes(s);
if (s.archetype === "bed" && /^day-bed/i.test(s.variant)) return dayBedRecipe(s);
if (/^chair$/i.test(s.variant)) return chairRecipe(s);
+ if (/^folding chair/i.test(s.variant) || /vihals-folding-chair/.test(s.slug ?? "")) return foldingChairRecipe(s);
if (s.archetype === "cabinet" || s.archetype === "drawers" || /^storage unit/i.test(s.variant)) {
const cfg = cabinetCfg(s);
if (cfg) return cabRecipe(s, cfg);
@@ -1281,7 +1332,6 @@ const family: Family = {
const r = recipe(s);
if (!r) return false;
buildCustom(b, { ...s, custom: r });
- retype(b);
return true;
},
};
diff --git a/src/lib/plan/families/vikhammer.ts b/src/lib/plan/families/vikhammer.ts
index 08751c9..00e9f95 100644
--- a/src/lib/plan/families/vikhammer.ts
+++ b/src/lib/plan/families/vikhammer.ts
@@ -92,6 +92,8 @@ function boxRecipe(s: ProductSpec): { parts: CustomPart[]; steps: CustomStep[] }
title: "Tap in four dowels and stand the sides on the bottom",
detail: "The runners face in, towards each other. Push each side down onto its dowels and cam bolts.",
add: sides,
+ // straight down onto the dowels and cam bolts
+ from: { SIDE_L: [0, 300, 0], SIDE_R: [0, 300, 0] },
fix: [fx("dowel", dowelsLow, [0, -1, 0], "BOT")],
tools: ["hammer"],
},
diff --git a/src/lib/plan/families/vildgas.ts b/src/lib/plan/families/vildgas.ts
index 215c71f..2274e39 100644
--- a/src/lib/plan/families/vildgas.ts
+++ b/src/lib/plan/families/vildgas.ts
@@ -126,7 +126,7 @@ function chair(): CustomParams {
{
title: "Screw the seat to the frames",
detail: "Four screws, two through the brackets on each side.",
- fix: sides.map((sx) => at("screw", [[sx * xT, yR - TUBE / 2, 80], [sx * xT, yR - TUBE / 2, -80]], [0, 1, 0], sx < 0 ? "F0" : "F1", { ...screw, mate: "S" })),
+ fix: sides.map((sx) => at("screw", [[sx * xT, yR - TUBE / 2, 50], [sx * xT, yR - TUBE / 2, -50]], [0, 1, 0], sx < 0 ? "F0" : "F1", { ...screw, mate: "S" })),
tools: ["screwdriver"],
},
{
diff --git a/src/lib/plan/families/vilhatten.ts b/src/lib/plan/families/vilhatten.ts
index ed55973..3cbf863 100644
--- a/src/lib/plan/families/vilhatten.ts
+++ b/src/lib/plan/families/vilhatten.ts
@@ -93,6 +93,7 @@ function carcass(): { parts: CustomPart[]; steps: CustomStep[] } {
title: "Screw two connector bolts into the fixed shelf",
detail: "Into the holes in the middle of its underside, by hand or with the screwdriver, until they stop.",
fix: [at("camScrew", [ZM - 60, ZM + 60].map((z) => [0, ySh, z] as Vec3), [0, 1, 0], { ...CONNECTOR, on: "SH" })],
+ from: { SH: [0, 300, 0] },
tools: ["screwdriver"],
},
{ title: "Push the divider onto the shelf", detail: "The connector bolts and dowels go into its top end; the runners face right.", add: ["DV"], from: { DV: [0, -300, 0] } },
@@ -126,7 +127,7 @@ function carcass(): { parts: CustomPart[]; steps: CustomStep[] } {
{
title: "Tap the dowels into the plinth and the back rail",
detail: "Two in each end of both rails.",
- fix: ["PF", "PB"].flatMap((id) => [-1, 1].map((sx) => at("dowel", [20, 50].map((y) => [sx * inner, y, id === "PF" ? Z1 - 20 - T / 2 : ZI + T / 2] as Vec3), [sx, 0, 0], { ...DOWEL, on: id }))),
+ fix: ["PF", "PB"].flatMap((id) => [-1, 1].map((sx) => at("dowel", [14, 56].map((y) => [sx * inner, y, id === "PF" ? Z1 - 20 - T / 2 : ZI + T / 2] as Vec3), [sx, 0, 0], { ...DOWEL, on: id }))),
wait: ["PF", "PB"],
tools: ["hammer"],
},
diff --git a/src/lib/plan/families/vimle.ts b/src/lib/plan/families/vimle.ts
index e607295..7f0a90e 100644
--- a/src/lib/plan/families/vimle.ts
+++ b/src/lib/plan/families/vimle.ts
@@ -397,7 +397,7 @@ function build(b: PlanBuilder, s: ProductSpec): boolean {
step({ title: "Cut the two ties that hold the bed folded", detail: "Stand the frame on the floor with the folded bed inside it, and throw the ties away.", scene: bs }, () => show(bs, m, [rec(m, m.k.frame)], [0, 200, 0]));
step({ title: "Hang the front panel on its two brackets", detail: "One of you at each end. Lower it straight down until both ends sit on the brackets.", scene: bs, kind: "join", people: 2 }, () => show(bs, m, [rec(m, m.k.front)], [0, 260, 160]));
step({ title: "Lock the front panel with the wing screw", detail: "One of you lifts the front of the bed a little; the other turns the wing screw in through the middle bracket by hand.", scene: bs, kind: "screws", people: 2, warnings: ["two", "hand"] }, () => {
- fit(WSCREW, [{ ...at(m, [0, LEG + 50, D / 2 - 60], [0, 0, 1], m.k.front, m.k.frame), travel: 70, spin: 3 }]);
+ fit(WSCREW, [{ ...at(m, [0, LEG + 50, D / 2 - 48], [0, 0, 1], m.k.front, m.k.frame), travel: 70, spin: 3 }]);
});
step({ title: "Unfold the bed", detail: "Together: lift the seat part up and out, then swing the leg frame over and down onto the floor.", scene: bs, people: 2 });
step({ title: "Lower the backrest onto the side plates", detail: "Fit the holes at the bottom of the backrest over the pins on both side plates and press it down.", scene: bs, kind: "join", people: 2 }, () => show(bs, m, [rec(m, m.k.back)], [0, 380, 0]));
diff --git a/src/lib/plan/families/vimund.ts b/src/lib/plan/families/vimund.ts
index e0d5762..7ad37ce 100644
--- a/src/lib/plan/families/vimund.ts
+++ b/src/lib/plan/families/vimund.ts
@@ -52,6 +52,8 @@ function chair(s: ProductSpec): CustomParams {
tube([-xl, yTop, zB], [xl, yTop, zB]),
...[-1, 1].flatMap((sx) => [tube([sx * xl, yTop, zB], [sx * xl, yBend, zB]), tube([sx * xl, yBend, zB], [sx * xl, yLow, zLow])]),
tube([-xl, yLow, zLow], [xl, yLow, zLow]),
+ // the bracket welded to the top bar, flat against the backrest, where its four screws go through
+ { shape: "box", size: [90, 50, 4], pos: [0, yTop, zB + T / 2 - 2] },
];
const backT = 50, zBack = zB + T / 2 + backT / 2;
const tips: Vec3[] = angles.map((a) => [dirOf(a)[0] * R, tipY - T / 2, dirOf(a)[1] * R]);
@@ -69,7 +71,7 @@ function chair(s: ProductSpec): CustomParams {
{ id: "MEC", name: "Mechanism", size: [170, 30, 170], pos: [0, mechY0 + 15, zSeat], material: "metal" },
{ id: "MCOV", name: "Mechanism cover", size: [90, 30, 40], pos: [0, yLow - T / 2 - 15, zLow], material: "board" },
];
- const backScrews: Vec3[] = [-1, 1].flatMap((sx) => [-15, 15].map((dy): Vec3 => [sx * 25, yTop + dy, zB - T / 2]));
+ const backScrews: Vec3[] = [-1, 1].flatMap((sx) => [-15, 15].map((dy): Vec3 => [sx * 25, yTop + dy, zB + T / 2 - 4]));
const mecScrews: Vec3[] = [-1, 1].flatMap((sx) => [mz0, mz1].map((z): Vec3 => [sx * 70, mechY0, z]));
const steps: CustomStep[] = [
{ title: "Push the legs into the hub", detail: "All five, each one as far as it goes into its socket.", add: ["HUB", ...legs.map((l) => l.id)] },
diff --git a/src/lib/plan/families/vingson.ts b/src/lib/plan/families/vingson.ts
index afc8001..88e3c2c 100644
--- a/src/lib/plan/families/vingson.ts
+++ b/src/lib/plan/families/vingson.ts
@@ -52,6 +52,8 @@ function chair(s: ProductSpec): CustomParams {
[
...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [rail, railH, fd], pos: [sx * (fw / 2 - rail / 2), legH + railH / 2, zF] })),
...[-1, 1].map((sz): PartPiece => ({ shape: "box", size: [fw - 2 * rail, railH, rail], pos: [0, legH + railH / 2, zF + sz * (fd / 2 - rail / 2)] })),
+ // the ledges inside the side rails the slatted seat rests on and is screwed through
+ ...[-1, 1].map((sx): PartPiece => ({ shape: "box", size: [20, 20, fd - 2 * rail], pos: [sx * (fw / 2 - rail - 10), seatY - 30, zF] })),
],
[-fw / 2, legH, zF - fd / 2],
[fw / 2, seatY, zF + fd / 2],
@@ -87,7 +89,7 @@ function chair(s: ProductSpec): CustomParams {
// the joints between the sections: three bolts down each seam
const seam = (x: number, z0: number): Vec3[] => [450, 850, 1250].map((y): Vec3 => [x, y, backZ(y) + z0]);
const backBolts: Vec3[] = [...[-1, 1].map((sz): Vec3 => [-(fw / 2 - rail / 2), seatY, zF + sz * 180]), ...[-1, 1].map((sz): Vec3 => [fw / 2 - rail / 2, seatY, zF + sz * 180]), [-200, seatY, zBack + rail / 2], [200, seatY, zBack + rail / 2]];
- const seatScrews: Vec3[] = [-1, 1].flatMap((sx) => [0, 1, 2, 3].map((i): Vec3 => [sx * 200, seatY - 20, zF - fd / 2 + rail + 50 + i * 170]));
+ const seatScrews: Vec3[] = [-1, 1].flatMap((sx) => [0, 1, 2, 3].map((i): Vec3 => [sx * (fw / 2 - rail - 12), seatY - 40, zF - fd / 2 + rail + 50 + i * 170]));
const steps: CustomStep[] = [
{
title: "Fit a barrel nut and a threaded rod into each leg",
diff --git a/src/lib/plan/families/visingso.ts b/src/lib/plan/families/visingso.ts
index 1178b71..4e1ecd6 100644
--- a/src/lib/plan/families/visingso.ts
+++ b/src/lib/plan/families/visingso.ts
@@ -8,7 +8,7 @@ import { buildCustom } from "../custom";
* by two nuts: those come off first. The cross is bolted onto the column with one long bolt, then the column is
* turned over and the four-armed base takes four short bolts. Upside down on the top, the cross goes over the eight
* studs under the top and takes eight washers and nuts, and the table is stood up and its feet adjusted.
- * The chair with armrests has no manual (its frame is welded in one piece), so it keeps its old guide.
+ * The chair with armrests has no manual (its frame is welded in one piece): its guide only unpacks it.
*/
function fx(kind: CustomFix["kind"], at: Vec3[], dir: Vec3, on?: string, o: Partial<CustomFix> = {}): CustomFix {
@@ -78,9 +78,10 @@ function table(s: ProductSpec): CustomParams {
detail: "The long bolt with the big washer and a spring washer, down through the cross into the column. Tighten with the Allen key.",
add: ["COL", "SP"],
fix: [
+ // the bolt first, so its washers stack on it
+ fx("bolt", [[0, under - 2, 0]], [0, -1, 0], "SP", { len: 90, dia: 8, mate: "COL" }),
fx("washer", [[0, under - 4, 0]], [0, -1, 0], "SP", { name: "Large washer", dia: 24 }),
fx("washer", [[0, under - 3, 0]], [0, -1, 0], "SP", { name: "Spring washer", dia: 10 }),
- fx("bolt", [[0, under - 2, 0]], [0, -1, 0], "SP", { len: 90, dia: 8, mate: "COL" }),
],
pose: "+y",
tools: ["allen"],
@@ -90,8 +91,8 @@ function table(s: ProductSpec): CustomParams {
detail: "Four short bolts, each with a spring washer, up through the base into the column. Use the Allen key, not a drill.",
add: ["BASE"],
fix: [
- fx("washer", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [a * 22, 0, b * 22])), [0, 1, 0], "BASE", { name: "Spring washer", dia: 10 }),
- fx("bolt", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [a * 22, -2, b * 22])), [0, 1, 0], "BASE", { len: 60, dia: 8, mate: "COL" }),
+ fx("bolt", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [a * 22, 8, b * 22])), [0, 1, 0], "BASE", { len: 60, dia: 8, mate: "COL" }),
+ fx("washer", [-1, 1].flatMap((a) => [-1, 1].map((b): Vec3 => [a * 22, 9, b * 22])), [0, 1, 0], "BASE", { name: "Spring washer", dia: 10 }),
],
pose: "-y",
tools: ["allen"],
@@ -108,12 +109,40 @@ function table(s: ProductSpec): CustomParams {
};
}
-const recipe = (s: ProductSpec) => (/visingso-table/.test(s.slug ?? "") ? table(s) : null);
+/** The chair with armrests is welded in one piece and has no manual: unpack it and it's ready. */
+function chair(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const ys = 450, t = 22, xl = W / 2 - 60, yc = H / 2;
+ const leg = (x: number, z0: number, z1: number, y1: number): PartPiece => {
+ const len = Math.hypot(y1, z1 - z0);
+ return { shape: "cyl", size: [t, len, t], pos: [x, y1 / 2 - yc, (z0 + z1) / 2], rot: [Math.atan2(z1 - z0, y1), 0, 0] };
+ };
+ const pieces: PartPiece[] = [
+ ...[-1, 1].flatMap((sx) => [leg(sx * xl, D / 2 - 40, D / 2 - 70, ys), leg(sx * xl, -D / 2 + 30, -D / 2 + 70, ys)]),
+ { shape: "slab", size: [W - 120, 14, D - 120], pos: [0, ys + 7 - yc, 10], outline: [[-(W - 120) / 2, -(D - 120) / 2], [(W - 120) / 2, -(D - 120) / 2], [(W - 120) / 2, (D - 120) / 2], [-(W - 120) / 2, (D - 120) / 2]], round: 60 },
+ { shape: "box", size: [W - 140, 260, 14], pos: [0, H - 150 - yc, -D / 2 + 60], rot: [-0.15, 0, 0] },
+ // the armrests: a tube up from each front leg, along to the back and down to the backrest
+ ...[-1, 1].flatMap((sx): PartPiece[] => [
+ { shape: "cyl", size: [t, 240, t], pos: [sx * (W / 2 - t / 2), ys + 120 - yc, D / 2 - 90] },
+ { shape: "cyl", size: [t, D - 150, t], pos: [sx * (W / 2 - t / 2), ys + 240 - yc, -15], rot: [Math.PI / 2, 0, 0] },
+ { shape: "cyl", size: [t, H - ys - 200, t], pos: [sx * (W / 2 - 50), (ys + H - 200) / 2 + 100 - yc, -D / 2 + 70] },
+ ]),
+ ];
+ return {
+ parts: [{ id: "C", name: "Chair", size: [W, H, D], pos: [0, yc, 0], material: "metal", pieces }],
+ steps: [
+ { title: "Take the chair out of its packaging", detail: "It comes welded in one piece, with its glides already on. There's nothing to put together.", add: ["C"] },
+ { title: "Check it stands steady", detail: "Set it on a flat surface. The chairs stack, so you can store them on top of each other." },
+ ],
+ };
+}
+
+const recipe = (s: ProductSpec) => (/visingso-table/.test(s.slug ?? "") ? table(s) : /chair/i.test(s.variant) ? chair(s) : null);
/** The top waits upside down beside the stand while the column, cross and base go together. */
function build(b: PlanBuilder, s: ProductSpec): boolean {
- const r = recipe(s);
- if (!r) return false;
+ if (!/visingso-table/.test(s.slug ?? "")) return false;
+ const r = table(s);
const start = b.steps.length;
buildCustom(b, { ...s, custom: r });
r.steps.forEach((st, i) => {
diff --git a/src/lib/plan/families/visthus.ts b/src/lib/plan/families/visthus.ts
new file mode 100644
index 0000000..97f4073
--- /dev/null
+++ b/src/lib/plan/families/visthus.ts
@@ -0,0 +1,507 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomPart, CustomStep, HwKind, ProductSpec, Vec3 } from "../../types";
+import type { FitOpts, HwDef, PlanBuilder } from "../builder";
+import { buildCustom } from "../custom";
+
+/*
+ * VISTHUS, read from IKEA's manuals for the chest of 6 drawers and the wardrobe.
+ *
+ * The carcass is built lying on its front. Cabinet runners are screwed onto the sides and dividers while they lie
+ * flat, the fixed shelves click into one side on their factory-fitted connectors, the other side clicks on, and the
+ * top (with the divider clicked into it) closes the end. Long screws hold the divider, the hardboard back slides down
+ * the grooves and is held with plastic plugs and pins, the wall brackets go into the top and the adjustable feet into
+ * the sides. Stood up, it is levelled with the spanner and screwed to the wall. The drawers are built on their fronts:
+ * the sides click on, the bottom slides down the grooves, the back goes on with push-in pins and cam locks, then the
+ * runners (or, for the bottom drawers, castors) and a grip on the top edge of the front.
+ */
+
+const T = 18;
+const S = [-1, 1];
+const pt = (x: number, y: number, z: number): Vec3 => [x, y, z];
+const fx = (kind: HwKind, at: Vec3[], dir: Vec3, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, ...o });
+
+/* ---------------------------------------------------------------- shared carcass bits */
+
+/** A cabinet runner on the face of a panel at x (dir points into the panel), with its three screws. */
+const runner = (on: string, x: number, y: number, d: number, z: number): CustomFix[] => [
+ fx("runner", [pt(x, y, z)], [d, 0, 0], { len: 400, dia: 30, name: "Cabinet runner", on }),
+ fx("screw", [-160, 0, 160].map((dz) => pt(x, y, z + dz)), [d, 0, 0], { len: 12, dia: 4, on }),
+];
+
+/** Plastic plugs pushed through the back into the edges of the shelves, then a pin into each. */
+const backFix = (pts: Vec3[], on: string): CustomStep[] => [
+ { title: "Push the plugs through the back", detail: `${pts.length} plastic plugs, into the holes over the fixed shelves.`, fix: [fx("clip", pts, [0, 0, 1], { name: "Back plug", len: 14, dia: 10, on })] },
+ { title: "Push a pin into each plug", detail: "Press them in until the heads sit flat. That spreads the plug and holds the back.", fix: [fx("clip", pts.map((p) => pt(p[0], p[1], p[2] - 0.5)), [0, 0, 1], { name: "Back pin", len: 16, dia: 6, on })] },
+];
+
+/** Leveling, then the wall fixing: spacers, mark, drill, then a screw and washer through each bracket. */
+function wallSteps(o: { xs: number[]; y: number; zBack: number; feet: number }): CustomStep[] {
+ const { xs, y, zBack } = o;
+ return [
+ {
+ title: "Screw the spacers onto the brackets if you need them",
+ detail: "Only when a skirting board keeps it off the wall: they hold the top as far out as the bottom.",
+ fix: [fx("spacer", xs.map((x) => pt(x, y, zBack - 2)), [0, 0, 1], { name: "Wall spacer", len: 20, dia: 30 })],
+ warnings: ["wall"],
+ },
+ {
+ title: "Push it to the wall and level it",
+ detail: `Turn the ${o.feet} feet with the spanner until it stands level and steady.`,
+ tools: ["wrench", "level"],
+ kind: "legs",
+ },
+ { title: "Mark the holes through the brackets", detail: "Read the safety leaflet first. Mark through both brackets, then move it away.", tools: ["pencil"], warnings: ["wall", "tip"], wall: true },
+ {
+ title: "Drill and plug the holes",
+ detail: "The plugs in the box are for solid walls. For other walls, use fixings made for them.",
+ fix: [fx("plug", xs.map((x) => pt(x, y, zBack - 22)), [0, 0, -1], { included: true })],
+ tools: ["drill"],
+ wall: true,
+ },
+ {
+ title: "Screw it to the wall",
+ detail: "Push it back, then a screw with a washer through each bracket. Click a cover cap over each screw head.",
+ fix: [
+ fx("washer", xs.map((x) => pt(x, y, zBack - 6)), [0, 0, -1], { included: true }),
+ fx("screw", xs.map((x) => pt(x, y, zBack - 6)), [0, 0, -1], { len: 50, dia: 5, included: true }),
+ fx("cap", xs.map((x) => pt(x, y, zBack - 8)), [0, 0, -1], { name: "Cover cap", len: 8, dia: 22 }),
+ ],
+ tools: ["screwdriver"],
+ wall: true,
+ warnings: ["wall", "tip"],
+ },
+ ];
+}
+
+/* ---------------------------------------------------------------- drawers */
+
+const D_PIN: HwDef = { kind: "camScrew", len: 34, dia: 8, name: "Cam pin" };
+const D_CAM: HwDef = { kind: "cam", len: 12, dia: 15 };
+const D_RUNNER: HwDef = { kind: "runner", len: 400, dia: 30, name: "Drawer runner" };
+const D_SCREW: HwDef = { kind: "screw", len: 12, dia: 4 };
+const D_GRIP: HwDef = { kind: "handle", len: 40, dia: 20, name: "Grip" };
+const D_GRIP_SCREW: HwDef = { kind: "screw", len: 12, dia: 4, name: "Grip screw" };
+const D_CLIP: HwDef = { kind: "clip", len: 20, dia: 30, name: "Front clip" };
+const D_CASTOR: HwDef = { kind: "castor", len: 40, dia: 40 };
+const D_CASTOR_SCREW: HwDef = { kind: "screw", len: 12, dia: 3.5 };
+const D_LONG: HwDef = { kind: "bolt", len: 50, dia: 6, name: "Long connecting screw" };
+const D_STOP: HwDef = { kind: "cap", len: 8, dia: 10, name: "Bumper" };
+
+interface Drawer {
+ front: string;
+ sides: string[];
+ back: string;
+ bottom: string;
+ cx: number;
+ fcx: number; // centre of the front, which covers the divider's edge
+ y0: number; // underside of the box
+ bh: number;
+ bw: number;
+ zf: number; // back face of the front
+ zb: number; // back face of the drawer back
+ fy: number;
+ fh: number;
+ fw: number;
+ castor: boolean;
+}
+
+/** A drawer whose front spans x cx±fw/2, y fy0..fy1, face at zFace; the box `dd` deep in an opening `ow` wide from `yb`. */
+function drawer(b: PlanBuilder, types: Map<string, string>, o: { cx: number; fcx?: number; fw: number; fy0: number; fy1: number; zFace: number; ow: number; yb: number; dd: number; bh: number; castor?: boolean }): Drawer {
+ const type = (name: string, size: Vec3, material?: "fiber") => {
+ const k = `${name}|${size.map(Math.round).join("x")}`;
+ let t = types.get(k);
+ if (!t) types.set(k, (t = b.part(name, size, { material })));
+ return t;
+ };
+ const castor = o.castor ?? false;
+ const fh = o.fy1 - o.fy0, fy = (o.fy0 + o.fy1) / 2;
+ const zf = o.zFace - T;
+ const bw = castor ? o.ow - 10 : o.ow - 26;
+ const y0 = castor ? 41 : o.yb + 15;
+ const zb = zf - o.dd;
+ const fcx = o.fcx ?? o.cx;
+ const front = b.place(type("Drawer front", [o.fw, fh, T]), [fcx, fy, o.zFace - T / 2]);
+ const sides = S.map((g) => b.place(type("Drawer side", [12, o.bh, o.dd]), [o.cx + g * (bw / 2 - 6), y0 + o.bh / 2, zb + o.dd / 2]));
+ // the back sits between the sides, above the bottom
+ const lift = castor ? 22 : 14;
+ const back = b.place(type("Drawer back", [bw - 24, o.bh - lift, 12]), [o.cx, y0 + lift + (o.bh - lift) / 2, zb + 6]);
+ const bottom = castor
+ ? b.place(type("Drawer bottom", [bw - 16, 16, o.dd - 4]), [o.cx, y0 + 12, zb + 2 + (o.dd - 4) / 2])
+ : b.place(type("Drawer bottom", [bw - 16, 3, o.dd - 2], "fiber"), [o.cx, y0 + 10, zb + 1 + (o.dd - 2) / 2]);
+ return { front, sides, back, bottom, cx: o.cx, fcx, y0, bh: o.bh, bw, zf, zb, fy, fh, fw: o.fw, castor };
+}
+
+function drawerFits(d: Drawer) {
+ const xs = d.bw / 2;
+ const lift = d.castor ? 22 : 14;
+ const ys = [d.y0 + lift + 25, d.y0 + d.bh - 25];
+ const side = (g: number) => d.sides[g < 0 ? 0 : 1];
+ const fTop = d.fy + d.fh / 2;
+ const cz = [d.zb + 50, d.zb + 200, d.zf - 50];
+ return {
+ clips: !d.castor ? [] : S.map((g): FitOpts => ({ on: side(g), at: [d.cx + g * (xs - 6), d.y0 + d.bh / 2, d.zf], dir: [0, 0, -1], hole: false })),
+ pins: S.flatMap((g) => ys.map((y): FitOpts => ({ on: side(g), at: [d.cx + g * xs, y, d.zb + 6], dir: [-g, 0, 0], mate: d.back }))),
+ cams: S.flatMap((g) => ys.map((y): FitOpts => ({ on: d.back, at: [d.cx + g * (xs - 12 - 28), y, d.zb], dir: [0, 0, 1] }))),
+ castors: !d.castor ? [] : S.flatMap((g) => [d.zb + 60, d.zf - 60].map((z): FitOpts => ({ on: d.bottom, at: [d.cx + g * (xs - 70), d.y0 + 4, z], dir: [0, 1, 0], hole: false }))),
+ castorScrews: !d.castor ? [] : S.flatMap((g) => [d.zb + 60, d.zf - 60].flatMap((z) => [-14, 14].map((dz): FitOpts => ({ on: d.bottom, at: [d.cx + g * (xs - 70), d.y0 + 4, z + dz], dir: [0, 1, 0] })))),
+ longScrews: !d.castor ? [] : S.flatMap((g) => [d.zb + 80, d.zf - 80].map((z): FitOpts => ({ on: side(g), at: [d.cx + g * xs, d.y0 + 12, z], dir: [-g, 0, 0], mate: d.bottom }))),
+ runners: d.castor ? [] : S.map((g): FitOpts => ({ on: side(g), at: [d.cx + g * xs, d.y0 + 12, (d.zb + d.zf) / 2], dir: [-g, 0, 0], hole: false })),
+ runnerScrews: d.castor ? [] : S.flatMap((g) => cz.map((z): FitOpts => ({ on: side(g), at: [d.cx + g * xs, d.y0 + 12, z], dir: [-g, 0, 0] }))),
+ grip: [{ on: d.front, at: [d.fcx, fTop, d.zf + T - 6], dir: [0, -1, 0], hole: false } as FitOpts],
+ gripScrew: [{ on: d.front, at: [d.fcx, fTop - 12, d.zf], dir: [0, 0, 1] } as FitOpts],
+ stops: d.castor ? S.map((g): FitOpts => ({ on: d.front, at: [d.cx + g * (d.fw / 2 - 12), d.fy - d.fh / 2 + 40, d.zf], dir: [0, 0, 1] })) : [],
+ };
+}
+
+type Fits = ReturnType<typeof drawerFits>;
+const FIT_DEFS: [keyof Fits, HwDef][] = [
+ ["clips", D_CLIP],
+ ["pins", D_PIN],
+ ["cams", D_CAM],
+ ["castors", D_CASTOR],
+ ["castorScrews", D_CASTOR_SCREW],
+ ["longScrews", D_LONG],
+ ["runners", D_RUNNER],
+ ["runnerScrews", D_SCREW],
+ ["grip", D_GRIP],
+ ["gripScrew", D_GRIP_SCREW],
+ ["stops", D_STOP],
+];
+
+/** The steps of one kind of drawer, shown on the first and repeated for the rest. */
+function drawerSteps(b: PlanBuilder, ds: Drawer[], o: { scene: string; label: string; clips?: boolean }) {
+ if (!ds.length) return;
+ const d0 = ds[0];
+ const f = drawerFits(d0);
+ const base: Vec3 = [d0.cx, d0.fy - d0.fh / 2, 0];
+ const rel = (k: string, dx = 0): Vec3 => {
+ const p = b.partItem(k).final.pos;
+ return [p[0] - base[0] + dx, p[1] - base[1], p[2]];
+ };
+ const stage = (k: string, from?: Vec3) => b.stage(k, rel(k), [0, 0, 0], from);
+ const sc = { scene: o.scene, repeat: ds.length > 1 ? ds.length : undefined };
+ const on = { ...sc, pose: "-z" as const };
+ if (o.clips)
+ b.step({ title: "Tap the clips into the sides", detail: "One into the front end of each side, gently with a hammer.", kind: "general", tools: ["hammer"], warnings: ["floor"], ...sc }, () => {
+ for (const k of d0.sides) stage(k, [0, 160, 0]);
+ b.then(0.1);
+ b.fits(D_CLIP, f.clips, 0.12);
+ });
+ b.step({ title: `Click the sides onto the ${o.label} front`, detail: "Lay the front face down on a rug. Slide each side into its connectors, then press it down until it clicks.", kind: "join", warnings: ["floor"], ...on }, () => {
+ stage(d0.front, [0, 0, -160]);
+ b.then(0.1);
+ for (const k of d0.sides) stage(k, [0, 0, -300]);
+ });
+ if (d0.castor) {
+ b.step({ title: "Put the back on", detail: "Lay it between the ends of the sides, cam holes facing out.", kind: "join", ...on }, () => stage(d0.back, [0, 0, -260]));
+ } else {
+ b.step({ title: "Slide in the drawer bottom", detail: "Smooth side in, down the grooves until it reaches the front.", kind: "join", ...on }, () => stage(d0.bottom, [0, 0, -420]));
+ b.step({ title: "Put the back on", detail: "The notch in its edge goes over the drawer bottom.", kind: "join", ...on }, () => stage(d0.back, [0, 0, -260]));
+ }
+ b.step({ title: "Push the cam pins in", detail: "Four, through the sides into the ends of the back.", kind: "cams", ...on }, () => b.fits(D_PIN, f.pins, 0.08));
+ b.step({ title: "Lock the cam locks", detail: "Four, in the back. Turn each clockwise until it grips its pin.", kind: "cams", tools: ["screwdriver"], ...on }, () => b.fits(D_CAM, f.cams, 0.08));
+ if (d0.castor) {
+ b.step({ title: "Screw the castors onto the bottom", detail: "Four castors, two screws each, near the corners.", kind: "screws", tools: ["screwdriver"], ...sc }, () => {
+ b.stage(d0.bottom, rel(d0.bottom, d0.bw + 160), [0, 0, 0], [0, 160, 0]);
+ b.then(0.1);
+ b.fits(D_CASTOR, f.castors, 0.12);
+ b.then(0.05);
+ b.fits(D_CASTOR_SCREW, f.castorScrews, 0.04);
+ });
+ b.step({ title: "Slide the bottom in", detail: "Castors out, down the grooves until it reaches the front.", kind: "join", ...on }, () => stage(d0.bottom, [0, 0, -420]));
+ b.step({ title: "Screw the bottom to the sides", detail: "Four long screws with the Allen key, two through each side.", kind: "bolts", tools: ["allen"], ...on }, () => b.fits(D_LONG, f.longScrews, 0.1));
+ } else {
+ b.step({ title: "Screw the runners onto the drawer", detail: "Along the bottom edge of each side, wheel at the back. Three screws each.", kind: "runners", tools: ["screwdriver"], ...on }, () => {
+ b.fits(D_RUNNER, f.runners, 0.15);
+ b.then(0.05);
+ b.fits(D_SCREW, f.runnerScrews, 0.05);
+ });
+ }
+ b.step({ title: "Turn it over and fit the grip", detail: "Hook the grip over the top edge of the front and screw it from the inside, with its washer.", kind: "screws", tools: ["screwdriver"], ...sc }, () => {
+ b.fits(D_GRIP, f.grip, 0.1);
+ b.then(0.05);
+ b.fits(D_GRIP_SCREW, f.gripScrew, 0.1);
+ });
+ if (d0.castor)
+ b.step({ title: "Push in the two bumpers", detail: "Into the holes low on the back of the front, one near each end.", kind: "general", ...sc }, () => b.fits(D_STOP, f.stops, 0.1));
+ if (ds.length > 1) {
+ const n = ds.length - 1;
+ b.step({ title: n === 1 ? `Build the other ${o.label} drawer` : `Build the other ${n} ${o.label} drawers`, detail: "Each one goes together like the first.", kind: "drawer", scene: o.scene }, () => {
+ b.stagger(0.12);
+ ds.slice(1).forEach((d, i) => {
+ const dx = (i + 1) * (d0.fw + 120);
+ for (const k of [d.front, ...d.sides, d.back, d.bottom]) {
+ const p = b.partItem(k).final.pos;
+ b.stage(k, [p[0] - d.cx + dx, p[1] - (d.fy - d.fh / 2), p[2]], [0, 0, 0]);
+ }
+ const fd = drawerFits(d);
+ for (const [key, def] of FIT_DEFS) for (const x of fd[key]) b.preset(def, x);
+ });
+ });
+ }
+}
+
+function drawersIn(b: PlanBuilder, groups: Drawer[][], title: string, detail: string) {
+ b.step({ title, detail, kind: "drawer", warnings: ["tip"] }, () => {
+ for (const g of groups)
+ for (const d of g) {
+ b.stagger(0);
+ for (const k of [d.front, ...d.sides, d.back, d.bottom]) b.add(k, [0, 0, 520]);
+ b.wait(0.15);
+ }
+ });
+}
+
+/* ---------------------------------------------------------------- chest of 6 drawers */
+
+function chest(b: PlanBuilder, s: ProductSpec) {
+ const W = 630, H = 1260, D = 490, F = 10;
+ const xo = W / 2 - 3 - T / 2, xi = W / 2 - 3 - T;
+ const yt = H - T; // underside of the top
+ const zb = -D / 2, zf = D / 2 - 4; // back and front edges of the sides
+ const zBk = zb + 10; // the back, in its grooves
+ const z0 = zBk + 1.5, z1 = zf - T - 2; // shelves and divider run between these
+ const sd = z1 - z0, sz = (z0 + z1) / 2;
+ const yB = 300, yA = 612, yL = 928; // lower fixed shelf, middle fixed shelf, loose shelves (undersides)
+ const LT = 16;
+ const ru = (y: number) => y + 30; // runner height in an opening from y
+ const rz = zf - T - 210;
+ const parts: CustomPart[] = [
+ { id: "SR", name: "Side", size: [T, yt - F, D - 4], pos: [xo, (yt + F) / 2, (zb + zf) / 2] },
+ { id: "SL", name: "Side", size: [T, yt - F, D - 4], pos: [-xo, (yt + F) / 2, (zb + zf) / 2] },
+ { id: "DV", name: "Divider", size: [T, yt - yA - T, sd], pos: [0, (yt + yA + T) / 2, sz] },
+ { id: "SB", name: "Fixed shelf", size: [2 * xi, T, sd], pos: [0, yB + T / 2, sz] },
+ { id: "SA", name: "Fixed shelf", size: [2 * xi, T, sd], pos: [0, yA + T / 2, sz] },
+ { id: "TP", name: "Top", size: [W, T, D], pos: [0, H - T / 2, 0] },
+ { id: "BK", name: "Back panel", size: [2 * xi + 2, yt - F - 8, 3], pos: [0, (yt + F + 8) / 2, zBk], material: "fiber" },
+ ...S.map((g, i): CustomPart => ({ id: `L${i}`, name: "Shelf", size: [xi - T / 2 - 2, LT, sd - 14], pos: [g * (xi + T / 2) / 2, yL + LT / 2, sz - 7] })),
+ ];
+ const small = [yA + T, yL + LT];
+ const plugs = [yB, yA].flatMap((y) => [-150, 150].map((x) => pt(x, y + T / 2, zBk - 1.5)));
+ const feet = S.flatMap((g) => [zb + 40, zf - 40].map((z) => pt(g * xo, F, z)));
+ const bx = [-200, 200];
+ const steps: CustomStep[] = [
+ {
+ title: "Screw on the right-hand runners",
+ detail: "Lay the right side and the divider on a rug, inside up. Three runners on the side, two on the divider, three screws each.",
+ add: ["SR"],
+ fix: [...[yB + T, ...small].flatMap((y) => runner("SR", xi, ru(y), 1, rz)), ...small.flatMap((y) => runner("DV", T / 2, ru(y), -1, rz))],
+ wait: ["DV"],
+ tools: ["screwdriver"],
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Turn the divider over and screw on the left-hand runners",
+ detail: "The marks on the runners show left and right. Three on the left side, two on the divider.",
+ fix: [...[yB + T, ...small].flatMap((y) => runner("SL", -xi, ru(y), -1, rz)), ...small.flatMap((y) => runner("DV", -T / 2, ru(y), 1, rz))],
+ wait: ["SL"],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the fixed shelves into the right side", detail: "Stand the side on its front edge. Slide each shelf onto its connectors, then press it down until it clicks.", add: ["SB", "SA"], from: { SB: [-400, 0, 0], SA: [-400, 0, 0] } },
+ { title: "Click the left side on", detail: "Onto the other ends of the shelves, then press down along the joints.", add: ["SL"], from: { SL: [-400, 0, 0] } },
+ {
+ title: "Click the divider into the top and fit them on",
+ detail: "Divider first, into the middle of the top. Then slide the top onto the ends of the sides, divider between them, until it clicks.",
+ add: ["DV", "TP"],
+ from: { DV: [0, 600, 0], TP: [0, 600, 0] },
+ },
+ { title: "Screw the shelf to the divider", detail: "Two long screws with the Allen key, up through the middle shelf into the divider.", fix: [fx("bolt", [z0 + 120, z1 - 120].map((z) => pt(0, yA, z)), [0, 1, 0], { len: 70, dia: 6, name: "Long connecting screw", on: "SA", mate: "DV" })], tools: ["allen"] },
+ { title: "Slide the back panel in", detail: "Smooth side in, from the bottom end along the grooves, until it sits in the groove of the top.", add: ["BK"], from: { BK: [0, -1300, 0] } },
+ ...backFix(plugs, "BK"),
+ { title: "Screw the wall brackets into the top", detail: "Two, into the holes in the back edge of the top.", fix: [fx("angle", bx.map((x) => pt(x, H - T / 2, zb)), [0, 0, 1], { name: "Wall bracket", len: 40, dia: 30, on: "TP" })], tools: ["screwdriver"] },
+ { title: "Screw in the feet", detail: "Four, into the bottom ends of the sides. Turn each in by hand.", fix: [fx("foot", feet, [0, 1, 0], { name: "Adjustable foot", len: 20, dia: 30 })] },
+ { title: "Stand it up", detail: "Lift it upright, near the wall where it will stand.", pose: "+y", people: 2 },
+ ...wallSteps({ xs: bx, y: H - T / 2, zBack: zb, feet: 4 }),
+ {
+ title: "Push in the shelf supports",
+ detail: "Eight, in the holes halfway up the top compartments: four on each side of the divider.",
+ fix: [0, 1].flatMap((i) => {
+ const g = S[i], x0 = g * T / 2, x1 = g * xi;
+ return [fx("pin", [z0 + 50, z1 - 50].map((z) => pt(x0, yL - 4, z)), [-g, 0, 0], { name: "Shelf support", len: 14, dia: 10 }), fx("pin", [z0 + 50, z1 - 50].map((z) => pt(x1, yL - 4, z)), [g, 0, 0], { name: "Shelf support", len: 14, dia: 10 })];
+ }),
+ },
+ { title: "Lay the shelves on the supports", detail: "One in each top compartment, pushed down over the supports.", add: ["L0", "L1"], from: { L0: [0, 0, 400], L1: [0, 0, 400] } },
+ ];
+ buildCustom(b, { ...s, custom: { parts, steps } });
+ const types = new Map<string, string>();
+ const dd = 400;
+ const half = (xi - T / 2) / 2;
+ const bottom = drawer(b, types, { cx: 0, fw: 2 * xi - 4, fy0: 3, fy1: yB + T / 2 - 2, zFace: zf, ow: 2 * xi, yb: 0, dd, bh: 230, castor: true });
+ const wide = drawer(b, types, { cx: 0, fw: 2 * xi - 4, fy0: yB + T / 2 + 2, fy1: yA + T / 2 - 2, zFace: zf, ow: 2 * xi, yb: yB + T, dd, bh: 200 });
+ const rows = [
+ [yA + T / 2 + 2, yL + LT / 2 - 2, yA + T],
+ [yL + LT / 2 + 2, yt - 2, yL + LT],
+ ];
+ const smalls = rows.flatMap(([f0, f1, yb]) => S.map((g) => drawer(b, types, { cx: g * (T / 2 + half), fcx: (g * xi) / 2, fw: xi - 4, fy0: f0, fy1: f1, zFace: zf, ow: half * 2, yb, dd, bh: 200 })));
+ drawerSteps(b, [bottom], { scene: "castor", label: "bottom", clips: true });
+ drawerSteps(b, [wide], { scene: "wide", label: "wide" });
+ drawerSteps(b, smalls, { scene: "small", label: "small" });
+ drawersIn(b, [smalls, [wide], [bottom]], "Put the drawers in", "Small ones at the top, then the wide one onto its runners. The bottom drawer rolls in on its castors.");
+}
+
+/* ---------------------------------------------------------------- wardrobe */
+
+function wardrobe(b: PlanBuilder, s: ProductSpec) {
+ const W = 1220, H = 2160, D = 590, F = 10;
+ const xo = W / 2 - 3 - T / 2, xi = W / 2 - 3 - T;
+ const yt = H - T;
+ const zb = -D / 2, zf = D / 2 - 4;
+ const zBk = zb + 10;
+ const z0 = zBk + 1.5, z1 = zf - T - 2;
+ const sd = z1 - z0, sz = (z0 + z1) / 2;
+ const dvx = -40; // the middle divider: the left column is a little narrower
+ const mL = dvx - T / 2, mR = dvx + T / 2; // its faces
+ const cL = (-xi + mL) / 2, wL = mL + xi; // left column centre and width
+ const cR = (mR + xi) / 2, wR = xi - mR;
+ const yC = 330; // fixed shelves over the castor drawers (undersides)
+ const yA = yC + T, yS = 625, yB = yS + 16, yK = 918; // small drawer rows, the shelf between them, the block shelf
+ const sdx = cL; // the small divider
+ const sL = (-xi + sdx - T / 2) / 2, sR = (sdx + T / 2 + mL) / 2, sw = sdx - T / 2 + xi;
+ const LT = 16;
+ const ru = (y: number) => y + 30;
+ const rz = zf - T - 250;
+ const upper = [1200, 1490, 1780]; // shelves behind the left doors (undersides)
+ const lower = [700, 1000]; // shelves under the clothes rail
+ const yRail = 1950;
+ const shelf = (id: string, x: number, w: number, y: number): CustomPart => ({ id, name: "Shelf", size: [w - 2, LT, sd - 14], pos: [x, y + LT / 2, sz - 7] });
+ const door = (id: string, x0: number, x1: number, y0: number, y1: number): CustomPart => ({ id, name: "Door", size: [x1 - x0, y1 - y0, T], pos: [(x0 + x1) / 2, (y0 + y1) / 2, zf - T / 2] });
+ const parts: CustomPart[] = [
+ { id: "MD", name: "Middle divider", size: [T, yt - F, zf - z0], pos: [dvx, (yt + F) / 2, (zf + z0) / 2] },
+ { id: "SD", name: "Small divider", size: [T, yK - yA, sd], pos: [sdx, (yK + yA) / 2, sz] },
+ { id: "TP", name: "Top", size: [W, T, D], pos: [0, H - T / 2, 0] },
+ { id: "SL", name: "Side", size: [T, yt - F, D - 4], pos: [-xo, (yt + F) / 2, (zb + zf) / 2] },
+ { id: "SR", name: "Side", size: [T, yt - F, D - 4], pos: [xo, (yt + F) / 2, (zb + zf) / 2] },
+ { id: "FL", name: "Fixed shelf", size: [wL, T, sd], pos: [cL, yC + T / 2, sz] },
+ { id: "FR", name: "Fixed shelf", size: [wR, T, sd], pos: [cR, yC + T / 2, sz] },
+ { id: "BL", name: "Back panel", size: [-dvx + xi + 1, yt - F - 8, 3], pos: [(-xi - 1 + dvx) / 2, (yt + F + 8) / 2, zBk], material: "fiber" },
+ { id: "BR", name: "Back panel", size: [xi + 1 - dvx, yt - F - 8, 3], pos: [(xi + 1 + dvx) / 2, (yt + F + 8) / 2, zBk], material: "fiber" },
+ { id: "BS", name: "Drawer shelf", size: [wL - 2, T, sd], pos: [cL, yK + T / 2, sz] },
+ shelf("K0", sL, sw, yS),
+ shelf("K1", sR, sw, yS),
+ ...upper.map((y, i) => shelf(`U${i}`, cL, wL, y)),
+ ...lower.map((y, i) => shelf(`W${i}`, cR, wR, y)),
+ { id: "RL", name: "Clothes rail", size: [wR - 4, 25, 25], pos: [cR, yRail, sz], shape: "cyl", material: "metal" },
+ door("DT", mR + 2, xi - 2, yC + T / 2 + 2, yt - 2),
+ door("DM", -xi + 2, mL - 2, yK + T / 2 + 2, 1498),
+ door("DU", -xi + 2, mL - 2, 1502, yt - 2),
+ ];
+ const plugs = [
+ ...[cL - 150, cL + 150].map((x) => pt(x, yC + T / 2, zBk - 1.5)),
+ ...[cR - 150, cR + 150].map((x) => pt(x, yC + T / 2, zBk - 1.5)),
+ ];
+ const midPlugs = [900, 1600].flatMap((y) => [pt(dvx - 5, y, zBk - 1.5), pt(dvx + 5, y, zBk - 1.5)]);
+ const feet = [-xo, dvx, xo].flatMap((x) => [zb + 45, zf - 40].map((z) => pt(x, F, z)));
+ const bx = [-400, 400];
+ const support = (x: number, y: number, d: number) => fx("pin", [z0 + 50, z1 - 50].map((z) => pt(x, y - 4, z)), [d, 0, 0], { name: "Shelf support", len: 14, dia: 10 });
+ const support3 = (x: number, y: number, d: number) => fx("pin", [z0 + 50, sz, z1 - 50].map((z) => pt(x, y - 4, z)), [d, 0, 0], { name: "Shelf support", len: 14, dia: 10 });
+ // two kinds of hinge: one kind at the ends of the tall door and the top of each small door, the other in between
+ const hinges = (id: string, x: number, a: number[], c: number[], d: number): CustomFix[] => [
+ fx("hinge", a.map((y) => pt(x, y, zf - T / 2)), [d, 0, 0], { name: "Hinge (type A)", on: id, twist: d < 0 ? Math.PI : 0 }),
+ fx("hinge", c.map((y) => pt(x, y, zf - T / 2)), [d, 0, 0], { name: "Hinge (type B)", on: id, twist: d < 0 ? Math.PI : 0 }),
+ ];
+ const grip = (id: string, x: number, y: number, d: number): CustomFix[] => [
+ fx("handle", [pt(x, y, zf - 6)], [d, 0, 0], { name: "Grip", len: 40, dia: 20, on: id }),
+ fx("screw", [pt(x + d * 12, y, zf - T)], [0, 0, 1], { name: "Grip screw", len: 12, dia: 4, on: id }),
+ ];
+ const steps: CustomStep[] = [
+ {
+ title: "Screw on the right-hand runners",
+ detail: "Lay the middle divider and the small divider on a rug. Two runners on each, three screws each.",
+ add: ["MD"],
+ fix: [yA, yB].flatMap((y) => [...runner("MD", mL, ru(y), 1, rz), ...runner("SD", sdx - T / 2, ru(y), 1, rz)]),
+ wait: ["SD"],
+ tools: ["screwdriver"],
+ pose: "-z",
+ warnings: ["floor"],
+ },
+ {
+ title: "Turn the small divider over and screw on the left-hand runners",
+ detail: "Two on the left side and two on the other face of the small divider.",
+ fix: [yA, yB].flatMap((y) => [...runner("SL", -xi, ru(y), -1, rz), ...runner("SD", sdx + T / 2, ru(y), -1, rz)]),
+ wait: ["SL"],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the top onto the middle divider", detail: "Stand the divider on its front edge. Slide the top onto its connectors, then press down until it clicks.", add: ["TP"], from: { TP: [0, 500, 0] } },
+ { title: "Click the left side on", detail: "Swing it up onto the end of the top, runners inside.", add: ["SL"], from: { SL: [-500, 0, 0] } },
+ { title: "Click the right side on", detail: "The same at the other end of the top.", add: ["SR"], from: { SR: [500, 0, 0] } },
+ { title: "Click in the two fixed shelves", detail: "At the bottom end, one in each column, pressed down until they click.", add: ["FL", "FR"], from: { FL: [0, 0, -500], FR: [0, 0, -500] } },
+ { title: "Slide the back panels in", detail: "Smooth side in, from the bottom end along the grooves, then push them into the groove of the top.", add: ["BL", "BR"], from: { BL: [0, -2300, 0], BR: [0, -2300, 0] }, people: 2 },
+ ...backFix([...plugs, ...midPlugs], "BL").map((st) => ({ ...st, fix: st.fix!.map((f) => ({ ...f, on: undefined })) })),
+ { title: "Screw the wall brackets into the top", detail: "Two, into the holes in the back edge of the top.", fix: [fx("angle", bx.map((x) => pt(x, H - T / 2, zb)), [0, 0, 1], { name: "Wall bracket", len: 40, dia: 30, on: "TP" })], tools: ["screwdriver"] },
+ { title: "Screw in the feet", detail: "Six, into the bottom ends of the sides and the middle divider.", fix: [fx("foot", feet, [0, 1, 0], { name: "Adjustable foot", len: 20, dia: 30 })] },
+ { title: "Stand it up", detail: "Together, and mind the ceiling: stand it up near where it goes.", pose: "+y", people: 2 },
+ {
+ title: "Push in four shelf supports",
+ detail: "For the drawer shelf in the left column: two on the left side, two on the middle divider.",
+ fix: [support(-xi, yK, -1), support(mL, yK, 1)],
+ },
+ {
+ title: "Click the small divider under its shelf and put them in",
+ detail: "The divider clicks into the middle of the drawer shelf. Lay the shelf on the supports, divider standing on the fixed shelf.",
+ add: ["SD", "BS"],
+ from: { SD: [0, 0, 500], BS: [0, 0, 500] },
+ },
+ { title: "Screw the small divider to the fixed shelf", detail: "Two long screws with the Allen key, up through the fixed shelf.", fix: [fx("bolt", [z0 + 150, z1 - 150].map((z) => pt(sdx, yC, z)), [0, 1, 0], { len: 70, dia: 6, name: "Long connecting screw", on: "FL", mate: "SD" })], tools: ["allen"] },
+ ...wallSteps({ xs: bx, y: H - T / 2, zBack: zb, feet: 6 }),
+ {
+ title: "Push in the supports for the small shelves",
+ detail: "Eight, between the two rows of small drawers.",
+ fix: [support(-xi, yS, -1), support(sdx - T / 2, yS, 1), support(sdx + T / 2, yS, -1), support(mL, yS, 1)],
+ },
+ { title: "Lay in the two small shelves", detail: "One in each half, over the supports.", add: ["K0", "K1"], from: { K0: [0, 0, 400], K1: [0, 0, 400] } },
+ {
+ title: "Push in the rest of the shelf supports",
+ detail: "Thirty: three on each side of every shelf, at the heights you want. Three shelves on the left, two under the rail on the right.",
+ fix: [...upper.flatMap((y) => [support3(-xi, y, -1), support3(mL, y, 1)]), ...lower.flatMap((y) => [support3(mR, y, -1), support3(xi, y, 1)])],
+ },
+ { title: "Lay the shelves on the supports", detail: "Pushed down over the supports until they sit flat.", add: [...upper.map((_, i) => `U${i}`), ...lower.map((_, i) => `W${i}`)] },
+ {
+ title: "Screw on the rail holders",
+ detail: "Near the top of the right column, one on the middle divider and one on the right side, two screws each.",
+ fix: [
+ fx("clip", [pt(mR, yRail, sz)], [-1, 0, 0], { name: "Rail holder", len: 30, dia: 40, on: "MD" }),
+ fx("clip", [pt(xi, yRail, sz)], [1, 0, 0], { name: "Rail holder", len: 30, dia: 40, on: "SR" }),
+ fx("screw", [-20, 20].map((dz) => pt(mR, yRail + 18, sz + dz)), [-1, 0, 0], { len: 14, dia: 4, on: "MD" }),
+ fx("screw", [-20, 20].map((dz) => pt(xi, yRail + 18, sz + dz)), [1, 0, 0], { len: 14, dia: 4, on: "SR" }),
+ ],
+ tools: ["screwdriver"],
+ },
+ { title: "Click the clothes rail in", detail: "Push its ends into the holders until they click.", add: ["RL"], from: { RL: [0, 0, 400] } },
+ { title: "Fit the hinges on the tall door", detail: "Lay it face down on a rug. Two of one kind at the ends, two of the other in between, pressed into the holes and screwed.", fix: hinges("DT", xi - 1, [450, 2030], [950, 1550], -1), wait: ["DT"], tools: ["screwdriver"], warnings: ["floor"] },
+ { title: "Hang the tall door", detail: "Together: click each hinge onto its plate on the right side.", add: ["DT"], from: { DT: [0, 0, 400] }, people: 2 },
+ { title: "Adjust the tall door", detail: "Turn the hinge screws until it hangs straight and the gaps are even.", tools: ["screwdriver"], check: "square" },
+ { title: "Fit the grip on the tall door", detail: "Over its left edge, screwed from the inside with the washer.", fix: grip("DT", mR + 2, 1240, 1), tools: ["screwdriver"] },
+ { title: "Fit the hinges on the two small doors", detail: "One of each kind on each door, pressed into the holes and screwed.", fix: [...hinges("DM", -xi + 1, [1420], [1010], 1), ...hinges("DU", -xi + 1, [2060], [1590], 1)], wait: ["DM", "DU"], tools: ["screwdriver"], warnings: ["floor"] },
+ { title: "Hang the small doors and adjust them", detail: "Click their hinges onto the plates on the left side, then line them up.", add: ["DM", "DU"], from: { DM: [0, 0, 400], DU: [0, 0, 400] }, tools: ["screwdriver"] },
+ { title: "Fit their grips", detail: "Over the right edges, near where the doors meet.", fix: [...grip("DM", mL - 2, 1420, -1), ...grip("DU", mL - 2, 1580, -1)], tools: ["screwdriver"] },
+ ];
+ buildCustom(b, { ...s, custom: { parts, steps } });
+ const types = new Map<string, string>();
+ const dd = 480;
+ const castors = [
+ drawer(b, types, { cx: cL, fw: wL - 4, fy0: 3, fy1: yC + T / 2 - 2, zFace: zf, ow: wL, yb: 0, dd, bh: 250, castor: true }),
+ drawer(b, types, { cx: cR, fw: wR - 4, fy0: 3, fy1: yC + T / 2 - 2, zFace: zf, ow: wR, yb: 0, dd, bh: 250, castor: true }),
+ ];
+ const rows = [
+ [yC + T / 2 + 2, yS + LT / 2 - 2, yA],
+ [yS + LT / 2 + 2, yK + T / 2 - 2, yB],
+ ];
+ const fwS = (mL + xi) / 2 - 4;
+ const smalls = rows.flatMap(([f0, f1, yb]) =>
+ [sL, sR].map((cx, i) => drawer(b, types, { cx, fcx: i ? (sdx + mL) / 2 : (-xi + sdx) / 2, fw: fwS, fy0: f0, fy1: f1, zFace: zf, ow: sw, yb, dd, bh: 200 })),
+ );
+ drawerSteps(b, castors, { scene: "castor", label: "bottom", clips: true });
+ drawerSteps(b, smalls, { scene: "small", label: "small" });
+ drawersIn(b, [smalls, castors], "Put the drawers in", "The small ones onto their runners under the drawer shelf. The two bottom drawers roll in on their castors.");
+}
+
+const family: Family = {
+ names: ["VISTHUS"],
+ build(b, s) {
+ if (/chest of 6 drawers/i.test(s.variant) || s.slug === "visthus-chest-6-drawers-63-x-49-x-126") return chest(b, s), true;
+ if (/^wardrobe/i.test(s.variant) || s.slug === "visthus-wardrobe-122-x-216") return wardrobe(b, s), true;
+ return false;
+ },
+};
+export default family;
diff --git a/src/lib/plan/families/vittsjo.ts b/src/lib/plan/families/vittsjo.ts
index a456d4a..cfe85ca 100644
--- a/src/lib/plan/families/vittsjo.ts
+++ b/src/lib/plan/families/vittsjo.ts
@@ -10,7 +10,7 @@ import type { CustomFix, CustomParams, CustomPart, CustomStep, PartPiece, Produc
* board is screwed into the top frame, which pushes onto the post ends; the bottom board is screwed into the bottom
* rails. Stood up, fixed to the wall, the glass shelves drop onto clear pads.
* The round coffee table, laptop table, desk and laptop stand are built upside down where the manual says so.
- * The 90x50 coffee table has no manual to follow and keeps its old guide.
+ * The 90x50 coffee table is the nest of two tables and follows that manual.
*/
type Kind = CustomFix["kind"];
@@ -91,16 +91,12 @@ function shelving(s: ProductSpec): CustomParams {
const feet = (sx: number) => fx("foot", [-1, 1].map((sz) => [sx * xs, F, sz * zs] as Vec3), [0, 1, 0], { ...FOOT, on: sx < 0 ? "L" : "R" });
// a screw through the rail's end into the lug on the side frame, from the front or back face
- const railScrews = (ids: string[], sx: number) =>
- fx(
- "screw",
- ids.map((id) => {
- const r = rails.find((x) => x.id === id)!;
- return [sx * (W / 2 - T - 12), r.y, r.sz * (D / 2)] as Vec3;
- }),
- [0, 0, -1],
- { ...SCREW, on: sx < 0 ? "L" : "R" },
- );
+ // front rails take their screws from the front, back rails from the back
+ const railScrews = (ids: string[], sx: number): CustomFix[] =>
+ [1, -1]
+ .map((sz) => ids.map((id) => rails.find((x) => x.id === id)!).filter((r) => r.sz === sz))
+ .filter((rs) => rs.length)
+ .map((rs) => fx("screw", rs.map((r) => [sx * (W / 2 - T - 12), r.y, r.sz * (D / 2)] as Vec3), [0, 0, -rs[0].sz], { ...SCREW, on: sx < 0 ? "L" : "R" }));
const railIds = rails.map((r) => r.id);
const bottom = railIds.slice(0, 2);
const steps: CustomStep[] = [];
@@ -115,21 +111,21 @@ function shelving(s: ProductSpec): CustomParams {
});
if (tall) {
steps.push({ title: "Drop the bottom rails onto the lugs", detail: "The two rails next to the feet. The screw holes face out, the hooks the way the drawing shows.", add: bottom });
- steps.push({ title: "Screw the bottom rails on", detail: "One screw through each rail into its lug.", fix: [railScrews(bottom, -1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the bottom rails on", detail: "One screw through each rail into its lug.", fix: railScrews(bottom, -1), tools: ["screwdriver"] });
steps.push({ title: "Drop the next rail on", detail: "Check its hook faces the right way before you let go.", add: [railIds[2]] });
- steps.push({ title: "Screw it on", detail: "One screw, through the rail into the lug.", fix: [railScrews([railIds[2]], -1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw it on", detail: "One screw, through the rail into the lug.", fix: railScrews([railIds[2]], -1), tools: ["screwdriver"] });
const rest = railIds.slice(3);
- steps.push({ title: "Fit the rest of the rails", detail: "Drop each one onto its lug and screw it on.", add: rest, fix: [railScrews(rest, -1)], tools: ["screwdriver"] });
+ steps.push({ title: "Fit the rest of the rails", detail: "Drop each one onto its lug and screw it on.", add: rest, fix: railScrews(rest, -1), tools: ["screwdriver"] });
steps.push({ title: "Lay the other side frame on", detail: "Turn two feet into its posts first, then lower it onto the rail ends with its feet at the same end.", add: ["R"], fix: [feet(1)], people: 2 });
- steps.push({ title: "Screw the side frame to every rail", detail: "Eight screws, one into each rail end.", fix: [railScrews(railIds, 1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the side frame to every rail", detail: "Eight screws, one into each rail end.", fix: railScrews(railIds, 1), tools: ["screwdriver"] });
} else {
steps.push({ title: "Drop the bottom rails onto the lugs", detail: "The screw holes face out, the hooks the way the drawing shows.", add: bottom });
- steps.push({ title: "Screw the bottom rails on", detail: "One screw through each rail into its lug.", fix: [railScrews(bottom, -1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the bottom rails on", detail: "One screw through each rail into its lug.", fix: railScrews(bottom, -1), tools: ["screwdriver"] });
const mid = railIds.slice(2);
steps.push({ title: "Drop the middle rails on", detail: "Both hooks face the same way as on the bottom rails.", add: mid });
- steps.push({ title: "Screw the middle rails on", detail: "One screw in each.", fix: [railScrews(mid, -1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the middle rails on", detail: "One screw in each.", fix: railScrews(mid, -1), tools: ["screwdriver"] });
steps.push({ title: "Lay the other side frame on top", detail: "Feet at the same end as the first one, every lug onto a rail end.", add: ["R"], fix: [feet(1)] });
- steps.push({ title: "Screw the side frame to the rails", detail: "One screw into each rail end.", fix: [railScrews(railIds, 1)], tools: ["screwdriver"] });
+ steps.push({ title: "Screw the side frame to the rails", detail: "One screw into each rail end.", fix: railScrews(railIds, 1), tools: ["screwdriver"] });
}
if (wide) {
@@ -148,8 +144,8 @@ function shelving(s: ProductSpec): CustomParams {
title: "Screw on its angle brackets",
detail: "One bracket where the post crosses each rail, one screw through each. The odd bracket goes at the bottom rail.",
fix: [
- fx("angle", ys.map((y) => [T / 2 + 12, y + T / 2 + 12, z - sz * T] as Vec3), [0, 0, -sz], { name: "Angle bracket", len: 24, dia: 24, on: id }),
- fx("screw", ys.map((y) => [T / 2 + 12, y + T / 2 + 12, z - sz * T - sz * 2] as Vec3), [0, 0, -sz], { ...SCREW, on: id }),
+ fx("angle", ys.map((y) => [T / 2 + 12, y, z - sz * T] as Vec3), [0, 0, sz], { name: "Angle bracket", len: 24, dia: 24, on: id }),
+ fx("screw", ys.map((y) => [T / 2 + 12, y, z - sz * T - sz * 2] as Vec3), [0, 0, sz], { ...SCREW, on: id }),
],
tools: ["screwdriver"],
});
@@ -188,7 +184,7 @@ function shelving(s: ProductSpec): CustomParams {
steps.push({
title: "Push the top onto the post ends",
detail: "Every lug slides over a post end. One screw through each lug.",
- fix: [fx("screw", topScrews, [0, 0, -1], { ...SCREW, on: "F" })],
+ fix: [1, -1].map((sz) => fx("screw", topScrews.filter((p) => Math.sign(p[2]) === sz), [0, 0, -sz], { ...SCREW, on: "F" })),
tools: ["screwdriver"],
});
steps.push({
@@ -432,7 +428,8 @@ function laptopTable(s: ProductSpec): CustomParams {
title: "Screw the back corners together",
detail: "Three screws through the corner tabs at each end of the back rail. They keep it from racking.",
fix: [
- fx("screw", [-1, 1].flatMap((sx) => [[sx * (xs - T - 20), yt - T / 2, -zs + T / 2], [sx * (xs - T / 2), yt - T / 2, -zs + T + 20], [sx * (xs - T - 30), yt + T / 2, -zs + T + 30]] as Vec3[]), [0, -1, 0], SCREW),
+ // up through the tab into the back rail (two) and the end frame's top bar (one)
+ fx("screw", [-1, 1].flatMap((sx) => [[sx * (xs - T - 20), yt - T / 2 - 2, -zs], [sx * (xs - T - 50), yt - T / 2 - 2, -zs], [sx * xs, yt - T / 2 - 2, -zs + T + 20]] as Vec3[]), [0, 1, 0], SCREW),
],
tools: ["screwdriver"],
},
@@ -464,6 +461,143 @@ function laptopTable(s: ProductSpec): CustomParams {
return { parts, steps };
}
+/* ---------- nest of tables ---------- */
+
+/**
+ * The 90 x 50 guide is the nest of two tables. The small square one is built first, upside down: its two leg
+ * frames push into the top frame's corner sockets and are bolted, the feet go in, and stood up it gets pads and
+ * its glass. The long one: two end frames, each an end bar with two posts clicked on and two angle brackets
+ * underneath (four bolts each), then upside down onto the top frame, the low rails bolted between the posts, the
+ * feet, the shelf screwed onto the rail tabs, and stood up, pads and glass. The small one stands over the long
+ * one's end, open at the sides so the long one slides in under it.
+ */
+function nest(s: ProductSpec): CustomParams {
+ const W = s.size.w * 10, H = 450, D = 440; // the long table
+ const w = 500, h = 500; // the small table, square
+ const F = 10, pt = 12;
+ const BOLT6 = { len: 12, dia: 6 };
+ const BRACKET = { name: "Angle bracket", len: 40, dia: 30 };
+ // the small one stands over the left end of the long one
+ const cx = -W / 2 + w / 2 - 20;
+ const sxs = w / 2 - T / 2, szs = w / 2 - T / 2;
+ const legY0 = F + T / 2, legY1 = h - T - T / 2;
+ const yf = 40; // its floor bars
+ const smallFrame = (id: string, sz: number) =>
+ frame(id, "Leg frame", [
+ [[cx - sxs, legY0, sz * szs], [cx - sxs, legY1, sz * szs]],
+ [[cx + sxs, legY0, sz * szs], [cx + sxs, legY1, sz * szs]],
+ [[cx - sxs + T, yf, sz * szs], [cx + sxs - T, yf, sz * szs]],
+ ]);
+ const ring = (id: string, x0: number, x1: number, z: number, y: number) =>
+ frame(id, "Top frame", [
+ [[x0, y, -z], [x1, y, -z]],
+ [[x0, y, z], [x1, y, z]],
+ [[x0, y, -z + T], [x0, y, z - T]],
+ [[x1, y, -z + T], [x1, y, z - T]],
+ ]);
+ const xs = W / 2 - T / 2, zs = D / 2 - T / 2;
+ const yl = 110; // the long table's low frame
+ const yTop = H - T / 2;
+ const parts: CustomPart[] = [
+ ring("SR", cx - sxs, cx + sxs, szs, h - T / 2),
+ smallFrame("SA", 1),
+ smallFrame("SB", -1),
+ { id: "SG", name: "Small glass top", size: [w - 2 * T, 6, w - 2 * T], pos: [cx, h - 5, 0], material: "glass" },
+ ];
+ const posts: string[][] = [[], []];
+ [-1, 1].forEach((sx, e) => {
+ parts.push(tube(`E${e}`, "End bar", [T, T, D - 2 * T], [sx * xs, yl, 0]));
+ for (const sz of [-1, 1]) {
+ const id = `P${e}${sz < 0 ? "b" : "f"}`;
+ posts[e].push(id);
+ parts.push(tube(id, "Post", [T, yTop - T / 2 - F, T], [sx * xs, (F + yTop - T / 2) / 2, sz * zs]));
+ }
+ });
+ parts.push(ring("LR", -xs, xs, zs, yTop));
+ for (const sz of [-1, 1]) parts.push(tube(`R${sz < 0 ? "b" : "f"}`, "Low rail", [W - 2 * T, T, T], [0, yl, sz * zs]));
+ parts.push({ id: "SH", name: "Shelf", size: [W - 2 * T, pt, D - 2 * T], pos: [0, yl + T / 2 + pt / 2, 0] });
+ parts.push({ id: "LG", name: "Glass top", size: [W - 2 * T, 6, D - 2 * T], pos: [0, H - 5, 0], material: "glass" });
+
+ // the small table's bolts: through each leg top into its socket in the top frame
+ const yb = h - T - 15;
+ const sideBolt = (sz: number) => [-1, 1].map((k) => fx("bolt", [[cx + k * (w / 2), yb, sz * szs]], [-k, 0, 0], { ...BOLT6, on: sz > 0 ? "SA" : "SB", mate: "SR" }));
+ // the long table's end frames: each bracket sits under the end bar against a post, two bolts up into the bar and two into the post
+ const endFix = (e: number, pass: 0 | 1): CustomFix[] => {
+ const sx = e === 0 ? -1 : 1;
+ return [-1, 1].flatMap((sz) => {
+ const zb = sz * (zs - T / 2 - 26 - pass * 26);
+ const yp = yl - T / 2 - 12 - pass * 30;
+ return [
+ fx("bolt", [[sx * xs, yl - T / 2 - 2, zb]], [0, 1, 0], { ...BOLT6, on: `E${e}` }),
+ fx("bolt", [[sx * xs, yp, sz * (zs - T / 2 - 2)]], [0, 0, sz], { ...BOLT6, on: `P${e}${sz < 0 ? "b" : "f"}` }),
+ ];
+ });
+ };
+ const brackets = (e: number) => fx("angle", [-1, 1].map((sz) => [(e === 0 ? -1 : 1) * xs, yl - T / 2 - 30, sz * (zs - T / 2 - 30)] as Vec3), [0, 1, 0], { ...BRACKET, on: `E${e}` });
+ const endSteps = (e: number): CustomStep[] => [
+ { title: e === 0 ? "Click two posts onto an end bar" : "Build the other end frame", detail: e === 0 ? "Lay the bar on a rug and push a post onto each stub until it clicks." : "Click its posts on and fit its brackets and bolts the same way.", wait: [`E${e}`, ...posts[e]], pose: "+y", warnings: e === 0 ? ["floor"] : [] },
+ { title: "Fit an angle bracket under each joint", detail: "Hold it against the post, under the bar, and turn one bolt up into the bar.", fix: [brackets(e), ...endFix(e, 0).filter((_, i) => i % 2 === 0)], tools: ["allen"] },
+ { title: "Bolt the brackets to the posts", detail: "One bolt through each bracket into its post.", fix: endFix(e, 0).filter((_, i) => i % 2 === 1), tools: ["allen"] },
+ { title: "Put in the second bolt up into the bar", detail: "In the other hole of each bracket.", fix: endFix(e, 1).filter((_, i) => i % 2 === 0), tools: ["allen"] },
+ { title: "And the second one into each post", detail: "Tighten all four now.", fix: endFix(e, 1).filter((_, i) => i % 2 === 1), tools: ["allen"] },
+ ];
+ const e1 = endSteps(1);
+ const otherEnd: CustomStep = { ...e1[0], fix: e1.flatMap((st) => st.fix ?? []), tools: ["allen"] };
+ const ringBolts = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => fx("bolt", [[sx * (W / 2), yTop - T / 2 - T - 15, sz * zs]], [-sx, 0, 0], { ...BOLT6, on: `P${sx < 0 ? 0 : 1}${sz < 0 ? "b" : "f"}`, mate: "LR" })));
+ const railBolts = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => fx("bolt", [[sx * (W / 2), yl, sz * zs]], [-sx, 0, 0], { ...BOLT6, len: 30, on: `P${sx < 0 ? 0 : 1}${sz < 0 ? "b" : "f"}`, mate: `R${sz < 0 ? "b" : "f"}` })));
+ const shelfScrews: Vec3[] = [-1, 1].flatMap((sz) => [-2, -1, 0, 1, 2].map((k) => [k * ((W - 2 * T - 120) / 4), yl + T / 2 - 1, sz * (zs - T)] as Vec3));
+ const pads = (x0: number, x1: number, z: number, y: number, n: number): Vec3[] => [-1, 1].flatMap((sz) => Array.from({ length: n }, (_, i) => [r1(x0 + ((x1 - x0) * i) / (n - 1)), y, sz * z] as Vec3));
+ const steps: CustomStep[] = [
+ {
+ title: "Push a leg frame into the small top frame",
+ detail: "Lay the top frame upside down on a rug. Push the two legs into the sockets at one side until they click.",
+ add: ["SR", "SA"],
+ pose: "-y",
+ warnings: ["floor"],
+ },
+ { title: "Bolt the legs to the top frame", detail: "One bolt through each leg into its socket.", fix: sideBolt(1), tools: ["allen"] },
+ { title: "Push in the other leg frame", detail: "Its floor bar the same way as the first one's.", add: ["SB"] },
+ {
+ title: "Bolt it on",
+ detail: "Four bolts: one from the side and one from the back of each leg. Then tighten them all.",
+ fix: [...sideBolt(-1), fx("bolt", [-1, 1].map((k) => [cx + k * sxs, yb - 30, -w / 2] as Vec3), [0, 0, 1], { ...BOLT6, on: "SB", mate: "SR" })],
+ tools: ["allen"],
+ },
+ { title: "Screw in the four feet", detail: "By hand, into the leg ends.", fix: [fx("foot", [-1, 1].flatMap((k) => [-1, 1].map((sz) => [cx + k * sxs, F, sz * szs] as Vec3)), [0, 1, 0], FOOT)] },
+ { title: "Turn it over and stick on the glass pads", detail: "Six clear pads, on the tabs inside the top frame.", fix: [fx("glide", pads(cx - sxs + T + 20, cx + sxs - T - 20, szs - T, h - 8, 3), [0, 1, 0], { ...PAD, on: "SR" })], pose: "+y" },
+ { title: "Lay the small glass top in", detail: "Lower it flat onto the pads.", add: ["SG"] },
+ ...endSteps(0),
+ otherEnd,
+ {
+ title: "Stand the end frames in the long top frame",
+ detail: "Lay the top frame upside down on a rug and push the four post ends into its corner sockets until they click.",
+ add: ["LR", "E0", "E1", ...posts[0], ...posts[1]],
+ pose: "-y",
+ people: 2,
+ warnings: ["floor", "two"],
+ },
+ {
+ title: "Bolt in the low rails",
+ detail: "One along each side between the end bars, tabs inwards. Eight bolts: one through each post into the top frame and one into the rail.",
+ add: ["Rb", "Rf"],
+ fix: [...ringBolts, ...railBolts],
+ tools: ["allen"],
+ },
+ { title: "Screw the feet into the posts", fix: [fx("foot", [-1, 1].flatMap((sx) => [-1, 1].map((sz) => [sx * xs, F, sz * zs] as Vec3)), [0, 1, 0], FOOT)] },
+ {
+ title: "Slide in the shelf and screw it on",
+ detail: "Slide it in between the rails, show side towards the rug, and screw through the ten tabs.",
+ add: ["SH"],
+ fix: [fx("screw", shelfScrews, [0, 1, 0], { ...SMALL, on: "SH" })],
+ from: { SH: [0, 0, 500] },
+ tools: ["screwdriver"],
+ },
+ { title: "Turn it over and stick on the glass pads", detail: "Eight clear pads on the tabs inside the top frame.", fix: [fx("glide", pads(-xs + T + 20, xs - T - 20, zs - T, H - 8, 4), [0, 1, 0], { ...PAD, on: "LR" })], pose: "+y", people: 2 },
+ { title: "Lay in the glass top", detail: "Lower it flat onto the pads, then turn the feet of both tables until they stand steady. The small one goes over the end of the long one.", add: ["LG"], people: 2, warnings: ["two"] },
+ ];
+ return { parts, steps };
+}
+
/* ---------- desk ---------- */
function desk(s: ProductSpec): CustomParams {
@@ -524,7 +658,7 @@ function desk(s: ProductSpec): CustomParams {
steps.push({
title: "Bolt it from below",
detail: "Its end sits on a tab of the frame: two short bolts up through the tab.",
- fix: [fx("bolt", [-1, 1].map((d) => [xI - T / 2 - 15, yt - T / 2, z - (z > 0 ? 1 : -1) * T + d * 0] as Vec3).map((p, i) => [p[0] - i * 30, p[1], p[2]] as Vec3), [0, 1, 0], { ...SHORT, on: id })],
+ fix: [fx("bolt", [0, 1].map((i) => [xI - T / 2 - 15 - i * 30, yt - T / 2 - 2, z] as Vec3), [0, 1, 0], { ...SHORT, on: id })],
tools: ["allen"],
});
}
@@ -590,6 +724,7 @@ const family: Family = {
const slug = s.slug ?? "";
if (/shelving-unit/.test(slug)) return shelving(s);
if (/coffee-table-75/.test(slug)) return coffeeRound(s);
+ if (/coffee-table-90-x-50/.test(slug)) return nest(s);
if (/laptop-stand/.test(slug)) return laptopStand(s);
if (/laptop-table/.test(slug)) return laptopTable(s);
if (/desk/.test(slug)) return desk(s);
diff --git a/src/lib/plan/families/vitval.ts b/src/lib/plan/families/vitval.ts
index 9f2b236..b923b8a 100644
--- a/src/lib/plan/families/vitval.ts
+++ b/src/lib/plan/families/vitval.ts
@@ -117,6 +117,10 @@ function recipe(g: Geo) {
// short post at the ladder end of the front panel, carrying the ladder's top
const stubH = yTopRod + ROD / 2 - yUb;
+ const rod = parts.find((p) => p.id === front.rod)!;
+ const rodX0 = rod.pos[0] - rod.size[0] / 2, rodX1 = xLR + D / 2;
+ rod.size = [rodX1 - rodX0, rod.size[1], rod.size[2]];
+ rod.pos = [(rodX0 + rodX1) / 2, rod.pos[1], rod.pos[2]];
put("ST", "Short post", [D, stubH, D], [xLR, yUb + stubH / 2, zLad], { shape: "cyl" });
// the frame's own cross rails: the bunk's lower front flat bar and foot bar, the loft's ladder ends and long back rail
@@ -151,7 +155,7 @@ function recipe(g: Geo) {
...[0, 1, 2, 3].map((k): PartPiece => ({ shape: "box", size: [LW, 20, 40], pos: [0, -len / 2 + (len * (k + 1)) / 5, 0], material: "metal" })),
];
put("LD", "Ladder", [LW + 30, len, 50], [X - D / 2 - 40 - LW / 2, rise / 2, zLad + 10 + reach / 2], { pieces, rot: [-a, 0, 0] });
- put("LK", "Ladder bracket", [LW + 60, 60, 10], [X - D / 2 - 40 - LW / 2, rise - 30, zLad + 5]);
+ put("LK", "Ladder bracket", [LW + 60, 60, 10], [X - D / 2 - 40 - LW / 2, rise - 30, Z + RAIL_T / 2 + 5]);
}
// roll-out slatted bases on the bed rails
@@ -182,7 +186,7 @@ function recipe(g: Geo) {
const longEnd = (x: -1 | 1, z: -1 | 1, ys: number[], mate: string): CustomFix => fix("bolt", ys.map((y) => [x * (L / 2), y, z * Z] as Vec3), [-x, 0, 0], post(x, z), mate, FRAME_BOLT);
// and into an end part's end, through the post from the front or back
const endEnd = (x: -1 | 1, z: -1 | 1, ys: number[], mate: string): CustomFix => fix("bolt", ys.map((y) => [x * X, y, z * (W / 2)] as Vec3), [0, 0, -z], post(x, z), mate, FRAME_BOLT);
- const railYs = (bi: number) => [g.beds[bi] + 12, g.beds[bi] + RAIL_H - 12];
+ const railYs = (bi: number) => [g.beds[bi] + 8, g.beds[bi] + RAIL_H - 8]; // far enough apart to tell two bolts apart
const yBar = (p: Panel) => p.yb + BAR_H / 2;
const steps: CustomStep[] = [];
@@ -230,9 +234,9 @@ function recipe(g: Geo) {
endEnd(-1, -1, [yBar(eUh)], eUh.bar),
endEnd(-1, -1, [eUh.yr], eUh.rod),
endEnd(-1, 1, [yBar(eUh)], eUh.bar),
- endEnd(-1, -1, [crossYs[0] - 10, crossYs[0] + 10], hc[0]),
- endEnd(-1, 1, [crossYs[0] - 10, crossYs[0] + 10], hc[0]),
- endEnd(-1, -1, [crossYs[1] - 10, crossYs[1] + 10], hc[1]),
+ endEnd(-1, -1, [crossYs[0] - 12, crossYs[0] + 12], hc[0]),
+ endEnd(-1, 1, [crossYs[0] - 12, crossYs[0] + 12], hc[0]),
+ endEnd(-1, -1, [crossYs[1] - 12, crossYs[1] + 12], hc[1]),
endEnd(-1, 1, [crossYs[1]], hc[1]),
],
tools: ["allen"],
@@ -262,7 +266,7 @@ function recipe(g: Geo) {
title: "Bolt the foot end together",
detail: "Two posts and two end rails, the post with the extra holes at the front. Seven bolts.",
add: [post(1, -1), post(1, 1), ...fc],
- fix: [endEnd(1, -1, [crossYs[0] - 10, crossYs[0] + 10], fc[0]), endEnd(1, 1, [crossYs[0] - 10, crossYs[0] + 10], fc[0]), endEnd(1, -1, [crossYs[1]], fc[1]), endEnd(1, 1, [crossYs[1] - 10, crossYs[1] + 10], fc[1])],
+ fix: [endEnd(1, -1, [crossYs[0] - 12, crossYs[0] + 12], fc[0]), endEnd(1, 1, [crossYs[0] - 12, crossYs[0] + 12], fc[0]), endEnd(1, -1, [crossYs[1]], fc[1]), endEnd(1, 1, [crossYs[1] - 12, crossYs[1] + 12], fc[1])],
tools: ["allen"],
pose: "-x",
});
@@ -305,7 +309,7 @@ function recipe(g: Geo) {
fix: [fix("screw", [[xLR, yUb + 40, zLad - D / 2]], [0, 0, 1], "ST", front.bar, { len: 16, dia: 4 })],
tools: ["screwdriver"],
});
- steps.push({ title: "Bolt it to the top rod", detail: "One long bolt through the short post.", fix: [fix("bolt", [[xLR + D / 2, yTopRod, zLad]], [-1, 0, 0], "ST", front.rod, FRAME_BOLT)], tools: ["allen"] });
+ steps.push({ title: "Bolt it to the top rod", detail: "One long bolt from the front through the short post into the rod behind it.", fix: [fix("bolt", [[xLR, yTopRod, zLad + D / 2]], [0, 0, -1], "ST", front.rod, FRAME_BOLT)], tools: ["allen"] });
const fr = `R${g.beds.length - 1}f`;
steps.push({
title: "Bolt the front bed rail under it",
@@ -371,7 +375,7 @@ function recipe(g: Geo) {
title: "Stand the ends up and bolt in the long back rail",
detail: "One of you holds the ends upright. Two bolts at each end.",
add: ["K"],
- fix: sx.map((x) => longEnd(x, -1, [crossYs[0] - 70, crossYs[0] - 50], "K")),
+ fix: sx.map((x) => longEnd(x, -1, [crossYs[0] - 72, crossYs[0] - 48], "K")),
tools: ["allen"],
pose: "+y",
people: 2,
@@ -390,7 +394,7 @@ function recipe(g: Geo) {
title: "Screw the ladder bracket to the front rail",
detail: "Under the short post, two flat-head bolts.",
add: ["LK"],
- fix: [fix("bolt", [-1, 1].map((dx) => [xl + dx * 60, upper + RAIL_H - 30, zLad + 10] as Vec3), [0, 0, -1], "LK", fr, FLAT_BOLT)],
+ fix: [fix("bolt", [-1, 1].map((dx) => [xl + dx * 60, upper + RAIL_H - 25, Z + RAIL_T / 2 + 10] as Vec3), [0, 0, -1], "LK", fr, FLAT_BOLT)],
tools: ["allen"],
});
const rise = upper + RAIL_H;
@@ -415,13 +419,13 @@ function recipe(g: Geo) {
steps.push({
title: "Bolt the ladder's top to the front rail",
detail: "Two flat-head bolts at each ladder rail.",
- fix: [fix("bolt", sx.flatMap((s) => [-1, 1].map((dy) => [xl + s * (LW / 2), rise - 20 + dy * 10, zLad + 20] as Vec3)), [0, 0, -1], "LD", fr, FLAT_BOLT)],
+ fix: [fix("bolt", sx.flatMap((s) => [-1, 1].map((dy) => [xl + s * (LW / 2), rise - 40 + dy * 12, Z + RAIL_T / 2 + 12] as Vec3)), [0, 0, -1], "LD", "LK", FLAT_BOLT)],
tools: ["allen"],
});
steps.push({
- title: "Hook the bracket over the ladder",
- detail: "Push it down over the ladder's top and the short post, then two flat-head bolts on each side.",
- fix: [fix("bolt", sx.flatMap((s) => [-1, 1].map((dy) => [xl + s * (LW / 2 + 20), rise + dy * 15, zLad + 10] as Vec3)), [0, 0, -1], "LK", "ST", FLAT_BOLT)],
+ title: "Bolt the bracket ends to the front rail",
+ detail: "Its ends reach past the ladder's rails: two flat-head bolts on each side, through the bracket into the front rail.",
+ fix: [fix("bolt", sx.flatMap((s) => [-1, 1].map((dy) => [xl + s * (LW / 2 + 24), rise - 25 + dy * 12, Z + RAIL_T / 2 + 10] as Vec3)), [0, 0, -1], "LK", fr, FLAT_BOLT)],
tools: ["allen"],
});
steps.push({ title: "Stick the grip strips on the ladder steps", detail: "Four strips, one along the top of each step." });
diff --git a/src/lib/plan/families/voxlov.ts b/src/lib/plan/families/voxlov.ts
index 6a4a9e2..98ededd 100644
--- a/src/lib/plan/families/voxlov.ts
+++ b/src/lib/plan/families/voxlov.ts
@@ -59,7 +59,8 @@ function chair(): CustomParams {
{ id: "RF", name: "Cross rail", size: [2 * xi, 50, 24], pos: [0, yRail - 10, zF], material: "wood" },
{ id: "RB", name: "Cross rail", size: [2 * xi, 50, 24], pos: [0, yRail - 10, zB(yRail) + L / 2 + 12], material: "wood" },
side("SR", 1),
- { id: "BACK", name: "Backrest", size: [2 * xi + 40, hBack, 30], pos: [0, yBack, zB(yBack) + L / 2 + 15], rot: [-0.1, 0, 0], material: "fiber" },
+ // between the uprights, in line with them, so the bolts through the uprights go into its edges
+ { id: "BACK", name: "Backrest", size: [2 * xi, hBack, 30], pos: [0, yBack, zB(yBack)], rot: [Math.atan2(zBt - zB0, H), 0, 0], material: "fiber" },
{ id: "SEAT", name: "Seat", size: [W + 20, seatT, D - 70], pos: [0, ySeat - seatT / 2, 20], material: "fiber" },
];
const long = (sx: number) => fx("bolt", [parts[1], parts[2]].map((r): Vec3 => [sx * W / 2, r.pos[1], r.pos[2]]), [-sx, 0, 0], sx < 0 ? "SL" : "SR", { len: 80, dia: 6, name: "Long Allen screw" });
diff --git a/src/lib/plan/families/vretstorp.ts b/src/lib/plan/families/vretstorp.ts
index 1ef7473..869a913 100644
--- a/src/lib/plan/families/vretstorp.ts
+++ b/src/lib/plan/families/vretstorp.ts
@@ -76,7 +76,10 @@ function sofa(s: ProductSpec): CustomParams {
{
title: "Screw the legs into the armrests",
detail: "Lay each armrest upside down. Two legs in each, clockwise by hand.",
- add: ["ARM_L", "ARM_R", "ALEG-1-1", "ALEG-11", "ALEG1-1", "ALEG11"],
+ add: ["ARM_L", "ALEG-1-1", "ALEG-11"],
+ // the right armrest gets its legs, pads and screws beside the build and hooks on after the rails
+ wait: ["ARM_R", "ALEG1-1", "ALEG11"],
+ from: { ARM_R: [600, 0, 0], "ALEG1-1": [600, 0, 0], ALEG11: [600, 0, 0] },
pose: "-y",
warnings: ["floor"],
},
@@ -88,18 +91,18 @@ function sofa(s: ProductSpec): CustomParams {
{
title: "Turn screws into the armrests",
detail: "Stand the armrests up. Four in the inside of each, turned in only until a few millimetres show: the rails hang on their heads.",
- fix: [-1, 1].map((sx) => fx("screw", armScrews(sx), [-sx, 0, 0], sx < 0 ? "ARM_L" : "ARM_R", { name: "Allen screw", len: 30, dia: 6 })),
+ fix: [-1, 1].map((sx) => fx("screw", armScrews(sx), [sx, 0, 0], sx < 0 ? "ARM_L" : "ARM_R", { name: "Allen screw", len: 30, dia: 6 })),
tools: ["allen"],
pose: "+y",
},
{ title: "Hang the back rail on the left armrest", detail: "Its keyhole slots go over the screw heads, then push it down.", add: ["RAIL_B"], people: 2 },
{ title: "Hang the front rail on", detail: "The same way, slots over the heads and down.", add: ["RAIL_F"], people: 2 },
- { title: "Hook the right armrest onto the rails", detail: "Lift it so its screw heads slide into the rails' slots, then lower it.", people: 2, from: { ARM_R: [400, 0, 0] } },
+ { title: "Hook the right armrest onto the rails", detail: "Lift it so its screw heads slide into the rails' slots, then lower it.", add: ["ARM_R", "ALEG1-1", "ALEG11"], people: 2, from: { ARM_R: [400, 0, 0], "ALEG1-1": [400, 0, 0], ALEG11: [400, 0, 0] } },
{ title: "Tighten the screws", detail: "The four at the rails' ends, firmly with the key.", tools: ["allen"] },
{
title: "Add the locking screws",
detail: "Eight more through the rails' brackets into the armrests.",
- fix: [-1, 1].map((sx) => fx("screw", [-1, 1].flatMap((sz) => [railY0 + 10, railY0 + 70].map((y): Vec3 => [sx * inX, y, sz * (railZ - 40)])), [-sx, 0, 0], sx < 0 ? "ARM_L" : "ARM_R", { name: "Allen screw", len: 30, dia: 6 })),
+ fix: [-1, 1].map((sx) => fx("screw", [-1, 1].flatMap((sz) => [railY0 + 10, railY0 + 70].map((y): Vec3 => [sx * inX, y, sz * (railZ - 40)])), [sx, 0, 0], sx < 0 ? "ARM_L" : "ARM_R", { name: "Allen screw", len: 30, dia: 6 })),
tools: ["allen"],
},
{ title: "Pull the armrest covers on", detail: "One over each armrest, the roll at the top.", add: ["ACOVER_L", "ACOVER_R"], from: { ACOVER_L: [0, 400, 0], ACOVER_R: [0, 400, 0] } },
@@ -111,7 +114,7 @@ function sofa(s: ProductSpec): CustomParams {
fix: [-1, 1].map((sx) => fx("screw", [[sx * (inX - 16), seatTop - seatT - 140, 150]], [sx, 0, 0], sx < 0 ? "MECH_L" : "MECH_R", { name: "Allen screw", len: 30, dia: 6 })),
tools: ["allen"],
},
- { title: "Clip the ends of the storage bottom's rods", detail: "Push a clip onto each of the four rod ends.", fix: [fx("clip", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * (inX - 30), railY0 + 10, sz * (railZ - 30)])), [0, -1, 0], "DECK")], wait: ["DECK"] },
+ { title: "Clip the ends of the storage bottom's rods", detail: "Push a clip onto each of the four rod ends.", fix: [fx("clip", [-1, 1].flatMap((sx) => [-1, 1].map((sz): Vec3 => [sx * (inX - 30), railY0 + 10, sz * (railZ - 30)])), [0, -1, 0], "DECK")], wait: ["DECK"], from: { DECK: [0, 0, 900] } },
{ title: "Lay the storage bottom between the rails", detail: "Two of you, rods across, clips over the rails.", add: ["DECK"], people: 2, warnings: ["two"] },
{ title: "Click the clips onto the rails", detail: "Ten along the front and back rails, pressed until they click." },
{ title: "Close the straps round the rails", detail: "Four on each side, wrapped round and pressed closed." },
diff --git a/src/lib/plan/families/yngvar.ts b/src/lib/plan/families/yngvar.ts
index 44ad87d..e576321 100644
--- a/src/lib/plan/families/yngvar.ts
+++ b/src/lib/plan/families/yngvar.ts
@@ -7,7 +7,8 @@ import { buildCustom } from "../custom";
* YNGVAR, read from the bar stool's manual. The steel frame comes welded in one piece with its backrest on. The seat
* lies upside down on a table with the frame on it, back hanging over the edge; a plastic spacer goes on at each of
* four points of the ring under the seat and a bolt through each, by hand, then the four are tightened crosswise with
- * the Allen key. The dining chair's manual only shows how to stack it (it comes assembled), so it keeps its old guide.
+ * the Allen key. The dining chair comes assembled: its manual only shows how to stack it (five high at most, never
+ * twisted round), so its guide unpacks it and stacks it.
*/
const TUBE = 20;
@@ -66,7 +67,39 @@ function barStool(s: ProductSpec): CustomParams {
};
}
-const recipe = (s: ProductSpec) => (/yngvar-bar-stool/.test(s.slug ?? "") ? barStool(s) : null);
+/** A crescent of a ring round the back of the seat, as [x, z] corners: outer edge one way, inner edge back. */
+function arc(rx: number, rz: number, t: number, a0: number, a1: number, n = 14): [number, number][] {
+ const pt = (a: number, d: number): [number, number] => [Math.round((rx - d) * Math.cos(a)), Math.round((rz - d) * Math.sin(a))];
+ const as = Array.from({ length: n + 1 }, (_, i) => a0 + ((a1 - a0) * i) / n);
+ return [...as.map((a) => pt(a, 0)), ...as.reverse().map((a) => pt(a, t))];
+}
+
+function chair(s: ProductSpec): CustomParams {
+ // IKEA: 71 high at the back, seat 45 high, 53 wide, 51 deep
+ const H = Math.round(s.size.h * 10) || 710, seatY = 450, seatT = 30, yRing = seatY - seatT - TUBE / 2;
+ const xt = 145, zt = 140, xf = 225, zf = 205;
+ const c: Vec3 = [0, H / 2, 0];
+ const corners = [-1, 1].flatMap((sx) => [-1, 1].map((sz): [number, number] => [sx, sz]));
+ const rx = 255, rz = 250, band = 80;
+ const zUp = (x: number) => -rz * Math.sqrt(1 - (x / rx) ** 2);
+ const pieces: PartPiece[] = [
+ ...corners.map(([sx, sz]) => tube([sx * xf, 0, sz * zf], [sx * xt, yRing, sz * zt], c)),
+ ...[-1, 1].map((sz) => tube([-xt, yRing, sz * zt], [xt, yRing, sz * zt], c)),
+ ...[-1, 1].map((sx) => tube([sx * xt, yRing, -zt], [sx * xt, yRing, zt], c)),
+ ...[-1, 1].map((sx) => tube([sx * 110, yRing, -zt], [sx * 150, H - band, zUp(150) + 8], c)),
+ { shape: "slab", size: [2 * rx, band, rz], pos: [0, H - band / 2 - c[1], 0], outline: arc(rx, rz, 14, Math.PI + 0.45, 2 * Math.PI - 0.45), round: 4 },
+ { shape: "cyl", size: [420, seatT, 420], pos: [0, seatY - seatT / 2 - c[1], 0] },
+ ];
+ return {
+ parts: [{ id: "CH", name: "Chair", size: [2 * xf + TUBE, H, 2 * zf + TUBE], pos: c, pieces, material: "metal" }],
+ steps: [
+ { title: "Unpack the chair", detail: "It comes ready assembled, so there is nothing to put together. Cut the wrapping open carefully so the knife can't scratch it.", add: ["CH"] },
+ { title: "Stack the chairs if you need to", detail: "Up to five, each one lowered straight onto the one below. Never twist a stack round to move it." },
+ ],
+ };
+}
+
+const recipe = (s: ProductSpec) => (/yngvar-bar-stool/.test(s.slug ?? "") ? barStool(s) : /yngvar-chair/.test(s.slug ?? "") ? chair(s) : null);
/** The recipe, with each step's tools as the manual shows them (the bolts go in by hand first). */
function build(b: PlanBuilder, s: ProductSpec): boolean {
diff --git a/src/lib/plan/families/yxstaby.ts b/src/lib/plan/families/yxstaby.ts
new file mode 100644
index 0000000..4a7bcfb
--- /dev/null
+++ b/src/lib/plan/families/yxstaby.ts
@@ -0,0 +1,126 @@
+import type { Family } from "./family";
+import type { CustomFix, CustomParams, CustomPart, CustomStep, ProductSpec, Vec3 } from "../../types";
+
+/**
+ * YXSTABY gaming monitor stand, read from its manual: a particleboard top on two steel end legs, with a steel cable
+ * tray hanging under its back edge. It is built upside down on a rug: the right leg is screwed to the top through its
+ * flange, the cable tray is laid on and tipped up, the left leg slides on, then the leg flanges, the tray flange and
+ * two small corner brackets are screwed down. Four anti-slip pads go under the legs and the stand is turned over;
+ * the hooks clip onto the back. Fourteen screws of one kind in all.
+ */
+
+const fx = (kind: CustomFix["kind"], at: Vec3[], dir: Vec3, on: string, o: Partial<CustomFix> = {}): CustomFix => ({ kind, count: at.length, at, dir, on, ...o });
+const SCREW = { len: 10, dia: 4 };
+const UP: Vec3 = [0, 1, 0];
+
+function recipe(s: ProductSpec): CustomParams {
+ const W = Math.round(s.size.w * 10), H = Math.round(s.size.h * 10), D = Math.round(s.size.d * 10);
+ const TT = 16, yT = H - TT; // underside of the top
+ const ST = 3; // steel sheet
+ const FW = 30; // leg flange, inwards under the top
+ const xo = W / 2; // outer face of a leg
+ const leg = (id: string, g: 1 | -1): CustomPart => ({
+ id,
+ name: "Leg",
+ size: [FW + ST, yT, D],
+ pos: [g * (xo - (FW + ST) / 2), yT / 2, 0],
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [ST, yT, D], pos: [g * (FW / 2), 0, 0] },
+ { shape: "box", size: [FW, ST, D - 30], pos: [-g * (ST / 2), yT / 2 - ST / 2, 0] },
+ ],
+ });
+ const xf = xo - ST - FW / 2; // flange screw line
+ const tl = 2 * (xo - ST - FW) - 10; // tray length, between the leg flanges
+ const zb = -D / 2; // back edge
+ const tz = zb + 40; // tray's hanging plate
+ const parts: CustomPart[] = [
+ {
+ id: "T",
+ name: "Top",
+ size: [W, TT, D],
+ pos: [0, H - TT / 2, 0],
+ material: "board",
+ // the front corners are rounded
+ pieces: [{ shape: "slab", size: [W, TT, D], pos: [0, 0, 0], outline: [[-W / 2, -D / 2], [W / 2, -D / 2], [W / 2, D / 2], [-W / 2, D / 2]], round: 14 }],
+ },
+ leg("R", 1),
+ leg("L", -1),
+ {
+ id: "C",
+ name: "Cable tray",
+ size: [tl, 90, 42],
+ pos: [0, yT - 45, zb + 21],
+ material: "metal",
+ pieces: [
+ { shape: "box", size: [tl, 2, 42], pos: [0, 45 - 1, 0] },
+ { shape: "box", size: [tl, 88, 2], pos: [0, -1, 19] },
+ ],
+ },
+ ...([1, -1] as const).map((g): CustomPart => ({ id: g > 0 ? "KR" : "KL", name: "Corner bracket", size: [xo - ST - tl / 2, 30, 20], pos: [g * ((xo - ST + tl / 2) / 2), yT - 60, tz + 12], material: "metal" })),
+ ];
+ // the flange screws go up through the flange into the top
+ const flange = (id: string, g: number, zs: number[]) => fx("screw", zs.map((z): Vec3 => [g * xf, yT - ST - 1, z]), UP, id, { ...SCREW, mate: "T" });
+ const steps: CustomStep[] = [
+ {
+ title: "Screw the right leg onto the top",
+ detail: "Lay the top face down on a rug. Stand the leg on its end, flange on the top, and turn in three screws by hand.",
+ add: ["T", "R"],
+ fix: [flange("R", 1, [-D / 2 + 40, 0, D / 2 - 40])],
+ tools: ["screwdriver"],
+ pose: "-y",
+ warnings: ["floor"],
+ },
+ { title: "Lay the cable tray on the top", detail: "Flat along the back edge, its end against the right leg.", add: ["C"] },
+ { title: "Tip the tray up into place", detail: "Turn it up onto its edge so its flange lies on the top and its end tucks into the leg." },
+ {
+ title: "Slide on the left leg",
+ detail: "Push it on from the end so it covers the end of the tray, then one screw through its flange.",
+ add: ["L"],
+ from: { L: [-200, 0, 0] },
+ fix: [flange("L", -1, [0])],
+ tools: ["screwdriver"],
+ },
+ { title: "Turn it round", detail: "Swing it end for end on the rug so the open back faces you. It stays upside down." },
+ {
+ title: "Slide in the corner brackets",
+ detail: "One at each end of the tray, between the tray and the leg.",
+ add: ["KR", "KL"],
+ from: { KR: [0, 0, 120], KL: [0, 0, 120] },
+ },
+ { title: "Screw the left leg's flange down", detail: "Two more screws, one near each end of the flange.", fix: [flange("L", -1, [-D / 2 + 40, D / 2 - 40])], tools: ["screwdriver"] },
+ {
+ title: "Screw the tray's flange to the top",
+ detail: "Six screws, spread along the back.",
+ fix: [fx("screw", [-0.42, -0.25, -0.08, 0.08, 0.25, 0.42].map((f): Vec3 => [f * tl, yT - 3, zb + 15]), UP, "C", { ...SCREW, mate: "T" })],
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Screw the brackets to the legs",
+ detail: "One screw through each bracket into the leg.",
+ fix: ([1, -1] as const).map((g) => fx("screw", [[g * (xo - ST - 2), yT - 60, tz + 12]], [g, 0, 0], g > 0 ? "KR" : "KL", { ...SCREW, mate: g > 0 ? "R" : "L" })),
+ tools: ["screwdriver"],
+ },
+ {
+ title: "Stick on the pads and turn it over",
+ detail: "Two anti-slip pads under each leg, then stand the stand on its legs.",
+ fix: ([1, -1] as const).map((g) => fx("glide", [-D / 2 + 40, D / 2 - 40].map((z): Vec3 => [g * (xo - ST / 2), 0, z]), UP, g > 0 ? "R" : "L", { name: "Anti-slip pad", len: 2, dia: 20 })),
+ pose: "+y",
+ },
+ {
+ title: "Clip on the holders",
+ detail: "The headphone hook, the controller holder and the cable holder hook over the back edge wherever you like them.",
+ fix: [fx("hook", [-W / 3, 40, W / 3].map((x): Vec3 => [x, H - TT / 2, zb]), [0, 0, 1], "T", { name: "Holder", len: 60, dia: 30 })],
+ },
+ ];
+ return { parts, steps };
+}
+
+const family: Family = {
+ names: ["YXSTABY"],
+ recipe(s) {
+ if (!/monitor stand/i.test(s.variant)) return null;
+ return recipe(s);
+ },
+};
+export default family;
diff --git a/src/lib/plan/row.ts b/src/lib/plan/row.ts
index 3c1d8f5..892bd98 100644
--- a/src/lib/plan/row.ts
+++ b/src/lib/plan/row.ts
@@ -1,5 +1,5 @@
import type { HwItem, PartItem, ProductSpec, Step, ToolId, Vec3 } from "../types";
-import { HW, PlanBuilder, type FitOpts, type HwDef } from "./builder";
+import { HW, PlanBuilder, defOf, type FitOpts, type HwDef } from "./builder";
import { clamp, rotate, toWorld } from "./math";
import { slidingDoors } from "./sliding";
@@ -63,7 +63,7 @@ export function buildRow(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder, s
// the first one's wall fixing waits until they all stand together
let anchor: { def: Step; items: HwItem[] } | undefined;
const lastStep = b.steps[b.steps.length - 1];
- if (lastStep?.kind === "anchor") {
+ if (lastStep && (lastStep.kind === "anchor" || lastStep.wall) && !b.items.some((it) => it.kind === "part" && it.states.some((x) => x.step === lastStep.n))) {
const items = b.items.filter((it): it is HwItem => it.kind === "hw" && it.step === lastStep.n);
b.items = b.items.filter((it) => !(it.kind === "hw" && it.step === lastStep.n));
for (const it of items) b.map.delete(it.key);
@@ -112,7 +112,7 @@ export function buildRow(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder, s
const ht = b.hw.get(h.ref)!;
const key = copies.get(h.parent!)![k - 1];
const f = b.partItem(key).final;
- const k2 = b.preset({ kind: ht.kind, len: ht.len, dia: ht.dia, notIncluded: ht.notIncluded }, { on: key, at: toWorld(h.pos, f.pos, f.rot), dir: rotate(h.dir, f.rot), twist: h.twist, scale: h.scale, hole: false });
+ const k2 = b.preset(defOf(ht), { on: key, at: toWorld(h.pos, f.pos, f.rot), dir: rotate(h.dir, f.rot), twist: h.twist, scale: h.scale, hole: false });
const c = b.map.get(k2) as HwItem;
c.spin = h.spin;
c.turn = h.turn;
@@ -180,7 +180,7 @@ export function buildRow(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder, s
b.stagger(0.12);
for (const h of a.items) {
const ht = b.hw.get(h.ref)!;
- const def = { kind: ht.kind, len: ht.len, dia: ht.dia, notIncluded: ht.notIncluded };
+ const def = defOf(ht);
for (let k = 0; k < n; k++) {
if (h.parent) {
const key = frameOf(h.parent, k);
diff --git a/src/lib/plan/units.ts b/src/lib/plan/units.ts
index 8bad67c..96e446c 100644
--- a/src/lib/plan/units.ts
+++ b/src/lib/plan/units.ts
@@ -1,5 +1,5 @@
import type { HwItem, HwType, PartItem, PartType, ProductSpec, RowUnit, Step, Vec3 } from "../types";
-import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { HW, PlanBuilder, defOf, type FitOpts } from "./builder";
import { rotate, toLocal, toWorld } from "./math";
import { slidingDoors } from "./sliding";
import { jointFits, type RowOpts } from "./row";
@@ -62,7 +62,7 @@ interface Built {
/** Takes the last step off when it fixes the frame to the wall: that waits until every frame stands in place. */
function takeAnchor(b: PlanBuilder): Built["anchor"] {
const last = b.steps[b.steps.length - 1];
- if (last?.kind !== "anchor") return undefined;
+ if (!last || (last.kind !== "anchor" && !last.wall) || b.items.some((it) => it.kind === "part" && it.states.some((x) => x.step === last.n))) return undefined;
const items = b.items.filter((it): it is HwItem => it.kind === "hw" && it.step === last.n);
b.items = b.items.filter((it) => !(it.kind === "hw" && it.step === last.n));
for (const it of items) b.map.delete(it.key);
@@ -205,7 +205,7 @@ export function buildUnits(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder,
const key = frameParts[i].get(h.parent!);
if (!key) continue;
const f = b.partItem(key).final;
- const k2 = b.preset({ kind: ht.kind, len: ht.len, dia: ht.dia, notIncluded: ht.notIncluded }, { on: key, at: toWorld(h.pos, f.pos, f.rot), dir: rotate(h.dir, f.rot), twist: h.twist, scale: h.scale, hole: false });
+ const k2 = b.preset(defOf(ht), { on: key, at: toWorld(h.pos, f.pos, f.rot), dir: rotate(h.dir, f.rot), twist: h.twist, scale: h.scale, hole: false });
const c = b.map.get(k2) as HwItem;
c.spin = h.spin;
c.turn = h.turn;
@@ -226,7 +226,7 @@ export function buildUnits(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder,
let title: string, detail: string;
if (u.corner) {
title = "Build the corner unit";
- detail = `The same way as a ${what}, without a clothes rail. Its shelves go on pins.`;
+ detail = "Every step of its own guide, lying down, then stand it up. Its shelves go on pins.";
} else if (g.includes(first)) {
title = k > 1 ? `Build ${COUNT[k]} more ${adj(u)}${whats} the same way` : `Build another ${adj(u)}${what} the same way`;
detail = k > 1 ? "Every step as for the first one. Stand each one next to the last." : "Every step as for the first one. Stand it next to the first.";
@@ -287,15 +287,12 @@ export function buildUnits(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder,
if (joint) for (const y of joint.ys(H)) addJoint(a, c, [Math.min(frontOf(a, 0), frontOf(c, 0)) - joint.back, y, zj], [0, 0, 1]);
else for (const y of ys) screws.push({ on: a, at: [xf, y, zj], dir: [0, 0, 1], mate: c });
}
- // the corner unit: screwed to the side of the first frame along the back wall, and to the first one on the side wall
+ // the corner unit: its own joining brackets hold it to the first frame along the back wall (they're in its own
+ // steps); here it's screwed to the first one on the side wall
const cu = units.findIndex((u) => u.corner);
if (cu >= 0) {
- const cz0 = places[cu].pos[2] - (units[cu].w * 10) / 2, cz1 = cz0 + units[cu].w * 10;
+ const cz1 = places[cu].pos[2] + (units[cu].w * 10) / 2;
const cx1 = -W / 2 + depth(cu);
- const b0 = backRun[0];
- const bl = b0 !== undefined ? extreme(b0, 0, false) : undefined;
- const zb1 = -D / 2 + (b0 !== undefined ? depth(b0) : 0);
- if (bl && zb1 - cz0 > 80) for (const y of ys) screws.push({ on: bl, at: [b.partItem(bl).final.pos[0] + tOf(bl) / 2, y, (cz0 + zb1) / 2], dir: [-1, 0, 0], hole: false });
const s0 = sideRun[0];
const cs = extreme(cu, 2, true), fs = s0 !== undefined ? extreme(s0, 2, false) : undefined;
if (cs && fs) for (const y of ys) screws.push({ on: cs, at: [Math.min(cx1, -W / 2 + depth(s0)) - 60, y, cz1 - tOf(cs)], dir: [0, 0, 1], mate: fs });
@@ -340,7 +337,7 @@ export function buildUnits(b: PlanBuilder, s: ProductSpec, one: (b: PlanBuilder,
if (!src.anchor) return;
for (const h of src.anchor.items) {
const ht = src.hw.get(h.ref)!;
- const def = { kind: ht.kind, len: ht.len, dia: ht.dia, notIncluded: ht.notIncluded };
+ const def = defOf(ht);
if (h.parent) {
// fittings sit on their part, wherever the part now stands
const key = frameParts[i].get(h.parent);
diff --git a/src/lib/products.ts b/src/lib/products.ts
index bdcf9e4..2bad407 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -193,12 +193,12 @@ export const ROWS: Row[] = [
["HEMNES", "chest", "Chest of 8 drawers", 160, 96, 50, { cols: 2, rows: 4, knobs: "knob", plinth: true, min: 240 }, "dresser"],
["HEMNES", "chest", "Chest of 6 drawers", 108, 131, 50, { cols: 2, rows: 3, knobs: "knob", plinth: true, min: 210 }, "dresser"],
["HEMNES", "nightstand", "Nightstand, 2 drawers", 46, 70, 35, { rows: 1, knobs: "knob", plinth: true }, "bedside table"],
- ["KULLEN", "chest", "Chest of 5 drawers", 35, 103, 40, { rows: 5, knobs: "knob" }],
+ ["KULLEN", "chest", "Chest of 5 drawers", 70, 112, 40, { rows: 5, knobs: "knob" }],
["KULLEN", "chest", "Chest of 6 drawers", 140, 72, 40, { cols: 2, rows: 3, knobs: "knob" }],
["KULLEN", "nightstand", "Chest of 2 drawers", 35, 49, 40, { rows: 2, knobs: "knob" }, "bedside"],
["NORDLI", "chest", "Chest of 8 drawers", 160, 99, 47, { cols: 2, rows: 4, knobs: "none", min: 240 }],
["NORDLI", "chest", "Chest of 4 drawers", 40, 99, 47, { rows: 4, knobs: "none" }],
- ["TARVA", "chest", "Chest of 5 drawers", 79, 129, 48, { rows: 5, knobs: "knob" }, "pine"],
+ ["TARVA", "chest", "Chest of 5 drawers", 76, 127, 40, { rows: 5, knobs: "knob" }, "pine"],
["TARVA", "chest", "Chest of 6 drawers", 118, 92, 48, { cols: 2, rows: 3, knobs: "knob" }, "pine"],
["TARVA", "nightstand", "Nightstand", 39, 61, 38, { rows: 1, knobs: "knob" }, "bedside pine"],
["KOPPANG", "chest", "Chest of 3 drawers", 90, 83, 55, { rows: 3, knobs: "bar" }],
@@ -313,7 +313,7 @@ export const ROWS: Row[] = [
["LANDSKRONA", "sofa", "3-seat sofa", 204, 78, 89, { seats: 3, arms: "slim", seatH: 44, sdp: 61, ah: 64 }, "couch"],
["GLOSTAD", "sofa", "2-seat sofa", 121, 68, 78, { seats: 2, seatH: 41, sdp: 54, ah: 57, bk: 68, lg: 23 }, "couch"],
["UPPLAND", "sofa", "3-seat sofa", 231, 89, 98, { seats: 3 }, "couch"],
- ["HEMLINGBY", "sofa", "2-seat sofa", 156, 80, 80, { seats: 2, arms: "slim" }, "couch"],
+ ["HEMLINGBY", "sofa", "2-seat sofa", 145, 71.5, 71.5, { seats: 2, arms: "slim" }, "couch"],
["STEFAN", "chair", "Chair", 42, 90, 49, { seatH: 46 }, "dining chair pine"],
["ODGER", "chair", "Chair", 45, 81, 51, { seatH: 43 }, "dining chair"],
["TEODORES", "chair", "Chair", 46, 80, 53, {}, "dining chair"],
diff --git a/src/lib/types.ts b/src/lib/types.ts
index b34c98a..76de955 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -276,7 +276,9 @@ export type PartMaterial = "board" | "fiber" | "wood" | "metal" | "soft" | "glas
/** One box or cylinder of a part made of several (a star base, a cot side with bars), in the part's own frame. */
export interface PartPiece {
- shape: "box" | "cyl" | "halfcyl"; // halfcyl: half a disc, [dia, thickness, dia / 2], flat edge at the back (-z)
+ shape: "box" | "cyl" | "halfcyl" | "slab"; // halfcyl: half a disc, [dia, thickness, dia / 2], flat edge at the back (-z)
+ outline?: [number, number][]; // slab: its corners as [x, z] (mm, from pos), drawn as one board of size[1] thickness
+ round?: number; // slab: corner radius
size: Vec3; // mm, box extents or cylinder [dia, length, dia]
pos: Vec3; // mm, from the centre of the part
rot?: Vec3;