mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
Update VMobject.is_smooth
This commit is contained in:
@ -654,9 +654,9 @@ class VMobject(Mobject):
|
|||||||
self.make_smooth(approx=approx)
|
self.make_smooth(approx=approx)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def is_smooth(self) -> bool:
|
def is_smooth(self, angle_tol=1 * DEGREES) -> bool:
|
||||||
dots = np.cos(self.get_joint_angles()[0::2])
|
angles = np.abs(self.get_joint_angles()[0::2])
|
||||||
return bool((dots > 1 - 1e-3).all())
|
return (angles < angle_tol).all()
|
||||||
|
|
||||||
def change_anchor_mode(self, mode: str) -> Self:
|
def change_anchor_mode(self, mode: str) -> Self:
|
||||||
assert mode in ("jagged", "approx_smooth", "true_smooth")
|
assert mode in ("jagged", "approx_smooth", "true_smooth")
|
||||||
|
Reference in New Issue
Block a user