@itwin/core-geometry 5.7.0-dev.8 → 5.8.0-dev.1
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 +6 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +2 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +15 -3
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +36 -23
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +18 -5
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +34 -14
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +12 -11
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +36 -36
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.d.ts +5 -5
- package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js +4 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +13 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +18 -2
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +2 -2
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +2 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -1
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +4 -15
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +1 -35
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +18 -13
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +2 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +2 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +5 -0
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +7 -0
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +2 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +2 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +15 -3
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +36 -23
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +18 -5
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +34 -14
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +12 -11
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +36 -36
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.d.ts +5 -5
- package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js +4 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +13 -1
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +18 -2
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +2 -2
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +2 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -1
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +4 -15
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +1 -35
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +2 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +19 -14
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +2 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +2 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +5 -0
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +7 -0
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +2 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/package.json +3 -3
package/lib/cjs/curve/Path.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Curve
|
|
3
|
+
*/
|
|
1
4
|
import { GeometryHandler } from "../geometry3d/GeometryHandler";
|
|
2
5
|
import { Point3d } from "../geometry3d/Point3dVector3d";
|
|
3
6
|
import { CurveChain } from "./CurveCollection";
|
|
4
|
-
import { VariantCurveExtendParameter } from "./CurveExtendMode";
|
|
5
|
-
import { CurveLocationDetail } from "./CurveLocationDetail";
|
|
6
7
|
import { CurvePrimitive } from "./CurvePrimitive";
|
|
7
8
|
import { RecursiveCurveProcessor } from "./CurveProcessor";
|
|
8
9
|
import { GeometryQuery } from "./GeometryQuery";
|
|
@@ -29,24 +30,12 @@ export declare class Path extends CurveChain {
|
|
|
29
30
|
*/
|
|
30
31
|
static create(...curves: Array<CurvePrimitive | Point3d[]>): Path;
|
|
31
32
|
/**
|
|
32
|
-
* Create a path from
|
|
33
|
+
* Create a path from an array of curve primitives.
|
|
33
34
|
* @param curves array of individual curve primitives.
|
|
34
35
|
*/
|
|
35
36
|
static createArray(curves: CurvePrimitive[]): Path;
|
|
36
37
|
/** Return a deep copy, with leaf-level curve primitives stroked. */
|
|
37
38
|
cloneStroked(options?: StrokeOptions): Path;
|
|
38
|
-
/**
|
|
39
|
-
* Return the closest point on the contained curves.
|
|
40
|
-
* @param spacePoint point in space.
|
|
41
|
-
* @param extend compute the closest point to the path extended according to variant type:
|
|
42
|
-
* * false: do not extend the path
|
|
43
|
-
* * true: extend the path at both start and end
|
|
44
|
-
* * CurveExtendOptions: extend the path in the specified manner at both start and end
|
|
45
|
-
* * CurveExtendOptions[]: first entry applies to path start; second, to path end; any other entries ignored
|
|
46
|
-
* @param result optional pre-allocated detail to populate and return.
|
|
47
|
-
* @returns details of the closest point.
|
|
48
|
-
*/
|
|
49
|
-
closestPoint(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail | undefined;
|
|
50
39
|
/** Return the boundary type (1) of a corresponding MicroStation CurveVector */
|
|
51
40
|
dgnBoundaryType(): number;
|
|
52
41
|
/** Clone as a new `Path` with no primitives */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,wCAAwC;IACxC,SAAgB,mBAAmB,UAAU;IAC7C,+CAA+C;IACxC,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAGzD,2DAA2D;IACpD,wBAAwB,CAAC,SAAS,EAAE,uBAAuB,EAAE,aAAa,GAAE,MAAW,GAAG,IAAI;IAGrG,+BAA+B;;IAI/B;;;;OAIG;WACW,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,cAAc,GAAG,OAAO,EAAE,CAAC,GAAG,IAAI;IAaxE;;;OAGG;WACW,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI;IAGzD,oEAAoE;IAC7D,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAMlD,+EAA+E;IACxE,eAAe,IAAI,MAAM;IAGhC,+CAA+C;IACxC,cAAc,IAAI,IAAI;IAG7B,sEAAsE;IAC/D,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;CAGhE"}
|
package/lib/cjs/curve/Path.js
CHANGED
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.Path = void 0;
|
|
8
|
-
/** @packageDocumentation
|
|
9
|
-
* @module Curve
|
|
10
|
-
*/
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
8
|
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
13
9
|
const CurveChainWithDistanceIndex_1 = require("./CurveChainWithDistanceIndex");
|
|
14
10
|
const CurveCollection_1 = require("./CurveCollection");
|
|
15
|
-
const CurveExtendMode_1 = require("./CurveExtendMode");
|
|
16
|
-
const CurveLocationDetail_1 = require("./CurveLocationDetail");
|
|
17
11
|
const CurvePrimitive_1 = require("./CurvePrimitive");
|
|
18
12
|
const LineString3d_1 = require("./LineString3d");
|
|
19
13
|
/**
|
|
@@ -56,7 +50,7 @@ class Path extends CurveCollection_1.CurveChain {
|
|
|
56
50
|
return result;
|
|
57
51
|
}
|
|
58
52
|
/**
|
|
59
|
-
* Create a path from
|
|
53
|
+
* Create a path from an array of curve primitives.
|
|
60
54
|
* @param curves array of individual curve primitives.
|
|
61
55
|
*/
|
|
62
56
|
static createArray(curves) {
|
|
@@ -69,34 +63,6 @@ class Path extends CurveCollection_1.CurveChain {
|
|
|
69
63
|
curve.emitStrokes(strokes, options);
|
|
70
64
|
return Path.create(strokes);
|
|
71
65
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Return the closest point on the contained curves.
|
|
74
|
-
* @param spacePoint point in space.
|
|
75
|
-
* @param extend compute the closest point to the path extended according to variant type:
|
|
76
|
-
* * false: do not extend the path
|
|
77
|
-
* * true: extend the path at both start and end
|
|
78
|
-
* * CurveExtendOptions: extend the path in the specified manner at both start and end
|
|
79
|
-
* * CurveExtendOptions[]: first entry applies to path start; second, to path end; any other entries ignored
|
|
80
|
-
* @param result optional pre-allocated detail to populate and return.
|
|
81
|
-
* @returns details of the closest point.
|
|
82
|
-
*/
|
|
83
|
-
closestPoint(spacePoint, extend = false, result) {
|
|
84
|
-
let detailA;
|
|
85
|
-
const detailB = new CurveLocationDetail_1.CurveLocationDetail();
|
|
86
|
-
if (this.children !== undefined) {
|
|
87
|
-
for (let i = 0; i < this.children.length; i++) {
|
|
88
|
-
const child = this.children[i]; // head only extends at start; tail, only at end. NOTE: child may be both head and tail!
|
|
89
|
-
const mode0 = (i === 0) ? CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0) : CurveExtendMode_1.CurveExtendMode.None;
|
|
90
|
-
const mode1 = (i === this.children.length - 1) ? CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1) : CurveExtendMode_1.CurveExtendMode.None;
|
|
91
|
-
if (child.closestPoint(spacePoint, [mode0, mode1], detailB)) {
|
|
92
|
-
const smaller = CurveLocationDetail_1.CurveLocationDetail.chooseSmallerA(detailA, detailB);
|
|
93
|
-
(0, core_bentley_1.assert)(undefined !== smaller, "expect defined because detailB is always defined");
|
|
94
|
-
detailA = result = smaller.clone(result);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return detailA;
|
|
99
|
-
}
|
|
100
66
|
/** Return the boundary type (1) of a corresponding MicroStation CurveVector */
|
|
101
67
|
dgnBoundaryType() {
|
|
102
68
|
return 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;
|
|
1
|
+
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../src/curve/Path.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,mEAAwD;AACxD,+EAA4E;AAC5E,uDAA+C;AAC/C,qDAAkD;AAGlD,iDAA8C;AAG9C;;;;;GAKG;AACH,MAAa,IAAK,SAAQ,4BAAU;IAClC,wCAAwC;IACxB,mBAAmB,GAAG,MAAM,CAAC;IAC7C,+CAA+C;IACxC,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,IAAI,CAAC;IAC/B,CAAC;IACD,2DAA2D;IACpD,wBAAwB,CAAC,SAAkC,EAAE,gBAAwB,CAAC,CAAC;QAC5F,OAAO,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IACD,+BAA+B;IAC/B;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,GAAG,MAAyC;QAC/D,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,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cesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\r\nimport { CurveChain } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * * A `Path` object is a collection of curves that join head-to-tail to form a path.\r\n * * A `Path` object does not bound a planar region. Use `Loop` to indicate region bounding.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport class Path extends CurveChain {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"path\";\r\n /** Test if `other` is an instance of `Path` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof Path;\r\n }\r\n /** Invoke `processor.announcePath(this, indexInParent)` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announcePath(this, indexInParent);\r\n }\r\n /** Construct an empty path. */\r\n public constructor() {\r\n super();\r\n }\r\n /**\r\n * Create a path from a variable length list of curve primitives\r\n * * CurvePrimitive params are captured.\r\n * @param curves variable length list of individual curve primitives or point arrays.\r\n */\r\n public static create(...curves: Array<CurvePrimitive | Point3d[]>): Path {\r\n const result = new Path();\r\n for (const curve of curves) {\r\n if (curve instanceof CurveChainWithDistanceIndex)\r\n result.children.push(...curve.path.children);\r\n else if (curve instanceof CurvePrimitive)\r\n result.children.push(curve);\r\n else if (Array.isArray(curve) && curve.length > 0 && curve[0] instanceof Point3d) {\r\n result.children.push(LineString3d.create(curve));\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Create a path from an array of curve primitives.\r\n * @param curves array of individual curve primitives.\r\n */\r\n public static createArray(curves: CurvePrimitive[]): Path {\r\n return this.create(...curves);\r\n }\r\n /** Return a deep copy, with leaf-level curve primitives stroked. */\r\n public cloneStroked(options?: StrokeOptions): Path {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n return Path.create(strokes);\r\n }\r\n /** Return the boundary type (1) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 1;\r\n }\r\n /** Clone as a new `Path` with no primitives */\r\n public cloneEmptyPeer(): Path {\r\n return new Path();\r\n }\r\n /** Second step of double dispatch: call `handler.handlePath(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handlePath(this);\r\n }\r\n}\r\n"]}
|
|
@@ -16,6 +16,7 @@ export declare class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler i
|
|
|
16
16
|
private _closestPoint;
|
|
17
17
|
private _spacePoint;
|
|
18
18
|
private _extend;
|
|
19
|
+
private _xyOnly;
|
|
19
20
|
private _fractionA;
|
|
20
21
|
private _functionA;
|
|
21
22
|
private _fractionB;
|
|
@@ -25,7 +26,7 @@ export declare class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler i
|
|
|
25
26
|
private _workRay;
|
|
26
27
|
private _newtonSolver;
|
|
27
28
|
/** Constructor */
|
|
28
|
-
constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail);
|
|
29
|
+
constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail, xyOnly?: boolean);
|
|
29
30
|
claimResult(): CurveLocationDetail | undefined;
|
|
30
31
|
needPrimaryGeometryForStrokes(): boolean;
|
|
31
32
|
startCurvePrimitive(curve: CurvePrimitive | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClosestPointStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ClosestPointStrokeHandler.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIrE,OAAO,EAAuC,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,uBAAwB,YAAW,cAAc;IAC9F,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,aAAa,CAAkC;IACvD,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,OAAO,CAAU;IAEzB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAa;IAE/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,aAAa,CAAa;IAElC,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,aAAa,CAAyC;IAC9D,kBAAkB;gBACC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,OAAO;IAarH,WAAW,IAAI,mBAAmB,GAAG,SAAS;IAY9C,6BAA6B;IAG7B,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS;IAMrD,iBAAiB;IAEjB,qCAAqC,CAC1C,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAC3E,IAAI;IAaP,OAAO,CAAC,iBAAiB;IASlB,uBAAuB,CAC5B,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAC9G,IAAI;IAcP;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,wBAAwB;IAIhC;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IAYjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAU1C,OAAO,CAAC,WAAW;IAUZ,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ;CAIhF"}
|
|
@@ -13,6 +13,7 @@ const Geometry_1 = require("../../Geometry");
|
|
|
13
13
|
const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
|
|
14
14
|
const Ray3d_1 = require("../../geometry3d/Ray3d");
|
|
15
15
|
const Newton_1 = require("../../numerics/Newton");
|
|
16
|
+
const SmallSystem_1 = require("../../numerics/SmallSystem");
|
|
16
17
|
const CurveExtendMode_1 = require("../CurveExtendMode");
|
|
17
18
|
const CurveLocationDetail_1 = require("../CurveLocationDetail");
|
|
18
19
|
const NewtonRtoRStrokeHandler_1 = require("./NewtonRtoRStrokeHandler");
|
|
@@ -25,6 +26,7 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
25
26
|
_closestPoint;
|
|
26
27
|
_spacePoint;
|
|
27
28
|
_extend;
|
|
29
|
+
_xyOnly;
|
|
28
30
|
// fraction and function value on one side of an interval that may bracket a root
|
|
29
31
|
_fractionA = 0;
|
|
30
32
|
_functionA = 0;
|
|
@@ -37,7 +39,7 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
37
39
|
_workRay;
|
|
38
40
|
_newtonSolver;
|
|
39
41
|
/** Constructor */
|
|
40
|
-
constructor(spacePoint, extend, result) {
|
|
42
|
+
constructor(spacePoint, extend, result, xyOnly) {
|
|
41
43
|
super();
|
|
42
44
|
this._spacePoint = spacePoint;
|
|
43
45
|
this._workPoint = Point3dVector3d_1.Point3d.create();
|
|
@@ -46,6 +48,7 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
46
48
|
if (this._closestPoint)
|
|
47
49
|
this._closestPoint.a = Geometry_1.Geometry.largeCoordinateResult;
|
|
48
50
|
this._extend = extend ?? false;
|
|
51
|
+
this._xyOnly = xyOnly ?? false;
|
|
49
52
|
this.startCurvePrimitive(undefined);
|
|
50
53
|
this._newtonSolver = new Newton_1.Newton1dUnboundedApproximateDerivative(this);
|
|
51
54
|
}
|
|
@@ -86,7 +89,7 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
announceCandidate(cp, fraction, point) {
|
|
89
|
-
const distance = this._spacePoint.distance(point);
|
|
92
|
+
const distance = this._xyOnly ? this._spacePoint.distanceXY(point) : this._spacePoint.distance(point);
|
|
90
93
|
if (this._closestPoint && distance > this._closestPoint.a)
|
|
91
94
|
return;
|
|
92
95
|
this._closestPoint = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);
|
|
@@ -95,16 +98,15 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
95
98
|
this._closestPoint.curve = this._parentCurvePrimitive;
|
|
96
99
|
}
|
|
97
100
|
announceSegmentInterval(cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
98
|
-
let localFraction =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
101
|
+
let localFraction = 0;
|
|
102
|
+
if (this._xyOnly)
|
|
103
|
+
localFraction = SmallSystem_1.SmallSystem.lineSegment3dXYClosestPointUnbounded(point0, point1, this._spacePoint) ?? 0;
|
|
104
|
+
else
|
|
105
|
+
localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);
|
|
106
|
+
// only consider segment extension at a parent curve endpoint, i.e. when fraction0 is 0 or fraction1 is 1
|
|
107
|
+
const extend0 = (fraction0 === 0) ? CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 0) : CurveExtendMode_1.CurveExtendMode.None;
|
|
108
|
+
const extend1 = (fraction1 === 1) ? CurveExtendMode_1.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 1) : CurveExtendMode_1.CurveExtendMode.None;
|
|
109
|
+
localFraction = CurveExtendMode_1.CurveExtendOptions.correctFraction([extend0, extend1], localFraction);
|
|
108
110
|
this._workPoint = point0.interpolate(localFraction, point1);
|
|
109
111
|
const globalFraction = Geometry_1.Geometry.interpolate(fraction0, localFraction, fraction1);
|
|
110
112
|
this.announceCandidate(cp, globalFraction, this._workPoint);
|
|
@@ -153,7 +155,10 @@ class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler_1.NewtonRtoRStro
|
|
|
153
155
|
this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);
|
|
154
156
|
else
|
|
155
157
|
return undefined;
|
|
156
|
-
|
|
158
|
+
if (this._xyOnly)
|
|
159
|
+
return this._workRay.dotProductToPointXY(this._spacePoint);
|
|
160
|
+
else
|
|
161
|
+
return this._workRay.dotProductToPoint(this._spacePoint);
|
|
157
162
|
}
|
|
158
163
|
evaluate(fraction) {
|
|
159
164
|
let curve = this._curve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClosestPointStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAA0C;AAE1C,sEAAqE;AACrE,kDAA+C;AAC/C,kDAA+E;AAC/E,wDAAqF;AACrF,gEAA6D;AAE7D,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iDAAuB;IAC5D,MAAM,CAA6B;IACnC,aAAa,CAAkC;IAC/C,WAAW,CAAU;IACrB,OAAO,CAA8B;IAC7C,iFAAiF;IACzE,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IAC/B,uFAAuF;IAC/E,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IACvB,aAAa,GAAW,CAAC,CAAC;IAClC,qCAAqC;IAC7B,UAAU,CAAU;IACpB,QAAQ,CAAQ;IAChB,aAAa,CAAyC;IAC9D,kBAAkB;IAClB,YAAmB,UAAmB,EAAE,MAAoC,EAAE,MAA4B;QACxG,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,aAAK,CAAC,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,IAAI,CAAC,aA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K,KAAK,SAAS;YACrB,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACO,WAAW,CAAC,QAAgB,EAAE,IAAW;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAA,qBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,iFAAiF,CAAC,CAAC;QAC/G,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,oFAAoF;YAChH,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACM,oBAAoB,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAiB;QAC7E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAnKD,8DAmKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Newton1dUnboundedApproximateDerivative } from \"../../numerics/Newton\";\r\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"../CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { NewtonRtoRStrokeHandler } from \"./NewtonRtoRStrokeHandler\";\r\n\r\n/**\r\n * Context for searching for the closest point to a CurvePrimitive.\r\n * @internal\r\n */\r\nexport class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _closestPoint: CurveLocationDetail | undefined;\r\n private _spacePoint: Point3d;\r\n private _extend: VariantCurveExtendParameter;\r\n // fraction and function value on one side of an interval that may bracket a root\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // fraction and function value on the other side of an interval that may bracket a root\r\n private _fractionB: number = 0;\r\n private _functionB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars to use within methods\r\n private _workPoint: Point3d;\r\n private _workRay: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n /** Constructor */\r\n public constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail) {\r\n super();\r\n this._spacePoint = spacePoint;\r\n this._workPoint = Point3d.create();\r\n this._workRay = Ray3d.createZero();\r\n this._closestPoint = result;\r\n if (this._closestPoint)\r\n this._closestPoint.a = Geometry.largeCoordinateResult\r\n this._extend = extend ?? false;\r\n this.startCurvePrimitive(undefined);\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n public claimResult(): CurveLocationDetail | undefined {\r\n if (this._closestPoint) {\r\n this._newtonSolver.setX(this._closestPoint.fraction);\r\n this._curve = this._closestPoint.curve;\r\n if (this._newtonSolver.runIterations()) {\r\n let fraction = this._newtonSolver.getX();\r\n fraction = CurveExtendOptions.correctFraction(this._extend, fraction);\r\n this.announceSolutionFraction(fraction);\r\n }\r\n }\r\n return this._closestPoint;\r\n }\r\n public needPrimaryGeometryForStrokes() {\r\n return true;\r\n }\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n }\r\n public endCurvePrimitive() {\r\n }\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n this.startCurvePrimitive(cp);\r\n this.announceSolutionFraction(0.0); // test start point as closest\r\n this.announceSolutionFraction(1.0); // test end point as closest\r\n if (numStrokes < 1)\r\n numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._workRay);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n }\r\n private announceCandidate(cp: CurvePrimitive, fraction: number, point: Point3d) {\r\n const distance = this._spacePoint.distance(point);\r\n if (this._closestPoint && distance > this._closestPoint.a)\r\n return;\r\n this._closestPoint = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);\r\n this._closestPoint.a = distance;\r\n if (this._parentCurvePrimitive !== undefined)\r\n this._closestPoint.curve = this._parentCurvePrimitive;\r\n }\r\n public announceSegmentInterval(\r\n cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n let localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);\r\n // only consider extending the segment if the immediate caller says we are at endpoints\r\n if (!this._extend)\r\n localFraction = Geometry.clampToStartEnd(localFraction, 0.0, 1.0);\r\n else {\r\n if (fraction0 !== 0.0)\r\n localFraction = Math.max(localFraction, 0.0);\r\n if (fraction1 !== 1.0)\r\n localFraction = Math.min(localFraction, 1.0);\r\n }\r\n this._workPoint = point0.interpolate(localFraction, point1);\r\n const globalFraction = Geometry.interpolate(fraction0, localFraction, fraction1);\r\n this.announceCandidate(cp, globalFraction, this._workPoint);\r\n }\r\n /**\r\n * Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this\r\n * fractional interval.\r\n * * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and\r\n * `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke\r\n * segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,\r\n * this method can miss a root of `f`.\r\n */\r\n private searchInterval() {\r\n if (this._functionA * this._functionB > 0)\r\n return; // stroke segment has no root; ASSUME the function has no root either\r\n if (this._functionA === 0)\r\n this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0)\r\n this.announceSolutionFraction(this._fractionB);\r\n // by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n private announceSolutionFraction(fraction: number) {\r\n if (this._curve)\r\n this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));\r\n }\r\n /**\r\n * Evaluate the univariate real-valued function for which we are finding roots.\r\n * * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.\r\n * * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.\r\n * @param pointAndDerivative pre-evaluated curve\r\n * @param fraction fraction at which to evaluate `curve`\r\n * @param curve curve to evaluate at `fraction`\r\n */\r\n private evaluateFunction(pointAndDerivative?: Ray3d, fraction?: number, curve?: CurvePrimitive): number | undefined {\r\n if (pointAndDerivative)\r\n this._workRay.setFrom(pointAndDerivative);\r\n else if (fraction !== undefined && curve)\r\n this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);\r\n else\r\n return undefined;\r\n return this._workRay.dotProductToPoint(this._spacePoint);\r\n }\r\n public evaluate(fraction: number): boolean {\r\n let curve = this._curve;\r\n if (this._parentCurvePrimitive)\r\n curve = this._parentCurvePrimitive;\r\n const value = this.evaluateFunction(undefined, fraction, curve);\r\n if (value === undefined)\r\n return false;\r\n this.currentF = value;\r\n return true;\r\n }\r\n private announceRay(fraction: number, data: Ray3d): void {\r\n const value = this.evaluateFunction(data);\r\n assert(value !== undefined, \"expect defined because evaluateFunction never returns undefined for input Ray3d\");\r\n this._functionB = value;\r\n this._fractionB = fraction;\r\n if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval\r\n this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n public announcePointTangent(point: Point3d, fraction: number, tangent: Vector3d) {\r\n this._workRay.set(point, tangent);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClosestPointStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAA0C;AAE1C,sEAAqE;AACrE,kDAA+C;AAC/C,kDAA+E;AAC/E,4DAAyD;AACzD,wDAAsG;AACtG,gEAA6D;AAE7D,uEAAoE;AAEpE;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,iDAAuB;IAC5D,MAAM,CAA6B;IACnC,aAAa,CAAkC;IAC/C,WAAW,CAAU;IACrB,OAAO,CAA8B;IACrC,OAAO,CAAU;IACzB,iFAAiF;IACzE,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IAC/B,uFAAuF;IAC/E,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IACvB,aAAa,GAAW,CAAC,CAAC;IAClC,qCAAqC;IAC7B,UAAU,CAAU;IACpB,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UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,oFAAoF;YAChH,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACM,oBAAoB,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAiB;QAC7E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAvKD,8DAuKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Newton1dUnboundedApproximateDerivative } from \"../../numerics/Newton\";\r\nimport { SmallSystem } from \"../../numerics/SmallSystem\";\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { NewtonRtoRStrokeHandler } from \"./NewtonRtoRStrokeHandler\";\r\n\r\n/**\r\n * Context for searching for the closest point to a CurvePrimitive.\r\n * @internal\r\n */\r\nexport class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _closestPoint: CurveLocationDetail | undefined;\r\n private _spacePoint: Point3d;\r\n private _extend: VariantCurveExtendParameter;\r\n private _xyOnly: boolean;\r\n // fraction and function value on one side of an interval that may bracket a root\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // fraction and function value on the other side of an interval that may bracket a root\r\n private _fractionB: number = 0;\r\n private _functionB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars to use within methods\r\n private _workPoint: Point3d;\r\n private _workRay: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n /** Constructor */\r\n public constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail, xyOnly?: boolean) {\r\n super();\r\n this._spacePoint = spacePoint;\r\n this._workPoint = Point3d.create();\r\n this._workRay = Ray3d.createZero();\r\n this._closestPoint = result;\r\n if (this._closestPoint)\r\n this._closestPoint.a = Geometry.largeCoordinateResult\r\n this._extend = extend ?? false;\r\n this._xyOnly = xyOnly ?? false;\r\n this.startCurvePrimitive(undefined);\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n public claimResult(): CurveLocationDetail | undefined {\r\n if (this._closestPoint) {\r\n this._newtonSolver.setX(this._closestPoint.fraction);\r\n this._curve = this._closestPoint.curve;\r\n if (this._newtonSolver.runIterations()) {\r\n let fraction = this._newtonSolver.getX();\r\n fraction = CurveExtendOptions.correctFraction(this._extend, fraction);\r\n this.announceSolutionFraction(fraction);\r\n }\r\n }\r\n return this._closestPoint;\r\n }\r\n public needPrimaryGeometryForStrokes() {\r\n return true;\r\n }\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n }\r\n public endCurvePrimitive() {\r\n }\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n this.startCurvePrimitive(cp);\r\n this.announceSolutionFraction(0.0); // test start point as closest\r\n this.announceSolutionFraction(1.0); // test end point as closest\r\n if (numStrokes < 1)\r\n numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._workRay);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n }\r\n private announceCandidate(cp: CurvePrimitive, fraction: number, point: Point3d) {\r\n const distance = this._xyOnly ? this._spacePoint.distanceXY(point) : this._spacePoint.distance(point);\r\n if (this._closestPoint && distance > this._closestPoint.a)\r\n return;\r\n this._closestPoint = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);\r\n this._closestPoint.a = distance;\r\n if (this._parentCurvePrimitive !== undefined)\r\n this._closestPoint.curve = this._parentCurvePrimitive;\r\n }\r\n public announceSegmentInterval(\r\n cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n let localFraction = 0;\r\n if (this._xyOnly)\r\n localFraction = SmallSystem.lineSegment3dXYClosestPointUnbounded(point0, point1, this._spacePoint) ?? 0;\r\n else\r\n localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);\r\n // only consider segment extension at a parent curve endpoint, i.e. when fraction0 is 0 or fraction1 is 1\r\n const extend0 = (fraction0 === 0) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 0) : CurveExtendMode.None;\r\n const extend1 = (fraction1 === 1) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 1) : CurveExtendMode.None;\r\n localFraction = CurveExtendOptions.correctFraction([extend0, extend1], localFraction);\r\n this._workPoint = point0.interpolate(localFraction, point1);\r\n const globalFraction = Geometry.interpolate(fraction0, localFraction, fraction1);\r\n this.announceCandidate(cp, globalFraction, this._workPoint);\r\n }\r\n /**\r\n * Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this\r\n * fractional interval.\r\n * * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and\r\n * `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke\r\n * segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,\r\n * this method can miss a root of `f`.\r\n */\r\n private searchInterval() {\r\n if (this._functionA * this._functionB > 0)\r\n return; // stroke segment has no root; ASSUME the function has no root either\r\n if (this._functionA === 0)\r\n this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0)\r\n this.announceSolutionFraction(this._fractionB);\r\n // by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n private announceSolutionFraction(fraction: number) {\r\n if (this._curve)\r\n this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));\r\n }\r\n /**\r\n * Evaluate the univariate real-valued function for which we are finding roots.\r\n * * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.\r\n * * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.\r\n * @param pointAndDerivative pre-evaluated curve\r\n * @param fraction fraction at which to evaluate `curve`\r\n * @param curve curve to evaluate at `fraction`\r\n */\r\n private evaluateFunction(pointAndDerivative?: Ray3d, fraction?: number, curve?: CurvePrimitive): number | undefined {\r\n if (pointAndDerivative)\r\n this._workRay.setFrom(pointAndDerivative);\r\n else if (fraction !== undefined && curve)\r\n this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);\r\n else\r\n return undefined;\r\n if (this._xyOnly)\r\n return this._workRay.dotProductToPointXY(this._spacePoint);\r\n else\r\n return this._workRay.dotProductToPoint(this._spacePoint);\r\n }\r\n public evaluate(fraction: number): boolean {\r\n let curve = this._curve;\r\n if (this._parentCurvePrimitive)\r\n curve = this._parentCurvePrimitive;\r\n const value = this.evaluateFunction(undefined, fraction, curve);\r\n if (value === undefined)\r\n return false;\r\n this.currentF = value;\r\n return true;\r\n }\r\n private announceRay(fraction: number, data: Ray3d): void {\r\n const value = this.evaluateFunction(data);\r\n assert(value !== undefined, \"expect defined because evaluateFunction never returns undefined for input Ray3d\");\r\n this._functionB = value;\r\n this._fractionB = fraction;\r\n if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval\r\n this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n public announcePointTangent(point: Point3d, fraction: number, tangent: Vector3d) {\r\n this._workRay.set(point, tangent);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n}\r\n"]}
|
|
@@ -183,7 +183,8 @@ export declare class Ellipsoid implements Clipper {
|
|
|
183
183
|
* @param angleB end point of arc (given as angles on this ellipsoid)
|
|
184
184
|
* @returns arc in the plane defined by the normal at the intermediate point. If calculation fails, return an
|
|
185
185
|
* arc with zero matrix.
|
|
186
|
-
* @deprecated in 5.1.9 - will not be removed until after 2027-01-05. Prefer [[sectionArcInPlaneOfInterpolatedNormal]],
|
|
186
|
+
* @deprecated in 5.1.9 - will not be removed until after 2027-01-05. Prefer [[sectionArcInPlaneOfInterpolatedNormal]],
|
|
187
|
+
* which has expanded return type.
|
|
187
188
|
*/
|
|
188
189
|
sectionArcWithIntermediateNormal(angleA: LongitudeLatitudeNumber, intermediateNormalFraction: number, angleB: LongitudeLatitudeNumber): Arc3d;
|
|
189
190
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ellipsoid.d.ts","sourceRoot":"","sources":["../../../src/geometry3d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,uBAAuB;CAG3C;AACD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO;IAIP;;;;;;;OAOG;WACW,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,EAC3D,WAAW,EAAE,uBAAuB,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,iBAAiB,EAAE,GAAG,SAAS;IAsDrI,OAAO,CAAC,uCAAuC;IAc/C,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,KAAK;IAGb;;;;;;;;;;OAUG;WACW,kCAAkC,CAAC,SAAS,EAAE,SAAS,EACnE,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAClD,4BAA4B,EAAE,MAAM,EACpC,4BAA4B,EAAE,MAAM,GAAG;QAAE,YAAY,EAAE,KAAK,CAAC;QAAC,oCAAoC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CA6B3H"}
|
|
@@ -521,7 +521,8 @@ class Ellipsoid {
|
|
|
521
521
|
* @param angleB end point of arc (given as angles on this ellipsoid)
|
|
522
522
|
* @returns arc in the plane defined by the normal at the intermediate point. If calculation fails, return an
|
|
523
523
|
* arc with zero matrix.
|
|
524
|
-
* @deprecated in 5.1.9 - will not be removed until after 2027-01-05. Prefer [[sectionArcInPlaneOfInterpolatedNormal]],
|
|
524
|
+
* @deprecated in 5.1.9 - will not be removed until after 2027-01-05. Prefer [[sectionArcInPlaneOfInterpolatedNormal]],
|
|
525
|
+
* which has expanded return type.
|
|
525
526
|
*/
|
|
526
527
|
sectionArcWithIntermediateNormal(angleA, intermediateNormalFraction, angleB) {
|
|
527
528
|
const arc = this.sectionArcInPlaneOfInterpolatedNormal(angleA, intermediateNormalFraction, angleB);
|