0031939: Coding - correction of spelling errors in comments [part 3]
[occt.git] / dox / samples / draw_scripts.md
CommitLineData
0a6d9742
VS
1Draw Demo Scripts {#samples__draw_scripts}
2================
3
4All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please
5follow the steps below:
6
71. Start DRAWEXE
82. Type *cd ../..* to return to the root directory
93. Type *cd samples/tcl* to reach the *DrawResources* directory
104. Type *source \<demo_file\>* to run the demonstration file provided with Open CASCADE. The following demonstration
11files are available:
12 * <b>DataExchangeDemo.tcl</b>: demonstrates sample sequence of operations with writing and reading IGES file
13 * <b>ModelingDemo.tcl</b>: demonstrates creation of simple shape and displaying it in HLR mode
14 * <b>VisualizationDemo.tcl</b>: demonstrates use of 3d viewer
15 * <b>cad.tcl</b>: creates solid shape looking like abbreviation "CAD"
16 * <b>bottle.tcl</b>: creates bottle as in OCCT Tutorial
17 * <b>drill.tcl</b>: creates twist drill bit shape
18 * <b>cutter.tcl</b>: creates milling cutter shape
19 * <b>xde.tcl</b>: demonstrates creation of simple assembly in XDE
20 * <b>materials.tcl</b>: demonstrates visual properties of materials supported by 3d viewer
21 * <b>raytrace.tcl</b>: demonstrates use of ray tracing display in 3d viewer
22 * <b>dimensions.tcl</b>: demonstrates use of dimensions, clipping, and capping in 3d viewer
23 * ...
24
25Draw is a command interpreter based on TCL and a graphical system used for testing and demonstrating OCCT modeling libraries.
26
27Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
28
29@figure{/introduction/images/overview_draw.png}
30
31Scripts can be written to customize Draw and perform tests.
32New types of objects and new commands can be added using C++ programming language.
33
34Draw contains:
35
36 * A command interpreter based on TCL command language.
37 * A 2D an 3D graphic viewer with support of operations such as zoom, pan, rotation and full-screen views.
38 * An optional set of geometric commands to create and modify curves and surfaces and to use OCCT geometry algorithms.
39 * A set of topological commands to create and modify BRep shapes and to use OCCT topology algorithms.
40 * A set of graphic commands for view and display operations including Mesh Visualization Service.
41 * A set of Application framework commands for handling of files and attributes.
42 * A set of Data Exchange commands for translation of files from various formats (IGES,STEP) into OCCT shapes.
43 * A set of Shape Healing commands: check of overlapping edges, approximation of a shape to BSpline, etc.
44
45You can add new custom test harness commands to Draw in order to test
46or demonstrate a new functionality, which you are developing.
47
48Currently DRAW Test Harness is a single executable called *DRAWEXE*.
49
50Commands grouped in toolkits can be loaded at run-time thereby implementing dynamically loaded plug-ins.
51Thus you can work only with the commands that suit your needs adding
52the commands dynamically without leaving the Test Harness session.
53
54Declaration of available plug-ins is done through special resource file(s).
55The *pload* command loads the plug-in in accordance with
56the specified resource file and activates the commands implemented in the plug-in.
57
58The whole process of using the plug-in mechanism as well as the instructions for extending Test Harness is described in the @ref occt_user_guides__test_harness.
59
60Draw Test Harness provides an environment for OCCT automated testing system.
61Check its @ref occt_contribution__tests "Automated Testing System" for details.
62
63Remarks:
64
65* The DRAWEXE executable is delivered with the installation procedure on Windows platform only.
66* To start it, launch DRAWEXE executable from Open CASCADE Technology/Draw Test Harness item of the Start\\Programs menu.
67
68Experimenting with Draw Test Harness
69------------------------------------
70
71 Running Draw
72------------
73
74**On Linux:**
75
76* If OCCT was built by Code::Blocks use <i>$CASROOT/draw.sh</i> file to launch *DRAWEXE* executable.
77
78Draw[1]> prompt appears in the command window
79
80Type *pload ALL*
81
82**On Windows:**
83
84Launch Draw executable from Open CASCADE Technology\\Test Harness\\Draw Test Harness
85item of the Start\\Programs menu or Use <i>$CASROOT\\draw.bat</i> file to launch *DRAWEXE* executable.
86
87Draw[1]> prompt appears in the command window
88
89Type pload ALL
90
91**Creating your first geometric objects**
92
931. In the command window, type *axo* to create an axonometric view
942. Type *box b -10 -10 -10 20 20 20* to create a cube *b* of size 20, parallel to the X Y Z axis and centered on the origin. The cube will be displayed in the axonometric view in wireframe mode.
953. Type *fit* to fill the viewer with the cube
964. Type *pcylinder c 2 30* to create a cylinder *c* of radius 2 and height 30. The cylinder will be displayed in addition to the cube
97
98**Manipulating the view**
99
1001. Type *clear* to erase the view
1012. Type *donly c* to display the cylinder only
1023. Type *donly b* to display the cube only
1034. Type *hlr hlr b* to display the cube in the hidden line removal mode
104
105**Running demonstration files**
106
1071. Type *cd ../..* to return to the root directory
1082. Type *cd samples/tcl* to reach the *DrawResources* directory
1093. Type *source \<demo_file\>* to run the demonstration file provided with Open CASCADE. The following demonstration files are available:
110 * DataExchangeDemo.tcl: demonstrates sample sequence of operations with writing and reading IGES file
111 * ModelingDemo.tcl: demonstrates creation of simple shape and displaying it in HLR mode
112 * VisualizationDemo.tcl: demonstrates use of 3d viewer
113 * cad.tcl: creates solid shape looking like abbreviation "CAD"
114 * bottle.tcl: creates bottle as in OCCT Tutorial
115 * drill.tcl: creates twist drill bit shape
116 * cutter.tcl: creates milling cutter shape
117 * xde.tcl: demonstrates creation of simple assembly in XDE
118 * materials.tcl: demonstrates visual properties of materials supported by 3d viewer
119 * raytrace.tcl: demonstrates use of ray tracing display in 3d viewer
120 * dimensions.tcl: demonstrates use of dimensions, clipping, and capping in 3d viewer
121
122**Getting Help**
123
1241. Type *help* to see all available commands
1252. Type *help \<command_name\>* to find out the arguments for a given command