[216] 3D: Formöffnungen als Wandkörper (rundes Loch, keine Stossfugen/Streifen), Flächenmuster an Giebel und Öffnungsumriss beschnitten, Glas in Weiss/Kanten sichtbar
This commit is contained in:
19 files changed
+684
-66
No files matched your search
+5
-1
@@ -1032,7 +1032,11 @@ async function execute(project: Project, file: string, command: string, rest: st
|
||||
// `--grey-floor <id|Name,…>`: Geschosse grau (Zeichnungsebenen-Modus), ebenso in der Geisterschicht.
|
||||
const filter: Filter3d = { hide: hideFlagCodes(project, args), grey: hideFlagCodes(project, args, "grey"), greyFloors: greyFloorIds(project, args) };
|
||||
const ghost = ghostFilter3d(filter);
|
||||
const model = projectToModel3d(project, { explode, hide: filter });
|
||||
const model = {
|
||||
...projectToModel3d(project, { explode, hide: filter }),
|
||||
// Flächenmuster ([100]) des Modells (render_png zeichnet sie in den Kanten-Stilen).
|
||||
patternLines: Array.from(emitSurfacePatternLines(project, explode, filter)),
|
||||
};
|
||||
// Geisterschicht: Modell, dazu gedämpfte 2D-Spuren und Flächenmuster (render_png `ghostDrawing`/`ghostPattern`).
|
||||
const json = ghost
|
||||
? {
|
||||
|
||||
@@ -1,43 +1,69 @@
|
||||
meshes [1962]
|
||||
meshes[].color [3] x1962
|
||||
meshes [1211]
|
||||
meshes[].color [3] x1211
|
||||
meshes[].indices [108] x6
|
||||
meshes[].indices [1152]
|
||||
meshes[].indices [1152] x3
|
||||
meshes[].indices [1224]
|
||||
meshes[].indices [1236]
|
||||
meshes[].indices [1248] x3
|
||||
meshes[].indices [12960]
|
||||
meshes[].indices [1326]
|
||||
meshes[].indices [1392]
|
||||
meshes[].indices [144] x55
|
||||
meshes[].indices [154014]
|
||||
meshes[].indices [1584]
|
||||
meshes[].indices [1716]
|
||||
meshes[].indices [180]
|
||||
meshes[].indices [2118]
|
||||
meshes[].indices [2124] x2
|
||||
meshes[].indices [2130]
|
||||
meshes[].indices [2376]
|
||||
meshes[].indices [2676] x2
|
||||
meshes[].indices [31104]
|
||||
meshes[].indices [312]
|
||||
meshes[].indices [348] x6
|
||||
meshes[].indices [36] x1861
|
||||
meshes[].indices [36] x1090
|
||||
meshes[].indices [3840]
|
||||
meshes[].indices [396]
|
||||
meshes[].indices [564] x2
|
||||
meshes[].indices [4086]
|
||||
meshes[].indices [5496]
|
||||
meshes[].indices [564] x4
|
||||
meshes[].indices [60] x9
|
||||
meshes[].indices [648]
|
||||
meshes[].indices [72]
|
||||
meshes[].indices [7332]
|
||||
meshes[].indices [7632]
|
||||
meshes[].indices [84] x2
|
||||
meshes[].indices [9288]
|
||||
meshes[].indices [96] x6
|
||||
meshes[].positions [1044] x6
|
||||
meshes[].positions [1083]
|
||||
meshes[].positions [1086] x2
|
||||
meshes[].positions [1089]
|
||||
meshes[].positions [108] x30
|
||||
meshes[].positions [1188]
|
||||
meshes[].positions [120]
|
||||
meshes[].positions [1368] x2
|
||||
meshes[].positions [162]
|
||||
meshes[].positions [16428]
|
||||
meshes[].positions [180] x9
|
||||
meshes[].positions [1890] x3
|
||||
meshes[].positions [1908]
|
||||
meshes[].positions [2031]
|
||||
meshes[].positions [216]
|
||||
meshes[].positions [24] x1829
|
||||
meshes[].positions [24] x1058
|
||||
meshes[].positions [252] x2
|
||||
meshes[].positions [264]
|
||||
meshes[].positions [288] x8
|
||||
meshes[].positions [324] x6
|
||||
meshes[].positions [2772]
|
||||
meshes[].positions [288] x10
|
||||
meshes[].positions [324] x7
|
||||
meshes[].positions [3666]
|
||||
meshes[].positions [4128]
|
||||
meshes[].positions [4746]
|
||||
meshes[].positions [576]
|
||||
meshes[].positions [576] x3
|
||||
meshes[].positions [618] x2
|
||||
meshes[].positions [663]
|
||||
meshes[].positions [7050]
|
||||
meshes[].positions [714]
|
||||
meshes[].positions [72] x2
|
||||
meshes[].positions [77523]
|
||||
meshes[].positions [78] x55
|
||||
@@ -60,17 +86,17 @@ slabs[].outline [26] x5
|
||||
slabs[].outline [270] x5
|
||||
slabs[].outline [4] x49
|
||||
slabs[].outline[] [2] x2748
|
||||
walls [1273]
|
||||
walls [1192]
|
||||
walls[].arcCenter [2] x613
|
||||
walls[].color [3] x1273
|
||||
walls[].end [2] x1273
|
||||
walls[].endCut [4] x869
|
||||
walls[].holes [1] x88
|
||||
walls[].color [3] x1192
|
||||
walls[].end [2] x1192
|
||||
walls[].endCut [4] x831
|
||||
walls[].holes [1] x81
|
||||
walls[].holes [2] x25
|
||||
walls[].holes [3] x14
|
||||
walls[].layers [0] x1273
|
||||
walls[].start [2] x1273
|
||||
walls[].startCut [4] x873
|
||||
walls[].topDrop [2] x115
|
||||
walls[].topPlane [3] x271
|
||||
hash 5af7a0a70a5b3624
|
||||
walls[].holes [3] x8
|
||||
walls[].layers [0] x1192
|
||||
walls[].start [2] x1192
|
||||
walls[].startCut [4] x832
|
||||
walls[].topDrop [2] x89
|
||||
walls[].topPlane [3] x245
|
||||
hash 11d1505c4650cdb4
|
||||
@@ -120,7 +120,9 @@ describe("3D nach Klassen ([180])", () => {
|
||||
it("[185] Element-Auswahl: `only` zeigt nur die Wand (samt ihren Öffnungen), `hideIds` blendet sie aus — Modell, Teile und Pick", () => {
|
||||
const host = (p.openings ?? [])[0].hostWallId;
|
||||
const hostOf = new Map((p.openings ?? []).map((o) => [o.id, o.hostWallId]));
|
||||
const others = p.walls.filter((w) => w.id !== host).length;
|
||||
// [216] Wände mit Formöffnung zeigt der Viewer als Körper-Mesh, nicht als Wand-Stück.
|
||||
const shapedHosts = new Set((p.openings ?? []).filter((o) => o.shape && o.shape !== "rechteck").map((o) => o.hostWallId));
|
||||
const others = p.walls.filter((w) => w.id !== host && !shapedHosts.has(w.id)).length;
|
||||
const wallIds = (m: ReturnType<typeof projectToModel3d>) => new Set(m.walls.map((w) => w.wallId));
|
||||
const only = projectToModel3d(p, { hide: { only: [host] } });
|
||||
expect([...wallIds(only)]).toEqual([host]);
|
||||
@@ -141,6 +143,6 @@ describe("3D nach Klassen ([180])", () => {
|
||||
expect(gh.walls.some((w) => w.wallId === host)).toBe(false);
|
||||
expect(gh.openings.some((o) => hostOf.get(o.openingId) === host)).toBe(false);
|
||||
// Kein Filter: alles wieder da.
|
||||
expect(wallIds(projectToModel3d(p, { hide: { only: null, hideIds: [] } })).size).toBe(p.walls.length);
|
||||
expect(wallIds(projectToModel3d(p, { hide: { only: null, hideIds: [] } })).size).toBe(p.walls.filter((w) => !shapedHosts.has(w.id)).length);
|
||||
});
|
||||
});
|
||||
@@ -54,7 +54,7 @@ import {
|
||||
type RVec2,
|
||||
type RWall,
|
||||
} from "./toWalls3d/shared";
|
||||
import { applyVoidMeshes, type VoidMeshes } from "./toWalls3d/voids3d";
|
||||
import { applyVoidMeshes, splitWallBodies, type VoidMeshes } from "./toWalls3d/voids3d";
|
||||
|
||||
// Re-Export des gemeinsamen Vokabulars — externe Konsumenten (viewport/,
|
||||
// export/, toSection.ts, nativeSync.ts, …) importieren weiterhin
|
||||
@@ -282,6 +282,10 @@ export function projectToModel3d(project: Project, opts: Model3dOptions = {}): R
|
||||
roofLayers: parts.roofLayers,
|
||||
};
|
||||
if (parts.voidMeshes) applyVoidMeshes(model, parts.voidMeshes);
|
||||
// [216] Wände mit Formöffnungen: der Körper des Kerns statt der Stücke.
|
||||
const bodies = splitWallBodies(model.walls);
|
||||
model.walls = bodies.walls;
|
||||
for (const m of bodies.meshes) model.meshes.push(m);
|
||||
return model;
|
||||
}
|
||||
|
||||
@@ -334,7 +338,10 @@ export function projectToModel3dParts(project: Project, opts: Model3dOptions = {
|
||||
cut += `.${i - start}m${m[0]}`;
|
||||
} else walls.push(parts.walls[i]);
|
||||
}
|
||||
out.push(cut ? { id: `w${ns}${k}${cut}`, fixed: true, walls, meshes } : { id: `w${ns}${k}`, fixed: true, walls });
|
||||
// [216] Wände mit Formöffnungen: der Körper des Kerns statt der Stücke.
|
||||
const bodies = splitWallBodies(walls);
|
||||
meshes.push(...bodies.meshes);
|
||||
out.push(cut ? { id: `w${ns}${k}${cut}`, fixed: true, walls: bodies.walls, meshes } : meshes.length ? { id: `w${ns}${k}`, fixed: true, walls: bodies.walls, meshes } : { id: `w${ns}${k}`, fixed: true, walls: bodies.walls });
|
||||
}
|
||||
for (const [k, lists] of openingEntries) {
|
||||
const meshes = lists.flat();
|
||||
|
||||
@@ -169,6 +169,14 @@ export interface RWall {
|
||||
* glatt (radiale Normalen, `WallInput.arcCenter`).
|
||||
*/
|
||||
arcCenter?: [number, number];
|
||||
/**
|
||||
* [216] Wand mit Formöffnungen (Rund, Bogen …): fertiger Körper des Bandes (`body`, Manifold-Boolean im Kern, ohne
|
||||
* Stossfugen, Öffnung nach dem Umriss) am ersten Stück; `noMesh` = das Stück zeigt der Viewer nicht. Die Fassade
|
||||
* `splitWallBodies` (`toWalls3d/voids3d.ts`) gibt render3d statt der Stücke das Netz als Mesh; Schnitt und Ansicht
|
||||
* rechnen im Kern mit den Stücken.
|
||||
*/
|
||||
noMesh?: boolean;
|
||||
body?: { positions: number[]; indices: number[] };
|
||||
}
|
||||
|
||||
/** Eine extrudierte Deckenplatte: geschlossener Grundriss-Umriss + Z-Ausdehnung. */
|
||||
|
||||
@@ -29,3 +29,33 @@ export function applyVoidMeshes(model: RModel3d, cuts: VoidMeshes): void {
|
||||
});
|
||||
model.slabs = slabs;
|
||||
}
|
||||
|
||||
/** [216] Knickwinkel (Grad) der Wandkörper: Bogen-Leibungen glatt, Wand-Ecken (90°) hart. */
|
||||
const WALL_BODY_CREASE_DEG = 20;
|
||||
|
||||
/**
|
||||
* [216] Wandstücke, deren Band einen fertigen Körper hat (Wand mit Formöffnungen, Kern `model3d/wall_body.rs`):
|
||||
* render3d bekommt statt der Stücke (`noMesh`) das Netz des Körpers als Mesh; Schnitt, Ansicht und Export
|
||||
* rechnen im Kern mit den Stücken. Rest und Netze getrennt.
|
||||
*/
|
||||
export function splitWallBodies(walls: readonly RWall[]): { walls: RWall[]; meshes: RMesh[] } {
|
||||
const rest: RWall[] = [];
|
||||
const meshes: RMesh[] = [];
|
||||
for (const w of walls) {
|
||||
if (!w.noMesh) {
|
||||
rest.push(w);
|
||||
continue;
|
||||
}
|
||||
if (w.body) {
|
||||
meshes.push({
|
||||
positions: w.body.positions,
|
||||
indices: w.body.indices,
|
||||
kind: "extrusion",
|
||||
color: w.color,
|
||||
...(w.materialIndex !== undefined ? { materialIndex: w.materialIndex } : {}),
|
||||
creaseAngle: WALL_BODY_CREASE_DEG,
|
||||
});
|
||||
}
|
||||
}
|
||||
return { walls: rest, meshes };
|
||||
}
|
||||
Reference in new issue
Block a user