MCPcopy Create free account
hub / github.com/FastLED/FastLED / Point

Class Point

examples/Chromancer/gen.py:35–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34@dataclass
35class Point:
36 x: float
37 y: float
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)
53
54 def __repr__(self) -> str:
55 x_rounded = round(self.x, 2)
56 y_rounded = round(self.y, 2)
57 return f"({x_rounded}, {y_rounded})"
58
59
60def next_point(pos: Point, angle: HexagonAngle, space: float) -> Point:

Callers 10

copyMethod · 0.70
next_pointFunction · 0.70
gen_pointsFunction · 0.70
mainFunction · 0.70
simple_testFunction · 0.70
two_angle_testFunction · 0.70
two_angle_test2Function · 0.70
find_red_anchor_pointFunction · 0.70
find_green_anchore_pointFunction · 0.70
gen.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected