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 corner sections sold alone

Youssef4dc9a5f2bf27
diff --git a/scripts/ikea/classify.ts b/scripts/ikea/classify.ts
index ba6b20a..9378adf 100644
--- a/scripts/ikea/classify.ts
+++ b/scripts/ikea/classify.ts
@@ -270,6 +270,8 @@ const RULES: Rule[] = [
}],
// a chaise longue sold alone as a section of a modular sofa: a one-seat section as long as a chaise
[/^(chaise longue section|chaise longue module(?:, (?:left|right))?|chaise longue, add-on unit|modular chaise longue)$/, () => ({ kind: "section", x: { seats: 1, chaise: "right" } })],
+ // a corner section sold alone as a piece of a modular sofa: a square seat with a backrest along two sides
+ [/^(corner section|corner section with cushion|corner module)$/, () => ({ kind: "section", x: { seats: 1, corner: "left" } })],
// corner wardrobes: frames along both walls around an add-on corner unit, with doors when a door's name comes with them
[/^corner wardrobe$/, (_m, c) => ({ kind: "cornerrobe", x: c.multi ? {} : { doors: 0 } })],
// the add-on corner unit sold on its own: a cabinet of shelves
@@ -601,6 +603,8 @@ export function classify(f: Fact, hints: Hints): Verdict {
d = Math.min(175, Math.max(140, d + 68));
delete x.chaise;
}
+ // a corner section is as wide as the family's seats are deep
+ if (x.corner) w = d;
} else if (kind === "cornerrobe") {
// IKEA gives the two legs and the height: "211/161x201 cm"
const legs = f.size.replace(/\s+/g, "").match(/^(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)x(\d+(?:\.\d+)?)cm$/);
diff --git a/scripts/ikea/slugs.json b/scripts/ikea/slugs.json
index 5531c13..d3bb75a 100644
--- a/scripts/ikea/slugs.json
+++ b/scripts/ikea/slugs.json
@@ -472,6 +472,7 @@
"JUTHOLMEN|2-seat modular sofa, outdoor, 146 × 73 cm": "jutholmen-2-seat-modular-sofa-outdoor-146-x-73",
"JUTHOLMEN|3-seat modular sofa, outdoor": "jutholmen-3-seat-modular-sofa-outdoor",
"JUTHOLMEN|3-seat modular sofa, outdoor, 210 × 73 cm": "jutholmen-3-seat-modular-sofa-outdoor-210-x-73",
+ "JUTHOLMEN|Corner section, outdoor": "jutholmen-corner-section-outdoor",
"JUTHOLMEN|Easy chair, outdoor, 65 × 73 × 71 cm": "jutholmen-easy-chair-outdoor-65-x-73-x-71",
"JUTHOLMEN|Easy chair, outdoor, 65 × 73 × 83 cm": "jutholmen-easy-chair-outdoor-65-x-73-x-83",
"JUTHOLMEN|Modular corner sofa 3-seat, outdoor": "jutholmen-modular-corner-sofa-3-seat-outdoor",
@@ -511,6 +512,7 @@
"KIVIK|3-seat sofa with chaise longue": "kivik-3-seat-sofa-chaise-longue",
"KIVIK|4-seat sofa": "kivik-4-seat-sofa",
"KIVIK|4-seat sofa with chaise longue": "kivik-4-seat-sofa-chaise-longue",
+ "KIVIK|Corner section": "kivik-corner-section",
"KIVIK|Corner sofa, 4-seat": "kivik-corner-sofa-4-seat",
"KIVIK|Corner sofa, 5-seat": "kivik-corner-sofa-5-seat",
"KIVIK|Corner sofa, 5-seat w chaise longue": "kivik-corner-sofa-5-seat-w-chaise-longue",
@@ -1073,6 +1075,8 @@
"SEGERÖN|2-seat sofa, outdoor": "segeron-2-seat-sofa-outdoor",
"SEGERÖN|Chair with armrests, outdoor": "segeron-chair-armrests-outdoor",
"SEGERÖN|Coffee table, outdoor, 73 × 73 cm": "segeron-coffee-table-outdoor-73-x-73",
+ "SEGERÖN|Corner section with cushion": "segeron-corner-section-cushion",
+ "SEGERÖN|Corner section, outdoor": "segeron-corner-section-outdoor",
"SEGERÖN|Corner sofa, 3-seat": "segeron-corner-sofa-3-seat",
"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",
@@ -1142,6 +1146,7 @@
"SÖDERHAMN|3-seat section": "soderhamn-3-seat-section",
"SÖDERHAMN|4-seat sofa with chaise longue": "soderhamn-4-seat-sofa-chaise-longue",
"SÖDERHAMN|4-seat sofa-bed": "soderhamn-4-seat-sofa-bed",
+ "SÖDERHAMN|Corner section": "soderhamn-corner-section",
"SÖDERHAMN|Corner sofa-bed, 6-seat": "soderhamn-corner-sofa-bed-6-seat",
"SÖDERHAMN|Corner sofa, 4-seat": "soderhamn-corner-sofa-4-seat",
"SOLUPPGÅNG|Stool, outdoor, 43 × 40 cm": "soluppgang-stool-outdoor-43-x-40",
@@ -1329,6 +1334,7 @@
"ULVEVÄR|Chair with armrests, outdoor": "ulvevar-chair-armrests-outdoor",
"UPPÅKRA|3-seat modular sofa": "uppakra-3-seat-modular-sofa",
"UPPÅKRA|Chaise longue module": "uppakra-chaise-longue-module",
+ "UPPÅKRA|Corner module": "uppakra-corner-module",
"UPPÅKRA|Modular corner sofa, 3-seat": "uppakra-modular-corner-sofa-3-seat",
"UPPÅKRA|Modular corner sofa, 6 seat": "uppakra-modular-corner-sofa-6-seat",
"URBAN|Junior chair": "urban-junior-chair",
@@ -1410,6 +1416,7 @@
"VIMLE|4-seat sofa with chaise longue": "vimle-4-seat-sofa-chaise-longue",
"VIMLE|Armchair": "vimle-armchair",
"VIMLE|Chaise longue section": "vimle-chaise-longue-section",
+ "VIMLE|Corner section": "vimle-corner-section",
"VIMLE|Corner sofa, 3-seat": "vimle-corner-sofa-3-seat",
"VIMLE|Corner sofa, 4-seat": "vimle-corner-sofa-4-seat",
"VIMLE|Corner sofa, 5-seat": "vimle-corner-sofa-5-seat",
diff --git a/src/data/ikea-items.ts b/src/data/ikea-items.ts
index 2ba4480..4a2b080 100644
--- a/src/data/ikea-items.ts
+++ b/src/data/ikea-items.ts
@@ -516,6 +516,7 @@ jutholmen-2-seat-modular-sofa-outdoor|69579852
jutholmen-2-seat-modular-sofa-outdoor-146-x-73|49579848
jutholmen-3-seat-modular-sofa-outdoor|79579856
jutholmen-3-seat-modular-sofa-outdoor-210-x-73|99579860
+jutholmen-corner-section-outdoor|80469116
jutholmen-easy-chair-outdoor-65-x-73-x-71|39579839
jutholmen-easy-chair-outdoor-65-x-73-x-83|39579844
jutholmen-modular-corner-sofa-3-seat-outdoor|19579835 09579831
@@ -561,6 +562,7 @@ kivik-3-seat-sofa|69440596 79443052 59482836 79482835 89500476 29500479 69500482
kivik-3-seat-sofa-chaise-longue|59440587 79500486 69443057 49482846 69482845 39500493 29500484
kivik-4-seat-sofa|19443192
kivik-4-seat-sofa-chaise-longue|99494390 69440582 69443062 69500496 89500495 49494383 39500501
+kivik-corner-section|49440494 89443037 99494371 59500454 59500449 29500455 09500456 70519503
kivik-corner-sofa-4-seat|89440473 99482858 49443015 59500411 39500412 99500414 19443173
kivik-corner-sofa-5-seat|99440477 69443019 49482865 89500419 29500422 09500418 89443179 49443176
kivik-corner-sofa-5-seat-w-chaise-longue|69482874 19440481 89443023 39500426 19500427
@@ -1150,6 +1152,8 @@ sandsberg-table-110-x-67|29420393 59420400
segeron-2-seat-sofa-outdoor|29584860 29584855
segeron-chair-armrests-outdoor|29500813 89500805 50510810 10514754
segeron-coffee-table-outdoor-73-x-73|40510797
+segeron-corner-section-cushion|59584726
+segeron-corner-section-outdoor|70510809
segeron-corner-sofa-3-seat|89584621
segeron-table-outdoor-91-x-147|10510812 90510813
segrare-desk-sit-stand-110-x-60|40534703
@@ -1221,6 +1225,7 @@ soderhamn-3-seat-section|29449645 29305618 09621608 09500531 69621605 39621602 1
soderhamn-3-seat-sofa|39621635 09621632 69621629 79621638 09305704 29449693 39305694 19449698 59452108 69622110 39622102 29622107 09622113 19618672 49580069 99580062 39621386 79621389 19621392
soderhamn-4-seat-sofa-bed|89616448 69621375 49621381 49616247 39621372 29618676 69618679 69621361 69616270 39621367 09621364 09616428
soderhamn-4-seat-sofa-chaise-longue|69449709 79621676 59621682 19621783 19621679
+soderhamn-corner-section|19305628 99449680 39452091 49449606 09500574 69621728 49621734
soderhamn-corner-sofa-4-seat|09449665 79305847 99622038 79622044 39622041 09622047
soderhamn-corner-sofa-bed-6-seat|59616275 89616453 69621403 29621400 09621397 09618682
soluppgang-stool-outdoor-43-x-40|70621303
@@ -1417,6 +1422,7 @@ ulriksberg-armchair|90434310
ulvevar-chair-armrests-outdoor|00608833
uppakra-3-seat-modular-sofa|99620341 49620353 79620337 69620347 59620324 39620344 79620318 09620246 49620249 79620064 79620059 69620069 89620252 19620255 19619940 99619955 99619922 59619943 39619958 79619937 69619928 89619913 39619897 89620313 79619904 79619876 69620314 59619882 99619856 99619842 99619837 79619862 69619867 69619853 69619848 89619970 79619961 69619985 49619991 49619967 39619982 19619964
uppakra-chaise-longue-module|39620457 89620474 89620469 79620460 69620489 69620451 59620480 89620501 79620530 79620498 69620516 59620507 39620513 39620495
+uppakra-corner-module|49620796 89620756 79620790 79620771 69620781 69620762 39620787
uppakra-modular-corner-sofa-3-seat|99620553 89620558 79620573 69620564 49620579 29621358 29620556
uppakra-modular-corner-sofa-6-seat|99620628 79620634 49620616 49620602 39620607 29620622 19620613 99620690 89620704 89620695 59620710 59620687 29620716 29620684 99620647 79620667 69620658 69620644 49620678 49620664 39620650
urban-junior-chair|00165213
@@ -1499,6 +1505,7 @@ vimle-4-seat-sofa|99635267 89633749 69635264 59635293 39635270 19635290 09633753
vimle-4-seat-sofa-chaise-longue|39399485 79399488 89401768 49401765 79503116
vimle-armchair|59502919 39477181 79501264 49477185 19501605 19476842 39477162 59477161 89502908 99501263 49501604
vimle-chaise-longue-section|79631802 79392571 59392567 89502946 89501292 89631793 89631788 80465378
+vimle-corner-section|99392546 69392543 59392553 19501295 89633688 89631868 69631831 00465382
vimle-corner-sofa-3-seat|59306758
vimle-corner-sofa-4-seat|09635342 69635339 09635337 89635362 19635365 29399481 89399478 19401795 49501270 09401786 49306730 09306280 39306721
vimle-corner-sofa-5-seat|79399577 49399668 89399586 59399583 59401802 69401811 29306750 89306766
diff --git a/src/data/ikea-rows.ts b/src/data/ikea-rows.ts
index eeb58f6..842c4ba 100644
--- a/src/data/ikea-rows.ts
+++ b/src/data/ikea-rows.ts
@@ -472,6 +472,7 @@ JUTEBODA|stool|Stool|35|45|35
JUTHOLMEN|armchair|Easy chair, outdoor, 65 × 73 × 71 cm|65|71|73||outdoor garden
JUTHOLMEN|armchair|Easy chair, outdoor, 65 × 73 × 83 cm|65|83|73||outdoor garden
JUTHOLMEN|corner|Modular corner sofa 3-seat, outdoor|173|85|173|seats=3,arms=wide,corner=left,sd=92|outdoor garden
+JUTHOLMEN|section|Corner section, outdoor|92|83|92|seats=1,corner=left|outdoor garden
JUTHOLMEN|sofa|2-seat modular sofa, outdoor, 146 × 73 cm|146|85|73|seats=2|outdoor garden
JUTHOLMEN|sofa|2-seat modular sofa, outdoor|170|85|92|seats=2|outdoor garden
JUTHOLMEN|sofa|3-seat modular sofa, outdoor, 210 × 73 cm|210|85|73|seats=3|outdoor garden
@@ -514,6 +515,7 @@ KIVIK|corner|Corner sofa, 4-seat|241|83|177|seats=4,arms=wide,corner=left,sd=95
KIVIK|corner|Corner sofa, 5-seat w chaise longue|241|83|224|seats=5,arms=wide,corner=left,open=1,sd=95
KIVIK|corner|Corner sofa, 6-seat|301|83|238|seats=6,arms=wide,corner=left,sd=95
KIVIK|corner|Corner sofa, 6-seat w chaise longue|306|83|224|seats=6,arms=wide,corner=left,open=1,sd=95
+KIVIK|section|Corner section|95|83|95|seats=1,corner=left
KIVIK|sofa|1-seat sofa-bed|110|85|92|seats=1
KIVIK|sofa|2-seat sofa|170|85|92|seats=2
KIVIK|sofa|4-seat sofa|290|85|92|seats=4
@@ -1075,6 +1077,8 @@ 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|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
SEGERÖN|sofa|2-seat sofa, outdoor|170|85|92|seats=2|outdoor garden
SEGRARE|desk|Desk sit/stand, 110 × 60 cm|110|74|60
SKÅLBODA|armchair|Armchair|75|90|80
@@ -1142,6 +1146,7 @@ SÖDERHAMN|chaise|4-seat sofa with chaise longue|259|69|167|seats=4,arms=slim,ch
SÖDERHAMN|corner|Corner sofa, 4-seat|228|69|168|seats=4,arms=slim,corner=left,sd=99
SÖDERHAMN|corner|Corner sofa-bed, 6-seat|289|69|228|seats=6,arms=slim,corner=left,sd=99
SÖDERHAMN|section|1-seat section|61|69|99|seats=1
+SÖDERHAMN|section|Corner section|99|69|99|seats=1,corner=left
SÖDERHAMN|section|3-seat section|182|69|99|seats=3
SÖDERHAMN|sofa|2-seat sofa|170|85|92|seats=2,arms=slim
SÖDERHAMN|sofa|4-seat sofa-bed|290|85|92|seats=4,arms=slim
@@ -1331,6 +1336,7 @@ ULVEVÄR|chair|Chair with armrests, outdoor|44|88|50|arms=slim|outdoor garden
UPPÅKRA|corner|Modular corner sofa, 3-seat|173|85|173|seats=3,arms=wide,corner=left,sd=92
UPPÅKRA|corner|Modular corner sofa, 6 seat|301|85|237|seats=6,arms=wide,corner=left,sd=92
UPPÅKRA|section|Chaise longue module|64|83|160|seats=1
+UPPÅKRA|section|Corner module|92|83|92|seats=1,corner=left
UPPÅKRA|sofa|3-seat modular sofa|230|85|92|seats=3
URBAN|junior|Junior chair|43|91|52||kids children
UTESPELARE|desk|Gaming desk, 160 × 80 cm|160|74|80
@@ -1411,6 +1417,7 @@ VIMLE|corner|Corner sofa, 5-seat w chaise longue|253|83|236|seats=5,arms=wide,co
VIMLE|corner|Crnr sofa-bed, 5-seat w chaise lng|253|83|236|seats=5,arms=wide,corner=left,open=1,sd=98
VIMLE|section|1-seat section|69|83|98|seats=1
VIMLE|section|Chaise longue section|69|83|166|seats=1
+VIMLE|section|Corner section|98|83|98|seats=1,corner=left
VIMLE|section|2-seat section|138|83|98|seats=2
VIMLE|section|3-seat section|207|83|98|seats=3
VIMLE|sofa|2-seat sofa|170|85|92|seats=2
diff --git a/src/lib/plan/corner.ts b/src/lib/plan/corner.ts
index 4456bea..81adc3a 100644
--- a/src/lib/plan/corner.ts
+++ b/src/lib/plan/corner.ts
@@ -24,6 +24,7 @@ interface Section {
* and bolted, armrests, backrests, and the cushions last.
*/
export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {
+ if (s.sofa?.corner && (s.sofa.seats ?? 3) <= 1) return cornerSection(b, s);
const p = s.sofa ?? {};
const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
const arms = p.arms ?? "wide";
@@ -349,3 +350,98 @@ export function buildCornerSofa(b: PlanBuilder, s: ProductSpec) {
},
);
}
+
+/**
+ * A corner section sold on its own, a square piece of a modular sofa: a seat frame on legs with a backrest along two sides,
+ * one seat cushion and a back cushion against each side of the backrest.
+ */
+function cornerSection(b: PlanBuilder, s: ProductSpec) {
+ const p = s.sofa ?? {};
+ const W = s.size.w * 10, H = s.size.h * 10, D = s.size.d * 10;
+ const legH = 110, baseTop = 300, seatT = 140;
+ const fh = baseTop - legH;
+ const backT = Math.min(200, D * 0.22);
+ const hb = H - baseTop;
+ const bh = Math.max(240, H - baseTop - seatT - 40);
+ const back = -D / 2;
+ // the backrest runs along the back and down one side, the left unless the sofa says right
+ const sx = p.corner === "right" ? 1 : -1;
+ const X = (x: number) => sx * x;
+ const frame = b.place(b.part("Corner section", [W, fh, D], { material: "soft" }), [0, legH + fh / 2, 0]);
+ const legT = b.part("Leg", [42, legH, 42], { shape: "cyl", material: "wood" });
+ const ix = Math.min(60, W / 4), iz = Math.min(70, D / 4);
+ const legs = [-1, 1].flatMap((a) => [-1, 1].map((c) => b.place(legT, [a * (W / 2 - ix), legH / 2, c * (D / 2 - iz)])));
+ const by = baseTop + hb / 2;
+ const rest = b.compound(
+ "Corner backrest",
+ [
+ { shape: "box", size: [W, hb, backT], pos: [0, by, back + backT / 2] },
+ { shape: "box", size: [backT, hb, D - backT], pos: [X(W / 2 - backT / 2), by, back + backT + (D - backT) / 2] },
+ ],
+ { material: "soft" },
+ );
+ const backrest = b.place(rest.type, rest.mid);
+ const cs = Math.min(W, D) - backT - 16;
+ const seat = b.place(b.part("Seat cushion", [cs, seatT, cs], { material: "soft" }), [X(W / 2 - backT - 8 - cs / 2), baseTop + seatT / 2, back + backT + 8 + cs / 2]);
+ const bcT = b.part("Back cushion", [cs - 6, bh, 170], { material: "soft" });
+ const cushions = [
+ b.place(bcT, [X(W / 2 - backT - 8 - cs / 2), baseTop + seatT + bh / 2 - 6, back + backT + 80], [-0.16, 0, 0]),
+ b.place(b.part("Back cushion", [170, bh, cs - 6], { material: "soft" }), [X(W / 2 - backT - 80), baseTop + seatT + bh / 2 - 6, back + backT + 8 + cs / 2], [0, 0, X(-0.16)]),
+ ];
+
+ b.step(
+ {
+ title: "Lay the section upside down",
+ detail: "Put a blanket or the flattened box under it first.",
+ pose: "-y",
+ kind: "general",
+ warnings: ["floor"],
+ },
+ () => b.add(frame, [0, 220, 0]),
+ );
+ b.step(
+ {
+ title: "Screw in the legs",
+ detail: "Clockwise by hand until each one is snug.",
+ pose: "-y",
+ kind: "legs",
+ warnings: ["hand"],
+ },
+ () => {
+ b.stagger(0.22);
+ legs.forEach((l) => b.add(l, [0, -260, 0], { spin: 2 }));
+ },
+ );
+ b.step({ title: "Turn it over", detail: "Lift it by the frame, never by the legs.", pose: "+y", kind: "flip" }, () => {});
+ b.step(
+ {
+ title: "Attach the backrest",
+ detail: "It runs along two sides. Slide it down behind the seat, then bolt it from the back.",
+ tools: ["allen"],
+ kind: "bolts",
+ },
+ () => {
+ b.add(backrest, [X(260), 120, -300]);
+ b.then(0.1);
+ const boltY = baseTop + 60;
+ const bolts: FitOpts[] = [
+ ...[-0.25, 0.25].map((f) => ({ on: backrest, at: [f * W, boltY, back] as Vec3, dir: [0, 0, 1] as Vec3, mate: frame })),
+ ...[0.35, 0.65].map((f) => ({ on: backrest, at: [X(W / 2), boltY, back + D * f] as Vec3, dir: [X(-1), 0, 0] as Vec3, mate: frame })),
+ ];
+ b.fits(HW.boltL, bolts, 0.1);
+ },
+ );
+ b.step({ title: "Drop in the seat cushion", detail: "The zip faces the back.", kind: "cushions" }, () => b.add(seat, [0, 320, 0]));
+ b.step(
+ {
+ title: "Add the back cushions",
+ detail: "One against each side of the backrest. Plump them up first.",
+ kind: "cushions",
+ },
+ () => {
+ b.stagger(0.2);
+ b.add(cushions[0], [0, 160, 360]);
+ b.add(cushions[1], [X(-360), 160, 0]);
+ },
+ );
+}
diff --git a/src/lib/products.ts b/src/lib/products.ts
index 02c8477..abde922 100644
--- a/src/lib/products.ts
+++ b/src/lib/products.ts
@@ -520,6 +520,8 @@ export function specFor(kind: Kind, name: string, variant: string, w: number, h:
case "section": {
// a straight section of a modular sofa, sold alone: no armrests
const seats = x.seats ?? 1;
+ // x.corner: a corner section, with a backrest along the back and down that side
+ if (x.corner) return { ...base, minutes: x.min ?? MIN.section + 15, people: 1, sofa: { seats: 1, arms: "none", legs: "round", corner: x.corner } };
return { ...base, minutes: x.min ?? MIN.section + 10 * seats, people: seats > 1 ? 2 : 1, sofa: { seats, arms: "none", legs: "round" } };
}
case "washstand":