(
input: list[HexagonAngle], leds_per_strip: int, startPos: Point,
exclude: list[int] | None = None,
add_last: bool = False
)
| 66 | |
| 67 | |
| 68 | def 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 |
no test coverage detected