import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
p = np.array([3,0,0])
wongklom = mnm.Circle(arc_center=p,
radius=3,
stroke_width=12,
color='#aaffaa')
self.play(
mnm.Write(wongklom),
run_time=1
)
self.wait(0.5)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
wongklom = mnm.Circle(radius=3,
stroke_width=14,
color='#fffb99',
fill_opacity=0.5,
fill_color='#b64a9b')
self.play(
wongklom.animate.set_fill(color='#2eab75',
opacity=1),
run_time=1
)
self.play(
wongklom.animate.set_style(stroke_color='#7ccbd4',
stroke_width=30,
fill_color='#ab7b2e',
fill_opacity=0.7),
run_time=1
)
self.play(
wongklom.animate.set_stroke(color='#be7cd4',
width=1),
run_time=1
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
wongri = mnm.Ellipse(width=7,
height=4,
color='#c1d9ad',
fill_opacity=1,
fill_color='#937cd4')
self.play(
wongri.animate.set_width(12,stretch=True),
run_time=1
)
self.play(
wongri.animate.set_height(6,stretch=True),
run_time=1
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
list_chut = []
for i in range(11):
xy = np.array([i-6,(i-9)/3,0]) # ตำแหน่งจุด
r = 0.2+0.02*i**2 # รัศมี เพิ่มขึ้นเรื่อยๆ
chut = mnm.Dot(xy,radius=r,color='#c1d9ad')
list_chut.append(chut)
# นำมาจัดรวมกลุ่ม
vg = mnm.VGroup(*list_chut)
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
p = np.array([2,-2,0])
arc = mnm.Arc(np.radians(30),
np.radians(160),
radius=4,
arc_center=p,
color='#eeaaaa',
stroke_width=20)
self.play(
mnm.Write(arc),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
p1 = np.array([-5,0,0]) # จุดเริ่ม
p2 = np.array([5,-1,0]) # จุดปลาย
# วาดหลายเส้นให้มีจุดต้นจุดปลายที่เดียวกันแต่มุมกวาดต่างกัน
lis_arc = []
for i in range(12):
a = np.radians(120-i*25)
arc = mnm.ArcBetweenPoints(p1,p2,
angle=a,
color='#bbeeaa',
stroke_width=15)
lis_arc.append(arc)
# รวมเส้นทั้งหมดเข้าไว้ในกลุ่ม
vg = mnm.VGroup(*lis_arc)
# ใส่จุดเริ่มกับจุดปลายไว้ก่อน
self.add(mnm.Dot(p1),mnm.Dot(p2))
# ทำการวาดเส้นโค้ง
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
self.play(
mnm.Write(
mnm.VGroup(
mnm.Annulus(inner_radius=0.1,outer_radius=0.5,color='#5c2496'),
mnm.Annulus(inner_radius=1.1,outer_radius=1.8,color='#884cc6'),
mnm.Annulus(inner_radius=2.1,outer_radius=3.1,color='#b081e1')
)
),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
lis_suan = []
for i in range(12):
suan = mnm.AnnularSector(inner_radius=3,
outer_radius=2,
angle=np.radians(25),
start_angle=np.radians(i*30),
color='#81c9e1')
lis_suan.append(suan)
vg = mnm.VGroup(*lis_suan)
self.play(
mnm.Write(vg),
run_time=1.5
)
import manimlib as mnm
import numpy as np
class Manimala(mnm.Scene):
def construct(self):
lis_suan = []
for i in range(24):
suan = mnm.Sector(outer_radius=3.7,
angle=np.radians(12),
start_angle=np.radians(i*15),
color='#ef9ddf')
lis_suan.append(suan)
vg = mnm.VGroup(*lis_suan)
self.play(
mnm.Write(vg),
run_time=1.5
)
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ