three-cad-viewer 1.8.4 → 1.8.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.
@@ -56211,11 +56211,12 @@ class TreeView {
56211
56211
  var walk = (obj) => {
56212
56212
  if (obj.type == "node") {
56213
56213
  if (
56214
- ((mode == 1 || mode == 3) &&
56215
- (obj.children.length === 1 || mode == 3) &&
56216
- obj !== this.tree &&
56217
- obj.children[0].type === "leaf") ||
56218
- mode == 2
56214
+ mode === 2 ||
56215
+ (obj !== this.tree &&
56216
+ (mode === 3 ||
56217
+ (mode == 1 &&
56218
+ obj.children.length === 1 &&
56219
+ obj.children[0].type === "leaf")))
56219
56220
  ) {
56220
56221
  var el = this.container.getElementsByClassName(
56221
56222
  `node${obj.id.replaceAll(" ", "_")}`,
@@ -58727,7 +58728,7 @@ class Camera {
58727
58728
  }
58728
58729
  }
58729
58730
 
58730
- const version="1.8.4";
58731
+ const version="1.8.6";
58731
58732
 
58732
58733
  class Viewer {
58733
58734
  /**
@@ -59501,8 +59502,8 @@ class Viewer {
59501
59502
 
59502
59503
  const theme =
59503
59504
  this.theme === "dark" ||
59504
- (this.theme === "browser" &&
59505
- window.matchMedia("(prefers-color-scheme: dark)").matches)
59505
+ (this.theme === "browser" &&
59506
+ window.matchMedia("(prefers-color-scheme: dark)").matches)
59506
59507
  ? "dark"
59507
59508
  : "light";
59508
59509
 
@@ -59618,6 +59619,7 @@ class Viewer {
59618
59619
  * @param {boolean} [notify=true] - whether to send notification or not.
59619
59620
  */
59620
59621
  presetCamera = (dir, zoom = null, notify = true) => {
59622
+ this.camera.target = new Vector3(...this.bbox.center());
59621
59623
  this.camera.presetCamera(dir, zoom, notify);
59622
59624
  this.controls.setTarget(this.camera.target);
59623
59625
  this.update(true, notify);
@@ -60726,6 +60728,14 @@ class Viewer {
60726
60728
  // update the this
60727
60729
  this.update(true);
60728
60730
  }
60731
+
60732
+ vector3(x = 0, y = 0, z = 0) {
60733
+ return new Vector3(x, y, z);
60734
+ }
60735
+
60736
+ quaternion(x = 0, y = 0, z = 0, w = 1) {
60737
+ return new Quaternion(x, y, z, w);
60738
+ }
60729
60739
  }
60730
60740
 
60731
60741
  export { Display, Timer, Viewer };