@itwin/core-geometry 5.3.0-dev.9 → 5.4.0-dev.3
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/CHANGELOG.md +21 -1
- package/lib/cjs/curve/Arc3d.d.ts +15 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +31 -2
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +25 -8
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +51 -55
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +10 -6
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js +36 -19
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
- package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +47 -53
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +112 -104
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +143 -117
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +99 -66
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +36 -29
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js +62 -40
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +50 -33
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +45 -34
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
- package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +96 -98
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +121 -110
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +135 -142
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +165 -160
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +51 -34
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +16 -6
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +78 -77
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +38 -35
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +27 -7
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +30 -9
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +15 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +31 -2
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +25 -8
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +51 -55
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts +10 -6
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js +36 -19
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
- package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +47 -53
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +112 -104
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +143 -117
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +99 -66
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts +36 -29
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js +62 -40
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js +50 -33
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +45 -34
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
- package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +96 -98
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +122 -111
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +135 -142
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +165 -160
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts +51 -34
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +14 -5
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +78 -77
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +38 -35
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +27 -7
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +30 -9
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/package.json +3 -3
|
@@ -24,35 +24,40 @@ const Ray3d_1 = require("../../geometry3d/Ray3d");
|
|
|
24
24
|
const Plane3dByOriginAndVectors_1 = require("../../geometry3d/Plane3dByOriginAndVectors");
|
|
25
25
|
/**
|
|
26
26
|
* An IntegratedSpiral3d is a curve defined by integrating its curvature.
|
|
27
|
-
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)
|
|
27
|
+
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).
|
|
28
28
|
* * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.
|
|
29
|
-
* * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.
|
|
30
|
-
* *
|
|
29
|
+
* * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.
|
|
30
|
+
* * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
33
|
class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
34
|
-
/** String name for schema properties */
|
|
34
|
+
/** String name for schema properties. */
|
|
35
35
|
curvePrimitiveType = "transitionSpiral";
|
|
36
|
-
/**
|
|
36
|
+
/** Start and end radii as a Segment1d. */
|
|
37
37
|
radius01;
|
|
38
|
-
/**
|
|
38
|
+
/** Start and end bearings as an AngleSweep. */
|
|
39
39
|
bearing01;
|
|
40
|
-
/**
|
|
40
|
+
/** Stroked approximation of entire spiral. */
|
|
41
41
|
_globalStrokes;
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* *
|
|
42
|
+
/**
|
|
43
|
+
* Stroked approximation of active spiral.
|
|
44
|
+
* * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed
|
|
45
|
+
* as partial versus complete.
|
|
46
|
+
* * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
|
|
45
47
|
*/
|
|
46
48
|
_activeStrokes;
|
|
47
|
-
/** Return the internal stroked form of the (possibly partial) spiral
|
|
48
|
-
get activeStrokes() {
|
|
49
|
+
/** Return the internal stroked form of the (possibly partial) spiral. */
|
|
50
|
+
get activeStrokes() {
|
|
51
|
+
return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
|
|
52
|
+
}
|
|
53
|
+
/** Evaluator for transition. */
|
|
49
54
|
_evaluator;
|
|
50
|
-
/** Total curve arc length (computed) */
|
|
55
|
+
/** Total curve arc length (computed). */
|
|
51
56
|
_arcLength01;
|
|
52
|
-
/** Curvatures (inverse radii) at start and end */
|
|
57
|
+
/** Curvatures (inverse radii) at start and end. */
|
|
53
58
|
_curvature01;
|
|
54
|
-
|
|
55
|
-
//
|
|
59
|
+
// constructor demands all bearing, radius, and length data.
|
|
60
|
+
// caller determines usual dependency of "any 4 determine the 5th".
|
|
56
61
|
constructor(spiralType, evaluator, radius01, bearing01, activeFractionInterval, localToWorld, arcLength, properties) {
|
|
57
62
|
super(spiralType, localToWorld, activeFractionInterval, properties);
|
|
58
63
|
this._evaluator = evaluator;
|
|
@@ -60,29 +65,33 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
60
65
|
this.bearing01 = bearing01;
|
|
61
66
|
this._arcLength01 = arcLength;
|
|
62
67
|
this._globalStrokes = LineString3d_1.LineString3d.create();
|
|
63
|
-
// initialize for compiler
|
|
68
|
+
// initialize for compiler; but this will be recomputed in refreshComputeProperties
|
|
64
69
|
this._curvature01 = Segment1d_1.Segment1d.create(0, 1);
|
|
65
70
|
this.refreshComputedProperties();
|
|
66
71
|
}
|
|
67
|
-
/**
|
|
72
|
+
/** Default spiral type name: clothoid. */
|
|
68
73
|
static defaultSpiralType = "clothoid";
|
|
69
|
-
/**
|
|
74
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
70
75
|
globalFractionToBearingRadians(fraction) {
|
|
71
76
|
const areaFraction = this._evaluator.fractionToArea(fraction);
|
|
72
77
|
const dx = this._arcLength01;
|
|
73
|
-
return this.bearing01.startRadians
|
|
78
|
+
return this.bearing01.startRadians
|
|
79
|
+
+ areaFraction * dx * this._curvature01.signedDelta()
|
|
80
|
+
+ fraction * this._curvature01.x0 * dx;
|
|
74
81
|
}
|
|
75
|
-
/**
|
|
82
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
76
83
|
globalFractionToCurvature(fraction) {
|
|
77
84
|
const f = this._evaluator.fractionToCurvatureFraction(fraction);
|
|
78
85
|
return this._curvature01.fractionToPoint(f);
|
|
79
86
|
}
|
|
80
|
-
/** Return the bearing at given fraction of the active interval
|
|
87
|
+
/** Return the bearing at given fraction of the active interval. */
|
|
81
88
|
fractionToBearingRadians(activeFraction) {
|
|
82
89
|
const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);
|
|
83
|
-
return this.bearing01.startRadians
|
|
90
|
+
return this.bearing01.startRadians
|
|
91
|
+
+ fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));
|
|
84
92
|
}
|
|
85
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Return the curvature at given fraction of the active interval.
|
|
86
95
|
* * The `undefined` result is to match the abstract class -- it cannot actually occur.
|
|
87
96
|
*/
|
|
88
97
|
fractionToCurvature(activeFraction) {
|
|
@@ -99,14 +108,15 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
99
108
|
IntegratedSpiral3d._gaussWeight = new Float64Array(5);
|
|
100
109
|
IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature_1.Quadrature.setupGauss5(xA, xB, xMapped, wMapped);
|
|
101
110
|
}
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
111
|
+
/**
|
|
112
|
+
* Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference
|
|
113
|
+
* length (recall that theta is a nonlinear function of the fraction).
|
|
104
114
|
* * This is a single interval of gaussian integration.
|
|
105
|
-
* * The fraction is on the full spiral (not in the mapped active interval)
|
|
115
|
+
* * The fraction is on the full spiral (not in the mapped active interval).
|
|
106
116
|
* @param xyz advancing integrated point.
|
|
107
|
-
* @param fractionA fraction at start of interval
|
|
117
|
+
* @param fractionA fraction at start of interval.
|
|
108
118
|
* @param fractionB fraction at end of interval.
|
|
109
|
-
* @param unitArcLength length of curve for 0 to 1 fractional
|
|
119
|
+
* @param unitArcLength length of curve for 0 to 1 fractional.
|
|
110
120
|
*/
|
|
111
121
|
fullSpiralIncrementalIntegral(xyz, fractionA, fractionB, applyMatrix) {
|
|
112
122
|
const gaussFraction = IntegratedSpiral3d._gaussFraction;
|
|
@@ -127,7 +137,7 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
127
137
|
else
|
|
128
138
|
xyz.addXYZInPlace(dx, dy, 0.0);
|
|
129
139
|
}
|
|
130
|
-
/** Recompute strokes */
|
|
140
|
+
/** Recompute strokes. */
|
|
131
141
|
refreshComputedProperties() {
|
|
132
142
|
this._curvature01 = Segment1d_1.Segment1d.create(TransitionSpiral3d_1.TransitionSpiral3d.radiusToCurvature(this.radius01.x0), TransitionSpiral3d_1.TransitionSpiral3d.radiusToCurvature(this.radius01.x1));
|
|
133
143
|
this._globalStrokes.clear();
|
|
@@ -146,8 +156,9 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
146
156
|
if (this._activeStrokes === undefined)
|
|
147
157
|
this._activeStrokes = LineString3d_1.LineString3d.create();
|
|
148
158
|
this._activeStrokes.clear();
|
|
149
|
-
// finer strokes
|
|
150
|
-
//
|
|
159
|
+
// The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.
|
|
160
|
+
// Below assumes fractionToPoint depends upon the global strokes we just computed, and not
|
|
161
|
+
// on the active strokes we are computing.
|
|
151
162
|
for (let i = 0; i <= numInterval; i++) {
|
|
152
163
|
const localFraction = i * fractionStep;
|
|
153
164
|
this._activeStrokes.addPoint(this.fractionToPoint(localFraction));
|
|
@@ -156,10 +167,11 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
156
167
|
}
|
|
157
168
|
/**
|
|
158
169
|
* Create a transition spiral with radius and bearing conditions.
|
|
159
|
-
* @param radius01 radius (inverse curvature) at start and end
|
|
160
|
-
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
170
|
+
* @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
|
|
171
|
+
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
172
|
+
* towards y axis.
|
|
161
173
|
* @param activeFractionInterval fractional limits of the active portion of the spiral.
|
|
162
|
-
* @param localToWorld placement frame.
|
|
174
|
+
* @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
|
|
163
175
|
*/
|
|
164
176
|
static createRadiusRadiusBearingBearing(radius01, bearing01, activeFractionInterval, localToWorld, typeName) {
|
|
165
177
|
const arcLength = TransitionSpiral3d_1.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);
|
|
@@ -172,14 +184,15 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
172
184
|
}
|
|
173
185
|
/**
|
|
174
186
|
* Create a transition spiral.
|
|
175
|
-
* * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.
|
|
187
|
+
* * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.
|
|
176
188
|
* @param spiralType one of "clothoid", "bloss", "biquadratic", "cosine", "sine". If undefined, "clothoid" is used.
|
|
177
|
-
* @param radius0 radius (or 0 for tangent to line) at start
|
|
178
|
-
* @param radius1 radius (or 0 for tangent to line) at end
|
|
189
|
+
* @param radius0 radius (or 0 for tangent to line) at start.
|
|
190
|
+
* @param radius1 radius (or 0 for tangent to line) at end.
|
|
179
191
|
* @param bearing0 bearing, measured CCW from x axis at start.
|
|
180
192
|
* @param bearing1 bearing, measured CCW from x axis at end.
|
|
181
|
-
* @param fractionInterval optional fractional interval for an "active" portion of the curve.
|
|
182
|
-
*
|
|
193
|
+
* @param fractionInterval optional fractional interval for an "active" portion of the curve. If omitted, the full
|
|
194
|
+
* [0,1] is used.
|
|
195
|
+
* @param localToWorld placement transform.
|
|
183
196
|
*/
|
|
184
197
|
static createFrom4OutOf5(spiralType, radius0, radius1, bearing0, bearing1, arcLength, fractionInterval, localToWorld) {
|
|
185
198
|
if (spiralType === undefined)
|
|
@@ -206,11 +219,11 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
206
219
|
this._arcLength01 = other._arcLength01;
|
|
207
220
|
return this;
|
|
208
221
|
}
|
|
209
|
-
/** Deep clone of this spiral */
|
|
222
|
+
/** Deep clone of this spiral. */
|
|
210
223
|
clone() {
|
|
211
224
|
return new IntegratedSpiral3d(this._spiralType, this._evaluator, this.radius01.clone(), this.bearing01.clone(), this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01, this._designProperties?.clone());
|
|
212
225
|
}
|
|
213
|
-
/**
|
|
226
|
+
/** Apply `transform` to this spiral's local to world transform. */
|
|
214
227
|
tryTransformInPlace(transformA) {
|
|
215
228
|
const rigidData = this.applyRigidPartOfTransform(transformA);
|
|
216
229
|
if (rigidData !== undefined) {
|
|
@@ -227,32 +240,50 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
227
240
|
startPoint(result) {
|
|
228
241
|
return this.activeStrokes.startPoint(result);
|
|
229
242
|
}
|
|
230
|
-
/**
|
|
243
|
+
/** Return the spiral end point. */
|
|
231
244
|
endPoint(result) {
|
|
232
245
|
return this.activeStrokes.endPoint(result);
|
|
233
246
|
}
|
|
234
|
-
/**
|
|
247
|
+
/** Test if the local to world transform places the spiral xy plane into `plane`. */
|
|
235
248
|
isInPlane(plane) {
|
|
236
249
|
return plane.isPointInPlane(this.localToWorld.origin)
|
|
237
250
|
&& Geometry_1.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
|
|
238
251
|
&& Geometry_1.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
|
|
239
252
|
}
|
|
240
|
-
/**
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Return length of the spiral.
|
|
255
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
256
|
+
*/
|
|
257
|
+
quickLength() {
|
|
258
|
+
return this.curveLength();
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Return length of the spiral.
|
|
262
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
263
|
+
*/
|
|
264
|
+
curveLength() {
|
|
265
|
+
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Return (unsigned) length of the spiral between fractions.
|
|
269
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
270
|
+
*/
|
|
245
271
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
246
272
|
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));
|
|
247
273
|
}
|
|
248
|
-
/** Test if `other` is an instance of `TransitionSpiral3d
|
|
249
|
-
isSameGeometryClass(other) {
|
|
250
|
-
|
|
274
|
+
/** Test if `other` is an instance of `TransitionSpiral3d`. */
|
|
275
|
+
isSameGeometryClass(other) {
|
|
276
|
+
return other instanceof TransitionSpiral3d_1.TransitionSpiral3d;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Add strokes from this spiral to `dest`.
|
|
251
280
|
* * Linestrings will usually stroke as just their points.
|
|
252
281
|
* * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
|
|
253
282
|
*/
|
|
254
|
-
emitStrokes(dest, options) {
|
|
255
|
-
|
|
283
|
+
emitStrokes(dest, options) {
|
|
284
|
+
this.activeStrokes.emitStrokes(dest, options);
|
|
285
|
+
}
|
|
286
|
+
/** Emit stroke fragments to `dest` handler. */
|
|
256
287
|
emitStrokableParts(dest, options) {
|
|
257
288
|
const n = this.computeStrokeCountForOptions(options);
|
|
258
289
|
dest.startParentCurvePrimitive(this);
|
|
@@ -267,8 +298,8 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
267
298
|
dest.endParentCurvePrimitive(this);
|
|
268
299
|
}
|
|
269
300
|
/**
|
|
270
|
-
*
|
|
271
|
-
* @param options StrokeOptions that determine count
|
|
301
|
+
* Return the stroke count required for given options.
|
|
302
|
+
* @param options StrokeOptions that determine count.
|
|
272
303
|
*/
|
|
273
304
|
computeStrokeCountForOptions(options) {
|
|
274
305
|
let numStroke;
|
|
@@ -283,8 +314,9 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
283
314
|
}
|
|
284
315
|
return numStroke;
|
|
285
316
|
}
|
|
286
|
-
/**
|
|
287
|
-
*
|
|
317
|
+
/**
|
|
318
|
+
* Reverse the active interval and active strokes.
|
|
319
|
+
* * Primary defining data remains unchanged.
|
|
288
320
|
*/
|
|
289
321
|
reverseInPlace() {
|
|
290
322
|
this.activeFractionInterval.reverseInPlace();
|
|
@@ -322,10 +354,10 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
322
354
|
}
|
|
323
355
|
else {
|
|
324
356
|
const clampedGlobalFraction = Geometry_1.Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);
|
|
325
|
-
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); //
|
|
357
|
+
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query
|
|
326
358
|
const globalFraction0 = index0 / numStrokes;
|
|
327
359
|
result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);
|
|
328
|
-
// GeometryCoreTestIO.consoleLog("
|
|
360
|
+
// GeometryCoreTestIO.consoleLog("fractionToPoint ", activeFraction, this.activeFractionInterval, "( global integration " + globalFraction0 + " to " + globalFraction + ")", index0);
|
|
329
361
|
this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);
|
|
330
362
|
}
|
|
331
363
|
return result;
|
|
@@ -352,10 +384,11 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
352
384
|
result.matrix.applyGivensColumnOp(0, 1, c, s);
|
|
353
385
|
return result;
|
|
354
386
|
}
|
|
355
|
-
/**
|
|
356
|
-
*
|
|
357
|
-
* * origin at fractional position along the curve
|
|
358
|
-
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
387
|
+
/**
|
|
388
|
+
* Return a plane with
|
|
389
|
+
* * origin at fractional position along the curve.
|
|
390
|
+
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
391
|
+
* the fraction.
|
|
359
392
|
* * vectorV is the second derivative, i.e.derivative of vectorU.
|
|
360
393
|
*/
|
|
361
394
|
fractionToPointAnd2Derivatives(activeFraction, result) {
|
|
@@ -372,11 +405,11 @@ class IntegratedSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
372
405
|
vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));
|
|
373
406
|
return Plane3dByOriginAndVectors_1.Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);
|
|
374
407
|
}
|
|
375
|
-
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)
|
|
408
|
+
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
|
|
376
409
|
dispatchToGeometryHandler(handler) {
|
|
377
410
|
return handler.handleTransitionSpiral(this);
|
|
378
411
|
}
|
|
379
|
-
/**
|
|
412
|
+
/** Compare various coordinate quantities. */
|
|
380
413
|
isAlmostEqual(other) {
|
|
381
414
|
if (other instanceof IntegratedSpiral3d) {
|
|
382
415
|
return this.radius01.isAlmostEqual(other.radius01)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegratedSpiral3d.js","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M,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC,CAAC;QACrE,OAAO,qDAAyB,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC;IACD,mFAAmF;IAC5E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,4CAA4C;IAC5B,aAAa,CAAC,KAAqB;QACjD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AApZH,gDAqZC;AACD,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.\n * * `TransitionConditionalProperties` implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n\n /** start and end radii as a Segment1d */\n public radius01: Segment1d;\n /** start and end bearings as an AngleSweep */\n public bearing01: AngleSweep;\n /** stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /** stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral */\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed) */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end */\n private _curvature01: Segment1d;\n /** evaluator for transition */\n // constructor demands all bearing, radius, and length data -- caller determines usual dependency of \"any 4 determine the 5th\"\n private constructor(spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler -- but this will be recomputed in refreshComputeProperties ...\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** default spiral type name. (clothoid) */\n public static readonly defaultSpiralType = \"clothoid\";\n\n /** use the integrated function to return an angle at fractional position. */\n\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta() + fraction * this._curvature01.x0 * dx;\n }\n /** use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n\n /** Return the bearing at given fraction of the active interval .... */\n\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /** Return the curvature at given fraction of the active interval ...\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n\n // These static variables are reused on calls to integrateFromStartFraction\n\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /** Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference length.\n * (recall that theta is a nonlinear function of the fraction.)\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval)\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval\n * @param fractionB fraction at end of interval.\n * @param unitArcLength length of curve for 0 to 1 fractional\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n\n }\n /** Recompute strokes */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1));\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // finer strokes in the active interval ... same fraction step, but mapped\n // This assumes factionToPoint acts normally within refreshComputedProperties -- that depends on the global strokes we just computed, but not on the active strokes\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end. (radius of zero means straight line)\n * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise towards y axis\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(radius01: Segment1d, bearing01: AngleSweep, activeFractionInterval: Segment1d, localToWorld: Transform, typeName?: string) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(typeName, evaluator,\n radius01.clone(),\n bearing01.clone(), activeFractionInterval.clone(), localToWorld.clone(), arcLength,\n new TransitionConditionalProperties(radius01.x0, radius01.x1,\n bearing01.startAngle.clone(), bearing01.endAngle.clone(),\n undefined));\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start\n * @param radius1 radius (or 0 for tangent to line) at end\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. if omitted, the full [0,1] is used.\n * @param localToWorld placement transform\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld, data.curveLength!, data1);\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(this._spiralType, this._evaluator,\n this.radius01.clone(), this.bearing01.clone(),\n this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01,\n this._designProperties?.clone());\n }\n\n /** apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** test if the local to world transform places the spiral xy plane into `plane` */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public quickLength() { return this.curveLength(); }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public override curveLength() { return this._arcLength01 * (this._activeFractionInterval.absoluteDelta()); }\n /** Return (unsigned) length of the spiral between fractions. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d` */\n public isSameGeometryClass(other: any): boolean { return other instanceof TransitionSpiral3d; }\n /** Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\n /** emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n\n /**\n * return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n\n /** Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged !!!\n */\n\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // This indexes the point to the left of the query.\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\" fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /** Return a plane with\n *\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n\n /** compare various coordinate quantities */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
|
|
1
|
+
{"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6DAA0D;AAC1D,0DAAuD;AACvD,4DAAyD;AACzD,0DAAuD;AACvD,kDAA+C;AAC/C,iEAA8D;AAC9D,uFAAoF;AACpF,0DAAuD;AACvD,sEAA2D;AAC3D,wDAAqD;AAGrD,6CAAqD;AACrD,oDAAiD;AAEjD,kDAA+C;AAC/C,0FAAuF;AAGvF;;;;;;;GAOG;AACH,MAAa,kBAAmB,SAAQ,uCAAkB;IACxD,yCAAyC;IACzB,kBAAkB,GAAG,kBAAkB,CAAC;IACxD,0CAA0C;IACnC,QAAQ,CAAY;IAC3B,+CAA+C;IACxC,SAAS,CAAa;IAC7B,8CAA8C;IACtC,cAAc,CAAe;IACrC;;;;;OAKG;IACK,cAAc,CAAgB;IACtC,yEAAyE;IACzE,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IACvF,CAAC;IACD,gCAAgC;IACxB,UAAU,CAAuB;IACzC,yCAAyC;IACjC,YAAY,CAAS;IAC7B,mDAAmD;IAC3C,YAAY,CAAY;IAChC,4DAA4D;IAC5D,mEAAmE;IACnE,YACE,UAA8B,EAC9B,SAA+B,EAC/B,QAAmB,EACnB,SAAqB,EACrB,sBAAiC,EACjC,YAAuB,EACvB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AC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AA/bH,gDAgcC;AACD,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Start and end radii as a Segment1d. */\n public radius01: Segment1d;\n /** Start and end bearings as an AngleSweep. */\n public bearing01: AngleSweep;\n /** Stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\n * as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n /** Evaluator for transition. */\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed). */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end. */\n private _curvature01: Segment1d;\n // constructor demands all bearing, radius, and length data.\n // caller determines usual dependency of \"any 4 determine the 5th\".\n private constructor(\n spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** Default spiral type name: clothoid. */\n public static readonly defaultSpiralType = \"clothoid\";\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians\n + areaFraction * dx * this._curvature01.signedDelta()\n + fraction * this._curvature01.x0 * dx;\n }\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n /** Return the bearing at given fraction of the active interval. */\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /**\n * Return the curvature at given fraction of the active interval.\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n // These static variables are reused on calls to integrateFromStartFraction\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\n * length (recall that theta is a nonlinear function of the fraction).\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval).\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval.\n * @param fractionB fraction at end of interval.\n * @param unitArcLength length of curve for 0 to 1 fractional.\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\n );\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\n // on the active strokes we are computing.\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\n * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise\n * towards y axis.\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n typeName?: string,\n ): IntegratedSpiral3d | undefined {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n radius01.x0, radius01.x1, bearing01.sweepRadians,\n );\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(\n typeName,\n evaluator,\n radius01.clone(),\n bearing01.clone(),\n activeFractionInterval.clone(),\n localToWorld.clone(),\n arcLength,\n new TransitionConditionalProperties(\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\n ),\n );\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start.\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\n * [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld,\n data.curveLength!,\n data1,\n );\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral. */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(\n this._spiralType,\n this._evaluator,\n this.radius01.clone(),\n this.bearing01.clone(),\n this.activeFractionInterval.clone(),\n this.localToWorld.clone(),\n this._arcLength01,\n this._designProperties?.clone(),\n );\n }\n /** Apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** Test if the local to world transform places the spiral xy plane into `plane`. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public quickLength() {\n return this.curveLength();\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLength() {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\n }\n /**\n * Return (unsigned) length of the spiral between fractions.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\n * Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n this.activeStrokes.emitStrokes(dest, options);\n }\n /** Emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n /**\n * Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged.\n */\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve.\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n /** Compare various coordinate quantities. */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { CubicEvaluator } from "./CubicEvaluator";
|
|
2
2
|
/**
|
|
3
3
|
* MX Cubic along arc.
|
|
4
|
-
* This is y= m*x^3 with
|
|
5
|
-
* * x any point on the x axis
|
|
6
|
-
* * `fraction` along the spiral goes to `x = fraction * Lx
|
|
7
|
-
* * m is (1/6RL)
|
|
4
|
+
* This is y = m*x^3 with
|
|
5
|
+
* * x any point on the x axis.
|
|
6
|
+
* * `fraction` along the spiral goes to `x = fraction * Lx`.
|
|
7
|
+
* * m is (1/6RL).
|
|
8
8
|
* * construction length L is nominal along the curve.
|
|
9
9
|
* * x length Lx is along the axis, determined by two terms of the clothoid x series.
|
|
10
|
-
* *
|
|
11
|
-
* @param localToWorld
|
|
12
|
-
* @param nominalL1
|
|
13
|
-
* @param nominalR1
|
|
14
|
-
* @param activeInterval
|
|
15
10
|
* @internal
|
|
16
11
|
*/
|
|
17
12
|
export declare class MXCubicAlongArcEvaluator extends CubicEvaluator {
|
|
@@ -23,14 +18,15 @@ export declare class MXCubicAlongArcEvaluator extends CubicEvaluator {
|
|
|
23
18
|
static computeCubicM(length1: number, radius1: number): number | undefined;
|
|
24
19
|
static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined;
|
|
25
20
|
scaleInPlace(scaleFactor: number): void;
|
|
26
|
-
/**
|
|
21
|
+
/** Return a deep copy of the evaluator. */
|
|
27
22
|
clone(): MXCubicAlongArcEvaluator;
|
|
28
|
-
/** Member by member matchup
|
|
23
|
+
/** Member by member matchup. */
|
|
29
24
|
isAlmostEqual(other: any): boolean;
|
|
30
25
|
/**
|
|
31
26
|
* Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
|
|
32
27
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
33
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
28
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
29
|
+
* CurvePrimitive measurements.
|
|
34
30
|
* @param x distance along the x axis.
|
|
35
31
|
*/
|
|
36
32
|
static approximateDistanceAlongToX(nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MXCubicAlongArcSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"MXCubicAlongArcSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,OAAO;IAKP,kCAAkC;WACpB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;WAInE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAO5E,YAAY,CAAC,WAAW,EAAE,MAAM;IAKhD,2CAA2C;IACpC,KAAK,IAAI,wBAAwB;IAGxC,gCAAgC;IACzB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAOzC;;;;;;OAMG;WACW,2BAA2B,CACvC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAC3E,MAAM;CAMV"}
|
|
@@ -12,17 +12,12 @@ const Geometry_1 = require("../../Geometry");
|
|
|
12
12
|
const CubicEvaluator_1 = require("./CubicEvaluator");
|
|
13
13
|
/**
|
|
14
14
|
* MX Cubic along arc.
|
|
15
|
-
* This is y= m*x^3 with
|
|
16
|
-
* * x any point on the x axis
|
|
17
|
-
* * `fraction` along the spiral goes to `x = fraction * Lx
|
|
18
|
-
* * m is (1/6RL)
|
|
15
|
+
* This is y = m*x^3 with
|
|
16
|
+
* * x any point on the x axis.
|
|
17
|
+
* * `fraction` along the spiral goes to `x = fraction * Lx`.
|
|
18
|
+
* * m is (1/6RL).
|
|
19
19
|
* * construction length L is nominal along the curve.
|
|
20
20
|
* * x length Lx is along the axis, determined by two terms of the clothoid x series.
|
|
21
|
-
* *
|
|
22
|
-
* @param localToWorld
|
|
23
|
-
* @param nominalL1
|
|
24
|
-
* @param nominalR1
|
|
25
|
-
* @param activeInterval
|
|
26
21
|
* @internal
|
|
27
22
|
*/
|
|
28
23
|
class MXCubicAlongArcEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
@@ -51,9 +46,11 @@ class MXCubicAlongArcEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
|
51
46
|
this.nominalRadius1 *= scaleFactor;
|
|
52
47
|
super.scaleInPlace(scaleFactor);
|
|
53
48
|
}
|
|
54
|
-
/**
|
|
55
|
-
clone() {
|
|
56
|
-
|
|
49
|
+
/** Return a deep copy of the evaluator. */
|
|
50
|
+
clone() {
|
|
51
|
+
return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
|
|
52
|
+
}
|
|
53
|
+
/** Member by member matchup. */
|
|
57
54
|
isAlmostEqual(other) {
|
|
58
55
|
if (other instanceof MXCubicAlongArcEvaluator) {
|
|
59
56
|
return Geometry_1.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -64,7 +61,8 @@ class MXCubicAlongArcEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
|
64
61
|
/**
|
|
65
62
|
* Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
|
|
66
63
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
67
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
64
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
65
|
+
* CurvePrimitive measurements.
|
|
68
66
|
* @param x distance along the x axis.
|
|
69
67
|
*/
|
|
70
68
|
static approximateDistanceAlongToX(nominalLength1, nominalRadius1, nominalDistanceAlong) {
|