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