@itwin/core-geometry 4.10.0-dev.36 → 4.10.0-dev.38
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/lib/cjs/curve/Arc3d.d.ts +119 -122
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +115 -118
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +32 -31
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +119 -122
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +115 -118
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +18 -18
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +32 -31
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/package.json +3 -3
package/lib/cjs/curve/Arc3d.js
CHANGED
|
@@ -155,15 +155,15 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
155
155
|
isSameGeometryClass(other) {
|
|
156
156
|
return other instanceof Arc3d;
|
|
157
157
|
}
|
|
158
|
-
/** Read property for (clone of) center */
|
|
158
|
+
/** Read property for (clone of) center. */
|
|
159
159
|
get center() {
|
|
160
160
|
return this._center.clone();
|
|
161
161
|
}
|
|
162
|
-
/** Read property for (clone of) vector0 */
|
|
162
|
+
/** Read property for (clone of) vector0. */
|
|
163
163
|
get vector0() {
|
|
164
164
|
return this._matrix.columnX();
|
|
165
165
|
}
|
|
166
|
-
/** Read property for (clone of) vector90 */
|
|
166
|
+
/** Read property for (clone of) vector90. */
|
|
167
167
|
get vector90() {
|
|
168
168
|
return this._matrix.columnY();
|
|
169
169
|
}
|
|
@@ -171,11 +171,11 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
171
171
|
get perpendicularVector() {
|
|
172
172
|
return this._matrix.columnZ();
|
|
173
173
|
}
|
|
174
|
-
/** Read property for (clone of) matrix of vector0, vector90, unit normal */
|
|
174
|
+
/** Read property for (clone of) matrix of vector0, vector90, unit normal. */
|
|
175
175
|
matrixClone() {
|
|
176
176
|
return this._matrix.clone();
|
|
177
177
|
}
|
|
178
|
-
/** Read property for (reference to) matrix of vector0, vector90, unit normal */
|
|
178
|
+
/** Read property for (reference to) matrix of vector0, vector90, unit normal. */
|
|
179
179
|
get matrixRef() {
|
|
180
180
|
return this._matrix;
|
|
181
181
|
}
|
|
@@ -186,21 +186,21 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
186
186
|
set sweep(value) {
|
|
187
187
|
this._sweep.setFrom(value);
|
|
188
188
|
}
|
|
189
|
-
/** An Arc3d extends along its complete elliptic arc */
|
|
189
|
+
/** An Arc3d extends along its complete elliptic arc. */
|
|
190
190
|
get isExtensibleFractionSpace() {
|
|
191
191
|
return true;
|
|
192
192
|
}
|
|
193
193
|
// constructor copies the pointers
|
|
194
194
|
constructor(center, matrix, sweep) {
|
|
195
195
|
super();
|
|
196
|
-
/** String name for schema properties */
|
|
196
|
+
/** String name for schema properties. */
|
|
197
197
|
this.curvePrimitiveType = "arc";
|
|
198
198
|
this._center = center;
|
|
199
199
|
this._matrix = matrix;
|
|
200
200
|
this._sweep = sweep;
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
|
-
* Return a clone of the arc, with transform applied
|
|
203
|
+
* Return a clone of the arc, with transform applied.
|
|
204
204
|
* @param transform
|
|
205
205
|
*/
|
|
206
206
|
cloneTransformed(transform) {
|
|
@@ -210,9 +210,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
212
|
* Redefine the arc with (captured references to) given data.
|
|
213
|
-
* @param center arc center
|
|
214
|
-
* @param matrix matrix with columns vector0, vector 90, and their unit cross product
|
|
215
|
-
* @param sweep angle sweep
|
|
213
|
+
* @param center arc center.
|
|
214
|
+
* @param matrix matrix with columns vector0, vector 90, and their unit cross product.
|
|
215
|
+
* @param sweep angle sweep.
|
|
216
216
|
*/
|
|
217
217
|
setRefs(center, matrix, sweep) {
|
|
218
218
|
this._center = center;
|
|
@@ -221,14 +221,14 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
223
|
* Redefine the arc with (clones of) given data.
|
|
224
|
-
* @param center arc center
|
|
225
|
-
* @param matrix matrix with columns vector0, vector 90, and their unit cross product
|
|
226
|
-
* @param sweep angle sweep
|
|
224
|
+
* @param center arc center.
|
|
225
|
+
* @param matrix matrix with columns vector0, vector 90, and their unit cross product.
|
|
226
|
+
* @param sweep angle sweep.
|
|
227
227
|
*/
|
|
228
228
|
set(center, matrix, sweep) {
|
|
229
229
|
this.setRefs(center.clone(), matrix.clone(), sweep ? sweep.clone() : AngleSweep_1.AngleSweep.create360());
|
|
230
230
|
}
|
|
231
|
-
/** Copy center, matrix, and sweep from other Arc3d */
|
|
231
|
+
/** Copy center, matrix, and sweep from other Arc3d. */
|
|
232
232
|
setFrom(other) {
|
|
233
233
|
this._center.setFrom(other._center);
|
|
234
234
|
this._matrix.setFrom(other._matrix);
|
|
@@ -240,9 +240,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* Create an arc, capturing references to center, matrix and sweep.
|
|
243
|
-
* @param center center point
|
|
244
|
-
* @param matrix matrix with columns vector0, vector90, and unit cross product
|
|
245
|
-
* @param sweep sweep limits
|
|
243
|
+
* @param center center point.
|
|
244
|
+
* @param matrix matrix with columns vector0, vector90, and unit cross product.
|
|
245
|
+
* @param sweep sweep limits.
|
|
246
246
|
* @param result optional preallocated result.
|
|
247
247
|
*/
|
|
248
248
|
static createRefs(center, matrix, sweep, result) {
|
|
@@ -254,11 +254,11 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
256
|
* Create an arc from center, x column to be scaled, and y column to be scaled.
|
|
257
|
-
* @param center center of ellipse
|
|
258
|
-
* @param matrix matrix whose x and y columns are
|
|
257
|
+
* @param center center of ellipse.
|
|
258
|
+
* @param matrix matrix whose x and y columns are scaled by radius0 and radius90.
|
|
259
259
|
* @param radius0 radius in x direction.
|
|
260
260
|
* @param radius90 radius in y direction.
|
|
261
|
-
* @param sweep sweep limits
|
|
261
|
+
* @param sweep sweep limits.
|
|
262
262
|
* @param result optional preallocated result.
|
|
263
263
|
*/
|
|
264
264
|
static createScaledXYColumns(center, matrix, radius0, radius90, sweep, result) {
|
|
@@ -267,9 +267,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
267
267
|
return Arc3d.create(center, vector0.scale(radius0, vector0), vector90.scale(radius90, vector90), sweep, result);
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
|
-
* Create a (full circular) arc from center, normal and radius
|
|
271
|
-
* @param center center of ellipse.
|
|
272
|
-
* @param normal normal vector
|
|
270
|
+
* Create a (full circular) arc from center, normal and radius.
|
|
271
|
+
* @param center center of ellipse. If undefined, center at 000.
|
|
272
|
+
* @param normal normal vector.
|
|
273
273
|
* @param radius radius in x direction.
|
|
274
274
|
* @param result optional preallocated result.
|
|
275
275
|
*/
|
|
@@ -279,11 +279,11 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* Create an arc by center with vectors to points at 0 and 90 degrees in parameter space.
|
|
282
|
-
* @param center arc center
|
|
283
|
-
* @param vector0 vector to 0 degrees (commonly major axis)
|
|
284
|
-
* @param vector90 vector to 90 degree point (commonly minor axis)
|
|
285
|
-
* @param sweep sweep limits
|
|
286
|
-
* @param result optional preallocated result
|
|
282
|
+
* @param center arc center.
|
|
283
|
+
* @param vector0 vector to 0 degrees (commonly major axis).
|
|
284
|
+
* @param vector90 vector to 90 degree point (commonly minor axis).
|
|
285
|
+
* @param sweep sweep limits; defaults to full sweep.
|
|
286
|
+
* @param result optional preallocated result.
|
|
287
287
|
*/
|
|
288
288
|
static create(center, vector0, vector90, sweep, result) {
|
|
289
289
|
const normal = vector0.unitCrossProductWithDefault(vector90, 0, 0, 0); // normal will be 000 for degenerate case
|
|
@@ -292,13 +292,13 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.
|
|
295
|
-
* @param start start of arc, on an axis
|
|
296
|
-
* @param middle point on arc somewhere between `start` and `end
|
|
297
|
-
* @param end point on arc directly opposite `start
|
|
295
|
+
* @param start start of arc, on an axis.
|
|
296
|
+
* @param middle point on arc somewhere between `start` and `end`.
|
|
297
|
+
* @param end point on arc directly opposite `start`.
|
|
298
298
|
* @param sweep angular sweep, measured from `start` in the direction of `middle`.
|
|
299
299
|
* For a half-ellipse from `start` to `end` passing through `middle`, pass `AngleSweep.createStartEndDegrees(0,180)`.
|
|
300
300
|
* Default value is full sweep to create the entire ellipse.
|
|
301
|
-
* @param result optional preallocated result
|
|
301
|
+
* @param result optional preallocated result.
|
|
302
302
|
* @returns elliptical arc, or undefined if construction impossible.
|
|
303
303
|
*/
|
|
304
304
|
static createStartMiddleEnd(start, middle, end, sweep, result) {
|
|
@@ -372,10 +372,10 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
374
374
|
* Create a circular arc defined by start and end points and radius.
|
|
375
|
-
* @param start start point of the arc
|
|
376
|
-
* @param end end point of the arc
|
|
377
|
-
* @param helper a third point near the arc in its plane, or a vector in the direction of the arc normal
|
|
378
|
-
* @returns the constructed arc, or undefined if desired arc cannot be constructed
|
|
375
|
+
* @param start start point of the arc.
|
|
376
|
+
* @param end end point of the arc.
|
|
377
|
+
* @param helper a third point near the arc in its plane, or a vector in the direction of the arc normal.
|
|
378
|
+
* @returns the constructed arc, or undefined if desired arc cannot be constructed.
|
|
379
379
|
*/
|
|
380
380
|
static createCircularStartEndRadius(start, end, radius, helper) {
|
|
381
381
|
// Construct a line segment from start to end. It is a chord of the circle,
|
|
@@ -407,7 +407,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
407
407
|
* Return a clone of this arc, projected to given z value.
|
|
408
408
|
* * If `z` is omitted, the clone is at the z of the center.
|
|
409
409
|
* * This function projects the arc into a plane parallel to xy-plane.
|
|
410
|
-
* * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle)
|
|
410
|
+
* * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle).
|
|
411
411
|
*/
|
|
412
412
|
cloneAtZ(z) {
|
|
413
413
|
if (z === undefined)
|
|
@@ -417,7 +417,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
417
417
|
/**
|
|
418
418
|
* Create an arc by center (cx,cy,xz) with vectors (ux,uy,uz) and (vx,vy,vz) to points at 0 and 90 degrees in
|
|
419
419
|
* parameter space.
|
|
420
|
-
* @param result optional preallocated result
|
|
420
|
+
* @param result optional preallocated result.
|
|
421
421
|
*/
|
|
422
422
|
static createXYZXYZXYZ(cx, cy, cz, ux, uy, uz, vx, vy, vz, sweep, result) {
|
|
423
423
|
return Arc3d.create(Point3dVector3d_1.Point3d.create(cx, cy, cz), Point3dVector3d_1.Vector3d.create(ux, uy, uz), Point3dVector3d_1.Vector3d.create(vx, vy, vz), sweep, result);
|
|
@@ -472,18 +472,18 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
472
472
|
return undefined;
|
|
473
473
|
}
|
|
474
474
|
/**
|
|
475
|
-
* Convert a fractional position to xyz coordinates
|
|
476
|
-
* @param fraction fractional position on arc
|
|
477
|
-
* @param result optional preallocated result
|
|
475
|
+
* Convert a fractional position to xyz coordinates.
|
|
476
|
+
* @param fraction fractional position on arc.
|
|
477
|
+
* @param result optional preallocated result.
|
|
478
478
|
*/
|
|
479
479
|
fractionToPoint(fraction, result) {
|
|
480
480
|
const radians = this._sweep.fractionToRadians(fraction);
|
|
481
481
|
return this._matrix.originPlusMatrixTimesXY(this._center, Math.cos(radians), Math.sin(radians), result);
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
|
-
* Convert fractional arc and radial positions to xyz coordinates
|
|
485
|
-
* @param fraction fractional position on arc
|
|
486
|
-
* @param result optional preallocated result
|
|
484
|
+
* Convert fractional arc and radial positions to xyz coordinates.
|
|
485
|
+
* @param fraction fractional position on arc.
|
|
486
|
+
* @param result optional preallocated result.
|
|
487
487
|
*/
|
|
488
488
|
fractionAndRadialFractionToPoint(arcFraction, radialFraction, result) {
|
|
489
489
|
const radians = this._sweep.fractionToRadians(arcFraction);
|
|
@@ -491,8 +491,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
493
|
* Convert a fractional position to xyz coordinates and derivative with respect to fraction.
|
|
494
|
-
* @param fraction fractional position on arc
|
|
495
|
-
* @param result optional preallocated result
|
|
494
|
+
* @param fraction fractional position on arc.
|
|
495
|
+
* @param result optional preallocated result.
|
|
496
496
|
*/
|
|
497
497
|
fractionToPointAndDerivative(fraction, result) {
|
|
498
498
|
result = this.radiansToPointAndDerivative(this._sweep.fractionToRadians(fraction), result);
|
|
@@ -501,10 +501,10 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* Construct a plane with
|
|
504
|
-
* * origin at the fractional position along the arc
|
|
505
|
-
* * x axis is the first derivative, i.e. tangent along the arc
|
|
504
|
+
* * origin at the fractional position along the arc.
|
|
505
|
+
* * x axis is the first derivative, i.e. tangent along the arc.
|
|
506
506
|
* * y axis is the second derivative, i.e. in the plane and on the center side of the tangent.
|
|
507
|
-
* If the arc is circular, the second derivative is directly towards the center
|
|
507
|
+
* If the arc is circular, the second derivative is directly towards the center.
|
|
508
508
|
*/
|
|
509
509
|
fractionToPointAnd2Derivatives(fraction, result) {
|
|
510
510
|
const radians = this._sweep.fractionToRadians(fraction);
|
|
@@ -520,8 +520,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
520
520
|
return result;
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
|
-
* Evaluate the point and derivative with respect to the angle (in radians)
|
|
524
|
-
* @param radians angular position
|
|
523
|
+
* Evaluate the point and derivative with respect to the angle (in radians).
|
|
524
|
+
* @param radians angular position.
|
|
525
525
|
* @param result optional preallocated ray.
|
|
526
526
|
*/
|
|
527
527
|
radiansToPointAndDerivative(radians, result) {
|
|
@@ -533,8 +533,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
533
533
|
return result;
|
|
534
534
|
}
|
|
535
535
|
/**
|
|
536
|
-
* Evaluate the point with respect to the angle (in radians)
|
|
537
|
-
* @param radians angular position
|
|
536
|
+
* Evaluate the point with respect to the angle (in radians).
|
|
537
|
+
* @param radians angular position.
|
|
538
538
|
* @param result optional preallocated ray.
|
|
539
539
|
*/
|
|
540
540
|
radiansToPoint(radians, result) {
|
|
@@ -546,11 +546,11 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
548
|
* Return a parametric plane with
|
|
549
|
-
* * origin at arc center
|
|
550
|
-
* * vectorU from center to arc at angle (in radians)
|
|
549
|
+
* * origin at arc center.
|
|
550
|
+
* * vectorU from center to arc at angle (in radians).
|
|
551
551
|
* * vectorV from center to arc at 90 degrees past the angle.
|
|
552
|
-
* @param radians angular position
|
|
553
|
-
* @param result optional preallocated plane
|
|
552
|
+
* @param radians angular position.
|
|
553
|
+
* @param result optional preallocated plane.
|
|
554
554
|
*/
|
|
555
555
|
radiansToRotatedBasis(radians, result) {
|
|
556
556
|
result = result ? result : Plane3dByOriginAndVectors_1.Plane3dByOriginAndVectors.createXYPlane();
|
|
@@ -562,8 +562,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
562
562
|
return result;
|
|
563
563
|
}
|
|
564
564
|
/**
|
|
565
|
-
* Evaluate the point and derivative with respect to the angle (in radians)
|
|
566
|
-
* @param theta angular position
|
|
565
|
+
* Evaluate the point and derivative with respect to the angle (in radians).
|
|
566
|
+
* @param theta angular position.
|
|
567
567
|
* @param result optional preallocated ray.
|
|
568
568
|
*/
|
|
569
569
|
angleToPointAndDerivative(theta, result) {
|
|
@@ -576,14 +576,14 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* Return the start point of the arc.
|
|
579
|
-
* @param result optional preallocated result
|
|
579
|
+
* @param result optional preallocated result.
|
|
580
580
|
*/
|
|
581
581
|
startPoint(result) {
|
|
582
582
|
return this.fractionToPoint(0.0, result);
|
|
583
583
|
}
|
|
584
584
|
/**
|
|
585
585
|
* Return the end point of the arc.
|
|
586
|
-
* @param result optional preallocated result
|
|
586
|
+
* @param result optional preallocated result.
|
|
587
587
|
*/
|
|
588
588
|
endPoint(result) {
|
|
589
589
|
return this.fractionToPoint(1.0, result);
|
|
@@ -655,9 +655,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
655
655
|
return chordSum * factor;
|
|
656
656
|
}
|
|
657
657
|
/**
|
|
658
|
-
* * See extended comments on `CurvePrimitive.moveSignedDistanceFromFraction
|
|
659
|
-
* * A zero length line generates `CurveSearchStatus.error
|
|
660
|
-
* * Nonzero length line generates `CurveSearchStatus.success` or `CurveSearchStatus.stoppedAtBoundary
|
|
658
|
+
* * See extended comments on `CurvePrimitive.moveSignedDistanceFromFraction`.
|
|
659
|
+
* * A zero length line generates `CurveSearchStatus.error`.
|
|
660
|
+
* * Nonzero length line generates `CurveSearchStatus.success` or `CurveSearchStatus.stoppedAtBoundary`.
|
|
661
661
|
*/
|
|
662
662
|
moveSignedDistanceFromFraction(startFraction, signedDistance, allowExtension, result) {
|
|
663
663
|
if (!this.isCircular) // suppress extension !!!
|
|
@@ -671,7 +671,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
671
671
|
}
|
|
672
672
|
/**
|
|
673
673
|
* Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.
|
|
674
|
-
* @param spacePoint point of origin of vectors to the ellipse
|
|
674
|
+
* @param spacePoint point of origin of vectors to the ellipse.
|
|
675
675
|
* @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned.
|
|
676
676
|
* @param endpoints if true, force the end radians into the result.
|
|
677
677
|
*/
|
|
@@ -740,7 +740,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
740
740
|
/**
|
|
741
741
|
* Apply a transform to the arc basis vectors.
|
|
742
742
|
* * nonuniform (i.e. skewing) transforms are allowed.
|
|
743
|
-
* * The transformed vector0 and vector90 are NOT squared up as major minor axes
|
|
743
|
+
* * The transformed vector0 and vector90 are NOT squared up as major minor axes (this is a good feature).
|
|
744
744
|
*/
|
|
745
745
|
tryTransformInPlace(transform) {
|
|
746
746
|
this._center = transform.multiplyPoint3d(this._center, this._center);
|
|
@@ -749,10 +749,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
749
749
|
this.setVector0Vector90(this._matrix.columnX(), this._matrix.columnY());
|
|
750
750
|
return true;
|
|
751
751
|
}
|
|
752
|
-
/**
|
|
753
|
-
* Return true if the ellipse center and basis vectors are in the plane
|
|
754
|
-
* @param plane
|
|
755
|
-
*/
|
|
752
|
+
/** Return true if the ellipse center and basis vectors are in the plane. */
|
|
756
753
|
isInPlane(plane) {
|
|
757
754
|
const normal = plane.getNormalRef();
|
|
758
755
|
// The ellipse vectors are full-length -- true distance comparisons say things.
|
|
@@ -780,7 +777,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
780
777
|
return Geometry_1.Geometry.hypotenuseXY(ux, uy);
|
|
781
778
|
return undefined;
|
|
782
779
|
}
|
|
783
|
-
/** If the arc is circular, return its radius. Otherwise return undefined */
|
|
780
|
+
/** If the arc is circular, return its radius. Otherwise return undefined. */
|
|
784
781
|
circularRadius() {
|
|
785
782
|
return this.isCircular ? this._matrix.columnXMagnitude() : undefined;
|
|
786
783
|
}
|
|
@@ -790,7 +787,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
790
787
|
}
|
|
791
788
|
/**
|
|
792
789
|
* Compute intersections with a plane.
|
|
793
|
-
* @param plane plane to intersect
|
|
790
|
+
* @param plane plane to intersect.
|
|
794
791
|
* @param result array of locations on the curve.
|
|
795
792
|
*/
|
|
796
793
|
appendPlaneIntersectionPoints(plane, result) {
|
|
@@ -853,8 +850,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
853
850
|
range.extend(highPoint);
|
|
854
851
|
}
|
|
855
852
|
/**
|
|
856
|
-
* Returns a (high accuracy) range of the curve between fractional positions
|
|
857
|
-
* * Default implementation returns teh range of the curve from clonePartialCurve
|
|
853
|
+
* Returns a (high accuracy) range of the curve between fractional positions.
|
|
854
|
+
* * Default implementation returns teh range of the curve from clonePartialCurve.
|
|
858
855
|
*/
|
|
859
856
|
rangeBetweenFractions(fraction0, fraction1, transform) {
|
|
860
857
|
const sweep = AngleSweep_1.AngleSweep.createStartEndRadians(this.sweep.fractionToRadians(fraction0), this.sweep.fractionToRadians(fraction1));
|
|
@@ -864,7 +861,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
864
861
|
}
|
|
865
862
|
/**
|
|
866
863
|
* Set up a SineCosinePolynomial as the function c+u*cos(theta)+v*sin(theta) where
|
|
867
|
-
*
|
|
864
|
+
* c,u,v are coefficients obtained by evaluating altitude and velocity relative to the plane.
|
|
868
865
|
* @param plane plane for altitude calculation.
|
|
869
866
|
* @param result optional result.
|
|
870
867
|
* @internal
|
|
@@ -884,32 +881,32 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
884
881
|
}
|
|
885
882
|
/**
|
|
886
883
|
* Create a new arc which is parallel to the xy plane, with given center and radius and optional angle sweep.
|
|
887
|
-
* @param center center of arc
|
|
888
|
-
* @param radius radius of arc
|
|
889
|
-
* @param sweep sweep limits
|
|
884
|
+
* @param center center of arc.
|
|
885
|
+
* @param radius radius of arc.
|
|
886
|
+
* @param sweep sweep limits; defaults to full circle.
|
|
890
887
|
*/
|
|
891
888
|
static createXY(center, radius, sweep = AngleSweep_1.AngleSweep.create360()) {
|
|
892
889
|
return new Arc3d(center.clone(), Matrix3d_1.Matrix3d.createScale(radius, radius, 1.0), sweep.clone());
|
|
893
890
|
}
|
|
894
891
|
/**
|
|
895
892
|
* Create a new arc which is parallel to the xy plane, with given center and x,y radii, and optional angle sweep
|
|
896
|
-
* @param center center of ellipse
|
|
897
|
-
* @param radiusA x axis radius
|
|
898
|
-
* @param radiusB y axis radius
|
|
899
|
-
* @param sweep angle sweep
|
|
893
|
+
* @param center center of ellipse.
|
|
894
|
+
* @param radiusA x axis radius.
|
|
895
|
+
* @param radiusB y axis radius.
|
|
896
|
+
* @param sweep angle sweep.
|
|
900
897
|
*/
|
|
901
898
|
static createXYEllipse(center, radiusA, radiusB, sweep = AngleSweep_1.AngleSweep.create360()) {
|
|
902
899
|
return new Arc3d(center.clone(), Matrix3d_1.Matrix3d.createScale(radiusA, radiusB, 1.0), sweep.clone());
|
|
903
900
|
}
|
|
904
901
|
/**
|
|
905
902
|
* Replace the arc's 0 and 90 degree vectors.
|
|
906
|
-
* @param vector0 vector from center to ellipse point at 0 degrees in parameter space
|
|
907
|
-
* @param vector90 vector from center to ellipse point at 90 degrees in parameter space
|
|
903
|
+
* @param vector0 vector from center to ellipse point at 0 degrees in parameter space.
|
|
904
|
+
* @param vector90 vector from center to ellipse point at 90 degrees in parameter space.
|
|
908
905
|
*/
|
|
909
906
|
setVector0Vector90(vector0, vector90) {
|
|
910
907
|
this._matrix.setColumns(vector0, vector90, vector0.unitCrossProductWithDefault(vector90, 0, 0, 0));
|
|
911
908
|
}
|
|
912
|
-
/** Return the arc definition with rigid matrix form with axis radii */
|
|
909
|
+
/** Return the arc definition with rigid matrix form with axis radii. */
|
|
913
910
|
toScaledMatrix3d() {
|
|
914
911
|
const angleData = Angle_1.Angle.dotProductsToHalfAngleTrigValues(this._matrix.columnXMagnitudeSquared(), this._matrix.columnYMagnitudeSquared(), this._matrix.columnXDotColumnY(), true);
|
|
915
912
|
const vector0A = this._matrix.multiplyXY(angleData.c, angleData.s);
|
|
@@ -923,7 +920,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
923
920
|
sweep: this.sweep.cloneMinusRadians(angleData.radians),
|
|
924
921
|
};
|
|
925
922
|
}
|
|
926
|
-
/** Return the arc definition with center, two vectors, and angle sweep
|
|
923
|
+
/** Return the arc definition with center, two vectors, and angle sweep. */
|
|
927
924
|
toVectors() {
|
|
928
925
|
return {
|
|
929
926
|
center: this.center.clone(),
|
|
@@ -958,9 +955,9 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
958
955
|
}
|
|
959
956
|
/**
|
|
960
957
|
* Set this arc from a json object with these values:
|
|
961
|
-
* * center center point
|
|
962
|
-
* * vector0 vector from center to 0 degree point in parameter space (commonly but not always the major axis vector)
|
|
963
|
-
* * vector90 vector from center to 90 degree point in parameter space (commonly but not always the minor axis vector)
|
|
958
|
+
* * center center point.
|
|
959
|
+
* * vector0 vector from center to 0 degree point in parameter space (commonly but not always the major axis vector).
|
|
960
|
+
* * vector90 vector from center to 90 degree point in parameter space (commonly but not always the minor axis vector).
|
|
964
961
|
* @param json
|
|
965
962
|
*/
|
|
966
963
|
setFromJSON(json) {
|
|
@@ -991,7 +988,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
991
988
|
vector90: this._matrix.columnY().toJSON(),
|
|
992
989
|
};
|
|
993
990
|
}
|
|
994
|
-
/** Test if this arc is almost equal to another GeometryQuery object */
|
|
991
|
+
/** Test if this arc is almost equal to another GeometryQuery object. */
|
|
995
992
|
isAlmostEqual(otherGeometry, distanceTol = Geometry_1.Geometry.smallMetricDistance, radianTol = Geometry_1.Geometry.smallAngleRadians) {
|
|
996
993
|
if (otherGeometry instanceof Arc3d) {
|
|
997
994
|
const other = otherGeometry;
|
|
@@ -1001,12 +998,12 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1001
998
|
}
|
|
1002
999
|
return false;
|
|
1003
1000
|
}
|
|
1004
|
-
/** Emit strokes to caller-supplied linestring */
|
|
1001
|
+
/** Emit strokes to caller-supplied linestring. */
|
|
1005
1002
|
emitStrokes(dest, options) {
|
|
1006
1003
|
const numStrokes = this.computeStrokeCountForOptions(options);
|
|
1007
1004
|
dest.appendFractionalStrokePoints(this, numStrokes, 0.0, 1.0, true);
|
|
1008
1005
|
}
|
|
1009
|
-
/** Emit strokes to caller-supplied handler */
|
|
1006
|
+
/** Emit strokes to caller-supplied handler. */
|
|
1010
1007
|
emitStrokableParts(handler, options) {
|
|
1011
1008
|
const numStrokes = this.computeStrokeCountForOptions(options);
|
|
1012
1009
|
handler.startCurvePrimitive(this);
|
|
@@ -1015,7 +1012,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1015
1012
|
}
|
|
1016
1013
|
/**
|
|
1017
1014
|
* Return the stroke count required for given options.
|
|
1018
|
-
* @param options StrokeOptions that determine count
|
|
1015
|
+
* @param options StrokeOptions that determine count.
|
|
1019
1016
|
*/
|
|
1020
1017
|
computeStrokeCountForOptions(options) {
|
|
1021
1018
|
let numStroke;
|
|
@@ -1028,14 +1025,14 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1028
1025
|
}
|
|
1029
1026
|
return numStroke;
|
|
1030
1027
|
}
|
|
1031
|
-
/** Second step of double dispatch:
|
|
1028
|
+
/** Second step of double dispatch: call `handler.handleArc3d(this)` */
|
|
1032
1029
|
dispatchToGeometryHandler(handler) {
|
|
1033
1030
|
return handler.handleArc3d(this);
|
|
1034
1031
|
}
|
|
1035
1032
|
/**
|
|
1036
1033
|
* Return (if possible) an arc which is a portion of this curve.
|
|
1037
|
-
* @param fractionA
|
|
1038
|
-
* @param fractionB
|
|
1034
|
+
* @param fractionA start fraction.
|
|
1035
|
+
* @param fractionB end fraction.
|
|
1039
1036
|
*/
|
|
1040
1037
|
clonePartialCurve(fractionA, fractionB) {
|
|
1041
1038
|
if (fractionB < fractionA) {
|
|
@@ -1049,8 +1046,8 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1049
1046
|
}
|
|
1050
1047
|
/**
|
|
1051
1048
|
* Return an arc whose basis vectors are rotated by given angle within the current basis space.
|
|
1052
|
-
* * the result arc will have its zero-degree point (new `vector0`) at the current
|
|
1053
|
-
* `vector0 * cos(theta) + vector90 * sin(theta)
|
|
1049
|
+
* * the result arc will have its zero-degree point (new `vector0`) at the current.
|
|
1050
|
+
* `vector0 * cos(theta) + vector90 * sin(theta)`.
|
|
1054
1051
|
* * the result sweep is adjusted so all fractional coordinates (e.g. start and end) evaluate to the same xyz.
|
|
1055
1052
|
* * Specifically, theta is subtracted from the original start and end angles.
|
|
1056
1053
|
* @param theta the angle (in the input arc space) which is to become the 0-degree point in the new arc.
|
|
@@ -1065,10 +1062,10 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1065
1062
|
return arcB;
|
|
1066
1063
|
}
|
|
1067
1064
|
/**
|
|
1068
|
-
* Find intervals of this CurvePrimitive that are interior to a clipper
|
|
1069
|
-
* @param clipper clip structure (e.g.clip planes)
|
|
1070
|
-
* @param announce(optional) function to be called announcing fractional intervals
|
|
1071
|
-
* `
|
|
1065
|
+
* Find intervals of this CurvePrimitive that are interior to a clipper.
|
|
1066
|
+
* @param clipper clip structure (e.g.clip planes).
|
|
1067
|
+
* @param announce (optional) function to be called announcing fractional intervals
|
|
1068
|
+
* `announce(fraction0, fraction1, curvePrimitive)`.
|
|
1072
1069
|
* @returns true if any "in" segments are announced.
|
|
1073
1070
|
*/
|
|
1074
1071
|
announceClipIntervals(clipper, announce) {
|
|
@@ -1093,20 +1090,20 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1093
1090
|
* Determine an arc "at a point of inflection" of a point sequence.
|
|
1094
1091
|
* * Return the arc along with the fractional positions of the tangency points.
|
|
1095
1092
|
* * In the returned object:
|
|
1096
|
-
* * `arc` is the (bounded) arc
|
|
1093
|
+
* * `arc` is the (bounded) arc.
|
|
1097
1094
|
* * `fraction10` is the tangency point's position as an interpolating fraction of the line segment from
|
|
1098
|
-
* `point1` (backwards) to `point0
|
|
1095
|
+
* `point1` (backwards) to `point0`.
|
|
1099
1096
|
* * `fraction12` is the tangency point's position as an interpolating fraction of the line segment from
|
|
1100
|
-
* `point1` (forward) to `point2
|
|
1097
|
+
* `point1` (forward) to `point2`.
|
|
1101
1098
|
* * `point` is the `point1` input.
|
|
1102
1099
|
* * If unable to construct the arc:
|
|
1103
1100
|
* * `point` is the `point1` input.
|
|
1104
|
-
* * both fractions are zero
|
|
1101
|
+
* * both fractions are zero.
|
|
1105
1102
|
* * `arc` is undefined.
|
|
1106
|
-
* @param point0 first point of path (the point before the point of inflection)
|
|
1107
|
-
* @param point1 second point of path (the point of inflection)
|
|
1108
|
-
* @param point2 third point of path (the point after the point of inflection)
|
|
1109
|
-
* @param radius arc radius
|
|
1103
|
+
* @param point0 first point of path (the point before the point of inflection).
|
|
1104
|
+
* @param point1 second point of path (the point of inflection).
|
|
1105
|
+
* @param point2 third point of path (the point after the point of inflection).
|
|
1106
|
+
* @param radius arc radius.
|
|
1110
1107
|
*
|
|
1111
1108
|
*/
|
|
1112
1109
|
static createFilletArc(point0, point1, point2, radius) {
|
|
@@ -1141,11 +1138,11 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1141
1138
|
}
|
|
1142
1139
|
return { fraction10: 0.0, fraction12: 0.0, point: point1.clone() };
|
|
1143
1140
|
}
|
|
1144
|
-
/** Scale the vector0 and vector90 vectors by `scaleFactor
|
|
1141
|
+
/** Scale the vector0 and vector90 vectors by `scaleFactor`. */
|
|
1145
1142
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
1146
1143
|
this._matrix.scaleColumnsInPlace(scaleFactor, scaleFactor, 1.0);
|
|
1147
1144
|
}
|
|
1148
|
-
/** Return the (signed!) area between (a fractional portion of) the arc and the chord between those points */
|
|
1145
|
+
/** Return the (signed!) area between (a fractional portion of) the arc and the chord between those points. */
|
|
1149
1146
|
areaToChordXY(fraction0, fraction1) {
|
|
1150
1147
|
let detJ = Geometry_1.Geometry.crossProductXYXY(this._matrix.coffs[0], this._matrix.coffs[3], this._matrix.coffs[1], this._matrix.coffs[4]);
|
|
1151
1148
|
// areas in arc of unit circle with radians limits
|
|
@@ -1160,7 +1157,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1160
1157
|
}
|
|
1161
1158
|
/**
|
|
1162
1159
|
* Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
|
|
1163
|
-
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
|
|
1160
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.
|
|
1164
1161
|
*/
|
|
1165
1162
|
constructOffsetXY(offsetDistanceOrOptions) {
|
|
1166
1163
|
const options = OffsetOptions_1.OffsetOptions.create(offsetDistanceOrOptions);
|
|
@@ -1192,7 +1189,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1192
1189
|
/**
|
|
1193
1190
|
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.
|
|
1194
1191
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
1195
|
-
* @param lowHigh optional receiver for output
|
|
1192
|
+
* @param lowHigh optional receiver for output.
|
|
1196
1193
|
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.
|
|
1197
1194
|
*/
|
|
1198
1195
|
projectedParameterRange(ray, lowHigh) {
|
|
@@ -1200,7 +1197,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
1200
1197
|
}
|
|
1201
1198
|
/**
|
|
1202
1199
|
* Construct a circular arc chain approximation to the instance elliptical arc.
|
|
1203
|
-
* @param options bundle of options for sampling an elliptical arc (use default options if undefined)
|
|
1200
|
+
* @param options bundle of options for sampling an elliptical arc (use default options if undefined).
|
|
1204
1201
|
* @returns the approximating curve chain, the circular instance, or undefined if construction fails.
|
|
1205
1202
|
*/
|
|
1206
1203
|
constructCircularArcChainApproximation(options) {
|
|
@@ -1222,8 +1219,8 @@ Arc3d._workVectorV = Point3dVector3d_1.Vector3d.create();
|
|
|
1222
1219
|
Arc3d._workVectorW = Point3dVector3d_1.Vector3d.create();
|
|
1223
1220
|
// !! misspelled Gauss in the published static !! Declare it ok.
|
|
1224
1221
|
// cspell::word Guass
|
|
1225
|
-
/** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep) */
|
|
1222
|
+
/** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep). */
|
|
1226
1223
|
Arc3d.quadratureGuassCount = 5;
|
|
1227
|
-
/** In quadrature for arc length, use this interval (divided by quickEccentricity) */
|
|
1224
|
+
/** In quadrature for arc length, use this interval (divided by quickEccentricity). */
|
|
1228
1225
|
Arc3d.quadratureIntervalAngleDegrees = 10.0;
|
|
1229
1226
|
//# sourceMappingURL=Arc3d.js.map
|