@itwin/core-geometry 4.10.0-dev.3 → 4.10.0-dev.30
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 +31 -1
- package/lib/cjs/Geometry.d.ts +2 -2
- package/lib/cjs/Geometry.js +2 -2
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +7 -7
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +21 -10
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +66 -38
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +27 -8
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +44 -25
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +11 -13
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +19 -46
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +2 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -4
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +40 -65
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +131 -70
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +5 -5
- package/lib/cjs/geometry3d/Angle.js +5 -5
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +101 -13
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +156 -57
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +4 -4
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +35 -31
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +55 -31
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -5
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +2 -2
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +2 -2
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +4 -2
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -2
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.d.ts +5 -5
- package/lib/cjs/geometry4d/Map4d.js +5 -5
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts +4 -7
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +4 -7
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +2 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -0
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +2 -5
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +46 -201
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +132 -445
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +164 -0
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -0
- package/lib/cjs/numerics/SmallSystem.js +321 -0
- package/lib/cjs/numerics/SmallSystem.js.map +1 -0
- package/lib/cjs/polyface/PolyfaceClip.d.ts +3 -3
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +7 -7
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +2 -2
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +2 -2
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +1 -1
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +2 -2
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/esm/Geometry.d.ts +2 -2
- package/lib/esm/Geometry.js +2 -2
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +7 -7
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +21 -10
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +66 -38
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +27 -8
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +44 -25
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +11 -13
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +17 -44
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +4 -3
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +35 -60
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +130 -69
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +5 -5
- package/lib/esm/geometry3d/Angle.js +5 -5
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +101 -13
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +156 -57
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +35 -31
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +55 -31
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -5
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +2 -2
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +4 -2
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -2
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.d.ts +5 -5
- package/lib/esm/geometry4d/Map4d.js +5 -5
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts +4 -7
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +4 -7
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +2 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -0
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +1 -4
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +46 -201
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +132 -444
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +164 -0
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -0
- package/lib/esm/numerics/SmallSystem.js +317 -0
- package/lib/esm/numerics/SmallSystem.js.map +1 -0
- package/lib/esm/polyface/PolyfaceClip.d.ts +3 -3
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -4
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +1 -1
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/package.json +7 -19
package/lib/esm/curve/Arc3d.js
CHANGED
|
@@ -11,7 +11,8 @@ import { Plane3dByOriginAndVectors } from "../geometry3d/Plane3dByOriginAndVecto
|
|
|
11
11
|
import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
12
12
|
import { Range1d, Range3d } from "../geometry3d/Range";
|
|
13
13
|
import { Ray3d } from "../geometry3d/Ray3d";
|
|
14
|
-
import { SineCosinePolynomial,
|
|
14
|
+
import { SineCosinePolynomial, TrigPolynomial } from "../numerics/Polynomials";
|
|
15
|
+
import { SmallSystem } from "../numerics/SmallSystem";
|
|
15
16
|
import { CurveExtendMode, CurveExtendOptions } from "./CurveExtendMode";
|
|
16
17
|
import { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from "./CurveLocationDetail";
|
|
17
18
|
import { CurvePrimitive } from "./CurvePrimitive";
|
|
@@ -287,19 +288,19 @@ export class Arc3d extends CurvePrimitive {
|
|
|
287
288
|
}
|
|
288
289
|
/**
|
|
289
290
|
* Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.
|
|
290
|
-
* @param
|
|
291
|
-
* @param
|
|
292
|
-
* @param
|
|
293
|
-
* @param sweep angular sweep, measured from `
|
|
294
|
-
* For a half-ellipse from `
|
|
291
|
+
* @param start start of arc, on an axis
|
|
292
|
+
* @param middle point on arc somewhere between `start` and `end`
|
|
293
|
+
* @param end point on arc directly opposite `start`
|
|
294
|
+
* @param sweep angular sweep, measured from `start` in the direction of `middle`.
|
|
295
|
+
* For a half-ellipse from `start` to `end` passing through `middle`, pass `AngleSweep.createStartEndDegrees(0,180)`.
|
|
295
296
|
* Default value is full sweep to create the entire ellipse.
|
|
296
297
|
* @param result optional preallocated result
|
|
297
298
|
* @returns elliptical arc, or undefined if construction impossible.
|
|
298
299
|
*/
|
|
299
|
-
static createStartMiddleEnd(
|
|
300
|
-
const center = Point3d.createAdd2Scaled(
|
|
301
|
-
const vector0 = Vector3d.createStartEnd(center,
|
|
302
|
-
const vector1 = Vector3d.createStartEnd(center,
|
|
300
|
+
static createStartMiddleEnd(start, middle, end, sweep, result) {
|
|
301
|
+
const center = Point3d.createAdd2Scaled(start, 0.5, end, 0.5);
|
|
302
|
+
const vector0 = Vector3d.createStartEnd(center, start);
|
|
303
|
+
const vector1 = Vector3d.createStartEnd(center, middle);
|
|
303
304
|
const v0DotV1 = vector0.dotProduct(vector1);
|
|
304
305
|
const v0Len2 = vector0.magnitudeSquared();
|
|
305
306
|
if (Math.abs(v0DotV1) >= v0Len2)
|
|
@@ -307,7 +308,7 @@ export class Arc3d extends CurvePrimitive {
|
|
|
307
308
|
const normal = vector0.crossProduct(vector1);
|
|
308
309
|
const vector90 = normal.unitCrossProductWithDefault(vector0, 0, 0, 0);
|
|
309
310
|
const v1DotV90 = vector1.dotProduct(vector90);
|
|
310
|
-
//
|
|
311
|
+
// solve the standard ellipse equation for the unknown axis length, given local coords of middle (v0.v1/||v0||, v90.v1)
|
|
311
312
|
const v90Len = Geometry.safeDivideFraction(v0Len2 * v1DotV90, Math.sqrt(v0Len2 * v0Len2 - v0DotV1 * v0DotV1), 0);
|
|
312
313
|
if (Geometry.isSmallMetricDistanceSquared(v90Len))
|
|
313
314
|
return undefined;
|
|
@@ -316,33 +317,55 @@ export class Arc3d extends CurvePrimitive {
|
|
|
316
317
|
}
|
|
317
318
|
/**
|
|
318
319
|
* Create a circular arc defined by start point, tangent at start point, and end point.
|
|
319
|
-
*
|
|
320
|
+
* * The circular arc is swept from `start` to `end` in the direction of `tangentAtStart`.
|
|
321
|
+
* * If `tangentAtStart` is parallel to the line segment from `start` to `end`, return the line segment.
|
|
320
322
|
*/
|
|
321
323
|
static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
const sweep = AngleSweep.
|
|
324
|
+
// see itwinjs-core\core\geometry\internaldocs\Arc3d.md to clarify below algorithm
|
|
325
|
+
const startToEnd = Vector3d.createStartEnd(start, end);
|
|
326
|
+
const frame = Matrix3d.createRigidFromColumns(tangentAtStart, startToEnd, AxisOrder.XYZ);
|
|
327
|
+
if (frame !== undefined) {
|
|
328
|
+
const vv = startToEnd.dotProduct(startToEnd);
|
|
329
|
+
const vw = frame.dotColumnY(startToEnd);
|
|
330
|
+
const radius = Geometry.conditionalDivideCoordinate(vv, 2 * vw);
|
|
331
|
+
if (radius !== undefined) {
|
|
332
|
+
const vector0 = frame.columnY();
|
|
333
|
+
vector0.scaleInPlace(-radius); // center to start
|
|
334
|
+
const vector90 = frame.columnX();
|
|
335
|
+
vector90.scaleInPlace(radius);
|
|
336
|
+
const centerToEnd = vector0.plus(startToEnd);
|
|
337
|
+
const sweepAngle = vector0.angleTo(centerToEnd);
|
|
338
|
+
let sweepRadians = sweepAngle.radians; // always positive and less than PI
|
|
339
|
+
if (tangentAtStart.dotProduct(centerToEnd) < 0.0) // sweepRadians is the wrong way
|
|
340
|
+
sweepRadians = 2.0 * Math.PI - sweepRadians;
|
|
341
|
+
const center = start.plusScaled(vector0, -1.0);
|
|
342
|
+
const sweep = AngleSweep.createStartEndRadians(0.0, sweepRadians);
|
|
341
343
|
return Arc3d.create(center, vector0, vector90, sweep, result);
|
|
342
344
|
}
|
|
343
345
|
}
|
|
344
346
|
return LineSegment3d.create(start, end);
|
|
345
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
|
|
350
|
+
* * The vector from start point to center is in the direction of upVector crossed with tangentA.
|
|
351
|
+
* @param start start point.
|
|
352
|
+
* @param tangentAtStart vector in tangent direction at the start.
|
|
353
|
+
* @param radius signed radius.
|
|
354
|
+
* @param upVector optional out-of-plane vector. Defaults to positive Z.
|
|
355
|
+
* @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
|
|
356
|
+
*/
|
|
357
|
+
static createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
|
|
358
|
+
if (upVector === undefined)
|
|
359
|
+
upVector = Vector3d.unitZ();
|
|
360
|
+
const vector0 = upVector.unitCrossProduct(tangentAtStart);
|
|
361
|
+
if (vector0 === undefined)
|
|
362
|
+
return undefined;
|
|
363
|
+
const center = start.plusScaled(vector0, radius);
|
|
364
|
+
// reverse the A-to-center vector and bring it up to scale
|
|
365
|
+
vector0.scaleInPlace(-radius);
|
|
366
|
+
const vector90 = tangentAtStart.scaleToLength(Math.abs(radius)); // cannot fail; prior unitCrossProduct would have failed first
|
|
367
|
+
return Arc3d.create(center, vector0, vector90, AngleSweep.create(sweep));
|
|
368
|
+
}
|
|
346
369
|
/**
|
|
347
370
|
* Create a circular arc defined by start and end points and radius.
|
|
348
371
|
* @param start start point of the arc
|
|
@@ -757,7 +780,7 @@ export class Arc3d extends CurvePrimitive {
|
|
|
757
780
|
circularRadius() {
|
|
758
781
|
return this.isCircular ? this._matrix.columnXMagnitude() : undefined;
|
|
759
782
|
}
|
|
760
|
-
/** Return the larger of the two defining vectors. */
|
|
783
|
+
/** Return the larger length of the two defining vectors. */
|
|
761
784
|
maxVectorLength() {
|
|
762
785
|
return Math.max(this._matrix.columnXMagnitude(), this._matrix.columnYMagnitude());
|
|
763
786
|
}
|
|
@@ -965,12 +988,12 @@ export class Arc3d extends CurvePrimitive {
|
|
|
965
988
|
};
|
|
966
989
|
}
|
|
967
990
|
/** Test if this arc is almost equal to another GeometryQuery object */
|
|
968
|
-
isAlmostEqual(otherGeometry) {
|
|
991
|
+
isAlmostEqual(otherGeometry, distanceTol = Geometry.smallMetricDistance, radianTol = Geometry.smallAngleRadians) {
|
|
969
992
|
if (otherGeometry instanceof Arc3d) {
|
|
970
993
|
const other = otherGeometry;
|
|
971
|
-
return this._center.isAlmostEqual(other._center)
|
|
972
|
-
&& this._matrix.isAlmostEqual(other._matrix)
|
|
973
|
-
&& this._sweep.isAlmostEqualAllowPeriodShift(other._sweep);
|
|
994
|
+
return this._center.isAlmostEqual(other._center, distanceTol)
|
|
995
|
+
&& this._matrix.isAlmostEqual(other._matrix, distanceTol)
|
|
996
|
+
&& this._sweep.isAlmostEqualAllowPeriodShift(other._sweep, radianTol);
|
|
974
997
|
}
|
|
975
998
|
return false;
|
|
976
999
|
}
|
|
@@ -1053,7 +1076,12 @@ export class Arc3d extends CurvePrimitive {
|
|
|
1053
1076
|
const otherVector0 = this._matrix.multiplyInverse(other.vector0);
|
|
1054
1077
|
const otherVector90 = this._matrix.multiplyInverse(other.vector90);
|
|
1055
1078
|
if (otherOrigin && otherVector0 && otherVector90) {
|
|
1056
|
-
return {
|
|
1079
|
+
return {
|
|
1080
|
+
center: otherOrigin,
|
|
1081
|
+
vector0: otherVector0,
|
|
1082
|
+
vector90: otherVector90,
|
|
1083
|
+
sweep: this.sweep.clone(),
|
|
1084
|
+
};
|
|
1057
1085
|
}
|
|
1058
1086
|
return undefined;
|
|
1059
1087
|
}
|
|
@@ -1071,7 +1099,7 @@ export class Arc3d extends CurvePrimitive {
|
|
|
1071
1099
|
* * `point` is the `point1` input.
|
|
1072
1100
|
* * both fractions are zero
|
|
1073
1101
|
* * `arc` is undefined.
|
|
1074
|
-
* @param point0 first point of path
|
|
1102
|
+
* @param point0 first point of path (the point before the point of inflection)
|
|
1075
1103
|
* @param point1 second point of path (the point of inflection)
|
|
1076
1104
|
* @param point2 third point of path (the point after the point of inflection)
|
|
1077
1105
|
* @param radius arc radius
|