Simplify
Some checks failed
Deploy to Pages / build (push) Failing after 10m45s

This commit is contained in:
Andras Schmelczer 2026-09-11 23:27:29 +01:00
commit 8bf3e3b705
40 changed files with 1443 additions and 1497 deletions

View file

@ -101,15 +101,12 @@ describe('skirting cutting plan', () => {
expect(front.leftMitre).toBeCloseTo(45);
expect(front.rightMitre).toBeCloseTo(45);
expect(front.leftType).toBe('external');
expect(front.leftBevel).toBeCloseTo(-45);
expect(front.rightBevel).toBeCloseTo(45);
expect(front.template.map((point) => Math.round(point.x))).toEqual([18, 1018, 1036, 0]);
const reversed = { ...room, walls: room.walls.map((wall) => ({ ...wall, turn: -wall.turn })) };
const reversePlan = planSkirting([reversed], { ...settings, stockLength: 6000 }, 5);
const reverseFront = reversePlan.pieces.find((piece) => piece.wallIndex === 4)!;
expect(reverseFront.length).toBeCloseTo(1036);
expect(reverseFront.leftBevel).toBeCloseTo(-45);
expect(reverseFront.rightBevel).toBeCloseTo(45);
});
it('packs across rooms with deterministic unique IDs and accounts for kerf', () => {
@ -404,8 +401,6 @@ describe('skirting cutting plan', () => {
expect(plan.pieces[0].id).toMatch(/^SU/);
for (const piece of plan.pieces) {
expect(piece.visibleLength).toBeCloseTo(2364);
expect(piece.leftOverlap).toBeCloseTo(18);
expect(piece.rightOverlap).toBeCloseTo(18);
}
const two = planSkirting(
[rectangle(2400, 2400, 'one'), rectangle(2400, 2400, 'two')],
@ -486,3 +481,18 @@ describe('skirting cutting plan', () => {
expect(plan.pieces.every((piece) => cutLength(piece.length) === 1200)).toBe(true);
});
});
it('uses the allocator cut decision at fractional stock boundaries', () => {
const room = rectangle(999.995, 999.995, 'precision');
room.walls.forEach((wall) => {
wall.doors = [];
});
const plan = planSkirting(
[room],
{ stockLength: 1000, thickness: 0, minLength: 100, kerf: 3 },
1,
);
expect(plan.issues.filter((issue) => issue.severity === 'error')).toEqual([]);
expect(plan.cuts).toBe(4);
expect(skirtingCuts(plan)).toHaveLength(4);
});