2021-01-19 22:02:51 +01:00
|
|
|
#!/bin/python
|
|
|
|
import numpy as np
|
|
|
|
import pandas as pd
|
|
|
|
|
2021-03-27 23:28:21 +01:00
|
|
|
led_count = 32
|
|
|
|
ring_diameter = 93
|
2021-01-19 22:02:51 +01:00
|
|
|
hole_center_coords = (70, 70)
|
2021-03-27 23:28:21 +01:00
|
|
|
led_footprint_rotation = 90
|
2021-01-19 22:02:51 +01:00
|
|
|
|
|
|
|
df = pd.DataFrame({'x': [], 'y': [], 'angle': []})
|
|
|
|
pd.set_option('display.float_format', lambda x: '%.3f' % x)
|
|
|
|
|
|
|
|
for led in range(led_count):
|
|
|
|
led_angle = led / led_count * 2 * np.pi
|
|
|
|
x_coord = np.cos(led_angle) * ring_diameter / 2 + hole_center_coords[0]
|
|
|
|
y_coord = -np.sin(led_angle) * ring_diameter / 2 + hole_center_coords[1]
|
|
|
|
df = df.append({'x': x_coord, 'y':y_coord, 'angle': (led_angle / np.pi * 180 + led_footprint_rotation) % 360}, ignore_index=True)
|
|
|
|
|
2021-03-27 23:28:21 +01:00
|
|
|
print(df)
|