From dd6e99ab2ed6c0be22c386ffe729ce5c52c63894 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sun, 16 Aug 2020 09:46:08 -0700 Subject: [PATCH] Make it possible to set a prefered direction for ShowCreation on surfaces --- manimlib/mobject/types/surface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manimlib/mobject/types/surface.py b/manimlib/mobject/types/surface.py index 94455ced..51a1353b 100644 --- a/manimlib/mobject/types/surface.py +++ b/manimlib/mobject/types/surface.py @@ -24,6 +24,7 @@ class ParametricSurface(Mobject): "opacity": 1.0, "gloss": 0.3, "shadow": 0.4, + "prefered_creation_axis": 1, # For du and dv steps. Much smaller and numerical error # can crop up in the shaders. "epsilon": 1e-5, @@ -125,7 +126,9 @@ class ParametricSurface(Mobject): self.rgbas = interpolate(mobject1.rgbas, mobject2.rgbas, alpha) return self - def pointwise_become_partial(self, smobject, a, b, axis=1): + def pointwise_become_partial(self, smobject, a, b, axis=None): + if axis is None: + axis = self.prefered_creation_axis assert(isinstance(smobject, ParametricSurface)) self.points[:] = smobject.points[:] if a <= 0 and b >= 1: