File: draw_test_harness.md

package info (click to toggle)
opencascade 7.5.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 290,544 kB
  • sloc: cpp: 1,190,524; tcl: 15,703; cs: 5,173; java: 1,557; ansic: 1,174; sh: 901; xml: 699; perl: 54; makefile: 27
file content (11732 lines) | stat: -rw-r--r-- 329,985 bytes parent folder | download
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
Draw Test Harness  {#occt_user_guides__test_harness}
===============================

@tableofcontents
 
@section occt_draw_1 Introduction

This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**).
Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries. 

@subsection occt_draw_1_1 Overview

Draw is a test harness for Open CASCADE Technology. It provides a flexible and easy to use means of testing and demonstrating the OCCT modeling libraries. 

Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes. 

Scripts may be written to customize Draw and perform tests. New types of objects and new commands may be added using the C++ programing language. 

Draw consists of: 

  * A command interpreter based on the TCL command language.
  * A 3d graphic viewer based on the X system.
  * A basic set of commands covering scripts, variables and graphics.
  * A set of geometric commands allowing the user to create and modify curves and surfaces and to use OCCT geometry algorithms. This set of commands is optional.
  * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.


There is also a set of commands for each delivery unit in the modeling libraries: 

  * GEOMETRY, 
  * TOPOLOGY, 
  * ADVALGOS, 
  * GRAPHIC, 
  * PRESENTATION. 


@subsection occt_draw_1_2 Contents of this documentation

This documentation describes: 

  * The command language.
  * The basic set of commands.
  * The graphical commands.
  * The Geometry set of commands.
  * The Topology set of commands.
  * OCAF commands.
  * Data Exchange commands
  * Shape Healing commands

This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command. 

~~~~~
exit
~~~~~

Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file. 

**Example:** 

~~~~~
# this is a very short example 
exit 
~~~~~


@subsection occt_draw_1_3 Getting started

Install Draw and launch Emacs. Get a command line in Emacs using *Esc x* and key in *woksh*. 

All DRAW Test Harness can be activated in the common executable called **DRAWEXE**. They are grouped in toolkits and can be loaded at run-time thereby implementing dynamically loaded plug-ins. Thus, it is possible to work only with the required commands adding them dynamically without leaving the Test Harness session. 

Declaration of available plug-ins is done through the special resource file(s). The *pload* command loads the plug-in in accordance with the specified resource file and activates the commands implemented in the plug-in. 

@subsubsection occt_draw_1_3_1 Launching DRAW Test Harness

Test Harness executable *DRAWEXE* is located in the <i>$CASROOT/\<platform\>/bin</i> directory (where \<platform\> is Win for Windows and Linux for Linux operating systems). Prior to launching it is important to make sure that the environment is correctly setup (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).  


@subsubsection occt_draw_1_3_2 Plug-in resource file

Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory. 

The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.hxx* file for details). 

Each key defines a sequence of either further (nested) keys or a name of the dynamic library. Keys can be nested down to an arbitrary level. However, cyclic dependencies between the keys are not checked. 

**Example:** (excerpt from DrawPlugin): 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
OCAF               : VISUALIZATION, OCAFKERNEL 
VISUALIZATION      : AISV 
OCAFKERNEL         : DCAF 

DCAF               : TKDCAF 
AISV               : TKViewerTest 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in

To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness: 

~~~~~
pload [-PluginFileName] [[Key1] [Key2]...]
~~~~~

where: 

* <i>-PluginFileName</i> -- defines the name of a plug-in resource file (prefix "-" is mandatory) described above. If this parameter is omitted then the default name *DrawPlugin* is used. 
* *Key* -- defines the key(s) enumerating plug-ins to be loaded. If no keys are specified then the key named *DEFAULT* is used (if there is no such key in the file then no plug-ins are loaded). 

According to the OCCT resource file management rules, to access the resource file the environment variable *CSF_PluginFileNameDefaults* (and optionally *CSF_PluginFileNameUserDefaults*) must be set and point to the directory storing the resource file. If it is omitted then the plug-in resource file will be searched in the <i>$CASROOT/src/DrawResources</i> directory. 

~~~~~
Draw[]        pload -DrawPlugin OCAF 
~~~~~
This command will search the resource file *DrawPlugin* using variable *CSF_DrawPluginDefaults* (and *CSF_DrawPluginUserDefaults*) and will start with the OCAF key. Since the *DrawPlugin* is the file shipped with Open CASCADE Technology it will be found in the <i>$CASROOT/src/DrawResources</i> directory (unless this location is redefined by user's variables). The OCAF key will be recursively extracted into two toolkits/plug-ins: *TKDCAF* and *TKViewerTest* (e.g. on Windows they correspond to *TKDCAF.dll* and *TKViewerTest.dll*). Thus, commands implemented for Visualization and OCAF will be loaded and activated in Test Harness. 

~~~~~
Draw[]        pload (equivalent to pload -DrawPlugin DEFAULT). 
~~~~~
This command will find the default DrawPlugin file and the DEFAULT key. The latter finally maps to the TKTopTest toolkit which implements basic modeling commands. 


@section occt_draw_2 The Command Language

@subsection occt_draw_2_1 Overview

The command language used in Draw is Tcl. Tcl documentation such as "TCL and the TK Toolkit" by John K. Ousterhout (Addison-Wesley) will prove useful if you intend to use Draw extensively. 

This chapter is designed to give you a short outline of both the TCL language and some extensions included in Draw. The following topics are covered: 

  * Syntax of the TCL language.
  * Accessing variables in TCL and Draw.
  * Control structures.
  * Procedures.

@subsection occt_draw_2_2 Syntax of TCL

TCL is an interpreted command language, not a structured language like C, Pascal, LISP or Basic. It uses a shell similar to that of csh. TCL is, however, easier to use than csh because control structures and procedures are easier to define. As well, because TCL does not assign a process to each command, it is faster than csh. 

The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set a 24 
set b 15 
set a 25; set b 15 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Each command consists of one or more *words*; the first word is the name of a command and additional words are arguments to that command. 

Words are separated by spaces or tabs. In the preceding example each of the four commands has three words. A command may contain any number of words and each word is a string of arbitrary length. 

The evaluation of a command by TCL is done in two steps. In the first step, the command is parsed and broken into words. Some substitutions are also performed. In the second step, the command procedure corresponding to the first word is called and the other words are interpreted as arguments. In the first step, there is only string manipulation, The words only acquire *meaning* in the second step by the command procedure. 

The following substitutions are performed by TCL: 

Variable substitution is triggered by the $ character (as with csh), the content of the variable is substitued; { } may be used as in csh to enclose the name of the variable. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# set a variable value 
set file documentation 
puts $file #to display file contents on the screen 

# a simple substitution, set psfile to documentation.ps 
set psfile $file.ps 
puts $psfile 

# another substitution, set pfile to documentationPS 
set pfile ${file}PS 

# a last one, 
# delete files NEWdocumentation and OLDdocumentation 
foreach prefix {NEW OLD} {rm $prefix$file} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted. 

Compare command construction in csh. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set degree 30 
set pi 3.14159265 
# expr is a command evaluating a numeric expression 
set radian [expr $pi*$degree/180] 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Backslash substitution is triggered by the backslash character. It is used to insert special characters like $, [ , ] , etc. It is also useful to insert a new line, a backslash terminated line is continued on the following line. 

TCL uses two forms of *quoting* to prevent substitution and word breaking. 

Double quote *quoting* enables the definition of a string with space and tabs as a single word. Substitutions are still performed inside the inverted commas " ". 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# set msg to ;the price is 12.00; 
set price 12.00 
set msg ;the price is $price; 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Braces *quoting* prevents all substitutions. Braces are also nested. The main use of braces is to defer evaluation when defining procedures and control structures. Braces are used for a clearer presentation of TCL scripts on several lines. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set x 0 
# this will loop for ever 
# because while argument is ;0 < 3; 
while ;$x < 3; {set x [expr $x+1]} 
# this will terminate as expected because 
# while argument is {$x < 3} 
while {$x < 3} {set x [expr $x+1]} 
# this can be written also 
while {$x < 3} { 
set x [expr $x+1] 
} 
# the following cannot be written 
# because while requires two arguments 
while {$x < 3} 
{ 
set x [expr $x+1] 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comments start with a \# character as the first non-blank character in a command. To add a comment at the end of the line, the comment must be preceded by a semi-colon to end the preceding command. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# This is a comment 
set a 1 # this is not a comment 
set b 1; # this is a comment 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The number of words is never changed by substitution when parsing in TCL. For example, the result of a substitution is always a single word. This is different from csh but convenient as the behavior of the parser is more predictable. It may sometimes be necessary to force a second round of parsing. **eval** accomplishes this: it accepts several arguments, concatenates them and executes the resulting script. 


**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# I want to delete two files 

set files ;foo bar; 

# this will fail because rm will receive only one argument 
# and complain that ;foo bar; does not exit 

exec rm $files 

# a second evaluation will do it 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsection occt_draw_2_3 Accessing variables in TCL and Draw

TCL variables have only string values. Note that even numeric values are stored as string literals, and computations using the **expr** command start by parsing the strings. Draw, however, requires variables with other kinds of values such as curves, surfaces or topological shapes. 

TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data. 

The string value of a Draw variable is meaningless. It is usually set to the name of the variable itself. Consequently, preceding a Draw variable with a <i>$</i> does not change the result of a command. The content of a Draw variable is accessed using appropriate commands. 

There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below. 

Draw numeric variables can be used within an expression anywhere a Draw command requires a numeric value. The *expr* command is useless in this case as the variables are stored not as strings but as floating point values. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# dset is used for numeric variables 
# pi is a predefined Draw variable 
dset angle pi/3 radius 10 
point p radius*cos(angle) radius*sin(angle) 0 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is recommended that you use TCL variables only for strings and Draw for numerals. That way, you will avoid the *expr* command. As a rule, Geometry and Topology require numbers but no strings. 

@subsubsection occt_draw_2_3_1 set, unset

Syntax:                  

~~~~~
set varname [value] 
unset varname [varname varname ...] 
~~~~~

*set* assigns a string value to a variable. If the variable does not already exist, it is created. 

Without a value, *set* returns the content of the variable. 

*unset* deletes variables. It is is also used to delete Draw variables. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set a "Hello world"
set b "Goodbye" 
set a 
== "Hello world" 
unset a b 
set a 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Note**, that the *set* command can set only one variable, unlike the *dset* command. 


@subsubsection occt_draw_2_3_2 dset, dval

Syntax

~~~~~
dset var1 value1 vr2 value2 ... 
dval name 
~~~~~

*dset* assigns values to Draw numeric variables. The argument can be any numeric expression including Draw numeric variables. Since all Draw commands expect a numeric expression, there is no need to use $ or *expr*. The *dset* command can assign several variables. If there is an odd number of arguments, the last variable will be assigned a value of 0. If the variable does not exist, it will be created. 

*dval* evaluates an expression containing Draw numeric variables and returns the result as a string, even in the case of a single variable. This is not used in Draw commands as these usually interpret the expression. It is used for basic TCL commands expecting strings. 


**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# z is set to 0 
dset x 10 y 15 z 
== 0 

# no $ required for Draw commands 
point p x y z 

# "puts" prints a string 
puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)]; 
== x = 10, cos(x/pi) = -0.99913874099467914 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Note,** that in TCL, parentheses are not considered to be special characters. Do not forget to quote an expression if it contains spaces in order to avoid parsing different words. <i>(a + b)</i> is parsed as three words: <i>"(a + b)"</i> or <i>(a+b)</i> are correct.

@subsubsection occt_draw_2_3_3 del, dall

Syntax:      
~~~~~
del varname_pattern [varname_pattern ...] 
dall
~~~~~

*del* command does the same thing as *unset*, but it deletes the variables matched by the pattern.

*dall* command deletes all variables in the session.

@subsection occt_draw_2_4 lists

TCL uses lists. A list is a string containing elements separated by spaces or tabs. If the string contains braces, the braced part accounts as one element. 

This allows you to insert lists within lists. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# a list of 3 strings 
;a b c; 

# a list of two strings the first is a list of 2 
;{a b} c; 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Many TCL commands return lists and **foreach** is a useful way to create loops on list elements. 

@subsubsection occt_draw_2_5 Control Structures

TCL allows looping using control structures. The control structures are implemented by commands and their syntax is very similar to that of their C counterparts (**if**, **while**, **switch**, etc.). In this case, there are two main differences between TCL and C: 

* You use braces instead of parentheses to enclose conditions. 
* You do not start the script on the next line of your command. 


@subsubsection occt_draw_2_5_1 if

Syntax       

~~~~~
if condition script [elseif script .... else script] 
~~~~~

**If** evaluates the condition and the script to see whether the condition is true. 



**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
if {$x > 0} { 
puts ;positive; 
} elseif {$x == 0} { 
puts ;null; 
} else { 
puts ;negative; 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_2_5_2 while, for, foreach

Syntax:                  


~~~~~
while condition script 
for init condition reinit script 
foreach varname list script 
~~~~~

The three loop structures are similar to their C or csh equivalent. It is important to use braces to delay evaluation. **foreach** will assign the elements of the list to the variable before evaluating the script. \

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# while example 
dset x 1.1 
while {[dval x] < 100} { 
  circle c 0 0 x 
  dset x x*x 
} 
# for example 
# incr var d, increments a variable of d (default 1) 
for {set i 0} {$i < 10} {incr i} { 
  dset angle $i*pi/10 
  point p$i cos(angle0 sin(angle) 0 
} 
# foreach example 
foreach object {crapo tomson lucas} {display $object} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_2_5_3 break, continue

Syntax:                  

~~~~~
break 
continue 
~~~~~

Within loops, the **break** and **continue** commands have the same effect as in C. 

**break** interrupts the innermost loop and **continue** jumps to the next iteration. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# search the index for which t$i has value ;secret; 
for {set i 1} {$i <= 100} {incr i} { 
  if {[set t$i] == ;secret;} break; 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsection occt_draw_2_6 Procedures

TCL can be extended by defining procedures using the **proc** command, which sets up a context of local variables, binds arguments and executes a TCL script. 

The only problematic aspect of procedures is that variables are strictly local, and as they are implicitly created when used, it may be difficult to detect errors. 

There are two means of accessing a variable outside the scope of the current procedures: **global** declares a global variable (a variable outside all procedures); **upvar** accesses a variable in the scope of the caller. Since arguments in TCL are always string values, the only way to pass Draw variables is by reference, i.e. passing the name of the variable and using the **upvar** command as in the following examples. 

As TCL is not a strongly typed language it is very difficult to detect programming errors and debugging can be tedious. TCL procedures are, of course, not designed for large scale software development but for testing and simple command or interactive writing. 


@subsubsection occt_draw_2_6_1 proc

Syntax:

~~~~~
proc argumentlist script 
~~~~~

**proc** defines a procedure. An argument may have a default value. It is then a list of the form {argument value}. The script is the body of the procedure. 

**return** gives a return value to the procedure. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# simple procedure 
proc hello {} { 
  puts ;hello world; 
} 
# procedure with arguments and default values 
proc distance {x1 y1 {x2 0} {y2 0}} { 
  set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)] 
  return [expr sqrt(d)] 
} 
proc fact n { 
  if {$n == 0} {return 1} else { 
    return [expr n*[fact [expr n -1]]] 
  } 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@subsubsection occt_draw_2_6_2 global, upvar

Syntax:                 

~~~~~
global varname [varname ...] 
upvar varname localname [varname localname ...] 
~~~~~


**global** accesses high level variables. Unlike C, global variables are not visible in procedures. 

**upvar** gives a local name to a variable in the caller scope. This is useful when an argument is the name of a variable instead of a value. This is a call by reference and is the only way to use Draw variables as arguments. 

**Note** that in the following examples the \$ character is always necessarily used to access the arguments.
 
**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# convert degree to radian 
# pi is a global variable 
proc deg2rad (degree} { 
  return [dval pi*$degree/2.] 
} 
# create line with a point and an angle 
proc linang {linename x y angle} { 
  upvar linename l 
  line l $x $y cos($angle) sin($angle) 
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@section occt_draw_3 Basic Commands

This chapter describes all the commands defined in the basic Draw package. Some are TCL commands, but most of them have been formulated in Draw. These commands are found in all Draw applications. The commands are grouped into four sections: 

  * General commands, which are used for Draw and TCL management.
  * Variable commands, which are used to manage Draw variables such as storing and dumping.
  * Graphic commands, which are used to manage the graphic system, and so pertain to views.
  * Variable display commands, which are used to manage the display of objects within given views.

Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands 


@subsection occt_draw_3_1 General commands

This section describes several useful commands:

  * **help** to get information, 
  * **source** to eval a script from a file, 
  * **spy** to capture the commands in a file,
  * **cpulimit** to limit the process cpu time, 
  * **wait** to waste some time, 
  * **chrono** to time commands. 

@subsubsection occt_draw_3_1_1 help

Syntax:                  

~~~~~
help [command [helpstring group]] 
~~~~~

Provides help or modifies the help information. 

**help** without arguments lists all groups and the commands in each group. 

Specifying the command returns its syntax and in some cases, information on the command, The joker \* is automatically added at the end so that all completing commands are returned as well. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# Gives help on all commands starting with *a* 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@subsubsection occt_draw_3_1_2 source

Syntax:

~~~~~
source filename 
~~~~~
Executes a file. 

The **exit** command will terminate the file. 

@subsubsection occt_draw_3_1_3 spy

Syntax:                  

~~~~~
spy [filename] 
~~~~~

Saves interactive commands in the file. If spying has already been performed, the current file is closed. **spy** without an argument closes the current file and stops spying. If a file already exists, the file is overwritten. Commands are not appended. 

If a command returns an error it is saved with a comment mark. 

The file created by **spy** can be executed with the **source** command. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# all commands will be saved in the file ;session; 
spy session 
# the file ;session; is closed and commands are not saved 
spy 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



@subsubsection occt_draw_3_1_4 cpulimit

Syntax:                  

~~~~~
cpulimit [nbseconds] 
~~~~~

**cpulimit**limits a process after the number of seconds specified in nbseconds. It is used in tests to avoid infinite loops. **cpulimit** without arguments removes all existing limits. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
#limit cpu to one hour 
cpulimit 3600 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_3_1_5 wait

Syntax:
~~~~~
wait [nbseconds] 
~~~~~
Suspends execution for the number of seconds specified in *nbseconds*. The default value is ten (10) seconds. This is a useful command for a slide show. 

~~~~~
# You have ten seconds ... 
wait 
~~~~~

@subsubsection occt_draw_3_1_6 chrono

Syntax:                  

~~~~~
chrono [ name start/stop/reset/show/restart/[counter text]]
~~~~~

Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed. 

With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer. 
  * run the chronometer (start).
  * stop the chronometer (stop).
  * reset the chronometer to 0 (reset).
  * restart the chronometer (restart).
  * display the current time (show).
  * display the current time with specified text (output example - *COUNTER text: N*), command <i>testdiff</i> will compare such outputs between two test runs (counter).

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
chrono 
==Chronometers activated. 
ptorus t 20 5 
==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds 
==CPU user time: 0.01 seconds 
==CPU system time: 0 seconds 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsection occt_draw_3_2  Variable management commands

@subsubsection occt_draw_3_2_1 isdraw, directory

Syntax:                  
~~~~~
isdraw varname 
directory [pattern] 
~~~~~

**isdraw** tests to see if a variable is a Draw variable. **isdraw** will return 1 if there is a Draw value attached to the variable. 

Use **directory** to return a list of all Draw global variables matching a pattern. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
set a 1 
isdraw a 
=== 0 

dset a 1 
isdraw a 
=== 1 

circle c 0 0 1 0 5 
isdraw c 
=== 1 

# to destroy all Draw objects with name containing curve 
foreach var [directory *curve*] {unset $var} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@subsubsection occt_draw_3_2_2 whatis, dump

Syntax:

~~~~~
whatis varname [varname ...] 
dump varname [varname ...] 
~~~~~

**whatis** returns short information about a Draw variable. This is usually the type name. 

**dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
circle c 0 0 1 0 5 
whatis c 
c is a 2d curve 

dump c 

***** Dump of c ***** 
Circle 
Center :0, 0 
XAxis :1, 0 
YAxis :-0, 1 
Radius :5 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Note** The behavior of *whatis* on other variables (not Draw) is not excellent. 


@subsubsection occt_draw_3_2_3 renamevar, copy

Syntax:      
~~~~~
renamevar varname tovarname [varname tovarname ...] 
copy varname tovarname [varname tovarname ...] 
~~~~~

  * **renamevar** changes the name of a Draw variable. The original variable will no longer exist. Note that the content is not modified. Only the name is changed. 
  * **copy** creates a new variable with a copy of the content of an existing variable. The exact behavior of **copy** is type dependent; in the case of certain topological variables, the content may still be shared. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
circle c1 0 0 1 0 5 
renamevar c1 c2 

# curves are copied, c2 will not be modified 
copy c2 c3 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_3_2_4 datadir, save, restore

Syntax:
~~~~~
datadir [directory] 
save variable [filename] 
restore filename [variablename] 
~~~~~

  * **datadir** without arguments prints the path of the current data directory. 
  * **datadir** with an argument sets the data directory path. \

If the path starts with a dot (.) only the last directory name will be changed in the path. 

  * **save** writes a file in the data directory with the content of a variable. By default the name of the file is the name of the variable. To give a different name use a second argument. 
  * **restore** reads the content of a file in the data directory in a local variable. By default, the name of the variable is the name of the file. To give a different name, use a second argument. 

The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# note how TCL accesses shell environment variables 
# using $env() 
datadir 
==. 

datadir $env(WBCONTAINER)/data/default 
==/adv_20/BAG/data/default 

box b 10 20 30 
save b theBox 
==/adv_20/BAG/data/default/theBox 

# when TCL does not find a command it tries a shell command 
ls [datadir] 
== theBox 

restore theBox 
== theBox 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsection occt_draw_3_3 User defined commands

*DrawTrSurf* provides commands to create and display a Draw **geometric** variable from a *Geom_Geometry* object and also get a *Geom_Geometry* object from a Draw geometric variable name. 

*DBRep* provides commands to create and display a Draw **topological** variable from a *TopoDS_Shape* object and also get a *TopoDS_Shape* object from a Draw topological variable name. 

@subsubsection occt_draw_3_3_1 set

#### In *DrawTrSurf* package:

~~~~~
void Set(Standard_CString& Name,const gp_Pnt& G) ; 
void Set(Standard_CString& Name,const gp_Pnt2d& G) ; 
void Set(Standard_CString& Name, 
const Handle(Geom_Geometry)& G) ; 
void Set(Standard_CString& Name, 
const Handle(Geom2d_Curve)& C) ; 
void Set(Standard_CString& Name, 
const Handle(Poly_Triangulation)& T) ; 
void Set(Standard_CString& Name, 
const Handle(Poly_Polygon3D)& P) ; 
void Set(Standard_CString& Name, 
const Handle(Poly_Polygon2D)& P) ; 
~~~~~

#### In *DBRep* package:

~~~~~
void Set(const Standard_CString Name, 
const TopoDS_Shape& S) ; 
~~~~~

Example of *DrawTrSurf*

~~~~~
Handle(Geom2d_Circle) C1 = new Geom2d_Circle 
(gce_MakeCirc2d (gp_Pnt2d(50,0,) 25)); 
DrawTrSurf::Set(char*, C1); 
~~~~~

Example of *DBRep* 

~~~~~
TopoDS_Solid B; 
B = BRepPrimAPI_MakeBox (10,10,10); 
DBRep::Set(char*,B); 
~~~~~

@subsubsection occt_draw_3_3_2 get

#### In *DrawTrSurf* package:
 
~~~~~
Handle_Geom_Geometry Get(Standard_CString& Name) ; 
~~~~~

#### In *DBRep* package:

~~~~~
TopoDS_Shape Get(Standard_CString& Name, 
const TopAbs_ShapeEnum Typ = TopAbs_SHAPE, 
const Standard_Boolean Complain 
= Standard_True) ; 
~~~~~

Example of *DrawTrSurf*

~~~~~
Standard_Integer MyCommand 
(Draw_Interpretor& theCommands, 
Standard_Integer argc, char** argv) 
{...... 
// Creation of a Geom_Geometry from a Draw geometric 
// name 
Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]); 
} 
~~~~~

Example of *DBRep*

~~~~~
Standard_Integer MyCommand 
(Draw_Interpretor& theCommands, 
Standard_Integer argc, char** argv) 
{...... 
// Creation of a TopoDS_Shape from a Draw topological 
// name 
TopoDS_Solid B = DBRep::Get(argv[1]); 
} 
~~~~~

@section occt_draw_4 Graphic Commands

Graphic commands are used to manage the Draw graphic system. Draw provides a 2d and a 3d viewer with up to 30 views. Views are numbered and the index of the view is displayed in the window’s title. Objects are displayed in all 2d views or in all 3d views, depending on their type. 2d objects can only be viewed in 2d views while 3d objects -- only in 3d views correspondingly. 

@subsection occt_draw_4_1 Axonometric viewer

@subsubsection occt_draw_4_1_1 view, delete

Syntax:                  
~~~~~
view index type [X Y W H] 
delete [index] 
~~~~~

**view** is the basic view creation command: it creates a new view with the given index. If a view with this index already exits, it is deleted. The view is created with default parameters and X Y W H are the position and dimensions of the window on the screen. Default values are 0, 0, 500, 500. 

As a rule it is far simpler either to use the procedures **axo**, **top**, **left** or to click on the desired view type in the menu under *Views* in the task bar.. 

**delete** deletes a view. If no index is given, all the views are deleted. 

Type selects from the following range: 

  * *AXON* : Axonometric view
  * *PERS* : Perspective view
  * <i>+X+Y</i> : View on both axes (i.e. a top view), other codes are <i>-X+Y</i>, <i>+Y-Z</i>, etc.
  * <i>-2D-</i> : 2d view

The index, the type, the current zoom are displayed in the window title . 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# this is the content of the mu4 procedure 
proc mu4 {} { 
delete 
view 1 +X+Z 320 20 400 400 
view 2 +X+Y 320 450 400 400 
view 3 +Y+Z 728 20 400 400 
view 4 AXON 728 450 400 400 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview** 

@subsubsection occt_draw_4_1_2  axo, pers, top, ...

Syntax:      

~~~~~
axo 
pers 
... 
smallview type 
~~~~~

All these commands are procedures used to define standard screen layout. They delete all existing views and create new ones. The layout usually complies with the European convention, i.e. a top view is under a front view. 

  * **axo** creates a large window axonometric view;
  * **pers** creates a large window perspective view;
  * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
  * **mu4** creates four small window views: front, left, top and axo.
  * **v2d** creates a large window 2d view.
  * **av2d** creates two small window views, one 2d and one axo
  * **smallview** creates a view at the bottom right of the screen of the given type. 

See also: **view**, **delete** 

@subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom

Syntax:

~~~~~
    mu [index] value 
    2dmu [index] value 
    zoom [index] value 
    wzoom 
~~~~~

* **mu** (magnify up) increases the zoom in one or several views by a factor of 10%. 
* **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd** 
perform the same on one or all 2d views. 
* **zoom** and **2dzoom** set the zoom factor to a value specified by you. The current zoom factor is always displayed in the window’s title bar. Zoom 20 represents a full screen view in a large window; zoom 10, a full screen view in a small one. 
* **wzoom** (window zoom) allows you to select the area you want to zoom in on with the mouse. You will be prompted to give two of the corners of the area that you want to magnify and the rectangle so defined will occupy the window of the view. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
    # set a zoom of 2.5 
    zoom 2.5 

    # magnify by 10% 
    mu 1 

    # magnify by 20% 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See also: **fit**, **2dfit** 


@subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr

Syntax:                  

~~~~~
pu [index] 
pd [index] 
~~~~~

The <i>p_</i> commands are used to pan. **pu** and **pd** pan up and down respectively; **pl** and **pr** pan to the left and to the right respectively. Each time the view is displaced by 40 pixels. When no index is given, all views will pan in the direction specified. 
~~~~~
# you have selected one anonometric view
pu
# or
pu 1

# you have selected an mu4 view; the object in the third view will pan up
pu 3
~~~~~
See also: **fit**, **2dfit** 


@subsubsection occt_draw_4_1_5 fit, 2dfit

Syntax:      

~~~~~
fit [index] 
2dfit [index] 
~~~~~

**fit** computes the best zoom and pans on the content of the view. The content of the view will be centered and fit the whole window. 

When fitting all views a unique zoom is computed for all the views. All views are on the same scale. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# fit only view 1 
fit 1 
# fit all 2d views 
2dfit 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See also: **zoom**, **mu**, **pu** 


@subsubsection occt_draw_4_1_6 u, d, l, r

Syntax:      

~~~~~
u [index] 
d [index] 
l [index] 
r [index] 
~~~~~

**u**, **d**, **l**, **r** Rotate the object in view around its axis by five degrees up, down, left or right respectively. This command is restricted to axonometric and perspective views. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# rotate the view up 
u 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_1_7 focal, fu, fd

Syntax:                  
~~~~~
focal [f] 
fu [index] 
fd [index] 
~~~~~

* **focal** changes the vantage point in perspective views. A low f value increases the perspective effect; a high one give a perspective similar to that of an axonometric view. The default value is 500. 
* **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
pers 
repeat 10 fd 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Note**: Do not use a negative or null focal value. 

See also: **pers** 

@subsubsection occt_draw_4_1_8 color

Syntax: 

~~~~~
color index name 
~~~~~

**color** sets the color to a value. The index of the *color* is a value between 0 and 15. The name is an X window color name. The list of these can be found in the file *rgb.txt* in the X library directory. 

The default values are: 0 White, 1 Red, 2 Green, 3 Blue, 4 Cyan, 5 Gold, 6 Magenta, 7 Marron, 8 Orange, 9 Pink, 10 Salmon, 11 Violet, 12 Yellow, 13 Khaki, 14 Coral. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# change the value of blue 
color 3 "navy blue" 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


**Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc. 

@subsubsection occt_draw_4_1_9 dtext

Syntax:      
~~~~~
dtext [x y [z]] string 
~~~~~

**dtext** displays a string in all 3d or 2d views. If no coordinates are given, a graphic selection is required. If two coordinates are given, the text is created in a 2d view at the position specified. With 3 coordinates, the text is created in a 3d view. 

The coordinates are real space coordinates. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# mark the origins 
dtext 0 0 bebop 
dtext 0 0 0 bebop 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd

Syntax:      
~~~~~
hardcopy [index] 
hcolor index width gray 
xwd [index] filename 
~~~~~

* **hardcopy** creates a postcript file called a4.ps in the current directory. This file contains the postscript description of the view index, and will allow you to print the view. 
* **hcolor** lets you change the aspect of lines in the postscript file. It allows to specify a width and a gray level for one of the 16 colors. **width** is measured in points with default value as 1, **gray** is the gray level from 0 = black to 1 = white with default value as 0. All colors are bound to the default values at the beginning. 
* **xwd** creates an X window xwd file from an active view. By default, the index is set to1. To visualize an xwd file, use the unix command **xwud**. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# all blue lines (color 3) 
# will be half-width and gray 
hcolor 3 0.5 

# make a postscript file and print it 
hardcopy 
lpr a4.ps 

# make an xwd file and display it 
xwd theview 
xwud -in theview 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Note:** When more than one view is present, specify the index of the view. 

Only use a postscript printer to print postscript files. 

See also: **color** 


@subsubsection occt_draw_4_1_11 wclick, pick

Syntax:      
~~~~~
wclick 
pick index X Y Z b [nowait] 
~~~~~

**wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed. 

Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored. 
  * index: index of the view where the input was made.
  * X,Y,Z: 3d coordinates in real world.
  * b: b is the mouse button 1,2 or 3.

When there is an extra argument, its value is not used and the command does not wait for a click; the value of b may then be 0 if there has not been a click. 

This option is useful for tracking the pointer. 

**Note** that the results are stored in Draw numeric variables.

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# make a circle at mouse location 
pick index x y z b 
circle c x y z 0 0 1 1 0 0 0 30 

# make a dynamic circle at mouse location 
# stop when a button is clicked 
# (see the repaint command) 

dset b 0 
while {[dval b] == 0} { 
pick index x y z b nowait 
circle c x y z 0 0 1 1 0 0 0 30 
repaint 
} 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See also: **repaint** 


Draw provides commands to manage the display of objects. 
* **display**, **donly** are used to display, 
* **erase**, **clear**, **2dclear** to erase. 
* **autodisplay** command is used to check whether variables are displayed when created. 

The variable name "." (dot) has a special status in Draw. Any Draw command expecting a Draw object as argument can be passed a dot. The meaning of the dot is the following. 
  * If the dot is an input argument, a graphic selection will be made. Instead of getting the object from a variable, Draw will ask you to select an object in a view.
  * If the dot is an output argument, an unnamed object will be created. Of course this makes sense only for graphic objects: if you create an unnamed number you will not be able to access it. This feature is used when you want to create objects for display only.
  * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# OK use dot to dump an object on the screen 
dump . 

point . x y z 

#Not OK. display points on a curve c 
# with dot no variables are created 
for {set i 0} {$i <= 10} {incr i} { 
cvalue c $i/10 x y z 
point . x y z 
} 

# point p x y z 
# would have displayed only one point 
# because the precedent variable content is erased 

# point p$i x y z 
# is an other solution, creating variables 
# p0, p1, p2, .... 

# give a name to a graphic object 
renamevar . x 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@subsubsection occt_draw_4_1_12 autodisplay

Syntax:      

~~~~~
autodisplay [0/1] 
~~~~~

By default, Draw automatically displays any graphic object as soon as it is created. This behavior known as autodisplay can be removed with the command **autodisplay**. Without arguments, **autodisplay** toggles the autodisplay mode. The command always returns the current mode. 

When **autodisplay** is off, using the dot return argument is ineffective. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# c is displayed 
circle c 0 0 1 0 5 

# toggle the mode 
autodisplay 
== 0 
circle c 0 0 1 0 5 

# c is erased, but not displayed 
display c 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_1_13 display, donly

Syntax:      
~~~~~
display varname [varname ...] 
donly varname [varname ...] 
~~~~~

* **display** makes objects visible. 
* **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen. 

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
\# to see all objects 
foreach var [directory] {display $var} 

\# to select two objects and erase the other ones 
donly . . 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@subsubsection occt_draw_4_1_14 erase, clear, 2dclear

Syntax:      

~~~~~
erase [varname varname ...] 
clear 
2dclear 
~~~~~

**erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d. 

**clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to  **clear; 2dclear**.


**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
# erase eveerything with a name starting with c_ 
foreach var [directory c_*] {erase $var} 

# clear 2d views 
2dclear 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_1_14_1 disp, don, era

These commands have the same meaning as correspondingly display, donly and erase, but with the difference that they evaluate the arguments using glob pattern rules. For example, to display all objects with names d_1, d_2, d_3, etc. it is enouth to run the command:
~~~~~{.cpp}
disp d_*
~~~~~

@subsubsection occt_draw_4_1_15 repaint, dflush


Syntax:

~~~~~
repaint 
dflush 
~~~~~

* **repaint** forces repainting of views. 
* **dflush** flushes the graphic buffers. 

These commands are useful within loops or in scripts. 

When an object is modified or erased, the whole view must be repainted. To avoid doing this too many times, Draw sets up a flag and delays the repaint to the end of the command in which the new prompt is issued. In a script, you may want to display the result of a change immediately. If the flag is raised, **repaint** will repaint the views and clear the flag. 

Graphic operations are buffered by Draw (and also by the X system). Usually the buffer is flushed at the end of a command and before graphic selection. If you want to flush the buffer from inside a script, use the **dflush** command. 

See also: @ref occt_draw_4_1_11 "pick" command.  

@subsection occt_draw_4_2 AIS viewer -- view commands

@subsubsection occt_draw_4_2_1 vinit

Syntax:                  
~~~~~
vinit 
~~~~~
Creates a new View window with the specified *view_name*.
By default the view is created in the viewer and in the graphic driver shared with the active view.

~~~~
name = {driverName/viewerName/viewName | viewerName/viewName | viewName}
~~~~

If *driverName* is not specified the driver will be shared with the active view.
If *viewerName* is not specified the viewer will be shared with the active view.

@subsubsection occt_draw_4_2_2 vhelp

Syntax:
~~~~~
vhelp 
~~~~~
Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities. 

@subsubsection occt_draw_4_2_3 vtop

Syntax:
~~~~~
vtop 
~~~~~

Displays top view in the 3D viewer window. Orientation +X+Y.

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
vinit 
box b 10 10 10 
vdisplay b 
vfit 
vtop 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_2_4 vaxo

Syntax:                  
~~~~~
vaxo 
~~~~~

Displays axonometric view in the 3D viewer window. Orientation +X-Y+Z.

**Example:** 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
vinit 
box b 10 10 10 
vdisplay b 
vfit 
vaxo 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@subsubsection occt_draw_4_2_5 vsetbg

Syntax:                  
~~~~~
vsetbg imagefile [filltype] 
~~~~~

Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH. 

**Example:** 
~~~~~
vinit 
vsetbg myimage.brep CENTERED 
~~~~~

@subsubsection occt_draw_4_2_6 vclear

Syntax:                  
~~~~~
vclear 
~~~~~
Removes all objects from the viewer. 

@subsubsection occt_draw_4_2_7 vrepaint

Syntax:                  
~~~~~
vrepaint 
~~~~~
Forcibly redisplays the shape in the 3D viewer window. 

@subsubsection occt_draw_4_2_8 vfit

Syntax:                  
~~~~~
vfit 
~~~~~
Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface. 

@subsubsection occt_draw_4_2_9 vzfit

Syntax:                  
~~~~~
vzfit 
~~~~~

Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space. 

@subsubsection occt_draw_4_2_10  vreadpixel

Syntax:     
~~~~~
vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name] 
~~~~~
Read pixel value for active view.


@subsubsection occt_draw_4_2_11  vselect

Syntax:     
~~~~~
vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [-allowoverlap 0|1] [shift_selection = 0|1]
~~~~~

Emulates different types of selection:

  * single mouse click selection
  * selection with a rectangle having the upper left and bottom right corners in <i>(x1,y1)</i> and <i>(x2,y2)</i> respectively
  * selection with a polygon having the corners in pixel positions <i>(x1,y1), (x2,y2),…, (xn,yn)</i>
  * <i> -allowoverlap </i> manages overlap and inclusion detection in rectangular selection. If the flag is set to 1, both sensitives that were included completely and overlapped partially by defined rectangle will be detected, otherwise algorithm will chose only fully included sensitives. Default behavior is to detect only full inclusion.
  * any of these selections if shift_selection is set to 1.

@subsubsection occt_draw_4_2_12  vmoveto

Syntax:     

~~~~~
vmoveto x y
~~~~~
Emulates cursor movement to pixel position (x,y).

@subsubsection occt_draw_4_2_13  vviewparams

Syntax:     
~~~~~
vviewparams [-scale [s]] [-eye [x y z]] [-at [x y z]] [-up [x y z]] [-proj [x y z]] [-center x y] [-size sx]
~~~~~
Gets or sets the current view parameters.
* If called without arguments, all view parameters are printed.
* The options are:
*   -scale [s]    : prints or sets the relative scale of viewport.
*   -eye [x y z]  : prints or sets the eye location.
*   -at [x y z]   : prints or sets the view center.
*   -up [x y z]   : prints or sets the up vector direction.
*   -proj [x y z] : prints or sets the view direction.
*   -center x y   : sets the screen center location in pixels.
*   -size [sx]    : prints viewport projection width and height sizes or changes the size of its maximum dimension.

@subsubsection occt_draw_4_2_14  vchangeselected

Syntax:     
~~~~~
vchangeselected shape
~~~~~
Adds a shape to selection or removes one from it.

@subsubsection occt_draw_4_2_15  vzclipping

Syntax:     
~~~~~
vzclipping [mode] [depth width]
~~~~~
Gets or sets ZClipping mode, width and depth, where
 - *mode = OFF|BACK|FRONT|SLICE*
 - *depth* is a real value from segment [0,1]
 - *width* is a real value from segment [0,1]

@subsubsection occt_draw_4_2_16  vnbselected

Syntax:     
~~~~~
vnbselected
~~~~~
Returns the number of selected objects in the interactive context.

@subsubsection occt_draw_4_2_18  vpurgedisplay

Syntax:     
~~~~~
vpurgedisplay [CollectorToo = 0|1]
~~~~~
Removes structures which do not belong to objects displayed in neutral point.

@subsubsection occt_draw_4_2_19  vhlr

Syntax:     
~~~~~
vhlr is_enabled={on|off} [show_hidden={1|0}]
~~~~~
Hidden line removal algorithm:
 * <i>is_enabled</i> applies HLR algorithm.
 * <i>show_hidden</i> if equals to 1, hidden lines are drawn as dotted ones.

@subsubsection occt_draw_4_2_20  vhlrtype

Syntax:     
~~~~~
vhlrtype  algo_type={algo|polyalgo} [shape_1 ... shape_n]
~~~~~

Changes the type of HLR algorithm used for shapes.
If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes. 

If no shape is specified through the command arguments, the given HLR algorithm_type is applied to all *AIS_Shape* isntances in the current context, and the command also changes the default HLR algorithm type.

**Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.

@subsubsection occt_draw_4_2_21 vcamera

Syntax:
~~~~~
vcamera [-ortho] [-projtype]
        [-persp]
        [-fovy   [Angle]] [-distance [Distance]]
        [-stereo] [-leftEye] [-rightEye]
        [-iod [Distance]] [-iodType    [absolute|relative]]
        [-zfocus [Value]] [-zfocusType [absolute|relative]]
~~~~~

Manages camera parameters.
Prints the current value when the option is called without argument.

Orthographic camera:
 * -ortho -- activates orthographic projection.
 
Perspective camera:
 * -persp -- activated perspective  projection (mono);
 * -fovy  -- field of view in y axis, in degrees;
 * -distance -- distance of eye from the camera center.
 
Stereoscopic camera:
 * -stereo -- perspective  projection (stereo);
 * -leftEye -- perspective  projection (left  eye);
 * -rightEye -- perspective  projection (right eye);
 * -iod -- intraocular distance value;
 * -iodType -- distance type, absolute or relative;
 * -zfocus -- stereographic focus value;
 * -zfocusType -- focus type, absolute or relative.

**Example:**
~~~~~
vinit
box b 10 10 10
vdisplay b
vfit
vcamera -persp
~~~~~

@subsubsection occt_draw_4_2_22 vstereo

Syntax:
~~~~~
vstereo [0|1] [-mode Mode] [-reverse {0|1}] [-anaglyph Filter]
~~~~~

Defines the stereo output mode. The following modes are available:
 * quadBuffer -- OpenGL QuadBuffer stereo, requires driver support. Should be called BEFORE *vinit*!
 * anaglyph         -- Anaglyph glasses;
 * rowInterlaced    -- row-interlaced display;
 * columnInterlaced -- column-interlaced display;
 * chessBoard       -- chess-board output;
 * sideBySide       -- horizontal pair;
 * overUnder        -- vertical pair;
Available Anaglyph filters for -anaglyph:
 * redCyan, redCyanSimple, yellowBlue, yellowBlueSimple, greenMagentaSimple.

**Example:**
~~~~~
vinit
box b 10 10 10
vdisplay b
vstereo 1
vfit
vcamera -stereo -iod 1
vcamera -lefteye
vcamera -righteye
~~~~~

@subsubsection occt_draw_4_2_23 vfrustumculling

Syntax:
~~~~~
vfrustumculling [toEnable]
~~~~~

Enables/disables objects clipping.


@subsection occt_draw_4_3 AIS viewer -- display commands

@subsubsection occt_draw_4_3_1 vdisplay

Syntax: 
~~~~~                 
vdisplay [-noupdate|-update] [-local] [-mutable] [-neutral]
         [-trsfPers {pan|zoom|rotate|trihedron|full|none}=none] [-trsfPersPos X Y [Z]] [-3d|-2d|-2dTopDown]
         [-dispMode mode] [-highMode mode]
         [-layer index] [-top|-topmost|-overlay|-underlay]
         [-redisplay]
         name1 [name2] ... [name n]
~~~~~

Displays named objects.
Option <i>-local</i> enables display of objects in the local selection context.
Local selection context will be opened if there is not any.

* *noupdate* suppresses viewer redraw call.
* *mutable* enables optimization for mutable objects.
* *neutral* draws objects in the main viewer.
* *layer* sets z-layer for objects. It can use <i>-overlay|-underlay|-top|-topmost</i> instead of <i>-layer index</i> for the default z-layers.
* *top* draws objects on top of main presentations but below the topmost level.
* *topmost* draws in overlay for 3D presentations with independent Depth.
* *overlay* draws objects in overlay for 2D presentations (On-Screen-Display).
* *underlay* draws objects in underlay for 2D presentations (On-Screen-Display).
* *selectable|-noselect* controls selection of objects.
* *trsfPers* sets transform persistence flags. Flag *full* allows to pan, zoom and rotate.
* *trsfPersPos* sets an anchor point for transform persistence.
* *2d|-2dTopDown* displays object in screen coordinates.
* *dispmode* sets display mode for objects.
* *highmode* sets highlight mode for objects.
* *redisplay* recomputes presentation of objects.

**Example:** 
~~~~~ 
vinit 
box b 40 40 40 10 10 10 
psphere s 20 
vdisplay s b 
vfit 
~~~~~ 

@subsubsection occt_draw_4_3_2 vdonly

Syntax:                  
~~~~~
vdonly [-noupdate|-update] [name1] ...  [name n]
~~~~~ 

Displays only selected or named objects. If there are no selected or named objects, nothing is done. 

**Example:** 
~~~~~ 
vinit 
box b 40 40 40 10 10 10 
psphere s 20 
vdonly b 
vfit
~~~~~ 
 
@subsubsection occt_draw_4_3_3 vdisplayall

Syntax:                  
~~~~~ 
vdisplayall [-local]
~~~~~ 

Displays all erased interactive objects (see vdir and vstate).
Option <i>-local</i> enables displaying objects in the local selection context.

**Example:** 
~~~~~ 
vinit 
box b 40 40 40 10 10 10 
psphere s 20 
vdisplayall 
vfit 
~~~~~ 

@subsubsection occt_draw_4_3_4 verase

Syntax:                  
~~~~~
verase [name1] [name2] … [name n]
~~~~~ 

Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased. 

**Example:** 
~~~~~
vinit 
box b1 40 40 40 10 10 10 
box b2 -40 -40 -40 10 10 10 
psphere s 20 
vdisplayall 
vfit 
# erase only first box 
verase b1 
# erase second box and sphere 
verase
~~~~~ 

@subsubsection occt_draw_4_3_5 veraseall

Syntax:                  
~~~~~
veraseall
~~~~~ 

Erases all objects displayed in the viewer. 

**Example:**
~~~~~ 
vinit 
box b1 40 40 40 10 10 10 
box b2 -40 -40 -40 10 10 10 
psphere s 20 
vdisplayall 
vfit 
# erase only first box 
verase b1 
# erase second box and sphere 
verseall
~~~~~ 

@subsubsection occt_draw_4_3_6 vsetdispmode

Syntax:                  
~~~~~
vsetdispmode [name] mode(0,1,2,3)
~~~~~ 

Sets display mode for all, selected or named objects. 
* *0* (*WireFrame*), 
* *1* (*Shading*), 
* *2* (*Quick HideLineremoval*), 
* *3* (*Exact HideLineremoval*). 

**Example:** 
~~~~~
vinit 
box b 10 10 10 
vdisplay b 
vsetdispmode 1 
vfit
~~~~~
 
@subsubsection occt_draw_4_3_7 vdisplaytype

Syntax:                  
~~~~~
vdisplaytype type
~~~~~ 

Displays all objects of a given type. 
The following types are possible: *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*. 

@subsubsection occt_draw_4_3_8 verasetype

Syntax:                  
~~~~~
verasetype type
~~~~~ 

Erases all objects of a given type. 
Possible type is *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*. 

@subsubsection occt_draw_4_3_9 vtypes

Syntax:                  
~~~~~
vtypes
~~~~~ 

Makes a list of known types and signatures in AIS. 

@subsubsection occt_draw_4_3_10 vaspects

Syntax:
~~~~~
vaspects [-noupdate|-update] [name1 [name2 [...]] | -defaults]
         [-setVisibility 0|1]
         [-setColor ColorName] [-setcolor R G B] [-unsetColor]
         [-setMaterial MatName] [-unsetMaterial]
         [-setTransparency Transp] [-unsetTransparency]
         [-setWidth LineWidth] [-unsetWidth]
         [-setLineType {solid|dash|dot|dotDash}] [-unsetLineType]
         [-freeBoundary {off/on | 0/1}]
         [-setFreeBoundaryWidth Width] [-unsetFreeBoundaryWidth]
         [-setFreeBoundaryColor {ColorName | R G B}] [-unsetFreeBoundaryColor]
         [-subshapes subname1 [subname2 [...]]]
         [-isoontriangulation 0|1]
         [-setMaxParamValue {value}]

~~~~~

Manages presentation properties of all, selected or named objects.
* *-subshapes* -- assigns presentation properties to the specified sub-shapes.
* *-defaults* -- assigns presentation properties to all objects that do not have their own specified properties and to all objects to be displayed in the future.
If *-defaults* option is used there should not be any names of objects and *-subshapes* specifier.

Aliases:
~~~~~
vsetcolor [-noupdate|-update] [name] ColorName

~~~~~


Manages presentation properties (color, material, transparency) of all objects, selected or named.

**Color**. The *ColorName* can be: *BLACK*, *MATRAGRAY*, *MATRABLUE*, *ALICEBLUE*, *ANTIQUEWHITE*, *ANTIQUEWHITE1*, *ANTIQUEWHITE2*, *ANTIQUEWHITE3*, *ANTIQUEWHITE4*, *AQUAMARINE1*, *AQUAMARINE2*, *AQUAMARINE4*, *AZURE*, *AZURE2*, *AZURE3*, *AZURE4*, *BEIGE*, *BISQUE*, *BISQUE2*, *BISQUE3*, *BISQUE4*, *BLANCHEDALMOND*, *BLUE1*, *BLUE2*, *BLUE3*, *BLUE4*, *BLUEVIOLET*, *BROWN*, *BROWN1*, *BROWN2*, *BROWN3*, *BROWN4*, *BURLYWOOD*, *BURLYWOOD1*, *BURLYWOOD2*, *BURLYWOOD3*, *BURLYWOOD4*, *CADETBLUE*, *CADETBLUE1*, *CADETBLUE2*, *CADETBLUE3*, *CADETBLUE4*, *CHARTREUSE*, *CHARTREUSE1*, *CHARTREUSE2*, *CHARTREUSE3*, *CHARTREUSE4*, *CHOCOLATE*, *CHOCOLATE1*, *CHOCOLATE2*, *CHOCOLATE3*, *CHOCOLATE4*, *CORAL*, *CORAL1*, *CORAL2*, *CORAL3*, *CORAL4*, *CORNFLOWERBLUE*, *CORNSILK1*, *CORNSILK2*, *CORNSILK3*, *CORNSILK4*, *CYAN1*, *CYAN2*, *CYAN3*, *CYAN4*, *DARKGOLDENROD*, *DARKGOLDENROD1*, *DARKGOLDENROD2*, *DARKGOLDENROD3*, *DARKGOLDENROD4*, *DARKGREEN*, *DARKKHAKI*, *DARKOLIVEGREEN*, *DARKOLIVEGREEN1*, *DARKOLIVEGREEN2*, *DARKOLIVEGREEN3*, *DARKOLIVEGREEN4*, *DARKORANGE*, *DARKORANGE1*, *DARKORANGE2*, *DARKORANGE3*, *DARKORANGE4*, *DARKORCHID*, *DARKORCHID1*, *DARKORCHID2*, *DARKORCHID3*, *DARKORCHID4*, *DARKSALMON*, *DARKSEAGREEN*, *DARKSEAGREEN1*, *DARKSEAGREEN2*, *DARKSEAGREEN3*, *DARKSEAGREEN4*, *DARKSLATEBLUE*, *DARKSLATEGRAY1*, *DARKSLATEGRAY2*, *DARKSLATEGRAY3*, *DARKSLATEGRAY4*, *DARKSLATEGRAY*, *DARKTURQUOISE*, *DARKVIOLET*, *DEEPPINK*, *DEEPPINK2*, *DEEPPINK3*, *DEEPPINK4*, *DEEPSKYBLUE1*, *DEEPSKYBLUE2*, *DEEPSKYBLUE3*, *DEEPSKYBLUE4*, *DODGERBLUE1*, *DODGERBLUE2*, *DODGERBLUE3*, *DODGERBLUE4*, *FIREBRICK*, *FIREBRICK1*, *FIREBRICK2*, *FIREBRICK3*, *FIREBRICK4*, *FLORALWHITE*, *FORESTGREEN*, *GAINSBORO*, *GHOSTWHITE*, *GOLD*, *GOLD1*, *GOLD2*, *GOLD3*, *GOLD4*, *GOLDENROD*, *GOLDENROD1*, *GOLDENROD2*, *GOLDENROD3*, *GOLDENROD4*, *GRAY*, *GRAY0*, *GRAY1*, *GRAY10*, *GRAY11*, *GRAY12*, *GRAY13*, *GRAY14*, *GRAY15*, *GRAY16*, *GRAY17*, *GRAY18*, *GRAY19*, *GRAY2*, *GRAY20*, *GRAY21*, *GRAY22*, *GRAY23*, *GRAY24*, *GRAY25*, *GRAY26*, *GRAY27*, *GRAY28*, *GRAY29*, *GRAY3*, *GRAY30*, *GRAY31*, *GRAY32*, *GRAY33*, *GRAY34*, *GRAY35*, *GRAY36*, *GRAY37*, *GRAY38*, *GRAY39*, *GRAY4*, *GRAY40*, *GRAY41*, *GRAY42*, *GRAY43*, *GRAY44*, *GRAY45*, *GRAY46*, *GRAY47*, *GRAY48*, *GRAY49*, *GRAY5*, *GRAY50*, *GRAY51*, *GRAY52*, *GRAY53*, *GRAY54*, *GRAY55*, *GRAY56*, *GRAY57*, *GRAY58*, *GRAY59*, *GRAY6*, *GRAY60*, *GRAY61*, *GRAY62*, *GRAY63*, *GRAY64*, *GRAY65*, *GRAY66*, *GRAY67*, *GRAY68*, *GRAY69*, *GRAY7*, *GRAY70*, *GRAY71*, *GRAY72*, *GRAY73*, *GRAY74*, *GRAY75*, *GRAY76*, *GRAY77*, *GRAY78*, *GRAY79*, *GRAY8*, *GRAY80*, *GRAY81*, *GRAY82*, *GRAY83*, *GRAY85*, *GRAY86*, *GRAY87*, *GRAY88*, *GRAY89*, *GRAY9*, *GRAY90*, *GRAY91*, *GRAY92*, *GRAY93*, *GRAY94*, *GRAY95*, *GREEN*, *GREEN1*, *GREEN2*, *GREEN3*, *GREEN4*, *GREENYELLOW*, *GRAY97*, *GRAY98*, *GRAY99*, *HONEYDEW*, *HONEYDEW2*, *HONEYDEW3*, *HONEYDEW4*, *HOTPINK*, *HOTPINK1*, *HOTPINK2*, *HOTPINK3*, *HOTPINK4*, *INDIANRED*, *INDIANRED1*, *INDIANRED2*, *INDIANRED3*, *INDIANRED4*, *IVORY*, *IVORY2*, *IVORY3*, *IVORY4*, *KHAKI*, *KHAKI1*, *KHAKI2*, *KHAKI3*, *KHAKI4*, *LAVENDER*, *LAVENDERBLUSH1*, *LAVENDERBLUSH2*, *LAVENDERBLUSH3*, *LAVENDERBLUSH4*, *LAWNGREEN*, *LEMONCHIFFON1*, *LEMONCHIFFON2*, *LEMONCHIFFON3*, *LEMONCHIFFON4*, *LIGHTBLUE*, *LIGHTBLUE1*, *LIGHTBLUE2*, *LIGHTBLUE3*, *LIGHTBLUE4*, *LIGHTCORAL*, *LIGHTCYAN1*, *LIGHTCYAN2*, *LIGHTCYAN3*, *LIGHTCYAN4*, *LIGHTGOLDENROD*, *LIGHTGOLDENROD1*, *LIGHTGOLDENROD2*, *LIGHTGOLDENROD3*, *LIGHTGOLDENROD4*, *LIGHTGOLDENRODYELLOW*, *LIGHTGRAY*, *LIGHTPINK*, *LIGHTPINK1*, *LIGHTPINK2*, *LIGHTPINK3*, *LIGHTPINK4*, *LIGHTSALMON1*, *LIGHTSALMON2*, *LIGHTSALMON3*, *LIGHTSALMON4*, *LIGHTSEAGREEN*, *LIGHTSKYBLUE*, *LIGHTSKYBLUE1*, *LIGHTSKYBLUE2*, *LIGHTSKYBLUE3*, *LIGHTSKYBLUE4*, *LIGHTSLATEBLUE*, *LIGHTSLATEGRAY*, *LIGHTSTEELBLUE*, *LIGHTSTEELBLUE1*, *LIGHTSTEELBLUE2*, *LIGHTSTEELBLUE3*, *LIGHTSTEELBLUE4*, *LIGHTYELLOW*, *LIGHTYELLOW2*, *LIGHTYELLOW3*, *LIGHTYELLOW4*, *LIMEGREEN*, *LINEN*, *MAGENTA1*, *MAGENTA2*, *MAGENTA3*, *MAGENTA4*, *MAROON*, *MAROON1*, *MAROON2*, *MAROON3*, *MAROON4*, *MEDIUMAQUAMARINE*, *MEDIUMORCHID*, *MEDIUMORCHID1*, *MEDIUMORCHID2*, *MEDIUMORCHID3*, *MEDIUMORCHID4*, *MEDIUMPURPLE*, *MEDIUMPURPLE1*, *MEDIUMPURPLE2*, *MEDIUMPURPLE3*, *MEDIUMPURPLE4*, *MEDIUMSEAGREEN*, *MEDIUMSLATEBLUE*, *MEDIUMSPRINGGREEN*, *MEDIUMTURQUOISE*, *MEDIUMVIOLETRED*, *MIDNIGHTBLUE*, *MINTCREAM*, *MISTYROSE*, *MISTYROSE2*, *MISTYROSE3*, *MISTYROSE4*, *MOCCASIN*, *NAVAJOWHITE1*, *NAVAJOWHITE2*, *NAVAJOWHITE3*, *NAVAJOWHITE4*, *NAVYBLUE*, *OLDLACE*, *OLIVEDRAB*, *OLIVEDRAB1*, *OLIVEDRAB2*, *OLIVEDRAB3*, *OLIVEDRAB4*, *ORANGE*, *ORANGE1*, *ORANGE2*, *ORANGE3*, *ORANGE4*, *ORANGERED*, *ORANGERED1*, *ORANGERED2*, *ORANGERED3*, *ORANGERED4*, *ORCHID*, *ORCHID1*, *ORCHID2*, *ORCHID3*, *ORCHID4*, *PALEGOLDENROD*, *PALEGREEN*, *PALEGREEN1*, *PALEGREEN2*, *PALEGREEN3*, *PALEGREEN4*, *PALETURQUOISE*, *PALETURQUOISE1*, *PALETURQUOISE2*, *PALETURQUOISE3*, *PALETURQUOISE4*, *PALEVIOLETRED*, *PALEVIOLETRED1*, *PALEVIOLETRED2*, *PALEVIOLETRED3*, *PALEVIOLETRED4*, *PAPAYAWHIP*, *PEACHPUFF*, *PEACHPUFF2*, *PEACHPUFF3*, *PEACHPUFF4*, *PERU*, *PINK*, *PINK1*, *PINK2*, *PINK3*, *PINK4*, *PLUM*, *PLUM1*, *PLUM2*, *PLUM3*, *PLUM4*, *POWDERBLUE*, *PURPLE*, *PURPLE1*, *PURPLE2*, *PURPLE3*, *PURPLE4*, *RED*, *RED1*, *RED2*, *RED3*, *RED4*, *ROSYBROWN*, *ROSYBROWN1*, *ROSYBROWN2*, *ROSYBROWN3*, *ROSYBROWN4*, *ROYALBLUE*, *ROYALBLUE1*, *ROYALBLUE2*, *ROYALBLUE3*, *ROYALBLUE4*, *SADDLEBROWN*, *SALMON*, *SALMON1*, *SALMON2*, *SALMON3*, *SALMON4*, *SANDYBROWN*, *SEAGREEN*, *SEAGREEN1*, *SEAGREEN2*, *SEAGREEN3*, *SEAGREEN4*, *SEASHELL*, *SEASHELL2*, *SEASHELL3*, *SEASHELL4*, *BEET*, *TEAL*, *SIENNA*, *SIENNA1*, *SIENNA2*, *SIENNA3*, *SIENNA4*, *SKYBLUE*, *SKYBLUE1*, *SKYBLUE2*, *SKYBLUE3*, *SKYBLUE4*, *SLATEBLUE*, *SLATEBLUE1*, *SLATEBLUE2*, *SLATEBLUE3*, *SLATEBLUE4*, *SLATEGRAY1*, *SLATEGRAY2*, *SLATEGRAY3*, *SLATEGRAY4*, *SLATEGRAY*, *SNOW*, *SNOW2*, *SNOW3*, *SNOW4*, *SPRINGGREEN*, *SPRINGGREEN2*, *SPRINGGREEN3*, *SPRINGGREEN4*, *STEELBLUE*, *STEELBLUE1*, *STEELBLUE2*, *STEELBLUE3*, *STEELBLUE4*, *TAN*, *TAN1*, *TAN2*, *TAN3*, *TAN4*, *THISTLE*, *THISTLE1*, *THISTLE2*, *THISTLE3*, *THISTLE4*, *TOMATO*, *TOMATO1*, *TOMATO2*, *TOMATO3*, *TOMATO4*, *TURQUOISE*, *TURQUOISE1*, *TURQUOISE2*, *TURQUOISE3*, *TURQUOISE4*, *VIOLET*, *VIOLETRED*, *VIOLETRED1*, *VIOLETRED2*, *VIOLETRED3*, *VIOLETRED4*, *WHEAT*, *WHEAT1*, *WHEAT2*, *WHEAT3*, *WHEAT4*, *WHITE*, *WHITESMOKE*, *YELLOW*, *YELLOW1*, *YELLOW2*, *YELLOW3*, *YELLOW4* and *YELLOWGREEN*.
~~~~~
vaspects    [name] [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]
vsetcolor   [name] ColorName
vunsetcolor [name]
~~~~~

**Transparency. The *Transp* may be between 0.0 (opaque) and 1.0 (fully transparent).
**Warning**: at 1.0 the shape becomes invisible.
~~~~~
vaspects           [name] [-settransparency Transp] [-unsettransparency]
vsettransparency   [name] Transp
vunsettransparency [name]
~~~~~

**Material**. The *MatName* can be *BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*, *WATER*, *GLASS*, *DIAMOND* or *CHARCOAL*.
~~~~~
vaspects       [name] [-setmaterial MatName] [-unsetmaterial]
vsetmaterial   [name] MatName
vunsetmaterial [name]
~~~~~

**Line width**. Specifies width of the edges. The *LineWidth* may be between 0.0 and 10.0.
~~~~~
vaspects    [name] [-setwidth LineWidth] [-unsetwidth]
vsetwidth   [name] LineWidth
vunsetwidth [name]
~~~~~

**Example:**
~~~~~
vinit
box b 10 10 10
vdisplay b
vfit

vsetdispmode b 1
vaspects -setcolor red -settransparency 0.2
vrotate 10 10 10
~~~~~






@subsubsection occt_draw_4_3_11 vsetshading

Syntax:                  
~~~~~
vsetshading shapename [coefficient]
~~~~~ 

Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008. 

**Example:** 
~~~~~
vinit 
psphere s 20 
vdisplay s 
vfit 
vsetdispmode 1 
vsetshading s 0.005
~~~~~
 
@subsubsection occt_draw_4_3_12 vunsetshading

Syntax:                  
~~~~~
vunsetshading [shapename]
~~~~~ 

Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode.

@subsubsection occt_draw_4_3_13 vsetam

Syntax:                  
~~~~~
vsetam [shapename] mode
~~~~~ 

Activates selection mode for all selected or named shapes: 
* *0* for *shape* itself, 
* *1* (*vertices*), 
* *2* (*edges*), 
* *3* (*wires*), 
* *4* (*faces*), 
* *5* (*shells*),
* *6* (*solids*),
* *7* (*compounds*).
 
**Example:** 
~~~~~
vinit 
box b 10 10 10 
vdisplay b 
vfit 
vsetam b 2
~~~~~
 
@subsubsection occt_draw_4_3_14 vunsetam

Syntax:                  
~~~~~
vunsetam
~~~~~ 

Deactivates all selection modes for all shapes. 

@subsubsection occt_draw_4_3_15 vdump

Syntax:                  
~~~~~
vdump <filename>.{png|bmp|jpg|gif} [-width Width -height Height]
      [-buffer rgb|rgba|depth=rgb]
      [-stereo mono|left|right|blend|sideBySide|overUnder=mono]

~~~~~ 

Extracts the contents of the viewer window to a image file.

@subsubsection occt_draw_4_3_16 vdir

Syntax:                  
~~~~~
vdir
~~~~~ 

Displays the list of displayed objects. 

@subsubsection occt_draw_4_3_17 vsub

Syntax:                  
~~~~~
vsub 0/1(on/off)[shapename]
~~~~~ 

Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
 
**Example:** 
~~~~~
vinit 
box b 10 10 10 
psphere s 20 
vdisplay b s 
vfit 
vsetdispmode 1 
vsub b 1
~~~~~ 

@subsubsection occt_draw_4_3_20 vsensdis

Syntax:                  
~~~~~
vsensdis
~~~~~ 

Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes). 

Standard entity types are those defined in Select3D package: 
  * sensitive box
  * sensitive face
  * sensitive curve
  * sensitive segment
  * sensitive circle
  * sensitive point
  * sensitive triangulation
  * sensitive triangle
Custom (application-defined) sensitive entity types are not processed by this command. 

@subsubsection occt_draw_4_3_21 vsensera

Syntax:                  
~~~~~
vsensera
~~~~~ 

Erases active entities. 

@subsubsection occt_draw_4_3_23 vr

Syntax:                  
~~~~~
vr filename
~~~~~ 

Reads shape from BREP-format file and displays it in the viewer. 

**Example:** 
~~~~~
vinit 
vr myshape.brep
~~~~~
 
@subsubsection occt_draw_4_3_24 vstate

Syntax:                  
~~~~~
vstate [-entities] [-hasSelected] [name1] ... [nameN]
~~~~~ 

Reports show/hidden state for selected or named objects:
 * *entities* -- prints low-level information about detected entities;
 * *hasSelected* -- prints 1 if the context has a selected shape and 0 otherwise.

@subsubsection occt_draw_4_3_25 vraytrace

Syntax:
~~~~~
vraytrace [0/1]
~~~~~

Turns on/off ray tracing renderer.

@subsubsection occt_draw_4_3_26 vrenderparams

Syntax:
~~~~~
vrenderparams [-rayTrace|-raster] [-rayDepth 0..10] [-shadows {on|off}]
              [-reflections {on|off}] [-fsaa {on|off}] [-gleam {on|off}]
              [-gi {on|off}] [-brng {on|off}] [-env {on|off}]
              [-shadin {color|flat|gouraud|phong}]
~~~~~

Manages rendering parameters:
* rayTrace     -- Enables  GPU ray-tracing
* raster       -- Disables GPU ray-tracing
* rayDepth     -- Defines maximum ray-tracing depth
* shadows      -- Enables/disables shadows rendering
* reflections  -- Enables/disables specular reflections
* fsaa         -- Enables/disables adaptive anti-aliasing
* gleam        -- Enables/disables transparency shadow effects
* gi           -- Enables/disables global illumination effects
* brng         -- Enables/disables blocked RNG (fast coherent PT)
* env          -- Enables/disables environment map background
* shadingModel -- Controls shading model from enumeration color, flat, gouraud, phong

Unlike *vcaps*, these parameters dramatically change visual properties.
The command is intended to control presentation quality depending on hardware capabilities and performance.

**Example:**
~~~~~
vinit
box b 10 10 10
vdisplay b
vfit
vraytrace 1
vrenderparams -shadows 1 -reflections 1 -fsaa 1
~~~~~
@subsubsection occt_draw_4_3_27 vshaderprog

Syntax:
~~~~~
   'vshaderprog [name] pathToVertexShader pathToFragmentShader'
or 'vshaderprog [name] off'   to disable GLSL program
or 'vshaderprog [name] phong' to enable per-pixel lighting calculations
~~~~~

Enables rendering using a shader program.

@subsubsection occt_draw_4_3_28 vsetcolorbg

Syntax:
~~~~~
vsetcolorbg r g b
~~~~~

Sets background color.

**Example:**
~~~~~
vinit
vsetcolorbg 200 0 200
~~~~~

@subsection occt_draw_4_4 AIS viewer -- object commands

@subsubsection occt_draw_4_4_1 vtrihedron

Syntax:                  
~~~~~
vtrihedron name [-dispMode {wf|sh|wireframe|shading}]
                [-origin x y z ]
                [-zaxis u v w -xaxis u v w ]
                [-drawaxes {X|Y|Z|XY|YZ|XZ|XYZ}]
                [-hidelabels {on|off}]"
                [-label {XAxis|YAxis|ZAxis} value]"
                [-attribute {XAxisLength|YAxisLength|ZAxisLength
                                        |TubeRadiusPercent|ConeRadiusPercent"
                                        |ConeLengthPercent|OriginRadiusPercent"
                                        |ShadingNumberOfFacettes} value]"
                [-color {Origin|XAxis|YAxis|ZAxis|XOYAxis|YOZAxis"
                                        |XOZAxis|Whole} {r g b | colorName}]"
                [-textcolor {r g b | colorName}]"
                [-arrowscolor {r g b | colorName}]"
                [-priority {Origin|XAxis|YAxis|ZAxis|XArrow"
                                        |YArrow|ZArrow|XOYAxis|YOZAxis"
                                        |XOZAxis|Whole} value]

~~~~~ 

Creates a new *AIS_Trihedron* object or changes existing trihedron. If no argument is set, the default trihedron (0XYZ) is created.

**Example:** 
~~~~~
vinit 
vtrihedron tr1

vtrihedron t2 -dispmode shading -origin -200 -200 -300
vtrihedron t2 -color XAxis Quantity_NOC_RED
vtrihedron t2 -color YAxis Quantity_NOC_GREEN
vtrihedron t2 -color ZAxis|Origin Quantity_NOC_BLUE1
~~~~~ 

@subsubsection occt_draw_4_4_2 vplanetri

Syntax:                  
~~~~~
vplanetri name
~~~~~ 

Creates a plane from a trihedron selection. If no arguments are set, the default plane is created. 


@subsubsection occt_draw_4_4_3 vsize

Syntax:                  
~~~~~
vsize [name] [size]
~~~~~ 

Changes the size of a named or selected trihedron. If the name is not defined: it affects the selected trihedrons otherwise nothing is done. If the value is not defined, it is set to 100 by default.
 
**Example:** 
~~~~~
vinit 
vtrihedron tr1 
vtrihedron tr2 0 0 0 1 0 0 1 0 0 
vsize tr2 400
~~~~~ 

@subsubsection occt_draw_4_4_4 vaxis

Syntax:                  
~~~~~
vaxis name [Xa Ya Za Xb Yb Zb]
~~~~~ 

Creates an axis. If  the values are not defined, an axis is created by interactive selection of two vertices or one edge
 
**Example:** 
~~~~~
vinit 
vtrihedron tr 
vaxis axe1 0 0 0 1 0 0 
~~~~~

@subsubsection occt_draw_4_4_5 vaxispara

Syntax:                  
~~~~~
vaxispara name
~~~~~ 

Creates an axis by interactive selection of an edge and a vertex. 

@subsubsection occt_draw_4_4_6 vaxisortho

Syntax:                  
~~~~~
vaxisotrho name
~~~~~ 

Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge. 

@subsubsection occt_draw_4_4_7 vpoint

Syntax:                  
~~~~~
vpoint name [Xa Ya Za]
~~~~~ 

Creates a point from coordinates. If the values are not defined, a point is created by interactive selection of a vertice or an edge (in the center of the edge). 

**Example:** 
~~~~~
vinit 
vpoint p 0 0 0 
~~~~~

@subsubsection occt_draw_4_4_8 vplane

Syntax:                  
~~~~~
vplane name [AxisName] [PointName] 
vplane name [PointName] [PointName] [PointName] 
vplane name [PlaneName] [PointName]
~~~~~ 

Creates a plane from named or interactively selected entities.
TypeOfSensitivity:
 * 0 -- Interior
 * 1 -- Boundary

**Example:** 
~~~~~
vinit 
vpoint p1 0 50 0 
vaxis axe1 0 0 0 0 0 1 
vtrihedron tr 
vplane plane1 axe1 p1 
~~~~~

@subsubsection occt_draw_4_4_9 vplanepara

Syntax:                  
~~~~~
vplanepara name
~~~~~ 

Creates a plane from interactively selected vertex and face. 

@subsubsection occt_draw_4_4_10 vplaneortho

Syntax:                  
~~~~~
vplaneortho name
~~~~~ 

Creates a plane from interactive selected face and coplanar edge. 

@subsubsection occt_draw_4_4_11 vline

Syntax:                  
~~~~~
vline name [PointName] [PointName] 
vline name [Xa Ya Za Xb Yb Zb]
~~~~~ 

Creates a line from coordinates, named or interactively selected vertices. 

**Example:** 
~~~~~
vinit 
vtrihedron tr 
vpoint p1 0 50 0 
vpoint p2 50 0 0 
vline line1 p1 p2 
vline line2 0 0 0 50 0 1 
~~~~~

@subsubsection occt_draw_4_4_12 vcircle

Syntax:      
~~~~~
vcircle name [PointName PointName PointName IsFilled] 
vcircle name [PlaneName PointName Radius IsFilled] 
~~~~~

Creates a circle from named or interactively selected entities.  Parameter IsFilled is defined as 0 or 1.
 
**Example:** 
~~~~~
vinit 
vtrihedron tr 
vpoint p1 0 50 0 
vpoint p2 50 0 0 
vpoint p3 0 0 0 
vcircle circle1 p1 p2 p3 1
~~~~~ 

@subsubsection occt_draw_4_4_13 vtri2d

Syntax:                  
~~~~~
vtri2d name
~~~~~ 

Creates a plane with a 2D trihedron from an interactively selected face. 

@subsubsection occt_draw_4_4_14 vselmode

Syntax:                  
~~~~~
vselmode [object] mode_number is_turned_on=(1|0)
~~~~~ 

Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects. 
*Mode_number* is a non-negative integer encoding different interactive object classes.
For shapes the following *mode_number* values are allowed:
 * 0 -- shape
 * 1 -- vertex
 * 2 -- edge
 * 3 -- wire
 * 4 -- face
 * 5 -- shell
 * 6 -- solid
 * 7 -- compsolid
 * 8 -- compound
*is_turned_on* is:
 * 1 if mode is to be switched on
 * 0 if mode is to be switched off

**Example:** 
~~~~~
vinit 
vpoint p1 0 0 0 
vpoint p2 50 0 0 
vpoint p3 25 40 0 
vtriangle triangle1 p1 p2 p3 
~~~~~

@subsubsection occt_draw_4_4_15 vconnect

Syntax:                  
~~~~~
vconnect vconnect name Xo Yo Zo object1 object2 ... [color=NAME]
~~~~~ 

Creates *AIS_ConnectedInteractive* object from the input object and location and displays it.

**Example:** 
~~~~~
vinit 
vpoint p1 0 0 0 
vpoint p2 50 0 0 
vsegment segment p1 p2 
restore CrankArm.brep obj 
vdisplay obj 
vconnect new obj 100100100 1 0 0 0 0 1
~~~~~ 

@subsubsection occt_draw_4_4_16 vtriangle

Syntax:                  
~~~~~
vtriangle name PointName PointName PointName
~~~~~ 

Creates and displays a filled triangle from named points. 

**Example:** 
~~~~~
vinit 
vpoint p1 0 0 0 
vpoint p2 50 0 0 
vpoint p3 25 40 0 
vtriangle triangle1 p1 p2 p3
~~~~~ 

@subsubsection occt_draw_4_4_17 vsegment

Syntax:                  
~~~~~
vsegment name PointName PointName 
~~~~~

Creates and displays a segment from named points. 

**Example:** 
~~~~~
Vinit 
vpoint p1 0 0 0 
vpoint p2 50 0 0 
vsegment segment p1 p2 
~~~~~

@subsubsection occt_draw_4_4_18 vpointcloud

Syntax:
~~~~~
vpointcloud name shape [-randColor] [-normals] [-noNormals]
~~~~~

Creates an interactive object for an arbitrary set of points from the triangulated shape.
Additional options:
 * *randColor* -- generates a random color per point;
 * *normals*   -- generates a normal per point (default);
 * *noNormals* -- does not generate a normal per point.

~~~~~
vpointcloud name x y z r npts {surface|volume} [-randColor] [-normals] [-noNormals]
~~~~~
Creates an arbitrary set of points (npts) randomly distributed on a spheric surface or within a spheric volume (x y z r).
Additional options:
 * *randColor* -- generates a random color per point;
 * *normals*   -- generates a normal per point (default);
 * *noNormals* -- does not generate a normal per point.

**Example:**
~~~~~
vinit
vpointcloud pc 0 0 0 100 100000 surface -randColor
vfit
~~~~~

@subsubsection occt_draw_4_4_19 vclipplane

Syntax:
~~~~~
vclipplane maxplanes <view_name> -- gets plane limit for the view.
vclipplane create <plane_name> -- creates a new plane.
vclipplane delete <plane_name> -- deletes a plane.
vclipplane clone <source_plane> <plane_name> -- clones the plane definition.
vclipplane set/unset <plane_name> object <object list> -- sets/unsets the plane for an IO.
vclipplane set/unset <plane_name> view <view list> -- sets/unsets plane for a view.
vclipplane change <plane_name> on/off -- turns clipping on/off.
vclipplane change <plane_name> equation <a> <b> <c> <d> -- changes plane equation.
vclipplane change <plane_name> capping on/off -- turns capping on/off.
vclipplane change <plane_name> capping color <r> <g> <b> -- sets color.
vclipplane change <plane name> capping texname <texture> -- sets texture.
vclipplane change <plane_name> capping texscale <sx> <sy> -- sets texture scale.
vclipplane change <plane_name> capping texorigin <tx> <ty> -- sets texture origin.
vclipplane change <plane_name> capping texrotate <angle> -- sets texture rotation.
vclipplane change <plane_name> capping hatch on/off/<id> -- sets hatching mask.
~~~~~

Manages clipping planes

**Example:**
~~~~~
vinit
vclipplane create pln1
vclipplane change pln1 equation 1 0 0 -0.1
vclipplane set pln1 view Driver1/Viewer1/View1
box b 100 100 100
vdisplay b
vsetdispmode 1
vfit
vrotate 10 10 10
vselect 100 100
~~~~~

@subsubsection occt_draw_4_4_20 vdimension

Syntax:
~~~~~
vdimension name {-angle|-length|-radius|-diameter} -shapes shape1 [shape2 [shape3]]
                [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
                [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
                [-arrow external|internal|fit] [{-arrowlength|-arlen} RealArrowLength]
                [{-arrowangle|-arangle} ArrowAngle(degrees)] [-plane xoy|yoz|zox]
                [-flyout FloatValue -extension FloatValue]
				[-autovalue] [-value CustomRealValue] [-textvalue CustomTextValue]
                [-dispunits DisplayUnitsString]
                [-modelunits ModelUnitsString] [-showunits | -hideunits]
~~~~~

Builds angle, length, radius or diameter dimension interactive object **name**.

**Attension:** length dimension can't be built without working plane.

**Example:** 
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2

vpoint p3 100 0 0
vdimension dim2 -angle -shapes p1 p2 p3

vcircle circle p1 p2 p3 0
vdimension dim3 -radius -shapes circle
vfit
~~~~~

@subsubsection occt_draw_4_4_21 vdimparam

Syntax:
~~~~~
vdimparam name [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
               [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
               [-arrow external|internal|fit]
               [{-arrowlength|-arlen} RealArrowLength]
               [{-arrowangle|-arangle} ArrowAngle(degrees)]
               [-plane xoy|yoz|zox]
               [-flyout FloatValue -extension FloatValue]
               [-autovalue]
               [-value CustomRealValue]
               [-textvalue CustomTextValue]
               [-dispunits DisplayUnitsString]
               [-modelunits ModelUnitsString]
               [-showunits | -hideunits]
~~~~~

Sets parameters for angle, length, radius and diameter dimension **name**.

**Example:** 
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2
vdimparam dim1 -flyout -15 -arrowlength 4 -showunits -value 10
vfit
vdimparam dim1 -textvalue "w_1"
vdimparam dim1 -autovalue
~~~~~

@subsubsection occt_draw_4_4_22 vangleparam

Syntax:
~~~~~
vangleparam name [-type interior|exterior]
                 [-showarrow first|second|both|none]
~~~~~

Sets parameters for angle dimension **name**.

**Example:** 
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 10 0 0
vpoint p3 10 5 0
vdimension dim1 -angle -plane xoy -shapes p1 p2 p3
vfit
vangleparam dim1 -type exterior -showarrow first
~~~~~

@subsubsection occt_draw_4_4_23 vlengthparam

Syntax:
~~~~~
vlengthparam name [-type interior|exterior]
                  [-showarrow first|second|both|none]
~~~~~

Sets parameters for length dimension **name**.

**Example:** 
~~~~~
vinit
vpoint p1 20 20 0
vpoint p2 80 80 0
vdimension dim1 -length -plane xoy -shapes p1 p2
vtop
vfit
vzoom 0.5
vlengthparam dim1 -direction ox
~~~~~

@subsubsection occt_draw_4_4_24 vmovedim

Syntax:
~~~~~
vmovedim [name] [x y z]
~~~~~

Moves picked or named (if **name** parameter is defined) dimension
to picked mouse position or input point with coordinates **x**,**y**,**z**.
Text label of dimension **name** is moved to position, another parts of dimension
are adjusted.

**Example:** 
~~~~~
vinit
vpoint p1 0 0 0
vpoint p2 50 50 0
vdimension dim1 -length -plane xoy -shapes p1 p2
vmovedim dim1 -10 30 0
~~~~~


@subsection occt_draw_4_5 AIS viewer -- Mesh Visualization Service

**MeshVS** (Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.

@subsubsection occt_draw_4_5_1 meshfromstl

Syntax:                  
~~~~~
meshfromstl meshname file
~~~~~ 

Creates a *MeshVS_Mesh* object based on STL file data. The object will be displayed immediately.
 
**Example:**
~~~~~ 
meshfromstl mesh myfile.stl
~~~~~ 

@subsubsection occt_draw_4_5_2 meshdispmode

Syntax:                  
~~~~~
meshdispmode meshname displaymode
~~~~~ 

Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
* *1* for *wireframe*, 
* *2* for *shading* mode, or
* *3* for *shrink* mode. 

**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshdispmode mesh 2
~~~~~ 

@subsubsection occt_draw_4_5_3 meshselmode

Syntax:                  
~~~~~
meshselmode meshname selectionmode
~~~~~ 

Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following: 
* *1* -- node selection;
* *2* -- 0D elements (not supported in STL); 
* *4* -- links (not supported in STL); 
* *8* -- faces.
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshselmode mesh 1
~~~~~ 

@subsubsection occt_draw_4_5_4 meshshadcolor

Syntax:                  
~~~~~
meshshadcolor meshname red green blue
~~~~~ 

Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshshadcolormode mesh 0.5 0.5 0.5
~~~~~ 

@subsubsection occt_draw_4_5_5 meshlinkcolor

Syntax:                  
~~~~~
meshlinkcolor meshname red green blue
~~~~~ 

Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshlinkcolormode mesh 0.5 0.5 0.5
~~~~~ 

@subsubsection occt_draw_4_5_6 meshmat

Syntax:                  
~~~~~
meshmat meshname material
~~~~~ 

Changes the material of object **meshname**.

*material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*): 
* *0 -- BRASS,* 
* *1 -- BRONZE,* 
* *2 -- COPPER,* 
* *3 -- GOLD,* 
* *4 -- PEWTER,* 
* *5 -- PLASTER,* 
* *6 -- PLASTIC,* 
* *7 -- SILVER,* 
* *8 -- STEEL,* 
* *9 -- STONE,* 
* *10 -- SHINY_PLASTIC,* 
* *11 -- SATIN,*
* *12 -- METALIZED,* 
* *13 -- NEON_GNC,* 
* *14 -- CHROME,*
* *15 -- ALUMINIUM,*
* *16 -- OBSIDIAN,* 
* *17 -- NEON_PHC,* 
* *18 -- JADE,*
* *19 -- DEFAULT,* 
* *20 -- UserDefined*
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshmat mesh JADE 
~~~~~

@subsubsection occt_draw_4_5_7 meshshrcoef

Syntax:                  
~~~~~
meshshrcoef meshname shrinkcoefficient
~~~~~ 

Changes the value of shrink coefficient used in the shrink mode. In the shrink mode the face is shown as a congruent part of a usual face, so that *shrinkcoefficient* controls the value of this part. The *shrinkcoefficient* is a positive real number.
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshshrcoef mesh 0.05
~~~~~ 

@subsubsection occt_draw_4_5_8 meshshow

Syntax:                  
~~~~~
meshshow meshname
~~~~~ 

Displays **meshname** in the viewer (if it is erased).
 
**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshshow mesh
~~~~~ 

@subsubsection occt_draw_4_5_9 meshhide

Syntax:                  
~~~~~
meshhide meshname
~~~~~ 

Hides **meshname** in the viewer. 

**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshhide mesh
~~~~~ 

@subsubsection occt_draw_4_5_10 meshhidesel

Syntax:                  
~~~~~
meshhidesel meshname
~~~~~ 

Hides only selected entities. The other part of **meshname** remains visible. 

@subsubsection occt_draw_4_5_11 meshshowsel

Syntax:                  
~~~~~
meshshowsel meshname
~~~~~ 

Shows only selected entities. The other part of **meshname** becomes invisible. 

@subsubsection occt_draw_4_5_12 meshshowall

Syntax:                  
~~~~~
meshshowall meshname
~~~~~ 

Changes the state of all entities to visible for **meshname**. 

@subsubsection occt_draw_4_5_13 meshdelete

Syntax:                  
~~~~~
meshdelete meshname
~~~~~ 

Deletes MeshVS_Mesh object **meshname**. 

**Example:** 
~~~~~
vinit 
meshfromstl mesh myfile.stl 
meshdelete mesh 
~~~~~

@subsection occt_draw_4_6	VIS Viewer commands

A specific plugin with alias *VIS* should be loaded to have access to VIS functionality in DRAW Test Harness:

~~~~
\> pload VIS
~~~~

@subsubsection occt_draw_4_6_1	ivtkinit

Syntax:
~~~~~
ivtkinit
~~~~~

Creates a window for VTK viewer.

@figure{/user_guides/draw_test_harness/images/draw_image001.png,"",225}

@subsubsection occt_draw_4_6_2	ivtkdisplay

Syntax:
~~~~~
ivtkdisplay name1 [name2] …[name n]
~~~~~

Displays named objects.

**Example:** 
~~~~~
ivtkinit
# create cone
pcone c 5 0 10
ivtkdisplay c
~~~~~

@figure{/user_guides/draw_test_harness/images/draw_image002.png,"",261}


@subsubsection occt_draw_4_6_3	ivtkerase

Syntax:
~~~~~
ivtkerase [name1] [name2] … [name n]
~~~~~

Erases named objects. If no arguments are passed, erases all displayed objects.

**Example:**
~~~~~
ivtkinit
# create a sphere
psphere s 10
# create a cone
pcone c 5 0 10
# create a cylinder
pcylinder cy 5 10
# display objects
ivtkdisplay s c cy
# erase only the cylinder
ivtkerase cy
# erase the sphere and the cone
ivtkerase s c
~~~~~

@subsubsection occt_draw_4_6_4	 ivtkfit

Syntax:
~~~~~
ivtkfit
~~~~~

Automatic zoom/panning.

@subsubsection occt_draw_4_6_5	ivtkdispmode

Syntax:
~~~~~
ivtksetdispmode [name] {0|1}
~~~~~

Sets display mode for a named object. If no arguments are passed, sets the given display mode for all displayed objects
The possible modes are: 0 (WireFrame) and 1 (Shading).

**Example:**
~~~~~
ivtkinit
# create a cone
pcone c 5 0 10
# display the cone
ivtkdisplay c
# set shading mode for the cone
ivtksetdispmode c 1
~~~~~

@figure{/user_guides/draw_test_harness/images/draw_image003.png,"",262}

@subsubsection occt_draw_4_6_6	ivtksetselmode

Syntax:
~~~~~
ivtksetselmode [name] mode {0|1}
~~~~~

Sets selection mode for a named object. If no arguments are passed, sets the given selection mode for all the displayed objects.

**Example:**
~~~~~
ivtkinit
# load a shape from file
restore CrankArm.brep a
# display the loaded shape
ivtkdisplay a
# set the face selection mode
ivtksetselmode a 4 1
~~~~~

@figure{/user_guides/draw_test_harness/images/draw_image004.png,"",291}
 
@subsubsection occt_draw_4_6_7	ivtkmoveto

Syntax:
~~~~~
ivtkmoveto x y
~~~~~

Imitates mouse cursor moving to point with the given display coordinates **x**,**y**.

**Example:**
~~~~~
ivtkinit
pcone c 5 0 10
ivtkdisplay c
ivtkmoveto 40 50
~~~~~

@subsubsection occt_draw_4_6_8	ivtkselect

Syntax:
~~~~~
ivtkselect x y
~~~~~

Imitates mouse cursor moving to point with the given display coordinates and performs selection at this point.

**Example:**
~~~~~
ivtkinit
pcone c 5 0 10
ivtkdisplay c
ivtkselect 40 50
~~~~~

@subsubsection occt_draw_4_6_9	ivtkdump

Syntax:
~~~~~
ivtkdump *filename* [buffer={rgb|rgba|depth}] [width height] [stereoproj={L|R}]
~~~~~

Dumps the contents of VTK viewer to image. It supports:
* dumping in different raster graphics formats: PNG, BMP, JPEG, TIFF or PNM.
* dumping of different buffers: RGB, RGBA or depth buffer.
* defining of image sizes (width and height in pixels).
* dumping of stereo projections (left or right).

**Example:**
~~~~~
ivtkinit
pcone c 5 0 10
ivtkdisplay c
ivtkdump D:/ConeSnapshot.png rgb 768 768
~~~~~

@subsubsection occt_draw_4_6_10	ivtkbgcolor


Syntax:
~~~~~
ivtkbgcolor r g b [r2 g2 b2]
~~~~~

Sets uniform background color or gradient background if second triple of parameters is set. Color parameters r,g,b have to be chosen in the interval  [0..255].

**Example:**
~~~~~
ivtkinit
ivtkbgcolor 200 220 250
~~~~~
 
@figure{/user_guides/draw_test_harness/images/draw_image005.png,"",196}

~~~~~
ivtkbgcolor 10 30 80 255 255 255
~~~~~

@figure{/user_guides/draw_test_harness/images/draw_image006.png,"",190}

@section occt_draw_5 OCAF commands

This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF). 


@subsection occt_draw_5_1 Application commands


@subsubsection occt_draw_5_1_1 NewDocument

Syntax:       
~~~~~
NewDocument docname [format]
~~~~~ 

Creates a new **docname** document with MDTV-Standard or described format. 

**Example:** 
~~~~~
# Create new document with default (MDTV-Standard) format 
NewDocument D 

# Create new document with BinOcaf format 
NewDocument D2 BinOcaf 
~~~~~

@subsubsection occt_draw_5_1_2 IsInSession

Syntax:       
~~~~~
IsInSession path
~~~~~ 

Returns *0*, if **path** document is managed by the application session, *1* -- otherwise. 

**Example:** 
~~~~~
IsInSession /myPath/myFile.std 
~~~~~

@subsubsection occt_draw_5_1_3 ListDocuments

Syntax:       
~~~~~
ListDocuments
~~~~~ 

Makes a list of documents handled during the session of the application. 


@subsubsection occt_draw_5_1_4 Open

Syntax:       
~~~~~
Open path docname [-stream]
~~~~~ 

Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session. 

option <i>-stream</i> activates usage of alternative interface of OCAF persistence working with C++ streams instead of file names.

**Example:** 
~~~~~
Open /myPath/myFile.std D
~~~~~ 

@subsubsection occt_draw_5_1_5 Close

Syntax:       
~~~~~
Close docname
~~~~~ 

Closes **docname** document. The document is no longer handled by the applicative session. 

**Example:** 
~~~~~
Close D 
~~~~~

@subsubsection occt_draw_5_1_6 Save

Syntax:       
~~~~~
Save docname
~~~~~ 

Saves **docname** active document. 

**Example:** 
~~~~~
Save D 
~~~~~

@subsubsection occt_draw_5_1_7 SaveAs

Syntax:       
~~~~~
SaveAs docname path [-stream]
~~~~~ 

Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.

option <i>-stream</i> activates usage of alternative interface of OCAF persistence working with C++ streams instead of file names.

**Example:** 
~~~~~
SaveAs D /myPath/myFile.std
~~~~~ 

@subsection occt_draw_5_2 Basic commands

@subsubsection occt_draw_5_2_1 Label

Syntax:   

~~~~~
Label docname entry
~~~~~

Creates the label expressed by <i>\<entry\></i> if it does not exist.

Example
~~~~~
Label D 0:2
~~~~~

@subsubsection occt_draw_5_2_2 NewChild

Syntax:   

~~~~~
NewChild docname [taggerlabel = Root label]
~~~~~
Finds (or creates) a *TagSource* attribute located at father label of <i>\<taggerlabel\></i> and makes a new child label.

Example
~~~~~
# Create new child of root label
NewChild D

# Create new child of existing label
Label D 0:2
NewChild D 0:2
~~~~~

@subsubsection occt_draw_5_2_3 Children

Syntax:  
~~~~~
Children docname label
~~~~~
Returns the list of attributes of label.

Example
~~~~~
Children D 0:2
~~~~~

@subsubsection occt_draw_5_2_4 ForgetAll

Syntax:   
~~~~~
ForgetAll docname label
~~~~~
Forgets all attributes of the label.

Example
~~~~~
ForgetAll D 0:2
~~~~~


@subsubsection occt_draw_5_3 Application commands

@subsubsection occt_draw_5_3_1  Main

Syntax:       
~~~~~
Main docname
~~~~~ 

Returns the main label of the framework. 

**Example:** 
~~~~~
Main D 
~~~~~

@subsubsection occt_draw_5_3_2  UndoLimit

Syntax:       
~~~~~
UndoLimit docname [value=0]
~~~~~ 


Sets the limit on the number of Undo Delta stored. **0** will disable Undo on the document. A negative *value* means that there is no limit. Note that by default Undo is disabled. Enabling it will take effect with the next call to *NewCommand*. Of course, this limit is the same for Redo 

**Example:** 
~~~~~
UndoLimit D 100 
~~~~~

@subsubsection occt_draw_5_3_3  Undo

Syntax:       
~~~~~
Undo docname [value=1]
~~~~~ 

Undoes **value** steps. 

**Example:** 
~~~~~
Undo D 
~~~~~

@subsubsection occt_draw_5_3_4  Redo

Syntax:       
~~~~~
Redo docname [value=1]
~~~~~ 

Redoes **value** steps.
 
**Example:** 
~~~~~
Redo D 
~~~~~

@subsubsection occt_draw_5_3_5  OpenCommand

Syntax:       
~~~~~
OpenCommand docname
~~~~~ 

Opens a new command transaction. 

**Example:**
~~~~~ 
OpenCommand D
~~~~~ 

@subsubsection occt_draw_5_3_6  CommitCommand

Syntax:       
~~~~~
CommitCommand docname
~~~~~ 

Commits the Command transaction. 

**Example:** 
~~~~~
CommitCommand D
~~~~~ 

@subsubsection occt_draw_5_3_7  NewCommand

Syntax:       
~~~~~
NewCommand docname
~~~~~ 

This is a shortcut for Commit and Open transaction. 

**Example:** 
~~~~~
NewCommand D 
~~~~~

@subsubsection occt_draw_5_3_8  AbortCommand

Syntax:       
~~~~~
AbortCommand docname
~~~~~ 

Aborts the Command transaction. 

**Example:** 
~~~~~
AbortCommand D 
~~~~~

@subsubsection occt_draw_5_3_9  Copy

Syntax:       
~~~~~
Copy docname entry Xdocname Xentry
~~~~~ 

Copies the contents of *entry* to *Xentry*. No links are registered. 

**Example:** 
~~~~~
Copy D1 0:2 D2 0:4 
~~~~~

@subsubsection occt_draw_5_3_10  UpdateLink

Syntax:       
~~~~~
UpdateLink docname [entry] 
~~~~~

Updates external reference set at *entry*. 

**Example:** 
~~~~~
UpdateLink D 
~~~~~

@subsubsection occt_draw_5_3_11  CopyWithLink

Syntax:       
~~~~~
CopyWithLink docname entry Xdocname Xentry
~~~~~ 

Aborts the Command transaction. 
Copies the content of *entry* to *Xentry*. The link is registered with an *Xlink* attribute at *Xentry*  label. 

**Example:** 
~~~~~
CopyWithLink D1 0:2 D2 0:4
~~~~~ 

@subsubsection occt_draw_5_3_12  UpdateXLinks

Syntax:       
~~~~~
UpdateXLinks docname entry
~~~~~ 

Sets modifications on labels impacted by external references to the *entry*. The *document* becomes invalid and must be recomputed 

**Example:** 
~~~~~
UpdateXLinks D 0:2 
~~~~~

@subsubsection occt_draw_5_3_13  DumpDocument

Syntax:       
~~~~~
DumpDocument docname
~~~~~ 

Displays parameters of *docname* document. 

**Example:** 
~~~~~
DumpDocument D 
~~~~~


@subsection occt_draw_5_4  Data Framework commands


@subsubsection occt_draw_5_4_1  MakeDF

Syntax:       
~~~~~
MakeDF dfname
~~~~~ 

Creates a new data framework. 

**Example:** 
~~~~~
MakeDF D 
~~~~~

@subsubsection occt_draw_5_4_2  ClearDF

Syntax:       
~~~~~
ClearDF dfname
~~~~~ 

Clears a data framework. 

**Example:** 
~~~~~
ClearDF D 
~~~~~

@subsubsection occt_draw_5_4_3  CopyDF

Syntax:       
~~~~~
CopyDF dfname1 entry1 [dfname2] entry2
~~~~~ 

Copies a data framework. 

**Example:** 
~~~~~
CopyDF D 0:2 0:4 
~~~~~

@subsubsection occt_draw_5_4_4  CopyLabel

Syntax:       
~~~~~
CopyLabel dfname fromlabel tolablel
~~~~~ 

Copies a label. 

**Example:** 
~~~~~
CopyLabel D1 0:2 0:4 
~~~~~

@subsubsection occt_draw_5_4_5  MiniDumpDF

Syntax:       
~~~~~
MiniDumpDF dfname
~~~~~ 

Makes a mini-dump of a data framework. 

**Example:** 
~~~~~
MiniDumpDF D 
~~~~~

@subsubsection occt_draw_5_4_6  XDumpDF

Syntax:       
~~~~~
XDumpDF dfname
~~~~~ 

Makes an extended dump of a data framework. 

**Example:** 
~~~~~
XDumpDF D
~~~~~ 

@subsection occt_draw_5_5  General attributes commands


@subsubsection occt_draw_5_5_1  SetInteger

Syntax:       
~~~~~
SetInteger dfname entry value
~~~~~ 

Finds or creates an Integer attribute at *entry* label and sets *value*. 

**Example:** 
~~~~~
SetInteger D 0:2 100 
~~~~~

@subsubsection occt_draw_5_5_2  GetInteger

Syntax:       
~~~~~
GetInteger dfname entry [drawname]
~~~~~ 

Gets a value of an Integer attribute at *entry* label and sets it to *drawname* variable, if it is defined. 

**Example:** 
~~~~~
GetInteger D 0:2 Int1 
~~~~~

@subsubsection occt_draw_5_5_3  SetReal

Syntax:       
~~~~~
SetReal dfname entry value
~~~~~ 

Finds or creates a Real attribute at *entry* label and sets *value*. 

**Example:** 
~~~~~
SetReal D 0:2 100. 
~~~~~

@subsubsection occt_draw_5_5_4  GetReal

Syntax:       
~~~~~
GetReal dfname entry [drawname]
~~~~~ 

Gets a value of a Real attribute at *entry* label and sets it to *drawname* variable, if it is defined. 

**Example:** 
~~~~~
GetReal D 0:2 Real1 
~~~~~

@subsubsection occt_draw_5_5_5  SetIntArray

Syntax:       
~~~~~
SetIntArray dfname entry lower upper value1 value2 … 
~~~~~

Finds or creates an IntegerArray attribute at *entry* label with lower and upper bounds and sets **value1*, *value2*... 

**Example:** 
~~~~~
SetIntArray D 0:2 1 4 100 200 300 400
~~~~~ 

@subsubsection occt_draw_5_5_6  GetIntArray

Syntax:       
~~~~~
GetIntArray dfname entry
~~~~~ 

Gets a value of an *IntegerArray* attribute at *entry* label. 

**Example:** 
~~~~~
GetIntArray D 0:2
~~~~~ 

@subsubsection occt_draw_5_5_7  SetRealArray

Syntax:       
~~~~~
SetRealArray dfname entry lower upper value1 value2 …
~~~~~ 

Finds or creates a RealArray attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*… 

**Example:** 
~~~~~
GetRealArray D 0:2 1 4 100. 200. 300. 400. 
~~~~~

@subsubsection occt_draw_5_5_8  GetRealArray

Syntax:       
~~~~~
GetRealArray dfname entry
~~~~~ 

Gets a value of a RealArray attribute at *entry* label. 

**Example:** 
~~~~~
GetRealArray D 0:2 
~~~~~

@subsubsection occt_draw_5_5_9  SetComment

Syntax:       
~~~~~
SetComment dfname entry value
~~~~~ 

Finds or creates a Comment attribute at *entry* label and sets *value*. 

**Example:** 
~~~~~
SetComment D 0:2 "My comment"
~~~~~ 

@subsubsection occt_draw_5_5_10  GetComment

Syntax:       
~~~~~
GetComment dfname entry
~~~~~ 

Gets a value of a Comment attribute at *entry* label. 

**Example:** 
~~~~~
GetComment D 0:2
~~~~~ 

@subsubsection occt_draw_5_5_11  SetExtStringArray

Syntax:       
~~~~~
SetExtStringArray dfname entry lower upper value1 value2 …
~~~~~ 

Finds or creates an *ExtStringArray* attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*… 

**Example:** 
~~~~~
SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
~~~~~ 

@subsubsection occt_draw_5_5_12  GetExtStringArray

Syntax:       
~~~~~
GetExtStringArray dfname entry
~~~~~ 

Gets a value of an ExtStringArray attribute at *entry* label. 

**Example:** 
~~~~~
GetExtStringArray D 0:2 
~~~~~

@subsubsection occt_draw_5_5_13  SetName

Syntax:       
~~~~~
SetName dfname entry value 
~~~~~

Finds or creates a Name attribute at *entry* label and sets *value*. 

**Example:** 
~~~~~
SetName D 0:2 *My name* 
~~~~~

@subsubsection occt_draw_5_5_14  GetName

Syntax:       
~~~~~
GetName dfname entry 
~~~~~

Gets a value of a Name attribute at *entry* label. 

**Example:** 
~~~~~
GetName D 0:2 
~~~~~

@subsubsection occt_draw_5_5_15  SetReference

Syntax:       
~~~~~
SetReference dfname entry reference 
~~~~~

Creates a Reference attribute at *entry* label and sets *reference*. 

**Example:** 
~~~~~
SetReference D 0:2 0:4 
~~~~~

@subsubsection occt_draw_5_5_16  GetReference

Syntax:       
~~~~~
GetReference dfname entry 
~~~~~

Gets a value of a Reference attribute at *entry* label. 

**Example:** 
~~~~~
GetReference D 0:2 
~~~~~

@subsubsection occt_draw_5_5_17  SetUAttribute

Syntax:       
~~~~~
SetUAttribute dfname entry localGUID 
~~~~~

Creates a UAttribute attribute at *entry* label with *localGUID*. 

**Example:** 
~~~~~
set localGUID "c73bd076-22ee-11d2-acde-080009dc4422" 
SetUAttribute D 0:2 ${localGUID} 
~~~~~

@subsubsection occt_draw_5_5_18  GetUAttribute

Syntax:       
~~~~~
GetUAttribute dfname entry loacalGUID 
~~~~~

Finds a *UAttribute* at *entry* label with *localGUID*. 

**Example:** 
~~~~~
set localGUID "c73bd076-22ee-11d2-acde-080009dc4422" 
GetUAttribute D 0:2 ${localGUID} 
~~~~~

@subsubsection occt_draw_5_5_19  SetFunction

Syntax:       
~~~~~
SetFunction dfname entry ID failure 
~~~~~

Finds or creates a *Function* attribute at *entry* label with driver ID and *failure* index. 

**Example:** 
~~~~~
set ID "c73bd076-22ee-11d2-acde-080009dc4422" 
SetFunction D 0:2 ${ID} 1 
~~~~~

@subsubsection occt_draw_5_5_20  GetFunction

Syntax:       
~~~~~
GetFunction dfname entry ID failure 
~~~~~

Finds a Function attribute at *entry* label and sets driver ID to *ID* variable and failure index to *failure* variable. 

**Example:** 
~~~~~
GetFunction D 0:2 ID failure 
~~~~~

@subsubsection occt_draw_5_5_21  NewShape

Syntax:       
~~~~~
NewShape dfname entry [shape] 
~~~~~

Finds or creates a Shape attribute at *entry* label. Creates or updates the associated *NamedShape* attribute by *shape* if *shape* is defined. 

**Example:** 
~~~~~
box b 10 10 10 
NewShape D 0:2 b 
~~~~~

@subsubsection occt_draw_5_5_22  SetShape

Syntax:       
~~~~~
SetShape dfname entry shape 
~~~~~

Creates or updates a *NamedShape* attribute at *entry* label by *shape*. 

**Example:** 
~~~~~
box b 10 10 10 
SetShape D 0:2 b 
~~~~~

@subsubsection occt_draw_5_5_23  GetShape

Syntax:       
~~~~~
GetShape2 dfname entry shape 
~~~~~

Sets a shape from NamedShape attribute associated with *entry* label to *shape* draw variable. 

**Example:** 
~~~~~
GetShape2 D 0:2 b 
~~~~~

@subsection occt_draw_5_6  Geometric attributes commands


@subsubsection occt_draw_5_6_1  SetPoint

Syntax:       
~~~~~
SetPoint dfname entry point
~~~~~ 

Finds or creates a Point attribute at *entry* label and sets *point* as generated in the associated *NamedShape* attribute. 

**Example:** 
~~~~~
point p 10 10 10 
SetPoint D 0:2 p 
~~~~~

@subsubsection occt_draw_5_6_2  GetPoint

Syntax:       
~~~~~
GetPoint dfname entry [drawname] 
~~~~~

Gets a vertex from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 

**Example:** 
~~~~~
GetPoint D 0:2 p 
~~~~~

@subsubsection occt_draw_5_6_3  SetAxis

Syntax:       
~~~~~
SetAxis dfname entry axis 
~~~~~

Finds or creates an Axis attribute at *entry* label and sets *axis* as generated in the associated *NamedShape* attribute. 

**Example:** 
~~~~~
line l 10 20 30 100 200 300 
SetAxis D 0:2 l 
~~~~~

@subsubsection occt_draw_5_6_4  GetAxis

Syntax:       
~~~~~
GetAxis dfname entry [drawname] 
~~~~~

Gets a line from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 

**Example:** 
~~~~~
GetAxis D 0:2 l 
~~~~~

@subsubsection occt_draw_5_6_5  SetPlane

Syntax:       
~~~~~
SetPlane dfname entry plane 
~~~~~

Finds or creates a Plane attribute at *entry* label and sets *plane* as generated in the associated *NamedShape* attribute. 

**Example:** 
~~~~~
plane pl 10 20 30 -1 0 0 
SetPlane D 0:2 pl 
~~~~~

@subsubsection occt_draw_5_6_6  GetPlane

Syntax:       
~~~~~
GetPlane dfname entry [drawname] 
~~~~~

Gets a plane from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 

**Example:** 
~~~~~
GetPlane D 0:2 pl 
~~~~~

@subsubsection occt_draw_5_6_7  SetGeometry

Syntax:       
~~~~~
SetGeometry dfname entry [type] [shape] 
~~~~~

Creates a Geometry attribute at *entry* label and sets *type* and *shape* as generated in the associated *NamedShape* attribute if they are defined. *type* must be one of the following: *any, pnt, lin, cir, ell, spl, pln, cyl*. 

**Example:** 
~~~~~
point p 10 10 10 
SetGeometry D 0:2 pnt p 
~~~~~

@subsubsection occt_draw_5_6_8  GetGeometryType

Syntax:       
~~~~~
GetGeometryType dfname entry
~~~~~ 

Gets a geometry type from Geometry attribute at *entry* label. 

**Example:** 
~~~~~
GetGeometryType D 0:2 
~~~~~

@subsubsection occt_draw_5_6_9  SetConstraint

Syntax:       
~~~~~
SetConstraint dfname entry keyword geometrie [geometrie …] 
SetConstraint dfname entry "plane" geometrie 
SetConstraint dfname entry "value" value
~~~~~  

1. Creates a Constraint attribute at *entry* label and sets *keyword* constraint between geometry(ies). 
*keyword* must be one of the following: 
*rad, dia, minr, majr, tan, par, perp, concentric, equal, dist, angle, eqrad, symm, midp, eqdist, fix, rigid,* or *from, axis, mate, alignf, aligna, axesa, facesa, round, offset* 
2. Sets plane for the existing constraint. 
3. Sets value for the existing constraint. 

**Example:** 
~~~~~
SetConstraint D 0:2 "value" 5 
~~~~~

@subsubsection occt_draw_5_6_10  GetConstraint

Syntax:       
~~~~~
GetConstraint dfname entry
~~~~~ 

Dumps a Constraint attribute at *entry* label 

**Example:** 
~~~~~
GetConstraint D 0:2 
~~~~~

@subsubsection occt_draw_5_6_11  SetVariable

Syntax:       
~~~~~
SetVariable dfname entry isconstant(0/1) units 
~~~~~

Creates a Variable attribute at *entry* label and sets *isconstant* flag and *units* as a string. 

**Example:** 
~~~~~
SetVariable D 0:2 1 "mm" 
~~~~~

@subsubsection occt_draw_5_6_12  GetVariable

Syntax:       
~~~~~
GetVariable dfname entry isconstant units 
~~~~~

Gets an *isconstant* flag and units of a Variable attribute at *entry* label. 

**Example:** 
~~~~~
GetVariable D 0:2 isconstant units 
puts "IsConstant=${isconstant}" 
puts "Units=${units}" 
~~~~~

@subsection occt_draw_5_7  Tree attributes commands


@subsubsection occt_draw_5_7_1  RootNode

Syntax:       
~~~~~
RootNode dfname treenodeentry [ID]
~~~~~ 

Returns the ultimate father of *TreeNode* attribute identified by its *treenodeentry* and its *ID* (or default ID, if *ID* is not defined). 


@subsubsection occt_draw_5_7_2  SetNode

Syntax:       
~~~~~
SetNode dfname treenodeentry [ID]
~~~~~ 

Creates a *TreeNode* attribute on the *treenodeentry* label with its tree *ID* (or assigns a default ID, if the *ID* is not defined). 


@subsubsection occt_draw_5_7_3  AppendNode

Syntax:       
~~~~~
AppendNode dfname fatherentry childentry [fatherID]
~~~~~ 


Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as last child of *fatherentry*. 




@subsubsection occt_draw_5_7_4  PrependNode

Syntax:       
~~~~~
PrependNode dfname fatherentry childentry [fatherID]
~~~~~ 


Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as first child of *fatherentry*. 


@subsubsection occt_draw_5_7_5  InsertNodeBefore

Syntax:       
~~~~~
InsertNodeBefore dfname treenodeentry beforetreenode [ID]
~~~~~ 

Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *beforetreenode* before *treenodeentry*. 


@subsubsection occt_draw_5_7_6  InsertNodeAfter

Syntax:       
~~~~~
InsertNodeAfter dfname treenodeentry aftertreenode [ID]
~~~~~ 

Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *aftertreenode* after *treenodeentry*. 


@subsubsection occt_draw_5_7_7  DetachNode

Syntax:       
~~~~~
DetachNode dfname treenodeentry [ID]
~~~~~ 

Removes a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) from *treenodeentry*. 


@subsubsection occt_draw_5_7_8  ChildNodeIterate

Syntax:       
~~~~~
ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
~~~~~ 


Iterates on the tree of *TreeNode* attributes with tree *ID* (or default ID, if *ID* is not defined). If *alllevels* is set to *1* it explores not only the first, but all the sub Step levels.
 
**Example:** 
~~~~~
Label D 0:2 
Label D 0:3 
Label D 0:4 
Label D 0:5 
Label D 0:6 
Label D 0:7 
Label D 0:8 
Label D 0:9 

# Set root node 
SetNode D 0:2 

AppendNode D 0:2 0:4 
AppendNode D 0:2 0:5 
PrependNode D 0:4 0:3 
PrependNode D 0:4 0:8 
PrependNode D 0:4 0:9 

InsertNodeBefore D 0:5 0:6 
InsertNodeAfter D 0:4 0:7 

DetachNode D 0:8 


# List all levels 
ChildNodeIterate D 0:2 1 

==0:4 
==0:9 
==0:3 
==0:7 
==0:6 
==0:5 


# List only first levels 
ChildNodeIterate D 0:2 1 

==0:4 
==0:7 
==0:6 
==0:5 
~~~~~

@subsubsection occt_draw_5_7_9  InitChildNodeIterator

Syntax:       
~~~~~
InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
~~~~~ 


Initializes the iteration on the tree of *TreeNode* attributes with tree *ID* (or default ID, if *ID* is not defined). If *alllevels* is set to *1* it explores not only the first, but also all sub Step levels. 

**Example:** 
~~~~~
InitChildNodeIterate D 0:5 1 
set aChildNumber 0 
for {set i 1} {$i < 100} {incr i} { 
    if {[ChildNodeMore] == *TRUE*} { 
        puts *Tree node = [ChildNodeValue]* 
        incr aChildNumber 
        ChildNodeNext 
    } 
} 
puts "aChildNumber=$aChildNumber"
~~~~~ 

@subsubsection occt_draw_5_7_10  ChildNodeMore

Syntax:       
~~~~~
ChildNodeMore
~~~~~ 

Returns TRUE if there is a current item in the iteration. 


@subsubsection occt_draw_5_7_11  ChildNodeNext

Syntax:       
~~~~~
ChildNodeNext
~~~~~ 

Moves to the next Item. 


@subsubsection occt_draw_5_7_12  ChildNodeValue

Syntax:       
~~~~~
ChildNodeValue
~~~~~ 

Returns the current treenode of *ChildNodeIterator*. 


@subsubsection occt_draw_5_7_13  ChildNodeNextBrother

Syntax:       
~~~~~
ChildNodeNextBrother
~~~~~ 

Moves to the next *Brother*. If there is none, goes up. This method is interesting only with *allLevels* behavior. 


@subsection occt_draw_5_8   Standard presentation commands


@subsubsection occt_draw_5_8_1  AISInitViewer

Syntax:       
~~~~~
AISInitViewer docname
~~~~~ 

Creates and sets *AISViewer* attribute at root label, creates AIS viewer window. 

**Example:** 
~~~~~
AISInitViewer D 
~~~~~

@subsubsection occt_draw_5_8_2  AISRepaint

Syntax:       
~~~~~
AISRepaint docname 
~~~~~

Updates the AIS viewer window. 

**Example:** 
~~~~~
AISRepaint D 
~~~~~

@subsubsection occt_draw_5_8_3  AISDisplay

Syntax:       
~~~~~
AISDisplay docname entry [not_update] 
~~~~~

Displays a presantation of *AISobject* from *entry* label in AIS viewer. If *not_update* is not defined then *AISobject* is recomputed and all visualization settings are applied. 

**Example:** 
~~~~~
AISDisplay D 0:5 
~~~~~

@subsubsection occt_draw_5_8_4  AISUpdate

Syntax:       
~~~~~
AISUpdate docname entry 
~~~~~

Recomputes a presentation of *AISobject* from *entry* label and applies the visualization setting in AIS viewer. 

**Example:** 
~~~~~
AISUpdate D 0:5 
~~~~~

@subsubsection occt_draw_5_8_5  AISErase

Syntax:       
~~~~~
AISErase docname entry 
~~~~~

Erases *AISobject* of *entry* label in AIS viewer. 

**Example:** 
~~~~~
AISErase D 0:5 
~~~~~

@subsubsection occt_draw_5_8_6  AISRemove

Syntax:       
~~~~~
AISRemove docname entry 
~~~~~

Erases *AISobject* of *entry* label in AIS viewer, then *AISobject* is removed from *AIS_InteractiveContext*. 

**Example:** 
~~~~~
AISRemove D 0:5 
~~~~~

@subsubsection occt_draw_5_8_7  AISSet

Syntax:       
~~~~~
AISSet docname entry ID 
~~~~~

Creates *AISPresentation* attribute at *entry* label and sets as driver ID. ID must be one of the following: *A* (*axis*), *C* (*constraint*), *NS* (*namedshape*), *G* (*geometry*), *PL* (*plane*), *PT* (*point*). 

**Example:** 
~~~~~
AISSet D 0:5 NS 
~~~~~

@subsubsection occt_draw_5_8_8  AISDriver

Syntax:       
~~~~~
AISDriver docname entry [ID] 
~~~~~

Returns DriverGUID stored in *AISPresentation* attribute of an *entry* label or sets a new one. ID must be one of the following: *A* (*axis*), *C* (*constraint*), *NS* (*namedshape*), *G* (*geometry*), *PL* (*plane*), *PT* (*point*). 

**Example:** 
~~~~~
# Get Driver GUID 
AISDriver D 0:5 
~~~~~

@subsubsection occt_draw_5_8_9  AISUnset

Syntax:       
~~~~~
AISUnset docname entry 
~~~~~

Deletes *AISPresentation* attribute (if it exists) of an *entry* label. 

**Example:** 
~~~~~
AISUnset D 0:5 
~~~~~

@subsubsection occt_draw_5_8_10  AISTransparency

Syntax:       
~~~~~
AISTransparency docname entry [transparency] 
~~~~~

Sets (if *transparency* is defined) or gets the value of transparency for *AISPresentation* attribute of an *entry* label. 

**Example:** 
~~~~~
AISTransparency D 0:5 0.5 
~~~~~

@subsubsection occt_draw_5_8_11  AISHasOwnTransparency

Syntax:       
~~~~~
AISHasOwnTransparency docname entry 
~~~~~

Tests *AISPresentation* attribute of an *entry* label by own transparency. 

**Example:** 
~~~~~
AISHasOwnTransparency D 0:5 
~~~~~

@subsubsection occt_draw_5_8_12  AISMaterial

Syntax:       
~~~~~
AISMaterial docname entry [material] 
~~~~~

Sets (if *material* is defined) or gets the value of transparency for *AISPresentation* attribute of an *entry* label. *material* is integer from 0 to 20 (see @ref occt_draw_4_5_6 "meshmat" command). 

**Example:** 
~~~~~
AISMaterial D 0:5 5 
~~~~~

@subsubsection occt_draw_5_8_13  AISHasOwnMaterial

Syntax:       
~~~~~
AISHasOwnMaterial docname entry 
~~~~~

Tests *AISPresentation* attribute of an *entry* label by own material. 

**Example:** 
~~~~~
AISHasOwnMaterial D 0:5 
~~~~~

@subsubsection occt_draw_5_8_14  AISColor

Syntax:       
~~~~~
AISColor docname entry [color] 
~~~~~

Sets (if *color* is defined) or gets value of color for *AISPresentation* attribute of an *entry* label. *color* is integer from 0 to 516 (see color names in *vsetcolor*). 

**Example:** 
~~~~~
AISColor D 0:5 25 
~~~~~

@subsubsection occt_draw_5_8_15  AISHasOwnColor

Syntax:       
~~~~~
AISHasOwnColor docname entry 
~~~~~

Tests *AISPresentation* attribute of an *entry* label by own color. 

**Example:** 
~~~~~
AISHasOwnColor D 0:5 
~~~~~

@section occt_draw_6 Geometry commands

@subsection occt_draw_6_1 Overview

Draw provides a set of commands to test geometry libraries. These commands are found in the TGEOMETRY executable, or in any Draw executable which includes *GeometryTest* commands. 

In the context of Geometry, Draw includes the following types of variable: 

  * 2d and 3d points
  * The 2d curve, which corresponds to *Curve* in *Geom2d*.
  * The 3d curve and surface, which correspond to *Curve* and *Surface* in <a href="user_guides__modeling_data.html#occt_modat_1">Geom package</a>.
  
Draw geometric variables never share data; the *copy* command will always make a complete copy of the content of the variable. 

The following topics are covered in the nine sections of this chapter: 

  * **Curve creation** deals with the various types of curves and how to create them.
  * **Surface creation** deals with the different types of surfaces and how to create them.
  * **Curve and surface modification** deals with the commands used to modify the definition of curves and surfaces, most of which concern modifications to bezier and bspline curves.
  * **Geometric transformations** covers translation, rotation, mirror image and point scaling transformations.
  * **Curve and Surface Analysis** deals with the commands used to compute points, derivatives and curvatures.
  * **Intersections** presents intersections of surfaces and curves.
  * **Approximations** deals with creating curves and surfaces from a set of points.
  * **Constraints** concerns construction of 2d circles and lines by constraints such as tangency.
  * **Display** describes commands to control the display of curves and surfaces.

Where possible, the commands have been made broad in application, i.e. they apply to 2d curves, 3d curves and surfaces. For instance, the *circle* command may create a 2d or a 3d circle depending on the number of arguments given. 

Likewise, the *translate* command will process points, curves or surfaces, depending on argument type. You may not always find the specific command you are looking for in the section where you expect it to be. In that case, look in another section. The *trim* command, for example, is described in the surface section. It can, nonetheless, be used with curves as well. 

@subsection occt_draw_6_2  Curve creation

This section deals with both points and curves. Types of curves are: 

  * Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
  * Polar curves such as bezier curves and bspline curves.
  * Trimmed curves and offset curves made from other curves with the *trim* and *offset* commands. Because they are used on both curves and surfaces, the *trim* and *offset* commands are described in the *surface creation* section.
  * NURBS can be created from other curves using *convert* in the *Surface Creation* section.
  * Curves can be created from the isoparametric lines of surfaces by the *uiso* and *viso* commands.
  * 3d curves can be created from 2d curves and vice versa using the *to3d* and *to2d* commands. The *project* command computes a 2d curve on a 3d surface.

Curves are displayed with an arrow showing the last parameter. 


@subsubsection occt_draw_6_2_1 point

Syntax:      
~~~~~
point name x y [z] 
~~~~~
  
Creates a 2d or 3d point, depending on the number of arguments. 

**Example:**
~~~~~
# 2d point 
point p1 1 2 

# 3d point 
point p2 10 20 -5 
~~~~~
  
@subsubsection occt_draw_6_2_2  line

Syntax:      
~~~~~
line name x y [z] dx dy [dz]
~~~~~ 

  
Creates a 2d or 3d line. *x y z* are the coordinates of the line’s point of origin; *dx, dy, dz* give the direction vector. 

A 2d line will be represented as *x y dx dy*, and a 3d line as *x y z dx dy dz* . A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not. 

**Example:** 
~~~~~
# a 2d line at 45 degrees of the X axis 
line l 2 0 1 1 

# a 3d line through the point 10 0 0 and parallel to Z 
line l 10 0 0 0 0 1 
~~~~~

@subsubsection occt_draw_6_2_3  circle

Syntax:      
~~~~~
circle name x y [z [dx dy dz]] [ux uy [uz]] radius
~~~~~ 

Creates a 2d or a 3d circle. 

In 2d, *x, y* are the coordinates of the center and *ux, uy* define the vector towards the point of origin of the parameters. By default, this direction is (1,0). The X Axis of the local coordinate system defines the origin of the parameters of the circle. Use another vector than the x axis to change the origin of parameters. 

In 3d, *x, y, z* are the coordinates of the center; *dx, dy, dz* give the vector normal to the plane of the circle. By default, this vector is (0,0,1) i.e. the Z axis (it must not be null). *ux, uy, uz* is the direction of the origin; if not given, a default direction will be computed. This vector must neither be null nor parallel to *dx, dy, dz*. 

The circle is parameterized by the angle in [0,2*pi] starting from the origin and. Note that the specification of origin direction and plane is the same for all analytical curves and surfaces. 

**Example:** 
~~~~~
# A 2d circle of radius 5 centered at 10,-2 
circle c1 10 -2 5 

# another 2d circle with a user defined origin 
# the point of parameter 0 on this circle will be 
# 1+sqrt(2),1+sqrt(2) 
circle c2 1 1 1 1 2 

# a 3d circle, center 10 20 -5, axis Z, radius 17 
circle c3 10 20 -5 17 

# same 3d circle with axis Y 
circle c4 10 20 -5 0 1 0 17 

# full 3d circle, axis X, origin on Z 
circle c5 10 20 -5 1 0 0 0 0 1 17 
~~~~~

@subsubsection occt_draw_6_2_4  ellipse

Syntax: 
~~~~~
ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius 
~~~~~

Creates a 2d or 3d ellipse. In a 2d ellipse, the first two arguments define the center; in a 3d ellipse, the first three. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. The parameter range of the ellipse is [0,2.*pi] starting from the X axis and going towards the Y axis. The Draw ellipse is parameterized by an angle: 

~~~~~
P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir 
~~~~~
where: 

  * P is the point of parameter *u*,
  * *O, Xdir* and *Ydir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
 
**Example:**
~~~~~
# default 2d ellipse 
ellipse e1 10 5 20 10 

# 2d ellipse at angle 60 degree 
ellipse e2 0 0 1 2 30 5 

# 3d ellipse, in the XY plane 
ellipse e3 0 0 0 25 5 

# 3d ellipse in the X,Z plane with axis 1, 0 ,1 
ellipse e4 0 0 0 0 1 0 1 0 1 25 5 
~~~~~

@subsubsection occt_draw_6_2_5  hyperbola

Syntax:      
~~~~~
hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
~~~~~ 

Creates a 2d or 3d conic. The first arguments define the center. The axis system is given by *firstradius*, the major radius, and *secondradius*, the minor radius. Note that the hyperbola has only one branch, that in the X direction. 

The Draw hyperbola is parameterized as follows: 
~~~~~
P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir 
~~~~~
where: 

  * *P* is the point of parameter *U*,
  * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *YDirection* of its local coordinate system. 

**Example:** 
~~~~~
# default 2d hyperbola, with asymptotes 1,1 -1,1 
hyperbola h1 0 0 30 30 

# 2d hyperbola at angle 60 degrees 
hyperbola h2 0 0 1 2 20 20 

# 3d hyperbola, in the XY plane 
hyperbola h3 0 0 0 50 50 
~~~~~

@subsubsection occt_draw_6_2_6  parabola

Syntax:      
~~~~~
parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength 
~~~~~

Creates a 2d or 3d parabola. in the axis system defined by the first arguments. The origin is the apex of the parabola. 

The *Geom_Parabola* is parameterized as follows: 

~~~~~
P(u) = O + u*u/(4.*F)*XDir + u*YDir 
~~~~~

where: 
  * *P* is the point of parameter *u*,
  * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
  * *F* is the focal length of the parabola.

**Example:** 
~~~~~
# 2d parabola 
parabola p1 0 0 50 

# 2d parabola with convexity +Y 
parabola p2 0 0 0 1 50 

# 3d parabola in the Y-Z plane, convexity +Z 
parabola p3 0 0 0 1 0 0 0 0 1 50 
~~~~~

@subsubsection occt_draw_6_2_7  beziercurve, 2dbeziercurve

Syntax:      
~~~~~
beziercurve name nbpole pole, [weight] 
2dbeziercurve name nbpole pole, [weight]
~~~~~ 

Creates a 3d rational or non-rational Bezier curve. Give the number of poles (control points,) and the coordinates of the poles *(x1 y1 z1 [w1] x2 y2 z2 [w2])*. The degree will be *nbpoles-1*. To create a rational curve, give weights with the poles. You must give weights for all poles or for none. If the weights of all the poles are equal, the curve is polynomial, and therefore non-rational. 

**Example:** 
~~~~~
# a rational 2d bezier curve (arc of circle) 
2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1 

# a 3d bezier curve, not rational 
beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10 
~~~~~

@subsubsection occt_draw_6_2_8  bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve

Syntax:      
~~~~~
bsplinecurve   name degree nbknots knot, umult pole, weight
2dbsplinecurve name degree nbknots knot, umult pole, weight

pbsplinecurve   name degree nbknots knot, umult pole, weight (periodic)
2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
~~~~~

Creates 2d or 3d bspline curves; the **pbsplinecurve** and **2dpbsplinecurve** commands create periodic bspline curves. 

A bspline curve is defined by its degree, its periodic or non-periodic nature, a table of knots and a table of poles (i.e. control points). Consequently, specify the degree, the number of knots, and for each knot, the multiplicity, for each pole, the weight. In the syntax above, the commas link the adjacent arguments which they fall between: knot and multiplicities, pole and weight. 

The table of knots is an increasing sequence of reals without repetition. 
Multiplicities must be lower or equal to the degree of the curve. For non-periodic curves, the first and last multiplicities can be equal to degree+1. For a periodic curve, the first and last multiplicities must be equal. 

The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be: 

  * For a non periodic curve: Sum of multiplicities - degree + 1
  * For a periodic curve: Sum of multiplicities - last multiplicity

**Example:** 
~~~~~
# a bspline curve with 4 poles and 3 knots 
bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
# a 2d periodic circle (parameter from 0 to 2*pi !!) 
dset h sqrt(3)/2 
2dpbsplinecurve c 2 \ 
4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \ 
0 -h/3 1 \ 
0.5 -h/3 0.5 \ 
0.25 h/6 1 \ 
0 2*h/3 0.5 \ 
-0.25 h/6 1 \ 
-0.5 -h/3 0.5 \ 
0 -h/3 1 
~~~~~

**Note** that you can create the **NURBS** subset of bspline curves and surfaces by trimming analytical curves and surfaces and executing the command *convert*. 


@subsubsection occt_draw_6_2_9  uiso, viso

Syntax:      
~~~~~
uiso name surface u 
viso name surface u 
~~~~~

Creates a U or V isoparametric curve from a surface. 

**Example:** 
~~~~~
# create a cylinder and extract iso curves 

cylinder c 10 
uiso c1 c pi/6 
viso c2 c 
~~~~~

**Note** that this cannot be done from offset surfaces.


@subsubsection occt_draw_6_2_10  to3d, to2d

Syntax:      
~~~~~
to3d name curve2d [plane] 
to2d name curve3d [plane] 
~~~~~

Create respectively a 3d curve from a 2d curve and a 2d curve from a 3d curve. The transformation uses a planar surface to define the XY plane in 3d (by default this plane is the default OXYplane). **to3d** always gives a correct result, but as **to2d** is not a projection, it may surprise you. It is always correct if the curve is planar and parallel to the plane of projection. The points defining the curve are projected on the plane. A circle, however, will remain a circle and will not be changed to an ellipse. 

**Example:** 
~~~~~
# the following commands 
circle c 0 0 5 
plane p -2 1 0 1 2 3 
to3d c c p 

# will create the same circle as 
circle c -2 1 0 1 2 3 5 
~~~~~

See also: **project** 


@subsubsection occt_draw_6_2_11  project

Syntax:      
~~~~~
project name curve3d surface 
~~~~~

Computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces. 

If we, for example, intersect a cylinder and a plane and project the resulting ellipse on the cylinder, this will create a 2d sinusoid-like bspline. 

~~~~~
cylinder c 5 
plane p 0 0 0 0 1 1 
intersect i c p 
project i2d i c 
~~~~~

@subsection occt_draw_6_3  Surface creation

The following types of surfaces exist: 
  * Analytical surfaces: plane, cylinder, cone, sphere, torus;
  * Polar surfaces: bezier surfaces, bspline surfaces;
  * Trimmed and Offset surfaces;
  * Surfaces produced by Revolution and Extrusion, created from curves with the *revsurf* and *extsurf*;
  * NURBS surfaces.

Surfaces are displayed with isoparametric lines. To show the parameterization, a small parametric line with a length 1/10 of V is displayed at 1/10 of U. 

@subsubsection occt_draw_6_3_1  plane

Syntax:      
~~~~~
plane name [x y z [dx dy dz [ux uy uz]]]
~~~~~ 

Creates an infinite plane. 

A plane is the same as a 3d coordinate system, *x,y,z* is the origin, *dx, dy, dz* is the Z direction and *ux, uy, uz* is the X direction. 

The plane is perpendicular to Z and X is the U parameter. *dx,dy,dz* and *ux,uy,uz* must not be null or collinear. *ux,uy,uz* will be modified to be orthogonal to *dx,dy,dz*. 

There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis. 

Note that this definition will be used for all analytical surfaces. 

**Example:** 
~~~~~
# a plane through the point 10,0,0 perpendicular to X 
# with U direction on Y 
plane p1 10 0 0 1 0 0 0 1 0 

# an horixontal plane with origin 10, -20, -5 
plane p2 10 -20 -5 
~~~~~

@subsubsection occt_draw_6_3_2  cylinder

Syntax:      
~~~~~
cylinder name [x y z [dx dy dz [ux uy uz]]] radius 
~~~~~

A cylinder is defined by a coordinate system, and a radius. The surface generated is an infinite cylinder with the Z axis as the axis. The U parameter is the angle starting from X going in the Y direction. 

**Example:** 
~~~~~
# a cylinder on the default Z axis, radius 10 
cylinder c1 10 

# a cylinder, also along the Z axis but with origin 5, 
10, -3 
cylinder c2 5 10 -3 10 

# a cylinder through the origin and on a diagonal 
# with longitude pi/3 and latitude pi/4 (euler angles) 
dset lo pi/3. la pi/4. 
cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo) 
sin(la) 10 
~~~~~

@subsubsection occt_draw_6_3_3  cone

Syntax:      
~~~~~
cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius 
~~~~~
Creates a cone in the infinite coordinate system along the Z-axis. The radius is that of the circle at the intersection of the cone and the XY plane. The semi-angle is the angle formed by the cone relative to the axis; it should be between -90 and 90. If the radius is 0, the vertex is the origin. 

**Example:** 
~~~~~
# a cone at 45 degrees at the origin on Z 
cone c1 45 0 

# a cone on axis Z with radius r1 at z1 and r2 at z2 
cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1 
~~~~~

@subsubsection occt_draw_6_3_4  sphere

Syntax:      
~~~~~
sphere name [x y z [dx dy dz [ux uy uz]]] radius 
~~~~~

Creates a sphere in the local coordinate system defined in the **plane** command. The sphere is centered at the origin. 

To parameterize the sphere, *u* is the angle from X to Y, between 0 and 2*pi. *v* is the angle in the half-circle at angle *u* in the plane containing the Z axis. *v* is between -pi/2 and pi/2. The poles are the points Z = +/- radius; their parameters are u,+/-pi/2 for any u in 0,2*pi. 

**Example:**
~~~~~ 
# a sphere at the origin 
sphere s1 10 
# a sphere at 10 10 10, with poles on the axis 1,1,1 
sphere s2 10 10 10 1 1 1 10 
~~~~~

@subsubsection occt_draw_6_3_5  torus

Syntax:      
~~~~~
torus name [x y z [dx dy dz [ux uy uz]]] major minor
~~~~~ 

Creates a torus in the local coordinate system with the given major and minor radii. *Z* is the axis for the major radius. The major radius may be lower in value than the minor radius. 

To parameterize a torus, *u* is the angle from X to Y; *v* is the angle in the plane at angle *u* from the XY plane to Z. *u* and *v* are in 0,2*pi. 

**Example:** 
~~~~~
# a torus at the origin 
torus t1 20 5 

# a torus in another coordinate system 
torus t2 10 5 -2 2 1 0 20 5 
~~~~~


@subsubsection occt_draw_6_3_6  beziersurf

Syntax:      
~~~~~
beziersurf name nbupoles nbvolpes pole, [weight] 
~~~~~

Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions. 

Then give the poles in the following order: *pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles)* and *pole(nbupoles, nbvpoles)*. 

Weights may be omitted, but if you give one weight you must give all of them. 

**Example:** 
~~~~~
# a non-rational degree 2,3 surface 
beziersurf s 3 4 \ 
0 0 0 10 0 5 20 0 0 \ 
0 10 2 10 10 3 20 10 2 \ 
0 20 10 10 20 20 20 20 10 \ 
0 30 0 10 30 0 20 30 0 
~~~~~

@subsubsection occt_draw_6_3_7   bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf

Syntax:     
~~~~~
bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot 
vmult ... x y z w ... 
upbsplinesurf ... 
vpbsplinesurf ... 
uvpbsplinesurf ... 
~~~~~

* **bsplinesurf** generates bspline surfaces;
* **upbsplinesurf** creates a bspline surface periodic in u; 
* **vpbsplinesurf** creates one periodic in v; 
* **uvpbsplinesurf** creates one periodic in uv. 

The syntax is similar to the *bsplinecurve* command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v. 

See *bsplinecurve* to compute the number of poles, the poles are first given in U as in the *beziersurf* command. You must give weights if the surface is rational. 

**Example:** 
~~~~~
# create a bspline surface of degree 1 2 
# with two knots in U and three in V 
bsplinesurf s \ 
1 2 0 2 1 2 \ 
2 3 0 3 1 1 2 3 \ 
0 0 0 1 10 0 5 1 \ 
0 10 2 1 10 10 3 1 \ 
0 20 10 1 10 20 20 1 \ 
0 30 0 1 10 30 0 1 
~~~~~


@subsubsection occt_draw_6_3_8  trim, trimu, trimv

Syntax:      
~~~~~
trim newname name [u1 u2 [v1 v2]] 
trimu newname name 
trimv newname name 
~~~~~

The **trim** commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom* package. 
* *trim* creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface.
* *trimu* creates a u-trimmed surface, 
* *trimv* creates a v-trimmed surface. 

After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed. 

**Note** that a trimmed curve or surface contains a copy of the basis geometry: modifying that will not modify the trimmed geometry. Trimming trimmed geometry will not create multiple levels of trimming. The basis geometry will be used. 

**Example:** 
~~~~~
# create a 3d circle 
circle c 0 0 0 10 

# trim it, use the same variable, the original is 
deleted 
trim c c 0 pi/2 

# the original can be recovered! 
trim orc c 

# trim again 
trim c c pi/4 pi/2 

# the original is not the trimmed curve but the basis 
trim orc c 

# as the circle is periodic, the two following commands 
are identical 
trim cc c pi/2 0 
trim cc c pi/2 2*pi 

# trim an infinite cylinder 
cylinder cy 10 
trimv cy cy 0 50 
~~~~~

@subsubsection occt_draw_6_3_9  offset

Syntax:      
~~~~~
offset name basename distance [dx dy dz]
~~~~~ 

Creates offset curves or surfaces at a given distance from a basis curve or surface. Offset curves and surfaces are classes from the *Geom *package. 

The curve can be a 2d or a 3d curve. To compute the offsets for a 3d curve, you must also give a vector *dx,dy,dz*. For a planar curve, this vector is usually the normal to the plane containing the curve. 

The offset curve or surface copies the basic geometry, which can be modified later. 

**Example:** 
~~~~~
# graphic demonstration that the outline of a torus 
# is the offset of an ellipse 
smallview +X+Y 
dset angle pi/6 
torus t 0 0 0 0 cos(angle) sin(angle) 50 20 
fit 
ellipse e 0 0 0 50 50*sin(angle) 
# note that the distance can be negative 
offset l1 e 20 0 0 1 
~~~~~

@subsubsection occt_draw_6_3_10  revsurf

Syntax:      
~~~~~
revsurf name curvename x y z dx dy dz
~~~~~ 

Creates a surface of revolution from a 3d curve. 

A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution. 

To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian. 

**Example:** 
~~~~~
# another way of creating a torus like surface 
circle c 50 0 0 20 
revsurf s c 0 0 0 0 1 0 
~~~~~

@subsubsection occt_draw_6_3_11  extsurf

Syntax:      
~~~~~
extsurf newname curvename dx dy dz 
~~~~~

Creates a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector. 

In the syntax, *dx,dy,dz* gives the direction of extrusion. 

To parameterize a surface of extrusion: *u* is the parameter along the extruded curve; the *v* parameter is along the direction of extrusion. 

**Example:** 
~~~~~
# an elliptic cylinder 
ellipse e 0 0 0 10 5 
extsurf s e 0 0 1 
# to make it finite 
trimv s s 0 10 
~~~~~

@subsubsection occt_draw_6_3_12  convert

Syntax:      
~~~~~
convert newname name 
~~~~~

Creates a 2d or 3d NURBS curve or a NURBS surface from any 2d curve, 3d curve or surface. In other words, conics, beziers and bsplines are turned into NURBS. Offsets are not processed.
 
**Example:** 
~~~~~
# turn a 2d arc of a circle into a 2d NURBS 
circle c 0 0 5 
trim c c 0 pi/3 
convert c1 c 

# an easy way to make a planar bspline surface 
plane p 
trim p p -1 1 -1 1 
convert p1 p 
~~~~~

**Note** that offset curves and surfaces are not processed by this command.

@subsection occt_draw_6_4  Curve and surface modifications

Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines. 

General modifications: 

  * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**

Modifications for both bezier curves and bsplines: 

  * Exchanging U and V on a surface: **exchuv**
  * Segmentation: **segment**, **segsur**
  * Increasing the degree: **incdeg**, **incudeg**, **incvdeg**
  * Moving poles: **cmovep**, **movep**, **movecolp**, **moverowp**

Modifications for bezier curves: 

  * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**

Modifications for bspline: 

  * Inserting and removing knots: **insertknot**, **remknot**, **insertuknot**, **remuknot**, **insetvknot**, **remvknot**
  * Modifying periodic curves and surfaces: **setperiodic**, **setnotperiodic**, **setorigin**, **setuperiodic**, **setunotperiodic**, **setuorigin**, **setvperiodic**, **setvnotperiodic**, **setvorigin**



@subsubsection occt_draw_6_4_1  reverse, ureverse, vreverse


Syntax:            
~~~~~
reverse curvename 
ureverse surfacename 
vreverse surfacename 
~~~~~

The **reverse** command reverses the parameterization and inverses the orientation of a 2d or 3d curve. Note that the geometry is modified. To keep the curve or the surface, you must copy it before modification. 

**ureverse** or **vreverse** reverse the u or v parameter of a surface. Note that the new parameters of the curve may change according to the type of curve. For instance, they will change sign on a line or stay 0,1 on a bezier. 

Reversing a parameter on an analytical surface may create an indirect coordinate system. 

**Example:** 
~~~~~
# reverse a trimmed 2d circle 
circle c 0 0 5 
trim c c pi/4 pi/2 
reverse c 

# dumping c will show that it is now trimmed between 
# 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4 
~~~~~

@subsubsection occt_draw_6_4_2  exchuv

Syntax:                 
~~~~~
exchuv surfacename 
~~~~~

For a bezier or bspline surface this command exchanges the u and v parameters. 

**Example:** 
~~~~~
# exchanging u and v on a spline (made from a cylinder) 
cylinder c 5 
trimv c c 0 10 
convert c1 c 
exchuv c1 
~~~~~

@subsubsection occt_draw_6_4_3  segment, segsur

Syntax:                  
~~~~~
segment curve Ufirst Ulast 
segsur surface Ufirst Ulast Vfirst Vlast 
~~~~~

**segment** and **segsur** segment a bezier curve and a bspline curve or surface respectively. 

These commands modify the curve to restrict it between the new parameters: *Ufirst*, the starting point of the modified curve, and *Ulast*, the end point. *Ufirst* is less than *Ulast*. 

This command must not be confused with **trim** which creates a new geometry. 

**Example:** 
~~~~~
# segment a bezier curve in half 
beziercurve c 3 0 0 0 10 0 0 10 10 0 
segment c ufirst ulast 
~~~~~

@subsubsection occt_draw_6_4_4  iincudeg, incvdeg

Syntax:      
~~~~~
incudeg surfacename newdegree 
incvdeg surfacename newdegree 
~~~~~

**incudeg** and **incvdeg** increase the degree in the U or V parameter of a bezier or bspline surface.
 
**Example:** 
~~~~~
# make a planar bspline and increase the degree to 2 3 
plane p 
trim p p -1 1 -1 1 
convert p1 p 
incudeg p1 2 
incvdeg p1 3 
~~~~~

**Note** that the geometry is modified.


@subsubsection occt_draw_6_4_5  cmovep, movep, movecolp, moverowp

Syntax:      
~~~~~
cmovep curve index dx dy [dz] 
movep surface uindex vindex dx dy dz 
movecolp surface uindex dx dy dz 
moverowp surface vindex dx dy dz 
~~~~~

**move** methods translate poles of a bezier curve, a bspline curve or a bspline surface. 
* **cmovep** and **movep** translate one pole with a given index. 
* **movecolp** and **moverowp** translate a whole column (expressed by the *uindex*) or row (expressed by the *vindex*) of poles. 

**Example:** 
~~~~~
# start with a plane 
# transform to bspline, raise degree and add relief 
plane p 
trim p p -10 10 -10 10 
convert p1 p 
incud p1 2 
incvd p1 2 
movecolp p1 2 0 0 5 
moverowp p1 2 0 0 5 
movep p1 2 2 0 0 5 
~~~~~

@subsubsection occt_draw_6_4_6  insertpole, rempole, remcolpole, remrowpole

Syntax:                  
~~~~~
insertpole curvename index x y [z] [weight] 
rempole curvename index 
remcolpole surfacename index 
remrowpole surfacename index
~~~~~ 

**insertpole** inserts a new pole into a 2d or 3d bezier curve. You may add a weight for the pole. The default value for the weight is 1. The pole is added at the position after that of the index pole. Use an index 0 to insert the new pole before the first one already existing in your drawing. 

**rempole** removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves. 

**remcolpole** and **remrowpole** remove a column or a row of poles from a bezier surface. A column is in the v direction and a row in the u direction The resulting degree must be at least 1; i.e there will be two rows and two columns left. 

**Example:** 
~~~~~
# start with a segment, insert a pole at end 
# then remove the central pole 
beziercurve c 2 0 0 0 10 0 0 
insertpole c 2 10 10 0 
rempole c 2 
~~~~~

@subsubsection occt_draw_6_4_7  insertknot, insertuknot, insertvknot

Syntax:                  
~~~~~
insertknot name knot [mult = 1] [knot mult ...] 
insertuknot surfacename knot mult 
insertvknot surfacename knot mult 
~~~~~

**insertknot** inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised. 

**insertuknot** and **insertvknot** insert knots in a surface. 

**Example:** 
~~~~~
# create a cylindrical surface and insert a knot 
cylinder c 10 
trim c c 0 pi/2 0 10 
convert c1 c 
insertuknot c1 pi/4 1 
~~~~~

@subsubsection occt_draw_6_4_8  remknot, remuknot, remvknot

Syntax:      
~~~~~
remknot index [mult] [tol] 
remuknot index [mult] [tol] 
remvknot index [mult] [tol] 
~~~~~

**remknot** removes a knot from the knot sequence of a curve or a surface. Give the index of the knot and optionally, the target multiplicity. If the target multiplicity is not 0, the multiplicity of the knot will be lowered. As the curve may be modified, you are allowed to set a tolerance to control the process. If the tolerance is low, the knot will only be removed if the curve will not be modified. 

By default, if no tolerance is given, the knot will always be removed. 

**Example:** 
~~~~~
# bspline circle, remove a knot 
circle c 0 0 5 
convert c1 c 
incd c1 5 
remknot c1 2 
~~~~~

**Note** that Curves or Surfaces may be modified.


@subsubsection occt_draw_6_4_9  setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic

Syntax:      
~~~~~
setperiodic curve 
setnotperiodic curve 
setuperiodic surface 
setunotperiodic surface 
setvperiodic surface 
setvnotperiodic surface
~~~~~ 

**setperiodic** turns a bspline curve into a periodic bspline curve; the knot vector stays the same and excess poles are truncated. The curve may be modified if it has not been closed. **setnotperiodic** removes the periodicity of a periodic curve. The pole table mau be modified. Note that knots are added at the beginning and the end of the knot vector and the multiplicities are knots set to degree+1 at the start and the end. 

**setuperiodic** and **setvperiodic** make the u or the v parameter of bspline surfaces periodic; **setunotperiodic**, and **setvnotperiodic** remove periodicity from the u or the v parameter of bspline surfaces. 

**Example:** 
~~~~~
# a circle deperiodicized 
circle c 0 0 5 
convert c1 c 
setnotperiodic c1 
~~~~~

@subsubsection occt_draw_6_4_10  setorigin, setuorigin, setvorigin

Syntax:      
~~~~~
setorigin curvename index 
setuorigin surfacename index 
setuorigin surfacename index 
~~~~~

These commands change the origin of the parameters on periodic curves or surfaces. The new origin must be an existing knot. To set an origin other than an existing knot, you must first insert one with the *insertknot* command. 

**Example:** 
~~~~~
# a torus with new U and V origins 
torus t 20 5 
convert t1 t 
setuorigin t1 2 
setvorigin t1 2
~~~~~ 


@subsection occt_draw_6_5  Transformations

Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling. 

@subsubsection occt_draw_6_5_1  translate, dtranslate

Syntax:                  
~~~~~
translate name [names ...] dx dy dz 
2dtranslate name [names ...] dx dy 
~~~~~

The **Translate** command translates 3d points, curves and surfaces along a vector *dx,dy,dz*. You can translate more than one object with the same command. 

For 2d points or curves, use the **2dtranslate** command. 

**Example:** 
~~~~~
# 3d tranlation 
point p 10 20 30 
circle c 10 20 30 5 
torus t 10 20 30 5 2 
translate p c t 0 0 15
~~~~~
 
*NOTE* 
*Objects are modified by this command.* 

@subsubsection occt_draw_6_5_2  rotate, 2drotate

Syntax:      
~~~~~
rotate name [name ...] x y z dx dy dz angle 
2drotate name [name ...] x y angle
~~~~~ 

The **rotate** command rotates a 3d point curve or surface. You must give an axis of rotation with a point *x,y,z*, a vector *dx,dy,dz* and an angle in degrees. 

For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative. 

**Example:** 
~~~~~
# make a helix of circles. create a script file with 
this code and execute it using **source**. 
circle c0 10 0 0 3 
for {set i 1} {$i <= 10} {incr i} { 
copy c[expr $i-1] c$i 
translate c$i 0 0 3 
rotate c$i 0 0 0 0 0 1 36 
} 
~~~~~

@subsubsection occt_draw_6_5_3  pmirror, lmirror, smirror, dpmirror, dlmirror

Syntax:      
~~~~~
pmirror name [names ...] x y z 
lmirror name [names ...] x y z dx dy dz 
smirror name [names ...] x y z dx dy dz 
2dpmirror name [names ...] x y 
2dlmirror name [names ...] x y dx dy 
~~~~~

The mirror commands perform a mirror transformation of 2d or 3d geometry. 

* **pmirror** is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. 
* **lmirror** is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry.
* **smirror** is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz. 
* **2dpmirror** is the point mirror in 2D.
* **2dlmirror** is the axis symmetry mirror in 2D.

**Example:** 
~~~~~
# build 3 images of a torus 
torus t 10 10 10 1 2 3 5 1 
copy t t1 
pmirror t1 0 0 0 
copy t t2 
lmirror t2 0 0 0 1 0 0 
copy t t3 
smirror t3 0 0 0 1 0 0 
~~~~~

@subsubsection occt_draw_6_5_4  pscale, dpscale

Syntax:                  
~~~~~
pscale name [name ...] x y z s 
2dpscale name [name ...] x y s 
~~~~~

The **pscale** and **2dpscale** commands transform an object by point scaling. You must give the center and the scaling factor. Because other scalings modify the type of the object, they are not provided. For example, a sphere may be transformed into an ellipsoid. Using a scaling factor of -1 is similar to using **pmirror**.

 
**Example:** 
~~~~~
# double the size of a sphere 
sphere s 0 0 0 10 
pscale s 0 0 0 2 
~~~~~

@subsection occt_draw_6_6  Curve and surface analysis

**Draw** provides methods to compute information about curves and surfaces: 

  * **coord** to find the coordinates of a point.
  * **cvalue** and **2dcvalue** to compute points and derivatives on curves.
  * **svalue** to compute points and derivatives on a surface.
  * **localprop** and **minmaxcurandif** to compute the curvature on a curve.
  * **parameters** to compute (u,v) values for a point on a surface.
  * **proj** and **2dproj** to project a point on a curve or a surface.
  * **surface_radius** to compute the curvature on a surface.

@subsubsection occt_draw_6_6_1  coord

Syntax:            
~~~~~
coord P x y [z] 
~~~~~

Sets the x, y (and optionally z) coordinates of the point P. 

**Example:** 
~~~~~
# translate a point 
point p 10 5 5 
translate p 5 0 0 
coord p x y z 
# x value is 15 
~~~~~


@subsubsection occt_draw_6_6_2   cvalue, 2dcvalue

Syntax:      
~~~~~
cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]] 
2dcvalue curve U x y [d1x d1y [d2x d2y]] 
~~~~~

For a curve at a given parameter, and depending on the number of arguments, **cvalue** computes the coordinates in *x,y,z*, the first derivative in *d1x,d1y,d1z* and the second derivative in *d2x,d2y,d2z*. 

**Example:**

Let on a bezier curve at parameter 0 the point is the first pole; the first derivative is the vector to the second pole multiplied by the degree; the second derivative is the difference first to the second pole, second to the third pole multipied by *degree-1* : 

~~~~~
2dbeziercurve c 4 0 0 1 1 2 1 3 0 
2dcvalue c 0 x y d1x d1y d2x d2y 

# values of x y d1x d1y d2x d2y 
# are 0 0 3 3 0 -6 
~~~~~

@subsubsection occt_draw_6_6_3  svalue

Syntax: 
~~~~~
svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]] 
~~~~~

Computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute the first and the second derivatives. 

**Example:** 
~~~~~
# display points on a sphere 
sphere s 10 
for {dset t 0} {[dval t] <= 1} {dset t t+0.01} { 
svalue s t*2*pi t*pi-pi/2 x y z 
point . x y z 
} 
~~~~~

@subsubsection occt_draw_6_6_4  localprop, minmaxcurandinf

Syntax:      
~~~~~
localprop curvename U 
minmaxcurandinf curve
~~~~~ 

**localprop** computes the curvature of a curve. 
**minmaxcurandinf** computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve. 

**Example:** 
~~~~~
# show curvature at the center of a bezier curve 
beziercurve c 3 0 0 0 10 2 0 20 0 0 
localprop c 0.5 
== Curvature : 0.02 
~~~~~

@subsubsection occt_draw_6_6_5  parameters

Syntax:      
~~~~~
parameters surf/curve x y z U [V] 
~~~~~

Returns the parameters on the surface of the 3d point *x,y,z* in variables *u* and *v*. This command may only be used on analytical surfaces: plane, cylinder, cone, sphere and torus. 

**Example:** 
~~~~~
# Compute parameters on a plane 
plane p 0 0 10 1 1 0 
parameters p 5 5 5 u v 
# the values of u and v are : 0 5 
~~~~~

@subsubsection occt_draw_6_6_6  proj, 2dproj

Syntax:      
~~~~~
proj name x y z 
2dproj name xy 
~~~~~

Use **proj** to project a point on a 3d curve or a surface and **2dproj** for a 2d curve. 

The command will compute and display all points in the projection. The lines joining the point to the projections are created with the names *ext_1, ext_2, ... *

**Example:** 

Let us project a point on a torus 

~~~~~
torus t 20 5 
proj t 30 10 7 
== ext_1 ext_2 ext_3 ext_4 
~~~~~

@subsubsection occt_draw_6_6_7  surface_radius

Syntax:      
~~~~~
surface_radius surface u v [c1 c2] 
~~~~~

Computes the main curvatures of a surface at parameters *(u,v)*. If there are extra arguments, their curvatures are stored in variables *c1* and *c2*. 

**Example:** 

Let us compute curvatures of a cylinder:

~~~~~
cylinder c 5 
surface_radius c pi 3 c1 c2 
== Min Radius of Curvature : -5 
== Min Radius of Curvature : infinite 
~~~~~


@subsection occt_draw_6_7  Intersections

* **intersect** computes intersections of surfaces; 
* **2dintersect** computes intersections of 2d curves.
* **intconcon** computes intersections of 2d conic curves.

@subsubsection occt_draw_6_7_1  intersect

Syntax:      
~~~~~
intersect name surface1 surface2
~~~~~ 

Intersects two surfaces; if there is one intersection curve it will be named *name*, if there are more than one they will be named *name_1*, *name_2*, ... 

**Example:** 
~~~~~
# create an ellipse 
cone c 45 0 
plane p 0 0 40 0 1 5 
intersect e c p 
~~~~~

@subsubsection occt_draw_6_7_2  2dintersect

Syntax:      
~~~~~
2dintersect curve1 [curve2] [-tol tol] [-state]
~~~~~

Displays the intersection points between 2d curves.
Options:
 -tol - allows changing the intersection tolerance (default value is 1.e-3);
 -state - allows printing the intersection state for each point.

**Example:** 
~~~~~
# intersect two 2d ellipses 
ellipse e1 0 0 5 2 
ellipse e2 0 0 0 1 5 2 
2dintersect e1 e2 -tol 1.e-10 -state
~~~~~

@subsubsection occt_draw_6_7_3 intconcon

Syntax:      
~~~~~
intconcon curve1 curve2 
~~~~~

Displays the intersection points between two 2d curves. 
Curves must be only conic sections: 2d lines, circles, ellipses,
hyperbolas, parabolas. The algorithm from *IntAna2d_AnaIntersection* is used.

**Example:** 
~~~~~
# intersect two 2d ellipses 
ellipse e1 0 0 5 2 
ellipse e2 0 0 0 1 5 2 
intconcon e1 e2 
~~~~~

@subsection occt_draw_6_8  Approximations

Draw provides command to create curves and surfaces by approximation. 

* **2dapprox** fits a curve through 2d points; 
* **appro** fits a curve through 3d points;
* **surfapp** and **grilapp** fit a surface through 3d points by approximation;
* **surfint** fit a surface through 3d points by interpolation;
* **2dinterpole** interpolates a curve. 

@subsubsection occt_draw_6_8_1   appro, dapprox

Syntax:      
~~~~~
appro result nbpoint [curve] 
2dapprox result nbpoint [curve / x1 y1 x2 y2]
~~~~~ 

These commands fit a curve through a set of points. First give the number of points, then choose one of the three ways available to get the points. If you have no arguments, click on the points. If you have a curve argument or a list of points, the command launches computation of the points on the curve. 

**Example:** 

Let us pick points and they will be fitted 

~~~~~
2dapprox c 10 
~~~~~

@subsubsection occt_draw_6_8_2  surfapp, grilapp, surfint


Syntax: 
~~~~~
surfapp name nbupoints nbvpoints x y z .... 
or
surfapp name nbupoints nbvpoints surf [periodic_flag = 0]
grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ... 
surfint name surf nbupoints nbvpoints [periodic_flag = 0]
~~~~~

* **surfapp** fits a surface through an array of u and v points, nbupoints*nbvpoints. 
* **grilapp** has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy. 
* **surfapp** can take array of points from other input surface, if alternative syntax
**surfapp** name nbupoints nbvpoints surf [periodic_flag = 0]
is used.
Both command use for fitting approximation algorithm.
**surfint** uses interpolation algorithm and can take array of point only from other input surface.
Optional parameter **periodic_flag** allows to get correct periodical surfaces in U direction.
U direction of result surface corresponds colums of initial array of points.
If **periodic_flag** = 1, algorithm uses first row of array as last row and builds periodical surface.

**Example:** 
~~~~~
# a surface using the same data as in the beziersurf 
example sect 4.4 
surfapp s 3 4 \ 
0 0 0 10 0 5 20 0 0 \ 
0 10 2 10 10 3 20 10 2 \ 
0 20 10 10 20 20 20 20 10 \ 
0 30 0 10 30 0 20 30 0 
~~~~~

@subsection  occt_draw_6_9  Projections

Draw provides commands to project points/curves on curves/surfaces.

* **proj** projects point on the curve/surface (see @ref occt_draw_6_6_6 "proj command description");
* **project** projects 3D curve on the surface (see @ref occt_draw_6_2_11 "project command description");
* **projponf** projects point on the face.

@subsubsection  occt_draw_6_9_1 projponf

Syntax:
~~~~~
projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]
~~~~~

**projponf** projects point *pnt* on the face *face*.
You can change the Extrema options:
* To change the Extrema search algorithm use the following options:<br>
 -g - for Grad algorithm;<br>
 -t - for Tree algorithm;
* To change the Extrema search solutions use the following options:<br>
 -min - to look for Min solutions;<br>
 -max - to look for Max solutions;<br>
 -minmax - to look for MinMax solutions.

**Example**
~~~~~
plane p 0 0 0 0 0 1
mkface f p
point pnt 5 5 10

projponf f pnt
# proj dist = 10
# uvproj = 5 5
# pproj = 5 5 0
~~~~~

@subsection occt_draw_6_10  Constraints

* **cirtang** constructs 2d circles tangent to curves;
* **lintan** constructs 2d lines tangent to curves. 


@subsubsection occt_draw_6_10_1  cirtang

Syntax: 
~~~~~
cirtang result [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...
~~~~~

Builds all circles satisfying the condition: 
1. the circle must be tangent to every given curve;
2. the circle must pass through every given point;
3. the radius of the circle must be equal to the requested one. 

Only following set of input data is supported: Curve-Curve-Curve, Curve-Curve-Point, Curve-Curve-Radius, Curve-Point-Point, Curve-Point-Radius, Point-Point-Point, Point-Point-Radius. The solutions will be stored in variables *result_1*, *result_2*, etc.

**Example:** 
~~~~~
# a point, a line and a radius. 2 solutions of type Curve-Point-Radius (C-P-R)
point p 0 0 
line l 10 0 -1 1 
cirtang c -p p -c l -r 4 
== Solution of type C-P-R is: c_1 c_2
~~~~~

Additionally it is possible to create a circle(s) with given center and tangent to the given curve (Curve-Point type).

**Example:** 
~~~~~
point pp 1 1
2dbsplinecurve cc 1 2 0 2 1 2 -10 -5 1 10 -5 1
cirtang r -p pp -c cc 
== Solution of type C-P is: r_1 r_2 
~~~~~

@subsubsection occt_draw_6_10_2  lintan

Syntax:      
~~~~~
lintan name curve curve [angle] 
~~~~~

Builds all 2d lines tangent to two curves. If the third angle argument is given the second curve must be a line and **lintan** will build all lines tangent to the first curve and forming the given angle with the line. The angle is given in degrees. The solutions are named *name_1*, *name_2*, etc. 

**Example:** 
~~~~~
# lines tangent to 2 circles, 4 solutions 
circle c1 -10 0 10 
circle c2 10 0 5 
lintan l c1 c2 

# lines at 15 degrees tangent to a circle and a line, 2 
solutions: l1_1 l1_2 
circle c1 -10 0 1 
line l 2 0 1 1 
lintan l1 c1 l 15 
~~~~~

@subsection occt_draw_6_11  Display

Draw provides commands to control the display of geometric objects. Some display parameters are used for all objects, others are valid for surfaces only, some for bezier and bspline only, and others for bspline only. 

On curves and surfaces, you can control the mode of representation with the **dmode** command. You can control the parameters for the mode with the **defle** command and the **discr** command, which control deflection and discretization respectively. 

On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso** command. 

On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles** and **shpoles** commands. 

On bspline curves and surfaces you can toggle the display of the knots with the **shknots** and **clknots** commands. 


@subsubsection occt_draw_6_11_1  dmod, discr, defle

Syntax:      
~~~~~
dmode name [name ...] u/d 
discr name [name ...] nbintervals 
defle name [name ...] deflection 
~~~~~

**dmod** command allows choosing the display mode for a curve or a surface. 

In mode *u*, or *uniform deflection*, the points are computed to keep the polygon at a distance lower than the deflection of the geometry. The deflection is set with the *defle* command. This mode involves intensive use of computational power. 

In *d*, or discretization mode, a fixed number of points is computed. This number is set with the *discr* command. This is the default mode. On a bspline, the fixed number of points is computed for each span of the curve. (A span is the interval between two knots). 

If the curve or the isolines seem to present too many angles, you can either increase the discretization or lower the deflection, depending on the mode. This will increase the number of points. 

**Example:** 
~~~~~
# increment the number of points on a big circle 
circle c 0 0 50 50 
discr 100 

# change the mode 
dmode c u 
~~~~~

@subsubsection occt_draw_6_11_2   nbiso

Syntax:      
~~~~~
nbiso name [names...] nuiso nviso 
~~~~~

Changes the number of isoparametric curves displayed on a surface in the U and V directions. On a bspline surface, isoparametric curves are displayed by default at knot values. Use *nbiso* to turn this feature off. 

**Example:** 

Let us  display 35 meridians and 15 parallels on a sphere:
~~~~~ 
sphere s 20 
nbiso s 35 15 
~~~~~

@subsubsection occt_draw_6_11_3  clpoles, shpoles

Syntax:      
~~~~~
clpoles name 
shpoles name 
~~~~~

On bezier and bspline curves and surfaces, the control polygon is displayed by default: *clpoles* erases it and *shpoles* restores it. 

**Example:** 

Let us make a bezier curve and erase the poles 

~~~~~
beziercurve c 3 0 0 0 10 0 0 10 10 0 
clpoles c 
~~~~~

@subsubsection occt_draw_6_11_4  clknots, shknots

Syntax:   
~~~~~
clknots name 
shknots name 
~~~~~

By default, knots on a bspline curve or surface are displayed with markers at the points with parametric value equal to the knots. *clknots* removes them and *shknots* restores them. 

**Example:** 
~~~~~
# hide the knots on a bspline curve 
bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
clknots bc
~~~~~


@section occt_draw_7 Topology commands

Draw provides a set of commands to test OCCT Topology libraries. The Draw commands are found in the DRAWEXE executable or in any executable including the BRepTest commands. 

Topology defines the relationship between simple geometric entities, which can thus be linked together to represent complex shapes. The type of variable used by Topology in Draw is the shape variable. 

The <a href="user_guides__modeling_data.html#occt_modat_5">different topological shapes</a> include: 

  * **COMPOUND**: A group of any type of topological object.
  * **COMPSOLID**: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
  * **SOLID**: A part of space limited by shells. It is three dimensional.
  * **SHELL**: A set of faces connected by their edges. A shell can be open or closed.
  * **FACE**: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
  * **WIRE**: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
  * **EDGE**: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
  * **VERTEX**: A topological element corresponding to a point. It has a zero dimension.

Shapes are usually shared. **copy** will create a new shape which shares its representation with the original. Nonetheless, two shapes sharing the same topology can be moved independently (see the section on **transformation**). 

The following topics are covered in the eight sections of this chapter: 

  * Basic shape commands to handle the structure of shapes and control the display.
  * Curve and surface topology, or methods to create topology from geometry and vice versa.
  * Primitive construction commands: box, cylinder, wedge etc.
  * Sweeping of shapes.
  * Transformations of shapes: translation, copy, etc.
  * Topological operations, or booleans.
  * Drafting and blending.
  * Defeaturing.
  * Making shapes periodic in 3D space.
  * Making shapes connected.
  * Analysis of shapes.


@subsection occt_draw_7_1  Basic topology

The set of basic commands allows simple operations on shapes, or step-by-step construction of objects. These commands are useful for analysis of shape structure and include: 

  * **isos** and **discretisation** to control display of shape faces by isoparametric curves .
  * **orientation**, **complement** and **invert** to modify topological attributes such as orientation.
  * **explode**, **exwire** and **nbshapes** to analyze the structure of a shape.
  * **emptycopy**, **add**, **compound** to create shapes by stepwise construction.

In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges: 

  * a red edge is an isolated edge, which belongs to no faces.
  * a green edge is a free boundary edge, which belongs to one face,
  * a yellow edge is a shared edge, which belongs to at least two faces.


@subsubsection occt_draw_7_1_1  isos, discretisation

Syntax:                  
~~~~~
isos [name ...][nbisos] 
discretisation nbpoints
~~~~~
 
Determines or changes the number of isoparametric curves on shapes. 

The same number is used for the u and v directions. With no arguments, *isos* prints the current default value. To determine, the number of isos for a shape, give it name as the first argument. 

*discretisation* changes the default number of points used to display the curves. The default value is 30. 

**Example:** 
~~~~~
# Display only the edges (the wireframe) 
isos 0 
~~~~~

**Warning**: don’t confuse *isos* and *discretisation* with the geometric commands *nbisos* and *discr*. 


@subsubsection occt_draw_7_1_2  orientation, complement, invert, normals, range

Syntax:      
~~~~~
orientation name [name ...] F/R/E/I 
complement name [name ...] 
invert name 
normals s (length = 10), disp normals 
range name value value 
~~~~~

* **orientation** -- assigns the orientation of simple and complex shapes to one of the following four values: *FORWARD, REVERSED, INTERNAL, EXTERNAL*. 
* **complement** -- changes the current orientation of shapes to its complement: *FORWARD* to *REVERSED* and  *INTERNAL* to *EXTERNAL*. 
* **invert** -- creates a copy of the original shape with a reversed orientation of all subshapes. For example, it may be useful to reverse the normals of a solid. 
* *normals** -- returns the assignment of colors to orientation values. 
* **range** -- defines the length of a selected edge by defining the values of a starting point and an end point.
 
**Example:** 
~~~~~
# to invert normals of a box 
box b 10 20 30 
normals b 5 
invert b 
normals b 5 

# to assign a value to an edge 
box b1 10 20 30 
# to define the box as edges 
explode b1 e 
b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 
# to define as an edge 
makedge e 1 
# to define the length of the edge as starting from 0 
and finishing at 1 
range e 0 1 
~~~~~

@subsubsection occt_draw_7_1_3  explode, exwire, nbshapes

Syntax:      
~~~~~
explode name [C/So/Sh/F/W/E/V] 
exwire name 
nbshapes name 
~~~~~

**explode** extracts subshapes from an entity. The subshapes will be named *name_1*, *name_2*, ... Note that they are not copied but shared with the original. 

With name only, **explode** will extract the first sublevel of shapes: the shells of a solid or the edges of a wire, for example. With one argument, **explode** will extract all subshapes of that type: *C* for compounds, *So* for solids, *Sh* for shells, *F* for faces, *W* for wires, *E* for edges, *V* for vertices. 

**exwire** is a special case of **explode** for wires, which extracts the edges in an ordered way, if possible. Each edge, for example, is connected to the following one by a vertex. 

**nbshapes** counts the number of shapes of each type in an entity. 

**Example:** 
~~~~~
# on a box 
box b 10 20 30 

# whatis returns the type and various information 
whatis b 
= b is a shape SOLID FORWARD Free Modified 

# make one shell 
explode b 
whatis b_1 
= b_1 is a shape SHELL FORWARD Modified Orientable 
Closed 

# extract the edges b_1, ... , b_12 
explode b e 
==b_1 ... b_12 

# count subshapes 
nbshapes b 
== 
Number of shapes in b 
VERTEX : 8 
EDGE : 12 
WIRE : 6 
FACE : 6 
SHELL : 1 
SOLID : 1 
COMPSOLID : 0 
COMPOUND : 0 
SHAPE : 34 
~~~~~

@subsubsection occt_draw_7_1_4  emptycopy, add, compound

Syntax:                  
~~~~~
emptycopy [newname] name 
add name toname 
compound [name ...] compoundname 
~~~~~

**emptycopy** returns an empty shape with the same orientation, location, and geometry as the target shape, but with no sub-shapes. If the **newname** argument is not given, the new shape is stored with the same name. This command is used to modify a frozen shape. A frozen shape is a shape used by another one. To modify it, you must **emptycopy** it. Its subshape may be reinserted with the **add** command. 

**add** inserts shape *C* into shape *S*. Verify that *C* and *S* reference compatible types of objects: 
  * Any *Shape* can be added to a *Compound*.
  * Only a *Solid* can be added to a *CompSolid*.
  * Only a *Shell* can *Edge* or a *Vertex* can be added into a *Solid*.
  * Only a *Face* can be added to a *Shell*.
  * Only a *Wire* and *Vertex* can be added in a *Solid*.
  * Only an *Edge* can be added to a *Wire*.
  * Only a *Vertex* can be added to an *Edge*.
  * Nothing can be added to a *Vertex*.

**emptycopy** and **add** should be used with care. 

On the other hand, **compound** is a safe way to achieve a similar result. It creates a compound from shapes. If no shapes are given, the compound is empty. 

**Example:** 
~~~~~
# a compound with three boxes 
box b1 0 0 0 1 1 1 
box b2 3 0 0 1 1 1 
box b3 6 0 0 1 1 1 
compound b1 b2 b3 c 
~~~~~


@subsubsection occt_draw_7_1_5  compare

Syntax:
~~~~~
compare shape1 shape2
~~~~~

**compare** compares the two shapes *shape1* and *shape2* using the methods *TopoDS_Shape::IsSame()* and *TopoDS_Shape::IsEqual()*.

**Example**
~~~~~
box b1 1 1 1
copy b1 b2
compare b1 b2
# same shapes
# equal shapes

orientation b2 R
compare b1 b2
# same shapes

box b2 1 1 1
compare b1 b2
# shapes are not same
~~~~~

@subsubsection occt_draw_7_1_6  issubshape

Syntax:
~~~~~
issubshape subshape shape
~~~~~

**issubshape** checks if the shape *subshape* is sub-shape of the shape *shape* and gets its index in the shape.

**Example**
~~~~~
box b 1 1 1
explode b f
issubshape b_2 b
# b_2 is sub-shape of b. Index in the shape: 2.
~~~~~


@subsection occt_draw_7_2  Curve and surface topology

This group of commands is used to create topology from shapes and to extract shapes from geometry. 

  * To create vertices, use the **vertex** command.
  * To create edges use, the **edge**, **mkedge** commands.
  * To create wires, use the **wire**, **polyline**, **polyvertex** commands.
  * To create faces, use the **mkplane**, **mkface** commands.
  * To extract the geometry from edges or faces, use the **mkcurve** and **mkface** commands.
  * To extract the 2d curves from edges or faces, use the **pcurve** command.


@subsubsection occt_draw_7_2_1  vertex

Syntax:      
~~~~~
vertex name [x y z / p edge] 
~~~~~

Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge. 

**Example:** 
~~~~~
vertex v1 10 20 30 
~~~~~

@subsubsection occt_draw_7_2_1a  mkpoint

Syntax:
~~~~~
mkpoint name vertex
~~~~~

Creates a point from the coordinates of a given vertex.

**Example:** 
~~~~~
mkpoint p v1
~~~~~

@subsubsection occt_draw_7_2_2  edge, mkedge, uisoedge, visoedge

Syntax:      
~~~~~
edge name vertex1 vertex2 
mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]] 
uisoedge edge face u v1 v2 
visoedge edge face v u1 u2 
~~~~~

* **edge** creates a straight line edge between two vertices. 
* **mkedge** generates edges from curves<.Two parameters can be given for the vertices: the first and last parameters of the curve are given by default. Vertices can also be given with their parameters, this option allows blocking the creation of new vertices. If the parameters of the vertices are not given, they are computed by projection on the curve. Instead of a 3d curve, a 2d curve and a surface can be given. 

**Example:** 
~~~~~
# straight line edge 
vertex v1 10 0 0 
vertex v2 10 10 0 
edge e1 v1 v2 

# make a circular edge 
circle c 0 0 0 5 
mkedge e2 c 0 pi/2 

# A similar result may be achieved by trimming the curve 
# The trimming is removed by mkedge 
trim c c 0 pi/2 
mkedge e2 c 
~~~~~

* **visoedge** and **uisoedge** are commands that generate a *uiso* parameter edge or a *viso* parameter edge. 

**Example:** 
~~~~~
# to create an edge between v1 and v2 at point u 
# to create the example plane 
plane p 
trim p p 0 1 0 1 
convert p p 
incudeg p 3 
incvdeg p 3 
movep p 2 2 0 0 1 
movep p 3 3 0 0 0.5 
mkface p p 
# to create the edge in the plane at the u axis point 
0.5, and between the v axis points v=0.2 and v =0.8 
uisoedge e p 0.5 0.20 0.8 
~~~~~

@subsubsection occt_draw_7_2_3  wire, polyline, polyvertex

Syntax:      
~~~~~
wire wirename e1/w1 [e2/w2 ...] 
polyline name x1 y1 z1 x2 y2 z2 ... 
polyvertex name v1 v2 ... 
~~~~~

**wire** creates a wire from edges or wires. The order of the elements should ensure that the wire is connected, and vertex locations will be compared to detect connection. If the vertices are different, new edges will be created to ensure topological connectivity. The original edge may be copied in the new one. 

**polyline** creates a polygonal wire from point coordinates. To make a closed wire, you should give the first point again at the end of the argument list. 

**polyvertex** creates a polygonal wire from vertices. 

**Example:** 
~~~~~
# create two polygonal wires 
# glue them and define as a single wire 
polyline w1 0 0 0 10 0 0 10 10 0 
polyline w2 10 10 0 0 10 0 0 0 0 
wire w w1 w2 
~~~~~

@subsubsection occt_draw_7_2_4  profile

Syntax       
~~~~~
profile name [code values] [code values] ... 
~~~~~


**profile** builds a profile in a plane using a moving point and direction. By default, the profile is closed and a face is created. The original point is 0 0, and direction is 1 0 situated in the XY plane. 


| **Code**     |    **Values **    |       **Action** |
| :------------ | :------------- | :---------------- |
| O                 |                     X Y Z      |          Sets the origin of the plane |
| P                 |         DX DY DZ UX UY UZ  |  Sets the normal and X of the plane |
| F                 |                      X Y    |               Sets the first point |
| X                 |                      DX      |             Translates a point along X |
| Y                 |                      DY       |            Translates a point along Y |
| L                 |                      DL        |            Translates a point along direction |
| XX                |                    X           |           Sets point X coordinate |
| YY                |                    Y           |           Sets point Y coordinate |
| T                 |                      DX DY     |         Translates a point |
| TT                |                     X Y        |           Sets a point |
| R                 |                      Angle     |           Rotates direction |
| RR                |                    Angle       |         Sets direction |
| D                 |                     DX DY      |        Sets direction |
| IX                |                      X         |             Intersects with vertical |
| IY                |                      Y         |             Intersects with horizontal |
| C                 |                Radius Angle    |      Arc of circle tangent to direction |


Codes and values are used to define the next point or change the direction. When the profile changes from a straight line to a curve, a tangent is created. All angles are in degrees and can be negative. 

The point [code values] can be repeated any number of times and in any order to create the profile contour. 

| Suffix | Action |
| :----- | :----- |
| No suffix  |             Makes a closed face |
| W          |               Make a closed wire |
| WW         |            Make an open wire |

The profile shape definition is the suffix; no suffix produces a face, *w* is a closed wire, *ww* is an open wire. 

Code letters are not case-sensitive. 

**Example:** 
~~~~~
# to create a trianglular plane using a vertex at the 
origin, in the xy plane 
profile p O 0 0 0 X 1 Y 0 x 1 y 1 
~~~~~

**Example:** 
~~~~~
# to create a contour using the different code 
possibilities 

# two vertices in the xy plane 
profile p F 1 0 x 2 y 1 ww 

# to view from a point normal to the plane 
top 

# add a circular element of 45 degrees 
profile p F 1 0 x 2 y 1 c 1 45 ww 

# add a tangential segment with a length value 1 
profile p F 1 0 x 2 y 1 c 1 45 l 1 ww 

# add a vertex with xy values of 1.5 and 1.5 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 ww 

# add a vertex with the x value 0.2, y value is constant 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 ww 

# add a vertex with the y value 2 x value is constant 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 yy 2 ww 

# add a circular element with a radius value of 1 and a circular value of 290 degrees 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 

# wire continues at a tangent to the intersection x = 0 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 ww 

# continue the wire at an angle of 90 degrees until it intersects the y axis at y= -o.3 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 ww 

#close the wire 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 w 

# to create the plane with the same contour 
profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 yy 2 c 1 290 ix 0 r 90 ix -0.3 
~~~~~

@subsubsection occt_draw_7_2_5   bsplineprof

Syntax:      
~~~~~
bsplineprof name [S face] [W WW] 
~~~~~

* for an edge : \<digitizes\> ... <mouse button 2>
* to end profile : <mouse button 3>

Builds a profile in the XY plane from digitizes. By default the profile is closed and a face is built. 

**bsplineprof** creates a 2d profile from bspline curves using the mouse as the input. *MB1* creates the points, *MB2* finishes the current curve and starts the next curve, *MB3* closes the profile. 

The profile shape definition is the suffix; no suffix produces a face, **w** is a closed wire, **ww** is an open wire. 

**Example:** 
~~~~~
#to view the xy plane 
top 
#to create a 2d curve with the mouse 
bsplineprof res 
# click mb1 to start the curve 
# click mb1 to create the second vertex 
# click mb1 to create a curve 
== 
#click mb2 to finish the curve and start a new curve 
== 
# click mb1 to create the second curve 
# click mb3 to create the face 
~~~~~

@subsubsection occt_draw_7_2_6  mkoffset

**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurrences is not limited. 
The offset distance defines the spacing and the positioning of the occurrences. 

Syntax:      
~~~~~
mkoffset result shape nboffset stepoffset [jointype(a/i) [alt]]
~~~~~
where:
* *result* - the base name for the resulting wires. The index of the occurrence (starting with 1) will be added to this name, so the resulting wires will have the names - *result_1*, *result_2* ...;
* *shape* - input shape (face or compound of wires);
* *nboffset* - the number of the parallel occurrences;
* *stepoffset* - offset distance between occurrences;
* *jointype(a/i)* - join type (a for *arc* (default) and i for *intersection*);
* *alt* - altitude from the plane of the input face in relation to the normal to the face.


**Example:** 
~~~~~
# Create a box and select a face 
box b 1 2 3 
explode b f 
# Create three exterior parallel contours with an offset value of 2 
mkoffset r b_1 3 2 
# wires r_1, r_2 and r_3 are created

# Create three exterior parallel contours with an offset value of 2 without round corners
mkoffset r b_1 3 2 i
# wires r_1, r_2 and r_3 are created

# Create one interior parallel contour with an offset value of 0.4 
mkoffset r b_1 1 -0.4 
~~~~~

**Note** that on a concave input contour for an interior step *mkoffset* command may produce several wires which will be contained in a single compound.

**Example:** 
~~~~~
# to create the example contour 
profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w 
# creates an incoherent interior offset 
mkoffset r p 1 -0.50 

# creates two incoherent wires 
mkoffset r p 1 -0.55 
# r_1 is a compound of two wires
~~~~~

@subsubsection occt_draw_7_2_7  mkplane, mkface

Syntax:      
~~~~~
mkplane name wire 
mkface name surface [ufirst ulast vfirst vlast] 
~~~~~

**mkplane** generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire. 

**mkface** generates a face from a surface. Parameter values can be given to trim a rectangular area. The default boundaries are those of the surface. 

**Example:** 
~~~~~
# make a polygonal face 
polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0 
mkplane f f 

# make a cylindrical face 
cylinder g 10 
trim g g -pi/3 pi/2 0 15 
mkface g g 
~~~~~

@subsubsection occt_draw_7_2_8  mkcurve, mksurface

Syntax:      
~~~~~
mkcurve curve edge 
mksurface name face 
~~~~~

**mkcurve** creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries. 

**mksurface** creates a surface from a face. The surface will not be trimmed. 

**Example:** 
~~~~~
# make a line 
vertex v1 0 0 0 
vertex v2 10 0 0 
edge e v1 v2 
~~~~~

@subsubsection occt_draw_7_2_9  pcurve

Syntax:      

~~~~~
pcurve [name edgename] facename 
~~~~~

Extracts the 2d curve of an edge on a face. If only the face is specified, the command extracts all the curves and colors them according to their orientation. This is useful in checking to see if the edges in a face are correctly oriented, i.e. they turn counter-clockwise. To make curves visible, use a fitted 2d view. 

**Example:** 
~~~~~
# view the pcurves of a face 
plane p 
trim p p -1 1 -1 1 
mkface p p 
av2d; # a 2d view 
pcurve p 
2dfit 
~~~~~

@subsubsection occt_draw_7_2_10  chfi2d

Syntax:      
~~~~~
chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) .... 
~~~~~


Creates chamfers and fillets on 2D objects. Select two adjacent edges and: 
  * a radius value
  * two respective distance values
  * a distance value and an angle

The radius value produces a fillet between the two faces. 

The distance is the length value from the edge between the two selected faces in a normal direction. 

**Example:** 

Let us create a 2d fillet: 

~~~~~
top 
profile p x 2 y 2 x -2 
chfi2d cfr p . . F 0.3 
==Pick an object 
#select an edge 
==Pick an object 
#select an edge 
~~~~~

Let us create a 2d chamfer using two distances:
 
~~~~~
profile p x 2 y 2 x -2 
chfi2d cfr p . . CDD 0.3 0.6 
==Pick an object 
#select an edge 
==Pick an object 
#select an edge 
~~~~~

Let us create a 2d chamfer using a defined distance and angle 

~~~~~
top 
profile p x 2 y 2 x -2 
chfi2d cfr p . . CDA 0.3 75 
==Pick an object 
#select an edge 
==Pick an object 
#select an edge 
~~~~~

@subsubsection occt_draw_7_2_11  nproject

Syntax:      
~~~~~
nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol 
[continuity [maxdeg [maxseg]]] 
~~~~~

Creates a shape projection which is normal to the target surface. 

**Example:**
~~~~~
# create a curved surface 
line l 0 0 0 1 0 0 
trim l l 0 2 
convert l l 

incdeg l 3 
cmovep l 1 0 0.5 0 
cmovep l 3 0 0.5 0 
copy l ll 
translate ll 2 -0.5 0 
mkedge e1 l 
mkedge e2 ll 
wire w e1 e2 
prism p w 0 0 3 
donl p 
#display in four views 
mu4 
fit 
# create the example shape 
circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4 
mkedge e c 
donly p e 
# create the normal projection of the shape(circle) 
nproject r e p 
~~~~~


@subsection occt_draw_7_3  Primitives

Primitive commands make it possible to create simple shapes. They include: 

  * **box** and **wedge** commands.
  * **pcylinder**, **pcone**, **psphere**, **ptorus** commands.
  * **halfspace** command


@subsubsection occt_draw_7_3_1  box, wedge

Syntax:      
~~~~~
box name [x y z] dx dy dz 
wedge name dx dy dz ltx / xmin zmin xmax xmax 
~~~~~

**box** creates a box parallel to the axes with dimensions *dx,dy,dz*. *x,y,z* is the corner of the box. It is the default origin. 

**wedge** creates a box with five faces called a wedge. One face is in the OXZ plane, and has dimensions *dx,dz* while the other face is in the plane *y = dy*. This face either has dimensions *ltx, dz* or is bounded by *xmin,zmin,xmax,zmax*. 

The other faces are defined between these faces. The face in the *y=yd* plane may be degenerated into a line if *ltx = 0*, or a point if *xmin = xmax* and *ymin = ymax*. In these cases, the line and the point both have 5 faces each. To position the wedge use the *ttranslate* and *trotate* commands. 

**Example:** 
~~~~~
# a box at the origin 
box b1 10 20 30 

# another box 
box b2 30 30 40 10 20 30 

# a wedge 
wedge w1 10 20 30 5 

# a wedge with a sharp edge (5 faces) 
wedge w2 10 20 30 0 

# a pyramid 
wedge w3 20 20 20 10 10 10 10 
~~~~~

@subsubsection occt_draw_7_3_2  pcylinder, pcone, psphere, ptorus

Syntax:      
~~~~~
pcylinder name [plane] radius height [angle] 
pcone name [plane] radius1 radius2 height [angle] 
pcone name [plane] radius1 radius2 height [angle] 
psphere name [plane] radius1 [angle1 angle2] [angle] 
ptorus name [plane] radius1 radius2 [angle1 angle2] [angle] 
~~~~~

All these commands create solid blocks in the default coordinate system, using the Z axis as the axis of revolution and the X axis as the origin of the angles. To use another system, translate and rotate the resulting solid or use a plane as first argument to specify a coordinate system. All primitives have an optional last argument which is an angle expressed in degrees and located on the Z axis, starting from the X axis. The default angle is 360. 

**pcylinder** creates a cylindrical block with the given radius and height. 

**pcone** creates a truncated cone of the given height with radius1 in the plane z = 0 and radius2 in the plane z = height. Neither radius can be negative, but one of them can be null. 

**psphere** creates a solid sphere centered on the origin. If two angles, *angle1* and *angle2*, are given, the solid will be limited by two planes at latitude *angle1* and *angle2*. The angles must be increasing and in the range -90,90. 

**ptorus** creates a solid torus with the given radii, centered on the origin, which is a point along the z axis. If two angles increasing in degree in the range 0 -- 360 are given, the solid will be bounded by two planar surfaces at those positions on the circle. 

**Example:** 
~~~~~
# a can shape 
pcylinder cy 5 10 

# a quarter of a truncated cone 
pcone co 15 10 10 90 

# three-quarters of sphere 
psphere sp 10 270 

# half torus 
ptorus to 20 5 0 90 
~~~~~

@subsubsection occt_draw_7_3_3  halfspace

Syntax:      
~~~~~
halfspace result face/shell x y z 
~~~~~

**halfspace** creates an infinite solid volume based on a face in a defined direction. This volume can be used to perform the boolean operation of cutting a solid by a face or plane. 

**Example:** 
~~~~~
box b 0 0 0 1 2 3 
explode b f 
==b_1 b_2 b_3 b_4 b_5 b_6 
halfspace hr b_3 0.5 0.5 0.5 
~~~~~


@subsection occt_draw_7_4  Sweeping

Sweeping creates shapes by sweeping out a shape along a defined path: 

  * **prism** -- sweeps along a direction.
  * **revol** -- sweeps around an axis.
  * **pipe** -- sweeps along a wire.
  * **mksweep** and **buildsweep** -- to create sweeps by defining the arguments and algorithms.
  * **thrusections** -- creates a sweep from wire in different planes.


@subsubsection occt_draw_7_4_1  prism

Syntax:      
~~~~~
prism result base dx dy dz [Copy | Inf | SemiInf] 
~~~~~

Creates a new shape by sweeping a shape in a direction. Any shape can be swept: a vertex gives an edge; an edge gives a face; and a face gives a solid. 

The shape is swept along the vector *dx dy dz*. The original shape will be shared in the result unless *Copy* is specified. If *Inf* is specified the prism is infinite in both directions. If *SemiInf* is specified the prism is infinite in the *dx,dy,dz* direction, and the length of the vector has no importance. 

**Example:** 
~~~~~
# sweep a planar face to make a solid 
polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0 
mkplane f f 
~~~~~

@subsubsection occt_draw_7_4_2  revol

Syntax:      
~~~~~
revol result base x y z dx dy dz angle [Copy] 
~~~~~

Creates a new shape by sweeping a base shape through an angle along the axis *x,y,z dx,dy,dz*. As with the prism command, the shape can be of any type and is not shared if *Copy* is specified. 

**Example:** 
~~~~~
# shell by wire rotation 
polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 
revol s w 20 0 0 0 1 0 90 
~~~~~


@subsubsection occt_draw_7_4_3  pipe

Syntax:      
~~~~~
pipe name wire_spine Profile 
~~~~~

Creates a new shape by sweeping a shape known as the profile along a wire known as the spine. 

**Example:** 
~~~~~
# sweep a circle along a bezier curve to make a solid 
pipe 

beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0 
mkedge spine spine 
wire spine spine 
circle profile 0 0 0 1 0 0 2 
mkedge profile profile 
wire profile profile 
mkplane profile profile 
pipe p spine profile 
~~~~~

@subsubsection occt_draw_7_4_4  mksweep, addsweep, setsweep, deletesweep, buildsweep, simulsweep

Syntax:      
~~~~~
mksweep wire 
addsweep wire[vertex][-M][-C] [auxiilaryshape]
deletesweep wire 
setsweep options [arg1 [arg2 [...]]] 
simulsweep r [n] [option] 
buildsweep [r] [option] [Tol] 
~~~~~

options are : 
 * *-FR* : Tangent and Normal are defined by a Frenet trihedron 
 * *-CF* : Tangent is given by Frenet, the Normal is computed to minimize the torsion 
 * *-DX Surf* : Tangent and Normal are given by Darboux trihedron, surf must be a shell or a face 
 * *-CN dx dy dz* : BiNormal is given by *dx dy dz* 
 * *-FX Tx Ty TZ [Nx Ny Nz]* : Tangent and Normal are fixed 
 * *-G guide* 

These commands are used to create a shape from wires. One wire is designated as the contour that defines the direction; it is called the spine. At least one other wire is used to define the the sweep profile. 
* **mksweep** -- initializes the sweep creation and defines the wire to be used as the spine. 
* **addsweep** -- defines the wire to be used as the profile. 
* **deletesweep** -- cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire. 
* **setsweep** -- commands the algorithms used for the construction of the sweep. 
* **simulsweep** -- can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep. 
* **buildsweep** -- creates the sweep using the arguments defined by all the commands. 

**Example:** 
~~~~~
#create a sweep based on a semi-circular wire using the 
Frenet algorithm 
#create a circular figure 
circle c2 0 0 0 1 0 0 10 
trim c2 c2 -pi/2 pi/2 
mkedge e2 c2 
donly e2 
wire w e2 
whatis w 
mksweep w 
# to display all the options for a sweep 
setsweep 
#to create a sweep using the Frenet algorithm where the 
#normal is computed to minimise the torsion 
setsweep -CF 
addsweep w -R 
# to simulate the sweep with a visual approximation 
simulsweep w 3 
~~~~~

@subsubsection occt_draw_7_4_5  thrusections

Syntax:  
~~~~~
thrusections [-N] result issolid isruled wire1 wire2 [..wire..] 
~~~~~

**thrusections** creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices. 
A bezier curve is generated between the vertices of each wire. The option *[-N]* means that no check is made on wires for direction. 

**Example:** 
~~~~~
#create three wires in three planes 
polyline w1 0 0 0 5 0 0 5 5 0 2 3 0 
polyline w2 0 1 3 4 1 3 4 4 3 1 3 3 
polyline w3 0 0 5 5 0 5 5 5 5 2 3 5 
# create the shape 
thrusections th issolid isruled w1 w2 w3 
==thrusections th issolid isruled w1 w2 w3 
Tolerances obtenues   -- 3d : 0 
-- 2d : 0 
~~~~~


@subsection occt_draw_7_5  Topological transformation

Transformations are applications of matrices. When the transformation is nondeforming, such as translation or rotation, the object is not copied. The topology localcoordinate system feature is used. The copy can be enforced with the **tcopy** command. 

  * **tcopy** -- makes a copy of the structure of a shape.
  * **ttranslate**, **trotate**, **tmove** and **reset** -- move a shape.
  * **tmirror** and **tscale** -- always modify the shape.


@subsubsection occt_draw_7_5_1   tcopy

Syntax: 
~~~~~
tcopy name toname [name toname ...] 
~~~~~

Copies the structure of one shape, including the geometry, into another, newer shape. 

**Example:** 
~~~~~
# create an edge from a curve and copy it 
beziercurve c 3 0 0 0 10 0 0 20 10 0 
mkedge e1 c 
ttranslate e1 0 5 0 
tcopy e1 e2 
ttranslate e2 0 5 0 
# now modify the curve, only e1 and e2 will be modified 
~~~~~

@subsubsection occt_draw_7_5_2   tmove, treset

Syntax:      
~~~~~
tmove name [name ...] shape 
reset name [name ...] 
~~~~~

**tmove** and **reset** modify the location, or the local coordinate system of a shape. 

**tmove** applies the location of a given shape to other shapes. **reset** restores one or several shapes it to its or their original coordinate system(s). 

**Example:** 
~~~~~
# create two boxes 
box b1 10 10 10 
box b2 20 0 0 10 10 10 
# translate the first box 
ttranslate b1 0 10 0 
# and apply the same location to b2 
tmove b2 b1 
# return to original positions 
reset b1 b2 
~~~~~

@subsubsection occt_draw_7_5_3   ttranslate, trotate

Syntax:      
~~~~~
ttranslate [name ...] dx dy dz 
trotate [name ...] x y z dx dy dz angle 
~~~~~

**ttranslate** translates a set of shapes by a given vector, and **trotate** rotates them by a given angle around an axis. Both commands only modify the location of the shape. 
When creating multiple shapes, the same location is used for all the shapes. (See *toto.tcl* example below. Note that the code of this file can also be directly executed in interactive mode.) 

Locations are very economic in the data structure because multiple occurences of an object share the topological description. 

**Example:** 
~~~~~
# make rotated copies of a sphere in between two cylinders 
# create a file source toto.tcl 
# toto.tcl code: 
for {set i 0} {$i < 360} {incr i 20} { 
copy s s$i 
trotate s$i 0 0 0 0 0 1 $i 
} 

# create two cylinders 
pcylinder c1 30 5 
copy c1 c2 
ttranslate c2 0 0 20 

#create a sphere 
psphere s 3 
ttranslate s 25 0 12.5 

# call the source file for multiple copies 
source toto.tcl 
~~~~~

@subsubsection occt_draw_7_5_4   tmirror, tscale

Syntax:      
~~~~~
tmirror name x y z dx dy dz 
tscale name x y z scale 
~~~~~

* **tmirror** makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. 

* **Tscale** applies a central homotopic mapping to a shape. 

**Example:** 
~~~~~
# mirror a portion of cylinder about the YZ plane 
pcylinder c1 10 10 270 
copy c1 c2 
tmirror c2 15 0 0 1 0 0 
# and scale it 
tscale c1 0 0 0 0.5 
~~~~~


@subsection occt_draw_7_6  Old Topological operations

  *  **fuse**, **cut**, **common** are boolean operations. 
  *  **section**, **psection** compute sections. 
  *  **sewing** joins two or more shapes. 


@subsubsection occt_draw_7_6_1  fuse, cut, common

These commands are no longer supported, so the result may be unpredictable.
Use the commands bfuse, bcut, bcommon instead.

Syntax:
~~~~~
fuse name shape1 shape2 
cut name shape1 shape2 
common name shape1 shape2 
~~~~~

**fuse** creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact. 

**cut** creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes. 

**common** creates a new shape which contains only what is in common between the two original shapes in their intersection. 

**Example:** 
~~~~~
# all four boolean operations on a box and a cylinder 

box b 0 -10 5 20 20 10 
pcylinder c 5 20 

fuse s1 b c 
ttranslate s1 40 0 0 

cut s2 b c 
ttranslate s2 -40 0 0 

cut s3 c b 
ttranslate s3 0 40 0 

common s4 b c 
ttranslate s4 0 -40 0 
~~~~~


@subsubsection occt_draw_7_6_2  section, psection

These commands are no longer supported, so the result may be unpredictable.
Use the command **bsection** instead.

Syntax:      
~~~~~
section result shape1 shape2 
psection name shape plane 
~~~~~

**section** creates a compound object consisting of the edges for the intersection curves on the faces of two shapes. 

**psection** creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane. 

**Example:** 
~~~~~
# section line between a cylinder and a box 
pcylinder c 10 20 
box b 0 0 5 15 15 15 
trotate b 0 0 0 1 1 1 20 
section s b c 

# planar section of a cone 
pcone c 10 30 30 
plane p 0 0 15 1 1 2 
psection s c p 
~~~~~

@subsubsection occt_draw_7_6_3  sewing

Syntax:      
~~~~~
sewing result [tolerance] shape1 shape2 ... 
~~~~~

**Sewing** joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value. 

**Example:** 
~~~~~
# create two adjacent boxes 
box b 0 0 0 1 2 3 
box b2 0 2 0 1 2 3 
sewing sr b b2 
whatis sr 
sr is a shape COMPOUND FORWARD Free Modified 
~~~~~

@subsection occt_draw_7_7 New Topological operations

The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old Boolean operation algorithm.
It also provides wider range of options and diagnostics.
The algorithms of Boolean component are fully described in the @ref specification__boolean_operations "Boolean Operations" of boolean operation user guide.

For the Draw commands to perform operations in Boolean component, read the dedicated section @ref occt_draw_bop "Boolean operations commands"


@subsection occt_draw_7_8  Drafting and blending

Drafting is creation of a new shape by tilting faces through an angle. 

Blending is the creation of a new shape by rounding edges to create a fillet. 

  * Use the **depouille** command for drafting.
  * Use the **chamf** command to add a chamfer to an edge
  * Use the **blend** command for simple blending.
  * Use **bfuseblend** for a fusion + blending operation.
  * Use **bcutblend** for a cut + blending operation.
  * Use **buildevol**, **mkevol**, **updatevol** to realize varying radius blending.


@subsubsection occt_draw_7_8_1  depouille

Syntax: 
~~~~~
dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...] 
~~~~~

Creates a new shape by drafting one or more faces of a shape. 

Identify the shape(s) to be drafted, the drafting direction, and the face(s) with an angle and an axis of rotation for each face. You can use dot syntax to identify the faces. 

**Example:** 
~~~~~
# draft a face of a box 
box b 10 10 10 
explode b f 
== b_1 b_2 b_3 b_4 b_5 b_6 

dep a b 0 0 1 b_2 10 0 10 0 1 0 5 
~~~~~

@subsubsection occt_draw_7_8_2  chamf

Syntax:      
~~~~~
chamf newname shape edge face S dist 
chamf newname shape edge face dist1 dist2 
chamf newname shape edge face A dist angle 
~~~~~

Creates a chamfer along the edge between faces using: 

  * a equal distances from the edge
  * the edge, a face and distance, a second distance
  * the edge, a reference face and an angle

Use the dot syntax to select the faces and edges. 

**Examples:**

Let us create a chamfer based on equal distances from the edge (45 degree angle):
~~~~~
# create a box 
box b 1 2 3 
chamf ch b . . S 0.5 
==Pick an object 
# select an edge 
==Pick an object 
# select an adjacent face 
~~~~~

Let us create a chamfer based on different distances from the selected edge:
~~~~~
box b 1 2 3 
chamf ch b . . 0.3 0.4 
==Pick an object 
# select an edge 
==Pick an object 
# select an adjacent face
~~~~~
 
Let us create a chamfer based on a distance from the edge and an angle:
 
~~~~~
box b 1 2 3 
chamf ch b . . A 0.4 30 
==Pick an object 
# select an edge 
==Pick an object 
# select an adjacent face 
~~~~~

@subsubsection occt_draw_7_8_3  blend

Syntax:      
~~~~~
blend result object rad1 ed1 rad2 ed2 ... [R/Q/P] 
~~~~~

Creates a new shape by filleting the edges of an existing shape. The edge must be inside the shape. You may use the dot syntax. Note that the blend is propagated to the edges of tangential planar, cylindrical or conical faces. 

**Example:** 
~~~~~
# blend a box, click on an edge 
box b 20 20 20 
blend b b 2 . 
==tolerance ang : 0.01 
==tolerance 3d : 0.0001 
==tolerance 2d : 1e-05 
==fleche : 0.001 
==tolblend 0.01 0.0001 1e-05 0.001 
==Pick an object 
# click on the edge you want ot fillet 

==COMPUTE: temps total 0.1s dont : 
==- Init + ExtentAnalyse 0s 
==- PerformSetOfSurf 0.02s 
==- PerformFilletOnVertex 0.02s 
==- FilDS 0s 
==- Reconstruction 0.06s 
==- SetRegul 0s 
~~~~~

@subsubsection occt_draw_7_8_4  bfuseblend

Syntax:
~~~~~
bfuseblend name shape1 shape2 radius [-d]
~~~~~
 
Creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
Option [-d] enables the Debugging mode in which the error messages, if any, will be printed.

**Example:**
~~~~~
# fuse-blend two boxes
box b1 20 20 5
copy b1 b2
ttranslate b2 -10 10 3
bfuseblend a b1 b2 1
~~~~~

@subsubsection occt_draw_7_8_4a  bcutblend

Syntax:
~~~~~
bcutblend name shape1 shape2 radius [-d]
~~~~~

Creates a boolean cut of two shapes and then blends (fillets) the intersection edges using the given radius.
Option [-d] enables the Debugging mode in which the error messages, if any, will be printed.

**Example:**
~~~~~
# cut-blend two boxes
box b1 20 20 5
copy b1 b2
ttranslate b2 -10 10 3
bcutblend a b1 b2 1
~~~~~

@subsubsection occt_draw_7_8_5  mkevol, updatevol, buildevol

Syntax:      
~~~~~
mkevol result object (then use updatevol) [R/Q/P] 
updatevol edge u1 radius1 [u2 radius2 ...] 
buildevol 
~~~~~

These three commands work together to create fillets with evolving radii. 

* **mkevol** allows specifying the shape and the name of the result. It returns the tolerances of the fillet. 
* **updatevol** allows describing the filleted edges you want to create. For each edge, you give a set of coordinates: parameter and radius and the command prompts you to pick the edge of the shape which you want to modify. The parameters will be calculated along the edges and the radius function applied to the whole edge. 
* **buildevol** produces the result described previously in **mkevol** and **updatevol**. 

**Example:** 
~~~~~
# makes an evolved radius on a box 
box b 10 10 10 
mkevol b b 
==tolerance ang : 0.01 
==tolerance 3d : 0.0001 
==tolerance 2d : 1e-05 
==fleche : 0.001 
==tolblend 0.01 0.0001 1e-05 0.001 

# click an edge 
updatevol . 0 1 1 3 2 2 
==Pick an object 

buildevol 
==Dump of SweepApproximation 
==Error 3d = 1.28548881203818e-14 
==Error 2d = 1.3468326936926e-14 , 
==1.20292299999388e-14 
==2 Segment(s) of degree 3 

==COMPUTE: temps total 0.91s dont : 
==- Init + ExtentAnalyse 0s 
==- PerformSetOfSurf 0.33s 
==- PerformFilletOnVertex 0.53s 
==- FilDS 0.01s 
==- Reconstruction 0.04s 
==- SetRegul 0s 
~~~~~


@subsection occt_draw_defeaturing Defeaturing

Draw command **removefeatures** is intended for performing @ref occt_modalg_defeaturing "3D Model Defeaturing", i.e. it performs the removal of the requested features from the shape.

Syntax:
~~~~
removefeatures result shape f1 f2 ... [-nohist] [-parallel]

Where:
result   - result of the operation;
shape    - the shape to remove the features from;
f1, f2   - features to remove from the shape;

Options:
nohist   - disables the history collection;
parallel - enables the parallel processing mode.
~~~~


@subsection occt_draw_makeperiodic 3D Model Periodicity

Draw module for @ref occt_modalg_makeperiodic "making the shape periodic" includes the following commands:
* **makeperiodic** - makes the shape periodic in required directions;
* **repeatshape** - repeats the periodic shape in requested periodic direction;
* **periodictwins** - returns the periodic twins for the shape;
* **clearrepetitions** - clears all previous repetitions of the periodic shape.

@subsubsection occt_draw_makeperiodic_makeperiodic makeperiodic

The command makes the shape periodic in the required directions with the required period.
If trimming is given it trims the shape to fit the requested period.

Syntax:
~~~~
makeperiodic result shape [-x/y/z period [-trim first]]

Where:
result        - resulting periodic shape;
shape         - input shape to make it periodic:
-x/y/z period - option to make the shape periodic in X, Y or Z direction with the given period;
-trim first   - option to trim the shape to fit the required period, starting the period in first.
~~~~

@subsubsection occt_draw_makeperiodic_repeatshape repeatshape

The command repeats the periodic shape in periodic direction requested number of time.
The result contains the all the repeated shapes glued together.
The command should be called after **makeperiodic** command.

Syntax:
~~~~
repeatshape result -x/y/z times

Where:
result       - resulting shape;
-x/y/z times - direction for repetition and number of repetitions (negative number of times means the repetition in negative direction).
~~~~

@subsubsection occt_draw_makeperiodic_periodictwins periodictwins

For the given shape the command returns the identical shapes located on the opposite sides of the periodic direction.
All periodic twins should have the same geometry.
The command should be called after **makeperiodic** command.

Syntax:
~~~~
periodictwins twins shape

Where:
twins - periodic twins for the given shape
shape - shape to find the twins for
~~~~

@subsubsection occt_draw_makeperiodic_clearrepetitions clearrepetitions

The command clears all previous repetitions of the periodic shape allowing to start the repetitions over.
No arguments are needed for the command.


@subsection occt_draw_makeconnected Making the touching shapes connected

Draw module for @ref occt_modalg_makeconnected "making the touching same-dimensional shapes connected" includes the following commands:
* **makeconnected** - make the input shapes connected or glued, performs material associations;
* **cmaterialson** - returns the materials located on the requested side of a shape;
* **cmakeperiodic** - makes the connected shape periodic in requested directions;
* **crepeatshape** - repeats the periodic connected shape in requested directions requested number of times;
* **cperiodictwins** - returns all periodic twins for the shape;
* **cclearrepetitions** - clears all previous repetitions of the periodic shape, keeping the shape periodic.

@subsubsection occt_draw_makeconnected_makeconnected makeconnected

The command makes the input touching shapes connected.

Syntax:
~~~~
makeconnected result shape1 shape2 ...

Where:
result            - resulting connected shape.
shape1 shape2 ... - shapes to be made connected.
~~~~

@subsubsection occt_draw_makeconnected_cmaterialson cmaterialson

The command returns the materials located on the requested side of the shape.
The command should be called after the shapes have been made connected, i.e. after the command **makeconnected**.

Syntax:
~~~~
cmaterialson result +/- shape

Where:
result - material shapes
shape  - shape for which the materials are needed
+/-    - side of a given shape ('+' for positive side, '-' - for negative).
~~~~

@subsubsection occt_draw_makeconnected_cmakeperiodic cmakeperiodic

The command makes the connected shape periodic in the required directions with the required period.
The command should be called after the shapes have been made connected, i.e. after the command **makeconnected**.

Syntax:
~~~~
cmakeperiodic result [-x/y/z period [-trim first]]
 
Where:
result        - resulting periodic shape;
shape         - input shape to make it periodic:
-x/y/z period - option to make the shape periodic in X, Y or Z direction with the given period;
-trim first   - option to trim the shape to fit the required period, starting the period in first.
~~~~

@subsubsection occt_draw_makeconnected_crepeatshape crepeatshape

The command repeats the connected periodic shape in the required periodic directions required number of times.
The command should be called after the shapes have been made connected and periodic, i.e. after the commands **makeconnected** and **cmakeperiodic**.

Syntax:
~~~~
crepeatshape result -x/y/z times

Where:
result       - resulting shape;
-x/y/z times - direction for repetition and number of repetitions (negative number of times means the repetition in negative direction).
~~~~

@subsubsection occt_draw_makeconnected_cperiodictwins cperiodictwins

The command returns all periodic twins for the shape.
The command should be called after the shapes have been made connected and periodic, i.e. after the commands **makeconnected** and **cmakeperiodic**.

Syntax:
~~~~
cperiodictwins twins shape

Where:
twins - periodic twins of a shape.
shape - input shape.
~~~~

@subsubsection occt_draw_makeconnected_cclearrepetitions cclearrepetitions

The command clears all previous repetitions of the periodic shape keeping the shape periodic.
The command should be called after the shapes have been made connected, periodic and the repetitions have been applied to the periodic shape, i.e. after the commands **makeconnected**, **cmakeperiodic** and **crepeatshape**.
Otherwise the command will have no effect.

Syntax:
~~~~
cclearrepetitions [result]
~~~~


@subsection occt_draw_7_9  Analysis of topology and geometry

Analysis of shapes includes commands to compute length, area, volumes and inertial properties, as well as to compute some aspects impacting shape validity.

  * Use **lprops**, **sprops**, **vprops** to compute integral properties.
  * Use **bounding** to compute and to display the bounding box of a shape.
  * Use **distmini** to calculate the minimum distance between two shapes.
  * Use **isbbinterf** to check if the two shapes are interfered by their bounding boxes. 
  * Use **xdistef**, **xdistcs**, **xdistcc**, **xdistc2dc2dss**, **xdistcc2ds** to check the distance between two objects on even grid.
  * Use **checkshape** to check validity of the shape.
  * Use **tolsphere** to see the tolerance spheres of all vertices in the shape.
  * Use **validrange** to check range of an edge not covered by vertices.


@subsubsection occt_draw_7_9_1  lprops, sprops, vprops

Syntax:      
~~~~~
lprops shape  [x y z] [-skip] [-full] [-tri]
sprops shape [epsilon] [c[losed]] [x y z] [-skip] [-full] [-tri]
vprops shape [epsilon] [c[losed]] [x y z] [-skip] [-full] [-tri] 
~~~~~

* **lprops** computes the mass properties of all edges in the shape with a linear density of 1;
* **sprops** of all faces with a surface density of 1;
* **vprops** of all solids with a density of 1. 

For computation of properties of the shape, exact geomery (curves, surfaces) or
some discrete data (polygons, triangulations) can be used for calculations.
The epsilon, if given, defines relative precision of computation.
The **closed** flag, if present, forces computation only closed shells of the shape.
The centroid coordinates will be put to DRAW variables x y z (if given).
Shared entities will be taken in account only one time in the **skip** mode.
All values are output with the full precision in the **full** mode.
Preferable source of geometry data are triangulations in case if it exists, 
if the **-tri** key is used, otherwise preferable data is exact geometry.
If epsilon is given, exact geometry (curves, surfaces) are used for calculations independently of using key **-tri**.

All three commands print the mass, the coordinates of the center of gravity, the matrix of inertia and the moments. Mass is either the length, the area or the volume. The center and the main axis of inertia are displayed. 

**Example:** 
~~~~~
# volume of a cylinder 
pcylinder c 10 20 
vprops c 
== results 
Mass : 6283.18529981086 

Center of gravity : 
X = 4.1004749224903e-06 
Y = -2.03392858349861e-16 
Z = 9.9999999941362 

Matrix of Inertia : 
366519.141445068                    5.71451850691484e-12 
0.257640437382627 
5.71451850691484e-12                366519.141444962 
2.26823064169991e-10                0.257640437382627 
2.26823064169991e-10                314159.265358863 

Moments : 
IX = 366519.141446336 
IY = 366519.141444962 
I.Z = 314159.265357595 
~~~~~


@subsubsection occt_draw_7_9_2   bounding

Syntax:      
~~~~~
bounding {-s shape | -c xmin ymin zmin xmax ymax zmax} [-obb] [-shape name] [-dump] [-notriangulation] [-perfmeter name NbIters] [-save xmin ymin zmin xmax ymax zmax] [-nodraw] [-optimal] [-exttoler]
~~~~~

Computes and displays the bounding box (BndBox) of a shape. The bounding box is a cuboid that circumscribes the source shape.
Generaly, bounding boxes can be divided into two main types:
  - axis-aligned BndBox (AABB). I.e. the box whose edges are parallel to an axis of World Coordinate System (WCS);
  - oriented BndBox (OBB). I.e. not AABB.

Detailed information about this command is availabe in DRAW help-system (enter "help bounding" in DRAW application).
  
**Example 1: Creation of AABB with given corners** 
~~~~~
bounding -c 50 100 30 180 200 100 -shape result
# look at the box
vdisplay result
vfit
vsetdispmode 1
~~~~~

**Example 2: Compare AABB and OBB** 
~~~~~
# Create a torus and rotate it
ptorus t 20 5 
trotate t 5 10 15 1 1 1 28

# Create AABB from the torus
bounding -s t -shape ra -dump -save x1 y1 z1 x2 y2 z2
==Axes-aligned bounding box
==X-range: -26.888704600189307 23.007685197265488
==Y-range: -22.237699567214314 27.658690230240481
==Z-range: -13.813966507560762 12.273995247458407

# Obtain the boundaries
dump x1 y1 z1 x2 y2 z2
==*********** Dump of x1 *************
==-26.8887046001893

==*********** Dump of y1 *************
==-22.2376995672143

==*********** Dump of z1 *************
==-13.8139665075608

==*********** Dump of x2 *************
==23.0076851972655

==*********** Dump of y2 *************
==27.6586902302405

==*********** Dump of z2 *************
==12.2739952474584

# Compute the volume of AABB
vprops ra 1.0e-12
==Mass :         64949.9

# Let us check this value
dval (x2-x1)*(y2-y1)*(z2-z1)
==64949.886543606823
~~~~~

The same result is obtained.

~~~~~
# Create OBB from the torus
bounding -s t -shape ro -dump -obb
==Oriented bounding box
==Center: -1.9405097014619073 2.7104953315130857 -0.76998563005117782
==X-axis: 0.31006700219833244 -0.23203206410428409 0.9219650619059514
==Y-axis: 0.098302309139513336 -0.95673739537318336 -0.27384340837854165
==Z-axis: 0.94561890324040099 0.17554109923901748 -0.27384340837854493
==Half X: 5.0000002000000077
==Half Y: 26.783728747002169
==Half Z: 26.783728747002165

# Compute the volume of OBB
vprops ro 1.0e-12
==Mass :         28694.7
~~~~~

As we can see, the volume of OBB is significantly less than the volume of AABB.

@subsubsection occt_draw_7_9_2a   isbbinterf

Syntax:      
~~~~~
isbbinterf shape1 shape2 [-o]
~~~~~

Checks whether the bounding boxes created from the given shapes are interfered. If "-o"-option is switched on then the oriented boxes will be checked. Otherwise, axis-aligned boxes will be checked.

**Example 1: Not interfered AABB** 
~~~~~
box b1 100 60 140 20 10 80
box b2 210 200 80 120 60 90
isbbinterf b1 b2
==The shapes are NOT interfered by AABB.
~~~~~

**Example 2: Interfered AABB** 
~~~~~
box b1 300 300 300
box b2 100 100 100 50 50 50
isbbinterf b1 b2
==The shapes are interfered by AABB.
~~~~~

**Example 3: Not interfered OBB** 
~~~~~
box b1 100 150 200
copy b1 b2
trotate b1 -150 -150 -150 1 2 3 -40
trotate b2 -150 -150 -150 1 5 2 60

# Check of interference
isbbinterf b1 b2 -o
==The shapes are NOT interfered by OBB.
~~~~~

**Example 4: Interfered OBB** 
~~~~~
box b1 100 150 200
copy b1 b2
trotate b1 -50 -50 -50 1 1 1 -40
trotate b2 -50 -50 -50 1 1 1 60

# Check of interference
isbbinterf b1 b2 -o
==The shapes are interfered by OBB.
~~~~~

@subsubsection occt_draw_7_9_3  distmini

Syntax:      
~~~~~
distmini name Shape1 Shape2 
~~~~~

Calculates the minimum distance between two shapes. The calculation returns the number of solutions, if more than one solution exists. The options are displayed in the viewer in red and the results are listed in the shell window. The *distmini* lines are considered as shapes which have a value v. 

**Example:** 
~~~~~
box b 0 0 0 10 20 30 
box b2 30 30 0 10 20 30 
distmini d1 b b2 
==the distance value is : 22.3606797749979 
==the number of solutions is :2 

==solution number 1 
==the type of the solution on the first shape is 0 
==the type of the solution on the second shape is 0 
==the coordinates of the point on the first shape are: 
==X=10 Y=20 Z=30 
==the coordinates of the point on the second shape 
are: 
==X=30 Y=30 Z=30 

==solution number 2: 
==the type of the solution on the first shape is 0 
==the type of the solution on the second shape is 0 
==the coordinates of the point on the first shape are: 
==X=10 Y=20 Z=0 
==the coordinates of the point on the second shape 
are: 
==X=30 Y=30 Z=0 

==d1_val d1 d12 
~~~~~

@subsubsection occt_draw_7_9_4 xdistef, xdistcs, xdistcc, xdistc2dc2dss, xdistcc2ds 

Syntax:
~~~~~
xdistef edge face
xdistcs curve surface firstParam lastParam [NumberOfSamplePoints]
xdistcc curve1 curve2 startParam finishParam [NumberOfSamplePoints]
xdistcc2ds c curve2d surf startParam finishParam [NumberOfSamplePoints]
xdistc2dc2dss curve2d_1 curve2d_2 surface_1 surface_2 startParam finishParam [NumberOfSamplePoints]
~~~~~

It is assumed that curves have the same parametrization range and *startParam* is less than *finishParam*.

Commands with prefix *xdist* allow checking the distance between two objects on even grid:
  * **xdistef** -- distance between edge and face;
  * **xdistcs** -- distance between curve and surface. This means that the projection of each sample point to the surface is computed;
  * **xdistcc** -- distance between two 3D curves;
  * **xdistcc2ds** -- distance between 3d curve and 2d curve on surface;
  * **xdistc2dc2dss** -- distance between two 2d curves on surface.
  
**Examples**
~~~~~
bopcurves b1 b2 -2d 
mksurf s1 b1
mksurf s2 b2
xdistcs c_1 s1 0 1 100
xdistcc2ds c_1 c2d2_1 s2 0 1
xdistc2dc2dss c2d1_1 c2d2_1 s1 s2 0 1 1000
~~~~~

@subsubsection occt_draw_7_9_5  checkshape

Syntax:                  
~~~~~
checkshape [-top] shape [result] [-short] 
~~~~~

Where: 
* *top* -- optional parameter, which allows checking only topological validity of a shape. 
* *shape* -- the only required parameter, defines the name of the shape to check. 
* *result* -- optional parameter, defines custom prefix for the output shape names.
* *short* -- a short description of the check. 

**checkshape** examines the selected object for topological and geometric coherence. The object should be a three dimensional shape. 

**Example:** 
~~~~~
# checkshape returns a comment valid or invalid 
box b1 0 0 0 1 1 1 
checkshape b1 
# returns the comment 
this shape seems to be valid 
~~~~~

@subsubsection occt_draw_7_9_6  tolsphere

Syntax:                  
~~~~~
tolsphere shape
~~~~~

Where: 
* *shape* -- the name of the shape to process. 

**tolsphere** shows vertex tolerances by drawing spheres around each vertex in the shape. Each sphere is assigned a name of the shape with suffix "_vXXX", where XXX is the number of the vertex in the shape.

**Example:** 
~~~~~
# tolsphere returns all names of created spheres.
box b1 0 0 0 1 1 1 
settolerance b1 0.05
tolsphere b1
# creates spheres and returns the names
b1_v1 b1_v2 b1_v3 b1_v4 b1_v5 b1_v6 b1_v7 b1_v8
~~~~~

@subsubsection occt_draw_7_9_7  validrange

Syntax:                  
~~~~~
validrange edge [(out) u1 u2]
~~~~~

Where: 
* *edge* -- the name of the edge to analyze. 
* *u1*, *u2* -- optional names of variables to put into the range.

**validrange** computes valid range of the edge. If *u1* and *u2* are not given, it returns the first and the last parameters. Otherwise, it sets variables *u1* and *u2*.

**Example:** 
~~~~~
circle c 0 0 0 10
mkedge e c
mkedge e c 0 pi
validrange e
# returns the range
1.9884375000000002e-008 3.1415926337054181
validrange e u1 u2
dval u1
1.9884375000000002e-008
dval u2
3.1415926337054181
~~~~~


@subsection occt_draw_7_10  Surface creation

Surface creation commands include surfaces created from boundaries and from spaces between shapes. 
  * **gplate** creates a surface from a boundary definition.
  * **filling** creates a surface from a group of surfaces.

@subsubsection occt_draw_7_10_1   gplate,

Syntax: 
~~~~~
gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ... 
~~~~~

Creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces. 

**Example:**
~~~~~
plane p 
trim p p -1 3 -1 3 
mkface p p 

beziercurve c1 3 0 0 0 1 0 1 2 0 0 
mkedge e1 c1 
tcopy e1 e2 
tcopy e1 e3 

ttranslate e2 0 2 0 
trotate e3 0 0 0 0 0 1 90 
tcopy e3 e4 
ttranslate e4 2 0 0 
# create the surface 
gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0 
== 
======== Results =========== 
DistMax=8.50014503228635e-16 
* GEOMPLATE END* 
Calculation time: 0.33 
Loop number: 1 
Approximation results 
Approximation error : 2.06274907619957e-13 
Criterium error : 4.97600631215754e-14 

#to create a surface defined by edges and passing through a point 
# to define the border edges and the point 
plane p 
trim p p -1 3 -1 3 
mkface p p 

beziercurve c1 3 0 0 0 1 0 1 2 0 0 
mkedge e1 c1 
tcopy e1 e2 
tcopy e1 e3 

ttranslate e2 0 2 0 
trotate e3 0 0 0 0 0 1 90 
tcopy e3 e4 
ttranslate e4 2 0 0 
# to create a point 
point pp 1 1 0 
# to create the surface 
gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp 
== 
======== Results =========== 
DistMax=3.65622157610934e-06 
* GEOMPLATE END* 
Calculculation time: 0.27 
Loop number: 1 
Approximation results 
Approximation error : 0.000422195884750181 
Criterium error : 3.43709808053967e-05 
~~~~~

@subsubsection occt_draw_7_10_2   filling, fillingparam

Syntax:      
~~~~~
filling result nbB nbC nbP [SurfInit] [edge][face]order... 
edge[face]order... point/u v face order... 
~~~~~

Creates a surface between borders. This command uses the **gplate** algorithm but creates a surface that is tangential to the adjacent surfaces. The result is a smooth continuous surface based on the G1 criterion. 

To define the surface border: 

  * enter the number of edges, constraints, and points
  * enumerate the edges, constraints and points

The surface can pass through other points. These are defined after the border definition. 

You can use the *fillingparam* command to access the filling parameters. 

The options are: 

 * <i>-l</i> : to list current values 
 * <i>-i</i> : to set default values 
 * <i>-rdeg nbPonC nbIt anis </i> : to set filling options 
 * <i>-c t2d t3d tang tcur </i> : to set tolerances 
 * <i>-a maxdeg maxseg </i> : Approximation option 

**Example:** 
~~~~~
# to create four curved survaces and a point 
plane p 
trim p p -1 3 -1 3 
mkface p p 

beziercurve c1 3 0 0 0 1 0 1 2 0 0 
mkedge e1 c1 
tcopy e1 e2 
tcopy e1 e3 

ttranslate e2 0 2 0 
trotate e3 0 0 0 0 0 1 90 
tcopy e3 e4 
ttranslate e4 2 0 0 

point pp 1 1 0 

prism f1 e1 0 -1 0 
prism f2 e2 0 1 0 
prism f3 e3 -1 0 0 
prism f4 e4 1 0 0 

# to create a tangential surface 
filling r1 4 0 0 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 
# to create a tangential surface passing through point pp 
filling r2 4 0 1 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 pp# 
# to visualise the surface in detail 
isos r2 40 
# to display the current filling parameters 
fillingparam -l 
== 
Degree = 3 
NbPtsOnCur = 10 
NbIter = 3 
Anisotropie = 0 
Tol2d = 1e-05 
Tol3d = 0.0001 
TolAng = 0.01 
TolCurv = 0.1 

MaxDeg = 8 
MaxSegments = 9 
~~~~~


@subsection occt_draw_7_11  Complex Topology

Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling. 


@subsubsection occt_draw_7_11_1  offsetshape, offsetcompshape

Syntax:      
~~~~~
offsetshape r shape offset [tol] [face ...] 
offsetcompshape r shape offset [face ...] 
~~~~~

**offsetshape** and **offsetcompshape** assign a thickness to the edges of a shape. The *offset* value can be negative or positive. This value defines the thickness and direction of the resulting shape. Each face can be removed to create a hollow object. 

The resulting shape is based on a calculation of intersections. In case of simple shapes such as a box, only the adjacent intersections are required and you can use the **offsetshape** command. 

In case of complex shapes, where intersections can occur from non-adjacent edges and faces, use the **offsetcompshape** command. **comp** indicates complete and requires more time to calculate the result. 

The opening between the object interior and exterior is defined by the argument face or faces. 

**Example:** 
~~~~~
box b1 10 20 30 
explode b1 f 
== b1_1 b1_2 b1_3 b1_4 b1_5 b1_6 
offsetcompshape r b1 -1 b1_3 
~~~~~

@subsubsection occt_draw_7_11_2  featprism, featdprism, featrevol, featlf, featrf

Syntax:      
~~~~~
featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1) 
featdprism shape face skface angle Fuse(0/1/2) Modify(0/1) 
featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1) 
featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1) 
featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1) 
featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil] 
featperformval prism/revol/dprism/lf result value 
~~~~~

**featprism** loads the arguments for a prism with contiguous sides normal to the face. 

**featdprism** loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle. 

**featrevol** loads the arguments for a prism with a circular evolution. 

**featlf** loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline. 

**featrf** loads the arguments for a rib or slot with a curved surface. This feature uses a circular face and a wire as a guideline. 

**featperform** loads the arguments to create the feature. 

**featperformval** uses the defined arguments to create a feature with a limiting value. 

All the features are created from a set of arguments which are defined when you initialize the feature context. Negative values can be used to create depressions. 

**Examples:** 

Let us create a feature prism with a draft angle and a normal direction :

~~~~~
# create a box with a wire contour on the upper face 
box b 1 1 1 
profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
explode b f 
# loads the feature arguments defining the draft angle 
featdprism b f b_6 5 1 0 
# create the feature 
featperformval dprism r 1 
==BRepFeat_MakeDPrism::Perform(Height) 
BRepFeat_Form::GlobalPerform () 
 Gluer 
 still Gluer 
 Gluer result 
~~~~~

Let us  create a feature prism with circular direction :

~~~~~
# create a box with a wire contour on the upper face 
box b 1 1 1 
profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
explode b f 
# loads the feature arguments defining a rotation axis 
featrevol b f b_6 1 0 1 0 1 0 1 0 
featperformval revol r 45 
==BRepFeat_MakeRevol::Perform(Angle) 
BRepFeat_Form::GlobalPerform () 
 Gluer 
 still Gluer 
 Gluer result 
~~~~~


Let us create a slot using the linear feature :

~~~~~
#create the base model using the multi viewer 
mu4 
profile p x 5 y 1 x -3 y -0.5 x -1.5 y 0.5 x 0.5 y 4 x -1 y -5 
prism pr p 0 0 1 
# create the contour for the linear feature 
vertex v1 -0.2 4 0.3 
vertex v2 0.2 4 0.3 
vertex v3 0.2 0.2 0.3 
vertex v4 4 0.2 0.3 
vertex v5 4 -0.2 0.3 
edge e1 v1 v2 
edge e2 v2 v3 
edge e3 v3 v4 
edge e4 v4 v5 
wire w e1 e2 e3 e4 
# define a plane 
plane pl 0.2 0.2 0.3 0 0 1 
# loads the linear feature arguments 
featlf pr w pl 0 0 0.3 0 0 0 0 1 
featperform lf result 
~~~~~

Let us create a rib using the revolution feature :

~~~~~
#create the base model using the multi viewer 
mu4 
pcylinder c1 3 5 
# create the contour for the revolution feature 
profile w c 1 190 WW 
trotate w 0 0 0 1 0 0 90 
ttranslate w -3 0 1 
trotate w -3 0 1.5 0 0 1 180 
plane pl -3 0 1.5 0 1 0 
# loads the revolution feature arguments 
featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1 
featperform rf result 
~~~~~

@subsubsection occt_draw_7_11_3  draft

Syntax: 
~~~~~
draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal] 
~~~~~

Computes a draft angle surface from a wire. The surface is determined by the draft direction, the inclination of the draft surface, a draft angle, and a limiting distance. 

  * The draft angle is measured in radians.
  * The draft direction is determined by the argument -INTERNAL
  * The argument Ri/Ro deftermines wether the corner edges of the draft surfaces are angular or rounded.
  * Arguments that can be used to define the surface distance are:
   * length, a defined distance
   * shape, until the surface contacts a shape
   * surface, until the surface contacts a surface.

**Note** that the original aim of adding a draft angle to a shape is to produce a shape which can be removed easily from a mould. The Examples below use larger angles than are used normally and the calculation results returned are not indicated.

**Example:** 
~~~~~
# to create a simple profile 
profile p F 0 0 x 2 y 4 tt 0 4 w 
# creates a draft with rounded angles 
draft res p 0 0 1 3 1 -Ro 
# to create a profile with an internal angle 
profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w 
# creates a draft with rounded external angles 
draft res p 0 0 1 3 1 -Ro 
~~~~~

@subsubsection occt_draw_7_11_4  deform

Syntax:      
~~~~~
deform newname name CoeffX CoeffY CoeffZ
~~~~~

Modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions. 
 
**Example:** 
~~~~~
pcylinder c 20 20 
deform a c 1 3 5 
# the conversion to bspline is followed by the 
deformation 
~~~~~


@subsubsection occt_draw_7_11_5 nurbsconvert

Syntax:
 
~~~~~
nurbsconvert result name [result name] 
~~~~~

Changes the NURBS curve definition of a shape to a Bspline curve definition. This conversion is required for assymetric deformation and prepares the arguments for other commands such as **deform**. The conversion can be necessary when transferring shape data to other applications. 


@subsubsection occt_draw_7_11_6 edgestofaces

**edgestofaces** - The command allows building planar faces from the planar edges randomly located in 3D space.

It has the following syntax:
~~~~
edgestofaces r_faces edges [-a AngTol -s Shared(0/1)]
~~~~
Options:
 * -a AngTol - angular tolerance used for distinguishing the planar faces;
 * -s Shared(0/1) - boolean flag which defines whether the input edges are already shared or have to be intersected.

@subsection occt_draw_hist History commands

Draw module for @ref occt_modalg_hist "History Information support" includes the command to save history of modifications performed by Boolean operation or sibling commands into a drawable object and the actual history commands:

* **setfillhistory**;
* **savehistory**;
* **isdeleted**;
* **modified**;
* **generated**.

@subsubsection occt_draw_hist_set setfillhistory

*setfillhistory* command controls if the history is needed to be filled in the supported algorithms and saved into the session after the algorithm is done.
By default it is TRUE, i.e. the history is filled and saved.

Syntax:
~~~~
setfillhistory  : Controls the history collection by the algorithms and its saving into the session after algorithm is done.
                Usage: setfillhistory [flag]
                w/o arguments prints the current state of the option;
                flag == 0 - history will not be collected and saved;
                flag != 0 - history will be collected and saved into the session (default).
~~~~

Example:
~~~~
box b1 10 10 10
box b2 10 10 10
setfillhistory 0
bfuse r b1 b2
savehistory h
# No history has been prepared yet.
setfillhistory 1
bfuse r b1 b2
savehistory h
dump h
# *********** Dump of h *************
# History contains:
#  - 2 Deleted shapes;
#  - 52 Modified shapes;
#  - 0 Generated shapes.
~~~~

@subsubsection occt_draw_hist_save savehistory

*savehistory* command saves the history from the session into a drawable object with the given name.

Syntax:
~~~~
savehistory     : savehistory name
~~~~

If the history of shape modifications performed during an operation is needed, the *savehistory* command should be called after the command performing the operation.
If another operation supporting history will be performed before the history of the first operation is saved it will be overwritten with the new history.

Example:
~~~~
box b1 10 10 10
box b2 5 0 0 10 10 15
bfuse r b1 b2
savehistory fuse_hist

dump fuse_hist
#*********** Dump of fuse_hist *************
# History contains:
# - 4 Deleted shapes;
# - 20 Modified shapes;
# - 6 Generated shapes.

unifysamedom ru r
savehistory usd_hist
dump usd_hist
#*********** Dump of usd_hist *************
#History contains:
# - 14 Deleted shapes;
# - 28 Modified shapes;
# - 0 Generated shapes.
~~~~

@subsubsection occt_draw_hist_isdel isdeleted

*isdeleted* command checks if the given shape has been deleted in the given history.

Syntax:
~~~~
isdeleted       : isdeleted history shape
~~~~

Example:
~~~~
box b1 4 4 4 2 2 2
box b2 10 10 10
bcommon r b1 b2

savehistory com_hist
# all vertices, edges and faces of the b2 are deleted
foreach s [join [list [explode b2 v] [explode b2 e] [explode b2 f] ] ] {
  isdeleted com_hist $s
  # Deleted
}
~~~~

@subsubsection occt_draw_hist_mod modified

*modified* command returns the shapes Modified from the given shape in the given history. All modified shapes are put into a compound. If the shape has not been modified, the resulting compound will be empty. Note that if the shape has been modified into a single shape only, it will be returned without enclosure into the compound.

Syntax:
~~~~
modified        : modified modified_shapes history shape
~~~~

Example:
~~~~
box b 10 10 10
explode b e
fillet r b 2 b_1

savehistory fillet_hist

explode b f

modified m3 fillet_hist b_3
modified m5 fillet_hist b_5
~~~~

@subsubsection occt_draw_hist_gen generated

*generated* command returns the shapes Generated from the given shape in the given history. All generated shapes are put into a compound. If no shapes have been generated from the shape, the resulting compound will be empty. Note that; if the shape has generated a single shape only, it will be returned without enclosure into the compound.

Syntax:
~~~~
generated       : generated generated_shapes history shape
~~~~

Example:
~~~~
polyline w1 0 0 0 10 0 0 10 10 0
polyline w2 5 1 10 9 1 10 9 5 10

thrusections r 0 0 w1 w2

savehistory loft_hist

explode w1 e
explode w2 e

generated g11 loft_hist w1_1
generated g12 loft_hist w1_2
generated g21 loft_hist w2_1
generated g22 loft_hist w2_2

compare g11 g21
# equal shapes

compare g12 g22
# equal shapes
~~~~

@subsubsection occt_draw_hist_extension Enabling Draw history support for the algorithms

Draw History mechanism allows fast and easy enabling of the Draw history support for the OCCT algorithms supporting standard history methods.
To enable History commands for the algorithm it is necessary to save the history of the algorithm into the session.
For that, it is necessary to put the following code into the command implementation just after the command is done:
~~~~
BRepTest_Objects::SetHistory(ListOfArguments, Algorithm);
~~~~

Here is the example of how it is done in the command performing Split operation (see implementation of the *bapisplit* command):
~~~~
BRepAlgoAPI_Splitter aSplitter;
// setting arguments
aSplitter.SetArguments(BOPTest_Objects::Shapes());
// setting tools
aSplitter.SetTools(BOPTest_Objects::Tools());

// setting options
aSplitter.SetRunParallel(BOPTest_Objects::RunParallel());
aSplitter.SetFuzzyValue(BOPTest_Objects::FuzzyValue());
aSplitter.SetNonDestructive(BOPTest_Objects::NonDestructive());
aSplitter.SetGlue(BOPTest_Objects::Glue());
aSplitter.SetCheckInverted(BOPTest_Objects::CheckInverted());
aSplitter.SetUseOBB(BOPTest_Objects::UseOBB());
aSplitter.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());

// performing operation
aSplitter.Build();

if (BRepTest_Objects::IsHistoryNeeded())
{
  // Store the history for the Objects (overwrites the history in the session)
  BRepTest_Objects::SetHistory(BOPTest_Objects::Shapes(), aSplitter);
  // Add the history for the Tools
  BRepTest_Objects::AddHistory(BOPTest_Objects::Tools(), aSplitter);
}
~~~~

The method *BRepTest_Objects::IsHistoryNeeded()* controls if the history is needed to be filled in the algorithm and saved into the session after the algorithm is done (*setfillhistory* command controls this option in DRAW).


@subsection occt_draw_7_12  Texture Mapping to a Shape

Texture mapping allows you to map textures on a shape. Textures are texture image files and several are predefined. You can control the number of occurrences of the texture on a face, the position of a texture and the scale factor of the texture. 

@subsubsection occt_draw_7_12_1  vtexture

Syntax:      
~~~~~
vtexture NameOfShape TextureFile 
vtexture NameOfShape 
vtexture NameOfShape ? 
vtexture NameOfShape IdOfTexture 
~~~~~

**TextureFile** identifies the file containing the texture you want. The same syntax without **TextureFile** disables texture mapping. The question-mark <b>?</b> lists available textures. **IdOfTexture** allows applying predefined textures. 

@subsubsection occt_draw_7_12_2  vtexscale

Syntax:      
~~~~~
vtexscale NameOfShape ScaleU ScaleV 
vtexscale NameOfShape ScaleUV 
vtexscale NameOfShape 
~~~~~

*ScaleU* and *Scale V* allow scaling the texture according to the U and V parameters individually, while *ScaleUV* applies the same scale to both parameters. 

The syntax without *ScaleU*, *ScaleV* or *ScaleUV* disables texture scaling. 

@subsubsection occt_draw_7_12_3  vtexorigin

Syntax:       
~~~~~
vtexorigin NameOfShape UOrigin VOrigin 
vtexorigin NameOfShape UVOrigin 
vtexorigin NameOfShape 
~~~~~

*UOrigin* and *VOrigin* allow placing the texture according to the U and V parameters individually, while *UVOrigin* applies the same position value to both parameters. 

The syntax without *UOrigin*, *VOrigin* or *UVOrigin* disables origin positioning. 

@subsubsection occt_draw_7_12_4  vtexrepeat

Syntax:       
~~~~~
vtexrepeat NameOfShape URepeat VRepeat 
vtexrepeat NameOfShape UVRepeat 
vtexrepeat NameOfShape 
~~~~~

*URepeat* and *VRepeat* allow repeating the texture along the U and V parameters individually, while *UVRepeat* applies the same number of repetitions for both parameters. 

The same syntax without *URepeat*, *VRepeat* or *UVRepeat* disables texture repetition. 

@subsubsection occt_draw_7_12_5  vtexdefault

Syntax:       
~~~~~
vtexdefault NameOfShape 
~~~~~

*Vtexdefault* sets or resets the texture mapping default parameters. 

The defaults are: 

 * *URepeat = VRepeat = 1* no repetition 
 * *UOrigin = VOrigin = 1*  origin set at (0,0) 
 * *UScale = VScale = 1*  texture covers 100% of the face 
 
 
@section occt_draw_bop Boolean Operations Commands

This chapter describes existing commands of Open CASCADE Draw Test Harness that are used for performing, analyzing, debugging the algorithm in Boolean Component.
See @ref specification__boolean_operations "Boolean operations" user's guide for the description of these algorithms.

@subsection occt_draw_bop_two Boolean Operations on two operands

All commands in this section perform Boolean operations on two shapes. One of them is considered as object, and the other as a tool.

@subsubsection occt_draw_bop_two_bop bop, bopfuse, bopcut, boptuc, bopcommon, bopsection

These commands perform Boolean operations on two shapes:
* **bop** performs intersection of given shapes and stores the intersection results into internal Data Structure.
* **bopfuse** creates a new shape representing the union of two shapes.
* **bopcut** creates a new shape representing a subtraction of a second argument from the first one.
* **boptuc** creates a new shape representing a subtraction of a first argument from the second one.
* **bopcommon** creates a new shape representing the intersection of two shapes.
* **bopsection** creates a new shape representing the intersection edges and vertices between shapes.

These commands allow intersecting the shapes only once for building all types of Boolean operations. After *bop* command is done, the other commands in this category use the intersection results prepared by *bop*.
It may be very useful as the intersection part is usually most time-consuming part of the operation.

Syntax:      
~~~~~
bop shape1 shape2 
bopcommon result 
bopfuse result 
bopcut result 
boptuc result 
~~~~~

**Example:** 

Let's produce all four boolean operations on a box and a cylinder performing intersection only once:
~~~~~
box b 0 -10 5 20 20 10 
pcylinder c 5 20 

# intersect the shape, storing results into data structure 
bop b c 

# fuse operation
bopfuse s1 

# cut operation
bopcut s2 

# opposite cut operation
boptuc s3 

# common operation
bopcommon s4 

# section operation
bopsection s5
~~~~~


@subsubsection occt_draw_bop_two_bapi bfuse, bcut, btuc, bcommon, bsection

These commands also perform Boolean operations on two shapes. These are the short variants of the bop* commands.
Each of these commands performs both intersection and building the result and may be useful if you need only the result of a single boolean operation.

Syntax:
~~~~~
bcommon result shape1 shape2 
bfuse result shape1 shape2 
bcut result shape1 shape2 
btuc result shape1 shape2 
~~~~~

**bection** command has some additional options for faces intersection:
~~~~
bsection result shape1 shape2 [-n2d/-n2d1/-n2d2] [-na]

Where:
result - result of the operation
shape1, shape2 - arguments of the operation
-n2d - disables PCurve construction on both objects
-n2d1 - disables PCurve construction on first object
-n2d2 - disables PCurve construction on second object
-na - disables approximation of the section curves
~~~~

@subsection occt_draw_bop_multi Boolean Operations on multiple arguments

The modern Boolean Operations algorithm available in Open CASCADE Technology is capable of performing a Boolean Operations not only on two shapes, but on arbitrary number of shapes.
In terms of Boolean Operations these arguments are divided on two groups **Objects** and **Tools**. The meaning of these groups is similar to the single object and tool of Boolean Operations on two shapes.

The Boolean operations are based on the General Fuse operation (see @ref specification__boolean_7 "General Fuse algorithm") which splits all input shapes basing on the intersection results.
Depending on the type of Boolean operation the BOP algorithm choses the necessary splits of the arguments.

@subsection occt_draw_bop_general_com General commands for working with multiple arguments

The algorithms based on General Fuse operation are using the same commands for adding and clearing the arguments list and for performing intersection of these arguments.

@subsubsection occt_draw_bop_general_com_add Adding arguments of operation

The following commands are used to add the objects and tools for Boolean operations:
* **baddobjects** *S1 S2...Sn*	-- adds shapes *S1, S2, ... Sn* as Objects;
* **baddtools** *S1 S2...Sn* -- adds shapes *S1, S2, ... Sn* as Tools;

The following commands are used to clear the objects and tools:
* **bclearobjects** -- clears the list of Objects;
* **bcleartools**	-- clears the list of Tools;

So, when running subsequent operation in one Draw session, make sure you cleared the Objects and Tools from previous operation. Otherwise, the new arguments will be added to the current ones.

@subsubsection occt_draw_bop_general_com_fill Intersection of the arguments

The command **bfillds** performs intersection of the arguments (**Objects** and **Tools**) and stores the intersection results into internal Data Structure.


@subsection occt_draw_bop_build Building the result of operations

@subsubsection occt_draw_bop_build_BOP Boolean operation

The command **bbop** is used for building the result of Boolean Operation. It has to be used after **bfillds** command.

Syntax:
~~~~
bbop result iOp

Where:
result - result of the operation
iOp - type of Boolean Operation. It could have the following values:
0 - COMMON operation
1 - FUSE operation
2 - CUT operation
3 - CUT21 (opposite CUT, i.e. objects and tools are swapped) operation
4 - SECTION operation
~~~~

**Example**
~~~~
box b1 10 10 10
box b2 5 5 5 10 10 10
box b3 -5 -5 -5 10 10 10

# Clear objects and tools from previous runs
bclearobjects
bcleartools
# add b1 as object
baddobjects b1
# add b2 and b3 as tools
baddtools b2 b3
# perform intersection
bfillds
# build result
bbop rcom 0
bbop rfuse 1
bbop rcut 2
bbop rtuc 3
bbop rsec 4
~~~~

@subsubsection occt_draw_bop_build_GF General Fuse operation

The command **bbuild** is used for building the result of General Fuse Operation. It has to be used after **bfillds** command.
General Fuse operation does not make the difference between Objects and Tools considering both as objects.

Syntax:
~~~~
bbuild result
~~~~
**Example**
~~~~
box b1 10 10 10
box b2 5 5 5 10 10 10
box b3 -5 -5 -5 10 10 10

# Clear objects and tools from previous runs
bclearobjects
bcleartools
# add b1 as object
baddobjects b1
# add b2 and b3 as tools
baddtools b2 b3
# perform intersection
bfillds
# build result
bbuild result
~~~~

@subsubsection occt_draw_bop_build_Split Split operation

Split operation splits the **Objects** by the **Tools**.
The command **bsplit** is used for building the result of Split operation. It has to be used after **bfillds** command.

**Example**
~~~~
box b1 10 10 10
box b2 5 5 5 10 10 10
box b3 -5 -5 -5 10 10 10

# Clear objects and tools from previous runs
bclearobjects
bcleartools
# add b1 as object
baddobjects b1
# add b2 and b3 as tools
baddtools b2 b3
# perform intersection
bfillds
# build result
bsplit result
~~~~

@subsubsection occt_draw_bop_build_BOP_opensolids Alternative command for BOP

There is an alternative way to build the result of Boolean operation using the **buildbop** command, which should be run after any other building command, such as **bbuild** or **bbop** or **bsplit**.
The command has the following features:
* It is designed to work on open solids and thus uses the alternative approach for building the results (see @ref specification__boolean_bop_on_opensolids "BOP on open solids" chapter of Boolean operations user guide).
* It allows changing the groups of Objects and Tools of the operation (even excluding some of the arguments is possible).
* History information for solids will be lost.

Syntax:
~~~~
buildbop result -o s1 [s2 ...] -t s3 [s4 ...] -op operation (common/fuse/cut/tuc)
Where:
result      - result shape of the operation
s1 s2 s3 s4 - arguments (solids) of the GF operation
operation   - type of boolean operation
~~~~

**Example**
~~~~
box b1 10 10 10
box b2 5 5 5 10 10 10
box b3 -5 -5 -5 10 10 10

bclearobjects
bcleartools
baddobjects b1 b2 b3
bfillds
bbuild r

# bbop command will not be available as the tools are not set
# but buildbop is available

# fuse of two
buildbop r1 -o b1 -t b2 -op fuse
buildbop r2 -o b2 -t b3 -op fuse

# fuse of all - it does not matter how the groups are formed
buildbop r3 -o b1 b2 -t b3 -op fuse
buildbop r4 -o b2 -t b1 b3 -op fuse
buildbop r5 -o b1 b2 b3 -op fuse
buildbop r6 -t b1 b2 b3 -op fuse

# common of two
buildbop r7 -o b2 -t b1 -op common
buildbop r8 -o b1 -t b3 -op common

# common
buildbop r9 -o b1 -t b2 b3 -op common

# cut
buildbop r10 -o b1 -t b2 b3 -op cut

# opposite cut
buildbop r11 -o b1 -t b2 b3 -op tuc
~~~~

@subsubsection occt_draw_bop_build_CB Cells Builder

See the @ref specification__boolean_10c_Cells_1 "Cells Builder Usage" for the Draw usage of Cells Builder algorithm.


@subsubsection occt_draw_bop_build_API Building result through API

The following commands are used to perform the operation using API implementation of the algorithms:
* **bapibuild** -- to perform API general fuse operation.
* **bapibop** -- to perform API Boolean operation.
* **bapisplit** -- to perform API Split operation.

These commands have the same syntax as the analogical commands described above.


@subsection occt_draw_bop_options Setting options for the operation

The algorithms in Boolean component have a wide range of options.
To see the current state of all option the command **boptions** should be used.
It has the following syntax:
~~~~
boptions [-default]

-default - allows to set all options to default state.
~~~~

To have an effect the options should be set before the operation (before *bfillds* command).

@subsubsection occt_draw_bop_options_par Parallel processing mode

**brunparallel** command enables/disables the parallel processing mode of the operation.

Syntax:
~~~~
brunparallel flag

Where:
flag is the boolean flag controlling the mode:
flag == 0 - parallel processing mode is off.
flag != 0 - parallel processing mode is on.
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_safe Safe processing mode

**bnondestructive** command enables/disables the safe processing mode in which the input arguments are protected from modification.

Syntax:
~~~~
bnondestructive flag

Where:
flag is the boolean flag controlling the mode:
flag == 0 - safe processing mode is off.
flag != 0 - safe processing mode is on.
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_fuzzy Fuzzy option

**bfuzzyvalue** command sets the additional tolerance for operations.

Syntax:
~~~~
bfuzzyvalue value
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_glue Gluing option

**bglue** command sets the gluing mode for the BOP algorithms.

Syntax:
~~~~
bglue 0/1/2

Where:
0 - disables gluing mode.
1 - enables the Shift gluing mode.
2 - enables the Full gluing mode.
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_checkinv Check inversion of input solids

**bcheckinverted** command enables/disables the check of the input solids on inverted status in BOP algorithms.

Syntax:
~~~~
bcheckinverted 0 (off) / 1 (on)
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_obb OBB usage

**buseobb** commannd enables/disables the usage of OBB in BOP algorithms.

Syntax:
~~~~
buseobb 0 (off) / 1 (on)
~~~~

The command is applicable for all commands in the component.

@subsubsection occt_draw_bop_options_simplify Result simplification

**bsimplify** command enables/disables the result simplification after BOP. The command is applicable only to the API variants of GF, BOP and Split operations.

Syntax:
~~~~
bsimplify [-e 0/1] [-f 0/1] [-a tol]

Where:
-e 0/1 - enables/disables edges unification
-f 0/1 - enables/disables faces unification
-a tol - changes default angular tolerance of unification algo.
~~~~

@subsubsection occt_draw_bop_options_warn Drawing warning shapes

**bdrawwarnshapes** command enables/disables drawing of warning shapes of BOP algorithms.

Syntax:
~~~~
bdrawwarnshapes 0 (do not draw) / 1 (draw warning shapes)
~~~~

The command is applicable for all commands in the component.


@subsection occt_draw_bop_check Check commands

The following commands are analyzing the given shape on the validity of Boolean operation.

@subsubsection occt_draw_bop_check_1 bopcheck

Syntax:
~~~~
bopcheck shape [level of check: 0 - 9]
~~~~

It checks the given shape for self-interference. The optional level of check allows limiting the check to certain intersection types. Here are the types of interferences that will be checked for given level of check:
* 0 - only V/V;
* 1 - V/V and V/E;
* 2 - V/V, V/E and E/E;
* 3 - V/V, V/E, E/E and V/F;
* 4 - V/V, V/E, E/E, V/F and E/F;
* 5 - V/V, V/E, E/E, V/F, E/F and F/F;
* 6 - V/V, V/E, E/E, V/F, E/F, F/F and V/S;
* 7 - V/V, V/E, E/E, V/F, E/F, F/F, V/S and E/S;
* 8 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S and F/S;
* 9 - V/V, V/E, E/E, V/F, E/F, F/F, V/S, E/S, F/S and S/S - all interferences (Default value)

**Example:**
~~~~
box b1 10 10 10
box b2 3 3 3 4 4 4
compound b1 b2 c
bopcheck c
~~~~

In this example one box is completely included into other box. So the output shows that all sub-shapes of b2 interfering with the solid b1.
**bopcheck** command does not modifies the input shape, thus can be safely used.


@subsubsection occt_draw_bop_check_2 bopargcheck

**bopargcheck** syntax:
~~~~
bopargcheck Shape1 [[Shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P|C|S]] [#BF]

 -<Boolean Operation>
 F (fuse)
 O (common)
 C (cut)
 T (cut21)
 S (section)
 U (unknown)
 For example: "bopargcheck s1 s2 -F" enables checking for Fuse operation
 default - section

 /<Test Options>
 R (disable small edges (shrank range) test)
 F (disable faces verification test)
 T (disable tangent faces searching test)
 V (disable test possibility to merge vertices)
 E (disable test possibility to merge edges)
 I (disable self-interference test)
 P (disable shape type test)
 C (disable test for shape continuity)
 S (disable curve on surface check)
 For example: "bopargcheck s1 s2 /RI" disables small edge detection and self-intersection detection
 default - all options are enabled

 #<Additional Test Options>
 B (stop test on first faulty found); default OFF
 F (full output for faulty shapes); default - output in a short format

 NOTE: <Boolean Operation> and <Test Options> are used only for couple of argument shapes, except I and P options that are always used for couple of shapes as well as for single shape test.
~~~~

As you can see *bopargcheck* performs more extended check of the given shapes than *bopcheck*.

**Example:**
Let's make an edge with big vertices:
~~~~
vertex v1 0 0 0
settolerance v1 0.5
vertex v2 1 0 0
settolerance v2 0.5
edge e v1 v2
top; don e; fit
tolsphere e

bopargcheck e
~~~~
Here is the output of this command:
~~~~
Made faulty shape: s1si_1
Made faulty shape: s1se_1
Faulties for FIRST  shape found : 2
---------------------------------
Shapes are not suppotrted by BOP: NO
Self-Intersections              : YES  Cases(1)  Total shapes(2)
Check for SI has been aborted   : NO
Too small edges                 : YES  Cases(1)  Total shapes(1)
Bad faces                       : NO
Too close vertices              : DISABLED
Too close edges                 : DISABLED
Shapes with Continuity C0       : NO
Invalid Curve on Surface        : NO

Faulties for SECOND  shape found : 0
~~~~

@subsection occt_draw_bop_debug Debug commands

The following terms and definitions are used in this chapter:
* **DS** -- internal data structure used by the algorithm (*BOPDS_DS* object).
* **PaveFiller** -- intersection part of the algorithm (*BOPAlgo_PaveFiller* object).
* **Builder** -- builder part of the algorithm (*BOPAlgo_Builder* object).
* **IDS Index** -- the index of the vector *myLines*.

@subsubsection occt_draw_bop_debug_int Intersection Part commands

All commands listed below  are available when the Intersection Part of the algorithm is done (i.e. after the command *bfillds*).

**bopds**
	
Syntax: 
~~~~
bopds -v [e, f]	
~~~~

Displays:
* all BRep shapes of arguments that are in the DS [default];
* <i>-v</i> : only vertices of arguments that are in the DS;
* <i>-e</i> : only edges of arguments that are in the DS;
* <i>-f</i> : only faces of arguments that are in the DS.

**bopdsdump**

Prints contents of the DS. 

Example:
~~~~
 Draw[28]> bopdsdump
 *** DS ***
 Ranges:2			number of ranges
 range: 0 33		indices for range 1
 range: 34 67		indices for range 2
 Shapes:68		total number of source shapes
 0 : SOLID { 1 }
 1 : SHELL { 2 12 22 26 30 32 }
 2 : FACE { 4 5 6 7 8 9 10 11 }
 3 : WIRE { 4 7 9 11 }
 4 : EDGE { 5 6 }
 5 : VERTEX { }
 6 : VERTEX { }
 7 : EDGE { 8 5 }
 8 : VERTEX { }
~~~~

@code 0 : SOLID { 1 } @endcode has the following meaning:
* *0* -- index in the DS;
* *SOLID* -- type of the shape;
* <i>{ 1 }</i> -- a DS index of the successors.


**bopindex**

Syntax:
~~~~
bopindex S
~~~~
Prints DS index of shape *S*.


**bopiterator**

Syntax:
~~~~~
bopiterator [t1 t2]
~~~~~

Prints pairs of DS indices of source shapes that are intersected in terms of bounding boxes.

<i>[t1 t2]</i> are types of the shapes:
* *7* -- vertex;
* *6* -- edge;
* *4* -- face.

Example:
~~~~
 Draw[104]> bopiterator 6 4
 EF: ( z58 z12 )
 EF: ( z17 z56 )
 EF: ( z19 z64 )
 EF: ( z45 z26 )
 EF: ( z29 z36 )
 EF: ( z38 z32 )
~~~~

* *bopiterator 6 4* prints pairs of indices for types: edge/face;
* *z58 z12* -- DS indices of intersecting edge and face.


**bopinterf**

Syntax: 
~~~~
bopinterf t
~~~~

Prints contents of *myInterfTB* for the type of interference *t*:
* *t=0* : vertex/vertex;
* *t=1* : vertex/edge;
* *t=2* : edge/edge;
* *t=3* : vertex/face;
* *t=4* : edge/face.

Example:
~~~~
 Draw[108]> bopinterf 4
 EF: (58, 12, 68), (17, 56, 69), (19, 64, 70), (45, 26, 71), (29, 36, 72), (38, 32, 73), 6 EF found.
~~~~

Here, record <i>(58, 12, 68)</i> means:
* *58* -- a DS index of the edge;
* *12* -- a DS index of the face;
* *68* -- a DS index of the new vertex.


**bopsp**

Displays split edges. 

Example:
~~~~
 Draw[33]> bopsp
 edge 58 : z58_74 z58_75
 edge 17 : z17_76 z17_77
 edge 19 : z19_78 z19_79
 edge 45 : z45_80 z45_81
 edge 29 : z29_82 z29_83
 edge 38 : z38_84 z38_85
~~~~

* *edge 58* -- 58 is a DS index of the original edge.
* *z58_74 z58_75* -- split edges, where 74, 75 are DS indices of the split edges.

**bopcb**

Syntax:
~~~~
bopcb [nE]
~~~~

Prints Common Blocks for:
* all source edges (by default);
* the source edge with the specified index *nE*.

Example:
~~~~
 Draw[43]> bopcb 17
 -- CB:
 PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }
 Faces: 36
~~~~

This command dumps common blocks for the source edge with index 17. 
* *PB* -- information about the Pave Block;
	* *71* -- a DS index of the split edge
	* *17* -- a DS index of the original edge
* <i>Pave1 : { 68 3.000 }</i> -- information about the Pave:
	* *68* -- a DS index of the vertex of the pave
	* *3.000* -- a parameter of vertex 68 on edge 17
* *Faces: 36* -- 36 is a DS index of the face the common block belongs to. 


**bopfin**

Syntax:
~~~~
bopfin nF	
~~~~
Prints Face Info about IN-parts for the face with DS index *nF*.

Example:
~~~~
 Draw[47]> bopfin 36
 pave blocks In:
 PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }
 PB:{ E:75 orE:19 Pave1: { 69 3.000 } Pave2: { 18 10.000 } }
 vrts In:
 18
~~~~


* <i>PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }</i> -- information about the Pave Block; 
* <i>vrts In ... 18 </i> -- a DS index of the vertex IN the face.

**bopfon**

Syntax:
~~~~
bopfon nF
~~~~
Print Face Info about ON-parts for the face with DS index *nF*.

Example:
~~~~
 Draw[58]> bopfon 36
 pave blocks On:
 PB:{ E:72 orE:38 Pave1: { 69 0.000 } Pave2: { 68 10.000 } }
 PB:{ E:76 orE:45 Pave1: { 69 0.000 } Pave2: { 71 10.000 } }
 PB:{ E:78 orE:43 Pave1: { 71 0.000 } Pave2: { 70 10.000 } }
 PB:{ E:74 orE:41 Pave1: { 68 0.000 } Pave2: { 70 10.000 } }
 vrts On:
 68 69 70 71
~~~~

* <i>PB:{ E:72 orE:38 Pave1: { 69 0.000 } Pave2: { 68 10.000 } }</i> -- information about the Pave Block; 
* <i>vrts On: ... 68 69 70 71</i> -- DS indices of the vertices ON the face.

**bopwho**

Syntax:
~~~~
bopwho nS
~~~~

Prints the information about the shape with DS index *nF*.

Example:
~~~~
 Draw[116]> bopwho 5
 rank: 0
~~~~

* *rank: 0* -- means that shape 5 results from the Argument with index 0.

Example:
~~~~
 Draw[118]> bopwho 68
 the shape is new
 EF: (58, 12),
 FF curves: (12, 56),
 FF curves: (12, 64),
~~~~

This means that shape 68 is a result of the following interferences:
* *EF: (58, 12)* -- edge 58 / face 12
* *FF curves: (12, 56)* -- edge from the intersection curve between faces 12 and 56
* *FF curves: (12, 64)* -- edge from the intersection curve between faces 12 and 64

**bopnews**

Syntax:
~~~~
bopnews -v [-e]
~~~~

* <i>-v</i> -- displays all new vertices produced during the operation;
* <i>-e</i> -- displays all new edges produced during the operation.

@subsubsection occt_draw_bop_debug_build Building Part commands

The commands listed below are available when the Building Part of the algorithm is done (i.e. after the command *bbuild*).

**bopim**

Syntax: 
~~~~
bopim S
~~~~
Shows the compound of shapes that are images of shape *S* from the argument.

 
@section occt_draw_8 Data Exchange commands

This chapter presents some general information about Data Exchange (DE) operations. 

DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.) 

This files include a number of entities. Each entity has its own number in the file which we call label and denote as # for a STEP file and D for an IGES file. Each file has entities called roots (one or more). A full description of such entities is contained in the Users' Guides 
* for <a href="user_guides__step.html#occt_step_1">STEP format</a> and
* for <a href="user_guides__iges.html#occt_iges_1">IGES format</a>. 

Each Draw session has an interface model, which is a structure for keeping various information. 

The first step of translation is loading information from a file into a model. 
The second step is creation of an OpenCASCADE shape from this model. 

Each entity from a file has its own number in the model (num). During the translation a map of correspondences between labels(from file) and numbers (from model) is created. 

The model and the map are used for working with most of DE commands. 

@subsection occt_draw_8_1  IGES commands 

@subsubsection occt_draw_8_1_1  igesread

Syntax:      
~~~~~
igesread <file_name> <result_shape_name> [<selection>]
~~~~~

Reads an IGES file to an OCCT shape. This command will interactively ask the user to select a set of entities to be converted. 


| N | Mode | Description |
| :-- | :-- | :---------- |
| 0 | End | finish conversion and exit igesbrep |
| 1 | Visible roots | convert only visible roots |
| 2 | All roots | convert all roots |
| 3 | One entity | convert entity with number provided by the user |
| 4 | Selection | convert only entities contained in selection |


After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes (e.g., one shape per root or one shape for all the entities). It is also possible to save loaded shapes in files, and to cancel loading. 

The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was *s*, they will be *s_1, ... s_N*. 

<i>\<selection\></i> specifies the scope of selected entities in the model, by default it is *xst-transferrable-roots*.  If we use symbol <i>*</i> as <i>\<selection\></i> all roots will be translated. 

See also the detailed description of <a href="user_guides__iges.html#occt_iges_2_3_4">Selecting IGES entities</a>.

**Example:**
~~~~~
# translation all roots from file 
igesread /disk01/files/model.igs a  * 
~~~~~

@subsubsection occt_draw_8_1_2   tplosttrim

Syntax:      
~~~~~
tplosttrim [<IGES_type>] 
~~~~~

Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails. This command gives us a number of lost trims and the number of corresponding IGES entities. 
It outputs the rank and numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once. 
Optional parameter <i>\<IGES_type\></i> can be *0TrimmedSurface, BoundedSurface* or *Face* to specify the only type of IGES faces. 

**Example:**
~~~~~
tplosttrim TrimmedSurface 
~~~~~

@subsubsection occt_draw_8_1_3  brepiges

Syntax:      
~~~~~
brepiges <shape_name> <filename.igs>
~~~~~

Writes an OCCT shape to an IGES file. 

**Example:** 
~~~~~    
# write shape with name aa to IGES file 
brepiges aa /disk1/tmp/aaa.igs 
== unit (write) : MM 
== mode  write  : Faces 
==   To modifiy : command  param 
== 1 Shapes written, giving 345 Entities 
==  Now, to write a file, command : writeall filename 
==  Output on file : /disk1/tmp/aaa.igs 
==  Write OK 
~~~~~

@subsection occt_draw_8_2  STEP commands 

These commands are used during the translation of STEP models. 


@subsubsection occt_draw_8_2_1  stepread

Syntax:      
~~~~~
stepread file_name result_shape_name [selection] 
~~~~~

Read a STEP file to an OCCT shape. 
This command will interactively ask the user to select a set of entities to be converted: 

| N | Mode | Description |
| :---- | :---- | :---- |  
| 0 | End | Finish transfer and exit stepread | 
| 1 | root with rank 1 | Transfer first root | 
| 2 | root by its rank | Transfer root specified by its rank | 
| 3 | One entity | Transfer entity with a number provided by the user | 
| 4 | Selection | Transfer only entities contained in selection | 

After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes. 
The second parameter of this command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was *s*, they will be *s_1, ... s_N*. 
<i>\<selection\></i> specifies the scope of selected entities in the model.  If we use symbol <i>*</i> as <i>\<selection\></i> all roots will be translated. 

See also the detailed description of <a href="user_guides__step.html#occt_step_2_3_6">Selecting STEP entities</a>.

**Example:**
~~~~~
# translation all roots from file 
stepread /disk01/files/model.stp a  * 
~~~~~

@subsubsection occt_draw_8_2_2   stepwrite

Syntax:      
~~~~~
stepwrite mode shape_name file_name 
~~~~~

Writes an OCCT shape to a STEP file. 

The following  modes are available : 
    * *a* -- as is -- the mode is selected automatically depending on the type & geometry of the shape; 
    * *m* -- *manifold_solid_brep* or *brep_with_voids* 
    * *f* -- *faceted_brep* 
    * *w* -- *geometric_curve_set* 
    * *s* -- *shell_based_surface_model* 
 
For further information see <a href="#user_guides__step.html#occt_step_6_5">Writing a STEP file</a>. 

**Example:**

Let us write shape *a* to a STEP file in mode *0*. 

~~~~~
stepwrite 0 a /disk1/tmp/aaa.igs 
~~~~~


@subsection occt_draw_8_3  General commands 

These are auxilary commands used for the analysis of result of translation of IGES and STEP files. 

@subsubsection occt_draw_8_3_1  count

Syntax:      
~~~~~
count <counter> [<selection>] 
~~~~~

Calculates statistics on the entities in the model and outputs a count of entities. 

The optional selection argument, if specified, defines a subset of entities, which are to be taken into account. The first argument should be one of the currently defined counters. 

| Counter | Operation |
| :-------- | :-------- | 
| xst-types | Calculates how many entities of each OCCT type exist | 
| step214-types | Calculates how many entities of each STEP type exist |

**Example:**
~~~~~
count xst-types 
~~~~~

@subsubsection occt_draw_8_3_2 data

Syntax:      
~~~~~
data <symbol>
~~~~~

Obtains general statistics on the loaded data. 
The information printed by this command depends on the symbol specified. 

**Example:**
~~~~~
# print full information about warnings and fails 
data c 
~~~~~

| Symbol | Output |
| :------ | :------ |
| g | Prints the information contained in the header of the file |
| c or f | Prints messages generated during the loading of the STEP file (when the procedure of the integrity of the loaded data check is performed) and the resulting statistics (f works only with fail messages while c with both fail and warning messages) |
| t | The same as c or f, with a list of failed or warned entities |
| m or l | The same as t but also prints a status for each entity | 
| e | Lists all entities of the model with their numbers, types, validity status etc. |
| R | The same as e but lists only root entities |



@subsubsection occt_draw_8_3_3  elabel

Syntax:      
~~~~~
elabel <num>
~~~~~

Entities in the IGES and STEP files are numbered in the succeeding order. An entity can be identified either by its number or by its label. Label is the letter ‘#'(for STEP, for IGES use ‘D’) followed by the rank. This command gives us a label for an entity with a known number. 

**Example:**
~~~~~
elabel 84 
~~~~~

@subsubsection occt_draw_8_3_4  entity

Syntax:      
~~~~~
entity <#(D)>_or_<num> <level_of_information>
~~~~~

The content of an IGES or STEP entity can be obtained by using this command. 
Entity can be determined by its number or label. 
<i>\<level_of_information\></i> has range [0-6]. You can get more information about this level using this command without parameters. 

**Example:**
~~~~~
# full information for STEP entity with label 84 
entity #84 6 
~~~~~

@subsubsection occt_draw_8_3_5  enum

Syntax:      
~~~~~
enum <#(D)> 
~~~~~

Prints a number for the entity with a given label. 

**Example:**
~~~~~
# give a number for IGES entity with label 21 
enum D21 
~~~~~

@subsubsection occt_draw_8_3_6  estatus

Syntax:      
~~~~~
estatus <#(D)>_or_<num>
~~~~~

The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command. 

**Example:**
~~~~~
estatus #315 
~~~~~

@subsubsection occt_draw_8_3_7  fromshape

Syntax:      
~~~~~
fromshape <shape_name>
~~~~~

Gives the number of an IGES or STEP entity corresponding to an OCCT shape. If no corresponding entity can be found and if OCCT shape is a compound the command explodes it to subshapes and try to find corresponding entities for them. 

**Example:**
~~~~~
fromshape a_1_23 
~~~~~

@subsubsection occt_draw_8_3_8  givecount

Syntax:
~~~~~
givecount <selection_name> [<selection_name>]
~~~~~


Prints a number of loaded entities defined by the selection argument.
Possible values of \<selection_name\> you can find in the “IGES FORMAT Users’s Guide”.

**Example:**
~~~~~
givecount xst-model-roots 
~~~~~

@subsubsection occt_draw_8_3_9  givelist

Syntax:      
~~~~~
givelist <selection_name>
~~~~~

Prints a list of a subset of loaded entities defined by the selection argument: 
| Selection | Description |
| :-------- | :----------- |
| xst-model-all | all entities of the model |
| xst-model-roots | all roots |
| xst-pointed | (Interactively) pointed entities (not used in DRAW) |
| xst-transferrable-all | all transferable (recognized) entities |
| xst-transferrable-roots | Transferable roots | 


**Example:**
~~~~~
# give a list of all entities of the model 
givelist xst-model-all 
~~~~~

@subsubsection occt_draw_8_3_10  listcount

Syntax:     listcount \<counter\> [\<selection\> ...]

Prints a list of entities per each type matching the criteria defined by arguments. 
Optional <i>\<selection\></i> argument, if specified, defines a subset of entities, which are to be taken into account. Argument <i>\<counter\></i>  should be one of the currently defined counters: 

| Counter     | Operation |
| :-----      | :------   |
| xst-types   | Calculates how many entities of each OCCT type exist |
| iges-types  | Calculates how many entities of each IGES type and form exist |
| iges-levels | Calculates how many entities lie in different IGES levels |

**Example:**
~~~~~
listcount xst-types 
~~~~~

@subsubsection occt_draw_8_3_11  listitems

Syntax:      
~~~~~
listitems 
~~~~~

This command prints a list of objects (counters, selections etc.) defined in the current session. 


@subsubsection occt_draw_8_3_12  listtypes

Syntax:      
~~~~~
listtypes [<selection_name> ...]
~~~~~

Gives a list of entity types which were encountered in the last loaded file (with a number of entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument. 


@subsubsection occt_draw_8_3_13  newmodel

Syntax:      
~~~~~
newmodel 
~~~~~

Clears the current model. 


@subsubsection occt_draw_8_3_14  param

Syntax:      
~~~~~
param [<parameter>] [<value>]
~~~~~

This command is used to manage translation parameters. 
Command without arguments gives a full list of parameters with current values. 
Command with <i>\<parameter\></i> (without <i><value></i>) gives us the current value of this parameter and all possible values for it. Command with <i><value></i> sets this new value to <i>\<parameter\></i>.

**Example:**

Let us get the information about possible schemes for writing STEP file :

~~~~~
param write.step.schema 
~~~~~

@subsubsection occt_draw_8_3_15  sumcount

Syntax:      
~~~~~
sumcount <counter> [<selection> ...]
~~~~~

Prints only a number of entities per each type matching the criteria defined by arguments. 

**Example:**
~~~~~
sumcount xst-types 
~~~~~

@subsubsection occt_draw_8_3_16  tpclear

Syntax:      
~~~~~
tpclear  
~~~~~

Clears the map of correspondences between IGES or STEP entities and OCCT shapes. 



@subsubsection occt_draw_8_3_17  tpdraw

Syntax:      
~~~~~
tpdraw <#(D)>_or_<num>
~~~~~

**Example:**
~~~~~
tpdraw 57 
~~~~~

@subsubsection occt_draw_8_3_18  tpent

Syntax:      
~~~~~
tpent <#(D)>_or_<num>
~~~~~

Get information about the result of translation of the given IGES or STEP entity.

**Example:**
~~~~~
tpent \#23 
~~~~~

@subsubsection occt_draw_8_3_19  tpstat

Syntax:      
~~~~~
tpstat [*|?]<symbol> [<selection>]
~~~~~


Provides all statistics on the last transfer, including a list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter <i>\<symbol\></i> defines what information will be printed: 

* *g* -- General statistics (a list of results and messages)
* *c* -- Count of all warning and fail messages
* *C* -- List of all warning and fail messages
* *f* -- Count of all fail messages
* *F* -- List of all fail messages
* *n* -- List of all transferred roots
* *s* -- The same, with types of source entity and the type of result
* *b* -- The same, with messages
* *t* -- Count of roots for geometrical types
* *r* -- Count of roots for topological types
* *l* -- The same, with the type of the source entity

The sign \* before parameters *n, s, b, t, r* makes it work on all entities (not only on roots).

The sign ? before *n, s, b, t* limits the scope of information to invalid entities. 

Optional argument \<selection\> can limit the action of the command to the selection, not to all entities. 

To get help, run this command without arguments. 

**Example:**
~~~~~
# translation ratio on IGES faces 
tpstat *l iges-faces 
~~~~~

@subsubsection occt_draw_8_3_20  xload

Syntax:      
~~~~~
xload <file_name>
~~~~~

This command loads an IGES or STEP file into memory (i.e. to fill the model with data from the file) without creation of an OCCT shape. 

**Example:**
~~~~~
xload /disk1/tmp/aaa.stp 
~~~~~


@subsection occt_draw_8_4  Overview of XDE commands 

These commands are used for translation of IGES and STEP files into an XCAF document (special document is inherited from CAF document and is intended for Extended Data Exchange (XDE) ) and working with it. XDE translation allows reading and writing of shapes with additional attributes -- colors, layers etc. All commands can be divided into the following groups: 
  * XDE translation commands
  * XDE general commands
  * XDE shape’s commands
  * XDE color’s commands
  * XDE layer’s commands
  * XDE property’s commands

Reminding: All operations of translation are performed with parameters managed by command @ref occt_draw_8_3_14 "param".

@subsubsection occt_draw_8_4_1  ReadIges

Syntax:      
~~~~~
ReadIges document file_name 
~~~~~

Reads information from an IGES file to an XCAF document. 

**Example:**
~~~~~
ReadIges D /disk1/tmp/aaa.igs 
==> Document saved with name D 
~~~~~

@subsubsection occt_draw_8_4_2  ReadStep

Syntax:      
~~~~~
ReadStep <document> <file_name>
~~~~~

Reads information from a STEP file to an XCAF document. 

**Example:**
~~~~~
ReadStep D /disk1/tmp/aaa.stp 
== Document saved with name D 
~~~~~

@subsubsection occt_draw_8_4_3  WriteIges

Syntax:      
~~~~~
WriteIges <document> <file_name>
~~~~~

**Example:**
~~~~~
WriteIges D /disk1/tmp/aaa.igs 
~~~~~

@subsubsection occt_draw_8_4_4  WriteStep

Syntax:      
~~~~~
WriteStep <document> <file_name>
~~~~~

Writes information from an XCAF document to a STEP file. 

**Example:**
~~~~~
WriteStep D /disk1/tmp/aaa.stp 
~~~~~

@subsubsection occt_draw_8_4_5  XFileCur

Syntax:      
~~~~~
XFileCur  
~~~~~

Returns the name of file which is set as the current one in the Draw session. 

**Example:**
~~~~~
XFileCur 
== *as1-ct-203.stp* 
~~~~~

@subsubsection occt_draw_8_4_6  XFileList

Syntax:      
~~~~~
XFileList  
~~~~~

Returns a list all files that were transferred by the last transfer. This command is  meant (assigned) for the assemble step file. 

**Example:**
~~~~~
XFileList 
==> *as1-ct-Bolt.stp* 
==> *as1-ct-L-Bracktet.stp* 
==> *as1-ct-LBA.stp* 
==> *as1-ct-NBA.stp* 
==> … 
~~~~~

@subsubsection occt_draw_8_4_7  XFileSet

Syntax:      
~~~~~
XFileSet <filename> 
~~~~~

Sets the current file taking it from the components list of the assemble file. 

**Example:**
~~~~~
XFileSet as1-ct-NBA.stp 
~~~~~

@subsubsection occt_draw_8_4_8  XFromShape

Syntax:      
~~~~~
XFromShape <shape>
~~~~~

This command is similar to the command @ref occt_draw_8_3_7 "fromshape", but gives additional information about the file name. It is useful if a shape was translated from several files. 

**Example:**
~~~~~
XFromShape a 
==> Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp 
~~~~~

@subsection occt_draw_8_5  XDE general commands 

@subsubsection occt_draw_8_5_1  XNewDoc

Syntax:      
~~~~~
XNewDoc <document>
~~~~~

Creates a new XCAF document. 

**Example:**
~~~~~
XNewDoc D 
~~~~~

@subsubsection occt_draw_8_5_2  XShow

Syntax:      
~~~~~
XShow <document> [ <label1> … ]
~~~~~

Shows a shape from a given label in the 3D viewer. If the label is not given -- shows all shapes from the document. 

**Example:**
~~~~~
# show shape from label 0:1:1:4 from document D 
XShow D 0:1:1:4 
~~~~~

@subsubsection occt_draw_8_5_3  XStat

Syntax:      
~~~~~
XStat <document>
~~~~~

Prints common information from an XCAF document. 

**Example:**
~~~~~
XStat D 
==>Statistis of shapes in the document: 
==>level N 0 : 9 
==>level N 1 : 18 
==>level N 2 : 5 
==>Total number of labels for shapes in the document = 32 
==>Number of labels with name = 27 
==>Number of labels with color link = 3 
==Number of labels with layer link = 0 
==>Statistis of Props in the document: 
==>Number of Centroid Props = 5 
==>Number of Volume Props = 5 
==>Number of Area Props = 5 
==>Number of colors = 4 
==>BLUE1 RED YELLOW BLUE2 
==>Number of layers = 0 
~~~~~

@subsubsection occt_draw_8_5_4  XWdump

Syntax:      
~~~~~
XWdump <document> <filename>
~~~~~

Saves the contents of the viewer window as an image (XWD, png or BMP file). 
<i>\<filename\></i> must have a corresponding extention. 

**Example:**
~~~~~
XWdump D /disk1/tmp/image.png 
~~~~~

@subsubsection occt_draw_8_5_5  Xdump

Syntax:      
~~~~~
Xdump <document> [int deep {0|1}]
~~~~~

Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes. 

**Example:**
~~~~~
Xdump D 1 
==> ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
==> ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
==> ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
==> ASSEMBLY 0:1:1:4 PLATE(0xe8387780) 
==> ASSEMBLY 0:1:1:5 ROD(0xe8475418) 
==> ASSEMBLY 0:1:1:6 AS1(0xe8476968) 
==>    ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230) 
==>       ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
==>       ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0) 
==>               ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
==>               ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
etc. 
~~~~~

@subsection occt_draw_8_6  XDE shape commands 

@subsubsection occt_draw_8_6_1  XAddComponent

Syntax:      
~~~~~
XAddComponent <document> <label> <shape> 
~~~~~

Adds a component shape to assembly. 

**Example:**

Let us add shape b as component shape to assembly shape from label *0:1:1:1* 

~~~~~
XAddComponent D 0:1:1:1 b 
~~~~~

@subsubsection occt_draw_8_6_2  XAddShape

Syntax:      
~~~~~
XAddShape <document> <shape> [makeassembly=1]
~~~~~

Adds a shape (or an assembly) to a document. If this shape already exists in the document, then prints the label which points to it. By default, a new shape is added as an assembly (i.e. last parameter 1), otherwise it is necessary to pass 0 as the last parameter. 

**Example:**
~~~~~
# add shape b to document D 
XAddShape D b 0 
== 0:1:1:10 
# if pointed shape is compound and last parameter in 
# XAddShape command is used by default (1), then for 
# each subshapes new label is created 
~~~~~

@subsubsection occt_draw_8_6_3  XFindComponent

Syntax:      
~~~~~
XFindComponent <document> <shape>
~~~~~

Prints a sequence of labels of the assembly path. 

**Example:**
~~~~~
XFindComponent D b 
~~~~~

@subsubsection occt_draw_8_6_4  XFindShape

Syntax:      
~~~~~
XFindShape <document> <shape>
~~~~~

Finds and prints a label with an indicated top-level shape. 

**Example:**
~~~~~
XFindShape D a 
~~~~~

@subsubsection occt_draw_8_6_5  XGetFreeShapes

Syntax:      
~~~~~
XGetFreeShapes <document> [shape_prefix]
~~~~~

Print labels or create DRAW shapes for all free shapes in the document. 
If *shape_prefix* is absent -- prints labels, else -- creates DRAW shapes with names 
<i>shape_prefix</i>_num (i.e. for example: there are 3 free shapes and *shape_prefix* = a therefore shapes will be created with names a_1, a_2 and a_3). 

**Note**: a free shape is a shape to which no other shape refers to. 

**Example:**
~~~~~
XGetFreeShapes D 
== 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13 

XGetFreeShapes D sh 
== sh_1 sh_2 sh_3 sh_4 
~~~~~

@subsubsection occt_draw_8_6_6  XGetOneShape

Syntax:      
~~~~~
XGetOneShape <shape> <document>
~~~~~

Creates one DRAW shape for all free shapes from a document. 

**Example:**
~~~~~
XGetOneShape a D 
~~~~~

@subsubsection occt_draw_8_6_7  XGetReferredShape

Syntax:      
~~~~~
XGetReferredShape <document> <label>
~~~~~

Prints a label that contains a top-level shape that corresponds to a shape at a given label. 

**Example:**
~~~~~
XGetReferredShape D 0:1:1:1:1 
~~~~~

@subsubsection occt_draw_8_6_8  XGetShape

Syntax:      
~~~~~
XGetShape <result> <document> <label>
~~~~~

Puts a shape from the indicated label in document to result. 

**Example:**
~~~~~
XGetShape b D 0:1:1:3 
~~~~~

@subsubsection occt_draw_8_6_9  XGetTopLevelShapes

Syntax:      
~~~~~
XGetTopLevelShapes <document>
~~~~~

Prints labels that contain top-level shapes. 

**Example:**
~~~~~
XGetTopLevelShapes D 
== 0:1:1:1 0:1:1:2 0:1:1:3 0:1:1:4 0:1:1:5 0:1:1:6 0:1:1:7 
0:1:1:8 0:1:1:9 
~~~~~

@subsubsection occt_draw_8_6_10  XLabelInfo

Syntax:      
~~~~~
XLabelInfo <document> <label>
~~~~~

Prints information about a shape, stored at an indicated label. 

**Example:** 
~~~~~    
XLabelInfo D 0:1:1:6 
==> There are TopLevel shapes. There is an Assembly. This Shape is not used. 
~~~~~

@subsubsection occt_draw_8_6_11  XNewShape

Syntax:      
~~~~~
XNewShape <document>
~~~~~

Creates a new empty top-level shape. 

**Example:**
~~~~~
XNewShape D 
~~~~~

@subsubsection occt_draw_8_6_12  XRemoveComponent

Syntax:      
~~~~~
XRemoveComponent <document> <label>
~~~~~

Removes a component from the components label. 

**Example:**
~~~~~
XRemoveComponent D 0:1:1:1:1 
~~~~~

@subsubsection occt_draw_8_6_13  XRemoveShape

Syntax:      
~~~~~
XRemoveShape <document> <label>
~~~~~

Removes a shape from a document (by it’s label). 

**Example:**
~~~~~
XRemoveShape D 0:1:1:2 
~~~~~

@subsubsection occt_draw_8_6_14  XSetShape

Syntax:      
~~~~~
XSetShape <document> <label> <shape>
~~~~~

Sets a shape at the indicated label. 

**Example:**
~~~~~
XSetShape D 0:1:1:3 b 
~~~~~

@subsubsection occt_draw_8_6_15  XUpdateAssemblies

Syntax:      
~~~~~
XUpdateAssemblies <document>
~~~~~

Updates all assembly compounds in the XDE document.

**Example:**
~~~~~
XUpdateAssemblies D
~~~~~

@subsection occt_draw_8_7_  XDE color commands 

@subsubsection occt_draw_8_7_1  XAddColor

Syntax:      
~~~~~
XAddColor <document> <R> <G> <B>
~~~~~

Adds color in document to the color table. Parameters R,G,B are real. 

**Example:**
~~~~~
XAddColor D 0.5 0.25 0.25 
~~~~~

@subsubsection occt_draw_8_7_2  XFindColor

Syntax:      
~~~~~
XFindColor <document> <R> <G> <B>
~~~~~

Finds a label where the indicated color is situated. 

**Example:**
~~~~~
XFindColor D 0.25 0.25 0.5 
==> 0:1:2:2 
~~~~~

@subsubsection occt_draw_8_7_3  XGetAllColors

Syntax:      
~~~~~
XGetAllColors <document> 
~~~~~

Prints all colors that are defined in the document. 

**Example:**
~~~~~
XGetAllColors D 
==> RED DARKORANGE BLUE1 GREEN YELLOW3 
~~~~~

@subsubsection occt_draw_8_7_4  XGetColor

Syntax:      
~~~~~
XGetColor <document> <label>
~~~~~

Returns a color defined at the indicated label from the color table. 

**Example:**
~~~~~
XGetColor D 0:1:2:3 
== BLUE1 
~~~~~

@subsubsection occt_draw_8_7_5  XGetObjVisibility

Syntax:      
~~~~~
XGetObjVisibility <document> {<label>|<shape>}
~~~~~

Returns the visibility of a shape. 

**Example:**
~~~~~
XGetObjVisibility D 0:1:1:4 
~~~~~

@subsubsection occt_draw_8_7_6  XGetShapeColor

Syntax:      
~~~~~
XGetShapeColor <document> <label> <colortype(s|c)>
~~~~~

Returns the color defined by label. If <i>colortype</i>=’s’ -- returns surface color, else -- returns curve color. 

**Example:**
~~~~~
XGetShapeColor D 0:1:1:4 c 
~~~~~

@subsubsection occt_draw_8_7_7  XRemoveColor

Syntax:      
~~~~~
XRemoveColor <document> <label>
~~~~~

Removes a color from the color table in a document. 

**Example:**
~~~~~
XRemoveColor D 0:1:2:1 
~~~~~

@subsubsection occt_draw_8_7_8  XSetColor

Syntax:      
~~~~~
XSetColor <document> {<label>|<shape>} <R> <G> <B>
~~~~~

Sets an RGB color to a shape given by label. 

**Example:**
~~~~~
XsetColor D 0:1:1:4 0.5 0.5 0. 
~~~~~

@subsubsection occt_draw_8_7_9  XSetObjVisibility

Syntax:      
~~~~~
XSetObjVisibility <document> {<label>|<shape>} {0|1}
~~~~~

Sets the visibility of a shape. 

**Example:**
~~~~~
# set shape from label 0:1:1:4 as invisible 
XSetObjVisibility D 0:1:1:4 0 
~~~~~

@subsubsection occt_draw_8_7_10  XUnsetColor

Syntax:      
~~~~~
XUnsetColor <document> {<label>|<shape>} <colortype>
~~~~~

Unset a color given type (‘s’ or ‘c’) for the indicated shape. 

**Example:**
~~~~~
XUnsetColor D 0:1:1:4 s 
~~~~~


@subsection occt_draw_8_8_  XDE layer commands 

@subsubsection occt_draw_8_8_1  XAddLayer

Syntax:      
~~~~~
XAddLayer <document> <layer>
~~~~~

Adds a new layer in an XCAF document. 

**Example:**
~~~~~
XAddLayer D layer2 
~~~~~

@subsubsection occt_draw_8_8_2  XFindLayer

Syntax:      
~~~~~
XFindLayer <document> <layer>
~~~~~

Prints a label where a layer is situated. 

**Example:**
~~~~~
XFindLayer D Bolt 
== 0:1:3:2 
~~~~~

@subsubsection occt_draw_8_8_3  XGetAllLayers

Syntax:      
~~~~~
XGetAllLayers <document> 
~~~~~

Prints all layers in an XCAF document. 

**Example:**
~~~~~
XGetAllLayers D 
== *0:1:1:3* *Bolt* *0:1:1:9* 
~~~~~

@subsubsection occt_draw_8_8_4  XGetLayers

Syntax:      
~~~~~
XGetLayers <document> {<shape>|<label>}
~~~~~

Returns names of layers, which are pointed to by links of an indicated shape. 

**Example:**
~~~~~
XGetLayers D 0:1:1:3 
== *bolt* *123* 
~~~~~

@subsubsection occt_draw_8_8_5  XGetOneLayer

Syntax:      
~~~~~
XGetOneLayer <document> <label>
~~~~~

Prints the name of a layer at a given label. 

**Example:**
~~~~~
XGetOneLayer D 0:1:3:2 
~~~~~

@subsubsection occt_draw_8_8_6  XIsVisible

Syntax:      
~~~~~
XIsVisible <document> {<label>|<layer>}
~~~~~

Returns 1 if the indicated layer is visible, else returns 0. 

**Example:**
~~~~~
XIsVisible D 0:1:3:1 
~~~~~

@subsubsection occt_draw_8_8_7  XRemoveAllLayers

Syntax:      
~~~~~
XRemoveAllLayers <document> 
~~~~~

Removes all layers from an XCAF document. 

**Example:**
~~~~~
XRemoveAllLayers D 
~~~~~

@subsubsection occt_draw_8_8_8  XRemoveLayer

Syntax:      
~~~~~
XRemoveLayer <document> {<label>|<layer>}
~~~~~

Removes the indicated layer from an XCAF document. 

**Example:**
~~~~~
XRemoveLayer D layer2 
~~~~~

@subsubsection occt_draw_8_8_9  XSetLayer

Syntax:      
~~~~~
XSetLayer XSetLayer <document> {<shape>|<label>} <layer> [shape_in_one_layer {0|1}]

~~~~~
 
Sets a reference between a shape and a layer (adds a layer if it is necessary). 
Parameter <i>\<shape_in_one_layer\></i> shows whether a shape could be in a number of layers or only in one (0 by default). 

**Example:**
~~~~~
XSetLayer D 0:1:1:2 layer2 
~~~~~

@subsubsection occt_draw_8_8_10  XSetVisibility

Syntax:      
~~~~~
XSetVisibility <document> {<label>|<layer>} <isvisible {0|1}>
~~~~~

Sets the visibility of a layer. 

**Example:**
~~~~~
# set layer at label 0:1:3:2 as invisible 
XSetVisibility D 0:1:3:2 0 
~~~~~

@subsubsection occt_draw_8_8_11  XUnSetAllLayers

Syntax:      
~~~~~
XUnSetAllLayers <document> {<label>|<shape>}
~~~~~

Unsets a shape from all layers. 

**Example:**
~~~~~
XUnSetAllLayers D 0:1:1:2 
~~~~~

@subsubsection occt_draw_8_8_12  XUnSetLayer

Syntax:      
~~~~~
XUnSetLayer <document> {<label>|<shape>} <layer>
~~~~~

Unsets a shape from the indicated layer. 

**Example:**
~~~~~
XUnSetLayer D 0:1:1:2 layer1 
~~~~~

@subsection occt_draw_8_9  XDE property commands 

@subsubsection occt_draw_8_9_1  XCheckProps

Syntax:      
~~~~~
XCheckProps <document> [ {0|deflection} [<shape>|<label>] ]
~~~~~

Gets properties for a given shape (*volume*, *area* and <i>centroid</i>) and compares them with the results after internal calculations. If the second parameter is 0, the standard OCCT tool is used for the computation of properties. If the second parameter is not 0, it is processed as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative -- meshing is forced. 

**Example:**
~~~~~
# check properties for shapes at label 0:1:1:1 from 
# document using standard Open CASCADE Technology tools 
XCheckProps D 0 0:1:1:1 
== Label 0:1:1:1      ;L-BRACKET* 
==  Area defect:        -0.0 (  0%) 
==  Volume defect:       0.0 (  0%) 
==  CG defect: dX=-0.000, dY=0.000, dZ=0.000 
~~~~~

@subsubsection occt_draw_8_9_2  XGetArea

Syntax:      
~~~~~
XGetArea <document> {<shape>|<label>}
~~~~~

Returns the area of a given shape. 

**Example:**
~~~~~
XGetArea D 0:1:1:1 
== 24628.31815094999 
~~~~~

@subsubsection occt_draw_8_9_3  XGetCentroid

Syntax:      
~~~~~
XGetCentroid <document> {<shape>|<label>}
~~~~~

Returns the center of gravity coordinates of a given shape. 

**Example:**
~~~~~
XGetCentroid D 0:1:1:1 
~~~~~

@subsubsection occt_draw_8_9_4  XGetVolume

Syntax:      
~~~~~
XGetVolume <document> {<shape>|<label>}
~~~~~

Returns the volume of a given shape. 

**Example:**
~~~~~
XGetVolume D 0:1:1:1 
~~~~~

@subsubsection occt_draw_8_9_5  XSetArea

Syntax:      
~~~~~
XSetArea <document> {<shape>|<label>} <area>
~~~~~

Sets new area to attribute list ??? given shape. 

**Example:**
~~~~~
XSetArea D 0:1:1:1 2233.99 
~~~~~

@subsubsection occt_draw_8_9_6  XSetCentroid

Syntax:      
~~~~~
XSetCentroid <document> {<shape>|<label>} <x> <y> <z>
~~~~~

Sets new center of gravity  to the attribute list given shape. 

**Example:**
~~~~~
XSetCentroid D 0:1:1:1 0. 0. 100. 
~~~~~

@subsubsection occt_draw_8_9_7  XSetMaterial

Syntax:      
~~~~~
XSetMaterial <document> {<shape>|<label>} <name> <density(g/cu sm)>
~~~~~ 

Adds a new label with material into the material table in a document, and adds a link to this material to the attribute list of a given shape or a given label. The last parameter sets the density of a pointed material. 

**Example:**
~~~~~
XSetMaterial D 0:1:1:1 Titanium 8899.77 
~~~~~

@subsubsection occt_draw_8_9_8  XSetVolume

Syntax:      
~~~~~
XSetVolume <document> {<shape>|<label>} <volume>
~~~~~

Sets new volume to the attribute list ??? given shape. 

**Example:**
~~~~~
XSetVolume D 0:1:1:1 444555.33 
~~~~~

@subsubsection occt_draw_8_9_9  XShapeMassProps

Syntax:      
~~~~~
XShapeMassProps <document> [ <deflection> [{<shape>|<label>}] ]
~~~~~

Computes and returns real mass and real center of gravity for a given shape or for all shapes in a document. The second parameter is used for calculation of the volume and CG(center of gravity). If it is 0, then the standard CASCADE tool (geometry) is used for computation, otherwise -- by triangulations with a given deflection. 

**Example:**
~~~~~
XShapeMassProps D 
== Shape from label : 0:1:1:1 
== Mass = 193.71681469282299 
== CenterOfGravity X = 14.594564763807696,Y = 
    20.20271885211281,Z = 49.999999385313245 
== Shape from label : 0:1:1:2 not have a mass 
etc. 
~~~~~

@subsubsection occt_draw_8_9_10  XShapeVolume

Syntax:      
~~~~~
XShapeVolume <shape> <deflection>
~~~~~

Calculates the real volume of a pointed shape with a given deflection. 

**Example:**
~~~~~
XShapeVolume a 0 
~~~~~

@section occt_draw_9 Shape Healing commands



@subsection occt_draw_9_1 General commands 

@subsubsection occt_draw_9_1_1 bsplres

Syntax:      
~~~~~
bsplres <result> <shape> <tol3d> <tol2d< <reqdegree> <reqnbsegments> <continuity3d> <continuity2d> <PriorDeg> <RationalConvert>
~~~~~

Performs approximations of a given shape (BSpline curves and surfaces or other surfaces) to BSpline with given required parameters. The specified continuity can be reduced if the approximation with a specified continuity was not done successfully. Results are put into the shape, which is given as a parameter result. For a more detailed description see the ShapeHealing User’s Guide (operator: **BSplineRestriction**). 

@subsubsection occt_draw_9_1_2 checkfclass2d

Syntax:      
~~~~~
checkfclass2d <face> <ucoord> <vcoord>
~~~~~

Shows where a point which is given by coordinates is located in relation to a given face -- outbound, inside or at the bounds. 

**Example:**
~~~~~
checkfclass2d f 10.5 1.1 
== Point is OUT 
~~~~~

@subsubsection occt_draw_9_1_3 checkoverlapedges

Syntax:      
~~~~~
checkoverlapedges <edge1> <edge2> [<toler> <domaindist>]
~~~~~

Checks the overlapping of two given edges. If the distance between two edges is less than the given value of tolerance then edges are overlapped. Parameter \<domaindist\> sets length of part of edges on which edges are overlapped. 

**Example:**
~~~~~
checkoverlapedges e1 e2 
~~~~~

@subsubsection occt_draw_9_1_4 comtol

Syntax:      
~~~~~
comptol <shape> [nbpoints] [prefix]
~~~~~

Compares the real value of tolerance on curves with the value calculated by standard (using 23 points). The maximal value of deviation of 3d curve from pcurve at given simple points is taken as a real value (371 is by default). Command returns the maximal, minimal and average value of tolerance for all edges and difference between real values and set values. Edges with the maximal value of tolerance and relation will be saved if the ‘prefix’ parameter is given. 

**Example:** 
~~~~~    
comptol h 871 t 

==> Edges tolerance computed by 871 points: 
==> MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009 MIN=0 
==> Relation real tolerance / tolerance set in edge 
==> MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0 
==> Edge with max tolerance saved to t_edge_tol 
==> Concerned faces saved to shapes t_1, t_2 
~~~~~

@subsubsection occt_draw_9_1_5 convtorevol

Syntax:      
~~~~~
convtorevol <result> <shape>
~~~~~

Converts all elementary surfaces of a given shape into surfaces of revolution. 
Results are put into the shape, which is given as the <i>\<result\></i> parameter. 

**Example:**
~~~~~
convtorevol r a 
~~~~~

@subsubsection occt_draw_9_1_6 directfaces

Syntax:      
~~~~~
directfaces <result> <shape>
~~~~~

Converts indirect surfaces and returns the results into the shape, which is given as the result parameter. 

**Example:**
~~~~~
directfaces r a 
~~~~~

@subsubsection occt_draw_9_1_7 expshape

Syntax:   
~~~~~
expshape <shape> <maxdegree> <maxseg>
~~~~~

Gives statistics for a given shape. This test command is working with Bezier and BSpline entities. 

**Example:**
~~~~~
expshape a 10 10 
==> Number of Rational Bspline curves 128 
==> Number of Rational Bspline pcurves 48 
~~~~~

@subsubsection occt_draw_9_1_8 fixsmall

Syntax:      
~~~~~
fixsmall <result> <shape> [<toler>=1.]
~~~~~

Fixes small edges in given shape by merging adjacent edges with agiven tolerance. Results are put into the shape, which is given as the result parameter. 

**Example:**
~~~~~
fixsmall r a 0.1 
~~~~~

@subsubsection occt_draw_9_1_9 fixsmalledges

Syntax:      
~~~~~
fixsmalledges <result> <shape> [<toler> <mode> <maxangle>]
~~~~~

Searches at least one small edge at a given shape. If such edges have been found, then small edges are merged with a given tolerance. If parameter <i>\<mode\></i> is equal to *Standard_True* (can be given any values, except 2), then  small edges, which can not be merged, are removed, otherwise they are to be kept (*Standard_False* is used by default). Parameter <i>\<maxangle\></i> sets a maximum possible angle for merging two adjacent edges, by default no limit angle is applied (-1). Results are put into the shape, which is given as parameter result. 

**Example:**
~~~~~
fixsmalledges r a 0.1 1 
~~~~~

@subsubsection occt_draw_9_1_10 fixshape

Syntax:      
~~~~~
fixshape <result> <shape> [<preci> [<maxpreci>]] [{switches}]
~~~~~

Performs fixes of all sub-shapes (such as *Solids*, *Shells*, *Faces*, *Wires* and *Edges*) of a given shape. Parameter <i>\<preci\></i> sets a basic precision value, <i>\<maxpreci\></i> sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result. <b>{switches}</b> allows to tune parameters of ShapeFix 

The following syntax is used: 
* <i>\<symbol\></i> may be
  * "-" to set parameter off, 
  * "+" to set on or  
  * "*" to set default 
* <i>\<parameter\></i> is identified by  letters: 
  * l -- FixLackingMode 
  * o -- FixOrientationMode 
  * h -- FixShiftedMode 
  * m -- FixMissingSeamMode 
  * d -- FixDegeneratedMode 
  * s -- FixSmallMode 
  * i -- FixSelfIntersectionMode 
  * n -- FixNotchedEdgesMode 
For enhanced message output, use switch '+?' 

**Example:**
~~~~~
fixshape r a 0.001 
~~~~~

@subsubsection occt_draw_9_1_11 fixwgaps

Syntax:      
~~~~~
fixwgaps <result> <shape> [<toler>=0]
~~~~~

Fixes gaps between ends of curves of adjacent edges (both 3d and pcurves) in wires in a given shape with a given tolerance. Results are put into the shape, which is given as parameter result. 

**Example:**
~~~~~
fixwgaps r a 
~~~~~

@subsubsection occt_draw_9_1_12 offsetcurve, offset2dcurve

Syntax:      
~~~~~
offsetcurve <result> <curve> <offset> <direction(as point)>
offset2dcurve <result> <curve> <offset>
~~~~~

**offsetcurve** works with the curve in 3d space, **offset2dcurve** in 2d space. 

Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter <i>\<offset\></i>. Parameter <i>\<direction\></i> defines direction of the offset curve. It is created as a point. For correct work of these commands the direction of normal of the offset curve must be perpendicular to the plane, the basis curve is located there. Results are put into the curve, which is given as parameter <i>\<result\></i>.  

**Example:**
~~~~~
point pp 10 10 10 
offsetcurve r c 20 pp 
~~~~~

@subsubsection occt_draw_9_1_13 projcurve

Syntax:      
~~~~~
projcurve <edge>|<curve3d>|<curve3d first last>  <X> <Y> <Z>
~~~~~

**projcurve** returns the projection of a given point on a given curve. The curve may be defined by three ways: by giving the edge name, giving the 3D curve and by giving the unlimited curve and limiting it by pointing its start and finish values. 

**Example:** 
~~~~~    
projcurve k_1 0 1 5 
==Edge k_1 Params from 0 to 1.3 
==Precision (BRepBuilderAPI) : 9.9999999999999995e-008  ==Projection : 0  1  5 
==Result : 0  1.1000000000000001  0 
==Param = -0.20000000000000001  Gap = 5.0009999000199947 
~~~~~

@subsubsection occt_draw_9_1_14 projpcurve

Syntax:      
~~~~~
projpcurve <edge> <face>  <Tol> <X> <Y> <Z> [<start_param>]
~~~~~

**projpcurve** returns the projection of a given point on a given curve on surface. The curve on surface is defined by giving the edge and face names. Edge must have curve 2D repesentation on the face. Optional parameter <i>\<start_param\></i> is any parameter of pcurve, which is used by algoritm as start point for searching projection of given point with help of local Extrema algorithm. If this parameter is not set, algorithm uses whole parametric interval of pcurve for searching projection.   

**Example:** 

~~~~~ 
# Using global searching   
projpcurve f_1 f 1.e-7 0.877 0 0.479
==Point: 0.87762772831890712 0 0.47934285275342808
==Param: 0.49990578239977856
==Dist: 0.0007152557954264938
~~~~~

~~~~~
# Using starting parameter on edge
projpcurve f_1 f 1.e-7 0.877 0 0.479 .6
==Point: 0.87762772831890712 0 0.47934285275342808
==Param: 0.49990578239977856
==Dist: 0.0007152557954264938
~~~~~

@subsubsection occt_draw_9_1_15 projface

Syntax:      
~~~~~
projface <face> <X> <Y> [<Z>]
~~~~~

Returns the projection of a given point to a given face in 2d or 3d space. If two coordinates (2d space) are given then returns coordinates projection of this point in 3d space and vice versa. 

**Example:**
~~~~~
projface a_1 10.0 0.0 
==  Point UV  U = 10  V = 0 
==   =   proj  X = -116  Y = -45  Z = 0 
~~~~~

@subsubsection occt_draw_9_1_16 scaleshape

Syntax:   
~~~~~
scaleshape <result> <shape> <scale>
~~~~~

Returns a new shape, which is the result of scaling of a given shape with a coefficient equal to the parameter <i>\<scale\></i>. Tolerance is calculated for the  new shape as well.

**Example:**
~~~~~
scaleshape r a_1 0.8 
~~~~~

@subsubsection occt_draw_9_1_17 settolerance

Syntax:      
~~~~~
settolerance <shape> [<mode>=v-e-w-f-a] <val>(fix value) or
                   <tolmin> <tolmax>
~~~~~ 

Sets new values of tolerance for a given shape. If the second parameter <i>mode</i> is given, then the tolerance value is set only for these sub shapes. 

**Example:**
~~~~~
settolerance a 0.001 
~~~~~

@subsubsection occt_draw_9_1_18 splitface

Syntax:      
~~~~~
splitface <result> <face> [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
~~~~~

Splits a given face in parametric space and puts the result into the given parameter <i>\<result\></i>. 
Returns the status of split face. 

**Example:**
~~~~~
# split face f by parameter u = 5 
splitface r f u 5 
==> Splitting by   U:   ,5 
==> Status:  DONE1 
~~~~~

@subsubsection occt_draw_9_1_19 statshape

Syntax:      
~~~~~
statshape <shape> [particul]
~~~~~

Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc.  It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0 
surfaces. The last parameter becomes out of date. 

**Example:**
~~~~~
statshape a 
==> Count     Item 
==> -----     ---- 
==> 402     Edge (oriented) 
==> 402     Edge (Shared) 
==> 74      Face 
==> 74      Face (Free) 
==> 804     Vertex (Oriented) 
==> 402     Vertex (Shared) 
==> 78      Wire 
==> 4      Face with more than one wire 
==> 34     bspsur: BSplineSurface 
~~~~~

@subsubsection occt_draw_9_1_20 tolerance

Syntax:
~~~~~
tolerance <shape> [<mode>:D v e f c] [<tolmin> <tolmax>:real]
~~~~~

Returns tolerance (maximal, avg and minimal values)  of all given shapes and tolerance of their *Faces*, *Edges* and *Vertices*. If parameter <i>\<tolmin\></i> or <i>\<tolmax\></i> or both of them are given, then sub-shapes are returned as a result of analys of this shape, which satisfy the given tolerances. If a particular value of entity ((**D**)all shapes  (**v**) *vertices* (**e**) *edges* (**f**) *faces* (**c**) *combined* (*faces*)) is given as the second parameter then only this group will be analyzed for tolerance. 

**Example:**
~~~~~
tolerance a 
==> Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08 
==> FACE    : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08 
==> EDGE    : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08 
==> VERTEX  : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08 

tolerance a v 0.1 0.001 
==>  Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6 
~~~~~


@subsection occt_draw_9_2 Conversion commands 

@subsubsection occt_draw_9_2_1 DT_ClosedSplit

Syntax:      
~~~~~
DT_ClosedSplit <result> <shape>
~~~~~

Divides all closed faces in the shape (for example cone) and returns result of given shape into shape, which is given as parameter result. Number of faces in resulting shapes will be increased. 
Note: A closed face is a face with one or more seam. 

**Example:**
~~~~~
DT_ClosetSplit r a 
~~~~~

@subsubsection occt_draw_9_2_2 DT_ShapeConvert, DT_ShapeConvertRev

Syntax:      
~~~~~
DT_ShapeConvert <result> <shape> <convert2d> <convert3d>
DT_ShapeConvertRev <result> <shape> <convert2d> <convert3d>
~~~~~
 
Both commands are intended for the conversion of 3D, 2D curves to Bezier curves and surfaces to Bezier based surfaces. Parameters convert2d and convert3d take on a value 0 or 1. If the given value is 1, then the conversion will be performed, otherwise it will not be performed. The results are put into the shape, which is given as parameter Result. Command *DT_ShapeConvertRev* differs from *DT_ShapeConvert* by converting all elementary surfaces into surfaces of revolution first. 

**Example:**
~~~~~
DT_ShapeConvert r a 1 1 
== Status: DONE1 
~~~~~

@subsubsection occt_draw_9_2_3 DT_ShapeDivide

Syntax:      
~~~~~
DT_ShapeDivide <result> <shape> <tol>
~~~~~

Divides the shape with C1 criterion and returns the result of geometry conversion of a given shape into the shape, which is given as parameter result. This command illustrates how class *ShapeUpgrade_ShapeDivideContinuity* works. This class allows to convert geometry with a continuity less than the specified continuity to geometry with target continuity. If conversion is not possible then the geometrical object is split into several ones, which satisfy the given tolerance. It also returns the  status shape splitting: 
 * OK      : no splitting was done 
 * Done1 : Some edges were split 
 * Done2 : Surface was split 
 * Fail1    : Some errors occurred 

**Example:**
~~~~~
DT_ShapeDivide r a 0.001 
== Status: OK 
~~~~~

@subsubsection occt_draw_9_2_4 DT_SplitAngle

Syntax:      
~~~~~
DT_SplitAngle <result> <shape> [MaxAngle=95]
~~~~~

Works with all revolved surfaces, like cylinders, surfaces of revolution, etc. This command divides given revolved surfaces into segments so that each resulting segment covers not more than the given *MaxAngle* degrees and puts the result of splitting into the shape, which is given as parameter result. Values of returned status are given above. 
This command illustrates how class *ShapeUpgrade_ShapeDivideAngle* works. 

**Example:**
~~~~~
DT_SplitAngle r a 
== Status: DONE2 
~~~~~

@subsubsection occt_draw_9_2_5 DT_SplitCurve

Syntax:      
~~~~~
DT_SplitCurve <curve> <tol> <split(0|1)>
~~~~~

Divides the 3d curve with C1 criterion and returns the result of splitting of the given curve into a new curve. If the curve had been divided by segments, then each segment is put to an individual result.  This command can correct a given curve at a knot with the given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added at the given curve, and its surface is split by segments, but this will be performed not for all parametric spaces. 

**Example:**
~~~~~
DT_SplitCurve r c 
~~~~~

@subsubsection occt_draw_9_2_6 DT_SplitCurve2d

Syntax:      
~~~~~
DT_SplitCurve2d Curve Tol Split(0/1) 
~~~~~

Works just as **DT_SplitCurve** (see above), only with 2d curve. 

**Example:**
~~~~~
DT_SplitCurve2d r c 
~~~~~

@subsubsection occt_draw_9_2_7 DT_SplitSurface

Syntax:      
~~~~~
DT_SplitSurface <result> <Surface|GridSurf> <tol> <split(0|1)>
~~~~~

Divides surface with C1 criterion and returns the result of splitting of a given surface into surface, which is given as parameter result. If the surface has been divided into segments, then each segment is put to an individual result.  This command can correct a given C0 surface at a knot with a given tolerance, if it is impossible, then the given surface is split at that knot. If the last parameter is 1, then 5 knots are added to the given surface, and its surface is split by segments, but this will be performed not for all parametric spaces. 

**Example:** 
~~~~~
# split surface with name "su"
DT_SplitSurface res su 0.1 1 
==> single surf 
==> appel a SplitSurface::Init 
==> appel a SplitSurface::Build 
==> appel a SplitSurface::GlobalU/VKnots 
==> nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1 
==> appel a Surfaces 
==> transfert resultat 
==> res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1 
~~~~~

@subsubsection occt_draw_9_2_8 DT_ToBspl

Syntax:
~~~~~
DT_ToBspl <result> <shape>
~~~~~

Converts a surface of linear extrusion, revolution and offset surfaces into BSpline surfaces. Returns the result into the shape, which is given as parameter result. 

**Example:** 
~~~~~    
DT_ToBspl res sh 
== error = 5.20375663162094e-08   spans = 10 
==  Surface is aproximated with continuity 2 
~~~~~

@section occt_draw_10 Performance evaluation commands


@subsection occt_draw_10_1 VDrawSphere

Syntax:      
~~~~~
vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0] 
~~~~~

Calculates and displays in a given number of steps a sphere with given coordinates, radius and fineness. Returns the information about the properties of the sphere, the time and the amount of memory required to build it. 

This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter. 

**Example:** 
~~~~~
vdrawsphere s 200 1 1 1 500 1 
== Compute Triangulation... 
== NumberOfPoints: 39602 
== NumberOfTriangles: 79200 
== Amount of memory required for PolyTriangulation without Normals: 2 Mb 
== Amount of memory for colors: 0 Mb 
== Amount of memory for PolyConnect: 1 Mb 
== Amount of graphic card memory required: 2 Mb 
== Number of scene redrawings: 1 
== CPU user time: 15.6000999999998950 msec 
== CPU system time: 0.0000000000000000 msec 
== CPU average time of scene redrawing: 15.6000999999998950 msec 
~~~~~


@section occt_draw_12 Simple vector algebra and measurements

This section contains description of auxiliary commands that can be useful for simple calculations and manipulations needed when analyzing complex models.

@subsection occt_draw_12_1 Vector algebra commands

This section describes commands providing simple calculations with 2D and 3D vectors. The vector is represented by a TCL list of double values (coordinates). The commands get input vector coordinates from the command line as distinct values. So, if you have a vector stored in a variable you need to use *eval* command as a prefix, for example, to compute the magnitude of cross products of two vectors given by 3 points the following commands can be used:
~~~~~{.cpp}
Draw[10]> set vec1 [vec 12 28 99 12 58 99]
0 30 0
Draw[13]> set vec2 [vec 12 28 99 16 21 89]
4 -7 -10
Draw[14]> set cross [eval cross $vec1 $vec2]
-300 0 -120
Draw[15]> eval module $cross
323.10988842807024
~~~~~

@subsubsection occt_draw_12_1_1 vec

Syntax:
~~~~~
vec <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~ 

Returns coordinates of vector between two 3D points.

Example:
~~~~~{.cpp}
vec 1 2 3 6 5 4
~~~~~

@subsubsection occt_draw_12_1_2 2dvec

Syntax:
~~~~~
2dvec <x1> <y1> <x2> <y2>
~~~~~ 

Returns coordinates of vector between two 2D points.

Example: 
~~~~~{.cpp}
2dvec 1 2 4 3
~~~~~

@subsubsection occt_draw_12_1_3 pln

Syntax:
~~~~~
pln <x1> <y1> <z1> <x2> <y2> <z2> <x3> <y3> <z3>
~~~~~ 

Returns plane built on three points. A plane is represented by 6 double values: coordinates of the origin point and the normal directoin.

Example: 
~~~~~{.cpp}
pln 1 2 3 6 5 4 9 8 7
~~~~~

@subsubsection occt_draw_12_1_4 module

Syntax:
~~~~~
module <x> <y> <z>
~~~~~ 

Returns module of a vector.

Example: 
~~~~~{.cpp}
module 1 2 3
~~~~~

@subsubsection occt_draw_12_1_5 2dmodule

Syntax:
~~~~~
2dmodule <x> <y>
~~~~~ 

Returns module of a 2D vector.

Example: 
~~~~~{.cpp}
2dmodule 1 2
~~~~~

@subsubsection occt_draw_12_1_6 norm

Syntax:
~~~~~
norm <x> <y> <z>
~~~~~ 

Returns unified vector from a given 3D vector.

Example: 
~~~~~{.cpp}
norm 1 2 3
~~~~~

@subsubsection occt_draw_12_1_7 2dnorm

Syntax:
~~~~~
2dnorm <x> <y>
~~~~~ 

Returns unified vector from a given 2D vector.

Example: 
~~~~~{.cpp}
2dnorm 1 2
~~~~~

@subsubsection occt_draw_12_1_8 inverse

Syntax:
~~~~~
inverse <x> <y> <z>
~~~~~ 

Returns inversed 3D vector.

Example: 
~~~~~{.cpp}
inverse 1 2 3
~~~~~

@subsubsection occt_draw_12_1_9 2dinverse

Syntax:
~~~~~
2dinverse <x> <y>
~~~~~ 

Returns inversed 2D vector.

Example: 
~~~~~{.cpp}
2dinverse 1 2
~~~~~

@subsubsection occt_draw_12_1_10 2dort

Syntax:
~~~~~
2dort <x> <y>
~~~~~ 

Returns 2D vector rotated on 90 degrees.

Example: 
~~~~~{.cpp}
2dort 1 2
~~~~~

@subsubsection occt_draw_12_1_11 distpp

Syntax:
~~~~~
distpp <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~ 

Returns distance between two 3D points.

Example: 
~~~~~{.cpp}
distpp 1 2 3 4 5 6
~~~~~

@subsubsection occt_draw_12_1_12 2ddistpp

Syntax:
~~~~~
2ddistpp <x1> <y1> <x2> <y2>
~~~~~ 

Returns distance between two 2D points.

Example: 
~~~~~{.cpp}
2ddistpp 1 2 3 4
~~~~~

@subsubsection occt_draw_12_1_13 distplp

Syntax:
~~~~~
distplp <x0> <y0> <z0> <nx> <ny> <nz> <xp> <yp> <zp>
~~~~~ 

Returns distance between plane defined by point and normal direction and another point.

Example: 
~~~~~{.cpp}
distplp 0 0 0 0 0 1 5 6 7
~~~~~

@subsubsection occt_draw_12_1_14 distlp

Syntax:
~~~~~
distlp <x0> <y0> <z0> <dx> <dy> <dz> <xp> <yp> <zp>
~~~~~ 

Returns distance between 3D line defined by point and direction and another point.

Example: 
~~~~~{.cpp}
distlp 0 0 0 1 0 0 5 6 7
~~~~~

@subsubsection occt_draw_12_1_15 2ddistlp

Syntax:
~~~~~
2ddistlp <x0> <y0> <dx> <dy> <xp> <yp>
~~~~~ 

Returns distance between 2D line defined by point and direction and another point.

Example: 
~~~~~{.cpp}
2ddistlp 0 0 1 0 5 6
~~~~~

@subsubsection occt_draw_12_1_16 distppp

Syntax:
~~~~~
distppp <x1> <y1> <z1> <x2> <y2> <z2> <x3> <y3> <z3>
~~~~~ 

Returns deviation of point (x2,y2,z2) from segment defined by points (x1,y1,z1) and (x3,y3,z3).

Example: 
~~~~~{.cpp}
distppp 0 0 0 1 1 0 2 0 0
~~~~~

@subsubsection occt_draw_12_1_17 2ddistppp

Syntax:
~~~~~
2ddistppp <x1> <y1> <x2> <y2> <x3> <y3>
~~~~~ 

Returns deviation of point (x2,y2) from segment defined by points (x1,y1) and (x3,y3). The result is a signed value. It is positive if the point (x2,y2) is on the left side of the segment, and negative otherwise.

Example: 
~~~~~{.cpp}
2ddistppp 0 0 1 -1 2 0
~~~~~

@subsubsection occt_draw_12_1_18 barycen

Syntax:
~~~~~
barycen <x1> <y1> <z1> <x2> <y2> <z2> <par>
~~~~~ 

Returns point of a given parameter between two 3D points.

Example: 
~~~~~{.cpp}
barycen 0 0 0 1 1 1 0.3
~~~~~

@subsubsection occt_draw_12_1_19 2dbarycen

Syntax:
~~~~~
2dbarycen <x1> <y1> <x2> <y2> <par>
~~~~~ 

Returns point of a given parameter between two 2D points.

Example: 
~~~~~{.cpp}
2dbarycen 0 0 1 1 0.3
~~~~~

@subsubsection occt_draw_12_1_20 cross

Syntax:
~~~~~
cross <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~ 

Returns cross product of two 3D vectors.

Example: 
~~~~~{.cpp}
cross 1 0 0 0 1 0
~~~~~

@subsubsection occt_draw_12_1_21 2dcross

Syntax:
~~~~~
2dcross <x1> <y1> <x2> <y2>
~~~~~ 

Returns cross product of two 2D vectors.

Example: 
~~~~~{.cpp}
2dcross 1 0 0 1
~~~~~

@subsubsection occt_draw_12_1_22 dot

Syntax:
~~~~~
dot <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~ 

Returns scalar product of two 3D vectors.

Example: 
~~~~~{.cpp}
dot 1 0 0 0 1 0
~~~~~

@subsubsection occt_draw_12_1_23 2ddot

Syntax:
~~~~~
2ddot <x1> <y1> <x2> <y2>
~~~~~ 

Returns scalar product of two 2D vectors.

Example: 
~~~~~{.cpp}
2ddot 1 0 0 1
~~~~~

@subsubsection occt_draw_12_1_24 scale

Syntax:
~~~~~
scale <x> <y> <z> <factor>
~~~~~ 

Returns 3D vector multiplied by scalar.

Example: 
~~~~~{.cpp}
scale 1 0 0 5
~~~~~

@subsubsection occt_draw_12_1_25 2dscale

Syntax:
~~~~~
2dscale <x> <y> <factor>
~~~~~ 

Returns 2D vector multiplied by scalar.

Example: 
~~~~~{.cpp}
2dscale 1 0 5
~~~~~

@subsection occt_draw_12_2 Measurements commands

This section describes commands that make possible to provide measurements on a model.

@subsubsection occt_draw_12_2_1 pnt

Syntax:
~~~~~
pnt <object>
~~~~~ 

Returns coordinates of point in the given Draw variable. Object can be of type point or vertex. Actually this command is built up from the commands @ref occt_draw_7_2_1a "mkpoint" and @ref occt_draw_6_6_1 "coord".

Example: 
~~~~~{.cpp}
vertex v 0 1 0
pnt v
~~~~~

@subsubsection occt_draw_12_2_2 pntc

Syntax:
~~~~~
pntc <curv> <par>
~~~~~ 

Returns coordinates of point on 3D curve with given parameter. Actually this command is based on the command @ref occt_draw_6_6_2 "cvalue".

Example: 
~~~~~{.cpp}
circle c 0 0 0 10
pntc c [dval pi/2]
~~~~~

@subsubsection occt_draw_12_2_3 2dpntc

Syntax:
~~~~~
2dpntc <curv2d> <par>
~~~~~ 

Returns coordinates of point on 2D curve with given parameter. Actually this command is based on the command @ref occt_draw_6_6_2 "2dcvalue".

Example: 
~~~~~{.cpp}
circle c 0 0 10
2dpntc c [dval pi/2]
~~~~~

@subsubsection occt_draw_12_2_4 pntsu

Syntax:
~~~~~
pntsu <surf> <u> <v>
~~~~~ 

Returns coordinates of point on surface with given parameters. Actually this command is based on the command @ref occt_draw_6_6_3 "svalue".

Example: 
~~~~~{.cpp}
cylinder s 10
pntsu s [dval pi/2] 5
~~~~~

@subsubsection occt_draw_12_2_5 pntcons

Syntax:
~~~~~
pntcons <curv2d> <surf> <par>
~~~~~ 

Returns coordinates of point on surface defined by point on 2D curve with given parameter. Actually this command is based on the commands @ref occt_draw_6_6_2 "2dcvalue" and @ref occt_draw_6_6_3 "svalue".

Example: 
~~~~~{.cpp}
line c 0 0 1 0
cylinder s 10
pntcons c s [dval pi/2]
~~~~~

@subsubsection occt_draw_12_2_6 drseg

Syntax:
~~~~~
drseg <name> <x1> <y1> <z1> <x2> <y2> <z2>
~~~~~ 

Creates a linear segment between two 3D points. The new object is given the *name*. The object is drawn in the axonometric view.

Example: 
~~~~~{.cpp}
drseg s 0 0 0 1 0 0
~~~~~

@subsubsection occt_draw_12_2_7 2ddrseg

Syntax:
~~~~~
2ddrseg <name> <x1> <y1> <x2> <y2>
~~~~~ 

Creates a linear segment between two 2D points. The new object is given the *name*. The object is drawn in the 2D view.

Example: 
~~~~~{.cpp}
2ddrseg s 0 0 1 0
~~~~~

@subsubsection occt_draw_12_2_8 mpick

Syntax:
~~~~~
mpick
~~~~~ 

Prints in the console the coordinates of a point clicked by mouse in a view (axonometric or 2D). This command will wait for mouse click event in a view.

Example: 
~~~~~{.cpp}
mpick
~~~~~

@subsubsection occt_draw_12_2_9 mdist

Syntax:
~~~~~
mdist
~~~~~ 

Prints in the console the distance between two points clicked by mouse in a view (axonometric or 2D). This command will wait for two mouse click events in a view.

Example: 
~~~~~{.cpp}
mdist
~~~~~

@section occt_draw_13 Inspector commands


This section describes commands that make possible to use Inspector.

@subsection occt_draw_13_1 tinspector

Syntax:                  
~~~~~
tinspector [-plugins {name1 ... [nameN] | all}]
           [-activate name]
           [-shape object [name1] ... [nameN]]
           [-open file_name [name1] ... [nameN]]
           [-update]
           [-select {object | name1 ... [nameN]}]
           [-show {0|1} = 1]
~~~~~
Starts inspection tool.
Options:
* *plugins* enters plugins that should be added in the inspector.
Available names are: *dfbrowser*, *vinspector* and *shapeview*.
Plugins order will be the same as defined in the arguments.
'all' adds all available plugins in the order:
DFBrowser, VInspector and ShapeView.
If at the first call this option is not used, 'all' option is applied;
* *activate* activates the plugin in the tool view.
If at the first call this option is not used, the first plugin is activated;
* *shape* initializes plugin(s) by the shape object. If 'name' is empty, initializes all plugins;
* *open* gives the file to the plugin(s). If the plugin is active after open, the content will be updated;
* *update* updates content of the active plugin;
* *select* sets the parameter that should be selected in an active tool view.
Depending on the active tool the parameter is:
ShapeView: 'object' is an instance of *TopoDS_Shape TShape*,
DFBrowser: 'name' is an entry of *TDF_Label* and 'name2' (optionally) for *TDF_Attribute* type name,
VInspector: 'object' is an instance of *AIS_InteractiveObject*;
* *show* sets Inspector view visible or hidden. The first call of this command will show it.

**Example:** 
~~~~~
pload DCAF INSPECTOR

NewDocument Doc BinOcaf

set aSetAttr1 100
set aLabel 0:2
SetInteger Doc ${aLabel} ${aSetAttr1}

tinspector -plugins dfbrowser -select 0:2 TDataStd_Integer
~~~~~ 

**Example:** 
~~~~~
pload ALL INSPECTOR

box b1 200 100 120
box b2 100 200 220 100 120 100

tinspector -plugins shapeview -shape b1 -shape b2 -select b1
~~~~~ 

**Example:** 
~~~~~
pload ALL INSPECTOR

tinspector -plugins vinspector

vinit
box box_1 100 100 100
vdisplay box_1

box box_2 180 120 200 150 150 150
vdisplay box_2

vfit
vselmode box_1 1 1
vselmode box_1 3 1

tinspector -update -select box_1
~~~~~ 


@section occt_draw_11 Extending Test Harness with custom commands


The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism. 


@subsection occt_draw_11_1 Custom command implementation

Custom command implementation has not undergone any changes since the introduction of the plug-in mechanism. The syntax of every command should still be like in the following example. 

**Example:** 
~~~~~
static Standard_Integer myadvcurve(Draw_Interpretor& di, Standard_Integer n, char** a) 
{ 
... 
} 
~~~~~

For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx). 


@subsection occt_draw_11_2 Registration of commands in Test Harness

To become available in the Test Harness the custom command must be registered in it. This should be done as follows. 

**Example:** 
~~~~~
void MyPack::CurveCommands(Draw_Interpretor& theCommands) 
{ 
... 
char* g = "Advanced curves creation"; 

theCommands.Add ( "myadvcurve", "myadvcurve name p1 p2 p3 - Creates my advanced curve from points", 
                  __FILE__, myadvcurve, g ); 
... 
} 
~~~~~

@subsection occt_draw_11_3 Creating a toolkit (library) as a plug-in

All custom commands are compiled and linked into a dynamic library (.dll on Windows, or .so on Unix/Linux). To make Test Harness recognize it as a plug-in it must respect certain conventions. Namely, it must export function *PLUGINFACTORY()* accepting the Test Harness interpreter object (*Draw_Interpretor*). This function will be called when the library is dynamically loaded during the Test Harness session. 

This exported function *PLUGINFACTORY()* must be implemented only once per library. 

For convenience the *DPLUGIN* macro (defined in the *Draw_PluginMacro.hxx* file) has been provided. It implements the *PLUGINFACTORY()* function as a call to the *Package::Factory()* method and accepts *Package* as an argument. Respectively, this *Package::Factory()* method must be implemented in the library and activate all implemented commands. 

**Example:** 
~~~~~
#include <Draw_PluginMacro.hxx>

void MyPack::Factory(Draw_Interpretor& theDI)
{
...
// 
MyPack::CurveCommands(theDI);
...
}

// Declare entry point PLUGINFACTORY
DPLUGIN(MyPack)
~~~~~

@subsection occt_draw_11_4 Creation of the plug-in resource file

As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see *Resource_Manager.hxx* file for details). In particular, it should contain keys separated from their values by a colon (;:;). 
For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name. 
Thus, the resource file must contain a line mapping this name (key) to the library name. The latter should be without file extension (.dll on Windows, .so on Unix/Linux) and without the ;lib; prefix on Unix/Linux. 
For several plug-ins one resource file can be created. In such case, keys denoting plug-ins can be combined into groups, these groups -- into their groups and so on (thereby creating some hierarchy). Any new parent key must have its value as a sequence of child keys separated by spaces, tabs or commas. Keys should form a tree without cyclic dependencies. 

**Examples** (file MyDrawPlugin): 
~~~~~
! Hierarchy of plug-ins 
ALL                : ADVMODELING, MESHING 
DEFAULT            : MESHING 
ADVMODELING        : ADVSURF, ADVCURV 

! Mapping from naming to toolkits (libraries) 
ADVSURF            : TKMyAdvSurf 
ADVCURV            : TKMyAdvCurv 
MESHING            : TKMyMesh 
~~~~~

For other examples of the plug-in resource file refer to the @ref occt_draw_1_3_2 "Plug-in resource file" chapter above or to the <i>$CASROOT/src/DrawPlugin</i> file shipped with Open CASCADE Technology. 


@subsection occt_draw_11_5 Dynamic loading and activation

Loading a plug-in and activating its commands is described in the @ref occt_draw_1_3_3 "Activation of the commands implemented in the plug-in" chapter. 

The procedure consists in defining the system variables and using the *pload* commands in the Test Harness session. 

**Example:** 
~~~~
Draw[]> set env(CSF_MyDrawPluginDefaults) /users/test
Draw[]> pload -MyDrawPlugin ALL
~~~~