Skip to content

armgit / bygga

Public Imported from GitHub
0

IKEA assembly, step by step: animated, manual-style 3D guides. Scan any paper manual with Together AI.

TypeScript

Draw sun loungers

Youssefe8aad49a461b
diff --git a/scripts/ikea/build.ts b/scripts/ikea/build.ts
index 56c0b0d..66141fd 100644
--- a/scripts/ikea/build.ts
+++ b/scripts/ikea/build.ts
@@ -59,7 +59,7 @@ function hints(family: string, kind: Kind): Hint | undefined {
/* ---------- matching against hand made entries ---------- */
-const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab", "bookrow", "cabrow", "section", "gateleg", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa"]);
+const LATER_KINDS = new Set<Kind>(["office", "chaise", "corner", "cot", "bunk", "loft", "dropleaf", "daybed", "mixed", "sliding", "slidecab", "bookrow", "cabrow", "section", "gateleg", "washstand", "sinkcab", "appliance", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa", "lounger"]);
function baseMatch(name: string, draw: Draw): CatalogEntry | undefined {
const fam = fold(name);
diff --git a/scripts/ikea/check.ts b/scripts/ikea/check.ts
index a607147..2e04073 100644
--- a/scripts/ikea/check.ts
+++ b/scripts/ikea/check.ts
@@ -99,6 +99,8 @@ async function main() {
// a real name we don't draw (a conference chair) must not land on a near miss
expect("laktare", null);
expect("laktare chair", null);
+ // sun loungers are drawn now
+ expect("nammaro sun lounger", "nammaro-sun-lounger");
expect("marius", "marius-stool");
// a day-bed is its own kind, and doesn't take over the family's bed
expect("hemnes daybed", "hemnes-day-bed-frame-3-drawers-80-x-200");
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index c9eb90f..9397bc8 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -266,6 +266,8 @@ const RULES: Rule[] = [
[/^(lounge chair|reclining chair)$/, (_m, c) => (c.f.spr ? "lounge chair sold with cushions" : { kind: "lounge" })],
// highchairs: a seat shell on four legs, with a tray (the legs, trays and seat shells sold alone stay skipped)
[/^highchair with (tray|safety belt)$/, (m) => ({ kind: "highchair", x: m[1] === "tray" ? {} : { shelf: false } })],
+ // sun loungers with a backrest that adjusts (their cushions, covers and pads sold alone stay skipped)
+ [/^sun lounger$/, () => ({ kind: "lounger" })],
[/swivel|office chair|gaming chair|conference|desk chair|highchair|lounge|reclining|lounger|hammock|massage/, () => "office, swivel or lounge chair"],
// sofas with a chaise longue at one or both ends, and corner sofas (an L of sections)
[/^(?=.*\bsofa)(?=.*\b(corner|crnr|chaise))/, (m) => {
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 8012a9c..f2e006d 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -872,6 +872,7 @@
"NÄMMARÖ|Modular easy chair, 63 cm": "nammaro-modular-easy-chair-63",
"NÄMMARÖ|Reclining chair, outdoor": "nammaro-reclining-chair-outdoor",
"NÄMMARÖ|Stool, outdoor, 37 × 45 cm": "nammaro-stool-outdoor-37-x-45",
+ "NÄMMARÖ|Sun lounger": "nammaro-sun-lounger",
"NÄMMARÖ|Table, outdoor, 130 cm": "nammaro-table-outdoor-130",
"NÄMMARÖ|Table, outdoor, 140 × 75 cm": "nammaro-table-outdoor-140-x-75",
"NÄMMARÖ|Table, outdoor, 75 × 63 cm": "nammaro-table-outdoor-75-x-63",
@@ -1112,6 +1113,7 @@
"SEGERÖN|Corner section, outdoor": "segeron-corner-section-outdoor",
"SEGERÖN|Corner sofa, 3-seat": "segeron-corner-sofa-3-seat",
"SEGERÖN|One-seat section, outdoor": "segeron-one-seat-section-outdoor",
+ "SEGERÖN|Sun lounger": "segeron-sun-lounger",
"SEGERÖN|Table, outdoor, 91 × 147 cm": "segeron-table-outdoor-91-x-147",
"SEGRARE|Desk sit/stand, 110 × 60 cm": "segrare-desk-sit-stand-110-x-60",
"SKÅLBODA|Armchair": "skalboda-armchair",
@@ -1234,6 +1236,7 @@
"STORKLINTA|Chest of 6 drawers, 140 × 50 × 75 cm": "storklinta-chest-6-drawers-140-x-50-x-75",
"STORKLINTA|Chest of 6 drawers, 70 × 50 × 120 cm": "storklinta-chest-6-drawers-70-x-50-x-120",
"STRANDÖN|Folding stool": "strandon-folding-stool",
+ "STRANDÖN|Sun lounger": "strandon-sun-lounger",
"STYRSPEL|Gaming chair": "styrspel-gaming-chair",
"SUNDSÖ|Cabinet, 60 × 35 × 86 cm": "sundso-cabinet-60-x-35-x-86",
"SUNDSÖ|Folding chair": "sundso-folding-chair",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index a6cf0c7..cb54a4a 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -942,6 +942,7 @@ nammaro-lounge-chair-outdoor|40510306
nammaro-modular-easy-chair-63|79584363 39529156 49621507 19611166 99575414 79607473
nammaro-reclining-chair-outdoor|50510301
nammaro-stool-outdoor-37-x-45|70510300
+nammaro-sun-lounger|30503354 49534888 69576028
nammaro-table-outdoor-130|50586701
nammaro-table-outdoor-140-x-75|20510307
nammaro-table-outdoor-75-x-63|00510308
@@ -1189,6 +1190,7 @@ segeron-corner-section-cushion|59584726
segeron-corner-section-outdoor|70510809
segeron-corner-sofa-3-seat|89584621
segeron-one-seat-section-outdoor|50510805
+segeron-sun-lounger|79500863 20510798
segeron-table-outdoor-91-x-147|10510812 90510813
segrare-desk-sit-stand-110-x-60|40534703
skalboda-armchair|40555309 90554388 20582035
@@ -1317,6 +1319,7 @@ storklinta-chest-6-drawers-140-x-50-x-75|70627550 00628223 30627547 80627559
storklinta-chest-6-drawers-70-x-50-x-120|70627545 80628224 00627544 20627557
strandmon-wing-chair|50628942 70359830 80613171 40613168 90613175 60613167 30359846 40494641 30392544
strandon-folding-stool|30591100
+strandon-sun-lounger|80605944
styrspel-gaming-chair|80522034 90613057
sundso-cabinet-60-x-35-x-86|80586243 70584188 10584186
sundso-folding-chair|50575887 40575883 90575890 10575889 30575888 90575885 70575891
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index 3896724..fb0033a 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -870,6 +870,7 @@ NÄMMARÖ|dining|Table, outdoor, 130 cm|130|74|130|round=1|outdoor garden
NÄMMARÖ|dining|Table, outdoor, 140 × 75 cm|140|74|75||outdoor garden
NÄMMARÖ|lounge|Reclining chair, outdoor|66|102|84||outdoor garden
NÄMMARÖ|lounge|Lounge chair, outdoor|72|88|80||outdoor garden
+NÄMMARÖ|lounger|Sun lounger|66|87|195||outdoor garden
NÄMMARÖ|section|Modular easy chair, 63 cm|63|83|92|seats=1,arms=wide|outdoor garden
NÄMMARÖ|sofa|2-seat sofa, 126 cm|126|85|92|seats=2|outdoor garden
NÄMMARÖ|sofa|2-seat sofa, 147 cm|147|85|92|seats=2|outdoor garden
@@ -1110,6 +1111,7 @@ SEGERÖN|chair|Chair with armrests, outdoor|44|88|50|arms=slim|outdoor garden
SEGERÖN|coffee|Coffee table, outdoor, 73 × 73 cm|73|45|73||outdoor garden
SEGERÖN|corner|Corner sofa, 3-seat|173|85|173|seats=3,arms=wide,corner=left,sd=92|outdoor garden
SEGERÖN|dining|Table, outdoor, 91 × 147 cm|91|74|147||outdoor garden
+SEGERÖN|lounger|Sun lounger|66|87|195||outdoor garden
SEGERÖN|section|One-seat section, outdoor|64|83|92|seats=1|outdoor garden
SEGERÖN|section|Corner section with cushion|92|83|92|seats=1,corner=left|outdoor garden
SEGERÖN|section|Corner section, outdoor|92|83|92|seats=1,corner=left|outdoor garden
@@ -1234,6 +1236,7 @@ STORKLINTA|chest|Chest of 6 drawers, 70 × 50 × 120 cm|70|120|50|rows=6
STORKLINTA|chest|Chest of 6 drawers, 140 × 50 × 75 cm|140|75|50|rows=3,cols=2
STORKLINTA|nightstand|Chest of 2 drawers, 30 × 50 × 53 cm|30|53|50|rows=2
STORKLINTA|nightstand|Chest of 2 drawers, 40 × 50 × 53 cm|40|53|50|rows=2
+STRANDÖN|lounger|Sun lounger|66|87|195||outdoor garden
STRANDÖN|stool|Folding stool|35|45|35||outdoor garden
STYRSPEL|office|Gaming chair|64|128|64|arms=slim,seatH=50
SUNDSÖ|cabinet|Cabinet, 60 × 35 × 86 cm|60|86|35||outdoor garden
diff --git a/src/lib/plan/lounger.ts b/src/lib/plan/lounger.ts
new file mode 100644
index 0000000..a4b7d83
--- /dev/null
+++ b/src/lib/plan/lounger.ts
@@ -0,0 +1,137 @@
+import type { PartPiece, ProductSpec, Vec3 } from "../types";
+import { HW, PlanBuilder, type FitOpts } from "./builder";
+import { clamp } from "./math";
+
+/**
+ * A sun lounger with a backrest that adjusts: two long side rails on four legs, cross rails between them, a slatted seat
+ * screwed on top, and a slatted backrest bolted at the end of the seat so it tips up, propped on a support that drops
+ * into notches on the rails. It lies along the depth, the backrest at the back.
+ */
+export function buildLounger(b: PlanBuilder, s: ProductSpec) {
+ const p = s.seat ?? {};
+ const W = s.size.w * 10, L = s.size.d * 10;
+ const top = clamp((p.seatH ?? 33) * 10, 250, 450); // top of the seat
+ const railH = 80, railT = 36, slatT = 18;
+ const railTop = top - slatT;
+ const ry = railTop - railH / 2;
+ const legS = 46;
+ const backLen = Math.round(L * 0.36);
+ const zh = -L / 2 + backLen; // where the backrest hinges, at the end of the seat
+ const tilt = (50 * Math.PI) / 180;
+
+ /* ---------- frame ---------- */
+ const railTp = b.part("Side rail", [railT, railH, L], { material: "wood" });
+ const xr = W / 2 - railT / 2;
+ const rails = [b.place(railTp, [-xr, ry, 0]), b.place(railTp, [xr, ry, 0])];
+ const legT = b.part("Leg", [legS, railTop, legS], { material: "wood" });
+ const xl = W / 2 - railT - legS / 2, zl = L / 2 - 70;
+ const legs = [-1, 1].flatMap((sx) => [-1, 1].map((sz) => b.place(legT, [sx * xl, railTop / 2, sz * zl])));
+ const crossT = b.part("Cross rail", [W - 2 * railT, 60, 30], { material: "wood" });
+ const zc = [-L / 2 + 150, 0, L / 2 - 150];
+ const cross = zc.map((z) => b.place(crossT, [0, ry, z]));
+
+ /* ---------- the slatted seat, and the backrest ---------- */
+ const slats = (len: number): PartPiece[] => {
+ const n = Math.max(4, Math.round(len / 95));
+ const step = len / n;
+ return Array.from({ length: n }, (_, i) => ({ shape: "box", size: [W - 20, slatT, step - 22], pos: [0, 0, -len / 2 + step * (i + 0.5)] }));
+ };
+ const seatLen = L / 2 - zh;
+ const seatC = b.compound("Seat", [...slats(seatLen), ...[-1, 1].map((sx) => ({ shape: "box" as const, size: [30, 20, seatLen - 20] as Vec3, pos: [sx * (W / 2 - railT - 40), -slatT / 2 - 10, 0] as Vec3 }))], { material: "wood" });
+ const seat = b.place(seatC.type, [0, top - slatT / 2 + seatC.mid[1], zh + seatLen / 2]);
+ const backC = b.compound("Backrest", [...slats(backLen), ...[-1, 1].map((sx) => ({ shape: "box" as const, size: [30, 20, backLen - 20] as Vec3, pos: [sx * (W / 2 - railT - 40), -slatT / 2 - 10, 0] as Vec3 }))], { material: "wood" });
+ // raised: it turns about the hinge, its far end up
+ const along: Vec3 = [0, Math.sin(tilt), -Math.cos(tilt)];
+ const bc: Vec3 = [0, top - slatT / 2 + along[1] * (backLen / 2), zh + along[2] * (backLen / 2)];
+ const backrest = b.place(backC.type, bc, [tilt, 0, 0]);
+ // the support: two struts up from the rails to the underside of the backrest, joined across the bottom
+ const tp: Vec3 = [0, top - slatT + along[1] * backLen * 0.62, zh + along[2] * backLen * 0.62];
+ const sh = tp[1] - railTop;
+ const supC = b.compound(
+ "Back support",
+ [
+ ...[-1, 1].map((sx) => ({ shape: "box" as const, size: [24, sh, 24] as Vec3, pos: [sx * (W / 2 - railT - 22), railTop + sh / 2, tp[2]] as Vec3 })),
+ { shape: "cyl", size: [22, W - 2 * railT, 22], pos: [0, railTop + 11, tp[2]], rot: [0, 0, Math.PI / 2] },
+ ],
+ { material: "wood" },
+ );
+ const support = b.place(supC.type, supC.mid);
+
+ /* ---------- steps ---------- */
+ b.step(
+ {
+ title: "Bolt a leg to each end of the side rails",
+ detail: "The legs go on the inside of the rails. Two bolts each, hand tight for now.",
+ tools: ["allen"],
+ kind: "bolts",
+ warnings: ["loose"],
+ },
+ () => {
+ b.stagger(0.25);
+ rails.forEach((r, i) => b.add(r, [(i === 0 ? -1 : 1) * 300, 0, 0]));
+ b.then(0.1);
+ b.stagger(0.18);
+ legs.forEach((l) => b.add(l, [0, -200, 0]));
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ legs.forEach((l, i) => {
+ const sx = i < 2 ? -1 : 1;
+ const z = b.partItem(l).final.pos[2];
+ for (const dz of [-12, 12]) bolts.push({ on: rails[i < 2 ? 0 : 1], at: [sx * (W / 2), ry, z + dz], dir: [-sx, 0, 0], mate: l });
+ });
+ b.fits(HW.boltL, bolts, 0.06);
+ },
+ );
+ b.step(
+ {
+ title: "Join the sides with the cross rails",
+ detail: "Bolt them in, stand it on its legs, then tighten every bolt.",
+ tools: ["allen"],
+ kind: "bolts",
+ },
+ () => {
+ b.stagger(0.25);
+ cross.forEach((c) => b.add(c, [0, 260, 0]));
+ b.then(0.1);
+ const bolts: FitOpts[] = [];
+ for (const z of zc) for (const sx of [-1, 1]) bolts.push({ on: rails[sx < 0 ? 0 : 1], at: [sx * (W / 2), ry, z], dir: [-sx, 0, 0], mate: cross[zc.indexOf(z)] });
+ b.fits(HW.boltL, bolts, 0.06);
+ },
+ );
+ b.step(
+ {
+ title: "Screw the seat onto the rails",
+ detail: "Its slats run across, from the backrest end to the foot end.",
+ tools: ["screwdriver"],
+ kind: "screws",
+ },
+ () => {
+ b.add(seat, [0, 300, 0]);
+ b.then(0.1);
+ const sc: FitOpts[] = [];
+ for (const z of [zh + 120, zh + seatLen / 2, L / 2 - 120]) for (const sx of [-1, 1]) sc.push({ on: seat, at: [sx * (W / 2 - railT / 2), top, z], dir: [0, -1, 0], hole: false });
+ b.fits(HW.screwM, sc, 0.08);
+ },
+ );
+ b.step(
+ {
+ title: "Bolt on the backrest",
+ detail: "One bolt each side, at the end of the seat. It should tip up and down freely.",
+ tools: ["allen"],
+ kind: "bolts",
+ },
+ () => {
+ b.add(backrest, [0, 260, -300]);
+ b.then(0.1);
+ b.fits(HW.boltS, [-1, 1].map((sx) => ({ on: rails[sx < 0 ? 0 : 1], at: [sx * (W / 2), ry, zh] as Vec3, dir: [-sx, 0, 0] as Vec3, mate: backrest })), 0.15);
+ },
+ );
+ b.step(
+ {
+ title: "Prop the backrest up on its support",
+ detail: "Lift the backrest and set the support in the notch you like. The lower the notch, the further it leans back.",
+ kind: "general",
+ },
+ () => b.add(support, [0, 0, 300]),
+ );
+}
diff --git a/src/lib/plan/seat.ts b/src/lib/plan/seat.ts
index 94ab0af..de79548 100644
--- a/src/lib/plan/seat.ts
+++ b/src/lib/plan/seat.ts
@@ -3,6 +3,7 @@ import { HW, PlanBuilder, type FitOpts } from "./builder";
import { clamp, rotate } from "./math";
import { buildOffice } from "./office";
import { buildHighchair } from "./highchair";
+import { buildLounger } from "./lounger";
export function defaultsSeat(s: ProductSpec): SeatParams {
const p = s.seat ?? {};
@@ -21,6 +22,7 @@ export function defaultsSeat(s: ProductSpec): SeatParams {
export function buildSeat(b: PlanBuilder, s: ProductSpec) {
if (s.seat?.kind === "office") return buildOffice(b, s);
if (s.seat?.kind === "highchair") return buildHighchair(b, s);
+ if (s.seat?.kind === "lounger") return buildLounger(b, s);
const p = defaultsSeat(s);
if (p.kind === "chair") return chair(b, s, p);
return stool(b, s, p);
diff --git a/src/lib/products.ts b/src/lib/products.ts
index 39228ea..9f4de41 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -64,7 +64,9 @@ export type Kind =
// the last hard shapes: corners
| "cornercab"
| "cornerrobe"
- | "usofa";
+ | "usofa"
+ // the last chairs
+ | "lounger";
export type X = {
rows?: number;
@@ -284,7 +286,7 @@ const MIN: Record<Kind, number> = {
cube: 40, bookcase: 50, open: 40, chest: 90, nightstand: 40, desk: 25, coffee: 20, side: 15, dining: 40,
bed: 100, wardrobe: 120, cabinet: 60, sideboard: 80, tv: 60, shoe: 45, chair: 25, stool: 12, bench: 20, sofa: 40, armchair: 30,
wallshelf: 25, wallcab: 40, kitchen: 50, trolley: 25, bar: 35, console: 30, kidstable: 15, kidschair: 20,
- office: 20, chaise: 55, corner: 70, cot: 35, bunk: 90, loft: 75, dropleaf: 40, daybed: 60, mixed: 50, sliding: 110, slidecab: 60, bookrow: 120, cabrow: 120, section: 25, gateleg: 50, washstand: 35, sinkcab: 45, appliance: 50, shoerack: 25, clothesrack: 20, changing: 50, divider: 20, backbench: 35, junior: 25, lounge: 30, highchair: 15, cornercab: 45, cornerrobe: 150, usofa: 110,
+ office: 20, chaise: 55, corner: 70, cot: 35, bunk: 90, loft: 75, dropleaf: 40, daybed: 60, mixed: 50, sliding: 110, slidecab: 60, bookrow: 120, cabrow: 120, section: 25, gateleg: 50, washstand: 35, sinkcab: 45, appliance: 50, shoerack: 25, clothesrack: 20, changing: 50, divider: 20, backbench: 35, junior: 25, lounge: 30, highchair: 15, cornercab: 45, cornerrobe: 150, usofa: 110, lounger: 35,
};
const CATEGORY: Record<Kind, string> = {
@@ -293,7 +295,7 @@ const CATEGORY: Record<Kind, string> = {
cabinet: "Cabinet", sideboard: "Sideboard", tv: "TV bench", shoe: "Shoe cabinet", chair: "Chair", stool: "Stool",
bench: "Bench", sofa: "Sofa", armchair: "Armchair", wallshelf: "Wall shelf", wallcab: "Wall cabinet", kitchen: "Kitchen cabinet",
trolley: "Trolley", bar: "Bar table", console: "Console table", kidstable: "Children's table", kidschair: "Children's chair",
- office: "Office chair", chaise: "Sofa with chaise longue", corner: "Corner sofa", cot: "Cot", bunk: "Bunk bed", loft: "Loft bed", dropleaf: "Drop-leaf table", daybed: "Day-bed", mixed: "Cabinet with doors and drawers", sliding: "Wardrobe with sliding doors", slidecab: "Cabinet with sliding doors", bookrow: "Bookcase combination", cabrow: "Storage combination", section: "Sofa section", gateleg: "Gateleg table", washstand: "Wash-stand", sinkcab: "Sink cabinet", appliance: "Appliance cabinet", shoerack: "Shoe rack", clothesrack: "Clothes rack", changing: "Changing table", divider: "Room divider", backbench: "Bench with backrest", junior: "Junior chair", lounge: "Lounge chair", highchair: "Highchair", cornercab: "Corner base cabinet", cornerrobe: "Corner wardrobe", usofa: "U-shaped sofa",
+ office: "Office chair", chaise: "Sofa with chaise longue", corner: "Corner sofa", cot: "Cot", bunk: "Bunk bed", loft: "Loft bed", dropleaf: "Drop-leaf table", daybed: "Day-bed", mixed: "Cabinet with doors and drawers", sliding: "Wardrobe with sliding doors", slidecab: "Cabinet with sliding doors", bookrow: "Bookcase combination", cabrow: "Storage combination", section: "Sofa section", gateleg: "Gateleg table", washstand: "Wash-stand", sinkcab: "Sink cabinet", appliance: "Appliance cabinet", shoerack: "Shoe rack", clothesrack: "Clothes rack", changing: "Changing table", divider: "Room divider", backbench: "Bench with backrest", junior: "Junior chair", lounge: "Lounge chair", highchair: "Highchair", cornercab: "Corner base cabinet", cornerrobe: "Corner wardrobe", usofa: "U-shaped sofa", lounger: "Sun lounger",
};
export const KIND_ARCH: Record<Kind, Archetype> = {
@@ -301,7 +303,7 @@ export const KIND_ARCH: Record<Kind, Archetype> = {
side: "table", dining: "table", bed: "bed", wardrobe: "cabinet", cabinet: "cabinet", sideboard: "cabinet", tv: "cabinet",
shoe: "cabinet", chair: "seat", stool: "seat", bench: "seat", sofa: "sofa", armchair: "sofa", wallshelf: "shelf", wallcab: "cabinet",
kitchen: "cabinet", trolley: "table", bar: "table", console: "table", kidstable: "table", kidschair: "seat",
- office: "seat", chaise: "sofa", corner: "sofa", cot: "bed", bunk: "bed", loft: "bed", dropleaf: "table", daybed: "bed", mixed: "cabinet", sliding: "cabinet", slidecab: "cabinet", bookrow: "shelf", cabrow: "cabinet", section: "sofa", gateleg: "table", washstand: "cabinet", sinkcab: "cabinet", appliance: "cabinet", shoerack: "shelf", clothesrack: "shelf", changing: "drawers", divider: "shelf", backbench: "seat", junior: "seat", lounge: "seat", highchair: "seat", cornercab: "cabinet", cornerrobe: "cabinet", usofa: "sofa",
+ office: "seat", chaise: "sofa", corner: "sofa", cot: "bed", bunk: "bed", loft: "bed", dropleaf: "table", daybed: "bed", mixed: "cabinet", sliding: "cabinet", slidecab: "cabinet", bookrow: "shelf", cabrow: "cabinet", section: "sofa", gateleg: "table", washstand: "cabinet", sinkcab: "cabinet", appliance: "cabinet", shoerack: "shelf", clothesrack: "shelf", changing: "drawers", divider: "shelf", backbench: "seat", junior: "seat", lounge: "seat", highchair: "seat", cornercab: "cabinet", cornerrobe: "cabinet", usofa: "sofa", lounger: "seat",
};
const round = (x: X) => (x.round ? { round: true } : {});
@@ -409,6 +411,9 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
case "highchair":
// x.shelf false: no tray in the box, only the safety belt
return { ...base, difficulty: 1, people: 1, seat: { kind: "highchair", seat: "square", seatH: x.seatH ?? 55, backH: h, ...(x.shelf === false ? { tray: false } : {}) } };
+ case "lounger":
+ // a sun lounger lies along its depth; size.h is the height with the backrest up
+ return { ...base, difficulty: 2, people: 1, seat: { kind: "lounger", seat: "square", seatH: x.seatH ?? 33, backH: h } };
case "lounge":
// a low armchair on a wooden frame, built like a chair with armrests
return { ...base, difficulty: 2, people: 1, seat: { kind: "chair", seat: "square", seatH: x.seatH ?? 38, backH: h, arms: true } };
@@ -635,5 +640,5 @@ export const KIND_DEFAULT_SIZE: Record<Kind, [number, number, number]> = {
sideboard: [140, 85, 45], tv: [150, 50, 42], shoe: [60, 100, 28], chair: [44, 88, 50], stool: [35, 45, 35], bench: [100, 45, 38],
sofa: [210, 85, 92], armchair: [75, 90, 80], wallshelf: [60, 60, 22], wallcab: [60, 60, 35], kitchen: [60, 80, 60], trolley: [50, 80, 40],
bar: [120, 105, 60], console: [100, 79, 35], kidstable: [77, 48, 55], kidschair: [34, 60, 34],
- office: [64, 105, 64], chaise: [226, 85, 160], corner: [233, 85, 171], cot: [130, 84, 68], bunk: [211, 160, 100], loft: [211, 195, 100], dropleaf: [134, 75, 80], daybed: [207, 83, 91], mixed: [80, 120, 40], sliding: [118, 200, 60], slidecab: [80, 110, 45], bookrow: [160, 202, 28], cabrow: [240, 48, 42], section: [192, 83, 92], gateleg: [151, 75, 90], washstand: [60, 83, 47], sinkcab: [60, 80, 60], appliance: [60, 200, 60], shoerack: [80, 40, 32], clothesrack: [100, 160, 46], changing: [80, 100, 55], divider: [150, 170, 25], backbench: [120, 86, 60], junior: [43, 91, 52], lounge: [72, 88, 80], highchair: [58, 90, 62], cornercab: [88, 80, 88], cornerrobe: [161, 201, 111], usofa: [306, 83, 241],
+ office: [64, 105, 64], chaise: [226, 85, 160], corner: [233, 85, 171], cot: [130, 84, 68], bunk: [211, 160, 100], loft: [211, 195, 100], dropleaf: [134, 75, 80], daybed: [207, 83, 91], mixed: [80, 120, 40], sliding: [118, 200, 60], slidecab: [80, 110, 45], bookrow: [160, 202, 28], cabrow: [240, 48, 42], section: [192, 83, 92], gateleg: [151, 75, 90], washstand: [60, 83, 47], sinkcab: [60, 80, 60], appliance: [60, 200, 60], shoerack: [80, 40, 32], clothesrack: [100, 160, 46], changing: [80, 100, 55], divider: [150, 170, 25], backbench: [120, 86, 60], junior: [43, 91, 52], lounge: [72, 88, 80], highchair: [58, 90, 62], cornercab: [88, 80, 88], cornerrobe: [161, 201, 111], usofa: [306, 83, 241], lounger: [66, 87, 195],
};
diff --git a/src/lib/search.ts b/src/lib/search.ts
index 32fbfba..47c9a6e 100644
--- a/src/lib/search.ts
+++ b/src/lib/search.ts
@@ -61,6 +61,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
["usofa", ["u shaped sofa", "u shaped couch", "u shaped sectional", "u sofa", "u couch", "horseshoe sofa"]],
["corner", ["corner sofa", "corner couch", "sectional", "l shaped sofa"]],
["sofa", ["sofa", "couch", "loveseat"]],
+ ["lounger", ["sun lounger", "sunlounger", "sun bed", "sunbed", "sun lounger chair", "pool lounger", "beach lounger", "garden lounger", "patio lounger"]],
["lounge", ["lounge chair", "reclining chair", "garden chair", "patio chair", "deck chair", "adirondack chair"]],
["armchair", ["armchair", "wing chair", "recliner"]],
["highchair", ["highchair", "high chair", "baby chair", "feeding chair"]],
@@ -73,7 +74,7 @@ const CATEGORY_WORDS: [Kind, string[]][] = [
];
const KIND_WORDS = new Map(CATEGORY_WORDS);
// rows, sections, and kinds drawn later than a family's other pieces, which only come first when asked for
-const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa"]);
+const LESSER = new Set<Kind>(["bookrow", "cabrow", "section", "sinkcab", "appliance", "washstand", "shoerack", "clothesrack", "changing", "divider", "backbench", "junior", "lounge", "highchair", "cornercab", "cornerrobe", "usofa", "lounger"]);
export function kindOf(q: string): Kind | null {
const f = " " + fold(q) + " ";
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 0420e68..a5e604d 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -108,7 +108,7 @@ export interface FitParams {
}
export interface SeatParams {
- kind: "stool" | "chair" | "bench" | "office" | "highchair";
+ kind: "stool" | "chair" | "bench" | "office" | "highchair" | "lounger";
seat: "round" | "square";
seatH: number; // cm
backH: number; // cm (chair total height)