Sideway
output.to from Sideway
Draft for Information Only

Content

Element Management
 def add_mobjects_among(self, values)
  Example Scene.add_mobjects_among
   Code Scene.add_mobjects_among
   Output Scene.add_mobjects_among
 def add_foreground_mobjects(self, *mobjects)
  Example Scene.add_foreground_mobjects
   Code Scene.add_foreground_mobjects
   Output Scene.add_foreground_mobjects
 def add_foreground_mobject(self, mobject)
  Example Scene.add_foreground_mobject
   Code Scene.add_foreground_mobject
   Output Scene.add_foreground_mobject

Element Management

The Element management functions of Scene object is to manage the Mobject objects of Scene object. The Element management functions are
  • def add(self, *mobjects)
  • def remove(self, *mobjects)
  • def add_mobjects_among(self, values)
  • def add_foreground_mobjects(self, *mobjects)
  • def add_foreground_mobject(self, mobject)
  • def remove_foreground_mobjects(self, *to_remove)
  • def remove_foreground_mobject(self, mobject)
  • def clear(self)

def add_mobjects_among(self, values)

Add one, more, or all Mobject object instances in the local symbol table at this code point of available to the casting list of Scene object. Any Mobject object instance declared after this calling point is not included. The order of background and foreground arrangement depends on the order of symbolic varibale in the local symbol table. The add_mobjects_among function can be used to add all mobjects using locals().values(), to add one or more mobjects using functions like filter(lambda x: x!=temp,locals().values()), or mapping like map(locals().get,{"temp"}) etc.last updated 28Dec2019

Example Scene.add_mobjects_among

Example of Scene.add_mobjects_among

Code Scene.add_mobjects_among

# folder/file: tut/manim_scene_add_among_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Square

class manim_scene_add_among_001a(Scene): 
    def construct(self):
        temp1=Square(color="#FFFF00")
        temp2=Circle(radius=1.2,color="#FF0000",stroke_width=10)
        temp3=Circle()
        self.add_mobjects_among(map(locals().get,{"temp1","temp2"}))
        temp1=Circle(stroke_width=10,radius=2.5)
        temp2=Square(color="#FFFFFF",side_length=4)
        temp3=Circle(radius=2.2,color="#FF0000",stroke_width=10)
        self.add_mobjects_among(filter(lambda x: x!=temp1,locals().values()))
        temp1=Square(color="#FFFF00")
        temp2=Circle(radius=1.2,color="#FF0000",stroke_width=10)
        temp3=Circle()
        temp4=Circle(color="#FFFF00",radius=1.75)
        temp5=Square(color="#FFFF00",side_length=2.25)
        temp6=Square(side_length=5.25)
        self.add_mobjects_among(locals().values())
        temp7=Square(side_length=7)
        print(locals().values())

Output Scene.add_mobjects_among

image

def add_foreground_mobjects(self, *mobjects)

Add one or more Mobject objects to both the priority casting list and casting list of Scene object. The priority casting list is used as an flag indicator to indicate that all Mobject in the priority casting list at this code point and after should be promoted to the front of the casting list of Scene object. And similar to add function, Mobjects are added to Scene object from background to foreground in the order with which these Mobject objects are added.last updated 28Dec2019

Example Scene.add_foreground_mobjects

Example of Scene.add_foreground_mobjects

Code Scene.add_foreground_mobjects

# folder/file: tut/manim_scene_add_foreground_mobjects_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Square

class manim_scene_add_foreground_mobjects_001a(Scene):
    def construct(self):
        temp=Square()
        temp1=Circle(stroke_width=10)
        temp2=Square(color="#FFFF00",stroke_width=10,side_length=1.8)
        temp3=Square(fill_opacity=1)
        self.add(temp)
        self.add_foreground_mobjects(temp1,temp2)
        self.add(temp3)

Output Scene.add_foreground_mobjects

image

def add_foreground_mobject(self, mobject)

Same function as add_foreground_mobjects, but add only one Mobject object to the priority casting list of Scene object instead of to the casting list.last updated 28Dec2019

Example Scene.add_foreground_mobject

Example of Scene.add_foreground_mobject.

Code Scene.add_foreground_mobject

# folder/file: tut/manim_scene_add_foreground_mobject_001a.py

from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Square

class manim_scene_add_foreground_mobject_001a(Scene):
    def construct(self):
        temp=Square()
        temp1=Circle(stroke_width=10)
        temp2=Square(color="#FFFF00",stroke_width=10,side_length=1.8)
        temp3=Square(fill_opacity=1)
        self.add(temp)
        self.add_foreground_mobject(temp1)
        self.add_foreground_mobject(temp2)
        self.add(temp3)

Output Scene.add_foreground_mobject

image

©sideway

ID: 200400202 Last Updated: 4/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