Merge [274] Umbau je Schicht (mit [271]-Rest zusammengeführt)
Konflikte inhaltlich gelöst, beide Funktionsumfänge bleiben: Sanierung je Schicht ([274]) und Ersatzstücke in Schnitt/Ansicht, Projektionslinien in Umbau-Farbe, 2D/Möbel, Bäume = Umbau-Status, Bäume verdeckt ([271]/[149]). - renovation.rs: resolve_filter (mit [272]-Grau) nimmt die sanierten Wände (build_up::look) auf; beide Testmodule (renovation_tests2, renovation_layers_tests); fehlende Felder `ghost` ergänzt (Stand vorher kompilierte nicht). - Schnitt (query.rs) und Ansicht (elevation): gefiltertes Projekt über Resolved::project bzw. without_hidden + swap_build_ups; `orig` (Quelle der Ersatzstücke) = Projekt mit allem, aber mit den gezeigten Aufbauten. - CutRules::with_renovation: Projektionslinien ([271]) plus Farbe je Schicht ([274]); Projektionslinien sanierter Wände in der Farbe der äussersten Schicht (Resolved::faces). - axo/queries: Bearbeitungsvariante ([272]) und Resolved::project ([274]). - Beispiel :umbau vereint Südwand W1 + Schnitt C mit Möbeln, Bäumen und Ansicht West; CSS beide Blöcke. - TODO/ARCHITEKTUR/RELEASE-NOTES: Sätze beider Seiten, veraltete Offen-Punkte von [271] gestrichen, ID-Zähler 274. Bild doc/review-274/06-nach-merge.png.
This commit is contained in:
37 files changed
+2033
-53
No files matched your search
+162
-4
@@ -3,8 +3,8 @@
|
||||
|
||||
import type { CoreOp } from "../core/ops";
|
||||
import { documentFor } from "../core/document";
|
||||
import { patchItems, setField } from "../core/opsBuild";
|
||||
import type { Project, Renovation, RenovationPhase, RenovationShow, RenovationStatus, Tree, TreeStatus } from "./types";
|
||||
import { addItems, patchItem, patchItems, setField } from "../core/opsBuild";
|
||||
import type { LayerRenovation, Project, Renovation, RenovationPhase, RenovationShow, RenovationSide, RenovationStatus, Tree, TreeStatus, WallType } from "./types";
|
||||
|
||||
/** Eingebaute Umbaufilter (Ids; Namen über `t("renovation.filter.<id>")`). */
|
||||
export const BUILTIN_RENOVATION_FILTERS = ["bestand", "abbruch", "neubau", "umbauplan", "endzustand"] as const;
|
||||
@@ -76,7 +76,7 @@ export function setRenovationOps(project: Project, ids: Iterable<string>, status
|
||||
const old = (e as { renovation?: Renovation }).renovation;
|
||||
const st = status ?? renovationStatus(old);
|
||||
const ph = phase === undefined ? old?.phase : phase ?? undefined;
|
||||
const next = renovationForNew(st, ph);
|
||||
const next = keepRenovated(renovationForNew(st, ph), old);
|
||||
const { renovation: _drop, ...rest } = e as { renovation?: Renovation } & Record<string, unknown>;
|
||||
void _drop;
|
||||
return (next ? { ...rest, renovation: next } : rest) as unknown as typeof e;
|
||||
@@ -88,6 +88,15 @@ export function setRenovationOps(project: Project, ids: Iterable<string>, status
|
||||
return ops;
|
||||
}
|
||||
|
||||
/** [274] Sanierung (`renovated`, `newTypeId`) beim Setzen von Status/Etappe behalten. */
|
||||
function keepRenovated(next: Renovation | undefined, old: Renovation | undefined): Renovation | undefined {
|
||||
if (!old?.renovated && !old?.newTypeId) return next;
|
||||
const r: Renovation = { ...(next ?? { status: "existing" }) };
|
||||
if (old.renovated) r.renovated = true;
|
||||
if (old.newTypeId) r.newTypeId = old.newTypeId;
|
||||
return r;
|
||||
}
|
||||
|
||||
/** Element-Ids der Auswahl, die einen Umbau-Status tragen können. */
|
||||
export function renovatableIds(project: Project, ids: Iterable<string>): string[] {
|
||||
const set = new Set(ids);
|
||||
@@ -141,7 +150,7 @@ export function setPhasesOps(project: Project, phases: readonly RenovationPhase[
|
||||
},
|
||||
(e) => {
|
||||
const r = (e as { renovation?: Renovation }).renovation!;
|
||||
const next = renovationForNew(renovationStatus(r), null);
|
||||
const next = keepRenovated(renovationForNew(renovationStatus(r), null), r);
|
||||
const { renovation: _drop, ...rest } = e as { renovation?: Renovation } & Record<string, unknown>;
|
||||
void _drop;
|
||||
return (next ? { ...rest, renovation: next } : rest) as unknown as typeof e;
|
||||
@@ -250,3 +259,152 @@ export function phaseUsage(project: Project, phaseId: string): number {
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
// ── [274] Sanierung je Schicht: Typ-Paar Bestand → Sanierungstyp (Regeln im Kern `renovation::build_up`) ────────────
|
||||
|
||||
/** Neuer Aufbau einer Wand: keiner, der Sanierungstyp ihres Wandtyps oder ein anderer Wandtyp (Ausnahme). */
|
||||
export type RenovationBuildUp = { kind: "none" } | { kind: "type" } | { kind: "other"; typeId: string };
|
||||
|
||||
/** Neuer Aufbau einer Wand aus ihren Umbau-Angaben. */
|
||||
export function wallBuildUp(r: Renovation | undefined | null): RenovationBuildUp {
|
||||
if (r?.newTypeId) return { kind: "other", typeId: r.newTypeId };
|
||||
return r?.renovated ? { kind: "type" } : { kind: "none" };
|
||||
}
|
||||
|
||||
/** Schlüssel eines Aufbaus für Auswahllisten (`""` keiner, `"type"` wie Typ, sonst die Typ-Id mit Präfix). */
|
||||
export function buildUpKey(b: RenovationBuildUp): string {
|
||||
return b.kind === "none" ? "" : b.kind === "type" ? "type" : `t:${b.typeId}`;
|
||||
}
|
||||
|
||||
/** Gegenstück zu {@link buildUpKey}. */
|
||||
export function parseBuildUpKey(k: string): RenovationBuildUp {
|
||||
if (k === "type") return { kind: "type" };
|
||||
if (k.startsWith("t:") && k.length > 2) return { kind: "other", typeId: k.slice(2) };
|
||||
return { kind: "none" };
|
||||
}
|
||||
|
||||
function withBuildUp(r: Renovation | undefined, b: RenovationBuildUp): Renovation | undefined {
|
||||
const base: Renovation = { ...(r ?? { status: "existing" }) };
|
||||
delete base.renovated;
|
||||
delete base.newTypeId;
|
||||
if (b.kind === "type") base.renovated = true;
|
||||
if (b.kind === "other") {
|
||||
base.renovated = true;
|
||||
base.newTypeId = b.typeId;
|
||||
}
|
||||
const plain = base.status === "existing" && !base.phase && !base.renovated;
|
||||
return plain ? undefined : base;
|
||||
}
|
||||
|
||||
/** Ops: neuer Aufbau für die Wände `ids` (ein Undo-Schritt); Status/Etappe bleiben. */
|
||||
export function setBuildUpOps(project: Project, ids: Iterable<string>, b: RenovationBuildUp): CoreOp[] {
|
||||
const set = new Set(ids);
|
||||
return patchItems(project, "walls", set, (w) => {
|
||||
const next = withBuildUp(w.renovation, b);
|
||||
const { renovation: _drop, ...rest } = w;
|
||||
void _drop;
|
||||
return next ? { ...rest, renovation: next } : rest;
|
||||
});
|
||||
}
|
||||
|
||||
/** Gemeinsamer Aufbau-Schlüssel ({@link buildUpKey}) der Wände `ids`: `"mixed"` bei verschiedenen, `null` ohne Wände. */
|
||||
export function commonBuildUp(project: Project, ids: Iterable<string>): string | null {
|
||||
const set = new Set(ids);
|
||||
let out: string | null = null;
|
||||
for (const w of project.walls) {
|
||||
if (!set.has(w.id)) continue;
|
||||
const k = buildUpKey(wallBuildUp(w.renovation));
|
||||
if (out === null) out = k;
|
||||
else if (out !== k) return "mixed";
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Ops: alle Wände des Bestandstyps `typeId` sanieren (Sanierungstyp des Typs; ein Undo-Schritt). */
|
||||
export function renovateAllOfTypeOps(project: Project, typeId: string): CoreOp[] {
|
||||
const ids = project.walls.filter((w) => w.wallTypeId === typeId && renovationStatus(w.renovation) === "existing").map((w) => w.id);
|
||||
return setBuildUpOps(project, ids, { kind: "type" });
|
||||
}
|
||||
|
||||
/** Nächste freie Wandtyp-Id mit Präfix. */
|
||||
function freeTypeId(project: Project, base: string): string {
|
||||
const used = new Set(project.wallTypes.map((t) => t.id));
|
||||
let i = 1;
|
||||
while (used.has(`${base}-${i}`)) i++;
|
||||
return `${base}-${i}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ops: „Sanierungstyp anlegen …“ — Kopie des Bestandstyps `typeId` als neuer Wandtyp `name` (zum Anpassen der Schichten)
|
||||
* und als Sanierungstyp des Bestandstyps eingetragen. Liefert die Ops und die neue Id.
|
||||
*/
|
||||
export function createRenovationTypeOps(project: Project, typeId: string, name: string): { ops: CoreOp[]; id: string } {
|
||||
const src = project.wallTypes.find((t) => t.id === typeId);
|
||||
if (!src) return { ops: [], id: "" };
|
||||
const id = freeTypeId(project, `${typeId}-saniert`);
|
||||
const copy: WallType = { id, name, layers: src.layers.map((l) => ({ ...l })) };
|
||||
return { ops: [...addItems("wallTypes", [copy]), ...setTypePairOps(project, typeId, { target: id, old: null, new: null })], id };
|
||||
}
|
||||
|
||||
/** Ops: Typ-Paar am Bestandstyp ändern (Sanierungstyp, Bezugsseite, manuelle Zuordnung; `null` entfernt). */
|
||||
export function setTypePairOps(
|
||||
project: Project,
|
||||
typeId: string,
|
||||
patch: { target?: string | null; side?: RenovationSide | null; old?: LayerRenovation[] | null; new?: LayerRenovation[] | null },
|
||||
): CoreOp[] {
|
||||
return patchItem(project, "wallTypes", typeId, (t) => {
|
||||
const next: WallType = { ...t };
|
||||
const put = <K extends keyof WallType>(k: K, v: WallType[K] | null | undefined) => {
|
||||
if (v === undefined) return;
|
||||
if (v === null || (Array.isArray(v) && v.every((x) => x === "auto"))) delete next[k];
|
||||
else next[k] = v;
|
||||
};
|
||||
put("renovationTarget", patch.target);
|
||||
put("renovationSide", patch.side === "inside" ? null : patch.side);
|
||||
put("renovationOld", patch.old);
|
||||
put("renovationNew", patch.new);
|
||||
return next;
|
||||
});
|
||||
}
|
||||
|
||||
/** Schicht eines Typ-Paars (Kern-Abfrage `renovationPair`). */
|
||||
export interface RenovationPairLayer {
|
||||
componentId: string;
|
||||
name: string;
|
||||
color: string;
|
||||
thickness: number;
|
||||
fate: "kept" | "demolish" | "new";
|
||||
}
|
||||
/** Teilstück eines Ergebnis-Streifens. */
|
||||
export interface RenovationStripPiece {
|
||||
thickness: number;
|
||||
kind: "kept" | "demolish" | "new" | "newOverDemolish";
|
||||
fill: string;
|
||||
}
|
||||
export interface RenovationPair {
|
||||
type: string;
|
||||
target: string;
|
||||
side: RenovationSide;
|
||||
old: RenovationPairLayer[];
|
||||
new: RenovationPairLayer[];
|
||||
oldStrip: RenovationStripPiece[];
|
||||
newStrip: RenovationStripPiece[];
|
||||
result: RenovationStripPiece[];
|
||||
walls: number;
|
||||
renovated: number;
|
||||
}
|
||||
|
||||
/** Typ-Paar Bestandstyp → Sanierungstyp (`target` fehlt = eingetragener); `null` ohne gültiges Paar. */
|
||||
export function renovationPair(project: Project, typeId: string, target?: string): RenovationPair | null {
|
||||
return documentFor(project).query<RenovationPair | null>("renovationPair", [], JSON.stringify({ type: typeId, target: target ?? "" }));
|
||||
}
|
||||
|
||||
export interface RenovationPairsInfo {
|
||||
pairs: { type: string; name: string; target: string; targetName: string | null; walls: number; renovated: number }[];
|
||||
renovated: number;
|
||||
}
|
||||
|
||||
/** Alle Typ-Paare mit Zählern (Umbau-Panel „Sanierung“). */
|
||||
export function renovationPairs(project: Project): RenovationPairsInfo {
|
||||
return documentFor(project).query<RenovationPairsInfo>("renovationPairs");
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
// [274] Sanierung je Schicht: Ops (neuer Aufbau je Wand, alle Wände eines Typs, Sanierungstyp anlegen, Typ-Paar),
|
||||
// gemeinsamer Wert bei Mehrfachauswahl, Kern-Abfragen am Umbau-Beispiel (Typ-Paar, Zähler, Grundriss je Filter).
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { applyOps } from "../core/ops";
|
||||
import {
|
||||
buildUpKey,
|
||||
commonBuildUp,
|
||||
createRenovationTypeOps,
|
||||
parseBuildUpKey,
|
||||
renovateAllOfTypeOps,
|
||||
renovationPair,
|
||||
renovationPairs,
|
||||
setBuildUpOps,
|
||||
setPhasesOps,
|
||||
setRenovationOps,
|
||||
setTypePairOps,
|
||||
wallBuildUp,
|
||||
} from "./renovation";
|
||||
import { buildUmbauSampleProject } from "./sampleProjectUmbau";
|
||||
import { generatePlan } from "../plan/generatePlan";
|
||||
import { computeAreaTable } from "../analysis/areaTable";
|
||||
import type { Project } from "./types";
|
||||
|
||||
const ALL = new Set(["20", "21", "30", "31", "40", "60"]);
|
||||
|
||||
function plan(p: Project, filter: string) {
|
||||
const q = { ...p, drawingLevels: p.drawingLevels.map((l) => (l.id === "eg" ? { ...l, renovationFilter: filter } : l)) };
|
||||
return generatePlan(q, "eg", ALL).primitives;
|
||||
}
|
||||
|
||||
describe("[274] Sanierung je Schicht", () => {
|
||||
it("Aufbau-Schlüssel: keiner, wie Typ, anderer Typ", () => {
|
||||
expect(wallBuildUp(undefined)).toEqual({ kind: "none" });
|
||||
expect(wallBuildUp({ status: "existing", renovated: true })).toEqual({ kind: "type" });
|
||||
expect(wallBuildUp({ status: "existing", renovated: true, newTypeId: "x" })).toEqual({ kind: "other", typeId: "x" });
|
||||
for (const k of ["", "type", "t:abc"]) expect(buildUpKey(parseBuildUpKey(k))).toBe(k);
|
||||
expect(parseBuildUpKey("t:")).toEqual({ kind: "none" });
|
||||
});
|
||||
|
||||
it("Neuer Aufbau für mehrere Wände in einem Schritt; Status/Etappe ändern behält die Sanierung", () => {
|
||||
const p = buildUmbauSampleProject();
|
||||
const ops = setBuildUpOps(p, ["W2", "W3"], { kind: "other", typeId: "aw-saniert" });
|
||||
expect(ops).toHaveLength(2);
|
||||
const q = applyOps(p, ops);
|
||||
expect(q.walls.find((w) => w.id === "W2")?.renovation).toEqual({ status: "existing", renovated: true, newTypeId: "aw-saniert" });
|
||||
expect(commonBuildUp(q, ["W2", "W3"])).toBe("t:aw-saniert");
|
||||
expect(commonBuildUp(q, ["W1", "W2"])).toBe("mixed");
|
||||
expect(commonBuildUp(q, ["O1"])).toBeNull();
|
||||
// Status setzen: Sanierung bleibt.
|
||||
const r = applyOps(q, setRenovationOps(q, ["W2"], "existing", "etappe-2"));
|
||||
expect(r.walls.find((w) => w.id === "W2")?.renovation).toEqual({ status: "existing", phase: "etappe-2", renovated: true, newTypeId: "aw-saniert" });
|
||||
// Etappe löschen: Sanierung bleibt.
|
||||
const s = applyOps(p, setPhasesOps(p, [{ id: "etappe-2", name: "Etappe 2" }]));
|
||||
expect(s.walls.find((w) => w.id === "W1")?.renovation).toEqual({ status: "existing", renovated: true });
|
||||
// Keiner: Feld weg (Bestand ohne Etappe).
|
||||
const t = applyOps(q, setBuildUpOps(q, ["W2"], { kind: "none" }));
|
||||
expect(t.walls.find((w) => w.id === "W2")).not.toHaveProperty("renovation");
|
||||
});
|
||||
|
||||
it("Sanierungstyp anlegen, alle Wände vom Typ sanieren, Typ-Paar mit Zuordnung", () => {
|
||||
const p = buildUmbauSampleProject();
|
||||
const { ops, id } = createRenovationTypeOps(p, "aw", "Aussenwand saniert");
|
||||
const q = applyOps(p, ops);
|
||||
expect(q.wallTypes.find((t) => t.id === "aw")?.renovationTarget).toBe(id);
|
||||
expect(q.wallTypes.find((t) => t.id === id)?.layers).toEqual(p.wallTypes.find((t) => t.id === "aw")?.layers);
|
||||
// Alle Bestandswände vom Typ „aw“ (W2, W3, W4 auf EG; W5–W8 auf OG; nicht die neuen W10–W12) in einem Schritt.
|
||||
const r = applyOps(q, renovateAllOfTypeOps(q, "aw"));
|
||||
const renovated = r.walls.filter((w) => w.renovation?.renovated).map((w) => w.id).sort();
|
||||
expect(renovated).toEqual(["W1", "W2", "W3", "W4", "W5", "W6", "W7", "W8"]);
|
||||
// Gleiche Schichten: alles Bestand (nichts abgebrochen, nichts neu).
|
||||
const pr = renovationPair(r, "aw");
|
||||
expect(pr?.old.every((l) => l.fate === "kept")).toBe(true);
|
||||
// Manuelle Zuordnung am Typ-Paar: die Dämmung wird ersetzt.
|
||||
const s = applyOps(r, setTypePairOps(r, "aw", { old: ["auto", "demolish"] }));
|
||||
expect(renovationPair(s, "aw")?.old.map((l) => l.fate)).toEqual(["kept", "demolish", "kept", "kept"]);
|
||||
expect(renovationPair(s, "aw")?.new.map((l) => l.fate)).toEqual(["kept", "new", "kept", "kept"]);
|
||||
// Alles „automatisch“: Feld weg.
|
||||
const u = applyOps(s, setTypePairOps(s, "aw", { old: ["auto", "auto"] }));
|
||||
expect(u.wallTypes.find((t) => t.id === "aw")).not.toHaveProperty("renovationOld");
|
||||
expect(renovationPairs(u).pairs.map((x) => x.type).sort()).toEqual(["aw", "aw-bestand"]);
|
||||
});
|
||||
|
||||
it("Beispiel Umbau: Typ-Paar der Südwand, Zähler, Grundriss und GF je Filter", () => {
|
||||
const p = buildUmbauSampleProject();
|
||||
const pr = renovationPair(p, "aw-bestand");
|
||||
expect(pr?.old.map((l) => l.fate)).toEqual(["demolish", "demolish", "kept"]);
|
||||
expect(pr?.new.map((l) => l.fate)).toEqual(["new", "new", "kept"]);
|
||||
expect(pr?.result.map((q) => q.kind)).toEqual(["new", "new", "newOverDemolish", "newOverDemolish", "kept"]);
|
||||
expect(renovationPairs(p).renovated).toBe(1);
|
||||
// Grundriss: Abbruch gelb, Umbauplan mit gelber gestrichelter Kontur über Rot.
|
||||
const dashedYellow = (prims: ReturnType<typeof plan>) => prims.some((x) => x.kind === "line" && !!x.dash && x.color === "#ffd800");
|
||||
expect(dashedYellow(plan(p, "umbauplan"))).toBe(true);
|
||||
expect(dashedYellow(plan(p, "endzustand"))).toBe(false);
|
||||
// GF im Endzustand: die Südwand ist 10 cm dicker als ohne Sanierung (die Aussenkante rückt nach aussen).
|
||||
const unsaniert = applyOps(p, setBuildUpOps(p, ["W1"], { kind: "none" }));
|
||||
const gf = (q: Project) => computeAreaTable(q, JSON.stringify({ renovation: "endzustand", renovationPhase: "etappe-1" })).total.gf;
|
||||
expect(gf(p) - gf(unsaniert)).toBeGreaterThan(0.25);
|
||||
const gfB = (q: Project) => computeAreaTable(q, "bestand").total.gf;
|
||||
expect(gfB(p)).toBeCloseTo(gfB(unsaniert), 9);
|
||||
});
|
||||
});
|
||||
@@ -8,9 +8,12 @@
|
||||
// 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.
|
||||
// Nur Modellfelder, keine Kern-Befehle: das Modul ist ohne geladenen Kern auswertbar.
|
||||
|
||||
import type { Ceiling, Drawing2D, DrawingLevel, Opening, Project, Renovation, Room, Tree, Wall } from "./types";
|
||||
import type { Ceiling, Drawing2D, DrawingLevel, Opening, Project, Renovation, Room, Tree, Wall, WallType } from "./types";
|
||||
import { sampleProject } from "./sampleProject";
|
||||
|
||||
const E1: Renovation = { status: "new", phase: "etappe-1" };
|
||||
@@ -46,8 +49,35 @@ export function buildUmbauSampleProject(): Project {
|
||||
{ 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 },
|
||||
],
|
||||
},
|
||||
];
|
||||
const walls: Wall[] = base.walls.map((w) => (w.id === "W9" ? { ...w, renovation: D1 } : w));
|
||||
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(
|
||||
@@ -86,6 +116,7 @@ export function buildUmbauSampleProject(): Project {
|
||||
id: "beispiel-umbau",
|
||||
name: "Beispiel Umbau",
|
||||
drawingLevels: levels,
|
||||
wallTypes,
|
||||
walls,
|
||||
openings,
|
||||
ceilings,
|
||||
|
||||
@@ -1981,6 +1981,9 @@ export type LayerFunction =
|
||||
| "cladding"
|
||||
| "air";
|
||||
|
||||
/** [274] Zuordnung einer Schicht im Typ-Paar Bestand → Sanierung (manuell statt automatisch). */
|
||||
export type LayerRenovation = "auto" | "existing" | "demolish" | "new";
|
||||
|
||||
/**
|
||||
* Schichteinzug einer Wandschicht an der Öffnung ([106]): Regel für alle Seiten, je Seite
|
||||
* übersteuerbar. `layer` zählt ab aussen (0 = äusserste Schicht); negativ ab innen (−1 = innerste),
|
||||
@@ -3415,6 +3418,15 @@ export type Renovation = {
|
||||
* Fehlt ⇒ erste Etappe.
|
||||
*/
|
||||
phase?: string;
|
||||
/**
|
||||
* [274] Saniert: die Wand bekommt den Sanierungstyp ihres Wandtyps (`WallType.renovationTarget`) als neuen
|
||||
* Aufbau; der bisherige Aufbau ist der Bestand. Wirkt nur beim Status Bestand; Etappe der Sanierung = `phase`.
|
||||
*/
|
||||
renovated?: boolean;
|
||||
/**
|
||||
* [274] Ausnahme: anderer neuer Aufbau als der Sanierungstyp des Wandtyps (Wandtyp-Id); setzt „saniert“ voraus.
|
||||
*/
|
||||
newTypeId?: string;
|
||||
};
|
||||
|
||||
/** [271] Ein Umbaufilter (wie Archicads „Renovation Filter“): Darstellung je Status. */
|
||||
@@ -3441,6 +3453,11 @@ export type RenovationSettings = {
|
||||
/** [271] Darstellung eines Status im Umbaufilter. */
|
||||
export type RenovationShow = "show" | "hide" | "override";
|
||||
|
||||
/**
|
||||
* [274] Bezugsseite einer Sanierung (bleibt stehen, von ihr her werden die Schichten verglichen).
|
||||
*/
|
||||
export type RenovationSide = "inside" | "outside";
|
||||
|
||||
/**
|
||||
* [271] Umbau-Status eines Bauteils (Archicad „Renovation Status“; SIA 400: Bestand schwarz/grau, Abbruch gelb,
|
||||
* Neu rot).
|
||||
@@ -4751,7 +4768,26 @@ export type Wall = {
|
||||
export type WallReferenceLine = "left" | "center" | "right";
|
||||
|
||||
/** Ein Wandtyp = geordneter Schichtaufbau (außen → innen). */
|
||||
export type WallType = { id: string; name: string; layers: Array<Layer> };
|
||||
export type WallType = {
|
||||
id: string;
|
||||
name: string;
|
||||
layers: Array<Layer>;
|
||||
/**
|
||||
* [274] Sanierungstyp (Wandtyp-Id): neuer Aufbau aller als „saniert“ markierten Wände dieses (Bestands-)Typs.
|
||||
*/
|
||||
renovationTarget?: string;
|
||||
/** [274] Bezugsseite der Sanierung (fehlt ⇒ innen). */
|
||||
renovationSide?: RenovationSide;
|
||||
/**
|
||||
* [274] Manuelle Zuordnung je Schicht dieses Bestandstyps (Bestand/Abbruch, fehlt/„auto“ = automatisch); gilt
|
||||
* für das Paar mit `renovationTarget`.
|
||||
*/
|
||||
renovationOld?: Array<LayerRenovation>;
|
||||
/**
|
||||
* [274] Manuelle Zuordnung je Schicht des Sanierungstyps (Bestand/Neu, fehlt/„auto“ = automatisch).
|
||||
*/
|
||||
renovationNew?: Array<LayerRenovation>;
|
||||
};
|
||||
|
||||
/** Rollladen-/Sonnenschutzkasten über der Öffnung (P0-Minimalfassung). */
|
||||
export type WindowShading = {
|
||||
|
||||
Reference in new issue
Block a user