@itwin/core-geometry 5.0.0-dev.40 → 5.0.0-dev.49

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 (112) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/bspline/KnotVector.d.ts +8 -6
  3. package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
  4. package/lib/cjs/bspline/KnotVector.js +12 -6
  5. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  6. package/lib/cjs/core-geometry.d.ts +1 -0
  7. package/lib/cjs/core-geometry.d.ts.map +1 -1
  8. package/lib/cjs/core-geometry.js +1 -0
  9. package/lib/cjs/core-geometry.js.map +1 -1
  10. package/lib/cjs/curve/Arc3d.js +1 -1
  11. package/lib/cjs/curve/Arc3d.js.map +1 -1
  12. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +0 -2
  13. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  14. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +0 -4
  15. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  16. package/lib/cjs/curve/CurvePrimitive.d.ts +7 -10
  17. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  18. package/lib/cjs/curve/CurvePrimitive.js +7 -10
  19. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  20. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +0 -5
  21. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  22. package/lib/cjs/geometry3d/GrowableXYArray.js +0 -7
  23. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  24. package/lib/cjs/polyface/FacetFaceData.d.ts +1 -1
  25. package/lib/cjs/polyface/FacetFaceData.js +1 -1
  26. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  27. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +9 -6
  28. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  29. package/lib/cjs/polyface/IndexedEdgeMatcher.js +9 -6
  30. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  31. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
  32. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  33. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +1 -1
  34. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  35. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +233 -0
  36. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
  37. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +349 -0
  38. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -0
  39. package/lib/cjs/polyface/Polyface.d.ts +35 -10
  40. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  41. package/lib/cjs/polyface/Polyface.js +55 -10
  42. package/lib/cjs/polyface/Polyface.js.map +1 -1
  43. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +0 -20
  44. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  45. package/lib/cjs/polyface/PolyfaceBuilder.js +0 -28
  46. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  47. package/lib/cjs/polyface/PolyfaceData.d.ts +28 -0
  48. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  49. package/lib/cjs/polyface/PolyfaceData.js +19 -0
  50. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  51. package/lib/cjs/serialization/IModelJsonSchema.d.ts +1 -2
  52. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  53. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  54. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
  55. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +1 -1
  56. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  57. package/lib/esm/bspline/KnotVector.d.ts +8 -6
  58. package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
  59. package/lib/esm/bspline/KnotVector.js +12 -6
  60. package/lib/esm/bspline/KnotVector.js.map +1 -1
  61. package/lib/esm/core-geometry.d.ts +1 -0
  62. package/lib/esm/core-geometry.d.ts.map +1 -1
  63. package/lib/esm/core-geometry.js +1 -0
  64. package/lib/esm/core-geometry.js.map +1 -1
  65. package/lib/esm/curve/Arc3d.js +1 -1
  66. package/lib/esm/curve/Arc3d.js.map +1 -1
  67. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +0 -2
  68. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  69. package/lib/esm/curve/CurveChainWithDistanceIndex.js +0 -4
  70. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  71. package/lib/esm/curve/CurvePrimitive.d.ts +7 -10
  72. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  73. package/lib/esm/curve/CurvePrimitive.js +7 -10
  74. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  75. package/lib/esm/geometry3d/GrowableXYArray.d.ts +0 -5
  76. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  77. package/lib/esm/geometry3d/GrowableXYArray.js +0 -7
  78. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  79. package/lib/esm/polyface/FacetFaceData.d.ts +1 -1
  80. package/lib/esm/polyface/FacetFaceData.js +1 -1
  81. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  82. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +9 -6
  83. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  84. package/lib/esm/polyface/IndexedEdgeMatcher.js +9 -6
  85. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  86. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
  87. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  88. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +1 -1
  89. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  90. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +233 -0
  91. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
  92. package/lib/esm/polyface/IndexedPolyfaceWalker.js +345 -0
  93. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -0
  94. package/lib/esm/polyface/Polyface.d.ts +35 -10
  95. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  96. package/lib/esm/polyface/Polyface.js +55 -10
  97. package/lib/esm/polyface/Polyface.js.map +1 -1
  98. package/lib/esm/polyface/PolyfaceBuilder.d.ts +0 -20
  99. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  100. package/lib/esm/polyface/PolyfaceBuilder.js +0 -28
  101. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  102. package/lib/esm/polyface/PolyfaceData.d.ts +28 -0
  103. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  104. package/lib/esm/polyface/PolyfaceData.js +19 -0
  105. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  106. package/lib/esm/serialization/IModelJsonSchema.d.ts +1 -2
  107. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  108. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  109. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
  110. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +1 -1
  111. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  112. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"CurvePrimitive.js","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG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,OAAO,GAAqB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QACrF,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;QACvF,OAAO,OAAO,CAAC;IACjB,CAAC;IAYD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAsB,EAAE,QAAkB;QACvE,OAAO,SAAS,CAAC,CAAC,6EAA6E;IACjG,CAAC;CACF","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 { 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 * 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 */\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 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 a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns the range of the curve from clonePartialCurve.\n */\n public rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns the range of the curve from clonePartialCurve\n */\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 * * Optional 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 gets speculatively moves closer to the tight range, and larger multipliers increase\n * confidence in being safely larger.\n * * This function is faster version 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 `curveStartState`\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 if applicable, compute the closest point to the curve extended according to variant type:\n * * false: do not extend the curve\n * * true: extend the curve at both start and end\n * * CurveExtendOptions: extend the curve in the specified manner at both start and end\n * * CurveExtendOptions[]: first entry applies to curve start; second, to curve end; any other entries ignored\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, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Find intervals of this curvePrimitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce (optional) function to be called announcing fractional intervals\n * `announce(fraction0, fraction1, curvePrimitive)`\n * @returns true if any \"in\" segments are announced.\n */\n public announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n // DEFAULT IMPLEMENTATION -- no interior parts\n return 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 /** Add strokes to caller-supplied linestring (function updates `dest`) */\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 computeComponentStrokeCountForOptions 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 (linestring, bspline curve) implement themselves and attach a StrokeCountMap containing the\n * total count, and also containing an array of StrokeCountMap per component.\n * * For CurvePrimitiveWithDistanceIndex, 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 (linestring, bspline curve) implement themselves and evaluate within components.\n * * CurvePrimitiveWithDistanceIndex 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 [[CurvePrimitiveWithDistanceIndex]] 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, 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 * 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,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA+B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAiB,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAgE3E;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,cAAe,SAAQ,aAAa;IAKxD,kBAAkB;IAClB;QACE,KAAK,EAAE,CAAC;QANV,wCAAwC;QACxB,qBAAgB,GAAG,gBAAgB,CAAC;IAMpD,CAAC;IAkCD;;;;OAIG;IACI,6BAA6B,CAAC,QAAgB,EAAE,MAAc;QACnE,MAAM,GAAG,GAAG,IAAI,CAAC,4BAA4B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAChE,GAAG,CAAC,+BAA+B,CAA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E5G,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD;;;;;;;OAOG;IACI,sBAAsB,CAC3B,cAAiC,EAAE,6BAAsC,KAAK,EAAE,qBAA8B,KAAK;QAEnH,MAAM,OAAO,GAAqB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QACrF,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;QACvF,OAAO,OAAO,CAAC;IACjB,CAAC;IAYD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAsB,EAAE,QAAkB;QACvE,OAAO,SAAS,CAAC,CAAC,6EAA6E;IACjG,CAAC;CACF","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 { 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 * 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 */\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 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 `curveStartState`\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 if applicable, compute the closest point to the curve extended according to variant type:\n * * false: do not extend the curve\n * * true: extend the curve at both start and end\n * * CurveExtendOptions: extend the curve in the specified manner at both start and end\n * * CurveExtendOptions[]: first entry applies to curve start; second, to curve end; any other entries ignored\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, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Find intervals of this curvePrimitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce (optional) function to be called announcing fractional intervals\n * `announce(fraction0, fraction1, curvePrimitive)`\n * @returns true if any \"in\" segments are announced.\n */\n public announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n // DEFAULT IMPLEMENTATION -- no interior parts\n return 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 /** Add strokes to caller-supplied linestring (function updates `dest`) */\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 computeComponentStrokeCountForOptions 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 (linestring, bspline curve) implement themselves and attach a StrokeCountMap containing the\n * total count, and also containing an array of StrokeCountMap per component.\n * * For CurvePrimitiveWithDistanceIndex, 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 (linestring, bspline curve) implement themselves and evaluate within components.\n * * CurvePrimitiveWithDistanceIndex 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 [[CurvePrimitiveWithDistanceIndex]] 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, 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 * 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"]}
@@ -193,11 +193,6 @@ export declare class GrowableXYArray extends IndexedXYCollection {
193
193
  * @param y y coordinate
194
194
  */
195
195
  setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean;
196
- /**
197
- * Set the coordinates of a single point given as coordinates.
198
- * @deprecated in 3.x. Use setXYAtCheckedPointIndex instead
199
- */
200
- setXYZAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean;
201
196
  /**
202
197
  * Copy all points into a simple array of Point3d with given z.
203
198
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GrowableXYArray.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,mBAAmB;IACtD;;OAEG;IACH,OAAO,CAAC,KAAK,CAAe;IAC5B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAS;IACzB;;OAEG;I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,SAAS,GAAE,MAAqC,GAAG,OAAO;CAYxG"}
@@ -421,13 +421,6 @@ export class GrowableXYArray extends IndexedXYCollection {
421
421
  this._data[index + 1] = y;
422
422
  return true;
423
423
  }
424
- /**
425
- * Set the coordinates of a single point given as coordinates.
426
- * @deprecated in 3.x. Use setXYAtCheckedPointIndex instead
427
- */
428
- setXYZAtCheckedPointIndex(pointIndex, x, y) {
429
- return this.setXYAtCheckedPointIndex(pointIndex, x, y);
430
- }
431
424
  /**
432
425
  * Copy all points into a simple array of Point3d with given z.
433
426
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GrowableXYArray.js","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IAkBtD;;;OAGG;IACH,YAAmB,YAAoB,CAAC,EAAE,YAAqB;QAC7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAG,qBAAqB;QACrE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,SAAS,KAAK,YAAY,IAAI,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IAChG,CAAC;IAED;;;;;OAKG;IACO,QA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sB;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,GAAG,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,+BAA+B;IACxB,aAAa,CAAC,KAAsB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedXYCollection {\n /**\n * array of packed xy xy xy components\n */\n private _data: Float64Array;\n /**\n * Number of xy tuples (not floats) in the array\n */\n private _xyInUse: number;\n /**\n * capacity in xy tuples. (not floats)\n */\n private _xyCapacity: number;\n /**\n * multiplier used by ensureCapacity to expand requested reallocation size\n */\n private _growthFactor: number;\n\n /** Construct a new GrowablePoint2d array.\n * @param numPoints initial capacity in xy tuples (default 8)\n * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)\n */\n public constructor(numPoints: number = 8, growthFactor?: number) {\n super();\n this._data = new Float64Array(numPoints * 2); // 2 values per point\n this._xyInUse = 0;\n this._xyCapacity = numPoints;\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n\n /** Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from\n * @param sourceCount copy the first sourceCount points; all points if undefined\n * @param destOffset copy to instance array starting at this point index; zero if undefined\n * @return count and offset of points copied\n */\n protected copyData(source: Float64Array | number[], sourceCount?: number, destOffset?: number): {count: number, offset: number} {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return {count: 0, offset: 0};\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return {count: 0, offset: 0};\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return {count: myCount / 2, offset: myOffset / 2};\n }\n\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() { return this._xyInUse; }\n public set length(newLength: number) { this.resize(newLength, true); }\n\n /** Return the number of float64 in use. */\n public get float64Length() { return this._xyInUse * 2; }\n /** Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array { return this._data; }\n\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity *= this._growthFactor;\n const prevData = this._data;\n this._data = new Float64Array(pointCapacity * 2);\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.\n * @param pointCount new number of active points in array\n * @param padWithZero when increasing point count, whether to zero out new points (default false)\n */\n public resize(pointCount: number, padWithZero?: boolean) {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /**\n * Make a copy of the (active) points in this array.\n * (The clone does NOT get excess capacity)\n */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /** Create an array populated from\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n\n /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.x. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** push a point to the end of the array */\n public push(toPush: XAndY) {\n this.pushXY(toPush.x, toPush.y);\n }\n\n /** push all points of an array */\n public pushAll(points: XAndY[]) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** push all points of an array */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /** Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public pushFrom(p: any) {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite. Unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate\n */\n public pushWrap(numWrap: number) {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number) {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n\n /** Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d `\n */\n public pop() {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /**\n * Clear all xy data, but leave capacity unchanged.\n */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a Point2d. This is unchecked. Use atPoint2dIndex to have validity test.\n * @param pointIndex index to access\n * @param result optional result\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n\n /**\n * Get x coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n\n /**\n * Get y coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n\n /**\n * Gather all points as a Point2d[]\n */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n\n /** copy xy into strongly typed Point2d */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /** copy xy into strongly typed Vector2d */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array\n * @param source source array\n * @param sourceIndex point index in source array\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n\n /**\n * push coordinates from the source array to the end of this array.\n * @param source source array\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push . . .\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push . . .\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n\n /**\n * * Compute a point at fractional coordinate between points i and j of source\n * * push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number) {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1]);\n }\n }\n\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray) {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /**\n * Return the first point, or undefined if the array is empty.\n */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /**\n * Return the last point, or undefined if the array is empty.\n */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set\n * @param value coordinates to set\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set\n * @param x x coordinate\n * @param y y coordinate\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @deprecated in 3.x. Use setXYAtCheckedPointIndex instead\n */\n public setXYZAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n return this.setXYAtCheckedPointIndex(pointIndex, x, y);\n }\n\n /**\n * Copy all points into a simple array of Point3d with given z.\n */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** reverse the order of points. */\n public reverseInPlace() {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n\n /** multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform) {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n\n }\n }\n /** sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor\n */\n public scaleInPlace(factor: number) {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n\n /** Sum the signed areas of the projection to xy plane */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count !!\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n\n /** Compute a vector from index origin i to indexed target j */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n\n /** Compute a vector from origin to indexed target j */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */\n public override crossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from origin to indexed targets i and j */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y);\n }\n return undefined;\n }\n\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n\n /** Return an array of block indices sorted per compareLexicalBlock function */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx) return 1;\n if (ax < bx) return -1;\n }\n return ia - ib; // so original order is maintained among duplicates !!!!\n }\n\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"GrowableXYArray.js","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYArray.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;IAkBtD;;;OAGG;IACH,YAAmB,YAAoB,CAAC,EAAE,YAAqB;QAC7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAG,qBAAqB;QACrE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,SAAS,KAAK,YAAY,IAAI,YAAY,IAAI,GAAG,CAAC,C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AAC,CAAC;IACrD,CAAC;IACD,+BAA+B;IACxB,aAAa,CAAC,KAAsB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAC3F,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;YAC1B,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;gBAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","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 ArraysAndInterfaces\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { MultiLineStringDataVariant } from \"./IndexedXYZCollection\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d } from \"./Point3dVector3d\";\nimport { Range2d } from \"./Range\";\nimport { Transform } from \"./Transform\";\nimport { XAndY, XYAndZ } from \"./XYZProps\";\n\n/** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.\n * @public\n */\nexport class GrowableXYArray extends IndexedXYCollection {\n /**\n * array of packed xy xy xy components\n */\n private _data: Float64Array;\n /**\n * Number of xy tuples (not floats) in the array\n */\n private _xyInUse: number;\n /**\n * capacity in xy tuples. (not floats)\n */\n private _xyCapacity: number;\n /**\n * multiplier used by ensureCapacity to expand requested reallocation size\n */\n private _growthFactor: number;\n\n /** Construct a new GrowablePoint2d array.\n * @param numPoints initial capacity in xy tuples (default 8)\n * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)\n */\n public constructor(numPoints: number = 8, growthFactor?: number) {\n super();\n this._data = new Float64Array(numPoints * 2); // 2 values per point\n this._xyInUse = 0;\n this._xyCapacity = numPoints;\n this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;\n }\n\n /** Copy xy points from source array. Does not reallocate or change active point count.\n * @param source array to copy from\n * @param sourceCount copy the first sourceCount points; all points if undefined\n * @param destOffset copy to instance array starting at this point index; zero if undefined\n * @return count and offset of points copied\n */\n protected copyData(source: Float64Array | number[], sourceCount?: number, destOffset?: number): { count: number, offset: number } {\n // validate inputs and convert from points to entries\n let myOffset = (undefined !== destOffset) ? destOffset * 2 : 0;\n if (myOffset < 0)\n myOffset = 0;\n if (myOffset >= this._data.length)\n return { count: 0, offset: 0 };\n let myCount = (undefined !== sourceCount) ? sourceCount * 2 : source.length;\n if (myCount > 0) {\n if (myCount > source.length)\n myCount = source.length;\n if (myOffset + myCount > this._data.length)\n myCount = this._data.length - myOffset;\n if (myCount % 2 !== 0)\n myCount -= myCount % 2;\n }\n if (myCount <= 0)\n return { count: 0, offset: 0 };\n if (myCount === source.length)\n this._data.set(source, myOffset);\n else if (source instanceof Float64Array)\n this._data.set(source.subarray(0, myCount), myOffset);\n else\n this._data.set(source.slice(0, myCount), myOffset);\n return { count: myCount / 2, offset: myOffset / 2 };\n }\n\n /** The number of points in use. When the length is increased, the array is padded with zeroes. */\n public override get length() { return this._xyInUse; }\n public set length(newLength: number) { this.resize(newLength, true); }\n\n /** Return the number of float64 in use. */\n public get float64Length() { return this._xyInUse * 2; }\n /** Return the raw packed data.\n * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity\n */\n public float64Data(): Float64Array { return this._data; }\n\n /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */\n public ensureCapacity(pointCapacity: number, applyGrowthFactor: boolean = true) {\n if (pointCapacity > this._xyCapacity) {\n if (applyGrowthFactor)\n pointCapacity *= this._growthFactor;\n const prevData = this._data;\n this._data = new Float64Array(pointCapacity * 2);\n this.copyData(prevData, this._xyInUse);\n this._xyCapacity = pointCapacity;\n }\n }\n /**\n * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.\n * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.\n * @param pointCount new number of active points in array\n * @param padWithZero when increasing point count, whether to zero out new points (default false)\n */\n public resize(pointCount: number, padWithZero?: boolean) {\n if (pointCount >= 0 && pointCount < this._xyInUse)\n this._xyInUse = pointCount;\n else if (pointCount > this._xyInUse) {\n this.ensureCapacity(pointCount, false);\n if (padWithZero ?? false)\n this._data.fill(0, this._xyInUse * 2);\n this._xyInUse = pointCount;\n }\n }\n /**\n * Make a copy of the (active) points in this array.\n * (The clone does NOT get excess capacity)\n */\n public clone(): GrowableXYArray {\n const newPoints = new GrowableXYArray(this.length);\n newPoints.copyData(this._data, this.length);\n newPoints._xyInUse = this.length;\n return newPoints;\n }\n /** Create an array populated from\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * An array of 3 doubles\n * * A GrowableXYZArray\n * * A GrowableXYArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public static create(data: any, result?: GrowableXYArray): GrowableXYArray {\n if (result) {\n result.clear();\n } else {\n const pointCount = typeof data[0] === \"number\" ? data.length / 2 : data.length;\n result = new GrowableXYArray(pointCount);\n }\n result.pushFrom(data);\n return result;\n }\n\n /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray\n * @deprecated in 4.x. Moved to GrowableXYZArray class.\n */\n public static createArrayOfGrowableXYZArray(data: MultiLineStringDataVariant): GrowableXYZArray[] | undefined {\n return GrowableXYZArray.createArrayOfGrowableXYZArray(data);\n }\n /** push a point to the end of the array */\n public push(toPush: XAndY) {\n this.pushXY(toPush.x, toPush.y);\n }\n\n /** push all points of an array */\n public pushAll(points: XAndY[]) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n for (const p of points)\n this.push(p);\n }\n /** push all points of an array */\n public pushAllXYAndZ(points: XYAndZ[] | GrowableXYZArray) {\n this.ensureCapacity(this._xyInUse + points.length, false);\n if (points instanceof GrowableXYZArray) {\n const xyzBuffer = points.float64Data();\n const n = points.length * 3;\n for (let i = 0; i + 2 < n; i += 3)\n this.pushXY(xyzBuffer[i], xyzBuffer[i + 1]);\n } else {\n for (const p of points) this.pushXY(p.x, p.y);\n }\n }\n /** Push copies of points from variant sources.\n * Valid inputs are:\n * * Point2d\n * * Point3d\n * * An array of 2 doubles\n * * A GrowableXYArray\n * * A GrowableXYZArray\n * * Any json object satisfying Point3d.isXAndY\n * * A Float64Array of doubles, interpreted as xyxy\n * * An array of any of the above\n */\n public pushFrom(p: any) {\n if (p instanceof Point3d) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof GrowableXYZArray) {\n this.pushAllXYAndZ(p);\n } else if (p instanceof Point2d) {\n this.pushXY(p.x, p.y);\n } else if (Geometry.isNumberArray(p, 3) || p instanceof Float64Array) {\n const xyToAdd = Math.trunc(p.length / 2);\n this.ensureCapacity(this._xyInUse + xyToAdd, false);\n this.copyData(p, xyToAdd, this._xyInUse);\n this._xyInUse += xyToAdd;\n } else if (Geometry.isNumberArray(p, 2)) {\n this.pushXY(p[0], p[1]);\n } else if (Array.isArray(p)) {\n // direct recursion re-wraps p and goes infinite. Unroll here.\n for (const q of p)\n this.pushFrom(q);\n } else if (Point3d.isXAndY(p)) {\n this.pushXY(p.x, p.y);\n } else if (p instanceof IndexedXYCollection) {\n const n = p.length;\n this.ensureCapacity(this._xyInUse + n, false);\n for (let i = 0; i < n; i++)\n this.pushXY(p.getXAtUncheckedPointIndex(i), p.getYAtUncheckedPointIndex(i));\n }\n }\n /**\n * Replicate numWrap xy values from the front of the array as new values at the end.\n * @param numWrap number of xy values to replicate\n */\n public pushWrap(numWrap: number) {\n if (this._xyInUse >= numWrap) {\n this.ensureCapacity(this._xyInUse + numWrap, false);\n for (let i = 0; i < numWrap; i++) {\n const k = 2 * i;\n this.pushXY(this._data[k], this._data[k + 1]);\n }\n }\n }\n /** push a point given by x,y coordinates */\n public pushXY(x: number, y: number) {\n this.ensureCapacity(this._xyInUse + 1);\n const index = this._xyInUse * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n this._xyInUse++;\n }\n\n /** Remove one point from the back.\n * * NOTE that (in the manner of std::vector native) this is \"just\" removing the point -- no point is NOT returned.\n * * Use `back ()` to get the last x,y assembled into a `Point2d `\n */\n public pop() {\n if (this._xyInUse > 0)\n this._xyInUse--;\n }\n /**\n * Test if index is valid for an xy (point or vector) within this array\n * @param index xy index to test.\n */\n public isIndexValid(index: number): boolean {\n if (index >= this._xyInUse || index < 0)\n return false;\n return true;\n }\n /**\n * Clear all xy data, but leave capacity unchanged.\n */\n public clear() {\n this._xyInUse = 0;\n }\n /**\n * Get a point by index, strongly typed as a Point2d. This is unchecked. Use atPoint2dIndex to have validity test.\n * @param pointIndex index to access\n * @param result optional result\n */\n public getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n\n /**\n * Get x coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex];\n }\n\n /**\n * Get y coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this._data[2 * pointIndex + 1];\n }\n\n /**\n * Gather all points as a Point2d[]\n */\n public getPoint2dArray(): Point2d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point2d.create(data[i], data[i + 1]));\n return result;\n }\n\n /** copy xy into strongly typed Point2d */\n public override getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(pointIndex)) {\n const index = 2 * pointIndex;\n return Point2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /** copy xy into strongly typed Vector2d */\n public override getVector2dAtCheckedVectorIndex(vectorIndex: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(vectorIndex)) {\n const index = 2 * vectorIndex;\n return Vector2d.create(this._data[index], this._data[index + 1], result);\n }\n return undefined;\n }\n\n /**\n * Read coordinates from source array, place them at index within this array.\n * @param destIndex point index where coordinates are to be placed in this array\n * @param source source array\n * @param sourceIndex point index in source array\n * @returns true if destIndex and sourceIndex are both valid.\n */\n public transferFromGrowableXYArray(destIndex: number, source: GrowableXYArray, sourceIndex: number): boolean {\n if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {\n const i = destIndex * 2;\n const j = sourceIndex * 2;\n this._data[i] = source._data[j];\n this._data[i + 1] = source._data[j + 1];\n return true;\n }\n return false;\n }\n\n /**\n * push coordinates from the source array to the end of this array.\n * @param source source array\n * @param sourceIndex xy index within the source. If undefined, push entire contents of source\n * @returns number of points pushed.\n */\n public pushFromGrowableXYArray(source: GrowableXYArray, sourceIndex?: number): number {\n // full array push . . .\n if (sourceIndex === undefined) {\n const numXYAdd = source.length;\n this.ensureCapacity(this.length + numXYAdd, false);\n this.copyData(source._data, numXYAdd, this.length);\n this._xyInUse += numXYAdd;\n return numXYAdd;\n }\n // single point push . . .\n if (source.isIndexValid(sourceIndex)) {\n const j = sourceIndex * 2;\n this.pushXY(source._data[j], source._data[j + 1]);\n return 1;\n }\n return 0;\n }\n\n /**\n * * Compute a point at fractional coordinate between points i and j of source\n * * push onto this array.\n */\n public pushInterpolatedFromGrowableXYArray(source: GrowableXYArray, i: number, fraction: number, j: number) {\n if (source.isIndexValid(i) && source.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = source._data;\n i = 2 * i;\n j = 2 * j;\n this.pushXY(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1]);\n }\n }\n\n /**\n * Create an array of xy points from source xyz points.\n * @param source source array of xyz\n * @param transform optional transform to apply to xyz points.\n * @param dest optional result.\n */\n public static createFromGrowableXYZArray(source: GrowableXYZArray, transform?: Transform, dest?: GrowableXYArray) {\n const numPoints = source.length;\n if (!dest)\n dest = new GrowableXYArray(numPoints);\n else {\n dest.ensureCapacity(numPoints, false);\n dest.clear();\n }\n if (transform) {\n const packedXYZ = source.float64Data();\n const nDouble = 3 * numPoints;\n let x, y, z;\n for (let i = 0; i < nDouble; i += 3) {\n x = packedXYZ[i];\n y = packedXYZ[i + 1];\n z = packedXYZ[i + 2];\n dest.pushXY(transform.multiplyComponentXYZ(0, x, y, z), transform.multiplyComponentXYZ(1, x, y, z));\n }\n } else {\n dest.pushAllXYAndZ(source);\n }\n return dest;\n }\n /**\n * Return the first point, or undefined if the array is empty.\n */\n public front(result?: Point2d): Point2d | undefined {\n if (this._xyInUse === 0) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(0, result);\n }\n /**\n * Return the last point, or undefined if the array is empty.\n */\n public back(result?: Point2d): Point2d | undefined {\n if (this._xyInUse < 1) return undefined;\n return this.getPoint2dAtUncheckedPointIndex(this._xyInUse - 1, result);\n }\n /**\n * Set the coordinates of a single point.\n * @param pointIndex index of point to set\n * @param value coordinates to set\n */\n public setAtCheckedPointIndex(pointIndex: number, value: XAndY): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = value.x;\n this._data[index + 1] = value.y;\n return true;\n }\n /**\n * Set the coordinates of a single point given as coordinates.\n * @param pointIndex index of point to set\n * @param x x coordinate\n * @param y y coordinate\n */\n public setXYAtCheckedPointIndex(pointIndex: number, x: number, y: number): boolean {\n if (!this.isIndexValid(pointIndex))\n return false;\n const index = pointIndex * 2;\n this._data[index] = x;\n this._data[index + 1] = y;\n return true;\n }\n /**\n * Copy all points into a simple array of Point3d with given z.\n */\n public getPoint3dArray(z: number = 0): Point3d[] {\n const n = 2 * this._xyInUse;\n const result = [];\n const data = this._data;\n for (let i = 0; i < n; i += 2)\n result.push(Point3d.create(data[i], data[i + 1], z));\n return result;\n }\n /** reverse the order of points. */\n public reverseInPlace() {\n const n = this.length;\n let j0, j1;\n let a;\n const data = this._data;\n for (let i0 = 0, i1 = n - 1; i0 < i1; i0++, i1--) {\n j0 = 2 * i0;\n j1 = 2 * i1;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n j0++;\n j1++;\n a = data[j0]; data[j0] = data[j1]; data[j1] = a;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public multiplyTransformInPlace(transform: Transform) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = transform.matrix.coffs;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y + x0;\n data[i + 1] = coffs[3] * x + coffs[4] * y + y0;\n }\n }\n\n /** multiply each xy (as a vector) by matrix, replace values. */\n public multiplyMatrix3dInPlace(matrix: Matrix3d) {\n const data = this._data;\n const nDouble = this.float64Length;\n const coffs = matrix.coffs;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i];\n y = data[i + 1];\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n }\n\n /** multiply each point by the transform, replace values. */\n public tryTransformInverseInPlace(transform: Transform): boolean {\n const data = this._data;\n const nDouble = this.float64Length;\n const matrix = transform.matrix;\n matrix.computeCachedInverse(true);\n const coffs = matrix.inverseCoffs;\n if (!coffs)\n return false;\n const origin = transform.origin;\n const x0 = origin.x;\n const y0 = origin.y;\n let x = 0;\n let y = 0;\n for (let i = 0; i + 1 < nDouble; i += 2) {\n x = data[i] - x0;\n y = data[i + 1] - y0;\n data[i] = coffs[0] * x + coffs[1] * y;\n data[i + 1] = coffs[3] * x + coffs[4] * y;\n }\n return true;\n }\n /** Extend a `Range2d`, optionally transforming the points. */\n public extendRange(rangeToExtend: Range2d, transform?: Transform) {\n const numDouble = this.float64Length;\n const data = this._data;\n if (transform) {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendTransformedXY(transform, data[i], data[i + 1]);\n } else {\n for (let i = 0; i + 1 < numDouble; i += 2)\n rangeToExtend.extendXY(data[i], data[i + 1]);\n\n }\n }\n /** sum the lengths of segments between points. */\n public sumLengths(): number {\n let sum = 0.0;\n const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use\n const data = this._data;\n for (let i = 0; i < n; i += 2) sum += Geometry.hypotenuseXY(\n data[i + 2] - data[i],\n data[i + 3] - data[i + 1]);\n return sum;\n }\n /**\n * Multiply each x,y by the scale factor.\n * @param factor\n */\n public scaleInPlace(factor: number) {\n if (this._data) {\n const numFloat = this.float64Length;\n for (let i = 0; i < numFloat; i++)\n this._data[i] = this._data[i] * factor;\n }\n }\n /** Compute a point at fractional coordinate between points i and j */\n public interpolate(i: number, fraction: number, j: number, result?: Point2d): Point2d | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const fraction0 = 1.0 - fraction;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Point2d.create(\n fraction0 * data[i] + fraction * data[j],\n fraction0 * data[i + 1] + fraction * data[j + 1], result);\n }\n return undefined;\n }\n\n /** Sum the signed areas of the projection to xy plane */\n public areaXY(): number {\n let area = 0.0;\n const n = 2 * this._xyInUse; // float count !!\n if (n > 4) {\n const x0 = this._data[n - 2];\n const y0 = this._data[n - 1];\n let dx1 = this._data[0] - x0;\n let dy1 = this._data[1] - y0;\n let dx2 = 0;\n let dy2 = 0;\n for (let i = 2; i < n; i += 2, dx1 = dx2, dy1 = dy2) {\n dx2 = this._data[i] - x0;\n dy2 = this._data[i + 1] - y0;\n area += Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);\n }\n }\n return 0.5 * area;\n }\n\n /** Compute a vector from index origin i to indexed target j */\n public override vectorIndexIndex(i: number, j: number, result?: Vector2d): Vector2d | undefined {\n if (!this.isIndexValid(i) || !this.isIndexValid(j))\n return undefined;\n const data = this._data;\n i = 2 * i;\n j = 2 * j;\n return Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);\n }\n\n /** Compute a vector from origin to indexed target j */\n public override vectorXAndYIndex(origin: XAndY, j: number, result?: Vector2d): Vector2d | undefined {\n if (this.isIndexValid(j)) {\n const data = this._data;\n j = 2 * j;\n return Vector2d.create(\n data[j] - origin.x,\n data[j + 1] - origin.y, result);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */\n public override crossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const i = originIndex * 2;\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - data[i], data[j + 1] - data[i + 1],\n data[k] - data[i], data[k + 1] - data[i + 1]);\n }\n return undefined;\n }\n\n /** Compute the cross product of vectors from from origin to indexed targets i and j */\n public override crossProductXAndYIndexIndex(origin: XAndY, targetAIndex: number, targetBIndex: number): number | undefined {\n if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {\n const j = targetAIndex * 2;\n const k = targetBIndex * 2;\n const data = this._data;\n return Geometry.crossProductXYXY(\n data[j] - origin.x, data[j + 1] - origin.y,\n data[k] - origin.x, data[k + 1] - origin.y);\n }\n return undefined;\n }\n\n /** Return the distance between two points in the array. */\n public distance(i: number, j: number): number | undefined {\n if (this.isIndexValid(i) && this.isIndexValid(j)) {\n const i0 = 2 * i;\n const j0 = 2 * j;\n return Geometry.hypotenuseXY(\n this._data[j0] - this._data[i0],\n this._data[j0 + 1] - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Return the distance between an array point and the input point. */\n public distanceIndexToPoint(i: number, spacePoint: Point2d): number | undefined {\n if (this.isIndexValid(i)) {\n const i0 = 2 * i;\n return Geometry.hypotenuseXY(\n spacePoint.x - this._data[i0],\n spacePoint.y - this._data[i0 + 1]);\n }\n return undefined;\n }\n /** Test for nearly equal arrays. */\n public static isAlmostEqual(dataA: GrowableXYArray | undefined, dataB: GrowableXYArray | undefined): boolean {\n if (dataA && dataB) {\n if (dataA.length !== dataB.length)\n return false;\n for (let i = 0; i < dataA.length; i++)\n if (!dataA.getPoint2dAtUncheckedPointIndex(i).isAlmostEqual(dataB.getPoint2dAtUncheckedPointIndex(i)))\n return false;\n return true;\n }\n // if both are null it is equal, otherwise unequal\n return (!dataA && !dataB);\n }\n\n /** Return an array of block indices sorted per compareLexicalBlock function */\n public sortIndicesLexical(): Uint32Array {\n const n = this._xyInUse;\n // let numCompare = 0;\n const result = new Uint32Array(n);\n for (let i = 0; i < n; i++) result[i] = i;\n result.sort(\n (blockIndexA: number, blockIndexB: number) => {\n // numCompare++;\n return this.compareLexicalBlock(blockIndexA, blockIndexB);\n });\n // console.log (n, numCompare);\n return result;\n }\n\n /** compare two blocks in simple lexical order. */\n public compareLexicalBlock(ia: number, ib: number): number {\n let ax = 0;\n let bx = 0;\n for (let i = 0; i < 2; i++) {\n ax = this._data[ia * 2 + i];\n bx = this._data[ib * 2 + i];\n if (ax > bx) return 1;\n if (ax < bx) return -1;\n }\n return ia - ib; // so original order is maintained among duplicates !!!!\n }\n\n /** Access a single double at offset within a block. This has no index checking. */\n public component(pointIndex: number, componentIndex: number): number {\n return this._data[2 * pointIndex + componentIndex];\n }\n /** Toleranced equality test */\n public isAlmostEqual(other: GrowableXYArray, tolerance: number = Geometry.smallMetricDistance): boolean {\n const numXY = this._xyInUse;\n if (other._xyInUse !== numXY)\n return false;\n const dataA = this._data;\n const dataB = other._data;\n for (let i = 0; i < 2 * numXY; i++) {\n if (Math.abs(dataA[i] - dataB[i]) > tolerance)\n return false;\n }\n return true;\n }\n}\n"]}
@@ -36,7 +36,7 @@ export declare class FacetFaceData {
36
36
  scaleDistances(distanceScale: number): void;
37
37
  /**
38
38
  * Sets the param and paramDistance range of this FacetFaceData based on the newly terminated facets that make it up.
39
- * Takes the polyface itself, the first and last indexes of the facets to be included in the face.
39
+ * Takes the polyface itself, and facetIndex range to be included in the face (facetStart <= facetIndex < facetEnd).
40
40
  * Returns true on success, false otherwise.
41
41
  */
42
42
  setParamDistanceRangeFromNewFaceData(polyface: IndexedPolyface, facetStart: number, facetEnd: number): boolean;
@@ -77,7 +77,7 @@ export class FacetFaceData {
77
77
  }
78
78
  /**
79
79
  * Sets the param and paramDistance range of this FacetFaceData based on the newly terminated facets that make it up.
80
- * Takes the polyface itself, the first and last indexes of the facets to be included in the face.
80
+ * Takes the polyface itself, and facetIndex range to be included in the face (facetStart <= facetIndex < facetEnd).
81
81
  * Returns true on success, false otherwise.
82
82
  */
83
83
  setParamDistanceRangeFromNewFaceData(polyface, facetStart, facetEnd) {