-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfpcb.ps
5975 lines (4439 loc) · 126 KB
/
fpcb.ps
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%!PS
% project notes
% fixed - circles arcs do not render to copper or component layers
% orphaned drawing on copper should be considered modules.
% fixed as polygon components- filled rects as zones create issues with overlap
%and clearance
% no mapping of trace to zone. expressPCB zones do not have nets
% could make them always ground. Can also check point in rect to
% see if named net intersects zone. infill
% thermals not handled in pads, are handled in zones. see above comment.
% update netlist parser to use named nets from schematic or netlist
% favor named nets over N$x nets when merging. This may fix issues
% with slightly non connected nets not merging
% keep out cut out areas need work, May need to merge these at parse time
% can check this with region checking.
% need to work out a library name system, useful for archiving footprints
% to module libraries.
% fixed - Group text is titleBlockType - these have no pads. One example
% has a broken link. Handle these as modules, which seem to allow
% drawings on the copper layers.
% deconstructed reader for express schematic files
% requires ghostscript min and max functions
cleardictstack
%-------------------------------------------------------------------------
/tfd (<yourpathhere>/small_e.pcb) def % must be edited from root.
%/tfd (/AROOT/APlace/fpcb/emmyIX_gk_e.pcb) def
/KiCadDataFolderPfx (KiCad/myFiles/) def % change this to the full path where the
% converted files will be stored. Must be full path from
% top file directory, or files will be stored
% in the conversion source directory. Directory must exist.
/verbose true def % for debug
/render true def % for logging graphical reconstructions to display device
/writefiles false def % write converted file
/backannotate false def % Attempt to write .cmp and .stf files for project.
/DisplayFont /URWGothicL-Book def
%DisplayFont /AvanteGarde-Book def
% no user settings past this point
%######################################################################
/=$ {dup length 2 mul dup 60 idiv add 1 add string dup
/ASCIIHexEncode filter 3 -1 roll 3 copy writestring 2
index flushfile pop pop closefile =} bind def
/$ {dup length 2 mul dup 60 idiv add 1 add string dup
/ASCIIHexEncode filter 3 -1 roll 3 copy writestring 2
index flushfile pop pop closefile } bind def
%/dfa {pop} bind def %
/dfa {{ exch =string cvs print (: ) print ==} forall} bind def
/makestring {
%verbose 2 gt {(<) print =$} if
dup length string % new string of right size
dup /NullEncode filter % make a file out of string
2 index % array to stack top
{ 2 copy write pop } % integers to string
forall
flushfile exch pop % clean up
} bind def
/strcat {
dup length 2 index length add string
2 index length 3 -1 roll 3 copy putinterval pop pop
0 3 -1 roll 3 copy putinterval pop pop
} bind def
/Word_l$ <870000> def % low first
/Long_l$ <8500000000> def % low first
/Word$ <860000> def % high first
/Long$ <8400000000> def % high first
/flushFlag false def % only render on exit
/sheetCount 1 def
% level2 date function
(%Calendar%) /IODevice resourcestatus {
pop pop (%Calendar%) currentdevparams
dup /Running get { /timedict exch def
[
timedict /Year get 4 string cvs {} forall 45
timedict /Month get 2 string cvs {} forall 45
timedict /Day get 2 string cvs {} forall 32
timedict /Hour get 2 string cvs {} forall 58
timedict /Minute get 100 add 3 string cvs 1 2 getinterval {} forall 58
timedict /Second get 100 add 3 string cvs 1 2 getinterval {} forall
]
makestring dup == /StartTime$ exch def
[
timedict /Day get 2 string cvs {} forall
[( jan ) ( feb ) ( mar ) ( apr ) ( may ) ( jun )
( jul ) ( aug ) ( sep ) ( oct ) ( nov ) ( dec )
]
timedict /Month get 1 sub get {} forall
timedict /Year get 4 string cvs {} forall
]
makestring /SimpleDate exch def
}{
(Clock/calendar is present but not running.\n) print
/StartTime$ (0) def
/SimpleDate ( nodate ) def
} ifelse
} {
(No clock/calendar present.\n) print
/StartTime$ (0) def
/SimpleDate ( noclock ) def
} ifelse
%quick and dirty proc for making a sort of timestamp
/TimeHashes 10 dict def
%quick and dirty proc for making a sort of timestamp
/TimeStamp {
(%Calendar%) currentdevparams begin
10 dict begin % make a local dictionary for constants
/SEC_PER_HOUR 60 60 mul def
/SEC_PER_DAY SEC_PER_HOUR 24 mul def
/SEC_IN_MONTH [0 2678400 5097600 7776000 10368000 13046400 15638400 18316800 20995200 23587200 26265600 28857600] def
Year 1970 sub 365.2425 mul SEC_PER_DAY mul cvi % approximate the number of seconds since 0 time
SEC_IN_MONTH Month 1 sub get cvi add % add in the seconds to the first of the month
Day 1 sub SEC_PER_DAY mul cvi add % seconds to midnight the prior day
Hour SEC_PER_HOUR mul cvi add
Minute 60 mul cvi add
% (->) print pstack (<-) =
Second add
% (->) print pstack (<-) =
cvi dup 16 8 string cvrs exch
end
{
1 index cvn TimeHashes exch 2 copy known
{
%(y->) print pstack (<-) = flush
get 1 add
cvi dup 16 8 string cvrs exch
4 -2 roll pop pop %put
%(y->) print pstack (<-) = flush
}{
%(n->) print pstack (<-) = flush
3 -1 roll put exit
%(n->) print pstack (<-) = flush
}ifelse
} loop
end
} bind def
/print_pcbFile {
writefiles {
pcbfileref exch writestring
}{
print
}ifelse
} bind def
/print_stfFile {
writefiles {
stffileref exch writestring
}{
print
}ifelse
} bind def
/print_cmpFile {
writefiles {
cmpfileref exch writestring
}{
print
}ifelse
} bind def
/print_pcbFile_integer {
cvi 25 string cvs
writefiles {
pcbfileref exch writestring
}{
print
}ifelse
} bind def
% functions for decoding the input stream
/keydict 10 dict def
/initIO {
keydict begin
tf read not {end exit} if % read low byte
tf read not {end exit} if % read high byte
8 bitshift or
/key exch def
/Object /keyDictType def
(\nkey: 0x) print key 16 =string cvrs =
end
} bind def
/nextKeyNumber {
keydict begin
/paramInt key def
17 {
/j 0 def
paramInt 16#20 and 0 ne {/j 1 def} if
paramInt 16#08 and 0 ne {/j j 1 add def}if
paramInt 16#04 and 0 ne {/j j 1 add def}if
paramInt 16#01 and 0 ne {/j j 1 add def}if
/paramInt paramInt -1 bitshift def
j 16#1 and 0 ne {/paramInt paramInt 32768 add def}if
} repeat
/key paramInt def
end
} bind def
/read1 {
keydict begin
tf read not {end exit} if % read i
nextKeyNumber
key xor 255 and
end
} bind def
/read2 {
keydict begin
tf read not {end exit} if % read i
tf read not {end exit} if % read j
8 bitshift or % j << 8
nextKeyNumber
key xor 65535 and
end
} bind def
/read3 {
keydict begin
tf read not {end exit} if % read i
tf read not {end exit} if % read j
8 bitshift or % j << 8
tf read not {end exit} if % read k
16 bitshift or % k << 16
/m exch def
nextKeyNumber
/n key 16 bitshift def
nextKeyNumber
/n n key or def
/m m n xor def
/m m 16777215 and def %0xFFFFFF
m 16#800000 and 0 ne {/m m -16777216 or def }if % 0xFF000000
m
end
} bind def
/dsysparm3 {
read3 verbose {dup dup 4 -1 roll print 16 =string cvrs print (h ) print =string cvs print ( ) print
dup [ exch dup -16 bitshift exch 16#FFFF and dup -8 bitshift exch 16#FF and ] makestring == }{exch pop} ifelse
} bind def
/dsysparm2 {
read2 verbose {dup dup 4 -1 roll print 16 =string cvrs print (h ) print =string cvs print ( ) print
dup [ exch dup -8 bitshift exch 16#FF and ] makestring == }{exch pop} ifelse
} bind def
/dsysparm1 {
read1 verbose {dup dup 4 -1 roll print 16 =string cvrs print (h ) print =string cvs print ( ) print
dup [ exch 16#FF and ] makestring == }{exch pop} ifelse
} bind def
% constant lookup tables
/SCHFILE 16#5678 def
/CMPFILE 16#5685 def
/PCBFILE 16#B9C7 def
/FPTFILE 16#7DF8 def
/DIRECTION [ 0 90 180 270] def
/KI_DIRECTION [
( 1 0 0 1\n) % degenerate 0
( 1 0 0 1\n) % 0 rotate
( 0 -1 1 0\n) % -90 rotate
(-1 0 0 -1\n) % -180
( 0 1 -1 0\n) % -270
] def
/PS_DIRECTION [
[ 1 0 0 1 0 0] % degenerate 0
[ 1 0 0 1 0 0] % 0 rotate
[ 0 1 -1 0 0 0] % 90 rotate
[-1 0 0 -1 0 0] % -180
[ 0 -1 1 0 0 0] % 270
] def
/TX_DIRECTION [
[ 1 0 0 1 0 0] % degenerate 0
[ 1 0 0 1 0 0] % 0 rotate
[ 0 -1 1 0 0 0] % -90 rotate
[-1 0 0 -1 0 0] % -180
[ 0 1 -1 0 0 0] % -270
] def
/ORENTATION [(H) (H) (V) (H) (V)] def % Kicad text orentation
/FONT [/notdef /PLAIN /BOLD] def
/ARC_ANGLE [ 3600 3000 2100 1800 900 -900 ] def
/ARC_SHAPE [[0 3600] dup [1200 600] [1650 150] [1801 3599] [2250 3150] [2700 0]] def
/K_ARC_DIRECTION [
[[0 3600] dup [1200 600] [1650 150] [1801 3599] [2250 3150] [0 900] ] % 0
[[0 3600] dup [300 3300] [750 2850] [901 2699] [1350 2250] [2700 0]] % 270
[[0 3600] dup [3000 2400] [3450 1950] [1 1799] [450 1350] [1800 2700] ] % ]180
[[0 3600] dup [2100 1500] [2550 1050] [2701 899] [3150 450] [900 1800] ] % 90
] def
/COMPONENT_TYPE [/notdef /titleBlockType /componentType /symbolType /footprintType /notdef] def
/ApertureText [(via)(round)(sqare)(rect)(bga)] def
/dddrawpage {
tfn ==
showpage
% more debug draw the nets
306 384 translate 180 rotate
%72 500 div dup scale % view with 150% enlargement
72 1000 div dup scale % normal scale
-1 1 scale
0 1 1 setrgbcolor
12 setlinewidth
1 setlinecap
1 setlinejoin
-3800 2 div -2500 2 div translate % mini-board zero
-3000 0 moveto 3000 0 lineto stroke
0 -3000 moveto 0 3000 lineto stroke
} bind def
%-Value
%~when unknown
%-Footprint
%~when unknown
%-Datasheet
%~when unknown
%#PWR for power pins -- handle symbols separatly
/getAttributes {
/paramInt exch def
verbose {
paramInt qdbp
% split it out
dup 0 12 getinterval print ( ) print
dup 12 1 getinterval print ( ) print
%dup 13 1 getinterval print ( ) print
13 3 getinterval print (b) =
} if
%FDECBA987654 3 2 10
%0123456789AB C D EF
%ssssssssssss
/TextAttributes << % >>
/attrib_vis paramInt 16#08 and 0 ne
/attrib_dir paramInt 7 and
/attrib_size paramInt -4 bitshift
/attrib_style 1 def % fixed style
/Object /attributesType
>> def
verbose {
TextAttributes begin
(TextAttributes: d:) print
DIRECTION attrib_dir 1 sub get =string cvs print
( s:) print attrib_size =string cvs print
( f:) print attrib_style =string cvs print
( v:) print attrib_vis =string cvs =
end
} if
} bind def
% renderers and object display functions
/createAddModule {
% creates or adds to a sub group keeping track of the bounding box
/objectDict exch def
/groupRef groupID =string cvs cvn def
modules groupRef 2 copy known {
verbose {(module: /) print dup =string cvs print ( exists) = flush}if
get % existing component directory
}{
verbose {(creating module: /) print dup =string cvs = flush} if
10 dict dup 4 1 roll put % creates a new group dictionary
} ifelse
begin %open component dictionary
/Object /moduleTypeInstance def
% calculate the new bounding box just for pins
% this will be used to detect component rotation and orentation
objectDict /Object get /padType eq {
% (is pin:) =
currentdict /minX known
objectDict begin
{
% (has bbox) =
minX lbb1X min
minY lbb1Y min
maxX lbb2X max
maxY lbb2Y max
}{
lbb1X
lbb1Y
lbb2X
lbb2Y
} ifelse
end
% (->) print pstack (<-) =
/maxY exch def
/maxX exch def
/minY exch def
/minX exch def
} if
localRef objectDict def
end
} bind def
% component parse case dictionaries
/renderPCB << % >>
/footprintType {
%/y2
%/x2
%/y1
%/x1
%/refAttrib
%/refTxt
%/valueTxt
refAttrib getAttributes
TextAttributes %dup dfa
begin
attrib_vis pop true
{
gsave
DisplayFont %attrib_size 1.3 mul selectfont % rotate text context
true {
findfont
[attrib_size 1.3 mul 0 0 2 index neg 0 4 index]
% TX_DIRECTION attrib_dir
% get matrix concatmatrix
makefont setfont
}if
% this changing of the context only works with
% postscript rendering. When matrix tranforms
% are used to place the text start point the
% results are screwy
x1 y1 drawMatrix transform translate
DIRECTION attrib_dir 1 sub get neg rotate
% attrib_size add
0 0 moveto refTxt show
grestore
} if
end
}
/outlineType { verbose {(render board outline) = } if
gsave
0 setlinewidth
x1 y1 drawMatrix transform moveto
modules parent get to get begin
x1 y1 drawMatrix transform lineto
end
stroke
% optionally flags can show us the anchor point
grestore
}
/padType {
gsave
%/aperture exch def
%/drillSize exch def
%/h exch def
%/w exch def
%/y1 exch def
%/x1 exch def
%/layerOptions
%/padNumber
aperture =string cvs cvn << % >
/1 { %via
x1 y1 drawMatrix transform w 2 div
dup scaleMatrix transform pop
0 360 arc fill
}
/2 {% round
x1 y1 drawMatrix transform w 2 div
dup scaleMatrix transform pop
0 360 arc fill
}
/3 {% square
x1 w 2 div sub y1 h 2 div sub drawMatrix transform
w h scaleMatrix transform rectfill
}
/4 {
% rectangle - possibly surface pad
x1 w 2 div sub y1 h 2 div sub drawMatrix transform
w h scaleMatrix transform rectfill
}
/5 {
% bga
x1 y1 drawMatrix transform w 2 div
dup scaleMatrix transform pop
0 360 arc fill
}
% pre version 7 do not have dynamic pad shapes
% can decoded them here or at parse time
>> exch 2 copy known {
get exec
}{
(pad Number: ) print padNumber ==
(aperture key: ) print ==
pop
% default pad
x1 y1 drawMatrix transform 65 2 div
dup scaleMatrix transform pop
0 360 arc fill
}ifelse
drillSize 0 gt {
gsave
0 0 0 setrgbcolor
x1 y1 drawMatrix transform drillSize 2 div
dup scaleMatrix transform pop
0 360 arc fill
grestore
}if
innerconnect 0 ne {
%/var_18 innerconnect 7 and def (var_18: ) print var_18 ==
gsave
x1 y1 drawMatrix transform translate
innerconnect -5 bitshift 3 and dup
1 eq {
0 1 1 setrgbcolor
30 rotate
-100 0 moveto 100 0 lineto stroke
0 -100 moveto 0 100 lineto stroke
}if
2 eq {
1 0 1 setrgbcolor
45 rotate
-100 0 moveto 100 0 lineto stroke
0 -100 moveto 0 100 lineto stroke
}if
innerconnect -3 bitshift 3 and dup
1 eq {
1 1 0 setrgbcolor
30 rotate
-100 0 moveto 100 0 lineto stroke
0 -100 moveto 0 100 lineto stroke
}if
2 eq {
1 0 0 setrgbcolor
45 rotate
-100 0 moveto 100 0 lineto stroke
0 -100 moveto 0 100 lineto stroke
}if
grestore
} if
grestore
}
/lineType {
gsave
thick setlinewidth
x1 y1 drawMatrix transform moveto
x2 y2 drawMatrix transform lineto stroke
grestore
}
/arcType {
gsave
verbose {(arc render) =
currentdict dfa
} if
%(arc direction: ) print arc_dir ==
%(shape: ) print shape ==
thick setlinewidth
x1 y1 drawMatrix transform radius
K_ARC_DIRECTION arc_dir 1 sub get shape get {10 div} forall
arc stroke
verbose {(/arc render) =} if
grestore
}
/textType {
gsave
% old style render
% x1 y1 drawMatrix transform translate
%1 -1 scale % invert the context
% choose font normal/bold/italic
DisplayFont %attrib_size 1.3 mul selectfont % rotate text context
true {
findfont
[attrib_size 1.3 mul 0 0 2 index neg 0 4 index]
% TX_DIRECTION attrib_dir
% get matrix concatmatrix
makefont setfont
}if
% this changing of the context only works with
% postscript rendering. When matrix tranforms
% are used to place the text start point the
% results are screwy
x1 y1 drawMatrix transform translate
DIRECTION attrib_dir 1 sub get neg rotate
% attrib_size add
0 0 moveto
displayText show
grestore
}
/polyFillType {
gsave
keepOutZone 2 eq {
1 0 0 setrgbcolor
} if
[65] 0 setdash
newpath
poly 0 get cvx exec drawMatrix transform moveto
poly {cvx exec lineto} forall
closepath
stroke
grestore
}
/rectFillType {
gsave
x1 y1 drawMatrix transform
x2 x1 sub y2 y1 sub rectfill
grestore
}
>> def
/sub_417744 {
% most information thrown away
%;var_C= dword ptr -0Ch
%;var_8= dword ptr -8
%;var_4= word ptr -4
%(---------------------) =
%currentdict dfa
%(---------------------) =
/saveVerboseState verbose def
/verbose true def
versionMajor 5 lt {
% 3 1 3 3
%tf fileposition
% re read header to get key
% version 4 layers may be encoded in plaintext
tf 12 setfileposition
tf 14 string readstring {=$}if
%tf exch setfileposition
initIO
%(---------------------) =
%currentdict dfa
%(---------------------) =
versionMajor 3 lt {
% test read for link list pattern
(*old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(\nold version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
(old version: ) dsysparm2 pop
/errBlock errBlock 1 add def
}{
% version 3 & 4 have link text
(schematic name string alloc: ) dsysparm2 dup ==
dup string
/dword_426E64 exch def
0 1 3 -1 roll 1 sub {
dword_426E64 exch read2 16#FF and put
} for
(linked schematic: ) print
dword_426E64 ==
% test read for link list pattern
% (>old version: ) dsysparm3 pop
% (old version: ) dsysparm1 pop
% (old version: ) dsysparm3 pop
% (old version: ) dsysparm3 pop
% (\nold version: ) dsysparm1 pop
% (old version: ) dsysparm3 pop
}ifelse
% {(old version: ) dsysparm2 pop}loop
}{
(\nXanchor: ) dsysparm3 /var_8 exch def
(Yanchor: ) dsysparm3 /var_C exch def
(Layers: ) dsysparm2 /gBoardLayerCount exch def
(Track Clearance: ) dsysparm2 /gTrackClearance exch def
(Zone Clearance: ) dsysparm2 /gZoneClearance exch def
(Default Via: ) dsysparm2 /gViaSize exch def
(Default Via Drill: ) dsysparm2 /gViaDrill# exch def
(read2: ) dsysparm2 pop
% rdStrNode
(schematic name string alloc: ) dsysparm2 dup ==
dup string
/dword_426E64 exch def
0 1 3 -1 roll 1 sub {
dword_426E64 exch read2 16#FF and put
} for
(linked schematic: ) print
dword_426E64 ==
/verbose false def
22 {
(read2) dsysparm2 pop
%read2 dup 16 =string cvrs print (h ) print ==
} repeat
}ifelse
/verbose saveVerboseState def
} bind def
/qdbp {
% quick and dirty binary print
16#10000 or 2 =string cvrs 1 16 getinterval
} bind def
%PCB sub functions
%PCB sub functions
% epcb hole size limit table
% 0.014", 0.020", 0.025",
% 0.029", 0.033", 0.035",
% 0.040", 0.043", 0.046",
% 0.052", 0.061", 0.067",
% 0.079", 0.088", 0.093",
% 0.100", 0.110", 0.125",
% 0.141", 0.150", 0.167",
% 0.192", 0.251".
% anular ring copper limit 0.017
% hole clearance 0.021
% edge clearance 0.025
/drillMap {
<< % >> drill map dictionary
0 { 0 }
135 { 8 }
200 { 14 }
260 { 20 }
310 { 25 }
350 { 29 }
390 { 33 }
420 { 35 } % 35 which is our target hole diameter
% these need fixing
%{ // case 2
%loc_416F1B:
%mov ax, 28h % 37
%}
465 { 40 }
492 { 43 }
520 { 46 }
595 { 52 }
670 { 61 }
730 {16#43 }