occt-gltf-addon-linux-x64 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/LICENSE_LGPL_21.txt +502 -0
  2. package/OCCT_LGPL_EXCEPTION.txt +10 -0
  3. package/README.md +2 -2
  4. package/index.js +63 -1
  5. package/lib/libTKBO.so.8.0.0 +0 -0
  6. package/lib/libTKBRep.so.8.0.0 +0 -0
  7. package/lib/libTKBin.so.8.0.0 +0 -0
  8. package/lib/libTKBinL.so.8.0.0 +0 -0
  9. package/lib/libTKBinTObj.so.8.0.0 +0 -0
  10. package/lib/libTKBinXCAF.so.8.0.0 +0 -0
  11. package/lib/libTKBool.so.8.0.0 +0 -0
  12. package/lib/libTKCAF.so.8.0.0 +0 -0
  13. package/lib/libTKCDF.so.8.0.0 +0 -0
  14. package/lib/libTKDE.so.8.0.0 +0 -0
  15. package/lib/libTKDECascade.so.8.0.0 +0 -0
  16. package/lib/libTKDEIGES.so.8.0.0 +0 -0
  17. package/lib/libTKDEOBJ.so.8.0.0 +0 -0
  18. package/lib/libTKDEPLY.so.8.0.0 +0 -0
  19. package/lib/libTKDESTEP.so.8.0.0 +0 -0
  20. package/lib/libTKDESTL.so.8.0.0 +0 -0
  21. package/lib/libTKDEVRML.so.8.0.0 +0 -0
  22. package/lib/libTKExpress.so.8.0.0 +0 -0
  23. package/lib/libTKFeat.so.8.0.0 +0 -0
  24. package/lib/libTKFillet.so.8.0.0 +0 -0
  25. package/lib/libTKG2d.so.8.0.0 +0 -0
  26. package/lib/libTKG3d.so.8.0.0 +0 -0
  27. package/lib/libTKGeomAlgo.so.8.0.0 +0 -0
  28. package/lib/libTKGeomBase.so.8.0.0 +0 -0
  29. package/lib/libTKHLR.so.8.0.0 +0 -0
  30. package/lib/libTKHelix.so.8.0.0 +0 -0
  31. package/lib/libTKLCAF.so.8.0.0 +0 -0
  32. package/lib/libTKMath.so.8.0.0 +0 -0
  33. package/lib/libTKMesh.so.8.0.0 +0 -0
  34. package/lib/libTKOffset.so.8.0.0 +0 -0
  35. package/lib/libTKPrim.so.8.0.0 +0 -0
  36. package/lib/libTKRWMesh.so.8.0.0 +0 -0
  37. package/lib/libTKService.so.8.0.0 +0 -0
  38. package/lib/libTKShHealing.so.8.0.0 +0 -0
  39. package/lib/libTKStd.so.8.0.0 +0 -0
  40. package/lib/libTKStdL.so.8.0.0 +0 -0
  41. package/lib/libTKTObj.so.8.0.0 +0 -0
  42. package/lib/libTKTopAlgo.so.8.0.0 +0 -0
  43. package/lib/libTKV3d.so.8.0.0 +0 -0
  44. package/lib/libTKVCAF.so.8.0.0 +0 -0
  45. package/lib/libTKXCAF.so.8.0.0 +0 -0
  46. package/lib/libTKXMesh.so.8.0.0 +0 -0
  47. package/lib/libTKXSBase.so.8.0.0 +0 -0
  48. package/lib/libTKXml.so.8.0.0 +0 -0
  49. package/lib/libTKXmlL.so.8.0.0 +0 -0
  50. package/lib/libTKXmlTObj.so.8.0.0 +0 -0
  51. package/lib/libTKXmlXCAF.so.8.0.0 +0 -0
  52. package/lib/libTKernel.so.8.0.0 +0 -0
  53. package/lib/libdraco.so.1 +0 -0
  54. package/lib/libtbb.so.2 +0 -0
  55. package/lib/libtbbmalloc.so.2 +0 -0
  56. package/lib/libtbbmalloc_proxy.so.2 +0 -0
  57. package/occt_gltf_addon.node +0 -0
  58. package/package.json +6 -2
  59. package/resources/BOPAlgo/BOPAlgo.msg +129 -0
  60. package/resources/BOPAlgo/FILES +1 -0
  61. package/resources/DrawResources/CURVES.tcl +38 -0
  62. package/resources/DrawResources/CheckCommands.tcl +1206 -0
  63. package/resources/DrawResources/DrawDefault +130 -0
  64. package/resources/DrawResources/DrawPlugin +64 -0
  65. package/resources/DrawResources/DrawTK.tcl +623 -0
  66. package/resources/DrawResources/FILES +16 -0
  67. package/resources/DrawResources/Geometry.tcl +96 -0
  68. package/resources/DrawResources/InitEnvironment.tcl +50 -0
  69. package/resources/DrawResources/Move.tcl +85 -0
  70. package/resources/DrawResources/OCC_logo.png +0 -0
  71. package/resources/DrawResources/PROFIL.tcl +726 -0
  72. package/resources/DrawResources/SCAN.tcl +192 -0
  73. package/resources/DrawResources/SURFACES.tcl +35 -0
  74. package/resources/DrawResources/StandardCommands.tcl +451 -0
  75. package/resources/DrawResources/StandardViews.tcl +284 -0
  76. package/resources/DrawResources/TKTopTest.tcl +27 -0
  77. package/resources/DrawResources/TestCommands.tcl +2969 -0
  78. package/resources/DrawResources/Vector.tcl +402 -0
  79. package/resources/DrawResources/dfb_attribns.gif +0 -0
  80. package/resources/DrawResources/dfb_attribute.gif +0 -0
  81. package/resources/DrawResources/dfb_folder.gif +0 -0
  82. package/resources/DrawResources/dftree.tcl +381 -0
  83. package/resources/DrawResources/lamp.ico +0 -0
  84. package/resources/SHMessage/FILES +2 -0
  85. package/resources/SHMessage/SHAPE.fr +267 -0
  86. package/resources/SHMessage/SHAPE.us +267 -0
  87. package/resources/Shaders/Declarations.glsl +276 -0
  88. package/resources/Shaders/DeclarationsImpl.glsl +121 -0
  89. package/resources/Shaders/Display.fs +157 -0
  90. package/resources/Shaders/FILES +27 -0
  91. package/resources/Shaders/LightShadow.glsl +48 -0
  92. package/resources/Shaders/PBRCookTorrance.glsl +20 -0
  93. package/resources/Shaders/PBRDirectionalLight.glsl +20 -0
  94. package/resources/Shaders/PBRDistribution.glsl +9 -0
  95. package/resources/Shaders/PBREnvBaking.fs +226 -0
  96. package/resources/Shaders/PBREnvBaking.vs +55 -0
  97. package/resources/Shaders/PBRFresnel.glsl +36 -0
  98. package/resources/Shaders/PBRGeometry.glsl +13 -0
  99. package/resources/Shaders/PBRIllumination.glsl +28 -0
  100. package/resources/Shaders/PBRPointLight.glsl +27 -0
  101. package/resources/Shaders/PBRSpotLight.glsl +45 -0
  102. package/resources/Shaders/PathtraceBase.fs +993 -0
  103. package/resources/Shaders/PhongDirectionalLight.glsl +29 -0
  104. package/resources/Shaders/PhongPointLight.glsl +36 -0
  105. package/resources/Shaders/PhongShading.fs +191 -0
  106. package/resources/Shaders/PhongShading.vs +43 -0
  107. package/resources/Shaders/PhongSpotLight.glsl +52 -0
  108. package/resources/Shaders/PointLightAttenuation.glsl +35 -0
  109. package/resources/Shaders/RaytraceBase.fs +1236 -0
  110. package/resources/Shaders/RaytraceBase.vs +12 -0
  111. package/resources/Shaders/RaytraceRender.fs +134 -0
  112. package/resources/Shaders/RaytraceSmooth.fs +80 -0
  113. package/resources/Shaders/SkydomBackground.fs +300 -0
  114. package/resources/Shaders/TangentSpaceNormal.glsl +17 -0
  115. package/resources/StdResource/FILES +6 -0
  116. package/resources/StdResource/MigrationSheet.txt +21 -0
  117. package/resources/StdResource/Plugin +52 -0
  118. package/resources/StdResource/Standard +25 -0
  119. package/resources/StdResource/StandardLite +22 -0
  120. package/resources/StdResource/TObj +17 -0
  121. package/resources/StdResource/XCAF +50 -0
  122. package/resources/TObj/FILES +1 -0
  123. package/resources/TObj/TObj.msg +85 -0
  124. package/resources/Textures/1d_elevation.rgb +0 -0
  125. package/resources/Textures/2d_MatraDatavision.rgb +0 -0
  126. package/resources/Textures/2d_alienskin.rgb +0 -0
  127. package/resources/Textures/2d_aluminum.rgb +0 -0
  128. package/resources/Textures/2d_blue_rock.rgb +0 -0
  129. package/resources/Textures/2d_bluewhite_paper.rgb +0 -0
  130. package/resources/Textures/2d_brushed.rgb +0 -0
  131. package/resources/Textures/2d_bubbles.rgb +0 -0
  132. package/resources/Textures/2d_bumps.rgb +0 -0
  133. package/resources/Textures/2d_cast.rgb +0 -0
  134. package/resources/Textures/2d_chess.rgba +0 -0
  135. package/resources/Textures/2d_chipbd.rgb +0 -0
  136. package/resources/Textures/2d_clouds.rgb +0 -0
  137. package/resources/Textures/2d_flesh.rgb +0 -0
  138. package/resources/Textures/2d_floor.rgb +0 -0
  139. package/resources/Textures/2d_galvnisd.rgb +0 -0
  140. package/resources/Textures/2d_grass.rgb +0 -0
  141. package/resources/Textures/2d_knurl.rgb +0 -0
  142. package/resources/Textures/2d_maple.rgb +0 -0
  143. package/resources/Textures/2d_marble.rgb +0 -0
  144. package/resources/Textures/2d_mottled.rgb +0 -0
  145. package/resources/Textures/2d_rain.rgb +0 -0
  146. package/resources/Textures/2d_rock.rgb +0 -0
  147. package/resources/Textures/FILES +31 -0
  148. package/resources/Textures/env_clouds.rgb +0 -0
  149. package/resources/Textures/env_cv.rgb +0 -0
  150. package/resources/Textures/env_lines.rgb +0 -0
  151. package/resources/Textures/env_medit.rgb +0 -0
  152. package/resources/Textures/env_pearl.rgb +0 -0
  153. package/resources/Textures/env_road.rgb +0 -0
  154. package/resources/Textures/env_sky1.rgb +0 -0
  155. package/resources/Textures/env_sky2.rgb +0 -0
  156. package/resources/UnitsAPI/CurrentUnits +74 -0
  157. package/resources/UnitsAPI/FILES +4 -0
  158. package/resources/UnitsAPI/MDTVBaseUnits +70 -0
  159. package/resources/UnitsAPI/MDTVCurrentUnits +74 -0
  160. package/resources/UnitsAPI/Units.dat +481 -0
  161. package/resources/XRResources/FILES +10 -0
  162. package/resources/XRResources/occtvr_actions.json +225 -0
  163. package/resources/XRResources/occtvr_bindings_generic.json +87 -0
  164. package/resources/XRResources/occtvr_bindings_holographic_hmd.json +18 -0
  165. package/resources/XRResources/occtvr_bindings_index_hmd.json +18 -0
  166. package/resources/XRResources/occtvr_bindings_rift.json +18 -0
  167. package/resources/XRResources/occtvr_bindings_touch.json +160 -0
  168. package/resources/XRResources/occtvr_bindings_vive.json +18 -0
  169. package/resources/XRResources/occtvr_bindings_vive_controller.json +139 -0
  170. package/resources/XRResources/occtvr_bindings_vive_cosmos.json +18 -0
  171. package/resources/XRResources/occtvr_bindings_vive_pro.json +18 -0
  172. package/resources/XSMessage/FILES +2 -0
  173. package/resources/XSMessage/XSTEP.fr +1026 -0
  174. package/resources/XSMessage/XSTEP.us +1023 -0
  175. package/resources/XSTEPResource/FILES +2 -0
  176. package/resources/XSTEPResource/IGES +65 -0
  177. package/resources/XSTEPResource/STEP +68 -0
  178. package/resources/XmlOcafResource/FILES +11 -0
  179. package/resources/XmlOcafResource/XmlOcaf.xsd +131 -0
  180. package/resources/XmlOcafResource/XmlOcaf_SmallTypes.xsd +217 -0
  181. package/resources/XmlOcafResource/XmlOcaf_TDF.xsd +33 -0
  182. package/resources/XmlOcafResource/XmlOcaf_TDataStd.xsd +230 -0
  183. package/resources/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd +37 -0
  184. package/resources/XmlOcafResource/XmlOcaf_TDocStd.xsd +37 -0
  185. package/resources/XmlOcafResource/XmlOcaf_TFunction.xsd +38 -0
  186. package/resources/XmlOcafResource/XmlOcaf_TNaming.xsd +128 -0
  187. package/resources/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd +97 -0
  188. package/resources/XmlOcafResource/XmlOcaf_TPrsStd.xsd +42 -0
  189. package/resources/XmlOcafResource/XmlXcaf.xsd +109 -0
  190. package/resources/samples/tcl/ANC101.tcl +282 -0
  191. package/resources/samples/tcl/DataExchangeDemo.tcl +85 -0
  192. package/resources/samples/tcl/MBBGehauseRohteil.tcl +268 -0
  193. package/resources/samples/tcl/ModelingDemo.tcl +120 -0
  194. package/resources/samples/tcl/Penrose.tcl +87 -0
  195. package/resources/samples/tcl/Readme.txt +4 -0
  196. package/resources/samples/tcl/VisualizationDemo.tcl +162 -0
  197. package/resources/samples/tcl/bottle.tcl +115 -0
  198. package/resources/samples/tcl/cad.tcl +63 -0
  199. package/resources/samples/tcl/cpu.tcl +327 -0
  200. package/resources/samples/tcl/cutter.tcl +91 -0
  201. package/resources/samples/tcl/dimensions.tcl +83 -0
  202. package/resources/samples/tcl/drill.tcl +147 -0
  203. package/resources/samples/tcl/logo2019.tcl +89 -0
  204. package/resources/samples/tcl/markers.tcl +76 -0
  205. package/resources/samples/tcl/materials.tcl +75 -0
  206. package/resources/samples/tcl/pathtrace_ball.tcl +79 -0
  207. package/resources/samples/tcl/pathtrace_cube.tcl +85 -0
  208. package/resources/samples/tcl/pathtrace_materials.tcl +229 -0
  209. package/resources/samples/tcl/pencil.tcl +64 -0
  210. package/resources/samples/tcl/raytrace.tcl +44 -0
  211. package/resources/samples/tcl/snowflake.tcl +161 -0
  212. package/resources/samples/tcl/spheres.tcl +148 -0
  213. package/resources/samples/tcl/vis_pbr_spheres.tcl +94 -0
  214. package/resources/samples/tcl/xde.tcl +47 -0
@@ -0,0 +1,726 @@
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 under
6
+ # the terms of the GNU Lesser General Public License 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
+ # File: BRepOffset.cxx
15
+ # Created: Wed Oct 25 10:39:23 1995
16
+ # Author: Bruno DUMORTIER
17
+ # <dub@fuegox>
18
+
19
+
20
+ addmenu Sketch "Sketch" { vprofil2d }
21
+
22
+ proc mkprofil2d {last} {
23
+ global [.top.p.eobj.name get]
24
+ global [.top.p.eobj.face get]
25
+ global DX
26
+ global DY
27
+ global DX0
28
+ global DY0
29
+
30
+ append cmd " F "
31
+ append cmd [dval DX] " " [dval DY]
32
+
33
+ for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
34
+ append cmd " [.top.l.lb.cm get $i]"
35
+ }
36
+ if [info exist cmd] {
37
+ uplevel #0 eval 2dprofile [.top.p.eobj.name get] $cmd $last
38
+ }
39
+ .top.p.eobj.com delete 0 end
40
+ set DX0 [dval DX]
41
+ set DY0 [dval DY]
42
+ update
43
+ repaint
44
+ }
45
+
46
+ proc mkprofil3d {last} {
47
+ global [.top.p.eobj.name get]
48
+ global [.top.p.eobj.face get]
49
+ global DX
50
+ global DY
51
+
52
+ append cmd " F "
53
+ append cmd [dval DX] " " [dval DY]
54
+
55
+ if [info exist [.top.p.eobj.face get]] {
56
+ append cmd " S"
57
+ append cmd " [.top.p.eobj.face get]";
58
+ }
59
+ for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
60
+ append cmd " [.top.l.lb.cm get $i]"
61
+ }
62
+ if [info exist cmd] {
63
+ puts $cmd
64
+ eval profile [.top.p.eobj.name get] $cmd $last
65
+ }
66
+ .top.p.eobj.com delete 0 end
67
+ repaint
68
+ }
69
+
70
+ proc bougex {} {
71
+ global DX
72
+ global DY
73
+
74
+ dset x0 DX
75
+ dset y0 DY
76
+
77
+ pick id x1 y1 z1 MOUSEbutton
78
+ dset MOUSEbutton 0
79
+ while {[dval MOUSEbutton] == 0} {
80
+ pick id x2 y2 z2 MOUSEbutton nowait
81
+ dset DX x0+x2-x1 DY y0
82
+ mkprofil2d WW
83
+ }
84
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
85
+ dset DX x0 DY y0
86
+ mkprofil2d WW
87
+ }
88
+
89
+ proc bougey {} {
90
+ global DX
91
+ global DY
92
+
93
+ dset x0 DX
94
+ dset y0 DY
95
+
96
+ pick id x1 y1 z1 MOUSEbutton
97
+ dset MOUSEbutton 0
98
+ while {[dval MOUSEbutton] == 0} {
99
+ pick id x2 y2 z2 MOUSEbutton nowait
100
+ dset DX x0 DY y0+y2-y1
101
+ mkprofil2d WW
102
+ }
103
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
104
+ dset DX x0 DY y0
105
+ mkprofil2d WW
106
+ }
107
+
108
+ proc bouge {} {
109
+ global DX
110
+ global DY
111
+
112
+ dset x0 DX
113
+ dset y0 DY
114
+
115
+ pick id x1 y1 z1 MOUSEbutton
116
+ dset MOUSEbutton 0
117
+ while {[dval MOUSEbutton] == 0} {
118
+ pick id x2 y2 z2 MOUSEbutton nowait
119
+ dset DX x0+x2-x1 DY y0+y2-y1
120
+ mkprofil2d WW
121
+ }
122
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
123
+ dset DX x0 DY y0
124
+ mkprofil2d WW
125
+ }
126
+
127
+ proc bougefp {} {
128
+ global DX
129
+ global DY
130
+
131
+ dset x0 DX
132
+ dset y0 DY
133
+
134
+ dset MOUSEbutton 0
135
+ while {[dval MOUSEbutton] == 0} {
136
+ pick 29 x2 y2 z2 MOUSEbutton nowait
137
+ dset DX x2 DY y2
138
+ mkprofil2d WW
139
+ }
140
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
141
+ dset DX x0 DY y0
142
+ mkprofil2d WW
143
+ }
144
+
145
+ proc movex {} {
146
+ pick id x1 y1 z1 MOUSEbutton
147
+ dset MOUSEbutton 0
148
+ while {[dval MOUSEbutton] == 0} {
149
+ set MO ""
150
+ pick id x2 y2 z2 MOUSEbutton nowait
151
+ dset dx x2-x1
152
+ if { [dval dx] != 0 } {
153
+ append MO "x "
154
+ append MO [dval dx]
155
+ }
156
+ append MO " WW"
157
+ mkprofil2d $MO
158
+ }
159
+ if {[dval MOUSEbutton] == 1} {
160
+ set MO ""
161
+ if { [dval dx] != 0 } {
162
+ append MO "x "
163
+ append MO [dval dx]
164
+ }
165
+ .top.l.lb.cm insert end $MO
166
+ mkprofil2d WW
167
+ return
168
+ }
169
+ 2dclear
170
+ if [info exist [.top.p.eobj.face get]] {
171
+ eval pcurve [.top.p.eobj.face get];
172
+ }
173
+ mkprofil2d WW
174
+ }
175
+
176
+ proc movey {} {
177
+ pick id x1 y1 z1 MOUSEbutton
178
+ dset MOUSEbutton 0
179
+ while {[dval MOUSEbutton] == 0} {
180
+ set MO ""
181
+ pick id x2 y2 z2 MOUSEbutton nowait
182
+ dset dy y2-y1
183
+ if { [dval dy] != 0 } {
184
+ append MO "y "
185
+ append MO [dval dy]
186
+ }
187
+ append MO " WW"
188
+ mkprofil2d $MO
189
+ }
190
+ if {[dval MOUSEbutton] == 1} {
191
+ set MO ""
192
+ if { [dval dy] != 0 } {
193
+ append MO "y "
194
+ append MO [dval dy]
195
+ }
196
+ .top.l.lb.cm insert end $MO
197
+ mkprofil2d WW
198
+ return
199
+ }
200
+ 2dclear
201
+ if [info exist [.top.p.eobj.face get]] {
202
+ eval pcurve [.top.p.eobj.face get];
203
+ }
204
+ mkprofil2d WW
205
+ }
206
+
207
+ proc movec {} {
208
+ autodisplay
209
+ upvar #0 pi PI
210
+ upvar #0 CurX CX
211
+ upvar #0 CurY CY
212
+ upvar #0 CurDX CDX
213
+ upvar #0 CurDY CDY
214
+
215
+ line dummyline CX CY CDX CDY
216
+
217
+ point p1 CX CY
218
+ repaint
219
+ pick id x1 y1 z1 MOUSEbutton
220
+ dset sign 1
221
+ if {[dval MOUSEbutton] == 2} { dset sign -1}
222
+ dset MOUSEbutton 0
223
+ autodisplay
224
+
225
+ while {[dval MOUSEbutton] == 0} {
226
+ pick id x2 y2 z2 MOUSEbutton nowait
227
+ autodisplay
228
+ point p2 x2 y2
229
+ cirtang dummy dummyline p1 p2
230
+ dset PS sign*(CDX*(y2-CY)-CDY*(x2-CX))
231
+ if { [dval PS] < 0 } { reverse dummy_1}
232
+ parameters dummy_1 CX CY U1
233
+ parameters dummy_1 x2 y2 U2
234
+ autodisplay
235
+ eval trim dummy_1 dummy_1 U1 U2
236
+ repaint
237
+ }
238
+
239
+ if {[dval MOUSEbutton] == 1} {
240
+ erase dummy_1
241
+ set MO ""
242
+ if { [dval U2] < [dval U1]} { dset U2 U2+2*PI}
243
+ dset da sign*180*(U2-U1)/PI
244
+ 2dcvalue dummy_1 0 X Y DX DY
245
+ dset dr sqrt(DX*DX+DY*DY)
246
+ dset PS CDX*(y2-CY)-CDY*(x2-CX)
247
+ if { [dval PS] < 0 } {dset dr -dr}
248
+ if { [dval dr] != 0 } {
249
+ if { [dval da] != 0 } {
250
+ append MO "c "
251
+ append MO [format "%.3f" [dval dr]] " "
252
+ append MO [format "%.3f" [dval da]]
253
+ .top.l.lb.cm insert end $MO
254
+ }
255
+ }
256
+ mkprofil2d WW
257
+ return
258
+ }
259
+ 2dclear
260
+ if [info exist [.top.p.eobj.face get]] {
261
+ eval pcurve [.top.p.eobj.face get];
262
+ }
263
+ mkprofil2d WW
264
+ }
265
+
266
+ proc movel {} {
267
+ pick id x1 y1 z1 MOUSEbutton
268
+ dset MOUSEbutton 0
269
+ while {[dval MOUSEbutton] == 0} {
270
+ set MO ""
271
+ pick id x2 y2 z2 MOUSEbutton nowait
272
+ dset dr sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
273
+ if { [dval dr] != 0 } {
274
+ append MO "l "
275
+ append MO [dval dr]
276
+ }
277
+ append MO " WW"
278
+ mkprofil2d $MO
279
+ }
280
+ if {[dval MOUSEbutton] == 1} {
281
+ set MO ""
282
+ if { [dval dr] != 0 } {
283
+ append MO "l "
284
+ append MO [dval dr]
285
+ }
286
+ .top.l.lb.cm insert end $MO
287
+ mkprofil2d WW
288
+ return
289
+ }
290
+ 2dclear
291
+ if [info exist [.top.p.eobj.face get]] {
292
+ eval pcurve [.top.p.eobj.face get];
293
+ }
294
+ mkprofil2d WW
295
+ }
296
+
297
+ proc movet {} {
298
+ pick id x1 y1 z1 MOUSEbutton
299
+ dset MOUSEbutton 0
300
+ while {[dval MOUSEbutton] == 0} {
301
+ set MO ""
302
+ pick id x2 y2 z2 MOUSEbutton nowait
303
+ dset dx x2-x1 dy y2-y1
304
+ if { [dval dx] != 0 || [dval dy] != 0 } {
305
+ append MO "t "
306
+ append MO [dval dx] " " [dval dy]
307
+ }
308
+ append MO " WW"
309
+ mkprofil2d $MO
310
+ }
311
+ if {[dval MOUSEbutton] == 1} {
312
+ set MO ""
313
+ if { [dval dx] != 0 || [dval dy] != 0 } {
314
+ append MO "t "
315
+ append MO [dval dx] " " [dval dy]
316
+ }
317
+ .top.l.lb.cm insert end $MO
318
+ mkprofil2d WW
319
+ return
320
+ }
321
+ 2dclear
322
+ if [info exist [.top.p.eobj.face get]] {
323
+ eval pcurve [.top.p.eobj.face get];
324
+ }
325
+ mkprofil2d WW
326
+ }
327
+
328
+ proc movexx {} {
329
+ pick id x1 y1 z1 MOUSEbutton
330
+ dset MOUSEbutton 0
331
+ while {[dval MOUSEbutton] == 0} {
332
+ set MO ""
333
+ pick id x2 y2 z2 MOUSEbutton nowait
334
+ append MO "xx "
335
+ append MO [dval x2]
336
+ append MO " WW"
337
+ mkprofil2d $MO
338
+ }
339
+ if {[dval MOUSEbutton] == 1} {
340
+ set MO ""
341
+ append MO "xx "
342
+ append MO [dval x2]
343
+ .top.l.lb.cm insert end $MO
344
+ mkprofil2d WW
345
+ return
346
+ }
347
+ 2dclear
348
+ if [info exist [.top.p.eobj.face get]] {
349
+ eval pcurve [.top.p.eobj.face get];
350
+ }
351
+ mkprofil2d WW
352
+ }
353
+
354
+ proc moveyy {} {
355
+ pick id x1 y1 z1 MOUSEbutton
356
+ dset MOUSEbutton 0
357
+ while {[dval MOUSEbutton] == 0} {
358
+ set MO ""
359
+ pick id x2 y2 z2 MOUSEbutton nowait
360
+ append MO "yy "
361
+ append MO [dval y2]
362
+ append MO " WW"
363
+ mkprofil2d $MO
364
+ }
365
+ if {[dval MOUSEbutton] == 1} {
366
+ set MO ""
367
+ append MO "yy "
368
+ append MO [dval y2]
369
+ .top.l.lb.cm insert end $MO
370
+ mkprofil2d WW
371
+ return
372
+ }
373
+ 2dclear
374
+ if [info exist [.top.p.eobj.face get]] {
375
+ eval pcurve [.top.p.eobj.face get];
376
+ }
377
+ mkprofil2d WW
378
+ }
379
+
380
+ proc moveix {} {
381
+ pick id x1 y1 z1 MOUSEbutton
382
+ dset MOUSEbutton 0
383
+ while {[dval MOUSEbutton] == 0} {
384
+ set MO ""
385
+ pick id x2 y2 z2 MOUSEbutton nowait
386
+ append MO "ix "
387
+ append MO [dval x2]
388
+ append MO " WW"
389
+ mkprofil2d $MO
390
+ }
391
+ if {[dval MOUSEbutton] == 1} {
392
+ set MO ""
393
+ append MO "ix "
394
+ append MO [dval x2]
395
+ .top.l.lb.cm insert end $MO
396
+ mkprofil2d WW
397
+ return
398
+ }
399
+ 2dclear
400
+ if [info exist [.top.p.eobj.face get]] {
401
+ eval pcurve [.top.p.eobj.face get];
402
+ }
403
+ mkprofil2d WW
404
+ }
405
+
406
+ proc moveiy {} {
407
+ pick id x1 y1 z1 MOUSEbutton
408
+ dset MOUSEbutton 0
409
+ while {[dval MOUSEbutton] == 0} {
410
+ set MO ""
411
+ pick id x2 y2 z2 MOUSEbutton nowait
412
+ append MO "iy "
413
+ append MO [dval y2]
414
+ append MO " WW"
415
+ mkprofil2d $MO
416
+ }
417
+ if {[dval MOUSEbutton] == 1} {
418
+ set MO ""
419
+ append MO "iy "
420
+ append MO [dval y2]
421
+ .top.l.lb.cm insert end $MO
422
+ mkprofil2d WW
423
+ return
424
+ }
425
+ 2dclear
426
+ if [info exist [.top.p.eobj.face get]] {
427
+ eval pcurve [.top.p.eobj.face get];
428
+ }
429
+ mkprofil2d WW
430
+ }
431
+
432
+ proc vprofil2d {} {
433
+
434
+ toplevel .top -bg cornsilk
435
+ wm geometry .top +10+10
436
+ wm title .top "SKETCHER"
437
+
438
+ frame .top.l -bg cornsilk
439
+
440
+ frame .top.l.lb -bg azure1 -relief ridge -bd 4
441
+ listbox .top.l.lb.cm -bg azure1 -yscrollcommand ".top.l.lb.sc set"
442
+ # scrollbar .top.l.lb.sc -bg azure2 -fg grey80 -activeforeground grey90\
443
+ # -relief sunken -command ".top.l.lb.cm yview"
444
+ scrollbar .top.l.lb.sc -bg azure2 \
445
+ -relief sunken -command ".top.l.lb.cm yview"
446
+ bind .top.l.lb.cm <Double-Button-1> {
447
+ .top.p.eobj.com delete 0 end
448
+ .top.p.eobj.com insert end\
449
+ [.top.l.lb.cm get [.top.l.lb.cm curselection]]
450
+ }
451
+ pack .top.l.lb.cm .top.l.lb.sc -side left -fill both -padx 2m
452
+
453
+ frame .top.l.t -bg azure2 -relief ridge -bd 4
454
+ radiobutton .top.l.t.a -bg azure3 -activebackground azure2\
455
+ -text "face" -variable proftype -value F
456
+ radiobutton .top.l.t.b -bg azure3 -activebackground azure2\
457
+ -text "closed" -variable proftype -value W
458
+ radiobutton .top.l.t.c -bg azure3 -activebackground azure2\
459
+ -text "wire" -variable proftype -value " "
460
+
461
+ frame .top.l.f -bg azure2 -relief ridge -bd 4
462
+ button .top.l.f.f -bg deepskyblue -activebackground lightskyblue1\
463
+ -text " FIT " -command {
464
+ if [info exist [.top.p.eobj.face get]] {
465
+ eval pcurve [.top.p.eobj.face get];
466
+ }
467
+ mkprofil2d WW
468
+ 2dfit; repaint
469
+ }
470
+ button .top.l.f.u -bg deepskyblue -activebackground lightskyblue1\
471
+ -text " ZOOM + " -command {
472
+ 2dmu; repaint
473
+ }
474
+ button .top.l.f.d -bg deepskyblue -activebackground lightskyblue1\
475
+ -text " ZOOM - " -command {2dmd; repaint}
476
+
477
+ pack .top.l.f.f .top.l.f.u .top.l.f.d -side right -padx 1m -pady 1m
478
+
479
+ frame .top.l.d -bg azure2 -relief ridge -bd 4
480
+ button .top.l.d.u -bg deepskyblue -activebackground lightskyblue1\
481
+ -text " UP" -command 2dpu
482
+ button .top.l.d.d -bg deepskyblue -activebackground lightskyblue1\
483
+ -text "DOWN" -command 2dpd
484
+ button .top.l.d.l -bg deepskyblue -activebackground lightskyblue1\
485
+ -text "LEFT" -command 2dpl
486
+ button .top.l.d.r -bg deepskyblue -activebackground lightskyblue1\
487
+ -text "RIGHT" -command 2dpr
488
+ pack .top.l.d.u .top.l.d.d .top.l.d.l .top.l.d.r -side left\
489
+ -padx 1m -pady 1m
490
+
491
+ frame .top.l.q -bg azure2 -relief ridge -bd 4
492
+ button .top.l.q.ok -bg deepskyblue -activebackground lightskyblue1\
493
+ -text " VALI " -command {
494
+ delete 29
495
+ if { $proftype == "F"} {
496
+ set proftype " "
497
+ } elseif { $proftype != "W" } {
498
+ set proftype "WW"
499
+ }
500
+ mkprofil3d $proftype
501
+ destroy .top
502
+ if [info exist PickedFace] { erase PickedFace}
503
+ repaint;
504
+ }
505
+ button .top.l.q.ko -bg deepskyblue -activebackground lightskyblue1\
506
+ -text " CANCEL " -command {
507
+ delete 29
508
+ if [info exist [.top.p.eobj.name get]] {
509
+ eval unset [.top.p.eobj.name get];
510
+ }
511
+ destroy .top
512
+ if [info exist PickedFace] { unset PickedFace}
513
+ repaint;
514
+ }
515
+ button .top.l.q.h -bg deepskyblue -activebackground lightskyblue1\
516
+ -text " HELP " -command helpme
517
+ pack .top.l.q.ok .top.l.q.ko .top.l.q.h -side left -fill both\
518
+ -padx 2m -pady 1m
519
+
520
+ pack .top.l.t.a .top.l.t.b .top.l.t.c -side left -padx 1m -pady 1m
521
+
522
+ pack .top.l.lb .top.l.t -side top -pady 1m -fill both
523
+ pack .top.l.f .top.l.d -side top -pady 1m -fill both
524
+ pack .top.l.q -side bottom -fill both -pady 1m
525
+
526
+ pack .top.l -side left -fill both -padx 1m
527
+
528
+ frame .top.p -bg azure2 -relief ridge -bd 4
529
+
530
+ frame .top.p.obj -bg azure2
531
+ frame .top.p.eobj -bg azure2
532
+ label .top.p.obj.name -bg azure2 -text "Name:"
533
+ entry .top.p.eobj.name -bg azure1 -relief sunken
534
+ .top.p.eobj.name insert end "prof"
535
+
536
+ label .top.p.obj.com -bg azure2 -text "Command:"
537
+ entry .top.p.eobj.com -bg azure1 -relief sunken
538
+ bind .top.p.eobj.com <Return> {
539
+ .top.l.lb.cm insert end [.top.p.eobj.com get]
540
+ mkprofil2d WW
541
+ }
542
+
543
+ label .top.p.obj.face -bg azure2 -text "Face:"
544
+ entry .top.p.eobj.face -bg azure1 -relief sunken -textvariable CURFACE
545
+ bind .top.p.eobj.face <Return> {
546
+ 2dclear
547
+ if [info exist [.top.p.eobj.face get]] {
548
+ eval pcurve [.top.p.eobj.face get];
549
+ } elseif { [.top.p.eobj.face get] == "."} {
550
+ uplevel #0 pickface
551
+ set CURFACE PickedFace
552
+ uplevel #0 eval pcurve [.top.p.eobj.face get];
553
+ }
554
+ mkprofil2d WW
555
+ 2dfit
556
+ repaint
557
+ }
558
+
559
+ label .top.p.obj.x0 -bg azure2 -text "X0:"
560
+ entry .top.p.eobj.x0 -bg azure1 -relief sunken -textvariable DX0
561
+ bind .top.p.eobj.x0 <Return> {
562
+ dset DX [expr $DX0]
563
+ mkprofil2d WW
564
+ }
565
+
566
+ label .top.p.obj.y0 -bg azure2 -text "Y0:"
567
+ entry .top.p.eobj.y0 -bg azure1 -relief sunken -textvariable DY0
568
+ bind .top.p.eobj.y0 <Return> {
569
+ dset DY [expr $DY0]
570
+ mkprofil2d WW
571
+ }
572
+
573
+ frame .top.c -bg azure2 -relief ridge -bd 4
574
+ button .top.c.add -bg deepskyblue -activebackground lightskyblue1\
575
+ -text " Add " -command {
576
+ .top.l.lb.cm insert end [.top.p.eobj.com get]
577
+ mkprofil2d WW
578
+ }
579
+ button .top.c.rem -bg deepskyblue -activebackground lightskyblue1\
580
+ -text "Remove" -command {
581
+ if {[.top.l.lb.cm curselection] != ""} {
582
+ .top.l.lb.cm delete [.top.l.lb.cm curselection]
583
+ } else {
584
+ .top.l.lb.cm delete end
585
+ }
586
+ 2dclear
587
+ if [info exist [.top.p.eobj.face get]] {
588
+ eval pcurve [.top.p.eobj.face get];
589
+ }
590
+ mkprofil2d WW
591
+ }
592
+ button .top.c.set -bg deepskyblue -activebackground lightskyblue1\
593
+ -text " Set " -command {
594
+ if {[.top.l.lb.cm curselection] != ""} {
595
+ .top.l.lb.cm insert [.top.l.lb.cm curselection]\
596
+ [.top.p.eobj.com get]
597
+ .top.l.lb.cm delete [.top.l.lb.cm curselection]
598
+ } else {
599
+ .top.l.lb.cm insert end [.top.l.lb.cm get]
600
+ }
601
+ mkprofil2d WW
602
+ }
603
+ pack .top.c.add .top.c.rem .top.c.set -side left -fill both\
604
+ -padx 4m -pady 1m
605
+
606
+ frame .top.m -bg azure2 -relief ridge -bd 4
607
+
608
+ frame .top.m.m1 -bg azure2
609
+ button .top.m.m1.x -bg deepskyblue -activebackground lightskyblue1\
610
+ -text " X " -command movex
611
+ button .top.m.m1.xx -bg deepskyblue -activebackground lightskyblue1\
612
+ -text " XX " -command movexx
613
+
614
+ frame .top.m.m2 -bg azure2
615
+ button .top.m.m2.y -bg deepskyblue -activebackground lightskyblue1\
616
+ -text " Y " -command movey
617
+ button .top.m.m2.yy -bg deepskyblue -activebackground lightskyblue1\
618
+ -text " YY " -command moveyy
619
+
620
+ frame .top.m.m3 -bg azure2
621
+ button .top.m.m3.c -bg deepskyblue -activebackground lightskyblue1\
622
+ -text " C " -command movec
623
+ button .top.m.m3.ix -bg deepskyblue -activebackground lightskyblue1\
624
+ -text " IX " -command moveix
625
+
626
+ frame .top.m.m4 -bg azure2
627
+ button .top.m.m4.l -bg deepskyblue -activebackground lightskyblue1\
628
+ -text " L " -command movel
629
+ button .top.m.m4.iy -bg deepskyblue -activebackground lightskyblue1\
630
+ -text " IY " -command moveiy
631
+
632
+ frame .top.m.m5 -bg azure2
633
+ button .top.m.m5.t -bg deepskyblue -activebackground lightskyblue1\
634
+ -text " T " -command movet
635
+ button .top.m.m5.tt -bg deepskyblue -activebackground lightskyblue1\
636
+ -text " TT " -command movett
637
+
638
+ frame .top.sc -bg azure2 -relief ridge -bd 4
639
+ frame .top.sc.sc1 -bg azure2
640
+ button .top.sc.sc1.d -bg deepskyblue -activebackground lightskyblue1\
641
+ -text "SCAN" -command bouge
642
+ button .top.sc.sc1.f -bg deepskyblue -activebackground lightskyblue1\
643
+ -text " First Point " -command bougefp
644
+
645
+ frame .top.sc.sc2 -bg azure2
646
+ button .top.sc.sc2.x -bg deepskyblue -activebackground lightskyblue1\
647
+ -text " SCAN X " -command bougex
648
+ button .top.sc.sc2.y -bg deepskyblue -activebackground lightskyblue1\
649
+ -text " SCAN Y " -command bougey
650
+
651
+ pack .top.p.obj.name .top.p.obj.com .top.p.obj.face .top.p.obj.x0\
652
+ .top.p.obj.y0 -side top -fill x -pady 1m
653
+ pack .top.p.eobj.name .top.p.eobj.com .top.p.eobj.face .top.p.eobj.x0\
654
+ .top.p.eobj.y0 -side top -fill x -pady 1m
655
+ pack .top.p.obj .top.p.eobj -side left
656
+
657
+ pack .top.m.m1.x .top.m.m1.xx -side top -fill x -pady 1m
658
+ pack .top.m.m2.y .top.m.m2.yy -side top -fill x -pady 1m
659
+ pack .top.m.m3.c .top.m.m3.ix -side top -fill x -pady 1m
660
+ pack .top.m.m4.l .top.m.m4.iy -side top -fill x -pady 1m
661
+ pack .top.m.m5.t .top.m.m5.tt -side top -fill x -pady 1m
662
+ pack .top.m.m1 .top.m.m2 .top.m.m3 .top.m.m4 .top.m.m5 -side left -padx 2m
663
+
664
+ pack .top.sc.sc1.d .top.sc.sc1.f -side top -fill x -pady 1m
665
+ pack .top.sc.sc2.x .top.sc.sc2.y -side top -fill x -pady 1m
666
+ pack .top.sc.sc1 .top.sc.sc2 -side left -padx 6m
667
+
668
+ pack .top.p -side top -fill both -padx 1m -pady 1m
669
+ pack .top.c -side top -fill both -padx 1m -pady 1m
670
+ pack .top.m -side top -fill both -padx 1m -pady 1m
671
+ pack .top.sc -side top -fill both -padx 1m -pady 1m
672
+
673
+ #global variables and init them
674
+ global proftype
675
+ global CURFACE
676
+ global DX
677
+ global DY
678
+ global DX0
679
+ global DY0
680
+
681
+ set proftype " "
682
+ set CURFACE ""
683
+ set DX0 ""
684
+ set DY0 ""
685
+ dset DX 0
686
+ dset DY 0
687
+
688
+ view 29 -2D- 465 10 664 410
689
+ 2dclear
690
+ # call 2dprofile to initialize CurX CurY CurDX CurDY
691
+ mkprofil2d WW
692
+ }
693
+
694
+ proc helpme {} {
695
+ toplevel .h -bg azure3
696
+ wm title .h "HELP"
697
+ wm geometry .h +40+90
698
+ message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text\
699
+ "Build a profile in the UV plane from a moving point and direction.\n \
700
+ The original point and direction are 0 0 and 1 0.\n \
701
+ Codes and values describe the point or direction change.\n \
702
+ When the point change the direction becomes the tangent.\n \
703
+ All angles are in degree (may be negative).\n \
704
+ By default the profile is closed.\n \
705
+ \n \
706
+ Instruction\tParameters\tAction\n \
707
+ F\t\tX Y\t\tSet the first point\n \
708
+ X\t\tDX\t\tTranslate point along X\n \
709
+ Y\t\tDY\t\tTranslate point along Y\n \
710
+ L\t\tDL\t\tTranslate point along direction\n \
711
+ XX\t\tX\t\tSet point X coordinate\n \
712
+ YY\t\tY\t\tSet point Y coordinate\n \
713
+ T\t\tDX DY\t\tTranslate point\n \
714
+ TT\t\tX Y\t\tSet point\n \
715
+ R\t\tAngle\t\tRotate direction\n \
716
+ RR\t\tAngle\t\tSet direction\n \
717
+ D\t\tDX DY\t\tSet direction\n \
718
+ IX\t\tX\t\tIntersect with vertical\n \
719
+ IY\t\tY\t\tIntersect with horizontal\n \
720
+ C\t\tRadius Angle\tArc of circle tangent to direction"
721
+
722
+ frame .h.q -relief ridge -bd 4 -bg azure3
723
+ button .h.q.q -bg deepskyblue -activebackground lightskyblue1 -text "QUIT" -command {destroy .h}
724
+ pack .h.q.q -padx 1m -pady 1m
725
+ pack .h.m .h.q -side top -pady 2m
726
+ }