Files
DOSSIER/src/plan/toSection.orientation.test.ts
T
Claude 4971348ec1 [162] Grosse Rust-Dateien geteilt: plan/section.rs → plan/section/, model3d.rs → model3d/
Reines Verschieben ohne Logik-Änderung: gleiche Funktionen, gleiche Tests (1194 Kern-Tests vorher und
nachher, Namensliste identisch). Jede neue Datei mit Kopf-Kommentar; Sichtbarkeit nur so weit geöffnet,
wie die Geschwister brauchen (pub(super)); öffentliche Pfade über Wiederexport in mod.rs unverändert.
Schnitt: mod (Typen, compute_section), input, bands, shapes, voids, meshes, projection, primitives,
openings, query; Tests in tests, ts_faelle, dach_faelle, abzug_faelle, wand_an_dach, bench, mesh_tests.
3D: mod (Typen, parts), ceilings, columns, walls, openings, stairs, roofs, context, drawings, pick, tests.
Doku (ARCHITEKTUR.md, READMEs) und Pfad-Hinweise in Kommentaren nachgeführt.
2026-11-09 13:10:30 +00:00

28 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* u-Achse der Schnittebene (`sectionUAxisModel`, `sectionPlaneFromLevel`): Blickrichtungs-RECHTS wie
* im Kern-Schnitt. Die Aussen/Innen-Lage der Schicht-Bänder prüft der Kern
* (`core/src/plan/section/ts_faelle.rs`, `schichten_aussen_aussen_und_override_auf_allen_schichten`).
*/
import { describe, it, expect } from "vitest";
import { sectionPlaneFromLevel, sectionUAxisModel } from "./toSection";
import { sampleProject } from "../model/sampleProject";
// Schnitt A: horizontale Linie y=2 (x −1…6), quer durch W2 (x=5) und W4 (x=0).
const planeA = sectionPlaneFromLevel(
sampleProject.drawingLevels.find((l) => l.id === "schnitt-a")!,
)!;
describe("Schnitt-u-Weltachse", () => {
it("entspricht der Kern-Konvention u = cross(up, normal) → Grundriss (Nz, −Nx)", () => {
// Schnitt A: Ebenennormale world = (0,0,1) → uWorld model = (1, 0) —
// Betrachter-RECHTS (Entspiegelung: Blick nach Norden ⇒ Osten rechts).
expect(planeA.normal[0]).toBeCloseTo(0, 9);
expect(planeA.normal[1]).toBeCloseTo(0, 9);
expect(planeA.normal[2]).toBeCloseTo(1, 9);
const u = sectionUAxisModel(planeA);
expect(u.x).toBeCloseTo(1, 9);
expect(u.y).toBeCloseTo(0, 9);
});
});