This commit is contained in:
Andras Schmelczer 2026-09-11 22:14:24 +01:00
commit 0c0f08b350
45 changed files with 1565 additions and 1579 deletions

View file

@ -9,19 +9,30 @@ import type { FlooringPiece, FlooringPlan, SkirtingPiece, SkirtingPlan } from '.
const project = defaultProject();
project.rooms.push(rectangle('room-2', 'Office'));
function floorPiece(id: string, stockId: string, roomId = 'room-1', cut = true): FlooringPiece {
const length = cut ? 400 : 1200;
return {
id,
stockId,
roomId,
cut,
length: cut ? 400 : 1200,
length,
width: 190,
blankLength: length,
blankWidth: 190,
row: 1,
column: 1,
polygon: [],
template: [],
template: [
{ x: 0, y: 0 },
{ x: length, y: 0 },
{ x: length, y: 190 },
{ x: 0, y: 190 },
],
shaped: false,
reused: false,
factoryLeft: false,
factoryRight: false,
ripEdge: null,
};
}
const flooring: FlooringPlan = {
@ -46,11 +57,18 @@ const flooring: FlooringPlan = {
issues: [],
};
function skirtPiece(id: string, stockId: string, roomId = 'room-1', length = 900): SkirtingPiece {
const template: SkirtingPiece['template'] = [
{ x: 0, y: 0 },
{ x: length, y: 0 },
{ x: length, y: 18 },
{ x: 0, y: 18 },
];
return {
id,
stockId,
roomId,
length,
blankLength: length,
backLength: length,
wallId: 'w1',
wallIndex: 0,
@ -60,6 +78,13 @@ function skirtPiece(id: string, stockId: string, roomId = 'room-1', length = 900
rightMitre: 0,
leftType: 'square',
rightType: 'square',
template,
installedTemplate: template,
visibleLength: length,
leftOverlap: 0,
rightOverlap: 0,
leftBevel: 0,
rightBevel: 0,
};
}
const skirting: SkirtingPlan = {