Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion manim/mobject/geometry/polygram.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ class Rectangle(Polygon):
No purpose.
close_new_points
No purpose.
grid_line_stroke_width
Stroke width of grid lines.
kwargs
Additional arguments to be passed to :class:`Polygon`

Expand All @@ -589,8 +591,9 @@ class RectangleExample(Scene):
def construct(self):
rect1 = Rectangle(width=4.0, height=2.0, grid_xstep=1.0, grid_ystep=0.5)
rect2 = Rectangle(width=1.0, height=4.0)
rect3 = Rectangle(width=2.0, height=2.0, grid_xstep=1.0, grid_ystep=1.0, grid_line_stroke_width=1)

rects = Group(rect1,rect2).arrange(buff=1)
rects = Group(rect1, rect2, rect3).arrange(buff=1)
self.add(rects)
"""

Expand All @@ -603,6 +606,7 @@ def __init__(
grid_ystep: float | None = None,
mark_paths_closed: bool = True,
close_new_points: bool = True,
grid_line_stroke_width: int = DEFAULT_STROKE_WIDTH,
**kwargs,
):
super().__init__(UR, UL, DL, DR, color=color, **kwargs)
Expand All @@ -620,6 +624,7 @@ def __init__(
v[1] + i * grid_xstep * RIGHT,
v[1] + i * grid_xstep * RIGHT + height * DOWN,
color=color,
stroke_width=grid_line_stroke_width,
)
for i in range(1, count)
)
Expand All @@ -634,6 +639,7 @@ def __init__(
v[1] + i * grid_ystep * DOWN,
v[1] + i * grid_ystep * DOWN + width * RIGHT,
color=color,
stroke_width=grid_line_stroke_width,
)
for i in range(1, count)
)
Expand Down