Skip to content

Commit aa79424

Browse files
committed
[Rendering] Circle sectors
1 parent e282df1 commit aa79424

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

vmas/simulator/rendering.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,13 @@ def render_function_util(
520520
return geom
521521

522522

523-
def make_circle(radius=10, res=30, filled=True):
523+
def make_circle(radius=10, res=30, filled=True, angle=2 * math.pi):
524524
points = []
525525
for i in range(res):
526-
ang = 2 * math.pi * i / res
526+
ang = -angle / 2 + angle * i / res
527527
points.append((math.cos(ang) * radius, math.sin(ang) * radius))
528+
if angle % (2 * math.pi) != 0:
529+
points.append((0, 0))
528530
if filled:
529531
return FilledPolygon(points)
530532
else:

0 commit comments

Comments
 (0)