viral-viewer-2 3.6.2 → 3.6.4
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.
|
@@ -51,30 +51,15 @@ class ViralViewerWorker3 {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
loadNoneStructuralGeometry(model, callbackOnSuccess = () => { }) {
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
mesh.userData.type = "Revit Element";
|
|
63
|
-
if (this.mainModel)
|
|
64
|
-
this.mainModel.add(mesh);
|
|
65
|
-
this.viralViewerApi.viralRenderer.render();
|
|
66
|
-
callbackOnSuccess();
|
|
67
|
-
});
|
|
54
|
+
this.workerPool.Enqueue(model, (data) => {
|
|
55
|
+
let mesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
56
|
+
mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
|
|
57
|
+
mesh.userData.type = "Revit Element";
|
|
58
|
+
if (this.mainModel)
|
|
59
|
+
this.mainModel.add(mesh);
|
|
60
|
+
this.viralViewerApi.viralRenderer.render();
|
|
61
|
+
callbackOnSuccess();
|
|
68
62
|
});
|
|
69
|
-
// this.workerPool.Enqueue<ViralViewerRevitNoneStructuralGeometry, any>(model, (data: any) => {
|
|
70
|
-
// let mesh: InstancedMesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data) as InstancedMesh;
|
|
71
|
-
// mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex)!;
|
|
72
|
-
// mesh.userData.type = "Revit Element";
|
|
73
|
-
// if (this.mainModel)
|
|
74
|
-
// this.mainModel.add(mesh);
|
|
75
|
-
// this.viralViewerApi.viralRenderer.render();
|
|
76
|
-
// callbackOnSuccess();
|
|
77
|
-
// })
|
|
78
63
|
}
|
|
79
64
|
}
|
|
80
65
|
exports.ViralViewerWorker3 = ViralViewerWorker3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-3.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-3.worker.ts"],"names":[],"mappings":";;;AACA,uCAMqB;AACrB,iCAae;AACf,kEAA4D;AAC5D,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAK7B,YACS,cAA8B,EACrC,YAAoB,gDAAgD;QAD7D,mBAAc,GAAd,cAAc,CAAgB;QAJhC,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC7B,kBAAa,GAAG,IAAI,oBAAY,EAAE,CAAC;QAKzC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,0BAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,oCAAoC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAgB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD,CAAC;IACM,OAAO,CAAC,SAA2B;QACxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,WAAW,GAAG,IAAA,2BAAiB,EACjC,QAAQ,CAAC,GAAG,EACZ,QAAQ,CAAC,KAAK,EACd,QAAQ,CAAC,IAAI,CACd,CAAC;Y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AC7C,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,OAAO,CACrB,KAAK,EACL,CAAC,IAAS,EAAE,EAAE;YACZ,IAAI,IAAI,GACN,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CACrD,IAAI,CACY,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAC1D,KAAK,CAAC,aAAa,CACnB,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,eAAe,CAAC;YACrC,IAAI,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC3C,iBAAiB,EAAE,CAAC;QACtB,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlFD,gDAkFC"}
|
|
@@ -13536,10 +13536,8 @@ 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.
|
|
13541
|
-
currentRenderTarget.texture.colorSpace :
|
|
13542
|
-
LinearSRGBColorSpace,
|
|
13539
|
+
renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ?
|
|
13540
|
+
currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace,
|
|
13543
13541
|
map: HAS_MAP,
|
|
13544
13542
|
matcap: HAS_MATCAP,
|
|
13545
13543
|
envMap: HAS_ENVMAP,
|
|
@@ -14647,9 +14645,7 @@ function workerFunction() {
|
|
|
14647
14645
|
}
|
|
14648
14646
|
}
|
|
14649
14647
|
if (shadow.map === null || toVSM === true || fromVSM === true) {
|
|
14650
|
-
const pars = this.type !== VSMShadowMap ?
|
|
14651
|
-
{ minFilter: NearestFilter, magFilter: NearestFilter } :
|
|
14652
|
-
{};
|
|
14648
|
+
const pars = this.type !== VSMShadowMap ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};
|
|
14653
14649
|
if (shadow.map !== null) {
|
|
14654
14650
|
shadow.map.dispose();
|
|
14655
14651
|
}
|
|
@@ -16516,8 +16512,7 @@ function workerFunction() {
|
|
|
16516
16512
|
}
|
|
16517
16513
|
else {
|
|
16518
16514
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16519
|
-
renderTarget.texture :
|
|
16520
|
-
[renderTarget.texture];
|
|
16515
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16521
16516
|
for (let i = 0; i < textures.length; i++) {
|
|
16522
16517
|
const texture = textures[i];
|
|
16523
16518
|
const glFormat = utils.convert(texture.format, texture.colorSpace);
|
|
@@ -16740,8 +16735,7 @@ function workerFunction() {
|
|
|
16740
16735
|
function updateRenderTargetMipmap(renderTarget) {
|
|
16741
16736
|
const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;
|
|
16742
16737
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16743
|
-
renderTarget.texture :
|
|
16744
|
-
[renderTarget.texture];
|
|
16738
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16745
16739
|
for (let i = 0, il = textures.length; i < il; i++) {
|
|
16746
16740
|
const texture = textures[i];
|
|
16747
16741
|
if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
|
|
@@ -16760,8 +16754,7 @@ function workerFunction() {
|
|
|
16760
16754
|
renderTarget.samples > 0 &&
|
|
16761
16755
|
useMultisampledRTT(renderTarget) === false) {
|
|
16762
16756
|
const textures = renderTarget.isWebGLMultipleRenderTargets ?
|
|
16763
|
-
renderTarget.texture :
|
|
16764
|
-
[renderTarget.texture];
|
|
16757
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16765
16758
|
const width = renderTarget.width;
|
|
16766
16759
|
const height = renderTarget.height;
|
|
16767
16760
|
let mask = _gl.COLOR_BUFFER_BIT;
|
|
@@ -17570,8 +17563,7 @@ function workerFunction() {
|
|
|
17570
17563
|
renderer.capabilities.isWebGL2 === false) {
|
|
17571
17564
|
const layerInit = {
|
|
17572
17565
|
antialias: session.renderState.layers === undefined ?
|
|
17573
|
-
attributes.antialias :
|
|
17574
|
-
true,
|
|
17566
|
+
attributes.antialias : true,
|
|
17575
17567
|
alpha: true,
|
|
17576
17568
|
depth: attributes.depth,
|
|
17577
17569
|
stencil: attributes.stencil,
|
|
@@ -18302,8 +18294,7 @@ function workerFunction() {
|
|
|
18302
18294
|
if (hasUniformChanged(uniform, i, cache) === true) {
|
|
18303
18295
|
const offset = uniform.__offset;
|
|
18304
18296
|
const values = Array.isArray(uniform.value) ?
|
|
18305
|
-
uniform.value :
|
|
18306
|
-
[uniform.value];
|
|
18297
|
+
uniform.value : [uniform.value];
|
|
18307
18298
|
let arrayOffset = 0;
|
|
18308
18299
|
for (let i = 0; i < values.length; i++) {
|
|
18309
18300
|
const value = values[i];
|
|
@@ -18364,8 +18355,7 @@ function workerFunction() {
|
|
|
18364
18355
|
}
|
|
18365
18356
|
else {
|
|
18366
18357
|
const cachedObjects = Array.isArray(cache[index]) ?
|
|
18367
|
-
cache[index] :
|
|
18368
|
-
[cache[index]];
|
|
18358
|
+
cache[index] : [cache[index]];
|
|
18369
18359
|
const values = Array.isArray(value) ? value : [value];
|
|
18370
18360
|
for (let i = 0; i < cachedObjects.length; i++) {
|
|
18371
18361
|
const cachedObject = cachedObjects[i];
|
|
@@ -18392,8 +18382,7 @@ function workerFunction() {
|
|
|
18392
18382
|
storage: 0, // bytes
|
|
18393
18383
|
};
|
|
18394
18384
|
const values = Array.isArray(uniform.value) ?
|
|
18395
|
-
uniform.value :
|
|
18396
|
-
[uniform.value];
|
|
18385
|
+
uniform.value : [uniform.value];
|
|
18397
18386
|
for (let j = 0, jl = values.length; j < jl; j++) {
|
|
18398
18387
|
const value = values[j];
|
|
18399
18388
|
const info = getUniformSize(value);
|
|
@@ -19229,8 +19218,7 @@ function workerFunction() {
|
|
|
19229
19218
|
_transmissionRenderTarget = new WebGLRenderTarget(1024, 1024, {
|
|
19230
19219
|
generateMipmaps: true,
|
|
19231
19220
|
type: extensions.has("EXT_color_buffer_half_float") ?
|
|
19232
|
-
HalfFloatType :
|
|
19233
|
-
UnsignedByteType,
|
|
19221
|
+
HalfFloatType : UnsignedByteType,
|
|
19234
19222
|
minFilter: LinearMipmapLinearFilter,
|
|
19235
19223
|
samples: isWebGL2 && antialias === true ? 4 : 0,
|
|
19236
19224
|
});
|
|
@@ -34120,8 +34108,17 @@ which can be placed in CurveUtils.
|
|
|
34120
34108
|
self.postMessage(jsonData);
|
|
34121
34109
|
}
|
|
34122
34110
|
else {
|
|
34123
|
-
|
|
34124
|
-
|
|
34111
|
+
let geometry = new BufferGeometry();
|
|
34112
|
+
if (dummyGeometry.attributes.position.count > maxPolygonPerObject) {
|
|
34113
|
+
let modifier = new SimplifyModifier();
|
|
34114
|
+
geometry = modifier.modify(dummyGeometry, maxPolygonPerObject);
|
|
34115
|
+
console.log(dummyGeometry.attributes.position.count, geometry.attributes.position.count);
|
|
34116
|
+
}
|
|
34117
|
+
else {
|
|
34118
|
+
geometry = dummyGeometry;
|
|
34119
|
+
}
|
|
34120
|
+
geometry.computeVertexNormals();
|
|
34121
|
+
const edges = new EdgesGeometry(geometry, 15);
|
|
34125
34122
|
const positions = edges.attributes.position.array;
|
|
34126
34123
|
const indices = [];
|
|
34127
34124
|
for (let i = 0; i < positions.length / 3; i += 2) {
|
|
@@ -34133,7 +34130,7 @@ which can be placed in CurveUtils.
|
|
|
34133
34130
|
// Set the index attribute
|
|
34134
34131
|
bufferGeometry.setIndex(indices);
|
|
34135
34132
|
const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#202020", linewidth: 0.5 }));
|
|
34136
|
-
const childMesh = new Mesh(
|
|
34133
|
+
const childMesh = new Mesh(geometry);
|
|
34137
34134
|
childMesh.add(line);
|
|
34138
34135
|
childMesh.castShadow = true;
|
|
34139
34136
|
childMesh.receiveShadow = true;
|