def compute_c_polygon(self, agent): agent_points = copy_points_list(agent.get_points()) all_points = [] for point in self.get_points(): for agent_point in agent_points: all_points.append(point - agent_point) c_polygon_points = generate_convex_hull(all_points) return Polygon(c_polygon_points)
def add_points(self, points): self.points.extend(copy_points_list(points)) if len(self.points) != len(set(self.points)): raise Exception('Points in Polygon must be distinct')
def get_points(self): return copy_points_list(self.points)