viral-viewer-2 3.9.3 → 3.9.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.
@@ -44,9 +44,6 @@ class ViralViewerWorker3 {
44
44
  mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
45
45
  this.viralViewerApi.viralBVH.applyThreeMeshBVH(mesh.geometry);
46
46
  mesh.userData.type = "Revit Element";
47
- const edges = new three_1.EdgesGeometry(mesh.geometry, 90);
48
- const line = new three_1.LineSegments(edges, new three_1.LineBasicMaterial({ color: "#202020", linewidth: 0.5 }));
49
- mesh.add(line);
50
47
  if (this.mainModel)
51
48
  this.mainModel.add(mesh);
52
49
  this.viralViewerApi.viralRenderer.render();
@@ -59,9 +56,6 @@ class ViralViewerWorker3 {
59
56
  mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
60
57
  this.viralViewerApi.viralBVH.applyThreeMeshBVH(mesh.geometry);
61
58
  mesh.userData.type = "Revit Element";
62
- const edges = new three_1.EdgesGeometry(mesh.geometry, 90);
63
- const line = new three_1.LineSegments(edges, new three_1.LineBasicMaterial({ color: "#202020", linewidth: 0.5 }));
64
- mesh.add(line);
65
59
  if (this.mainModel)
66
60
  this.mainModel.add(mesh);
67
61
  this.viralViewerApi.viralRenderer.render();
@@ -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,iCAOe;AACf,kEAA4D;AAC5D,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAI7B,YACS,cAA8B,EACrC,YAAoB,gDAAgD;QAD7D,mBAAc,GAAd,cAAc,CAAgB;QAHhC,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAKnC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,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AAU,CAAC,SAAS,CAAC,GAAG,CAC1D,KAAK,CAAC,aAAa,CACnB,CAAC;YACH,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9D,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;AAvFD,gDAuFC"}
@@ -34088,29 +34088,23 @@ which can be placed in CurveUtils.
34088
34088
  matrix4.fromArray(numbers);
34089
34089
  childMesh.setMatrixAt(index, matrix4);
34090
34090
  //if number of polygon smaller than expect, generate edges
34091
- // if (geometry.attributes.position.count <= maxPolygonForEdge) {
34092
- // const edges = new EdgesGeometry(geometry, 10);
34093
- // const positions = edges.attributes.position.array;
34094
- // const indices = [];
34095
- // for (let i = 0; i < positions.length / 3; i += 2) {
34096
- // indices.push(i, i + 1);
34097
- // }
34098
- // const bufferGeometry = new BufferGeometry();
34099
- // // Set the position attribute
34100
- // bufferGeometry.setAttribute(
34101
- // "position",
34102
- // new BufferAttribute(new Float32Array(positions), 3)
34103
- // );
34104
- // // Set the index attribute
34105
- // bufferGeometry.setIndex(indices);
34106
- // const line = new LineSegments(
34107
- // bufferGeometry,
34108
- // new LineBasicMaterial({ color: "#666", linewidth: 1 })
34109
- // );
34110
- // line.applyMatrix4(matrix4);
34111
- // line.updateMatrix();
34112
- // childMesh.add(line);
34113
- // }
34091
+ if (geometry.attributes.position.count <= maxPolygonForEdge) {
34092
+ const edges = new EdgesGeometry(geometry, 90);
34093
+ const positions = edges.attributes.position.array;
34094
+ const indices = [];
34095
+ for (let i = 0; i < positions.length / 3; i += 2) {
34096
+ indices.push(i, i + 1);
34097
+ }
34098
+ const bufferGeometry = new BufferGeometry();
34099
+ // Set the position attribute
34100
+ bufferGeometry.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
34101
+ // Set the index attribute
34102
+ bufferGeometry.setIndex(indices);
34103
+ const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#000", linewidth: 1 }));
34104
+ line.applyMatrix4(matrix4);
34105
+ line.updateMatrix();
34106
+ childMesh.add(line);
34107
+ }
34114
34108
  }
34115
34109
  // childMesh.instanceMatrix.needsUpdate = true;
34116
34110
  childMesh.updateMatrix();
@@ -34131,26 +34125,20 @@ which can be placed in CurveUtils.
34131
34125
  // }
34132
34126
  geometry = mergeVertices(dummyGeometry);
34133
34127
  geometry.computeVertexNormals();
34134
- // const edges = new EdgesGeometry(geometry, 10);
34135
- // const positions = edges.attributes.position.array;
34136
- // const indices = [];
34137
- // for (let i = 0; i < positions.length / 3; i += 2) {
34138
- // indices.push(i, i + 1);
34139
- // }
34140
- // const bufferGeometry = new BufferGeometry();
34141
- // // Set the position attribute
34142
- // bufferGeometry.setAttribute(
34143
- // "position",
34144
- // new BufferAttribute(new Float32Array(positions), 3)
34145
- // );
34146
- // // Set the index attribute
34147
- // bufferGeometry.setIndex(indices);
34148
- // const line = new LineSegments(
34149
- // bufferGeometry,
34150
- // new LineBasicMaterial({ color: "#202020", linewidth: 1 })
34151
- // );
34128
+ const edges = new EdgesGeometry(geometry, 90);
34129
+ const positions = edges.attributes.position.array;
34130
+ const indices = [];
34131
+ for (let i = 0; i < positions.length / 3; i += 2) {
34132
+ indices.push(i, i + 1);
34133
+ }
34134
+ const bufferGeometry = new BufferGeometry();
34135
+ // Set the position attribute
34136
+ bufferGeometry.setAttribute("position", new BufferAttribute(new Float32Array(positions), 3));
34137
+ // Set the index attribute
34138
+ bufferGeometry.setIndex(indices);
34139
+ const line = new LineSegments(bufferGeometry, new LineBasicMaterial({ color: "#000", linewidth: 1 }));
34152
34140
  const childMesh = new Mesh(geometry);
34153
- // childMesh.add(line);
34141
+ childMesh.add(line);
34154
34142
  childMesh.castShadow = true;
34155
34143
  childMesh.receiveShadow = true;
34156
34144
  let jsonData = childMesh.toJSON();