mirror of https://gitee.com/cf-fz/WebCAD.git
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.
19 lines
1.0 KiB
19 lines
1.0 KiB
2 years ago
|
import { Polyline } from "../../src/api";
|
||
|
import { Contour } from "../../src/DatabaseServices/Contour";
|
||
|
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
|
||
|
|
||
|
test('多个布尔错误', () =>
|
||
|
{
|
||
|
let d =
|
||
|
[2, "Polyline", 8, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 142, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [942, -142], 0, [942, 202], 0, [430, 202], 0, [430.0000000000002, 18], 0, [430.0000000000002, 18], 0, [430.0000000000002, 0], 0, [0, 0], 0, [0, -142], 0, true, "Polyline", 8, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 142, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 142, 0, 1], 0, 2, 4, [0, 0], 0, [698, 0], 0, [698, 18], 0, [0, 18], 0, true];
|
||
|
|
||
|
let pls = LoadEntityFromFileData(d) as Polyline[];
|
||
|
|
||
|
let cons = pls.map(pl => Contour.CreateContour(pl));
|
||
|
|
||
|
let res = cons[0].GetSubtractListByMoreTargets(cons.slice(1));
|
||
|
|
||
|
expect(res.outlines.length).toBe(1);
|
||
|
expect(res.holes.length).toBe(0);
|
||
|
});
|