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.
28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
/**
|
||
* 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);
|
||
});
|
||
});
|