0025674: Debug dev guide: misprint in Saving and dumping shapes and geometric objects...
[occt.git] / dox / user_guides / draw_test_harness / draw_test_harness.md
1 Draw Test Harness  {#occt_user_guides__test_harness}
2 ===============================
3
4 @tableofcontents
5  
6 @section occt_draw_1 Introduction
7
8 This manual explains how to use Draw, the test harness for Open CASCADE Technology (**OCCT**).
9 Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries. 
10
11 @subsection occt_draw_1_1 Overview
12
13 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. 
14
15 Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes. 
16
17 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. 
18
19 Draw consists of: 
20
21   * A command interpreter based on the TCL command language.
22   * A 3d graphic viewer based on the X system.
23   * A basic set of commands covering scripts, variables and graphics.
24   * 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.
25   * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
26
27
28 There is also a set of commands for each delivery unit in the modeling libraries: 
29
30   * GEOMETRY, 
31   * TOPOLOGY, 
32   * ADVALGOS, 
33   * GRAPHIC, 
34   * PRESENTATION. 
35
36
37 @subsection occt_draw_1_2 Contents of this documentation
38
39 This documentation describes: 
40
41   * The command language.
42   * The basic set of commands.
43   * The graphical commands.
44   * The Geometry set of commands.
45   * The Topology set of commands.
46
47 This document does not describe other sets of commands and does not explain how to extend Draw using C++. 
48
49 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. 
50
51 ~~~~~
52 exit
53 ~~~~~
54
55 Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file. 
56
57 **Example:** 
58
59 ~~~~~
60 # this is a very short example 
61 exit 
62 ~~~~~
63
64
65 @subsection occt_draw_1_3 Getting started
66
67 Install Draw and launch Emacs. Get a command line in Emacs using *Esc x* and key in *woksh*. 
68
69 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. 
70
71 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. 
72
73 @subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
74
75 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 set-up (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).  
76
77
78 @subsubsection occt_draw_1_3_2 Plug-in resource file
79
80 Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory. 
81
82 The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.cdl* file for details). 
83
84 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. 
85
86 **Example:** (excerpt from DrawPlugin): 
87 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
88 OCAF               : VISUALIZATION, OCAFKERNEL 
89 VISUALIZATION      : AISV 
90 OCAFKERNEL         : DCAF 
91
92 DCAF               : TKDCAF 
93 AISV               : TKViewerTest 
94 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95
96 @subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
97
98 To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness: 
99
100 ~~~~~
101 pload [-PluginFileName] [[Key1] [Key2]...]
102 ~~~~~
103
104 where: 
105
106 * <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. 
107 * *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). 
108
109 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. 
110
111 ~~~~~
112 Draw[]        pload -DrawPlugin OCAF 
113 ~~~~~
114 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. 
115
116 ~~~~~
117 Draw[]        pload (equivalent to pload -DrawPlugin DEFAULT). 
118 ~~~~~
119 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. 
120
121
122 @section occt_draw_2 The Command Language
123
124 @subsection occt_draw_2_1 Overview
125
126 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. 
127
128 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: 
129
130   * Syntax of the TCL language.
131   * Accessing variables in TCL and Draw.
132   * Control structures.
133   * Procedures.
134
135 @subsection occt_draw_2_2 Syntax of TCL
136
137 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. 
138
139 The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons. 
140
141 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
142 set a 24 
143 set b 15 
144 set a 25; set b 15 
145 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146
147 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. 
148
149 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. 
150
151 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. 
152
153 The following substitutions are performed by TCL: 
154
155 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. 
156
157 **Example:** 
158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
159 # set a variable value 
160 set file documentation 
161 puts $file #to display file contents on the screen 
162
163 # a simple substitution, set psfile to documentation.ps 
164 set psfile $file.ps 
165 puts $psfile 
166
167 # another substitution, set pfile to documentationPS 
168 set pfile ${file}PS 
169
170 # a last one, 
171 # delete files NEWdocumentation and OLDdocumentation 
172 foreach prefix {NEW OLD} {rm $prefix$file} 
173 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
175 Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted. 
176
177 Compare command construction in csh. 
178
179 **Example:** 
180 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
181 set degree 30 
182 set pi 3.14159265 
183 # expr is a command evaluating a numeric expression 
184 set radian [expr $pi*$degree/180] 
185 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186
187 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. 
188
189 TCL uses two forms of *quoting* to prevent substitution and word breaking. 
190
191 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 " ". 
192
193 **Example:** 
194 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
195 # set msg to ;the price is 12.00; 
196 set price 12.00 
197 set msg ;the price is $price; 
198 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199
200 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. 
201
202 **Example:** 
203 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
204 set x 0 
205 # this will loop for ever 
206 # because while argument is ;0  3; 
207 while ;$x  3; {set x [expr $x+1]} 
208 # this will terminate as expected because 
209 # while argument is {$x  3} 
210 while {$x  3} {set x [expr $x+1]} 
211 # this can be written also 
212 while {$x  3} { 
213 set x [expr $x+1] 
214
215 # the following cannot be written 
216 # because while requires two arguments 
217 while {$x  3} 
218
219 set x [expr $x+1] 
220
221 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222
223 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. 
224
225 **Example:** 
226 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
227 # This is a comment 
228 set a 1 # this is not a comment 
229 set b 1; # this is a comment 
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231
232 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. 
233
234
235 **Example:** 
236 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
237 # I want to delete two files 
238
239 set files ;foo bar; 
240
241 # this will fail because rm will receive only one argument 
242 # and complain that ;foo bar; does not exit 
243
244 exec rm $files 
245
246 # a second evaluation will do it 
247 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248
249 @subsection occt_draw_2_3 Accessing variables in TCL and Draw
250
251 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. 
252
253 TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data. 
254
255 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. 
256
257 There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below. 
258
259 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. 
260
261 **Example:** 
262 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
263 # dset is used for numeric variables 
264 # pi is a predefined Draw variable 
265 dset angle pi/3 radius 10 
266 point p radius*cos(angle) radius*sin(angle) 0 
267 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
268 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. 
269
270 @subsubsection occt_draw_2_3_1 set, unset
271
272 Syntax:                  
273
274 ~~~~~
275 set varname [value] 
276 unset varname [varname varname ...] 
277 ~~~~~
278
279 *set* assigns a string value to a variable. If the variable does not already exist, it is created. 
280
281 Without a value, *set* returns the content of the variable. 
282
283 *unset* deletes variables. It is is also used to delete Draw variables. 
284
285 **Example:** 
286 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
287 set a "Hello world"
288 set b "Goodbye" 
289 set a 
290 == "Hello world" 
291 unset a b 
292 set a 
293 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294
295 **Note**, that the *set* command can set only one variable, unlike the *dset* command. 
296
297
298 @subsubsection occt_draw_2_3_2 dset, dval
299
300 Syntax
301
302 ~~~~~
303 dset var1 value1 vr2 value2 ... 
304 dval name 
305 ~~~~~
306
307 *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. 
308
309 *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. 
310
311
312 **Example:** 
313 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
314 # z is set to 0 
315 dset x 10 y 15 z 
316 == 0 
317
318 # no $ required for Draw commands 
319 point p x y z 
320
321 # "puts" prints a string 
322 puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)]; 
323 == x = 10, cos(x/pi) = -0.99913874099467914 
324 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325
326 **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.
327
328
329 @subsection occt_draw_2_4 lists
330
331 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. 
332
333 This allows you to insert lists within lists. 
334
335 **Example:** 
336 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
337 # a list of 3 strings 
338 ;a b c; 
339
340 # a list of two strings the first is a list of 2 
341 ;{a b} c; 
342 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343
344 Many TCL commands return lists and **foreach** is a useful way to create loops on list elements. 
345
346 @subsubsection occt_draw_2_5 Control Structures
347
348 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: 
349
350 * You use braces instead of parentheses to enclose conditions. 
351 * You do not start the script on the next line of your command. 
352
353
354 @subsubsection occt_draw_2_5_1 if
355
356 Syntax       
357
358 ~~~~~
359 if condition script [elseif script .... else script] 
360 ~~~~~
361
362 **If** evaluates the condition and the script to see whether the condition is true. 
363
364
365
366 **Example:** 
367 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
368 if {$x  0} { 
369 puts ;positive; 
370 } elseif {$x == 0} { 
371 puts ;null; 
372 } else { 
373 puts ;negative; 
374
375 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376
377 @subsubsection occt_draw_2_5_2 while, for, foreach
378
379 Syntax:                  
380
381
382 ~~~~~~
383 while condition script 
384 for init condition reinit script 
385 foreach varname list script 
386 ~~~~~
387
388 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. \
389
390 **Example:** 
391 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
392 # while example 
393 dset x 1.1 
394 while {[dval x]  100} { 
395   circle c 0 0 x 
396   dset x x*x 
397
398 # for example 
399 # incr var d, increments a variable of d (default 1) 
400 for {set i 0} {$i  10} {incr i} { 
401   dset angle $i*pi/10 
402   point p$i cos(angle0 sin(angle) 0 
403
404 # foreach example 
405 foreach object {crapo tomson lucas} {display $object} 
406 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
407
408 @subsubsection occt_draw_2_5_3 break, continue
409
410 Syntax:                  
411
412 ~~~~~
413 break 
414 continue 
415 ~~~~~
416
417 Within loops, the **break** and **continue** commands have the same effect as in C. 
418
419 **break** interrupts the innermost loop and **continue** jumps to the next iteration. 
420
421 **Example:** 
422 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
423 # search the index for which t$i has value ;secret; 
424 for {set i 1} {$i = 100} {incr i} { 
425   if {[set t$i] == ;secret;} break; 
426
427 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
428
429 @subsection occt_draw_2_6 Procedures
430
431 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. 
432
433 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. 
434
435 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. 
436
437 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. 
438
439
440 @subsubsection occt_draw_2_6_1 proc
441
442 Syntax:
443
444 ~~~~~
445 proc argumentlist script 
446 ~~~~~
447
448 **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. 
449
450 **return** gives a return value to the procedure. 
451
452 **Example:** 
453 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
454 # simple procedure 
455 proc hello {} { 
456   puts ;hello world; 
457
458 # procedure with arguments and default values 
459 proc distance {x1 y1 {x2 0} {y2 0}} { 
460   set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)] 
461   return [expr sqrt(d)] 
462
463 proc fact n { 
464   if {$n == 0} {return 1} else { 
465     return [expr n*[fact [expr n -1]]] 
466   } 
467
468 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
469
470
471 @subsubsection occt_draw_2_6_2 global, upvar
472
473 Syntax:                 
474
475 ~~~~~
476 global varname [varname ...] 
477 upvar varname localname [varname localname ...] 
478 ~~~~~
479
480
481 **global** accesses high level variables. Unlike C, global variables are not visible in procedures. 
482
483 **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. 
484
485 **Note** that in the following examples the \$ character is always necessarily used to access the arguments.
486  
487 **Example:** 
488 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
489 # convert degree to radian 
490 # pi is a global variable 
491 proc deg2rad (degree} { 
492   return [dval pi*$degree/2.] 
493
494 # create line with a point and an angle 
495 proc linang {linename x y angle} { 
496   upvar linename l 
497   line l $x $y cos($angle) sin($angle) 
498 }
499 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
500
501 @section occt_draw_3 Basic Commands
502
503 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: 
504
505   * General commands, which are used for Draw and TCL management.
506   * Variable commands, which are used to manage Draw variables such as storing and dumping.
507   * Graphic commands, which are used to manage the graphic system, and so pertain to views.
508   * Variable display commands, which are used to manage the display of objects within given views.
509
510 Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands 
511
512
513 @subsection occt_draw_3_1 General commands
514
515 This section describes several useful commands:
516
517   * **help** to get information, 
518   * **source** to eval a script from a file, 
519   * **spy** to capture the commands in a file,
520   * **cpulimit** to limit the process cpu time, 
521   * **wait** to waste some time, 
522   * **chrono** to time commands. 
523
524 @subsubsection occt_draw_3_1_1 help
525
526 Syntax:                  
527
528 ~~~~~
529 help [command [helpstring group]] 
530 ~~~~~
531
532 Provides help or modifies the help information. 
533
534 **help** without arguments lists all groups and the commands in each group. 
535
536 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. 
537
538 **Example:** 
539 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
540 # Gives help on all commands starting with *a* 
541 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
542
543
544 @subsubsection occt_draw_3_1_2 source
545
546 Syntax:
547
548 ~~~~~
549 source filename 
550 ~~~~~
551 Executes a file. 
552
553 The **exit** command will terminate the file. 
554
555 @subsubsection occt_draw_3_1_3 spy
556
557 Syntax:                  
558
559 ~~~~~
560 spy [filename] 
561 ~~~~~
562
563 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. 
564
565 If a command returns an error it is saved with a comment mark. 
566
567 The file created by **spy** can be executed with the **source** command. 
568
569 **Example:** 
570 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
571 # all commands will be saved in the file ;session; 
572 spy session 
573 # the file ;session; is closed and commands are not saved 
574 spy 
575 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
576
577
578
579 @subsubsection occt_draw_3_1_4 cpulimit
580
581 Syntax:                  
582
583 ~~~~~
584 cpulimit [nbseconds] 
585 ~~~~~
586
587 **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. 
588
589 **Example:** 
590 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
591 #limit cpu to one hour 
592 cpulimit 3600 
593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594
595 @subsubsection occt_draw_3_1_5 wait
596
597 Syntax:
598 ~~~~~
599 wait [nbseconds] 
600 ~~~~~
601 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. 
602
603 ~~~~~
604 # You have ten seconds ... 
605 wait 
606 ~~~~~
607
608 @subsubsection occt_draw_3_1_6 chrono
609
610 Syntax:                  
611
612 ~~~~~
613 chrono [ name start/stop/reset/show] 
614 ~~~~~
615
616 Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed. 
617
618 With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer. 
619   * run the chronometer (start).
620   * stop the chronometer (stop).
621   * reset the chronometer to 0 (reset).
622   * display the current time (show).
623
624 **Example:** 
625 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
626 chrono 
627 ==Chronometers activated. 
628 ptorus t 20 5 
629 ==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds 
630 ==CPU user time: 0.01 seconds 
631 ==CPU system time: 0 seconds 
632 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
633
634 @subsection occt_draw_3_2  Variable management commands
635
636 @subsubsection occt_draw_3_2_1 isdraw, directory
637
638 Syntax:                  
639 ~~~~~
640 isdraw varname 
641 directory [pattern] 
642 ~~~~~
643
644 **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. 
645
646 Use **directory** to return a list of all Draw global variables matching a pattern. 
647
648 **Example:** 
649 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
650 set a 1 
651 isdraw a 
652 === 0 
653
654 dset a 1 
655 isdraw a 
656 === 1 
657
658 circle c 0 0 1 0 5 
659 isdraw c 
660 === 1 
661
662 # to destroy all Draw objects with name containing curve 
663 foreach var [directory *curve*] {unset $var} 
664 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
665
666
667 @subsubsection occt_draw_3_2_2 whatis, dump
668
669 Syntax:
670
671 ~~~~~
672 whatis varname [varname ...] 
673 dump varname [varname ...] 
674 ~~~~~
675
676 **whatis** returns short information about a Draw variable. This is usually the type name. 
677
678 **dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable. 
679
680 **Example:** 
681 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
682 circle c 0 0 1 0 5 
683 whatis c 
684 c is a 2d curve 
685
686 dump c 
687
688 ***** Dump of c ***** 
689 Circle 
690 Center :0, 0 
691 XAxis :1, 0 
692 YAxis :-0, 1 
693 Radius :5 
694 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695
696 **Note** The behavior of *whatis* on other variables (not Draw) is not excellent. 
697
698
699 @subsubsection occt_draw_3_2_3 rename, copy
700
701 Syntax:      
702 ~~~~~
703 rename varname tovarname [varname tovarname ...] 
704 copy varname tovarname [varname tovarname ...] 
705 ~~~~~
706
707   * **rename** 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. 
708   * **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. 
709
710 **Example:** 
711 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
712 circle c1 0 0 1 0 5 
713 rename c1 c2 
714
715 # curves are copied, c2 will not be modified 
716 copy c2 c3 
717 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
718
719 @subsubsection occt_draw_3_2_4 datadir, save, restore
720
721 Syntax:
722 ~~~~~
723 datadir [directory] 
724 save variable [filename] 
725 restore filename [variablename] 
726 ~~~~~
727
728   * **datadir** without arguments prints the path of the current data directory. 
729   * **datadir** with an argument sets the data directory path. \
730
731 If the path starts with a dot (.) only the last directory name will be changed in the path. 
732
733   * **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. 
734   * **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. 
735
736 The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent. 
737
738 **Example:** 
739 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
740 # note how TCL accesses shell environment variables 
741 # using $env() 
742 datadir 
743 ==. 
744
745 datadir $env(WBCONTAINER)/data/default 
746 ==/adv_20/BAG/data/default 
747
748 box b 10 20 30 
749 save b theBox 
750 ==/adv_20/BAG/data/default/theBox 
751
752 # when TCL does not find a command it tries a shell command 
753 ls [datadir] 
754 == theBox 
755
756 restore theBox 
757 == theBox 
758 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
759
760 @subsection occt_draw_3_3 User defined commands
761
762 *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. 
763
764 *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. 
765
766 @subsubsection occt_draw_3_3_1 set
767
768 #### In *DrawTrSurf* package:
769
770 ~~~~~
771 void Set(Standard_CString& Name,const gp_Pnt& G) ; 
772 void Set(Standard_CString& Name,const gp_Pnt2d& G) ; 
773 void Set(Standard_CString& Name, 
774 const Handle(Geom_Geometry)& G) ; 
775 void Set(Standard_CString& Name, 
776 const Handle(Geom2d_Curve)& C) ; 
777 void Set(Standard_CString& Name, 
778 const Handle(Poly_Triangulation)& T) ; 
779 void Set(Standard_CString& Name, 
780 const Handle(Poly_Polygon3D)& P) ; 
781 void Set(Standard_CString& Name, 
782 const Handle(Poly_Polygon2D)& P) ; 
783 ~~~~~
784
785 #### In *DBRep* package:
786
787 ~~~~~
788 void Set(const Standard_CString Name, 
789 const TopoDS_Shape& S) ; 
790 ~~~~~
791
792 Example of *DrawTrSurf*
793
794 ~~~~~
795 Handle(Geom2d_Circle) C1 = new Geom2d_Circle 
796 (gce_MakeCirc2d (gp_Pnt2d(50,0,) 25)); 
797 DrawTrSurf::Set(char*, C1); 
798 ~~~~~
799
800 Example of *DBRep* 
801
802 ~~~~~
803 TopoDS_Solid B; 
804 B = BRepPrimAPI_MakeBox (10,10,10); 
805 DBRep::Set(char*,B); 
806 ~~~~~
807
808 @subsubsection occt_draw_3_3_2 get
809
810 #### In *DrawTrSurf* package:
811  
812 ~~~~~
813 Handle_Geom_Geometry Get(Standard_CString& Name) ; 
814 ~~~~~
815
816 #### In *DBRep* package:
817
818 ~~~~~
819 TopoDS_Shape Get(Standard_CString& Name, 
820 const TopAbs_ShapeEnum Typ = TopAbs_SHAPE, 
821 const Standard_Boolean Complain 
822 = Standard_True) ; 
823 ~~~~~
824
825 Example of *DrawTrSurf*
826
827 ~~~~~
828 Standard_Integer MyCommand 
829 (Draw_Interpretor& theCommands, 
830 Standard_Integer argc, char** argv) 
831 {...... 
832 // Creation of a Geom_Geometry from a Draw geometric 
833 // name 
834 Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]); 
835
836 ~~~~~
837
838 Example of *DBRep*
839
840 ~~~~~
841 Standard_Integer MyCommand 
842 (Draw_Interpretor& theCommands, 
843 Standard_Integer argc, char** argv) 
844 {...... 
845 // Creation of a TopoDS_Shape from a Draw topological 
846 // name 
847 TopoDS_Solid B = DBRep::Get(argv[1]); 
848
849 ~~~~~
850
851 @section occt_draw_4 Graphic Commands
852
853 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. 
854
855 @subsection occt_draw_4_1 Axonometric viewer
856
857 @subsubsection occt_draw_4_1_1 view, delete
858
859 Syntax:                  
860 ~~~~~
861 view index type [X Y W H] 
862 delete [index] 
863 ~~~~~
864
865 **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. 
866
867 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.. 
868
869 **delete** deletes a view. If no index is given, all the views are deleted. 
870
871 Type selects from the following range: 
872
873   * *AXON* : Axonometric view
874   * *PERS* : Perspective view
875   * <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.
876   * <i>-2D-</i> : 2d view
877
878 The index, the type, the current zoom are displayed in the window title . 
879
880 **Example:** 
881 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
882 # this is the content of the mu4 procedure 
883 proc mu4 {} { 
884 delete 
885 view 1 +X+Z 320 20 400 400 
886 view 2 +X+Y 320 450 400 400 
887 view 3 +Y+Z 728 20 400 400 
888 view 4 AXON 728 450 400 400 
889
890 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
891
892 See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview** 
893
894 @subsubsection occt_draw_4_1_2  axo, pers, top, ...
895
896 Syntax:      
897
898 ~~~~~
899 axo 
900 pers 
901 ... 
902 smallview type 
903 ~~~~~
904
905 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. 
906
907   * **axo** creates a large window axonometric view;
908   * **pers** creates a large window perspective view;
909   * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
910   * **mu4** creates four small window views: front, left, top and axo.
911   * **v2d** creates a large window 2d view.
912   * **av2d** creates two small window views, one 2d and one axo
913   * **smallview** creates a view at the bottom right of the screen of the given type. 
914
915 See also: **view**, **delete** 
916
917 @subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
918
919 Syntax:
920
921 ~~~~~
922     mu [index] value 
923     2dmu [index] value 
924     zoom [index] value 
925     wzoom 
926 ~~~~~
927
928 * **mu** (magnify up) increases the zoom in one or several views by a factor of 10%. 
929 * **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd** 
930 perform the same on one or all 2d views. 
931 * **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. 
932 * **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. 
933
934 **Example:** 
935 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
936     # set a zoom of 2.5 
937     zoom 2.5 
938
939     # magnify by 10% 
940     mu 1 
941
942     # magnify by 20% 
943 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
944 See also: **fit**, **2dfit** 
945
946
947 @subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
948
949 Syntax:                  
950
951 ~~~~~
952 pu [index] 
953 pd [index] 
954 ~~~~~
955
956 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. 
957 ~~~~~
958 # you have selected one anonometric view
959 pu
960 # or
961 pu 1
962
963 # you have selected an mu4 view; the object in the third view will pan up
964 pu 3
965 ~~~~~
966 See also: **fit**, **2dfit** 
967
968
969 @subsubsection occt_draw_4_1_5 fit, 2dfit
970
971 Syntax:      
972
973 ~~~~~
974 fit [index] 
975 2dfit [index] 
976 ~~~~~
977
978 **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. 
979
980 When fitting all views a unique zoom is computed for all the views. All views are on the same scale. 
981
982 **Example:** 
983 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
984 # fit only view 1 
985 fit 1 
986 # fit all 2d views 
987 2dfit 
988 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
989 See also: **zoom**, **mu**, **pu** 
990
991
992 @subsubsection occt_draw_4_1_6 u, d, l, r
993
994 Syntax:      
995
996 ~~~~~
997 u [index] 
998 d [index] 
999 l [index] 
1000 r [index] 
1001 ~~~~~
1002
1003 **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. 
1004
1005 **Example:** 
1006 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1007 # rotate the view up 
1008
1009 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1010
1011 @subsubsection occt_draw_4_1_7 focal, fu, fd
1012
1013 Syntax:                  
1014 ~~~~~
1015 focal [f] 
1016 fu [index] 
1017 fd [index] 
1018 ~~~~~
1019
1020 * **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. 
1021 * **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object. 
1022
1023 **Example:** 
1024 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1025 pers 
1026 repeat 10 fd 
1027 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1028
1029 **Note**: Do not use a negative or null focal value. 
1030
1031 See also: **pers** 
1032
1033 @subsubsection occt_draw_4_1_8 color
1034
1035 Syntax: 
1036
1037 ~~~~~
1038 color index name 
1039 ~~~~~
1040
1041 **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. 
1042
1043 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. 
1044
1045 **Example:** 
1046 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1047 # change the value of blue 
1048 color 3 "navy blue" 
1049 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1050
1051
1052 **Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc. 
1053
1054 @subsubsection occt_draw_4_1_9 dtext
1055
1056 Syntax:      
1057 ~~~~~
1058 dtext [x y [z]] string 
1059 ~~~~~
1060
1061 **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. 
1062
1063 The coordinates are real space coordinates. 
1064
1065 **Example:** 
1066 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1067 # mark the origins 
1068 dtext 0 0 bebop 
1069 dtext 0 0 0 bebop 
1070 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1071
1072 @subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
1073
1074 Syntax:      
1075 ~~~~~
1076 hardcopy [index] 
1077 hcolor index width gray 
1078 xwd [index] filename 
1079 ~~~~~
1080
1081 * **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. 
1082 * **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. 
1083 * **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**. 
1084
1085 **Example:** 
1086 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1087 # all blue lines (color 3) 
1088 # will be half-width and gray 
1089 hcolor 3 0.5 
1090
1091 # make a postscript file and print it 
1092 hardcopy 
1093 lpr a4.ps 
1094
1095 # make an xwd file and display it 
1096 xwd theview 
1097 xwud -in theview 
1098 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1099
1100 **Note:** When more than one view is present, specify the index of the view. 
1101
1102 Only use a postscript printer to print postscript files. 
1103
1104 See also: **color** 
1105
1106
1107 @subsubsection occt_draw_4_1_11 wclick, pick
1108
1109 Syntax:      
1110 ~~~~~
1111 wclick 
1112 pick index X Y Z b [nowait] 
1113 ~~~~~
1114
1115 **wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed. 
1116
1117 Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored. 
1118   * index: index of the view where the input was made.
1119   * X,Y,Z: 3d coordinates in real world.
1120   * b: b is the mouse button 1,2 or 3.
1121
1122 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. 
1123
1124 This option is useful for tracking the pointer. 
1125
1126 **Note** that the results are stored in Draw numeric variables.
1127
1128 **Example:** 
1129 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1130 # make a circle at mouse location 
1131 pick index x y z b 
1132 circle c x y z 0 0 1 1 0 0 0 30 
1133
1134 # make a dynamic circle at mouse location 
1135 # stop when a button is clicked 
1136 # (see the repaint command) 
1137
1138 dset b 0 
1139 while {[dval b] == 0} { 
1140 pick index x y z b nowait 
1141 circle c x y z 0 0 1 1 0 0 0 30 
1142 repaint 
1143
1144 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1145 See also: **repaint** 
1146
1147
1148 Draw provides commands to manage the display of objects. 
1149 * **display**, **donly** are used to display, 
1150 * **erase**, **clear**, **2dclear** to erase. 
1151 * **autodisplay** command is used to check whether variables are displayed when created. 
1152
1153 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. 
1154   * 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.
1155   * 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.
1156   * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
1157
1158 **Example:** 
1159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1160 # OK use dot to dump an object on the screen 
1161 dump . 
1162
1163 point . x y z 
1164
1165 #Not OK. display points on a curve c 
1166 # with dot no variables are created 
1167 for {set i 0} {$i = 10} {incr i} { 
1168 cvalue c $i/10 x y z 
1169 point . x y z 
1170
1171
1172 # point p x y z 
1173 # would have displayed only one point 
1174 # because the precedent variable content is erased 
1175
1176 # point p$i x y z 
1177 # is an other solution, creating variables 
1178 # p0, p1, p2, .... 
1179
1180 # give a name to a graphic object 
1181 rename . x 
1182 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1183
1184
1185 @subsubsection occt_draw_4_1_12 autodisplay
1186
1187 Syntax:      
1188
1189 ~~~~~
1190 autodisplay [0/1] 
1191 ~~~~~
1192
1193 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. 
1194
1195 When **autodisplay** is off, using the dot return argument is ineffective. 
1196
1197 **Example:** 
1198 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1199 # c is displayed 
1200 circle c 0 0 1 0 5 
1201
1202 # toggle the mode 
1203 autodisplay 
1204 == 0 
1205 circle c 0 0 1 0 5 
1206
1207 # c is erased, but not displayed 
1208 display c 
1209 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1210
1211 @subsubsection occt_draw_4_1_13 display, donly
1212
1213 Syntax:      
1214 ~~~~~
1215 display varname [varname ...] 
1216 donly varname [varname ...] 
1217 ~~~~~
1218
1219 * **display** makes objects visible. 
1220 * **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen. 
1221
1222 **Example:** 
1223 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1224 \# to see all objects 
1225 foreach var [directory] {display $var} 
1226
1227 \# to select two objects and erase the other ones 
1228 donly . . 
1229 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1230
1231
1232 @subsubsection occt_draw_4_1_14 erase, clear, 2dclear
1233
1234 Syntax:      
1235
1236 ~~~~~
1237 erase [varname varname ...] 
1238 clear 
1239 2dclear 
1240 ~~~~~
1241
1242 **erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d. 
1243
1244 **clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to  **clear; 2dclear**.
1245
1246
1247 **Example:** 
1248 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1249 # erase eveerything with a name starting with c_ 
1250 foreach var [directory c_*] {erase $var} 
1251
1252 # clear 2d views 
1253 2dclear 
1254 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1255
1256 @subsubsection occt_draw_4_1_15 repaint, dflush
1257
1258
1259 Syntax:
1260
1261 ~~~~~
1262 repaint 
1263 dflush 
1264 ~~~~~
1265
1266 * **repaint** forces repainting of views. 
1267 * **dflush** flushes the graphic buffers. 
1268
1269 These commands are useful within loops or in scripts. 
1270
1271 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. 
1272
1273 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. 
1274
1275 See also: <a href="#occt_draw_4_1_11">pick</a> command.  
1276
1277 @subsection occt_draw_4_2 AIS viewer – view commands
1278
1279 @subsubsection occt_draw_4_2_1 vinit
1280
1281 Syntax:                  
1282 ~~~~~
1283 vinit 
1284 ~~~~~
1285 Creates the 3D viewer window 
1286
1287 @subsubsection occt_draw_4_2_2 vhelp
1288
1289 Syntax:
1290 ~~~~~
1291 vhelp 
1292 ~~~~~
1293 Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities. 
1294
1295 @subsubsection occt_draw_4_2_3 vtop
1296
1297 Syntax:
1298 ~~~~~
1299 vtop 
1300 ~~~~~
1301
1302 Displays top view in the 3D viewer window. 
1303
1304 **Example:** 
1305 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1306 vinit 
1307 box b 10 10 10 
1308 vdisplay b 
1309 vfit 
1310 vtop 
1311 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1312
1313 @subsubsection occt_draw_4_2_4 vaxo
1314
1315 Syntax:                  
1316 ~~~~~
1317 vaxo 
1318 ~~~~~
1319
1320 Displays axonometric view in the 3D viewer window. 
1321
1322 **Example:** 
1323 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1324 vinit 
1325 box b 10 10 10 
1326 vdisplay b 
1327 vfit 
1328 vaxo 
1329 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1330
1331 @subsubsection occt_draw_4_2_5 vsetbg
1332
1333 Syntax:                  
1334 ~~~~~
1335 vsetbg imagefile [filltype] 
1336 ~~~~~
1337
1338 Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH. 
1339
1340 **Example:** 
1341 ~~~~~
1342 vinit 
1343 vsetbg myimage.brep CENTERED 
1344 ~~~~~
1345
1346 @subsubsection occt_draw_4_2_6 vclear
1347
1348 Syntax:                  
1349 ~~~~~
1350 vclear 
1351 ~~~~~
1352 Removes all objects from the viewer. 
1353
1354 @subsubsection occt_draw_4_2_7 vrepaint
1355
1356 Syntax:                  
1357 ~~~~~
1358 vrepaint 
1359 ~~~~~
1360 Forcedly redisplays the shape in the 3D viewer window. 
1361
1362 @subsubsection occt_draw_4_2_8 vfit
1363
1364 Syntax:                  
1365 ~~~~~
1366 vfit 
1367 ~~~~~
1368 Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface. 
1369
1370 @subsubsection occt_draw_4_2_9 vzfit
1371
1372 Syntax:                  
1373 ~~~~~
1374 vzfit 
1375 ~~~~~
1376
1377 Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space. 
1378
1379 @subsubsection occt_draw_4_2_10  vreadpixel
1380
1381 Syntax:     
1382 ~~~~~
1383 vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name] 
1384 ~~~~~
1385 Read pixel value for active view.
1386
1387
1388 @subsubsection occt_draw_4_2_11  vselect
1389
1390 Syntax:     
1391 ~~~~~
1392 vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [shift_selection = 0|1]
1393 ~~~~~
1394
1395 Emulates different types of selection:
1396
1397   * single mouse click selection
1398   * selection with a rectangle having the upper left and bottom right corners in <i>(x1,y1)</i> and <i>(x2,y2)</i> respectively
1399   * selection with a polygon having the corners in pixel positions <i>(x1,y1), (x2,y2),…, (xn,yn)</i>
1400   * any of these selections if shift_selection is set to 1.
1401
1402 @subsubsection occt_draw_4_2_12  vmoveto
1403
1404 Syntax:     
1405
1406 ~~~~~
1407 vmoveto x y
1408 ~~~~~
1409 Emulates cursor movement to pixel position (x,y).
1410
1411 @subsubsection occt_draw_4_2_13  vviewparams
1412
1413 Syntax:     
1414 ~~~~~
1415 vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]
1416 ~~~~~
1417 Gets or sets the current view characteristics.
1418
1419 @subsubsection occt_draw_4_2_14  vchangeselected
1420
1421 Syntax:     
1422 ~~~~~
1423 vchangeselected shape
1424 ~~~~~
1425 Adds a shape to selection or removes one from it.
1426
1427 @subsubsection occt_draw_4_2_15  vzclipping
1428
1429 Syntax:     
1430 ~~~~~
1431 vzclipping [mode] [depth width]
1432 ~~~~~
1433 Gets or sets ZClipping mode, width and depth, where
1434  - *mode = OFF|BACK|FRONT|SLICE*
1435  - *depth* is a real value from segment [0,1]
1436  - *width* is a real value from segment [0,1]
1437
1438 @subsubsection occt_draw_4_2_16  vnbselected
1439
1440 Syntax:     
1441 ~~~~~
1442 vnbselected
1443 ~~~~~
1444 Returns the number of selected objects in the interactive context.
1445
1446 @subsubsection occt_draw_4_2_17  vantialiasing
1447
1448 Syntax:     
1449 ~~~~~
1450 vantialiasing 1|0
1451 ~~~~~
1452 Sets antialiasing if the command is called with 1 or unsets otherwise.
1453
1454 @subsubsection occt_draw_4_2_18  vpurgedisplay
1455
1456 Syntax:     
1457 ~~~~~
1458 vpurgedisplay [CollectorToo = 0|1]
1459 ~~~~~
1460 Removes structures which do not belong to objects displayed in neutral point.
1461
1462 @subsubsection occt_draw_4_2_19  vhlr
1463
1464 Syntax:     
1465 ~~~~~
1466 vhlr is_enabled={on|off}
1467 ~~~~~
1468 Switches hidden line removal (computed) mode on/off.
1469
1470 @subsubsection occt_draw_4_2_20  vhlrtype
1471
1472 Syntax:     
1473 ~~~~~
1474 vhlrtype  algo_type={algo|polyalgo} [shape_1 ... shape_n]
1475 ~~~~~
1476
1477 Changes the type of HLR algorithm used for shapes.
1478 If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes. 
1479
1480 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.
1481
1482 **Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
1483
1484 @subsubsection occt_draw_4_2_21 vcamera
1485
1486 Syntax:
1487 ~~~~~
1488 vcamera
1489 ~~~~~
1490
1491 Manages camera parameters.
1492
1493 **Example:**
1494 ~~~~~
1495 vinit
1496 box b 10 10 10
1497 vdisplay b
1498 vfit
1499 vcamera -persp
1500 ~~~~~
1501
1502 @subsubsection occt_draw_4_2_22 vstereo
1503
1504 Syntax:
1505 ~~~~~
1506 vstereo [0:1]
1507 ~~~~~
1508
1509 Turns stereo usage On/Off.
1510
1511 **Example:**
1512 ~~~~~
1513 vinit
1514 box b 10 10 10
1515 vdisplay b
1516 vstereo 1
1517 vfit
1518 vcamera -stereo -iod 1
1519 vcamera -lefteye
1520 vcamera -righteye
1521 ~~~~~
1522
1523 @subsubsection occt_draw_4_2_23 vfrustumculling
1524
1525 Syntax:
1526 ~~~~~
1527 vfrustumculling [toEnable]
1528 ~~~~~
1529
1530 Enables/disables objects clipping.
1531
1532
1533 @subsection occt_draw_4_3 AIS viewer – display commands
1534
1535 @subsubsection occt_draw_4_3_1 vdisplay
1536
1537 Syntax: 
1538 ~~~~~                 
1539 vdisplay [-noupdate|-update] [-local] [-mutable] name1 [name2] … [name n]
1540 ~~~~~
1541
1542 Displays named objects. Automatically redraws view by default.
1543 Redraw can be suppressed by -noupdate option.
1544
1545 **Example:** 
1546 ~~~~~ 
1547 vinit 
1548 box b 40 40 40 10 10 10 
1549 psphere s 20 
1550 vdisplay s b 
1551 vfit 
1552 ~~~~~ 
1553
1554 @subsubsection occt_draw_4_3_2 vdonly
1555
1556 Syntax:                  
1557 ~~~~~
1558 vdonly [name1] … [name n]
1559 ~~~~~ 
1560
1561 Displays only selected or named objects. If there are no selected or named objects, nothing is done. 
1562
1563 **Example:** 
1564 ~~~~~ 
1565 vinit 
1566 box b 40 40 40 10 10 10 
1567 psphere s 20 
1568 vdonly b 
1569 vfit
1570 ~~~~~ 
1571  
1572 @subsubsection occt_draw_4_3_3 vdisplayall
1573
1574 Syntax:                  
1575 ~~~~~ 
1576 vdisplayall 
1577 ~~~~~ 
1578
1579 Displays all created objects. 
1580
1581 **Example:** 
1582 ~~~~~ 
1583 vinit 
1584 box b 40 40 40 10 10 10 
1585 psphere s 20 
1586 vdisplayall 
1587 vfit 
1588 ~~~~~ 
1589
1590 @subsubsection occt_draw_4_3_4 verase
1591
1592 Syntax:                  
1593 ~~~~~
1594 verase [name1] [name2] … [name n]
1595 ~~~~~ 
1596
1597 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased. 
1598
1599 **Example:** 
1600 ~~~~~
1601 vinit 
1602 box b1 40 40 40 10 10 10 
1603 box b2 -40 -40 -40 10 10 10 
1604 psphere s 20 
1605 vdisplayall 
1606 vfit 
1607 # erase only first box 
1608 verase b1 
1609 # erase second box and sphere 
1610 verase
1611 ~~~~~ 
1612
1613 @subsubsection occt_draw_4_3_5 veraseall
1614
1615 Syntax:                  
1616 ~~~~~
1617 veraseall
1618 ~~~~~ 
1619
1620 Erases all objects displayed in the viewer. 
1621
1622 **Example:**
1623 ~~~~~ 
1624 vinit 
1625 box b1 40 40 40 10 10 10 
1626 box b2 -40 -40 -40 10 10 10 
1627 psphere s 20 
1628 vdisplayall 
1629 vfit 
1630 # erase only first box 
1631 verase b1 
1632 # erase second box and sphere 
1633 verseall
1634 ~~~~~ 
1635
1636 @subsubsection occt_draw_4_3_6 vsetdispmode
1637
1638 Syntax:                  
1639 ~~~~~
1640 vsetdispmode [name] mode(0,1,2,3)
1641 ~~~~~ 
1642
1643 Sets display mode for all, selected or named objects. 
1644 * *0* (*WireFrame*), 
1645 * *1* (*Shading*), 
1646 * *2* (*Quick HideLineremoval*), 
1647 * *3* (*Exact HideLineremoval*). 
1648
1649 **Example:** 
1650 ~~~~~
1651 vinit 
1652 box b 10 10 10 
1653 vdisplay b 
1654 vsetdispmode 1 
1655 vfit
1656 ~~~~~
1657  
1658 @subsubsection occt_draw_4_3_7 vdisplaytype
1659
1660 Syntax:                  
1661 ~~~~~
1662 vdisplaytype type
1663 ~~~~~ 
1664
1665 Displays all objects of a given type. 
1666 The following types are possible: *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*. 
1667
1668 @subsubsection occt_draw_4_3_8 verasetype
1669
1670 Syntax:                  
1671 ~~~~~
1672 verasetype type
1673 ~~~~~ 
1674
1675 Erases all objects of a given type. 
1676 Possible type is *Point*, *Axis*, *Trihedron*, *PlaneTrihedron*, *Line*, *Circle*, *Plane*, *Shape*, *ConnectedShape*, *MultiConn.Shape*, *ConnectedInter.*, *MultiConn.*, *Constraint* and *Dimension*. 
1677
1678 @subsubsection occt_draw_4_3_9 vtypes
1679
1680 Syntax:                  
1681 ~~~~~
1682 vtypes
1683 ~~~~~ 
1684
1685 Makes a list of known types and signatures in AIS. 
1686
1687 @subsubsection occt_draw_4_3_10 vaspects
1688
1689 Syntax:
1690 ~~~~~
1691 vaspects [-noupdate|-update] [name1 [name2 [...]]]
1692          [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]
1693          [-setmaterial MatName] [-unsetmaterial]
1694          [-settransparency Transp] [-unsettransparency]
1695          [-setwidth LineWidth] [-unsetwidth]
1696          [-subshapes subname1 [subname2 [...]]]
1697
1698 ~~~~~
1699
1700 Aliases:
1701 ~~~~~
1702 vsetcolor [shapename] colorname
1703
1704 ~~~~~
1705
1706
1707 Manages presentation properties (color, material, transparency) of all objects, selected or named.
1708
1709 **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*.
1710 ~~~~~
1711 vaspects    [name] [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]
1712 vsetcolor   [name] ColorName
1713 vunsetcolor [name]
1714 ~~~~~
1715
1716 **Transparency. The *Transp* may be between 0.0 (opaque) and 1.0 (fully transparent).
1717 **Warning**: at 1.0 the shape becomes invisible.
1718 ~~~~~
1719 vaspects           [name] [-settransparency Transp] [-unsettransparency]
1720 vsettransparency   [name] Transp
1721 vunsettransparency [name]
1722 ~~~~~
1723
1724 **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*.
1725 ~~~~~
1726 vaspects       [name] [-setmaterial MatName] [-unsetmaterial]
1727 vsetmaterial   [name] MatName
1728 vunsetmaterial [name]
1729 ~~~~~
1730
1731 **Line width**. Specifies width of the edges. The *LineWidth* may be between 0.0 and 10.0.
1732 ~~~~~
1733 vaspects    [name] [-setwidth LineWidth] [-unsetwidth]
1734 vsetwidth   [name] LineWidth
1735 vunsetwidth [name]
1736 ~~~~~
1737
1738 **Example:**
1739 ~~~~~
1740 vinit
1741 box b 10 10 10
1742 vdisplay b
1743 vfit
1744
1745 vsetdispmode b 1
1746 vaspects -setcolor red -settransparency 0.2
1747 vrotate 10 10 10
1748 ~~~~~
1749
1750
1751
1752
1753
1754
1755 @subsubsection occt_draw_4_3_11 vsetshading
1756
1757 Syntax:                  
1758 ~~~~~
1759 vsetshading shapename [coefficient]
1760 ~~~~~ 
1761
1762 Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008. 
1763
1764 **Example:** 
1765 ~~~~~
1766 vinit 
1767 psphere s 20 
1768 vdisplay s 
1769 vfit 
1770 vsetdispmode 1 
1771 vsetshading s 0.005
1772 ~~~~~
1773  
1774 @subsubsection occt_draw_4_3_12 vunsetshading
1775
1776 Syntax:                  
1777 ~~~~~
1778 vunsetshading [shapename]
1779 ~~~~~ 
1780
1781 Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008. 
1782
1783 @subsubsection occt_draw_4_3_13 vsetam
1784
1785 Syntax:                  
1786 ~~~~~
1787 vsetam [shapename] mode
1788 ~~~~~ 
1789
1790 Activates selection mode for all selected or named shapes: 
1791 * *0* for *shape* itself, 
1792 * *1* (*vertices*), 
1793 * *2* (*edges*), 
1794 * *3* (*wires*), 
1795 * *4* (*faces*), 
1796 * *5* (*shells*),
1797 * *6* (*solids*),
1798 * *7* (*compounds*).
1799  
1800 **Example:** 
1801 ~~~~~
1802 vinit 
1803 box b 10 10 10 
1804 vdisplay b 
1805 vfit 
1806 vsetam b 2
1807 ~~~~~
1808  
1809 @subsubsection occt_draw_4_3_14 vunsetam
1810
1811 Syntax:                  
1812 ~~~~~
1813 vunsetam
1814 ~~~~~ 
1815
1816 Deactivates all selection modes for all shapes. 
1817
1818 @subsubsection occt_draw_4_3_15 vdump
1819
1820 Syntax:                  
1821 ~~~~~
1822 vdump <filename>.{png|bmp|jpg|gif}
1823 ~~~~~ 
1824
1825 Extracts the contents of the viewer window to a image file.
1826
1827 @subsubsection occt_draw_4_3_16 vdir
1828
1829 Syntax:                  
1830 ~~~~~
1831 vdir
1832 ~~~~~ 
1833
1834 Displays the list of displayed objects. 
1835
1836 @subsubsection occt_draw_4_3_17 vsub
1837
1838 Syntax:                  
1839 ~~~~~
1840 vsub 0/1(on/off)[shapename]
1841 ~~~~~ 
1842
1843 Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
1844  
1845 **Example:** 
1846 ~~~~~
1847 vinit 
1848 box b 10 10 10 
1849 psphere s 20 
1850 vdisplay b s 
1851 vfit 
1852 vsetdispmode 1 
1853 vsub b 1
1854 ~~~~~ 
1855
1856 @subsubsection occt_draw_4_3_18 vardis
1857
1858 Syntax:                  
1859 ~~~~~
1860 vardis
1861 ~~~~~ 
1862
1863 Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity). 
1864
1865 @subsubsection occt_draw_4_3_19 varera
1866
1867 Syntax:                  
1868 ~~~~~
1869 varera
1870 ~~~~~ 
1871
1872 Erases active areas. 
1873
1874 @subsubsection occt_draw_4_3_20 vsensdis
1875
1876 Syntax:                  
1877 ~~~~~
1878 vsensdis
1879 ~~~~~ 
1880
1881 Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes). 
1882
1883 Standard entity types are those defined in Select3D package: 
1884   * sensitive box
1885   * sensitive face
1886   * sensitive curve
1887   * sensitive segment
1888   * sensitive circle
1889   * sensitive point
1890   * sensitive triangulation
1891   * sensitive triangle
1892 Custom (application-defined) sensitive entity types are not processed by this command. 
1893
1894 @subsubsection occt_draw_4_3_21 vsensera
1895
1896 Syntax:                  
1897 ~~~~~
1898 vsensera
1899 ~~~~~ 
1900
1901 Erases active entities. 
1902
1903 @subsubsection occt_draw_4_3_22 vperf
1904
1905 Syntax:                  
1906 ~~~~~
1907 vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
1908 ~~~~~ 
1909
1910 Tests the animation of an object along a predefined trajectory. 
1911
1912 **Example:** 
1913 ~~~~~
1914 vinit 
1915 box b 10 10 10 
1916 psphere s 20 
1917 vdisplay b s 
1918 vfit 
1919 vsetdispmode 0 
1920 vperf b 1 1
1921 ~~~~~
1922  
1923 @subsubsection occt_draw_4_3_23 vr
1924
1925 Syntax:                  
1926 ~~~~~
1927 vr filename
1928 ~~~~~ 
1929
1930 Reads shape from BREP-format file and displays it in the viewer. 
1931
1932 **Example:** 
1933 ~~~~~
1934 vinit 
1935 vr myshape.brep
1936 ~~~~~
1937  
1938 @subsubsection occt_draw_4_3_24 vstate
1939
1940 Syntax:                  
1941 ~~~~~
1942 vstate [name1] … [name n]
1943 ~~~~~ 
1944
1945 Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects. 
1946
1947 @subsubsection occt_draw_4_3_25 vraytrace
1948
1949 Syntax:
1950 ~~~~~
1951 vraytrace [0/1]
1952 ~~~~~
1953
1954 Turns on/off ray tracing renderer.
1955
1956 @subsubsection occt_draw_4_3_26 vrenderparams
1957
1958 Syntax:
1959 ~~~~~
1960 vrenderparams
1961 ~~~~~
1962
1963 Manages rendering parameters:
1964 * rayTrace
1965 * raster
1966 * rayDepth
1967 * shadows
1968 * reflections
1969 * fsaa
1970 * gleam
1971 * shadingModel
1972
1973 **Example:**
1974 ~~~~~
1975 vinit
1976 box b 10 10 10
1977 vdisplay b
1978 vfit
1979 vraytrace 1
1980 vrenderparams -shadows 1 -reflections 1 -fsaa 1
1981 ~~~~~
1982 @subsubsection occt_draw_4_3_27 vshaderprog
1983
1984 Syntax:
1985 ~~~~~
1986 vshaderprog [name] pathToVertexShader pathToFragmentShader
1987 ~~~~~
1988
1989 Enables rendering using a shader program.
1990
1991 @subsubsection occt_draw_4_3_28 vsetcolorbg
1992
1993 Syntax:
1994 ~~~~~
1995 vsetcolorbg r g b
1996 ~~~~~
1997
1998 Sets background color.
1999
2000 **Example:**
2001 ~~~~~
2002 vinit
2003 vsetcolorbg 200 0 200
2004 ~~~~~
2005
2006 @subsection occt_draw_4_4 AIS viewer – object commands
2007
2008 @subsubsection occt_draw_4_4_1 vtrihedron
2009
2010 Syntax:                  
2011 ~~~~~
2012 vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
2013 ~~~~~ 
2014
2015 Creates a new *AIS_Trihedron* object. If no argument is set, the default trihedron (0XYZ) is created.
2016  
2017 **Example:** 
2018 ~~~~~
2019 vinit 
2020 vtrihedron tr
2021 ~~~~~ 
2022
2023 @subsubsection occt_draw_4_4_2 vplanetri
2024
2025 Syntax:                  
2026 ~~~~~
2027 vplanetri name
2028 ~~~~~ 
2029
2030 Creates a plane from a trihedron selection. 
2031
2032
2033 @subsubsection occt_draw_4_4_3 vsize
2034
2035 Syntax:                  
2036 ~~~~~
2037 vsize [name] [size]
2038 ~~~~~ 
2039
2040 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.
2041  
2042 **Example:** 
2043 ~~~~~
2044 vinit 
2045 vtrihedron tr1 
2046 vtrihedron tr2 0 0 0 1 0 0 1 0 0 
2047 vsize tr2 400
2048 ~~~~~ 
2049
2050 @subsubsection occt_draw_4_4_4 vaxis
2051
2052 Syntax:                  
2053 ~~~~~
2054 vaxis name [Xa Ya Za Xb Yb Zb]
2055 ~~~~~ 
2056
2057 Creates an axis. If  the values are not defined, an axis is created by interactive selection of two vertices or one edge
2058  
2059 **Example:** 
2060 ~~~~~
2061 vinit 
2062 vtrihedron tr 
2063 vaxis axe1 0 0 0 1 0 0 
2064 ~~~~~
2065
2066 @subsubsection occt_draw_4_4_5 vaxispara
2067
2068 Syntax:                  
2069 ~~~~~
2070 vaxispara nom
2071 ~~~~~ 
2072
2073 Creates an axis by interactive selection of an edge and a vertex. 
2074
2075 @subsubsection occt_draw_4_4_6 vaxisortho
2076
2077 Syntax:                  
2078 ~~~~~
2079 vaxisotrho name
2080 ~~~~~ 
2081
2082 Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge. 
2083
2084 @subsubsection occt_draw_4_4_7 vpoint
2085
2086 Syntax:                  
2087 ~~~~~
2088 vpoint name [Xa Ya Za]
2089 ~~~~~ 
2090
2091 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). 
2092
2093 **Example:** 
2094 ~~~~~
2095 vinit 
2096 vpoint p 0 0 0 
2097 ~~~~~
2098
2099 @subsubsection occt_draw_4_4_8 vplane
2100
2101 Syntax:                  
2102 ~~~~~
2103 vplane name [AxisName] [PointName] 
2104 vplane name [PointName] [PointName] [PointName] 
2105 vplane name [PlaneName] [PointName]
2106 ~~~~~ 
2107
2108 Creates a plane from named or interactively selected entities.
2109  
2110 **Example:** 
2111 ~~~~~
2112 vinit 
2113 vpoint p1 0 50 0 
2114 vaxis axe1 0 0 0 0 0 1 
2115 vtrihedron tr 
2116 vplane plane1 axe1 p1 
2117 ~~~~~
2118
2119 @subsubsection occt_draw_4_4_9 vplanepara
2120
2121 Syntax:                  
2122 ~~~~~
2123 vplanepara name
2124 ~~~~~ 
2125
2126 Creates a plane from interactively selected vertex and face. 
2127
2128 @subsubsection occt_draw_4_4_10 vplaneortho
2129
2130 Syntax:                  
2131 ~~~~~
2132 vplaneortho name
2133 ~~~~~ 
2134
2135 Creates a plane from interactive selected face and coplanar edge. 
2136
2137 @subsubsection occt_draw_4_4_11 vline
2138
2139 Syntax:                  
2140 ~~~~~
2141 vline name [PointName] [PointName] 
2142 vline name [Xa Ya Za Xb Yb Zb]
2143 ~~~~~ 
2144
2145 Creates a line from coordinates, named or interactively selected vertices. 
2146
2147 **Example:** 
2148 ~~~~~
2149 vinit 
2150 vtrihedron tr 
2151 vpoint p1 0 50 0 
2152 vpoint p2 50 0 0 
2153 vline line1 p1 p2 
2154 vline line2 0 0 0 50 0 1 
2155 ~~~~~
2156
2157 @subsubsection occt_draw_4_4_12 vcircle
2158
2159 Syntax:      
2160 ~~~~~
2161 vcircle name [PointName PointName PointName IsFilled] 
2162 vcircle name [PlaneName PointName Radius IsFilled] 
2163 ~~~~~
2164
2165 Creates a circle from named or interactively selected entities.  Parameter IsFilled is defined as 0 or 1.
2166  
2167 **Example:** 
2168 ~~~~~
2169 vinit 
2170 vtrihedron tr 
2171 vpoint p1 0 50 0 
2172 vpoint p2 50 0 0 
2173 vpoint p3 0 0 0 
2174 vcircle circle1 p1 p2 p3 1
2175 ~~~~~ 
2176
2177 @subsubsection occt_draw_4_4_13 vtri2d
2178
2179 Syntax:                  
2180 ~~~~~
2181 vtri2d name
2182 ~~~~~ 
2183
2184 Creates a plane with a 2D trihedron from an interactively selected face. 
2185
2186 @subsubsection occt_draw_4_4_14 vselmode
2187
2188 Syntax:                  
2189 ~~~~~
2190 vselmode [object] mode On/Off
2191 ~~~~~ 
2192
2193 Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects. 
2194 Value *On* is defined as 1 and *Off* – as 0. 
2195
2196 **Example:** 
2197 ~~~~~
2198 vinit 
2199 vpoint p1 0 0 0 
2200 vpoint p2 50 0 0 
2201 vpoint p3 25 40 0 
2202 vtriangle triangle1 p1 p2 p3 
2203 ~~~~~
2204
2205 @subsubsection occt_draw_4_4_15 vconnect, vconnectsh
2206
2207 Syntax:                  
2208 ~~~~~
2209 vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw 
2210 vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw
2211 ~~~~~ 
2212
2213 Creates and displays an object with input location connected to a named entity. 
2214 The difference between these two commands is that the object created by *vconnect* does not support the selection modes different from 0. 
2215
2216 **Example:** 
2217 ~~~~~
2218 Vinitvinit 
2219 vpoint p1 0 0 0 
2220 vpoint p2 50 0 0 
2221 vsegment segment p1 p2 
2222 restore CrankArm.brep obj 
2223 vdisplay obj 
2224 vconnectsh new obj 100100100 1 0 0 0 0 1
2225 ~~~~~ 
2226
2227 @subsubsection occt_draw_4_4_16 vtriangle
2228
2229 Syntax:                  
2230 ~~~~~
2231 vtriangle name PointName PointName PointName
2232 ~~~~~ 
2233
2234 Creates and displays a filled triangle from named points. 
2235
2236 **Example:** 
2237 ~~~~~
2238 vinit 
2239 vpoint p1 0 0 0 
2240 vpoint p2 50 0 0 
2241 vpoint p3 25 40 0 
2242 vtriangle triangle1 p1 p2 p3
2243 ~~~~~ 
2244
2245 @subsubsection occt_draw_4_4_17 vsegment
2246
2247 Syntax:                  
2248 ~~~~~
2249 vsegment name PointName PointName 
2250 ~~~~~
2251
2252 Creates and displays a segment from named points. 
2253
2254 **Example:** 
2255 ~~~~~
2256 Vinit 
2257 vpoint p1 0 0 0 
2258 vpoint p2 50 0 0 
2259 vsegment segment p1 p2 
2260 ~~~~~
2261
2262 @subsubsection occt_draw_4_4_18 vpointcloud
2263
2264 Syntax:
2265 ~~~~~
2266 vpointcloud name shape
2267 ~~~~~
2268
2269 Creates an interactive object for an arbitary set of points from the triangulated shape.
2270
2271 ~~~~~
2272 vpointcloud name x y z r npts {surface|volume}
2273 ~~~~~
2274 Creates an arbitrary set of points (npts) randomly distributed on a spheric surface or within a spheric volume (x y z r).
2275
2276 **Example:**
2277 ~~~~~
2278 vinit
2279 vpointcloud pc 0 0 0 100 100000 surface -randColor
2280 vfit
2281 ~~~~~
2282
2283 @subsubsection occt_draw_4_4_19 vclipplane
2284
2285 Syntax:
2286 ~~~~~
2287 vclipplane maxplanes <view_name> - gets plane limit for the view.
2288 vclipplane create <plane_name> - creates a new plane.
2289 vclipplane delete <plane_name> - delete a plane.
2290 vclipplane clone <source_plane> <plane_name> - clones the plane definition.
2291 vclipplane set/unset <plane_name> object <object list> - sets/unsets the plane for an IO.
2292 vclipplane set/unset <plane_name> view <view list> - sets/unsets plane for a view.
2293 vclipplane change <plane_name> on/off - turns clipping on/off.
2294 vclipplane change <plane_name> equation <a> <b> <c> <d> - changes plane equation.
2295 vclipplane change <plane_name> capping on/off - turns capping on/off.
2296 vclipplane change <plane_name> capping color <r> <g> <b> - sets color.
2297 vclipplane change <plane name> capping texname <texture> - sets texture.
2298 vclipplane change <plane_name> capping texscale <sx> <sy> - sets texture scale.
2299 vclipplane change <plane_name> capping texorigin <tx> <ty> - sets texture origin.
2300 vclipplane change <plane_name> capping texrotate <angle> - sets texture rotation.
2301 vclipplane change <plane_name> capping hatch on/off/<id> - sets hatching mask.
2302 ~~~~~
2303
2304 Manages clipping planes
2305
2306 **Example:**
2307 ~~~~~
2308 vinit
2309 vclipplane create pln1
2310 vclipplane change pln1 equation 1 0 0 -0.1
2311 vclipplane set pln1 view Driver1/Viewer1/View1
2312 box b 100 100 100
2313 vdisplay b
2314 vsetdispmode 1
2315 vfit
2316 vrotate 10 10 10
2317 vselect 100 100
2318 ~~~~~
2319
2320 @subsubsection occt_draw_4_4_20 vdimension
2321
2322 Syntax:
2323 ~~~~~
2324 vdimension name {-angle|-length|-radius|-diameter} -shapes shape1 [shape2 [shape3]]
2325                 [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
2326                 [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
2327                 [-arrow external|internal|fit] [{-arrowlength|-arlen} RealArrowLength]
2328                 [{-arrowangle|-arangle} ArrowAngle(degrees)] [-plane xoy|yoz|zox]
2329                 [-flyout FloatValue -extension FloatValue] [-value CustomNumberValue]
2330                 [-dispunits DisplayUnitsString] [-modelunits ModelUnitsString]
2331                 [-showunits | -hideunits]
2332 ~~~~~
2333
2334 Builds angle, length, radius or diameter dimension interactive object **name**.
2335
2336 **Attension:** length dimension can't be built without working plane.
2337
2338 **Example:** 
2339 ~~~~~
2340 vpoint p1 0 0 0
2341 vpoint p2 50 50 0
2342 vdimension dim1 -length -plane xoy -shapes p1 p2
2343
2344 vpoint p3 100 0 0
2345 vdimension dim2 -angle -shapes p1 p2 p3
2346
2347 vcircle circle p1 p2 p3 0
2348 vdimension dim3 -radius -shapes circle
2349 vfit
2350 ~~~~~
2351
2352 @subsubsection occt_draw_4_4_21 vdimparam
2353
2354 Syntax:
2355 ~~~~~
2356 vdimparam name [-text 3d|2d wf|sh|wireframe|shading IntegerSize]
2357                [-label left|right|hcenter|hfit top|bottom|vcenter|vfit]
2358                [-arrow external|internal|fit]
2359                [{-arrowlength|-arlen} RealArrowLength]
2360                [{-arrowangle|-arangle} ArrowAngle(degrees)]
2361                [-plane xoy|yoz|zox]
2362                [-flyout FloatValue -extension FloatValue]
2363                [-value CustomNumberValue]
2364                [-dispunits DisplayUnitsString]
2365                [-modelunits ModelUnitsString]
2366                [-showunits | -hideunits]
2367 ~~~~~
2368
2369 Sets parameters for angle, length, radius and diameter dimension **name**.
2370
2371 **Example:** 
2372 ~~~~~
2373 vpoint p1 0 0 0
2374 vpoint p2 50 50 0
2375 vdimension dim1 -length -plane xoy -shapes p1 p2
2376 vdimparam dim1 -flyout -15 -arrowlength 4 -showunits -value 10
2377 ~~~~~
2378
2379 @subsubsection occt_draw_4_4_22 vmovedim
2380
2381 Syntax:
2382 ~~~~~
2383 vmovedim [name] [x y z]
2384 ~~~~~
2385
2386 Moves picked or named (if **name** parameter is defined) dimension
2387 to picked mouse position or input point with coordinates **x**,**y**,**z**.
2388 Text label of dimension **name** is moved to position, another parts of dimension
2389 are adjusted.
2390
2391 **Example:** 
2392 ~~~~~
2393 vpoint p1 0 0 0
2394 vpoint p2 50 50 0
2395 vdimension dim1 -length -plane xoy -shapes p1 p2
2396 vmovedim dim1 -10 30 0
2397 ~~~~~
2398
2399
2400 @subsection occt_draw_4_5 AIS viewer – Mesh Visualization Service
2401
2402 **MeshVS** (Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
2403
2404 @subsubsection occt_draw_4_5_1 meshfromstl
2405
2406 Syntax:                  
2407 ~~~~~
2408 meshfromstl meshname file
2409 ~~~~~ 
2410
2411 Creates a *MeshVS_Mesh* object based on STL file data. The object will be displayed immediately.
2412  
2413 **Example:**
2414 ~~~~~ 
2415 meshfromstl mesh myfile.stl
2416 ~~~~~ 
2417
2418 @subsubsection occt_draw_4_5_2 meshdispmode
2419
2420 Syntax:                  
2421 ~~~~~
2422 meshdispmode meshname displaymode
2423 ~~~~~ 
2424
2425 Changes the display mode of object **meshname**. The **displaymode** is integer, which can be:
2426 * *1* for *wireframe*, 
2427 * *2* for *shading* mode, or
2428 * *3* for *shrink* mode. 
2429
2430 **Example:** 
2431 ~~~~~
2432 vinit 
2433 meshfromstl mesh myfile.stl 
2434 meshdispmode mesh 2
2435 ~~~~~ 
2436
2437 @subsubsection occt_draw_4_5_3 meshselmode
2438
2439 Syntax:                  
2440 ~~~~~
2441 meshselmode meshname selectionmode
2442 ~~~~~ 
2443
2444 Changes the selection mode of object **meshname**. The *selectionmode* is integer OR-combination of mode flags. The basic flags are the following: 
2445 * *1* – node selection;
2446 * *2* – 0D elements (not supported in STL); 
2447 * *4* – links (not supported in STL); 
2448 * *8* – faces.
2449  
2450 **Example:** 
2451 ~~~~~
2452 vinit 
2453 meshfromstl mesh myfile.stl 
2454 meshselmode mesh 1
2455 ~~~~~ 
2456
2457 @subsubsection occt_draw_4_5_4 meshshadcolor
2458
2459 Syntax:                  
2460 ~~~~~
2461 meshshadcolor meshname red green blue
2462 ~~~~~ 
2463
2464 Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
2465  
2466 **Example:** 
2467 ~~~~~
2468 vinit 
2469 meshfromstl mesh myfile.stl 
2470 meshshadcolormode mesh 0.5 0.5 0.5
2471 ~~~~~ 
2472
2473 @subsubsection occt_draw_4_5_5 meshlinkcolor
2474
2475 Syntax:                  
2476 ~~~~~
2477 meshlinkcolor meshname red green blue
2478 ~~~~~ 
2479
2480 Changes the color of face borders for object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
2481  
2482 **Example:** 
2483 ~~~~~
2484 vinit 
2485 meshfromstl mesh myfile.stl 
2486 meshlinkcolormode mesh 0.5 0.5 0.5
2487 ~~~~~ 
2488
2489 @subsubsection occt_draw_4_5_6 meshmat
2490
2491 Syntax:                  
2492 ~~~~~
2493 meshmat meshname material
2494 ~~~~~ 
2495
2496 Changes the material of object **meshname**.
2497
2498 *material* is represented with an integer value as follows (equivalent to enumeration *Graphic3d_NameOfMaterial*): 
2499 * *0 - BRASS,* 
2500 * *1 - BRONZE,* 
2501 * *2 - COPPER,* 
2502 * *3 - GOLD,* 
2503 * *4 - PEWTER,* 
2504 * *5 - PLASTER,* 
2505 * *6 - PLASTIC,* 
2506 * *7 - SILVER,* 
2507 * *8 - STEEL,* 
2508 * *9 - STONE,* 
2509 * *10 - SHINY_PLASTIC,* 
2510 * *11 - SATIN,*
2511 * *12 - METALIZED,* 
2512 * *13 - NEON_GNC,* 
2513 * *14 - CHROME,*
2514 * *15 - ALUMINIUM,*
2515 * *16 - OBSIDIAN,* 
2516 * *17 - NEON_PHC,* 
2517 * *18 - JADE,*
2518 * *19 - DEFAULT,* 
2519 * *20 - UserDefined*
2520  
2521 **Example:** 
2522 ~~~~~
2523 vinit 
2524 meshfromstl mesh myfile.stl 
2525 meshmat mesh JADE 
2526 ~~~~~
2527
2528 @subsubsection occt_draw_4_5_7 meshshrcoef
2529
2530 Syntax:                  
2531 ~~~~~
2532 meshshrcoef meshname shrinkcoefficient
2533 ~~~~~ 
2534
2535 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.
2536  
2537 **Example:** 
2538 ~~~~~
2539 vinit 
2540 meshfromstl mesh myfile.stl 
2541 meshshrcoef mesh 0.05
2542 ~~~~~ 
2543
2544 @subsubsection occt_draw_4_5_8 meshshow
2545
2546 Syntax:                  
2547 ~~~~~
2548 meshshow meshname
2549 ~~~~~ 
2550
2551 Displays **meshname** in the viewer (if it is erased).
2552  
2553 **Example:** 
2554 ~~~~~
2555 vinit 
2556 meshfromstl mesh myfile.stl 
2557 meshshow mesh
2558 ~~~~~ 
2559
2560 @subsubsection occt_draw_4_5_9 meshhide
2561
2562 Syntax:                  
2563 ~~~~~
2564 meshhide meshname
2565 ~~~~~ 
2566
2567 Hides **meshname** in the viewer. 
2568
2569 **Example:** 
2570 ~~~~~
2571 vinit 
2572 meshfromstl mesh myfile.stl 
2573 meshhide mesh
2574 ~~~~~ 
2575
2576 @subsubsection occt_draw_4_5_10 meshhidesel
2577
2578 Syntax:                  
2579 ~~~~~
2580 meshhidesel meshname
2581 ~~~~~ 
2582
2583 Hides only selected entities. The other part of **meshname** remains visible. 
2584
2585 @subsubsection occt_draw_4_5_11 meshshowsel
2586
2587 Syntax:                  
2588 ~~~~~
2589 meshshowsel meshname
2590 ~~~~~ 
2591
2592 Shows only selected entities. The other part of **meshname** becomes invisible. 
2593
2594 @subsubsection occt_draw_4_5_12 meshshowall
2595
2596 Syntax:                  
2597 ~~~~~
2598 meshshowall meshname
2599 ~~~~~ 
2600
2601 Changes the state of all entities to visible for **meshname**. 
2602
2603 @subsubsection occt_draw_4_5_13 meshdelete
2604
2605 Syntax:                  
2606 ~~~~~
2607 meshdelete meshname
2608 ~~~~~ 
2609
2610 Deletes MeshVS_Mesh object **meshname**. 
2611
2612 **Example:** 
2613 ~~~~~
2614 vinit 
2615 meshfromstl mesh myfile.stl 
2616 meshdelete mesh 
2617 ~~~~~
2618
2619 @subsection occt_draw_4_6       VIS Viewer commands
2620
2621 A specific plugin with alias *VIS* should be loaded to have access to VIS functionality in DRAW Test Harness:
2622
2623 ~~~~
2624 \> pload VIS
2625 ~~~~
2626
2627 @subsubsection occt_draw_4_6_1  ivtkinit
2628
2629 Syntax:
2630 ~~~~~
2631 ivtkinit
2632 ~~~~~
2633
2634 Creates a window for VTK viewer.
2635
2636 @figure{/user_guides/draw_test_harness/images/draw_image001.png}
2637
2638 @subsection occt_draw_4_6_2     ivtkdisplay
2639
2640 Syntax:
2641 ~~~~~
2642 ivtkdisplay name1 [name2] …[name n]
2643 ~~~~~
2644
2645 Displays named objects.
2646
2647 **Example:** 
2648 ~~~~~
2649 ivtkinit
2650 # create cone
2651 pcone c 5 0 10
2652 ivtkdisplay c
2653 ~~~~~
2654
2655 @figure{/user_guides/draw_test_harness/images/draw_image002.png}
2656
2657 @subsection occt_draw_4_6_3     ivtkerase
2658
2659 Syntax:
2660 ~~~~~
2661 ivtkerase [name1] [name2] … [name n]
2662 ~~~~~
2663
2664 Erases named objects. If no arguments are passed, erases all displayed objects.
2665
2666 **Example:**
2667 ~~~~~
2668 ivtkinit
2669 # create a sphere
2670 psphere s 10
2671 # create a cone
2672 pcone c 5 0 10
2673 # create a cylinder
2674 pcylinder cy 5 10
2675 # display objects
2676 ivtkdisplay s c cy
2677 # erase only the cylinder
2678 ivtkerase cy
2679 # erase the sphere and the cone
2680 ivtkerase s c
2681 ~~~~~
2682
2683 @subsection occt_draw_4_6_4      ivtkfit
2684
2685 Syntax:
2686 ~~~~~
2687 ivtkfit
2688 ~~~~~
2689
2690 Automatic zoom/panning.
2691
2692 @subsection occt_draw_4_6_5     ivtkdispmode
2693
2694 Syntax:
2695 ~~~~~
2696 ivtksetdispmode [name] {0|1}
2697 ~~~~~
2698
2699 Sets display mode for a named object. If no arguments are passed, sets the given display mode for all displayed objects
2700 The possible modes are: 0 (WireFrame) and 1 (Shading).
2701
2702 **Example:**
2703 ~~~~~
2704 ivtkinit
2705 # create a cone
2706 pcone c 5 0 10
2707 # display the cone
2708 ivtkdisplay c
2709 # set shading mode for the cone
2710 ivtksetdispmode c 1
2711 ~~~~~
2712
2713 @figure{/user_guides/draw_test_harness/images/draw_image003.png}
2714  
2715 @subsection occt_draw_4_6_6     ivtksetselmode
2716
2717 Syntax:
2718 ~~~~~
2719 ivtksetselmode [name] mode {0|1}
2720 ~~~~~
2721
2722 Sets selection mode for a named object. If no arguments are passed, sets the given selection mode for all the displayed objects.
2723
2724 **Example:**
2725 ~~~~~
2726 ivtkinit
2727 # load a shape from file
2728 restore CrankArm.brep a
2729 # display the loaded shape
2730 ivtkdisplay a
2731 # set the face selection mode
2732 ivtksetselmode a 4 1
2733 ~~~~~
2734
2735 @figure{/user_guides/draw_test_harness/images/draw_image004.png}
2736  
2737 @subsection occt_draw_4_6_7     ivtkmoveto
2738
2739 Syntax:
2740 ~~~~~
2741 ivtkmoveto x y
2742 ~~~~~
2743
2744 Imitates mouse cursor moving to point with the given display coordinates **x**,**y**.
2745
2746 **Example:**
2747 ~~~~~
2748 ivtkinit
2749 pcone c 5 0 10
2750 ivtkdisplay c
2751 ivtkmoveto 40 50
2752 ~~~~~
2753
2754 @subsection occt_draw_4_6_8     ivtkselect
2755
2756 Syntax:
2757 ~~~~~
2758 ivtkselect x y
2759 ~~~~~
2760
2761 Imitates mouse cursor moving to point with the given display coordinates and performs selection at this point.
2762
2763 **Example:**
2764 ~~~~~
2765 ivtkinit
2766 pcone c 5 0 10
2767 ivtkdisplay c
2768 ivtkselect 40 50
2769 ~~~~~
2770
2771 @subsection occt_draw_4_6_9     ivtkdump
2772
2773 Syntax:
2774 ~~~~~
2775 ivtkdump *filename* [buffer={rgb|rgba|depth}] [width height] [stereoproj={L|R}]
2776 ~~~~~
2777
2778 Dumps the contents of VTK viewer to image. It supports:
2779 * dumping in different raster graphics formats: PNG, BMP, JPEG, TIFF or PNM.
2780 * dumping of different buffers: RGB, RGBA or depth buffer.
2781 * defining of image sizes (width and height in pixels).
2782 * dumping of stereo projections (left or right).
2783
2784 **Example:**
2785 ~~~~~
2786 ivtkinit
2787 pcone c 5 0 10
2788 ivtkdisplay c
2789 ivtkdump D:/ConeSnapshot.png rgb 768 768
2790 ~~~~~
2791
2792 @subsection occt_draw_4_6_10    ivtkbgcolor
2793
2794
2795 Syntax:
2796 ~~~~~
2797 ivtkbgcolor r g b [r2 g2 b2]
2798 ~~~~~
2799
2800 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].
2801
2802 **Example:**
2803 ~~~~~
2804 ivtkinit
2805 ivtkbgcolor 200 220 250
2806 ~~~~~
2807  
2808 @figure{/user_guides/draw_test_harness/images/draw_image005.png}
2809
2810 ~~~~~
2811 ivtkbgcolor 10 30 80 255 255 255
2812 ~~~~~
2813
2814 @figure{/user_guides/draw_test_harness/images/draw_image006.png}
2815
2816
2817 @section occt_draw_5 OCAF commands
2818
2819
2820 This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF). 
2821
2822
2823 @subsection occt_draw_5_1 Application commands
2824
2825
2826 @subsubsection occt_draw_5_1_1 NewDocument
2827
2828 Syntax:       
2829 ~~~~~
2830 NewDocument docname [format]
2831 ~~~~~ 
2832
2833 Creates a new **docname** document with MDTV-Standard or described format. 
2834
2835 **Example:** 
2836 ~~~~~
2837 # Create new document with default (MDTV-Standard) format 
2838 NewDocument D 
2839
2840 # Create new document with BinOcaf format 
2841 NewDocument D2 BinOcaf 
2842 ~~~~~
2843
2844 @subsubsection occt_draw_5_1_2 IsInSession
2845
2846 Syntax:       
2847 ~~~~~
2848 IsInSession path
2849 ~~~~~ 
2850
2851 Returns *0*, if **path** document is managed by the application session, *1* – otherwise. 
2852
2853 **Example:** 
2854 ~~~~~
2855 IsInSession /myPath/myFile.std 
2856 ~~~~~
2857
2858 @subsubsection occt_draw_5_1_3 ListDocuments
2859
2860 Syntax:       
2861 ~~~~~
2862 ListDocuments
2863 ~~~~~ 
2864
2865 Makes a list of documents handled during the session of the application. 
2866
2867
2868 @subsubsection occt_draw_5_1_4 Open
2869
2870 Syntax:       
2871 ~~~~~
2872 Open path docname
2873 ~~~~~ 
2874
2875 Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session. 
2876
2877 **Example:** 
2878 ~~~~~
2879 Open /myPath/myFile.std D
2880 ~~~~~ 
2881
2882 @subsubsection occt_draw_5_1_5 Close
2883
2884 Syntax:       
2885 ~~~~~
2886 Close docname
2887 ~~~~~ 
2888
2889 Closes **docname** document. The document is no longer handled by the applicative session. 
2890
2891 **Example:** 
2892 ~~~~~
2893 Close D 
2894 ~~~~~
2895
2896 @subsubsection occt_draw_5_1_6 Save
2897
2898 Syntax:       
2899 ~~~~~
2900 Save docname
2901 ~~~~~ 
2902
2903 Saves **docname** active document. 
2904
2905 **Example:** 
2906 ~~~~~
2907 Save D 
2908 ~~~~~
2909
2910 @subsubsection occt_draw_5_1_7 SaveAs
2911
2912 Syntax:       
2913 ~~~~~
2914 SaveAs docname path
2915 ~~~~~ 
2916
2917 Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists. 
2918
2919 **Example:** 
2920 ~~~~~
2921 SaveAs D /myPath/myFile.std
2922 ~~~~~ 
2923
2924 @subsection occt_draw_5_2 Basic commands
2925
2926 @subsubsection occt_draw_5_2_1 Label
2927
2928 Syntax:   
2929
2930 ~~~~~
2931 Label docname entry
2932 ~~~~~
2933
2934 Creates the label expressed by <i>\<entry\></i> if it does not exist.
2935
2936 Example
2937 ~~~~~
2938 Label D 0:2
2939 ~~~~~
2940
2941 @subsubsection occt_draw_5_2_2 NewChild
2942
2943 Syntax:   
2944
2945 ~~~~~
2946 NewChild docname [taggerlabel = Root label]
2947 ~~~~~
2948 Finds (or creates) a *TagSource* attribute located at father label of <i>\<taggerlabel\></i> and makes a new child label.
2949
2950 Example
2951 ~~~~~
2952 # Create new child of root label
2953 NewChild D
2954
2955 # Create new child of existing label
2956 Label D 0:2
2957 NewChild D 0:2
2958 ~~~~~
2959
2960 @subsubsection occt_draw_5_2_3 Children
2961
2962 Syntax:  
2963 ~~~~~
2964 Children docname label
2965 ~~~~~
2966 Returns the list of attributes of label.
2967
2968 Example
2969 ~~~~~
2970 Children D 0:2
2971 ~~~~~
2972
2973 @subsubsection occt_draw_5_2_4 ForgetAll
2974
2975 Syntax:   
2976 ~~~~~
2977 ForgetAll docname label
2978 ~~~~~
2979 Forgets all attributes of the label.
2980
2981 Example
2982 ~~~~~
2983 ForgetAll D 0:2
2984 ~~~~~
2985
2986
2987 @subsubsection occt_draw_5_3 Application commands
2988
2989 @subsubsection occt_draw_5_3_1  Main
2990
2991 Syntax:       
2992 ~~~~~
2993 Main docname
2994 ~~~~~ 
2995
2996 Returns the main label of the framework. 
2997
2998 **Example:** 
2999 ~~~~~
3000 Main D 
3001 ~~~~~
3002
3003 @subsubsection occt_draw_5_3_2  UndoLimit
3004
3005 Syntax:       
3006 ~~~~~
3007 UndoLimit docname [value=0]
3008 ~~~~~ 
3009
3010
3011 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 
3012
3013 **Example:** 
3014 ~~~~~
3015 UndoLimit D 100 
3016 ~~~~~
3017
3018 @subsubsection occt_draw_5_3_3  Undo
3019
3020 Syntax:       
3021 ~~~~~
3022 Undo docname [value=1]
3023 ~~~~~ 
3024
3025 Undoes **value** steps. 
3026
3027 **Example:** 
3028 ~~~~~
3029 Undo D 
3030 ~~~~~
3031
3032 @subsubsection occt_draw_5_3_4  Redo
3033
3034 Syntax:       
3035 ~~~~~
3036 Redo docname [value=1]
3037 ~~~~~ 
3038
3039 Redoes **value** steps.
3040  
3041 **Example:** 
3042 ~~~~~
3043 Redo D 
3044 ~~~~~
3045
3046 @subsubsection occt_draw_5_3_5  OpenCommand
3047
3048 Syntax:       
3049 ~~~~~
3050 OpenCommand docname
3051 ~~~~~ 
3052
3053 Opens a new command transaction. 
3054
3055 **Example:**
3056 ~~~~~ 
3057 OpenCommand D
3058 ~~~~~ 
3059
3060 @subsubsection occt_draw_5_3_6  CommitCommand
3061
3062 Syntax:       
3063 ~~~~~
3064 CommitCommand docname
3065 ~~~~~ 
3066
3067 Commits the Command transaction. 
3068
3069 **Example:** 
3070 ~~~~~
3071 CommitCommand D
3072 ~~~~~ 
3073
3074 @subsubsection occt_draw_5_3_7  NewCommand
3075
3076 Syntax:       
3077 ~~~~~
3078 NewCommand docname
3079 ~~~~~ 
3080
3081 This is a short-cut for Commit and Open transaction. 
3082
3083 **Example:** 
3084 ~~~~~
3085 NewCommand D 
3086 ~~~~~
3087
3088 @subsubsection occt_draw_5_3_8  AbortCommand
3089
3090 Syntax:       
3091 ~~~~~
3092 AbortCommand docname
3093 ~~~~~ 
3094
3095 Aborts the Command transaction. 
3096
3097 **Example:** 
3098 ~~~~~
3099 AbortCommand D 
3100 ~~~~~
3101
3102 @subsubsection occt_draw_5_3_9  Copy
3103
3104 Syntax:       
3105 ~~~~~
3106 Copy docname entry Xdocname Xentry
3107 ~~~~~ 
3108
3109 Copies the contents of *entry* to *Xentry*. No links are registered. 
3110
3111 **Example:** 
3112 ~~~~~
3113 Copy D1 0:2 D2 0:4 
3114 ~~~~~
3115
3116 @subsubsection occt_draw_5_3_10  UpdateLink
3117
3118 Syntax:       
3119 ~~~~~
3120 UpdateLink docname [entry] 
3121 ~~~~~
3122
3123 Updates external reference set at *entry*. 
3124
3125 **Example:** 
3126 ~~~~~
3127 UpdateLink D 
3128 ~~~~~
3129
3130 @subsubsection occt_draw_5_3_11  CopyWithLink
3131
3132 Syntax:       
3133 ~~~~~
3134 CopyWithLink docname entry Xdocname Xentry
3135 ~~~~~ 
3136
3137 Aborts the Command transaction. 
3138 Copies the content of *entry* to *Xentry*. The link is registered with an *Xlink* attribute at *Xentry*  label. 
3139
3140 **Example:** 
3141 ~~~~~
3142 CopyWithLink D1 0:2 D2 0:4
3143 ~~~~~ 
3144
3145 @subsubsection occt_draw_5_3_12  UpdateXLinks
3146
3147 Syntax:       
3148 ~~~~~
3149 UpdateXLinks docname entry
3150 ~~~~~ 
3151
3152 Sets modifications on labels impacted by external references to the *entry*. The *document* becomes invalid and must be recomputed 
3153
3154 **Example:** 
3155 ~~~~~
3156 UpdateXLinks D 0:2 
3157 ~~~~~
3158
3159 @subsubsection occt_draw_5_3_13  DumpDocument
3160
3161 Syntax:       
3162 ~~~~~
3163 DumpDocument docname
3164 ~~~~~ 
3165
3166 Displays parameters of *docname* document. 
3167
3168 **Example:** 
3169 ~~~~~
3170 DumpDocument D 
3171 ~~~~~
3172
3173
3174 @subsection occt_draw_5_4  Data Framework commands
3175
3176
3177 @subsubsection occt_draw_5_4_1  MakeDF
3178
3179 Syntax:       
3180 ~~~~~
3181 MakeDF dfname
3182 ~~~~~ 
3183
3184 Creates a new data framework. 
3185
3186 **Example:** 
3187 ~~~~~
3188 MakeDF D 
3189 ~~~~~
3190
3191 @subsubsection occt_draw_5_4_2  ClearDF
3192
3193 Syntax:       
3194 ~~~~~
3195 ClearDF dfname
3196 ~~~~~ 
3197
3198 Clears a data framework. 
3199
3200 **Example:** 
3201 ~~~~~
3202 ClearDF D 
3203 ~~~~~
3204
3205 @subsubsection occt_draw_5_4_3  CopyDF
3206
3207 Syntax:       
3208 ~~~~~
3209 CopyDF dfname1 entry1 [dfname2] entry2
3210 ~~~~~ 
3211
3212 Copies a data framework. 
3213
3214 **Example:** 
3215 ~~~~~
3216 CopyDF D 0:2 0:4 
3217 ~~~~~
3218
3219 @subsubsection occt_draw_5_4_4  CopyLabel
3220
3221 Syntax:       
3222 ~~~~~
3223 CopyLabel dfname fromlabel tolablel
3224 ~~~~~ 
3225
3226 Copies a label. 
3227
3228 **Example:** 
3229 ~~~~~
3230 CopyLabel D1 0:2 0:4 
3231 ~~~~~
3232
3233 @subsubsection occt_draw_5_4_5  MiniDumpDF
3234
3235 Syntax:       
3236 ~~~~~
3237 MiniDumpDF dfname
3238 ~~~~~ 
3239
3240 Makes a mini-dump of a data framework. 
3241
3242 **Example:** 
3243 ~~~~~
3244 MiniDumpDF D 
3245 ~~~~~
3246
3247 @subsubsection occt_draw_5_4_6  XDumpDF
3248
3249 Syntax:       
3250 ~~~~~
3251 XDumpDF dfname
3252 ~~~~~ 
3253
3254 Makes an extended dump of a data framework. 
3255
3256 **Example:** 
3257 ~~~~~
3258 XDumpDF D
3259 ~~~~~ 
3260
3261 @subsection occt_draw_5_5  General attributes commands
3262
3263
3264 @subsubsection occt_draw_5_5_1  SetInteger
3265
3266 Syntax:       
3267 ~~~~~
3268 SetInteger dfname entry value
3269 ~~~~~ 
3270
3271 Finds or creates an Integer attribute at *entry* label and sets *value*. 
3272
3273 **Example:** 
3274 ~~~~~
3275 SetInteger D 0:2 100 
3276 ~~~~~
3277
3278 @subsubsection occt_draw_5_5_2  GetInteger
3279
3280 Syntax:       
3281 ~~~~~
3282 GetInteger dfname entry [drawname]
3283 ~~~~~ 
3284
3285 Gets a value of an Integer attribute at *entry* label and sets it to *drawname* variable, if it is defined. 
3286
3287 **Example:** 
3288 ~~~~~
3289 GetInteger D 0:2 Int1 
3290 ~~~~~
3291
3292 @subsubsection occt_draw_5_5_3  SetReal
3293
3294 Syntax:       
3295 ~~~~~
3296 SetReal dfname entry value
3297 ~~~~~ 
3298
3299 Finds or creates a Real attribute at *entry* label and sets *value*. 
3300
3301 **Example:** 
3302 ~~~~~
3303 SetReal D 0:2 100. 
3304 ~~~~~
3305
3306 @subsubsection occt_draw_5_5_4  GetReal
3307
3308 Syntax:       
3309 ~~~~~
3310 GetReal dfname entry [drawname]
3311 ~~~~~ 
3312
3313 Gets a value of a Real attribute at *entry* label and sets it to *drawname* variable, if it is defined. 
3314
3315 **Example:** 
3316 ~~~~~
3317 GetReal D 0:2 Real1 
3318 ~~~~~
3319
3320 @subsubsection occt_draw_5_5_5  SetIntArray
3321
3322 Syntax:       
3323 ~~~~~
3324 SetIntArray dfname entry lower upper value1 value2 … 
3325 ~~~~~
3326
3327 Finds or creates an IntegerArray attribute at *entry* label with lower and upper bounds and sets **value1*, *value2*... 
3328
3329 **Example:** 
3330 ~~~~~
3331 SetIntArray D 0:2 1 4 100 200 300 400
3332 ~~~~~ 
3333
3334 @subsubsection occt_draw_5_5_6  GetIntArray
3335
3336 Syntax:       
3337 ~~~~~
3338 GetIntArray dfname entry
3339 ~~~~~ 
3340
3341 Gets a value of an *IntegerArray* attribute at *entry* label. 
3342
3343 **Example:** 
3344 ~~~~~
3345 GetIntArray D 0:2
3346 ~~~~~ 
3347
3348 @subsubsection occt_draw_5_5_7  SetRealArray
3349
3350 Syntax:       
3351 ~~~~~
3352 SetRealArray dfname entry lower upper value1 value2 …
3353 ~~~~~ 
3354
3355 Finds or creates a RealArray attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*… 
3356
3357 **Example:** 
3358 ~~~~~
3359 GetRealArray D 0:2 1 4 100. 200. 300. 400. 
3360 ~~~~~
3361
3362 @subsubsection occt_draw_5_5_8  GetRealArray
3363
3364 Syntax:       
3365 ~~~~~
3366 GetRealArray dfname entry
3367 ~~~~~ 
3368
3369 Gets a value of a RealArray attribute at *entry* label. 
3370
3371 **Example:** 
3372 ~~~~~
3373 GetRealArray D 0:2 
3374 ~~~~~
3375
3376 @subsubsection occt_draw_5_5_9  SetComment
3377
3378 Syntax:       
3379 ~~~~~
3380 SetComment dfname entry value
3381 ~~~~~ 
3382
3383 Finds or creates a Comment attribute at *entry* label and sets *value*. 
3384
3385 **Example:** 
3386 ~~~~~
3387 SetComment D 0:2 "My comment"
3388 ~~~~~ 
3389
3390 @subsubsection occt_draw_5_5_10  GetComment
3391
3392 Syntax:       
3393 ~~~~~
3394 GetComment dfname entry
3395 ~~~~~ 
3396
3397 Gets a value of a Comment attribute at *entry* label. 
3398
3399 **Example:** 
3400 ~~~~~
3401 GetComment D 0:2
3402 ~~~~~ 
3403
3404 @subsubsection occt_draw_5_5_11  SetExtStringArray
3405
3406 Syntax:       
3407 ~~~~~
3408 SetExtStringArray dfname entry lower upper value1 value2 …
3409 ~~~~~ 
3410
3411 Finds or creates an *ExtStringArray* attribute at *entry* label with lower and upper bounds and sets *value1*, *value2*… 
3412
3413 **Example:** 
3414 ~~~~~
3415 SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
3416 ~~~~~ 
3417
3418 @subsubsection occt_draw_5_5_12  GetExtStringArray
3419
3420 Syntax:       
3421 ~~~~~
3422 GetExtStringArray dfname entry
3423 ~~~~~ 
3424
3425 Gets a value of an ExtStringArray attribute at *entry* label. 
3426
3427 **Example:** 
3428 ~~~~~
3429 GetExtStringArray D 0:2 
3430 ~~~~~
3431
3432 @subsubsection occt_draw_5_5_13  SetName
3433
3434 Syntax:       
3435 ~~~~~
3436 SetName dfname entry value 
3437 ~~~~~
3438
3439 Finds or creates a Name attribute at *entry* label and sets *value*. 
3440
3441 **Example:** 
3442 ~~~~~
3443 SetName D 0:2 *My name* 
3444 ~~~~~
3445
3446 @subsubsection occt_draw_5_5_14  GetName
3447
3448 Syntax:       
3449 ~~~~~
3450 GetName dfname entry 
3451 ~~~~~
3452
3453 Gets a value of a Name attribute at *entry* label. 
3454
3455 **Example:** 
3456 ~~~~~
3457 GetName D 0:2 
3458 ~~~~~
3459
3460 @subsubsection occt_draw_5_5_15  SetReference
3461
3462 Syntax:       
3463 ~~~~~
3464 SetReference dfname entry reference 
3465 ~~~~~
3466
3467 Creates a Reference attribute at *entry* label and sets *reference*. 
3468
3469 **Example:** 
3470 ~~~~~
3471 SetReference D 0:2 0:4 
3472 ~~~~~
3473
3474 @subsubsection occt_draw_5_5_16  GetReference
3475
3476 Syntax:       
3477 ~~~~~
3478 GetReference dfname entry 
3479 ~~~~~
3480
3481 Gets a value of a Reference attribute at *entry* label. 
3482
3483 **Example:** 
3484 ~~~~~
3485 GetReference D 0:2 
3486 ~~~~~
3487
3488 @subsubsection occt_draw_5_5_17  SetUAttribute
3489
3490 Syntax:       
3491 ~~~~~
3492 SetUAttribute dfname entry localGUID 
3493 ~~~~~
3494
3495 Creates a UAttribute attribute at *entry* label with *localGUID*. 
3496
3497 **Example:** 
3498 ~~~~~
3499 set localGUID "c73bd076-22ee-11d2-acde-080009dc4422" 
3500 SetUAttribute D 0:2 ${localGUID} 
3501 ~~~~~
3502
3503 @subsubsection occt_draw_5_5_18  GetUAttribute
3504
3505 Syntax:       
3506 ~~~~~
3507 GetUAttribute dfname entry loacalGUID 
3508 ~~~~~
3509
3510 Finds a *UAttribute* at *entry* label with *localGUID*. 
3511
3512 **Example:** 
3513 ~~~~~
3514 set localGUID "c73bd076-22ee-11d2-acde-080009dc4422" 
3515 GetUAttribute D 0:2 ${localGUID} 
3516 ~~~~~
3517
3518 @subsubsection occt_draw_5_5_19  SetFunction
3519
3520 Syntax:       
3521 ~~~~~
3522 SetFunction dfname entry ID failure 
3523 ~~~~~
3524
3525 Finds or creates a *Function* attribute at *entry* label with driver ID and *failure* index. 
3526
3527 **Example:** 
3528 ~~~~~
3529 set ID "c73bd076-22ee-11d2-acde-080009dc4422" 
3530 SetFunction D 0:2 ${ID} 1 
3531 ~~~~~
3532
3533 @subsubsection occt_draw_5_5_20  GetFunction
3534
3535 Syntax:       
3536 ~~~~~
3537 GetFunction dfname entry ID failure 
3538 ~~~~~
3539
3540 Finds a Function attribute at *entry* label and sets driver ID to *ID* variable and failure index to *failure* variable. 
3541
3542 **Example:** 
3543 ~~~~~
3544 GetFunction D 0:2 ID failure 
3545 ~~~~~
3546
3547 @subsubsection occt_draw_5_5_21  NewShape
3548
3549 Syntax:       
3550 ~~~~~
3551 NewShape dfname entry [shape] 
3552 ~~~~~
3553
3554 Finds or creates a Shape attribute at *entry* label. Creates or updates the associated *NamedShape* attribute by *shape* if *shape* is defined. 
3555
3556 **Example:** 
3557 ~~~~~
3558 box b 10 10 10 
3559 NewShape D 0:2 b 
3560 ~~~~~
3561
3562 @subsubsection occt_draw_5_5_22  SetShape
3563
3564 Syntax:       
3565 ~~~~~
3566 SetShape dfname entry shape 
3567 ~~~~~
3568
3569 Creates or updates a *NamedShape* attribute at *entry* label by *shape*. 
3570
3571 **Example:** 
3572 ~~~~~
3573 box b 10 10 10 
3574 SetShape D 0:2 b 
3575 ~~~~~
3576
3577 @subsubsection occt_draw_5_5_23  GetShape
3578
3579 Syntax:       
3580 ~~~~~
3581 GetShape2 dfname entry shape 
3582 ~~~~~
3583
3584 Sets a shape from NamedShape attribute associated with *entry* label to *shape* draw variable. 
3585
3586 **Example:** 
3587 ~~~~~
3588 GetShape2 D 0:2 b 
3589 ~~~~~
3590
3591 @subsection occt_draw_5_6  Geometric attributes commands
3592
3593
3594 @subsubsection occt_draw_5_6_1  SetPoint
3595
3596 Syntax:       
3597 ~~~~~
3598 SetPoint dfname entry point
3599 ~~~~~ 
3600
3601 Finds or creates a Point attribute at *entry* label and sets *point* as generated in the associated *NamedShape* attribute. 
3602
3603 **Example:** 
3604 ~~~~~
3605 point p 10 10 10 
3606 SetPoint D 0:2 p 
3607 ~~~~~
3608
3609 @subsubsection occt_draw_5_6_2  GetPoint
3610
3611 Syntax:       
3612 ~~~~~
3613 GetPoint dfname entry [drawname] 
3614 ~~~~~
3615
3616 Gets a vertex from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 
3617
3618 **Example:** 
3619 ~~~~~
3620 GetPoint D 0:2 p 
3621 ~~~~~
3622
3623 @subsubsection occt_draw_5_6_3  SetAxis
3624
3625 Syntax:       
3626 ~~~~~
3627 SetAxis dfname entry axis 
3628 ~~~~~
3629
3630 Finds or creates an Axis attribute at *entry* label and sets *axis* as generated in the associated *NamedShape* attribute. 
3631
3632 **Example:** 
3633 ~~~~~
3634 line l 10 20 30 100 200 300 
3635 SetAxis D 0:2 l 
3636 ~~~~~
3637
3638 @subsubsection occt_draw_5_6_4  GetAxis
3639
3640 Syntax:       
3641 ~~~~~
3642 GetAxis dfname entry [drawname] 
3643 ~~~~~
3644
3645 Gets a line from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 
3646
3647 **Example:** 
3648 ~~~~~
3649 GetAxis D 0:2 l 
3650 ~~~~~
3651
3652 @subsubsection occt_draw_5_6_5  SetPlane
3653
3654 Syntax:       
3655 ~~~~~
3656 SetPlane dfname entry plane 
3657 ~~~~~
3658
3659 Finds or creates a Plane attribute at *entry* label and sets *plane* as generated in the associated *NamedShape* attribute. 
3660
3661 **Example:** 
3662 ~~~~~
3663 plane pl 10 20 30 –1 0 0 
3664 SetPlane D 0:2 pl 
3665 ~~~~~
3666
3667 @subsubsection occt_draw_5_6_6  GetPlane
3668
3669 Syntax:       
3670 ~~~~~
3671 GetPlane dfname entry [drawname] 
3672 ~~~~~
3673
3674 Gets a plane from *NamedShape* attribute at *entry* label and sets it to *drawname* variable, if it is defined. 
3675
3676 **Example:** 
3677 ~~~~~
3678 GetPlane D 0:2 pl 
3679 ~~~~~
3680
3681 @subsubsection occt_draw_5_6_7  SetGeometry
3682
3683 Syntax:       
3684 ~~~~~
3685 SetGeometry dfname entry [type] [shape] 
3686 ~~~~~
3687
3688 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*. 
3689
3690 **Example:** 
3691 ~~~~~
3692 point p 10 10 10 
3693 SetGeometry D 0:2 pnt p 
3694 ~~~~~
3695
3696 @subsubsection occt_draw_5_6_8  GetGeometryType
3697
3698 Syntax:       
3699 ~~~~~
3700 GetGeometryType dfname entry
3701 ~~~~~ 
3702
3703 Gets a geometry type from Geometry attribute at *entry* label. 
3704
3705 **Example:** 
3706 ~~~~~
3707 GetGeometryType D 0:2 
3708 ~~~~~
3709
3710 @subsubsection occt_draw_5_6_9  SetConstraint
3711
3712 Syntax:       
3713 ~~~~~
3714 SetConstraint dfname entry keyword geometrie [geometrie …] 
3715 SetConstraint dfname entry "plane" geometrie 
3716 SetConstraint dfname entry "value" value
3717 ~~~~~  
3718
3719 1. Creates a Constraint attribute at *entry* label and sets *keyword* constraint between geometry(ies). 
3720 *keyword* must be one of the following: 
3721 *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* 
3722 2. Sets plane for the existing constraint. 
3723 3. Sets value for the existing constraint. 
3724
3725 **Example:** 
3726 ~~~~~
3727 SetConstraint D 0:2 "value" 5 
3728 ~~~~~
3729
3730 @subsubsection occt_draw_5_6_10  GetConstraint
3731
3732 Syntax:       
3733 ~~~~~
3734 GetConstraint dfname entry
3735 ~~~~~ 
3736
3737 Dumps a Constraint attribute at *entry* label 
3738
3739 **Example:** 
3740 ~~~~~
3741 GetConstraint D 0:2 
3742 ~~~~~
3743
3744 @subsubsection occt_draw_5_6_11  SetVariable
3745
3746 Syntax:       
3747 ~~~~~
3748 SetVariable dfname entry isconstant(0/1) units 
3749 ~~~~~
3750
3751 Creates a Variable attribute at *entry* label and sets *isconstant* flag and *units* as a string. 
3752
3753 **Example:** 
3754 ~~~~~
3755 SetVariable D 0:2 1 "mm" 
3756 ~~~~~
3757
3758 @subsubsection occt_draw_5_6_12  GetVariable
3759
3760 Syntax:       
3761 ~~~~~
3762 GetVariable dfname entry isconstant units 
3763 ~~~~~
3764
3765 Gets an *isconstant* flag and units of a Variable attribute at *entry* label. 
3766
3767 **Example:** 
3768 ~~~~~
3769 GetVariable D 0:2 isconstant units 
3770 puts "IsConstant=${isconstant}" 
3771 puts "Units=${units}" 
3772 ~~~~~
3773
3774 @subsection occt_draw_5_7  Tree attributes commands
3775
3776
3777 @subsubsection occt_draw_5_7_1  RootNode
3778
3779 Syntax:       
3780 ~~~~~
3781 RootNode dfname treenodeentry [ID]
3782 ~~~~~ 
3783
3784 Returns the ultimate father of *TreeNode* attribute identified by its *treenodeentry* and its *ID* (or default ID, if *ID* is not defined). 
3785
3786
3787 @subsubsection occt_draw_5_7_2  SetNode
3788
3789 Syntax:       
3790 ~~~~~
3791 SetNode dfname treenodeentry [ID]
3792 ~~~~~ 
3793
3794 Creates a *TreeNode* attribute on the *treenodeentry* label with its tree *ID* (or assigns a default ID, if the *ID* is not defined). 
3795
3796
3797 @subsubsection occt_draw_5_7_3  AppendNode
3798
3799 Syntax:       
3800 ~~~~~
3801 AppendNode dfname fatherentry childentry [fatherID]
3802 ~~~~~ 
3803
3804
3805 Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as last child of *fatherentry*. 
3806
3807
3808
3809
3810 @subsubsection occt_draw_5_7_4  PrependNode
3811
3812 Syntax:       
3813 ~~~~~
3814 PrependNode dfname fatherentry childentry [fatherID]
3815 ~~~~~ 
3816
3817
3818 Inserts a *TreeNode* attribute with its tree *fatherID* (or default ID, if *fatherID* is not defined) on *childentry* as first child of *fatherentry*. 
3819
3820
3821 @subsubsection occt_draw_5_7_5  InsertNodeBefore
3822
3823 Syntax:       
3824 ~~~~~
3825 InsertNodeBefore dfname treenodeentry beforetreenode [ID]
3826 ~~~~~ 
3827
3828 Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *beforetreenode* before *treenodeentry*. 
3829
3830
3831 @subsubsection occt_draw_5_7_6  InsertNodeAfter
3832
3833 Syntax:       
3834 ~~~~~
3835 InsertNodeAfter dfname treenodeentry aftertreenode [ID]
3836 ~~~~~ 
3837
3838 Inserts a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) *aftertreenode* after *treenodeentry*. 
3839
3840
3841 @subsubsection occt_draw_5_7_7  DetachNode
3842
3843 Syntax:       
3844 ~~~~~
3845 DetachNode dfname treenodeentry [ID]
3846 ~~~~~ 
3847
3848 Removes a *TreeNode* attribute with tree *ID* (or default ID, if *ID* is not defined) from *treenodeentry*. 
3849
3850
3851 @subsubsection occt_draw_5_7_8  ChildNodeIterate
3852
3853 Syntax:       
3854 ~~~~~
3855 ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
3856 ~~~~~ 
3857
3858
3859 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.
3860  
3861 **Example:** 
3862 ~~~~~
3863 Label D 0:2 
3864 Label D 0:3 
3865 Label D 0:4 
3866 Label D 0:5 
3867 Label D 0:6 
3868 Label D 0:7 
3869 Label D 0:8 
3870 Label D 0:9 
3871
3872 # Set root node 
3873 SetNode D 0:2 
3874
3875 AppendNode D 0:2 0:4 
3876 AppendNode D 0:2 0:5 
3877 PrependNode D 0:4 0:3 
3878 PrependNode D 0:4 0:8 
3879 PrependNode D 0:4 0:9 
3880
3881 InsertNodeBefore D 0:5 0:6 
3882 InsertNodeAfter D 0:4 0:7 
3883
3884 DetachNode D 0:8 
3885
3886
3887 # List all levels 
3888 ChildNodeIterate D 0:2 1 
3889
3890 ==0:4 
3891 ==0:9 
3892 ==0:3 
3893 ==0:7 
3894 ==0:6 
3895 ==0:5 
3896
3897
3898 # List only first levels 
3899 ChildNodeIterate D 0:2 1 
3900
3901 ==0:4 
3902 ==0:7 
3903 ==0:6 
3904 ==0:5 
3905 ~~~~~
3906
3907 @subsubsection occt_draw_5_7_9  InitChildNodeIterator
3908
3909 Syntax:       
3910 ~~~~~
3911 InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
3912 ~~~~~ 
3913
3914
3915 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. 
3916
3917 **Example:** 
3918 ~~~~~
3919 InitChildNodeIterate D 0:5 1 
3920 set aChildNumber 0 
3921 for {set i 1} {$i  100} {incr i} { 
3922     if {[ChildNodeMore] == *TRUE*} { 
3923         puts *Tree node = [ChildNodeValue]* 
3924         incr aChildNumber 
3925         ChildNodeNext 
3926     } 
3927
3928 puts "aChildNumber=$aChildNumber"
3929 ~~~~~ 
3930
3931 @subsubsection occt_draw_5_7_10  ChildNodeMore
3932
3933 Syntax:       
3934 ~~~~~
3935 ChildNodeMore
3936 ~~~~~ 
3937
3938 Returns TRUE if there is a current item in the iteration. 
3939
3940
3941 @subsubsection occt_draw_5_7_11  ChildNodeNext
3942
3943 Syntax:       
3944 ~~~~~
3945 ChildNodeNext
3946 ~~~~~ 
3947
3948 Moves to the next Item. 
3949
3950
3951 @subsubsection occt_draw_5_7_12  ChildNodeValue
3952
3953 Syntax:       
3954 ~~~~~
3955 ChildNodeValue
3956 ~~~~~ 
3957
3958 Returns the current treenode of *ChildNodeIterator*. 
3959
3960
3961 @subsubsection occt_draw_5_7_13  ChildNodeNextBrother
3962
3963 Syntax:       
3964 ~~~~~
3965 ChildNodeNextBrother
3966 ~~~~~ 
3967
3968 Moves to the next *Brother*. If there is none, goes up. This method is interesting only with *allLevels* behavior. 
3969
3970
3971 @subsection occt_draw_5_8   Standard presentation commands
3972
3973
3974 @subsubsection occt_draw_5_8_1  AISInitViewer
3975
3976 Syntax:       
3977 ~~~~~
3978 AISInitViewer docname
3979 ~~~~~ 
3980
3981 Creates and sets *AISViewer* attribute at root label, creates AIS viewer window. 
3982
3983 **Example:** 
3984 ~~~~~
3985 AISInitViewer D 
3986 ~~~~~
3987
3988 @subsubsection occt_draw_5_8_2  AISRepaint
3989
3990 Syntax:       
3991 ~~~~~
3992 AISRepaint docname 
3993 ~~~~~
3994
3995 Updates the AIS viewer window. 
3996
3997 **Example:** 
3998 ~~~~~
3999 AISRepaint D 
4000 ~~~~~
4001
4002 @subsubsection occt_draw_5_8_3  AISDisplay
4003
4004 Syntax:       
4005 ~~~~~
4006 AISDisplay docname entry [not_update] 
4007 ~~~~~
4008
4009 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. 
4010
4011 **Example:** 
4012 ~~~~~
4013 AISDisplay D 0:5 
4014 ~~~~~
4015
4016 @subsubsection occt_draw_5_8_4  AISUpdate
4017
4018 Syntax:       
4019 ~~~~~
4020 AISUpdate docname entry 
4021 ~~~~~
4022
4023 Recomputes a presentation of *AISobject* from *entry* label and applies the visualization setting in AIS viewer. 
4024
4025 **Example:** 
4026 ~~~~~
4027 AISUpdate D 0:5 
4028 ~~~~~
4029
4030 @subsubsection occt_draw_5_8_5  AISErase
4031
4032 Syntax:       
4033 ~~~~~
4034 AISErase docname entry 
4035 ~~~~~
4036
4037 Erases *AISobject* of *entry* label in AIS viewer. 
4038
4039 **Example:** 
4040 ~~~~~
4041 AISErase D 0:5 
4042 ~~~~~
4043
4044 @subsubsection occt_draw_5_8_6  AISRemove
4045
4046 Syntax:       
4047 ~~~~~
4048 AISRemove docname entry 
4049 ~~~~~
4050
4051 Erases *AISobject* of *entry* label in AIS viewer, then *AISobject* is removed from *AIS_InteractiveContext*. 
4052
4053 **Example:** 
4054 ~~~~~
4055 AISRemove D 0:5 
4056 ~~~~~
4057
4058 @subsubsection occt_draw_5_8_7  AISSet
4059
4060 Syntax:       
4061 ~~~~~
4062 AISSet docname entry ID 
4063 ~~~~~
4064
4065 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*). 
4066
4067 **Example:** 
4068 ~~~~~
4069 AISSet D 0:5 NS 
4070 ~~~~~
4071
4072 @subsubsection occt_draw_5_8_8  AISDriver
4073
4074 Syntax:       
4075 ~~~~~
4076 AISDriver docname entry [ID] 
4077 ~~~~~
4078
4079 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*). 
4080
4081 **Example:** 
4082 ~~~~~
4083 # Get Driver GUID 
4084 AISDriver D 0:5 
4085 ~~~~~
4086
4087 @subsubsection occt_draw_5_8_9  AISUnset
4088
4089 Syntax:       
4090 ~~~~~
4091 AISUnset docname entry 
4092 ~~~~~
4093
4094 Deletes *AISPresentation* attribute (if it exists) of an *entry* label. 
4095
4096 **Example:** 
4097 ~~~~~
4098 AISUnset D 0:5 
4099 ~~~~~
4100
4101 @subsubsection occt_draw_5_8_10  AISTransparency
4102
4103 Syntax:       
4104 ~~~~~
4105 AISTransparency docname entry [transparency] 
4106 ~~~~~
4107
4108 Sets (if *transparency* is defined) or gets the value of transparency for *AISPresentation* attribute of an *entry* label. 
4109
4110 **Example:** 
4111 ~~~~~
4112 AISTransparency D 0:5 0.5 
4113 ~~~~~
4114
4115 @subsubsection occt_draw_5_8_11  AISHasOwnTransparency
4116
4117 Syntax:       
4118 ~~~~~
4119 AISHasOwnTransparency docname entry 
4120 ~~~~~
4121
4122 Tests *AISPresentation* attribute of an *entry* label by own transparency. 
4123
4124 **Example:** 
4125 ~~~~~
4126 AISHasOwnTransparency D 0:5 
4127 ~~~~~
4128
4129 @subsubsection occt_draw_5_8_12  AISMaterial
4130
4131 Syntax:       
4132 ~~~~~
4133 AISMaterial docname entry [material] 
4134 ~~~~~
4135
4136 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 <a href="#occt_draw_4_5_6">meshmat</a> command). 
4137
4138 **Example:** 
4139 ~~~~~
4140 AISMaterial D 0:5 5 
4141 ~~~~~
4142
4143 @subsubsection occt_draw_5_8_13  AISHasOwnMaterial
4144
4145 Syntax:       
4146 ~~~~~
4147 AISHasOwnMaterial docname entry 
4148 ~~~~~
4149
4150 Tests *AISPresentation* attribute of an *entry* label by own material. 
4151
4152 **Example:** 
4153 ~~~~~
4154 AISHasOwnMaterial D 0:5 
4155 ~~~~~
4156
4157 @subsubsection occt_draw_5_8_14  AISColor
4158
4159 Syntax:       
4160 ~~~~~
4161 AISColor docname entry [color] 
4162 ~~~~~
4163
4164 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*). 
4165
4166 **Example:** 
4167 ~~~~~
4168 AISColor D 0:5 25 
4169 ~~~~~
4170
4171 @subsubsection occt_draw_5_8_15  AISHasOwnColor
4172
4173 Syntax:       
4174 ~~~~~
4175 AISHasOwnColor docname entry 
4176 ~~~~~
4177
4178 Tests *AISPresentation* attribute of an *entry* label by own color. 
4179
4180 **Example:** 
4181 ~~~~~
4182 AISHasOwnColor D 0:5 
4183 ~~~~~
4184
4185 @section occt_draw_6 Geometry commands
4186
4187 @subsection occt_draw_6_1 Overview
4188
4189 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. 
4190
4191 In the context of Geometry, Draw includes the following types of variable: 
4192
4193   * 2d and 3d points
4194   * The 2d curve, which corresponds to *Curve* in *Geom2d*.
4195   * 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>.
4196   
4197 Draw geometric variables never share data; the *copy* command will always make a complete copy of the content of the variable. 
4198
4199 The following topics are covered in the nine sections of this chapter: 
4200
4201   * **Curve creation** deals with the various types of curves and how to create them.
4202   * **Surface creation** deals with the different types of surfaces and how to create them.
4203   * **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.
4204   * **Geometric transformations** covers translation, rotation, mirror image and point scaling transformations.
4205   * **Curve and Surface Analysis** deals with the commands used to compute points, derivatives and curvatures.
4206   * **Intersections** presents intersections of surfaces and curves.
4207   * **Approximations** deals with creating curves and surfaces from a set of points.
4208   * **Constraints** concerns construction of 2d circles and lines by constraints such as tangency.
4209   * **Display** describes commands to control the display of curves and surfaces.
4210
4211 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. 
4212
4213 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. 
4214
4215 @subsection occt_draw_6_2  Curve creation
4216
4217 This section deals with both points and curves. Types of curves are: 
4218
4219   * Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
4220   * Polar curves such as bezier curves and bspline curves.
4221   * 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.
4222   * NURBS can be created from other curves using *convert* in the *Surface Creation* section.
4223   * Curves can be created from the isoparametric lines of surfaces by the *uiso* and *viso* commands.
4224   * 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.
4225
4226 Curves are displayed with an arrow showing the last parameter. 
4227
4228
4229 @subsubsection occt_draw_6_2_1 point
4230
4231 Syntax:      
4232 ~~~~~
4233 point name x y [z] 
4234 ~~~~~
4235   
4236 Creates a 2d or 3d point, depending on the number of arguments. 
4237
4238 **Example:**
4239 ~~~~~
4240 # 2d point 
4241 point p1 1 2 
4242
4243 # 3d point 
4244 point p2 10 20 -5 
4245 ~~~~~
4246   
4247 @subsubsection occt_draw_6_2_2  line
4248
4249 Syntax:      
4250 ~~~~~
4251 line name x y [z] dx dy [dz]
4252 ~~~~~ 
4253
4254   
4255 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. 
4256
4257 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. 
4258
4259 **Example:** 
4260 ~~~~~
4261 # a 2d line at 45 degrees of the X axis 
4262 line l 2 0 1 1 
4263
4264 # a 3d line through the point 10 0 0 and parallel to Z 
4265 line l 10 0 0 0 0 1 
4266 ~~~~~
4267
4268 @subsubsection occt_draw_6_2_3  circle
4269
4270 Syntax:      
4271 ~~~~~
4272 circle name x y [z [dx dy dz]] [ux uy [uz]] radius
4273 ~~~~~ 
4274
4275 Creates a 2d or a 3d circle. 
4276
4277 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. 
4278
4279 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*. 
4280
4281 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. 
4282
4283 **Example:** 
4284 ~~~~~
4285 # A 2d circle of radius 5 centered at 10,-2 
4286 circle c1 10 -2 5 
4287
4288 # another 2d circle with a user defined origin 
4289 # the point of parameter 0 on this circle will be 
4290 # 1+sqrt(2),1+sqrt(2) 
4291 circle c2 1 1 1 1 2 
4292
4293 # a 3d circle, center 10 20 -5, axis Z, radius 17 
4294 circle c3 10 20 -5 17 
4295
4296 # same 3d circle with axis Y 
4297 circle c4 10 20 -5 0 1 0 17 
4298
4299 # full 3d circle, axis X, origin on Z 
4300 circle c5 10 20 -5 1 0 0 0 0 1 17 
4301 ~~~~~
4302
4303 @subsubsection occt_draw_6_2_4  ellipse
4304
4305 Syntax: 
4306 ~~~~~
4307 ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius 
4308 ~~~~~
4309
4310 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: 
4311
4312 ~~~~~
4313 P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir 
4314 ~~~~~
4315 where: 
4316
4317   * P is the point of parameter *u*,
4318   * *O, Xdir* and *Ydir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
4319  
4320 **Example:**
4321 ~~~~~
4322 # default 2d ellipse 
4323 ellipse e1 10 5 20 10 
4324
4325 # 2d ellipse at angle 60 degree 
4326 ellipse e2 0 0 1 2 30 5 
4327
4328 # 3d ellipse, in the XY plane 
4329 ellipse e3 0 0 0 25 5 
4330
4331 # 3d ellipse in the X,Z plane with axis 1, 0 ,1 
4332 ellipse e4 0 0 0 0 1 0 1 0 1 25 5 
4333 ~~~~~
4334
4335 @subsubsection occt_draw_6_2_5  hyperbola
4336
4337 Syntax:      
4338 ~~~~~
4339 hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
4340 ~~~~~ 
4341
4342 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. 
4343
4344 The Draw hyperbola is parameterized as follows: 
4345 ~~~~~
4346 P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir 
4347 ~~~~~
4348 where: 
4349
4350   * *P* is the point of parameter *U*,
4351   * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *YDirection* of its local coordinate system. 
4352
4353 **Example:** 
4354 ~~~~~
4355 # default 2d hyperbola, with asymptotes 1,1 -1,1 
4356 hyperbola h1 0 0 30 30 
4357
4358 # 2d hyperbola at angle 60 degrees 
4359 hyperbola h2 0 0 1 2 20 20 
4360
4361 # 3d hyperbola, in the XY plane 
4362 hyperbola h3 0 0 0 50 50 
4363 ~~~~~
4364
4365 @subsubsection occt_draw_6_2_6  parabola
4366
4367 Syntax:      
4368 ~~~~~
4369 parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength 
4370 ~~~~~
4371
4372 Creates a 2d or 3d parabola. in the axis system defined by the first arguments. The origin is the apex of the parabola. 
4373
4374 The *Geom_Parabola* is parameterized as follows: 
4375
4376 ~~~~~
4377 P(u) = O + u*u/(4.*F)*XDir + u*YDir 
4378 ~~~~~
4379
4380 where: 
4381   * *P* is the point of parameter *u*,
4382   * *O, XDir* and *YDir* are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
4383   * *F* is the focal length of the parabola.
4384
4385 **Example:** 
4386 ~~~~~
4387 # 2d parabola 
4388 parabola p1 0 0 50 
4389
4390 # 2d parabola with convexity +Y 
4391 parabola p2 0 0 0 1 50 
4392
4393 # 3d parabola in the Y-Z plane, convexity +Z 
4394 parabola p3 0 0 0 1 0 0 0 0 1 50 
4395 ~~~~~
4396
4397 @subsubsection occt_draw_6_2_7  beziercurve, 2dbeziercurve
4398
4399 Syntax:      
4400 ~~~~~
4401 beziercurve name nbpole pole, [weight] 
4402 2dbeziercurve name nbpole pole, [weight]
4403 ~~~~~ 
4404
4405 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. 
4406
4407 **Example:** 
4408 ~~~~~
4409 # a rational 2d bezier curve (arc of circle) 
4410 2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1 
4411
4412 # a 3d bezier curve, not rational 
4413 beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10 
4414 ~~~~~
4415
4416 @subsubsection occt_draw_6_2_8  bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve
4417
4418 Syntax:      
4419 ~~~~~
4420 bsplinecurve   name degree nbknots knot, umult pole, weight
4421 2dbsplinecurve name degree nbknots knot, umult pole, weight
4422
4423 pbsplinecurve   name degree nbknots knot, umult pole, weight (periodic)
4424 2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
4425 ~~~~~
4426
4427 Creates 2d or 3d bspline curves; the **pbsplinecurve** and **2dpbsplinecurve** commands create periodic bspline curves. 
4428
4429 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. 
4430
4431 The table of knots is an increasing sequence of reals without repetition. 
4432 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. 
4433
4434 The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be: 
4435
4436   * For a non periodic curve: Sum of multiplicities - degree + 1
4437   * For a periodic curve: Sum of multiplicities - last multiplicity
4438
4439 **Example:** 
4440 ~~~~~
4441 # a bspline curve with 4 poles and 3 knots 
4442 bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
4443 10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
4444 # a 2d periodic circle (parameter from 0 to 2*pi !!) 
4445 dset h sqrt(3)/2 
4446 2dpbsplinecurve c 2 \ 
4447 4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \ 
4448 0 -h/3 1 \ 
4449 0.5 -h/3 0.5 \ 
4450 0.25 h/6 1 \ 
4451 0 2*h/3 0.5 \ 
4452 -0.25 h/6 1 \ 
4453 -0.5 -h/3 0.5 \ 
4454 0 -h/3 1 
4455 ~~~~~
4456
4457 **Note** that you can create the **NURBS** subset of bspline curves and surfaces by trimming analytical curves and surfaces and executing the command *convert*. 
4458
4459
4460 @subsubsection occt_draw_6_2_9  uiso, viso
4461
4462 Syntax:      
4463 ~~~~~
4464 uiso name surface u 
4465 viso name surface u 
4466 ~~~~~
4467
4468 Creates a U or V isoparametric curve from a surface. 
4469
4470 **Example:** 
4471 ~~~~~
4472 # create a cylinder and extract iso curves 
4473
4474 cylinder c 10 
4475 uiso c1 c pi/6 
4476 viso c2 c 
4477 ~~~~~
4478
4479 **Note** that this cannot be done from offset surfaces.
4480
4481
4482 @subsubsection occt_draw_6_2_10  to3d, to2d
4483
4484 Syntax:      
4485 ~~~~~
4486 to3d name curve2d [plane] 
4487 to2d name curve3d [plane] 
4488 ~~~~~
4489
4490 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. 
4491
4492 **Example:** 
4493 ~~~~~
4494 # the following commands 
4495 circle c 0 0 5 
4496 plane p -2 1 0 1 2 3 
4497 to3d c c p 
4498
4499 # will create the same circle as 
4500 circle c -2 1 0 1 2 3 5 
4501 ~~~~~
4502
4503 See also: **project** 
4504
4505
4506 @subsubsection occt_draw_6_2_11  project
4507
4508 Syntax:      
4509 ~~~~~
4510 project name curve3d surface 
4511 ~~~~~
4512
4513 Computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces. 
4514
4515 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. 
4516
4517 ~~~~~
4518 cylinder c 5 
4519 plane p 0 0 0 0 1 1 
4520 intersect i c p 
4521 project i2d i c 
4522 ~~~~~
4523
4524 @subsection occt_draw_6_3  Surface creation
4525
4526 The following types of surfaces exist: 
4527   * Analytical surfaces: plane, cylinder, cone, sphere, torus;
4528   * Polar surfaces: bezier surfaces, bspline surfaces;
4529   * Trimmed and Offset surfaces;
4530   * Surfaces produced by Revolution and Extrusion, created from curves with the *revsurf* and *extsurf*;
4531   * NURBS surfaces.
4532
4533 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. 
4534
4535 @subsubsection occt_draw_6_3_1  plane
4536
4537 Syntax:      
4538 ~~~~~
4539 plane name [x y z [dx dy dz [ux uy uz]]]
4540 ~~~~~ 
4541
4542 Creates an infinite plane. 
4543
4544 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. 
4545
4546 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*. 
4547
4548 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. 
4549
4550 Note that this definition will be used for all analytical surfaces. 
4551
4552 **Example:** 
4553 ~~~~~
4554 # a plane through the point 10,0,0 perpendicular to X 
4555 # with U direction on Y 
4556 plane p1 10 0 0 1 0 0 0 1 0 
4557
4558 # an horixontal plane with origin 10, -20, -5 
4559 plane p2 10 -20 -5 
4560 ~~~~~
4561
4562 @subsubsection occt_draw_6_3_2  cylinder
4563
4564 Syntax:      
4565 ~~~~~
4566 cylinder name [x y z [dx dy dz [ux uy uz]]] radius 
4567 ~~~~~
4568
4569 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. 
4570
4571 **Example:** 
4572 ~~~~~
4573 # a cylinder on the default Z axis, radius 10 
4574 cylinder c1 10 
4575
4576 # a cylinder, also along the Z axis but with origin 5, 
4577 10, -3 
4578 cylinder c2 5 10 -3 10 
4579
4580 # a cylinder through the origin and on a diagonal 
4581 # with longitude pi/3 and latitude pi/4 (euler angles) 
4582 dset lo pi/3. la pi/4. 
4583 cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo) 
4584 sin(la) 10 
4585 ~~~~~
4586
4587 @subsubsection occt_draw_6_3_3  cone
4588
4589 Syntax:      
4590 ~~~~~
4591 cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius 
4592 ~~~~~
4593 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. 
4594
4595 **Example:** 
4596 ~~~~~
4597 # a cone at 45 degrees at the origin on Z 
4598 cone c1 45 0 
4599
4600 # a cone on axis Z with radius r1 at z1 and r2 at z2 
4601 cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1 
4602 ~~~~~
4603
4604 @subsubsection occt_draw_6_3_4  sphere
4605
4606 Syntax:      
4607 ~~~~~
4608 sphere name [x y z [dx dy dz [ux uy uz]]] radius 
4609 ~~~~~
4610
4611 Creates a sphere in the local coordinate system defined in the **plane** command. The sphere is centered at the origin. 
4612
4613 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. 
4614
4615 **Example:**
4616 ~~~~~ 
4617 # a sphere at the origin 
4618 sphere s1 10 
4619 # a sphere at 10 10 10, with poles on the axis 1,1,1 
4620 sphere s2 10 10 10 1 1 1 10 
4621 ~~~~~
4622
4623 @subsubsection occt_draw_6_3_5  torus
4624
4625 Syntax:      
4626 ~~~~~
4627 torus name [x y z [dx dy dz [ux uy uz]]] major minor
4628 ~~~~~ 
4629
4630 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. 
4631
4632 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. 
4633
4634 **Example:** 
4635 ~~~~~
4636 # a torus at the origin 
4637 torus t1 20 5 
4638
4639 # a torus in another coordinate system 
4640 torus t2 10 5 -2 2 1 0 20 5 
4641 ~~~~~
4642
4643
4644 @subsubsection occt_draw_6_3_6  beziersurf
4645
4646 Syntax:      
4647 ~~~~~
4648 beziersurf name nbupoles nbvolpes pole, [weight] 
4649 ~~~~~
4650
4651 Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions. 
4652
4653 Then give the poles in the following order: *pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles)* and *pole(nbupoles, nbvpoles)*. 
4654
4655 Weights may be omitted, but if you give one weight you must give all of them. 
4656
4657 **Example:** 
4658 ~~~~~
4659 # a non-rational degree 2,3 surface 
4660 beziersurf s 3 4 \ 
4661 0 0 0 10 0 5 20 0 0 \ 
4662 0 10 2 10 10 3 20 10 2 \ 
4663 0 20 10 10 20 20 20 20 10 \ 
4664 0 30 0 10 30 0 20 30 0 
4665 ~~~~~
4666
4667 @subsubsection occt_draw_6_3_7   bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
4668
4669 Syntax:     
4670 ~~~~~
4671 bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot 
4672 vmult ... x y z w ... 
4673 upbsplinesurf ... 
4674 vpbsplinesurf ... 
4675 uvpbsplinesurf ... 
4676 ~~~~~
4677
4678 * **bsplinesurf** generates bspline surfaces;
4679 * **upbsplinesurf** creates a bspline surface periodic in u; 
4680 * **vpbsplinesurf** creates one periodic in v; 
4681 * **uvpbsplinesurf** creates one periodic in uv. 
4682
4683 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. 
4684
4685 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. 
4686
4687 **Example:** 
4688 ~~~~~
4689 # create a bspline surface of degree 1 2 
4690 # with two knots in U and three in V 
4691 bsplinesurf s \ 
4692 1 2 0 2 1 2 \ 
4693 2 3 0 3 1 1 2 3 \ 
4694 0 0 0 1 10 0 5 1 \ 
4695 0 10 2 1 10 10 3 1 \ 
4696 0 20 10 1 10 20 20 1 \ 
4697 0 30 0 1 10 30 0 1 
4698 ~~~~~
4699
4700
4701 @subsubsection occt_draw_6_3_8  trim, trimu, trimv
4702
4703 Syntax:      
4704 ~~~~~
4705 trim newname name [u1 u2 [v1 v2]] 
4706 trimu newname name 
4707 trimv newname name 
4708 ~~~~~
4709
4710 The **trim** commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom* package. 
4711 * *trim* creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface.
4712 * *trimu* creates a u-trimmed surface, 
4713 * *trimv* creates a v-trimmed surface. 
4714
4715 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. 
4716
4717 **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. 
4718
4719 **Example:** 
4720 ~~~~~
4721 # create a 3d circle 
4722 circle c 0 0 0 10 
4723
4724 # trim it, use the same variable, the original is 
4725 deleted 
4726 trim c c 0 pi/2 
4727
4728 # the original can be recovered! 
4729 trim orc c 
4730
4731 # trim again 
4732 trim c c pi/4 pi/2 
4733
4734 # the original is not the trimmed curve but the basis 
4735 trim orc c 
4736
4737 # as the circle is periodic, the two following commands 
4738 are identical 
4739 trim cc c pi/2 0 
4740 trim cc c pi/2 2*pi 
4741
4742 # trim an infinite cylinder 
4743 cylinder cy 10 
4744 trimv cy cy 0 50 
4745 ~~~~~
4746
4747 @subsubsection occt_draw_6_3_9  offset
4748
4749 Syntax:      
4750 ~~~~~
4751 offset name basename distance [dx dy dz]
4752 ~~~~~ 
4753
4754 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. 
4755
4756 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. 
4757
4758 The offset curve or surface copies the basic geometry, which can be modified later. 
4759
4760 **Example:** 
4761 ~~~~~
4762 # graphic demonstration that the outline of a torus 
4763 # is the offset of an ellipse 
4764 smallview +X+Y 
4765 dset angle pi/6 
4766 torus t 0 0 0 0 cos(angle) sin(angle) 50 20 
4767 fit 
4768 ellipse e 0 0 0 50 50*sin(angle) 
4769 # note that the distance can be negative 
4770 offset l1 e 20 0 0 1 
4771 ~~~~~
4772
4773 @subsubsection occt_draw_6_3_10  revsurf
4774
4775 Syntax:      
4776 ~~~~~
4777 revsurf name curvename x y z dx dy dz
4778 ~~~~~ 
4779
4780 Creates a surface of revolution from a 3d curve. 
4781
4782 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. 
4783
4784 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. 
4785
4786 **Example:** 
4787 ~~~~~
4788 # another way of creating a torus like surface 
4789 circle c 50 0 0 20 
4790 revsurf s c 0 0 0 0 1 0 
4791 ~~~~~
4792
4793 @subsubsection occt_draw_6_3*11  extsurf
4794
4795 Syntax:      
4796 ~~~~~
4797 extsurf newname curvename dx dy dz 
4798 ~~~~~
4799
4800 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. 
4801
4802 In the syntax, *dx,dy,dz* gives the direction of extrusion. 
4803
4804 To parameterize a surface of extrusion: *u* is the parameter along the extruded curve; the *v* parameter is along the direction of extrusion. 
4805
4806 **Example:** 
4807 ~~~~~
4808 # an elliptic cylinder 
4809 ellipse e 0 0 0 10 5 
4810 extsurf s e 0 0 1 
4811 # to make it finite 
4812 trimv s s 0 10 
4813 ~~~~~
4814
4815 @subsubsection occt_draw_6_3_12  convert
4816
4817 Syntax:      
4818 ~~~~~
4819 convert newname name 
4820 ~~~~~
4821
4822 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.
4823  
4824 **Example:** 
4825 ~~~~~
4826 # turn a 2d arc of a circle into a 2d NURBS 
4827 circle c 0 0 5 
4828 trim c c 0 pi/3 
4829 convert c1 c 
4830
4831 # an easy way to make a planar bspline surface 
4832 plane p 
4833 trim p p -1 1 -1 1 
4834 convert p1 p 
4835 ~~~~~
4836
4837 **Note** that offset curves and surfaces are not processed by this command.
4838
4839 @subsection occt_draw_6_4  Curve and surface modifications
4840
4841 Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines. 
4842
4843 General modifications: 
4844
4845   * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**
4846
4847 Modifications for both bezier curves and bsplines: 
4848
4849   * Exchanging U and V on a surface: **exchuv**
4850   * Segmentation: **segment**, **segsur**
4851   * Increasing the degree: **incdeg**, **incudeg**, **incvdeg**
4852   * Moving poles: **cmovep**, **movep**, **movecolp**, **moverowp**
4853
4854 Modifications for bezier curves: 
4855
4856   * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**
4857
4858 Modifications for bspline: 
4859
4860   * Inserting and removing knots: **insertknot**, **remknot**, **insertuknot**, **remuknot**, **insetvknot**, **remvknot**
4861   * Modifying periodic curves and surfaces: **setperiodic**, **setnotperiodic**, **setorigin**, **setuperiodic**, **setunotperiodic**, **setuorigin**, **setvperiodic**, **setvnotperiodic**, **setvorigin**
4862
4863
4864
4865 @subsubsection occt_draw_6_4_1  reverse, ureverse, vreverse
4866
4867
4868 Syntax:            
4869 ~~~~~
4870 reverse curvename 
4871 ureverse surfacename 
4872 vreverse surfacename 
4873 ~~~~~
4874
4875 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. 
4876
4877 **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. 
4878
4879 Reversing a parameter on an analytical surface may create an indirect coordinate system. 
4880
4881 **Example:** 
4882 ~~~~~
4883 # reverse a trimmed 2d circle 
4884 circle c 0 0 5 
4885 trim c c pi/4 pi/2 
4886 reverse c 
4887
4888 # dumping c will show that it is now trimmed between 
4889 # 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4 
4890 ~~~~~
4891
4892 @subsubsection occt_draw_6_4_2  exchuv
4893
4894 Syntax:                 
4895 ~~~~~
4896 exchuv surfacename 
4897 ~~~~~
4898
4899 For a bezier or bspline surface this command exchanges the u and v parameters. 
4900
4901 **Example:** 
4902 ~~~~~
4903 # exchanging u and v on a spline (made from a cylinder) 
4904 cylinder c 5 
4905 trimv c c 0 10 
4906 convert c1 c 
4907 exchuv c1 
4908 ~~~~~
4909
4910 @subsubsection occt_draw_6_4_3  segment, segsur
4911
4912 Syntax:                  
4913 ~~~~~
4914 segment curve Ufirst Ulast 
4915 segsur surface Ufirst Ulast Vfirst Vlast 
4916 ~~~~~
4917
4918 **segment** and **segsur** segment a bezier curve and a bspline curve or surface respectively. 
4919
4920 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*. 
4921
4922 This command must not be confused with **trim** which creates a new geometry. 
4923
4924 **Example:** 
4925 ~~~~~
4926 # segment a bezier curve in half 
4927 beziercurve c 3 0 0 0 10 0 0 10 10 0 
4928 segment c ufirst ulast 
4929 ~~~~~
4930
4931 @subsubsection occt_draw_6_4_4  iincudeg, incvdeg
4932
4933 Syntax:      
4934 ~~~~~
4935 incudeg surfacename newdegree 
4936 incvdeg surfacename newdegree 
4937 ~~~~~
4938
4939 **incudeg** and **incvdeg** increase the degree in the U or V parameter of a bezier or bspline surface.
4940  
4941 **Example:** 
4942 ~~~~~
4943 # make a planar bspline and increase the degree to 2 3 
4944 plane p 
4945 trim p p -1 1 -1 1 
4946 convert p1 p 
4947 incudeg p1 2 
4948 incvdeg p1 3 
4949 ~~~~~
4950
4951 **Note** that the geometry is modified.
4952
4953
4954 @subsubsection occt_draw_6_4_5  cmovep, movep, movecolp, moverowp
4955
4956 Syntax:      
4957 ~~~~~
4958 cmovep curve index dx dy [dz] 
4959 movep surface uindex vindex dx dy dz 
4960 movecolp surface uindex dx dy dz 
4961 moverowp surface vindex dx dy dz 
4962 ~~~~~
4963
4964 **move** methods translate poles of a bezier curve, a bspline curve or a bspline surface. 
4965 * **cmovep** and **movep** translate one pole with a given index. 
4966 * **movecolp** and **moverowp** translate a whole column (expressed by the *uindex*) or row (expressed by the *vindex*) of poles. 
4967
4968 **Example:** 
4969 ~~~~~
4970 # start with a plane 
4971 # transform to bspline, raise degree and add relief 
4972 plane p 
4973 trim p p -10 10 -10 10 
4974 convert p1 p 
4975 incud p1 2 
4976 incvd p1 2 
4977 movecolp p1 2 0 0 5 
4978 moverowp p1 2 0 0 5 
4979 movep p1 2 2 0 0 5 
4980 ~~~~~
4981
4982 @subsubsection occt_draw_6_4_6  insertpole, rempole, remcolpole, remrowpole
4983
4984 Syntax:                  
4985 ~~~~~
4986 insertpole curvename index x y [z] [weight] 
4987 rempole curvename index 
4988 remcolpole surfacename index 
4989 remrowpole surfacename index
4990 ~~~~~ 
4991
4992 **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. 
4993
4994 **rempole** removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves. 
4995
4996 **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. 
4997
4998 **Example:** 
4999 ~~~~~
5000 # start with a segment, insert a pole at end 
5001 # then remove the central pole 
5002 beziercurve c 2 0 0 0 10 0 0 
5003 insertpole c 2 10 10 0 
5004 rempole c 2 
5005 ~~~~~
5006
5007 @subsubsection occt_draw_6_4_7  insertknot, insertuknot, insertvknot
5008
5009 Syntax:                  
5010 ~~~~~
5011 insertknot name knot [mult = 1] [knot mult ...] 
5012 insertuknot surfacename knot mult 
5013 insertvknot surfacename knot mult 
5014 ~~~~~
5015
5016 **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. 
5017
5018 **insertuknot** and **insertvknot** insert knots in a surface. 
5019
5020 **Example:** 
5021 ~~~~~
5022 # create a cylindrical surface and insert a knot 
5023 cylinder c 10 
5024 trim c c 0 pi/2 0 10 
5025 convert c1 c 
5026 insertuknot c1 pi/4 1 
5027 ~~~~~
5028
5029 @subsubsection occt_draw_6_4_8  remknot, remuknot, remvknot
5030
5031 Syntax:      
5032 ~~~~~
5033 remknot index [mult] [tol] 
5034 remuknot index [mult] [tol] 
5035 remvknot index [mult] [tol] 
5036 ~~~~~
5037
5038 **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. 
5039
5040 By default, if no tolerance is given, the knot will always be removed. 
5041
5042 **Example:** 
5043 ~~~~~
5044 # bspline circle, remove a knot 
5045 circle c 0 0 5 
5046 convert c1 c 
5047 incd c1 5 
5048 remknot c1 2 
5049 ~~~~~
5050
5051 **Note** that Curves or Surfaces may be modified.
5052
5053
5054 @subsubsection occt_draw_6_4_9  setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
5055
5056 Syntax:      
5057 ~~~~~
5058 setperiodic curve 
5059 setnotperiodic curve 
5060 setuperiodic surface 
5061 setunotperiodic surface 
5062 setvperiodic surface 
5063 setvnotperiodic surface
5064 ~~~~~ 
5065
5066 **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. 
5067
5068 **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. 
5069
5070 **Example:** 
5071 ~~~~~
5072 # a circle deperiodicized 
5073 circle c 0 0 5 
5074 convert c1 c 
5075 setnotperiodic c1 
5076 ~~~~~
5077
5078 @subsubsection occt_draw_6_4_10  setorigin, setuorigin, setvorigin
5079
5080 Syntax:      
5081 ~~~~~
5082 setorigin curvename index 
5083 setuorigin surfacename index 
5084 setuorigin surfacename index 
5085 ~~~~~
5086
5087 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. 
5088
5089 **Example:** 
5090 ~~~~~
5091 # a torus with new U and V origins 
5092 torus t 20 5 
5093 convert t1 t 
5094 setuorigin t1 2 
5095 setvorigin t1 2
5096 ~~~~~ 
5097
5098
5099 @subsection occt_draw_6_5  Transformations
5100
5101 Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling. 
5102
5103 @subsubsection occt_draw_6_5_1  translate, dtranslate
5104
5105 Syntax:                  
5106 ~~~~~
5107 translate name [names ...] dx dy dz 
5108 2dtranslate name [names ...] dx dy 
5109 ~~~~~
5110
5111 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. 
5112
5113 For 2d points or curves, use the **2dtranslate** command. 
5114
5115 **Example:** 
5116 ~~~~~
5117 # 3d tranlation 
5118 point p 10 20 30 
5119 circle c 10 20 30 5 
5120 torus t 10 20 30 5 2 
5121 translate p c t 0 0 15
5122 ~~~~~
5123  
5124 *NOTE* 
5125 *Objects are modified by this command.* 
5126
5127 @subsubsection occt_draw_6_5_2  rotate, 2drotate
5128
5129 Syntax:      
5130 ~~~~~
5131 rotate name [name ...] x y z dx dy dz angle 
5132 2drotate name [name ...] x y angle
5133 ~~~~~ 
5134
5135 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. 
5136
5137 For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative. 
5138
5139 **Example:** 
5140 ~~~~~
5141 # make a helix of circles. create a scripte file with 
5142 this code and execute it using **source**. 
5143 circle c0 10 0 0 3 
5144 for {set i 1} {$i = 10} {incr i} { 
5145 copy c[expr $i-1] c$i 
5146 translate c$i 0 0 3 
5147 rotate c$i 0 0 0 0 0 1 36 
5148
5149 ~~~~~
5150
5151 @subsubsection occt_draw_6_5_3  pmirror, lmirror, smirror, dpmirror, dlmirror
5152
5153 Syntax:      
5154 ~~~~~
5155 pmirror name [names ...] x y z 
5156 lmirror name [names ...] x y z dx dy dz 
5157 smirror name [names ...] x y z dx dy dz 
5158 2dpmirror name [names ...] x y 
5159 2dlmirror name [names ...] x y dx dy 
5160 ~~~~~
5161
5162 The mirror commands perform a mirror transformation of 2d or 3d geometry. 
5163
5164 * **pmirror** is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. 
5165 * **lmirror** is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry.
5166 * **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. 
5167 * **2dpmirror** is the point mirror in 2D.
5168 * **2dlmirror** is the axis symmetry mirror in 2D.
5169
5170 **Example:** 
5171 ~~~~~
5172 # build 3 images of a torus 
5173 torus t 10 10 10 1 2 3 5 1 
5174 copy t t1 
5175 pmirror t1 0 0 0 
5176 copy t t2 
5177 lmirror t2 0 0 0 1 0 0 
5178 copy t t3 
5179 smirror t3 0 0 0 1 0 0 
5180 ~~~~~
5181
5182 @subsubsection occt_draw_6_5_4  pscale, dpscale
5183
5184 Syntax:                  
5185 ~~~~~
5186 pscale name [name ...] x y z s 
5187 2dpscale name [name ...] x y s 
5188 ~~~~~
5189
5190 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**.
5191
5192  
5193 **Example:** 
5194 ~~~~~
5195 # double the size of a sphere 
5196 sphere s 0 0 0 10 
5197 pscale s 0 0 0 2 
5198 ~~~~~
5199
5200 @subsection occt_draw_6_6  Curve and surface analysis
5201
5202 **Draw** provides methods to compute information about curves and surfaces: 
5203
5204   * **coord** to find the coordinates of a point.
5205   * **cvalue** and **2dcvalue** to compute points and derivatives on curves.
5206   * **svalue** to compute points and derivatives on a surface.
5207   * **localprop** and **minmaxcurandif** to compute the curvature on a curve.
5208   * **parameters** to compute (u,v) values for a point on a surface.
5209   * **proj** and **2dproj** to project a point on a curve or a surface.
5210   * **surface_radius** to compute the curvature on a surface.
5211
5212 @subsubsection occt_draw_6_6_1  coord
5213
5214 Syntax:            
5215 ~~~~~
5216 coord P x y [z] 
5217 ~~~~~
5218
5219 Sets the x, y (and optionally z) coordinates of the point P. 
5220
5221 **Example:** 
5222 ~~~~~
5223 # translate a point 
5224 point p 10 5 5 
5225 translate p 5 0 0 
5226 coord p x y z 
5227 # x value is 15 
5228 ~~~~~
5229
5230
5231 @subsubsection occt_draw_6_6_2   cvalue, 2dcvalue
5232
5233 Syntax:      
5234 ~~~~~
5235 cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]] 
5236 2dcvalue curve U x y [d1x d1y [d2x d2y]] 
5237 ~~~~~
5238
5239 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*. 
5240
5241 **Example:**
5242
5243 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* : 
5244
5245 ~~~~~
5246 2dbeziercurve c 4 0 0 1 1 2 1 3 0 
5247 2dcvalue c 0 x y d1x d1y d2x d2y 
5248
5249 # values of x y d1x d1y d2x d2y 
5250 # are 0 0 3 3 0 -6 
5251 ~~~~~
5252
5253 @subsubsection occt_draw_6_6_3  svalue
5254
5255 Syntax: 
5256 ~~~~~
5257 svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]] 
5258 ~~~~~
5259
5260 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. 
5261
5262 **Example:** 
5263 ~~~~~
5264 # display points on a sphere 
5265 sphere s 10 
5266 for {dset t 0} {[dval t] = 1} {dset t t+0.01} { 
5267 svalue s t*2*pi t*pi-pi/2 x y z 
5268 point . x y z 
5269
5270 ~~~~~
5271
5272 @subsubsection occt_draw_6_6_4  localprop, minmaxcurandinf
5273
5274 Syntax:      
5275 ~~~~~
5276 localprop curvename U 
5277 minmaxcurandinf curve
5278 ~~~~~ 
5279
5280 **localprop** computes the curvature of a curve. 
5281 **minmaxcurandinf** computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve. 
5282
5283 **Example:** 
5284 ~~~~~
5285 # show curvature at the center of a bezier curve 
5286 beziercurve c 3 0 0 0 10 2 0 20 0 0 
5287 localprop c 0.5 
5288 == Curvature : 0.02 
5289 ~~~~~
5290
5291 @subsubsection occt_draw_6_6_5  parameters
5292
5293 Syntax:      
5294 ~~~~~
5295 parameters surf/curve x y z U [V] 
5296 ~~~~~
5297
5298 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. 
5299
5300 **Example:** 
5301 ~~~~~
5302 # Compute parameters on a plane 
5303 plane p 0 0 10 1 1 0 
5304 parameters p 5 5 5 u v 
5305 # the values of u and v are : 0 5 
5306 ~~~~~
5307
5308 @subsubsection occt_draw_6_6_6  proj, dproj
5309
5310 Syntax:      
5311 ~~~~~
5312 proj name x y z 
5313 2dproj name xy 
5314 ~~~~~
5315
5316 Use **proj** to project a point on a 3d curve or a surface and **2dproj** for a 2d curve. 
5317
5318 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, ... *
5319
5320 **Example:** 
5321
5322 Let us project a point on a torus 
5323
5324 ~~~~~
5325 torus t 20 5 
5326 proj t 30 10 7 
5327 == ext_1 ext_2 ext_3 ext_4 
5328 ~~~~~
5329
5330 @subsubsection occt_draw_6_6_7  surface_radius
5331
5332 Syntax:      
5333 ~~~~~
5334 surface_radius surface u v [c1 c2] 
5335 ~~~~~
5336
5337 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*. 
5338
5339 **Example:** 
5340
5341 Let us compute curvatures of a cylinder:
5342
5343 ~~~~~
5344 cylinder c 5 
5345 surface_radius c pi 3 c1 c2 
5346 == Min Radius of Curvature : -5 
5347 == Min Radius of Curvature : infinite 
5348 ~~~~~
5349
5350
5351 @subsection occt_draw_6_7  Intersections
5352
5353 * **intersect** computes intersections of surfaces; 
5354 * **2dintersect** computes intersections of 2d curves.
5355
5356 @subsubsection occt_draw_6_7_1  intersect
5357
5358 Syntax:      
5359 ~~~~~
5360 intersect name surface1 surface2
5361 ~~~~~ 
5362
5363 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*, ... 
5364
5365 **Example:** 
5366 ~~~~~
5367 # create an ellipse 
5368 cone c 45 0 
5369 plane p 0 0 40 0 1 5 
5370 intersect e c p 
5371 ~~~~~
5372
5373 @subsubsection occt_draw_6_7_2  dintersect
5374
5375 Syntax:      
5376 ~~~~~
5377 2dintersect curve1 curve2 
5378 ~~~~~
5379
5380 Displays the intersection points between two 2d curves. 
5381
5382 **Example:** 
5383 ~~~~~
5384 # intersect two 2d ellipses 
5385 ellipse e1 0 0 5 2 
5386 ellipse e2 0 0 0 1 5 2 
5387 2dintersect e1 e2 
5388 ~~~~~
5389
5390 @subsection occt_draw_6_8  Approximations
5391
5392 Draw provides command to create curves and surfaces by approximation. 
5393
5394 * **2dapprox** fits a curve through 2d points; 
5395 * **appro** fits a curve through 3d points;
5396 * **surfapp** and **grilapp** fit a surface through 3d points;
5397 * **2dinterpolate** interpolates a curve. 
5398
5399 @subsubsection occt_draw_6_8_1   appro, dapprox
5400
5401 Syntax:      
5402 ~~~~~
5403 appro result nbpoint [curve] 
5404 2dapprox result nbpoint [curve / x1 y1 x2 y2]
5405 ~~~~~ 
5406
5407 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. 
5408
5409 **Example:** 
5410
5411 Let us pick points and they will be fitted 
5412
5413 ~~~~~
5414 2dapprox c 10 
5415 ~~~~~
5416
5417 @subsubsection occt_draw_6_8_2  surfapp, grilapp
5418
5419
5420 Syntax: 
5421 ~~~~~
5422 surfapp name nbupoints nbvpoints x y z .... 
5423 grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ... 
5424 ~~~~~
5425
5426 * **surfapp** fits a surface through an array of u and v points, nbupoints*nbvpoints. 
5427 * **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. 
5428
5429 **Example:** 
5430 ~~~~~
5431 # a surface using the same data as in the beziersurf 
5432 example sect 4.4 
5433 surfapp s 3 4 \ 
5434 0 0 0 10 0 5 20 0 0 \ 
5435 0 10 2 10 10 3 20 10 2 \ 
5436 0 20 10 10 20 20 20 20 10 \ 
5437 0 30 0 10 30 0 20 30 0 
5438 ~~~~~
5439
5440 @subsection occt_draw_6_9  Constraints
5441
5442 * **cirtang** constructs 2d circles tangent to curves;
5443 * **lintan** constructs 2d lines tangent to curves. 
5444
5445
5446 @subsubsection occt_draw_6_9_1  cirtang
5447
5448 Syntax: 
5449 ~~~~~
5450 cirtang cname curve/point/radius curve/point/radius curve/point/radius 
5451 ~~~~~
5452
5453 Builds all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc. 
5454
5455 **Example:** 
5456 ~~~~~
5457 # a point, a line and a radius. 2 solutions 
5458 point p 0 0 
5459 line 1 10 0 -1 1 
5460 cirtang c p 1 4 
5461 == c_1 c_2 
5462 ~~~~~
5463
5464 @subsubsection occt_draw_6_9_2  lintan
5465
5466 Syntax:      
5467 ~~~~~
5468 lintan name curve curve [angle] 
5469 ~~~~~
5470
5471 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. 
5472
5473 **Example:** 
5474 ~~~~~
5475 # lines tangent to 2 circles, 4 solutions 
5476 circle c1 -10 0 10 
5477 circle c2 10 0 5 
5478 lintan l c1 c2 
5479
5480 # lines at 15 degrees tangent to a circle and a line, 2 
5481 solutions: l1_1 l1_2 
5482 circle c1 -10 0 1 
5483 line l 2 0 1 1 
5484 lintan l1 c1 l 15 
5485 ~~~~~
5486
5487 @subsection occt_draw_6_10  Display
5488
5489 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. 
5490
5491 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. 
5492
5493 On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso** command. 
5494
5495 On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles** and **shpoles** commands. 
5496
5497 On bspline curves and surfaces you can toggle the display of the knots with the **shknots** and **clknots** commands. 
5498
5499
5500 @subsubsection occt_draw_6_10_1  dmod, discr, defle
5501
5502 Syntax:      
5503 ~~~~~
5504 dmode name [name ...] u/d 
5505 discr name [name ...] nbintervals 
5506 defle name [name ...] deflection 
5507 ~~~~~
5508
5509 **dmod** command allows choosing the display mode for a curve or a surface. 
5510
5511 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. 
5512
5513 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). 
5514
5515 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. 
5516
5517 **Example:** 
5518 ~~~~~
5519 # increment the number of points on a big circle 
5520 circle c 0 0 50 50 
5521 discr 100 
5522
5523 # change the mode 
5524 dmode c u 
5525 ~~~~~
5526
5527 @subsubsection occt_draw_6_10_2   nbiso
5528
5529 Syntax:      
5530 ~~~~~
5531 nbiso name [names...] nuiso nviso 
5532 ~~~~~
5533
5534 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. 
5535
5536 **Example:** 
5537
5538 Let us  display 35 meridians and 15 parallels on a sphere:
5539 ~~~~~ 
5540 sphere s 20 
5541 nbiso s 35 15 
5542 ~~~~~
5543
5544 @subsubsection occt_draw_6_10_3  clpoles, shpoles
5545
5546 Syntax:      
5547 ~~~~~
5548 clpoles name 
5549 shpoles name 
5550 ~~~~~
5551
5552 On bezier and bspline curves and surfaces, the control polygon is displayed by default: *clpoles* erases it and *shpoles* restores it. 
5553
5554 **Example:** 
5555
5556 Let us make a bezier curve and erase the poles 
5557
5558 ~~~~~
5559 beziercurve c 3 0 0 0 10 0 0 10 10 0 
5560 clpoles c 
5561 ~~~~~
5562
5563 @subsubsection occt_draw_6_10_4  clknots, shknots
5564
5565 Syntax:   
5566 ~~~~~
5567 clknots name 
5568 shknots name 
5569 ~~~~~
5570
5571 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. 
5572
5573 **Example:** 
5574 ~~~~~
5575 # hide the knots on a bspline curve 
5576 bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
5577 10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
5578 clknots bc
5579 ~~~~~
5580
5581
5582 @section occt_draw_7 Topology commands
5583
5584 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. 
5585
5586 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. 
5587
5588 The <a href="user_guides__modeling_data.html#occt_modat_5">different topological shapes</a> include: 
5589
5590   * **COMPOUND**: A group of any type of topological object.
5591   * **COMPSOLID**: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
5592   * **SOLID**: A part of space limited by shells. It is three dimensional.
5593   * **SHELL**: A set of faces connected by their edges. A shell can be open or closed.
5594   * **FACE**: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
5595   * **WIRE**: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
5596   * **EDGE**: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
5597   * **VERTEX**: A topological element corresponding to a point. It has a zero dimension.
5598
5599 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**). 
5600
5601 The following topics are covered in the eight sections of this chapter: 
5602
5603   * Basic shape commands to handle the structure of shapes and control the display.
5604   * Curve and surface topology, or methods to create topology from geometry and vice versa.
5605   * Primitive construction commands: box, cylinder, wedge etc.
5606   * Sweeping of shapes.
5607   * Transformations of shapes: translation, copy, etc.
5608   * Topological operations, or booleans.
5609   * Drafting and blending.
5610   * Analysis of shapes.
5611
5612
5613 @subsection occt_draw_7_1  Basic topology
5614
5615 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: 
5616
5617   * **isos** and **discretisation** to control display of shape faces by isoparametric curves .
5618   * **orientation**, **complement** and **invert** to modify topological attributes such as orientation.
5619   * **explode**, **exwire** and **nbshapes** to analyze the structure of a shape.
5620   * **emptycopy**, **add**, **compound** to create shapes by stepwise construction.
5621
5622 In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges: 
5623
5624   * a red edge is an isolated edge, which belongs to no faces.
5625   * a green edge is a free boundary edge, which belongs to one face,
5626   * a yellow edge is a shared edge, which belongs to at least two faces.
5627
5628
5629 @subsubsection occt_draw_7_1_1  isos, discretisation
5630
5631 Syntax:                  
5632 ~~~~~
5633 isos [name ...][nbisos] 
5634 discretisation nbpoints
5635 ~~~~~
5636  
5637 Determines or changes the number of isoparametric curves on shapes. 
5638
5639 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. 
5640
5641 *discretisation* changes the default number of points used to display the curves. The default value is 30. 
5642
5643 **Example:** 
5644 ~~~~~
5645 # Display only the edges (the wireframe) 
5646 isos 0 
5647 ~~~~~
5648
5649 **Warning**: don’t confuse *isos* and *discretisation* with the geometric commands *nbisos* and *discr*. 
5650
5651
5652 @subsubsection occt_draw_7_1_2  orientation, complement, invert, normals, range
5653
5654 Syntax:      
5655 ~~~~~
5656 orientation name [name ...] F/R/E/I 
5657 complement name [name ...] 
5658 invert name 
5659 normals s (length = 10), disp normals 
5660 range name value value 
5661 ~~~~~
5662
5663 * **orientation** assigns the orientation of shapes - simple and complex - to one of the following four values: *FORWARD, REVERSED, INTERNAL, EXTERNAL*. 
5664 * **complement** changes the current orientation of shapes to its complement, *FORWARD - REVERSED, INTERNAL - EXTERNAL*. 
5665 * **invert** creates a new shape which is a copy of the original with the orientation all subshapes reversed. For example, it may be useful to reverse the normals of a solid. 
5666 * *normals** returns the assignment of colors to orientation values. 
5667 * **range** defines the length of a selected edge by defining the values of a starting point and an end point.
5668  
5669 **Example:** 
5670 ~~~~~
5671 # to invert normals of a box 
5672 box b 10 20 30 
5673 normals b 5 
5674 invert b 
5675 normals b 5 
5676
5677 # to assign a value to an edge 
5678 box b1 10 20 30 
5679 # to define the box as edges 
5680 explode b1 e 
5681 b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 
5682 # to define as an edge 
5683 makedge e 1 
5684 # to define the length of the edge as starting from 0 
5685 and finishing at 1 
5686 range e 0 1 
5687 ~~~~~
5688
5689 @subsubsection occt_draw_7_1_3  explode, exwire, nbshapes
5690
5691 Syntax:      
5692 ~~~~~
5693 explode name [C/So/Sh/F/W/E/V] 
5694 exwire name 
5695 nbshapes name 
5696 ~~~~~
5697
5698 **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. 
5699
5700 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. 
5701
5702 **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. 
5703
5704 **nbshapes** counts the number of shapes of each type in an entity. 
5705
5706 **Example:** 
5707 ~~~~~
5708 # on a box 
5709 box b 10 20 30 
5710
5711 # whatis returns the type and various information 
5712 whatis b 
5713 = b is a shape SOLID FORWARD Free Modified 
5714
5715 # make one shell 
5716 explode b 
5717 whatis b_1 
5718 = b_1 is a shape SHELL FORWARD Modified Orientable 
5719 Closed 
5720
5721 # extract the edges b_1, ... , b_12 
5722 explode b e 
5723 ==b_1 ... b_12 
5724
5725 # count subshapes 
5726 nbshapes b 
5727 == 
5728 Number of shapes in b 
5729 VERTEX : 8 
5730 EDGE : 12 
5731 WIRE : 6 
5732 FACE : 6 
5733 SHELL : 1 
5734 SOLID : 1 
5735 COMPSOLID : 0 
5736 COMPOUND : 0 
5737 SHAPE : 34 
5738 ~~~~~
5739
5740 @subsubsection occt_draw_7_1_4  emptycopy, add, compound
5741
5742 Syntax:                  
5743 ~~~~~
5744 emptycopy [newname] name 
5745 add name toname 
5746 compound [name ...] compoundname 
5747 ~~~~~
5748
5749 **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. 
5750
5751 **add** inserts shape *C* into shape *S*. Verify that *C* and *S* reference compatible types of objects: 
5752   * Any *Shape* can be added to a *Compound*.
5753   * Only a *Solid* can be added to a *CompSolid*.
5754   * Only a *Shell* can *Edge* or a *Vertex* can be added into a *Solid*.
5755   * Only a *Face* can be added to a *Shell*.
5756   * Only a *Wire* and *Vertex* can be added in a *Solid*.
5757   * Only an *Edge* can be added to a *Wire*.
5758   * Only a *Vertex* can be added to an *Edge*.
5759   * Nothing can be added to a *Vertex*.
5760
5761 **emptycopy** and **add** should be used with care. 
5762
5763 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. 
5764
5765 **Example:** 
5766 ~~~~~
5767 # a compound with three boxes 
5768 box b1 0 0 0 1 1 1 
5769 box b2 3 0 0 1 1 1 
5770 box b3 6 0 0 1 1 1 
5771 compound b1 b2 b3 c 
5772 ~~~~~
5773
5774 @subsubsection occt_draw_7_1_5  checkshape
5775
5776 Syntax:                  
5777 ~~~~~
5778 checkshape [-top] shape [result] [-short] 
5779 ~~~~~
5780
5781 Where: 
5782 * *top* – optional parameter, which allows checking only topological validity of a shape. 
5783 * *shape*– the only required parameter which represents the name of the shape to check. 
5784 * *result* – optional parameter which is the prefix of the output shape names. 
5785 * *short* – a short description of the check. 
5786
5787 **checkshape** examines the selected object for topological and geometric coherence. The object should be a three dimensional shape. 
5788
5789 **Example:** 
5790 ~~~~~
5791 # checkshape returns a comment valid or invalid 
5792 box b1 0 0 0 1 1 1 
5793 checkshape b1 
5794 # returns the comment 
5795 this shape seems to be valid 
5796 ~~~~~
5797
5798 **Note** that this test is performed using the tolerance set in the algorithm.
5799
5800
5801 @subsection occt_draw_7_2  Curve and surface topology
5802
5803 This group of commands is used to create topology from shapes and to extract shapes from geometry. 
5804
5805   * To create vertices, use the **vertex** command.
5806   * To create edges use, the **edge**, **mkedge** commands.
5807   * To create wires, use the **wire**, **polyline**, **polyvertex** commands.
5808   * To create faces, use the **mkplane**, **mkface** commands.
5809   * To extract the geometry from edges or faces, use the **mkcurve** and **mkface** commands.
5810   * To extract the 2d curves from edges or faces, use the **pcurve** command.
5811
5812
5813 @subsubsection occt_draw_7_2_1  vertex
5814
5815 Syntax:      
5816 ~~~~~
5817 vertex name [x y z / p edge] 
5818 ~~~~~
5819
5820 Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge. 
5821
5822 **Example:** 
5823 ~~~~~
5824 vertex v1 10 20 30 
5825 ~~~~~
5826
5827 @subsubsection occt_draw_7_2_2  edge, mkedge, uisoedge, visoedge
5828
5829 Syntax:      
5830 ~~~~~
5831 edge name vertex1 vertex2 
5832 mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]] 
5833 uisoedge edge face u v1 v2 
5834 visoedge edge face v u1 u2 
5835 ~~~~~
5836
5837 * **edge** creates a straight line edge between two vertices. 
5838 * **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. 
5839
5840 **Example:** 
5841 ~~~~~
5842 # straight line edge 
5843 vertex v1 10 0 0 
5844 vertex v2 10 10 0 
5845 edge e1 v1 v2 
5846
5847 # make a circular edge 
5848 circle c 0 0 0 5 
5849 mkedge e2 c 0 pi/2 
5850
5851 # A similar result may be achieved by trimming the curve 
5852 # The trimming is removed by mkedge 
5853 trim c c 0 pi/2 
5854 mkedge e2 c 
5855 ~~~~~
5856
5857 * **visoedge** and **uisoedge** are commands that generate a *uiso* parameter edge or a *viso* parameter edge. 
5858
5859 **Example:** 
5860 ~~~~~
5861 # to create an edge between v1 and v2 at point u 
5862 # to create the example plane 
5863 plane p 
5864 trim p p 0 1 0 1 
5865 convert p p 
5866 incudeg p 3 
5867 incvdeg p 3 
5868 movep p 2 2 0 0 1 
5869 movep p 3 3 0 0 0.5 
5870 mkface p p 
5871 # to create the edge in the plane at the u axis point 
5872 0.5, and between the v axis points v=0.2 and v =0.8 
5873 uisoedge e p 0.5 0.20 0.8 
5874 ~~~~~
5875
5876 @subsubsection occt_draw_7_2_3  wire, polyline, polyvertex
5877
5878 Syntax:      
5879 ~~~~~
5880 wire wirename e1/w1 [e2/w2 ...] 
5881 polyline name x1 y1 z1 x2 y2 z2 ... 
5882 polyvertex name v1 v2 ... 
5883 ~~~~~
5884
5885 **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. 
5886
5887 **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. 
5888
5889 **polyvertex** creates a polygonal wire from vertices. 
5890
5891 **Example:** 
5892 ~~~~~
5893 # create two polygonal wires 
5894 # glue them and define as a single wire 
5895 polyline w1 0 0 0 10 0 0 10 10 0 
5896 polyline w2 10 10 0 0 10 0 0 0 0 
5897 wire w w1 w2 
5898 ~~~~~
5899
5900 @subsubsection occt_draw_7_2_4  profile
5901
5902 Syntax       
5903 ~~~~~
5904 profile name [code values] [code values] ... 
5905 ~~~~~
5906
5907
5908 **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. 
5909
5910
5911 | **Code**     |    **Values **    |       **Action** |
5912 | :------------ | :------------- | :---------------- |
5913 | O                 |                     X Y Z      |          Sets the origin of the plane |
5914 | P                 |         DX DY DZ UX UY UZ  |  Sets the normal and X of the plane |
5915 | F                 |                      X Y    |               Sets the first point |
5916 | X                 |                      DX      |             Translates a point along X |
5917 | Y                 |                      DY       |            Translates a point along Y |
5918 | L                 |                      DL        |            Translates a point along direction |
5919 | XX                |                    X           |           Sets point X coordinate |
5920 | YY                |                    Y           |           Sets point Y coordinate |
5921 | T                 |                      DX DY     |         Translates a point |
5922 | TT                |                     X Y        |           Sets a point |
5923 | R                 |                      Angle     |           Rotates direction |
5924 | RR                |                    Angle       |         Sets direction |
5925 | D                 |                     DX DY      |        Sets direction |
5926 | IX                |                      X         |             Intersects with vertical |
5927 | IY                |                      Y         |             Intersects with horizontal |
5928 | C                 |                Radius Angle    |      Arc of circle tangent to direction |
5929
5930
5931 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. 
5932
5933 The point [code values] can be repeated any number of times and in any order to create the profile contour. 
5934
5935 | Suffix | Action |
5936 | :----- | :----- |
5937 | No suffix  |             Makes a closed face |
5938 | W          |               Make a closed wire |
5939 | WW         |            Make an open wire |
5940
5941 The profile shape definition is the suffix; no suffix produces a face, *w* is a closed wire, *ww* is an open wire. 
5942
5943 Code letters are not case-sensitive. 
5944
5945 **Example:** 
5946 ~~~~~
5947 # to create a trianglular plane using a vertex at the 
5948 origin, in the xy plane 
5949 profile p O 0 0 0 X 1 Y 0 x 1 y 1 
5950 ~~~~~
5951
5952 **Example:** 
5953 ~~~~~
5954 # to create a contour using the different code 
5955 possibilities 
5956
5957 # two vertices in the xy plane 
5958 profile p F 1 0 x 2 y 1 ww 
5959
5960 # to view from a point normal to the plane 
5961 top 
5962
5963 # add a circular element of 45 degrees 
5964 profile p F 1 0 x 2 y 1 c 1 45 ww 
5965
5966 # add a tangential segment with a length value 1 
5967 profile p F 1 0 x 2 y 1 c 1 45 l 1 ww 
5968
5969 # add a vertex with xy values of 1.5 and 1.5 
5970 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 ww 
5971
5972 # add a vertex with the x value 0.2, y value is constant 
5973 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 ww 
5974
5975 # add a vertex with the y value 2 x value is constant 
5976 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 yy 2 ww 
5977
5978 # add a circular element with a radius value of 1 and a circular value of 290 degrees 
5979 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 
5980
5981 # wire continues at a tangent to the intersection x = 0 
5982 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 
5983
5984 # continue the wire at an angle of 90 degrees until it intersects the y axis at y= -o.3 
5985 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 
5986
5987 #close the wire 
5988 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 
5989
5990 # to create the plane with the same contour 
5991 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 
5992 ~~~~~
5993
5994 @subsubsection occt_draw_7_2_5   bsplineprof
5995
5996 Syntax:      
5997 ~~~~~
5998 bsplineprof name [S face] [W WW] 
5999 ~~~~~
6000
6001 * for an edge : \<digitizes\> ... <mouse button 2>
6002 * to end profile : <mouse button 3>
6003
6004 Builds a profile in the XY plane from digitizes. By default the profile is closed and a face is built. 
6005
6006 **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. 
6007
6008 The profile shape definition is the suffix; no suffix produces a face, **w** is a closed wire, **ww** is an open wire. 
6009
6010 **Example:** 
6011 ~~~~~
6012 #to view the xy plane 
6013 top 
6014 #to create a 2d curve with the mouse 
6015 bsplineprof res 
6016 # click mb1 to start the curve 
6017 # click mb1 to create the second vertex 
6018 # click mb1 to create a curve 
6019 == 
6020 #click mb2 to finish the curve and start a new curve 
6021 == 
6022 # click mb1 to create the second curve 
6023 # click mb3 to create the face 
6024 ~~~~~
6025
6026 @subsubsection occt_draw_7_2_6  mkoffset
6027
6028 Syntax:      
6029 ~~~~~
6030 mkoffset result face/compound of wires nboffset stepoffset 
6031 ~~~~~
6032
6033 **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 occurences is not limited. 
6034
6035 The offset distance defines the spacing and the positioning of the occurences. 
6036
6037 **Example:** 
6038 ~~~~~
6039 #Create a box and select a face 
6040 box b 1 2 3 
6041 explode b f 
6042 #Create three exterior parallel contours with an offset 
6043 value of 2 
6044 mkoffset r b_1 3 2 
6045 Create one interior parallel contour with an offset 
6046 value of 
6047 0.4 
6048 mkoffset r b_1 1 -0.4 
6049 ~~~~~
6050
6051 **Note** that *mkoffset* command must be used with prudence, as angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused.
6052
6053 **Example:** 
6054 ~~~~~
6055 # to create the example contour 
6056 profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w 
6057 # to create an incoherent interior offset 
6058 mkoffset r p 1 -0.50 
6059 ==p is not a FACE but a WIRE 
6060 BRepFill_TrimEdgeTool: incoherent intersection 
6061 # to create two incoherent wires 
6062 mkoffset r p 1 -0.50 
6063 ~~~~~
6064
6065 @subsubsection occt_draw_7_2_7  mkplane, mkface
6066
6067 Syntax:      
6068 ~~~~~
6069 mkplane name wire 
6070 mkface name surface [ufirst ulast vfirst vlast] 
6071 ~~~~~
6072
6073 **mkplane** generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire. 
6074
6075 **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. 
6076
6077 **Example:** 
6078 ~~~~~
6079 # make a polygonal face 
6080 polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0 
6081 mkplane f f 
6082
6083 # make a cylindrical face 
6084 cylinder g 10 
6085 trim g g -pi/3 pi/2 0 15 
6086 mkface g g 
6087 ~~~~~
6088
6089 @subsubsection occt_draw_7_2_8  mkcurve, mksurface
6090
6091 Syntax:      
6092 ~~~~~
6093 mkcurve curve edge 
6094 mksurface name face 
6095 ~~~~~
6096
6097 **mkcurve** creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries. 
6098
6099 **mksurface** creates a surface from a face. The surface will not be trimmed. 
6100
6101 **Example:** 
6102 ~~~~~
6103 # make a line 
6104 vertex v1 0 0 0 
6105 vertex v2 10 0 0 
6106 edge e v1 v2 
6107 ~~~~~
6108
6109 @subsubsection occt_draw_7_2_9  pcurve
6110
6111 Syntax:      
6112
6113 ~~~~~
6114 pcurve [name edgename] facename 
6115 ~~~~~
6116
6117 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. 
6118
6119 **Example:** 
6120 ~~~~~
6121 # view the pcurves of a face 
6122 plane p 
6123 trim p p -1 1 -1 1 
6124 mkface p p 
6125 av2d; # a 2d view 
6126 pcurve p 
6127 2dfit 
6128 ~~~~~
6129
6130 @subsubsection occt_draw_7_2_10  chfi2d
6131
6132 Syntax:      
6133 ~~~~~
6134 chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) .... 
6135 ~~~~~
6136
6137
6138 Creates chamfers and fillets on 2D objects. Select two adjacent edges and: 
6139   * a radius value
6140   * two respective distance values
6141   * a distance value and an angle
6142
6143 The radius value produces a fillet between the two faces. 
6144
6145 The distance is the length value from the edge between the two selected faces in a normal direction. 
6146
6147 **Example:** 
6148
6149 Let us create a 2d fillet: 
6150
6151 ~~~~~
6152 top 
6153 profile p x 2 y 2 x -2 
6154 chfi2d cfr p . . F 0.3 
6155 ==Pick an object 
6156 #select an edge 
6157 ==Pick an object 
6158 #select an edge 
6159 ~~~~~
6160
6161 Let us create a 2d chamfer using two distances:
6162  
6163 ~~~~~
6164 profile p x 2 y 2 x -2 
6165 chfi2d cfr p . . CDD 0.3 0.6 
6166 ==Pick an object 
6167 #select an edge 
6168 ==Pick an object 
6169 #select an edge 
6170 ~~~~~
6171
6172 Let us create a 2d chamfer using a defined distance and angle 
6173
6174 ~~~~~
6175 top 
6176 profile p x 2 y 2 x -2 
6177 chfi2d cfr p . . CDA 0.3 75 
6178 ==Pick an object 
6179 #select an edge 
6180 ==Pick an object 
6181 #select an edge 
6182 ~~~~~
6183
6184 @subsubsection occt_draw_7_2_11  nproject
6185
6186 Syntax:      
6187 ~~~~~
6188 nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol 
6189 [continuity [maxdeg [maxseg]]] 
6190 ~~~~~
6191
6192 Creates a shape projection which is normal to the target surface. 
6193
6194 **Example:**
6195 ~~~~~
6196 # create a curved surface 
6197 line l 0 0 0 1 0 0 
6198 trim l l 0 2 
6199 convert l l 
6200
6201 incdeg l 3 
6202 cmovep l 1 0 0.5 0 
6203 cmovep l 3 0 0.5 0 
6204 copy l ll 
6205 translate ll 2 -0.5 0 
6206 mkedge e1 l 
6207 mkedge e2 ll 
6208 wire w e1 e2 
6209 prism p w 0 0 3 
6210 donl p 
6211 #display in four views 
6212 mu4 
6213 fit 
6214 # create the example shape 
6215 circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4 
6216 mkedge e c 
6217 donly p e 
6218 # create the normal projection of the shape(circle) 
6219 nproject r e p 
6220 ~~~~~
6221
6222
6223 @subsection occt_draw_7_3  Primitives
6224
6225 Primitive commands make it possible to create simple shapes. They include: 
6226
6227   * **box** and **wedge** commands.
6228   * **pcylinder**, **pcone**, **psphere**, **ptorus** commands.
6229   * **halfspace** command
6230
6231
6232 @subsubsection occt_draw_7_3_1  box, wedge
6233
6234 Syntax:      
6235 ~~~~~
6236 box name [x y z] dx dy dz 
6237 wedge name dx dy dz ltx / xmin zmin xmax xmax 
6238 ~~~~~
6239
6240 **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. 
6241
6242 **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*. 
6243
6244 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. 
6245
6246 **Example:** 
6247 ~~~~~
6248 # a box at the origin 
6249 box b1 10 20 30 
6250
6251 # another box 
6252 box b2 30 30 40 10 20 30 
6253
6254 # a wedge 
6255 wedge w1 10 20 30 5 
6256
6257 # a wedge with a sharp edge (5 faces) 
6258 wedge w2 10 20 30 0 
6259
6260 # a pyramid 
6261 wedge w3 20 20 20 10 10 10 10 
6262 ~~~~~
6263
6264 @subsubsection occt_draw_7_3_2  pcylinder, pcone, psphere, ptorus
6265
6266 Syntax:      
6267 ~~~~~
6268 pcylinder name [plane] radius height [angle] 
6269 pcone name [plane] radius1 radius2 height [angle] 
6270 pcone name [plane] radius1 radius2 height [angle] 
6271 psphere name [plane] radius1 [angle1 angle2] [angle] 
6272 ptorus name [plane] radius1 radius2 [angle1 angle2] [angle] 
6273 ~~~~~
6274
6275 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. 
6276
6277 **pcylinder** creates a cylindrical block with the given radius and height. 
6278
6279 **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. 
6280
6281 **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. 
6282
6283 **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. 
6284
6285 **Example:** 
6286 ~~~~~
6287 # a can shape 
6288 pcylinder cy 5 10 
6289
6290 # a quarter of a truncated cone 
6291 pcone co 15 10 10 90 
6292
6293 # three-quarters of sphere 
6294 psphere sp 10 270 
6295
6296 # half torus 
6297 ptorus to 20 5 0 90 
6298 ~~~~~
6299
6300 @subsubsection occt_draw_7_3_3  halfspace
6301
6302 Syntax:      
6303 ~~~~~
6304 halfspace result face/shell x y z 
6305 ~~~~~
6306
6307 **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. 
6308
6309 **Example:** 
6310 ~~~~~
6311 box b 0 0 0 1 2 3 
6312 explode b f 
6313 ==b_1 b_2 b_3 b_4 b_5 b_6 
6314 halfspace hr b_3 0.5 0.5 0.5 
6315 ~~~~~
6316
6317
6318 @subsection occt_draw_7_4  Sweeping
6319
6320 Sweeping creates shapes by sweeping out a shape along a defined path: 
6321
6322   * **prism** sweeps along a direction.
6323   * **revol** sweeps around an axis.
6324   * **pipe** sweeps along a wire.
6325   * **mksweep** and **buildsweep** are commands to create sweeps by defining the arguments and algorithms.
6326   * **thrusections** creates a sweep from wire in different planes.
6327
6328
6329 @subsubsection occt_draw_7_4_1  prism
6330
6331 Syntax:      
6332 ~~~~~
6333 prism result base dx dy dz [Copy | Inf | SemiInf] 
6334 ~~~~~
6335
6336 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. 
6337
6338 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. 
6339
6340 **Example:** 
6341 ~~~~~
6342 # sweep a planar face to make a solid 
6343 polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0 
6344 mkplane f f 
6345 ~~~~~
6346
6347 @subsubsection occt_draw_7_4_2  revol
6348
6349 Syntax:      
6350 ~~~~~
6351 revol result base x y z dx dy dz angle [Copy] 
6352 ~~~~~
6353
6354 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. 
6355
6356 **Example:** 
6357 ~~~~~
6358 # shell by wire rotation 
6359 polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 
6360 revol s w 20 0 0 0 1 0 90 
6361 ~~~~~
6362
6363
6364 @subsubsection occt_draw_7_4_3  pipe
6365
6366 Syntax:      
6367 ~~~~~
6368 pipe name wire_spine Profile 
6369 ~~~~~
6370
6371 Creates a new shape by sweeping a shape known as the profile along a wire known as the spine. 
6372
6373 **Example:** 
6374 ~~~~~
6375 # sweep a circle along a bezier curve to make a solid 
6376 pipe 
6377
6378 beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0 
6379 mkedge spine spine 
6380 wire spine spine 
6381 circle profile 0 0 0 1 0 0 2 
6382 mkedge profile profile 
6383 wire profile profile 
6384 mkplane profile profile 
6385 pipe p spine profile 
6386 ~~~~~
6387
6388 @subsubsection occt_draw_7_4_4  mksweep, addsweep, setsweep, deletesweep, buildsweep, simulsweep
6389
6390 Syntax:      
6391 ~~~~~
6392 mksweep wire 
6393 addsweep wire[vertex][-M][-C] [auxiilaryshape]
6394 deletesweep wire 
6395 setsweep options [arg1 [arg2 [...]]] 
6396 simulsweep r [n] [option] 
6397 buildsweep [r] [option] [Tol] 
6398 ~~~~~
6399
6400 options are : 
6401  * *-FR* : Tangent and Normal are defined by a Frenet trihedron 
6402  * *-CF* : Tangent is given by Frenet, the Normal is computed to minimize the torsion 
6403  * *-DX Surf* : Tangent and Normal are given by Darboux trihedron, surf must be a shell or a face 
6404  * *-CN dx dy dz* : BiNormal is given by *dx dy dz* 
6405  * *-FX Tx Ty TZ [Nx Ny Nz]* : Tangent and Normal are fixed 
6406  * *-G guide* 
6407
6408 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. 
6409 * **mksweep** initializes the sweep creation and defines the wire to be used as the spine. 
6410 * **addsweep** defines the wire to be used as the profile. 
6411 * **deletesweep** cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire. 
6412 * **setsweep** commands the algorithms used for the construction of the sweep. 
6413 * **simulsweep** can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep. 
6414 * **buildsweep** creates the sweep using the arguments defined by all the commands. 
6415
6416 **Example:** 
6417 ~~~~~
6418 #create a sweep based on a semi-circular wire using the 
6419 Frenet algorithm 
6420 #create a circular figure 
6421 circle c2 0 0 0 1 0 0 10 
6422 trim c2 c2 -pi/2 pi/2 
6423 mkedge e2 c2 
6424 donly e2 
6425 wire w e2 
6426 whatis w 
6427 mksweep w 
6428 # to display all the options for a sweep 
6429 setsweep 
6430 #to create a sweep using the Frenet algorithm where the 
6431 #normal is computed to minimise the torsion 
6432 setsweep -CF 
6433 addsweep w -R 
6434 # to simulate the sweep with a visual approximation 
6435 simulsweep w 3 
6436 ~~~~~
6437
6438 @subsubsection occt_draw_7_4_5  thrusections
6439
6440 Syntax:  
6441 ~~~~~
6442 thrusections [-N] result issolid isruled wire1 wire2 [..wire..] 
6443 ~~~~~
6444
6445 **thrusections** creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices. 
6446 A bezier curve is generated between the vertices of each wire. The option *[-N]* means that no check is made on wires for direction. 
6447
6448 **Example:** 
6449 ~~~~~
6450 #create three wires in three planes 
6451 polyline w1 0 0 0 5 0 0 5 5 0 2 3 0 
6452 polyline w2 0 1 3 4 1 3 4 4 3 1 3 3 
6453 polyline w3 0 0 5 5 0 5 5 5 5 2 3 5 
6454 # create the shape 
6455 thrusections th issolid isruled w1 w2 w3 
6456 ==thrusections th issolid isruled w1 w2 w3 
6457 Tolerances obtenues   -- 3d : 0 
6458 -- 2d : 0 
6459 ~~~~~
6460
6461
6462 @subsection occt_draw_7_5  Topological transformation
6463
6464 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. 
6465
6466   * **tcopy** makes a copy of the structure of a shape.
6467   * **ttranslate**, **trotate**, **tmove**, **reset** move a shape.
6468   * **tmirror**, **tscale** always modify the shape.
6469
6470
6471 @subsubsection occt_draw_7_5_1   tcopy
6472
6473 Syntax: 
6474 ~~~~~
6475 tcopy name toname [name toname ...] 
6476 ~~~~~
6477
6478 Copies the structure of one shape, including the geometry, into another, newer shape. 
6479
6480 **Example:** 
6481 ~~~~~
6482 # create an edge from a curve and copy it 
6483 beziercurve c 3 0 0 0 10 0 0 20 10 0 
6484 mkedge e1 c 
6485 ttranslate e1 0 5 0 
6486 tcopy e1 e2 
6487 ttranslate e2 0 5 0 
6488 # now modify the curve, only e1 and e2 will be modified 
6489 ~~~~~
6490
6491 @subsubsection occt_draw_7_5_2   tmove, treset
6492
6493 Syntax:      
6494 ~~~~~
6495 tmove name [name ...] shape 
6496 reset name [name ...] 
6497 ~~~~~
6498
6499 **tmove** and **reset** modify the location, or the local coordinate system of a shape. 
6500
6501 **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). 
6502
6503 **Example:** 
6504 ~~~~~
6505 # create two boxes 
6506 box b1 10 10 10 
6507 box b2 20 0 0 10 10 10 
6508 # translate the first box 
6509 ttranslate b1 0 10 0 
6510 # and apply the same location to b2 
6511 tmove b2 b1 
6512 # return to original positions 
6513 reset b1 b2 
6514 ~~~~~
6515
6516 @subsubsection occt_draw_7_5_3   ttranslate, trotate
6517
6518 Syntax:      
6519 ~~~~~
6520 ttranslate [name ...] dx dy dz 
6521 trotate [name ...] x y z dx dy dz angle 
6522 ~~~~~
6523
6524 **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. 
6525 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.) 
6526
6527 Locations are very economic in the data structure because multiple occurences of an object share the topological description. 
6528
6529 **Example:** 
6530 ~~~~~
6531 # make rotated copies of a sphere in between two cylinders 
6532 # create a file source toto.tcl 
6533 # toto.tcl code: 
6534 for {set i 0} {$i  360} {incr i 20} { 
6535 copy s s$i 
6536 trotate s$i 0 0 0 0 0 1 $i 
6537
6538
6539 # create two cylinders 
6540 pcylinder c1 30 5 
6541 copy c1 c2 
6542 ttranslate c2 0 0 20 
6543
6544 #create a sphere 
6545 psphere s 3 
6546 ttranslate s 25 0 12.5 
6547
6548 # call the source file for multiple copies 
6549 source toto.tcl 
6550 ~~~~~
6551
6552 @subsubsection occt_draw_7_5_4   tmirror, tscale
6553
6554 Syntax:      
6555 ~~~~~
6556 tmirror name x y z dx dy dz 
6557 tscale name x y z scale 
6558 ~~~~~
6559
6560 * **tmirror** makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. 
6561
6562 * **Tscale** applies a central homotopic mapping to a shape. 
6563
6564 **Example:** 
6565 ~~~~~
6566 # mirror a portion of cylinder about the YZ plane 
6567 pcylinder c1 10 10 270 
6568 copy c1 c2 
6569 tmirror c2 15 0 0 1 0 0 
6570 # and scale it 
6571 tscale c1 0 0 0 0.5 
6572 ~~~~~
6573
6574
6575 @subsection occt_draw_7_6  Old Topological operations
6576
6577   *  **fuse**, **cut**, **common** are boolean operations. 
6578   *  **section**, **psection** compute sections. 
6579   *  **sewing** joins two or more shapes. 
6580
6581
6582 @subsubsection occt_draw_7_6_1  fuse, cut, common
6583
6584 Syntax:      
6585 ~~~~~
6586 fuse name shape1 shape2 
6587 cut name shape1 shape2 
6588 common name shape1 shape2 
6589 ~~~~~
6590
6591 **fuse** creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact. 
6592
6593 **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. 
6594
6595 **common** creates a new shape which contains only what is in common between the two original shapes in their intersection. 
6596
6597 **Example:** 
6598 ~~~~~
6599 # all four boolean operations on a box and a cylinder 
6600
6601 box b 0 -10 5 20 20 10 
6602 pcylinder c 5 20 
6603
6604 fuse s1 b c 
6605 ttranslate s1 40 0 0 
6606
6607 cut s2 b c 
6608 ttranslate s2 -40 0 0 
6609
6610 cut s3 c b 
6611 ttranslate s3 0 40 0 
6612
6613 common s4 b c 
6614 ttranslate s4 0 -40 0 
6615 ~~~~~
6616
6617
6618 @subsubsection occt_draw_7_6_2  section, psection
6619
6620 Syntax:      
6621 ~~~~~
6622 section result shape1 shape2 
6623 psection name shape plane 
6624 ~~~~~
6625
6626 **section** creates a compound object consisting of the edges for the intersection curves on the faces of two shapes. 
6627
6628 **psection** creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane. 
6629
6630 **Example:** 
6631 ~~~~~
6632 # section line between a cylinder and a box 
6633 pcylinder c 10 20 
6634 box b 0 0 5 15 15 15 
6635 trotate b 0 0 0 1 1 1 20 
6636 section s b c 
6637
6638 # planar section of a cone 
6639 pcone c 10 30 30 
6640 plane p 0 0 15 1 1 2 
6641 psection s c p 
6642 ~~~~~
6643
6644 @subsubsection occt_draw_7_6_3  sewing
6645
6646 Syntax:      
6647 ~~~~~
6648 sewing result [tolerance] shape1 shape2 ... 
6649 ~~~~~
6650
6651 **Sewing** joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value. 
6652
6653 **Example:** 
6654 ~~~~~
6655 # create two adjacent boxes 
6656 box b 0 0 0 1 2 3 
6657 box b2 0 2 0 1 2 3 
6658 sewing sr b b2 
6659 whatis sr 
6660 sr is a shape COMPOUND FORWARD Free Modified 
6661 ~~~~~
6662
6663 @subsection occt_draw_7_7  New Topological operations
6664
6665
6666 The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm. 
6667
6668
6669 @subsubsection occt_draw_7_7_1  bparallelmode
6670
6671 * **bparallelmode** enable or disable parallel mode for boolean operations. Sequential computing is used by default.
6672
6673 Syntax: 
6674 ~~~~~
6675 bparallelmode [1/0]
6676
6677 ~~~~~
6678
6679 Without arguments, bparallelmode shows current state of parallel mode for boolean operations.
6680
6681 * *0* Disable parallel mode, 
6682 * *1* Enable parallel mode 
6683
6684 **Example:**
6685 ~~~~~
6686 # Enable parallel mode for boolean operations.
6687 bparallelmode 1
6688
6689 # Show state of parallel mode for boolean operations.
6690 bparallelmode
6691 ~~~~~
6692
6693 @subsubsection occt_draw_7_7_2  bop, bopfuse, bopcut, boptuc, bopcommon
6694
6695 * **bop** defines *shape1* and *shape2* subject to ulterior Boolean operations 
6696 * **bopfuse** creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact. 
6697 * **bopcut** creates a new shape which contains all parts of the second shape but only the first shape without the intersection of the two shapes. 
6698 * **boptuc** is a reverced **bopcut**. 
6699 * **bopcommon** creates a new shape which contains only whatever is in common between the two original shapes in their intersection. 
6700
6701 Syntax:      
6702 ~~~~~
6703 bop shape1 shape2 
6704 bopcommon result 
6705 bopfuse result 
6706 bopcut result 
6707 boptuc result 
6708 ~~~~~
6709
6710 These commands have short variants: 
6711
6712 ~~~~~
6713 bcommon result shape1 shape2 
6714 bfuse result shape1 shape2 
6715 bcut result shape1 shape2 
6716 ~~~~~
6717
6718
6719 **bop** fills data structure (DS) of boolean operation for *shape1* and *shape2*. 
6720 **bopcommon, bopfuse, bopcut, boptuc** commands are used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example:
6721
6722 ~~~~~
6723 bop S1 S2
6724 bopfuse R
6725 ~~~~~ 
6726
6727
6728 **Example:** 
6729
6730 Let us produce all four boolean operations on a box and a cylinder: 
6731
6732 ~~~~~
6733 box b 0 -10 5 20 20 10 
6734 pcylinder c 5 20 
6735
6736 # fills data structure 
6737 bop b c 
6738
6739 bopfuse s1 
6740 ttranslate s1 40 0 0 
6741
6742 bopcut s2 
6743 ttranslate s2 -40 0 0 
6744
6745 boptuc s3 
6746 ttranslate s3 0 40 0 
6747
6748 bopcommon s4 
6749 ttranslate s4 0 -40 0 
6750 ~~~~~
6751
6752 Now use short variants of the commands: 
6753
6754 ~~~~~
6755 bfuse s11 b c 
6756 ttranslate s11 40 0 100 
6757
6758 bcut s12 b c 
6759 ttranslate s12 -40 0 100 
6760
6761 bcommon s14 b c 
6762 ttranslate s14 0 -40 100 
6763 ~~~~~
6764
6765 @subsubsection occt_draw_7_7_3  bopsection
6766
6767 Syntax:      
6768 ~~~~~
6769 bop shape1 shape2 
6770 bopsection result 
6771 ~~~~~
6772
6773 * **bopsection** creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
6774 * **bop** fills data structure (DS) of boolean operation for *shape1* and *shape2*. 
6775 * **bopsection** command used after **bop** command.
6776  
6777 Short variant syntax:      
6778 ~~~~~
6779 bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a] 
6780 ~~~~~
6781
6782 * <i>-2d</i>  -  PCurves are computed on both parts. 
6783 * <i>-2d1</i> - PCurves are computed on first part. 
6784 * <i>-2d2</i> - PCurves are computed on second part. 
6785 * <i>-a</i>  -   built geometries  are approximated. 
6786
6787 **Example:** 
6788
6789 Let us build a section line between a cylinder and a box 
6790 ~~~~~
6791 pcylinder c 10 20 
6792 box b 0 0 5 15 15 15 
6793 trotate b 0 0 0 1 1 1 20 
6794 bop b c 
6795 bopsection s 
6796 # Short variant: 
6797 bsection s2 b c 
6798 ~~~~~
6799
6800 @subsubsection occt_draw_7_7_4  bopcheck, bopargshape
6801
6802 Syntax:      
6803 ~~~~~
6804 bopcheck shape 
6805 bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF] 
6806 ~~~~~
6807
6808 **bopcheck** checks a shape for self-interference. 
6809
6810 **bopargcheck** checks the validity of argument(s) for boolean operations. 
6811
6812 * Boolean Operation - (by default a section is made) : 
6813   * **F** (fuse) 
6814   * **O** (common) 
6815   * **C** (cut) 
6816   * **T** (cut21) 
6817   * **S** (section) 
6818   * **U** (unknown) 
6819 * Test Options - (by default all options are enabled) : 
6820   * **R** (disable small edges (shrank range) test) 
6821   * **F** (disable faces verification test) 
6822   * **T** (disable tangent faces searching test) 
6823   * **V** (disable test possibility to merge vertices) 
6824   * **E** (disable test possibility to merge edges) 
6825   * **I** (disable self-interference test) 
6826   * **P** (disable shape type test) 
6827 * Additional Test Options :
6828   * **B** (stop test on first faulty found) - by default it is off; 
6829   * **F** (full output for faulty shapes) - by default the output is made in a short format.
6830
6831 **Note** that Boolean Operation and Test Options are used only for a couple of argument shapes, except for <b>I</b> and <b>P</b> options that are always used to test a couple of shapes as well as a single shape.
6832
6833 **Example:** 
6834 ~~~~~
6835 # checks a shape on self-interference 
6836 box b1 0 0 0 1 1 1 
6837 bopcheck b1 
6838
6839 # checks the validity of argument for boolean cut operations 
6840 box b2 0 0 0 10 10 10 
6841 bopargcheck b1 b2 -C 
6842 ~~~~~
6843
6844 @subsection occt_draw_7_8  Drafting and blending
6845
6846 Drafting is creation of a new shape by tilting faces through an angle. 
6847
6848 Blending is the creation of a new shape by rounding edges to create a fillet. 
6849
6850   * Use the **depouille** command for drafting.
6851   * Use the **chamf** command to add a chamfer to an edge
6852   * Use the **blend** command for simple blending.
6853   * Use **fubl** for a fusion + blending operation.
6854   * Use **buildevol**, **mkevol**, **updatevol** to realize varying radius blending.
6855
6856
6857 @subsubsection occt_draw_7_8_1  depouille
6858
6859 Syntax: 
6860 ~~~~~
6861 dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...] 
6862 ~~~~~
6863
6864 Creates a new shape by drafting one or more faces of a shape. 
6865
6866 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. 
6867
6868 **Example:** 
6869 ~~~~~
6870 # draft a face of a box 
6871 box b 10 10 10 
6872 explode b f 
6873 == b_1 b_2 b_3 b_4 b_5 b_6 
6874
6875 dep a b 0 0 1 b_2 10 0 10 0 1 0 5 
6876 ~~~~~
6877
6878 @subsubsection occt_draw_7_8_2  chamf
6879
6880 Syntax:      
6881 ~~~~~
6882 chamf newname shape edge face S dist 
6883 chamf newname shape edge face dist1 dist2 
6884 chamf newname shape edge face A dist angle 
6885 ~~~~~
6886
6887 Creates a chamfer along the edge between faces using: 
6888
6889   * a equal distances from the edge
6890   * the edge, a face and distance, a second distance
6891   * the edge, a reference face and an angle
6892
6893 Use the dot syntax to select the faces and edges. 
6894
6895 **Examples:**
6896
6897 Let us create a chamfer based on equal distances from the edge (45 degree angle):
6898 ~~~~~
6899 # create a box 
6900 box b 1 2 3 
6901 chamf ch b . . S 0.5 
6902 ==Pick an object 
6903 # select an edge 
6904 ==Pick an object 
6905 # select an adjacent face 
6906 ~~~~~
6907
6908 Let us create a chamfer based on different distances from the selected edge:
6909 ~~~~~
6910 box b 1 2 3 
6911 chamf ch b . . 0.3 0.4 
6912 ==Pick an object 
6913 # select an edge 
6914 ==Pick an object 
6915 # select an adjacent face
6916 ~~~~~
6917  
6918 Let us create a chamfer based on a distance from the edge and an angle:
6919  
6920 ~~~~~
6921 box b 1 2 3 
6922 chamf ch b . . A 0.4 30 
6923 ==Pick an object 
6924 # select an edge 
6925 ==Pick an object 
6926 # select an adjacent face 
6927 ~~~~~
6928
6929 @subsubsection occt_draw_7_8_3  blend
6930
6931 Syntax:      
6932 ~~~~~
6933 blend result object rad1 ed1 rad2 ed2 ... [R/Q/P] 
6934 ~~~~~
6935
6936 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. 
6937
6938 **Example:** 
6939 ~~~~~
6940 # blend a box, click on an edge 
6941 box b 20 20 20 
6942 blend b b 2 . 
6943 ==tolerance ang : 0.01 
6944 ==tolerance 3d : 0.0001 
6945 ==tolerance 2d : 1e-05 
6946 ==fleche : 0.001 
6947 ==tolblend 0.01 0.0001 1e-05 0.001 
6948 ==Pick an object 
6949 # click on the edge you want ot fillet 
6950
6951 ==COMPUTE: temps total 0.1s dont : 
6952 ==- Init + ExtentAnalyse 0s 
6953 ==- PerformSetOfSurf 0.02s 
6954 ==- PerformFilletOnVertex 0.02s 
6955 ==- FilDS 0s 
6956 ==- Reconstruction 0.06s 
6957 ==- SetRegul 0s 
6958 ~~~~~
6959
6960 @subsubsection occt_draw_7_8_4  fubl
6961
6962 Syntax:      
6963 ~~~~~
6964 fubl name shape1 shape2 radius
6965 ~~~~~ 
6966  
6967 Creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius. 
6968
6969 **Example:** 
6970 ~~~~~
6971 # fuse-blend two boxes 
6972 box b1 20 20 5 
6973 copy b1 b2 
6974 ttranslate b2 -10 10 3 
6975 fubl a b1 b2 1 
6976 ~~~~~
6977
6978
6979 @subsubsection occt_draw_7_8_5  mkevol, updatevol, buildevol
6980
6981 Syntax:      
6982 ~~~~~
6983 mkevol result object (then use updatevol) [R/Q/P] 
6984 updatevol edge u1 radius1 [u2 radius2 ...] 
6985 buildevol 
6986 ~~~~~
6987
6988 These three commands work together to create fillets with evolving radii. 
6989
6990 * **mkevol** allows specifying the shape and the name of the result. It returns the tolerances of the fillet. 
6991 * **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. 
6992 * **buildevol** produces the result described previously in **mkevol** and **updatevol**. 
6993
6994 **Example:** 
6995 ~~~~~
6996 # makes an evolved radius on a box 
6997 box b 10 10 10 
6998 mkevol b b 
6999 ==tolerance ang : 0.01 
7000 ==tolerance 3d : 0.0001 
7001 ==tolerance 2d : 1e-05 
7002 ==fleche : 0.001 
7003 ==tolblend 0.01 0.0001 1e-05 0.001 
7004
7005 # click an edge 
7006 updatevol . 0 1 1 3 2 2 
7007 ==Pick an object 
7008
7009 buildevol 
7010 ==Dump of SweepApproximation 
7011 ==Error 3d = 1.28548881203818e-14 
7012 ==Error 2d = 1.3468326936926e-14 , 
7013 ==1.20292299999388e-14 
7014 ==2 Segment(s) of degree 3 
7015
7016 ==COMPUTE: temps total 0.91s dont : 
7017 ==- Init + ExtentAnalyse 0s 
7018 ==- PerformSetOfSurf 0.33s 
7019 ==- PerformFilletOnVertex 0.53s 
7020 ==- FilDS 0.01s 
7021 ==- Reconstruction 0.04s 
7022 ==- SetRegul 0s 
7023 ~~~~~
7024
7025
7026 @subsection occt_draw_7_9  Topological analysis
7027
7028 Analysis of shapes includes commands to compute length, area, volumes and inertial properties. 
7029
7030   * Use **lprops**, **sprops**, **vprops** to compute integral properties.
7031   * Use **bounding** to display the bounding box of a shape.
7032   * Use **distmini** to calculate the minimum distance between two shapes.
7033
7034
7035 @subsubsection occt_draw_7_9_1  lprops, sprops, vprops
7036
7037 Syntax:      
7038 ~~~~~
7039 lprops shape 
7040 sprops shape 
7041 vprops shape 
7042 ~~~~~
7043
7044 * **lprops** computes the mass properties of all edges in the shape with a linear density of 1;
7045 * **sprops** of all faces with a surface density of 1;
7046 * **vprops** of all solids with a density of 1. 
7047
7048 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. 
7049
7050 **Example:** 
7051 ~~~~~
7052 # volume of a cylinder 
7053 pcylinder c 10 20 
7054 vprops c 
7055 == results 
7056 Mass : 6283.18529981086 
7057
7058 Center of gravity : 
7059 X = 4.1004749224903e-06 
7060 Y = -2.03392858349861e-16 
7061 Z = 9.9999999941362 
7062
7063 Matrix of Inertia : 
7064 366519.141445068                    5.71451850691484e-12 
7065 0.257640437382627 
7066 5.71451850691484e-12                366519.141444962 
7067 2.26823064169991e-10                0.257640437382627 
7068 2.26823064169991e-10                314159.265358863 
7069
7070 Moments : 
7071 IX = 366519.141446336 
7072 IY = 366519.141444962 
7073 I.Z = 314159.265357595 
7074 ~~~~~
7075
7076
7077 @subsubsection occt_draw_7_9_2   bounding
7078
7079 Syntax:      
7080 ~~~~~
7081 bounding shape 
7082 ~~~~~
7083
7084 Displays the bounding box of a shape. The bounding box is a cuboid created with faces parallel to the x, y, and z planes. The command returns the dimension values of the the box, *xmin ymin zmin xmax ymax zmax.* 
7085
7086 **Example:** 
7087 ~~~~~
7088 # bounding box of a torus 
7089 ptorus t 20 5 
7090 bounding t 
7091 ==-27.059805107309852              -27.059805107309852 - 
7092 5.0000001000000003 
7093 ==27.059805107309852               27.059805107309852 
7094 5.0000001000000003 
7095 ~~~~~
7096
7097 @subsubsection occt_draw_7_9_3  distmini
7098
7099 Syntax:      
7100 ~~~~~
7101 distmini name Shape1 Shape2 
7102 ~~~~~
7103
7104 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(red) and the results are listed in the shell window. The *distmini* lines are considered as shapes which have a value v. 
7105
7106 **Example:** 
7107 ~~~~~
7108 box b 0 0 0 10 20 30 
7109 box b2 30 30 0 10 20 30 
7110 distmini d1 b b2 
7111 ==the distance value is : 22.3606797749979 
7112 ==the number of solutions is :2 
7113
7114 ==solution number 1 
7115 ==the type of the solution on the first shape is 0 
7116 ==the type of the solution on the second shape is 0 
7117 ==the coordinates of the point on the first shape are: 
7118 ==X=10 Y=20 Z=30 
7119 ==the coordinates of the point on the second shape 
7120 are: 
7121 ==X=30 Y=30 Z=30 
7122
7123 ==solution number 2: 
7124 ==the type of the solution on the first shape is 0 
7125 ==the type of the solution on the second shape is 0 
7126 ==the coordinates of the point on the first shape are: 
7127 ==X=10 Y=20 Z=0 
7128 ==the coordinates of the point on the second shape 
7129 are: 
7130 ==X=30 Y=30 Z=0 
7131
7132 ==d1_val d1 d12 
7133 ~~~~~
7134
7135 @subsection occt_draw_7_10  Surface creation
7136
7137 Surface creation commands include surfaces created from boundaries and from spaces between shapes. 
7138   * **gplate** creates a surface from a boundary definition.
7139   * **filling** creates a surface from a group of surfaces.
7140
7141 @subsubsection occt_draw_7_10_1   gplate,
7142
7143 Syntax: 
7144 ~~~~~
7145 gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ... 
7146 ~~~~~
7147
7148 Creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces. 
7149
7150 **Example:**
7151 ~~~~~
7152 plane p 
7153 trim p p -1 3 -1 3 
7154 mkface p p 
7155
7156 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
7157 mkedge e1 c1 
7158 tcopy e1 e2 
7159 tcopy e1 e3 
7160
7161 ttranslate e2 0 2 0 
7162 trotate e3 0 0 0 0 0 1 90 
7163 tcopy e3 e4 
7164 ttranslate e4 2 0 0 
7165 # create the surface 
7166 gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0 
7167 == 
7168 ======== Results =========== 
7169 DistMax=8.50014503228635e-16 
7170 * GEOMPLATE END* 
7171 Calculation time: 0.33 
7172 Loop number: 1 
7173 Approximation results 
7174 Approximation error : 2.06274907619957e-13 
7175 Criterium error : 4.97600631215754e-14 
7176
7177 #to create a surface defined by edges and passing through a point 
7178 # to define the border edges and the point 
7179 plane p 
7180 trim p p -1 3 -1 3 
7181 mkface p p 
7182
7183 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
7184 mkedge e1 c1 
7185 tcopy e1 e2 
7186 tcopy e1 e3 
7187
7188 ttranslate e2 0 2 0 
7189 trotate e3 0 0 0 0 0 1 90 
7190 tcopy e3 e4 
7191 ttranslate e4 2 0 0 
7192 # to create a point 
7193 point pp 1 1 0 
7194 # to create the surface 
7195 gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp 
7196 == 
7197 ======== Results =========== 
7198 DistMax=3.65622157610934e-06 
7199 * GEOMPLATE END* 
7200 Calculculation time: 0.27 
7201 Loop number: 1 
7202 Approximation results 
7203 Approximation error : 0.000422195884750181 
7204 Criterium error : 3.43709808053967e-05 
7205 ~~~~~
7206
7207 @subsubsection occt_draw_7_10_2   filling, fillingparam
7208
7209 Syntax:      
7210 ~~~~~
7211 filling result nbB nbC nbP [SurfInit] [edge][face]order... 
7212 edge[face]order... point/u v face order... 
7213 ~~~~~
7214
7215 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. 
7216
7217 To define the surface border: 
7218
7219   * enter the number of edges, constraints, and points
7220   * enumerate the edges, constraints and points
7221
7222 The surface can pass through other points. These are defined after the border definition. 
7223
7224 You can use the *fillingparam* command to access the filling parameters. 
7225
7226 The options are: 
7227
7228  * <i>-l</i> : to list current values 
7229  * <i>-i</i> : to set default values 
7230  * <i>-rdeg nbPonC nbIt anis </i> : to set filling options 
7231  * <i>-c t2d t3d tang tcur </i> : to set tolerances 
7232  * <i>-a maxdeg maxseg </i> : Approximation option 
7233
7234 **Example:** 
7235 ~~~~~
7236 # to create four curved survaces and a point 
7237 plane p 
7238 trim p p -1 3 -1 3 
7239 mkface p p 
7240
7241 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
7242 mkedge e1 c1 
7243 tcopy e1 e2 
7244 tcopy e1 e3 
7245
7246 ttranslate e2 0 2 0 
7247 trotate e3 0 0 0 0 0 1 90 
7248 tcopy e3 e4 
7249 ttranslate e4 2 0 0 
7250
7251 point pp 1 1 0 
7252
7253 prism f1 e1 0 -1 0 
7254 prism f2 e2 0 1 0 
7255 prism f3 e3 -1 0 0 
7256 prism f4 e4 1 0 0 
7257
7258 # to create a tangential surface 
7259 filling r1 4 0 0 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 
7260 # to create a tangential surface passing through point pp 
7261 filling r2 4 0 1 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 pp# 
7262 # to visualise the surface in detail 
7263 isos r2 40 
7264 # to display the current filling parameters 
7265 fillingparam -l 
7266 == 
7267 Degree = 3 
7268 NbPtsOnCur = 10 
7269 NbIter = 3 
7270 Anisotropie = 0 
7271 Tol2d = 1e-05 
7272 Tol3d = 0.0001 
7273 TolAng = 0.01 
7274 TolCurv = 0.1 
7275
7276 MaxDeg = 8 
7277 MaxSegments = 9 
7278 ~~~~~
7279
7280
7281 @subsection occt_draw_7_11  Complex Topology
7282
7283 Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling. 
7284
7285
7286 @subsubsection occt_draw_7_11_1  offsetshape, offsetcompshape
7287
7288 Syntax:      
7289 ~~~~~
7290 offsetshape r shape offset [tol] [face ...] 
7291 offsetcompshape r shape offset [face ...] 
7292 ~~~~~
7293
7294 **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. 
7295
7296 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. 
7297
7298 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. 
7299
7300 The opening between the object interior and exterior is defined by the argument face or faces. 
7301
7302 **Example:** 
7303 ~~~~~
7304 box b1 10 20 30 
7305 explode b1 f 
7306 == b1_1 b1_2 b1_3 b1_4 b1_5 b1_6 
7307 offsetcompshape r b1 -1 b1_3 
7308 ~~~~~
7309
7310 @subsubsection occt_draw_7_11_2  featprism, featdprism, featrevol, featlf, featrf
7311
7312 Syntax:      
7313 ~~~~~
7314 featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1) 
7315 featdprism shape face skface angle Fuse(0/1/2) Modify(0/1) 
7316 featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1) 
7317 featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1) 
7318 featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1) 
7319 featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil] 
7320 featperformval prism/revol/dprism/lf result value 
7321 ~~~~~
7322
7323 **featprism** loads the arguments for a prism with contiguous sides normal to the face. 
7324
7325 **featdprism** loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle. 
7326
7327 **featrevol** loads the arguments for a prism with a circular evolution. 
7328
7329 **featlf** loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline. 
7330
7331 **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. 
7332
7333 **featperform** loads the arguments to create the feature. 
7334
7335 **featperformval** uses the defined arguments to create a feature with a limiting value. 
7336
7337 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. 
7338
7339 **Examples:** 
7340
7341 Let us create a feature prism with a draft angle and a normal direction :
7342
7343 ~~~~~
7344 # create a box with a wire contour on the upper face 
7345 box b 1 1 1 
7346 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
7347 explode b f 
7348 # loads the feature arguments defining the draft angle 
7349 featdprism b f b_6 5 1 0 
7350 # create the feature 
7351 featperformval dprism r 1 
7352 ==BRepFeat_MakeDPrism::Perform(Height) 
7353 BRepFeat_Form::GlobalPerform () 
7354  Gluer 
7355  still Gluer 
7356  Gluer result 
7357 ~~~~~
7358
7359 Let us  create a feature prism with circular direction :
7360
7361 ~~~~~
7362 # create a box with a wire contour on the upper face 
7363 box b 1 1 1 
7364 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
7365 explode b f 
7366 # loads the feature arguments defining a rotation axis 
7367 featrevol b f b_6 1 0 1 0 1 0 1 0 
7368 featperformval revol r 45 
7369 ==BRepFeat_MakeRevol::Perform(Angle) 
7370 BRepFeat_Form::GlobalPerform () 
7371  Gluer 
7372  still Gluer 
7373  Gluer result 
7374 ~~~~~
7375
7376
7377 Let us create a slot using the linear feature :
7378
7379 ~~~~~
7380 #create the base model using the multi viewer 
7381 mu4 
7382 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 
7383 prism pr p 0 0 1 
7384 # create the contour for the linear feature 
7385 vertex v1 -0.2 4 0.3 
7386 vertex v2 0.2 4 0.3 
7387 vertex v3 0.2 0.2 0.3 
7388 vertex v4 4 0.2 0.3 
7389 vertex v5 4 -0.2 0.3 
7390 edge e1 v1 v2 
7391 edge e2 v2 v3 
7392 edge e3 v3 v4 
7393 edge e4 v4 v5 
7394 wire w e1 e2 e3 e4 
7395 # define a plane 
7396 plane pl 0.2 0.2 0.3 0 0 1 
7397 # loads the linear feature arguments 
7398 featlf pr w pl 0 0 0.3 0 0 0 0 1 
7399 featperform lf result 
7400 ~~~~~
7401
7402 Let us create a rib using the revolution feature :
7403
7404 ~~~~~
7405 #create the base model using the multi viewer 
7406 mu4 
7407 pcylinder c1 3 5 
7408 # create the contour for the revolution feature 
7409 profile w c 1 190 WW 
7410 trotate w 0 0 0 1 0 0 90 
7411 ttranslate w -3 0 1 
7412 trotate w -3 0 1.5 0 0 1 180 
7413 plane pl -3 0 1.5 0 1 0 
7414 # loads the revolution feature arguments 
7415 featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1 
7416 featperform rf result 
7417 ~~~~~
7418
7419 @subsubsection occt_draw_7_11_3  draft
7420
7421 Syntax: 
7422 ~~~~~
7423 draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal] 
7424 ~~~~~
7425
7426 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. 
7427
7428   * The draft angle is measured in radians.
7429   * The draft direction is determined by the argument -INTERNAL
7430   * The argument Ri/Ro deftermines wether the corner edges of the draft surfaces are angular or rounded.
7431   * Arguments that can be used to define the surface distance are:
7432    * length, a defined distance
7433    * shape, until the surface contacts a shape
7434    * surface, until the surface contacts a surface.
7435
7436 **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.
7437
7438 **Example:** 
7439 ~~~~~
7440 # to create a simple profile 
7441 profile p F 0 0 x 2 y 4 tt 0 4 w 
7442 # creates a draft with rounded angles 
7443 draft res p 0 0 1 3 1 -Ro 
7444 # to create a profile with an internal angle 
7445 profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w 
7446 # creates a draft with rounded external angles 
7447 draft res p 0 0 1 3 1 -Ro 
7448 ~~~~~
7449
7450 @subsubsection occt_draw_7_11_4  deform
7451
7452 Syntax:      
7453 ~~~~~
7454 deform newname name CoeffX CoeffY CoeffZ
7455 ~~~~~
7456
7457 Modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions. 
7458  
7459 **Example:** 
7460 ~~~~~
7461 pcylinder c 20 20 
7462 deform a c 1 3 5 
7463 # the conversion to bspline is followed by the 
7464 deformation 
7465 ~~~~~
7466
7467
7468 @subsubsection occt_draw_7_11_5 nurbsconvert
7469
7470 Syntax:
7471  
7472 ~~~~~
7473 nurbsconvert result name [result name] 
7474 ~~~~~
7475
7476 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. 
7477
7478
7479 @subsection occt_draw_7_12  Texture Mapping to a Shape
7480
7481 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. 
7482
7483 @subsubsection occt_draw_7_12_1  vtexture
7484
7485 Syntax:      
7486 ~~~~~
7487 vtexture NameOfShape TextureFile 
7488 vtexture NameOfShape 
7489 vtexture NameOfShape ? 
7490 vtexture NameOfShape IdOfTexture 
7491 ~~~~~
7492
7493 **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. 
7494
7495 @subsubsection occt_draw_7_12_2  vtexscale
7496
7497 Syntax:      
7498 ~~~~~
7499 vtexscale NameOfShape ScaleU ScaleV 
7500 vtexscale NameOfShape ScaleUV 
7501 vtexscale NameOfShape 
7502 ~~~~~
7503
7504 *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. 
7505
7506 The syntax without *ScaleU*, *ScaleV* or *ScaleUV* disables texture scaling. 
7507
7508 @subsubsection occt_draw_7_12_3  vtexorigin
7509
7510 Syntax:       
7511 ~~~~~
7512 vtexorigin NameOfShape UOrigin VOrigin 
7513 vtexorigin NameOfShape UVOrigin 
7514 vtexorigin NameOfShape 
7515 ~~~~~
7516
7517 *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. 
7518
7519 The syntax without *UOrigin*, *VOrigin* or *UVOrigin* disables origin positioning. 
7520
7521 @subsubsection occt_draw_7_12_4  vtexrepeat
7522
7523 Syntax:       
7524 ~~~~~
7525 vtexrepeat NameOfShape URepeat VRepeat 
7526 vtexrepeat NameOfShape UVRepeat 
7527 vtexrepeat NameOfShape 
7528 ~~~~~
7529
7530 *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. 
7531
7532 The same syntax without *URepeat*, *VRepeat* or *UVRepeat* disables texture repetition. 
7533
7534 @subsubsection occt_draw_7_12_5  vtexdefault
7535
7536 Syntax:       
7537 ~~~~~
7538 vtexdefault NameOfShape 
7539 ~~~~~
7540
7541 *Vtexdefault* sets or resets the texture mapping default parameters. 
7542
7543 The defaults are: 
7544
7545  * *URepeat = VRepeat = 1* no repetition 
7546  * *UOrigin = VOrigin = 1*  origin set at (0,0) 
7547  * *UScale = VScale = 1*  texture covers 100% of the face 
7548  
7549  
7550 @section occt_draw_20 General Fuse Algorithm commands
7551
7552 This chapter describes existing commands of Open CASCADE Draw Test Harness that are used for debugging of General Fuse Algorithm (GFA). It is also applicable for Boolean Operations Algorithm (BOA) and Partition Algorithm (PA) because these algorithms are subclasses of GFA. 
7553
7554 See @ref occt_user_guides__boolean_operations "Boolean operations" user's guide for the description of these algorithms.
7555
7556 @subsection occt_draw_20_1 Definitions
7557
7558 The following terms and definitions are used in this document:
7559 * **Objects** – list of shapes that are arguments of the algorithm.
7560 * **Tools** – list of shapes that are arguments of the algorithm. Difference between Objects and Tools is defined by specific requirements of the operations (Boolean Operations, Partition Operation).
7561 * **DS** – internal data structure used by the algorithm (*BOPDS_DS* object).
7562 * **PaveFiller** – intersection part of the algorithm (*BOPAlgo_PaveFiller* object).
7563 * **Builder** – builder part of the algorithm (*BOPAlgo_Builder* object).
7564 * **IDS Index** – the index of the vector *myLines*.
7565
7566 @subsection occt_draw_20_2 General commands
7567
7568 * **bclearobjects** - clears the list of Objects;       
7569 * **bcleartools**       - clears the list of Tools;     
7570 * **baddobjects** *S1 S2...Sn*  - adds shapes *S1, S2, ... Sn* as Objects;      
7571 * **baddtools** *S1 S2...Sn* - adds shapes *S1, S2, ... Sn* as Tools;
7572 * **bfillds** - performs the Intersection Part of the Algorithm;        
7573 * **bbuild** *r* - performs the Building Part of the Algorithm; *r* is the resulting shape.
7574
7575 @subsection occt_draw_20_3 Commands for Intersection Part
7576
7577 All commands listed below  are available when the Intersection Part of the algorithm is done (i.e. after the command *bfillds*).
7578
7579 @subsubsection occt_draw_20_3_1 bopds
7580         
7581 Syntax: 
7582 ~~~~
7583 bopds –v [e, f]       
7584 ~~~~
7585
7586 Displays:
7587 * all BRep shapes of arguments that are in the DS [default];
7588 * <i>–v</i> : only vertices of arguments that are in the DS;
7589 * <i>–e</i> : only edges of arguments that are in the DS;
7590 * <i>–f</i> : only faces of arguments that are in the DS.
7591
7592 @subsubsection occt_draw_20_3_2 bopdsdump
7593
7594 Prints contents of the DS. 
7595
7596 Example:
7597
7598 ~~~~
7599  Draw[28]> bopdsdump
7600  *** DS ***
7601  Ranges:2                       number of ranges
7602  range: 0 33            indices for range 1
7603  range: 34 67           indices for range 2
7604  Shapes:68              total number of source shapes
7605  0 : SOLID { 1 }
7606  1 : SHELL { 2 12 22 26 30 32 }
7607  2 : FACE { 4 5 6 7 8 9 10 11 }
7608  3 : WIRE { 4 7 9 11 }
7609  4 : EDGE { 5 6 }
7610  5 : VERTEX { }
7611  6 : VERTEX { }
7612  7 : EDGE { 8 5 }
7613  8 : VERTEX { }
7614 ~~~~
7615
7616 @code 0 : SOLID { 1 } @endcode has the following meaning:
7617 * *0* – index in the DS;
7618 * *SOLID* – type of the shape;
7619 * <i>{ 1 }</i> – a DS index of the successors.
7620
7621 @subsubsection occt_draw_20_3_3 bopindex
7622
7623 Syntax:
7624 ~~~~
7625 bopindex S
7626 ~~~~
7627 Prints DS index of shape *S*.
7628
7629 @subsubsection occt_draw_20_3_4 bopiterator
7630
7631 Syntax:
7632 ~~~~~
7633 bopiterator [t1 t2]
7634 ~~~~~
7635
7636 Prints pairs of DS indices of source shapes that are intersected in terms of bounding boxes.
7637
7638 <i>[t1 t2]</i> are types of the shapes:
7639 * *7* - vertex;
7640 * *6* - edge;
7641 * *4* – face.
7642
7643 Example:
7644 ~~~~
7645  Draw[104]> bopiterator 6 4
7646  EF: ( z58 z12 )
7647  EF: ( z17 z56 )
7648  EF: ( z19 z64 )
7649  EF: ( z45 z26 )
7650  EF: ( z29 z36 )
7651  EF: ( z38 z32 )
7652 ~~~~
7653
7654 * *bopiterator 6 4* prints pairs of indices for types: edge/face;
7655 * *z58 z12* - DS indices of intersecting edge and face.
7656
7657
7658 @subsubsection occt_draw_20_3_5 bopinterf
7659
7660 Syntax: 
7661 ~~~~
7662 bopinterf t
7663 ~~~~
7664
7665 Prints contents of *myInterfTB* for the type of interference *t*:
7666 * *t=0* : vertex/vertex;
7667 * *t=1* : vertex/edge;
7668 * *t=2* : edge/edge;
7669 * *t=3* : vertex/face;
7670 * *t=4* : edge/face.
7671
7672 Example:
7673 ~~~~
7674  Draw[108]> bopinterf 4
7675  EF: (58, 12, 68), (17, 56, 69), (19, 64, 70), (45, 26, 71), (29, 36, 72), (38, 32, 73), 6 EF found.
7676 ~~~~
7677
7678 Here, record <i>(58, 12, 68)</i> means:
7679 * *58* – a DS index of the edge;
7680 * *12* – a DS index of the face;
7681 * *68* – a DS index of the new vertex.
7682
7683 @subsubsection occt_draw_20_3_6 bopsp   
7684
7685 Displays split edges. 
7686
7687 Example:
7688 ~~~~
7689  Draw[33]> bopsp
7690  edge 58 : z58_74 z58_75
7691  edge 17 : z17_76 z17_77
7692  edge 19 : z19_78 z19_79
7693  edge 45 : z45_80 z45_81
7694  edge 29 : z29_82 z29_83
7695  edge 38 : z38_84 z38_85
7696 ~~~~
7697
7698 * *edge 58* – 58 is a DS index of the original edge.
7699 * *z58_74 z58_75* – split edges, where 74, 75 are DS indices of the split edges.
7700
7701 @subsubsection occt_draw_20_3_7 bopcb
7702
7703 Syntax:
7704 ~~~~
7705 bopcb [nE]
7706 ~~~~
7707
7708 Prints Common Blocks for:
7709 * all source edges (by default);
7710 * the source edge with the specified index *nE*.
7711
7712 Example:
7713 ~~~~
7714  Draw[43]> bopcb 17
7715  -- CB:
7716  PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }
7717  Faces: 36
7718 ~~~~
7719
7720 This command dumps common blocks for the source edge with index 17. 
7721 * *PB* – information about the Pave Block;
7722         * *71* – a DS index of the split edge
7723         * *17* – a DS index of the original edge
7724 * <i>Pave1 : { 68 3.000 }</i> – information about the Pave:
7725         * *68* – a DS index of the vertex of the pave
7726         * *3.000* – a parameter of vertex 68 on edge 17
7727 * *Faces: 36* – 36 is a DS index of the face the common block belongs to. 
7728
7729
7730 @subsubsection occt_draw_20_3_8 bopfin
7731
7732 Syntax:
7733
7734 ~~~~
7735 bopfin nF       
7736 ~~~~
7737 Prints Face Info about IN-parts for the face with DS index *nF*.
7738
7739 Example:
7740 ~~~~
7741  Draw[47]> bopfin 36
7742  pave blocks In:
7743  PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }
7744  PB:{ E:75 orE:19 Pave1: { 69 3.000 } Pave2: { 18 10.000 } }
7745  vrts In:
7746  18
7747 ~~~~
7748
7749
7750 * <i>PB:{ E:71 orE:17 Pave1: { 68 3.000 } Pave2: { 18 10.000 } }</i> – information about the Pave Block; 
7751 * <i>vrts In ... 18 – 18</i> a DS index of the vertex IN the face.
7752
7753 @subsubsection occt_draw_20_3_9 bopfon
7754
7755 Syntax:
7756 ~~~~
7757 bopfon nF
7758 ~~~~
7759 Print Face Info about ON-parts for the face with DS index *nF*.
7760
7761 Example:
7762 ~~~~
7763  Draw[58]> bopfon 36
7764  pave blocks On:
7765  PB:{ E:72 orE:38 Pave1: { 69 0.000 } Pave2: { 68 10.000 } }
7766  PB:{ E:76 orE:45 Pave1: { 69 0.000 } Pave2: { 71 10.000 } }
7767  PB:{ E:78 orE:43 Pave1: { 71 0.000 } Pave2: { 70 10.000 } }
7768  PB:{ E:74 orE:41 Pave1: { 68 0.000 } Pave2: { 70 10.000 } }
7769  vrts On:
7770  68 69 70 71
7771 ~~~~
7772
7773 * <i>PB:{ E:72 orE:38 Pave1: { 69 0.000 } Pave2: { 68 10.000 } }</i> – information about the Pave Block; 
7774 * <i>vrts On: ... 68 69 70 71 – 68, 69, 70, 71 </i> DS indices of the vertices ON the face.
7775
7776 @subsubsection occt_draw_20_3_10 bopwho
7777
7778 Syntax:
7779 ~~~~
7780 bopwho nS
7781 ~~~~
7782
7783 Prints the information about the shape with DS index *nF*.
7784
7785 Example:
7786 ~~~~
7787  Draw[116]> bopwho 5
7788  rank: 0
7789 ~~~~
7790
7791 * *rank: 0* – means that shape 5 results from the Argument with index 0.
7792
7793 Example:
7794 ~~~~
7795  Draw[118]> bopwho 68
7796  the shape is new
7797  EF: (58, 12),
7798  FF curves: (12, 56),
7799  FF curves: (12, 64),
7800 ~~~~
7801
7802 This means that shape 68 is a result of the following interferences:
7803 * *EF: (58, 12)* – edge 58 / face 12
7804 * *FF curves: (12, 56)* – edge from the intersection curve between faces 12 and 56
7805 * *FF curves: (12, 64)* – edge from the intersection curve between faces 12 and 64
7806
7807 @subsubsection occt_draw_20_3_11 bopnews
7808
7809 Syntax:
7810 ~~~~
7811 bopnews -v [-e]
7812 ~~~~
7813
7814 * <i>-v</i> - displays all new vertices produced during the operation;
7815 * <i>-e</i> - displays all new edges produced during the operation.
7816
7817 @subsection occt_draw_20_4      Commands for the Building Part
7818
7819 The commands listed below are available when the Building Part of the algorithm is done (i.e. after the command *bbuild*).
7820
7821 @subsubsection occt_draw_20_4_1 bopim
7822
7823 Syntax: 
7824
7825 ~~~~
7826 bopim S
7827 ~~~~
7828 Shows the compound of shapes that are images of shape *S* from the argument.
7829
7830  
7831 @section occt_draw_8 Data Exchange commands
7832
7833 This chapter presents some general information about Data Exchange (DE) operations. 
7834
7835 DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.) 
7836
7837 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 
7838 * for <a href="user_guides__step.html#occt_step_1">STEP format</a> and
7839 * for <a href="user_guides__iges.html#occt_iges_1">IGES format</a>. 
7840
7841 Each Draw session has an interface model, which is a structure for keeping various information. 
7842
7843 The first step of translation is loading information from a file into a model. 
7844 The second step is creation of an OpenCASCADE shape from this model. 
7845
7846 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. 
7847
7848 The model and the map are used for working with most of DE commands. 
7849
7850 @subsection occt_draw_8_1  IGES commands 
7851
7852 @subsubsection occt_draw_8_1_1  igesread
7853
7854 Syntax:      
7855 ~~~~~
7856 igesread <file_name> <result_shape_name> [<selection>]
7857 ~~~~~
7858
7859 Reads an IGES file to an OCCT shape. This command will interactively ask the user to select a set of entities to be converted. 
7860
7861
7862 | N | Mode | Description |
7863 | :-- | :-- | :---------- |
7864 | 0 | End | finish conversion and exit igesbrep |
7865 | 1 | Visible roots | convert only visible roots |
7866 | 2 | All roots | convert all roots |
7867 | 3 | One entity | convert entity with number provided by the user |
7868 | 4 | Selection | convert only entities contained in selection |
7869
7870
7871 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. 
7872
7873 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*. 
7874
7875 <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. 
7876
7877 See also the detailed description of <a href="user_guides__iges.html#occt_iges_2_3_4">Selecting IGES entities</a>.
7878
7879 **Example:**
7880 ~~~~~
7881 # translation all roots from file 
7882 igesread /disk01/files/model.igs a  * 
7883 ~~~~~
7884
7885 @subsubsection occt_draw_8_1_2   tplosttrim
7886
7887 Syntax:      
7888 ~~~~~
7889 tplosttrim [<IGES_type>] 
7890 ~~~~~
7891
7892 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. 
7893 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. 
7894 Optional parameter <i>\<IGES_type\></i> can be *0TrimmedSurface, BoundedSurface* or *Face* to specify the only type of IGES faces. 
7895
7896 **Example:**
7897 ~~~~~
7898 tplosttrim TrimmedSurface 
7899 ~~~~~
7900
7901 @subsubsection occt_draw_8_1_3  brepiges
7902
7903 Syntax:      
7904 ~~~~~
7905 brepiges <shape_name> <filename.igs>
7906 ~~~~~
7907
7908 Writes an OCCT shape to an IGES file. 
7909
7910 **Example:** 
7911 ~~~~~    
7912 # write shape with name aa to IGES file 
7913 brepiges aa /disk1/tmp/aaa.igs 
7914 == unit (write) : MM 
7915 == mode  write  : Faces 
7916 ==   To modifiy : command  param 
7917 == 1 Shapes written, giving 345 Entities 
7918 ==  Now, to write a file, command : writeall filename 
7919 ==  Output on file : /disk1/tmp/aaa.igs 
7920 ==  Write OK 
7921 ~~~~~
7922
7923 @subsection occt_draw_8_2  STEP commands 
7924
7925 These commands are used during the translation of STEP models. 
7926
7927
7928 @subsubsection occt_draw_8_2_1  stepread
7929
7930 Syntax:      
7931 ~~~~~
7932 stepread file_name result_shape_name [selection] 
7933 ~~~~~
7934
7935 Read a STEP file to an OCCT shape. 
7936 This command will interactively ask the user to select a set of entities to be converted: 
7937
7938 | N | Mode | Description |
7939 | :---- | :---- | :---- |  
7940 | 0 | End | Finish transfer and exit stepread | 
7941 | 1 | root with rank 1 | Transfer first root | 
7942 | 2 | root by its rank | Transfer root specified by its rank | 
7943 | 3 | One entity | Transfer entity with a number provided by the user | 
7944 | 4 | Selection | Transfer only entities contained in selection | 
7945
7946 After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes. 
7947 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*. 
7948 <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. 
7949
7950 See also the detailed description of <a href="user_guides__step.html#occt_step_2_3_6">Selecting STEP entities</a>.
7951
7952 **Example:**
7953 ~~~~~
7954 # translation all roots from file 
7955 stepread /disk01/files/model.stp a  * 
7956 ~~~~~
7957
7958 @subsubsection occt_draw_8_2_2   stepwrite
7959
7960 Syntax:      
7961 ~~~~~
7962 stepwrite mode shape_name file_name 
7963 ~~~~~
7964
7965 Writes an OCCT shape to a STEP file. 
7966
7967 The following  modes are available : 
7968     * *a* - as is – mode is selected automatically depending on the type & geometry of the shape; 
7969     * *m* - *manifold_solid_brep* or *brep_with_voids* 
7970     * *f* - *faceted_brep* 
7971     * *w* - *geometric_curve_set* 
7972     * *s* - *shell_based_surface_model* 
7973  
7974 For further information see <a href="#user_guides__step.html#occt_step_6_5">Writing a STEP file</a>. 
7975
7976 **Example:**
7977
7978 Let us write shape *a* to a STEP file in mode *0*. 
7979
7980 ~~~~~
7981 stepwrite 0 a /disk1/tmp/aaa.igs 
7982 ~~~~~
7983
7984
7985 @subsection occt_draw_8_3  General commands 
7986
7987 These are auxilary commands used for the analysis of result of translation of IGES and STEP files. 
7988
7989 @subsubsection occt_draw_8_3_1  count
7990
7991 Syntax:      
7992 ~~~~~
7993 count <counter> [<selection>] 
7994 ~~~~~
7995
7996 Calculates statistics on the entities in the model and outputs a count of entities. 
7997
7998 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. 
7999
8000 | Counter | Operation |
8001 | :-------- | :-------- | 
8002 | xst-types | Calculates how many entities of each OCCT type exist | 
8003 | step214-types | Calculates how many entities of each STEP type exist |
8004
8005 **Example:**
8006 ~~~~~
8007 count xst-types 
8008 ~~~~~
8009
8010 @subsubsection occt_draw_8_3_2 data
8011
8012 Syntax:      
8013 ~~~~~
8014 data <symbol>
8015 ~~~~~
8016
8017 Obtains general statistics on the loaded data. 
8018 The information printed by this command depends on the symbol specified. 
8019
8020 **Example:**
8021 ~~~~~
8022 # print full information about warnings and fails 
8023 data c 
8024 ~~~~~
8025
8026 | Symbol | Output |
8027 | :------ | :------ |
8028 | g | Prints the information contained in the header of the file |
8029 | 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) |
8030 | t | The same as c or f, with a list of failed or warned entities |
8031 | m or l | The same as t but also prints a status for each entity | 
8032 | e | Lists all entities of the model with their numbers, types, validity status etc. |
8033 | R | The same as e but lists only root entities |
8034
8035
8036
8037 @subsubsection occt_draw_8_3_3  elabel
8038
8039 Syntax:      
8040 ~~~~~
8041 elabel <num>
8042 ~~~~~
8043
8044 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. 
8045
8046 **Example:**
8047 ~~~~~
8048 elabel 84 
8049 ~~~~~
8050
8051 @subsubsection occt_draw_8_3_4  entity
8052
8053 Syntax:      
8054 ~~~~~
8055 entity <#(D)>_or_<num> <level_of_information>
8056 ~~~~~
8057
8058 The content of an IGES or STEP entity can be obtained by using this command. 
8059 Entity can be determined by its number or label. 
8060 <i>\<level_of_information\></i> has range [0-6]. You can get more information about this level using this command without parameters. 
8061
8062 **Example:**
8063 ~~~~~
8064 # full information for STEP entity with label 84 
8065 entity #84 6 
8066 ~~~~~
8067
8068 @subsubsection occt_draw_8_3_5  enum
8069
8070 Syntax:      
8071 ~~~~~
8072 enum <#(D)> 
8073 ~~~~~
8074
8075 Prints a number for the entity with a given label. 
8076
8077 **Example:**
8078 ~~~~~
8079 # give a number for IGES entity with label 21 
8080 enum D21 
8081 ~~~~~
8082
8083 @subsubsection occt_draw_8_3_6  estatus
8084
8085 Syntax:      
8086 ~~~~~
8087 estatus <#(D)>_or_<num>
8088 ~~~~~
8089
8090 The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command. 
8091
8092 **Example:**
8093 ~~~~~
8094 estatus #315 
8095 ~~~~~
8096
8097 @subsubsection occt_draw_8_3_7  fromshape
8098
8099 Syntax:      
8100 ~~~~~
8101 fromshape <shape_name>
8102 ~~~~~
8103
8104 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. 
8105
8106 **Example:**
8107 ~~~~~
8108 fromshape a_1_23 
8109 ~~~~~
8110
8111 @subsubsection occt_draw_8_3_8  givecount
8112
8113 Syntax:
8114 ~~~~~
8115 givecount <selection_name> [<selection_name>]
8116 ~~~~~
8117
8118
8119 Prints a number of loaded entities defined by the selection argument.
8120 Possible values of \<selection_name\> you can find in the “IGES FORMAT Users’s Guide”.
8121
8122 **Example:**
8123 ~~~~~
8124 givecount xst-model-roots 
8125 ~~~~~
8126
8127 @subsubsection occt_draw_8_3_9  givelist
8128
8129 Syntax:      
8130 ~~~~~
8131 givelist <selection_name>
8132 ~~~~~
8133
8134 Prints a list of a subset of loaded entities defined by the selection argument: 
8135 | Selection | Description |
8136 | :-------- | :----------- |
8137 | xst-model-all | all entities of the model |
8138 | xst-model-roots | all roots |
8139 | xst-pointed | (Interactively) pointed entities (not used in DRAW) |
8140 | xst-transferrable-all | all transferable (recognized) entities |
8141 | xst-transferrable-roots | Transferable roots | 
8142
8143
8144 **Example:**
8145 ~~~~~
8146 # give a list of all entities of the model 
8147 givelist xst-model-all 
8148 ~~~~~
8149
8150 @subsubsection occt_draw_8_3_10  listcount
8151
8152 Syntax:     listcount \<counter\> [\<selection\> ...]
8153
8154 Prints a list of entities per each type matching the criteria defined by arguments. 
8155 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: 
8156
8157 | Counter     | Operation |
8158 | :-----      | :------   |
8159 | xst-types   | Calculates how many entities of each OCCT type exist |
8160 | iges-types  | Calculates how many entities of each IGES type and form exist |
8161 | iges-levels | Calculates how many entities lie in different IGES levels |
8162
8163 **Example:**
8164 ~~~~~
8165 listcount xst-types 
8166 ~~~~~
8167
8168 @subsubsection occt_draw_8_3_11  listitems
8169
8170 Syntax:      
8171 ~~~~~
8172 listitems 
8173 ~~~~~
8174
8175 This command prints a list of objects (counters, selections etc.) defined in the current session. 
8176
8177
8178 @subsubsection occt_draw_8_3_12  listtypes
8179
8180 Syntax:      
8181 ~~~~~
8182 listtypes [<selection_name> ...]
8183 ~~~~~
8184
8185 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. 
8186
8187
8188 @subsubsection occt_draw_8_3_13  newmodel
8189
8190 Syntax:      
8191 ~~~~~
8192 newmodel 
8193 ~~~~~
8194
8195 Clears the current model. 
8196
8197
8198 @subsubsection occt_draw_8_3_14  param
8199
8200 Syntax:      
8201 ~~~~~
8202 param [<parameter>] [<value>]
8203 ~~~~~
8204
8205 This command is used to manage translation parameters. 
8206 Command without arguments gives a full list of parameters with current values. 
8207 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>.
8208
8209 **Example:**
8210
8211 Let us get the information about possible schemes for writing STEP file :
8212
8213 ~~~~~
8214 param write.step.schema 
8215 ~~~~~
8216
8217 @subsubsection occt_draw_8_3_15  sumcount
8218
8219 Syntax:      
8220 ~~~~~
8221 sumcount <counter> [<selection> ...]
8222 ~~~~~
8223
8224 Prints only a number of entities per each type matching the criteria defined by arguments. 
8225
8226 **Example:**
8227 ~~~~~
8228 sumcount xst-types 
8229 ~~~~~
8230
8231 @subsubsection occt_draw_8_3_16  tpclear
8232
8233 Syntax:      
8234 ~~~~~
8235 tpclear  
8236 ~~~~~
8237
8238 Clears the map of correspondences between IGES or STEP entities and OCCT shapes. 
8239
8240
8241
8242 @subsubsection occt_draw_8_3_17  tpdraw
8243
8244 Syntax:      
8245 ~~~~~
8246 tpdraw <#(D)>_or_<num>
8247 ~~~~~
8248
8249 **Example:**
8250 ~~~~~
8251 tpdraw 57 
8252 ~~~~~
8253
8254 @subsubsection occt_draw_8_3_18  tpent
8255
8256 Syntax:      
8257 ~~~~~
8258 tpent <#(D)>_or_<num>
8259 ~~~~~
8260
8261 Get information about the result of translation of the given IGES or STEP entity.
8262
8263 **Example:**
8264 ~~~~~
8265 tpent \#23 
8266 ~~~~~
8267
8268 @subsubsection occt_draw_8_3_19  tpstat
8269
8270 Syntax:      
8271 ~~~~~
8272 tpstat [*|?]<symbol> [<selection>]
8273 ~~~~~
8274
8275
8276 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: 
8277
8278 * *g* - General statistics (a list of results and messages)
8279 * *c* - Count of all warning and fail messages
8280 * *C* - List of all warning and fail messages
8281 * *f* - Count of all fail messages
8282 * *F* - List of all fail messages
8283 * *n* - List of all transferred roots
8284 * *s* - The same, with types of source entity and the type of result
8285 * *b* - The same, with messages
8286 * *t* - Count of roots for geometrical types
8287 * *r* - Count of roots for topological types
8288 * *l* - The same, with the type of the source entity
8289
8290 The sign \* before parameters *n, s, b, t, r* makes it work on all entities (not only on roots).
8291
8292 The sign ? before *n, s, b, t* limits the scope of information to invalid entities. 
8293
8294 Optional argument \<selection\> can limit the action of the command to the selection, not to all entities. 
8295
8296 To get help, run this command without arguments. 
8297
8298 **Example:**
8299 ~~~~~
8300 # translation ratio on IGES faces 
8301 tpstat *l iges-faces 
8302 ~~~~~
8303
8304 @subsubsection occt_draw_8_3_20  xload
8305
8306 Syntax:      
8307 ~~~~~
8308 xload <file_name>
8309 ~~~~~
8310
8311 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. 
8312
8313 **Example:**
8314 ~~~~~
8315 xload /disk1/tmp/aaa.stp 
8316 ~~~~~
8317
8318
8319 @subsection occt_draw_8_4  Overview of XDE commands 
8320
8321 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: 
8322   * XDE translation commands
8323   * XDE general commands
8324   * XDE shape’s commands
8325   * XDE color’s commands
8326   * XDE layer’s commands
8327   * XDE property’s commands
8328
8329 Reminding: All operations of translation are performed with parameters managed by command  <a href="#occt_draw_8_3_14">the command *param*</a>.
8330
8331 @subsubsection occt_draw_8_4_1  ReadIges
8332
8333 Syntax:      
8334 ~~~~~
8335 ReadIges document file_name 
8336 ~~~~~
8337
8338 Reads information from an IGES file to an XCAF document. 
8339
8340 **Example:**
8341 ~~~~~
8342 ReadIges D /disk1/tmp/aaa.igs 
8343 ==> Document saved with name D 
8344 ~~~~~
8345
8346 @subsubsection occt_draw_8_4_2  ReadStep
8347
8348 Syntax:      
8349 ~~~~~
8350 ReadStep <document> <file_name>
8351 ~~~~~
8352
8353 Reads information from a STEP file to an XCAF document. 
8354
8355 **Example:**
8356 ~~~~~
8357 ReadStep D /disk1/tmp/aaa.stp 
8358 == Document saved with name D 
8359 ~~~~~
8360
8361 @subsubsection occt_draw_8_4_3  WriteIges
8362
8363 Syntax:      
8364 ~~~~~
8365 WriteIges <document> <file_name>
8366 ~~~~~
8367
8368 **Example:**
8369 ~~~~~
8370 WriteIges D /disk1/tmp/aaa.igs 
8371 ~~~~~
8372
8373 @subsubsection occt_draw_8_4_4  WriteStep
8374
8375 Syntax:      
8376 ~~~~~
8377 WriteStep <document> <file_name>
8378 ~~~~~
8379
8380 Writes information from an XCAF document to a STEP file. 
8381
8382 **Example:**
8383 ~~~~~
8384 WriteStep D /disk1/tmp/aaa.stp 
8385 ~~~~~
8386
8387 @subsubsection occt_draw_8_4_5  XFileCur
8388
8389 Syntax:      
8390 ~~~~~
8391 XFileCur  
8392 ~~~~~
8393
8394 Returns the name of file which is set as the current one in the Draw session. 
8395
8396 **Example:**
8397 ~~~~~
8398 XFileCur 
8399 == *as1-ct-203.stp* 
8400 ~~~~~
8401
8402 @subsubsection occt_draw_8_4_6  XFileList
8403
8404 Syntax:      
8405 ~~~~~
8406 XFileList  
8407 ~~~~~
8408
8409 Returns a list all files that were transferred by the last transfer. This command is  meant (assigned) for the assemble step file. 
8410
8411 **Example:**
8412 ~~~~~
8413 XFileList 
8414 ==> *as1-ct-Bolt.stp* 
8415 ==> *as1-ct-L-Bracktet.stp* 
8416 ==> *as1-ct-LBA.stp* 
8417 ==> *as1-ct-NBA.stp* 
8418 ==> … 
8419 ~~~~~
8420
8421 @subsubsection occt_draw_8_4_7  XFileSet
8422
8423 Syntax:      
8424 ~~~~~
8425 XFileSet <filename> 
8426 ~~~~~
8427
8428 Sets the current file taking it from the components list of the assemble file. 
8429
8430 **Example:**
8431 ~~~~~
8432 XFileSet as1-ct-NBA.stp 
8433 ~~~~~
8434
8435 @subsubsection occt_draw_8_4_8  XFromShape
8436
8437 Syntax:      
8438 ~~~~~
8439 XFromShape <shape>
8440 ~~~~~
8441
8442 This command is similar to <a href="#occt_draw_8_3_7">the command *fromshape*</a>, but gives additional information about the file name. It is useful if a shape was translated from several files. 
8443
8444 **Example:**
8445 ~~~~~
8446 XFromShape a 
8447 ==> Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp 
8448 ~~~~~
8449
8450 @subsection occt_draw_8_5  XDE general commands 
8451
8452 @subsubsection occt_draw_8_5_1  XNewDoc
8453
8454 Syntax:      
8455 ~~~~~
8456 XNewDoc <document>
8457 ~~~~~
8458
8459 Creates a new XCAF document. 
8460
8461 **Example:**
8462 ~~~~~
8463 XNewDoc D 
8464 ~~~~~
8465
8466 @subsubsection occt_draw_8_5_2  XShow
8467
8468 Syntax:      
8469 ~~~~~
8470 XShow <document> [ <label1> … ]
8471 ~~~~~
8472
8473 Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document. 
8474
8475 **Example:**
8476 ~~~~~
8477 # show shape from label 0:1:1:4 from document D 
8478 XShow D 0:1:1:4 
8479 ~~~~~
8480
8481 @subsubsection occt_draw_8_5_3  XStat
8482
8483 Syntax:      
8484 ~~~~~
8485 XStat <document>
8486 ~~~~~
8487
8488 Prints common information from an XCAF document. 
8489
8490 **Example:**
8491 ~~~~~
8492 XStat D 
8493 ==>Statistis of shapes in the document: 
8494 ==>level N 0 : 9 
8495 ==>level N 1 : 18 
8496 ==>level N 2 : 5 
8497 ==>Total number of labels for shapes in the document = 32 
8498 ==>Number of labels with name = 27 
8499 ==>Number of labels with color link = 3 
8500 ==Number of labels with layer link = 0 
8501 ==>Statistis of Props in the document: 
8502 ==>Number of Centroid Props = 5 
8503 ==>Number of Volume Props = 5 
8504 ==>Number of Area Props = 5 
8505 ==>Number of colors = 4 
8506 ==>BLUE1 RED YELLOW BLUE2 
8507 ==>Number of layers = 0 
8508 ~~~~~
8509
8510 @subsubsection occt_draw_8_5_4  XWdump
8511
8512 Syntax:      
8513 ~~~~~
8514 XWdump <document> <filename>
8515 ~~~~~
8516
8517 Saves the contents of the viewer window as an image (XWD, png or BMP file). 
8518 <i>\<filename\></i> must have a corresponding extention. 
8519
8520 **Example:**
8521 ~~~~~
8522 XWdump D /disk1/tmp/image.png 
8523 ~~~~~
8524
8525 @subsubsection occt_draw_8_5_5  Xdump
8526
8527 Syntax:      
8528 ~~~~~
8529 Xdump <document> [int deep {0|1}]
8530 ~~~~~
8531
8532 Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes. 
8533
8534 **Example:**
8535 ~~~~~
8536 Xdump D 1 
8537 ==> ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
8538 ==> ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
8539 ==> ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
8540 ==> ASSEMBLY 0:1:1:4 PLATE(0xe8387780) 
8541 ==> ASSEMBLY 0:1:1:5 ROD(0xe8475418) 
8542 ==> ASSEMBLY 0:1:1:6 AS1(0xe8476968) 
8543 ==>    ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230) 
8544 ==>       ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
8545 ==>       ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0) 
8546 ==>               ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
8547 ==>               ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
8548 etc. 
8549 ~~~~~
8550
8551 @subsection occt_draw_8_6  XDE shape commands 
8552
8553 @subsubsection occt_draw_8_6_1  XAddComponent
8554
8555 Syntax:      
8556 ~~~~~
8557 XAddComponent <document> <label> <shape> 
8558 ~~~~~
8559
8560 Adds a component shape to assembly. 
8561
8562 **Example:**
8563
8564 Let us add shape b as component shape to assembly shape from label *0:1:1:1* 
8565
8566 ~~~~~
8567 XAddComponent D 0:1:1:1 b 
8568 ~~~~~
8569
8570 @subsubsection occt_draw_8_6_2  XAddShape
8571
8572 Syntax:      
8573 ~~~~~
8574 XAddShape <document> <shape> [makeassembly=1]
8575 ~~~~~
8576
8577 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. 
8578
8579 **Example:**
8580 ~~~~~
8581 # add shape b to document D 
8582 XAddShape D b 0 
8583 == 0:1:1:10 
8584 # if pointed shape is compound and last parameter in 
8585 # XAddShape command is used by default (1), then for 
8586 # each subshapes new label is created 
8587 ~~~~~
8588
8589 @subsubsection occt_draw_8_6_3  XFindComponent
8590
8591 Syntax:      
8592 ~~~~~
8593 XFindComponent <document> <shape>
8594 ~~~~~
8595
8596 Prints a sequence of labels of the assembly path. 
8597
8598 **Example:**
8599 ~~~~~
8600 XFindComponent D b 
8601 ~~~~~
8602
8603 @subsubsection occt_draw_8_6_4  XFindShape
8604
8605 Syntax:      
8606 ~~~~~
8607 XFindShape <document> <shape>
8608 ~~~~~
8609
8610 Finds and prints a label with an indicated top-level shape. 
8611
8612 **Example:**
8613 ~~~~~
8614 XFindShape D a 
8615 ~~~~~
8616
8617 @subsubsection occt_draw_8_6_5  XGetFreeShapes
8618
8619 Syntax:      
8620 ~~~~~
8621 XGetFreeShapes <document> [shape_prefix]
8622 ~~~~~
8623
8624 Print labels or create DRAW shapes for all free shapes in the document. 
8625 If *shape_prefix* is absent – prints labels, else – creates DRAW shapes with names 
8626 <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). 
8627
8628 **Note**: a free shape is a shape to which no other shape refers to. 
8629
8630 **Example:**
8631 ~~~~~
8632 XGetFreeShapes D 
8633 == 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13 
8634
8635 XGetFreeShapes D sh 
8636 == sh_1 sh_2 sh_3 sh_4 
8637 ~~~~~
8638
8639 @subsubsection occt_draw_8_6_6  XGetOneShape
8640
8641 Syntax:      
8642 ~~~~~
8643 XGetOneShape <shape> <document>
8644 ~~~~~
8645
8646 Creates one DRAW shape for all free shapes from a document. 
8647
8648 **Example:**
8649 ~~~~~
8650 XGetOneShape a D 
8651 ~~~~~
8652
8653 @subsubsection occt_draw_8_6_7  XGetReferredShape
8654
8655 Syntax:      
8656 ~~~~~
8657 XGetReferredShape <document> <label>
8658 ~~~~~
8659
8660 Prints a label that contains a top-level shape that corresponds to a shape at a given label. 
8661
8662 **Example:**
8663 ~~~~~
8664 XGetReferredShape D 0:1:1:1:1 
8665 ~~~~~
8666
8667 @subsubsection occt_draw_8_6_8  XGetShape
8668
8669 Syntax:      
8670 ~~~~~
8671 XGetShape <result> <document> <label>
8672 ~~~~~
8673
8674 Puts a shape from the indicated label in document to result. 
8675
8676 **Example:**
8677 ~~~~~
8678 XGetShape b D 0:1:1:3 
8679 ~~~~~
8680
8681 @subsubsection occt_draw_8_6_9  XGetTopLevelShapes
8682
8683 Syntax:      
8684 ~~~~~
8685 XGetTopLevelShapes <document>
8686 ~~~~~
8687
8688 Prints labels that contain top-level shapes. 
8689
8690 **Example:**
8691 ~~~~~
8692 XGetTopLevelShapes D 
8693 == 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 
8694 0:1:1:8 0:1:1:9 
8695 ~~~~~
8696
8697 @subsubsection occt_draw_8_6_10  XLabelInfo
8698
8699 Syntax:      
8700 ~~~~~
8701 XLabelInfo <document> <label>
8702 ~~~~~
8703
8704 Prints information about a shape, stored at an indicated label. 
8705
8706 **Example:** 
8707 ~~~~~    
8708 XLabelInfo D 0:1:1:6 
8709 ==> There are TopLevel shapes. There is an Assembly. This Shape is not used. 
8710 ~~~~~
8711
8712 @subsubsection occt_draw_8_6_11  XNewShape
8713
8714 Syntax:      
8715 ~~~~~
8716 XNewShape <document>
8717 ~~~~~
8718
8719 Creates a new empty top-level shape. 
8720
8721 **Example:**
8722 ~~~~~
8723 XNewShape D 
8724 ~~~~~
8725
8726 @subsubsection occt_draw_8_6_12  XRemoveComponent
8727
8728 Syntax:      
8729 ~~~~~
8730 XRemoveComponent <document> <label>
8731 ~~~~~
8732
8733 Removes a component from the components label. 
8734
8735 **Example:**
8736 ~~~~~
8737 XRemoveComponent D 0:1:1:1:1 
8738 ~~~~~
8739
8740 @subsubsection occt_draw_8_6_13  XRemoveShape
8741
8742 Syntax:      
8743 ~~~~~
8744 XRemoveShape <document> <label>
8745 ~~~~~
8746
8747 Removes a shape from a document (by it’s label). 
8748
8749 **Example:**
8750 ~~~~~
8751 XRemoveShape D 0:1:1:2 
8752 ~~~~~
8753
8754 @subsubsection occt_draw_8_6_14  XSetShape
8755
8756 Syntax:      
8757 ~~~~~
8758 XSetShape <document> <label> <shape>
8759 ~~~~~
8760
8761 Sets a shape at the indicated label. 
8762
8763 **Example:**
8764 ~~~~~
8765 XSetShape D 0:1:1:3 b 
8766 ~~~~~
8767
8768
8769 @subsection occt_draw_8_7_  XDE color commands 
8770
8771 @subsubsection occt_draw_8_7_1  XAddColor
8772
8773 Syntax:      
8774 ~~~~~
8775 XAddColor <document> <R> <G> <B>
8776 ~~~~~
8777
8778 Adds color in document to the color table. Parameters R,G,B are real. 
8779
8780 **Example:**
8781 ~~~~~
8782 XAddColor D 0.5 0.25 0.25 
8783 ~~~~~
8784
8785 @subsubsection occt_draw_8_7_2  XFindColor
8786
8787 Syntax:      
8788 ~~~~~
8789 XFindColor <document> <R> <G> <B>
8790 ~~~~~
8791
8792 Finds a label where the indicated color is situated. 
8793
8794 **Example:**
8795 ~~~~~
8796 XFindColor D 0.25 0.25 0.5 
8797 ==> 0:1:2:2 
8798 ~~~~~
8799
8800 @subsubsection occt_draw_8_7_3  XGetAllColors
8801
8802 Syntax:      
8803 ~~~~~
8804 XGetAllColors <document> 
8805 ~~~~~
8806
8807 Prints all colors that are defined in the document. 
8808
8809 **Example:**
8810 ~~~~~
8811 XGetAllColors D 
8812 ==> RED DARKORANGE BLUE1 GREEN YELLOW3 
8813 ~~~~~
8814
8815 @subsubsection occt_draw_8_7_4  XGetColor
8816
8817 Syntax:      
8818 ~~~~~
8819 XGetColor <document> <label>
8820 ~~~~~
8821
8822 Returns a color defined at the indicated label from the color table. 
8823
8824 **Example:**
8825 ~~~~~
8826 XGetColor D 0:1:2:3 
8827 == BLUE1 
8828 ~~~~~
8829
8830 @subsubsection occt_draw_8_7_5  XGetObjVisibility
8831
8832 Syntax:      
8833 ~~~~~
8834 XGetObjVisibility <document> {<label>|<shape>}
8835 ~~~~~
8836
8837 Returns the visibility of a shape. 
8838
8839 **Example:**
8840 ~~~~~
8841 XGetObjVisibility D 0:1:1:4 
8842 ~~~~~
8843
8844 @subsubsection occt_draw_8_7_6  XGetShapeColor
8845
8846 Syntax:      
8847 ~~~~~
8848 XGetShapeColor <document> <label> <colortype(s|c)>
8849 ~~~~~
8850
8851 Returns the color defined by label. If <i>colortype</i>=’s’ – returns surface color, else – returns curve color. 
8852
8853 **Example:**
8854 ~~~~~
8855 XGetShapeColor D 0:1:1:4 c 
8856 ~~~~~
8857
8858 @subsubsection occt_draw_8_7_7  XRemoveColor
8859
8860 Syntax:      
8861 ~~~~~
8862 XRemoveColor <document> <label>
8863 ~~~~~
8864
8865 Removes a color from the color table in a document. 
8866
8867 **Example:**
8868 ~~~~~
8869 XRemoveColor D 0:1:2:1 
8870 ~~~~~
8871
8872 @subsubsection occt_draw_8_7_8  XSetColor
8873
8874 Syntax:      
8875 ~~~~~
8876 XSetColor <document> {<label>|<shape>} <R> <G> <B>
8877 ~~~~~
8878
8879 Sets an RGB color to a shape given by label. 
8880
8881 **Example:**
8882 ~~~~~
8883 XsetColor D 0:1:1:4 0.5 0.5 0. 
8884 ~~~~~
8885
8886 @subsubsection occt_draw_8_7_9  XSetObjVisibility
8887
8888 Syntax:      
8889 ~~~~~
8890 XSetObjVisibility <document> {<label>|<shape>} {0|1}
8891 ~~~~~
8892
8893 Sets the visibility of a shape. 
8894
8895 **Example:**
8896 ~~~~~
8897 # set shape from label 0:1:1:4 as invisible 
8898 XSetObjVisibility D 0:1:1:4 0 
8899 ~~~~~
8900
8901 @subsubsection occt_draw_8_7_10  XUnsetColor
8902
8903 Syntax:      
8904 ~~~~~
8905 XUnsetColor <document> {<label>|<shape>} <colortype>
8906 ~~~~~
8907
8908 Unset a color given type (‘s’ or ‘c’) for the indicated shape. 
8909
8910 **Example:**
8911 ~~~~~
8912 XUnsetColor D 0:1:1:4 s 
8913 ~~~~~
8914
8915
8916 @subsection occt_draw_8_8_  XDE layer commands 
8917
8918 @subsubsection occt_draw_8_8_1  XAddLayer
8919
8920 Syntax:      
8921 ~~~~~
8922 XAddLayer <document> <layer>
8923 ~~~~~
8924
8925 Adds a new layer in an XCAF document. 
8926
8927 **Example:**
8928 ~~~~~
8929 XAddLayer D layer2 
8930 ~~~~~
8931
8932 @subsubsection occt_draw_8_8_2  XFindLayer
8933
8934 Syntax:      
8935 ~~~~~
8936 XFindLayer <document> <layer>
8937 ~~~~~
8938
8939 Prints a label where a layer is situated. 
8940
8941 **Example:**
8942 ~~~~~
8943 XFindLayer D Bolt 
8944 == 0:1:3:2 
8945 ~~~~~
8946
8947 @subsubsection occt_draw_8_8_3  XGetAllLayers
8948
8949 Syntax:      
8950 ~~~~~
8951 XGetAllLayers <document> 
8952 ~~~~~
8953
8954 Prints all layers in an XCAF document. 
8955
8956 **Example:**
8957 ~~~~~
8958 XGetAllLayers D 
8959 == *0:1:1:3* *Bolt* *0:1:1:9* 
8960 ~~~~~
8961
8962 @subsubsection occt_draw_8_8_4  XGetLayers
8963
8964 Syntax:      
8965 ~~~~~
8966 XGetLayers <document> {<shape>|<label>}
8967 ~~~~~
8968
8969 Returns names of layers, which are pointed to by links of an indicated shape. 
8970
8971 **Example:**
8972 ~~~~~
8973 XGetLayers D 0:1:1:3 
8974 == *bolt* *123* 
8975 ~~~~~
8976
8977 @subsubsection occt_draw_8_8_5  XGetOneLayer
8978
8979 Syntax:      
8980 ~~~~~
8981 XGetOneLayer <document> <label>
8982 ~~~~~
8983
8984 Prints the name of a layer at a given label. 
8985
8986 **Example:**
8987 ~~~~~
8988 XGetOneLayer D 0:1:3:2 
8989 ~~~~~
8990
8991 @subsubsection occt_draw_8_8_6  XIsVisible
8992
8993 Syntax:      
8994 ~~~~~
8995 XIsVisible <document> {<label>|<layer>}
8996 ~~~~~
8997
8998 Returns 1 if the indicated layer is visible, else returns 0. 
8999
9000 **Example:**
9001 ~~~~~
9002 XIsVisible D 0:1:3:1 
9003 ~~~~~
9004
9005 @subsubsection occt_draw_8_8_7  XRemoveAllLayers
9006
9007 Syntax:      
9008 ~~~~~
9009 XRemoveAllLayers <document> 
9010 ~~~~~
9011
9012 Removes all layers from an XCAF document. 
9013
9014 **Example:**
9015 ~~~~~
9016 XRemoveAllLayers D 
9017 ~~~~~
9018
9019 @subsubsection occt_draw_8_8_8  XRemoveLayer
9020
9021 Syntax:      
9022 ~~~~~
9023 XRemoveLayer <document> {<label>|<layer>}
9024 ~~~~~
9025
9026 Removes the indicated layer from an XCAF document. 
9027
9028 **Example:**
9029 ~~~~~
9030 XRemoveLayer D layer2 
9031 ~~~~~
9032
9033 @subsubsection occt_draw_8_8_9  XSetLayer
9034
9035 Syntax:      
9036 ~~~~~
9037 XSetLayer XSetLayer <document> {<shape>|<label>} <layer> [shape_in_one_layer {0|1}]
9038
9039 ~~~~~
9040  
9041 Sets a reference between a shape and a layer (adds a layer if it is necessary). 
9042 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). 
9043
9044 **Example:**
9045 ~~~~~
9046 XSetLayer D 0:1:1:2 layer2 
9047 ~~~~~
9048
9049 @subsubsection occt_draw_8_8_10  XSetVisibility
9050
9051 Syntax:      
9052 ~~~~~
9053 XSetVisibility <document> {<label>|<layer>} <isvisible {0|1}>
9054 ~~~~~
9055
9056 Sets the visibility of a layer. 
9057
9058 **Example:**
9059 ~~~~~
9060 # set layer at label 0:1:3:2 as invisible 
9061 XSetVisibility D 0:1:3:2 0 
9062 ~~~~~
9063
9064 @subsubsection occt_draw_8_8_11  XUnSetAllLayers
9065
9066 Syntax:      
9067 ~~~~~
9068 XUnSetAllLayers <document> {<label>|<shape>}
9069 ~~~~~
9070
9071 Unsets a shape from all layers. 
9072
9073 **Example:**
9074 ~~~~~
9075 XUnSetAllLayers D 0:1:1:2 
9076 ~~~~~
9077
9078 @subsubsection occt_draw_8_8_12  XUnSetLayer
9079
9080 Syntax:      
9081 ~~~~~
9082 XUnSetLayer <document> {<label>|<shape>} <layer>
9083 ~~~~~
9084
9085 Unsets a shape from the indicated layer. 
9086
9087 **Example:**
9088 ~~~~~
9089 XUnSetLayer D 0:1:1:2 layer1 
9090 ~~~~~
9091
9092 @subsection occt_draw_8_9  XDE property commands 
9093
9094 @subsubsection occt_draw_8_9_1  XCheckProps
9095
9096 Syntax:      
9097 ~~~~~
9098 XCheckProps <document> [ {0|deflection} [<shape>|<label>] ]
9099 ~~~~~
9100
9101 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. 
9102
9103 **Example:**
9104 ~~~~~
9105 # check properties for shapes at label 0:1:1:1 from 
9106 # document using standard Open CASCADE Technology tools 
9107 XCheckProps D 0 0:1:1:1 
9108 == Label 0:1:1:1      ;L-BRACKET* 
9109 ==  Area defect:        -0.0 (  0%) 
9110 ==  Volume defect:       0.0 (  0%) 
9111 ==  CG defect: dX=-0.000, dY=0.000, dZ=0.000 
9112 ~~~~~
9113
9114 @subsubsection occt_draw_8_9_2  XGetArea
9115
9116 Syntax:      
9117 ~~~~~
9118 XGetArea <document> {<shape>|<label>}
9119 ~~~~~
9120
9121 Returns the area of a given shape. 
9122
9123 **Example:**
9124 ~~~~~
9125 XGetArea D 0:1:1:1 
9126 == 24628.31815094999 
9127 ~~~~~
9128
9129 @subsubsection occt_draw_8_9_3  XGetCentroid
9130
9131 Syntax:      
9132 ~~~~~
9133 XGetCentroid <document> {<shape>|<label>}
9134 ~~~~~
9135
9136 Returns the center of gravity coordinates of a given shape. 
9137
9138 **Example:**
9139 ~~~~~
9140 XGetCentroid D 0:1:1:1 
9141 ~~~~~
9142
9143 @subsubsection occt_draw_8_9_4  XGetVolume
9144
9145 Syntax:      
9146 ~~~~~
9147 XGetVolume <document> {<shape>|<label>}
9148 ~~~~~
9149
9150 Returns the volume of a given shape. 
9151
9152 **Example:**
9153 ~~~~~
9154 XGetVolume D 0:1:1:1 
9155 ~~~~~
9156
9157 @subsubsection occt_draw_8_9_5  XSetArea
9158
9159 Syntax:      
9160 ~~~~~
9161 XSetArea <document> {<shape>|<label>} <area>
9162 ~~~~~
9163
9164 Sets new area to attribute list ??? given shape. 
9165
9166 **Example:**
9167 ~~~~~
9168 XSetArea D 0:1:1:1 2233.99 
9169 ~~~~~
9170
9171 @subsubsection occt_draw_8_9_6  XSetCentroid
9172
9173 Syntax:      
9174 ~~~~~
9175 XSetCentroid <document> {<shape>|<label>} <x> <y> <z>
9176 ~~~~~
9177
9178 Sets new center of gravity  to the attribute list given shape. 
9179
9180 **Example:**
9181 ~~~~~
9182 XSetCentroid D 0:1:1:1 0. 0. 100. 
9183 ~~~~~
9184
9185 @subsubsection occt_draw_8_9_7  XSetMaterial
9186
9187 Syntax:      
9188 ~~~~~
9189 XSetMaterial <document> {<shape>|<label>} <name> <density(g/cu sm)>
9190 ~~~~~ 
9191
9192 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. 
9193
9194 **Example:**
9195 ~~~~~
9196 XSetMaterial D 0:1:1:1 Titanium 8899.77 
9197 ~~~~~
9198
9199 @subsubsection occt_draw_8_9_8  XSetVolume
9200
9201 Syntax:      
9202 ~~~~~
9203 XSetVolume <document> {<shape>|<label>} <volume>
9204 ~~~~~
9205
9206 Sets new volume to the attribute list ??? given shape. 
9207
9208 **Example:**
9209 ~~~~~
9210 XSetVolume D 0:1:1:1 444555.33 
9211 ~~~~~
9212
9213 @subsubsection occt_draw_8_9_9  XShapeMassProps
9214
9215 Syntax:      
9216 ~~~~~
9217 XShapeMassProps <document> [ <deflection> [{<shape>|<label>}] ]
9218 ~~~~~
9219
9220 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. 
9221
9222 **Example:**
9223 ~~~~~
9224 XShapeMassProps D 
9225 == Shape from label : 0:1:1:1 
9226 == Mass = 193.71681469282299 
9227 == CenterOfGravity X = 14.594564763807696,Y = 
9228     20.20271885211281,Z = 49.999999385313245 
9229 == Shape from label : 0:1:1:2 not have a mass 
9230 etc. 
9231 ~~~~~
9232
9233 @subsubsection occt_draw_8_9_10  XShapeVolume
9234
9235 Syntax:      
9236 ~~~~~
9237 XShapeVolume <shape> <deflection>
9238 ~~~~~
9239
9240 Calculates the real volume of a pointed shape with a given deflection. 
9241
9242 **Example:**
9243 ~~~~~
9244 XShapeVolume a 0 
9245 ~~~~~
9246
9247 @section occt_draw_9 Shape Healing commands
9248
9249
9250
9251 @subsection occt_draw_9_1 General commands 
9252
9253 @subsubsection occt_draw_9_1_1 bsplres
9254
9255 Syntax:      
9256 ~~~~~
9257 bsplres <result> <shape> <tol3d> <tol2d< <reqdegree> <reqnbsegments> <continuity3d> <continuity2d> <PriorDeg> <RationalConvert>
9258 ~~~~~
9259
9260 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**). 
9261
9262 @subsubsection occt_draw_9_1_2 checkfclass2d
9263
9264 Syntax:      
9265 ~~~~~
9266 checkfclass2d <face> <ucoord> <vcoord>
9267 ~~~~~
9268
9269 Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds. 
9270
9271 **Example:**
9272 ~~~~~
9273 checkfclass2d f 10.5 1.1 
9274 == Point is OUT 
9275 ~~~~~
9276
9277 @subsubsection occt_draw_9_1_3 checkoverlapedges
9278
9279 Syntax:      
9280 ~~~~~
9281 checkoverlapedges <edge1> <edge2> [<toler> <domaindist>]
9282 ~~~~~
9283
9284 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. 
9285
9286 **Example:**
9287 ~~~~~
9288 checkoverlapedges e1 e2 
9289 ~~~~~
9290
9291 @subsubsection occt_draw_9_1_4 comtol
9292
9293 Syntax:      
9294 ~~~~~
9295 comptol <shape> [nbpoints] [prefix]
9296 ~~~~~
9297
9298 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. 
9299
9300 **Example:** 
9301 ~~~~~    
9302 comptol h 871 t 
9303
9304 ==> Edges tolerance computed by 871 points: 
9305 ==> MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009 MIN=0 
9306 ==> Relation real tolerance / tolerance set in edge 
9307 ==> MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0 
9308 ==> Edge with max tolerance saved to t_edge_tol 
9309 ==> Concerned faces saved to shapes t_1, t_2 
9310 ~~~~~
9311
9312 @subsubsection occt_draw_9_1_5 convtorevol
9313
9314 Syntax:      
9315 ~~~~~
9316 convtorevol <result> <shape>
9317 ~~~~~
9318
9319 Converts all elementary surfaces of a given shape into surfaces of revolution. 
9320 Results are put into the shape, which is given as the <i>\<result\></i> parameter. 
9321
9322 **Example:**
9323 ~~~~~
9324 convtorevol r a 
9325 ~~~~~
9326
9327 @subsubsection occt_draw_9_1_6 directfaces
9328
9329 Syntax:      
9330 ~~~~~
9331 directfaces <result> <shape>
9332 ~~~~~
9333
9334 Converts indirect surfaces and returns the results into the shape, which is given as the result parameter. 
9335
9336 **Example:**
9337 ~~~~~
9338 directfaces r a 
9339 ~~~~~
9340
9341 @subsubsection occt_draw_9_1_7 expshape
9342
9343 Syntax:   
9344 ~~~~~
9345 expshape <shape> <maxdegree> <maxseg>
9346 ~~~~~
9347
9348 Gives statistics for a given shape. This test command is working with Bezier and BSpline entities. 
9349
9350 **Example:**
9351 ~~~~~
9352 expshape a 10 10 
9353 ==> Number of Rational Bspline curves 128 
9354 ==> Number of Rational Bspline pcurves 48 
9355 ~~~~~
9356
9357 @subsubsection occt_draw_9_1_8 fixsmall
9358
9359 Syntax:      
9360 ~~~~~
9361 fixsmall <result> <shape> [<toler>=1.]
9362 ~~~~~
9363
9364 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. 
9365
9366 **Example:**
9367 ~~~~~
9368 fixsmall r a 0.1 
9369 ~~~~~
9370
9371 @subsubsection occt_draw_9_1_9 fixsmalledges
9372
9373 Syntax:      
9374 ~~~~~
9375 fixsmalledges <result> <shape> [<toler> <mode> <maxangle>]
9376 ~~~~~
9377
9378 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. 
9379
9380 **Example:**
9381 ~~~~~
9382 fixsmalledges r a 0.1 1 
9383 ~~~~~
9384
9385 @subsubsection occt_draw_9_1_10 fixshape
9386
9387 Syntax:      
9388 ~~~~~
9389 fixshape <result> <shape> [<preci> [<maxpreci>]] [{switches}]
9390 ~~~~~
9391
9392 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 
9393
9394 The following syntax is used: 
9395 * <i>\<symbol\></i> may be
9396   * "-" to set parameter off, 
9397   * "+" to set on or  
9398   * "*" to set default 
9399 * <i>\<parameter\></i> is identified by  letters: 
9400   * l - FixLackingMode 
9401   * o - FixOrientationMode 
9402   * h - FixShiftedMode 
9403   * m - FixMissingSeamMode 
9404   * d - FixDegeneratedMode 
9405   * s - FixSmallMode 
9406   * i - FixSelfIntersectionMode 
9407   * n - FixNotchedEdgesMode 
9408 For enhanced message output, use switch '+?' 
9409
9410 **Example:**
9411 ~~~~~
9412 fixshape r a 0.001 
9413 ~~~~~
9414
9415 @subsubsection occt_draw_9_1_11 fixwgaps
9416
9417 Syntax:      
9418 ~~~~~
9419 fixwgaps <result> <shape> [<toler>=0]
9420 ~~~~~
9421
9422 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. 
9423
9424 **Example:**
9425 ~~~~~
9426 fixwgaps r a 
9427 ~~~~~
9428
9429 @subsubsection occt_draw_9_1_12 offsetcurve, offset2dcurve
9430
9431 Syntax:      
9432 ~~~~~
9433 offsetcurve <result> <curve> <offset> <direction(as point)>
9434 offset2dcurve <result> <curve> <offset>
9435 ~~~~~
9436
9437 **offsetcurve** works with the curve in 3d space, **offset2dcurve** in 2d space. 
9438
9439 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>.  
9440
9441 **Example:**
9442 ~~~~~
9443 point pp 10 10 10 
9444 offsetcurve r c 20 pp 
9445 ~~~~~
9446
9447 @subsubsection occt_draw_9_1_13 projcurve
9448
9449 Syntax:      
9450 ~~~~~
9451 projcurve <edge>|<curve3d>|<curve3d first last>  <X> <Y> <Z>
9452 ~~~~~
9453
9454 **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. 
9455
9456 **Example:** 
9457 ~~~~~    
9458 projcurve k_1 0 1 5 
9459 ==Edge k_1 Params from 0 to 1.3 
9460 ==Precision (BRepBuilderAPI) : 9.9999999999999995e-008  ==Projection : 0  1  5 
9461 ==Result : 0  1.1000000000000001  0 
9462 ==Param = -0.20000000000000001  Gap = 5.0009999000199947 
9463 ~~~~~
9464
9465 @subsubsection occt_draw_9_1_14 projface
9466
9467 Syntax:      
9468 ~~~~~
9469 projface <face> <X> <Y> [<Z>]
9470 ~~~~~
9471
9472 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. 
9473
9474 **Example:**
9475 ~~~~~
9476 projface a_1 10.0 0.0 
9477 ==  Point UV  U = 10  V = 0 
9478 ==   =   proj  X = -116  Y = -45  Z = 0 
9479 ~~~~~
9480
9481 @subsubsection occt_draw_9_1_15 scaleshape
9482
9483 Syntax:   
9484 ~~~~~
9485 scaleshape <result> <shape> <scale>
9486 ~~~~~
9487
9488 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.
9489
9490 **Example:**
9491 ~~~~~
9492 scaleshape r a_1 0.8 
9493 ~~~~~
9494
9495 @subsubsection occt_draw_9_1_16 settolerance
9496
9497 Syntax:      
9498 ~~~~~
9499 settolerance <shape> [<mode>=v-e-w-f-a] <val>(fix value) or
9500                    <tolmin> <tolmax>
9501 ~~~~~ 
9502
9503 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. 
9504
9505 **Example:**
9506 ~~~~~
9507 settolerance a 0.001 
9508 ~~~~~
9509
9510 @subsubsection occt_draw_9_1_17 splitface
9511
9512 Syntax:      
9513 ~~~~~
9514 splitface <result> <face> [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
9515 ~~~~~
9516
9517 Splits a given face in parametric space and puts the result into the given parameter <i>\<result\></i>. 
9518 Returns the status of split face. 
9519
9520 **Example:**
9521 ~~~~~
9522 # split face f by parameter u = 5 
9523 splitface r f u 5 
9524 ==> Splitting by   U:   ,5 
9525 ==> Status:  DONE1 
9526 ~~~~~
9527
9528 @subsubsection occt_draw_9_1_18 statshape
9529
9530 Syntax:      
9531 ~~~~~
9532 statshape <shape> [particul]
9533 ~~~~~
9534
9535 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 
9536 surfaces. The last parameter becomes out of date. 
9537
9538 **Example:**
9539 ~~~~~
9540 statshape a 
9541 ==> Count     Item 
9542 ==> -----     ---- 
9543 ==> 402     Edge (oriented) 
9544 ==> 402     Edge (Shared) 
9545 ==> 74      Face 
9546 ==> 74      Face (Free) 
9547 ==> 804     Vertex (Oriented) 
9548 ==> 402     Vertex (Shared) 
9549 ==> 78      Wire 
9550 ==> 4      Face with more than one wire 
9551 ==> 34     bspsur: BSplineSurface 
9552 ~~~~~
9553
9554 @subsubsection occt_draw_9_1_19 tolerance
9555
9556 Syntax:
9557 ~~~~~
9558 tolerance <shape> [<mode>:D v e f c] [<tolmin> <tolmax>:real]
9559 ~~~~~
9560
9561 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. 
9562
9563 **Example:**
9564 ~~~~~
9565 tolerance a 
9566 ==> Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08 
9567 ==> FACE    : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08 
9568 ==> EDGE    : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08 
9569 ==> VERTEX  : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08 
9570
9571 tolerance a v 0.1 0.001 
9572 ==>  Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6 
9573 ~~~~~
9574
9575
9576 @subsection occt_draw_9_2 Conversion commands 
9577
9578 @subsubsection occt_draw_9_2_1 DT_ClosedSplit
9579
9580 Syntax:      
9581 ~~~~~
9582 DT_ClosedSplit <result> <shape>
9583 ~~~~~
9584
9585 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. 
9586 Note: Closed face – it’s face with one or more seam. 
9587
9588 **Example:**
9589 ~~~~~
9590 DT_ClosetSplit r a 
9591 ~~~~~
9592
9593 @subsubsection occt_draw_9_2_2 DT_ShapeConvert, DT_ShapeConvertRev
9594
9595 Syntax:      
9596 ~~~~~
9597 DT_ShapeConvert <result> <shape> <convert2d> <convert3d>
9598 DT_ShapeConvertRev <result> <shape> <convert2d> <convert3d>
9599 ~~~~~
9600  
9601 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. 
9602
9603 **Example:**
9604 ~~~~~
9605 DT_ShapeConvert r a 1 1 
9606 == Status: DONE1 
9607 ~~~~~
9608
9609 @subsubsection occt_draw_9_2_3 DT_ShapeDivide
9610
9611 Syntax:      
9612 ~~~~~
9613 DT_ShapeDivide <result> <shape> <tol>
9614 ~~~~~
9615
9616 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: 
9617  * OK      : no splitting was done 
9618  * Done1 : Some edges were split 
9619  * Done2 : Surface was split 
9620  * Fail1    : Some errors occurred 
9621
9622 **Example:**
9623 ~~~~~
9624 DT_ShapeDivide r a 0.001 
9625 == Status: OK 
9626 ~~~~~
9627
9628 @subsubsection occt_draw_9_2_4 DT_SplitAngle
9629
9630 Syntax:      
9631 ~~~~~
9632 DT_SplitAngle <result> <shape> [MaxAngle=95]
9633 ~~~~~
9634
9635 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. 
9636 This command illustrates how class *ShapeUpgrade_ShapeDivideAngle* works. 
9637
9638 **Example:**
9639 ~~~~~
9640 DT_SplitAngle r a 
9641 == Status: DONE2 
9642 ~~~~~
9643
9644 @subsubsection occt_draw_9_2_5 DT_SplitCurve
9645
9646 Syntax:      
9647 ~~~~~
9648 DT_SplitCurve <curve> <tol> <split(0|1)>
9649 ~~~~~
9650
9651 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. 
9652
9653 **Example:**
9654 ~~~~~
9655 DT_SplitCurve r c 
9656 ~~~~~
9657
9658 @subsubsection occt_draw_9_2_6 DT_SplitCurve2d
9659
9660 Syntax:      
9661 ~~~~~
9662 DT_SplitCurve2d Curve Tol Split(0/1) 
9663 ~~~~~
9664
9665 Works just as **DT_SplitCurve** (see above), only with 2d curve. 
9666
9667 **Example:**
9668 ~~~~~
9669 DT_SplitCurve2d r c 
9670 ~~~~~
9671
9672 @subsubsection occt_draw_9_2_7 DT_SplitSurface
9673
9674 Syntax:      
9675 ~~~~~
9676 DT_SplitSurface <result> <Surface|GridSurf> <tol> <split(0|1)>
9677 ~~~~~
9678
9679 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. 
9680
9681 **Example:** 
9682 ~~~~~
9683
9684 ~~~~~
9685 # split surface with name "su"
9686 DT_SplitSurface res su 0.1 1 
9687 ==> single surf 
9688 ==> appel a SplitSurface::Init 
9689 ==> appel a SplitSurface::Build 
9690 ==> appel a SplitSurface::GlobalU/VKnots 
9691 ==> nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1 
9692 ==> appel a Surfaces 
9693 ==> transfert resultat 
9694 ==> res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1 
9695 ~~~~~
9696 ~~~~~
9697
9698 @subsubsection occt_draw_9_2_8 DT_ToBspl
9699
9700 Syntax:
9701 ~~~~~
9702 DT_ToBspl <result> <shape>
9703 ~~~~~
9704
9705 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. 
9706
9707 **Example:** 
9708 ~~~~~    
9709 DT_ToBspl res sh 
9710 == error = 5.20375663162094e-08   spans = 10 
9711 ==  Surface is aproximated with continuity 2 
9712 ~~~~~
9713
9714 @section occt_draw_10 Performance evaluation commands
9715
9716
9717 @subsection occt_draw_10_1 VDrawSphere
9718
9719 Syntax:      
9720 ~~~~~
9721 vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0] 
9722 ~~~~~
9723
9724 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. 
9725
9726 This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter. 
9727
9728 **Example:** 
9729 ~~~~~
9730 vdrawsphere s 200 1 1 1 500 1 
9731 == Compute Triangulation... 
9732 == NumberOfPoints: 39602 
9733 == NumberOfTriangles: 79200 
9734 == Amount of memory required for PolyTriangulation without Normals: 2 Mb 
9735 == Amount of memory for colors: 0 Mb 
9736 == Amount of memory for PolyConnect: 1 Mb 
9737 == Amount of graphic card memory required: 2 Mb 
9738 == Number of scene redrawings: 1 
9739 == CPU user time: 15.6000999999998950 msec 
9740 == CPU system time: 0.0000000000000000 msec 
9741 == CPU average time of scene redrawing: 15.6000999999998950 msec 
9742 ~~~~~
9743
9744
9745 @section occt_draw_11 Extending Test Harness with custom commands
9746
9747
9748 The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism. 
9749
9750
9751 @subsection occt_draw_11_1 Custom command implementation
9752
9753 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. 
9754
9755 **Example:** 
9756 ~~~~~
9757 static Standard_Integer myadvcurve(Draw_Interpretor& di, Standard_Integer n, char** a) 
9758
9759 ... 
9760
9761 ~~~~~
9762
9763 For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx). 
9764
9765
9766 @subsection occt_draw_11_2 Registration of commands in Test Harness
9767
9768 To become available in the Test Harness the custom command must be registered in it. This should be done as follows. 
9769
9770 **Example:** 
9771 ~~~~~
9772 void MyPack::CurveCommands(Draw_Interpretor& theCommands) 
9773
9774 ... 
9775 char* g = "Advanced curves creation"; 
9776
9777 theCommands.Add ( "myadvcurve", "myadvcurve name p1 p2 p3 – Creates my advanced curve from points", 
9778                   __FILE__, myadvcurve, g ); 
9779 ... 
9780
9781 ~~~~~
9782
9783 @subsection occt_draw_11_3 Creating a toolkit (library) as a plug-in
9784
9785 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. 
9786
9787 This exported function *PLUGINFACTORY()* must be implemented only once per library. 
9788
9789 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. 
9790
9791 **Example:** 
9792 ~~~~~
9793 #include <Draw_PluginMacro.hxx>
9794
9795 void MyPack::Factory(Draw_Interpretor& theDI)
9796 {
9797 ...
9798 // 
9799 MyPack::CurveCommands(theDI);
9800 ...
9801 }
9802
9803 // Declare entry point PLUGINFACTORY
9804 DPLUGIN(MyPack)
9805 ~~~~~
9806
9807 @subsection occt_draw_11_4 Creation of the plug-in resource file
9808
9809 As mentioned above, the plug-in resource file must be compliant with Open CASCADE Technology requirements (see *Resource_Manager.cdl* file for details). In particular, it should contain keys separated from their values by a colon (;:;). 
9810 For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name. 
9811 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. 
9812 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. 
9813
9814 **Examples** (file MyDrawPlugin): 
9815 ~~~~~
9816 ! Hierarchy of plug-ins 
9817 ALL                : ADVMODELING, MESHING 
9818 DEFAULT            : MESHING 
9819 ADVMODELING        : ADVSURF, ADVCURV 
9820
9821 ! Mapping from naming to toolkits (libraries) 
9822 ADVSURF            : TKMyAdvSurf 
9823 ADVCURV            : TKMyAdvCurv 
9824 MESHING            : TKMyMesh 
9825 ~~~~~
9826
9827 For other examples of the plug-in resource file refer to the <a href="#occt_draw_1_3_2">Plug-in resource file</a> chapter above or to the <i>$CASROOT/src/DrawPlugin</i> file shipped with Open CASCADE Technology. 
9828
9829
9830 @subsection occt_draw_11_5 Dynamic loading and activation
9831
9832 Loading a plug-in and activating its commands is described in the <a href="#occt_draw_1_3_3">Activation of the commands implemented in the plug-in</a> chapter. 
9833
9834 The procedure consists in defining the system variables and using the pload commands in the Test Harness session. 
9835
9836 **Example:** 
9837 ~~~~
9838 Draw[]> set env(CSF_MyDrawPluginDefaults) /users/test
9839 Draw[]> pload -MyDrawPlugin ALL
9840 ~~~~
9841