Sideway
output.to from Sideway
Draft for Information Only

Content

Shape Matcher
 Class SurroundingRectangle(Rectangle)
  Example
   Code
   Output
 Class BackgroundRectangle(SurroundingRectangle)
  Example
   Code
   Output
 Class Cross(VGroup)
  Example
   Code
   Output
 Class Underline(Line)
  Example
   Code
   Output

Shape Matcher

The defined shape matcher VMobject in shape_matchers.py
  • Class SurroundingRectangle(Rectangle)
  • Class BackgroundRectangle(SurroundingRectangle)
  • Class Cross(VGroup)
  • Class Underline(Line)

Class SurroundingRectangle(Rectangle)

SurroundingRectangle is used to generate a surrounding rectangle with respect to specified VMobject for given parameters.

Example

Code

# folder/file: tut/manim_mobject_surroundingrectangle_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.shape_matchers import SurroundingRectangle
from manimlib.mobject.geometry import VMobject, Square, Triangle
from manimlib.mobject.svg.tex_mobject import TexMobject

class manim_mobject_surroundingrectangle_001a(Scene):
    def construct(self):
        triangle=Triangle(fill_color="#FF3300",fill_opacity=1)
        trianglebg=SurroundingRectangle(triangle,fill_opacity=1)
        self.add(VMobject.add(trianglebg,triangle).move_to([-3,3,0])).wait(2)
        triangle=Triangle(fill_color="#333300",fill_opacity=1)
        trianglebg=SurroundingRectangle(triangle,fill_opacity=0.5).shift([1,0,0])
        self.add(VMobject.add(triangle,trianglebg).move_to([3,3,0])).wait(2)
        self.add(SurroundingRectangle(VMobject.add(triangle,trianglebg)).move_to([-3,-3,0])).wait(2)
        text1= TexMobject("TEXT").move_to([3,-1.5,0])
        text1bg= SurroundingRectangle(text1,color="#FF3300",fill_color="#FF3333", fill_opacity=.5) 
        self.add(VMobject.add(text1bg,text1).move_to([3,-3,0])).wait(2)

Output

image

Class BackgroundRectangle(SurroundingRectangle)

BackgroundRectangle is used to generate a background rectangle with respect to specified VMobject for given parameters.

Example

Code

# folder/file: tut/manim_mobject_backgroundrectangle_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.shape_matchers import BackgroundRectangle
from manimlib.mobject.geometry import VMobject, Square, Triangle
from manimlib.mobject.svg.tex_mobject import TexMobject

class manim_mobject_backgroundrectangle_001a(Scene):
    def construct(self):
        triangle=Triangle(fill_color="#FF3300",fill_opacity=1)
        trianglebg=BackgroundRectangle(triangle,fill_color="#FFFFFF",fill_opacity=1)
        self.add(VMobject.add(trianglebg,triangle).move_to([-3,3,0])).wait(2)
        triangle=Triangle(fill_color="#333300",fill_opacity=1)
        trianglebg=BackgroundRectangle(triangle,fill_color="#FFFFFF",fill_opacity=0.5).shift([1,0,0])
        self.add(VMobject.add(triangle,trianglebg).move_to([3,3,0])).wait(2)
        self.add(BackgroundRectangle(VMobject.add(triangle,trianglebg),fill_color="#FFFFFF").move_to([-3,-3,0])).wait(2)
        text1= TexMobject("TEXT")
        text1bg= BackgroundRectangle(text1,color="#FFFF00",fill_color="#FFFFFF", fill_opacity=.5) 
        self.add(VMobject.add(text1bg,text1).move_to([3,-3,0])).wait(2)

Output

image

Class Cross(VGroup)

Cross is used to generate a cross with respect to specified VMobject for given parameters.

Example

Code

# folder/file: tut/manim_mobject_cross_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.shape_matchers import Cross
from manimlib.mobject.geometry import VMobject, Square, Triangle
from manimlib.mobject.svg.tex_mobject import TexMobject

class manim_mobject_cross_001a(Scene):
    def construct(self):
        triangle=Triangle(fill_color="#FF3300",fill_opacity=1)
        trianglebg=Cross(triangle,fill_color="#FFFFFF",fill_opacity=1)
        self.add(VMobject.add(trianglebg,triangle).move_to([-3,3,0])).wait(2)
        triangle=Triangle(fill_color="#333300",fill_opacity=1)
        trianglebg=Cross(triangle,fill_color="#FFFFFF",fill_opacity=0.5).shift([1,0,0])
        self.add(VMobject.add(triangle,trianglebg).move_to([3,3,0])).wait(2)
        self.add(Cross(VMobject.add(triangle,trianglebg),fill_color="#FFFFFF").move_to([-3,-3,0])).wait(2)
        text1= TexMobject("TEXT")
        text1bg= Cross(text1,color="#FFFF00",fill_color="#FFFFFF", fill_opacity=.5) 
        self.add(VMobject.add(text1bg,text1).move_to([3,-3,0])).wait(2)

Output

image

Class Underline(Line)

Underline is used to generate an underline with respect to specified VMobject for given parameters.

Example

Code

# folder/file: tut/manim_mobject_underline_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.shape_matchers import Underline
from manimlib.mobject.geometry import VMobject, Square, Triangle
from manimlib.mobject.svg.tex_mobject import TexMobject

class manim_mobject_underline_001a(Scene):
    def construct(self):
        triangle=Triangle(fill_color="#FF3300",fill_opacity=1)
        trianglebg=Underline(triangle,fill_color="#FFFFFF",fill_opacity=1)
        self.add(VMobject.add(trianglebg,triangle).move_to([-3,3,0])).wait(2)
        triangle=Triangle(fill_color="#333300",fill_opacity=1)
        trianglebg=Underline(triangle,fill_color="#FFFFFF",fill_opacity=0.5).shift([1,0,0])
        self.add(VMobject.add(triangle,trianglebg).move_to([3,3,0])).wait(2)
        self.add(Underline(VMobject.add(triangle,trianglebg),fill_color="#FFFFFF").move_to([-3,-3,0])).wait(2)
        text1= TexMobject("TEXT")
        text1bg= Underline(text1,color="#FFFF00",fill_color="#FFFFFF", fill_opacity=.5) 
        self.add(VMobject.add(text1bg,text1).move_to([3,-3,0])).wait(2)

Output

image

©sideway

ID: 200600202 Last Updated: 6/2/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