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