This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| class tikztest(Scene): | |
| def construct(self): | |
| MyTexTemplate = TexTemplate( | |
| tex_compiler="xelatex", | |
| output_format=".xdv", | |
| documentclass=r"\documentclass[preview,dvisvgm]{standalone}" | |
| ) | |
| MyTexTemplate.add_to_preamble(r"\usepackage{tikz}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| import manim.mobject.geometry.tips as tips | |
| class LineFromPoints(Line): | |
| def __init__(self, pointsdirections, radius=0, **kwargs): | |
| super().__init__(**kwargs) | |
| pointsradii = [(pointsdirections[0][0],0)] | |
| for p0,p2 in zip(pointsdirections, pointsdirections[1:]): | |
| if len(p0)==3: | |
| r = p0[2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LineThroughPoints(Line): | |
| def __init__(self, pointsdirections, radius=0, **kwargs): | |
| super().__init__(**kwargs) | |
| self.pointsdirections = pointsdirections | |
| self.radius = radius | |
| self.set_points([pointsdirections[0][0]]) | |
| for p0,p1 in zip(pointsdirections,pointsdirections[1:]): | |
| dx,dy,dz = p1[0]-p0[0] | |
| if len(p0) == 3: | |
| r = p0[2] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://discord.com/channels/581738731934056449/1414961601127383170/1415086069568766024 | |
| from manim import * | |
| class dotinbox(Scene): | |
| def construct(self): | |
| outerbox = RegularPolygon(n=6).rotate(5*DEGREES).scale_to_fit_height(7) | |
| innerobjs = VGroup( | |
| RegularPolygon(n=5, fill_opacity=1).scale_to_fit_height(2).shift(UR), | |
| Square(side_length=1).shift(DL) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| # inspired by Grant Sanderson's Fourier video | |
| # translated to ManimCE and using numpy's FFT | |
| class FFTCirclesDotScene(MovingCameraScene): | |
| center_point = ORIGIN | |
| slow_factor = 0.1 | |
| def get_fft_coefficients_of_path(self, path, n_samples=32768, n_freqs = 200): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| class possible2(Scene): | |
| def construct(self): | |
| phase = ValueTracker(0) | |
| def bottom(): | |
| return VMobject().add_points_as_corners( | |
| [ | |
| *[[x,0.5*np.sin(x-phase.get_value()),0] for x in np.linspace(-8,8,1000)], | |
| [8,-8,0],[-8,-8,0],[-8,0,0] | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| # https://discord.com/channels/581738731934056449/1178561529914871818/1180619063161016390 | |
| class feynman(Scene): | |
| def construct(self): | |
| MyTexTemplate = TexTemplate() | |
| MyTexTemplate.add_to_preamble(r"\usepackage{tikz}\usepackage[compat=1.1.0]{tikz-feynman}") | |
| feyn = Tex(r""" | |
| \begin{tikzpicture} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| class testarabic(Scene): | |
| def construct(self): | |
| i=0 | |
| texts = VGroup() | |
| for font in Text.font_list(): | |
| print(font) | |
| texts += VGroup( | |
| Text(font, font_size=18).next_to([0,3.5-0.8*i,0],LEFT,buff=0.5), | |
| Text("جيب", font=font).next_to([0,3.5-0.8*i,0],RIGHT,buff=0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from manim import * | |
| import sys | |
| class clitest(Scene): | |
| def construct(self): | |
| args = VGroup( | |
| Text(arg) | |
| for arg in self.argv | |
| ).arrange(DOWN) | |
| self.add(args) |
NewerOlder