ParametricSurface replaces the role of SurfaceMobject, and instead of tracking normals infinitesimal nudges are tracked

This commit is contained in:
Grant Sanderson
2020-06-05 11:12:52 -07:00
parent efe15cf2f0
commit cacfe67fe1
10 changed files with 155 additions and 138 deletions

View File

@ -1,6 +1,6 @@
from manimlib.constants import *
from manimlib.mobject.geometry import Square
from manimlib.mobject.types.surface_mobject import ParametricSurface
from manimlib.mobject.types.surface import ParametricSurface
from manimlib.mobject.types.vectorized_mobject import VGroup
@ -8,7 +8,7 @@ from manimlib.mobject.types.vectorized_mobject import VGroup
class Sphere(ParametricSurface):
CONFIG = {
"resolution": (96, 48),
"resolution": (100, 50),
"radius": 1,
"u_range": (0, TAU),
"v_range": (0, PI),
@ -18,10 +18,19 @@ class Sphere(ParametricSurface):
return self.radius * np.array([
np.cos(u) * np.sin(v),
np.sin(u) * np.sin(v),
np.cos(v)
-np.cos(v)
])
class Clyinder(ParametricSurface):
CONFIG = {
}
def func(self, u, v):
pass
class Cube(VGroup):
CONFIG = {
"fill_opacity": 0.75,