Simpler VMobject.get_num_curves

This commit is contained in:
Grant Sanderson
2023-01-12 10:40:18 -08:00
parent f3e91db581
commit ab30f085b4

View File

@ -683,7 +683,7 @@ class VMobject(Mobject):
return bezier(self.get_nth_curve_points(n)) return bezier(self.get_nth_curve_points(n))
def get_num_curves(self) -> int: def get_num_curves(self) -> int:
return max((len(self.get_points()) - 1) // 2, 0) return len(self.data["points"]) // 2
def quick_point_from_proportion(self, alpha: float) -> Vect3: def quick_point_from_proportion(self, alpha: float) -> Vect3:
# Assumes all curves have the same length, so is inaccurate # Assumes all curves have the same length, so is inaccurate