添加点在线段内测试.

pull/68/head
ChenX 6 years ago
parent 200c5ee2fd
commit 01c921fd8d

@ -176,7 +176,20 @@ describe("", () =>
f.Read(); f.Read();
let pl = f.ReadObject() as Polyline; let pl = f.ReadObject() as Polyline;
pl.PtInCurve(p);//? expect(pl.PtInCurve(p)).toBeFalsy();
});
test('同样是因为精度导致的错误IKOTO', () =>
{
let f = new CADFile();
f.Data =
[1, ["Polyline", 1, 1, 4, false, 2, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2.1413261486708848, -0.2136470533821324, 0, 1], 2, 5, [376.7856405585377, -104.2720901386406], -0.9999999999999999, [378.6693614887703, -104.2720901386406], 0, [378.4693614887703, -104.2720901386406], 0.9999999999999999, [376.9856405585377, -104.2720901386406], 0, [376.7856405585377, -104.2720901386406], 0, false]]
let p = new Vector3().fromArray([380.6106876374412, -106.61364416876692, 0]);
f.Read();
let pl = f.ReadObject() as Polyline;
expect(pl.PtInCurve(p)).toBeFalsy();
}); });
}) })

Loading…
Cancel
Save