fl-web-component 1.2.19 → 1.3.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.
- package/README.md +4 -1
- package/dist/fl-web-component.common.js +50 -31
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +5 -5
- package/packages/components/com-graphics/index.vue +2 -2
- package/src/static/question.svg +1 -0
- package/src/utils/flgltf-parser.js +21 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";#fl-model[data-v-
|
|
1
|
+
@charset "UTF-8";#fl-model[data-v-416e2bff]{width:100%;height:100%;cursor:pointer}[data-v-416e2bff] .tips-label{width:50px;color:#000;font:12px Helvetica;padding:5px;text-align:center;vertical-align:middle;background-color:khaki}[data-v-416e2bff] .measure-label{max-width:100px;margin-top:-1em;border:10px;border-radius:5px;padding:3px 10px;cursor:pointer;color:#009bea;background-color:#f4f4f4;box-shadow:0 1px 3px 1px rgba(0,0,0,.25)}[data-v-416e2bff] .circle-tag{width:10px;height:10px;border-radius:50%;background-color:#ff5000}[data-v-416e2bff] .measure-label-font{word-break:break-all}[data-v-416e2bff] .mark-label-img{padding-top:5px;width:20px;height:20px}#konva-container[data-v-4458f11e]{z-index:3;width:100%;height:100%;cursor:pointer;overflow:hidden}span[data-v-f547d5c6]{font-weight:bolder}.text[data-v-f547d5c6]{margin-top:20px}.line[data-v-f547d5c6]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-f547d5c6]{display:flex;flex-direction:column;align-items:center}.center .cen span[data-v-f547d5c6],.center .top span[data-v-f547d5c6]{color:"#53a8ff";display:inline-block;width:30px;height:30px;text-align:center;line-height:30px;border:1px solid;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-f547d5c6]{margin:10px}.button[data-v-f547d5c6]{display:flex;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-f547d5c6]{font-family:iconfont!important;font-size:50px;font-style:normal;color:"#53a8ff";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-f547d5c6]:before{content:""}#svg-tigger[data-v-0ec35ee4]{cursor:pointer;height:100%;width:100%}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fl-web-component",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"tip1": "仅调试本组件不涉及业务组件,请执行dev",
|
|
6
6
|
"dev": "vue-cli-service serve",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"build": "npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js",
|
|
13
13
|
"build:test": "vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js",
|
|
14
14
|
"registry:npm": "npm config set registry https://registry.npmjs.org/",
|
|
15
|
-
"publish:base": "npm run build && npm publish",
|
|
15
|
+
"publish:base": "npm run build && npm run registry:npm && npm publish",
|
|
16
16
|
"==": "=============================================================",
|
|
17
17
|
"tip3": "发版注意: 【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】",
|
|
18
|
-
"publish:fix": "npm
|
|
19
|
-
"publish:feat": "npm
|
|
20
|
-
"publish:perf": "npm
|
|
18
|
+
"publish:fix": "npm version patch && npm run publish:base",
|
|
19
|
+
"publish:feat": "npm version minor && npm run publish:base",
|
|
20
|
+
"publish:perf": "npm version major && npm run publish:base"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
powerPreference: 'high-performance',
|
|
158
158
|
preserveDrawingBuffer: true, //保留图形缓冲区 TODO 临时截图使用
|
|
159
159
|
});
|
|
160
|
-
renderer.setPixelRatio(window.devicePixelRatio
|
|
161
|
-
renderer.setSize(
|
|
160
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
161
|
+
renderer.setSize(instructions.clientWidth, instructions.clientHeight);
|
|
162
162
|
renderer.domElement.id = 'three-model';
|
|
163
163
|
renderer.shadowMap.enabled = true;
|
|
164
164
|
// 暂时注释这句 还有worker里面的 这跟渲染出的模型浅或暗有关系
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1581238842264" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1409" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 0C229.233778 0 0 229.233778 0 512s229.233778 512 512 512 512-229.233778 512-512A512 512 0 0 0 512 0z m0 938.666667C276.366222 938.666667 85.333333 747.633778 85.333333 512 85.333333 276.366222 276.366222 85.333333 512 85.333333c235.633778 0 426.666667 191.032889 426.666667 426.666667a426.666667 426.666667 0 0 1-426.666667 426.666667z m0-717.653334a170.666667 170.666667 0 0 0-170.666667 170.666667 42.666667 42.666667 0 0 0 85.333334 0 85.333333 85.333333 0 1 1 85.333333 85.333333 42.666667 42.666667 0 0 0-42.666667 42.666667v111.36a42.666667 42.666667 0 0 0 85.333334 0v-74.24A170.666667 170.666667 0 0 0 512 221.013333z m-42.666667 542.293334a42.666667 42.666667 0 1 0 85.333334 0 42.666667 42.666667 0 0 0-85.333334 0z" p-id="1410"></path></svg>
|
|
@@ -99,7 +99,8 @@ function parseData(input) {
|
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
const formatInstances = [];
|
|
102
|
-
const
|
|
102
|
+
const preNode = input.node ? input.node : generateNode(input.mesh);
|
|
103
|
+
const rootInstances = parseNode(preNode);
|
|
103
104
|
flattenAndComputeWorldMatrices(rootInstances, formatInstances);
|
|
104
105
|
|
|
105
106
|
const map = {
|
|
@@ -166,5 +167,24 @@ function parseNode(node) {
|
|
|
166
167
|
|
|
167
168
|
return rootInstances;
|
|
168
169
|
}
|
|
170
|
+
// 生成默认node节点
|
|
171
|
+
function generateNode(mesh) {
|
|
172
|
+
let nodes = [];
|
|
173
|
+
mesh.forEach(item => {
|
|
174
|
+
if (item.primitives.length) {
|
|
175
|
+
let tempNode = {
|
|
176
|
+
id: item.id,
|
|
177
|
+
_batchId: item.id,
|
|
178
|
+
name: item.id,
|
|
179
|
+
mesh: item.id,
|
|
180
|
+
matrix: {},
|
|
181
|
+
nodeType: 3,
|
|
182
|
+
};
|
|
183
|
+
nodes.push(tempNode);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
return nodes;
|
|
188
|
+
}
|
|
169
189
|
|
|
170
190
|
export { parseData, parseNode };
|