|
|
|
@ -12,8 +12,10 @@ function testPathCount(br: Board, count?: number)
|
|
|
|
|
let cus = feedUtil.CalcPath(br);
|
|
|
|
|
if (count !== undefined)
|
|
|
|
|
expect(cus.length).toBe(count);
|
|
|
|
|
expect(cus.length).toBeGreaterThan(2);
|
|
|
|
|
expect(cus.length - 2 - holeCount).toMatchSnapshot("走刀数量");
|
|
|
|
|
else
|
|
|
|
|
expect(cus.length).toBeGreaterThan(2);
|
|
|
|
|
let pathCount = cus.length - 1 - holeCount - br.BoardModeling.length;
|
|
|
|
|
expect(pathCount < 0 ? 0 : pathCount).toMatchSnapshot("走刀数量");
|
|
|
|
|
for (let cu of cus)
|
|
|
|
|
{
|
|
|
|
|
expect(cu.Length).toMatchSnapshot("曲线长度");
|
|
|
|
@ -100,3 +102,18 @@ test("复杂造型测试", () =>
|
|
|
|
|
brs = LoadBoardsFromFileData(data);
|
|
|
|
|
testPathCount(brs[0]);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test("造型的外框和内框厚度小于刀半径厚度", () =>
|
|
|
|
|
{
|
|
|
|
|
let data =
|
|
|
|
|
[1, "Board", 3, 2, 101, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 26851.321807232103, -1144.6658743078003, 0, 1], 2, 1200, 600, 18, true, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 2, 416.58619999999996, 325.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1187.5114150409554, -619.5823942857144, 0, 1], 2, 4, [1187.5114150409554, 619.5823942857144], 0, [1512.6519150409554, 619.5823942857144], 0, [1512.6519150409554, 1036.1685942857143], 0, [1187.5114150409554, 1036.1685942857143], 0, true, 1, 2, 408.58619999999996, 317.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1191.5114150409554, -623.5823942857144, 0, 1], 2, 4, [1508.6519150409554, 1032.1685942857143], 0, [1191.5114150409554, 1032.1685942857143], 0, [1191.5114150409554, 623.5823942857144], 0, [1508.6519150409554, 623.5823942857144], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 26864.321807232103, -1017.7520587975966, 453.37831265306136, 1], 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 26864.321807232103, -1021.7520587975966, 449.37831265306136, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -537.1188495066017, 139.8723180005327, 0, 1], 1, "左侧板", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\",\"highDrill\":[]}", 0, 0]
|
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
testPathCount(brs[0], 1);
|
|
|
|
|
})
|
|
|
|
|
test("造型的外框和内框厚度等于刀直径", () =>
|
|
|
|
|
{
|
|
|
|
|
let data =
|
|
|
|
|
[1, "Board", 3, 2, 118, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25702.129700607577, -1144.6658743078003, 0, 1], 2, 1200, 600, 18, true, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 2, 416.58619999999996, 325.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1187.5114150409554, -619.5823942857144, 0, 1], 2, 4, [1187.5114150409554, 619.5823942857144], 0, [1512.6519150409554, 619.5823942857144], 0, [1512.6519150409554, 1036.1685942857143], 0, [1187.5114150409554, 1036.1685942857143], 0, true, 1, 2, 404.58619999999996, 313.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1193.5114150409554, -625.5823942857144, 0, 1], 2, 4, [1506.6519150409554, 1030.1685942857143], 0, [1193.5114150409554, 1030.1685942857143], 0, [1193.5114150409554, 625.5823942857144], 0, [1506.6519150409554, 625.5823942857144], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25715.129700607577, -1015.7520587975966, 455.37831265306136, 1], 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25715.129700607577, -1021.7520587975966, 449.37831265306136, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1686.3109561311285, 139.8723180005327, 0, 1], 1, "左侧板", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\",\"highDrill\":[\"three\",\"three\",\"three\",\"three\",\"three\",\"three\"]}", 0, 0]
|
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
testPathCount(brs[0], 4);
|
|
|
|
|
})
|
|
|
|
|