@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.16.7 → 3.16.9

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.
Files changed (95) hide show
  1. package/dist/api/implementation/AbstractRestrictionApi.d.ts +12 -12
  2. package/dist/api/implementation/AbstractRestrictionApi.js +46 -46
  3. package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
  4. package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +12 -12
  5. package/dist/api/implementation/AbstractSnapRestrictionApi.js +46 -46
  6. package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
  7. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +6 -6
  8. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js +23 -23
  9. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
  10. package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +14 -14
  11. package/dist/api/implementation/geometry/GeometryRestrictionApi.js +53 -53
  12. package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
  13. package/dist/api/implementation/line/LineRestrictionApi.d.ts +10 -10
  14. package/dist/api/implementation/line/LineRestrictionApi.js +39 -39
  15. package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
  16. package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +19 -19
  17. package/dist/api/implementation/plane/PlaneRestrictionApi.js +66 -66
  18. package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
  19. package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +9 -9
  20. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js +39 -39
  21. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
  22. package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +6 -6
  23. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js +23 -23
  24. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
  25. package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +9 -9
  26. package/dist/api/implementation/plane/snap/GridRestrictionApi.js +39 -39
  27. package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
  28. package/dist/api/implementation/point/PointRestrictionApi.d.ts +9 -9
  29. package/dist/api/implementation/point/PointRestrictionApi.js +36 -36
  30. package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
  31. package/dist/api/interfaces/IRestrictionApi.d.ts +10 -10
  32. package/dist/api/interfaces/IRestrictionApi.js +2 -2
  33. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +12 -12
  34. package/dist/api/interfaces/ISnapRestrictionApi.js +2 -2
  35. package/dist/implementation/EventManager.d.ts +25 -25
  36. package/dist/implementation/EventManager.d.ts.map +1 -1
  37. package/dist/implementation/EventManager.js +62 -62
  38. package/dist/implementation/EventManager.js.map +1 -1
  39. package/dist/implementation/GeometryMathManager.d.ts +87 -87
  40. package/dist/implementation/GeometryMathManager.js +260 -260
  41. package/dist/implementation/GeometryMathManager.js.map +1 -1
  42. package/dist/implementation/RestrictionManager.d.ts +28 -28
  43. package/dist/implementation/RestrictionManager.js +323 -323
  44. package/dist/implementation/RestrictionManager.js.map +1 -1
  45. package/dist/implementation/restrictions/AbstractRestriction.d.ts +42 -42
  46. package/dist/implementation/restrictions/AbstractRestriction.js +164 -154
  47. package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
  48. package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +35 -35
  49. package/dist/implementation/restrictions/AbstractSnapRestriction.js +150 -140
  50. package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
  51. package/dist/implementation/restrictions/RestrictionsHelper.d.ts +10 -10
  52. package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
  53. package/dist/implementation/restrictions/RestrictionsHelper.js +50 -50
  54. package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
  55. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +17 -17
  56. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +62 -62
  57. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
  58. package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +92 -92
  59. package/dist/implementation/restrictions/geometry/GeometryRestriction.js +410 -400
  60. package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
  61. package/dist/implementation/restrictions/line/LineRestriction.d.ts +58 -58
  62. package/dist/implementation/restrictions/line/LineRestriction.js +291 -281
  63. package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
  64. package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +65 -65
  65. package/dist/implementation/restrictions/plane/PlaneRestriction.js +306 -306
  66. package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
  67. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +39 -39
  68. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
  69. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +346 -346
  70. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
  71. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +27 -27
  72. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
  73. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +239 -229
  74. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
  75. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +39 -39
  76. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
  77. package/dist/implementation/restrictions/plane/snap/GridRestriction.js +318 -308
  78. package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
  79. package/dist/implementation/restrictions/point/PointRestriction.d.ts +45 -45
  80. package/dist/implementation/restrictions/point/PointRestriction.js +166 -156
  81. package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
  82. package/dist/index.d.ts +29 -29
  83. package/dist/index.js +37 -37
  84. package/dist/interfaces/IDragAnchor.d.ts +8 -8
  85. package/dist/interfaces/IDragAnchor.js +2 -2
  86. package/dist/interfaces/IRestriction.d.ts +117 -117
  87. package/dist/interfaces/IRestriction.d.ts.map +1 -1
  88. package/dist/interfaces/IRestriction.js +23 -23
  89. package/dist/interfaces/IRestriction.js.map +1 -1
  90. package/dist/interfaces/IRestrictionManager.d.ts +13 -13
  91. package/dist/interfaces/IRestrictionManager.js +2 -2
  92. package/dist/interfaces/ISnapRestriction.d.ts +81 -81
  93. package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
  94. package/dist/interfaces/ISnapRestriction.js +3 -3
  95. package/package.json +10 -10
@@ -1,261 +1,261 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _GeometryMathManager_localToWorldMatrix, _GeometryMathManager_settings, _GeometryMathManager_viewport;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.GeometryMathManager = void 0;
16
- const viewer_1 = require("@shapediver/viewer");
17
- const gl_matrix_1 = require("gl-matrix");
18
- class GeometryMathManager {
19
- // #endregion Properties (3)
20
- // #region Constructors (1)
21
- constructor(viewport, settings) {
22
- // #region Properties (3)
23
- _GeometryMathManager_localToWorldMatrix.set(this, gl_matrix_1.mat4.create());
24
- _GeometryMathManager_settings.set(this, void 0);
25
- _GeometryMathManager_viewport.set(this, void 0);
26
- __classPrivateFieldSet(this, _GeometryMathManager_viewport, viewport, "f");
27
- __classPrivateFieldSet(this, _GeometryMathManager_settings, settings, "f");
28
- }
29
- // #endregion Constructors (1)
30
- /**
31
- * Set the matrix that transforms local-space points to world space.
32
- * When set, screenSpaceDistanceCheck will transform points before projecting
33
- * via camera.project(), which expects world-space input.
34
- * Defaults to identity (local space = world space).
35
- */
36
- set localToWorldMatrix(m) {
37
- __classPrivateFieldSet(this, _GeometryMathManager_localToWorldMatrix, m, "f");
38
- }
39
- // #region Public Methods (9)
40
- /**
41
- * Check which distances of lines to ray
42
- *
43
- * @param ray
44
- * @returns
45
- */
46
- checkLineDistances(ray, positionArray, indicesArrayLines) {
47
- // if there are no line array indices, return
48
- if (!indicesArrayLines)
49
- return;
50
- /**
51
- * Calculate line distances to ray
52
- */
53
- const distances = [];
54
- for (let i = 0; i < indicesArrayLines.length; i += 2) {
55
- const firstIndex = indicesArrayLines.at(i);
56
- const secondIndex = indicesArrayLines.at(i + 1);
57
- const lineStart = gl_matrix_1.vec3.fromValues(positionArray.at(firstIndex * 3), positionArray.at(firstIndex * 3 + 1), positionArray.at(firstIndex * 3 + 2));
58
- const lineEnd = gl_matrix_1.vec3.fromValues(positionArray.at(secondIndex * 3), positionArray.at(secondIndex * 3 + 1), positionArray.at(secondIndex * 3 + 2));
59
- const { closestPointOnRay, closestPointOnLine } = this.closestPointsRayLine(ray, lineStart, lineEnd);
60
- if (this.screenSpaceDistanceCheck(closestPointOnRay, closestPointOnLine, __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").points.size_0 *
61
- __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").distanceMultiplicationFactor).check === false)
62
- continue;
63
- distances.push({
64
- index: [firstIndex, secondIndex],
65
- distance: gl_matrix_1.vec3.distance(closestPointOnRay, closestPointOnLine),
66
- });
67
- }
68
- // if there are no distances, return
69
- if (distances.length === 0)
70
- return;
71
- return distances.sort((a, b) => a.distance - b.distance);
72
- }
73
- /**
74
- * Check which distances of points to ray
75
- *
76
- * @param ray
77
- * @returns
78
- */
79
- checkPointDistances(ray, positionArray) {
80
- /**
81
- * Calculate point distances to ray
82
- */
83
- const distances = [];
84
- for (let i = 0; i < positionArray.length; i += 3) {
85
- const point = gl_matrix_1.vec3.fromValues(positionArray.at(i), positionArray.at(i + 1), positionArray.at(i + 2));
86
- // distance from point to ray
87
- const closestPoint = this.closestPoint(ray, point);
88
- if (this.screenSpaceDistanceCheck(point, closestPoint, __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").points.size_0 *
89
- __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").distanceMultiplicationFactor).check === false)
90
- continue;
91
- distances.push({
92
- index: i / 3,
93
- distance: gl_matrix_1.vec3.distance(point, closestPoint),
94
- });
95
- }
96
- // if there are no distances, return
97
- if (distances.length === 0)
98
- return;
99
- // sort distances
100
- return distances.sort((a, b) => a.distance - b.distance);
101
- }
102
- close() { }
103
- /**
104
- * Calculate the closest point on a ray to a point
105
- *
106
- * @param ray
107
- * @param point
108
- * @returns
109
- */
110
- closestPoint(ray, point) {
111
- // distance from point to ray
112
- const dot = gl_matrix_1.vec3.dot(ray.direction, gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, ray.origin));
113
- // closest point on ray to point
114
- return gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray.origin, gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), ray.direction, gl_matrix_1.vec3.fromValues(dot, dot, dot)));
115
- }
116
- /**
117
- * Calculate the closest point on a line to a point
118
- *
119
- * @param start
120
- * @param end
121
- * @param point
122
- */
123
- closestPointOnLine(start, end, point) {
124
- const lineDir = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), end, start);
125
- // Vector from linePoint to point
126
- const v = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, start);
127
- // Line direction dot product with itself
128
- const dirDotDir = gl_matrix_1.vec3.dot(lineDir, lineDir);
129
- // If the direction vector is a zero vector, return the line point as closest point
130
- if (dirDotDir === 0)
131
- return start;
132
- // Projection factor t
133
- const t = gl_matrix_1.vec3.dot(v, lineDir) / dirDotDir;
134
- // Closest point on the line
135
- const closestPoint = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), start, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDir, t));
136
- return closestPoint;
137
- }
138
- /**
139
- * Calculate the closest point on a plane to a point
140
- *
141
- * @param point
142
- * @param planeNormal
143
- * @param planeOrigin
144
- * @returns
145
- */
146
- closestPointOnPlane(planeOrigin, planeNormal, point) {
147
- // Calculate the vector from the plane origin to the point
148
- const toPoint = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, planeOrigin);
149
- // Project the vector onto the plane normal
150
- const projectionLength = gl_matrix_1.vec3.dot(toPoint, planeNormal);
151
- const projectionVector = gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), planeNormal, projectionLength);
152
- // Subtract the projection vector from the original point to get the projected point
153
- return gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, projectionVector);
154
- }
155
- /**
156
- * Calculate the distance between a ray and a line segment
157
- *
158
- * @param ray
159
- * @param lineStart
160
- * @param lineEnd
161
- * @returns
162
- */
163
- closestPointsRayLine(ray, lineStart, lineEnd) {
164
- // direction of line
165
- const lineDirection = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), lineEnd, lineStart));
166
- // cross product of ray direction and line direction
167
- const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), ray.direction, lineDirection);
168
- // length of cross product
169
- const crossProductLength = gl_matrix_1.vec3.length(crossProduct);
170
- if (crossProductLength < 0.0001) {
171
- // ray and line are parallel, calculate the distance differently
172
- const closestPointOnRay = ray.origin;
173
- const closestPointOnLine = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), lineStart, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDirection, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), ray.origin, lineStart), lineDirection)));
174
- return {
175
- closestPointOnRay,
176
- closestPointOnLine,
177
- };
178
- }
179
- const t = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), lineStart, ray.origin);
180
- const u = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, lineDirection);
181
- const v = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray.direction);
182
- const tValue = gl_matrix_1.vec3.dot(u, crossProduct) / Math.pow(crossProductLength, 2);
183
- const uValue = gl_matrix_1.vec3.dot(v, crossProduct) / Math.pow(crossProductLength, 2);
184
- const closestPointOnRay = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray.direction, tValue));
185
- // restrict the closest point on line to the line segment
186
- let closestPointOnLine;
187
- if (uValue < 0) {
188
- closestPointOnLine = lineStart;
189
- }
190
- else if (uValue > gl_matrix_1.vec3.distance(lineStart, lineEnd)) {
191
- closestPointOnLine = lineEnd;
192
- }
193
- else {
194
- closestPointOnLine = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), lineStart, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDirection, uValue));
195
- }
196
- return {
197
- closestPointOnRay,
198
- closestPointOnLine,
199
- };
200
- }
201
- /**
202
- * Calculate the distance between two rays
203
- *
204
- * @param ray1
205
- * @param ray2
206
- * @returns
207
- */
208
- closestPointsRayRay(ray1, ray2) {
209
- // cross product of ray1 direction and ray2 direction
210
- const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), ray1.direction, ray2.direction);
211
- // length of cross product
212
- const crossProductLength = gl_matrix_1.vec3.length(crossProduct);
213
- if (crossProductLength < 0.0001) {
214
- // ray1 and ray2 are parallel, calculate the distance differently
215
- const closestPointOnRay1 = ray1.origin;
216
- const closestPointOnRay2 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray2.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray2.direction, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), ray1.origin, ray2.origin), ray2.direction)));
217
- return {
218
- closestPointOnRay1,
219
- closestPointOnRay2,
220
- };
221
- }
222
- const t = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), ray2.origin, ray1.origin);
223
- const u = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray2.direction);
224
- const v = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray1.direction);
225
- const tValue = gl_matrix_1.vec3.dot(u, crossProduct) / Math.pow(crossProductLength, 2);
226
- const uValue = gl_matrix_1.vec3.dot(v, crossProduct) / Math.pow(crossProductLength, 2);
227
- const closestPointOnRay1 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray1.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray1.direction, tValue));
228
- const closestPointOnRay2 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray2.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray2.direction, uValue));
229
- return {
230
- closestPointOnRay1,
231
- closestPointOnRay2,
232
- };
233
- }
234
- screenSpaceDistanceCheck(point1, point2, threshold) {
235
- const camera = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").camera;
236
- // Transform local-space points to world space before projection.
237
- // camera.project() expects world-space input.
238
- const ws1 = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point1, __classPrivateFieldGet(this, _GeometryMathManager_localToWorldMatrix, "f"));
239
- const ws2 = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point2, __classPrivateFieldGet(this, _GeometryMathManager_localToWorldMatrix, "f"));
240
- // Project points to NDC
241
- const screenPos1 = camera.project(ws1);
242
- const screenPos2 = camera.project(ws2);
243
- const width = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").canvas.width;
244
- const height = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").canvas.height;
245
- const x1 = screenPos1[0] * (width / 2) + width / 2;
246
- const y1 = -(screenPos1[1] * (height / 2) + height / 2);
247
- const x2 = screenPos2[0] * (width / 2) + width / 2;
248
- const y2 = -(screenPos2[1] * (height / 2) + height / 2);
249
- const distanceSquared = Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2);
250
- const thresholdValue = viewer_1.SystemInfo.instance.isMobile
251
- ? threshold * 2
252
- : threshold;
253
- return {
254
- distanceSquared: distanceSquared,
255
- check: distanceSquared * 4 < Math.pow(thresholdValue, 2),
256
- };
257
- }
258
- }
259
- exports.GeometryMathManager = GeometryMathManager;
260
- _GeometryMathManager_localToWorldMatrix = new WeakMap(), _GeometryMathManager_settings = new WeakMap(), _GeometryMathManager_viewport = new WeakMap();
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _GeometryMathManager_localToWorldMatrix, _GeometryMathManager_settings, _GeometryMathManager_viewport;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GeometryMathManager = void 0;
16
+ const viewer_1 = require("@shapediver/viewer");
17
+ const gl_matrix_1 = require("gl-matrix");
18
+ class GeometryMathManager {
19
+ // #endregion Properties (3)
20
+ // #region Constructors (1)
21
+ constructor(viewport, settings) {
22
+ // #region Properties (3)
23
+ _GeometryMathManager_localToWorldMatrix.set(this, gl_matrix_1.mat4.create());
24
+ _GeometryMathManager_settings.set(this, void 0);
25
+ _GeometryMathManager_viewport.set(this, void 0);
26
+ __classPrivateFieldSet(this, _GeometryMathManager_viewport, viewport, "f");
27
+ __classPrivateFieldSet(this, _GeometryMathManager_settings, settings, "f");
28
+ }
29
+ // #endregion Constructors (1)
30
+ /**
31
+ * Set the matrix that transforms local-space points to world space.
32
+ * When set, screenSpaceDistanceCheck will transform points before projecting
33
+ * via camera.project(), which expects world-space input.
34
+ * Defaults to identity (local space = world space).
35
+ */
36
+ set localToWorldMatrix(m) {
37
+ __classPrivateFieldSet(this, _GeometryMathManager_localToWorldMatrix, m, "f");
38
+ }
39
+ // #region Public Methods (9)
40
+ /**
41
+ * Check which distances of lines to ray
42
+ *
43
+ * @param ray
44
+ * @returns
45
+ */
46
+ checkLineDistances(ray, positionArray, indicesArrayLines) {
47
+ // if there are no line array indices, return
48
+ if (!indicesArrayLines)
49
+ return;
50
+ /**
51
+ * Calculate line distances to ray
52
+ */
53
+ const distances = [];
54
+ for (let i = 0; i < indicesArrayLines.length; i += 2) {
55
+ const firstIndex = indicesArrayLines.at(i);
56
+ const secondIndex = indicesArrayLines.at(i + 1);
57
+ const lineStart = gl_matrix_1.vec3.fromValues(positionArray.at(firstIndex * 3), positionArray.at(firstIndex * 3 + 1), positionArray.at(firstIndex * 3 + 2));
58
+ const lineEnd = gl_matrix_1.vec3.fromValues(positionArray.at(secondIndex * 3), positionArray.at(secondIndex * 3 + 1), positionArray.at(secondIndex * 3 + 2));
59
+ const { closestPointOnRay, closestPointOnLine } = this.closestPointsRayLine(ray, lineStart, lineEnd);
60
+ if (this.screenSpaceDistanceCheck(closestPointOnRay, closestPointOnLine, __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").points.size_0 *
61
+ __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").distanceMultiplicationFactor).check === false)
62
+ continue;
63
+ distances.push({
64
+ index: [firstIndex, secondIndex],
65
+ distance: gl_matrix_1.vec3.distance(closestPointOnRay, closestPointOnLine),
66
+ });
67
+ }
68
+ // if there are no distances, return
69
+ if (distances.length === 0)
70
+ return;
71
+ return distances.sort((a, b) => a.distance - b.distance);
72
+ }
73
+ /**
74
+ * Check which distances of points to ray
75
+ *
76
+ * @param ray
77
+ * @returns
78
+ */
79
+ checkPointDistances(ray, positionArray) {
80
+ /**
81
+ * Calculate point distances to ray
82
+ */
83
+ const distances = [];
84
+ for (let i = 0; i < positionArray.length; i += 3) {
85
+ const point = gl_matrix_1.vec3.fromValues(positionArray.at(i), positionArray.at(i + 1), positionArray.at(i + 2));
86
+ // distance from point to ray
87
+ const closestPoint = this.closestPoint(ray, point);
88
+ if (this.screenSpaceDistanceCheck(point, closestPoint, __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").points.size_0 *
89
+ __classPrivateFieldGet(this, _GeometryMathManager_settings, "f").distanceMultiplicationFactor).check === false)
90
+ continue;
91
+ distances.push({
92
+ index: i / 3,
93
+ distance: gl_matrix_1.vec3.distance(point, closestPoint),
94
+ });
95
+ }
96
+ // if there are no distances, return
97
+ if (distances.length === 0)
98
+ return;
99
+ // sort distances
100
+ return distances.sort((a, b) => a.distance - b.distance);
101
+ }
102
+ close() { }
103
+ /**
104
+ * Calculate the closest point on a ray to a point
105
+ *
106
+ * @param ray
107
+ * @param point
108
+ * @returns
109
+ */
110
+ closestPoint(ray, point) {
111
+ // distance from point to ray
112
+ const dot = gl_matrix_1.vec3.dot(ray.direction, gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, ray.origin));
113
+ // closest point on ray to point
114
+ return gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray.origin, gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), ray.direction, gl_matrix_1.vec3.fromValues(dot, dot, dot)));
115
+ }
116
+ /**
117
+ * Calculate the closest point on a line to a point
118
+ *
119
+ * @param start
120
+ * @param end
121
+ * @param point
122
+ */
123
+ closestPointOnLine(start, end, point) {
124
+ const lineDir = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), end, start);
125
+ // Vector from linePoint to point
126
+ const v = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, start);
127
+ // Line direction dot product with itself
128
+ const dirDotDir = gl_matrix_1.vec3.dot(lineDir, lineDir);
129
+ // If the direction vector is a zero vector, return the line point as closest point
130
+ if (dirDotDir === 0)
131
+ return start;
132
+ // Projection factor t
133
+ const t = gl_matrix_1.vec3.dot(v, lineDir) / dirDotDir;
134
+ // Closest point on the line
135
+ const closestPoint = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), start, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDir, t));
136
+ return closestPoint;
137
+ }
138
+ /**
139
+ * Calculate the closest point on a plane to a point
140
+ *
141
+ * @param point
142
+ * @param planeNormal
143
+ * @param planeOrigin
144
+ * @returns
145
+ */
146
+ closestPointOnPlane(planeOrigin, planeNormal, point) {
147
+ // Calculate the vector from the plane origin to the point
148
+ const toPoint = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, planeOrigin);
149
+ // Project the vector onto the plane normal
150
+ const projectionLength = gl_matrix_1.vec3.dot(toPoint, planeNormal);
151
+ const projectionVector = gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), planeNormal, projectionLength);
152
+ // Subtract the projection vector from the original point to get the projected point
153
+ return gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), point, projectionVector);
154
+ }
155
+ /**
156
+ * Calculate the distance between a ray and a line segment
157
+ *
158
+ * @param ray
159
+ * @param lineStart
160
+ * @param lineEnd
161
+ * @returns
162
+ */
163
+ closestPointsRayLine(ray, lineStart, lineEnd) {
164
+ // direction of line
165
+ const lineDirection = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), lineEnd, lineStart));
166
+ // cross product of ray direction and line direction
167
+ const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), ray.direction, lineDirection);
168
+ // length of cross product
169
+ const crossProductLength = gl_matrix_1.vec3.length(crossProduct);
170
+ if (crossProductLength < 0.0001) {
171
+ // ray and line are parallel, calculate the distance differently
172
+ const closestPointOnRay = ray.origin;
173
+ const closestPointOnLine = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), lineStart, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDirection, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), ray.origin, lineStart), lineDirection)));
174
+ return {
175
+ closestPointOnRay,
176
+ closestPointOnLine,
177
+ };
178
+ }
179
+ const t = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), lineStart, ray.origin);
180
+ const u = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, lineDirection);
181
+ const v = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray.direction);
182
+ const tValue = gl_matrix_1.vec3.dot(u, crossProduct) / Math.pow(crossProductLength, 2);
183
+ const uValue = gl_matrix_1.vec3.dot(v, crossProduct) / Math.pow(crossProductLength, 2);
184
+ const closestPointOnRay = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray.direction, tValue));
185
+ // restrict the closest point on line to the line segment
186
+ let closestPointOnLine;
187
+ if (uValue < 0) {
188
+ closestPointOnLine = lineStart;
189
+ }
190
+ else if (uValue > gl_matrix_1.vec3.distance(lineStart, lineEnd)) {
191
+ closestPointOnLine = lineEnd;
192
+ }
193
+ else {
194
+ closestPointOnLine = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), lineStart, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), lineDirection, uValue));
195
+ }
196
+ return {
197
+ closestPointOnRay,
198
+ closestPointOnLine,
199
+ };
200
+ }
201
+ /**
202
+ * Calculate the distance between two rays
203
+ *
204
+ * @param ray1
205
+ * @param ray2
206
+ * @returns
207
+ */
208
+ closestPointsRayRay(ray1, ray2) {
209
+ // cross product of ray1 direction and ray2 direction
210
+ const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), ray1.direction, ray2.direction);
211
+ // length of cross product
212
+ const crossProductLength = gl_matrix_1.vec3.length(crossProduct);
213
+ if (crossProductLength < 0.0001) {
214
+ // ray1 and ray2 are parallel, calculate the distance differently
215
+ const closestPointOnRay1 = ray1.origin;
216
+ const closestPointOnRay2 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray2.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray2.direction, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), ray1.origin, ray2.origin), ray2.direction)));
217
+ return {
218
+ closestPointOnRay1,
219
+ closestPointOnRay2,
220
+ };
221
+ }
222
+ const t = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), ray2.origin, ray1.origin);
223
+ const u = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray2.direction);
224
+ const v = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, ray1.direction);
225
+ const tValue = gl_matrix_1.vec3.dot(u, crossProduct) / Math.pow(crossProductLength, 2);
226
+ const uValue = gl_matrix_1.vec3.dot(v, crossProduct) / Math.pow(crossProductLength, 2);
227
+ const closestPointOnRay1 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray1.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray1.direction, tValue));
228
+ const closestPointOnRay2 = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray2.origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), ray2.direction, uValue));
229
+ return {
230
+ closestPointOnRay1,
231
+ closestPointOnRay2,
232
+ };
233
+ }
234
+ screenSpaceDistanceCheck(point1, point2, threshold) {
235
+ const camera = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").camera;
236
+ // Transform local-space points to world space before projection.
237
+ // camera.project() expects world-space input.
238
+ const ws1 = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point1, __classPrivateFieldGet(this, _GeometryMathManager_localToWorldMatrix, "f"));
239
+ const ws2 = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point2, __classPrivateFieldGet(this, _GeometryMathManager_localToWorldMatrix, "f"));
240
+ // Project points to NDC
241
+ const screenPos1 = camera.project(ws1);
242
+ const screenPos2 = camera.project(ws2);
243
+ const width = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").canvas.width;
244
+ const height = __classPrivateFieldGet(this, _GeometryMathManager_viewport, "f").canvas.height;
245
+ const x1 = screenPos1[0] * (width / 2) + width / 2;
246
+ const y1 = -(screenPos1[1] * (height / 2) + height / 2);
247
+ const x2 = screenPos2[0] * (width / 2) + width / 2;
248
+ const y2 = -(screenPos2[1] * (height / 2) + height / 2);
249
+ const distanceSquared = Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2);
250
+ const thresholdValue = viewer_1.SystemInfo.instance.isMobile
251
+ ? threshold * 2
252
+ : threshold;
253
+ return {
254
+ distanceSquared: distanceSquared,
255
+ check: distanceSquared * 4 < Math.pow(thresholdValue, 2),
256
+ };
257
+ }
258
+ }
259
+ exports.GeometryMathManager = GeometryMathManager;
260
+ _GeometryMathManager_localToWorldMatrix = new WeakMap(), _GeometryMathManager_settings = new WeakMap(), _GeometryMathManager_viewport = new WeakMap();
261
261
  //# sourceMappingURL=GeometryMathManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryMathManager.js","sourceRoot":"","sources":["../../src/implementation/GeometryMathManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA4D;AAE5D,yCAAqC;AAErC,MAAa,mBAAmB;IAO/B,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,QAAsB,EAAE,QAAgC;QAVpE,yBAAyB;QAEzB,kDAA4B,gBAAI,CAAC,MAAM,EAAE,EAAC;QAC1C,gDAA2C;QAC3C,gDAAiC;QAOhC,uBAAA,IAAI,iCAAa,QAAQ,MAAA,CAAC;QAC1B,uBAAA,IAAI,iCAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAED,8BAA8B;IAE9B;;;;;OAKG;IACH,IAAW,kBAAkB,CAAC,CAAO;QACpC,uBAAA,IAAI,2CAAuB,CAAC,MAAA,CAAC;IAC9B,CAAC;IAED,6BAA6B;IAE7B;;;;;OAKG;IACI,kBAAkB,CACxB,GAAS,EACT,aAA2B,EAC3B,iBAAqC;QAErC,6CAA6C;QAC7C,IAAI,CAAC,iBAAiB;YAAE,OAAO;QAE/B;;WAEG;QACH,MAAM,SAAS,GAGT,EAAE,CAAC;QAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YACrD,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC;YAC5C,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC;YACjD,MAAM,SAAS,GAAG,gBAAI,CAAC,UAAU,CAChC,aAAa,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,CAAE,EACjC,aAAa,CAAC,EAAE,CAAC,UAAU,GAAG,CAAC,GAAG,CAAC,CAAE,EACrC,aAAa,CA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AI,qCAAU,CAAC,MAAM,CAAC,KAAK,CAAC;QAC1C,MAAM,MAAM,GAAG,uBAAA,IAAI,qCAAU,CAAC,MAAM,CAAC,MAAM,CAAC;QAE5C,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACnD,MAAM,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;QAExD,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACnD,MAAM,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;QAExD,MAAM,eAAe,GAAG,SAAA,CAAC,EAAE,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,GAAG,SAAA,CAAC,EAAE,GAAG,EAAE,CAAC,EAAI,CAAC,CAAA,CAAC;QAExD,MAAM,cAAc,GAAG,mBAAU,CAAC,QAAQ,CAAC,QAAQ;YAClD,CAAC,CAAC,SAAS,GAAG,CAAC;YACf,CAAC,CAAC,SAAS,CAAC;QACb,OAAO;YACN,eAAe,EAAE,eAAe;YAChC,KAAK,EAAE,eAAe,GAAG,CAAC,GAAG,SAAA,cAAc,EAAI,CAAC,CAAA;SAChD,CAAC;IACH,CAAC;CAGD;AAxaD,kDAwaC"}
@@ -1,29 +1,29 @@
1
- import { IViewportApi } from "@shapediver/viewer";
2
- import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
- import { IRay, IVisualizationSettings } from "@shapediver/viewer.shared.types";
4
- import { DraggingRestrictionMetaData, DrawingRestrictionMetaData, IRestriction, RayTraceResult, RestrictionProperties, TransformationToolsRestrictionMetaData } from "../interfaces/IRestriction";
5
- import { IRestrictionManager } from "../interfaces/IRestrictionManager";
6
- export declare class RestrictionManager implements IRestrictionManager {
7
- #private;
8
- constructor(viewport: IViewportApi, parentNode?: ITreeNode, restrictions?: RestrictionProperties[], settings?: IVisualizationSettings);
9
- get closed(): boolean;
10
- get restrictions(): {
11
- [token: string]: IRestriction;
12
- };
13
- get showRestrictionVisualization(): boolean;
14
- set showRestrictionVisualization(value: boolean);
15
- addRestriction(properties: RestrictionProperties): string | undefined;
16
- close(): void;
17
- getPressedKeys(): string[];
18
- getToggleKeys(): string[];
19
- getRestriction(token: string): IRestriction | undefined;
20
- rayTrace(ray: IRay, metaData: DrawingRestrictionMetaData | DraggingRestrictionMetaData | TransformationToolsRestrictionMetaData): RayTraceResult | undefined;
21
- removeRestriction(token: string): boolean;
22
- private onDown;
23
- private onKeyDown;
24
- private onKeyUp;
25
- private onMove;
26
- private onOut;
27
- private onUp;
28
- }
1
+ import { IViewportApi } from "@shapediver/viewer";
2
+ import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
+ import { IRay, IVisualizationSettings } from "@shapediver/viewer.shared.types";
4
+ import { DraggingRestrictionMetaData, DrawingRestrictionMetaData, IRestriction, RayTraceResult, RestrictionProperties, TransformationToolsRestrictionMetaData } from "../interfaces/IRestriction";
5
+ import { IRestrictionManager } from "../interfaces/IRestrictionManager";
6
+ export declare class RestrictionManager implements IRestrictionManager {
7
+ #private;
8
+ constructor(viewport: IViewportApi, parentNode?: ITreeNode, restrictions?: RestrictionProperties[], settings?: IVisualizationSettings);
9
+ get closed(): boolean;
10
+ get restrictions(): {
11
+ [token: string]: IRestriction;
12
+ };
13
+ get showRestrictionVisualization(): boolean;
14
+ set showRestrictionVisualization(value: boolean);
15
+ addRestriction(properties: RestrictionProperties): string | undefined;
16
+ close(): void;
17
+ getPressedKeys(): string[];
18
+ getToggleKeys(): string[];
19
+ getRestriction(token: string): IRestriction | undefined;
20
+ rayTrace(ray: IRay, metaData: DrawingRestrictionMetaData | DraggingRestrictionMetaData | TransformationToolsRestrictionMetaData): RayTraceResult | undefined;
21
+ removeRestriction(token: string): boolean;
22
+ private onDown;
23
+ private onKeyDown;
24
+ private onKeyUp;
25
+ private onMove;
26
+ private onOut;
27
+ private onUp;
28
+ }
29
29
  //# sourceMappingURL=RestrictionManager.d.ts.map