From fa3e2e58542525a92e4e4f640fa8f193eb0d498b Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 1 Jul 2026 05:49:32 +0530 Subject: [PATCH] fix(mobject): get_start/get_end fall back to submobject points get_start/get_end raised "no points" whenever the top-level mobject had no own points, even though its submobjects did. This breaks e.g. the result of TransformFromCopy(Text(...), circle), whose points end up on submobjects. Fall back to family_members_with_points before erroring. Fixes #4510 Co-authored-by: Cursor --- manim/mobject/mobject.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index 615d6b90e7..ccc5e8bd2a 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -2380,11 +2380,21 @@ def get_z(self, direction: Vector3DLike = ORIGIN) -> float: def get_start(self) -> Point3D: """Returns the point, where the stroke that surrounds the :class:`~.Mobject` starts.""" + # Points may live only on submobjects (e.g. a Text/Tex-shaped mobject, or + # the result of a Transform onto one), so fall back to the family (#4510). + if self.has_no_points(): + members = self.family_members_with_points() + if members: + return members[0].get_start() self.throw_error_if_no_points() return np.array(self.points[0]) def get_end(self) -> Point3D: """Returns the point, where the stroke that surrounds the :class:`~.Mobject` ends.""" + if self.has_no_points(): + members = self.family_members_with_points() + if members: + return members[-1].get_end() self.throw_error_if_no_points() return np.array(self.points[-1])