occt-gltf-addon-linux-x64 0.1.0 → 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,147 @@
1
+ # Sample: creation of simple twist drill bit
2
+ #Category: Modeling
3
+ #Title: Drill
4
+
5
+ pload MODELING VISUALIZATION
6
+
7
+ # drill parameters (some terms taken from http://www.drill-bits.cn/drill-bits-quality.asp)
8
+ dset R 4. ;# outer radius
9
+ dset D 2*R ;# diameter
10
+ dset Rr 3.5 ;# chisel radius (outer radius minus body clearance)
11
+
12
+ dset b 1. ;# web thickness (approximate)
13
+ dset d b/2
14
+
15
+ dset H 80. ;# height of the spiral part
16
+ dset a 3.*pi ;# total angle of spiral rotation
17
+
18
+ dset sigma 118 ;# point angle, in degrees
19
+
20
+ # Create section profile by sequence of Boolean operations
21
+ # on simple planar objects
22
+ puts "Creating the drill section profile..."
23
+
24
+ polyline rectangle1 d -R 0 R -R 0 -d R 0 -R R 0 d -R 0
25
+
26
+ circle circle1 0 0 0 0 0 1 R
27
+ mkedge circle1 circle1
28
+ wire circle1 circle1
29
+
30
+ circle circle2 0 0 0 0 0 1 Rr
31
+ mkedge circle2 circle2
32
+ wire circle2 circle2
33
+
34
+ plane p0
35
+ mkface rectangle1 p0 rectangle1
36
+ mkface circle1 p0 circle1
37
+ mkface circle2 p0 circle2
38
+
39
+ bcommon sec rectangle1 circle1
40
+ bfuse sec sec circle2
41
+ unifysamedom sec sec
42
+
43
+ # Construct flute profile so as to have cutting lip straight after sharpening.
44
+ # Here we need to take into account spiral shift of the flute edge
45
+ # along the point length -- the way to do that is to make spiral
46
+ # from the desired cutting lip edge and then intersect it by plane
47
+ polyline lip d -d/2 0 d -R -R/tan(sigma/2*pi/180)
48
+
49
+ polyline sp 0 0 0 0 0 H
50
+ cylinder cc 0 0 0 0 0 1 0 -4 0 4
51
+ line ll 0 0 a 80
52
+ trim ll ll 0 sqrt(a*a+H*H)
53
+
54
+ vertex v1 0 -R 0
55
+ vertex v2 0 -R H
56
+ trotate v2 0 0 0 0 0 1 180.*a/pi
57
+ mkedge ee ll cc v1 v2
58
+ wire gg ee
59
+
60
+ mksweep sp
61
+ setsweep -G gg 0 0
62
+ addsweep lip
63
+ buildsweep spiral -S
64
+
65
+ mkface f0 p0 -R R -R R
66
+ bsection sflute spiral f0
67
+
68
+ # here we rely on that section curve is parameterized from 0 to 1
69
+ # and directed as cutting lip edge;
70
+ # note that this can change if intersection algorithm is modified
71
+ explode sflute e
72
+ mkcurve cflute sflute_1
73
+ cvalue cflute 0. x0 y0 z0
74
+ cvalue cflute 1. x1 y1 z1
75
+ vertex vf0 x0 y0 z0
76
+ vertex vf1 x1 y1 z1
77
+
78
+ # -- variant: replace curve by arc with start at x0,y0,z0 and end at x1,y1,z1,
79
+ # -- such that tangent at start point is along Y
80
+ #dset Rflute ((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))/(2*(x1-x0))
81
+ #circle aflute x0+Rflute y0 0 0 0 1 Rflute
82
+ #mkedge sflute_1 aflute vf0 vf1
83
+
84
+ # make rounding in the flute; use circle with radius Rr/2
85
+ circle cround x0+Rr/2 y0 0 0 0 1 Rr/2
86
+ vertex vf3 x0+Rr y0 0
87
+ mkedge sflute_2 cround vf3 vf0
88
+ vertex vf2 R -R 0
89
+ edge sflute_3 vf3 vf2
90
+ edge sflute_4 vf2 vf1
91
+ wire w2 sflute_1 sflute_2 sflute_3 sflute_4
92
+ mkface flute p0 w2
93
+
94
+ # cut flute from profile
95
+ bcut sec sec flute
96
+ trotate flute 0 0 0 0 0 1 180.
97
+ bcut sec sec flute
98
+ donly sec
99
+
100
+ # sweep profile to get a drill body
101
+ puts "Sweeping the profile..."
102
+
103
+ mksweep sp
104
+ setsweep -G gg 0 0
105
+ explode sec w
106
+ addsweep sec_1
107
+ buildsweep base -S
108
+
109
+ # sharpen the drill (see http://tool-land.ru/zatochka-sverla.php)
110
+ puts "Sharpening..."
111
+
112
+ dset theta a*R/H*sin((90-sigma/2)*pi/180)
113
+ plane ax1 d 1.9*D "H+1.9*D/tan(pi/180.*sigma/2.)" 0 -1 -1
114
+ pcone sh1 ax1 0 100*sin((sigma-90)/2*pi/180.) 100
115
+ trotate sh1 0 0 0 0 0 1 -theta*180/pi
116
+ tcopy sh1 sh2
117
+ trotate sh2 0 0 0 0 0 1 180
118
+ box sh -D/2 -D/2 72 D D 20
119
+ bcommon qq sh1 sh2
120
+ bcut sharpener sh qq
121
+
122
+ bcut body base sharpener
123
+
124
+ # make a shank
125
+ puts "Making a shank..."
126
+ plane pl2 0 0 -40 0 0 1
127
+ pcylinder shank pl2 4 40
128
+ pcone transit R 0 R
129
+ plane pl3 0 0 -40 0 0 -0.5
130
+ pcone tail pl3 R 0 0.5
131
+ bfuse shank shank tail
132
+ bfuse shank shank transit
133
+ bfuse drill body shank
134
+
135
+ # check result
136
+ checkshape drill
137
+
138
+ # show result
139
+ puts "Displaying result..."
140
+ incmesh drill 0.01
141
+ vdisplay drill
142
+ vsetdispmode drill 1
143
+ vrenderparams -msaa 8
144
+ vfit
145
+
146
+ # show section and sweep path
147
+ ttranslate sec_1 0 0 H; trotate sec_1 0 0 0 0 0 1 a*180/pi; incmesh gg 0.01; vdisplay gg sec_1
@@ -0,0 +1,89 @@
1
+ # The following example constructs a 3D object looking like new OCC logo on top view.
2
+ #
3
+ #Category: Modeling
4
+ #Title: OCC Logo 2019
5
+
6
+ pload MODELING VISUALIZATION XDE OCAF
7
+
8
+ # spheric body
9
+ psphere s 1
10
+ box b 0 0 -2 1.5 1.5 4
11
+ bcut sb s b
12
+
13
+ # toroidal handle
14
+ ptorus t 1 0.5
15
+ trotate t 0 0 0 0 0 1 -90
16
+ ttranslate t 1.5 1.5 0
17
+ bcut tb t b
18
+
19
+ pcylinder p1 0.5 0.5
20
+ trotate p1 0 0 0 0 0 1 180
21
+ trotate p1 0 0 0 1 0 0 90
22
+ ttranslate p1 0.5 1.5 0
23
+
24
+ pcylinder p2 0.5 0.5
25
+ trotate p2 0 0 0 0 0 1 180
26
+ trotate p2 0 0 0 1 0 0 90
27
+ trotate p2 0 0 0 0 0 1 90
28
+ ttranslate p2 1 0.5 0
29
+
30
+ bfuse tp tb p1
31
+ bfuse tp tp p2
32
+
33
+ # intermediate part
34
+
35
+ # - get surfaces and edges on half of spheric and toroidal parts for filling
36
+ box b -2 -2 -2 4 4 2
37
+ bcut sbh sb b
38
+ bcut tph tp b
39
+ unset b
40
+
41
+ explode sbh f
42
+ renamevar sbh_1 sbf
43
+ explode sbf e
44
+
45
+ explode tph f
46
+ renamevar tph_2 tpf1
47
+ renamevar tph_13 tpf2
48
+ explode tpf1 e
49
+ explode tpf2 e
50
+
51
+ # - make curved surface by plate
52
+ #plate r 0 4 tpf1_1 tpf1 1 tpf2_3 tpf2 1 sbf_2 sbf 1 sbf_4 sbf 1
53
+ approxplate r1 0 4 tpf1_1 tpf1 0 tpf2_1 tpf2 0 sbf_2 sbf 0 sbf_4 sbf 0 0.00001 100 3 0
54
+
55
+ # - make solid
56
+ tcopy r1 r2
57
+ tmirror r2 0 0 0 0 0 1
58
+ explode sb f
59
+ explode tp f
60
+ sewing rr 0.001 r1 r2 sb_2 sb_3 tp_2 tp_5
61
+ ssolid rr rs
62
+
63
+ # rotate all solids by 45 deg to have standard orientation of the logo on top view
64
+ trotate sb 0 0 0 0 0 1 -45
65
+ trotate tp 0 0 0 0 0 1 -45
66
+ trotate rs 0 0 0 0 0 1 -45
67
+
68
+ # create XDE document
69
+ catch {Close D}
70
+ XNewDoc D
71
+ set main [XNewShape D]
72
+ XAddComponent D $main sb
73
+ XAddComponent D $main tp
74
+ XAddComponent D $main rs
75
+ XUpdateAssemblies D
76
+ SetName D $main "OCC Logo 2019"
77
+ SetName D [XFindShape D sb] "Core"
78
+ SetName D [XFindShape D tp] "Loop"
79
+ SetName D [XFindShape D rs] "Connector"
80
+ XSetColor D sb FF3652
81
+ XSetColor D tp 00AADA
82
+ XSetColor D rs 0073B0
83
+
84
+ # display
85
+ vinit View1
86
+ vbackground -color WHITE
87
+ XDisplay -dispMode 1 D
88
+ vtop
89
+ vfit
@@ -0,0 +1,76 @@
1
+ # Markers demo
2
+ #
3
+ # It shows the various marker types supported by OCCT.
4
+
5
+ #Category: Visualization
6
+ #Title: Markers in 3d viewer
7
+
8
+ pload MODELING VISUALIZATION
9
+
10
+ # reflects Aspect_TypeOfMarker enumeration
11
+ set aMarkerTypeNames {
12
+ Aspect_TOM_POINT
13
+ Aspect_TOM_PLUS
14
+ Aspect_TOM_STAR
15
+ Aspect_TOM_X
16
+ Aspect_TOM_O
17
+ Aspect_TOM_O_POINT
18
+ Aspect_TOM_O_PLUS
19
+ Aspect_TOM_O_STAR
20
+ Aspect_TOM_O_X
21
+ Aspect_TOM_RING1
22
+ Aspect_TOM_RING2
23
+ Aspect_TOM_RING3
24
+ Aspect_TOM_BALL
25
+ Aspect_TOM_USERDEFINED
26
+ }
27
+
28
+ # custom marker
29
+ set aCustom1 [locate_data_file images/marker_box1.png]
30
+ set aCustom2 [locate_data_file images/marker_box2.png]
31
+ set aCustom3 [locate_data_file images/marker_kr.png]
32
+ set aCustom4 [locate_data_file images/marker_dot.png]
33
+
34
+ set aFontFile ""
35
+ catch { set aFontFile [locate_data_file DejaVuSans.ttf] }
36
+ set aLabelFont "Arial"
37
+ if { "$aFontFile" != "" } {
38
+ vfont add "$aFontFile" SansFont
39
+ set aLabelFont "SansFont"
40
+ }
41
+
42
+ # reset the viewer
43
+ vclear
44
+ vclose ALL
45
+ vinit name=View1 l=32 t=32 w=512 h=512
46
+
47
+ puts "Draw box in advance which should fit all our markers"
48
+ box b -8 -8 0 16 16 2
49
+ vbottom
50
+ vdisplay -noupdate -dispmode 0 b
51
+ vfit
52
+ vremove -noupdate b
53
+
54
+ puts "Draw markers of different type and size"
55
+ for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
56
+ set aRow [expr $aMarkerType - 7]
57
+ set aCol 5
58
+ set aName [lindex $aMarkerTypeNames $aMarkerType]
59
+ vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 7FFFFF -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font $aLabelFont -noupdate
60
+ vdisplay -top -noupdate "$aName"
61
+ if { $aMarkerType == 13 } {
62
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
63
+ set aCol [expr $aCol - 1]
64
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom2
65
+ set aCol [expr $aCol - 1]
66
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom3
67
+ set aCol [expr $aCol - 1]
68
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom4
69
+ } else {
70
+ for { set aMarkerScale 1.0 } { $aMarkerScale <= 7 } { set aMarkerScale [expr $aMarkerScale + 0.5] } {
71
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 MarkerType=$aMarkerType Scale=$aMarkerScale PointsOnSide=1
72
+ set aCol [expr $aCol - 1]
73
+ }
74
+ }
75
+ }
76
+ puts "All markers have been displayed"
@@ -0,0 +1,75 @@
1
+ # Script displays properties of different materials available in OCCT
2
+
3
+ #Category: Visualization
4
+ #Title: Material properties in viewer
5
+
6
+ set THE_MATERIALS {brass bronze copper gold jade neon_phc pewter obsidian plaster plastic satin silver steel stone chrome aluminium water glass diamond charcoal}
7
+ set THE_COLORS {default red green blue}
8
+ set THE_ROW_DIST 35
9
+
10
+ proc drawLabels {} {
11
+ set x 20
12
+ set y 15
13
+ foreach aMatIter $::THE_MATERIALS {
14
+ vdrawtext "$aMatIter" "$aMatIter" -pos $x $y 0 -color GRAY10 -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
15
+ incr y 10
16
+ }
17
+ set x 40
18
+ set y 5
19
+ foreach aColIter $::THE_COLORS {
20
+ set aLabColor "$aColIter"
21
+ if { "$aColIter" == "default" } { set aLabColor BLACK }
22
+ vdrawtext "$aColIter" "$aColIter" -pos $x $y 0 -color "$aLabColor" -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
23
+ incr x $::THE_ROW_DIST
24
+ }
25
+ }
26
+
27
+ proc drawObjects {theRow theColor} {
28
+ set aSize 4
29
+ set aCtr -2
30
+ set aCounter 0
31
+ set x [expr 30 + $theRow * $::THE_ROW_DIST]
32
+ set y 15
33
+ foreach aMatIter $::THE_MATERIALS {
34
+ set aSph s${theRow}_${aCounter}
35
+ set aBox b${theRow}_${aCounter}
36
+ uplevel #0 psphere $aSph $aSize
37
+ uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
38
+ uplevel #0 ttranslate $aSph $x $y 0
39
+ uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
40
+ uplevel #0 vdisplay -noredraw -dispMode 1 $aSph $aBox
41
+ uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
42
+ if {$theColor != ""} {
43
+ uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
44
+ }
45
+ incr aCounter
46
+ incr y 10
47
+ }
48
+ }
49
+
50
+ # setup 3D viewer content
51
+ pload MODELING VISUALIZATION
52
+
53
+ vclear
54
+ vclose ALL
55
+ vinit View1 w=768 h=768
56
+ vtop
57
+ vglinfo
58
+ vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
59
+
60
+ vlight -change 0 -dir 0.577 -0.577 -0.577
61
+ vrenderparams -msaa 8
62
+
63
+ # adjust scene bounding box
64
+ box bnd 0 0 0 180 210 1
65
+ vdisplay -noredraw -dispMode 0 bnd
66
+ vfit
67
+ vremove -noredraw bnd
68
+
69
+ # draw spheres and boxes with different materials
70
+ drawLabels
71
+ drawObjects 0 ""
72
+ drawObjects 1 red
73
+ drawObjects 2 green
74
+ drawObjects 3 blue1
75
+ vrepaint
@@ -0,0 +1,79 @@
1
+ # Script demonstrating Global illumination materials
2
+ # using path tracing rendering engine in 3D view
3
+
4
+ #Category: Visualization
5
+ #Title: Path tracing - Ball
6
+
7
+ set aBallPath [locate_data_file occ/Ball.brep]
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
+ # Setup 3D viewer
14
+ vclear
15
+ vinit name=View1 w=512 h=512
16
+ vglinfo
17
+ vvbo 0
18
+ vsetdispmode 1
19
+
20
+ # Setup view parameters
21
+ vcamera -persp
22
+ vviewparams -scale 18 -eye 44.49 -0.15 33.93 -at -14.20 -0.15 1.87 -up -0.48 0.00 0.88
23
+
24
+ # Load the model from disk
25
+ puts "Importing shape..."
26
+ restore $aBallPath ball
27
+
28
+ # Tessellate the model
29
+ incmesh ball 0.01
30
+
31
+ # Display the model and assign material
32
+ vdisplay -noupdate ball
33
+ vsetmaterial -noupdate ball glass
34
+
35
+ # Create a sphere inside the model
36
+ psphere s 8
37
+ incmesh s 0.01
38
+ vdisplay -noupdate s
39
+ vsetlocation -noupdate s 0 0 13
40
+ vsetmaterial -noupdate s plaster
41
+
42
+ # Create chessboard-style floor
43
+ box tile 10 10 0.1
44
+ eval compound [lrepeat 144 tile] tiles
45
+ explode tiles
46
+ for {set i 0} {$i < 12} {incr i} {
47
+ for {set j 1} {$j <= 12} {incr j} {
48
+ ttranslate tiles_[expr 12 * $i + $j] [expr $i * 10 - 90] [expr $j * 10 - 70] -0.15
49
+ vdisplay -noupdate tiles_[expr 12 * $i + $j]
50
+
51
+ vsetmaterial -noupdate tiles_[expr 12 * $i + $j] plaster
52
+
53
+ if {($i + $j) % 2 == 0} {
54
+ vbsdf tiles_[expr 12 * $i + $j] -kd 0.85
55
+ } else {
56
+ vbsdf tiles_[expr 12 * $i + $j] -kd 0.45
57
+ }
58
+ }
59
+ }
60
+
61
+ # Configure light sources
62
+ vlight -change 0 -headLight 0
63
+ vlight -change 0 -direction -0.25 -1 -1
64
+ vlight -change 0 -smoothAngle 17
65
+ vlight -change 0 -intensity 10.0
66
+
67
+ # Load environment map
68
+ vtextureenv on 1
69
+
70
+ puts "Trying path tracing mode..."
71
+ vrenderparams -ray -gi -rayDepth 10
72
+
73
+ # Start progressive refinement mode
74
+ #vprogressive
75
+
76
+ puts "Make several path tracing iterations to refine the picture, please wait..."
77
+ vfps 100
78
+ puts "Done. To improve the image further, or after view manipulations, give command:"
79
+ puts "vfps \[nb_iteratons\] or vrepaint -continuous"
@@ -0,0 +1,85 @@
1
+ # Script demonstrating Global illumination effects using non-interactive
2
+ # path tracing rendering engine in 3d view
3
+
4
+ #Category: Visualization
5
+ #Title: Path tracing - Cube
6
+
7
+ pload MODELING VISUALIZATION
8
+ # Ray-Tracing doesn't work with Compatible Profile on macOS
9
+ if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
10
+
11
+ # setup 3D viewer content
12
+ vclear
13
+ vinit name=View1 w=512 h=512
14
+ vglinfo
15
+
16
+ # setup light sources
17
+ vlight -clear
18
+ vlight -add POSITIONAL -headLight 0 -pos 0.5 0.5 0.85 -smoothRadius 0.06 -intensity 30.0 -name pntlight
19
+
20
+ vvbo 0
21
+ vsetdispmode 1
22
+ vcamera -persp
23
+
24
+ # setup outer box
25
+ box b 1 1 1
26
+ explode b FACE
27
+ vdisplay -noupdate b_1 b_2 b_3 b_5 b_6
28
+ vlocation -noupdate b_1 -setLocation 1 0 0
29
+ vlocation -noupdate b_2 -setLocation -1 0 0
30
+ vlocation -noupdate b_3 -setLocation 0 1 0
31
+ vlocation -noupdate b_5 -setLocation 0 0 1
32
+ vlocation -noupdate b_6 -setLocation 0 0 -1
33
+
34
+ vsetmaterial -noupdate b_1 plastic
35
+ vsetmaterial -noupdate b_2 plastic
36
+ vsetmaterial -noupdate b_3 plastic
37
+ vsetmaterial -noupdate b_5 plastic
38
+ vsetmaterial -noupdate b_6 plastic
39
+ vbsdf b_1 -kd 1 0.3 0.3 -ks 0
40
+ vbsdf b_2 -kd 0.3 0.5 1 -ks 0
41
+ vbsdf b_3 -kd 1 -ks 0
42
+ vbsdf b_5 -kd 1 -ks 0
43
+ vbsdf b_6 -kd 1 -ks 0
44
+
45
+ vfront
46
+ vfit
47
+
48
+ # setup first inner sphere
49
+ psphere s 0.2
50
+ vdisplay -noupdate s
51
+ vlocation -noupdate s -setLocation 0.21 0.3 0.2
52
+ vsetmaterial -noupdate s glass
53
+ vbsdf s -absorpColor 0.8 0.8 1.0
54
+ vbsdf s -absorpCoeff 6
55
+
56
+ # setup first inner box
57
+ box c 0.3 0.3 0.2
58
+ vdisplay -noupdate c
59
+ vlocation -noupdate c -reset -rotate 0 0 0 0 0 1 -30 -translate 0.55 0.3 0.0
60
+ vsetmaterial -noupdate c plastic
61
+ vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
62
+
63
+ # setup second inner box
64
+ box g 0.15 0.15 0.3
65
+ vdisplay -noupdate g
66
+ vlocation -noupdate g -reset -rotate 0 0 0 0 0 1 10 -translate 0.7 0.25 0.2
67
+ vsetmaterial -noupdate g glass
68
+ vbsdf g -absorpColor 0.8 1.0 0.8
69
+ vbsdf g -absorpCoeff 6
70
+
71
+ # setup second inner sphere
72
+ psphere r 0.1
73
+ vdisplay -noupdate r
74
+ vsetmaterial -noupdate r plastic
75
+ vbsdf r -kd 0.5 0.9 0.3 -ks 0.3 -baseRoughness 0.0 -n
76
+ vbsdf r -baseFresnel Constant 1.0
77
+ vlocation r -setLocation 0.5 0.65 0.1
78
+
79
+ puts "Trying path tracing mode..."
80
+ vrenderparams -ray -gi -rayDepth 8
81
+
82
+ puts "Make several path tracing iterations to refine the picture, please wait..."
83
+ vfps 100
84
+ puts "Done. To improve the image further, or after view manipulations, give command:"
85
+ puts "vfps \[nb_iteratons\] or vrepaint -continuous"