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__/Interest/3d.test.ts

16 lines
1.2 KiB

import { Curve } from "../../src/DatabaseServices/Entity/Curve";
import { IntersectOption } from "../../src/GraphicsSystem/IntersectWith";
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
test('错误的使用2维点判断导致的交点丢失', () =>
{
let d =
{ "file": [2, "Polyline", 8, 2, 107, false, 1, 7, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 684.2249657064676, 1564.334705075446, -91.90672153635137, 1], 0, 0, true, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 684.2249657064676, 1564.334705075446, -91.90672153635137, 1], 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 2000], 0, [0, 2000], 0, true, "Circle", 8, 2, 108, false, 1, 7, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 684.2249657064676, 2164.334705075446, 908.0932784636486, 1], 0, 0, true, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 684.2249657064472, 518.1069958847737, 0, 1], 0, 1, 308.64197530864226], "basePt": { "x": 684.2249657064676, "y": 1564.334705075446, "z": -91.90672153635137 }, "ucs": [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1] };
let cus = LoadEntityFromFileData(d) as Curve[];
let ipts = cus[0].IntersectWith2(cus[1], IntersectOption.ExtendNone);
expect(ipts.length).toBe(2);
});