Kern/Huelle Phase A.3-5: Fassade src/core, Hueller-Importe aus plan/ und geometry/ darauf umgestellt, Waechter-Test (Kern importiert keine Huelle, Huelle nur ueber core), Plattform-Adapter (projectFile, saveFile, colorIcc) nach native/, Kern laeuft headless

This commit is contained in:
karim committed 2026-10-27 19:30:47 +01:00
1 parent b00bef0959
commit a9a1632260
83 files changed
+690 -240

No files matched your search

+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env python3
"""Erzeugt src/core/index.ts aus den Importen der Hülle in plan/ und geometry/ und schreibt die
Importe der Hülle auf "core" um (Phase A der Kern/UI-Trennung, docs/core-ui-split.md).
Aufruf: scripts/core-facade.py [--dry]"""
import re, glob, os, sys, collections
SHELL = ['ui','panels','views','menus','editors','viewport','native','tools','state','commands']
FACADE_DIRS = ('plan', 'geometry')
imp_re = re.compile(r'''import\s+(type\s+)?\{([^}]*)\}\s+from\s+["'](\.[^"']*)["'];?[ \t]*\n''', re.S)
# Namen, die ein Modul nur weiterreicht — kanonisch aus dem Ursprungsmodul exportieren.
CANON = {
'buildDrawingIndex': 'src/geometry/drawingIndex', 'DrawingIndex': 'src/geometry/drawingIndex',
'drawingsWithinDistance': 'src/geometry/drawingIndex', 'nearestInDrawings': 'src/geometry/drawingIndex',
'Primitive': 'src/plan/generatePlan/shared',
}
def shell_file(f):
parts = f.split('/')
top = parts[1] if len(parts) > 2 else parts[1].split('.')[0]
return top in SHELL or top in ('App', 'main')
uses = collections.defaultdict(dict) # name -> {module: is_type_only}
edits = {}
for f in glob.glob('src/**/*.ts*', recursive=True):
if '.test.' in f or not shell_file(f): continue
s = open(f).read()
out = s
for m in imp_re.finditer(s):
tgt = os.path.normpath(os.path.join(os.path.dirname(f), m.group(3)))
tp = tgt.split('/')
if len(tp) < 3 or tp[0] != 'src' or tp[1] not in FACADE_DIRS: continue
all_type = bool(m.group(1))
for raw in m.group(2).split(','):
raw = raw.strip()
if not raw: continue
is_t = all_type or raw.startswith('type ')
nm = raw[5:].strip() if raw.startswith('type ') else raw
orig = nm.split(' as ')[0].strip()
tgt2 = CANON.get(orig, tgt)
prev = uses[orig].get(tgt2)
uses[orig][tgt2] = (prev if prev is not None else True) and is_t
edits[f] = s
# Kollisionen: gleicher Name aus mehreren Modulen
coll = {n: m for n, m in uses.items() if len(m) > 1}
if coll:
print('Namenskollisionen (werden mit Modul-Präfix aliasiert):')
for n, m in coll.items(): print(' ', n, list(m))
def alias(n, mod):
if n not in coll: return n
return n + '__' + re.sub(r'\W+', '_', mod[len('src/'):])
lines = ['// Fassade des Kerns für die Hülle (Phase A der Kern/UI-Trennung, docs/core-ui-split.md).',
'// Dünne Durchreichung, Namen 1:1; die Hülle importiert Plan-/Geometrie-Funktionen nur noch von hier.',
'// Erzeugt mit scripts/core-facade.py — neue Einträge von Hand ergänzen.', '']
bymod = collections.defaultdict(list)
for n, mods in uses.items():
for mod, is_t in mods.items(): bymod[mod].append((n, is_t))
for mod in sorted(bymod):
rel = '../' + mod[len('src/'):]
items = []
for n, is_t in sorted(bymod[mod]):
a = alias(n, mod)
core = f'{n} as {a}' if a != n else n
items.append(('type ' if is_t else '') + core)
lines.append('export {\n ' + ',\n '.join(items) + f',\n}} from "{rel}";')
lines.append('')
os.makedirs('src/core', exist_ok=True)
if '--dry' not in sys.argv:
open('src/core/index.ts', 'w').write('\n'.join(lines))
def rel_core(f):
r = os.path.relpath('src/core', os.path.dirname(f))
return r if r.startswith('.') else './' + r
changed = 0
if '--dry' not in sys.argv:
for f, s in edits.items():
keep_stmts = []
core_items = []
def fix(m):
tgt = os.path.normpath(os.path.join(os.path.dirname(f), m.group(3)))
tp = tgt.split('/')
if len(tp) < 3 or tp[0] != 'src' or tp[1] not in FACADE_DIRS: return m.group(0)
all_type = bool(m.group(1))
items = []
for raw in m.group(2).split(','):
raw = raw.strip()
if not raw: continue
is_t = all_type or raw.startswith('type ')
nm = raw[5:].strip() if raw.startswith('type ') else raw
orig, _, loc = nm.partition(' as ')
a = alias(orig.strip(), CANON.get(orig.strip(), tgt))
spec = (a if a == orig.strip() else f'{a} as {orig.strip()}') if not loc else f'{a} as {loc.strip()}'
items.append(('type ' if is_t and not all_type else '') + spec)
kw = 'import type' if all_type else 'import'
return f'{kw} {{ {", ".join(items)} }} from "{rel_core(f)}";\n'
n = imp_re.sub(fix, s)
if n != s:
open(f, 'w').write(n); changed += 1
print('umgeschrieben:', changed, 'Dateien;', len(uses), 'Namen')
+6 -6
View File
@@ -34,10 +34,10 @@ import type {
} from "./model/types";
import { activePenSet, resolvePenColor, resolvePenWeight } from "./model/penSets";
import { PenColorField } from "./ui/PenColorField";
import { generatePlan } from "./plan/generatePlan";
import type { CategoryDisplayResolver } from "./plan/generatePlan";
import { sectionPlaneFromLevel, sectionUAxisModel } from "./plan/toSection";
import { roofBaseElevation, roofGeometry } from "./geometry/roof";
import { generatePlan } from "./core";
import type { CategoryDisplayResolver } from "./core";
import { sectionPlaneFromLevel, sectionUAxisModel } from "./core";
import { roofBaseElevation, roofGeometry } from "./core";
import { setDxfImportTrigger } from "./io/dxfImportHook";
import { ImportDialog } from "./ui/ImportDialog";
import { BusyOverlay } from "./ui/BusyOverlay";
@@ -51,7 +51,7 @@ import { LockConflictDialog } from "./ui/LockConflictDialog";
import { UnsavedChangesDialog } from "./ui/UnsavedChangesDialog";
import { RecoverAutosaveDialog } from "./ui/RecoverAutosaveDialog";
import { Toast } from "./ui/Toast";
import { isTauriRuntime, PROJECT_TEMPLATE_EXT } from "./io/projectFile";
import { isTauriRuntime, PROJECT_TEMPLATE_EXT } from "./native/projectFile";
import { stepTextToImportedMeshes } from "./io/stepImport";
import { applyClashMarkers, runClashCheck } from "./analysis/clash";
import { checkForUpdate } from "./update/checkForUpdate";
@@ -204,7 +204,7 @@ import { PanelHostContext } from "./panels/types";
import { hostWithMode } from "./panels/host";
import { deriveSelection } from "./state/selectionInfo";
import type { Selection } from "./state/selectionInfo";
import { centroid as roomCentroid } from "./geometry/roomArea";
import { centroid as roomCentroid } from "./core";
import { docFromText, plainText, DEFAULT_PRESETS } from "./text/richText";
import type { RichTextDoc } from "./text/richText";
import { revealPanel, saveLayout } from "./panels/layout";
+1 -5
View File
@@ -33,11 +33,7 @@
import type { Drawing2D } from "../../model/types";
import { uniqueId } from "../../tools/types";
import {
arcFromStartEndDirection,
arcFromStartEndRadius,
arcThroughPoints,
} from "../../geometry/bulge";
import { arcFromStartEndDirection, arcFromStartEndRadius, arcThroughPoints } from "../../core";
import type {
Command,
CommandContext,
+1 -1
View File
@@ -9,7 +9,7 @@
import type { Drawing2D } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { sampleBezierChain } from "../../geometry/curves";
import { sampleBezierChain } from "../../core";
import type {
Command,
CommandContext,
+2 -2
View File
@@ -20,8 +20,8 @@
import type { Drawing2D } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { breakCurve, nearestOnPolyline } from "../../geometry/kernel2d";
import { hasRealBulge } from "../../geometry/bulge";
import { breakCurve, nearestOnPolyline } from "../../core";
import { hasRealBulge } from "../../core";
import { chainToGeom, geomToCurve, isTrimmable, pickCurveAt } from "./trim";
import type {
Command,
+1 -1
View File
@@ -16,7 +16,7 @@
// • categoryCode← "30" (Ebene „Decken"; Fallback ctx.defaultCategoryCode)
import type { Ceiling } from "../../model/types";
import { normalizeOutline, ceilingArea } from "../../geometry/ceiling";
import { normalizeOutline, ceilingArea } from "../../core";
import { uniqueId } from "../../tools/types";
import type {
Command,
+1 -1
View File
@@ -8,7 +8,7 @@
// 1) „Erste Ecke der Aussparung:" → Punkt
// 2) „Gegenecke:" → Live-Rechteck-Vorschau; Klick committet.
import { pointInOutline } from "../../geometry/ceiling";
import { pointInOutline } from "../../core";
import type {
Command,
CommandContext,
+2 -2
View File
@@ -9,8 +9,8 @@
// ist von Natur aus gerade, also ein exaktes (nicht approximiertes) Ergebnis.
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { hasRealBulge } from "../../geometry/bulge";
import { chamferCorner, type Chamfer } from "../../geometry/kernel2d";
import { hasRealBulge } from "../../core";
import { chamferCorner, type Chamfer } from "../../core";
import type {
Command,
CommandContext,
+2 -7
View File
@@ -37,13 +37,8 @@
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { arcThroughPoints } from "../../geometry/bulge";
import {
pointSegmentDistance,
polylineEdges,
tangentCircleCenters,
type TangentTarget,
} from "../../geometry/kernel2d";
import { arcThroughPoints } from "../../core";
import { pointSegmentDistance, polylineEdges, tangentCircleCenters, type TangentTarget } from "../../core";
import type {
CmdOption,
Command,
+1 -1
View File
@@ -15,7 +15,7 @@
import type { Column, ColumnProfile } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { columnFootprint } from "../../geometry/column";
import { columnFootprint } from "../../core";
import type {
Command,
CommandContext,
+1 -1
View File
@@ -11,7 +11,7 @@
// Leere/rein-block-Auswahl → No-Op (kein Commit).
import type { BlockDef, Drawing2D } from "../../model/types";
import { mvGeom } from "../../geometry/geomTransform";
import { mvGeom } from "../../core";
import { uniqueId } from "../../tools/types";
import type {
Command,
+1 -1
View File
@@ -21,7 +21,7 @@
import type { Drawing2D } from "../../model/types";
import { segmentHud, uniqueId } from "../../tools/types";
import { ellipsePts } from "../../geometry/curves";
import { ellipsePts } from "../../core";
import type {
CmdOption,
Command,
+2 -7
View File
@@ -23,13 +23,8 @@
// Bezeichner englisch, Kommentare/UI deutsch (CONVENTIONS.md).
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { bulgeArcPoints, hasRealBulge } from "../../geometry/bulge";
import {
extendBulgeSegment,
extendSegment,
pointSegmentDistance,
polylineEdges,
} from "../../geometry/kernel2d";
import { bulgeArcPoints, hasRealBulge } from "../../core";
import { extendBulgeSegment, extendSegment, pointSegmentDistance, polylineEdges } from "../../core";
import type {
Command,
CommandResult,
+1 -1
View File
@@ -15,7 +15,7 @@
import type { Drawing2D, ExtrudedSolid } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { polylineEdges, pointSegmentDistance } from "../../geometry/kernel2d";
import { polylineEdges, pointSegmentDistance } from "../../core";
import type {
Command,
CommandContext,
+2 -2
View File
@@ -15,8 +15,8 @@
// einer polyline (kein reines Rechteck mehr).
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { bulgeFromSagittaPoint, hasRealBulge } from "../../geometry/bulge";
import { filletCorner, type Fillet } from "../../geometry/kernel2d";
import { bulgeFromSagittaPoint, hasRealBulge } from "../../core";
import { filletCorner, type Fillet } from "../../core";
import type {
Command,
CommandContext,
+1 -1
View File
@@ -18,7 +18,7 @@
import type { Drawing2D } from "../../model/types";
import { segmentHud, uniqueId } from "../../tools/types";
import { leftNormal, normalize, sub } from "../../model/geometry";
import { offsetSegment } from "../../geometry/kernel2d";
import { offsetSegment } from "../../core";
import type {
CmdOption,
Command,
+2 -8
View File
@@ -14,16 +14,10 @@
// Vorzeichen, wenn negativ getippt.
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { bulgeArcPoints, hasRealBulge } from "../../geometry/bulge";
import { bulgeArcPoints, hasRealBulge } from "../../core";
import { uniqueId } from "../../tools/types";
import { leftNormal, normalize, sub } from "../../model/geometry";
import {
offsetPolyline,
offsetPolylineWithBulge,
offsetSegment,
pointSegmentDistance,
polylineEdges,
} from "../../geometry/kernel2d";
import { offsetPolyline, offsetPolylineWithBulge, offsetSegment, pointSegmentDistance, polylineEdges } from "../../core";
import type {
CmdInput,
Command,
+1 -1
View File
@@ -19,7 +19,7 @@
// Tangenten-Referenz und bleibt gerade.
import type { Drawing2D } from "../../model/types";
import { bulgeArcPoints, bulgeThroughPoint } from "../../geometry/bulge";
import { bulgeArcPoints, bulgeThroughPoint } from "../../core";
import { segmentHud, uniqueId } from "../../tools/types";
import type {
Command,
+2 -2
View File
@@ -31,8 +31,8 @@
import type { Drawing2D } from "../../model/types";
import { deltaHud, segmentHud, uniqueId } from "../../tools/types";
import { filletCorner } from "../../geometry/kernel2d";
import { bulgeArcPoints, bulgeThroughPoint } from "../../geometry/bulge";
import { filletCorner } from "../../core";
import { bulgeArcPoints, bulgeThroughPoint } from "../../core";
import type {
Command,
CommandContext,
+2 -2
View File
@@ -9,8 +9,8 @@
// Aufrufe hinweg (wie `lastSides` bei `polygon.ts`).
import type { Drawing2D } from "../../model/types";
import { bulgeArcPoints } from "../../geometry/bulge";
import { revisionCloudPts } from "../../geometry/revisionCloud";
import { bulgeArcPoints } from "../../core";
import { revisionCloudPts } from "../../core";
import { segmentHud, uniqueId } from "../../tools/types";
import type {
CmdOption,
+2 -2
View File
@@ -19,8 +19,8 @@
import type { Room } from "../../model/types";
import { wallTypeThickness } from "../../model/types";
import { roomFromPointInside, type WallSegment } from "../../geometry/roomBoundary";
import { polygonArea, centroid } from "../../geometry/roomArea";
import { roomFromPointInside, type WallSegment } from "../../core";
import { polygonArea, centroid } from "../../core";
import { docFromText } from "../../text/richText";
import { uniqueId } from "../../tools/types";
import type {
+1 -1
View File
@@ -10,7 +10,7 @@
import type { ExtrudedSolid, Vec2 } from "../../model/types";
import { getFloor } from "../../model/types";
import { uniqueId } from "../../tools/types";
import { extrudedSolidSpec } from "../../plan/extrudedSolidSpec";
import { extrudedSolidSpec } from "../../core";
import type { Command, CommandResult, CommandState, CmdOption, Project, ToolDraft } from "../types";
export type SolidBoolOp = "union" | "difference" | "intersection";
+1 -1
View File
@@ -17,7 +17,7 @@
import type { Drawing2D } from "../../model/types";
import { segmentHud, uniqueId } from "../../tools/types";
import { sampleCatmullRom, sampleUniformBSpline } from "../../geometry/curves";
import { sampleCatmullRom, sampleUniformBSpline } from "../../core";
import type {
Command,
CommandContext,
+1 -1
View File
@@ -20,7 +20,7 @@
// Bezeichner englisch, sichtbarer Text via t() (CONVENTIONS.md).
import type { Stair, StairShape, Vec2 as MVec2 } from "../../model/types";
import { stairGeometry, defaultStepCount, IDEAL_TREAD, MIN_STEPS } from "../../geometry/stair";
import { stairGeometry, defaultStepCount, IDEAL_TREAD, MIN_STEPS } from "../../core";
import { uniqueId } from "../../tools/types";
import type {
Command,
+2 -7
View File
@@ -19,14 +19,9 @@
// Bezeichner englisch, Kommentare/UI deutsch (CONVENTIONS.md).
import type { Drawing2D, Drawing2DGeom } from "../../model/types";
import { bulgeArcPoints, hasRealBulge } from "../../geometry/bulge";
import { bulgeArcPoints, hasRealBulge } from "../../core";
import { uniqueId } from "../../tools/types";
import {
pointSegmentDistance,
polylineEdges,
trimPolylineWithBulge,
vecEqual,
} from "../../geometry/kernel2d";
import { pointSegmentDistance, polylineEdges, trimPolylineWithBulge, vecEqual } from "../../core";
import type {
Command,
CommandResult,
+105
View File
@@ -0,0 +1,105 @@
// Wächter für die Kern/Hülle-Grenze (docs/core-ui-split.md, Phase A). Es gibt kein ESLint im
// Projekt — die Regeln laufen deshalb als Test über die Importzeilen aller Quelldateien.
//
// 1. Der KERN (model, geometry, plan, io, export, analysis, materials, text, engine) importiert
// nie die HÜLLE (ui, panels, views, menus, editors, viewport, native, tools, state, commands,
// App) und nie React/Zustand/Tauri statisch.
// 2. Die HÜLLE holt Funktionen aus `plan/` und `geometry/` nur über die Fassade `src/core`.
// (`model/` — Typen und kleine Modell-Helfer — darf sie direkt importieren.)
//
// Ausnahmen stehen in den Listen unten; Ziel: leer.
import { describe, expect, it } from "vitest";
import { readdirSync, readFileSync, statSync } from "node:fs";
import { dirname, join, normalize, relative, sep } from "node:path";
const SRC = join(process.cwd(), "src");
const CORE_DIRS = new Set(["model", "geometry", "plan", "io", "export", "analysis", "materials", "text", "engine"]);
const SHELL_DIRS = new Set(["ui", "panels", "views", "menus", "editors", "viewport", "native", "tools", "state", "commands"]);
const FACADE_DIRS = new Set(["plan", "geometry"]);
const FORBIDDEN_PACKAGES = /^(react|react-dom|zustand|@tauri-apps\/.*)$/;
/** Kern-Dateien, die (noch) Hüllen-Verzeichnisse oder UI-Pakete importieren — Ziel: leer. */
const CORE_EXCEPTIONS: string[] = [];
/** Hüllen-Dateien, die `plan/`/`geometry/` direkt importieren — Ziel: leer. */
const SHELL_EXCEPTIONS: string[] = [];
function walk(dir: string, out: string[] = []): string[] {
for (const name of readdirSync(dir)) {
const p = join(dir, name);
if (statSync(p).isDirectory()) walk(p, out);
else if (/\.tsx?$/.test(name) && !/\.test\.tsx?$/.test(name)) out.push(p);
}
return out;
}
/** Oberstes Verzeichnis unter src/ ("App"/"main" für Dateien direkt darin). */
function top(file: string): string {
const parts = relative(SRC, file).split(sep);
return parts.length > 1 ? parts[0] : parts[0].replace(/\.tsx?$/, "");
}
interface Imp {
spec: string;
/** aufgelöst relativ zu src/, mit "/" (nur bei relativen Importen) */
target: string | null;
}
const IMPORT_RE = /(?:import|export)\s+(?:type\s+)?(?:[^"';]*?\s+from\s+)?["']([^"']+)["']|import\(\s*["']([^"']+)["']\s*\)/g;
function importsOf(file: string): Imp[] {
const src = readFileSync(file, "utf8");
const out: Imp[] = [];
for (const m of src.matchAll(IMPORT_RE)) {
const spec = m[1] ?? m[2];
if (!spec) continue;
out.push({
spec,
target: spec.startsWith(".") ? normalize(join(dirname(file), spec)).slice(SRC.length + 1).split(sep).join("/") : null,
});
}
return out;
}
const files = walk(SRC);
describe("Kern/Hülle-Grenze", () => {
it("der Kern importiert keine Hülle und keine UI-Pakete", () => {
const violations: string[] = [];
for (const f of files) {
const t = top(f);
if (!CORE_DIRS.has(t)) continue;
const rel = relative(SRC, f).split(sep).join("/");
if (CORE_EXCEPTIONS.includes(rel)) continue;
for (const i of importsOf(f)) {
const tt = i.target?.split("/")[0];
if (tt && (SHELL_DIRS.has(tt) || tt === "App" || tt === "main")) violations.push(`${rel} → ${i.target}`);
if (!i.target && FORBIDDEN_PACKAGES.test(i.spec)) violations.push(`${rel} → ${i.spec}`);
}
}
expect(violations).toEqual([]);
});
it("die Hülle holt plan/ und geometry/ nur über die Fassade src/core", () => {
const violations: string[] = [];
for (const f of files) {
const t = top(f);
if (!SHELL_DIRS.has(t) && t !== "App" && t !== "main") continue;
const rel = relative(SRC, f).split(sep).join("/");
if (SHELL_EXCEPTIONS.includes(rel)) continue;
for (const i of importsOf(f)) {
const tt = i.target?.split("/")[0];
if (tt && FACADE_DIRS.has(tt)) violations.push(`${rel} → ${i.target}`);
}
}
expect(violations).toEqual([]);
});
it("die Fassade zeigt nur auf plan/ und geometry/ und importiert keine Hülle", () => {
const f = join(SRC, "core", "index.ts");
for (const i of importsOf(f)) {
const tt = i.target?.split("/")[0];
expect(tt === undefined || FACADE_DIRS.has(tt)).toBe(true);
}
});
});
+19
View File
@@ -0,0 +1,19 @@
// Beweis, dass die Grenze trägt: der Kern läuft ohne DOM/React, nur über die Fassade `src/core`
// (Vitest-Umgebung = node). Ein späteres `dossier-cli` ([4]) nutzt genau diese Einstiege.
import { describe, expect, it } from "vitest";
import { generatePlan, planToRenderScene, projectToModel3d } from "./index";
import { sampleProject } from "../model/sampleProject";
describe("Kern headless (nur über src/core)", () => {
it("Grundriss, Render-Szene und 3D-Modell des Beispielprojekts ohne DOM", () => {
expect(typeof document).toBe("undefined");
const floor = sampleProject.drawingLevels.find((l) => l.kind === "floor")!;
const codes = new Set(sampleProject.layers.map((l) => l.code));
const plan = generatePlan(sampleProject, floor.id, codes);
expect(plan.primitives.length).toBeGreaterThan(50);
const scene = planToRenderScene(plan);
expect(scene).toBeTruthy();
const model = projectToModel3d(sampleProject);
expect(model.walls.length).toBeGreaterThan(5);
});
});
+309
View File
@@ -0,0 +1,309 @@
// Fassade des Kerns für die Hülle (Phase A der Kern/UI-Trennung, docs/core-ui-split.md).
// Dünne Durchreichung, Namen 1:1; die Hülle importiert Plan-/Geometrie-Funktionen nur noch von hier.
// Erzeugt mit scripts/core-facade.py — neue Einträge von Hand ergänzen.
export {
arcFromStartEndDirection,
arcFromStartEndRadius,
arcThroughPoints,
bulgeArc,
bulgeArcPoints,
bulgeBetweenAngles,
bulgeFromSagittaPoint,
bulgePointAt,
bulgeThroughPoint,
hasRealBulge,
pointOnCircle,
} from "../geometry/bulge";
export {
ceilingArea,
normalizeOutline,
outlineBBox,
pointInOutline,
} from "../geometry/ceiling";
export {
columnFootprint,
} from "../geometry/column";
export {
ellipsePts,
sampleBezierChain,
sampleCatmullRom,
sampleUniformBSpline,
} from "../geometry/curves";
export {
type DrawingIndex,
buildDrawingIndex,
drawingsNear,
drawingsWithinDistance,
isIndexable,
nearestInDrawings,
pointSegDist as pointSegDist__geometry_drawingIndex,
} from "../geometry/drawingIndex";
export {
mvGeom,
reversesOrientation,
scaleFactor,
scaleGeom,
} from "../geometry/geomTransform";
export {
type Chamfer,
type Fillet,
type TangentTarget,
breakCurve,
chamferCorner,
extendBulgeSegment,
extendSegment,
filletCorner,
joinChainsWithBulge,
nearestOnPolyline,
offsetPolyline,
offsetPolylineWithBulge,
offsetSegment,
pointSegmentDistance,
polylineEdges,
removeSegment,
removeSegmentWithBulge,
splitAtIntersections,
splitClosedByChord,
splitPolylineAtParam,
tangentCircleCenters,
trimPolylineWithBulge,
vecEqual,
} from "../geometry/kernel2d";
export {
LINE_PRESETS,
type LinePresetKey,
type LineSegment,
type LineSegmentType,
dashHasDot,
dashToSegments,
presetOfDash,
segmentsToDash,
} from "../geometry/lineSegments";
export {
openingGapQuad,
openingVerticalExtent,
} from "../geometry/opening";
export {
nearestPolylineTarget,
toleranceFor,
} from "../geometry/polylinePoint";
export {
type PolylineVertexType,
canSetVertexType,
vertexTypeOf,
withVertexType,
} from "../geometry/polylineVertexType";
export {
revisionCloudPts,
} from "../geometry/revisionCloud";
export {
roofBBox,
roofBaseElevation,
roofGeometry,
} from "../geometry/roof";
export {
SIA_CATEGORIES,
balance,
centroid,
evaluateRoom,
polygonArea,
roomsToCsv,
siaLabelFull,
} from "../geometry/roomArea";
export {
type WallSegment,
roomFromPointInside,
} from "../geometry/roomBoundary";
export {
IDEAL_TREAD,
MIN_STEPS,
defaultStepCount,
stairBBox,
stairGeometry,
stairOutline,
} from "../geometry/stair";
export {
extrudedSolidSpec,
transformSolid,
} from "../plan/extrudedSolidSpec";
export {
type CategoryDisplayResolver,
type HatchRender,
type Plan,
type PlanImage,
type UnderlayGroup,
generatePlan,
generateSectionPlan,
generateVisibleLevelsPlan,
materializeGreyed,
materializeUnderlay,
} from "../plan/generatePlan";
export {
addDrawing2D,
} from "../plan/generatePlan/drawing2d";
export {
END_MARK_DEFAULT_SIZE_MM,
} from "../plan/generatePlan/endMarks";
export {
NO_HATCH,
type Primitive,
resolveBackground,
resolveForeground,
resolveHatchId,
resolveStrokeWeight,
} from "../plan/generatePlan/shared";
export {
GpuChunkCache,
} from "../plan/glPlan/glPlanChunks";
export {
compilePrimitivesToGpu,
} from "../plan/glPlan/glPlanCompile";
export {
DASH_MM_TO_M,
buildRandomHatchRuns,
motifPoints,
zigzagPoints,
} from "../plan/glPlan/glPlanHatch";
export {
type BufferGl,
type GpuGeometry,
type ViewBox as ViewBox__plan_glPlan_glPlanTypes,
} from "../plan/glPlan/glPlanTypes";
export {
levelMarkerPrimitives,
levelMarksEnabled,
} from "../plan/levelMarkers";
export {
NativeTextSync,
isGpuText,
} from "../plan/nativeText";
export {
type PickKind,
categoryNameForPick,
} from "../plan/pickLabels";
export {
DRAWING_PICK_TOLERANCE,
type PickContextMesh,
type PickDrawingSeg,
type PickOpening,
type PickRoof,
type PickSlab,
type PickStair,
type PickWall,
type Vec3,
} from "../plan/pickTypes";
export {
crossKindOverlayAllowed,
planUnderlayPrimitives,
} from "../plan/planUnderlay";
export {
type Bounds,
expandRegion,
indexedInRegion,
regionContains,
} from "../plan/planView/cullPrimitives";
export {
HAIRLINE_PX,
type ModelRect,
PAD,
PX_PER_M,
type ViewBox as ViewBox__plan_planView_geometry,
clamp,
fitBoxFor,
marqueeHit,
marqueeHitCeilings,
marqueeHitDrawings,
marqueeHitRooms,
marqueeHitStairs,
meetScale,
mmToPx,
pointInPolygon,
pointSegDistPx,
printStrokeVb,
scaleFromView,
toScreen,
viewForCamera,
viewForScale,
visibleEdgeRuns,
} from "../plan/planView/geometry";
export {
type OwnerField,
type OwnerIndex,
buildOwnerIndex,
ownedBy,
} from "../plan/planView/ownerIndex";
export {
buildSegmentIndex,
nearestSegment,
pointSegDist as pointSegDist__plan_planView_segmentIndex,
segmentsNear,
} from "../plan/planView/segmentIndex";
export {
marqueeHitUnderlay,
} from "../plan/planView/underlayAccess";
export {
sectionOpeningPrimitives,
} from "../plan/sectionOpenings";
export {
generateElevationPlan,
} from "../plan/toElevation";
export {
planToRenderScene,
} from "../plan/toRenderScene";
export {
type SectionOutput,
computeSection,
sameSectionInputs,
sameSectionLine,
sectionPlaneFromLevel,
sectionUAxisModel,
} from "../plan/toSection";
export {
TRUCK_MESH_READY_EVENT,
draftWorldLines,
emitDrawingLineVerts,
pickGeometry,
projectToModel3d,
selectionHighlightLines,
wallMaterialColorMaps,
} from "../plan/toWalls3d";
+1 -1
View File
@@ -8,7 +8,7 @@
import type { Drawing2D, Project, Vec2 } from "../model/types";
import { geomBBox } from "../state/selectionInfo";
import { mvGeom } from "../geometry/geomTransform";
import { mvGeom } from "../core";
/** Ausrichtungskante bzw. -achse. */
export type AlignMode = "left" | "right" | "centerX" | "top" | "bottom" | "centerY";
+1 -1
View File
@@ -16,7 +16,7 @@
// unverändert stehen. Ebenso alles, was kein 2D-Element ist.
import type { Drawing2D, Drawing2DGeom, Project, Vec2 } from "../model/types";
import { bulgeArc } from "../geometry/bulge";
import { bulgeArc } from "../core";
import { uniqueId } from "../tools/types";
/** Teilgeometrien EINES Elements, oder `null`, wenn es nicht zerlegbar ist. */
+2 -10
View File
@@ -6,16 +6,8 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import type { Drawing2D, Drawing2DGeom, Vec2 } from "../model/types";
import {
joinChainsWithBulge,
removeSegment,
removeSegmentWithBulge,
splitAtIntersections,
splitClosedByChord,
splitPolylineAtParam,
vecEqual,
} from "../geometry/kernel2d";
import { bulgeArcPoints, hasRealBulge } from "../geometry/bulge";
import { joinChainsWithBulge, removeSegment, removeSegmentWithBulge, splitAtIntersections, splitClosedByChord, splitPolylineAtParam, vecEqual } from "../core";
import { bulgeArcPoints, hasRealBulge } from "../core";
/** Eine Polylinien-Darstellung eines Drawing2D (für die Kernel-Funktionen). */
export interface PolyForm {
+4 -15
View File
@@ -15,7 +15,6 @@ import "svg2pdf.js";
import type { Layout, LayoutAnnotation, MasterLayout, Project } from "../model/types";
import { generatePlan } from "../plan/generatePlan";
import { planToPrintSvg } from "./planToPrintSvg";
import { saveBinaryFile } from "../io/saveFile";
import { wrapDocToLines, type SvgLine } from "../text/renderHtml";
import { docFromText } from "../text/richText";
import {
@@ -304,19 +303,9 @@ export async function buildFolderPdf(
return doc;
}
/**
* Baut das Ordner-PDF und speichert es (nativer Tauri-Dialog bzw.
* Browser-Download). Liefert `false`, wenn nichts zu exportieren war oder der
* Speichern-Dialog abgebrochen wurde.
*/
export async function saveFolderPdf(
project: Project,
folderId: string,
fileName: string,
): Promise<boolean> {
/** Baut das Ordner-PDF als Bytes (`null`, wenn nichts zu exportieren war). Speichern macht die Hülle. */
export async function folderPdfBytes(project: Project, folderId: string): Promise<Uint8Array | null> {
const doc = await buildFolderPdf(project, folderId);
if (!doc) return false;
const bytes = doc.output("arraybuffer");
const name = fileName.replace(/\.pdf$/i, "");
return saveBinaryFile(new Uint8Array(bytes), `${name}.pdf`, "application/pdf");
if (!doc) return null;
return new Uint8Array(doc.output("arraybuffer"));
}
+2 -2
View File
@@ -8,8 +8,8 @@
// Kommentare deutsch (CONVENTIONS.md).
import { t } from "../i18n";
import { canSetVertexType, vertexTypeOf, type PolylineVertexType } from "../geometry/polylineVertexType";
import { nearestPolylineTarget, toleranceFor } from "../geometry/polylinePoint";
import { canSetVertexType, vertexTypeOf, type PolylineVertexType } from "../core";
import { nearestPolylineTarget, toleranceFor } from "../core";
import type { LayerCategory, Project, Vec2 } from "../model/types";
import { flattenCategories } from "../model/types";
import { findCategory } from "../state/projectSlice";
+1 -1
View File
@@ -13,7 +13,7 @@
// Bezeichner englisch, UI-Text über i18n (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import { t } from "../i18n";
import { APP_VERSION } from "../ui/TopBar";
import type { View3d, ViewType } from "../model/viewTypes";
File renamed without changes.
@@ -21,7 +21,7 @@
import { readFile } from "@tauri-apps/plugin-fs";
import type { LcmsInstance } from "lcms-wasm";
import type { Cmyk, Rgb } from "./color";
import type { Cmyk, Rgb } from "../model/color";
const MACOS_GENERIC_CMYK_PROFILE = "/System/Library/ColorSync/Profiles/Generic CMYK Profile.icc";
+1 -1
View File
@@ -16,7 +16,7 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import type { GeoAnchor } from "../ui/ContextImportDialog";
import { BORDERLESS_WINDOW_CHROME } from "./windowChrome";
+1 -1
View File
@@ -18,7 +18,7 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import type { DrawingLevel } from "../model/types";
import type { DisplayMode } from "../panels/types";
import { BORDERLESS_WINDOW_CHROME } from "./windowChrome";
+1 -1
View File
@@ -22,7 +22,7 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import { findCategory } from "../state/projectSlice";
import type { HatchStyle, LayerCategory, Project } from "../model/types";
import { BORDERLESS_WINDOW_CHROME } from "./windowChrome";
File renamed without changes.
+1 -1
View File
@@ -19,7 +19,7 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import type { Project } from "../model/types";
import type { ResourceManagerHandlers, TabId } from "../ui/ResourceManager";
import { BORDERLESS_WINDOW_CHROME } from "./windowChrome";
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -13,7 +13,7 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { useEffect, useRef } from "react";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "./projectFile";
import type { LayoutState } from "../panels/types";
import type { RendererMode } from "../ui/StatusBar";
import type { ThemeMode } from "../theme/themeMode";
+1 -1
View File
@@ -33,7 +33,7 @@ import { Dropdown } from "../ui/Dropdown";
import { PenColorField } from "../ui/PenColorField";
import { activePenSet, resolvePenWeight } from "../model/penSets";
import { DIM_DEFAULTS_MM } from "../model/dimension";
import { END_MARK_DEFAULT_SIZE_MM } from "../plan/generatePlan/endMarks";
import { END_MARK_DEFAULT_SIZE_MM } from "../core";
import type { EndMark } from "../model/types";
/** Auswahl der Linienenden (Reihenfolge = Anzeige im Dropdown). */
+1 -1
View File
@@ -35,7 +35,7 @@ import type {
VerticalAnchor,
WallReferenceLine,
} from "../model/types";
import { SIA_CATEGORIES, siaLabelFull } from "../geometry/roomArea";
import { SIA_CATEGORIES, siaLabelFull } from "../core";
import { Dropdown } from "../ui/Dropdown";
import type { DetailLevel } from "../model/viewTypes";
import { ColorHexField } from "../ui/ColorHexField";
+1 -6
View File
@@ -8,12 +8,7 @@
import { t } from "../i18n";
import { usePanelHost } from "./host";
import {
balance,
evaluateRoom,
roomsToCsv,
siaLabelFull,
} from "../geometry/roomArea";
import { balance, evaluateRoom, roomsToCsv, siaLabelFull } from "../core";
import type { Room } from "../model/types";
import { roomDisplayName } from "../model/roomStamp";
+1 -1
View File
@@ -19,7 +19,7 @@ import type { ContextObject } from "../model/types";
import { ContextImportDialog } from "../ui/ContextImportDialog";
import { Dropdown } from "../ui/Dropdown";
import { useStore } from "../state/appStore";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
import { openContextImportWindowNative } from "../native/contextImportWindow";
/** Typ-spezifisches Badge-Label (i18n-Key) je Kontext-Objekt-Art. */
+2 -2
View File
@@ -6,9 +6,9 @@
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import type { Drawing2D, Group, Project } from "../model/types";
import type { Plan, UnderlayGroup } from "../plan/generatePlan";
import type { Plan, UnderlayGroup } from "../core";
import { uniqueId } from "../tools/types";
import type { Primitive } from "../plan/generatePlan/shared";
import type { Primitive } from "../core";
/** Mitglieds-IDs je Elementart — dieselbe Form wie `Group`, ohne `id`/`name`/`groupIds`. */
export interface GroupMembership {
+3 -3
View File
@@ -8,7 +8,7 @@
// laufen. Die Slice tippt daher nur ihre eigenen Felder; `get()` liefert
// RootState (siehe appStore.ts), wir greifen punktuell auf View-Felder zu.
import { withVertexType, type PolylineVertexType } from "../geometry/polylineVertexType";
import { withVertexType, type PolylineVertexType } from "../core";
import { sampleProject } from "../model/sampleProject";
import {
flattenCategories,
@@ -38,8 +38,8 @@ import { lineIntersect } from "../model/geometry";
import { commitTransform } from "../tools/transform";
import type { CopyMode, TransformOp, TransformSelection } from "../tools/transform";
import { uniqueId } from "../tools/types";
import { centroid as roomCentroid } from "../geometry/roomArea";
import { bulgeArc, bulgeBetweenAngles, bulgeFromSagittaPoint, bulgePointAt, pointOnCircle } from "../geometry/bulge";
import { centroid as roomCentroid } from "../core";
import { bulgeArc, bulgeBetweenAngles, bulgeFromSagittaPoint, bulgePointAt, pointOnCircle } from "../core";
import {
DEFAULT_SCALE_DENOMINATOR,
DIM_DEFAULTS_MM,
+8 -13
View File
@@ -10,7 +10,7 @@
//
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { extrudedSolidSpec } from "../plan/extrudedSolidSpec";
import { extrudedSolidSpec } from "../core";
import type { SolidSpec } from "../engine/truckSolid";
import {
ceilingThickness,
@@ -47,25 +47,20 @@ import type {
} from "../model/types";
import type { DetailLevel } from "../model/viewTypes";
import { localToLv95 } from "../io/lv95";
import {
resolveForeground,
resolveBackground,
resolveHatchId,
resolveStrokeWeight,
} from "../plan/generatePlan/shared";
import { resolveForeground, resolveBackground, resolveHatchId, resolveStrokeWeight } from "../core";
import { columnVerticalExtent } from "../model/wall";
import { columnFootprint } from "../geometry/column";
import { evaluateRoom, polygonArea } from "../geometry/roomArea";
import { columnFootprint } from "../core";
import { evaluateRoom, polygonArea } from "../core";
import {
ceilingVerticalExtent,
nextFloorAbove,
stairVerticalExtent,
wallVerticalExtent,
} from "../model/wall";
import { ceilingArea, outlineBBox } from "../geometry/ceiling";
import { roofBBox, roofBaseElevation, roofGeometry } from "../geometry/roof";
import { openingGapQuad, openingVerticalExtent } from "../geometry/opening";
import { stairGeometry, stairBBox } from "../geometry/stair";
import { ceilingArea, outlineBBox } from "../core";
import { roofBBox, roofBaseElevation, roofGeometry } from "../core";
import { openingGapQuad, openingVerticalExtent } from "../core";
import { stairGeometry, stairBBox } from "../core";
/** Eintrag für die WallType-Auswahl (Preset-Dropdown) im Object-Info-Panel. */
export interface WallTypeChoice {
+2 -2
View File
@@ -5,8 +5,8 @@
//
// Extrahiert aus App.tsx. Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { generatePlan } from "../plan/generatePlan";
import type { CategoryDisplayResolver } from "../plan/generatePlan";
import { generatePlan } from "../core";
import type { CategoryDisplayResolver } from "../core";
import type { DetailLevel } from "../model/viewTypes";
import type { DisplayResolver } from "../viewport/Viewport3D";
import { savePlanPdf } from "../export/exportPdf";
+1 -1
View File
@@ -11,7 +11,7 @@ import type { Ceiling, Drawing2D, EdgeGrip, Project, Room, Stair, Vec2 } from ".
import { wallTypeThickness } from "../model/types";
import { drawingVertices } from "./projectSlice";
import { areaMovePreview } from "../tools/transform";
import { mvGeom } from "../geometry/geomTransform";
import { mvGeom } from "../core";
import { drawingPreviewShapes } from "../tools/drawingPreview";
import type { DraftShape, SnapResult, SnapSettings, ToolDraft, ToolMods } from "../tools/types";
import { applyAngleConstraint, computeSnap } from "../tools/snapping";
+1 -1
View File
@@ -6,7 +6,7 @@
// Extrahiert aus App.tsx. Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import type { Project, Vec2 } from "../model/types";
import type { CategoryDisplayResolver } from "../plan/generatePlan";
import type { CategoryDisplayResolver } from "../core";
import type { DisplayResolver } from "../viewport/Viewport3D";
import type { PlanSelection, MarqueeSelection } from "../views/plan/PlanView";
import type { Pick3dHit } from "../viewport/Wasm3DViewport";
+6 -3
View File
@@ -20,7 +20,7 @@ import type { Selection } from "./selectionInfo";
import type { EngineView } from "../commands/engine";
import type { ScheduleKind } from "../export/exportSchedule";
import type { TabId as ResourceTabId } from "../ui/ResourceManager";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
import { openDrawingLevelsWindowNative } from "../native/drawingLevelsWindow";
import { t } from "../i18n";
import {
@@ -52,7 +52,8 @@ import {
moveFolderToFolder,
patchAnnotation as patchAnnotationInLayout,
} from "../model/layoutModel";
import { saveFolderPdf } from "../export/layoutPdf";
import { folderPdfBytes } from "../export/layoutPdf";
import { saveBinaryFile } from "../native/saveFile";
import type { useProjectActions } from "./useProjectActions";
import type { useSelectionState } from "./useSelectionState";
import type { useDrawingToolState } from "./useDrawingToolState";
@@ -1567,7 +1568,9 @@ export function usePanelHostBase(opts: {
onExportFolderPdf: (folderId) => {
const folder = (project.layoutFolders ?? []).find((f) => f.id === folderId);
const name = folder?.name?.trim() || "layouts";
void saveFolderPdf(project, folderId, name);
void folderPdfBytes(project, folderId).then((bytes) => {
if (bytes) return saveBinaryFile(bytes, `${name}.pdf`, "application/pdf");
});
},
onMoveLayoutToFolder: (layoutId, folderId) => {
setProject((p) => ({
+3 -3
View File
@@ -25,7 +25,7 @@ import { exportIfcSpf } from "../export/exportIfc";
import { exportProjectStep } from "../export/exportStep";
import { exportObj, exportStl } from "../export/exportMesh";
import type { ExportSaveFormat } from "../ui/ExportSaveDialog";
import { saveTextFile } from "../io/saveFile";
import { saveTextFile } from "../native/saveFile";
import {
saveProjectFile,
openProjectFileNative,
@@ -35,8 +35,8 @@ import {
releaseProjectLock,
registerLockAutoRelease,
isTauriRuntime,
} from "../io/projectFile";
import type { LockInfo } from "../io/projectFile";
} from "../native/projectFile";
import type { LockInfo } from "../native/projectFile";
import { addRecentProject, removeRecentProject } from "./recentProjects";
import { emptyProject, sampleProject } from "../model/sampleProject";
import { flattenCategories } from "../model/types";
+2 -2
View File
@@ -6,8 +6,8 @@
// Polylinie/Rechteck/Bild, alles andere war beim Verschieben unsichtbar).
import type { Drawing2D, Project, Vec2 } from "../model/types";
import type { Primitive } from "../plan/generatePlan";
import { addDrawing2D } from "../plan/generatePlan/drawing2d";
import type { Primitive } from "../core";
import { addDrawing2D } from "../core";
import { textFrameCorners } from "../text/textFrame";
import type { DraftShape } from "./types";
+1 -1
View File
@@ -6,7 +6,7 @@
// `computeSnap` liest sie für die aktive Ebene mit.
import type { Vec2 } from "../model/types";
import type { Primitive } from "../plan/generatePlan";
import type { Primitive } from "../core";
export type SnapSeg = [Vec2, Vec2];
+5 -5
View File
@@ -10,12 +10,12 @@ import type { Drawing2D, Project, Vec2, Wall } from "../model/types";
import { getWallType, wallTypeThickness } from "../model/types";
import { add, leftNormal, lineIntersect, normalize, scale, sub } from "../model/geometry";
import { wallReferenceOffset } from "../model/wall";
import { centroid as roomCentroid } from "../geometry/roomArea";
import { columnFootprint } from "../geometry/column";
import { stairOutline } from "../geometry/stair";
import { centroid as roomCentroid } from "../core";
import { columnFootprint } from "../core";
import { stairOutline } from "../core";
import type { SnapKind, SnapResult, SnapSettings } from "./types";
import { sampleBezierChain, sampleCatmullRom, sampleUniformBSpline } from "../geometry/curves";
import { buildDrawingIndex, drawingsNear, isIndexable, pointSegDist, type DrawingIndex } from "../geometry/drawingIndex";
import { sampleBezierChain, sampleCatmullRom, sampleUniformBSpline } from "../core";
import { buildDrawingIndex, drawingsNear, isIndexable, pointSegDist__geometry_drawingIndex as pointSegDist, type DrawingIndex } from "../core";
import { sheetSnapSegments } from "./sheetSnapGeometry";
const dist = (a: Vec2, b: Vec2): number => Math.hypot(a.x - b.x, a.y - b.y);
+1 -1
View File
@@ -4,7 +4,7 @@
import type { Ceiling, Drawing2D, Project, Vec2, Wall } from "../model/types";
import { wallTypeThickness } from "../model/types";
import { wallCorners } from "../model/geometry";
import { normalizeOutline, ceilingArea } from "../geometry/ceiling";
import { normalizeOutline, ceilingArea } from "../core";
import type { DraftShape, Tool, ToolContext, ToolDraft, ToolId } from "./types";
import { uniqueId } from "./types";
+4 -4
View File
@@ -9,7 +9,7 @@
// Bezeichner englisch, UI-Text via t() (CONVENTIONS.md). Reine Funktionen + Geometrie;
// die App hält den State und wendet `commitTransform` immutabel an.
import { transformSolid } from "../plan/extrudedSolidSpec";
import { transformSolid } from "../core";
import type {
Ceiling,
Column,
@@ -25,11 +25,11 @@ import type {
} from "../model/types";
import { wallTypeThickness } from "../model/types";
import { wallCorners } from "../model/geometry";
import { columnFootprint } from "../geometry/column";
import { stairOutline } from "../geometry/stair";
import { columnFootprint } from "../core";
import { stairOutline } from "../core";
import type { DraftShape } from "./types";
import { drawingPreviewShapes } from "./drawingPreview";
import { mvGeom, reversesOrientation, scaleFactor, scaleGeom } from "../geometry/geomTransform";
import { mvGeom, reversesOrientation, scaleFactor, scaleGeom } from "../core";
import { uniqueId } from "./types";
import type { CommandSelection } from "../commands/types";
+1 -1
View File
@@ -29,7 +29,7 @@ import {
rgbToHsv,
} from "../model/color";
import type { Cmyk, Hsl, Hsv, Rgb } from "../model/color";
import { initIccColorManagement, iccColorManagementAvailable, rgbToCmykIcc, cmykToRgbIcc } from "../model/colorIcc";
import { initIccColorManagement, iccColorManagementAvailable, rgbToCmykIcc, cmykToRgbIcc } from "../native/colorIcc";
import { SpectrumPicker } from "./SpectrumPicker";
import { Segmented } from "./resourceManager/fields";
import { t } from "../i18n";
+1 -1
View File
@@ -23,7 +23,7 @@ import type {
LayoutViewport,
Project,
} from "../model/types";
import { generatePlan } from "../plan/generatePlan";
import { generatePlan } from "../core";
import { planToPrintSvg } from "../export/planToPrintSvg";
import {
effectiveSheetSizeMm,
+1 -1
View File
@@ -5,7 +5,7 @@
import { useEffect } from "react";
import { t } from "../i18n";
import type { LockInfo } from "../io/projectFile";
import type { LockInfo } from "../native/projectFile";
export interface LockConflictDialogProps {
/** Info aus der Lock-Sidecar-Datei (pid/hostname/timestamp) — kann fehlen. */
+1 -1
View File
@@ -5,7 +5,7 @@
// tatsächlich laufende Version in der Fussleiste (s. update/version.ts).
import { useEffect, useState } from "react";
import { getLanguage, t } from "../i18n";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
import { APP_VERSION } from "./TopBar";
import { getRunningVersion } from "../update/version";
import {
+1 -1
View File
@@ -10,7 +10,7 @@
import { useId } from "react";
import type { HatchStyle, LineStyle } from "../model/types";
import { dashHasDot } from "../geometry/lineSegments";
import { dashHasDot } from "../core";
// ── Kleiner deterministischer PRNG (mulberry32) ────────────────────────────
// Für „random"-Striche: stabil pro Seed, damit die Vorschau bei gleichem
+1 -9
View File
@@ -7,15 +7,7 @@ import type { LineStyle, Project } from "../../model/types";
import { PEN_WEIGHTS } from "../../model/types";
import { parseLin } from "../../io/linParser";
import { LineSwatch } from "../hatchPreview";
import {
segmentsToDash,
dashToSegments,
presetOfDash,
LINE_PRESETS,
type LineSegment,
type LineSegmentType,
type LinePresetKey,
} from "../../geometry/lineSegments";
import { segmentsToDash, dashToSegments, presetOfDash, LINE_PRESETS, type LineSegment, type LineSegmentType, type LinePresetKey } from "../../core";
import { MotifEditor } from "../MotifEditor";
import { t } from "../../i18n";
import {
+1 -1
View File
@@ -5,7 +5,7 @@
// weder die Plugins noch etwas zu aktualisieren.
import { ask, message } from "@tauri-apps/plugin-dialog";
import { t } from "../i18n";
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
/** localStorage-Key fuer die Update-Pause (s. `getUpdateSnoozeUntil`). */
const SNOOZE_KEY = "dossier.updateSnoozeUntil";
+1 -1
View File
@@ -2,7 +2,7 @@
// manuell gepflegte `APP_VERSION`-String in ui/TopBar.tsx) — vermeidet, dass
// die Anzeige von der echten Installation abweicht, falls jemand beim
// Versionsbump eine der beiden Stellen vergisst.
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
/** `null` ausserhalb von Tauri (Vite-Dev-Server im Browser, keine Installation). */
export async function getRunningVersion(): Promise<string | null> {
+1 -1
View File
@@ -5,7 +5,7 @@
// Release „latest" wie `latest.json`, s. checkForUpdate.ts) und bieten pro
// Eintrag nur den DMG-Download im System-Browser an — Installation bleibt
// der gewohnte manuelle Schritt (DMG oeffnen, App in Applications ersetzen).
import { isTauriRuntime } from "../io/projectFile";
import { isTauriRuntime } from "../native/projectFile";
export interface VersionEntry {
version: string;
+3 -3
View File
@@ -45,8 +45,8 @@
import { useEffect, useRef, useState } from "react";
import type { Project, Wall, Drawing2D, Ceiling, Roof, Vec2 } from "../model/types";
import { ceilingVerticalExtent, wallVerticalExtent } from "../model/wall";
import { roofBaseElevation, roofGeometry } from "../geometry/roof";
import { projectToModel3d, pickGeometry, draftWorldLines, TRUCK_MESH_READY_EVENT } from "../plan/toWalls3d";
import { roofBaseElevation, roofGeometry } from "../core";
import { projectToModel3d, pickGeometry, draftWorldLines, TRUCK_MESH_READY_EVENT } from "../core";
import type { DetailLevel, RenderMode, View3d } from "../model/viewTypes";
import type { ToolDraft } from "../tools/types";
import { hudSegments, type HudFieldsState } from "../tools/hudFormat";
@@ -63,7 +63,7 @@ import { t } from "../i18n";
import { useWasm3dRenderer } from "./useWasm3dRenderer";
import type { Camera3d } from "./useWasm3dRenderer";
import { cameraRay, pickNearest, rayPlaneY, rayPlane, worldToScreen } from "./raycast3d";
import type { Vec3 } from "./raycast3d";
import type { Vec3 } from "../core";
import { drawingGripVertices, drawingMoveAnchor } from "./drawingGrips";
/** Ein per 3D-Klick getroffenes Bauteil, oder null (Leerraum). */
+1 -1
View File
@@ -15,7 +15,7 @@
*/
import type { Project } from "../model/types";
import { wallMaterialColorMaps } from "../plan/toWalls3d";
import { wallMaterialColorMaps } from "../core";
/** Kantenlänge einer Textur-Ebene in Texeln (muss zu render3d `TEXTURE_SIZE`). */
const TEX_SIZE = 256;
+2 -3
View File
@@ -17,9 +17,8 @@
// Ortho-Zweig, keine perspektivische Näherung mehr.
import { DRAWING_PICK_TOLERANCE } from "../plan/pickTypes";
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh } from "../plan/pickTypes";
export type { Vec3 } from "../plan/pickTypes";
import { DRAWING_PICK_TOLERANCE } from "../core";
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh } from "../core";
/** Kamera-Parameter für den Pick-Strahl (Teilmenge von Camera3d). */
export interface RayCamera {
+1 -1
View File
@@ -18,7 +18,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import type { ContextImage, Project } from "../model/types";
import { emitDrawingLineVerts, projectToModel3d } from "../plan/toWalls3d";
import { emitDrawingLineVerts, projectToModel3d } from "../core";
import type { DetailLevel } from "../model/viewTypes";
import { loadEngine3d } from "../engine/engine3d";
import { decodeMaterialTextures } from "./materialTextures";
+9 -34
View File
@@ -5,7 +5,7 @@
// Polygon wird ein eigenes <pattern> in <defs> definiert, damit Maßstab/Winkel/
// Farbe variieren können.
import type { PickKind } from "../../plan/pickLabels";
import type { PickKind } from "../../core";
import {
forwardRef,
useEffect,
@@ -15,8 +15,8 @@ import {
useState,
} from "react";
import type { ComponentProps, CSSProperties } from "react";
import type { HatchRender, Plan, PlanImage, Primitive } from "../../plan/generatePlan";
import { materializeGreyed, materializeUnderlay, type UnderlayGroup } from "../../plan/generatePlan";
import type { HatchRender, Plan, PlanImage, Primitive } from "../../core";
import { materializeGreyed, materializeUnderlay, type UnderlayGroup } from "../../core";
import type { Drawing2D, EdgeGrip, Vec2 } from "../../model/types";
import { t } from "../../i18n";
import type { ToolHandlers, ToolId, ToolMods } from "../../tools/types";
@@ -27,30 +27,11 @@ import { contentFontBaselineFromTop, TEXT_LINE_HEIGHT_MULT } from "../../text/fo
import { textFrameCorners } from "../../text/textFrame";
import { RichTextEditor } from "../../editors/RichTextEditor";
import { useNativeAvailable, useNativePlanRenderer } from "./useNativePlanRenderer";
import { isGpuText } from "../../plan/nativeText";
import { isGpuText } from "../../core";
import { LiveMeet, LiveValue, createMeetStore, createValueStore } from "./planView/liveMeet";
import { useWasmPlanRenderer } from "./useWasmPlanRenderer";
import { DEFAULT_MARQUEE_COLOR, DEFAULT_SNAP_COLOR } from "../../theme/accents";
import {
type ViewBox,
PX_PER_M,
PAD,
toScreen,
clamp,
meetScale,
scaleFromView,
viewForScale,
viewForCamera,
fitBoxFor,
pointInPolygon,
pointSegDistPx,
marqueeHit,
marqueeHitDrawings,
type ModelRect,
marqueeHitCeilings,
marqueeHitRooms,
marqueeHitStairs,
} from "../../plan/planView/geometry";
import { type ViewBox__plan_planView_geometry as ViewBox, PX_PER_M, PAD, toScreen, clamp, meetScale, scaleFromView, viewForScale, viewForCamera, fitBoxFor, pointInPolygon, pointSegDistPx, marqueeHit, marqueeHitDrawings, type ModelRect, marqueeHitCeilings, marqueeHitRooms, marqueeHitStairs } from "../../core";
import {
polyUsesPattern,
HatchPattern,
@@ -62,16 +43,10 @@ import {
import { DraftOverlay } from "./planView/overlays";
import { PlanRulers } from "./planView/PlanRulers";
import { PlanGrid } from "./planView/PlanGrid";
import { expandRegion, indexedInRegion, regionContains, type Bounds } from "../../plan/planView/cullPrimitives";
import { buildSegmentIndex, nearestSegment, pointSegDist, segmentsNear } from "../../plan/planView/segmentIndex";
import { buildOwnerIndex, ownedBy, type OwnerField, type OwnerIndex } from "../../plan/planView/ownerIndex";
import {
buildDrawingIndex,
drawingsWithinDistance,
marqueeHitUnderlay,
nearestInDrawings,
type DrawingIndex,
} from "../../plan/planView/underlayAccess";
import { expandRegion, indexedInRegion, regionContains, type Bounds } from "../../core";
import { buildSegmentIndex, nearestSegment, pointSegDist__plan_planView_segmentIndex as pointSegDist, segmentsNear } from "../../core";
import { buildOwnerIndex, ownedBy, type OwnerField, type OwnerIndex } from "../../core";
import { buildDrawingIndex, drawingsWithinDistance, marqueeHitUnderlay, nearestInDrawings, type DrawingIndex } from "../../core";
import { endBusyAfterPaint } from "../../state/busyStore";
import { createCursorStore, useCursorValue, type CursorStore } from "../../state/cursorStore";
+1 -1
View File
@@ -8,7 +8,7 @@
* Frame wandert danach nur noch der Ausschnitt.
*/
import type { BufferGl, GpuGeometry } from '../../plan/glPlan/glPlanTypes';
import type { BufferGl, GpuGeometry } from "../../core";
export type NativeInvoke = (cmd: string, args?: unknown, options?: unknown) => Promise<unknown>;
+4 -4
View File
@@ -9,11 +9,11 @@
// Tauri an `window.__TAURI_INTERNALS__`; Fehler beim Invoke werden still
// geschluckt (console.debug), damit die App nie daran scheitert.
import type { Plan } from "../../plan/generatePlan";
import { materializeGreyed, materializeUnderlay } from "../../plan/generatePlan";
import type { Plan } from "../../core";
import { materializeGreyed, materializeUnderlay } from "../../core";
import type { Project } from "../../model/types";
import { planToRenderScene } from "../../plan/toRenderScene";
import { projectToModel3d, TRUCK_MESH_READY_EVENT } from "../../plan/toWalls3d";
import { planToRenderScene } from "../../core";
import { projectToModel3d, TRUCK_MESH_READY_EVENT } from "../../core";
/** Sammel-Fenster: Modelländerungen werden gebündelt gepusht (nicht je Frame). */
const DEBOUNCE_MS = 200;
+1 -1
View File
@@ -6,7 +6,7 @@
// (`ZOOM_MIN`/`ZOOM_MAX` in PlanView.tsx) auf ≤ ~Bildschirmbreite/64px
// begrenzt, unabhängig davon, wie weit heraus- oder hereingezoomt ist.
import { PX_PER_M } from "../../../plan/planView/geometry";
import { PX_PER_M } from "../../../core";
import { rulerStep } from "./PlanRulers";
export function PlanGrid({
+1 -1
View File
@@ -1,7 +1,7 @@
// Lineale oben + links (Vectorworks-Stil) am Rand der Plan-Ansicht.
import type { Vec2 } from "../../../model/types";
import { PX_PER_M } from "../../../plan/planView/geometry";
import { PX_PER_M } from "../../../core";
/**
* Schrittweite (Meter) fürs Lineal: 1/2/5·10^n, sodass Major-Ticks ≥ ~64 px
+5 -5
View File
@@ -3,14 +3,14 @@
// Renderer. Bekommt `toScreen`/Massstab-Parameter gereicht, kein eigener
// Zugriff auf PlanView-internen State.
import type { HatchRender, Primitive } from "../../../plan/generatePlan";
import { NO_HATCH } from "../../../plan/generatePlan/shared";
import type { HatchRender, Primitive } from "../../../core";
import { NO_HATCH } from "../../../core";
import { docToLines, wrapDocToLines, type SvgLine } from "../../../text/renderHtml";
import type { Vec2 } from "../../../model/types";
import { quantizePen } from "../../../export/sceneToPrintSvg";
import { buildRandomHatchRuns, zigzagPoints, motifPoints, DASH_MM_TO_M } from "../../../plan/glPlan/glPlanHatch";
import { dashHasDot } from "../../../geometry/lineSegments";
import { HAIRLINE_PX, PX_PER_M, mmToPx, printStrokeVb, visibleEdgeRuns } from "../../../plan/planView/geometry";
import { buildRandomHatchRuns, zigzagPoints, motifPoints, DASH_MM_TO_M } from "../../../core";
import { dashHasDot } from "../../../core";
import { HAIRLINE_PX, PX_PER_M, mmToPx, printStrokeVb, visibleEdgeRuns } from "../../../core";
/** Basis-Kachelmaß (viewBox-Einheiten) einer Bild-Schraffur bei scaleX/scaleY = 1. */
const IMG_TILE_VB = 40;
+6 -6
View File
@@ -9,14 +9,14 @@
*/
import { useCallback, useEffect, useRef, useState } from 'react';
import type { Plan } from '../../plan/generatePlan';
import { GpuChunkCache } from '../../plan/glPlan/glPlanChunks';
import { compilePrimitivesToGpu } from '../../plan/glPlan/glPlanCompile';
import type { GpuGeometry, ViewBox } from '../../plan/glPlan/glPlanTypes';
import type { Primitive } from '../../plan/generatePlan';
import type { Plan } from "../../core";
import { GpuChunkCache } from "../../core";
import { compilePrimitivesToGpu } from "../../core";
import type { GpuGeometry, ViewBox__plan_glPlan_glPlanTypes as ViewBox } from "../../core";
import type { Primitive } from "../../core";
import { NativeGl, type NativeInvoke } from './nativeGl';
import { readCssColor } from './cssColor';
import { NativeTextSync } from '../../plan/nativeText';
import { NativeTextSync } from "../../core";
/** Läuft die App in einer Tauri-Webview? */
const isTauri = (): boolean => typeof window !== 'undefined' && '__TAURI_INTERNALS__' in window;
+2 -2
View File
@@ -13,8 +13,8 @@
*/
import { useCallback, useEffect, useRef, useState } from "react";
import type { Plan } from "../../plan/generatePlan";
import { planToRenderScene } from "../../plan/toRenderScene";
import type { Plan } from "../../core";
import { planToRenderScene } from "../../core";
interface ViewBox {
x: number;
+11 -11
View File
@@ -19,20 +19,20 @@ import type {
Vec2,
Wall,
} from "../model/types";
import { categoryNameForPick } from "../plan/pickLabels";
import type { PickKind } from "../plan/pickLabels";
import { generatePlan, generateSectionPlan, generateVisibleLevelsPlan } from "../plan/generatePlan";
import type { CategoryDisplayResolver, Plan, Primitive } from "../plan/generatePlan";
import { categoryNameForPick } from "../core";
import type { PickKind } from "../core";
import { generatePlan, generateSectionPlan, generateVisibleLevelsPlan } from "../core";
import type { CategoryDisplayResolver, Plan, Primitive } from "../core";
import type { RichTextDoc } from "../text/richText";
import { computeSection, sameSectionInputs, sameSectionLine } from "../plan/toSection";
import type { SectionOutput } from "../plan/toSection";
import { generateElevationPlan } from "../plan/toElevation";
import { crossKindOverlayAllowed, planUnderlayPrimitives } from "../plan/planUnderlay";
import { sectionOpeningPrimitives } from "../plan/sectionOpenings";
import { levelMarkerPrimitives, levelMarksEnabled } from "../plan/levelMarkers";
import { computeSection, sameSectionInputs, sameSectionLine } from "../core";
import type { SectionOutput } from "../core";
import { generateElevationPlan } from "../core";
import { crossKindOverlayAllowed, planUnderlayPrimitives } from "../core";
import { sectionOpeningPrimitives } from "../core";
import { levelMarkerPrimitives, levelMarksEnabled } from "../core";
import { setSheetOwnerOutlines, setSheetSnapSegments, snapSegmentsFromPrimitives } from "../tools/sheetSnapGeometry";
import { pushNativeScene, pushNativeWalls } from "./plan/nativeSync";
import { selectionHighlightLines } from "../plan/toWalls3d";
import { selectionHighlightLines } from "../core";
import { applyGroupDimmingToPlan } from "../state/groupActions";
import { PlanView } from "./plan/PlanView";
import type {