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.
- package/LICENSE_LGPL_21.txt +502 -0
- package/OCCT_LGPL_EXCEPTION.txt +10 -0
- package/README.md +2 -2
- package/index.js +63 -1
- package/lib/libTKBO.so.8.0.0 +0 -0
- package/lib/libTKBRep.so.8.0.0 +0 -0
- package/lib/libTKBin.so.8.0.0 +0 -0
- package/lib/libTKBinL.so.8.0.0 +0 -0
- package/lib/libTKBinTObj.so.8.0.0 +0 -0
- package/lib/libTKBinXCAF.so.8.0.0 +0 -0
- package/lib/libTKBool.so.8.0.0 +0 -0
- package/lib/libTKCAF.so.8.0.0 +0 -0
- package/lib/libTKCDF.so.8.0.0 +0 -0
- package/lib/libTKDE.so.8.0.0 +0 -0
- package/lib/libTKDECascade.so.8.0.0 +0 -0
- package/lib/libTKDEIGES.so.8.0.0 +0 -0
- package/lib/libTKDEOBJ.so.8.0.0 +0 -0
- package/lib/libTKDEPLY.so.8.0.0 +0 -0
- package/lib/libTKDESTEP.so.8.0.0 +0 -0
- package/lib/libTKDESTL.so.8.0.0 +0 -0
- package/lib/libTKDEVRML.so.8.0.0 +0 -0
- package/lib/libTKExpress.so.8.0.0 +0 -0
- package/lib/libTKFeat.so.8.0.0 +0 -0
- package/lib/libTKFillet.so.8.0.0 +0 -0
- package/lib/libTKG2d.so.8.0.0 +0 -0
- package/lib/libTKG3d.so.8.0.0 +0 -0
- package/lib/libTKGeomAlgo.so.8.0.0 +0 -0
- package/lib/libTKGeomBase.so.8.0.0 +0 -0
- package/lib/libTKHLR.so.8.0.0 +0 -0
- package/lib/libTKHelix.so.8.0.0 +0 -0
- package/lib/libTKLCAF.so.8.0.0 +0 -0
- package/lib/libTKMath.so.8.0.0 +0 -0
- package/lib/libTKMesh.so.8.0.0 +0 -0
- package/lib/libTKOffset.so.8.0.0 +0 -0
- package/lib/libTKPrim.so.8.0.0 +0 -0
- package/lib/libTKRWMesh.so.8.0.0 +0 -0
- package/lib/libTKService.so.8.0.0 +0 -0
- package/lib/libTKShHealing.so.8.0.0 +0 -0
- package/lib/libTKStd.so.8.0.0 +0 -0
- package/lib/libTKStdL.so.8.0.0 +0 -0
- package/lib/libTKTObj.so.8.0.0 +0 -0
- package/lib/libTKTopAlgo.so.8.0.0 +0 -0
- package/lib/libTKV3d.so.8.0.0 +0 -0
- package/lib/libTKVCAF.so.8.0.0 +0 -0
- package/lib/libTKXCAF.so.8.0.0 +0 -0
- package/lib/libTKXMesh.so.8.0.0 +0 -0
- package/lib/libTKXSBase.so.8.0.0 +0 -0
- package/lib/libTKXml.so.8.0.0 +0 -0
- package/lib/libTKXmlL.so.8.0.0 +0 -0
- package/lib/libTKXmlTObj.so.8.0.0 +0 -0
- package/lib/libTKXmlXCAF.so.8.0.0 +0 -0
- package/lib/libTKernel.so.8.0.0 +0 -0
- package/lib/libdraco.so.1 +0 -0
- package/lib/libtbb.so.2 +0 -0
- package/lib/libtbbmalloc.so.2 +0 -0
- package/lib/libtbbmalloc_proxy.so.2 +0 -0
- package/occt_gltf_addon.node +0 -0
- package/package.json +6 -2
- package/resources/BOPAlgo/BOPAlgo.msg +129 -0
- package/resources/BOPAlgo/FILES +1 -0
- package/resources/DrawResources/CURVES.tcl +38 -0
- package/resources/DrawResources/CheckCommands.tcl +1206 -0
- package/resources/DrawResources/DrawDefault +130 -0
- package/resources/DrawResources/DrawPlugin +64 -0
- package/resources/DrawResources/DrawTK.tcl +623 -0
- package/resources/DrawResources/FILES +16 -0
- package/resources/DrawResources/Geometry.tcl +96 -0
- package/resources/DrawResources/InitEnvironment.tcl +50 -0
- package/resources/DrawResources/Move.tcl +85 -0
- package/resources/DrawResources/OCC_logo.png +0 -0
- package/resources/DrawResources/PROFIL.tcl +726 -0
- package/resources/DrawResources/SCAN.tcl +192 -0
- package/resources/DrawResources/SURFACES.tcl +35 -0
- package/resources/DrawResources/StandardCommands.tcl +451 -0
- package/resources/DrawResources/StandardViews.tcl +284 -0
- package/resources/DrawResources/TKTopTest.tcl +27 -0
- package/resources/DrawResources/TestCommands.tcl +2969 -0
- package/resources/DrawResources/Vector.tcl +402 -0
- package/resources/DrawResources/dfb_attribns.gif +0 -0
- package/resources/DrawResources/dfb_attribute.gif +0 -0
- package/resources/DrawResources/dfb_folder.gif +0 -0
- package/resources/DrawResources/dftree.tcl +381 -0
- package/resources/DrawResources/lamp.ico +0 -0
- package/resources/SHMessage/FILES +2 -0
- package/resources/SHMessage/SHAPE.fr +267 -0
- package/resources/SHMessage/SHAPE.us +267 -0
- package/resources/Shaders/Declarations.glsl +276 -0
- package/resources/Shaders/DeclarationsImpl.glsl +121 -0
- package/resources/Shaders/Display.fs +157 -0
- package/resources/Shaders/FILES +27 -0
- package/resources/Shaders/LightShadow.glsl +48 -0
- package/resources/Shaders/PBRCookTorrance.glsl +20 -0
- package/resources/Shaders/PBRDirectionalLight.glsl +20 -0
- package/resources/Shaders/PBRDistribution.glsl +9 -0
- package/resources/Shaders/PBREnvBaking.fs +226 -0
- package/resources/Shaders/PBREnvBaking.vs +55 -0
- package/resources/Shaders/PBRFresnel.glsl +36 -0
- package/resources/Shaders/PBRGeometry.glsl +13 -0
- package/resources/Shaders/PBRIllumination.glsl +28 -0
- package/resources/Shaders/PBRPointLight.glsl +27 -0
- package/resources/Shaders/PBRSpotLight.glsl +45 -0
- package/resources/Shaders/PathtraceBase.fs +993 -0
- package/resources/Shaders/PhongDirectionalLight.glsl +29 -0
- package/resources/Shaders/PhongPointLight.glsl +36 -0
- package/resources/Shaders/PhongShading.fs +191 -0
- package/resources/Shaders/PhongShading.vs +43 -0
- package/resources/Shaders/PhongSpotLight.glsl +52 -0
- package/resources/Shaders/PointLightAttenuation.glsl +35 -0
- package/resources/Shaders/RaytraceBase.fs +1236 -0
- package/resources/Shaders/RaytraceBase.vs +12 -0
- package/resources/Shaders/RaytraceRender.fs +134 -0
- package/resources/Shaders/RaytraceSmooth.fs +80 -0
- package/resources/Shaders/SkydomBackground.fs +300 -0
- package/resources/Shaders/TangentSpaceNormal.glsl +17 -0
- package/resources/StdResource/FILES +6 -0
- package/resources/StdResource/MigrationSheet.txt +21 -0
- package/resources/StdResource/Plugin +52 -0
- package/resources/StdResource/Standard +25 -0
- package/resources/StdResource/StandardLite +22 -0
- package/resources/StdResource/TObj +17 -0
- package/resources/StdResource/XCAF +50 -0
- package/resources/TObj/FILES +1 -0
- package/resources/TObj/TObj.msg +85 -0
- package/resources/Textures/1d_elevation.rgb +0 -0
- package/resources/Textures/2d_MatraDatavision.rgb +0 -0
- package/resources/Textures/2d_alienskin.rgb +0 -0
- package/resources/Textures/2d_aluminum.rgb +0 -0
- package/resources/Textures/2d_blue_rock.rgb +0 -0
- package/resources/Textures/2d_bluewhite_paper.rgb +0 -0
- package/resources/Textures/2d_brushed.rgb +0 -0
- package/resources/Textures/2d_bubbles.rgb +0 -0
- package/resources/Textures/2d_bumps.rgb +0 -0
- package/resources/Textures/2d_cast.rgb +0 -0
- package/resources/Textures/2d_chess.rgba +0 -0
- package/resources/Textures/2d_chipbd.rgb +0 -0
- package/resources/Textures/2d_clouds.rgb +0 -0
- package/resources/Textures/2d_flesh.rgb +0 -0
- package/resources/Textures/2d_floor.rgb +0 -0
- package/resources/Textures/2d_galvnisd.rgb +0 -0
- package/resources/Textures/2d_grass.rgb +0 -0
- package/resources/Textures/2d_knurl.rgb +0 -0
- package/resources/Textures/2d_maple.rgb +0 -0
- package/resources/Textures/2d_marble.rgb +0 -0
- package/resources/Textures/2d_mottled.rgb +0 -0
- package/resources/Textures/2d_rain.rgb +0 -0
- package/resources/Textures/2d_rock.rgb +0 -0
- package/resources/Textures/FILES +31 -0
- package/resources/Textures/env_clouds.rgb +0 -0
- package/resources/Textures/env_cv.rgb +0 -0
- package/resources/Textures/env_lines.rgb +0 -0
- package/resources/Textures/env_medit.rgb +0 -0
- package/resources/Textures/env_pearl.rgb +0 -0
- package/resources/Textures/env_road.rgb +0 -0
- package/resources/Textures/env_sky1.rgb +0 -0
- package/resources/Textures/env_sky2.rgb +0 -0
- package/resources/UnitsAPI/CurrentUnits +74 -0
- package/resources/UnitsAPI/FILES +4 -0
- package/resources/UnitsAPI/MDTVBaseUnits +70 -0
- package/resources/UnitsAPI/MDTVCurrentUnits +74 -0
- package/resources/UnitsAPI/Units.dat +481 -0
- package/resources/XRResources/FILES +10 -0
- package/resources/XRResources/occtvr_actions.json +225 -0
- package/resources/XRResources/occtvr_bindings_generic.json +87 -0
- package/resources/XRResources/occtvr_bindings_holographic_hmd.json +18 -0
- package/resources/XRResources/occtvr_bindings_index_hmd.json +18 -0
- package/resources/XRResources/occtvr_bindings_rift.json +18 -0
- package/resources/XRResources/occtvr_bindings_touch.json +160 -0
- package/resources/XRResources/occtvr_bindings_vive.json +18 -0
- package/resources/XRResources/occtvr_bindings_vive_controller.json +139 -0
- package/resources/XRResources/occtvr_bindings_vive_cosmos.json +18 -0
- package/resources/XRResources/occtvr_bindings_vive_pro.json +18 -0
- package/resources/XSMessage/FILES +2 -0
- package/resources/XSMessage/XSTEP.fr +1026 -0
- package/resources/XSMessage/XSTEP.us +1023 -0
- package/resources/XSTEPResource/FILES +2 -0
- package/resources/XSTEPResource/IGES +65 -0
- package/resources/XSTEPResource/STEP +68 -0
- package/resources/XmlOcafResource/FILES +11 -0
- package/resources/XmlOcafResource/XmlOcaf.xsd +131 -0
- package/resources/XmlOcafResource/XmlOcaf_SmallTypes.xsd +217 -0
- package/resources/XmlOcafResource/XmlOcaf_TDF.xsd +33 -0
- package/resources/XmlOcafResource/XmlOcaf_TDataStd.xsd +230 -0
- package/resources/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd +37 -0
- package/resources/XmlOcafResource/XmlOcaf_TDocStd.xsd +37 -0
- package/resources/XmlOcafResource/XmlOcaf_TFunction.xsd +38 -0
- package/resources/XmlOcafResource/XmlOcaf_TNaming.xsd +128 -0
- package/resources/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd +97 -0
- package/resources/XmlOcafResource/XmlOcaf_TPrsStd.xsd +42 -0
- package/resources/XmlOcafResource/XmlXcaf.xsd +109 -0
- package/resources/samples/tcl/ANC101.tcl +282 -0
- package/resources/samples/tcl/DataExchangeDemo.tcl +85 -0
- package/resources/samples/tcl/MBBGehauseRohteil.tcl +268 -0
- package/resources/samples/tcl/ModelingDemo.tcl +120 -0
- package/resources/samples/tcl/Penrose.tcl +87 -0
- package/resources/samples/tcl/Readme.txt +4 -0
- package/resources/samples/tcl/VisualizationDemo.tcl +162 -0
- package/resources/samples/tcl/bottle.tcl +115 -0
- package/resources/samples/tcl/cad.tcl +63 -0
- package/resources/samples/tcl/cpu.tcl +327 -0
- package/resources/samples/tcl/cutter.tcl +91 -0
- package/resources/samples/tcl/dimensions.tcl +83 -0
- package/resources/samples/tcl/drill.tcl +147 -0
- package/resources/samples/tcl/logo2019.tcl +89 -0
- package/resources/samples/tcl/markers.tcl +76 -0
- package/resources/samples/tcl/materials.tcl +75 -0
- package/resources/samples/tcl/pathtrace_ball.tcl +79 -0
- package/resources/samples/tcl/pathtrace_cube.tcl +85 -0
- package/resources/samples/tcl/pathtrace_materials.tcl +229 -0
- package/resources/samples/tcl/pencil.tcl +64 -0
- package/resources/samples/tcl/raytrace.tcl +44 -0
- package/resources/samples/tcl/snowflake.tcl +161 -0
- package/resources/samples/tcl/spheres.tcl +148 -0
- package/resources/samples/tcl/vis_pbr_spheres.tcl +94 -0
- package/resources/samples/tcl/xde.tcl +47 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Script demonstrating Global illumination materials
|
|
2
|
+
# using path tracing rendering engine in 3D view
|
|
3
|
+
|
|
4
|
+
#Category: Visualization
|
|
5
|
+
#Title: Path tracing - Materials
|
|
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
|
+
# Restore exported shapes
|
|
21
|
+
restore $aBallPath Ball0
|
|
22
|
+
restore $aBallPath Ball1
|
|
23
|
+
restore $aBallPath Ball2
|
|
24
|
+
restore $aBallPath Ball3
|
|
25
|
+
restore $aBallPath Ball4
|
|
26
|
+
restore $aBallPath Ball5
|
|
27
|
+
restore $aBallPath Ball6
|
|
28
|
+
restore $aBallPath Ball7
|
|
29
|
+
restore $aBallPath Ball8
|
|
30
|
+
|
|
31
|
+
# Create chessboard-style floor
|
|
32
|
+
box tile 10 10 0.1
|
|
33
|
+
eval compound [lrepeat 144 tile] tiles
|
|
34
|
+
explode tiles
|
|
35
|
+
for {set i 0} {$i < 12} {incr i} {
|
|
36
|
+
for {set j 1} {$j <= 12} {incr j} {
|
|
37
|
+
ttranslate tiles_[expr 12 * $i + $j] [expr $i * 10 - 90] [expr $j * 10 - 70] -0.15
|
|
38
|
+
vdisplay -noupdate tiles_[expr 12 * $i + $j]
|
|
39
|
+
|
|
40
|
+
vsetmaterial -noupdate tiles_[expr 12 * $i + $j] plaster
|
|
41
|
+
|
|
42
|
+
if {($i + $j) % 2 == 0} {
|
|
43
|
+
vbsdf tiles_[expr 12 * $i + $j] -kd 0.85
|
|
44
|
+
} else {
|
|
45
|
+
vbsdf tiles_[expr 12 * $i + $j] -kd 0.45
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# Setup object 'Ball1'
|
|
51
|
+
vdisplay Ball1
|
|
52
|
+
vsetmaterial Ball1 Brass
|
|
53
|
+
vbsdf Ball1 -Kc 0 0 0
|
|
54
|
+
vbsdf Ball1 -Kd 0.272798 0.746262 0.104794
|
|
55
|
+
vbsdf Ball1 -Ks 0.253738 0.253738 0.253738
|
|
56
|
+
vbsdf Ball1 -Kt 0 0 0
|
|
57
|
+
vbsdf Ball1 -baseRoughness 0.045
|
|
58
|
+
vbsdf Ball1 -coatRoughness 0
|
|
59
|
+
vbsdf Ball1 -Le 0 0 0
|
|
60
|
+
vbsdf Ball1 -absorpColor 0 0 0
|
|
61
|
+
vbsdf Ball1 -absorpCoeff 0
|
|
62
|
+
vbsdf Ball1 -coatFresnel Constant 0
|
|
63
|
+
vbsdf Ball1 -baseFresnel Schlick 0.58 0.42 0.2
|
|
64
|
+
vlocation Ball1 -rotation 0 0 0 1
|
|
65
|
+
vlocation Ball1 -location 10 0 0
|
|
66
|
+
|
|
67
|
+
# Setup object 'Ball2'
|
|
68
|
+
vdisplay Ball2
|
|
69
|
+
vsetmaterial Ball2 Brass
|
|
70
|
+
vbsdf Ball2 -Kc 0 0 0
|
|
71
|
+
vbsdf Ball2 -Kd 0.8 0.8 0.8
|
|
72
|
+
vbsdf Ball2 -Ks 0 0 0
|
|
73
|
+
vbsdf Ball2 -Kt 0 0 0
|
|
74
|
+
vbsdf Ball2 -baseRoughness 0
|
|
75
|
+
vbsdf Ball2 -coatRoughness 0
|
|
76
|
+
vbsdf Ball2 -Le 2.02 0.171915 0.171915
|
|
77
|
+
vbsdf Ball2 -absorpColor 0 0 0
|
|
78
|
+
vbsdf Ball2 -absorpCoeff 0
|
|
79
|
+
vbsdf Ball2 -coatFresnel Constant 0
|
|
80
|
+
vbsdf Ball2 -baseFresnel Constant 1
|
|
81
|
+
vlocation Ball2 -rotation 0 0 0 1
|
|
82
|
+
vlocation Ball2 -location 10 40 0
|
|
83
|
+
|
|
84
|
+
# Setup object 'Ball3'
|
|
85
|
+
vdisplay Ball3
|
|
86
|
+
vsetmaterial Ball3 Glass
|
|
87
|
+
vbsdf Ball3 -Kc 1 1 1
|
|
88
|
+
vbsdf Ball3 -Kd 0 0 0
|
|
89
|
+
vbsdf Ball3 -Ks 0 0 0
|
|
90
|
+
vbsdf Ball3 -Kt 1 1 1
|
|
91
|
+
vbsdf Ball3 -baseRoughness 0
|
|
92
|
+
vbsdf Ball3 -coatRoughness 0
|
|
93
|
+
vbsdf Ball3 -Le 0 0 0
|
|
94
|
+
vbsdf Ball3 -absorpColor 0.75 0.95 0.9
|
|
95
|
+
vbsdf Ball3 -absorpCoeff 0.05
|
|
96
|
+
vbsdf Ball3 -coatFresnel Dielectric 1.62
|
|
97
|
+
vbsdf Ball3 -baseFresnel Constant 1
|
|
98
|
+
vlocation Ball3 -rotation 0 0 0 1
|
|
99
|
+
vlocation Ball3 -location -30 -40 0
|
|
100
|
+
|
|
101
|
+
# Setup object 'Ball4'
|
|
102
|
+
vdisplay Ball4
|
|
103
|
+
vsetmaterial Ball4 Brass
|
|
104
|
+
vbsdf Ball4 -Kc 0 0 0
|
|
105
|
+
vbsdf Ball4 -Kd 0 0 0
|
|
106
|
+
vbsdf Ball4 -Ks 0.985 0.985 0.985
|
|
107
|
+
vbsdf Ball4 -Kt 0 0 0
|
|
108
|
+
vbsdf Ball4 -baseRoughness 0
|
|
109
|
+
vbsdf Ball4 -coatRoughness 0
|
|
110
|
+
vbsdf Ball4 -Le 0 0 0
|
|
111
|
+
vbsdf Ball4 -absorpColor 0 0 0
|
|
112
|
+
vbsdf Ball4 -absorpCoeff 0
|
|
113
|
+
vbsdf Ball4 -coatFresnel Constant 0
|
|
114
|
+
vbsdf Ball4 -baseFresnel Schlick 0.58 0.42 0.2
|
|
115
|
+
vlocation Ball4 -rotation 0 0 0 1
|
|
116
|
+
vlocation Ball4 -location -70 -40 0
|
|
117
|
+
|
|
118
|
+
# Setup object 'Ball5'
|
|
119
|
+
vdisplay Ball5
|
|
120
|
+
vsetmaterial Ball5 Glass
|
|
121
|
+
vbsdf Ball5 -Kc 1 1 1
|
|
122
|
+
vbsdf Ball5 -Kd 0 0 0
|
|
123
|
+
vbsdf Ball5 -Ks 0 0 0
|
|
124
|
+
vbsdf Ball5 -Kt 1 1 1
|
|
125
|
+
vbsdf Ball5 -baseRoughness 0
|
|
126
|
+
vbsdf Ball5 -coatRoughness 0
|
|
127
|
+
vbsdf Ball5 -Le 0 0 0
|
|
128
|
+
vbsdf Ball5 -absorpColor 0 0.288061 0.825532
|
|
129
|
+
vbsdf Ball5 -absorpCoeff 0.3
|
|
130
|
+
vbsdf Ball5 -coatFresnel Dielectric 1.62
|
|
131
|
+
vbsdf Ball5 -baseFresnel Constant 1
|
|
132
|
+
vlocation Ball5 -rotation 0 0 0 1
|
|
133
|
+
vlocation Ball5 -location -30 0 0
|
|
134
|
+
|
|
135
|
+
# Setup object 'Ball6'
|
|
136
|
+
vdisplay Ball6
|
|
137
|
+
vsetmaterial Ball6 Brass
|
|
138
|
+
vbsdf Ball6 -Kc 1 1 1
|
|
139
|
+
vbsdf Ball6 -Kd 0 0.716033 0.884507
|
|
140
|
+
vbsdf Ball6 -Ks 0.115493 0.115493 0.115493
|
|
141
|
+
vbsdf Ball6 -Kt 0 0 0
|
|
142
|
+
vbsdf Ball6 -baseRoughness 0.045
|
|
143
|
+
vbsdf Ball6 -coatRoughness 0
|
|
144
|
+
vbsdf Ball6 -Le 0 0 0
|
|
145
|
+
vbsdf Ball6 -absorpColor 0 0 0
|
|
146
|
+
vbsdf Ball6 -absorpCoeff 0
|
|
147
|
+
vbsdf Ball6 -coatFresnel Dielectric 1.5
|
|
148
|
+
vbsdf Ball6 -baseFresnel Schlick 0.58 0.42 0.2
|
|
149
|
+
vlocation Ball6 -rotation 0 0 0 1
|
|
150
|
+
vlocation Ball6 -location -30 40 0
|
|
151
|
+
|
|
152
|
+
# Setup object 'Ball7'
|
|
153
|
+
vdisplay Ball7
|
|
154
|
+
vsetmaterial Ball7 Brass
|
|
155
|
+
vbsdf Ball7 -Kc 1 1 1
|
|
156
|
+
vbsdf Ball7 -Kd 1e-06 9.9999e-07 9.9999e-07
|
|
157
|
+
vbsdf Ball7 -Ks 0.0479573 0.804998 0
|
|
158
|
+
vbsdf Ball7 -Kt 0 0 0
|
|
159
|
+
vbsdf Ball7 -baseRoughness 0.447
|
|
160
|
+
vbsdf Ball7 -coatRoughness 0
|
|
161
|
+
vbsdf Ball7 -Le 0 0 0
|
|
162
|
+
vbsdf Ball7 -absorpColor 0 0 0
|
|
163
|
+
vbsdf Ball7 -absorpCoeff 0
|
|
164
|
+
vbsdf Ball7 -coatFresnel Dielectric 1.5
|
|
165
|
+
vbsdf Ball7 -baseFresnel Schlick 0.58 0.42 0.2
|
|
166
|
+
vlocation Ball7 -rotation 0 0 0 1
|
|
167
|
+
vlocation Ball7 -location -70 0 0
|
|
168
|
+
|
|
169
|
+
# Setup object 'Ball8'
|
|
170
|
+
vdisplay Ball8
|
|
171
|
+
vsetmaterial Ball8 Aluminium
|
|
172
|
+
vbsdf Ball8 -Kc 0 0 0
|
|
173
|
+
vbsdf Ball8 -Kd 0 0 0
|
|
174
|
+
vbsdf Ball8 -Ks 0.985 0.985 0.985
|
|
175
|
+
vbsdf Ball8 -Kt 0 0 0
|
|
176
|
+
vbsdf Ball8 -baseRoughness 0.026
|
|
177
|
+
vbsdf Ball8 -coatRoughness 0
|
|
178
|
+
vbsdf Ball8 -Le 0 0 0
|
|
179
|
+
vbsdf Ball8 -absorpColor 0 0 0
|
|
180
|
+
vbsdf Ball8 -absorpCoeff 0
|
|
181
|
+
vbsdf Ball8 -coatFresnel Constant 0
|
|
182
|
+
vbsdf Ball8 -baseFresnel Schlick 0.913183 0.921494 0.924524
|
|
183
|
+
vlocation Ball8 -rotation 0 0 0 1
|
|
184
|
+
vlocation Ball8 -location -70 40 0
|
|
185
|
+
|
|
186
|
+
# Setup object 'Ball0'
|
|
187
|
+
vdisplay Ball0
|
|
188
|
+
vsetmaterial Ball0 Glass
|
|
189
|
+
vbsdf Ball0 -Kc 0 0 0
|
|
190
|
+
vbsdf Ball0 -Kd 0.723404 0.166229 0.166229
|
|
191
|
+
vbsdf Ball0 -Ks 0 0 0
|
|
192
|
+
vbsdf Ball0 -Kt 0 0 0
|
|
193
|
+
vbsdf Ball0 -baseRoughness 0
|
|
194
|
+
vbsdf Ball0 -coatRoughness 0
|
|
195
|
+
vbsdf Ball0 -Le 0 0 0
|
|
196
|
+
vbsdf Ball0 -absorpColor 0 0 0
|
|
197
|
+
vbsdf Ball0 -absorpCoeff 0
|
|
198
|
+
vbsdf Ball0 -coatFresnel Constant 0
|
|
199
|
+
vbsdf Ball0 -baseFresnel Constant 1
|
|
200
|
+
vlocation Ball0 -rotation 0 0 0 1
|
|
201
|
+
vlocation Ball0 -location 10 -40 0
|
|
202
|
+
|
|
203
|
+
# Restore view parameters
|
|
204
|
+
vcamera -perspective -fovy 25
|
|
205
|
+
vcamera -distance 238.089
|
|
206
|
+
vviewparams -proj 0.679219 -0.00724546 0.7339
|
|
207
|
+
vviewparams -up -0.733931 -0.00311795 0.679217
|
|
208
|
+
vviewparams -at -22.3025 0.0986351 3.30327
|
|
209
|
+
vviewparams -eye 139.412 -1.62643 178.037
|
|
210
|
+
vviewparams -size 170.508
|
|
211
|
+
|
|
212
|
+
# Restore light source parameters
|
|
213
|
+
vlight -clear
|
|
214
|
+
vlight -add AMBIENT -name amblight
|
|
215
|
+
vlight -add DIRECTIONAL -direction -0.303949 -0.434084 -0.848048 -smoothAngle 17 -intensity 12 -name dirlight
|
|
216
|
+
|
|
217
|
+
# Load environment map
|
|
218
|
+
vtextureenv on 1
|
|
219
|
+
|
|
220
|
+
puts "Trying path tracing mode..."
|
|
221
|
+
vrenderparams -ray -gi -rayDepth 10
|
|
222
|
+
|
|
223
|
+
# Start progressive refinement mode
|
|
224
|
+
#vprogressive
|
|
225
|
+
|
|
226
|
+
puts "Make several path tracing iterations to refine the picture, please wait..."
|
|
227
|
+
vfps 512
|
|
228
|
+
puts "Done. To improve the image further, or after view manipulations, give command:"
|
|
229
|
+
puts "vfps \[nb_iteratons\] or vrepaint -continuous"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Sample demonstrating assignment of colors to faces in XDE
|
|
2
|
+
|
|
3
|
+
#Category: XDE
|
|
4
|
+
#Title: Assignment of colors to faces
|
|
5
|
+
|
|
6
|
+
pload MODELING VISUALIZATION OCAF XDE
|
|
7
|
+
|
|
8
|
+
box b 0 -20 -10 100 40 20
|
|
9
|
+
compound b b b a
|
|
10
|
+
explode a
|
|
11
|
+
trotate a_1 0 0 0 1 0 0 60
|
|
12
|
+
trotate a_2 0 0 0 1 0 0 -60
|
|
13
|
+
bcommon b a a_1
|
|
14
|
+
bcommon b b a_2
|
|
15
|
+
|
|
16
|
+
pcylinder c 4 100
|
|
17
|
+
trotate c 0 0 0 0 1 0 90
|
|
18
|
+
|
|
19
|
+
psphere s 1.4
|
|
20
|
+
ttranslate s 99.2 0 0
|
|
21
|
+
bfuse cx c s
|
|
22
|
+
|
|
23
|
+
pcone e 60 0.5 101
|
|
24
|
+
trotate e 0 0 0 0 1 0 90
|
|
25
|
+
|
|
26
|
+
bcommon body b e
|
|
27
|
+
bcut body body c
|
|
28
|
+
bcommon core cx e
|
|
29
|
+
|
|
30
|
+
text2brep text "CAD Assistant" -font Times -height 10
|
|
31
|
+
ttranslate text 10 -4 10
|
|
32
|
+
prism tr text 0 0 -1
|
|
33
|
+
bfuse body body tr
|
|
34
|
+
|
|
35
|
+
donly body core
|
|
36
|
+
|
|
37
|
+
#vdisplay body core
|
|
38
|
+
#vsetcolor body yellow
|
|
39
|
+
#vsetcolor core red
|
|
40
|
+
|
|
41
|
+
explode body so
|
|
42
|
+
explode body_1 f
|
|
43
|
+
explode core so
|
|
44
|
+
|
|
45
|
+
NewDocument D
|
|
46
|
+
XAddShape D body_1
|
|
47
|
+
XAddShape D core_1
|
|
48
|
+
|
|
49
|
+
for {set i 1} {$i <= 26} {incr i} {XSetColor D body_1_$i BLUE}
|
|
50
|
+
XSetColor D body_1_1 E68066
|
|
51
|
+
XSetColor D body_1_9 E68066
|
|
52
|
+
for {set i 10} {$i <= 22} {incr i} {XSetColor D body_1_$i 99B300}
|
|
53
|
+
XSetColor D core_1 1A1AFF
|
|
54
|
+
foreach ff [explode core_1 f] { XSetColor D $ff 1A1AFF ; puts "set color $ff" }
|
|
55
|
+
|
|
56
|
+
vclear
|
|
57
|
+
vinit View1
|
|
58
|
+
XDisplay -dispMode 1 D -explore
|
|
59
|
+
vfit
|
|
60
|
+
vrenderparams -msaa 8
|
|
61
|
+
vbackground -color WHITE
|
|
62
|
+
|
|
63
|
+
#param write.iges.brep.mode 1
|
|
64
|
+
#WriteIges D d:/pencil3.igs
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Script demonstrating ray tracing in 3d view
|
|
2
|
+
|
|
3
|
+
#Category: Visualization
|
|
4
|
+
#Title: Ray tracing
|
|
5
|
+
|
|
6
|
+
# Ray-Tracing doesn't work with Compatible Profile on macOS
|
|
7
|
+
pload VISUALIZATION
|
|
8
|
+
if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
|
|
9
|
+
|
|
10
|
+
# make bottle by calling another script
|
|
11
|
+
source [file join [file dirname [info script]] bottle.tcl]
|
|
12
|
+
|
|
13
|
+
# make table and a glass
|
|
14
|
+
box table -50 -50 -10 100 100 10
|
|
15
|
+
pcone glass_out 7 9 25
|
|
16
|
+
pcone glass_in 7 9 25
|
|
17
|
+
ttranslate glass_in 0 0 0.2
|
|
18
|
+
bcut glass glass_out glass_in
|
|
19
|
+
ttranslate glass -30 -30 0
|
|
20
|
+
|
|
21
|
+
# show table and glass
|
|
22
|
+
vinit w=1024 h=1024
|
|
23
|
+
vsetmaterial bottle aluminium
|
|
24
|
+
vdisplay table
|
|
25
|
+
vsetmaterial table bronze
|
|
26
|
+
vsetmaterial table plastic
|
|
27
|
+
vsetcolor table coral2
|
|
28
|
+
vdisplay glass
|
|
29
|
+
vsetmaterial glass plastic
|
|
30
|
+
vsetcolor glass brown
|
|
31
|
+
vsettransparency glass 0.6
|
|
32
|
+
|
|
33
|
+
# add light source for shadows
|
|
34
|
+
vlight spot -type SPOT -pos -100 -100 300
|
|
35
|
+
|
|
36
|
+
# set white background and fit view
|
|
37
|
+
vbackground -color WHITE
|
|
38
|
+
vfit
|
|
39
|
+
|
|
40
|
+
# set ray tracing
|
|
41
|
+
puts "Trying raytrace mode..."
|
|
42
|
+
if { ! [catch {vrenderparams -raytrace -shadows -reflections -fsaa -rayDepth 5}] } {
|
|
43
|
+
vtextureenv on 1
|
|
44
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Creation of 2d drawing
|
|
2
|
+
|
|
3
|
+
#Category: Modeling
|
|
4
|
+
#Title: Snowflake - creation of 2d drawing
|
|
5
|
+
|
|
6
|
+
pload MODELING VISUALIZATION
|
|
7
|
+
|
|
8
|
+
puts "Generating sample drawing of snowflake..."
|
|
9
|
+
|
|
10
|
+
# make circular elements
|
|
11
|
+
circle c11 5 5 0 5
|
|
12
|
+
circle c12 5 5 0 3
|
|
13
|
+
circle c21 18 7 0 7
|
|
14
|
+
circle c22 18 7 0 5
|
|
15
|
+
circle c31 28.5 5 0 5
|
|
16
|
+
circle c32 28.5 5 0 3
|
|
17
|
+
trim c21 c21 pi/4 -pi/4
|
|
18
|
+
trim c22 c22 pi/4 -pi/4
|
|
19
|
+
trim c31 c31 pi/4 -pi/4
|
|
20
|
+
trim c32 c32 pi/4 -pi/4
|
|
21
|
+
line l21 18 7 0 1 1 0
|
|
22
|
+
line l22 18 7 0 1 -1 0
|
|
23
|
+
line l31 28.5 5 0 1 1 0
|
|
24
|
+
line l32 28.5 5 0 1 -1 0
|
|
25
|
+
trim l21 l21 5 7
|
|
26
|
+
trim l22 l22 5 7
|
|
27
|
+
trim l31 l31 3 5
|
|
28
|
+
trim l32 l32 3 5
|
|
29
|
+
line l1 -6 0 0 0.86602540378443864 0.5 0
|
|
30
|
+
line l2 -6 1 0 1 0 0
|
|
31
|
+
trim l1 l1 0 30
|
|
32
|
+
trim l2 l2 0 45
|
|
33
|
+
mkedge c11 c11
|
|
34
|
+
mkedge c12 c12
|
|
35
|
+
mkedge c21 c21
|
|
36
|
+
mkedge c22 c22
|
|
37
|
+
mkedge c31 c31
|
|
38
|
+
mkedge c32 c32
|
|
39
|
+
mkedge l21 l21
|
|
40
|
+
mkedge l22 l22
|
|
41
|
+
mkedge l31 l31
|
|
42
|
+
mkedge l32 l32
|
|
43
|
+
mkedge l1 l1
|
|
44
|
+
mkedge l2 l2
|
|
45
|
+
wire b11 c11
|
|
46
|
+
wire b12 c12
|
|
47
|
+
orientation b12 R
|
|
48
|
+
|
|
49
|
+
# build one ray
|
|
50
|
+
plane p -6 0 0 0 0 1
|
|
51
|
+
mkface f1 p b11
|
|
52
|
+
add b12 f1
|
|
53
|
+
wire b2 c21 l21 c22 l22
|
|
54
|
+
mkface f2 p b2
|
|
55
|
+
wire b3 c31 l31 c32 l32
|
|
56
|
+
mkface f3 p b3
|
|
57
|
+
prism f5 l1 -5 8.6602540378443864 0
|
|
58
|
+
prism f4 l2 0 -1 0
|
|
59
|
+
compound f1 f2 f3 bc
|
|
60
|
+
bfuse r bc f4
|
|
61
|
+
bcut r r f5
|
|
62
|
+
tcopy r r1
|
|
63
|
+
tmirror r1 -6 0 0 0 1 0
|
|
64
|
+
bfuse w r r1
|
|
65
|
+
unifysamedom w w
|
|
66
|
+
donly w
|
|
67
|
+
|
|
68
|
+
# construct complete snowflake
|
|
69
|
+
tcopy w w1
|
|
70
|
+
tcopy w w2
|
|
71
|
+
tcopy w w3
|
|
72
|
+
tcopy w w4
|
|
73
|
+
tcopy w w5
|
|
74
|
+
trotate w1 -6 0 0 0 0 1 60
|
|
75
|
+
trotate w2 -6 0 0 0 0 1 120
|
|
76
|
+
trotate w3 -6 0 0 0 0 1 180
|
|
77
|
+
trotate w4 -6 0 0 0 0 1 240
|
|
78
|
+
trotate w5 -6 0 0 0 0 1 300
|
|
79
|
+
bfuse w w w1
|
|
80
|
+
bfuse w w w2
|
|
81
|
+
bfuse w w w3
|
|
82
|
+
bfuse w w w4
|
|
83
|
+
bfuse w w w5
|
|
84
|
+
shape wsh Sh
|
|
85
|
+
foreach f [explode w f] {add $f wsh}
|
|
86
|
+
renamevar wsh w
|
|
87
|
+
unifysamedom r w
|
|
88
|
+
|
|
89
|
+
# keep only wires in compound
|
|
90
|
+
eval compound [explode r w] snowflake
|
|
91
|
+
tscale snowflake -6 0 0 1.5
|
|
92
|
+
|
|
93
|
+
# draw frame loosely following GOST 2.104-68
|
|
94
|
+
polyline frame -100 -100 0 172 -100 0 172 100 0 -100 100 0 -100 -100 0
|
|
95
|
+
polyline t1 52 -100 0 52 -45 0 172 -45 0
|
|
96
|
+
polyline t2 52 -60 0 172 -60 0
|
|
97
|
+
polyline t3 52 -85 0 172 -85 0
|
|
98
|
+
polyline t4 122 -100 0 122 -60 0
|
|
99
|
+
polyline t5 122 -80 0 172 -80 0
|
|
100
|
+
polyline t6 122 -65 0 172 -65 0
|
|
101
|
+
polyline t7 142 -80 0 142 -85 0
|
|
102
|
+
polyline t8 137 -80 0 137 -60 0
|
|
103
|
+
polyline t9 154 -80 0 154 -60 0
|
|
104
|
+
compound frame t1 t2 t3 t4 t5 t6 t7 t8 t9 lines
|
|
105
|
+
|
|
106
|
+
# add text
|
|
107
|
+
text2brep sample "SAMPLE" -font Arial -height 10 -pos 90 -55 0 -aspect bolditalic
|
|
108
|
+
text2brep occ "Open CASCADE" -font Times -height 6 -pos 125 -95 0
|
|
109
|
+
text2brep name "Snowflake" -font Courier -height 7 -pos 65 -75 0 -aspect italic
|
|
110
|
+
text2brep material "Ice" -font Courier -height 7 -pos 75 -95 0 -aspect italic
|
|
111
|
+
text2brep sheets "Sheets 1" -font Courier -height 3.5 -pos 145 -83 0 -aspect italic
|
|
112
|
+
text2brep scale "Scale\n\n1:100" -font Courier -height 3.5 -pos 157 -63 0 -aspect italic -valign topfirstline
|
|
113
|
+
text2brep mass "Mass\n\n1 mg" -font Courier -height 3.5 -pos 140 -63 0 -aspect italic -valign topfirstline
|
|
114
|
+
eval compound [explode sample w] sample
|
|
115
|
+
eval compound [explode occ w] occ
|
|
116
|
+
eval compound [explode name w] name
|
|
117
|
+
eval compound [explode material w] material
|
|
118
|
+
eval compound [explode sheets w] sheets
|
|
119
|
+
eval compound [explode scale w] scale
|
|
120
|
+
eval compound [explode mass w] mass
|
|
121
|
+
compound sample occ name material sheets scale mass text
|
|
122
|
+
|
|
123
|
+
compound snowflake lines text drawing
|
|
124
|
+
bounding snowflake -save x1 y1 z1 x2 y2 z2
|
|
125
|
+
|
|
126
|
+
# display in 3d view
|
|
127
|
+
vinit Driver1/Viewer1/View1 w=1024 h=768
|
|
128
|
+
vdisplay snowflake lines text
|
|
129
|
+
vrenderparams -msaa 8
|
|
130
|
+
vsetcolor snowflake BLACK
|
|
131
|
+
vsetcolor lines BLACK
|
|
132
|
+
vsetcolor text BLACK
|
|
133
|
+
vbackground -color WHITE
|
|
134
|
+
vtop
|
|
135
|
+
vfit
|
|
136
|
+
|
|
137
|
+
# add dimension:
|
|
138
|
+
# detect vertices extremal in X direction
|
|
139
|
+
plane f1 x1 0 0 1 0 0
|
|
140
|
+
plane f2 x2 0 0 1 0 0
|
|
141
|
+
mkface f1 f1
|
|
142
|
+
mkface f2 f2
|
|
143
|
+
bsection s1 snowflake f1
|
|
144
|
+
bsection s2 snowflake f2
|
|
145
|
+
# select only upper vertices (nearer to the upper bound)
|
|
146
|
+
explode s1 v
|
|
147
|
+
explode s2 v
|
|
148
|
+
plane fup 0 y2 0 0 1 0
|
|
149
|
+
mkface fup fup
|
|
150
|
+
for {set i 1} {$i <= 2} {incr i} {
|
|
151
|
+
set dmin 1e10
|
|
152
|
+
for {set j 1} {$j <= 2} {incr j} {
|
|
153
|
+
distmini d s${i}_$j fup
|
|
154
|
+
set dist [dval d_val]
|
|
155
|
+
if {$dmin > $dist} {
|
|
156
|
+
set dmin $dist
|
|
157
|
+
eval set v$i s${i}_$j
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
vdimension length -length -shapes $v1 $v2 -plane xoy -value 0.001 -dispunits mm -showunits -flyout 70 -label above -color black -text 5 3d sh
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# test performance of display of heavy scene involving multiple interactive
|
|
2
|
+
# objects, on example of 1000 spheres
|
|
3
|
+
|
|
4
|
+
#Category: Visualization
|
|
5
|
+
#Title: Display of complex scene and animation
|
|
6
|
+
|
|
7
|
+
pload MODELING
|
|
8
|
+
pload VISUALIZATION
|
|
9
|
+
|
|
10
|
+
vinit View1 w=1024 h=1024
|
|
11
|
+
vclear
|
|
12
|
+
vdefaults -autoTriang 0
|
|
13
|
+
vrenderparams -stats basic
|
|
14
|
+
|
|
15
|
+
# parameter NB defines number of spheres by each coordinate
|
|
16
|
+
set NB 10
|
|
17
|
+
puts "Creating [expr $NB * $NB * $NB] spheres..."
|
|
18
|
+
set slist {}
|
|
19
|
+
for {set i 0} {$i < $NB} {incr i} {
|
|
20
|
+
for {set j 0} {$j < $NB} {incr j} {
|
|
21
|
+
for {set k 0} {$k < $NB} {incr k} {
|
|
22
|
+
psphere s$i$j$k 1.
|
|
23
|
+
lappend slist s$i$j$k
|
|
24
|
+
ttranslate s$i$j$k 3.*$i 3.*$j 3.*$k
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
eval compound $slist c
|
|
29
|
+
incmesh c 0.006
|
|
30
|
+
|
|
31
|
+
puts "Measuring FPS of display of spheres as separate objects..."
|
|
32
|
+
vaxo
|
|
33
|
+
eval vdisplay -dispMode 1 $slist
|
|
34
|
+
vfit
|
|
35
|
+
|
|
36
|
+
# measure FPS
|
|
37
|
+
puts [set fps_separate [vfps]]
|
|
38
|
+
vclear
|
|
39
|
+
|
|
40
|
+
puts "Measuring FPS of display of spheres as single object..."
|
|
41
|
+
vdisplay -dispMode 1 c
|
|
42
|
+
|
|
43
|
+
# measure FPS
|
|
44
|
+
puts [set fps_compound [vfps]]
|
|
45
|
+
vclear
|
|
46
|
+
|
|
47
|
+
# redisplay individual spheres, trying to avoid unnecessary internal updates
|
|
48
|
+
eval vdisplay -dispMode 1 $slist
|
|
49
|
+
|
|
50
|
+
# auxiliary procedure to make random update of variable
|
|
51
|
+
proc upd {theValueName theDeltaName theTime theToRand} {
|
|
52
|
+
upvar $theValueName aValue
|
|
53
|
+
upvar $theDeltaName aDelta
|
|
54
|
+
|
|
55
|
+
# set colors to corner spheres
|
|
56
|
+
if { $theToRand == 1 } {
|
|
57
|
+
set aValue [expr $aValue + $aDelta * $theTime / 100.0]
|
|
58
|
+
set aDelta [expr 0.5 * (rand() - 0.5)]
|
|
59
|
+
return $aValue
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set aRes [expr $aValue + $aDelta * $theTime / 100.0]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# move corner spheres in cycle
|
|
66
|
+
proc animateSpheres {{theDuration 10.0}} {
|
|
67
|
+
set nb [expr $::NB - 1]
|
|
68
|
+
|
|
69
|
+
# set colors to corner spheres
|
|
70
|
+
for {set i 0} {$i < $::NB} {incr i $nb} {
|
|
71
|
+
for {set j 0} {$j < $::NB} {incr j $nb} {
|
|
72
|
+
for {set k 0} {$k < $::NB} {incr k $nb} {
|
|
73
|
+
# mark animated spheres mutable for faster updates
|
|
74
|
+
uplevel #0 vdisplay -dispMode 1 -mutable s$i$j$k
|
|
75
|
+
# vaspects -noupdate s$i$j$k -setcolor red -setmaterial plastic
|
|
76
|
+
uplevel #0 vaspects -noupdate s$i$j$k -setcolor red
|
|
77
|
+
set x$i$j$k 0.0
|
|
78
|
+
set y$i$j$k 0.0
|
|
79
|
+
set z$i$j$k 0.0
|
|
80
|
+
set dx$i$j$k 0.0
|
|
81
|
+
set dy$i$j$k 0.0
|
|
82
|
+
set dz$i$j$k 0.0
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set aDuration 0.0
|
|
88
|
+
set aPrevRand 0.0
|
|
89
|
+
set aTimeFrom [clock clicks -milliseconds]
|
|
90
|
+
uplevel #0 chrono anAnimTimer reset
|
|
91
|
+
uplevel #0 chrono anAnimTimer start
|
|
92
|
+
set toRand 1
|
|
93
|
+
for {set aFrameIter 1} { $aFrameIter > 0 } {incr aFrameIter} {
|
|
94
|
+
set aCurrTime [expr [clock clicks -milliseconds] - $aTimeFrom]
|
|
95
|
+
if { $aCurrTime >= [expr $theDuration * 1000.0] } {
|
|
96
|
+
puts "Nb Frames: $aFrameIter"
|
|
97
|
+
puts "Duration: [expr $aCurrTime * 0.001] s"
|
|
98
|
+
set fps [expr ($aFrameIter - 1) / ($aDuration * 0.001) ]
|
|
99
|
+
puts "FPS: $fps"
|
|
100
|
+
uplevel #0 chrono anAnimTimer stop
|
|
101
|
+
uplevel #0 chrono anAnimTimer show
|
|
102
|
+
return $fps
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
set aRandTime [expr $aCurrTime - $aPrevRand]
|
|
106
|
+
if { $aRandTime > 1000 } {
|
|
107
|
+
set toRand 1
|
|
108
|
+
set aPrevRand $aCurrTime
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
#puts "PTS: $aCurrTime ms"
|
|
112
|
+
for {set i 0} {$i < $::NB} {incr i $nb} {
|
|
113
|
+
for {set j 0} {$j < $::NB} {incr j $nb} {
|
|
114
|
+
for {set k 0} {$k < $::NB} {incr k $nb} {
|
|
115
|
+
uplevel #0 vsetlocation -noupdate s$i$j$k [upd x$i$j$k dx$i$j$k $aRandTime $toRand] [upd y$i$j$k dy$i$j$k $aRandTime $toRand] [upd z$i$j$k dz$i$j$k $aRandTime $toRand]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
uplevel #0 vrepaint
|
|
120
|
+
set aDuration [expr [clock clicks -milliseconds] - $aTimeFrom]
|
|
121
|
+
set toRand 0
|
|
122
|
+
|
|
123
|
+
# sleep 1 ms allowing the user to interact with the viewer
|
|
124
|
+
after 1 set waiter 1
|
|
125
|
+
vwait waiter
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
puts "Animating movements of corner spheres (10 sec)..."
|
|
130
|
+
puts "(you can interact with the view during the process)"
|
|
131
|
+
set fps_animation [animateSpheres 10.0]
|
|
132
|
+
|
|
133
|
+
puts ""
|
|
134
|
+
puts "Performance counters (FPS = \"Frames per second\"):"
|
|
135
|
+
puts ""
|
|
136
|
+
puts "Spheres as separate interactive objects:"
|
|
137
|
+
puts " Actual FPS: [lindex $fps_separate 1]"
|
|
138
|
+
puts " FPS estimate by CPU load: [expr 1000. / [lindex $fps_separate 3]]"
|
|
139
|
+
puts ""
|
|
140
|
+
puts "Spheres as one interactive object (compound):"
|
|
141
|
+
puts " Actual FPS: [lindex $fps_compound 1]"
|
|
142
|
+
puts " FPS estimate by CPU load: [expr 1000. / [lindex $fps_compound 3]]"
|
|
143
|
+
puts ""
|
|
144
|
+
puts "Animation FPS: $fps_animation"
|
|
145
|
+
puts ""
|
|
146
|
+
puts "Scene contains [lindex [trinfo c] 3] triangles"
|
|
147
|
+
puts ""
|
|
148
|
+
puts "Print 'animateSpheres 10.0' to restart animation"
|