@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.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 = "
|
|
17619
|
-
input.step = "
|
|
17620
|
-
input.value = this._radius
|
|
17618
|
+
input.min = "1";
|
|
17619
|
+
input.step = "1";
|
|
17620
|
+
input.value = String(this._radius);
|
|
17621
17621
|
input.style.cssText = `
|
|
17622
|
-
width:
|
|
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(
|
|
17630
|
-
input.value = v
|
|
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 =
|
|
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 = "
|
|
17708
|
-
input.step = "
|
|
17709
|
-
input.value =
|
|
17707
|
+
input.min = "1";
|
|
17708
|
+
input.step = "1";
|
|
17709
|
+
input.value = String(Math.round(initial));
|
|
17710
17710
|
input.style.cssText = `
|
|
17711
|
-
width:
|
|
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(
|
|
17719
|
-
input.value = v
|
|
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 =
|
|
17766
|
-
this.inputY.value =
|
|
17767
|
-
this.inputZ.value =
|
|
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
|
|
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.
|
|
18199
|
-
this.volumeRenderer.setVolume("box",
|
|
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 =
|
|
18202
|
-
this.
|
|
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 {
|