Skip to content

Surface has incorrect checkerboard coloring #4639

@BillyLjm

Description

@BillyLjm

Description of bug / unexpected behavior

I tried rendering a sphere with manim.Surface, and the checkerboard coloring is not alternating properly.
This is evident in the 2nd and 3rd row above the horizontal plane in the screenshot section below.

Expected behavior

The code should create a spherical surface which each cell having alternating, checkerboard colors.

How to reproduce the issue

Code for reproducing the problem
from manim import *

class ParaSphereDemo(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        sphere = Surface(
            lambda u, v: axes.c2p(
                *np.array([
                    np.sin(u) * np.cos(v),
                    np.sin(u) * np.sin(v),
                    np.cos(u)
                ])
            ),
            u_range=(-np.pi, np.pi),
            v_range=(-np.pi, np.pi),
            checkerboard_colors=False
        )
        self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
        self.add(axes, sphere)

Additional media files

Images/GIFs Image

Additional comments

I've already fixed this and will submit a PR soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions