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(); }); })