mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 23:07:44 +00:00
Fix Mobject.looks_identical
This commit is contained in:
parent
5c33c7e4a8
commit
4db01fd221
1 changed files with 11 additions and 2 deletions
|
|
@ -667,8 +667,17 @@ class Mobject(object):
|
||||||
if set(d1).difference(d2):
|
if set(d1).difference(d2):
|
||||||
return False
|
return False
|
||||||
for key in d1:
|
for key in d1:
|
||||||
if not np.isclose(d1[key], d2[key]).all():
|
try:
|
||||||
return False
|
if isinstance(d1[key], np.ndarray) and isinstance(d2[key], np.ndarray):
|
||||||
|
if not d1[key].size == d2[key].size:
|
||||||
|
return False
|
||||||
|
if not np.isclose(d1[key], d2[key]).all():
|
||||||
|
return False
|
||||||
|
except Exception as e:
|
||||||
|
print(self)
|
||||||
|
print(d1[key])
|
||||||
|
print(d2[key])
|
||||||
|
raise e
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_same_shape_as(self, mobject: Mobject) -> bool:
|
def has_same_shape_as(self, mobject: Mobject) -> bool:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue