3b1b / manim

Animation engine for explanatory math videos
MIT License
60.43k stars 5.71k forks source link

Requesting .svg files for diffyq fourier_series.py example #1078

Closed lakeside-park closed 4 years ago

lakeside-park commented 4 years ago

Hi - A bit greedy here I may be. I say I am being greedy here because I am a total newbie to manim but managed to get the fourier_montage_scenes.py running on my PC even though I am skipping all the hard work required to get that far developing these scenes.

One of my favorive 3b1b scenes is the trebleclef drawn with the fourier series vectors so I wanted to reproduce that here. Trouble is I do not have the TrebleClef (svg?) file or any of the other files referenced in the .py montage. I found a TrebleClef.svg file on the internet and got the code to run through the end. Made some cool pictures but it was obvious the .svg file I downloaded did not work correct (see attached .png) Anyway, I looked in the github repositories for those svg files and could not find them. I was wondering if those could be loaded up so I can reproduce the video results.

I am being greedy because my daughter is graduating from (Aero engineering major) college next week and I would like to use manim to make some cool custom video for her using the fourier series drawing "tool" so I want to understand what I am doing with the examples before going further. No graduation. No senior week. No friends. Very sad graduation period for someone who worked hard for 4 years to get here.

So nerdy dad with no manim experience (I used to write a lot of assembly language DSP code for a living). Any suggestions from others doing something similar for their kid or interested in doing something similar maybe we can come up with something together and help make something cool to honor our child.

Thanks for your help. Really love this stuff

Picture1

TonyCrane commented 4 years ago

Here have some available svg files made by us. You can try it.

The key to making a successful svg file is to have only one path in the svg file. You can try Adobe Illustrator to generate svg files.

NavpreetDevpuri commented 4 years ago

https://danmarshall.github.io/google-font-to-svg-path/ https://material.io/resources/icons/?style=baseline https://all-free-download.com/ Or simply search on google for free svg files

NOTE: If you are using Adobe Illustrator just choice save as option instead of export as because export as creates problems when using those files in manim and save as creates SVG 1.1 version SVG files which works fine with manim.

I suggest to use free and open source software Inkscrape.

aritra1911 commented 4 years ago

Also this is probably the exact file Grant used in his video. https://svgur.com/i/LD8.svg

hadichaudhri commented 4 years ago

Here have some available svg files made by us. You can try it.

The key to making a successful svg file is to have only one path in the svg file. You can try Adobe Illustrator to generate svg files.

I'm confused as to how https://github.com/manim-kindergarten/manim_sandbox/blob/master/assets/svg_images/coin.svg would work in manim, as it isn't a single line (One path on the outside, another on the inside).

lakeside-park commented 4 years ago

Thanks to all your replies. I did find a TrebleClef.svg that I used to generate the .png in my post - but it was not the same and I wanted the other .svg files called out in the code to run them and experiment with. I will check out all your links.

Regarding the coin.svg - I ran a similar run using a round college logo .svg and it only traced the outside circle. As others pointed out the .svg seems to need to be one path.

The other strange thing I am experiencing is the video display seems to start somewhere in the middle of the process of tracing the .svg. The drawing below if the first few frames of an .svg trace using a .svg file I created of a name using connected letters. All of my runs (with my generated .svg) have the same problems with starting the display in the middle - which is why I am interested in using the original .svg files Grant used because his videos do not have that problem. I will try some of them to see.

One other thing I would like to change is for all my runs, the traced line fades away as time goes on so I was wondering if anyone knew how to make the line permanent.

What I am working on is to have the fourier code trace out a picture of my daughter - you can see a rough version of that in the second .png attached. I would like the face to stay drawn the whole time

Picture2

Picture1

hadichaudhri commented 4 years ago

If you want to just change the duration the line stays yellow then I suggest changing this line: image in update_path in the file from_3b1b\active\diffyq\part2\fourier_series.py under FourierCirclesScene (Different line numbers because this is a modified copy).

If you want to make it stop fading away altogether, you can likely get rid of the for-loop in it's entirety. If that doesn't work then just modify the above line to width=stroke_width. It's inefficient but it is almost certain to work.

lakeside-park commented 4 years ago

Thanks for your help.