malhotra5 / manim-tutorial Goto Github PK
View Code? Open in Web Editor NEWA tutorial for manim, a mathematical animation engine made by 3b1b
A tutorial for manim, a mathematical animation engine made by 3b1b
Line 485: class ThreedSurface(ParametricSurface)
should be class ThreeDSurface(ParametricSurface)
with a capital D, not a small d.
I got a NameError when the D
was small.
use manimlib.imports
instead. it has the exact same comment at the top with "I won't pretend like this is best practice..."
there's probably other outdated stuff but yeah this one took forever to figure out
Using code from 06/10, I could not get the following simple wiggle scene to render properly:
class test(Scene):
def construct(self):
dot = Dot(color=YELLOW)
self.add(dot)
self.play(dot.shift, RIGHT, rate_func=lambda t: wiggle(t,6),run_time=5)
self.wait(1)
The movement would occur in one direction as expected but not on the other. After digging into the code, I found the following lines in manimlib/animation/animation.py:
def get_sub_alpha(self, alpha, index, num_submobjects):
# TODO, make this more understanable, and/or combine
# its functionality with AnimationGroup's method
# build_animations_with_timings
lag_ratio = self.lag_ratio
full_length = (num_submobjects - 1) * lag_ratio + 1
value = alpha * full_length
lower = index * lag_ratio
return np.clip((value - lower), 0 1) # <---- could this be -1 instead of 0?
Since the wiggle function outputs values in the [-1, 1] interval, I fail to see how it's supposed to work with the above clipping in place. While I understand that it's supposed to be a safety net against wild user-provided rate functions, I believe it's better to extend the clipping to the [-1, 1] interval.
After fulfilling all the requirements I run the python3 manim.py example_scenes.py
:
Result:
python3 manim.py example_scenes.py Traceback (most recent call last): File "manim.py", line 2, in <module> import manimlib File "/root/manim/manimlib/__init__.py", line 4, in <module> import manimlib.extract_scene File "/root/manim/manimlib/extract_scene.py", line 9, in <module> from manimlib.scene.scene import Scene File "/root/manim/manimlib/scene/scene.py", line 12, in <module> from manimlib.camera.camera import Camera File "/root/manim/manimlib/camera/camera.py", line 9, in <module> import cairo File "/root/anaconda3/lib/python3.7/site-packages/cairo/__init__.py", line 1, in <module> from ._cairo import * # noqa: F401,F403 ImportError: /root/anaconda3/lib/python3.7/site-packages/cairo/_cairo.cpython-37m-x86_64-linux-gnu.so: undefined symbol: cairo_svg_surface_set_document_unit
Please help
When I try
!git clone https://github.com/3b1b/manim.git
!pip3 install manimlib
!python3 -m pip install -r requirements.txt
I see a bunch of errors.
Need a windows installation guide for Manim ASAP. Assigned to @malhotra5 as I can run windows.
In the shapes tutorial, for the yellow lines, there are several places where constants are not defined as np.<constant>
, even though they are inherited from NumPy. The code currently reads:
pointers = []
for i in range(8):
pointers.append(Line(ORIGIN, np.array([cos(pi/180*360/8*i),sin(pi/180*360/8*i), 0]),color=YELLOW))
But needs to be fixed to:
pointers = []
for i in range(8):
pointers.append(Line(ORIGIN, np.array([np.cos(np.pi/180*360/8*i), np.sin(np.pi//180*360/8*i), 0]), color=YELLOW))
Where sin()
and cos()
have been fixed to np.sin()
and np.cos()
, and pi
has been fixed to np.pi
. Without it, the script doesn't compile properly (at least not for me).
Edit: I have posted a pull request. I can't link it to this issue because I don't have edit access, but I forked this repo and created a pull from a branch on my fork.
In the graphing section, can you display the graph that is already played ?
How would you go about displaying python code as a TextMobject or other object so that you can animate the code on the screen. I feel this would be amazing for programming tutorials so I was just wondering.
I was trying to make molecules ,with manim, arraying polygons, lines and letters and it turn out to be a huge pain. Does someone know if it's possible to install a LaTex package (Chemfig) and use LaTex (the same way we use to generate equations) but to generate LaTex figures in manim ?
Hi, sorry I'm pretty new to Linux and programming in general, I have a question which Python version do i need to install and where can I find it, after that I got to the part with the SystemReq but I got always an error that there are no SystemReq found.
Is it possible to change the line width of graphs?
EDIT: Under manlib/contants.py if I change DEFAULT_STROKE_WIDTH I can change the width. It would be nice if we could pass this variable when making the graph.
Now I know how to graph arc, arch,circle,semecircle...
but I don't know how to graph 1/n circle ...
How to add sound in the rendered videos ?
README created by @malhotra5 explains everything carefully about the tutorial of manim. However I believe there are still methods to let README both look better and be synchronized to manim's update:
pip
interface, so we really should change these.By the way, I also request assigning this issue to myself since I have already started working on the solutions in my fork of this repo.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.