Compare commits

...

2 Commits

Author SHA1 Message Date
Agent Zero c3b976758c docs: roadmap log E2 arc-row 2026-08-27 22:49:09 +02:00
Agent Zero 633cf3d647 task(E2): arc-row tool for curved seating around stage 2026-08-27 22:49:09 +02:00
3 changed files with 98 additions and 1 deletions
+1
View File
@@ -704,6 +704,7 @@ Format: `YYYY-MM-DD | TASK-ID | was getan | Tests Ergebnis | commit | Notizen/of
| 2026-08-27 | D-ext3 | join/explode/align in core-modify v1.8.0: join=Selektions-Linien→Polyline (Punkte gesammelt), explode=Polyline→Einzelsegmente (Original entfernt), align=Element auf Ziel-Position verschieben; alle via doc.transact=undo-faehig; core-modify tools jetzt 19 | ALLE GRUEN: 485/485 gesamt, tsc 0, build OK | b470ac3 | D-EXT3 COMPLETE |
| 2026-08-27 | D-fin | polyline-edit + stretch + break in core-modify v1.9.0: polyline-edit (Vertex ziehen mit Preview + doc.updateElement), stretch (Endpunkte in Basisnähe verschieben), break (Linie am Klickpunkt teilen — Original entfernt, 2 neue hinzugefuegt); core-modify tools jetzt 22 | ALLE GRUEN: 485/485 gesamt, tsc 0, build OK | 5500462 | **PHASE D COMPLETE** — core-modify deckt vollstaendigen CAD-Standardumfang ab |
| 2026-08-27 | E1 | seating-row + seating-block auf Drag-Interaktion umgestellt (Klick1=Start, Drag=Preview, up=Commit); spacing/colSpacing/rowSpacing aus Options-Schema; count aus Distanz berechnet; A4.9-Tests an Drag-Verhalten angepasst; 4 neue Tests (row Laenge+undo, row cancel, block rows×cols+undo, BUG-1-Regression) | ALLE GRUEN: 488/488 gesamt (+3), tsc 0, build OK | siehe git | E1 COMPLETE |
| 2026-08-27 | E2 | createArcRow in SeatingService + arcRowTool in event-tools: 3-Klick-Sequenz (Zentrum→Radius→Endwinkel), Stuehle tangential rotiert (angle+90), spacing aus Options, rowId unique; klick-progressiv wie Arc-Lektion | ALLE GRUEN: 488/488 gesamt, tsc 0, build OK | siehe git | E2 COMPLETE |
| 2026-08-27 | C3 | elementToPrimitives erweitert um fehlende Typen: dimension (Linie + Label aus value/text), leader (Linie + Label am Ende), revcloud (geschlossener Punktzug), chair (gefuelltes Rechteck #4a90d9), table (Kreis #8b7355), stage (dunkles Rechteck #3a3a4a); Legacy-Konventionen beibehalten; 6 neue Tests | ALLE GRUEN: 481/481 gesamt (+6), tsc 0, build OK | siehe git | Naechster Task: C4 (Flag-Umdrehung Pixi=Default) oder Selection-Handles/Snap-Marks |
## Gefundene Nebenprobleme (noch nicht zugewiesen)
@@ -186,6 +186,61 @@ export const tableTool = makePlaceTool('table', 'Tisch', '\u25cb',
export const stageTool = makePlaceTool('stage', 'Bühne', '\u25ad',
(x, y, layerId) => seating.createStage(x, y, layerId), 'Bühne');
// ─────────────────────────────────────────────────────────────
// Arc-Row (Task E2): Reihen entlang Kreisbogen um Bühnenpunkt.
// Klick 1: Zentrum (Bühne). Drag: Radius + Startwinkel.
// Klick 2: Endwinkel → Commit.
// Phasen: 0=Zentrum setzen, 1=Radius+Start, 2=Endwinkel → commit
// ─────────────────────────────────────────────────────────────
let arcCenter: Pt | null = null;
let arcStartPt: Pt | null = null;
let arcPhase = 0;
export const arcRowTool: ToolExtensionV2 = {
manifest: {
id: 'arc-row',
label: 'Arc-Row',
icon: '\u2312',
ribbonTab: 'insert',
tags: ['basic'],
description: 'Bogenreihe: Zentrum, Startpunkt, Endpunkt klicken',
},
optionsSchema: [
{ key: 'arcSpacing', label: 'Abstand (cm)', type: 'number', min: 20, max: 200 },
],
handlers: {
down(e, ctx) {
const c = ctx as FullToolContext;
const { layerId } = optsOf(c);
const spacing = (c.options.arcSpacing as number | undefined) ?? 50;
if (arcPhase === 0) {
arcCenter = e.world;
arcPhase = 1;
ctx.setStatus('Arc-Row: Radius ziehen (Startpunkt)');
} else if (arcPhase === 1 && arcCenter) {
arcStartPt = e.world;
arcPhase = 2;
ctx.setStatus('Arc-Row: Endwinkel klicken');
} else if (arcPhase === 2 && arcCenter && arcStartPt && c.doc) {
const els = seating.createArcRow(arcCenter.x, arcCenter.y, Math.hypot(arcStartPt.x - arcCenter.x, arcStartPt.y - arcCenter.y),
(Math.atan2(arcStartPt.y - arcCenter.y, arcStartPt.x - arcCenter.x) * 180) / Math.PI,
(Math.atan2(e.world.y - arcCenter.y, e.world.x - arcCenter.x) * 180) / Math.PI,
layerId, spacing);
c.doc.transact(() => {
for (const el of els) c.doc!.addElement(el);
});
ctx.setStatus(`Arc-Row: ${els.length} Stühle platziert`);
arcPhase = 0; arcCenter = null; arcStartPt = null;
}
},
cancel(ctx) {
arcPhase = 0; arcCenter = null; arcStartPt = null;
ctx.setPreview?.(null);
ctx.setStatus('Arc-Row abgebrochen');
},
},
};
/** V2-Plugin: Event-Domain (Tasks A4.9 + E1). */
export const eventToolsV2Plugin: PluginV2 = {
manifest: {
@@ -197,5 +252,5 @@ export const eventToolsV2Plugin: PluginV2 = {
category: 'elements',
enabledByDefault: true,
},
tools: [chairTool, seatingRowToolDrag, seatingBlockToolDrag, tableTool, stageTool],
tools: [chairTool, seatingRowToolDrag, seatingBlockToolDrag, tableTool, stageTool, arcRowTool],
};
+41
View File
@@ -280,6 +280,47 @@ export class SeatingService {
return elements;
}
/** Create an arc row (curved seating around a center point) — Task E2 */
createArcRow(
centerX: number,
centerY: number,
radius: number,
startAngleDeg: number,
endAngleDeg: number,
layerId: string,
spacing = 50,
): CADElement[] {
const arcLen = Math.abs(endAngleDeg - startAngleDeg) * Math.PI / 180 * radius;
const count = Math.max(2, Math.floor(arcLen / spacing));
const rowId = `arcrow_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
const elements: CADElement[] = [];
for (let i = 0; i <= count; i++) {
const angle = startAngleDeg + (endAngleDeg - startAngleDeg) * (i / count);
const rad = angle * Math.PI / 180;
const px = centerX + radius * Math.cos(rad);
const py = centerY + radius * Math.sin(rad);
elements.push({
id: this.generateId(),
type: 'chair',
layerId,
x: px,
y: py,
width: 45,
height: 45,
properties: {
rotation: angle + 90,
fill: '#4a90d9',
backrestColor: '#3a7ac9',
outlineColor: '#2a5a99',
seatType: 'standard',
rowIndex: i,
rowId,
},
});
}
return elements;
}
/** Create a table element */
createTable(x: number, y: number, layerId: string, config: Partial<TableConfig> = {}): CADElement {
const cfg = { ...DEFAULT_TABLE, ...config };