Commit | Line | Data |
---|---|---|
0a6d9742 VS |
1 | Draw Demo Scripts {#samples__draw_scripts} |
2 | ================ | |
3 | ||
4 | All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please | |
5 | follow the steps below: | |
6 | ||
7 | 1. Start DRAWEXE | |
8 | 2. Type *cd ../..* to return to the root directory | |
9 | 3. Type *cd samples/tcl* to reach the *DrawResources* directory | |
10 | 4. Type *source \<demo_file\>* to run the demonstration file provided with Open CASCADE. The following demonstration | |
11 | files 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 | ||
25 | Draw is a command interpreter based on TCL and a graphical system used for testing and demonstrating OCCT modeling libraries. | |
26 | ||
27 | Draw 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 | ||
31 | Scripts can be written to customize Draw and perform tests. | |
32 | New types of objects and new commands can be added using C++ programming language. | |
33 | ||
34 | Draw 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 | ||
45 | You can add new custom test harness commands to Draw in order to test | |
46 | or demonstrate a new functionality, which you are developing. | |
47 | ||
48 | Currently DRAW Test Harness is a single executable called *DRAWEXE*. | |
49 | ||
50 | Commands grouped in toolkits can be loaded at run-time thereby implementing dynamically loaded plug-ins. | |
51 | Thus you can work only with the commands that suit your needs adding | |
52 | the commands dynamically without leaving the Test Harness session. | |
53 | ||
54 | Declaration of available plug-ins is done through special resource file(s). | |
55 | The *pload* command loads the plug-in in accordance with | |
56 | the specified resource file and activates the commands implemented in the plug-in. | |
57 | ||
58 | The 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 | ||
60 | Draw Test Harness provides an environment for OCCT automated testing system. | |
61 | Check its @ref occt_contribution__tests "Automated Testing System" for details. | |
62 | ||
63 | Remarks: | |
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 | ||
68 | Experimenting 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 | ||
78 | Draw[1]> prompt appears in the command window | |
79 | ||
80 | Type *pload ALL* | |
81 | ||
82 | **On Windows:** | |
83 | ||
84 | Launch Draw executable from Open CASCADE Technology\\Test Harness\\Draw Test Harness | |
85 | item of the Start\\Programs menu or Use <i>$CASROOT\\draw.bat</i> file to launch *DRAWEXE* executable. | |
86 | ||
87 | Draw[1]> prompt appears in the command window | |
88 | ||
89 | Type pload ALL | |
90 | ||
91 | **Creating your first geometric objects** | |
92 | ||
93 | 1. In the command window, type *axo* to create an axonometric view | |
94 | 2. 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. | |
95 | 3. Type *fit* to fill the viewer with the cube | |
96 | 4. 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 | ||
100 | 1. Type *clear* to erase the view | |
101 | 2. Type *donly c* to display the cylinder only | |
102 | 3. Type *donly b* to display the cube only | |
103 | 4. Type *hlr hlr b* to display the cube in the hidden line removal mode | |
104 | ||
105 | **Running demonstration files** | |
106 | ||
107 | 1. Type *cd ../..* to return to the root directory | |
108 | 2. Type *cd samples/tcl* to reach the *DrawResources* directory | |
109 | 3. 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 | ||
124 | 1. Type *help* to see all available commands | |
125 | 2. Type *help \<command_name\>* to find out the arguments for a given command |