viral-viewer-2 4.4.5 → 4.4.6
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/dist/components/scene/viral-scene.d.ts +1 -0
- package/dist/components/scene/viral-scene.js +1 -0
- package/dist/components/scene/viral-scene.js.map +1 -1
- package/dist/components/worker/viral-viewer-4.worker.d.ts +1 -1
- package/dist/components/worker/viral-viewer-4.worker.js +19 -22
- package/dist/components/worker/viral-viewer-4.worker.js.map +1 -1
- package/dist/components/worker-script/load-model-worker-3.script.js +41 -15
- package/dist/components/worker-script/load-model-worker-3.script.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.js +8 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-scene.js","sourceRoot":"","sources":["../../../src/components/scene/viral-scene.ts"],"names":[],"mappings":";;;AAAA,iCAee;AAEf,uCAAyC;AACzC,6EAA0E;AAE1E,MAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"viral-scene.js","sourceRoot":"","sources":["../../../src/components/scene/viral-scene.ts"],"names":[],"mappings":";;;AAAA,iCAee;AAEf,uCAAyC;AACzC,6EAA0E;AAE1E,MAAa,UAAU;IAUrB,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QATjD,UAAK,GAAU,IAAI,aAAK,EAAE,CAAC;QAC3B,YAAO,GAAe,EAAE,CAAC;QACzB,WAAM,GAAe,EAAE,CAAC;QACxB,gBAAW,GAAe,EAAE,CAAC;QAC7B,UAAK,GAAe,EAAE,CAAC;QACvB,WAAM,GAAY,EAAE,CAAC;QACrB,sBAAiB,GAA6B,IAAI,CAAC;QACnD,iBAAY,GAAmB,EAAE,CAAC;QAClC,cAAS,GAAiC,IAAI,kBAAU,EAAoB,CAAC;QAE3E,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,C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AC,CAAC,EACxB,IAAI,4BAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAC/D,CAAC;YACF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;SACtB;IACH,CAAC;IACM,OAAO;QACZ,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,UAAU,GAAG,IAAI,kBAAU,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;SAC5B;IACH,CAAC;IACM,iBAAiB,CAAC,KAAc;QACrC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACzC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB;IACH,CAAC;CAEF;AAvHD,gCAuHC"}
|
|
@@ -5,8 +5,8 @@ import { WorkerThreadPool } from "./base/worker-pool";
|
|
|
5
5
|
export declare class ViralViewerWorker4 {
|
|
6
6
|
viralViewerApi: ViralViewerApi;
|
|
7
7
|
workerPool: WorkerThreadPool;
|
|
8
|
-
materials: RenderMaterial[];
|
|
9
8
|
mainModel: Mesh | null;
|
|
9
|
+
materialGroup: any[];
|
|
10
10
|
constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
|
|
11
11
|
initial(materials: RenderMaterial[]): void;
|
|
12
12
|
loadElement(elements: ViralutionElement[], callbackOnSuccess?: () => void): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ViralViewerWorker4 = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
4
5
|
const three_1 = require("three");
|
|
5
6
|
const load_model_worker_3_script_1 = require("../worker-script/load-model-worker-3.script");
|
|
6
7
|
const worker_pool_1 = require("./base/worker-pool");
|
|
@@ -8,8 +9,8 @@ const threejs_1 = require("../../utils/threejs");
|
|
|
8
9
|
class ViralViewerWorker4 {
|
|
9
10
|
constructor(viralViewerApi, scriptUrl = "../worker-script/load-model-worker-2.script.js") {
|
|
10
11
|
this.viralViewerApi = viralViewerApi;
|
|
11
|
-
this.materials = [];
|
|
12
12
|
this.mainModel = null;
|
|
13
|
+
this.materialGroup = [];
|
|
13
14
|
// Create a new Blob containing the worker code
|
|
14
15
|
const blob = new Blob([`(${load_model_worker_3_script_1.workerCode})()`]);
|
|
15
16
|
const workerPath = URL.createObjectURL(blob);
|
|
@@ -17,7 +18,6 @@ class ViralViewerWorker4 {
|
|
|
17
18
|
this.workerPool = new worker_pool_1.WorkerThreadPool(this.viralViewerApi.options.numberOfWorker, workerPath);
|
|
18
19
|
}
|
|
19
20
|
initial(materials) {
|
|
20
|
-
this.materials = materials;
|
|
21
21
|
this.mainModel = new three_1.Mesh();
|
|
22
22
|
this.mainModel.name = "Viral Model";
|
|
23
23
|
this.viralViewerApi.viralScene.addModel(this.mainModel);
|
|
@@ -35,30 +35,27 @@ class ViralViewerWorker4 {
|
|
|
35
35
|
polygonOffsetUnits: 0.1,
|
|
36
36
|
});
|
|
37
37
|
this.viralViewerApi.viralScene.materials.add(index, renderMaterial);
|
|
38
|
+
this.materialGroup.push(renderMaterial.toJSON());
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
loadElement(elements, callbackOnSuccess = () => { }) {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
let toWorker = new types_1.ToWorker();
|
|
43
|
+
toWorker.Elements = elements;
|
|
44
|
+
toWorker.Materials = this.materialGroup;
|
|
45
|
+
this.workerPool.Enqueue(toWorker, (data) => {
|
|
43
46
|
let dummyMesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
catch (error) { }
|
|
57
|
-
}
|
|
58
|
-
if (!((_b = element.userData) === null || _b === void 0 ? void 0 : _b.IsInstancedMesh)) {
|
|
59
|
-
element.userData.type = "Revit Element";
|
|
60
|
-
}
|
|
61
|
-
}
|
|
47
|
+
// for (let j = 0; j < dummyMesh.children.length; j++) {
|
|
48
|
+
// const element = dummyMesh.children[j];
|
|
49
|
+
// for (let index = 0; index < element.children.length; index++) {
|
|
50
|
+
// const object: any = element.children[index];
|
|
51
|
+
// object.material = this.viralViewerApi.viralScene.materials.get(
|
|
52
|
+
// object.userData.MaterialId
|
|
53
|
+
// )!;
|
|
54
|
+
// try {
|
|
55
|
+
// this.viralViewerApi.viralBVH.applyThreeMeshBVH(object.geometry);
|
|
56
|
+
// } catch (error) {}
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
62
59
|
if (this.mainModel)
|
|
63
60
|
this.mainModel.add(dummyMesh);
|
|
64
61
|
this.viralViewerApi.viralRenderer.render();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-4.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-4.worker.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"viral-viewer-4.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-4.worker.ts"],"names":[],"mappings":";;;AACA,uCAQqB;AACrB,iCASe;AACf,4FAAyE;AACzE,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAI7B,YACS,cAA8B,EACrC,YAAoB,gDAAgD;QAD7D,mBAAc,GAAd,cAAc,CAAgB;QAHhC,cAAS,GAAgB,IAAI,CAAC;QAC9B,kBAAa,GAAS,EAAE,CAAC;QAK9B,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,uCAAU,KAAK,CAAC,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AAC,MAAM,EAAE,CAAC,CAAC;SAClD;IACH,CAAC;IACM,WAAW,CAChB,QAA6B,EAC7B,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC;QAE5B,IAAI,QAAQ,GAAG,IAAI,gBAAQ,EAAE,CAAC;QAC9B,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC7B,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC;QAExC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAgB,QAAQ,EAAE,CAAC,IAAS,EAAE,EAAE;YAC7D,IAAI,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC9E,wDAAwD;YACxD,2CAA2C;YAC3C,oEAAoE;YACpE,mDAAmD;YACnD,sEAAsE;YACtE,mCAAmC;YACnC,UAAU;YAEV,YAAY;YACZ,yEAAyE;YACzE,yBAAyB;YACzB,MAAM;YACN,IAAI;YACJ,IAAI,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC3C,iBAAiB,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvED,gDAuEC"}
|
|
@@ -13536,8 +13536,10 @@ function workerFunction() {
|
|
|
13536
13536
|
instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
|
|
13537
13537
|
supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
|
|
13538
13538
|
outputColorSpace: currentRenderTarget === null ?
|
|
13539
|
-
renderer.outputColorSpace :
|
|
13540
|
-
currentRenderTarget.
|
|
13539
|
+
renderer.outputColorSpace :
|
|
13540
|
+
currentRenderTarget.isXRRenderTarget === true ?
|
|
13541
|
+
currentRenderTarget.texture.colorSpace :
|
|
13542
|
+
LinearSRGBColorSpace,
|
|
13541
13543
|
map: HAS_MAP,
|
|
13542
13544
|
matcap: HAS_MATCAP,
|
|
13543
13545
|
envMap: HAS_ENVMAP,
|
|
@@ -14645,7 +14647,9 @@ function workerFunction() {
|
|
|
14645
14647
|
}
|
|
14646
14648
|
}
|
|
14647
14649
|
if (shadow.map === null || toVSM === true || fromVSM === true) {
|
|
14648
|
-
const pars = this.type !== VSMShadowMap ?
|
|
14650
|
+
const pars = this.type !== VSMShadowMap ?
|
|
14651
|
+
{ minFilter: NearestFilter, magFilter: NearestFilter } :
|
|
14652
|
+
{};
|
|
14649
14653
|
if (shadow.map !== null) {
|
|
14650
14654
|
shadow.map.dispose();
|
|
14651
14655
|
}
|
|
@@ -16513,7 +16517,8 @@ function workerFunction() {
|
|
|
16513
16517
|
}
|
|
16514
16518
|
else {
|
|
16515
16519
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16516
|
-
renderTarget.texture :
|
|
16520
|
+
renderTarget.texture :
|
|
16521
|
+
[renderTarget.texture];
|
|
16517
16522
|
for (let i = 0; i < textures.length; i++) {
|
|
16518
16523
|
const texture = textures[i];
|
|
16519
16524
|
const glFormat = utils.convert(texture.format, texture.colorSpace);
|
|
@@ -16736,7 +16741,8 @@ function workerFunction() {
|
|
|
16736
16741
|
function updateRenderTargetMipmap(renderTarget) {
|
|
16737
16742
|
const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;
|
|
16738
16743
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16739
|
-
renderTarget.texture :
|
|
16744
|
+
renderTarget.texture :
|
|
16745
|
+
[renderTarget.texture];
|
|
16740
16746
|
for (let i = 0, il = textures.length; i < il; i++) {
|
|
16741
16747
|
const texture = textures[i];
|
|
16742
16748
|
if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
|
|
@@ -16755,7 +16761,8 @@ function workerFunction() {
|
|
|
16755
16761
|
renderTarget.samples > 0 &&
|
|
16756
16762
|
useMultisampledRTT(renderTarget) === false) {
|
|
16757
16763
|
const textures = renderTarget.isWebGLMultipleRenderTargets ?
|
|
16758
|
-
renderTarget.texture :
|
|
16764
|
+
renderTarget.texture :
|
|
16765
|
+
[renderTarget.texture];
|
|
16759
16766
|
const width = renderTarget.width;
|
|
16760
16767
|
const height = renderTarget.height;
|
|
16761
16768
|
let mask = _gl.COLOR_BUFFER_BIT;
|
|
@@ -17564,7 +17571,8 @@ function workerFunction() {
|
|
|
17564
17571
|
renderer.capabilities.isWebGL2 === false) {
|
|
17565
17572
|
const layerInit = {
|
|
17566
17573
|
antialias: session.renderState.layers === undefined ?
|
|
17567
|
-
attributes.antialias :
|
|
17574
|
+
attributes.antialias :
|
|
17575
|
+
true,
|
|
17568
17576
|
alpha: true,
|
|
17569
17577
|
depth: attributes.depth,
|
|
17570
17578
|
stencil: attributes.stencil,
|
|
@@ -18295,7 +18303,8 @@ function workerFunction() {
|
|
|
18295
18303
|
if (hasUniformChanged(uniform, i, cache) === true) {
|
|
18296
18304
|
const offset = uniform.__offset;
|
|
18297
18305
|
const values = Array.isArray(uniform.value) ?
|
|
18298
|
-
uniform.value :
|
|
18306
|
+
uniform.value :
|
|
18307
|
+
[uniform.value];
|
|
18299
18308
|
let arrayOffset = 0;
|
|
18300
18309
|
for (let i = 0; i < values.length; i++) {
|
|
18301
18310
|
const value = values[i];
|
|
@@ -18356,7 +18365,8 @@ function workerFunction() {
|
|
|
18356
18365
|
}
|
|
18357
18366
|
else {
|
|
18358
18367
|
const cachedObjects = Array.isArray(cache[index]) ?
|
|
18359
|
-
cache[index] :
|
|
18368
|
+
cache[index] :
|
|
18369
|
+
[cache[index]];
|
|
18360
18370
|
const values = Array.isArray(value) ? value : [value];
|
|
18361
18371
|
for (let i = 0; i < cachedObjects.length; i++) {
|
|
18362
18372
|
const cachedObject = cachedObjects[i];
|
|
@@ -18383,7 +18393,8 @@ function workerFunction() {
|
|
|
18383
18393
|
storage: 0, // bytes
|
|
18384
18394
|
};
|
|
18385
18395
|
const values = Array.isArray(uniform.value) ?
|
|
18386
|
-
uniform.value :
|
|
18396
|
+
uniform.value :
|
|
18397
|
+
[uniform.value];
|
|
18387
18398
|
for (let j = 0, jl = values.length; j < jl; j++) {
|
|
18388
18399
|
const value = values[j];
|
|
18389
18400
|
const info = getUniformSize(value);
|
|
@@ -19219,7 +19230,8 @@ function workerFunction() {
|
|
|
19219
19230
|
_transmissionRenderTarget = new WebGLRenderTarget(1024, 1024, {
|
|
19220
19231
|
generateMipmaps: true,
|
|
19221
19232
|
type: extensions.has("EXT_color_buffer_half_float") ?
|
|
19222
|
-
HalfFloatType :
|
|
19233
|
+
HalfFloatType :
|
|
19234
|
+
UnsignedByteType,
|
|
19223
19235
|
minFilter: LinearMipmapLinearFilter,
|
|
19224
19236
|
samples: isWebGL2 && antialias === true ? 4 : 0,
|
|
19225
19237
|
});
|
|
@@ -34060,9 +34072,19 @@ which can be placed in CurveUtils.
|
|
|
34060
34072
|
return result;
|
|
34061
34073
|
}
|
|
34062
34074
|
self.addEventListener("message", (event) => {
|
|
34075
|
+
let rawElements = event.data.Elements;
|
|
34076
|
+
let materialJsons = event.data.Materials;
|
|
34077
|
+
//get materials first
|
|
34078
|
+
let materials = [];
|
|
34079
|
+
let objectLoader = new ObjectLoader();
|
|
34080
|
+
for (let index = 0; index < materialJsons.length; index++) {
|
|
34081
|
+
const json = materialJsons[index];
|
|
34082
|
+
let material = objectLoader.parseObject(json);
|
|
34083
|
+
materials.push(material);
|
|
34084
|
+
}
|
|
34063
34085
|
let mainMesh = new Mesh();
|
|
34064
|
-
for (let k = 0; k <
|
|
34065
|
-
const data =
|
|
34086
|
+
for (let k = 0; k < rawElements.length; k++) {
|
|
34087
|
+
const data = rawElements[k];
|
|
34066
34088
|
//1 element may have multiple solids
|
|
34067
34089
|
const solids = progressGeometries(data);
|
|
34068
34090
|
if (data.Instances && data.Instances.length > 0) {
|
|
@@ -34092,10 +34114,12 @@ which can be placed in CurveUtils.
|
|
|
34092
34114
|
instancedMesh.setMatrixAt(j, matrix4);
|
|
34093
34115
|
}
|
|
34094
34116
|
instancedMesh.userData.MaterialId = solid.userData.MaterialId;
|
|
34117
|
+
instancedMesh.material = materials[solid.userData.MaterialId];
|
|
34095
34118
|
instancedMesh.updateMatrix();
|
|
34096
34119
|
group.add(instancedMesh);
|
|
34097
34120
|
}
|
|
34098
34121
|
group.userData.IsInstancedMesh = true;
|
|
34122
|
+
group.userData.type = 0;
|
|
34099
34123
|
group.updateMatrix();
|
|
34100
34124
|
mainMesh.add(group);
|
|
34101
34125
|
// let jsonData = group.toJSON();
|
|
@@ -34105,9 +34129,11 @@ which can be placed in CurveUtils.
|
|
|
34105
34129
|
//recreate element by combine solids
|
|
34106
34130
|
const mesh = new Mesh();
|
|
34107
34131
|
for (let index = 0; index < solids.length; index++) {
|
|
34108
|
-
const
|
|
34109
|
-
|
|
34132
|
+
const solid = solids[index];
|
|
34133
|
+
solid.material = materials[solid.userData.MaterialId];
|
|
34134
|
+
mesh.add(solid);
|
|
34110
34135
|
}
|
|
34136
|
+
mesh.userData.type = 0;
|
|
34111
34137
|
mainMesh.add(mesh);
|
|
34112
34138
|
// let jsonData = mesh.toJSON();
|
|
34113
34139
|
// self.postMessage(jsonData);
|