0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / tcl / ModelingDemo.tcl
1 # Copyright (c) 1999-2014 OPEN CASCADE SAS
2 #
3 #Category: Demos
4 #Title: Modeling operations
5 #
6 # This file is part of Open CASCADE Technology software library.
7 #
8 # This library is free software; you can redistribute it and / or modify it
9 # under the terms of the GNU Lesser General Public version 2.1 as published
10 # by the Free Software Foundation, with special exception defined in the file
11 # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 # distribution for complete text of the license and disclaimer of any warranty.
13 #
14 # Alternatively, this file may be used under the terms of Open CASCADE
15 # commercial license or contractual agreement.
16
17 # Command to log a message to both command-line and dialog window
18 proc sage { a} {
19     if { ![winfo exists .h ] } {
20         toplevel .h -bg azure3
21         wm title .h "INFO TEST HARNESS"
22         wm geometry .h +320+20
23     } 
24     if { [winfo exists .h.m ] } {
25         set astring [.h.m cget  -text]
26         set newstring "${astring} \n $a"
27         .h.m configure -text $newstring 
28         puts $a
29     } else {
30         message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text $a
31         puts $a
32     } 
33     pack .h.m
34     update
35 }
36
37 pload MODELING
38
39 smallview
40 if { [winfo exists .h ] } {
41     destroy .h
42 }
43 sage " Creating a box"
44 sage "    box  b -10 -10 -10 20 20 20"
45 sage " "
46 box b -10 -10 -10 20 20 20
47 fit
48 nexplode b f
49 erase b
50 sage " Draft of two lateral faces "
51 sage "    depouille r b  0 0  -1 b_6 -15 10 -10 10  0 0 -1 "
52 sage "    nexplode r f"
53 sage "    depouille rr r  0 0 -1   r_1 -15 -10 -10 10  0 0 -1 "
54 sage " "
55 depouille r b  0 0  -1 b_6 -15 10 -10 10  0 0 -1 
56 clear
57 nexplode r f
58 depouille rr r  0 0 -1   r_1 -15 -10 -10 10  0 0 -1 
59 clear
60 nexplode rr e
61 sage " Fillet on four lateral edges, then on the top and bottom edges  "
62 sage "    nexplode rr e"
63 sage "    blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
64 sage "    nexplode result e"
65 sage "    blend result result 2 result_11 3 result_12"
66 sage " "
67 blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
68 erase rr
69 erase result
70 nexplode result e
71 blend result result 2 result_11 3 result_12 
72 clear
73 nexplode result f
74 sage " Creating a profile on the top face "
75 sage "    nexplode result f"
76 sage "    profile p  S result_16 F 10 4 D 1 0 C 2 90. Y 8 C 2 90. X -2 C 2 90. Y -8 C 2 90. X 2
77 "
78 sage " "
79 profile p  S result_16 F 10 4 D 1 0 C 2 90. Y 8 C 2 90. X -2 C 2 90. Y -8 C 2 90. X 2
80 sage " Creating a prism"
81 sage "    prism rr p 0 0 20"
82 sage " "
83 prism rr p 0 0 20
84 fit
85 sage " Fusion of this prism with the original part "
86 sage "    fuse result rr result"
87 sage " "
88 fuse result rr result
89 donly result
90 nexplode result f
91 erase result
92 fit
93
94 sage " Opening the top face"
95 sage "    offsetshape r result -1 0.0001 result_17"
96 sage " "
97
98 nexplode result f
99 offsetshape r result -1 0.0001 result_17
100 sage " Creating a cylinder and positionning it"
101 sage "    pcylinder cyl 2 300"
102 sage "    trotate cyl cyl 0 0 0  1 0 0 45"
103 sage "    ttranslate cyl cyl 0 7.5 0"
104 sage " "
105 pcylinder cyl 2 30
106 trotate cyl cyl 0 0 0  1 0 0 45
107 ttranslate cyl cyl 0 7.5 0
108 sage " Display the Shape on Hidden Line Mode "
109 sage "   hlr hid r"
110 sage ""
111 donly r
112 hlr hid r
113 sage " Display the Shape on HLR Mode "
114 sage "   hlr nohid r"
115 sage "   hlr hlr r"
116 sage ""
117 donly r
118 hlr nohid r
119 hlr hlr r
120 sage "Demo completed"