Merge branch 'worktree-agent-a43834281029e75d5' into claude/practical-noether-1hb2s1
This commit is contained in:
10 files changed
+273
-31
No files matched your search
@@ -11,6 +11,7 @@ import "../engine/fileioWasm.setup";
|
||||
import { exportIfcSpf, ifcGuid } from "./exportIfc";
|
||||
import { wallMeshVolumes } from "./meshScene.testutil";
|
||||
import { sampleProject } from "../model/sampleProject";
|
||||
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
import type { Project } from "../model/types";
|
||||
|
||||
const hasIfcOpenShell = spawnSync("python3", ["-c", "import ifcopenshell, ifcopenshell.validate, _pytest"]).status === 0;
|
||||
@@ -163,6 +164,14 @@ describe.skipIf(!hasIfcOpenShell)("IFC-Export gegen ifcopenshell", { timeout: 60
|
||||
expect(r.out).toContain("0 Befunde");
|
||||
expect(r.status).toBe(0);
|
||||
});
|
||||
it("[191] Decken/Räume mit Bogenkanten: IfcCompositeCurve mit IfcTrimmedCurve, gültig", () => {
|
||||
const ifc = exportIfcSpf(buildComplexSampleProject());
|
||||
expect(ifc).toContain("IFCCOMPOSITECURVE(");
|
||||
expect(ifc).toContain("IFCTRIMMEDCURVE(");
|
||||
const r = validate("komplex-boegen", ifc);
|
||||
expect(r.out).toContain("0 Befunde");
|
||||
expect(r.status).toBe(0);
|
||||
}, 240_000);
|
||||
it("[98] Pset_Door/Window/Wall/SlabCommon mit Kennwerten: gültig", () => {
|
||||
const p: Project = {
|
||||
...sampleProject,
|
||||
|
||||
@@ -210,3 +210,15 @@ describe("roofUndersideAt — Dach-Unterkante an einem Grundriss-Punkt", () => {
|
||||
expect(roofUndersideAt(g, -0.5, 3, 0)).toBeCloseTo(10, 6);
|
||||
});
|
||||
});
|
||||
|
||||
describe("roofGeometry — Bogenkanten ([191])", () => {
|
||||
it("Traufe folgt dem Bogen (3D-Griffe sehen dieselbe Geometrie wie der Kern), Kantenneigung bleibt lesbar", () => {
|
||||
// Rechteck 6×4, rechte Kante (6,0)→(6,4) als Halbkreis nach aussen (Scheitel rechts der Kante: Bulge −1).
|
||||
const g = roofGeometry(roof({ shape: "flach", pitchDeg: 0, outlineBulge: [0, -1, 0, 0] }), E);
|
||||
expect(Math.max(...g.eaves.map((p) => p.x))).toBeCloseTo(8, 6);
|
||||
expect(g.eaves.length).toBeGreaterThan(48);
|
||||
expect(roofGeometry(roof({ shape: "flach", pitchDeg: 0 }), E).eaves.length).toBe(4);
|
||||
const withEdges = roofGeometry(roof({ shape: "pult", outlineBulge: [0, -1, 0, 0], edgePitchDeg: [10, 10, 10, 10] }), E);
|
||||
expect(withEdges.planes.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
@@ -63,8 +63,16 @@ function encodeRoof(roof: Roof): Float64Array {
|
||||
const pts = roof.outline;
|
||||
const holes = roof.holes ?? [];
|
||||
const edges = roof.edgePitchDeg;
|
||||
// [191] Bögen je Ring (Umriss, dann Höfe); der Kern teilt Bogenkanten fein und vererbt die Kantenneigung.
|
||||
const bulges = [roof.outlineBulge, ...holes.map((_, k) => roof.holesBulge?.[k])];
|
||||
const hasArcs = bulges.some((b) => b?.some((v) => v));
|
||||
let size = 10 + 2 * pts.length + 1 + 1 + (edges ? edges.length : 0);
|
||||
for (const h of holes) size += 1 + 2 * h.length;
|
||||
if (hasArcs) {
|
||||
size += 1;
|
||||
const rings = [pts, ...holes];
|
||||
for (const r of rings) size += 1 + r.length;
|
||||
}
|
||||
const buf = new Float64Array(size);
|
||||
buf[0] = SHAPE_CODE[roof.shape] ?? 0;
|
||||
buf[1] = roof.pitchDeg;
|
||||
@@ -92,6 +100,14 @@ function encodeRoof(roof: Roof): Float64Array {
|
||||
// Neigung je Kante: NaN = Feld fehlt, +∞ = Giebel (null), negativ = Standard.
|
||||
buf[i++] = edges ? edges.length : NaN;
|
||||
if (edges) for (const v of edges) buf[i++] = v === null ? Infinity : v;
|
||||
if (hasArcs) {
|
||||
const rings = [pts, ...holes];
|
||||
buf[i++] = rings.length;
|
||||
rings.forEach((r, k) => {
|
||||
buf[i++] = r.length;
|
||||
for (let e = 0; e < r.length; e++) buf[i++] = bulges[k]?.[e] ?? 0;
|
||||
});
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user