[77] Objekt-Info: Fläche geschlossener 2D-Formen (Bögen exakt, abzüglich Löcher)

This commit is contained in:
Claude committed 2026-11-05 04:30:23 +00:00
1 parent 9afa9204b4
commit c288dd31f1
7 files changed
+82 -3

No files matched your search

+1
View File
@@ -591,6 +591,7 @@ export const de = {
"objinfo.ceiling.openings": "Aussparungen",
"objinfo.ceiling.removeOpening": "Aussparung entfernen",
"objinfo.ceiling.area": "Fläche",
"objinfo.drawing.area": "Fläche",
"objinfo.ceiling.anchorFloor": "Gebunden",
"objinfo.ceiling.anchorCustom": "Eigene",
// ── Öffnungs-Attribute (Object-Info-Panel) ──────────────────────────────
+1
View File
@@ -590,6 +590,7 @@ export const en: Record<TranslationKey, string> = {
"objinfo.ceiling.openings": "Openings",
"objinfo.ceiling.removeOpening": "Remove opening",
"objinfo.ceiling.area": "Area",
"objinfo.drawing.area": "Area",
"objinfo.ceiling.anchorFloor": "Bound",
"objinfo.ceiling.anchorCustom": "Custom",
// ── Opening attributes (object info panel) ──────────────────────────────
+6
View File
@@ -287,6 +287,12 @@ export function ObjectInfoPanel() {
onCommit={(v) => host.onSetDrawingTextPaperHeight(v)}
/>
)}
{sel.kind === "drawing2d" && sel.area !== undefined && (
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.drawing.area")}</span>
<span className="objinfo-fval">{sel.area.toFixed(2)} m²</span>
</div>
)}
{drawingShape === "circle" && (
<DimensionField
label={t("objinfo.drawing.radius")}
+2
View File
@@ -42,6 +42,8 @@ describe("deriveSelection (Kern)", () => {
expect(l.bbox).toEqual({ minX: 0, minY: -2, maxX: 3, maxY: 0 });
const r = deriveSelection(p, { drawings: ["r"] })!;
expect(r.closed).toBe(true);
expect(r.area).toBe(3);
expect(l.area).toBeUndefined();
expect(r.fillHatchId).toBe("h");
expect(r.effectiveHatchId).toBe("h");
expect(deriveSelection(p, { drawings: ["nix"] })).toBeNull();
+2
View File
@@ -457,6 +457,8 @@ export interface SelectionInfo {
effectiveHatchId?: string | null;
/** Ob die Form geschlossen ist (rect/circle/closed polyline) — nur Drawing2D. */
closed?: boolean;
/** Fläche in m² (geschlossene Form: rect/circle/ellipse/Polylinie inkl. Bögen, netto ohne Löcher) — nur Drawing2D. */
area?: number;
/**
* Ob das Element ein Bild ist (Drawing2D `{shape:"image"}`, Layout-
* Annotation `kind:"image"` ODER Kontext-Objekt `type:"image"`) — steuert