@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 +25 -28
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +25 -28
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +1 -1
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 = "
|
|
17617
|
-
input.step = "
|
|
17618
|
-
input.value = this._radius
|
|
17616
|
+
input.min = "1";
|
|
17617
|
+
input.step = "1";
|
|
17618
|
+
input.value = String(this._radius);
|
|
17619
17619
|
input.style.cssText = `
|
|
17620
|
-
width:
|
|
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(
|
|
17628
|
-
input.value = v
|
|
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 =
|
|
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 = "
|
|
17706
|
-
input.step = "
|
|
17707
|
-
input.value =
|
|
17705
|
+
input.min = "1";
|
|
17706
|
+
input.step = "1";
|
|
17707
|
+
input.value = String(Math.round(initial));
|
|
17708
17708
|
input.style.cssText = `
|
|
17709
|
-
width:
|
|
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(
|
|
17717
|
-
input.value = v
|
|
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 =
|
|
17764
|
-
this.inputY.value =
|
|
17765
|
-
this.inputZ.value =
|
|
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
|
|
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.
|
|
18197
|
-
this.volumeRenderer.setVolume("box",
|
|
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 =
|
|
18200
|
-
this.
|
|
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 {
|