[272] Varianten: Sätze und Varianten wie Archicads Design Options, Kombination je Ansicht im Umbau-Kern-Ort, Panel, Vergleich, Übernehmen
Modell (Rust, gen:types, KNOWN_KEYS): Project.designOptionSets (Sätze mit Varianten und
Hauptvariante), designOption {set, option} an Wand, Öffnung, Decke, Dach, Treppe, Stütze,
Körper, Raum und 2D-Element (samt Bibliotheksobjekt); Kombination designOptions an
DrawingLevel, ViewTemplate, ViewSnapshot und LayoutViewport.
Keine zweite Sichtbarkeitslogik: die Kombination gehört zur renovation::View ([271]);
View::with/for_level lösen sie auf (Hauptvarianten, gespeicherte Wahl, Anfrage
„Dachform=B,…“), View::resolve blendet Elemente anderer Varianten aus wie Ausgeblendetes des
Umbaufilters. Ohne Elemente in Varianten bleibt alles wie vorher (Goldens unverändert).
Wirkt in Grundriss (Ctx.hidden, 2D über on_floor), Schnitt, Ansicht, Axo, 3D (ohne
Teil-Cache), Kennzahlen, Kosten, Baurecht, Raumbuch, IFC/Netz-Exporte, DXF und Blatt/PDF
(Viewport-Kombination mit Titelzusatz).
Kern design_options.rs: Übernehmen, Satz/Variante löschen, Zuweisen, In Variante kopieren
(je ein Undo-Schritt), Zeichen-Variante neuer Elemente (stamp_ops), Vergleich der Kennzahlen
und Kosten je Kombination (+ CSV). Oberfläche: Dock-Panel „Varianten“, Chip in der
Statusleiste (öffnet das Panel, Überlauf „⋯“), Objekt-Info „Variante“, Ressourcen-Tab,
Befehle variante/variantekopieren, Varianten-Vergleich in der Flächenbilanz, Viewport-Wahl
im Blatt, Vorlage „Beispiel Varianten“ (CLI :varianten), CLI --options und designoptions.
Tests: Kern design_options_tests.rs (13: Kombination, Grundriss/Schnitt/Ansicht/3D/Axo/IFC je
Kombination, mit Umbaufilter, Kennzahlen/Kosten, Übernehmen+Undo, Löschen, Zuweisen/Kopieren,
Zeichen-Variante, Viewport, Unsinn), Robustheit, vitest designOptions.test.ts und
designOption.test.ts, e2e designOptions272.spec.ts (2× grün, Port 5195). Bilder
doc/review-272 (CLI-SVG --hatch in Chromium, App). Nur im Linux-Container geprüft, nicht in
der Tauri-App/auf dem Mac (Prüfschritt RELEASE-1.0 13.38). Offen: TODO [272].
This commit is contained in:
73 files changed
+2981
-100
No files matched your search
+32
-2
@@ -21,6 +21,9 @@
|
||||
// --model-view <Name> wählt eine Modelldarstellung (eigene Stufe oder grob/mittel/fein) [173]
|
||||
// --renovation <Filter> Umbaufilter (bestand, abbruch, neubau, umbauplan, endzustand oder eigener)
|
||||
// mit --phase <Etappe> (Name oder id); auch für axo, model3d und kennzahlen [271]
|
||||
// --options "Dachform=B,Fassade=A" Variantenkombination (Satz=Variante, Namen oder ids;
|
||||
// fehlende Sätze: Hauptvariante); für alle Ausgaben (plan, section, elevation, axo,
|
||||
// model3d, kennzahlen, dxf, ifc, obj …); `designoptions` vergleicht alle Kombinationen [272]
|
||||
// --hide <Code|Name,…> blendet Klassen aus (z. B. --hide "Schatten,Auto-Bemassung") [180]
|
||||
// --snapshot <Name|id> übernimmt Geschoss, Massstab, Vorlage und Sichtbarkeit eines Ausschnitts [207]
|
||||
// dossier-cli <projekt.obp> axo [--view southeast|southwest|northeast|northwest|iso|…] [--projection iso|military|military30]
|
||||
@@ -145,6 +148,12 @@ import {
|
||||
viewportLevelPlan,
|
||||
generateAxoPlan,
|
||||
renovationFilterList,
|
||||
parseCombination,
|
||||
designOptionSets,
|
||||
projectWithCombination,
|
||||
compareDesignOptions,
|
||||
compareDesignOptionsCsv,
|
||||
buildVariantenSampleProject,
|
||||
buildUmbauSampleProject,
|
||||
type AxoOptions,
|
||||
planToRenderScene,
|
||||
@@ -258,6 +267,7 @@ function loadProject(path: string, args: Args): Project {
|
||||
if (path === ":musterhaus-komplex") return buildComplexSampleProject();
|
||||
if (path === ":wettbewerb") return buildWettbewerbSampleProject();
|
||||
if (path === ":umbau") return buildUmbauSampleProject();
|
||||
if (path === ":varianten") return buildVariantenSampleProject();
|
||||
if (path === ":gross") return buildBigSampleProject({ floors: Number(args.flags.get("floors") ?? 8), apartments: Number(args.flags.get("apartments") ?? 15) });
|
||||
let text: string;
|
||||
try {
|
||||
@@ -631,7 +641,7 @@ function importParsedDrawing(base: Project, parsed: ReturnType<typeof parseDxf>,
|
||||
/** Liest Eingabe nach Endung in ein Projekt: obp direkt, dxf/dwg als 2D-Zeichnung + Meshes, ifc als Kontext-Meshes (`--elements`: Bauteile). */
|
||||
async function importAny(path: string, args: Args): Promise<Project> {
|
||||
const ext = extOf(path);
|
||||
if (ext === "obp" || ext === "json" || path === ":beispiel" || path === ":musterhaus-komplex" || path === ":wettbewerb" || path === ":umbau") return loadProject(path, args);
|
||||
if (ext === "obp" || ext === "json" || path === ":beispiel" || path === ":musterhaus-komplex" || path === ":wettbewerb" || path === ":umbau" || path === ":varianten") return loadProject(path, args);
|
||||
let bytes: Uint8Array;
|
||||
try {
|
||||
bytes = new Uint8Array(readFileSync(path));
|
||||
@@ -1049,7 +1059,7 @@ async function importSyntheticContext(base: Project, args: Args, rows: Array<[st
|
||||
}
|
||||
|
||||
/** Befehle, die eine Ausgabe-Datei erzeugen (für die Anonymitäts-Prüfung einer Wettbewerbs-Abgabe, [208]). */
|
||||
const EXPORT_COMMANDS = new Set(["plan", "section", "elevation", "axo", "dxf", "dwg", "ifc", "obj", "stl", "glb", "gltf", "step", "stp", "schedule", "kennzahlen", "raumprogramm", "render", "blend", "model3d"]);
|
||||
const EXPORT_COMMANDS = new Set(["plan", "section", "elevation", "axo", "dxf", "dwg", "ifc", "obj", "stl", "glb", "gltf", "step", "stp", "schedule", "kennzahlen", "designoptions", "raumprogramm", "render", "blend", "model3d"]);
|
||||
|
||||
/**
|
||||
* [208] Anonyme Abgabe: vor einem Export den Freitext prüfen. Treffer stehen auf stderr; ohne `--ignore-anonymity`
|
||||
@@ -1078,6 +1088,17 @@ async function execute(project: Project, file: string, command: string, rest: st
|
||||
const scale = Number(args.flags.get("scale") ?? 100);
|
||||
const blocked = anonymityGate(project, file, command, args);
|
||||
if (blocked !== 0) return blocked;
|
||||
// [272] `--options "Dachform=B,Fassade=A"`: diese Variantenkombination gilt für alle Ausgaben (wird zur Hauptkombination).
|
||||
const optSpec = args.flags.get("options");
|
||||
if (optSpec && optSpec !== "true") {
|
||||
const combo = parseCombination(project, optSpec);
|
||||
const asked = optSpec.split(/[,;]/).filter((s) => s.trim()).length;
|
||||
if (Object.keys(combo).length !== asked) {
|
||||
const known = designOptionSets(project).map((s) => `${s.name}=${s.options.map((o) => o.name).join("|")}`).join(", ");
|
||||
fail(`Variante nicht gefunden: ${optSpec} (vorhanden: ${known || "keine Variantensätze"})`);
|
||||
}
|
||||
project = projectWithCombination(project, combo);
|
||||
}
|
||||
// [257] `bench --context`: vorher synthetische Kontext-Importe (Kataster, Höhenlinien, Gebäudenetze) ins Projekt laden.
|
||||
const contextRows: Array<[string, number]> = [];
|
||||
if (command === "bench" && args.flags.has("context")) {
|
||||
@@ -1341,6 +1362,15 @@ async function execute(project: Project, file: string, command: string, rest: st
|
||||
out(args, JSON.stringify({ kennzahlen: k, raumprogramm: prog, baurecht, erdarbeiten }, null, 2), `${exportProjectName(project) || "projekt"}-kennzahlen.json`);
|
||||
return 0;
|
||||
}
|
||||
case "designoptions": {
|
||||
// [272] Varianten-Vergleich: Kennzahlen und Kosten je Kombination; --format json|csv, --renovation wie kennzahlen.
|
||||
const ren = renovationFlags(project, args)?.renovation ?? "";
|
||||
const stem = `${exportProjectName(project) || "projekt"}-varianten`;
|
||||
if ((args.flags.get("format") ?? "json") === "csv") {
|
||||
out(args, compareDesignOptionsCsv(project, ["Kombination", "GF m2", "HNF m2", "GV m3", "Fussabdruck m2", "AZ", "UEZ", "Kosten CHF"], ren), `${stem}.csv`);
|
||||
} else out(args, JSON.stringify(compareDesignOptions(project, ren), null, 2), `${stem}.json`);
|
||||
return 0;
|
||||
}
|
||||
case "raumprogramm": {
|
||||
// Raumprogramm: [--import tabelle.xlsx|ods|csv [--sheet Name|Nr] [--mode replace|append]] [--tolerance 5]
|
||||
// [--generate] [--format json|csv|svg|pdf] [--out datei] [--save projekt.obp]
|
||||
|
||||
Reference in new issue
Block a user