@inweb/viewer-visualize 25.11.2 → 25.11.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-visualize",
3
- "version": "25.11.2",
3
+ "version": "25.11.3",
4
4
  "description": "JavaScript library for rendering CAD and BIM files in a browser using VisualizeJS",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -29,10 +29,10 @@
29
29
  "docs": "typedoc"
30
30
  },
31
31
  "dependencies": {
32
- "@inweb/client": "~25.11.2",
33
- "@inweb/eventemitter2": "~25.11.2",
34
- "@inweb/markup": "~25.11.2",
35
- "@inweb/viewer-core": "~25.11.2"
32
+ "@inweb/client": "~25.11.3",
33
+ "@inweb/eventemitter2": "~25.11.3",
34
+ "@inweb/markup": "~25.11.3",
35
+ "@inweb/viewer-core": "~25.11.3"
36
36
  },
37
- "visualizeJS": "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/master/Visualize.js"
37
+ "visualizeJS": "https://public-fhemb7e3embacwec.z02.azurefd.net/libs/visualizejs/25.11/Visualize.js"
38
38
  }
@@ -454,17 +454,18 @@ export class Viewer
454
454
 
455
455
  const view = device.getActiveView();
456
456
 
457
- // setup light
458
457
  view.enableDefaultLighting(true, visLib.DefaultLightingType.kTwoLights);
459
458
  view.setDefaultLightingIntensity(1.25);
460
459
 
460
+ // Visualize.js 25.11 and earlier threw an exception if the style did not exist.
461
461
  let visualStyleId;
462
462
  try {
463
463
  visualStyleId = visViewer.findVisualStyle("OpenCloud");
464
- } catch (e) {
465
- // if (!isInitializing) {
466
- // console.log("OpenCloud visual style not found, creating it on client side");
467
- // }
464
+ } catch {
465
+ visualStyleId = undefined;
466
+ }
467
+
468
+ if (!visualStyleId || visualStyleId.isNull()) {
468
469
  visualStyleId = visViewer.createVisualStyle("OpenCloud");
469
470
 
470
471
  const colorDef = new visLib.OdTvColorDef(66, 66, 66);
@@ -473,7 +474,6 @@ export class Viewer
473
474
  const visualStylePtr = visualStyleId.openObject();
474
475
  visualStylePtr.copyFrom(shadedVsId);
475
476
  visualStylePtr.setOptionInt32(visLib.VisualStyleOptions.kFaceModifiers, 0, visLib.VisualStyleOperations.kSet);
476
- //visualStylePtr.setOptionInt32(visLib.VisualStyleOptions.kEdgeModel, 1, visLib.VisualStyleOperations.kSet);
477
477
  visualStylePtr.setOptionInt32(visLib.VisualStyleOptions.kEdgeModel, 2, visLib.VisualStyleOperations.kSet);
478
478
  visualStylePtr.setOptionDouble(visLib.VisualStyleOptions.kEdgeCreaseAngle, 60, visLib.VisualStyleOperations.kSet);
479
479
  visualStylePtr.setOptionInt32(visLib.VisualStyleOptions.kEdgeStyles, 0, visLib.VisualStyleOperations.kSet);