Repository navigation
Expand file tree
/
Copy pathtest.py
More file actions
1366 lines (1149 loc) · 128 KB
/
Copy pathtest.py
File metadata and controls
1366 lines (1149 loc) · 128 KB
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
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# (c) Valik mailto:vasnake@gmail.com
'''
Created on 2011-06-08
@author: Valik
Python >= 2.5
Recovery drawing entities from exported data tests
'''
import os, sys, math
import time, traceback
cp = 'utf-8'
ecErr = 1
ecOK = 0
def test (s, norm):
if s == norm:
return
print('test NOT passed, sample [%s], paragon [%s]' % (s, norm))
def pline(pts):
s = ''
for p in pts:
if s: s += ' '
s += "'(%0.15f %0.15f)" % (p[0], p[1])
res = '(setq o (command "pline" %s ))' % s
print res
return res
#def pline(pts):
def parsePoint(p):
''' point samples
('(bulge -0.40485) 5167.6677942053193000', '2925.3907451592981000')
('(bulge -0.40485) 5168.5389312196739000', '2924.4912080961035000')
('5167.6677942053193000', '2923.5916710329097000')
'''
x,y = p
bulge = ''
lst = x.split(') ')
if len(lst) > 1:
bulge,x = lst
t,bulge = bulge.split(' ')
return (bulge,float(x),float(y))
#def parsePoint(p):
################################################################################
def testBlockReference():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, floatIsEqual
def block(pnt, name, xscale, yscale, angle):
res = '(setq o (command "insert" "%s" \'(%0.15f %0.15f) %0.3f %0.3f %0.5f))' % \
(name, pnt[0], pnt[1], xscale, yscale, angle)
print res
return res
def testBlock(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list (4 points)
p = (float(lp[0]), float(lp[1])) # insertion point
sp = (float(lp[2]), float(lp[3])) # vector p-sp with angle == block rotation angle in OCS
cx = (float(lp[4]), float(lp[5])) # vector p-x with angle 0 grad. in OCS
cy = (float(lp[6]), float(lp[7])) # vector p-y with angle 90 grad. in OCS
ocsA = float(lst[8].split(', ')[0]) # rotation angle in OCS
wcsA = float(lst[8].split(', ')[1]) # rotation angle in WCS (useless)
nm = lst[9] # block name
xsc = float(lst[11].split(', ')[0]) # X scale factor
ysc = float(lst[11].split(', ')[1]) # Y scale factor
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
ucsCY,ucsCX,ucsP,ucsSP = ( tm.wcs2ucsP(cy), tm.wcs2ucsP(cx), tm.wcs2ucsP(p), tm.wcs2ucsP(sp) )
pline( (ucsCX,ucsP,ucsCY,ucsSP) )
zDir,ucsA = rotationAngle(ucsCX, ucsCY, ucsP, ocsA)
# print ';angles, deg.: ucs [%s], ocs [%s]. Zdir [%s]' % (math.degrees(ucsA), math.degrees(ocsA), zDir)
test(block(ucsP, nm, xsc*zDir, ysc, math.degrees(normAngle2pi(ucsA))), paragon)
print
#~ .\data\dwg.dump\+01+02.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+02 AcDbBlockReference 7 ЗД_БЕНЗОКОЛОНКИ_Т 2129542992 6BB2 00:"Запр. станции и бензоколонки";99:51220000 2722.1499999999996000, 1115.9400000000001000, 2822.1499999999996000, 1115.9400000000001000, 2822.1499999999996000, 1115.9400000000001000, 2722.1499999999996000, 1215.9400000000001000 0.0, 0.0 AZS 1.0, 1.0'
paragon = '(setq o (command "insert" "AZS" \'(1115.940000000000100 2722.149999999999600) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 В_ФОНТАН 2129569936 6CC2 00:"Фонтан питьевой";99:56045100 2639.8999999999996000, 1019.8100000000003000, 2739.8999999999996000, 1019.8100000000003000, 2739.8999999999996000, 1019.8100000000003000, 2639.8999999999996000, 1119.8100000000004000 0.0, 0.0 FOUNTAIN 1.0, 1.0'
paragon = '(setq o (command "insert" "FOUNTAIN" \'(1019.810000000000300 2639.899999999999600) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 КС_ФОНАРИ 2129004584 4555 00:"Фонари";99:56017200 2097.2999999999993000, 1831.8500000000004000, 2197.2999999999993000, 1831.8500000000004000, 2197.2999999999993000, 1831.8500000000004000, 2097.2999999999993000, 1931.8500000000004000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '(setq o (command "insert" "LANTERN" \'(1831.850000000000400 2097.299999999999300) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 ПР_РАЗНОЕ_МОЛНИЕОТВ 2129029704 52B9 00:"Молниеотвод";99:56017400 2381.6499999999996000, 1568.3400000000001000, 2481.6499999999996000, 1568.3400000000001000, 2481.6499999999996000, 1568.3400000000001000, 2381.6499999999996000, 1668.3400000000001000 0.0, 0.0 LIGHT 1.0, 1.0'
paragon = '(setq o (command "insert" "LIGHT" \'(1568.340000000000100 2381.649999999999600) -1.000 1.000 270.00000))'
testBlock(t, paragon,trans)
t = '+01+02 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2129003352 44CB 00:"Люки прочие";99:56067000;НН:207.27- 2021.0899999999999000, 1818.0000000000005000, 2121.0900000000001000, 1818.0000000000005000, 2121.0900000000001000, 1818.0000000000005000, 2021.0899999999999000, 1918.0000000000005000 0.0, 0.0 LP 1.0, 1.0'
paragon = '(setq o (command "insert" "LP" \'(1818.000000000000500 2021.089999999999900) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 ТФ_ТАКСОФОН 2129024832 5080 00:"Таксофон";99:56023200 2080.5999999999995000, 1529.2500000000005000, 2180.5999999999995000, 1529.2500000000005000, 2180.5999999999995000, 1529.2500000000005000, 2080.5999999999995000, 1629.2500000000005000 0.0, 0.0 PHONE 1.0, 1.0'
paragon = '(setq o (command "insert" "PHONE" \'(1529.250000000000500 2080.599999999999500) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 ТС_КОЛОДЕЦ 2129005712 45DA 00:"Смотровой колодец";99:55141000;НН:202.29- 2000.1499999999999000, 1751.1100000000001000, 2100.1499999999996000, 1751.1100000000001000, 2100.1499999999996000, 1751.1100000000001000, 2000.1499999999999000, 1851.1100000000001000 0.0, 0.0 WELLTS 1.0, 1.0'
paragon = '(setq o (command "insert" "WELLTS" \'(1751.110000000000100 2000.149999999999900) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 ГАЗ_ЗАГЛУШКА 2129061760 5DA8 00:"Заглушка";99:56034000 2195.1799999999994000, 1402.9100000000003000, 2295.1799999999994000, 1402.9100000000003000, 2295.1799999999994000, 1402.9100000000003000, 2195.1799999999994000, 1502.9100000000003000 0.0, 0.0 ZAGL 1.0, 1.0'
paragon = '(setq o (command "insert" "ZAGL" \'(1402.910000000000300 2195.179999999999400) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 ЗД_ОБЪЕКТ 2129006664 4649 00:"Объект";99:44150000;A3:вент. 2017.2099999999998000, 1805.9900000000002000, 2117.2100000000000000, 1805.9900000000002000, 2117.2100000000000000, 1805.9900000000002000, 2017.2099999999998000, 1905.9900000000002000 0.0, 0.0 OBJECT 1.0, 1.0'
paragon = '(setq o (command "insert" "OBJECT" \'(1805.990000000000200 2017.209999999999800) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+02 AcDbBlockReference 7 В_ГИДРАНТ 2129477944 7907 00:Гидрант;99:56046000 2888.6357668968549000, 1008.7086200698827000, 2988.4867149324468000, 1003.2507655103074000, 2988.6357668968549000, 1008.7086200698827000, 2888.6357668968549000, 1108.7086200698827000 6.22857962861, 6.22857962861 HIDRANT 2.0, 2.0'
paragon = '(setq o (command "insert" "HIDRANT" \'(1008.708620069882700 2888.635766896854900) -2.000 2.000 273.12867))'
testBlock(t, paragon, trans)
#~ .\data\dwg.dump\+01+03.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+03 AcDbBlockReference 7 В_ГИДРАНТ 2124665920 1BC0 3129.5610861052091000, 1528.4911634508862000, 3223.8790209230019000, 1495.2627543450226000, 3029.5610861052091000, 1528.4911634508862000, 3129.5610861052091000, 1628.4911634508862000 3.48031689218, 5.94446106859 HIDRANT 2.0, 2.0'
paragon = '(setq o (command "insert" "HIDRANT" \'(1528.491163450886200 3129.561086105209100) 2.000 2.000 109.40747))'
testBlock(t, paragon, trans) #~ углы должны быть (приблизительно): WCS 160,OCS 199,UCS 109
t = '+01+03 AcDbBlockReference 7 В_ГИДРАНТ 2124621632 1E00 3404.3549905733530000, 1842.0239330218847000, 3304.8659553801763000, 1831.9278012710190000, 3304.3549905733530000, 1842.0239330218847000, 3404.3549905733530000, 1942.0239330218847000 6.18205167851, 3.24272628226 HIDRANT 2.0, 2.0'
paragon = '(setq o (command "insert" "HIDRANT" \'(1842.023933021884700 3404.354990573353000) 2.000 2.000 264.20547))'
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 В_ФОНТАН 2124920880 796 00:"Фонтан питьевой";99:56045100 3744.3099999999995000, 1860.9000000000005000, 3844.3099999999995000, 1860.9000000000005000, 3844.3099999999995000, 1860.9000000000005000, 3744.3099999999995000, 1960.9000000000005000 0.0, 0.0 FOUNTAIN 1.0, 1.0'
paragon = '(setq o (command "insert" "FOUNTAIN" \'(1860.900000000000500 3744.309999999999500) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 В_КОЛОНКА 2124564136 166D 00:"Колонка водопроводная";99:56045000 3120.8758234395259000, 1237.9213216393466000, 3093.8205837979012000, 1141.6507965138740000, 3220.8758234395259000, 1237.9213216393466000, 3120.8758234395259000, 1337.9213216393466000 4.43842219915, 4.43842219915 KOLVP 2.0, 2.0'
paragon = '(setq o (command "insert" "KOLVP" \'(1237.921321639346600 3120.875823439525900) -2.000 2.000 15.69714))'
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 В_КОЛОНКА 2125191752 1319 00:"Колонка водопроводная";99:56045000 3772.2299999999996000, 1436.5900000000006000, 3872.2299999999996000, 1436.5900000000006000, 3872.2299999999996000, 1436.5900000000006000, 3772.2299999999996000, 1536.5900000000006000 0.0, 0.0 KOLVP 2.0, 2.0'
paragon = '(setq o (command "insert" "KOLVP" \'(1436.590000000000600 3772.229999999999600) -2.000 2.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2124565000 16D1 00:"Люки прочие";99:56067000;НН:206.25-204.61 3224.1800000000003000, 1001.6000000000005000, 3324.1800000000003000, 1001.6000000000005000, 3324.1800000000003000, 1001.6000000000005000, 3224.1800000000003000, 1101.6000000000004000 0.0, 0.0 LP 1.0, 1.0'
paragon = '(setq o (command "insert" "LP" \'(1001.600000000000500 3224.180000000000300) -1.000 1.000 270.00000))'
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2124745432 114B 00:"Люки прочие";99:56067000;НН:211.64-211.19 3226.9099999999999000, 1406.3500000000008000, 3326.9099999999999000, 1406.3500000000008000, 3326.9099999999999000, 1406.3500000000008000, 3226.9099999999999000, 1506.3500000000008000 0.0, 0.0 LP 1.0, 1.0'
paragon = '''(setq o (command "insert" "LP" '(1406.350000000000800 3226.909999999999900) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 ТФ_ТРУБОКАБЕЛЕУКАЗАТЕЛЬ 2125191520 12FC 00:"Трубокабелеуказатель";99:56025000 3760.1400000000003000, 1452.6000000000008000, 3860.1400000000003000, 1452.6000000000008000, 3860.1400000000003000, 1452.6000000000008000, 3760.1400000000003000, 1552.6000000000008000 0.0, 0.0 TKU 1.0, 1.0'
paragon = '''(setq o (command "insert" "TKU" '(1452.600000000000800 3760.140000000000300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 ПР_РАЗНОЕ_СВЕТОФОРЫ 2124565096 16DD 00:"Семафоры и светофоры";99:62143000 3010.7200000000003000, 1118.3000000000006000, 3110.7200000000003000, 1118.3000000000006000, 3110.7200000000003000, 1118.3000000000006000, 3010.7200000000003000, 1218.3000000000006000 0.0, 0.0 SEMAPHORE 1.0, 1.0'
paragon = '''(setq o (command "insert" "SEMAPHORE" '(1118.300000000000600 3010.720000000000300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 ТФ_ТАКСОФОН 2124911984 1826 00:"Таксофон";99:56023200 3254.7600000000002000, 1220.1800000000007000, 3354.7600000000002000, 1220.1800000000007000, 3354.7600000000002000, 1220.1800000000007000, 3254.7600000000002000, 1320.1800000000007000 0.0, 0.0 PHONE 1.0, 1.0'
paragon = '''(setq o (command "insert" "PHONE" '(1220.180000000000700 3254.760000000000200) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 КС_ФОНАРИ 2124742776 100F 00:"Фонари";99:56017200 3206.5000000000000000, 1430.8100000000009000, 3306.5000000000000000, 1430.8100000000009000, 3306.5000000000000000, 1430.8100000000009000, 3206.5000000000000000, 1530.8100000000009000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(1430.810000000000900 3206.500000000000000) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+03 AcDbBlockReference 7 КС_ФОНАРИ 2125200136 611 00:"Фонари";99:56017200 3494.0600000000004000, 1901.5600000000009000, 3594.0600000000004000, 1901.5600000000009000, 3594.0600000000004000, 1901.5600000000009000, 3494.0600000000004000, 2001.5600000000009000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(1901.560000000000900 3494.060000000000400) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
#~ .\data\dwg.dump\+01+04.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+04 AcDbBlockReference 7 В_ГИДРАНТ 2119865976 2CE7 00:Гидрант;99:56046000 4224.1117928160320000, 1453.9448657725547000, 4220.4769162715320000, 1553.8787822999593000, 4324.1117928160320000, 1453.9448657725547000, 4224.1117928160320000, 1553.9448657725547000 1.6071531012, 1.6071531012 HIDRANT 2.0, 2.0'
paragon = '''(setq o (command "insert" "HIDRANT" '(1453.944865772554700 4224.111792816032000) -2.000 2.000 177.91691))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 В_ГИДРАНТ 2120030928 204A 00:Гидрант;99:56046000 4785.8334479999994000, 1770.9057500000006000, 4885.1849373506402000, 1759.5355449090862000, 4885.8334479999994000, 1770.9057500000006000, 4785.8334479999994000, 1870.9057500000006000 6.16923682693, 6.16923682693 HIDRANT 2.0, 2.0'
paragon = '''(setq o (command "insert" "HIDRANT" '(1770.905750000000600 4785.833447999999400) -2.000 2.000 276.52877))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ЗД_БЕНЗОКОЛОНКИ_Т 2120049912 1817 00:"Запр. станции и бензоколонки";99:51220000 4808.8600000000006000, 1313.5000000000007000, 4908.8600000000006000, 1313.5000000000007000, 4908.8600000000006000, 1313.5000000000007000, 4808.8600000000006000, 1413.5000000000007000 0.0, 0.0 AZS 1.0, 1.0'
paragon = '''(setq o (command "insert" "AZS" '(1313.500000000000700 4808.860000000000600) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 В_ФОНТАН 2120075176 96D 00:"Фонтан питьевой";99:56045100 4050.5600000000004000, 1735.8100000000006000, 4150.5600000000004000, 1735.8100000000006000, 4150.5600000000004000, 1735.8100000000006000, 4050.5600000000004000, 1835.8100000000006000 0.0, 0.0 FOUNTAIN 1.0, 1.0'
paragon = '''(setq o (command "insert" "FOUNTAIN" '(1735.810000000000600 4050.560000000000400) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 В_КОЛОНКА 2120069600 E5C 00:"Колонка водопроводная";99:56045000 4961.6764999999996000, 1708.2034780000006000, 5016.5505064504623000, 1624.6041752751896000, 5061.6764999999996000, 1708.2034780000006000, 4961.6764999999996000, 1808.2034780000006000 5.29324535904, 5.29324535904 KOLVP 2.0, 2.0'
paragon = '''(setq o (command "insert" "KOLVP" '(1708.203478000000600 4961.676499999999600) -2.000 2.000 326.71938))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 В_КОЛОНКА 2120069608 E5D 00:"Колонка водопроводная";99:56045000 4755.2000000000007000, 1539.0100000000004000, 4855.2000000000007000, 1539.0100000000004000, 4855.2000000000007000, 1539.0100000000004000, 4755.2000000000007000, 1639.0100000000004000 0.0, 0.0 KOLVP 2.0, 2.0'
paragon = '''(setq o (command "insert" "KOLVP" '(1539.010000000000400 4755.200000000000700) -2.000 2.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 КС_ФОНАРИ 2120086840 37F 00:"Фонари";99:56017200 4117.1099999999997000, 1804.2300000000007000, 4217.1099999999997000, 1804.2300000000007000, 4217.1099999999997000, 1804.2300000000007000, 4117.1099999999997000, 1904.2300000000007000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(1804.230000000000700 4117.109999999999700) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2120070728 EE1 00:"Люки прочие";99:56067000;НН:216.50- 4911.2900000000009000, 1631.5400000000006000, 5011.2900000000009000, 1631.5400000000006000, 5011.2900000000009000, 1631.5400000000006000, 4911.2900000000009000, 1731.5400000000006000 0.0, 0.0 LP 1.0, 1.0'
paragon = '''(setq o (command "insert" "LP" '(1631.540000000000600 4911.290000000000900) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ТФ_ШКАФ 2120058416 147E 00:"Телефонный шкаф";99:56024100 4622.4400000000005000, 1440.5100000000004000, 4722.4400000000005000, 1440.5100000000004000, 4722.4400000000005000, 1440.5100000000004000, 4622.4400000000005000, 1540.5100000000004000 0.0, 0.0 PHONESH 1.0, 1.0'
paragon = '''(setq o (command "insert" "PHONESH" '(1440.510000000000400 4622.440000000000500) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ПР_РАЗНОЕ_СВЕТОФОРЫ 2120084048 B9A 00:"Семафоры и светофоры";99:62143000 4598.9699999999993000, 1729.2800000000009000, 4698.9699999999993000, 1729.2800000000009000, 4698.9699999999993000, 1729.2800000000009000, 4598.9699999999993000, 1829.2800000000009000 0.0, 0.0 SEMAPHORE 1.0, 1.0'
paragon = '''(setq o (command "insert" "SEMAPHORE" '(1729.280000000000900 4598.969999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 КС_ЩИТ 2120075776 9B0 00:"Щит";99:56018400 4480.2199999999993000, 1648.7200000000005000, 4580.2199999999993000, 1648.7200000000005000, 4580.2199999999993000, 1648.7200000000005000, 4480.2199999999993000, 1748.7200000000005000 0.0, 0.0 SHIELD 1.0, 1.0'
paragon = '''(setq o (command "insert" "SHIELD" '(1648.720000000000500 4480.219999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ТФ_ТРУБОКАБЕЛЕУКАЗАТЕЛЬ 2119978392 1EBB 00:"Трубокабелеуказатель";99:56025000 4986.9899999999998000, 1126.4500000000005000, 5086.9899999999998000, 1126.4500000000005000, 5086.9899999999998000, 1126.4500000000005000, 4986.9899999999998000, 1226.4500000000005000 0.0, 0.0 TKU 1.0, 1.0'
paragon = '''(setq o (command "insert" "TKU" '(1126.450000000000500 4986.989999999999800) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ТФ_КОЛОДЕЦ 2120056616 68D 00:"Телефонный колодец";99:56023000;НН:213.91\213.11 4633.3600000000006000, 1773.5700000000008000, 4733.3600000000006000, 1773.5700000000008000, 4733.3600000000006000, 1773.5700000000008000, 4633.3600000000006000, 1873.5700000000008000 0.0, 0.0 WELLPH 1.0, 1.0'
paragon = '''(setq o (command "insert" "WELLPH" '(1773.570000000000800 4633.360000000000600) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+01+04 AcDbBlockReference 7 ТС_КОЛОДЕЦ 2120054808 5B3 00:"Смотровой колодец";99:55141000;НН:214.55\ 4660.9400000000005000, 1829.4200000000008000, 4760.9400000000005000, 1829.4200000000008000, 4760.9400000000005000, 1829.4200000000008000, 4660.9400000000005000, 1929.4200000000008000 0.0, 0.0 WELLTS 1.0, 1.0'
paragon = '''(setq o (command "insert" "WELLTS" '(1829.420000000000800 4660.940000000000500) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
#~ .\data\dwg.dump\+02+02.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+02 AcDbBlockReference 7 ПР_ГЕО_ПУНКТЫ 2124564296 B119 00:"Пункты ГГС";09:Пушкинская;99:11200000 2988.1499999999992000, 2160.7400000000002000, 3088.1499999999992000, 2160.7400000000002000, 3088.1499999999992000, 2160.7400000000002000, 2988.1499999999992000, 2260.7400000000002000 0.0, 0.0 GGS_POINT 1.0, 1.0'
paragon = '''(setq o (command "insert" "GGS_POINT" '(2160.740000000000200 2988.149999999999200) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 БРОШЕННЫЕ_СЕТИ 2124514144 9C04 00:"Колонка водопроводная";99:56045000 2782.1724959999997000, 2703.6661180000006000, 2702.7303332449324000, 2764.4027854818223000, 2882.1724959999997000, 2703.6661180000006000, 2782.1724959999997000, 2803.6661180000006000 2.48885104997, 2.48885104997 KOLVP 2.0, 2.0'
paragon = '''(setq o (command "insert" "KOLVP" '(2703.666118000000600 2782.172495999999700) -2.000 2.000 127.39934))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 КС_ФОНАРИ 2124475784 8A71 00:"Фонари";99:56017200 2023.5599999999995000, 2993.1900000000001000, 2123.5599999999995000, 2993.1900000000001000, 2123.5599999999995000, 2993.1900000000001000, 2023.5599999999995000, 3093.1900000000001000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(2993.190000000000100 2023.559999999999500) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2124494744 9323 00:"Люки прочие";99:56067000;НН:226.46\225.49 2855.7899999999995000, 2963.4100000000003000, 2955.7899999999995000, 2963.4100000000003000, 2955.7899999999995000, 2963.4100000000003000, 2855.7899999999995000, 3063.4100000000003000 0.0, 0.0 LP 1.0, 1.0'
paragon = '''(setq o (command "insert" "LP" '(2963.410000000000300 2855.789999999999500) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 ПР_МЕТРО_СТАНЦИИ 2124569656 B387 00:"Станции метрополитена";09:Академия наук;99:62132000 2792.6899999999991000, 2073.4500000000003000, 2892.6899999999991000, 2073.4500000000003000, 2892.6899999999991000, 2073.4500000000003000, 2792.6899999999991000, 2173.4500000000003000 0.0, 0.0 METRO 1.0, 1.0'
paragon = '''(setq o (command "insert" "METRO" '(2073.450000000000300 2792.689999999999100) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 ПР_РАЗНОЕ_СВЕТОФОРЫ 2124508344 9957 00:"Семафоры и светофоры";99:62143000 2571.5799999999995000, 2525.8400000000006000, 2671.5799999999995000, 2525.8400000000006000, 2671.5799999999995000, 2525.8400000000006000, 2571.5799999999995000, 2625.8400000000006000 0.0, 0.0 SEMAPHORE 1.0, 1.0'
paragon = '''(setq o (command "insert" "SEMAPHORE" '(2525.840000000000600 2571.579999999999500) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 КС_ЩИТ 2124547600 A972 00:"Щит";99:56018400 2240.6399999999999000, 2064.7000000000003000, 2340.6399999999999000, 2064.7000000000003000, 2340.6399999999999000, 2064.7000000000003000, 2240.6399999999999000, 2164.7000000000003000 0.0, 0.0 SHIELD 1.0, 1.0'
paragon = '''(setq o (command "insert" "SHIELD" '(2064.700000000000300 2240.639999999999900) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 ТФ_ТРУБОКАБЕЛЕУКАЗАТЕЛЬ 2124476824 8AEB 00:"Трубокабелеуказатель";99:56025000 2149.6799999999998000, 2755.7800000000002000, 2249.6799999999998000, 2755.7800000000002000, 2249.6799999999998000, 2755.7800000000002000, 2149.6799999999998000, 2855.7800000000002000 0.0, 0.0 TKU 1.0, 1.0'
paragon = '''(setq o (command "insert" "TKU" '(2755.780000000000200 2149.679999999999800) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 ТС_КОЛОДЕЦ 2124559008 AEAC 00:"Смотровой колодец";99:55141000;НН:211.57\ 2686.4599999999996000, 2211.4600000000005000, 2786.4599999999996000, 2211.4600000000005000, 2786.4599999999996000, 2211.4600000000005000, 2686.4599999999996000, 2311.4600000000005000 0.0, 0.0 WELLTS 1.0, 1.0'
paragon = '''(setq o (command "insert" "WELLTS" '(2211.460000000000500 2686.459999999999600) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 В_ГИДРАНТ 2124576456 B6A9 00:Гидрант;99:56046000 2919.3699459999993000, 2728.9372980000003000, 3006.1981378201021000, 2778.5444054066152000, 3019.3699459999993000, 2728.9372980000003000, 2919.3699459999993000, 2828.9372980000003000 0.51906795322, 0.51906795322 HIDRANT 2.0, 2.0'
paragon = '''(setq o (command "insert" "HIDRANT" '(2728.937298000000300 2919.369945999999300) -2.000 2.000 240.25960))'''
testBlock(t, paragon, trans)
t = '+02+02 AcDbBlockReference 7 В_ГИДРАНТ 2124584320 B860 00:Гидрант;99:56046000 2270.5507819999998000, 2028.4030820000003000, 2354.0521483909761000, 1973.3801612229283000, 2370.5507819999998000, 2028.4030820000003000, 2270.5507819999998000, 2128.4030820000003000 5.7005465983, 5.7005465983 HIDRANT 2.0, 2.0'
paragon = '''(setq o (command "insert" "HIDRANT" '(2028.403082000000300 2270.550781999999800) -2.000 2.000 303.38274))'''
testBlock(t, paragon, trans)
#~ .\data\dwg.dump\+02+03.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+03 AcDbBlockReference 7 В_ФОНТАН 2117178384 2702 00:"Фонтан питьевой";99:56045100 3932.1899999999991000, 2127.7500000000005000, 4032.1899999999991000, 2127.7500000000005000, 4032.1899999999991000, 2127.7500000000005000, 3932.1899999999991000, 2227.7500000000005000 0.0, 0.0 FOUNTAIN 1.0, 1.0'
paragon = '''(setq o (command "insert" "FOUNTAIN" '(2127.750000000000500 3932.189999999999100) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 В_КОЛОНКА 2117204992 2610 00:"Колонка водопроводная";99:56045000 3747.9899999999993000, 2059.9500000000003000, 3847.9899999999993000, 2059.9500000000003000, 3847.9899999999993000, 2059.9500000000003000, 3747.9899999999993000, 2159.9500000000003000 0.0, 0.0 KOLVP 2.0, 2.0'
paragon = '''(setq o (command "insert" "KOLVP" '(2059.950000000000300 3747.989999999999300) -2.000 2.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 КС_ФОНАРИ 2117177960 26D5 00:"Фонари";99:56017200 3771.3099999999999000, 2085.4900000000002000, 3871.3099999999999000, 2085.4900000000002000, 3871.3099999999999000, 2085.4900000000002000, 3771.3099999999999000, 2185.4900000000002000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(2085.490000000000200 3771.309999999999900) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2120156904 185D 00:"Люки прочие";99:56067000;НН:219.36\218.99 3030.1099999999992000, 2253.1900000000001000, 3130.1099999999992000, 2253.1900000000001000, 3130.1099999999992000, 2253.1900000000001000, 3030.1099999999992000, 2353.1900000000001000 0.0, 0.0 LP 1.0, 1.0'
paragon = '''(setq o (command "insert" "LP" '(2253.190000000000100 3030.109999999999200) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 ПР_РАЗНОЕ_СВЕТОФОРЫ 2119559752 2221 00:"Семафоры и светофоры";99:62143000 3052.2399999999993000, 2126.3400000000006000, 3152.2399999999993000, 2126.3400000000006000, 3152.2399999999993000, 2126.3400000000006000, 3052.2399999999993000, 2226.3400000000006000 0.0, 0.0 SEMAPHORE 1.0, 1.0'
paragon = '''(setq o (command "insert" "SEMAPHORE" '(2126.340000000000600 3052.239999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 КС_ЩИТ 2119459320 AA7 00:"Щит";99:56018400 3760.2599999999998000, 2837.1900000000001000, 3860.2599999999998000, 2837.1900000000001000, 3860.2599999999998000, 2837.1900000000001000, 3760.2599999999998000, 2937.1900000000001000 0.0, 0.0 SHIELD 1.0, 1.0'
paragon = '''(setq o (command "insert" "SHIELD" '(2837.190000000000100 3760.259999999999800) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 ТФ_ТРУБОКАБЕЛЕУКАЗАТЕЛЬ 2120156416 1820 00:"Трубокабелеуказатель";99:56025000 3035.1599999999994000, 2495.6800000000007000, 3135.1599999999994000, 2495.6800000000007000, 3135.1599999999994000, 2495.6800000000007000, 3035.1599999999994000, 2595.6800000000007000 0.0, 0.0 TKU 1.0, 1.0'
paragon = '''(setq o (command "insert" "TKU" '(2495.680000000000700 3035.159999999999400) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 УЛ_ПАМЯТНИКИ 2117177376 268C 00:"Выдающиеся памятники";99:53520000 3946.5299999999993000, 2038.9000000000005000, 4046.5299999999993000, 2038.9000000000005000, 4046.5299999999993000, 2038.9000000000005000, 3946.5299999999993000, 2138.9000000000005000 0.0, 0.0 VMONUMENT 1.0, 1.0'
paragon = '''(setq o (command "insert" "VMONUMENT" '(2038.900000000000500 3946.529999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 ТС_КОЛОДЕЦ 2119864760 22FF 00:"Смотровой колодец";99:55141000;НН:219.42\ 3378.0899999999997000, 2236.8900000000008000, 3478.0899999999997000, 2236.8900000000008000, 3478.0899999999997000, 2236.8900000000008000, 3378.0899999999997000, 2336.8900000000008000 0.0, 0.0 WELLTS 1.0, 1.0'
paragon = '''(setq o (command "insert" "WELLTS" '(2236.890000000000800 3378.089999999999700) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 В_ГИДРАНТ 2117260184 2ABB 3489.8890756119881000, 2803.8625408838143000, 3392.5516590439297000, 2826.7847426946414000, 3389.8890756119881000, 2803.8625408838143000, 3489.8890756119881000, 2903.8625408838143000 0.231278344611, 2.91031430898 ААА 1.0, 1.0'
paragon = '''(setq o (command "insert" "ААА" '(2803.862540883814300 3489.889075611988100) 1.000 1.000 283.25127))'''
testBlock(t, paragon, trans)
t = '+02+03 AcDbBlockReference 7 В_ГИДРАНТ 2117259768 2A87 3478.4704191893579000, 2870.3076443137957000, 3380.5692403699286000, 2849.9272815651557000, 3378.4704191893579000, 2870.3076443137957000, 3478.4704191893579000, 2970.3076443137957000 6.07794377624, 3.34683418453 ААА 1.0, 1.0'
paragon = '''(setq o (command "insert" "ААА" '(2870.307644313795700 3478.470419189357900) 1.000 1.000 258.24053))'''
testBlock(t, paragon, trans)
#~ .\data\dwg.dump\+02+04.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbBlockReference 7 В_ФОНТАН 2120676824 8F3 00:"Фонтан питьевой";99:56045100 4706.1099999999988000, 2816.4700000000003000, 4806.1099999999988000, 2816.4700000000003000, 4806.1099999999988000, 2816.4700000000003000, 4706.1099999999988000, 2916.4700000000003000 0.0, 0.0 FOUNTAIN 1.0, 1.0'
paragon = '''(setq o (command "insert" "FOUNTAIN" '(2816.470000000000300 4706.109999999998800) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 БРОШЕННЫЕ_СЕТИ 2120722008 1BC3 00:"Колонка водопроводная";99:56045000 4925.7199999999993000, 2467.2200000000003000, 5025.7199999999993000, 2467.2200000000003000, 5025.7199999999993000, 2467.2200000000003000, 4925.7199999999993000, 2567.2200000000003000 0.0, 0.0 KOLVP 1.0, 1.0'
paragon = '''(setq o (command "insert" "KOLVP" '(2467.220000000000300 4925.719999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 КС_ФОНАРИ 2120793224 2039 00:"Фонари";99:56017200 4945.9399999999987000, 2156.5600000000004000, 5045.9399999999987000, 2156.5600000000004000, 5045.9399999999987000, 2156.5600000000004000, 4945.9399999999987000, 2256.5600000000004000 0.0, 0.0 LANTERN 1.0, 1.0'
paragon = '''(setq o (command "insert" "LANTERN" '(2156.560000000000400 4945.939999999998700) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 ПР_РАЗНОЕ_ЛЮКИ 2120785968 C06 00:"Люки прочие";99:56067000;НН:215.50 4984.2500000000000000, 2922.0900000000001000, 5084.2500000000000000, 2922.0900000000001000, 5084.2500000000000000, 2922.0900000000001000, 4984.2500000000000000, 3022.0900000000001000 0.0, 0.0 LP 1.0, 1.0'
paragon = '''(setq o (command "insert" "LP" '(2922.090000000000100 4984.250000000000000) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 ПР_МЕТРО_СТАНЦИИ 2120786016 C0C 00:"Станции метрополитена";99:62132000 4893.8999999999996000, 2779.2100000000000000, 4993.8999999999996000, 2779.2100000000000000, 4993.8999999999996000, 2779.2100000000000000, 4893.8999999999996000, 2879.2100000000000000 0.0, 0.0 METRO 1.0, 1.0'
paragon = '''(setq o (command "insert" "METRO" '(2779.210000000000000 4893.899999999999600) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 ПР_РАЗНОЕ_СВЕТОФОРЫ 2120724912 13B6 00:"Семафоры и светофоры";99:62143000 4712.3799999999992000, 2742.9100000000008000, 4812.3799999999992000, 2742.9100000000008000, 4812.3799999999992000, 2742.9100000000008000, 4712.3799999999992000, 2842.9100000000008000 0.0, 0.0 SEMAPHORE 1.0, 1.0'
paragon = '''(setq o (command "insert" "SEMAPHORE" '(2742.910000000000800 4712.379999999999200) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 ТФ_ТРУБОКАБЕЛЕУКАЗАТЕЛЬ 2120334784 440 00:"Трубокабелеуказатель";99:56025000 4017.3499999999999000, 2969.9000000000005000, 4117.3500000000004000, 2969.9000000000005000, 4117.3500000000004000, 2969.9000000000005000, 4017.3499999999999000, 3069.9000000000005000 0.0, 0.0 TKU 1.0, 1.0'
paragon = '''(setq o (command "insert" "TKU" '(2969.900000000000500 4017.349999999999900) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 ТС_КОЛОДЕЦ 2120333520 3AA 00:"Смотровой колодец";99:55141000;НН:223.68\ 4130.5499999999993000, 2896.1400000000003000, 4230.5499999999993000, 2896.1400000000003000, 4230.5499999999993000, 2896.1400000000003000, 4130.5499999999993000, 2996.1400000000003000 0.0, 0.0 WELLTS 1.0, 1.0'
paragon = '''(setq o (command "insert" "WELLTS" '(2896.140000000000300 4130.549999999999300) -1.000 1.000 270.00000))'''
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 В_ГИДРАНТ 2120799728 2336 4213.0339729591606000, 2716.6180976937721000, 4124.0661528319670000, 2762.2769082544432000, 4113.0339729591606000, 2716.6180976937721000, 4213.0339729591606000, 2816.6180976937721000 0.474156431937, 2.66743622165 ААА 1.0, 1.0'
paragon = '(setq o (command "insert" "ААА" \'(2716.618097693772100 4213.033972959160600) 1.000 1.000 297.16716))'
testBlock(t, paragon, trans)
t = '+02+04 AcDbBlockReference 7 В_ГИДРАНТ 2120799464 2315 4089.9492850422043000, 2484.1434517543498000, 4005.8697106837690000, 2430.0082028336665000, 3989.9492850422043000, 2484.1434517543498000, 4089.9492850422043000, 2584.1434517543498000 5.71114044686, 3.71363751391 ААА 1.0, 1.0'
paragon = '''(setq o (command "insert" "ААА" '(2484.143451754349800 4089.949285042204300) 1.000 1.000 237.22424))'''
testBlock(t, paragon, trans)
return ecOK
#def testBlockReference
def testCircle():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, unzipBulge2
def circle(c, rad):
''' (setq o (command "circle" '(2000.000000000001100 5000.000000000000000) 50 ))
'''
res = '''(setq o (command "circle" '(%0.15f %0.15f) %0.15f ))''' % (
c[0], c[1], rad)
print res
return res
def circleEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list
radius = float(lst[11])
bulge,x,y = parsePoint(lp)
c = tm.wcs2ucsP((x,y))
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
test(circle(c, radius), paragon)
print
#~ .\data\dwg.dump\+02+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbCircle 8 В_КОЛОДЕЦ 2128192792 26DB 4234.8723382428707000, 2545.6443423411306000 1.23643565775'
paragon = '''(setq o (command "circle" '(2545.644342341130600 4234.872338242870700) 1.236435657750000 ))'''
circleEntity(t, paragon, trans)
t = '+02+04 AcDbCircle 8 В_ТЕКСТ_УЗЛЫ 2128220176 2462 5066.8309759369076000, 2750.9952895870733000 14.8771425258'
paragon = '''(setq o (command "circle" '(2750.995289587073300 5066.830975936907600) 14.877142525800000 ))'''
circleEntity(t, paragon, trans)
return ecOK
#def testCircle():
def testArc():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign, detectArcStartEnd
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, unzipBulge2, getArcBulge
def arcEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list (c, s, e, m)
plen = len(lp)
points = []
pts = []
for n,e in zip(range(plen), lp):
if n%2 == 0: # 0, 2, 4,...
points.append( (e, lp[n+1]) )
for n,p in zip(range(len(points)), points):
bulge,x,y = parsePoint(p)
p = tm.wcs2ucsP((x,y))
pts.append(p)
c, s, e, m = pts
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
test(pline( res['points'] ), paragon)
print
#~ .\data\dwg.dump\+02+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbArc 4 В_ТЕКСТ_УЗЛЫ 2128220832 24B4 5061.7378255128042000, 2638.9920103622517000, 5061.4835404392416000, 2636.6080312971353000, 5061.4835404392416000, 2641.3759894273680000, 5059.3403232538794000, 2638.9920103622517000 4.81865134371, 1.46453396347 2.39750225893'
paragon = '''(setq o (command "pline" '(2636.608031297135300 5061.483540439241600) '(2636.702678206477200 5061.025803489206700) '(2636.884342242179600 5060.595130375340900) '(2637.146118385103800 5060.207890909544400) '(2637.478056568524600 5059.878803998133700) '(2637.867539878474900 5059.620378178709900) '(2638.299764120503800 5059.442436172771500) '(2638.758300524592400 5059.351741525738400) '(2639.225720199910900 5059.351741525738400) '(2639.684256603999500 5059.442436172771500) '(2640.116480846028500 5059.620378178709900) '(2640.505964155978700 5059.878803998133700) '(2640.837902339399500 5060.207890909544400) '(2641.099678482323700 5060.595130375340900) '(2641.281342518026100 5061.025803489206700) '(2641.375989427368000 5061.483540439241600) ))'''
arcEntity(t, paragon, trans)
t = '+02+04 AcDbArc 4 В_ТЕКСТ_УЗЛЫ 2128497992 2411 5068.3296667864270000, 2891.7626858982708000, 5070.3827230988572000, 2890.7619137075217000, 5069.6108480378180000, 2889.8718766004117000, 5070.0551599176815000, 2890.2662706304459000 3.5951538428, 4.11686657509 2.28398450078'
paragon = '''(setq o (command "pline" '(2890.761913707521700 5070.382723098857200) '(2890.421770318846000 5070.178593666712000) '(2890.122077719760500 5069.918688499427800) '(2889.871876600411700 5069.610848037818000) ))'''
arcEntity(t, paragon, trans)
return ecOK
#def testArc():
def testPoint():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, unzipBulge2
def point(p):
res = '''(setq o (command "point" '(%0.15f %0.15f) ))''' % (p[0], p[1])
print res
return res
def pointEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
x,y = lst[7].split(', ') # coords list
p = tm.wcs2ucsP((float(x), float(y)))
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
test(point( p ), paragon)
print
#~ .\data\dwg.dump\+02+03.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+03 AcDbPoint 22 К_ХОЗФЕК 2107609632 35CC 00:Канализация хф;99:56061000;A3:;ДМ:150;МТ: 3518.3800000000001000, 2941.6999999999998000'
paragon = '''(setq o (command "point" '(2941.699999999999800 3518.380000000000100) ))'''
pointEntity(t, paragon, trans)
return ecOK
#def testPoint():
def testLine():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, unzipBulge2
def lineEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list
plen = len(lp)
points = []
pts = []
for n,e in zip(range(plen), lp):
if n%2 == 0: # 0, 2, 4,...
points.append( (e, lp[n+1]) )
for n,p in zip(range(len(points)), points):
bulge,x,y = parsePoint(p)
s = tm.wcs2ucsP((x,y))
pts.append(s)
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
test(pline( pts ), paragon)
print
#~ .\data\dwg.dump\+02+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbLine 19 0 2128495496 22F1 3999.9999999999991000, 3000.0000000000009000, 3999.9999999999995000, 2000.0000000000007000'
paragon = '''(setq o (command "pline" '(3000.000000000000900 3999.999999999999100) '(2000.000000000000700 3999.999999999999500) ))'''
lineEntity(t, paragon, trans)
t = '+02+04 AcDbLine 19 0 2128495480 22EF 5000.0000000000000000, 2000.0000000000011000, 4999.9999999999991000, 3000.0000000000009000'
paragon = '''(setq o (command "pline" '(2000.000000000001100 5000.000000000000000) '(3000.000000000000900 4999.999999999999100) ))'''
lineEntity(t, paragon, trans)
return ecOK
#def testLine():
def testPolylineLight():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle, unzipBulge2
def polylineEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list
closed = lst[10] # closed
plen = len(lp)
points = []
pts = []
for n,e in zip(range(plen), lp):
if n%2 == 0: # 0, 2, 4,...
points.append( (e, lp[n+1]) )
for n,p in zip(range(len(points)), points):
bulge,x,y = parsePoint(p)
# print 'parsePoint: bulge [%s], x [%s], y [%s]' % (bulge,x,y)
s = tm.wcs2ucsP((x,y))
if bulge:
bulge = float(bulge) * tm.getUCSBulgeSign()
p = points[n+1]
bulge2,x2,y2 = parsePoint(p)
e = tm.wcs2ucsP((x2,y2))
res = unzipBulge2(s, e, bulge, 0)
pts = pts + res['points'][:-1]
else:
pts.append(s)
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
test(pline( pts ), paragon)
print
#~ .\data\dwg.dump\+02+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbPolyline 24 В_ТЕКСТ_УЗЛЫ 2128498272 2434 (bulge -0.40485) 5167.6677942053193000, 2925.3907451592981000, (bulge -0.40485) 5168.5389312196739000, 2924.4912080961035000, 5167.6677942053193000, 2923.5916710329097000 False'
paragon = '''(setq o (command "pline" '(2925.390745159298100 5167.667794205319300) '(2925.368640046310200 5167.839214224406500) '(2925.314174515999200 5168.003247650792200) '(2925.229357303057400 5168.153844793370800) '(2925.117316537830900 5168.285451502513800) '(2924.982184378233300 5168.393214011795000) '(2924.828944612277600 5168.473157948987100) '(2924.663248851770300 5168.522334914264300) '(2924.491208096103500 5168.538931219673900) '(2924.319167340435800 5168.522334914265200) '(2924.153471579928900 5168.473157948987100) '(2924.000231813973200 5168.393214011795000) '(2923.865099654376100 5168.285451502513800) '(2923.753058889150000 5168.153844793370800) '(2923.668241676208700 5168.003247650792200) '(2923.613776145897600 5167.839214224406500) '(2923.591671032909700 5167.667794205319300) ))'''
polylineEntity(t, paragon, trans)
t = '+02+04 AcDbPolyline 24 В_1_СЕТЬ 2128358744 1AB3 00:"Водопровод";99:56041000;ДМ:1000;МТ:ЖБ 4750.0000000000000000, 2448.9900000000007000, 4767.2099999999991000, 2440.0500000000002000, 4780.8099999999995000, 2432.7600000000002000, 4792.1599999999999000, 2426.8100000000004000, 4801.9899999999998000, 2421.2500000000009000, 4808.6999999999989000, 2416.5700000000006000, 4813.0599999999995000, 2413.6900000000005000, 4814.5000000000000000, 2412.5100000000002000, 4815.7099999999991000, 2411.6000000000004000, 4824.9099999999999000, 2403.5000000000009000, 4826.9099999999999000, 2401.6500000000005000, 4827.4599999999991000, 2401.1400000000003000, 4828.5000000000000000, 2400.2500000000009000, 4829.8899999999994000, 2399.4400000000005000, 4836.3299999999999000, 2395.0000000000009000, 4845.1499999999996000, 2388.8900000000003000, 4848.5599999999995000, 2386.2100000000000000, 4854.1199999999990000, 2381.8400000000001000, 4859.5799999999999000, 2377.3300000000008000, 4861.7399999999998000, 2375.7600000000002000, 4863.0299999999988000, 2375.0000000000009000, 4871.6499999999996000, 2380.1200000000008000, 4886.5899999999983000, 2388.8900000000003000, 4898.5000000000000000, 2395.9100000000008000, 4915.2999999999993000, 2405.2600000000002000, 4930.8999999999996000, 2413.8800000000001000, 4950.1599999999999000, 2425.4700000000003000, 4965.1799999999985000, 2434.6500000000005000, 4973.7500000000000000, 2439.8600000000006000, 4983.0499999999993000, 2445.5300000000007000, 4989.8499999999985000, 2449.2000000000007000, 4996.1099999999988000, 2452.3000000000002000, 5000.0000000000000000, 2454.0900000000001000 False'
paragon = '''(setq o (command "pline" '(2448.990000000000700 4750.000000000000000) '(2440.050000000000200 4767.209999999999100) '(2432.760000000000200 4780.809999999999500) '(2426.810000000000400 4792.159999999999900) '(2421.250000000000900 4801.989999999999800) '(2416.570000000000600 4808.699999999998900) '(2413.690000000000500 4813.059999999999500) '(2412.510000000000200 4814.500000000000000) '(2411.600000000000400 4815.709999999999100) '(2403.500000000000900 4824.909999999999900) '(2401.650000000000500 4826.909999999999900) '(2401.140000000000300 4827.459999999999100) '(2400.250000000000900 4828.500000000000000) '(2399.440000000000500 4829.889999999999400) '(2395.000000000000900 4836.329999999999900) '(2388.890000000000300 4845.149999999999600) '(2386.210000000000000 4848.559999999999500) '(2381.840000000000100 4854.119999999999000) '(2377.330000000000800 4859.579999999999900) '(2375.760000000000200 4861.739999999999800) '(2375.000000000000900 4863.029999999998800) '(2380.120000000000800 4871.649999999999600) '(2388.890000000000300 4886.589999999998300) '(2395.910000000000800 4898.500000000000000) '(2405.260000000000200 4915.299999999999300) '(2413.880000000000100 4930.899999999999600) '(2425.470000000000300 4950.159999999999900) '(2434.650000000000500 4965.179999999998500) '(2439.860000000000600 4973.750000000000000) '(2445.530000000000700 4983.049999999999300) '(2449.200000000000700 4989.849999999998500) '(2452.300000000000200 4996.109999999998800) '(2454.090000000000100 5000.000000000000000) ))'''
polylineEntity(t, paragon, trans)
t = '+02+04 AcDbPolyline 24 В_КАМЕРА_П 2109261720 CEB 00:"Камера водопровода";99:56043000 4086.8399999999997000, 2749.5900000000001000, 4087.3099999999999000, 2748.2100000000000000, 4089.4099999999994000, 2748.9000000000005000, 4088.8499999999999000, 2750.0000000000009000, 4088.3099999999999000, 2750.0000000000009000, 4086.8399999999997000, 2749.5900000000001000, 4086.8399999999997000, 2749.5900000000001000, 4086.8399999999997000, 2749.5900000000001000 True'
paragon = '''(setq o (command "pline" '(2749.590000000000100 4086.839999999999700) '(2748.210000000000000 4087.309999999999900) '(2748.900000000000500 4089.409999999999400) '(2750.000000000000900 4088.849999999999900) '(2750.000000000000900 4088.309999999999900) '(2749.590000000000100 4086.839999999999700) '(2749.590000000000100 4086.839999999999700) '(2749.590000000000100 4086.839999999999700) ))'''
polylineEntity(t, paragon, trans)
return ecOK
#def testPolylineLight():
def testText():
from trig import wcs2ucs, wcs2ucsP, AutoLISP, getUCSBulgeSign
from trig import Vwcs2ucs, normAngle2pi, rotationAngle
def text(insP, txt, angle, style, height, j=0, zdir=1, alP=(0,0,0)):
''' (setq o (command "text" "s" "romans" "j" "ml" '(1267.298512069065500 2005.375351909133300) 3 263.13584 "119ст"))
(setq o (command "mirror" "l" "" '(x y) '(x y) "y"))
'''
res = '(setq o (command "text" "s" "%s" \'(%0.15f %0.15f) %0.5f %0.5f "%s"))' % (
style, insP[0], insP[1], height, angle, txt)
if j == 1:
jstfy = 'c' # acAlignmentCenter = 1
insP = alP
res = '(setq o (command "text" "s" "%s" "j" "%s" \'(%0.15f %0.15f) %0.5f %0.5f "%s"))' % (
style, jstfy, insP[0], insP[1], height, angle, txt)
print res
if not zdir == 1: # set MIRRTEXT = 1, than mirror
mlP = AutoLISP.polarP(insP, normAngle2pi(math.radians(angle+90)), 50)
t = '''MIRRTEXT 1 (setq o (command "mirror" "l" "" '(%0.15f %0.15f) '(%0.15f %0.15f) "y"))''' % (
insP[0], insP[1], mlP[0], mlP[1])
print t
return res
def textEntity(dat, paragon, tm):
lst = dat.split('\t')
h = lst[5] # handle
lp = lst[7].split(', ') # coords list (5 points)
p = (float(lp[0]), float(lp[1])) # insertion point
ap = (float(lp[2]), float(lp[3])) # aligment point
sp = (float(lp[4]), float(lp[5])) # vector p-sp with angle == text rotation angle in OCS
cx = (float(lp[6]), float(lp[7])) # vector p-x with angle 0 grad. in OCS
cy = (float(lp[8]), float(lp[9])) # vector p-y with angle 90 grad. in OCS
ocsA = float(lst[8]) # rotation angle in OCS
nm = lst[9] # text
style = lst[10] # StyleName
# Alignment, VerticalAlignment, HorizontalAlignment, Height, ScaleFactor, Backward
alignment = int(lst[11].split(', ')[0]) # Alignment property (0,1)
height = float(lst[11].split(', ')[3])
print
print '(setq h (handent "%s") o (redraw h 3) o (command "zoom" "o" h ""))' % h
ucsCY,ucsCX,ucsP,ucsSP,ucsAP = (
tm.wcs2ucsP(cy), tm.wcs2ucsP(cx), tm.wcs2ucsP(p), tm.wcs2ucsP(sp), tm.wcs2ucsP(ap))
if ap == (0.0, 0.0) or ap == (-0.0, -0.0):
pline((ucsCX,ucsP,ucsCY,ucsSP))
else:
pline((ucsCX,ucsP,ucsCY,ucsSP,ucsAP))
zDir,ucsA = rotationAngle(ucsCX, ucsCY, ucsP, ocsA)
print ';zDir [%s], ucsA [%0.3f]' % (zDir, math.degrees(ucsA))
# я пока не понял, от чего зависит зеркалирование текста, от перевертывания UCS-WCS или OCS-UCS, или еще от чего
zDir = tm.getUCSBulgeSign()
test(
text(
ucsP, nm, math.degrees(normAngle2pi(ucsA)),
style, height, j=alignment, zdir=zDir, alP=ucsAP),
paragon)
print
#~ .\data\dwg.dump\+02+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+04 AcDbText 32 В_ 2128497504 23DC 00:Водопровод;99:56041000;A3:;ДМ:;МТ: 4660.1754282193215000, 2098.5390269819404000, 0.0000000000000000, 0.0000000000000000, 4671.7890262822248000, 2197.8623592862550000, 4760.1754282193215000, 2098.5390269819404000, 4660.1754282193215000, 2198.5390269819404000 1.45439768353 150 ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2098.539026981940400 4660.175428219321500) 3.00000 186.66915 "150"))'''
textEntity(t, paragon, trans)
t = '+02+04 AcDbText 32 К_ХОЗФЕК_ТЕКСТ 2128194264 278B 4820.2346179690185000, 2022.2000374643121000, 0.0000000000000000, 0.0000000000000000, 4878.4389181390934000, 1940.8842367751977000, 4920.2346179690185000, 2022.2000374643121000, 4820.2346179690185000, 2122.2000374643121000 5.33362784756 кер ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2022.200037464312100 4820.234617969018500) 3.00000 324.40563 "кер"))'''
textEntity(t, paragon, trans)
t = '+02+04 AcDbText 32 ТЕКСТ 2127931016 2169 4255.1785182462781000, 2768.9504951229555000, 0.0000000000000000, 0.0000000000000000, 4347.8204812430622000, 2806.5997539749224000, 4355.1785182462781000, 2768.9504951229555000, 4255.1785182462781000, 2868.9504951229555000 0.386007384627 5кж ROMANS 0, 0, 0, 4.4, 0.7, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2768.950495122955500 4255.178518246278100) 4.40000 247.88341 "5кж"))'''
textEntity(t, paragon, trans)
#~ .\data\dwg.dump\+02+03.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+03 AcDbText 32 В_ТЕКСТ_УЗЛЫ 2106937760 2C5C 4226.9214796637671000, 2958.6728408830641000, 4231.6833844256716000, 2958.6728408830641000, 4326.9214796637671000, 2958.6728408830641000, 4326.9214796637671000, 2958.6728408830641000, 4226.9214796637671000, 3058.6728408830641000 0.0 2 ROMANT 1, 0, 1, 10.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(2958.672840883064100 4231.683384425671600) 10.00000 270.00000 "2"))'''
textEntity(t, paragon, trans)
t = '+02+03 AcDbText 32 В_ТЕКСТ_УЗЛЫ 2106938864 2CDE 4080.9372068116886000, 2748.9184736856269000, 0.0000000000000000, 0.0000000000000000, 4083.5834179222747000, 2848.8834553880120000, 4180.9372068116882000, 2748.9184736856269000, 4080.9372068116886000, 2848.9184736856269000 1.5443311264 300 ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2748.918473685626900 4080.937206811688600) 3.00000 181.51634 "300"))'''
textEntity(t, paragon, trans)
t = '+02+03 AcDbText 32 ТЕКСТ 2107623072 2754 3799.3154319999999000, 2769.1727920000008000, 0.0000000000000000, 0.0000000000000000, 3839.2087894766973000, 2677.4748093109774000, 3899.3154319999999000, 2769.1727920000008000, 3799.3154319999999000, 2869.1727920000008000 5.12274255616 ул.Толбухина ROMANS 0, 0, 0, 4.4, 0.7, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2769.172792000000800 3799.315431999999900) 4.40000 336.48847 "ул.Толбухина"))'''
textEntity(t, paragon, trans)
#~ .\data\dwg.dump\+02+02.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+02+02 AcDbText 32 В_ТЕКСТ_ОФОРМЛЕНИЕ 2125083840 B668 2468.7482773333331000, 3010.6138940000005000, 2490.4149439999997000, 3010.6138940000005000, 2568.7482773333331000, 3010.6138940000005000, 2568.7482773333331000, 3010.6138940000005000, 2468.7482773333331000, 3110.6138940000005000 0.0 +2+2 ROMANT 1, 0, 1, 10.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(3010.613894000000500 2490.414943999999700) 10.00000 270.00000 "+2+2"))'''
textEntity(t, paragon, trans)
t = '+02+02 AcDbText 32 ТЕКСТ 2124671032 B4EF 2670.3974439999997000, 2282.9589626399925000, 0.0000000000000000, 0.0000000000000000, 2730.6212296463273000, 2203.1272919670996000, 2770.3974439999997000, 2282.9589626399925000, 2670.3974439999997000, 2382.9589626399925000 5.35869035397 ул.Б.Хмельницкого ROMANS 0, 0, 0, 4.4, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(2282.958962639992500 2670.397443999999700) 4.40000 322.96966 "ул.Б.Хмельницкого"))'''
textEntity(t, paragon, trans)
t = '+02+02 AcDbText 32 К_ХОЗФЕК_КОЛОДЕЦ_НОМЕР 2126234392 CCBB 2235.2999999999993000, 2570.4400000000010000, 0.0000000000000000, 0.0000000000000000, 2335.2999999999993000, 2570.4400000000010000, 2335.2999999999993000, 2570.4400000000010000, 2235.2999999999993000, 2670.4400000000010000 0.0 К_017 Standard 0, 0, 0, 2.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "Standard" '(2570.440000000001000 2235.299999999999300) 2.00000 270.00000 "К_017"))'''
textEntity(t, paragon, trans)
#~ .\data\dwg.dump\+01+04.dwg.csv
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+04 AcDbText 32 В_ТЕКСТ_ОФОРМЛЕНИЕ 2115479472 1FEE 4425.1755248571426000, 2031.0123800000008000, 4502.3183819999995000, 2031.0123800000008000, 4525.1755248571426000, 2031.0123800000008000, 4525.1755248571426000, 2031.0123800000008000, 4425.1755248571426000, 2131.0123800000010000 0.0 МИНСКВОДОКАНАЛ ROMANT 1, 0, 1, 10.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(2031.012380000000800 4502.318381999999500) 10.00000 270.00000 "МИНСКВОДОКАНАЛ"))'''
textEntity(t, paragon, trans)
t = '+01+04 AcDbText 32 В_ТЕКСТ 2115590856 2409 4870.7735541383590000, 1353.4673763609028000, 0.0000000000000000, 0.0000000000000000, 4924.8040391774121000, 1269.3204412625605000, 4970.7735541383590000, 1353.4673763609028000, 4870.7735541383590000, 1453.4673763609028000 5.28318833108 противопожарный ROMANS 0, 0, 0, 3.0, 0.8, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1353.467376360902800 4870.773554138359000) 3.00000 327.29561 "противопожарный"))'''
textEntity(t, paragon, trans)
t = '+01+04 AcDbText 32 В_ТЕКСТ_ОФОРМЛЕНИЕ 2115479728 2006 5053.3897340000003000, 1011.0680160000006000, 0.0000000000000000, 0.0000000000000000, 5153.3897340000003000, 1011.0680160000006000, 5153.3897340000003000, 1011.0680160000006000, 5053.3897340000003000, 1111.0680160000006000 0.0 Водопровод от 3-ей группы насосов РПНС ROMANT 0, 0, 0, 6.0, 0.7, False'
paragon = '''(setq o (command "text" "s" "ROMANT" '(1011.068016000000600 5053.389734000000300) 6.00000 270.00000 "Водопровод от 3-ей группы насосов РПНС"))'''
textEntity(t, paragon, trans)
#~ .\data\dwg.dump\+01+03.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+03 AcDbText 32 В_ТЕКСТ_УЗЛЫ 2124651112 1C7D 4030.6924336709390000, 1663.5183232011484000, 0.0000000000000000, 0.0000000000000000, 4130.6579490955819000, 1666.1442946186426000, 4130.6924336709390000, 1663.5183232011484000, 4030.6924336709390000, 1763.5183232011484000 0.0262627331083 250 ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1663.518323201148400 4030.692433670939000) 3.00000 268.49526 "250"))'''
textEntity(t, paragon, trans)
t = '+01+03 AcDbText 32 В_ТЕКСТ 2124657760 19E4 3447.8558800000001000, 1142.6416680000007000, 0.0000000000000000, 0.0000000000000000, 3505.1449713783391000, 1060.6785054875384000, 3547.8558800000001000, 1142.6416680000007000, 3447.8558800000001000, 1242.6416680000007000 5.32241759501 50ст.полив. ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1142.641668000000700 3447.855880000000100) 3.00000 325.04793 "50ст.полив."))'''
textEntity(t, paragon, trans)
t = '+01+03 AcDbText 32 В_ТЕКСТ 2124870904 1DB7 3070.7240860963320000, 1625.1846311375807000, 0.0000000000000000, 0.0000000000000000, 3128.5335443203521000, 1543.5876548465119000, 3170.7240860963320000, 1625.1846311375807000, 3070.7240860963320000, 1725.1846311375807000 5.32878057677 100чуг ROMANS 0, 0, 0, 3.0, 0.8, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1625.184631137580700 3070.724086096332000) 3.00000 324.68336 "100чуг"))'''
textEntity(t, paragon, trans)
t = '+01+03 AcDbText 32 В_ТЕКСТ_УЗЛЫ 2124650528 1C34 3254.2078520207765000, 1314.1026529906976000, 3259.9221377350623000, 1314.1026529906976000, 3154.2078520207765000, 1314.1026529906976000, 3154.2078520207765000, 1314.1026529906976000, 3254.2078520207765000, 1414.1026529906976000 0.0 4 ROMANT 1, 0, 1, 12.0, 1.0, True'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(1314.102652990697600 3259.922137735062300) 12.00000 270.00000 "4"))'''
textEntity(t, paragon, trans)
t = '+01+03 AcDbText 32 ТЕКСТ 2124872176 1E4E 3022.7746145215133000, 1312.0022830650014000, 0.0000000000000000, 0.0000000000000000, 3079.6651973122275000, 1229.7620156181304000, 3122.7746145215133000, 1312.0022830650014000, 3022.7746145215133000, 1412.0022830650014000 5.31756376454 дезинфек. и стерилиз. ROMANS 0, 0, 0, 3.0, 0.7, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1312.002283065001400 3022.774614521513300) 3.00000 325.32604 " дезинфек. и стерилиз."))'''
textEntity(t, paragon, trans)
#~ .\data\dwg.dump\+01+02.dwg
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
trans = Vwcs2ucs()
trans.config(ucsMatrix)
print
#~ dwg typename typenum layer id handle attribs coords angle text closed radius
t = '+01+02 AcDbText 32 В_ТЕКСТ 2107161072 782E 2005.3753519091333000, 1267.2985120690655000, 0.0000000000000000, 0.0000000000000000, 2104.6585812182652000, 1279.2500968154616000, 2105.3753519091333000, 1267.2985120690655000, 2005.3753519091333000, 1367.2985120690655000 0.119802220209 119ст ROMANS 0, 0, 0, 3.0, 0.7, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1267.298512069065500 2005.375351909133300) 3.00000 263.13584 "119ст"))'''
textEntity(t, paragon, trans)
t = '+01+02 AcDbText 32 В_ТЕКСТ_УЗЛЫ 2107155776 75C0 2962.9745582280498000, 1213.0974025778492000, 2966.7840820375736000, 1213.0974025778492000, 2862.9745582280498000, 1213.0974025778492000, 2862.9745582280498000, 1213.0974025778492000, 2962.9745582280498000, 1313.0974025778492000 0.0 3 ROMANT 1, 0, 1, 8.0, 1.0, True'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(1213.097402577849200 2966.784082037573600) 8.00000 270.00000 "3"))'''
textEntity(t, paragon, trans)
t = '+01+02 AcDbText 32 В_ТЕКСТ_ОФОРМЛЕНИЕ 2107151664 73DE 3167.6148526666657000, 2024.5083320000012000, 3197.9481859999992000, 2024.5083320000012000, 3067.6148526666657000, 2024.5083320000012000, 3067.6148526666657000, 2024.5083320000012000, 3167.6148526666657000, 2124.5083320000012000 0.0 +1+2 ROMANT 1, 0, 1, 14.0, 1.0, True'
paragon = '''(setq o (command "text" "s" "ROMANT" "j" "c" '(2024.508332000001200 3197.948185999999200) 14.00000 270.00000 "+1+2"))'''
textEntity(t, paragon, trans)
t = '+01+02 AcDbText 32 В_ТЕКСТ_ОФОРМЛЕНИЕ 2107151800 73EF 3053.3897339999999000, 1011.0680160000009000, 0.0000000000000000, 0.0000000000000000, 2953.3897339999999000, 1011.0680160000009000, 2953.3897339999999000, 1011.0680160000009000, 3053.3897339999999000, 1111.0680160000009000 0.0 Водопровод от 3-ей группы насосов РПНС ROMANT 0, 0, 0, 6.0, 0.7, True'
paragon = '''(setq o (command "text" "s" "ROMANT" '(1011.068016000000900 3053.389733999999900) 6.00000 270.00000 "Водопровод от 3-ей группы насосов РПНС"))'''
textEntity(t, paragon, trans)
t = '+01+02 AcDbText 32 В_ТЕКСТ 2107147688 720D 2015.2745823273906000, 1749.2938856644687000, 0.0000000000000000, 0.0000000000000000, 2100.5839315907101000, 1697.1180777812269000, 2115.2745823273908000, 1749.2938856644687000, 2015.2745823273906000, 1849.2938856644687000 5.73427482429 219ст ROMANS 0, 0, 0, 3.0, 1.0, False'
paragon = '''(setq o (command "text" "s" "ROMANS" '(1749.293885664468700 2015.274582327390600) 3.00000 301.45025 "219ст"))'''
textEntity(t, paragon, trans)
return ecOK
#def testText():
def testBulge():
from trig import wcs2ucs, detectArcStartEnd, getArcBulge, unzipBulge2, getUCSBulgeSign
from trig import unzipBulge
def pline(res):
pts = res['points']
s = ''
for p in pts:
if s: s += ' '
s += "'(%0.15f %0.15f)" % (p[0], p[1])
res = '(setq o (command "pline" %s ))' % s
print
print res
print
return res
print
print 'testBulge...'
# real data (MVK)
# arc
#~ '+02+04'
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
print '(setq h (handent "240F") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5061.5535286155118000, 2884.3686816878144000)
s = wcs2ucs(ucsMatrix, 5063.7714018472143000, 2883.4058363920590000)
e = wcs2ucs(ucsMatrix, 5062.7700108278868000, 2882.2791353824086000)
m = wcs2ucs(ucsMatrix, 5063.3607538699707000, 2882.7624533058251000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2883.405836392059000 5063.771401847214300) '(2882.962023016220400 5063.520085026370900) '(2882.580801620218600 5063.181262500197600) '(2882.279135382408600 5062.770010827886800) ))")
print '(setq h (handent "2411") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5068.3296667864270000, 2891.7626858982708000)
s = wcs2ucs(ucsMatrix, 5070.3827230988572000, 2890.7619137075217000)
e = wcs2ucs(ucsMatrix, 5069.6108480378180000, 2889.8718766004117000)
m = wcs2ucs(ucsMatrix, 5070.0551599176815000, 2890.2662706304459000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2890.761913707521700 5070.382723098857200) '(2890.421770318846000 5070.178593666712000) '(2890.122077719760500 5069.918688499427800) '(2889.871876600411700 5069.610848037818000) ))")
print '(setq h (handent "2413") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5072.7584968497740000, 2893.7086212079112000)
s = wcs2ucs(ucsMatrix, 5070.3824418044269000, 2894.5348029804909000)
e = wcs2ucs(ucsMatrix, 5072.6989933208479000, 2896.2235115096755000)
m = wcs2ucs(ucsMatrix, 5071.2766329841261000, 2895.7414255230256000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2894.534802980490900 5070.382441804426900) '(2894.994892338753700 5070.596617926748000) '(2895.402631412589500 5070.898780923534100) '(2895.741425523026000 5071.276632984125200) '(2895.997486000148500 5071.714795808900800) '(2896.160391371775900 5072.195436494708700) '(2896.223511509675500 5072.698993320847900) ))")
print '(setq h (handent "24B4") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5061.7378255128042000, 2638.9920103622517000)
s = wcs2ucs(ucsMatrix, 5061.4835404392416000, 2636.6080312971353000)
e = wcs2ucs(ucsMatrix, 5061.4835404392416000, 2641.3759894273680000)
m = wcs2ucs(ucsMatrix, 5059.3403232538794000, 2638.9920103622517000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2636.608031297135300 5061.483540439241600) '(2636.702678206477200 5061.025803489206700) '(2636.884342242179600 5060.595130375340900) '(2637.146118385103800 5060.207890909544400) '(2637.478056568524600 5059.878803998133700) '(2637.867539878474900 5059.620378178709900) '(2638.299764120503800 5059.442436172771500) '(2638.758300524592400 5059.351741525738400) '(2639.225720199910900 5059.351741525738400) '(2639.684256603999500 5059.442436172771500) '(2640.116480846028500 5059.620378178709900) '(2640.505964155978700 5059.878803998133700) '(2640.837902339399500 5060.207890909544400) '(2641.099678482323700 5060.595130375340900) '(2641.281342518026100 5061.025803489206700) '(2641.375989427368000 5061.483540439241600) ))")
print '(setq h (handent "24F8") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5071.9390982089244000, 2514.7043304550493000)
s = wcs2ucs(ucsMatrix, 5071.6848131353618000, 2512.3203513899330000)
e = wcs2ucs(ucsMatrix, 5071.6848131353618000, 2517.0883095201657000)
m = wcs2ucs(ucsMatrix, 5069.5415959499996000, 2514.7043304550493000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2512.320351389933000 5071.684813135361800) '(2512.414998299274900 5071.227076185327000) '(2512.596662334977300 5070.796403071461100) '(2512.858438477901500 5070.409163605664600) '(2513.190376661322300 5070.080076694253900) '(2513.579859971272500 5069.821650874830100) '(2514.012084213301500 5069.643708868891700) '(2514.470620617390100 5069.553014221858600) '(2514.938040292708600 5069.553014221858600) '(2515.396576696797200 5069.643708868891700) '(2515.828800938826100 5069.821650874830100) '(2516.218284248776400 5070.080076694253900) '(2516.550222432197200 5070.409163605664600) '(2516.811998575121400 5070.796403071461100) '(2516.993662610823800 5071.227076185327000) '(2517.088309520165700 5071.684813135361800) ))")
#~ '+02+03'
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
print '(setq h (handent "2D92") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 4053.2853754834041000, 2677.4212796329884000)
s = wcs2ucs(ucsMatrix, 4053.3561883626003000, 2673.8689412728309000)
e = wcs2ucs(ucsMatrix, 4053.3561883626003000, 2680.9736179931460000)
m = wcs2ucs(ucsMatrix, 4049.7323313957368000, 2677.4212796329884000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2673.868941272830900 4053.356188362600300) '(2673.924948004199500 4052.653088024697800) '(2674.118736906138600 4051.974904641974300) '(2674.442671215784200 4051.348363819559800) '(2674.883985447180700 4050.798156051272100) '(2675.425288448926500 4050.345963725576400) '(2676.045248748371300 4050.009606673874300) '(2676.719435174563400 4049.802339933041800) '(2677.421279632988000 4049.732331395736800) '(2678.123124091412600 4049.802339933041800) '(2678.797310517604700 4050.009606673874300) '(2679.417270817049500 4050.345963725576400) '(2679.958573818795200 4050.798156051272100) '(2680.399888050191700 4051.348363819559800) '(2680.723822359837400 4051.974904641974300) '(2680.917611261776500 4052.653088024697800) '(2680.973617993146000 4053.356188362600300) ))")
print '(setq h (handent "2D14") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 4054.1586834208783000, 2491.5337198609909000)
s = wcs2ucs(ucsMatrix, 4054.2294963000745000, 2487.9813815008333000)
e = wcs2ucs(ucsMatrix, 4054.2294963000745000, 2495.0860582211485000)
m = wcs2ucs(ucsMatrix, 4050.6056393332110000, 2491.5337198609909000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2487.981381500833300 4054.229496300074500) '(2488.037388232201900 4053.526395962172000) '(2488.231177134141000 4052.848212579448500) '(2488.555111443786700 4052.221671757034100) '(2488.996425675183200 4051.671463988746400) '(2489.537728676929000 4051.219271663050700) '(2490.157688976373700 4050.882914611348500) '(2490.831875402565900 4050.675647870516100) '(2491.533719860990500 4050.605639333211000) '(2492.235564319415100 4050.675647870516100) '(2492.909750745607200 4050.882914611348500) '(2493.529711045052000 4051.219271663050700) '(2494.071014046797700 4051.671463988746400) '(2494.512328278194200 4052.221671757034100) '(2494.836262587839900 4052.848212579448500) '(2495.030051489779000 4053.526395962172000) '(2495.086058221148500 4054.229496300074500) ))")
print '(setq h (handent "2C65") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 4082.8023315151831000, 2762.9914992191516000)
s = wcs2ucs(ucsMatrix, 4079.2499931550255000, 2762.9206863399554000)
e = wcs2ucs(ucsMatrix, 4086.3546698753407000, 2762.9206863399554000)
m = wcs2ucs(ucsMatrix, 4082.8023315151831000, 2766.5445433068189000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(2762.920686339955400 4079.249993155025500) '(2763.623786677857900 4079.305999886394100) '(2764.301970060581400 4079.499788788333300) '(2764.928510882995900 4079.823723097978900) '(2765.478718651283500 4080.265037329375400) '(2765.930910976979200 4080.806340331121200) '(2766.267268028681400 4081.426300630565900) '(2766.474534769513900 4082.100487056758100) '(2766.544543306818900 4082.802331515182700) '(2766.474534769513900 4083.504175973607300) '(2766.267268028681400 4084.178362399799400) '(2765.930910976979200 4084.798322699244200) '(2765.478718651283500 4085.339625700989900) '(2764.928510882995900 4085.780939932386400) '(2764.301970060581400 4086.104874242032100) '(2763.623786677857900 4086.298663143971200) '(2762.920686339955400 4086.354669875340700) ))")
#~ '+01+03'
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
print '(setq h (handent "1C71") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 4062.6651046938769000, 1636.5974593130943000)
s = wcs2ucs(ucsMatrix, 4060.5037272915624000, 1636.1400409635037000)
e = wcs2ucs(ucsMatrix, 4061.8144797880718000, 1634.5585328574805000)
m = wcs2ucs(ucsMatrix, 4060.9641251383314000, 1635.1876889866246000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(1634.558532857480500 4061.814479788071800) '(1634.760033345470000 4061.438463085550700) '(1635.030046395125300 4061.108184475509500) '(1635.358503962323300 4060.835959139096300) '(1635.733158767596000 4060.631937610524300) '(1636.140040963503700 4060.503727291562400) ))")
print '(setq h (handent "1C3E") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 4069.8322890678246000, 1786.6208677551444000)
s = wcs2ucs(ucsMatrix, 4069.7854916891056000, 1788.8178755080628000)
e = wcs2ucs(ucsMatrix, 4069.7854916891056000, 1784.4238600022261000)
m = wcs2ucs(ucsMatrix, 4067.6347829674833000, 1786.6208677551444000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(1784.423860002226100 4069.785491689105600) '(1784.480181158075300 4069.335807492973300) '(1784.627549781137800 4068.907239601287500) '(1784.859698003947600 4068.518015820547600) '(1785.166752121622500 4068.184690577480100) '(1785.535652539287600 4067.921440827824400) '(1785.950709221452400 4067.739463083477400) '(1786.394269019022900 4067.646497203573300) '(1786.847466491265500 4067.646497203573300) '(1787.291026288836100 4067.739463083477400) '(1787.706082971000800 4067.921440827824400) '(1788.074983388665900 4068.184690577480100) '(1788.382037506340800 4068.518015820547600) '(1788.614185729150700 4068.907239601287500) '(1788.761554352213100 4069.335807492973300) '(1788.817875508062800 4069.785491689105600) ))")
#~ '+01+02'
ucsMatrix = ((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
print '(setq h (handent "8C9A") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 2083.6211704525558000, 1840.6523209234265000)
s = wcs2ucs(ucsMatrix, 2092.8759048775592000, 1842.5868406048162000)
e = wcs2ucs(ucsMatrix, 2083.3420991987355000, 1831.2016810027485000)
m = wcs2ucs(ucsMatrix, 2090.8700391319962000, 1834.5821991336061000)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(1842.586840604816200 2092.875904877559200) '(1840.702944485363600 2093.075794344070800) '(1838.817015879457100 2092.896089916929200) '(1837.004772974396700 2092.344006552962600) '(1835.338975548727800 2091.441709858773300) '(1833.886503738360900 2090.225426163330700) '(1832.705672864586900 2088.743988066327300) '(1831.843892131015100 2087.056873857106400) '(1831.335761190459200 2085.231819519569900) '(1831.201681002748500 2083.342099198735500) ))")
#~ 'DRAWING3'
ucsMatrix = ((1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))
print '(setq h (handent "38C") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 1.0841418438549795, 5.1022174168718788)
s = wcs2ucs(ucsMatrix, 4.9186134512202679, 15.4157538815975670)
e = wcs2ucs(ucsMatrix, 11.0510998090400920, 9.7639720047014436)
m = wcs2ucs(ucsMatrix, -6.3727693234796590, -2.9889310034326790)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(4.918613451220268 15.415753881597567) '(2.829741482510930 15.966152653168219) '(0.673591190533724 16.097837230141820) '(-1.466735794105237 15.805732269156223) '(-3.508747697471838 15.101095982895561) '(-5.373741972940145 14.011086229784816) '(-6.989838628684375 12.577713804802940) '(-8.294750602522848 10.856223273333455) '(-9.238184409244022 8.912963753418088) '(-9.783778535460270 6.822831710018812) '(-9.910504873016798 4.666384320265095) '(-9.613479177373293 2.526734665407179) '(-8.904149314539712 0.486348413959037) '(-7.809854041215167 -1.376134542791350) '(-6.372769323479666 -2.988931003432675) '(-4.648282804674822 -4.289881100810147) '(-2.702859073194205 -5.228844047042925) '(-0.611478006325318 -5.769630643167927) '(1.545255079353379 -5.891398071263262) '(3.684216091393906 -5.589453211435067) '(5.722965902725735 -4.875433522490468) '(7.582927693193986 -3.776858514853646) '(9.192415431343385 -2.336069102707361) '(10.489396773705838 -0.608595714498503) '(11.423883894842154 1.338981942447804) '(11.959860101558078 3.431600974961968) '(12.076667976367499 5.588608353203547) '(11.769805548837089 7.726869413031428) '(11.051099809040092 9.763972004701444) ))")
print '(setq h (handent "378") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 5.8488993905517104, 7.4608267393789776)
s = wcs2ucs(ucsMatrix, 6.5171488538920022, 4.1770855919933361)
e = wcs2ucs(ucsMatrix, 6.8886173967031574, 10.6464977418480990)
m = wcs2ucs(ucsMatrix, 9.1944354627503966, 7.2687286969486928)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(6.517148853892002 4.177085591993336) '(7.162223213367650 4.377858396253754) '(7.753916697875588 4.703940392957595) '(8.268179552612768 5.142077773719698) '(8.684109239551361 5.674462168407102) '(8.984800034278159 6.279454477573157) '(9.158030169824192 6.932464407300273) '(9.196758598090300 7.606949957202972) '(9.099411177687241 8.275496236771096) '(8.869944655905128 8.910929760882571) '(8.517685844224667 9.487422933241948) '(8.056952524182989 9.981543825318859) '(7.506471492114200 10.373208581859437) '(6.888617396703157 10.646497741848099) ))")
print '(setq h (handent "377") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 7.2943541954524846, 7.6562227951962285)
s = wcs2ucs(ucsMatrix, 6.5885851277066587, 10.6607789870368300)
e = wcs2ucs(ucsMatrix, 6.4885743713744901, 4.6769297981878202)
m = wcs2ucs(ucsMatrix, 4.2084494996111346, 7.7077989049643696)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(6.588585127706659 10.660778987036830) '(5.995666652376922 10.456022529529895) '(5.456394293608126 10.135612092206035) '(4.993044285565180 9.712783172517787) '(4.624756665951932 9.205001965187567) '(4.366744640342787 8.633243869556910) '(4.229666155888888 8.021127038896331) '(4.219183643399112 7.393936762975196) '(4.335730113946733 6.777580984645001) '(4.574491272070846 6.197520095901965) '(4.925604384439446 5.677715221356753) '(5.374565689117930 5.239638433362317) '(5.902829516202441 4.901385784781179) '(6.488574371374490 4.676929798187820) ))")
print '(setq h (handent "35C") o (command "zoom" "o" h "") o (redraw h 3))'
c = wcs2ucs(ucsMatrix, 6.5103624594413212, 7.4972547416212052)
s = wcs2ucs(ucsMatrix, 9.2629963175141459, 10.7777160310759540)
e = wcs2ucs(ucsMatrix, 9.7908237488960701, 10.2498885996940300)
m = wcs2ucs(ucsMatrix, 3.4822921640039786, 4.4691844461838617)
s,e = detectArcStartEnd(c, s, e, m)
bulge = getArcBulge(c, s, e)
res = unzipBulge2(s, e, bulge, 0)
test(pline(res), "(setq o (command \"pline\" '(9.262996317514146 10.777716031075954) '(8.567476238901284 11.253143761091289) '(7.792336560586073 11.583201612569738) '(6.967578691103666 11.755114855073089) '(6.125124487220187 11.762229669212099) '(5.297580733815750 11.604270679526568) '(4.516977113954136 11.287351612760112) '(3.813526515400794 10.823738669006250) '(3.214455655329286 10.231375764331792) '(2.742951283324634 9.533190020133533) '(2.417262749389623 8.756204379928748) '(2.249995671627866 7.930491699319918) '(2.247624041856318 7.088010790578715) '(2.410239652864926 6.261369472183927) '(2.731548545620826 5.482562498886208) '(3.199114613926362 4.781733220109643) '(3.794840937929750 4.186006896106257) '(4.495670216706315 3.718440827800722) '(5.274477190004034 3.397131935044822) '(6.101118508398823 3.234516324036215) '(6.943599417140026 3.236887953807764) '(7.769312097748856 3.404155031569523) '(8.546297737953640 3.729843565504535) '(9.244483482151898 4.201347937509188) '(9.836846386826355 4.800418797580696) '(10.300459330580216 5.503869396134039) '(10.617378397346670 6.284473015995655) '(10.775337387032199 7.112016769400092) '(10.768222572893185 7.954470973283570) '(10.596309330389831 8.779228842765978) '(10.266251478911379 9.554368521081187) '(9.790823748896070 10.249888599694030) ))")