0024154: Wrong result of CUT operation
[occt.git] / samples / tcl / VisualizationDemo.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
03392dd2 18# Command to log a message to both command-line and dialog window
7fd59977 19proc sage { a} {
03392dd2 20 if { ![winfo exists .h ] } {
21 toplevel .h -bg azure3
22 wm title .h "INFO TEST HARNESS"
23 wm geometry .h +320+20
24 }
25 if { [winfo exists .h.m ] } {
26 set astring [.h.m cget -text]
27 set newstring "${astring} \n $a"
28 .h.m configure -text $newstring
29 puts $a
30 } else {
31 message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text $a
32 puts $a
33 }
34 pack .h.m
35 update
7fd59977 36}
37
38if { [winfo exists .h ] } {
39 destroy .h
40}
41
03392dd2 42pload MODELING VISUALIZATION
43
7fd59977 44sage " Creating the V3D Viewer"
45sage " vinit"
46sage " "
47vinit
48vclear
49clear
50
51sage " Creating the Topological Viewer"
52sage " smallview"
53sage " "
54smallview
55sage " Creating a box"
56sage " box b -10 -10 -10 20 20 20"
57sage " "
58box b -10 -10 -10 20 20 20
59fit
60sage " Display the box in the V3D Viewer"
61sage " vdisplay b"
62sage " "
63vdisplay b
64vfit
65nexplode b f
66erase b
67sage " Draft of two lateral faces "
68sage " nexplode b f"
69sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
70sage " nexplode r f"
71sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
72sage " "
73depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
74clear
75nexplode r f
76depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
77clear
78nexplode rr e
79verase b
80vdisplay rr
81vfit
82sage " Fillet on four lateral edges, then on the top and bottom edges "
83sage " nexplode rr e"
84sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
85sage " nexplode result e"
86sage " blend result result 2 result_11 3 result_12"
87sage " "
88blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
89erase rr
90erase result
91nexplode result e
92blend result result 2 result_11 3 result_12
93clear
94nexplode result f
95verase rr
96vdisplay result
97vfit
98sage " Creating a profile on the top face "
99sage " nexplode result f"
100sage " 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
101"
102sage " "
103profile 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
104sage " Creating a prism"
105sage " prism rr p 0 0 20"
106sage " "
107prism rr p 0 0 20
108sage " Change some attributs : MATERIAL , TRANSPARENCY"
109sage " vsetmaterial rr PLASTIC"
110sage " vsetcolor rr RED"
111sage " vsettransparency result 0.5"
112sage " vsetdispmode 1"
113sage " "
114vdisplay rr
115vsetmaterial rr PLASTIC
116vsettransparency rr 0.5
117vsetcolor rr RED
118vsettransparency result 0.5
119vsetdispmode 1
120vfit
121fit
122sage " Fusion of this prism with the original part "
123sage " fuse result rr result"
124sage " "
125fuse result rr result
126donl result
127vdisplay result
128vdonly result
129vfit
130nexplode result f
131erase result
132fit
133
134sage " Opening the top face"
135sage " offsetshape r result -1 0.0001 result_17"
136sage " "
137nexplode result f
138
139offsetshape r result -1 0.0001 result_17
140vdisplay r
141vdonly r
142vfit
143vsetcolor r MATRABLUE
144vsettransparency r 0
145
146sage " Creating a cylinder and positionning it"
147sage " pcylinder cyl 2 300"
148sage " trotate cyl cyl 0 0 0 1 0 0 45"
149sage " ttranslate cyl cyl 0 7.5 0"
150sage " "
151pcylinder cyl 2 30
152vdisplay cyl
153vsetcolor cyl RED
154vfit
155trotate cyl cyl 0 0 0 1 0 0 45
156ttranslate cyl cyl 0 7.5 0
157vdisplay cyl
158vsetcolor cyl RED
159vfit
160vdisplay cyl
161vsetcolor cyl RED
162vfit
163sage "Demo completed"