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__/Board/2dpath.test.ts

27 lines
3.5 KiB

import { end } from "xaop";
import { HostApplicationServices } from "../../src/ApplicationServices/HostApplicationServices";
import { Entity } from "../../src/DatabaseServices/Entity/Entity";
import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util";
import "../Utils/jest.util";
HostApplicationServices.show2DPathObject = true;
test('二维刀路测试(常规)', async () =>
{
let brd = { "file": [1, "Board", 10, 2, 100, 0, 1, 3, 71, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 809.3041405064287, 638.3657841841923, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 809.3041405064287, 638.3657841841923, 0, 1], 0, 0, 1, 3, 800, 500, 18, true, "Polyline", 10, 2, 0, 0, 0, 7, 71, [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, [500, 0], 0, [500, 800], 0, [0, 800], 0, true, 0, 3, 0, 0, 0, 0, 0, 13, 2, "背板", "", "", "", "", "", 0, 0, "阿萨S", 2, 0, "0", "0", "0", "0", "", "", "", 4, "阿萨S", "阿萨S", "阿萨S", "阿萨S", true, true, 1, "1", "1", 0, 0, 0, 0, 0, 0, 0, true, 1, "Polyline", 10, 2, 0, 0, 0, 1, 71, [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, 3, [264.1772151898734, 924.5569620253166], 0, [264.1772151898734, 492.1518987341773], 0, [792.2784810126584, 492.1518987341773], 0, false, 0, 1, 10, 0, "4472", 3, 0, "12号刀(1)", 0, null, 1, "4472", "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -9.99999999999909, -4.547473508864641e-13, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -11939.567631031936, -1853.7579836292566, 0, 1], 0, 0, 1, 2, 31, [19.99999999999818, 2.2737367544323206e-13], 0, [0, 0], 0, [-1.500000000003638, 1.0000000000002274], 0, [-10.000000000120053, 1.0000000004658887], 0, [-10.000000000032742, 4.500000000465889], 0, [-1.500000000003638, 4.500000000465889], 0, [-3.637978807091713e-12, 5.500000000465889], 0, [-1.2005330063402653e-10, 8.499999999883812], 0, [-1.5000000001200533, 9.499999999883812], 0, [-20.000000000120053, 9.500000000611408], 0, [-20.000000000120053, 13.500000000465889], 0, [-11.499999772295268, 13.500000000611408], 0, [-9.999999772411684, 14.50000000069872], 0, [-9.999999772564479, 17.50000000046589], 0, [-11.499999772613592, 18.500000000466116], 0, [-11.499999772613592, 48.500000000466116], 0, [31.499999772609954, 48.50000000046589], 0, [31.499999772609954, 18.50000000046589], 0, [29.999999772559022, 17.50000000046589], 0, [29.999999772406227, 14.50000000069872], 0, [31.49999977228981, 13.500000000611408], 0, [40.000000000114596, 13.500000000465889], 0, [40.000000000114596, 9.500000000611408], 0, [21.500000000114596, 9.499999999883812], 0, [20.000000000114596, 8.499999999883812], 0, [19.99999999999818, 5.500000000465889], 0, [21.49999999999818, 4.500000000465889], 0, [30.000000000027285, 4.500000000465889], 0, [30.000000000114596, 1.0000000004658887], 0, [21.49999999999818, 1.0000000000002274], 0, [19.99999999999818, 2.2737367544323206e-13], 0, false, 0], "basePt": { "x": 809.3041405064287, "y": 620.3657841841923, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] };
let br = LoadBoardsFromFileData(brd)[0];
br.MeshGeometry;//预读取
await new Promise<void>((res, rej) =>
{
end((new Entity()).AsyncUpdated, function ()
{
res();
});
});
expect(br.MeshGeometry.getAttribute("position").count).toMatchNumberSnapshot(0);
expect(br.EdgeGeometry.getAttribute("position").count).toMatchNumberSnapshot(0);
});