feat: sesli CAD asistani, bellek optimizasyonlari ve akilli cozunurluk
CI / Typecheck and unit tests (push) Canceled after 0s
Build and Push Docker Images / build (push) Canceled after 0s

- SnapVoice Turkce sesli CAD ve komut konsolu (/denetle, /ram, /eko, /otomatik, /sessiz)
- 3B uzamsal sesli radar ve gorme engelli gelistirici geometri denetim motoru
- LibreDWG/DXF ikili sikistirma, font tembel yukleme ve RAM optimizasyonu
- Monitor cozunurlugune gore otomatik uyarlamali dinamik grafik modu
This commit is contained in:
Enes Yakıştır
2026-11-02 13:37:37 +03:00
parent c09407bcb3
commit e7b6db9db6
32 changed files with 5503 additions and 285 deletions
+39
View File
@@ -1,8 +1,41 @@
import * as THREE from "three";
import DxfParser from "dxf-parser";
import { deflateSync, inflateSync, strToU8, strFromU8 } from "fflate";
import { createLocalId } from "@/lib/localIds";
import type { WorkplaneShape } from "@/types/sketchforge";
export function compressDxfText(source: string): string {
const bytes = deflateSync(strToU8(source));
let binary = "";
for (let offset = 0; offset < bytes.length; offset += 0x8000) {
binary += String.fromCharCode(...bytes.subarray(offset, Math.min(bytes.length, offset + 0x8000)));
}
return globalThis.btoa(binary);
}
export function decompressDxfText(base64: string): string {
const binary = globalThis.atob(base64);
const bytes = new Uint8Array(binary.length);
for (let index = 0; index < binary.length; index += 1) {
bytes[index] = binary.charCodeAt(index);
}
return strFromU8(inflateSync(bytes));
}
export function getImportedDxfText(importedMesh?: WorkplaneShape["importedMesh"]): string | undefined {
if (!importedMesh) return undefined;
if (importedMesh.sourceDxfText) return importedMesh.sourceDxfText;
if (importedMesh.sourceDxfCompressed) {
try {
return decompressDxfText(importedMesh.sourceDxfCompressed);
} catch (err) {
console.warn("Could not decompress DXF source", err);
return undefined;
}
}
return undefined;
}
export const MAX_DXF_ENTITIES = 50_000;
export const MAX_DXF_TRIANGLES = 200_000;
const DEFAULT_DXF_EXTRUSION_DEPTH = 4;
@@ -926,6 +959,11 @@ export function importedShapeFromDxf(fileName: string, source: string): Workplan
}
geom.dispose();
const isLarge = source.length > 2048;
const dxfPayload = isLarge
? { sourceDxfCompressed: compressDxfText(source) }
: { sourceDxfText: source };
return {
id: createLocalId("uploaded-dxf"),
name: fileName.replace(/\.[^.]+$/, "") || "İçe Aktarılan DWG/DXF Pafta",
@@ -948,6 +986,7 @@ export function importedShapeFromDxf(fileName: string, source: string): Workplan
baseHeight: height,
triangleCount: positions.length / 9,
sourceFormat: "dxf",
...dxfPayload,
},
locked: false,
hidden: false,