// [271] „Beispiel Umbau": das Demo-Haus (sampleProject) als Bestand, umgebaut in zwei Etappen — Vorlage für Tests, die // Kurzanleitung (Abschnitt Umbau) und die Prüfbilder (`doc/review-271`). // // Etappe 1 (innen): die Zwischenwand W9 wird abgebrochen, das Nordfenster O2 zugemauert (Öffnung „Abbruch“: im Neubau- // und Endzustand ist die Wand dort zu, mit roter Ausfachung im Umbauplan), in die Westwand W4 kommt ein neues Fenster O3 // (Öffnung „Neu“ in Bestandswand: im Bestand ist die Wand dort zu, im Umbauplan gelbes Abbruch-Stück). // Etappe 2 (Anbau): ein eingeschossiger Anbau im Norden (Wände, Decke, Raum, Fenster) und eine neue Tür in W3. // Möbel (Objekte der Bibliothek) und Bäume tragen den Umbau-Status ebenfalls: ein Sofa bleibt (Bestand), ein Tisch wird // entfernt (Abbruch, Etappe 1), ein neues Sofa kommt in den Anbau (Etappe 2); ein Baum wird gefällt (Bäume: `status` = Umbau-Status), // ein neuer wird gepflanzt. // [274] Sanierung je Schicht: die Südwand W1 ist eine Aussenwand „Beton 20 + Dämmung 10 + Aussenputz“ (Bestandstyp // „aw-bestand“) mit dem Sanierungstyp „aw-saniert“ (Beton bleibt, Dämmung und Putz werden abgebrochen, neue Dämmung 20 + // neuer Putz), saniert in Etappe 1: Kern bleibt an seiner Stelle, die Fassade rückt 10 cm nach aussen. // Ebenso je Schicht saniert (Etappe 1): die Geschossdecke C1 über dem EG (Rohdecke bleibt; Linoleum, Unterlagsboden und // Trittschall werden abgebrochen, neu Parkett + Unterlagsboden + dickerer Trittschall, gleiche Gesamtdicke) und das Dach // RF1 (Sparren und Verkleidung bleiben; Ziegel ab, neu 12 cm Aufsparrendämmung + Ziegel: die Dachhaut hebt sich). Schnitt C // (x = 2) schneidet Wand, Decke und Dach. // Nur Modellfelder, keine Kern-Befehle: das Modul ist ohne geladenen Kern auswertbar. import type { Ceiling, CeilingType, Component, Drawing2D, DrawingLevel, Opening, Project, Renovation, Roof, RoofType, Room, Tree, Wall, WallType } from "./types"; import { sampleProject } from "./sampleProject"; const E1: Renovation = { status: "new", phase: "etappe-1" }; const E2: Renovation = { status: "new", phase: "etappe-2" }; const D1: Renovation = { status: "demolish", phase: "etappe-1" }; const wall = (id: string, x0: number, y0: number, x1: number, y1: number): Wall => ({ id, type: "wall", floorId: "eg", categoryCode: "20", start: { x: x0, y: y0 }, end: { x: x1, y: y1 }, wallTypeId: "aw", height: 2.6, renovation: E2, }); const win = (id: string, hostWallId: string, position: number, width: number, renovation?: Renovation): Opening => ({ id, type: "opening", hostWallId, categoryCode: "21", kind: "window", typeId: "window-standard", position, width, height: 1.2, sillHeight: 0.9, ...(renovation ? { renovation } : {}), }); /** Objekt der Bibliothek ([253]) auf der Möbel-Klasse; ohne `renovation` = Bestand. */ const furniture = (id: string, libId: string, x: number, y: number, renovation?: Renovation, rotation = 0): Drawing2D => ({ id, type: "drawing2d", levelId: "eg", categoryCode: "22", geom: { shape: "libobj", libId, at: { x, y }, rotation }, ...(renovation ? { renovation } : {}), }); const tree = (id: string, x: number, y: number, status: Tree["status"]): Tree => ({ id, type: "tree", floorId: "eg", categoryCode: "13", position: { x, y }, trunkDiameter: 0.3, crownDiameter: 3.2, crownBase: 1.8, height: 6.5, shape: "round", status, foliage: "deciduous", }); /** Das Umbau-Beispiel (frische Kopie bei jedem Aufruf). */ export function buildUmbauSampleProject(): Project { const base = structuredClone(sampleProject); const levels: DrawingLevel[] = [ ...base.drawingLevels, // Schnitt durch den Anbau (Nord–Süd, Blick nach Osten): zeigt Bestand, Abbruch W9 nicht, aber Anbau und neue Tür. { id: "schnitt-b", name: "Schnitt B", kind: "section", visible: true, locked: false, linePoints: [{ x: 1.4, y: -1 }, { x: 1.4, y: 8 }], directionSign: -1 }, // Ansicht West (Blick nach Osten): das neue Fenster O3 in der Bestandswand W4 mit seinem Abbruch-Stück, der Anbau dahinter. { id: "ansicht-west", name: "Ansicht West", kind: "elevation", visible: true, locked: false, linePoints: [{ x: -2, y: 8 }, { x: -2, y: -1 }], directionSign: 1 }, // [274] Schnitt durch die sanierte Südwand W1 (zwischen Tür und Fenster) und den Anbau. { id: "schnitt-c", name: "Schnitt C", kind: "section", visible: true, locked: false, linePoints: [{ x: 2, y: -1 }, { x: 2, y: 8 }], directionSign: -1 }, ]; const walls: Wall[] = base.walls.map((w) => w.id === "W9" ? { ...w, renovation: D1 } : w.id === "W1" ? { ...w, wallTypeId: "aw-bestand", renovation: { status: "existing", phase: "etappe-1", renovated: true } } : w, ); // [274] Typ-Paar Bestand → Sanierung (aussen → innen). const wallTypes: WallType[] = [ ...base.wallTypes, { id: "aw-bestand", name: "Aussenwand Beton 20 + Dämmung 10 (Bestand)", layers: [ { componentId: "render-ext", thickness: 0.02 }, { componentId: "insulation", thickness: 0.1 }, { componentId: "concrete", thickness: 0.2 }, ], renovationTarget: "aw-saniert", }, { id: "aw-saniert", name: "Aussenwand Beton 20 + Dämmung 20 (saniert)", layers: [ { componentId: "render-ext", thickness: 0.02 }, { componentId: "insulation", thickness: 0.2 }, { componentId: "concrete", thickness: 0.2 }, ], }, ]; walls.push(wall("W10", 0, 4, 0, 7), wall("W11", 0, 7, 3, 7), wall("W12", 3, 7, 3, 4)); const openings: Opening[] = (base.openings ?? []).map((o) => (o.id === "O2" ? { ...o, renovation: D1 } : o)); openings.push( win("O3", "W4", 1.5, 1.0, E1), // Neue Tür in der Bestandswand W3 (W3 läuft von x 5 nach x 0: Tür x 1.9–1.0) zum Anbau. { id: "O4", type: "opening", hostWallId: "W3", categoryCode: "21", kind: "door", typeId: "door-standard", position: 3.1, width: 0.9, height: 2.1, sillHeight: 0, swing: "left", hinge: "start", renovation: E2 }, // Fenster des Anbaus: ohne eigenen Status, folgt der neuen Wand. win("O5", "W11", 0.9, 1.2), ); // [274] Decke und Dach je Schicht saniert (Typ-Paare oben → unten bzw. aussen → innen). const components: Component[] = [ ...base.components, { id: "linoleum", name: "Linoleum", color: "#9c8f6e", hatchId: "none", joinPriority: 5 }, { id: "parquet", name: "Parkett", color: "#c49a6c", hatchId: "none", joinPriority: 5 }, { id: "timber", name: "Sparren (Holz)", color: "#c8a26b", hatchId: "diagonal", joinPriority: 40 }, ]; const ceilingTypes: CeilingType[] = [ ...(base.ceilingTypes ?? []), { id: "decke-bestand", name: "Geschossdecke Linoleum (Bestand)", layers: [ { componentId: "linoleum", thickness: 0.005 }, { componentId: "screed", thickness: 0.055 }, { componentId: "insulation", thickness: 0.02 }, { componentId: "concrete", thickness: 0.2 }, ], renovationTarget: "decke-saniert", }, { id: "decke-saniert", name: "Geschossdecke Parkett (saniert)", layers: [ { componentId: "parquet", thickness: 0.01 }, { componentId: "screed", thickness: 0.04 }, { componentId: "insulation", thickness: 0.03 }, { componentId: "concrete", thickness: 0.2 }, ], }, ]; const roofTypes: RoofType[] = [ ...(base.roofTypes ?? []), { id: "dach-bestand", name: "Steildach Sparren (Bestand)", layers: [ { componentId: "roof-tiles", thickness: 0.04 }, { componentId: "timber", thickness: 0.16 }, { componentId: "render-int", thickness: 0.0125 }, ], renovationTarget: "dach-saniert", }, { id: "dach-saniert", name: "Steildach Aufsparrendämmung (saniert)", layers: [ { componentId: "roof-tiles", thickness: 0.04 }, { componentId: "insulation", thickness: 0.12 }, { componentId: "timber", thickness: 0.16 }, { componentId: "render-int", thickness: 0.0125 }, ], }, ]; const R1: Renovation = { status: "existing", phase: "etappe-1", renovated: true }; const roofs: Roof[] = (base.roofs ?? []).map((r) => (r.id === "RF1" ? { ...r, roofTypeId: "dach-bestand", renovation: R1 } : r)); const c1: Ceiling = { ...(base.ceilings ?? [])[0], ceilingTypeId: "decke-bestand", renovation: R1 }; const ceilings: Ceiling[] = [ c1, ...(base.ceilings ?? []).slice(1), { ...c1, ceilingTypeId: (base.ceilings ?? [])[0].ceilingTypeId, id: "C2", outline: [{ x: 0, y: 4 }, { x: 3, y: 4 }, { x: 3, y: 7 }, { x: 0, y: 7 }], renovation: E2 }, ]; const r1 = (base.rooms ?? [])[0]; const h = 0.1725; const rooms: Room[] = [ ...(base.rooms ?? []), { ...r1, id: "R2", name: "Anbau", siaCategory: "HNF", boundary: [{ x: h, y: 4 + h }, { x: 3 - h, y: 4 + h }, { x: 3 - h, y: 7 - h }, { x: h, y: 7 - h }], stampAnchor: { x: 1.5, y: 5.8 }, renovation: E2, }, ]; // Möbel im Westraum und im Anbau, Bäume östlich des Hauses. const drawings2d: Drawing2D[] = [ ...base.drawings2d, furniture("M1", "lib:sofa-2", 0.85, 2.0, undefined, Math.PI / 2), furniture("M2", "lib:tisch-80x140", 1.65, 2.0, D1), furniture("M3", "lib:sofa-2", 1.5, 5.6, E2), ]; const trees: Tree[] = [...(base.trees ?? []), tree("B1", 7.4, 1.2, "remove"), tree("B2", 9.4, 4.6, "new")]; return { ...base, id: "beispiel-umbau", name: "Beispiel Umbau", drawingLevels: levels, wallTypes, components, ceilingTypes, roofTypes, roofs, walls, openings, ceilings, rooms, drawings2d, trees, renovation: { phases: [ { id: "etappe-1", name: "Etappe 1" }, // [275] Etappe 2 (Anbau) mit eigener Farbe: Neues gedämpft blau statt rot, damit die zwei Etappen im Umbauplan // auseinanderzuhalten sind. { id: "etappe-2", name: "Etappe 2", styles: { new: { fill: "#5b84b1", line: "#3e6390" } } }, ], }, }; }