Merge [281] Geneigte Decken und Rampen (IFC-Datensatz der geneigten Decke auf 27, 26 bleibt Geländer)

This commit is contained in:
Claude committed 2026-11-18 00:50:05 +00:00
commit b6d8a6c2ad
60 files changed
+1273 -66

No files matched your search

+9
View File
@@ -107,6 +107,15 @@ const SLAB: PickSlab = {
};
describe("raySlabPrism", () => {
it("[281] geneigte Platte: Deckel um den Versatz der Neigungsebene höher", () => {
// Steigt 15 % nach +x: bei x = 3 liegt die OK auf 3.0 + 0.45 = 3.45 → senkrecht von y = 10: t = 6.55.
const sloped = { ...SLAB, slope: [0, 0, 0.15, 0] as const };
expect(raySlabPrism({ origin: [3, 10, 2], dir: [0, -1, 0] }, sloped)!).toBeCloseTo(6.55, 6);
// Waagrechter Strahl auf 3.2: an der Seite x = 0 (2.9..3.0) vorbei, trifft die steigende Oberseite bei
// 3.0 + 0.15·x = 3.2 → x = 4/3 (Strahl von −5 aus: t = 19/3).
expect(raySlabPrism({ origin: [-5, 3.2, 2], dir: [1, 0, 0] }, sloped)!).toBeCloseTo(19 / 3, 6);
});
it("Strahl von oben trifft den Deckel (kleinstes t)", () => {
// eye (2,10,2) senkrecht nach unten: Deckel y=3 bei t=7.
const t = raySlabPrism({ origin: [2, 10, 2], dir: [0, -1, 0] }, SLAB);
+8 -1
View File
@@ -301,7 +301,14 @@ function rayPrismXZ(
* oder null — s. {@link rayPrismXZ}.
*/
export function raySlabPrism(ray: Ray, slab: PickSlab): number | null {
return rayPrismXZ(ray, slab.outline, slab.zBottom, slab.zTop);
const g = slab.slope;
if (!g) return rayPrismXZ(ray, slab.outline, slab.zBottom, slab.zTop);
// [281] Geneigte Platte: in den ungescherten Raum abbilden (Höhe − Versatz der Neigungsebene). Die Scherung ist
// affin, der Strahlparameter t bleibt also gleich.
const [ox, oz] = [ray.origin[0], ray.origin[2]];
const origin: Vec3 = [ox, ray.origin[1] - (g[2] * (ox - g[0]) + g[3] * (oz - g[1])), oz];
const dir: Vec3 = [ray.dir[0], ray.dir[1] - (g[2] * ray.dir[0] + g[3] * ray.dir[2]), ray.dir[2]];
return rayPrismXZ({ ...ray, origin, dir }, slab.outline, slab.zBottom, slab.zTop);
}
/**