|
|
@ -1,5 +1,5 @@
|
|
|
|
import { Polyline } from "../../src/DatabaseServices/Entity/Polyline";
|
|
|
|
|
|
|
|
import { Vector2 } from "three";
|
|
|
|
import { Vector2 } from "three";
|
|
|
|
|
|
|
|
import { Polyline } from "../../src/DatabaseServices/Entity/Polyline";
|
|
|
|
import { IntersectOption } from "../../src/GraphicsSystem/IntersectWith";
|
|
|
|
import { IntersectOption } from "../../src/GraphicsSystem/IntersectWith";
|
|
|
|
describe("相交", () =>
|
|
|
|
describe("相交", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,7 +25,7 @@ describe("相交", () =>
|
|
|
|
bul: 2.01
|
|
|
|
bul: 2.01
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
let pts = pl.IntersectWith(p2, IntersectOption.OnBothOperands);
|
|
|
|
let pts = pl.IntersectWith(p2, IntersectOption.ExtendNone);
|
|
|
|
expect(pts.length).toBe(0);
|
|
|
|
expect(pts.length).toBe(0);
|
|
|
|
let pts1 = pl.IntersectWith(p2, IntersectOption.ExtendBoth);
|
|
|
|
let pts1 = pl.IntersectWith(p2, IntersectOption.ExtendBoth);
|
|
|
|
expect(pts1.length).toBe(2);
|
|
|
|
expect(pts1.length).toBe(2);
|
|
|
@ -96,7 +96,7 @@ describe("相交", () =>
|
|
|
|
bul: 0
|
|
|
|
bul: 0
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
let pts = pl.IntersectWith(p2, IntersectOption.OnBothOperands);
|
|
|
|
let pts = pl.IntersectWith(p2, IntersectOption.ExtendNone);
|
|
|
|
expect(pts.length).toBe(1);
|
|
|
|
expect(pts.length).toBe(1);
|
|
|
|
let pts1 = pl.IntersectWith(p2, IntersectOption.ExtendBoth);
|
|
|
|
let pts1 = pl.IntersectWith(p2, IntersectOption.ExtendBoth);
|
|
|
|
expect(pts1.length).toBe(2);
|
|
|
|
expect(pts1.length).toBe(2);
|
|
|
@ -104,10 +104,10 @@ describe("相交", () =>
|
|
|
|
expect(pts2.length).toBe(2);
|
|
|
|
expect(pts2.length).toBe(2);
|
|
|
|
let pts3 = pl.IntersectWith(p2, IntersectOption.ExtendArg);
|
|
|
|
let pts3 = pl.IntersectWith(p2, IntersectOption.ExtendArg);
|
|
|
|
expect(pts3.length).toBe(1);
|
|
|
|
expect(pts3.length).toBe(1);
|
|
|
|
let pts4 = pl.IntersectWith(p3, IntersectOption.OnBothOperands);
|
|
|
|
let pts4 = pl.IntersectWith(p3, IntersectOption.ExtendNone);
|
|
|
|
expect(pts).toMatchSnapshot();
|
|
|
|
expect(pts).toMatchSnapshot();
|
|
|
|
expect(pts4.length).toBe(2);
|
|
|
|
expect(pts4.length).toBe(2);
|
|
|
|
let pts5 = pl.IntersectWith(p4, IntersectOption.OnBothOperands);
|
|
|
|
let pts5 = pl.IntersectWith(p4, IntersectOption.ExtendNone);
|
|
|
|
expect(pts5.length).toBe(1);
|
|
|
|
expect(pts5.length).toBe(1);
|
|
|
|
let pts6 = pl.IntersectWith(p4, IntersectOption.ExtendArg);
|
|
|
|
let pts6 = pl.IntersectWith(p4, IntersectOption.ExtendArg);
|
|
|
|
expect(pts6.length).toBe(2);
|
|
|
|
expect(pts6.length).toBe(2);
|
|
|
|