From ddcd511ab127ec6e13882cdb0251128d0bef8c2c Mon Sep 17 00:00:00 2001 From: Sir James Clarck Maxwell Date: Tue, 25 Jun 2024 21:43:05 +0200 Subject: [PATCH] Finished! Replaced VMobject by VectorizedPoint as Ben suggested while ago --- manim/mobject/three_d/three_dimensions.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/manim/mobject/three_d/three_dimensions.py b/manim/mobject/three_d/three_dimensions.py index a96e3e3c12..b78a7b0528 100644 --- a/manim/mobject/three_d/three_dimensions.py +++ b/manim/mobject/three_d/three_dimensions.py @@ -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, @@ -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) @@ -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):