@d5techs/3dgs-lib 1.4.78 → 1.4.79

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/3dgs-lib.js CHANGED
@@ -17613,19 +17613,19 @@ class SphereSelection {
17613
17613
  inputWrap.style.cssText = "display:inline-flex; align-items:center; gap:2px;";
17614
17614
  const input = document.createElement("input");
17615
17615
  input.type = "number";
17616
- input.min = "0.01";
17617
- input.step = "0.1";
17618
- input.value = this._radius.toFixed(2);
17616
+ input.min = "1";
17617
+ input.step = "1";
17618
+ input.value = String(this._radius);
17619
17619
  input.style.cssText = `
17620
- width:50px; padding:3px 4px; border:1px solid #555; border-radius:4px;
17620
+ width:40px; padding:3px 4px; border:1px solid #555; border-radius:4px;
17621
17621
  background:#222; color:#ddd; font-size:12px; text-align:center;
17622
17622
  `;
17623
17623
  const label = document.createElement("span");
17624
17624
  label.textContent = "Radius";
17625
17625
  label.style.cssText = "color:#888; font-size:11px;";
17626
17626
  input.addEventListener("change", () => {
17627
- const v = Math.max(0.01, parseFloat(input.value) || 0.01);
17628
- input.value = v.toFixed(2);
17627
+ const v = Math.max(1, Math.round(parseFloat(input.value) || 1));
17628
+ input.value = String(v);
17629
17629
  this._radius = v;
17630
17630
  this.callbacks.onRadiusChanged(v);
17631
17631
  });
@@ -17642,8 +17642,8 @@ class SphereSelection {
17642
17642
  return this._radius;
17643
17643
  }
17644
17644
  setRadius(radius) {
17645
- this._radius = radius;
17646
- this.radiusInput.value = radius.toFixed(2);
17645
+ this._radius = Math.round(radius);
17646
+ this.radiusInput.value = String(this._radius);
17647
17647
  }
17648
17648
  activate() {
17649
17649
  this.toolbar.style.display = "flex";
@@ -17702,19 +17702,19 @@ class BoxSelection {
17702
17702
  wrap.style.cssText = "display:inline-flex; align-items:center; gap:2px;";
17703
17703
  const input = document.createElement("input");
17704
17704
  input.type = "number";
17705
- input.min = "0.01";
17706
- input.step = "0.1";
17707
- input.value = initial.toFixed(2);
17705
+ input.min = "1";
17706
+ input.step = "1";
17707
+ input.value = String(Math.round(initial));
17708
17708
  input.style.cssText = `
17709
- width:50px; padding:3px 4px; border:1px solid #555; border-radius:4px;
17709
+ width:40px; padding:3px 4px; border:1px solid #555; border-radius:4px;
17710
17710
  background:#222; color:#ddd; font-size:12px; text-align:center;
17711
17711
  `;
17712
17712
  const label = document.createElement("span");
17713
17713
  label.textContent = placeholder;
17714
17714
  label.style.cssText = "color:#888; font-size:11px;";
17715
17715
  input.addEventListener("change", () => {
17716
- const v = Math.max(0.01, parseFloat(input.value) || 0.01);
17717
- input.value = v.toFixed(2);
17716
+ const v = Math.max(1, Math.round(parseFloat(input.value) || 1));
17717
+ input.value = String(v);
17718
17718
  onChange(v);
17719
17719
  });
17720
17720
  wrap.appendChild(input);
@@ -17757,12 +17757,12 @@ class BoxSelection {
17757
17757
  return this._lenZ;
17758
17758
  }
17759
17759
  setDimensions(lenX, lenY, lenZ) {
17760
- this._lenX = lenX;
17761
- this._lenY = lenY;
17762
- this._lenZ = lenZ;
17763
- this.inputX.value = lenX.toFixed(2);
17764
- this.inputY.value = lenY.toFixed(2);
17765
- this.inputZ.value = lenZ.toFixed(2);
17760
+ this._lenX = Math.round(lenX);
17761
+ this._lenY = Math.round(lenY);
17762
+ this._lenZ = Math.round(lenZ);
17763
+ this.inputX.value = String(this._lenX);
17764
+ this.inputY.value = String(this._lenY);
17765
+ this.inputZ.value = String(this._lenZ);
17766
17766
  }
17767
17767
  activate() {
17768
17768
  this.toolbar.style.display = "flex";
@@ -18189,16 +18189,13 @@ class SplatEditor {
18189
18189
  this.toolOverlay.style.display = name && !isVolumeTool ? "block" : "none";
18190
18190
  if (isVolumeTool && this.volumeRenderer) {
18191
18191
  const volType = name;
18192
- const bounds = this.getModelBounds();
18193
- const defaultSize = Math.max(bounds.size[0], bounds.size[1], bounds.size[2]) * 0.3;
18194
- const safeSize = Math.max(defaultSize, 0.5);
18192
+ const center = this.getModelCenter();
18195
18193
  if (volType === "box") {
18196
- this.boxTool.setDimensions(safeSize, safeSize, safeSize);
18197
- this.volumeRenderer.setVolume("box", bounds.center, [safeSize, safeSize, safeSize]);
18194
+ const lx = this.boxTool.lenX, ly = this.boxTool.lenY, lz = this.boxTool.lenZ;
18195
+ this.volumeRenderer.setVolume("box", center, [lx, ly, lz]);
18198
18196
  } else {
18199
- const r = safeSize / 2;
18200
- this.sphereTool.setRadius(r);
18201
- this.volumeRenderer.setVolume("sphere", bounds.center, [r, 0, 0]);
18197
+ const r = this.sphereTool.radius;
18198
+ this.volumeRenderer.setVolume("sphere", center, [r, 0, 0]);
18202
18199
  }
18203
18200
  (_b2 = (_a2 = this.callbacks).onVolumeToolActivated) == null ? void 0 : _b2.call(_a2, this.volumeRenderer.volume);
18204
18201
  } else {