-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfourier_data.py
102 lines (88 loc) · 17.5 KB
/
fourier_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import numpy as np
from numpy.fft import fft
import matplotlib.pyplot as plt
# SVG格式
# 首先用adobe illustrator或其他工具生成矢量图,保存为SVG格式
# 这个矢量图应当只有一条曲线,且曲线是闭合的
# 因为解析SVG格式是自己写的,目前只支持path标签且仅支持:HhVvLlMmCcSs
# 将path的内容复制到这里就可以了
path = """M169.64-55.13l4.37-3.35l4.1-3.14l9.37-4.87l9.37-3.61l9.55-2.88l10.46-2.16l14.24-1.26h11.54l12.44,1.8 l10.64,5.77l5.59,6.67l3.06,7.93l-0.72,5.95l-3.06,4.69l-0.18-5.05l-0.72-7.21L266.81-60l-3.97-5.05l-4.51-2.88l-5.05-3.25 l-6.13-2.34l-12.44-2.16l10.82,5.05l7.75,4.87l5.23,5.77l2.88,6.13l0.72,5.23l0.18,5.95l1.8,2.88h3.97l2.88,6.49l0.72,10.1 l0.54-5.41l-1.8-8.29l-4.33-3.79l-3.97,0.72l1.26-9.01h-9.92L245-46.66l-5.23,3.61l3.43,2.16l-9.74-2.52l-9.19-0.18l-9.19,2.88 l-11.18,6.49l-9.01,9.37l-7.21,9.74l-5.05,6.67l-4.69,5.23l-6.49-9.92l-4.69-9.19l-2.16-5.05l8.47,4.87l12.62,6.31l1.26,3.97 l-8.11,5.95l-3.97,1.08l-11.36-25.24h20.19l10.1-1.26l7.57-1.62l-10.64,12.08L181-5.01l-9.92,6.67l-10.64,2.52l-12.26-0.9 l-13.34-6.49l-5.59-5.41L137.91,0l13.7,6.71l18.57,2.7l14.42-2.52l10.46-3.25l13.88-8.11l8.11-7.93l8.65-8.65L211.28-4.11 l-6.13,10.28l-3.34,9.74l10.01-7.75l7.21-9.37l6.85-9.37l5.77-9.55l6.13-8.11l-4.87,4.15l-3.97,11.18l-5.77,8.65l-6.85,8.83 l-9.55,9.19l-15.32,7.75l-8.11,2.34l-13.7,1.26h26.86l13.16-3.79l11.72-5.77l9.37-6.49l12.98-11.9l-19.47,18.57l-9.74,14.78 l-4.87,12.26l-2.7,13.34v13.52l3.61,6.85l-4.51-10.46l4.15-12.08l4.33-9.92l9.01-8.47l9.37-5.77l8.65-6.13l6.67-6.85l5.95-8.83 l2.88-13.88l-0.72-12.44l-1.08,15.86l-4.33,18.57l-5.59,10.28l-7.39,7.39l-5.23,1.44h10.46l11.9-6.85l7.93-7.39l6.49-6.85 c0,0,3.79-8.47,3.97-9.19c0.18-0.72,1.62-11.72,1.62-11.72v17.67l-5.41,8.29l-7.03,4.69l-3.97,2.88l-1.62,3.43l7.57-2.16h5.77 l-6.85,3.43l-1.26,7.75l3.61-3.06l4.69-2.34l1.8,2.34l-0.9,2.88l1.26,3.97l1.62,3.06l2.52,3.25l5.05,1.44l4.87-1.62l2.88-3.79 l1.44-4.15v-3.97l-3.43,0.72l-2.16,2.88l-2.34,2.34l-3.79-0.9l-3.61-1.98l1.62-2.16l3.06,1.98h2.7l3.06-3.06h-3.97l-4.33-1.26 l-3.97-1.44l5.95-0.36l3.43,0.54l4.33,0.36h3.43l-0.9-3.79l-2.52,1.26l-1.62-2.16l-0.36,2.52l-2.52-2.16l-1.08,2.52l-2.16-2.52 l-1.98,2.7l-2.16-2.7l-2.52,1.62l-2.88-0.72l-3.79,1.98l-2.7,1.98l2.7-9.19l5.95-2.52l4.69-4.51l5.41-8.65l2.34-10.46l-0.36-9.19 l-1.08-7.75l-2.7-5.95l4.51,10.64l-0.72,19.47l-0.18,3.97l5.77,5.59c0,0,3.43,6.49,4.15,6.85c0.72,0.36,4.33,8.83,4.33,9.55 c0,0.72,1.44,10.64,1.44,10.64l-1.08,7.39l-3.79,5.59l-8.47,3.43l9.01-0.9l8.11-5.05l6.67-7.75l6.31-8.83l2.88-6.31l1.08-16.77 v31.91l-6.49,13.16l-6.67,6.13l-4.69,3.43l-4.15,0.54l5.59-5.95l3.97-7.75l1.44-6.49l-9.74,5.41l-2.7,7.03l-2.88,6.85l-5.41,5.23 l-2.88,2.34l6.13-1.08l5.23-4.15l-3.97,14.96h-5.05l-8.29,3.97l-10.28,5.41l-8.65,5.77l-8.47,3.25l-10.28,1.8h-13.7h-9.01l1.44-2.16 l6.67-1.98l10.82-3.43l5.77-1.8l3.97-0.54l12.44,6.31l-5.77-1.26l-10.1-7.39L240.49,90l-3.06-5.05l-3.25-6.31l-3.06-6.31l-4.87-9.92 l0.9-3.97l3.06-2.52l1.98,2.52l-0.18,3.79l2.52,4.51l3.61,3.79l4.33,1.62l2.52-2.52l0.54-4.69l-2.88-5.59l-2.52-5.23l0.9,5.05 l1.26,6.13l-3.06,0.36l-1.98-1.8l-3.06-1.62l5.05-2.52l1.44,3.97l-4.87-4.33l3.97-2.34l-2.16-3.25l-0.36,3.06l-2.34-2.34l-1.08,1.98 l-1.8-2.34l-4.15,1.62l-2.79,5.23l-3.15-4.51l-0.72-9.19l0.9-5.05l4.33-2.7l-6.31,4.87L223,60.79l3.06,7.39l2.16,1.62l-7.39-5.41 l-3.79-5.95c0,0-1.44-5.41-1.44-5.95s0-6.85,0-6.85l-5.59,5.59l-3.06,29.93l-2.16,8.11l-4.87,7.93l-6.49,7.75l-6.85,5.23l-7.75,3.43 l-7.93,1.62l11.18-4.33l7.57-5.77l5.59-7.93l4.15-7.93l2.34-6.85l1.8-8.47l0.18-7.57l-1.08-7.39l0.18-11.54l3.25-9.74l3.61-7.75 l2.16-4.87l-5.59,7.93l-4.69,22.17l-2.88-6.13l-0.72-9.37l0.9-14.06l-4.87,3.06l-9.92,10.46l-8.65,13.34l-4.87,15.68l-1.26,14.42 L170,95.04l-3.61-4.33l-1.98-7.03l-0.54-8.47l1.98-11.36l3.97-10.1l4.51-9.37l5.41-7.75l5.05-5.05l3.43-3.61l4.33-4.33l5.23,3.97 l-10.64,10.1l-4.33,10.28l-2.34,17.49l-0.36,15.86l-0.54,9.19l5.23-8.11l5.23-11.18l2.16-11.54l-9.92,29.21l-9.55,11.18 l-10.64,10.28l-14.6,8.29l-12.62,4.51l-16.41,2.34l-11.9-1.8l-9.37-4.87l-5.95-4.69l-7.93-10.82L81.3,91.62l2.88,17.85l8.83,11.18 l12.98,7.39c0,0,13.16,3.97,14.24,4.33s10.46,2.52,10.46,2.52h19.83l11.54-3.61l17.31-7.57l13.88-8.65l11.54-9.37l9.01-12.8 l5.05-11.9l1.8-8.65l-13.88,33.53l-11.36,13.7l-13.52,13.52l-20.91,18.75l-12.08,14.96l-4.51,7.75l10.82-17.67l15.86-18.03 l13.52-14.96l2.34-3.61l-27.4,13.88l-8.47,8.65l-9.92,14.42l-7.75,18.93l-2.52,14.06l1.26,19.29l3.61,9.92l2.88,2.7l-4.33-9.74 l2.34-15.86l6.49-12.98l11.18-14.24c0,0,13.16-12.98,14.6-13.88c1.44-0.9,23.62-19.83,24.52-21.09c0.9-1.26,16.77-16.77,16.77-16.77 l7.57-8.11l7.93-11.54l6.13-14.06l3.06,1.8l-1.26,13.7l-3.79,1.26l-9.55,7.57l-0.18,14.06l-7.75,9.37l-12.44,11.72l-11.36,7.75 l-11.9,6.85l-11,6.31l-13.16,9.37l11.72-6.85l-3.43,7.93l-1.26,11.18l1.98,10.82l3.61,5.05l-3.79-10.82l1.98-9.74l2.52-8.65 l5.23-8.11l4.51-4.69l18.39-11l-5.41,9.01l-0.36,4.51l7.03-6.49l3.43-10.28L212,133.8l7.21-8.29l-0.18,3.06l-4.69,4.87l-0.36,2.52 l-14.96,16.77l-14.6,12.08l-3.06,3.97l-2.88,7.93l-2.52,9.01l-2.16,7.75l-2.7,7.21l-3.25,4.15l-2.34,3.61l1.62,3.25l3.79,5.59 l3.43,7.21l2.34,6.13l1.62,6.31l-0.72,3.61l-3.97,8.11l-5.95,13.7l-2.7,7.39l-2.88,8.29l-6.85,12.8l-3.25,6.13l-5.77,5.59 l-8.83,7.93l-11.9,8.65l-11.72,8.47l-9.37,6.67l-11,9.92L83.1,357.53l-6.67,9.92l-1.08,2.34l5.41-2.7l6.49-1.44l7.93,1.08l6.13,3.79 l10.46,4.69l13.16,5.59l2.16-6.67c0,0,6.49-12.26,7.21-12.62c0.72-0.36,16.41-24.34,16.41-24.34l12.26-19.65l6.67-12.8l4.87-11.36 l7.75-14.6l-0.9,10.46l-2.34,12.44l-1.8,20.73l6.49-3.25l12.26-3.25l2.16-1.62l-0.72-10.46l-1.08-12.26l-0.54-14.42l0.72-9.19 l4.33-11l3.79-9.37l3.43-11.54l3.43-7.75l3.06-0.18l-0.9,9.74l1.08,16.23l2.34,23.98l5.05,16.95l4.87,13.52l3.43,6.85l26.14,0.54 l-2.7-3.97l-7.21-10.28l-8.11-10.46l-5.95-10.82l-4.51-11.36l-2.88-11.54l-3.06-11.18l-1.8-9.55l-1.08-7.75l9.37,4.69l8.83,4.69 h5.41l3.79-2.34l2.7-8.11l1.98-10.64l1.62-6.13l-1.26-6.85l-3.61-2.7l-6.49,1.98l-8.29,3.43l-6.49,2.34l-8.83,4.87l-3.25,2.88 l0.72,6.85l6.85,0.9l9.92-0.54l8.65,4.51l4.51,5.05l-3.97,2.16l-8.65,1.08l-16.04-10.82l-7.57,0.9l-3.97-3.79l-0.9-4.33l3.06-5.23 l14.24-0.36l-16.41-0.9l-0.36-4.87l-1.44-6.31l3.61-8.47l4.15-7.03l5.77-7.57l5.95-7.21l7.39-9.01l9.74-9.92l15.86-9.74 l-24.34,15.32l-11.9,6.13l-1.44,10.82l-0.18-10.28l-15.32,7.75l-2.16,13.7l0.36,8.47l2.16,5.41l-1.98-2.16l-0.72-17.31l0.72-7.93 l-8.83,6.49l-8.29,7.39l-4.33,9.01l-3.06,7.93l-7.39,5.05l4.87,7.93l5.23,18.57l4.15-9.19l2.34-9.55l-3.97-5.05l-2.16-5.41 l-0.18-6.49l2.7,9.74l4.87,5.41l0.36-7.03l1.8-3.43l7.21,2.34l4.69,3.43l4.69,4.69l-1.8,7.93l2.7,4.69l-6.31-1.26l-6.49,1.26 l-6.31,4.33l-1.98-2.34l2.16-7.75l-0.9-3.43l-2.52,18.57l4.51,2.88l6.49-1.08l5.77-3.25l6.49-5.77l-6.31,8.11l-3.06,11.18 l-5.23,10.28l4.51-20.01l-14.24,37.5l-6.13,36.24l-0.54,8.29l7.39,0.18l-3.97,10.82l-4.33,11v6.85l4.69,3.43l-7.03,5.41l-10.1,13.88 l6.67,6.49l-0.18,3.79l7.39,4.87l-8.65,14.96l-10.1,18.21l-11.36,21.09l-7.03,16.23l-4.87,10.46l-0.9,4.69l3.61,4.69l8.83,5.77 l9.74,7.75l8.11,5.95c0,0,8.65,2.52,9.92,3.25s17.13,1.26,17.49,1.8s12.98,1.26,12.98,1.26l10.82,29.21l10.46,30.11l4.33,8.47 l3.61,5.95l2.52,7.57l4.33,14.6l4.69,17.67l2.7,11.36l2.34,4.69l2.34,47.95l-5.77-24.34l-5.77-21.99l-1.08-5.59l4.69-3.97l6.49,0.36 l3.97,79.86l2.88,43.81l0.36,26.68l-2.16,4.69l1.62,3.06l-1.44,7.03l-1.98,10.64l-5.59,20.73l-7.21,22.54l-5.23,9.55l-1.08,12.8 l1.44,11.36l0.36,5.59l5.59,4.69l11,1.98h11.18l9.37-3.97l8.11-5.05l2.52-4.15l0.72-6.67l2.88-6.49l2.16-18.21l14.24-14.06 l8.11-12.26l5.59-10.28l1.98-9.74v-8.83l-3.06-5.77l-7.03-7.57l-10.1-8.29l-5.59-2.34l-0.54,9.37l1.26,4.15l-2.7,3.61l-0.9,5.77 l-0.18,27.04l-1.08,24.34l-1.08,3.25l2.88-9.74l7.75-10.1l9.92-13.88l3.43-9.01l0.72-8.65l0.9-8.83l-9.49-9.55l-10.89-10.28 l3.25-22.17l4.51-29.57l3.13-28.3l1.37-22.9l2.7-29.75l0.36-11.72l-4.44-3.25h-3.68l-1.62-12.62l-4.87-23.62l-5.41-22.53 l-3.06-15.14l-1.62-8.29l-2.16,19.65l4.33-32.99l3.43-18.57l2.52-14.96l2.16-12.26l-6.13-2.52l-4.69-2.52l-2.52-3.25l1.62-3.43 l11.18-3.79l7.39-3.25l3.13-3.61l-1.69-10.46l-3.79-12.62l-6.13-22.81l-7.21-19.38l-4.51-11.72l17.67,48.86l3.97,27.4l-8.47-3.79 l-11.9-5.05l-16.04-3.61h-18.21l-18.39,4.51l-0.18,8.83l0.9,17.31l2.52,29.75l4.69,27.4l4.51,23.44l2.7,14.24l2.16,9.74l2.52,6.49 l3.79,23.26l1.26,13.88l1.62,12.08l10.82,1.8l14.96-0.9l10.64-2.16l11.79-5.95l-2.95-1.08l-0.54-3.97l-0.18,5.77l-12.44,7.03 l-26.14,1.62l-9.74-3.79l0.72-6.31l-2.34,1.62l-4.33-1.44l-14.42-49.58l-13.52-33.53l-11.18-30.83l-5.23-8.83l-8.65-26.5h-6.31 l-11.18-0.18l-15.68-1.26l-15.14-2.16l-5.59,0.72l30.47,1.08h23.62l2.88-3.06l-2.7-2.16l-5.05-2.88l-3.61-2.88l-4.33-3.06 l-1.62-3.43l4.33-1.44h9.19l10.82-0.9l11-1.98l13.7-5.23L212,451.82l-12.26,2.34l-17.85-1.8l3.06-10.82l7.03-24.52l8.65-27.22 l2.88-11.72c0,0-2.7-1.98-3.43-1.8c-0.72,0.18-3.79,2.34-3.79,2.34l-3.79,0.36l-7.75-2.7l-6.49,9.37l5.59-10.28l-11.18-2.34 l-5.05-0.36l16.23,1.44l3.97-4.33l7.39-6.49l1.8-7.03l-15.32-3.06l1.62,1.8l-0.9,4.87l1.62,2.52l3.43-3.79l0.9-2.88l14.6,1.08 l7.03,0.18l3.79-0.36l-1.08,4.87l-2.34,9.01L209.3,377l-3.79,1.8l7.39-3.25l7.39-1.8l5.95,0.36L223,363.66l-2.7-7.57l-5.05,0.72 l9.92-3.06l8.83-4.15l6.31-3.97l2.52,14.96l0.36,7.21l6.85,1.8l-4.51,3.79l-8.65,2.34l-5.59,0.72l-5.05-0.36l16.23-0.9l9.92-5.23 l-3.06-3.97l-3.25,1.26l9.92-3.79l9.74-2.52c0,0,10.28-1.44,10.82-1.44s7.03-3.61,7.03-3.61l-1.26-4.33l-4.15,1.62l2.52,1.26 l-4.51,0.36l-2.16-19.47l-4.87-0.9l-13.7,4.51l-12.98,6.49l32.09-12.26l7.75-1.44l12.44,14.96c0,0-5.41,1.26-5.95,1.26 c-0.54,0-5.05,2.34-5.05,2.34l11.9-2.16l0.18,2.16l6.67-1.26l5.41,9.92l4.69,13.16c0,0,1.8,11.9,1.8,12.44s3.25,18.93,3.25,18.93 l1.8,32.81v-43.63l-0.36-28.12l-1.8-13.52l-0.18-6.49l-3.61-1.08l-5.59,2.52l-3.43,1.44l6.85-4.87l7.93,0.54l5.23-0.54l4.69,34.25 l4.87,27.4l2.34,13.88l9.19,27.76l8.83,20.37l-8.65,0.72l-19.47,5.23l-13.52,3.06l-7.57,1.62l-8.29-1.08l-2.34,15.32l15.86-0.36 c0,0,26.32-1.44,27.58-1.44s22.72-3.06,22.72-3.06s20.19-5.95,20.73-6.13c0.54-0.18,13.34-8.47,13.34-8.47l5.59-6.13v-3.97 l-5.05-2.7l0.36-2.34l-3.79-2.52l-5.77,3.06l-5.23,3.43l-7.57,4.51l-9.74,2.16l-7.21-0.36l13.88-2.52l21.09-8.29l9.01-0.9 l14.06-5.77l9.01-4.87l6.31-4.51l5.05-5.23l2.16-4.33l-6.31,0.54l-7.21,1.98l-2.52-1.62l2.7-4.51l6.67-5.41l1.26-5.77l-5.23-1.62 l-9.74,3.43l-12.44,7.39l-13.34,9.37l-3.43,5.41l2.52,4.87l8.65-0.72l-5.41,6.31l1.26,2.52l-9.74-5.95l-7.21-7.57l-7.57-11.72 l-5.41-10.1l-6.85-10.19l-3.97-4.06l-1.26-16.95l-1.8-21.27l-0.18-9.74l67.42,44.53l12.8,11.9l-81.31-58.95l-0.36-15.68l-1.44-18.39 l-0.54-12.8l-0.18-8.29l-5.95,3.06l-10.82,0.9l-4.87,1.44l-7.93-3.61l-0.36,7.03l3.43,18.03l3.06,16.41l-1.26-13.7l-25.96,2.52 l-11.9,2.16l19.47-1.8l11.72,10.46l-4.87-11l8.47-0.9l-8.47-13.16l-11.36-16.04l-9.19-13.7l-1.44-8.29l-5.59-5.95l-0.36-4.33 l2.7-3.06l-3.06-5.59v-2.7l5.77-10.1l2.88-5.59l-0.36-40.56l-3.97-25.78l5.23,28.3l0.9,54.81l-0.9,25.6l9.55,10.28l1.8,6.85 l11.72,3.06l3.79-6.85l-7.21-4.69l-2.88-8.11l3.06-14.6l1.98,14.42l6.13,7.93l10.46-19.29l-11,26.32l5.77,3.97l8.65-3.25 l12.26-12.26l-1.08,5.95l-4.69,3.61l7.21-1.44l5.59,0.72l3.61-3.06c0,0,0.54-7.93-0.36-7.39c-0.9,0.54-6.85,8.29-6.85,8.29 l12.98-20.55l3.25-11.54l-0.36-9.92l-3.06-9.01l-8.83-21.63l-7.93-27.76l-5.77-22.72l24.34,36.24c0,0,23.26,23.62,23.26,24.16 c0,0.54,30.47,26.32,30.47,26.32l22.72,17.85l9.37,9.37c0,0,1.44,6.13,2.34,7.57c0.9,1.44,16.77,29.39,16.77,29.39l11.54,27.04 l8.29,22.17l3.61,19.47l-1.62,17.13l-3.61,13.7c0,0-5.05,9.19-5.23,9.74c-0.18,0.54-3.79,6.85-3.79,6.85l-1.08,2.34l8.47-1.62 l6.85-2.88l6.49-3.97c0,0,7.03-4.69,7.75-4.69c0.72,0,6.49-3.79,6.49-3.79l9.55-0.18l7.03-2.34l6.13-3.97l1.26-4.51l-2.16-10.64 l-3.43-16.77l-3.25-13.34l-2.7-8.65l-8.83-15.68L509.83,335l-11.54-15.32l-10.82-13.52l-9.37-13.34l-8.65-11.18l-21.45-23.8 l-18.39-20.01l-12.62-15.14l-10.64-12.62l-12.98-19.29l-21.45-18.93l-9.92-9.19l-12.44-17.67l20.01,26.14l10.28,5.77l-10.82-16.04 l-20.01-23.98l-13.88-15.32l-15.5-13.88l10.64,11.36l6.13,18.21l1.62,9.74l1.8,21.27l-5.77-33.53l-7.57-16.04l-6.49-3.06l-6.85,0.72 l-5.59,3.06l-5.95,4.33c0,0-6.67,6.67-7.39,7.03c-0.72,0.36-9.37,8.11-9.37,8.11l-8.65,6.67l-8.83,7.21c0,0-7.75,6.49-8.29,7.03 c-0.54,0.54-8.65,7.57-8.65,7.57l-10.82,12.08l-10.46,15.5l-5.95,11l-2.52,5.23l-9.19,3.97l-8.47-5.41l2.16-9.37l5.59-11.18 l23.44-29.39l13.52-10.82l11.18-8.47l-12.62,2.34l-7.93,1.26l-9.55-1.8l-12.26-4.87l18.75,7.03l26.32-5.77l7.03-4.69l10.64-10.1 l17.49-7.57l14.78-4.51l-31.37,10.1l9.55-8.29l10.64-7.39l7.21-2.52l-22.17,11l-7.21,5.05l-12.98,7.57l-9.01,4.69l-8.29,1.08 l11.18-3.97l9.92-6.13l9.19-8.65l7.57-9.92c0,0,4.87-11,5.41-11.18s2.16-5.41,2.16-5.41l1.98-13.16l6.31-4.15l0.72,5.23l-2.7,14.6 l-3.43,9.55l-7.57,8.47l-5.05,4.51l8.29-4.33l8.29-7.39L306,90.9c0,0,3.18-8.83,3.18-9.55s1.8-10.64,1.8-10.64l-2.88,18.93 l7.21-1.98l7.75-0.72L333.33,90l8.83,4.15c0,0,0.18,9.92,0.18,10.46s13.7,24.16,13.7,24.16l23.44,40.02l13.16,19.65v-3.79 l6.13-14.24l3.25-14.42c0,0,0.9-14.96,0.9-15.86s-1.44-18.57-1.44-18.57l-4.69-17.31L389.4,90l-9.19-12.8l-5.05-6.67l23.08,9.92 l11.18,10.28l13.52,16.23c0,0,8.29,20.73,8.29,21.45c0,0.72,0.72,21.63,0.72,21.63l-7.03,15.32l-8.47,9.19l-8.29,6.31l-11,2.88 l-2.52,0.18l10.46-7.75l6.13-13.88l3.43-14.06L412.66,132l-9.37-16.59l-4.33-8.11l-14.78-27.04l-12.08-11.18l-19.47-11.54 l-16.41-13.88l8.29,17.31l17.31,22.54l16.95,18.75l8.65,14.96l5.23,17.49l1.44,13.52l-1.44,18.57l-3.97,12.98l6.67-26.68 l-3.25-12.08l-0.9,12.26l-2.52,9.37l-5.59,8.47l-8.11-12.62l2.52-8.29V133.8c0,0-3.25-12.8-3.25-13.7c0-0.9-7.93-18.21-7.93-18.21 l-8.29-13.52l8.29,24.16l-0.72,26.68l-6.67-9.19v-16.04c0,0-5.05-17.49-5.05-18.03s-8.65-25.06-8.65-25.06l11.54,16.59L336.76,57 l-4.69-12.98l-6.31,12.44c0,0-6.31,7.75-6.85,7.75s-10.1,6.49-10.1,6.49l-5.23,0.72l16.04-5.23c0,0-1.44,16.04-1.44,16.59 s-1.44,2.88-1.44,2.88l6.67-0.9c0,0,4.33-8.47,4.33-9.01s2.7-10.64,2.7-11.36s0-13.88,0-13.88l1.62-9.55l0.36-9.55l-2.52-10.64 l-5.05-11.36l10.1,15.5l15.68,13.52l26.5,11.54l-25.78-13.88l-20.73-23.08l-2.88-3.97l4.51,16.23l1.98,16.04l19.83,18.39 l55.17,26.68l14.24,8.65l14.24,12.98l6.31,9.37l2.34,6.85v10.46l-3.25,7.93c0,0-4.69,6.31-5.23,6.31s-5.05,2.34-5.05,2.34l7.93-3.61 l6.85-7.57l5.05-9.92c0,0,3.79-8.29,3.79-8.83s0.36-9.74,0.36-9.74l-4.87-11.18l-4.87-8.47l-7.39-8.29l11,11.18l5.41,10.28 l2.34,7.75l-0.36-11.72l-3.25-9.55l-9.74-10.82l-14.6-11.9l-24.16-14.78L384.35,38.8l-20.73-14.78L345.23,6.35l-10.1-12.98 l18.57,22.9l7.75,4.15l-6.31-14.6l-7.21-11.72l-6.31-8.65l-3.06-0.54l0.72-4.33l-35.88-11.18l61.66,19.29L393.55,4l18.03,13.7 l8.29,10.1l5.05,9.74c0,0,1.62,7.21,1.8,8.11c0.18,0.9-0.72,9.01-0.72,9.01l-2.16,6.85l4.69-4.33l4.87-7.93l1.26-8.65l-1.44-10.28 l-5.59-9.74l-7.93-9.37L405.63-1.05l-16.59-9.55l-22.35-9.74l-13.34-4.33l-13.16-4.51l-15.32-4.69l-12.26-3.43l-12.98-2.88 l-12.26-3.06l-1.98-4.15l-1.98-4.15l-7.93,0.36l6.49-1.62l5.41-3.61l-0.72-2.7l-4.51-1.8l5.23-1.8l5.95-3.97l-6.13-2.16l-0.36,4.69 l3.79-7.03l7.39-1.98h8.2l-18.48,2.52l2.16-5.77l1.62-7.75l0.9-7.57l1.08-7.57l0.36-2.7l2.88,8.47l3.25,9.01l6.02,8.47 c0,0,3.72,6.31,4.08,6.85s3.97,7.93,3.97,7.93l2.7,10.46l1.44,8.29l-4.51,2.88l1.98-5.41v-14.24l-2.7-6.85l-11.18-13.88L298-95.15 l9.74,13.16l10.1,8.47l7.75,6.49l6.67,8.29c0,0,2.52,7.57,2.88,8.29c0.36,0.72,3.61,12.98,3.61,12.98v5.41l-1.8,3.25l-32.45-11.54 l-19.29-4.51l-0.36-7.39l-9.92,2.7l-1.44-11.36l-12.26-12.44l-15.32-4.69l-19.83-0.18L209.3-71.9l-17.67,4.87L169.64-55.13z"""
def is_zm(c):
return c in "MmHhLlQWERTYUIOPKJGFDSAZXCVBNMqwertyuiopkjgfdsazxcvbn"
path_len = len(path)
l_list = []
i = 0
while i < path_len:
if is_zm(path[i]):
j = i
i += 1
while i < path_len and not is_zm(path[i]):
i += 1
if i == path_len:
i += 1
if i != j:
s = path[j:i].strip()
a = s[0]
b = s[1:]
if a in "HhVv":
l_list.append([a, float(b)])
elif a in "LlMm":
a = a.replace("M", "L").replace("m", "l")
b_list = b.replace("-", ",-").split(",")
b_list = [float(bb) for bb in b_list if len(bb) != 0]
assert len(b_list) == 2
l_list.append([a, *b_list])
elif a in "Cc":
b_list = b.replace("-", ",-").split(",")
b_list = [float(bb) for bb in b_list if len(bb) != 0]
assert len(b_list) == 6
l_list.append([a, *b_list])
elif a in "Ss":
b_list = b.replace("-", ",-").split(",")
b_list = [float(bb) for bb in b_list if len(bb) != 0]
assert len(b_list) == 4
l_list.append([a, *b_list])
else:
print("未知的:", s)
else:
print("error:", path[i])
i += 1
print(len(l_list))
point_list = []
for line in l_list[:-1]:
a = line[0]
if a == "L":
point_list.append((line[1], line[2]))
elif a == "l":
point_list.append((point_list[-1][0] + line[1], point_list[-1][1] + line[2]))
elif a == "h":
point_list.append((point_list[-1][0] + line[1], point_list[-1][1]))
elif a == "v":
point_list.append((point_list[-1][0], point_list[-1][1] + line[1]))
elif a == "V":
point_list.append((point_list[-1][0], line[1]))
elif a == "c":
point_list.append((point_list[-1][0] + line[5], point_list[-1][1] + line[6]))
elif a == "s":
point_list.append((point_list[-1][0] + line[3], point_list[-1][1] + line[4]))
else:
print(point_list[-1], line)
y = [complex(p[0] - 270, p[1] - 213.5) for p in point_list]
y_matrix = np.array(point_list)
y_len = len(y)
yy = fft(y)
print(y_len, len(yy))
plt.plot(y_matrix[:, 0], y_matrix[:, 1])
plt.show()
def fuck(v):
if v.real == 0 or v.imag == 0:
return 0
return np.arctan(v.imag / v.real)
PP = []
for i, v in enumerate(yy[:y_len]):
c = -2 * np.pi * i / y_len
PP.append([-v.real / y_len, c, np.pi / 2])
PP.append([-v.imag / y_len, c, 0])
PP.sort(key=lambda x: abs(x[0]), reverse=True)
# for p in PP:
# print(p, ",")