release: SnapCAD Studio 1.0.10 (desktop menuler, macOS kisayollari, YakNet SSO)
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s

This commit is contained in:
Enes Yakıştır
2026-11-12 10:12:35 +03:00
parent d5cc023856
commit ee28672e23
81 changed files with 10729 additions and 821 deletions
+13 -11
View File
@@ -35,22 +35,24 @@ async function runAudit() {
console.log("▶ BÖLÜM 1: 2B CAD VE POLİGON MOTORU DOĞRULAMASI");
console.log("--------------------------------------------------------------------------------");
// Test 1.1: 2D Poligon Kırpma (Union & Difference)
const polygonClipping = (await import("polygon-clipping")).default;
const squareA = [[[0, 0], [50, 0], [50, 50], [0, 50], [0, 0]]];
const squareB = [[[25, 25], [75, 25], [75, 75], [25, 75], [25, 25]]];
// Test 1.1: 2D Poligon Kırpma (Union & Difference) via Clipper2
const { Clipper, ClipType, FillRule, Point64 } = await import("clipper2-js");
const toPath64 = (pts) => pts.map(([x, y]) => new Point64(x * 1000, y * 1000));
const squareA = toPath64([[0, 0], [50, 0], [50, 50], [0, 50]]);
const squareB = toPath64([[25, 25], [75, 25], [75, 75], [25, 75]]);
const unionResult = polygonClipping.union(squareA, squareB);
const unionResult = Clipper.BooleanOp(ClipType.Union, [squareA], [squareB], FillRule.NonZero);
assert(
unionResult.length === 1 && unionResult[0][0].length >= 8,
"İki çakışan karenin Boolean Birleşimi (Union)",
`Tek poligon oluştu, köşe sayısı: ${unionResult[0][0].length}`
unionResult.length === 1 && unionResult[0].length >= 8,
"İki çakışan karenin Boolean Birleşimi (Union - Clipper2)",
`Tek poligon oluştu, köşe sayısı: ${unionResult[0]?.length ?? 0}`
);
const diffHole = polygonClipping.difference(squareA, [[[10, 10], [30, 10], [30, 30], [10, 30], [10, 10]]]);
const holeBox = toPath64([[10, 10], [30, 10], [30, 30], [10, 30]]);
const diffHole = Clipper.BooleanOp(ClipType.Difference, [squareA], [holeBox], FillRule.NonZero);
assert(
diffHole.length === 1 && diffHole[0].length === 2,
"İç delik çıkarma Boolean Farkı (A - B)",
diffHole.length === 2,
"İç delik çıkarma Boolean Farkı (A - B - Clipper2)",
`Dış kontur ve 1 adet iç delik halkası oluşturuldu`
);