!762 补充差集单元测试

pull/762/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 50710f1342
commit e6d40b9314

@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`差集共线(圆) 1`] = `442426.78778792813`; exports[`差集共线(圆) 1`] = `442426.78778792813`;
exports[`差集问题 1`] = `546438.8158863322`;

@ -12,3 +12,14 @@ test('差集共线(圆)', () =>
expect(regs[0].Area).toMatchSnapshot(); expect(regs[0].Area).toMatchSnapshot();
}); });
test('差集问题', () =>
{
let d = { "file": [2, "Region", 7, 2, 179, 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, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 2, "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, 4, [166.89661244019044, 262.16359808612503], 0, [361.0113684210519, 262.16359808612503], 0, [361.0113684210519, 475.46411483253655], 0, [166.89661244019044, 475.46411483253655], 0, true, "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, 4, [224.89278468899556, 700.9699521531093], 0, [516.496842105263, 700.9699521531093], 0, [516.496842105263, 756.458181818181], 0, [224.89278468899556, 756.458181818181], 0, true, "Region", 7, 2, 206, false, 1, 3, 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, 4, [134.10526315789502, 423.99555980861203], 0, [419.38373205741664, 423.99555980861203], 0, [419.38373205741664, 903.3818181818185], 0, [134.10526315789502, 903.3818181818185], 0, true, 0], "basePt": { "x": 0, "y": 0, "z": 0 } };
let regs = LoadRegionsFromFileData(d);
regs[0].BooleanOper(regs[1], BoolOpeartionType.Subtract);
expect(regs[0].ShapeManager.ShapeList.length).toBe(1);
expect(regs[0].Explode().length).toBe(16);
expect(regs[0].Area).toMatchSnapshot();
});

Loading…
Cancel
Save