Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active April 17, 2026 12:23
Show Gist options
  • Select an option

  • Save uwezi/0567c71ef2dc808a78c591757a022591 to your computer and use it in GitHub Desktop.

Select an option

Save uwezi/0567c71ef2dc808a78c591757a022591 to your computer and use it in GitHub Desktop.
[Mandala] Drawing a mandala. #manim #geometry #bezier
from manim import *
class manadala(Scene):
def construct(self):
center = Dot()
tri = RegularPolygon(n=3, radius=0.5).rotate(PI, about_point=ORIGIN)
circ = Circle(radius = 1)
petarc = VMobject().set_anchors_and_handles(
[np.cos(PI/8),np.sin(PI/8),0],
[1.5*np.cos(PI/8),1.5*np.sin(PI/8),0],
[1.2*np.cos(PI/8),0.2*np.sin(PI/8),0],
[1.5,0,0]
)
petals = VGroup(
VGroup(
petarc.copy(),
petarc.copy().rotate(PI,about_point=ORIGIN,axis=[1,0,0])
).rotate(i*PI/4, about_point=ORIGIN)
for i in range(8)
)
fline = VMobject(color=GREEN).set_points_as_corners(
[
[2,-2,0],[2,-0.5,0],[2.25,-0.5,0],[2.25,-1,0],[2.5,-1,0],[2.5,0,0],
]
)
frame = VGroup(
VGroup(
fline.copy(),
fline.copy().rotate(PI,about_point=ORIGIN,axis=[1,0,0])
).rotate(i*PI/2,about_point=ORIGIN)
for i in range(4)
)
self.play(Create(center), rate_func=rate_functions.linear)
self.play(Create(tri), rate_func=rate_functions.linear)
self.play(Create(circ), rate_func=rate_functions.linear)
self.play(Create(petals), rate_func=rate_functions.linear)
self.play(Create(frame), rate_func=rate_functions.linear)
self.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment