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