Skip to content

Commit

Permalink
Finished! Replaced VMobject by VectorizedPoint as Ben suggested while…
Browse files Browse the repository at this point in the history
… ago
  • Loading branch information
SirJamesClarkMaxwell committed Jun 25, 2024
1 parent 85941b4 commit ddcd511
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions manim/mobject/three_d/three_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from manim.mobject.mobject import *
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
from manim.mobject.opengl.opengl_mobject import OpenGLMobject
from manim.mobject.types.vectorized_mobject import VGroup, VMobject
from manim.mobject.types.vectorized_mobject import VGroup, VMobject, VectorizedPoint

from manim.utils.color import (
BLUE,
BLUE_D,
Expand Down Expand Up @@ -728,8 +729,8 @@ def _set_start_and_end_attributes(self, direction):

start = self.base_circle.get_center()
end = start + normalized_direction * self.new_height
self.start_point = VMobject().set_points_as_corners([start] * 3)
self.end_point = VMobject().set_points_as_corners([end] * 3)
self.start_point = VectorizedPoint(start)
self.end_point = VectorizedPoint(end)
self.add(self.start_point, self.end_point)


Expand Down Expand Up @@ -1179,12 +1180,12 @@ def __init__(
**kwargs,
)
self.cone.shift(end)
self.end_point = VMobject().set_points_as_corners([end] * 3)
self.end_point = VectorizedPoint(end)
self.add(self.end_point, self.cone)
self.set_color(color)

def get_end(self) -> np.ndarray:
return self.end_point.get_end()
return self.end_point.get_center()


class Torus(Surface):
Expand Down

0 comments on commit ddcd511

Please sign in to comment.