improvements

This commit is contained in:
Debucquoy Anthony 2025-03-10 14:32:46 +01:00
parent 669da197fe
commit 18468933ca
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

22
main.py
View File

@ -49,7 +49,7 @@ class snowflake(Scene):
vg = VGroup()
self.add(vg)
for i in range(5):
for i in range(4):
points = SegmentedLine(points)
new_vg = VGroup(*[Dot(p, radius=0.1/(i+1)) for p in points])
@ -63,6 +63,26 @@ class snowflake(Scene):
self.remove(new_vg)
self.play(Uncreate(vg))
segment2 = segment.copy()
segment3 = segment.copy()
segs = VGroup(segment, segment2, segment3)
mid = -(math.sqrt(14**2 - 7**2))/ 2 + 1
self.play(Rotate(segment2, 2 * PI / 3, axis=[0,0,1], about_point=[0, mid, 0]),
Rotate(segment3, -2 * PI / 3, axis=[0,0,1], about_point=[0, mid, 0]))
# self.play(segs.animate.center())
# self.play(segs.animate.scale(0.5))
self.play(segs.animate.scale(0.5).center())
lines = [
Line(segment.get_all_points()[0], segment.get_all_points()[-1], color=RED),
Line(segment2.get_all_points()[0], segment2.get_all_points()[-1], color=RED),
Line(segment3.get_all_points()[0], segment3.get_all_points()[-1], color=RED)
]
self.play(Create(VGroup(*lines)))
self.play(*[FadeOut(mob) for mob in self.mobjects])