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