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__/Booloperate/bool5.test.ts

15 lines
1.4 KiB

import { LoadRegionsFromFileData } from "../Utils/LoadEntity.util";
import { BoolOpeartionType } from "../../src/GraphicsSystem/BoolOperateUtils";
test('差集共线(圆)', () =>
{
let d =
{ "file": [2, "Region", 7, 2, 103, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 1, 1, 1, 1, "Polyline", 7, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 6, [807.6555023923443, 146.3157894736844], 0, [1710.7559808612436, 146.3157894736844], 0, [1710.7559808612436, 706.1818181818184], 0, [1459.7725447442663, 706.1818181818184], -0.9999999999999999, [1058.6389385093214, 706.1818181818184], 0, [807.6555023923443, 706.1818181818184], 0, true, 0, "Region", 7, 2, 105, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1259.205741626794, 706.1818181818184, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1259.205741626794, 706.1818181818184, 0, 1], 1, 1, 1, 1, "Circle", 7, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1259.205741626794, 706.1818181818184, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 1, 200.56680311747243, 0], "basePt": { "x": 807.6555023923443, "y": 146.3157894736844, "z": 0 } };
let regs = LoadRegionsFromFileData(d);
regs[0].BooleanOper(regs[1], BoolOpeartionType.Subtract);
expect(regs[0].Area).toMatchSnapshot();
});