[176] Geknickter Schnitt: Abwicklung je Segment, Knicklinien, Werkzeug und Griffe für Knickpunkte

Kern plan/section/unfold.rs: jedes Segment schneidet mit eigener Ebene, Schnittflächen auf den u-Bereich,
Projektion an den Winkelhalbierenden zugeschnitten, Teilbilder lückenlos (u = abgewickelte Länge), dünne
Knicklinie je Knick; Öffnungen/Achsen/Bäume je Segment. Ohne bendPoints unverändert.
Schnittlinien-Befehl: weitere Klicks = Knicke, Enter/Doppelklick beendet (Ansicht weiter zwei Klicks).
Griffe: Anfang, Knicke, Ende (grips.rs sectionLineGrip).
This commit is contained in:
Claude committed 2026-11-10 16:44:09 +00:00
1 parent 718101dc12
commit bc676388bf
18 files changed
+748 -39

No files matched your search

+3
View File
@@ -386,6 +386,8 @@ export interface ProjectSlice {
moveCeilingGrip: (ceilingId: string, index: number, pt: Vec2) => void;
/** [68] Baugrube: Umriss-Ecke ziehen (Index = Ecke; Index = Eckenzahl: Sohlenhöhe). */
moveExcavationGrip: (id: string, index: number, pt: Vec2) => void;
/** [176] Griff einer Schnittlinie: 0 = Anfang, dann die Knickpunkte, zuletzt das Ende. */
moveSectionLineGrip: (id: string, index: number, pt: Vec2) => void;
moveExcavationEdge: (id: string, aIndex: number, bIndex: number, delta: Vec2) => void;
/** Verschiebt eine Decke (ganzer Umriss) um `delta`. */
moveCeilingBy: (ceilingId: string, delta: Vec2) => void;
@@ -1240,6 +1242,7 @@ export function createProjectSlice(
applyGrip({ op: "ceilingGrip", id: ceilingId, index, pt: gripPt(pt) }, `moveCeilingGrip:${ceilingId}:${index}`),
moveExcavationGrip: (id, index, pt) => applyGrip({ op: "excavationGrip", id, index, pt: gripPt(pt) }, `moveExcavationGrip:${id}:${index}`),
moveSectionLineGrip: (id, index, pt) => applyGrip({ op: "sectionLineGrip", id, index, pt: gripPt(pt) }, `moveSectionLineGrip:${id}:${index}`),
moveExcavationEdge: (id, aIndex, bIndex, delta) =>
applyGrip({ op: "excavationEdge", id, a: aIndex, b: bIndex, delta: gripPt(delta) }, `moveExcavationEdge:${id}:${aIndex}:${bIndex}`),
+17
View File
@@ -176,6 +176,13 @@ export function useGripEditing(opts: {
// [149] Baum: Griff in der Stammmitte (verschieben) und am Kronenrand (Kronendurchmesser).
const selectedTreeId = single(selection, "trees");
const selectedTree = selectedTreeId ? (project.trees ?? []).find((x) => x.id === selectedTreeId) : undefined;
// [176] Schnitt-/Ansichtslinie im Grundriss: Griffe an Anfang, Knickpunkten (`bendPoints`) und Ende.
const selectedSectionLineId = single(selection, "sectionLines");
const selectedSectionLine = modelEditable && selectedSectionLineId
? project.drawingLevels.find((l) => l.id === selectedSectionLineId && l.linePoints)
: undefined;
const sectionLineGrips = (l: NonNullable<typeof selectedSectionLine>): Vec2[] =>
l.linePoints ? [l.linePoints[0], ...(l.bendPoints ?? []), l.linePoints[1]] : [];
// Mit gezeigter Beschriftung dazu ihr Griff (`labelOffset`, s. `treeGrips.ts`).
const treeGrips = (tr: NonNullable<typeof selectedTree>): Vec2[] => treeGripPoints(tr, scaleDenominator);
const selectedRoomId = single(selection, "rooms");
@@ -315,6 +322,11 @@ export function useGripEditing(opts: {
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
return pts;
}
if (selectedSectionLine && effectiveDrawingIds.length === 0 && selectedWallIds.length === 0) {
const pts = sectionLineGrips(selectedSectionLine);
pts.forEach((_, i) => { gripOwners.push({ localIndex: i }); gripOwnerRange.push([0, pts.length - 1]); });
return pts;
}
// [68] Baugrube: Umriss-Ecken + Sohlen-Griff (Lage: Schwerpunkt, y um die Sohlenhöhe versetzt).
if (modelEditable && selectedExcavation && !selectedCeiling && effectiveDrawingIds.length === 0 && selectedWallIds.length === 0) {
const pts = excavationGripPoints(selectedExcavation);
@@ -911,6 +923,11 @@ export function useGripEditing(opts: {
storeState().applyChange((p) => patchItem(p, "trees", tr.id, patch), `treeGrip:${tr.id}:${index}`);
return;
}
// [176] Schnittlinie: Endpunkt bzw. Knickpunkt live, ein Undo-Schritt je Zug (Kern `grips.rs`).
if (selectedSectionLine && effectiveDrawingIds.length === 0 && selectedWallIds.length === 0) {
storeState().moveSectionLineGrip(selectedSectionLine.id, index, pt);
return;
}
// [68] Baugrube: Sohlen-Griff sofort (Höhe), Ecken als Vorschau bis zum Setzen.
if (selectedExcavation && !selectedCeilingId && !selectedRoomId) {
if (index >= selectedExcavation.outline.length) moveExcavationGrip(selectedExcavation.id, index, pt);