Test for 0022778: Bug in BRepMesh
[occt.git] / src / DrawResources / Geometry.tcl
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
18 proc cmp {} {
19     dtyp .
20     set name [lastrep id x y b]
21     global $name
22     lastrep id x1 y1 z1 b
23     cfindp $name id x y pole
24     if {[dval pole] == 0} return
25     dset x0 x1 y0 y1 z0 z1 b 0
26     draw id 6 $name
27     while {[dval b] == 0} {
28         pick id x2 y2 z2 b nowait
29         dset dx x2-x1 dy y2-y1 dz z2-z1  x1 x2  y1 y2  z1 z2
30         draw id 6 $name
31         cmovep $name pole dx dy dz
32         draw id 6 $name
33     }
34     draw id 6 $name
35     if {[dval b] == 1} return;
36     dset dx x0-x2 dy y0-y2 dz z0-z2
37     cmovep $name pole dx dy dz
38 }
39
40 proc smp {} {
41     dtyp .
42     set name [lastrep id x y b]
43     global $name
44     lastrep id x1 y1 z1 b
45     sfindp $name id x y upole vpole
46     if {[dval upole] == 0} return
47     dset x0 x1 y0 y1 z0 z1 b 0
48     draw id 6 $name
49     while { [dval b] == 0} {
50         pick id x2 y2 z2 b nowait
51         dset dx x2-x1  dy y2-y1  dz z2-z1 x1 x2 y1 y2 z1 z2
52         draw id 6 $name
53         movep $name upole vpole dx dy dz
54         draw id 6 $name
55     }
56     draw id 6 $name
57     if {[dval b] == 1} return
58     dset dx x0-x2  dy y0-y2  dz z0-z2
59     movep $name upole vpole dx dy dz
60 }
61
62 #################################################
63 # smooth
64 #################################################
65 proc smooth {name tol {file ""}} {
66     if {$file == ""} {
67         uplevel #0 "bsmooth $name $tol"
68     } else {
69         global Draw_DataDir
70         uplevel #0 "bsmooth $name $tol $Draw_DataDir/$file"
71     }
72     return $name
73 }
74
75 help smooth {smooth  cname tol [filename] } "DRAW Variables management"
76
77 #################################################
78 # beziersmooth
79 #################################################
80 proc beziersmooth {name tol deg option {file ""}} {
81     if {$file == ""} {
82         uplevel #0 "bzsmooth $name $tol $deg $option"
83     } else {
84         global Draw_DataDir
85         uplevel #0 "bzsmooth $name $tol  $deg $option $Draw_DataDir/$file"
86     }
87     return $name
88 }
89
90 help beziersmooth { beziersmooth  cname tol deg [-GR -VA -PR] [filename] } "DRAW Variables management"
91
92