Merge branch 'worktree-agent-ad1b4a0a708d60d18' into claude/practical-noether-1hb2s1
This commit is contained in:
24 files changed
+1511
-171
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* [212] Materialtabelle des Pathtracers: je Textur-Ebene ({@link wallMaterialColorMaps}) Baustoff-Name und Farbkarte,
|
||||
* in derselben Reihenfolge (render3d ordnet `materialIndex` i der Tabelle i − 1 zu).
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
import { pathtraceMaterials, wallMaterialColorMaps } from "./toWalls3d";
|
||||
|
||||
const sampleProjectComplex = buildComplexSampleProject();
|
||||
|
||||
describe("[212] pathtraceMaterials", () => {
|
||||
it("folgt den Textur-Ebenen und nennt den Baustoff", () => {
|
||||
const maps = wallMaterialColorMaps(sampleProjectComplex);
|
||||
const table = pathtraceMaterials(sampleProjectComplex);
|
||||
expect(maps.length).toBeGreaterThan(0);
|
||||
expect(table.map((e) => e.map)).toEqual(maps);
|
||||
for (const e of table) {
|
||||
const comp = (sampleProjectComplex.components ?? []).find((c) => c.name === e.name);
|
||||
expect(comp?.material?.color).toBe(e.map);
|
||||
}
|
||||
});
|
||||
|
||||
it("leer ohne Farbkarten", () => {
|
||||
const bare = { ...sampleProjectComplex, components: (sampleProjectComplex.components ?? []).map((c) => ({ ...c, material: undefined })) };
|
||||
expect(pathtraceMaterials(bare)).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -198,6 +198,16 @@ export function wallMaterialColorMaps(project: Project): string[] {
|
||||
return maps;
|
||||
}
|
||||
|
||||
/**
|
||||
* [212] Materialtabelle des Pathtracers: je Textur-Ebene ({@link wallMaterialColorMaps}, gleiche Reihenfolge) der
|
||||
* Baustoff-Name (erstes Bauteil mit dieser Farbkarte) und die Farbkarte. render3d ordnet daraus Rauigkeit, Metall und
|
||||
* Glas zu (`render3d/src/pt_material.rs`, wie der Blender-Leser [211]).
|
||||
*/
|
||||
export function pathtraceMaterials(project: Project): { name: string; map: string }[] {
|
||||
const comps = project.components ?? [];
|
||||
return wallMaterialColorMaps(project).map((map) => ({ name: comps.find((c) => c.material?.color === map)?.name ?? "", map }));
|
||||
}
|
||||
|
||||
/**
|
||||
* Dach-Meshes (geschlossene, geschichtete Körper je Dachschicht); `onlyRoofId` beschränkt auf ein
|
||||
* Dach (IFC-Export). Rechnet der Kern.
|
||||
|
||||
Reference in new issue
Block a user