@xeokit/xeokit-sdk 2.6.32 → 2.6.34
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/xeokit-sdk.cjs.js +86 -25
- package/dist/xeokit-sdk.es.js +86 -25
- package/dist/xeokit-sdk.es5.js +33 -12
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/extras/PointerLens/PointerLens.js +14 -6
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +59 -9
- package/src/viewer/scene/math/MeshVolume.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/VBOInstancingLinesLayer.js +3 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/VBOInstancingTrianglesLayer.js +9 -7
- package/types/extras/ContextMenu/ContextMenu.d.ts +2 -0
- package/types/extras/PointerLens/PointerLens.d.ts +47 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +18 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +12 -0
- package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +4 -0
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +7 -7
- package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +19 -0
- package/types/viewer/scene/scene/Scene.d.ts +23 -0
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -1038,20 +1038,23 @@ class PointerLens {
|
|
|
1038
1038
|
this._lensCursorDiv.style.pointerEvents = "none";
|
|
1039
1039
|
|
|
1040
1040
|
this._lensContainer = document.createElement('div');
|
|
1041
|
+
this._lensContainerId = cfg.containerId || 'xeokit-lens';
|
|
1042
|
+
this._lensContainer.setAttribute("id", this._lensContainerId);
|
|
1043
|
+
|
|
1041
1044
|
this._lensContainer.style.border = "1px solid black";
|
|
1042
1045
|
this._lensContainer.style.background = "white";
|
|
1043
1046
|
// this._lensContainer.style.opacity = "0";
|
|
1044
1047
|
this._lensContainer.style.borderRadius = "50%";
|
|
1045
1048
|
this._lensContainer.style.width = "300px";
|
|
1046
1049
|
this._lensContainer.style.height = "300px";
|
|
1047
|
-
|
|
1048
|
-
this._lensContainer.style.marginLeft = "25px";
|
|
1050
|
+
|
|
1049
1051
|
this._lensContainer.style.zIndex = "15000";
|
|
1050
1052
|
this._lensContainer.style.position = "absolute";
|
|
1051
1053
|
this._lensContainer.style.pointerEvents = "none";
|
|
1052
1054
|
this._lensContainer.style.visibility = "hidden";
|
|
1053
1055
|
|
|
1054
1056
|
this._lensCanvas = document.createElement('canvas');
|
|
1057
|
+
this._lensCanvas.id = `${this._lensContainerId}-canvas`;
|
|
1055
1058
|
// this._lensCanvas.style.background = "darkblue";
|
|
1056
1059
|
this._lensCanvas.style.borderRadius = "50%";
|
|
1057
1060
|
|
|
@@ -1068,7 +1071,12 @@ class PointerLens {
|
|
|
1068
1071
|
|
|
1069
1072
|
this._canvasPos = null;
|
|
1070
1073
|
this._snappedCanvasPos = null;
|
|
1071
|
-
this._lensPosToggle = true;
|
|
1074
|
+
this._lensPosToggle = cfg.lensPosToggle || true;
|
|
1075
|
+
this._lensPosToggleAmount = cfg.lensPosToggleAmount || 85;
|
|
1076
|
+
this._lensPosMarginLeft = cfg.lensPosMarginLeft || 85;
|
|
1077
|
+
this._lensPosMarginTop = cfg.lensPosMarginTop || 25;
|
|
1078
|
+
this._lensContainer.style.marginTop = `${this._lensPosMarginTop}px`;
|
|
1079
|
+
this._lensContainer.style.marginLeft = `${this._lensPosMarginLeft}px`;
|
|
1072
1080
|
|
|
1073
1081
|
this._zoomLevel = cfg.zoomLevel || 2;
|
|
1074
1082
|
|
|
@@ -1098,12 +1106,12 @@ class PointerLens {
|
|
|
1098
1106
|
const pointerOnLens =
|
|
1099
1107
|
this._canvasPos[0] < lensRect.right && this._canvasPos[0] > lensRect.left &&
|
|
1100
1108
|
this._canvasPos[1] < lensRect.bottom && this._canvasPos[1] > lensRect.top;
|
|
1101
|
-
|
|
1109
|
+
this._lensContainer.style.marginLeft = `${this._lensPosMarginLeft}px`;
|
|
1102
1110
|
if (pointerOnLens) {
|
|
1103
1111
|
if (this._lensPosToggle) {
|
|
1104
|
-
this._lensContainer.style.marginTop = `${canvasRect.bottom - canvasRect.top - this._lensCanvas.height -
|
|
1112
|
+
this._lensContainer.style.marginTop = `${canvasRect.bottom - canvasRect.top - this._lensCanvas.height - this._lensPosToggleAmount}px`;
|
|
1105
1113
|
} else {
|
|
1106
|
-
this._lensContainer.style.marginTop =
|
|
1114
|
+
this._lensContainer.style.marginTop = `${this._lensPosMarginTop}px`;
|
|
1107
1115
|
}
|
|
1108
1116
|
this._lensPosToggle = !this._lensPosToggle;
|
|
1109
1117
|
}
|
|
@@ -50864,7 +50872,7 @@ class MeshVolume {
|
|
|
50864
50872
|
volume += math.dotVec3(v1$1, v3$1);
|
|
50865
50873
|
}
|
|
50866
50874
|
|
|
50867
|
-
return volume;
|
|
50875
|
+
return volume / 6;
|
|
50868
50876
|
}
|
|
50869
50877
|
}
|
|
50870
50878
|
|
|
@@ -61388,7 +61396,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
61388
61396
|
*/
|
|
61389
61397
|
constructor(cfg) {
|
|
61390
61398
|
|
|
61391
|
-
|
|
61399
|
+
// console.info("Creating VBOInstancingTrianglesLayer");
|
|
61392
61400
|
|
|
61393
61401
|
/**
|
|
61394
61402
|
* Owner model
|
|
@@ -61730,7 +61738,9 @@ class VBOInstancingTrianglesLayer {
|
|
|
61730
61738
|
&& !!textureSet
|
|
61731
61739
|
&& !!textureSet.colorTexture;
|
|
61732
61740
|
|
|
61733
|
-
this.
|
|
61741
|
+
if (!this.model.scene.readableGeometryEnabled) {
|
|
61742
|
+
this._state.geometry = null;
|
|
61743
|
+
}
|
|
61734
61744
|
|
|
61735
61745
|
this._finalized = true;
|
|
61736
61746
|
}
|
|
@@ -62057,11 +62067,11 @@ class VBOInstancingTrianglesLayer {
|
|
|
62057
62067
|
this.model.error("portion not found: " + portionId);
|
|
62058
62068
|
return;
|
|
62059
62069
|
}
|
|
62060
|
-
const positions = geometry.
|
|
62070
|
+
const positions = geometry.positionsCompressed;
|
|
62061
62071
|
const origin = state.origin;
|
|
62062
|
-
const offsetX = origin[0]
|
|
62063
|
-
const offsetY = origin[1]
|
|
62064
|
-
const offsetZ = origin[2]
|
|
62072
|
+
const offsetX = origin[0];
|
|
62073
|
+
const offsetY = origin[1];
|
|
62074
|
+
const offsetZ = origin[2];
|
|
62065
62075
|
const worldPos = tempVec4a$7;
|
|
62066
62076
|
const portionMatrix = portion.matrix;
|
|
62067
62077
|
const sceneModelMatrix = this.model.matrix;
|
|
@@ -62137,7 +62147,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
62137
62147
|
return;
|
|
62138
62148
|
}
|
|
62139
62149
|
this._updateBackfaceCull(renderFlags, frameCtx);
|
|
62140
|
-
const useAlphaCutoff = this._state.textureSet && (typeof(this._state.textureSet.alphaCutoff) === "number");
|
|
62150
|
+
const useAlphaCutoff = this._state.textureSet && (typeof (this._state.textureSet.alphaCutoff) === "number");
|
|
62141
62151
|
if (frameCtx.withSAO && this.model.saoEnabled) {
|
|
62142
62152
|
if (frameCtx.pbrEnabled && this.model.pbrEnabled && this._state.pbrSupported) {
|
|
62143
62153
|
if (this._renderers.pbrRendererWithSAO) {
|
|
@@ -65557,7 +65567,9 @@ class VBOInstancingLinesLayer {
|
|
|
65557
65567
|
this._modelMatrixCol1 = [];
|
|
65558
65568
|
this._modelMatrixCol2 = [];
|
|
65559
65569
|
}
|
|
65560
|
-
this.
|
|
65570
|
+
if (!this.model.scene.readableGeometryEnabled) {
|
|
65571
|
+
this._state.geometry = null;
|
|
65572
|
+
}
|
|
65561
65573
|
this._finalized = true;
|
|
65562
65574
|
}
|
|
65563
65575
|
|
|
@@ -87793,6 +87805,7 @@ function colorizeToRGB(color) {
|
|
|
87793
87805
|
}
|
|
87794
87806
|
|
|
87795
87807
|
const distVec3 = math.vec3();
|
|
87808
|
+
const tmpVec3 = math.vec3();
|
|
87796
87809
|
|
|
87797
87810
|
const lengthWire = (x1, y1, x2, y2) => {
|
|
87798
87811
|
var a = x1 - x2;
|
|
@@ -88103,6 +88116,44 @@ class DistanceMeasurement extends Component {
|
|
|
88103
88116
|
this.labelsVisible = cfg.labelsVisible;
|
|
88104
88117
|
this.labelsOnWires = cfg.labelsOnWires;
|
|
88105
88118
|
this.useRotationAdjustment = cfg.useRotationAdjustment;
|
|
88119
|
+
|
|
88120
|
+
/**
|
|
88121
|
+
* @type {number[]}
|
|
88122
|
+
*/
|
|
88123
|
+
this._axesBasis = [
|
|
88124
|
+
1, 0, 0, 0,
|
|
88125
|
+
0, 1, 0, 0,
|
|
88126
|
+
0, 0, 1, 0,
|
|
88127
|
+
0, 0, 0, 1,
|
|
88128
|
+
];
|
|
88129
|
+
}
|
|
88130
|
+
|
|
88131
|
+
/**
|
|
88132
|
+
* Sets the axes basis for the measurement.
|
|
88133
|
+
*
|
|
88134
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
88135
|
+
*
|
|
88136
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
88137
|
+
*
|
|
88138
|
+
* @param {number[]} value
|
|
88139
|
+
*/
|
|
88140
|
+
set axesBasis(value) {
|
|
88141
|
+
this._axesBasis = value.slice();
|
|
88142
|
+
this._wpDirty = true;
|
|
88143
|
+
this._needUpdate(0); // No lag
|
|
88144
|
+
}
|
|
88145
|
+
|
|
88146
|
+
/**
|
|
88147
|
+
* Gets the axes basis for the measurement.
|
|
88148
|
+
*
|
|
88149
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
88150
|
+
*
|
|
88151
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
88152
|
+
*
|
|
88153
|
+
* @type {number[]}
|
|
88154
|
+
*/
|
|
88155
|
+
get axesBasis() {
|
|
88156
|
+
return this._axesBasis;
|
|
88106
88157
|
}
|
|
88107
88158
|
|
|
88108
88159
|
_update() {
|
|
@@ -88138,20 +88189,30 @@ class DistanceMeasurement extends Component {
|
|
|
88138
88189
|
this._wp[15] = 1.0;
|
|
88139
88190
|
}
|
|
88140
88191
|
else {
|
|
88192
|
+
const delta = math.subVec3(
|
|
88193
|
+
this._targetWorld,
|
|
88194
|
+
this._originWorld,
|
|
88195
|
+
tmpVec3
|
|
88196
|
+
);
|
|
88197
|
+
|
|
88198
|
+
/**
|
|
88199
|
+
* The length detected for each measurement axis.
|
|
88200
|
+
*/
|
|
88201
|
+
this._factors = math.transformVec3(this._axesBasis, delta);
|
|
88202
|
+
|
|
88141
88203
|
this._wp[0] = this._originWorld[0];
|
|
88142
88204
|
this._wp[1] = this._originWorld[1];
|
|
88143
88205
|
this._wp[2] = this._originWorld[2];
|
|
88144
88206
|
this._wp[3] = 1.0;
|
|
88145
88207
|
|
|
88146
|
-
this._wp[4] = this.
|
|
88147
|
-
this._wp[5] = this._originWorld[1];
|
|
88148
|
-
this._wp[6] = this._originWorld[2];
|
|
88208
|
+
this._wp[4] = this._originWorld[0] + this._axesBasis[0]*this._factors[0];
|
|
88209
|
+
this._wp[5] = this._originWorld[1] + this._axesBasis[4]*this._factors[0];
|
|
88210
|
+
this._wp[6] = this._originWorld[2] + this._axesBasis[8]*this._factors[0];
|
|
88149
88211
|
this._wp[7] = 1.0;
|
|
88150
88212
|
|
|
88151
|
-
this._wp[8] = this.
|
|
88152
|
-
this._wp[9] = this.
|
|
88153
|
-
this._wp[10] = this._originWorld[2];
|
|
88154
|
-
this._wp[11] = 1.0;
|
|
88213
|
+
this._wp[8] = this._originWorld[0] + this._axesBasis[0]*this._factors[0]+ this._axesBasis[1]*this._factors[1];
|
|
88214
|
+
this._wp[9] = this._originWorld[1] + this._axesBasis[4]*this._factors[0]+ this._axesBasis[5]*this._factors[1];
|
|
88215
|
+
this._wp[10] = this._originWorld[2] + this._axesBasis[8]*this._factors[0]+ this._axesBasis[9]*this._factors[1]; this._wp[11] = 1.0;
|
|
88155
88216
|
|
|
88156
88217
|
this._wp[12] = this._targetWorld[0];
|
|
88157
88218
|
this._wp[13] = this._targetWorld[1];
|
|
@@ -88312,14 +88373,14 @@ class DistanceMeasurement extends Component {
|
|
|
88312
88373
|
}
|
|
88313
88374
|
|
|
88314
88375
|
if (!this._xAxisLabelCulled) {
|
|
88315
|
-
this._xAxisLabel.setText(tilde + Math.abs(
|
|
88376
|
+
this._xAxisLabel.setText(tilde + Math.abs(this._factors[0] * scale).toFixed(2) + unitAbbrev);
|
|
88316
88377
|
this._xAxisLabel.setCulled(!this.axisVisible);
|
|
88317
88378
|
} else {
|
|
88318
88379
|
this._xAxisLabel.setCulled(true);
|
|
88319
88380
|
}
|
|
88320
88381
|
|
|
88321
88382
|
if (!this._yAxisLabelCulled) {
|
|
88322
|
-
this._yAxisLabel.setText(tilde + Math.abs(
|
|
88383
|
+
this._yAxisLabel.setText(tilde + Math.abs(this._factors[1] * scale).toFixed(2) + unitAbbrev);
|
|
88323
88384
|
this._yAxisLabel.setCulled(!this.axisVisible);
|
|
88324
88385
|
} else {
|
|
88325
88386
|
this._yAxisLabel.setCulled(true);
|
|
@@ -88332,7 +88393,7 @@ class DistanceMeasurement extends Component {
|
|
|
88332
88393
|
}
|
|
88333
88394
|
else {
|
|
88334
88395
|
this._zAxisLabel.setPrefix("Z");
|
|
88335
|
-
this._zAxisLabel.setText(tilde + Math.abs(
|
|
88396
|
+
this._zAxisLabel.setText(tilde + Math.abs(this._factors[2] * scale).toFixed(2) + unitAbbrev);
|
|
88336
88397
|
}
|
|
88337
88398
|
this._zAxisLabel.setCulled(!this.axisVisible);
|
|
88338
88399
|
} else {
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -1034,20 +1034,23 @@ class PointerLens {
|
|
|
1034
1034
|
this._lensCursorDiv.style.pointerEvents = "none";
|
|
1035
1035
|
|
|
1036
1036
|
this._lensContainer = document.createElement('div');
|
|
1037
|
+
this._lensContainerId = cfg.containerId || 'xeokit-lens';
|
|
1038
|
+
this._lensContainer.setAttribute("id", this._lensContainerId);
|
|
1039
|
+
|
|
1037
1040
|
this._lensContainer.style.border = "1px solid black";
|
|
1038
1041
|
this._lensContainer.style.background = "white";
|
|
1039
1042
|
// this._lensContainer.style.opacity = "0";
|
|
1040
1043
|
this._lensContainer.style.borderRadius = "50%";
|
|
1041
1044
|
this._lensContainer.style.width = "300px";
|
|
1042
1045
|
this._lensContainer.style.height = "300px";
|
|
1043
|
-
|
|
1044
|
-
this._lensContainer.style.marginLeft = "25px";
|
|
1046
|
+
|
|
1045
1047
|
this._lensContainer.style.zIndex = "15000";
|
|
1046
1048
|
this._lensContainer.style.position = "absolute";
|
|
1047
1049
|
this._lensContainer.style.pointerEvents = "none";
|
|
1048
1050
|
this._lensContainer.style.visibility = "hidden";
|
|
1049
1051
|
|
|
1050
1052
|
this._lensCanvas = document.createElement('canvas');
|
|
1053
|
+
this._lensCanvas.id = `${this._lensContainerId}-canvas`;
|
|
1051
1054
|
// this._lensCanvas.style.background = "darkblue";
|
|
1052
1055
|
this._lensCanvas.style.borderRadius = "50%";
|
|
1053
1056
|
|
|
@@ -1064,7 +1067,12 @@ class PointerLens {
|
|
|
1064
1067
|
|
|
1065
1068
|
this._canvasPos = null;
|
|
1066
1069
|
this._snappedCanvasPos = null;
|
|
1067
|
-
this._lensPosToggle = true;
|
|
1070
|
+
this._lensPosToggle = cfg.lensPosToggle || true;
|
|
1071
|
+
this._lensPosToggleAmount = cfg.lensPosToggleAmount || 85;
|
|
1072
|
+
this._lensPosMarginLeft = cfg.lensPosMarginLeft || 85;
|
|
1073
|
+
this._lensPosMarginTop = cfg.lensPosMarginTop || 25;
|
|
1074
|
+
this._lensContainer.style.marginTop = `${this._lensPosMarginTop}px`;
|
|
1075
|
+
this._lensContainer.style.marginLeft = `${this._lensPosMarginLeft}px`;
|
|
1068
1076
|
|
|
1069
1077
|
this._zoomLevel = cfg.zoomLevel || 2;
|
|
1070
1078
|
|
|
@@ -1094,12 +1102,12 @@ class PointerLens {
|
|
|
1094
1102
|
const pointerOnLens =
|
|
1095
1103
|
this._canvasPos[0] < lensRect.right && this._canvasPos[0] > lensRect.left &&
|
|
1096
1104
|
this._canvasPos[1] < lensRect.bottom && this._canvasPos[1] > lensRect.top;
|
|
1097
|
-
|
|
1105
|
+
this._lensContainer.style.marginLeft = `${this._lensPosMarginLeft}px`;
|
|
1098
1106
|
if (pointerOnLens) {
|
|
1099
1107
|
if (this._lensPosToggle) {
|
|
1100
|
-
this._lensContainer.style.marginTop = `${canvasRect.bottom - canvasRect.top - this._lensCanvas.height -
|
|
1108
|
+
this._lensContainer.style.marginTop = `${canvasRect.bottom - canvasRect.top - this._lensCanvas.height - this._lensPosToggleAmount}px`;
|
|
1101
1109
|
} else {
|
|
1102
|
-
this._lensContainer.style.marginTop =
|
|
1110
|
+
this._lensContainer.style.marginTop = `${this._lensPosMarginTop}px`;
|
|
1103
1111
|
}
|
|
1104
1112
|
this._lensPosToggle = !this._lensPosToggle;
|
|
1105
1113
|
}
|
|
@@ -50860,7 +50868,7 @@ class MeshVolume {
|
|
|
50860
50868
|
volume += math.dotVec3(v1$1, v3$1);
|
|
50861
50869
|
}
|
|
50862
50870
|
|
|
50863
|
-
return volume;
|
|
50871
|
+
return volume / 6;
|
|
50864
50872
|
}
|
|
50865
50873
|
}
|
|
50866
50874
|
|
|
@@ -61384,7 +61392,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
61384
61392
|
*/
|
|
61385
61393
|
constructor(cfg) {
|
|
61386
61394
|
|
|
61387
|
-
|
|
61395
|
+
// console.info("Creating VBOInstancingTrianglesLayer");
|
|
61388
61396
|
|
|
61389
61397
|
/**
|
|
61390
61398
|
* Owner model
|
|
@@ -61726,7 +61734,9 @@ class VBOInstancingTrianglesLayer {
|
|
|
61726
61734
|
&& !!textureSet
|
|
61727
61735
|
&& !!textureSet.colorTexture;
|
|
61728
61736
|
|
|
61729
|
-
this.
|
|
61737
|
+
if (!this.model.scene.readableGeometryEnabled) {
|
|
61738
|
+
this._state.geometry = null;
|
|
61739
|
+
}
|
|
61730
61740
|
|
|
61731
61741
|
this._finalized = true;
|
|
61732
61742
|
}
|
|
@@ -62053,11 +62063,11 @@ class VBOInstancingTrianglesLayer {
|
|
|
62053
62063
|
this.model.error("portion not found: " + portionId);
|
|
62054
62064
|
return;
|
|
62055
62065
|
}
|
|
62056
|
-
const positions = geometry.
|
|
62066
|
+
const positions = geometry.positionsCompressed;
|
|
62057
62067
|
const origin = state.origin;
|
|
62058
|
-
const offsetX = origin[0]
|
|
62059
|
-
const offsetY = origin[1]
|
|
62060
|
-
const offsetZ = origin[2]
|
|
62068
|
+
const offsetX = origin[0];
|
|
62069
|
+
const offsetY = origin[1];
|
|
62070
|
+
const offsetZ = origin[2];
|
|
62061
62071
|
const worldPos = tempVec4a$7;
|
|
62062
62072
|
const portionMatrix = portion.matrix;
|
|
62063
62073
|
const sceneModelMatrix = this.model.matrix;
|
|
@@ -62133,7 +62143,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
62133
62143
|
return;
|
|
62134
62144
|
}
|
|
62135
62145
|
this._updateBackfaceCull(renderFlags, frameCtx);
|
|
62136
|
-
const useAlphaCutoff = this._state.textureSet && (typeof(this._state.textureSet.alphaCutoff) === "number");
|
|
62146
|
+
const useAlphaCutoff = this._state.textureSet && (typeof (this._state.textureSet.alphaCutoff) === "number");
|
|
62137
62147
|
if (frameCtx.withSAO && this.model.saoEnabled) {
|
|
62138
62148
|
if (frameCtx.pbrEnabled && this.model.pbrEnabled && this._state.pbrSupported) {
|
|
62139
62149
|
if (this._renderers.pbrRendererWithSAO) {
|
|
@@ -65553,7 +65563,9 @@ class VBOInstancingLinesLayer {
|
|
|
65553
65563
|
this._modelMatrixCol1 = [];
|
|
65554
65564
|
this._modelMatrixCol2 = [];
|
|
65555
65565
|
}
|
|
65556
|
-
this.
|
|
65566
|
+
if (!this.model.scene.readableGeometryEnabled) {
|
|
65567
|
+
this._state.geometry = null;
|
|
65568
|
+
}
|
|
65557
65569
|
this._finalized = true;
|
|
65558
65570
|
}
|
|
65559
65571
|
|
|
@@ -87789,6 +87801,7 @@ function colorizeToRGB(color) {
|
|
|
87789
87801
|
}
|
|
87790
87802
|
|
|
87791
87803
|
const distVec3 = math.vec3();
|
|
87804
|
+
const tmpVec3 = math.vec3();
|
|
87792
87805
|
|
|
87793
87806
|
const lengthWire = (x1, y1, x2, y2) => {
|
|
87794
87807
|
var a = x1 - x2;
|
|
@@ -88099,6 +88112,44 @@ class DistanceMeasurement extends Component {
|
|
|
88099
88112
|
this.labelsVisible = cfg.labelsVisible;
|
|
88100
88113
|
this.labelsOnWires = cfg.labelsOnWires;
|
|
88101
88114
|
this.useRotationAdjustment = cfg.useRotationAdjustment;
|
|
88115
|
+
|
|
88116
|
+
/**
|
|
88117
|
+
* @type {number[]}
|
|
88118
|
+
*/
|
|
88119
|
+
this._axesBasis = [
|
|
88120
|
+
1, 0, 0, 0,
|
|
88121
|
+
0, 1, 0, 0,
|
|
88122
|
+
0, 0, 1, 0,
|
|
88123
|
+
0, 0, 0, 1,
|
|
88124
|
+
];
|
|
88125
|
+
}
|
|
88126
|
+
|
|
88127
|
+
/**
|
|
88128
|
+
* Sets the axes basis for the measurement.
|
|
88129
|
+
*
|
|
88130
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
88131
|
+
*
|
|
88132
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
88133
|
+
*
|
|
88134
|
+
* @param {number[]} value
|
|
88135
|
+
*/
|
|
88136
|
+
set axesBasis(value) {
|
|
88137
|
+
this._axesBasis = value.slice();
|
|
88138
|
+
this._wpDirty = true;
|
|
88139
|
+
this._needUpdate(0); // No lag
|
|
88140
|
+
}
|
|
88141
|
+
|
|
88142
|
+
/**
|
|
88143
|
+
* Gets the axes basis for the measurement.
|
|
88144
|
+
*
|
|
88145
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
88146
|
+
*
|
|
88147
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
88148
|
+
*
|
|
88149
|
+
* @type {number[]}
|
|
88150
|
+
*/
|
|
88151
|
+
get axesBasis() {
|
|
88152
|
+
return this._axesBasis;
|
|
88102
88153
|
}
|
|
88103
88154
|
|
|
88104
88155
|
_update() {
|
|
@@ -88134,20 +88185,30 @@ class DistanceMeasurement extends Component {
|
|
|
88134
88185
|
this._wp[15] = 1.0;
|
|
88135
88186
|
}
|
|
88136
88187
|
else {
|
|
88188
|
+
const delta = math.subVec3(
|
|
88189
|
+
this._targetWorld,
|
|
88190
|
+
this._originWorld,
|
|
88191
|
+
tmpVec3
|
|
88192
|
+
);
|
|
88193
|
+
|
|
88194
|
+
/**
|
|
88195
|
+
* The length detected for each measurement axis.
|
|
88196
|
+
*/
|
|
88197
|
+
this._factors = math.transformVec3(this._axesBasis, delta);
|
|
88198
|
+
|
|
88137
88199
|
this._wp[0] = this._originWorld[0];
|
|
88138
88200
|
this._wp[1] = this._originWorld[1];
|
|
88139
88201
|
this._wp[2] = this._originWorld[2];
|
|
88140
88202
|
this._wp[3] = 1.0;
|
|
88141
88203
|
|
|
88142
|
-
this._wp[4] = this.
|
|
88143
|
-
this._wp[5] = this._originWorld[1];
|
|
88144
|
-
this._wp[6] = this._originWorld[2];
|
|
88204
|
+
this._wp[4] = this._originWorld[0] + this._axesBasis[0]*this._factors[0];
|
|
88205
|
+
this._wp[5] = this._originWorld[1] + this._axesBasis[4]*this._factors[0];
|
|
88206
|
+
this._wp[6] = this._originWorld[2] + this._axesBasis[8]*this._factors[0];
|
|
88145
88207
|
this._wp[7] = 1.0;
|
|
88146
88208
|
|
|
88147
|
-
this._wp[8] = this.
|
|
88148
|
-
this._wp[9] = this.
|
|
88149
|
-
this._wp[10] = this._originWorld[2];
|
|
88150
|
-
this._wp[11] = 1.0;
|
|
88209
|
+
this._wp[8] = this._originWorld[0] + this._axesBasis[0]*this._factors[0]+ this._axesBasis[1]*this._factors[1];
|
|
88210
|
+
this._wp[9] = this._originWorld[1] + this._axesBasis[4]*this._factors[0]+ this._axesBasis[5]*this._factors[1];
|
|
88211
|
+
this._wp[10] = this._originWorld[2] + this._axesBasis[8]*this._factors[0]+ this._axesBasis[9]*this._factors[1]; this._wp[11] = 1.0;
|
|
88151
88212
|
|
|
88152
88213
|
this._wp[12] = this._targetWorld[0];
|
|
88153
88214
|
this._wp[13] = this._targetWorld[1];
|
|
@@ -88308,14 +88369,14 @@ class DistanceMeasurement extends Component {
|
|
|
88308
88369
|
}
|
|
88309
88370
|
|
|
88310
88371
|
if (!this._xAxisLabelCulled) {
|
|
88311
|
-
this._xAxisLabel.setText(tilde + Math.abs(
|
|
88372
|
+
this._xAxisLabel.setText(tilde + Math.abs(this._factors[0] * scale).toFixed(2) + unitAbbrev);
|
|
88312
88373
|
this._xAxisLabel.setCulled(!this.axisVisible);
|
|
88313
88374
|
} else {
|
|
88314
88375
|
this._xAxisLabel.setCulled(true);
|
|
88315
88376
|
}
|
|
88316
88377
|
|
|
88317
88378
|
if (!this._yAxisLabelCulled) {
|
|
88318
|
-
this._yAxisLabel.setText(tilde + Math.abs(
|
|
88379
|
+
this._yAxisLabel.setText(tilde + Math.abs(this._factors[1] * scale).toFixed(2) + unitAbbrev);
|
|
88319
88380
|
this._yAxisLabel.setCulled(!this.axisVisible);
|
|
88320
88381
|
} else {
|
|
88321
88382
|
this._yAxisLabel.setCulled(true);
|
|
@@ -88328,7 +88389,7 @@ class DistanceMeasurement extends Component {
|
|
|
88328
88389
|
}
|
|
88329
88390
|
else {
|
|
88330
88391
|
this._zAxisLabel.setPrefix("Z");
|
|
88331
|
-
this._zAxisLabel.setText(tilde + Math.abs(
|
|
88392
|
+
this._zAxisLabel.setText(tilde + Math.abs(this._factors[2] * scale).toFixed(2) + unitAbbrev);
|
|
88332
88393
|
}
|
|
88333
88394
|
this._zAxisLabel.setCulled(!this.axisVisible);
|
|
88334
88395
|
} else {
|