0026342: No materials are read from STEP
[occt.git] / samples / tcl / ModelingDemo.tcl
CommitLineData
480bf81e 1# Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 2#
ab91ab6f 3#Category: Demos
4#Title: Modeling operations
5#
480bf81e 6# This file is part of Open CASCADE Technology software library.
b311480e 7#
480bf81e 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.
b311480e 13#
480bf81e 14# Alternatively, this file may be used under the terms of Open CASCADE
15# commercial license or contractual agreement.
b311480e 16
03392dd2 17# Command to log a message to both command-line and dialog window
7fd59977 18proc sage { a} {
03392dd2 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
7fd59977 35}
36
03392dd2 37pload MODELING
7fd59977 38
39smallview
40if { [winfo exists .h ] } {
41 destroy .h
42}
43sage " Creating a box"
44sage " box b -10 -10 -10 20 20 20"
45sage " "
46box b -10 -10 -10 20 20 20
47fit
48nexplode b f
49erase b
50sage " Draft of two lateral faces "
51sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
52sage " nexplode r f"
53sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
54sage " "
55depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
56clear
57nexplode r f
58depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
59clear
60nexplode rr e
61sage " Fillet on four lateral edges, then on the top and bottom edges "
62sage " nexplode rr e"
63sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
64sage " nexplode result e"
65sage " blend result result 2 result_11 3 result_12"
66sage " "
67blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
68erase rr
69erase result
70nexplode result e
71blend result result 2 result_11 3 result_12
72clear
73nexplode result f
74sage " Creating a profile on the top face "
75sage " nexplode result f"
76sage " 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"
78sage " "
79profile 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
80sage " Creating a prism"
81sage " prism rr p 0 0 20"
82sage " "
83prism rr p 0 0 20
84fit
85sage " Fusion of this prism with the original part "
86sage " fuse result rr result"
87sage " "
88fuse result rr result
89donl result
90nexplode result f
91erase result
92fit
93
94sage " Opening the top face"
95sage " offsetshape r result -1 0.0001 result_17"
96sage " "
97
98nexplode result f
99offsetshape r result -1 0.0001 result_17
100sage " Creating a cylinder and positionning it"
101sage " pcylinder cyl 2 300"
102sage " trotate cyl cyl 0 0 0 1 0 0 45"
103sage " ttranslate cyl cyl 0 7.5 0"
104sage " "
105pcylinder cyl 2 30
106trotate cyl cyl 0 0 0 1 0 0 45
107ttranslate cyl cyl 0 7.5 0
108sage " Display the Shape on Hidden Line Mode "
109sage " hlr hid r"
110sage ""
111donl r
112hlr hid r
113sage " Display the Shape on HLR Mode "
114sage " hlr nohid r"
115sage " hlr hlr r"
116sage ""
117donl r
118hlr nohid r
119hlr hlr r
120sage "Demo completed"