from manim import *
class StrokeSurface(ThreeDScene):
    def construct(self):
        self.set_camera_orientation(phi=68 * DEGREES, theta=-48 * DEGREES)
        title = Text("自定义曲面分割线：黄色、宽度 2", font="STLiti", font_size=30).to_edge(UP)
        self.add_fixed_in_frame_mobjects(title)
        def func(u, v):
            return (u, v, u**2 - v**2)
        surf = Surface(func, u_range=[-1.4, 1.4], v_range=[-1.0, 1.0], resolution=(16, 16))
        surf.set_fill(BLUE_E, opacity=0.55).set_stroke(YELLOW, width=2.0)
        note = Text("stroke_color 设颜色，stroke_width 设分割线宽度", font="STLiti", font_size=21, color=YELLOW).to_edge(DOWN)
        self.add_fixed_in_frame_mobjects(note)
        self.play(FadeIn(title), run_time=0.6)
        self.play(FadeIn(surf), run_time=1.6)
        self.play(FadeIn(note), run_time=0.5)
        self.wait(3.6)
