Skip to content

Commit

Permalink
Merge pull request #134 from godardma/master
Browse files Browse the repository at this point in the history
[python_api] added drawPoints
  • Loading branch information
SimonRohou authored Oct 18, 2024
2 parents dcb440f + 52cbb74 commit a32e570
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client-api/python/vibes/vibes.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,26 @@ def drawPoint(cls, cx, cy, radius=3, color='r', **kwargs):
}
}
cls._write(msg, **kwargs)

@classmethod
def drawPoints(cls,cx,cy, color='r', **kwargs):
"""Draw a set of points at position (cx, cy)
Args:
cx,cy (list of double): location of the points
"""
points = []
for i in range(len(cx)):
points.append([cx[i], cy[i]])
msg = {'action': 'draw',
'shape': {'type': 'points',
'centers': points,
'format': color
}
}
cls._write(msg, **kwargs)

@classmethod
def drawRing(cls, cx, cy, r_min, r_max, color='r', **kwargs):
"""Draw a ring at position (cx, cy) with radius between (r_min, r_max)
Expand Down

0 comments on commit a32e570

Please sign in to comment.