@itwin/core-geometry 5.12.0-dev.13 → 5.12.0-dev.14

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.
Files changed (61) hide show
  1. package/lib/cjs/bspline/AkimaCurve3d.d.ts +5 -0
  2. package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
  3. package/lib/cjs/bspline/AkimaCurve3d.js +8 -0
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/InterpolationCurve3d.d.ts +5 -0
  6. package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
  7. package/lib/cjs/bspline/InterpolationCurve3d.js +8 -0
  8. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  9. package/lib/cjs/curve/CurveCollection.d.ts +2 -0
  10. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  11. package/lib/cjs/curve/CurveCollection.js +5 -0
  12. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  13. package/lib/cjs/curve/CurvePrimitive.d.ts +2 -0
  14. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurvePrimitive.js +5 -0
  16. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  17. package/lib/cjs/curve/RegionOps.d.ts +60 -6
  18. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  19. package/lib/cjs/curve/RegionOps.js +241 -79
  20. package/lib/cjs/curve/RegionOps.js.map +1 -1
  21. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +2 -3
  22. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  23. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +4 -5
  24. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  25. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
  26. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  27. package/lib/cjs/topology/Graph.d.ts +5 -2
  28. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  29. package/lib/cjs/topology/Graph.js +5 -2
  30. package/lib/cjs/topology/Graph.js.map +1 -1
  31. package/lib/esm/bspline/AkimaCurve3d.d.ts +5 -0
  32. package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
  33. package/lib/esm/bspline/AkimaCurve3d.js +8 -0
  34. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  35. package/lib/esm/bspline/InterpolationCurve3d.d.ts +5 -0
  36. package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
  37. package/lib/esm/bspline/InterpolationCurve3d.js +8 -0
  38. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  39. package/lib/esm/curve/CurveCollection.d.ts +2 -0
  40. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  41. package/lib/esm/curve/CurveCollection.js +5 -0
  42. package/lib/esm/curve/CurveCollection.js.map +1 -1
  43. package/lib/esm/curve/CurvePrimitive.d.ts +2 -0
  44. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  45. package/lib/esm/curve/CurvePrimitive.js +5 -0
  46. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  47. package/lib/esm/curve/RegionOps.d.ts +60 -6
  48. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  49. package/lib/esm/curve/RegionOps.js +241 -79
  50. package/lib/esm/curve/RegionOps.js.map +1 -1
  51. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +2 -3
  52. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  53. package/lib/esm/curve/RegionOpsClassificationSweeps.js +4 -5
  54. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  55. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +1 -1
  56. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  57. package/lib/esm/topology/Graph.d.ts +5 -2
  58. package/lib/esm/topology/Graph.d.ts.map +1 -1
  59. package/lib/esm/topology/Graph.js +5 -2
  60. package/lib/esm/topology/Graph.js.map +1 -1
  61. package/package.json +5 -5
@@ -9,6 +9,7 @@ import { GeometryHandler } from "../geometry3d/GeometryHandler";
9
9
  import { Point3d } from "../geometry3d/Point3dVector3d";
10
10
  import { Transform } from "../geometry3d/Transform";
11
11
  import { XYZProps } from "../geometry3d/XYZProps";
12
+ import { BSplineCurve3d } from "./BSplineCurve";
12
13
  /**
13
14
  * fitPoints [[AkimaCurve3d]]
14
15
  * * This is a "json compatible" version of the serializer-friendly [[AkimaCurve3dOptions]]
@@ -69,6 +70,8 @@ export declare class AkimaCurve3d extends ProxyCurve {
69
70
  * * The options object is captured into the new curve object (not copied)
70
71
  */
71
72
  static createCapture(options: AkimaCurve3dOptions): AkimaCurve3d | undefined;
73
+ /** Return the (pointer to) the proxy B-spline curve. */
74
+ get proxyCurve(): BSplineCurve3d;
72
75
  /** Return a (copy of) the defining points, packed as a Float64Array */
73
76
  copyFitPointsFloat64Array(): Float64Array;
74
77
  /**
@@ -97,6 +100,8 @@ export declare class AkimaCurve3d extends ProxyCurve {
97
100
  announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
98
101
  /** Return a deep clone */
99
102
  clone(): AkimaCurve3d;
103
+ /** Return a transformed clone. */
104
+ cloneTransformed(transform: Transform): AkimaCurve3d | undefined;
100
105
  /** Test if `other` is also an [[AkimaCurve3d]] */
101
106
  isSameGeometryClass(other: GeometryQuery): boolean;
102
107
  isAlmostEqual(other: GeometryQuery): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AkimaCurve3d.d.ts","sourceRoot":"","sources":["../../../src/bspline/AkimaCurve3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kCAAkC,EAAkB,MAAM,yBAAyB,CAAC;AAC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"}
@@ -106,6 +106,10 @@ class AkimaCurve3d extends ProxyCurve_1.ProxyCurve {
106
106
  return new AkimaCurve3d(options, proxyCurve);
107
107
  return undefined;
108
108
  }
109
+ /** Return the (pointer to) the proxy B-spline curve. */
110
+ get proxyCurve() {
111
+ return this._proxyCurve;
112
+ }
109
113
  /** Return a (copy of) the defining points, packed as a Float64Array */
110
114
  copyFitPointsFloat64Array() {
111
115
  return PointHelpers_1.Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);
@@ -153,6 +157,10 @@ class AkimaCurve3d extends ProxyCurve_1.ProxyCurve {
153
157
  clone() {
154
158
  return new AkimaCurve3d(this._options.clone(), this._proxyCurve.clone());
155
159
  }
160
+ /** Return a transformed clone. */
161
+ cloneTransformed(transform) {
162
+ return super.cloneTransformed(transform);
163
+ }
156
164
  /** Test if `other` is also an [[AkimaCurve3d]] */
157
165
  isSameGeometryClass(other) { return other instanceof AkimaCurve3d; }
158
166
  isAlmostEqual(other) {
@@ -1 +1 @@
1
- {"version":3,"file":"AkimaCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/AkimaCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,oDAAiD;AACjD,0CAAuC;AAGvC,6DAA0D;AAG1D,iDAAgD;AAYhD;;;;;GAKG;AACH,MAAa,mBAAmB;IACvB,SAAS,CAAY;IAC5B;;;;OAIG;IACH,YAAmB,SAAqB;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,CAAC;IAEF;;;;mEAI+D;IACvD,wBAAwB;QAC7B,MAAM,KAAK,GAAG;YACZ,SAAS,EAAE,2BAAY,CAAC,yBAAyB,CAAC,IAAI,CAAC,SAAS,CAAC;SAClE,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;IACH,gEAAgE;IACvD,KAAK;QACV,MAAM,KAAK,GAAG,IAAI,mBAA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,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;;;OAMG;IACa,qBAAqB,CAAC,OAAgB,EAAE,QAA6C;QACnG,OAAO,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IACD,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC;IAEnF,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;YAClC,OAAO,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAnGD,oCAmGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\n\n/**\n * fitPoints [[AkimaCurve3d]]\n * * This is a \"json compatible\" version of the serializer-friendly [[AkimaCurve3dOptions]]\n * @public\n */\n export interface AkimaCurve3dProps {\n /** Points that the curve must pass through */\n fitPoints: XYZProps[];\n}\n\n/**\n * fitPoints and end condition data for [[AkimaCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[AkimaCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class AkimaCurve3dOptions {\n public fitPoints: Point3d[];\n /**\n *\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[]) {\n this.fitPoints = fitPoints ? fitPoints : [];\n }\n\n /** Points that the curve must pass through.\n * First and last 2 points are \"beyond the end\" for control of end slope.\n fitPoints: Point3d[];\n\n/** Clone with strongly typed members reduced to simple json. */\n public cloneAsAkimaCurve3dProps(): AkimaCurve3dProps {\n const props = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n };\n return props;\n }\n/** Clone with strongly typed members reduced to simple json. */\n public clone(): AkimaCurve3dOptions {\n const clone = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints));\n return clone;\n }\n\n/** Clone with strongly typed members reduced to simple json. */\npublic static create(source: AkimaCurve3dProps): AkimaCurve3dOptions {\n const result = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints));\n return result;\n}\n\n public static areAlmostEqual(dataA: AkimaCurve3dOptions | undefined, dataB: AkimaCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n return Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b));\n }\n return false;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class AkimaCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: AkimaCurve3dOptions;\n /** CAPTURE properties and proxy curve. */\n private constructor(properties: AkimaCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n /** Second step of double dispatch: call `handler.handleAkimaCurve3d(this)` */\n public override dispatchToGeometryHandler(handler: GeometryHandler) {\n let result = handler.handleAkimaCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on Akima curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n/**\n * Create an [[AkimaCurve3d]] based on points, knots, and other properties in the [[AkimaCurve3dProps]] or [[AkimaCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: AkimaCurve3dOptions | AkimaCurve3dProps): AkimaCurve3d | undefined {\n let optionsCopy;\n if (options instanceof AkimaCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = AkimaCurve3dOptions.create(options);\n }\n return AkimaCurve3d.createCapture(optionsCopy);\n }\n /**\n * Create an [[AkimaCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: AkimaCurve3dOptions): AkimaCurve3d | undefined{\n const proxyCurve = BSplineCurve3d.createFromAkimaCurve3dOptions(options);\n if (proxyCurve)\n return new AkimaCurve3d(options, proxyCurve);\n return undefined;\n }\n\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[AkimaCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n /** Clone the [[AkimaCurve3dProps]] object in this [[AkimaCurve3dProps]] */\n public cloneProps(): AkimaCurve3dProps {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.fitPoints.reverse();\n }\n /**\n * Transform this [[AkimaCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArray(this._options.fitPoints);\n }\n return proxyOk;\n }\n /**\n * Find intervals of this CurvePrimitive that are interior to a clipper.\n * * This implementation simply passes the call to the proxy curve.\n * @param clipper clip structure (e.g. clip planes).\n * @param announce (optional) function to be called announcing fractional intervals of the input curve.\n * @returns true if any \"in\" segments are announced.\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return this._proxyCurve.announceClipIntervals(clipper, announce);\n }\n /** Return a deep clone */\n public override clone(): AkimaCurve3d {\n return new AkimaCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n\n /** Test if `other` is also an [[AkimaCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof AkimaCurve3d; }\n\n public override isAlmostEqual(other: GeometryQuery): boolean{\n if (other instanceof AkimaCurve3d) {\n return AkimaCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"AkimaCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/AkimaCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,oDAAiD;AACjD,0CAAuC;AAGvC,6DAA0D;AAG1D,iDAAgD;AAYhD;;;;;GAKG;AACH,MAAa,mBAAmB;IACvB,SAAS,CAAY;IAC5B;;;;OAIG;IACH,YAAmB,SAAqB;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,CAAC;IAEF;;;;mEA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cAAc;QACnB,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IACD;;OAEG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;;;OAMG;IACa,qBAAqB,CAAC,OAAgB,EAAE,QAA6C;QACnG,OAAO,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IACD,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,kCAAkC;IAClB,gBAAgB,CAAC,SAAoB;QACnD,OAAO,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAA6B,CAAC;IACvE,CAAC;IAED,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC;IAEnF,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;YAClC,OAAO,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA1GD,oCA0GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\n\n/**\n * fitPoints [[AkimaCurve3d]]\n * * This is a \"json compatible\" version of the serializer-friendly [[AkimaCurve3dOptions]]\n * @public\n */\n export interface AkimaCurve3dProps {\n /** Points that the curve must pass through */\n fitPoints: XYZProps[];\n}\n\n/**\n * fitPoints and end condition data for [[AkimaCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[AkimaCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class AkimaCurve3dOptions {\n public fitPoints: Point3d[];\n /**\n *\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[]) {\n this.fitPoints = fitPoints ? fitPoints : [];\n }\n\n /** Points that the curve must pass through.\n * First and last 2 points are \"beyond the end\" for control of end slope.\n fitPoints: Point3d[];\n\n/** Clone with strongly typed members reduced to simple json. */\n public cloneAsAkimaCurve3dProps(): AkimaCurve3dProps {\n const props = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n };\n return props;\n }\n/** Clone with strongly typed members reduced to simple json. */\n public clone(): AkimaCurve3dOptions {\n const clone = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints));\n return clone;\n }\n\n/** Clone with strongly typed members reduced to simple json. */\npublic static create(source: AkimaCurve3dProps): AkimaCurve3dOptions {\n const result = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints));\n return result;\n}\n\n public static areAlmostEqual(dataA: AkimaCurve3dOptions | undefined, dataB: AkimaCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n return Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b));\n }\n return false;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class AkimaCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: AkimaCurve3dOptions;\n /** CAPTURE properties and proxy curve. */\n private constructor(properties: AkimaCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n /** Second step of double dispatch: call `handler.handleAkimaCurve3d(this)` */\n public override dispatchToGeometryHandler(handler: GeometryHandler) {\n let result = handler.handleAkimaCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on Akima curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n/**\n * Create an [[AkimaCurve3d]] based on points, knots, and other properties in the [[AkimaCurve3dProps]] or [[AkimaCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: AkimaCurve3dOptions | AkimaCurve3dProps): AkimaCurve3d | undefined {\n let optionsCopy;\n if (options instanceof AkimaCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = AkimaCurve3dOptions.create(options);\n }\n return AkimaCurve3d.createCapture(optionsCopy);\n }\n /**\n * Create an [[AkimaCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: AkimaCurve3dOptions): AkimaCurve3d | undefined{\n const proxyCurve = BSplineCurve3d.createFromAkimaCurve3dOptions(options);\n if (proxyCurve)\n return new AkimaCurve3d(options, proxyCurve);\n return undefined;\n }\n /** Return the (pointer to) the proxy B-spline curve. */\n public override get proxyCurve(): BSplineCurve3d {\n return this._proxyCurve as BSplineCurve3d;\n }\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[AkimaCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n /** Clone the [[AkimaCurve3dProps]] object in this [[AkimaCurve3dProps]] */\n public cloneProps(): AkimaCurve3dProps {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.fitPoints.reverse();\n }\n /**\n * Transform this [[AkimaCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArray(this._options.fitPoints);\n }\n return proxyOk;\n }\n /**\n * Find intervals of this CurvePrimitive that are interior to a clipper.\n * * This implementation simply passes the call to the proxy curve.\n * @param clipper clip structure (e.g. clip planes).\n * @param announce (optional) function to be called announcing fractional intervals of the input curve.\n * @returns true if any \"in\" segments are announced.\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return this._proxyCurve.announceClipIntervals(clipper, announce);\n }\n /** Return a deep clone */\n public override clone(): AkimaCurve3d {\n return new AkimaCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n /** Return a transformed clone. */\n public override cloneTransformed(transform: Transform): AkimaCurve3d | undefined {\n return super.cloneTransformed(transform) as AkimaCurve3d | undefined;\n }\n\n /** Test if `other` is also an [[AkimaCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof AkimaCurve3d; }\n\n public override isAlmostEqual(other: GeometryQuery): boolean{\n if (other instanceof AkimaCurve3d) {\n return AkimaCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n}\n"]}
@@ -9,6 +9,7 @@ import { GeometryHandler } from "../geometry3d/GeometryHandler";
9
9
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
10
10
  import { Transform } from "../geometry3d/Transform";
11
11
  import { XYZProps } from "../geometry3d/XYZProps";
12
+ import { BSplineCurve3d } from "./BSplineCurve";
12
13
  /**
13
14
  * fitPoints and end condition data for [[InterpolationCurve3d]]
14
15
  * * This is a "json compatible" version of [[InterpolationCurve3dOptions]]
@@ -130,6 +131,8 @@ export declare class InterpolationCurve3d extends ProxyCurve {
130
131
  * * The options object is captured into the new curve object (not copied)
131
132
  */
132
133
  static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined;
134
+ /** Return the (pointer to) the proxy B-spline curve. */
135
+ get proxyCurve(): BSplineCurve3d;
133
136
  /** Return a (copy of) the defining points, packed as a Float64Array */
134
137
  copyFitPointsFloat64Array(): Float64Array;
135
138
  /**
@@ -160,6 +163,8 @@ export declare class InterpolationCurve3d extends ProxyCurve {
160
163
  announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
161
164
  /** Return a deep clone */
162
165
  clone(): InterpolationCurve3d;
166
+ /** Return a transformed clone. */
167
+ cloneTransformed(transform: Transform): InterpolationCurve3d | undefined;
163
168
  isAlmostEqual(other: GeometryQuery): boolean;
164
169
  /** Test if `other` is also an [[InterpolationCurve3d]] */
165
170
  isSameGeometryClass(other: GeometryQuery): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"InterpolationCurve3d.d.ts","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,O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;IAIxE,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAO5D,0DAA0D;IACnD,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAE1D"}
@@ -233,6 +233,10 @@ class InterpolationCurve3d extends ProxyCurve_1.ProxyCurve {
233
233
  return new InterpolationCurve3d(options, proxyCurve);
234
234
  return undefined;
235
235
  }
236
+ /** Return the (pointer to) the proxy B-spline curve. */
237
+ get proxyCurve() {
238
+ return this._proxyCurve;
239
+ }
236
240
  /** Return a (copy of) the defining points, packed as a Float64Array */
237
241
  copyFitPointsFloat64Array() {
238
242
  return PointHelpers_1.Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);
@@ -286,6 +290,10 @@ class InterpolationCurve3d extends ProxyCurve_1.ProxyCurve {
286
290
  clone() {
287
291
  return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());
288
292
  }
293
+ /** Return a transformed clone. */
294
+ cloneTransformed(transform) {
295
+ return super.cloneTransformed(transform);
296
+ }
289
297
  isAlmostEqual(other) {
290
298
  if (other instanceof InterpolationCurve3d) {
291
299
  return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);
@@ -1 +1 @@
1
- {"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAA6D;AAI7D,oDAAiD;AACjD,0CAAuC;AAEvC,mEAAkE;AAClE,6DAA0D;AAG1D,iDAAgD;AA8BhD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,MAAM,CAAU;IAChB,OAAO,CAAW;IACl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AI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC1C,OAAO,2BAA2B,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IACnD,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;CAE5G;AA1GD,oDA0GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\n * @public\n */\nexport interface InterpolationCurve3dProps {\n /** The order of the computed B-spline curve (one more than its degree). */\n order?: number;\n /** Whether the B-spline construction should be periodic. Default is `false`. */\n closed?: boolean;\n /** If closed and no knots, compute chord length knots (1) or uniform knots (0, default). Chord length knots give best fit. */\n isChordLenKnots?: number;\n /** If !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0, default). */\n isColinearTangents?: number;\n /** If !closed and start/endTangent is defined, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0, default). Bessel gives best fit. */\n isChordLenTangents?: number;\n /** If !closed and start/endTangent is `undefined`, compute it using the natural end condition (1) or Bessel (0, default). Bessel gives best fit. */\n isNaturalTangents?: number;\n /** Optional start tangent, pointing into curve. Magnitude is ignored. */\n startTangent?: XYZProps;\n /** Optional end tangent, pointing into curve. Magnitude is ignored. */\n endTangent?: XYZProps;\n /** Points that the curve must pass through. */\n fitPoints: XYZProps[];\n /** Optional parameters for curve fitting, one per fit point. If `undefined`, knots are computed. */\n knots?: number[];\n}\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class InterpolationCurve3dOptions {\n /**\n * Constructor.\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\n this._fitPoints = fitPoints ? fitPoints : [];\n this._knots = knots;\n }\n\n private _order?: number;\n private _closed?: boolean;\n private _isChordLenKnots?: number;\n private _isColinearTangents?: number;\n private _isChordLenTangents?: number;\n private _isNaturalTangents?: number;\n private _startTangent?: Vector3d;\n private _endTangent?: Vector3d;\n private _fitPoints: Point3d[];\n private _knots?: number[];\n\n /** `order` as property */\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\n public set order(val: number) { this._order = val; }\n /** `closed` as property */\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\n public set closed(val: boolean) { this._closed = val; }\n /** `isChordLenKnots` as property */\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\n /** `isColinearTangents` as property */\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\n /** `isChordLenTangents` as property */\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\n /** `isNaturalTangents` as property */\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\n /** access POINTER TO fit points. Setter CAPTURES. */\n public get fitPoints(): Point3d[] { return this._fitPoints; }\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\n public get knots(): number[] | undefined { return this._knots; }\n public set knots(val: number[] | undefined) { this._knots = val; }\n\n /** One step setup of properties not named in constructor.\n * * CAPTURE pointers to tangents.\n * * OPTIONALLY downgrade \"0\" values to undefined.\n */\n public captureOptionalProps(\n order: number | undefined,\n closed: boolean | undefined,\n isChordLenKnots: number | undefined,\n isColinearTangents: number | undefined,\n isChordLenTangent: number | undefined,\n isNaturalTangents: number | undefined,\n startTangent: Vector3d | undefined,\n endTangent: Vector3d | undefined,\n ) {\n this._order = Geometry.resolveToUndefined(order, 0);\n this._closed = Geometry.resolveToUndefined(closed, false);\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\n this._startTangent = startTangent;\n this._endTangent = endTangent;\n\n }\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\n const props: InterpolationCurve3dProps = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n knots: this._knots?.slice(),\n };\n if (this._order !== undefined)\n props.order = this._order;\n if (this._closed !== undefined)\n props.closed = this._closed;\n if (this._isChordLenKnots !== undefined)\n props.isChordLenKnots = this._isChordLenKnots;\n if (this._isColinearTangents !== undefined)\n props.isColinearTangents = this._isColinearTangents;\n if (this._isChordLenTangents !== undefined)\n props.isChordLenTangents = this._isChordLenTangents;\n if (this._isNaturalTangents !== undefined)\n props.isNaturalTangents = this._isNaturalTangents;\n if (this._startTangent !== undefined)\n props.startTangent = this._startTangent?.toArray();\n if (this._endTangent !== undefined)\n props.endTangent = this._endTangent?.toArray();\n return props;\n }\n /** Clone with strongly typed members reduced to simple json. */\n public clone(): InterpolationCurve3dOptions {\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\n clone._order = this.order;\n clone._closed = this.closed;\n clone._isChordLenKnots = this.isChordLenKnots;\n clone._isColinearTangents = this.isColinearTangents;\n clone._isChordLenTangents = this.isChordLenTangents;\n clone._isNaturalTangents = this.isNaturalTangents;\n clone._startTangent = this._startTangent?.clone();\n clone._endTangent = this._endTangent?.clone();\n return clone;\n }\n\n /** Clone with strongly typed members reduced to simple json. */\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\n result._order = source.order;\n result._closed = source.closed;\n result._isChordLenKnots = source.isChordLenKnots;\n result._isColinearTangents = source.isColinearTangents;\n result._isChordLenTangents = source.isChordLenTangents;\n result._isNaturalTangents = source.isNaturalTangents;\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\n return result;\n }\n // ugh.\n // vector equality test with awkward rule that 000 matches undefined.\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\n if (a !== undefined && a.maxAbs() === 0)\n a = undefined;\n if (b !== undefined && b.maxAbs() === 0)\n b = undefined;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqual(b);\n return a === undefined && b === undefined;\n }\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\n return true;\n if (dataA.knots === undefined && dataB.knots === undefined)\n return true;\n /* alas .. need to allow tricky mismatch of end replication */\n let knotsA = dataA.knots, knotsB = dataB.knots;\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\n else if (dataB.knots === undefined)\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\n }\n }\n return false;\n }\n /** reverse the order or sense of all start-to-end related properties. */\n public reverseInPlace() {\n this.fitPoints.reverse();\n if (this.knots)\n this.knots.reverse();\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\n const oldStart = this._startTangent;\n this._startTangent = this.endTangent;\n this._endTangent = oldStart;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class InterpolationCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: InterpolationCurve3dOptions;\n /** CAPTURE properties and proxy curve. */\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n /** Second step of double dispatch: call `handler.handleInterpolationCurve3d(this)` */\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\n let result = handler.handleInterpolationCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n /**\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\n let optionsCopy;\n if (options instanceof InterpolationCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = InterpolationCurve3dOptions.create(options);\n }\n return InterpolationCurve3d.createCapture(optionsCopy);\n }\n /**\n * Create an [[InterpolationCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\n if (proxyCurve)\n return new InterpolationCurve3d(options, proxyCurve);\n return undefined;\n }\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\n public cloneProps(): InterpolationCurve3dProps {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n\n /** return the options pointer */\n public get options(): InterpolationCurve3dOptions { return this._options; }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.reverseInPlace();\n }\n /**\n * Transform this [[InterpolationCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\n if (this._options.startTangent)\n transform.multiplyVectorInPlace(this._options.startTangent);\n if (this._options.endTangent)\n transform.multiplyVectorInPlace(this._options.endTangent);\n }\n return proxyOk;\n }\n /**\n * Find intervals of this CurvePrimitive that are interior to a clipper.\n * * This implementation simply passes the call to the proxy curve.\n * @param clipper clip structure (e.g. clip planes).\n * @param announce (optional) function to be called announcing fractional intervals of the input curve.\n * @returns true if any \"in\" segments are announced.\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return this._proxyCurve.announceClipIntervals(clipper, announce);\n }\n /** Return a deep clone */\n public override clone(): InterpolationCurve3d {\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof InterpolationCurve3d) {\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n\n /** Test if `other` is also an [[InterpolationCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\n\n}\n"]}
1
+ {"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAA6D;AAI7D,oDAAiD;AACjD,0CAAuC;AAEvC,mEAAkE;AAClE,6DAA0D;AAG1D,iDAAgD;AA8BhD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEO,MAAM,CAAU;IAChB,OAAO,CAAW;IAClB,gBAAgB,CAAU;IAC1B,mBAAmB,CAAU;IAC7B,mBAAmB,CAAU;IAC7B,kBAAkB,CAAU;IAC5B,aAAa,CAAY;IACzB,WAAW,CAAY;IACvB,UAAU,CAAY;IACtB,MAAM,CAAY;IAE1B,0BAA0B;IAC1B,IAAW,KAAK,KAAa,OAAO,mBAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;IACpD,2BAA2B;IAC3B,IAAW,MAAM,KAAc,OAAO,mBAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACnF,IAAW,MAAM,CAAC,GAAY,IAAI,I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W,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,SAAS,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC/D,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY;gBAC5B,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU;gBAC1B,SAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;;;OAMG;IACa,qBAAqB,CAAC,OAAgB,EAAE,QAA6C;QACnG,OAAO,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IACD,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IACD,kCAAkC;IAClB,gBAAgB,CAAC,SAAoB;QACnD,OAAO,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAqC,CAAC;IAC/E,CAAC;IAEe,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC1C,OAAO,2BAA2B,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IACnD,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;CAE5G;AAlHD,oDAkHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\n * @public\n */\nexport interface InterpolationCurve3dProps {\n /** The order of the computed B-spline curve (one more than its degree). */\n order?: number;\n /** Whether the B-spline construction should be periodic. Default is `false`. */\n closed?: boolean;\n /** If closed and no knots, compute chord length knots (1) or uniform knots (0, default). Chord length knots give best fit. */\n isChordLenKnots?: number;\n /** If !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0, default). */\n isColinearTangents?: number;\n /** If !closed and start/endTangent is defined, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0, default). Bessel gives best fit. */\n isChordLenTangents?: number;\n /** If !closed and start/endTangent is `undefined`, compute it using the natural end condition (1) or Bessel (0, default). Bessel gives best fit. */\n isNaturalTangents?: number;\n /** Optional start tangent, pointing into curve. Magnitude is ignored. */\n startTangent?: XYZProps;\n /** Optional end tangent, pointing into curve. Magnitude is ignored. */\n endTangent?: XYZProps;\n /** Points that the curve must pass through. */\n fitPoints: XYZProps[];\n /** Optional parameters for curve fitting, one per fit point. If `undefined`, knots are computed. */\n knots?: number[];\n}\n\n/**\n * fitPoints and end condition data for [[InterpolationCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class InterpolationCurve3dOptions {\n /**\n * Constructor.\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\n this._fitPoints = fitPoints ? fitPoints : [];\n this._knots = knots;\n }\n\n private _order?: number;\n private _closed?: boolean;\n private _isChordLenKnots?: number;\n private _isColinearTangents?: number;\n private _isChordLenTangents?: number;\n private _isNaturalTangents?: number;\n private _startTangent?: Vector3d;\n private _endTangent?: Vector3d;\n private _fitPoints: Point3d[];\n private _knots?: number[];\n\n /** `order` as property */\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\n public set order(val: number) { this._order = val; }\n /** `closed` as property */\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\n public set closed(val: boolean) { this._closed = val; }\n /** `isChordLenKnots` as property */\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\n /** `isColinearTangents` as property */\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\n /** `isChordLenTangents` as property */\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\n /** `isNaturalTangents` as property */\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\n /** access POINTER TO fit points. Setter CAPTURES. */\n public get fitPoints(): Point3d[] { return this._fitPoints; }\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\n public get knots(): number[] | undefined { return this._knots; }\n public set knots(val: number[] | undefined) { this._knots = val; }\n\n /** One step setup of properties not named in constructor.\n * * CAPTURE pointers to tangents.\n * * OPTIONALLY downgrade \"0\" values to undefined.\n */\n public captureOptionalProps(\n order: number | undefined,\n closed: boolean | undefined,\n isChordLenKnots: number | undefined,\n isColinearTangents: number | undefined,\n isChordLenTangent: number | undefined,\n isNaturalTangents: number | undefined,\n startTangent: Vector3d | undefined,\n endTangent: Vector3d | undefined,\n ) {\n this._order = Geometry.resolveToUndefined(order, 0);\n this._closed = Geometry.resolveToUndefined(closed, false);\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\n this._startTangent = startTangent;\n this._endTangent = endTangent;\n\n }\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\n const props: InterpolationCurve3dProps = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n knots: this._knots?.slice(),\n };\n if (this._order !== undefined)\n props.order = this._order;\n if (this._closed !== undefined)\n props.closed = this._closed;\n if (this._isChordLenKnots !== undefined)\n props.isChordLenKnots = this._isChordLenKnots;\n if (this._isColinearTangents !== undefined)\n props.isColinearTangents = this._isColinearTangents;\n if (this._isChordLenTangents !== undefined)\n props.isChordLenTangents = this._isChordLenTangents;\n if (this._isNaturalTangents !== undefined)\n props.isNaturalTangents = this._isNaturalTangents;\n if (this._startTangent !== undefined)\n props.startTangent = this._startTangent?.toArray();\n if (this._endTangent !== undefined)\n props.endTangent = this._endTangent?.toArray();\n return props;\n }\n /** Clone with strongly typed members reduced to simple json. */\n public clone(): InterpolationCurve3dOptions {\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\n clone._order = this.order;\n clone._closed = this.closed;\n clone._isChordLenKnots = this.isChordLenKnots;\n clone._isColinearTangents = this.isColinearTangents;\n clone._isChordLenTangents = this.isChordLenTangents;\n clone._isNaturalTangents = this.isNaturalTangents;\n clone._startTangent = this._startTangent?.clone();\n clone._endTangent = this._endTangent?.clone();\n return clone;\n }\n\n /** Clone with strongly typed members reduced to simple json. */\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\n result._order = source.order;\n result._closed = source.closed;\n result._isChordLenKnots = source.isChordLenKnots;\n result._isColinearTangents = source.isColinearTangents;\n result._isChordLenTangents = source.isChordLenTangents;\n result._isNaturalTangents = source.isNaturalTangents;\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\n return result;\n }\n // ugh.\n // vector equality test with awkward rule that 000 matches undefined.\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\n if (a !== undefined && a.maxAbs() === 0)\n a = undefined;\n if (b !== undefined && b.maxAbs() === 0)\n b = undefined;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqual(b);\n return a === undefined && b === undefined;\n }\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\n return true;\n if (dataA.knots === undefined && dataB.knots === undefined)\n return true;\n /* alas .. need to allow tricky mismatch of end replication */\n let knotsA = dataA.knots, knotsB = dataB.knots;\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\n else if (dataB.knots === undefined)\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\n }\n }\n return false;\n }\n /** reverse the order or sense of all start-to-end related properties. */\n public reverseInPlace() {\n this.fitPoints.reverse();\n if (this.knots)\n this.knots.reverse();\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\n const oldStart = this._startTangent;\n this._startTangent = this.endTangent;\n this._endTangent = oldStart;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class InterpolationCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: InterpolationCurve3dOptions;\n /** CAPTURE properties and proxy curve. */\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n /** Second step of double dispatch: call `handler.handleInterpolationCurve3d(this)` */\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\n let result = handler.handleInterpolationCurve3d(this);\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\n return result;\n }\n /**\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\n let optionsCopy;\n if (options instanceof InterpolationCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = InterpolationCurve3dOptions.create(options);\n }\n return InterpolationCurve3d.createCapture(optionsCopy);\n }\n /**\n * Create an [[InterpolationCurve3d]]\n * * The options object is captured into the new curve object (not copied)\n */\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\n if (proxyCurve)\n return new InterpolationCurve3d(options, proxyCurve);\n return undefined;\n }\n /** Return the (pointer to) the proxy B-spline curve. */\n public override get proxyCurve(): BSplineCurve3d {\n return this._proxyCurve as BSplineCurve3d;\n }\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\n public cloneProps(): InterpolationCurve3dProps {\n return this._options.cloneAsInterpolationCurve3dProps();\n }\n\n /** return the options pointer */\n public get options(): InterpolationCurve3dOptions { return this._options; }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.reverseInPlace();\n }\n /**\n * Transform this [[InterpolationCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\n if (this._options.startTangent)\n transform.multiplyVectorInPlace(this._options.startTangent);\n if (this._options.endTangent)\n transform.multiplyVectorInPlace(this._options.endTangent);\n }\n return proxyOk;\n }\n /**\n * Find intervals of this CurvePrimitive that are interior to a clipper.\n * * This implementation simply passes the call to the proxy curve.\n * @param clipper clip structure (e.g. clip planes).\n * @param announce (optional) function to be called announcing fractional intervals of the input curve.\n * @returns true if any \"in\" segments are announced.\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return this._proxyCurve.announceClipIntervals(clipper, announce);\n }\n /** Return a deep clone */\n public override clone(): InterpolationCurve3d {\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n /** Return a transformed clone. */\n public override cloneTransformed(transform: Transform): InterpolationCurve3d | undefined {\n return super.cloneTransformed(transform) as InterpolationCurve3d | undefined;\n }\n\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof InterpolationCurve3d) {\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n\n /** Test if `other` is also an [[InterpolationCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\n\n}\n"]}
@@ -98,6 +98,8 @@ export declare abstract class CurveCollection extends GeometryQuery {
98
98
  closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined;
99
99
  /** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */
100
100
  reverseInPlace(): void;
101
+ /** Call [[reverseInPlace]] and return the instance. */
102
+ reverse(): this;
101
103
  /**
102
104
  * Return the max gap between adjacent primitives in Path and Loop collections.
103
105
  * * In a Path, gaps are computed between consecutive primitives.
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAuC,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAWhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,MAA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AE,QAAQ,GAAG,SAAS,GAAG,OAAO;IAKxD,2BAA2B;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAKhD,8EAA8E;IACvE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;CAGhE"}
@@ -156,6 +156,11 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
156
156
  for (const curve of this.children)
157
157
  curve.reverseInPlace();
158
158
  }
159
+ /** Call [[reverseInPlace]] and return the instance. */
160
+ reverse() {
161
+ this.reverseInPlace();
162
+ return this;
163
+ }
159
164
  /**
160
165
  * Return the max gap between adjacent primitives in Path and Loop collections.
161
166
  * * In a Path, gaps are computed between consecutive primitives.
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAC7C,0CAAuC;AAGvC,qDAAkD;AAKlD,uDAAqG;AACrG,+DAA4D;AAC5D,qDAAkE;AAGlE,mDAAgD;AAChD,kGAA+F;AAC/F,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACzF,4EAAyE;AACzE,wFAAqF;AACrF,iDAA8C;AAC9C,6CAA0C;AAoB1C;;;;;;;;;;;;GAYG;AACH,MAAsB,eAAgB,SAAQ,6BAAa;IACzD,wCAAwC;IACxB,gBAAgB,GAAG,iBAAiB,CAAC;IAGrD,uDAAuD;IAChD,OAAO,GAAY,KAAK,CAAC;IAGhC,6DAA6D;IACtD,UAAU;QACf,OAAO,qCAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACO,mBAAmB,CACzB,UAAmB,EAAE,SAAsC,KAAK,EAAE,MAA4B,EAAE,SAAkB,KAAK;QAEvH,IAAI,OAAwC,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAI,yCAAmB,EA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AAC,KAAK,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AA3ED,kCA2EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { CurvePrimitive, TangentOptions } from \"./CurvePrimitive\";\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { ProxyCurve } from \"./ProxyCurve\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\nimport type { Path } from \"./Path\";\nimport type { Loop } from \"./Loop\";\n\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\n\n/**\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\n * used in conditional statements for type-switching.\n * - \"loop\" => [[Loop]]\n * - \"path\" => [[Path]]\n * - \"unionRegion\" => [[UnionRegion]]\n * - \"parityRegion\" => [[ParityRegion]]\n * - \"bagOfCurves\" => [[BagOfCurves]]\n * @public\n */\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\n\n/**\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\n * - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.\n * The two instantiable forms of `CurveChain` are:\n * - [[Path]] - a chain of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\n * - [[ParityRegion]] - a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\n * - [[UnionRegion]] - a collection of coplanar `Loop` and/or `ParityRegion`, with \"in/out\" classification by union rules.\n * - [[BagOfCurves]] - a collection of [[AnyCurve]] with no implied structure.\n *\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveCollection extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curveCollection\";\n /** Type discriminator. */\n public abstract readonly curveCollectionType: CurveCollectionType;\n /** Flag for inner loop status. Only used by `Loop`. */\n public isInner: boolean = false;\n /** Return the curve children. */\n public abstract override get children(): AnyCurve[];\n /** Return the sum of the lengths of all contained curves. */\n public sumLengths(): number {\n return SumLengthsContext.sumLengths(this);\n }\n private computeClosestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail, xyOnly: boolean = false,\n ): CurveLocationDetail | undefined {\n let detailA: CurveLocationDetail | undefined;\n const detailB = new CurveLocationDetail();\n let ext = this.isAnyRegion() ? false : extend;\n for (let i = 0; i < this.children.length; i++) {\n const child = this.children[i];\n if (this.isPath()) {\n // head only extends at start; tail only at end. NOTE: child may be both head and tail!\n const mode0 = (i === 0) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0) : CurveExtendMode.None;\n const mode1 = (i === this.children.length - 1) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1) : CurveExtendMode.None;\n ext = [mode0, mode1];\n }\n const cp = xyOnly ? child.closestPointXY(spacePoint, ext, detailB) : child.closestPoint(spacePoint, ext, detailB);\n if (cp) {\n const smaller = CurveLocationDetail.chooseSmallerA(detailA, detailB);\n assert(undefined !== smaller, \"expect defined because detailB is always defined\");\n detailA = result = smaller.clone(result);\n }\n }\n return detailA;\n }\n /**\n * Return the closest point on the contained curves.\n * @param spacePoint point in space.\n * @param extend extend applicable only to [[Path]] and [[BagOfCurves]]. Default value `false`.\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n return this.computeClosestPoint(spacePoint, extend, result);\n }\n /**\n * Return the closest point on the contained curves as viewed in the xy-plane (ignoring z).\n * @param spacePoint point in space.\n * @param extend (optional) extend applicable only to [[Path]] and [[BagOfCurves]]. Default value `false`.\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public closestPointXY(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n return this.computeClosestPoint(spacePoint, extend, result, true);\n }\n /**\n * Announce all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to\n * the contained curves in the view defined by `options.vectorToEye`.\n * * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve\n * tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to\n * `options.vectorToEye`.\n * @param spacePoint point in space.\n * @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused\n * internally, so it should be cloned in the callback if it needs to be saved.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n */\n public emitTangents(\n spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions,\n ): void {\n const strokeHandler = new AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);\n if (this.children !== undefined) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive)\n child.emitStrokableParts(strokeHandler, options?.strokeOptions);\n else if (child instanceof CurveCollection)\n child.emitTangents(spacePoint, announceTangent, options);\n }\n }\n }\n /**\n * Return all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\n * contained curves in the view defined by `options.vectorToEye`.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns an array of details of all tangent points or undefined if no tangent was found.\n */\n public allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined {\n const tangents: CurveLocationDetail[] = [];\n this.emitTangents(spacePoint, (t: CurveLocationDetail) => tangents.push(t.clone()), options);\n return (tangents.length === 0) ? undefined : tangents;\n }\n /**\n * Return the point `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\n * contained curves in the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns the detail of the closest tangent point or undefined if no tangent was found.\n */\n public closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined {\n const hint = options?.hintPoint ?? spacePoint;\n let toLocal: Matrix3d | undefined;\n if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))\n toLocal = Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);\n const measureHintDist2 = (pt: Point3d): number => { // measure distance to hint in view plane coordinates\n return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);\n };\n let closestTangent: CurveLocationDetail | undefined;\n let closestDist2 = Geometry.largeCoordinateResult;\n const collectClosestTangent = (tangent: CurveLocationDetail) => {\n const dist2 = measureHintDist2(tangent.point);\n if (!closestTangent || dist2 < closestDist2) {\n closestTangent = tangent.clone(closestTangent);\n closestDist2 = dist2;\n }\n };\n this.emitTangents(spacePoint, collectClosestTangent, options);\n return closestTangent;\n }\n /** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */\n public reverseInPlace(): void {\n for (const curve of this.children)\n curve.reverseInPlace();\n }\n /**\n * Return the max gap between adjacent primitives in Path and Loop collections.\n * * In a Path, gaps are computed between consecutive primitives.\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\n * \"unstructured\" so gaps should not be semantically meaningful.\n */\n public maxGap(): number {\n return GapSearchContext.maxGap(this);\n }\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\n public checkForNonLinearPrimitives(): boolean {\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\n }\n /** Apply transform recursively to children */\n public tryTransformInPlace(transform: Transform): boolean {\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\n }\n /** Return a deep copy. */\n public override clone(): CurveCollection {\n return CloneCurvesContext.clone(this) as CurveCollection;\n }\n /** Create a deep copy of transformed curves. */\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\n return CloneCurvesContext.clone(this, transform);\n }\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\n public cloneWithExpandedLineStrings(): CurveCollection {\n return CloneWithExpandedLineStrings.clone(this);\n }\n /**\n * Push all CurvePrimitives contained in the instance onto the `results` array.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\n * of the Loop are pushed onto `results`.\n */\n private collectCurvePrimitivesGo(\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\n ): void {\n if (this.children) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n else if (child instanceof CurveCollection)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n }\n }\n }\n /**\n * Return an array containing all CurvePrimitives in the instance.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\n * the Loop are pushed onto the returned array.\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\n * clearing the array).\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\n * it recurses to its (otherwise hidden) children.\n */\n public collectCurvePrimitives(\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\n ): CurvePrimitive[] {\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\n return results;\n }\n /**\n * Return true for planar region types:\n * * `Loop`\n * * `ParityRegion`\n * * `UnionRegion`\n * @see isAnyRegion\n */\n public get isAnyRegionType(): boolean {\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\n }\n /** Type guard for AnyRegion */\n public isAnyRegion(): this is AnyRegion {\n return this.isAnyRegionType;\n }\n /**\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail.\n * * This is NOT a test for (lack of) physical closure.\n * @see [[isPath]], [[CurveChain.isPhysicallyClosedCurve]]\n */\n public get isOpenPath(): boolean {\n return this.dgnBoundaryType() === 1;\n }\n /**\n * Type guard for Path.\n * * This is NOT a test for (lack of) physical closure.\n * @see [[CurveChain.isPhysicallyClosedCurve]]\n */\n public isPath(): this is Path {\n return this.isOpenPath;\n }\n /**\n * Return true for a single-loop planar region type, i.e. `Loop`.\n * * This is NOT a test for physical closure.\n * @see [[isLoop]], [[CurveChain.isPhysicallyClosedCurve]]\n */\n public get isClosedPath(): boolean {\n return this.dgnBoundaryType() === 2;\n }\n /**\n * Type guard for Loop.\n * * This is NOT a test for physical closure.\n * @see [[CurveChain.isPhysicallyClosedCurve]]\n */\n public isLoop(): this is Loop {\n return this.isClosedPath;\n }\n\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\n /** Clone an empty collection. */\n public abstract cloneEmptyPeer(): CurveCollection;\n /**\n * Return the boundary type of a corresponding MicroStation CurveVector.\n * * Derived class must implement.\n */\n public abstract dgnBoundaryType(): number;\n /**\n * Try to add a child.\n * @param child child to add.\n * @return true if child is an acceptable type for this collection.\n */\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\n /** Return a child identified by by index */\n public abstract getChild(i: number): AnyCurve | undefined;\n /**\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\n * @param rangeToExtend the given range.\n * @param transform if supplied, the range is extended with transformed curves.\n */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const children = this.children;\n if (children) {\n for (const c of children) {\n c.extendRange(rangeToExtend, transform);\n }\n }\n }\n /**\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\n * @param source containing `CurvePrimitive` or `CurveCollection`\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\n */\n public static createCurveLocationDetailOnAnyCurvePrimitive(\n source: GeometryQuery | undefined, fraction: number = 0.5,\n ): CurveLocationDetail | undefined {\n if (!source)\n return undefined;\n if (source instanceof CurvePrimitive) {\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\n } else if (source instanceof CurveCollection && source.children !== undefined)\n for (const child of source.children) {\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\n if (detail)\n return detail;\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\n * of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n /** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */\n public findParentOfDescendant(descendant: AnyCurve): CurveCollection | undefined {\n for (const child of this.children) {\n if (child === descendant)\n return this;\n if (child instanceof CurveCollection) {\n const parent = child.findParentOfDescendant(descendant);\n if (parent)\n return parent;\n }\n }\n return undefined;\n };\n}\n\n/**\n * Shared base class for use by both open and closed paths.\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\n * * The specific derived classes are `Path` and `Loop`.\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveChain extends CurveCollection {\n /** The curve primitives in the chain. */\n protected _curves: CurvePrimitive[];\n /** Constructor */\n protected constructor() {\n super();\n this._curves = [];\n }\n /** Return the array of `CurvePrimitive` */\n public override get children(): CurvePrimitive[] {\n return this._curves;\n }\n /** Return the start point of the curve chain (start point of the first child). */\n public startPoint(result?: Point3d): Point3d | undefined {\n const firstChild = this.getChild(0);\n if (firstChild)\n return firstChild.fractionToPoint(0.0, result);\n else\n return undefined;\n }\n /** Return the end point of the curve chain (end point of the last child). */\n public endPoint(result?: Point3d): Point3d | undefined {\n const lastChild = this.getChild(this._curves.length - 1);\n if (lastChild)\n return lastChild.fractionToPoint(1.0, result);\n else\n return undefined;\n }\n /**\n * Whether the chain start and end points are defined and within tolerance.\n * * Does not check for planarity or degeneracy.\n * @param tolerance optional distance tolerance (default is [[Geometry.smallMetricDistance]])\n * @param xyOnly if true, ignore z coordinate (default is `false`)\n */\n public isPhysicallyClosedCurve(tolerance: number = Geometry.smallMetricDistance, xyOnly: boolean = false): boolean {\n const p0 = this.startPoint();\n const p1 = this.endPoint();\n return p0 !== undefined && p1 !== undefined && (xyOnly ? p0.isAlmostEqualXY(p1, tolerance) : p0.isAlmostEqual(p1, tolerance));\n }\n /**\n * Return the start point and derivative of the first child of the curve chain.\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\n */\n public startPointAndDerivative(result?: Ray3d): Ray3d | undefined {\n const firstChild = this.getChild(0);\n if (firstChild)\n return firstChild.fractionToPointAndDerivative(0.0, result);\n else\n return undefined;\n }\n /**\n * Return the end point and derivative of the last child of the curve chain.\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\n */\n public endPointAndDerivative(result?: Ray3d): Ray3d | undefined {\n const lastChild = this.getChild(this._curves.length - 1);\n if (lastChild)\n return lastChild.fractionToPointAndDerivative(1.0, result);\n else\n return undefined;\n }\n /**\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\n * * In particular, `-1` is the final curve.\n * @param index cyclic index\n * @param cyclic whether to employ modulo operator for wrap-around indexing. Default is `true`.\n */\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\n const n = this.children.length;\n if (n === 0)\n return undefined;\n if (index >= 0 && index < n) // try simplest non-cyclic access first\n return this.children[index];\n if (cyclic) {\n const index2 = Geometry.modulo(index, n);\n return this.children[index2];\n }\n return undefined;\n }\n /**\n * Stroke the chain into a simple xyz array.\n * @param options tolerance parameters controlling the stroking.\n */\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\n /**\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\n * the points of that LineString3d using \"packedPoints\".\n */\n const tree = this.cloneStroked(options);\n if (tree instanceof CurveChain) {\n const children = tree.children;\n if (children.length === 1) {\n const ls = children[0];\n if (ls instanceof LineString3d)\n return ls.packedPoints;\n }\n }\n return undefined;\n }\n /** Return a structural clone, with CurvePrimitive objects stroked. */\n public abstract override cloneStroked(options?: StrokeOptions): CurveChain;\n /**\n * Add a child curve.\n * @param child curve to add to the chain. The curve is captured by this instance.\n * @return whether the child was added\n */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child && child instanceof CurvePrimitive) {\n this._curves.push(child);\n return true;\n }\n return false;\n }\n /** Return a child by index */\n public getChild(i: number): CurvePrimitive | undefined {\n if (i < this._curves.length) return this._curves[i];\n return undefined;\n }\n /** Invoke `curve.extendRange(range, transform)` for each child */\n public override extendRange(range: Range3d, transform?: Transform): void {\n for (const curve of this._curves)\n curve.extendRange(range, transform);\n }\n /**\n * Reverse each child curve (in place).\n * Reverse the order of the children array.\n */\n public reverseChildrenInPlace(): void {\n for (const curve of this._curves)\n curve.reverseInPlace();\n this._curves.reverse();\n }\n /** Same as [[reverseChildrenInPlace]]. */\n public override reverseInPlace(): void {\n this.reverseChildrenInPlace();\n }\n /**\n * Return the index where target is found in the array of children.\n * @param alsoSearchProxies whether to also check proxy curves of the children\n */\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\n for (let i = 0; i < this._curves.length; i++) {\n if (this._curves[i] === target)\n return i;\n }\n if (alsoSearchProxies ?? false) {\n for (let i = 0; i < this._curves.length; i++) {\n const childCurve = this._curves[i];\n if (childCurve instanceof ProxyCurve) {\n if (childCurve.proxyCurve === target)\n return i;\n }\n }\n }\n return undefined;\n }\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\n if (primitive) {\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\n }\n return undefined;\n }\n}\n\n/**\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\n * * A `BagOfCurves` has no implied properties such as being planar.\n * @public\n */\nexport class BagOfCurves extends CurveCollection {\n /** String name for schema properties */\n public readonly curveCollectionType = \"bagOfCurves\";\n /** Test if `other` is an instance of `BagOfCurves` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof BagOfCurves;\n }\n /**\n * Array of children.\n * * No restrictions on type.\n */\n protected _children: AnyCurve[];\n /** Construct an empty `BagOfCurves` */\n public constructor() {\n super();\n this._children = [];\n }\n /** Return the (reference to) array of children */\n public override get children(): AnyCurve[] {\n return this._children;\n }\n /** Create with given curves. */\n public static create(...data: AnyCurve[]): BagOfCurves {\n const result = new BagOfCurves();\n for (const child of data) {\n result.tryAddChild(child);\n }\n return result;\n }\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\n public dgnBoundaryType(): number {\n return 0;\n }\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\n return processor.announceBagOfCurves(this, indexInParent);\n }\n /** Clone all children in stroked form. */\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\n const clone = new BagOfCurves();\n let child;\n for (child of this.children) {\n if (child instanceof CurvePrimitive) {\n const ls = LineString3d.create();\n child.emitStrokes(ls, options);\n if (ls)\n clone.children.push(ls);\n } else if (child instanceof CurveCollection) {\n const childStrokes = child.cloneStroked(options);\n if (childStrokes)\n clone.children.push(childStrokes);\n }\n }\n return clone;\n }\n /** Return an empty `BagOfCurves` */\n public cloneEmptyPeer(): BagOfCurves {\n return new BagOfCurves();\n }\n /** Add a child */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child)\n this._children.push(child);\n return true;\n }\n /** Get a child by index */\n public getChild(i: number): AnyCurve | undefined {\n if (i < this._children.length)\n return this._children[i];\n return undefined;\n }\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBagOfCurves(this);\n }\n}\n"]}
1
+ {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAC7C,0CAAuC;AAGvC,qDAAkD;AAKlD,uDAAqG;AACrG,+DAA4D;AAC5D,qDAAkE;AAGlE,mDAAgD;AAChD,kGAA+F;AAC/F,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACzF,4EAAyE;AACzE,wFAAqF;AACrF,iDAA8C;AAC9C,6CAA0C;AAoB1C;;;;;;;;;;;;GAYG;AACH,MAAsB,eAAgB,SAAQ,6BAAa;IACzD,wCAAwC;IACxB,gBAAgB,G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AAK,YAAY,eAAe,EAAE,CAAC;gBAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACjD,IAAI,YAAY;oBACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,oCAAoC;IAC7B,cAAc;QACnB,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD,mBAAmB;IACZ,WAAW,CAAC,KAA2B;QAC5C,IAAI,KAAK;YACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AA3ED,kCA2EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { CurvePrimitive, TangentOptions } from \"./CurvePrimitive\";\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { ProxyCurve } from \"./ProxyCurve\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\nimport type { Path } from \"./Path\";\nimport type { Loop } from \"./Loop\";\n\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\n\n/**\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\n * used in conditional statements for type-switching.\n * - \"loop\" => [[Loop]]\n * - \"path\" => [[Path]]\n * - \"unionRegion\" => [[UnionRegion]]\n * - \"parityRegion\" => [[ParityRegion]]\n * - \"bagOfCurves\" => [[BagOfCurves]]\n * @public\n */\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\n\n/**\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\n * - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.\n * The two instantiable forms of `CurveChain` are:\n * - [[Path]] - a chain of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\n * - [[ParityRegion]] - a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\n * - [[UnionRegion]] - a collection of coplanar `Loop` and/or `ParityRegion`, with \"in/out\" classification by union rules.\n * - [[BagOfCurves]] - a collection of [[AnyCurve]] with no implied structure.\n *\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveCollection extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curveCollection\";\n /** Type discriminator. */\n public abstract readonly curveCollectionType: CurveCollectionType;\n /** Flag for inner loop status. Only used by `Loop`. */\n public isInner: boolean = false;\n /** Return the curve children. */\n public abstract override get children(): AnyCurve[];\n /** Return the sum of the lengths of all contained curves. */\n public sumLengths(): number {\n return SumLengthsContext.sumLengths(this);\n }\n private computeClosestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail, xyOnly: boolean = false,\n ): CurveLocationDetail | undefined {\n let detailA: CurveLocationDetail | undefined;\n const detailB = new CurveLocationDetail();\n let ext = this.isAnyRegion() ? false : extend;\n for (let i = 0; i < this.children.length; i++) {\n const child = this.children[i];\n if (this.isPath()) {\n // head only extends at start; tail only at end. NOTE: child may be both head and tail!\n const mode0 = (i === 0) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0) : CurveExtendMode.None;\n const mode1 = (i === this.children.length - 1) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1) : CurveExtendMode.None;\n ext = [mode0, mode1];\n }\n const cp = xyOnly ? child.closestPointXY(spacePoint, ext, detailB) : child.closestPoint(spacePoint, ext, detailB);\n if (cp) {\n const smaller = CurveLocationDetail.chooseSmallerA(detailA, detailB);\n assert(undefined !== smaller, \"expect defined because detailB is always defined\");\n detailA = result = smaller.clone(result);\n }\n }\n return detailA;\n }\n /**\n * Return the closest point on the contained curves.\n * @param spacePoint point in space.\n * @param extend extend applicable only to [[Path]] and [[BagOfCurves]]. Default value `false`.\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n return this.computeClosestPoint(spacePoint, extend, result);\n }\n /**\n * Return the closest point on the contained curves as viewed in the xy-plane (ignoring z).\n * @param spacePoint point in space.\n * @param extend (optional) extend applicable only to [[Path]] and [[BagOfCurves]]. Default value `false`.\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public closestPointXY(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n return this.computeClosestPoint(spacePoint, extend, result, true);\n }\n /**\n * Announce all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to\n * the contained curves in the view defined by `options.vectorToEye`.\n * * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve\n * tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to\n * `options.vectorToEye`.\n * @param spacePoint point in space.\n * @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused\n * internally, so it should be cloned in the callback if it needs to be saved.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n */\n public emitTangents(\n spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions,\n ): void {\n const strokeHandler = new AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);\n if (this.children !== undefined) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive)\n child.emitStrokableParts(strokeHandler, options?.strokeOptions);\n else if (child instanceof CurveCollection)\n child.emitTangents(spacePoint, announceTangent, options);\n }\n }\n }\n /**\n * Return all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\n * contained curves in the view defined by `options.vectorToEye`.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns an array of details of all tangent points or undefined if no tangent was found.\n */\n public allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined {\n const tangents: CurveLocationDetail[] = [];\n this.emitTangents(spacePoint, (t: CurveLocationDetail) => tangents.push(t.clone()), options);\n return (tangents.length === 0) ? undefined : tangents;\n }\n /**\n * Return the point `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the\n * contained curves in the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns the detail of the closest tangent point or undefined if no tangent was found.\n */\n public closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined {\n const hint = options?.hintPoint ?? spacePoint;\n let toLocal: Matrix3d | undefined;\n if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))\n toLocal = Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);\n const measureHintDist2 = (pt: Point3d): number => { // measure distance to hint in view plane coordinates\n return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);\n };\n let closestTangent: CurveLocationDetail | undefined;\n let closestDist2 = Geometry.largeCoordinateResult;\n const collectClosestTangent = (tangent: CurveLocationDetail) => {\n const dist2 = measureHintDist2(tangent.point);\n if (!closestTangent || dist2 < closestDist2) {\n closestTangent = tangent.clone(closestTangent);\n closestDist2 = dist2;\n }\n };\n this.emitTangents(spacePoint, collectClosestTangent, options);\n return closestTangent;\n }\n /** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */\n public reverseInPlace(): void {\n for (const curve of this.children)\n curve.reverseInPlace();\n }\n /** Call [[reverseInPlace]] and return the instance. */\n public reverse(): this {\n this.reverseInPlace();\n return this;\n }\n /**\n * Return the max gap between adjacent primitives in Path and Loop collections.\n * * In a Path, gaps are computed between consecutive primitives.\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\n * \"unstructured\" so gaps should not be semantically meaningful.\n */\n public maxGap(): number {\n return GapSearchContext.maxGap(this);\n }\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\n public checkForNonLinearPrimitives(): boolean {\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\n }\n /** Apply transform recursively to children */\n public tryTransformInPlace(transform: Transform): boolean {\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\n }\n /** Return a deep copy. */\n public override clone(): CurveCollection {\n return CloneCurvesContext.clone(this) as CurveCollection;\n }\n /** Create a deep copy of transformed curves. */\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\n return CloneCurvesContext.clone(this, transform);\n }\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\n public cloneWithExpandedLineStrings(): CurveCollection {\n return CloneWithExpandedLineStrings.clone(this);\n }\n /**\n * Push all CurvePrimitives contained in the instance onto the `results` array.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\n * of the Loop are pushed onto `results`.\n */\n private collectCurvePrimitivesGo(\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\n ): void {\n if (this.children) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n else if (child instanceof CurveCollection)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n }\n }\n }\n /**\n * Return an array containing all CurvePrimitives in the instance.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\n * the Loop are pushed onto the returned array.\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\n * clearing the array).\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\n * it recurses to its (otherwise hidden) children.\n */\n public collectCurvePrimitives(\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\n ): CurvePrimitive[] {\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\n return results;\n }\n /**\n * Return true for planar region types:\n * * `Loop`\n * * `ParityRegion`\n * * `UnionRegion`\n * @see isAnyRegion\n */\n public get isAnyRegionType(): boolean {\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\n }\n /** Type guard for AnyRegion */\n public isAnyRegion(): this is AnyRegion {\n return this.isAnyRegionType;\n }\n /**\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail.\n * * This is NOT a test for (lack of) physical closure.\n * @see [[isPath]], [[CurveChain.isPhysicallyClosedCurve]]\n */\n public get isOpenPath(): boolean {\n return this.dgnBoundaryType() === 1;\n }\n /**\n * Type guard for Path.\n * * This is NOT a test for (lack of) physical closure.\n * @see [[CurveChain.isPhysicallyClosedCurve]]\n */\n public isPath(): this is Path {\n return this.isOpenPath;\n }\n /**\n * Return true for a single-loop planar region type, i.e. `Loop`.\n * * This is NOT a test for physical closure.\n * @see [[isLoop]], [[CurveChain.isPhysicallyClosedCurve]]\n */\n public get isClosedPath(): boolean {\n return this.dgnBoundaryType() === 2;\n }\n /**\n * Type guard for Loop.\n * * This is NOT a test for physical closure.\n * @see [[CurveChain.isPhysicallyClosedCurve]]\n */\n public isLoop(): this is Loop {\n return this.isClosedPath;\n }\n\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\n /** Clone an empty collection. */\n public abstract cloneEmptyPeer(): CurveCollection;\n /**\n * Return the boundary type of a corresponding MicroStation CurveVector.\n * * Derived class must implement.\n */\n public abstract dgnBoundaryType(): number;\n /**\n * Try to add a child.\n * @param child child to add.\n * @return true if child is an acceptable type for this collection.\n */\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\n /** Return a child identified by by index */\n public abstract getChild(i: number): AnyCurve | undefined;\n /**\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\n * @param rangeToExtend the given range.\n * @param transform if supplied, the range is extended with transformed curves.\n */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const children = this.children;\n if (children) {\n for (const c of children) {\n c.extendRange(rangeToExtend, transform);\n }\n }\n }\n /**\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\n * @param source containing `CurvePrimitive` or `CurveCollection`\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\n */\n public static createCurveLocationDetailOnAnyCurvePrimitive(\n source: GeometryQuery | undefined, fraction: number = 0.5,\n ): CurveLocationDetail | undefined {\n if (!source)\n return undefined;\n if (source instanceof CurvePrimitive) {\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\n } else if (source instanceof CurveCollection && source.children !== undefined)\n for (const child of source.children) {\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\n if (detail)\n return detail;\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\n * of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n /** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */\n public findParentOfDescendant(descendant: AnyCurve): CurveCollection | undefined {\n for (const child of this.children) {\n if (child === descendant)\n return this;\n if (child instanceof CurveCollection) {\n const parent = child.findParentOfDescendant(descendant);\n if (parent)\n return parent;\n }\n }\n return undefined;\n };\n}\n\n/**\n * Shared base class for use by both open and closed paths.\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\n * * The specific derived classes are `Path` and `Loop`.\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveChain extends CurveCollection {\n /** The curve primitives in the chain. */\n protected _curves: CurvePrimitive[];\n /** Constructor */\n protected constructor() {\n super();\n this._curves = [];\n }\n /** Return the array of `CurvePrimitive` */\n public override get children(): CurvePrimitive[] {\n return this._curves;\n }\n /** Return the start point of the curve chain (start point of the first child). */\n public startPoint(result?: Point3d): Point3d | undefined {\n const firstChild = this.getChild(0);\n if (firstChild)\n return firstChild.fractionToPoint(0.0, result);\n else\n return undefined;\n }\n /** Return the end point of the curve chain (end point of the last child). */\n public endPoint(result?: Point3d): Point3d | undefined {\n const lastChild = this.getChild(this._curves.length - 1);\n if (lastChild)\n return lastChild.fractionToPoint(1.0, result);\n else\n return undefined;\n }\n /**\n * Whether the chain start and end points are defined and within tolerance.\n * * Does not check for planarity or degeneracy.\n * @param tolerance optional distance tolerance (default is [[Geometry.smallMetricDistance]])\n * @param xyOnly if true, ignore z coordinate (default is `false`)\n */\n public isPhysicallyClosedCurve(tolerance: number = Geometry.smallMetricDistance, xyOnly: boolean = false): boolean {\n const p0 = this.startPoint();\n const p1 = this.endPoint();\n return p0 !== undefined && p1 !== undefined && (xyOnly ? p0.isAlmostEqualXY(p1, tolerance) : p0.isAlmostEqual(p1, tolerance));\n }\n /**\n * Return the start point and derivative of the first child of the curve chain.\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\n */\n public startPointAndDerivative(result?: Ray3d): Ray3d | undefined {\n const firstChild = this.getChild(0);\n if (firstChild)\n return firstChild.fractionToPointAndDerivative(0.0, result);\n else\n return undefined;\n }\n /**\n * Return the end point and derivative of the last child of the curve chain.\n * * For queries interior to the chain, use [[CurveChainWithDistanceIndex.fractionToPointAndDerivative]].\n */\n public endPointAndDerivative(result?: Ray3d): Ray3d | undefined {\n const lastChild = this.getChild(this._curves.length - 1);\n if (lastChild)\n return lastChild.fractionToPointAndDerivative(1.0, result);\n else\n return undefined;\n }\n /**\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\n * * In particular, `-1` is the final curve.\n * @param index cyclic index\n * @param cyclic whether to employ modulo operator for wrap-around indexing. Default is `true`.\n */\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\n const n = this.children.length;\n if (n === 0)\n return undefined;\n if (index >= 0 && index < n) // try simplest non-cyclic access first\n return this.children[index];\n if (cyclic) {\n const index2 = Geometry.modulo(index, n);\n return this.children[index2];\n }\n return undefined;\n }\n /**\n * Stroke the chain into a simple xyz array.\n * @param options tolerance parameters controlling the stroking.\n */\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\n /**\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\n * the points of that LineString3d using \"packedPoints\".\n */\n const tree = this.cloneStroked(options);\n if (tree instanceof CurveChain) {\n const children = tree.children;\n if (children.length === 1) {\n const ls = children[0];\n if (ls instanceof LineString3d)\n return ls.packedPoints;\n }\n }\n return undefined;\n }\n /** Return a structural clone, with CurvePrimitive objects stroked. */\n public abstract override cloneStroked(options?: StrokeOptions): CurveChain;\n /**\n * Add a child curve.\n * @param child curve to add to the chain. The curve is captured by this instance.\n * @return whether the child was added\n */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child && child instanceof CurvePrimitive) {\n this._curves.push(child);\n return true;\n }\n return false;\n }\n /** Return a child by index */\n public getChild(i: number): CurvePrimitive | undefined {\n if (i < this._curves.length) return this._curves[i];\n return undefined;\n }\n /** Invoke `curve.extendRange(range, transform)` for each child */\n public override extendRange(range: Range3d, transform?: Transform): void {\n for (const curve of this._curves)\n curve.extendRange(range, transform);\n }\n /**\n * Reverse each child curve (in place).\n * Reverse the order of the children array.\n */\n public reverseChildrenInPlace(): void {\n for (const curve of this._curves)\n curve.reverseInPlace();\n this._curves.reverse();\n }\n /** Same as [[reverseChildrenInPlace]]. */\n public override reverseInPlace(): void {\n this.reverseChildrenInPlace();\n }\n /**\n * Return the index where target is found in the array of children.\n * @param alsoSearchProxies whether to also check proxy curves of the children\n */\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\n for (let i = 0; i < this._curves.length; i++) {\n if (this._curves[i] === target)\n return i;\n }\n if (alsoSearchProxies ?? false) {\n for (let i = 0; i < this._curves.length; i++) {\n const childCurve = this._curves[i];\n if (childCurve instanceof ProxyCurve) {\n if (childCurve.proxyCurve === target)\n return i;\n }\n }\n }\n return undefined;\n }\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\n if (primitive) {\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\n }\n return undefined;\n }\n}\n\n/**\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\n * * A `BagOfCurves` has no implied properties such as being planar.\n * @public\n */\nexport class BagOfCurves extends CurveCollection {\n /** String name for schema properties */\n public readonly curveCollectionType = \"bagOfCurves\";\n /** Test if `other` is an instance of `BagOfCurves` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof BagOfCurves;\n }\n /**\n * Array of children.\n * * No restrictions on type.\n */\n protected _children: AnyCurve[];\n /** Construct an empty `BagOfCurves` */\n public constructor() {\n super();\n this._children = [];\n }\n /** Return the (reference to) array of children */\n public override get children(): AnyCurve[] {\n return this._children;\n }\n /** Create with given curves. */\n public static create(...data: AnyCurve[]): BagOfCurves {\n const result = new BagOfCurves();\n for (const child of data) {\n result.tryAddChild(child);\n }\n return result;\n }\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\n public dgnBoundaryType(): number {\n return 0;\n }\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\n return processor.announceBagOfCurves(this, indexInParent);\n }\n /** Clone all children in stroked form. */\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\n const clone = new BagOfCurves();\n let child;\n for (child of this.children) {\n if (child instanceof CurvePrimitive) {\n const ls = LineString3d.create();\n child.emitStrokes(ls, options);\n if (ls)\n clone.children.push(ls);\n } else if (child instanceof CurveCollection) {\n const childStrokes = child.cloneStroked(options);\n if (childStrokes)\n clone.children.push(childStrokes);\n }\n }\n return clone;\n }\n /** Return an empty `BagOfCurves` */\n public cloneEmptyPeer(): BagOfCurves {\n return new BagOfCurves();\n }\n /** Add a child */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child)\n this._children.push(child);\n return true;\n }\n /** Get a child by index */\n public getChild(i: number): AnyCurve | undefined {\n if (i < this._children.length)\n return this._children[i];\n return undefined;\n }\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBagOfCurves(this);\n }\n}\n"]}
@@ -411,6 +411,8 @@ export declare abstract class CurvePrimitive extends GeometryQuery {
411
411
  getFractionToDistanceScale(): number | undefined;
412
412
  /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */
413
413
  abstract reverseInPlace(): void;
414
+ /** Call [[reverseInPlace]] and return the instance. */
415
+ reverse(): this;
414
416
  /**
415
417
  * Compute intersections of the curve with a plane.
416
418
  * * The intersections are appended to the result array.