0023148: Error in stepstrcmp
[occt.git] / src / DrawResources / ModelingDemo.tcl
CommitLineData
b311480e 1# Copyright (c) 1999-2012 OPEN CASCADE SAS
2#
3# The content of this file is subject to the Open CASCADE Technology Public
4# License Version 6.5 (the "License"). You may not use the content of this file
5# except in compliance with the License. Please obtain a copy of the License
6# at http://www.opencascade.org and read it completely before using this file.
7#
8# The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9# main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10#
11# The Original Code and all software distributed under the License is
12# distributed on an "AS IS" basis, without warranty of any kind, and the
13# Initial Developer hereby disclaims all such warranties, including without
14# limitation, any warranties of merchantability, fitness for a particular
15# purpose or non-infringement. Please see the License for the specific terms
16# and conditions governing the rights and limitations under the License.
17
7fd59977 18
19set stationname $tcl_platform(platform)
20if { ${stationname} == "windows" } {
21 proc winfo { aTest aWindow } { return False }
22}
23
24
25proc sage { a} {
26 global stationname
27 if { ${stationname} != "windows" } {
28
29 if { ![winfo exists .h ] } {
30 toplevel .h -bg azure3
31 wm title .h "INFO TEST HARNESS"
32 wm geometry .h +320+20
33
34 }
35 if { [winfo exists .h.m ] } {
36 set astring [.h.m cget -text]
37 set newstring "${astring} \n $a"
38 .h.m configure -text $newstring
39 puts $a
40 } else {
41 message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4\
42 -text $a
43 puts $a
44 }
45 pack .h.m
46 update
47 }
48}
49
50
51smallview
52if { [winfo exists .h ] } {
53 destroy .h
54}
55sage " Creating a box"
56sage " box b -10 -10 -10 20 20 20"
57sage " "
58box b -10 -10 -10 20 20 20
59fit
60nexplode b f
61erase b
62sage " Draft of two lateral faces "
63sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
64sage " nexplode r f"
65sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
66sage " "
67depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
68clear
69nexplode r f
70depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
71clear
72nexplode rr e
73sage " Fillet on four lateral edges, then on the top and bottom edges "
74sage " nexplode rr e"
75sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
76sage " nexplode result e"
77sage " blend result result 2 result_11 3 result_12"
78sage " "
79blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
80erase rr
81erase result
82nexplode result e
83blend result result 2 result_11 3 result_12
84clear
85nexplode result f
86sage " Creating a profile on the top face "
87sage " nexplode result f"
88sage " 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
89"
90sage " "
91profile 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
92sage " Creating a prism"
93sage " prism rr p 0 0 20"
94sage " "
95prism rr p 0 0 20
96fit
97sage " Fusion of this prism with the original part "
98sage " fuse result rr result"
99sage " "
100fuse result rr result
101donl result
102nexplode result f
103erase result
104fit
105
106sage " Opening the top face"
107sage " offsetshape r result -1 0.0001 result_17"
108sage " "
109
110nexplode result f
111offsetshape r result -1 0.0001 result_17
112sage " Creating a cylinder and positionning it"
113sage " pcylinder cyl 2 300"
114sage " trotate cyl cyl 0 0 0 1 0 0 45"
115sage " ttranslate cyl cyl 0 7.5 0"
116sage " "
117pcylinder cyl 2 30
118trotate cyl cyl 0 0 0 1 0 0 45
119ttranslate cyl cyl 0 7.5 0
120sage " Display the Shape on Hidden Line Mode "
121sage " hlr hid r"
122sage ""
123donl r
124hlr hid r
125sage " Display the Shape on HLR Mode "
126sage " hlr nohid r"
127sage " hlr hlr r"
128sage ""
129donl r
130hlr nohid r
131hlr hlr r
132sage "Demo completed"
133