/ CPX_DAC_Guide / adafruit_logo_vector.py
adafruit_logo_vector.py
  1  # SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
  2  #
  3  # SPDX-License-Identifier: MIT
  4  
  5  ### Adafruit logo
  6  
  7  """Adafruit logo created from bitmap,
  8  vectorised and flattened to straight lines by Inkscape
  9  then points extracte from SVG data.
 10  (Other route is to ask Adafruit for vector version!)
 11  """
 12  
 13  ### pylint 2.3.1 has some strange opinions on data structure indentation here
 14  ### and this conflicts with version 1.9.2
 15  ### pylint: disable=invalid-name,bad-continuation
 16  offset_x = -10
 17  offset_y = 9
 18  
 19  data = [
 20          # Removing the box outline
 21          # Group 1
 22          #     (2.9962184, 251.49811),
 23          #     (2.9962184, 1.4981075),
 24          #     (252.99622, 1.4981075),
 25          #     (502.99622, 1.4981075),
 26          #     (502.99622, 251.49811),
 27          #     (502.99622, 501.49811),
 28          #     (252.99622, 501.49811),
 29          #     (2.9962184, 501.49811),
 30          #     (2.9962184, 251.49811),
 31  
 32          # Outline of the flower followed by the five
 33          # Group 2
 34          [(342.49622, 454.21659),
 35           (346.959242969, 451.054080156),
 36           (349.16935125, 444.29346125),
 37           (349.74007, 396.99811),
 38           (349.42067, 348.99811),
 39           (346.15117, 331.03534),
 40           (341.803838594, 322.622872031),
 41           (336.10557625, 315.17921375),
 42           (320.50984, 301.96305),
 43           (315.24595, 297.9209),
 44           (322.89745, 300.16203),
 45           (338.78867125, 303.15162),
 46           (354.51274, 302.19987),
 47           (370.1502025, 297.314415),
 48           (383.99038, 290.42349),
 49           (425.3782575, 261.03182375),
 50           (455.62553, 237.51598),
 51           (457.673981406, 232.384370781),
 52           (457.63498125, 226.75574125),
 53           (455.656955469, 221.435746094),
 54           (451.88833, 217.23004),
 55           (411.03035375, 203.142875),
 56           (364.28838, 189.00345),
 57           (346.28838, 187.51289),
 58           (334.345396094, 188.212601406),
 59           (324.08682875, 190.43598375),
 60           (314.755874531, 194.422959219),
 61           (305.59573, 200.41345),
 62           (298.69523, 205.64576),
 63           (302.36566, 200.82194),
 64           (309.1910175, 190.60812125),
 65           (313.73687, 180.22634),
 66           (316.80698125, 162.25769875),
 67           (315.61122, 142.49811),
 68           (302.2062, 97.30761225),
 69           (287.72529, 54.616095),
 70           (281.9467975, 48.27558525),
 71           (273.17468, 46.774785),
 72           (268.19440125, 47.74447575),
 73           (264.37486, 50.652804),
 74           (236.2211725, 88.324987),
 75           (209.53225, 127.99811),
 76           (202.6606625, 146.3071125),
 77           (201.25938, 164.93584),
 78           (203.77534, 181.49811),
 79           (206.51089, 188.99811),
 80           (205.9051675, 188.794985),
 81           (203.43769, 185.49811),
 82           (196.64267375, 177.104034375),
 83           (188.75523, 169.97381),
 84           (179.92702375, 164.224298125),
 85           (170.30972, 159.97236),
 86           (160.326935313, 157.051098125),
 87           (148.6087275, 155.3990125),
 88           (102.61522, 154.49966),
 89           (60.16592325, 155.3425225),
 90           (53.6551856875, 157.376749063),
 91           (50.290496, 161.35986),
 92           (47.372345, 168.60014),
 93           (48.89669, 175.71523),
 94           (74.532052, 211.99811),
 95           (94.1360167813, 237.819985),
 96           (108.59780025, 254.2254825),
 97           (120.832361594, 264.08215625),
 98           (133.75466, 270.25756),
 99           (141.60613, 272.36428),
100           (152.49621, 273.38038),
101           (164.49621, 273.99811),
102           (158.0089, 275.81829),
103           (145.07552625, 280.9514125),
104           (133.8165275, 288.7022225),
105           (124.0311775, 299.24521125),
106           (115.51875, 312.75487),
107           (98.843153625, 358.473565),
108           (85.295136, 403.16722),
109           (85.26685925, 408.01758375),
110           (86.915068, 411.86681),
111           (92.4915405, 417.39844125),
112           (99.473822, 419.49811),
113           (143.00896275, 406.315715),
114           (190.36777, 389.38911),
115           (202.01838, 382.636295),
116           (212.26301, 373.79104),
117           (221.50430875, 362.505715),
118           (227.61924, 348.61117),
119           (230.74226, 339.12239),
120           (231.21585, 351.56025),
121           (232.0963625, 362.919155),
122           (234.30307, 370.76155),
123           (242.12680375, 385.41184875),
124           (253.38592, 399.00254),
125           (289.43734875, 427.02384125),
126           (327.49622, 454.1789),
127           (334.9740875, 456.36105375),
128           #(342.49622, 454.2166),
129           #(342.49622, 454.21659),
130          ],
131          # Group 3
132          [(269.38148, 328.24811),
133           (260.235962344, 318.54971125),
134           (252.98225875, 304.9253925),
135           (249.221025781, 291.33056),
136           (249.150290957, 285.780265547),
137           (250.55292, 281.72062),
138           (254.134922402, 279.408903848),
139           (258.744026719, 280.396155156),
140           (263.916454863, 284.085617324),
141           (269.18842875, 289.88053375),
142           (278.175901406, 305.399702969),
143           (280.963844004, 313.930442559),
144           (281.99622, 322.17961),
145           (281.55819875, 326.77132),
146           (279.99622, 329.49811),
147           (275.74986, 331.3257375),
148           #(269.38148, 328.24811),
149           #(269.38148, 328.24811),
150          ],
151          # Group 4
152          [(189.27613, 317.48919),
153           (186.689292012, 315.017226172),
154           (186.253231719, 310.95217),
155           (190.75285125, 299.8028675),
156           (200.613802656, 287.56145625),
157           (213.6749, 277.74811),
158           (220.431676309, 274.964493711),
159           (225.392900469, 274.551332812),
160           (228.531887832, 276.197175508),
161           (229.82195375, 279.59057),
162           (229.236413574, 284.420064492),
163           (226.748582656, 290.374207187),
164           (215.95931, 304.41063),
165           (208.563450625, 310.792326562),
166           (201.1146375, 315.3621975),
167           (194.417365625, 317.725924687),
168           #(189.27613, 317.48919),
169           #(189.27613, 317.48919),
170          ],
171          # Group 5
172          [(270.49622, 263.99178),
173           (266.275620215, 261.866190078),
174           (264.014989219, 259.301005),
175           (263.608503301, 256.443141797),
176           (264.95033875, 253.4395175),
177           (272.455678906, 247.58265375),
178           (285.68442, 242.90575),
179           (302.642775, 241.59651875),
180           (316.00365, 244.06329),
181           (319.7235275, 248.4713),
182           (318.6949, 253.83523),
183           (310.640874688, 259.620080625),
184           (297.3441375, 263.7845675),
185           (282.673111563, 265.513523125),
186           #(270.49622, 263.99178),
187           #(270.49622, 263.99178),
188          ],
189          # Group 6
190          [(202.04337, 252.52942),
191           (191.235123437, 247.592305),
192           (181.9467875, 241.23868),
193           (175.444952812, 234.5173375),
194           (172.99621, 228.47707),
195           (174.24765832, 224.997173086),
196           (177.684219687, 223.036961563),
197           (189.20598, 223.281585),
198           (203.748087812, 228.422920938),
199           (217.49714, 237.67295),
200           (224.516762344, 246.891496563),
201           (224.975280254, 250.442414727),
202           (223.57588375, 253.118295),
203           (220.450783652, 254.792036523),
204           (215.732190781, 255.336538437),
205           #(202.04337, 252.52942),
206           #(202.04337, 252.52942),
207          ],
208          # Group 7
209          [(243.14004, 239.17141),
210           (240.444360469, 233.682861094),
211           (238.94700375, 225.78207875),
212           (239.96685, 206.99811),
213           (245.63492375, 191.82701),
214           (249.349385156, 186.715313438),
215           (252.99622, 184.38871),
216           (256.799735, 184.899581563),
217           (259.7174025, 187.9743),
218           (262.71503, 201.49811),
219           (261.901079688, 215.476273438),
220           (258.45465, 228.0064775),
221           (253.205227813, 237.032497812),
222           (250.16360918, 239.588868945),
223           (246.9823, 240.49811),
224           #(243.14004, 239.17141),
225           #(243.14004, 239.17141),
226          ]
227      ]