fl-web-component 1.2.7 → 1.2.9
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 -0
- package/dist/fl-web-component.common.js +38 -36
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-graphics/index.vue +3 -3
- package/src/utils/flgltf-parser.js +4 -2
- package/src/utils/instance-parser.js +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";#fl-model[data-v-
|
|
1
|
+
@charset "UTF-8";#fl-model[data-v-9d23b864],#konva-container[data-v-1eba8e28]{width:100%;height:100%;cursor:pointer}#konva-container[data-v-1eba8e28]{z-index:3;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
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
const { instances, drawObjs } = parseData(data);
|
|
218
218
|
if (instances.length > 0) {
|
|
219
|
-
|
|
219
|
+
handleInstancedMeshModel(modelGroup,
|
|
220
220
|
instances,
|
|
221
221
|
drawObjs,
|
|
222
222
|
'',
|
|
@@ -268,6 +268,7 @@
|
|
|
268
268
|
});
|
|
269
269
|
// cameraControls.fitToSphere(scene, true); // TODO 待处理,先用 setModelCenter 进行定位
|
|
270
270
|
this.setModelCenter(modelGroup);
|
|
271
|
+
console.log(modelGroup)
|
|
271
272
|
this.$emit('modelLoaded')
|
|
272
273
|
// cameraControls.saveState();
|
|
273
274
|
}
|
|
@@ -696,12 +697,11 @@
|
|
|
696
697
|
this.removeTraverse();
|
|
697
698
|
} else {
|
|
698
699
|
// 在这里清除一些标记之类的
|
|
700
|
+
modelGroup.clear();
|
|
699
701
|
scene.remove(modelGroup);
|
|
700
702
|
renderer.clear();
|
|
701
703
|
modelGroup = null;
|
|
702
704
|
modelGroup = new this.THREE.Group();
|
|
703
|
-
this.initCamera();
|
|
704
|
-
this.initControl();
|
|
705
705
|
}
|
|
706
706
|
},
|
|
707
707
|
// 销毁场景 释放内存
|
|
@@ -111,9 +111,11 @@ function parseData(input) {
|
|
|
111
111
|
linewidth: material?.linewidth !== undefined ? material?.linewidth : 1, // 默认值
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
const identity = new THREE.Matrix4().identity();
|
|
115
|
+
|
|
114
116
|
geomList.push({
|
|
115
117
|
matrix: {
|
|
116
|
-
val: primitive.matrix,
|
|
118
|
+
val: primitive.matrix?.length ? primitive.matrix : identity.elements,
|
|
117
119
|
},
|
|
118
120
|
prmid: primitive.prmid,
|
|
119
121
|
geomId: primitiveData.id,
|
|
@@ -121,7 +123,7 @@ function parseData(input) {
|
|
|
121
123
|
text: primitiveData.geomText,
|
|
122
124
|
points: primitiveData.position,
|
|
123
125
|
normals: primitiveData.normal,
|
|
124
|
-
triangles: primitiveData.indices,
|
|
126
|
+
triangles: primitiveData.indices || [],
|
|
125
127
|
max: primitiveData.max,
|
|
126
128
|
min: primitiveData.min,
|
|
127
129
|
prop: prop,
|
|
@@ -26,6 +26,7 @@ let drawObjMapInstance = {};
|
|
|
26
26
|
* @param {Array} drawObjs - 绘制对象数组,包含几何数据
|
|
27
27
|
*/
|
|
28
28
|
function handleInstancedMeshModel(
|
|
29
|
+
modelGroup,
|
|
29
30
|
instances,
|
|
30
31
|
drawObjs,
|
|
31
32
|
type,
|
|
@@ -34,8 +35,9 @@ function handleInstancedMeshModel(
|
|
|
34
35
|
meshNameConfig,
|
|
35
36
|
customOpacity
|
|
36
37
|
) {
|
|
38
|
+
drawObjMapInstance = {};
|
|
37
39
|
// 第一阶段:构建实例映射表
|
|
38
|
-
let modelGroup = new THREE.Group();
|
|
40
|
+
// let modelGroup = new THREE.Group();
|
|
39
41
|
for (let i = 0; i < instances.length; i++) {
|
|
40
42
|
formatInstancedMap(instances[i], drawObjs);
|
|
41
43
|
}
|