Merge branch 'worktree-agent-a6dfad03524c70231' into claude/practical-noether-1hb2s1

This commit is contained in:
Claude committed 2026-11-16 16:25:05 +00:00
commit 0cd52acfe1
20 files changed
+281 -39

No files matched your search

+6
View File
@@ -6,6 +6,12 @@ describe("[221] getippte Landeskoordinaten", () => {
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("[266] Ergebnis auf mm gerundet, keine Gleitkomma-Reste", () => {
const o = { e: 2_600_000.1, n: 1_200_000.3 };
const r = fromWorldInput(parseInput("2600053.3,1200010.7"), o);
expect(r).toEqual({ kind: "absolute", point: { x: 53.2, y: 10.4 } });
expect(fromWorldInput(parseInput("2600053.2,1200000.1"), origin)).toEqual({ kind: "absolute", point: { x: 53.2, y: 0.1 } });
});
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");
+3 -1
View File
@@ -147,7 +147,9 @@ export function isLv95(e: number, n: number): boolean {
*/
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 } };
// [266] Auf mm runden: 2600053.2 − 2600000 ergäbe sonst 53.200000000186 im Modell.
const mm = (v: number) => Math.round(v * 1000) / 1000;
return { kind: "absolute", point: { x: mm(p.point.x - origin.e), y: mm(p.point.y - origin.n) } };
}
/** Punkt aus polarer Form (Distanz/Winkel) relativ zu einem Basispunkt. */