mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 17:29:06 +08:00
Some convenient utility functions added to helpers.py, which I had reason to make use of previously
This commit is contained in:
@ -438,11 +438,6 @@ class MappingCamera(Camera):
|
|||||||
excluded_mobjects = None,
|
excluded_mobjects = None,
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: Put this in different utility/helpers file? Convenient for me (Sridhar); I like it.
|
|
||||||
class DictAsObject(object):
|
|
||||||
def __init__(self, dict):
|
|
||||||
self.__dict__ = dict
|
|
||||||
|
|
||||||
# Note: This allows layering of multiple cameras onto the same portion of the pixel array,
|
# Note: This allows layering of multiple cameras onto the same portion of the pixel array,
|
||||||
# the later cameras overwriting the former
|
# the later cameras overwriting the former
|
||||||
#
|
#
|
||||||
|
@ -629,6 +629,12 @@ def angle_of_vector(vector):
|
|||||||
return 0
|
return 0
|
||||||
return np.angle(complex(*vector[:2]))
|
return np.angle(complex(*vector[:2]))
|
||||||
|
|
||||||
|
def concatenate_lists(*list_of_lists):
|
||||||
|
return [item for l in list_of_lists for item in l]
|
||||||
|
|
||||||
|
# Occasionally convenient in order to write dict.x instead of more laborious
|
||||||
|
# (and less in keeping with all other attr accesses) dict["x"]
|
||||||
|
class DictAsObject(object):
|
||||||
|
def __init__(self, dict):
|
||||||
|
self.__dict__ = dict
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user