mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 02:35:22 +08:00
After running 2to3
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import itertools as it
|
||||
import numpy as np
|
||||
import operator as op
|
||||
|
||||
import aggdraw
|
||||
# import aggdraw
|
||||
import copy
|
||||
import time
|
||||
|
||||
@ -44,7 +44,7 @@ class Camera(object):
|
||||
# than this value will be rescaled.
|
||||
"max_allowable_norm": FRAME_WIDTH,
|
||||
"image_mode": "RGBA",
|
||||
"n_rgb_coords": 4,
|
||||
"n_channels": 4,
|
||||
"pixel_array_dtype": 'uint8',
|
||||
"use_z_coordinate_for_display_order": False,
|
||||
# z_buff_func is only used if the flag above is set to True.
|
||||
@ -131,7 +131,7 @@ class Camera(object):
|
||||
self.background_color, self.background_opacity
|
||||
)
|
||||
self.background = np.zeros(
|
||||
(height, width, self.n_rgb_coords),
|
||||
(height, width, self.n_channels),
|
||||
dtype=self.pixel_array_dtype
|
||||
)
|
||||
self.background[:, :] = background_rgba
|
||||
@ -372,8 +372,7 @@ class Camera(object):
|
||||
coord_strings[0] = "M" + coord_strings[0]
|
||||
# The C at the start of every 6th number communicates
|
||||
# that the following 6 define a cubic Bezier
|
||||
coord_strings[2::6] = map(
|
||||
lambda s: "C" + str(s), coord_strings[2::6])
|
||||
coord_strings[2::6] = ["C" + str(s) for s in coord_strings[2::6]]
|
||||
# Possibly finish with "Z"
|
||||
if vmobject.mark_paths_closed:
|
||||
coord_strings[-1] = coord_strings[-1] + " Z"
|
||||
@ -549,7 +548,7 @@ class Camera(object):
|
||||
return 1 + (thickness - 1) / factor
|
||||
|
||||
def get_thickening_nudges(self, thickness):
|
||||
_range = range(-thickness / 2 + 1, thickness / 2 + 1)
|
||||
_range = list(range(-thickness / 2 + 1, thickness / 2 + 1))
|
||||
return np.array(list(it.product(_range, _range)))
|
||||
|
||||
def thickened_coordinates(self, pixel_coords, thickness):
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from constants import FRAME_HEIGHT
|
||||
from constants import FRAME_WIDTH
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from camera.moving_camera import MovingCamera
|
||||
from utils.iterables import list_difference_update
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -98,7 +98,7 @@ class ThreeDCamera(MovingCamera):
|
||||
# -np.linalg.norm(vm.get_center()-camera_point)
|
||||
# for vm in vmobs
|
||||
# ])
|
||||
three_d_status = map(should_shade_in_3d, vmobs)
|
||||
three_d_status = list(map(should_shade_in_3d, vmobs))
|
||||
has_points = [vm.get_num_points() > 0 for vm in vmobs]
|
||||
if all(three_d_status) and all(has_points):
|
||||
cmp_vect = self.get_unit_normal_vect(vmobs[1])
|
||||
|
Reference in New Issue
Block a user