planar_robot_representation

Draw 2D representations of Modular Robots. Based on Karine Miras` Method.

Module Contents

Functions

draw_robots(→ None)

Draw multiple robots at once.

draw_robot(→ None)

Draw a 2D representation for a modular robots body.

draw_robots(robots: list[revolve2.modular_robot.ModularRobot] | list[revolve2.modular_robot.body.base.Body], scale: int = 100, path: str | None = None) None

Draw multiple robots at once.

How to use:
>>> robots: list[revolve2.modular_robot.ModularRobot] | list[revolve2.modular_robot.body.base.Body]
>>> draw_robots(robots, path="<your desired path to save the image to>")
Parameters:
  • robots – The robots.

  • scale – The scale for the robots to be drawn.

  • path – The path for the output files.

draw_robot(robot: revolve2.modular_robot.ModularRobot | revolve2.modular_robot.body.base.Body, scale: int = 100, path: str | None = None) None

Draw a 2D representation for a modular robots body.

How to use:
>>> robot: revolve2.modular_robot.ModularRobot | revolve2.modular_robot.body.base.Body
>>> draw_robot(robot, path="<your desired path to save the image to>")
Parameters:
  • robot – Supply the robot as a ModularRobot object, or the body directly as a Body object.

  • scale – Allows to set the size of the drawing.

  • path – The path to save images to.