From 01c921fd8d29eadb414ae9d064dcf70053fbfd4f Mon Sep 17 00:00:00 2001 From: ChenX Date: Fri, 22 Jun 2018 23:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=82=B9=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=AE=B5=E5=86=85=E6=B5=8B=E8=AF=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __test__/Polyline/PointInPolyline.test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/__test__/Polyline/PointInPolyline.test.ts b/__test__/Polyline/PointInPolyline.test.ts index a20f06791..157892baa 100644 --- a/__test__/Polyline/PointInPolyline.test.ts +++ b/__test__/Polyline/PointInPolyline.test.ts @@ -176,7 +176,20 @@ describe("", () => f.Read(); 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(); }); })