[221] [225] LV95-Projekte lokal um den Projekt-Nullpunkt, Standard-Schnitt/-Ansicht folgen dem Gebäude; Kennzahlenleiste = Flächentabelle
[221] DXF/DWG-Import in Landeskoordinaten setzt ohne Standort-Bezug den Kilometerpunkt unter der Mitte als geoAnchor und importiert lokal (mit Bezug: auf dessen Ursprung). Getippte LV95-Koordinaten werden auf den Nullpunkt gerechnet, die Statusleiste zeigt LV95 des Zeigers. Schnitt A/Ansicht Süd des leeren Projekts (autoLine) führt der Kern im selben Undo-Schritt ans Gebaute bzw. die Parzelle nach, bis man sie bearbeitet (auto_lines.rs). Schnittmarken weit weg vom Gebauten zählen nicht mehr zum Ausmass. [225] kennzahlen::compute liest Flächentabelle und IVHB-Ziffern (GF = NGF + KF, ÜZ = aGbF/aGSF). e2e release10: Schritte [221]/[225] aktiv; kataster.spec auf lokale Koordinaten.
This commit is contained in:
30 files changed
+797
-139
No files matched your search
+15
-7
@@ -16,7 +16,7 @@
|
||||
import type { Vec2 } from "../model/types";
|
||||
import type { SnapResult, ToolDraft } from "../tools/types";
|
||||
import type { ProjectMutation } from "../core";
|
||||
import { NON_LENGTH_FIELDS, parseInput, resolvePoint, toModelInput } from "./parseInput";
|
||||
import { NON_LENGTH_FIELDS, fromWorldInput, parseInput, resolvePoint, toModelInput } from "./parseInput";
|
||||
import { MODEL_UNITS, type DisplayUnits } from "../tools/displayUnits";
|
||||
import { getCommand, resolveCommand, autocomplete } from "./registry";
|
||||
import { hasTransformSelection } from "../tools/transform";
|
||||
@@ -66,6 +66,11 @@ export interface EngineHost {
|
||||
* (s. `tools/displayUnits.ts`). Fehlt der Handler, gelten Meter.
|
||||
*/
|
||||
inputUnits?(): DisplayUnits;
|
||||
/**
|
||||
* Optional ([221]): LV95-Ursprung des Projekts (Standort-Bezug), wenn getippte Landeskoordinaten auf den
|
||||
* Projekt-Nullpunkt gerechnet werden sollen (Modell-Ebenen, nicht auf dem Layout-Blatt); `null` = keiner.
|
||||
*/
|
||||
inputGeoOrigin?(): { e: number; n: number } | null;
|
||||
/** Optional: Hinweis zeigen (i18n-Key), z. B. „erst Objekte wählen" (`Command.needsSelection`). */
|
||||
notify?(key: string, params?: Record<string, string | number>, kind?: "info" | "warning" | "error"): void;
|
||||
}
|
||||
@@ -484,12 +489,15 @@ export class CommandEngine {
|
||||
return;
|
||||
}
|
||||
|
||||
const parsed = toModelInput(
|
||||
parseInput(text),
|
||||
this.host.inputUnits?.() ?? MODEL_UNITS,
|
||||
// Nackte Zahl: Länge im Längen-Feld bzw. als Distanz-Lock eines Punkt-Schritts; reine Zahl-Schritte
|
||||
// (Anzahl, Faktor, Winkel …) bleiben ohne Umrechnung.
|
||||
this.hasFields() ? this.activeFieldUnit() : accepts.includes("point") ? "length" : "none",
|
||||
const parsed = fromWorldInput(
|
||||
toModelInput(
|
||||
parseInput(text),
|
||||
this.host.inputUnits?.() ?? MODEL_UNITS,
|
||||
// Nackte Zahl: Länge im Längen-Feld bzw. als Distanz-Lock eines Punkt-Schritts; reine Zahl-Schritte
|
||||
// (Anzahl, Faktor, Winkel …) bleiben ohne Umrechnung.
|
||||
this.hasFields() ? this.activeFieldUnit() : accepts.includes("point") ? "length" : "none",
|
||||
),
|
||||
this.host.inputGeoOrigin?.() ?? null,
|
||||
);
|
||||
|
||||
// Tab-Feld-Modus (§2.7): eine nackte Zahl LOCKT das aktive Feld (statt als
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { fromWorldInput, isLv95, parseInput } from "./parseInput";
|
||||
|
||||
describe("[221] getippte Landeskoordinaten", () => {
|
||||
const origin = { e: 2_600_000, n: 1_200_000 };
|
||||
it("absolute LV95-Eingabe wird bei Standort-Bezug auf den Projekt-Nullpunkt gerechnet", () => {
|
||||
expect(fromWorldInput(parseInput("2600048,1200046"), origin)).toEqual({ kind: "absolute", point: { x: 48, y: 46 } });
|
||||
});
|
||||
it("lokale, relative Eingaben und Projekte ohne Bezug bleiben", () => {
|
||||
expect(fromWorldInput(parseInput("48,46"), origin)).toEqual({ kind: "absolute", point: { x: 48, y: 46 } });
|
||||
expect(fromWorldInput(parseInput("r2600048,1200046"), origin).kind).toBe("relative");
|
||||
expect(fromWorldInput(parseInput("2600048,1200046"), null)).toEqual({ kind: "absolute", point: { x: 2600048, y: 1200046 } });
|
||||
});
|
||||
it("LV95-Bereich", () => {
|
||||
expect(isLv95(2_600_000, 1_200_000)).toBe(true);
|
||||
expect(isLv95(600_000, 200_000)).toBe(false);
|
||||
expect(isLv95(48, 46)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -132,6 +132,24 @@ export function toModelInput(p: ParsedInput, u: DisplayUnits, distance: "length"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [221] Liegt der Punkt in den Landeskoordinaten LV95 (Ost 2.4–2.9 Mio. m, Nord 1.0–1.4 Mio. m)? Dieselben
|
||||
* Grenzen wie der Kern beim Import (`src-tauri/core/src/import_drawing.rs::is_lv95`).
|
||||
*/
|
||||
export function isLv95(e: number, n: number): boolean {
|
||||
return e >= 2.4e6 && e <= 2.9e6 && n >= 1.0e6 && n <= 1.4e6;
|
||||
}
|
||||
|
||||
/**
|
||||
* [221] Getippte absolute Landeskoordinaten auf den Projekt-Nullpunkt rechnen: das Modell liegt lokal um den
|
||||
* Ursprung des Standort-Bezugs (`origin` = `projectGeoOrigin`, LV95 des Modell-Nullpunkts), getippt wird oft
|
||||
* aus dem Kataster (`2600048,1200046`). Ohne Bezug, ausserhalb LV95 und für relative Eingaben unverändert.
|
||||
*/
|
||||
export function fromWorldInput(p: ParsedInput, origin: { e: number; n: number } | null): ParsedInput {
|
||||
if (!origin || p.kind !== "absolute" || !isLv95(p.point.x, p.point.y)) return p;
|
||||
return { kind: "absolute", point: { x: p.point.x - origin.e, y: p.point.y - origin.n } };
|
||||
}
|
||||
|
||||
/** Punkt aus polarer Form (Distanz/Winkel) relativ zu einem Basispunkt. */
|
||||
export function polarPoint(base: Vec2, dist: number, angleDeg: number): Vec2 {
|
||||
const a = angleDeg * DEG;
|
||||
|
||||
Reference in new issue
Block a user