@configura/babylon-view 3.3.0 → 3.3.1-alpha.0

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.
@@ -74,8 +74,11 @@ export declare class CfgStretchData {
74
74
  * actually use this for anything, but it can be handy for debug.
75
75
  * @param sp Start Point, the start anchor of the stretch line.
76
76
  * @param ep End Point, the end anchor of the stretch line.
77
- * @param spToEpLength Distance from sp to ep.
78
- * @param originalSpToEpLength spToEpLength before transforms.
77
+ * @param spToEpLength Distance from sp to ep in this instance's coordinate system. This changes
78
+ * when a scale is applied while descending through the model hierarchy.
79
+ * @param originalSpToEpLength Distance from sp to ep when the stretch was first created. This
80
+ * remains unchanged through all hierarchy transforms because morph influence is calculated
81
+ * against this original baseline.
79
82
  * @param normal The normal is from sp to ep and is the normal of every plane that divides this
80
83
  * stretch.
81
84
  * @param normalNormalized Normalized version of normal
@@ -89,8 +92,10 @@ export declare class CfgStretchData {
89
92
  /**
90
93
  * If the Matrix is identity the original CfgStretchData is returned.
91
94
  * If not a new CfgStretchData will be created.
92
- * sp, ep, spToEpLength, normal, normalNormalized, scale will be cloned and transformed
93
- * The rest will still reference the original objects
95
+ * sp, ep, spToEpLength, normal and normalNormalized are transformed into the destination
96
+ * coordinate system. originalSpToEpLength is intentionally preserved: it is a model-space
97
+ * baseline, not a measurement in the destination coordinate system.
98
+ * The rest will still reference the original objects.
94
99
  */
95
100
  applyMatrix(matrix: Matrix): CfgStretchData;
96
101
  /**
@@ -85,8 +85,11 @@ export class CfgStretchData {
85
85
  * actually use this for anything, but it can be handy for debug.
86
86
  * @param sp Start Point, the start anchor of the stretch line.
87
87
  * @param ep End Point, the end anchor of the stretch line.
88
- * @param spToEpLength Distance from sp to ep.
89
- * @param originalSpToEpLength spToEpLength before transforms.
88
+ * @param spToEpLength Distance from sp to ep in this instance's coordinate system. This changes
89
+ * when a scale is applied while descending through the model hierarchy.
90
+ * @param originalSpToEpLength Distance from sp to ep when the stretch was first created. This
91
+ * remains unchanged through all hierarchy transforms because morph influence is calculated
92
+ * against this original baseline.
90
93
  * @param normal The normal is from sp to ep and is the normal of every plane that divides this
91
94
  * stretch.
92
95
  * @param normalNormalized Normalized version of normal
@@ -288,8 +291,10 @@ export class CfgStretchData {
288
291
  /**
289
292
  * If the Matrix is identity the original CfgStretchData is returned.
290
293
  * If not a new CfgStretchData will be created.
291
- * sp, ep, spToEpLength, normal, normalNormalized, scale will be cloned and transformed
292
- * The rest will still reference the original objects
294
+ * sp, ep, spToEpLength, normal and normalNormalized are transformed into the destination
295
+ * coordinate system. originalSpToEpLength is intentionally preserved: it is a model-space
296
+ * baseline, not a measurement in the destination coordinate system.
297
+ * The rest will still reference the original objects.
293
298
  */
294
299
  applyMatrix(matrix) {
295
300
  if (matrix.isIdentity()) {
@@ -298,7 +303,10 @@ export class CfgStretchData {
298
303
  const sp = Vector3.TransformCoordinates(this.sp, matrix);
299
304
  const ep = Vector3.TransformCoordinates(this.ep, matrix);
300
305
  const { spToEpLength, normal, normalizedNormal } = calculateNormals(sp, ep);
301
- return new CfgStretchData(this.detailLevel, this.measureParam, this.stretchSymNodeId, this.originalReferenceLength, sp, ep, spToEpLength, this.spToEpLength, normal, normalizedNormal, this.sections);
306
+ return new CfgStretchData(this.detailLevel, this.measureParam, this.stretchSymNodeId, this.originalReferenceLength, sp, ep, spToEpLength,
307
+ // A nested scale changes the local stretch geometry, but not the baseline used to
308
+ // calculate (requestedLength - originalLength) / originalLength.
309
+ this.originalSpToEpLength, normal, normalizedNormal, this.sections);
302
310
  }
303
311
  /**
304
312
  * Calculates the translation of a point which moves it from its original position to where it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/babylon-view",
3
- "version": "3.3.0",
3
+ "version": "3.3.1-alpha.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,13 +22,13 @@
22
22
  "@babylonjs/loaders": "5.52.0",
23
23
  "@babylonjs/materials": "5.52.0",
24
24
  "@babylonjs/serializers": "5.52.0",
25
- "@configura/web-core": "3.3.0",
26
- "@configura/web-utilities": "3.3.0",
25
+ "@configura/web-core": "3.3.1-alpha.0",
26
+ "@configura/web-utilities": "3.3.1-alpha.0",
27
27
  "babylonjs-gltf2interface": "5.22.0",
28
28
  "exifr": "^7.1.3"
29
29
  },
30
30
  "devDependencies": {
31
- "@configura/web-api": "3.3.0",
31
+ "@configura/web-api": "3.3.1-alpha.0",
32
32
  "@types/react": "17.0.9",
33
33
  "@types/react-dom": "17.0.6",
34
34
  "del-cli": "^3.0.0",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "104ce32c903256c81b11337556386878fbd3980c"
40
+ "gitHead": "d93a2232ea58d2cc1ab2a7350b6f7320bfa71608"
41
41
  }