[69][26] Georeferenz: Innenhoefe der Daecher wandern mit

translateProject (TS: Befehl "Neuer Bezugspunkt", DXF-Export) und die
Kern-Fassung fuer den IFC-Export (geo_rebase.rs) verschoben Roof.holes nicht:
nach dem Verschieben bzw. im georeferenzierten IFC lagen die Hoefe am alten Ort
(im IFC um Millionen Meter neben dem Dach). Beim Port der Export-Sammler
gefunden; die Gleichheitspruefung lief vorher mit dem alten Verhalten.

Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
Claude committed 2026-10-29 02:53:22 +00:00
1 parent c7434dacb0
commit bc8b522763
3 files changed
+28 -6

No files matched your search

+8 -3
View File
@@ -38,11 +38,16 @@ describe("translateProject", () => {
expect(oc.openings![0]).toEqual(src.openings![0].map((p) => ({ x: p.x + DX, y: p.y + DY })));
});
it("verschiebt Dach-Umriss", () => {
const out = translateProject(sampleProject, DX, DY);
const r = sampleProject.roofs![0];
it("verschiebt Dach-Umriss inkl. Innenhöfe", () => {
const hole = [{ x: 1, y: 1 }, { x: 2, y: 1 }, { x: 2, y: 2 }, { x: 1, y: 2 }];
const withHole: Project = { ...sampleProject, roofs: [{ ...sampleProject.roofs![0], holes: [hole] }] };
const out = translateProject(withHole, DX, DY);
const r = withHole.roofs![0];
const or_ = out.roofs!.find((x) => x.id === r.id)!;
expect(or_.outline).toEqual(r.outline.map((p) => ({ x: p.x + DX, y: p.y + DY })));
expect(or_.holes![0]).toEqual(hole.map((p) => ({ x: p.x + DX, y: p.y + DY })));
// Ohne Höfe kein neues Feld.
expect("holes" in translateProject(sampleProject, DX, DY).roofs![0]).toBe(false);
});
it("Treppe: start/center verschieben sich, dir (Richtungsvektor) bleibt unverändert", () => {
+5 -1
View File
@@ -78,7 +78,11 @@ export function translateProject(project: Project, dx: number, dy: number): Proj
outline: shiftAll(c.outline, dx, dy),
openings: c.openings?.map((h) => shiftAll(h, dx, dy)),
})),
roofs: project.roofs?.map((r) => ({ ...r, outline: shiftAll(r.outline, dx, dy) })),
roofs: project.roofs?.map((r) => ({
...r,
outline: shiftAll(r.outline, dx, dy),
...(r.holes ? { holes: r.holes.map((h) => shiftAll(h, dx, dy)) } : {}),
})),
stairs: project.stairs?.map((s) => ({
...s,
start: shift(s.start, dx, dy),