diff --git a/__test__/EdgeSealing/LineCutBoardSealing.test.ts b/__test__/EdgeSealing/LineCutBoardSealing.test.ts new file mode 100644 index 000000000..3d031e6bc --- /dev/null +++ b/__test__/EdgeSealing/LineCutBoardSealing.test.ts @@ -0,0 +1,25 @@ +import { Board } from "../../src/DatabaseServices/Entity/Board"; +import { Polyline } from "../../src/DatabaseServices/Entity/Polyline"; +import { LoadEntityFromFileData } from "../Utils/LoadEntity.util"; + +test('线性切割后封边对应错误', () => +{ + let data = { "file": [3, "Board", 10, 2, 100, 0, 1, 3, 71, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 18, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -781.9999999999995, -280, 0, 1], 0, 0, 1, 3, 1777, 1182, 18, true, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -781.9999999999995, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -781.9999999999995, 0, 0, 1], 0, 0, 1, 2, 4, [781.9999999999995, 0], 0, [781.9999999999995, 1776.9999999999995], 0, [1963.9999999999995, 1777], 0, [1963.9999999999995, 0], 0, true, 0, 3, 0, 0, 0, 0, 0, 11, 2, "背板", "", "", "", "多层板", "盛橡木多层板", 0, 1, "**多种**", 2, 0, "0", "1", "1", "1", "", "", "", 4, "无效配置", "无效配置", "无效配置", "无效配置", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, null, "Polyline", 10, 2, 107, 0, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, 2, 4, [0, 0], 0, [591, 0], 0, [591, 1776.9999999999998], 0, [0, 1776.9999999999995], 0, true, "Polyline", 10, 2, 108, 0, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -591, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -591, 0, 0, 1], 0, 0, 1, 2, 4, [591, 0], 0, [1182, 0], 0, [1182, 1777], 0, [591, 1776.9999999999998], 0, true], "basePt": { "x": 0, "y": 0, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] }; + let ents = LoadEntityFromFileData(data); + let br1 = ents[0] as Board; + + let cus = [ents[1], ents[2]] as Polyline[]; + let br2 = br1.Clone(); + br1.ContourCurve = cus[0]; + br2.ContourCurve = cus[1]; + + expect(br1.BoardProcessOption.sealedDown).toMatchSnapshot(); + expect(br1.BoardProcessOption.sealedLeft).toMatchSnapshot(); + expect(br1.BoardProcessOption.sealedRight).toMatchSnapshot(); + expect(br1.BoardProcessOption.sealedUp).toMatchSnapshot(); + + expect(br2.BoardProcessOption.sealedDown).toMatchSnapshot(); + expect(br2.BoardProcessOption.sealedLeft).toMatchSnapshot(); + expect(br2.BoardProcessOption.sealedRight).toMatchSnapshot(); + expect(br2.BoardProcessOption.sealedUp).toMatchSnapshot(); +}); diff --git a/__test__/EdgeSealing/__snapshots__/LineCutBoardSealing.test.ts.snap b/__test__/EdgeSealing/__snapshots__/LineCutBoardSealing.test.ts.snap new file mode 100644 index 000000000..cb977835e --- /dev/null +++ b/__test__/EdgeSealing/__snapshots__/LineCutBoardSealing.test.ts.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`线性切割后封边对应错误 1`] = `"1"`; + +exports[`线性切割后封边对应错误 2`] = `"1"`; + +exports[`线性切割后封边对应错误 3`] = `"1"`; + +exports[`线性切割后封边对应错误 4`] = `"0"`; + +exports[`线性切割后封边对应错误 5`] = `"1"`; + +exports[`线性切割后封边对应错误 6`] = `"1"`; + +exports[`线性切割后封边对应错误 7`] = `"1"`; + +exports[`线性切割后封边对应错误 8`] = `"0"`;