Newer
Older
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
#!/usr/bin/env python3
import dsnwritier
from pykicad import pcb
test=dsnwritier.Dsn()
###############################################################################
layers=[
dsnwritier.Layer('F.Cu'),
dsnwritier.Layer('B.Cu')
]
bdata=[137735, -31864.8, 165736, -31864.8, 165736, -113335, 137735, -113335,
137735, -113864, 160735, -113864, 160735, -151336, 150736, -151336,
150736, -151865, 160735, -151865, 160735, -211335, 150736, -211335,
150736, -211865, 169735, -211865, 169735, -249335, 96264.4,-249335,
96264.4, -211865, 138264, -211865, 138264, -211335, 37264.4, -211335,
37264.4, -151865, 138264, -151865, 138264, -151336, 87264.4, -151336,
87264.4, -113864, 119265, -113864, 119265, -113335, 264.583, -113335,
264.583, -31864.8, 78264.5, -31864.8, 78264.5, -264.632, 137735, -264.632,
137735, -31864.8]
kdata1=[138725, -221865, 138725, -244336, 150275, -244336, 150275, -221865,
138725, -221865]
kdata2=[98235.3, -224531, 98764.5, -224531, 98764.5, -219905, 103236, -224376,
103236, -236824, 98764.5, -241294, 98764.5, -236669, 98235.3, -236669,
98235.3, -242572, 103610, -237198, 103765, -237198, 103765, -237043,
103874, -236933, 103765, -236824, 103765, -224376, 103874, -224266,
103765, -224157, 103765, -224002, 103610, -224002, 98235.3, -218628,
98235.3, -224531]
#######################################################################################
parsers= dsnwritier.Parser()
boundary=dsnwritier.Boundary(bdata)
keepout=[
dsnwritier.Keepout(kdata1),
dsnwritier.Keepout(kdata2)]
rule=dsnwritier.Rule()
clearance=[
dsnwritier.Clearance(200.1),
dsnwritier.Clearance(200.1,'default_smd'),
dsnwritier.Clearance(50,'smd_smd')]
rule.clearance=clearance
component=[dsnwritier.Component('U1',[103000,48000],name='"DEV"'),
dsnwritier.Component('J1',[103000,48000],name='"DEV"')]
image1_outline=[
dsnwritier.module.Outline(width=120,outline_start=[-7620, 11430],outline_end=[7540, 11430]),
dsnwritier.module.Outline(width=120,outline_start=[-7620, 11430],outline_end=[7540, -13570]),
dsnwritier.module.Outline(width=120,outline_start=[-7620, -13570],outline_end=[-7620, -13570]),
dsnwritier.module.Outline(width=120,outline_start=[-7620, -13570],outline_end=[-7620, 11430])]
# image1_outline=[dsnwritier.module.Outline(120)]
image1_pin=[
dsnwritier.module.Pin(1,[-6350, 10160]),
dsnwritier.module.Pin(2,[-6350, 7620])]
image1=dsnwritier.Footprint('U1',image1_outline,image1_pin)
image=[image1]
########################################################################################
test.parser=parsers
test.layers=layers
test.boundary=boundary
test.keepout=keepout
test.rule=rule
test.component=component
test.image=image
test.to_file('testdsn.dsn')