Skip to main content

A package for tools in Manim

Project description

导入 Import

from ManimTool import *

依赖库(Requires):manim

了解更多详情,请前往Manim Community

For more details, visit Manim Community.

发现任何bug或问题,请反馈到zhuchongjing_pypi@163.com,谢谢!

If you find any bugs or issues, please report them to zhuchongjing_pypi@163.com, thank you!

公式与图形 MathTexs and Graphics

def ChineseMathTex(*texts, font="SimSun", tex_to_color_map={}, **kwargs):

创建中文数学公式。

Creates Chinese mathematical formulas.

在此函数的公式部分和tex_to_color_map中直接写入中文即可,无需包裹\text{},返回MathTexfont,设置公式中的中文字体。所有原版参数都可使用。

You can directly write Chinese characters in the formula part of this function and in tex_to_color_map without wrapping them in \text{}. Returns a MathTex object. The font parameter sets the Chinese font for the formula. All original parameters can be used.

def LabelDot(dot_label, dot_pos, label_pos=DOWN, buff=0.1):

创建一个带有名字的点,返回带有点和名字的VGroup

Creates a point with a name. Returns a VGroup containing the point and its name.

dot_label,点的名字,字符串;dot_pos,点位置[x,y,z]label_pos,点的名字相对于点的位置,Manim中的方向向量;buff,点的名字与点的间距,数值。

dot_label is the name of the point (a string). dot_pos is the position of the point [x, y, z]. label_pos is the position of the label relative to the point (one of the direction constants in Manim). buff is the spacing between the label and the point (a numerical value).

def MathTexLine(mathtex: MathTex, direction=UP, buff=0.5, **kwargs):
def MathTexBrace(mathtex: MathTex, direction=UP, buff=0.5, **kwargs):
def MathTexDoublearrow(mathtex: MathTex, direction=UP, buff=0.5, **kwargs):

创建可以标注内容的图形,返回带有图形和标注内容的VGroup

Creates a graphical annotation for a MathTex object. Returns a VGroup containing the graphic and the annotation.

mathtex,标注的公式,MathTex类型。direction,标注内容相对于线的位置,Manim中的方向向量。buff,标注内容与图形的间距,数值。图形的所有原版参数都可使用。

mathtex is the MathTex object to annotate. direction is the position of the annotation relative to the graphic (using Manim's direction constants). buff is the spacing between the graphic and the annotation. All original parameters of the underlying graphic can be used.

def ExtendedLine(line: Line, extend_distance: float) -> Line:

将一条线延长extend_distance的距离,返回延长后的Line

Extends a line by extend_distance. Returns the extended Line.

lineLine类型。extend_distance,要延长的距离,数值。

line must be of type Line. extend_distance is the distance to extend (a numerical value).

交点 Intersections

def CircleInt(circle1, circle2):
def LineCircleInt(line, circle):
def LineInt(line1: Line, line2: Line) -> Optional[Tuple[float, float]]:
def LineArcInt(line: Line, arc: Arc) -> list:

函数名代表了寻找具体图形交点的功能。

The function names represent the function of finding the intersection points of specific shapes.

例如LineCircleInt代表寻找LineCircle的交点,返回点位置[x,y,z],如果没有交点会返回None

For example, LineCircleInt represents finding the intersection points of Line and Circle. Returns the position of the point [x,y,z]. If there are no intersection points, it will return None.

动画 Animation

def VisDrawArc(scene: Scene, arc: Arc, axis=OUT, run_time=1):

创建可视化(显示半径)的绘弧动画。

Creates a visualized arc drawing animation (with radius display).

直接使用即可,无需写入self.play()内。 scene,动画场景。arc, 已经定义好的Arcaxis,只有2个值INOUT,分别表示正方向还是反方向作弧。run_time,这是绘弧动画的时长。

Can be used directly without wrapping in self.play()scene refers to the animation scene. arc is the predefined Arc object. axis accepts two values: IN (positive direction) and OUT (negative direction), indicating the drawing direction of the arc. run_time denotes the duration of the arc drawing animation.

class TypeWriter(Animation):
    def __init__(self, mobject, interval=2, **kwargs):

TypeWriter用于实现Text内容的打字机效果(按顺序逐个显示)。

TypeWriter is used to achieve a typewriter effect for Text objects (displaying characters sequentially one by one).

mobject,必须为Text类型。interval,每个字符间的显示间隔时间(单位:秒),数值,默认为2。Animation的其他参数都可使用。

mobject must be of type Text. interval is the time interval (in seconds) between each character's appearance (numeric value), defaults to 2. All other parameters from Animation can also be used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manimtool-0.1.1.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ManimTool-0.1.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file manimtool-0.1.1.1.tar.gz.

File metadata

  • Download URL: manimtool-0.1.1.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for manimtool-0.1.1.1.tar.gz
Algorithm Hash digest
SHA256 b419ce8b5482f31c02f50dcaea7346f51c8c98fd33704ae3f4ec750cf4e003e1
MD5 8d5dfc9e29c5dac919292c996c1991e3
BLAKE2b-256 ded471eb38e400495e647e7b544d707a91705ae11a731e08cecced209ff10081

See more details on using hashes here.

File details

Details for the file ManimTool-0.1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ManimTool-0.1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for ManimTool-0.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bdb289586db6c3430e640adf323b8a51e03670840c4e3d4ebc42af4b5408884
MD5 de8cd46ec294e341375aac8df65af6bf
BLAKE2b-256 9ead3351d1023f9a2809ae5f53ce929cd46d8b301d70e0bc1a929c0545bec25e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page