0024886: BRepOffsetAPI_NormalProjection failure
[occt.git] / samples / tcl / DataExchangeDemo.tcl
1 # Copyright (c) 1999-2014 OPEN CASCADE SAS
2 #
3 # This file is part of Open CASCADE Technology software library.
4 #
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.
10 #
11 # Alternatively, this file may be used under the terms of Open CASCADE
12 # commercial license or contractual agreement.
13
14 # Command to log a message to both command-line and dialog window
15 proc sage { a} {
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
32 }
33
34 pload DATAEXCHANGE
35
36 smallview
37 if { [winfo exists .h ] } {
38     destroy .h
39 }
40
41 set ddir .
42 if { [info exists env(CASROOT)] } {
43     set ddir [file join $env(CASROOT) data occ]
44 }
45
46 set tdir .
47 if { [info exist env(TEMP)] } {
48     set tdir $env(TEMP)
49 }
50
51 sage " First, we retrieve a BREP File "
52 sage "    restore $ddir/wing.brep wing"
53 sage " "
54 datadir .
55 restore $ddir/wing.brep wing
56 disp wing
57 fit
58
59 sage "Generate the IGES File of this BREP"
60 sage "   brepiges wing $tdir/wing.igs"
61 sage " "
62 brepiges wing $tdir/wing.igs
63 wait 3
64
65 sage "we delete all DRAW data"
66 sage ""
67 dall
68 fit
69 wait 3
70
71 sage "Restore this IGES File we have created " 
72 sage "   igesbrep $tdir/wing.igs new *"
73 sage ""
74 igesbrep $tdir/wing.igs new *
75 disp new
76 fit
77
78 puts "End IGES Elementary Test " 
79 sage " "
80 file delete $tdir/wing.igs