Merge branch 'worktree-agent-a503ff91dcc2f951c' into claude/practical-noether-1hb2s1
This commit is contained in:
13 files changed
+202
-18
No files matched your search
+2
-2
@@ -35,7 +35,7 @@
|
||||
// [--scale 200] [--hatch] [--color] [--format svg|json|dxf|dxfbin|dwg] [--out axo.svg]
|
||||
// [266] 3D-Dokument: Vektor-Axonometrie/-Perspektive mit verdeckten Kanten aus dem Kern
|
||||
// (Linienzeichnung, Silhouette kräftig, Flächen nach Lage grau; ohne GPU)
|
||||
// dossier-cli <projekt.obp> ifc [--ebkph] [--ebenen] [--kontext] (IFC mit eBKP-H-Hauptgruppen bzw. Modell-Ebenen als Klassifikation; --kontext: Gelände/Nachbarn mitgeben)
|
||||
// dossier-cli <projekt.obp> ifc [--ebkph] [--ebenen] [--kontext] [--entourage] (IFC mit eBKP-H-Hauptgruppen bzw. Modell-Ebenen als Klassifikation; --kontext: Gelände/Nachbarn mitgeben; --entourage: Person/Velo/Auto als Proxy, Möbel gehen immer als IfcFurniture)
|
||||
// --schema 4|2x3: IFC4 (Standard) oder IFC2x3 (Coordination View 2.0)
|
||||
// dossier-cli <projekt.obp> dxf [--binary] [--scale 100] [--dim-unit cm] [--layout]|dwg|ifc|step|obj [--no-mtl]|stl|glb|gltf|schedule [--openings|--elements|--rooms] [--format json|csv|svg|pdf]|kennzahlen [--sia416] [--ivhb] [--nachweis] [--wohnungsspiegel] [--format json|csv|svg|pdf] [--agsf m2] [--gruenflaeche m2] [--agf-basis gf|ngf|nf] [--untergeschosse]|raumprogramm [--import tabelle] [--sheet name|nr] [--mode replace|append] [--tolerance %] [--generate] [--format json|csv|svg|pdf] [--save projekt.obp]|sun [--level EG] [--out datei]
|
||||
// glb/gltf = glTF 2.0 (Y-up, Meter, Geschoss als Eltern; --flat ohne Geschoss-Knoten)
|
||||
@@ -1334,7 +1334,7 @@ async function execute(project: Project, file: string, command: string, rest: st
|
||||
case "ifc":
|
||||
await loadFileio();
|
||||
// --ebkph: eBKP-H-Hauptgruppen je Bauteilart; --ebenen: Ebene (categoryCode) des Modells als Klassifikation.
|
||||
out(args, exportIfcSpf(project, { ebkph: args.flags.has("ebkph"), layerCodes: args.flags.has("ebenen"), context: args.flags.has("kontext"), schema: ifcSchemaFlag(args), view: exportViewFlags(project, args) }), `${exportProjectName(project) || "projekt"}.ifc`);
|
||||
out(args, exportIfcSpf(project, { ebkph: args.flags.has("ebkph"), layerCodes: args.flags.has("ebenen"), context: args.flags.has("kontext"), entourage: args.flags.has("entourage"), schema: ifcSchemaFlag(args), view: exportViewFlags(project, args) }), `${exportProjectName(project) || "projekt"}.ifc`);
|
||||
return 0;
|
||||
case "obj":
|
||||
await loadFileio();
|
||||
|
||||
@@ -109,15 +109,43 @@ describe.skipIf(!hasIfcOpenShell)("[259] IFC für Fachplaner (ifcopenshell)", {
|
||||
});
|
||||
});
|
||||
|
||||
describe("[259] 2D-Objektbibliothek im IFC", () => {
|
||||
it("bleibt draussen: die Datei ist mit und ohne Objekte zeichengleich", () => {
|
||||
const objs: Drawing2D[] = [
|
||||
{ id: "wc", type: "drawing2d", levelId: "eg", categoryCode: "23", geom: { shape: "libobj", libId: "lib:wc-wand", at: { x: 1, y: 1 }, rotation: 0 } },
|
||||
{ id: "ti", type: "drawing2d", levelId: "eg", categoryCode: "22", geom: { shape: "libobj", libId: "lib:tisch-80x140", at: { x: 3, y: 2 }, rotation: 0.5, seed: 3 } },
|
||||
];
|
||||
describe("[259][253] 2D-Objektbibliothek im IFC", () => {
|
||||
const libobj = (id: string, libId: string, x: number, y: number): Drawing2D => ({ id, type: "drawing2d", levelId: "eg", categoryCode: "22", geom: { shape: "libobj", libId, at: { x, y }, rotation: 0.5, seed: 3 } });
|
||||
|
||||
it("Objekte ohne 3D-Netz (WC) bleiben draussen: die Datei ist zeichengleich", () => {
|
||||
const without = exportAt(sampleProject);
|
||||
const withObjs = exportAt({ ...sampleProject, drawings2d: [...sampleProject.drawings2d, ...objs] });
|
||||
const withObjs = exportAt({ ...sampleProject, drawings2d: [...sampleProject.drawings2d, libobj("wc", "lib:wc-wand", 1, 1)] });
|
||||
expect(withObjs).toBe(without);
|
||||
expect(withObjs).not.toMatch(/IFCFURNITURE|IFCSANITARYTERMINAL|IFCFURNISHINGELEMENT/);
|
||||
});
|
||||
|
||||
it("Möbel mit Netz als IfcFurniture (IFC2x3: IfcFurnishingElement), Entourage nur mit Option als Proxy", () => {
|
||||
const p: Project = { ...sampleProject, drawings2d: [...sampleProject.drawings2d, libobj("ti", "lib:tisch-80x140", 3, 2), libobj("pe", "lib:person-stehend", 5, 2), libobj("ve", "lib:velo", 6, 2)] };
|
||||
const ifc = exportAt(p);
|
||||
expect(ifc.match(/=IFCFURNITURE\(/g)).toHaveLength(1);
|
||||
expect(ifc).toMatch(/=IFCFURNITURE\([^\n]*'Tisch 80x140'[^\n]*\.TABLE\.\);/);
|
||||
expect(ifc).not.toMatch(/Person|Velo|Entourage/);
|
||||
const v2 = exportAt(p, { schema: "IFC2X3" });
|
||||
expect(v2.match(/=IFCFURNISHINGELEMENT\(/g)).toHaveLength(1);
|
||||
const ent = exportAt(p, { entourage: true });
|
||||
expect(ent.match(/=IFCFURNITURE\(/g)).toHaveLength(1);
|
||||
expect(ent.match(/=IFCBUILDINGELEMENTPROXY\([^\n]*'Entourage'/g)).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe.skipIf(!hasIfcOpenShell)("[253] Möbel im IFC (ifcopenshell)", { timeout: 900_000 }, () => {
|
||||
it("Wettbewerb: Bank als IfcFurniture im Geschoss, keine Personen/Velo/Auto; mit Option als Proxy", () => {
|
||||
const p = buildWettbewerbSampleProject();
|
||||
const libs = p.drawings2d.flatMap((d) => (d.geom.shape === "libobj" ? [d.geom.libId] : []));
|
||||
const entourage = libs.filter((l) => /person|velo|auto/.test(l)).length;
|
||||
expect(libs).toContain("lib:sitzbank");
|
||||
expect(entourage).toBeGreaterThan(0);
|
||||
const c = check("wettbewerb-moebel", exportIfcSpf(p), ["--geo"]);
|
||||
expect(c.stats.counts.IfcFurniture).toBe(libs.filter((l) => /sitzbank|tisch|stuhl/.test(l)).length);
|
||||
expect(c.stats.counts.IfcBuildingElementProxy ?? 0).toBe(0);
|
||||
const e = check("wettbewerb-entourage", exportIfcSpf(p, { entourage: true }), ["--geo"]);
|
||||
expect(e.stats.counts.IfcBuildingElementProxy).toBe(entourage);
|
||||
// IFC2x3: Schema-Prüfung (das inhaltliche Skript kennt nur IFC4-Geometrie).
|
||||
const v = spawnSync("python3", ["scripts/validate-ifc.py", writeIfc("wettbewerb-moebel-2x3", exportIfcSpf(p, { schema: "IFC2X3", entourage: true }))], { encoding: "utf8", timeout: 400_000 });
|
||||
expect(`${v.stdout}\n${v.stderr}`).toContain(" 0 Befunde");
|
||||
});
|
||||
});
|
||||
@@ -36,6 +36,8 @@ export interface IfcExportOptions {
|
||||
* (IfcBuildingElementProxy „Kontext"), am IfcSite. Ohne Angabe nicht: Fachplaner wollen meist nur das Gebäude.
|
||||
*/
|
||||
context?: boolean;
|
||||
/** [253] Entourage (Person, Velo, Auto) als IfcBuildingElementProxy „Entourage" mitgeben; Möbel gehen immer als IfcFurniture. */
|
||||
entourage?: boolean;
|
||||
/** [271][272] Ansicht der Ausgabe: Umbaufilter und Variantenkombination (ohne Angabe kein Filter, Hauptvarianten). */
|
||||
view?: ExportView;
|
||||
}
|
||||
@@ -82,7 +84,7 @@ export function decodeExportFlat(bytes: Uint8Array): [Float64Array, string] {
|
||||
export function exportIfcSpf(project: Project, options: IfcExportOptions = {}): string {
|
||||
const now = Date.now();
|
||||
const iso = new Date(now).toISOString().replace(/\.\d+Z$/, "");
|
||||
const args = [Math.floor(now / 1000), options.schema === "IFC2X3" ? 1 : 0, options.ebkph ? 1 : 0, options.layerCodes ? 1 : 0, options.context ? 1 : 0];
|
||||
const args = [Math.floor(now / 1000), options.schema === "IFC2X3" ? 1 : 0, options.ebkph ? 1 : 0, options.layerCodes ? 1 : 0, options.context ? 1 : 0, options.entourage ? 1 : 0];
|
||||
const [buf, strings] = decodeExportFlat(documentFor(project).queryBin("ifcExportData", args, exportViewText(options.view, { iso })));
|
||||
const m = fileio();
|
||||
const text = m.export_ifc_flat(buf, strings);
|
||||
|
||||
@@ -3016,6 +3016,8 @@ export const de = {
|
||||
"exportSave.ifc.layers": "Ebene (Kategorie-Code) des Modells als Klassifikation",
|
||||
"exportSave.ifc.layersHint": "System «Dossier-Ebenen»: Code und Name der Grafik-Ebene jedes Bauteils (kein Baukostenplan).",
|
||||
"exportSave.ifc.context": "Kontext mitgeben (Gelände, Nachbargebäude)",
|
||||
"exportSave.ifc.entourage": "Entourage mitexportieren (Personen, Velos, Autos)",
|
||||
"exportSave.ifc.entourageHint": "Möbel (Tische, Stühle, Bänke) gehen immer als IfcFurniture mit. Personen, Velos und Autos sind keine Bauteile und kommen nur mit dieser Option, als IfcBuildingElementProxy «Entourage».",
|
||||
"exportSave.ifc.contextHint": "Gelände als IfcGeographicElement, Netze auf Umgebungsklassen (z. B. 12 Gebäude) als IfcBuildingElementProxy «Kontext», am Grundstück statt im Geschoss. Für Fachplaner meist aus lassen: sie brauchen nur das Gebäude.",
|
||||
"exportSave.ifc.zonesNote": "SIA-416-Zonen (HNF, NNF …) und Geschossflächen sind immer enthalten, sobald Räume vorhanden sind.",
|
||||
"exportSave.ifc.schema": "IFC-Schema",
|
||||
|
||||
@@ -3348,6 +3348,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"exportSave.ifc.layers": "Model layer (category code) as classification",
|
||||
"exportSave.ifc.layersHint": "System “Dossier-Ebenen”: code and name of each element's graphic layer (not a cost plan).",
|
||||
"exportSave.ifc.context": "Include context (terrain, neighbouring buildings)",
|
||||
"exportSave.ifc.entourage": "Export entourage (people, bicycles, cars)",
|
||||
"exportSave.ifc.entourageHint": "Furniture (tables, chairs, benches) is always exported as IfcFurniture. People, bicycles and cars are not building elements and only come with this option, as IfcBuildingElementProxy “Entourage”.",
|
||||
"exportSave.ifc.contextHint": "Terrain as IfcGeographicElement, meshes on context classes (e.g. 12 Buildings) as IfcBuildingElementProxy “Kontext”, placed on the site instead of a storey. Usually leave off for consultants: they only need the building.",
|
||||
"exportSave.ifc.zonesNote": "SIA 416 zones (HNF, NNF …) and floor areas are always included when rooms exist.",
|
||||
"exportSave.ifc.schema": "IFC schema",
|
||||
|
||||
@@ -77,13 +77,14 @@ export function ExportSaveDialog({
|
||||
const [ebkph, setEbkph] = useState(false);
|
||||
const [layerCodes, setLayerCodes] = useState(false);
|
||||
const [context, setContext] = useState(false);
|
||||
const [entourage, setEntourage] = useState(false);
|
||||
// IFC-Schema: IFC4 (Standard) oder IFC2x3 für ältere Fachplaner-Programme.
|
||||
const [schema, setSchema] = useState<IfcSchema>("IFC4");
|
||||
// [271][272] Die Ansicht der aktiven Ebene gilt für alle 3D-Formate (IFC, OBJ, STL, glTF, STEP); die Bauteilliste (CSV) nicht.
|
||||
const viewApplies = format !== "csv";
|
||||
const viewActive = hasExportView(view);
|
||||
const [useView, setUseView] = useState(true);
|
||||
const onConfirm = () => onSave(format, filename, format === "ifc" ? { schema, ebkph, layerCodes, context } : undefined, viewApplies && viewActive && useView ? view : undefined);
|
||||
const onConfirm = () => onSave(format, filename, format === "ifc" ? { schema, ebkph, layerCodes, context, entourage } : undefined, viewApplies && viewActive && useView ? view : undefined);
|
||||
|
||||
return (
|
||||
<div className="imp-overlay" onClick={onClose}>
|
||||
@@ -147,6 +148,11 @@ export function ExportSaveDialog({
|
||||
<span>{t("exportSave.ifc.context")}</span>
|
||||
</label>
|
||||
<div className="imp-note">{t("exportSave.ifc.contextHint")}</div>
|
||||
<label className="imp-check">
|
||||
<input type="checkbox" checked={entourage} onChange={(e) => setEntourage(e.target.checked)} />
|
||||
<span>{t("exportSave.ifc.entourage")}</span>
|
||||
</label>
|
||||
<div className="imp-note">{t("exportSave.ifc.entourageHint")}</div>
|
||||
<div className="imp-note">{t("exportSave.ifc.zonesNote")}</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user