(points: list["Point"])
| 38 | |
| 39 | @staticmethod |
| 40 | def toJson(points: list["Point"]) -> list[dict]: |
| 41 | x_values = [p.x for p in points] |
| 42 | y_values = [p.y for p in points] |
| 43 | # round |
| 44 | x_values = [round(x, 4) for x in x_values] |
| 45 | y_values = [round(y, 4) for y in y_values] |
| 46 | if MIRROR_X: |
| 47 | x_values = [-x for x in x_values] |
| 48 | |
| 49 | return {"x": x_values, "y": y_values, "diameter": LED_DIAMETER} |
| 50 | |
| 51 | def copy(self) -> "Point": |
| 52 | return Point(self.x, self.y) |