You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/__test__/EdgeSealing/LineCutBoardSealing.test.ts

26 lines
2.4 KiB

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();
});