w-threejs-vue 1.0.0

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 (151) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +39 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +15 -0
  9. package/dist/w-threejs-vue.umd.js +26 -0
  10. package/dist/w-threejs-vue.umd.js.map +1 -0
  11. package/docs/examples/app.html +66 -0
  12. package/docs/examples/app.umd.js +31 -0
  13. package/docs/examples/app.umd.js.map +1 -0
  14. package/docs/examples/ex-AppBasicAutoRotateDeg.html +190 -0
  15. package/docs/examples/ex-AppBasicBackgroundColor.html +189 -0
  16. package/docs/examples/ex-AppBasicSize.html +170 -0
  17. package/docs/examples/ex-AppBasicUploadStl.html +237 -0
  18. package/docs/examples/ex-AppBasicUseAutoRotate.html +189 -0
  19. package/docs/examples/ex-AppCmCameraFar.html +191 -0
  20. package/docs/examples/ex-AppCmCameraFov.html +191 -0
  21. package/docs/examples/ex-AppCmCameraNear.html +191 -0
  22. package/docs/examples/ex-AppCmCameraOrthographicRatio.html +191 -0
  23. package/docs/examples/ex-AppCmCameraType.html +190 -0
  24. package/docs/examples/ex-AppCmGetCameraViewAngle.html +218 -0
  25. package/docs/examples/ex-AppCmSetCameraAzimuthAngle.html +190 -0
  26. package/docs/examples/ex-AppCmSetCameraPolarAngle.html +190 -0
  27. package/docs/examples/ex-AppCmSetCameraViewAngle.html +194 -0
  28. package/docs/examples/ex-AppHpHelperAxesLengthRatio.html +189 -0
  29. package/docs/examples/ex-AppHpHelperGridDensity.html +189 -0
  30. package/docs/examples/ex-AppHpHelperGridLengthRatio.html +189 -0
  31. package/docs/examples/ex-AppHpHelperGridPositionRatioZ.html +189 -0
  32. package/docs/examples/ex-AppHpUseHelperAxes.html +189 -0
  33. package/docs/examples/ex-AppHpUseHelperGrid.html +189 -0
  34. package/docs/examples/ex-AppLgLegnedBackgroundColor.html +189 -0
  35. package/docs/examples/ex-AppLgLegnedHeight.html +189 -0
  36. package/docs/examples/ex-AppLgLegnedHeightMax.html +189 -0
  37. package/docs/examples/ex-AppLtLightAmbientColor.html +189 -0
  38. package/docs/examples/ex-AppLtLightDirectionColor.html +191 -0
  39. package/docs/examples/ex-AppLtLightDirectionIntensity.html +191 -0
  40. package/docs/examples/ex-AppLtLightDirectionPos.html +191 -0
  41. package/docs/examples/ex-AppLtLightPointColor.html +192 -0
  42. package/docs/examples/ex-AppLtLightPointDecay.html +192 -0
  43. package/docs/examples/ex-AppLtLightPointDistance.html +192 -0
  44. package/docs/examples/ex-AppLtLightPointIntensity.html +192 -0
  45. package/docs/examples/ex-AppLtLightPointPoss.html +192 -0
  46. package/docs/examples/ex-AppLtUseLightAmbient.html +191 -0
  47. package/docs/examples/ex-AppLtUseLightDirection.html +191 -0
  48. package/docs/examples/ex-AppLtUseLightPoint.html +191 -0
  49. package/docs/examples/ex-AppMhGetMeshsInfor.html +198 -0
  50. package/docs/examples/ex-AppMhSetMeshColor.html +190 -0
  51. package/docs/examples/ex-AppMhSetMeshLabelText.html +190 -0
  52. package/docs/examples/ex-AppMhSetMeshLabelTextColor.html +190 -0
  53. package/docs/examples/ex-AppMhSetMeshLabelTextFontFamily.html +190 -0
  54. package/docs/examples/ex-AppMhSetMeshLabelTextFontSize.html +190 -0
  55. package/docs/examples/ex-AppMhSetMeshLabelVisible.html +198 -0
  56. package/docs/examples/ex-AppMhSetMeshVisible.html +198 -0
  57. package/docs/examples/ex-AppMuMenuIcons.html +217 -0
  58. package/docs/examples/ex-AppMuMenuTooltips.html +218 -0
  59. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  60. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  61. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  62. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  63. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  64. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  65. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  66. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  67. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  68. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  69. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  70. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  71. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  72. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  73. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  74. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  75. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  76. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  77. package/docs/index.html +84 -0
  78. package/docs/module-WThreejsVue.html +216 -0
  79. package/docs/scripts/collapse.js +39 -0
  80. package/docs/scripts/commonNav.js +28 -0
  81. package/docs/scripts/linenumber.js +25 -0
  82. package/docs/scripts/nav.js +12 -0
  83. package/docs/scripts/polyfill.js +4 -0
  84. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  85. package/docs/scripts/prettify/lang-css.js +2 -0
  86. package/docs/scripts/prettify/prettify.js +28 -0
  87. package/docs/scripts/search.js +99 -0
  88. package/docs/styles/jsdoc.css +776 -0
  89. package/docs/styles/prettify.css +80 -0
  90. package/package.json +74 -0
  91. package/public/index.html +42 -0
  92. package/src/App.vue +574 -0
  93. package/src/AppBasicAutoRotateDeg.vue +102 -0
  94. package/src/AppBasicBackgroundColor.vue +101 -0
  95. package/src/AppBasicSize.vue +90 -0
  96. package/src/AppBasicUploadStl.vue +159 -0
  97. package/src/AppBasicUseAutoRotate.vue +101 -0
  98. package/src/AppCmCameraFar.vue +103 -0
  99. package/src/AppCmCameraFov.vue +103 -0
  100. package/src/AppCmCameraNear.vue +103 -0
  101. package/src/AppCmCameraOrthographicRatio.vue +103 -0
  102. package/src/AppCmCameraType.vue +102 -0
  103. package/src/AppCmGetCameraViewAngle.vue +135 -0
  104. package/src/AppCmSetCameraAzimuthAngle.vue +104 -0
  105. package/src/AppCmSetCameraPolarAngle.vue +104 -0
  106. package/src/AppCmSetCameraViewAngle.vue +105 -0
  107. package/src/AppHpHelperAxesLengthRatio.vue +101 -0
  108. package/src/AppHpHelperGridDensity.vue +101 -0
  109. package/src/AppHpHelperGridLengthRatio.vue +101 -0
  110. package/src/AppHpHelperGridPositionRatioZ.vue +101 -0
  111. package/src/AppHpUseHelperAxes.vue +101 -0
  112. package/src/AppHpUseHelperGrid.vue +101 -0
  113. package/src/AppLgLegnedBackgroundColor.vue +101 -0
  114. package/src/AppLgLegnedHeight.vue +101 -0
  115. package/src/AppLgLegnedHeightMax.vue +101 -0
  116. package/src/AppLtLightAmbientColor.vue +101 -0
  117. package/src/AppLtLightDirectionColor.vue +103 -0
  118. package/src/AppLtLightDirectionIntensity.vue +103 -0
  119. package/src/AppLtLightDirectionPos.vue +103 -0
  120. package/src/AppLtLightPointColor.vue +104 -0
  121. package/src/AppLtLightPointDecay.vue +104 -0
  122. package/src/AppLtLightPointDistance.vue +104 -0
  123. package/src/AppLtLightPointIntensity.vue +104 -0
  124. package/src/AppLtLightPointPoss.vue +104 -0
  125. package/src/AppLtUseLightAmbient.vue +103 -0
  126. package/src/AppLtUseLightDirection.vue +103 -0
  127. package/src/AppLtUseLightPoint.vue +103 -0
  128. package/src/AppMhGetMeshsInfor.vue +112 -0
  129. package/src/AppMhSetMeshColor.vue +104 -0
  130. package/src/AppMhSetMeshLabelText.vue +104 -0
  131. package/src/AppMhSetMeshLabelTextColor.vue +104 -0
  132. package/src/AppMhSetMeshLabelTextFontFamily.vue +104 -0
  133. package/src/AppMhSetMeshLabelTextFontSize.vue +104 -0
  134. package/src/AppMhSetMeshLabelVisible.vue +106 -0
  135. package/src/AppMhSetMeshVisible.vue +106 -0
  136. package/src/AppMuMenuIcons.vue +130 -0
  137. package/src/AppMuMenuTooltips.vue +131 -0
  138. package/src/components/WThreejsVue.vue +955 -0
  139. package/src/js/addStl.mjs +83 -0
  140. package/src/js/getCsrdFromMeshs.mjs +85 -0
  141. package/src/js/plot3d.mjs +1407 -0
  142. package/src/main.js +8 -0
  143. package/test/all.test.mjs +10 -0
  144. package/toolg/addVersion.mjs +4 -0
  145. package/toolg/cleanFolder.mjs +4 -0
  146. package/toolg/gDistApp.mjs +38 -0
  147. package/toolg/gDistRollupComps.mjs +22 -0
  148. package/toolg/gDocExams.mjs +47 -0
  149. package/toolg/gExtractHtml.mjs +159 -0
  150. package/toolg/modifyReadme.mjs +4 -0
  151. package/vue.config.js +21 -0
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshLabelText</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshLabelText.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshLabelText.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelText(0,'Wheel Hub')">set mesh[0] color to 'Wheel Hub'</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelText(0,'ABC')">set mesh[0] color to 'ABC'</button>
18
+ </div>
19
+ <WThreejsVue
20
+ ref="thr"
21
+ :opt="opt"
22
+ @init="loading=false"
23
+ ></WThreejsVue>
24
+ </div>
25
+
26
+ <div style="padding-left:20px;">
27
+
28
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
29
+ <div style="padding-left:5px;">
30
+ <div id="optjson" style="font-size:10pt;"></div>
31
+ </div>
32
+ </div>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import WThreejsVue from './components/WThreejsVue.vue'
45
+ import jv from 'w-jsonview-tree'
46
+
47
+ export default {
48
+ components: {
49
+ WThreejsVue,
50
+ },
51
+ data: function() {
52
+ return {
53
+ 'loading': true,
54
+ 'opt': {
55
+ width: 800,
56
+ height: 600,
57
+ items: [
58
+ {
59
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
60
+ name: 'Wheel Hub',
61
+ color: 'rgba(214, 92, 92, 0.9)',
62
+ },
63
+ {
64
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
65
+ name: 'Ushape Connector',
66
+ color: 'rgba(214, 214, 92, 0.9)',
67
+ },
68
+ ],
69
+ },
70
+ 'action': [
71
+ ],
72
+ }
73
+ },
74
+ mounted: function() {
75
+ let vo = this
76
+ vo.showOptJson()
77
+ },
78
+ watch: {
79
+ opt: {
80
+ handler: function() {
81
+ let vo = this
82
+ vo.showOptJson()
83
+ },
84
+ deep: true,
85
+ },
86
+ },
87
+ methods: {
88
+ showOptJson: function() {
89
+ let vo = this
90
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
91
+ },
92
+ setMeshLabelText: function(ind, t) {
93
+ let vo = this
94
+ try {
95
+ vo.$refs.thr.getInst().setMeshLabelText(ind, t)
96
+ }
97
+ catch (err) {}
98
+ },
99
+ },
100
+ }
101
+ </script>
102
+
103
+ <style>
104
+ </style>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshLabelTextColor</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshLabelTextColor.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshLabelTextColor.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextColor(0,'#fff')">set mesh[0] color to '#fff'</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextColor(0,'#2ff')">set mesh[0] color to '#2ff'</button>
18
+ </div>
19
+ <WThreejsVue
20
+ ref="thr"
21
+ :opt="opt"
22
+ @init="loading=false"
23
+ ></WThreejsVue>
24
+ </div>
25
+
26
+ <div style="padding-left:20px;">
27
+
28
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
29
+ <div style="padding-left:5px;">
30
+ <div id="optjson" style="font-size:10pt;"></div>
31
+ </div>
32
+ </div>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import WThreejsVue from './components/WThreejsVue.vue'
45
+ import jv from 'w-jsonview-tree'
46
+
47
+ export default {
48
+ components: {
49
+ WThreejsVue,
50
+ },
51
+ data: function() {
52
+ return {
53
+ 'loading': true,
54
+ 'opt': {
55
+ width: 800,
56
+ height: 600,
57
+ items: [
58
+ {
59
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
60
+ name: 'Wheel Hub',
61
+ color: 'rgba(214, 92, 92, 0.9)',
62
+ },
63
+ {
64
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
65
+ name: 'Ushape Connector',
66
+ color: 'rgba(214, 214, 92, 0.9)',
67
+ },
68
+ ],
69
+ },
70
+ 'action': [
71
+ ],
72
+ }
73
+ },
74
+ mounted: function() {
75
+ let vo = this
76
+ vo.showOptJson()
77
+ },
78
+ watch: {
79
+ opt: {
80
+ handler: function() {
81
+ let vo = this
82
+ vo.showOptJson()
83
+ },
84
+ deep: true,
85
+ },
86
+ },
87
+ methods: {
88
+ showOptJson: function() {
89
+ let vo = this
90
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
91
+ },
92
+ setMeshLabelTextColor: function(ind, c) {
93
+ let vo = this
94
+ try {
95
+ vo.$refs.thr.getInst().setMeshLabelTextColor(ind, c)
96
+ }
97
+ catch (err) {}
98
+ },
99
+ },
100
+ }
101
+ </script>
102
+
103
+ <style>
104
+ </style>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshLabelTextFontFamily</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshLabelTextFontFamily.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshLabelTextFontFamily.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextFontFamily(0,'Microsoft JhengHei')">set mesh[0] color to 'Microsoft JhengHei'</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextFontFamily(0,'Arial')">set mesh[0] color to 'Arial'</button>
18
+ </div>
19
+ <WThreejsVue
20
+ ref="thr"
21
+ :opt="opt"
22
+ @init="loading=false"
23
+ ></WThreejsVue>
24
+ </div>
25
+
26
+ <div style="padding-left:20px;">
27
+
28
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
29
+ <div style="padding-left:5px;">
30
+ <div id="optjson" style="font-size:10pt;"></div>
31
+ </div>
32
+ </div>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import WThreejsVue from './components/WThreejsVue.vue'
45
+ import jv from 'w-jsonview-tree'
46
+
47
+ export default {
48
+ components: {
49
+ WThreejsVue,
50
+ },
51
+ data: function() {
52
+ return {
53
+ 'loading': true,
54
+ 'opt': {
55
+ width: 800,
56
+ height: 600,
57
+ items: [
58
+ {
59
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
60
+ name: 'Wheel Hub',
61
+ color: 'rgba(214, 92, 92, 0.9)',
62
+ },
63
+ {
64
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
65
+ name: 'Ushape Connector',
66
+ color: 'rgba(214, 214, 92, 0.9)',
67
+ },
68
+ ],
69
+ },
70
+ 'action': [
71
+ ],
72
+ }
73
+ },
74
+ mounted: function() {
75
+ let vo = this
76
+ vo.showOptJson()
77
+ },
78
+ watch: {
79
+ opt: {
80
+ handler: function() {
81
+ let vo = this
82
+ vo.showOptJson()
83
+ },
84
+ deep: true,
85
+ },
86
+ },
87
+ methods: {
88
+ showOptJson: function() {
89
+ let vo = this
90
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
91
+ },
92
+ setMeshLabelTextFontFamily: function(ind, ff) {
93
+ let vo = this
94
+ try {
95
+ vo.$refs.thr.getInst().setMeshLabelTextFontFamily(ind, ff)
96
+ }
97
+ catch (err) {}
98
+ },
99
+ },
100
+ }
101
+ </script>
102
+
103
+ <style>
104
+ </style>
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshLabelTextFontSize</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshLabelTextFontSize.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshLabelTextFontSize.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextFontSize(0,'0.8rem')">set mesh[0] color to '0.8rem'</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelTextFontSize(0,'1.0rem')">set mesh[0] color to '1.0rem'</button>
18
+ </div>
19
+ <WThreejsVue
20
+ ref="thr"
21
+ :opt="opt"
22
+ @init="loading=false"
23
+ ></WThreejsVue>
24
+ </div>
25
+
26
+ <div style="padding-left:20px;">
27
+
28
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
29
+ <div style="padding-left:5px;">
30
+ <div id="optjson" style="font-size:10pt;"></div>
31
+ </div>
32
+ </div>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import WThreejsVue from './components/WThreejsVue.vue'
45
+ import jv from 'w-jsonview-tree'
46
+
47
+ export default {
48
+ components: {
49
+ WThreejsVue,
50
+ },
51
+ data: function() {
52
+ return {
53
+ 'loading': true,
54
+ 'opt': {
55
+ width: 800,
56
+ height: 600,
57
+ items: [
58
+ {
59
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
60
+ name: 'Wheel Hub',
61
+ color: 'rgba(214, 92, 92, 0.9)',
62
+ },
63
+ {
64
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
65
+ name: 'Ushape Connector',
66
+ color: 'rgba(214, 214, 92, 0.9)',
67
+ },
68
+ ],
69
+ },
70
+ 'action': [
71
+ ],
72
+ }
73
+ },
74
+ mounted: function() {
75
+ let vo = this
76
+ vo.showOptJson()
77
+ },
78
+ watch: {
79
+ opt: {
80
+ handler: function() {
81
+ let vo = this
82
+ vo.showOptJson()
83
+ },
84
+ deep: true,
85
+ },
86
+ },
87
+ methods: {
88
+ showOptJson: function() {
89
+ let vo = this
90
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
91
+ },
92
+ setMeshLabelTextFontSize: function(ind, s) {
93
+ let vo = this
94
+ try {
95
+ vo.$refs.thr.getInst().setMeshLabelTextFontSize(ind, s)
96
+ }
97
+ catch (err) {}
98
+ },
99
+ },
100
+ }
101
+ </script>
102
+
103
+ <style>
104
+ </style>
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshLabelVisible</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshLabelVisible.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshLabelVisible.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelVisible(0,true)">show label of mesh[0]</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelVisible(0,false)">hide label of mesh[0]</button>
18
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelVisible(1,true)">show label of mesh[1]</button>
19
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshLabelVisible(1,false)">hide label of mesh[1]</button>
20
+ </div>
21
+ <WThreejsVue
22
+ ref="thr"
23
+ :opt="opt"
24
+ @init="loading=false"
25
+ ></WThreejsVue>
26
+ </div>
27
+
28
+ <div style="padding-left:20px;">
29
+
30
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
31
+ <div style="padding-left:5px;">
32
+ <div id="optjson" style="font-size:10pt;"></div>
33
+ </div>
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+
42
+ </div>
43
+ </template>
44
+
45
+ <script>
46
+ import WThreejsVue from './components/WThreejsVue.vue'
47
+ import jv from 'w-jsonview-tree'
48
+
49
+ export default {
50
+ components: {
51
+ WThreejsVue,
52
+ },
53
+ data: function() {
54
+ return {
55
+ 'loading': true,
56
+ 'opt': {
57
+ width: 800,
58
+ height: 600,
59
+ items: [
60
+ {
61
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
62
+ name: 'Wheel Hub',
63
+ color: 'rgba(214, 92, 92, 0.9)',
64
+ },
65
+ {
66
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
67
+ name: 'Ushape Connector',
68
+ color: 'rgba(214, 214, 92, 0.9)',
69
+ },
70
+ ],
71
+ },
72
+ 'action': [
73
+ ],
74
+ }
75
+ },
76
+ mounted: function() {
77
+ let vo = this
78
+ vo.showOptJson()
79
+ },
80
+ watch: {
81
+ opt: {
82
+ handler: function() {
83
+ let vo = this
84
+ vo.showOptJson()
85
+ },
86
+ deep: true,
87
+ },
88
+ },
89
+ methods: {
90
+ showOptJson: function() {
91
+ let vo = this
92
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
93
+ },
94
+ setMeshLabelVisible: function(ind, b) {
95
+ let vo = this
96
+ try {
97
+ vo.$refs.thr.getInst().setMeshLabelVisible(ind, b)
98
+ }
99
+ catch (err) {}
100
+ },
101
+ },
102
+ }
103
+ </script>
104
+
105
+ <style>
106
+ </style>
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div>
3
+
4
+ <div style="padding:20px;">
5
+ <div style="font-size:1.5rem;">setMeshVisible</div>
6
+ <a href="//yuda-lyu.github.io/w-threejs-vue/examples/ex-AppMhSetMeshVisible.html" target="_blank" class="item-link">example</a>
7
+ <a href="//github.com/yuda-lyu/w-threejs-vue/blob/master/docs/examples/ex-AppMhSetMeshVisible.html" target="_blank" class="item-link">code</a>
8
+ </div>
9
+
10
+ <div style="padding:0px 20px;">
11
+
12
+ <div style="display:flex; padding-bottom:40px; overflow-x:auto;">
13
+
14
+ <div style="position:relative;">
15
+ <div style="position:absolute; right:2px; top:1px; z-index:1;" v-if="!loading">
16
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshVisible(0,true)">show mesh[0]</button>
17
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshVisible(0,false)">hide mesh[0]</button>
18
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshVisible(1,true)">show mesh[1]</button>
19
+ <button style="margin:0px 3px 3px 0px;" @click="setMeshVisible(1,false)">hide mesh[1]</button>
20
+ </div>
21
+ <WThreejsVue
22
+ ref="thr"
23
+ :opt="opt"
24
+ @init="loading=false"
25
+ ></WThreejsVue>
26
+ </div>
27
+
28
+ <div style="padding-left:20px;">
29
+
30
+ <div :style="`border:1px solid #ddd; width:600px; min-width:600px; height:${opt.height}px; overflow-y:auto;`">
31
+ <div style="padding-left:5px;">
32
+ <div id="optjson" style="font-size:10pt;"></div>
33
+ </div>
34
+ </div>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ </div>
41
+
42
+ </div>
43
+ </template>
44
+
45
+ <script>
46
+ import WThreejsVue from './components/WThreejsVue.vue'
47
+ import jv from 'w-jsonview-tree'
48
+
49
+ export default {
50
+ components: {
51
+ WThreejsVue,
52
+ },
53
+ data: function() {
54
+ return {
55
+ 'loading': true,
56
+ 'opt': {
57
+ width: 800,
58
+ height: 600,
59
+ items: [
60
+ {
61
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_wheel-hub.stl',
62
+ name: 'Wheel Hub',
63
+ color: 'rgba(214, 92, 92, 0.9)',
64
+ },
65
+ {
66
+ url: 'https://cdn.jsdelivr.net/npm/w-demores@1.0.25/res/model/stl/3d_ushape-connector.stl',
67
+ name: 'Ushape Connector',
68
+ color: 'rgba(214, 214, 92, 0.9)',
69
+ },
70
+ ],
71
+ },
72
+ 'action': [
73
+ ],
74
+ }
75
+ },
76
+ mounted: function() {
77
+ let vo = this
78
+ vo.showOptJson()
79
+ },
80
+ watch: {
81
+ opt: {
82
+ handler: function() {
83
+ let vo = this
84
+ vo.showOptJson()
85
+ },
86
+ deep: true,
87
+ },
88
+ },
89
+ methods: {
90
+ showOptJson: function() {
91
+ let vo = this
92
+ jv(vo.opt, document.querySelector('#optjson'), { expanded: true })
93
+ },
94
+ setMeshVisible: function(ind, b) {
95
+ let vo = this
96
+ try {
97
+ vo.$refs.thr.getInst().setMeshVisible(ind, b)
98
+ }
99
+ catch (err) {}
100
+ },
101
+ },
102
+ }
103
+ </script>
104
+
105
+ <style>
106
+ </style>