diff --git a/__test__/Booloperate/bool2.test.ts b/__test__/Booloperate/bool2.test.ts index 0a8f837d3..646c65517 100644 --- a/__test__/Booloperate/bool2.test.ts +++ b/__test__/Booloperate/bool2.test.ts @@ -45,3 +45,18 @@ test('布尔错误', () => expect(regs[0].ShapeManager.ShapeCount).toBe(1); }); + +/* +如果曲线全部没有被破坏,那么有可能是内槽,也有可能将源轮廓分裂. +*/ +test("包含差集的对象,差一点就可以切断", () => +{ + let data = + [2, "Region", 2, 1, 103, false, 7, 0, [6.123233995736766e-17, -1, 0, 0, 1, 6.123233995736766e-17, 0, 0, 0, 0, 1, 0, 7844.613399859296, 9627.014177659035, -0.000003860448487102985, 1], 1, 1, 1, 1, 1, "Polyline", 2, 1, 0, false, 7, 0, [6.123233995736766e-17, -1, 0, 0, 1, 6.123233995736766e-17, 0, 0, 0, 0, 1, 0, 7844.613399859296, 9627.014177659035, -0.000003860448487102985, 1], 0, 2, 5, [7094.5404957357605, -503.2636790371175], 0, [7942.380560966396, -503.2636790371175], 0, [7942.380560966396, 768.496418808835], 0, [7094.5404957357605, 768.496418808835], 0, [7094.5404957357605, -503.2636790371175], 0, true, 0, "Region", 2, 1, 102, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 7341.349720822179, 1684.633616692639, -0.000003860448487102985, 1], 1, 1, 1, 1, 1, "Polyline", 2, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 7341.349720822179, 1684.633616692639, -0.000003860448487102985, 1], 0, 2, 6, [485.26368725963897, 323.50923230733497], 0, [485.26368725963886, 847.8400336226459], 0, [503.26368725963897, 847.8400336226459], 0, [503.26368725963897, 335.5092294277747], 0, [503.26368725963897, 0.00018987264593306463], 0, [485.26368725963897, 0.00018987264593306463], 0, true, 0] + + let regs: Region[] = LoadRegionsFromFileData(data); + regs[0].BooleanOper(regs[1], BoolOpeartionType.Subtract); + + expect(regs[0].ShapeManager.ShapeCount).toBe(1); + expect(regs[0].ShapeManager.ShapeList[0].Holes.length).toBe(1); +});