Sideway
output.to from Sideway
Draft for Information Only

Content

Mobject
 def match_color(self, mobject)
 def match_dim_size(self, mobject, dim, **kwargs)
 def match_width(self, mobject, **kwargs)
 def match_height(self, mobject, **kwargs)
 def match_depth(self, mobject, **kwargs)
 def match_coord(self, mobject, dim, direction=ORIGIN)
 def match_x(self, mobject, direction=ORIGIN)
 def match_y(self, mobject, direction=ORIGIN)
 def match_z(self, mobject, direction=ORIGIN)
 def align_to(self, mobject_or_point, direction=ORIGIN, alignment_vect=UP)
  Example
   Code
   Output

Mobject

The defined match other mobject property functions for Mobject in mobject.py
  • def match_color(self, mobject)
  • def match_dim_size(self, mobject, dim, **kwargs)
  • def match_width(self, mobject, **kwargs)
  • def match_height(self, mobject, **kwargs)
  • def match_depth(self, mobject, **kwargs)
  • def match_coord(self, mobject, dim, direction=ORIGIN)
  • def match_x(self, mobject, direction=ORIGIN)
  • def match_y(self, mobject, direction=ORIGIN)
  • def match_z(self, mobject, direction=ORIGIN)
  • def align_to(self, mobject_or_point, direction=ORIGIN, alignment_vect=UP)

def match_color(self, mobject)

match_color is used to set the color of a Mobject according to the corresponding property of the specified parameter, mobject.

def match_dim_size(self, mobject, dim, **kwargs)

match_dim_size is used to rescale the size of a Mobject with respect to the specified dimension parameter, dim, according to the corresponding property of the specified parameter, mobject.

def match_width(self, mobject, **kwargs)

match_width is used to rescale the size of a Mobject with respect to the width direction according to the corresponding property of the specified parameter, mobject.

def match_height(self, mobject, **kwargs)

match_height is used to rescale the size of a Mobject with respect to the height direction according to the corresponding property of the specified parameter, mobject.

def match_depth(self, mobject, **kwargs)

match_depth is used to rescale the size of a Mobject with respect to the depth direction according to the corresponding property of the specified parameter, mobject.

def match_coord(self, mobject, dim, direction=ORIGIN)

match_coord is used to set the coordinate of a Mobject along the specified dimension, dim with respect to the specified direction, direction, according to the corresponding property of the specified parameter, mobject.

def match_x(self, mobject, direction=ORIGIN)

match_x is used to set the x dimension of a Mobject with respect to the specified direction parameter, direction, according to the corresponding property of the specified parameter, mobject.

def match_y(self, mobject, direction=ORIGIN)

match_y is used to set the y dimension of a Mobject with respect to the specified direction parameter, direction, according to the corresponding property of the specified parameter, mobject.

def match_z(self, mobject, direction=ORIGIN)

match_z is used to set the z dimenstion of a Mobject with respect to the specified direction parameter, direction, according to the corresponding property of the specified parameter, mobject.

def align_to(self, mobject_or_point, direction=ORIGIN, alignment_vect=UP)

align_to is used to align the specified direction parameter, direction, of a Mobject to the corresponding property of the specified parameter, mobject_or_point.

Example

Code

# folder/file: tut/manim_mobject_func_match_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Rectangle, Square, Circle, RoundedRectangle
from manimlib.animation.creation import ShowCreation
from manimlib.mobject.svg.tex_mobject import TexMobject, TextMobject
from manimlib.animation.fading import FadeOut
from manimlib.animation.creation import Write

class manim_mobject_func_match_001a(Scene): 
   def construct(self):
      polya= RoundedRectangle(width=2,height=2,corner_radius=0.5,stroke_width=0,fill_color="#FFFF00",fill_opacity=1)
      polyb = Rectangle(width=2.5,height=1.5,stroke_width=15,color="#88FF00",fill_color="#FFFF00",fill_opacity=1)
      polyc= Square(side_length=2,stroke_width=20,fill_color="#FF8800",fill_opacity=1).move_to([-3,-2,0])
      polyd= Circle(arc_center=(-2,0.75,0),color="#888888")
      polye = Rectangle(width=1.25,height=3.75,color="#888888",fill_color="#333333",fill_opacity=1).move_to([-0.625,-1.125,0])
      polyf= Rectangle(width=1,height=2,color="#888888").move_to([-2.5,-2,0])
      polyb.add(TextMobject("B").move_to(polyb))
      polye.add(TextMobject("E").move_to(polye))
      self.play(ShowCreation(polyb),ShowCreation(polye),run_time=2)
      self.wait()
      polyc.add(polyf)
      polyc.add(TextMobject("C").move_to(polyc))
      self.play(ShowCreation(polyc),run_time=2)
      self.wait()
      self.play(ShowCreation(polya.move_to(polyd)),ShowCreation(polyd),run_time=2)
      self.wait()
      text=TexMobject(r"polya.match\_color(polyb)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_color(polyb)),run_time=3)
      polya.add(Rectangle(width=2,height=2,color="#77DDCC").move_to(polya))
      polya.add(Rectangle(width=1,height=2.5,color="#77DDCC").move_to(polya))
      polya.add(TextMobject("A").move_to(polya))
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_dim\_size(polyb,1)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_dim_size(polyb,1)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_width(polyb)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_width(polyb)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_height(polyb)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_height(polyb)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_depth(polyc)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_depth(polyb)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_coord(polyb,0)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_coord(polyb,0)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_x(polyc,[1,0,0])").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_x(polyc,[1,0,0])),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_y(polyb,[0,-1,0])").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_y(polyb,[0,-1,0])),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.match\_z(polyc)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.match_z(polyc)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.align\_to(polyc,(1,-1,0))").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.align_to(polyc,(1,-1,0))),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.align\_to(polyb,(-1,0,0)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.align_to(polyb,([-1,0,0]))),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.align\_to(polyc,(0,1,0)").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.align_to(polyc,[0,1,0])),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)
      text=TexMobject(r"polya.align\_to(polyc").move_to([0,3,0])
      self.play(Write(text),ShowCreation(polya.align_to(polyc)),run_time=3)
      self.wait()
      self.play(FadeOut(text),run_time=2)

Output

image

©sideway

ID: 200301002 Last Updated: 3/10/2020 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339new

Travel 7new

Reference 79

Computer

Hardware 251

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019