Skip to content

Instantly share code, notes, and snippets.

@todbot
Last active June 30, 2022 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todbot/05d8e64ba8c6a7a584c1956c817a8779 to your computer and use it in GitHub Desktop.
Save todbot/05d8e64ba8c6a7a584c1956c817a8779 to your computer and use it in GitHub Desktop.
parse output from PathToPoints when fed DVD_logo.svg
# dvdlogo_vectors_normalize.py -- parse output from PathToPoints when fed DVD_logo.svg
# 25 Mar 2022 - @todbot / Tod Kurt
# svg source: https://upload.wikimedia.org/wikipedia/commons/9/9b/DVD_logo.svg
# parsed with: https://github.com/todbot/PathToPoints (orig https://github.com/Shinao/PathToPoints)
# run on computer with: python3 dvdlogo_vectors_normalize.py
# outputs: python tuples for use in other CircuitPython vectorio code
# width/height from SVG header and looking at min/max below
dvdlogo_w = 205
dvdlogo_h = 95
dvdlogo_path0 = (
118.89249702310562,20.349082887172703,
112.69026161314278,28.189439747250525,
106.80828198448103,36.267881516751835,
104.36643648565652,30.885893098919656,
101.33235576400905,21.36852771707624,
98.15471176570652,11.868642322778701,
93.29829206062293,4.774000000000001,
83.29594567717797,4.774000000000001,
73.29666908875248,4.774000000000001,
63.29384311752161,4.774000000000001,
53.293247511230874,4.774000000000001,
43.28763317056,4.774000000000001,
33.28928206053725,4.774000000000001,
23.29307476918958,4.774000000000001,
20.173639464378358,13.426757190726699,
27.13175846874714,15.842,
37.13298876953125,15.842000000000002,
47.12098360157013,15.9995820851326,
56.66776916353964,18.72844706791546,
61.71947892728425,26.833244461702535,
58.4722559105875,36.09076087261085,
50.403909588851036,41.80694489360601,
40.689007357041355,44.02147236300912,
32.76724659559131,42.550117869943385,
35.00342648124695,32.79985802268982,
37.23883536338806,23.052959928512575,
31.084976277470588,19.987000000000002,
21.090725083470343,19.987000000000002,
16.93965998840332,27.35824042116106,
14.682979690551756,37.101193152412776,
12.427612930297851,46.8384748390168,
11.70342931294441,55.355000000000004,
21.717422332223503,55.355000000000004,
31.704354010075328,55.355000000000004,
41.70169677734375,55.227240478515625,
51.58241893537901,53.72927058866714,
61.065476798322734,50.57369660419144,
69.7746877750773,45.697886423948226,
77.05805527561344,38.90042738186475,
81.54860717182605,30.05163835909963,
81.37097023973706,20.10735880344734,
82.579500564754,20.33210584378429,
85.85823334884643,29.79136272633076,
89.13070523896066,39.232556714352455,
92.40583611841592,48.68142197810192,
95.67901220769434,58.1246476049393,
99.10229449333994,66.80840449574589,
105.65994851462855,59.244743376154915,
112.20494531066424,51.6956812217147,
118.75215966141303,44.14406131837377,
125.31016430380102,36.57999578903988,
131.86232685894612,29.022668579231947,
138.41680477724222,21.4626708073318,
145.8790697643701,15.919916346766056,
155.88084093455967,15.870869763553141,
165.8753527803421,15.840999999999998,
175.77907210808678,17.028706534037717,
183.74269893272313,22.642548350579105,
183.81862798012327,32.30976226597186,
177.4249843430519,39.80100899553299,
168.15425914912947,43.385271845973094,
158.20455871999263,44.194,
156.98731546546333,37.2248091441933,
159.25564118196257,27.480468306696043,
158.69269447288477,19.987,
148.7033191235233,19.987000000000002,
141.0316499253479,22.92649615031667,
138.77359687123416,32.66824052917654,
136.51527247318393,42.411155546283354,
134.25697675809263,52.15394681870938,
140.23484304588706,55.355000000000004,
150.222138166239,55.355000000000004,
160.2357423095703,55.355000000000004,
170.18726969726845,54.61709191299219,
179.88184530142692,52.22699566362706,
189.01199970747993,48.16328476424504,
197.0572015242716,42.28407823842543,
203.02060342032925,34.313841900532026,
204.93914093674908,24.623641400814993,
201.1548262357842,15.531031243159442,
193.3727472752688,9.35266170566199,
183.997045876503,5.981690536975865,
174.07812945079803,4.792137650966649,
164.0734942949766,4.7740000000000045,
154.07012961696088,4.7740000000000045,
144.08492116993108,4.7740000000000045,
134.08238283806108,4.7740000000000045,
126.85820923534571,10.68081904140383,
120.48674529266357,18.397977870941162,
)
dvdlogo_path1 = (
99.41445244176678,67.32900006839526,
89.41751208500344,67.40486664935354,
79.4254229028841,67.63627165974236,
69.43333402644298,68.03312170951659,
59.46040311519278,68.61051714187614,
49.47972241613823,69.39636643074684,
39.52814074803318,70.4319932133191,
29.627058865663596,71.79427091750968,
19.800468686270527,73.65166621692013,
10.243903328232467,76.50210858797283,
6.33556587459438,83.3182536344079,
15.461762265719473,87.27745789794623,
25.206913021184725,89.47035242999976,
35.07803074712776,91.02347964778184,
45.01185904825959,92.19281821658873,
54.984133808145884,93.08404371089559,
64.95435786876703,93.75032321420139,
74.94578391293149,94.22609118104577,
84.93566473104318,94.5300505768165,
94.9428300617534,94.67487433521053,
104.93298601687754,94.6671991837515,
114.92559406711104,94.50726879370468,
124.92748067710994,94.18711890301017,
134.91783875383018,93.69433316450329,
144.90267545804886,93.00770776961397,
154.8504360376522,92.0956269402355,
164.78148542104526,90.89676596576956,
174.64503505580925,89.29989375939367,
184.3825675174594,87.01828127706051,
193.26244684559106,82.66915846741199,
187.8513791690421,76.1627827505473,
178.23014208337224,73.44884422749233,
168.39587212553423,71.6511720073336,
158.492094361952,70.32528614303962,
148.54559939418954,69.31655553750777,
138.5685006020116,68.55178528267815,
128.58419880174787,67.99129523270821,
118.5923970678303,67.60995038511128,
108.59107696112176,67.3923835459655,
95.25705274310847,85.86974583251717,
85.28075950359181,85.25753785229195,
75.64697033199668,82.75935206665844,
81.40033352371306,77.91257213335486,
91.3323355174017,76.79900971413997,
101.32665613961221,76.82616162919997,
111.23936367157103,78.02676445442438,
115.91406768295168,83.04748130194098,
106.21741645646095,85.32868668144943,
96.23459396269872,85.87288009476813,
)
print("path0 = (")
for i in range(0,len(dvdlogo_path0), 2):
x = dvdlogo_path0[i+0] / dvdlogo_w
y = dvdlogo_path0[i+1] / dvdlogo_h
print( "(%.3f, %.3f), " %( x,y), end='')
print(")")
print("path1 = (")
for i in range(0,len(dvdlogo_path1), 2):
x = dvdlogo_path1[i+0] / dvdlogo_w
y = dvdlogo_path1[i+1] / dvdlogo_h
print( "(%.3f, %.3f), " %( x,y), end='')
print(")")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment