576d5dfb05be0b7c1756cbbf0a62f5e451ee957c
[occt.git] / dox / user_guides / draw_test_harness.md
1 Draw Test Harness  {#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**). It provides basic documentation on using Draw. For advanced information on Draw and its applications, see our offerings on our web site at <a href="http://www.opencascade.org/support/training">http://www.opencascade.org/support/training</a>  
9
10 Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries. 
11
12
13 @subsection occt_draw_1_1 Overview
14
15 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. 
16
17 Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes. 
18
19 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. 
20
21 Draw consists of: 
22
23   * A command interpreter based on the TCL command language.
24   * A 3d graphic viewer based on the X system.
25   * A basic set of commands covering scripts, variables and graphics.
26   * 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.
27   * A set of topological commands allowing the user to create and modify BRep shapes and to use the OCCT topology algorithms.
28
29
30 There is also a set of commands for each delivery unit in the modeling libraries: 
31
32   * GEOMETRY, 
33   * TOPOLOGY, 
34   * ADVALGOS, 
35   * GRAPHIC, 
36   * PRESENTATION. 
37
38
39 @subsection occt_draw_1_2 Contents of this documentation
40
41 This documentation describes: 
42
43   * The command language.
44   * The basic set of commands.
45   * The graphical commands.
46   * The Geometry set of commands.
47   * The Topology set of commands.
48
49 This document does not describe other sets of commands and does not explain how to extend Draw using C++. 
50
51 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. 
52
53 ~~~~~
54 exit
55 ~~~~~
56
57 Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file. 
58
59 **Example:** 
60
61 ~~~~~
62 # this is a very short example 
63 exit 
64 ~~~~~
65
66
67 @subsection occt_draw_1_3 Getting started
68
69 Install Draw and launch Emacs. Get a command line in Emacs using *Esc x *and key in *woksh*. 
70
71 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. 
72
73 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. 
74
75 @subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
76
77 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).  
78
79
80 @subsubsection occt_draw_1_3_2 Plug-in resource file
81
82 Open CASCADE Technology is shipped with the DrawPlugin resource file located in the <i>$CASROOT/src/DrawResources</i> directory. 
83
84 The format of the file is compliant with standard Open CASCADE Technology resource files (see the *Resource_Manager.cdl* file for details). 
85
86 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. 
87
88 **Example:** (excerpt from DrawPlugin): 
89 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
90 OCAF               : VISUALIZATION, OCAFKERNEL 
91 VISUALIZATION      : AISV 
92 OCAFKERNEL         : DCAF 
93
94 DCAF               : TKDCAF 
95 AISV               : TKViewerTest 
96 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
98 @subsubsection occt_draw_1_3_3 Activation of commands implemented in the plug-in
99
100 To load a plug-in declared in the resource file and to activate the commands the following command must be used in Test Harness: 
101
102 ~~~~~
103 pload [-PluginFileName] [[Key1] [Key2]...]
104 ~~~~~
105
106 , where: 
107
108 * *-PluginFileName* - defines the name of a plug-in resource file (prefix "-" is mandatory) described above. 
109 If this parameter is omitted then the default name DrawPlugin is used. 
110 * *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). 
111
112 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. 
113
114 ~~~~~
115 Draw[]        pload -DrawPlugin OCAF 
116 ~~~~~
117 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. 
118
119 ~~~~~
120 Draw[]        pload (equivalent to pload -DrawPlugin DEFAULT). 
121 ~~~~~
122 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. 
123
124
125 @section occt_draw_2 The Command Language
126
127 @subsection occt_draw_2_1 Overview
128
129 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. 
130
131 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: 
132
133   * Syntax of the TCL language.
134   * Accessing variables in TCL and Draw.
135   * Control structures.
136   * Procedures.
137
138 @subsection occt_draw_2_2 Syntax of TCL
139
140 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. 
141
142 The basic program for TCL is a script. A script consists of one or more commands. Commands are separated by new lines or semicolons. 
143
144 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
145 set a 24 
146 set b 15 
147 set a 25; set b 15 
148 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149
150 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. 
151
152 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. 
153
154 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. 
155
156 The following substitutions are performed by TCL: 
157
158 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. 
159
160 **Example:** 
161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
162 # set a variable value 
163 set file documentation 
164 puts $file #to display file contents on the screen 
165
166 # a simple substitution, set psfile to documentation.ps 
167 set psfile $file.ps 
168 puts $psfile 
169
170 # another substitution, set pfile to documentationPS 
171 set pfile ${file}PS 
172
173 # a last one, 
174 # delete files NEWdocumentation and OLDdocumentation 
175 foreach prefix {NEW OLD} {rm $prefix$file} 
176 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177
178 Command substitution is triggered by the [ ] characters. The brackets must enclose a valid script. The script is evaluated and the result is substituted. 
179
180 Compare command construction in csh. 
181
182 **Example:** 
183 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
184 set degree 30 
185 set pi 3.14159265 
186 # expr is a command evaluating a numeric expression 
187 set radian [expr $pi*$degree/180] 
188 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189
190 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. 
191
192 TCL uses two forms of *quoting* to prevent substitution and word breaking. 
193
194 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 " ". 
195
196 **Example:** 
197 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
198 # set msg to ;the price is 12.00; 
199 set price 12.00 
200 set msg ;the price is $price; 
201 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202
203 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. 
204
205 **Example:** 
206 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
207 set x 0 
208 # this will loop for ever 
209 # because while argument is ;0  3; 
210 while ;$x  3; {set x [expr $x+1]} 
211 # this will terminate as expected because 
212 # while argument is {$x  3} 
213 while {$x  3} {set x [expr $x+1]} 
214 # this can be written also 
215 while {$x  3} { 
216 set x [expr $x+1] 
217
218 # the following cannot be written 
219 # because while requires two arguments 
220 while {$x  3} 
221
222 set x [expr $x+1] 
223
224 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225
226 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. 
227
228 **Example:** 
229 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
230 # This is a comment 
231 set a 1 # this is not a comment 
232 set b 1; # this is a comment 
233 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
234
235 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. 
236
237
238 **Example:** 
239 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240 # I want to delete two files 
241
242 set files ;foo bar; 
243
244 # this will fail because rm will receive only one argument 
245 # and complain that ;foo bar; does not exit 
246
247 exec rm $files 
248
249 # a second evaluation will do it 
250 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
252 @subsection occt_draw_2_3 Accessing variables in TCL and Draw
253
254 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. 
255
256 TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data. 
257
258 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 *$* does not change the result of a command. The content of a Draw variable is accessed using appropriate commands. 
259
260 There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below. 
261
262 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. 
263
264 **Example:** 
265 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
266 # dset is used for numeric variables 
267 # pi is a predefined Draw variable 
268 dset angle pi/3 radius 10 
269 point p radius*cos(angle) radius*sin(angle) 0 
270 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271 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. 
272
273 @subsubsection occt_draw_2_3_1 set, unset
274
275 Syntax:                  
276
277 ~~~~~
278 set varname [value] 
279 unset varname [varname varname ...] 
280 ~~~~~
281
282 **set** assigns a string value to a variable. If the variable does not already exist, it is created. 
283
284 Without a value, **set** returns the content of the variable. 
285
286 **unset** deletes variables. It is is also used to delete Draw variables. 
287
288 **Example:** 
289 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
290 set a "Hello world"
291 set b "Goodbye" 
292 set a 
293 == "Hello world" 
294 unset a b 
295 set a 
296 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297
298 **Note**, that the *set* command can set only one variable, unlike the *dset* command. 
299
300
301 @subsubsection occt_draw_2_3_2 dset, dval
302
303 Syntax
304
305 ~~~~~
306 dset var1 value1 vr2 value2 ... 
307 dval name 
308 ~~~~~
309
310 *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. 
311
312 *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. 
313
314
315 **Example:** 
316 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
317 # z is set to 0 
318 dset x 10 y 15 z 
319 == 0 
320
321 # no $ required for Draw commands 
322 point p x y z 
323
324 # *puts* prints a string 
325 puts ;x = [dval x], cos(x/pi) = [dval cos(x/pi)]; 
326 == x = 10, cos(x/pi) = -0.99913874099467914 
327 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328
329 **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.* 
330
331
332 @subsection occt_draw_2_4 lists
333
334 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. 
335
336 This allows you to insert lists within lists. 
337
338 **Example:** 
339 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
340 # a list of 3 strings 
341 ;a b c; 
342
343 # a list of two strings the first is a list of 2 
344 ;{a b} c; 
345 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
346
347 Many TCL commands return lists and **foreach** is a useful way to create loops on list elements. 
348
349 @subsubsection occt_draw_2_5 Control Structures
350
351 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: 
352
353 * You use braces instead of parentheses to enclose conditions. 
354 * You do not start the script on the next line of your command. 
355
356
357 @subsubsection occt_draw_2_5_1 if
358
359 Syntax       
360
361 ~~~~~
362 if condition script [elseif script .... else script] 
363 ~~~~~
364
365 **If** evaluates the condition and the script to see whether the condition is true. 
366
367
368
369 **Example:** 
370 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
371 if {$x  0} { 
372 puts ;positive; 
373 } elseif {$x == 0} { 
374 puts ;null; 
375 } else { 
376 puts ;negative; 
377
378 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379
380 @subsubsection occt_draw_2_5_2 while, for, foreach
381
382 Syntax:                  
383
384
385 ~~~~~~
386 while condition script 
387 for init condition reinit script 
388 foreach varname list script 
389 ~~~~~
390
391 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. \
392
393 **Example:** 
394 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
395 # while example 
396 dset x 1.1 
397 while {[dval x]  100} { 
398   circle c 0 0 x 
399   dset x x*x 
400
401 # for example 
402 # incr var d, increments a variable of d (default 1) 
403 for {set i 0} {$i  10} {incr i} { 
404   dset angle $i*pi/10 
405   point p$i cos(angle0 sin(angle) 0 
406
407 # foreach example 
408 foreach object {crapo tomson lucas} {display $object} 
409 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410
411 @subsubsection occt_draw_2_5_3 break, continue
412
413 Syntax:                  
414
415 ~~~~~
416 break 
417 continue 
418 ~~~~~
419
420 Within loops, the **break** and **continue** commands have the same effect as in C. 
421
422 **break** interrupts the innermost loop and **continue** jumps to the next iteration. 
423
424 **Example:** 
425 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
426 # search the index for which t$i has value ;secret; 
427 for {set i 1} {$i = 100} {incr i} { 
428   if {[set t$i] == ;secret;} break; 
429
430 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431
432 @subsection occt_draw_2_6 Procedures
433
434 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. 
435
436 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. 
437
438 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. 
439
440 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. 
441
442
443 @subsubsection occt_draw_2_6_1 proc
444
445 Syntax:
446
447 ~~~~~
448 proc argumentlist script 
449 ~~~~~
450
451 **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. 
452
453 **return** gives a return value to the procedure. 
454
455 **Example:** 
456 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
457 # simple procedure 
458 proc hello {} { 
459   puts ;hello world; 
460
461 # procedure with arguments and default values 
462 proc distance {x1 y1 {x2 0} {y2 0}} { 
463   set d [expr (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)] 
464   return [expr sqrt(d)] 
465
466 proc fact n { 
467   if {$n == 0} {return 1} else { 
468     return [expr n*[fact [expr n -1]]] 
469   } 
470
471 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
472
473
474 @subsubsection occt_draw_2_6_2 global, upvar
475
476 Syntax:                 
477
478 ~~~~~
479 global varname [varname ...] 
480 upvar varname localname [varname localname ...] 
481 ~~~~~
482
483
484 **global** accesses high level variables. Unlike C, global variables are not visible in procedures. 
485
486 **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. 
487
488 **Note** that in the following examples the \$ character is always necessarily used to access the arguments.
489  
490 **Example:** 
491 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
492 # convert degree to radian 
493 # pi is a global variable 
494 proc deg2rad (degree} { 
495   return [dval pi*$degree/2.] 
496
497 # create line with a point and an angle 
498 proc linang {linename x y angle} { 
499   upvar linename l 
500   line l $x $y cos($angle) sin($angle) 
501 }
502 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503
504 @section occt_draw_3 Basic Commands
505
506 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: 
507
508   * General commands, which are used for Draw and TCL management.
509   * Variable commands, which are used to manage Draw variables such as storing and dumping.
510   * Graphic commands, which are used to manage the graphic system, and so pertain to views.
511   * Variable display commands, which are used to manage the display of objects within given views.
512
513 Note that Draw also features a GUI task bar providing an alternative way to give certain general, graphic and display commands 
514
515
516 @subsection occt_draw_3_1 General commands
517
518 This section describes several useful commands:
519
520   * **help** to get information, 
521   * **source** to eval a script from a file, 
522   * **spy** to capture the commands in a file,
523   * **cpulimit** to limit the process cpu time, 
524   * **wait** to waste some time, 
525   * **chrono** to time commands. 
526
527 @subsubsection occt_draw_3_1_1 help
528
529 Syntax:                  
530
531 ~~~~~
532 help [command [helpstring group]] 
533 ~~~~~
534
535 Provides help or modifies the help information. 
536
537 **help** without arguments lists all groups and the commands in each group. 
538
539 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. 
540
541 **Example:** 
542 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
543 # Gives help on all commands starting with *a* 
544 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
545
546
547 @subsubsection occt_draw_3_1_2 source
548
549 Syntax:
550
551 ~~~~~
552 source filename 
553 ~~~~~
554 Executes a file. 
555
556 The **exit** command will terminate the file. 
557
558 @subsubsection occt_draw_3_1_3 spy
559
560 Syntax:                  
561
562 ~~~~~
563 spy [filename] 
564 ~~~~~
565
566 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. 
567
568 If a command returns an error it is saved with a comment mark. 
569
570 The file created by **spy** can be executed with the **source** command. 
571
572 **Example:** 
573 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
574 # all commands will be saved in the file ;session; 
575 spy session 
576 # the file ;session; is closed and commands are not saved 
577 spy 
578 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579
580
581
582 @subsubsection occt_draw_3_1_4 cpulimit
583
584 Syntax:                  
585
586 ~~~~~
587 cpulimit [nbseconds] 
588 ~~~~~
589
590 **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. 
591
592 **Example:** 
593 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
594 #limit cpu to one hour 
595 cpulimit 3600 
596 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
597
598 @subsubsection occt_draw_3_1_5 wait
599
600 Syntax:
601 ~~~~~
602 wait [nbseconds] 
603 ~~~~~
604 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. 
605
606 ~~~~~
607 # You have ten seconds ... 
608 wait 
609 ~~~~~
610
611 @subsubsection occt_draw_3_1_6 chrono
612
613 Syntax:                  
614
615 ~~~~~
616 chrono [ name start/stop/reset/show] 
617 ~~~~~
618
619 Without arguments, **chrono** activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed. 
620
621 With arguments, **chrono** is used to manage activated chronometers. You can perform the following actions with a chronometer. 
622   * run the chronometer (start).
623   * stop the chronometer (stop).
624   * reset the chronometer to 0 (reset).
625   * display the current time (show).
626
627 **Example:** 
628 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
629 chrono 
630 ==Chronometers activated. 
631 ptorus t 20 5 
632 ==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds 
633 ==CPU user time: 0.01 seconds 
634 ==CPU system time: 0 seconds 
635 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
636
637 @subsection occt_draw_3_2  Variable management commands
638
639 @subsubsection occt_draw_3_2_1 isdraw, directory
640
641 Syntax:                  
642 ~~~~~
643 isdraw varname 
644 directory [pattern] 
645 ~~~~~
646
647 **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. 
648
649 Use **directory** to return a list of all Draw global variables matching a pattern. 
650
651 **Example:** 
652 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
653 set a 1 
654 isdraw a 
655 === 0 
656
657 dset a 1 
658 isdraw a 
659 === 1 
660
661 circle c 0 0 1 0 5 
662 isdraw c 
663 === 1 
664
665 # to destroy all Draw objects with name containing curve 
666 foreach var [directory *curve*] {unset $var} 
667 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
668
669
670 @subsubsection occt_draw_3_2_2 whatis, dump
671
672 Syntax:
673
674 ~~~~~
675 whatis varname [varname ...] 
676 dump varname [varname ...] 
677 ~~~~~
678
679 **whatis** returns short information about a Draw variable. This is usually the type name. 
680
681 **dump** returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable. 
682
683 **Example:** 
684 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
685 circle c 0 0 1 0 5 
686 whatis c 
687 c is a 2d curve 
688
689 dump c 
690
691 ***** Dump of c ***** 
692 Circle 
693 Center :0, 0 
694 XAxis :1, 0 
695 YAxis :-0, 1 
696 Radius :5 
697 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
698
699 **Note** The behavior of *whatis* on other variables (not Draw) is not excellent. 
700
701
702 @subsubsection occt_draw_3_2_3 rename, copy
703
704 Syntax:      
705 ~~~~~
706 rename varname tovarname [varname tovarname ...] 
707 copy varname tovarname [varname tovarname ...] 
708 ~~~~~
709
710   * **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. 
711   * **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. 
712
713 **Example:** 
714 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
715 circle c1 0 0 1 0 5 
716 rename c1 c2 
717
718 # curves are copied, c2 will not be modified 
719 copy c2 c3 
720 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
721
722 @subsubsection occt_draw_3_2_4 datadir, save, restore
723
724 Syntax:
725 ~~~~~
726 datadir [directory] 
727 save variable [filename] 
728 restore filename [variablename] 
729 ~~~~~
730
731   * **datadir** without arguments prints the path of the current data directory. 
732   * **datadir** with an argument sets the data directory path. \
733
734 If the path starts with a dot (.) only the last directory name will be changed in the path. 
735
736   * **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. 
737   * **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. 
738
739 The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent. 
740
741 **Example:** 
742 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
743 # note how TCL accesses shell environment variables 
744 # using $env() 
745 datadir 
746 ==. 
747
748 datadir $env(WBCONTAINER)/data/default 
749 ==/adv_20/BAG/data/default 
750
751 box b 10 20 30 
752 save b theBox 
753 ==/adv_20/BAG/data/default/theBox 
754
755 # when TCL does not find a command it tries a shell command 
756 ls [datadir] 
757 == theBox 
758
759 restore theBox 
760 == theBox 
761 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
762
763 @subsection occt_draw_3_3 User defined commands
764
765 *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. 
766
767 *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. 
768
769 @subsubsection occt_draw_3_3_1 set
770
771 #### In *DrawTrSurf* package:
772
773 ~~~~~
774 void Set(Standard_CString&amp; Name,const gp_Pnt&amp; G) ; 
775 void Set(Standard_CString&amp; Name,const gp_Pnt2d&amp; G) ; 
776 void Set(Standard_CString&amp; Name, 
777 const Handle(Geom_Geometry)&amp; G) ; 
778 void Set(Standard_CString&amp; Name, 
779 const Handle(Geom2d_Curve)&amp; C) ; 
780 void Set(Standard_CString&amp; Name, 
781 const Handle(Poly_Triangulation)&amp; T) ; 
782 void Set(Standard_CString&amp; Name, 
783 const Handle(Poly_Polygon3D)&amp; P) ; 
784 void Set(Standard_CString&amp; Name, 
785 const Handle(Poly_Polygon2D)&amp; P) ; 
786 ~~~~~
787
788 #### In *DBRep* package:
789
790 ~~~~~
791 void Set(const Standard_CString Name, 
792 const TopoDS_Shape&amp; S) ; 
793 ~~~~~
794
795 Example of *DrawTrSurf*
796
797 ~~~~~
798 Handle(Geom2d_Circle) C1 = new Geom2d_Circle 
799 (gce_MakeCirc2d (gp_Pnt2d(50,0,) 25)); 
800 DrawTrSurf::Set(char*, C1); 
801 ~~~~~
802
803 Example of *DBRep* 
804
805 ~~~~~
806 TopoDS_Solid B; 
807 B = BRepPrimAPI_MakeBox (10,10,10); 
808 DBRep::Set(char*,B); 
809 ~~~~~
810
811 @subsubsection occt_draw_3_3_2 get
812
813 #### In *DrawTrSurf* package:
814  
815 ~~~~~
816 Handle_Geom_Geometry Get(Standard_CString&amp; Name) ; 
817 ~~~~~
818
819 #### In *DBRep* package:
820
821 ~~~~~
822 TopoDS_Shape Get(Standard_CString&amp; Name, 
823 const TopAbs_ShapeEnum Typ = TopAbs_SHAPE, 
824 const Standard_Boolean Complain 
825 = Standard_True) ; 
826 ~~~~~
827
828 Example of *DrawTrSurf*
829
830 ~~~~~
831 Standard_Integer MyCommand 
832 (Draw_Interpretor&amp; theCommands, 
833 Standard_Integer argc, char** argv) 
834 {...... 
835 // Creation of a Geom_Geometry from a Draw geometric 
836 // name 
837 Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]); 
838
839 ~~~~~
840
841 Example of *DBRep*
842
843 ~~~~~
844 Standard_Integer MyCommand 
845 (Draw_Interpretor&amp; theCommands, 
846 Standard_Integer argc, char** argv) 
847 {...... 
848 // Creation of a TopoDS_Shape from a Draw topological 
849 // name 
850 TopoDS_Solid B = DBRep::Get(argv[1]); 
851
852 ~~~~~
853
854 @section occt_draw_4 Graphic Commands
855
856 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. 
857
858 @subsection occt_draw_4_1 Axonometric viewer
859
860 @subsubsection occt_draw_4_1_1 view, delete
861
862 Syntax:                  
863 ~~~~~
864 view index type [X Y W H] 
865 delete [index] 
866 ~~~~~
867
868 **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. 
869
870 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.. 
871
872 **delete** deletes a view. If no index is given, all the views are deleted. 
873
874 Type selects from the following range: 
875
876   * *AXON* : Axonometric view
877   * *PERS* : Perspective view
878   * *+X+Y* : View on both axes (i.e. a top view), other codes are *-X+Y, +Y-Z*, etc.
879   * *-2D-* : 2d view
880
881 The index, the type, the current zoom are displayed in the window title . 
882
883 **Example:** 
884 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
885 # this is the content of the mu4 procedure 
886 proc mu4 {} { 
887 delete 
888 view 1 +X+Z 320 20 400 400 
889 view 2 +X+Y 320 450 400 400 
890 view 3 +Y+Z 728 20 400 400 
891 view 4 AXON 728 450 400 400 
892
893 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
894
895 See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview** 
896
897 @subsubsection occt_draw_4_1_2  axo, pers, top, ...
898
899 Syntax:      
900
901 ~~~~~
902 axo 
903 pers 
904 ... 
905 smallview type 
906 ~~~~~
907
908 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. 
909
910   * **axo** creates a large window axonometric view;
911   * **pers** creates a large window perspective view;
912   * **top**, **bottom**, **left**, **right**, **front**, **back** create a large window axis view;
913   * **mu4** creates four small window views: front, left, top and axo.
914   * **v2d** creates a large window 2d view.
915   * **av2d** creates two small window views, one 2d and one axo
916   * **smallview** creates a view at the bottom right of the screen of the given type. 
917
918 See also: **view**, **delete** 
919
920 @subsubsection occt_draw_4_1_3 mu, md, 2dmu, 2dmd, zoom, 2dzoom
921
922 Syntax:
923
924 ~~~~~
925     mu [index] value 
926     2dmu [index] value 
927     zoom [index] value 
928     wzoom 
929 ~~~~~
930
931 * **mu** (magnify up) increases the zoom in one or several views by a factor of 10%. 
932 * **md** (magnify down) decreases the zoom by the inverse factor. **2dmu** and **2dmd** 
933 perform the same on one or all 2d views. 
934 * **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. 
935 * **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. 
936
937 **Example:** 
938 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
939     # set a zoom of 2.5 
940     zoom 2.5 
941
942     # magnify by 10% 
943     mu 1 
944
945     # magnify by 20% 
946 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
947 See also: **fit**, **2dfit** 
948
949
950 @subsubsection occt_draw_4_14 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
951
952 Syntax:                  pu [index] 
953 pd [index] 
954
955 The **p_ **commands are used to pan. **pu **and **pd **pan up and down respectively;**pl **and **pr **pan left and right respectively. Each time the view is displaced by 40 pixels.When no index is given, all views will pan in the direction specified. 
956
957 **Example:** 
958 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
959 # you have selected one anonometric view 
960 pu 
961 # or 
962 pu 1 
963
964 # you have selected an mu4 view; the object in the third 
965 # view will pan up 
966 pu 3 
967 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
968 See also: **fit**, **2dfit** 
969
970
971 @subsubsection occt_draw_4_1_5 fit, 2dfit
972
973 Syntax:      
974
975 ~~~~~
976 fit [index] 
977 2dfit [index] 
978 ~~~~~
979
980 **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. 
981
982 When fitting all views a unique zoom is computed for all the views. All views are on the same scale. 
983
984 **Example:** 
985 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
986 # fit only view 1 
987 fit 1 
988 # fit all 2d views 
989 2dfit 
990 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
991 See also: **zoom**, **mu**, **pu** 
992
993
994 @subsubsection occt_draw_4_1_6 u, d, l, r
995
996 Syntax:      
997
998 ~~~~~
999 u [index] 
1000 d [index] 
1001 l [index] 
1002 r [index] 
1003 ~~~~~
1004
1005 **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. 
1006
1007 **Example:** 
1008 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1009 # rotate the view up 
1010
1011 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1012
1013 @subsubsection occt_draw_4_1_7 focal, fu, fd
1014
1015 Syntax:                  
1016 ~~~~~
1017 focal [f] 
1018 fu [index] 
1019 fd [index] 
1020 ~~~~~
1021
1022 * **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. 
1023 * **fu** and **fd** increase or decrease the focal value by 10%. **fd** makes the eye closer to the object. 
1024
1025 **Example:** 
1026 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1027 pers 
1028 repeat 10 fd 
1029 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1030
1031 **Note**: Do not use a negative or null focal value. 
1032
1033 See also: **pers** 
1034
1035 @subsubsection occt_draw_4_1_8 color
1036
1037 Syntax: 
1038
1039 ~~~~~
1040 color index name 
1041 ~~~~~
1042
1043 **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. 
1044
1045 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. 
1046
1047 **Example:** 
1048 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1049 # change the value of blue 
1050 color 3 "navy blue" 
1051 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1052
1053
1054 **Note** that the color change will be visible on the next redraw of the views, for example, after *fit* or *mu*, etc. 
1055
1056 @subsubsection occt_draw_4_1_9 dtext
1057
1058 Syntax:      
1059 ~~~~~
1060 dtext [x y [z]] string 
1061 ~~~~~
1062
1063 **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. 
1064
1065 The coordinates are real space coordinates. 
1066
1067 **Example:** 
1068 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1069 # mark the origins 
1070 dtext 0 0 bebop 
1071 dtext 0 0 0 bebop 
1072 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1073
1074 @subsubsection occt_draw_4_1_10 hardcopy, hcolor, xwd
1075
1076 Syntax:      
1077 ~~~~~
1078 hardcopy [index] 
1079 hcolor index width gray 
1080 xwd [index] filename 
1081 ~~~~~
1082
1083 * **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. 
1084 * **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. 
1085 * **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**. 
1086
1087 **Example:** 
1088 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1089 # all blue lines (color 3) 
1090 # will be half-width and gray 
1091 hcolor 3 0.5 
1092
1093 # make a postscript file and print it 
1094 hardcopy 
1095 lpr a4.ps 
1096
1097 # make an xwd file and display it 
1098 xwd theview 
1099 xwud -in theview 
1100 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101
1102 **Note:** When more than one view is present, specify the index of the view. 
1103
1104 Only use a postscript printer to print postscript files. 
1105
1106 See also: **color** 
1107
1108
1109 @subsubsection occt_draw_4_1_11 wclick, pick
1110
1111 Syntax:      
1112 ~~~~~
1113 wclick 
1114 pick index X Y Z b [nowait] 
1115 ~~~~~
1116
1117 **wclick** defers an event until the mouse button is clicked. The message <code>just click</code> is displayed. 
1118
1119 Use the **pick** command to get graphic input. The arguments must be names for variables where the results are stored. 
1120   * index: index of the view where the input was made.
1121   * X,Y,Z: 3d coordinates in real world.
1122   * b: b is the mouse button 1,2 or 3.
1123
1124 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. 
1125
1126 This option is useful for tracking the pointer. 
1127
1128 **Note** that the results are stored in Draw numeric variables.
1129
1130 **Example:** 
1131 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1132 # make a circle at mouse location 
1133 pick index x y z b 
1134 circle c x y z 0 0 1 1 0 0 0 30 
1135
1136 # make a dynamic circle at mouse location 
1137 # stop when a button is clicked 
1138 # (see the repaint command) 
1139
1140 dset b 0 
1141 while {[dval b] == 0} { 
1142 pick index x y z b nowait 
1143 circle c x y z 0 0 1 1 0 0 0 30 
1144 repaint 
1145
1146 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1147 See also: **repaint** 
1148
1149
1150 Draw provides commands to manage the display of objects. 
1151 * **display**, **donly** are used to display, 
1152 * **erase**, **clear**, **2dclear** to erase. 
1153 * **autodisplay** command is used to check whether variables are displayed when created. 
1154
1155 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. 
1156   * 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.
1157   * 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.
1158   * If you do not see what you expected while executing loops or sourcing files, use the **repaint** and **dflush** commands.
1159
1160 **Example:** 
1161 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1162 # OK use dot to dump an object on the screen 
1163 dump . 
1164
1165 point . x y z 
1166
1167 #Not OK. display points on a curve c 
1168 # with dot no variables are created 
1169 for {set i 0} {$i = 10} {incr i} { 
1170 cvalue c $i/10 x y z 
1171 point . x y z 
1172
1173
1174 # point p x y z 
1175 # would have displayed only one point 
1176 # because the precedent variable content is erased 
1177
1178 # point p$i x y z 
1179 # is an other solution, creating variables 
1180 # p0, p1, p2, .... 
1181
1182 # give a name to a graphic object 
1183 rename . x 
1184 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1185
1186
1187 @subsubsection occt_draw_4_1_12 autodisplay
1188
1189 Syntax:      
1190
1191 ~~~~~
1192 autodisplay [0/1] 
1193 ~~~~~
1194
1195 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. 
1196
1197 When **autodisplay** is off, using the dot return argument is ineffective. 
1198
1199 **Example:** 
1200 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1201 # c is displayed 
1202 circle c 0 0 1 0 5 
1203
1204 # toggle the mode 
1205 autodisplay 
1206 == 0 
1207 circle c 0 0 1 0 5 
1208
1209 # c is erased, but not displayed 
1210 display c 
1211 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1212
1213 @subsubsection occt_draw_4_1_13 display, donly
1214
1215 Syntax:      
1216 ~~~~~
1217 display varname [varname ...] 
1218 donly varname [varname ...] 
1219 ~~~~~
1220
1221 * **display** makes objects visible. 
1222 * **donly** *display only* makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen. 
1223
1224 **Example:** 
1225 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1226 \# to see all objects 
1227 foreach var [directory] {display $var} 
1228
1229 \# to select two objects and erase the other ones 
1230 donly . . 
1231 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1232
1233
1234 @subsubsection occt_draw_4_1_14 erase, clear, 2dclear
1235
1236 Syntax:      
1237
1238 ~~~~~
1239 erase [varname varname ...] 
1240 clear 
1241 2dclear 
1242 ~~~~~
1243
1244 **erase** removes objects from all views. **erase** without arguments erases everything in 2d and 3d. 
1245
1246 **clear** erases only 3d objects and **2dclear** only 2d objects. **erase** without arguments is similar to  **clear; 2dclear**.
1247
1248
1249 **Example:** 
1250 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1251 # erase eveerything with a name starting with c_ 
1252 foreach var [directory c_*] {erase $var} 
1253
1254 # clear 2d views 
1255 2d clear 
1256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1257
1258 @subsubsection occt_draw_4_1_15 repaint, dflush
1259
1260
1261 Syntax:
1262
1263 ~~~~~
1264 repaint 
1265 dflush 
1266 ~~~~~
1267
1268 * **repaint** forces repainting of views. 
1269 * **dflush** flushes the graphic buffers. 
1270
1271 These commands are useful within loops or in scripts. 
1272
1273 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. 
1274
1275 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. 
1276
1277 **Example:** 
1278 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1279 # See the example with the pick command 
1280 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1281 See also: **pick** 
1282
1283 @subsection occt_draw_4_2 AIS viewer – view commands
1284
1285
1286 @subsubsection occt_draw_4_2_1 vinit
1287
1288 Syntax:                  
1289 ~~~~~
1290 vinit 
1291 ~~~~~
1292 Creates the 3D viewer window 
1293
1294 @subsubsection occt_draw_4_2_2 vhelp
1295
1296 Syntax:
1297 ~~~~~
1298 vhelp 
1299 ~~~~~
1300 Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities. 
1301
1302 @subsubsection occt_draw_4_2_3 vtop
1303
1304 Syntax:
1305 ~~~~~
1306 vtop 
1307 ~~~~~
1308
1309 Displays top view in the 3D viewer window. 
1310
1311 **Example:** 
1312 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1313 vinit 
1314 box b 10 10 10 
1315 vdisplay b 
1316 vfit 
1317 vtop 
1318 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1319
1320 @subsubsection occt_draw_4_2_4 vaxo
1321
1322 Syntax:                  
1323 ~~~~~
1324 vaxo 
1325 ~~~~~
1326
1327 Displays axonometric view in the 3D viewer window. 
1328
1329 **Example:** 
1330 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1331 vinit 
1332 box b 10 10 10 
1333 vdisplay b 
1334 vfit 
1335 vaxo 
1336 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1337
1338 @subsubsection occt_draw_4_2_5 vsetbg
1339
1340 Syntax:                  
1341 ~~~~~
1342 vsetbg imagefile [filltype] 
1343 ~~~~~
1344
1345 Loads image file as background. *filltype* must be NONE, CENTERED, TILED or STRETCH. 
1346
1347 **Example:** 
1348 ~~~~~
1349 vinit 
1350 vsetbg myimage.brep CENTERED 
1351 ~~~~~
1352
1353 @subsubsection occt_draw_4_2_6 vclear
1354
1355 Syntax:                  
1356 ~~~~~
1357 vclear 
1358 ~~~~~
1359 Removes all objects from the viewer. 
1360
1361 @subsubsection occt_draw_4_2_7 vrepaint
1362
1363 Syntax:                  
1364 ~~~~~
1365 vrepaint 
1366 ~~~~~
1367 Forcedly redisplays the shape in the 3D viewer window. 
1368
1369 @subsubsection occt_draw_4_2_8 vfit
1370
1371 Syntax:                  
1372 ~~~~~
1373 vfit 
1374 ~~~~~
1375 Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface. 
1376
1377 @subsubsection occt_draw_4_2_9 vzfit
1378
1379 Syntax:                  
1380 ~~~~~
1381 vzfit 
1382 ~~~~~
1383
1384 Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space. 
1385
1386 @subsubsection occt_draw_4_2_10  vreadpixel
1387
1388 Syntax:     
1389 ~~~~~
1390 vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [name] 
1391 ~~~~~
1392 Read pixel value for active view.
1393
1394
1395 @subsubsection occt_draw_4_2_11  vselect
1396
1397 Syntax:     
1398 ~~~~~
1399 vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [shift_selection = 0|1]
1400 ~~~~~
1401
1402 Emulates different types of selection:
1403
1404   * single mouse click selection
1405   * selection with a rectangle having the upper left and bottom right corners in *(x1,y1)* and *(x2,y2)* respectively
1406   * selection with a polygon having the corners in pixel positions *(x1,y1), (x2,y2),…, (xn,yn)*
1407   * any of these selections if shift_selection is set to 1.
1408
1409 @subsubsection occt_draw_4_2_12  vmoveto
1410
1411 Syntax:     
1412
1413 ~~~~~
1414 vmoveto x y
1415 ~~~~~
1416 Emulates cursor movement to pixel position (x,y).
1417
1418 @subsubsection occt_draw_4_2_13  vviewparams
1419
1420 Syntax:     
1421 ~~~~~
1422 vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]
1423 ~~~~~
1424 Gets or sets the current view characteristics.
1425
1426 @subsubsection occt_draw_4_2_14  vchangeselected
1427
1428 Syntax:     
1429 ~~~~~
1430 vchangeselected shape
1431 ~~~~~
1432 Adds a shape to selection or removes one from it.
1433
1434 @subsubsection occt_draw_4_2_15  vzclipping
1435
1436 Syntax:     
1437 ~~~~~
1438 vzclipping [mode] [depth width]
1439 ~~~~~
1440 Gets or sets ZClipping mode, width and depth, where
1441  - *mode = OFF|BACK|FRONT|SLICE*
1442  - *depth* is a real value from segment [0,1]
1443  - *width* is a real value from segment [0,1]
1444
1445 @subsubsection occt_draw_4_2_16  vnbselected
1446
1447 Syntax:     
1448 ~~~~~
1449 vnbselected
1450 ~~~~~
1451 Returns the number of selected objects in the interactive context.
1452
1453 @subsubsection occt_draw_4_2_17  vantialiasing
1454
1455 Syntax:     
1456 ~~~~~
1457 valntialiasing 1|0
1458 ~~~~~
1459 Sets antialiasing if the command is called with 1 or unsets otherwise.
1460
1461 @subsubsection occt_draw_4_2_18  vpurgedisplay
1462
1463 Syntax:     
1464 ~~~~~
1465 vpurgedisplay [CollectorToo = 0|1]
1466 ~~~~~
1467 Removes structures which do not belong to objects displayed in neutral point.
1468
1469 @subsubsection occt_draw_4_2_19  vhlr
1470
1471 Syntax:     
1472 ~~~~~
1473 vhlr is_enabled={on|off}
1474 ~~~~~
1475 Switches hidden line removal (computed) mode on/off.
1476
1477 @subsubsection occt_draw_4_2_20  vhlrtype
1478
1479 Syntax:     
1480 ~~~~~
1481 vhlrtype  algo_type={algo|polyalgo} [shape_1 ... shape_n]
1482 ~~~~~
1483
1484 Changes the type of HLR algorithm used for shapes.
1485 If the algo_type is algo, the exact HLR algorithm is used, otherwise the polygonal algorithm is used for defined shapes. 
1486
1487 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.
1488
1489 **Note** that this command works with instances of *AIS_Shape* or derived classes only, other interactive object types are ignored.
1490
1491
1492 @subsection occt_draw_4_3 AIS viewer – display commands
1493
1494 @subsubsection occt_draw_4_3_1 vdisplay
1495
1496 Syntax:                  
1497 vdisplay name1 [name2] … [name n] 
1498
1499 Displays named objects. 
1500 **Example:** 
1501
1502 vinit 
1503 box b 40 40 40 10 10 10 
1504 psphere s 20 
1505 vdisplay s b 
1506 vfit 
1507
1508
1509 @subsubsection occt_draw_4_32 vdonly
1510
1511 Syntax:                  vdonly [name1] … [name n] 
1512
1513 Displays only selected or named objects. If there are no selected or named objects, nothing is done. 
1514 **Example:** 
1515
1516 vinit 
1517 box b 40 40 40 10 10 10 
1518 psphere s 20 
1519 vdonly b 
1520 vfit 
1521 @subsubsection occt_draw_4_33 vdisplayall
1522
1523 Syntax:                  vdisplayall 
1524
1525 Displays all created objects. 
1526 **Example:** 
1527
1528 vinit 
1529 box b 40 40 40 10 10 10 
1530 psphere s 20 
1531 vdisplayall 
1532 vfit 
1533 @subsubsection occt_draw_4_34 verase
1534
1535 Syntax:                  verase [name1] [name2] … [name n] 
1536
1537 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased. 
1538 **Example:** 
1539
1540 vinit 
1541 box b1 40 40 40 10 10 10 
1542 box b2 -40 -40 -40 10 10 10 
1543 psphere s 20 
1544 vdisplayall 
1545 vfit 
1546 # erase only first box 
1547 verase b1 
1548 # erase second box and sphere 
1549 verase 
1550 @subsubsection occt_draw_4_35 veraseall
1551
1552 Syntax:                  veraseall 
1553
1554 Erases all objects displayed in the viewer. 
1555 **Example:** 
1556 vinit 
1557 box b1 40 40 40 10 10 10 
1558 box b2 -40 -40 -40 10 10 10 
1559 psphere s 20 
1560 vdisplayall 
1561 vfit 
1562 # erase only first box 
1563 verase b1 
1564 # erase second box and sphere 
1565 verseall 
1566
1567 @subsubsection occt_draw_4_36 vsetdispmode
1568
1569 Syntax:                  vsetdispmode [name] mode(0,1,2,3) 
1570
1571 Sets display mode for all, selected or named objects. 
1572 **mode** is **0** (**WireFrame**), **1** (**Shading**), **2** (**Quick HideLineremoval**), **3** (**Exact HideLineremoval**). 
1573 **Example:** 
1574
1575 vinit 
1576 box b 10 10 10 
1577 vdisplay b 
1578 vsetdispmode 1 
1579 vfit 
1580 @subsubsection occt_draw_4_37 vdisplaytype
1581
1582 Syntax:                  vdisplaytype type 
1583
1584 Displays all objects of a given type. 
1585 Possible **type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and** ;Dimension; **(see **vtypes**). 
1586
1587 @subsubsection occt_draw_4_38 verasetype
1588
1589 Syntax:                  verasetype type 
1590
1591 Erases all objects of a given type. 
1592 Possible** type**s are **;Point;, ;Axis;, ;Trihedron;, ;PlaneTrihedron;, ;Line;, ;Circle;, ;Plane;, ;Shape;, ;ConnectedShape;, ;MultiConn.Shape;, ;ConnectedInter.;, ;MultiConn.;, ;Constraint; **and **;Dimension; **(see **vtypes**). 
1593
1594 @subsubsection occt_draw_4_39 vtypes
1595
1596 Syntax:                  vtypes 
1597
1598 Makes a list of known types and signatures in AIS. 
1599
1600 @subsubsection occt_draw_4_310 vsetcolor
1601
1602 Syntax:                  vsetcolor [shapename] colorname 
1603
1604 Sets color for all, selected or named shapes. 
1605 Possible **colorname**s are: ;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;**. 
1606
1607
1608
1609 @subsubsection occt_draw_4_311 vunsetcolor
1610
1611 Syntax:                  vunsetcolor [shapename] 
1612
1613 Sets default color for all, selected or named shapes. 
1614
1615 @subsubsection occt_draw_4_312 vsettransparency
1616
1617 Syntax:                  vsettransparency [shapename] coeficient 
1618
1619 Sets transparency for all selected or named shapes. The **Coefficient** may be between 0.0 (opaque) and 1.0 (fully transparent). Warning: at 1.0 the shape becomes invisible. 
1620 **Example:** 
1621
1622 vinit 
1623 box b 10 10 10 
1624 psphere s 20 
1625 vdisplay b s 
1626 vfit 
1627 vsetdispmode 1 
1628 vsettransparency b 0.5 
1629
1630 @subsubsection occt_draw_4_313 vunsettransparency
1631
1632 Syntax:                  vunsettransparency [shapename] 
1633
1634 Sets default transparency (0.0) for all selected or named shapes. 
1635
1636 @subsubsection occt_draw_4_314 vsetmaterial
1637
1638 Syntax:                  vsetmaterial [shapename] materialname 
1639
1640 Sets material for all selected or named shapes. 
1641 **materialname** is ***BRASS*, *BRONZE*, *COPPER*, *GOLD*, *PEWTER*, *PLASTER*, *PLASTIC*, *SILVER*, *STEEL*, *STONE*, *SHINY_PLASTIC*, *SATIN*, *METALIZED*, *NEON_GNC*, *CHROME*, *ALUMINIUM*, *OBSIDIAN*, *NEON_PHC*, *JADE*.** 
1642 **Example:** 
1643
1644 vinit 
1645 psphere s 20 
1646 vdisplay s 
1647 vfit 
1648 vsetdispmode 1 
1649 vsetmaterial s JADE 
1650
1651 @subsubsection occt_draw_4_315 vunsetmaterial
1652
1653 Syntax:                  vunsetmaterial [shapename] 
1654
1655 Sets default material for all selected or named shapes. 
1656
1657 @subsubsection occt_draw_4_316 vsetwidth
1658
1659 Syntax:                  vsetwidth [shapename] coeficient 
1660
1661 Sets width of the edges for all selected or named shapes. 
1662 The **Coefficient** may be between 0.0 and 10.0. 
1663 **Example:** 
1664
1665 vinit 
1666 box b 10 10 10 
1667 vdisplay b 
1668 vfit 
1669 vsetwidth b 5 
1670
1671 @subsubsection occt_draw_4_317 vunsetwidth
1672
1673 Syntax:                  vunsetwidth [shapename] 
1674
1675 Sets default width of edges (0.0) for all selected or named shapes. 
1676
1677 @subsubsection occt_draw_4_318 vsetshading
1678
1679 Syntax:                  vsetshading shapename [coefficient] 
1680
1681 Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008. 
1682 **Example:** 
1683
1684 vinit 
1685 psphere s 20 
1686 vdisplay s 
1687 vfit 
1688 vsetdispmode 1 
1689 vsetshading s 0.005 
1690 @subsubsection occt_draw_4_319 vunsetshading
1691
1692 Syntax:                  vunsetshading [shapename] 
1693
1694 Sets default deflection coefficient (0.0008) that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008. 
1695
1696 @subsubsection occt_draw_4_320 vsetam
1697
1698 Syntax:                  vsetam [shapename] mode 
1699
1700 Activates selection mode for all selected or named shapes. 
1701 **mode** is **0** for **shape** itself, **1** for **vertices**, **2** for **edges**, **3** for **wires**, **4** for **faces**, **5** for **shells**, **6** for **solids**, **7** for **compounds**. 
1702 **Example:** 
1703
1704 vinit 
1705 box b 10 10 10 
1706 vdisplay b 
1707 vfit 
1708 vsetam b 2 
1709 @subsubsection occt_draw_4_321 vunsetam
1710
1711 Syntax:                  vunsetam 
1712
1713 Deactivates all selection modes for all shapes. 
1714
1715 @subsubsection occt_draw_4_322 vdump
1716
1717 Syntax:                  vdump filename.{png|xwd|bmp} 
1718
1719 Extracts the contents of the viewer window to a png, XWD or BMP file. 
1720
1721 @subsubsection occt_draw_4_323 vdir
1722
1723 Syntax:                  vdir 
1724
1725 Displays the list of displayed objects. 
1726
1727 @subsubsection occt_draw_4_324 vsub
1728
1729 Syntax:                  vsub 0/1(on/off)[shapename] 
1730
1731 Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color. 
1732 **Example:** 
1733
1734 vinit 
1735 box b 10 10 10 
1736 psphere s 20 
1737 vdisplay b s 
1738 vfit 
1739 vsetdispmode 1 
1740 vsub b 1 
1741
1742 @subsubsection occt_draw_4_325 vardis
1743
1744 Syntax:                  vardis 
1745
1746 Displays active areas (for each activated sensitive entity, one or several 2D bounding boxes are displayed, depending on the implementation of a particular entity). 
1747
1748 @subsubsection occt_draw_4_326 varera
1749
1750 Syntax:                  varera 
1751
1752 Erases active areas. 
1753
1754 @subsubsection occt_draw_4_327 vsensdis
1755
1756 Syntax:                  vsensdis 
1757
1758 Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes). 
1759
1760 Standard entity types are those defined in Select3D package: 
1761   * sensitive box
1762   * sensitive face
1763   * sensitive curve
1764   * sensitive segment
1765   * sensitive circle
1766   * sensitive point
1767   * sensitive triangulation
1768   * sensitive triangle
1769 Custom (application-defined) sensitive entity types are not processed by this command. 
1770
1771 @subsubsection occt_draw_4_328 vsensera
1772
1773 Syntax:                  vsensera 
1774
1775 Erases active entities. 
1776
1777 @subsubsection occt_draw_4_329 vperf
1778
1779 Syntax:                  vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF) 
1780
1781 Tests the animation of an object along a predefined trajectory. 
1782 **Example:** 
1783
1784 vinit 
1785 box b 10 10 10 
1786 psphere s 20 
1787 vdisplay b s 
1788 vfit 
1789 vsetdispmode 0 
1790 vperf b 1 1 
1791 @subsubsection occt_draw_4_330 vr
1792
1793 Syntax:                  vr filename 
1794
1795 Reads shape from BREP-format file and displays it in the viewer. 
1796 **Example:** 
1797
1798 vinit 
1799 vr myshape.brep 
1800 @subsubsection occt_draw_4_330331 vstate
1801
1802 Syntax:                  vstate [name1] … [name n] 
1803
1804 Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects. 
1805
1806
1807
1808 @subsection occt_draw_4_3304 AIS viewer – object commands
1809
1810 @subsubsection occt_draw_4_33041 vtrihedron
1811
1812 Syntax:                  vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw] 
1813
1814 Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created. 
1815 **Example:** 
1816
1817 vinit 
1818 vtrihedron tr 
1819
1820 @subsubsection occt_draw_4_33042 vplanetri
1821
1822 Syntax:                  vplanetri name 
1823
1824 Creates a plane from a trihedron selection. 
1825
1826
1827 @subsubsection occt_draw_4_33043 vsize
1828
1829 Syntax:                  vsize [name] [size] 
1830
1831 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. 
1832 **Example:** 
1833
1834 vinit 
1835 vtrihedron tr1 
1836 vtrihedron tr2 0 0 0 1 0 0 1 0 0 
1837 vsize tr2 400 
1838
1839 @subsubsection occt_draw_4_33044 vaxis
1840
1841 Syntax:                  vaxis name [Xa Ya Za Xb Yb Zb] 
1842
1843 Creates an axis. If  the values are not defined, an axis is created by interactive selection of two vertices or one edge 
1844 **Example:** 
1845
1846 vinit 
1847 vtrihedron tr 
1848 vaxis axe1 0 0 0 1 0 0 
1849
1850 @subsubsection occt_draw_4_33045 vaxispara
1851
1852 Syntax:                  vaxispara nom 
1853
1854 Creates an axis by interactive selection of an edge and a vertex. 
1855
1856 @subsubsection occt_draw_4_33046 vaxisortho
1857
1858 Syntax:                  vaxisotrho name 
1859
1860 Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge. 
1861
1862 @subsubsection occt_draw_4_33047 vpoint
1863
1864 Syntax:                  vpoint name [Xa Ya Za] 
1865
1866 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). 
1867 **Example:** 
1868
1869 vinit 
1870 vpoint p 0 0 0 
1871
1872 @subsubsection occt_draw_4_33048 vplane
1873
1874 Syntax:                  vplane name [AxisName] [PointName] 
1875                         vplane name [PointName] [PointName] [PointName] 
1876                         vplane name [PlaneName] [PointName] 
1877
1878 Creates a plane from named or interactively selected entities. 
1879 **Example:** 
1880
1881 vinit 
1882 vpoint p1 0 50 0 
1883 vaxis axe1 0 0 0 0 0 1 
1884 vtrihedron tr 
1885 vplane plane1 axe1 p1 
1886
1887 @subsubsection occt_draw_4_33049 vplanepara
1888
1889 Syntax:                  vplanepara name 
1890
1891 Creates a plane from interactively selected vertex and face. 
1892
1893 @subsubsection occt_draw_4_330410 vplaneortho
1894
1895 Syntax:                  vplaneortho name 
1896
1897 Creates a plane from interactive selected face and coplanar edge. 
1898
1899 @subsubsection occt_draw_4_330411 vline
1900
1901 Syntax:                  vline name [PointName] [PointName] 
1902                         vline name [Xa Ya Za Xb Yb Zb] 
1903
1904 Creates a line from coordinates, named or interactively selected vertices. 
1905 **Example:** 
1906
1907 vinit 
1908 vtrihedron tr 
1909 vpoint p1 0 50 0 
1910 vpoint p2 50 0 0 
1911 vline line1 p1 p2 
1912 vline line2 0 0 0 50 0 1 
1913
1914 @subsubsection occt_draw_4_330412 vcircle
1915
1916 Syntax:      vcircle name [PointName PointName PointName IsFilled] 
1917 vcircle name [PlaneName PointName Radius IsFilled] 
1918
1919 Creates a circle from named or interactively selected entities.  Parameter IsFilled is defined as 0 or 1. 
1920 **Example:** 
1921
1922 vinit 
1923 vtrihedron tr 
1924 vpoint p1 0 50 0 
1925 vpoint p2 50 0 0 
1926 vpoint p3 0 0 0 
1927 vcircle circle1 p1 p2 p3 1 
1928
1929
1930 @subsubsection occt_draw_4_330413 vtri2d
1931
1932 Syntax:                  vtri2d name 
1933
1934 Creates a plane with a 2D trihedron from an interactively selected face. 
1935
1936 @subsubsection occt_draw_4_330414 vselmode
1937
1938 Syntax:                  vselmode [object] mode On/Off 
1939
1940 Sets the selection mode for an object. If the object value is not defined, the selection mode is set for all displayed objects. 
1941 Value On is defined as 1 and Off – as 0. 
1942 **Example:** 
1943
1944 vinit 
1945 vpoint p1 0 0 0 
1946 vpoint p2 50 0 0 
1947 vpoint p3 25 40 0 
1948 vtriangle triangle1 p1 p2 p3 
1949 @subsubsection occt_draw_4_330415 vconnect, vconnectsh
1950
1951 Syntax:                  vconnect name object Xo Yo Zo Xu Xv Xw Zu Zv Zw 
1952                              vconnectsh name shape Xo Yo Zo Xu Xv Xw Zu Zv Zw 
1953
1954 Creates and displays an object with input location connected to a named entity. 
1955 The difference between these two commands is that the object created by vconnect does not support the selection modes differrent from 0. 
1956 **Example:** 
1957
1958 Vinitvinit 
1959 vpoint p1 0 0 0 
1960 vpoint p2 50 0 0 
1961 vsegment segment p1 p2 
1962 restore CrankArm.brep obj 
1963 vdisplay obj 
1964 vconnectsh new obj 100100100 1 0 0 0 0 1 
1965
1966
1967
1968 @subsubsection occt_draw_4_330416 vtriangle
1969
1970 Syntax:                  vtriangle name PointName PointName PointName 
1971
1972 Creates and displays a filled triangle from named points. 
1973 **Example:** 
1974
1975 vinit 
1976 vpoint p1 0 0 0 
1977 vpoint p2 50 0 0 
1978 vpoint p3 25 40 0 
1979 vtriangle triangle1 p1 p2 p3 
1980
1981 @subsubsection occt_draw_4_330417 vsegment
1982
1983 Syntax:                  vsegment name PointName PointName 
1984
1985 Creates and displays a segment from named points. 
1986 **Example:** 
1987
1988 Vinit 
1989 vpoint p1 0 0 0 
1990 vpoint p2 50 0 0 
1991 vsegment segment p1 p2 
1992
1993
1994 **MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data. 
1995
1996
1997
1998 @subsection occt_draw_4_3305 AIS viewer – Mesh Visualization Service
1999
2000 @subsubsection occt_draw_4_33051 meshfromstl
2001
2002 Syntax:                  meshfromstl meshname file 
2003
2004 Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately. 
2005 **Example:** 
2006
2007 meshfromstl mesh myfile.stl 
2008
2009 @subsubsection occt_draw_4_33052 meshdispmode
2010
2011 Syntax:                  meshdispmode meshname displaymode 
2012
2013 Changes the display mode of object **meshname**. The **displaymode** is integer, which can be **1** (for wireframe), **2** (for shading mode) or **3** (for shrink mode). 
2014 **Example:** 
2015
2016 vinit 
2017 meshfromstl mesh myfile.stl 
2018 meshdispmode mesh 2 
2019
2020 @subsubsection occt_draw_4_33053 meshselmode
2021
2022 Syntax:                  meshselmode meshname selectionmode 
2023
2024 Changes the selection mode of object **meshname**. The **selectionmode** is integer OR-combination of mode flags. The basic flags are the following: 
2025 **1** – node selection, 
2026 **2** – 0D elements (not suppored in STL) 
2027 **4** – links (not supported in STL) 
2028 **8** – faces 
2029 **Example:** 
2030
2031 vinit 
2032 meshfromstl mesh myfile.stl 
2033 meshselmode mesh 1 
2034
2035 @subsubsection occt_draw_4_33054 meshshadcolor
2036
2037 Syntax:                  meshshadcolor meshname red green blue 
2038
2039 Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**. 
2040 **Example:** 
2041
2042 vinit 
2043 meshfromstl mesh myfile.stl 
2044 meshshadcolormode mesh 0.5 0.5 0.5 
2045
2046 @subsubsection occt_draw_4_33055 meshlinkcolor
2047
2048 Syntax:                  meshlinkcolor meshname red green blue 
2049
2050 Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**. 
2051 **Example:** 
2052
2053 vinit 
2054 meshfromstl mesh myfile.stl 
2055 meshlinkcolormode mesh 0.5 0.5 0.5 
2056
2057 @subsubsection occt_draw_4_33056 meshmat
2058
2059 Syntax:                  meshmat meshname material 
2060
2061 Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial): 
2062 **0 – BRASS,** 
2063 **1 – BRONZE,** 
2064 **2 - COPPER,** 
2065 **3 - GOLD,** 
2066 **4 - PEWTER,** 
2067 **5 - PLASTER,** 
2068 **6 - PLASTIC,** 
2069 **7 - SILVER,** 
2070 **8 - STEEL,** 
2071 **9 - STONE,** 
2072 **10 - SHINY_PLASTIC,** 
2073 **11 - SATIN,** 
2074 **12 - METALIZED,** 
2075 **13 - NEON_GNC,** 
2076 **14 - CHROME,** 
2077 **15 - ALUMINIUM,** 
2078 **16 - OBSIDIAN,** 
2079 **17 - NEON_PHC,** 
2080 **18 - JADE,** 
2081 **19 - DEFAULT,** 
2082 **20 - UserDefined** 
2083 **Example:** 
2084
2085 vinit 
2086 meshfromstl mesh myfile.stl 
2087 meshmat mesh JADE 
2088
2089 @subsubsection occt_draw_4_33057 meshshrcoef
2090
2091 Syntax:                  meshshrcoef meshname shrinkcoefficient 
2092
2093 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. 
2094 **Example:** 
2095
2096 vinit 
2097 meshfromstl mesh myfile.stl 
2098 meshshrcoef mesh 0.05 
2099
2100 @subsubsection occt_draw_4_33058 meshshow
2101
2102 Syntax:                  meshshow meshname 
2103
2104 Displays **meshname** in the viewer (if it is erased). 
2105 **Example:** 
2106
2107 vinit 
2108 meshfromstl mesh myfile.stl 
2109 meshshow mesh 
2110
2111 @subsubsection occt_draw_4_33059 meshhide
2112
2113 Syntax:                  meshhide meshname 
2114
2115 Hides **meshname** in the viewer. 
2116 **Example:** 
2117
2118 vinit 
2119 meshfromstl mesh myfile.stl 
2120 meshhide mesh 
2121
2122 @subsubsection occt_draw_4_330510 meshhidesel
2123
2124 Syntax:                  meshhidesel meshname 
2125
2126 Hides only selected entities. The other part of **meshname** remains visible. 
2127
2128 @subsubsection occt_draw_4_330511 meshshowsel
2129
2130 Syntax:                  meshshowsel meshname 
2131
2132 Shows only selected entities. The other part of **meshname** becomes invisible. 
2133
2134 @subsubsection occt_draw_4_330512 meshshowall
2135
2136 Syntax:                  meshshowall meshname 
2137
2138 Changes the state of all entities to visible for **meshname**. 
2139
2140 @subsubsection occt_draw_4_330513 meshdelete
2141
2142 Syntax:                  meshdelete meshname 
2143
2144 Deletes MeshVS_Mesh object **meshname**. 
2145 **Example:** 
2146
2147 vinit 
2148 meshfromstl mesh myfile.stl 
2149 meshdelete mesh 
2150
2151
2152
2153
2154 @subsection occt_draw_4_3306 AIS viewer – 2D viewer – view commands
2155
2156 @subsubsection occt_draw_4_33061 v2dinit
2157
2158 Syntax:                  v2dinit 
2159
2160 **v2dinit **creates the 2D viewer window. 
2161
2162 @subsubsection occt_draw_4_33062 v2dsetbg
2163
2164 Syntax:                  v2dsetbg imagefile [filletype] 
2165
2166 **v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**. 
2167 **Example:** 
2168
2169 v2dinit 
2170 v2dsetbg myimage.brep CENTERED 
2171
2172 @subsubsection occt_draw_4_33063 v2dfit
2173
2174 Syntax:                  v2dfit 
2175
2176 Fits all shapes to the size of the window. 
2177
2178 @subsubsection occt_draw_4_33064 v2drepaint
2179
2180 Syntax:                  v2drepaint 
2181
2182 Forcedly repaints all shapes. 
2183
2184 @subsubsection occt_draw_4_33065 v2dclear
2185
2186 Syntax:                  v2dclear 
2187
2188 Clears the 2D viewer window 
2189
2190 @subsubsection occt_draw_4_33066 v2dtext
2191
2192 Syntax:                  v2dtext text x y [angle scale fontindex] 
2193
2194 Creates a new object with the name **text_i** (i – integer value) and displays **text** at the position** x**, **y.** The text can be displayed at a certain **angle**, on a certain **scale** and with a certain **fontindex**. 
2195 Default values are: **angle=0.0, scale=1.0, fontindex=0**. 
2196 **Example:** 
2197
2198 v2dinit 
2199 v2dtext *My text* 10 10 
2200 @subsubsection occt_draw_4_33067 v2dsettextcolor
2201
2202 Syntax:                  v2dsettextcolor text_name colorindex 
2203
2204 Changes the color of **text_name** object (**name** must be an integer value). 
2205 **Example:** 
2206
2207 v2dinit 
2208 v2dtext *My text* 10 10 
2209 # Change color to red 
2210 v2dsettextcolor text_0 3 
2211 @subsubsection occt_draw_4_33068 v2dpick
2212
2213 Syntax:                  v2dpick 
2214
2215 Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window. 
2216
2217
2218 @subsubsection occt_draw_4_33069 v2dgrid
2219
2220 Syntax:                  v2dgrid [type x y xstep ystep angle [drawmode]] 
2221      v2dgrid [type x y radiusstep division angle [drawmode]] 
2222
2223 Loads a grid in the 2D viewer window. 
2224 **type** is **Rect** or **Circ**. 
2225 **drawmode** is **Lines**, **Points** or **None**. 
2226 **Example:** 
2227
2228 v2dinit 
2229 v2dgrid Circ 0 0 250 12 0 Lines 
2230 v2drmgrid 
2231 v2dgrid Rect 0 0 200 200 0 Lines 
2232 @subsubsection occt_draw_4_330610 v2rmgrid
2233
2234 Syntax:                  v2rmgrid 
2235
2236 Unloads a grid from the window. 
2237
2238 @subsubsection occt_draw_4_330611 v2dpickgrid
2239
2240 Syntax:                  v2dpickgrid [mouse_x mouse_y [grid_x grid_y]] 
2241
2242 Gets coordinates of a grid point near the mouse button click in the 2D viewer window and sets it to **grid_x**, **grid_y** variables. 
2243
2244 @subsubsection occt_draw_4_330612 v2dpsout
2245
2246 Syntax:                  v2dpsout imagefile [scale colorspace] 
2247                                                      [width height [xcenter ycenter]] 
2248
2249 Exports **imagefile**. You can set its the scale, width, height and colorspace. 
2250 **colorspace** can be **RGB, BlackAndWhite, GreyScale**. 
2251
2252 @subsubsection occt_draw_4_330612613 v2ddir
2253
2254 Syntax:                  v2ddir 
2255
2256 Makes aLlist of the displayed objects. 
2257
2258
2259 @subsection occt_draw_4_3306127 Ais viewer – 2D viewer – display commands
2260
2261 @subsubsection occt_draw_4_33061271 v2ddisplay
2262
2263 Syntax:                  v2ddisplay name [projection] 
2264
2265 Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z. 
2266
2267 Displays named objects. 
2268 **Example:** 
2269
2270 v2dinit 
2271 box b 10 10 10 
2272 psphere s 20 
2273 v2ddisplay s 
2274 v2ddisplay b 
2275 v2dfit 
2276 @subsubsection occt_draw_4_33061272 v2ddonly
2277
2278 Syntax:                  v2ddonly [name1] … [name n] 
2279
2280 Displays only selected or named objects. If there are no selected or named objects, nothing is done. 
2281 **Example:** 
2282
2283 v2dinit 
2284 box b 10 10 10 
2285 psphere s 20 
2286 v2ddisplay b 
2287 v2ddisplay s 
2288 v2ddonly s 
2289 v2dfit 
2290 @subsubsection occt_draw_4_33061273 v2ddisplayall
2291
2292 Syntax:                  v2ddisplayall 
2293
2294 Displays all created objects. 
2295 **Example:** 
2296
2297 v2dinit 
2298 box b 10 10 10 
2299 psphere s 20 
2300 v2ddisplay b 
2301 v2ddisplay s 
2302 v2ddonly 
2303 v2ddisplayall 
2304 v2dfit 
2305 @subsubsection occt_draw_4_33061274 v2derase
2306
2307 Syntax:                  v2derase name1 [name2] … [name n] 
2308
2309 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased. 
2310 **Example:** 
2311
2312 v2dinit 
2313 box b 10 10 10 
2314 psphere s 20 
2315 v2ddisplay b 
2316 v2ddisplay s 
2317 v2derase b 
2318 v2dfit 
2319 @subsubsection occt_draw_4_33061275 v2deraseall
2320
2321 Syntax:                  v2deraseall 
2322
2323 Erases all objects displayed in the viewer. 
2324 **Example:** 
2325
2326 v2dinit 
2327 box b 10 10 10 
2328 psphere s 20 
2329 v2ddisplay b 
2330 v2ddisplay s 
2331 v2deraseall 
2332 v2dfit 
2333 @subsubsection occt_draw_4_33061276 v2dsetcolor
2334
2335 Syntax:                  v2dsetcolor [shapename] colorname 
2336
2337 Sets color for all, selected or named shapes. 
2338 Values of **colorname** see **vsetcolor**. 
2339 **Example:** 
2340
2341 v2dinit 
2342 box b 10 10 10 
2343 v2ddisplay b 
2344 v2ddisplay s 
2345 v2dsetcolor b RED 
2346 v2dfit 
2347 @subsubsection occt_draw_4_33061277 v2dunsetcolor
2348
2349 Syntax:                  v2dunsetcolor [shapename] 
2350
2351 Sets default color for all, selected or named shapes. 
2352 **Example:** 
2353
2354 v2dinit 
2355 box b 10 10 10 
2356 v2ddisplay b 
2357 v2ddisplay s 
2358 v2dsetcolor RED 
2359 v2dunsetcolor b 
2360 v2dfit 
2361 @subsubsection occt_draw_4_33061278 v2dsetbgcolor
2362
2363 Syntax:                  v2dsetbgcolor colorname 
2364
2365 Sets background color. 
2366 See **vsetcolor** for the values of **colorname.**. 
2367 **Example:** 
2368
2369 v2dinit 
2370 box b 10 10 10 
2371 v2ddisplay b 
2372 v2ddisplay s 
2373 v2dsetbgcolor RED 
2374 v2dfit 
2375 @subsubsection occt_draw_4_33061279 v2dsetwidth
2376
2377 Syntax:                  v2dsetwidth [shapename] widthenum 
2378
2379 Set width of the edges for all, selected or named shapes. 
2380 **widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**. 
2381 **Example:** 
2382
2383 v2dinit 
2384 box b 10 10 10 
2385 v2ddisplay b 
2386 v2ddisplay s 
2387 v2dsetwidth b THICK 
2388 v2dfit 
2389 @subsubsection occt_draw_4_330612710 v2dunsetwidth
2390
2391 Syntax:                  vunsetwidth [shapename] 
2392
2393 Sets default width of the edges for all, selected or named shapes. 
2394 **Example:** 
2395
2396 v2dinit 
2397 box b 10 10 10 
2398 v2ddisplay b 
2399 v2ddisplay s 
2400 v2dsetwidth THICK 
2401 v2dunsetwidth b 
2402 v2dfit 
2403
2404 @section occt_2142243456_930384826 OCAF commands
2405
2406
2407 This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF). 
2408
2409
2410 @subsection occt_2142243456_9303848261 Application commands
2411
2412
2413 @subsubsection occt_2142243456_93038482611 NewDocument
2414
2415 Syntax:       NewDocument docname [format] 
2416
2417 Creates a new **docname** document with MDTV-Standard or described format. 
2418 **Example:** 
2419
2420 # Create new document with default (MDTV-Standard) format 
2421 NewDocument D 
2422
2423 # Create new document with BinOcaf format 
2424 NewDocument D2 BinOcaf 
2425
2426 @subsubsection occt_2142243456_93038482612 IsInSession
2427
2428 Syntax:       IsInSession path 
2429
2430 **I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise. 
2431 **Example:** 
2432
2433 IsInSession /myPath/myFile.std 
2434
2435 @subsubsection occt_2142243456_93038482613 ListDocuments
2436
2437 Syntax:       ListDocuments 
2438
2439 Makes a list of documents handled during the session of the application. 
2440
2441
2442 @subsubsection occt_2142243456_93038482614 Open
2443
2444 Syntax:       Open path docname 
2445
2446 Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session. 
2447 **Example:** 
2448
2449 Open /myPath/myFile.std D 
2450
2451 @subsubsection occt_2142243456_93038482615 Close
2452
2453 Syntax:       Close docname 
2454
2455 Closes **docname** document. The document is no longer handled by the applicative session. 
2456 **Example:** 
2457
2458 Close D 
2459
2460 @subsubsection occt_2142243456_93038482616 Save
2461
2462 Syntax:       Save docname 
2463
2464 Saves **docname** active document. 
2465 **Example:** 
2466
2467 Save D 
2468
2469 @subsubsection occt_2142243456_93038482617 SaveAs
2470
2471 Syntax:       SaveAs docname path 
2472
2473 Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists. 
2474 **Example:** 
2475
2476 SaveAs D /myPath/myFile.std 
2477
2478 @subsection occt_2142243456_9303848262 Basic commands
2479
2480
2481 @subsubsection occt_2142243456_930384826521  Label
2482
2483 Syntax:       Label docname entry 
2484
2485 Creates the label expressed by **entry** if it does not exist. 
2486 **Example:** 
2487
2488 Label D 0:2 
2489
2490 @subsubsection occt_2142243456_930384826522  NewChild
2491
2492 Syntax:       NewChild docname [taggerlabel = Root label] 
2493
2494 Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label. 
2495 **Example:** 
2496
2497 # Create new child of root label 
2498 NewChild D 
2499
2500 # Create new child of existing label 
2501 Label D 0:2 
2502 NewChild D 0:2 
2503
2504 @subsubsection occt_2142243456_930384826523  Children
2505
2506 Syntax:       Children docname label 
2507
2508 Returns the list of attributes of **label**. 
2509 **Example:** 
2510
2511 Children D 0:2 
2512
2513 @subsubsection occt_2142243456_930384826524  ForgetAll
2514
2515 Syntax:       ForgetAll docname label 
2516
2517 Forgets all attributes of the label. 
2518 **Example:** 
2519
2520 ForgetAll D 0:2 
2521
2522 @subsection occt_2142243456_93038482653  Application commands
2523
2524
2525 @subsubsection occt_2142243456_930384826531  Main
2526
2527 Syntax:       Main docname 
2528
2529 Returns the main label of the framework. 
2530 **Example:** 
2531
2532 Main D 
2533
2534 @subsubsection occt_2142243456_930384826532  UndoLimit
2535
2536 Syntax:       UndoLimit docname [value=0] 
2537
2538
2539 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 
2540 **Example:** 
2541
2542 UndoLimit D 100 
2543
2544 @subsubsection occt_2142243456_930384826533  Undo
2545
2546 Syntax:       Undo docname [value=1] 
2547
2548 Undoes **value** steps. 
2549 **Example:** 
2550
2551 Undo D 
2552
2553 @subsubsection occt_2142243456_930384826534  Redo
2554
2555 Syntax:       Redo docname [value=1] 
2556
2557 Redoes **value** steps. 
2558 **Example:** 
2559
2560 Redo D 
2561
2562 @subsubsection occt_2142243456_930384826535  OpenCommand
2563
2564 Syntax:       OpenCommand docname 
2565
2566 Opens a new command transaction. 
2567 **Example:** 
2568
2569 OpenCommand D 
2570
2571 @subsubsection occt_2142243456_930384826536  CommitCommand
2572
2573 Syntax:       CommitCommand docname 
2574
2575 Commits the Command transaction. 
2576 **Example:** 
2577
2578 CommitCommand D 
2579
2580 @subsubsection occt_2142243456_930384826537  NewCommand
2581
2582 Syntax:       NewCommand docname 
2583
2584 This is a short-cut for Commit and Open transaction. 
2585 **Example:** 
2586
2587 NewCommand D 
2588
2589 @subsubsection occt_2142243456_930384826538  AbortCommand
2590
2591 Syntax:       AbortCommand docname 
2592
2593 Aborts the Command transaction. 
2594 **Example:** 
2595
2596 AbortCommand D 
2597
2598 @subsubsection occt_2142243456_930384826539  Copy
2599
2600 Syntax:       Copy docname entry Xdocname Xentry 
2601
2602 Copies the contents of **entry** to **Xentry**. No links are registred. 
2603 **Example:** 
2604
2605 Copy D1 0:2 D2 0:4 
2606
2607 @subsubsection occt_2142243456_9303848265310  UpdateLink
2608
2609 Syntax:       UpdateLink docname [entry] 
2610
2611 Updates external reference set at **entry**. 
2612 **Example:** 
2613
2614 UpdateLink D 
2615
2616 @subsubsection occt_2142243456_9303848265311  CopyWithLink
2617
2618 Syntax:       CopyWithLink docname entry Xdocname Xentry 
2619
2620 Aborts the Command transaction. 
2621 Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry**  label. 
2622 **Example:** 
2623
2624 CopyWithLink D1 0:2 D2 0:4 
2625
2626 @subsubsection occt_2142243456_9303848265312  UpdateXLinks
2627
2628 Syntax:       UpdateXLinks docname entry 
2629
2630 Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed 
2631 **Example:** 
2632
2633 UpdateXLinks D 0:2 
2634
2635 @subsubsection occt_2142243456_9303848265313  DumpDocument
2636
2637 Syntax:       DumpDocument docname 
2638
2639 Displays parameters of **docname** document. 
2640 **Example:** 
2641
2642 DumpDocument D 
2643
2644 @subsection occt_2142243456_93038482654  Data Framework commands
2645
2646
2647 @subsubsection occt_2142243456_930384826541  MakeDF
2648
2649 Syntax:       MakeDF dfname 
2650
2651 Creates a new data framework. 
2652 **Example:** 
2653
2654 MakeDF D 
2655
2656 @subsubsection occt_2142243456_930384826542  ClearDF
2657
2658 Syntax:       ClearDF dfname 
2659
2660 Clears a data framework. 
2661 **Example:** 
2662
2663 ClearDF D 
2664
2665 @subsubsection occt_2142243456_930384826543  CopyDF
2666
2667 Syntax:       CopyDF dfname1 entry1 [dfname2] entry2 
2668
2669 Copies a data framework. 
2670 **Example:** 
2671
2672 CopyDF D 0:2 0:4 
2673
2674 @subsubsection occt_2142243456_930384826544  CopyLabel
2675
2676 Syntax:       CopyLabel dfname fromlabel tolablel 
2677
2678 Copies a label. 
2679 **Example:** 
2680
2681 CopyLabel D1 0:2 0:4 
2682
2683 @subsubsection occt_2142243456_930384826545  MiniDumpDF
2684
2685 Syntax:       MiniDumpDF dfname 
2686
2687 Makes a mini-dump of a data framework. 
2688 **Example:** 
2689
2690 MiniDumpDF D 
2691
2692 @subsubsection occt_2142243456_930384826546  XDumpDF
2693
2694 Syntax:       XDumpDF dfname 
2695
2696 Makes an extended dump of a data framework. 
2697 **Example:** 
2698
2699 XDumpDF D 
2700
2701 @subsection occt_2142243456_93038482655  General attributes commands
2702
2703
2704 @subsubsection occt_2142243456_930384826551  SetInteger
2705
2706 Syntax:       SetInteger dfname entry value 
2707
2708 Finds or creates an Integer attribute at **entry** label and sets **value**. 
2709 **Example:** 
2710
2711 SetInteger D 0:2 100 
2712
2713 @subsubsection occt_2142243456_930384826552  GetInteger
2714
2715 Syntax:       GetInteger dfname entry [drawname] 
2716
2717 Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined. 
2718 **Example:** 
2719
2720 GetInteger D 0:2 Int1 
2721
2722 @subsubsection occt_2142243456_930384826553  SetReal
2723
2724 Syntax:       SetReal dfname entry value 
2725
2726 Finds or creates a Real attribute at **entry** label and sets **value**. 
2727 **Example:** 
2728
2729 SetReal D 0:2 100. 
2730
2731 @subsubsection occt_2142243456_930384826554  GetReal
2732
2733 Syntax:       GetReal dfname entry [drawname] 
2734
2735 Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined. 
2736 **Example:** 
2737
2738 GetReal D 0:2 Real1 
2739
2740 @subsubsection occt_2142243456_930384826555  SetIntArray
2741
2742 Syntax:       SetIntArray dfname entry lower upper value1 value2 … 
2743
2744 Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…** 
2745 **Example:** 
2746
2747 SetIntArray D 0:2 1 4 100 200 300 400 
2748
2749 @subsubsection occt_2142243456_930384826556  GetIntArray
2750
2751 Syntax:       GetIntArray dfname entry 
2752
2753 Gets a value of an IntegerArray attribute at **entry** label. 
2754 **Example:** 
2755
2756 GetIntArray D 0:2 
2757
2758 @subsubsection occt_2142243456_930384826557  SetRealArray
2759
2760 Syntax:       SetRealArray dfname entry lower upper value1 value2 … 
2761
2762 Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…** 
2763 **Example:** 
2764
2765 GetRealArray D 0:2 1 4 100. 200. 300. 400. 
2766
2767 @subsubsection occt_2142243456_930384826558  GetRealArray
2768
2769 Syntax:       GetRealArray dfname entry 
2770
2771 Gets a value of a RealArray attribute at **entry** label. 
2772 **Example:** 
2773
2774 GetRealArray D 0:2 
2775
2776 @subsubsection occt_2142243456_930384826559  SetComment
2777
2778 Syntax:       SetComment dfname entry value 
2779
2780 Finds or creates a Comment attribute at **entry** label and sets **value**. 
2781 **Example:** 
2782
2783 SetComment D 0:2 *My comment* 
2784
2785 @subsubsection occt_2142243456_9303848265510  GetComment
2786
2787 Syntax:       GetComment dfname entry 
2788
2789 Gets a value of a Comment attribute at **entry** label. 
2790 **Example:** 
2791
2792 GetComment D 0:2 
2793
2794 @subsubsection occt_2142243456_9303848265511  SetExtStringArray
2795
2796 Syntax:       SetExtStringArray dfname entry lower upper value1 value2 … 
2797
2798 Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…** 
2799 **Example:** 
2800
2801 SetExtStringArray D 0:2 1 3 *string1* *string2* *string3* 
2802
2803 @subsubsection occt_2142243456_9303848265512  GetExtStringArray
2804
2805 Syntax:       GetExtStringArray dfname entry 
2806
2807 Gets a value of an ExtStringArray attribute at **entry** label. 
2808 **Example:** 
2809
2810 GetExtStringArray D 0:2 
2811
2812 @subsubsection occt_2142243456_9303848265513  SetName
2813
2814 Syntax:       SetName dfname entry value 
2815
2816 Finds or creates a Name attribute at **entry** label and set **value**. 
2817 **Example:** 
2818
2819 SetName D 0:2 *My name* 
2820
2821 @subsubsection occt_2142243456_9303848265514  GetName
2822
2823 Syntax:       GetName dfname entry 
2824
2825 Gets a value of a Name attribute at **entry** label. 
2826 **Example:** 
2827
2828 GetName D 0:2 
2829
2830 @subsubsection occt_2142243456_9303848265515  SetReference
2831
2832 Syntax:       SetReference dfname entry reference 
2833
2834 Creates a Reference attribute at **entry** label and sets **reference**. 
2835 **Example:** 
2836
2837 SetReference D 0:2 0:4 
2838
2839 @subsubsection occt_2142243456_9303848265516  GetReference
2840
2841 Syntax:       GetReference dfname entry 
2842
2843 Gets a value of a Reference attribute at **entry** label. 
2844 **Example:** 
2845
2846 GetReference D 0:2 
2847
2848 @subsubsection occt_2142243456_9303848265517  SetUAttribute
2849
2850 Syntax:       SetUAttribute dfname entry localGUID 
2851
2852 Creates a UAttribute attribute at **entry** label with **localGUID**. 
2853 **Example:** 
2854
2855 set localGUID *c73bd076-22ee-11d2-acde-080009dc4422* 
2856 SetUAttribute D 0:2 ${localGUID} 
2857
2858 @subsubsection occt_2142243456_9303848265518  GetUAttribute
2859
2860 Syntax:       GetUAttribute dfname entry loacalGUID 
2861
2862 Finds a UAttribute at **entry** label with **localGUID**. 
2863 **Example:** 
2864
2865 set localGUID *c73bd076-22ee-11d2-acde-080009dc4422* 
2866 GetUAttribute D 0:2 ${localGUID} 
2867
2868 @subsubsection occt_2142243456_9303848265519  SetFunction
2869
2870 Syntax:       SetFunction dfname entry ID failure 
2871
2872 Finds or creates a Function attribute at **entry** label with driver ID and **failure** index. 
2873 **Example:** 
2874
2875 set ID *c73bd076-22ee-11d2-acde-080009dc4422* 
2876 SetFunction D 0:2 ${ID} 1 
2877
2878 @subsubsection occt_2142243456_9303848265520  GetFunction
2879
2880 Syntax:       GetFunction dfname entry ID failure 
2881
2882 Finds a Function attribute at **entry** label and sets driver ID to **ID** variable and failure index to **failure** variable. 
2883 **Example:** 
2884
2885 GetFunction D 0:2 ID failure 
2886
2887 @subsubsection occt_2142243456_9303848265521  NewShape
2888
2889 Syntax:       NewShape dfname entry [shape] 
2890
2891
2892 Finds or creates a Shape attribute at **entry** label. Creates or updates the associated NamedShape attribute by **shape** if **shape** is defined. 
2893 **Example:** 
2894
2895 box b 10 10 10 
2896 NewShape D 0:2 b 
2897
2898 @subsubsection occt_2142243456_9303848265522  SetShape
2899
2900 Syntax:       SetShape dfname entry shape 
2901
2902 Creates or updates a NamedShape attribute at **entry** label by **shape**. 
2903 **Example:** 
2904
2905 box b 10 10 10 
2906 SetShape D 0:2 b 
2907
2908 @subsubsection occt_2142243456_9303848265523  GetShape
2909
2910 Syntax:       GetShape2 dfname entry shape 
2911
2912 Sets a shape from NamedShape attribute associated with **entry** label to **shape** draw variable. 
2913 **Example:** 
2914
2915 GetShape2 D 0:2 b 
2916
2917 @subsection occt_2142243456_93038482656  Geometric attributes commands
2918
2919
2920 @subsubsection occt_2142243456_930384826561  SetPoint
2921
2922 Syntax:       SetPoint dfname entry point 
2923
2924 Finds or creates a Point attribute at **entry** label and sets **point** as generated in the associated NamedShape attribute. 
2925 **Example:** 
2926
2927 point p 10 10 10 
2928 SetPoint D 0:2 p 
2929
2930 @subsubsection occt_2142243456_930384826562  GetPoint
2931
2932 Syntax:       GetPoint dfname entry [drawname] 
2933
2934 Gets a vertex from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined. 
2935 **Example:** 
2936
2937 GetPoint D 0:2 p 
2938
2939 @subsubsection occt_2142243456_930384826563  SetAxis
2940
2941 Syntax:       SetAxis dfname entry axis 
2942
2943 Finds or creates an Axis attribute at **entry** label and sets **axis** as generated in the associated NamedShape attribute. 
2944 **Example:** 
2945
2946 line l 10 20 30 100 200 300 
2947 SetAxis D 0:2 l 
2948
2949 @subsubsection occt_2142243456_930384826564  GetAxis
2950
2951 Syntax:       GetAxis dfname entry [drawname] 
2952
2953 Gets a line from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined. 
2954 **Example:** 
2955
2956 GetAxis D 0:2 l 
2957
2958 @subsubsection occt_2142243456_930384826565  SetPlane
2959
2960 Syntax:       SetPlane dfname entry plane 
2961
2962 Finds or creates a Plane attribute at **entry** label and sets **plane** as generated in the associated NamedShape attribute. 
2963 **Example:** 
2964
2965 plane pl 10 20 30 –1 0 0 
2966 SetPlane D 0:2 pl 
2967
2968 @subsubsection occt_2142243456_930384826566  GetPlane
2969
2970 Syntax:       GetPlane dfname entry [drawname] 
2971
2972 Gets a plane from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined. 
2973 **Example:** 
2974
2975 GetPlane D 0:2 pl 
2976
2977 @subsubsection occt_2142243456_930384826567  SetGeometry
2978
2979 Syntax:       SetGeometry dfname entry [type] [shape] 
2980
2981
2982 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**. 
2983 **Example:** 
2984
2985 point p 10 10 10 
2986 SetGeometry D 0:2 pnt p 
2987
2988 @subsubsection occt_2142243456_930384826568  GetGeometryType
2989
2990 Syntax:       GetGeometryType dfname entry 
2991
2992 Gets a geometry type from Geometry attribute at **entry** label. 
2993 **Example:** 
2994
2995 GetGeometryType D 0:2 
2996
2997 @subsubsection occt_2142243456_930384826569  SetConstraint
2998
2999 Syntax:       SetConstraint dfname entry keyword geometrie [geometrie …] 
3000             SetConstraint dfname entry *plane* geometrie 
3001             SetConstraint dfname entry *value* value  
3002
3003 1. Creates a Constraint attribute at **entry** label and sets **keyword** constraint between geometry(ies). 
3004 **keyword** must be one of the following: 
3005 **rad/dia/minr/majr/tan/par/perp/concentric/equal/dist/angle/eqrad/symm/midp/ eqdist/fix/rigid** 
3006 or 
3007 **from/axis/mate/alignf/aligna/axesa/facesa/round/offset** 
3008
3009 2. Sets plane for the existing constraint. 
3010
3011 3. Sets value for the existing constraint. 
3012 **Example:** 
3013
3014 SetConstraint D 0:2 *value* 5 
3015
3016 @subsubsection occt_2142243456_9303848265610  GetConstraint
3017
3018 Syntax:       GetConstraint dfname entry 
3019
3020 Dumps a Constraint attribute at **entry** label 
3021 **Example:** 
3022
3023 GetConstraint D 0:2 
3024
3025 @subsubsection occt_2142243456_9303848265611  SetVariable
3026
3027 Syntax:       SetVariable dfname entry isconstant(0/1) units 
3028
3029 Creates a Variable attribute at **entry** label and sets **isconstant** flag and **units** as a string. 
3030 **Example:** 
3031
3032 SetVariable D 0:2 1 *mm* 
3033
3034 @subsubsection occt_2142243456_9303848265612  GetVariable
3035
3036 Syntax:       GetVariable dfname entry isconstant units 
3037
3038 Gets an **isconstant** flag and **units** of a Variable attribute at **entry** label. 
3039 **Example:** 
3040
3041 GetVariable D 0:2 isconstant units 
3042 puts *IsConstant=${isconstant}* 
3043 puts *Units=${units}* 
3044
3045
3046 @subsection occt_2142243456_93038482657  Tree attributes commands
3047
3048
3049 @subsubsection occt_2142243456_930384826571  RootNode
3050
3051 Syntax:       RootNode dfname treenodeentry [ID] 
3052
3053 Returns ultimate father of TreeNode attribute identified by its **treenodeentry** and its **ID** (or default ID, if **ID** is not defined). 
3054
3055
3056 @subsubsection occt_2142243456_930384826572  SetNode
3057
3058 Syntax:       SetNode dfname treenodeentry [ID] 
3059
3060 Creates a TreeNode attribute on the **treenodeentry** label with its tree **ID** (or assigns a default ID, if the **ID** is not defined). 
3061
3062
3063 @subsubsection occt_2142243456_930384826573  AppendNode
3064
3065 Syntax:       AppendNode dfname fatherentry childentry [fatherID] 
3066
3067
3068 Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as last child of **fatherentry**. 
3069
3070
3071
3072
3073 @subsubsection occt_2142243456_930384826574  PrependNode
3074
3075 Syntax:       PrependNode dfname fatherentry childentry [fatherID] 
3076
3077
3078 Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as first child of **fatherentry**. 
3079
3080
3081 @subsubsection occt_2142243456_930384826575  InsertNodeBefore
3082
3083 Syntax:       InsertNodeBefore dfname treenodeentry beforetreenode [ID] 
3084
3085 Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **beforetreenode** before **treenodeentry**. 
3086
3087
3088 @subsubsection occt_2142243456_930384826576  InsertNodeAfter
3089
3090 Syntax:       InsertNodeAfter dfname treenodeentry aftertreenode [ID] 
3091
3092 Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **aftertreenode** after **treenodeentry**. 
3093
3094
3095 @subsubsection occt_2142243456_930384826577  DetachNode
3096
3097 Syntax:       DetachNode dfname treenodeentry [ID] 
3098
3099 Removes a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) from **treenodeentry**. 
3100
3101
3102 @subsubsection occt_2142243456_930384826578  ChildNodeIterate
3103
3104 Syntax:       ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID] 
3105
3106
3107 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. 
3108 **Example:** 
3109
3110 Label D 0:2 
3111 Label D 0:3 
3112 Label D 0:4 
3113 Label D 0:5 
3114 Label D 0:6 
3115 Label D 0:7 
3116 Label D 0:8 
3117 Label D 0:9 
3118
3119 # Set root node 
3120 SetNode D 0:2 
3121
3122 AppendNode D 0:2 0:4 
3123 AppendNode D 0:2 0:5 
3124 PrependNode D 0:4 0:3 
3125 PrependNode D 0:4 0:8 
3126 PrependNode D 0:4 0:9 
3127
3128 InsertNodeBefore D 0:5 0:6 
3129 InsertNodeAfter D 0:4 0:7 
3130
3131 DetachNode D 0:8 
3132
3133
3134 # List all levels 
3135 ChildNodeIterate D 0:2 1 
3136
3137 ==0:4 
3138 ==0:9 
3139 ==0:3 
3140 ==0:7 
3141 ==0:6 
3142 ==0:5 
3143
3144
3145 # List only first levels 
3146 ChildNodeIterate D 0:2 1 
3147
3148 ==0:4 
3149 ==0:7 
3150 ==0:6 
3151 ==0:5 
3152
3153 @subsubsection occt_2142243456_930384826579  InitChildNodeIterator
3154
3155 Syntax:       InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID] 
3156
3157
3158 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. 
3159 **Example:** 
3160
3161 InitChildNodeIterate D 0:5 1 
3162 set aChildNumber 0 
3163 for {set i 1} {$i  100} {incr i} { 
3164     if {[ChildNodeMore] == *TRUE*} { 
3165         puts *Tree node = [ChildNodeValue]* 
3166         incr aChildNumber 
3167         ChildNodeNext 
3168     } 
3169
3170 puts *aChildNumber=$aChildNumber* 
3171
3172 @subsubsection occt_2142243456_9303848265710  ChildNodeMore
3173
3174 Syntax:       ChildNodeMore 
3175
3176 Returns TRUE if there is a current item in the iteration. 
3177
3178
3179 @subsubsection occt_2142243456_9303848265711  ChildNodeNext
3180
3181 Syntax:       ChildNodeNext 
3182
3183 Moves to the next Item. 
3184
3185
3186 @subsubsection occt_2142243456_9303848265712  ChildNodeValue
3187
3188 Syntax:       ChildNodeValue 
3189
3190 Returns the current treenode of ChildNodeIterator. 
3191
3192
3193 @subsubsection occt_2142243456_9303848265713  ChildNodeNextBrother
3194
3195 Syntax:       ChildNodeNextBrother 
3196
3197 Moves to the next Brother. If there is none, goes up. This method is interesting only with ;allLevels; behavior. 
3198
3199
3200 @subsection occt_2142243456_93038482658  Standard presentation commands
3201
3202
3203 @subsubsection occt_2142243456_930384826581  AISInitViewer
3204
3205 Syntax:       AISInitViewer docname 
3206
3207 Creates and sets AISViewer attribute at root label, creates AIS viewer window. 
3208 **Example:** 
3209
3210 AISInitViewer D 
3211
3212 @subsubsection occt_2142243456_930384826582  AISRepaint
3213
3214 Syntax:       AISRepaint docname 
3215
3216 Updates the AIS viewer window. 
3217 **Example:** 
3218
3219 AISRepaint D 
3220
3221 @subsubsection occt_2142243456_930384826583  AISDisplay
3222
3223 Syntax:       AISDisplay docname entry [not_update] 
3224
3225
3226 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. 
3227 **Example:** 
3228
3229 AISDisplay D 0:5 
3230
3231 @subsubsection occt_2142243456_930384826584  AISUpdate
3232
3233 Syntax:       AISUpdate docname entry 
3234
3235 Recomputes a presantation of AISobject from **entry** label and applies the visualization setting in AIS viewer. 
3236 **Example:** 
3237
3238 AISUpdate D 0:5 
3239
3240 @subsubsection occt_2142243456_930384826585  AISErase
3241
3242 Syntax:       AISErase docname entry 
3243
3244 Erases AISobject of **entry** label in AIS viewer. 
3245 **Example:** 
3246
3247 AISErase D 0:5 
3248
3249 @subsubsection occt_2142243456_930384826586  AISRemove
3250
3251 Syntax:       AISRemove docname entry 
3252
3253 Erases AISobject of **entry** label in AIS viewer, then AISobject is removed from AIS_InteractiveContext. 
3254 **Example:** 
3255
3256 AISRemove D 0:5 
3257
3258 @subsubsection occt_2142243456_930384826587  AISSet
3259
3260 Syntax:       AISSet docname entry ID 
3261
3262
3263 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). 
3264 **Example:** 
3265
3266 AISSet D 0:5 NS 
3267
3268 @subsubsection occt_2142243456_930384826588  AISDriver
3269
3270 Syntax:       AISDriver docname entry [ID] 
3271
3272
3273 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). 
3274 **Example:** 
3275
3276 # Get Driver GUID 
3277 AISDriver D 0:5 
3278
3279 @subsubsection occt_2142243456_930384826589  AISUnset
3280
3281 Syntax:       AISUnset docname entry 
3282
3283 Deletes AISPresentation attribute (if it exists) of an **entry** label. 
3284 **Example:** 
3285
3286 AISUnset D 0:5 
3287
3288 @subsubsection occt_2142243456_9303848265810  AISTransparency
3289
3290 Syntax:       AISTransparency docname entry [transparency] 
3291
3292 Sets (if **transparency** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label. 
3293 **Example:** 
3294
3295 AISTransparency D 0:5 0.5 
3296
3297 @subsubsection occt_2142243456_9303848265811  AISHasOwnTransparency
3298
3299 Syntax:       AISHasOwnTransparency docname entry 
3300
3301 Tests AISPresentation attribute of an **entry** label by own transparency. 
3302 **Example:** 
3303
3304 AISHasOwnTransparency D 0:5 
3305
3306 @subsubsection occt_2142243456_9303848265812  AISMaterial
3307
3308 Syntax:       AISMaterial docname entry [material] 
3309
3310
3311 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 **meshmat**). 
3312 **Example:** 
3313
3314 AISMaterial D 0:5 5 
3315
3316 @subsubsection occt_2142243456_9303848265813  AISHasOwnMaterial
3317
3318 Syntax:       AISHasOwnMaterial docname entry 
3319
3320 Tests AISPresentation attribute of an **entry** label by own material. 
3321 **Example:** 
3322
3323 AISHasOwnMaterial D 0:5 
3324
3325 @subsubsection occt_2142243456_9303848265814  AISColor
3326
3327 Syntax:       AISColor docname entry [color] 
3328
3329 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**). 
3330 **Example:** 
3331
3332 AISColor D 0:5 25 
3333
3334 @subsubsection occt_2142243456_9303848265815  AISHasOwnColor
3335
3336 Syntax:       AISHasOwnColor docname entry 
3337
3338 Tests AISPresentation attribute of an **entry** label by own color. 
3339 **Example:** 
3340
3341 AISHasOwnColor D 0:5 
3342
3343
3344 @section occt_2142243456_1101404852 Geometry commands
3345
3346 @subsection occt_2142243456_110140485261 Overview
3347
3348 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. 
3349
3350 In the context of Geometry, Draw includes the following types of variable: 
3351
3352   * 2d and 3d points
3353   * The 2d curve, which corresponds to *Curve *in *Geom2d*.
3354   * The 3d curve and surface, which correspond to *Curve *and *Surface *in *Geom *<a href="#_ftn2">[2]</a>.
3355   
3356 Draw geometric variables never share data; the **copy **command will always make a complete copy of the content of the variable. 
3357
3358 The following topics are covered in the nine sections of this chapter: 
3359
3360   * **Curve creation** deals with the various types of curves and how to create them.
3361   * **Surface creation** deals with the different types of surfaces and how to create them.
3362   * **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.
3363   * **Geometric transformations** covers translation, rotation, mirror image and point scaling transformations.
3364   * **Curve and Surface Analysis** deals with the commands used to compute points, derivatives and curvatures.
3365   * **Intersections** presents intersections of surfaces and curves.
3366   * **Approximations** deals with creating curves and surfaces from a set of points.
3367   * **Constraints** concerns construction of 2d circles and lines by constraints such as tangency.
3368   * **Display** describes commands to control the display of curves and surfaces.
3369
3370 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. 
3371
3372 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. 
3373
3374 @subsection occt_2142243456_110140485262  Curve creation
3375
3376 This section deals with both points and curves. Types of curves are: 
3377
3378   * Analytical curves such as lines, circles, ellipses, parabolas, and hyperbolas.
3379   * Polar curves such as bezier curves and bspline curves.
3380   * 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.
3381   * NURBS can be created from other curves using **convert **in the *Surface Creation *section.
3382   * Curves can be created from the isoparametric lines of surfaces by the **uiso **and **viso **commands.
3383   * 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.
3384
3385 Curves are displayed with an arrow showing the last parameter. 
3386
3387
3388 @subsubsection occt_2142243456_1101404852621 point
3389
3390   @verbatim
3391     Syntax:      point name x y [z] 
3392   @endverbatim
3393   
3394 **point** creates a 2d or 3d point, depending on the number of arguments. **Example:**
3395
3396   @verbatim
3397     # 2d point 
3398     point p1 1 2 
3399
3400     # 3d point 
3401     point p2 10 20 -5 
3402   @endverbatim
3403   
3404 @subsubsection occt_2142243456_1101404852622  line
3405
3406   @verbatim
3407     Syntax:      line name x y [z] dx dy [dz] 
3408   @endverbatim
3409   
3410 **line** 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. 
3411
3412 A 2d line will be represented asl x y dx dy, and a 3d line asl x y z dx dy dz. A line is parameterized along its length starting from the point of origin along the direction vector. The direction vector is normalized and must not be null. Lines are infinite, even though their representation is not. **Example:** 
3413
3414   @verbatim
3415     # a 2d line at 45 degrees of the X axis 
3416     line l 2 0 1 1 
3417
3418     # a 3d line through the point 10 0 0 and parallel to Z 
3419     line l 10 0 0 0 0 1 
3420   @endverbatim
3421
3422 @subsubsection occt_2142243456_1101404852623  circle
3423
3424 Syntax:      circle name x y [z [dx dy dz]] [ux uy [uz]] radius 
3425
3426 **circle **creates a 2d or a 3d circle. 
3427
3428 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. 
3429
3430 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. 
3431
3432 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. 
3433
3434 **Example:** 
3435
3436 # A 2d circle of radius 5 centered at 10,-2 
3437 circle c1 10 -2 5 
3438
3439 # another 2d circle with a user defined origin 
3440 # the point of parameter 0 on this circle will be 
3441 # 1+sqrt(2),1+sqrt(2) 
3442 circle c2 1 1 1 1 2 
3443
3444 # a 3d circle, center 10 20 -5, axis Z, radius 17 
3445 circle c3 10 20 -5 17 
3446
3447 # same 3d circle with axis Y 
3448 circle c4 10 20 -5 0 1 0 17 
3449
3450 # full 3d circle, axis X, origin on Z 
3451 circle c5 10 20 -5 1 0 0 0 0 1 17 
3452
3453
3454 @subsubsection occt_2142243456_1101404852624  ellipse
3455
3456 Syntax: ellipse name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius **ellipse **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: 
3457
3458 P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir 
3459
3460 where: 
3461
3462   * P is the point of parameter u,
3463   * O, Xdir and Ydir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system.
3464 **Example:**
3465
3466 # default 2d ellipse 
3467 ellipse e1 10 5 20 10 
3468
3469 # 2d ellipse at angle 60 degree 
3470 ellipse e2 0 0 1 2 30 5 
3471
3472 # 3d ellipse, in the XY plane 
3473 ellipse e3 0 0 0 25 5 
3474
3475 # 3d ellipse in the X,Z plane with axis 1, 0 ,1 
3476 ellipse e4 0 0 0 0 1 0 1 0 1 25 5 
3477
3478 See also: **circle** 
3479 @subsubsection occt_2142243456_1101404852625  hyperbola
3480
3481 Syntax:      hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius 
3482
3483 **hyperbola **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. 
3484
3485 The Draw hyperbola is parameterized as follows: 
3486
3487 P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir 
3488
3489 where: 
3490
3491   * P is the point of parameter U,
3492   * O, XDir and YDir are respectively the origin, *X Direction* and *Y
3493
3494 Direction* of its local coordinate system. 
3495 **Example:** 
3496
3497 # default 2d hyperbola, with asymptotes 1,1 -1,1 
3498 hyperbola h1 0 0 30 30 
3499
3500 # 2d hyperbola at angle 60 degrees 
3501 hyperbola h2 0 0 1 2 20 20 
3502
3503 # 3d hyperbola, in the XY plane 
3504 hyperbola h3 0 0 0 50 50 
3505
3506 See also: **circle** 
3507
3508
3509 @subsubsection occt_2142243456_1101404852626  parabola
3510
3511 Syntax:      parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength 
3512
3513 **parabola **creates a 2d or 3d parabola. in the axis system defined by the first arguments.The origin is the apex of the parabola. 
3514
3515 The Geom_Parabola parabola is parameterized as follows: 
3516
3517 P(u) = O + u*u/(4.*F)*XDir + u*YDir 
3518
3519 where: 
3520   * P is the point of parameter u,
3521   * O, XDir and YDir are respectively the origin, *X Direction* and *Y Direction* of its local coordinate system,
3522   * F is the focal length of the parabola.
3523 **Example:** 
3524
3525 # 2d parabola 
3526 parabola p1 0 0 50 
3527
3528 # 2d parabola with convexity +Y 
3529 parabola p2 0 0 0 1 50 
3530
3531 # 3d parabola in the Y-Z plane, convexity +Z 
3532 parabola p3 0 0 0 1 0 0 0 0 1 50 
3533
3534 See also: **circle** 
3535
3536
3537 @subsubsection occt_2142243456_1101404852627  beziercurve, dbeziercurve
3538
3539 Syntax:      beziercurve name nbpole pole, [weight] 
3540 2dbeziercurve name nbpole pole, [weight] 
3541
3542 **beziercurve **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. 
3543 **Example:** 
3544
3545 # a rational 2d bezier curve (arc of circle) 
3546 2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1 
3547
3548 # a 3d bezier curve, not rational 
3549 beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10 
3550
3551
3552 @subsubsection occt_2142243456_1101404852628  bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
3553
3554 Syntax:      bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic) 
3555 2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic) 
3556
3557 **bsplinecurve **creates 2d or 3d bspline curves; the **pbsplinecurve **and **2dpbsplinecurve **commands create periodic bspline curves. 
3558
3559 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. 
3560
3561 The table of knots is an increasing sequence of reals without repetition. 
3562 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. 
3563
3564 The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be: 
3565
3566   * For a non periodic curve: Sum of multiplicities - degree + 1
3567   * For a periodic curve: Sum of multiplicities - last multiplicity
3568 **Example:** 
3569
3570 # a bspline curve with 4 poles and 3 knots 
3571 bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
3572 10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
3573 # a 2d periodic circle (parameter from 0 to 2*pi !!) 
3574 dset h sqrt(3)/2 
3575 2dpbsplinecurve c 2 \ 
3576 4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \ 
3577 0 -h/3 1 \ 
3578 0.5 -h/3 0.5 \ 
3579 0.25 h/6 1 \ 
3580 0 2*h/3 0.5 \ 
3581 -0.25 h/6 1 \ 
3582 -0.5 -h/3 0.5 \ 
3583 0 -h/3 1 
3584
3585 <h4>NOTE</h4>
3586 *You can create the **NURBS **subset of bspline curves and* 
3587 *surfaces by trimming analytical curves and surfaces and* 
3588 *executing the command *convert*; see below.* 
3589
3590
3591 @subsubsection occt_2142243456_1101404852629  uiso, viso
3592
3593 Syntax:      uiso name surface u 
3594 viso name surface u 
3595
3596 Use these commands to create a U or V isoparametric curve from a surface. 
3597 **Example:** 
3598
3599 # create a cylinder and extract iso curves 
3600
3601 cylinder c 10 
3602 uiso c1 c pi/6 
3603 viso c2 c 
3604
3605 *NOTE* 
3606 *Cannot be done from offset surfaces.* 
3607
3608
3609 @subsubsection occt_2142243456_11014048526210  tod, tod
3610
3611 Syntax:      to3d name curve2d [plane] 
3612 to2d name curve3d [plane] 
3613
3614 The **to3d **and **to2d **commands are used to 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. 
3615 **Example:** 
3616
3617 # the following commands 
3618 circle c 0 0 5 
3619 plane p -2 1 0 1 2 3 
3620 to3d c c p 
3621
3622 # will create the same circle as 
3623 circle c -2 1 0 1 2 3 5 
3624
3625 See also: **project** 
3626
3627
3628 @subsubsection occt_2142243456_11014048526211  project
3629
3630 Syntax:      project name curve3d surface 
3631
3632 **project **computes a 2d curve in the parametric space of a surface corresponding to a 3d curve. This can only be used on analytical surfaces. 
3633 **Example:** 
3634
3635 # intersect a cylinder and a plane 
3636 # and project the resulting ellipse on the cylinder 
3637 # this will create a 2d sinusoid-like bspline 
3638 cylinder c 5 
3639 plane p 0 0 0 0 1 1 
3640 intersect i c p 
3641 project i2d i c 
3642
3643 @subsection occt_2142243456_110140485263  Surface creation
3644
3645 Types of surfaces are: 
3646
3647   * Analytical surfaces: plane, cylinder, cone, sphere, torus.
3648   * Polar surfaces: bezier surfaces, bspline surfaces
3649   * Trimmed and Offset surfaces; see **trim**, **trimu**, **trimv**, **offset**.
3650   * Surfaces produced by Revolution and Extrusion, created from curves with the **revsurf **and **extsurf**.
3651   * NURBS surfaces.
3652
3653 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. 
3654
3655
3656 @subsubsection occt_2142243456_1101404852631  plane
3657
3658 Syntax:      plane name [x y z [dx dy dz [ux uy uz]]] 
3659
3660 Uses this command to create an infinite plane. A plane is the same as a 3d coordinate system, x,y,z is the origin, dx, dy, dz is the Z direction and ux, uy, uz is the X direction. The plane is perpendicular to Z and X is the U parameter. dx,dy,dz and ux,uy,uz must not be null and not colinear. ux,uy,uz will be modified to be orthogonal to dx,dy,dz. There are default values for the coordinate system. If no arguments are given, the global system (0,0,0), (0,0,1), (1,0,0). If only the origin is given, the axes are those given by default(0,0,1), (1,0,0). If the origin and the Z axis are given, the X axis is generated perpendicular to the Z axis. Note that this definition will be used for all analytical surfaces. 
3661 **Example:** 
3662
3663 # a plane through the point 10,0,0 perpendicular to X 
3664 # with U direction on Y 
3665 plane p1 10 0 0 1 0 0 0 1 0 
3666
3667 # an horixontal plane with origin 10, -20, -5 
3668 plane p2 10 -20 -5 
3669
3670
3671 @subsubsection occt_2142243456_1101404852632  cylinder
3672
3673 Syntax:      cylinder name [x y z [dx dy dz [ux uy uz]]] radius 
3674
3675 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. 
3676 See also: **plane** 
3677 **Example:** 
3678
3679 # a cylinder on the default Z axis, radius 10 
3680 cylinder c1 10 
3681
3682 # a cylinder, also along the Z axis but with origin 5, 
3683 10, -3 
3684 cylinder c2 5 10 -3 10 
3685
3686 # a cylinder through the origin and on a diagonal 
3687 # with longitude pi/3 and latitude pi/4 (euler angles) 
3688 dset lo pi/3. la pi/4. 
3689 cylinder c3 0 0 0 cos(la)*cos(lo) cos(la)*sin(lo) 
3690 sin(la) 10 
3691
3692
3693 @subsubsection occt_2142243456_1101404852633  cone
3694
3695 Syntax:      cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius 
3696
3697 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. 
3698 See also: **plane** 
3699 **Example:** 
3700
3701 # a cone at 45 degrees at the origin on Z 
3702 cone c1 45 0 
3703
3704 # a cone on axis Z with radius r1 at z1 and r2 at z2 
3705 cone c2 0 0 z1 180.*atan2(r2-r1,z2-z1)/pi r1 
3706
3707 @subsubsection occt_2142243456_1101404852634  sphere
3708
3709 Syntax:      sphere name [x y z [dx dy dz [ux uy uz]]] radius 
3710
3711 Creates a sphere in the local coordinate system defined in the **plane **command. The sphere is centered at the origin. To parameterize the sphere, u is the angle from X to Y, between o 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. 
3712 **Example:** 
3713 # a sphere at the origin 
3714 sphere s1 10 
3715 # a sphere at 10 10 10, with poles on the axis 1,1,1 
3716 sphere s2 10 10 10 1 1 1 10 
3717
3718 See also: **plane** 
3719
3720
3721 @subsubsection occt_2142243456_1101404852635  torus
3722
3723 Syntax:      torus name [x y z [dx dy dz [ux uy uz]]] major minor 
3724
3725 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. 
3726
3727 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. 
3728 **Example:** 
3729
3730 # a torus at the origin 
3731 torus t1 20 5 
3732
3733 # a torus in another coordinate system 
3734 torus t2 10 5 -2 2 1 0 20 5 
3735
3736 See also: **plane** 
3737
3738
3739 @subsubsection occt_2142243456_1101404852636  beziersurf
3740
3741 Syntax:      beziersurf name nbupoles nbvolpes pole, [weight] 
3742
3743 Use this command to create a bezier surface, rational or non-rational. First give the numbers of poles in the u and v directions. 
3744
3745 Then give the poles in the following order: pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles) and pole(nbupoles, nbvpoles). 
3746
3747 Weights may be omitted, but if you give one weight you must give all of them. 
3748 **Example:** 
3749
3750 # a non-rational degree 2,3 surface 
3751 beziersurf s 3 4 \ 
3752 0 0 0 10 0 5 20 0 0 \ 
3753 0 10 2 10 10 3 20 10 2 \ 
3754 0 20 10 10 20 20 20 20 10 \ 
3755 0 30 0 10 30 0 20 30 0 
3756
3757 See also: **beziercurve** 
3758
3759 @subsubsection occt_2142243456_1101404852637   bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
3760
3761 Syntax:      bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot 
3762 vmult ... x y z w ... 
3763 upbsplinesurf ... 
3764 vpbsplinesurf ... 
3765 uvpbsplinesurf ... 
3766
3767 **bsplinesurf **generates bspline surfaces. **upbsplinesurf **creates a bspline surface periodic in u; **vpbsplinesurf **creates one periodic in v; and **uvpbsplinesurf **creates one periodic in uv. 
3768
3769 The syntax is similar to the **bsplinecurve **command. First give the degree in u and the knots in u with their multiplicities, then do the same in v. The poles follow. The number of poles is the product of the number in u and the number in v. See **bsplinecurve **to compute the number of poles, the poles are first given in U as in the beziersurf command. You must give weights if the surface is rational. 
3770 **Example:** 
3771
3772 # create a bspline surface of degree 1 2 
3773 # with two knots in U and three in V 
3774 bsplinesurf s \ 
3775 1 2 0 2 1 2 \ 
3776 2 3 0 3 1 1 2 3 \ 
3777 0 0 0 1 10 0 5 1 \ 
3778 0 10 2 1 10 10 3 1 \ 
3779 0 20 10 1 10 20 20 1 \ 
3780 0 30 0 1 10 30 0 1 
3781
3782 See also: **bsplinecurve**, **beziersurf**, **convert** 
3783
3784
3785 @subsubsection occt_2142243456_1101404852638  trim, trimu, trimv
3786
3787 Syntax:      trim newname name [u1 u2 [v1 v2]] 
3788 trimu newname name 
3789 trimv newname name 
3790
3791 The **trim **commands create trimmed curves or trimmed surfaces. Note that trimmed curves and surfaces are classes of the *Geom *package. The **trim **command creates either a new trimmed curve from a curve or a new trimmed surface in u and v from a surface. **trimu **creates a u-trimmed surface, and **trimv **a v-trimmed surface. After an initial trim, a second execution with no parameters given recreates the basis curve. The curves can be either 2d or 3d. If the trimming parameters decrease and if the curve or surface is not periodic, the direction is reversed. 
3792 <h4>NOTE</h4>
3793 *Note that a trimmed curve or surface contains a copy of the* 
3794 *basis geometry: modifying that will not modify the trimmed* 
3795 *geometry. Trimming trimmed geometry will not create* 
3796 *multiple levels of trimming. The basis geometry will be used.* 
3797 **Example:** 
3798
3799 # create a 3d circle 
3800 circle c 0 0 0 10 
3801
3802 # trim it, use the same variable, the original is 
3803 deleted 
3804 trim c c 0 pi/2 
3805
3806 # the original can be recovered! 
3807 trim orc c 
3808
3809 # trim again 
3810 trim c c pi/4 pi/2 
3811
3812 # the original is not the trimmed curve but the basis 
3813 trim orc c 
3814
3815 # as the circle is periodic, the two following commands 
3816 are identical 
3817 trim cc c pi/2 0 
3818 trim cc c pi/2 2*pi 
3819
3820 # trim an infinite cylinder 
3821 cylinder cy 10 
3822 trimv cy cy 0 50 
3823
3824 See also: **reverse** 
3825
3826
3827 @subsubsection occt_2142243456_1101404852639  offset
3828
3829 Syntax:      offset name basename distance [dx dy dz] 
3830
3831 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. 
3832
3833 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. 
3834
3835 The offset curve or surface copies the basic geometry, which can be modified later. 
3836 **Example:** 
3837
3838 # graphic demonstration that the outline of a torus 
3839 # is the offset of an ellipse 
3840 smallview +X+Y 
3841 dset angle pi/6 
3842 torus t 0 0 0 0 cos(angle) sin(angle) 50 20 
3843 fit 
3844 ellipse e 0 0 0 50 50*sin(angle) 
3845 # note that the distance can be negative 
3846 offset l1 e 20 0 0 1 
3847 @subsubsection occt_2142243456_11014048526310  revsurf
3848
3849 Syntax:      revsurf name curvename x y z dx dy dz 
3850
3851 Creates a surface of revolution from a 3d curve. A surface of revolution or revolved surface is obtained by rotating a curve (called the *meridian*) through a complete revolution about an axis (referred to as the *axis of revolution*). The curve and the axis must be in the same plane (the *reference plane* of the surface). Give the point of origin x,y,z and the vector dx,dy,dz to define the axis of revolution. To parameterize a surface of revolution: u is the angle of rotation around the axis. Its origin is given by the position of the meridian on the surface. v is the parameter of the meridian. 
3852 **Example:** 
3853
3854 # another way of creating a torus like surface 
3855 circle c 50 0 0 20 
3856 revsurf s c 0 0 0 0 1 0 
3857
3858
3859 @subsubsection occt_2142243456_11014048526311  extsurf
3860
3861 Syntax:      extsurf newname curvename dx dy dz 
3862
3863 Use the **extsurf **command to create a surface of linear extrusion from a 3d curve. The basis curve is swept in a given direction,the *direction of extrusion* defined by a vector. In the syntax, dx,dy,dz gives the direction of extrusion. To parameterize a surface of extrusion: u is the parameter along the extruded curve; the v parameter is along the direction of extrusion. 
3864 **Example:** 
3865
3866 # an elliptic cylinder 
3867 ellipse e 0 0 0 10 5 
3868 extsurf s e 0 0 1 
3869 # to make it finite 
3870 trimv s s 0 10 
3871
3872
3873 @subsubsection occt_2142243456_11014048526312  convert
3874
3875 Syntax:      convert newname name 
3876
3877 **convert **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. 
3878 **Example:** 
3879
3880 # turn a 2d arc of a circle into a 2d NURBS 
3881 circle c 0 0 5 
3882 trim c c 0 pi/3 
3883 convert c1 c 
3884
3885 # an easy way to make a planar bspline surface 
3886 plane p 
3887 trim p p -1 1 -1 1 
3888 convert p1 p 
3889
3890 <h4>NOTE</h4>
3891 *Offset curves and surfaces are not treated by this command.* 
3892
3893
3894
3895 @subsection occt_2142243456_110140485264  Curve and surface modifications
3896
3897 Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines. 
3898
3899 General modifications: 
3900
3901   * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**
3902
3903 Modifications for both bezier curves and bsplines: 
3904
3905   * Exchanging U and V on a surface: **exchuv**
3906   * Segmentation: **segment**, **segsur**
3907   * Increasing the degree: **incdeg**, **incudeg**, **incvdeg**
3908   * Moving poles: **cmovep**, **movep**, **movecolp**, **moverowp**
3909
3910 Modifications for bezier curves: 
3911
3912   * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**
3913
3914 Modifications for bspline: 
3915
3916   * Inserting and removing knots: **insertknot**, **remknot**, **insertuknot**, **remuknot**, **insetvknot**, **remvknot**
3917   * Modifying periodic curves and surfaces: **setperiodic**, **setnotperiodic**, **setorigin**, **setuperiodic**, **setunotperiodic**, **setuorigin**, **setvperiodic**, **setvnotperiodic**, **setvorigin**
3918
3919
3920
3921
3922
3923 @subsubsection occt_2142243456_1101404852641  reverse, ureverse, vreverse
3924
3925
3926 Syntax:            reverse curvename 
3927 ureverse surfacename 
3928 vreverse surfacename 
3929
3930 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. 
3931
3932 **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. 
3933
3934 Reversing a parameter on an analytical surface may create an indirect coordinate system. 
3935 **Example:** 
3936
3937 # reverse a trimmed 2d circle 
3938 circle c 0 0 5 
3939 trim c c pi/4 pi/2 
3940 reverse c 
3941
3942 # dumping c will show that it is now trimmed between 
3943 # 3*pi/2 and 7*pi/4 i.e. 2*pi-pi/2 and 2*pi-pi/4 
3944
3945
3946 @subsubsection occt_2142243456_1101404852642  exchuv
3947
3948 Syntax:                  exchuv surfacename 
3949
3950 For a bezier or bspline surface this command exchanges the u and v parameters. 
3951 **Example:** 
3952
3953 # exchanging u and v on a spline (made from a cylinder) 
3954 cylinder c 5 
3955 trimv c c 0 10 
3956 convert c1 c 
3957 exchuv c1 
3958
3959
3960 @subsubsection occt_2142243456_1101404852643  segment, segsur
3961
3962 Syntax:                  segment curve Ufirst Ulast 
3963 segsur surface Ufirst Ulast Vfirst Vlast 
3964
3965 **segment **and **segsur **segment a bezier curve and a bspline curve or surface respectively. These commands modify the curve to restrict it between the new parameters: the starting point of the modified curve, Ufirst, and the end point, Ulast. Ufirst is less than Ulast. 
3966
3967 This command must not be confused with **trim **which creates new geometry. 
3968
3969 **Example:** 
3970
3971 # segment a bezier curve in half 
3972 beziercurve c 3 0 0 0 10 0 0 10 10 0 
3973 segment c ufirst ulast 
3974
3975
3976 @subsubsection occt_2142243456_1101404852644  iincudeg, incvdeg
3977
3978 Syntax:      incudeg surfacename newdegree 
3979 incvdeg surfacename newdegree 
3980
3981 **incudeg **and **incvdeg **increase the degree in the U or V parameter of a bezier or bspline surface. 
3982 **Example:** 
3983
3984 # make a planar bspline and increase the degree to 2 3 
3985 plane p 
3986 trim p p -1 1 -1 1 
3987 convert p1 p 
3988 incudeg p1 2 
3989 incvdeg p1 3 
3990
3991 <h4>NOTE</h4>
3992 *The geometry is modified.* 
3993
3994
3995 @subsubsection occt_2142243456_1101404852645  cmovep, movep, movecolp, moverowp
3996
3997 Syntax:      cmovep curve index dx dy [dz] 
3998 movep surface uindex vindex dx dy dz 
3999 movecolp surface uindex dx dy dz 
4000 moverowp surface vindex dx dy dz 
4001
4002 **move **methods translate poles of a bezier curve, a bspline curve or a bspline surface. **cmovep **and **movep **translate one pole with a given index. 
4003
4004 **movecolp **and **moverowp **translate a whole column (expressed by the uindex) or row (expressed by the vindex) of poles. 
4005 **Example:** 
4006
4007 # start with a plane 
4008 # transform to bspline, raise degree and add relief 
4009 plane p 
4010 trim p p -10 10 -10 10 
4011 convert p1 p 
4012 incud p1 2 
4013 incvd p1 2 
4014 movecolp p1 2 0 0 5 
4015 moverowp p1 2 0 0 5 
4016 movep p1 2 2 0 0 5 
4017
4018
4019 @subsubsection occt_2142243456_1101404852646  insertpole, rempole, remcolpole, remrowpole
4020
4021 Syntax:                  insertpole curvename index x y [z] [weight] 
4022 rempole curvename index 
4023 remcolpole surfacename index 
4024 remrowpole surfacename index 
4025
4026 **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. 
4027
4028 **rempole **removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves. 
4029
4030 **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. 
4031 **Example:** 
4032
4033 # start with a segment, insert a pole at end 
4034 # then remove the central pole 
4035 beziercurve c 2 0 0 0 10 0 0 
4036 insertpole c 2 10 10 0 
4037 rempole c 2 
4038
4039
4040 @subsubsection occt_2142243456_1101404852647  insertknot, insertuknot, insertvknot
4041
4042 Syntax:                  insertknot name knot [mult = 1] [knot mult ...] 
4043 insertuknot surfacename knot mult 
4044 insertvknot surfacename knot mult 
4045
4046 **insertknot **inserts knots in the knot sequence of a bspline curve. You must give a knot value and a target multiplicity. The default multiplicity is 1. If there is already a knot with the given value and a multiplicity lower than the target one, its multiplicity will be raised. **insertuknot **and **insertvknot **insert knots in a surface. 
4047
4048
4049
4050
4051 **Example:** 
4052
4053 # create a cylindrical surface and insert a knot 
4054 cylinder c 10 
4055 trim c c 0 pi/2 0 10 
4056 convert c1 c 
4057 insertuknot c1 pi/4 1 
4058
4059 @subsubsection occt_2142243456_1101404852648  remknot, remuknot, remvknot
4060
4061 Syntax:      remknot index [mult] [tol] 
4062 remuknot index [mult] [tol] 
4063 remvknot index [mult] [tol] 
4064
4065 **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. 
4066
4067 By default, if no tolerance is given, the knot will always be removed. 
4068 **Example:** 
4069
4070 # bspline circle, remove a knot 
4071 circle c 0 0 5 
4072 convert c1 c 
4073 incd c1 5 
4074 remknot c1 2 
4075
4076 *NOTE* 
4077 *Curves or Surfaces may be modified.* 
4078
4079
4080 @subsubsection occt_2142243456_1101404852649  setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
4081
4082 Syntax:      setperiodic curve 
4083 setnotperiodic curve 
4084 setuperiodic surface 
4085 setunotperiodic surface 
4086 setvperiodic surface 
4087 setvnotperiodic surface 
4088
4089 **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. 
4090
4091 **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. 
4092 **Example:** 
4093
4094 # a circle deperiodicized 
4095 circle c 0 0 5 
4096 convert c1 c 
4097 setnotperiodic c1 
4098 @subsubsection occt_2142243456_11014048526410  setorigin, setuorigin, setvorigin
4099
4100 Syntax:      setorigin curvename index 
4101 setuorigin surfacename index 
4102 setuorigin surfacename index 
4103
4104 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. 
4105 **Example:** 
4106
4107 # a torus with new U and V origins 
4108 torus t 20 5 
4109 convert t1 t 
4110 setuorigin t1 2 
4111 setvorigin t1 2 
4112
4113
4114 @subsection occt_2142243456_110140485265  Transformations
4115
4116 Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling. 
4117
4118 @subsubsection occt_2142243456_1101404852651  translate, dtranslate
4119
4120 Syntax:                  translate name [names ...] dx dy dz 
4121 2dtranslate name [names ...] dx dy 
4122
4123 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. 
4124
4125 For 2d points or curves, use the **2dtranslate **command. 
4126 **Example:** 
4127
4128 # 3d tranlation 
4129 point p 10 20 30 
4130 circle c 10 20 30 5 
4131 torus t 10 20 30 5 2 
4132 translate p c t 0 0 15 
4133 *NOTE* 
4134 *Objects are modified by this command.* 
4135
4136 @subsubsection occt_2142243456_1101404852652  rotate, drotate
4137
4138 Syntax:      rotate name [name ...] x y z dx dy dz angle 
4139 2drotate name [name ...] x y angle 
4140 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. 
4141
4142 For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative. 
4143 **Example:** 
4144
4145 # make a helix of circles. create a scripte file with 
4146 this code and execute it using **source**. 
4147 circle c0 10 0 0 3 
4148 for {set i 1} {$i = 10} {incr i} { 
4149 copy c[expr $i-1] c$i 
4150 translate c$i 0 0 3 
4151 rotate c$i 0 0 0 0 0 1 36 
4152
4153
4154 @subsubsection occt_2142243456_1101404852653  pmirror, lmirror, smirror, dpmirror, dlmirror
4155
4156 Syntax:      pmirror name [names ...] x y z 
4157 lmirror name [names ...] x y z dx dy dz 
4158 smirror name [names ...] x y z dx dy dz 
4159 2dpmirror name [names ...] x y 
4160 2dlmirror name [names ...] x y dx dy 
4161
4162 The mirror commands perform a mirror transformation of 2d or 3d geometry. 
4163
4164 **pmirror **is the point mirror, mirroring 3d curves and surfaces about a point of symmetry. **lmirror **is the line mirror commamd, mirroring 3d curves and surfaces about an axis of symmetry. **smirror **is the surface mirror, mirroring 3d curves and surfaces about a plane of symmetry. In the last case, the plane of symmetry is perpendicular to dx,dy,dz. 
4165
4166 In 2d, only **2dpmirror**, point symmetry mirroring, and **2dlmirror**, axis symmetry mirroring, are available. 
4167 **Example:** 
4168
4169 # build 3 images of a torus 
4170 torus t 10 10 10 1 2 3 5 1 
4171 copy t t1 
4172 pmirror t1 0 0 0 
4173 copy t t2 
4174 lmirror t2 0 0 0 1 0 0 
4175 copy t t3 
4176 smirror t3 0 0 0 1 0 0 
4177
4178 @subsubsection occt_2142243456_1101404852654  pscale, dpscale
4179
4180 Syntax:                  pscale name [name ...] x y z s 
4181 2dpscale name [name ...] x y s 
4182 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**. 
4183 **Example:** 
4184
4185 # double the size of a sphere 
4186 sphere s 0 0 0 10 
4187 pscale s 0 0 0 2 
4188
4189 @subsection occt_2142243456_110140485266  Curve and surface analysis
4190
4191 **Draw **provides methods to compute information about curves and surfaces: 
4192
4193   * **coord **to find the coordinates of a point.
4194   * **cvalue **and **2dcvalue **to compute points and derivatives on curves.
4195   * **svalue **to compute points and derivatives on a surface.
4196   * **localprop **and **minmaxcurandif **to compute the curvature on a curve.
4197   * **parameters **to compute (u,v) values for a point on a surface.
4198   * **proj **and **2dproj **to project a point on a curve or a surface.
4199   * **surface_radius **to compute the curvature on a surface.
4200
4201 @subsubsection occt_2142243456_1101404852661  coord
4202
4203 Syntax:            coord P x y [z] 
4204
4205 The **coord **command will set the coordinates of the point P. x, y (and optionally z) 
4206 **Example:** 
4207
4208 # translate a point 
4209 point p 10 5 5 
4210 translate p 5 0 0 
4211 coord p x y z 
4212 # x value is 15 
4213 See also: **point** 
4214 @subsubsection occt_2142243456_1101404852662   cvalue, dcvalue
4215
4216 Syntax:      cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]] 
4217 2dcvalue curve U x y [d1x d1y [d2x d2y]] 
4218
4219 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. 
4220 **Example:**
4221
4222 # on a bezier curve at parameter 0 
4223 # the point is the first pole 
4224 # the derivative is the vector first to second pole 
4225 # multiplied by the degree 
4226 # the second derivative is the difference 
4227 # first to second pole, second to third pole 
4228 # multipied by degree  * degree-1 
4229 2dbeziercurve c 4 0 0 1 1 2 1 3 0 
4230 2dcvalue c 0 x y d1x d1y d2x d2y 
4231
4232 # values of x y d1x d1y d2x d2y 
4233 # are 0 0 3 3 0 -6 
4234
4235
4236 @subsubsection occt_2142243456_1101404852663  svalue
4237
4238 Syntax: svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]] 
4239
4240 **svalue **computes points and derivatives on a surface for a pair of parameter values. The result depends on the number of arguments. You can compute first and second derivatives. 
4241 **Example:** 
4242
4243 # display points on a sphere 
4244 sphere s 10 
4245 for {dset t 0} {[dval t] = 1} {dset t t+0.01} { 
4246 svalue s t*2*pi t*pi-pi/2 x y z 
4247 point . x y z 
4248
4249
4250
4251 @subsubsection occt_2142243456_1101404852664  localprop, minmaxcurandinf
4252
4253 Syntax:      localprop curvename U 
4254 minmaxcurandinf curve 
4255
4256 The **localprop **command computes the curvature of a curve. 
4257 **minmaxcurandinf **computes and prints the parameters of the points where the curvature is minimum and maximum on a 2d curve. 
4258 **Example:** 
4259
4260 # show curvature at the center of a bezier curve 
4261 beziercurve c 3 0 0 0 10 2 0 20 0 0 
4262 localprop c 0.5 
4263 == Curvature : 0.02 
4264
4265 See also: **surface_radius** 
4266
4267
4268 @subsubsection occt_2142243456_1101404852665  parameters
4269
4270 Syntax:      parameters surf/curve x y z U [V] 
4271
4272 The **parameters **command 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. 
4273 **Example:** 
4274
4275 # Compute parameters on a plane 
4276 plane p 0 0 10 1 1 0 
4277 parameters p 5 5 5 u v 
4278 # the values of u and v are : 0 5 
4279
4280
4281 @subsubsection occt_2142243456_1101404852666  proj, dproj
4282
4283 Syntax:      proj name x y z 
4284 2dproj name xy 
4285
4286 Use **proj **to project a point on a 3d curve or a surface and **2dproj **for a 2d curve. 
4287
4288 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, ... 
4289 **Example:** 
4290
4291 # project point on a torus 
4292 torus t 20 5 
4293 proj t 30 10 7 
4294 == ext_1 ext_2 ext_3 ext_4 
4295
4296
4297 @subsubsection occt_2142243456_1101404852667  surface_radius
4298
4299 Syntax:      surface_radius surface u v [c1 c2] 
4300
4301 The **surface_radius **command 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. 
4302 **Example:** 
4303
4304 # computes curvatures of a cylinder 
4305 cylinder c 5 
4306 surface_radius c pi 3 c1 c2 
4307 == Min Radius of Curvature : -5 
4308 == Min Radius of Curvature : infinite 
4309
4310
4311
4312 @subsection occt_2142243456_110140485267  Intersections
4313
4314 The **intersect **command computes intersections of surfaces; the **2dintersect **command, intersections of 2d curves. 
4315
4316
4317 @subsubsection occt_2142243456_1101404852671  intersect
4318
4319 Syntax:      intersect name surface1 surface2 
4320
4321 The **intersect **command 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;, ... 
4322 **Example:** 
4323
4324 # create an ellipse 
4325 cone c 45 0 
4326 plane p 0 0 40 0 1 5 
4327 intersect e c p 
4328
4329
4330 @subsubsection occt_2142243456_1101404852672  dintersect
4331
4332 Syntax:      2dintersect curve1 curve2 
4333
4334 **2dintersect **displays the intersection points between two 2d curves. 
4335 **Example:** 
4336
4337 # intersect two 2d ellipses 
4338 ellipse e1 0 0 5 2 
4339 ellipse e2 0 0 0 1 5 2 
4340 2dintersect e1 e2 
4341 @subsection occt_2142243456_110140485268  Approximations
4342
4343 Draw provides command to create curves and surfaces by approximation. 
4344
4345 **2dapprox **fits a curve through 2d points, **appro **fits a curve through 3d points, **surfapp **and **grilapp **fits a surface through 3d points, **2dinterpolate **may be used to interpolate a curve. 
4346
4347 @subsubsection occt_2142243456_1101404852681   appro, dapprox
4348
4349 Syntax:      appro result nbpoint [curve] 
4350 2dapprox result nbpoint [curve / x1 y1 x2 y2] 
4351
4352 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. 
4353 **Example:** 
4354
4355 # pick points and they will be fitted 
4356 2dapprox c 10 
4357
4358
4359 @subsubsection occt_2142243456_1101404852682  surfapp, grilapp
4360
4361
4362 Syntax: surfapp name nbupoints nbvpoints x y z .... 
4363 grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ... 
4364
4365 **surfapp **fits a surface through an array of u and v points, nbupoints*nbvpoints. 
4366
4367 **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. 
4368 **Example:** 
4369
4370 # a surface using the same data as in the beziersurf 
4371 example sect 4.4 
4372 surfapp s 3 4 \ 
4373 0 0 0 10 0 5 20 0 0 \ 
4374 0 10 2 10 10 3 20 10 2 \ 
4375 0 20 10 10 20 20 20 20 10 \ 
4376 0 30 0 10 30 0 20 30 0 
4377
4378
4379
4380
4381
4382 @subsection occt_2142243456_110140485269  Constraints
4383
4384 The **cirtang **command is used to construct 2d circles tangent to curves and **lintan **to construct 2d lines tangent to curves. 
4385
4386
4387 @subsubsection occt_2142243456_1101404852691  cirtang
4388
4389 Syntax: cirtang cname curve/point/radius curve/point/radius curve/point/radius 
4390
4391 The **cirtang **command will build 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. 
4392 **Example:** 
4393
4394 # a point, a line and a radius. 2 solutions 
4395 point p 0 0 
4396 line 1 10 0 -1 1 
4397 cirtang c p 1 4 
4398 == c_1 c_2 
4399
4400
4401 @subsubsection occt_2142243456_1101404852692  lintan
4402
4403 Syntax:      lintan name curve curve [angle] 
4404
4405 The **lintan **command will build all 2d lines tangent to two curves. If a 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. 
4406 **Example:** 
4407
4408 # lines tangent to 2 circles, 4 solutions 
4409 circle c1 -10 0 10 
4410 circle c2 10 0 5 
4411 lintan l c1 c2 
4412
4413 # lines at 15 degrees tangent to a circle and a line, 2 
4414 solutions: l1_1 l1_2 
4415 circle c1 -10 0 1 
4416 line l 2 0 1 1 
4417 lintan l1 c1 l 15 
4418
4419
4420
4421
4422 @subsection occt_2142243456_1101404852610  Display
4423
4424 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. 
4425
4426 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. 
4427
4428 On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso **commands. 
4429
4430 On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles **and **shpoles **commands. 
4431
4432 On bspline curves and surfaces you can toggle the display of the knots with the **shknots **and **clknots **commands. 
4433
4434
4435 @subsubsection occt_2142243456_11014048526101  dmod, discr, defle
4436
4437 Syntax:      dmode name [name ...] u/d 
4438 discr name [name ...] nbintervals 
4439 defle name [name ...] deflection 
4440
4441 **dmode **allows you to choose the display mode for a curve or a surface. 
4442
4443 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. 
4444
4445 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). 
4446
4447 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. 
4448 **Example:** 
4449
4450 # increment the number of points on a big circle 
4451 circle c 0 0 50 50 
4452 discr 100 
4453
4454 # change the mode 
4455 dmode c u 
4456
4457
4458 @subsubsection occt_2142243456_11014048526102   nbiso
4459
4460 Syntax:      nbiso name [names...] nuiso nviso 
4461
4462 **nbiso **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. 
4463 **Example:** 
4464
4465 # display 35 meridians and 15 parallels on a spere 
4466 sphere s 20 
4467 nbiso s 35 15 
4468
4469
4470 @subsubsection occt_2142243456_11014048526103  clpoles, shpoles
4471
4472 Syntax:      clpoles name 
4473 shpoles name 
4474
4475 On bezier and bspline curves and surfaces, the control polygon is displayed by default: **clpoles **erases it and **shpoles **restores it. 
4476 **Example:** 
4477
4478 # make a bezier curve and erase the poles 
4479 beziercurve c 3 0 0 0 10 0 0 10 10 0 
4480 clpoles c 
4481
4482
4483 @subsubsection occt_2142243456_11014048526104  clknots, shknots
4484
4485 Syntax:   clknots name 
4486 shknots name 
4487
4488 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. 
4489 **Example:** 
4490
4491 # hide the knots on a bspline curve 
4492 bsplinecurve bc 2 3 0 3 1 1 2 3 \ 
4493 10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1 
4494 clknots bc 
4495 @section occt_2142243456_1869436669 Topology commands
4496
4497
4498
4499
4500
4501
4502
4503 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. 
4504
4505 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. 
4506
4507 The different topological shapes<a href="#_ftn3">[3]</a> include: 
4508
4509   * COMPOUND: A group of any type of topological object.
4510   * COMPSOLID: A set of solids connected by their faces. This expands the notions of WIRE and SHELL to solids.
4511   * SOLID: A part of space limited by shells. It is three dimensional.
4512   * SHELL: A set of faces connected by their edges. A shell can be open or closed.
4513   * FACE: In 2d, a plane; in 3d, part of a surface. Its geometry is constrained (trimmed) by contours. It is two dimensional.
4514   * WIRE: A set of edges connected by their vertices. It can be open or closed depending on whether the edges are linked or not.
4515   * EDGE: A topological element corresponding to a restrained curve. An edge is generally limited by vertices. It has one dimension.
4516   * VERTEX: A topological element corresponding to a point. It has a zero dimension.
4517
4518 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**). 
4519
4520 The following topics are covered in the eight sections of this chapter: 
4521
4522   * Basic shape commands to handle the structure of shapes and control the display.
4523   * Curve and surface topology, or methods to create topology from geometry and vice versa.
4524   * Primitive construction commands: box, cylinder, wedge etc.
4525   * Sweeping of shapes.
4526   * Transformations of shapes: translation, copy, etc.
4527   * Topological operations, or booleans.
4528   * Drafting and blending.
4529   * Analysis of shapes.
4530
4531
4532
4533 @subsection occt_2142243456_186943666971  Basic topology
4534
4535 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: 
4536
4537   * **isos **and **discretisation **to control display of shape faces by isoparametric curves .
4538   * **orientation**, **complement **and **invert **to modify topological attributes such as orientation.
4539   * **explode**, **exwire **and **nbshapes **to analyze the structure of a shape.
4540   * **emptycopy**, **add**, **compound **to create shapes by stepwise construction.
4541
4542 In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges: 
4543
4544   * a red edge is an isolated edge, which belongs to no faces.
4545   * a green edge is a free boundary edge, which belongs to one face,
4546   * a yellow edge is a shared edge, which belongs to at least two faces.
4547
4548
4549 @subsubsection occt_2142243456_1869436669711  isos, discretisation
4550
4551 Syntax:                  isos [name ...][nbisos] 
4552 discretisation nbpoints 
4553 **isos **determines or changes the number of isoparametric curves on shapes. 
4554
4555 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. 
4556
4557 **discretisation **changes the default number of points used to display the curves. The default value is 30. 
4558 **Example:** 
4559
4560 # Display only the edges (the wireframe) 
4561 isos 0 
4562
4563 <h4>NOTE</h4>
4564 Don’t confuse *isos* and *discretisation* with the geometric 
4565 *commands *nbisos* and *discr*.* 
4566
4567
4568 @subsubsection occt_2142243456_1869436669712  orientation, complement, invert, normals, range
4569
4570 Syntax:      orientation name [name ...] F/R/E/I 
4571 complement name [name ...] 
4572 invert name 
4573 normals s (length = 10), disp normals 
4574 range name value value 
4575
4576 **orientation **assigns the orientation of shapes - simple and complex - to one of the following four values: FORWARD, REVERSED, INTERNAL, EXTERNAL. 
4577
4578 **complement **changes the current orientation of shapes to its complement, FORWARD - REVERSED, INTERNAL - EXTERNAL. 
4579
4580 **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. 
4581
4582 **normals **returns the assignment of colors to orientation values. 
4583
4584 **range **defines the length of a selected edge by defining the values of a starting point and an end point. 
4585 **Example:** 
4586
4587 # invert normals of a box 
4588 box b 10 20 30 
4589 normals b 5 
4590 invert b 
4591 normals b 5 
4592
4593 # to assign a value to an edge 
4594 box b1 10 20 30 
4595 # to define the box as edges 
4596 explode b1 e 
4597 b_1 b_2 b_3 b_4 b_5 b_6 b_7 b_8 b_9 b_10 b_11 b_12 
4598 # to define as an edge 
4599 makedge e 1 
4600 # to define the length of the edge as starting from 0 
4601 and finishing at 1 
4602 range e 0 1 
4603
4604
4605 @subsubsection occt_2142243456_1869436669713  explode, exwire, nbshapes
4606
4607 Syntax:      explode name [C/So/Sh/F/W/E/V] 
4608 exwire name 
4609 nbshapes name 
4610
4611 **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. 
4612
4613 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. 
4614
4615 **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. 
4616
4617 **nbshapes **counts the number of shapes of each type in an entity. 
4618 **Example:** 
4619
4620 # on a box 
4621 box b 10 20 30 
4622
4623 # whatis returns the type and various information 
4624 whatis b 
4625 = b is a shape SOLID FORWARD Free Modified 
4626
4627 # make one shell 
4628 explode b 
4629 whatis b_1 
4630 = b_1 is a shape SHELL FORWARD Modified Orientable 
4631 Closed 
4632
4633 # extract the edges b_1, ... , b_12 
4634 explode b e 
4635 ==b_1 ... b_12 
4636
4637 # count subshapes 
4638 nbshapes b 
4639 == 
4640 Number of shapes in b 
4641 VERTEX : 8 
4642 EDGE : 12 
4643 WIRE : 6 
4644 FACE : 6 
4645 SHELL : 1 
4646 SOLID : 1 
4647 COMPSOLID : 0 
4648 COMPOUND : 0 
4649 SHAPE : 34 
4650
4651
4652 @subsubsection occt_2142243456_1869436669714  emptycopy, add, compound
4653
4654 Syntax:                  emptycopy [newname] name 
4655 add name toname 
4656 compound [name ...] compoundname 
4657
4658 **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. 
4659
4660 **add **inserts shape C into shape S. Verify that C and S reference compatible types of objects: 
4661
4662   * Any *Shape *can be added to a *Compound*.
4663   * Only a *Solid *can be added to a *CompSolid*.
4664   * Only a *Shell*, an *Edge *or a *Vertex *can be added into a *Solid*.
4665   * Only a *Face *can be added to a *Shell*.
4666   * Only a *Wire *and *Vertex *can be added in a *Solid*.
4667   * Only an *Edge *can be added to a *Wire*.
4668   * Only a *Vertex *can be added to an *Edge*.
4669   * Nothing can be added to a *Vertex*.
4670
4671 Care should be taken using **emptycopy **and **add**. 
4672
4673 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. 
4674 **Example:** 
4675
4676 # a compound with three boxes 
4677 box b1 0 0 0 1 1 1 
4678 box b2 3 0 0 1 1 1 
4679 box b3 6 0 0 1 1 1 
4680 compound b1 b2 b3 c 
4681
4682
4683 @subsubsection occt_2142243456_1869436669715  checkshape
4684
4685 Syntax:                  checkshape [-top] shape [result] [-short] 
4686
4687 Where: 
4688 *-top* – check only topological validity of a shape. 
4689 *shape *– the only required parameter which represents the name of the shape to check. 
4690 *result* – optional parameter which is the prefix of the output shape names. 
4691 *-short* – short description of check. 
4692
4693
4694 **checkshape **examines the selected object for topological and geometric coherence. The object should be a three dimensional shape. 
4695 **Example:** 
4696
4697 # checkshape returns a comment valid or invalid 
4698 box b1 0 0 0 1 1 1 
4699 checkshape b1 
4700 # returns the comment 
4701 this shape seems to be valid 
4702
4703 <h4>NOTE</h4>
4704 *This test is performed using the tolerance set in the algorithm.* 
4705
4706
4707
4708
4709
4710 @subsection occt_2142243456_186943666972  Curve and surface topology
4711
4712 This group of commands is used to create topology from shapes and to extract shapes from geometry. 
4713
4714   * To create vertices, use the **vertex **command.
4715   * To create edges use, the **edge**, **mkedge **commands.
4716   * To create wires, use the **wire**, **polyline**, **polyvertex **commands.
4717   * To create faces, use the **mkplane**, **mkface **commands.
4718   * To extract the geometry from edges or faces, use the **mkcurve **and **mkface **commands.
4719   * To extract the 2d curves from edges or faces, use the **pcurve **command.
4720
4721
4722 @subsubsection occt_2142243456_1869436669721  vertex
4723
4724 Syntax:      vertex name [x y z / p edge] 
4725
4726 Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge. 
4727 **Example:** 
4728
4729 vertex v1 10 20 30 
4730
4731
4732 @subsubsection occt_2142243456_1869436669722  edge, mkedge, uisoedge, visoedge
4733
4734 Syntax:      edge name vertex1 vertex2 
4735 mkedge edge curve [surface] [pfirst plast] [vfirst [pfirst] vlast [plast]] 
4736 uisoedge edge face u v1 v2 
4737 visoedge edge face v u1 u2 
4738
4739 **edge **creates a straight line edge between two vertices. 
4740
4741 **mkedge **generates edges from curves<a href="#_ftn4">[4]</a>.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 you to block 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. 
4742 **Example:** 
4743
4744 # straight line edge 
4745 vertex v1 10 0 0 
4746 vertex v2 10 10 0 
4747 edge e1 v1 v2 
4748
4749 # make a circular edge 
4750 circle c 0 0 0 5 
4751 mkedge e2 c 0 pi/2 
4752
4753 # A similar result may be achieved by trimming the curve 
4754 # The trimming is removed by mkedge 
4755 trim c c 0 pi/2 
4756 mkedge e2 c 
4757
4758 **visoedge **and **uisoedge **are commands that generate a uiso parameter edge 
4759 or a viso parameter edge. 
4760
4761 **Example:** 
4762
4763 # to create an edge between v1 and v2 at point u 
4764 # to create the example plane 
4765 plane p 
4766 trim p p 0 1 0 1 
4767 convert p p 
4768 incudeg p 3 
4769 incvdeg p 3 
4770 movep p 2 2 0 0 1 
4771 movep p 3 3 0 0 0.5 
4772 mkface p p 
4773 # to create the edge in the plane at the u axis point 
4774 0.5, and between the v axis points v=0.2 and v =0.8 
4775 uisoedge e p 0.5 0.20 0.8 
4776
4777
4778 @subsubsection occt_2142243456_1869436669723  wire, polyline, polyvertex
4779
4780 Syntax:      wire wirename e1/w1 [e2/w2 ...] 
4781 polyline name x1 y1 z1 x2 y2 z2 ... 
4782 polyvertex name v1 v2 ... 
4783
4784 **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. 
4785
4786 **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. 
4787
4788 **polyvertex **creates a polygonal wire from vertices. 
4789 **Example:** 
4790
4791 # create two polygonal wires 
4792 # glue them and define as a single wire 
4793 polyline w1 0 0 0 10 0 0 10 10 0 
4794 polyline w2 10 10 0 0 10 0 0 0 0 
4795 wire w w1 w2 
4796
4797
4798 @subsubsection occt_2142243456_1869436669724  profile
4799
4800 Syntax       profile name [code values] [code values] ... 
4801
4802 **Code**                                 **Values **            **Action** 
4803 O                                      X Y Z                Sets the origin of the plane 
4804 P                           DX DY DZ UX UY UZ    Sets the normal and X of the plane 
4805 F                                       X Y                   Sets the first point 
4806 X                                       DX                   Translates a point along X 
4807 Y                                       DY                   Translates a point along Y 
4808 L                                       DL                    Translates a point along direction 
4809 XX                                    X                      Sets point X coordinate 
4810 YY                                    Y                      Sets point Y coordinate 
4811 T                                       DX DY              Translates a point 
4812 TT                                     X Y                   Sets a point 
4813 R                                       Angle                Rotates direction 
4814 RR                                    Angle                Sets direction 
4815 D                                      DX DY              Sets direction 
4816 IX                                      X                      Intersects with vertical 
4817 IY                                      Y                      Intersects with horizontal 
4818 C                                 Radius Angle          Arc of circle tangent to direction 
4819
4820 <h5>Suffix</h5>
4821 No suffix               Makes a closed face 
4822 W                          Make a closed wire 
4823 WW                       Make an open wire 
4824
4825
4826 **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. 
4827
4828 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. 
4829
4830 The point [code values] can be repeated any number of times and in any order to create the profile contour. 
4831
4832 The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire. 
4833
4834 Code letters are not case-sensitive. 
4835 **Example:** 
4836
4837 # to create a trianglular plane using a vertex at the 
4838 origin, in the xy plane 
4839 profile p O 0 0 0 X 1 Y 0 x 1 y 1 
4840 **Example:** 
4841
4842 # to create a contour using the different code 
4843 possibilities 
4844
4845 # two vertices in the xy plane 
4846 profile p F 1 0 x 2 y 1 ww 
4847
4848 # to view from a point normal to the plane 
4849 top 
4850
4851 # add a circular element of 45 degrees 
4852 profile p F 1 0 x 2 y 1 c 1 45 ww 
4853
4854 # add a tangential segment with a length value 1 
4855 profile p F 1 0 x 2 y 1 c 1 45 l 1 ww 
4856
4857 # add a vertex with xy values of 1.5 and 1.5 
4858 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 ww 
4859
4860 # add a vertex with the x value 0.2, y value is constant 
4861 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 xx 0.2 ww 
4862
4863 # add a vertex with the y value 2 x value is constant 
4864 profile p F 1 0 x 2 y 1 c 1 45 l 1 tt 1.5 1.5 yy 2 ww 
4865
4866 # add a circular element with a radius value of 1 and a circular value of 290 degrees 
4867 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 
4868
4869 # wire continues at a tangent to the intersection x = 0 
4870 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 
4871
4872 # continue the wire at an angle of 90 degrees until it intersects the y axis at y= -o.3 
4873 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 
4874
4875 #close the wire 
4876 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 
4877
4878 # to create the plane with the same contour 
4879 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 
4880
4881
4882 @subsubsection occt_2142243456_1869436669725   bsplineprof
4883
4884 Syntax:      bsplineprof name [S face] [W WW] 
4885
4886 for an edge : digitizes ... mouse button 2 
4887 to end profile : mouse button 3 
4888
4889 Build a profile in the XY plane from digitizes 
4890 By default the profile is closed and a face is built. 
4891
4892 W              Make a closed wire 
4893 WW           Make an open wires 
4894
4895 **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. 
4896
4897 The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire. 
4898 **Example:** 
4899
4900 #to view the xy plane 
4901 top 
4902 #to create a 2d curve with the mouse 
4903 bsplineprof res 
4904 # click mb1 to start the curve 
4905 # click mb1 to create the second vertex 
4906 # click mb1 to create a curve 
4907 == 
4908 #click mb2 to finish the curve and start a new curve 
4909 == 
4910 # click mb1 to create the second curve 
4911 # click mb3 to create the face 
4912
4913
4914 @subsubsection occt_2142243456_1869436669726  mkoffset
4915
4916 Syntax:      mkoffset result face/compound of wires nboffset stepoffset 
4917
4918 **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. 
4919
4920 The offset distance defines the spacing and the positionning of the occurences. 
4921 **Example:** 
4922
4923 #Create a box and select a face 
4924 box b 1 2 3 
4925 explode b f 
4926 #Create three exterior parallel contours with an offset 
4927 value of 2 
4928 mkoffset r b_1 3 2 
4929 Create one interior parallel contour with an offset 
4930 value of 
4931 0.4 
4932 mkoffset r b_1 1 -0.4 
4933
4934 NOTE 
4935 *The mkoffset command must be used with prudence, 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* 
4936 **Example:** 
4937
4938 # to create the example contour 
4939 profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w 
4940 # to create an incoherent interior offset 
4941 mkoffset r p 1 -0.50 
4942 ==p is not a FACE but a WIRE 
4943 BRepFill_TrimEdgeTool: incoherent intersection 
4944 # to create two incoherent wires 
4945 mkoffset r p 1 -0.50 
4946
4947
4948 @subsubsection occt_2142243456_1869436669727  mkplane, mkface
4949
4950 Syntax:      mkplane name wire 
4951 mkface name surface [ufirst ulast vfirst vlast] 
4952
4953 **mkplane **generates a face from a planar wire. The planar surface will be constructed with an orientation which keeps the face inside the wire. 
4954
4955 **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. 
4956 **Example:** 
4957
4958 # make a polygonal face 
4959 polyline f 0 0 0 20 0 0 20 10 0 10 10 0 10 20 0 0 20 0 0 0 0 
4960 mkplane f f 
4961
4962 # make a cylindrical face 
4963 cylinder g 10 
4964 trim g g -pi/3 pi/2 0 15 
4965 mkface g g 
4966
4967
4968 @subsubsection occt_2142243456_1869436669728  mkcurve, mksurface
4969
4970 Syntax:      mkcurve curve edge 
4971 mksurface name face 
4972
4973 **mkcurve **creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries. 
4974
4975 **mksurface **creates a surface from a face. The surface will not be trimmed. 
4976 **Example:** 
4977
4978 # make a line 
4979 vertex v1 0 0 0 
4980 vertex v2 10 0 0 
4981 edge e v1 v2 
4982
4983
4984 @subsubsection occt_2142243456_1869436669729  pcurve
4985
4986 Syntax:      pcurve [name edgename] facename 
4987
4988 **pcurve **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 counterclockwise. To make curves visible, use a fitted 2d view. 
4989 **Example:** 
4990
4991 # view the pcurves of a face 
4992 plane p 
4993 trim p p -1 1 -1 1 
4994 mkface p p 
4995 av2d; # a 2d view 
4996 pcurve p 
4997 2dfit 
4998
4999
5000 @subsubsection occt_2142243456_18694366697210  chfid
5001
5002 Syntax:      chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) .... 
5003
5004 chfi2d creates chamfers and fillets on 2D objects. Select t:wo adjacent edges and: 
5005
5006   * a radius value
5007   * two respective distance values
5008   * a distance value and an angle
5009
5010 The radius value produces a fillet between the two faces. 
5011
5012 The distance is the length value from the edge between the two selected faces in a normal direction. 
5013
5014 **Example:** 
5015
5016 # to create a 2d fillet 
5017 top 
5018 profile p x 2 y 2 x -2 
5019 chfi2d cfr p . . F 0.3 
5020 ==Pick an object 
5021 #select an edge 
5022 ==Pick an object 
5023 #select an edge 
5024 **Example:** 
5025
5026 # to create a 2d chamfer using two distances 
5027 profile p x 2 y 2 x -2 
5028 chfi2d cfr p . . CDD 0.3 0.6 
5029 ==Pick an object 
5030 #select an edge 
5031 ==Pick an object 
5032 #select an edge 
5033 **Example:** 
5034
5035 # to create a 2d chamfer using a defined distance and 
5036 angle 
5037 top 
5038 profile p x 2 y 2 x -2 
5039 chfi2d cfr p . . CDA 0.3 75 
5040 ==Pick an object 
5041 #select an edge 
5042 ==Pick an object 
5043 #select an edge 
5044
5045
5046 @subsubsection occt_2142243456_18694366697211  nproject
5047
5048 Syntax:      nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol 
5049 [continuity [maxdeg [maxseg]]] 
5050
5051 **nproject **creates a shape projection which is normal to the target surface. 
5052 **Example:**
5053
5054 # create a curved surface 
5055 line l 0 0 0 1 0 0 
5056 trim l l 0 2 
5057 convert l l 
5058
5059 incdeg l 3 
5060 cmovep l 1 0 0.5 0 
5061 cmovep l 3 0 0.5 0 
5062 copy l ll 
5063 translate ll 2 -0.5 0 
5064 mkedge e1 l 
5065 mkedge e2 ll 
5066 wire w e1 e2 
5067 prism p w 0 0 3 
5068 donl p 
5069 #display in four views 
5070 mu4 
5071 fit 
5072 # create the example shape 
5073 circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4 
5074 mkedge e c 
5075 donly p e 
5076 # create the normal projection of the shape(circle) 
5077 nproject r e p 
5078
5079
5080
5081 @subsection occt_2142243456_186943666973  Primitives
5082
5083 Primitive commands make it possible to create simple shapes. They include: 
5084
5085   * **box **and **wedge **commands.
5086   * **pcylinder**, **pcone**, **psphere**, **ptorus **commands.
5087   * **halfspace **command
5088
5089
5090 @subsubsection occt_2142243456_1869436669731  box, wedge
5091
5092 Syntax:      box name [x y z] dx dy dz 
5093 wedge name dx dy dz ltx / xmin zmin xmax xmax 
5094
5095 **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. 
5096
5097 **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. 
5098
5099 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. 
5100 **Example:** 
5101
5102 # a box at the origin 
5103 box b1 10 20 30 
5104
5105 # another box 
5106 box b2 30 30 40 10 20 30 
5107
5108 # a wedge 
5109 wedge w1 10 20 30 5 
5110
5111 # a wedge with a sharp edge (5 faces) 
5112 wedge w2 10 20 30 0 
5113
5114 # a pyramid 
5115 wedge w3 20 20 20 10 10 10 10 
5116
5117
5118 @subsubsection occt_2142243456_1869436669732  pcylinder, pcone, psphere, ptorus
5119
5120 Syntax:      pcylinder name [plane] radius height [angle] 
5121 pcone name [plane] radius1 radius2 height [angle] 
5122 pcone name [plane] radius1 radius2 height [angle] 
5123 psphere name [plane] radius1 [angle1 angle2] [angle] 
5124 ptorus name [plane] radius1 radius2 [angle1 angle2] [angle] 
5125
5126 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 expreesed in degrees and located on the Z axis, starting from the X axis. The default angle is 360. 
5127
5128 **pcylinder **creates a cylindrical block with the given radius and height. 
5129
5130 **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. 
5131
5132 **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. 
5133
5134 **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. 
5135 **Example:** 
5136
5137 # a can shape 
5138 pcylinder cy 5 10 
5139
5140 # a quarter of a truncated cone 
5141 pcone co 15 10 10 90 
5142
5143 # three-quarters of sphere 
5144 psphere sp 10 270 
5145
5146 # half torus 
5147 ptorus to 20 5 0 90 
5148 @subsubsection occt_2142243456_1869436669733  halfspace
5149
5150 Syntax:      halfspace result face/shell x y z 
5151
5152 **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. 
5153 **Example:** 
5154
5155 box b 0 0 0 1 2 3 
5156 explode b f 
5157 ==b_1 b_2 b_3 b_4 b_5 b_6 
5158 halfspace hr b_3 0.5 0.5 0.5 
5159
5160
5161
5162 @subsection occt_2142243456_186943666974  Sweeping
5163
5164 Sweeping creates shapes by sweeping out a shape along a defined path: 
5165
5166   * **prism **sweeps along a direction.
5167   * **revol **sweeps around an axis.
5168   * **pipe **sweeps along a wire.
5169   * **mksweep **and **buildsweep **are commands to create sweeps by defining the arguments and algorithms.
5170   * **thrusections **creates a sweep from wire in different planes.
5171
5172
5173 @subsubsection occt_2142243456_1869436669741  prism
5174
5175 Syntax:      prism result base dx dy dz [Copy | Inf | SemiInf] 
5176
5177 **prism **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. 
5178
5179 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. 
5180 **Example:** 
5181
5182 # sweep a planar face to make a solid 
5183 polyline f 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 0 0 0 
5184 mkplane f f 
5185
5186
5187 @subsubsection occt_2142243456_1869436669742  revol
5188
5189 Syntax:      revol result base x y z dx dy dz angle [Copy] 
5190
5191 **revol **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. 
5192 **Example:** 
5193
5194 # shell by wire rotation 
5195 polyline w 0 0 0 10 0 0 10 5 0 5 5 0 5 15 0 0 15 0 
5196 revol s w 20 0 0 0 1 0 90 
5197
5198
5199
5200 @subsubsection occt_2142243456_1869436669743  pipe
5201
5202 Syntax:      pipe name wire_spine Profile 
5203
5204 **pipe **creates a new shape by sweeping a shape known as the profile along a wire known as the spine. 
5205 **Example:** 
5206
5207 # sweep a circle along a bezier curve to make a solid 
5208 pipe 
5209
5210 beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0 
5211 mkedge spine spine 
5212 wire spine spine 
5213 circle profile 0 0 0 1 0 0 2 
5214 mkedge profile profile 
5215 wire profile profile 
5216 mkplane profile profile 
5217 pipe p spine profile 
5218
5219
5220 @subsubsection occt_2142243456_1869436669744  mksweep, deletesweep, buildsweep, simulsweep
5221
5222 Syntax:      mksweep wire 
5223 addsweep wire[vertex][-M][-C] [auxiilaryshapedeletesweep wire 
5224 setsweep options [arg1 [arg2 [...]]] 
5225
5226 options are : 
5227
5228 -FR : Tangent and Normal are defined by a Frenet trihedron 
5229 -CF : Tangent is given by Frenet, 
5230 the Normal is computed to minimize the torsion 
5231 -DX Surf : Tangent and Normal are given by Darboux trihedron, 
5232 Surf must be a shell or a face 
5233 -CN dx dy dz : BiNormal is given by dx dy dz 
5234 -FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed 
5235 -G guide 0|1(AC 
5236 simulsweep r [n] [option] 
5237 buildsweep [r] [option] [Tol] 
5238
5239 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. 
5240
5241 **mksweep **initializes the sweep creation and defines the wire to be used as the spine. 
5242
5243 **addsweep **defines the wire to be used as the profile. 
5244
5245 **deletesweep **cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire. 
5246
5247 **setsweep **commands the algorithms used for the construction of the sweep. 
5248
5249 **simulsweep **can be used to create a preview of the shape. [n] is the number of sections that are used to simulate the sweep. 
5250
5251 **buildsweep **creates the sweep using the arguments defined by all the commands. 
5252 **Example:** 
5253
5254 #create a sweep based on a semi-circular wire using the 
5255 Frenet algorithm 
5256 #create a circular figure 
5257 circle c2 0 0 0 1 0 0 10 
5258 trim c2 c2 -pi/2 pi/2 
5259 mkedge e2 c2 
5260 donly e2 
5261 wire w e2 
5262 whatis w 
5263 mksweep w 
5264 # to display all the options for a sweep 
5265 setsweep 
5266 #to create a sweep using the Frenet algorithm where the 
5267 #normal is computed to minimise the torsion 
5268 setsweep -CF 
5269 addsweep w -R 
5270 # to simulate the sweep with a visual approximation 
5271 simulsweep w 3 
5272
5273
5274 @subsubsection occt_2142243456_1869436669745  thrusections
5275
5276 Syntax:  thrusections [-N] result issolid isruled wire1 wire2 [..wire..] 
5277
5278 **thrusections **creates a shape using wires that are positioned in different planes. Each wire selected must have the same number of edges and vertices. 
5279 A bezier curve is generated between the vertices of each wire. The option [-N] means no check is made on wires for direction. 
5280 **Example:** 
5281
5282 #create three wires in three planes 
5283 polyline w1 0 0 0 5 0 0 5 5 0 2 3 0 
5284 polyline w2 0 1 3 4 1 3 4 4 3 1 3 3 
5285 polyline w3 0 0 5 5 0 5 5 5 5 2 3 5 
5286 # create the shape 
5287 thrusections th issolid isruled w1 w2 w3 
5288 ==thrusections th issolid isruled w1 w2 w3 
5289 Tolerances obtenues   -- 3d : 0 
5290 -- 2d : 0 
5291
5292
5293
5294
5295
5296 @subsection occt_2142243456_186943666975  Topological transformation
5297
5298 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. 
5299
5300   * **tcopy **makes a copy of the structure of a shape.
5301   * **ttranslate**, **trotate**, **tmove**, **reset **move a shape.
5302   * **tmirror**, **tscale **always modify the shape.
5303
5304
5305 @subsubsection occt_2142243456_1869436669751   tcopy
5306
5307 Syntax: tcopy name toname [name toname ...] 
5308
5309 Copies the structure of one shape, including the geometry, into another, newer shape. 
5310 **Example:** 
5311
5312 # create an edge from a curve and copy it 
5313 beziercurve c 3 0 0 0 10 0 0 20 10 0 
5314 mkedge e1 c 
5315 ttranslate e1 0 5 0 
5316 tcopy e1 e2 
5317 ttranslate e2 0 5 0 
5318 # now modify the curve, only e1 and e2 will be modified 
5319
5320 @subsubsection occt_2142243456_1869436669752   tmove, treset
5321
5322 Syntax:      tmove name [name ...] shape 
5323 reset name [name ...] 
5324
5325 **tmove **and **reset **modify the location, or the local coordinate system of a shape. 
5326
5327 **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). 
5328 **Example:** 
5329
5330 # create two boxes 
5331 box b1 10 10 10 
5332 box b2 20 0 0 10 10 10 
5333 # translate the first box 
5334 ttranslate b1 0 10 0 
5335 # and apply the same location to b2 
5336 tmove b2 b1 
5337 # return to original positions 
5338 reset b1 b2 
5339
5340
5341 @subsubsection occt_2142243456_1869436669753   ttranslate, trotate
5342
5343 Syntax:      ttranslate [name ...] dx dy dz 
5344 trotate [name ...] x y z dx dy dz angle 
5345
5346 **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. 
5347 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.) 
5348
5349 Locations are very economic in the data structure because multiple occurences of an object share the topological description. 
5350 **Example:** 
5351 # make rotated copies of a sphere in between two cylinders 
5352 # create a file source toto.tcl 
5353 # toto.tcl code: 
5354 for {set i 0} {$i  360} {incr i 20} { 
5355 copy s s$i 
5356 trotate s$i 0 0 0 0 0 1 $i 
5357
5358
5359 # create two cylinders 
5360 pcylinder c1 30 5 
5361 copy c1 c2 
5362 ttranslate c2 0 0 20 
5363
5364 #create a sphere 
5365 psphere s 3 
5366 ttranslate s 25 0 12.5 
5367
5368 # call the source file for multiple copies 
5369 source toto.tcl 
5370
5371
5372 @subsubsection occt_2142243456_1869436669754   tmirror, tscale
5373
5374 Syntax:      tmirror name x y z dx dy dz 
5375 tscale name x y z scale 
5376
5377 **tmirror **makes a mirror copy of a shape about a plane x,y,z dx,dy,dz. **Tscale **applies a central homotopic mapping to a shape. 
5378 **Example:** 
5379
5380 # mirror a portion of cylinder about the YZ plane 
5381 pcylinder c1 10 10 270 
5382 copy c1 c2 
5383 tmirror c2 15 0 0 1 0 0 
5384 # and scale it 
5385 tscale c1 0 0 0 0.5 
5386
5387
5388
5389 @subsection occt_2142243456_186943666976  Old Topological operations
5390
5391
5392
5393   *  **fuse**, **cut**, **common **are boolean operations. 
5394   *  **section**, **psection **compute sections. 
5395   *  **sewing **joins two or more shapes. 
5396
5397
5398 @subsubsection occt_2142243456_1869436669761  fuse, cut, common
5399
5400 Syntax:      fuse name shape1 shape2 
5401 cut name shape1 shape2 
5402 common name shape1 shape2 
5403
5404 **fuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact. 
5405
5406 **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. 
5407
5408 **common **creates a new shape which contains only what is in common between the two original shapes in their intersection. 
5409 **Example:** 
5410
5411 # all four boolean operations on a box and a cylinder 
5412
5413 box b 0 -10 5 20 20 10 
5414 pcylinder c 5 20 
5415
5416 fuse s1 b c 
5417 ttranslate s1 40 0 0 
5418
5419 cut s2 b c 
5420 ttranslate s2 -40 0 0 
5421
5422 cut s3 c b 
5423 ttranslate s3 0 40 0 
5424
5425 common s4 b c 
5426 ttranslate s4 0 -40 0 
5427
5428
5429
5430 @subsubsection occt_2142243456_1869436669762  section, psection
5431
5432 Syntax:      section result shape1 shape2 
5433 psection name shape plane 
5434
5435 **section **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes. 
5436
5437 **psection **creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane. 
5438 **Example:** 
5439
5440 # section line between a cylinder and a box 
5441 pcylinder c 10 20 
5442 box b 0 0 5 15 15 15 
5443 trotate b 0 0 0 1 1 1 20 
5444 section s b c 
5445
5446 # planar section of a cone 
5447 pcone c 10 30 30 
5448 plane p 0 0 15 1 1 2 
5449 psection s c p 
5450
5451
5452 @subsubsection occt_2142243456_1869436669763  sewing
5453
5454 Syntax:      sewing result [tolerance] shape1 shape2 ... 
5455
5456 **Sewing **joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value. 
5457
5458 **Example:** 
5459
5460 # create two adjacent boxes 
5461 box b 0 0 0 1 2 3 
5462 box b2 0 2 0 1 2 3 
5463 sewing sr b b2 
5464 whatis sr 
5465 sr is a shape COMPOUND FORWARD Free Modified 
5466
5467
5468 @subsection occt_2142243456_186943666977  New Topological operations
5469
5470
5471 The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm. 
5472
5473
5474 @subsubsection occt_2142243456_1869436669771  bop, bopfuse, bopcut, boptuc, bopcommon,
5475
5476 **bop** defines **shape1** and **shape2** subject to ulterior Boolean operations 
5477
5478 **bopfuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact. 
5479
5480 **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. 
5481
5482 **boptuc **is a reverced** bopcut**. 
5483
5484 **bopcommon **creates a new shape which contains only whatever is in common between the two original shapes in their intersection. 
5485
5486
5487 Syntax:      bop shape1 shape2 
5488 bopcommon result 
5489 bopfuse result 
5490 bopcut result 
5491 boptuc result 
5492
5493 These commands have short variants: 
5494
5495 bcommon result shape1 shape2 
5496 bfuse result shape1 shape2 
5497 bcut result shape1 shape2 
5498
5499
5500 **bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**. 
5501 **bopcommon, bopfuse, bopcut, boptuc **commands used after **bop** command. After one **bop** command it is possible to call several commands from the list above. For example: **bop** S1 S2; **bopfuse** R. 
5502
5503 **Example:** 
5504
5505 # all four boolean operations on a box and a cylinder 
5506
5507 box b 0 -10 5 20 20 10 
5508 pcylinder c 5 20 
5509
5510 # fills data structure 
5511 bop b c 
5512
5513 bopfuse s1 
5514 ttranslate s1 40 0 0 
5515
5516 bopcut s2 
5517 ttranslate s2 -40 0 0 
5518
5519 boptuc s3 
5520 ttranslate s3 0 40 0 
5521
5522 bopcommon s4 
5523 ttranslate s4 0 -40 0 
5524
5525
5526 Short variants of commands: 
5527
5528 bfuse s11 b c 
5529 ttranslate s11 40 0 100 
5530
5531 bcut s12 b c 
5532 ttranslate s12 -40 0 100 
5533
5534 bcommon s14 b c 
5535 ttranslate s14 0 -40 100 
5536
5537 @subsubsection occt_2142243456_1869436669772  bopsection
5538
5539 **bopsection **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes. 
5540
5541
5542 Syntax:      bop shape1 shape2 
5543 bopsection result 
5544
5545
5546
5547 Short variant: 
5548
5549 bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a] 
5550
5551
5552 **bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**. 
5553 **bopsection** command used after **bop** command. 
5554
5555 **-2d**  -  PCurves are computed on both parts. 
5556 **-2d1** - PCurves are computed on first part. 
5557 **-2d2 **- PCurves are computed on second part. 
5558 **-a**  -    geometries built are approximated. 
5559
5560
5561 **Example:** 
5562
5563 # section line between a cylinder and a box 
5564 pcylinder c 10 20 
5565 box b 0 0 5 15 15 15 
5566 trotate b 0 0 0 1 1 1 20 
5567 bop b c 
5568 bopsection s 
5569 # Short variant: 
5570 bsection s2 b c 
5571
5572
5573 @subsubsection occt_2142243456_1869436669773  bopcheck, bopargshape
5574
5575 Syntax:      bopcheck shape 
5576 bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF] 
5577
5578
5579 **bopcheck** checks a shape for self-interference. 
5580
5581 **bopargcheck** checks the validity of argument(s) for boolean operations. 
5582
5583 -Boolean Operation 
5584  **F** (fuse) 
5585  **O** (common) 
5586  **C** (cut) 
5587  **T** (cut21) 
5588  **S** (section) 
5589  **U** (unknown) 
5590 By default a section is made. 
5591
5592  /Test Options 
5593  **R** (disable small edges (shrank range) test) 
5594  **F** (disable faces verification test) 
5595  **T** (disable tangent faces searching test) 
5596  **V** (disable test possibility to merge vertices) 
5597  **E** (disable test possibility to merge edges) 
5598  **I** (disable self-interference test) 
5599  **P** (disable shape type test) 
5600 By default all options are enabled. 
5601
5602  #Additional Test Options 
5603  **B** (stop test on first faulty found); default OFF 
5604  **F** (full output for faulty shapes); 
5605 **By **default the output is made in a short format. 
5606
5607  NOTE: Boolean Operation and Test Options are used only for a couple of argument shapes, except for **I** and **P** options that are always used to test a couple of shapes as well as a single shape. 
5608
5609 **Example:** 
5610
5611 # checks a shape on self-interference 
5612 box b1 0 0 0 1 1 1 
5613 bopcheck b1 
5614
5615 # checks the validity of argument for boolean cut operations 
5616 box b2 0 0 0 10 10 10 
5617 bopargcheck b1 b2 -C 
5618
5619
5620 @subsection occt_2142243456_186943666978  Drafting and blending
5621
5622 Drafting is creation of a new shape by tilting faces through an angle. 
5623
5624 Blending is the creation of a new shape by rounding edges to create a fillet. 
5625
5626   * Use the **depouille **command for drafting.
5627   * Use the **chamf **command to add a chamfer to an edge
5628   * Use the **blend **command for simple blending.
5629   * Use **fubl **for a fusion + blending operation.
5630   * Use **buildevol**, **mkevol**, **updatevol **to realize varying radius blending.
5631
5632
5633 @subsubsection occt_2142243456_1869436669781  depouille
5634
5635 Syntax: dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...] 
5636
5637 **depouille **creates a new shape by drafting one or more faces of a shape. 
5638
5639 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. 
5640 **Example:** 
5641 # draft a face of a box 
5642 box b 10 10 10 
5643 explode b f 
5644 == b_1 b_2 b_3 b_4 b_5 b_6 
5645
5646 dep a b 0 0 1 b_2 10 0 10 0 1 0 5 
5647
5648
5649 @subsubsection occt_2142243456_1869436669782  chamf
5650
5651 Syntax:      chamf newname shape edge face S dist 
5652 chamf newname shape edge face dist1 dist2 
5653 chamf newname shape edge face A dist angle 
5654
5655 **chamf **creates a chamfer along the edge between faces using: 
5656
5657   * a equal distances from the edge
5658   * the edge, a face and distance, a second distance
5659   * the edge, a reference face and an angle
5660
5661 Use the dot syntax to select the faces and edges. 
5662 **Example:**
5663
5664 # to create a chamfer based on equal distances from the 
5665 edge (45 degree angle) 
5666 # create a box 
5667 box b 1 2 3 
5668 chamf ch b . . S 0.5 
5669 ==Pick an object 
5670 # select an edge 
5671 ==Pick an object 
5672 # select an adjacent face 
5673 **Example:** 
5674
5675 # to create a chamfer based on different distances from 
5676 the selected edge 
5677 box b 1 2 3 
5678 chamf ch b . . 0.3 0.4 
5679 ==Pick an object 
5680 # select an edge 
5681 ==Pick an object 
5682 # select an adjacent face 
5683 **Example:** 
5684
5685 # to create a chamfer based on a distance from the edge 
5686 and an angle 
5687 box b 1 2 3 
5688 chamf ch b . . A 0.4 30 
5689 ==Pick an object 
5690 # select an edge 
5691 ==Pick an object 
5692 # select an adjacent face 
5693
5694
5695 @subsubsection occt_2142243456_1869436669783  blend
5696
5697 Syntax:      blend result object rad1 ed1 rad2 ed2 ... [R/Q/P] 
5698
5699 **blend **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. 
5700 **Example:** 
5701
5702 # blend a box, click on an edge 
5703 box b 20 20 20 
5704 blend b b 2 . 
5705 ==tolerance ang : 0.01 
5706 ==tolerance 3d : 0.0001 
5707 ==tolerance 2d : 1e-05 
5708 ==fleche : 0.001 
5709 ==tolblend 0.01 0.0001 1e-05 0.001 
5710 ==Pick an object 
5711 # click on the edge you want ot fillet 
5712
5713 ==COMPUTE: temps total 0.1s dont : 
5714 ==- Init + ExtentAnalyse 0s 
5715 ==- PerformSetOfSurf 0.02s 
5716 ==- PerformFilletOnVertex 0.02s 
5717 ==- FilDS 0s 
5718 ==- Reconstruction 0.06s 
5719 ==- SetRegul 0s 
5720
5721
5722 @subsubsection occt_2142243456_1869436669784  fubl
5723
5724 Syntax:      fubl name shape1 shape2 radius 
5725 **     ** 
5726 **fubl **creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius. 
5727 **Example:** 
5728
5729 # fuse-blend two boxes 
5730 box b1 20 20 5 
5731 copy b1 b2 
5732 ttranslate b2 -10 10 3 
5733 fubl a b1 b2 1 
5734 See also: **fuse**, **blend** 
5735
5736
5737 @subsubsection occt_2142243456_1869436669785  mkevol, updatevol, buildevol
5738
5739 Syntax:      mkevol result object (then use updatevol) [R/Q/P] 
5740 updatevol edge u1 radius1 [u2 radius2 ...] 
5741 buildevol 
5742
5743 These three commands work together to create fillets with evolving radii. 
5744
5745 **mkevol **allows you to specify the shape and the name of the result. It returns the tolerances of the fillet. 
5746
5747 **updatevol **allows you to describe 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. 
5748
5749 **buildevol **produces the result described previously in **mkevol **and **updatevol**. 
5750 **Example:** 
5751
5752 # makes an evolved radius on a box 
5753 box b 10 10 10 
5754 mkevol b b 
5755 ==tolerance ang : 0.01 
5756 ==tolerance 3d : 0.0001 
5757 ==tolerance 2d : 1e-05 
5758 ==fleche : 0.001 
5759 ==tolblend 0.01 0.0001 1e-05 0.001 
5760
5761 # click an edge 
5762 updatevol . 0 1 1 3 2 2 
5763 ==Pick an object 
5764
5765 buildevol 
5766 ==Dump of SweepApproximation 
5767 ==Error 3d = 1.28548881203818e-14 
5768 ==Error 2d = 1.3468326936926e-14 , 
5769 ==1.20292299999388e-14 
5770 ==2 Segment(s) of degree 3 
5771
5772 ==COMPUTE: temps total 0.91s dont : 
5773 ==- Init + ExtentAnalyse 0s 
5774 ==- PerformSetOfSurf 0.33s 
5775 ==- PerformFilletOnVertex 0.53s 
5776 ==- FilDS 0.01s 
5777 ==- Reconstruction 0.04s 
5778 ==- SetRegul 0s 
5779
5780
5781
5782 @subsection occt_2142243456_186943666979  Topological analysis
5783
5784 Analysis of shapes includes commands to compute length, area, volumes and inertial properties. 
5785
5786   * Use **lprops**, **sprops**, **vprops **to compute integral properties.
5787   * Use **bounding **to display the bounding box of a shape.
5788   * Use **distmini **to calculate the minimum distance between two shapes.
5789
5790
5791
5792
5793 @subsubsection occt_2142243456_1869436669791  lprops, sprops, vprops
5794
5795 Syntax:      lprops shape 
5796 sprops shape 
5797 vprops shape 
5798
5799 **lprops **computes the mass properties of all edges in the shape with a linear density of 1, **sprops **of all faces with a surface density of 1 and **vprops **of all solids with a density of 1. 
5800
5801 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. 
5802 **Example:** 
5803
5804 # volume of a cylinder 
5805 pcylinder c 10 20 
5806 vprops c 
5807 == results 
5808 Mass : 6283.18529981086 
5809
5810 Center of gravity : 
5811 X = 4.1004749224903e-06 
5812 Y = -2.03392858349861e-16 
5813 Z = 9.9999999941362 
5814
5815 Matrix of Inertia : 
5816 366519.141445068                    5.71451850691484e-12 
5817 0.257640437382627 
5818 5.71451850691484e-12                366519.141444962 
5819 2.26823064169991e-10                0.257640437382627 
5820 2.26823064169991e-10                314159.265358863 
5821
5822 Moments : 
5823 IX = 366519.141446336 
5824 IY = 366519.141444962 
5825 I.Z = 314159.265357595 
5826
5827
5828
5829 @subsubsection occt_2142243456_1869436669792   bounding
5830
5831 Syntax:      bounding shape 
5832
5833 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.* 
5834 **Example:** 
5835
5836 # bounding box of a torus 
5837 ptorus t 20 5 
5838 bounding t 
5839 ==-27.059805107309852              -27.059805107309852 - 
5840 5.0000001000000003 
5841 ==27.059805107309852               27.059805107309852 
5842 5.0000001000000003 
5843
5844
5845 @subsubsection occt_2142243456_1869436669793  distmini
5846
5847 Syntax:      distmini name Shape1 Shape2 
5848
5849 **distmini **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. 
5850 **Example:** 
5851
5852 box b 0 0 0 10 20 30 
5853 box b2 30 30 0 10 20 30 
5854 distmini d1 b b2 
5855 ==the distance value is : 22.3606797749979 
5856 ==the number of solutions is :2 
5857
5858 ==solution number 1 
5859 ==the type of the solution on the first shape is 0 
5860 ==the type of the solution on the second shape is 0 
5861 ==the coordinates of the point on the first shape are: 
5862 ==X=10 Y=20 Z=30 
5863 ==the coordinates of the point on the second shape 
5864 are: 
5865 ==X=30 Y=30 Z=30 
5866
5867 ==solution number 2: 
5868 ==the type of the solution on the first shape is 0 
5869 ==the type of the solution on the second shape is 0 
5870 ==the coordinates of the point on the first shape are: 
5871 ==X=10 Y=20 Z=0 
5872 ==the coordinates of the point on the second shape 
5873 are: 
5874 ==X=30 Y=30 Z=0 
5875
5876 ==d1_val d1 d12 
5877
5878
5879
5880
5881 @subsection occt_2142243456_1869436669710  Surface creation
5882
5883 Surface creation commands include surfaces created from boundaries and from spaces between shapes. 
5884
5885   * gplate creates a surface from a boundary definition.
5886   * filling creates a surface from a group of surfaces.
5887
5888
5889 @subsubsection occt_2142243456_18694366697101   gplate,
5890
5891 Syntax: gplate result nbrcurfront nbrpntconst [SurfInit] [edge 0] [edge tang (1:G1;2:G2) surf]...[point] [u v tang (1:G1;2:G2) surf] ... 
5892
5893 **gplate **creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces. 
5894 **Example:**
5895
5896 plane p 
5897 trim p p -1 3 -1 3 
5898 mkface p p 
5899
5900 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
5901 mkedge e1 c1 
5902 tcopy e1 e2 
5903 tcopy e1 e3 
5904
5905 ttranslate e2 0 2 0 
5906 trotate e3 0 0 0 0 0 1 90 
5907 tcopy e3 e4 
5908 ttranslate e4 2 0 0 
5909 # create the surface 
5910 gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0 
5911 == 
5912 ======== Results =========== 
5913 DistMax=8.50014503228635e-16 
5914 * GEOMPLATE END* 
5915 Calculation time: 0.33 
5916 Loop number: 1 
5917 Approximation results 
5918 Approximation error : 2.06274907619957e-13 
5919 Criterium error : 4.97600631215754e-14 
5920
5921 #to create a surface defined by edges and passing through a point 
5922 # to define the border edges and the point 
5923 plane p 
5924 trim p p -1 3 -1 3 
5925 mkface p p 
5926
5927 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
5928 mkedge e1 c1 
5929 tcopy e1 e2 
5930 tcopy e1 e3 
5931
5932 ttranslate e2 0 2 0 
5933 trotate e3 0 0 0 0 0 1 90 
5934 tcopy e3 e4 
5935 ttranslate e4 2 0 0 
5936 # to create a point 
5937 point pp 1 1 0 
5938 # to create the surface 
5939 gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp 
5940 == 
5941 ======== Results =========== 
5942 DistMax=3.65622157610934e-06 
5943 * GEOMPLATE END* 
5944 Calculculation time: 0.27 
5945 Loop number: 1 
5946 Approximation results 
5947 Approximation error : 0.000422195884750181 
5948 Criterium error : 3.43709808053967e-05 
5949
5950 @subsubsection occt_2142243456_18694366697102   filling, fillingparam
5951
5952 Syntax:      filling result nbB nbC nbP [SurfInit] [edge][face]order... 
5953 edge[face]order... point/u v face order... 
5954
5955 **filling **creates a surface between borders. It 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. 
5956
5957 To define the surface border: 
5958
5959   * enter the number of edges, constraints, and points
5960   * enumerate the edges, constraints and points
5961
5962 The surface can pass through other points. These are defined after the border definition. 
5963
5964 You can use the **fillingparam **command to access the filling parameters. 
5965
5966 The options are: 
5967
5968 -l : to list current values 
5969
5970 -i : to set default values 
5971
5972 -r deg nbPonC nbIt anis : to set filling options 
5973
5974 -c t2d t3d tang tcur : to set tolerances 
5975
5976 -a maxdeg maxseg : Approximation option 
5977 **Example:** 
5978
5979 # to create four curved survaces and a point 
5980 plane p 
5981 trim p p -1 3 -1 3 
5982 mkface p p 
5983
5984 beziercurve c1 3 0 0 0 1 0 1 2 0 0 
5985 mkedge e1 c1 
5986 tcopy e1 e2 
5987 tcopy e1 e3 
5988
5989 ttranslate e2 0 2 0 
5990 trotate e3 0 0 0 0 0 1 90 
5991 tcopy e3 e4 
5992 ttranslate e4 2 0 0 
5993
5994 point pp 1 1 0 
5995
5996 prism f1 e1 0 -1 0 
5997 prism f2 e2 0 1 0 
5998 prism f3 e3 -1 0 0 
5999 prism f4 e4 1 0 0 
6000
6001 # to create a tangential surface 
6002 filling r1 4 0 0 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 
6003 # to create a tangential surface passing through point pp 
6004 filling r2 4 0 1 p e1 f1 1 e2 f2 1 e3 f3 1 e4 f4 1 pp# 
6005 # to visualise the surface in detail 
6006 isos r2 40 
6007 # to display the current filling parameters 
6008 fillingparam -l 
6009 == 
6010 Degree = 3 
6011 NbPtsOnCur = 10 
6012 NbIter = 3 
6013 Anisotropie = 0 
6014 Tol2d = 1e-05 
6015 Tol3d = 0.0001 
6016 TolAng = 0.01 
6017 TolCurv = 0.1 
6018
6019 MaxDeg = 8 
6020 MaxSegments = 9 
6021
6022
6023
6024
6025 @subsection occt_2142243456_1869436669711  Complex Topology
6026
6027 Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling. 
6028
6029
6030 @subsubsection occt_2142243456_18694366697111  offsetshape, offsetcompshape
6031
6032 Syntax:      offsetshape r shape offset [tol] [face ...] 
6033 offsetcompshape r shape offset [face ...] 
6034
6035 **offsetshape **and **offsetcompshape **assigns 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. 
6036
6037 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. 
6038
6039 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. 
6040
6041
6042 The opening between the object interior and exterior is defined by the argument face or faces. 
6043 **Example:** 
6044
6045 box b1 10 20 30 
6046 explode b1 f 
6047 == b1_1 b1_2 b1_3 b1_4 b1_5 b1_6 
6048 offsetcompshape r b1 -1 b1_3 
6049
6050 Syntax:      offsetparameter tolerance intersection(c/p) join(a/i) 
6051 offsetload      shape offset [face1 face2 …] 
6052 offsetonface    face1 offset1 face2 offset2 … 
6053 offsetperform   result 
6054
6055 **offsetparameter** sets the values of parameters and options for the following command **offsetload**: 
6056   * *tolerance* defines the coincidence tolerance criterion for generated shapes;
6057   * *intersection* defines the mode of intersection: *c* means complete intersection, *p* means partial intersection;
6058   * *join* defines the mode of connecting new adjacent faces: *a* means GeomAbs_Arc, *i* means GeomAbs_Intersection.
6059
6060 **offsetload** loads shape, offset value and, if necessary,  a set of faces to remove from the shape. These data are later used by command **offsetperform**.   
6061 **offsetonface** indicates the faces of shape (loaded earlier by command **offsetload**) that should be shifted with special offset value. This command is optional. **Warning:** this command should be called only after **offsetload** and it takes effect only if parameter join = GeomAbs_Intersection. 
6062
6063 **offsetperform** performs the result of 3d-offset algorithm using the data loaded by previous commands. 
6064 **Example:** 
6065
6066 box b1 10 20 30 
6067 explode b1 f 
6068 == b1_1 b1_2 b1_3 b1_4 b1_5 b1_6 
6069 offsetparameter 1e-7 p i 
6070 offsetload b1 2 b1_1 b1_2 
6071 offsetonface b1_3 5 
6072 offsetperform result 
6073
6074
6075
6076 @subsubsection occt_2142243456_18694366697112  featprism, featdprism, featrevol, featlf, featrf
6077
6078 Syntax:      featprism shape element skface Dirx Diry Dirz Fuse(0/1/2) Modify(0/1) 
6079 featdprism shape face skface angle Fuse(0/1/2) Modify(0/1) 
6080 featrevol shape element skface Ox Oy Oz Dx Dy Dz Fuse(0/1/2) Modify(0/1) 
6081 featlf shape wire plane DirX DirY DirZ DirX DirY DirZ Fuse(0/1/2) Modify(0/1) 
6082 featrf shape wire plane X Y Z DirX DirY DirZ Size Size Fuse(0/1/2) Modify(0/1) 
6083 featperform prism/revol/pipe/dprism/lf result [[Ffrom] Funtil] 
6084 featperformval prism/revol/dprism/lf result value 
6085
6086 **featprism **loads the arguments for a prism with contiguous sides normal to the face. 
6087
6088 **featdprism **loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle. 
6089
6090 **featrevol **loads the arguments for a prism with a circular evolution. 
6091
6092 **featlf **loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline. 
6093
6094 **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. 
6095
6096 **featperform **loads the arguments to create the feature. 
6097
6098 **featperformval **uses the defined arguments to create a feature with a limiting value. 
6099
6100 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. 
6101 **Example:** 
6102
6103 # to create a feature prism with a draft angle and a 
6104 normal direction 
6105 # create a box with a wire contour on the upper face 
6106 box b 1 1 1 
6107 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
6108 explode b f 
6109 # loads the feature arguments defining the draft angle 
6110 featdprism b f b_6 5 1 0 
6111 # create the feature 
6112 featperformval dprism r 1 
6113 ==BRepFeat_MakeDPrism::Perform(Height) 
6114 BRepFeat_Form::GlobalPerform () 
6115 Gluer 
6116 still Gluer 
6117 Gluer result 
6118
6119 # to create a feature prism with circular direction 
6120 # create a box with a wire contour on the upper face 
6121 box b 1 1 1 
6122 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5 
6123 explode b f 
6124 # loads the feature arguments defining a rotation axis 
6125 featrevol b f b_6 1 0 1 0 1 0 1 0 
6126 featperformval revol r 45 
6127 ==BRepFeat_MakeRevol::Perform(Angle) 
6128 BRepFeat_Form::GlobalPerform () 
6129 Gluer 
6130 still Gluer 
6131 Gluer result 
6132
6133 # to create a slot using the linear feature 
6134 #create the base model using the multi viewer 
6135 mu4 
6136 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 
6137 prism pr p 0 0 1 
6138 # create the contour for the linear feature 
6139 vertex v1 -0.2 4 0.3 
6140 vertex v2 0.2 4 0.3 
6141 vertex v3 0.2 0.2 0.3 
6142 vertex v4 4 0.2 0.3 
6143 vertex v5 4 -0.2 0.3 
6144 edge e1 v1 v2 
6145 edge e2 v2 v3 
6146 edge e3 v3 v4 
6147 edge e4 v4 v5 
6148 wire w e1 e2 e3 e4 
6149 # define a plane 
6150 plane pl 0.2 0.2 0.3 0 0 1 
6151 # loads the linear feature arguments 
6152 featlf pr w pl 0 0 0.3 0 0 0 0 1 
6153 featperform lf result 
6154
6155 # to create a rib using the revolution feature 
6156 #create the base model using the multi viewer 
6157 mu4 
6158 pcylinder c1 3 5 
6159 # create the contour for the revolution feature 
6160 profile w c 1 190 WW 
6161 trotate w 0 0 0 1 0 0 90 
6162 ttranslate w -3 0 1 
6163 trotate w -3 0 1.5 0 0 1 180 
6164 plane pl -3 0 1.5 0 1 0 
6165 # loads the revolution feature arguments 
6166 featrf c1 w pl 0 0 0 0 0 1 0.3 0.3 1 1 
6167 featperform rf result 
6168
6169
6170 @subsubsection occt_2142243456_18694366697113  draft
6171
6172 Syntax: draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal] 
6173
6174 **draft **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. 
6175
6176   * The draft angle is measured in radians.
6177   * The draft direction is determined by the argument -INTERNAL
6178   * The argument Ri/Ro deftermines wether the corner edges of the
6179
6180 draft surface are angular or rounded. 
6181
6182   * Arguments that can be used to define the surface distance are:
6183   * length, a defined distance
6184   * shape, until the surface contacts a shape
6185   * surface, until the surface contacts a surface.
6186
6187 <h4>NOTE</h4>
6188 *The original aim of adding a draft angle to a shape is to* 
6189 *produce a shape which can be removed easily from a mould.* 
6190 *The Examples below use larger angles than are used normally* 
6191 *and the calculation results returned are not indicated.* 
6192
6193 **Example:** 
6194
6195 # to create a simple profile 
6196 profile p F 0 0 x 2 y 4 tt 0 4 w 
6197 # creates a draft with rounded angles 
6198 draft res p 0 0 1 3 1 -Ro 
6199 # to create a profile with an internal angle 
6200 profile p F 0 0 x 2 y 4 tt 1 1.5 tt 0 4 w 
6201 # creates a draft with rounded external angles 
6202 draft res p 0 0 1 3 1 -Ro 
6203
6204
6205 @subsubsection occt_2142243456_18694366697114  deform, nurbsconvert
6206
6207 Syntax:      deform newname name CoeffX CoeffY CoeffZ 
6208
6209 **deform **modifies the shape using the x, y, and z coefficients. You can reduce or magnify the shape in the x,y, and z directions. 
6210
6211 Syntax nurbsconvert result name [result name] 
6212
6213 **nurbsconvert **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. 
6214 **Example:** 
6215
6216 pcylinder c 20 20 
6217 deform a c 1 3 5 
6218 # the conversion to bspline is followed by the 
6219 deformation 
6220
6221
6222
6223 @subsection occt_2142243456_1869436669712  Texture Mapping to a Shape
6224
6225 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. 
6226
6227 @subsubsection occt_2142243456_18694366697121  vtexture
6228
6229 Syntax       vtexture NameOfShape TextureFile 
6230 vtexture NameOfShape 
6231 vtexture NameOfShape ? 
6232 vtexture NameOfShape IdOfTexture 
6233
6234 **TextureFile **identifies the file containing the texture you want. The same syntax without **TextureFile **disables texture mapping. The question-mark ***?* **lists available textures. **IdOfTexture **allows you to apply predefined textures. 
6235
6236 @subsubsection occt_2142243456_18694366697122  vtexscale
6237
6238 Syntax:      vtexscale NameOfShape ScaleU ScaleV 
6239 vtexscale NameOfShape ScaleUV 
6240 vtexscale NameOfShape 
6241
6242 **ScaleU **and **Scale V **allow you to scale the texture according to the U and V parameters individually, while **ScaleUV **applies the same scale to both parameters. The same syntax without **ScaleU**, **ScaleV **or **ScaleUV **disables texture scaling. 
6243
6244 @subsubsection occt_2142243456_18694366697123  vtexorigin
6245
6246 Syntax       vtexorigin NameOfShape UOrigin VOrigin 
6247 vtexorigin NameOfShape UVOrigin 
6248 vtexorigin NameOfShape 
6249
6250 **UOrigin **and **VOrigin **allow you to place the texture according to the U and V parameters individually while **UVOrigin **applies the same position value to both parameters. The same syntax without **UOrigin**, **VOrigin **or **UVOrigin **disables origin positioning. 
6251
6252 @subsubsection occt_2142243456_18694366697124  vtexrepeat
6253
6254 Syntax       vtexrepeat NameOfShape URepeat VRepeat 
6255 vtexrepeat NameOfShape UVRepeat 
6256 vtexrepeat NameOfShape 
6257
6258 **URepeat **and **VRepeat **allow you to repeat the texture along the U and V parameters individually while **UVRepeat **applies the same number of repetitions for both parameters. The same syntax without **URepeat**, **VRepeat **or **UVRepeat **disables texture repetition. 
6259
6260 @subsubsection occt_2142243456_18694366697125  vtexdefault
6261
6262 Syntax       vtexdefault NameOfShape 
6263
6264 **Vtexdefault **sets or resets the texture mapping default parameters. 
6265
6266 The defaults are: 
6267
6268 URepeat = VRepeat = 1 = no repetition 
6269 UOrigin = VOrigin = 1 = origin set at (0,0) 
6270 UScale = VScale = 1 = texture covers 100% of the face 
6271 @section occt_2142243456_1866931135 Data Exchange commands
6272
6273
6274 @subsection occt_2142243456_186693113581  General
6275
6276 This paragraph presents some general information about Data Exchange (DE) operations. 
6277
6278 DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.) 
6279
6280 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’s Guide for a corresponding format. 
6281
6282 Each Draw session has an interface model – some structure for keeping various information. 
6283 First step of translation – loading information from a file into a model. 
6284 Second step – creation of an OpenCASCADE shape from this model. 
6285 Each entity from file has its own number in the model (num). 
6286 During the translation a map of correspondences between labels(from file) and numbers (from model) is created. 
6287 The model and the mentioned map are used for working with most of DE commands. 
6288
6289 @subsection occt_2142243456_186693113582  IGES commands 
6290
6291 These commands are used during the translation of IGES models. 
6292
6293
6294 @subsubsection occt_2142243456_1866931135821  igesread
6295
6296 Syntax:      igesread file_name result_shape_name [selection] 
6297
6298 Read an IGES file to an OCCT shape. 
6299 This command will interactively ask the user to select a set of entities to be converted: 
6300
6301
6302 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. 
6303 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. 
6304 selection specifies the scope of selected entities in the model, it is xst-transferrable-roots by default. More about selection see in the *IGES FORMAT User’s Guide*. 
6305 If we use symbol  * as selection all roots will be translated. 
6306 **Example:**
6307
6308 # translation all roots from file 
6309 igesread /disk01/files/model.igs a  * 
6310
6311 @subsubsection occt_2142243456_1866931135822   tplosttrim
6312
6313 Syntax:      tplosttrim [IGES_type] 
6314
6315 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. 
6316 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. 
6317 Optional parameter IGES_type can be TrimmedSurface, BoundedSurface or Face to specify the only type of IGES faces. 
6318 **Example:**
6319
6320 tplosttrim TrimmedSurface 
6321
6322 @subsubsection occt_2142243456_1866931135823  brepiges
6323
6324 Syntax:      brepiges shape_name filename.igs 
6325
6326 Writes an OCCT shape to an IGES file. 
6327 **Example:** 
6328     
6329 # write shape with name aa to IGES file 
6330 brepiges aa /disk1/tmp/aaa.igs 
6331 == unit (write) : MM 
6332 == mode  write  : Faces 
6333 ==   To modifiy : command  param 
6334 == 1 Shapes written, giving 345 Entities 
6335 ==  Now, to write a file, command : writeall filename 
6336 ==  Output on file : /disk1/tmp/aaa.igs 
6337 ==  Write OK 
6338
6339
6340
6341 @subsection occt_2142243456_186693113583  STEP commands 
6342
6343 These commands are used during the translation of STEP models. 
6344
6345
6346 @subsubsection occt_2142243456_1866931135831  stepread
6347
6348 Syntax:      stepread file_name result_shape_name [selection] 
6349
6350 Read a STEP file to an OCCT shape. 
6351 This command will interactively ask the user to select a set of entities to be converted: 
6352
6353
6354 After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes. 
6355 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. 
6356 selection specifies the scope of selected entities in the model. More about selection see in the *STEP FORMAT User’s Guide*. 
6357 If as selection we use symbol  * all roots will be translated. 
6358 **Example:**
6359
6360 # translation all roots from file 
6361 stepread /disk01/files/model.stp a  * 
6362
6363 @subsubsection occt_2142243456_1866931135832   stepwrite
6364
6365 Syntax:      stepwrite mode shape_name file_name 
6366
6367 Writes an OCCT shape to a STEP file. 
6368 The available modes are the following: 
6369      0 or ‘a’  - ;as is; mode – mode is selected automatically depending on type &amp; geometry of the shape 
6370      1 or ‘m’ - manifold_solid_brep or brep_with_voids 
6371      2 or ‘f’ - faceted_brep 
6372      3 or ‘w’ - geometric_curve_set 
6373      4 or ‘s’ - shell_based_surface_model 
6374 For further information see ;STEP FORMAT User’s Guide ;. 
6375 **Example:**
6376
6377 # write shape with name a to STEP file with mode 0 
6378 stepwrite 0 a /disk1/tmp/aaa.igs 
6379
6380
6381
6382 @subsection occt_2142243456_186693113584  General commands 
6383
6384 These commands are auxilary commands. Most of them are used for the analysis of result of translation of IGES and STEP files. 
6385
6386 @subsubsection occt_2142243456_1866931135841  count
6387
6388 Syntax:      count counter [selection] 
6389
6390 Is used to calculate statistics on the entities in the model. 
6391 Gives us a count of entities. 
6392 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 (for example): 
6393
6394 **Example:**
6395
6396 count xst-types 
6397
6398 @subsubsection occt_2142243456_1866931135842  data
6399
6400 Syntax:      data symbol 
6401
6402 Is used to obtain general statistics on the loaded data. 
6403 Information printed by this command depends on the symbol specified: 
6404 **Example:**
6405
6406 # print full information about warnings and fails 
6407 data c 
6408
6409 @subsubsection occt_2142243456_1866931135843  elabel
6410
6411 Syntax:      elabel num 
6412
6413 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. 
6414 **Example:**
6415
6416 elabel 84 
6417
6418 @subsubsection occt_2142243456_1866931135844  entity
6419
6420 Syntax:      entity #(D)_or_num level_of_information 
6421
6422 The content of an IGES or STEP entity can be obtained by using this command. 
6423 Entity can be determined by its number or label. 
6424 level_of_information has range [0-6]. You can get more information about this level using this command without parameters. 
6425 **Example:**
6426
6427 # full information for STEP entity with label 84 
6428 entity #84 6 
6429
6430 @subsubsection occt_2142243456_1866931135845  enum
6431
6432 Syntax:      enum #(D) 
6433
6434 Prints a number for the entity with a given label. 
6435 **Example:**
6436
6437 # give a number for IGES entity with label 21 
6438 enum D21 
6439
6440 @subsubsection occt_2142243456_1866931135846  estatus
6441
6442 Syntax:      estatus #(D)_or_num 
6443
6444 The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command. 
6445 **Example:**
6446
6447 estatus #315 
6448
6449 @subsubsection occt_2142243456_1866931135847  fromshape
6450
6451 Syntax:      fromshape shape_name 
6452
6453 Gives us 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. 
6454 **Example:**
6455
6456 fromshape a_1_23 
6457
6458 @subsubsection occt_2142243456_1866931135848  givecount
6459
6460 Syntax:      givecount selection_name [selection_name] 
6461
6462 **Example:**
6463
6464 givecount xst-model-roots 
6465
6466 @subsubsection occt_2142243456_1866931135849  givelist
6467
6468 Syntax:      givelist selection_name 
6469
6470 Prints a list of a subset of loaded entities defined by the selection argument: 
6471
6472 **Example:**
6473
6474 # give a list of all entities of the model 
6475 givelist xst-model-all 
6476
6477 @subsubsection occt_2142243456_18669311358410  listcount
6478
6479 Syntax:      listcount counter [selection ...] 
6480
6481 Prints a list of entities per each type matching the criteria defined by arguments. 
6482 Optional selection argument, if specified, defines a subset of entities, which are to be taken into account. Argument counter should be one of the currently defined counters: 
6483
6484 **Example:**
6485
6486 listcount xst-types 
6487
6488 @subsubsection occt_2142243456_18669311358411  listitems
6489
6490 Syntax:      listitems 
6491
6492 This command prints a list of objects (counters, selections etc.) defined in the current session. 
6493 **Example:**
6494
6495 listitems 
6496
6497 @subsubsection occt_2142243456_18669311358412  listtypes
6498
6499 Syntax:      listtypes [selection_name ...] 
6500
6501 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. 
6502 **Example:**
6503
6504 # full list of all entities with thier counts 
6505 listtypes 
6506
6507 @subsubsection occt_2142243456_18669311358413  newmodel
6508
6509 Syntax:      newmodel 
6510
6511 Clears the current model. 
6512 **Example:**
6513
6514 newmodel 
6515
6516 @subsubsection occt_2142243456_18669311358414  param
6517
6518 Syntax:      param [parameter] [value] 
6519
6520 This command is used to manage translation parameters. 
6521 Command without arguments gives us a full list of parameters with current values. 
6522 Command with parameter (without value) gives us the current value of this parameter and all possible values for it. Command with value sets this new value to parameter. 
6523 For more information about translation parameters see the corresponding User’s Guide. 
6524 **Example:**
6525
6526 # info about possible schemes for writing STEP file 
6527 param write.step.schema 
6528
6529 @subsubsection occt_2142243456_18669311358415  sumcount
6530
6531 Syntax:      sumcount counter [selection ...] 
6532
6533 Prints only a number of entities per each type matching the criteria defined by arguments. 
6534 **Example:**
6535
6536 sumcount xst-types 
6537
6538 @subsubsection occt_2142243456_18669311358416  tpclear
6539
6540 Syntax:      tpclear  
6541
6542 Clears the map of correspondences between IGES or STEP entities and OCCT shapes. 
6543 **Example:**
6544
6545 tpclear 
6546
6547 @subsubsection occt_2142243456_18669311358417  tpdraw
6548
6549 Syntax:      tpdraw #(D)_or_num 
6550
6551 **Example:**
6552
6553 tpdraw 57 
6554
6555 @subsubsection occt_2142243456_18669311358418  tpent
6556
6557 Syntax:      tpent #(D)_or_num 
6558
6559 **Example:**
6560
6561 tpent #23 
6562
6563 @subsubsection occt_2142243456_18669311358419  tpstat
6564
6565 Syntax:      tpstat [*|?]symbol [selection] 
6566
6567 Gives all statistics on the last transfer, including the list of transferred entities with mapping from IGES or STEP to OCCT types, as well as fail and warning messages. The parameter *symbol *defines what information will be printed: 
6568
6569
6570 The sign ‘*’ before the parameters **n**, **s**, **b**, **t**, **r** makes it work on all entities (not only on roots). The sign ‘?’ before **n**, **s**, **b**, **t** limits the scope of information to invalid entities. 
6571 Optional argument selection can limit the action of the command with a selected subset of entities. 
6572 **Example:**
6573
6574 # translation ratio on IGES faces 
6575 tpstat *l iges-faces 
6576
6577 @subsubsection occt_2142243456_18669311358420  xload
6578
6579 Syntax:      xload file_name 
6580
6581 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. 
6582 **Example:**
6583
6584 xload /disk1/tmp/aaa.stp 
6585
6586
6587
6588 @subsection occt_2142243456_186693113585  Overview of XDE commands 
6589
6590 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: 
6591   * **XDE translation commands**
6592   * **XDE general commands**
6593   * **XDE shape’s commands**
6594   * **XDE color’s commands**
6595   * **XDE layer’s commands**
6596   * **XDE property’s commands**
6597
6598
6599
6600 @subsection occt_2142243456_186693113586  XDE translation commands 
6601
6602 Reminding: All operations of translation are performed with parameters managed by command param (see above) 
6603
6604 @subsubsection occt_2142243456_1866931135861  ReadIges
6605
6606 Syntax:      ReadIges document file_name 
6607
6608 Reads information from an IGES file to an XCAF document. 
6609 **Example:**
6610
6611 ReadIges D /disk1/tmp/aaa.igs 
6612 == Document saved with name D 
6613
6614 @subsubsection occt_2142243456_1866931135862  ReadStep
6615
6616 Syntax:      ReadStep document file_name 
6617
6618 Reads information from a STEP file to an XCAF document. 
6619 **Example:**
6620
6621 ReadStep D /disk1/tmp/aaa.stp 
6622 == Document saved with name D 
6623
6624 @subsubsection occt_2142243456_1866931135863  WriteIges
6625
6626 Syntax:      WriteIges document file_name 
6627
6628 **Example:**
6629
6630 WriteIges D /disk1/tmp/aaa.igs 
6631
6632 @subsubsection occt_2142243456_1866931135864  WriteStep
6633
6634 Syntax:      WriteStep document file_name 
6635
6636 Writes information from an XCAF document to a STEP file. 
6637 **Example:**
6638
6639 WriteStep D /disk1/tmp/aaa.stp 
6640
6641 @subsubsection occt_2142243456_1866931135865  XFileCur
6642
6643 Syntax:      XFileCur  
6644
6645 Returns the name of file which is set as the current one in the Draw session. 
6646 **Example:**
6647
6648 XFileCur 
6649 == *as1-ct-203.stp* 
6650
6651 @subsubsection occt_2142243456_1866931135866  XFileList
6652
6653 Syntax:      XFileList  
6654
6655 Returns a list all files that were transferred by the last transfer. This command is  meant (assigned) for the assemble step file. 
6656 **Example:**
6657
6658 XFileList 
6659 == *as1-ct-Bolt.stp* 
6660 == *as1-ct-L-Bracktet.stp* 
6661 == *as1-ct-LBA.stp* 
6662 == *as1-ct-NBA.stp* 
6663 == … 
6664
6665 @subsubsection occt_2142243456_1866931135867  XFileSet
6666
6667 Syntax:      XFileSet filename 
6668
6669 Sets the current file taking it from the components list of the assemble file. 
6670 **Example:**
6671
6672 XFileSet as1-ct-NBA.stp 
6673
6674 @subsubsection occt_2142243456_1866931135868  XFromShape
6675
6676 Syntax:      XFromShape shape 
6677
6678 This command is similar to command *fromshape* (see above) but gives additional information about the name of file. It is useful in the case when a shape was translated from several files. 
6679 **Example:**
6680
6681 XFromShape a 
6682 == Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp 
6683
6684
6685 @subsection occt_2142243456_186693113587  XDE general commands 
6686
6687 @subsubsection occt_2142243456_1866931135871  XNewDoc
6688
6689 Syntax:      XNewDoc document 
6690
6691 Creates a new XCAF document. 
6692 **Example:**
6693
6694 XNewDoc D 
6695
6696 @subsubsection occt_2142243456_1866931135872  XShow
6697
6698 Syntax:      XShow document [ label1 … ] 
6699
6700 Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document. 
6701 **Example:**
6702
6703 # show shape from label 0:1:1:4 from document D 
6704 XShow D 0:1:1:4 
6705
6706 @subsubsection occt_2142243456_1866931135873  XStat
6707
6708 Syntax:      XStat document 
6709
6710 Prints common information from an XCAF document. 
6711 **Example:**
6712
6713 XStat D 
6714 ==Statistis of shapes in the document: 
6715 ==level N 0 : 9 
6716 ==level N 1 : 18 
6717 ==level N 2 : 5 
6718 ==Total number of labels for shapes in the document = 32 
6719 ==Number of labels with name = 27 
6720 ==Number of labels with color link = 3 
6721 ==Number of labels with layer link = 0 
6722 ==Statistis of Props in the document: 
6723 ==Number of Centroid Props = 5 
6724 ==Number of Volume Props = 5 
6725 ==Number of Area Props = 5 
6726 ==Number of colors = 4 
6727 ==BLUE1 RED YELLOW BLUE2 
6728 ==Number of layers = 0 
6729
6730 @subsubsection occt_2142243456_1866931135874  XWdump
6731
6732 Syntax:      XWdump document filename 
6733
6734 Saves the contents of the viewer window as an image (XWD, png or BMP file). 
6735 filename must have a corresponding extention. 
6736 **Example:**
6737
6738 XWdump D /disk1/tmp/image.png 
6739
6740 @subsubsection occt_2142243456_1866931135875  Xdump
6741
6742 Syntax:      Xdump document [int deep {0|1}] 
6743
6744 Prints information about the tree structure of the document. If parameter 1 is given, then the tree is printed with a link to shapes. 
6745 **Example:**
6746
6747 Xdump D 1 
6748 == ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
6749 == ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
6750 == ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
6751 == ASSEMBLY 0:1:1:4 PLATE(0xe8387780) 
6752 == ASSEMBLY 0:1:1:5 ROD(0xe8475418) 
6753 == ASSEMBLY 0:1:1:6 AS1(0xe8476968) 
6754 ==    ASSEMBLY 0:1:1:7 L-BRACKET-ASSEMBLY(0xe8476230) 
6755 ==       ASSEMBLY 0:1:1:1 L-BRACKET(0xe8180448) 
6756 ==       ASSEMBLY 0:1:1:8 NUT-BOLT-ASSEMBLY(0xe8475ec0) 
6757 ==               ASSEMBLY 0:1:1:2 NUT(0xe82151e8) 
6758 ==               ASSEMBLY 0:1:1:3 BOLT(0xe829b000) 
6759 etc. 
6760
6761
6762 @subsection occt_2142243456_186693113588  XDE shape’s commands 
6763
6764 @subsubsection occt_2142243456_1866931135881  XAddComponent
6765
6766 Syntax:      XAddComponent document label shape 
6767
6768 Adds a component shape to assembly. 
6769 **Example:**
6770
6771 # Add shape b as component shape to assembly shape from 
6772 # label 0:1:1:1 
6773 XAddComponent D 0:1:1:1 b 
6774
6775 @subsubsection occt_2142243456_1866931135882  XAddShape
6776
6777 Syntax:      XAddShape document shape [makeassembly=1] 
6778
6779 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. 
6780 **Example:**
6781
6782 # add shape b to document D 
6783 XAddShape D b 0 
6784 == 0:1:1:10 
6785 # if pointed shape is compound and last parameter in 
6786 # XAddShape command is used by default (1), then for 
6787 # each subshapes new label is created 
6788
6789 @subsubsection occt_2142243456_1866931135883  XFindComponent
6790
6791 Syntax:      XFindComponent document shape 
6792
6793 Prints a sequence of labels of the assembly path. 
6794 **Example:**
6795
6796 XFindComponent D b 
6797
6798 @subsubsection occt_2142243456_1866931135884  XFindShape
6799
6800 Syntax:      XFindShape document shape 
6801
6802 Finds and prints a label with an indicated top-level shape. 
6803 **Example:**
6804
6805 XFindShape D a 
6806
6807 @subsubsection occt_2142243456_1866931135885  XGetFreeShapes
6808
6809 Syntax:      XGetFreeShapes document [shape_prefix] 
6810
6811 Print labels or create DRAW shapes for all free shapes in the document. 
6812 If [shape_prefix] is absent – prints labels, else – creates DRAW shapes with names 
6813 [shape_prefix]_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). 
6814 Note: a free shape is a shape to which no other shape refers to. 
6815 **Example:**
6816
6817 XGetFreeShapes D 
6818 == 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13 
6819
6820 XGetFreeShapes D sh 
6821 == sh_1 sh_2 sh_3 sh_4 
6822
6823 @subsubsection occt_2142243456_1866931135886  XGetOneShape
6824
6825 Syntax:      XGetOneShape shape document 
6826
6827 Creates one DRAW shape for all free shapes from a document. 
6828 **Example:**
6829
6830 XGetOneShape a D 
6831
6832 @subsubsection occt_2142243456_1866931135887  XGetReferredShape
6833
6834 Syntax:      XGetReferredShape document label 
6835
6836 Prints a label that contains a top-level shape that corresponds to a shape at a given label. 
6837 **Example:**
6838
6839 XGetReferredShape D 0:1:1:1:1 
6840
6841 @subsubsection occt_2142243456_1866931135888  XGetShape
6842
6843 Syntax:      XGetShape result document label 
6844
6845 Puts a shape from the indicated label in document to result. 
6846 **Example:**
6847
6848 XGetShape b D 0:1:1:3 
6849
6850 @subsubsection occt_2142243456_1866931135889  XGetTopLevelShapes
6851
6852 Syntax:      XGetTopLevelShapes document 
6853
6854 Prints labels that contain top-level shapes. 
6855 **Example:**
6856
6857 XGetTopLevelShapes D 
6858 == 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 
6859 0:1:1:8 0:1:1:9 
6860
6861 @subsubsection occt_2142243456_18669311358810  XLabelInfo
6862
6863 Syntax:      XLabelInfo document label 
6864
6865 Prints information about a shape, stored at an indicated label. 
6866 **Example:** 
6867     
6868 XLabelInfo D 0:1:1:6 
6869 == There are TopLevel Shape. There are an Assembly. This Shape don’t used. 
6870
6871 @subsubsection occt_2142243456_18669311358811  XNewShape
6872
6873 Syntax:      XNewShape document 
6874
6875 Creates a new empty top-level shape. 
6876 **Example:**
6877
6878 XNewShape D 
6879
6880 @subsubsection occt_2142243456_18669311358812  XRemoveComponent
6881
6882 Syntax:      XRemoveComponent document label 
6883
6884 Removes a component from the components label. 
6885 **Example:**
6886
6887 XRemoveComponent D 0:1:1:1:1 
6888
6889 @subsubsection occt_2142243456_18669311358813  XRemoveShape
6890
6891 Syntax:      XRemoveShape document label 
6892
6893 Removes a shape from a document (by it’s label). 
6894 **Example:**
6895
6896 XRemoveShape D 0:1:1:2 
6897
6898 @subsubsection occt_2142243456_18669311358814  XSetShape
6899
6900 Syntax:      XSetShape document label shape 
6901
6902 Sets a shape at the indicated label. 
6903 **Example:**
6904
6905 XSetShape D 0:1:1:3 b 
6906
6907
6908 @subsection occt_2142243456_186693113589  XDE color’s commands 
6909
6910 @subsubsection occt_2142243456_1866931135891  XAddColor
6911
6912 Syntax:      XAddColor document R G B 
6913
6914 Adds color in document to the color table. Parameters R,G,B are real. 
6915 **Example:**
6916
6917 XAddColor D 0.5 0.25 0.25 
6918
6919 @subsubsection occt_2142243456_1866931135892  XFindColor
6920
6921 Syntax:      XFindColor document R G B 
6922
6923 Finds a label where the indicated color is situated. 
6924 **Example:**
6925
6926 XFindColor D 0.25 0.25 0.5 
6927 == 0:1:2:2 
6928
6929 @subsubsection occt_2142243456_1866931135893  XGetAllColors
6930
6931 Syntax:      XGetAllColors document 
6932
6933 Prints all colors that are defined in the document. 
6934 **Example:**
6935
6936 XGetAllColors D 
6937 == RED DARKORANGE BLUE1 GREEN YELLOW3 
6938
6939 @subsubsection occt_2142243456_1866931135894  XGetColor
6940
6941 Syntax:      XGetColor document label 
6942
6943 Returns a color defined at the indicated label from the color table. 
6944 **Example:**
6945
6946 XGetColor D 0:1:2:3 
6947 == BLUE1 
6948
6949 @subsubsection occt_2142243456_1866931135895  XGetObjVisibility
6950
6951 Syntax:      XGetObjVisibility document {label|shape} 
6952
6953 Returns the visibility of a shape. 
6954 **Example:**
6955
6956 XGetObjVisibility D 0:1:1:4 
6957
6958 @subsubsection occt_2142243456_1866931135896  XGetShapeColor
6959
6960 Syntax:      XGetShapeColor document label colortype(s|c) 
6961
6962 Returns the color defined by label. If colortype=’s’ – returns surface color, else – returns curve color. 
6963 **Example:**
6964
6965 XGetShapeColor D 0:1:1:4 c 
6966
6967 @subsubsection occt_2142243456_1866931135897  XRemoveColor
6968
6969 Syntax:      XRemoveColor document label 
6970
6971 Removes a color from the color table in a document. 
6972 **Example:**
6973
6974 XRemoveColor D 0:1:2:1 
6975
6976 @subsubsection occt_2142243456_1866931135898  XSetColor
6977
6978 Syntax:      XSetColor document {label|shape} R G B 
6979
6980 Sets an RGB color to a shape given by label. 
6981 **Example:**
6982
6983 XsetColor D 0:1:1:4 0.5 0.5 0. 
6984
6985 @subsubsection occt_2142243456_1866931135899  XSetObjVisibility
6986
6987 Syntax:      XSetObjVisibility document {label|shape} {0|1} 
6988
6989 Sets the visibility of a shape. 
6990 **Example:**
6991
6992 # set shape from label 0:1:1:4 as invisible 
6993 XSetObjVisibility D 0:1:1:4 0 
6994
6995 @subsubsection occt_2142243456_18669311358910  XUnsetColor
6996
6997 Syntax:      XUnsetColor document {label|shape} colortype 
6998
6999 Unset a color given??? type (‘s’ or ‘c’) for the indicated shape. 
7000 **Example:**
7001
7002 XUnsetColor D 0:1:1:4 s 
7003
7004
7005 @subsection occt_2142243456_1866931135810  XDE layer’s commands 
7006
7007 @subsubsection occt_2142243456_18669311358101  XAddLayer
7008
7009 Syntax:      XAddLayer document layer 
7010
7011 Adds a new layer in an XCAF document. layer - name of new layer (string). 
7012 **Example:**
7013
7014 XAddLayer D layer2 
7015
7016 @subsubsection occt_2142243456_18669311358102  XFindLayer
7017
7018 Syntax:      XFindLayer document layer 
7019
7020 Prints a label where a layer is situated. 
7021 **Example:**
7022
7023 XFindLayer D Bolt 
7024 == 0:1:3:2 
7025
7026 @subsubsection occt_2142243456_18669311358103  XGetAllLayers
7027
7028 Syntax:      XGetAllLayers document 
7029
7030 Prints all layers in an XCAF document. 
7031 **Example:**
7032
7033 XGetAllLayers D 
7034 == *0:1:1:3* *Bolt* *0:1:1:9* 
7035
7036 @subsubsection occt_2142243456_18669311358104  XGetLayers
7037
7038 Syntax:      XGetLayers document {shape|label} 
7039
7040 Returns names of layers, which are pointed to by links of an indicated shape. 
7041 **Example:**
7042
7043 XGetLayers D 0:1:1:3 
7044 == *bolt* *123* 
7045
7046 @subsubsection occt_2142243456_18669311358105  XGetOneLayer
7047
7048 Syntax:      XGetOneLayer document label 
7049
7050 Prints the name of a layer at a given label. 
7051 **Example:**
7052
7053 XGetOneLayer D 0:1:3:2 
7054
7055 @subsubsection occt_2142243456_18669311358106  XIsVisible
7056
7057 Syntax:      XIsVisible document {label|layer} 
7058
7059 Returns 1 if the indicated layer is visible, else returns 0. 
7060 **Example:**
7061
7062 XIsVisible D 0:1:3:1 
7063
7064 @subsubsection occt_2142243456_18669311358107  XRemoveAllLayers
7065
7066 Syntax:      XRemoveAllLayers document 
7067
7068 Removes all layers from an XCAF document. 
7069 **Example:**
7070
7071 XRemoveAllLayers D 
7072
7073 @subsubsection occt_2142243456_18669311358108  XRemoveLayer
7074
7075 Syntax:      XRemoveLayer document {label|layer} 
7076
7077 Removes the indicated layer from an XCAF document. 
7078 **Example:**
7079
7080 XRemoveLayer D layer2 
7081
7082 @subsubsection occt_2142243456_18669311358109  XSetLayer
7083
7084 Syntax:      XSetLayer document {shape|label} layer 
7085                   [shape_in_one_layer {0|1}] 
7086
7087 Sets a reference between a shape and a layer (adds a layer if it is necessary). 
7088 Parameter shape_in_one_layer shows whether a shape could be in a number of layers or only in one (0 by default). 
7089 **Example:**
7090
7091 XSetLayer D 0:1:1:2 layer2 
7092
7093 @subsubsection occt_2142243456_186693113581010  XSetVisibility
7094
7095 Syntax:      XSetVisibility document {label|layer} isvisible {0|1} 
7096
7097 Sets the visibility of a layer. 
7098 **Example:**
7099
7100 # set layer at label 0:1:3:2 as invisible 
7101 XSetVisibility D 0:1:3:2 0 
7102
7103 @subsubsection occt_2142243456_186693113581011  XUnSetAllLayers
7104
7105 Syntax:      XUnSetAllLayers document {label|shape} 
7106
7107 Unsets a shape from all layers. 
7108 **Example:**
7109
7110 XUnSetAllLayers D 0:1:1:2 
7111
7112 @subsubsection occt_2142243456_186693113581012  XUnSetLayer
7113
7114 Syntax:      XUnSetLayer document {label|shape} layer 
7115
7116 Unsets a shape from the indicated layer. 
7117 **Example:**
7118
7119 XUnSetLayer D 0:1:1:2 layer1 
7120
7121
7122 @subsection occt_2142243456_1866931135811  XDE property’s commands 
7123
7124 @subsubsection occt_2142243456_18669311358111  XCheckProps
7125
7126 Syntax:      XCheckProps document [ {0|deflection} [shape|label] ] 
7127
7128 Gets properties for a given shape (volume, area and centroid) 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 treated as a deflection. If the deflection is positive the computation is done by triangulations, if it is negative – meshing is forced. 
7129 **Example:**
7130
7131 # check properties for shapes at label 0:1:1:1 from 
7132 # document using standard Open CASCADE Technology tools 
7133 XCheckProps D 0 0:1:1:1 
7134 == Label 0:1:1:1      ;L-BRACKET* 
7135 ==  Area defect:        -0.0 (  0%) 
7136 ==  Volume defect:       0.0 (  0%) 
7137 ==  CG defect: dX=-0.000, dY=0.000, dZ=0.000 
7138
7139 @subsubsection occt_2142243456_18669311358112  XGetArea
7140
7141 Syntax:      XGetArea document {shape|label} 
7142
7143 Returns the area of a given shape. 
7144 **Example:**
7145
7146 XGetArea D 0:1:1:1 
7147 == 24628.31815094999 
7148
7149 @subsubsection occt_2142243456_18669311358113  XGetCentroid
7150
7151 Syntax:      XGetCentroid document {shape|label} 
7152
7153 Returns the center of gravity coordinates of a given shape. 
7154 **Example:**
7155
7156 XGetCentroid D 0:1:1:1 
7157
7158 @subsubsection occt_2142243456_18669311358114  XGetVolume
7159
7160 Syntax:      XGetVolume document {shape|label} 
7161
7162 Returns the volume of a given shape. 
7163 **Example:**
7164
7165 XGetVolume D 0:1:1:1 
7166
7167 @subsubsection occt_2142243456_18669311358115  XSetArea
7168
7169 Syntax:      XSetArea document {shape|label} area 
7170
7171 Sets new area to attribute list ??? given shape. 
7172 **Example:**
7173
7174 XSetArea D 0:1:1:1 2233.99 
7175
7176 @subsubsection occt_2142243456_18669311358116  XSetCentroid
7177
7178 Syntax:      XSetCentroid document {shape|label} x y z 
7179
7180 Sets new center of gravity  to the attribute list ??? given shape. 
7181 **Example:**
7182
7183 XSetCentroid D 0:1:1:1 0. 0. 100. 
7184
7185 @subsubsection occt_2142243456_18669311358117  XSetMaterial
7186
7187 Syntax:      XSetMaterial document {shape|label} name 
7188                   density(g/cu sm) 
7189
7190 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 agiven shape or a given label. The last parameter sets the density of a pointed material. 
7191 **Example:**
7192
7193 XSetMaterial D 0:1:1:1 Titanium 8899.77 
7194
7195 @subsubsection occt_2142243456_18669311358118  XSetVolume
7196
7197 Syntax:      XSetVolume document {shape|label} volume 
7198
7199 Sets new volume to the attribute list ??? given shape. 
7200 **Example:**
7201
7202 XSetVolume D 0:1:1:1 444555.33 
7203
7204 @subsubsection occt_2142243456_18669311358119  XShapeMassProps
7205
7206 Syntax:      XShapeMassProps document [ deflection [{shape|label}] ] 
7207
7208 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. 
7209 **Example:**
7210
7211 XShapeMassProps D 
7212 == Shape from label : 0:1:1:1 
7213 == Mass = 193.71681469282299 
7214 == CenterOfGravity X = 14.594564763807696,Y = 
7215     20.20271885211281,Z = 49.999999385313245 
7216 == Shape from label : 0:1:1:2 not have a mass 
7217 etc. 
7218
7219 @subsubsection occt_2142243456_186693113581110  XShapeVolume
7220
7221 Syntax:      XShapeVolume shape deflection 
7222
7223 Calculates the real volume of a pointed shape with a given deflection. 
7224 **Example:**
7225
7226 XShapeVolume a 0 
7227
7228 @section occt_2142243456_1672096717 Shape Healing commands
7229
7230
7231
7232 @subsection occt_2142243456_16720967171 General commands 
7233
7234 @subsubsection occt_2142243456_1672096717111 bsplres
7235
7236 Syntax:      bsplres result shape tol3d tol2d reqdegree reqnbsegments continuity3d continuity2d PriorDeg RationalConvert 
7237
7238 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). 
7239
7240 @subsubsection occt_2142243456_1672096717112 checkfclass2d
7241
7242 Syntax:      checkfclass2d face ucoord vcoord 
7243
7244 Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds. 
7245 **Example:**
7246
7247 checkfclass2d f 10.5 1.1 
7248 == Point is OUT 
7249
7250 @subsubsection occt_2142243456_1672096717113 checkoverlapedges
7251
7252 Syntax:      checkoverlapedges edge1 edge2 [toler domaindist] 
7253
7254 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. 
7255 **Example:**
7256
7257 checkoverlapedges e1 e2 
7258
7259 @subsubsection occt_2142243456_1672096717114 comtol
7260
7261 Syntax:      comptol shape [nbpoints] [prefix] 
7262
7263 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. 
7264 **Example:** 
7265     
7266 comptol h 871 t 
7267
7268 == Edges tolerance computed by 871 points: 
7269 == MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009 
7270     MIN=0 
7271 == Relation real tolerance / tolerance set in edge 
7272 == MAX=0.80001130696523448 AVG=0.06349345591805905 MIN=0 
7273 == Edge with max tolerance saved to t_edge_tol 
7274 == Concerned faces saved to shapes t_1, t_2 
7275
7276
7277 @subsubsection occt_2142243456_1672096717115 convtorevol
7278
7279 Syntax:      convtorevol result shape 
7280
7281 Converts all elementary surfaces of a given shape into surfaces of revolution. 
7282 Results are put into the shape, which is given as theresult parameter. 
7283 **Example:**
7284
7285 convtorevol r a 
7286
7287 @subsubsection occt_2142243456_1672096717116 directfaces
7288
7289 Syntax:      directfaces result shape 
7290
7291 Converts indirect surfaces and returns the results into the shape, which is given as the result parameter. 
7292 **Example:**
7293
7294 directfaces r a 
7295
7296 @subsubsection occt_2142243456_1672096717117 expshape
7297
7298 Syntax:   expshape shape maxdegree maxseg 
7299
7300 Gives statistics for a given shape. This test command is working with Bezier and BSpline entities. 
7301 **Example:**
7302
7303 expshape a 10 10 
7304 == Number of Rational Bspline curves 128 
7305 == Number of Rational Bspline pcurves 48 
7306
7307 @subsubsection occt_2142243456_1672096717118 fixsmall
7308
7309 Syntax:      fixsmall result shape [toler=1.] 
7310
7311 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. 
7312 **Example:**
7313
7314 fixsmall r a 0.1 
7315
7316 @subsubsection occt_2142243456_1672096717119 fixsmalledges
7317
7318 Syntax:      fixsmalledges result shape [toler mode maxangle] 
7319
7320 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 mode 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 maxangle 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. 
7321 **Example:**
7322
7323 fixsmalledges r a 0.1 1 
7324
7325 @subsubsection occt_2142243456_16720967171110 fixshape
7326
7327 Syntax:      fixshape result shape [preci [maxpreci]] [{switches}] 
7328
7329 Performs fixes of all sub-shapes (such as Solids, Shells, Faces, Wires and Edges) of a given shape. Parameter preci sets a basic precision value, maxpreci sets the maximal allowed tolerance. Results are put into the shape, which is given as parameter result. 
7330 {switches} allows to tune parameters of ShapeFix 
7331 The following syntax is used: symbolparameter 
7332 - symbol may be - to set parameter off, + to set on or  * to set default 
7333 - parameters are identified by letters: 
7334 l - FixLackingMode 
7335 o - FixOrientationMode 
7336 h - FixShiftedMode 
7337 m - FixMissingSeamMode 
7338 d - FixDegeneratedMode 
7339 s - FixSmallMode 
7340 i - FixSelfIntersectionMode 
7341 n - FixNotchedEdgesMode 
7342 For enhanced message output, use switch '+?' 
7343 **Example:**
7344
7345 fixshape r a 0.001 
7346
7347 @subsubsection occt_2142243456_16720967171111 fixwgaps
7348
7349 Syntax:      fixwgaps result shape [toler=0] 
7350
7351 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. 
7352 **Example:**
7353
7354 fixwgaps r a 
7355
7356 @subsubsection occt_2142243456_16720967171112 offsetcurve, offset2dcurve
7357
7358 Syntax:      offsetcurve result curve offset direction(as point) 
7359                   offset2dcurve result curve offset 
7360
7361 Both commands are intended to create a new offset curve by copying the given curve to distance, given by parameter offset. Parameter direction 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 result.  **offsetcurve **works with the curve in 3d space, **offset2dcurve **in 2d space accordingly. 
7362 **Example:**
7363
7364 point pp 10 10 10 
7365 offsetcurve r c 20 pp 
7366
7367 @subsubsection occt_2142243456_16720967171113 projcurve
7368
7369 Syntax:      projcurve edge|curve3d|curve3d first last  X Y Z 
7370
7371 **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. 
7372 **Example:** 
7373     
7374 projcurve k_1 0 1 5 
7375 ==Edge k_1 Params from 0 to 1.3 
7376 ==Precision (BRepBuilderAPI) : 9.9999999999999995e-008  ==Projection : 0  1  5 
7377 ==Result : 0  1.1000000000000001  0 
7378 ==Param = -0.20000000000000001  Gap = 5.0009999000199947 
7379
7380
7381 @subsubsection occt_2142243456_16720967171114 projface
7382
7383 Syntax:      projface face X Y [Z] 
7384
7385 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. 
7386 **Example:**
7387
7388 projface a_1 10.0 0.0 
7389 ==  Point UV  U = 10  V = 0 
7390 ==   =   proj  X = -116  Y = -45  Z = 0 
7391
7392 @subsubsection occt_2142243456_16720967171115 scaleshape
7393
7394 Syntax:   scaleshape result shape scale 
7395
7396 **Example:**
7397
7398 scaleshape r a_1 0.8 
7399
7400 @subsubsection occt_2142243456_16720967171116 settolerance
7401
7402 Syntax:      settolerance shape [mode=v-e-w-f-a] val(fix value) or 
7403                    tolmin tolmax 
7404
7405 Sets new values of tolerance for a given shape. If the given second parameter (mode) is given, then the atolerance value is set only for these sub shapes. 
7406 **Example:**
7407
7408 settolerance a 0.001 
7409
7410 @subsubsection occt_2142243456_16720967171117 splitface
7411
7412 Syntax:      splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...] 
7413
7414 Splits a given face in parametric space and puts the result into the given parameter result. 
7415 Returns the status of split face. 
7416 **Example:**
7417
7418 # split face f by parameter u = 5 
7419 splitface r f u 5 
7420 == Splitting by   U:   ,5 
7421 == Status:  DONE1 
7422
7423 @subsubsection occt_2142243456_16720967171118 statshape
7424
7425 Syntax:      statshape shape [particul] 
7426
7427 Returns the number of sub-shapes, which compose the given shape. For example, the number of solids, number of faces etc.  It also returns the number of geometrical objects or sub-shapes with a specified type, example, number of free faces, number of C0 surfaces. The last parameter becomes out of date. 
7428 **Example:**
7429
7430 statshape a 
7431 == Count     Item 
7432 == -----     ---- 
7433 == 402     Edge (oriented) 
7434 == 402     Edge (Shared) 
7435 == 74      Face 
7436 == 74      Face (Free) 
7437 == 804     Vertex (Oriented) 
7438 == 402     Vertex (Shared) 
7439 == 78      Wire 
7440 == 4      Face with more than one wire 
7441 == 34     bspsur: BSplineSurface 
7442
7443 @subsubsection occt_2142243456_16720967171119 tolerance
7444
7445 Syntax:      tolerance shape [mode:D v e f c] [tolmin tolmax:real] 
7446
7447 Returns tolerance (maximal, avg and minimal values)  of all given shapes and tolerance of their Faces, Edges and Vertices. If parameter tolmin or tolmax 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 (all shapes (D) (v) vertices (e) edges (f) faces (c) combined (faces)) is given as the second parameter then only this group will be analyzed for tolerance. 
7448 **Example:**
7449
7450 tolerance a 
7451 == Tolerance MAX=0.31512672416608001 AVG=0.14901359484722074 MIN=9.9999999999999995e-08 
7452 == FACE    : MAX=9.9999999999999995e-08 AVG=9.9999999999999995e-08 MIN=9.9999999999999995e-08 
7453 == EDGE    : MAX=0.31512672416608001 AVG=0.098691334511810405 MIN=9.9999999999999995e-08 
7454 == VERTEX  : MAX=0.31512672416608001 AVG=0.189076074499648 MIN=9.9999999999999995e-08 
7455
7456 tolerance a v 0.1 0.001 
7457 ==  Analysing Vertices gives 6 Shapes between tol1=0.10000000000000001 and tol2=0.001 , named tol_1 to tol_6 
7458
7459
7460
7461 @subsection occt_2142243456_16720967172 Convertion commands 
7462 More detailed information about using here classes can be found into Shape Healing documentation. All this commands are created for testing. 
7463
7464 @subsubsection occt_2142243456_1672096717121 DT_ClosedSplit
7465
7466 Syntax:      DT_ClosedSplit result shape 
7467
7468 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. 
7469 Note: Closed face – it’s face with one or more seam. 
7470 **Example:**
7471
7472 DT_ClosetSplit r a 
7473
7474 @subsubsection occt_2142243456_1672096717122 DT_ShapeConvert, DT_ShapeConvertRev
7475
7476 Syntax:      DT_ShapeConvert result shape convert2d convert3d 
7477                   DT_ShapeConvertRev result shape convert2d convert3d 
7478
7479 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. 
7480 **Example:**
7481
7482 DT_ShapeConvert r a 1 1 
7483 == Status: DONE1 
7484
7485 @subsubsection occt_2142243456_1672096717123 DT_ShapeDivide
7486
7487 Syntax:      DT_ShapeDivide result shape tol 
7488
7489 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: 
7490 OK      : no splitting was done 
7491 Done1 : Some edges were split 
7492 Done2 : Surface was split 
7493 Fail1    : Some errors occurred 
7494 **Example:**
7495
7496 DT_ShapeDivide r a 0.001 
7497 == Status: OK 
7498
7499 @subsubsection occt_2142243456_1672096717124 DT_SplitAngle
7500
7501 Syntax:      DT_SplitAngle result shape [MaxAngle=95] 
7502
7503 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. 
7504 This command illustrates how class ShapeUpgrade_ShapeDivideAngle works. 
7505 **Example:**
7506
7507 DT_SplitAngle r a 
7508 == Status: DONE2 
7509
7510 @subsubsection occt_2142243456_1672096717125 DT_SplitCurve
7511
7512 Syntax:      DT_SplitCurve curve tol split(0|1) 
7513
7514 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. 
7515 **Example:**
7516
7517 DT_SplitCurve r c 
7518
7519 @subsubsection occt_2142243456_1672096717126 DT_SplitCurve2d
7520
7521 Syntax:      DT_SplitCurve2d Curve Tol Split(0/1) 
7522
7523 Works just as DT_SplitCurve (see above), only with 2d curve. 
7524 **Example:**
7525
7526 DT_SplitCurve2d r c 
7527
7528 @subsubsection occt_2142243456_1672096717127 DT_SplitSurface
7529
7530 Syntax:      DT_SplitSurface result Surface|GridSurf tol split(0|1) 
7531
7532 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. 
7533 **Example:** 
7534     
7535
7536 ~~~~~
7537 # split surface with name "su"
7538 DT_SplitSurface res su 0.1 1 
7539 == single surf 
7540 == appel a SplitSurface::Init 
7541 == appel a SplitSurface::Build 
7542 == appel a SplitSurface::GlobalU/VKnots 
7543 == nb GlobalU;nb GlobalV=7 2 0 1 2 3 4 5 6.2831853072 0 1 
7544 == appel a Surfaces 
7545 == transfert resultat 
7546 == res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1 
7547 ~~~~~
7548
7549 @subsubsection occt_2142243456_1672096717128 DT_ToBspl
7550
7551 Syntax:      DT_ToBspl result shape 
7552
7553 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. 
7554 **Example:** 
7555     
7556 DT_ToBspl res sh 
7557 == error = 5.20375663162094e-08   spans = 10 
7558 ==  Surface is aproximated with continuity 2 
7559
7560 @section occt_draw_commands_perf Performance evaluation commands
7561
7562
7563 @subsection occt_draw_commands_perf_vdrawsphere VDrawSphere
7564
7565 Syntax:      vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0] 
7566
7567 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. 
7568
7569 This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter. 
7570 **Example:** 
7571
7572 vdrawsphere s 200 1 1 1 500 1 == Compute Triangulation... == NumberOfPoints: 39602 == NumberOfTriangles: 79200 == Amount of memory required for PolyTriangulation without Normals: 2 Mb == Amount of memory for colors: 0 Mb == Amount of memory for PolyConnect: 1 Mb == Amount of graphic card memory required: 2 Mb == Number of scene redrawings: 1 == CPU user time: 15.6000999999998950 msec == CPU system time: 0.0000000000000000 msec == CPU average time of scene redrawing: 15.6000999999998950 msec 
7573
7574
7575
7576 @section occt_2142243456_713659999 Extending Test Harness with custom commands
7577
7578
7579 The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism. 
7580
7581
7582 @subsection occt_2142243456_7136599991 Custom command implementation
7583
7584 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. 
7585 **Example:** 
7586
7587 ~~~~~
7588 static Standard_Integer myadvcurve(Draw_Interpretor&amp; di, 
7589 Standard_Integer n, 
7590 char** a) 
7591
7592 ... 
7593
7594 ~~~~~
7595
7596 For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx). 
7597
7598
7599 @subsection occt_2142243456_7136599992 Registration of commands in Test Harness
7600
7601 To become available in the Test Harness the custom command must be registered in it. This should be done as follows. 
7602 **Example:** 
7603
7604 ~~~~~
7605 void MyPack::CurveCommands(Draw_Interpretor&amp; theCommands) 
7606
7607 ... 
7608 char* g = ;Advanced curves creation;; 
7609
7610
7611                   theCommands.Add ( ;myadvcurve;, ;myadvcurve name p1 p2 p3 – 
7612                               Creates my advanced curve from points;, 
7613 __FILE__, myadvcurve, g); 
7614 ... 
7615
7616 ~~~~~
7617
7618 @subsection occt_2142243456_7136599993 Creating a toolkit (library) as a plug-in
7619
7620 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. 
7621 This exported function PLUGINFACTORY() must be implemented only once per library. 
7622 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. 
7623 **Example:** 
7624
7625 #include Draw_PluginMacro.hxx 
7626
7627 void MyPack::Factory(Draw_Interpretor&amp; theDI) 
7628
7629 ... 
7630 // 
7631 MyPack::CurveCommands(theDI); 
7632 ... 
7633
7634
7635 // Declare entry point PLUGINFACTORY 
7636 DPLUGIN(MyPack) 
7637
7638
7639 @subsection occt_2142243456_7136599994 Creation of the plug-in resource file
7640
7641 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 (;:;). 
7642 For every created plug-in there must be a key. For better readability and comprehension it is recommended to have some meaningful name. 
7643 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. 
7644 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. 
7645 **Examples** (file MyDrawPlugin): 
7646
7647 ! Hierarchy of plug-ins 
7648 ALL                : ADVMODELING, MESHING 
7649 DEFAULT            : MESHING 
7650 ADVMODELING        : ADVSURF, ADVCURV 
7651
7652 ! Mapping from naming to toolkits (libraries) 
7653 ADVSURF            : TKMyAdvSurf 
7654 ADVCURV            : TKMyAdvCurv 
7655 MESHING            : TKMyMesh 
7656
7657
7658 For other examples of the plug-in resource file refer to the *;Plug-in resource file;* chapter above or to the $CASROOT/src/DrawPlugin file shipped with Open CASCADE Technology. 
7659
7660
7661 @subsection occt_2142243456_7136599995 Dynamic loading and activation
7662
7663 Loading a plug-in and activating its commands is described in the *;Activation of the commands implemented in the plug-in;* chapter. 
7664
7665 The procedure consists in defining the system variables and using the pload commands in the Test Harness session. 
7666
7667 **Example:** 
7668
7669 ~~~~
7670     Draw[] set env(CSF_MyDrawPluginDefaults) /users/test 
7671 ~~~~
7672