1 # Copyright (c) 1999-2014 OPEN CASCADE SAS
4 #Title: Displaying 3d viewer
6 # This file is part of Open CASCADE Technology software library.
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.
14 # Alternatively, this file may be used under the terms of Open CASCADE
15 # commercial license or contractual agreement.
17 # Command to log a message to both command-line and dialog window
19 if { ![winfo exists .h ] } {
20 toplevel .h -bg azure3
21 wm title .h "INFO TEST HARNESS"
22 wm geometry .h +320+20
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
30 message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text $a
37 if { [winfo exists .h ] } {
41 pload MODELING VISUALIZATION
43 sage " Creating the V3D Viewer"
50 sage " Creating the Topological Viewer"
54 sage " Creating a box"
55 sage " box b -10 -10 -10 20 20 20"
57 box b -10 -10 -10 20 20 20
59 sage " Display the box in the V3D Viewer"
66 sage " Draft of two lateral faces "
68 sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
70 sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
72 depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
75 depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
81 sage " Fillet on four lateral edges, then on the top and bottom edges "
83 sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
84 sage " nexplode result e"
85 sage " blend result result 2 result_11 3 result_12"
87 blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
91 blend result result 2 result_11 3 result_12
97 sage " Creating a profile on the top face "
98 sage " nexplode result f"
99 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
102 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
103 sage " Creating a prism"
104 sage " prism rr p 0 0 20"
107 sage " Change some attributs : MATERIAL , TRANSPARENCY"
108 sage " vsetmaterial rr PLASTIC"
109 sage " vsetcolor rr RED"
110 sage " vsettransparency result 0.5"
111 sage " vsetdispmode 1"
114 vsetmaterial rr PLASTIC
115 vsettransparency rr 0.5
117 vsettransparency result 0.5
121 sage " Fusion of this prism with the original part "
122 sage " fuse result rr result"
124 fuse result rr result
133 sage " Opening the top face"
134 sage " offsetshape r result -1 0.0001 result_17"
138 offsetshape r result -1 0.0001 result_17
142 vsetcolor r MATRABLUE
145 sage " Creating a cylinder and positionning it"
146 sage " pcylinder cyl 2 300"
147 sage " trotate cyl cyl 0 0 0 1 0 0 45"
148 sage " ttranslate cyl cyl 0 7.5 0"
154 trotate cyl cyl 0 0 0 1 0 0 45
155 ttranslate cyl cyl 0 7.5 0
162 sage "Demo completed"