mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
532 stars 134 forks source link

Intersection is not counted properly #212

Open Sulyma30 opened 1 year ago

Sulyma30 commented 1 year ago

If a bbox degenerates into an interval (x_min=x_max or y_min=y_max), then corresponding width=0 and intersection is not counted

Sulyma30 commented 1 year ago

We can instead check whether any outermost point of one interval is inside of another interval:

def check_intervals_intersection(a,b,c,d): if (a <= d and a >= c) or (b <= d and b >= c) or (c <= b and c >= a) or (d <= b and d >= a): return True else: return False