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

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,268 @@
1
+ # The following example constructs (however, not trying to follow the drawings
2
+ # precisely) an airplane part called Gehause Rohteil from MBB Deutsche Aerospace.
3
+ # In this example the planar geometry is combined together with cylindrical parts.
4
+ # There are many ways to create a single mechanical workpiece like the following
5
+ # one. Here we choose Booleans as a main tool for material cutting. Fillets
6
+ # (presented in the original model) are not employed herein as we are focused
7
+ # on BOPs only. However, Gehause Rohteil is a good model to test blendings as well.
8
+ #
9
+ # This model was used as a test part for comparing modeling systems in 1979 and
10
+ # again in 1983. The tests were organized by Computer Aided Manufacturing
11
+ # International (CAM-I).
12
+ #
13
+ #Category: Modeling
14
+ #Title: MBB Gehause Rohteil (classic test for CAD modelling by CAM-I)
15
+
16
+ pload MODELING XSDRAW
17
+
18
+ # -----------------------------------------------------------------------------
19
+ # Prepare base contour
20
+ # -----------------------------------------------------------------------------
21
+
22
+ point p1 0 0
23
+ point p2 35 0
24
+ point p3 39 4
25
+ point p4 39 10
26
+ point p5 35 13
27
+ point p6 27 13
28
+ point p7 27 10
29
+ point p8 22 10
30
+ point p9 20 8
31
+ point p10 20 4
32
+ point p11 11 4
33
+ point p12 11 3
34
+ point p13 5 3
35
+ point p14 5 13
36
+ point p15 0 13
37
+ point p16 0 9
38
+ point p17 4 9
39
+ point p18 4 4
40
+ point p19 0 4
41
+
42
+ line l1 0 0 1 0; trim l1 l1 0 35
43
+ line l2 39 4 0 1; trim l2 l2 0 6
44
+ line l3 35 13 -1 0; trim l3 l3 0 8
45
+ line l4 27 13 0 -1; trim l4 l4 0 3
46
+ line l5 27 10 -1 0; trim l5 l5 0 5
47
+ line l6 20 8 0 -1; trim l6 l6 0 4
48
+ line l7 20 4 -1 0; trim l7 l7 0 9
49
+ line l8 11 4 0 -1; trim l8 l8 0 1
50
+ line l9 11 3 -1 0; trim l9 l9 0 6
51
+ line l10 5 3 0 1; trim l10 l10 0 10
52
+ line l11 5 13 -1 0; trim l11 l11 0 5
53
+ line l12 0 13 0 -1; trim l12 l12 0 4
54
+ line l13 0 9 1 0; trim l13 l13 0 4
55
+ line l14 4 9 0 -1; trim l14 l14 0 5
56
+ line l15 4 4 -1 0; trim l15 l15 0 4
57
+ line l16 0 4 0 -1; trim l16 l16 0 4
58
+
59
+ # We use Bezier curves here instead of circles. This does not make
60
+ # a great sense since we are focused on a principle rather than
61
+ # trying to follow the drawing precisely
62
+ 2dbeziercurve c1 3 35 0 1 39 0 1 39 4 1
63
+ 2dbeziercurve c2 3 39 10 1 39 13 1 35 13 1
64
+ 2dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
65
+
66
+ # Circle for a big hole
67
+ circle cbig 33 6.5 4.0
68
+
69
+ # Create topology
70
+ mkedge e1 l1
71
+ mkedge e2 c1
72
+ mkedge e3 l2
73
+ mkedge e4 c2
74
+ mkedge e5 l3
75
+ mkedge e6 l4
76
+ mkedge e7 l5
77
+ mkedge e8 c3
78
+ mkedge e9 l6
79
+ mkedge e10 l7
80
+ mkedge e11 l8
81
+ mkedge e12 l9
82
+ mkedge e13 l10
83
+ mkedge e14 l11
84
+ mkedge e15 l12
85
+ mkedge e16 l13
86
+ mkedge e17 l14
87
+ mkedge e18 l15
88
+ mkedge e19 l16
89
+ wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14 e15 e16 e17 e18 e19
90
+ mkedge ein1 cbig
91
+ wire win1 ein1
92
+ mkplane f wout
93
+ mkplane f1 win1
94
+ fixshape f f
95
+ fixshape f1 f1
96
+ bcut f f f1
97
+
98
+ # -----------------------------------------------------------------------------
99
+ # Make extrusion
100
+ # -----------------------------------------------------------------------------
101
+
102
+ prism p f 0 0 3
103
+
104
+ # -----------------------------------------------------------------------------
105
+ # Prepare a contour on top face
106
+ # -----------------------------------------------------------------------------
107
+
108
+ point p1 0 0
109
+ point p2 28 0
110
+ point p3 28 13
111
+ point p4 27 13
112
+ point p5 27 10
113
+ point p6 22 10
114
+ point p7 20 8
115
+ point p8 20 4
116
+ point p9 11 4
117
+ point p10 11 3
118
+ point p11 5 3
119
+ point p12 5 13
120
+ point p13 0 13
121
+ line l1 0 0 1 0; trim l1 l1 0 28
122
+ line l2 28 0 0 1; trim l2 l2 0 13
123
+ line l3 28 13 -1 0; trim l3 l3 0 1
124
+ line l4 27 13 0 -1; trim l4 l4 0 3
125
+ line l5 27 10 -1 0; trim l5 l5 0 5
126
+ line l6 20 8 0 -1; trim l6 l6 0 4
127
+ line l7 20 4 -1 0; trim l7 l7 0 9
128
+ line l8 11 4 0 -1; trim l8 l8 0 1
129
+ line l9 11 3 -1 0; trim l9 l9 0 6
130
+ line l10 5 3 0 1; trim l10 l10 0 10
131
+ line l11 5 13 -1 0; trim l11 l11 0 5
132
+ line l12 0 13 0 -1; trim l12 l12 0 13
133
+ 2dbeziercurve c3 3 22 10 1 20 10 1 20 8 1
134
+
135
+ # Create topology on top face
136
+ plane top_pln 0 0 3
137
+ to3d l1 l1 top_pln
138
+ to3d l2 l2 top_pln
139
+ to3d l3 l3 top_pln
140
+ to3d l4 l4 top_pln
141
+ to3d l5 l5 top_pln
142
+ to3d c3 c3 top_pln
143
+ to3d l6 l6 top_pln
144
+ to3d l7 l7 top_pln
145
+ to3d l8 l8 top_pln
146
+ to3d l9 l9 top_pln
147
+ to3d l10 l10 top_pln
148
+ to3d l11 l11 top_pln
149
+ to3d l12 l12 top_pln
150
+ mkedge e1 l1
151
+ mkedge e2 l2
152
+ mkedge e3 l3
153
+ mkedge e4 l4
154
+ mkedge e5 l5
155
+ mkedge e6 c3
156
+ mkedge e7 l6
157
+ mkedge e8 l7
158
+ mkedge e9 l8
159
+ mkedge e10 l9
160
+ mkedge e11 l10
161
+ mkedge e12 l11
162
+ mkedge e13 l12
163
+ wire wout e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13
164
+ mkface ftop top_pln wout
165
+ fixshape ftop ftop
166
+
167
+ # -----------------------------------------------------------------------------
168
+ # Make top extrusion
169
+ # -----------------------------------------------------------------------------
170
+
171
+ prism ptop ftop 0 0 1.5
172
+
173
+ # -----------------------------------------------------------------------------
174
+ # Fuse top and bottom parts and make features
175
+ # -----------------------------------------------------------------------------
176
+
177
+ # Fuse top and bottom
178
+ bfuse p p ptop
179
+
180
+ # Create a hole
181
+ plane top_pln 0 0 10
182
+ circle csmall 23 6.5 2.0
183
+ to3d hole_top csmall top_pln
184
+ plane bot_pln 0 0 -10
185
+ to3d hole_bot csmall bot_pln
186
+ mkedge ehole_top hole_top
187
+ mkedge ehole_bot hole_bot
188
+ wire whole_top ehole_top
189
+ wire whole_bot ehole_bot
190
+ thrusections tool 1 1 whole_top whole_bot
191
+ bcut p p tool
192
+
193
+ # Add extrusion around the hole
194
+ plane top_pln 0 0 4.5
195
+ circle csmall_outer 23 6.5 3.0
196
+ circle csmall_inner 23 6.5 2.0
197
+ to3d hole_top_outer csmall_outer top_pln
198
+ to3d hole_top_inner csmall_inner top_pln
199
+ mkedge e_hole_top_outer hole_top_outer
200
+ mkedge e_hole_top_inner hole_top_inner
201
+ wire w_hole_top_outer e_hole_top_outer
202
+ wire w_hole_top_inner e_hole_top_inner
203
+ mkface ftube_outer top_pln w_hole_top_outer
204
+ mkface ftube_inner top_pln w_hole_top_inner
205
+ fixshape ftube_outer ftube_outer
206
+ fixshape ftube_inner ftube_inner
207
+ prism ptube_outer ftube_outer 0 0 3
208
+ prism ptube_inner ftube_inner 0 0 3
209
+ bcut ptube ptube_outer ptube_inner
210
+ bfuse p p ptube
211
+
212
+ # Build elevation "teeths" near the big hole
213
+ box t1 26 0 0 3 2.5 7
214
+ box t2 26 13 0 3 -3 7
215
+ bfuse p p t1
216
+ bfuse p p t2
217
+
218
+ # Build elevation "teeths" near the tail
219
+ box t1 0 0 0 5 3 8
220
+ box t2 0 13 0 5 -3 8
221
+ bfuse p p t1
222
+ bfuse p p t2
223
+
224
+ # Remove some material from tail "teeths"
225
+ box blend_box 0 -5 0 5 25 5
226
+ trotate blend_box blend_box 0 0 0 0 1 0 -10
227
+ ttranslate blend_box blend_box 2.5 0 2.25
228
+ bcut p p blend_box
229
+
230
+ # Remove some material from "teeths" near big hole
231
+ box blend_box 0 -5 0 5 25 5
232
+ trotate blend_box blend_box 0 0 0 0 1 0 -9
233
+ ttranslate blend_box blend_box 14.5 0 1.5
234
+ bcut p p blend_box
235
+
236
+ # Hole at the tail
237
+ ellipse tail_hole1 0 0 0.75 0.5
238
+ plane base_pln 2 6.5 0
239
+ to3d tail_hole_3d1 tail_hole1 base_pln
240
+ mkedge e_tail_hole1 tail_hole_3d1
241
+ wire w_tail_hole1 e_tail_hole1
242
+ plane base_pln 2 6.5 20
243
+ to3d tail_hole_3d2 tail_hole1 base_pln
244
+ mkedge e_tail_hole2 tail_hole_3d2
245
+ wire w_tail_hole2 e_tail_hole2
246
+ thrusections tail_tube 1 1 w_tail_hole1 w_tail_hole2
247
+ bcut p p tail_tube
248
+
249
+ # Chamfer at tail
250
+ box blend_box 0 3 0 5 7 5
251
+ trotate blend_box blend_box 0 0 0 0 1 0 -5
252
+ ttranslate blend_box blend_box 2 0 1.5
253
+ bcut p p blend_box
254
+
255
+ # -----------------------------------------------------------------------------
256
+ # Extract final solid and simplify it
257
+ # -----------------------------------------------------------------------------
258
+
259
+ explode p So
260
+ unifysamedom result p_1
261
+
262
+ # Show result
263
+ pload VISUALIZATION
264
+ vinit Driver1/Viewer1/View1
265
+ vbackground -color C8C8FF
266
+ vdisplay -dispMode 1 result
267
+ vfit
268
+ vaspects result -setFaceBoundaryDraw 1
@@ -0,0 +1,120 @@
1
+ # Copyright (c) 1999-2014 OPEN CASCADE SAS
2
+ #
3
+ #Category: Demos
4
+ #Title: Modeling operations
5
+ #
6
+ # This file is part of Open CASCADE Technology software library.
7
+ #
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.
13
+ #
14
+ # Alternatively, this file may be used under the terms of Open CASCADE
15
+ # commercial license or contractual agreement.
16
+
17
+ # Command to log a message to both command-line and dialog window
18
+ proc sage { a} {
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
35
+ }
36
+
37
+ pload MODELING
38
+
39
+ smallview
40
+ if { [winfo exists .h ] } {
41
+ destroy .h
42
+ }
43
+ sage " Creating a box"
44
+ sage " box b -10 -10 -10 20 20 20"
45
+ sage " "
46
+ box b -10 -10 -10 20 20 20
47
+ fit
48
+ nexplode b f
49
+ erase b
50
+ sage " Draft of two lateral faces "
51
+ sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
52
+ sage " nexplode r f"
53
+ sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
54
+ sage " "
55
+ depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
56
+ clear
57
+ nexplode r f
58
+ depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
59
+ clear
60
+ nexplode rr e
61
+ sage " Fillet on four lateral edges, then on the top and bottom edges "
62
+ sage " nexplode rr e"
63
+ sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
64
+ sage " nexplode result e"
65
+ sage " blend result result 2 result_11 3 result_12"
66
+ sage " "
67
+ blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
68
+ erase rr
69
+ erase result
70
+ nexplode result e
71
+ blend result result 2 result_11 3 result_12
72
+ clear
73
+ nexplode result f
74
+ sage " Creating a profile on the top face "
75
+ sage " nexplode result f"
76
+ sage " 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
+ "
78
+ sage " "
79
+ 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
80
+ sage " Creating a prism"
81
+ sage " prism rr p 0 0 20"
82
+ sage " "
83
+ prism rr p 0 0 20
84
+ fit
85
+ sage " Fusion of this prism with the original part "
86
+ sage " fuse result rr result"
87
+ sage " "
88
+ fuse result rr result
89
+ donly result
90
+ nexplode result f
91
+ erase result
92
+ fit
93
+
94
+ sage " Opening the top face"
95
+ sage " offsetshape r result -1 0.0001 result_17"
96
+ sage " "
97
+
98
+ nexplode result f
99
+ offsetshape r result -1 0.0001 result_17
100
+ sage " Creating a cylinder and positioning it"
101
+ sage " pcylinder cyl 2 300"
102
+ sage " trotate cyl cyl 0 0 0 1 0 0 45"
103
+ sage " ttranslate cyl cyl 0 7.5 0"
104
+ sage " "
105
+ pcylinder cyl 2 30
106
+ trotate cyl cyl 0 0 0 1 0 0 45
107
+ ttranslate cyl cyl 0 7.5 0
108
+ sage " Display the Shape on Hidden Line Mode "
109
+ sage " hlr hid r"
110
+ sage ""
111
+ donly r
112
+ hlr hid r
113
+ sage " Display the Shape on HLR Mode "
114
+ sage " hlr nohid r"
115
+ sage " hlr hlr r"
116
+ sage ""
117
+ donly r
118
+ hlr nohid r
119
+ hlr hlr r
120
+ sage "Demo completed"
@@ -0,0 +1,87 @@
1
+ # Generate set of boxes resembling OCC logo and arranged in the shape of
2
+ # Penrose triangle on perspective view.
3
+ # The sample shows how the viewer can be manipulated to produce required
4
+ # visual effect
5
+
6
+ #Category: Visualization
7
+ #Title: Penrose triangle on perspective view
8
+
9
+ pload MODELING VISUALIZATION
10
+ # Ray-Tracing doesn't work with Compatible Profile on macOS
11
+ if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
12
+
13
+ # procedure to define box dimensions
14
+ set scale 1.
15
+ set ratio 0.94
16
+ proc defbox {} {
17
+ global scale ratio
18
+ set scale [expr $scale * $ratio]
19
+ return [list 1.8*$scale 1.8*$scale 1.3*$scale]
20
+ }
21
+
22
+ # make set of boxes
23
+ eval box b1 0 0 0 [defbox]
24
+ eval box b2 2 0 0 [defbox]
25
+ eval box b3 4 0 0 [defbox]
26
+ eval box b4 6 0 0 [defbox]
27
+ eval box b5 6 -1.5 0 [defbox]
28
+ eval box b6 6 -3 0 [defbox]
29
+ eval box b7 6 -4.5 0 [defbox]
30
+ eval box b8 6 -6 0 [defbox]
31
+ eval box b9 6 -6 1 [defbox]
32
+ eval box b10 6 -6 2 [defbox]
33
+
34
+ # cut last box by prisms created from the first two to make impression
35
+ # that it is overlapped by these on selected view (see vviewparams below)
36
+ explode b1 f
37
+ explode b2 f
38
+ prism p0 b1_5 12.3 -14 6.8
39
+ bcut bx b10 p0
40
+ prism p1 b2_3 12 -14 6.8
41
+ bcut bxx bx p1
42
+ tcopy bxx b10
43
+
44
+ # make some boxes hollow
45
+ for {set i 1} {$i <= 1} {incr i} {
46
+ set dim [bounding b$i -save xmin ymin zmin xmax ymax zmax]
47
+ set dx [dval xmax-xmin]
48
+ set x1 [dval xmin+0.1*$dx]
49
+ set x2 [dval ymin+0.1*$dx]
50
+ set x3 [dval zmin+0.1*$dx]
51
+ box bc $x1 $x2 $x3 0.8*$dx 0.8*$dx $dx
52
+ bcut bb b$i bc
53
+ tcopy bb b$i
54
+ }
55
+
56
+ # prepare a view
57
+ vinit Penrose w=1024 h=512
58
+ vbackground -color WHITE
59
+ vrenderparams -rayTrace -fsaa on -reflections off -shadows off
60
+
61
+ # set camera position and adjust lights
62
+ vcamera -persp -fovy 25
63
+ vviewparams -eye 14 -14 6.8 -up 0 0 1 -at 4 -4 0 -scale 70
64
+ vsetdispmode 1
65
+ vlight -defaults
66
+ vlight dirlight1 -type DIRECTIONAL -direction 1 -2 -10 -head 1 -color WHITE
67
+ vlight dirlight2 -type DIRECTIONAL -direction 0 -10 0 -head 1 -color WHITE
68
+
69
+ # display boxes
70
+ vdisplay b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
71
+
72
+ # set colors like in boxes of on OCC logo
73
+ vsetcolor b1 DD0029
74
+ vsetcolor b2 F6DD00
75
+ vsetcolor b3 98F918
76
+ vsetcolor b4 E9007A
77
+ vsetcolor b5 007ABC
78
+ vsetcolor b6 93007A
79
+ vsetcolor b7 EE9800
80
+ vsetcolor b8 00B489
81
+ vsetcolor b9 00A47A
82
+ vsetcolor b10 007ABC
83
+
84
+ # set material to plastic for better look
85
+ for {set i 1} {$i <= 10} {incr i} {vsetmaterial b$i plastic}
86
+
87
+ vdrawtext label "Which\nbox\nis\ncloser\nto\nyou?" -pos 0 -6 -2 -color BLACK -halign left -valign bottom -angle 0 -zoom 0 -height 40
@@ -0,0 +1,4 @@
1
+ This directory provides a set of demo scripts for using OCCT functionality from
2
+ within DRAW Test Harness. Call the scripts from DRAW prompt, e.g.:
3
+
4
+ Draw[]> source resources/samples/tcl/VisualizationDemo.tcl
@@ -0,0 +1,162 @@
1
+ # Copyright (c) 1999-2014 OPEN CASCADE SAS
2
+ #
3
+ #Category: Demos
4
+ #Title: Displaying 3d viewer
5
+ #
6
+ # This file is part of Open CASCADE Technology software library.
7
+ #
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.
13
+ #
14
+ # Alternatively, this file may be used under the terms of Open CASCADE
15
+ # commercial license or contractual agreement.
16
+
17
+ # Command to log a message to both command-line and dialog window
18
+ proc sage { a} {
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
35
+ }
36
+
37
+ if { [winfo exists .h ] } {
38
+ destroy .h
39
+ }
40
+
41
+ pload MODELING VISUALIZATION
42
+
43
+ sage " Creating the V3D Viewer"
44
+ sage " vinit"
45
+ sage " "
46
+ vinit
47
+ vclear
48
+ clear
49
+
50
+ sage " Creating the Topological Viewer"
51
+ sage " smallview"
52
+ sage " "
53
+ smallview
54
+ sage " Creating a box"
55
+ sage " box b -10 -10 -10 20 20 20"
56
+ sage " "
57
+ box b -10 -10 -10 20 20 20
58
+ fit
59
+ sage " Display the box in the V3D Viewer"
60
+ sage " vdisplay b"
61
+ sage " "
62
+ vdisplay b
63
+ vfit
64
+ nexplode b f
65
+ erase b
66
+ sage " Draft of two lateral faces "
67
+ sage " nexplode b f"
68
+ sage " depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1 "
69
+ sage " nexplode r f"
70
+ sage " depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1 "
71
+ sage " "
72
+ depouille r b 0 0 -1 b_6 -15 10 -10 10 0 0 -1
73
+ clear
74
+ nexplode r f
75
+ depouille rr r 0 0 -1 r_1 -15 -10 -10 10 0 0 -1
76
+ clear
77
+ nexplode rr e
78
+ verase b
79
+ vdisplay rr
80
+ vfit
81
+ sage " Fillet on four lateral edges, then on the top and bottom edges "
82
+ sage " nexplode rr e"
83
+ sage " blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11"
84
+ sage " nexplode result e"
85
+ sage " blend result result 2 result_11 3 result_12"
86
+ sage " "
87
+ blend result rr 3 rr_2 3 rr_3 3 rr_10 3 rr_11
88
+ erase rr
89
+ erase result
90
+ nexplode result e
91
+ blend result result 2 result_11 3 result_12
92
+ clear
93
+ nexplode result f
94
+ verase rr
95
+ vdisplay result
96
+ vfit
97
+ sage " Creating a profile on the top face "
98
+ sage " nexplode result f"
99
+ sage " 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
100
+ "
101
+ sage " "
102
+ 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
103
+ sage " Creating a prism"
104
+ sage " prism rr p 0 0 20"
105
+ sage " "
106
+ prism rr p 0 0 20
107
+ sage " Change some attributes : MATERIAL , TRANSPARENCY"
108
+ sage " vsetmaterial rr PLASTIC"
109
+ sage " vsetcolor rr RED"
110
+ sage " vsettransparency result 0.5"
111
+ sage " vsetdispmode 1"
112
+ sage " "
113
+ vdisplay rr
114
+ vsetmaterial rr PLASTIC
115
+ vsettransparency rr 0.5
116
+ vsetcolor rr RED
117
+ vsettransparency result 0.5
118
+ vsetdispmode 1
119
+ vfit
120
+ fit
121
+ sage " Fusion of this prism with the original part "
122
+ sage " fuse result rr result"
123
+ sage " "
124
+ fuse result rr result
125
+ donl result
126
+ vdisplay result
127
+ vdonly result
128
+ vfit
129
+ nexplode result f
130
+ erase result
131
+ fit
132
+
133
+ sage " Opening the top face"
134
+ sage " offsetshape r result -1 0.0001 result_17"
135
+ sage " "
136
+ nexplode result f
137
+
138
+ offsetshape r result -1 0.0001 result_17
139
+ vdisplay r
140
+ vdonly r
141
+ vfit
142
+ vsetcolor r MATRABLUE
143
+ vsettransparency r 0
144
+
145
+ sage " Creating a cylinder and positioning it"
146
+ sage " pcylinder cyl 2 300"
147
+ sage " trotate cyl cyl 0 0 0 1 0 0 45"
148
+ sage " ttranslate cyl cyl 0 7.5 0"
149
+ sage " "
150
+ pcylinder cyl 2 30
151
+ vdisplay cyl
152
+ vsetcolor cyl RED
153
+ vfit
154
+ trotate cyl cyl 0 0 0 1 0 0 45
155
+ ttranslate cyl cyl 0 7.5 0
156
+ vdisplay cyl
157
+ vsetcolor cyl RED
158
+ vfit
159
+ vdisplay cyl
160
+ vsetcolor cyl RED
161
+ vfit
162
+ sage "Demo completed"