@itwin/core-geometry 5.12.0-dev.8 → 5.12.0

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 (96) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/lib/cjs/bspline/AkimaCurve3d.d.ts +5 -0
  3. package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js +8 -0
  5. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  6. package/lib/cjs/bspline/InterpolationCurve3d.d.ts +5 -0
  7. package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
  8. package/lib/cjs/bspline/InterpolationCurve3d.js +8 -0
  9. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  10. package/lib/cjs/curve/CurveCollection.d.ts +2 -0
  11. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  12. package/lib/cjs/curve/CurveCollection.js +5 -0
  13. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  14. package/lib/cjs/curve/CurvePrimitive.d.ts +2 -0
  15. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurvePrimitive.js +5 -0
  17. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  18. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +3 -3
  19. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  20. package/lib/cjs/curve/Query/PlanarSubdivision.js +6 -6
  21. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  22. package/lib/cjs/curve/RegionOps.d.ts +69 -8
  23. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  24. package/lib/cjs/curve/RegionOps.js +257 -86
  25. package/lib/cjs/curve/RegionOps.js.map +1 -1
  26. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +2 -3
  27. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  28. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +5 -6
  29. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  30. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -1
  31. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  32. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +82 -58
  33. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  34. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +3 -7
  35. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  36. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +48 -53
  37. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  38. package/lib/cjs/geometry3d/Transform.d.ts +1 -4
  39. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  40. package/lib/cjs/geometry3d/Transform.js +1 -4
  41. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  42. package/lib/cjs/numerics/Polynomials.d.ts +3 -3
  43. package/lib/cjs/numerics/Polynomials.js +5 -5
  44. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  45. package/lib/cjs/topology/Graph.d.ts +5 -2
  46. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  47. package/lib/cjs/topology/Graph.js +5 -2
  48. package/lib/cjs/topology/Graph.js.map +1 -1
  49. package/lib/esm/bspline/AkimaCurve3d.d.ts +5 -0
  50. package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
  51. package/lib/esm/bspline/AkimaCurve3d.js +8 -0
  52. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  53. package/lib/esm/bspline/InterpolationCurve3d.d.ts +5 -0
  54. package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
  55. package/lib/esm/bspline/InterpolationCurve3d.js +8 -0
  56. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  57. package/lib/esm/curve/CurveCollection.d.ts +2 -0
  58. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  59. package/lib/esm/curve/CurveCollection.js +5 -0
  60. package/lib/esm/curve/CurveCollection.js.map +1 -1
  61. package/lib/esm/curve/CurvePrimitive.d.ts +2 -0
  62. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  63. package/lib/esm/curve/CurvePrimitive.js +5 -0
  64. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  65. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +3 -3
  66. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  67. package/lib/esm/curve/Query/PlanarSubdivision.js +6 -6
  68. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  69. package/lib/esm/curve/RegionOps.d.ts +69 -8
  70. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  71. package/lib/esm/curve/RegionOps.js +257 -86
  72. package/lib/esm/curve/RegionOps.js.map +1 -1
  73. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +2 -3
  74. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  75. package/lib/esm/curve/RegionOpsClassificationSweeps.js +5 -6
  76. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  77. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -1
  78. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  79. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +82 -58
  80. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  81. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +3 -7
  82. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  83. package/lib/esm/curve/internalContexts/MultiChainCollector.js +48 -53
  84. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  85. package/lib/esm/geometry3d/Transform.d.ts +1 -4
  86. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  87. package/lib/esm/geometry3d/Transform.js +1 -4
  88. package/lib/esm/geometry3d/Transform.js.map +1 -1
  89. package/lib/esm/numerics/Polynomials.d.ts +3 -3
  90. package/lib/esm/numerics/Polynomials.js +5 -5
  91. package/lib/esm/numerics/Polynomials.js.map +1 -1
  92. package/lib/esm/topology/Graph.d.ts +5 -2
  93. package/lib/esm/topology/Graph.d.ts.map +1 -1
  94. package/lib/esm/topology/Graph.js +5 -2
  95. package/lib/esm/topology/Graph.js.map +1 -1
  96. package/package.json +5 -5
@@ -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,EAAE,CAAC;QAC1C,IAAI,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,K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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,GAAG,iBAAiB,CAAC;IAGrD,uDAAuD;IAChD,OAAO,GAAY,KAAK,CAAC;IAGhC,6DAA6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,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.
@@ -1 +1 @@
1
- {"version":3,"file":"CurvePrimitive.d.ts","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAqB,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,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;;;;;;;OAYG;IACI,qCAAqC,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,cAAc;IAQhG;;;;;;;;;;;OAWG;IACI,8BAA8B,CAAC,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,GAAG,MAAM;IAU5F;;;;;OAKG;WACW,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,cAAc;IAK/G;;;;;;;;OAQG;IACI,wBAAwB,CAC7B,cAAc,EAAE,cAAc,EAAE,EAAE,2BAA2B,EAAE,OAAO,EAAE,mBAAmB,GAAE,OAAe,GAC3G,IAAI;IAGP;;;;;;;;OAQG;IACI,sBAAsB,CAC3B,cAAc,CAAC,EAAE,cAAc,EAAE,EAAE,0BAA0B,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,GAClH,cAAc,EAAE;IAKnB;;;;;;OAMG;aACa,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAC9C,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS;IAEhD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGhG"}
@@ -528,6 +528,11 @@ class CurvePrimitive extends GeometryQuery_1.GeometryQuery {
528
528
  getFractionToDistanceScale() {
529
529
  return undefined;
530
530
  }
531
+ /** Call [[reverseInPlace]] and return the instance. */
532
+ reverse() {
533
+ this.reverseInPlace();
534
+ return this;
535
+ }
531
536
  /**
532
537
  * Compute intersections of the curve with a plane.
533
538
  * * The intersections are appended to the result array.
@@ -1 +1 @@
1
- {"version":3,"file":"CurvePrimitive.js","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAA6C;AAC7C,kEAA+D;AAC/D,0C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C;QACvF,OAAO,OAAO,CAAC;IACjB,CAAC;IAYD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAsB,EAAE,QAAkB;QACvE,OAAO,SAAS,CAAC,CAAC,6EAA6E;IACjG,CAAC;CACF;AA9xBD,wCA8xBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\nimport { AxisOrder, Geometry, type PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, type Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { type Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from \"./CurveLocationDetail\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { AppendPlaneIntersectionStrokeHandler } from \"./internalContexts/AppendPlaneIntersectionStrokeHandler\";\nimport { ClosestPointStrokeHandler } from \"./internalContexts/ClosestPointStrokeHandler\";\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\nimport { CurveLengthContext } from \"./internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"./LineString3d\";\n\nimport type { AkimaCurve3d } from \"../bspline/AkimaCurve3d\";\nimport type { Arc3d } from \"./Arc3d\";\nimport type { BezierCurve3d } from \"../bspline/BezierCurve3d\";\nimport type { BSplineCurve3d } from \"../bspline/BSplineCurve\";\nimport type { Clipper } from \"../clipping/ClipUtils\";\nimport type { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\nimport type { DirectSpiral3d } from \"./spiral/DirectSpiral3d\";\nimport type { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\nimport type { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\nimport type { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport type { LineSegment3d } from \"./LineSegment3d\";\nimport type { OffsetOptions } from \"./OffsetOptions\";\nimport type { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport type { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport type { StrokeOptions } from \"./StrokeOptions\";\nimport type { VariantCurveExtendParameter } from \"./CurveExtendMode\";\n\n/**\n * Describes the concrete type of a [[CurvePrimitive]]. Each type name maps to a specific subclass and can be used\n * for type-switching in conditional statements.\n * - \"arc\" => [[Arc3d]]\n * - \"lineSegment\" => [[LineSegment3d]]\n * - \"lineString\" => [[LineString3d]]\n * - \"bsplineCurve\" => [[BSplineCurve3dBase]] which is an intermediate class implemented by [[BSplineCurve3d]] and\n * [[BSplineCurve3dH]]\n * - \"bezierCurve\" => [[BezierCurveBase]] which is an intermediate class implemented by [[BezierCurve3d]] and\n * [[BezierCurve3dH]]\n * - \"transitionSpiral\" => [[TransitionSpiral3d]]\n * - \"curveChainWithDistanceIndex\" => [[CurveChainWithDistanceIndex]]\n * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article.\n * @see [[AnyCurvePrimitive]] for a union type that supports compile-time type narrowing.\n * @public\n */\nexport type CurvePrimitiveType = \"arc\" | \"lineSegment\" | \"lineString\" | \"bsplineCurve\" | \"bezierCurve\" | \"transitionSpiral\" | \"curveChainWithDistanceIndex\" | \"interpolationCurve\" | \"akimaCurve\";\n/**\n * Union type for subclasses of [[CurvePrimitive]]. Specific subclasses can be discriminated at compile- or run-time\n * using [[CurvePrimitive.curvePrimitiveType]].\n * @public\n */\nexport type AnyCurvePrimitive = Arc3d | LineSegment3d | LineString3d | BSplineCurve3d | BezierCurve3d | DirectSpiral3d | IntegratedSpiral3d | CurveChainWithDistanceIndex | InterpolationCurve3d | AkimaCurve3d;\n/**\n * Union type for a linear [[CurvePrimitive]].\n * @public\n */\nexport type LinearCurvePrimitive = LineSegment3d | LineString3d;\n/**\n * Function signature for callback which announces a pair of numbers, such as a fractional interval, along with a\n * containing CurvePrimitive.\n * @public\n */\nexport type AnnounceNumberNumberCurvePrimitive = (a0: number, a1: number, cp: CurvePrimitive) => void;\n/**\n * Function signature for a callback which announces a pair of numbers\n * @public\n */\nexport type AnnounceNumberNumber = (a0: number, a1: number) => void;\n/** Function signature for a callback which announces a curve primitive\n * @public\n */\nexport type AnnounceCurvePrimitive = (cp: CurvePrimitive) => void;\n\n/**\n * Options for computing tangents to a curve from a fixed point `P`.\n * See [[CurvePrimitive.emitTangents]], [[CurvePrimitive.allTangents]], and [[CurvePrimitive.closestTangent]].\n * @public\n */\nexport interface TangentOptions {\n /**\n * The tangent point returned by [[CurvePrimitive.closestTangent]] is nearest to this point as seen in the view plane.\n * * Default value is the fixed point `P`.\n */\n hintPoint?: Point3d,\n /**\n * Tangents are computed as seen in a view plane perpendicular to this vector.\n * * Default value is (0,0,1), i.e., tangents are computed as seen in the top view.\n */\n vectorToEye?: Vector3d,\n /** Stroke options for default stroke-based implementations. */\n strokeOptions?: StrokeOptions,\n /**\n * Compute tangents to the curve extended according to variant type.\n * * This option is ignored for linear segments and linestrings.\n * * Default value is `false`.\n */\n extend?: VariantCurveExtendParameter,\n /**\n * Distance tolerance, interpreted as follows:\n * * Maximum distance of `P` from the tangent plane at curve point `Q` in order for `Q-P` to be considered a\n * tangent to the curve.\n * * Minimum length of a line/stroke segment for which to consider computing a tangent.\n * * Default value is [[Geometry.smallMetricDistance]].\n */\n distanceTol?: number,\n}\n\n/**\n * A curve primitive is bounded.\n * A curve primitive maps fractions in 0..1 to points in space.\n * As the fraction proceeds from 0 towards 1, the point moves \"forward\" along the curve.\n * True distance along the curve is not always strictly proportional to fraction.\n * * A LineSegment3d always has proportional fraction and distance.\n * * An Arc3d which is true circular has proportional fraction and distance.\n * * A LineString3d is not proportional (except for special case of all segments of equal length).\n * * A Spiral3d is proportional.\n * * A BsplineCurve3d is only proportional for special cases.\n * For fractions outside 0..1, the curve primitive class may either (a) return the near endpoint or (b) evaluate\n * an extended curve.\n * @public\n */\nexport abstract class CurvePrimitive extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curvePrimitive\";\n /** String name for schema properties */\n public abstract readonly curvePrimitiveType: CurvePrimitiveType;\n /** Constructor */\n protected constructor() {\n super();\n }\n /**\n * Data attached during stroking for facets.\n */\n public strokeData?: StrokeCountMap;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public startCut?: CurveLocationDetail;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public endCut?: CurveLocationDetail;\n /**\n * Data attached by various algorithms (e.g. Region booleans)\n */\n public parent?: any;\n /**\n * Return the point (x,y,z) on the curve at fractional position.\n * @param fraction fractional position along the geometry.\n * @returns Returns a point on the curve.\n */\n public abstract fractionToPoint(fraction: number, result?: Point3d): Point3d;\n /**\n * Return the point (x,y,z) and derivative on the curve at fractional position.\n * * Note that this derivative is \"derivative of xyz with respect to fraction\".\n * * This derivative shows the speed of the \"fractional point\" moving along the curve.\n * * This is not generally a unit vector. Use fractionToPointAndUnitTangent for a unit vector.\n * @param fraction fractional position along the geometry.\n * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.\n */\n public abstract fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d;\n /**\n * Returns a ray whose origin is the curve point and direction is the unit tangent.\n * @param fraction fractional position on the curve.\n * @param result optional preallocated ray.\n * @returns tangent ray with normalized direction or zero vector if the derivative vanishes.\n */\n public fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d {\n const ray = this.fractionToPointAndDerivative(fraction, result);\n ray.trySetDirectionMagnitudeInPlace(1.0);\n return ray;\n }\n /**\n * Returns the (absolute) curvature magnitude.\n * * Base implementation in CurvePrimitive computes curvature from the first and second derivative vectors.\n * @param fraction fractional position on the curve\n */\n public fractionToCurvature(fraction: number): number | undefined {\n const data = this.fractionToPointAnd2Derivatives(fraction);\n if (!data)\n return undefined;\n const cross = data.vectorU.crossProduct(data.vectorV);\n const a = cross.magnitude();\n const b = data.vectorU.magnitude();\n return Geometry.conditionalDivideFraction(a, b * b * b);\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's\n * derivative's change.\n * * **Note:** We are dealing with a parametric equation of the curve (a function f : R -> R^3) so first and\n * second derivatives are in fact derivatives of the parametric equation.\n */\n public abstract fractionToPointAnd2Derivatives(\n fraction: number, result?: Plane3dByOriginAndVectors\n ): Plane3dByOriginAndVectors | undefined;\n /**\n * Construct a Frenet frame:\n * * origin at the point on the curve\n * * x axis is unit vector along the curve (tangent)\n * * y axis is perpendicular and in the plane of the osculating circle. y axis is called \"main normal\"\n * * z axis perpendicular to those. z axis is called \"bi-normal\"\n */\n public fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return undefined;\n // first derivative (plane.vectorU) and second derivative (plane.vectorV) are not essentially\n // perpendicular so we use createRigidFromColumns to make 3 perpendicular vectors.\n let axes = Matrix3d.createRigidFromColumns(plane.vectorU, plane.vectorV, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n // 2nd derivative not distinct. for example if curve is linear at fraction so second derivative is 0.\n // in this case we find perpendicular vector to plane.vectorU and pass it to createRigidFromColumns.\n const perpVector = Matrix3d.createPerpendicularVectorFavorXYPlane(plane.vectorU, plane.vectorV);\n axes = Matrix3d.createRigidFromColumns(plane.vectorU, perpVector, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n return undefined;\n }\n /**\n * Construct signed distance from a point on the planar curve to its center of curvature (in xy only).\n * * Positive distance means the center is to the left of the curve at fraction.\n * * Negative distance means the center is to the right of the curve at fraction.\n * * Zero distance means curve is linear at fraction.\n */\n public fractionToSignedXYRadiusOfCurvature(fraction: number): number {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return 0.0;\n const cross = plane.vectorU.crossProductXY(plane.vectorV);\n const b = plane.vectorU.magnitude();\n if (b === 0.0)\n return 0.0;\n const r = Geometry.conditionalDivideCoordinate(b * b * b, cross);\n if (r !== undefined)\n return r;\n return 0.0;\n }\n /**\n * Construct a point extrapolated along tangent at fraction.\n * @param fraction fractional position on the primitive\n * @param distance (signed) distance to move on the tangent.\n */\n public fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d {\n const ray = this.fractionToPointAndUnitTangent(fraction);\n return ray.fractionToPoint(distance);\n }\n /**\n * Return the length of the curve.\n * * Curve length is always positive.\n */\n public curveLength(): number {\n const context = new CurveLengthContext();\n this.emitStrokableParts(context);\n return context.getSum();\n }\n /**\n * Returns a (high accuracy) length of the curve between fractional positions.\n * * Curve length is always positive.\n * * Default implementation applies a generic Gaussian integration.\n * * Most curve classes (certainly LineSegment, LineString, Arc) are expected to provide efficient implementations.\n */\n public curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n if (fraction0 === fraction1)\n return 0.0;\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n return Math.abs((fraction1 - fraction0) * totalLength);\n }\n const context = new CurveLengthContext(fraction0, fraction1);\n this.emitStrokableParts(context);\n return Math.abs(context.getSum());\n }\n /**\n * Returns the range of the curve between fractional positions.\n * * Default implementation calls [[rangeBetweenFractionsByClone]].\n */\n public rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);\n }\n /** Returns a high accuracy range of the curve between fractional positions using [[clonePartialCurve]]. */\n public rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n if (fraction0 === fraction1)\n return Range3d.create(this.fractionToPoint(fraction0));\n const fragment = this.clonePartialCurve(fraction0, fraction1);\n if (fragment)\n return fragment.range(transform);\n return Range3d.createNull();\n }\n /**\n * Returns an approximate range based on a fixed number of evaluations.\n * * Default implementation returns a range determined by evaluating a specified number of points on the curve.\n * * Optionally evaluate again at interval midpoints and extrapolate any increase.\n * * For a smooth curve, Richardson extrapolation suggests each subdivision moves 3/4 of the way to final. So\n * extrapolationFactor of 1/3 speculatively moves closer to the tight range, and larger multipliers increase\n * confidence in being safely larger.\n * * This function is faster to compute the range of a portion of a curve, because some curves can be\n * expensive to compute the partial curve and/or to compute the partial curve's range.\n * @param fraction0 start fraction for evaluation\n * @param fraction1 end fraction for evaluation\n * @param count number of points to evaluate\n * @param transform optional transform to be applied to the curve\n * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier\n * to any increase in size.\n */\n public rangeBetweenFractionsByCount(\n fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0,\n ): Range3d {\n const range = Range3d.createNull();\n const workPoint = Point3d.create();\n range.extendPoint(this.startPoint(workPoint));\n range.extendPoint(this.endPoint(workPoint));\n // Evaluate at count fractions (fraction0 + i * fractionStep)\n const evaluateSteps = (fractionA: number, fractionStep: number, countA: number) => {\n let f = fractionA;\n for (let i = 0; i < countA; i++, f += fractionStep) {\n this.fractionToPoint(f, workPoint);\n if (transform)\n range.extendTransformedPoint(transform, workPoint);\n else\n range.extendPoint(workPoint);\n }\n };\n const interiorCount = count - 2;\n if (interiorCount > 0) {\n const localFraction0 = 1.0 / (interiorCount + 1);\n const globalFractionStep = localFraction0 * (fraction1 - fraction0);\n evaluateSteps(fraction0 + globalFractionStep, globalFractionStep, interiorCount);\n }\n if (extrapolationFactor > 0.0) {\n // Evaluate at midpoints. Where this makes the range larger, apply extrapolationFactor to move it to safer\n // excess value. same interior step, but shift to interval midpoints.\n const baseRange = range.clone();\n const interiorCount1 = interiorCount + 1;\n const localFraction0 = 0.5 / interiorCount1; // we only evaluate at new midpoints.\n const globalFractionStep = 2 * localFraction0 * (fraction1 - fraction0); // same as above, but avoids special logic for interiorCount = 0\n evaluateSteps(fraction0 + globalFractionStep * 0.5, globalFractionStep, interiorCount1);\n range.extendWhenLarger(baseRange, extrapolationFactor);\n }\n return range;\n }\n /**\n * Run an integration (with a default Gaussian quadrature) with a fixed fractional step\n * * This is typically called by specific curve type implementations of curveLengthBetweenFractions.\n * * For example, in Arc3d implementation of curveLengthBetweenFractions:\n * * If the Arc3d is true circular, it the arc is true circular, use the direct `arcLength = radius * sweepRadians`\n * * If the Arc3d is not true circular, call this method with an interval count appropriate to eccentricity and\n * sweepRadians.\n * @returns Returns the curve length via an integral estimated by numerical quadrature between the fractional positions.\n * @param fraction0 start fraction for integration\n * @param fraction1 end fraction for integration\n * @param numInterval number of quadrature intervals\n */\n public curveLengthWithFixedIntervalCountQuadrature(\n fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5,\n ): number {\n if (fraction0 > fraction1) {\n const fSave = fraction0;\n fraction0 = fraction1;\n fraction1 = fSave;\n }\n const context = new CurveLengthContext(fraction0, fraction1, numGauss);\n context.announceIntervalForUniformStepStrokes(this, numInterval, fraction0, fraction1);\n return Math.abs(context.getSum());\n }\n /**\n * (Attempt to) find a position on the curve at a signed distance from start fraction.\n * * Return the position as a CurveLocationDetail.\n * * In the `CurveLocationDetail`, record:\n * * `fraction` = fractional position\n * * `point` = coordinates of the point\n * * `a` = (signed!) distance moved. If `allowExtension` is false and the move reached the start or end of the\n * curve, this distance is smaller than the requested signedDistance.\n * * `curveSearchStatus` indicates one of:\n * * `error` (unusual) computation failed not supported for this curve.\n * * `success` full movement completed\n * * `stoppedAtBoundary` partial movement completed. This can be due to either\n * * `allowExtension` parameter sent as `false`\n * * the curve type (e.g. bspline) does not support extended range.\n * * if `allowExtension` is true, movement may still end at the startPoint or end point for curves that do not support\n * extended geometry (specifically bsplines)\n * * if the curve returns a value (i.e. not `undefined`) for `curve.getFractionToDistanceScale()`, the base class\n * carries out the computation\n * and returns a final location.\n * * LineSegment3d relies on this.\n * * If the curve does not implement the computation or the curve has zero length, the returned `CurveLocationDetail`\n * has\n * * `fraction` = the value of `startFraction`\n * * `point` = result of `curve.fractionToPoint(startFraction)`\n * * `a` = 0\n * * `curveStartState` = `CurveSearchStatus.error`\n * @param startFraction fractional position where the move starts\n * @param signedDistance distance to move. Negative distance is backwards in the fraction space\n * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,\n * do not allow movement beyond the startPoint or endpoint\n * @param result optional result.\n * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is\n * still a result which contains the point at the input startFraction, with failure indicated in the `curveSearchStatus`\n * member.\n */\n public moveSignedDistanceFromFraction(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n const signedFractionMove = Geometry.conditionalDivideFraction(signedDistance, totalLength);\n if (signedFractionMove === undefined) {\n return CurveLocationDetail.createCurveFractionPointDistanceCurveSearchStatus(\n this, startFraction, this.fractionToPoint(startFraction), 0.0, CurveSearchStatus.error);\n }\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension,\n this,\n startFraction,\n startFraction + signedFractionMove,\n signedDistance,\n result,\n );\n }\n return this.moveSignedDistanceFromFractionGeneric(startFraction, signedDistance, allowExtension, result);\n }\n /**\n * Generic algorithm to search for point at signed distance from a fractional startPoint.\n * * This will work for well for smooth curves.\n * * Curves with tangent or other low-order-derivative discontinuities may need to implement specialized algorithms.\n * * We need to find an endFraction which is the end-of-interval (usually upper) limit of integration of the tangent\n * magnitude from startFraction to endFraction\n * * That integral is a function of endFraction.\n * * The derivative of that integral with respect to end fraction is the tangent magnitude at end fraction.\n * * Use that function and (easily evaluated!) derivative for a Newton iteration\n * * TO ALL WHO HAVE FUZZY MEMORIES OF CALCULUS CLASS: \"The derivative of the integral wrt upper limit is the value\n * of the integrand there\" is the fundamental theorem of integral calculus !!! The fundamental theorem is not just\n * an abstraction !!! It is being used here in its barest possible form !!!\n * * See https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus\n * @param startFraction\n * @param signedDistance\n * @param _allowExtension\n * @param result\n */\n protected moveSignedDistanceFromFractionGeneric(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let limitFraction: number;\n const slackFraction = 0.1; // slack to use when integration would otherwise have no room to work\n if (signedDistance === 0.0)\n return CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result); // no movement, just evaluate at startFraction\n if (signedDistance > 0.0) {\n limitFraction = 1.0;\n if (startFraction >= 1.0) {\n const newStartFraction = 1.0 - slackFraction;\n signedDistance += this.curveLengthBetweenFractions(newStartFraction, startFraction);\n startFraction = newStartFraction;\n }\n } else { // signedDistance < 0.0\n limitFraction = 0.0;\n if (startFraction <= 0.0) {\n const newStartFraction = 0.0 + slackFraction;\n signedDistance -= this.curveLengthBetweenFractions(startFraction, newStartFraction);\n startFraction = newStartFraction;\n }\n }\n const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction);\n assert(availableLength > 0.0);\n const absDistance = Math.abs(signedDistance);\n if (availableLength < absDistance && !allowExtension)\n return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, limitFraction, signedDistance, result);\n\n const fractionStep = Geometry.conditionalDivideCoordinate(absDistance, availableLength);\n if (undefined === fractionStep) {\n // no available length!\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;\n let fractionB = Geometry.interpolate(startFraction, fractionStep, limitFraction);\n let fractionA = startFraction;\n let distanceA = 0.0;\n const tol = 1.0e-12 * availableLength;\n let numConverged = 0;\n const tangent = Ray3d.createXAxis();\n // on each loop entry:\n // fractionA is the most recent endOfInterval. (It may have been reached by a mixture of forward and backward step.)\n // distanceA is the distance to (the point at) fractionA\n // fractionB is the next end fraction\n for (let iterations = 0; iterations < 10; iterations++) {\n const distanceAB = this.curveLengthBetweenFractions(fractionA, fractionB);\n const directionAB = fractionB > fractionA ? directionFactor : -directionFactor;\n const distance0B = distanceA + directionAB * distanceAB;\n const distanceError = absDistance - distance0B;\n if (Math.abs(distanceError) < tol) {\n numConverged++;\n if (numConverged > 1)\n break;\n } else {\n numConverged = 0;\n }\n this.fractionToPointAndDerivative(fractionB, tangent);\n const tangentMagnitude = tangent.direction.magnitude();\n fractionA = fractionB;\n fractionB = fractionA + directionFactor * distanceError / tangentMagnitude;\n if (fractionA === fractionB) { // YES -- that is an exact equality test. When it happens, there's no need for confirming with another iteration.\n numConverged = 100;\n break;\n }\n distanceA = distance0B;\n }\n if (numConverged > 1)\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension, this, startFraction, fractionB, signedDistance, result,\n );\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n /**\n * * Returns true if the curve can be easily extended past its start/end point (i.e., beyond the usual\n * fraction space [0,1]). Otherwise, returns false.\n * * Base class default implementation returns false.\n * * These classes (and perhaps others in the future) will return true:\n * * LineSegment3d\n * * LineString3d\n * * Arc3d\n */\n public get isExtensibleFractionSpace(): boolean {\n return false;\n }\n /**\n * Compute a length for curve which may be a fast approximation to the true length.\n * This is expected to be either (a) exact or (b) larger than the actual length, but by no more than\n * a small multiple, perhaps up to PI/2, but commonly much closer to 1.\n *\n * * An example use of this is for setting a tolerance which is a small multiple of the curve length.\n * * Simple line, circular arc, and transition spiral may return exact length\n * * Ellipse may return circumference of some circle or polygon that encloses the ellipse.\n * * bspline curve may return control polygon length\n * *\n */\n public abstract quickLength(): number;\n /**\n * Search for a point on the curve that is closest to the spacePoint.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false).\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details `d` of the closest point. The distance from spacePoint to the closest point is stored in `d.a`.\n */\n public closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Search for a point on the curve that is closest to `spacePoint`, ignoring z-coordinates.\n * * This is equivalent to finding the closest point as seen in the top view.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false).\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details `d` of the closest point. The distance from spacePoint to the closest point is stored in `d.a`.\n */\n public closestPointXY(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result, true);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Announce all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 this.emitStrokableParts(strokeHandler, options?.strokeOptions);\n }\n /**\n * Return all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 /**\n * Find intervals of this curve that are interior to the clipper.\n * * Default implementation calls `clipper.announceClippedCurveIntervals`; subclasses can implement more efficiently as necessary.\n * @param clipper clip structure (e.g. clip planes)\n * @param announce (optional) called to announce each fractional interval: `announce(fraction0, fraction1, this)`\n * @returns true if any \"in\" segments are announced.\n */\n public announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedCurveIntervals?.(this, announce) ?? false;\n }\n /** Return a deep clone. */\n public abstract override clone(): CurvePrimitive;\n /** Return a transformed deep clone. */\n public abstract override cloneTransformed(transform: Transform): CurvePrimitive | undefined;\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param _fractionA [in] start fraction\n * @param _fractionB [in] end fraction\n */\n public clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined {\n return undefined;\n }\n /**\n * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.\n * If distance-along-the-curve is not proportional, return undefined.\n * * When defined, the scale factor is always the length of the curve.\n * * This scale factor is typically available for these curve types:\n * * * All `LineSegment3d`\n * * * Arc3d which is a true circular arc (axes perpendicular and of equal length).\n * * * CurveChainWithDistanceIndex\n * * This scale factor is undefined for these curve types:\n * * * Arc3d which is a true ellipse, i.e. unequal lengths of defining vectors or non-perpendicular defining vectors.\n * * * bspline and bezier curves\n * @returns scale factor or undefined\n */\n public getFractionToDistanceScale(): number | undefined {\n return undefined;\n }\n /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */\n public abstract reverseInPlace(): void;\n /**\n * Compute intersections of the curve with a plane.\n * * The intersections are appended to the result array.\n * * The base class implementation emits strokes to an AppendPlaneIntersectionStrokeHandler object, which uses a\n * Newton iteration to get high-accuracy intersection points within strokes.\n * * Derived classes should override this default implementation if there are easy analytic solutions.\n * * Derived classes are free to implement extended intersections (e.g. arc!!!)\n * @param plane The plane to be intersected.\n * @param result Array to receive intersections\n * @returns Return the number of CurveLocationDetail's added to the result array.\n */\n public appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const strokeHandler = new AppendPlaneIntersectionStrokeHandler(plane, result);\n const n0 = result.length;\n this.emitStrokableParts(strokeHandler);\n return result.length - n0;\n }\n /**\n * Examine contents of an array of CurveLocationDetail.\n * Filter the intersections according to the parameters.\n * @param allowExtend if false, remove points on the extension.\n * @param applySnappedCoordinates if true, change the stored fractions and coordinates to exact end values.\n * Otherwise use the exact values only for purpose of updating the curveIntervalRole.\n * @param startEndFractionTolerance if nonzero, adjust fraction to 0 or 1 with this tolerance.\n * @param startEndXYZTolerance if nonzero, adjust to endpoint with this tolerance.\n * @internal\n */\n public static snapAndRestrictDetails(\n details: CurveLocationDetail[],\n allowExtend: boolean = true,\n applySnappedCoordinates: boolean = false,\n startEndFractionTolerance = Geometry.smallAngleRadians,\n startEndXYZTolerance = Geometry.smallMetricDistance,\n ): void {\n const n0 = details.length;\n let acceptIndex = 0;\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n let snappedCoordinates: Point3d | undefined;\n for (let candidateIndex = 0; candidateIndex < n0; candidateIndex++) {\n snappedCoordinates = undefined;\n const detail = details[candidateIndex];\n let fraction = detail.fraction;\n let accept = allowExtend || Geometry.isIn01(fraction);\n if (detail.curve) {\n detail.curve.startPoint(point0);\n detail.curve.endPoint(point1);\n }\n if (startEndFractionTolerance > 0) {\n if (Math.abs(fraction) < startEndFractionTolerance) {\n fraction = 0.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n }\n if (Math.abs(fraction - 1.0) < startEndFractionTolerance) {\n fraction = 1.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n if (detail.curve)\n snappedCoordinates = detail.curve.startPoint(point1);\n }\n }\n if (startEndXYZTolerance > 0 && detail.curve !== undefined) {\n // REMARK: always test both endpoints. If there is a cyclic fraction space, an intersection marked as \"after\" the end might have wrapped all the way to the beginning.\n if (detail.point.distance(point0) <= startEndXYZTolerance) {\n fraction = 0.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n } else if (detail.point.distance(point1) <= startEndXYZTolerance) {\n fraction = 1.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n }\n }\n if (accept) {\n if (applySnappedCoordinates) {\n detail.fraction = fraction;\n if (snappedCoordinates !== undefined)\n detail.point.setFrom(snappedCoordinates);\n }\n if (acceptIndex < candidateIndex)\n details[acceptIndex] = detail;\n acceptIndex++;\n }\n }\n if (acceptIndex < n0)\n details.length = acceptIndex;\n }\n /**\n * Ask if the curve is within tolerance of a plane.\n * @returns Returns true if the curve is completely within tolerance of the plane.\n */\n public abstract isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean;\n /** Return the startPoint of the primitive. The default implementation returns fractionToPoint(0.0) */\n public startPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(0.0, result);\n }\n /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */\n public endPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(1.0, result);\n }\n /**\n * Whether the 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 /** Append stroke points to caller-supplied linestring. */\n public abstract emitStrokes(dest: LineString3d, options?: StrokeOptions): void;\n /**\n * Ask the curve to announce points and simple subcurve fragments for stroking.\n * See IStrokeHandler for description of the sequence of the method calls.\n */\n public abstract emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void;\n /**\n * Return the stroke count required for given options.\n * * This returns a single number\n * * See [[computeAndAttachRecursiveStrokeCounts]] to get structured per-component counts and fraction mappings.\n * @param options StrokeOptions that determine count\n */\n public abstract computeStrokeCountForOptions(options?: StrokeOptions): number;\n /**\n * Attach StrokeCountMap structure to this primitive (and recursively to any children)\n * * Base class implementation (here) gets the simple count from [[computeStrokeCountForOptions]] and attaches it.\n * * [[LineString3d]], [[Arc3d]], [[BezierCurve3d]], [[BezierCurve3dH]] accept that default.\n * * Subdivided primitives ([[LineString3d]], [[BSplineCurve3d]]) implement themselves and attach a StrokeCountMap containing the\n * total count, and also containing an array of StrokeCountMap per component.\n * * For [[CurveChainWithDistanceIndex]], the top level gets (only) a total count, and each child gets\n * its own StrokeCountMap with appropriate structure.\n * @param options StrokeOptions that determine count\n * @param parentStrokeMap optional map from parent. Its count, curveLength, and a1 values are increased with count\n * and distance from this primitive.\n * @return sum of `a0+this.curveLength()`, for use as `a0` of successor in chain.\n */\n public computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap) {\n const n = this.computeStrokeCountForOptions(options);\n const a = this.curveLength();\n CurvePrimitive.installStrokeCountMap(\n this,\n StrokeCountMap.createWithCurvePrimitive(this, n, a, 0, a),\n parentMap);\n }\n /**\n * Evaluate strokes at fractions indicated in a StrokeCountMap.\n * * Base class implementation (here) gets the simple count from [[computeStrokeCountForOptions]] and strokes at\n * uniform fractions.\n * * [[LineString3d]], [[Arc3d]], [[BezierCurve3d]], [[BezierCurve3dH]] accept that default.\n * * Subdivided primitives ([[LineString3d]], [[BSplineCurve3d]]) implement themselves and evaluate within components.\n * * [[CurveChainWithDistanceIndex]] recurses to its children.\n * * if packedFraction and packedDerivative arrays are present in the LineString3d, fill them.\n * @param map = stroke count data.\n * @param linestring = receiver linestring.\n * @return number of strokes added. 0 if any errors matching the map to the curve primitive.\n */\n public addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number {\n const numPoint0 = linestring.numPoints();\n if (map.primitive && map.primitive === this && map.numStroke > 0) {\n for (let i = 0; i <= map.numStroke; i++) {\n const fraction = i / map.numStroke;\n linestring.appendFractionToPoint(this, fraction);\n }\n }\n return linestring.numPoints() - numPoint0;\n }\n /**\n * Final install step to save curveMap in curve. If parentMap is given, update its length, count, and a1 fields\n * @param curve curve to receive the annotation\n * @param map\n * @param parentMap\n */\n public static installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap) {\n if (parentMap)\n parentMap.addToCountAndLength(curveMap.numStroke, curveMap.curveLength);\n curve.strokeData = curveMap;\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation simply pushes `this` to the collectorArray.\n * @param collectorArray array to receive primitives (pushed -- the array is not cleared)\n * @param smallestPossiblePrimitives if true, a [[CurveChainWithDistanceIndex]] recurses on its (otherwise hidden)\n * children. If false, it returns only itself.\n * @param explodeLinestrings if true, push a [[LineSegment3d]] for each segment of a [[LineString3d]]. If false,\n * push only the [[LineString3d]].\n */\n public collectCurvePrimitivesGo(\n collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false,\n ): void {\n collectorArray.push(this);\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation captures the optional collector and calls [[collectCurvePrimitivesGo]].\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\n * clearing the array.)\n * @param smallestPossiblePrimitives if false (default), a [[CurveChainWithDistanceIndex]] returns only itself;\n * otherwise, it recurses to its (otherwise hidden) children.\n * @param explodeLinestrings whether to return [[LineSegment3d]]s for a [[LineString3d]] (default false).\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 * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use [[CurveOps.constructCurveXYOffset]]\n * instead.\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public abstract constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions\n ): CurvePrimitive | CurvePrimitive[] | undefined;\n\n /**\n * Project instance geometry (via dispatch) onto the line of the given ray, and return the extreme fractional\n * parameters 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 undefined; // common implementation delegated to subclasses to avoid circular dependency\n }\n}\n"]}
1
+ {"version":3,"file":"CurvePrimitive.js","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAA6C;AAC7C,kEAA+D;AAC/D,0CAA+E;AAC/E,qDAAkD;AAClD,mEAAuE;AACvE,+CAA4D;AAC5D,+CAA4C;AAC5C,uDAAoD;AACpD,+DAAkG;AAClG,mDAAgD;AAChD,kHAA+G;AAC/G,4FAAyF;AACzF,kGAA+F;AAC/F,8EAA2E;AAkG3E;;;;;;;;;;;;;GAaG;AACH,MAAsB,cAAe,SAAQ,6BAAa;IACxD,wCAAwC;IACxB,gBAAgB,GA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BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\nimport { AxisOrder, Geometry, type PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, type Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { type Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from \"./CurveLocationDetail\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { AppendPlaneIntersectionStrokeHandler } from \"./internalContexts/AppendPlaneIntersectionStrokeHandler\";\nimport { ClosestPointStrokeHandler } from \"./internalContexts/ClosestPointStrokeHandler\";\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\nimport { CurveLengthContext } from \"./internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"./LineString3d\";\n\nimport type { AkimaCurve3d } from \"../bspline/AkimaCurve3d\";\nimport type { Arc3d } from \"./Arc3d\";\nimport type { BezierCurve3d } from \"../bspline/BezierCurve3d\";\nimport type { BSplineCurve3d } from \"../bspline/BSplineCurve\";\nimport type { Clipper } from \"../clipping/ClipUtils\";\nimport type { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\nimport type { DirectSpiral3d } from \"./spiral/DirectSpiral3d\";\nimport type { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\nimport type { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\nimport type { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport type { LineSegment3d } from \"./LineSegment3d\";\nimport type { OffsetOptions } from \"./OffsetOptions\";\nimport type { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport type { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport type { StrokeOptions } from \"./StrokeOptions\";\nimport type { VariantCurveExtendParameter } from \"./CurveExtendMode\";\n\n/**\n * Describes the concrete type of a [[CurvePrimitive]]. Each type name maps to a specific subclass and can be used\n * for type-switching in conditional statements.\n * - \"arc\" => [[Arc3d]]\n * - \"lineSegment\" => [[LineSegment3d]]\n * - \"lineString\" => [[LineString3d]]\n * - \"bsplineCurve\" => [[BSplineCurve3dBase]] which is an intermediate class implemented by [[BSplineCurve3d]] and\n * [[BSplineCurve3dH]]\n * - \"bezierCurve\" => [[BezierCurveBase]] which is an intermediate class implemented by [[BezierCurve3d]] and\n * [[BezierCurve3dH]]\n * - \"transitionSpiral\" => [[TransitionSpiral3d]]\n * - \"curveChainWithDistanceIndex\" => [[CurveChainWithDistanceIndex]]\n * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article.\n * @see [[AnyCurvePrimitive]] for a union type that supports compile-time type narrowing.\n * @public\n */\nexport type CurvePrimitiveType = \"arc\" | \"lineSegment\" | \"lineString\" | \"bsplineCurve\" | \"bezierCurve\" | \"transitionSpiral\" | \"curveChainWithDistanceIndex\" | \"interpolationCurve\" | \"akimaCurve\";\n/**\n * Union type for subclasses of [[CurvePrimitive]]. Specific subclasses can be discriminated at compile- or run-time\n * using [[CurvePrimitive.curvePrimitiveType]].\n * @public\n */\nexport type AnyCurvePrimitive = Arc3d | LineSegment3d | LineString3d | BSplineCurve3d | BezierCurve3d | DirectSpiral3d | IntegratedSpiral3d | CurveChainWithDistanceIndex | InterpolationCurve3d | AkimaCurve3d;\n/**\n * Union type for a linear [[CurvePrimitive]].\n * @public\n */\nexport type LinearCurvePrimitive = LineSegment3d | LineString3d;\n/**\n * Function signature for callback which announces a pair of numbers, such as a fractional interval, along with a\n * containing CurvePrimitive.\n * @public\n */\nexport type AnnounceNumberNumberCurvePrimitive = (a0: number, a1: number, cp: CurvePrimitive) => void;\n/**\n * Function signature for a callback which announces a pair of numbers\n * @public\n */\nexport type AnnounceNumberNumber = (a0: number, a1: number) => void;\n/** Function signature for a callback which announces a curve primitive\n * @public\n */\nexport type AnnounceCurvePrimitive = (cp: CurvePrimitive) => void;\n\n/**\n * Options for computing tangents to a curve from a fixed point `P`.\n * See [[CurvePrimitive.emitTangents]], [[CurvePrimitive.allTangents]], and [[CurvePrimitive.closestTangent]].\n * @public\n */\nexport interface TangentOptions {\n /**\n * The tangent point returned by [[CurvePrimitive.closestTangent]] is nearest to this point as seen in the view plane.\n * * Default value is the fixed point `P`.\n */\n hintPoint?: Point3d,\n /**\n * Tangents are computed as seen in a view plane perpendicular to this vector.\n * * Default value is (0,0,1), i.e., tangents are computed as seen in the top view.\n */\n vectorToEye?: Vector3d,\n /** Stroke options for default stroke-based implementations. */\n strokeOptions?: StrokeOptions,\n /**\n * Compute tangents to the curve extended according to variant type.\n * * This option is ignored for linear segments and linestrings.\n * * Default value is `false`.\n */\n extend?: VariantCurveExtendParameter,\n /**\n * Distance tolerance, interpreted as follows:\n * * Maximum distance of `P` from the tangent plane at curve point `Q` in order for `Q-P` to be considered a\n * tangent to the curve.\n * * Minimum length of a line/stroke segment for which to consider computing a tangent.\n * * Default value is [[Geometry.smallMetricDistance]].\n */\n distanceTol?: number,\n}\n\n/**\n * A curve primitive is bounded.\n * A curve primitive maps fractions in 0..1 to points in space.\n * As the fraction proceeds from 0 towards 1, the point moves \"forward\" along the curve.\n * True distance along the curve is not always strictly proportional to fraction.\n * * A LineSegment3d always has proportional fraction and distance.\n * * An Arc3d which is true circular has proportional fraction and distance.\n * * A LineString3d is not proportional (except for special case of all segments of equal length).\n * * A Spiral3d is proportional.\n * * A BsplineCurve3d is only proportional for special cases.\n * For fractions outside 0..1, the curve primitive class may either (a) return the near endpoint or (b) evaluate\n * an extended curve.\n * @public\n */\nexport abstract class CurvePrimitive extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curvePrimitive\";\n /** String name for schema properties */\n public abstract readonly curvePrimitiveType: CurvePrimitiveType;\n /** Constructor */\n protected constructor() {\n super();\n }\n /**\n * Data attached during stroking for facets.\n */\n public strokeData?: StrokeCountMap;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public startCut?: CurveLocationDetail;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public endCut?: CurveLocationDetail;\n /**\n * Data attached by various algorithms (e.g. Region booleans)\n */\n public parent?: any;\n /**\n * Return the point (x,y,z) on the curve at fractional position.\n * @param fraction fractional position along the geometry.\n * @returns Returns a point on the curve.\n */\n public abstract fractionToPoint(fraction: number, result?: Point3d): Point3d;\n /**\n * Return the point (x,y,z) and derivative on the curve at fractional position.\n * * Note that this derivative is \"derivative of xyz with respect to fraction\".\n * * This derivative shows the speed of the \"fractional point\" moving along the curve.\n * * This is not generally a unit vector. Use fractionToPointAndUnitTangent for a unit vector.\n * @param fraction fractional position along the geometry.\n * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.\n */\n public abstract fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d;\n /**\n * Returns a ray whose origin is the curve point and direction is the unit tangent.\n * @param fraction fractional position on the curve.\n * @param result optional preallocated ray.\n * @returns tangent ray with normalized direction or zero vector if the derivative vanishes.\n */\n public fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d {\n const ray = this.fractionToPointAndDerivative(fraction, result);\n ray.trySetDirectionMagnitudeInPlace(1.0);\n return ray;\n }\n /**\n * Returns the (absolute) curvature magnitude.\n * * Base implementation in CurvePrimitive computes curvature from the first and second derivative vectors.\n * @param fraction fractional position on the curve\n */\n public fractionToCurvature(fraction: number): number | undefined {\n const data = this.fractionToPointAnd2Derivatives(fraction);\n if (!data)\n return undefined;\n const cross = data.vectorU.crossProduct(data.vectorV);\n const a = cross.magnitude();\n const b = data.vectorU.magnitude();\n return Geometry.conditionalDivideFraction(a, b * b * b);\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's\n * derivative's change.\n * * **Note:** We are dealing with a parametric equation of the curve (a function f : R -> R^3) so first and\n * second derivatives are in fact derivatives of the parametric equation.\n */\n public abstract fractionToPointAnd2Derivatives(\n fraction: number, result?: Plane3dByOriginAndVectors\n ): Plane3dByOriginAndVectors | undefined;\n /**\n * Construct a Frenet frame:\n * * origin at the point on the curve\n * * x axis is unit vector along the curve (tangent)\n * * y axis is perpendicular and in the plane of the osculating circle. y axis is called \"main normal\"\n * * z axis perpendicular to those. z axis is called \"bi-normal\"\n */\n public fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return undefined;\n // first derivative (plane.vectorU) and second derivative (plane.vectorV) are not essentially\n // perpendicular so we use createRigidFromColumns to make 3 perpendicular vectors.\n let axes = Matrix3d.createRigidFromColumns(plane.vectorU, plane.vectorV, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n // 2nd derivative not distinct. for example if curve is linear at fraction so second derivative is 0.\n // in this case we find perpendicular vector to plane.vectorU and pass it to createRigidFromColumns.\n const perpVector = Matrix3d.createPerpendicularVectorFavorXYPlane(plane.vectorU, plane.vectorV);\n axes = Matrix3d.createRigidFromColumns(plane.vectorU, perpVector, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n return undefined;\n }\n /**\n * Construct signed distance from a point on the planar curve to its center of curvature (in xy only).\n * * Positive distance means the center is to the left of the curve at fraction.\n * * Negative distance means the center is to the right of the curve at fraction.\n * * Zero distance means curve is linear at fraction.\n */\n public fractionToSignedXYRadiusOfCurvature(fraction: number): number {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return 0.0;\n const cross = plane.vectorU.crossProductXY(plane.vectorV);\n const b = plane.vectorU.magnitude();\n if (b === 0.0)\n return 0.0;\n const r = Geometry.conditionalDivideCoordinate(b * b * b, cross);\n if (r !== undefined)\n return r;\n return 0.0;\n }\n /**\n * Construct a point extrapolated along tangent at fraction.\n * @param fraction fractional position on the primitive\n * @param distance (signed) distance to move on the tangent.\n */\n public fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d {\n const ray = this.fractionToPointAndUnitTangent(fraction);\n return ray.fractionToPoint(distance);\n }\n /**\n * Return the length of the curve.\n * * Curve length is always positive.\n */\n public curveLength(): number {\n const context = new CurveLengthContext();\n this.emitStrokableParts(context);\n return context.getSum();\n }\n /**\n * Returns a (high accuracy) length of the curve between fractional positions.\n * * Curve length is always positive.\n * * Default implementation applies a generic Gaussian integration.\n * * Most curve classes (certainly LineSegment, LineString, Arc) are expected to provide efficient implementations.\n */\n public curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n if (fraction0 === fraction1)\n return 0.0;\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n return Math.abs((fraction1 - fraction0) * totalLength);\n }\n const context = new CurveLengthContext(fraction0, fraction1);\n this.emitStrokableParts(context);\n return Math.abs(context.getSum());\n }\n /**\n * Returns the range of the curve between fractional positions.\n * * Default implementation calls [[rangeBetweenFractionsByClone]].\n */\n public rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);\n }\n /** Returns a high accuracy range of the curve between fractional positions using [[clonePartialCurve]]. */\n public rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n if (fraction0 === fraction1)\n return Range3d.create(this.fractionToPoint(fraction0));\n const fragment = this.clonePartialCurve(fraction0, fraction1);\n if (fragment)\n return fragment.range(transform);\n return Range3d.createNull();\n }\n /**\n * Returns an approximate range based on a fixed number of evaluations.\n * * Default implementation returns a range determined by evaluating a specified number of points on the curve.\n * * Optionally evaluate again at interval midpoints and extrapolate any increase.\n * * For a smooth curve, Richardson extrapolation suggests each subdivision moves 3/4 of the way to final. So\n * extrapolationFactor of 1/3 speculatively moves closer to the tight range, and larger multipliers increase\n * confidence in being safely larger.\n * * This function is faster to compute the range of a portion of a curve, because some curves can be\n * expensive to compute the partial curve and/or to compute the partial curve's range.\n * @param fraction0 start fraction for evaluation\n * @param fraction1 end fraction for evaluation\n * @param count number of points to evaluate\n * @param transform optional transform to be applied to the curve\n * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier\n * to any increase in size.\n */\n public rangeBetweenFractionsByCount(\n fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0,\n ): Range3d {\n const range = Range3d.createNull();\n const workPoint = Point3d.create();\n range.extendPoint(this.startPoint(workPoint));\n range.extendPoint(this.endPoint(workPoint));\n // Evaluate at count fractions (fraction0 + i * fractionStep)\n const evaluateSteps = (fractionA: number, fractionStep: number, countA: number) => {\n let f = fractionA;\n for (let i = 0; i < countA; i++, f += fractionStep) {\n this.fractionToPoint(f, workPoint);\n if (transform)\n range.extendTransformedPoint(transform, workPoint);\n else\n range.extendPoint(workPoint);\n }\n };\n const interiorCount = count - 2;\n if (interiorCount > 0) {\n const localFraction0 = 1.0 / (interiorCount + 1);\n const globalFractionStep = localFraction0 * (fraction1 - fraction0);\n evaluateSteps(fraction0 + globalFractionStep, globalFractionStep, interiorCount);\n }\n if (extrapolationFactor > 0.0) {\n // Evaluate at midpoints. Where this makes the range larger, apply extrapolationFactor to move it to safer\n // excess value. same interior step, but shift to interval midpoints.\n const baseRange = range.clone();\n const interiorCount1 = interiorCount + 1;\n const localFraction0 = 0.5 / interiorCount1; // we only evaluate at new midpoints.\n const globalFractionStep = 2 * localFraction0 * (fraction1 - fraction0); // same as above, but avoids special logic for interiorCount = 0\n evaluateSteps(fraction0 + globalFractionStep * 0.5, globalFractionStep, interiorCount1);\n range.extendWhenLarger(baseRange, extrapolationFactor);\n }\n return range;\n }\n /**\n * Run an integration (with a default Gaussian quadrature) with a fixed fractional step\n * * This is typically called by specific curve type implementations of curveLengthBetweenFractions.\n * * For example, in Arc3d implementation of curveLengthBetweenFractions:\n * * If the Arc3d is true circular, it the arc is true circular, use the direct `arcLength = radius * sweepRadians`\n * * If the Arc3d is not true circular, call this method with an interval count appropriate to eccentricity and\n * sweepRadians.\n * @returns Returns the curve length via an integral estimated by numerical quadrature between the fractional positions.\n * @param fraction0 start fraction for integration\n * @param fraction1 end fraction for integration\n * @param numInterval number of quadrature intervals\n */\n public curveLengthWithFixedIntervalCountQuadrature(\n fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5,\n ): number {\n if (fraction0 > fraction1) {\n const fSave = fraction0;\n fraction0 = fraction1;\n fraction1 = fSave;\n }\n const context = new CurveLengthContext(fraction0, fraction1, numGauss);\n context.announceIntervalForUniformStepStrokes(this, numInterval, fraction0, fraction1);\n return Math.abs(context.getSum());\n }\n /**\n * (Attempt to) find a position on the curve at a signed distance from start fraction.\n * * Return the position as a CurveLocationDetail.\n * * In the `CurveLocationDetail`, record:\n * * `fraction` = fractional position\n * * `point` = coordinates of the point\n * * `a` = (signed!) distance moved. If `allowExtension` is false and the move reached the start or end of the\n * curve, this distance is smaller than the requested signedDistance.\n * * `curveSearchStatus` indicates one of:\n * * `error` (unusual) computation failed not supported for this curve.\n * * `success` full movement completed\n * * `stoppedAtBoundary` partial movement completed. This can be due to either\n * * `allowExtension` parameter sent as `false`\n * * the curve type (e.g. bspline) does not support extended range.\n * * if `allowExtension` is true, movement may still end at the startPoint or end point for curves that do not support\n * extended geometry (specifically bsplines)\n * * if the curve returns a value (i.e. not `undefined`) for `curve.getFractionToDistanceScale()`, the base class\n * carries out the computation\n * and returns a final location.\n * * LineSegment3d relies on this.\n * * If the curve does not implement the computation or the curve has zero length, the returned `CurveLocationDetail`\n * has\n * * `fraction` = the value of `startFraction`\n * * `point` = result of `curve.fractionToPoint(startFraction)`\n * * `a` = 0\n * * `curveStartState` = `CurveSearchStatus.error`\n * @param startFraction fractional position where the move starts\n * @param signedDistance distance to move. Negative distance is backwards in the fraction space\n * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,\n * do not allow movement beyond the startPoint or endpoint\n * @param result optional result.\n * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is\n * still a result which contains the point at the input startFraction, with failure indicated in the `curveSearchStatus`\n * member.\n */\n public moveSignedDistanceFromFraction(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n const signedFractionMove = Geometry.conditionalDivideFraction(signedDistance, totalLength);\n if (signedFractionMove === undefined) {\n return CurveLocationDetail.createCurveFractionPointDistanceCurveSearchStatus(\n this, startFraction, this.fractionToPoint(startFraction), 0.0, CurveSearchStatus.error);\n }\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension,\n this,\n startFraction,\n startFraction + signedFractionMove,\n signedDistance,\n result,\n );\n }\n return this.moveSignedDistanceFromFractionGeneric(startFraction, signedDistance, allowExtension, result);\n }\n /**\n * Generic algorithm to search for point at signed distance from a fractional startPoint.\n * * This will work for well for smooth curves.\n * * Curves with tangent or other low-order-derivative discontinuities may need to implement specialized algorithms.\n * * We need to find an endFraction which is the end-of-interval (usually upper) limit of integration of the tangent\n * magnitude from startFraction to endFraction\n * * That integral is a function of endFraction.\n * * The derivative of that integral with respect to end fraction is the tangent magnitude at end fraction.\n * * Use that function and (easily evaluated!) derivative for a Newton iteration\n * * TO ALL WHO HAVE FUZZY MEMORIES OF CALCULUS CLASS: \"The derivative of the integral wrt upper limit is the value\n * of the integrand there\" is the fundamental theorem of integral calculus !!! The fundamental theorem is not just\n * an abstraction !!! It is being used here in its barest possible form !!!\n * * See https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus\n * @param startFraction\n * @param signedDistance\n * @param _allowExtension\n * @param result\n */\n protected moveSignedDistanceFromFractionGeneric(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let limitFraction: number;\n const slackFraction = 0.1; // slack to use when integration would otherwise have no room to work\n if (signedDistance === 0.0)\n return CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result); // no movement, just evaluate at startFraction\n if (signedDistance > 0.0) {\n limitFraction = 1.0;\n if (startFraction >= 1.0) {\n const newStartFraction = 1.0 - slackFraction;\n signedDistance += this.curveLengthBetweenFractions(newStartFraction, startFraction);\n startFraction = newStartFraction;\n }\n } else { // signedDistance < 0.0\n limitFraction = 0.0;\n if (startFraction <= 0.0) {\n const newStartFraction = 0.0 + slackFraction;\n signedDistance -= this.curveLengthBetweenFractions(startFraction, newStartFraction);\n startFraction = newStartFraction;\n }\n }\n const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction);\n assert(availableLength > 0.0);\n const absDistance = Math.abs(signedDistance);\n if (availableLength < absDistance && !allowExtension)\n return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, limitFraction, signedDistance, result);\n\n const fractionStep = Geometry.conditionalDivideCoordinate(absDistance, availableLength);\n if (undefined === fractionStep) {\n // no available length!\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;\n let fractionB = Geometry.interpolate(startFraction, fractionStep, limitFraction);\n let fractionA = startFraction;\n let distanceA = 0.0;\n const tol = 1.0e-12 * availableLength;\n let numConverged = 0;\n const tangent = Ray3d.createXAxis();\n // on each loop entry:\n // fractionA is the most recent endOfInterval. (It may have been reached by a mixture of forward and backward step.)\n // distanceA is the distance to (the point at) fractionA\n // fractionB is the next end fraction\n for (let iterations = 0; iterations < 10; iterations++) {\n const distanceAB = this.curveLengthBetweenFractions(fractionA, fractionB);\n const directionAB = fractionB > fractionA ? directionFactor : -directionFactor;\n const distance0B = distanceA + directionAB * distanceAB;\n const distanceError = absDistance - distance0B;\n if (Math.abs(distanceError) < tol) {\n numConverged++;\n if (numConverged > 1)\n break;\n } else {\n numConverged = 0;\n }\n this.fractionToPointAndDerivative(fractionB, tangent);\n const tangentMagnitude = tangent.direction.magnitude();\n fractionA = fractionB;\n fractionB = fractionA + directionFactor * distanceError / tangentMagnitude;\n if (fractionA === fractionB) { // YES -- that is an exact equality test. When it happens, there's no need for confirming with another iteration.\n numConverged = 100;\n break;\n }\n distanceA = distance0B;\n }\n if (numConverged > 1)\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension, this, startFraction, fractionB, signedDistance, result,\n );\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n /**\n * * Returns true if the curve can be easily extended past its start/end point (i.e., beyond the usual\n * fraction space [0,1]). Otherwise, returns false.\n * * Base class default implementation returns false.\n * * These classes (and perhaps others in the future) will return true:\n * * LineSegment3d\n * * LineString3d\n * * Arc3d\n */\n public get isExtensibleFractionSpace(): boolean {\n return false;\n }\n /**\n * Compute a length for curve which may be a fast approximation to the true length.\n * This is expected to be either (a) exact or (b) larger than the actual length, but by no more than\n * a small multiple, perhaps up to PI/2, but commonly much closer to 1.\n *\n * * An example use of this is for setting a tolerance which is a small multiple of the curve length.\n * * Simple line, circular arc, and transition spiral may return exact length\n * * Ellipse may return circumference of some circle or polygon that encloses the ellipse.\n * * bspline curve may return control polygon length\n * *\n */\n public abstract quickLength(): number;\n /**\n * Search for a point on the curve that is closest to the spacePoint.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false).\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details `d` of the closest point. The distance from spacePoint to the closest point is stored in `d.a`.\n */\n public closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Search for a point on the curve that is closest to `spacePoint`, ignoring z-coordinates.\n * * This is equivalent to finding the closest point as seen in the top view.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false).\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details `d` of the closest point. The distance from spacePoint to the closest point is stored in `d.a`.\n */\n public closestPointXY(\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result, true);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Announce all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 this.emitStrokableParts(strokeHandler, options?.strokeOptions);\n }\n /**\n * Return all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * 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 /**\n * Find intervals of this curve that are interior to the clipper.\n * * Default implementation calls `clipper.announceClippedCurveIntervals`; subclasses can implement more efficiently as necessary.\n * @param clipper clip structure (e.g. clip planes)\n * @param announce (optional) called to announce each fractional interval: `announce(fraction0, fraction1, this)`\n * @returns true if any \"in\" segments are announced.\n */\n public announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedCurveIntervals?.(this, announce) ?? false;\n }\n /** Return a deep clone. */\n public abstract override clone(): CurvePrimitive;\n /** Return a transformed deep clone. */\n public abstract override cloneTransformed(transform: Transform): CurvePrimitive | undefined;\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param _fractionA [in] start fraction\n * @param _fractionB [in] end fraction\n */\n public clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined {\n return undefined;\n }\n /**\n * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.\n * If distance-along-the-curve is not proportional, return undefined.\n * * When defined, the scale factor is always the length of the curve.\n * * This scale factor is typically available for these curve types:\n * * * All `LineSegment3d`\n * * * Arc3d which is a true circular arc (axes perpendicular and of equal length).\n * * * CurveChainWithDistanceIndex\n * * This scale factor is undefined for these curve types:\n * * * Arc3d which is a true ellipse, i.e. unequal lengths of defining vectors or non-perpendicular defining vectors.\n * * * bspline and bezier curves\n * @returns scale factor or undefined\n */\n public getFractionToDistanceScale(): number | undefined {\n return undefined;\n }\n /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */\n public abstract reverseInPlace(): void;\n /** Call [[reverseInPlace]] and return the instance. */\n public reverse(): this {\n this.reverseInPlace();\n return this;\n }\n /**\n * Compute intersections of the curve with a plane.\n * * The intersections are appended to the result array.\n * * The base class implementation emits strokes to an AppendPlaneIntersectionStrokeHandler object, which uses a\n * Newton iteration to get high-accuracy intersection points within strokes.\n * * Derived classes should override this default implementation if there are easy analytic solutions.\n * * Derived classes are free to implement extended intersections (e.g. arc!!!)\n * @param plane The plane to be intersected.\n * @param result Array to receive intersections\n * @returns Return the number of CurveLocationDetail's added to the result array.\n */\n public appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const strokeHandler = new AppendPlaneIntersectionStrokeHandler(plane, result);\n const n0 = result.length;\n this.emitStrokableParts(strokeHandler);\n return result.length - n0;\n }\n /**\n * Examine contents of an array of CurveLocationDetail.\n * Filter the intersections according to the parameters.\n * @param allowExtend if false, remove points on the extension.\n * @param applySnappedCoordinates if true, change the stored fractions and coordinates to exact end values.\n * Otherwise use the exact values only for purpose of updating the curveIntervalRole.\n * @param startEndFractionTolerance if nonzero, adjust fraction to 0 or 1 with this tolerance.\n * @param startEndXYZTolerance if nonzero, adjust to endpoint with this tolerance.\n * @internal\n */\n public static snapAndRestrictDetails(\n details: CurveLocationDetail[],\n allowExtend: boolean = true,\n applySnappedCoordinates: boolean = false,\n startEndFractionTolerance = Geometry.smallAngleRadians,\n startEndXYZTolerance = Geometry.smallMetricDistance,\n ): void {\n const n0 = details.length;\n let acceptIndex = 0;\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n let snappedCoordinates: Point3d | undefined;\n for (let candidateIndex = 0; candidateIndex < n0; candidateIndex++) {\n snappedCoordinates = undefined;\n const detail = details[candidateIndex];\n let fraction = detail.fraction;\n let accept = allowExtend || Geometry.isIn01(fraction);\n if (detail.curve) {\n detail.curve.startPoint(point0);\n detail.curve.endPoint(point1);\n }\n if (startEndFractionTolerance > 0) {\n if (Math.abs(fraction) < startEndFractionTolerance) {\n fraction = 0.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n }\n if (Math.abs(fraction - 1.0) < startEndFractionTolerance) {\n fraction = 1.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n if (detail.curve)\n snappedCoordinates = detail.curve.startPoint(point1);\n }\n }\n if (startEndXYZTolerance > 0 && detail.curve !== undefined) {\n // REMARK: always test both endpoints. If there is a cyclic fraction space, an intersection marked as \"after\" the end might have wrapped all the way to the beginning.\n if (detail.point.distance(point0) <= startEndXYZTolerance) {\n fraction = 0.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n } else if (detail.point.distance(point1) <= startEndXYZTolerance) {\n fraction = 1.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n }\n }\n if (accept) {\n if (applySnappedCoordinates) {\n detail.fraction = fraction;\n if (snappedCoordinates !== undefined)\n detail.point.setFrom(snappedCoordinates);\n }\n if (acceptIndex < candidateIndex)\n details[acceptIndex] = detail;\n acceptIndex++;\n }\n }\n if (acceptIndex < n0)\n details.length = acceptIndex;\n }\n /**\n * Ask if the curve is within tolerance of a plane.\n * @returns Returns true if the curve is completely within tolerance of the plane.\n */\n public abstract isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean;\n /** Return the startPoint of the primitive. The default implementation returns fractionToPoint(0.0) */\n public startPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(0.0, result);\n }\n /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */\n public endPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(1.0, result);\n }\n /**\n * Whether the 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 /** Append stroke points to caller-supplied linestring. */\n public abstract emitStrokes(dest: LineString3d, options?: StrokeOptions): void;\n /**\n * Ask the curve to announce points and simple subcurve fragments for stroking.\n * See IStrokeHandler for description of the sequence of the method calls.\n */\n public abstract emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void;\n /**\n * Return the stroke count required for given options.\n * * This returns a single number\n * * See [[computeAndAttachRecursiveStrokeCounts]] to get structured per-component counts and fraction mappings.\n * @param options StrokeOptions that determine count\n */\n public abstract computeStrokeCountForOptions(options?: StrokeOptions): number;\n /**\n * Attach StrokeCountMap structure to this primitive (and recursively to any children)\n * * Base class implementation (here) gets the simple count from [[computeStrokeCountForOptions]] and attaches it.\n * * [[LineString3d]], [[Arc3d]], [[BezierCurve3d]], [[BezierCurve3dH]] accept that default.\n * * Subdivided primitives ([[LineString3d]], [[BSplineCurve3d]]) implement themselves and attach a StrokeCountMap containing the\n * total count, and also containing an array of StrokeCountMap per component.\n * * For [[CurveChainWithDistanceIndex]], the top level gets (only) a total count, and each child gets\n * its own StrokeCountMap with appropriate structure.\n * @param options StrokeOptions that determine count\n * @param parentStrokeMap optional map from parent. Its count, curveLength, and a1 values are increased with count\n * and distance from this primitive.\n * @return sum of `a0+this.curveLength()`, for use as `a0` of successor in chain.\n */\n public computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap) {\n const n = this.computeStrokeCountForOptions(options);\n const a = this.curveLength();\n CurvePrimitive.installStrokeCountMap(\n this,\n StrokeCountMap.createWithCurvePrimitive(this, n, a, 0, a),\n parentMap);\n }\n /**\n * Evaluate strokes at fractions indicated in a StrokeCountMap.\n * * Base class implementation (here) gets the simple count from [[computeStrokeCountForOptions]] and strokes at\n * uniform fractions.\n * * [[LineString3d]], [[Arc3d]], [[BezierCurve3d]], [[BezierCurve3dH]] accept that default.\n * * Subdivided primitives ([[LineString3d]], [[BSplineCurve3d]]) implement themselves and evaluate within components.\n * * [[CurveChainWithDistanceIndex]] recurses to its children.\n * * if packedFraction and packedDerivative arrays are present in the LineString3d, fill them.\n * @param map = stroke count data.\n * @param linestring = receiver linestring.\n * @return number of strokes added. 0 if any errors matching the map to the curve primitive.\n */\n public addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number {\n const numPoint0 = linestring.numPoints();\n if (map.primitive && map.primitive === this && map.numStroke > 0) {\n for (let i = 0; i <= map.numStroke; i++) {\n const fraction = i / map.numStroke;\n linestring.appendFractionToPoint(this, fraction);\n }\n }\n return linestring.numPoints() - numPoint0;\n }\n /**\n * Final install step to save curveMap in curve. If parentMap is given, update its length, count, and a1 fields\n * @param curve curve to receive the annotation\n * @param map\n * @param parentMap\n */\n public static installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap) {\n if (parentMap)\n parentMap.addToCountAndLength(curveMap.numStroke, curveMap.curveLength);\n curve.strokeData = curveMap;\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation simply pushes `this` to the collectorArray.\n * @param collectorArray array to receive primitives (pushed -- the array is not cleared)\n * @param smallestPossiblePrimitives if true, a [[CurveChainWithDistanceIndex]] recurses on its (otherwise hidden)\n * children. If false, it returns only itself.\n * @param explodeLinestrings if true, push a [[LineSegment3d]] for each segment of a [[LineString3d]]. If false,\n * push only the [[LineString3d]].\n */\n public collectCurvePrimitivesGo(\n collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false,\n ): void {\n collectorArray.push(this);\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation captures the optional collector and calls [[collectCurvePrimitivesGo]].\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\n * clearing the array.)\n * @param smallestPossiblePrimitives if false (default), a [[CurveChainWithDistanceIndex]] returns only itself;\n * otherwise, it recurses to its (otherwise hidden) children.\n * @param explodeLinestrings whether to return [[LineSegment3d]]s for a [[LineString3d]] (default false).\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 * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use [[CurveOps.constructCurveXYOffset]]\n * instead.\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public abstract constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions\n ): CurvePrimitive | CurvePrimitive[] | undefined;\n\n /**\n * Project instance geometry (via dispatch) onto the line of the given ray, and return the extreme fractional\n * parameters 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 undefined; // common implementation delegated to subclasses to avoid circular dependency\n }\n}\n"]}
@@ -35,11 +35,11 @@ export declare class PlanarSubdivision {
35
35
  /**
36
36
  * Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative,
37
37
  * or sliver loops.
38
- * @param zeroAreaTolerance absolute area tolerance for sliver face detection
38
+ * @param areaTol absolute area tolerance for sliver face detection
39
39
  * @param isSliverFace whether the loop is known a priori (e.g., via topology) to have zero area
40
40
  * @returns the area (forced to zero if within tolerance)
41
41
  */
42
- static collectSignedLoop(loop: Loop, outLoops: SignedLoops, zeroAreaTolerance?: number, isSliverFace?: boolean): number;
42
+ static collectSignedLoop(loop: Loop, outLoops: SignedLoops, areaTol?: number, isSliverFace?: boolean): number;
43
43
  /** Extract geometric info from a topological edge. */
44
44
  private static extractGeometryFromEdge;
45
45
  /** Create the geometry for a topological edge. */
@@ -63,7 +63,7 @@ export declare class PlanarSubdivision {
63
63
  private static isNullFace;
64
64
  /** Look across edge mates (possibly several) for a non-null mate face. */
65
65
  private static getNonNullEdgeMate;
66
- static collectSignedLoopSetsInHalfEdgeGraph(graph: HalfEdgeGraph, zeroAreaTolerance?: number): SignedLoops[];
66
+ static collectSignedLoopSetsInHalfEdgeGraph(graph: HalfEdgeGraph, closureTol?: number, areaTol?: number): SignedLoops[];
67
67
  }
68
68
  /**
69
69
  * @internal