[108] Schräge Wandanschlüsse: IFC-Profile und truck-Körper mit Gehrung
This commit is contained in:
9 files changed
+383
-31
No files matched your search
@@ -103,6 +103,8 @@ export type SolidSpec =
|
||||
uAxis: [number, number, number];
|
||||
vAxis: [number, number, number];
|
||||
depth: number;
|
||||
/** Ring auf der Rückseite (gleiche Punktzahl): schräge Stirnflächen an Gehrung/Stoss ([108]). */
|
||||
pointsBack?: number[];
|
||||
}
|
||||
| { kind: "revolve"; profile: number[]; cx?: number; cy?: number; angleDeg?: number }
|
||||
| { kind: "loft"; sections: LoftSectionSpec[] }
|
||||
|
||||
@@ -86,4 +86,18 @@ describe("STEP-Export Ende-zu-Ende (truck-WASM)", () => {
|
||||
const step: string = mod.export_step(JSON.stringify({ solids: bools, fileName: "void.stp" }));
|
||||
expect(step.startsWith("ISO-10303-21;")).toBe(true);
|
||||
}, 60_000);
|
||||
|
||||
it("[108] Wände an Ecken: schräge Stirnflächen (pointsBack) werden zu geschlossenen Körpern", async () => {
|
||||
const mod: any = await import("../engine/pkgTruck/trucksolid.js");
|
||||
await mod.default({ module_or_path: readFileSync("src/engine/pkgTruck/trucksolid_bg.wasm") });
|
||||
const skew = projectSolidSpecs(sampleProject).filter((s) => s.kind === "extrudePlane" && s.pointsBack);
|
||||
expect(skew.length).toBeGreaterThan(0);
|
||||
for (const spec of skew) {
|
||||
const props = JSON.parse(mod.solid_props(JSON.stringify({ spec })));
|
||||
expect(props.closed).toBe(true);
|
||||
expect(props.volume).toBeGreaterThan(0);
|
||||
}
|
||||
const step: string = mod.export_step(JSON.stringify({ solids: skew, fileName: "ecken.stp" }));
|
||||
expect(step).toContain("CLOSED_SHELL");
|
||||
}, 60_000);
|
||||
});
|
||||
@@ -158,6 +158,12 @@ export interface RWall {
|
||||
* der 3D-Live-Schnitt die Boolean-Dominanz + Fugenlinien wie der 2D-Schnitt macht.
|
||||
*/
|
||||
cut?: RCutMeta;
|
||||
/**
|
||||
* Schnittlinie `[px, py, dx, dy]` (Grundriss) am Anfang/Ende: Gehrung, T-Stoss-Fläche oder schräge
|
||||
* Aussparungs-Seite ([108], `RWall.startCut/endCut` im Kern).
|
||||
*/
|
||||
startCut?: [number, number, number, number];
|
||||
endCut?: [number, number, number, number];
|
||||
}
|
||||
|
||||
/** Eine extrudierte Deckenplatte: geschlossener Grundriss-Umriss + Z-Ausdehnung. */
|
||||
|
||||
@@ -7,11 +7,15 @@ import type { SolidSpec } from "../engine/truckSolid";
|
||||
import { core } from "../engine/coreWasm";
|
||||
import type { RWall } from "./toWalls3d/shared";
|
||||
|
||||
type WallLike = Pick<RWall, "start" | "end" | "thickness" | "height" | "baseElevation" | "holes">;
|
||||
type WallLike = Pick<RWall, "start" | "end" | "thickness" | "height" | "baseElevation" | "holes" | "startCut" | "endCut">;
|
||||
|
||||
/** Wand als `extrudePlane` (Profil in der Wandebene, Tiefe = Dicke); null bei entarteter Wand. */
|
||||
/**
|
||||
* Wand als `extrudePlane` (Profil in der Wandebene, Tiefe = Dicke; mit Schnittlinien schräge
|
||||
* Stirnflächen über `pointsBack`, [108]); null bei entarteter Wand.
|
||||
*/
|
||||
export function wallSpec(w: WallLike): SolidSpec | null {
|
||||
const f = [w.start[0], w.start[1], w.end[0], w.end[1], w.thickness, w.height, w.baseElevation];
|
||||
for (const c of [w.startCut, w.endCut]) f.push(c ? 1 : 0, ...(c ?? [0, 0, 0, 0]));
|
||||
for (const h of w.holes ?? []) f.push(h.from, h.to, h.zBottom, h.zTop);
|
||||
const s = core().wall_spec_flat(Float64Array.from(f));
|
||||
return s ? (JSON.parse(s) as SolidSpec) : null;
|
||||
|
||||
Reference in new issue
Block a user