A community-maintained Python framework for creating mathematical animations.
Added support for changing and interpolating stroke_width on PMobjects
Grant Sanderson42e0cd07acb0
diff --git a/manimlib/mobject/types/point_cloud_mobject.py b/manimlib/mobject/types/point_cloud_mobject.pyindex f7b087aba..44ef3f98a 100644--- a/manimlib/mobject/types/point_cloud_mobject.py+++ b/manimlib/mobject/types/point_cloud_mobject.py@@ -50,6 +50,15 @@ class PMobject(Mobject):self.color = colorreturn self+ def get_stroke_width(self):+ return self.stroke_width++ def set_stroke_width(self, width, family=True):+ mobs = self.family_members_with_points() if family else [self]+ for mob in mobs:+ mob.stroke_width = width+ return self+# def set_color_by_gradient(self, start_color, end_color):def set_color_by_gradient(self, *colors):self.rgbas = np.array(list(map(@@ -158,6 +167,12 @@ class PMobject(Mobject):self.rgbas = interpolate(mobject1.rgbas, mobject2.rgbas, alpha)+ self.set_stroke_width(interpolate(+ mobject1.get_stroke_width(),+ mobject2.get_stroke_width(),+ alpha,+ ))+ return selfdef pointwise_become_partial(self, mobject, a, b):lower_index, upper_index = [