Schnitt: Treppe anwaehlbar (stairId an den Cut-Flaechen) und waagrecht ziehbar

This commit is contained in:
karim committed 2026-10-21 21:16:37 +02:00
1 parent e4641357fd
commit 5d1d3ba3f7
5 files changed
+29 -5

No files matched your search

+5
View File
@@ -612,6 +612,8 @@ export interface BodyTarget {
openingId?: string;
/** Nur im Schnitt/in der Ansicht (`sheetBodies`). */
ceilingId?: string;
/** Nur im Schnitt/in der Ansicht (`sheetBodies`). */
stairId?: string;
}
export interface GripHandlers {
@@ -1777,6 +1779,9 @@ export const PlanView = forwardRef<PlanViewHandle, PlanViewProps>(
if (p && p.kind === "polygon" && p.ceilingId && selectedCeilingIds?.includes(p.ceilingId)) {
return { ceilingId: p.ceilingId };
}
if (p && p.kind === "polygon" && p.stairId && selectedStairIds?.includes(p.stairId)) {
return { stairId: p.stairId };
}
}
const selWalls = new Set(selectedWallIds ?? []);
if (selWalls.size) {
+2 -1
View File
@@ -922,8 +922,9 @@ export function generateSectionPlan(
strokeWidthMm: SECTION_CUT_OUTLINE_MM,
hatch: mono ? monoHatch : hatch,
wallId: kind === "wall" ? sourceId : undefined,
ceilingId: kind === "slab" ? sourceId : undefined,
ceilingId: kind === "slab" && !cp.stairId ? sourceId : undefined,
roofId: kind === "roof" ? sourceId : undefined,
stairId: cp.stairId,
greyed: cp.categoryCode !== undefined && catDisplay(cp.categoryCode).greyed,
});
}
+16
View File
@@ -95,6 +95,12 @@ export interface SectionCutPolygon {
* Grundriss. Fehlt (unauflösbares Bauteil), bleibt das Band immer sichtbar.
*/
categoryCode?: string;
/**
* Quell-Treppe (Tritt-/Podest-Prisma einer Treppe, s. `emitStairs` —
* `RSlab.ceilingId` trägt dort die Treppen-ID). Macht die geschnittene Treppe
* im Schnitt anwählbar.
*/
stairId?: string;
}
/** Ein projiziertes Liniensegment in (u, v)-Metern. */
@@ -1213,6 +1219,16 @@ export async function computeSection(
// Monolithische Bauteile aus mehreren Prismen (Treppen-Tritte): ihre Schnitt-
// Rechtecke zu EINEM Umriss vereinen — sonst je Tritt ein eigenes,
// überlappendes Schraffur-Rechteck mit Kontur ("gestapelte Kistchen").
// Treppen-Prismen: Herkunft + Kategorie nachtragen (attachCutStyles kennt
// nur Decken), damit die geschnittene Treppe anwählbar/filterbar ist.
const stairsById = new Map((project.stairs ?? []).map((st) => [st.id, st]));
for (const cp of output.cutPolygons) {
if (cp.component.kind !== "slab") continue;
const st = stairsById.get(model.slabs[cp.component.index]?.ceilingId ?? "");
if (!st) continue;
cp.stairId = st.id;
cp.categoryCode = st.categoryCode;
}
output.cutPolygons = mergeMonolithCuts(output.cutPolygons, (i) => model.slabs[i]?.monolith);
// Schnitt-Tiefe: Kanten weiter als `level.depth` hinter der Ebene ausblenden.
if (level.depth !== undefined) filterByDepth(output, project, plane, level.depth);
+4 -3
View File
@@ -1124,8 +1124,9 @@ export function useGripEditing(opts: {
}
const wallId = target ? target.wallId ?? null : selectedWallId;
const ceilingId = target ? target.ceilingId ?? null : !wallId ? selectedCeilingId : null;
const kind = wallId ? "wall" : ceilingId ? "ceiling" : null;
const id = wallId ?? ceilingId;
const stairId = target ? target.stairId ?? null : !wallId && !ceilingId ? selectedStairId : null;
const kind = wallId ? "wall" : ceilingId ? "ceiling" : stairId ? "stair" : null;
const id = wallId ?? ceilingId ?? stairId;
if (!kind || !id) return;
if (kind === "wall" && project.walls.find((w) => w.id === id)?.locked) return;
const prevDu = sheetDuRef.current && sheetDuRef.current.id === id ? sheetDuRef.current.du : 0;
@@ -1136,7 +1137,7 @@ export function useGripEditing(opts: {
if (moveCoincidentRef.current === null) moveCoincidentRef.current = findMoveCoincident2D(null, id);
pendingWallMoveRef.current = { wallId: id, total };
} else {
pendingAreaMoveRef.current = { kind: "ceiling", id, total };
pendingAreaMoveRef.current = { kind, id, total };
}
const preview: DraftShape[] = sheetOwnerOutlines(sh.levelId, kind, id).map((pts) => ({
kind: "poly",
+2 -1
View File
@@ -60,7 +60,7 @@ export function snapSegmentsFromPrimitives(prims: readonly Primitive[]): SnapSeg
}
/** Bauteil-Art, deren Schnittflächen im Blatt gezogen werden können. */
export type SheetOwnerKind = "wall" | "ceiling" | "opening";
export type SheetOwnerKind = "wall" | "ceiling" | "opening" | "stair";
/**
* Schnittflächen der Ebene `levelId` je Quell-Bauteil ablegen (aus den Plan-
@@ -80,6 +80,7 @@ export function setSheetOwnerOutlines(levelId: string, prims: readonly Primitive
for (const p of prims) {
if (p.kind !== "polygon") continue;
if (p.openingId) add(`opening:${p.openingId}`, p.pts);
else if (p.stairId) add(`stair:${p.stairId}`, p.pts);
else if (p.wallId) add(`wall:${p.wallId}`, p.pts);
else if (p.ceilingId) add(`ceiling:${p.ceilingId}`, p.pts);
}