[C1][C2] DXF-/DWG-Export über acadrust: export.rs (flache Zeichnung → CadDocument → DXF R2018 ASCII / DWG R2018), TS sammelt nur noch aus dem Plan, dxfWriter.ts gelöscht; Dialog mit Formatwahl, CLI dwg; Rundreise-Tests (acadrust, libredwg, ezdxf)
This commit is contained in:
21 files changed
+1177
-417
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// Vitest-Hilfe: Format-Modul (pkgFileIo) synchron laden. Anders als der Kern nicht global in
|
||||
// `vitest.config.ts` (acadrust ist gross, die meisten Tests brauchen es nicht) — Tests, die
|
||||
// DXF/DWG schreiben, importieren diese Datei. Fehlt das Paket: `npm run build:fileio`.
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { initFileioSync } from "./fileioWasm";
|
||||
|
||||
const file = fileURLToPath(new URL("./pkgFileIo/fileio_bg.wasm", import.meta.url));
|
||||
let bytes: Buffer;
|
||||
try {
|
||||
bytes = readFileSync(file);
|
||||
} catch {
|
||||
throw new Error(`Format-Modul fehlt (${file}): zuerst \`npm run build:fileio\`.`);
|
||||
}
|
||||
await initFileioSync(new Uint8Array(bytes));
|
||||
@@ -22,6 +22,12 @@ export function loadFileio(): Promise<FileioModule> {
|
||||
return loading;
|
||||
}
|
||||
|
||||
/** Synchroner Zugriff, nachdem `loadFileio()`/`initFileioSync()` gelaufen ist (Muster `core()`). */
|
||||
export function fileio(): FileioModule {
|
||||
if (!mod) throw new Error("Format-Modul (pkgFileIo) nicht geladen: zuerst `await loadFileio()`.");
|
||||
return mod;
|
||||
}
|
||||
|
||||
/** Synchron laden aus vorliegenden Bytes (Node: Tests, Werkzeuge). */
|
||||
export async function initFileioSync(bytes: BufferSource): Promise<FileioModule> {
|
||||
if (mod) return mod;
|
||||
|
||||
Reference in new issue
Block a user