feat: SnapCAD Studio'yu YakHub deposuna taşı
Build and Push Docker Images / build (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s

- DWG/DXF içe aktarma ve .skf yeniden açma düzeltmeleri

- YakNet Bulut eşitlemede boş/eski kopya koruması ve yerel-only proje bildirimi

- Panelden içe aktarma duyuruları ve erişilebilir Türkçe hata mesajları

- AGPL-3.0 lisansı, README ve YakHub bağlantıları
This commit is contained in:
Enes Yakıştır
2026-10-25 18:20:21 +03:00
parent e9cb8e8681
commit 33b0940012
149 changed files with 46978 additions and 1273 deletions
+96
View File
@@ -0,0 +1,96 @@
import { describe, expect, it } from "vitest";
import type { WorkplaneShape } from "@/types/sketchforge";
describe("Wall Opening & Window Cutout Unit Tests", () => {
it("calculates correct through-cutting hole dimensions and position for a wall", () => {
const wall: WorkplaneShape = {
id: "wall-sample",
name: "Taşıyıcı Duvar",
kind: "box",
color: "#94a3b8",
x: 0,
z: 0,
width: 120,
depth: 20,
height: 60,
size: 60,
elevation: 0,
rotation: 0,
};
const windowConfig = {
width: 30,
height: 30,
elevation: 20, // sill height
offsetX: 0,
};
// Calculate hole box penetrating through the wall
const holeDepth = (wall.depth ?? 20) + 6; // 26mm, ensures 3mm overhang on each side
const holeShape: WorkplaneShape = {
id: "hole-1",
name: "Pencere Kesici",
kind: "box",
color: "#6b7280",
x: (wall.x ?? 0) + windowConfig.offsetX,
z: wall.z ?? 0,
width: windowConfig.width,
depth: holeDepth,
height: windowConfig.height,
size: windowConfig.height,
elevation: (wall.elevation ?? 0) + windowConfig.elevation,
rotation: wall.rotation ?? 0,
hole: true,
};
expect(holeShape.hole).toBe(true);
expect(holeShape.depth).toBeGreaterThan(wall.depth ?? 0);
expect(holeShape.elevation).toBe(20);
expect(holeShape.width).toBe(30);
expect(holeShape.height).toBe(30);
});
it("handles door cutout at zero elevation (ground level)", () => {
const wall: WorkplaneShape = {
id: "wall-sample-door",
name: "Giriş Duvarı",
kind: "box",
color: "#94a3b8",
x: 50,
z: -20,
width: 100,
depth: 20,
height: 60,
size: 60,
elevation: 0,
rotation: 0,
};
const doorConfig = {
width: 25,
height: 50,
elevation: 0, // door sill at ground
offsetX: -20,
};
const holeShape: WorkplaneShape = {
id: "door-hole",
name: "Kapı Kesici",
kind: "box",
color: "#6b7280",
x: (wall.x ?? 0) + doorConfig.offsetX,
z: wall.z ?? 0,
width: doorConfig.width,
depth: (wall.depth ?? 20) + 6,
height: doorConfig.height,
size: doorConfig.height,
elevation: (wall.elevation ?? 0) + doorConfig.elevation,
rotation: wall.rotation ?? 0,
hole: true,
};
expect(holeShape.elevation).toBe(0);
expect(holeShape.x).toBe(30); // 50 - 20
expect(holeShape.height).toBe(50);
});
});