@@ -352,3 +352,46 @@ def test_full_arc(offset):
352
352
maxs = np .max (path .vertices , axis = 0 )
353
353
np .testing .assert_allclose (mins , - 1 )
354
354
np .testing .assert_allclose (maxs , 1 )
355
+
356
+
357
+ def test_disjoint_zero_length_segment ():
358
+ this_path = Path (
359
+ np .array ([
360
+ [824.85064295 , 2056.26489203 ],
361
+ [861.69033931 , 2041.00539016 ],
362
+ [868.57864109 , 2057.63522175 ],
363
+ [831.73894473 , 2072.89472361 ],
364
+ [824.85064295 , 2056.26489203 ]]),
365
+ np .array ([1 , 2 , 2 , 2 , 79 ], dtype = Path .code_type ))
366
+
367
+ outline_path = Path (
368
+ np .array ([
369
+ [859.91051028 , 2165.38461538 ],
370
+ [859.06772495 , 2149.30331334 ],
371
+ [859.06772495 , 2181.46591743 ],
372
+ [859.91051028 , 2165.38461538 ],
373
+ [859.91051028 , 2165.38461538 ]]),
374
+ np .array ([1 , 2 , 2 , 2 , 2 ],
375
+ dtype = Path .code_type ))
376
+
377
+ assert not outline_path .intersects_path (this_path )
378
+ assert not this_path .intersects_path (outline_path )
379
+
380
+
381
+ def test_intersect_zero_length_segment ():
382
+ this_path = Path (
383
+ np .array ([
384
+ [0 , 0 ],
385
+ [1 , 1 ],
386
+ ]))
387
+
388
+ outline_path = Path (
389
+ np .array ([
390
+ [1 , 0 ],
391
+ [.5 , .5 ],
392
+ [.5 , .5 ],
393
+ [0 , 1 ],
394
+ ]))
395
+
396
+ assert outline_path .intersects_path (this_path )
397
+ assert this_path .intersects_path (outline_path )
0 commit comments