Repository: ManimCommunity/manim
File: manim/mobject/three_dimensions.py (Python)

Code before:
from ..mobject.opengl_mobject import OpenGLMobject
from ..mobject.types.vectorized_mobject import VGroup, VMobject
from ..utils.color import *
from ..utils.deprecation import deprecated_params
from ..utils.iterables import tuplify
from ..utils.space_ops import normalize, z_to_vector


class ThreeDVMobject(VMobject):
    def __init__(self, shade_in_3d=True, **kwargs):
        super().__init__(shade_in_3d=shade_in_3d, **kwargs)


class ParametricSurface(VGroup):
    """Creates a Parametric Surface

    Parameters
    ----------
    func : :class:`Callable[[float,float],np.ndarray]`
        The function of the surface
    u_range : :class:`Sequence[float]`
        The range of the u variable (replacing u_min and u_max)
    v_range : :class:`Sequence[float]`
        The range of the v variable (replacing v_min and v_max)
    resolution : :class:`int`
        The number of samples of the surface

    Examples
    --------
    .. manim:: ParaSurface
        :save_last_frame:

        class ParaSurface(ThreeDScene):
            def func(self, u, v):
                return np.array([np.cos(u) * np.cos(v), np.cos(u) * np.sin(v), u])

            def construct(self):
                axes = ThreeDAxes(x_range=[-4,4], x_length=8)
                surface = ParametricSurface(
                    lambda u, v: axes.c2p(*self.func(u, v)),
                    u_range=[-PI, PI],
                    v_range=[0, TAU]
                )
                self.set_camera_orientation(theta=70 * DEGREES, phi=75 * DEGREES)
                self.add(axes, surface)
    """

    @deprecated_params(
        params="u_min,u_max,v_min,v_max",
        since="v0.8.0",
        until="v0.9.0",

Review comment (suggestion):
The backticks make the text code-formatted.
```suggestion
    func : :class:`Callable[[float,float],np.ndarray]`
        The function that defines the surface.
    u_range : :class:`Sequence[float]`
        The range of the ``u`` variable: ``(u_min, u_max)``.
    v_range : :class:`Sequence[float]`
        The range of the ``v`` variable: ``(v_min, v_max)``.
    resolution : :class:`int`
        The number of samples taken of the surface.
```

Code after:
    from colour import Color

from manim.mobject.opengl_compatibility import ConvertToOpenGL

from ..constants import *
from ..mobject.geometry import Circle, Square
from ..mobject.mobject import *
from ..mobject.opengl_mobject import OpenGLMobject
from ..mobject.types.vectorized_mobject import VGroup, VMobject
from ..utils.color import *
from ..utils.deprecation import deprecated_params
from ..utils.iterables import tuplify
from ..utils.space_ops import normalize, z_to_vector


class ThreeDVMobject(VMobject, metaclass=ConvertToOpenGL):
    def __init__(self, shade_in_3d=True, **kwargs):
        super().__init__(shade_in_3d=shade_in_3d, **kwargs)


class ParametricSurface(VGroup):
    """Creates a Parametric Surface

    Parameters
    ----------
    func :
        The function that defines the surface.
    u_range :
        The range of the ``u`` variable: ``(u_min, u_max)``.
    v_range :
        The range of the ``v`` variable: ``(v_min, v_max)``.
    resolution :
        The number of samples taken of the surface. A tuple
        can be used to define different resolutions for ``u`` and
        ``v`` respectively.

    Examples
    --------
    .. manim:: ParaSurface
        :save_last_frame:

        class ParaSurface(ThreeDScene):
            def func(self, u, v):
                return np.array([np.cos(u) * np.cos(v), np.cos(u) * np.sin(v), u])

            def construct(self):
                axes = ThreeDAxes(x_range=[-4,4], x_length=8)
                surface = ParametricSurface(
                    lambda u, v: axes.c2p(*self.func(u, v)),
                    u_range=[-PI, PI],
                    v_range=[0, TAU]