[Path] Improve comparisons: compare vertices
This commit is contained in:
parent
9a76ce5b66
commit
838c742651
1 changed files with 8 additions and 0 deletions
|
|
@ -265,6 +265,14 @@ class Path(Shape):
|
||||||
if self.cap_extensions is None:
|
if self.cap_extensions is None:
|
||||||
return True
|
return True
|
||||||
return tuple(self.cap_extensions) < tuple(other.cap_extensions)
|
return tuple(self.cap_extensions) < tuple(other.cap_extensions)
|
||||||
|
if not numpy.array_equal(self.vertices, other.vertices):
|
||||||
|
min_len = min(self.vertices.shape[0], other.vertices.shape[0])
|
||||||
|
eq_mask = self.vertices[:min_len] != other.vertices[:min_len]
|
||||||
|
eq_lt = self.vertices[:min_len] < other.vertices[:min_len]
|
||||||
|
eq_lt_masked = eq_lt[eq_mask]
|
||||||
|
if eq_lt_masked.size > 0:
|
||||||
|
return eq_lt_masked.flat[0]
|
||||||
|
return self.vertices.shape[0] < other.vertices.shape[0]
|
||||||
if self.repetition != other.repetition:
|
if self.repetition != other.repetition:
|
||||||
return rep2key(self.repetition) < rep2key(other.repetition)
|
return rep2key(self.repetition) < rep2key(other.repetition)
|
||||||
return annotations_lt(self.annotations, other.annotations)
|
return annotations_lt(self.annotations, other.annotations)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue