1 Draw Test Harness {#user_guides__test_harness}
2 ===============================
4 @section occt_2142243456_1775316760 Introduction
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>
8 Draw is a command interpreter based on TCL and a graphical system used to test and demonstrate Open CASCADE Technology modeling libraries.
11 @subsection occt_2142243456_17753167601 Overview
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.
15 Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
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.
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.
28 There is also a set of commands for each delivery unit in the modeling libraries:
30 GEOMETRY, TOPOLOGY, ADVALGOS, GRAPHIC, PRESENTATION.
33 @subsection occt_2142243456_17753167602 Contents of this documentation
35 This documentation describes:
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.
43 This document does not describe other sets of commands and does not explain how to extend Draw using C++.
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.
51 Terminates the Draw, TCL session. If the commands are read from a file using the source command, this will terminate the file.
55 # this is a very short example
60 @subsection occt_2142243456_17753167603 Getting started
62 Install Draw and launch Emacs. Get a command line in Emacs using *Esc x *and key in *woksh*.
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**.
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.
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.
72 @subsubsection occt_2142243456_177531676031 Launching DRAW Test Harness
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.
77 @subsubsection occt_2142243456_177531676032 Plug-in resource file
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).
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
91 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93 @subsubsection occt_2142243456_177531676033 Activation of commands implemented in the plug-in
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:
97 pload [-PluginFileName] [[Key1] [Key2]...], where:
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.
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.
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.
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.
114 @subsubsection occt_2142243456_177531676034 Mapping between former separate Test Harness executables and the new plug-ins
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.
119 For instance, in order to activate commands available in the former AISViewer executable, now it is enough to use the command pload VISUALIZATION.
121 When you have the tclsh prompt, key in the library references:
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:
127 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
128 # create two views, one 2d the other axonometric. Use either the command line or the Draw taskbar (*Views/av2d*).
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
136 ==***** Dump of c *****
138 ==Parameters : 0 1.5707963267949
145 # make a 3d circle from it, and turn it into a bspline
148 Draw[8] convert c2 c1
150 ***** Dump of c2 *****
151 BSplineCurve rational
152 Degree 2, 3 Poles, 2 Knots
155 2 : 5, 5, 0 0.707106781186548
156 3 : 3.06161699786838e-16, 5, 0 1
159 2 : 1.5707963267949 3
161 # make a surface of revolution from the spline
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
173 # make a bspline surface and intersect with a plane
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
184 Draw[27] rename c_1 c
186 # save the curve, use datadir (p. 32) to specify the
187 directory you want to save your file in.
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
198 @subsection occt_2142243456_16685307294 Overview
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.
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:
204 * Syntax of the TCL language.
205 * Accessing variables in TCL and Draw.
206 * Control structures.
209 @subsection occt_2142243456_16685307295 Syntax of TCL
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.
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.
215 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
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.
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.
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.
226 The following substitutions are performed by TCL:
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.
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
231 # set a variable value
232 set file documentation
233 puts $file #to display file contents on the screen
235 # a simple substitution, set psfile to documentation.ps
239 # another substitution, set pfile to documentationPS
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.
250 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
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.
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 ; ;.
262 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
263 # set msg to ;the price is 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.
269 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
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
281 # the following cannot be written
282 # because while requires two arguments
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.
290 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
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.
299 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300 # I want to delete two files
304 # this will fail because rm will receive only one argument
305 # and complain that ;foo bar; does not exit
309 # a second evaluation will do it
310 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312 @subsection occt_2142243456_16685307296 Accessing variables in TCL and Draw
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.
316 TCL provides a mechanism to link user data to variables. Using this functionality, Draw defines its variables as TCL variables with associated data.
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.
320 There are many kinds of Draw variables, and new ones may be added with C++. Geometric and topological variables are described below.
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.
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.
333 @subsubsection occt_2142243456_166853072961 set, unset
335 Syntax: set varname [value]
336 unset varname [varname varname ...]
338 **set **assigns a string value to a variable. If the variable does not already exist, it is ñreated.
340 Without a value, **set **returns the content of the variable.
342 **unset **deletes variables. It is is also used to delete Draw variables.
344 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
351 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
354 *The set command can set only one variable, unlike the dset command.*
357 See also: **dset**, **dval**
360 @subsubsection occt_2142243456_166853072962 dset, dval
362 Syntax dset var1 value1 vr2 value2 ...
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.
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.
369 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
374 # no $ required for Draw commands
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.*
384 See also: **set**, **unset**
388 @subsection occt_2142243456_16685307297 lists
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.
392 This allows you to insert lists within lists.
394 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
395 # a list of 3 strings
398 # a list of two strings the first is a list of 2
400 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401 Many TCL commands return lists and **foreach **is a useful way to create loops on list elements.
403 @subsubsection occt_2142243456_166853072971 Control Structures
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:
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.
411 @subsubsection occt_2142243456_166853072911 if
413 Syntax if condition script [elseif script .... else script]
415 **If **evaluates the condition and the script to see whether the condition is true.
417 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
425 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 @subsubsection occt_2142243456_166853072912 while, for, foreach
429 Syntax: while condition script
430 for init condition reinit script
431 foreach varname list script
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.
435 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
438 while {[dval x] 100} {
443 # incr var d, increments a variable of d (default 1)
444 for {set i 0} {$i 10} {incr i} {
446 point p$i cos(angle0 sin(angle) 0
449 foreach object {crapo tomson lucas} {display $object}
450 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
451 See also: **break**, **continue**
454 @subsubsection occt_2142243456_166853072913 break, continue
459 Within loops, the **break **and **continue **commands have the same effect as in C.
461 **break **interrupts the innermost loop and **continue **jumps to the next iteration.
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;
468 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
469 @subsection occt_2142243456_16685307292 Procedures
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.
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.
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.
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.
480 @subsubsection occt_2142243456_166853072921 proc
482 Syntax: proc argumentlist script
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.
486 **return **gives a return value to the procedure.
488 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
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)]
499 if {$n == 0} {return 1} else {
500 return [expr n*[fact [expr n -1]]]
503 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
504 See also: **global**, **upvar**
507 @subsubsection occt_2142243456_166853072922 global, upvar
509 Syntax: global varname [varname ...]
510 upvar varname localname [varname localname ...]
512 **global **accesses high level variables. Unlike C, global variables are not visible in procedures.
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.
517 *Note in the following examplesthat the $ character is always*
518 *necessarily used to access the arguments.*
520 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
521 # convert degree to radian
522 # pi is a global variable
523 proc deg2rad (degree} {
524 return [dval pi*$degree/2.]
526 # create line with a point and an angle
527 proc linang {linename x y angle} {
529 line l $x $y cos($angle) sin($angle)
531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
533 @section occt_2142243456_967049381 Basic Commands
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:
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.
542 Note that Draw also features a GUI taskbar providing an alternative way to give certain general, graphic and display commands
546 @subsection occt_2142243456_9670493811 General commands
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.
551 @subsubsection occt_2142243456_96704938111 help
553 Syntax: help [command [helpstring group]]
555 Provides help or modifies the help information.
557 **help **without arguments lists all groups and the commands in each group.
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.
561 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
562 # Gives help on all commands starting with *a*
563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
564 @subsubsection occt_2142243456_96704938112 source
566 Syntax: source filename
570 The **exit **command will terminate the file.
575 @subsubsection occt_2142243456_96704938113 spy
577 Syntax: spy [filename]
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.
582 The file created by **spy **can be executed with the **source **command.
584 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
585 # all commands will be saved in the file ;session;
587 # the file ;session; is closed and commands are not saved
589 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
593 @subsubsection occt_2142243456_96704938114 cpulimit
595 Syntax: cpulimit [nbseconds]
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.
599 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
600 #limit cpu to one hour
602 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
604 @subsubsection occt_2142243456_96704938115 wait
606 Syntax: wait [nbseconds]
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.
612 # You have ten seconds ...
615 @subsubsection occt_2142243456_96704938116 chrono
617 Syntax: chrono [ name start/stop/reset/show]
619 Without arguments, **chrono **activates Draw chronometers. The elapsed time ,cpu system and cpu user times for each command will be printed.
621 With arguments, **chrono **is used to manage activated chronometers. You can perform the following actions with a chronometer.
623 * run the chronometer (start).
624 * stop the chronometer (stop).
625 * reset the chronometer to 0 (reset).
626 * display the current time (show).
629 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
631 ==Chronometers activated.
633 ==Elapsed time: 0 Hours 0 Minutes 0.0318 Seconds
634 ==CPU user time: 0.01 seconds
635 ==CPU system time: 0 seconds
636 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
638 @subsection occt_2142243456_9670493812 Variable management commands
640 @subsubsection occt_2142243456_96704938121 isdraw, directory
642 Syntax: isdraw varname
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.
649 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
662 # to destroy all Draw objects with name containing curve
663 foreach var [directory *curve*] {unset $var}
664 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
668 @subsubsection occt_2142243456_96704938122 whatis, dump
670 Syntax: whatis varname [varname ...]
671 dump varname [varname ...]
673 **whatis **returns short information about a Draw variable. This is usually the type name.
675 **dump **returns a brief type description, the coordinates, and if need be, the parameters of a Draw variable.
678 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
685 ***** Dump of c *****
691 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
693 *The behavior of whatis on other variables (not Draw) is not*
697 @subsubsection occt_2142243456_96704938123 rename, copy
699 Syntax: rename varname tovarname [varname tovarname ...]
700 copy varname tovarname [varname tovarname ...]
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.
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.
706 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
710 # curves are copied, c2 will not be modified
712 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
714 @subsubsection occt_2142243456_96704938124 datadir, save, restore
716 Syntax: datadir [directory]
717 save variable [filename]
718 restore filename [variablename]
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.
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.
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.
728 The exact content of the file is type-dependent. They are usually ASCII files and so, architecture independent.
730 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
731 # note how TCL accesses shell environment variables
736 datadir $env(WBCONTAINER)/data/default
737 ==/adv_20/BAG/data/default
741 ==/adv_20/BAG/data/default/theBox
743 # when TCL does not find a command it tries a shell command
749 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
750 @subsection occt_2142243456_9670493813 User defined commands
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.
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.
756 @subsubsection occt_2142243456_96704938131 set
758 **DrawTrSurf Package:**
761 void Set(Standard_CString& Name,const gp_Pnt& G) ;
762 void Set(Standard_CString& Name,const gp_Pnt2d& G) ;
763 void Set(Standard_CString& Name,
764 const Handle(Geom_Geometry)& G) ;
765 void Set(Standard_CString& Name,
766 const Handle(Geom2d_Curve)& C) ;
767 void Set(Standard_CString& Name,
768 const Handle(Poly_Triangulation)& T) ;
769 void Set(Standard_CString& Name,
770 const Handle(Poly_Polygon3D)& P) ;
771 void Set(Standard_CString& Name,
772 const Handle(Poly_Polygon2D)& P) ;
777 void Set(const Standard_CString Name,
778 const TopoDS_Shape& S) ;
780 **Example: DrawTrSurf**
782 Handle(Geom2d_Circle) C1 = new Geom2d_Circle
783 (gce_MakeCirc2d (gp_Pnt2d(50,0,) 25));
784 DrawTrSurf::Set(char*, C1);
789 B = BRepPrimAPI_MakeBox (10,10,10);
794 @subsubsection occt_2142243456_96704938132 get
796 **DrawTrSurf Package:**
799 Handle_Geom_Geometry Get(Standard_CString& Name) ;
804 TopoDS_Shape Get(Standard_CString& Name,
805 const TopAbs_ShapeEnum Typ = TopAbs_SHAPE,
806 const Standard_Boolean Complain
808 **Example: DrawTrSurf**
810 Standard_Integer MyCommand
811 (Draw_Interpretor& theCommands,
812 Standard_Integer argc, char** argv)
814 // Creation of a Geom_Geometry from a Draw geometric
816 Handle (Geom_Geometry) aGeom= DrawTrSurf::Get(argv[1]);
821 Standard_Integer MyCommand
822 (Draw_Interpretor& theCommands,
823 Standard_Integer argc, char** argv)
825 // Creation of a TopoDS_Shape from a Draw topological
827 TopoDS_Solid B = DBRep::Get(argv[1]);
831 @section occt_2142243456_445622066 Graphic Commands
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.
835 @subsection occt_2142243456_4456220661 Axonometric viewer
837 @subsubsection occt_2142243456_44562206611 view, delete
839 Syntax: view index type [X Y W H]
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.
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..
846 **delete **deletes a view. If no index is given, all the views are deleted.
848 Type selects from the following range:
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.
855 The index, the type, the current zoom are displayed in the window title .
857 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
858 # this is the content of the mu4 procedure
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
866 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
867 See also: **axo, pers, top, bottom, left, right, front, back, mu4, v2d, av2d, smallview**
869 @subsubsection occt_2142243456_44562206612 axo, pers, top, ...
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.
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.
886 See also: **view**, **delete**
889 @subsubsection occt_2142243456_44562206613 mu, md, 2dmu, 2dmd, zoom, 2dzoom
891 Syntax: mu [index] value
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.
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.
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.
907 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
915 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
916 See also: **fit**, **2dfit**
919 @subsubsection occt_2142243456_44562206614 pu, pd, pl, pr, 2dpu, 2dpd, 2dpl, 2dpr
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.
927 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
928 # you have selected one anonometric view
933 # you have selected an mu4 view; the object in the third
936 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
937 See also: **fit**, **2dfit**
940 @subsubsection occt_2142243456_44562206615 fit, 2dfit
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.
947 When fitting all views a unique zoom is computed for all the views. All views are on the same scale.
950 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
955 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
956 See also: **zoom**, **mu**, **pu**
959 @subsubsection occt_2142243456_44562206616 u, d, l, r
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.
969 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
972 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
974 @subsubsection occt_2142243456_44562206617 focal, fu, fd
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.
981 Use **fu **and **fd **to increase or decrease the focal value by 10%. **fd **makes the eye closer to the object.
983 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
986 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
988 *Do not use a negative or null focal value.*
993 @subsubsection occt_2142243456_44562206618 color
995 Syntax: color index name
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.
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.
1001 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1002 # change the value of blue
1004 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1006 *The color change will be visible on the next redraw of the*
1007 *views, for example after fit or mu, etc.*
1010 @subsubsection occt_2142243456_44562206619 dtext
1012 Syntax: dtext [x y [z]] string
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.
1016 The coordinates are real space coordinates.
1019 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1023 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1025 @subsubsection occt_2142243456_445622066110 hardcopy, hcolor, xwd
1027 Syntax: hardcopy [index]
1028 hcolor index width gray
1029 xwd [index] filename
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.
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.
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**.
1037 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1038 # all blue lines (color 3)
1039 # will be half-width and gray
1042 # make a postscript file and print it
1046 # make an xwd file and display it
1049 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1051 *When more than one view is present, specify the index of the view.*
1052 *Only use a postscript printer to print postscript files.*
1057 @subsubsection occt_2142243456_445622066111 wclick, pick
1060 pick index X Y Z b [nowait]
1062 **wclick **defers an event until the mouse button is clicked. The message ;just click; is displayed.
1064 Use the **pick **command to get graphic input. The arguments must be names for variables where the results are stored.
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.
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.
1072 This option is useful for tracking the pointer.
1075 *The results are stored in Draw numeric variables.*
1077 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1078 # make a circle at mouse location
1080 circle c x y z 0 0 1 1 0 0 0 30
1082 # make a dynamic circle at mouse location
1083 # stop when a button is clicked
1084 # (see the repaint command)
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
1092 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093 See also: **repaint**
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.
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.
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.
1105 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1106 # OK use dot to dump an object on the screen
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
1119 # would have displayed only one point
1120 # because the precedent variable content is erased
1123 # is an other solution, creating variables
1126 # give a name to a graphic object
1128 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1129 @subsubsection occt_2142243456_445622066112 autodisplay
1131 Syntax: autodisplay [0/1]
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.
1135 When **autodisplay **is off, using the dot return argument is ineffective.
1137 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1146 # c is erased, but not displayed
1148 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1149 See also: **display**
1151 @subsubsection occt_2142243456_445622066113 display, donly
1153 Syntax: display varname [varname ...]
1154 donly varname [varname ...]
1156 **display **makes objects visible.
1158 **donly **(*display only*) makes objects visible and erases all other objects. It is very useful to extract one object from a messy screen.
1160 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1161 # to see all objects
1162 foreach var [directory] {display $var}
1164 # to select two objects and erase the other ones
1166 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1170 @subsubsection occt_2142243456_445622066114 erase, clear, 2dclear
1172 Syntax: erase [varname varname ...]
1176 **erase **removes objects from all views. **erase **without arguments erases everything in 2d and 3d.
1178 **clear **erases only 3d objects and **2dclear, **only 2d objects. **erase **without arguments is similar to ; clear; 2dclear;.
1180 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1181 # erase eveerything with a name starting with c_
1182 foreach var [directory c_*] {erase $var}
1186 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1187 See also: **display**
1188 @subsubsection occt_2142243456_445622066115 repaint, dflush
1193 **repaint **forces repainting of views.
1195 **dflush **flushes the graphic buffers.
1197 These commands are useful within loops or in scripts.
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.
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.
1203 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1204 # See the example with the pick command
1205 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1208 @subsection occt_2142243456_4456220662 AIS viewer – view commands
1211 @subsubsection occt_2142243456_44562206621 vinit
1215 Creates the 3D viewer window
1217 @subsubsection occt_2142243456_44562206622 vhelp
1221 Displays help in the 3D viewer window. The help consists in a list of hotkeys and their functionalities.
1223 @subsubsection occt_2142243456_44562206623 vtop
1227 Displays top view in the 3D viewer window.
1229 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1235 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1236 @subsubsection occt_2142243456_44562206624 vaxo
1240 Displays axonometric view in the 3D viewer window.
1242 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1248 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1249 @subsubsection occt_2142243456_44562206625 vsetbg
1251 Syntax: vsetbg imagefile [filltype]
1253 Loads image file as background. **filltype** must be **NONE, CENTERED, TILED or STRETCH**.
1257 vsetbg myimage.brep CENTERED
1259 @subsubsection occt_2142243456_44562206626 vclear
1263 Removes all objects from the viewer.
1265 @subsubsection occt_2142243456_44562206627 vrepaint
1269 Forcedly redisplays the shape in the 3D viewer window.
1271 @subsubsection occt_2142243456_44562206628 vfit
1275 Automatic zoom/panning. Objects in the view are visualized to occupy the maximum surface.
1277 @subsubsection occt_2142243456_44562206629 vzfit
1281 Automatic depth panning. Objects in the view are visualized to occupy the maximum 3d space.
1284 @subsection occt_2142243456_4456220663 AIS viewer – display commands
1286 @subsubsection occt_2142243456_44562206631 vdisplay
1288 Syntax: vdisplay name1 [name2] … [name n]
1290 Displays named objects.
1294 box b 40 40 40 10 10 10
1300 @subsubsection occt_2142243456_44562206632 vdonly
1302 Syntax: vdonly [name1] … [name n]
1304 Displays only selected or named objects. If there are no selected or named objects, nothing is done.
1308 box b 40 40 40 10 10 10
1312 @subsubsection occt_2142243456_44562206633 vdisplayall
1316 Displays all created objects.
1320 box b 40 40 40 10 10 10
1324 @subsubsection occt_2142243456_44562206634 verase
1326 Syntax: verase [name1] [name2] … [name n]
1328 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
1332 box b1 40 40 40 10 10 10
1333 box b2 -40 -40 -40 10 10 10
1337 # erase only first box
1339 # erase second box and sphere
1341 @subsubsection occt_2142243456_44562206635 veraseall
1345 Erases all objects displayed in the viewer.
1348 box b1 40 40 40 10 10 10
1349 box b2 -40 -40 -40 10 10 10
1353 # erase only first box
1355 # erase second box and sphere
1358 @subsubsection occt_2142243456_44562206636 vsetdispmode
1360 Syntax: vsetdispmode [name] mode(0,1,2,3)
1362 Sets display mode for all, selected or named objects.
1363 **mode** is **0** (**WireFrame**), **1** (**Shading**), **2** (**Quick HideLineremoval**), **3** (**Exact HideLineremoval**).
1371 @subsubsection occt_2142243456_44562206637 vdisplaytype
1373 Syntax: vdisplaytype type
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**).
1378 @subsubsection occt_2142243456_44562206638 verasetype
1380 Syntax: verasetype type
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**).
1385 @subsubsection occt_2142243456_44562206639 vtypes
1389 Makes a list of known types and signatures in AIS.
1391 @subsubsection occt_2142243456_445622066310 vsetcolor
1393 Syntax: vsetcolor [shapename] colorname
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;**.
1400 @subsubsection occt_2142243456_445622066311 vunsetcolor
1402 Syntax: vunsetcolor [shapename]
1404 Sets default color for all, selected or named shapes.
1406 @subsubsection occt_2142243456_445622066312 vsettransparency
1408 Syntax: vsettransparency [shapename] coeficient
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.
1419 vsettransparency b 0.5
1421 @subsubsection occt_2142243456_445622066313 vunsettransparency
1423 Syntax: vunsettransparency [shapename]
1425 Sets default transparency (0.0) for all selected or named shapes.
1427 @subsubsection occt_2142243456_445622066314 vsetmaterial
1429 Syntax: vsetmaterial [shapename] materialname
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*.**
1442 @subsubsection occt_2142243456_445622066315 vunsetmaterial
1444 Syntax: vunsetmaterial [shapename]
1446 Sets default material for all selected or named shapes.
1448 @subsubsection occt_2142243456_445622066316 vsetwidth
1450 Syntax: vsetwidth [shapename] coeficient
1452 Sets width of the edges for all selected or named shapes.
1453 The **Coefficient** may be between 0.0 and 10.0.
1462 @subsubsection occt_2142243456_445622066317 vunsetwidth
1464 Syntax: vunsetwidth [shapename]
1466 Sets default width of edges (0.0) for all selected or named shapes.
1468 @subsubsection occt_2142243456_445622066318 vsetshading
1470 Syntax: vsetshading shapename [coefficient]
1472 Sets deflection coefficient that defines the quality of the shape’s representation in the shading mode. Default coefficient is 0.0008.
1481 @subsubsection occt_2142243456_445622066319 vunsetshading
1483 Syntax: vunsetshading [shapename]
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.
1487 @subsubsection occt_2142243456_445622066320 vsetam
1489 Syntax: vsetam [shapename] mode
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**.
1500 @subsubsection occt_2142243456_445622066321 vunsetam
1504 Deactivates all selection modes for all shapes.
1506 @subsubsection occt_2142243456_445622066322 vdump
1508 Syntax: vdump filename.{png|xwd|bmp}
1510 Extracts the contents of the viewer window to a png, XWD or BMP file.
1512 @subsubsection occt_2142243456_445622066323 vdir
1516 Displays the list of displayed objects.
1518 @subsubsection occt_2142243456_445622066324 vsub
1520 Syntax: vsub 0/1(on/off)[shapename]
1522 Hilights/unhilights named or selected objects which are displayed at neutral state with subintensity color.
1533 @subsubsection occt_2142243456_445622066325 vardis
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).
1539 @subsubsection occt_2142243456_445622066326 varera
1543 Erases active areas.
1545 @subsubsection occt_2142243456_445622066327 vsensdis
1549 Displays active entities (sensitive entities of one of the standard types corresponding to active selection modes).
1551 Standard entity types are those defined in Select3D package:
1558 * sensitive triangulation
1559 * sensitive triangle
1560 Custom (application-defined) sensitive entity types are not processed by this command.
1562 @subsubsection occt_2142243456_445622066328 vsensera
1566 Erases active entities.
1568 @subsubsection occt_2142243456_445622066329 vperf
1570 Syntax: vperf shapename 1/0 (Transformation/Loacation) 1/0 (Primitives sensibles ON/OFF)
1572 Tests the animation of an object along a predefined trajectory.
1582 @subsubsection occt_2142243456_445622066330 vr
1586 Reads shape from BREP-format file and displays it in the viewer.
1591 @subsubsection occt_2142243456_445622066330331 vstate
1593 Syntax: vstate [name1] … [name n]
1595 Makes a list of the status (**Displayed** or **Not Displayed**) of some selected or named objects.
1599 @subsection occt_2142243456_4456220663304 AIS viewer – object commands
1601 @subsubsection occt_2142243456_44562206633041 vtrihedron
1603 Syntax: vtrihedron name [X0] [Y0] [Z0] [Zu] [Zv] [Zw] [Xu] [Xv] [Xw]
1605 Creates a new AIS_Trihedron object. If no argument is set, the default trihedron (0XYZ) is created.
1611 @subsubsection occt_2142243456_44562206633042 vplanetri
1613 Syntax: vplanetri name
1615 Creates a plane from a trihedron selection.
1618 @subsubsection occt_2142243456_44562206633043 vsize
1620 Syntax: vsize [name] [size]
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.
1627 vtrihedron tr2 0 0 0 1 0 0 1 0 0
1630 @subsubsection occt_2142243456_44562206633044 vaxis
1632 Syntax: vaxis name [Xa Ya Za Xb Yb Zb]
1634 Creates an axis. If the values are not defined, an axis is created by interactive selection of two vertices or one edge
1639 vaxis axe1 0 0 0 1 0 0
1641 @subsubsection occt_2142243456_44562206633045 vaxispara
1643 Syntax: vaxispara nom
1645 Creates an axis by interactive selection of an edge and a vertex.
1647 @subsubsection occt_2142243456_44562206633046 vaxisortho
1649 Syntax: vaxisotrho name
1651 Creates an axis by interactive selection of an edge and a vertex. The axis will be orthogonal to the selected edge.
1653 @subsubsection occt_2142243456_44562206633047 vpoint
1655 Syntax: vpoint name [Xa Ya Za]
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).
1663 @subsubsection occt_2142243456_44562206633048 vplane
1665 Syntax: vplane name [AxisName] [PointName]
1666 vplane name [PointName] [PointName] [PointName]
1667 vplane name [PlaneName] [PointName]
1669 Creates a plane from named or interactively selected entities.
1674 vaxis axe1 0 0 0 0 0 1
1676 vplane plane1 axe1 p1
1678 @subsubsection occt_2142243456_44562206633049 vplanepara
1680 Syntax: vplanepara name
1682 Creates a plane from interactively selected vertex and face.
1684 @subsubsection occt_2142243456_445622066330410 vplaneortho
1686 Syntax: vplaneortho name
1688 Creates a plane from interactive selected face and coplanar edge.
1690 @subsubsection occt_2142243456_445622066330411 vline
1692 Syntax: vline name [PointName] [PointName]
1693 vline name [Xa Ya Za Xb Yb Zb]
1695 Creates a line from coordinates, named or interactively selected vertices.
1703 vline line2 0 0 0 50 0 1
1705 @subsubsection occt_2142243456_445622066330412 vcircle
1707 Syntax: vcircle name [PointName PointName PointName IsFilled]
1708 vcircle name [PlaneName PointName Radius IsFilled]
1710 Creates a circle from named or interactively selected entities. Parameter IsFilled is defined as 0 or 1.
1718 vcircle circle1 p1 p2 p3 1
1721 @subsubsection occt_2142243456_445622066330413 vtri2d
1725 Creates a plane with a 2D trihedron from an interactively selected face.
1727 @subsubsection occt_2142243456_445622066330414 vselmode
1729 Syntax: vselmode [object] mode On/Off
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.
1739 vtriangle triangle1 p1 p2 p3
1740 @subsubsection occt_2142243456_445622066330415 vconnect, vconnectsh
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
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.
1752 vsegment segment p1 p2
1753 restore CrankArm.brep obj
1755 vconnectsh new obj 100100100 1 0 0 0 0 1
1759 @subsubsection occt_2142243456_445622066330416 vtriangle
1761 Syntax: vtriangle name PointName PointName PointName
1763 Creates and displays a filled triangle from named points.
1770 vtriangle triangle1 p1 p2 p3
1772 @subsubsection occt_2142243456_445622066330417 vsegment
1774 Syntax: vsegment name PointName PointName
1776 Creates and displays a segment from named points.
1782 vsegment segment p1 p2
1785 **MeshVS **(Mesh Visualization Service) component provides flexible means of displaying meshes with associated pre- and post- processor data.
1789 @subsection occt_2142243456_4456220663305 AIS viewer – Mesh Visualization Service
1791 @subsubsection occt_2142243456_44562206633051 meshfromstl
1793 Syntax: meshfromstl meshname file
1795 Creates a MeshVS_Mesh object based on STL file data. The object will be displayed immediately.
1798 meshfromstl mesh myfile.stl
1800 @subsubsection occt_2142243456_44562206633052 meshdispmode
1802 Syntax: meshdispmode meshname displaymode
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).
1808 meshfromstl mesh myfile.stl
1811 @subsubsection occt_2142243456_44562206633053 meshselmode
1813 Syntax: meshselmode meshname selectionmode
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)
1823 meshfromstl mesh myfile.stl
1826 @subsubsection occt_2142243456_44562206633054 meshshadcolor
1828 Syntax: meshshadcolor meshname red green blue
1830 Changes the face interior color of object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
1834 meshfromstl mesh myfile.stl
1835 meshshadcolormode mesh 0.5 0.5 0.5
1837 @subsubsection occt_2142243456_44562206633055 meshlinkcolor
1839 Syntax: meshlinkcolor meshname red green blue
1841 Changes the color of face borders for object **meshname**. The **red**, **green** and **blue** are real values between **0** and **1**.
1845 meshfromstl mesh myfile.stl
1846 meshlinkcolormode mesh 0.5 0.5 0.5
1848 @subsubsection occt_2142243456_44562206633056 meshmat
1850 Syntax: meshmat meshname material
1852 Changes the material of object **meshname**. **material** is represented with an integer value as follows (equivalent to enumeration Graphic3d_NameOfMaterial):
1863 **10 - SHINY_PLASTIC,**
1873 **20 - UserDefined**
1877 meshfromstl mesh myfile.stl
1880 @subsubsection occt_2142243456_44562206633057 meshshrcoef
1882 Syntax: meshshrcoef meshname shrinkcoefficient
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.
1888 meshfromstl mesh myfile.stl
1889 meshshrcoef mesh 0.05
1891 @subsubsection occt_2142243456_44562206633058 meshshow
1893 Syntax: meshshow meshname
1895 Displays **meshname** in the viewer (if it is erased).
1899 meshfromstl mesh myfile.stl
1902 @subsubsection occt_2142243456_44562206633059 meshhide
1904 Syntax: meshhide meshname
1906 Hides **meshname** in the viewer.
1910 meshfromstl mesh myfile.stl
1913 @subsubsection occt_2142243456_445622066330510 meshhidesel
1915 Syntax: meshhidesel meshname
1917 Hides only selected entities. The other part of **meshname** remains visible.
1919 @subsubsection occt_2142243456_445622066330511 meshshowsel
1921 Syntax: meshshowsel meshname
1923 Shows only selected entities. The other part of **meshname** becomes invisible.
1925 @subsubsection occt_2142243456_445622066330512 meshshowall
1927 Syntax: meshshowall meshname
1929 Changes the state of all entities to visible for **meshname**.
1931 @subsubsection occt_2142243456_445622066330513 meshdelete
1933 Syntax: meshdelete meshname
1935 Deletes MeshVS_Mesh object **meshname**.
1939 meshfromstl mesh myfile.stl
1945 @subsection occt_2142243456_4456220663306 AIS viewer – 2D viewer – view commands
1947 @subsubsection occt_2142243456_44562206633061 v2dinit
1951 **v2dinit **creates the 2D viewer window.
1953 @subsubsection occt_2142243456_44562206633062 v2dsetbg
1955 Syntax: v2dsetbg imagefile [filletype]
1957 **v2dsetbg** loads **imagefile** as background. **filletype** is **NONE**, **CENTERED**, **TILED**, **STRETCH**.
1961 v2dsetbg myimage.brep CENTERED
1963 @subsubsection occt_2142243456_44562206633063 v2dfit
1967 Fits all shapes to the size of the window.
1969 @subsubsection occt_2142243456_44562206633064 v2drepaint
1973 Forcedly repaints all shapes.
1975 @subsubsection occt_2142243456_44562206633065 v2dclear
1979 Clears the 2D viewer window
1981 @subsubsection occt_2142243456_44562206633066 v2dtext
1983 Syntax: v2dtext text x y [angle scale fontindex]
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**.
1990 v2dtext *My text* 10 10
1991 @subsubsection occt_2142243456_44562206633067 v2dsettextcolor
1993 Syntax: v2dsettextcolor text_name colorindex
1995 Changes the color of **text_name** object (**name** must be an integer value).
1999 v2dtext *My text* 10 10
2000 # Change color to red
2001 v2dsettextcolor text_0 3
2002 @subsubsection occt_2142243456_44562206633068 v2dpick
2006 Displays mouse coordinates and color after clicking the mouse button in the 2D viewer window.
2009 @subsubsection occt_2142243456_44562206633069 v2dgrid
2011 Syntax: v2dgrid [type x y xstep ystep angle [drawmode]]
2012 v2dgrid [type x y radiusstep division angle [drawmode]]
2014 Loads a grid in the 2D viewer window.
2015 **type** is **Rect** or **Circ**.
2016 **drawmode** is **Lines**, **Points** or **None**.
2020 v2dgrid Circ 0 0 250 12 0 Lines
2022 v2dgrid Rect 0 0 200 200 0 Lines
2023 @subsubsection occt_2142243456_445622066330610 v2rmgrid
2027 Unloads a grid from the window.
2029 @subsubsection occt_2142243456_445622066330611 v2dpickgrid
2031 Syntax: v2dpickgrid [mouse_x mouse_y [grid_x grid_y]]
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.
2035 @subsubsection occt_2142243456_445622066330612 v2dpsout
2037 Syntax: v2dpsout imagefile [scale colorspace]
2038 [width height [xcenter ycenter]]
2040 Exports **imagefile**. You can set its the scale, width, height and colorspace.
2041 **colorspace** can be **RGB, BlackAndWhite, GreyScale**.
2043 @subsubsection occt_2142243456_445622066330612613 v2ddir
2047 Makes aLlist of the displayed objects.
2050 @subsection occt_2142243456_4456220663306127 Ais viewer – 2D viewer – display commands
2052 @subsubsection occt_2142243456_44562206633061271 v2ddisplay
2054 Syntax: v2ddisplay name [projection]
2056 Projection: origin_x origin_y origin_z normal_x normal_y normal_z dx_x dx_y dx_z.
2058 Displays named objects.
2067 @subsubsection occt_2142243456_44562206633061272 v2ddonly
2069 Syntax: v2ddonly [name1] … [name n]
2071 Displays only selected or named objects. If there are no selected or named objects, nothing is done.
2081 @subsubsection occt_2142243456_44562206633061273 v2ddisplayall
2083 Syntax: v2ddisplayall
2085 Displays all created objects.
2096 @subsubsection occt_2142243456_44562206633061274 v2derase
2098 Syntax: v2derase name1 [name2] … [name n]
2100 Erases some selected or named objects. If there are no selected or named objects, the whole viewer is erased.
2110 @subsubsection occt_2142243456_44562206633061275 v2deraseall
2114 Erases all objects displayed in the viewer.
2124 @subsubsection occt_2142243456_44562206633061276 v2dsetcolor
2126 Syntax: v2dsetcolor [shapename] colorname
2128 Sets color for all, selected or named shapes.
2129 Values of **colorname** see **vsetcolor**.
2138 @subsubsection occt_2142243456_44562206633061277 v2dunsetcolor
2140 Syntax: v2dunsetcolor [shapename]
2142 Sets default color for all, selected or named shapes.
2152 @subsubsection occt_2142243456_44562206633061278 v2dsetbgcolor
2154 Syntax: v2dsetbgcolor colorname
2156 Sets background color.
2157 See **vsetcolor** for the values of **colorname.**.
2166 @subsubsection occt_2142243456_44562206633061279 v2dsetwidth
2168 Syntax: v2dsetwidth [shapename] widthenum
2170 Set width of the edges for all, selected or named shapes.
2171 **widthenum** may be one of: **THIN, MEDIUM, THICK, VERYTHICK**.
2180 @subsubsection occt_2142243456_445622066330612710 v2dunsetwidth
2182 Syntax: vunsetwidth [shapename]
2184 Sets default width of the edges for all, selected or named shapes.
2195 @section occt_2142243456_930384826 OCAF commands
2198 This chapter contains a set of commands for Open CASCADE Technology Application Framework (OCAF).
2201 @subsection occt_2142243456_9303848261 Application commands
2204 @subsubsection occt_2142243456_93038482611 NewDocument
2206 Syntax: NewDocument docname [format]
2208 Creates a new **docname** document with MDTV-Standard or described format.
2211 # Create new document with default (MDTV-Standard) format
2214 # Create new document with BinOcaf format
2215 NewDocument D2 BinOcaf
2217 @subsubsection occt_2142243456_93038482612 IsInSession
2219 Syntax: IsInSession path
2221 **I**Returns **0**, if **path** document is managed by the application session, **1** – otherwise.
2224 IsInSession /myPath/myFile.std
2226 @subsubsection occt_2142243456_93038482613 ListDocuments
2228 Syntax: ListDocuments
2230 Makes a list of documents handled during the session of the application.
2233 @subsubsection occt_2142243456_93038482614 Open
2235 Syntax: Open path docname
2237 Retrieves the document of file **docname** in the path **path**. Overwrites the document, if it is already in session.
2240 Open /myPath/myFile.std D
2242 @subsubsection occt_2142243456_93038482615 Close
2244 Syntax: Close docname
2246 Closes **docname** document. The document is no longer handled by the applicative session.
2251 @subsubsection occt_2142243456_93038482616 Save
2253 Syntax: Save docname
2255 Saves **docname** active document.
2260 @subsubsection occt_2142243456_93038482617 SaveAs
2262 Syntax: SaveAs docname path
2264 Saves the active document in the file **docname** in the path **path**. Overwrites the file if it already exists.
2267 SaveAs D /myPath/myFile.std
2269 @subsection occt_2142243456_9303848262 Basic commands
2272 @subsubsection occt_2142243456_930384826521 Label
2274 Syntax: Label docname entry
2276 Creates the label expressed by **entry** if it does not exist.
2281 @subsubsection occt_2142243456_930384826522 NewChild
2283 Syntax: NewChild docname [taggerlabel = Root label]
2285 Finds (or creates) a TagSource attribute located at father label of **taggerlabel** and makes a new child label.
2288 # Create new child of root label
2291 # Create new child of existing label
2295 @subsubsection occt_2142243456_930384826523 Children
2297 Syntax: Children docname label
2299 Returns the list of attributes of **label**.
2304 @subsubsection occt_2142243456_930384826524 ForgetAll
2306 Syntax: ForgetAll docname label
2308 Forgets all attributes of the label.
2313 @subsection occt_2142243456_93038482653 Application commands
2316 @subsubsection occt_2142243456_930384826531 Main
2318 Syntax: Main docname
2320 Returns the main label of the framework.
2325 @subsubsection occt_2142243456_930384826532 UndoLimit
2327 Syntax: UndoLimit docname [value=0]
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
2335 @subsubsection occt_2142243456_930384826533 Undo
2337 Syntax: Undo docname [value=1]
2339 Undoes **value** steps.
2344 @subsubsection occt_2142243456_930384826534 Redo
2346 Syntax: Redo docname [value=1]
2348 Redoes **value** steps.
2353 @subsubsection occt_2142243456_930384826535 OpenCommand
2355 Syntax: OpenCommand docname
2357 Opens a new command transaction.
2362 @subsubsection occt_2142243456_930384826536 CommitCommand
2364 Syntax: CommitCommand docname
2366 Commits the Command transaction.
2371 @subsubsection occt_2142243456_930384826537 NewCommand
2373 Syntax: NewCommand docname
2375 This is a short-cut for Commit and Open transaction.
2380 @subsubsection occt_2142243456_930384826538 AbortCommand
2382 Syntax: AbortCommand docname
2384 Aborts the Command transaction.
2389 @subsubsection occt_2142243456_930384826539 Copy
2391 Syntax: Copy docname entry Xdocname Xentry
2393 Copies the contents of **entry** to **Xentry**. No links are registred.
2398 @subsubsection occt_2142243456_9303848265310 UpdateLink
2400 Syntax: UpdateLink docname [entry]
2402 Updates external reference set at **entry**.
2407 @subsubsection occt_2142243456_9303848265311 CopyWithLink
2409 Syntax: CopyWithLink docname entry Xdocname Xentry
2411 Aborts the Command transaction.
2412 Copies the content of **entry** to **Xentry**. The link is registred with an Xlink attribute at ** Xentry** label.
2415 CopyWithLink D1 0:2 D2 0:4
2417 @subsubsection occt_2142243456_9303848265312 UpdateXLinks
2419 Syntax: UpdateXLinks docname entry
2421 Sets modifications on labels impacted by external references to the **entry**. The **document** becomes invalid and must be recomputed
2426 @subsubsection occt_2142243456_9303848265313 DumpDocument
2428 Syntax: DumpDocument docname
2430 Displays parameters of **docname** document.
2435 @subsection occt_2142243456_93038482654 Data Framework commands
2438 @subsubsection occt_2142243456_930384826541 MakeDF
2440 Syntax: MakeDF dfname
2442 Creates a new data framework.
2447 @subsubsection occt_2142243456_930384826542 ClearDF
2449 Syntax: ClearDF dfname
2451 Clears a data framework.
2456 @subsubsection occt_2142243456_930384826543 CopyDF
2458 Syntax: CopyDF dfname1 entry1 [dfname2] entry2
2460 Copies a data framework.
2465 @subsubsection occt_2142243456_930384826544 CopyLabel
2467 Syntax: CopyLabel dfname fromlabel tolablel
2472 CopyLabel D1 0:2 0:4
2474 @subsubsection occt_2142243456_930384826545 MiniDumpDF
2476 Syntax: MiniDumpDF dfname
2478 Makes a mini-dump of a data framework.
2483 @subsubsection occt_2142243456_930384826546 XDumpDF
2485 Syntax: XDumpDF dfname
2487 Makes an extended dump of a data framework.
2492 @subsection occt_2142243456_93038482655 General attributes commands
2495 @subsubsection occt_2142243456_930384826551 SetInteger
2497 Syntax: SetInteger dfname entry value
2499 Finds or creates an Integer attribute at **entry** label and sets **value**.
2502 SetInteger D 0:2 100
2504 @subsubsection occt_2142243456_930384826552 GetInteger
2506 Syntax: GetInteger dfname entry [drawname]
2508 Gets a value of an Integer attribute at **entry** label and sets it to **drawname** variable, if it is defined.
2511 GetInteger D 0:2 Int1
2513 @subsubsection occt_2142243456_930384826553 SetReal
2515 Syntax: SetReal dfname entry value
2517 Finds or creates a Real attribute at **entry** label and sets **value**.
2522 @subsubsection occt_2142243456_930384826554 GetReal
2524 Syntax: GetReal dfname entry [drawname]
2526 Gets a value of a Real attribute at **entry** label and sets it to **drawname** variable, if it is defined.
2531 @subsubsection occt_2142243456_930384826555 SetIntArray
2533 Syntax: SetIntArray dfname entry lower upper value1 value2 …
2535 Finds or creates an IntegerArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
2538 SetIntArray D 0:2 1 4 100 200 300 400
2540 @subsubsection occt_2142243456_930384826556 GetIntArray
2542 Syntax: GetIntArray dfname entry
2544 Gets a value of an IntegerArray attribute at **entry** label.
2549 @subsubsection occt_2142243456_930384826557 SetRealArray
2551 Syntax: SetRealArray dfname entry lower upper value1 value2 …
2553 Finds or creates a RealArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
2556 GetRealArray D 0:2 1 4 100. 200. 300. 400.
2558 @subsubsection occt_2142243456_930384826558 GetRealArray
2560 Syntax: GetRealArray dfname entry
2562 Gets a value of a RealArray attribute at **entry** label.
2567 @subsubsection occt_2142243456_930384826559 SetComment
2569 Syntax: SetComment dfname entry value
2571 Finds or creates a Comment attribute at **entry** label and sets **value**.
2574 SetComment D 0:2 *My comment*
2576 @subsubsection occt_2142243456_9303848265510 GetComment
2578 Syntax: GetComment dfname entry
2580 Gets a value of a Comment attribute at **entry** label.
2585 @subsubsection occt_2142243456_9303848265511 SetExtStringArray
2587 Syntax: SetExtStringArray dfname entry lower upper value1 value2 …
2589 Finds or creates an ExtStringArray attribute at **entry** label with lower and upper bounds and sets **value1, **.** value2…**
2592 SetExtStringArray D 0:2 1 3 *string1* *string2* *string3*
2594 @subsubsection occt_2142243456_9303848265512 GetExtStringArray
2596 Syntax: GetExtStringArray dfname entry
2598 Gets a value of an ExtStringArray attribute at **entry** label.
2601 GetExtStringArray D 0:2
2603 @subsubsection occt_2142243456_9303848265513 SetName
2605 Syntax: SetName dfname entry value
2607 Finds or creates a Name attribute at **entry** label and set **value**.
2610 SetName D 0:2 *My name*
2612 @subsubsection occt_2142243456_9303848265514 GetName
2614 Syntax: GetName dfname entry
2616 Gets a value of a Name attribute at **entry** label.
2621 @subsubsection occt_2142243456_9303848265515 SetReference
2623 Syntax: SetReference dfname entry reference
2625 Creates a Reference attribute at **entry** label and sets **reference**.
2628 SetReference D 0:2 0:4
2630 @subsubsection occt_2142243456_9303848265516 GetReference
2632 Syntax: GetReference dfname entry
2634 Gets a value of a Reference attribute at **entry** label.
2639 @subsubsection occt_2142243456_9303848265517 SetUAttribute
2641 Syntax: SetUAttribute dfname entry localGUID
2643 Creates a UAttribute attribute at **entry** label with **localGUID**.
2646 set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
2647 SetUAttribute D 0:2 ${localGUID}
2649 @subsubsection occt_2142243456_9303848265518 GetUAttribute
2651 Syntax: GetUAttribute dfname entry loacalGUID
2653 Finds a UAttribute at **entry** label with **localGUID**.
2656 set localGUID *c73bd076-22ee-11d2-acde-080009dc4422*
2657 GetUAttribute D 0:2 ${localGUID}
2659 @subsubsection occt_2142243456_9303848265519 SetFunction
2661 Syntax: SetFunction dfname entry ID failure
2663 Finds or creates a Function attribute at **entry** label with driver ID and **failure** index.
2666 set ID *c73bd076-22ee-11d2-acde-080009dc4422*
2667 SetFunction D 0:2 ${ID} 1
2669 @subsubsection occt_2142243456_9303848265520 GetFunction
2671 Syntax: GetFunction dfname entry ID failure
2673 Finds a Function attribute at **entry** label and sets driver ID to **ID** variable and failure index to **failure** variable.
2676 GetFunction D 0:2 ID failure
2678 @subsubsection occt_2142243456_9303848265521 NewShape
2680 Syntax: NewShape dfname entry [shape]
2683 Finds or creates a Shape attribute at **entry** label. Creates or updates the associated NamedShape attribute by **shape** if **shape** is defined.
2689 @subsubsection occt_2142243456_9303848265522 SetShape
2691 Syntax: SetShape dfname entry shape
2693 Creates or updates a NamedShape attribute at **entry** label by **shape**.
2699 @subsubsection occt_2142243456_9303848265523 GetShape
2701 Syntax: GetShape2 dfname entry shape
2703 Sets a shape from NamedShape attribute associated with **entry** label to **shape** draw variable.
2708 @subsection occt_2142243456_93038482656 Geometric attributes commands
2711 @subsubsection occt_2142243456_930384826561 SetPoint
2713 Syntax: SetPoint dfname entry point
2715 Finds or creates a Point attribute at **entry** label and sets **point** as generated in the associated NamedShape attribute.
2721 @subsubsection occt_2142243456_930384826562 GetPoint
2723 Syntax: GetPoint dfname entry [drawname]
2725 Gets a vertex from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
2730 @subsubsection occt_2142243456_930384826563 SetAxis
2732 Syntax: SetAxis dfname entry axis
2734 Finds or creates an Axis attribute at **entry** label and sets **axis** as generated in the associated NamedShape attribute.
2737 line l 10 20 30 100 200 300
2740 @subsubsection occt_2142243456_930384826564 GetAxis
2742 Syntax: GetAxis dfname entry [drawname]
2744 Gets a line from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
2749 @subsubsection occt_2142243456_930384826565 SetPlane
2751 Syntax: SetPlane dfname entry plane
2753 Finds or creates a Plane attribute at **entry** label and sets **plane** as generated in the associated NamedShape attribute.
2756 plane pl 10 20 30 –1 0 0
2759 @subsubsection occt_2142243456_930384826566 GetPlane
2761 Syntax: GetPlane dfname entry [drawname]
2763 Gets a plane from NamedShape attribute at **entry** label and sets it to **drawname** variable, if it is defined.
2768 @subsubsection occt_2142243456_930384826567 SetGeometry
2770 Syntax: SetGeometry dfname entry [type] [shape]
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**.
2777 SetGeometry D 0:2 pnt p
2779 @subsubsection occt_2142243456_930384826568 GetGeometryType
2781 Syntax: GetGeometryType dfname entry
2783 Gets a geometry type from Geometry attribute at **entry** label.
2786 GetGeometryType D 0:2
2788 @subsubsection occt_2142243456_930384826569 SetConstraint
2790 Syntax: SetConstraint dfname entry keyword geometrie [geometrie …]
2791 SetConstraint dfname entry *plane* geometrie
2792 SetConstraint dfname entry *value* value
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**
2798 **from/axis/mate/alignf/aligna/axesa/facesa/round/offset**
2800 2. Sets plane for the existing constraint.
2802 3. Sets value for the existing constraint.
2805 SetConstraint D 0:2 *value* 5
2807 @subsubsection occt_2142243456_9303848265610 GetConstraint
2809 Syntax: GetConstraint dfname entry
2811 Dumps a Constraint attribute at **entry** label
2816 @subsubsection occt_2142243456_9303848265611 SetVariable
2818 Syntax: SetVariable dfname entry isconstant(0/1) units
2820 Creates a Variable attribute at **entry** label and sets **isconstant** flag and **units** as a string.
2823 SetVariable D 0:2 1 *mm*
2825 @subsubsection occt_2142243456_9303848265612 GetVariable
2827 Syntax: GetVariable dfname entry isconstant units
2829 Gets an **isconstant** flag and **units** of a Variable attribute at **entry** label.
2832 GetVariable D 0:2 isconstant units
2833 puts *IsConstant=${isconstant}*
2834 puts *Units=${units}*
2837 @subsection occt_2142243456_93038482657 Tree attributes commands
2840 @subsubsection occt_2142243456_930384826571 RootNode
2842 Syntax: RootNode dfname treenodeentry [ID]
2844 Returns ultimate father of TreeNode attribute identified by its **treenodeentry** and its **ID** (or default ID, if **ID** is not defined).
2847 @subsubsection occt_2142243456_930384826572 SetNode
2849 Syntax: SetNode dfname treenodeentry [ID]
2851 Creates a TreeNode attribute on the **treenodeentry** label with its tree **ID** (or assigns a default ID, if the **ID** is not defined).
2854 @subsubsection occt_2142243456_930384826573 AppendNode
2856 Syntax: AppendNode dfname fatherentry childentry [fatherID]
2859 Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as last child of **fatherentry**.
2864 @subsubsection occt_2142243456_930384826574 PrependNode
2866 Syntax: PrependNode dfname fatherentry childentry [fatherID]
2869 Inserts a TreeNode attribute with its tree **fatherID** (or default ID, if **fatherID** is not defined) on **childentry** as first child of **fatherentry**.
2872 @subsubsection occt_2142243456_930384826575 InsertNodeBefore
2874 Syntax: InsertNodeBefore dfname treenodeentry beforetreenode [ID]
2876 Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **beforetreenode** before **treenodeentry**.
2879 @subsubsection occt_2142243456_930384826576 InsertNodeAfter
2881 Syntax: InsertNodeAfter dfname treenodeentry aftertreenode [ID]
2883 Inserts a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) **aftertreenode** after **treenodeentry**.
2886 @subsubsection occt_2142243456_930384826577 DetachNode
2888 Syntax: DetachNode dfname treenodeentry [ID]
2890 Removes a TreeNode attribute with tree **ID** (or default ID, if **ID** is not defined) from **treenodeentry**.
2893 @subsubsection occt_2142243456_930384826578 ChildNodeIterate
2895 Syntax: ChildNodeIterate dfname treenodeentry alllevels(0/1) [ID]
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.
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
2919 InsertNodeBefore D 0:5 0:6
2920 InsertNodeAfter D 0:4 0:7
2926 ChildNodeIterate D 0:2 1
2936 # List only first levels
2937 ChildNodeIterate D 0:2 1
2944 @subsubsection occt_2142243456_930384826579 InitChildNodeIterator
2946 Syntax: InitChildNodeIterator dfname treenodeentry alllevels(0/1) [ID]
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.
2952 InitChildNodeIterate D 0:5 1
2954 for {set i 1} {$i 100} {incr i} {
2955 if {[ChildNodeMore] == *TRUE*} {
2956 puts *Tree node = [ChildNodeValue]*
2961 puts *aChildNumber=$aChildNumber*
2963 @subsubsection occt_2142243456_9303848265710 ChildNodeMore
2965 Syntax: ChildNodeMore
2967 Returns TRUE if there is a current item in the iteration.
2970 @subsubsection occt_2142243456_9303848265711 ChildNodeNext
2972 Syntax: ChildNodeNext
2974 Moves to the next Item.
2977 @subsubsection occt_2142243456_9303848265712 ChildNodeValue
2979 Syntax: ChildNodeValue
2981 Returns the current treenode of ChildNodeIterator.
2984 @subsubsection occt_2142243456_9303848265713 ChildNodeNextBrother
2986 Syntax: ChildNodeNextBrother
2988 Moves to the next Brother. If there is none, goes up. This method is interesting only with ;allLevels; behavior.
2991 @subsection occt_2142243456_93038482658 Standard presentation commands
2994 @subsubsection occt_2142243456_930384826581 AISInitViewer
2996 Syntax: AISInitViewer docname
2998 Creates and sets AISViewer attribute at root label, creates AIS viewer window.
3003 @subsubsection occt_2142243456_930384826582 AISRepaint
3005 Syntax: AISRepaint docname
3007 Updates the AIS viewer window.
3012 @subsubsection occt_2142243456_930384826583 AISDisplay
3014 Syntax: AISDisplay docname entry [not_update]
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.
3022 @subsubsection occt_2142243456_930384826584 AISUpdate
3024 Syntax: AISUpdate docname entry
3026 Recomputes a presantation of AISobject from **entry** label and applies the visualization setting in AIS viewer.
3031 @subsubsection occt_2142243456_930384826585 AISErase
3033 Syntax: AISErase docname entry
3035 Erases AISobject of **entry** label in AIS viewer.
3040 @subsubsection occt_2142243456_930384826586 AISRemove
3042 Syntax: AISRemove docname entry
3044 Erases AISobject of **entry** label in AIS viewer, then AISobject is removed from AIS_InteractiveContext.
3049 @subsubsection occt_2142243456_930384826587 AISSet
3051 Syntax: AISSet docname entry ID
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).
3059 @subsubsection occt_2142243456_930384826588 AISDriver
3061 Syntax: AISDriver docname entry [ID]
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).
3070 @subsubsection occt_2142243456_930384826589 AISUnset
3072 Syntax: AISUnset docname entry
3074 Deletes AISPresentation attribute (if it exists) of an **entry** label.
3079 @subsubsection occt_2142243456_9303848265810 AISTransparency
3081 Syntax: AISTransparency docname entry [transparency]
3083 Sets (if **transparency** is defined) or gets the value of transparency for AISPresentation attribute of an **entry** label.
3086 AISTransparency D 0:5 0.5
3088 @subsubsection occt_2142243456_9303848265811 AISHasOwnTransparency
3090 Syntax: AISHasOwnTransparency docname entry
3092 Tests AISPresentation attribute of an **entry** label by own transparency.
3095 AISHasOwnTransparency D 0:5
3097 @subsubsection occt_2142243456_9303848265812 AISMaterial
3099 Syntax: AISMaterial docname entry [material]
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**).
3107 @subsubsection occt_2142243456_9303848265813 AISHasOwnMaterial
3109 Syntax: AISHasOwnMaterial docname entry
3111 Tests AISPresentation attribute of an **entry** label by own material.
3114 AISHasOwnMaterial D 0:5
3116 @subsubsection occt_2142243456_9303848265814 AISColor
3118 Syntax: AISColor docname entry [color]
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**).
3125 @subsubsection occt_2142243456_9303848265815 AISHasOwnColor
3127 Syntax: AISHasOwnColor docname entry
3129 Tests AISPresentation attribute of an **entry** label by own color.
3132 AISHasOwnColor D 0:5
3136 @section occt_2142243456_1101404852 Geometry commands
3141 @subsection occt_2142243456_110140485261 Overview
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.
3145 In the context of Geometry, Draw includes the following types of variable:
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.
3152 The following topics are covered in the nine sections of this chapter:
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.
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.
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.
3170 @subsection occt_2142243456_110140485262 Curve creation
3172 This section deals with both points and curves. Types of curves are:
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.
3181 Curves are displayed with an arrow showing the last parameter.
3184 @subsubsection occt_2142243456_1101404852621 point
3186 Syntax: point name x y [z]
3188 **point **creates a 2d or 3d point, depending on the number of arguments.
3198 @subsubsection occt_2142243456_1101404852622 line
3200 Syntax: line name x y [z] dx dy [dz]
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.
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.
3207 # a 2d line at 45 degrees of the X axis
3210 # a 3d line through the point 10 0 0 and parallel to Z
3214 @subsubsection occt_2142243456_1101404852623 circle
3216 Syntax: circle name x y [z [dx dy dz]] [ux uy [uz]] radius
3218 **circle **creates a 2d or a 3d circle.
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.
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.
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.
3228 # A 2d circle of radius 5 centered at 10,-2
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)
3236 # a 3d circle, center 10 20 -5, axis Z, radius 17
3237 circle c3 10 20 -5 17
3239 # same 3d circle with axis Y
3240 circle c4 10 20 -5 0 1 0 17
3242 # full 3d circle, axis X, origin on Z
3243 circle c5 10 20 -5 1 0 0 0 0 1 17
3246 @subsubsection occt_2142243456_1101404852624 ellipse
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:
3250 P(u) = O + firstradius*cos(u)*Xdir + secondradius*sin(u)*Ydir
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.
3258 # default 2d ellipse
3259 ellipse e1 10 5 20 10
3261 # 2d ellipse at angle 60 degree
3262 ellipse e2 0 0 1 2 30 5
3264 # 3d ellipse, in the XY plane
3265 ellipse e3 0 0 0 25 5
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
3270 See also: **circle**
3271 @subsubsection occt_2142243456_1101404852625 hyperbola
3273 Syntax: hyperbola name x y [z [dx dy dz]] [ux uy [uz]] firstradius secondradius
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.
3277 The Draw hyperbola is parameterized as follows:
3279 P(U) = O + firstradius*Cosh(U)*XDir + secondradius*Sinh(U)*YDir
3283 * P is the point of parameter U,
3284 * O, XDir and YDir are respectively the origin, *X Direction* and *Y
3286 Direction* of its local coordinate system.
3289 # default 2d hyperbola, with asymptotes 1,1 -1,1
3290 hyperbola h1 0 0 30 30
3292 # 2d hyperbola at angle 60 degrees
3293 hyperbola h2 0 0 1 2 20 20
3295 # 3d hyperbola, in the XY plane
3296 hyperbola h3 0 0 0 50 50
3298 See also: **circle**
3301 @subsubsection occt_2142243456_1101404852626 parabola
3303 Syntax: parabola name x y [z [dx dy dz]] [ux uy [uz]] FocalLength
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.
3307 The Geom_Parabola parabola is parameterized as follows:
3309 P(u) = O + u*u/(4.*F)*XDir + u*YDir
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.
3320 # 2d parabola with convexity +Y
3321 parabola p2 0 0 0 1 50
3323 # 3d parabola in the Y-Z plane, convexity +Z
3324 parabola p3 0 0 0 1 0 0 0 0 1 50
3326 See also: **circle**
3329 @subsubsection occt_2142243456_1101404852627 beziercurve, dbeziercurve
3331 Syntax: beziercurve name nbpole pole, [weight]
3332 2dbeziercurve name nbpole pole, [weight]
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.
3337 # a rational 2d bezier curve (arc of circle)
3338 2dbeziercurve ci 3 0 0 1 10 0 sqrt(2.)/2. 10 10 1
3340 # a 3d bezier curve, not rational
3341 beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
3344 @subsubsection occt_2142243456_1101404852628 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
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)
3349 **bsplinecurve **creates 2d or 3d bspline curves; the **pbsplinecurve **and **2dpbsplinecurve **commands create periodic bspline curves.
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.
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.
3356 The poles must be given with their weights, use weights of 1 for a non rational curve, the number of poles must be:
3358 * For a non periodic curve: Sum of multiplicities - degree + 1
3359 * For a periodic curve: Sum of multiplicities - last multiplicity
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 !!)
3367 2dpbsplinecurve c 2 \
3368 4 0 2 pi/1.5 2 pi/0.75 2 2*pi 2 \
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.*
3383 @subsubsection occt_2142243456_1101404852629 uiso, viso
3385 Syntax: uiso name surface u
3388 Use these commands to create a U or V isoparametric curve from a surface.
3391 # create a cylinder and extract iso curves
3398 *Cannot be done from offset surfaces.*
3401 @subsubsection occt_2142243456_11014048526210 tod, tod
3403 Syntax: to3d name curve2d [plane]
3404 to2d name curve3d [plane]
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.
3409 # the following commands
3411 plane p -2 1 0 1 2 3
3414 # will create the same circle as
3415 circle c -2 1 0 1 2 3 5
3417 See also: **project**
3420 @subsubsection occt_2142243456_11014048526211 project
3422 Syntax: project name curve3d surface
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.
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
3435 @subsection occt_2142243456_110140485263 Surface creation
3437 Types of surfaces are:
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**.
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.
3448 @subsubsection occt_2142243456_1101404852631 plane
3450 Syntax: plane name [x y z [dx dy dz [ux uy uz]]]
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.
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
3459 # an horixontal plane with origin 10, -20, -5
3463 @subsubsection occt_2142243456_1101404852632 cylinder
3465 Syntax: cylinder name [x y z [dx dy dz [ux uy uz]]] radius
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.
3471 # a cylinder on the default Z axis, radius 10
3474 # a cylinder, also along the Z axis but with origin 5,
3476 cylinder c2 5 10 -3 10
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)
3485 @subsubsection occt_2142243456_1101404852633 cone
3487 Syntax: cone name [x y z [dx dy dz [ux uy uz]]] semi-angle radius
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.
3493 # a cone at 45 degrees at the origin on Z
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
3499 @subsubsection occt_2142243456_1101404852634 sphere
3501 Syntax: sphere name [x y z [dx dy dz [ux uy uz]]] radius
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.
3505 # a sphere at the origin
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
3513 @subsubsection occt_2142243456_1101404852635 torus
3515 Syntax: torus name [x y z [dx dy dz [ux uy uz]]] major minor
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.
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.
3522 # a torus at the origin
3525 # a torus in another coordinate system
3526 torus t2 10 5 -2 2 1 0 20 5
3531 @subsubsection occt_2142243456_1101404852636 beziersurf
3533 Syntax: beziersurf name nbupoles nbvolpes pole, [weight]
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.
3537 Then give the poles in the following order: pole(1, 1), pole(nbupoles, 1), pole(1, nbvpoles) and pole(nbupoles, nbvpoles).
3539 Weights may be omitted, but if you give one weight you must give all of them.
3542 # a non-rational degree 2,3 surface
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
3549 See also: **beziercurve**
3551 @subsubsection occt_2142243456_1101404852637 bsplinesurf, upbsplinesurf, vpbsplinesurf, uvpbsplinesurf
3553 Syntax: bsplinesurf name udegree nbuknots uknot umult ... nbvknot vknot
3554 vmult ... x y z w ...
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.
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.
3564 # create a bspline surface of degree 1 2
3565 # with two knots in U and three in V
3570 0 10 2 1 10 10 3 1 \
3571 0 20 10 1 10 20 20 1 \
3574 See also: **bsplinecurve**, **beziersurf**, **convert**
3577 @subsubsection occt_2142243456_1101404852638 trim, trimu, trimv
3579 Syntax: trim newname name [u1 u2 [v1 v2]]
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.
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.*
3591 # create a 3d circle
3594 # trim it, use the same variable, the original is
3598 # the original can be recovered!
3604 # the original is not the trimmed curve but the basis
3607 # as the circle is periodic, the two following commands
3612 # trim an infinite cylinder
3616 See also: **reverse**
3619 @subsubsection occt_2142243456_1101404852639 offset
3621 Syntax: offset name basename distance [dx dy dz]
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.
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.
3627 The offset curve or surface copies the basic geometry, which can be modified later.
3630 # graphic demonstration that the outline of a torus
3631 # is the offset of an ellipse
3634 torus t 0 0 0 0 cos(angle) sin(angle) 50 20
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
3641 Syntax: revsurf name curvename x y z dx dy dz
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.
3646 # another way of creating a torus like surface
3648 revsurf s c 0 0 0 0 1 0
3651 @subsubsection occt_2142243456_11014048526311 extsurf
3653 Syntax: extsurf newname curvename dx dy dz
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.
3658 # an elliptic cylinder
3659 ellipse e 0 0 0 10 5
3665 @subsubsection occt_2142243456_11014048526312 convert
3667 Syntax: convert newname name
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.
3672 # turn a 2d arc of a circle into a 2d NURBS
3677 # an easy way to make a planar bspline surface
3683 *Offset curves and surfaces are not treated by this command.*
3687 @subsection occt_2142243456_110140485264 Curve and surface modifications
3689 Draw provides commands to modify curves and surfaces, some of them are general, others restricted to bezier curves or bsplines.
3691 General modifications:
3693 * Reversing the parametrization: **reverse**, **ureverse**, **vreverse**
3695 Modifications for both bezier curves and bsplines:
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**
3702 Modifications for bezier curves:
3704 * Adding and removing poles: **insertpole**, **rempole**, **remcolpole**, **remrowpole**
3706 Modifications for bspline:
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**
3715 @subsubsection occt_2142243456_1101404852641 reverse, ureverse, vreverse
3718 Syntax: reverse curvename
3719 ureverse surfacename
3720 vreverse surfacename
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.
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.
3726 Reversing a parameter on an analytical surface may create an indirect coordinate system.
3729 # reverse a trimmed 2d circle
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
3738 @subsubsection occt_2142243456_1101404852642 exchuv
3740 Syntax: exchuv surfacename
3742 For a bezier or bspline surface this command exchanges the u and v parameters.
3745 # exchanging u and v on a spline (made from a cylinder)
3752 @subsubsection occt_2142243456_1101404852643 segment, segsur
3754 Syntax: segment curve Ufirst Ulast
3755 segsur surface Ufirst Ulast Vfirst Vlast
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.
3759 This command must not be confused with **trim **which creates new geometry.
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
3768 @subsubsection occt_2142243456_1101404852644 iincudeg, incvdeg
3770 Syntax: incudeg surfacename newdegree
3771 incvdeg surfacename newdegree
3773 **incudeg **and **incvdeg **increase the degree in the U or V parameter of a bezier or bspline surface.
3776 # make a planar bspline and increase the degree to 2 3
3784 *The geometry is modified.*
3787 @subsubsection occt_2142243456_1101404852645 cmovep, movep, movecolp, moverowp
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
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.
3796 **movecolp **and **moverowp **translate a whole column (expressed by the uindex) or row (expressed by the vindex) of poles.
3799 # start with a plane
3800 # transform to bspline, raise degree and add relief
3802 trim p p -10 10 -10 10
3811 @subsubsection occt_2142243456_1101404852646 insertpole, rempole, remcolpole, remrowpole
3813 Syntax: insertpole curvename index x y [z] [weight]
3814 rempole curvename index
3815 remcolpole surfacename index
3816 remrowpole surfacename index
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.
3820 **rempole **removes a pole from a 2d or 3d bezier curve. Leave at least two poles in the curves.
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.
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
3832 @subsubsection occt_2142243456_1101404852647 insertknot, insertuknot, insertvknot
3834 Syntax: insertknot name knot [mult = 1] [knot mult ...]
3835 insertuknot surfacename knot mult
3836 insertvknot surfacename knot mult
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.
3845 # create a cylindrical surface and insert a knot
3847 trim c c 0 pi/2 0 10
3849 insertuknot c1 pi/4 1
3851 @subsubsection occt_2142243456_1101404852648 remknot, remuknot, remvknot
3853 Syntax: remknot index [mult] [tol]
3854 remuknot index [mult] [tol]
3855 remvknot index [mult] [tol]
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.
3859 By default, if no tolerance is given, the knot will always be removed.
3862 # bspline circle, remove a knot
3869 *Curves or Surfaces may be modified.*
3872 @subsubsection occt_2142243456_1101404852649 setperiodic, setnotperiodic, setuperiodic, setunotperiodic, setvperiodic, setvnotperiodic
3874 Syntax: setperiodic curve
3875 setnotperiodic curve
3876 setuperiodic surface
3877 setunotperiodic surface
3878 setvperiodic surface
3879 setvnotperiodic surface
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.
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.
3886 # a circle deperiodicized
3890 @subsubsection occt_2142243456_11014048526410 setorigin, setuorigin, setvorigin
3892 Syntax: setorigin curvename index
3893 setuorigin surfacename index
3894 setuorigin surfacename index
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.
3899 # a torus with new U and V origins
3906 @subsection occt_2142243456_110140485265 Transformations
3908 Draw provides commands to apply linear transformations to geometric objects: they include translation, rotation, mirroring and scaling.
3910 @subsubsection occt_2142243456_1101404852651 translate, dtranslate
3912 Syntax: translate name [names ...] dx dy dz
3913 2dtranslate name [names ...] dx dy
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.
3917 For 2d points or curves, use the **2dtranslate **command.
3923 torus t 10 20 30 5 2
3924 translate p c t 0 0 15
3926 *Objects are modified by this command.*
3928 @subsubsection occt_2142243456_1101404852652 rotate, drotate
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.
3934 For a 2d rotation, you need only give the center point and the angle. In 2d or 3d, the angle can be negative.
3937 # make a helix of circles. create a scripte file with
3938 this code and execute it using **source**.
3940 for {set i 1} {$i = 10} {incr i} {
3941 copy c[expr $i-1] c$i
3943 rotate c$i 0 0 0 0 0 1 36
3946 @subsubsection occt_2142243456_1101404852653 pmirror, lmirror, smirror, dpmirror, dlmirror
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
3954 The mirror commands perform a mirror transformation of 2d or 3d geometry.
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.
3958 In 2d, only **2dpmirror**, point symmetry mirroring, and **2dlmirror**, axis symmetry mirroring, are available.
3961 # build 3 images of a torus
3962 torus t 10 10 10 1 2 3 5 1
3966 lmirror t2 0 0 0 1 0 0
3968 smirror t3 0 0 0 1 0 0
3970 @subsubsection occt_2142243456_1101404852654 pscale, dpscale
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**.
3977 # double the size of a sphere
3981 @subsection occt_2142243456_110140485266 Curve and surface analysis
3983 **Draw **provides methods to compute information about curves and surfaces:
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.
3993 @subsubsection occt_2142243456_1101404852661 coord
3995 Syntax: coord P x y [z]
3997 The **coord **command will set the coordinates of the point P. x, y (and optionally z)
4006 @subsubsection occt_2142243456_1101404852662 cvalue, dcvalue
4008 Syntax: cvalue curve U x y z [d1x d1y d1z [d2x d2y d2z]]
4009 2dcvalue curve U x y [d1x d1y [d2x d2y]]
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.
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
4024 # values of x y d1x d1y d2x d2y
4028 @subsubsection occt_2142243456_1101404852663 svalue
4030 Syntax: svalue surfname U v x y z [dux duy duz dvx dvy dvz [d2ux d2uy d2uz d2vx d2vy d2vz d2uvx d2uvy d2uvz]]
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.
4035 # display points on a sphere
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
4043 @subsubsection occt_2142243456_1101404852664 localprop, minmaxcurandinf
4045 Syntax: localprop curvename U
4046 minmaxcurandinf curve
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.
4052 # show curvature at the center of a bezier curve
4053 beziercurve c 3 0 0 0 10 2 0 20 0 0
4057 See also: **surface_radius**
4060 @subsubsection occt_2142243456_1101404852665 parameters
4062 Syntax: parameters surf/curve x y z U [V]
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.
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
4073 @subsubsection occt_2142243456_1101404852666 proj, dproj
4075 Syntax: proj name x y z
4078 Use **proj **to project a point on a 3d curve or a surface and **2dproj **for a 2d curve.
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, ...
4083 # project point on a torus
4086 == ext_1 ext_2 ext_3 ext_4
4089 @subsubsection occt_2142243456_1101404852667 surface_radius
4091 Syntax: surface_radius surface u v [c1 c2]
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.
4096 # computes curvatures of a cylinder
4098 surface_radius c pi 3 c1 c2
4099 == Min Radius of Curvature : -5
4100 == Min Radius of Curvature : infinite
4104 @subsection occt_2142243456_110140485267 Intersections
4106 The **intersect **command computes intersections of surfaces; the **2dintersect **command, intersections of 2d curves.
4109 @subsubsection occt_2142243456_1101404852671 intersect
4111 Syntax: intersect name surface1 surface2
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;, ...
4118 plane p 0 0 40 0 1 5
4122 @subsubsection occt_2142243456_1101404852672 dintersect
4124 Syntax: 2dintersect curve1 curve2
4126 **2dintersect **displays the intersection points between two 2d curves.
4129 # intersect two 2d ellipses
4131 ellipse e2 0 0 0 1 5 2
4133 @subsection occt_2142243456_110140485268 Approximations
4135 Draw provides command to create curves and surfaces by approximation.
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.
4139 @subsubsection occt_2142243456_1101404852681 appro, dapprox
4141 Syntax: appro result nbpoint [curve]
4142 2dapprox result nbpoint [curve / x1 y1 x2 y2]
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.
4147 # pick points and they will be fitted
4151 @subsubsection occt_2142243456_1101404852682 surfapp, grilapp
4154 Syntax: surfapp name nbupoints nbvpoints x y z ....
4155 grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
4157 **surfapp **fits a surface through an array of u and v points, nbupoints*nbvpoints.
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.
4162 # a surface using the same data as in the beziersurf
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
4174 @subsection occt_2142243456_110140485269 Constraints
4176 The **cirtang **command is used to construct 2d circles tangent to curves and **lintan **to construct 2d lines tangent to curves.
4179 @subsubsection occt_2142243456_1101404852691 cirtang
4181 Syntax: cirtang cname curve/point/radius curve/point/radius curve/point/radius
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.
4186 # a point, a line and a radius. 2 solutions
4193 @subsubsection occt_2142243456_1101404852692 lintan
4195 Syntax: lintan name curve curve [angle]
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.
4200 # lines tangent to 2 circles, 4 solutions
4205 # lines at 15 degrees tangent to a circle and a line, 2
4206 solutions: l1_1 l1_2
4214 @subsection occt_2142243456_1101404852610 Display
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.
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.
4220 On surfaces, you can control the number of isoparametric curves displayed on the surface with the **nbiso **commands.
4222 On bezier and bspline curve and surface you can toggle the display of the control points with the **clpoles **and **shpoles **commands.
4224 On bspline curves and surfaces you can toggle the display of the knots with the **shknots **and **clknots **commands.
4227 @subsubsection occt_2142243456_11014048526101 dmod, discr, defle
4229 Syntax: dmode name [name ...] u/d
4230 discr name [name ...] nbintervals
4231 defle name [name ...] deflection
4233 **dmode **allows you to choose the display mode for a curve or a surface.
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.
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).
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.
4242 # increment the number of points on a big circle
4250 @subsubsection occt_2142243456_11014048526102 nbiso
4252 Syntax: nbiso name [names...] nuiso nviso
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.
4257 # display 35 meridians and 15 parallels on a spere
4262 @subsubsection occt_2142243456_11014048526103 clpoles, shpoles
4264 Syntax: clpoles name
4267 On bezier and bspline curves and surfaces, the control polygon is displayed by default: **clpoles **erases it and **shpoles **restores it.
4270 # make a bezier curve and erase the poles
4271 beziercurve c 3 0 0 0 10 0 0 10 10 0
4275 @subsubsection occt_2142243456_11014048526104 clknots, shknots
4277 Syntax: clknots name
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.
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
4287 @section occt_2142243456_1869436669 Topology commands
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.
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.
4299 The different topological shapes<a href="#_ftn3">[3]</a> include:
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.
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**).
4312 The following topics are covered in the eight sections of this chapter:
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.
4325 @subsection occt_2142243456_186943666971 Basic topology
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:
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.
4334 In Draw, shapes are displayed using isoparametric curves. There is color coding for the edges:
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.
4341 @subsubsection occt_2142243456_1869436669711 isos, discretisation
4343 Syntax: isos [name ...][nbisos]
4344 discretisation nbpoints
4345 **isos **determines or changes the number of isoparametric curves on shapes.
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.
4349 **discretisation **changes the default number of points used to display the curves. The default value is 30.
4352 # Display only the edges (the wireframe)
4356 Don’t confuse *isos* and *discretisation* with the geometric
4357 *commands *nbisos* and *discr*.*
4360 @subsubsection occt_2142243456_1869436669712 orientation, complement, invert, normals, range
4362 Syntax: orientation name [name ...] F/R/E/I
4363 complement name [name ...]
4365 normals s (length = 10), disp normals
4366 range name value value
4368 **orientation **assigns the orientation of shapes - simple and complex - to one of the following four values: FORWARD, REVERSED, INTERNAL, EXTERNAL.
4370 **complement **changes the current orientation of shapes to its complement, FORWARD - REVERSED, INTERNAL - EXTERNAL.
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.
4374 **normals **returns the assignment of colors to orientation values.
4376 **range **defines the length of a selected edge by defining the values of a starting point and an end point.
4379 # invert normals of a box
4385 # to assign a value to an edge
4387 # to define the box as edges
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
4392 # to define the length of the edge as starting from 0
4397 @subsubsection occt_2142243456_1869436669713 explode, exwire, nbshapes
4399 Syntax: explode name [C/So/Sh/F/W/E/V]
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.
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.
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.
4409 **nbshapes **counts the number of shapes of each type in an entity.
4415 # whatis returns the type and various information
4417 = b is a shape SOLID FORWARD Free Modified
4422 = b_1 is a shape SHELL FORWARD Modified Orientable
4425 # extract the edges b_1, ... , b_12
4432 Number of shapes in b
4444 @subsubsection occt_2142243456_1869436669714 emptycopy, add, compound
4446 Syntax: emptycopy [newname] name
4448 compound [name ...] compoundname
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.
4452 **add **inserts shape C into shape S. Verify that C and S reference compatible types of objects:
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*.
4463 Care should be taken using **emptycopy **and **add**.
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.
4468 # a compound with three boxes
4475 @subsubsection occt_2142243456_1869436669715 checkshape
4477 Syntax: checkshape [-top] shape [result] [-short]
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.
4486 **checkshape **examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
4489 # checkshape returns a comment valid or invalid
4492 # returns the comment
4493 this shape seems to be valid
4496 *This test is performed using the tolerance set in the algorithm.*
4502 @subsection occt_2142243456_186943666972 Curve and surface topology
4504 This group of commands is used to create topology from shapes and to extract shapes from geometry.
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.
4514 @subsubsection occt_2142243456_1869436669721 vertex
4516 Syntax: vertex name [x y z / p edge]
4518 Creates a vertex at either a 3d location x,y,z or the point at parameter p on an edge.
4524 @subsubsection occt_2142243456_1869436669722 edge, mkedge, uisoedge, visoedge
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
4531 **edge **creates a straight line edge between two vertices.
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.
4536 # straight line edge
4541 # make a circular edge
4545 # A similar result may be achieved by trimming the curve
4546 # The trimming is removed by mkedge
4550 **visoedge **and **uisoedge **are commands that generate a uiso parameter edge
4551 or a viso parameter edge.
4555 # to create an edge between v1 and v2 at point u
4556 # to create the example plane
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
4570 @subsubsection occt_2142243456_1869436669723 wire, polyline, polyvertex
4572 Syntax: wire wirename e1/w1 [e2/w2 ...]
4573 polyline name x1 y1 z1 x2 y2 z2 ...
4574 polyvertex name v1 v2 ...
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.
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.
4580 **polyvertex **creates a polygonal wire from vertices.
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
4590 @subsubsection occt_2142243456_1869436669724 profile
4592 Syntax profile name [code values] [code values] ...
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
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
4613 No suffix Makes a closed face
4614 W Make a closed wire
4615 WW Make an open wire
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.
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.
4622 The point [code values] can be repeated any number of times and in any order to create the profile contour.
4624 The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
4626 Code letters are not case-sensitive.
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
4634 # to create a contour using the different code
4637 # two vertices in the xy plane
4638 profile p F 1 0 x 2 y 1 ww
4640 # to view from a point normal to the plane
4643 # add a circular element of 45 degrees
4644 profile p F 1 0 x 2 y 1 c 1 45 ww
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
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
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
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
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
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
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
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
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
4674 @subsubsection occt_2142243456_1869436669725 bsplineprof
4676 Syntax: bsplineprof name [S face] [W WW]
4678 for an edge : digitizes ... mouse button 2
4679 to end profile : mouse button 3
4681 Build a profile in the XY plane from digitizes
4682 By default the profile is closed and a face is built.
4684 W Make a closed wire
4685 WW Make an open wires
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.
4689 The profile shape definition is the suffix; no suffix produces a face, **w **is a closed wire, **ww **is an open wire.
4692 #to view the xy plane
4694 #to create a 2d curve with the mouse
4696 # click mb1 to start the curve
4697 # click mb1 to create the second vertex
4698 # click mb1 to create a curve
4700 #click mb2 to finish the curve and start a new curve
4702 # click mb1 to create the second curve
4703 # click mb3 to create the face
4706 @subsubsection occt_2142243456_1869436669726 mkoffset
4708 Syntax: mkoffset result face/compound of wires nboffset stepoffset
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.
4712 The offset distance defines the spacing and the positionning of the occurences.
4715 #Create a box and select a face
4718 #Create three exterior parallel contours with an offset
4721 Create one interior parallel contour with an offset
4724 mkoffset r b_1 1 -0.4
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*
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
4740 @subsubsection occt_2142243456_1869436669727 mkplane, mkface
4742 Syntax: mkplane name wire
4743 mkface name surface [ufirst ulast vfirst vlast]
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.
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.
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
4754 # make a cylindrical face
4756 trim g g -pi/3 pi/2 0 15
4760 @subsubsection occt_2142243456_1869436669728 mkcurve, mksurface
4762 Syntax: mkcurve curve edge
4765 **mkcurve **creates a 3d curve from an edge. The curve will be trimmed to the edge boundaries.
4767 **mksurface **creates a surface from a face. The surface will not be trimmed.
4776 @subsubsection occt_2142243456_1869436669729 pcurve
4778 Syntax: pcurve [name edgename] facename
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.
4783 # view the pcurves of a face
4792 @subsubsection occt_2142243456_18694366697210 chfid
4794 Syntax: chfi2d result face [edge1 edge2 (F radius/CDD d1 d2/CDA d ang) ....
4796 chfi2d creates chamfers and fillets on 2D objects. Select t:wo adjacent edges and:
4799 * two respective distance values
4800 * a distance value and an angle
4802 The radius value produces a fillet between the two faces.
4804 The distance is the length value from the edge between the two selected faces in a normal direction.
4808 # to create a 2d fillet
4810 profile p x 2 y 2 x -2
4811 chfi2d cfr p . . F 0.3
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
4827 # to create a 2d chamfer using a defined distance and
4830 profile p x 2 y 2 x -2
4831 chfi2d cfr p . . CDA 0.3 75
4838 @subsubsection occt_2142243456_18694366697211 nproject
4840 Syntax: nproject pj e1 e2 e3 ... surf -g -d [dmax] [Tol
4841 [continuity [maxdeg [maxseg]]]
4843 **nproject **creates a shape projection which is normal to the target surface.
4846 # create a curved surface
4855 translate ll 2 -0.5 0
4861 #display in four views
4864 # create the example shape
4865 circle c 1.8 -0.5 1 0 1 0 1 0 0 0.4
4868 # create the normal projection of the shape(circle)
4873 @subsection occt_2142243456_186943666973 Primitives
4875 Primitive commands make it possible to create simple shapes. They include:
4877 * **box **and **wedge **commands.
4878 * **pcylinder**, **pcone**, **psphere**, **ptorus **commands.
4879 * **halfspace **command
4882 @subsubsection occt_2142243456_1869436669731 box, wedge
4884 Syntax: box name [x y z] dx dy dz
4885 wedge name dx dy dz ltx / xmin zmin xmax xmax
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.
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.
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.
4894 # a box at the origin
4898 box b2 30 30 40 10 20 30
4903 # a wedge with a sharp edge (5 faces)
4907 wedge w3 20 20 20 10 10 10 10
4910 @subsubsection occt_2142243456_1869436669732 pcylinder, pcone, psphere, ptorus
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]
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.
4920 **pcylinder **creates a cylindrical block with the given radius and height.
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.
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.
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.
4932 # a quarter of a truncated cone
4933 pcone co 15 10 10 90
4935 # three-quarters of sphere
4940 @subsubsection occt_2142243456_1869436669733 halfspace
4942 Syntax: halfspace result face/shell x y z
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.
4949 ==b_1 b_2 b_3 b_4 b_5 b_6
4950 halfspace hr b_3 0.5 0.5 0.5
4954 @subsection occt_2142243456_186943666974 Sweeping
4956 Sweeping creates shapes by sweeping out a shape along a defined path:
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.
4965 @subsubsection occt_2142243456_1869436669741 prism
4967 Syntax: prism result base dx dy dz [Copy | Inf | SemiInf]
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.
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.
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
4979 @subsubsection occt_2142243456_1869436669742 revol
4981 Syntax: revol result base x y z dx dy dz angle [Copy]
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.
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
4992 @subsubsection occt_2142243456_1869436669743 pipe
4994 Syntax: pipe name wire_spine Profile
4996 **pipe **creates a new shape by sweeping a shape known as the profile along a wire known as the spine.
4999 # sweep a circle along a bezier curve to make a solid
5002 beziercurve spine 4 0 0 0 10 0 0 10 10 0 20 10 0
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
5012 @subsubsection occt_2142243456_1869436669744 mksweep, deletesweep, buildsweep, simulsweep
5014 Syntax: mksweep wire
5015 addsweep wire[vertex][-M][-C] [auxiilaryshapedeletesweep wire
5016 setsweep options [arg1 [arg2 [...]]]
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
5028 simulsweep r [n] [option]
5029 buildsweep [r] [option] [Tol]
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.
5033 **mksweep **initializes the sweep creation and defines the wire to be used as the spine.
5035 **addsweep **defines the wire to be used as the profile.
5037 **deletesweep **cancels the choice of profile wire, without leaving the mksweep mode. You can re-select a profile wire.
5039 **setsweep **commands the algorithms used for the construction of the sweep.
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.
5043 **buildsweep **creates the sweep using the arguments defined by all the commands.
5046 #create a sweep based on a semi-circular wire using the
5048 #create a circular figure
5049 circle c2 0 0 0 1 0 0 10
5050 trim c2 c2 -pi/2 pi/2
5056 # to display all the options for a sweep
5058 #to create a sweep using the Frenet algorithm where the
5059 #normal is computed to minimise the torsion
5062 # to simulate the sweep with a visual approximation
5066 @subsubsection occt_2142243456_1869436669745 thrusections
5068 Syntax: thrusections [-N] result issolid isruled wire1 wire2 [..wire..]
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.
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
5079 thrusections th issolid isruled w1 w2 w3
5080 ==thrusections th issolid isruled w1 w2 w3
5081 Tolerances obtenues -- 3d : 0
5088 @subsection occt_2142243456_186943666975 Topological transformation
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.
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.
5097 @subsubsection occt_2142243456_1869436669751 tcopy
5099 Syntax: tcopy name toname [name toname ...]
5101 Copies the structure of one shape, including the geometry, into another, newer shape.
5104 # create an edge from a curve and copy it
5105 beziercurve c 3 0 0 0 10 0 0 20 10 0
5110 # now modify the curve, only e1 and e2 will be modified
5112 @subsubsection occt_2142243456_1869436669752 tmove, treset
5114 Syntax: tmove name [name ...] shape
5115 reset name [name ...]
5117 **tmove **and **reset **modify the location, or the local coordinate system of a shape.
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).
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
5129 # return to original positions
5133 @subsubsection occt_2142243456_1869436669753 ttranslate, trotate
5135 Syntax: ttranslate [name ...] dx dy dz
5136 trotate [name ...] x y z dx dy dz angle
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.)
5141 Locations are very economic in the data structure because multiple occurences of an object share the topological description.
5143 # make rotated copies of a sphere in between two cylinders
5144 # create a file source toto.tcl
5146 for {set i 0} {$i 360} {incr i 20} {
5148 trotate s$i 0 0 0 0 0 1 $i
5151 # create two cylinders
5154 ttranslate c2 0 0 20
5158 ttranslate s 25 0 12.5
5160 # call the source file for multiple copies
5164 @subsubsection occt_2142243456_1869436669754 tmirror, tscale
5166 Syntax: tmirror name x y z dx dy dz
5167 tscale name x y z scale
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.
5172 # mirror a portion of cylinder about the YZ plane
5173 pcylinder c1 10 10 270
5175 tmirror c2 15 0 0 1 0 0
5181 @subsection occt_2142243456_186943666976 Old Topological operations
5185 * **fuse**, **cut**, **common **are boolean operations.
5186 * **section**, **psection **compute sections.
5187 * **sewing **joins two or more shapes.
5190 @subsubsection occt_2142243456_1869436669761 fuse, cut, common
5192 Syntax: fuse name shape1 shape2
5193 cut name shape1 shape2
5194 common name shape1 shape2
5196 **fuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
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.
5200 **common **creates a new shape which contains only what is in common between the two original shapes in their intersection.
5203 # all four boolean operations on a box and a cylinder
5205 box b 0 -10 5 20 20 10
5209 ttranslate s1 40 0 0
5212 ttranslate s2 -40 0 0
5215 ttranslate s3 0 40 0
5218 ttranslate s4 0 -40 0
5222 @subsubsection occt_2142243456_1869436669762 section, psection
5224 Syntax: section result shape1 shape2
5225 psection name shape plane
5227 **section **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
5229 **psection **creates a planar section consisting of the edges for the intersection curves on the faces of a shape and a plane.
5232 # section line between a cylinder and a box
5234 box b 0 0 5 15 15 15
5235 trotate b 0 0 0 1 1 1 20
5238 # planar section of a cone
5240 plane p 0 0 15 1 1 2
5244 @subsubsection occt_2142243456_1869436669763 sewing
5246 Syntax: sewing result [tolerance] shape1 shape2 ...
5248 **Sewing **joins shapes by connecting their adjacent or near adjacent edges. Adjacency can be redefined by modifying the tolerance value.
5252 # create two adjacent boxes
5257 sr is a shape COMPOUND FORWARD Free Modified
5260 @subsection occt_2142243456_186943666977 New Topological operations
5263 The new algorithm of Boolean operations avoids a large number of weak points and limitations presented in the old boolean operation algorithm.
5266 @subsubsection occt_2142243456_1869436669771 bop, bopfuse, bopcut, boptuc, bopcommon,
5268 **bop** defines **shape1** and **shape2** subject to ulterior Boolean operations
5270 **bopfuse **creates a new shape by a boolean operation on two existing shapes. The new shape contains both originals intact.
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.
5274 **boptuc **is a reverced** bopcut**.
5276 **bopcommon **creates a new shape which contains only whatever is in common between the two original shapes in their intersection.
5279 Syntax: bop shape1 shape2
5285 These commands have short variants:
5287 bcommon result shape1 shape2
5288 bfuse result shape1 shape2
5289 bcut result shape1 shape2
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.
5297 # all four boolean operations on a box and a cylinder
5299 box b 0 -10 5 20 20 10
5302 # fills data structure
5306 ttranslate s1 40 0 0
5309 ttranslate s2 -40 0 0
5312 ttranslate s3 0 40 0
5315 ttranslate s4 0 -40 0
5318 Short variants of commands:
5321 ttranslate s11 40 0 100
5324 ttranslate s12 -40 0 100
5327 ttranslate s14 0 -40 100
5329 @subsubsection occt_2142243456_1869436669772 bopsection
5331 **bopsection **creates a compound object consisting of the edges for the intersection curves on the faces of two shapes.
5334 Syntax: bop shape1 shape2
5341 bsection result shape1 shape2 [-2d/-2d1/-2s2] [-a]
5344 **bop** fills data structure (DS) of boolean operation for **shape1** and **shape2**.
5345 **bopsection** command used after **bop** command.
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.
5355 # section line between a cylinder and a box
5357 box b 0 0 5 15 15 15
5358 trotate b 0 0 0 1 1 1 20
5365 @subsubsection occt_2142243456_1869436669773 bopcheck, bopargshape
5367 Syntax: bopcheck shape
5368 bopargcheck shape1 [[shape2] [-F/O/C/T/S/U] [/R|F|T|V|E|I|P]] [#BF]
5371 **bopcheck** checks a shape for self-interference.
5373 **bopargcheck** checks the validity of argument(s) for boolean operations.
5382 By default a section is made.
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.
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.
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.
5403 # checks a shape on self-interference
5407 # checks the validity of argument for boolean cut operations
5408 box b2 0 0 0 10 10 10
5409 bopargcheck b1 b2 -C
5412 @subsection occt_2142243456_186943666978 Drafting and blending
5414 Drafting is creation of a new shape by tilting faces through an angle.
5416 Blending is the creation of a new shape by rounding edges to create a fillet.
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.
5425 @subsubsection occt_2142243456_1869436669781 depouille
5427 Syntax: dep result shape dirx diry dirz face angle x y x dx dy dz [face angle...]
5429 **depouille **creates a new shape by drafting one or more faces of a shape.
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.
5433 # draft a face of a box
5436 == b_1 b_2 b_3 b_4 b_5 b_6
5438 dep a b 0 0 1 b_2 10 0 10 0 1 0 5
5441 @subsubsection occt_2142243456_1869436669782 chamf
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
5447 **chamf **creates a chamfer along the edge between faces using:
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
5453 Use the dot syntax to select the faces and edges.
5456 # to create a chamfer based on equal distances from the
5457 edge (45 degree angle)
5460 chamf ch b . . S 0.5
5464 # select an adjacent face
5467 # to create a chamfer based on different distances from
5470 chamf ch b . . 0.3 0.4
5474 # select an adjacent face
5477 # to create a chamfer based on a distance from the edge
5480 chamf ch b . . A 0.4 30
5484 # select an adjacent face
5487 @subsubsection occt_2142243456_1869436669783 blend
5489 Syntax: blend result object rad1 ed1 rad2 ed2 ... [R/Q/P]
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.
5494 # blend a box, click on an edge
5497 ==tolerance ang : 0.01
5498 ==tolerance 3d : 0.0001
5499 ==tolerance 2d : 1e-05
5501 ==tolblend 0.01 0.0001 1e-05 0.001
5503 # click on the edge you want ot fillet
5505 ==COMPUTE: temps total 0.1s dont :
5506 ==- Init + ExtentAnalyse 0s
5507 ==- PerformSetOfSurf 0.02s
5508 ==- PerformFilletOnVertex 0.02s
5510 ==- Reconstruction 0.06s
5514 @subsubsection occt_2142243456_1869436669784 fubl
5516 Syntax: fubl name shape1 shape2 radius
5518 **fubl **creates a boolean fusion of two shapes and then blends (fillets) the intersection edges using the given radius.
5521 # fuse-blend two boxes
5524 ttranslate b2 -10 10 3
5526 See also: **fuse**, **blend**
5529 @subsubsection occt_2142243456_1869436669785 mkevol, updatevol, buildevol
5531 Syntax: mkevol result object (then use updatevol) [R/Q/P]
5532 updatevol edge u1 radius1 [u2 radius2 ...]
5535 These three commands work together to create fillets with evolving radii.
5537 **mkevol **allows you to specify the shape and the name of the result. It returns the tolerances of the fillet.
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.
5541 **buildevol **produces the result described previously in **mkevol **and **updatevol**.
5544 # makes an evolved radius on a box
5547 ==tolerance ang : 0.01
5548 ==tolerance 3d : 0.0001
5549 ==tolerance 2d : 1e-05
5551 ==tolblend 0.01 0.0001 1e-05 0.001
5554 updatevol . 0 1 1 3 2 2
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
5564 ==COMPUTE: temps total 0.91s dont :
5565 ==- Init + ExtentAnalyse 0s
5566 ==- PerformSetOfSurf 0.33s
5567 ==- PerformFilletOnVertex 0.53s
5569 ==- Reconstruction 0.04s
5574 @subsection occt_2142243456_186943666979 Topological analysis
5576 Analysis of shapes includes commands to compute length, area, volumes and inertial properties.
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.
5585 @subsubsection occt_2142243456_1869436669791 lprops, sprops, vprops
5587 Syntax: lprops shape
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.
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.
5596 # volume of a cylinder
5600 Mass : 6283.18529981086
5603 X = 4.1004749224903e-06
5604 Y = -2.03392858349861e-16
5608 366519.141445068 5.71451850691484e-12
5610 5.71451850691484e-12 366519.141444962
5611 2.26823064169991e-10 0.257640437382627
5612 2.26823064169991e-10 314159.265358863
5615 IX = 366519.141446336
5616 IY = 366519.141444962
5617 I.Z = 314159.265357595
5621 @subsubsection occt_2142243456_1869436669792 bounding
5623 Syntax: bounding shape
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.*
5628 # bounding box of a torus
5631 ==-27.059805107309852 -27.059805107309852 -
5633 ==27.059805107309852 27.059805107309852
5637 @subsubsection occt_2142243456_1869436669793 distmini
5639 Syntax: distmini name Shape1 Shape2
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.
5644 box b 0 0 0 10 20 30
5645 box b2 30 30 0 10 20 30
5647 ==the distance value is : 22.3606797749979
5648 ==the number of solutions is :2
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:
5655 ==the coordinates of the point on the second shape
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:
5664 ==the coordinates of the point on the second shape
5673 @subsection occt_2142243456_1869436669710 Surface creation
5675 Surface creation commands include surfaces created from boundaries and from spaces between shapes.
5677 * gplate creates a surface from a boundary definition.
5678 * filling creates a surface from a group of surfaces.
5681 @subsubsection occt_2142243456_18694366697101 gplate,
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] ...
5685 **gplate **creates a surface from a defined boundary. The boundary can be defined using edges, points, or other surfaces.
5692 beziercurve c1 3 0 0 0 1 0 1 2 0 0
5698 trotate e3 0 0 0 0 0 1 90
5701 # create the surface
5702 gplate r1 4 0 p e1 0 e2 0 e3 0 e4 0
5704 ======== Results ===========
5705 DistMax=8.50014503228635e-16
5707 Calculation time: 0.33
5709 Approximation results
5710 Approximation error : 2.06274907619957e-13
5711 Criterium error : 4.97600631215754e-14
5713 #to create a surface defined by edges and passing through a point
5714 # to define the border edges and the point
5719 beziercurve c1 3 0 0 0 1 0 1 2 0 0
5725 trotate e3 0 0 0 0 0 1 90
5730 # to create the surface
5731 gplate r2 4 1 p e1 0 e2 0 e3 0 e4 0 pp
5733 ======== Results ===========
5734 DistMax=3.65622157610934e-06
5736 Calculculation time: 0.27
5738 Approximation results
5739 Approximation error : 0.000422195884750181
5740 Criterium error : 3.43709808053967e-05
5742 @subsubsection occt_2142243456_18694366697102 filling, fillingparam
5744 Syntax: filling result nbB nbC nbP [SurfInit] [edge][face]order...
5745 edge[face]order... point/u v face order...
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.
5749 To define the surface border:
5751 * enter the number of edges, constraints, and points
5752 * enumerate the edges, constraints and points
5754 The surface can pass through other points. These are defined after the border definition.
5756 You can use the **fillingparam **command to access the filling parameters.
5760 -l : to list current values
5762 -i : to set default values
5764 -r deg nbPonC nbIt anis : to set filling options
5766 -c t2d t3d tang tcur : to set tolerances
5768 -a maxdeg maxseg : Approximation option
5771 # to create four curved survaces and a point
5776 beziercurve c1 3 0 0 0 1 0 1 2 0 0
5782 trotate e3 0 0 0 0 0 1 90
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
5799 # to display the current filling parameters
5817 @subsection occt_2142243456_1869436669711 Complex Topology
5819 Complex topology is the group of commands that modify the topology of shapes. This includes feature modeling.
5822 @subsubsection occt_2142243456_18694366697111 offsetshape, offsetcompshape
5824 Syntax: offsetshape r shape offset [tol] [face ...]
5825 offsetcompshape r shape offset [face ...]
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.
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.
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.
5834 The opening between the object interior and exterior is defined by the argument face or faces.
5839 == b1_1 b1_2 b1_3 b1_4 b1_5 b1_6
5840 offsetcompshape r b1 -1 b1_3
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
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.
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.
5855 **offsetperform** performs the result of 3d-offset algorithm using the data loaded by previous commands.
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
5864 offsetperform result
5868 @subsubsection occt_2142243456_18694366697112 featprism, featdprism, featrevol, featlf, featrf
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
5878 **featprism **loads the arguments for a prism with contiguous sides normal to the face.
5880 **featdprism **loads the arguments for a prism which is created in a direction normal to the face and includes a draft angle.
5882 **featrevol **loads the arguments for a prism with a circular evolution.
5884 **featlf **loads the arguments for a linear rib or slot. This feature uses planar faces and a wire as a guideline.
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.
5888 **featperform **loads the arguments to create the feature.
5890 **featperformval **uses the defined arguments to create a feature with a limiting value.
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.
5895 # to create a feature prism with a draft angle and a
5897 # create a box with a wire contour on the upper face
5899 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
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 ()
5911 # to create a feature prism with circular direction
5912 # create a box with a wire contour on the upper face
5914 profil f O 0 0 1 F 0.25 0.25 x 0.5 y 0.5 x -0.5
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 ()
5925 # to create a slot using the linear feature
5926 #create the base model using the multi viewer
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
5930 # create the contour for the linear feature
5931 vertex v1 -0.2 4 0.3
5933 vertex v3 0.2 0.2 0.3
5935 vertex v5 4 -0.2 0.3
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
5947 # to create a rib using the revolution feature
5948 #create the base model using the multi viewer
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
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
5962 @subsubsection occt_2142243456_18694366697113 draft
5964 Syntax: draft result shape dirx diry dirz angle shape/surf/length [-IN/-OUT] [Ri/Ro] [-Internal]
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.
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
5972 draft surface are angular or rounded.
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.
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.*
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
5997 @subsubsection occt_2142243456_18694366697114 deform, nurbsconvert
5999 Syntax: deform newname name CoeffX CoeffY CoeffZ
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.
6003 Syntax nurbsconvert result name [result name]
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.
6010 # the conversion to bspline is followed by the
6015 @subsection occt_2142243456_1869436669712 Texture Mapping to a Shape
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.
6019 @subsubsection occt_2142243456_18694366697121 vtexture
6021 Syntax vtexture NameOfShape TextureFile
6022 vtexture NameOfShape
6023 vtexture NameOfShape ?
6024 vtexture NameOfShape IdOfTexture
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.
6028 @subsubsection occt_2142243456_18694366697122 vtexscale
6030 Syntax: vtexscale NameOfShape ScaleU ScaleV
6031 vtexscale NameOfShape ScaleUV
6032 vtexscale NameOfShape
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.
6036 @subsubsection occt_2142243456_18694366697123 vtexorigin
6038 Syntax vtexorigin NameOfShape UOrigin VOrigin
6039 vtexorigin NameOfShape UVOrigin
6040 vtexorigin NameOfShape
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.
6044 @subsubsection occt_2142243456_18694366697124 vtexrepeat
6046 Syntax vtexrepeat NameOfShape URepeat VRepeat
6047 vtexrepeat NameOfShape UVRepeat
6048 vtexrepeat NameOfShape
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.
6052 @subsubsection occt_2142243456_18694366697125 vtexdefault
6054 Syntax vtexdefault NameOfShape
6056 **Vtexdefault **sets or resets the texture mapping default parameters.
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
6066 @subsection occt_2142243456_186693113581 General
6068 This paragraph presents some general information about Data Exchange (DE) operations.
6070 DE commands are intended for translation files of various formats (IGES,STEP) into OCCT shapes with their attributes (colors, layers etc.)
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.
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.
6081 @subsection occt_2142243456_186693113582 IGES commands
6083 These commands are used during the translation of IGES models.
6086 @subsubsection occt_2142243456_1866931135821 igesread
6088 Syntax: igesread file_name result_shape_name [selection]
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:
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.
6100 # translation all roots from file
6101 igesread /disk01/files/model.igs a *
6103 @subsubsection occt_2142243456_1866931135822 tplosttrim
6105 Syntax: tplosttrim [IGES_type]
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.
6112 tplosttrim TrimmedSurface
6114 @subsubsection occt_2142243456_1866931135823 brepiges
6116 Syntax: brepiges shape_name filename.igs
6118 Writes an OCCT shape to an IGES file.
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
6133 @subsection occt_2142243456_186693113583 STEP commands
6135 These commands are used during the translation of STEP models.
6138 @subsubsection occt_2142243456_1866931135831 stepread
6140 Syntax: stepread file_name result_shape_name [selection]
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:
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.
6152 # translation all roots from file
6153 stepread /disk01/files/model.stp a *
6155 @subsubsection occt_2142243456_1866931135832 stepwrite
6157 Syntax: stepwrite mode shape_name file_name
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 & 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 ;.
6169 # write shape with name a to STEP file with mode 0
6170 stepwrite 0 a /disk1/tmp/aaa.igs
6174 @subsection occt_2142243456_186693113584 General commands
6176 These commands are auxilary commands. Most of them are used for the analysis of result of translation of IGES and STEP files.
6178 @subsubsection occt_2142243456_1866931135841 count
6180 Syntax: count counter [selection]
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):
6190 @subsubsection occt_2142243456_1866931135842 data
6194 Is used to obtain general statistics on the loaded data.
6195 Information printed by this command depends on the symbol specified:
6198 # print full information about warnings and fails
6201 @subsubsection occt_2142243456_1866931135843 elabel
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.
6210 @subsubsection occt_2142243456_1866931135844 entity
6212 Syntax: entity #(D)_or_num level_of_information
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.
6219 # full information for STEP entity with label 84
6222 @subsubsection occt_2142243456_1866931135845 enum
6226 Prints a number for the entity with a given label.
6229 # give a number for IGES entity with label 21
6232 @subsubsection occt_2142243456_1866931135846 estatus
6234 Syntax: estatus #(D)_or_num
6236 The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by this command.
6241 @subsubsection occt_2142243456_1866931135847 fromshape
6243 Syntax: fromshape shape_name
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.
6250 @subsubsection occt_2142243456_1866931135848 givecount
6252 Syntax: givecount selection_name [selection_name]
6256 givecount xst-model-roots
6258 @subsubsection occt_2142243456_1866931135849 givelist
6260 Syntax: givelist selection_name
6262 Prints a list of a subset of loaded entities defined by the selection argument:
6266 # give a list of all entities of the model
6267 givelist xst-model-all
6269 @subsubsection occt_2142243456_18669311358410 listcount
6271 Syntax: listcount counter [selection ...]
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:
6280 @subsubsection occt_2142243456_18669311358411 listitems
6284 This command prints a list of objects (counters, selections etc.) defined in the current session.
6289 @subsubsection occt_2142243456_18669311358412 listtypes
6291 Syntax: listtypes [selection_name ...]
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.
6296 # full list of all entities with thier counts
6299 @subsubsection occt_2142243456_18669311358413 newmodel
6303 Clears the current model.
6308 @subsubsection occt_2142243456_18669311358414 param
6310 Syntax: param [parameter] [value]
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.
6318 # info about possible schemes for writing STEP file
6319 param write.step.schema
6321 @subsubsection occt_2142243456_18669311358415 sumcount
6323 Syntax: sumcount counter [selection ...]
6325 Prints only a number of entities per each type matching the criteria defined by arguments.
6330 @subsubsection occt_2142243456_18669311358416 tpclear
6334 Clears the map of correspondences between IGES or STEP entities and OCCT shapes.
6339 @subsubsection occt_2142243456_18669311358417 tpdraw
6341 Syntax: tpdraw #(D)_or_num
6347 @subsubsection occt_2142243456_18669311358418 tpent
6349 Syntax: tpent #(D)_or_num
6355 @subsubsection occt_2142243456_18669311358419 tpstat
6357 Syntax: tpstat [*|?]symbol [selection]
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:
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.
6366 # translation ratio on IGES faces
6367 tpstat *l iges-faces
6369 @subsubsection occt_2142243456_18669311358420 xload
6371 Syntax: xload file_name
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.
6376 xload /disk1/tmp/aaa.stp
6380 @subsection occt_2142243456_186693113585 Overview of XDE commands
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**
6392 @subsection occt_2142243456_186693113586 XDE translation commands
6394 Reminding: All operations of translation are performed with parameters managed by command param (see above)
6396 @subsubsection occt_2142243456_1866931135861 ReadIges
6398 Syntax: ReadIges document file_name
6400 Reads information from an IGES file to an XCAF document.
6403 ReadIges D /disk1/tmp/aaa.igs
6404 == Document saved with name D
6406 @subsubsection occt_2142243456_1866931135862 ReadStep
6408 Syntax: ReadStep document file_name
6410 Reads information from a STEP file to an XCAF document.
6413 ReadStep D /disk1/tmp/aaa.stp
6414 == Document saved with name D
6416 @subsubsection occt_2142243456_1866931135863 WriteIges
6418 Syntax: WriteIges document file_name
6422 WriteIges D /disk1/tmp/aaa.igs
6424 @subsubsection occt_2142243456_1866931135864 WriteStep
6426 Syntax: WriteStep document file_name
6428 Writes information from an XCAF document to a STEP file.
6431 WriteStep D /disk1/tmp/aaa.stp
6433 @subsubsection occt_2142243456_1866931135865 XFileCur
6437 Returns the name of file which is set as the current one in the Draw session.
6443 @subsubsection occt_2142243456_1866931135866 XFileList
6447 Returns a list all files that were transferred by the last transfer. This command is meant (assigned) for the assemble step file.
6451 == *as1-ct-Bolt.stp*
6452 == *as1-ct-L-Bracktet.stp*
6457 @subsubsection occt_2142243456_1866931135867 XFileSet
6459 Syntax: XFileSet filename
6461 Sets the current file taking it from the components list of the assemble file.
6464 XFileSet as1-ct-NBA.stp
6466 @subsubsection occt_2142243456_1866931135868 XFromShape
6468 Syntax: XFromShape shape
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.
6474 == Shape a: imported from entity 217:#26 in file as1-ct-Nut.stp
6477 @subsection occt_2142243456_186693113587 XDE general commands
6479 @subsubsection occt_2142243456_1866931135871 XNewDoc
6481 Syntax: XNewDoc document
6483 Creates a new XCAF document.
6488 @subsubsection occt_2142243456_1866931135872 XShow
6490 Syntax: XShow document [ label1 … ]
6492 Shows a shape from a given label in the 3D viewer. If the label is not given – shows all shapes from the document.
6495 # show shape from label 0:1:1:4 from document D
6498 @subsubsection occt_2142243456_1866931135873 XStat
6500 Syntax: XStat document
6502 Prints common information from an XCAF document.
6506 ==Statistis of shapes in the document:
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
6522 @subsubsection occt_2142243456_1866931135874 XWdump
6524 Syntax: XWdump document filename
6526 Saves the contents of the viewer window as an image (XWD, png or BMP file).
6527 filename must have a corresponding extention.
6530 XWdump D /disk1/tmp/image.png
6532 @subsubsection occt_2142243456_1866931135875 Xdump
6534 Syntax: Xdump document [int deep {0|1}]
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.
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)
6554 @subsection occt_2142243456_186693113588 XDE shape’s commands
6556 @subsubsection occt_2142243456_1866931135881 XAddComponent
6558 Syntax: XAddComponent document label shape
6560 Adds a component shape to assembly.
6563 # Add shape b as component shape to assembly shape from
6565 XAddComponent D 0:1:1:1 b
6567 @subsubsection occt_2142243456_1866931135882 XAddShape
6569 Syntax: XAddShape document shape [makeassembly=1]
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.
6574 # add shape b to document D
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
6581 @subsubsection occt_2142243456_1866931135883 XFindComponent
6583 Syntax: XFindComponent document shape
6585 Prints a sequence of labels of the assembly path.
6590 @subsubsection occt_2142243456_1866931135884 XFindShape
6592 Syntax: XFindShape document shape
6594 Finds and prints a label with an indicated top-level shape.
6599 @subsubsection occt_2142243456_1866931135885 XGetFreeShapes
6601 Syntax: XGetFreeShapes document [shape_prefix]
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.
6610 == 0:1:1:6 0:1:1:10 0:1:1:12 0:1:1:13
6613 == sh_1 sh_2 sh_3 sh_4
6615 @subsubsection occt_2142243456_1866931135886 XGetOneShape
6617 Syntax: XGetOneShape shape document
6619 Creates one DRAW shape for all free shapes from a document.
6624 @subsubsection occt_2142243456_1866931135887 XGetReferredShape
6626 Syntax: XGetReferredShape document label
6628 Prints a label that contains a top-level shape that corresponds to a shape at a given label.
6631 XGetReferredShape D 0:1:1:1:1
6633 @subsubsection occt_2142243456_1866931135888 XGetShape
6635 Syntax: XGetShape result document label
6637 Puts a shape from the indicated label in document to result.
6640 XGetShape b D 0:1:1:3
6642 @subsubsection occt_2142243456_1866931135889 XGetTopLevelShapes
6644 Syntax: XGetTopLevelShapes document
6646 Prints labels that contain top-level shapes.
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
6653 @subsubsection occt_2142243456_18669311358810 XLabelInfo
6655 Syntax: XLabelInfo document label
6657 Prints information about a shape, stored at an indicated label.
6660 XLabelInfo D 0:1:1:6
6661 == There are TopLevel Shape. There are an Assembly. This Shape don’t used.
6663 @subsubsection occt_2142243456_18669311358811 XNewShape
6665 Syntax: XNewShape document
6667 Creates a new empty top-level shape.
6672 @subsubsection occt_2142243456_18669311358812 XRemoveComponent
6674 Syntax: XRemoveComponent document label
6676 Removes a component from the components label.
6679 XRemoveComponent D 0:1:1:1:1
6681 @subsubsection occt_2142243456_18669311358813 XRemoveShape
6683 Syntax: XRemoveShape document label
6685 Removes a shape from a document (by it’s label).
6688 XRemoveShape D 0:1:1:2
6690 @subsubsection occt_2142243456_18669311358814 XSetShape
6692 Syntax: XSetShape document label shape
6694 Sets a shape at the indicated label.
6697 XSetShape D 0:1:1:3 b
6700 @subsection occt_2142243456_186693113589 XDE color’s commands
6702 @subsubsection occt_2142243456_1866931135891 XAddColor
6704 Syntax: XAddColor document R G B
6706 Adds color in document to the color table. Parameters R,G,B are real.
6709 XAddColor D 0.5 0.25 0.25
6711 @subsubsection occt_2142243456_1866931135892 XFindColor
6713 Syntax: XFindColor document R G B
6715 Finds a label where the indicated color is situated.
6718 XFindColor D 0.25 0.25 0.5
6721 @subsubsection occt_2142243456_1866931135893 XGetAllColors
6723 Syntax: XGetAllColors document
6725 Prints all colors that are defined in the document.
6729 == RED DARKORANGE BLUE1 GREEN YELLOW3
6731 @subsubsection occt_2142243456_1866931135894 XGetColor
6733 Syntax: XGetColor document label
6735 Returns a color defined at the indicated label from the color table.
6741 @subsubsection occt_2142243456_1866931135895 XGetObjVisibility
6743 Syntax: XGetObjVisibility document {label|shape}
6745 Returns the visibility of a shape.
6748 XGetObjVisibility D 0:1:1:4
6750 @subsubsection occt_2142243456_1866931135896 XGetShapeColor
6752 Syntax: XGetShapeColor document label colortype(s|c)
6754 Returns the color defined by label. If colortype=’s’ – returns surface color, else – returns curve color.
6757 XGetShapeColor D 0:1:1:4 c
6759 @subsubsection occt_2142243456_1866931135897 XRemoveColor
6761 Syntax: XRemoveColor document label
6763 Removes a color from the color table in a document.
6766 XRemoveColor D 0:1:2:1
6768 @subsubsection occt_2142243456_1866931135898 XSetColor
6770 Syntax: XSetColor document {label|shape} R G B
6772 Sets an RGB color to a shape given by label.
6775 XsetColor D 0:1:1:4 0.5 0.5 0.
6777 @subsubsection occt_2142243456_1866931135899 XSetObjVisibility
6779 Syntax: XSetObjVisibility document {label|shape} {0|1}
6781 Sets the visibility of a shape.
6784 # set shape from label 0:1:1:4 as invisible
6785 XSetObjVisibility D 0:1:1:4 0
6787 @subsubsection occt_2142243456_18669311358910 XUnsetColor
6789 Syntax: XUnsetColor document {label|shape} colortype
6791 Unset a color given??? type (‘s’ or ‘c’) for the indicated shape.
6794 XUnsetColor D 0:1:1:4 s
6797 @subsection occt_2142243456_1866931135810 XDE layer’s commands
6799 @subsubsection occt_2142243456_18669311358101 XAddLayer
6801 Syntax: XAddLayer document layer
6803 Adds a new layer in an XCAF document. layer - name of new layer (string).
6808 @subsubsection occt_2142243456_18669311358102 XFindLayer
6810 Syntax: XFindLayer document layer
6812 Prints a label where a layer is situated.
6818 @subsubsection occt_2142243456_18669311358103 XGetAllLayers
6820 Syntax: XGetAllLayers document
6822 Prints all layers in an XCAF document.
6826 == *0:1:1:3* *Bolt* *0:1:1:9*
6828 @subsubsection occt_2142243456_18669311358104 XGetLayers
6830 Syntax: XGetLayers document {shape|label}
6832 Returns names of layers, which are pointed to by links of an indicated shape.
6835 XGetLayers D 0:1:1:3
6838 @subsubsection occt_2142243456_18669311358105 XGetOneLayer
6840 Syntax: XGetOneLayer document label
6842 Prints the name of a layer at a given label.
6845 XGetOneLayer D 0:1:3:2
6847 @subsubsection occt_2142243456_18669311358106 XIsVisible
6849 Syntax: XIsVisible document {label|layer}
6851 Returns 1 if the indicated layer is visible, else returns 0.
6854 XIsVisible D 0:1:3:1
6856 @subsubsection occt_2142243456_18669311358107 XRemoveAllLayers
6858 Syntax: XRemoveAllLayers document
6860 Removes all layers from an XCAF document.
6865 @subsubsection occt_2142243456_18669311358108 XRemoveLayer
6867 Syntax: XRemoveLayer document {label|layer}
6869 Removes the indicated layer from an XCAF document.
6872 XRemoveLayer D layer2
6874 @subsubsection occt_2142243456_18669311358109 XSetLayer
6876 Syntax: XSetLayer document {shape|label} layer
6877 [shape_in_one_layer {0|1}]
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).
6883 XSetLayer D 0:1:1:2 layer2
6885 @subsubsection occt_2142243456_186693113581010 XSetVisibility
6887 Syntax: XSetVisibility document {label|layer} isvisible {0|1}
6889 Sets the visibility of a layer.
6892 # set layer at label 0:1:3:2 as invisible
6893 XSetVisibility D 0:1:3:2 0
6895 @subsubsection occt_2142243456_186693113581011 XUnSetAllLayers
6897 Syntax: XUnSetAllLayers document {label|shape}
6899 Unsets a shape from all layers.
6902 XUnSetAllLayers D 0:1:1:2
6904 @subsubsection occt_2142243456_186693113581012 XUnSetLayer
6906 Syntax: XUnSetLayer document {label|shape} layer
6908 Unsets a shape from the indicated layer.
6911 XUnSetLayer D 0:1:1:2 layer1
6914 @subsection occt_2142243456_1866931135811 XDE property’s commands
6916 @subsubsection occt_2142243456_18669311358111 XCheckProps
6918 Syntax: XCheckProps document [ {0|deflection} [shape|label] ]
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.
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
6931 @subsubsection occt_2142243456_18669311358112 XGetArea
6933 Syntax: XGetArea document {shape|label}
6935 Returns the area of a given shape.
6939 == 24628.31815094999
6941 @subsubsection occt_2142243456_18669311358113 XGetCentroid
6943 Syntax: XGetCentroid document {shape|label}
6945 Returns the center of gravity coordinates of a given shape.
6948 XGetCentroid D 0:1:1:1
6950 @subsubsection occt_2142243456_18669311358114 XGetVolume
6952 Syntax: XGetVolume document {shape|label}
6954 Returns the volume of a given shape.
6957 XGetVolume D 0:1:1:1
6959 @subsubsection occt_2142243456_18669311358115 XSetArea
6961 Syntax: XSetArea document {shape|label} area
6963 Sets new area to attribute list ??? given shape.
6966 XSetArea D 0:1:1:1 2233.99
6968 @subsubsection occt_2142243456_18669311358116 XSetCentroid
6970 Syntax: XSetCentroid document {shape|label} x y z
6972 Sets new center of gravity to the attribute list ??? given shape.
6975 XSetCentroid D 0:1:1:1 0. 0. 100.
6977 @subsubsection occt_2142243456_18669311358117 XSetMaterial
6979 Syntax: XSetMaterial document {shape|label} name
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.
6985 XSetMaterial D 0:1:1:1 Titanium 8899.77
6987 @subsubsection occt_2142243456_18669311358118 XSetVolume
6989 Syntax: XSetVolume document {shape|label} volume
6991 Sets new volume to the attribute list ??? given shape.
6994 XSetVolume D 0:1:1:1 444555.33
6996 @subsubsection occt_2142243456_18669311358119 XShapeMassProps
6998 Syntax: XShapeMassProps document [ deflection [{shape|label}] ]
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.
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
7011 @subsubsection occt_2142243456_186693113581110 XShapeVolume
7013 Syntax: XShapeVolume shape deflection
7015 Calculates the real volume of a pointed shape with a given deflection.
7020 @section occt_2142243456_1672096717 Shape Healing commands
7024 @subsection occt_2142243456_16720967171 General commands
7026 @subsubsection occt_2142243456_1672096717111 bsplres
7028 Syntax: bsplres result shape tol3d tol2d reqdegree reqnbsegments continuity3d continuity2d PriorDeg RationalConvert
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).
7032 @subsubsection occt_2142243456_1672096717112 checkfclass2d
7034 Syntax: checkfclass2d face ucoord vcoord
7036 Shows where a point which is given by coordinates is located in relation to a given face – outbound, inside or at the bounds.
7039 checkfclass2d f 10.5 1.1
7042 @subsubsection occt_2142243456_1672096717113 checkoverlapedges
7044 Syntax: checkoverlapedges edge1 edge2 [toler domaindist]
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.
7049 checkoverlapedges e1 e2
7051 @subsubsection occt_2142243456_1672096717114 comtol
7053 Syntax: comptol shape [nbpoints] [prefix]
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.
7060 == Edges tolerance computed by 871 points:
7061 == MAX=8.0001130696523449e-008 AVG=6.349346868091096e-009
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
7069 @subsubsection occt_2142243456_1672096717115 convtorevol
7071 Syntax: convtorevol result shape
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.
7079 @subsubsection occt_2142243456_1672096717116 directfaces
7081 Syntax: directfaces result shape
7083 Converts indirect surfaces and returns the results into the shape, which is given as the result parameter.
7088 @subsubsection occt_2142243456_1672096717117 expshape
7090 Syntax: expshape shape maxdegree maxseg
7092 Gives statistics for a given shape. This test command is working with Bezier and BSpline entities.
7096 == Number of Rational Bspline curves 128
7097 == Number of Rational Bspline pcurves 48
7099 @subsubsection occt_2142243456_1672096717118 fixsmall
7101 Syntax: fixsmall result shape [toler=1.]
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.
7108 @subsubsection occt_2142243456_1672096717119 fixsmalledges
7110 Syntax: fixsmalledges result shape [toler mode maxangle]
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.
7115 fixsmalledges r a 0.1 1
7117 @subsubsection occt_2142243456_16720967171110 fixshape
7119 Syntax: fixshape result shape [preci [maxpreci]] [{switches}]
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:
7127 o - FixOrientationMode
7129 m - FixMissingSeamMode
7130 d - FixDegeneratedMode
7132 i - FixSelfIntersectionMode
7133 n - FixNotchedEdgesMode
7134 For enhanced message output, use switch '+?'
7139 @subsubsection occt_2142243456_16720967171111 fixwgaps
7141 Syntax: fixwgaps result shape [toler=0]
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.
7148 @subsubsection occt_2142243456_16720967171112 offsetcurve, offset2dcurve
7150 Syntax: offsetcurve result curve offset direction(as point)
7151 offset2dcurve result curve offset
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.
7157 offsetcurve r c 20 pp
7159 @subsubsection occt_2142243456_16720967171113 projcurve
7161 Syntax: projcurve edge|curve3d|curve3d first last X Y Z
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.
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
7173 @subsubsection occt_2142243456_16720967171114 projface
7175 Syntax: projface face X Y [Z]
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.
7180 projface a_1 10.0 0.0
7181 == Point UV U = 10 V = 0
7182 == = proj X = -116 Y = -45 Z = 0
7184 @subsubsection occt_2142243456_16720967171115 scaleshape
7186 Syntax: scaleshape result shape scale
7190 scaleshape r a_1 0.8
7192 @subsubsection occt_2142243456_16720967171116 settolerance
7194 Syntax: settolerance shape [mode=v-e-w-f-a] val(fix value) or
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.
7200 settolerance a 0.001
7202 @subsubsection occt_2142243456_16720967171117 splitface
7204 Syntax: splitface result face [u usplit1 usplit2...] [v vsplit1 vsplit2 ...]
7206 Splits a given face in parametric space and puts the result into the given parameter result.
7207 Returns the status of split face.
7210 # split face f by parameter u = 5
7212 == Splitting by U: ,5
7215 @subsubsection occt_2142243456_16720967171118 statshape
7217 Syntax: statshape shape [particul]
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.
7225 == 402 Edge (oriented)
7226 == 402 Edge (Shared)
7229 == 804 Vertex (Oriented)
7230 == 402 Vertex (Shared)
7232 == 4 Face with more than one wire
7233 == 34 bspsur: BSplineSurface
7235 @subsubsection occt_2142243456_16720967171119 tolerance
7237 Syntax: tolerance shape [mode:D v e f c] [tolmin tolmax:real]
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.
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
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
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.
7256 @subsubsection occt_2142243456_1672096717121 DT_ClosedSplit
7258 Syntax: DT_ClosedSplit result shape
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.
7266 @subsubsection occt_2142243456_1672096717122 DT_ShapeConvert, DT_ShapeConvertRev
7268 Syntax: DT_ShapeConvert result shape convert2d convert3d
7269 DT_ShapeConvertRev result shape convert2d convert3d
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.
7274 DT_ShapeConvert r a 1 1
7277 @subsubsection occt_2142243456_1672096717123 DT_ShapeDivide
7279 Syntax: DT_ShapeDivide result shape tol
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
7288 DT_ShapeDivide r a 0.001
7291 @subsubsection occt_2142243456_1672096717124 DT_SplitAngle
7293 Syntax: DT_SplitAngle result shape [MaxAngle=95]
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.
7302 @subsubsection occt_2142243456_1672096717125 DT_SplitCurve
7304 Syntax: DT_SplitCurve curve tol split(0|1)
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.
7311 @subsubsection occt_2142243456_1672096717126 DT_SplitCurve2d
7313 Syntax: DT_SplitCurve2d Curve Tol Split(0/1)
7315 Works just as DT_SplitCurve (see above), only with 2d curve.
7320 @subsubsection occt_2142243456_1672096717127 DT_SplitSurface
7322 Syntax: DT_SplitSurface result Surface|GridSurf tol split(0|1)
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.
7327 # split surface with name ‘su’
7328 DT_SplitSurface res su 0.1 1
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
7335 == transfert resultat
7336 == res1_1_1 res1_2_1 res1_3_1 res1_4_1 res1_5_1 res1_6_1
7339 @subsubsection occt_2142243456_1672096717128 DT_ToBspl
7341 Syntax: DT_ToBspl result shape
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.
7347 == error = 5.20375663162094e-08 spans = 10
7348 == Surface is aproximated with continuity 2
7350 @section occt_2142243456_1640587828 Performance evaluation commands
7353 @subsubsection occt_2142243456_16405878281.1 VDrawSphere
7355 Syntax: vdrawsphere shapeName Fineness [X=0.0 Y=0.0 Z=0.0] [Radius=100.0] [ToEnableVBO=1] [NumberOfViewerUpdate=1] [ToShowEdges=0]
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.
7359 This command can be used for visualization performance evaluation instead of the outdated Visualization Performance Meter.
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
7366 @section occt_2142243456_713659999 Extending Test Harness with custom commands
7369 The following chapters explain how to extend Test Harness with custom commands and how to activate them using a plug-in mechanism.
7372 @subsection occt_2142243456_7136599991 Custom command implementation
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.
7377 static Standard_Integer myadvcurve(Draw_Interpretor& di,
7384 For examples of existing commands refer to Open CASCADE Technology (e.g. GeomliteTest.cxx).
7387 @subsection occt_2142243456_7136599992 Registration of commands in Test Harness
7389 To become available in the Test Harness the custom command must be registered in it. This should be done as follows.
7392 void MyPack::CurveCommands(Draw_Interpretor& theCommands)
7395 char* g = ;Advanced curves creation;;
7398 theCommands.Add ( ;myadvcurve;, ;myadvcurve name p1 p2 p3 –
7399 Creates my advanced curve from points;,
7400 __FILE__, myadvcurve, g);
7404 @subsection occt_2142243456_7136599993 Creating a toolkit (library) as a plug-in
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.
7411 #include Draw_PluginMacro.hxx
7413 void MyPack::Factory(Draw_Interpretor& theDI)
7417 MyPack::CurveCommands(theDI);
7421 // Declare entry point PLUGINFACTORY
7425 @subsection occt_2142243456_7136599994 Creation of the plug-in resource file
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):
7433 ! Hierarchy of plug-ins
7434 ALL : ADVMODELING, MESHING
7436 ADVMODELING : ADVSURF, ADVCURV
7438 ! Mapping from naming to toolkits (libraries)
7439 ADVSURF : TKMyAdvSurf
7440 ADVCURV : TKMyAdvCurv
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.
7447 @subsection occt_2142243456_7136599995 Dynamic loading and activation
7449 Loading a plug-in and activating its commands is described in the *;Activation of the commands implemented in the plug-in;* chapter.
7451 The procedure consists in defining the system variables and using the pload commands in the Test Harness session.
7455 Draw[] set env(CSF_MyDrawPluginDefaults) /users/test