Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Removed unwanted parameters in geometry (#1552)

Nikhil Garudae5cc89fe38b7
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
index 1c742d10b..e16624430 100644
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -271,7 +271,6 @@ class Arc(TipableVMobject):
start_angle=0,
angle=TAU / 4,
num_components=9,
- anchors_span_full_range=True,
arc_center=ORIGIN,
**kwargs,
):
@@ -279,7 +278,6 @@ class Arc(TipableVMobject):
radius = 1.0
self.radius = radius
self.num_components = num_components
- self.anchors_span_full_range = anchors_span_full_range
self.arc_center = arc_center
self.start_angle = start_angle
self.angle = angle
@@ -439,10 +437,6 @@ class Circle(Arc):
----------
color : :class:`~.Colors`, optional
The color of the shape.
- close_new_points : :class:`bool`, optional
- No purpose.
- anchors_span_full_range : :class:`bool`, optional
- No purpose.
kwargs : Any
Additional arguments to be passed to :class:`Arc`
@@ -466,8 +460,6 @@ class Circle(Arc):
self,
radius: float = None,
color=RED,
- close_new_points=True,
- anchors_span_full_range=False,
**kwargs,
):
Arc.__init__(
@@ -476,8 +468,6 @@ class Circle(Arc):
start_angle=0,
angle=TAU,
color=color,
- close_new_points=close_new_points,
- anchors_span_full_range=anchors_span_full_range,
**kwargs,
)
@@ -951,7 +941,7 @@ class DashedLine(Line):
dash_length : :class:`float`, optional
The length of each individual dash of the line.
dash_spacing : Optional[:class:`float`]
- No purpose.
+ The spacing between the dashes.
positive_space_ratio : :class:`float`, optional
The ratio of empty space to dash space. Range of 0-1.
kwargs : Any
@@ -1177,8 +1167,6 @@ class Arrow(Line):
:attr:`tip_length` scales with the length of the arrow. Increasing this ratio raises the max value of :attr:`tip_length`.
max_stroke_width_to_length_ratio : :class:`float`, optional
:attr:`stroke_width` scales with the length of the arrow. Increasing this ratio ratios the max value of :attr:`stroke_width`.
- preserve_tip_size_when_scaling : :class:`bool`, optional
- No purpose.
kwargs : Any
Additional arguments to be passed to :class:`Line`.
@@ -1221,14 +1209,10 @@ class Arrow(Line):
buff=MED_SMALL_BUFF,
max_tip_length_to_length_ratio=0.25,
max_stroke_width_to_length_ratio=5,
- preserve_tip_size_when_scaling=True,
**kwargs,
):
self.max_tip_length_to_length_ratio = max_tip_length_to_length_ratio
self.max_stroke_width_to_length_ratio = max_stroke_width_to_length_ratio
- self.preserve_tip_size_when_scaling = (
- preserve_tip_size_when_scaling # is this used anywhere
- )
tip_shape = kwargs.pop("tip_shape", ArrowTriangleFilledTip)
super().__init__(*args, buff=buff, stroke_width=stroke_width, **kwargs)
# TODO, should this be affected when
@@ -2245,8 +2229,6 @@ class Rectangle(Polygon):
close_new_points=True,
**kwargs,
):
- self.mark_paths_closed = mark_paths_closed
- self.close_new_points = close_new_points
super().__init__(UR, UL, DL, DR, color=color, **kwargs)
self.stretch_to_fit_width(width)
self.stretch_to_fit_height(height)
diff --git a/manim/mobject/opengl_geometry.py b/manim/mobject/opengl_geometry.py
index b501dec52..526f94232 100644
--- a/manim/mobject/opengl_geometry.py
+++ b/manim/mobject/opengl_geometry.py
@@ -202,7 +202,6 @@ class OpenGLArc(OpenGLTipableVMobject):
angle=TAU / 4,
radius=1.0,
n_components=8,
- anchors_span_full_range=True,
arc_center=ORIGIN,
**kwargs
):
@@ -210,7 +209,6 @@ class OpenGLArc(OpenGLTipableVMobject):
self.angle = angle
self.radius = radius
self.n_components = n_components
- self.anchors_span_full_range = anchors_span_full_range
self.arc_center = arc_center
super().__init__(self, **kwargs)
@@ -295,18 +293,8 @@ class OpenGLCurvedDoubleArrow(OpenGLCurvedArrow):
class OpenGLCircle(OpenGLArc):
- def __init__(
- self, color=RED, close_new_points=True, anchors_span_full_range=False, **kwargs
- ):
- OpenGLArc.__init__(
- self,
- 0,
- TAU,
- color=color,
- close_new_points=close_new_points,
- anchors_span_full_range=anchors_span_full_range,
- **kwargs
- )
+ def __init__(self, color=RED, **kwargs):
+ OpenGLArc.__init__(self, 0, TAU, color=color, **kwargs)
def surround(self, mobject, dim_to_match=0, stretch=False, buff=MED_SMALL_BUFF):
# Ignores dim_to_match and stretch; result will always be a circle
@@ -543,15 +531,9 @@ class OpenGLLine(OpenGLTipableVMobject):
class OpenGLDashedLine(OpenGLLine):
def __init__(
- self,
- *args,
- dash_length=DEFAULT_DASH_LENGTH,
- dash_spacing=None,
- positive_space_ratio=0.5,
- **kwargs
+ self, *args, dash_length=DEFAULT_DASH_LENGTH, positive_space_ratio=0.5, **kwargs
):
self.dash_length = dash_length
- self.dash_spacing = (dash_spacing,)
self.positive_space_ratio = positive_space_ratio
super().__init__(*args, **kwargs)
ps_ratio = self.positive_space_ratio
@@ -869,17 +851,7 @@ class OpenGLArrowTip(OpenGLTriangle):
class OpenGLRectangle(OpenGLPolygon):
- def __init__(
- self,
- color=WHITE,
- width=4.0,
- height=2.0,
- mark_paths_closed=True,
- close_new_points=True,
- **kwargs
- ):
- self.mark_paths_closed = mark_paths_closed
- self.close_new_points = close_new_points
+ def __init__(self, color=WHITE, width=4.0, height=2.0, **kwargs):
OpenGLPolygon.__init__(self, UR, UL, DL, DR, color=color, **kwargs)
self.set_width(width, stretch=True)