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

Function gen_points

examples/Chromancer/gen.py:68–98  ·  view source on GitHub ↗
(
    input: list[HexagonAngle], leds_per_strip: int, startPos: Point,
    exclude: list[int] | None = None,
    add_last: bool = False
)

Source from the content-addressed store, hash-verified

66
67
68def gen_points(
69 input: list[HexagonAngle], leds_per_strip: int, startPos: Point,
70 exclude: list[int] | None = None,
71 add_last: bool = False
72) -> list[Point]:
73 points: list[Point] = []
74 if (not input) or (not leds_per_strip):
75 return points
76 exclude = exclude or []
77 # Start FSM. Start pointer get's put into the accumulator.
78 curr_point: Point = Point(startPos.x, startPos.y)
79 # points.append(curr_point)
80 last_angle = input[0]
81 for i,angle in enumerate(input):
82 excluded = i in exclude
83 values = list(range(leds_per_strip))
84 last_angle = angle
85 for v in values:
86 last_angle = angle
87 curr_point = next_point(curr_point, angle, SPACE_PER_LED)
88 if not excluded:
89 points.append(curr_point)
90 #if i == len(input) - 1:
91 # break
92 # Next starting point
93 curr_point = next_point(curr_point, last_angle, SPACE_PER_LED)
94 #if not excluded:
95 # points.append(curr_point)
96 if add_last:
97 points.append(curr_point)
98 return points
99
100
101

Callers 10

mainFunction · 0.85
simple_testFunction · 0.85
two_angle_testFunction · 0.85
two_angle_test2Function · 0.85
find_red_anchor_pointFunction · 0.85
find_green_anchore_pointFunction · 0.85
generate_red_pointsFunction · 0.85
generate_black_pointsFunction · 0.85
generate_green_pointsFunction · 0.85
generate_blue_pointsFunction · 0.85

Calls 4

listClass · 0.85
next_pointFunction · 0.85
PointClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected